weaver-work-cli 0.1.25 → 0.1.26
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 +30 -30
- package/dist/cmd/root.js +1 -0
- package/dist/core/runtime-agent.js +19 -0
- package/dist/internal/e10/auth/commands.js +47 -27
- package/dist/internal/e10/auth/xiaoe.js +62 -43
- package/dist/internal/e10/context.js +5 -27
- 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 +157 -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/index.js +2 -0
- package/dist/shortcuts/invoice/host.js +2 -1
- package/dist/shortcuts/invoice/manifest.js +111 -0
- package/dist/shortcuts/invoice/operations/issuing-qys.js +361 -0
- package/dist/shortcuts/invoice/operations/issuing.js +5 -5
- package/dist/shortcuts/invoice/operations/registry.js +4 -0
- package/dist/shortcuts/workflow/endpoints.js +11 -0
- package/dist/shortcuts/workflow/host.js +2 -2
- package/dist/shortcuts/workflow/index.js +6 -36
- package/dist/shortcuts/workflow/operations/chatscene.js +270 -0
- package/dist/shortcuts/workflow/operations/form.js +899 -158
- package/dist/shortcuts/workflow/operations/read.js +111 -6
- 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 +9 -1
- package/docs/archive-oa.md +79 -0
- package/docs/e10-auth.md +7 -6
- package/package.json +1 -1
- package/skill-template/business-info.json +16 -0
- package/skill-template/domains/archive-oa.md +19 -0
- package/skill-template/domains/yepiaotong.md +2 -2
- 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-builder/SKILL.md +22 -0
- package/skills/weaver-e10-caizhilian/SKILL.md +37 -15
- package/skills/weaver-e10-caizhilian/references/agent-entry.md +7 -3
- 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 +4 -3
- package/skills/weaver-e10-caizhilian/references/file-upload.md +2 -3
- 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/setting-attach.md +13 -39
- package/skills/weaver-e10-caizhilian/references/setting-backup.md +13 -51
- package/skills/weaver-e10-caizhilian/references/setting-encrypt.md +20 -51
- package/skills/weaver-e10-caizhilian/references/setting-storage.md +82 -147
- package/skills/weaver-e10-caizhilian/references/withheld.md +20 -44
- package/skills/weaver-e10-shared/SKILL.md +22 -20
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +14 -15
- package/skills/weaver-e10-shared/references/non-interactive-environment.md +10 -10
- package/skills/weaver-e10-workflow/references/source-manifest.json +32 -22
- package/skills/weaver-e10-workflow/references/workflow-create.md +68 -28
- package/skills/weaver-e10-yepiaotong/SKILL.md +10 -7
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +49 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-qys-ledger.md +66 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +59 -36
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +54 -509
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +182 -345
- package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +4 -5
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +153 -345
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +5 -5
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +182 -154
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +96 -0
- package/skills/weaver-e10-yepiaotong/references/reim-fast-path.md +0 -119
|
@@ -508,6 +508,20 @@
|
|
|
508
508
|
"references/invoice-issuing-examples.md"
|
|
509
509
|
]
|
|
510
510
|
},
|
|
511
|
+
{
|
|
512
|
+
"id": "invoice.issuing.qys",
|
|
513
|
+
"sourcePath": "user-provided: 契约锁合同商品信息 /api/ebuilder/form/eblist/getData 字段表与返回样例",
|
|
514
|
+
"anchor": "source:qys-ledger",
|
|
515
|
+
"status": "converted",
|
|
516
|
+
"mapsToOperations": [
|
|
517
|
+
"invoice.issuing.qys.list",
|
|
518
|
+
"invoice.issuing.qys.prepare",
|
|
519
|
+
"invoice.issuing.result"
|
|
520
|
+
],
|
|
521
|
+
"references": [
|
|
522
|
+
"references/invoice-issuing-qys-ledger.md"
|
|
523
|
+
]
|
|
524
|
+
},
|
|
511
525
|
{
|
|
512
526
|
"id": "invoice.share",
|
|
513
527
|
"sourcePath": "weaver-interface/backend/business-apis/inc/weaver-e10-yepiaotong/references/invoice-share.md",
|
|
@@ -1435,6 +1449,88 @@
|
|
|
1435
1449
|
"workflow.version",
|
|
1436
1450
|
"workflow.state"
|
|
1437
1451
|
]
|
|
1452
|
+
},
|
|
1453
|
+
"invoice.issuing.qys.list": {
|
|
1454
|
+
"risk": "read",
|
|
1455
|
+
"sourceChunks": [
|
|
1456
|
+
"invoice.issuing.qys"
|
|
1457
|
+
],
|
|
1458
|
+
"references": [
|
|
1459
|
+
"references/invoice-issuing-qys-ledger.md"
|
|
1460
|
+
],
|
|
1461
|
+
"requiresConfirmationChain": false,
|
|
1462
|
+
"inputFields": [
|
|
1463
|
+
"keyword",
|
|
1464
|
+
"contractNo",
|
|
1465
|
+
"includeIssued",
|
|
1466
|
+
"limit"
|
|
1467
|
+
],
|
|
1468
|
+
"outputFields": [
|
|
1469
|
+
"items[].formDataId",
|
|
1470
|
+
"items[].contractNo",
|
|
1471
|
+
"items[].purchaserName",
|
|
1472
|
+
"items[].amount",
|
|
1473
|
+
"items[].issuable",
|
|
1474
|
+
"items[].blockers",
|
|
1475
|
+
"matched",
|
|
1476
|
+
"truncated",
|
|
1477
|
+
"scanned",
|
|
1478
|
+
"scanComplete"
|
|
1479
|
+
]
|
|
1480
|
+
},
|
|
1481
|
+
"invoice.issuing.qys.prepare": {
|
|
1482
|
+
"risk": "read-before-write",
|
|
1483
|
+
"sourceChunks": [
|
|
1484
|
+
"invoice.issuing.qys"
|
|
1485
|
+
],
|
|
1486
|
+
"references": [
|
|
1487
|
+
"references/invoice-issuing-qys-ledger.md"
|
|
1488
|
+
],
|
|
1489
|
+
"requiresConfirmationChain": true,
|
|
1490
|
+
"inputFields": [
|
|
1491
|
+
"formDataId",
|
|
1492
|
+
"mode"
|
|
1493
|
+
],
|
|
1494
|
+
"outputFields": [
|
|
1495
|
+
"preview.formDataId",
|
|
1496
|
+
"preview.contractNo",
|
|
1497
|
+
"preview.externalDocumentNo",
|
|
1498
|
+
"preview.totalAmount",
|
|
1499
|
+
"preview.taxAmount",
|
|
1500
|
+
"preview.totalAmountWithTax",
|
|
1501
|
+
"warnings",
|
|
1502
|
+
"ledgerRow",
|
|
1503
|
+
"normalizedPayload",
|
|
1504
|
+
"continuation",
|
|
1505
|
+
"expiresInSeconds",
|
|
1506
|
+
"workflow.workflow",
|
|
1507
|
+
"workflow.version",
|
|
1508
|
+
"workflow.state"
|
|
1509
|
+
]
|
|
1510
|
+
},
|
|
1511
|
+
"invoice.issuing.result": {
|
|
1512
|
+
"risk": "read",
|
|
1513
|
+
"sourceChunks": [
|
|
1514
|
+
"invoice.issuing.qys"
|
|
1515
|
+
],
|
|
1516
|
+
"references": [
|
|
1517
|
+
"references/invoice-issuing-qys-ledger.md"
|
|
1518
|
+
],
|
|
1519
|
+
"requiresConfirmationChain": false,
|
|
1520
|
+
"inputFields": [
|
|
1521
|
+
"externalDocumentNo",
|
|
1522
|
+
"serialNo"
|
|
1523
|
+
],
|
|
1524
|
+
"outputFields": [
|
|
1525
|
+
"externalDocumentNo",
|
|
1526
|
+
"state",
|
|
1527
|
+
"returnCode",
|
|
1528
|
+
"returnMessage",
|
|
1529
|
+
"invoiceNo",
|
|
1530
|
+
"invoiceTime",
|
|
1531
|
+
"serialNo",
|
|
1532
|
+
"result"
|
|
1533
|
+
]
|
|
1438
1534
|
}
|
|
1439
1535
|
},
|
|
1440
1536
|
"withheldOperations": [
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
# 报销快速路径(0.1.13 新增 operation)
|
|
2
|
-
|
|
3
|
-
> 三个新 operation 把「查票 → 分类 → 组 payload → prepare」压成两步,人工只保留确认 + apply。
|
|
4
|
-
> 固化映射来自 2026-09-14 / 2026-09-21 两次真实 apply 成功的「总部费用报销」单据,只覆盖该流程。
|
|
5
|
-
|
|
6
|
-
## 1. `invoice.reim.candidates.list`(read)— 票夹候选分类
|
|
7
|
-
|
|
8
|
-
自动翻页拉取未报销(sreim=3)发票,并按 `oreim.list_reim` / 红冲状态分成三组,**不再需要手动翻页和逐条剔重**:
|
|
9
|
-
|
|
10
|
-
macOS/Linux(bash):
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
weaver-work-cli --json invoice run invoice.reim.candidates.list --input-json '{"date_begin":"2026-09-14","date_end":"2026-09-21"}'
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
Windows PowerShell:
|
|
17
|
-
|
|
18
|
-
```powershell
|
|
19
|
-
weaver-work-cli --json invoice run invoice.reim.candidates.list --input-json '{"date_begin":"2026-09-14","date_end":"2026-09-21"}'
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
- 入参(全部可选):`date_begin`/`date_end`(YYYY-MM-DD,开票日期范围)、`page_size`(10-200,默认 50)、`max_items`(1-500,默认 200,超出截断并产生 warning)、`include_red_reversed`(默认 `false`)。
|
|
23
|
-
- **红冲票默认已过滤**:全额红冲发票(`status=8`)不可报销,默认**不出现在结果里任何一组**,被过滤的张数由 `summary.filteredRedReversedCount` 告知(不会静默丢弃)。需要看红冲票时传 `include_red_reversed: true`,此时它们进 `redReversed` 组。
|
|
24
|
-
- 过滤发生在翻页循环内部:即使某一页全是红冲票也会继续翻页,直到凑够 `max_items` 张**可用**发票或数据取完,因此 `fetched` 只计保留下来的发票数、`total` 仍是接口返回的符合条件的总张数。
|
|
25
|
-
- 输出:`available` / `assigned` / `redReversed` 三组(后一组默认恒为空),每组元素含 `fid`、`number`、`date`、`total`、`buyer`、`payer`、`typeName`、`status`、`valid`、`reimRequests`;`summary` 给出三组的张数与金额合计,外加 `filteredRedReversedCount`;`warnings` 含截断与金额解析告警。
|
|
26
|
-
- **报销范围永远从 `available` 里选**;`assigned` 是已挂单的(重复提交 = 重复报销)。
|
|
27
|
-
- **⚠️ 关于"两次连续查询之间 assigned↔available 翻转"(2026-09-21 已定位,结论:分类是准的,不是误判)**:同一天内观察到 25 张发票从 `assigned` 翻到 `available`,一度被怀疑是 `oreim.list_reim` 缓存滞后。最终用 `workflow.detail` 逐个复核 requestId 后定案:`1313947830149185538`(报销单 2026-09-11)、`1314910388070170941`(2026-09-14)、`1317591500119752761`(当天新建)**均返回"流程已被删除"**,10+15+2 张发票随之释放。⇒ **翻转的根因是报销单被删除,发票真实释放,`candidates.list` 的三分类如实反映了状态变化。**
|
|
28
|
-
- **因此不要每次报销都对每张入选票再跑一次 `invoice.get` 复核 `oreim.list_reim`** —— 那会让快速路径失去意义。只有在**观察到异常翻转**(或对某张票的归属存疑)时才做核实,正确顺序是:`weaver-work-cli workflow run workflow.detail --input-json '{"requestId":"<id>"}'` 查单据是否还存在(被删的单会明确返回"流程已被删除")→ 再用 `invoice.get` 看 `oreim.list_reim`。
|
|
29
|
-
- **已知局限**:`list_reim` 元素只有报销单**名称**(无 requestId、无单号、无单据状态),`reimRequests` 里拿不到能直接喂给 `workflow.detail` 的 id。要核实只能先按名称用 `workflow.search` 找 requestId —— 注意**被删除的单在 `workflow.search` 里搜不到**,这本身就是一个"单可能已被删"的信号,但无法区分"从未存在"与"已被删除"。
|
|
30
|
-
- 另一个易踩点:`sreim="3"`(未报销)**不会**把挂单中的发票排除掉(实测 13 张挂单票仍出现在 `sreim=3` 的 39 张结果里),所以不能靠 `sreim` 判断是否已挂单,分类必须看 `list_reim`。
|
|
31
|
-
|
|
32
|
-
## 2. `invoice.reim.template.build`(read)— 固化模板组装 payload
|
|
33
|
-
|
|
34
|
-
输入发票 ID 列表 + 标题,一条命令产出完整 `payload`(19 个主表字段 + N 行明细)。内部自动完成:取上级(`directSuperior`)→ 解析候选工作流(或用传入 `workflowId`)→ 取表单结构并**按名称定位「费用明细」子表** → 批量取发票详情与行预填。
|
|
35
|
-
|
|
36
|
-
macOS/Linux(bash):
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
weaver-work-cli --json invoice run invoice.reim.template.build --input-json '{"invoiceIds":["1317524773561163780","1317524747581644831"],"requestName":"烧烤调料及托盘采购报销-龚为明-2026-09-21(共2笔)","relatedCustomerId":"100504500000311504","contractNo":"20260999"}'
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Windows PowerShell:
|
|
43
|
-
|
|
44
|
-
```powershell
|
|
45
|
-
weaver-work-cli --json invoice run invoice.reim.template.build --input-json '{"invoiceIds":["1317524773561163780","1317524747581644831"],"requestName":"烧烤调料及托盘采购报销-龚为明-2026-09-21(共2笔)","relatedCustomerId":"100504500000311504","contractNo":"20260999"}'
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
- 入参:`invoiceIds`(必填,1-100 个,顺序 = 明细行顺序)、`requestName`(必填,≤100 字);可选 `workflowId`(不传则自动解析唯一候选流程)、`reason`(报销事由,缺省用 requestName)、`relatedCustomerId`、`relatedCustomerName`、`contractNo`(**默认值 `"20260999"`,视为必传**)。
|
|
49
|
-
- **⚠️ `contractNo` 默认填 `"20260999"`,不能省略**:主表 `合同号(100003720000001376)` 只有在入参给了 `contractNo` 时才写进 `payload.main_fields`(不传时该字段**整条缺失**,实测同一票同参数:不传 18 个主表字段,传 `"contractNo":"20260999"` 后 19 个),报销单里它会留空**且 `warnings` 不会提示**,属于静默漏填。
|
|
50
|
-
- **默认值口径与 [`reim-form-fill-rules.md`](reim-form-fill-rules.md) 的主表字段映射表一致**:合同编号 = 固定值 `"20260999"`。**除非用户明确给出别的合同号,否则一律填 `"20260999"`** —— 快速路径也必须遵守这条,不能因为「入参可选」就留空。
|
|
51
|
-
- 用户另有指定时以用户指定为准;用户明确说"不填合同号"时才允许留空。
|
|
52
|
-
- 输出:`payload`(可直接喂给 `flow.create.prepare` / apply)、`preview`、`labels`、`warnings`。
|
|
53
|
-
- `preview.mainFields[]` / `preview.detailRows[]`:**已把字典类 ID 渲染成「中文(id)」,预览直接展示这两项即可,不必再查名**(详见 `reim-workflow.md` Step 4.7)。
|
|
54
|
-
- `labels`:`employees` / `subjects` / `currencies` / `customers` / `selectOptions` / `customer` / `detailSubForm` / `workflow` 字典;`labels.unresolved` 为没取到中文名的 ID 清单,非空时如实展示并提醒用户核对。
|
|
55
|
-
- 相关客户只给名称也行:传 `relatedCustomerName`(不传 ID 时 CLI 反查 ID;ID + 名称同传则不额外请求,仅用于渲染)。
|
|
56
|
-
- 行为细节(与 2026-09 实测口径一致):
|
|
57
|
-
- 报销人上级 / 承担人直接上级 = `directSuperior.id`(**不是 allSuperiors[0]**);承担人所有上级 = allSuperiors 全部 id 逗号拼接。
|
|
58
|
-
- 费用明细子表优先按名称「费用明细」匹配,兜底按「相关发票」字段结构签名匹配。
|
|
59
|
-
- 费用说明自动去掉 `*`;科目缺省「日常消费」;币种人民币;报销方式银行(optionValue "7")。
|
|
60
|
-
- 发票已挂单 → warning;发票全额红冲(status=8)或金额合计为 0 → **直接报错拒绝组装**。
|
|
61
|
-
- `relatedCustomerId` 不传会留空并产生 warning(E10 apply 时可能因必填校验失败,非出差场景建议传)。
|
|
62
|
-
- 模板只固化了「总部费用报销」(`100003460000000060`) 的字段映射。若解析到的候选流程不是它,字段映射可能不适用 —— 此时**改走 `reim-workflow.md` 的手工组装路径**。
|
|
63
|
-
|
|
64
|
-
## 3. `invoice.reim.flow.create.auto-prepare`(read-before-write)— 一站式 prepare
|
|
65
|
-
|
|
66
|
-
与 `template.build` 相同的入参,组装 payload 后**直接签发 `flow.create.apply` 的 continuation**,一步到 `AWAITING_CONFIRMATION`:
|
|
67
|
-
|
|
68
|
-
macOS/Linux(bash):
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
weaver-work-cli --json invoice run invoice.reim.flow.create.auto-prepare --input-json '{"invoiceIds":["1317524773561163780","1317524747581644831"],"requestName":"烧烤调料及托盘采购报销-龚为明-2026-09-21(共2笔)","relatedCustomerId":"100504500000311504","contractNo":"20260999"}'
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Windows PowerShell:
|
|
75
|
-
|
|
76
|
-
```powershell
|
|
77
|
-
weaver-work-cli --json invoice run invoice.reim.flow.create.auto-prepare --input-json '{"invoiceIds":["1317524773561163780","1317524747581644831"],"requestName":"烧烤调料及托盘采购报销-龚为明-2026-09-21(共2笔)","relatedCustomerId":"100504500000311504","contractNo":"20260999"}'
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
输出含 `payload` + `preview` + `labels` + `continuation` + `expiresInSeconds: 600`。**用户确认后**,把 payload 的字段**展开到顶层**(即 `work_flow_id` / `mainFormId` / `request_name` / `main_fields` / `detail_rows` / `need_user_confirm` / `unable_to_fill`),再补 `continuation` 与 `confirm: true`,交给 `invoice.reim.flow.create.apply` 提交。**不要写成 `{"payload": {...}, "continuation": ...}` 的嵌套结构**(`reim-api-reference.md` 第 7 节已明确「不要再包一层通用 payload」)。
|
|
81
|
-
|
|
82
|
-
## 推荐流程(快速路径)
|
|
83
|
-
|
|
84
|
-
```
|
|
85
|
-
candidates.list(选 available)
|
|
86
|
-
→ 向用户展示汇总并确认范围
|
|
87
|
-
→ auto-prepare(或 template.build + flow.create.prepare) ← 必带 relatedCustomerId + contractNo:"20260999"(用户另有指定时用其值)
|
|
88
|
-
→ 展示 preview + warnings(**ID 一律带中文名,见 `reim-workflow.md` Step 4.7**),等用户确认
|
|
89
|
-
→ flow.create.apply(展开 payload 到顶层 + continuation + confirm=true)
|
|
90
|
-
→ 回查验证(candidates.list 或 invoice.list)
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
人工确认环节不可跳过:apply 是 high-risk-write,金额、抬头、明细、上级必须经过用户核对。
|
|
94
|
-
|
|
95
|
-
> **apply 入参改用 `--input <path>` 时的解析坑(0.1.18 实测)**:stdout 会在 JSON **之前多出一行** `[weaver-work-cli] 使用 --input <path> 读取 JSON 文件;多步传递请优先用 --input-ref,简单数据请用 --input-json。`。脚本解析必须先定位第一个 `{` 再 `JSON.parse`,直接解析会抛 `Unexpected token 'w'`。
|
|
96
|
-
|
|
97
|
-
> **continuation 只有 600 秒有效期**:`prepare` / `auto-prepare` 签发后要尽快 `apply`,中间不要插入文档查询、多轮确认或其它耗时命令,否则会返回 `validation/continuation_expired`。遇到过期**重新 `prepare` 后立即 `apply`** 即可(用户已确认过的内容无需重新征询),**不要重放旧 continuation**。
|
|
98
|
-
|
|
99
|
-
## 快速路径适用判断
|
|
100
|
-
|
|
101
|
-
Agent 在决定走快速路径还是手工路径时,按以下规则判断:
|
|
102
|
-
|
|
103
|
-
| 条件 | 走快速路径 | 走手工路径 |
|
|
104
|
-
|------|------------|------------|
|
|
105
|
-
| `workflow.resolve` 返回的 workFlowId = `100003460000000060`(总部费用报销) | ✅ | — |
|
|
106
|
-
| workFlowId 不是 `100003460000000060` | — | ✅ |
|
|
107
|
-
| `template.build` 返回 error 含 `structure_invalid` 或字段映射异常 | — | ✅(自动回退) |
|
|
108
|
-
| 需要逐字段精细控制(如手动指定某行的费用科目) | — | ✅ |
|
|
109
|
-
| 有事前申请需要绑定 | — | ✅(模板不做事前绑定) |
|
|
110
|
-
| 无事前申请 + 总部费用报销流程 | ✅(优先) | — |
|
|
111
|
-
|
|
112
|
-
> **⚠️ 快速路径的 `template.build` 和 `auto-prepare` 已内置挂单检查**:如果某张发票已挂在其他报销单上,`warnings` 会明确告知"继续组装存在重复报销风险",Agent 应展示给用户确认。
|
|
113
|
-
|
|
114
|
-
> **⚠️ 0.1.19 起 `contractNo` 默认值**:CLI 未收到 `contractNo` 入参时自动使用 `"20260999"` 并产生 warning,不再静默缺失。但仍建议显式传入以确保意图明确。
|
|
115
|
-
|
|
116
|
-
## 与手工路径的关系
|
|
117
|
-
|
|
118
|
-
- `invoice.reim.requests.list`(事前申请匹配)仍按 `reim-matching-rules.md` 走,模板不做事前申请绑定。
|
|
119
|
-
- 其他流程(出差报销等)或需要逐字段精细控制的场景,仍走 `reim-workflow.md` / `reim-form-fill-rules.md` 的手工组装路径。
|