@coda-console/plugin-check 0.5.25 → 0.5.27
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 +7 -1
- package/check/coda/adapters/provider-api.mjs +32 -0
- package/check/coda/builtin.json +321 -125
- package/check/coda/components/protocols/provider-definition.mjs +11 -0
- package/check/coda/components/protocols/types.mjs +76 -0
- package/check/coda/contract.json +8 -3
- package/check/coda/domain/plugin-services.mjs +5 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -22,7 +22,6 @@ plugins/network-log/ 网络记录:默认关闭,按需开启建连等待
|
|
|
22
22
|
plugins/review/ PR 生命流程:会话开的 PR 先跑项目的检查、再交叉评审,你批准后合并、部署与发布;也是写 PR 流程的样例
|
|
23
23
|
plugins/testbed/ 测试机:长插在 Mac 上的 iPhone、iPad 只经 use-testbed 使用,排到后装 App、交给会话操作、用完切黑屏;依赖宿主资源
|
|
24
24
|
plugins/composer/ 输入框模式:交接到新会话、子会话、! 执行命令、Ultra 与 /loop 循环;Ultra 模板设置为 composer.templates
|
|
25
|
-
plugins/ultra/ Ultra(已并入 @coda-console/composer,暂时保留旧包):输入框的协调模式,主 Agent 负责拆解、调度和验收,子会话负责实现、排查和测试;名单与模板在模式参数和设置里
|
|
26
25
|
templates/agent/ 最小的 Agent 插件:手写 ACP 的回声 Agent,演示会话指令、插话、Agent 活动与自主轮次
|
|
27
26
|
templates/panel/ 最小的面板插件:一张卡片、一条进度条、一个按钮
|
|
28
27
|
bin/、check/ 契约检查(仓库根的 package.json 就是它,@coda-console/plugin-check);check/coda/ 是 Coda 同步来的规则副本,不要手改
|
|
@@ -69,6 +68,13 @@ Coda 插件页的「商店」列出 Coda 自带的插件,以及 npm 上 `@coda
|
|
|
69
68
|
带依赖的插件各有自己的 `package-lock.json`(`node_modules` 不提交);Coda 在插件的版本目录里 `npm ci` 装它们,
|
|
70
69
|
这几个插件不是本仓库根的 npm workspaces(根包是契约检查,装它不该带上 Codex、Claude 的平台二进制)。
|
|
71
70
|
|
|
71
|
+
### 紧凑显示名
|
|
72
|
+
|
|
73
|
+
模型与模式的 `_meta.coda.shortName` 供 Coda 的工具栏使用,完整名称仍供选择面板与辅助功能读取,执行始终使用原 ID。
|
|
74
|
+
Claude 的短名取 SDK 的显示名(不再附上完整 ID),保留模型版本与上下文变体;Codex 的模型短名去掉重复的 GPT 前缀,审批模式提供中文短名。
|
|
75
|
+
Kimi 的模式提供中文短名,高速模型缩短 Highspeed 文案但保留 2×用量;Grok 声明自己的审批模式名称。
|
|
76
|
+
OpenCode 已按来源分组去掉模型的 provider 前缀,沿用现有名称;build/plan 是它的 Agent 模式,不改称审批。
|
|
77
|
+
|
|
72
78
|
### 会话指令与设置动作
|
|
73
79
|
|
|
74
80
|
Coda 的会话指令(`systemPrompt`)各插件都声明并接受,只接受 `append` 模式的文本块,其他回 -32602、不建立会话:
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// The plugin host's local API. Controllers consume accepted objects serially per ID; they choose their own actions.
|
|
2
|
+
export function providerAPI({ call, watch, report = console.error }) {
|
|
3
|
+
const observe = (kind, fn, scope = 'available') => watch(`provider:${kind}`, fn, { scope });
|
|
4
|
+
return {
|
|
5
|
+
define: definition => call('define', [definition]),
|
|
6
|
+
put: object => call('put', [object]),
|
|
7
|
+
update: (kind, id, spec, revision) => call('update', [kind, id, spec, revision]),
|
|
8
|
+
setStatus: (kind, id, status, revision) => call('setStatus', [kind, id, status, revision]),
|
|
9
|
+
delete: (kind, id) => call('delete', [kind, id]),
|
|
10
|
+
publish: (kind, id, enabled = true) => call('publish', [kind, id, enabled]),
|
|
11
|
+
observe,
|
|
12
|
+
async control(kind, handler, scope = 'local') {
|
|
13
|
+
if (typeof handler !== 'function') throw new TypeError('controller 须为函数');
|
|
14
|
+
const pending = new Map(), running = new Set();
|
|
15
|
+
let disposed = false;
|
|
16
|
+
const subscription = await observe(kind, event => {
|
|
17
|
+
pending.set(event.id, event);
|
|
18
|
+
if (running.has(event.id)) return;
|
|
19
|
+
running.add(event.id);
|
|
20
|
+
void (async () => {
|
|
21
|
+
try {
|
|
22
|
+
while (!disposed && pending.has(event.id)) {
|
|
23
|
+
const next = pending.get(event.id); pending.delete(event.id);
|
|
24
|
+
try { await handler(next); } catch (error) { report('[protocol controller]', error); }
|
|
25
|
+
}
|
|
26
|
+
} finally { running.delete(event.id); }
|
|
27
|
+
})();
|
|
28
|
+
}, scope);
|
|
29
|
+
return { dispose() { disposed = true; pending.clear(); subscription.dispose(); } };
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
package/check/coda/builtin.json
CHANGED
|
@@ -125,116 +125,6 @@
|
|
|
125
125
|
}
|
|
126
126
|
]
|
|
127
127
|
},
|
|
128
|
-
{
|
|
129
|
-
"id": "composer",
|
|
130
|
-
"displayName": "输入框模式",
|
|
131
|
-
"description": "输入框的三种模式:交接到新会话、新建子会话,以及打 ! 执行命令。停用后输入框里没有这几种模式。",
|
|
132
|
-
"version": "1.1.0",
|
|
133
|
-
"category": "工作流程",
|
|
134
|
-
"source": {
|
|
135
|
-
"kind": "builtin"
|
|
136
|
-
},
|
|
137
|
-
"dir": "src/resources/plugins/composer",
|
|
138
|
-
"title": "输入框模式",
|
|
139
|
-
"properties": {},
|
|
140
|
-
"main": "main.mjs",
|
|
141
|
-
"workflows": [],
|
|
142
|
-
"capabilities": [],
|
|
143
|
-
"services": [],
|
|
144
|
-
"groups": [],
|
|
145
|
-
"commands": [],
|
|
146
|
-
"gitCredentials": [],
|
|
147
|
-
"endpoints": [],
|
|
148
|
-
"views": [],
|
|
149
|
-
"composerModes": [
|
|
150
|
-
{
|
|
151
|
-
"id": "handoff",
|
|
152
|
-
"title": "交接到新会话",
|
|
153
|
-
"icon": "arrow.right.square",
|
|
154
|
-
"hint": "新会话承接这里的上下文,共享当前工作目录及其中的文件;这个会话保留,仍可继续使用。",
|
|
155
|
-
"placeholder": "接下来要完成什么?",
|
|
156
|
-
"sendLabel": "交接",
|
|
157
|
-
"agent": "own",
|
|
158
|
-
"in": [
|
|
159
|
-
"session"
|
|
160
|
-
]
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
"id": "subagent",
|
|
164
|
-
"title": "子会话",
|
|
165
|
-
"icon": "arrow.triangle.branch",
|
|
166
|
-
"hint": "承接父会话近期上下文,沿用父会话工作目录;只启动子会话,不向父 Agent 发送这段要求。",
|
|
167
|
-
"placeholder": "描述交给子会话的任务…",
|
|
168
|
-
"sendLabel": "启动子会话",
|
|
169
|
-
"agent": "own",
|
|
170
|
-
"in": [
|
|
171
|
-
"session"
|
|
172
|
-
],
|
|
173
|
-
"parameters": {
|
|
174
|
-
"properties": {
|
|
175
|
-
"replyTo": {
|
|
176
|
-
"type": "string",
|
|
177
|
-
"enum": [
|
|
178
|
-
"parent",
|
|
179
|
-
"sender"
|
|
180
|
-
],
|
|
181
|
-
"enumItemLabels": [
|
|
182
|
-
"完成后回报父会话",
|
|
183
|
-
"完成后回报你"
|
|
184
|
-
],
|
|
185
|
-
"enumDescriptions": [
|
|
186
|
-
"结果交给父 Agent,由它接着处理",
|
|
187
|
-
"做完提醒你,不叫醒父 Agent"
|
|
188
|
-
],
|
|
189
|
-
"title": "回报对象",
|
|
190
|
-
"default": "parent",
|
|
191
|
-
"order": 0
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
"schema": {
|
|
196
|
-
"type": "object",
|
|
197
|
-
"properties": {
|
|
198
|
-
"replyTo": {
|
|
199
|
-
"title": "回报对象",
|
|
200
|
-
"type": "string",
|
|
201
|
-
"enum": [
|
|
202
|
-
"parent",
|
|
203
|
-
"sender"
|
|
204
|
-
],
|
|
205
|
-
"enumItemLabels": [
|
|
206
|
-
"完成后回报父会话",
|
|
207
|
-
"完成后回报你"
|
|
208
|
-
],
|
|
209
|
-
"enumDescriptions": [
|
|
210
|
-
"结果交给父 Agent,由它接着处理",
|
|
211
|
-
"做完提醒你,不叫醒父 Agent"
|
|
212
|
-
],
|
|
213
|
-
"default": "parent"
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
"id": "shell",
|
|
220
|
-
"title": "执行命令",
|
|
221
|
-
"icon": "terminal",
|
|
222
|
-
"hint": "在会话工作目录执行,命令和结果作为这条消息发给 Agent。",
|
|
223
|
-
"placeholder": "输入要执行的命令…",
|
|
224
|
-
"sendLabel": "执行",
|
|
225
|
-
"agent": "off",
|
|
226
|
-
"trigger": "!",
|
|
227
|
-
"in": [
|
|
228
|
-
"session",
|
|
229
|
-
"new"
|
|
230
|
-
]
|
|
231
|
-
}
|
|
232
|
-
],
|
|
233
|
-
"agents": [],
|
|
234
|
-
"dependencies": [],
|
|
235
|
-
"extensionPoints": {},
|
|
236
|
-
"extensions": []
|
|
237
|
-
},
|
|
238
128
|
{
|
|
239
129
|
"id": "diagnostics",
|
|
240
130
|
"displayName": "机器诊断",
|
|
@@ -899,14 +789,14 @@
|
|
|
899
789
|
"id": "claude",
|
|
900
790
|
"displayName": "Claude",
|
|
901
791
|
"description": "Claude SDK Agent:Coda 基于 Claude Agent SDK 写的 ACP 入口,一个进程一个 SDK 会话;资源页的「Claude」面板显示会话报告的额度,可从 Coda 登录。",
|
|
902
|
-
"version": "1.7.
|
|
792
|
+
"version": "1.7.8",
|
|
903
793
|
"category": "Agent",
|
|
904
794
|
"source": {
|
|
905
795
|
"kind": "builtin",
|
|
906
796
|
"package": "@coda-console/claude",
|
|
907
797
|
"tag": "latest",
|
|
908
|
-
"version": "1.7.
|
|
909
|
-
"integrity": "sha512-
|
|
798
|
+
"version": "1.7.8",
|
|
799
|
+
"integrity": "sha512-Ti4gpscvuq1qrx6ti4ZxLw3zu0g1eCD3CHFn6ICGASofyET4qHrWwjB/jr2/ou6SFnyRg5fMo2m88CjjHCUwMQ==",
|
|
910
800
|
"repo": "https://github.com/coda-console/coda-plugins.git",
|
|
911
801
|
"path": "plugins/claude"
|
|
912
802
|
},
|
|
@@ -989,14 +879,14 @@
|
|
|
989
879
|
"id": "codex",
|
|
990
880
|
"displayName": "Codex",
|
|
991
881
|
"description": "Codex Agent:Coda 自带的入口运行 codex-acp,报告子 Agent、后台命令与命令的自动审核。额度与登录由账号来源插件接管;未接入账号来源时使用 Codex 自己的登录面板。",
|
|
992
|
-
"version": "1.8.
|
|
882
|
+
"version": "1.8.6",
|
|
993
883
|
"category": "Agent",
|
|
994
884
|
"source": {
|
|
995
885
|
"kind": "builtin",
|
|
996
886
|
"package": "@coda-console/codex",
|
|
997
887
|
"tag": "latest",
|
|
998
|
-
"version": "1.8.
|
|
999
|
-
"integrity": "sha512-
|
|
888
|
+
"version": "1.8.6",
|
|
889
|
+
"integrity": "sha512-np09xwMCHBzUUOfWTYV1IOo4Ci6Ua5ZVFXA0d/PzyFAhwDYmtll8kU39LxBU88R3ReuiHz7W9kCV2GAT8Kqn6A==",
|
|
1000
890
|
"repo": "https://github.com/coda-console/coda-plugins.git",
|
|
1001
891
|
"path": "plugins/codex"
|
|
1002
892
|
},
|
|
@@ -1141,18 +1031,324 @@
|
|
|
1141
1031
|
],
|
|
1142
1032
|
"defaultInstalled": false
|
|
1143
1033
|
},
|
|
1034
|
+
{
|
|
1035
|
+
"id": "composer",
|
|
1036
|
+
"displayName": "输入框模式",
|
|
1037
|
+
"description": "输入框的五种模式:交接到新会话、创建子会话、打 ! 执行命令、Ultra 协调模式,以及按周期重复任务的循环模式。Ultra 的主 Agent 负责决策、调度和验收,非微小任务交给 Coda 子会话执行。",
|
|
1038
|
+
"version": "2.1.0",
|
|
1039
|
+
"category": "工作流程",
|
|
1040
|
+
"source": {
|
|
1041
|
+
"kind": "builtin",
|
|
1042
|
+
"package": "@coda-console/composer",
|
|
1043
|
+
"tag": "latest",
|
|
1044
|
+
"version": "2.1.0",
|
|
1045
|
+
"integrity": "sha512-vFT4hELREpRSTWXmxAyNCAvlWi6MjiXxBj15tyGUMopGLQqY7NzJj8M81kbY0XzoBqXm96wEzPlDZL6IfuRspg==",
|
|
1046
|
+
"repo": "https://github.com/coda-console/coda-plugins.git",
|
|
1047
|
+
"path": "plugins/composer"
|
|
1048
|
+
},
|
|
1049
|
+
"dir": "node_modules/@coda-console/composer",
|
|
1050
|
+
"title": "输入框模式",
|
|
1051
|
+
"properties": {
|
|
1052
|
+
"composer.templates": {
|
|
1053
|
+
"type": "array",
|
|
1054
|
+
"description": "进入 Ultra 时可选的名单,一行一个子 Agent:同一个模板名的几行是一个模板,排第一的模板是进入时的默认。默认没有模板,子 Agent 名单为空时沿用当前会话的 Agent 和模型。",
|
|
1055
|
+
"title": "模板",
|
|
1056
|
+
"rows": {
|
|
1057
|
+
"type": "object",
|
|
1058
|
+
"columns": {
|
|
1059
|
+
"template": {
|
|
1060
|
+
"type": "string",
|
|
1061
|
+
"title": "模板",
|
|
1062
|
+
"order": 0
|
|
1063
|
+
},
|
|
1064
|
+
"who": {
|
|
1065
|
+
"type": "object",
|
|
1066
|
+
"format": "coda-agent",
|
|
1067
|
+
"title": "Agent",
|
|
1068
|
+
"order": 1
|
|
1069
|
+
},
|
|
1070
|
+
"when": {
|
|
1071
|
+
"type": "string",
|
|
1072
|
+
"title": "什么时候派给它",
|
|
1073
|
+
"order": 2
|
|
1074
|
+
}
|
|
1075
|
+
},
|
|
1076
|
+
"required": [
|
|
1077
|
+
"template",
|
|
1078
|
+
"who"
|
|
1079
|
+
]
|
|
1080
|
+
},
|
|
1081
|
+
"default": []
|
|
1082
|
+
}
|
|
1083
|
+
},
|
|
1084
|
+
"main": "main.mjs",
|
|
1085
|
+
"workflows": [],
|
|
1086
|
+
"capabilities": [],
|
|
1087
|
+
"services": [],
|
|
1088
|
+
"groups": [],
|
|
1089
|
+
"commands": [],
|
|
1090
|
+
"gitCredentials": [],
|
|
1091
|
+
"endpoints": [],
|
|
1092
|
+
"views": [],
|
|
1093
|
+
"composerModes": [
|
|
1094
|
+
{
|
|
1095
|
+
"id": "handoff",
|
|
1096
|
+
"title": "交接到新会话",
|
|
1097
|
+
"icon": "arrow.right.square",
|
|
1098
|
+
"hint": "新会话承接这里的上下文,共享当前工作目录及其中的文件;这个会话保留,仍可继续使用。",
|
|
1099
|
+
"placeholder": "接下来要完成什么?",
|
|
1100
|
+
"sendLabel": "交接",
|
|
1101
|
+
"agent": "own",
|
|
1102
|
+
"in": [
|
|
1103
|
+
"session"
|
|
1104
|
+
]
|
|
1105
|
+
},
|
|
1106
|
+
{
|
|
1107
|
+
"id": "subagent",
|
|
1108
|
+
"title": "子会话",
|
|
1109
|
+
"icon": "arrow.triangle.branch",
|
|
1110
|
+
"hint": "承接父会话近期上下文,沿用父会话工作目录;只启动子会话,不向父 Agent 发送这段要求。",
|
|
1111
|
+
"placeholder": "描述交给子会话的任务…",
|
|
1112
|
+
"sendLabel": "启动子会话",
|
|
1113
|
+
"agent": "own",
|
|
1114
|
+
"in": [
|
|
1115
|
+
"session"
|
|
1116
|
+
],
|
|
1117
|
+
"parameters": {
|
|
1118
|
+
"properties": {
|
|
1119
|
+
"replyTo": {
|
|
1120
|
+
"type": "string",
|
|
1121
|
+
"enum": [
|
|
1122
|
+
"parent",
|
|
1123
|
+
"sender"
|
|
1124
|
+
],
|
|
1125
|
+
"enumItemLabels": [
|
|
1126
|
+
"完成后回报父会话",
|
|
1127
|
+
"完成后回报你"
|
|
1128
|
+
],
|
|
1129
|
+
"enumDescriptions": [
|
|
1130
|
+
"结果交给父 Agent,由它接着处理",
|
|
1131
|
+
"做完提醒你,不叫醒父 Agent"
|
|
1132
|
+
],
|
|
1133
|
+
"title": "回报对象",
|
|
1134
|
+
"default": "parent",
|
|
1135
|
+
"order": 0
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
},
|
|
1139
|
+
"schema": {
|
|
1140
|
+
"type": "object",
|
|
1141
|
+
"properties": {
|
|
1142
|
+
"replyTo": {
|
|
1143
|
+
"title": "回报对象",
|
|
1144
|
+
"type": "string",
|
|
1145
|
+
"enum": [
|
|
1146
|
+
"parent",
|
|
1147
|
+
"sender"
|
|
1148
|
+
],
|
|
1149
|
+
"enumItemLabels": [
|
|
1150
|
+
"完成后回报父会话",
|
|
1151
|
+
"完成后回报你"
|
|
1152
|
+
],
|
|
1153
|
+
"enumDescriptions": [
|
|
1154
|
+
"结果交给父 Agent,由它接着处理",
|
|
1155
|
+
"做完提醒你,不叫醒父 Agent"
|
|
1156
|
+
],
|
|
1157
|
+
"default": "parent"
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
"id": "shell",
|
|
1164
|
+
"title": "执行命令",
|
|
1165
|
+
"icon": "terminal",
|
|
1166
|
+
"hint": "在会话工作目录执行,命令和结果作为这条消息发给 Agent。",
|
|
1167
|
+
"placeholder": "输入要执行的命令…",
|
|
1168
|
+
"sendLabel": "执行",
|
|
1169
|
+
"agent": "off",
|
|
1170
|
+
"trigger": "!",
|
|
1171
|
+
"in": [
|
|
1172
|
+
"session",
|
|
1173
|
+
"new"
|
|
1174
|
+
]
|
|
1175
|
+
},
|
|
1176
|
+
{
|
|
1177
|
+
"id": "ultra",
|
|
1178
|
+
"title": "Ultra",
|
|
1179
|
+
"icon": "square.stack.3d.up",
|
|
1180
|
+
"hint": "节省主 Agent 的 Token,非微小任务交给子会话执行",
|
|
1181
|
+
"placeholder": "要完成什么?",
|
|
1182
|
+
"agent": "session",
|
|
1183
|
+
"in": [
|
|
1184
|
+
"session",
|
|
1185
|
+
"new"
|
|
1186
|
+
],
|
|
1187
|
+
"parameters": {
|
|
1188
|
+
"properties": {
|
|
1189
|
+
"template": {
|
|
1190
|
+
"type": "string",
|
|
1191
|
+
"title": "模板",
|
|
1192
|
+
"order": 0
|
|
1193
|
+
},
|
|
1194
|
+
"subagents": {
|
|
1195
|
+
"type": "array",
|
|
1196
|
+
"title": "子 Agent",
|
|
1197
|
+
"rows": {
|
|
1198
|
+
"type": "object",
|
|
1199
|
+
"columns": {
|
|
1200
|
+
"who": {
|
|
1201
|
+
"type": "object",
|
|
1202
|
+
"format": "coda-agent",
|
|
1203
|
+
"title": "Agent",
|
|
1204
|
+
"order": 0
|
|
1205
|
+
},
|
|
1206
|
+
"when": {
|
|
1207
|
+
"type": "string",
|
|
1208
|
+
"title": "什么时候派给它",
|
|
1209
|
+
"order": 1
|
|
1210
|
+
}
|
|
1211
|
+
},
|
|
1212
|
+
"required": [
|
|
1213
|
+
"who"
|
|
1214
|
+
]
|
|
1215
|
+
},
|
|
1216
|
+
"order": 1
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
},
|
|
1220
|
+
"schema": {
|
|
1221
|
+
"type": "object",
|
|
1222
|
+
"properties": {
|
|
1223
|
+
"template": {
|
|
1224
|
+
"title": "模板",
|
|
1225
|
+
"type": "string"
|
|
1226
|
+
},
|
|
1227
|
+
"subagents": {
|
|
1228
|
+
"title": "子 Agent",
|
|
1229
|
+
"type": "array",
|
|
1230
|
+
"items": {
|
|
1231
|
+
"type": "object",
|
|
1232
|
+
"properties": {
|
|
1233
|
+
"who": {
|
|
1234
|
+
"title": "Agent",
|
|
1235
|
+
"type": "object",
|
|
1236
|
+
"format": "coda-agent"
|
|
1237
|
+
},
|
|
1238
|
+
"when": {
|
|
1239
|
+
"title": "什么时候派给它",
|
|
1240
|
+
"type": "string"
|
|
1241
|
+
}
|
|
1242
|
+
},
|
|
1243
|
+
"required": [
|
|
1244
|
+
"who"
|
|
1245
|
+
]
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
},
|
|
1251
|
+
{
|
|
1252
|
+
"id": "loop",
|
|
1253
|
+
"title": "循环",
|
|
1254
|
+
"icon": "clock.arrow.2.circlepath",
|
|
1255
|
+
"hint": "按周期把同一句话再发给 Agent,每轮做完才开始计时,7 天后自动结束",
|
|
1256
|
+
"placeholder": "每轮要做什么?",
|
|
1257
|
+
"sendLabel": "开始循环",
|
|
1258
|
+
"agent": "session",
|
|
1259
|
+
"in": [
|
|
1260
|
+
"session"
|
|
1261
|
+
],
|
|
1262
|
+
"parameters": {
|
|
1263
|
+
"properties": {
|
|
1264
|
+
"every": {
|
|
1265
|
+
"type": "string",
|
|
1266
|
+
"format": "duration",
|
|
1267
|
+
"enum": [
|
|
1268
|
+
"PT5M",
|
|
1269
|
+
"PT10M",
|
|
1270
|
+
"PT15M",
|
|
1271
|
+
"PT30M",
|
|
1272
|
+
"PT1H",
|
|
1273
|
+
"PT2H",
|
|
1274
|
+
"PT3H",
|
|
1275
|
+
"PT6H",
|
|
1276
|
+
"PT12H",
|
|
1277
|
+
"P1D"
|
|
1278
|
+
],
|
|
1279
|
+
"enumItemLabels": [
|
|
1280
|
+
"5 分钟",
|
|
1281
|
+
"10 分钟",
|
|
1282
|
+
"15 分钟",
|
|
1283
|
+
"30 分钟",
|
|
1284
|
+
"1 小时",
|
|
1285
|
+
"2 小时",
|
|
1286
|
+
"3 小时",
|
|
1287
|
+
"6 小时",
|
|
1288
|
+
"12 小时",
|
|
1289
|
+
"1 天"
|
|
1290
|
+
],
|
|
1291
|
+
"title": "周期",
|
|
1292
|
+
"default": "PT30M",
|
|
1293
|
+
"order": 0
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
},
|
|
1297
|
+
"schema": {
|
|
1298
|
+
"type": "object",
|
|
1299
|
+
"properties": {
|
|
1300
|
+
"every": {
|
|
1301
|
+
"title": "周期",
|
|
1302
|
+
"type": "string",
|
|
1303
|
+
"format": "duration",
|
|
1304
|
+
"enum": [
|
|
1305
|
+
"PT5M",
|
|
1306
|
+
"PT10M",
|
|
1307
|
+
"PT15M",
|
|
1308
|
+
"PT30M",
|
|
1309
|
+
"PT1H",
|
|
1310
|
+
"PT2H",
|
|
1311
|
+
"PT3H",
|
|
1312
|
+
"PT6H",
|
|
1313
|
+
"PT12H",
|
|
1314
|
+
"P1D"
|
|
1315
|
+
],
|
|
1316
|
+
"enumItemLabels": [
|
|
1317
|
+
"5 分钟",
|
|
1318
|
+
"10 分钟",
|
|
1319
|
+
"15 分钟",
|
|
1320
|
+
"30 分钟",
|
|
1321
|
+
"1 小时",
|
|
1322
|
+
"2 小时",
|
|
1323
|
+
"3 小时",
|
|
1324
|
+
"6 小时",
|
|
1325
|
+
"12 小时",
|
|
1326
|
+
"1 天"
|
|
1327
|
+
],
|
|
1328
|
+
"default": "PT30M"
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
],
|
|
1334
|
+
"agents": [],
|
|
1335
|
+
"dependencies": [],
|
|
1336
|
+
"extensionPoints": {},
|
|
1337
|
+
"extensions": [],
|
|
1338
|
+
"defaultInstalled": true
|
|
1339
|
+
},
|
|
1144
1340
|
{
|
|
1145
1341
|
"id": "grok",
|
|
1146
1342
|
"displayName": "Grok",
|
|
1147
1343
|
"description": "Grok Agent:适配运行机上 Grok CLI 的 ACP 与审批模式;资源页的「Grok」面板显示账号与额度,可从 Coda 安装和登录。",
|
|
1148
|
-
"version": "1.3.
|
|
1344
|
+
"version": "1.3.3",
|
|
1149
1345
|
"category": "Agent",
|
|
1150
1346
|
"source": {
|
|
1151
1347
|
"kind": "builtin",
|
|
1152
1348
|
"package": "@coda-console/grok",
|
|
1153
1349
|
"tag": "latest",
|
|
1154
|
-
"version": "1.3.
|
|
1155
|
-
"integrity": "sha512
|
|
1350
|
+
"version": "1.3.3",
|
|
1351
|
+
"integrity": "sha512-59h5Kp3IjPerRjQJKnZNY1EnVJ+PBSnWK+U7ZfeYe6HeCDMVXmSaXhj1xmg2HY8xMRUGo4O8GqzYYHa5MntH+Q==",
|
|
1156
1352
|
"repo": "https://github.com/coda-console/coda-plugins.git",
|
|
1157
1353
|
"path": "plugins/grok"
|
|
1158
1354
|
},
|
|
@@ -1218,14 +1414,14 @@
|
|
|
1218
1414
|
"id": "kimi",
|
|
1219
1415
|
"displayName": "Kimi Code",
|
|
1220
1416
|
"description": "Kimi Code Agent:Coda 的入口在运行机的 kimi acp 与 Coda 之间转发,读 Kimi 的会话文件报出后台命令与子 Agent;资源页的「Kimi」面板显示账号与额度,可从 Coda 安装和登录。",
|
|
1221
|
-
"version": "1.2.
|
|
1417
|
+
"version": "1.2.3",
|
|
1222
1418
|
"category": "Agent",
|
|
1223
1419
|
"source": {
|
|
1224
1420
|
"kind": "builtin",
|
|
1225
1421
|
"package": "@coda-console/kimi",
|
|
1226
1422
|
"tag": "latest",
|
|
1227
|
-
"version": "1.2.
|
|
1228
|
-
"integrity": "sha512-
|
|
1423
|
+
"version": "1.2.3",
|
|
1424
|
+
"integrity": "sha512-EDIqC/89PfKDrbeRr/Dj4jaaae2U7V+s6mSJllW4ZNvesA7FJNO/pE8S1zQESfQqWdNjkS8cCjXq/d2P2CNZgQ==",
|
|
1229
1425
|
"repo": "https://github.com/coda-console/coda-plugins.git",
|
|
1230
1426
|
"path": "plugins/kimi"
|
|
1231
1427
|
},
|
|
@@ -1365,14 +1561,14 @@
|
|
|
1365
1561
|
"id": "review",
|
|
1366
1562
|
"displayName": "PR 生命流程",
|
|
1367
1563
|
"description": "会话开的 PR 从开出来起一条流程:每个新版本先跑项目声明的检查,再请另一家 Agent 评审,要求修改时交给开 PR 的会话处理、有分歧时交给你仲裁;通过后请你批准合并,跑过项目的合并前检查再合并,合并后按你的选择删除远程分支、调用项目的部署和发布流程,PR 合并或关闭时结束。",
|
|
1368
|
-
"version": "2.9.
|
|
1564
|
+
"version": "2.9.1",
|
|
1369
1565
|
"category": "工作流程",
|
|
1370
1566
|
"source": {
|
|
1371
1567
|
"kind": "builtin",
|
|
1372
1568
|
"package": "@coda-console/review",
|
|
1373
1569
|
"tag": "latest",
|
|
1374
|
-
"version": "2.9.
|
|
1375
|
-
"integrity": "sha512-
|
|
1570
|
+
"version": "2.9.1",
|
|
1571
|
+
"integrity": "sha512-gbg46xKbJv8TTnjfQpae5+bGE+Jt22m2nB3JWkpmMWwQdtLoHcODWdel1MJvJ8DHkITHvUAJmeImvi9bS40aZQ==",
|
|
1376
1572
|
"repo": "https://github.com/coda-console/coda-plugins.git",
|
|
1377
1573
|
"path": "plugins/review"
|
|
1378
1574
|
},
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import Ajv from 'ajv';
|
|
2
|
+
|
|
3
|
+
// Only JSON Schema rules: no coercion, custom keywords or executable constraints. Only the type's schemas
|
|
4
|
+
// supply defaults. An absent field without a declared default stays absent.
|
|
5
|
+
const ajv = new Ajv({ allErrors: true, addUsedSchema: false });
|
|
6
|
+
const defaults = new Ajv({ allErrors: true, addUsedSchema: false, useDefaults: true });
|
|
7
|
+
const object = value => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
8
|
+
const compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
9
|
+
|
|
10
|
+
const compile = (schema, compiler = ajv) => {
|
|
11
|
+
const check = compiler.compile(schema);
|
|
12
|
+
if (check.$async) throw new TypeError('协议只允许同步 JSON Schema 校验');
|
|
13
|
+
return check;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export function validate(check, value, who) {
|
|
17
|
+
if (!check(value)) throw new TypeError(`${who}: ${ajv.errorsText(check.errors)}`);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class ProtocolTypes {
|
|
21
|
+
constructor() { this.types = new Map(); }
|
|
22
|
+
register({ kind, spec, status, contributions = {}, participants }, registered = () => {}) {
|
|
23
|
+
if (typeof kind !== 'string' || !/^[a-z][a-zA-Z0-9-]*$/.test(kind) || this.types.has(kind)) throw new TypeError(`协议类型无效或已登记:${kind}`);
|
|
24
|
+
if (spec?.type !== 'object' || status?.type !== 'object') throw new TypeError(`${kind}: spec 与 status 须为对象 schema`);
|
|
25
|
+
if (typeof participants !== 'function' || !object(contributions)) throw new TypeError(`${kind}: 需要 participants 与 contributions`);
|
|
26
|
+
const properties = {};
|
|
27
|
+
for (const [field, { merge, schema }] of Object.entries(contributions)) {
|
|
28
|
+
const type = merge === 'append' ? 'array' : merge === 'or' ? 'boolean' : null;
|
|
29
|
+
if (!type || schema?.type !== type || spec?.properties?.[field]?.type !== type) {
|
|
30
|
+
throw new TypeError(`${kind}.${field}: 补充只允许 append 列表或 or 开关,单值栏不可补充`);
|
|
31
|
+
}
|
|
32
|
+
Object.defineProperty(properties, field, { value: schema, enumerable: true });
|
|
33
|
+
}
|
|
34
|
+
const type = { kind, participants, contributions: structuredClone(contributions),
|
|
35
|
+
spec: compile(spec, defaults), status: compile(status, defaults),
|
|
36
|
+
// Before supplementation only merge operands must be shaped correctly. Required fields and counts apply to the
|
|
37
|
+
// complete spec, so a participant can supply a required list that the initial object does not have yet.
|
|
38
|
+
base: compile({ type: 'object', properties: Object.fromEntries(Object.entries(properties).map(([field, schema]) => [field, { type: schema.type }])) }),
|
|
39
|
+
answer: compile({ type: 'object', properties, additionalProperties: false }, defaults) };
|
|
40
|
+
registered(type);
|
|
41
|
+
this.types.set(kind, type);
|
|
42
|
+
return type;
|
|
43
|
+
}
|
|
44
|
+
get(kind) {
|
|
45
|
+
const type = this.types.get(kind);
|
|
46
|
+
if (!type) throw new TypeError(`未登记协议类型:${kind}`);
|
|
47
|
+
return type;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function checkParticipants(answers) {
|
|
52
|
+
const seen = new Set();
|
|
53
|
+
for (const { plugin, key } of answers) {
|
|
54
|
+
const id = JSON.stringify([plugin, key]);
|
|
55
|
+
if (typeof plugin !== 'string' || !plugin || typeof key !== 'string' || !key || seen.has(id)) throw new TypeError(`参与者无效或重复:${id}`);
|
|
56
|
+
seen.add(id);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Each answer is atomic. Append in participant identity order, preserving each answer's own list order and duplicates;
|
|
61
|
+
// neither the participants' enumeration nor their completion order supplies precedence.
|
|
62
|
+
export function mergeContributions(type, spec, answers) {
|
|
63
|
+
validate(type.base, spec, `${type.kind}.spec`);
|
|
64
|
+
checkParticipants(answers);
|
|
65
|
+
const replies = structuredClone(answers);
|
|
66
|
+
for (const { plugin, key, value } of replies) validate(type.answer, value, `插件 ${plugin}(${key})的补充`);
|
|
67
|
+
const result = structuredClone(spec);
|
|
68
|
+
for (const { value } of replies.sort((a, b) => compare(a.plugin, b.plugin) || compare(a.key, b.key))) {
|
|
69
|
+
for (const [field, added] of Object.entries(value)) {
|
|
70
|
+
const merged = type.contributions[field].merge === 'append' ? [...(result[field] ?? []), ...structuredClone(added)] : (result[field] ?? false) || added;
|
|
71
|
+
Object.defineProperty(result, field, { value: merged, enumerable: true, writable: true, configurable: true });
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
validate(type.spec, result, `${type.kind}.spec`);
|
|
75
|
+
return result;
|
|
76
|
+
}
|
package/check/coda/contract.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
"commit": "
|
|
2
|
+
"commit": "c1d9bd9f99a2c90a446397eec21f581a71725385",
|
|
3
3
|
"packages": {
|
|
4
4
|
"@0dep/piso": "5.2.0",
|
|
5
5
|
"@agentclientprotocol/sdk": "1.4.0",
|
|
6
|
-
"@coda-console/protocol": "1.
|
|
6
|
+
"@coda-console/protocol": "1.10.0",
|
|
7
|
+
"ajv": "8.20.0",
|
|
7
8
|
"yaml": "2.9.1"
|
|
8
9
|
},
|
|
9
10
|
"files": {
|
|
11
|
+
"check/coda/components/protocols/provider-definition.mjs": "98327f1900f84109fd5493d2de8f683eb020754245f3049869ca3b30468821f9",
|
|
12
|
+
"check/coda/components/protocols/types.mjs": "c214787505f3b493eae8c89da79a3e7ea89e54945424ce227bea1fbcf35e826e",
|
|
13
|
+
"check/coda/adapters/provider-api.mjs": "99d5b32f9083645682e5b46d0d5f773db93e06cc72d1f98ae01e47f9b7e1253b",
|
|
10
14
|
"check/coda/components/plugins/agent-plugins.mjs": "d117702f83c988aa89c2e5ae26aafd6ae3e8ba0829adaeedf9e8640f5f8282be",
|
|
11
15
|
"check/coda/components/plugins/plugin-extensions.mjs": "4d7963185195ba6d21a4e49a66987613d5892210b1eb1dc02cffb7b816407776",
|
|
12
16
|
"check/coda/components/plugins/plugin-rules.mjs": "bf2eecafaf3a3c3a8b4719c3252db30a582fce5f11946926cd6a2bc03920c702",
|
|
@@ -18,12 +22,13 @@
|
|
|
18
22
|
"check/coda/domain/agent-protocol.mjs": "769cc10dc21b3cef7718f94272aaef2d17d4882d42617b408cb47357abfc3bcb",
|
|
19
23
|
"check/coda/domain/duration.mjs": "15dd64ef9b02342ad521c66e5968a569432a89dc7568d11afd3e6f3fe37e104b",
|
|
20
24
|
"check/coda/domain/errors.mjs": "ddc00aef9bb6f9a56845a9926c82200628a906230d31212d88fcde48e36dfd36",
|
|
25
|
+
"check/coda/domain/plugin-services.mjs": "940a72a14da980188a32c790c7f341d3ec0062a6e87ef1ebc9ef051798ea0a75",
|
|
21
26
|
"check/coda/domain/values.mjs": "01cc72b8d9c09e3fe16c93ec332ca01148bba859b1c672586d9d07444d7816c4",
|
|
22
27
|
"check/coda/kernel/agent-failures.mjs": "cbc215e2403d86f0acc765c2077197e0b529fc01e213db465c388361238ea8ce",
|
|
23
28
|
"check/coda/resources/plugins/resources/panels/command.mjs": "606f28bf87f87dded9df2db892bc7624c770d795ffab88f2409998346920ae42",
|
|
24
29
|
"check/coda/resources/plugins/resources/panels/panels.mjs": "9e25cfbc16ed9f68101fc7bfc34b8056c13a29d2368c5561e65e333233eb921e",
|
|
25
30
|
"check/coda/resources/plugins/resources/panels/rules.mjs": "8418ed83b796f18047c154d8dea8dca7d98244af8ddfe3ddf188520c59324ee8",
|
|
26
31
|
"check/coda/resources/plugins/resources/panels/sign-in.mjs": "1271a24e33b1b882a1fb9bee03b8e240db8b9bee1b5208f0e1c84499cfb1be7e",
|
|
27
|
-
"check/coda/builtin.json": "
|
|
32
|
+
"check/coda/builtin.json": "cb4cb30ea2ae9abd67627761c2931811228a4d9084da308c3c4d5dd3519533f0"
|
|
28
33
|
}
|
|
29
34
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coda-console/plugin-check",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.27",
|
|
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.
|
|
27
|
+
"@coda-console/protocol": "1.10.0",
|
|
28
28
|
"ajv": "8.20.0",
|
|
29
29
|
"yaml": "2.9.1"
|
|
30
30
|
},
|