weaver-work-cli 0.1.25 → 0.1.28
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 +35 -30
- package/dist/cmd/root.js +1 -0
- package/dist/cmd/setup/index.js +1 -1
- package/dist/core/runtime-agent.js +19 -0
- package/dist/internal/e10/auth/commands.js +48 -33
- package/dist/internal/e10/auth/messages.js +3 -0
- package/dist/internal/e10/auth/session.js +8 -0
- package/dist/internal/e10/auth/xiaoe.js +62 -43
- package/dist/internal/e10/auth-recovery.js +148 -0
- package/dist/internal/e10/client.js +47 -15
- package/dist/internal/e10/context.js +9 -31
- package/dist/internal/e10/index.js +1 -0
- package/dist/internal/e10/request-runtime.js +51 -9
- package/dist/shortcuts/archive/host.js +3 -2
- package/dist/shortcuts/archive/manifest.js +1 -1
- package/dist/shortcuts/archive-oa/constants.js +66 -0
- package/dist/shortcuts/archive-oa/continuation.js +70 -0
- package/dist/shortcuts/archive-oa/errors.js +53 -0
- package/dist/shortcuts/archive-oa/host.js +158 -0
- package/dist/shortcuts/archive-oa/index.js +225 -0
- package/dist/shortcuts/archive-oa/manifest.js +62 -0
- package/dist/shortcuts/archive-oa/operations/borrow-car.js +159 -0
- package/dist/shortcuts/archive-oa/operations/borrow-url.js +108 -0
- package/dist/shortcuts/archive-oa/operations/confirm.js +48 -0
- package/dist/shortcuts/archive-oa/operations/contract.js +120 -0
- package/dist/shortcuts/archive-oa/operations/locate.js +50 -0
- package/dist/shortcuts/archive-oa/operations/registry.js +40 -0
- package/dist/shortcuts/archive-oa/operations/shared.js +181 -0
- package/dist/shortcuts/archive-oa/operations/types.js +45 -0
- package/dist/shortcuts/archive-oa/operations.js +13 -0
- package/dist/shortcuts/asset/host.js +7 -6
- package/dist/shortcuts/blog/host.js +4 -3
- package/dist/shortcuts/caizhilian/host.js +3 -2
- package/dist/shortcuts/caizhilian/manifest.js +1 -1
- package/dist/shortcuts/calendar/host.js +2 -1
- package/dist/shortcuts/contract/host.js +34 -59
- package/dist/shortcuts/ehr/host.js +2 -1
- package/dist/shortcuts/esb/host.js +2 -1
- package/dist/shortcuts/fna/host.js +6 -3
- package/dist/shortcuts/fna/manifest.js +10 -5
- package/dist/shortcuts/fna/operations/expense-chart.js +162 -0
- package/dist/shortcuts/fna/operations/registry.js +2 -0
- package/dist/shortcuts/hrm/host.js +2 -1
- package/dist/shortcuts/im/host.js +3 -2
- package/dist/shortcuts/index.js +2 -0
- package/dist/shortcuts/invoice/host.js +9 -7
- package/dist/shortcuts/invoice/manifest.js +38 -47
- package/dist/shortcuts/invoice/operations/issuing-qys.js +328 -0
- package/dist/shortcuts/invoice/operations/registry.js +2 -3
- package/dist/shortcuts/jiuchuanhui/host.js +2 -1
- package/dist/shortcuts/mail/host.js +2 -1
- package/dist/shortcuts/meeting/host.js +2 -1
- package/dist/shortcuts/meeting/operations/eb/conflict.js +78 -12
- package/dist/shortcuts/okr/host.js +2 -1
- package/dist/shortcuts/plan/host.js +2 -1
- package/dist/shortcuts/project/host.js +2 -1
- package/dist/shortcuts/workflow/endpoints.js +11 -0
- package/dist/shortcuts/workflow/host.js +5 -7
- package/dist/shortcuts/workflow/index.js +6 -36
- package/dist/shortcuts/workflow/operations/chatscene.js +252 -0
- package/dist/shortcuts/workflow/operations/form.js +1047 -191
- package/dist/shortcuts/workflow/operations/read.js +137 -8
- package/dist/shortcuts/workflow/operations/sign-input.js +106 -0
- package/dist/shortcuts/workflow/operations/write.js +9 -1
- package/dist/shortcuts/workflow/stdout-compact.js +16 -1
- package/docs/SKILL.md +1 -1
- package/docs/_catalog.md +1 -1
- package/docs/agent-invoice.md +1 -1
- package/docs/archive-oa.md +79 -0
- package/docs/caizhilian.md +1 -1
- package/docs/e10-auth.md +7 -6
- package/docs/fna.md +7 -3
- package/docs/invoice.md +4 -6
- package/package.json +1 -1
- package/skill-template/business-info.json +20 -1
- package/skill-template/domains/archive-oa.md +19 -0
- package/skill-template/domains/caizhilian.md +2 -1
- package/skill-template/domains/qiyecheng.md +1 -0
- package/skill-template/domains/yepiaotong.md +8 -4
- package/skill-template/skill-template.md +1 -0
- package/skills/weaver-e10-archive-oa/SKILL.md +159 -0
- package/skills/weaver-e10-archive-oa/references/archive-locate.md +49 -0
- package/skills/weaver-e10-archive-oa/references/borrow-car.md +76 -0
- package/skills/weaver-e10-archive-oa/references/borrow-flow.md +53 -0
- package/skills/weaver-e10-archive-oa/references/contract-search.md +63 -0
- package/skills/weaver-e10-archive-oa/references/disabled-capabilities.md +29 -0
- package/skills/weaver-e10-archive-oa/references/qys-contract-search.md +47 -0
- package/skills/weaver-e10-archive-oa/references/source-manifest.json +400 -0
- package/skills/weaver-e10-blog/SKILL.md +6 -1
- package/skills/weaver-e10-blog/references/blog-query.md +3 -1
- package/skills/weaver-e10-builder/SKILL.md +22 -0
- package/skills/weaver-e10-caizhilian/SKILL.md +47 -16
- package/skills/weaver-e10-caizhilian/references/action-flow.md +70 -0
- package/skills/weaver-e10-caizhilian/references/agent-entry.md +12 -4
- package/skills/weaver-e10-caizhilian/references/auth-and-install.md +207 -0
- package/skills/weaver-e10-caizhilian/references/collaboration.md +5 -3
- package/skills/weaver-e10-caizhilian/references/document.md +33 -11
- package/skills/weaver-e10-caizhilian/references/file-collection.md +57 -54
- package/skills/weaver-e10-caizhilian/references/file-upload.md +5 -6
- package/skills/weaver-e10-caizhilian/references/files.md +9 -3
- package/skills/weaver-e10-caizhilian/references/folder.md +48 -16
- package/skills/weaver-e10-caizhilian/references/host-executor-prompt.md +32 -0
- package/skills/weaver-e10-caizhilian/references/host-platform-integration.md +46 -0
- package/skills/weaver-e10-caizhilian/references/rule-index.md +56 -0
- package/skills/weaver-e10-caizhilian/references/setting-attach.md +17 -54
- package/skills/weaver-e10-caizhilian/references/setting-backup.md +16 -63
- package/skills/weaver-e10-caizhilian/references/setting-encrypt.md +24 -64
- package/skills/weaver-e10-caizhilian/references/setting-storage-docs-summary.md +126 -0
- package/skills/weaver-e10-caizhilian/references/setting-storage-field-map.md +57 -0
- package/skills/weaver-e10-caizhilian/references/setting-storage.md +143 -548
- package/skills/weaver-e10-caizhilian/references/source-manifest.json +7 -7
- package/skills/weaver-e10-caizhilian/references/task-workflow.md +87 -0
- package/skills/weaver-e10-caizhilian/references/withheld.md +21 -45
- package/skills/weaver-e10-caizhilian/references/write-protocol.md +7 -0
- package/skills/weaver-e10-calendar/SKILL.md +6 -1
- package/skills/weaver-e10-esb/SKILL.md +8 -0
- package/skills/weaver-e10-esb/references/input-format.md +3 -1
- package/skills/weaver-e10-esb/references/source-manifest.json +5 -5
- package/skills/weaver-e10-hrm/SKILL.md +6 -1
- package/skills/weaver-e10-hrm/references/employee.md +1 -1
- package/skills/weaver-e10-hrm/references/org.md +1 -1
- package/skills/weaver-e10-hrm/references/position.md +1 -1
- package/skills/weaver-e10-jinchengda/SKILL.md +2 -1
- package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +1 -1
- package/skills/weaver-e10-jiuchuanhui/SKILL.md +6 -1
- package/skills/weaver-e10-jucailin/SKILL.md +6 -1
- package/skills/weaver-e10-jucailin/references/hr-contact.md +1 -1
- package/skills/weaver-e10-jucailin/references/salary.md +1 -1
- package/skills/weaver-e10-mail/SKILL.md +6 -1
- package/skills/weaver-e10-meeting/SKILL.md +11 -6
- package/skills/weaver-e10-meeting/references/meeting-eb.md +7 -3
- package/skills/weaver-e10-meeting/references/meeting-queries.md +3 -1
- package/skills/weaver-e10-meeting/references/meeting-verification.md +4 -2
- package/skills/weaver-e10-okr/SKILL.md +6 -1
- package/skills/weaver-e10-okr/references/source-manifest.json +5 -5
- package/skills/weaver-e10-plan/SKILL.md +6 -1
- package/skills/weaver-e10-plan/references/plan-overview-and-routing.md +3 -1
- package/skills/weaver-e10-plan/references/plan-report-query.md +3 -1
- package/skills/weaver-e10-plan/references/source-manifest.json +7 -7
- package/skills/weaver-e10-qiyecheng/SKILL.md +16 -6
- package/skills/weaver-e10-qiyecheng/references/catalog.md +6 -3
- package/skills/weaver-e10-qiyecheng/references/expense-center.md +2 -0
- package/skills/weaver-e10-qiyecheng/references/expense-chart.md +78 -0
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +87 -33
- package/skills/weaver-e10-shared/SKILL.md +53 -28
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +22 -20
- package/skills/weaver-e10-shared/references/non-interactive-environment.md +13 -13
- package/skills/weaver-e10-shared/references/weaver-e10-installation.md +3 -1
- package/skills/weaver-e10-wenshuding/SKILL.md +6 -1
- package/skills/weaver-e10-wenshuding/references/source-manifest.json +3 -3
- package/skills/weaver-e10-workflow/references/source-manifest.json +33 -24
- package/skills/weaver-e10-workflow/references/workflow-create.md +41 -26
- package/skills/weaver-e10-yepiaotong/SKILL.md +23 -18
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +87 -45
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-form-fill-rules.md +152 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +210 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +59 -36
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +63 -512
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +205 -346
- package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +4 -5
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +231 -344
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +5 -5
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +201 -162
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +121 -145
- package/skills/weaver-e10-yimiaoban/SKILL.md +9 -2
- package/skills/weaver-e10-yimiaoban/references/file-user-i18n.md +1 -1
- package/skills/weaver-e10-yimiaoban/references/msg-read.md +1 -1
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +9 -9
- package/skills/weaver-e10-ziguanjia/SKILL.md +6 -1
- package/dist/shortcuts/invoice/operations/issuing.js +0 -198
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-field-rules.md +0 -161
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing.md +0 -107
- package/skills/weaver-e10-yepiaotong/references/reim-fast-path.md +0 -119
|
@@ -6,27 +6,34 @@
|
|
|
6
6
|
|
|
7
7
|
## Operation
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
9
|
+
本技能负责报销的**数据准备**;报销单的**创建与修改**统一调用 `weaver-e10-workflow` 技能的发起/修改能力。
|
|
10
|
+
|
|
11
|
+
| 意图 | Operation | 所属技能 | 风险 |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| E10 fileId 转发票识别结果 | `invoice.reim.file-ocr.preview` | yepiaotong | read-with-upload |
|
|
14
|
+
| 报销候选发票分类(可报 / 已挂单 / 红冲) | `invoice.reim.candidates.list` | yepiaotong | read |
|
|
15
|
+
| 查询事前申请 | `invoice.reim.requests.list` | yepiaotong | read |
|
|
16
|
+
| 获取报销工作流 ID 与名称 | `invoice.reim.workflow.resolve` | yepiaotong | read |
|
|
17
|
+
| 获取发票明细行预填信息 | `invoice.reim.row-info` / `invoice.reim.row-info-batch` | yepiaotong | read |
|
|
18
|
+
| 取发票字段对象 | `invoice.browse-field.data` | yepiaotong | read |
|
|
19
|
+
| 获取当前人员及上级(兜底) | `invoice.reim.employee-superiors` | yepiaotong | read |
|
|
20
|
+
| 载入报销表单 | `workflow.createForm` | workflow | read |
|
|
21
|
+
| 创建报销单(固定存草稿) | `workflow.createRequest` | workflow | high-risk-write |
|
|
22
|
+
| 修改已创建的报销单 | `workflow.editLoad` / `workflow.editPrepare` / `workflow.editApply` | workflow | read / read-before-write / high-risk-write |
|
|
23
|
+
|
|
24
|
+
> workflow 侧命令的入参、返回处置以 [`../../weaver-e10-workflow/references/workflow-create.md`](../../weaver-e10-workflow/references/workflow-create.md)、[`workflow-edit.md`](../../weaver-e10-workflow/references/workflow-edit.md) 为准。`weaver-e10-workflow` 技能不可用时停止并告知用户需要安装该技能,不要改用其他方式创建报销单。
|
|
20
25
|
|
|
21
26
|
## 处理链
|
|
22
27
|
|
|
23
|
-
1. 获取发票:已有 `fid` 时可用 `invoice.get
|
|
28
|
+
1. 获取发票:已有 `fid` 时可用 `invoice.get`;已有 E10 `fileId` 时用 `invoice.reim.file-ocr.preview`;按日期批量报销用 `invoice.reim.candidates.list`(只取 `available`),按关键词/号码筛选用 `invoice.list`,默认未报销发票。
|
|
24
29
|
2. 展示发票汇总,让用户确认哪些发票进入报销。
|
|
25
30
|
3. 用 `invoice.reim.requests.list` 获取事前申请,再按时间、费用类型和标题做匹配;原始 ID、日期、金额必须逐字符保留。
|
|
26
31
|
4. 用 `invoice.reim.workflow.resolve` 得到报销工作流,必要时按工作流分组。
|
|
27
|
-
5.
|
|
28
|
-
6.
|
|
29
|
-
7. 报销单创建成功后,后续修正使用 `
|
|
32
|
+
5. 对每组并行调用 `workflow.createForm`(`workflow` 传 `{workFlowName}({workFlowId})`)、`invoice.reim.row-info-batch`、`invoice.browse-field.data`(发票 + 配对凭证的 `fid`)。
|
|
33
|
+
6. 按 [`reim-form-fill-rules.md`](reim-form-fill-rules.md) 组装 `createRequest` 的 `data`,直接调用 `workflow.createRequest` 存草稿(`action` 固定 `"draft"`,不问用户),结果原样粘贴 `finalMarkdown`。命中「话费补贴标准审批流程」或「话费报销」时,必须先读 [`reim-phone-subsidy-rules.md`](reim-phone-subsidy-rules.md),按月度标准核算实报金额,不能直接用发票金额填单。
|
|
34
|
+
7. 报销单创建成功后,后续修正使用 `workflow.editLoad` → `workflow.editPrepare` → 用户确认 → `workflow.editApply`,不要重复创建同一组发票的报销单。
|
|
35
|
+
|
|
36
|
+
完整编排见 [`reim-workflow.md`](reim-workflow.md)。
|
|
30
37
|
|
|
31
38
|
## 命令
|
|
32
39
|
|
|
@@ -44,50 +51,66 @@ macOS/Linux(bash/zsh):
|
|
|
44
51
|
weaver-work-cli --json invoice run invoice.reim.requests.list --input-json '{"pageNo":1,"pageSize":20,"requestname":"交通","cusCreateDateStart":"2026-07-01","cusCreateDateEnd":"2026-07-31"}'
|
|
45
52
|
```
|
|
46
53
|
|
|
47
|
-
|
|
54
|
+
载入报销表单(拿 `continuation` 与可写字段 `fields`):
|
|
48
55
|
|
|
49
56
|
Windows PowerShell:
|
|
50
57
|
|
|
51
58
|
```powershell
|
|
52
|
-
|
|
59
|
+
weaver-work-cli --json workflow run workflow.createForm --input-json '{"workflow":["总部费用报销(100003460000000060)"]}'
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
macOS/Linux(bash/zsh):
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
weaver-work-cli --json workflow run workflow.createForm --input-json '{"workflow":["总部费用报销(100003460000000060)"]}'
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
创建报销单:`data` 含发票对象、体积较大,先写入 UTF-8 JSON 文件再传入。
|
|
69
|
+
|
|
70
|
+
Windows PowerShell:
|
|
71
|
+
|
|
72
|
+
```powershell
|
|
73
|
+
Set-Content -Encoding utf8 -LiteralPath .\reim-create-request.json -Value @'
|
|
53
74
|
{
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
|
|
75
|
+
"context": "<createForm 返回的 continuation>",
|
|
76
|
+
"requestName": "示例7月上海交通费报销",
|
|
77
|
+
"action": "draft",
|
|
78
|
+
"data": {
|
|
79
|
+
"main": {"100003720000000088": "上海市内交通费(滴滴出行)"},
|
|
80
|
+
"details": {"100003690000000011": [{"100003720000016373": "108.2", "100003720000052200": "人民币(100001050000000001)"}]}
|
|
81
|
+
}
|
|
59
82
|
}
|
|
60
83
|
'@
|
|
61
|
-
weaver-work-cli --json
|
|
84
|
+
weaver-work-cli --json workflow run workflow.createRequest --input .\reim-create-request.json
|
|
62
85
|
```
|
|
63
86
|
|
|
64
87
|
macOS/Linux(bash/zsh):
|
|
65
88
|
|
|
66
89
|
```bash
|
|
67
|
-
cat > ./reim-create.json <<'JSON'
|
|
90
|
+
cat > ./reim-create-request.json <<'JSON'
|
|
68
91
|
{
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
|
|
92
|
+
"context": "<createForm 返回的 continuation>",
|
|
93
|
+
"requestName": "示例7月上海交通费报销",
|
|
94
|
+
"action": "draft",
|
|
95
|
+
"data": {
|
|
96
|
+
"main": {"100003720000000088": "上海市内交通费(滴滴出行)"},
|
|
97
|
+
"details": {"100003690000000011": [{"100003720000016373": "108.2", "100003720000052200": "人民币(100001050000000001)"}]}
|
|
98
|
+
}
|
|
74
99
|
}
|
|
75
100
|
JSON
|
|
76
|
-
weaver-work-cli --json
|
|
101
|
+
weaver-work-cli --json workflow run workflow.createRequest --input ./reim-create-request.json
|
|
77
102
|
```
|
|
78
103
|
|
|
79
|
-
|
|
104
|
+
示例里的字段 id 来自「总部费用报销」,实际一律以本次 `createForm` 返回的 `fields` 为准;明细行的「相关发票」「相关凭证」要放 `invoice.browse-field.data` 返回的发票对象数组。
|
|
80
105
|
|
|
81
106
|
## 输出处理
|
|
82
107
|
|
|
83
|
-
`
|
|
84
|
-
|
|
85
|
-
`invoice.reim.flow.update.apply` 若服务端返回删除或更新部分失败,CLI 会按 `partial/write_uncertain` 报告,Agent 不要继续连环重试。
|
|
108
|
+
`workflow.createRequest` 在成功(`CREATED` / `CREATED_SUBMITTED`)、提交失败(`CREATED_SUBMIT_FAILED`)和缺必填(`NEEDS_INPUT`)时返回 `finalMarkdown`,**原样粘贴给用户**,不要自己重拼表格;链接只出现在回复文本里,不要主动打开。若返回 `partial/write_uncertain`,停止,不要重放;最多做一次只读查询或请用户在 E10 页面核对。
|
|
86
109
|
|
|
87
110
|
## 注意
|
|
88
111
|
|
|
89
|
-
|
|
112
|
+
载入表单的 `workflow.createForm` **不传 `userQuestion`**、也不用 `workflow.createRequestDirect`:报销的 `data` 由本技能规则组装,不用流程侧智能填参。AI 报销**一律存草稿**(`action:"draft"`),组装完直接调用 `workflow.createRequest`,不让用户选「存草稿 / 提交审批」;草稿由用户在 E10 里核对后自己提交。同一组发票创建成功后禁止再次创建,修改只能走 `workflow.edit*`。
|
|
90
113
|
|
|
91
|
-
|
|
114
|
+
出差/差旅流程需要具体相关客户。未拿到用户提供的客户前,不要调用 `workflow.createRequest`。
|
|
92
115
|
|
|
93
116
|
`invoice.reim.file-ocr.preview` 会让 E10 侧文件进入发票识别流程;如果 fileId 来自用户新上传或附件解析,先提醒用户文件内容可能进入大模型上下文,也可能发送到 E10/OCR 服务,并等待明确确认。
|