weaver-work-cli 0.1.49 → 0.1.52
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-MU2LPI5P.js → attachment-content-MBYYSQIX.js} +3 -3
- package/dist/chunks/{chunk-ZKEUGS2U.js → chunk-7UOXOGFL.js} +4 -4
- package/dist/chunks/{chunk-72MI3MBX.js → chunk-ATEXBEPD.js} +55 -15
- package/dist/chunks/{chunk-3NV2ETZR.js → chunk-D3TDNRFE.js} +8 -8
- package/dist/chunks/{chunk-6GWU63YF.js → chunk-DZOC77ZD.js} +1 -1
- package/dist/chunks/{chunk-K3BT54CU.js → chunk-IRMA3GVP.js} +1 -1
- package/dist/chunks/{chunk-3X7VOSBA.js → chunk-KLZ3ULQQ.js} +1 -1
- package/dist/chunks/{chunk-YLCYX7LE.js → chunk-KMRT7NAT.js} +18 -5
- package/dist/chunks/{chunk-NBEWUR7L.js → chunk-LALWNK6M.js} +167 -44
- package/dist/chunks/{chunk-BRRW7CWA.js → chunk-LM2H7SZI.js} +26 -26
- package/dist/chunks/{chunk-KV5SOWMS.js → chunk-LTRLF6MM.js} +4 -4
- package/dist/chunks/{chunk-D2QRZUW4.js → chunk-RPRFIG6I.js} +35 -28
- package/dist/chunks/{chunk-GEOMANP7.js → chunk-RWFRZSIP.js} +2 -2
- package/dist/chunks/{chunk-EJVA5ZVB.js → chunk-ZRHKGQRQ.js} +2 -2
- package/dist/chunks/{conflict-6347A7YK.js → conflict-D2HYKBMH.js} +2 -2
- package/dist/chunks/{contract-N6P2HIIE.js → contract-MFOFMM2J.js} +4284 -254
- package/dist/chunks/{create-flow-7WG7LVX5.js → create-flow-7ZATJVTM.js} +6 -6
- package/dist/chunks/{data-QO7QWOIV.js → data-WK5CQXNF.js} +17 -32
- package/dist/chunks/{env-LHRKSLG6.js → env-5DO4YENS.js} +2 -2
- package/dist/chunks/{factory-2H7Z4RWJ.js → factory-3M7D7WJC.js} +1 -1
- package/dist/chunks/{fna-ZVB2IILI.js → fna-ECOYBQYL.js} +328 -5
- package/dist/chunks/{group-chat-EW6PNDDT.js → group-chat-B2HT5NEO.js} +3 -3
- package/dist/chunks/{im-3RCNL5GT.js → im-TN2JYVGJ.js} +2 -2
- package/dist/chunks/{invoice-FXWH5GPO.js → invoice-V7ZTITUO.js} +726 -206
- package/dist/chunks/{meeting-N2FQBHXI.js → meeting-HZOX3CBB.js} +10 -10
- package/dist/chunks/{msg-parse-4GSQ2WTO.js → msg-parse-FPFVPMYI.js} +5 -1
- package/dist/chunks/{reception-MYOKJULO.js → reception-QGPNTGHG.js} +98 -82
- package/dist/chunks/{recruit-stage-FKWS5UQF.js → recruit-stage-XCMVEQA2.js} +718 -131
- package/dist/chunks/{registry-BUTEDK3C.js → registry-E5RQJVWN.js} +2 -2
- package/dist/chunks/{registry-7VZ6YJUF.js → registry-KYPFFQIH.js} +1 -1
- package/dist/chunks/{registry-CKUVBS53.js → registry-SJHSBO5G.js} +10 -10
- package/dist/chunks/{room-recommend-MBCYENQ2.js → room-recommend-5AHR4YQV.js} +4 -4
- package/dist/chunks/{schedule-5IFMCXME.js → schedule-KZPJUPC2.js} +4 -4
- package/dist/chunks/smart-extract-IXHCZE4R.js +2846 -0
- package/dist/chunks/{workflow-2TRU2ZSP.js → workflow-UHKCZJMY.js} +1 -1
- package/dist/index.js +14 -9
- package/dist/shortcuts/contract/host.js +11 -0
- package/dist/shortcuts/contract/index.js +13 -0
- package/dist/shortcuts/contract/manifest.js +204 -0
- package/dist/shortcuts/contract/operations/card-action.js +585 -0
- package/dist/shortcuts/contract/operations/card-ebdf-list.js +315 -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/elements-build.js +714 -0
- package/dist/shortcuts/contract/operations/elements-spec.js +216 -0
- package/dist/shortcuts/contract/operations/first-screen.js +563 -0
- package/dist/shortcuts/contract/operations/flow.js +81 -25
- 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 +58 -7
- package/dist/shortcuts/contract/operations/quote.js +410 -22
- package/dist/shortcuts/contract/operations/registry.js +22 -0
- package/dist/shortcuts/contract/operations/review.js +73 -58
- package/dist/shortcuts/contract/operations/save-recognize.js +151 -0
- package/dist/shortcuts/contract/operations/summary-validate.js +293 -0
- package/dist/shortcuts/contract/operations/summary.js +4 -2
- 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/fna/host.js +4 -2
- package/dist/shortcuts/fna/manifest.js +14 -5
- package/dist/shortcuts/fna/operations/audit.js +334 -0
- package/dist/shortcuts/fna/operations/registry.js +2 -0
- package/dist/shortcuts/im/operations/at-mention.js +6 -3
- package/dist/shortcuts/im/operations/msg-parse.js +35 -5
- package/dist/shortcuts/im/operations/msg-sync.js +3 -1
- package/dist/shortcuts/im/operations/msg-write.js +57 -9
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/invoice/index.js +0 -12
- package/dist/shortcuts/invoice/manifest.js +201 -50
- 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/meeting/operations/from-group-chat.js +16 -2
- package/dist/shortcuts/reception/constants.js +3 -7
- package/dist/shortcuts/reception/operations/leads.js +30 -6
- package/dist/shortcuts/reception/operations/panels.js +3 -2
- 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 +489 -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 +408 -0
- package/dist/shortcuts/workflow/operations/read.js +77 -15
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +140 -24
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +42 -14
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +4 -6
- package/docs/SKILL.md +1 -1
- package/docs/_catalog.md +4 -1
- package/docs/agent-invoice.md +5 -7
- package/docs/data.md +5 -1
- package/docs/fna.md +24 -4
- package/docs/invoice.md +7 -5
- package/docs/smart-extract.md +156 -0
- package/package.json +1 -1
- package/skill-template/business-info.json +21 -1
- package/skill-template/domains/qiyecheng.md +6 -2
- 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 +159 -11
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +13 -8
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +5 -4
- package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +44 -2
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +220 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +68 -33
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +26 -15
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +128 -0
- package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +90 -0
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +96 -2
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +167 -5
- package/skills/weaver-e10-jinchengda/scripts/contract_first_screen.py +200 -0
- package/skills/weaver-e10-jinchengda/scripts/fill_contract_from_quote.py +572 -0
- package/skills/weaver-e10-jinchengda/scripts/fill_plan.py +997 -0
- package/skills/weaver-e10-jinchengda/scripts/quote_screen.py +560 -0
- package/skills/weaver-e10-jinchengda/scripts/triage_contract.py +894 -0
- package/skills/weaver-e10-jinchengda/scripts/validate_action_card.py +93 -0
- package/skills/weaver-e10-jinchengda/scripts/verify_docx_placeholders.py +118 -0
- package/skills/weaver-e10-qiyecheng/SKILL.md +58 -7
- package/skills/weaver-e10-qiyecheng/references/ai-check-audit.md +118 -0
- package/skills/weaver-e10-qiyecheng/references/budget.md +14 -0
- package/skills/weaver-e10-qiyecheng/references/catalog.md +42 -3
- 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 +153 -40
- package/skills/weaver-e10-reception-flow/SKILL.md +43 -6
- package/skills/weaver-e10-reception-flow/references/guide.md +1 -1
- 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 -40
- 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 +169 -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 +105 -0
- package/skills/weaver-e10-workflow/SKILL.md +2 -1
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +29 -6
- 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-workflow/tools/todo-summary.cjs +162 -10
- package/skills/weaver-e10-yepiaotong/SKILL.md +53 -35
- 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-issuing-workflow.md +19 -32
- 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 +18 -53
- package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +97 -39
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +96 -7
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +5 -38
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +14 -14
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +8 -4
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +139 -94
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +131 -58
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +110 -43
- package/skills/weaver-e10-yimiaoban/SKILL.md +8 -6
- package/skills/weaver-e10-yimiaoban/references/msg-read.md +20 -0
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +7 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +18 -15
- 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_risk_report.py +0 -358
- package/skills/weaver-e10-yepiaotong/references/invoice-validation-preview.md +0 -40
|
@@ -43,6 +43,26 @@ weaver-work-cli --json im run im.msg.top.sync --input-json '{"groupId":"17883342
|
|
|
43
43
|
## 输出处理
|
|
44
44
|
|
|
45
45
|
- `data.messages[]` 是已解析的结构化行:`sender`(姓名,走 hrm)、`time`、`typeName`(文本/图片/视频/文件…)、`content`(完整文本,不截断)、`media`(图片/视频/文件的预览与下载 URL,需登录态访问)、`must`(必达标记,`true` 展示加 `[必达]` 前缀)等。
|
|
46
|
+
- **消息类型(消息体最外层 `type`)官方枚举**(2026-11-11 上游确认,`typeName` 按此表展示):
|
|
47
|
+
|
|
48
|
+
| type | 含义 | type | 含义 |
|
|
49
|
+
| --- | --- | --- | --- |
|
|
50
|
+
| 1 | 文本 | 14 | 居中(灰色字体) |
|
|
51
|
+
| 2 | 图片 | 15 | 第三方(im 不解析) |
|
|
52
|
+
| 3 | 语音 | 16 | 语音通话 |
|
|
53
|
+
| 4 | 文件 | 17 | 合并转发 |
|
|
54
|
+
| 5 | 地理位置 | 18 | 视频通话 |
|
|
55
|
+
| 6 | 图文 | 19 | 群公告通知消息 |
|
|
56
|
+
| 7 | 视频 | 20 | 分享地址(消息体 `t`:0 群分享;1 人员卡片即名片) |
|
|
57
|
+
| 8 | 事项 | 21 | 表情消息 |
|
|
58
|
+
| 9 | 系统 | 22 | 强提醒 |
|
|
59
|
+
| 10 | 撤回 | 23 | 链接消息 |
|
|
60
|
+
| 11 | 抖一抖 | 24 | 群接龙 |
|
|
61
|
+
| 12 | 屏蔽 | 25 | +1回复 |
|
|
62
|
+
| — | — | 26 | 富文本 |
|
|
63
|
+
|
|
64
|
+
- **特别说明 type=26(富文本)**:含义是**一个消息里可能包含多种类型数据段**(纯文本、图片、文件等混合),**不能把 26 等价于 markdown 格式消息**。26 中只有带 `vt=1` 的 txt 段,其 `v` 才是 markdown 原文(见下条 contentFormat 规则)。
|
|
65
|
+
- **markdown 消息**:行内 `contentFormat` 标识内容格式——`contentFormat:"markdown"`(判定两要素:消息体最外层 `type=26`(富文本)**且** `txt` 段带 `vt=1`;客户端仅对 type=26 的消息按 markdown 解析,type≠26 时即使带 vt=1 也按普通文本处理。注意 26 是富文本(可混合多类型段),**26 不等价于 markdown**)时,`content` 是 **markdown 原文**:换行**保持原样**(未折叠成 ⏎)、表格/加粗/引用等原样保留。展示时按 markdown 渲染,**不要把换行压平、不要把 `|` 当普通字符转义后塞进表格**,也**不要自行截断**;`contentFormat:"text"` 为普通文本(换行以 ⏎ 表示,按原有规则处理)。
|
|
46
66
|
- **引用/回复消息**:行内出现顶层 `quote`(`kind`:`quote` 引用 / `reply` 回复;含被引消息 `id`、被引人 `fromName`、被引内容 `text`、`quoteTime` 被引时间)。展示时把引用信息与正文一起呈现(如 `回复 <fromName>:<text>:<正文>`),不要只展示正文漏掉引用关系。
|
|
47
67
|
- 顺序:消息按消息 id **从新到旧**(最新在最前)返回。
|
|
48
68
|
- 分页字段:`pages`(本次实际拉了几页)、`autoPaged`(是否走了自动翻页)、`pageSize`、`exhausted`、`hasMore`、`nextStart`(还有更早数据时的续拉锚点)、`range.scope`(`today`/`range`/`latest`/`explicit-id`)、`rangeShrink`(7 天收敛提示)。
|
|
@@ -23,6 +23,13 @@
|
|
|
23
23
|
- **群聊**:引用与回复都支持;prepare 阶段按 id 在群内自动定位被引消息并组装服务端原生 `ref`/`rmsg`(含被引人姓名与被引内容预览 `rcon`),姓名走 hrm 解析;被引消息拉不到/不在群内报 `quote_msg_not_found`。
|
|
24
24
|
- **单聊**:**仅支持引用(`quoteMsgId`),不支持回复**(传 `replyMsgId` 报 `reply_not_supported`);prepare 在该单聊会话内定位被引消息。
|
|
25
25
|
- 与 `img`/`file` 不能同发(`quote_requires_txt`)。
|
|
26
|
+
- **markdown 消息(单聊/群聊/普通必达)**:`txt` 传 **markdown 原文**(表格/加粗/标题/引用块/列表等)+ `markdown:true`。
|
|
27
|
+
- **客户端解析约束**:客户端**仅对消息体最外层 `type=26`(富文本)的消息按 markdown 解析渲染**;`vt=1` 只是内容标记,必须配合 type=26 才生效。注意 26 的含义是富文本(一个消息里可包含文本/图片/文件等多种类型数据段),**26 不等价于 markdown 消息**。
|
|
28
|
+
- CLI 发送时把 txt 放进完整原生 msg JSON 的 `dt[0].txt`,外层 **`type: "26"`** 且 txt 段带 **`vt: "1"`**(与 `v` 同级,与客户端 markdown 消息格式一致;不传 `markdown` 时按普通文本 `type:"1"` 发,行为与旧版完全一致)。
|
|
29
|
+
- **markdown 仅支持纯文本消息**:与 `img`/`file` 同用报 `markdown_txt_only`;不带 `txt` 报 `markdown_requires_txt`。
|
|
30
|
+
- 群聊 markdown **可与 @/引用/回复叠加**(同一 msg JSON 内外层 `type:"26"`,txt 段同时带 `aus`/`ref` 与 `vt=1`);单聊 markdown 可与 `quoteMsgId` 叠加。
|
|
31
|
+
- 普通必达(`im.ding.send`)同样支持 `markdown:true`;**转必达(`convertMsgid`)不支持**——沿用源消息格式(`markdown_txt_only`)。
|
|
32
|
+
- prepare 摘要带 `contentFormat:"markdown"` 供确认时核对;2026-11-11 已在 yunteams 实测收发回路:发送(vt=1)→ 服务端存储 → 拉取解析 `contentFormat:"markdown"` + markdown 原文完整还原。
|
|
26
33
|
- **全空白文本(空格/换行)不算内容,会被拒绝(`content_required`)**;`img` 与 `file` 一次只能传一种(`content_conflict`)。
|
|
27
34
|
- **同一个图片/文件可以反复发送**:CLI 上传前会做 `preUploadCheck`,服务端按 MD5 命中已有文件时走「秒传」直接复用文件对象,只发 1 次 HTTP(不再走 `valid/upload`)。因此不要为了「避免重复上传失败」而改名、改内容或另存副本。
|
|
28
35
|
- 撤回:`type`(single/group)+ `msgid`(消息 `ser_msgid`);单聊还需 `toUid`/`toCid`,群聊还需 `groupId`。**只能撤回本人发出的消息,且有时限**——`apply` 回包会给出该环境实际时限(`withdrawInterval`,实测如"30 秒",不同环境可能是"2 分钟"),超时(1505)错误里也会带上;以回包值为准,不要写死时限。
|
|
@@ -1328,6 +1328,7 @@
|
|
|
1328
1328
|
"toUid",
|
|
1329
1329
|
"toCid",
|
|
1330
1330
|
"txt",
|
|
1331
|
+
"markdown",
|
|
1331
1332
|
"quoteMsgId",
|
|
1332
1333
|
"img",
|
|
1333
1334
|
"file"
|
|
@@ -1367,6 +1368,7 @@
|
|
|
1367
1368
|
"schemaFields": [
|
|
1368
1369
|
"groupId",
|
|
1369
1370
|
"txt",
|
|
1371
|
+
"markdown",
|
|
1370
1372
|
"atAll",
|
|
1371
1373
|
"atUids",
|
|
1372
1374
|
"quoteMsgId",
|
|
@@ -1490,6 +1492,7 @@
|
|
|
1490
1492
|
"toUid",
|
|
1491
1493
|
"toCid",
|
|
1492
1494
|
"txt",
|
|
1495
|
+
"markdown",
|
|
1493
1496
|
"convertMsgid",
|
|
1494
1497
|
"unreadOnly",
|
|
1495
1498
|
"toUids",
|
|
@@ -2270,7 +2273,7 @@
|
|
|
2270
2273
|
}
|
|
2271
2274
|
},
|
|
2272
2275
|
"artifactBaseline": {
|
|
2273
|
-
"aggregateSha256": "
|
|
2276
|
+
"aggregateSha256": "8d1fff2eef713b7e313628bca155e4b8de1144a377d6b3f08f33b3b0fff2d104",
|
|
2274
2277
|
"files": [
|
|
2275
2278
|
{
|
|
2276
2279
|
"path": "docs/im.md",
|
|
@@ -2323,14 +2326,14 @@
|
|
|
2323
2326
|
{
|
|
2324
2327
|
"path": "skills/weaver-e10-yimiaoban/references/msg-read.md",
|
|
2325
2328
|
"role": "generated-reference",
|
|
2326
|
-
"size":
|
|
2327
|
-
"sha256": "
|
|
2329
|
+
"size": 7615,
|
|
2330
|
+
"sha256": "592e57ce79f2407b04169c6928bd0b30b90c6ce6a65f54908e4f5e13b432d2a0"
|
|
2328
2331
|
},
|
|
2329
2332
|
{
|
|
2330
2333
|
"path": "skills/weaver-e10-yimiaoban/references/msg-write.md",
|
|
2331
2334
|
"role": "generated-reference",
|
|
2332
|
-
"size":
|
|
2333
|
-
"sha256": "
|
|
2335
|
+
"size": 14869,
|
|
2336
|
+
"sha256": "cee403b24d21dff62b05445553c815cc972de63dd71595a42dbb71ddf1284049"
|
|
2334
2337
|
},
|
|
2335
2338
|
{
|
|
2336
2339
|
"path": "skills/weaver-e10-yimiaoban/references/person.md",
|
|
@@ -2359,8 +2362,8 @@
|
|
|
2359
2362
|
{
|
|
2360
2363
|
"path": "skills/weaver-e10-yimiaoban/SKILL.md",
|
|
2361
2364
|
"role": "generated-reference",
|
|
2362
|
-
"size":
|
|
2363
|
-
"sha256": "
|
|
2365
|
+
"size": 33168,
|
|
2366
|
+
"sha256": "5fbf183a17bd32910f0da37b1cfc0bf1f550db3e79a8222c186c4f398ddcabad"
|
|
2364
2367
|
},
|
|
2365
2368
|
{
|
|
2366
2369
|
"path": "src/shortcuts/im/continuation.ts",
|
|
@@ -2405,8 +2408,8 @@
|
|
|
2405
2408
|
},
|
|
2406
2409
|
{
|
|
2407
2410
|
"path": "src/shortcuts/im/operations/at-mention.ts",
|
|
2408
|
-
"size":
|
|
2409
|
-
"sha256": "
|
|
2411
|
+
"size": 6065,
|
|
2412
|
+
"sha256": "9d9061ff5f5e7147e071d0db5eae0fbb56885c9fa10d96ea246741145cfea871"
|
|
2410
2413
|
},
|
|
2411
2414
|
{
|
|
2412
2415
|
"path": "src/shortcuts/im/operations/file-user.ts",
|
|
@@ -2429,20 +2432,20 @@
|
|
|
2429
2432
|
{
|
|
2430
2433
|
"path": "src/shortcuts/im/operations/msg-parse.ts",
|
|
2431
2434
|
"role": "generated-cli",
|
|
2432
|
-
"size":
|
|
2433
|
-
"sha256": "
|
|
2435
|
+
"size": 17431,
|
|
2436
|
+
"sha256": "046dbd7fb7520e09deaf817e04dd12afd254170bba58479b3d21a9b19a17dc51"
|
|
2434
2437
|
},
|
|
2435
2438
|
{
|
|
2436
2439
|
"path": "src/shortcuts/im/operations/msg-sync.ts",
|
|
2437
2440
|
"role": "generated-cli",
|
|
2438
|
-
"size":
|
|
2439
|
-
"sha256": "
|
|
2441
|
+
"size": 24909,
|
|
2442
|
+
"sha256": "7d5ededfdb0e9529929154305a8d99db7e8df2cd2ba563bd3ee14f4b8a6f150b"
|
|
2440
2443
|
},
|
|
2441
2444
|
{
|
|
2442
2445
|
"path": "src/shortcuts/im/operations/msg-write.ts",
|
|
2443
2446
|
"role": "generated-cli",
|
|
2444
|
-
"size":
|
|
2445
|
-
"sha256": "
|
|
2447
|
+
"size": 35188,
|
|
2448
|
+
"sha256": "497df028da5cbb40d769640ab9f8ea0e5f2fb383194b8dbf90311283870d1190"
|
|
2446
2449
|
},
|
|
2447
2450
|
{
|
|
2448
2451
|
"path": "src/shortcuts/im/operations/person.ts",
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { InvoiceCliError } from '../errors.js';
|
|
2
|
-
import { detailInfo, getDetail, identityFingerprint, normalizeScope, operateType, reqBase, validationPreview, workflow, } from './shared.js';
|
|
3
|
-
export class InvoiceValidatePreviewOperation {
|
|
4
|
-
name = 'invoice.validate.preview';
|
|
5
|
-
async execute(input, { host }) {
|
|
6
|
-
const scope = normalizeScope(input.scope);
|
|
7
|
-
const session = await host.getSession();
|
|
8
|
-
const detail = await getDetail({ fid: input.fid }, host);
|
|
9
|
-
const info = detailInfo(detail);
|
|
10
|
-
const result = await host.invoiceRequest({
|
|
11
|
-
path: '/api/inc/valid',
|
|
12
|
-
method: 'POST',
|
|
13
|
-
body: {
|
|
14
|
-
info,
|
|
15
|
-
flag: 100,
|
|
16
|
-
is_cut: 0,
|
|
17
|
-
is_save: 1,
|
|
18
|
-
operate_type: operateType(scope),
|
|
19
|
-
needLog: true,
|
|
20
|
-
req_base: reqBase({ numericTrace: true }),
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
if (!result?.info) {
|
|
24
|
-
throw new InvoiceCliError('api', 'validation_empty', '查验接口未返回发票信息', { details: { result }, exitCode: 1 });
|
|
25
|
-
}
|
|
26
|
-
if (identityFingerprint(result.info) !== identityFingerprint(info)) {
|
|
27
|
-
throw new InvoiceCliError('api', 'validation_target_mismatch', '查验返回的票面身份字段与目标发票不一致', { exitCode: 1 });
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
status: 'COMPLETE',
|
|
31
|
-
data: {
|
|
32
|
-
preview: validationPreview(result.info, scope, input.fid, session.baseUrl),
|
|
33
|
-
info: result.info,
|
|
34
|
-
saved: false,
|
|
35
|
-
result,
|
|
36
|
-
workflow: workflow('invoice.validate.preview', 'COMPLETE'),
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
"""
|
|
4
|
-
plan_actions.py — 合同动作推荐引擎(可执行实现,2026-11-09 新增)
|
|
5
|
-
|
|
6
|
-
背景:此前 `contract-action-engine.md` 只是算法文档,1~4 张卡片全靠模型每次手算,
|
|
7
|
-
实测出现「预审后只给 1 张报告卡、漏掉查看审查详情/发起流程/查资信」的偏差。
|
|
8
|
-
本脚本把注册表、requires、抑制、排序、截断固化为可执行逻辑,
|
|
9
|
-
模型只需提供上下文状态 JSON,不再自行推断卡片条数。
|
|
10
|
-
|
|
11
|
-
用法:
|
|
12
|
-
python scripts/plan_actions.py --context ctx.json
|
|
13
|
-
python scripts/plan_actions.py --context ctx.json --pretty
|
|
14
|
-
也可以传 JSON 字符串: python scripts/plan_actions.py --context-json '{"reviewed":true,...}'
|
|
15
|
-
|
|
16
|
-
上下文(全部可选,缺省为 false / null):
|
|
17
|
-
scene doc | query | config(默认 doc)
|
|
18
|
-
docType contract | quote | tender | other
|
|
19
|
-
hasFileId 已有审查用 fileId
|
|
20
|
-
flowKey 契约锁 | 新客户 | 常规二次销售 | 老客户增值 | null
|
|
21
|
-
hasCounterparty 有对方企业全称
|
|
22
|
-
summaryReady 摘要已生成
|
|
23
|
-
reviewStarted 预审已触发(已预热/审查在跑),但**尚未拿到审查结果**
|
|
24
|
-
reviewed 已拿到审查结果(只有它为真才允许导出审查报告)
|
|
25
|
-
submitted 流程已发起
|
|
26
|
-
requestId 流程实例 id
|
|
27
|
-
compared 已完成比对
|
|
28
|
-
comparePair 比对文件对
|
|
29
|
-
compareReportReady 比对报告已生成
|
|
30
|
-
generatedDocx 报价单已生成合同
|
|
31
|
-
otherVersionAvailable 会话内存在另一版本
|
|
32
|
-
lastAction 上一步刚执行的动作 id(本轮剔除)
|
|
33
|
-
|
|
34
|
-
输出:JSON(count / title / cards[]),退出码 0。FAIL 情形返回 1 并说明缺口。
|
|
35
|
-
"""
|
|
36
|
-
|
|
37
|
-
import argparse
|
|
38
|
-
import io
|
|
39
|
-
import json
|
|
40
|
-
import sys
|
|
41
|
-
|
|
42
|
-
MAX_CARDS = 4
|
|
43
|
-
|
|
44
|
-
# ── 动作注册表 ───────────────────────────────────────────────
|
|
45
|
-
# requires : 全部为真才进候选
|
|
46
|
-
# blocked : 任一为真则退场(终态不回推 / 已完成不重复)
|
|
47
|
-
# walk : e10Sdk(系统页面已存在)/ artifact(内容已在手)/ sendQuestion(需现场加工)
|
|
48
|
-
ACTIONS = [
|
|
49
|
-
{
|
|
50
|
-
"id": "generate-contract",
|
|
51
|
-
"title": "按报价单生成合同",
|
|
52
|
-
"weight": 100,
|
|
53
|
-
"walk": "sendQuestion",
|
|
54
|
-
"desc": "用真实模板把标的与金额填成合同 docx | 缺 .docx 模板 | 3~5 步 · 确认 1 次",
|
|
55
|
-
"requires": {"docType": ["quote", "tender"]},
|
|
56
|
-
"blocked": ["generatedDocx"],
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"id": "launch-flow",
|
|
60
|
-
"title": "发起「{flowKey}」合同流程",
|
|
61
|
-
"weight": 100,
|
|
62
|
-
"walk": "e10Sdk",
|
|
63
|
-
"desc": "生成正式审批单并进入流转 | 证据齐 | 4~7 步 · 确认 2 次",
|
|
64
|
-
"requires": {"flowKey": "set", "hasFileId": True},
|
|
65
|
-
"blocked": ["submitted"],
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"id": "review",
|
|
69
|
-
"title": "合同预审",
|
|
70
|
-
"weight": 92,
|
|
71
|
-
"walk": "sendQuestion",
|
|
72
|
-
"desc": "发消息让 AI 出风险条款与修改建议 | 只读,不改原文",
|
|
73
|
-
"requires": {"hasFileId": True},
|
|
74
|
-
# 已经触发过审查(reviewStarted)就不再给「合同预审」,避免重复触发
|
|
75
|
-
"blocked": ["reviewed", "reviewStarted"],
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"id": "export-review",
|
|
79
|
-
"title": "导出审查报告",
|
|
80
|
-
"weight": 84,
|
|
81
|
-
"walk": "artifact",
|
|
82
|
-
"desc": "查看风险条款、问题说明与建议修改 | 只读 | 点开即看",
|
|
83
|
-
# 只有「已拿到审查结果」才允许导出;reviewStarted 但无结果时不得出现
|
|
84
|
-
"requires": {"reviewed": True},
|
|
85
|
-
"blocked": [],
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
"id": "view-compare",
|
|
89
|
-
"title": "查看比对详情",
|
|
90
|
-
"weight": 82,
|
|
91
|
-
"walk": "e10Sdk",
|
|
92
|
-
"desc": "左右对照看两版差异 | 只读,仅开页面",
|
|
93
|
-
"requires": {"compared": True},
|
|
94
|
-
"blocked": [],
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"id": "view-review",
|
|
98
|
-
"title": "查看审查详情",
|
|
99
|
-
"weight": 80,
|
|
100
|
-
"walk": "e10Sdk",
|
|
101
|
-
"desc": "打开 AI 审查页看逐条判定与原文定位 | 只读,不改原文",
|
|
102
|
-
# 审查进行中(reviewStarted)与已出结果(reviewed)两种情况都要给:
|
|
103
|
-
# 前者是用户稍后回来看进度的唯一入口,后者可看逐条判定
|
|
104
|
-
"requires": {},
|
|
105
|
-
"any_of": [{"reviewed": True}, {"reviewStarted": True}],
|
|
106
|
-
"blocked": [],
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
"id": "export-compare-report",
|
|
110
|
-
"title": "生成比对报告",
|
|
111
|
-
"weight": 78,
|
|
112
|
-
"walk": "artifact",
|
|
113
|
-
"desc": "出四指标统计与差异清单 | 只读 | 点开即看",
|
|
114
|
-
"requires": {"compared": True},
|
|
115
|
-
"blocked": [],
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"id": "credit",
|
|
119
|
-
"title": "查对方资信",
|
|
120
|
-
"weight": 72,
|
|
121
|
-
"walk": "e10Sdk",
|
|
122
|
-
"desc": "看诉讼/被执行/工商变更 | 只开页面,只读",
|
|
123
|
-
"requires": {"hasCounterparty": True},
|
|
124
|
-
"blocked": [],
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"id": "request-status",
|
|
128
|
-
"title": "查这份合同的审批进度",
|
|
129
|
-
"weight": 70,
|
|
130
|
-
"walk": "sendQuestion",
|
|
131
|
-
"desc": "看当前节点与审批意见 | 只读 | 1~2 步",
|
|
132
|
-
"requires": {"submitted": True, "requestId": "set"},
|
|
133
|
-
"blocked": [],
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
"id": "compare",
|
|
137
|
-
"title": "比对两份合同",
|
|
138
|
-
"weight": 60,
|
|
139
|
-
"walk": "e10Sdk",
|
|
140
|
-
"desc": "逐条比差异 | 需两份文件 | 2~3 步",
|
|
141
|
-
"requires": {"otherVersionAvailable": True},
|
|
142
|
-
"blocked": ["compared"],
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
"id": "clause-rewrite",
|
|
146
|
-
"title": "按建议改条款",
|
|
147
|
-
"weight": 56,
|
|
148
|
-
"walk": "sendQuestion",
|
|
149
|
-
"desc": "把建议条款写回合同 | 会改原文 | 需确认 2 次",
|
|
150
|
-
"requires": {"reviewed": True},
|
|
151
|
-
"blocked": [],
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
"id": "summary",
|
|
155
|
-
"title": "查看合同摘要",
|
|
156
|
-
"weight": 28,
|
|
157
|
-
"walk": "artifact",
|
|
158
|
-
"desc": "要素、标的与关键条款 | 只读 | 点开即看",
|
|
159
|
-
"requires": {"summaryReady": True},
|
|
160
|
-
"blocked": [],
|
|
161
|
-
},
|
|
162
|
-
]
|
|
163
|
-
|
|
164
|
-
# scene ≠ doc 时的动作域(query / config 不处理合同文件)
|
|
165
|
-
QUERY_ACTIONS = [
|
|
166
|
-
{"id": "query-contracts", "title": "查我负责的合同", "weight": 100, "walk": "sendQuestion",
|
|
167
|
-
"desc": "按负责人查合同列表 | 只读", "requires": {}, "blocked": []},
|
|
168
|
-
{"id": "query-performance", "title": "查直销业绩", "weight": 90, "walk": "sendQuestion",
|
|
169
|
-
"desc": "按期间汇总直销业绩 | 只读", "requires": {}, "blocked": []},
|
|
170
|
-
{"id": "query-receipts", "title": "查合同收款", "weight": 80, "walk": "sendQuestion",
|
|
171
|
-
"desc": "按合同号查收款台账 | 只读", "requires": {}, "blocked": []},
|
|
172
|
-
{"id": "query-channel", "title": "查渠道订单", "weight": 70, "walk": "sendQuestion",
|
|
173
|
-
"desc": "按渠道查订单 | 只读", "requires": {}, "blocked": []},
|
|
174
|
-
]
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
def _ok(rule_value, ctx):
|
|
178
|
-
if rule_value is True:
|
|
179
|
-
return bool(ctx.get("hasFileId") if False else True)
|
|
180
|
-
return True
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
def _match_one(cond, ctx):
|
|
184
|
-
"""单个条件组:全部为真才通过。"""
|
|
185
|
-
for key, expect in cond.items():
|
|
186
|
-
actual = ctx.get(key)
|
|
187
|
-
if expect == "set":
|
|
188
|
-
if actual in (None, "", False):
|
|
189
|
-
return False
|
|
190
|
-
continue
|
|
191
|
-
if isinstance(expect, list):
|
|
192
|
-
if actual not in expect:
|
|
193
|
-
return False
|
|
194
|
-
continue
|
|
195
|
-
if bool(actual) != bool(expect):
|
|
196
|
-
return False
|
|
197
|
-
return True
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
def matches(action, ctx):
|
|
201
|
-
"""requires 判定:requires 全真 且 (无 any_of 或任一分支全真)。"""
|
|
202
|
-
if not _match_one(action.get("requires") or {}, ctx):
|
|
203
|
-
return False
|
|
204
|
-
any_of = action.get("any_of")
|
|
205
|
-
if any_of:
|
|
206
|
-
if not any(_match_one(c, ctx) for c in any_of):
|
|
207
|
-
return False
|
|
208
|
-
return True
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
def suppressed(action, ctx):
|
|
212
|
-
"""抑制判定:终态不回推、已完成不重复、本轮刚执行的不立刻回推。"""
|
|
213
|
-
aid = action["id"]
|
|
214
|
-
for key in action.get("blocked", []):
|
|
215
|
-
if ctx.get(key):
|
|
216
|
-
return True
|
|
217
|
-
if ctx.get("lastAction") == aid:
|
|
218
|
-
return True
|
|
219
|
-
return False
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
def plan(ctx):
|
|
223
|
-
scene = ctx.get("scene") or "doc"
|
|
224
|
-
pool = QUERY_ACTIONS if scene in ("query", "config") else ACTIONS
|
|
225
|
-
|
|
226
|
-
scored = []
|
|
227
|
-
for a in pool:
|
|
228
|
-
if not matches(a, ctx):
|
|
229
|
-
continue
|
|
230
|
-
if suppressed(a, ctx):
|
|
231
|
-
continue
|
|
232
|
-
scored.append(a)
|
|
233
|
-
|
|
234
|
-
scored.sort(key=lambda x: (-x["weight"], x["id"]))
|
|
235
|
-
picked = scored[:MAX_CARDS]
|
|
236
|
-
|
|
237
|
-
cards = []
|
|
238
|
-
for a in picked:
|
|
239
|
-
title = a["title"].replace("{flowKey}", str(ctx.get("flowKey") or ""))
|
|
240
|
-
cards.append({
|
|
241
|
-
"id": a["id"],
|
|
242
|
-
"title": title,
|
|
243
|
-
"weight": a["weight"],
|
|
244
|
-
"walk": a["walk"],
|
|
245
|
-
"desc": a["desc"],
|
|
246
|
-
})
|
|
247
|
-
|
|
248
|
-
return {
|
|
249
|
-
"scene": scene,
|
|
250
|
-
"count": len(cards),
|
|
251
|
-
"title": "可做的 %d 件事" % len(cards),
|
|
252
|
-
"cards": cards,
|
|
253
|
-
"dropped": [a["id"] for a in scored[MAX_CARDS:]],
|
|
254
|
-
"hint": "" if cards else "按 contract-action-engine.md §7 空结果处理:不出卡片,说明缺什么与补法",
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
def main():
|
|
259
|
-
ap = argparse.ArgumentParser(description="合同动作推荐引擎")
|
|
260
|
-
ap.add_argument("--context", help="上下文状态 JSON 文件")
|
|
261
|
-
ap.add_argument("--context-json", help="上下文状态 JSON 字符串")
|
|
262
|
-
ap.add_argument("--pretty", action="store_true", help="缩进输出")
|
|
263
|
-
args = ap.parse_args()
|
|
264
|
-
|
|
265
|
-
if args.context:
|
|
266
|
-
with io.open(args.context, "r", encoding="utf-8-sig") as f:
|
|
267
|
-
ctx = json.load(f)
|
|
268
|
-
elif args.context_json:
|
|
269
|
-
ctx = json.loads(args.context_json)
|
|
270
|
-
else:
|
|
271
|
-
ap.error("必须提供 --context 或 --context-json")
|
|
272
|
-
|
|
273
|
-
result = plan(ctx)
|
|
274
|
-
print(json.dumps(result, ensure_ascii=False, indent=2 if args.pretty else None))
|
|
275
|
-
return 0
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
if __name__ == "__main__":
|
|
279
|
-
sys.exit(main())
|