Skip to content

feat(core)!: #1799 删除 MCP 配置与库命令 - #19

Merged
1lck merged 1 commit into
mainfrom
feat/1799-remove-mcp-module
Nov 12, 2026
Merged

1lck merged 1 commit into
mainfrom
feat/1799-remove-mcp-module

Conversation

@1lck

@1lck 1lck commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

关联

  • Refs Lithe-IDEA/Lithe-IDEA#1799:Agent 对话移除后,MCP 管理失去全部消费者;MCP 后续会重新设计,本次先整块删除。

这个 PR 做什么

Go 客户端对 mcp.* 命令零引用,旧 SwiftUI/Tauri 客户端也已从 Lithe-IDEA 移除,lithe-core 的 MCP 子系统(配置解析、Registry、库规划、工具策略、命令行、格式保留编辑)在 Core 里不再有调用方。

破坏性变更

删除 9 个命令:mcp.parseConfiguration、mcp.parseRegistry、mcp.featuredRegistry、mcp.planWrite、mcp.toolPolicy、mcp.commandLine、mcp.librarySnapshot、mcp.validateDraft、mcp.batchPlan。

删除清单

位置 内容
rust/lithe-core/src/mcp/ 14 个文件:配置解析、Registry、库与批量规划、工具策略、命令行、toml_edit 子模块与测试
rust/lithe-core/src/protocol/command.rs 9 个 Mcp* 变体与命令名映射
rust/lithe-core/src/runtime/dispatcher.rs 9 个分发分支
rust/fixtures/mcp/ featured-setup-v1.json、library-v1.json、tools-v1.json
rust/contracts/mcp-registry-page.json 可移植 Registry 样例响应
rust/contracts/rust-core-api.md ### MCP configuration 章节(该章节还残留上一轮已删除的 mcp.probe 说明,一并清掉)

保留

  • rust/lithe-ide-host 的 lithe-mcp 二进制与 rust/fixtures/ide-api/mcp-protocol.json:这是 Lithe 对外提供的 IDE API MCP 服务端,不依赖 lithe-core 的 mcp 模块,与本次删除无关。
  • toml_edit crate 依赖保留(toolchain/pin_sources.rs 仍在使用),ignore 依赖保留(toolchain/pin_sources.rs 使用)。

验证

  • cargo fmt --all --check:通过
  • cargo check -p lithe-core --lib:通过(仅剩仓库既有 warning)
  • cargo test -p lithe-core --lib:1739 passed / 0 failed
  • scripts/rust-core/verify-rust-core-comments.sh:通过

后续

  • 合并后需要提升 Lithe-IDEA 的 PINNED_CORE_REVISION。
  • Lithe-IDEA 侧还要同步删除 shared/fixtures/mcp、shared/contracts/mcp-registry-page.json、两个 MCP 功能矩阵条目、仅旧客户端使用的 MCP 词条,并归档 MCP 服务器库 Note。

桌面端不做 Agent 对话后,MCP 管理已经没有调用方:Go 客户端对 mcp.* 命令零引用,
旧 SwiftUI/Tauri 客户端也已从 Lithe-IDEA 移除。MCP 后续会重新设计,本次先把整块
删掉:

- 删除 lithe-core 的 mcp 模块(配置解析、Registry、库规划、工具策略、命令行、
  格式保留编辑等 14 个文件)。
- 删除 mcp.* 命令:parseConfiguration、parseRegistry、featuredRegistry、
  planWrite、toolPolicy、commandLine、librarySnapshot、validateDraft、batchPlan。
- 删除 rust/fixtures/mcp 与 rust/contracts/mcp-registry-page.json,并从
  rust-core-api.md 删除 MCP configuration 章节;该章节还残留上一轮已删除的
  mcp.probe 说明,一并清掉。

保留 IDE 面向的 MCP 服务端:lithe-ide-host 的 lithe-mcp 二进制与
rust/fixtures/ide-api/mcp-protocol.json 不动,它们不依赖 lithe-core 的 mcp 模块。

验证:cargo fmt --all --check;cargo check -p lithe-core --lib;
cargo test -p lithe-core --lib(1739 通过);注释校验脚本通过。

Co-Authored-By: AtomCode (deepseek-v4.1-flash) <noreply@atomgit.com>
@1lck
1lck marked this pull request as ready for review November 12, 2026 03:30
@1lck
1lck merged commit 47c9859 into main Nov 12, 2026
5 checks passed
xiaoyumuxi added a commit that referenced this pull request Nov 13, 2026
- rust-core-api.md 补回 #19 误删的命令总表(375 条,每个 CoreCommand::parse 接受的命令一行)
  和 AI configuration 章节;Build systems 表补上 build.resolveStoredOptions、build.editStoredOption。
- protocol::command 新增测试:命令表与解析器逐条比对,增删改命令必须同一次提交更新表格。
- 删除 rust/fixtures/i18n(归 Lithe-IDEA i18n 生成器所有,迁到 shared/i18n/fixtures)
  和无人读取的 rust/fixtures/phpunit-project。

Refs 1lck/Lithe-IDEA#1853
xiaoyumuxi added a commit that referenced this pull request Nov 13, 2026
* feat(core)!: 删除 Java/Maven/JDT 特判与契约专属死命令,run/start 临时文件支持 base64

Core 对 Java 等语言零依赖、零特判,语言和工具专属知识全部由插件注入。

- 删除 execution.planLaunchCommand(JDK @argfile 规划)及 execution/launch_plan.rs
- 删除 LSP 内置语言目录:lsp/languages/catalog.rs、resources/lsp/language-providers.json、
  FFI lithe_core_lsp_provider_catalog_json 与头文件声明
- 删除 tree-sitter、tree-sitter-java 依赖
- 删除 lithe-ide-host 目录里的 Java/Maven 工具
- 删除只存在于契约、fixture、测试中的 23 个命令名(java.*、lsp.jdt*、maven.*、
  mybatis.index、spring.index、runConfig.selectJava、build.languageImport、
  agent.attachments.retentionPlan)及其 fixture
- 删除 maven-launch-context-v1、maven-portable-configuration-v1、run-configuration-v1 schema
- run/start 的 temporaryFiles 增加 {name, base64} 字节文件,宿主原样写入
- 模板 ${field.<id>.major} 取第一个数字分量,不再特判 1.x
- 旧版工具链 pin 的条目改为不透明字符串记录,不再点名 javaHome
- 契约文档和测试 fixture 去掉 Java/Maven/JDT 专属内容

Refs 1lck/Lithe-IDEA#1856, 1lck/Lithe-IDEA#1857, 1lck/Lithe-IDEA#1858, 1lck/Lithe-IDEA#1853

* docs(plugins): 协议更新记录补上 #23

* test(run): 契约 fixture 覆盖 temporaryFiles base64 的拒绝用例

run-start.json 增加三条拒绝用例:同时给出 contents 和 base64、两者都不给、
base64 不是标准编码。Core 的 fixture 回放测试改为传入临时目录,
让这些用例走到逐项校验,而不是停在缺少临时目录。

* docs(contracts): Core 作为应用契约唯一真源,补回命令表与 AI 配置章节

- rust-core-api.md 补回 #19 误删的命令总表(375 条,每个 CoreCommand::parse 接受的命令一行)
  和 AI configuration 章节;Build systems 表补上 build.resolveStoredOptions、build.editStoredOption。
- protocol::command 新增测试:命令表与解析器逐条比对,增删改命令必须同一次提交更新表格。
- 删除 rust/fixtures/i18n(归 Lithe-IDEA i18n 生成器所有,迁到 shared/i18n/fixtures)
  和无人读取的 rust/fixtures/phpunit-project。

Refs 1lck/Lithe-IDEA#1853

* refactor(ai): AI 命令拆成独立 crate lithe-ai

- rust/lithe-core/src/ai 整体移到 rust/lithe-ai:提交信息生成、PR 描述、内联编辑、
  AI CLI 配置解析。新 crate 只依赖 serde、serde_json、toml、url,不做文件、网络和凭据访问。
- lithe-ai 提供 COMMANDS / execute / execute_json 和 AiError,形状与 lithe-core-rules 一致;
  lithe-core 的 9 个 ai.* 分发分支改为调用 lithe_ai::execute,AiError 一一映射到 CoreError。
- git.commitMessageContext 仍在 lithe-core(要跑 git),改用 lithe_ai 的敏感路径与预算规则。
- lithe_core::ai 改为 re-export lithe_ai,原有路径不变。命令名、C ABI、JSON 和错误码不变。
- 注释规范检查覆盖 lithe-ai;新增测试确认每个 lithe-ai 命令都经 Core 路由到 lithe-ai。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant