Repository navigation
feat(buddy): 支持插件贡献 MCP 连接器与 NPC - #469
Merged
shanyuhai123 merged 6 commits intoOct 28, 2026
Merged
Conversation
为什么:一项完整能力常需要技能、MCP 连接器和子代理配套,但插件清单目前只能贡献技能,连接器和子代理要用户手动到设置里添加,卸载时也不会清理。 做了什么: - 清单新增 contributes.mcpConnectors(仅 streamable-http、无凭据的 HTTPS 地址,默认关闭)与 contributes.subagents(仅 NPC,工具只能引用本包声明的连接器,文件权限默认只读),需要 API 4。 - 主进程汇总已安装插件的声明,服务进程对账:创建、更新、移除对应记录并随插件启停,不新增数据库迁移;用台账文件区分用户改动,读不出台账时不删除任何东西。 - 安装审核页列出连接器与子代理;卸载对话框提前列出用户改过、将被保留的内容。 - plugin-creator 技能补充说明与类型声明。 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- extensionCapabilities 不再引用 buddySettings:清单 schema 会被插件 SDK 导出在纯 Node 下加载,无法解析它的无扩展名导入,改为在本文件内保留一份与之一致的工具选择 schema。 - 卸载对话框的类型标签改为 MCP / 子代理,插件术语测试遍历嵌套标签,同步测试只断言子代理台账为空。 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ex/plugin-capability-contributions # Conflicts: # apps/buddy/service/resources/skills/plugin-creator/SKILL.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景与关联 / Context and related issue
contributes.skills)。连接器和子代理要用户手动到设置里添加,卸载插件时也不会清理。本 PR 让插件清单可以声明它们,随插件安装、启停和卸载。主要改动 / Changes
contributes.mcpConnectors(仅streamable-http,地址必须是不带账号密码的 HTTPS;deferred默认true,credential为none/bearer/oauth)和contributes.subagents(仅kind: "npc";文件权限inherit/read_only,默认只读)。需要 API 4;ID 不能重复;子代理的工具只能引用同一个包声明的连接器;不能使用内置子代理 ID。ExtensionService.capabilityContributions),服务进程的ExtensionCapabilitySync对账——创建、更新、移除对应记录,并随插件启停;不新增数据库迁移。连接器是默认关闭、没有凭据的记录;子代理是带ext.<插件 ID>.前缀的伙伴记录,并加入默认伙伴的可委派列表。extension-capabilities.json)记录“哪些记录是插件创建的、安装时的摘要”,据此区分用户改动——卸载只删未改动的,改过的(改了提示词、填了凭据、改了地址等)保留。台账读不出来按“空”处理,即什么都不删;读取描述符失败时整轮放弃,不会把失败当成“全部卸载”。references/mcp-and-subagents.md,并在api.d.ts补充类型。验证 / Verification
ExtensionService的描述符发布与变更通知、安装审核页和卸载对话框的展示。本 PR 是把下游实现重新切到upstream/master上的版本,按仓库约定没有在本地重装依赖和跑测试,请以本 PR 的 CI 为准。兼容与风险 / Compatibility and risks
capabilityImpact管理动作与extensions.capabilities.*内部 RPC,仅主进程与服务进程之间使用。extensionManifest.ts、extensionCapabilities.ts)和对账里“不接管用户记录、不删用户改动”的判断(ExtensionCapabilitySync.ts)。extension-capabilities.json后,插件创建的记录都会按“用户自己的”保留,不会被删除。界面变更 / UI changes
安装审核页新增“MCP 连接”“子代理”两节,卸载对话框可能出现“你修改过的内容会保留”一节;仅在包声明了对应内容时出现,没有截图。
🤖 Generated with Claude Code