Skip to content

🔧 同步 sctl 协议:ScriptCat 多实例握手上下文与 SCRIPTCAT_* 错误码 - #1820

Merged
CodFrm merged 1 commit into
mainfrom
chore/sctl-protocol-scriptcat-instances
Nov 3, 2026
Merged

CodFrm merged 1 commit into
mainfrom
chore/sctl-protocol-scriptcat-instances

Conversation

@CodFrm

@CodFrm CodFrm commented Nov 3, 2026

Copy link
Copy Markdown
Member

Checklist / 检查清单

  • Fixes mentioned issues / 修复已提及的问题
  • Code reviewed by human / 代码通过人工检查
  • Changes tested / 已完成测试

N/A — 修复已提及的问题:本 PR 只同步协议生成文件,不修复问题。

背景

scriptscat/sctl#16 让 sctl daemon 同时接入多个 ScriptCat 实例,在 protocol.json 中新增了四个 ScriptCat 实例握手上下文和三个错误码,均标注给 ScriptCat 使用,因此生成给 ScriptCat 的 TypeScript 发生变化。sctl CI 要求生成结果与固定 ScriptCat 版本中的副本逐字节一致(SCRIPTCAT_REF 指向本 PR 的提交 bc6f6bb4),本仓库的一致性测试要求 BRIDGE_ERROR_CODES 与生成的错误码列表完全一致。

本次改动

  • generated/protocol.generated.ts:make protocol-sync-scriptcat 的输出,新增 scriptcatSessionExt / scriptcatSessionDaemon / scriptcatPairExt / scriptcatPairDaemon 上下文与 SCRIPTCAT_OFFLINE / SCRIPTCAT_NOT_FOUND / SCRIPTCAT_AMBIGUOUS。validators.generated.ts 无变化。
  • types.ts:BRIDGE_ERROR_CODES 增加这三个码。

不改变任何运行时行为:新常量当前没有被使用,后续 PR 让 ScriptCat 声明实例身份时才会用到。

已知限制

若本 PR 以 squash 方式合并,生成文件内容不变,sctl 侧需把 SCRIPTCAT_REF 改指向合并后的提交。

关联

验证

基于 79f2a99f(main)…bc6f6bb4,git diff origin/main...origin/chore/sctl-protocol-scriptcat-instances 只改上述两个文件。

  • pnpm vitest run --no-coverage src/app/service/service_worker/external_access/:8 个文件 139 个测试通过(含 protocol.conformance.test.ts)。
  • tsc --noEmit 通过;eslint、prettier 通过。
  • 在 sctl 侧复现 CI 镜像检查:生成文件经 prettier 3.6.2 按本仓库 .prettierrc 格式化后,与本 PR 的两个文件 cmp 一致。

@CodFrm
CodFrm merged commit d993ae5 into main Nov 3, 2026
11 checks passed
@CodFrm
CodFrm deleted the chore/sctl-protocol-scriptcat-instances branch November 3, 2026 03:55
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