Repository navigation
contract: 同步到 Lithe@bb61147,Node SDK 支持 litheVcs(Lithe #827) - #1
Merged
Merged
Conversation
… P1) - 契约副本同步到 #1430 合入后的 preview(18345cc):README 与 schema 增加 API 3 的 vcsProviders,新增 fixture vcs-provider.plugin.json - Node SDK:backend.vcs(id, handlers, traits) 按声明的处理函数协商 litheVcs 能力; VCS 处理函数里的 context.run 自动发出 lithe/vcs/execution 执行报告;导出 VCS_ERRORS、isVcsId - 新增示例 sdk/node/examples/sample-vcs(修订存在 JSON 文件里的玩具 VCS)与单元测试 vcs.test.mjs - 端到端:sdk/e2e/plugin_sdk/vcs.rs 经真实 Core 会话跑通示例的协商和全部 11 种操作 - 这部分原在 Lithe #1430,#1442 把 SDK 移出主仓库后迁到这里
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.
背景
主仓库 1lck/Lithe-IDEA#1430 已合入 preview(
18345cc),在 Rust Core 里实现了插件 VCS Provider 的底层(API 3vcsProviders、litheVcs协商、lsp.vcsRequest等)。这个 PR 原本还包含 Node SDK 的改动,但 #1442 已经把 SDK 移出主仓库,所以这部分改动迁到这里提交。改动
契约副本
node scripts/contract.mjs sync同步,没有手工改动;锁定到 #1441 合入后的 previewbb61147(契约内容与 #1430 合入时的18345cc相同)。contract/v1/README.md、plugin-manifest.schema.json增加 API 3 的vcsProviders能力;新增 fixturevcs-provider.plugin.json。Node SDK
backend.vcs(id, handlers, traits):声明 VCS Provider 的处理函数,按声明了哪些处理函数来协商litheVcs能力。status、baseContent、checkin、rollback是必需的,其余 7 种可选;git是保留 ID。context.run会自动发出lithe/vcs/execution执行报告,只带命令行、退出码、耗时和截断后的 stderr,不带 stdout;可以用{ report: false }关掉。VCS_ERRORS、isVcsId;protocol.mjs新增VCS_VERSION、VCS_OPERATIONS等常量;补齐类型声明index.d.ts。shared/contracts/vcs-provider-v1.md,不在契约副本范围内,所以写成绝对链接。示例与测试
sdk/node/examples/sample-vcs:一个把修订存在 JSON 文件里的玩具 VCS,不需要任何 VCS 客户端。sdk/node/test/vcs.test.mjs:能力协商、ID 规则、声明校验、错误码映射、执行报告。原测试读主仓库的shared/fixtures/vcs/model-v1.json,这个文件不在契约副本里,因此改成在测试里写出那 11 种能力,并注明来源;和 Core 是否一致由端到端场景兜底。sdk/e2e/plugin_sdk/vcs.rs:经真实 Core 会话跑通示例的协商和全部 11 种操作。验证
node --test sdk/node/test/*.test.mjs:43 项通过node --test scripts/*.test.mjs:13 项通过node scripts/contract.mjs verify:28 个文件与bb61147一致node scripts/sdk-e2e.mjs --ref bb61147…:Java 示例、Node 构建示例、Node VCS 示例三个端到端场景全部通过