@coda-console/protocol 2.4.0 → 2.5.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.
@@ -5,7 +5,7 @@
5
5
  2.2.0 按[第 7 步方案](https://github.com/coda-console/coda/issues/2078#issuecomment-6559423071)补齐流程接入:
6
6
  **无资源或一个资源的一单位**,可独占所申请资源;多单位、多资源原子申请仍未开放。
7
7
 
8
- 协议对象版本 `protocolVersion: 1`、本目录的 v1、npm 包版本 2.4.0 和插件清单的 v2 分开演进。
8
+ 协议对象版本 `protocolVersion: 1`、本目录的 v1、npm 包版本 2.5.0 和插件清单的 v2 分开演进。
9
9
  本次只增加契约;不改变 `contributes.executors`,也不宣称 host、scheduler、空间引用解析或账本接口已经实现。
10
10
 
11
11
  ## 定义与登记
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coda-console/protocol",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "Coda 的协议:插件清单的类型(JSON Schema)、通用校验器、流程方言与 Agent 接入协议",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -7,6 +7,14 @@
7
7
  "properties": {
8
8
  "id": {"$ref": "common.json#/$defs/id", "description": "插件 ID:小写字母、数字和「-」,以字母开头,至多 40 个字符;不写就用 name"},
9
9
  "name": {"type": "string"},
10
+ "description": {"description": "一句话简介:插件列表里只显示一行,20 字以内为宜;更多的说明写在插件目录的 README.md,插件页里显示", "type": "string"},
11
+ "icon": {
12
+ "description": "插件的图标:插件目录里的 PDF(light 必填,dark 与 template 可选,同 Agent 的图标),或 SF Symbols 的符号画在系统色的底上(symbol 与 color);客户端裁成圆角方块。不写时,只带一个 Agent 的插件用那个 Agent 的图标,其余用分类的默认图标",
13
+ "type": "object",
14
+ "if": {"required": ["symbol"]},
15
+ "then": {"$ref": "#/$defs/symbolIcon"},
16
+ "else": {"$ref": "#/$defs/fileIcon"}
17
+ },
10
18
  "categories": {"description": "分类:文本的数组,第一个是插件页里归的类", "type": "array", "items": {"type": "string"}},
11
19
  "coda": {
12
20
  "description": "Coda 宿主的安装要求;不写 channels 就不限制后端通道",
@@ -49,6 +57,23 @@
49
57
  "propertyNames": {"description": "contributes 的键:字母和数字,以小写字母开头", "pattern": "^[a-z][A-Za-z0-9]{0,39}$"}
50
58
  }
51
59
  },
60
+ "$defs": {
61
+ "fileIcon": {
62
+ "type": "object",
63
+ "properties": {"light": {"$ref": "agents.json#/$defs/icon"}, "dark": {"$ref": "agents.json#/$defs/icon"}, "template": {"description": "单色图标:按文字颜色画", "type": "boolean"}},
64
+ "required": ["light"],
65
+ "additionalProperties": false
66
+ },
67
+ "symbolIcon": {
68
+ "type": "object",
69
+ "properties": {
70
+ "symbol": {"description": "SF Symbols 的符号名,如 key.fill", "type": "string", "maxLength": 100, "pattern": "^[a-z0-9]+(\\.[a-z0-9]+)*$"},
71
+ "color": {"description": "底色:系统色 red、orange、yellow、green、mint、teal、cyan、blue、indigo、purple、pink、brown、gray 之一", "enum": ["red", "orange", "yellow", "green", "mint", "teal", "cyan", "blue", "indigo", "purple", "pink", "brown", "gray"]}
72
+ },
73
+ "required": ["symbol", "color"],
74
+ "additionalProperties": false
75
+ }
76
+ },
52
77
  "if": {"properties": {"activationEvents": {"minItems": 1}}, "required": ["activationEvents"]},
53
78
  "then": {"required": ["main"], "description": "写了 activationEvents 的插件须有 main"}
54
79
  }