@coda-console/plugin-check 0.5.32 → 0.5.33

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 CHANGED
@@ -226,6 +226,12 @@ Claude 的设置「缓存过期前压缩」(`claude.idleCompaction`,默认
226
226
  - 会话事实 `pinned`、`usage`,动作 `compact-session` 与流程属性 `coda:agents` 由 Coda 提供(见 Coda 仓 docs/workflows.md「生命周期流程」与
227
227
  docs/agent-protocol.md),Coda 还没有这些时,这条流程读不进来,不会运行。
228
228
 
229
+ ### Claude Ultracode
230
+
231
+ Ultracode 是 Claude Agent SDK 的会话设置 `ultracode`:每个任务都用动态工作流派多个子 Agent 完成,与推理强度无关。
232
+ 入口用布尔配置项 `ultracode`(「Ultracode」)报告它,只在当前模型能开时出现(SDK `getSettings()` 的 `applied.ultracodeAvailable`),
233
+ 开关经 `applyFlagSettings` 设给 SDK;改推理强度时同时带上 `ultracode`,不会把它关掉。打开后用量明显更大。
234
+
229
235
  ### Grok 审批模式
230
236
 
231
237
  Grok 插件通过 ACP 提供原来的「自动审批」「全部放行」两个选项;新会话未选择时沿用运行机配置。
@@ -2,9 +2,14 @@
2
2
  {
3
3
  "id": "approve-command",
4
4
  "displayName": "批准执行",
5
- "description": "Agent 自己跑不了、或要你明确点头(例如改生产环境)的命令,在会话里出一张卡片,写着理由、目录和完整命令;你点「执行」后由 Coda 在本机执行,结果交回 Agent。",
5
+ "description": "要你点头的命令,批准后由 Coda 执行",
6
6
  "version": "1.0.0",
7
7
  "category": "工作流程",
8
+ "icon": {
9
+ "symbol": "checkmark.shield.fill",
10
+ "color": "green"
11
+ },
12
+ "readme": true,
8
13
  "source": {
9
14
  "kind": "builtin"
10
15
  },
@@ -30,9 +35,14 @@
30
35
  {
31
36
  "id": "changes",
32
37
  "displayName": "变更",
33
- "description": "会话旁的「变更」页:新建工作树的会话从起点到现在改了哪些文件、每个文件改了什么(Mac 会话侧栏、iPhone 会话菜单);Mac 输入框上方写着改了几个文件、多少行,点开就是这一页。",
38
+ "description": "看会话改了哪些文件",
34
39
  "version": "1.0.1",
35
40
  "category": "工作流程",
41
+ "icon": {
42
+ "symbol": "plusminus",
43
+ "color": "orange"
44
+ },
45
+ "readme": true,
36
46
  "source": {
37
47
  "kind": "builtin"
38
48
  },
@@ -69,9 +79,14 @@
69
79
  {
70
80
  "id": "cliproxy",
71
81
  "displayName": "CLIProxy",
72
- "description": "在资源页显示这台机器上 CLIProxy 里 Antigravity 登录的额度;填了地址和 Key 时,把 CLIProxy 作为模型服务提供给 Pi 等插件选用。",
82
+ "description": "显示额度,把 CLIProxy 提供为模型服务",
73
83
  "version": "1.2.0",
74
84
  "category": "模型与账号",
85
+ "icon": {
86
+ "symbol": "bolt.fill",
87
+ "color": "teal"
88
+ },
89
+ "readme": true,
75
90
  "source": {
76
91
  "kind": "builtin"
77
92
  },
@@ -129,9 +144,14 @@
129
144
  {
130
145
  "id": "diagnostics",
131
146
  "displayName": "机器诊断",
132
- "description": "给巡检会话提供只读工具,查看空间各台机器的健康状态、网络诊断与客户端性能。需要时安装,再按目录启用或用 Tag 限定。",
147
+ "description": "给巡检会话的只读诊断工具",
133
148
  "version": "1.0.0",
134
149
  "category": "机器与资源",
150
+ "icon": {
151
+ "symbol": "stethoscope",
152
+ "color": "pink"
153
+ },
154
+ "readme": true,
135
155
  "source": {
136
156
  "kind": "builtin"
137
157
  },
@@ -168,9 +188,14 @@
168
188
  {
169
189
  "id": "github",
170
190
  "displayName": "GitHub",
171
- "description": "在 Coda 里登录 GitHub 账号,可以登录多个。Coda 启动的会话、流程步骤与插件安装访问 GitHub 时,按仓库的 owner 自动试出能推送的账号并记下,之后这个 owner 的仓库都用它;账号按面板上的顺序试,可以上移下移;会话里的 gh 与提交署名也跟着这个账号;gh 的只读命令遇到网络类失败会自动重试。会话里的 git 也经它交给真正的 git,Git 自己已知、重跑即好的故障(几个工作树同时创建时读到别的还没写好的 commondir)自动重跑;会话推送它开的 PR 的分支时,PR 观察立即去看,PR 已合并或关闭就当场提醒这次推送进不了目标分支。添加目录、安装插件时可以从这些账号的仓库里挑。",
191
+ "description": "登录账号,推送时自动选对账号",
172
192
  "version": "1.8.0",
173
193
  "category": "模型与账号",
194
+ "icon": {
195
+ "symbol": "arrow.triangle.pull",
196
+ "color": "gray"
197
+ },
198
+ "readme": true,
174
199
  "source": {
175
200
  "kind": "builtin"
176
201
  },
@@ -295,9 +320,14 @@
295
320
  {
296
321
  "id": "guide",
297
322
  "displayName": "Coda 使用指南",
298
- "description": "给会话里的 Agent 一份 Coda 使用指南(Skill `coda`):你问 Coda 怎么用、某个界面或状态是什么意思时,Agent 按它回答。",
323
+ "description": "让 Agent 会回答 Coda 怎么用",
299
324
  "version": "1.0.0",
300
325
  "category": "工作流程",
326
+ "icon": {
327
+ "symbol": "book.fill",
328
+ "color": "blue"
329
+ },
330
+ "readme": true,
301
331
  "source": {
302
332
  "kind": "builtin"
303
333
  },
@@ -327,9 +357,14 @@
327
357
  {
328
358
  "id": "maintenance",
329
359
  "displayName": "维护",
330
- "description": "按周期为每个目录做维护:删除超过保留期未活动的工具详情,清掉空闲工作树的构建产物,以及已归档会话的密钥与命令输出;整台机器清一次没人引用的旧附件。",
360
+ "description": "定期清理旧记录和构建产物",
331
361
  "version": "1.0.0",
332
362
  "category": "工作流程",
363
+ "icon": {
364
+ "symbol": "wrench.adjustable.fill",
365
+ "color": "brown"
366
+ },
367
+ "readme": true,
333
368
  "source": {
334
369
  "kind": "builtin"
335
370
  },
@@ -395,9 +430,14 @@
395
430
  {
396
431
  "id": "resources",
397
432
  "displayName": "资源",
398
- "description": "资源页:这台电脑(看一组电脑时是每一台)上已安装插件的面板,如账号与额度,按插件排列;可以隐藏、从 Coda 登录、选择显示的指标。",
399
- "version": "1.2.1",
433
+ "description": "各台电脑的账号、额度与负载",
434
+ "version": "2.0.0",
400
435
  "category": "机器与资源",
436
+ "icon": {
437
+ "symbol": "gauge.with.dots.needle.67percent",
438
+ "color": "indigo"
439
+ },
440
+ "readme": true,
401
441
  "source": {
402
442
  "kind": "builtin"
403
443
  },
@@ -428,8 +468,127 @@
428
468
  "agents": [],
429
469
  "dependencies": [],
430
470
  "extensionPoints": {
471
+ "resources": {
472
+ "description": "资源页上的资源类型:插件在 contributes.resources 里声明,由资源插件读取、执行动作与登录",
473
+ "contributes": "resources",
474
+ "title": "资源",
475
+ "commands": {
476
+ "command": "读取",
477
+ "actions.*.command": "动作",
478
+ "signIn.command": "登录",
479
+ "signIn.installed": "安装检查",
480
+ "signIn.install": "安装"
481
+ },
482
+ "schema": {
483
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
484
+ "title": "contributes.resources:资源页上的资源类型",
485
+ "description": "资源类型的数组:每个类型一条读取命令,它打印的 { resources } 由资源页按类型名画出来(docs/plugins.md「资源」)",
486
+ "type": "array",
487
+ "x-unique-by": [
488
+ "id"
489
+ ],
490
+ "items": {
491
+ "type": "object",
492
+ "properties": {
493
+ "id": {
494
+ "$ref": "common.json#/$defs/name"
495
+ },
496
+ "title": {
497
+ "description": "类型名,如 Claude、GitHub、CPU、内存:资源页上只写它,同名的类型合成一处",
498
+ "$ref": "common.json#/$defs/line40"
499
+ },
500
+ "command": {
501
+ "$ref": "common.json#/$defs/command"
502
+ },
503
+ "maxAge": {
504
+ "description": "读数不重读还能再显示多久:ISO 8601 时长,如 PT5M(周、天与时分秒,不用年和月)",
505
+ "type": "string",
506
+ "maxLength": 200,
507
+ "pattern": "^P(?!$)(?:\\d+W)?(?:\\d+D)?(?:T(?=\\d)(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?$"
508
+ },
509
+ "hidden": {
510
+ "description": "默认不显示:在资源页的「显示的资源」里打开才读、才显示",
511
+ "type": "boolean"
512
+ },
513
+ "actions": {
514
+ "description": "动作名 → { command, confirm }:资源上的按钮执行的命令,和执行前问的话",
515
+ "type": "object",
516
+ "propertyNames": {
517
+ "$ref": "common.json#/$defs/name"
518
+ },
519
+ "additionalProperties": {
520
+ "type": "object",
521
+ "properties": {
522
+ "command": {
523
+ "$ref": "common.json#/$defs/command"
524
+ },
525
+ "confirm": {
526
+ "$ref": "#/$defs/question"
527
+ }
528
+ },
529
+ "required": [
530
+ "command"
531
+ ],
532
+ "additionalProperties": false
533
+ }
534
+ },
535
+ "signIn": {
536
+ "description": "从 Coda 登录:command 打印一个链接,在任一设备上确认;installed 查装没装好,install 装上它",
537
+ "type": "object",
538
+ "properties": {
539
+ "command": {
540
+ "$ref": "common.json#/$defs/command"
541
+ },
542
+ "installed": {
543
+ "$ref": "common.json#/$defs/command"
544
+ },
545
+ "install": {
546
+ "$ref": "common.json#/$defs/command"
547
+ },
548
+ "input": {
549
+ "description": "登录页给出授权码要贴回来时写 authorizationCode:贴的交给 command 的标准输入",
550
+ "const": "authorizationCode"
551
+ },
552
+ "note": {
553
+ "$ref": "#/$defs/question"
554
+ }
555
+ },
556
+ "required": [
557
+ "command"
558
+ ],
559
+ "additionalProperties": false,
560
+ "if": {
561
+ "required": [
562
+ "install"
563
+ ]
564
+ },
565
+ "then": {
566
+ "description": "写了 install 就要写 installed:Coda 才知道装没装好",
567
+ "required": [
568
+ "installed"
569
+ ]
570
+ }
571
+ }
572
+ },
573
+ "required": [
574
+ "id",
575
+ "title",
576
+ "command"
577
+ ],
578
+ "additionalProperties": false
579
+ },
580
+ "$defs": {
581
+ "question": {
582
+ "description": "不超过 200 字,可以分行",
583
+ "type": "string",
584
+ "maxLength": 200,
585
+ "pattern": "^(?=[\\s\\S]*\\S)[^\\u0000]*$"
586
+ }
587
+ }
588
+ }
589
+ },
431
590
  "panels": {
432
- "description": "资源页上的面板:插件在 contributes.panels 里声明,由资源插件读取、执行动作与登录",
591
+ "description": "旧的资源页面板:插件在 contributes.panels 里声明,资源页把它当作资源显示;新插件写 contributes.resources",
433
592
  "contributes": "panels",
434
593
  "title": "面板",
435
594
  "commands": {
@@ -554,9 +713,14 @@
554
713
  {
555
714
  "id": "secrets",
556
715
  "displayName": "密钥",
557
- "description": "用卡片填写凭据,Agent 只拿到密文路径或句柄;Coda 代填指定网站。Mac 系统身份验证密码只在后端内存中供本会话复用,归档或重启后清除。",
716
+ "description": "用卡片填凭据,Agent 只拿到密文",
558
717
  "version": "1.0.0",
559
718
  "category": "工作流程",
719
+ "icon": {
720
+ "symbol": "key.fill",
721
+ "color": "yellow"
722
+ },
723
+ "readme": true,
560
724
  "source": {
561
725
  "kind": "builtin"
562
726
  },
@@ -583,9 +747,14 @@
583
747
  {
584
748
  "id": "session",
585
749
  "displayName": "会话生命周期",
586
- "description": "所有会话共用:存续期间管理空闲进程和任务转交,归档宽限后收尾,按设置回收托管工作树,限定同时执行的子会话。停用后不执行生命周期政策;归档宽限后的 Agent 停止仍由 Coda 保障。",
750
+ "description": "空闲进程、归档收尾与工作树回收",
587
751
  "version": "1.0.0",
588
752
  "category": "工作流程",
753
+ "icon": {
754
+ "symbol": "hourglass",
755
+ "color": "purple"
756
+ },
757
+ "readme": true,
589
758
  "source": {
590
759
  "kind": "builtin"
591
760
  },
@@ -663,9 +832,14 @@
663
832
  {
664
833
  "id": "space",
665
834
  "displayName": "空间",
666
- "description": "把几台电脑组成一个空间:在一处看各台的目录与会话,把任务派到另一台上,在一处对各台的插件一起改。安装或卸载后,这台电脑的后端会重启一下。",
835
+ "description": "把几台电脑组成一个空间",
667
836
  "version": "1.1.0",
668
837
  "category": "机器与资源",
838
+ "icon": {
839
+ "symbol": "square.stack.3d.up.fill",
840
+ "color": "blue"
841
+ },
842
+ "readme": true,
669
843
  "source": {
670
844
  "kind": "builtin"
671
845
  },
@@ -692,9 +866,14 @@
692
866
  {
693
867
  "id": "tailnet",
694
868
  "displayName": "网络",
695
- "description": "这台电脑在 tailnet 里的节点:空间的机器经它互相访问;也给插件中继(coda-relay)。由空间插件带来,安装或卸载后,这台电脑的后端会重启一下。",
869
+ "description": "空间里电脑互连的网络节点",
696
870
  "version": "1.2.0",
697
871
  "category": "机器与资源",
872
+ "icon": {
873
+ "symbol": "network",
874
+ "color": "cyan"
875
+ },
876
+ "readme": true,
698
877
  "source": {
699
878
  "kind": "builtin"
700
879
  },
@@ -728,9 +907,14 @@
728
907
  {
729
908
  "id": "workflows",
730
909
  "displayName": "工作流",
731
- "description": "工作流的页面:会话的流程模板与相关运行(会话侧栏、iPhone 会话菜单),所有机器的流程运行(一页),运行的进度与流程图、每个节点的执行记录与步骤输出。打开运行的卡片与链接也由它接管。",
910
+ "description": "流程模板、运行进度与流程图",
732
911
  "version": "1.0.1",
733
912
  "category": "工作流程",
913
+ "icon": {
914
+ "symbol": "flowchart.fill",
915
+ "color": "mint"
916
+ },
917
+ "readme": true,
734
918
  "source": {
735
919
  "kind": "builtin"
736
920
  },
@@ -785,15 +969,20 @@
785
969
  {
786
970
  "id": "claude",
787
971
  "displayName": "Claude",
788
- "description": "Claude SDK Agent:Coda 基于 Claude Agent SDK 写的 ACP 入口,一个进程一个 SDK 会话;资源页的「Claude」面板显示会话报告的额度,可从 Coda 登录。",
789
- "version": "1.7.9",
972
+ "description": "用 Claude Agent SDK 跑会话",
973
+ "version": "1.9.0",
790
974
  "category": "Agent",
975
+ "icon": {
976
+ "light": "JVBERi0xLjcKJbXtrvsKNCAwIG9iago8PCAvTGVuZ3RoIDUgMCBSCiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCj4+CnN0cmVhbQp4nG1WSY4YNxC76xX6QBTtyzP8hCCAnUP74OT/QFhkqWcMewaYaUrqWlisUpeY8ftHwZ/T0hrx7+/hR/gSf4Sc9shnx5z6xM/CQ+ulrBn//Rb//CvHb/+FntPaJe6T8qzxe+w15dPjbqmO+MTe0gBcwwwD9rRLjfM4HOm0HWeF3R5sYfL4OOnk6djQKkcot2LYjAAjMBybK5mxVtKG1XXskBmrIxUEsWcqw4xVxILXgfV6zbS7B60AY68yGzxXBrKzvRI+rM+dJhNr5nSWVBVZoY+x9GxUjJk6cmOU9qawmSqTcS24mBZHKYxjNS4/keSsYpzYbmbScCxzwGeeGDzrslOzu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"template": false
978
+ },
979
+ "readme": true,
791
980
  "source": {
792
981
  "kind": "builtin",
793
982
  "package": "@coda-console/claude",
794
983
  "tag": "latest",
795
- "version": "1.7.9",
796
- "integrity": "sha512-MfJDrhFrzJ4rAdI1hSGd60ILdZY4mtklOjDoc0y1YfWFYrCpOn2s/nAGYbEuiD9JNP5KpzPP56xF39GV5UtMiQ==",
984
+ "version": "1.9.0",
985
+ "integrity": "sha512-DfJ32fNdk1bfD0/e4H38otvoL3gqu77EvQaFvpLtycm0OzSKGQ+6eSZQybrVncohoEFe0Rd7hcUfA4OKo6rW5A==",
797
986
  "repo": "https://github.com/coda-console/coda-plugins.git",
798
987
  "path": "plugins/claude"
799
988
  },
@@ -854,7 +1043,8 @@
854
1043
  "command": "exec \"$CODA_NODE\" \"$CODA_PLUGIN_PATH/agent/entry.mjs\"",
855
1044
  "modes": {
856
1045
  "title": "审批模式",
857
- "unset": "人工审批",
1046
+ "unset": "Agent 默认",
1047
+ "note": "未选择时从人工审批开始;Claude 自己切换的模式保持不变。",
858
1048
  "auto": "auto",
859
1049
  "full": "bypassPermissions"
860
1050
  },
@@ -875,15 +1065,20 @@
875
1065
  {
876
1066
  "id": "codex",
877
1067
  "displayName": "Codex",
878
- "description": "Codex Agent:Coda 自带的入口运行 codex-acp,报告子 Agent、后台命令与命令的自动审核。额度与登录由账号来源插件接管;未接入账号来源时使用 Codex 自己的登录面板。",
879
- "version": "1.9.0",
1068
+ "description": "用 OpenAI Codex 跑会话",
1069
+ "version": "1.10.0",
880
1070
  "category": "Agent",
1071
+ "icon": {
1072
+ "light": "JVBERi0xLjcKJbXtrvsKNCAwIG9iago8PCAvTGVuZ3RoIDUgMCBSCiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCj4+CnN0cmVhbQp4nG2WXW4cOQyE33UKXWAVUb/UMXKEoIEkD56H7N4f2I9sqT1eLAzYUxy1mixWkZaY+flL+CVL08grXq/wJ3yPf0L27/7+Fb/9yPHXP2GOpKPGWVJZNb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Z0artEN29zyRUPl5B0fn+LfnQXr5ZdrbmnSK25bU9AutgHCpCmVuZHN0cmVhbQplbmRvYmoKMTIgMCBvYmoKICAgMjg0CmVuZG9iagoxMyAwIG9iago8PCAvVHlwZSAvWFJlZgogICAvTGVuZ3RoIDU5CiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCiAgIC9TaXplIDE0CiAgIC9XIFsxIDIgMl0KICAgL1Jvb3QgMTEgMCBSCiAgIC9JbmZvIDEwIDAgUgo+PgpzdHJlYW0KeJxjYGD4/5+JgZOBAUQwMbIcY2BgZOAHEizrQWLsQBYrH4iYACKWQtQxgghmRnZToBi7DwMDAP4JBa8KZW5kc3RyZWFtCmVuZG9iagpzdGFydHhyZWYKMTg2OAolJUVPRgo=",
1073
+ "template": true
1074
+ },
1075
+ "readme": true,
881
1076
  "source": {
882
1077
  "kind": "builtin",
883
1078
  "package": "@coda-console/codex",
884
1079
  "tag": "latest",
885
- "version": "1.9.0",
886
- "integrity": "sha512-TQMgUt2mVoacCOZDs+weWsJnQGGrXkgNuWtRCgVEAbhwFIy6aew28KMqi64TnurrYPR0PaM3hO/biyqulqr52Q==",
1080
+ "version": "1.10.0",
1081
+ "integrity": "sha512-NVj+4zdggzf8mhwGiVgI9FROdeSB27SeyW2evopnz5y/29Pinv+S6AIj/hX6Z1T0ksdAvxFL2uqhf2/0oI8SSg==",
887
1082
  "repo": "https://github.com/coda-console/coda-plugins.git",
888
1083
  "path": "plugins/codex"
889
1084
  },
@@ -940,7 +1135,8 @@
940
1135
  "command": "exec \"$CODA_NODE\" \"$CODA_PLUGIN_PATH/agent/entry.mjs\"",
941
1136
  "modes": {
942
1137
  "title": "审批模式",
943
- "unset": "完全访问",
1138
+ "unset": "Agent 默认",
1139
+ "note": "未选择时为完全访问。",
944
1140
  "auto": "agent",
945
1141
  "full": "agent-full-access"
946
1142
  },
@@ -964,15 +1160,20 @@
964
1160
  {
965
1161
  "id": "codex-accounts",
966
1162
  "displayName": "Codex 多账号",
967
- "description": "在 Coda 内管理 Codex 账号:自动纳入已有登录,添加与移除账号、自动续期、查看额度和使用完全重置;接管 Codex 额度面板,所选账号在会话开始和两轮之间生效。",
968
- "version": "2.1.3",
1163
+ "description": "管理多个 Codex 账号与额度",
1164
+ "version": "2.2.0",
969
1165
  "category": "模型与账号",
1166
+ "icon": {
1167
+ "symbol": "person.2.fill",
1168
+ "color": "teal"
1169
+ },
1170
+ "readme": true,
970
1171
  "source": {
971
1172
  "kind": "builtin",
972
1173
  "package": "@coda-console/codex-accounts",
973
1174
  "tag": "latest",
974
- "version": "2.1.3",
975
- "integrity": "sha512-5CECC/Lb+LNjHha039Q/caqv9OSlLb7HdEuTCXbNfhTICybMzwP66QqVhjb1U5HNBb6cIdXEZxzgWG0DZWmgyg==",
1175
+ "version": "2.2.0",
1176
+ "integrity": "sha512-k/mF1HBQxWE5vc9S6fPg58+oBWmpUQqBbbVYD8WPd4T794yIqOI3/2FuIRmN+WEowYKZL+Og1C2rEZvwSroq1Q==",
976
1177
  "repo": "https://github.com/coda-console/coda-plugins.git",
977
1178
  "path": "plugins/codex-accounts"
978
1179
  },
@@ -1031,15 +1232,20 @@
1031
1232
  {
1032
1233
  "id": "composer",
1033
1234
  "displayName": "输入框模式",
1034
- "description": "输入框可同时开启的五种模式:交接到新会话、从任意会话创建子会话、打 ! 执行命令、Ultra 协调模式,以及按周期重复任务的循环模式。Ultra 按需求交付,通过关联的开发流程委派功能,主 Agent 亲自审查、判断达标,统一验收与批准后按序合并、部署并在真实环境验证。",
1035
- "version": "3.8.0",
1235
+ "description": "交接、子会话、! 命令、Ultra 与循环",
1236
+ "version": "3.9.0",
1036
1237
  "category": "工作流程",
1238
+ "icon": {
1239
+ "symbol": "character.cursor.ibeam",
1240
+ "color": "blue"
1241
+ },
1242
+ "readme": true,
1037
1243
  "source": {
1038
1244
  "kind": "builtin",
1039
1245
  "package": "@coda-console/composer",
1040
1246
  "tag": "latest",
1041
- "version": "3.8.0",
1042
- "integrity": "sha512-E/aeIb0xSFvRfPKXo2e4sRDpu7Y7BmqcPzQwRleIEQZiNFPwH5gVpDqUQkXmvyLjdP0fz6sCsT+JWC6Hmn2b+A==",
1247
+ "version": "3.9.0",
1248
+ "integrity": "sha512-o3yN3ED6XjYLG7a+gZlxA34Hj4vpRpdW23od+hSJgXfwayhb9G2hW7VNEJ9xfexe2VUjVRashtSz0Xe67uEK1Q==",
1043
1249
  "repo": "https://github.com/coda-console/coda-plugins.git",
1044
1250
  "path": "plugins/composer"
1045
1251
  },
@@ -1377,15 +1583,20 @@
1377
1583
  {
1378
1584
  "id": "grok",
1379
1585
  "displayName": "Grok",
1380
- "description": "Grok Agent:适配运行机上 Grok CLI 的 ACP 与审批模式;资源页的「Grok」面板显示账号与额度,可从 Coda 安装和登录。",
1381
- "version": "1.4.0",
1586
+ "description": "用 Grok CLI 跑会话",
1587
+ "version": "1.5.0",
1382
1588
  "category": "Agent",
1589
+ "icon": {
1590
+ "light": "JVBERi0xLjcKJbXtrvsKNCAwIG9iago8PCAvTGVuZ3RoIDUgMCBSCiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCj4+CnN0cmVhbQp4nFVTTcoVQQzc9ymyFoxJ57eP4RFkwG/zXKj3Byv9UJCBGZLupCpVGSXB81nx0rPp+bF+Lrm5Xx/05ZvQx+9Vzpqke7Nt+kFqxaedKlg96EXqyqpGtbm3IwyOTirjMkTF0puqUL3oIQ3nszed5D3noezapHpY7KB7cIvi65y1p2AL60EmhE2CTrNnLMQA2EXVnHIu7EGjhyIvgAYSQHhRN1oHKTjsxMEeCFSU8jmJTn7eHLzZfFpo9h1O9+E4mAnDnInF361wHtuoBVL8LYha1Mrig6kpXFKE8RU3tIRDmsw4AxQOwiIQvMUHVaEIbfRDFKaLIED22MIiTjZcLxLkRZkJu/VF+pewOEiMX1ZvwyxpvSjlOqZArw54aNDMR/TNvpN8gxwcPWx1KIEPNigyHQNgdLqSwzDBiNB/ZHfgO0TU5kYRpDvqww8HmNDe8eu/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G9iagogICAyNzcKZW5kb2JqCjEzIDAgb2JqCjw8IC9UeXBlIC9YUmVmCiAgIC9MZW5ndGggNTkKICAgL0ZpbHRlciAvRmxhdGVEZWNvZGUKICAgL1NpemUgMTQKICAgL1cgWzEgMiAyXQogICAvUm9vdCAxMSAwIFIKICAgL0luZm8gMTAgMCBSCj4+CnN0cmVhbQp4nGNgYPj/n4mBk4EBRDAxMoUxMDAy8AMJJgeQGDuINQ9IMCuACFOIOkYQwczIsg8oxnKVgQEA1JwFgQplbmRzdHJlYW0KZW5kb2JqCnN0YXJ0eHJlZgoxMjM3CiUlRU9GCg==",
1591
+ "template": true
1592
+ },
1593
+ "readme": true,
1383
1594
  "source": {
1384
1595
  "kind": "builtin",
1385
1596
  "package": "@coda-console/grok",
1386
1597
  "tag": "latest",
1387
- "version": "1.4.0",
1388
- "integrity": "sha512-acq1OH9zrCN1qyfEpJpj0rJwwepzJkKsUM2E22Rh7Bk0IXpqkdbSnX8PYJsADCc6pRpjK0/P8ecYKK9146AZ1Q==",
1598
+ "version": "1.5.0",
1599
+ "integrity": "sha512-eMrRAGwSDOhkVER7Kh0yFwFwnuLdg92k/JTXC+1HUu80RE56zf1HcFjDp8BgEL6HxDxz9gqqk+L34f5Yymq9Ng==",
1389
1600
  "repo": "https://github.com/coda-console/coda-plugins.git",
1390
1601
  "path": "plugins/grok"
1391
1602
  },
@@ -1450,15 +1661,21 @@
1450
1661
  {
1451
1662
  "id": "kimi",
1452
1663
  "displayName": "Kimi Code",
1453
- "description": "Kimi Code Agent:Coda 的入口在运行机的 kimi acp 与 Coda 之间转发,读 Kimi 的会话文件报出后台命令与子 Agent;资源页的「Kimi」面板显示账号与额度,可从 Coda 安装和登录。",
1454
- "version": "1.2.4",
1664
+ "description": "用 Kimi Code 跑会话",
1665
+ "version": "1.3.0",
1455
1666
  "category": "Agent",
1667
+ "icon": {
1668
+ "light": "JVBERi0xLjcKJbXtrvsKNCAwIG9iago8PCAvTGVuZ3RoIDUgMCBSCiAg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IDE2CmVuZG9iago5IDAgb2JqCjw8IC9UeXBlIC9PYmpTdG0KICAgL0xlbmd0aCAxMiAwIFIKICAgL04gNAogICAvRmlyc3QgMjMKICAgL0ZpbHRlciAvRmxhdGVEZWNvZGUKPj4Kc3RyZWFtCnicVZFBa4QwEIXv/oq5lCoFzURtdxfZwyospRTE3VvpIcTgBoqRJJbuv28S1y0lzGE+3uS9YRBIhARKElHAEiNEyF+KqKogO18nAVnLBmEiAMjeZG/gAygQ6OAzoFrNowWM9vsw0WrVz1xoiDmTWgGmuEkLiC/WTmaXZYEOmk0XyU2q9JAkyzdaMCvV2DArIG52lNBnssUtpWWB+EQ2j4Qkq8lfLHhw1n6+ZVr4HD5ZAO+il+ygflxc4h7mZag19Gid3EBx1x+1mieoKt/4fvEIdEUnRzUbzeS9+HXFr2D1LNaudqpGfEsuuuPBQ5fZ804YNWsuDOR3z5Mb5HaJbtwV/q1XM8u+1HDbzl3gtpwT/QIe+27SCmVuZHN0cmVhbQplbmRvYmoKMTIgMCBvYmoKICAgMjc4CmVuZG9iagoxMyAwIG9iago8PCAvVHlwZSAvWFJlZgogICAvTGVuZ3RoIDU5CiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCiAgIC9TaXplIDE0CiAgIC9XIFsxIDIgMl0KICAgL1Jvb3QgMTEgMCBSCiAgIC9JbmZvIDEwIDAgUgo+PgpzdHJlYW0KeJxjYGD4/5+JgZOBAUQwMTItZ2BgZOAHEkwTQWLsINZ7IMFcCCLaIOoYQQQzI6sAUIxVnYEBAAYyBbwKZW5kc3RyZWFtCmVuZG9iagpzdGFydHhyZWYKMTMxOQolJUVPRgo=",
1670
+ "template": false
1671
+ },
1672
+ "readme": true,
1456
1673
  "source": {
1457
1674
  "kind": "builtin",
1458
1675
  "package": "@coda-console/kimi",
1459
1676
  "tag": "latest",
1460
- "version": "1.2.4",
1461
- "integrity": "sha512-Mg4mHnzuWASYcjJYFzCnYm23eML9DZKTIkVQHMQKFPw9vknbIBWOz3d/C2kSAFudR3RuLXAxLtO3EgdEGOssAw==",
1677
+ "version": "1.3.0",
1678
+ "integrity": "sha512-Q/qiUPshiQO7xFEvk8n8TKguBHmmpEkqrS5BR+3mTdq3i3HxpV/Q8gKKaa11KqE6I2tUlReBXt5e/l/PAcgLSQ==",
1462
1679
  "repo": "https://github.com/coda-console/coda-plugins.git",
1463
1680
  "path": "plugins/kimi"
1464
1681
  },
@@ -1523,15 +1740,21 @@
1523
1740
  {
1524
1741
  "id": "opencode",
1525
1742
  "displayName": "OpenCode",
1526
- "description": "OpenCode Agent:接入原生子会话的状态、过程与停止,跟踪后台命令,并送入会话指令。",
1527
- "version": "2.2.1",
1743
+ "description": "用 OpenCode 跑会话",
1744
+ "version": "2.3.0",
1528
1745
  "category": "Agent",
1746
+ "icon": {
1747
+ "light": "JVBERi0xLjcKJbXtrvsKNCAwIG9iago8PCAvTGVuZ3RoIDUgMCBSCiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCj4+CnN0cmVhbQp4nDNUMABCXUMgYWRkqpCcy1XIVaigX2yukF6soF9hoeCSrxDIFcgFAKn0CNoKZW5kc3RyZWFtCmVuZG9iago1IDAgb2JqCiAgIDQ1CmVuZG9iagozIDAgb2JqCjw8CiAgIC9FeHRHU3RhdGUgPDwKICAgICAgL3M3IDcgMCBSCiAgID4+CiAgIC9YT2JqZWN0IDw8IC94OCA4IDAgUiA+Pgo+PgplbmRvYmoKMTAgMCBvYmoKPDwgL1R5cGUgL1hPYmplY3QKICAgL0xlbmd0aCA0MAogICAvRmlsdGVyIC9GbGF0ZURlY29kZQogICAvU3VidHlwZSAvRm9ybQogICAvQkJveCBbIDAgMCAxODAgMjI1IF0KICAgL0dyb3VwIDw8CiAgICAgIC9UeXBlIC9Hcm91cAogICAgICAvUyAvVHJhbnNwYXJlbmN5CiAgICAgIC9JIHRydWUKICAgICAgL0NTIC9EZXZpY2VSR0IKICAgPj4KICAgL1Jlc291cmNlcwo8PAogICAvRXh0R1N0YXRlI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yq35obiMHi8YaNY9dOdJ7pDf9Xtrhh5lGYpQTx4jndGJqJWd64OXus74Fd4Oeq4qUu30d6v0cb8NkDIHftTODFZph8Xd80SNyk/RHV3h33qV9PLLNLft6AK35Uj0CyJRbtQKZW5kc3RyZWFtCmVuZG9iagoyMiAwIG9iagogICAyNzgKZW5kb2JqCjIzIDAgb2JqCjw8IC9UeXBlIC9YUmVmCiAgIC9MZW5ndGggOTEKICAgL0ZpbHRlciAvRmxhdGVEZWNvZGUKICAgL1NpemUgMjQKICAgL1cgWzEgMiAyXQogICAvUm9vdCAyMSAwIFIKICAgL0luZm8gMjAgMCBSCj4+CnN0cmVhbQp4nGNgYPj/n4lBmIEBRDAxMsxjYGBk4AcRnSAxTiCLpRFIMC0BEuzPQBLfQGI3gASbI4jlCiRY94GIFSAlySDCB0hwZIKIeojJjCCCmZGLCyjGpcjAAAArXguKCmVuZHN0cmVhbQplbmRvYmoKc3RhcnR4cmVmCjI1OTMKJSVFT0YK",
1749
+ "template": false
1750
+ },
1751
+ "readme": true,
1529
1752
  "source": {
1530
1753
  "kind": "builtin",
1531
1754
  "package": "@coda-console/opencode",
1532
1755
  "tag": "latest",
1533
- "version": "2.2.1",
1534
- "integrity": "sha512-Nh8hHSI3mBC43spD6410oCxAfSmjj/OWF1AXEhibCQIxswISHgXt0b39OpY1wHZPENZ9UmFSjmmAJpmdujNuEg==",
1756
+ "version": "2.3.0",
1757
+ "integrity": "sha512-PNvZZNnZ3Xbfw3+CG7SkC9pKfKEFIigLTUN4shA3y9ZCbfH7EMv7diSAhgSowxrwuP26JvdoV0dGet46mBIAPA==",
1535
1758
  "repo": "https://github.com/coda-console/coda-plugins.git",
1536
1759
  "path": "plugins/opencode"
1537
1760
  },
@@ -1597,15 +1820,20 @@
1597
1820
  {
1598
1821
  "id": "review",
1599
1822
  "displayName": "PR 生命流程",
1600
- "description": "会话开的 PR 从开出来起一条流程:每个新版本先跑项目声明的检查,再请另一家 Agent 评审,要求修改时交给开 PR 的会话处理、有分歧时交给你仲裁;通过后请你批准合并,跑过项目的合并前检查再合并,合并后按你的选择删除远程分支、调用项目的部署和发布流程,PR 合并或关闭时结束。",
1601
- "version": "2.9.1",
1823
+ "description": "PR 从检查、评审到批准合并",
1824
+ "version": "2.10.0",
1602
1825
  "category": "工作流程",
1826
+ "icon": {
1827
+ "symbol": "checkmark.bubble.fill",
1828
+ "color": "purple"
1829
+ },
1830
+ "readme": true,
1603
1831
  "source": {
1604
1832
  "kind": "builtin",
1605
1833
  "package": "@coda-console/review",
1606
1834
  "tag": "latest",
1607
- "version": "2.9.1",
1608
- "integrity": "sha512-gbg46xKbJv8TTnjfQpae5+bGE+Jt22m2nB3JWkpmMWwQdtLoHcODWdel1MJvJ8DHkITHvUAJmeImvi9bS40aZQ==",
1835
+ "version": "2.10.0",
1836
+ "integrity": "sha512-EutKwDxNJmijPJawe48K4ffeHbaFo8JZEhYgJHY/dVwonsXHcSwj4S7flYWiQvdiM03O22Ha4KfI4V15SOripA==",
1609
1837
  "repo": "https://github.com/coda-console/coda-plugins.git",
1610
1838
  "path": "plugins/review"
1611
1839
  },
@@ -1776,6 +2004,7 @@
1776
2004
  "description": "在资源页显示 CPU、内存、各磁盘、网络、温度、GPU、电池与风扇数值;在插件设置中选择显示项,打开或刷新时采样。",
1777
2005
  "version": "1.0.2",
1778
2006
  "category": "机器与资源",
2007
+ "readme": true,
1779
2008
  "source": {
1780
2009
  "kind": "builtin",
1781
2010
  "repo": "https://github.com/coda-console/machine-stats.git",
@@ -7,12 +7,19 @@ import { isAbsolute, join, normalize } from 'node:path';
7
7
  // An icon file, read once with the plugin (its schema says it is a PDF in the plugin's directory): both clients draw it as
8
8
  // they drew the brand artwork they shipped with.
9
9
  const icon = (dir, path) => readFileSync(join(dir, normalize(path))).toString('base64');
10
+ // The PDFs an icon names (an agent's, or a plugin's own drawn the same way), read: light, dark when there is one, and
11
+ // whether it is drawn in the text colour.
12
+ export const iconFiles = (dir, spec) => ({ light: icon(dir, spec.light), ...(spec.dark !== undefined ? { dark: icon(dir, spec.dark) } : {}), template: spec.template === true });
13
+ // An icon as the clients are given it: PDFs as data, light and dark, and whether they take the text's color; a symbol on
14
+ // a colour as it is.
15
+ const pdf = data => data ? `data:application/pdf;base64,${data}` : null;
16
+ export const shownIcon = icon => icon.symbol ? { symbol: icon.symbol, color: icon.color } : { light: pdf(icon.light), dark: pdf(icon.dark), template: icon.template };
10
17
  const MODES = ['title', 'unset', 'note', 'auto', 'full'];
11
18
  // `contributes.agents` of the plugin in `dir`, as its schema has them.
12
19
  export function agentDeclarations(raw = [], dir) {
13
20
  return raw.map(agent => ({
14
21
  id: agent.id, displayName: agent.displayName,
15
- icon: { light: icon(dir, agent.icon.light), ...(agent.icon.dark !== undefined ? { dark: icon(dir, agent.icon.dark) } : {}), template: agent.icon.template === true },
22
+ icon: iconFiles(dir, agent.icon),
16
23
  command: agent.command,
17
24
  ...(agent.lifecycle !== undefined ? { lifecycle: agent.lifecycle } : {}),
18
25
  modes: Object.fromEntries(MODES.filter(key => agent.modes?.[key] !== undefined).map(key => [key, agent.modes[key]])),
@@ -16,7 +16,7 @@ import { settings as agentSettings } from '../session-config/commands.mjs';
16
16
  import { requireCondition as check, ContractError } from '../../domain/errors.mjs';
17
17
  import { isDuration } from '../../domain/duration.mjs';
18
18
  import { AGENT_ID } from '../../domain/values.mjs';
19
- import { agentDeclarations } from './agent-plugins.mjs';
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
22
  import { claims, COMMIT, INTEGRITY, NPM_VERSION, npmPluginId, repoAddress, sourcePath } from './plugin-source-rules.mjs';
@@ -95,6 +95,18 @@ function parametersOf(value, where) {
95
95
  }));
96
96
  return { properties, ...(value.required?.length ? { required: [...value.required] } : {}) };
97
97
  }
98
+ // Its icon (docs/plugins.md「插件页」): a symbol on a system colour as written, or its PDFs read as an agent's are; one that
99
+ // draws none and brings one agent is drawn as that agent. Nothing else: the clients draw its category's.
100
+ export function pluginIcon(declared, agents, dir) {
101
+ if (declared?.symbol) return { symbol: declared.symbol, color: declared.color };
102
+ if (declared) return iconFiles(dir, declared);
103
+ return agents.length === 1 ? agents[0].icon : null;
104
+ }
105
+ // The README a plugin's page shows (docs/plugins.md「插件页」), as npm and GitHub find it in its directory; null without one.
106
+ const README = /^readme(\.md|\.markdown)?$/i;
107
+ export function readmeFile(dir) {
108
+ try { const name = readdirSync(dir).filter(name => README.test(name)).sort()[0]; return name ? join(dir, name) : null; } catch { return null; }
109
+ }
98
110
  // The category it is listed under (docs/plugins.md「商店」): the first of its manifest's `categories`, as VS Code's are
99
111
  // written; empty when it names none.
100
112
  export const manifestCategory = manifest => Array.isArray(manifest?.categories) && typeof manifest.categories[0] === 'string' ? manifest.categories[0].trim().slice(0, 32) : '';
@@ -122,8 +134,10 @@ export function readPlugin(dir, source) {
122
134
  const displayName = typeof manifest.displayName === 'string' ? manifest.displayName : id;
123
135
  // What it writes under keys of `contributes` that are none of Coda's: for the points other plugins declare (checkCatalog).
124
136
  const offers = Object.fromEntries(Object.entries(contributes).filter(([key]) => !TYPES.includes(key)));
137
+ const agents = agentDeclarations(contributes.agents, dir), icon = pluginIcon(manifest.icon, agents, dir);
125
138
  return { id, displayName, description: typeof manifest.description === 'string' ? manifest.description : '', version: String(manifest.version ?? ''),
126
- category: manifestCategory(manifest), source, dir, title: typeof configuration.title === 'string' ? configuration.title : displayName, properties,
139
+ category: manifestCategory(manifest), ...(icon ? { icon } : {}), ...(readmeFile(dir) ? { readme: true } : {}),
140
+ source, dir, title: typeof configuration.title === 'string' ? configuration.title : displayName, properties,
127
141
  ...(manifest.coda !== undefined ? { coda: manifest.coda } : {}),
128
142
  ...(manifest.main ? { main: posix.normalize(manifest.main) } : {}), ...(activation.includes('onStartupFinished') ? { startup: true } : {}),
129
143
  ...(required.length ? { required: [...required] } : {}), workflows: files('.coda/workflows'),
@@ -139,7 +153,7 @@ export function readPlugin(dir, source) {
139
153
  ...(v.checkout ? { checkout: v.checkout } : {}), ...(v.frame ? { frame: v.frame } : {}) })),
140
154
  ...(contributes.composerModes?.length ? { composerModes: composerModes(contributes.composerModes) } : {}),
141
155
  ...(Object.keys(offers).length ? { offers } : {}),
142
- agents: agentDeclarations(contributes.agents, dir),
156
+ agents,
143
157
  dependencies: [...dependencies], extensionPoints: extensionPoints(contributes.extensionPoints, dir),
144
158
  extensions: Object.entries(contributes.extensions ?? {}).map(([key, value]) => { const [plugin, point] = key.split('/'); return { plugin, point, command: value.command }; }),
145
159
  ...(contributes.instructions ? { instructions: contributes.instructions.trim() } : {}), ...(contributes.setup ? { setup: { command: contributes.setup.command } } : {}),
@@ -1,4 +1,5 @@
1
- // Read-only Skill documents from the same plugin copy the catalog gives agents (docs/plugins.md「Skills」).
1
+ // Read-only documents of the same plugin copy the catalog gives agents: its Skills (docs/plugins.md「Skills」) and its README
2
+ // (docs/plugins.md「插件页」).
2
3
  import { readFileSync, realpathSync, statSync } from 'node:fs';
3
4
  import { isAbsolute, join, relative } from 'node:path';
4
5
  import { parse } from 'yaml';
@@ -33,3 +34,21 @@ export function readSkillDocument(plugin, name) {
33
34
  throw error;
34
35
  }
35
36
  }
37
+
38
+ // A plugin's README as its page shows it, from its own directory (never through a link out of it): empty without one.
39
+ export function readPluginReadme(plugin, file) {
40
+ const said = { plugin: plugin.id, displayName: plugin.displayName, version: plugin.version };
41
+ if (!file) return { ...said, markdown: '' };
42
+ try {
43
+ const path = realpathSync(file), within = relative(realpathSync(plugin.dir), path);
44
+ check(within && within !== '..' && !within.startsWith('../') && !isAbsolute(within), 'not_found', 'README 不在插件目录里');
45
+ const found = statSync(path);
46
+ check(found.isFile() && found.size <= README_LIMIT, 'invalid_plugin', 'README 须为不超过 1 MiB 的文本');
47
+ return { ...said, markdown: readFileSync(path, 'utf8') };
48
+ } catch (error) {
49
+ if (['ENOENT', 'ENOTDIR'].includes(error.code)) return { ...said, markdown: '' };
50
+ check(!['EACCES', 'EPERM'].includes(error.code), 'invalid_plugin', '无法读取这个插件的 README。');
51
+ throw error;
52
+ }
53
+ }
54
+ export const README_LIMIT = 1024 * 1024;
@@ -1,9 +1,9 @@
1
1
  {
2
- "commit": "b133b738adb57f44665c89f5a8ed8b1ebc84920c",
2
+ "commit": "d75bc18652da406a03a9d5665fa1f05034837206",
3
3
  "packages": {
4
4
  "@0dep/piso": "5.2.0",
5
5
  "@agentclientprotocol/sdk": "1.4.0",
6
- "@coda-console/protocol": "2.4.0",
6
+ "@coda-console/protocol": "2.5.0",
7
7
  "ajv": "8.20.0",
8
8
  "yaml": "2.9.1"
9
9
  },
@@ -14,11 +14,11 @@
14
14
  "check/coda/adapters/provider-api.mjs": "8a2b5d7b4a3766f9e28270bd355f4b4081d3069b4cedad120671995bea160253",
15
15
  "check/coda/adapters/admission-api.mjs": "461b5a8a1ad73d7afed5db308813d02324e29c643b8e773ad127d4bdb00fb524",
16
16
  "check/coda/components/composers/schemas.mjs": "282052bb58bdbf612a55b275456c6fea04d979136cf8a3700a4641380e501b3f",
17
- "check/coda/components/plugins/agent-plugins.mjs": "d117702f83c988aa89c2e5ae26aafd6ae3e8ba0829adaeedf9e8640f5f8282be",
17
+ "check/coda/components/plugins/agent-plugins.mjs": "7ca5c0303c6fedffa7b0bcd90546273356ebc410b101f203f2ee8e7503063403",
18
18
  "check/coda/components/plugins/plugin-extensions.mjs": "4d7963185195ba6d21a4e49a66987613d5892210b1eb1dc02cffb7b816407776",
19
- "check/coda/components/plugins/plugin-rules.mjs": "e0fd9c1dade361667337a4c680e399f02ddd557af79e476bcecd91daebcf81d5",
19
+ "check/coda/components/plugins/plugin-rules.mjs": "6a0e534aefb2256c4e88486a4727dc7ad88cb29bec755a854d5bf2f4bf773a24",
20
20
  "check/coda/components/plugins/plugin-source-rules.mjs": "d894d55a3272df5ef3b108b68820c64aefdf6b69346404b58954f2a3503cb4a5",
21
- "check/coda/components/plugins/skill-document.mjs": "c5b5e815c42cd836572f7b60e22a46af6ac607fd9df0170fa36f955825636ce6",
21
+ "check/coda/components/plugins/skill-document.mjs": "153ad3c096c7c9b7774bcf7dcc0ba603c962ee1ac8697c8a71e3f2c9ba9c92e6",
22
22
  "check/coda/components/prompt-recovery/prompt-recovery.mjs": "f43f21d24c19a58113d3304f9248225b12080ab00ed15eab74bf7b94642732de",
23
23
  "check/coda/components/session-config/commands.mjs": "2e4c80b0280db32fe220fa360f18a8e66f12e6a16e3e7bce545c762c9c6340e1",
24
24
  "check/coda/components/workflows/executor-labels.mjs": "dceca6ae60c0a4f3c3cc72a6c84f1489831790774c93caab96e4ddb493bc89e1",
@@ -30,9 +30,9 @@
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
- "check/coda/resources/plugins/resources/panels/panels.mjs": "9e25cfbc16ed9f68101fc7bfc34b8056c13a29d2368c5561e65e333233eb921e",
34
- "check/coda/resources/plugins/resources/panels/rules.mjs": "8418ed83b796f18047c154d8dea8dca7d98244af8ddfe3ddf188520c59324ee8",
33
+ "check/coda/resources/plugins/resources/panels/panels.mjs": "4862dccd91c29db76caf1033ffeab743c7943befaca7406a56467c470b90a1b8",
34
+ "check/coda/resources/plugins/resources/panels/rules.mjs": "8de0c45df3b252d49a5a012696db95c9c46f29262213b2f846928cd512dd7213",
35
35
  "check/coda/resources/plugins/resources/panels/sign-in.mjs": "1271a24e33b1b882a1fb9bee03b8e240db8b9bee1b5208f0e1c84499cfb1be7e",
36
- "check/coda/builtin.json": "837c8cc80b5313f41c0e452da6355183b7e9070eb44e00a21e30cf59eff38e9e"
36
+ "check/coda/builtin.json": "5a597073d8188733dda85977c4ba7ed83fe011b9968146e4b567b3b7219435ad"
37
37
  }
38
38
  }
@@ -1,17 +1,19 @@
1
- // The panels installed plugins bring to this machine's resources page (docs/plugins.md「面板」), read and acted on here, in
2
- // the resources plugin's module: what each plugin declares comes from Coda's collection of the installed plugins
1
+ // The resource types installed plugins bring to this machine's resources page (docs/plugins.md「资源」), read and acted on
2
+ // here, in the resources plugin's module: what each plugin declares comes from Coda's collection of the installed plugins
3
3
  // (`coda.watch("plugins")`), and each command runs with that plugin's own environment (`coda.environment(null, { plugin })`),
4
- // as Coda gives every process of the plugin's. A panel is read only when a page asks (opening it, refreshing), never in
5
- // the background, and no reading is kept on disk. What every panel gets from here and not from its plugin: one reading
6
- // at a time (a second ask joins it), the last good reading shown again within the panel's `maxAge` and listed with the
7
- // panel, and on failure the last good one kept and marked as such. The machine keeps the panels it hides, in this
8
- // plugin's state; their order is their plugins' (docs/resources-page.md「顺序」).
4
+ // as Coda gives every process of the plugin's. A plugin declaring `resources` has those; one still declaring the panels
5
+ // before them has its panels, read as they were (`format`), for the page to take as resources (docs/plugins.md「旧的面板」).
6
+ // A type is read only when a page asks (opening it, refreshing), never in the background, and no reading is kept on disk.
7
+ // What every type gets from here and not from its plugin: one reading at a time (a second ask joins it), the last good
8
+ // reading shown again within the type's `maxAge` and listed with it, and on failure the last good one kept and marked as
9
+ // such. The machine keeps which it shows and which not, in this plugin's state; their order is their plugins'
10
+ // (docs/resources-page.md「顺序」). Inside, a type is still called a panel, as the page's view and its messages are.
9
11
  import { spawnSync } from 'node:child_process';
10
12
  import { readFileSync, writeFileSync, renameSync } from 'node:fs';
11
13
  import { tmpdir } from 'node:os';
12
14
  import { join } from 'node:path';
13
15
  import { runCommand, ended, outcome } from './command.mjs';
14
- import { PanelError, panelDeclarations, panelItems, actionArgs, shownItems, displayOptions, keepMissingMetrics } from './rules.mjs';
16
+ import { PanelError, panelDeclarations, panelItems, resourceItems, actionArgs, shownItems, displayOptions, keepMissingMetrics } from './rules.mjs';
15
17
  import { SignIn, authorizationLink, deviceCode } from './sign-in.mjs';
16
18
 
17
19
  const fail = (code, message) => { throw new PanelError(code, message); };
@@ -31,10 +33,10 @@ export class Panels {
31
33
  // Nothing is told before the plugins' environments are there (`ready`): what a login says of whether its program is
32
34
  // installed is checked with its plugin's own.
33
35
  changed(key = null) { if (this.ready) for (const fn of this.listeners) try { fn(key); } catch {} }
34
- // Once: the installed plugins watched, what this machine hides, and the environment of each plugin whose panels sign in.
36
+ // Once: the installed plugins watched, what this machine shows and hides, and the environment of each plugin whose panels sign in.
35
37
  start() {
36
38
  this.started ??= (async () => {
37
- this.hidden = this.readHidden();
39
+ this.choices = this.readHidden();
38
40
  const watched = await this.coda.watch('plugins', ({ type, id, object }) => {
39
41
  if (type === 'DELETED') this.plugins.delete(id); else this.plugins.set(id, object);
40
42
  // Another version (another directory, another environment): what was checked with the last is checked again.
@@ -51,20 +53,29 @@ export class Panels {
51
53
  })();
52
54
  return this.started;
53
55
  }
54
- // What the machine hides, as it was kept: none when nothing is, or what is cannot be read.
56
+ // What the machine was told to hide or show, by panel: none when nothing is, or what is cannot be read. Kept before as
57
+ // the list of those hidden.
55
58
  readHidden() {
56
- try { return new Set(JSON.parse(readFileSync(this.file, 'utf8'))); } catch { return new Set(); }
59
+ try {
60
+ const kept = JSON.parse(readFileSync(this.file, 'utf8'));
61
+ return Array.isArray(kept) ? Object.fromEntries(kept.map(key => [key, true])) : kept && typeof kept === 'object' ? kept : {};
62
+ } catch { return {}; }
57
63
  }
58
- keepHidden(hidden) {
64
+ keepHidden(choices) {
59
65
  const next = `${this.file}.next`;
60
- writeFileSync(next, JSON.stringify([...hidden].sort()));
66
+ writeFileSync(next, JSON.stringify(Object.fromEntries(Object.entries(choices).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0))));
61
67
  renameSync(next, this.file);
62
68
  }
63
- // The installed plugins' panels, by plugin id, each plugin's in the order it declares them. A project disabling a plugin
64
- // does not take its panels away: the page is the machine's, not a project's.
69
+ // Whether the machine hides it: as it was told, else as its type says (`hidden`, shown only once chosen).
70
+ hiddenOf({ key, panel }) { return this.choices[key] ?? !!panel.hidden; }
71
+ // The installed plugins' types, by plugin id, each plugin's in the order it declares them: its resource types, or the
72
+ // panels of one that declares none. A project disabling a plugin does not take them away: the page is the machine's,
73
+ // not a project's.
65
74
  installed() {
66
- return [...this.plugins.values()].sort((a, b) => a.id < b.id ? -1 : a.id > b.id ? 1 : 0).flatMap(plugin =>
67
- panelDeclarations(plugin.contributes?.panels).map(panel => ({ plugin, panel, key: `${plugin.id}/${panel.id}` })));
75
+ return [...this.plugins.values()].sort((a, b) => a.id < b.id ? -1 : a.id > b.id ? 1 : 0).flatMap(plugin => {
76
+ const format = plugin.contributes?.resources ? 'resources' : 'panels';
77
+ return panelDeclarations(plugin.contributes?.[format]).map(panel => ({ plugin, panel, key: `${plugin.id}/${panel.id}`, format }));
78
+ });
68
79
  }
69
80
  find(key) {
70
81
  return this.installed().find(e => e.key === key) ?? fail('not_found', `没有面板 ${key}`);
@@ -76,14 +87,15 @@ export class Panels {
76
87
  }
77
88
  // What a page shows of a panel: what it is, whether the machine hides it, what was last read and how that stands now.
78
89
  view(entry, index) {
79
- const { plugin, panel, key } = entry, shown = this.shown.get(key);
80
- return { plugin: plugin.id, pluginName: plugin.name, panel: panel.id, title: panel.title, version: plugin.version ?? '', source: plugin.source ?? { kind: 'builtin' },
90
+ const { plugin, panel, key, format } = entry, shown = this.shown.get(key), acting = this.acting.get(key);
91
+ return { plugin: plugin.id, pluginName: plugin.name, panel: panel.id, title: panel.title, format, version: plugin.version ?? '', source: plugin.source ?? { kind: 'builtin' },
81
92
  actions: Object.fromEntries(Object.entries(panel.actions ?? {}).map(([name, a]) => [name, a.confirm ? { confirm: a.confirm } : {}])),
82
- configurable: !!panel.displaySetting, signsIn: !!panel.signIn, hidden: this.hidden.has(key), index,
93
+ configurable: !!panel.displaySetting, signsIn: !!panel.signIn, hidden: this.hiddenOf(entry), index,
83
94
  signIn: panel.signIn ? this.login(entry).view() : null,
84
95
  reading: shown ? this.present(entry, shown) : null,
85
96
  busy: this.reading.has(key), failure: this.failures.get(key) ?? null,
86
- acting: this.acting.get(key)?.button ?? null, actionError: this.acting.get(key)?.error ?? null };
97
+ // The action under way, by its button; or why the last one did not go through, with the button it was.
98
+ acting: acting && !acting.error ? acting.button : null, actionError: acting?.error ?? null, failedButton: acting?.error ? acting.button : null };
87
99
  }
88
100
  list() { return this.installed().map((entry, index) => [entry.key, this.view(entry, index)]); }
89
101
  // One panel's, as `list` has it; none for one no longer installed.
@@ -106,13 +118,14 @@ export class Panels {
106
118
  const values = this.settingsOf(plugin.id)[panel.displaySetting] ?? {};
107
119
  return { ...reading, items: shownItems(reading.items, values), display: { setting: panel.displaySetting, options: displayOptions(reading.items, values) } };
108
120
  }
109
- // `{ items, readAt }`, or with `error` when this reading failed: then the last good items with `stale`, or none.
121
+ // `{ resources, readAt }` (a panel's `{ items, readAt }`), or with `error` when this reading failed: then the last good
122
+ // one with `stale`, or none.
110
123
  read(key, { force = false } = {}) {
111
124
  const entry = this.find(key);
112
125
  const pending = this.reading.get(key);
113
126
  if (pending) return pending;
114
127
  const last = this.last.get(key);
115
- if (!force && last && entry.panel.maxAgeMs && this.now() - last.at < entry.panel.maxAgeMs && !this.shown.get(key)?.error) return Promise.resolve(this.present(entry, { items: last.items, readAt: last.at }));
128
+ if (!force && last && entry.panel.maxAgeMs && this.now() - last.at < entry.panel.maxAgeMs && !this.shown.get(key)?.error) return Promise.resolve(this.present(entry, { ...last.content, readAt: last.at }));
116
129
  const reading = this.fetch(entry).finally(() => { this.reading.delete(key); this.changed(key); });
117
130
  this.reading.set(key, reading);
118
131
  this.changed(key);
@@ -124,11 +137,10 @@ export class Panels {
124
137
  try {
125
138
  const result = await this.run(panel.command, { env: await this.env(plugin.id), timeoutMs: this.readTimeoutMs, signal: this.closing.signal });
126
139
  if (ended(result)) {
127
- const parsed = panelItems(result.stdout, panel, plugin.views ?? []), at = this.now();
128
- const items = panel.displaySetting ? keepMissingMetrics(parsed, this.last.get(key)?.items ?? []) : parsed;
129
- this.last.set(key, { items, at }); this.failures.delete(key);
130
- this.shown.set(key, { items, readAt: at });
131
- return this.present(entry, { items, readAt: at });
140
+ const content = this.content(entry, result.stdout), at = this.now();
141
+ this.last.set(key, { content, at }); this.failures.delete(key);
142
+ this.shown.set(key, { ...content, readAt: at });
143
+ return this.present(entry, { ...content, readAt: at });
132
144
  }
133
145
  failure = outcome(result, '读取');
134
146
  } catch (e) {
@@ -136,15 +148,21 @@ export class Panels {
136
148
  failure = `输出无效:${e.message}`;
137
149
  }
138
150
  const last = this.last.get(key);
139
- const reading = last ? { items: last.items, readAt: last.at, stale: true, error: failure } : { items: [], error: failure };
151
+ const reading = last ? { ...last.content, readAt: last.at, stale: true, error: failure } : { [entry.format === 'resources' ? 'resources' : 'items']: [], error: failure };
140
152
  this.shown.set(key, reading);
141
153
  return this.present(entry, reading);
142
154
  }
155
+ // What a command printed, as its format has it: resources, or a panel's items (those it chooses among keeping their places).
156
+ content({ plugin, panel, key, format }, output) {
157
+ if (format === 'resources') return { resources: resourceItems(output, panel, plugin.views ?? []) };
158
+ const items = panelItems(output, panel, plugin.views ?? []);
159
+ return { items: panel.displaySetting ? keepMissingMetrics(items, this.last.get(key)?.content.items ?? []) : items };
160
+ }
143
161
  // Runs one of a panel's actions with what its button sent, then reads the panel again. One action of a panel at a time;
144
162
  // one under way goes on to its end even when whoever asked has gone.
145
163
  async act(key, name, args, button = name) {
146
- const entry = this.find(key), { plugin, panel } = entry;
147
- if (this.acting.get(key)?.button) fail('panel_busy', `${panel.title} 正在进行另一项操作`);
164
+ const entry = this.find(key), { plugin, panel } = entry, now = this.acting.get(key);
165
+ if (now && !now.error) fail('panel_busy', `${panel.title} 正在进行另一项操作`);
148
166
  // What went wrong is said under the panel, whatever it was.
149
167
  try {
150
168
  const action = panel.actions?.[name] ?? fail('not_found', `面板 ${panel.title} 没有动作 ${name}`);
@@ -155,20 +173,19 @@ export class Panels {
155
173
  if (!ended(result)) fail('action_failed', outcome(result, '操作'));
156
174
  this.acting.delete(key);
157
175
  } catch (e) {
158
- this.acting.set(key, { error: e.message }); this.changed(key);
176
+ this.acting.set(key, { button, error: e.message }); this.changed(key);
159
177
  throw e;
160
178
  }
161
179
  // A reading that began before the action ended may not show what it did.
162
180
  await this.reading.get(key);
163
181
  return this.read(key, { force: true });
164
182
  }
165
- // One panel hidden or shown again on this machine, the others as they were: one change at a time.
183
+ // One type hidden or shown on this machine, the others as they were: one change at a time.
166
184
  hide(key, hidden) {
167
185
  const change = this.hides.then(() => {
168
- const next = new Set(this.hidden);
169
- if (hidden) next.add(key); else next.delete(key);
186
+ const next = { ...this.choices, [key]: !!hidden };
170
187
  this.keepHidden(next);
171
- this.hidden = next;
188
+ this.choices = next;
172
189
  this.changed(key);
173
190
  });
174
191
  this.hides = change.catch(() => {});
@@ -1,7 +1,8 @@
1
- // What a panel is (docs/plugins.md「面板」): how a plugin declares one (`contributes.panels`, of the schema the resources
2
- // plugin declares for its point, schema.json, checked where the plugin is installed) and what its command may print,
3
- // checked here, where the panels are read, the way a task's card is drawn from its fields. Nothing here knows what a panel
4
- // is about: CPU, an account's quota and a disk are all meters and figures.
1
+ // What a resource type is (docs/plugins.md「资源」): how a plugin declares one (`contributes.resources`, of the schema the
2
+ // resources plugin declares for its point, resources.schema.json, checked where the plugin is installed) and what its
3
+ // command may print, checked here, where the types are read. Nothing here knows what a resource is about: CPU, an account's
4
+ // quota and a disk are all names and values. A plugin still declaring the panels before them (`contributes.panels`,
5
+ // schema.json) has them read as they were, for the page to take as resources (docs/plugins.md「旧的面板」).
5
6
 
6
7
  // What is not as it must be: the panel says so where it would show.
7
8
  export class PanelError extends Error {
@@ -19,6 +20,8 @@ function durationMs(text) {
19
20
  }
20
21
 
21
22
  export const ITEM_TYPES = ['card', 'meter', 'stat', 'markdown', 'button', 'error'];
23
+ // How many resources a reading lists, and how many values and buttons one has.
24
+ const RESOURCES = 50, VALUES = 8, ACTIONS = 8;
22
25
  // What a panel's command may print: past these, the reading fails rather than being cut short.
23
26
  export const OUTPUT_LIMIT = 64 * 1024;
24
27
  export const ARGS_LIMIT = 4 * 1024;
@@ -36,8 +39,8 @@ const text = (value, max, where, code, { need = true, line = true } = {}) => {
36
39
  };
37
40
  const object = (value, where, code) => check(value && typeof value === 'object' && !Array.isArray(value), code, `${where} 须为对象`);
38
41
 
39
- // ---- Declarations (`contributes.panels`) ----
40
- // A plugin's panels as it declares them, in its order, each with the actions its buttons may take (none when it declares
42
+ // ---- Declarations (`contributes.resources`, or the panels before them) ----
43
+ // A plugin's types as it declares them, in its order, each with the actions its buttons may take (none when it declares
41
44
  // none) and, with a `maxAge`, how long a reading may be shown again without asking.
42
45
  export function panelDeclarations(raw = []) {
43
46
  return raw.map(panel => ({ ...panel, actions: panel.actions ?? {}, ...(panel.maxAge ? { maxAgeMs: durationMs(panel.maxAge) } : {}) }));
@@ -98,24 +101,28 @@ function plainItem(raw, where, scope, inCard) {
98
101
  case 'error':
99
102
  keys(raw, ['type', 'text'], where, code);
100
103
  return { type: 'error', text: text(raw.text, ERROR, `${where} 的 text`, code, { line: false }) };
101
- case 'button': {
102
- keys(raw, ['type', 'label', 'action', 'view', 'args', 'disabled', 'confirm'], where, code);
103
- // What it does: run one of the panel's actions here, or open one of its plugin's views in the client.
104
- const opens = raw.view !== undefined;
105
- check(opens !== (raw.action !== undefined), code, `${where} 须有 action 或 view 之一`);
106
- if (opens) check(typeof raw.view === 'string' && scope.views.includes(raw.view), code, `${where} 的 view 须是插件声明的视图:${raw.view}`);
107
- else check(typeof raw.action === 'string' && Object.hasOwn(scope.actions, raw.action), code, `${where} 的 action 须是面板声明的动作:${raw.action}`);
108
- check(raw.args === undefined || (raw.args && typeof raw.args === 'object' && !Array.isArray(raw.args) && JSON.stringify(raw.args).length <= ARGS_LIMIT), code,
109
- `${where} 的 args 须为不超过 ${ARGS_LIMIT} 字节的对象`);
110
- check(raw.disabled === undefined || typeof raw.disabled === 'boolean', code, `${where} 的 disabled 须为开或关`);
111
- // Its own question, for what this one button does (which account, which credit), in place of its action's.
112
- return { type: 'button', label: text(raw.label, LABEL, `${where} 的 label`, code), ...(opens ? { view: raw.view } : { action: raw.action }),
113
- ...(raw.args ? { args: raw.args } : {}), ...(raw.disabled ? { disabled: true } : {}),
114
- ...(raw.confirm !== undefined ? { confirm: text(raw.confirm, CONFIRM, `${where} 的 confirm`, code, { line: false }) } : {}) };
115
- }
104
+ case 'button':
105
+ keys(raw, ['type', ...BUTTON_KEYS], where, code);
106
+ return { type: 'button', ...button(raw, where, scope) };
116
107
  }
117
108
  return fail(code, `${where} 的 type 不受支持`);
118
109
  }
110
+ const BUTTON_KEYS = ['label', 'action', 'view', 'args', 'disabled', 'confirm'];
111
+ // What a button does: run one of the type's actions here, or open one of its plugin's views in the client.
112
+ function button(raw, where, scope) {
113
+ const code = 'invalid_panel';
114
+ const opens = raw.view !== undefined;
115
+ check(opens !== (raw.action !== undefined), code, `${where} 须有 action 或 view 之一`);
116
+ if (opens) check(typeof raw.view === 'string' && scope.views.includes(raw.view), code, `${where} 的 view 须是插件声明的视图:${raw.view}`);
117
+ else check(typeof raw.action === 'string' && Object.hasOwn(scope.actions, raw.action), code, `${where} 的 action 须是声明的动作:${raw.action}`);
118
+ check(raw.args === undefined || (raw.args && typeof raw.args === 'object' && !Array.isArray(raw.args) && JSON.stringify(raw.args).length <= ARGS_LIMIT), code,
119
+ `${where} 的 args 须为不超过 ${ARGS_LIMIT} 字节的对象`);
120
+ check(raw.disabled === undefined || typeof raw.disabled === 'boolean', code, `${where} 的 disabled 须为开或关`);
121
+ // 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), ...(opens ? { view: raw.view } : { action: raw.action }),
123
+ ...(raw.args ? { args: raw.args } : {}), ...(raw.disabled ? { disabled: true } : {}),
124
+ ...(raw.confirm !== undefined ? { confirm: text(raw.confirm, CONFIRM, `${where} 的 confirm`, code, { line: false }) } : {}) };
125
+ }
119
126
  // A panel's reading from what its command printed. Anything it cannot be fails the reading, with where. `views`: the ids
120
127
  // of its plugin's views, which a button may open.
121
128
  export function panelItems(output, panel, views = []) {
@@ -132,6 +139,55 @@ export function panelItems(output, panel, views = []) {
132
139
  check(new Set(ids).size === ids.length, code, 'display.id 不能重复');
133
140
  return items;
134
141
  }
142
+ // A type's reading from what its command printed: `{ resources: [...] }`, each a name, the outside identity it is (an
143
+ // account, compared and nothing else), its values, one line of what is wrong with it, and its buttons. Nothing that
144
+ // explains: a value is a name and what it reads (docs/plugins.md「资源」). Anything else fails the reading, with where.
145
+ export function resourceItems(output, type, views = []) {
146
+ const code = 'invalid_panel';
147
+ check(Buffer.byteLength(output) <= OUTPUT_LIMIT, code, `输出超过 ${OUTPUT_LIMIT / 1024} KiB`);
148
+ let value;
149
+ try { value = JSON.parse(output); } catch { return fail(code, '输出不是 JSON'); }
150
+ object(value, '输出', code);
151
+ keys(value, ['resources'], '输出', code);
152
+ check(Array.isArray(value.resources) && value.resources.length <= RESOURCES, code, `输出的 resources 须为不超过 ${RESOURCES} 项的数组`);
153
+ return value.resources.map((r, i) => resource(r, `resources[${i}]`, { actions: type.actions, views }));
154
+ }
155
+ function resource(raw, where, scope) {
156
+ const code = 'invalid_panel';
157
+ object(raw, where, code);
158
+ keys(raw, ['name', 'identity', 'values', 'error', 'actions'], where, code);
159
+ const list = (value, max, name) => {
160
+ check(value === undefined || (Array.isArray(value) && value.length <= max), code, `${where} 的 ${name} 须为不超过 ${max} 项的数组`);
161
+ return value ?? [];
162
+ };
163
+ const name = text(raw.name, LABEL, `${where} 的 name`, code, { need: false });
164
+ const values = list(raw.values, VALUES, 'values').map((v, i) => reading(v, `${where}.values[${i}]`));
165
+ const actions = list(raw.actions, ACTIONS, 'actions').map((b, i) => {
166
+ const at = `${where}.actions[${i}]`;
167
+ object(b, at, code);
168
+ keys(b, BUTTON_KEYS, at, code);
169
+ return button(b, at, scope);
170
+ });
171
+ check(name !== undefined || values.length, code, `${where} 须有 name 或 values`);
172
+ return { ...(name !== undefined ? { name } : {}),
173
+ ...(raw.identity !== undefined ? { identity: text(raw.identity, IDENTITY, `${where} 的 identity`, code) } : {}),
174
+ values, ...(raw.error !== undefined ? { error: text(raw.error, LABEL, `${where} 的 error`, code) } : {}), actions };
175
+ }
176
+ // One value: what it is called (left out where its resource has only it), what it reads, how much of it is left (0–1,
177
+ // left out when not known: never drawn as empty), and a time it comes with (when a quota is back).
178
+ function reading(raw, where) {
179
+ const code = 'invalid_panel';
180
+ object(raw, where, code);
181
+ keys(raw, ['label', 'value', 'fraction', 'time'], where, code);
182
+ check(raw.fraction === undefined || raw.fraction === null || (typeof raw.fraction === 'number' && raw.fraction >= 0 && raw.fraction <= 1), code,
183
+ `${where} 的 fraction 须在 0–1 之间,不知道时不写`);
184
+ check(raw.time === undefined || (typeof raw.time === 'string' && Number.isFinite(Date.parse(raw.time))), code, `${where} 的 time 须为 ISO 8601 时间`);
185
+ check(raw.value !== undefined || typeof raw.fraction === 'number', code, `${where} 须有 value 或 fraction`);
186
+ return { ...(raw.label !== undefined ? { label: text(raw.label, LABEL, `${where} 的 label`, code) } : {}),
187
+ ...(raw.value !== undefined ? { value: text(raw.value, LABEL, `${where} 的 value`, code) } : {}),
188
+ ...(typeof raw.fraction === 'number' ? { fraction: raw.fraction } : {}),
189
+ ...(raw.time !== undefined ? { time: new Date(raw.time).toISOString() } : {}) };
190
+ }
135
191
  // What a button sends: an object the action's command reads as JSON.
136
192
  export function actionArgs(value) {
137
193
  if (value === undefined || value === null) return {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coda-console/plugin-check",
3
- "version": "0.5.32",
3
+ "version": "0.5.33",
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": "2.4.0",
27
+ "@coda-console/protocol": "2.5.0",
28
28
  "ajv": "8.20.0",
29
29
  "yaml": "2.9.1"
30
30
  },