@guandata/decidex 0.3.0 → 0.4.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/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # Decidex CLI
2
2
 
3
- 基于 Decidex **0.0.6** HTTP API 的零依赖 Node.js CLI(CLI 版本 0.3.0)。要求 Node.js 22+。
3
+ 基于 Decidex **0.0.7** HTTP API 的零依赖 Node.js CLI(CLI 版本 0.4.0)。要求 Node.js 22+。
4
4
 
5
- 适配基线:[tag 0.0.6 / 73901fa03](https://gitlab.mayidata.com/zijie0/decidex/-/tree/0.0.6),2026-11-06。按实际部署的 release 契约执行,保留 0.0.5 调度兼容。
5
+ 适配基线:[tag 0.0.7 / cfdf08dba](https://gitlab.mayidata.com/zijie0/decidex/-/tree/0.0.7),2026-11-11。按实际部署的 release 契约执行,保留 0.0.5 调度兼容。
6
6
 
7
7
  ```bash
8
- npm install -g @guandata/decidex@0.3.0
8
+ npm install -g @guandata/decidex@0.4.0
9
9
  decidex version --json # 本地 CLI 版本
10
10
  decidex server version # 目标服务端版本与 commit
11
11
  decidex server check auth whoami
@@ -34,7 +34,7 @@ decidex auth whoami # 服务端 >= 0.0.5,返回已验证的
34
34
 
35
35
  版本来自已登录目标的 `GET /api/app-version`,每次 CLI 进程重新读取,不持久缓存。`version` 查询即使遇到 `dev` 等版本也会显示原值和 `comparable=false`;需要版本决策的命令遇到无法比较的版本、认证失败或版本查询失败会明确报错,不猜测版本或在写入失败后重试另一种协议。
36
36
 
37
- `server check` 对没有版本规则的命令返回 `supported=null`、`reason=no_version_rule`,表示尚未声明版本边界,不能据此断言目标支持。`0.0.6` 是本次适配基线,不是所有命令的首次发布版本。SemVer 比较支持 `v` 前缀、预发布和构建信息;例如 `0.0.8-rc.1` 低于正式 `0.0.8`。
37
+ `server check` 对没有版本规则的命令返回 `supported=null`、`reason=no_version_rule`,表示尚未声明版本边界,不能据此断言目标支持。`0.0.7` 是本次适配基线,不是所有命令的首次发布版本。SemVer 比较支持 `v` 前缀、预发布和构建信息;例如 `0.0.8-rc.1` 低于正式 `0.0.8`。
38
38
 
39
39
  已核实的版本差异:
40
40
 
@@ -98,6 +98,8 @@ decidex agent delete AGENT_ID
98
98
 
99
99
  每个 Agent 最多绑定一个业务本体;`versionId` 可以使用固定版本 ID 或 `latest`。`contextReferences` 的 BI 资产需要保留来源环境(`guandataEnvRef` 或有效的 `guandataBaseUrl`);也可按服务端契约传钉钉/飞书文档引用。`builtInInstructions` 仅支持更新已有 Agent。
100
100
 
101
+ 服务端 >= 0.0.7 可配置 `biUserPropertiesEnabled`(创建默认 `false`)和 `biUserPropertyKeys`(默认 `[]`)。Key 最多 20 项,每项去空白后 1..200 字符,去重保序;可选 Key 通过 `decidex platform call personal-agents.bi-user-property-options.list --agent-id AGENT_ID` 查询,实际可用性取决于维护者的 BI 身份和属性目录。旧服务端使用这些字段会在写入前被 CLI 拒绝。
102
+
101
103
  上传参考文件和执行冒烟问题:
102
104
 
103
105
  ```bash
@@ -144,6 +146,7 @@ decidex agent knowledge remove AGENT_ID DOCUMENT_ID
144
146
 
145
147
  ```bash
146
148
  decidex session list --status running
149
+ decidex session list --pinned-session-id SESSION_ID --pinned-agent-id AGENT_ID
147
150
  decidex session view SESSION_ID
148
151
  decidex session send SESSION_ID --message "继续拆解渠道" --wait --follow
149
152
  decidex session stop SESSION_ID
@@ -158,6 +161,8 @@ decidex session files download SESSION_ID --scope analysis --suffix .boe --all -
158
161
  decidex run diagnose RUN_ID --session-id SESSION_ID --json
159
162
  ```
160
163
 
164
+ `session list` 的两个 `--pinned-*-id` 参数可重复,要求服务端 >= 0.0.7;只用于历史列表保留指定条目,不修改平台的置顶状态。
165
+
161
166
  `session rename` 的标题不能为空,最多 24 个字符。
162
167
 
163
168
  会话列表按页返回;`--cursor` 接收 `nextCursor` 原值,`--agent-id` 查询指定 Agent 的历史页。`--status` 只过滤当前页,`completed` 表示非 RUNNING(含 ERROR),空页仍可能有下一页。`--query` 不可与 `--cursor` / `--agent-id` 同用。`session view --before OLDER_CURSOR` 读取更早消息,`--since LIVE_CURSOR` 读取增量;两者互斥。
@@ -306,7 +311,7 @@ decidex automation runs AUTOMATION_ID --cursor NEXT_CURSOR
306
311
  decidex automation delete AUTOMATION_ID
307
312
  ```
308
313
 
309
- 文件包含 `id` 时用 PATCH 更新;可只传 `{ "id": "...", "status": "PAUSED" }` 暂停,改为 `ACTIVE` 恢复。暂停状态不能手动运行;单次调度完成后由服务端写入 `FINISHED`,不能手动设置、恢复或再次运行。
314
+ 文件包含 `id` 时用 PATCH 更新;服务端 >= 0.0.7 可只传 `{ "id": "...", "status": "PAUSED" }` 暂停,改为 `ACTIVE` 恢复。目标 0.0.5/0.0.6 更新时必须附上原 `schedule`,CLI 会阻止省略计划的写入,避免服务端应用默认计划。暂停状态不能手动运行;单次调度完成后由服务端写入 `FINISHED`,不能手动设置、恢复或再次运行。
310
315
 
311
316
  服务端 >= 0.0.6 支持以下调度:
312
317
 
@@ -322,6 +327,8 @@ decidex automation delete AUTOMATION_ID
322
327
 
323
328
  CLI 根据目标版本选择协议:0.0.6 的旧 `weekday` 转为 `weekdays`,旧 `HOURLY` 转为 `INTERVAL(60)`;目标 0.0.5 保留原协议,单元素 `weekdays` 可转换为 `weekday`,多元素及新调度模式在写入前拒绝。`server check automation apply` 查看所选协议。
324
329
 
330
+ 服务端 >= 0.0.7 可在 `imPush.channels[]`、`emailPush` 内设置 `biGroupIds`;用 `decidex platform call personal-agent-automations.bi-groups.list` 读取目录。IM 用户组目标仍需指定 `channel` 和 `botId`,邮件即使仅选组也需传 `recipientUserIds: []`。组成员在每次执行时按当时目录解析,保存成功不代表实际送达。
331
+
325
332
  文件还可按服务端契约配置 `imPush`、`emailPush`;更新时省略保留原配置,`null` 清空。手动 `run --wait` 等待分析 Run,不代表通知已送达;送达结果查看 `automation runs`。服务端 0.0.5 的启动接口会同步等待执行结果,`--wait --timeout` 覆盖该请求及后续读取的总时间。客户端超时不会取消服务端执行;应先查 `automation runs`,不要直接重试触发。
326
333
 
327
334
  ## 任务中心
@@ -351,7 +358,17 @@ decidex action-task complete TASK_ID --version 1
351
358
  }
352
359
  ```
353
360
 
354
- `--run-id` 从当前会话窗口查找回答;较早的回答用 `session view --before CURSOR` 找到消息后传 `--message-id`。采纳后可完成或取消,待处理时可拒绝。`reject`、`cancel` 必须传 `--note 理由`。每次操作使用 `get` 返回的当前 `task.version`;409 表示任务已变化,应重新确认,不自动重试。平台没有行动任务删除接口。
361
+ `--run-id` 从当前会话窗口查找回答;较早的回答用 `session view --before CURSOR` 找到消息后传 `--message-id`。采纳后可完成或取消,待处理时可拒绝;服务端 >= 0.0.7 也允许直接完成待处理任务,`complete --note` 可附完成说明。`reject`、`cancel` 必须传 `--note 理由`。每次操作使用 `get` 返回的当前 `task.version`;409 表示任务已变化,应重新确认,不自动重试。平台没有行动任务删除接口。
362
+
363
+ 服务端 >= 0.0.7 可读取分发选项、显式分发任务和下载事件证据附件:
364
+
365
+ ```bash
366
+ decidex action-task dispatch-info TASK_ID
367
+ decidex action-task dispatch TASK_ID dispatch.json
368
+ decidex action-task attachment TASK_ID EVENT_ID 0 evidence.bin
369
+ ```
370
+
371
+ 分发文件包含 `botId`、`recipientIds`、`idempotencyKey`,可选 `createNativeTask`(默认 `true`;只推消息时设为 `false`);所选渠道要求的授权信息以 `dispatch-info` 返回为准。分发会发送真实通知,同一次分发应保留同一幂等键,响应不确定时先查分发状态,不自动重发。附件的 `EVENT_ID` 来自 `get` 返回的事件,序号从 0 开始;只有已有渠道证据才能下载,材料失效或上游不可用会保留服务端错误。
355
372
 
356
373
  ### 指标追踪
357
374
 
@@ -392,7 +409,7 @@ decidex platform coverage
392
409
 
393
410
  版本边界来自 release tag 中的路由存在性,**不等于该版本所有业务字段均兼容**;字段与权限仍以服务端契约为准。仅在 main 存在的操作默认拒绝,确认目标已部署后才能显式 `--allow-unreleased`,不猜测未来版本号。`inputHints` 是路由文件线索,不是完整请求 schema。
394
411
 
395
- 当前目录覆盖 444/444 个纳入范围的操作,全部存在于 0.0.6 tag。全部 549 个路由操作中另有 105 个运行时、服务令牌、公开分享、回调、流式或代理协议,未纳入浏览器登录态 CLI;按全部路由计为 80.9%。这表示操作入口覆盖,不是逐接口业务验证或真实冒烟覆盖。详见 [覆盖审计](docs/api-coverage.md)。
412
+ 当前目录覆盖 461/461 个纳入范围的操作,全部存在于 0.0.7 tag。全部 569 个路由操作中另有 108 个运行时、服务令牌、公开分享、回调、流式或代理协议,未纳入浏览器登录态 CLI;按全部路由计为 81.0%。这表示操作入口覆盖,不是逐接口业务验证或真实冒烟覆盖。详见 [覆盖审计](docs/api-coverage.md)。
396
413
 
397
414
  ## 组织
398
415
 
@@ -447,7 +464,7 @@ CI 中可使用 `DECIDEX_BASE_URL` 和 `DECIDEX_SESSION`,无需写本地配置
447
464
  npm test
448
465
  npm pack --dry-run
449
466
  # 更新 API 目录:必须指定已核对的源码 commit 和适配 tag
450
- python3 scripts/sync-api-catalog.py --repo /path/to/decidex --ref COMMIT --baseline 0.0.6
467
+ python3 scripts/sync-api-catalog.py --repo /path/to/decidex --ref COMMIT --baseline 0.0.7
451
468
  npm install -g . # 更新本机 decidex;不发布到 npm
452
469
  ```
453
470
 
@@ -475,3 +492,7 @@ npm install -g . # 更新本机 decidex;不发布到 npm
475
492
  ## 2026-11-06 / 服务端 0.0.6 适配
476
493
 
477
494
  适配 tag `0.0.6 / 73901fa03`,CLI 0.3.0 在此补充 0.0.6 适配。新增多星期、月度、固定间隔和单次调度,保留 0.0.5 legacy 协议并拒绝不兼容写入;操作目录更新为已发布的 444 项,新增 BI 用户同步入口。机器人成员候选需传 `botId`,可用机器人支持 `purpose=push|channel`、`transport=STREAM|WEBHOOK`;使用授权支持成员或 BI 组。在线文档不支持下载或替换上传原件。权限与业务字段仍以目标服务端为准。
495
+
496
+ ## 2026-11-11 / 服务端 0.0.7 适配
497
+
498
+ CLI 0.4.0 适配 tag `0.0.7 / cfdf08dba`:新增 Agent BI 用户属性、历史会话保留参数、行动任务分发与证据附件下载,定时推送支持 BI 用户组。新增字段按 0.0.7 版本预检;旧版定时任务更新必须显式带计划,防止计划被重置。平台目录更新为 461 项,新增统一权限、渠道回调配置和推送管理入口,移除已废弃的渠道绑定成员接口;外部事件回调仍不作为普通管理 API。
@@ -1,18 +1,18 @@
1
1
  # API 覆盖审计
2
2
 
3
- 更新:2026-11-06;CLI:0.3.0;适配服务端:0.0.6。
3
+ 更新:2026-11-11;CLI:0.4.0;适配服务端:0.0.7。
4
4
 
5
- 源码依据与适配基线:[0.0.6 / 73901fa03](https://gitlab.mayidata.com/zijie0/decidex/-/tree/0.0.6),与生产 `server version` 返回的 commit 一致。逐一扫描 `src/app/api/**/route.ts` 的 HTTP 方法导出,以“方法 + 路径”计数,未把 `decidex api` 兜底算作覆盖。
5
+ 源码依据与适配基线:[0.0.7 / cfdf08dba](https://gitlab.mayidata.com/zijie0/decidex/-/tree/0.0.7),与生产 `server version` 返回的 commit 一致。逐一扫描 `src/app/api/**/route.ts` 的 HTTP 方法导出,以“方法 + 路径”计数,未把 `decidex api` 兜底算作覆盖。
6
6
 
7
7
  ## 覆盖口径
8
8
 
9
9
  | 范围 | 操作数 | CLI 入口 |
10
10
  | --- | ---: | --- |
11
- | 用户/管理员主动调用的 HTTP 操作 | 444 | 全部注册到 `platform list/show/call`,目录覆盖 100% |
12
- | 其中存在于 0.0.6 tag | 444 | 默认可调用,实际权限由服务端判断 |
11
+ | 用户/管理员主动调用的 HTTP 操作 | 461 | 全部注册到 `platform list/show/call`,目录覆盖 100% |
12
+ | 其中存在于 0.0.7 tag | 461 | 默认可调用,实际权限由服务端判断 |
13
13
  | 其中仅在 main | 0 | 本次目录仅取部署 release |
14
- | 运行时、分享、认证回调等协议 | 105 | 不纳入浏览器登录态 CLI |
15
- | 全部路由操作 | 549 | 按全部路由计算为 80.9% |
14
+ | 运行时、分享、认证回调等协议 | 108 | 不纳入浏览器登录态 CLI |
15
+ | 全部路由操作 | 569 | 按全部路由计算为 81.0% |
16
16
 
17
17
  **90% 目标在“用户/管理员主动操作”的入口范围内达到;若包含服务协议全部路由,仍未达到 90%。** 目录注册证明请求入口可发现、路径参数可校验、传输可执行,不证明每个接口字段已适配或业务功能经过冒烟。特殊协议不应通过替换认证头强行视为普通管理 API。
18
18
 
@@ -26,7 +26,7 @@
26
26
 
27
27
  - 上述扩展领域多数没有专用流程命令;请求字段仍需依据对应服务端 route/契约,`inputHints` 只提供线索。
28
28
  - 版本元数据只证明路由在哪个 tag 已存在,不保证相同路由的请求字段、语义或权限始终不变;字段协议变化仍需单独适配与测试。
29
- - 未支持内部运行时 24 项、服务令牌协议 61 项、外部消息回调/投递 5 项、认证回调/元数据 7 项、事件流 2 项、代理/预览 catch-all 3 项、公开分享 3 项。
29
+ - 未支持内部运行时 24 项、服务令牌协议 61 项、外部消息回调/投递 8 项、认证回调/元数据 7 项、事件流 2 项、代理/预览 catch-all 3 项、公开分享 3 项。
30
30
  - 当前上传/下载整包载入内存;外部消息实际送达、管理员写配置及每个接口的业务成功路径未全量验证。
31
31
 
32
32
  ## 0.0.6 版本差异
@@ -37,10 +37,17 @@
37
37
  - `organizations.current.bi-user-sync.users.list` 必须传 `--query-param q=关键词`,`offset` 默认 0;省略 q 的实际请求返回服务端 500,补齐参数后成功。CLI 保留原始错误,没有改写服务端错误码。
38
38
  - 在线知识文档不支持上传原件的下载/替换协议;该限制由目标服务端判断,普通上传文档传输保持可用。
39
39
 
40
+ ## 0.0.7 版本差异
41
+
42
+ - 新增 19 个管理操作,移除 2 个渠道绑定成员操作:权限集中到本体、Skill 和机器人权限接口;补入行动分发/附件、BI 属性/组目录、推送配置和渠道回调配置。
43
+ - Agent BI 属性、会话保留参数、定时推送 BI 组与行动分发/附件仅在 >= 0.0.7 使用;相同路由上的新增字段也先检查目标版本。
44
+ - 0.0.7 修复定时任务 PATCH 省略计划时重置默认计划的问题;CLI 对旧版本要求显式带原计划。
45
+ - 区分用户读取证据的 `/action-tasks/.../events/.../attachments/...` 与外部事件接收接口,保留飞书/企微回调配置管理,排除实际外部事件接收协议。
46
+
40
47
  ## 复核方法
41
48
 
42
49
  ```bash
43
- python3 scripts/sync-api-catalog.py --repo /path/to/decidex --ref COMMIT --baseline 0.0.6
50
+ python3 scripts/sync-api-catalog.py --repo /path/to/decidex --ref COMMIT --baseline 0.0.7
44
51
  decidex platform coverage
45
52
  decidex platform list --group knowledge-library
46
53
  decidex platform show knowledge-library.folders.documents.create
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guandata/decidex",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "CLI for building and operating Decidex ontologies, agents, skills, sessions, and evaluations.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "sourceCommit": "73901fa03b18d2cb00484ffa951bf99b19af4161",
4
- "baselineVersion": "0.0.6",
5
- "baselineCommit": "73901fa03b18d2cb00484ffa951bf99b19af4161",
3
+ "sourceCommit": "cfdf08dbab954510ea1ebb4dba6a50d6b2af8c82",
4
+ "baselineVersion": "0.0.7",
5
+ "baselineCommit": "cfdf08dbab954510ea1ebb4dba6a50d6b2af8c82",
6
6
  "coverage": {
7
- "allRouteOperations": 549,
8
- "eligibleOperations": 444,
9
- "catalogOperations": 444,
10
- "excludedOperations": 105,
7
+ "allRouteOperations": 569,
8
+ "eligibleOperations": 461,
9
+ "catalogOperations": 461,
10
+ "excludedOperations": 108,
11
11
  "catalogCoveragePercent": 100,
12
- "baselineOperations": 444,
12
+ "baselineOperations": 461,
13
13
  "groups": {
14
14
  "account": 4,
15
- "action-tasks": 3,
15
+ "action-tasks": 6,
16
16
  "agent-channels": 3,
17
17
  "agent-session-conversation-references": 1,
18
18
  "agent-session-turn-references": 1,
@@ -21,7 +21,7 @@
21
21
  "app-version": 1,
22
22
  "auth": 7,
23
23
  "bi-asset-citations": 1,
24
- "biz-ontology": 62,
24
+ "biz-ontology": 64,
25
25
  "decision-tracking-tasks": 10,
26
26
  "health": 1,
27
27
  "i18n": 1,
@@ -29,21 +29,21 @@
29
29
  "official-marketplace": 2,
30
30
  "organization-bi-environments": 7,
31
31
  "organization-bot-deliveries": 1,
32
- "organization-bots": 29,
32
+ "organization-bots": 37,
33
33
  "organization-email": 5,
34
34
  "organization-service-channels": 6,
35
35
  "organization-user-memories": 5,
36
36
  "organization-user-memory-suggestions": 2,
37
37
  "organizations": 9,
38
- "personal-agent-automations": 6,
38
+ "personal-agent-automations": 7,
39
39
  "personal-agents": 159,
40
- "platform": 36,
40
+ "platform": 38,
41
41
  "plugins": 8,
42
42
  "product-feedback": 4,
43
43
  "recommended-agents": 1,
44
44
  "shared-files": 6,
45
45
  "skillhub-sources": 3,
46
- "skills": 21
46
+ "skills": 22
47
47
  }
48
48
  },
49
49
  "operations": [
@@ -934,6 +934,36 @@
934
934
  ],
935
935
  "sourceFile": "src/app/api/action-tasks/[taskId]/route.ts"
936
936
  },
937
+ {
938
+ "id": "action-tasks.dispatch.list",
939
+ "method": "GET",
940
+ "path": "/api/action-tasks/[taskId]/dispatch",
941
+ "group": "action-tasks",
942
+ "parameters": [
943
+ "taskId"
944
+ ],
945
+ "minVersion": "0.0.7",
946
+ "inBaseline": true,
947
+ "inputHints": [
948
+ "json"
949
+ ],
950
+ "sourceFile": "src/app/api/action-tasks/[taskId]/dispatch/route.ts"
951
+ },
952
+ {
953
+ "id": "action-tasks.events.attachments.get",
954
+ "method": "GET",
955
+ "path": "/api/action-tasks/[taskId]/events/[eventId]/attachments/[index]",
956
+ "group": "action-tasks",
957
+ "parameters": [
958
+ "taskId",
959
+ "eventId",
960
+ "index"
961
+ ],
962
+ "minVersion": "0.0.7",
963
+ "inBaseline": true,
964
+ "inputHints": [],
965
+ "sourceFile": "src/app/api/action-tasks/[taskId]/events/[eventId]/attachments/[index]/route.ts"
966
+ },
937
967
  {
938
968
  "id": "agent-session-conversation-references.list",
939
969
  "method": "GET",
@@ -1334,6 +1364,21 @@
1334
1364
  ],
1335
1365
  "sourceFile": "src/app/api/biz-ontology/networks/[networkId]/object-types/[objectTypeId]/data-source-management/route.ts"
1336
1366
  },
1367
+ {
1368
+ "id": "biz-ontology.networks.permissions.list",
1369
+ "method": "GET",
1370
+ "path": "/api/biz-ontology/networks/[networkId]/permissions",
1371
+ "group": "biz-ontology",
1372
+ "parameters": [
1373
+ "networkId"
1374
+ ],
1375
+ "minVersion": "0.0.7",
1376
+ "inBaseline": true,
1377
+ "inputHints": [
1378
+ "json"
1379
+ ],
1380
+ "sourceFile": "src/app/api/biz-ontology/networks/[networkId]/permissions/route.ts"
1381
+ },
1337
1382
  {
1338
1383
  "id": "biz-ontology.networks.relation-types.list",
1339
1384
  "method": "GET",
@@ -1690,6 +1735,36 @@
1690
1735
  "inputHints": [],
1691
1736
  "sourceFile": "src/app/api/organization-bots/[botId]/deliveries/route.ts"
1692
1737
  },
1738
+ {
1739
+ "id": "organization-bots.dingtalk-task-config.list",
1740
+ "method": "GET",
1741
+ "path": "/api/organization-bots/[botId]/dingtalk-task-config",
1742
+ "group": "organization-bots",
1743
+ "parameters": [
1744
+ "botId"
1745
+ ],
1746
+ "minVersion": "0.0.7",
1747
+ "inBaseline": true,
1748
+ "inputHints": [
1749
+ "json"
1750
+ ],
1751
+ "sourceFile": "src/app/api/organization-bots/[botId]/dingtalk-task-config/route.ts"
1752
+ },
1753
+ {
1754
+ "id": "organization-bots.feishu-callback.list",
1755
+ "method": "GET",
1756
+ "path": "/api/organization-bots/[botId]/feishu-callback",
1757
+ "group": "organization-bots",
1758
+ "parameters": [
1759
+ "botId"
1760
+ ],
1761
+ "minVersion": "0.0.7",
1762
+ "inBaseline": true,
1763
+ "inputHints": [
1764
+ "json"
1765
+ ],
1766
+ "sourceFile": "src/app/api/organization-bots/[botId]/feishu-callback/route.ts"
1767
+ },
1693
1768
  {
1694
1769
  "id": "organization-bots.group-binding.list",
1695
1770
  "method": "GET",
@@ -1746,6 +1821,21 @@
1746
1821
  ],
1747
1822
  "sourceFile": "src/app/api/organization-bots/[botId]/manager-grants/route.ts"
1748
1823
  },
1824
+ {
1825
+ "id": "organization-bots.permissions.list",
1826
+ "method": "GET",
1827
+ "path": "/api/organization-bots/[botId]/permissions",
1828
+ "group": "organization-bots",
1829
+ "parameters": [
1830
+ "botId"
1831
+ ],
1832
+ "minVersion": "0.0.7",
1833
+ "inBaseline": true,
1834
+ "inputHints": [
1835
+ "json"
1836
+ ],
1837
+ "sourceFile": "src/app/api/organization-bots/[botId]/permissions/route.ts"
1838
+ },
1749
1839
  {
1750
1840
  "id": "organization-bots.recipient-candidates.list.by-botId",
1751
1841
  "method": "GET",
@@ -1800,6 +1890,21 @@
1800
1890
  "inputHints": [],
1801
1891
  "sourceFile": "src/app/api/organization-bots/[botId]/use-grants/group-directory/route.ts"
1802
1892
  },
1893
+ {
1894
+ "id": "organization-bots.wecom-callback.list",
1895
+ "method": "GET",
1896
+ "path": "/api/organization-bots/[botId]/wecom-callback",
1897
+ "group": "organization-bots",
1898
+ "parameters": [
1899
+ "botId"
1900
+ ],
1901
+ "minVersion": "0.0.7",
1902
+ "inBaseline": true,
1903
+ "inputHints": [
1904
+ "json"
1905
+ ],
1906
+ "sourceFile": "src/app/api/organization-bots/[botId]/wecom-callback/route.ts"
1907
+ },
1803
1908
  {
1804
1909
  "id": "organization-bots.member-candidates.list",
1805
1910
  "method": "GET",
@@ -1983,6 +2088,17 @@
1983
2088
  "inputHints": [],
1984
2089
  "sourceFile": "src/app/api/personal-agent-automations/[automationId]/runs/route.ts"
1985
2090
  },
2091
+ {
2092
+ "id": "personal-agent-automations.bi-groups.list",
2093
+ "method": "GET",
2094
+ "path": "/api/personal-agent-automations/bi-groups",
2095
+ "group": "personal-agent-automations",
2096
+ "parameters": [],
2097
+ "minVersion": "0.0.7",
2098
+ "inBaseline": true,
2099
+ "inputHints": [],
2100
+ "sourceFile": "src/app/api/personal-agent-automations/bi-groups/route.ts"
2101
+ },
1986
2102
  {
1987
2103
  "id": "personal-agents.list",
1988
2104
  "method": "GET",
@@ -2024,6 +2140,21 @@
2024
2140
  "inputHints": [],
2025
2141
  "sourceFile": "src/app/api/personal-agents/[agentId]/avatar/route.ts"
2026
2142
  },
2143
+ {
2144
+ "id": "personal-agents.bi-user-property-options.list",
2145
+ "method": "GET",
2146
+ "path": "/api/personal-agents/[agentId]/bi-user-property-options",
2147
+ "group": "personal-agents",
2148
+ "parameters": [
2149
+ "agentId"
2150
+ ],
2151
+ "minVersion": "0.0.7",
2152
+ "inBaseline": true,
2153
+ "inputHints": [
2154
+ "json"
2155
+ ],
2156
+ "sourceFile": "src/app/api/personal-agents/[agentId]/bi-user-property-options/route.ts"
2157
+ },
2027
2158
  {
2028
2159
  "id": "personal-agents.biz-ontology-bindings.list",
2029
2160
  "method": "GET",
@@ -2065,22 +2196,6 @@
2065
2196
  ],
2066
2197
  "sourceFile": "src/app/api/personal-agents/[agentId]/channel-bindings/route.ts"
2067
2198
  },
2068
- {
2069
- "id": "personal-agents.channel-bindings.members.list",
2070
- "method": "GET",
2071
- "path": "/api/personal-agents/[agentId]/channel-bindings/[bindingId]/members",
2072
- "group": "personal-agents",
2073
- "parameters": [
2074
- "agentId",
2075
- "bindingId"
2076
- ],
2077
- "minVersion": "0.0.4",
2078
- "inBaseline": true,
2079
- "inputHints": [
2080
- "json"
2081
- ],
2082
- "sourceFile": "src/app/api/personal-agents/[agentId]/channel-bindings/[bindingId]/members/route.ts"
2083
- },
2084
2199
  {
2085
2200
  "id": "personal-agents.collaborators.list",
2086
2201
  "method": "GET",
@@ -2948,6 +3063,19 @@
2948
3063
  ],
2949
3064
  "sourceFile": "src/app/api/platform/administrators/route.ts"
2950
3065
  },
3066
+ {
3067
+ "id": "platform.automation-push.list",
3068
+ "method": "GET",
3069
+ "path": "/api/platform/automation-push",
3070
+ "group": "platform",
3071
+ "parameters": [],
3072
+ "minVersion": "0.0.7",
3073
+ "inBaseline": true,
3074
+ "inputHints": [
3075
+ "json"
3076
+ ],
3077
+ "sourceFile": "src/app/api/platform/automation-push/route.ts"
3078
+ },
2951
3079
  {
2952
3080
  "id": "platform.background-tasks.list",
2953
3081
  "method": "GET",
@@ -3517,6 +3645,21 @@
3517
3645
  ],
3518
3646
  "sourceFile": "src/app/api/biz-ontology/networks/[networkId]/object-types/[objectTypeId]/properties/[propertyId]/route.ts"
3519
3647
  },
3648
+ {
3649
+ "id": "biz-ontology.networks.permissions.update",
3650
+ "method": "PATCH",
3651
+ "path": "/api/biz-ontology/networks/[networkId]/permissions",
3652
+ "group": "biz-ontology",
3653
+ "parameters": [
3654
+ "networkId"
3655
+ ],
3656
+ "minVersion": "0.0.7",
3657
+ "inBaseline": true,
3658
+ "inputHints": [
3659
+ "json"
3660
+ ],
3661
+ "sourceFile": "src/app/api/biz-ontology/networks/[networkId]/permissions/route.ts"
3662
+ },
3520
3663
  {
3521
3664
  "id": "biz-ontology.networks.relation-types.update",
3522
3665
  "method": "PATCH",
@@ -3685,6 +3828,21 @@
3685
3828
  ],
3686
3829
  "sourceFile": "src/app/api/organization-bots/[botId]/groups/[groupId]/route.ts"
3687
3830
  },
3831
+ {
3832
+ "id": "organization-bots.permissions.update",
3833
+ "method": "PATCH",
3834
+ "path": "/api/organization-bots/[botId]/permissions",
3835
+ "group": "organization-bots",
3836
+ "parameters": [
3837
+ "botId"
3838
+ ],
3839
+ "minVersion": "0.0.7",
3840
+ "inBaseline": true,
3841
+ "inputHints": [
3842
+ "json"
3843
+ ],
3844
+ "sourceFile": "src/app/api/organization-bots/[botId]/permissions/route.ts"
3845
+ },
3688
3846
  {
3689
3847
  "id": "organization-service-channels.update",
3690
3848
  "method": "PATCH",
@@ -3760,22 +3918,6 @@
3760
3918
  ],
3761
3919
  "sourceFile": "src/app/api/personal-agents/[agentId]/channel-bindings/[bindingId]/route.ts"
3762
3920
  },
3763
- {
3764
- "id": "personal-agents.channel-bindings.members.update",
3765
- "method": "PATCH",
3766
- "path": "/api/personal-agents/[agentId]/channel-bindings/[bindingId]/members",
3767
- "group": "personal-agents",
3768
- "parameters": [
3769
- "agentId",
3770
- "bindingId"
3771
- ],
3772
- "minVersion": "0.0.4",
3773
- "inBaseline": true,
3774
- "inputHints": [
3775
- "json"
3776
- ],
3777
- "sourceFile": "src/app/api/personal-agents/[agentId]/channel-bindings/[bindingId]/members/route.ts"
3778
- },
3779
3921
  {
3780
3922
  "id": "personal-agents.evaluation-case-design.update",
3781
3923
  "method": "PATCH",
@@ -4020,6 +4162,36 @@
4020
4162
  ],
4021
4163
  "sourceFile": "src/app/api/skills/[skillId]/governance/route.ts"
4022
4164
  },
4165
+ {
4166
+ "id": "skills.permissions.update",
4167
+ "method": "PATCH",
4168
+ "path": "/api/skills/[skillId]/permissions",
4169
+ "group": "skills",
4170
+ "parameters": [
4171
+ "skillId"
4172
+ ],
4173
+ "minVersion": "0.0.7",
4174
+ "inBaseline": true,
4175
+ "inputHints": [
4176
+ "json"
4177
+ ],
4178
+ "sourceFile": "src/app/api/skills/[skillId]/permissions/route.ts"
4179
+ },
4180
+ {
4181
+ "id": "action-tasks.dispatch.create",
4182
+ "method": "POST",
4183
+ "path": "/api/action-tasks/[taskId]/dispatch",
4184
+ "group": "action-tasks",
4185
+ "parameters": [
4186
+ "taskId"
4187
+ ],
4188
+ "minVersion": "0.0.7",
4189
+ "inBaseline": true,
4190
+ "inputHints": [
4191
+ "json"
4192
+ ],
4193
+ "sourceFile": "src/app/api/action-tasks/[taskId]/dispatch/route.ts"
4194
+ },
4023
4195
  {
4024
4196
  "id": "agent-channels.dingtalk.user-bindings.create",
4025
4197
  "method": "POST",
@@ -4874,6 +5046,21 @@
4874
5046
  "inputHints": [],
4875
5047
  "sourceFile": "src/app/api/personal-agents/[agentId]/authoring-session/route.ts"
4876
5048
  },
5049
+ {
5050
+ "id": "personal-agents.bi-user-property-options.create",
5051
+ "method": "POST",
5052
+ "path": "/api/personal-agents/[agentId]/bi-user-property-options",
5053
+ "group": "personal-agents",
5054
+ "parameters": [
5055
+ "agentId"
5056
+ ],
5057
+ "minVersion": "0.0.7",
5058
+ "inBaseline": true,
5059
+ "inputHints": [
5060
+ "json"
5061
+ ],
5062
+ "sourceFile": "src/app/api/personal-agents/[agentId]/bi-user-property-options/route.ts"
5063
+ },
4877
5064
  {
4878
5065
  "id": "personal-agents.channel-bindings.create",
4879
5066
  "method": "POST",
@@ -6039,6 +6226,51 @@
6039
6226
  ],
6040
6227
  "sourceFile": "src/app/api/organization-bi-environments/[environmentId]/core-api-credential/route.ts"
6041
6228
  },
6229
+ {
6230
+ "id": "organization-bots.dingtalk-task-config.put",
6231
+ "method": "PUT",
6232
+ "path": "/api/organization-bots/[botId]/dingtalk-task-config",
6233
+ "group": "organization-bots",
6234
+ "parameters": [
6235
+ "botId"
6236
+ ],
6237
+ "minVersion": "0.0.7",
6238
+ "inBaseline": true,
6239
+ "inputHints": [
6240
+ "json"
6241
+ ],
6242
+ "sourceFile": "src/app/api/organization-bots/[botId]/dingtalk-task-config/route.ts"
6243
+ },
6244
+ {
6245
+ "id": "organization-bots.feishu-callback.put",
6246
+ "method": "PUT",
6247
+ "path": "/api/organization-bots/[botId]/feishu-callback",
6248
+ "group": "organization-bots",
6249
+ "parameters": [
6250
+ "botId"
6251
+ ],
6252
+ "minVersion": "0.0.7",
6253
+ "inBaseline": true,
6254
+ "inputHints": [
6255
+ "json"
6256
+ ],
6257
+ "sourceFile": "src/app/api/organization-bots/[botId]/feishu-callback/route.ts"
6258
+ },
6259
+ {
6260
+ "id": "organization-bots.wecom-callback.put",
6261
+ "method": "PUT",
6262
+ "path": "/api/organization-bots/[botId]/wecom-callback",
6263
+ "group": "organization-bots",
6264
+ "parameters": [
6265
+ "botId"
6266
+ ],
6267
+ "minVersion": "0.0.7",
6268
+ "inBaseline": true,
6269
+ "inputHints": [
6270
+ "json"
6271
+ ],
6272
+ "sourceFile": "src/app/api/organization-bots/[botId]/wecom-callback/route.ts"
6273
+ },
6042
6274
  {
6043
6275
  "id": "organization-email.put",
6044
6276
  "method": "PUT",
@@ -6257,6 +6489,19 @@
6257
6489
  ],
6258
6490
  "sourceFile": "src/app/api/platform/access/route.ts"
6259
6491
  },
6492
+ {
6493
+ "id": "platform.automation-push.put",
6494
+ "method": "PUT",
6495
+ "path": "/api/platform/automation-push",
6496
+ "group": "platform",
6497
+ "parameters": [],
6498
+ "minVersion": "0.0.7",
6499
+ "inBaseline": true,
6500
+ "inputHints": [
6501
+ "json"
6502
+ ],
6503
+ "sourceFile": "src/app/api/platform/automation-push/route.ts"
6504
+ },
6260
6505
  {
6261
6506
  "id": "platform.galaxy-oidc.put",
6262
6507
  "method": "PUT",
@@ -6395,6 +6640,11 @@
6395
6640
  "path": "/api/internal/guandata-metrics",
6396
6641
  "reason": "server_runtime_protocol"
6397
6642
  },
6643
+ {
6644
+ "method": "GET",
6645
+ "path": "/api/organization-bots/[botId]/wecom-events",
6646
+ "reason": "external_channel_callback_or_delivery"
6647
+ },
6398
6648
  {
6399
6649
  "method": "GET",
6400
6650
  "path": "/api/personal-agents/[agentId]/channel-bindings/[bindingId]/stream",
@@ -6775,6 +7025,16 @@
6775
7025
  "path": "/api/internal/organization-email-send",
6776
7026
  "reason": "server_runtime_protocol"
6777
7027
  },
7028
+ {
7029
+ "method": "POST",
7030
+ "path": "/api/organization-bots/[botId]/feishu-events",
7031
+ "reason": "external_channel_callback_or_delivery"
7032
+ },
7033
+ {
7034
+ "method": "POST",
7035
+ "path": "/api/organization-bots/[botId]/wecom-events",
7036
+ "reason": "external_channel_callback_or_delivery"
7037
+ },
6778
7038
  {
6779
7039
  "method": "POST",
6780
7040
  "path": "/api/personal-agents/[agentId]/channel-bindings/[bindingId]/stream",
package/src/cli.js CHANGED
@@ -44,7 +44,7 @@ Usage:
44
44
  decidex agent models ID
45
45
  decidex agent run ID (--message TEXT | --input FILE | --attach FILE) [--model-entry-id ID] [--reasoning-effort LEVEL] [--wait] [--follow] [--output FILE] [--timeout SECONDS]
46
46
 
47
- decidex session list [--status all|running|completed] [--query TEXT] [--cursor CURSOR] [--agent-id ID]
47
+ decidex session list [--status all|running|completed] [--query TEXT] [--cursor CURSOR] [--agent-id ID] [--pinned-session-id ID] [--pinned-agent-id ID]
48
48
  decidex session view SESSION_ID [--before CURSOR | --since CURSOR]
49
49
  decidex session send SESSION_ID (--message TEXT | --input FILE) [--wait] [--follow]
50
50
  decidex session stop SESSION_ID
@@ -107,7 +107,7 @@ Usage:
107
107
  decidex automation run ID [--wait] [--follow] [--output FILE] [--timeout SECONDS]
108
108
  decidex automation runs ID [--cursor CURSOR]
109
109
 
110
- decidex action-task list|get|suggestions|members|create|adopt|reject|complete|cancel ...
110
+ decidex action-task list|get|suggestions|members|create|adopt|reject|complete|cancel|dispatch-info|dispatch|attachment ...
111
111
  decidex tracking list|get|preview|create|lookup|wait|rename|schedule|pause|resume|close|review|reviews|report|retry|delete ...
112
112
  decidex platform list|show|call|coverage ...
113
113
 
@@ -138,6 +138,8 @@ Server >= 0.0.6: DAILY; WEEKLY weekdays:[0..6]; MONTHLY monthDays:[1..31];
138
138
  INTERVAL intervalMinutes:5..2147483647; ONCE runOnceAt:future ISO time.
139
139
  On 0.0.5, one weekday is supported; newer schedules are rejected before writing.
140
140
  Old HOURLY becomes INTERVAL(60) on 0.0.6. server check automation apply shows the protocol.
141
+ Server >= 0.0.7: imPush.channels[].biGroupIds / emailPush.biGroupIds select BI groups.
142
+ Before 0.0.7, include schedule when PATCHing to avoid the server's default schedule reset.
141
143
  --wait --timeout covers start, polling and final reads. A timeout does not cancel the run.`,
142
144
  "action-task": `Usage:
143
145
  decidex action-task list [--status PENDING|ADOPTED|COMPLETED|REJECTED|CANCELED|all] [--query TEXT] [--page N]
@@ -145,11 +147,18 @@ Old HOURLY becomes INTERVAL(60) on 0.0.6. server check automation apply shows th
145
147
  decidex action-task members SESSION_ID [--query TEXT]
146
148
  decidex action-task create SESSION_ID FILE
147
149
  decidex action-task get TASK_ID
150
+ decidex action-task dispatch-info TASK_ID [--bot-id ID]
151
+ decidex action-task dispatch TASK_ID FILE
152
+ decidex action-task attachment TASK_ID EVENT_ID INDEX FILE
148
153
  decidex action-task adopt|complete TASK_ID --version N
149
154
  decidex action-task reject|cancel TASK_ID --version N --note REASON
150
155
 
151
156
  Create FILE: {messageId,suggestionId,draft:{title,description,assigneeIds:[USER_ID]}}.
152
157
  Read the current version with get before changing status; 409 requires a new user decision.
158
+ Dispatch and attachment require server >= 0.0.7. INDEX starts at 0.
159
+ Dispatch FILE: {botId,recipientIds:[USER_ID],idempotencyKey,createNativeTask:false}.
160
+ Dispatch sends real notifications; createNativeTask defaults to true. Keep the same key
161
+ for the same dispatch and query dispatch-info after an uncertain response; no automatic retry.
153
162
  Action tasks have no delete API.`,
154
163
  tracking: `Usage:
155
164
  decidex tracking list [--filter all|due] [--page N]
@@ -202,7 +211,7 @@ to stderr, so stdout or --output remains machine-readable.
202
211
  accept JSON arrays. --reasoning-effort null uses the model default.
203
212
  Use agent models AGENT_ID to discover supported catalog entries and efforts.`,
204
213
  session: `Usage:
205
- decidex session list [--status all|running|completed] [--query TEXT] [--cursor CURSOR] [--agent-id ID]
214
+ decidex session list [--status all|running|completed] [--query TEXT] [--cursor CURSOR] [--agent-id ID] [--pinned-session-id ID] [--pinned-agent-id ID]
206
215
  decidex session view SESSION_ID [--before CURSOR | --since CURSOR]
207
216
  decidex session send SESSION_ID (--message TEXT | --input FILE) [--wait] [--follow]
208
217
  decidex session stop SESSION_ID
@@ -274,12 +283,6 @@ Runtime Pod termination details require backend support.`,
274
283
  decidex ontology versions list NETWORK_ID
275
284
  decidex ontology versions get NETWORK_ID VERSION_ID
276
285
  decidex ontology versions create NETWORK_ID [--description TEXT]`,
277
- automation: `Usage:
278
- decidex automation list
279
- decidex automation apply FILE
280
- decidex automation delete ID
281
- decidex automation run ID [--wait] [--follow] [--output FILE] [--timeout SECONDS]
282
- decidex automation runs ID [--cursor CURSOR]`,
283
286
  server: `Usage:
284
287
  decidex server version
285
288
  decidex server check [COMMAND...]
@@ -1004,11 +1007,19 @@ async function agentCommand(action, args) {
1004
1007
  if (!spec || typeof spec !== "object" || Array.isArray(spec)) throw new Error("Agent 文件必须是 JSON 对象");
1005
1008
  const id = spec.id;
1006
1009
  if (id !== undefined && (typeof id !== "string" || !id.trim())) throw new Error("Agent id 必须是非空字符串");
1007
- const allowed = new Set(["id", "name", "description", "instructions", "avatarIcon", "avatarColor", "avatarImageDataUrl", "openingMessage", "presetQuestions", "contextReferences", "bizOntologyBindings", "betaFeatures", "actionSuggestionsEnabled", "biExplorationPolicy", "pluginSelection", "useScope", "sessionDefaultModelCatalogEntryId", "sessionDefaultReasoningEffort", ...(id ? ["builtInInstructions"] : [])]);
1010
+ const allowed = new Set(["id", "name", "description", "instructions", "avatarIcon", "avatarColor", "avatarImageDataUrl", "openingMessage", "presetQuestions", "contextReferences", "bizOntologyBindings", "betaFeatures", "actionSuggestionsEnabled", "biUserPropertiesEnabled", "biUserPropertyKeys", "biExplorationPolicy", "pluginSelection", "useScope", "sessionDefaultModelCatalogEntryId", "sessionDefaultReasoningEffort", ...(id ? ["builtInInstructions"] : [])]);
1008
1011
  const unknown = Object.keys(spec).filter((key) => !allowed.has(key));
1009
1012
  if (unknown.length) throw new Error(`Agent 文件包含不支持的字段:${unknown.join(", ")}`);
1010
1013
  const body = { ...spec };
1011
1014
  delete body.id;
1015
+ if (body.biUserPropertiesEnabled !== undefined || body.biUserPropertyKeys !== undefined) {
1016
+ if (body.biUserPropertiesEnabled !== undefined && typeof body.biUserPropertiesEnabled !== "boolean") throw new Error("biUserPropertiesEnabled 必须是布尔值");
1017
+ if (body.biUserPropertyKeys !== undefined) {
1018
+ if (!Array.isArray(body.biUserPropertyKeys) || body.biUserPropertyKeys.length > 20 || body.biUserPropertyKeys.some((key) => typeof key !== "string" || !key.trim() || key.trim().length > 200)) throw new Error("biUserPropertyKeys 最多 20 项,每项为 1..200 字符的属性 Key");
1019
+ body.biUserPropertyKeys = [...new Set(body.biUserPropertyKeys.map((key) => key.trim()))];
1020
+ }
1021
+ await commandCompatibility("agent apply bi-user-properties", values);
1022
+ }
1012
1023
  return print(
1013
1024
  await request(id ? `/api/personal-agents/${encodeURIComponent(id)}` : "/api/personal-agents", {
1014
1025
  method: id ? "PUT" : "POST",
@@ -1089,6 +1100,8 @@ async function sessionCommand(action, args) {
1089
1100
  const { values, positionals } = commandArgs(args, {
1090
1101
  ...TURN_OPTIONS,
1091
1102
  "agent-id": { type: "string" },
1103
+ "pinned-session-id": { type: "string", multiple: true },
1104
+ "pinned-agent-id": { type: "string", multiple: true },
1092
1105
  "model-entry-id": { type: "string" },
1093
1106
  before: { type: "string" },
1094
1107
  since: { type: "string" },
@@ -1115,6 +1128,12 @@ async function sessionCommand(action, args) {
1115
1128
  if (values.query) query.set("q", values.query);
1116
1129
  if (values.cursor) query.set("cursor", values.cursor);
1117
1130
  if (values["agent-id"]) { query.set("groupMode", "agent"); query.set("agentId", values["agent-id"]); }
1131
+ for (const [flag, parameter] of [["pinned-session-id", "pinnedSessionIds"], ["pinned-agent-id", "pinnedAgentIds"]]) {
1132
+ if (!values[flag]?.length) continue;
1133
+ if (values[flag].some((id) => !id.trim() || id.trim().length > 200)) throw new Error(`--${flag} 需要 1..200 字符的 ID`);
1134
+ await commandCompatibility("session list pinned", values);
1135
+ query.set(parameter, JSON.stringify([...new Set(values[flag].map((id) => id.trim()))]));
1136
+ }
1118
1137
  const result = await request(`/api/agent-sessions?${query}`, { values });
1119
1138
  if (values.status !== "all") result.sessions = (result.sessions ?? []).filter((session) => values.status === "running" ? session.status === "RUNNING" : session.status !== "RUNNING");
1120
1139
  return print(result);
@@ -1744,12 +1763,17 @@ async function automationCommand(action, args) {
1744
1763
  const allowed = new Set(["name", "instructions", "personalAgentId", "schedule", "imPush", "emailPush", ...(id ? ["status"] : ["source"])]);
1745
1764
  const unknown = Object.keys(body).filter((key) => !allowed.has(key));
1746
1765
  if (unknown.length) throw new Error(`定时任务文件包含不支持的字段:${unknown.join(", ")}`);
1766
+ if (body.emailPush?.biGroupIds !== undefined || body.imPush?.channels?.some((channel) => channel.biGroupIds !== undefined)) await commandCompatibility("automation apply bi-groups", values);
1747
1767
  if (body.schedule !== undefined) {
1748
1768
  const compatibility = await commandCompatibility("automation apply", values);
1749
1769
  body.schedule = adaptAutomationSchedule(body.schedule, compatibility.protocol);
1750
1770
  }
1751
1771
  if (body.status !== undefined && !["ACTIVE", "PAUSED"].includes(body.status)) throw new Error("status 只能手动设置 ACTIVE 或 PAUSED;FINISHED 由服务端单次调度写入");
1752
1772
  if (id !== undefined && (typeof id !== "string" || !id.trim())) throw new Error("定时任务 id 必须是非空字符串");
1773
+ if (id && body.schedule === undefined) {
1774
+ const server = await targetVersion(values);
1775
+ if (!resolveCommandCompatibility("automation apply partial", server.version).supported) throw new Error(`目标 ${server.version} 省略 schedule 的更新可能重置计划;请在文件中附上原 schedule,或升级服务端到 >= 0.0.7`);
1776
+ }
1753
1777
  return print(await request(id ? `${base}/${encodeURIComponent(id)}` : base, { method: id ? "PATCH" : "POST", body, values }));
1754
1778
  }
1755
1779
  if (!["delete", "run", "runs"].includes(action)) throw new Error(`未知 automation 命令:${action || "(空)"}`);
@@ -1794,9 +1818,20 @@ async function actionTaskCommand(action, args) {
1794
1818
  const { values, positionals } = commandArgs(args, {
1795
1819
  status: { type: "string", default: "PENDING" }, query: { type: "string" }, page: { type: "string", default: "1" },
1796
1820
  version: { type: "string" }, note: { type: "string" }, "message-id": { type: "string" },
1797
- "run-id": { type: "string" }, output: { type: "string" }, timeout: { type: "string", default: "600" },
1821
+ "run-id": { type: "string" }, "bot-id": { type: "string" }, output: { type: "string" }, timeout: { type: "string", default: "600" },
1798
1822
  });
1799
1823
  const deadline = Date.now() + positiveSeconds(values.timeout) * 1000;
1824
+ if (action === "attachment") {
1825
+ expectPositionals(positionals, 4, "action-task attachment TASK_ID EVENT_ID INDEX FILE");
1826
+ if (!/^\d{1,4}$/.test(positionals[2])) throw new Error("附件 INDEX 必须是 0..9999 的整数(从 0 开始)");
1827
+ return print(await taskApi("action-tasks.events.attachments.get", { taskId: positionals[0], eventId: positionals[1], index: positionals[2] }, { output: positionals[3], values, deadline }));
1828
+ }
1829
+ if (action === "dispatch") {
1830
+ expectPositionals(positionals, 2, "action-task dispatch TASK_ID FILE");
1831
+ const body = await readJsonFile(positionals[1]);
1832
+ if (!body || typeof body !== "object" || Array.isArray(body) || typeof body.idempotencyKey !== "string" || !body.idempotencyKey.trim() || body.idempotencyKey.length > 80) throw new Error("分发文件需要 1..80 字符的 idempotencyKey;同一次分发保持此值不变,超时后先查询 dispatch-info");
1833
+ return emit(await taskApi("action-tasks.dispatch.create", { taskId: positionals[0] }, { body, values, deadline }), values.output);
1834
+ }
1800
1835
  if (action === "list") {
1801
1836
  expectPositionals(positionals, 0, "action-task list");
1802
1837
  if (!["PENDING", "ADOPTED", "COMPLETED", "REJECTED", "CANCELED", "all"].includes(values.status)) throw new Error("--status 不合法");
@@ -1822,6 +1857,7 @@ async function actionTaskCommand(action, args) {
1822
1857
  }
1823
1858
  expectPositionals(positionals, 1, `action-task ${action} TASK_ID`);
1824
1859
  const parameters = { taskId: positionals[0] };
1860
+ if (action === "dispatch-info") return emit(await taskApi("action-tasks.dispatch.list", parameters, { query: values["bot-id"] ? { botId: values["bot-id"] } : {}, values, deadline }), values.output);
1825
1861
  if (action === "get") return emit(await taskApi("action-tasks.get", parameters, { values, deadline }), values.output);
1826
1862
  if (!["adopt", "reject", "complete", "cancel"].includes(action)) throw new Error(`未知 action-task 命令:${action || "(空)"}`);
1827
1863
  if (values.version === undefined || !/^\d+$/.test(values.version) || !Number.isSafeInteger(Number(values.version))) throw new Error("需要 --version 非负整数;从 action-task get 返回值读取,冲突后不要自动重试");
@@ -1,5 +1,5 @@
1
- export const ADAPTED_SERVER_VERSION = "0.0.6";
2
- export const ADAPTED_SERVER_COMMIT = "73901fa03b18d2cb00484ffa951bf99b19af4161";
1
+ export const ADAPTED_SERVER_VERSION = "0.0.7";
2
+ export const ADAPTED_SERVER_COMMIT = "cfdf08dbab954510ea1ebb4dba6a50d6b2af8c82";
3
3
 
4
4
  // Version boundaries must be backed by release tags, not the current main version.
5
5
  // /api/auth/context first appears between tags 0.0.4 and 0.0.5 (a860e97ad).
@@ -10,6 +10,11 @@ export const COMMAND_COMPATIBILITY = {
10
10
  "context show": { protocol: "identity-context", legacy: { before: "0.0.5", protocol: "local-context" } },
11
11
  // 0.0.6 changes the automation schedule contract; 0.0.5 strips unknown fields.
12
12
  "automation apply": { protocol: "schedule-v2", legacy: { before: "0.0.6", protocol: "schedule-v1" } },
13
+ // These fields first appear in the 0.0.7 release; older schemas strip or reject them.
14
+ "agent apply bi-user-properties": { minVersion: "0.0.7" },
15
+ "session list pinned": { minVersion: "0.0.7" },
16
+ "automation apply bi-groups": { minVersion: "0.0.7" },
17
+ "automation apply partial": { minVersion: "0.0.7" },
13
18
  };
14
19
 
15
20
  export function adaptAutomationSchedule(input, protocol, now = Date.now()) {