@coda-console/plugin-check 0.5.19 → 0.5.21

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
@@ -21,7 +21,7 @@ plugins/magpie/ Magpie:把本机的 Magpie 网关作为模型服务
21
21
  plugins/network-log/ 网络记录:默认关闭,按需开启建连等待与定时探测采集;关闭后仍可查看历史
22
22
  plugins/review/ PR 生命流程:会话开的 PR 先跑项目的检查、再交叉评审,你批准后合并、部署与发布;也是写 PR 流程的样例
23
23
  plugins/testbed/ 测试机:长插在 Mac 上的 iPhone、iPad 只经 use-testbed 使用,排到后装 App、交给会话操作、用完切黑屏;依赖宿主资源
24
- plugins/ultra/ Ultra:输入框的 Ultra 模式,主 Agent 主动把能并行的活按名单派给子会话,汇总后验证;名单与模板在模式参数和设置里
24
+ plugins/ultra/ Ultra:输入框的协调模式,主 Agent 负责拆解、调度和验收,子会话负责实现、排查和测试;名单与模板在模式参数和设置里
25
25
  templates/agent/ 最小的 Agent 插件:手写 ACP 的回声 Agent,演示会话指令、插话、Agent 活动与自主轮次
26
26
  templates/panel/ 最小的面板插件:一张卡片、一条进度条、一个按钮
27
27
  bin/、check/ 契约检查(仓库根的 package.json 就是它,@coda-console/plugin-check);check/coda/ 是 Coda 同步来的规则副本,不要手改
@@ -82,6 +82,12 @@ Claude 把一轮进行中的插话标上 `priority: 'next'` 交给 Claude Code
82
82
  这一轮被停止或失败时,还没并进去的插话随之撤掉(`interrupt` 带 `cancelQueued`),不会在之后再跑,原来的 `session/prompt` 等撤掉了才答复。
83
83
  结果最多列出 64 条它接收的消息,所以同时在途的插话最多 32 条,再多的回 `promptRequired`,由 Coda 在这一轮结束后作为下一轮发出。
84
84
 
85
+ Claude 的工具调用与审批卡片按原生工具名报告 ACP `kind`,读写文件带 `locations`,Read 的 `offset` 对应起始行。
86
+ 执行标题取命令第一行,搜索与联网标题取模式、查询或 URL(最多 200 字符);没有相应输入时保留工具名,`rawInput` 始终原样保留。
87
+ Edit、MultiEdit 与 Write 的输入生成标准 `diff` 预览;成功结果用 SDK 的写入前后全文或 `structuredPatch` 修正 diff,覆盖写入与多处替换均按实际结果报告,同时保留结果文本。NotebookEdit 只报告路径,不把单元格源码当成整个笔记本的 diff。
88
+ 计划工具归 `think`,Task/Agent 子 Agent、MCP 与未知工具归 `other`,子 Agent 的活动卡片沿用原有报告。
89
+ 进行中的工具保留到结果到达;为处理重复结果,已完成调用仅缓存最近 128 条,且估算字符串存储不超过 4 MiB。超限 diff 正常发送但不缓存,淘汰后忽略重复结果,不覆盖客户端已有的 diff。
90
+
85
91
  Claude 的额度耗尽按[执行失败](https://github.com/coda-console/coda-protocol/blob/main/docs/agent-protocol.md#额度不足)报 `quota_exhausted`,保留上游给出的重置时间;
86
92
  只认明确的额度原因,或本轮 `rate_limit` 错误配合订阅窗口的 `rejected`,不把普通 429、登录失败或额度预警算进去。
87
93
  SDK 作为 `assistant` 消息发来的 API 错误不当成回复正文;由本轮 `result` 报告失败。
@@ -899,14 +899,14 @@
899
899
  "id": "claude",
900
900
  "displayName": "Claude",
901
901
  "description": "Claude SDK Agent:Coda 基于 Claude Agent SDK 写的 ACP 入口,一个进程一个 SDK 会话;资源页的「Claude」面板显示会话报告的额度,可从 Coda 登录。",
902
- "version": "1.7.2",
902
+ "version": "1.7.6",
903
903
  "category": "Agent",
904
904
  "source": {
905
905
  "kind": "builtin",
906
906
  "package": "@coda-console/claude",
907
907
  "tag": "latest",
908
- "version": "1.7.2",
909
- "integrity": "sha512-Ux5uWnF1sBwOIUTIXfeZwbRWbJz9ZVKaxPL0Q2QMD7C5uPDzDU1KQjR6fJPKwmIw9kR5YFSz3cq7GuL3DEo4kg==",
908
+ "version": "1.7.6",
909
+ "integrity": "sha512-Gz0U1s8aWTahr+IcJAPtUZu9LLySQWmKgVrgk3qorolZycNG+gez7SbKfu24sgJq6TY89SgupH/xRj8d+VBgLg==",
910
910
  "repo": "https://github.com/coda-console/coda-plugins.git",
911
911
  "path": "plugins/claude"
912
912
  },
@@ -4,7 +4,7 @@
4
4
  // is the extended plugin's own contract, which Coda neither reads nor shapes. A point may instead take what any plugin
5
5
  // writes under a key of its `contributes` (`contributes` there, as the resources plugin's `panels`): of the schema the point
6
6
  // declares, kept as written, for the declaring plugin to read, only the commands in it listed where installing confirms them.
7
- import { pointProblem } from '@coda-console/protocol/validate';
7
+ import { pointProblem, valueProblem } from '@coda-console/protocol/validate';
8
8
  import { requireCondition as check } from '../../domain/errors.mjs';
9
9
 
10
10
  const code = 'invalid_plugin';
@@ -80,6 +80,25 @@ export function withDependencies(catalog, id) {
80
80
  visit(id);
81
81
  return order;
82
82
  }
83
+ // A channel restriction is the target backend's, never the client's. An unknown channel cannot satisfy an explicit list.
84
+ // The store reads registry metadata; installation reads the package itself. Both use the same schema and rule.
85
+ export function pluginChannelProblem(plugin, channel) {
86
+ if (plugin.coda === undefined) return null;
87
+ const problem = valueProblem('plugin.json#/properties/coda', plugin.coda, 'coda');
88
+ if (problem) return problem;
89
+ const channels = plugin.coda.channels;
90
+ if (!channels || channels.includes(channel)) return null;
91
+ const names = channels.map(value => value === 'preview' ? '预览版' : '正式版').join('或');
92
+ return `此插件仅支持 Coda ${names}后端${channel ? '' : ',当前后端没有发布通道记录'}`;
93
+ }
94
+ // The same dependency closure used by installation, after resolving each dependency to its actual local or source version.
95
+ export function catalogChannelProblem(catalog, id, channel) {
96
+ for (const each of withDependencies(catalog, id)) {
97
+ const plugin = catalog.get(each), problem = plugin && pluginChannelProblem(plugin, channel);
98
+ if (problem) return each === id ? problem : `${each}:${problem}`;
99
+ }
100
+ return null;
101
+ }
83
102
  // The installed plugins that need this one, directly or through another, by ID.
84
103
  export function dependents(catalog, installed, id) {
85
104
  const found = new Set();
@@ -132,6 +132,7 @@ export function readPlugin(dir, source) {
132
132
  const offers = Object.fromEntries(Object.entries(contributes).filter(([key]) => !TYPES.includes(key)));
133
133
  return { id, displayName, description: typeof manifest.description === 'string' ? manifest.description : '', version: String(manifest.version ?? ''),
134
134
  category: manifestCategory(manifest), source, dir, title: typeof configuration.title === 'string' ? configuration.title : displayName, properties,
135
+ ...(manifest.coda !== undefined ? { coda: manifest.coda } : {}),
135
136
  ...(manifest.main ? { main: posix.normalize(manifest.main) } : {}), ...(activation.includes('onStartupFinished') ? { startup: true } : {}),
136
137
  ...(required.length ? { required: [...required] } : {}), workflows: files('.coda/workflows'),
137
138
  capabilities: [...(contributes.capabilities ?? [])].sort(), services: [...(contributes.services ?? [])],
@@ -7,7 +7,7 @@
7
7
  import { createHash } from 'node:crypto';
8
8
  import { normalize } from 'node:path';
9
9
  import { requireCondition as check } from '../../domain/errors.mjs';
10
- import { offerPoint, offeredCommands, offerProblem, withDependencies } from './plugin-extensions.mjs';
10
+ import { catalogChannelProblem, offerPoint, offeredCommands, offerProblem, withDependencies } from './plugin-extensions.mjs';
11
11
 
12
12
  export const COMMIT = /^[0-9a-f]{40}$/;
13
13
  const ID = /^[a-z][a-z0-9-]{0,39}$/;
@@ -168,7 +168,7 @@ export function npmManifest(id, own, skills) {
168
168
  }
169
169
  if (!Object.keys(contributes).length) return { problem: '这个 npm 包读不成插件:package.json 没有 contributes,没有 Skill 目录,也不是写了 mcpName 的 MCP 服务器' };
170
170
  return { manifest: { name: id, displayName: own.name, description: typeof own.description === 'string' ? own.description.slice(0, 500) : '',
171
- version: String(own.version ?? ''), contributes } };
171
+ version: String(own.version ?? ''), ...(own.coda !== undefined ? { coda: own.coda } : {}), contributes } };
172
172
  }
173
173
  // The packages npm installs for a package from npm, by name with the range it asks for: its dependencies are not pinned
174
174
  // (docs/plugins.md「从 npm 安装」), unless it brings an `npm-shrinkwrap.json`, whose versions they then are. Among them the
@@ -352,7 +352,7 @@ export const manifestId = manifest => manifest?.id ?? manifest?.name;
352
352
  // rows, the built-in plugins): what it is, the one of its ID installed here, why it cannot be installed, what comes along
353
353
  // with it (`siblings`: the other plugins of the same commit, by ID) and what it brings. `manifest`: what is known of it
354
354
  // when it does not read as a plugin, its ID `fallback` without a name.
355
- export function candidate({ path, manifest, plugin, problem, fallback }, { catalog, installed, builtin }, siblings) {
355
+ export function candidate({ path, manifest, plugin, problem, fallback }, { catalog, installed, builtin, channel }, siblings) {
356
356
  const id = plugin?.id ?? (typeof manifestId(manifest) === 'string' ? manifestId(manifest) : fallback);
357
357
  const row = installed.get(id), along = plugin ? together(plugin, { catalog, installed, siblings }) : [];
358
358
  const missing = along.filter(each => each.from === 'missing').map(each => each.id);
@@ -361,7 +361,7 @@ export function candidate({ path, manifest, plugin, problem, fallback }, { catal
361
361
  return { path, id, displayName: plugin?.displayName ?? (typeof manifest?.displayName === 'string' ? manifest.displayName : id),
362
362
  description: plugin?.description ?? (typeof manifest?.description === 'string' ? manifest.description : ''), version: plugin?.version ?? '',
363
363
  installed: row ? row.source ?? builtin.get(id)?.source ?? { kind: 'builtin' } : null,
364
- problem: problem ?? (plugin ? catalogProblem(plugin, catalog, builtin, installed) ?? offerProblem(plugin, after) : null)
364
+ problem: problem ?? (plugin ? catalogChannelProblem(after, id, channel) ?? catalogProblem(plugin, catalog, builtin, installed) ?? offerProblem(plugin, after) : null)
365
365
  ?? (missing.length ? `要一起装的 ${missing.join('、')} 不在这台机器上${plugin.source?.kind === 'npm' ? '' : ',也不在这个提交里'}` : null),
366
366
  together: along.filter(each => each.from !== 'missing'),
367
367
  ...(plugin ? { contributes: contributions(plugin, after) } : {}) };
@@ -1,16 +1,16 @@
1
1
  {
2
- "commit": "050c09df875ee474c1824b551c1794451c43b4cd",
2
+ "commit": "24631031f629cae0f395ec7c04ede6a036d49f5a",
3
3
  "packages": {
4
4
  "@0dep/piso": "5.2.0",
5
5
  "@agentclientprotocol/sdk": "1.4.0",
6
- "@coda-console/protocol": "1.4.0",
6
+ "@coda-console/protocol": "1.7.0",
7
7
  "yaml": "2.9.1"
8
8
  },
9
9
  "files": {
10
10
  "check/coda/components/plugins/agent-plugins.mjs": "d117702f83c988aa89c2e5ae26aafd6ae3e8ba0829adaeedf9e8640f5f8282be",
11
- "check/coda/components/plugins/plugin-extensions.mjs": "91badae3de3c5a015d83d425def2593ffcd451576fb5f07309888f09d3157b52",
12
- "check/coda/components/plugins/plugin-rules.mjs": "eb4ba82ea871c03116a4edfe84ef6e423d15a17bcd66c56e732af6255f9624dd",
13
- "check/coda/components/plugins/plugin-source-rules.mjs": "4eedfd024c0824b1fed78be106f1a2827ffc3dd35ac0c69b8b0c61a59af42efd",
11
+ "check/coda/components/plugins/plugin-extensions.mjs": "4d7963185195ba6d21a4e49a66987613d5892210b1eb1dc02cffb7b816407776",
12
+ "check/coda/components/plugins/plugin-rules.mjs": "bf2eecafaf3a3c3a8b4719c3252db30a582fce5f11946926cd6a2bc03920c702",
13
+ "check/coda/components/plugins/plugin-source-rules.mjs": "d894d55a3272df5ef3b108b68820c64aefdf6b69346404b58954f2a3503cb4a5",
14
14
  "check/coda/components/plugins/skill-document.mjs": "c5b5e815c42cd836572f7b60e22a46af6ac607fd9df0170fa36f955825636ce6",
15
15
  "check/coda/components/prompt-recovery/prompt-recovery.mjs": "f43f21d24c19a58113d3304f9248225b12080ab00ed15eab74bf7b94642732de",
16
16
  "check/coda/components/session-config/commands.mjs": "be07377c153f812a648deb60f023269c1f0a49b91cf2e4516f05b7eac09c28de",
@@ -24,6 +24,6 @@
24
24
  "check/coda/resources/plugins/resources/panels/panels.mjs": "9e25cfbc16ed9f68101fc7bfc34b8056c13a29d2368c5561e65e333233eb921e",
25
25
  "check/coda/resources/plugins/resources/panels/rules.mjs": "8418ed83b796f18047c154d8dea8dca7d98244af8ddfe3ddf188520c59324ee8",
26
26
  "check/coda/resources/plugins/resources/panels/sign-in.mjs": "1271a24e33b1b882a1fb9bee03b8e240db8b9bee1b5208f0e1c84499cfb1be7e",
27
- "check/coda/builtin.json": "33ef1ee3612117b0684484ab819dd9afbe4bd7d43f4b391b925f3018e0192e20"
27
+ "check/coda/builtin.json": "98d28f8cc5e242b2e25c987d252dd2d9f594b3ef83b627781842af35faa2d851"
28
28
  }
29
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coda-console/plugin-check",
3
- "version": "0.5.19",
3
+ "version": "0.5.21",
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": "1.4.0",
27
- "@coda-console/protocol": "1.4.0",
27
+ "@coda-console/protocol": "1.7.0",
28
28
  "ajv": "8.20.0",
29
29
  "yaml": "2.9.1"
30
30
  },