Repository navigation
feat(agents): 资源库 MCP 服务器补齐字段并存变量值,Agent 中的同项由 Core 分组,粘贴 JSON 由 Core 解析 - #264
Draft
xiaoyumuxi wants to merge 1 commit into
Draft
xiaoyumuxi wants to merge 1 commit into
xiaoyumuxi wants to merge 1 commit into
Conversation
xiaoyumuxi
force-pushed
the
feat/agent-library-mcp-fields
branch
from
December 3, 2026 15:29
65e7c07 to
8e43376
Compare
This was referenced Dec 3, 2026
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.
关联
改动
都是 API-45、
agents能力 0 内的补充,不升版本。一、插件声明 CLI 能保存什么
agents[].configuration.mcpServers {transports?, fields?},需要read:transports:CLI 支持的连接方式,取stdio、http、sse,不写为全部;fields:CLI 能保存的额外字段,取environment、headers、enabled、disabledTools、startupTimeout、callTimeout,不写为都不保存。二、资源库服务器的新字段
environment、headers({name, value?});note、enabled、pausedAgents(关掉时被拿掉的 Agent,打开时放回);disabledTools、startupTimeoutSeconds、callTimeoutSeconds;icon:PNG、JPEG、GIF 或 WebP,解码后不超过 32 KiB,Core 不联网取。library.json,Core 总以仅所有者可读写的方式写入;agentLibrary.read只回答{name, valueSet};save里不带值的变量沿用原值,改名的服务器用renamedFrom给出原名;transportUnsupported);fieldUnsupported),每个变量都要有值(valueMissing);enabled: false写进能保存开关的 Agent,其他 Agent 不写(serverOff);stateDetails.unsupportedFields里列出。put实际写入的内容,只比 Agent 能保存的字段;query也匹配服务器备注。三、插件函数参数
configuration.read报告的服务器新增environment、headers(带值)、enabled、disabledTools、startupTimeoutSeconds、callTimeoutSeconds。原来只报名字的environmentNames、headerNames仍可用,两者不能同时给。configuration.edit的put服务器只带插件声明的字段;声明了environment、headers时带值,声明了enabled时总带开关。四、宿主命令
agentLibrary.parseServers {text}:解析用户粘贴的 JSON,回答{servers, problems},不保存。"名称": {…}成员;mcpServers、servers、context_servers、mcp下的服务器表、单个服务器、服务器数组和名称到服务器的对象;textTooLarge。agentLibrary.apply新增{category: "mcpServers", op: "import", name, revision}:把 Agent 的服务器连同值放进资源库,不改 Agent 的文件,回答{changed, revision}。资源库已有同名报serverExists,满了报libraryFull。agentLibrary.read新增:directory:资源库目录,给宿主的“资源库文件夹”按钮;stateDetails:每项按 Agent 的状态原因(reason、unsupportedFields);found:只在 Agent 里的服务器、Hooks、技能,按项归组,标出各副本是第几种写法、和资源库那份是否不同、能否导入、从哪个 Agent 导入或为什么不能;mcpServerSupport。library.json会超过 Core 能读回的 8 MiB 时,以libraryTooLarge拒绝。五、错误码与日志
agentLibrary.transportUnsupported、fieldUnsupported、valueMissing、serverOff、serverExists、libraryFull、textTooLarge、libraryTooLarge。六、文档
agents.plugin.json、invalid-manifests.json;rust/contracts/rust-core-api.md;domains/agents.md(中英);agents0 行;CONTRIBUTING.md里本机做 Windows clippy 的命令补上ZSTD_SYS_USE_PKG_CONFIG=1 PKG_CONFIG_ALLOW_CROSS=1。原来只设 SQLite 的变量,插件市场经zstdcrate 依赖的zstd-sys在 macOS 上编不过。对宿主的影响
desktop/internal/agents的LibraryServer等结构要加上新字段,save要带renamedFrom。否则桌面端整份save时,新字段和变量会被当成删除。桌面端接入在 1lck/Lithe-IDEA 另开 PR,同时升PINNED_CORE_REVISION。parseServers;found,删掉桌面端自己按名字和 Hook 字段合并的代码;directory;configuration.mcpServers;read报告值、开关、禁用的工具和超时;edit写入这些字段。验证
本机 macOS arm64,基于 main 5364983(含 #262、#263):
cargo test --locked -p lithe-agent-runtime -p lithe-plugin-agents -p lithe-corecargo clippy --locked --workspace --all-targets -- -D warnings、cargo fmt --all -- --checkLIBSQLITE3_SYS_USE_PKG_CONFIG=1 ZSTD_SYS_USE_PKG_CONFIG=1 PKG_CONFIG_ALLOW_CROSS=1 cargo clippy --target x86_64-pc-windows-msvc -p lithe-agent-runtime -p lithe-plugin-agents -p lithe-core --all-targetsverify-docs.mjsgenerate-log-events.mjs --checkverify-rust-core-comments.shverify-platform-tests.mjssdk-e2e.mjs新测试(
tests/library/servers.rs等)覆盖:stateDetails里报告;library.json能读、保存后仅所有者可读写;mcpServers的默认值和非法声明。