@coda-console/protocol 3.1.0 → 3.3.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/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  按 semver。协议自己的大版本写在协议名里(如 `coda/run@1`),与 npm 包版本、插件清单的 v2 独立;更早的版本见 git 历史。
4
4
 
5
+ ## 3.3.0 — 2026-11-09
6
+
7
+ - `coda:choice` 的 `note`:`required` 时选它必须附言(写说明或附上文件),默认 `optional`(Coda #2303 第 3 步:卡片在输入框里填写)。
8
+
9
+ ## 3.2.0 — 2026-11-09
10
+
11
+ - 人工任务的 `coda:wake`:`false` 时派出不叫醒 Agent,任务随会话的下一条输入告诉它(如用户在会话里开启的开发流程,Agent 下次说话时才读到);只写在交给 Agent 的任务上,默认 `true`。
12
+ - `coda:assignee` 的说明跟上 Coda 的处理人规则:先交给 Agent,它处理不了才逐层往上(Coda #2303)。
13
+
5
14
  ## 3.1.0 — 2026-11-08
6
15
 
7
16
  - 流程种类 `prebuild`(预编):开发流程推出执行者的提交后,在审查的同时调用一次、不等它的结果,为随后验收要装的客户端先编好;任何提交都能跑,不算部署类。设置选项的 `workflowKind` 也接受它。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coda-console/protocol",
3
- "version": "3.1.0",
3
+ "version": "3.3.0",
4
4
  "description": "Coda 的协议:插件清单的类型(JSON Schema)、通用校验器、协议定义与调用信封、流程方言与 Agent 接入协议",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -108,9 +108,10 @@
108
108
  "name": "UserTaskProperties",
109
109
  "isAbstract": true,
110
110
  "extends": ["bpmn:UserTask"],
111
- "description": "人工任务的:assignee 交给谁,三个按钮的名字",
111
+ "description": "人工任务的:assignee 交给谁,wake 派出时叫不叫醒 Agent,三个按钮的名字",
112
112
  "properties": [
113
113
  {"name": "assignee", "isAttr": true, "type": "String"},
114
+ {"name": "wake", "isAttr": true, "type": "String"},
114
115
  {"name": "completeLabel", "isAttr": true, "type": "String"},
115
116
  {"name": "rejectLabel", "isAttr": true, "type": "String"},
116
117
  {"name": "noteLabel", "isAttr": true, "type": "String"}
@@ -170,12 +171,13 @@
170
171
  {
171
172
  "name": "Choice",
172
173
  "superClass": ["Element"],
173
- "description": "人工任务给的一个答复:id 是任务输出里的 choice;可以套着更多答复,按住时给出;fields 是它检查并发送的输入(不写是全部,空串是没有)",
174
+ "description": "人工任务给的一个答复:id 是任务输出里的 choice;可以套着更多答复,按住时给出;fields 是它检查并发送的输入(不写是全部,空串是没有);note 是选它时要不要附言",
174
175
  "properties": [
175
176
  {"name": "id", "isAttr": true, "type": "String"},
176
177
  {"name": "name", "isAttr": true, "type": "String"},
177
178
  {"name": "detail", "isAttr": true, "type": "String"},
178
179
  {"name": "primary", "isAttr": true, "type": "Boolean"},
180
+ {"name": "note", "isAttr": true, "type": "String"},
179
181
  {"name": "fields", "isAttr": true, "type": "String"},
180
182
  {"name": "choices", "type": "Choice", "isMany": true},
181
183
  {"name": "options", "type": "Option", "isMany": true}
@@ -474,6 +474,34 @@
474
474
  }
475
475
  }
476
476
  },
477
+ {
478
+ "description": "coda:wake=\"false\" 只写在交给 Agent 的任务上:交给用户的(coda:assignee=\"user\"、有输入字段的)本来就不叫醒 Agent",
479
+ "schema": {
480
+ "properties": {
481
+ "assignee": {
482
+ "not": {
483
+ "const": "user"
484
+ }
485
+ },
486
+ "hasInputFields": {
487
+ "const": false
488
+ }
489
+ }
490
+ },
491
+ "on": [
492
+ "bpmn:UserTask"
493
+ ],
494
+ "when": {
495
+ "required": [
496
+ "wake"
497
+ ],
498
+ "properties": {
499
+ "wake": {
500
+ "const": "false"
501
+ }
502
+ }
503
+ }
504
+ },
477
505
  {
478
506
  "description": "不支持标准循环(standardLoopCharacteristics):重复做一件事写成连回去的连线加网关,按集合或次数做多份写多实例",
479
507
  "schema": {
@@ -81,7 +81,8 @@
81
81
  "UserTaskProperties": {
82
82
  "type": "object",
83
83
  "properties": {
84
- "assignee": {"enum": ["agent", "user"], "description": "coda:assignee 只能是 agent(先给运行所属会话的 Agent 一轮,没答就逐层往上,最上面是用户;有输入字段的直接到用户)或 user(直接交给用户)"}
84
+ "assignee": {"enum": ["agent", "user"], "description": "coda:assignee 只能是 agent(先交给运行所属会话的 Agent,它处理不了才逐层往上,最上面是用户;有输入字段的直接到用户)或 user(直接交给用户)"},
85
+ "wake": {"enum": ["true", "false"], "description": "coda:wake 只能是 true(默认,派出就叫醒 Agent)或 false(不叫醒,任务随会话的下一条输入告诉 Agent)"}
85
86
  }
86
87
  },
87
88
  "Input": {
@@ -143,6 +144,7 @@
143
144
  "id": {"type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_-]{0,63}$", "description": "id 须为字母开头的字母、数字、「_」「-」"},
144
145
  "name": {"type": "string", "pattern": "\\S", "maxLength": 40, "description": "name 须为 1–40 个字"},
145
146
  "detail": {"type": "string", "maxLength": 200, "x-feel": true, "description": "detail 不超过 200 字"},
147
+ "note": {"enum": ["required", "optional"], "description": "note 只能是 required(选它必须附言:写说明或附上文件)或 optional(默认)"},
146
148
  "choices": {"type": "array", "maxItems": 6, "description": "最多 6 个按住出现的选项"},
147
149
  "options": {"type": "array", "maxItems": 12, "x-unique-by": ["id"], "description": "最多 12 个勾选项"}
148
150
  },