@dp-bohrium/widget-cli 0.2.0 → 0.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/AGENTS.md CHANGED
@@ -96,7 +96,20 @@ bohr-widget help [<命令路径>]
96
96
 
97
97
  完整步骤见[交付验收指南](https://dev.dp.tech/bohrium-widget-sdk/guides/delivery-checklist)。
98
98
 
99
- ## file-preview 当前文件读写(SDK 0.4.0)
99
+ ## Panel 发现与观察计算任务(SDK 0.5.0)
100
+
101
+ 需要在 Panel 可见期间发现当前会话的计算任务时,在作者 Manifest 声明
102
+ `capabilities.tasks: { list: true }`;还要读取单个任务的后续快照时,同时声明
103
+ `watch: true`。只需观察已知任务引用的旧 Panel 可继续单独声明 `{ watch: true }`。
104
+
105
+ - `context.tasks.list({ cursor, limit })` 只返回 Host 授权、裁剪后的任务摘要;分页继续使用返回的
106
+ `nextCursor`,不要解析或自行构造 cursor。
107
+ - 首次读取与后续刷新须遵守 grant 的 `minPollMs`、`pageSize` 和 `callsPerMinute`;面板不可见或停用后停止轮询。
108
+ - 列表项的 `taskId` 可传给 `context.tasks.watch`。`list` / `watch` 分别需要真实 grant,Manifest 声明、
109
+ sample 或 CLI 校验通过都不代表目标 Host 已授权。
110
+ - 这两个能力只用于发现和观察,不提供任务创建、调度或取消;任务提交仍由 Agent 与平台工具负责。
111
+
112
+ ## file-preview 当前文件读写(SDK 0.5.0)
100
113
 
101
114
  按原来的 `create --template file-preview --ui vanilla|react` 创建工程。用户需要编辑文件时,
102
115
  由 Agent 在作者 Manifest 中声明 `capabilities.files: { read: true, write: true }`,并实现
package/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  本文件记录使用者可感知的命令、工程模板、校验与打包能力变化。
4
4
 
5
+ ## 0.3.0
6
+
7
+ ### 新增
8
+
9
+ **1. 固定支持任务发现的 SDK/contracts 工具链**
10
+
11
+ - CLI 固定 profile 升级到 SDK/contracts `0.5.0`,内置 compiler、Schema 与校验器接受 `capabilities.tasks.list`,并继续接受既有的 `capabilities.tasks.watch`。
12
+ - `check` / `validate` 可校验仅申请 `list`、仅申请 `watch` 或同时申请两者的作者 Manifest;空的 `tasks: {}` 仍会按契约拒绝。
13
+ - 通过 Bohr CLI 转发或直接安装本版 CLI 时,`integration --json`、生成工程锁和打包摘要都会返回 `widget-sdk-0.5.0-contracts-0.5.0`,避免继续使用不认识 `tasks.list` 的旧校验器。
14
+
15
+ CLI 只负责离线清单、工程与产物校验;真实 Host 是否签发 `tasks.list` / `tasks.watch` grant,仍由目标平台决定。
16
+
5
17
  ## 0.2.0
6
18
 
7
19
  ### 新增
package/README.md CHANGED
@@ -40,6 +40,11 @@ npm run widget:pack -- --out artifacts/my-widget.zip
40
40
  `widget:pack` 生成 Widget ZIP;`pnpm pack` 是制作 npm `.tgz` 的内置命令。
41
41
  `check` 检查声明和样例,不执行界面;实际运行验收见[交付指南](https://dev.dp.tech/bohrium-widget-sdk/guides/delivery-checklist)。
42
42
 
43
+ 需要列出当前会话计算任务的 Panel,在作者 Manifest 声明
44
+ `capabilities.tasks: { list: true }`;还要持续观察单个任务时可同时声明
45
+ `{ list: true, watch: true }`。Widget 只能在 Host 签发对应 grant 后调用能力,列表刷新频率须遵守
46
+ `tasks.list` grant 的 `minPollMs`。
47
+
43
48
  ## 开发预览
44
49
 
45
50
  在工程目录监听修改并重新构建:
@@ -112,12 +112,13 @@
112
112
  }
113
113
  },
114
114
  "TasksCapabilityRequest": {
115
- "description": "任务观察能力的申请;watch 固定为 true。",
115
+ "description": "任务发现与观察能力的申请;list / watch 至少显式申请一项,已申请项固定为 true。",
116
116
  "title": "TasksCapabilityRequest",
117
117
  "type": "object",
118
118
  "additionalProperties": false,
119
- "required": ["watch"],
119
+ "minProperties": 1,
120
120
  "properties": {
121
+ "list": { "const": true },
121
122
  "watch": { "const": true }
122
123
  }
123
124
  },
@@ -81,6 +81,15 @@
81
81
  "taskObservationBatch": {
82
82
  "$ref": "#/$defs/TaskObservationBatch"
83
83
  },
84
+ "taskListField": {
85
+ "$ref": "#/$defs/TaskListField"
86
+ },
87
+ "taskListItem": {
88
+ "$ref": "#/$defs/TaskListItem"
89
+ },
90
+ "taskListPage": {
91
+ "$ref": "#/$defs/TaskListPage"
92
+ },
84
93
  "toolResultEnvelope": {
85
94
  "$ref": "#/$defs/ToolResultEnvelope"
86
95
  },
@@ -393,6 +402,11 @@
393
402
  }
394
403
  }
395
404
  },
405
+ "TaskStatus": {
406
+ "description": "Host 投影给 Widget 的统一任务状态。",
407
+ "title": "TaskStatus",
408
+ "enum": ["queued", "running", "succeeded", "failed", "cancelled", "expired"]
409
+ },
396
410
  "TaskObservationSnapshot": {
397
411
  "description": "任务观察的当前快照:taskId、status 与 updatedAt;progress、message 可选。",
398
412
  "title": "TaskObservationSnapshot",
@@ -405,9 +419,7 @@
405
419
  "minLength": 1,
406
420
  "maxLength": 256
407
421
  },
408
- "status": {
409
- "enum": ["queued", "running", "succeeded", "failed", "cancelled", "expired"]
410
- },
422
+ "status": { "$ref": "#/$defs/TaskStatus" },
411
423
  "progress": {
412
424
  "type": "number",
413
425
  "minimum": 0,
@@ -475,6 +487,105 @@
475
487
  }
476
488
  }
477
489
  },
490
+ "TaskListField": {
491
+ "description": "任务列表中的受限展示字段;key 是稳定机器键,value 是 Host 裁剪后的展示文本。",
492
+ "title": "TaskListField",
493
+ "type": "object",
494
+ "additionalProperties": false,
495
+ "required": ["key", "value"],
496
+ "properties": {
497
+ "key": {
498
+ "description": "展示字段的稳定机器键,例如 machine 或 command。",
499
+ "type": "string",
500
+ "minLength": 1,
501
+ "maxLength": 64,
502
+ "pattern": "^[A-Za-z][A-Za-z0-9_.:-]*$"
503
+ },
504
+ "value": {
505
+ "description": "Host 完成授权与裁剪后的展示文本。",
506
+ "type": "string",
507
+ "maxLength": 16384
508
+ }
509
+ }
510
+ },
511
+ "TaskListItem": {
512
+ "description": "Host 已授权发现的任务摘要;taskId 是可继续传给 tasks.watch 的不透明引用。",
513
+ "title": "TaskListItem",
514
+ "type": "object",
515
+ "additionalProperties": false,
516
+ "required": ["taskId", "kind", "name", "status", "updatedAt", "fields"],
517
+ "properties": {
518
+ "taskId": {
519
+ "description": "可继续传给 tasks.watch 的 Host 不透明任务引用。",
520
+ "type": "string",
521
+ "minLength": 1,
522
+ "maxLength": 256
523
+ },
524
+ "kind": {
525
+ "description": "任务来源类型的稳定机器键。",
526
+ "type": "string",
527
+ "minLength": 1,
528
+ "maxLength": 64,
529
+ "pattern": "^[A-Za-z][A-Za-z0-9_.:-]*$"
530
+ },
531
+ "name": {
532
+ "description": "任务的安全展示名称。",
533
+ "type": "string",
534
+ "minLength": 1,
535
+ "maxLength": 256
536
+ },
537
+ "status": {
538
+ "$ref": "#/$defs/TaskStatus"
539
+ },
540
+ "progress": {
541
+ "description": "可选执行进度,取值范围为 0 到 1。",
542
+ "type": "number",
543
+ "minimum": 0,
544
+ "maximum": 1
545
+ },
546
+ "message": {
547
+ "description": "Host 裁剪后的可选状态说明。",
548
+ "type": "string",
549
+ "maxLength": 1024
550
+ },
551
+ "updatedAt": {
552
+ "description": "任务摘要最后更新时间,使用 UTC ISO 8601 字符串。",
553
+ "type": "string",
554
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T[^ ]+Z$"
555
+ },
556
+ "fields": {
557
+ "description": "任务面板可展示的受限附加字段。",
558
+ "type": "array",
559
+ "maxItems": 32,
560
+ "items": { "$ref": "#/$defs/TaskListField" }
561
+ }
562
+ }
563
+ },
564
+ "TaskListPage": {
565
+ "description": "Host 已授权任务摘要的一页结果;nextCursor 缺失表示当前页已到末尾。",
566
+ "title": "TaskListPage",
567
+ "type": "object",
568
+ "additionalProperties": false,
569
+ "required": ["schemaVersion", "tasks"],
570
+ "properties": {
571
+ "schemaVersion": {
572
+ "description": "任务列表页结构版本,当前固定为 1。",
573
+ "const": 1
574
+ },
575
+ "tasks": {
576
+ "description": "当前页中 Host 已授权的任务摘要。",
577
+ "type": "array",
578
+ "maxItems": 100,
579
+ "items": { "$ref": "#/$defs/TaskListItem" }
580
+ },
581
+ "nextCursor": {
582
+ "description": "下一页的不透明游标;缺失表示当前列表已到末尾。",
583
+ "type": "string",
584
+ "minLength": 1,
585
+ "maxLength": 512
586
+ }
587
+ }
588
+ },
478
589
  "ToolResultMetric": {
479
590
  "description": "工具结果中的单个指标。",
480
591
  "title": "ToolResultMetric",
@@ -796,6 +907,24 @@
796
907
  }
797
908
  }
798
909
  },
910
+ {
911
+ "type": "object",
912
+ "additionalProperties": false,
913
+ "required": ["name", "limits"],
914
+ "properties": {
915
+ "name": { "const": "tasks.list" },
916
+ "limits": {
917
+ "type": "object",
918
+ "additionalProperties": false,
919
+ "required": ["callsPerMinute", "pageSize", "minPollMs"],
920
+ "properties": {
921
+ "callsPerMinute": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
922
+ "pageSize": { "type": "integer", "minimum": 1, "maximum": 100 },
923
+ "minPollMs": { "type": "integer", "minimum": 1000, "maximum": 60000 }
924
+ }
925
+ }
926
+ }
927
+ },
799
928
  {
800
929
  "type": "object",
801
930
  "additionalProperties": false,
@@ -1232,6 +1361,22 @@
1232
1361
  }
1233
1362
  }
1234
1363
  },
1364
+ {
1365
+ "type": "object",
1366
+ "additionalProperties": false,
1367
+ "required": ["operation", "input"],
1368
+ "properties": {
1369
+ "operation": { "const": "tasks.list" },
1370
+ "input": {
1371
+ "type": "object",
1372
+ "additionalProperties": false,
1373
+ "properties": {
1374
+ "cursor": { "type": "string", "minLength": 1, "maxLength": 512 },
1375
+ "limit": { "type": "integer", "minimum": 1, "maximum": 100 }
1376
+ }
1377
+ }
1378
+ }
1379
+ },
1235
1380
  {
1236
1381
  "type": "object",
1237
1382
  "additionalProperties": false,
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "formatVersion": 2,
3
3
  "packageName": "@dp-bohrium/widget-cli",
4
- "cli": "0.2.0",
4
+ "cli": "0.3.0",
5
5
  "profile": {
6
- "id": "widget-sdk-0.4.1-contracts-0.4.1",
7
- "sdk": "0.4.1",
8
- "contracts": "0.4.1"
6
+ "id": "widget-sdk-0.5.0-contracts-0.5.0",
7
+ "sdk": "0.5.0",
8
+ "contracts": "0.5.0"
9
9
  },
10
10
  "hostAcceptance": "unknown",
11
11
  "documentation": {
@@ -16,9 +16,9 @@
16
16
  "llms": "https://dev.dp.tech/bohrium-widget-sdk/llms.txt"
17
17
  },
18
18
  "digests": {
19
- "compiler": "sha256:6ec63498b23bc9a04bcedf0d3ac8a2ffaf71fcbacffe1cc1c96b219d05860547",
20
- "validators": "sha256:45a2edd5818fa0841cc00a1bfe7aa83ad08205db8176ffa7af31c3d91bade214",
21
- "schemas": "sha256:16cae8e2cefb9456883359f2d72d4c833fa6dbd4d70a311e9861e94d52362d45",
19
+ "compiler": "sha256:e5944e59c8070a239b803945a5c15abb0398736a0f1622c1543242acf7d4c533",
20
+ "validators": "sha256:e3e411c6ea3c09f07554222141ccb92124cdf8921ab39dbaeb8f79f4ad8d12aa",
21
+ "schemas": "sha256:2286156c619d6482471966fb97a2a4adbb9c86ef9ec17225eb1b070d8489dd9c",
22
22
  "templates": "sha256:c495eb5a7faf3123acf871ddd54fa745e17efd5f45c7c037908475610ff13c77"
23
23
  }
24
24
  }
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as normalizeArchivePath, c as resolveWidgetProjects, i as collectWidgetPackageFiles, l as compileAuthorManifest, n as scaffoldDshWidget, o as storedZip, s as checkWidgetProject, t as auditDshPlugin } from "./dsh-BzxDpEcZ.mjs";
2
+ import { a as normalizeArchivePath, c as resolveWidgetProjects, i as collectWidgetPackageFiles, l as compileAuthorManifest, n as scaffoldDshWidget, o as storedZip, s as checkWidgetProject, t as auditDshPlugin } from "./dsh-DbOeoKFJ.mjs";
3
3
  import { createHash, randomBytes, timingSafeEqual } from "node:crypto";
4
4
  import { existsSync, lstatSync, readFileSync, readdirSync, realpathSync, statSync, watch } from "node:fs";
5
5
  import { mkdir, readFile, readdir, realpath, rm, stat, writeFile } from "node:fs/promises";
package/dist/core.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { c as resolveWidgetProjects, l as compileAuthorManifest, n as scaffoldDshWidget, r as buildWidgetPackage, s as checkWidgetProject, t as auditDshPlugin } from "./dsh-BzxDpEcZ.mjs";
1
+ import { c as resolveWidgetProjects, l as compileAuthorManifest, n as scaffoldDshWidget, r as buildWidgetPackage, s as checkWidgetProject, t as auditDshPlugin } from "./dsh-DbOeoKFJ.mjs";
2
2
  //#region src/core.mjs
3
3
  /** Validate a community template before registering it in a custom CLI. */
4
4
  function defineWidgetTemplate(template) {
@@ -95,9 +95,9 @@ function collectReferencedFileIds(request) {
95
95
  return referenced;
96
96
  }
97
97
  //#endregion
98
- //#region ../widget-sdk/dist/runtime-RyAEhkyn.js
98
+ //#region ../widget-sdk/dist/runtime-DVFTv55x.js
99
99
  /** 从当前安装的 SDK package.json 读取版本,插件作者不需要重复填写。 */
100
- const WIDGET_SDK_VERSION = "0.4.1";
100
+ const WIDGET_SDK_VERSION = "0.5.0";
101
101
  //#endregion
102
102
  //#region ../widget-sdk/dist/index.js
103
103
  function compiledContribution(contribution) {
@@ -6824,7 +6824,7 @@ var require_json_schema_2020_12 = /* @__PURE__ */ __commonJSMin(((exports) => {
6824
6824
  exports.default = addMetaSchema2020;
6825
6825
  }));
6826
6826
  //#endregion
6827
- //#region ../contract-testing/dist/manifest-validator-DCdGSuVM.js
6827
+ //#region ../contract-testing/dist/manifest-validator-DUzSsw8D.js
6828
6828
  var import__2020 = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
6829
6829
  Object.defineProperty(exports, "__esModule", { value: true });
6830
6830
  exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv2020 = void 0;
@@ -7036,12 +7036,15 @@ const widgetManifestSchema = {
7036
7036
  } }
7037
7037
  },
7038
7038
  "TasksCapabilityRequest": {
7039
- "description": "任务观察能力的申请;watch 固定为 true。",
7039
+ "description": "任务发现与观察能力的申请;list / watch 至少显式申请一项,已申请项固定为 true。",
7040
7040
  "title": "TasksCapabilityRequest",
7041
7041
  "type": "object",
7042
7042
  "additionalProperties": false,
7043
- "required": ["watch"],
7044
- "properties": { "watch": { "const": true } }
7043
+ "minProperties": 1,
7044
+ "properties": {
7045
+ "list": { "const": true },
7046
+ "watch": { "const": true }
7047
+ }
7045
7048
  },
7046
7049
  "StateCapabilityRequest": {
7047
7050
  "description": "受限 UI 状态读写能力的申请;read / write 分别声明。",
@@ -7471,6 +7474,9 @@ const widgetRuntimeContractsSchema = {
7471
7474
  "taskObservationSnapshot": { "$ref": "#/$defs/TaskObservationSnapshot" },
7472
7475
  "taskObservationEvent": { "$ref": "#/$defs/TaskObservationEvent" },
7473
7476
  "taskObservationBatch": { "$ref": "#/$defs/TaskObservationBatch" },
7477
+ "taskListField": { "$ref": "#/$defs/TaskListField" },
7478
+ "taskListItem": { "$ref": "#/$defs/TaskListItem" },
7479
+ "taskListPage": { "$ref": "#/$defs/TaskListPage" },
7474
7480
  "toolResultEnvelope": { "$ref": "#/$defs/ToolResultEnvelope" },
7475
7481
  "uiStateResult": { "$ref": "#/$defs/UiStateResult" },
7476
7482
  "uiStateWriteResult": { "$ref": "#/$defs/UiStateWriteResult" },
@@ -7861,6 +7867,18 @@ const widgetRuntimeContractsSchema = {
7861
7867
  "cancelled"
7862
7868
  ] } }
7863
7869
  },
7870
+ "TaskStatus": {
7871
+ "description": "Host 投影给 Widget 的统一任务状态。",
7872
+ "title": "TaskStatus",
7873
+ "enum": [
7874
+ "queued",
7875
+ "running",
7876
+ "succeeded",
7877
+ "failed",
7878
+ "cancelled",
7879
+ "expired"
7880
+ ]
7881
+ },
7864
7882
  "TaskObservationSnapshot": {
7865
7883
  "description": "任务观察的当前快照:taskId、status 与 updatedAt;progress、message 可选。",
7866
7884
  "title": "TaskObservationSnapshot",
@@ -7877,14 +7895,7 @@ const widgetRuntimeContractsSchema = {
7877
7895
  "minLength": 1,
7878
7896
  "maxLength": 256
7879
7897
  },
7880
- "status": { "enum": [
7881
- "queued",
7882
- "running",
7883
- "succeeded",
7884
- "failed",
7885
- "cancelled",
7886
- "expired"
7887
- ] },
7898
+ "status": { "$ref": "#/$defs/TaskStatus" },
7888
7899
  "progress": {
7889
7900
  "type": "number",
7890
7901
  "minimum": 0,
@@ -7968,6 +7979,110 @@ const widgetRuntimeContractsSchema = {
7968
7979
  }
7969
7980
  }
7970
7981
  },
7982
+ "TaskListField": {
7983
+ "description": "任务列表中的受限展示字段;key 是稳定机器键,value 是 Host 裁剪后的展示文本。",
7984
+ "title": "TaskListField",
7985
+ "type": "object",
7986
+ "additionalProperties": false,
7987
+ "required": ["key", "value"],
7988
+ "properties": {
7989
+ "key": {
7990
+ "description": "展示字段的稳定机器键,例如 machine 或 command。",
7991
+ "type": "string",
7992
+ "minLength": 1,
7993
+ "maxLength": 64,
7994
+ "pattern": "^[A-Za-z][A-Za-z0-9_.:-]*$"
7995
+ },
7996
+ "value": {
7997
+ "description": "Host 完成授权与裁剪后的展示文本。",
7998
+ "type": "string",
7999
+ "maxLength": 16384
8000
+ }
8001
+ }
8002
+ },
8003
+ "TaskListItem": {
8004
+ "description": "Host 已授权发现的任务摘要;taskId 是可继续传给 tasks.watch 的不透明引用。",
8005
+ "title": "TaskListItem",
8006
+ "type": "object",
8007
+ "additionalProperties": false,
8008
+ "required": [
8009
+ "taskId",
8010
+ "kind",
8011
+ "name",
8012
+ "status",
8013
+ "updatedAt",
8014
+ "fields"
8015
+ ],
8016
+ "properties": {
8017
+ "taskId": {
8018
+ "description": "可继续传给 tasks.watch 的 Host 不透明任务引用。",
8019
+ "type": "string",
8020
+ "minLength": 1,
8021
+ "maxLength": 256
8022
+ },
8023
+ "kind": {
8024
+ "description": "任务来源类型的稳定机器键。",
8025
+ "type": "string",
8026
+ "minLength": 1,
8027
+ "maxLength": 64,
8028
+ "pattern": "^[A-Za-z][A-Za-z0-9_.:-]*$"
8029
+ },
8030
+ "name": {
8031
+ "description": "任务的安全展示名称。",
8032
+ "type": "string",
8033
+ "minLength": 1,
8034
+ "maxLength": 256
8035
+ },
8036
+ "status": { "$ref": "#/$defs/TaskStatus" },
8037
+ "progress": {
8038
+ "description": "可选执行进度,取值范围为 0 到 1。",
8039
+ "type": "number",
8040
+ "minimum": 0,
8041
+ "maximum": 1
8042
+ },
8043
+ "message": {
8044
+ "description": "Host 裁剪后的可选状态说明。",
8045
+ "type": "string",
8046
+ "maxLength": 1024
8047
+ },
8048
+ "updatedAt": {
8049
+ "description": "任务摘要最后更新时间,使用 UTC ISO 8601 字符串。",
8050
+ "type": "string",
8051
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T[^ ]+Z$"
8052
+ },
8053
+ "fields": {
8054
+ "description": "任务面板可展示的受限附加字段。",
8055
+ "type": "array",
8056
+ "maxItems": 32,
8057
+ "items": { "$ref": "#/$defs/TaskListField" }
8058
+ }
8059
+ }
8060
+ },
8061
+ "TaskListPage": {
8062
+ "description": "Host 已授权任务摘要的一页结果;nextCursor 缺失表示当前页已到末尾。",
8063
+ "title": "TaskListPage",
8064
+ "type": "object",
8065
+ "additionalProperties": false,
8066
+ "required": ["schemaVersion", "tasks"],
8067
+ "properties": {
8068
+ "schemaVersion": {
8069
+ "description": "任务列表页结构版本,当前固定为 1。",
8070
+ "const": 1
8071
+ },
8072
+ "tasks": {
8073
+ "description": "当前页中 Host 已授权的任务摘要。",
8074
+ "type": "array",
8075
+ "maxItems": 100,
8076
+ "items": { "$ref": "#/$defs/TaskListItem" }
8077
+ },
8078
+ "nextCursor": {
8079
+ "description": "下一页的不透明游标;缺失表示当前列表已到末尾。",
8080
+ "type": "string",
8081
+ "minLength": 1,
8082
+ "maxLength": 512
8083
+ }
8084
+ }
8085
+ },
7971
8086
  "ToolResultMetric": {
7972
8087
  "description": "工具结果中的单个指标。",
7973
8088
  "title": "ToolResultMetric",
@@ -8346,6 +8461,40 @@ const widgetRuntimeContractsSchema = {
8346
8461
  }
8347
8462
  }
8348
8463
  },
8464
+ {
8465
+ "type": "object",
8466
+ "additionalProperties": false,
8467
+ "required": ["name", "limits"],
8468
+ "properties": {
8469
+ "name": { "const": "tasks.list" },
8470
+ "limits": {
8471
+ "type": "object",
8472
+ "additionalProperties": false,
8473
+ "required": [
8474
+ "callsPerMinute",
8475
+ "pageSize",
8476
+ "minPollMs"
8477
+ ],
8478
+ "properties": {
8479
+ "callsPerMinute": {
8480
+ "type": "integer",
8481
+ "minimum": 1,
8482
+ "maximum": 9007199254740991
8483
+ },
8484
+ "pageSize": {
8485
+ "type": "integer",
8486
+ "minimum": 1,
8487
+ "maximum": 100
8488
+ },
8489
+ "minPollMs": {
8490
+ "type": "integer",
8491
+ "minimum": 1e3,
8492
+ "maximum": 6e4
8493
+ }
8494
+ }
8495
+ }
8496
+ }
8497
+ },
8349
8498
  {
8350
8499
  "type": "object",
8351
8500
  "additionalProperties": false,
@@ -8831,6 +8980,30 @@ const widgetRuntimeContractsSchema = {
8831
8980
  }
8832
8981
  }
8833
8982
  },
8983
+ {
8984
+ "type": "object",
8985
+ "additionalProperties": false,
8986
+ "required": ["operation", "input"],
8987
+ "properties": {
8988
+ "operation": { "const": "tasks.list" },
8989
+ "input": {
8990
+ "type": "object",
8991
+ "additionalProperties": false,
8992
+ "properties": {
8993
+ "cursor": {
8994
+ "type": "string",
8995
+ "minLength": 1,
8996
+ "maxLength": 512
8997
+ },
8998
+ "limit": {
8999
+ "type": "integer",
9000
+ "minimum": 1,
9001
+ "maximum": 100
9002
+ }
9003
+ }
9004
+ }
9005
+ }
9006
+ },
8834
9007
  {
8835
9008
  "type": "object",
8836
9009
  "additionalProperties": false,
package/llms.txt CHANGED
@@ -39,7 +39,10 @@ pnpm exec bohr-widget --version --json
39
39
  - `create`: 创建 vanilla 或 React 工程并写 `widget-toolchain.json`;工作区文件面板使用
40
40
  `--panel-id workspace-files`。
41
41
  - `adopt`: 为旧工程显式写入工具链锁,先核对精确依赖、实际 SDK/contracts、Manifest 和 samples。
42
- - SDK 0.4.0 文件读写按需在 Manifest 声明 `capabilities.files.read/write`,再实现
42
+ - SDK 0.5.0 的任务 Panel 在 Manifest 声明 `capabilities.tasks.list`;需要观察单个任务时再声明
43
+ `tasks.watch`。列表刷新遵守 grant 的 `minPollMs`,面板不可见后停止轮询;CLI 校验通过不代表
44
+ 目标 Host 已签发 grant,详见 AGENTS.md。
45
+ - SDK 0.5.0 文件读写按需在 Manifest 声明 `capabilities.files.read/write`,再实现
43
46
  `context.files.read/write`;创建命令和模板保持原样。保存使用读取回执的内容版本与 mutationId,
44
47
  缺授权、版本或完整性证据时只读;冲突/未知结果保留草稿且不自动重试,详见 AGENTS.md。
45
48
  - `check` / `validate`: 校验作者清单、Manifest、entry、samples 和 fixtures;`check all` 以
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dp-bohrium/widget-cli",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Bohrium Widget 插件工程的创建、校验、开发和打包工具。",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -52,8 +52,8 @@
52
52
  "tsdown": "0.22.14",
53
53
  "typescript": "5.9.3",
54
54
  "@dp-bohrium/widget-contract-testing": "0.1.0-alpha.0",
55
- "@dp-bohrium/widget-sdk": "0.4.1",
56
- "@dp-bohrium/widget-contracts": "0.4.1"
55
+ "@dp-bohrium/widget-contracts": "0.5.0",
56
+ "@dp-bohrium/widget-sdk": "0.5.0"
57
57
  },
58
58
  "sideEffects": false,
59
59
  "scripts": {