weaver-work-cli 0.1.73 → 0.1.76
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 +37 -1
- package/dist/chunks/{archive-THZV4ND4.js → archive-ENBSUMHV.js} +14 -9
- package/dist/chunks/{archive-oa-PQ23OLEV.js → archive-oa-7BFPQ6M5.js} +10 -7
- package/dist/chunks/{asset-RGPROZYH.js → asset-V5SUD3PW.js} +10 -7
- package/dist/chunks/{asset-idle-Z2PDX7NA.js → asset-idle-3CEL7WFX.js} +7 -4
- package/dist/chunks/{attachment-content-R3RPVOYE.js → attachment-content-24RL44SE.js} +3 -3
- package/dist/chunks/{blog-7U3QZPIF.js → blog-FLI4SS3P.js} +10 -7
- package/dist/chunks/{caizhilian-3AB42GCV.js → caizhilian-7WCTKCCP.js} +10 -7
- package/dist/chunks/{calendar-KINM64E4.js → calendar-G726HUUH.js} +10 -7
- package/dist/chunks/chunk-257JXJGD.js +30 -0
- package/dist/chunks/chunk-2BZ7TY4M.js +49 -0
- package/dist/chunks/{chunk-4BXR6CNB.js → chunk-2KW7AI6P.js} +2 -2
- package/dist/chunks/{chunk-WM33BSIL.js → chunk-2QCCXPNU.js} +1 -1
- package/dist/chunks/chunk-2UV4IZIT.js +473 -0
- package/dist/chunks/{chunk-R3MK2RBN.js → chunk-5E2FDXBU.js} +1 -1
- package/dist/chunks/{chunk-DRUND2PJ.js → chunk-5QUTQHXF.js} +225 -152
- package/dist/chunks/chunk-7DE3VMZD.js +35 -0
- package/dist/chunks/{chunk-PAFOLIYQ.js → chunk-AZC53XSQ.js} +1 -1
- package/dist/chunks/{chunk-6HT73VOI.js → chunk-BWFCTE43.js} +2 -2
- package/dist/chunks/{chunk-4YXAK6OA.js → chunk-FEZK536Z.js} +12 -7
- package/dist/chunks/{chunk-IU6UB2TD.js → chunk-FPWCCRKT.js} +48 -6
- package/dist/chunks/{chunk-LLCMOZ5L.js → chunk-H6N6U2D6.js} +11 -11
- package/dist/chunks/{chunk-54ST55IJ.js → chunk-JJONWB5N.js} +11 -1
- package/dist/chunks/{chunk-GWJLAF6B.js → chunk-JWF2R6EQ.js} +0 -462
- package/dist/chunks/chunk-KINXYJXM.js +205 -0
- package/dist/chunks/{chunk-F4HM25K4.js → chunk-KJA7CRES.js} +1 -1
- package/dist/chunks/chunk-L5SCNJKX.js +1166 -0
- package/dist/chunks/{chunk-TV46Q4NY.js → chunk-MS7MKBGJ.js} +74 -68
- package/dist/chunks/{chunk-XZBYRYWX.js → chunk-NZQRW4KL.js} +2 -2
- package/dist/chunks/chunk-OJ4JPD25.js +428 -0
- package/dist/chunks/chunk-OVTCWLNQ.js +1346 -0
- package/dist/chunks/{chunk-NUP4RYZK.js → chunk-PMRNIGKZ.js} +2 -2
- package/dist/chunks/{chunk-2CHGUYMG.js → chunk-Q7RXCK2Y.js} +4 -4
- package/dist/chunks/{chunk-AMAPQVBT.js → chunk-QVKRNL7L.js} +286 -305
- package/dist/chunks/{chunk-7QFVXP2X.js → chunk-R4PN3OFK.js} +8 -7
- package/dist/chunks/{chunk-L7TYG5SN.js → chunk-RVEKGVZU.js} +2 -2
- package/dist/chunks/{chunk-2XED2FKY.js → chunk-SQFKBWTR.js} +38 -36
- package/dist/chunks/chunk-SU6IJD6D.js +49 -0
- package/dist/chunks/{chunk-IBSJJGXL.js → chunk-T7HVQ2WP.js} +2 -2
- package/dist/chunks/{chunk-ZWLWXHJC.js → chunk-TBCKK6LH.js} +2 -2
- package/dist/chunks/{chunk-JMJBPP4B.js → chunk-UDBQJLQF.js} +2 -2
- package/dist/chunks/chunk-UUJK76HV.js +209 -0
- package/dist/chunks/{chunk-4I26YMBY.js → chunk-WHI6YAUE.js} +7 -3
- package/dist/chunks/{chunk-BWYVS62Z.js → chunk-WJQJ7YEX.js} +4 -4
- package/dist/chunks/{chunk-GAMGDNTF.js → chunk-XNN5PZTI.js} +1 -1
- package/dist/chunks/chunk-Y3C6MDL7.js +28 -0
- package/dist/chunks/chunk-ZM7RN2IM.js +38 -0
- package/dist/chunks/cli-DFLV57LO.js +226 -0
- package/dist/chunks/commands-J52MJ6NF.js +70 -0
- package/dist/chunks/{conflict-VPAR7E6F.js → conflict-72Q6DM4I.js} +2 -2
- package/dist/chunks/{contract-DDXAO2DZ.js → contract-IRNRQ5FY.js} +12446 -5964
- package/dist/chunks/{cowork-34QCHMDD.js → cowork-GZDODGKF.js} +11 -8
- package/dist/chunks/{create-flow-52PU2OBI.js → create-flow-UGTDI7SP.js} +6 -6
- package/dist/chunks/{data-CLQ62QGD.js → data-HTQZRPPI.js} +6 -3
- package/dist/chunks/{ebuilder-form-W5R7Q22S.js → ebuilder-form-GHNIZ7ET.js} +9 -6
- package/dist/chunks/{ehr-LCNAVMK5.js → ehr-PHIBBUIG.js} +23 -16
- package/dist/chunks/{entry-mode-6Z3ZV3DE.js → entry-mode-5WOXFE67.js} +3 -3
- package/dist/chunks/{env-RDKWAARB.js → env-H4ALHESA.js} +2 -2
- package/dist/chunks/{esb-ANKPUU65.js → esb-ATRKVHCD.js} +10 -7
- package/dist/chunks/{factory-434B7RAT.js → factory-COX6AVK7.js} +1 -1
- package/dist/chunks/{fna-AKBSG5HI.js → fna-IKYI3SST.js} +13 -8
- package/dist/chunks/{group-chat-PROTW22R.js → group-chat-ZIWQQO4G.js} +3 -3
- package/dist/chunks/{host-5R2SNFWD.js → host-6UOXYOOY.js} +6 -3
- package/dist/chunks/{host-7FJW4E7R.js → host-EJSJSLVK.js} +6 -3
- package/dist/chunks/{host-WO4L5G5I.js → host-EYNLB6S4.js} +6 -3
- package/dist/chunks/{host-PDJAKCT7.js → host-OT4KNR3G.js} +6 -3
- package/dist/chunks/{host-CGXUFQO4.js → host-UY4LQPN4.js} +6 -3
- package/dist/chunks/{host-XIYG4F4B.js → host-XXGDQM7D.js} +6 -3
- package/dist/chunks/{hrm-WGODDTEH.js → hrm-5JQ7QZ6A.js} +8 -5
- package/dist/chunks/{im-YKTKAJU3.js → im-2YJW3EI5.js} +7 -4
- package/dist/chunks/{invoice-PVYCCCVM.js → invoice-37HR6L3W.js} +956 -566
- package/dist/chunks/{jiuchuanhui-RKOQW7BY.js → jiuchuanhui-KBWUZ7WT.js} +17 -10
- package/dist/chunks/{lazy-dispatch-DW45AFQ5.js → lazy-dispatch-MZ3EZYDL.js} +22 -8
- package/dist/chunks/{mail-BNB5S4NW.js → mail-YBKUM6HM.js} +11 -8
- package/dist/chunks/{meeting-O2KDJH66.js → meeting-XE6CTXYA.js} +22 -18
- package/dist/chunks/{minute-doc-JUCG56GY.js → minute-doc-4BA2R5EA.js} +4 -4
- package/dist/chunks/{okr-LWFGWOE7.js → okr-HW7IULIR.js} +10 -7
- package/dist/chunks/{operations-532PN5OB.js → operations-4P2UYVLH.js} +7 -4
- package/dist/chunks/{performance-7W5COCFU.js → performance-PM2G6L3E.js} +6 -3
- package/dist/chunks/{plan-ZVY3IYTL.js → plan-3YYGZ7ZM.js} +10 -7
- package/dist/chunks/{project-SA62B7MH.js → project-XREEXFU2.js} +10 -7
- package/dist/chunks/{reception-NGIONPQ3.js → reception-7G3J2MA6.js} +8 -4
- package/dist/chunks/{recruit-stage-WOSN6MGP.js → recruit-stage-TSQWOGQD.js} +199 -74
- package/dist/chunks/register-SQOPIR2G.js +16 -0
- package/dist/chunks/{registry-N7P3W2RD.js → registry-3VTB3KLV.js} +7 -4
- package/dist/chunks/registry-7UDUWYB5.js +30 -0
- package/dist/chunks/{registry-R72GWXOG.js → registry-F4YFZLOD.js} +7 -3
- package/dist/chunks/{room-recommend-KCGIVUFR.js → room-recommend-FO3HLPNB.js} +4 -4
- package/dist/chunks/root-YZG2TS5W.js +16 -0
- package/dist/chunks/{schedule-6UP27HQ4.js → schedule-DHNNOHVS.js} +4 -4
- package/dist/chunks/{smart-extract-DDOQSPRB.js → smart-extract-T5Z4AULN.js} +15 -7
- package/dist/chunks/update-AV5VOXGY.js +13 -0
- package/dist/chunks/{workflow-V5ALD6QZ.js → workflow-MAGCHWYZ.js} +15 -10
- package/dist/cli.js +40 -0
- package/dist/cmd/action.js +3 -1
- package/dist/cmd/doctor/index.js +1 -1
- package/dist/cmd/e10/index.js +1 -1
- package/dist/cmd/identity/index.js +5 -8
- package/dist/cmd/index.js +2 -0
- package/dist/cmd/setup/index.js +1 -1
- package/dist/cmd/update/index.js +38 -0
- package/dist/core/manifest-view.js +1 -1
- package/dist/core/output.js +8 -1
- package/dist/core/runtime-agent.js +13 -0
- package/dist/core/update-notice.js +23 -0
- package/dist/index.js +105 -198
- package/dist/internal/e10/auth/agent-host-key.js +16 -0
- package/dist/internal/e10/auth/agent-hosts.js +45 -9
- package/dist/internal/e10/auth/commands.js +66 -36
- package/dist/internal/e10/auth/session.js +30 -15
- package/dist/internal/e10/auth/xiaoe.js +4 -20
- package/dist/internal/e10/auth-recovery.js +44 -4
- package/dist/internal/e10/context.js +5 -2
- package/dist/internal/update/bootstrap.js +96 -0
- package/dist/internal/update/npm.js +78 -0
- package/dist/internal/update/service.js +252 -0
- package/dist/internal/update/store.js +135 -0
- package/dist/shortcuts/archive/index.js +2 -2
- package/dist/shortcuts/archive/manifest.js +1 -0
- package/dist/shortcuts/archive/operations/search.js +3 -1
- package/dist/shortcuts/archive-oa/index.js +1 -1
- package/dist/shortcuts/asset/index.js +1 -1
- package/dist/shortcuts/asset-idle/index.js +1 -1
- package/dist/shortcuts/blog/index.js +1 -1
- package/dist/shortcuts/caizhilian/index.js +1 -1
- package/dist/shortcuts/calendar/index.js +1 -1
- package/dist/shortcuts/contract/data/bi-config.js +156 -0
- package/dist/shortcuts/contract/data/collection-ledger-html.js +189 -0
- package/dist/shortcuts/contract/data/collection-node-catalog.js +226 -0
- package/dist/shortcuts/contract/data/metric-catalog.js +154 -20
- package/dist/shortcuts/contract/data/report-renderers.js +414 -0
- package/dist/shortcuts/contract/data/report-spec.js +132 -0
- package/dist/shortcuts/contract/error-actions.js +114 -0
- package/dist/shortcuts/contract/host.js +12 -3
- package/dist/shortcuts/contract/index.js +17 -1
- package/dist/shortcuts/contract/manifest.js +398 -3
- package/dist/shortcuts/contract/ooxml/docx-table.js +48 -0
- package/dist/shortcuts/contract/operations/bi-preview.js +131 -0
- package/dist/shortcuts/contract/operations/bizreview-report.js +496 -0
- package/dist/shortcuts/contract/operations/collection-node.js +229 -0
- package/dist/shortcuts/contract/operations/docx-slots.js +735 -16
- package/dist/shortcuts/contract/operations/draft-build.js +940 -0
- package/dist/shortcuts/contract/operations/draft-submit.js +229 -0
- package/dist/shortcuts/contract/operations/first-screen.js +3 -2
- package/dist/shortcuts/contract/operations/generated-submit.js +175 -0
- package/dist/shortcuts/contract/operations/ledger-report.js +233 -0
- package/dist/shortcuts/contract/operations/ledger-stat.js +1400 -0
- package/dist/shortcuts/contract/operations/ledger.js +4 -1
- package/dist/shortcuts/contract/operations/metrics.js +9 -3
- package/dist/shortcuts/contract/operations/ops-draft.js +527 -0
- package/dist/shortcuts/contract/operations/page.js +9 -0
- package/dist/shortcuts/contract/operations/quote-submit.js +55 -229
- package/dist/shortcuts/contract/operations/registry.js +20 -0
- package/dist/shortcuts/contract/operations/sign-launch.js +256 -0
- package/dist/shortcuts/contract/operations/viewlink.js +334 -0
- package/dist/shortcuts/cowork/index.js +2 -2
- package/dist/shortcuts/ebuilder-form/index.js +1 -1
- package/dist/shortcuts/ehr/index.js +2 -2
- package/dist/shortcuts/ehr/manifest.js +1 -1
- package/dist/shortcuts/ehr/operations/recruit-position.js +7 -2
- package/dist/shortcuts/ehr/operations/recruit-write.js +7 -6
- package/dist/shortcuts/ehr/operations/recruit.js +318 -248
- package/dist/shortcuts/ehr/operations/shared.js +22 -2
- package/dist/shortcuts/esb/index.js +1 -1
- package/dist/shortcuts/fna/index.js +1 -1
- package/dist/shortcuts/fna/manifest.js +1 -0
- package/dist/shortcuts/fna/operations/expense-chart.js +3 -1
- package/dist/shortcuts/hrm/index.js +1 -1
- package/dist/shortcuts/invoice/business-response.js +13 -0
- package/dist/shortcuts/invoice/calendar.js +24 -0
- package/dist/shortcuts/invoice/host.js +26 -15
- package/dist/shortcuts/invoice/index.js +3 -3
- package/dist/shortcuts/invoice/invoice-record.js +7 -2
- package/dist/shortcuts/invoice/manifest.js +179 -155
- package/dist/shortcuts/invoice/operations/get.js +9 -3
- package/dist/shortcuts/invoice/operations/issuing-red-requests.js +138 -0
- package/dist/shortcuts/invoice/operations/registry.js +4 -5
- package/dist/shortcuts/invoice/operations/reim-auto.js +40 -2
- package/dist/shortcuts/invoice/operations/reim-customer-projects.js +79 -0
- package/dist/shortcuts/invoice/operations/reim-customer.js +79 -30
- package/dist/shortcuts/invoice/operations/reim-relation.js +0 -146
- package/dist/shortcuts/invoice/operations/reim.js +2 -126
- package/dist/shortcuts/invoice/operations/shared.js +15 -17
- package/dist/shortcuts/invoice/preapproval-enrichment.js +180 -0
- package/dist/shortcuts/invoice/projection.js +14 -0
- package/dist/shortcuts/invoice/read-enrichment.js +123 -0
- package/dist/shortcuts/jiuchuanhui/index.js +2 -2
- package/dist/shortcuts/jiuchuanhui/manifest.js +3 -0
- package/dist/shortcuts/mail/index.js +2 -2
- package/dist/shortcuts/meeting/index.js +1 -1
- package/dist/shortcuts/meeting/manifest.js +1 -0
- package/dist/shortcuts/meeting/operations/eb/catalog.js +5 -3
- package/dist/shortcuts/meeting/operations/eb/conflict.js +3 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +10 -9
- package/dist/shortcuts/meeting/operations/eb/factory.js +2 -0
- package/dist/shortcuts/meeting/operations/eb/member-expand.js +3 -2
- package/dist/shortcuts/meeting/operations/invitation-publish.js +3 -3
- package/dist/shortcuts/meeting/operations/invitation.js +4 -4
- package/dist/shortcuts/meeting/operations/link.js +3 -1
- package/dist/shortcuts/okr/index.js +1 -1
- package/dist/shortcuts/performance/index.js +1 -1
- package/dist/shortcuts/plan/index.js +1 -1
- package/dist/shortcuts/project/index.js +1 -1
- package/dist/shortcuts/reception/manifest.js +2 -2
- package/dist/shortcuts/recruit-stage/context.js +10 -2
- package/dist/shortcuts/recruit-stage/index.js +16 -3
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +1 -1
- package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +1 -1
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +17 -8
- package/dist/shortcuts/recruit-stage/operations/list.js +1 -1
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +178 -35
- package/dist/shortcuts/recruit-stage/operations/search.js +2 -2
- package/dist/shortcuts/recruit-stage/operations/shortlist.js +4 -2
- package/dist/shortcuts/recruit-stage/shared.js +27 -53
- package/dist/shortcuts/smart-extract/manifest.js +1 -0
- package/dist/shortcuts/smart-extract/operations/fill.js +7 -2
- package/dist/shortcuts/smart-extract/operations/validate.js +4 -1
- package/dist/shortcuts/workflow/index.js +2 -2
- package/dist/shortcuts/workflow/manifest.js +1 -0
- package/dist/shortcuts/workflow/operations/aiDeepRead/render.js +4 -1
- package/dist/shortcuts/workflow/operations/deepRead.js +23 -2
- package/dist/shortcuts/workflow/operations/form.js +8 -2
- package/docs/agent-invoice.md +28 -2
- package/docs/contract.md +6 -1
- package/docs/e10-auth.md +25 -7
- package/docs/invoice.md +60 -9
- package/docs/operation-manual.md +15 -0
- package/package.json +2 -2
- package/skill-template/business-info.json +28 -0
- package/skill-template/domains/jinchengda.md +13 -1
- package/skill-template/domains/yepiaotong.md +36 -7
- package/skills/weaver-e10-archive-oa/references/source-manifest.json +3 -3
- package/skills/weaver-e10-caizhilian/references/auth-and-install.md +2 -1
- package/skills/weaver-e10-caizhilian/references/source-manifest.json +3 -3
- package/skills/weaver-e10-esb/references/source-manifest.json +3 -3
- package/skills/weaver-e10-jinchengda/SKILL.md +90 -32
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +45 -0
- package/skills/weaver-e10-jinchengda/references/contract-bizreview-report-template.html +68 -0
- package/skills/weaver-e10-jinchengda/references/contract-bizreview.md +216 -0
- package/skills/weaver-e10-jinchengda/references/contract-clause-negotiate.md +215 -0
- package/skills/weaver-e10-jinchengda/references/contract-collection-node.md +113 -0
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +19 -3
- package/skills/weaver-e10-jinchengda/references/contract-decisions.md +114 -0
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +53 -44
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-firstscreen-guide.md +200 -0
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +18 -1
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +138 -3
- package/skills/weaver-e10-jinchengda/references/contract-ledger-report.md +158 -0
- package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +3 -1
- package/skills/weaver-e10-jinchengda/references/contract-material-gap.md +139 -0
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +10 -3
- package/skills/weaver-e10-jinchengda/references/contract-ops-draft.md +106 -0
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +176 -56
- package/skills/weaver-e10-jinchengda/references/contract-sign-launch.md +123 -0
- package/skills/weaver-e10-jinchengda/references/contract-smart-draft.md +410 -0
- package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-viewlink.md +110 -0
- package/skills/weaver-e10-jinchengda/references/orchestration.md +38 -24
- package/skills/weaver-e10-meeting/SKILL.md +13 -0
- package/skills/weaver-e10-okr/SKILL.md +11 -0
- package/skills/weaver-e10-okr/references/source-manifest.json +7 -6
- package/skills/weaver-e10-performance/SKILL.md +131 -39
- package/skills/weaver-e10-performance/agents/openai.yaml +48 -17
- package/skills/weaver-e10-performance/references/default-assembly.md +3 -0
- package/skills/weaver-e10-performance/references/extraction-guide.md +17 -3
- package/skills/weaver-e10-performance/references/flow-assess.md +38 -5
- package/skills/weaver-e10-performance/references/scheme-setting-page.md +20 -3
- package/skills/weaver-e10-performance/scripts/assemble_scheme.py +461 -0
- package/skills/weaver-e10-performance/scripts/parse_appraisal_doc.py +41 -0
- package/skills/weaver-e10-plan/SKILL.md +10 -0
- package/skills/weaver-e10-plan/references/source-manifest.json +13 -13
- package/skills/weaver-e10-qiyecheng/SKILL.md +2 -2
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +9 -9
- package/skills/weaver-e10-recruit-stage/SKILL.md +230 -202
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +74 -46
- package/skills/weaver-e10-recruit-stage/lib/interview-conflict.mjs +3 -0
- package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +201 -36
- package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +336 -27
- package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +3 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +15 -1
- package/skills/weaver-e10-recruit-stage/lib/report-attachment.mjs +38 -0
- package/skills/weaver-e10-recruit-stage/lib/xiaoe-session.mjs +5 -1
- package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/env-ziyong.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +12 -8
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +20 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +11 -7
- package/skills/weaver-e10-recruit-stage/references/recruit-check-install.md +5 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-detail-process.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +8 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-failure-fallback.md +6 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +7 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +32 -25
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-template.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +5 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +16 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-my-positions.md +6 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +148 -40
- package/skills/weaver-e10-recruit-stage/references/recruit-platform-compat.md +5 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +32 -8
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-creator.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +8 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +6 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +41 -41
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +7 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +7 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +8 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +5 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +5 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +5 -1
- package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +41 -28
- package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +23 -26
- package/skills/weaver-e10-recruit-stage/templates/match-report.html +44 -36
- package/skills/weaver-e10-shared/SKILL.md +40 -5
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +11 -1
- package/skills/weaver-e10-shared/references/json-output-contract.md +144 -8
- package/skills/weaver-e10-shared/references/weaver-e10-installation.md +11 -0
- package/skills/weaver-e10-shijingran/references/source-manifest.json +3 -3
- package/skills/weaver-e10-wenshuding/references/source-manifest.json +3 -3
- package/skills/weaver-e10-workflow/references/source-manifest.json +3 -3
- package/skills/weaver-e10-yepiaotong/SKILL.md +133 -61
- package/skills/weaver-e10-yepiaotong/references/invoice-add.md +3 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +18 -2
- package/skills/weaver-e10-yepiaotong/references/invoice-disabled-capabilities.md +3 -3
- package/skills/weaver-e10-yepiaotong/references/invoice-download.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +13 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-file-upload.md +3 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-import.md +6 -4
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +42 -45
- package/skills/weaver-e10-yepiaotong/references/invoice-ocr-preview.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +18 -2
- package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +14 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-red-workflow.md +96 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-reim-relation.md +56 -369
- package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +16 -6
- package/skills/weaver-e10-yepiaotong/references/name-fuzzy-search.md +38 -0
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +163 -646
- package/skills/weaver-e10-yepiaotong/references/reim-customer-search.md +90 -44
- package/skills/weaver-e10-yepiaotong/references/reim-eligibility-rules.md +85 -0
- package/skills/weaver-e10-yepiaotong/references/reim-fill-validation.md +61 -0
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +91 -280
- package/skills/weaver-e10-yepiaotong/references/reim-preapproval-rules.md +98 -0
- package/skills/weaver-e10-yepiaotong/references/reim-travel-invoice-matching.md +48 -0
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +234 -695
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +395 -204
- package/skills/weaver-e10-yepiaotong/references/travel-application-fill.md +84 -0
- package/skills/weaver-e10-yepiaotong/references/workflow-direct-fill.md +165 -0
- package/skills/weaver-e10-yepiaotong.zip +0 -0
- package/dist/chunks/chunk-ICP53R52.js +0 -2849
- package/dist/chunks/registry-RIQ67ZT7.js +0 -27
- package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
- package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +0 -93
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +0 -774
- package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +0 -111
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +0 -360
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +0 -167
|
@@ -1,122 +1,26 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { basename } from 'node:path';
|
|
3
3
|
import { contractValidationError } from '../errors.js';
|
|
4
|
+
import { callOperation, runGeneratedSubmit, str } from './generated-submit.js';
|
|
4
5
|
import { inspectAmount } from './money.js';
|
|
5
|
-
import { resolveOperation } from './op-resolver.js';
|
|
6
|
-
import { baseOf } from './page.js';
|
|
7
|
-
import { assertQuoteRefsResolved, resolveQuoteRefs } from './quote-ref.js';
|
|
8
6
|
import { normalizeContractFileName } from './quote-recognize.js';
|
|
7
|
+
import { assertQuoteRefsResolved, resolveQuoteRefs } from './quote-ref.js';
|
|
9
8
|
/**
|
|
10
9
|
* 报价单链路「生成后收口」一键:`contract.quotescreen.submit`。
|
|
11
10
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* (5~10 s),合计 20~30 s 纯等待,且中间任何一步产物都要在上下文里倒手一遍。
|
|
16
|
-
*
|
|
17
|
-
* 本 operation 在**进程内**把它们串起来,模型侧只发一条命令:
|
|
18
|
-
*
|
|
19
|
-
* ```text
|
|
20
|
-
* ① flow.launch(网络上传,约 10 s) ∥ ② 本地装配要素(纯计算,瞬时)
|
|
21
|
-
* ↓ 拿到 workflowFileId
|
|
22
|
-
* ③ 回填 origin 前缀
|
|
23
|
-
* ↓
|
|
24
|
-
* ④ save-recognize-record → aiExtraId
|
|
25
|
-
* ↓
|
|
26
|
-
* ⑤ 拼合同智能页地址(tab 按行为取)
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* 关键设计(改代码前先读):
|
|
30
|
-
*
|
|
31
|
-
* 1. **并行是「上传 ∥ 装配」**,不是「上传 ∥ 抽正文」。报价单链路要素全部来自报价单与固定规则,
|
|
32
|
-
* 装配不需要合同文件;只有 `origin` 前缀要等 `workflowFileId`。因此先用占位前缀装配,
|
|
33
|
-
* 拿到真实 fileId 后整体替换——两道工序真正重叠。
|
|
34
|
-
* 2. **只服务报价单链路**,不碰上传合同链路。`triage.extract` / `elements.build` 一行未动,
|
|
35
|
-
* 用户直接上传现成合同仍走原链路(外来合同必须读正文,跳读必漏抽)。
|
|
36
|
-
* 3. **识别记录保存失败不阻断开页**(2026-11-19 用户定稿):接口异常、数据库字段长度限制等
|
|
37
|
-
* 导致取不到 `aiExtraId` 时,照常返回不带 `aiExtraId` 的地址并说明原因。
|
|
38
|
-
* ⛔ `aiExtraId` 宁可缺,**不得编造、不得用 fileId 顶替**。
|
|
39
|
-
* 4. **URL 不带 `fieldId`**(附件字段由系统按 `workflowId` 定位),`flowId` 与 `workflowId`
|
|
40
|
-
* 取值相同且必须同时出现。
|
|
41
|
-
*/
|
|
42
|
-
/** 合同智能页固定 aiid。 */
|
|
43
|
-
const AI_CONTRACT_AIID = '1256652614210789601';
|
|
44
|
-
/** 装配阶段还没有真实 fileId 时占用的 origin 前缀占位符,拿到 workflowFileId 后整体替换。 */
|
|
45
|
-
const PENDING_FILE_ID = '__WORKFLOW_FILE_ID_PENDING__';
|
|
46
|
-
/** `tab` 合法枚举;报价单链路默认 `Extract`(发起合同流程 / 要素提取)。 */
|
|
47
|
-
const ALLOWED_TABS = ['Extract', 'Summary', 'RiskReview', 'Credit', 'termComponent'];
|
|
48
|
-
function str(value) {
|
|
49
|
-
if (typeof value === 'string')
|
|
50
|
-
return value.trim();
|
|
51
|
-
if (typeof value === 'number' && Number.isFinite(value))
|
|
52
|
-
return String(value);
|
|
53
|
-
return '';
|
|
54
|
-
}
|
|
55
|
-
async function callOperation(name, input, context) {
|
|
56
|
-
const operation = resolveOperation(name);
|
|
57
|
-
const result = await operation.execute(input, context);
|
|
58
|
-
return (result?.data ?? {});
|
|
59
|
-
}
|
|
60
|
-
/** 把装配阶段写入的占位前缀替换成真实 `workflowFileId`。 */
|
|
61
|
-
function injectFileId(payload, fileId) {
|
|
62
|
-
const swap = (item) => typeof item === 'string' ? item.split(PENDING_FILE_ID).join(fileId) : item;
|
|
63
|
-
const rows = payload?.recognizeResult?.mainTable?.rows;
|
|
64
|
-
if (Array.isArray(rows)) {
|
|
65
|
-
for (const row of rows) {
|
|
66
|
-
const results = row?.fieldResults;
|
|
67
|
-
if (!Array.isArray(results))
|
|
68
|
-
continue;
|
|
69
|
-
for (const result of results) {
|
|
70
|
-
if (Array.isArray(result?.origin))
|
|
71
|
-
result.origin = result.origin.map(swap);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
const tables = payload?.recognizeResult?.subTables;
|
|
76
|
-
if (Array.isArray(tables)) {
|
|
77
|
-
for (const table of tables) {
|
|
78
|
-
const tableRows = table?.rows;
|
|
79
|
-
if (!Array.isArray(tableRows))
|
|
80
|
-
continue;
|
|
81
|
-
for (const row of tableRows) {
|
|
82
|
-
if (!Array.isArray(row?.origins))
|
|
83
|
-
continue;
|
|
84
|
-
row.origins = row.origins.map((column) => Array.isArray(column) ? column.map(swap) : swap(column));
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* 拼合同智能页统一地址。
|
|
11
|
+
* 本文件只负责**报价单链路特有的入参体检与要素装配**(金额形态、值引用、客户全称、
|
|
12
|
+
* 报价单标识判类型),通用收口动作(上传 ∥ 装配 → 回填 origin → 存识别记录 → 拼地址)
|
|
13
|
+
* 已下沉到 `generated-submit.ts`,与智能起草链路的 `contract.draft.submit` 共用同一份实现。
|
|
91
14
|
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* 不拼 `fieldId`(附件字段由系统按 `workflowId` 定位)、不拼 `formId`。
|
|
15
|
+
* 边界:**只服务「正文由本进程产出」的链路**(报价单回填、无模板起草)。
|
|
16
|
+
* 用户直接上传现成合同不走这里——外来合同必须 `triage.extract` 读正文,跳读必漏抽。
|
|
95
17
|
*/
|
|
96
|
-
export
|
|
97
|
-
const segments = [
|
|
98
|
-
`aiid=${AI_CONTRACT_AIID}`,
|
|
99
|
-
`flowId=${args.workflowId}`,
|
|
100
|
-
`workflowId=${args.workflowId}`,
|
|
101
|
-
'authModule=workflow',
|
|
102
|
-
'mode=edit',
|
|
103
|
-
'module=WEA_FORM',
|
|
104
|
-
`contractTermIds=${args.contractTermIds ? encodeURIComponent(args.contractTermIds) : ''}`,
|
|
105
|
-
`files[0][id]=${args.fileId}`,
|
|
106
|
-
`files[0][name]=${encodeURIComponent(args.fileName)}`,
|
|
107
|
-
`spfiles[0][fileid]=${args.fileId}`,
|
|
108
|
-
`spfiles[0][name]=${encodeURIComponent(args.fileName)}`,
|
|
109
|
-
];
|
|
110
|
-
if (args.aiExtraId)
|
|
111
|
-
segments.push(`aiExtraId=${encodeURIComponent(args.aiExtraId)}`);
|
|
112
|
-
segments.push(`tab=${args.tab}`);
|
|
113
|
-
return `${baseOf(args.baseUrl)}/sp/contract/business/ai-contract?${segments.join('&')}`;
|
|
114
|
-
}
|
|
18
|
+
export { buildAiContractUrl } from './generated-submit.js';
|
|
115
19
|
export const contractQuoteSubmitOperations = [
|
|
116
20
|
{
|
|
117
21
|
name: 'contract.quotescreen.submit',
|
|
118
22
|
async execute(input, context) {
|
|
119
|
-
//
|
|
23
|
+
// 值引用解析:totalAmount / sections 可写成
|
|
120
24
|
// {"$quote":"<报价书解析结果.json>#totals.final_total"},真值由本进程读,
|
|
121
25
|
// 模型不必(也不可能)把脱敏后的金额还原成数字。
|
|
122
26
|
const refOutcome = resolveQuoteRefs(input);
|
|
@@ -151,134 +55,56 @@ export const contractQuoteSubmitOperations = [
|
|
|
151
55
|
throw contractValidationError('total_amount_required', `totalAmount 必须是大于 0 的纯数值(报价单最终优惠报价),收到「${amountCheck.raw}」`, { raw: amountCheck.raw });
|
|
152
56
|
}
|
|
153
57
|
const tabRaw = str(input.tab) || 'Extract';
|
|
154
|
-
if (!ALLOWED_TABS.includes(tabRaw)) {
|
|
155
|
-
throw contractValidationError('tab_invalid', `tab 只允许 ${ALLOWED_TABS.join(' / ')},收到「${tabRaw}」`);
|
|
156
|
-
}
|
|
157
58
|
const fileName = normalizeContractFileName(str(input.fileName) || basename(contractPath), customerName);
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
const recognizeInput = {
|
|
163
|
-
fileId: input.reuseFileId ? str(input.reuseFileId) : PENDING_FILE_ID,
|
|
59
|
+
return runGeneratedSubmit({
|
|
60
|
+
input,
|
|
61
|
+
context,
|
|
62
|
+
contractPath,
|
|
164
63
|
flow,
|
|
165
|
-
|
|
166
|
-
totalAmount,
|
|
167
|
-
contractTitle: str(input.contractTitle) || undefined,
|
|
168
|
-
contractFileName: fileName,
|
|
169
|
-
ourCompany: str(input.ourCompany) || undefined,
|
|
170
|
-
sections: Array.isArray(input.sections) ? input.sections : undefined,
|
|
171
|
-
background: str(input.background) || undefined,
|
|
172
|
-
quoteTitle: str(input.quoteTitle) || undefined,
|
|
173
|
-
quoteFileName: str(input.quoteFileName) || undefined,
|
|
174
|
-
verified: input.verified === undefined ? true : input.verified === true,
|
|
175
|
-
};
|
|
176
|
-
const [launched, assembled] = await Promise.all([
|
|
177
|
-
// ⛔ 必须把规范文件名一起传下去(2026-11-23 修复):E10 附件名恒等于上传时的 multipart 文件名,
|
|
178
|
-
// 而它原先取自本地 basename——模型把产物写成 `合同.docx`,系统附件列表里就是「合同.docx」,
|
|
179
|
-
// 与表单里的合同名称字段、以及返回的 expectedFileName 都对不上。
|
|
180
|
-
callOperation('contract.flow.launch', { flow, path: contractPath, fileName }, context),
|
|
181
|
-
callOperation('contract.quotescreen.recognize', recognizeInput, context),
|
|
182
|
-
]);
|
|
183
|
-
steps.push('flow.launch+quotescreen.recognize(parallel)');
|
|
184
|
-
// 装配可能返回 needsConfirm(类型判不出):此时不能继续上传后的落库
|
|
185
|
-
if (assembled?.ok === false && assembled?.needsConfirm === true) {
|
|
186
|
-
return {
|
|
187
|
-
status: 'COMPLETE',
|
|
188
|
-
data: {
|
|
189
|
-
ok: false,
|
|
190
|
-
needsConfirm: true,
|
|
191
|
-
reason: assembled.reason,
|
|
192
|
-
candidates: assembled.candidates,
|
|
193
|
-
workflowId: launched?.workflowId ?? '',
|
|
194
|
-
workflowFileId: str(launched?.file?.fileId),
|
|
195
|
-
steps,
|
|
196
|
-
note: '合同类型未能唯一确定:请确认后同时传 flow 重跑(四个流程:契约锁 / 新客户 / 常规二次销售 / 老客户增值)',
|
|
197
|
-
},
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
if (assembled?.ok === false) {
|
|
201
|
-
throw contractValidationError('recognize_failed', `要素装配失败:${str(assembled?.reason) || '未知原因'};合同已上传但未落库识别记录`);
|
|
202
|
-
}
|
|
203
|
-
const workflowId = str(launched?.workflowId) || str(assembled?.workflowId);
|
|
204
|
-
const workflowFileId = str(launched?.file?.fileId);
|
|
205
|
-
if (!workflowId || !workflowFileId) {
|
|
206
|
-
throw contractValidationError('launch_result_incomplete', '上传未返回 workflowId / workflowFileId,无法继续落库与拼地址(不生成半成品地址)', { workflowId, workflowFileId });
|
|
207
|
-
}
|
|
208
|
-
// ── ③ 回填 origin 前缀:占位 → 真实 workflowFileId
|
|
209
|
-
const payload = (assembled.payload ?? {});
|
|
210
|
-
if (str(recognizeInput.fileId) === PENDING_FILE_ID) {
|
|
211
|
-
injectFileId(payload, workflowFileId);
|
|
212
|
-
}
|
|
213
|
-
payload.attachmentIds = workflowFileId;
|
|
214
|
-
payload.attachmentFileId = workflowFileId;
|
|
215
|
-
payload.workflowId = workflowId;
|
|
216
|
-
// ── ④ 保存识别记录;失败不阻断开页(2026-11-19 用户定稿)
|
|
217
|
-
let aiExtraId = '';
|
|
218
|
-
let saveError = '';
|
|
219
|
-
try {
|
|
220
|
-
const saved = await callOperation('contract.flow.save-recognize-record', {
|
|
221
|
-
flow,
|
|
222
|
-
workflowId,
|
|
223
|
-
attachmentIds: workflowFileId,
|
|
224
|
-
attachmentFieldId: str(assembled.attachmentFieldId) || str(launched?.fieldId),
|
|
225
|
-
attachmentFileId: workflowFileId,
|
|
226
|
-
recognizeResult: payload.recognizeResult,
|
|
227
|
-
}, context);
|
|
228
|
-
aiExtraId = str(saved?.aiExtraId);
|
|
229
|
-
steps.push('flow.save-recognize-record');
|
|
230
|
-
if (!aiExtraId)
|
|
231
|
-
saveError = '保存接口未返回 aiExtraId';
|
|
232
|
-
}
|
|
233
|
-
catch (error) {
|
|
234
|
-
saveError = error instanceof Error ? error.message : String(error);
|
|
235
|
-
warnings.push(`识别记录保存失败(合同已上传、附件不受影响):${saveError};已照常生成页面地址,要素区可能为空,可人工补录`);
|
|
236
|
-
}
|
|
237
|
-
// ── ⑤ 拼合同智能页地址
|
|
238
|
-
const session = await context.host.getSession();
|
|
239
|
-
const uploadedName = str(launched?.file?.name) || fileName;
|
|
240
|
-
const url = buildAiContractUrl({
|
|
241
|
-
baseUrl: session.baseUrl,
|
|
242
|
-
workflowId,
|
|
243
|
-
fileId: workflowFileId,
|
|
244
|
-
fileName: uploadedName,
|
|
64
|
+
fileName,
|
|
245
65
|
tab: tabRaw,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
66
|
+
parallelStepLabel: 'flow.launch+quotescreen.recognize(parallel)',
|
|
67
|
+
assemble: async (pendingFileId) => {
|
|
68
|
+
const reuseFileId = str(input.reuseFileId);
|
|
69
|
+
const recognizeInput = {
|
|
70
|
+
fileId: reuseFileId || pendingFileId,
|
|
71
|
+
flow,
|
|
72
|
+
customerName,
|
|
73
|
+
totalAmount,
|
|
74
|
+
contractTitle: str(input.contractTitle) || undefined,
|
|
75
|
+
contractFileName: fileName,
|
|
76
|
+
ourCompany: str(input.ourCompany) || undefined,
|
|
77
|
+
sections: Array.isArray(input.sections) ? input.sections : undefined,
|
|
78
|
+
background: str(input.background) || undefined,
|
|
79
|
+
quoteTitle: str(input.quoteTitle) || undefined,
|
|
80
|
+
quoteFileName: str(input.quoteFileName) || undefined,
|
|
81
|
+
verified: input.verified === undefined ? true : input.verified === true,
|
|
82
|
+
};
|
|
83
|
+
const assembled = await callOperation('contract.quotescreen.recognize', recognizeInput, context);
|
|
84
|
+
// 装配可能返回 needsConfirm(类型判不出):此时不能继续上传后的落库
|
|
85
|
+
if (assembled?.ok === false && assembled?.needsConfirm === true) {
|
|
86
|
+
return {
|
|
87
|
+
kind: 'abort',
|
|
88
|
+
data: {
|
|
89
|
+
needsConfirm: true,
|
|
90
|
+
reason: assembled.reason,
|
|
91
|
+
candidates: assembled.candidates,
|
|
92
|
+
note: '合同类型未能唯一确定:请确认后同时传 flow 重跑(四个流程:契约锁 / 新客户 / 常规二次销售 / 老客户增值)',
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
if (assembled?.ok === false) {
|
|
97
|
+
throw contractValidationError('recognize_failed', `要素装配失败:${str(assembled?.reason) || '未知原因'};合同已上传但未落库识别记录`);
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
kind: 'ok',
|
|
101
|
+
payload: (assembled.payload ?? {}),
|
|
102
|
+
attachmentFieldId: str(assembled.attachmentFieldId),
|
|
103
|
+
expectedTitle: str(assembled.expectedTitle) || str(input.contractTitle),
|
|
104
|
+
workflowIdFallback: str(assembled.workflowId),
|
|
105
|
+
};
|
|
280
106
|
},
|
|
281
|
-
};
|
|
107
|
+
});
|
|
282
108
|
},
|
|
283
109
|
},
|
|
284
110
|
];
|
|
@@ -4,6 +4,7 @@ import { contractAssistantOperations } from './assistant.js';
|
|
|
4
4
|
import { contractClauseInsertOperations } from './clause-insert.js';
|
|
5
5
|
import { contractClauseLibraryOperations } from './clause-library.js';
|
|
6
6
|
import { contractClauseReferenceOperations } from './clause-reference.js';
|
|
7
|
+
import { contractBizReviewReportOperations } from './bizreview-report.js';
|
|
7
8
|
import { contractLedgerCardOperations } from './ledger-card.js';
|
|
8
9
|
import { contractReviewReportOperations } from './review-report.js';
|
|
9
10
|
import { contractCompareOperations } from './compare.js';
|
|
@@ -12,14 +13,21 @@ import { contractCreditPageOperations } from './credit-page.js';
|
|
|
12
13
|
import { contractCustomerOperations } from './customer.js';
|
|
13
14
|
import { contractDocxVerifyOperations } from './docx-verify.js';
|
|
14
15
|
import { contractDocxSlotsOperations } from './docx-slots.js';
|
|
16
|
+
import { contractDraftOperations } from './draft-build.js';
|
|
17
|
+
import { contractDraftSubmitOperations } from './draft-submit.js';
|
|
15
18
|
import { contractElementsBuildOperations } from './elements-build.js';
|
|
16
19
|
import { contractFileDownloadOperations } from './file-download.js';
|
|
17
20
|
import { contractFirstScreenOperations } from './first-screen.js';
|
|
18
21
|
import { setOperationResolver } from './op-resolver.js';
|
|
19
22
|
import { contractFlowOperations } from './flow.js';
|
|
20
23
|
import { contractLedgerOperations, contractLedgerRouteOperations } from './ledger.js';
|
|
24
|
+
import { contractLedgerStatOperation } from './ledger-stat.js';
|
|
25
|
+
import { contractLedgerReportOperation } from './ledger-report.js';
|
|
26
|
+
import { contractLedgerBiOperation } from './bi-preview.js';
|
|
27
|
+
import { contractCollectionNodeOperations } from './collection-node.js';
|
|
21
28
|
import { contractLedgerMetricsOperations } from './metrics.js';
|
|
22
29
|
import { contractModelTextOperations } from './modeltext.js';
|
|
30
|
+
import { contractOpsDraftOperations } from './ops-draft.js';
|
|
23
31
|
import { contractPerformanceOperations } from './performance.js';
|
|
24
32
|
import { contractQuoteOperations } from './quote.js';
|
|
25
33
|
import { contractQuoteRecognizeOperations } from './quote-recognize.js';
|
|
@@ -28,9 +36,11 @@ import { contractRecommendOperations } from './recommend.js';
|
|
|
28
36
|
import { contractRequestOperations } from './request.js';
|
|
29
37
|
import { contractReviewOperations } from './review.js';
|
|
30
38
|
import { contractSaveRecognizeOperations } from './save-recognize.js';
|
|
39
|
+
import { contractSignLaunchOperations } from './sign-launch.js';
|
|
31
40
|
import { contractSubjectOperations } from './subject.js';
|
|
32
41
|
import { contractTriageOperations } from './triage.js';
|
|
33
42
|
import { contractTypeClauseReadOperations } from './type-clause-read.js';
|
|
43
|
+
import { contractViewlinkOperations } from './viewlink.js';
|
|
34
44
|
import { contractWorkflowOperations } from './workflow.js';
|
|
35
45
|
function buildRegistry() {
|
|
36
46
|
const registry = new Map();
|
|
@@ -63,10 +73,20 @@ function buildRegistry() {
|
|
|
63
73
|
...contractLedgerRouteOperations,
|
|
64
74
|
...contractLedgerMetricsOperations,
|
|
65
75
|
...contractLedgerCardOperations,
|
|
76
|
+
...contractViewlinkOperations,
|
|
77
|
+
...contractSignLaunchOperations,
|
|
78
|
+
...contractOpsDraftOperations,
|
|
79
|
+
contractLedgerStatOperation,
|
|
80
|
+
contractLedgerReportOperation,
|
|
81
|
+
contractLedgerBiOperation,
|
|
82
|
+
...contractCollectionNodeOperations,
|
|
66
83
|
...contractReviewReportOperations,
|
|
84
|
+
...contractBizReviewReportOperations,
|
|
67
85
|
...contractQuoteOperations,
|
|
68
86
|
...contractQuoteRecognizeOperations,
|
|
69
87
|
...contractQuoteSubmitOperations,
|
|
88
|
+
...contractDraftOperations,
|
|
89
|
+
...contractDraftSubmitOperations,
|
|
70
90
|
];
|
|
71
91
|
for (const handler of handlers) {
|
|
72
92
|
if (registry.has(handler.name))
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 发起电子签署(固定答复版)。
|
|
3
|
+
*
|
|
4
|
+
* 🔴 **本 operation 不发起任何签署动作**:全程只读——查一次直销合同台账,
|
|
5
|
+
* 然后按分支返回**固定文案**。没有任何签署接口、没有写操作、没有 continuation。
|
|
6
|
+
*
|
|
7
|
+
* 分支(判定顺序即下表顺序):
|
|
8
|
+
*
|
|
9
|
+
* ① 没给客户 → 直接拒绝(`input_invalid`),让调用方先问清是哪个客户
|
|
10
|
+
* ② 客户名下**没有未归档合同** → NO_CONTRACT(固定文案「不存在客户合同」)
|
|
11
|
+
* ③ 客户名下未归档合同**多于一条** → NEED_CHOICE(摊候选,用户自己选,不替他挑)
|
|
12
|
+
* ④ 已确定唯一一份合同 + 本轮**上传了终稿文件** → INCONSISTENT(固定「版本内容不一致」文案)
|
|
13
|
+
* ⑤ 已确定唯一一份合同 + **没上传**终稿文件 → NEED_FINAL_FILE(固定「请先上传终稿合同」文案)
|
|
14
|
+
* —— ⛔ 没有「已按…发起签署」这种分支:**没上传就不给签署结论**。
|
|
15
|
+
*
|
|
16
|
+
* 「未归档」口径(2026-11-29 实测):直销合同台账「处理进度」`cljd`
|
|
17
|
+
* (字段 `846297265322574160`,textarea)取 `notLike 已归档`——
|
|
18
|
+
* 实测该字段取值含「已归档」「作废」,textarea **不支持 notEq**,只能用 notLike。
|
|
19
|
+
* 因此「作废」行也算未归档,候选里会把处理进度一起显示出来,由用户自己判断。
|
|
20
|
+
*
|
|
21
|
+
* 查询用 `searchParamJson` 一次带两个条件(客户名称 like + 处理进度 notLike):
|
|
22
|
+
* `contract.performance.list.query` 的 `searchFieldId/searchOperator` 只支持
|
|
23
|
+
* eq/like/startWith 单条件,notLike 必须走 `searchParamJson`。
|
|
24
|
+
*/
|
|
25
|
+
import { contractValidationError } from '../errors.js';
|
|
26
|
+
import { contractPerformanceOperations } from './performance.js';
|
|
27
|
+
import { pickRowDataId } from './viewlink.js';
|
|
28
|
+
/** 直销合同台账(六台账字典 §2.1)。 */
|
|
29
|
+
const LIST_ID = '846297265322576591';
|
|
30
|
+
const OBJECT_ID = '846297265322573825';
|
|
31
|
+
const APP_ID = '0';
|
|
32
|
+
const API_PREFIX = '/api/ebuilder';
|
|
33
|
+
const LIST_QUERY_OPERATION = 'contract.performance.list.query';
|
|
34
|
+
/** 过滤字段:客户名称(like)、处理进度(notLike)、合同号(eq)。 */
|
|
35
|
+
const CUSTOMER_FIELD_ID = '846297265322574105';
|
|
36
|
+
const PROGRESS_FIELD_ID = '846297265322574160';
|
|
37
|
+
const CONTRACT_NO_FIELD_ID = '846297265322574097';
|
|
38
|
+
const ARCHIVED_VALUE = '已归档';
|
|
39
|
+
/** 固定文案:不存在客户合同(用户指定口径)。 */
|
|
40
|
+
export const NO_CONTRACT_TEXT = '不存在客户合同';
|
|
41
|
+
/**
|
|
42
|
+
* 固定文案:本轮**没有**上传终稿合同文件。
|
|
43
|
+
* 🔴 用户指定口径:没有文件就**先让用户上传终稿**,⛔ **不允许**直接回「已按…发起电子签署」这类结论。
|
|
44
|
+
* 用户嘴上说「终稿已确认」不算上传——必须有本轮实际的上传/指定文件。
|
|
45
|
+
*/
|
|
46
|
+
export const NEED_FINAL_FILE_TEXT = '发起电子签署需要终稿合同文件:请先把这份合同的终稿合同文件上传给我(.docx 最好),我会与系统中的终稿合同文件核对后再提交签署。';
|
|
47
|
+
/**
|
|
48
|
+
* 固定文案:上传了终稿文件。
|
|
49
|
+
* 🔴 用户指定口径,**逐字固定**,不要改写、不要加解释、不要真去比对文件内容。
|
|
50
|
+
*/
|
|
51
|
+
export const INCONSISTENT_TEXT = '您上传的终稿合同文件与系统中的终稿合同文件版本内容不一致,请在系统中更新之后再提交签署。';
|
|
52
|
+
/** 默认印章与签署顺序(用户没说时用;用户说了就按用户的填进文案)。 */
|
|
53
|
+
const DEFAULT_SEAL = '合同专用章';
|
|
54
|
+
const DEFAULT_SIGN_ORDER = '我方先签 → 客户后签';
|
|
55
|
+
const DEFAULT_MAX_CANDIDATES = 20;
|
|
56
|
+
const HARD_MAX_CANDIDATES = 50;
|
|
57
|
+
/** 候选行回给用户看/选的列:返回键 → 中文名。 */
|
|
58
|
+
const CANDIDATE_COLUMNS = [
|
|
59
|
+
['hth', '合同号'],
|
|
60
|
+
['khmc', '客户名称'],
|
|
61
|
+
['cljd', '处理进度'],
|
|
62
|
+
['htzje', '合同总金额'],
|
|
63
|
+
['htzl', '合同种类'],
|
|
64
|
+
['htyjny', '合同业绩年月'],
|
|
65
|
+
['qdrq', '签订日期'],
|
|
66
|
+
['xsjl', '销售经理'],
|
|
67
|
+
];
|
|
68
|
+
function isRecord(value) {
|
|
69
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
70
|
+
}
|
|
71
|
+
function text(value) {
|
|
72
|
+
if (value === null || value === undefined)
|
|
73
|
+
return '';
|
|
74
|
+
if (typeof value === 'string')
|
|
75
|
+
return value.trim();
|
|
76
|
+
if (typeof value === 'number' || typeof value === 'boolean')
|
|
77
|
+
return String(value);
|
|
78
|
+
return '';
|
|
79
|
+
}
|
|
80
|
+
function clause(fieldId, value, operator) {
|
|
81
|
+
const key = `field_${fieldId}`;
|
|
82
|
+
return { [key]: [{ [key]: value, [`${key}_condition_type`]: operator }] };
|
|
83
|
+
}
|
|
84
|
+
/** 客户名称 like + 处理进度 notLike 已归档 的组合条件(两个条件一次查)。 */
|
|
85
|
+
export function buildSignLookupSearchParam(customer, contractNo) {
|
|
86
|
+
const common = {
|
|
87
|
+
...clause(CUSTOMER_FIELD_ID, customer, 'like'),
|
|
88
|
+
...clause(PROGRESS_FIELD_ID, ARCHIVED_VALUE, 'notLike'),
|
|
89
|
+
};
|
|
90
|
+
if (contractNo)
|
|
91
|
+
Object.assign(common, clause(CONTRACT_NO_FIELD_ID, contractNo, 'eq'));
|
|
92
|
+
return JSON.stringify({ searchType: '2', type: 'and', groupFields: {}, commonSearchFields: common });
|
|
93
|
+
}
|
|
94
|
+
function shapeRow(row, index) {
|
|
95
|
+
const out = { index: index + 1, dataId: pickRowDataId(row) };
|
|
96
|
+
for (const [key] of CANDIDATE_COLUMNS)
|
|
97
|
+
out[key] = text(row[key]);
|
|
98
|
+
return out;
|
|
99
|
+
}
|
|
100
|
+
function findListQueryOperation() {
|
|
101
|
+
const operation = contractPerformanceOperations.find((item) => item.name === LIST_QUERY_OPERATION);
|
|
102
|
+
if (!operation) {
|
|
103
|
+
throw contractValidationError('operation_unknown', `缺少 ${LIST_QUERY_OPERATION},无法查询客户合同。`);
|
|
104
|
+
}
|
|
105
|
+
return operation;
|
|
106
|
+
}
|
|
107
|
+
/** 查该客户**未归档**的合同(一次查询,两个条件)。 */
|
|
108
|
+
async function queryUnarchivedContracts(context, args) {
|
|
109
|
+
const result = await findListQueryOperation().execute({
|
|
110
|
+
apiPrefix: API_PREFIX,
|
|
111
|
+
listId: LIST_ID,
|
|
112
|
+
appId: APP_ID,
|
|
113
|
+
objId: OBJECT_ID,
|
|
114
|
+
searchParamJson: buildSignLookupSearchParam(args.customer, args.contractNo),
|
|
115
|
+
pageSize: args.pageSize,
|
|
116
|
+
maxPages: 1,
|
|
117
|
+
}, context);
|
|
118
|
+
const rows = Array.isArray(result.data?.rows) ? result.data.rows.filter(isRecord) : [];
|
|
119
|
+
const total = Number(result.data?.pagination?.total ?? rows.length);
|
|
120
|
+
return { rows, total: Number.isFinite(total) ? total : rows.length };
|
|
121
|
+
}
|
|
122
|
+
export const contractSignLaunchOperations = [
|
|
123
|
+
{
|
|
124
|
+
name: 'contract.sign.launch',
|
|
125
|
+
risk: 'read',
|
|
126
|
+
inputSchema: {
|
|
127
|
+
type: 'object',
|
|
128
|
+
additionalProperties: false,
|
|
129
|
+
properties: {
|
|
130
|
+
customer: { type: 'string', description: '客户名称(必填);用于查该客户**未归档**的合同' },
|
|
131
|
+
contractNo: { type: 'string', description: '用户已从候选里选定的合同号;给了就跳过"多条让用户选"' },
|
|
132
|
+
uploadedFinal: { type: 'boolean', description: '本轮用户是否上传/指定了终稿合同文件' },
|
|
133
|
+
finalFile: { type: 'string', description: '终稿文件路径或文件名(给了即视为已上传)' },
|
|
134
|
+
seal: { type: 'string', description: '印章类型,默认 合同专用章' },
|
|
135
|
+
signOrder: { type: 'string', description: '签署顺序,默认 我方先签 → 客户后签' },
|
|
136
|
+
maxCandidates: { type: 'number' },
|
|
137
|
+
},
|
|
138
|
+
required: ['customer'],
|
|
139
|
+
},
|
|
140
|
+
async execute(input, context) {
|
|
141
|
+
const customer = text(input.customer);
|
|
142
|
+
if (!customer) {
|
|
143
|
+
throw contractValidationError('input_invalid', 'customer 必填:先问清是哪个客户(「本合同」这类指代不算),再查该客户的未归档合同。');
|
|
144
|
+
}
|
|
145
|
+
const contractNo = text(input.contractNo);
|
|
146
|
+
const seal = text(input.seal) || DEFAULT_SEAL;
|
|
147
|
+
const signOrder = text(input.signOrder) || DEFAULT_SIGN_ORDER;
|
|
148
|
+
const finalFile = text(input.finalFile);
|
|
149
|
+
const uploadedFinal = input.uploadedFinal === true || finalFile !== '';
|
|
150
|
+
const maxCandidates = Math.min(Math.max(Math.trunc(Number(input.maxCandidates)) || DEFAULT_MAX_CANDIDATES, 1), HARD_MAX_CANDIDATES);
|
|
151
|
+
// 查询上限:既要能判「多条」,也要够摊候选(要合同号时多取一条用于定位)
|
|
152
|
+
const pageSize = Math.min(maxCandidates + 1, 200);
|
|
153
|
+
const { rows, total } = await queryUnarchivedContracts(context, { customer, contractNo: contractNo || undefined, pageSize });
|
|
154
|
+
const candidates = rows.slice(0, maxCandidates).map(shapeRow);
|
|
155
|
+
const base = {
|
|
156
|
+
customer,
|
|
157
|
+
ledger: { menu: '直销合同', listId: LIST_ID, objId: OBJECT_ID, apiPrefix: API_PREFIX },
|
|
158
|
+
filter: { 客户名称: `like ${customer}`, 处理进度: `notLike ${ARCHIVED_VALUE}` },
|
|
159
|
+
fixed: true,
|
|
160
|
+
launched: false,
|
|
161
|
+
seal,
|
|
162
|
+
signOrder,
|
|
163
|
+
uploadedFinalFile: uploadedFinal,
|
|
164
|
+
counts: { total, returned: candidates.length, truncated: total > candidates.length },
|
|
165
|
+
};
|
|
166
|
+
// ② 不存在未归档合同
|
|
167
|
+
if (total === 0) {
|
|
168
|
+
return {
|
|
169
|
+
status: 'COMPLETE',
|
|
170
|
+
data: {
|
|
171
|
+
...base,
|
|
172
|
+
status: 'NO_CONTRACT',
|
|
173
|
+
contract: null,
|
|
174
|
+
candidates: [],
|
|
175
|
+
nextAction: 'report_fixed',
|
|
176
|
+
message: NO_CONTRACT_TEXT,
|
|
177
|
+
warnings: [],
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
// ③ 多条:摊候选,用户自己选,不替他挑
|
|
182
|
+
if (total > 1) {
|
|
183
|
+
return {
|
|
184
|
+
status: 'COMPLETE',
|
|
185
|
+
data: {
|
|
186
|
+
...base,
|
|
187
|
+
status: 'NEED_CHOICE',
|
|
188
|
+
contract: null,
|
|
189
|
+
candidates,
|
|
190
|
+
nextAction: 'ask_user_to_choose',
|
|
191
|
+
nextCommand: `contract run contract.sign.launch --input '{"customer":"${customer}","contractNo":"<用户选中的合同号>"}'`,
|
|
192
|
+
message: `客户「${customer}」名下有 ${total} 条未归档合同,请让用户自己选一条(不要自行取第一条);选定后带 contractNo 重跑本命令。`,
|
|
193
|
+
warnings: [],
|
|
194
|
+
},
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
// ④⑤ 唯一确定一份合同
|
|
198
|
+
const row = rows[0] ?? {};
|
|
199
|
+
const hitNo = text(row.hth);
|
|
200
|
+
const hitProgress = text(row.cljd);
|
|
201
|
+
const contract = {
|
|
202
|
+
contractNo: hitNo,
|
|
203
|
+
customerName: text(row.khmc),
|
|
204
|
+
progress: hitProgress,
|
|
205
|
+
amount: text(row.htzje),
|
|
206
|
+
contractType: text(row.htzl),
|
|
207
|
+
performanceMonth: text(row.htyjny),
|
|
208
|
+
signDate: text(row.qdrq),
|
|
209
|
+
salesManager: text(row.xsjl),
|
|
210
|
+
dataId: pickRowDataId(row),
|
|
211
|
+
};
|
|
212
|
+
const warnings = [];
|
|
213
|
+
const notes = [];
|
|
214
|
+
if (hitProgress && hitProgress !== '已归档' && /作废|终止|解除/.test(hitProgress)) {
|
|
215
|
+
// 只进 note(给调用方看的内部上下文),**不进 warnings / message**:
|
|
216
|
+
// 固定答复是用户指定口径,不能被这条提示改写或追加。
|
|
217
|
+
notes.push(`内部上下文:该合同处理进度为「${hitProgress}」,不是可签署状态,人工核实后再决定是否发起。`);
|
|
218
|
+
}
|
|
219
|
+
// ④ 上传了终稿文件 → 固定「版本内容不一致」文案
|
|
220
|
+
if (uploadedFinal) {
|
|
221
|
+
return {
|
|
222
|
+
status: 'COMPLETE',
|
|
223
|
+
data: {
|
|
224
|
+
...base,
|
|
225
|
+
status: 'INCONSISTENT',
|
|
226
|
+
contract,
|
|
227
|
+
candidates,
|
|
228
|
+
...(finalFile ? { finalFile } : {}),
|
|
229
|
+
nextAction: 'report_fixed',
|
|
230
|
+
message: INCONSISTENT_TEXT,
|
|
231
|
+
note: '本答复是**逐字固定文案**(用户指定口径):不要改写、不要补充解释、不要真去比对文件内容;'
|
|
232
|
+
+ '也不得改写成"签署已发起 / 已生效 / 已完成"。'
|
|
233
|
+
+ (notes.length ? ` ${notes.join(' ')}` : ''),
|
|
234
|
+
warnings: [],
|
|
235
|
+
},
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
// ⑤ 没上传终稿文件 → 固定「请先上传终稿合同」文案(⛔ 不再回"已发起签署")
|
|
239
|
+
return {
|
|
240
|
+
status: 'COMPLETE',
|
|
241
|
+
data: {
|
|
242
|
+
...base,
|
|
243
|
+
status: 'NEED_FINAL_FILE',
|
|
244
|
+
contract,
|
|
245
|
+
candidates,
|
|
246
|
+
nextAction: 'ask_user_to_upload',
|
|
247
|
+
message: NEED_FINAL_FILE_TEXT,
|
|
248
|
+
note: '用户嘴上说「终稿已确认」**不算**上传:必须有本轮实际的上传/指定文件才走 INCONSISTENT 分支。'
|
|
249
|
+
+ '本答复同样是固定文案,不要补"已按合同专用章/我方先签客户后签发起签署"之类结论。'
|
|
250
|
+
+ (notes.length ? ` ${notes.join(' ')}` : ''),
|
|
251
|
+
warnings: [],
|
|
252
|
+
},
|
|
253
|
+
};
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
];
|