Repository navigation
feat(plugins)!: 插件 API 单一基线(版本归 0),插件契约、文档与 SDK 并入 Core - #17
Merged
Merged
Conversation
插件契约 shared/contracts/plugins/v1 原地重写为只保留每个 API 最完整的形态: - pluginAPIVersion、清单 schemaVersion、全部能力版本、协议版本和文档版本都归 0; 版本字段和协商保留,以后从 0 往上迭代。requires 必填,宿主只提供 0。 - serverProcess 和 executableResolution 并入基础契约,声明它们会被拒绝为 plugin.api.unsupported。 - 删除宿主内置运行时(checkRuntimeVersion)和生成器 runtime 字段;工具一律经 requiresTools 声明,未声明时报 plugin.runtime.undeclared。tool 字段暴露 .version、.major、.executable。 - 语言服务器启动计划始终带 sessionPolicy;runtimeRequirements 统一为 kind tool。 - 构建文档(litheBuildModel、litheDependencies、litheTestResults、 litheTestDiscovery、litheBuildConfiguration、litheConfigurationEdit、 diagnostics、modelInputs)、索引、native-ui、bridge、VCS、editorActions、 后端计划版本都为 0。 - 删除旧格式插件清单测试和 fixture(tests/plugins.rs、official-v1、 language-support-v1、runtime-versions),fixture 去掉 -v2 后缀。 - invalid-manifests 的 expectedField 由测试校验。
- shared/fixtures → rust/fixtures,shared/logging → rust/logging, shared/contracts 下的非插件契约 → rust/contracts;四个 crate 的 include_str!、测试路径和文档引用一起改。 - 插件契约 shared/contracts/plugins/v1 → shared/plugins/contract/v1。 - macos/Tests/LitheTests/Fixtures/GitGraph 的 issue410 对照数据移到 rust/fixtures/git/graph-issue410,删除 macos/ 目录。 - 拆仓时没跟过来的 Lithe-IDEA 文件(根 README、i18n README、Agent Note、 native-ui-lab)改为指向 Lithe-IDEA preview 的绝对链接。
xiaoyumuxi
marked this pull request as ready for review
November 11, 2026 11:50
- shared/plugins/README.md 为插件开发入口;guides/、reference/(API 总表、能力与版本、协议更新记录、domains/ 领域参考)按基线 0 重写,去掉版本对照和宿主平台现状说法
- sdk/{node,java,rust} 三个官方后端 SDK 与示例并入;5 个用 Node/Java 启动的示例补上 requiresTools
- sdk/e2e 经 lithe-core 的 plugin-sdk-e2e feature 编译;新增 runtime-tools.plugin.json 代替运行时插件,host_launch_arguments 按宿主流程调 toolchains.instantiateLaunch 与 toolchains.checkVersion,替换已删除的 checkRuntimeVersion
- scripts/verify-docs.mjs(schema $id、相对链接、拒绝指向 lithe-plugin-docs 的文件链接)及测试,scripts/sdk-e2e.mjs
- .github/workflows:plugins-verify 与按 sdk-*-v* 标签发布三个 SDK
- 契约 README 删除 Windows 映射与宿主现状小节,修复失效锚点和死链,去掉不存在的 build-host-integration fixture;SDK README 的宿主服务缺口改为链接能力页的唯一清单
- 根目录 README 说明目录分工;.gitignore 忽略 SDK 构建产物;cargo fmt 处理路径缩短后的格式差异
16 of 22 tasks
This was referenced Nov 12, 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.
关联
PINNED_CORE_REVISION到本 PR 的 commit)背景
插件 API 过去每个能力各有 1–12 不等的版本,宿主、清单、SDK 和文档都要处理“某能力到第几版才有某字段”。这些旧版本没有需要兼容的已发布插件,留着只会增加理解和实现成本。同时,契约在三个地方各有一份:Lithe-IDEA 的
shared/contracts/plugins/、Core 的shared/plugins/contract/、lithe-plugin-docs 的副本,SDK 也不和协议在同一个仓库里验证。本 PR 把每个能力收敛到当前最完整的那一版,并从 0 重新编号;版本字段和协商机制都保留,以后新增功能时从 0 往上加。插件契约、开发资料和 SDK 合并到本仓库的
shared/plugins/,作为唯一来源。改动
1. 插件 API 单一基线(83f853d)
SUPPORTED_PLUGIN_API_VERSIONS = [0];18 个能力在capabilities.rs中都只支持[0],每个能力只保留最高、最完整的那一版行为。schemaVersion、市场索引schemaVersion、原生 UI 文档schemaVersion、litheBuildModel等后端协议的version、plugins.editorActions.decode的version、网页桥window.lithe.version全部为 0。serverProcess、executableResolution不再是能力(requires里出现时按plugin.manifest.invalid拒绝,fixture 已覆盖)。invalid-manifests.json现为 189 个拒绝用例。2. 目录整理(ca610c2)
shared/只保留plugins/;Core 自己的接口契约、测试数据和日志事件目录移到rust/contracts/、rust/fixtures/、rust/logging/。scripts/rust-core/保留,它是 develop-lithe Skill 要求的 Core 注释门禁(模块文档、英文注释、unsafe安全说明、导出项 Rustdoc)。3. 并入 lithe-plugin-docs(本次新增提交)
shared/plugins/README.md:插件开发入口(中英)。shared/plugins/guides/:语言服务器、后端工作区、构建工具、原生构建流程、调试适配器、原生终端、插件日志等指南,按基线 0 重写,去掉版本对照表和 macOS/Windows 宿主现状说法。shared/plugins/reference/:API 总表(api-catalog.md)、能力与版本(capabilities-and-versions.md)、协议更新记录(protocol-changelog.md,登记本 PR)、domains/下 15 个领域参考页。shared/plugins/sdk/{node,java,rust}:三个官方后端 SDK 与示例,版本为 Node 0.5.0、Java 0.5.0、Rust 0.4.0;sdk/e2e/为 SDK 端到端场景,经rust/lithe-core/Cargo.toml的plugin-sdk-e2efeature 编译。requiresTools(基线 0 要求列出启动用到的每个工具,否则plugin.runtime.undeclared)。sdk/e2e/runtime-tools.plugin.json(node、java 工具定义,代替运行时插件),共用的host_launch_arguments调toolchains.instantiateLaunch展开启动模板、探测版本,再用toolchains.checkVersion校验最低版本;替换了已删除的plugins.declarative.checkRuntimeVersion和 plan 里不再存在的versionArguments。构建、原生构建、VCS 三个场景都用它。shared/plugins/scripts/:verify-docs.mjs(schema$id、相对链接、拒绝指向 lithe-plugin-docs 的文件链接)及其测试,sdk-e2e.mjs(构建三个 SDK 的示例并跑端到端测试)。.github/workflows/:plugins-verify.yml(文档检查与 SDK 测试)、plugins-release-{node,java,rust}-sdk.yml(按sdk-*-v*标签发布)。vcs-provider-v1.md状态块同样改写;修复失效锚点和指向 Lithe-IDEA 平台目录的死链;构建系统一节删掉早已不存在的build-host-integrationfixture,改为说明hostIntegration来源没有 fixture。capabilities-and-versions.md的唯一清单。README.md:说明目录分工与常用命令;.gitignore忽略 SDK 构建产物。shared/contracts/rust-core-api.md和shared/fixtures/git/execution-events-v1.json已按本分支的新位置落到rust/contracts/、rust/fixtures/。cargo fmt:ca610c2缩短 fixture 路径后,include_str!等调用能放进一行,相关文件重新格式化(只有空白变化)。不在本 PR 范围内
plugin-index.schema.jsonURL:对外可见,由维护者执行。sdk-*-v*打标签发布新版 SDK:合入后由维护者执行。验证
cargo test --manifest-path rust/Cargo.toml --workspacebash scripts/rust-core/verify-rust-core-comments.shcargo fmt --all -- --checknode shared/plugins/scripts/sdk-e2e.mjsnode shared/plugins/scripts/verify-docs.mjs、node --test shared/plugins/scripts/verify-docs.test.mjs7a71cd6)