Repository navigation
feat(core)!: 删除 Java/Maven/JDT 特判与契约专属死命令,run/start 临时文件支持 base64 - #23
Merged
Merged
Conversation
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
run-start.json 增加三条拒绝用例:同时给出 contents 和 base64、两者都不给、 base64 不是标准编码。Core 的 fixture 回放测试改为传入临时目录, 让这些用例走到逐项校验,而不是停在缺少临时目录。
xiaoyumuxi
marked this pull request as ready for review
November 13, 2026 16:02
This was referenced Nov 13, 2026
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。
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.
关联
shared/里的副本由 #1853 删除。hostIntegration的不可达实现。@argfile,通过本 PR 新增的temporaryFilesbase64 形式交给宿主。lithe-core原有的 clippy 问题(1 个 error、88 个 warning)已补充到 [Bug] rustc 1.96 下 lithe-git-host、lithe-core-rules 出现 3 条新 clippy 告警 1lck/Lithe-IDEA#1789 的评论里。这些问题不是本 PR 引入的。这个 PR 做什么
把 Core 里所有按 Java、Maven、JDT 名字写死的代码、资源、依赖和契约删掉:
宿主以后按原样启动插件给出的命令行。必须由插件决定编码的文件,比如 Windows 上按系统 ANSI 代码页读取的 JDK 参数文件,通过
run/start的temporaryFiles以字节形式交给宿主。破坏性变更
execution.planLaunchCommand。Viva 桌面端desktop/internal/core/launch_plan.go和pluginservice/runs.go目前还在调用,需要配套桌面端 PR 一起删除,见 refactor(desktop): 删除 Core 的 Java 启动规划,run/start 临时文件支持 base64 字节 1lck/Lithe-IDEA#1859。lithe_core_lsp_provider_catalog_json,同时删除include/lithe_core.h中的声明。桌面端没有调用。protocol/command.rs本来就没有这些命令,所以不会改变任何运行行为:java.codeVision、java.jdtCacheRetention、java.jdtWorkspaceFingerprint、java.navigationMarkers、java.prepareLaunch、java.resolveNavigation、java.runMarkers、java.sourceDefinition、java.structure、java.workspacePolicylsp.jdtWorkspaceKey、lsp.updateMavenConfigurationmaven.dependencies、maven.dependencyPlan、maven.diagnostics、maven.launchPlan、maven.scan、maven.testResultsmybatis.index、spring.index、runConfig.selectJava、build.languageImport、agent.attachments.retentionPlanmaven-launch-context-v1、maven-portable-configuration-v1、run-configuration-v1。lithe_maven_inspect、lithe_maven_configure、lithe_maven_execute、lithe_maven_reload,构建相关操作统一走lithe_build_*。${field.<id>.major}改为取版本号的第一个数字分量:1.8.0_412得到1,不再特判成8。工具自己的版本编号应由工具定义的version.pattern在进入模板前换算。现有官方插件只在minimumVersion: 17的 JDK 字段上使用它,不受影响。toolchain-local-v1)的条目改成不透明的字符串记录,不再点名home、executable、javaHome。旧文档仍然能通过校验;新增一条限制:每个条目最多 16 个属性。hostIntegration去掉只含jdt和maven的枚举,明确为保留字段:任何 ID 都会以plugin.integration.unsupported拒绝。Core 的拒绝行为、错误码和现有拒绝 fixture 都不变。删除清单
rust/lithe-core/src/execution/launch_plan.rs@argfile规划,即execution.planLaunchCommandrust/lithe-core/src/protocol/command.rs、runtime/dispatcher.rs、execution/mod.rsrust/lithe-core/src/lsp/languages/catalog.rsrust/lithe-core/resources/lsp/language-providers.jsonrust/lithe-core/src/runtime/ffi.rs、include/lithe_core.hlithe_core_lsp_provider_catalog_jsonrust/lithe-core/Cargo.toml、rust/Cargo.locktree-sitter、tree-sitter-javarust/lithe-core/src/lsp/tests.rsrust/lithe-ide-host/src/catalog.rslithe_maven_*工具定义;IDE API fixturecalls.json、host-tool-exposure.json同步更新rust/contracts/rust-core-api.md、application-boundary.md、ide-api/v1.md中 Java/Maven/JDT 专属的章节rust/fixtures/lsp/java-*、jdt-*、maven-profile-events、project-preparationfixturerust/fixtures/maven/、java/、spring/、mybatis/rust/fixtures/execution/rust/fixtures/run-configuration/hybrid-spring-vue.json用中立的hybrid-service-web.json替换;build-provider.json、editor-save.json去掉 Java 内容rust/fixtures/projects/lithe-spring-boot-git-graph/rust/fixtures/editor/basic-file-highlighting-v1.jsonrust/fixtures/modules/built-in-v1.jsonexecution.maven条目。整个文件的去留见 #1858rust/fixtures/build-project-options/maven改成makeshared/plugins/backend.md、build-systems.md、languages.md、manifest.md、api-catalog.md、构建工具集成指南:去掉 Java/Maven/JDT 专属说明,示例改用中立的工具新增
run/start的temporaryFiles每项可以写成以下两种形式之一:{name, contents}:UTF-8 文本,和原来一样;{name, base64}:标准 base64 编码的字节,宿主按原样写入,不转码。contents和base64同时给出或都不给,都会被拒绝。原有限制不变:最多 4 个文件,每个不超过 4 MiB,名字不超过 64 字节;参数里写${temporaryFile:<name>}引用文件。实现在
build/run_start.rs,测试在src/tests/plugin_run_debug.rs。契约 README、backend.md和 API 总表已同步更新。契约 fixture
shared/plugins/contract/v1/fixtures/run/run-start.json增加三条拒绝用例:contents和base64同时给出、两者都不给、base64不是标准编码。plugin_run_debug.rs的 fixture 回放测试改为传入临时目录,让这些用例走到逐项校验,而不是停在“缺少临时目录”。桌面端回放同一份 fixture,也会覆盖这三条用例。已在插件协议更新记录的“宿主方法(按 API 编号)”索引和 2026-11-13 时间线中登记:API-23,
pluginAPIVersion0 内的补充。保留
git.commitState、git.rollbackPlan、github.pullRequestCheckoutPlan、runConfig.projectToolchain、keymap.evaluateContext。lithe-core/src/community和社区相关的 fixture 不在本 PR 处理。hostIntegration的解析和拒绝路径保持不变。不可达的实现由 #1857 清理。验证
cargo fmt --all --check:通过。scripts/rust-core/verify-rust-core-comments.sh:通过。剩下的 2 个 warning 来自本 PR 没有改动的文件:lithe-git-host/src/configuration.rs的forward_slash_path,以及plugins/capabilities.rs的私有文档链接。node shared/plugins/scripts/verify-docs.mjs:通过。node --test shared/plugins/scripts/*.test.mjs:2 passed / 0 failed。cargo test --workspace:全部通过,其中lithe-core单元测试 1743 passed / 0 failed。node shared/plugins/scripts/sdk-e2e.mjs:Java 2、Node 3、Rust 2,全部通过。下面的命令名在全仓库搜索 0 命中:23 个契约专属命令名、
execution.planLaunchCommand、lithe_core_lsp_provider_catalog_json、language-providers.json、tree-sitter。在 Lithe-IDEA 组织 16 个插件仓库的默认分支(2026-11-13 拉取)中检查过:
hostIntegration;lithe-plugin-java 里出现的
java.*、spring.index、mybatis.index、runConfig.selectJava、execution.planLaunchCommand,是它从 Core 移植后自己注册的同名插件函数,放在crates/java-domain,不依赖 Core 的实现。后续
桌面端配套 PR:refactor(desktop): 删除 Core 的 Java 启动规划,run/start 临时文件支持 base64 字节 1lck/Lithe-IDEA#1859
desktop/internal/core/launch_plan.go、pluginservice/runargs.go、argfile_encoding_*.go,以及runs.go中的 planLaunch 调用;base64临时文件;PINNED_CORE_REVISION升到本 PR。合并顺序:本 PR → 桌面端 PR → Java 插件发布 argfile 版本(lithe-plugin-java#7)。在 Java 插件发版之前,Windows 上依赖很多的 Java 项目会因为命令行超长而启动失败。
[Feature] 应用契约与 fixture 在本仓库 shared/ 与 Core rust/ 各存一份且已分叉:以 Core 为唯一来源,桌面测试读取所链接的 Core 检出 1lck/Lithe-IDEA#1853:删除 Lithe-IDEA
shared/中的契约和 fixture 副本。