@coda-console/plugin-check 0.6.0 → 0.7.0
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 -2
- package/check/coda/adapters/provider-api.mjs +14 -4
- package/check/coda/builtin.json +116 -85
- package/check/coda/components/composers/schemas.mjs +3 -2
- package/check/coda/components/plugins/plugin-rules.mjs +5 -0
- package/check/coda/components/plugins/plugin-source-rules.mjs +4 -0
- package/check/coda/components/protocols/creation.mjs +1 -0
- package/check/coda/components/protocols/types.mjs +27 -6
- package/check/coda/components/session-config/commands.mjs +16 -18
- package/check/coda/contract.json +12 -12
- package/check/coda/domain/resource-kinds.mjs +4 -0
- package/check/coda/resources/plugins/resources/panels/rules.mjs +14 -10
- package/package.json +2 -2
- package/check/coda/components/protocols/provider-definition.mjs +0 -11
package/README.md
CHANGED
|
@@ -17,8 +17,7 @@ plugins/opencode/ OpenCode:在运行机的 opencode acp 与 Coda 之间
|
|
|
17
17
|
plugins/codex-accounts/ Codex 多账号:管理登录、自动续期与账号选择,接管资源「Codex」
|
|
18
18
|
plugins/cursor/ Cursor:在运行机的 cursor-agent acp 与 Coda 之间转发,送入会话指令
|
|
19
19
|
plugins/git/ Git 源与快照:本机仓库 provider、运行关联的工作树/提交快照、临时 ref 回收与只读 smart HTTP v2
|
|
20
|
-
plugins/host/
|
|
21
|
-
plugins/scheduler/ 执行调度:为本机 execution 选择可用运行器,本机优先、按名额选择、安全改派与取消;政策和排队原因见插件 README
|
|
20
|
+
plugins/host/ 宿主资源:发布本机 coda/executor@1 执行环境,执行 execute 并写 coda/run@1;Xcode 构建、Apple 模拟器与项目要求排队的命令共用这台机器的一组名额(组 host、持锁执行 run-held、host-sim),资源「构建名额」
|
|
22
21
|
plugins/magpie/ Magpie:把本机的 Magpie 网关作为模型服务提供给 Pi 等插件,安装时装好 Magpie 并让网关常驻
|
|
23
22
|
plugins/network-log/ 网络记录:默认关闭,按需开启建连等待与定时探测采集;关闭后仍可查看历史
|
|
24
23
|
plugins/review/ PR 生命流程:会话开的 PR 先跑项目的检查、再交叉评审,你批准后合并、部署与发布;也是写 PR 流程的样例
|
|
@@ -330,6 +329,10 @@ Kimi 插件在 `session/prompt` 的回执中将这条已知错误改为普通执
|
|
|
330
329
|
同时按[执行失败协议](https://github.com/coda-console/coda-protocol/blob/main/docs/agent-protocol.md#执行失败)报告 `error.data._meta.coda.failure: {kind: "quota_exhausted"}`。
|
|
331
330
|
Coda 按这个通用类别显示「额度不足」,不触发服务故障重试;其他 ACP 客户端仍能读取完整原因。
|
|
332
331
|
插件不推算额度重置时间;其他认证失败、403、短时限流与普通错误原样保留。
|
|
332
|
+
Kimi 2.1.1 的 ACP 把失败的一轮(包括现在以 429 报的五小时额度耗尽)答成 `end_turn`,错误只记在它主 wire 的 `turn.ended` 里。
|
|
333
|
+
插件在交出 `session/prompt` 的回执前读到这一轮以 `failed` 结束,就改答 -32603,`error.message` 是这一轮的错误原文;
|
|
334
|
+
Kimi 自己归为 `APIProviderQuotaExhaustedError` 的另报 `quota_exhausted`,其他失败不带类别。被过滤的回复 Kimi 已答 `refusal`,不改。
|
|
335
|
+
Kimi 在一轮失败后暂停 goal,goal 的定时随之以 `failed` 结束,说明是那一轮的原因,额度耗尽时标题为「额度不足」。
|
|
333
336
|
`CODA_DISABLE_RUNTIME_PATCHES=kimi` 关闭这层适配。
|
|
334
337
|
|
|
335
338
|
### 升级 Agent 的 CLI 与 SDK
|
|
@@ -1,20 +1,30 @@
|
|
|
1
|
-
// The plugin host's local API.
|
|
1
|
+
// The plugin host's local API. A provider's own observations consume accepted objects serially per ID; the plugin chooses
|
|
2
|
+
// its own actions. `handle` keeps a plugin's operation handlers in `operations`, by kind and operation, for the protocols
|
|
3
|
+
// its manifest implements.
|
|
2
4
|
import { checkCreationReadOnly } from '../components/protocols/creation.mjs';
|
|
3
|
-
export function providerAPI({ call, watch, connection, report = console.error }) {
|
|
4
|
-
const observe = (kind, fn, scope = 'available') => watch(
|
|
5
|
+
export function providerAPI({ call, watch, connection, plugin, operations, report = console.error }) {
|
|
6
|
+
const observe = (kind, fn, scope = 'available') => watch(kind, fn, { scope });
|
|
5
7
|
return {
|
|
6
8
|
async resolve(ref, service) {
|
|
7
9
|
const { resource, path } = await call('resolve', [ref, service]);
|
|
8
10
|
const api = connection();
|
|
9
11
|
return { resource, url: `${api.url}${path}`, headers: { authorization: `Bearer ${api.token}` } };
|
|
10
12
|
},
|
|
11
|
-
define: definition => call('define', [definition]),
|
|
12
13
|
put: async object => { checkCreationReadOnly(object); return call('put', [object]); },
|
|
13
14
|
update: (kind, id, spec, revision) => call('update', [kind, id, spec, revision]),
|
|
14
15
|
setStatus: (kind, id, status, revision) => call('setStatus', [kind, id, status, revision]),
|
|
15
16
|
delete: (kind, id) => call('delete', [kind, id]),
|
|
16
17
|
publish: (kind, id, enabled = true) => call('publish', [kind, id, enabled]),
|
|
17
18
|
observe,
|
|
19
|
+
handle(kind, operation, handler) {
|
|
20
|
+
if (typeof kind !== 'string' || !kind || typeof operation !== 'string' || !operation || typeof handler !== 'function')
|
|
21
|
+
throw new TypeError('protocols.handle(协议名, 操作, handler)');
|
|
22
|
+
if (!(plugin.protocolImplementations ?? []).includes(kind)) throw new TypeError(`插件 ${plugin.id} 没有实现 ${kind}`);
|
|
23
|
+
const id = JSON.stringify([kind, operation]);
|
|
24
|
+
if (operations.has(id)) throw new TypeError(`协议操作已登记:${kind}/${operation}`);
|
|
25
|
+
operations.set(id, handler);
|
|
26
|
+
return { dispose: () => { if (operations.get(id) === handler) operations.delete(id); } };
|
|
27
|
+
},
|
|
18
28
|
async control(kind, handler, scope = 'local') {
|
|
19
29
|
if (typeof handler !== 'function') throw new TypeError('controller 须为函数');
|
|
20
30
|
const pending = new Map(), running = new Set();
|
package/check/coda/builtin.json
CHANGED
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"id": "cliproxy",
|
|
81
81
|
"displayName": "CLIProxy",
|
|
82
82
|
"description": "显示额度,把 CLIProxy 提供为模型服务",
|
|
83
|
-
"version": "1.
|
|
83
|
+
"version": "1.3.0",
|
|
84
84
|
"category": "模型与账号",
|
|
85
85
|
"icon": {
|
|
86
86
|
"symbol": "bolt.fill",
|
|
@@ -118,10 +118,10 @@
|
|
|
118
118
|
"endpoints": [],
|
|
119
119
|
"views": [],
|
|
120
120
|
"offers": {
|
|
121
|
-
"
|
|
121
|
+
"resources": [
|
|
122
122
|
{
|
|
123
123
|
"id": "antigravity",
|
|
124
|
-
"title": "Antigravity
|
|
124
|
+
"title": "Antigravity",
|
|
125
125
|
"command": "node \"$CODA_PLUGIN_PATH/scripts/antigravity.mjs\"",
|
|
126
126
|
"maxAge": "PT5M"
|
|
127
127
|
}
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
"id": "github",
|
|
190
190
|
"displayName": "GitHub",
|
|
191
191
|
"description": "登录账号,推送时自动选对账号",
|
|
192
|
-
"version": "1.
|
|
192
|
+
"version": "1.9.0",
|
|
193
193
|
"category": "模型与账号",
|
|
194
194
|
"icon": {
|
|
195
195
|
"symbol": "arrow.triangle.pull",
|
|
@@ -270,28 +270,31 @@
|
|
|
270
270
|
"command": "exec \"$CODA_NODE\" \"$CODA_PLUGIN_PATH/scripts/credential.mjs\""
|
|
271
271
|
}
|
|
272
272
|
],
|
|
273
|
-
"endpoints": [
|
|
274
|
-
|
|
273
|
+
"endpoints": [
|
|
274
|
+
{
|
|
275
|
+
"id": "accounts",
|
|
276
|
+
"command": "exec node \"$CODA_PLUGIN_PATH/scripts/endpoint.mjs\""
|
|
277
|
+
}
|
|
278
|
+
],
|
|
279
|
+
"views": [
|
|
280
|
+
{
|
|
281
|
+
"id": "accounts",
|
|
282
|
+
"title": "GitHub 账号",
|
|
283
|
+
"entry": "view/accounts.html",
|
|
284
|
+
"frame": "document"
|
|
285
|
+
}
|
|
286
|
+
],
|
|
275
287
|
"offers": {
|
|
276
|
-
"
|
|
288
|
+
"resources": [
|
|
277
289
|
{
|
|
278
290
|
"id": "accounts",
|
|
279
|
-
"title": "GitHub
|
|
280
|
-
"command": "node \"$CODA_PLUGIN_PATH/scripts/
|
|
291
|
+
"title": "GitHub",
|
|
292
|
+
"command": "node \"$CODA_PLUGIN_PATH/scripts/resources.mjs\"",
|
|
281
293
|
"maxAge": "PT1M",
|
|
282
294
|
"actions": {
|
|
283
295
|
"remove": {
|
|
284
296
|
"command": "node \"$CODA_PLUGIN_PATH/scripts/action.mjs\" remove",
|
|
285
297
|
"confirm": "移除这个账号的登录?\n它负责的 owner 之后会重新试出用哪个账号。"
|
|
286
|
-
},
|
|
287
|
-
"assign": {
|
|
288
|
-
"command": "node \"$CODA_PLUGIN_PATH/scripts/action.mjs\" assign"
|
|
289
|
-
},
|
|
290
|
-
"forget": {
|
|
291
|
-
"command": "node \"$CODA_PLUGIN_PATH/scripts/action.mjs\" forget"
|
|
292
|
-
},
|
|
293
|
-
"move": {
|
|
294
|
-
"command": "node \"$CODA_PLUGIN_PATH/scripts/action.mjs\" move"
|
|
295
298
|
}
|
|
296
299
|
},
|
|
297
300
|
"signIn": {
|
|
@@ -321,7 +324,7 @@
|
|
|
321
324
|
"id": "guide",
|
|
322
325
|
"displayName": "Coda 使用指南",
|
|
323
326
|
"description": "让 Agent 会回答 Coda 怎么用",
|
|
324
|
-
"version": "1.0.
|
|
327
|
+
"version": "1.0.3",
|
|
325
328
|
"category": "工作流程",
|
|
326
329
|
"icon": {
|
|
327
330
|
"symbol": "book.fill",
|
|
@@ -431,7 +434,7 @@
|
|
|
431
434
|
"id": "resources",
|
|
432
435
|
"displayName": "资源",
|
|
433
436
|
"description": "各台电脑的账号、额度与负载",
|
|
434
|
-
"version": "2.
|
|
437
|
+
"version": "2.1.0",
|
|
435
438
|
"category": "机器与资源",
|
|
436
439
|
"icon": {
|
|
437
440
|
"symbol": "gauge.with.dots.needle.67percent",
|
|
@@ -784,21 +787,6 @@
|
|
|
784
787
|
"order": 5,
|
|
785
788
|
"default": "PT1H"
|
|
786
789
|
},
|
|
787
|
-
"session.handToUser": {
|
|
788
|
-
"type": "boolean",
|
|
789
|
-
"description": "流程交给会话 Agent 的任务,Agent 停下没答复、也没有别的东西会叫醒它时,转成你的卡片;关掉就一直留在 Agent 那里,等它下次被叫醒。",
|
|
790
|
-
"title": "Agent 停下没答复的任务转给你",
|
|
791
|
-
"order": 8,
|
|
792
|
-
"default": true
|
|
793
|
-
},
|
|
794
|
-
"session.handToUserAfter": {
|
|
795
|
-
"type": "string",
|
|
796
|
-
"format": "duration",
|
|
797
|
-
"description": "从 Agent 最后一次干活算起。期间它刚做完的事让流程撤掉了任务(如推送新提交),就不转;进程已停就立即转。",
|
|
798
|
-
"title": "Agent 停下多久后转给你",
|
|
799
|
-
"order": 9,
|
|
800
|
-
"default": "PT2M"
|
|
801
|
-
},
|
|
802
790
|
"session.subagents": {
|
|
803
791
|
"type": "integer",
|
|
804
792
|
"minimum": 1,
|
|
@@ -970,7 +958,7 @@
|
|
|
970
958
|
"id": "claude",
|
|
971
959
|
"displayName": "Claude",
|
|
972
960
|
"description": "用 Claude Agent SDK 跑会话",
|
|
973
|
-
"version": "1.
|
|
961
|
+
"version": "1.10.0",
|
|
974
962
|
"category": "Agent",
|
|
975
963
|
"icon": {
|
|
976
964
|
"light": "JVBERi0xLjcKJbXtrvsKNCAwIG9iago8PCAvTGVuZ3RoIDUgMCBSCiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCj4+CnN0cmVhbQp4nG1WSY4YNxC76xX6QBTtyzP8hCCAnUP74OT/QFhkqWcMewaYaUrqWlisUpeY8ftHwZ/T0hrx7+/hR/gSf4Sc9shnx5z6xM/CQ+ulrBn//Rb//CvHb/+FntPaJe6T8qzxe+w15dPjbqmO+MTe0gBcwwwD9rRLjfM4HOm0HWeF3R5sYfL4OOnk6djQKkcot2LYjAAjMBybK5mxVtKG1XXskBmrIxUEsWcqw4xVxILXgfV6zbS7B60AY68yGzxXBrKzvRI+rM+dJhNr5nSWVBVZoY+x9GxUjJk6cmOU9qaw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bQplbmRvYmoKc3RhcnR4cmVmCjE3MjUKJSVFT0YK",
|
|
@@ -981,8 +969,8 @@
|
|
|
981
969
|
"kind": "builtin",
|
|
982
970
|
"package": "@coda-console/claude",
|
|
983
971
|
"tag": "latest",
|
|
984
|
-
"version": "1.
|
|
985
|
-
"integrity": "sha512-
|
|
972
|
+
"version": "1.10.0",
|
|
973
|
+
"integrity": "sha512-iG7lXu3xtzuvuMKDZiIBEzvidrMn8mPmi+WFLrJl9iY1XoLyJYyPuZa4rY3f+HNB6L0jAz2P4NsgzEtJxEry6g==",
|
|
986
974
|
"repo": "https://github.com/coda-console/coda-plugins.git",
|
|
987
975
|
"path": "plugins/claude"
|
|
988
976
|
},
|
|
@@ -1018,11 +1006,11 @@
|
|
|
1018
1006
|
"endpoints": [],
|
|
1019
1007
|
"views": [],
|
|
1020
1008
|
"offers": {
|
|
1021
|
-
"
|
|
1009
|
+
"resources": [
|
|
1022
1010
|
{
|
|
1023
1011
|
"id": "limits",
|
|
1024
1012
|
"title": "Claude",
|
|
1025
|
-
"command": "node \"$CODA_PLUGIN_PATH/scripts/
|
|
1013
|
+
"command": "node \"$CODA_PLUGIN_PATH/scripts/resources.mjs\"",
|
|
1026
1014
|
"signIn": {
|
|
1027
1015
|
"command": "exec node \"$CODA_PLUGIN_PATH/scripts/login.mjs\"",
|
|
1028
1016
|
"installed": "node \"$CODA_PLUGIN_PATH/scripts/login.mjs\" --installed",
|
|
@@ -1066,7 +1054,7 @@
|
|
|
1066
1054
|
"id": "codex",
|
|
1067
1055
|
"displayName": "Codex",
|
|
1068
1056
|
"description": "用 OpenAI Codex 跑会话",
|
|
1069
|
-
"version": "1.
|
|
1057
|
+
"version": "1.11.0",
|
|
1070
1058
|
"category": "Agent",
|
|
1071
1059
|
"icon": {
|
|
1072
1060
|
"light": "JVBERi0xLjcKJbXtrvsKNCAwIG9iago8PCAvTGVuZ3RoIDUgMCBSCiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCj4+CnN0c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1j+yFi8mPzFwgNZB30trQ45QrIJvOlzJ/fmh+IyeoKxJCvyDXiRJzT5nr73pHNY34VHa8YBZRmKUM9mE13QiaiVvRuCqbou+AXejnqpDtRV6e9O6ea4D5DCB95oZ0artEN29zyRUPl5B0fn+LfnQXr5ZdrbmnSK25bU9AutgHCpCmVuZHN0cmVhbQplbmRvYmoKMTIgMCBvYmoKICAgMjg0CmVuZG9iagoxMyAwIG9iago8PCAvVHlwZSAvWFJlZgogICAvTGVuZ3RoIDU5CiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCiAgIC9TaXplIDE0CiAgIC9XIFsxIDIgMl0KICAgL1Jvb3QgMTEgMCBSCiAgIC9JbmZvIDEwIDAgUgo+PgpzdHJlYW0KeJxjYGD4/5+JgZOBAUQwMbIcY2BgZOAHEizrQWLsQBYrH4iYACKWQtQxgghmRnZToBi7DwMDAP4JBa8KZW5kc3RyZWFtCmVuZG9iagpzdGFydHhyZWYKMTg2OAolJUVPRgo=",
|
|
@@ -1077,8 +1065,8 @@
|
|
|
1077
1065
|
"kind": "builtin",
|
|
1078
1066
|
"package": "@coda-console/codex",
|
|
1079
1067
|
"tag": "latest",
|
|
1080
|
-
"version": "1.
|
|
1081
|
-
"integrity": "sha512
|
|
1068
|
+
"version": "1.11.0",
|
|
1069
|
+
"integrity": "sha512-/Vri1yv+QOGIHZ/PIvL1A8Ai9hYcT4LbJOvZ9AcLJIACJ4tK5Mq8WBIkAPYvZgxY37rnH1EqwNAChGFlsPl75A==",
|
|
1082
1070
|
"repo": "https://github.com/coda-console/coda-plugins.git",
|
|
1083
1071
|
"path": "plugins/codex"
|
|
1084
1072
|
},
|
|
@@ -1105,11 +1093,11 @@
|
|
|
1105
1093
|
"endpoints": [],
|
|
1106
1094
|
"views": [],
|
|
1107
1095
|
"offers": {
|
|
1108
|
-
"
|
|
1096
|
+
"resources": [
|
|
1109
1097
|
{
|
|
1110
1098
|
"id": "login",
|
|
1111
1099
|
"title": "Codex",
|
|
1112
|
-
"command": "node \"$CODA_PLUGIN_PATH/scripts/
|
|
1100
|
+
"command": "node \"$CODA_PLUGIN_PATH/scripts/resources.mjs\"",
|
|
1113
1101
|
"maxAge": "PT0S",
|
|
1114
1102
|
"actions": {
|
|
1115
1103
|
"reset": {
|
|
@@ -1151,7 +1139,7 @@
|
|
|
1151
1139
|
"dependencies": [],
|
|
1152
1140
|
"extensionPoints": {
|
|
1153
1141
|
"account-source": {
|
|
1154
|
-
"description": "Codex 的账号与登录入口:来源给出当前账号和令牌,响应 --login
|
|
1142
|
+
"description": "Codex 的账号与登录入口:来源给出当前账号和令牌,响应 --login,并提供账号与额度资源;接入后 Codex 自带的那一行不再显示。"
|
|
1155
1143
|
}
|
|
1156
1144
|
},
|
|
1157
1145
|
"extensions": [],
|
|
@@ -1161,7 +1149,7 @@
|
|
|
1161
1149
|
"id": "codex-accounts",
|
|
1162
1150
|
"displayName": "Codex 多账号",
|
|
1163
1151
|
"description": "管理多个 Codex 账号与额度",
|
|
1164
|
-
"version": "2.
|
|
1152
|
+
"version": "2.3.0",
|
|
1165
1153
|
"category": "模型与账号",
|
|
1166
1154
|
"icon": {
|
|
1167
1155
|
"symbol": "person.2.fill",
|
|
@@ -1172,8 +1160,8 @@
|
|
|
1172
1160
|
"kind": "builtin",
|
|
1173
1161
|
"package": "@coda-console/codex-accounts",
|
|
1174
1162
|
"tag": "latest",
|
|
1175
|
-
"version": "2.
|
|
1176
|
-
"integrity": "sha512-
|
|
1163
|
+
"version": "2.3.0",
|
|
1164
|
+
"integrity": "sha512-CM1cYx8TbkpXa/PY+9XYmS7LQY+UnsovxbglzSCGN8m40AqGofgDpBmUlm8hf2kvYbz5/S4OBfUwH+YW7Zj4rA==",
|
|
1177
1165
|
"repo": "https://github.com/coda-console/coda-plugins.git",
|
|
1178
1166
|
"path": "plugins/codex-accounts"
|
|
1179
1167
|
},
|
|
@@ -1189,11 +1177,11 @@
|
|
|
1189
1177
|
"endpoints": [],
|
|
1190
1178
|
"views": [],
|
|
1191
1179
|
"offers": {
|
|
1192
|
-
"
|
|
1180
|
+
"resources": [
|
|
1193
1181
|
{
|
|
1194
1182
|
"id": "accounts",
|
|
1195
|
-
"title": "Codex
|
|
1196
|
-
"command": "node \"$CODA_PLUGIN_PATH/scripts/
|
|
1183
|
+
"title": "Codex",
|
|
1184
|
+
"command": "node \"$CODA_PLUGIN_PATH/scripts/resources.mjs\"",
|
|
1197
1185
|
"maxAge": "PT5M",
|
|
1198
1186
|
"actions": {
|
|
1199
1187
|
"select": {
|
|
@@ -1210,7 +1198,7 @@
|
|
|
1210
1198
|
},
|
|
1211
1199
|
"signIn": {
|
|
1212
1200
|
"command": "NO_COLOR=1 exec node \"$CODA_PLUGIN_PATH/scripts/login.mjs\"",
|
|
1213
|
-
"note": "
|
|
1201
|
+
"note": "登录其他账号即可添加;登录已有账号会更新其凭据。首个账号会自动选用,之后在账号那一行的「···」里切换。"
|
|
1214
1202
|
}
|
|
1215
1203
|
}
|
|
1216
1204
|
]
|
|
@@ -1233,7 +1221,7 @@
|
|
|
1233
1221
|
"id": "composer",
|
|
1234
1222
|
"displayName": "输入框模式",
|
|
1235
1223
|
"description": "交接、子会话、! 命令、Ultra 与循环",
|
|
1236
|
-
"version": "3.
|
|
1224
|
+
"version": "3.10.1",
|
|
1237
1225
|
"category": "工作流程",
|
|
1238
1226
|
"icon": {
|
|
1239
1227
|
"symbol": "character.cursor.ibeam",
|
|
@@ -1244,8 +1232,8 @@
|
|
|
1244
1232
|
"kind": "builtin",
|
|
1245
1233
|
"package": "@coda-console/composer",
|
|
1246
1234
|
"tag": "latest",
|
|
1247
|
-
"version": "3.
|
|
1248
|
-
"integrity": "sha512-
|
|
1235
|
+
"version": "3.10.1",
|
|
1236
|
+
"integrity": "sha512-21uk17cG/JCC8ohPzJy5bvJnY8e75c0SAec77hr6hxv00SvyoZtKrfeG2sz3bbOZqz/v3lxOoJ1AeVBZ81gfOw==",
|
|
1249
1237
|
"repo": "https://github.com/coda-console/coda-plugins.git",
|
|
1250
1238
|
"path": "plugins/composer"
|
|
1251
1239
|
},
|
|
@@ -1584,7 +1572,7 @@
|
|
|
1584
1572
|
"id": "grok",
|
|
1585
1573
|
"displayName": "Grok",
|
|
1586
1574
|
"description": "用 Grok CLI 跑会话",
|
|
1587
|
-
"version": "1.
|
|
1575
|
+
"version": "1.6.0",
|
|
1588
1576
|
"category": "Agent",
|
|
1589
1577
|
"icon": {
|
|
1590
1578
|
"light": "JVBERi0xLjcKJbXtrvsKNCAwIG9iago8PCAvTGVuZ3RoIDUgMCBSCiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCj4+CnN0cmVhbQp4nFVTTcoVQQzc9ymyFoxJ57eP4RFkwG/zXKj3Byv9UJCBGZLupCpVGSXB81nx0rPp+bF+Lrm5Xx/05ZvQx+9Vzpqke7Nt+kFqxaedKlg96EXqyqpGtbm3IwyOTirjMkTF0puqUL3oIQ3nszed5D3noezapHpY7KB7cIvi65y1p2AL60EmhE2CTrNnLMQA2EXVnHIu7EGjhyIvgAYSQHhRN1oHKTjsxMEeCFSU8jmJTn7eHLzZfFpo9h1O9+E4mAnDnInF361wHtuoBVL8LYha1Mrig6kpXFKE8RU3tIRDmsw4AxQOwiIQvMUHVaEIbfRDFKaLIED22MIiTjZcLxLkRZkJu/VF+pewOEiMX1ZvwyxpvSjlOqZArw54aNDMR/TNvpN8gxwcPWx1KIEPNigyHQNgdLqSwzDBiNB/ZHfgO0TU5kYRpDvqww8HmNDe8eu/eEJLFigHm1OwEGpYHsH5vvevN10zDK4/l2G1EtLhNdjWRhsTNrVz0IbZVbRAUzg3bh4uJKJAKwhoqdeFrjvCTPLQLqAHJYrRTRmE0Bpu0wIRrVl354oZyEdXWOZ+NRvAmL0dGfA1djipWH60egjCpt9VO3kWXOvEJXDGD4Y9tD2Gjx+p149ZxBd9/7S+rj95P69MCmVuZHN0cmVhbQplbmRvYmoKNSAwIG9iagogICA0ODQKZW5kb2JqCjMgMCBvYmoKPDwKICAgL0V4d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FgQplbmRzdHJlYW0KZW5kb2JqCnN0YXJ0eHJlZgoxMjM3CiUlRU9GCg==",
|
|
@@ -1595,8 +1583,8 @@
|
|
|
1595
1583
|
"kind": "builtin",
|
|
1596
1584
|
"package": "@coda-console/grok",
|
|
1597
1585
|
"tag": "latest",
|
|
1598
|
-
"version": "1.
|
|
1599
|
-
"integrity": "sha512-
|
|
1586
|
+
"version": "1.6.0",
|
|
1587
|
+
"integrity": "sha512-BPmNhauZXOTCdnyuVoydvVdH/szTHFDlaISF0CfcgIFyMv2jMKrElDy7+H97nGexKIpLLp+iZuUmSIj7L4sxog==",
|
|
1600
1588
|
"repo": "https://github.com/coda-console/coda-plugins.git",
|
|
1601
1589
|
"path": "plugins/grok"
|
|
1602
1590
|
},
|
|
@@ -1612,11 +1600,11 @@
|
|
|
1612
1600
|
"endpoints": [],
|
|
1613
1601
|
"views": [],
|
|
1614
1602
|
"offers": {
|
|
1615
|
-
"
|
|
1603
|
+
"resources": [
|
|
1616
1604
|
{
|
|
1617
1605
|
"id": "account",
|
|
1618
1606
|
"title": "Grok",
|
|
1619
|
-
"command": "node \"$CODA_PLUGIN_PATH/scripts/
|
|
1607
|
+
"command": "node \"$CODA_PLUGIN_PATH/scripts/resources.mjs\"",
|
|
1620
1608
|
"maxAge": "PT5M",
|
|
1621
1609
|
"signIn": {
|
|
1622
1610
|
"command": "g=\"$HOME/.grok/bin/grok\"; [ -x \"$g\" ] || g=grok; BROWSER=/usr/bin/true NO_COLOR=1 exec \"$g\" login --device-auth",
|
|
@@ -1662,7 +1650,7 @@
|
|
|
1662
1650
|
"id": "kimi",
|
|
1663
1651
|
"displayName": "Kimi Code",
|
|
1664
1652
|
"description": "用 Kimi Code 跑会话",
|
|
1665
|
-
"version": "1.
|
|
1653
|
+
"version": "1.4.1",
|
|
1666
1654
|
"category": "Agent",
|
|
1667
1655
|
"icon": {
|
|
1668
1656
|
"light": "JVBERi0xLjcKJbXtrvsKNCAwIG9iago8PCAvTGVuZ3RoIDU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.
|
|
1678
|
-
"integrity": "sha512-
|
|
1665
|
+
"version": "1.4.1",
|
|
1666
|
+
"integrity": "sha512-bBLlDqgdZWnEDb3l7LPKYWamyd05jV9Ptelwcjz/DQpzfw/YbBN316crIgk7L2dVOvcmZgdL+VFtGU83nXA7+A==",
|
|
1679
1667
|
"repo": "https://github.com/coda-console/coda-plugins.git",
|
|
1680
1668
|
"path": "plugins/kimi"
|
|
1681
1669
|
},
|
|
@@ -1691,11 +1679,11 @@
|
|
|
1691
1679
|
"endpoints": [],
|
|
1692
1680
|
"views": [],
|
|
1693
1681
|
"offers": {
|
|
1694
|
-
"
|
|
1682
|
+
"resources": [
|
|
1695
1683
|
{
|
|
1696
1684
|
"id": "account",
|
|
1697
1685
|
"title": "Kimi",
|
|
1698
|
-
"command": "node \"$CODA_PLUGIN_PATH/scripts/
|
|
1686
|
+
"command": "node \"$CODA_PLUGIN_PATH/scripts/resources.mjs\"",
|
|
1699
1687
|
"maxAge": "PT5M",
|
|
1700
1688
|
"signIn": {
|
|
1701
1689
|
"command": "exec sh \"$CODA_PLUGIN_PATH/scripts/login.sh\"",
|
|
@@ -2001,29 +1989,23 @@
|
|
|
2001
1989
|
{
|
|
2002
1990
|
"id": "machine-stats",
|
|
2003
1991
|
"displayName": "机器负载",
|
|
2004
|
-
"description": "
|
|
2005
|
-
"version": "
|
|
1992
|
+
"description": "CPU、内存、磁盘、网络与温度读数",
|
|
1993
|
+
"version": "2.0.0",
|
|
2006
1994
|
"category": "机器与资源",
|
|
1995
|
+
"icon": {
|
|
1996
|
+
"symbol": "cpu",
|
|
1997
|
+
"color": "green"
|
|
1998
|
+
},
|
|
2007
1999
|
"readme": true,
|
|
2008
2000
|
"source": {
|
|
2009
2001
|
"kind": "builtin",
|
|
2010
2002
|
"repo": "https://github.com/coda-console/machine-stats.git",
|
|
2011
2003
|
"path": "",
|
|
2012
|
-
"commit": "
|
|
2004
|
+
"commit": "957498f60cdd2fdd95f431ad07060f3f8e8ff84b"
|
|
2013
2005
|
},
|
|
2014
2006
|
"dir": "node_modules/machine-stats",
|
|
2015
2007
|
"title": "机器负载",
|
|
2016
|
-
"properties": {
|
|
2017
|
-
"machine-stats.display": {
|
|
2018
|
-
"type": "object",
|
|
2019
|
-
"description": "资源页显示的指标,按磁盘与网卡分别选择。",
|
|
2020
|
-
"title": "显示指标",
|
|
2021
|
-
"entries": {
|
|
2022
|
-
"type": "boolean"
|
|
2023
|
-
},
|
|
2024
|
-
"default": {}
|
|
2025
|
-
}
|
|
2026
|
-
},
|
|
2008
|
+
"properties": {},
|
|
2027
2009
|
"workflows": [],
|
|
2028
2010
|
"capabilities": [],
|
|
2029
2011
|
"services": [],
|
|
@@ -2033,12 +2015,61 @@
|
|
|
2033
2015
|
"endpoints": [],
|
|
2034
2016
|
"views": [],
|
|
2035
2017
|
"offers": {
|
|
2036
|
-
"
|
|
2018
|
+
"resources": [
|
|
2019
|
+
{
|
|
2020
|
+
"id": "cpu",
|
|
2021
|
+
"title": "CPU",
|
|
2022
|
+
"command": "node \"$CODA_PLUGIN_PATH/scripts/stats.mjs\" cpu"
|
|
2023
|
+
},
|
|
2024
|
+
{
|
|
2025
|
+
"id": "memory",
|
|
2026
|
+
"title": "内存",
|
|
2027
|
+
"command": "node \"$CODA_PLUGIN_PATH/scripts/stats.mjs\" memory"
|
|
2028
|
+
},
|
|
2029
|
+
{
|
|
2030
|
+
"id": "swap",
|
|
2031
|
+
"title": "交换空间",
|
|
2032
|
+
"command": "node \"$CODA_PLUGIN_PATH/scripts/stats.mjs\" swap",
|
|
2033
|
+
"hidden": true
|
|
2034
|
+
},
|
|
2035
|
+
{
|
|
2036
|
+
"id": "disks",
|
|
2037
|
+
"title": "磁盘",
|
|
2038
|
+
"command": "node \"$CODA_PLUGIN_PATH/scripts/stats.mjs\" disks"
|
|
2039
|
+
},
|
|
2040
|
+
{
|
|
2041
|
+
"id": "disk-io",
|
|
2042
|
+
"title": "磁盘读写",
|
|
2043
|
+
"command": "node \"$CODA_PLUGIN_PATH/scripts/stats.mjs\" disk-io",
|
|
2044
|
+
"hidden": true
|
|
2045
|
+
},
|
|
2046
|
+
{
|
|
2047
|
+
"id": "network",
|
|
2048
|
+
"title": "网络",
|
|
2049
|
+
"command": "node \"$CODA_PLUGIN_PATH/scripts/stats.mjs\" network"
|
|
2050
|
+
},
|
|
2051
|
+
{
|
|
2052
|
+
"id": "temperature",
|
|
2053
|
+
"title": "温度",
|
|
2054
|
+
"command": "node \"$CODA_PLUGIN_PATH/scripts/stats.mjs\" temperature"
|
|
2055
|
+
},
|
|
2056
|
+
{
|
|
2057
|
+
"id": "gpu",
|
|
2058
|
+
"title": "GPU",
|
|
2059
|
+
"command": "node \"$CODA_PLUGIN_PATH/scripts/stats.mjs\" gpu",
|
|
2060
|
+
"hidden": true
|
|
2061
|
+
},
|
|
2062
|
+
{
|
|
2063
|
+
"id": "battery",
|
|
2064
|
+
"title": "电池",
|
|
2065
|
+
"command": "node \"$CODA_PLUGIN_PATH/scripts/stats.mjs\" battery",
|
|
2066
|
+
"hidden": true
|
|
2067
|
+
},
|
|
2037
2068
|
{
|
|
2038
|
-
"id": "
|
|
2039
|
-
"title": "
|
|
2040
|
-
"command": "node \"$CODA_PLUGIN_PATH/scripts/stats.mjs\"",
|
|
2041
|
-
"
|
|
2069
|
+
"id": "fans",
|
|
2070
|
+
"title": "风扇",
|
|
2071
|
+
"command": "node \"$CODA_PLUGIN_PATH/scripts/stats.mjs\" fans",
|
|
2072
|
+
"hidden": true
|
|
2042
2073
|
}
|
|
2043
2074
|
]
|
|
2044
2075
|
},
|
|
@@ -17,13 +17,14 @@ export const target = {
|
|
|
17
17
|
],
|
|
18
18
|
};
|
|
19
19
|
const snapshotMode = object({ mode, values, sent: { type: 'integer', minimum: 0 }, changedSinceSent: { type: 'boolean' } });
|
|
20
|
-
export const
|
|
20
|
+
export const COMPOSER = 'coda/composer@1', SUBMISSION = 'coda/submission@1';
|
|
21
|
+
export const composerType = { kind: COMPOSER, participants: () => [],
|
|
21
22
|
spec: { ...object({ thread: string, project: string, modes: array(object({ mode, values })) }, ['modes']),
|
|
22
23
|
oneOf: [{ required: ['thread'], not: { required: ['project'] } }, { required: ['project'], not: { required: ['thread'] } }] },
|
|
23
24
|
status: object({ modes: array(object({ mode, sent: { type: 'integer', minimum: 0 }, changedSinceSent: { type: 'boolean' }, presets: { type: 'object', additionalProperties: array(object({ name: {}, values: array(values) })) } })) }) };
|
|
24
25
|
const tell = array({ type: 'string', minLength: 1, pattern:'^[^\\u0000]*\\S[^\\u0000]*$' });
|
|
25
26
|
const targets = array(target), divert = { type: 'boolean' };
|
|
26
|
-
export const submissionType = { kind:
|
|
27
|
+
export const submissionType = { kind: SUBMISSION,
|
|
27
28
|
participants: object => object.spec.modes.map(({ mode }) => { const [plugin, key] = mode.split('/'); return { plugin, key }; }),
|
|
28
29
|
spec: object({ composer: string, thread: { type: ['string', 'null'] }, projectId: string, text: { type: 'string', minLength: 1, maxLength: 100000 },
|
|
29
30
|
attachments: { ...array(string), maxItems: 20, uniqueItems: true }, quotes: { ...array({ type: 'string', maxLength: 20000 }), maxItems: 20 },
|
|
@@ -19,6 +19,7 @@ import { AGENT_ID } from '../../domain/values.mjs';
|
|
|
19
19
|
import { agentDeclarations, iconFiles } from './agent-plugins.mjs';
|
|
20
20
|
import { checkCatalog, extensionsFor } from './plugin-extensions.mjs';
|
|
21
21
|
import { manifestProblem, TYPES } from '@coda-console/protocol/validate';
|
|
22
|
+
import { ownedProtocolsProblem } from '@coda-console/protocol/protocol';
|
|
22
23
|
import { claims, COMMIT, INTEGRITY, NPM_VERSION, npmPluginId, repoAddress, sourcePath } from './plugin-source-rules.mjs';
|
|
23
24
|
import { readSkillDocument } from './skill-document.mjs';
|
|
24
25
|
import { executorLabels } from '../workflows/executor-labels.mjs';
|
|
@@ -125,6 +126,8 @@ export function readPlugin(dir, source) {
|
|
|
125
126
|
if (!named && source?.package && typeof manifest.name === 'string') try { id = npmPluginId(manifest.name); } catch {}
|
|
126
127
|
check(typeof id === 'string' && ID.test(id), 'invalid_plugin', `package.json 的 ${named ? 'id' : 'name'} 只能用小写字母、数字和「-」`);
|
|
127
128
|
const contributes = manifest.contributes ?? {}, configuration = contributes.configuration ?? {};
|
|
129
|
+
const protocolsProblem = ownedProtocolsProblem({ id, contributes: { protocols: contributes.protocols } });
|
|
130
|
+
check(!protocolsProblem, 'invalid_plugin', protocolsProblem);
|
|
128
131
|
const properties = Object.fromEntries(Object.entries(configuration.properties ?? {}).map(([key, value]) => {
|
|
129
132
|
check(key.split('.')[0] === id, 'invalid_plugin', `设置名须以「${id}.」开头:${key}`);
|
|
130
133
|
return [key, setting(value, key)];
|
|
@@ -152,6 +155,8 @@ export function readPlugin(dir, source) {
|
|
|
152
155
|
...(v.icon ? { icon: v.icon } : {}), ...(v.handles?.length ? { handles: [...v.handles] } : {}), ...(v.readout ? { readout: v.readout } : {}),
|
|
153
156
|
...(v.checkout ? { checkout: v.checkout } : {}), ...(v.frame ? { frame: v.frame } : {}) })),
|
|
154
157
|
...(contributes.composerModes?.length ? { composerModes: composerModes(contributes.composerModes) } : {}),
|
|
158
|
+
...(contributes.protocols?.length ? { protocols: structuredClone(contributes.protocols) } : {}),
|
|
159
|
+
...(contributes.protocolImplementations?.length ? { protocolImplementations: [...contributes.protocolImplementations] } : {}),
|
|
155
160
|
...(Object.keys(offers).length ? { offers } : {}),
|
|
156
161
|
agents,
|
|
157
162
|
dependencies: [...dependencies], extensionPoints: extensionPoints(contributes.extensionPoints, dir),
|
|
@@ -279,6 +279,10 @@ export function catalogProblem(plugin, catalog, builtin, installed) {
|
|
|
279
279
|
const owner = [...catalog.values()].find(p => p.id !== plugin.id && claims(p).includes(claim));
|
|
280
280
|
if (owner) return `${claim} 已由插件 ${owner.displayName} 声明`;
|
|
281
281
|
}
|
|
282
|
+
for (const definition of plugin.protocols ?? []) {
|
|
283
|
+
const owner = [...catalog.values()].find(p => p.id !== plugin.id && p.protocols?.some(other => other.name === definition.name));
|
|
284
|
+
if (owner) return `协议 ${definition.name} 已由插件 ${owner.displayName} 定义`;
|
|
285
|
+
}
|
|
282
286
|
return null;
|
|
283
287
|
}
|
|
284
288
|
// What installing a plugin from a repository brings along, in the order installing does it (components/plugins/plugin-extensions.mjs
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Ajv2020 from 'ajv/dist/2020.js';
|
|
2
|
+
import { parseProtocolName } from '@coda-console/protocol/protocol';
|
|
3
|
+
import { AGENTS, GROUPS, THREADS } from '../../domain/resource-kinds.mjs';
|
|
4
|
+
|
|
5
|
+
// The resource kinds an invocation may name until the resource is a protocol of its own (docs/plugins.md「调用」): `threads`,
|
|
6
|
+
// `agents`, `groups`. Only Coda's own core operations use these; a plugin defines protocols under its namespace.
|
|
7
|
+
const KINDS = new Set([AGENTS, GROUPS, THREADS]);
|
|
8
|
+
export const resourceKind = value => KINDS.has(value);
|
|
2
9
|
|
|
3
10
|
// Only JSON Schema rules: no coercion, custom keywords or executable constraints. Only the type's schemas
|
|
4
11
|
// supply defaults. An absent field without a declared default stays absent.
|
|
5
|
-
const
|
|
6
|
-
const
|
|
12
|
+
const options = { allErrors: true, addUsedSchema: false, strict: true, strictTypes: false, strictRequired: false, allowUnionTypes: true };
|
|
13
|
+
const ajv = new Ajv2020(options);
|
|
14
|
+
const defaults = new Ajv2020({ ...options, useDefaults: true });
|
|
7
15
|
const object = value => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
8
16
|
const compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
9
17
|
|
|
@@ -19,10 +27,23 @@ export function validate(check, value, who) {
|
|
|
19
27
|
|
|
20
28
|
export class ProtocolTypes {
|
|
21
29
|
constructor() { this.types = new Map(); }
|
|
22
|
-
register({ kind, spec, status, contributions = {}, participants }, registered = () => {}) {
|
|
23
|
-
if (
|
|
30
|
+
register({ kind, spec, status, operations = {}, contributions = {}, participants = () => [] }, registered = () => {}, replace = false) {
|
|
31
|
+
if (!(parseProtocolName(kind) || resourceKind(kind)) || (this.types.has(kind) && !replace)) throw new TypeError(`协议名无效或已登记:${kind}`);
|
|
24
32
|
if (spec?.type !== 'object' || status?.type !== 'object') throw new TypeError(`${kind}: spec 与 status 须为对象 schema`);
|
|
25
33
|
if (typeof participants !== 'function' || !object(contributions)) throw new TypeError(`${kind}: 需要 participants 与 contributions`);
|
|
34
|
+
// Each operation is an input and either an immediate result or a run reference, as the protocol package defines them.
|
|
35
|
+
// `join` names an input field holding the run of an open call that the operation adds to instead of opening one;
|
|
36
|
+
// `safe`, one that only reads and answers at once, whose request and answer neither side keeps.
|
|
37
|
+
if (!object(operations)) throw new TypeError(`${kind}: operations 须为对象`);
|
|
38
|
+
const compiled = new Map();
|
|
39
|
+
for (const [name, operation] of Object.entries(operations)) {
|
|
40
|
+
if (!/^[a-z][a-z0-9-]{0,63}$/.test(name) || !object(operation)) throw new TypeError(`${kind}.${name}: 操作名或定义无效`);
|
|
41
|
+
const run = operation.run === true, join = operation.join;
|
|
42
|
+
if (run === Object.hasOwn(operation, 'result') || !operation.input) throw new TypeError(`${kind}.${name}: 操作要写 input,并恰写 result 或 run`);
|
|
43
|
+
if (join !== undefined && (!run || typeof join !== 'string' || !join)) throw new TypeError(`${kind}.${name}: join 只能用于运行,并写出输入里的字段`);
|
|
44
|
+
compiled.set(name, { input: compile(operation.input), ...(run ? { run } : { result: compile(operation.result) }), ...(join ? { join } : {}),
|
|
45
|
+
...(operation.safe === true ? { safe: true } : {}) });
|
|
46
|
+
}
|
|
26
47
|
const properties = {};
|
|
27
48
|
for (const [field, { merge, schema }] of Object.entries(contributions)) {
|
|
28
49
|
const type = merge === 'append' ? 'array' : merge === 'or' ? 'boolean' : null;
|
|
@@ -31,7 +52,7 @@ export class ProtocolTypes {
|
|
|
31
52
|
}
|
|
32
53
|
Object.defineProperty(properties, field, { value: schema, enumerable: true });
|
|
33
54
|
}
|
|
34
|
-
const type = { kind, participants, contributions: structuredClone(contributions),
|
|
55
|
+
const type = { kind, participants, contributions: structuredClone(contributions), operations: compiled,
|
|
35
56
|
spec: compile(spec, defaults), status: compile(status, defaults),
|
|
36
57
|
// Before supplementation only merge operands must be shaped correctly. Required fields and counts apply to the
|
|
37
58
|
// complete spec, so a participant can supply a required list that the initial object does not have yet.
|
|
@@ -60,16 +60,26 @@ const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
|
60
60
|
export function firstMessage(value) {
|
|
61
61
|
object(value, '首次发送');
|
|
62
62
|
keys(value, ['requestId', 'projectId', 'title', 'agent', 'checkout', 'settings', 'text', 'attachments', 'quotes', 'handoffSource', 'parentThreadId',
|
|
63
|
-
'replyTo', 'threadId', '
|
|
63
|
+
'replyTo', 'threadId', 'modes', 'initiatedBy', 'link']);
|
|
64
64
|
const initiatedBy = value.initiatedBy === undefined ? {} : (() => {
|
|
65
65
|
const source = object(value.initiatedBy, '发起会话');
|
|
66
66
|
keys(source, ['threadId', 'title']);
|
|
67
67
|
check(UUID.test(source.threadId ?? ''), 'invalid_input', '发起会话标识须为 UUID');
|
|
68
|
-
check(!value.parentThreadId && !value.
|
|
68
|
+
check(!value.parentThreadId && !value.handoffSource, 'invalid_input', '发起的会话须为独立会话');
|
|
69
69
|
return { initiatedBy: { threadId: source.threadId, title: text(source.title, '发起会话标题') } };
|
|
70
70
|
})();
|
|
71
71
|
const handoff = value.handoffSource === undefined ? {} : { handoffSource: text(value.handoffSource, '交接来源', 100) };
|
|
72
72
|
const parent = value.parentThreadId === undefined ? {} : { parentThreadId: text(value.parentThreadId, '父会话', 100) };
|
|
73
|
+
// A session made in a session a plugin provides, as its bot (components/session-links): the `coda/session@1` record, this
|
|
74
|
+
// machine's or another's by its `remote:` reference, and what there wakes it — a message that @s or answers it
|
|
75
|
+
// (`mention`, the default), or any (`all`). That the record is one a provider has is checked as the session is made.
|
|
76
|
+
const link = value.link === undefined ? {} : (() => {
|
|
77
|
+
const named = object(value.link, '外部会话');
|
|
78
|
+
keys(named, ['record', 'wake']);
|
|
79
|
+
check(!parent.parentThreadId && !value.initiatedBy, 'invalid_input', '外部会话里的会话须为用户新建的独立会话');
|
|
80
|
+
check([undefined, 'mention', 'all'].includes(named.wake), 'invalid_input', 'wake 须为 mention 或 all');
|
|
81
|
+
return { link: { record: text(named.record, '外部会话', 2048), wake: named.wake ?? 'mention' } };
|
|
82
|
+
})();
|
|
73
83
|
check(!parent.parentThreadId || handoff.handoffSource === parent.parentThreadId, 'invalid_input', '子会话必须引用父会话上下文');
|
|
74
84
|
// Whom a child the user starts answers (#1904「回复权」): its parent, as a call of the parent's would (`parent`, the
|
|
75
85
|
// default), or the user who started it (`sender`): under its parent all the same, which is where it belongs, not whom it
|
|
@@ -78,21 +88,9 @@ export function firstMessage(value) {
|
|
|
78
88
|
const reply = value.replyTo === 'sender' ? { replyTo: 'sender' } : {};
|
|
79
89
|
// Which agents may run is the store's to say (its plugin installed); here only that it names one.
|
|
80
90
|
check(typeof value.agent === 'string' && AGENT_ID.test(value.agent), 'invalid_input', 'Agent 不可用');
|
|
81
|
-
// A session an
|
|
82
|
-
//
|
|
83
|
-
|
|
84
|
-
// `location`, where the parent is, in words — all as the extension knows them. Only an extension may say so
|
|
85
|
-
// (transport/http.mjs); the child works in a worktree of its own, and is nobody's child here.
|
|
86
|
-
const outside = value.extensionParent === undefined ? {} : (() => {
|
|
87
|
-
const p = object(value.extensionParent, '父会话');
|
|
88
|
-
keys(p, ['caller', 'threadId', 'title', 'location']);
|
|
89
|
-
check(UUID.test(value.threadId ?? ''), 'invalid_input', '扩展发起的子会话须带会话标识(UUID)');
|
|
90
|
-
check(value.parentThreadId === undefined && value.handoffSource === undefined && value.checkout?.kind === 'worktree', 'invalid_input',
|
|
91
|
-
'扩展发起的子会话只在新工作树里开始');
|
|
92
|
-
return { threadId: value.threadId, extensionParent: { caller: text(p.caller, '调用方', 200), threadId: text(p.threadId, '父会话', 100),
|
|
93
|
-
title: typeof p.title === 'string' ? p.title.slice(0, 200) : '', ...(typeof p.location === 'string' && p.location ? { location: p.location.slice(0, 200) } : {}) } };
|
|
94
|
-
})();
|
|
95
|
-
check(value.threadId === undefined || value.extensionParent !== undefined || value.initiatedBy !== undefined,
|
|
91
|
+
// A session an agent started of its own (initiatedBy) names its own ID, so that a retry finds it; the child the user
|
|
92
|
+
// starts from the interface is under its parent, in a checkout it names.
|
|
93
|
+
check(value.threadId === undefined || value.initiatedBy !== undefined,
|
|
96
94
|
'invalid_input', '只有 Agent 发起的会话可以指定会话标识');
|
|
97
95
|
if (value.threadId !== undefined) check(UUID.test(value.threadId), 'invalid_input', '会话标识须为 UUID');
|
|
98
96
|
const checkout = object(value.checkout, '工作位置');
|
|
@@ -110,8 +108,8 @@ export function firstMessage(value) {
|
|
|
110
108
|
...handoff,
|
|
111
109
|
...initiatedBy,
|
|
112
110
|
...parent,
|
|
111
|
+
...link,
|
|
113
112
|
...reply,
|
|
114
|
-
...outside,
|
|
115
113
|
...(value.threadId === undefined ? {} : { threadId: value.threadId }),
|
|
116
114
|
requestId: text(value.requestId, '请求标识', 100),
|
|
117
115
|
projectId: text(value.projectId, '目录标识', 100),
|
package/check/coda/contract.json
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
{
|
|
2
|
-
"commit": "
|
|
2
|
+
"commit": "c5dcba044bf07a0c0466c04765f32b717c6b7cf7",
|
|
3
3
|
"packages": {
|
|
4
4
|
"@0dep/piso": "5.2.0",
|
|
5
5
|
"@agentclientprotocol/sdk": "1.4.0",
|
|
6
|
-
"@coda-console/protocol": "
|
|
6
|
+
"@coda-console/protocol": "3.0.0",
|
|
7
7
|
"ajv": "8.20.0",
|
|
8
8
|
"yaml": "2.9.1"
|
|
9
9
|
},
|
|
10
10
|
"files": {
|
|
11
|
-
"check/coda/components/protocols/creation.mjs": "
|
|
12
|
-
"check/coda/components/protocols/
|
|
13
|
-
"check/coda/
|
|
14
|
-
"check/coda/adapters/provider-api.mjs": "8a2b5d7b4a3766f9e28270bd355f4b4081d3069b4cedad120671995bea160253",
|
|
11
|
+
"check/coda/components/protocols/creation.mjs": "2b4a400d3064af4b5106077dc783c567910fef3c47b2d52af3f0d838c5accf19",
|
|
12
|
+
"check/coda/components/protocols/types.mjs": "b101452e2638b1dd27e103e58f6c56ee2e19d598840d8f59c4bb8e06687bf4da",
|
|
13
|
+
"check/coda/adapters/provider-api.mjs": "a584316c3e0dafa19667f4288c54b8f894b49de72d9f62098d592b9084dec482",
|
|
15
14
|
"check/coda/adapters/admission-api.mjs": "461b5a8a1ad73d7afed5db308813d02324e29c643b8e773ad127d4bdb00fb524",
|
|
16
|
-
"check/coda/components/composers/schemas.mjs": "
|
|
15
|
+
"check/coda/components/composers/schemas.mjs": "6d497f58147756e789f9a566b2366f2fe36c0c72310421fb02508bf24a04f2c0",
|
|
17
16
|
"check/coda/components/plugins/agent-plugins.mjs": "7ca5c0303c6fedffa7b0bcd90546273356ebc410b101f203f2ee8e7503063403",
|
|
18
17
|
"check/coda/components/plugins/plugin-extensions.mjs": "4d7963185195ba6d21a4e49a66987613d5892210b1eb1dc02cffb7b816407776",
|
|
19
|
-
"check/coda/components/plugins/plugin-rules.mjs": "
|
|
20
|
-
"check/coda/components/plugins/plugin-source-rules.mjs": "
|
|
18
|
+
"check/coda/components/plugins/plugin-rules.mjs": "5c6aeb7025337098f33844b743faaaa4cf122c343c3a897d755b00098a5d4938",
|
|
19
|
+
"check/coda/components/plugins/plugin-source-rules.mjs": "cdbe62cc3264469ec91ef7b8ff011a4b8313210f02bd44feb6bfb19eb4624fb9",
|
|
21
20
|
"check/coda/components/plugins/skill-document.mjs": "153ad3c096c7c9b7774bcf7dcc0ba603c962ee1ac8697c8a71e3f2c9ba9c92e6",
|
|
22
21
|
"check/coda/components/prompt-recovery/prompt-recovery.mjs": "f43f21d24c19a58113d3304f9248225b12080ab00ed15eab74bf7b94642732de",
|
|
23
|
-
"check/coda/components/session-config/commands.mjs": "
|
|
22
|
+
"check/coda/components/session-config/commands.mjs": "b8505802e25590435bf48d741522d85c8b185e8f2ae190d49e53eebd35a1d453",
|
|
24
23
|
"check/coda/components/workflows/executor-labels.mjs": "dceca6ae60c0a4f3c3cc72a6c84f1489831790774c93caab96e4ddb493bc89e1",
|
|
25
24
|
"check/coda/domain/agent-protocol.mjs": "769cc10dc21b3cef7718f94272aaef2d17d4882d42617b408cb47357abfc3bcb",
|
|
26
25
|
"check/coda/domain/duration.mjs": "15dd64ef9b02342ad521c66e5968a569432a89dc7568d11afd3e6f3fe37e104b",
|
|
27
26
|
"check/coda/domain/errors.mjs": "ddc00aef9bb6f9a56845a9926c82200628a906230d31212d88fcde48e36dfd36",
|
|
28
27
|
"check/coda/domain/resource-admission.mjs": "775b1d7067f9d8487a3504d737f3f4bea31adf77af3357ed42e313805e5188e7",
|
|
29
28
|
"check/coda/domain/plugin-services.mjs": "940a72a14da980188a32c790c7f341d3ec0062a6e87ef1ebc9ef051798ea0a75",
|
|
29
|
+
"check/coda/domain/resource-kinds.mjs": "32d020457484823ce8c2ce1c6ec10cef9d6dabafc4d0c640b4084a8339622930",
|
|
30
30
|
"check/coda/domain/values.mjs": "01cc72b8d9c09e3fe16c93ec332ca01148bba859b1c672586d9d07444d7816c4",
|
|
31
31
|
"check/coda/kernel/agent-failures.mjs": "cbc215e2403d86f0acc765c2077197e0b529fc01e213db465c388361238ea8ce",
|
|
32
32
|
"check/coda/resources/plugins/resources/panels/command.mjs": "606f28bf87f87dded9df2db892bc7624c770d795ffab88f2409998346920ae42",
|
|
33
33
|
"check/coda/resources/plugins/resources/panels/panels.mjs": "4862dccd91c29db76caf1033ffeab743c7943befaca7406a56467c470b90a1b8",
|
|
34
|
-
"check/coda/resources/plugins/resources/panels/rules.mjs": "
|
|
34
|
+
"check/coda/resources/plugins/resources/panels/rules.mjs": "d5b12f3e0e5040224314e5d2de2bd49f5b1ed24ea205590ff99a54e8b4e96d7f",
|
|
35
35
|
"check/coda/resources/plugins/resources/panels/sign-in.mjs": "1271a24e33b1b882a1fb9bee03b8e240db8b9bee1b5208f0e1c84499cfb1be7e",
|
|
36
|
-
"check/coda/builtin.json": "
|
|
36
|
+
"check/coda/builtin.json": "1f1b4562e78e797c8e27411b785aa20ffa001b727b09d107e7b79376e3174c7a"
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -25,7 +25,7 @@ const RESOURCES = 50, VALUES = 8, ACTIONS = 8;
|
|
|
25
25
|
// What a panel's command may print: past these, the reading fails rather than being cut short.
|
|
26
26
|
export const OUTPUT_LIMIT = 64 * 1024;
|
|
27
27
|
export const ARGS_LIMIT = 4 * 1024;
|
|
28
|
-
const ITEMS = 50, CARD_ITEMS = 20, LABEL = 80, IDENTITY = 200, MARKDOWN = 4000, ERROR = 500, CONFIRM = 200;
|
|
28
|
+
const ITEMS = 50, CARD_ITEMS = 20, LABEL = 80, IDENTITY = 200, MARKDOWN = 4000, ERROR = 500, CONFIRM = 200, LINK = 2000;
|
|
29
29
|
const fail = (code, message) => check(false, code, message);
|
|
30
30
|
const keys = (value, allowed, where, code) => {
|
|
31
31
|
const extra = Object.keys(value).filter(k => !allowed.includes(k));
|
|
@@ -108,18 +108,22 @@ function plainItem(raw, where, scope, inCard) {
|
|
|
108
108
|
return fail(code, `${where} 的 type 不受支持`);
|
|
109
109
|
}
|
|
110
110
|
const BUTTON_KEYS = ['label', 'action', 'view', 'args', 'disabled', 'confirm'];
|
|
111
|
-
// What a button does: run one of the type's actions here,
|
|
112
|
-
|
|
111
|
+
// What a button does: run one of the type's actions here, open one of its plugin's views in the client, or (a resource's,
|
|
112
|
+
// `url` among `keys`) open a web page on the device.
|
|
113
|
+
function button(raw, where, scope, keys = BUTTON_KEYS) {
|
|
113
114
|
const code = 'invalid_panel';
|
|
114
|
-
const
|
|
115
|
-
check(
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
const does = ['action', 'view', 'url'].filter(k => keys.includes(k) && raw[k] !== undefined);
|
|
116
|
+
check(does.length === 1, code, `${where} 须有 ${keys.includes('url') ? 'action、view 或 url' : 'action 或 view'} 之一`);
|
|
117
|
+
const [kind] = does;
|
|
118
|
+
if (kind === 'view') check(typeof raw.view === 'string' && scope.views.includes(raw.view), code, `${where} 的 view 须是插件声明的视图:${raw.view}`);
|
|
119
|
+
else if (kind === 'action') check(typeof raw.action === 'string' && Object.hasOwn(scope.actions, raw.action), code, `${where} 的 action 须是声明的动作:${raw.action}`);
|
|
120
|
+
else check(typeof raw.url === 'string' && raw.url.length <= LINK && /^https:\/\/[^\s]+$/.test(raw.url), code, `${where} 的 url 须为不超过 ${LINK} 字的 https 地址`);
|
|
121
|
+
check(kind !== 'url' || (raw.args === undefined && raw.confirm === undefined), code, `${where}:打开网页的按钮不带 args 与 confirm`);
|
|
118
122
|
check(raw.args === undefined || (raw.args && typeof raw.args === 'object' && !Array.isArray(raw.args) && JSON.stringify(raw.args).length <= ARGS_LIMIT), code,
|
|
119
123
|
`${where} 的 args 须为不超过 ${ARGS_LIMIT} 字节的对象`);
|
|
120
124
|
check(raw.disabled === undefined || typeof raw.disabled === 'boolean', code, `${where} 的 disabled 须为开或关`);
|
|
121
125
|
// Its own question, for what this one button does (which account, which credit), in place of its action's.
|
|
122
|
-
return { label: text(raw.label, LABEL, `${where} 的 label`, code),
|
|
126
|
+
return { label: text(raw.label, LABEL, `${where} 的 label`, code), [kind]: raw[kind],
|
|
123
127
|
...(raw.args ? { args: raw.args } : {}), ...(raw.disabled ? { disabled: true } : {}),
|
|
124
128
|
...(raw.confirm !== undefined ? { confirm: text(raw.confirm, CONFIRM, `${where} 的 confirm`, code, { line: false }) } : {}) };
|
|
125
129
|
}
|
|
@@ -165,8 +169,8 @@ function resource(raw, where, scope) {
|
|
|
165
169
|
const actions = list(raw.actions, ACTIONS, 'actions').map((b, i) => {
|
|
166
170
|
const at = `${where}.actions[${i}]`;
|
|
167
171
|
object(b, at, code);
|
|
168
|
-
keys(b, BUTTON_KEYS, at, code);
|
|
169
|
-
return button(b, at, scope);
|
|
172
|
+
keys(b, [...BUTTON_KEYS, 'url'], at, code);
|
|
173
|
+
return button(b, at, scope, [...BUTTON_KEYS, 'url']);
|
|
170
174
|
});
|
|
171
175
|
check(name !== undefined || values.length, code, `${where} 须有 name 或 values`);
|
|
172
176
|
return { ...(name !== undefined ? { name } : {}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coda-console/plugin-check",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
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": "
|
|
27
|
+
"@coda-console/protocol": "3.0.0",
|
|
28
28
|
"ajv": "8.20.0",
|
|
29
29
|
"yaml": "2.9.1"
|
|
30
30
|
},
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// The provider declaration contract, shared verbatim with plugin-check. No topology or runtime policy here.
|
|
2
|
-
import { ProtocolTypes } from './types.mjs';
|
|
3
|
-
import { requireCondition as check } from '../../domain/errors.mjs';
|
|
4
|
-
|
|
5
|
-
export function providerDefinition(input) {
|
|
6
|
-
const { kind, spec, status, controllers = [], target = null } = input ?? {};
|
|
7
|
-
check(Array.isArray(controllers) && controllers.every(id => typeof id === 'string' && id), 'invalid_input', 'controllers 须为插件 ID 列表');
|
|
8
|
-
check(target === null || (typeof target === 'string' && Object.hasOwn(spec?.properties ?? {}, target)), 'invalid_input', 'target 须为 spec 声明的资源引用栏');
|
|
9
|
-
new ProtocolTypes().register({ kind, spec, status, participants: () => [] });
|
|
10
|
-
return structuredClone({ kind, spec, status, controllers, target });
|
|
11
|
-
}
|