weaver-work-cli 0.1.50 → 0.1.53
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 +1 -1
- package/dist/chunks/{attachment-content-EJYIOJPH.js → attachment-content-W3TSJC3Y.js} +3 -3
- package/dist/chunks/{chunk-BFKLQLBK.js → chunk-2J3XY4ED.js} +7 -7
- package/dist/chunks/{chunk-K67FODVC.js → chunk-6GCXWKG6.js} +1 -1
- package/dist/chunks/{chunk-WNJUGI2F.js → chunk-76PRVYH4.js} +1 -1
- package/dist/chunks/{chunk-RYFRGTUV.js → chunk-DEHJ7PMA.js} +4 -4
- package/dist/chunks/{chunk-3NCFFHB2.js → chunk-IF33CG4V.js} +1 -1
- package/dist/chunks/{chunk-YB3AJYPY.js → chunk-PE334WL3.js} +4 -4
- package/dist/chunks/{chunk-MCZG6HPM.js → chunk-QQXMHM3J.js} +2 -2
- package/dist/chunks/{chunk-7ECB22G3.js → chunk-U7ROML5E.js} +23 -23
- package/dist/chunks/{chunk-7AYQJSFY.js → chunk-WTLQGS6D.js} +2 -2
- package/dist/chunks/{chunk-6T53BSWZ.js → chunk-XPQN4E5O.js} +50 -19
- package/dist/chunks/{chunk-HARQF5IP.js → chunk-Z4G7LLDD.js} +25 -25
- package/dist/chunks/{conflict-C4UDHCWV.js → conflict-57WDJWL7.js} +2 -2
- package/dist/chunks/{contract-VUC6JOPG.js → contract-LJRAXVZU.js} +8587 -1421
- package/dist/chunks/{create-flow-6OG2LYBD.js → create-flow-3FMMZBCA.js} +6 -6
- package/dist/chunks/{data-QO7QWOIV.js → data-WK5CQXNF.js} +17 -32
- package/dist/chunks/{env-WP57TF2S.js → env-JYZE3BZB.js} +2 -2
- package/dist/chunks/{factory-VUXI7N5C.js → factory-66SCIKW3.js} +1 -1
- package/dist/chunks/{group-chat-UQRGXILK.js → group-chat-MNRYMLNG.js} +3 -3
- package/dist/chunks/{invoice-E7GOITEU.js → invoice-V7ZTITUO.js} +725 -205
- package/dist/chunks/{meeting-4BBLVAWM.js → meeting-IIY4UAJL.js} +10 -10
- package/dist/chunks/{recruit-stage-FKWS5UQF.js → recruit-stage-XCMVEQA2.js} +718 -131
- package/dist/chunks/{registry-V4CHRQDI.js → registry-CJOVECZD.js} +1 -1
- package/dist/chunks/{registry-5CRCN2TV.js → registry-METZ2LWE.js} +10 -10
- package/dist/chunks/{room-recommend-AYR3UG7R.js → room-recommend-YFY7HTOF.js} +4 -4
- package/dist/chunks/{schedule-JZEFIXUS.js → schedule-6I63TERA.js} +4 -4
- package/dist/chunks/smart-extract-FOUYNIG3.js +2882 -0
- package/dist/chunks/{workflow-3ZAF2J5E.js → workflow-YHXFIU63.js} +1 -1
- package/dist/index.js +11 -6
- package/dist/shortcuts/contract/manifest.js +251 -0
- package/dist/shortcuts/contract/ooxml/docx-table.js +233 -0
- package/dist/shortcuts/contract/operations/card-action.js +1165 -0
- package/dist/shortcuts/contract/operations/card-ebdf-list.js +571 -0
- package/dist/shortcuts/contract/operations/card-plan.js +327 -0
- package/dist/shortcuts/contract/operations/card-risk-report.js +565 -0
- package/dist/shortcuts/contract/operations/card.js +6 -5
- package/dist/shortcuts/contract/operations/docx-fillfromquote.js +532 -0
- package/dist/shortcuts/contract/operations/docx-verify.js +258 -0
- package/dist/shortcuts/contract/operations/elements-build.js +761 -0
- package/dist/shortcuts/contract/operations/elements-spec.js +216 -0
- package/dist/shortcuts/contract/operations/first-screen.js +588 -0
- package/dist/shortcuts/contract/operations/flow.js +81 -25
- package/dist/shortcuts/contract/operations/ledger.js +438 -0
- package/dist/shortcuts/contract/operations/modeltext.js +132 -0
- package/dist/shortcuts/contract/operations/op-resolver.js +22 -0
- package/dist/shortcuts/contract/operations/performance.js +104 -3
- package/dist/shortcuts/contract/operations/quote.js +131 -25
- package/dist/shortcuts/contract/operations/quotescreen.js +529 -0
- package/dist/shortcuts/contract/operations/registry.js +30 -0
- package/dist/shortcuts/contract/operations/review.js +73 -58
- package/dist/shortcuts/contract/operations/summary-validate.js +293 -0
- package/dist/shortcuts/contract/operations/summary.js +4 -2
- package/dist/shortcuts/contract/operations/triage.js +1100 -0
- package/dist/shortcuts/contract/operations/upload.js +48 -7
- package/dist/shortcuts/contract/prewarm-cache.js +90 -0
- package/dist/shortcuts/contract/prewarm.js +88 -0
- package/dist/shortcuts/contract/upload-cache.js +49 -4
- package/dist/shortcuts/data/index.js +1 -6
- package/dist/shortcuts/data/manifest.js +2 -2
- package/dist/shortcuts/data/operations/index.js +1 -1
- package/dist/shortcuts/data/operations/query.js +23 -46
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/invoice/index.js +0 -12
- package/dist/shortcuts/invoice/manifest.js +200 -49
- package/dist/shortcuts/invoice/operations/registry.js +4 -2
- package/dist/shortcuts/invoice/operations/reim-relation.js +438 -0
- package/dist/shortcuts/invoice/operations/shared.js +3 -19
- package/dist/shortcuts/invoice/operations/upload-and-validate.js +109 -73
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +4 -2
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +6 -2
- package/dist/shortcuts/recruit-stage/operations/list.js +217 -1
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +144 -158
- package/dist/shortcuts/recruit-stage/operations/search.js +348 -0
- package/dist/shortcuts/recruit-stage/shared.js +5 -0
- package/dist/shortcuts/recruit-stage/tag-lookup.js +136 -0
- package/dist/shortcuts/smart-extract/constants.js +79 -0
- package/dist/shortcuts/smart-extract/continuation.js +71 -0
- package/dist/shortcuts/smart-extract/errors.js +68 -0
- package/dist/shortcuts/smart-extract/host.js +191 -0
- package/dist/shortcuts/smart-extract/index.js +105 -0
- package/dist/shortcuts/smart-extract/ledger.js +70 -0
- package/dist/shortcuts/smart-extract/manifest.js +35 -0
- package/dist/shortcuts/smart-extract/operations/attachment.js +212 -0
- package/dist/shortcuts/smart-extract/operations/batch.js +67 -0
- package/dist/shortcuts/smart-extract/operations/config.js +118 -0
- package/dist/shortcuts/smart-extract/operations/fill.js +492 -0
- package/dist/shortcuts/smart-extract/operations/preview.js +174 -0
- package/dist/shortcuts/smart-extract/operations/registry.js +34 -0
- package/dist/shortcuts/smart-extract/operations/save.js +355 -0
- package/dist/shortcuts/smart-extract/operations/shared.js +191 -0
- package/dist/shortcuts/smart-extract/operations/structure.js +401 -0
- package/dist/shortcuts/smart-extract/operations/target.js +167 -0
- package/dist/shortcuts/smart-extract/operations/types.js +22 -0
- package/dist/shortcuts/smart-extract/operations/validate.js +454 -0
- package/dist/shortcuts/workflow/operations/form.js +68 -33
- package/dist/shortcuts/workflow/operations/read.js +19 -1
- package/docs/SKILL.md +1 -1
- package/docs/_catalog.md +3 -0
- package/docs/agent-invoice.md +5 -7
- package/docs/data.md +5 -1
- package/docs/fna.md +14 -1
- package/docs/invoice.md +7 -5
- package/docs/smart-extract.md +156 -0
- package/package.json +1 -1
- package/skill-template/business-info.json +16 -1
- package/skill-template/domains/qiyecheng.md +2 -0
- package/skill-template/domains/smart-extract.md +16 -0
- package/skill-template/domains/yepiaotong.md +2 -2
- package/skills/weaver-e10-data/references/scene-and-misc.md +4 -3
- package/skills/weaver-e10-jinchengda/SKILL.md +223 -35
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +47 -481
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +11 -11
- package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +3 -3
- package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +32 -16
- package/skills/weaver-e10-jinchengda/references/contract-card-render-internals.md +478 -0
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +39 -61
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +18 -13
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +21 -6
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +6 -4
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +3 -3
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +263 -0
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +525 -0
- package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +36 -0
- package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +128 -0
- package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +87 -0
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +80 -54
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +110 -14
- package/skills/weaver-e10-jinchengda/references/contract-template-selector.md +19 -21
- package/skills/weaver-e10-jinchengda/references/orchestration.md +12 -12
- package/skills/weaver-e10-jinchengda/references/source-manifest.json +1 -6
- package/skills/weaver-e10-jinchengda/scripts/fill_plan.py +2 -1
- package/skills/weaver-e10-qiyecheng/SKILL.md +37 -0
- package/skills/weaver-e10-qiyecheng/references/ai-check-audit.md +14 -0
- package/skills/weaver-e10-qiyecheng/references/budget.md +14 -0
- package/skills/weaver-e10-qiyecheng/references/catalog.md +25 -0
- package/skills/weaver-e10-qiyecheng/references/expense-center.md +8 -0
- package/skills/weaver-e10-qiyecheng/references/expense-chart.md +9 -0
- package/skills/weaver-e10-qiyecheng/references/invoice-writeoff.md +13 -0
- package/skills/weaver-e10-qiyecheng/references/loan-management.md +14 -0
- package/skills/weaver-e10-qiyecheng/references/self-hosted-mode.md +239 -0
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +34 -27
- package/skills/weaver-e10-recruit-stage/SKILL.md +62 -4
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +42 -8
- package/skills/weaver-e10-recruit-stage/references/env-ziyong.md +79 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +11 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +3 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +153 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +7 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-my-positions.md +66 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +156 -42
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +122 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +36 -8
- package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +157 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +35 -0
- package/skills/weaver-e10-smart-extract/SKILL.md +180 -0
- package/skills/weaver-e10-smart-extract/references/api-contract.md +71 -0
- package/skills/weaver-e10-smart-extract/references/result-format.md +102 -0
- package/skills/weaver-e10-smart-extract/references/troubleshooting.md +106 -0
- package/skills/weaver-e10-workflow/references/workflow-create.md +6 -5
- package/skills/weaver-e10-workflow/references/workflow-edit.md +1 -1
- package/skills/weaver-e10-workflow/references/workflow-query.md +1 -1
- package/skills/weaver-e10-workflow/references/workflow-view.md +1 -1
- package/skills/weaver-e10-yepiaotong/SKILL.md +46 -33
- package/skills/weaver-e10-yepiaotong/references/invoice-add.md +2 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-file-upload.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-import.md +19 -2
- package/skills/weaver-e10-yepiaotong/references/invoice-ocr-preview.md +8 -2
- package/skills/weaver-e10-yepiaotong/references/invoice-reim-relation.md +407 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +12 -8
- package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +97 -39
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +91 -2
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +12 -12
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +8 -4
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +136 -91
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +109 -23
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +110 -43
- package/dist/shortcuts/invoice/operations/validate-preview.js +0 -40
- package/skills/weaver-e10-jinchengda/scripts/plan_actions.py +0 -279
- package/skills/weaver-e10-jinchengda/scripts/render_action_card.py +0 -450
- package/skills/weaver-e10-jinchengda/scripts/render_ebdf_list_card.py +0 -265
- package/skills/weaver-e10-jinchengda/scripts/render_risk_report.py +0 -358
- package/skills/weaver-e10-jinchengda/scripts/validate_action_card.py +0 -588
- package/skills/weaver-e10-jinchengda/scripts/verify_docx_placeholders.py +0 -118
- package/skills/weaver-e10-yepiaotong/references/invoice-validation-preview.md +0 -40
package/docs/_catalog.md
CHANGED
|
@@ -59,3 +59,6 @@
|
|
|
59
59
|
| E10 闲置资产判定结果查询(分页获取/聚合统计/三张图口径)、asset-idle operation | `docs/asset-idle.md` |
|
|
60
60
|
| Agent 调用闲置资产统计 CLI 的入口路由 | `skills/weaver-e10-asset-idle/SKILL.md` |
|
|
61
61
|
| Agent 调用闲置资产统计 CLI 的具体 reference | `skills/weaver-e10-asset-idle/references/` |
|
|
62
|
+
| 智能抽取(表单结构/识别规则/附件正文/校验与落库)、smart-extract operation | `docs/smart-extract.md` |
|
|
63
|
+
| Agent 调用智能抽取 CLI 的入口路由 | `skills/weaver-e10-smart-extract/SKILL.md` |
|
|
64
|
+
| Agent 调用智能抽取 CLI 的具体 reference(接口对照/结果格式/故障排查) | `skills/weaver-e10-smart-extract/references/` |
|
package/docs/agent-invoice.md
CHANGED
|
@@ -57,17 +57,15 @@ weaver-work-cli --json invoice run invoice.list --input-json '{"page_size":10,"s
|
|
|
57
57
|
|
|
58
58
|
处理“把这张发票录入业票通”的典型流程:
|
|
59
59
|
|
|
60
|
-
1.
|
|
61
|
-
2. `invoice.
|
|
62
|
-
3.
|
|
63
|
-
4. 把 prepare 返回的 `continuation` 原样交给 `invoice.import.apply`,并传 `confirm=true`。
|
|
64
|
-
5. 使用返回的 `fid` 回查详情,按实际结果报告查验状态、写入状态和附件信息。
|
|
60
|
+
1. 提醒用户文件会上传到 E10 业票通做识别和查验,用户明确确认后再继续。
|
|
61
|
+
2. 每个文件执行一次 `invoice.upload-and-validate`,一步完成上传、OCR 识别、查验并进个人票夹。
|
|
62
|
+
3. 按返回的 `invoices[]` 逐张报告:`ret.ret=0` 为识别并查验成功;非 0 时报告 `ret.message`,`fid` 非空说明已进票夹但查验没通过,`fid` 为空说明没进票夹。号码用 `detailUrl` 做链接。
|
|
65
63
|
|
|
66
|
-
|
|
64
|
+
只有要用 `fieldKey` / `filedMap` 设字段,或用户明确要求跳过发票查验、离线导入时,才改走 `invoice.ocr.preview` -> `invoice.import.prepare`(显式传 `validate`、`syncToOa`)-> `invoice.import.apply`(原样传 `continuation` 和 `confirm=true`)。传 `validate=false` 的结果必须报告为“跳过查验”,不能写成“查验通过”。
|
|
67
65
|
|
|
68
66
|
删除、编辑、新增同样必须使用 `prepare -> apply`。出现 `partial/write_uncertain` 时停止,不能自动重试写操作。
|
|
69
67
|
|
|
70
|
-
处理“把发票填进流程表单”的场景,使用 `invoice.browse-field.data` 生成浏览按钮控件所需 JSON。处理“报销发票/自动填单”时,先读取 `invoice-reim.md`,用报销相关只读 operation(`invoice.reim.candidates.list`、`invoice.reim.requests.list`、`invoice.reim.workflow.resolve`、`invoice.reim.employee-superiors`、`invoice.reim.field.search
|
|
68
|
+
处理“把发票填进流程表单”的场景,使用 `invoice.browse-field.data` 生成浏览按钮控件所需 JSON。处理“报销发票/自动填单”时,先读取 `invoice-reim.md`,用报销相关只读 operation(`invoice.reim.candidates.list`、`invoice.reim.requests.list`、`invoice.reim.workflow.resolve`、`invoice.reim.employee-superiors`、`invoice.reim.field.search`、`invoice.reim.relation.list`)获取候选发票、事前申请、工作流、人员上级和相关客户/项目,其中 `invoice.reim.relation.list` 读回发票上传时登记的相关客户、相关项目、事前申请,登记过的直接用、不再问用户;发票上传成功后(`invoice.import.apply`、`invoice.upload-and-validate`、`invoice.add.apply`),仅上传 / 录入且无报销意图时,识别查验完后同一批先只问一次要不要登记(这时不查数据),用户同意后再按类别采集(话费 / 油费用 `weaver-e10-workflow` 的 `workflow.search` 从最近的报销单找出事前申请,找不到给出发起链接;差旅 / 打车 / 滴滴问相关项目和事前申请;其他问相关客户、相关项目、事前申请),用 `invoice.reim.relation.save` 登记,它失败不重试、不影响上传;报销意图下不问登记、不采集登记数据,只读已有登记,见 `invoice-reim-relation.md`;报销单的载入、创建和修改统一走 `weaver-e10-workflow`:`workflow.createForm` 载入表单,`workflow.createRequest`(`action` 固定 `draft`)存草稿,修改走 `workflow.editLoad` / `workflow.editPrepare` / `workflow.editApply`。旧的 `invoice.reim.flow.create/update.*` 已移除,不要再调用。处理“开票 / 待开票合同”时读取 `invoice-issuing-workflow.md`:先用 `weaver-e10-workflow` 的 `workflow.search` 查出当前用户有权限看的合同审批流程,再把 `data.cards` 传给 `invoice.issuing.contracts.list` 补齐是否开票、合同号、客户名称和开票金额,列出待开票合同;用户选定后用 `invoice.issuing.contract.detail` 取合同客户与合同正文文档 id,按销售方选开票申请流程,问清预计收款时间并确认后用 `workflow.createForm` / `workflow.createRequest`(`action` 固定 `draft`)存草稿。当前修正资料包没有客户档案查询或红字发票红冲接口,`invoice.customer.*` 和 `invoice.red.*` 不能调用或绕过。
|
|
71
69
|
|
|
72
70
|
## 暂缓能力
|
|
73
71
|
|
package/docs/data.md
CHANGED
|
@@ -64,7 +64,11 @@ weaver-work-cli auth login --base-url <E10 域名>
|
|
|
64
64
|
|
|
65
65
|
### query:DSL 查询
|
|
66
66
|
|
|
67
|
-
`POST /api/dw/dsl/executeQueryDsl
|
|
67
|
+
`POST /api/dw/dsl/executeQueryDsl`。每次查询必须提供 `question_context`,CLI 原样映射为请求体 `questionContext`,不会缓存、补造或复用历史上下文。DSL 行数据兼容 `data.dataList[]`、`data.records[]` 和 `data[]`。
|
|
68
|
+
|
|
69
|
+
- `tipTimeout=true`:平台未执行或未返回可交付结果,**不是 0 行**;按提示收窄时间或数据范围后重试。
|
|
70
|
+
- `tipTimelimit=true`:结果仍可使用,但实际查询范围可能已被平台收窄;交付时必须说明该限制。
|
|
71
|
+
- 两者同时出现时,以 `tipTimeout` 为终止信号。
|
|
68
72
|
|
|
69
73
|
### ds:数据源发现与取数
|
|
70
74
|
|
package/docs/fna.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
## Agent 入口
|
|
12
12
|
|
|
13
|
-
面向 Agent 时先读 `skills/weaver-e10-qiyecheng/SKILL.md`,再按入口路由读取 `references/`(catalog/budget/expense-center/expense-chart/ai-check-audit/loan-management/invoice-writeoff)。
|
|
13
|
+
面向 Agent 时先读 `skills/weaver-e10-qiyecheng/SKILL.md`,再按入口路由读取 `references/`(catalog/budget/expense-center/expense-chart/ai-check-audit/loan-management/invoice-writeoff/self-hosted-mode)。
|
|
14
14
|
|
|
15
15
|
## Operation 目录
|
|
16
16
|
|
|
@@ -35,6 +35,19 @@
|
|
|
35
35
|
|
|
36
36
|
完整 schema(inputSchema/required/enum)以 `weaver-work-cli fna schema` 为准。`withheldOperations` 记录了未实现的按钮能力(确认已还、核销明细)、ID 解析边界、AI 报表 SQL 与规则配置维护、表单明细回传边界。
|
|
37
37
|
|
|
38
|
+
## 流程链接(单据跳转)
|
|
39
|
+
|
|
40
|
+
输出单据标题/申请名称时须同时给出流程详情链接:`{baseUrl}/sp/workflow/flowpage/view/{requestId}`——`{baseUrl}` 取 `weaver-work-cli auth status --no-check` 的 `baseUrl`(禁止硬编码),`{requestId}` 取列表行的 `id`(`fna.loan.main.list`、`fna.invoice.writeoff.list`)或详情/预审入参的 `requestId`;ID 一律按字符串拼接(超 2^53),链接只带 `requestId`,不拼任何凭证。`fna.budget.execute.list` 与 `fna.expense.chart` 的行通常不含 `requestId`,不得反推链接。
|
|
41
|
+
|
|
42
|
+
## 自用系统专场(仅 e-cology)
|
|
43
|
+
|
|
44
|
+
`baseUrl` 主机名含 `e-cology`(泛微自用系统)时,两个跨 skill 的编排能力由 `skills/weaver-e10-qiyecheng/references/self-hosted-mode.md` 承载,本 CLI 侧没有新增 operation——它们复用 `fna.audit.check.*` 与 `workflow.search` / `workflow.batchSubmit`:
|
|
45
|
+
|
|
46
|
+
- 报销待办 AI 预审:`workflow.search`(钉死「总部费用报销 `100003460000000060`」)→ 逐条 `fna.audit.check.prepare/apply` → 总览与分状态分组 → 按需 `workflow.batchSubmit`。
|
|
47
|
+
- 查报销流程的客户/项目/合同信息:流程字段用 workflow 详情,主数据转客户/合同/项目 Skill,本 CLI 只出金额与费用分布(`fna.expense.chart`、`fna.expense.reimbursed.sum`)。
|
|
48
|
+
|
|
49
|
+
环境判定与拦截都必须只读 `weaver-work-cli auth status --no-check` 的 `baseUrl`;非自用环境固定拒绝,不做降级实现、不改用其它接口拼装近似结果。待办 `nodeId` 不由本 Skill 获取。
|
|
50
|
+
|
|
38
51
|
## 常用命令
|
|
39
52
|
|
|
40
53
|
Windows PowerShell:
|
package/docs/invoice.md
CHANGED
|
@@ -63,8 +63,8 @@ weaver-work-cli --json invoice list --fields number,detailUrl
|
|
|
63
63
|
| `invoice.get` | 只读 | `fid` 优先,或按 `number` 查询 |
|
|
64
64
|
| `invoice.upload` | 外部制品 | 固定上传 `ocr=0`,只取上传文件 ID,不做上传阶段解析 |
|
|
65
65
|
| `invoice.ocr.preview` | 上传+只读 | 固定 `flag=13`、`is_sync=1`、`is_save=1`,不保存票夹 |
|
|
66
|
-
| `invoice.validate
|
|
67
|
-
| `invoice.import.prepare/apply` | 高风险写 | continuation 绑定本地文件 SHA-256 或远程 URL
|
|
66
|
+
| `invoice.upload-and-validate` | 上传+写票夹 | **文件上传发票和行程单的默认入口**。`POST /api/inc/biz/addInvoiceByFile`(multipart,`file` 或 `url`),一次完成上传、OCR 识别、查验并进个人票夹,行程单和发票一样识别查验。返回 `fileName`、`count`、`validatedCount` 和精简后的 `invoices[]`:`fid`、`code`、`number`、`cname`、`type`(票种代码,17/18/57/58 是行程单等相关凭证)、`kind`、`date`、`amount`、`total`、`dtax`、`buyer` / `payer`(`company`、`tcode`)、去掉空值和版式标记的 `ext`、`ret`(`ret=0` 即识别并查验成功)、`validated`、`detailUrl`。`fid` 非空即已进票夹(含查验没通过的)。连接中断返回 `partial/write_uncertain`,禁止自动重试 |
|
|
67
|
+
| `invoice.import.prepare/apply` | 高风险写 | 只在需要 `fieldKey` / `filedMap` 设字段或明确跳过查验时使用;continuation 绑定本地文件 SHA-256 或远程 URL;`filedMap` 在 inputSchema 中保持 JSON object |
|
|
68
68
|
| `invoice.add.prepare/apply` | 高风险写 | 单张票面校验、重复检查、确认后新增并回查 |
|
|
69
69
|
| `invoice.update.prepare/apply` | 高风险写 | 基于完整详情修改白名单字段,保留附件并回查 |
|
|
70
70
|
| `invoice.download` | 本地文件写 | 先校验 `fileId` 属于目标 `fid`,拒绝覆盖 |
|
|
@@ -76,11 +76,14 @@ weaver-work-cli --json invoice list --fields number,detailUrl
|
|
|
76
76
|
| `invoice.reim.candidates.list` | 只读 | 按日期自动翻页拉取未报销发票,分成 `available`(可报)/ `assigned`(已挂单)两组并给出金额合计 |
|
|
77
77
|
| `invoice.reim.employee-superiors` | 只读 | 获取当前人员和上级信息 |
|
|
78
78
|
| `invoice.reim.field.search` | 只读 | `GET /api/government/formStructure/fieldRelateSearch`;按名称模糊搜相关客户或相关项目。返回 `match=unique/multiple/none`:一条直接填 `名称(ID)`,多条让用户选。报销时客户和项目必须在建草稿前确认 |
|
|
79
|
+
| `invoice.reim.relation.search` | 只读 | 上传发票登记前按名称模糊搜相关客户 / 相关项目,不需要报销表单。入参 `target`(`customer`/`project`)、`keywords`。客户走 `POST /api/ebuilder/coms/nlist/getData`(multipart,`ebbusinessid` / `pageId` `1218181956452048911`,按客户「名称」`field_1173221220888062665` 过滤);项目走 `POST /api/ebuilder/form/common/browser/data/ebuilder`(`quickSearchDatas.field_1020275734718578690` 传项目名称,`formParam` 固定为总部费用报销的项目浏览框),停用项目不返回。每页 20 条。返回 `match`、`items[]`(只有 `id`、`name`)、`selected`(唯一或名称完全一致时给出) |
|
|
80
|
+
| `invoice.reim.relation.save` | 写入(尽力而为) | 发票上传后登记相关客户、相关项目、事前申请:`POST /api/esb/server/event/triggerActionFlow`(`esbFlowId` 固定 `908258457763844096`,`moduleSource="-1"`),每张发票一次,`invoiceId` 取 `fid`。入参 `fid`/`fids`,可选 `customerId`+`customerName`、`projectId`+`projectName`(成对)、`flowId`(事前申请 requestid),至少给一项。`mainTable.msg` 含「关联成功」才算成功;接口失败、超时、返回其他内容只记为 `saved=false`,命令不报错、不重试。返回 `saved`、`savedCount`、`failedCount`、`results[]` |
|
|
81
|
+
| `invoice.reim.relation.list` | 只读 | 报销时读回发票上传时登记的关联信息:`POST /api/ebuilder/form/eblist/getData`(发票附加信息表,按「单子发票ID」精确过滤),同一张登记多次取最新。入参 `fid`/`fids`。返回 `items[]`(`customer`/`project` 为 `{id,name,value}`,`preApproval` 为 `{requestId,requestName,value,...}`,`value` 已是 `名称(ID)`)、按取值分组的 `groups`、查询失败的 `failed[]` 和 `summary` |
|
|
79
82
|
| `invoice.reim.subsidy.submit` | 高风险写入 | 话费 / 油费补贴报销直接创建并提交流程:`POST /api/secondev/fna/expense/reimbursement/aiCreateWf`,固定 `autoCommit="1"`,`currentEmpId` 取登录会话。入参 `processTitle`、`reason`、`relatedProcessId`(事前申请 requestId)、`invoices`(`[{fid,total}]`,每张一行明细),可选 `monthlyAllowance`(月补贴额度;CLI 给每行明细算 `reimbursedAmount`:所有行加起来不超过额度,超过时最后一行 = 额度 − 前面行累加金额,额度用完后剩下的发票不进明细,返回在 `skippedInvoices`)、`customerId`(不传默认泛微上海 `100504500000311504`)、`projectId`(不传发空字符串)。返回 `requestId`、`url`(`{baseUrl}/sp/workflow/flowpage/view/{requestId}`)、`finalMarkdown`。连接中断或成功但没有 `requestId` 时返回 `partial/write_uncertain`,禁止自动重试 |
|
|
80
83
|
| `invoice.issuing.contracts.list` | 只读 | 入参 `cards`(`workflow.search` 返回的 `data.cards`,原样传入)或 `requestIds`,二选一,最多 50 条。对每个 `requestId` 调一次 `POST /api/ebuilder/form/eblist/getData`(合同虚拟表,按「合同审批流程」过滤,明细按 100 行一页取完),把结果拼回卡片:`invoiced`(查不到明细为 `true`,即已开票)、`contractNo`、`customerName`、`buyerTaxNo`、`sellerName`、`invoiceAmount`(全部明细金额之和,两位小数)、`invoiceGroups[]`(按分组标识汇总 `group` / `amount` / `items[]`);顶层返回 `count`、`pendingCount`、`invoicedCount`。AI 开票先用 `weaver-e10-workflow` 的 `workflow.search` 查三个合同审批流程(用户点名检索词时追加 `requestName`,按流程标题模糊搜索;不传则不带该字段),再用本命令列出待开票合同 |
|
|
81
84
|
| `invoice.issuing.contract.detail` | 只读 | 入参 `requestId`(用户选定的合同审批流程)。`POST /api/workflow/core/paService/v1/getWorkflowRequest`(`isReadRequest=false`,不标记已读),只取主表:`customer`(「客户名称」Ebuilder 的 `{id, name}`,没有时取「最终用户卡片」)、`customerSource`、`contractDocuments[]`(「合同正文及附件」每个文件的 `docId` / `fileId` / `name`)、`contractDocIds`(全部 `docId` 逗号连接)。AI 开票「合同客户」填 `customer` 的 `{id, name}`;「合同文本」与合同流程一样,按每个文件的 `docId`、`name` 填 `{id, name}`,多个文件传数组,不要填 `contractDocIds` 逗号串或纯数字 id |
|
|
82
85
|
|
|
83
|
-
> 报销单的创建与修改统一走 `weaver-e10-workflow`(`workflow.createForm` / `workflow.createRequest` / `workflow.edit*`),旧的 `invoice.reim.form.structure`、`invoice.reim.row-info`、`invoice.reim.row-info-batch`、`invoice.reim.flow.create.prepare/apply`、`invoice.reim.flow.update.prepare/apply`、`invoice.reim.template.build`、`invoice.reim.flow.create.auto-prepare` 已移除;`invoice.issuing.qys.list` 也已由 `invoice.issuing.contracts.list` / `invoice.issuing.contract.detail`
|
|
86
|
+
> 报销单的创建与修改统一走 `weaver-e10-workflow`(`workflow.createForm` / `workflow.createRequest` / `workflow.edit*`),旧的 `invoice.reim.form.structure`、`invoice.reim.row-info`、`invoice.reim.row-info-batch`、`invoice.reim.flow.create.prepare/apply`、`invoice.reim.flow.update.prepare/apply`、`invoice.reim.template.build`、`invoice.reim.flow.create.auto-prepare` 已移除;`invoice.issuing.qys.list` 也已由 `invoice.issuing.contracts.list` / `invoice.issuing.contract.detail` 取代;`invoice.validate.preview` 已下线,发票文件统一走 `invoice.upload-and-validate`。调用这些旧 operation 会返回 `validation/operation_retired`(退出码 2),`error.details` 给出 `replacement`(替代链路)和 `reference`(skill 文档),完整清单见 `invoice schema` 的 `retiredOperations`。
|
|
84
87
|
|
|
85
88
|
共享、转让和标签仍暂不暴露给 Agent:新版源资料给出了提交接口,但还缺少稳定的接收人 `appid/cid/uid` 解析来源、标签关系查询和写后回查契约。
|
|
86
89
|
|
|
@@ -92,7 +95,6 @@ weaver-work-cli --json invoice enterprise list --input-json '{"page_size":10,"st
|
|
|
92
95
|
weaver-work-cli --json invoice get --fid INVOICE_FID
|
|
93
96
|
weaver-work-cli --json invoice upload --file ./invoice.pdf
|
|
94
97
|
weaver-work-cli --json invoice ocr preview --file ./invoice.pdf
|
|
95
|
-
weaver-work-cli --json invoice validate preview --fid INVOICE_FID --scope personal
|
|
96
98
|
weaver-work-cli --json invoice download --fid INVOICE_FID --file-id FILE_ID --output ./invoice.pdf
|
|
97
99
|
weaver-work-cli --json invoice run invoice.browse-field.data --input-json '{"fid":"INVOICE_FID"}'
|
|
98
100
|
weaver-work-cli --json invoice run invoice.reim.requests.list --input-json '{"pageNo":1,"pageSize":100}'
|
|
@@ -120,7 +122,7 @@ weaver-work-cli --json invoice import prepare --input-json '{"file":"./invoice.p
|
|
|
120
122
|
weaver-work-cli --json invoice import apply --input-json '{"file":"./invoice.pdf","continuation":"PREPARE_CONTINUATION","confirm":true}'
|
|
121
123
|
```
|
|
122
124
|
|
|
123
|
-
|
|
125
|
+
上传发票文件或远程 URL 时,面向 Agent 的默认链路是 `invoice.upload-and-validate` 一步完成上传、识别、查验。只有要设字段(`fieldKey` / `filedMap`)或用户明确要求跳过查验、离线导入时,才走 `invoice.ocr.preview` -> `invoice.import.prepare` -> `invoice.import.apply`,且只有明确跳过查验时才传 `validate=false`;`validate=false` 表示跳过查验,不能描述为“查验通过”。`filedMap`、嵌套字段映射等 JSON 参数在 `--input-json` 中保持对象,CLI 只在 multipart 提交前序列化。
|
|
124
126
|
|
|
125
127
|
报销单由 Agent 按 Skill 规则组装 `data` 后,通过 `weaver-e10-workflow` 存草稿;待开票合同由 `workflow.search` 查出合同审批流程后(用户点名检索词时追加 `requestName` 做标题模糊搜索),交给 `invoice.issuing.contracts.list` 补齐开票信息;用户选定并确认后,按销售方通过 `weaver-e10-workflow` 创建「合同收款发票开具及快递申请」或「契约锁合同收款发票开具及快递申请」草稿,不提交。发票与事前申请只按时间关联,一张发票同时落在多条事前申请上时由用户选择。CLI 不负责猜测出差客户或税率;这些规则在 Skill reference 中指导 Agent 组装。当前修正资料包没有客户档案查询或红字发票红冲接口,`invoice.customer.*` 和 `invoice.red.*` 不暴露为 operation,Agent 不能绕过 CLI 调用原始接口。写操作出现网络中断、部分成功、缺少回执 ID 或回查失败时,CLI 返回 `partial/write_uncertain`,Agent 禁止自动重复提交。
|
|
126
128
|
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# smart-extract — 泛微 E10 智能抽取
|
|
2
|
+
|
|
3
|
+
一次抽取固定两次 CLI 调用:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
fill 一次取齐:表单结构 + 识别规则 + 附件正文
|
|
7
|
+
抽取 模型按 fields/rules 产出结果(不调工具)
|
|
8
|
+
fill.save 校验 → 写库 → 回查 → 返回 aiExtraId
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
产出只有一条**批次抽取记录**(`ai_smart_fill_batch_info`):不写流程表单、不发起/不提交审批。
|
|
12
|
+
前端组件用同一个 `getBatchInfoById` 读这条记录回显、回填。用户只需要 `aiExtraId`。
|
|
13
|
+
|
|
14
|
+
## CLI 结构
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
weaver-work-cli smart-extract --help
|
|
18
|
+
weaver-work-cli smart-extract schema # operation 合约(Agent 第一信息源)
|
|
19
|
+
weaver-work-cli smart-extract run <operation> --input-json '{...}'
|
|
20
|
+
weaver-work-cli smart-extract run <operation> --input params.json
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
输出统一为 `{schemaVersion, ok, operation, risk, data, meta?, warnings[]}`;
|
|
24
|
+
失败也走 stdout(`ok:false` + `error{type,subtype,...}`),调用方只解析 stdout。
|
|
25
|
+
|
|
26
|
+
## operation
|
|
27
|
+
|
|
28
|
+
### 主链路
|
|
29
|
+
|
|
30
|
+
| operation | 风险 | 作用 |
|
|
31
|
+
| --- | --- | --- |
|
|
32
|
+
| `smart-extract.fill` | read | 取发起节点、表单结构(压缩串)、识别规则、附件正文;写 `sessionFile` |
|
|
33
|
+
| `smart-extract.fill.save` | high-risk-write | 校验 + 写库 + 回查,返回 `aiExtraId`;每次都新建 |
|
|
34
|
+
|
|
35
|
+
`fill` 并行发起 4 件事:`getFlowStartNode`(缺 nodeId 时)、`getSimple`(wf 结构)、`config/list`、附件下载;
|
|
36
|
+
结构取回后再用同一表单的 EB 定义校正 `single`。返回给模型的内容经过裁剪:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"sessionFile": "~/.weaver-work-cli/smart-extract/sessions/sf....json",
|
|
41
|
+
"fields": { "main": ["字段ID#名称#notMarked#single#Text", "..."],
|
|
42
|
+
"subTables": [{ "subFormId": "...", "subFormName": "双方证据", "fields": ["..."] }] },
|
|
43
|
+
"rules": { "globalRule": "...", "fieldRules": ["字段名#规则"], "parseFields": ["..."] },
|
|
44
|
+
"attachments": [{ "fileId": "...", "name": "...", "kind": "word", "chars": 4166,
|
|
45
|
+
"textFile": "<附件路径>.txt", "textPreview": "..." }],
|
|
46
|
+
"resultContract": "{...}",
|
|
47
|
+
"next": "..."
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
结构、规则、附件清单落在 `sessionFile` 里,`fill.save` 只凭它组装请求体。
|
|
52
|
+
|
|
53
|
+
### 排障用细粒度命令(不要串着用)
|
|
54
|
+
|
|
55
|
+
| operation | 风险 | 作用 |
|
|
56
|
+
| --- | --- | --- |
|
|
57
|
+
| `smart-extract.target.resolve` | read | 流程名/ID、表单 ID/objId → 目标 ID |
|
|
58
|
+
| `smart-extract.flow.start-node` | read | 流程发起节点 |
|
|
59
|
+
| `smart-extract.config.list` | read | 识别规则 |
|
|
60
|
+
| `smart-extract.form.structure` | read | 结构归一化 + 压缩串(EB 走 formId,流程走 workflowId+nodeId) |
|
|
61
|
+
| `smart-extract.attachment.fetch` | read | 附件 ID → 本地文件(不抽文本) |
|
|
62
|
+
| `smart-extract.result.validate` | read | 校验(与 `fill.save` 内置同一套规则) |
|
|
63
|
+
| `smart-extract.result.preview` | read | 人可读确认表(纯本地) |
|
|
64
|
+
| `smart-extract.save.prepare` | read-before-write | 组 payload + 签票据(落盘,返回 ticketFile) |
|
|
65
|
+
| `smart-extract.save.apply` | high-risk-write | 票据确认后写入批次记录 |
|
|
66
|
+
| `smart-extract.batch.get` | read | 按 aiExtraId 回查 |
|
|
67
|
+
|
|
68
|
+
主链路只要 `fill` + `fill.save`;上表只用于排障,串起来用会把一次抽取拖成几十次工具调用。
|
|
69
|
+
|
|
70
|
+
## 表单结构来源
|
|
71
|
+
|
|
72
|
+
| 场景 | 入参 | 字段范围 |
|
|
73
|
+
| --- | --- | --- |
|
|
74
|
+
| EB 建模表单 | `formId` | 全部字段(建模表单没有节点读写概念) |
|
|
75
|
+
| 流程 + 指定节点(填单默认) | `workflowId` + `nodeId` | 仅该节点可编辑/必填,只读字段被服务端过滤 |
|
|
76
|
+
|
|
77
|
+
不传 `nodeId` 时自动调 `getFlowStartNode` 取发起节点。
|
|
78
|
+
`getWorkflowSimple`(流程全量、不区分节点)不使用:会把只读/隐藏字段全部带回。
|
|
79
|
+
|
|
80
|
+
压缩串由 CLI **本地生成**,不用服务端 `isCompress`:服务端压缩遇到空属性会错位,模型解析错位串会静默写出错值。
|
|
81
|
+
|
|
82
|
+
`single`/`multiple` 以**字段定义**为准,但 wf 接口会把这个标记丢掉:
|
|
83
|
+
|
|
84
|
+
| 接口 | 案件号(Text) | 审判员(Employee) |
|
|
85
|
+
| --- | --- | --- |
|
|
86
|
+
| `getSimple?formModeType=eb` | `single: true` | `single: false` |
|
|
87
|
+
| `getSimple?formModeType=wf` | `single: false` ← 丢 | `single: false` |
|
|
88
|
+
|
|
89
|
+
照抄会把「案件号」标成 `multiple`,模型给出数组,写入必然失败。所以 wf 路径会再用同一
|
|
90
|
+
`mainFormId` 拉一次 EB 定义,按 `fieldId` 校正 `single`(EB 读不到时按字段类型兜底:
|
|
91
|
+
Text/TextArea/Number/Money/Date 视为单值)。校正数量写进 `warnings`,不静默改。
|
|
92
|
+
|
|
93
|
+
## 附件:下载 + 本地抽正文
|
|
94
|
+
|
|
95
|
+
`fill`(以及排障用的 `attachment.fetch`)走 `queryAttachmentInfo`(拿文件名/扩展名)→
|
|
96
|
+
`/api/file/remotedownload/{fileId}/meeting/true`(拿原始字节)→ 落 `<state>/smart-extract/attachments/`。
|
|
97
|
+
不带 `/meeting/true` 会 404;带上是 302 跳存储、由 runtime 跟随重定向。
|
|
98
|
+
|
|
99
|
+
服务端没有「给 fileId 返回附件正文」的 HTTP 接口(解析在 Java 内部 RPC),正文在客户端抽:
|
|
100
|
+
|
|
101
|
+
| 类型 | 处理 |
|
|
102
|
+
| --- | --- |
|
|
103
|
+
| `.docx` | 解 zip 读 `word/document.xml`(Node 自带 `zlib`,无第三方依赖),转纯文本 |
|
|
104
|
+
| `.txt/.md/.csv/.json/.xml/.html` | 直接读,HTML 去标签 |
|
|
105
|
+
| PDF / 图片 / Excel / PPT | 不抽,回 `path`,由宿主原生能力读 |
|
|
106
|
+
|
|
107
|
+
正文交付方式按剩余预算决定:`fill` 先算出结构、规则、固定说明占了多少字节,
|
|
108
|
+
stdout 预算(约 24KB)剩下的额度 ≥ 正文大小就直接内联在 `attachments[].text`(一次调用就能抽);
|
|
109
|
+
装不下才写 `<附件路径>.txt` 并回 `textFile` + 400 字预览,模型读一次文件即可。
|
|
110
|
+
额度按字数估算时保守按 3 字节/字(中文),多附件均分。
|
|
111
|
+
|
|
112
|
+
## 落库
|
|
113
|
+
|
|
114
|
+
`fill.save` **不判断记录是否已存在,每次调用都新建一条记录**:同一流程、同一附件再抽一次就是新的 `aiExtraId`。
|
|
115
|
+
|
|
116
|
+
`requestId` 由 `sessionFile` 派生(`se` + 24 位十六进制,≤32 字符),写库前先 `queryBatchInfo?requestId=` 查一次。
|
|
117
|
+
只有同一次 `fill` 重跑时值才相同,命中即说明上次写库已成功、只是响应丢了,直接返回原 `aiExtraId`(`retried:true`)。
|
|
118
|
+
新一次抽取必然是新 `sessionFile` → 新 `requestId` → 正常新建。所以 `partial/write_uncertain` 的标准动作是原样重跑一次 `fill.save`。
|
|
119
|
+
|
|
120
|
+
`ai_smart_fill_batch_info.request_id` 列宽 32:32 字符可写,59 字符直接 `Data too long for column 'request_id'` 500,
|
|
121
|
+
服务端不截断也不校验。自定义值超过 32 会在本地被拒(`request_id_too_long`);不传则由 CLI 生成。
|
|
122
|
+
|
|
123
|
+
## 校验(确定性,不靠再问模型)
|
|
124
|
+
|
|
125
|
+
`fill.save` 写库前先整理结果再跑本地校验,`errors` 非空直接拒写(`result_invalid` + `details.errors`)。
|
|
126
|
+
整理是确定性动作:主表剔除空值字段并按 `fields.main` 顺序排序、明细删整行无值的行(明细 `values` 的空串占位保留,数组必须与 `fields` 对齐)。
|
|
127
|
+
校验内容:字段 ID 是否存在、选项值是否合法(写选项名报 `option_name_used` 并给出正确值)、单值字段是否多值、
|
|
128
|
+
日期 `YYYY-MM-DD`、金额是否带千分位、明细三数组长度是否对齐、`origin` 是否为 `附件ID#原文片段`。
|
|
129
|
+
|
|
130
|
+
## 环境差异
|
|
131
|
+
|
|
132
|
+
`listCreatableFlows` 在部分租户上返回 HTTP 200 + `code:500 系统错误`(服务端流程组 RPC 挂了)。
|
|
133
|
+
`target.resolve` 对这种失败降级成 `resolved:false` + `flowListAvailable:false`,提示调用方让用户直接给
|
|
134
|
+
`workflowId`,不把整条链路判失败——不能用「列表查不到」推断「没有这个流程」。
|
|
135
|
+
|
|
136
|
+
## 边界
|
|
137
|
+
|
|
138
|
+
- `fill` 只支持流程(wf)。EB 建模表单没有对外落库接口(`saveBatchInfo` 是内部方法),
|
|
139
|
+
`fill.save`/`save.prepare` 返回 `eb_save_unsupported`:EB 场景只做「结构 + 抽取 + 校验」。
|
|
140
|
+
- 不写流程业务数据、不提交审批;填单/提交由用户在 E10 页面完成。
|
|
141
|
+
- 附件超过 200MB 或加密文件不处理,只回报元数据/失败原因。
|
|
142
|
+
|
|
143
|
+
## 调试
|
|
144
|
+
|
|
145
|
+
以 macOS/Linux 的 bash 为例。Windows PowerShell 下长中文 JSON 经管道或命令行长内联会被截断损坏(报 `E-0003 不是合法 JSON`):把 result 写成 UTF-8 无 BOM 的 JSON 文件,`--input-json` 里只传 `sessionFile` 与 `resultPath` 两个路径。
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
npm run dev -- smart-extract schema
|
|
149
|
+
npm run dev -- --json smart-extract run smart-extract.fill --input-json '{"workflowId":"...","attachmentIds":"..."}'
|
|
150
|
+
npm run dev -- --json smart-extract run smart-extract.fill.save --input-json '{"sessionFile":"...","resultPath":"result.json"}'
|
|
151
|
+
npm run dev -- --json smart-extract run smart-extract.form.structure --input-json '{"workflowId":"..."}'
|
|
152
|
+
npm run dev -- --json smart-extract run smart-extract.batch.get --input-json '{"id":"<aiExtraId>"}'
|
|
153
|
+
node --import tsx --test test/business/smart-extract-operations.test.ts
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
stdout 只有 JSON,日志走 stderr;没 JSON 就是失败。
|
package/package.json
CHANGED
|
@@ -131,7 +131,9 @@
|
|
|
131
131
|
"规则预审",
|
|
132
132
|
"预审",
|
|
133
133
|
"规则校验",
|
|
134
|
-
"AI规则"
|
|
134
|
+
"AI规则",
|
|
135
|
+
"报销待办",
|
|
136
|
+
"自用系统"
|
|
135
137
|
],
|
|
136
138
|
"weaver-e10-hrm": [
|
|
137
139
|
"组织管理",
|
|
@@ -593,5 +595,18 @@
|
|
|
593
595
|
"参观总部",
|
|
594
596
|
"参观典型客户",
|
|
595
597
|
"客户参观接待流程"
|
|
598
|
+
],
|
|
599
|
+
"weaver-e10-smart-extract": [
|
|
600
|
+
"智能抽取",
|
|
601
|
+
"表单数据抽取",
|
|
602
|
+
"字段抽取",
|
|
603
|
+
"附件信息提取",
|
|
604
|
+
"表单结构",
|
|
605
|
+
"识别规则",
|
|
606
|
+
"抽取结果校验",
|
|
607
|
+
"智能填单",
|
|
608
|
+
"填单抽取",
|
|
609
|
+
"流程表单字段",
|
|
610
|
+
"EB 表单字段"
|
|
596
611
|
]
|
|
597
612
|
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
- `ai-check-audit.md`:AI 规则预审(提交前按流程规则校验单据,prepare→apply 写链),含 `status` 三态、ID 约定、`checkMode`/`dimension`/`recordId` 语义与结果不确定处理。
|
|
8
8
|
- `loan-management.md`:借款管理(汇总/列表/提醒还款 prepare→apply 写链),含 menuCode 核对与回查策略。
|
|
9
9
|
- `invoice-writeoff.md`:发票核销(金额 tab/列表/催票 prepare→apply 写链),含 invoiceStatus 枚举与回查策略。
|
|
10
|
+
- `self-hosted-mode.md`:自用系统专场(仅 `baseUrl` 含 `e-cology`),含环境判定与非自用固定拒绝、报销类近义词只查总部费用报销、报销待办 AI 预审五步、客户/项目/合同转 Skill 与自动补齐。CLI 侧无新增 operation。
|
|
10
11
|
- `source-manifest.json`:源资料指纹与生成产物基线,供更新检测。
|
|
11
12
|
|
|
12
13
|
Agent 调优重点:
|
|
@@ -18,3 +19,4 @@ Agent 调优重点:
|
|
|
18
19
|
- AI 预审按 `data.status` 回话(`checked`/`empty`/`unparsed`),`empty` 不是报错;`workflowId`/`requestId`/`nodeId` 不得传 0。
|
|
19
20
|
- 结果为 `partial/write_uncertain` 时停止并做一次只读回查,不自动重放写请求。
|
|
20
21
|
- 借款金额查询已知只统计首条记录,对外汇报注明口径。
|
|
22
|
+
- 自用系统能力先判环境:只读 `auth status --no-check` 的 `baseUrl`;非自用环境固定拒绝,不降级、不改用其它接口拼装近似结果。
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
本业务域用于泛微 E10 智能抽取(表单结构化数据抽取)。主链路只有两条命令:`smart-extract.fill`(一次取齐结构+规则+附件正文)与 `smart-extract.fill.save`(校验+落库+回查,返回 `aiExtraId`);其余 operation 仅用于排障。入口 `SKILL.md` 先路由到 `weaver-e10-shared/SKILL.md`,再给出两步链路与字段值规则。具体用法拆到 `references/`:
|
|
2
|
+
|
|
3
|
+
- `api-contract.md`:operation 与服务端接口的对照(主链路 + 排障命令)、两个结构数据源的差异、压缩串格式、落库字段口径。
|
|
4
|
+
- `result-format.md`:抽取结果 JSON 契约(`isSuccess/mainTable/subTables`、明细三数组对齐、origin 写法)与完整示例。
|
|
5
|
+
- `troubleshooting.md`:fill 取不到结构、附件读不到、校验错误码改法、保存异常(含 `write_uncertain`)与调试组合拳。
|
|
6
|
+
|
|
7
|
+
执行约束:
|
|
8
|
+
|
|
9
|
+
- **一次抽取就是 `fill` →(长文档读一次 `textFile`)→ `fill.save`。** 不要串 `target.resolve → config.list → form.structure → attachment.fetch → result.validate → result.preview → save.prepare → save.apply → batch.get`。
|
|
10
|
+
- **`weaver-work-cli smart-extract schema` 是 operation 合约第一信息源**;`inputSchema` 全部 `additionalProperties:false`,传错字段会立刻失败。
|
|
11
|
+
- **`fill` 已经做了这些,不要重复调**:取发起节点、取节点结构并按 EB 定义校正 `single`、取识别规则、下载附件、docx 抽正文。返回的 `fields.main`/`fields.subTables[].fields` 就是唯一字段清单(压缩串,不含 `fieldDbName`/`optionId` 之类冗余)。
|
|
12
|
+
- **结构和规则不落模型上下文,落在 `sessionFile`**:`fill.save` 只凭 `sessionFile` + `result` 组装请求体,不要自己解析或改写它。
|
|
13
|
+
- **校验是落库前的硬闸**:`fill.save` 内置 `result.validate` 同一套规则,失败返回 `result_invalid` + `details.errors`;按 errors 改结果再调一次 `fill.save`,不要改去调 `validate`。
|
|
14
|
+
- **每次都新建**:`fill.save` 不判断记录是否已存在,同一附件再抽一次就是一条新记录,直接报新 `aiExtraId`。唯一例外是同一次 `fill` 的重试(`requestId` 按 `sessionFile` 派生),返回 `retried:true` + 原 `aiExtraId`。
|
|
15
|
+
- **`write_uncertain` 直接重跑同一条 `fill.save`**:requestId 命中上一次已写入的记录,不会重复入库。
|
|
16
|
+
- **`fill` 只支持流程(wf)**:EB 建模表单没有对外落库接口,返回 `eb_save_unsupported`;填单/提交由用户在页面完成。
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
- `invoice-enterprise-list.md`:企业票夹查询,默认筛选未报销发票。
|
|
6
6
|
- `invoice-detail.md`:按 `fid` 或 `number` 查看详情。
|
|
7
7
|
- `invoice-file-upload.md`:上传发票文件。
|
|
8
|
-
- `invoice-ocr-preview.md
|
|
9
|
-
- `invoice-
|
|
8
|
+
- `invoice-ocr-preview.md`:用户只说识别时的 OCR 预览,不查验,不描述为已入票夹。
|
|
9
|
+
- `invoice-upload-and-validate.md`:查验、上传文件查验、上传文件报销、上传入票夹的默认入口,上传、识别、查验一步到位。
|
|
10
10
|
- `invoice-download.md`:下载发票附件。
|
|
11
11
|
- `invoice-browse-field-data.md`:生成流程表单发票浏览按钮字段对象。
|
|
12
12
|
- `invoice-import.md`:导入发票文件或远程 URL 的 `prepare -> apply` 写入协议;`filedMap` 等 JSON 参数在 inputSchema 中保持 object。
|
|
@@ -74,9 +74,10 @@ weaver-work-cli --json data attend statis --user <人员ID> --begin 2026-01-01 -
|
|
|
74
74
|
## `query`:裸 DSL
|
|
75
75
|
|
|
76
76
|
```text
|
|
77
|
-
weaver-work-cli --json data query --conn <connId> --model <model> --schema <schema>
|
|
77
|
+
weaver-work-cli --json data query --conn <connId> --model <model> --schema <schema> \
|
|
78
|
+
--dsl @dsl.json --question-context @context.json
|
|
78
79
|
```
|
|
79
80
|
|
|
80
|
-
`
|
|
81
|
+
`data query` 与 `ds list/chart/stat/count` 走不同后端接口,是独立查询通道。前者适用于已经明确需要手写 DslQuery(如自定义表达式)的场景;后者适用于已知数据集和标准 `fields` / `where` / `stat` DTO 的查询。
|
|
81
82
|
|
|
82
|
-
|
|
83
|
+
每次 DSL 查询必须传入 `--question-context <json|@file>`;CLI 将其原样下发为 `questionContext`,不缓存、补造或复用历史上下文。
|