weaver-work-cli 0.1.5 → 0.1.7
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 +14 -9
- package/dist/cmd/skills/index.js +60 -0
- package/dist/internal/e10/auth/commands.js +48 -32
- package/dist/internal/e10/auth/session.js +44 -3
- package/dist/internal/e10/auth/xiaoe.js +363 -11
- package/dist/internal/e10/context.js +4 -2
- package/dist/internal/skills/detector.js +42 -0
- package/dist/internal/skills/install.js +50 -3
- package/dist/shortcuts/archive/render/search-format.js +12 -3
- package/dist/shortcuts/ebuilder-form/continuation.js +70 -0
- package/dist/shortcuts/ebuilder-form/errors.js +54 -0
- package/dist/shortcuts/ebuilder-form/host.js +1238 -0
- package/dist/shortcuts/ebuilder-form/index.js +108 -0
- package/dist/shortcuts/ebuilder-form/manifest.js +347 -0
- package/dist/shortcuts/ebuilder-form/operations/read.js +157 -0
- package/dist/shortcuts/ebuilder-form/operations/registry.js +56 -0
- package/dist/shortcuts/ebuilder-form/operations/shared.js +132 -0
- package/dist/shortcuts/ebuilder-form/operations/types.js +19 -0
- package/dist/shortcuts/ebuilder-form/operations/write.js +277 -0
- package/dist/shortcuts/ebuilder-form/operations.js +8 -0
- package/dist/shortcuts/ehr/operations/salary.js +2 -140
- package/dist/shortcuts/im/continuation.js +70 -0
- package/dist/shortcuts/{yimiaoban → im}/errors.js +14 -14
- package/dist/shortcuts/{yimiaoban → im}/host.js +26 -26
- package/dist/shortcuts/{yimiaoban → im}/index.js +42 -42
- package/dist/shortcuts/{yimiaoban → im}/manifest.js +7 -6
- package/dist/shortcuts/{yimiaoban → im}/operations/file-user.js +54 -41
- package/dist/shortcuts/{yimiaoban → im}/operations/group-read.js +46 -44
- package/dist/shortcuts/{yimiaoban → im}/operations/group-write.js +113 -66
- package/dist/shortcuts/{yimiaoban → im}/operations/msg-sync.js +164 -141
- package/dist/shortcuts/{yimiaoban → im}/operations/msg-write.js +47 -47
- package/dist/shortcuts/{yimiaoban → im}/operations/person.js +10 -10
- package/dist/shortcuts/{yimiaoban → im}/operations/registry.js +10 -8
- package/dist/shortcuts/{yimiaoban → im}/operations/session.js +82 -83
- package/dist/shortcuts/im/operations/shared.js +442 -0
- package/dist/shortcuts/{yimiaoban → im}/operations/types.js +1 -1
- package/dist/shortcuts/im/operations/user-remind.js +201 -0
- package/dist/shortcuts/{yimiaoban → im}/operations/write-util.js +7 -7
- package/dist/shortcuts/{yimiaoban → im}/operations.js +3 -3
- package/dist/shortcuts/index.js +10 -2
- package/dist/shortcuts/invoice/manifest.js +113 -10
- package/dist/shortcuts/invoice/operations/import.js +39 -14
- package/dist/shortcuts/invoice/operations/reim.js +38 -18
- package/dist/shortcuts/invoice/operations/shared.js +35 -6
- package/dist/shortcuts/jiuchuanhui/manifest.js +3 -3
- package/dist/shortcuts/jiuchuanhui/operations/registry.js +2 -2
- package/dist/shortcuts/{yimiaoban → okr}/continuation.js +10 -10
- package/dist/shortcuts/okr/errors.js +70 -0
- package/dist/shortcuts/okr/host.js +169 -0
- package/dist/shortcuts/okr/index.js +155 -0
- package/dist/shortcuts/okr/manifest.js +70 -0
- package/dist/shortcuts/okr/operations/link.js +305 -0
- package/dist/shortcuts/okr/operations/read.js +481 -0
- package/dist/shortcuts/okr/operations/registry.js +31 -0
- package/dist/shortcuts/okr/operations/shared.js +381 -0
- package/dist/shortcuts/okr/operations/types.js +88 -0
- package/dist/shortcuts/okr/operations/write.js +838 -0
- package/dist/shortcuts/okr/operations.js +8 -0
- package/dist/shortcuts/project/continuation.js +70 -0
- package/dist/shortcuts/project/errors.js +53 -0
- package/dist/shortcuts/project/host.js +160 -0
- package/dist/shortcuts/project/index.js +106 -0
- package/dist/shortcuts/project/manifest.js +36 -0
- package/dist/shortcuts/project/operations/read.js +551 -0
- package/dist/shortcuts/project/operations/registry.js +31 -0
- package/dist/shortcuts/project/operations/shared.js +68 -0
- package/dist/shortcuts/project/operations/types.js +39 -0
- package/dist/shortcuts/project/operations/write.js +266 -0
- package/dist/shortcuts/project/operations.js +8 -0
- package/dist/shortcuts/workflow/continuation.js +508 -0
- package/dist/shortcuts/workflow/endpoints.js +149 -0
- package/dist/shortcuts/workflow/errors.js +112 -0
- package/dist/shortcuts/workflow/host.js +224 -0
- package/dist/shortcuts/workflow/index.js +116 -0
- package/dist/shortcuts/workflow/manifest.js +30 -0
- package/dist/shortcuts/workflow/operations/form.js +4159 -0
- package/dist/shortcuts/workflow/operations/read.js +3778 -0
- package/dist/shortcuts/workflow/operations/registry.js +33 -0
- package/dist/shortcuts/workflow/operations/shared.js +167 -0
- package/dist/shortcuts/workflow/operations/types.js +44 -0
- package/dist/shortcuts/workflow/operations/write.js +1991 -0
- package/dist/shortcuts/workflow/operations.js +119 -0
- package/dist/shortcuts/workflow/state.js +182 -0
- package/docs/SKILL.md +5 -3
- package/docs/_catalog.md +10 -1
- package/docs/agent-invoice.md +2 -2
- package/docs/agent-skill-install.md +2 -2
- package/docs/e10-auth.md +3 -1
- package/docs/ebuilder-form.md +38 -0
- package/docs/im.md +104 -0
- package/docs/invoice.md +5 -5
- package/docs/okr.md +122 -0
- package/docs/operation-manual.md +10 -7
- package/docs/project.md +69 -0
- package/docs/skill-review-2026-09-19.md +68 -0
- package/package.json +3 -2
- package/scripts/package-skill.mjs +38 -11
- package/scripts/sync-connector-skills.mjs +172 -0
- package/skill-template/business-info.json +357 -16
- package/skill-template/domains/ebuilder-form.md +5 -0
- package/skill-template/domains/okr.md +18 -0
- package/skill-template/domains/shijingran.md +3 -0
- package/skill-template/domains/skill-maker.md +4 -4
- package/skill-template/domains/workflow.md +22 -0
- package/skill-template/domains/yepiaotong.md +4 -2
- package/skill-template/domains/yimiaoban.md +13 -10
- package/skill-template/product.json +5 -0
- package/skill-template/skill-template.md +1 -0
- package/skills/weaver-e10-calendar/SKILL.md +5 -1
- package/skills/weaver-e10-calendar/references/calendar-query.md +7 -0
- package/skills/weaver-e10-calendar/references/source-manifest.json +314 -32
- package/skills/weaver-e10-ebuilder-form/SKILL.md +123 -0
- package/skills/weaver-e10-ebuilder-form/references/context-routing.md +90 -0
- package/skills/weaver-e10-ebuilder-form/references/custom-api.md +86 -0
- package/skills/weaver-e10-ebuilder-form/references/disabled-capabilities.md +50 -0
- package/skills/weaver-e10-ebuilder-form/references/fields-browser.md +100 -0
- package/skills/weaver-e10-ebuilder-form/references/list-nlist.md +91 -0
- package/skills/weaver-e10-ebuilder-form/references/openapi-read.md +74 -0
- package/skills/weaver-e10-ebuilder-form/references/openapi-write.md +86 -0
- package/skills/weaver-e10-ebuilder-form/references/source-manifest.json +107 -0
- package/skills/weaver-e10-esb/SKILL.md +1 -1
- package/skills/weaver-e10-esb/references/source-manifest.json +15 -14
- package/skills/weaver-e10-hrm/SKILL.md +1 -1
- package/skills/weaver-e10-hrm/references/source-manifest.json +357 -38
- package/skills/weaver-e10-jiuchuanhui/SKILL.md +22 -4
- package/skills/weaver-e10-jiuchuanhui/references/clue.md +4 -2
- package/skills/weaver-e10-jiuchuanhui/references/contact.md +1 -1
- package/skills/weaver-e10-jiuchuanhui/references/customer.md +3 -3
- package/skills/weaver-e10-jiuchuanhui/references/disabled-capabilities.md +1 -1
- package/skills/weaver-e10-jiuchuanhui/references/discovery-config.md +10 -10
- package/skills/weaver-e10-jiuchuanhui/references/general-helpers.md +3 -3
- package/skills/weaver-e10-jiuchuanhui/references/sale.md +7 -7
- package/skills/weaver-e10-jiuchuanhui/references/source-manifest.json +3 -3
- package/skills/weaver-e10-jucailin/SKILL.md +2 -2
- package/skills/weaver-e10-mail/SKILL.md +22 -6
- package/skills/weaver-e10-meeting/SKILL.md +22 -1
- package/skills/weaver-e10-okr/SKILL.md +139 -0
- package/skills/weaver-e10-okr/references/okr-align.md +59 -0
- package/skills/weaver-e10-okr/references/okr-keyresult.md +68 -0
- package/skills/weaver-e10-okr/references/okr-link-routing.md +67 -0
- package/skills/weaver-e10-okr/references/okr-query.md +105 -0
- package/skills/weaver-e10-okr/references/okr-write.md +94 -0
- package/skills/weaver-e10-okr/references/source-manifest.json +672 -0
- package/skills/weaver-e10-plan/SKILL.md +3 -3
- package/skills/weaver-e10-plan/references/plan-report-write.md +1 -1
- package/skills/weaver-e10-plan/references/source-manifest.json +20 -20
- package/skills/weaver-e10-qiyecheng/SKILL.md +21 -1
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +17 -17
- package/skills/weaver-e10-shared/SKILL.md +79 -11
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +41 -8
- package/skills/weaver-e10-shared/references/non-interactive-environment.md +78 -0
- package/skills/weaver-e10-shared/references/weaver-e10-installation.md +39 -0
- package/skills/weaver-e10-shijingran/SKILL.md +83 -0
- package/skills/weaver-e10-shijingran/references/field-resolution.md +105 -0
- package/skills/weaver-e10-shijingran/references/operations.md +154 -0
- package/skills/weaver-e10-shijingran/references/source-manifest.json +1380 -0
- package/skills/weaver-e10-shijingran/references/write-operations.md +90 -0
- package/skills/weaver-e10-skill-maker/SKILL.md +26 -9
- package/skills/weaver-e10-skill-maker/references/business-skill-generation.md +39 -8
- package/skills/weaver-e10-skill-maker/references/detector-validation.md +25 -8
- package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +66 -5
- package/skills/weaver-e10-skill-maker/references/module-gap-audit-and-repair.md +86 -0
- package/skills/weaver-e10-skill-maker/references/source-update-detection.md +59 -5
- package/skills/weaver-e10-skill-maker/references/weaver-skill-style.md +16 -8
- package/skills/weaver-e10-wenshuding/SKILL.md +28 -4
- package/skills/weaver-e10-wenshuding/references/archive-search.md +14 -0
- package/skills/weaver-e10-wenshuding/references/source-manifest.json +27 -26
- package/skills/weaver-e10-workflow/SKILL.md +250 -0
- package/skills/weaver-e10-workflow/references/source-manifest.json +1062 -0
- package/skills/weaver-e10-workflow/references/workflow-agent-entry.md +96 -0
- package/skills/weaver-e10-workflow/references/workflow-batch.md +275 -0
- package/skills/weaver-e10-workflow/references/workflow-create.md +182 -0
- package/skills/weaver-e10-workflow/references/workflow-edit.md +106 -0
- package/skills/weaver-e10-workflow/references/workflow-memory.md +165 -0
- package/skills/weaver-e10-workflow/references/workflow-operate.md +153 -0
- package/skills/weaver-e10-workflow/references/workflow-query.md +821 -0
- package/skills/weaver-e10-workflow/references/workflow-share.md +117 -0
- package/skills/weaver-e10-workflow/references/workflow-view.md +189 -0
- package/skills/weaver-e10-yepiaotong/SKILL.md +28 -28
- package/skills/weaver-e10-yepiaotong/references/invoice-disabled-capabilities.md +11 -5
- package/skills/weaver-e10-yepiaotong/references/invoice-import.md +14 -8
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +9 -43
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing.md +8 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +13 -17
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +6 -7
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +2 -2
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +1155 -553
- package/skills/weaver-e10-yimiaoban/SKILL.md +56 -38
- package/skills/weaver-e10-yimiaoban/references/ding-write.md +8 -8
- package/skills/weaver-e10-yimiaoban/references/error-codes.md +16 -0
- package/skills/weaver-e10-yimiaoban/references/field-resolution.md +10 -10
- package/skills/weaver-e10-yimiaoban/references/file-user-i18n.md +12 -12
- package/skills/weaver-e10-yimiaoban/references/group-read.md +16 -16
- package/skills/weaver-e10-yimiaoban/references/group-write.md +17 -15
- package/skills/weaver-e10-yimiaoban/references/msg-read.md +21 -17
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +10 -10
- package/skills/weaver-e10-yimiaoban/references/person.md +6 -6
- package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +15 -11
- package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +11 -10
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +2164 -154
- package/skills/weaver-e10-yimiaoban/references/user-remind.md +75 -0
- package/skills/weaver-e10-ziguanjia/SKILL.md +4 -2
- package/skills/weaver-e10-ziguanjia/references/source-manifest.json +99 -29
- package/tools/weaver-skill-detector-1.0.13/SKILL.md +253 -0
- package/tools/weaver-skill-detector-1.0.13/_meta.json +6 -0
- package/tools/weaver-skill-detector-1.0.13/references/checklist.md +298 -0
- package/tools/weaver-skill-detector-1.0.13/scripts/validate_skill.py +4190 -0
- package/dist/shortcuts/yimiaoban/operations/shared.js +0 -236
- package/docs/yimiaoban.md +0 -86
- package/skills/weaver-e10-calendar/product.json +0 -8
- package/skills/weaver-e10-esb/product.json +0 -8
- package/skills/weaver-e10-hrm/product.json +0 -8
- package/skills/weaver-e10-jiuchuanhui/product.json +0 -8
- package/skills/weaver-e10-jucailin/product.json +0 -8
- package/skills/weaver-e10-mail/product.json +0 -8
- package/skills/weaver-e10-meeting/product.json +0 -8
- package/skills/weaver-e10-plan/product.json +0 -8
- package/skills/weaver-e10-qiyecheng/product.json +0 -8
- package/skills/weaver-e10-skill-maker/product.json +0 -8
- package/skills/weaver-e10-wenshuding/product.json +0 -8
- package/skills/weaver-e10-yepiaotong/product.json +0 -8
- package/skills/weaver-e10-yepiaotong/references/invoice-red.md +0 -261
- package/skills/weaver-e10-yimiaoban/product.json +0 -8
- package/skills/weaver-e10-ziguanjia/product.json +0 -8
- /package/dist/shortcuts/{yimiaoban → im}/operations/msg-parse.js +0 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# 修改已存在流程表单
|
|
2
|
+
|
|
3
|
+
## 什么时候读取
|
|
4
|
+
|
|
5
|
+
用户要"修改/更正某条已存在流程的表单内容"(改已发起流程的字段值)时读取本文件。覆盖 `workflow.editLoad` / `workflow.editPrepare` / `workflow.editApply`。只保存表单字段,不调 flow/save、不提交、不校验必填。
|
|
6
|
+
|
|
7
|
+
## Operation
|
|
8
|
+
|
|
9
|
+
| Operation | 风险 | 固定规则 |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| `workflow.editLoad` | read | 必传 `requestId`;返回 `context`/editableFields/currentValues/fields/requestInfo |
|
|
12
|
+
| `workflow.editPrepare` | read-before-write | requiresConfirmation;必传 `context`/`data`;不校验必填;触发字段联动 |
|
|
13
|
+
| `workflow.editApply` | high-risk-write | requiresConfirmation;必传 `confirm:true`/`context`;仅 saveFormData,不调 flow/save、不提交;遇 `partial`/`write_uncertain` 禁止重试 |
|
|
14
|
+
|
|
15
|
+
## 确认链(写操作)
|
|
16
|
+
|
|
17
|
+
1. `workflow.editLoad` 加载当前表单值与可编辑字段,拿到 `context`。
|
|
18
|
+
2. `workflow.editPrepare` 修改字段,向用户摘要变更字段与联动结果。
|
|
19
|
+
3. 等用户明确确认。
|
|
20
|
+
4. `workflow.editApply` 带 `confirm:true` 与同一 `context` 保存。
|
|
21
|
+
5. 成功时返回 `status = EDIT_SAVED` 与 `saved.data_id` / `saved.updateTimeStamp`——**按返回值汇报即可,不需要再去反查**。
|
|
22
|
+
6. 遇 `partial`/`write_uncertain` 停止,先只读回查(detail/summary),不自动重放。
|
|
23
|
+
7. Apply 被重复执行时按句柄状态分流(**不要一看到"用过"就重跑 Prepare**):
|
|
24
|
+
- `ok:true` + `data.status = "ALREADY_APPLIED"`:该 `context` 上一次**已经保存成功**,本次没有重复写入——按返回值里的 `requestId` / `previousResult` 汇报即可;
|
|
25
|
+
- `partial`/`write_uncertain`:上一次已经发出保存请求、结果未确认——先只读回查流程表单确认是否已生效,确认没生效才重跑 Prepare;
|
|
26
|
+
- `validation/continuation_busy`:句柄正被另一次执行占用、上一次还没发出写入——**稍后原样重试同一条命令**即可;
|
|
27
|
+
- `validation/continuation_consumed`:占用该句柄的执行停在无法判定的旧状态——先只读回查确认,再决定是否重跑 Prepare。
|
|
28
|
+
|
|
29
|
+
## 输入
|
|
30
|
+
|
|
31
|
+
### workflow.editLoad
|
|
32
|
+
|
|
33
|
+
- `requestId`(string|integer,必填):流程请求 ID,来自 workflow-search/detail 的 `requestId`。
|
|
34
|
+
|
|
35
|
+
### workflow.editPrepare
|
|
36
|
+
|
|
37
|
+
- `context`(string,必填,minLength 1):复用 editLoad 返回的 `context`;prepare/apply 同一值,原样回传,禁止手工构造/修改/复用他处。
|
|
38
|
+
- `data`(object,必填):要修改的字段值,结构 `{"main":{...},"details":{"<subFormId>":[{...}]}}`。
|
|
39
|
+
|
|
40
|
+
### workflow.editApply
|
|
41
|
+
|
|
42
|
+
- `context`(string,必填):复用 editPrepare 的 `context` 原样回传。
|
|
43
|
+
- `confirm`(const true,必填):声明用户已明确确认保存。
|
|
44
|
+
|
|
45
|
+
## 示例
|
|
46
|
+
|
|
47
|
+
### ① 加载流程表单当前值
|
|
48
|
+
|
|
49
|
+
Windows PowerShell:
|
|
50
|
+
|
|
51
|
+
```powershell
|
|
52
|
+
weaver-work-cli --json workflow run workflow.editLoad --input-json '{"requestId":"1307945196792242242"}'
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
macOS/Linux(bash/zsh):
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
weaver-work-cli --json workflow run workflow.editLoad --input-json '{"requestId":"1307945196792242242"}'
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### ② 修改字段(触发字段联动)
|
|
62
|
+
|
|
63
|
+
Windows PowerShell:
|
|
64
|
+
|
|
65
|
+
```powershell
|
|
66
|
+
weaver-work-cli --json workflow run workflow.editPrepare --input-json '{"context":"<editLoad返回的context>","data":{"main":{"报销事由":"客户约谈"}}}'
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
macOS/Linux(bash/zsh):
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
weaver-work-cli --json workflow run workflow.editPrepare --input-json '{"context":"<editLoad返回的context>","data":{"main":{"报销事由":"客户约谈"}}}'
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### ③ 保存(仅保存表单,不提交)
|
|
76
|
+
|
|
77
|
+
Windows PowerShell:
|
|
78
|
+
|
|
79
|
+
```powershell
|
|
80
|
+
weaver-work-cli --json workflow run workflow.editApply --input-json '{"context":"<同一context>","confirm":true}'
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
macOS/Linux(bash/zsh):
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
weaver-work-cli --json workflow run workflow.editApply --input-json '{"context":"<同一context>","confirm":true}'
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## 返回
|
|
90
|
+
|
|
91
|
+
- editLoad:`context`、`EDIT_READY`、`editableFields`(可编辑且可见字段 id)、`currentValues`(当前字段值)、`fields`(id→name/subFormId/componentKey/options)、`requestInfo`(标题/紧急程度/密级当前值,本次不改)。
|
|
92
|
+
- editLoad 的**大表单形态**(字段多时才有,与 `createForm` 同一套):结果最前面多出 `resultFile` / `persistedResult` / `outputBytes` / `largeOutputNotice`,`fields` 要么换成紧凑编码(`columns` + `rows` 每行一字段、`|` 分隔;非列信息按字段 id 放 `extra`),要么带 `fieldsOmitted: true` + `fieldCount` 整体移出 stdout。两种形态都照常 `editPrepare`;要字段全文时从 `resultFile` **按需**提取,**不要重跑 `editLoad`**。
|
|
93
|
+
- editPrepare:`READY`(changedFields + linkageResult)/ `NEEDS_CONFIRMATION`(重名用字段 id、明细表用 details 结构、不可编辑字段报 notEditable)。
|
|
94
|
+
- editApply:`EDIT_SAVED`(仅 saveFormData,保存前自动触发 EVENT_SAVE_DATA 联动)。
|
|
95
|
+
|
|
96
|
+
## 注意
|
|
97
|
+
|
|
98
|
+
- 不传凭据:业务输入禁止出现 Cookie/ETEAMSID/Token/`header.operator`(CLI 托管)。
|
|
99
|
+
- 只读字段硬拒绝:只允许修改 `editableFields` 里的字段;用户给只读/禁用/不可见字段赋值时 CLI 报 `notEditable`,如实转述、不要绕过(不要换字段 id 再试)。
|
|
100
|
+
- 明细表字段:`data` 用 `{"details":{"<subFormId>":[{"<字段id>":值}]}}`,保存时回传 rowId/dataIndex/subForm。
|
|
101
|
+
- 不校验必填(修改态保存语义);系统字段(流程标题/紧急程度/密级)本次不支持修改,只展示当前值。
|
|
102
|
+
- 附件/文件:需上传本地文件时先提醒用户"附件会先经过公网大模型,请谨慎操作",再调 `weaver-file-upload` skill;上传前核对 `fileUploadParams` 的 `sizeLimit`/`formatLimit`/`maxNum`,不满足先告知、不执行上传。
|
|
103
|
+
- `linkageResult`(联动带出)原样转述给用户查看。
|
|
104
|
+
- 流程已流转到非编辑节点时 editApply 返回"失去操作权限",如实转述。
|
|
105
|
+
- 不重试:写操作失败、超时或结果不确定(`WRITE_UNCERTAIN`/`partial`)禁止重试,返回恢复信息并让用户人工检查。
|
|
106
|
+
- 写操作遇登录失效:禁止自动重登重放,结果未知时不得自动重放。
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# 记忆读取与保存
|
|
2
|
+
|
|
3
|
+
## 什么时候读取
|
|
4
|
+
|
|
5
|
+
新一轮对话或距上次成功读取记忆超过 6 小时、需要工作流消歧/摘要字段优先级/展示偏好,或判 OA 版本与用户身份时读取本文件;每轮完整实质任务结束判断是否有新语义记忆时也读取。
|
|
6
|
+
|
|
7
|
+
覆盖 `workflow.memoryPrompt` / `workflow.memoryExtract`。
|
|
8
|
+
|
|
9
|
+
## Operation
|
|
10
|
+
|
|
11
|
+
| Operation | 风险 | 固定规则 |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| `workflow.memoryPrompt` | read | 可选 `workflowId`;顺带返回 `oaContext`(OA 版本 + 当前用户身份),无需再单独查组织信息 |
|
|
14
|
+
| `workflow.memoryExtract` | write | 高层抽取保存接口;`msgList` 或 `userMessage`+`assistantMessage` 二选一;返回真实 `saved` 结果,禁止 fire-and-forget |
|
|
15
|
+
|
|
16
|
+
## 输入
|
|
17
|
+
|
|
18
|
+
### workflow.memoryPrompt
|
|
19
|
+
|
|
20
|
+
- `workflowId`(string,可选):工作流维度记忆的 workflowId;不传读全局记忆。
|
|
21
|
+
|
|
22
|
+
### workflow.memoryExtract
|
|
23
|
+
|
|
24
|
+
- `msgList`(array,可选):记忆消息数组,每项 `{"msgRole":"user"|"assistant","msgValue":"..."}`。
|
|
25
|
+
- `userMessage`(array of string,可选):用户消息列表,与 `msgList` 二选一。
|
|
26
|
+
- `assistantMessage`(array of string,可选):模型消息列表,与 `msgList` 二选一。
|
|
27
|
+
- `dynamicContext`(object,可选):动态上下文参数(合并进 dynamicContextParams)。
|
|
28
|
+
- `workflowId`(string,可选):关联工作流 ID;已确定具体 workflowId 时放入,抽取会落到该工作流维度。**保存「业务别名 → 工作流」映射时,ID 还必须同时写进 `msgValue` 的事实句,不要只依赖这个入参**——实测:别名条目的 `workflowId` 仍是「(待确认)」时,带 `workflowId` 的调用并没有把它补上。
|
|
29
|
+
- `memoryAppId`(string,可选):记忆应用 ID。
|
|
30
|
+
- `async`(boolean,可选):语义为同步发送并返回真实结果(禁止 fire-and-forget)。
|
|
31
|
+
|
|
32
|
+
## 示例
|
|
33
|
+
|
|
34
|
+
### 读取用户记忆(全局)
|
|
35
|
+
|
|
36
|
+
Windows PowerShell:
|
|
37
|
+
|
|
38
|
+
```powershell
|
|
39
|
+
weaver-work-cli --json workflow run workflow.memoryPrompt --input-json '{}'
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
macOS/Linux(bash/zsh):
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
weaver-work-cli --json workflow run workflow.memoryPrompt --input-json '{}'
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 读取某工作流维度记忆
|
|
49
|
+
|
|
50
|
+
Windows PowerShell:
|
|
51
|
+
|
|
52
|
+
```powershell
|
|
53
|
+
weaver-work-cli --json workflow run workflow.memoryPrompt --input-json '{"workflowId":"100003460000000060"}'
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
macOS/Linux(bash/zsh):
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
weaver-work-cli --json workflow run workflow.memoryPrompt --input-json '{"workflowId":"100003460000000060"}'
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 保存工作流澄清映射(同步返回真实结果)
|
|
63
|
+
|
|
64
|
+
Windows PowerShell(用 UTF-8 文件传入消息列表):
|
|
65
|
+
|
|
66
|
+
```powershell
|
|
67
|
+
Set-Content -Encoding utf8 -LiteralPath .\mem-extract.json -Value @'
|
|
68
|
+
{
|
|
69
|
+
"msgList": [
|
|
70
|
+
{"msgRole":"user","msgValue":"我本月发起的报销流程怎么样了"},
|
|
71
|
+
{"msgRole":"assistant","msgValue":"匹配到多个报销相关工作流,请确认要查看哪一个。"},
|
|
72
|
+
{"msgRole":"user","msgValue":"5"}
|
|
73
|
+
],
|
|
74
|
+
"workflowId": "100003460000000060",
|
|
75
|
+
"async": true
|
|
76
|
+
}
|
|
77
|
+
'@
|
|
78
|
+
weaver-work-cli --json workflow run workflow.memoryExtract --input .\mem-extract.json
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
macOS/Linux(bash/zsh):
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
cat > ./mem-extract.json <<'JSON'
|
|
85
|
+
{
|
|
86
|
+
"msgList": [
|
|
87
|
+
{"msgRole":"user","msgValue":"我本月发起的报销流程怎么样了"},
|
|
88
|
+
{"msgRole":"assistant","msgValue":"匹配到多个报销相关工作流,请确认要查看哪一个。"},
|
|
89
|
+
{"msgRole":"user","msgValue":"5"}
|
|
90
|
+
],
|
|
91
|
+
"workflowId": "100003460000000060",
|
|
92
|
+
"async": true
|
|
93
|
+
}
|
|
94
|
+
JSON
|
|
95
|
+
weaver-work-cli --json workflow run workflow.memoryExtract --input ./mem-extract.json
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## 返回
|
|
99
|
+
|
|
100
|
+
- memoryPrompt:`available`、记忆提示词、`oaContext`(可能缺失)。
|
|
101
|
+
- `oaContext.version`:OA 版本(如 `10.0.9909.01`),判版本场景直接用;缺失时按低版本处理。
|
|
102
|
+
- `oaContext.user.position`:岗位;`oaContext.user.department`:部门;`oaContext.user.subcompany`:分部(可能为空,为空忽略);`oaContext.user.employeeId`:用户标识。
|
|
103
|
+
- `oaContext` 取不到时为 `null` 并带 `oaContextMissing: true`,不影响记忆主体。
|
|
104
|
+
- memoryExtract:`saved`(true/false 真实结果)。
|
|
105
|
+
|
|
106
|
+
## 记忆规则(保存时机与处理)
|
|
107
|
+
|
|
108
|
+
每轮完整实质任务结束后(输出最终回复前),模型自行判断本轮是否出现**新的、有价值的语义记忆**(用户新澄清/确认了具体工作流、本次新表达字段偏好,或对某字段值有新约定;与已有记忆重复的不算):
|
|
109
|
+
|
|
110
|
+
- **有** → 组装本轮"用户原始意图 + 澄清过程 + 确认结果"的消息列表并调用 `workflow.memoryExtract`(同步,`async` 语义为返回真实结果):
|
|
111
|
+
- `saved:true` → 用自然语言告知用户会记住什么(如"后续发起请假流程会默认按本次偏好填写"),不展示接口原文;
|
|
112
|
+
- `saved:false` → 按静默失败处理,不告知用户、不重试,直接继续回答。
|
|
113
|
+
- **没有** → 不调用,直接输出最终回复。
|
|
114
|
+
|
|
115
|
+
**硬禁令(必须遵守)**:
|
|
116
|
+
|
|
117
|
+
- **不允许只在思考中写"保存记忆"**:判断"有"后必须**实际调用** `workflow.memoryExtract` 命令,命令完成(拿到真实 `saved`)后再输出最终回复。只在思考/内心说"应该保存"而不执行命令 = 没保存,属于违规。
|
|
118
|
+
- **`workflow.createApply` 成功后命令不会自动保存记忆**:发起流程的语义记忆(本次发起的工作流与关键字段偏好)**由模型在任务结束后主动调用 `workflow.memoryExtract` 保存**,不要假设命令已自动保存。
|
|
119
|
+
- **别名条目的 `workflowId` 是「(待确认)」时,它是一张待办不是终态**:本轮只要把该别名唯一解析出了 `workflowId`(**`cards[].workflowId`** 或 `countDetails[].workflowId` 里就有),任务结束时**必须再保存一次把 ID 补上**,不要放着不管——否则下一轮读到的还是「(待确认)」,只能拿纯名称去试探,多命中还要再澄清一次。
|
|
120
|
+
|
|
121
|
+
消息列表由模型在本地组装并作为入参传入(`msgList` 或 `userMessage`+`assistantMessage`);可含多轮原始消息(尤其澄清链路),可精简无用消息(命令执行日志、大段接口原始返回、调试输出),不需要模型提前总结。
|
|
122
|
+
|
|
123
|
+
记不清字段结构时回读本文档,只用 schema 真实存在的字段名。已确定 workflowId 时放入 `workflowId`(一次调用即可,不要 global/workflow 两次请求);**保存别名映射时把 ID 同时写进 `msgValue` 事实句**——写漏了就会留下「(待确认)」,而「(待确认)」是**待办不是终态**:后续任一轮只要把该别名唯一解析出 ID,就要再保存一次把它补掉。
|
|
124
|
+
|
|
125
|
+
**别名映射的保存口径(不要写漏 ID)**:`msgList` 每项的字段名固定为 `msgRole` / `msgValue`(不要写成 `role` / `content`);保存「业务别名 → 工作流」时,`msgValue` 里要写成可抽取的事实句,例如 `业务别名"问题流程"= 工作流"E10客户问题支持解决流程",workflowId=1003655203465764898`,并把同一个 ID 放进入参 `workflowId`。
|
|
126
|
+
|
|
127
|
+
**ID 从哪来(写记忆前必须回看本轮返回)**:别名条目的 `workflowId` 只能来自本轮命令返回,**不要凭名称推断、也不要因为"没看到 ID"就留空**:
|
|
128
|
+
|
|
129
|
+
| 场景 | 取 ID 的位置 |
|
|
130
|
+
| --- | --- |
|
|
131
|
+
| `workflow.search` / plan 查到流程(**含用户只澄清了工作流名称、CLI 内部唯一匹配成功那一轮**) | `cards[].workflowId` / `cards[].workflowName`(V12.1.37 起是**唯一**的结构化取 ID 通道) |
|
|
132
|
+
| `workflow.createList` 选定/候选过工作流 | 候选对象的 `id` / `workflowname` |
|
|
133
|
+
| `workflow.todoStat` 统计过 | `countDetails[].workflowId` |
|
|
134
|
+
|
|
135
|
+
> `finalMarkdown` 按契约**不渲染工作流名、更不含 ID**,所以上面三个结构化字段是 ID 的**唯一出处**;"最终以 `finalMarkdown` 为准"指的是**渲染呈现**,不是让你只读 `finalMarkdown`。
|
|
136
|
+
|
|
137
|
+
## 三类记忆职责(保存时按维度选 `workflowId`)
|
|
138
|
+
|
|
139
|
+
- **user.md**(用户画像):稳定身份信息、展示偏好、协作方式、沟通风格、通用风险确认偏好。**适合**:不展示 requestId、不输出统计区块、中文简洁回复、异常直接停止。**不适合**:workflowId、fieldId、工作流审批规则、业务别名到工作流映射。
|
|
140
|
+
- **memory.md**(长期记忆):跨项目稳定事实、经验教训、通用工作流、工具配置、反复出现的规律。**适合**:业务别名与工作流消歧、跨流程优先级规律、通用查询经验、接口使用教训。**不适合**:单个工作流关注字段、单个工作流审批规则、用户沟通风格。
|
|
141
|
+
- **workflow:{workflowId}**(工作流维度):单工作流专项记忆。**适合**:该工作流常用别名、关注字段、摘要偏好、优先级与处理节奏、审批规则、风险提醒。**不适合**:其他工作流规则、全局用户画像、临时 requestId。
|
|
142
|
+
|
|
143
|
+
## 记忆消费方式(影响哪些行为)
|
|
144
|
+
|
|
145
|
+
记忆可用于:
|
|
146
|
+
|
|
147
|
+
- **业务别名与工作流消歧**:把用户的口语简称落到具体工作流(落到 `workflowId` 后,查询时直接用 `名称(ID)` 传 `workflow`,不要再用纯名称试探)。
|
|
148
|
+
- **每页条数偏好**:用于列表查询的 `pageSize`;**本次用户明确指定的条数优先于记忆偏好**。
|
|
149
|
+
- **紧急/超时流程优先展示**、详情摘要关注字段、已确认的审批建议规则、展示/确认/异常处理偏好。
|
|
150
|
+
|
|
151
|
+
记忆影响了本轮决策时(工作流消歧、摘要字段优先级、审批建议、每页条数、紧急超时优先展示),最终回复**不要展示记忆原文**,但必须保留自然语言说明依据了哪类历史偏好(如"我按你之前确认的偏好,把报销优先理解为总部费用报销。")。
|
|
152
|
+
|
|
153
|
+
记忆**不能**用于:猜测当前系统元数据(工作流 ID/字段/节点元数据必须来自当前链路解析)、替代 `index` 序号映射定位、绕过操作门禁(`canSubmitRejectTransfer` 等)、仅凭记忆自动执行审批(记忆只能生成建议,执行以用户本轮明确指示为准)。
|
|
154
|
+
|
|
155
|
+
## 注意
|
|
156
|
+
|
|
157
|
+
- 不传凭据:业务输入禁止出现 Cookie/ETEAMSID/Token/`header.operator`(CLI 托管)。
|
|
158
|
+
- 读取时机:本轮已成功读取(`available=true`)直接复用,不重复调用;距上次成功读取超过 6 小时才重读。
|
|
159
|
+
- 记忆读取失败(`available=false`、CLI 失败信封、无可用提示词)→ 静默忽略,不告诉用户、不重试、不中断主任务。
|
|
160
|
+
- `memoryNotSupported=true` → 当前环境不支持记忆,本会话跳过记忆读取/保存,不追问。
|
|
161
|
+
- `available=false` 时可看 `diagnosis`(`code`/`status`/`fail`/`dataEmpty`)了解失败环节,但**不要向用户展示、不要重试**。
|
|
162
|
+
- 记忆与当前系统解析结果冲突时以当前系统为准(流程改名/ID 变更/环境切换不套用过期记忆标签)。
|
|
163
|
+
- 记忆不能用于猜测当前系统元数据、替代定位索引、绕过操作门禁或仅凭记忆自动执行审批(记忆只生成建议,执行以用户本轮明确指示为准)。
|
|
164
|
+
- `async` 为同步发送并返回真实 `saved` 结果,禁止 fire-and-forget(不得调用后不等结果)。
|
|
165
|
+
- 记忆可用于:业务别名与工作流消歧、每页条数/紧急超时优先展示、详情摘要关注字段、已确认审批建议、展示/确认/异常处理偏好。
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# 单条流程操作(workflow.operatePrepare / workflow.operateApply)
|
|
2
|
+
|
|
3
|
+
## 什么时候读取
|
|
4
|
+
|
|
5
|
+
用户要对**单条**流程执行同意 / 提交 / 退回 / 转办 / 委托 / 转发 / 抄送 / 加审 / 强制收回 / 强制结束 / 意见征询 / 删除 / 催办时读取本文件。
|
|
6
|
+
|
|
7
|
+
## Operation
|
|
8
|
+
|
|
9
|
+
| Operation | 风险 | 固定规则 |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| `workflow.operatePrepare` | read-before-write | 只解析定位、接收人名称转 ID、预览,不写入;产出 continuation |
|
|
12
|
+
| `workflow.operateApply` | high-risk-write | 必须 `confirm: true` 且携带 `operatePrepare` 的 continuation |
|
|
13
|
+
|
|
14
|
+
## 确认链
|
|
15
|
+
|
|
16
|
+
1. `operatePrepare` → 向用户摘要目标 `requestId` / `action` / 接收人 / 意见 / 删除或强制类不可逆风险。
|
|
17
|
+
2. 等用户**明确确认**。
|
|
18
|
+
3. `operateApply` 带 `confirm: true` 与 `continuation`(`action` 必须与 Prepare 一致且必填),由 CLI 真正提交。
|
|
19
|
+
4. 返回 `partial/write_uncertain` 时**立即停止**,先做只读回查确认流程状态,**禁止自动重放** `apply`。
|
|
20
|
+
|
|
21
|
+
## 输入
|
|
22
|
+
|
|
23
|
+
- `requestId`(`string` / `integer`,仅数字)或 `group` + `index` 定位流程;`requestId` 必须来自查询索引,模型不能自己编。
|
|
24
|
+
- `action`:必填,枚举见下方对照表。
|
|
25
|
+
- `opinion`:签字 / 操作意见(同意 / 退回 / 强制结束 / 意见征询 / 催办等使用)。
|
|
26
|
+
- `receiverName`:接收人类动作(transfer / turnTodo / forward / cc / addreview / consul)接收人名称,逗号分隔,支持 `"名称(ID)"`。
|
|
27
|
+
- `agent`:`delegate` 代理人用户 ID。
|
|
28
|
+
- `rejectType`:`reject` 退回类型 `0` 自由 / `1` 逐级 / `2` 指定范围 / `3` 按出口。
|
|
29
|
+
- `nodeid`:`reject` 退回目标节点 ID。
|
|
30
|
+
- `deleteType`:`deleteRequest` 删除方式 `0` 回收站(默认)/ `1` 彻底删除。
|
|
31
|
+
- `otherParamJson`:附加参数 JSON 字符串(`forceDrawBack` / `forceOver` / `consul` 的 otherParam / otherParams)。
|
|
32
|
+
- `continuation`(仅 Apply):Prepare 返回的短句柄(形如 `wc-1a2b3c4d5e6f7a8b`),载荷由 CLI 托管在本机状态目录;Agent 只原样回传,禁止解析、手工构造、修改或复用。
|
|
33
|
+
- `confirm`(仅 Apply):固定为 `true`。
|
|
34
|
+
|
|
35
|
+
## action 取值对照表(按用户原话选,不靠英文名猜)
|
|
36
|
+
|
|
37
|
+
| 用户说法 | `action` 值 | 语义 | 附加输入 |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
|
+
| 同意 / 批准 / 通过 | `agree` | 同意审批 | `opinion` |
|
|
40
|
+
| 提交 | `submit` | 提交 / 同意审批 | `opinion` |
|
|
41
|
+
| 退回 / 驳回 / 打回 | `reject` | 退回流程 | `opinion`、`rejectType`、`nodeid` |
|
|
42
|
+
| 返回 / 回退 | `return` | 返回 | `opinion` |
|
|
43
|
+
| 转办(把流程转给某人处理) | `turnTodo` | 处理权转移给接收人 | `receiverName` |
|
|
44
|
+
| 转发(把流程转发给某人看 / 知会) | `forward` | 转发分享给接收人 | `receiverName` |
|
|
45
|
+
| 委托 / 代理人 | `delegate` | 委托代理人处理 | `agent` |
|
|
46
|
+
| 抄送 / 知会 | `cc` | 抄送给接收人 | `receiverName` |
|
|
47
|
+
| 加审 / 加签 | `addreview` | 加会审人 | `receiverName` |
|
|
48
|
+
| 强制收回 | `forceDrawBack` | 强制收回流程 | `opinion`(可选),监控权限 `otherParamJson` |
|
|
49
|
+
| 强制结束 | `forceOver` | 强制结束流程 | `opinion`,监控权限 `otherParamJson` |
|
|
50
|
+
| 意见征询 | `consul` | 发起意见征询给接收人 | `opinion`、`receiverName`,限时 `otherParamJson` |
|
|
51
|
+
| 删除流程 | `deleteRequest` | 删除流程 | `deleteType`(0 回收站默认;1 彻底删除) |
|
|
52
|
+
| 催办 | `supervise` | 催办流程 | `opinion`;默认提醒当前审批人,自定义提醒对象用 `otherParamJson`(`messageRemind`/`emailRemind`/`otherReminder`/`currentOperator`/`doneOperator`/`submitOperator`/`ccOperator`) |
|
|
53
|
+
| (schema 枚举含 `transfer`) | `transfer` | schema 枚举含此值,但 schema 描述未说明语义;按用户原话选,不臆造含义 | 视具体业务 |
|
|
54
|
+
|
|
55
|
+
说明:用户说"转发 / 转发给 X" → `forward`;说"转办 / 转给 X 处理 / 交给 X 办" → `turnTodo`。按用户原话字面选,不替换、不试错。**action 必须查表确定后再执行,禁止用试错方式探索 action 值。**
|
|
56
|
+
|
|
57
|
+
## 定位与门禁
|
|
58
|
+
|
|
59
|
+
- 单条操作按 `requestId`(或 `group` + `index`)解析目标流程,并检查流程的 `canSubmitRejectTransfer` 操作权限——**权限不足时 CLI 直接拒绝该操作,不要绕过、不要换 action 试探**(意见征询类的提交自动放行走征询回复)。
|
|
60
|
+
- `receiverName` 类动作(`turnTodo`/`forward`/`cc`/`addreview`/`transfer`/`consul`)的接收人必须是用户 ID;用户给姓名时交给 CLI 内部转换(多命中会报错并在 `error.message` 列出候选,见「注意」)。
|
|
61
|
+
- 目标来自列表序号时,**序号必须是最近一次查询的结果**(`index` 基于会话序号映射),禁止凭记忆或猜测填序号。
|
|
62
|
+
|
|
63
|
+
## 示例
|
|
64
|
+
|
|
65
|
+
### 同意审批
|
|
66
|
+
|
|
67
|
+
Windows PowerShell:
|
|
68
|
+
|
|
69
|
+
```powershell
|
|
70
|
+
weaver-work-cli --json workflow run workflow.operatePrepare --input-json '{"requestId":"1307945196792242242","action":"agree","opinion":"同意"}'
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
macOS/Linux(bash/zsh):
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
weaver-work-cli --json workflow run workflow.operatePrepare --input-json '{"requestId":"1307945196792242242","action":"agree","opinion":"同意"}'
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
确认后提交:
|
|
80
|
+
|
|
81
|
+
Windows PowerShell:
|
|
82
|
+
|
|
83
|
+
```powershell
|
|
84
|
+
weaver-work-cli --json workflow run workflow.operateApply --input-json '{"action":"agree","confirm":true,"continuation":"<operatePrepare 返回的句柄,形如 wc-1a2b3c4d5e6f7a8b>"}'
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
macOS/Linux(bash/zsh):
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
weaver-work-cli --json workflow run workflow.operateApply --input-json '{"action":"agree","confirm":true,"continuation":"<operatePrepare 返回的句柄,形如 wc-1a2b3c4d5e6f7a8b>"}'
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 转办给某人(姓名自动转 ID)
|
|
94
|
+
|
|
95
|
+
Windows PowerShell:
|
|
96
|
+
|
|
97
|
+
```powershell
|
|
98
|
+
weaver-work-cli --json workflow run workflow.operatePrepare --input-json '{"requestId":"1307945196792242242","action":"turnTodo","receiverName":"张三"}'
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
macOS/Linux(bash/zsh):
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
weaver-work-cli --json workflow run workflow.operatePrepare --input-json '{"requestId":"1307945196792242242","action":"turnTodo","receiverName":"张三"}'
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### 强制结束
|
|
108
|
+
|
|
109
|
+
Windows PowerShell:
|
|
110
|
+
|
|
111
|
+
```powershell
|
|
112
|
+
weaver-work-cli --json workflow run workflow.operatePrepare --input-json '{"requestId":"1307945196792242242","action":"forceOver","opinion":"业务终止","otherParamJson":"{\"ismonitor\":\"1\"}"}'
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
macOS/Linux(bash/zsh):
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
weaver-work-cli --json workflow run workflow.operatePrepare --input-json '{"requestId":"1307945196792242242","action":"forceOver","opinion":"业务终止","otherParamJson":"{\"ismonitor\":\"1\"}"}'
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 删除流程到回收站
|
|
122
|
+
|
|
123
|
+
Windows PowerShell:
|
|
124
|
+
|
|
125
|
+
```powershell
|
|
126
|
+
weaver-work-cli --json workflow run workflow.operatePrepare --input-json '{"requestId":"1307945196792242242","action":"deleteRequest","deleteType":"0"}'
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
macOS/Linux(bash/zsh):
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
weaver-work-cli --json workflow run workflow.operatePrepare --input-json '{"requestId":"1307945196792242242","action":"deleteRequest","deleteType":"0"}'
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## 返回
|
|
136
|
+
|
|
137
|
+
- `operatePrepare` 返回定位结果、接收人名称解析、操作预览与 `continuation`;不写入。
|
|
138
|
+
- `operateApply` 返回操作结果;网络中断 / 结果不确定时返回 `partial/write_uncertain`。
|
|
139
|
+
- **结果展示**:单条操作结果简洁说明动作、流程名称、状态和接口消息,不展示 `requestId`,除非用户明确要求技术定位信息。
|
|
140
|
+
- 按退出码 / `error.type` / `error.subtype` / `error.message` 判断成败,不盲目重试。
|
|
141
|
+
|
|
142
|
+
## 注意
|
|
143
|
+
|
|
144
|
+
- `deleteRequest`(删除流程)不可恢复,执行前必须明确告知用户不可逆影响并征得确认。
|
|
145
|
+
- 接收人名称由 CLI 调人员浏览器解析:**多命中**报 `receiver_ambiguous`(`error.message` 说明需回传 `"名称(ID)"`)、**0 命中**报 `receiver_not_found`——CLI **不会静默取第一个**。用户确认后按 `"名称(ID)"` 回传,其余已确认的接收人按同样格式一并带上(逗号分隔)。
|
|
146
|
+
- 失败一律看 **stderr** 的 `{ok:false, error:{type, subtype, message, retryable}}`(**没有** `success`/`stopReason`/`userMessage` 字段);`error.message` 原样转述,不自行改写或补造结果。
|
|
147
|
+
- `continuation` 是 CLI 托管的短句柄(形如 `wc-1a2b3c4d5e6f7a8b`),Agent 只原样回传,禁止解析、手工构造、修改或复用;`confirm` 必须且只能为 `true`。
|
|
148
|
+
- Apply 被重复执行、且上一次已经成功时,返回 `ok:true` + `data.status = "ALREADY_APPLIED"`(含 `previousResult`;若上一次是"服务端已成功回执、只是没来得及写回结果",还会给出 `requestId`)——**这不是失败**,本次没有重复写入,按上一次结果汇报即可,不要重跑 Prepare。
|
|
149
|
+
- Apply 报 `validation/continuation_busy` 时,说明句柄正被另一次执行占用、**上一次还没发出任何写入**:**稍后原样重试同一条命令**即可,不必重跑 Prepare、也不要换句柄。
|
|
150
|
+
- Apply 报 `validation/continuation_consumed` 时,说明占用该句柄的那次执行停在无法判定的旧状态:先只读核对目标流程是否已生效,确认没生效才重跑 Prepare。
|
|
151
|
+
- 写操作遇登录失效 / 超时 / 断连,CLI 返回 `partial/write_uncertain`(对应原 operation_unknown);**禁止自动重放**,必须先做只读回查确认流程状态,不得重复提交。
|
|
152
|
+
- 同一操作连续 2 次失败必须停止,不得第 3 次重试。
|
|
153
|
+
- 不写任何凭据(Cookie / ETEAMSID / Token / 操作员标识由 CLI 托管)。
|