@coda-console/plugin-check 0.5.8 → 0.5.10

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/check/agent.mjs CHANGED
@@ -8,7 +8,7 @@ import { mkdirSync } from 'node:fs';
8
8
  import { join } from 'node:path';
9
9
  import { cleared } from './coda/components/plugins/plugin-rules.mjs';
10
10
  import { RETRY_DELAYS, continuationPrompt, serviceFailure } from './coda/components/prompt-recovery/prompt-recovery.mjs';
11
- import { NOT_STEERED, OPEN_LIMIT, SIGNED_OUT, STEERED, STEERING, STOP_LIMIT, TERM_GRACE, clientCapabilities, currentModel, steeringParams, supportsSteering, systemPrompt,
11
+ import { NOT_STEERED, OPEN_LIMIT, REMOTE_CODE, SIGNED_OUT, STEERED, STEERING, STOP_LIMIT, TERM_GRACE, clientCapabilities, currentModel, steeringParams, supportsSteering, systemPrompt,
12
12
  takesInstructions } from './coda/domain/agent-protocol.mjs';
13
13
  import { agentErrorMessage } from './coda/kernel/agent-failures.mjs';
14
14
  import { temporary } from './leftovers.mjs';
@@ -153,6 +153,18 @@ class Session {
153
153
  }
154
154
  return;
155
155
  }
156
+ // A code binding the place a remote agent works (docs/agent-protocol.md「远端入口」): Coda answers it for the agent's own
157
+ // session only, here with a code that binds nothing and no address, as on a machine in no tailnet.
158
+ if (m.method === REMOTE_CODE) {
159
+ if (m.params?.sessionId !== this.sessionId) {
160
+ this.at.fail('request.session', `绑定码请求说的会话 ${m.params?.sessionId} 不是本会话:Coda 只为本会话发绑定码`);
161
+ this.proc.respondError(m.id, -32603, '只能为本会话请求');
162
+ return;
163
+ }
164
+ this.proc.respond(m.id, { code: randomBytes(12).toString('base64url'), expiresAt: new Date(Date.now() + 10 * 60_000).toISOString(), addresses: [] });
165
+ this.at.info('request.remote-code', '绑定码:检查给一个绑不上任何东西的码,没有入口地址');
166
+ return;
167
+ }
156
168
  // Coda handles nothing else an agent asks: its ACP SDK answers that the method is not found.
157
169
  this.proc.respondError(m.id, METHOD_NOT_FOUND, `"Method not found": ${m.method}`);
158
170
  this.once(`request:${m.method}`, () => this.at.warn('request.unsupported', `Agent 请求了 ${m.method}:Coda 不提供(没声明 fs、terminal),回 -32601`));
@@ -277,7 +277,7 @@
277
277
  {
278
278
  "id": "github",
279
279
  "displayName": "GitHub",
280
- "description": "在 Coda 里登录 GitHub 账号,可以登录多个。Coda 启动的会话、流程步骤与插件安装访问 GitHub 时,按仓库的 owner 自动试出能推送的账号并记下,之后这个 owner 的仓库都用它;账号按面板上的顺序试,可以上移下移;会话里的 gh 与提交署名也跟着这个账号;gh 的只读命令遇到网络类失败会自动重试。会话里的 git 也经它交给真正的 git,Git 自己已知、重跑即好的故障(几个工作树同时创建时读到别的还没写好的 commondir)自动重跑;会话推送它开的 PR 的分支时,PR 观察立即去看,PR 已合并或关闭就当场提醒这次推送进不了目标分支。添加项目、安装插件时可以从这些账号的仓库里挑。",
280
+ "description": "在 Coda 里登录 GitHub 账号,可以登录多个。Coda 启动的会话、流程步骤与插件安装访问 GitHub 时,按仓库的 owner 自动试出能推送的账号并记下,之后这个 owner 的仓库都用它;账号按面板上的顺序试,可以上移下移;会话里的 gh 与提交署名也跟着这个账号;gh 的只读命令遇到网络类失败会自动重试。会话里的 git 也经它交给真正的 git,Git 自己已知、重跑即好的故障(几个工作树同时创建时读到别的还没写好的 commondir)自动重跑;会话推送它开的 PR 的分支时,PR 观察立即去看,PR 已合并或关闭就当场提醒这次推送进不了目标分支。添加目录、安装插件时可以从这些账号的仓库里挑。",
281
281
  "version": "1.8.0",
282
282
  "category": "模型与账号",
283
283
  "source": {
@@ -429,14 +429,14 @@
429
429
  {
430
430
  "name": "coda",
431
431
  "path": "src/resources/plugins/guide/skills/coda",
432
- "description": "Coda 的使用指南:Coda 是什么、连接、项目、会话、卡片、流程、插件、空间各是什么、怎么配合。用户问 Coda 怎么用、某个界面、菜单、状态或标记是什么意思时,先读这里再回答。"
432
+ "description": "Coda 的使用指南:Coda 是什么、连接、目录、会话、卡片、流程、插件、空间各是什么、怎么配合。用户问 Coda 怎么用、某个界面、菜单、状态或标记是什么意思时,先读这里再回答。"
433
433
  }
434
434
  ]
435
435
  },
436
436
  {
437
437
  "id": "maintenance",
438
438
  "displayName": "维护",
439
- "description": "按周期为每个项目做维护:把旧的工具详情移到冷文件,清掉空闲工作树的构建产物,以及已归档会话的密钥与命令输出;整台机器清一次没人引用的旧附件。",
439
+ "description": "按周期为每个目录做维护:把旧的工具详情移到冷文件,清掉空闲工作树的构建产物,以及已归档会话的密钥与命令输出;整台机器清一次没人引用的旧附件。",
440
440
  "version": "1.0.0",
441
441
  "category": "工作流程",
442
442
  "source": {
@@ -479,7 +479,7 @@
479
479
  "maintenance.uploadsAfter": {
480
480
  "type": "string",
481
481
  "format": "duration",
482
- "description": "上传后既没有发送、也没有留在草稿里的附件,过了这么久就删掉;已发送消息里的附件与消息同寿命。附件不属于任何项目,由流程 clean-uploads 按维护周期整台机器清一次。ISO 8601 时长,如 P1D。",
482
+ "description": "上传后既没有发送、也没有留在草稿里的附件,过了这么久就删掉;已发送消息里的附件与消息同寿命。附件不属于任何目录,由流程 clean-uploads 按维护周期整台机器清一次。ISO 8601 时长,如 P1D。",
483
483
  "title": "没人引用的附件多久后清掉",
484
484
  "order": 5,
485
485
  "default": "P1D"
@@ -671,7 +671,7 @@
671
671
  {
672
672
  "id": "space",
673
673
  "displayName": "空间",
674
- "description": "把几台电脑组成一个空间:在一处看各台的项目与会话,把任务派到另一台上,在一处对各台的插件一起改。安装或卸载后,这台电脑的后端会重启一下。",
674
+ "description": "把几台电脑组成一个空间:在一处看各台的目录与会话,把任务派到另一台上,在一处对各台的插件一起改。安装或卸载后,这台电脑的后端会重启一下。",
675
675
  "version": "1.1.0",
676
676
  "category": "机器与资源",
677
677
  "source": {
@@ -1257,14 +1257,14 @@
1257
1257
  "id": "review",
1258
1258
  "displayName": "PR 生命流程",
1259
1259
  "description": "会话开的 PR 从开出来起一条流程:每个新版本先跑项目声明的检查,再请另一家 Agent 评审,要求修改时交给开 PR 的会话处理、有分歧时交给你仲裁;通过后请你批准合并,跑过项目的合并前检查再合并,合并后按你的选择删除远程分支、调用项目的部署和发布流程,PR 合并或关闭时结束。",
1260
- "version": "2.7.0",
1260
+ "version": "2.8.0",
1261
1261
  "category": "工作流程",
1262
1262
  "source": {
1263
1263
  "kind": "builtin",
1264
1264
  "package": "@coda-console/review",
1265
1265
  "tag": "latest",
1266
- "version": "2.7.0",
1267
- "integrity": "sha512-RI8F5KkWgoKnvCv7Xwk7C0CwXe2AG8WcHOKOSY1oBFwe2qxXhJbgPqroc7IJkjXYhbnW23cmokt9ThP8pPD8gA==",
1266
+ "version": "2.8.0",
1267
+ "integrity": "sha512-wNKaMCX5dhlC0Xa5s1O7dXg7SokL8KXhb2FNc2lOPr86cI9E0CoO5On6L4P4EvZ7DOmBRJ9BF76R02mQmsiy7Q==",
1268
1268
  "repo": "https://github.com/coda-console/coda-plugins.git",
1269
1269
  "path": "plugins/review"
1270
1270
  },
@@ -1389,7 +1389,7 @@
1389
1389
  ],
1390
1390
  "extensionPoints": {},
1391
1391
  "extensions": [],
1392
- "instructions": "gh pr create 开出即评审,可与验证并行;合并要等别的 PR、升锁或发布的开草稿(-R 写在 --draft 前),说明写明前提,满足后 gh pr ready。只合并进默认分支,叠放的不合。合并前的验证写成流程步骤或 GitHub 必需检查。正常结束只更新状态,任务与失败送到本会话,不要轮询 PR;提前评审用 workflow_run 发起 pull-request,结论交回会话。",
1392
+ "instructions": "gh pr create 开出即评审;等其他 PR、升锁或发布的开草稿(-R 在 --draft 前),满足后 gh pr ready。只合并进默认分支;合并前验证声明为流程步骤或 GitHub 必需检查。正常结束只更新状态,任务与失败回本会话,不轮询。手动用 workflow_run 发起 pull-request 前用 gh pr view 取得完整地址传 pr;同 PR 复用未结束运行。",
1393
1393
  "defaultInstalled": false
1394
1394
  },
1395
1395
  {
@@ -98,7 +98,7 @@ export function firstMessage(value) {
98
98
  ...reply,
99
99
  ...outside,
100
100
  requestId: text(value.requestId, '请求标识', 100),
101
- projectId: text(value.projectId, '项目标识', 100),
101
+ projectId: text(value.projectId, '目录标识', 100),
102
102
  title: text(value.title ?? message.trim().slice(0, 80), '会话标题'),
103
103
  agent: value.agent,
104
104
  checkout: checkout.kind === 'worktree' ? { kind: 'worktree', baseRef: checkout.baseRef } : { kind: checkout.kind },
@@ -1,5 +1,5 @@
1
1
  {
2
- "commit": "04fd85113f83823020febc7ffc647f10d15a2ddc",
2
+ "commit": "2e5849933437879adf1a1efd75b7f4dc9d469f6a",
3
3
  "packages": {
4
4
  "@0dep/piso": "5.2.0",
5
5
  "@agentclientprotocol/sdk": "1.4.0",
@@ -13,9 +13,9 @@
13
13
  "check/coda/components/plugins/plugin-source-rules.mjs": "e03606bf3056061ee3a78494d34dae9dfbe35d6fb2f139880fab5891663cbedc",
14
14
  "check/coda/components/plugins/skill-document.mjs": "c5b5e815c42cd836572f7b60e22a46af6ac607fd9df0170fa36f955825636ce6",
15
15
  "check/coda/components/prompt-recovery/prompt-recovery.mjs": "f43f21d24c19a58113d3304f9248225b12080ab00ed15eab74bf7b94642732de",
16
- "check/coda/components/session-config/commands.mjs": "2ccc0c089d88b3f76d9098876dc60bd7e06348931773da131732c0d6c6c7a6cf",
16
+ "check/coda/components/session-config/commands.mjs": "b59772a8216d8d97d0e0fb4f094c194b3e602ef3aeca2ea3eba5919f481f791c",
17
17
  "check/coda/components/workflows/executor-labels.mjs": "dceca6ae60c0a4f3c3cc72a6c84f1489831790774c93caab96e4ddb493bc89e1",
18
- "check/coda/domain/agent-protocol.mjs": "7337cf0af97a9592bbcad98a0e4f3837d8bb4d48b53c22846a8c56a0c88a4630",
18
+ "check/coda/domain/agent-protocol.mjs": "e85866b88c802de1204d4215f7c10d345d76aa9900854d5e2d615f2d1c8f30b7",
19
19
  "check/coda/domain/duration.mjs": "15dd64ef9b02342ad521c66e5968a569432a89dc7568d11afd3e6f3fe37e104b",
20
20
  "check/coda/domain/errors.mjs": "773c641309a0d19b93c0b3457428d74ecf636454d9fe91cacf3d944b952831dc",
21
21
  "check/coda/domain/values.mjs": "01cc72b8d9c09e3fe16c93ec332ca01148bba859b1c672586d9d07444d7816c4",
@@ -24,7 +24,7 @@
24
24
  "check/coda/resources/plugins/resources/panels/panels.mjs": "aee040febb37fd6eebaf1a1da5b3299d2b6a9dfc982e649d9a628291af298179",
25
25
  "check/coda/resources/plugins/resources/panels/rules.mjs": "c024c5ede7c1516877128aa6d6796fbe5fd0e14642741b0745481bb1c5ca41d3",
26
26
  "check/coda/resources/plugins/resources/panels/sign-in.mjs": "1271a24e33b1b882a1fb9bee03b8e240db8b9bee1b5208f0e1c84499cfb1be7e",
27
- "check/coda/builtin.json": "add6de7df1f74456223275750a76919c983fd3eba2f4c0750077f7b998d9d3fc",
28
- "docs/agent-protocol.md": "2a40fac029e93bc512d0405105c9d74fa3e5a59e92788b6951dba182775875c1"
27
+ "check/coda/builtin.json": "d1865fad1440a62341188458578cf95e1afc5528229ff8a97c2a727ce7985b67",
28
+ "docs/agent-protocol.md": "322271992a6c95db24fa4f8fbddf8bec23ca9dc9e7d00e5f8bdb4258a30e1cd7"
29
29
  }
30
30
  }
@@ -7,9 +7,15 @@ export const clientCapabilities = () => ({
7
7
  elicitation: { form: {}, url: {} },
8
8
  // A config option may be a switch: shown as one, its value on or off (`options`).
9
9
  session: { compaction: {}, configOptions: { boolean: {} } },
10
- // Coda takes the agent's own waits.
11
- _meta: { coda: { waits: {} } },
10
+ // Coda takes the agent's own waits, and relays what is asked of the session from outside to an agent that takes it.
11
+ _meta: { coda: { waits: {}, remote: {} } },
12
12
  });
13
+ // The remote entry (「远端入口」): an agent whose work is done elsewhere (a bot on its own computer) declares it; the code to
14
+ // bind that place to its session is asked of Coda (`REMOTE_CODE`), and what that place then asks of the session is handed
15
+ // to the agent (`REMOTE`) as it was asked.
16
+ export const REMOTE = '_coda/remote', REMOTE_CODE = '_coda/remote/code';
17
+ export const supportsRemote = init => init?.agentCapabilities?._meta?.coda?.remote != null
18
+ && typeof init.agentCapabilities._meta.coda.remote === 'object';
13
19
  // The agent refuses until it is signed in (ACP's auth_required).
14
20
  export const SIGNED_OUT = -32000;
15
21
  // Session instructions (「会话指令」): ACP's `systemPrompt`, only to an agent that declares it, the same on every open of
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coda-console/plugin-check",
3
- "version": "0.5.8",
3
+ "version": "0.5.10",
4
4
  "description": "Coda 插件的契约检查:扮演 Coda 读清单、启动 Agent 讲 ACP 与 _coda/wait、读面板。",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,5 +28,8 @@
28
28
  },
29
29
  "publishConfig": {
30
30
  "access": "public"
31
+ },
32
+ "devDependencies": {
33
+ "feelin": "8.2.0"
31
34
  }
32
35
  }