@coda-console/plugin-check 0.8.15 → 0.8.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/check/agent.mjs +187 -1
- package/check/coda/builtin.json +25 -25
- package/check/coda/components/session-config/commands.mjs +3 -3
- package/check/coda/contract.json +6 -6
- package/check/coda/domain/agent-protocol.mjs +8 -0
- package/check/coda/domain/session-env.mjs +3 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@ plugins/grok-bot/ Grok Bot:每个云端 Bot 的原生主会话是一条
|
|
|
16
16
|
plugins/opencode/ OpenCode:在运行机的 opencode acp 与 Coda 之间转发,送入所选模型服务,模型按来源分组
|
|
17
17
|
plugins/codex-accounts/ Codex 多账号:管理登录、自动续期与账号选择,接管资源「Codex」
|
|
18
18
|
plugins/cursor/ Cursor:直接启动运行机的 cursor-agent acp
|
|
19
|
+
plugins/antigravity/ Antigravity:转发运行机的 agy acp,不把附加目录交给它,加「全部放行」模式,资源页登录
|
|
19
20
|
plugins/git/ Git 源与快照:本机仓库 provider、运行关联的工作树/提交快照、临时 ref 回收与只读 smart HTTP v2
|
|
20
21
|
plugins/host/ 宿主资源:发布本机 coda/executor@1 执行环境,执行 execute 并写 coda/run@1;Xcode 构建、Apple 模拟器与项目要求排队的命令共用这台机器的一组名额(组 host、持锁执行 run-held、host-sim),资源「构建名额」
|
|
21
22
|
plugins/magpie/ Magpie:把本机的 Magpie 网关作为模型服务提供给 Pi 等插件,安装时装好 Magpie 并让网关常驻
|
|
@@ -64,7 +65,7 @@ Coda 插件页的「商店」列出 Coda 自带的插件,以及 npm 上 `@coda
|
|
|
64
65
|
| `claude` | `@agentclientprotocol/sdk` 1.4.0、`@anthropic-ai/claude-agent-sdk` 0.3.312(平台二进制是 SDK 自己的可选依赖) | — |
|
|
65
66
|
| `codex-accounts` | `proper-lockfile` 4.1.2;用依赖插件 `codex` 的 Codex CLI | 无;依赖 `codex` 插件 |
|
|
66
67
|
| `kimi` | 无 | Kimi CLI 2.1.1 及以上(缺失或更旧时设置动作装入口核对过的 2.1.1,更新的不动;资源页上可从 Coda 安装、登录) |
|
|
67
|
-
| `grok` | 无 | Grok CLI 1.0.52
|
|
68
|
+
| `grok` | 无 | Grok CLI 1.0.52 及以上(`sessions delete` 核对于 1.0.77,更旧的 CLI 没有它时删除会话回错误;设置动作安装或升级;资源页上可从 Coda 安装、登录) |
|
|
68
69
|
| `opencode` | `jsonc-parser` 3.3.1 | 已登录的 OpenCode CLI 2.1.4 及以上(设置动作安装或升级,OpenCode 1 升到 2) |
|
|
69
70
|
|
|
70
71
|
带依赖的插件各有自己的 `package-lock.json`(`node_modules` 不提交);Coda 在插件的版本目录里 `npm ci` 装它们,
|
|
@@ -153,7 +154,7 @@ OpenCode 的后台 shell 命令由随插件带的原生观察器 `runtime/server
|
|
|
153
154
|
|
|
154
155
|
Kimi、Grok、OpenCode、Cursor 带设置动作(`contributes.setup`,`scripts/setup.mjs`),用户安装或更新插件时 Coda 在每台机器上运行:
|
|
155
156
|
CLI 不在或运行不了就用它自己的安装程序安装,低于插件要求的版本就升级,较新的版本保留。要求的版本:Kimi 2.1.1(入口读得懂的会话文件布局)、
|
|
156
|
-
Grok 1.0.52
|
|
157
|
+
Grok 1.0.52(审批模式通知核对过的版本;`sessions delete` 核对于 1.0.77)、OpenCode 2.1.4(入口核对过的版本;OpenCode 1 遇到模型服务的 `Retry-After` 会一声不响地等,多久都等,见下文。用 OpenCode 2 自己的安装程序 `https://opencode.ai/v2/install`,装在同一个 `~/.opencode/bin`,OpenCode 1 的会话由它按原 ID 接过去);Cursor 没有已知的下限,能运行就行(它自己会更新)。
|
|
157
158
|
Codex 与 Claude 的 CLI、SDK 是插件的 npm 依赖,不需要设置动作。
|
|
158
159
|
|
|
159
160
|
### 模型服务
|
|
@@ -516,7 +517,7 @@ gh workflow run publish.yml --repo coda-console/coda-plugins --ref main
|
|
|
516
517
|
逐包配置 GitHub 仓库 `coda-console/coda-plugins`、流程文件 `publish.yml`、允许 `npm publish`、不指定 environment。
|
|
517
518
|
已有可信发布配置会显示出来供维护者核对,不自动覆盖。首次 2FA 验证可选择五分钟内不再询问,包与包之间停两秒以免限流。
|
|
518
519
|
配置后立即发起上述 GitHub 工作流:npm 要求新配置在两天内完成第一次成功发布,由 CI 发布仓库里的实际版本并验证信任关系。
|
|
519
|
-
|
|
520
|
+
npm 包设置里的 Publishing access 保持 npm 的默认设置,不另行收紧;CI 经 OIDC 发布,不配置 npm 写令牌。
|
|
520
521
|
|
|
521
522
|
## 契约检查
|
|
522
523
|
|
|
@@ -537,7 +538,7 @@ npx github:coda-console/coda-plugins#<提交> <插件目录>
|
|
|
537
538
|
| 级 | 要不要登录 | 查什么 |
|
|
538
539
|
| --- | --- | --- |
|
|
539
540
|
| 清单(总是) | 不要 | `package.json` 的通用键对协议 schema 校验(`manifestProblem`),再照 Coda 读成插件(`readPlugin`:登记的贡献点各按自己的 schema 查、读,ID、设置名在 ID 之下);其余写给别的插件扩展点的键,要有 Coda 自带的或旁边依赖的插件声明这个类型。资源类型与旧的面板按资源插件给扩展点 `resources`、`panels` 带的 schema 查。`.coda/workflows/` 里的每个流程(含能力)按协议的流程方言读(`workflowProblem`):不是 BPMN、认不出的 `coda:` 属性或元素、没有的动作或动作不接受的参数都算失败。另有只提醒的:分类、版本、图标页面太小、旧的 Agent ID `claude` |
|
|
540
|
-
| 握手(默认) | 不要 | `sh -c` 启动 `command`(环境是 Coda 的 `pluginEnv` 给的:`CODA_NODE`、`CODA_PLUGIN_PATH`、临时的 `CODA_PLUGIN_STATE`、设置默认值的 `CODA_PLUGIN_SETTINGS`;依赖的插件在旁边(同一个父目录里同名的目录)时 `CODA_PLUGIN_DEPENDENCIES` 给它的目录,Coda 自带的不在这里、不给),发与 Coda 相同的 `initialize`,要求 `protocolVersion` 为 1;能力声明的 `_meta.coda` 与顶层插话声明交协议 schema 校验;检查会话指令能力(`sessionCapabilities.systemPrompt`,没声明也通过,由 Coda 在第一轮送入);声明了的 `session/new` 带会话指令,给出会话与当前模型,配置选项的 `_meta.coda.default` 交协议校验;错误里声明的执行失败也查协议 schema,回 -32000 记为未登录、跳过后面的检查(不算失败);像 Coda 一样对进程组发 SIGTERM,5 秒内要退出(超过 0.8 秒提醒);另起一个进程,关掉标准输入后 5
|
|
541
|
+
| 握手(默认) | 不要 | `sh -c` 启动 `command`(环境是 Coda 的 `pluginEnv` 给的:`CODA_NODE`、`CODA_PLUGIN_PATH`、临时的 `CODA_PLUGIN_STATE`、设置默认值的 `CODA_PLUGIN_SETTINGS`;依赖的插件在旁边(同一个父目录里同名的目录)时 `CODA_PLUGIN_DEPENDENCIES` 给它的目录,Coda 自带的不在这里、不给),发与 Coda 相同的 `initialize`,要求 `protocolVersion` 为 1;能力声明的 `_meta.coda` 与顶层插话声明交协议 schema 校验;检查会话指令能力(`sessionCapabilities.systemPrompt`,没声明也通过,由 Coda 在第一轮送入);声明了的 `session/new` 带会话指令,给出会话与当前模型,配置选项的 `_meta.coda.default` 交协议校验;错误里声明的执行失败也查协议 schema,回 -32000 记为未登录、跳过后面的检查(不算失败);像 Coda 一样对进程组发 SIGTERM,5 秒内要退出(超过 0.8 秒提醒);另起一个进程,关掉标准输入后 5 秒内不退出只提醒;声明了配置探测(`_meta.coda.probe`)的,再另起进程发带探测标记的 `session/new`(要给非空的 `sessionId`;标记不是 `true` 的要回 -32602):逐个模型用 `category: model` 的配置项切换(只有 `models` 的用 `session/set_model`),每次要返回该模型完整的配置、思考档位在它自己的选项里并能设回(标了 `_meta.coda.default` 的设回那一项),不存在的模型与配置项要报错,`session/prompt` 要回 -32602,声明了 `session/close` 的另开一个虚拟会话关掉,要回 `{}`、之后它的请求回 -32002,探测期间不干活;断线后新进程的 `session/load`、`session/resume` 要回 -32002,`session/list`(带探测的 `cwd`,沿 `nextCursor` 翻完;每页、每个会话条目合 ACP schema,`sessionId` 非空,`nextCursor` 只能是字符串或 null;重复的游标或超过 100 页算失败)不列出这个虚拟会话,没声明的跳过。资源类型(或旧的面板)由 Coda 资源插件的 `Panels` 读一次(30 秒),输出合格式 |
|
|
541
542
|
| 一轮(`--live`) | 要 | 声明了会话指令的经 `systemPrompt` 送入,没声明的在第一轮前加契约的 `instructionsBlock`;第一轮问会话指令里的检查词(一个随机词),回复里要有它;再发一轮提示词(默认「只回复 ok」)收到 `stopReason`;每条 `session/update` 先过 ACP SDK 的 schema,工具审核、用量与默认选项标记再过协议 schema;`_coda/wait` 用协议的 `agentMessageProblem` 校验形状,另查会话归属、登记与终态(子 Agent 不带 `childSessionId`、定时不带 `at` 只提醒);扩展形状问题按现有规则报告协议返回的「位置:说明」;远端绑定码请求先查协议参数再查本会话归属;执行失败的形状交协议校验,重试预算照 Coda 策略;审批与提问一律回拒绝,在一轮之外发来的算失败;再发一轮并 `session/cancel`,30 秒内要结束,读到取消后还在做事或拖过 5 秒才答复却不回 `cancelled` 算失败(见下);有自主轮次的也取消一次;声明插话的,答复用协议的 `agentResultProblem` 校验,一轮结束后插话要回 `promptRequired` 且不自己另开一轮,一轮进行中插话要回 `injected` 或 `promptRequired`(`injected` 的那一轮照常回 `stopReason`);声明 `loadSession` 的,新开进程 `session/load`(声明了的同样带会话指令)要成功,随后在新进程里再跑一轮也要收到 `stopReason` |
|
|
542
543
|
|
|
543
544
|
**取消后的 `stopReason` 怎么判**:检查发 `session/cancel` 时紧跟一个只会得到 -32601 的探测请求(`_codaCheck/barrier`)。Agent 按顺序读,
|
package/check/agent.mjs
CHANGED
|
@@ -84,7 +84,7 @@ class Session {
|
|
|
84
84
|
this.say = say; this.limits = limits; this.instructions = instructions;
|
|
85
85
|
this.waits = new Waits({ fail: (rule, message) => this.at.fail(rule, message), warn: (rule, message) => this.at.warn(rule, message) });
|
|
86
86
|
this.turn = null; this.autonomous = null; this.autonomousTurns = 0; this.loading = true; this.pendingWaits = [];
|
|
87
|
-
this.kinds = new Map(); this.malformed = 0; this.said = new Set(); this.listeners = new Set(); this.idleWork = [];
|
|
87
|
+
this.kinds = new Map(); this.malformed = 0; this.said = new Set(); this.listeners = new Set(); this.idleWork = []; this.probeWork = [];
|
|
88
88
|
// The session's working copy, and the plugin's state directory, which Coda makes for it.
|
|
89
89
|
this.cwd = join(base, 'work');
|
|
90
90
|
for (const dir of [this.cwd, join(base, 'state')]) mkdirSync(dir, { recursive: true });
|
|
@@ -113,6 +113,7 @@ class Session {
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
receive(m) {
|
|
116
|
+
if (this.probing) this.probeRecord(m);
|
|
116
117
|
if ('id' in m) return this.request(m);
|
|
117
118
|
if (m.method === 'session/update') return this.update(m.params);
|
|
118
119
|
if (m.method === '_coda/wait') {
|
|
@@ -123,6 +124,17 @@ class Session {
|
|
|
123
124
|
if (m.method === '$/cancel_request') return;
|
|
124
125
|
this.once(`notify:${m.method}`, () => this.at.info('notify.unknown', `Agent 发了 Coda 不认识的通知 ${m.method}:Coda 忽略`));
|
|
125
126
|
}
|
|
127
|
+
// A probe does nothing (docs/agent-protocol.md「配置探测 · 通知」): whatever else it says, whichever way the rest of the
|
|
128
|
+
// session takes it (opening, a turn, autonomous work, another session), is work.
|
|
129
|
+
probeRecord(m) {
|
|
130
|
+
const permission = m.method === 'session/request_permission';
|
|
131
|
+
if ('id' in m) this.probeWork.push(permission ? '审批' : m.method === 'elicitation/create' ? '提问' : m.method);
|
|
132
|
+
else if (m.method === '_coda/wait') this.probeWork.push(m.method);
|
|
133
|
+
else if (m.method === 'session/update') {
|
|
134
|
+
const kind = m.params?.update?.sessionUpdate;
|
|
135
|
+
if (!BOOKKEEPING.has(kind)) this.probeWork.push(kind ?? m.method);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
126
138
|
update(params) {
|
|
127
139
|
const parsed = schemas.zSessionNotification.safeParse(params);
|
|
128
140
|
if (!parsed.success) {
|
|
@@ -390,6 +402,178 @@ async function inputEnd({ agent, checked, base, limits, say }) {
|
|
|
390
402
|
} finally { proc.kill(); }
|
|
391
403
|
}
|
|
392
404
|
|
|
405
|
+
// docs/agent-protocol.md「配置探测」: an agent that declares `_meta.coda.probe` is asked, as Coda's catalog probe asks, for
|
|
406
|
+
// `session/new` marked `_meta.coda.probe: true`, and opens a session of that connection alone: each model through the
|
|
407
|
+
// `category: model` option (`session/set_model` for an agent with `models` alone), every answer that model's whole options,
|
|
408
|
+
// its thinking level set back as Coda sets the default; a bad model refused; no prompt; nothing done or asked of the user;
|
|
409
|
+
// and, the connection gone, nothing to load, resume or list. Its own process, apart from the handshake's real session.
|
|
410
|
+
// Coda's own `supportsProbe` is not in the copy of its contract yet: the declaration is read here as the protocol says.
|
|
411
|
+
const supportsProbe = init => { const probe = init?.agentCapabilities?._meta?.coda?.probe; return !!probe && typeof probe === 'object' && !Array.isArray(probe); };
|
|
412
|
+
// An `initialize` answer the probe goes on from, read as the handshake reads one: no error, a result ACP's schema takes.
|
|
413
|
+
function initializeProblem({ error, result }) {
|
|
414
|
+
if (error) return `initialize 回了错误 ${error.code}:${error.message}`;
|
|
415
|
+
const parsed = schemas.zInitializeResponse.safeParse(result);
|
|
416
|
+
return parsed.success ? null : `initialize 的结果不合 ACP schema:${explain(parsed.error)}`;
|
|
417
|
+
}
|
|
418
|
+
const leaves = option => (Array.isArray(option?.options) ? option.options : []).flatMap(o => Array.isArray(o?.options) ? o.options : [o]);
|
|
419
|
+
const choices = option => leaves(option).map(o => o?.value);
|
|
420
|
+
// What the protocol answers in a probe: a malformed mark, or a prompt to a probe session (-32602); a session ID it does not
|
|
421
|
+
// know, or no longer (-32002).
|
|
422
|
+
const INVALID_PARAMS = -32602, NOT_FOUND = -32002;
|
|
423
|
+
// How many pages of `session/list` the session is looked for in after the probe: past that the list is taken to go on forever.
|
|
424
|
+
const LIST_PAGES = 100;
|
|
425
|
+
|
|
426
|
+
async function probeModels(ask, sessionId, opened, say) {
|
|
427
|
+
// An option it does not have is not taken (「配置」: what it does not support is an error, not sent on to a real session).
|
|
428
|
+
const unknown = await ask('session/set_config_option', { sessionId, configId: 'coda-check-no-such-option', value: 'coda-check' });
|
|
429
|
+
if (!unknown.error) return say.fail('probe.config', '设不存在的配置项也成功了:不支持的请求必须报错,不能转给真实会话');
|
|
430
|
+
const model = opened.configOptions?.find?.(o => o?.category === 'model' && o.type === 'select');
|
|
431
|
+
if (!model) {
|
|
432
|
+
const models = opened.models?.availableModels;
|
|
433
|
+
if (!Array.isArray(models) || !models.length) return say.fail('probe.config', '探测会话既没有 category 为 model 的配置项,也没有 models:Coda 读不到模型目录');
|
|
434
|
+
for (const { modelId } of models) {
|
|
435
|
+
const m = await ask('session/set_model', { sessionId, modelId });
|
|
436
|
+
if (m.error) return say.fail('probe.config', `session/set_model ${modelId} 回了错误 ${m.error.code}:${m.error.message}:只报 models 却不能切换,不满足配置探测`);
|
|
437
|
+
if (!m.result || typeof m.result !== 'object' || Array.isArray(m.result)) return say.fail('probe.config', `session/set_model ${modelId} 的答复没有 result 对象(${JSON.stringify(m.result)}):不知道切换成没成`);
|
|
438
|
+
}
|
|
439
|
+
return say.pass('probe.config', `逐个模型 session/set_model ${models.length} 个`);
|
|
440
|
+
}
|
|
441
|
+
const seen = [];
|
|
442
|
+
for (const value of choices(model)) {
|
|
443
|
+
const m = await ask('session/set_config_option', { sessionId, configId: model.id, value });
|
|
444
|
+
if (m.error) return say.fail('probe.config', `切到模型 ${value}(session/set_config_option ${model.id})回了错误 ${m.error.code}:${m.error.message}`);
|
|
445
|
+
const parsed = schemas.zSetSessionConfigOptionResponse.safeParse(m.result);
|
|
446
|
+
if (!parsed.success) return say.fail('probe.config', `切到模型 ${value} 的结果不合 ACP schema:${explain(parsed.error)}`);
|
|
447
|
+
const problems = configProblems(m.result.configOptions, 'session/set_config_option result.configOptions');
|
|
448
|
+
if (problems.length) return say.fail('probe.config', problems[0]);
|
|
449
|
+
const options = m.result.configOptions, now = options.find(o => o?.id === model.id), level = options.find(o => o?.category === 'thought_level' && o.type === 'select');
|
|
450
|
+
if (now?.currentValue !== value) return say.fail('probe.config', `切到模型 ${value} 后返回的配置里当前模型是 ${now?.currentValue}:要返回这个模型完整的配置`);
|
|
451
|
+
if (level && !choices(level).includes(level.currentValue)) return say.fail('probe.config', `模型 ${value} 的思考档位 ${level.currentValue} 不在它自己的选项里:不能留着上一个模型的档位`);
|
|
452
|
+
if (level) {
|
|
453
|
+
// Back to the level the agent marks its default, as Coda sets it; with none marked, the one it has.
|
|
454
|
+
const fallback = leaves(level).find(o => o?._meta?.coda?.default === true)?.value ?? level.currentValue;
|
|
455
|
+
const back = await ask('session/set_config_option', { sessionId, configId: level.id, value: fallback });
|
|
456
|
+
if (back.error) return say.fail('probe.config', `模型 ${value} 设思考档位 ${fallback} 回了错误 ${back.error.code}:${back.error.message}:Coda 读完一个模型会把档位设回默认`);
|
|
457
|
+
const set = schemas.zSetSessionConfigOptionResponse.safeParse(back.result);
|
|
458
|
+
if (!set.success) return say.fail('probe.config', `模型 ${value} 设思考档位 ${fallback} 的结果不合 ACP schema:${explain(set.error)}`);
|
|
459
|
+
const now = back.result.configOptions.find(o => o?.id === level.id)?.currentValue;
|
|
460
|
+
if (now !== fallback) return say.fail('probe.config', `模型 ${value} 设思考档位 ${fallback} 后返回的档位是 ${now}:设回默认没有生效`);
|
|
461
|
+
}
|
|
462
|
+
seen.push(`${value}(${level ? choices(level).join('/') : '无档位'})`);
|
|
463
|
+
}
|
|
464
|
+
const bad = await ask('session/set_config_option', { sessionId, configId: model.id, value: 'coda-check-no-such-model' });
|
|
465
|
+
if (!bad.error) return say.fail('probe.config', '切到不存在的模型也成功了:不合法的值要回错误');
|
|
466
|
+
say.pass('probe.config', `逐个模型切换 ${seen.length} 个,每次返回该模型完整的配置:${seen.join(',')}`);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
async function probe({ agent, checked, base, limits, say, instructions }) {
|
|
470
|
+
const scopes = { handshake: say, live: say }, init = { protocolVersion: ACP_PROTOCOL_VERSION, clientCapabilities: clientCapabilities() };
|
|
471
|
+
const session = new Session({ agent, checked, base, say: scopes, limits, instructions });
|
|
472
|
+
const ask = (method, params, proc = session.proc) => proc.request(method, params, { timeout: limits.open });
|
|
473
|
+
session.probing = true;
|
|
474
|
+
let sessionId, rule = 'probe.new';
|
|
475
|
+
try {
|
|
476
|
+
let reply = await ask('initialize', init);
|
|
477
|
+
const initFailure = initializeProblem(reply);
|
|
478
|
+
if (initFailure) return say.fail(rule, initFailure);
|
|
479
|
+
const closes = reply.result.agentCapabilities?.sessionCapabilities?.close != null;
|
|
480
|
+
reply = await ask('session/new', { cwd: session.cwd, mcpServers: [], _meta: { coda: { probe: true } } });
|
|
481
|
+
if (reply.error?.code === SIGNED_OUT) return say.skip('probe.signed-out', '带探测标记的 session/new 回了 -32000(未登录):配置探测跳过');
|
|
482
|
+
if (reply.error) return say.fail(rule, `带探测标记的 session/new 回了错误 ${reply.error.code}:${reply.error.message}(Coda 不改发普通 session/new,这次读不到目录)`);
|
|
483
|
+
const parsed = schemas.zNewSessionResponse.safeParse(reply.result);
|
|
484
|
+
if (!parsed.success) return say.fail(rule, `带探测标记的 session/new 的结果不合 ACP schema:${explain(parsed.error)}`);
|
|
485
|
+
const problems = configProblems(reply.result.configOptions, 'session/new result.configOptions'), model = currentModel(reply.result);
|
|
486
|
+
if (problems.length) return say.fail(rule, problems[0]);
|
|
487
|
+
if (typeof model !== 'string') return say.fail(rule, '带探测标记的 session/new 没报当前模型:Coda 读不到目录');
|
|
488
|
+
if (!reply.result.sessionId) return say.fail(rule, '带探测标记的 session/new 给了空的 sessionId:虚拟会话要有非空的 ID');
|
|
489
|
+
sessionId = reply.result.sessionId;
|
|
490
|
+
session.sessionId = session.waits.sessionId = sessionId; session.loading = false;
|
|
491
|
+
say.pass(rule, `带探测标记的 session/new:虚拟会话 ${sessionId},当前模型 ${model}`);
|
|
492
|
+
// A mark that is not `true` is refused, not dropped for an ordinary session (「请求」).
|
|
493
|
+
rule = 'probe.mark';
|
|
494
|
+
const marked = await ask('session/new', { cwd: session.cwd, mcpServers: [], _meta: { coda: { probe: 'true' } } });
|
|
495
|
+
if (marked.error?.code === INVALID_PARAMS) say.pass(rule, `探测标记写成字符串 "true" 的 session/new 回 -32602:${marked.error.message}`);
|
|
496
|
+
else say.fail(rule, `探测标记写成字符串 "true" 的 session/new ${marked.error ? `回了 ${marked.error.code}(${marked.error.message})`
|
|
497
|
+
: `开了会话 ${marked.result?.sessionId}`}:标记格式不对要回 -32602,不能去掉标记当普通会话`);
|
|
498
|
+
rule = 'probe.config';
|
|
499
|
+
await probeModels(ask, sessionId, reply.result, say);
|
|
500
|
+
rule = 'probe.prompt';
|
|
501
|
+
const turn = await ask('session/prompt', { sessionId, prompt: [{ type: 'text', text: CHECK_QUESTION }] });
|
|
502
|
+
if (turn.error?.code === INVALID_PARAMS) say.pass(rule, `虚拟会话的 session/prompt 回 -32602:${turn.error.message}`);
|
|
503
|
+
else say.fail(rule, `虚拟会话的 session/prompt ${turn.error ? `回了 ${turn.error.code}(${turn.error.message})` : `被接受了(stopReason ${turn.result?.stopReason})`}:配置探测会话不执行 prompt,要回 -32602`);
|
|
504
|
+
// Closed, it is gone: what is asked of it then is of a session it no longer knows (「错误与收尾」). Another probe session is
|
|
505
|
+
// closed, so that the first goes only with the connection, as it must without a close.
|
|
506
|
+
if (closes) {
|
|
507
|
+
rule = 'probe.close';
|
|
508
|
+
session.loading = true;
|
|
509
|
+
const other = await ask('session/new', { cwd: session.cwd, mcpServers: [], _meta: { coda: { probe: true } } }), closing = other.result?.sessionId;
|
|
510
|
+
session.loading = false;
|
|
511
|
+
if (other.error || !closing) say.fail(rule, `为查 session/close 另开的虚拟会话没开成(${other.error ? `${other.error.code}:${other.error.message}` : '没有 sessionId'})`);
|
|
512
|
+
else {
|
|
513
|
+
session.waits.children.add(closing);
|
|
514
|
+
const closed = await ask('session/close', { sessionId: closing }), parsed = closed.error ? null : schemas.zCloseSessionResponse.safeParse(closed.result);
|
|
515
|
+
if (closed.error) say.fail(rule, `虚拟会话的 session/close 回了错误 ${closed.error.code}:${closed.error.message}:声明了 close 就要释放虚拟会话并回 {}`);
|
|
516
|
+
else if (!parsed.success) say.fail(rule, `虚拟会话的 session/close 的结果不合 ACP schema:${explain(parsed.error)}`);
|
|
517
|
+
else {
|
|
518
|
+
const after = await ask('session/prompt', { sessionId: closing, prompt: [{ type: 'text', text: CHECK_QUESTION }] });
|
|
519
|
+
if (after.error?.code === NOT_FOUND) say.pass(rule, `另开的虚拟会话 ${closing} session/close 回 {},之后它的请求回 -32002`);
|
|
520
|
+
else say.fail(rule, `session/close 之后对虚拟会话 ${closing} 发 session/prompt ${after.error ? `回了 ${after.error.code}(${after.error.message})` : '被接受了'}:已失效的 sessionId 要回 -32002`);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
} catch (e) { return say.fail(rule, `${rule === 'probe.new' ? '带探测标记的 session/new' : '探测'}失败:${e.message}`); }
|
|
525
|
+
finally {
|
|
526
|
+
await session.proc.terminate(limits.exit); session.proc.kill();
|
|
527
|
+
// Whichever way the probe ended (a signed-out answer too), what was done while it ran counts.
|
|
528
|
+
if (session.probeWork.length) say.fail('probe.quiet', `探测期间 Agent 发了执行类的 session/update、请求或 _coda/wait(${[...new Set(session.probeWork)].join('、')}):探测不执行任何东西,不登记活动`);
|
|
529
|
+
}
|
|
530
|
+
// The connection is gone: another one has nothing of the session.
|
|
531
|
+
const again = new Session({ agent, checked, base, say: scopes, limits, instructions }), asked = [];
|
|
532
|
+
try {
|
|
533
|
+
const reply = await ask('initialize', init, again.proc), initFailure = initializeProblem(reply);
|
|
534
|
+
// An initialize that did not come back says nothing of what the new connection would resume.
|
|
535
|
+
if (initFailure) return say.fail('probe.resume', `断线后新进程的 ${initFailure}:查不了虚拟会话能不能恢复`);
|
|
536
|
+
const caps = reply.result.agentCapabilities ?? {};
|
|
537
|
+
const tries = [caps.loadSession === true && 'session/load', caps.sessionCapabilities?.resume != null && 'session/resume'].filter(Boolean);
|
|
538
|
+
for (const method of tries) {
|
|
539
|
+
asked.push(method);
|
|
540
|
+
const { error } = await ask(method, { sessionId, cwd: again.cwd, mcpServers: [] }, again.proc);
|
|
541
|
+
if (!error) return say.fail('probe.resume', `断线后新进程 ${method} 接上了虚拟会话 ${sessionId}:虚拟会话不能恢复`);
|
|
542
|
+
if (error.code !== NOT_FOUND) return say.fail('probe.resume', `断线后新进程 ${method} 虚拟会话 ${sessionId} 回了 ${error.code}(${error.message}):已失效的 sessionId 要回 -32002`);
|
|
543
|
+
}
|
|
544
|
+
if (caps.sessionCapabilities?.list != null) {
|
|
545
|
+
// Every page of the probe's cwd, as ACP pages it (`cursor`, `nextCursor`): the session may be on any of them.
|
|
546
|
+
const cursors = new Set();
|
|
547
|
+
for (let page = 1, cursor; ; page++) {
|
|
548
|
+
const { result, error } = await ask('session/list', { cwd: session.cwd, ...(cursor !== undefined && { cursor }) }, again.proc);
|
|
549
|
+
const at = page > 1 ? `第 ${page} 页` : '';
|
|
550
|
+
// A list that did not come back says nothing of whether the session was kept.
|
|
551
|
+
if (error) return say.fail('probe.resume', `断线后 session/list ${at}回了错误 ${error.code}:${error.message}:查不了虚拟会话是否留在历史里`);
|
|
552
|
+
// ACP's parser takes a `sessions` that is not a list, or has an entry it cannot read, for none, and drops a `nextCursor`
|
|
553
|
+
// that is not a string: the page is read as it came.
|
|
554
|
+
const parsed = schemas.zListSessionsResponse.safeParse(result);
|
|
555
|
+
if (!parsed.success) return say.fail('probe.resume', `断线后 session/list ${at}的答复不合 ACP schema:${explain(parsed.error)}:查不了虚拟会话是否留在历史里`);
|
|
556
|
+
if (!Array.isArray(result.sessions)) return say.fail('probe.resume', `断线后 session/list ${at}的答复没有 sessions 数组(${JSON.stringify(result.sessions)}):查不了虚拟会话是否留在历史里`);
|
|
557
|
+
for (const [i, entry] of result.sessions.entries()) {
|
|
558
|
+
const info = schemas.zSessionInfo.safeParse(entry);
|
|
559
|
+
if (!info.success || !entry.sessionId) return say.fail('probe.resume', `断线后 session/list ${at}的 sessions[${i}] ${info.success ? 'sessionId 是空的' : `不合 ACP schema:${explain(info.error)}`}:查不了虚拟会话是否留在历史里`);
|
|
560
|
+
}
|
|
561
|
+
if (result.sessions.some(s => s.sessionId === sessionId)) return say.fail('probe.resume', `断线后 session/list ${at}列出了虚拟会话 ${sessionId}`);
|
|
562
|
+
if (result.nextCursor != null && typeof result.nextCursor !== 'string') return say.fail('probe.resume', `断线后 session/list ${at}的 nextCursor 不是字符串(${JSON.stringify(result.nextCursor)}):查不了后面的页`);
|
|
563
|
+
cursor = result.nextCursor ?? undefined;
|
|
564
|
+
if (cursor === undefined) break;
|
|
565
|
+
if (cursors.has(cursor)) return say.fail('probe.resume', `断线后 session/list 第 ${page} 页又给了用过的 nextCursor ${cursor}:翻页不会结束,查不完虚拟会话是否留在历史里`);
|
|
566
|
+
if (page === LIST_PAGES) return say.fail('probe.resume', `断线后 session/list 翻了 ${LIST_PAGES} 页还有 nextCursor:查不完虚拟会话是否留在历史里`);
|
|
567
|
+
cursors.add(cursor);
|
|
568
|
+
}
|
|
569
|
+
asked.push(`session/list(${cursors.size + 1} 页)`);
|
|
570
|
+
}
|
|
571
|
+
if (asked.length) say.pass('probe.resume', `断线后 ${asked.join('、')} 都不接受、不列出虚拟会话`);
|
|
572
|
+
else say.skip('probe.resume', '没声明 loadSession、resume、list:没有恢复的路');
|
|
573
|
+
} catch (e) { say.fail('probe.resume', `断线后再连失败:${e.message}`); }
|
|
574
|
+
finally { again.proc.kill(); }
|
|
575
|
+
}
|
|
576
|
+
|
|
393
577
|
// The first turn asks for the word in the session instructions (docs/agent-protocol.md「会话指令」): they are to be in the
|
|
394
578
|
// agent's context before it, whether its own system prompt took them or they went in front of the user's input.
|
|
395
579
|
async function instructions(session, word, limits, say) {
|
|
@@ -465,6 +649,8 @@ export async function checkAgent({ agent, checked, live: running = false, prompt
|
|
|
465
649
|
else scopes.live.skip('live.skipped', '一轮要 --live(会真的发一条提示词,可能要登录、花额度)');
|
|
466
650
|
await session.finish(scopes.handshake);
|
|
467
651
|
if (opened !== 'failed') await inputEnd({ agent, checked, base, limits, say: scopes.handshake });
|
|
652
|
+
if (opened === 'ok' && supportsProbe(session.init)) await probe({ agent, checked, base, limits, say: scopes.handshake, instructions });
|
|
653
|
+
else if (opened === 'ok') scopes.handshake.skip('probe.skipped', '没声明配置探测(_meta.coda.probe):Coda 读模型目录时开普通会话');
|
|
468
654
|
if (opened !== 'ok' || !running) return;
|
|
469
655
|
if (!session.canLoad) { scopes.live.skip('live.load', '没声明 loadSession:Coda 不会要求恢复,session/load 不查'); return; }
|
|
470
656
|
const again = new Session({ agent, checked, base, say: scopes, limits, instructions });
|
package/check/coda/builtin.json
CHANGED
|
@@ -404,7 +404,7 @@
|
|
|
404
404
|
"id": "guide",
|
|
405
405
|
"displayName": "Coda 使用指南",
|
|
406
406
|
"description": "让 Agent 会回答 Coda 怎么用",
|
|
407
|
-
"version": "1.0.
|
|
407
|
+
"version": "1.0.16",
|
|
408
408
|
"category": "工作流程",
|
|
409
409
|
"icon": {
|
|
410
410
|
"symbol": "book.fill",
|
|
@@ -441,7 +441,7 @@
|
|
|
441
441
|
"id": "maintenance",
|
|
442
442
|
"displayName": "维护",
|
|
443
443
|
"description": "定期清理旧记录和构建产物",
|
|
444
|
-
"version": "1.
|
|
444
|
+
"version": "1.1.0",
|
|
445
445
|
"category": "工作流程",
|
|
446
446
|
"icon": {
|
|
447
447
|
"symbol": "wrench.adjustable.fill",
|
|
@@ -480,8 +480,8 @@
|
|
|
480
480
|
"maintenance.archivedGrace": {
|
|
481
481
|
"type": "string",
|
|
482
482
|
"format": "duration",
|
|
483
|
-
"description": "
|
|
484
|
-
"title": "
|
|
483
|
+
"description": "会话(随它的根会话)归档满这么久,就删掉它的密钥文件、人机验证截图、批准执行命令的输出,以及它的 Agent 的临时目录(`CODA_SESSION_TMP`;会话还有进程在就等下一次);期间取消归档就保留。实际删除发生在这之后的下一次维护。ISO 8601 时长,如 PT10M。",
|
|
484
|
+
"title": "归档后多久删掉会话的密钥、命令输出与临时目录",
|
|
485
485
|
"order": 6,
|
|
486
486
|
"default": "PT10M"
|
|
487
487
|
},
|
|
@@ -514,7 +514,7 @@
|
|
|
514
514
|
"id": "resources",
|
|
515
515
|
"displayName": "资源",
|
|
516
516
|
"description": "各台电脑的账号、额度与负载",
|
|
517
|
-
"version": "2.4.
|
|
517
|
+
"version": "2.4.2",
|
|
518
518
|
"category": "机器与资源",
|
|
519
519
|
"icon": {
|
|
520
520
|
"symbol": "gauge.with.dots.needle.67percent",
|
|
@@ -585,7 +585,7 @@
|
|
|
585
585
|
"$ref": "common.json#/$defs/command"
|
|
586
586
|
},
|
|
587
587
|
"kind": {
|
|
588
|
-
"description": "
|
|
588
|
+
"description": "种类名:声明后这类资源成为可引用种类,读数由这台电脑写成后端目录库里的记录;小写字母、数字和「-」,全空间唯一",
|
|
589
589
|
"type": "string",
|
|
590
590
|
"maxLength": 63,
|
|
591
591
|
"pattern": "^[a-z][a-z0-9-]{0,62}$"
|
|
@@ -912,7 +912,7 @@
|
|
|
912
912
|
"id": "space",
|
|
913
913
|
"displayName": "空间",
|
|
914
914
|
"description": "把几台电脑组成一个空间",
|
|
915
|
-
"version": "1.3.
|
|
915
|
+
"version": "1.3.2",
|
|
916
916
|
"category": "机器与资源",
|
|
917
917
|
"icon": {
|
|
918
918
|
"symbol": "square.stack.3d.up.fill",
|
|
@@ -1065,7 +1065,7 @@
|
|
|
1065
1065
|
"id": "claude",
|
|
1066
1066
|
"displayName": "Claude",
|
|
1067
1067
|
"description": "用 Claude Agent SDK 跑会话",
|
|
1068
|
-
"version": "1.
|
|
1068
|
+
"version": "1.14.0",
|
|
1069
1069
|
"category": "Agent",
|
|
1070
1070
|
"icon": {
|
|
1071
1071
|
"light": "JVBERi0xLjcKJbXtrvsKNCAwIG9iago8PCAvTGVuZ3RoIDUgMCBSCiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCj4+CnN0cmVhbQp4nG1WSY4YNxC76xX6QBTtyzP8hCCAnUP74O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MTMgMCBvYmoKPDwgL1R5cGUgL1hSZWYKICAgL0xlbmd0aCA1OQogICAvRmlsdGVyIC9GbGF0ZURlY29kZQogICAvU2l6ZSAxNAogICAvVyBbMSAyIDJdCiAgIC9Sb290IDExIDAgUgogICAvSW5mbyAxMCAwIFIKPj4Kc3RyZWFtCnicY2Bg+P+fiYGTgQFEMDGy2DAwMDLwAwkWNZAYO4jVAiRY2UCENEQdI4hgZmRbBhRj28vAAADC2ATdCmVuZHN0cmVhbQplbmRvYmoKc3RhcnR4cmVmCjE3MjUKJSVFT0YK",
|
|
@@ -1076,8 +1076,8 @@
|
|
|
1076
1076
|
"kind": "builtin",
|
|
1077
1077
|
"package": "@coda-console/claude",
|
|
1078
1078
|
"tag": "latest",
|
|
1079
|
-
"version": "1.
|
|
1080
|
-
"integrity": "sha512-
|
|
1079
|
+
"version": "1.14.0",
|
|
1080
|
+
"integrity": "sha512-Ne0bs9jWmZiHH9avBhVoW6L5s6/qVwlweUt1NE3jvvdoGlx4kXjMxNTdd+OMgtgAvZk7MUth9xCZR7mL5eDQZQ==",
|
|
1081
1081
|
"repo": "https://github.com/coda-console/coda-plugins.git",
|
|
1082
1082
|
"path": "plugins/claude"
|
|
1083
1083
|
},
|
|
@@ -1161,7 +1161,7 @@
|
|
|
1161
1161
|
"id": "codex",
|
|
1162
1162
|
"displayName": "Codex",
|
|
1163
1163
|
"description": "用 OpenAI Codex 跑会话",
|
|
1164
|
-
"version": "1.13.
|
|
1164
|
+
"version": "1.13.1",
|
|
1165
1165
|
"category": "Agent",
|
|
1166
1166
|
"icon": {
|
|
1167
1167
|
"light": "JVBERi0xLjcKJbXtrvsKNCAwIG9iago8PCAvTGVuZ3RoIDUgMCBSCiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCj4+CnN0cmVhbQp4nG2WXW4cOQyE33UKXWAVUb/UMXKEoIEkD56H7N4f2I9sqT1eLAzYUxy1mixWkZaY+flL+CVL08grXq/wJ3yPf0L27/7+Fb/9yPHX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e9O6ea4D5DCB95oZ0artEN29zyRUPl5B0fn+LfnQXr5ZdrbmnSK25bU9AutgHCpCmVuZHN0cmVhbQplbmRvYmoKMTIgMCBvYmoKICAgMjg0CmVuZG9iagoxMyAwIG9iago8PCAvVHlwZSAvWFJlZgogICAvTGVuZ3RoIDU5CiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCiAgIC9TaXplIDE0CiAgIC9XIFsxIDIgMl0KICAgL1Jvb3QgMTEgMCBSCiAgIC9JbmZvIDEwIDAgUgo+PgpzdHJlYW0KeJxjYGD4/5+JgZOBAUQwMbIcY2BgZOAHEizrQWLsQBYrH4iYACKWQtQxgghmRnZToBi7DwMDAP4JBa8KZW5kc3RyZWFtCmVuZG9iagpzdGFydHhyZWYKMTg2OAolJUVPRgo=",
|
|
@@ -1172,8 +1172,8 @@
|
|
|
1172
1172
|
"kind": "builtin",
|
|
1173
1173
|
"package": "@coda-console/codex",
|
|
1174
1174
|
"tag": "latest",
|
|
1175
|
-
"version": "1.13.
|
|
1176
|
-
"integrity": "sha512-
|
|
1175
|
+
"version": "1.13.1",
|
|
1176
|
+
"integrity": "sha512-g9MTjk4VryCMDMeStmm+lsM9t93EYipzWrDF9+gkbZc6WTPFmDL/nj4J3QOZIkofe5vxG7hQFLmtcdl5cDOwyQ==",
|
|
1177
1177
|
"repo": "https://github.com/coda-console/coda-plugins.git",
|
|
1178
1178
|
"path": "plugins/codex"
|
|
1179
1179
|
},
|
|
@@ -1328,7 +1328,7 @@
|
|
|
1328
1328
|
"id": "composer",
|
|
1329
1329
|
"displayName": "输入框模式",
|
|
1330
1330
|
"description": "交接、子会话、! 命令、Ultra 与循环",
|
|
1331
|
-
"version": "
|
|
1331
|
+
"version": "10.2.0",
|
|
1332
1332
|
"category": "工作流程",
|
|
1333
1333
|
"icon": {
|
|
1334
1334
|
"symbol": "character.cursor.ibeam",
|
|
@@ -1339,8 +1339,8 @@
|
|
|
1339
1339
|
"kind": "builtin",
|
|
1340
1340
|
"package": "@coda-console/composer",
|
|
1341
1341
|
"tag": "latest",
|
|
1342
|
-
"version": "
|
|
1343
|
-
"integrity": "sha512
|
|
1342
|
+
"version": "10.2.0",
|
|
1343
|
+
"integrity": "sha512-/N6fdF74tlziAGfYVBjTPx0k8wpswW4JpdPdXAB8KuR1qwD0mLV6NOSKu/wK0hXexKQmw8fPn/izyhNIHpj9+A==",
|
|
1344
1344
|
"repo": "https://github.com/coda-console/coda-plugins.git",
|
|
1345
1345
|
"path": "plugins/composer"
|
|
1346
1346
|
},
|
|
@@ -1759,7 +1759,7 @@
|
|
|
1759
1759
|
"id": "kimi",
|
|
1760
1760
|
"displayName": "Kimi Code",
|
|
1761
1761
|
"description": "用 Kimi Code 跑会话",
|
|
1762
|
-
"version": "1.4.
|
|
1762
|
+
"version": "1.4.4",
|
|
1763
1763
|
"category": "Agent",
|
|
1764
1764
|
"icon": {
|
|
1765
1765
|
"light": "JVBERi0xLjcKJbXtrvsKNCAwIG9iago8PCAvTGVuZ3RoIDUgMCBSCiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCj4+CnN0cmVhbQp4nGWUTY4cIQyF95yCC4RgDMY+Ro4QtdSTRc0iyf2lvEcV1Z1EI03xgY2ff2jJFX9fBP9ER358pp+prr1fH/nr95o/fifVMgd2PrNUKY3LI4tE8dh+4sW6rOVp/Ti3T/tjQdou9/dlsWJfrlzDYxSpsQAhxIqO4GrZJxjXy/zg7mV8fvZJhdWPN/XPVEuNKmGQXYboZGQmKrUX7Z7bLOpzJepFbhZBUJestXT3F8KpMdPN8OmetnOn0n7ffeEjh5emG48cs8w5N4O69NwrK5TesKvT9+Qz8nHjpasiq3aL/iuntGrxX57PhDacNbBRukU2ysFJyOooZHllkaMV0SVbxXjqY1CXQgioSVzESHPCeO7jI08r4X0zyNUWxSBNWVcNYTW7Y2HZHDn1BGds1OncCJYCKbd1PFRumuvGx2aoxBXHjbVYRCJKu1V3BB6+CdM3S33ldGS1Yn6fg1iyfdXGFeixEa01P10X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Z804YNWsuDOR3z5Mb5HaJbtwV/q1XM8u+1HDbzl3gtpwT/QIe+27SCmVuZHN0cmVhbQplbmRvYmoKMTIgMCBvYmoKICAgMjc4CmVuZG9iagoxMyAwIG9iago8PCAvVHlwZSAvWFJlZgogICAvTGVuZ3RoIDU5CiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCiAgIC9TaXplIDE0CiAgIC9XIFsxIDIgMl0KICAgL1Jvb3QgMTEgMCBSCiAgIC9JbmZvIDEwIDAgUgo+PgpzdHJlYW0KeJxjYGD4/5+JgZOBAUQwMTItZ2BgZOAHEkwTQWLsINZ7IMFcCCLaIOoYQQQzI6sAUIxVnYEBAAYyBbwKZW5kc3RyZWFtCmVuZG9iagpzdGFydHhyZWYKMTMxOQolJUVPRgo=",
|
|
@@ -1771,8 +1771,8 @@
|
|
|
1771
1771
|
"kind": "builtin",
|
|
1772
1772
|
"package": "@coda-console/kimi",
|
|
1773
1773
|
"tag": "latest",
|
|
1774
|
-
"version": "1.4.
|
|
1775
|
-
"integrity": "sha512-
|
|
1774
|
+
"version": "1.4.4",
|
|
1775
|
+
"integrity": "sha512-2Pdw4IXeibl3Q4XV445TjolNuAyPLaoxmjtGVv8Hc13Go2eUnjWQlki2vNbVevu7tbqKOORC7DrLkB335toXoQ==",
|
|
1776
1776
|
"repo": "https://github.com/coda-console/coda-plugins.git",
|
|
1777
1777
|
"path": "plugins/kimi"
|
|
1778
1778
|
},
|
|
@@ -1838,7 +1838,7 @@
|
|
|
1838
1838
|
"id": "opencode",
|
|
1839
1839
|
"displayName": "OpenCode",
|
|
1840
1840
|
"description": "用 OpenCode 跑会话",
|
|
1841
|
-
"version": "2.3.
|
|
1841
|
+
"version": "2.3.3",
|
|
1842
1842
|
"category": "Agent",
|
|
1843
1843
|
"icon": {
|
|
1844
1844
|
"light": "JVBERi0xLjcKJbXtrvsKNCAwIG9iago8PCAvTGVuZ3RoIDUgMCBSCiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2R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d0YmolZ3rg5e6zvgV3g56ripS7fR3q/Rxvw2QMgd+1M4MVmmHxd3zRI3KT9EdXeHfepX08ss0t+3oArflSPQLIlFu1AplbmRzdHJlYW0KZW5kb2JqCjIyIDAgb2JqCiAgIDI3OAplbmRvYmoKMjMgMCBvYmoKPDwgL1R5cGUgL1hSZWYKICAgL0xlbmd0aCA5MAogICAvRmlsdGVyIC9GbGF0ZURlY29kZQogICAvU2l6ZSAyNAogICAvVyBbMSAyIDJdCiAgIC9Sb290IDIxIDAgUgogICAvSW5mbyAyMCAwIFIKPj4Kc3RyZWFtCnicY2Bg+P+fiUGYgQFEMDEyzGNgYGTgBxGdIDFOIIulEUgwLQES7K9BEt9AYjeABJsjiOUKJFj3gYgVICUZICIQSHDkgYgWiMmMIIKZkQtkMpcaAwMAL2QLrQplbmRzdHJlYW0KZW5kb2JqCnN0YXJ0eHJlZgoyNTk4CiUlRU9GCg==",
|
|
@@ -1850,8 +1850,8 @@
|
|
|
1850
1850
|
"kind": "builtin",
|
|
1851
1851
|
"package": "@coda-console/opencode",
|
|
1852
1852
|
"tag": "latest",
|
|
1853
|
-
"version": "2.3.
|
|
1854
|
-
"integrity": "sha512-
|
|
1853
|
+
"version": "2.3.3",
|
|
1854
|
+
"integrity": "sha512-MJ/D5cchatMZnBJtaArYXkWJo9wDqKSjO8Dp8kOGn0CkA8sTDEt1uJoHACoOqtA928ZrsY24pgaRq/ruM9MfJg==",
|
|
1855
1855
|
"repo": "https://github.com/coda-console/coda-plugins.git",
|
|
1856
1856
|
"path": "plugins/opencode"
|
|
1857
1857
|
},
|
|
@@ -1918,7 +1918,7 @@
|
|
|
1918
1918
|
"id": "review",
|
|
1919
1919
|
"displayName": "PR 生命流程",
|
|
1920
1920
|
"description": "PR 从检查、评审到批准合并;简易开发",
|
|
1921
|
-
"version": "3.
|
|
1921
|
+
"version": "3.4.0",
|
|
1922
1922
|
"category": "工作流程",
|
|
1923
1923
|
"icon": {
|
|
1924
1924
|
"symbol": "checkmark.bubble.fill",
|
|
@@ -1929,8 +1929,8 @@
|
|
|
1929
1929
|
"kind": "builtin",
|
|
1930
1930
|
"package": "@coda-console/review",
|
|
1931
1931
|
"tag": "latest",
|
|
1932
|
-
"version": "3.
|
|
1933
|
-
"integrity": "sha512-
|
|
1932
|
+
"version": "3.4.0",
|
|
1933
|
+
"integrity": "sha512-F07P+V8EiQo7NybXLU4dwkFMtrxjn0yb16x5Yoiqe57odCC1lrnxD046slg2xhoTF4tam7CtNLwYOK0FMiQyfQ==",
|
|
1934
1934
|
"repo": "https://github.com/coda-console/coda-plugins.git",
|
|
1935
1935
|
"path": "plugins/review"
|
|
1936
1936
|
},
|
|
@@ -67,9 +67,9 @@ export function firstMessage(value) {
|
|
|
67
67
|
const handoff = value.handoffSource === undefined ? {} : { handoffSource: text(value.handoffSource, '交接来源', 100) };
|
|
68
68
|
const parent = value.parentThreadId === undefined ? {} : { parentThreadId: text(value.parentThreadId, '父会话', 100) };
|
|
69
69
|
check(!parent.parentThreadId || handoff.handoffSource === parent.parentThreadId, 'invalid_input', '子会话必须引用父会话上下文');
|
|
70
|
-
// Whom a child the user starts answers (#1904「回复权」):
|
|
71
|
-
//
|
|
72
|
-
//
|
|
70
|
+
// Whom a child the user starts answers (#1904「回复权」): said as `parent` (the default) or `sender`, and either way the
|
|
71
|
+
// user who started it — under its parent, which is where it belongs, with nothing going back to it (store
|
|
72
|
+
// acceptFirstMessage). Only the one that is not the default is kept, so that a request saying the default is the same request.
|
|
73
73
|
check(value.replyTo === undefined || parent.parentThreadId && ['parent', 'sender'].includes(value.replyTo), 'invalid_input', '子会话的回报对象无效');
|
|
74
74
|
const reply = value.replyTo === 'sender' ? { replyTo: 'sender' } : {};
|
|
75
75
|
// Which agents may run is the store's to say (its plugin installed); here only that it names one.
|
package/check/coda/contract.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"commit": "
|
|
2
|
+
"commit": "0275e21adcd2e12818b6e638ae3002474f748ecd",
|
|
3
3
|
"packages": {
|
|
4
4
|
"@0dep/piso": "5.2.0",
|
|
5
5
|
"@agentclientprotocol/sdk": "2.6.0",
|
|
6
|
-
"@coda-console/protocol": "6.
|
|
6
|
+
"@coda-console/protocol": "6.5.0",
|
|
7
7
|
"ajv": "8.20.0",
|
|
8
8
|
"yaml": "2.9.1"
|
|
9
9
|
},
|
|
@@ -24,21 +24,21 @@
|
|
|
24
24
|
"check/coda/components/plugins/plugin-source-rules.mjs": "1b6c0fb1868481627f09b7227bc64ef07fe669dcc344dad353e6743adf6c9c5d",
|
|
25
25
|
"check/coda/components/plugins/skill-document.mjs": "153ad3c096c7c9b7774bcf7dcc0ba603c962ee1ac8697c8a71e3f2c9ba9c92e6",
|
|
26
26
|
"check/coda/components/prompt-recovery/prompt-recovery.mjs": "f43f21d24c19a58113d3304f9248225b12080ab00ed15eab74bf7b94642732de",
|
|
27
|
-
"check/coda/components/session-config/commands.mjs": "
|
|
27
|
+
"check/coda/components/session-config/commands.mjs": "5276f81fc430a6eef7d7a0dbdecfffdb4a77f8c192cb0238ed73b7722641ce17",
|
|
28
28
|
"check/coda/components/session-config/contributions.mjs": "74d52d65dc7b6f13ef301a211bdf50cc91ae468c462cbe201f5dc34f7437b97b",
|
|
29
29
|
"check/coda/components/workflows/contributions.mjs": "43e656a2d502b851679d8da11e74a6fb843c47a1502bfc948da719855ca7b438",
|
|
30
|
-
"check/coda/domain/agent-protocol.mjs": "
|
|
30
|
+
"check/coda/domain/agent-protocol.mjs": "f1d7c939c240664b773c04d9a1c1e9457cc8396fd8f99f1d5b6b6964150843c0",
|
|
31
31
|
"check/coda/domain/duration.mjs": "3f07411812362adcacfc288b1513f10e7d0ea1addcdc1b47ae553561f1d3430b",
|
|
32
32
|
"check/coda/domain/errors.mjs": "8319c6759c5b16b692f5e0a6208d066e43882c571da1075bff8698761020daef",
|
|
33
33
|
"check/coda/domain/resource-admission.mjs": "775b1d7067f9d8487a3504d737f3f4bea31adf77af3357ed42e313805e5188e7",
|
|
34
34
|
"check/coda/domain/plugin-services.mjs": "940a72a14da980188a32c790c7f341d3ec0062a6e87ef1ebc9ef051798ea0a75",
|
|
35
|
-
"check/coda/domain/session-env.mjs": "
|
|
35
|
+
"check/coda/domain/session-env.mjs": "e6717b7fb02e0175a25a00765919fa058182433beed6dcb22bf1745b4591749f",
|
|
36
36
|
"check/coda/domain/values.mjs": "afb8bf30e374bed27fe41ee4b6d8c3c0b4dbe1dcfb6b62dad9d3d53b966706a1",
|
|
37
37
|
"check/coda/kernel/agent-failures.mjs": "cbc215e2403d86f0acc765c2077197e0b529fc01e213db465c388361238ea8ce",
|
|
38
38
|
"check/coda/resources/plugins/resources/panels/command.mjs": "606f28bf87f87dded9df2db892bc7624c770d795ffab88f2409998346920ae42",
|
|
39
39
|
"check/coda/resources/plugins/resources/panels/panels.mjs": "452860c6b1b39dd9a67a8dadf4dac8f7773741b3608274494a8ac518a01f5b33",
|
|
40
40
|
"check/coda/resources/plugins/resources/panels/rules.mjs": "80da2709985c3866fff1698ea4d1c1afdf59cac2cc955605d3ec6c35f181eec6",
|
|
41
41
|
"check/coda/resources/plugins/resources/panels/sign-in.mjs": "1271a24e33b1b882a1fb9bee03b8e240db8b9bee1b5208f0e1c84499cfb1be7e",
|
|
42
|
-
"check/coda/builtin.json": "
|
|
42
|
+
"check/coda/builtin.json": "00124de57b1ec74c5913d8ab662fbd53805fdc54e0164d6cf3f6da8e34499083"
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -19,6 +19,14 @@ export const clientCapabilities = () => ({
|
|
|
19
19
|
export const REMOTE = '_coda/remote', REMOTE_CODE = '_coda/remote/code';
|
|
20
20
|
export const supportsRemote = init => init?.agentCapabilities?._meta?.coda?.remote != null
|
|
21
21
|
&& typeof init.agentCapabilities._meta.coda.remote === 'object';
|
|
22
|
+
// The probe (「配置探测」): an agent that declares it answers a `session/new` marked as one with a session of this connection only,
|
|
23
|
+
// no native session behind it, so a probe has nothing to delete. The declaration is strictly an object (not the array remote
|
|
24
|
+
// historically also accepts); the mark keeps whatever else the request's `_meta` and its `coda` hold.
|
|
25
|
+
export const supportsProbe = init => {
|
|
26
|
+
const probe = init?.agentCapabilities?._meta?.coda?.probe;
|
|
27
|
+
return probe !== null && typeof probe === 'object' && !Array.isArray(probe);
|
|
28
|
+
};
|
|
29
|
+
export const probeMeta = meta => ({ ...meta, coda: { ...meta?.coda, probe: true } });
|
|
22
30
|
// The agent refuses until it is signed in (ACP's auth_required).
|
|
23
31
|
export const SIGNED_OUT = -32000;
|
|
24
32
|
// Session instructions (「会话指令」): ACP's `systemPrompt`, only to an agent that declares it, the same on every open of
|
|
@@ -5,3 +5,6 @@ export const THREAD_ENV = 'CODA_THREAD_ID';
|
|
|
5
5
|
// what the process brings back beside the session it names. A plugin's process takes its environment through `cleared`
|
|
6
6
|
// (components/plugins/plugin-rules.mjs), which leaves out both.
|
|
7
7
|
export const TOKEN_ENV = 'CODA_TOKEN';
|
|
8
|
+
// A directory of the session's own for its agent's temporary files, which goes with the session once it is archived and its
|
|
9
|
+
// process is gone (docs/plugins.md「插件进程的环境」); none for a backend without a state root. Not the agent's TMPDIR.
|
|
10
|
+
export const SESSION_TMP_ENV = 'CODA_SESSION_TMP';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coda-console/plugin-check",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.18",
|
|
4
4
|
"description": "Coda 插件的契约检查:扮演 Coda 读清单、启动 Agent 讲 ACP 与 _coda/wait、读资源类型(与旧的面板)。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@0dep/piso": "5.2.0",
|
|
26
26
|
"@agentclientprotocol/sdk": "2.6.0",
|
|
27
|
-
"@coda-console/protocol": "6.
|
|
27
|
+
"@coda-console/protocol": "6.5.0",
|
|
28
28
|
"ajv": "8.20.0",
|
|
29
29
|
"yaml": "2.9.1"
|
|
30
30
|
},
|