@coda-console/plugin-check 0.8.6 → 0.8.7

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 CHANGED
@@ -63,7 +63,7 @@ Coda 插件页的「商店」列出 Coda 自带的插件,以及 npm 上 `@coda
63
63
  | `codex` | `@agentclientprotocol/codex-acp` 1.12.0、`@openai/codex` 0.165.0;`overrides` 让 codex-acp 用同一个 `@openai/codex` | — |
64
64
  | `claude` | `@agentclientprotocol/sdk` 1.4.0、`@anthropic-ai/claude-agent-sdk` 0.3.312(平台二进制是 SDK 自己的可选依赖) | — |
65
65
  | `codex-accounts` | `proper-lockfile` 4.1.2;用依赖插件 `codex` 的 Codex CLI | 无;依赖 `codex` 插件 |
66
- | `kimi` | 无 | Kimi CLI 2.1.1 及以上(设置动作安装或升级;资源页上可从 Coda 安装、登录) |
66
+ | `kimi` | 无 | Kimi CLI 2.1.1 及以上(缺失或更旧时设置动作装入口核对过的 2.1.1,更新的不动;资源页上可从 Coda 安装、登录) |
67
67
  | `grok` | 无 | Grok CLI 1.0.52 及以上(设置动作安装或升级;资源页上可从 Coda 安装、登录) |
68
68
  | `opencode` | `jsonc-parser` 3.3.1 | 已登录的 OpenCode CLI 2.1.4 及以上(设置动作安装或升级,OpenCode 1 升到 2) |
69
69
 
@@ -97,7 +97,8 @@ Edit、MultiEdit 与 Write 的输入生成标准 `diff` 预览;成功结果用
97
97
  计划工具归 `think`,Task/Agent 子 Agent、MCP 与未知工具归 `other`,子 Agent 的活动卡片沿用原有报告。
98
98
  进行中的工具保留到结果到达;为处理重复结果,已完成调用仅缓存最近 128 条,且估算字符串存储不超过 4 MiB。超限 diff 正常发送但不缓存,淘汰后忽略重复结果,不覆盖客户端已有的 diff。
99
99
 
100
- Claude 的额度耗尽按[执行失败](https://github.com/coda-console/coda-protocol/blob/main/docs/agent-protocol.md#额度不足)报 `quota_exhausted`,保留上游给出的重置时间;
100
+ Claude 的额度耗尽按[执行失败](https://github.com/coda-console/coda-protocol/blob/main/docs/agent-protocol.md#额度不足)报 `quota_exhausted`;
101
+ 本轮窗口为 `rejected` 且有有效的 Unix 秒 `resetsAt` 时,同时写 `failure.resetAt`(UTC ISO 8601),并保持正文的 `<t:…>` 改写。没有确切时间就不写。
101
102
  只认明确的额度原因,或本轮 `rate_limit` 错误配合订阅窗口的 `rejected`,不把普通 429、登录失败或额度预警算进去。
102
103
  SDK 作为 `assistant` 消息发来的 API 错误不当成回复正文;由本轮 `result` 报告失败。
103
104
  后台结果或定时唤醒后的自主轮次没有 `session/prompt` 可回复,失败时以自己的活动卡片报 `failed` 和原因,额度耗尽的卡片标题为「额度不足」;
@@ -364,7 +365,12 @@ Codex 的原生失败统一以 ACP 错误结束,包括只有 `turn/completed.f
364
365
  插件将服务端内部错误、5xx、响应流中断、模型容量不足,以及已知的 `model '…' is not enabled in rustponsesapi` 报成
365
366
  `error.data._meta.coda.failure: {kind: "service_unavailable", input: "accepted"}`。新轮请求明确被拒绝、只给
366
367
  `Internal error` 时按临时故障报告 `input: "not_accepted"`;这表示允许有限重试,不表示已确定历史故障根因。
367
- 明确的额度耗尽、认证、上下文限制、参数、配置或沙箱错误不带此标记。
368
+ 额度耗尽 `usageLimitExceeded` 单独报 `failure.kind: "quota_exhausted"`;认证、上下文限制、参数、配置或沙箱错误不带此标记。
369
+ Codex 仅从本次错误的 `additionalDetails`、`message` 或外层错误正文提取重置时间:JSON 的 `error.resets_at`(有效 Unix 秒),
370
+ 或 `try again at` / `resets at` / `resets` 后明确带 `Z` 的 ISO 8601 时间;取到就写 UTC `failure.resetAt`,可读正文中的这些 ISO 时间改写为 `<t:…>`。
371
+ 未给时间、只有相对时间或没有时区时不写。`account/rateLimits/read` 是账号级快照,可能含多个模型额度池,
372
+ 失败未指出阻断本轮的额度池,因此不从该快照推断重置时间,也不另开连接查询。
373
+ Coda 对接时,`backend/test/codex-errors.test.mjs` 中 `usageLimitExceeded` 原先预期的 `unknown` 应改为 `quota_exhausted`;没有时间仍属额度不足。
368
374
  插件不做退避或重新发送;Coda 按通用协议统一退避,客户端只支持 ACP 时仍能读到完整错误。
369
375
 
370
376
  Kimi 2.1.1 会把五小时额度耗尽(`403 You've reached your 5-hour usage limit.`)误报为 ACP `auth_required`。
package/check/agent.mjs CHANGED
@@ -127,7 +127,7 @@ class Session {
127
127
  const parsed = schemas.zSessionNotification.safeParse(params);
128
128
  if (!parsed.success) {
129
129
  this.malformed++;
130
- this.at.fail('update.schema', `session/update 不合 ACP schema(SDK 1.4.0):${explain(parsed.error, params)}`);
130
+ this.at.fail('update.schema', `session/update 不合 ACP schema(SDK 2.6.0):${explain(parsed.error, params)}`);
131
131
  return;
132
132
  }
133
133
  const update = params.update, kind = update.sessionUpdate;
@@ -220,7 +220,7 @@ class Session {
220
220
  if (problem) say.fail('handshake.initialize', problem);
221
221
  this.init = reply.result;
222
222
  if (reply.result.protocolVersion !== ACP_PROTOCOL_VERSION) {
223
- say.fail('handshake.protocol', `protocolVersion 是 ${reply.result.protocolVersion}:Coda 用的 ACP(SDK 1.4.0)是版本 ${ACP_PROTOCOL_VERSION}(Coda 自己不核对这一项,按它说的协议说话)`);
223
+ say.fail('handshake.protocol', `protocolVersion 是 ${reply.result.protocolVersion}:Coda 用的 ACP(SDK 2.6.0)是版本 ${ACP_PROTOCOL_VERSION}(Coda 自己不核对这一项,按它说的协议说话)`);
224
224
  return 'failed';
225
225
  }
226
226
  const caps = reply.result.agentCapabilities ?? {}, waits = !!caps._meta?.coda?.waits && typeof caps._meta.coda.waits === 'object';
@@ -449,7 +449,7 @@ async function live(session, { prompt, word }, limits, say) {
449
449
  await session.settle(limits.settle, { cancel: true });
450
450
  }
451
451
  const kinds = [...session.kinds].map(([kind, n]) => `${kind} ×${n}`).join(',');
452
- if (!session.malformed) say.pass('live.updates', `session/update 都合 ACP schema(SDK 1.4.0)与 Coda 扩展 schema:${kinds || '无'}`);
452
+ if (!session.malformed) say.pass('live.updates', `session/update 都合 ACP schema(SDK 2.6.0)与 Coda 扩展 schema:${kinds || '无'}`);
453
453
  }
454
454
 
455
455
  // Checks one declared agent of the plugin as the manifest level read it (`checked`, manifest.mjs checkManifest), started as
@@ -2,7 +2,7 @@
2
2
  "commit": "8cb0da14acae31719a5021e1d5e04aa705f63175",
3
3
  "packages": {
4
4
  "@0dep/piso": "5.2.0",
5
- "@agentclientprotocol/sdk": "1.4.0",
5
+ "@agentclientprotocol/sdk": "2.6.0",
6
6
  "@coda-console/protocol": "5.10.0",
7
7
  "ajv": "8.20.0",
8
8
  "yaml": "2.9.1"
package/check/schema.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  // ACP's own parsers, from the SDK version Coda pins (package.json). They are its generated zod schemas, which the SDK does
2
- // not export by name: read from the file next to its entry point.
2
+ // not export by name: read from the stable v1 file relative to its entry point.
3
3
  const sdk = import.meta.resolve('@agentclientprotocol/sdk');
4
- export const schemas = await import(new URL('./schema/zod.gen.js', sdk));
4
+ export const schemas = await import(new URL('../schema/zod.gen.js', sdk));
5
5
 
6
6
  // One line on why a value does not parse. A union (a session update is one of many kinds) names the branch it meant: the
7
7
  // one whose `sessionUpdate` matched.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coda-console/plugin-check",
3
- "version": "0.8.6",
3
+ "version": "0.8.7",
4
4
  "description": "Coda 插件的契约检查:扮演 Coda 读清单、启动 Agent 讲 ACP 与 _coda/wait、读资源类型(与旧的面板)。",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@0dep/piso": "5.2.0",
26
- "@agentclientprotocol/sdk": "1.4.0",
26
+ "@agentclientprotocol/sdk": "2.6.0",
27
27
  "@coda-console/protocol": "5.10.0",
28
28
  "ajv": "8.20.0",
29
29
  "yaml": "2.9.1"