weaver-work-cli 0.1.73 → 0.1.75
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-OZJ6PYUR.js} +14 -9
- package/dist/chunks/{archive-oa-PQ23OLEV.js → archive-oa-BHL5RK2F.js} +10 -7
- package/dist/chunks/{asset-RGPROZYH.js → asset-HKRFRQR2.js} +10 -7
- package/dist/chunks/{asset-idle-Z2PDX7NA.js → asset-idle-GGIR4KE7.js} +7 -4
- package/dist/chunks/{attachment-content-R3RPVOYE.js → attachment-content-4OV65NK5.js} +3 -3
- package/dist/chunks/{blog-7U3QZPIF.js → blog-HYDP4DV3.js} +10 -7
- package/dist/chunks/{caizhilian-3AB42GCV.js → caizhilian-JS4RQZ6Z.js} +10 -7
- package/dist/chunks/{calendar-KINM64E4.js → calendar-SWRY4DIT.js} +10 -7
- package/dist/chunks/chunk-257JXJGD.js +30 -0
- package/dist/chunks/{chunk-LLCMOZ5L.js → chunk-2AUFKU2D.js} +11 -11
- package/dist/chunks/chunk-2BZ7TY4M.js +49 -0
- package/dist/chunks/{chunk-WM33BSIL.js → chunk-2QCCXPNU.js} +1 -1
- package/dist/chunks/{chunk-TV46Q4NY.js → chunk-4FCBEWNB.js} +74 -68
- package/dist/chunks/{chunk-NUP4RYZK.js → chunk-5D2V7ZAN.js} +2 -2
- package/dist/chunks/{chunk-DRUND2PJ.js → chunk-5QUTQHXF.js} +225 -152
- package/dist/chunks/{chunk-4BXR6CNB.js → chunk-5ZJGPEIB.js} +2 -2
- package/dist/chunks/chunk-7DE3VMZD.js +35 -0
- package/dist/chunks/chunk-BNKUHN4N.js +1346 -0
- package/dist/chunks/{chunk-2CHGUYMG.js → chunk-BSR5TM7U.js} +4 -4
- package/dist/chunks/{chunk-4I26YMBY.js → chunk-ERZY6GYL.js} +7 -3
- package/dist/chunks/{chunk-4YXAK6OA.js → chunk-FEZK536Z.js} +12 -7
- package/dist/chunks/{chunk-F4HM25K4.js → chunk-I6NOHKEK.js} +1 -1
- package/dist/chunks/{chunk-JMJBPP4B.js → chunk-J7FAAHWH.js} +2 -2
- package/dist/chunks/{chunk-54ST55IJ.js → chunk-JJONWB5N.js} +11 -1
- package/dist/chunks/chunk-JOY3HZXL.js +467 -0
- package/dist/chunks/{chunk-GWJLAF6B.js → chunk-JWF2R6EQ.js} +0 -462
- package/dist/chunks/{chunk-BWYVS62Z.js → chunk-KEA4XQPO.js} +4 -4
- package/dist/chunks/chunk-KINXYJXM.js +205 -0
- package/dist/chunks/{chunk-IBSJJGXL.js → chunk-KWJEICD4.js} +2 -2
- package/dist/chunks/{chunk-GAMGDNTF.js → chunk-LJI4N6FV.js} +1 -1
- package/dist/chunks/{chunk-IU6UB2TD.js → chunk-MXCRKXOP.js} +48 -6
- package/dist/chunks/{chunk-PAFOLIYQ.js → chunk-NWYHCZTY.js} +1 -1
- package/dist/chunks/chunk-OJ4JPD25.js +428 -0
- package/dist/chunks/{chunk-L7TYG5SN.js → chunk-OQCK5SAU.js} +2 -2
- package/dist/chunks/chunk-PG5YSNYY.js +1166 -0
- package/dist/chunks/{chunk-XZBYRYWX.js → chunk-QJWVYOOV.js} +2 -2
- package/dist/chunks/{chunk-AMAPQVBT.js → chunk-QVKRNL7L.js} +286 -305
- package/dist/chunks/chunk-SU6IJD6D.js +49 -0
- package/dist/chunks/{chunk-ZWLWXHJC.js → chunk-TA2RBUTH.js} +2 -2
- package/dist/chunks/{chunk-6HT73VOI.js → chunk-U6Y32KEV.js} +2 -2
- package/dist/chunks/chunk-UUJK76HV.js +209 -0
- package/dist/chunks/{chunk-R3MK2RBN.js → chunk-VOMDD2C5.js} +1 -1
- package/dist/chunks/chunk-Y3C6MDL7.js +28 -0
- package/dist/chunks/chunk-ZM7RN2IM.js +38 -0
- package/dist/chunks/{chunk-2XED2FKY.js → chunk-ZUB4M4N3.js} +38 -36
- package/dist/chunks/{chunk-7QFVXP2X.js → chunk-ZWIMLT6P.js} +8 -7
- package/dist/chunks/cli-FULPXIKJ.js +226 -0
- package/dist/chunks/commands-BNWFNTD3.js +70 -0
- package/dist/chunks/{conflict-VPAR7E6F.js → conflict-5BKCDV2F.js} +2 -2
- package/dist/chunks/{contract-DDXAO2DZ.js → contract-WI23OXVC.js} +12446 -5964
- package/dist/chunks/{cowork-34QCHMDD.js → cowork-DZBBVNMQ.js} +11 -8
- package/dist/chunks/{create-flow-52PU2OBI.js → create-flow-7ZRBRKX7.js} +6 -6
- package/dist/chunks/{data-CLQ62QGD.js → data-PAZVE6QE.js} +6 -3
- package/dist/chunks/{ebuilder-form-W5R7Q22S.js → ebuilder-form-5SQXIGXN.js} +9 -6
- package/dist/chunks/{ehr-LCNAVMK5.js → ehr-CX5F4ZAU.js} +23 -16
- package/dist/chunks/{entry-mode-6Z3ZV3DE.js → entry-mode-I2BYNONZ.js} +3 -3
- package/dist/chunks/{env-RDKWAARB.js → env-ZAQZ7EHN.js} +2 -2
- package/dist/chunks/{esb-ANKPUU65.js → esb-DQTXDIBF.js} +10 -7
- package/dist/chunks/{factory-434B7RAT.js → factory-XRI6KZ7H.js} +1 -1
- package/dist/chunks/{fna-AKBSG5HI.js → fna-FK6HQVJL.js} +13 -8
- package/dist/chunks/{group-chat-PROTW22R.js → group-chat-MLWNYM2P.js} +3 -3
- package/dist/chunks/{host-WO4L5G5I.js → host-3EPREGXS.js} +6 -3
- package/dist/chunks/{host-XIYG4F4B.js → host-J74JGYAW.js} +6 -3
- package/dist/chunks/{host-7FJW4E7R.js → host-KUMU3DDK.js} +6 -3
- package/dist/chunks/{host-5R2SNFWD.js → host-MEC4VQZA.js} +6 -3
- package/dist/chunks/{host-PDJAKCT7.js → host-T6NNQGVZ.js} +6 -3
- package/dist/chunks/{host-CGXUFQO4.js → host-VI7Q45PM.js} +6 -3
- package/dist/chunks/{hrm-WGODDTEH.js → hrm-KKVAW4P5.js} +8 -5
- package/dist/chunks/{im-YKTKAJU3.js → im-47CIWQNL.js} +7 -4
- package/dist/chunks/{invoice-PVYCCCVM.js → invoice-CDYRBNIG.js} +21 -16
- package/dist/chunks/{jiuchuanhui-RKOQW7BY.js → jiuchuanhui-M7QTRHZK.js} +17 -10
- package/dist/chunks/{lazy-dispatch-DW45AFQ5.js → lazy-dispatch-FKQJZFI5.js} +22 -8
- package/dist/chunks/{mail-BNB5S4NW.js → mail-NRBS5N6Y.js} +11 -8
- package/dist/chunks/{meeting-O2KDJH66.js → meeting-WC5LD3IO.js} +22 -18
- package/dist/chunks/{minute-doc-JUCG56GY.js → minute-doc-OQUMDTKG.js} +4 -4
- package/dist/chunks/{okr-LWFGWOE7.js → okr-EHKSKMPL.js} +10 -7
- package/dist/chunks/{operations-532PN5OB.js → operations-V5VM5MS2.js} +7 -4
- package/dist/chunks/{performance-7W5COCFU.js → performance-ZJADXJPN.js} +6 -3
- package/dist/chunks/{plan-ZVY3IYTL.js → plan-OTDNBDJ7.js} +10 -7
- package/dist/chunks/{project-SA62B7MH.js → project-4XVBQ3HX.js} +10 -7
- package/dist/chunks/{reception-NGIONPQ3.js → reception-3FAHOOH7.js} +8 -4
- package/dist/chunks/{recruit-stage-WOSN6MGP.js → recruit-stage-3WTVWW2K.js} +199 -74
- package/dist/chunks/register-SQOPIR2G.js +16 -0
- package/dist/chunks/{registry-R72GWXOG.js → registry-F4YFZLOD.js} +7 -3
- package/dist/chunks/registry-NBTBXR4L.js +30 -0
- package/dist/chunks/{registry-N7P3W2RD.js → registry-TJGCVRCW.js} +7 -4
- package/dist/chunks/{room-recommend-KCGIVUFR.js → room-recommend-KL62XB2Y.js} +4 -4
- package/dist/chunks/root-YZG2TS5W.js +16 -0
- package/dist/chunks/{schedule-6UP27HQ4.js → schedule-XOISYUPB.js} +4 -4
- package/dist/chunks/{smart-extract-DDOQSPRB.js → smart-extract-UYGNV3BM.js} +15 -7
- package/dist/chunks/update-AV5VOXGY.js +13 -0
- package/dist/chunks/{workflow-V5ALD6QZ.js → workflow-V54LJPXL.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/index.js +1 -1
- 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/contract.md +6 -1
- package/docs/e10-auth.md +25 -7
- package/docs/operation-manual.md +15 -0
- package/package.json +2 -2
- package/scripts/pysite/__pycache__/sitecustomize.cpython-314.pyc +0 -0
- package/skill-template/business-info.json +28 -0
- package/skill-template/domains/jinchengda.md +13 -1
- 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 +188 -169
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +55 -37
- package/skills/weaver-e10-recruit-stage/lib/interview-conflict.mjs +3 -0
- package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +168 -35
- package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +175 -7
- 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 +16 -11
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +10 -6
- 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 +7 -3
- 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 +31 -23
- 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 +147 -34
- package/skills/weaver-e10-recruit-stage/references/recruit-platform-compat.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +16 -4
- 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 +24 -15
- 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 +32 -30
- 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/references/source-manifest.json +5 -5
- package/dist/chunks/chunk-ICP53R52.js +0 -2849
- package/dist/chunks/registry-RIQ67ZT7.js +0 -27
|
@@ -478,6 +478,9 @@ const EBDF_ONLY_MENUS = ['合同收款', '项目验收'];
|
|
|
478
478
|
const MENU_INTENT_HINTS = [
|
|
479
479
|
{ pattern: /我的合同|看合同|查合同|合同台账|合同清单/u, menu: '直销合同' },
|
|
480
480
|
{ pattern: /我的业绩|看业绩|查业绩|业绩台账/u, menu: '直销业绩' },
|
|
481
|
+
// 签署 / 签约 / 回款 / 新签 这类词只可能落在直销合同(合同总金额、已收款、合同种类都在它上面)。
|
|
482
|
+
// 排在「业绩」之后:同时出现「业绩」时仍按业绩台账走。
|
|
483
|
+
{ pattern: /签署|签约|合同总金额|合同总额|新签|续签|回款率|回款/u, menu: '直销合同' },
|
|
481
484
|
];
|
|
482
485
|
/**
|
|
483
486
|
* 从用户原话里认台账名(2026-11-19 新增)。
|
|
@@ -798,7 +801,7 @@ export const contractLedgerRouteOperation = {
|
|
|
798
801
|
? '(卡片已随本响应返回:顶层 data.card 直接作为 <browsertool> 输出,无需再调 contract.ledger.card)'
|
|
799
802
|
: 'weaver-work-cli --json contract run contract.ledger.card --input <args.json>'
|
|
800
803
|
+ `(menu=${menu}${prefillHint})`)
|
|
801
|
-
: 'contract.ledger.metrics 取口径 → contract.performance.list.query
|
|
804
|
+
: 'contract.ledger.stat(按月/跨年/多口径/同比一次成表,先 dryRun 看计划)→ 要报表再 contract.ledger.report;单点汇总用 contract.ledger.metrics 取口径 → contract.performance.list.query → contract.ledger.aggregate';
|
|
802
805
|
return {
|
|
803
806
|
status: 'COMPLETE',
|
|
804
807
|
data: {
|
|
@@ -21,9 +21,13 @@ function buildQueryPlan(metric) {
|
|
|
21
21
|
note: cond.note ?? null,
|
|
22
22
|
}));
|
|
23
23
|
const unresolved = unresolvedMetricFields(metric);
|
|
24
|
-
const aggregateHint = metric.
|
|
25
|
-
?
|
|
26
|
-
:
|
|
24
|
+
const aggregateHint = metric.aggregation === 'countDistinct'
|
|
25
|
+
? `取回结果后按「${metric.distinct?.dataKey ?? metric.metricDataKey}」键去重计数(字段「${metric.distinct?.field ?? metric.metricField}」);跨月合计按整窗去重,不是各月相加。`
|
|
26
|
+
: metric.aggregation === 'ratio'
|
|
27
|
+
? `取回结果后按「${metric.ratio?.numerator.dataKey}」求和 ÷「${metric.ratio?.denominator.dataKey}」求和 ×100%,分子分母必须同台账同窗口;分母为 0 返回 null。`
|
|
28
|
+
: metric.metricDataKey
|
|
29
|
+
? `取回结果后按返回行的「${metric.metricDataKey}」键求和(字段「${metric.metricField}」);该键来自 getListDatas 响应 data.columns 的 dataKey,不是字段中文名。`
|
|
30
|
+
: `取回结果后按「${metric.metricField}」对应返回键求和;键名未登记,先核对非空键再汇总。`;
|
|
27
31
|
return {
|
|
28
32
|
operation: 'contract.performance.list.query',
|
|
29
33
|
apiPrefix: '/api/ebuilder',
|
|
@@ -80,6 +84,8 @@ export const contractLedgerMetricsOperations = [
|
|
|
80
84
|
metricFieldId: metric.metricFieldId,
|
|
81
85
|
metricDataKey: metric.metricDataKey,
|
|
82
86
|
aggregation: metric.aggregation,
|
|
87
|
+
...(metric.distinct ? { distinct: metric.distinct } : {}),
|
|
88
|
+
...(metric.ratio ? { ratio: metric.ratio } : {}),
|
|
83
89
|
conditions: metric.conditions,
|
|
84
90
|
note: metric.note,
|
|
85
91
|
queryPlan: buildQueryPlan(metric),
|
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 客户运维合同起草(E10):销售合同 × 百分比 → 系统维护服务范文 → 可执行填充方案。
|
|
3
|
+
*
|
|
4
|
+
* 链路(本 operation 负责 ①~④,⑤⑥ 由调用方按 nextCommands 继续):
|
|
5
|
+
*
|
|
6
|
+
* ① 客户 → 该客户的**销售合同**(多条让用户自己选,唯一则继续)→ 取「合同总金额」`htzje`
|
|
7
|
+
* ② 百分比(默认 10%,可被用户指定)× 合同总金额 = **运维合同金额**
|
|
8
|
+
* ③ 在**范文库**里按名称找系统维护的**年度维护服务合同模板**(命中多篇按优先级取第一,并把候选摊出来)
|
|
9
|
+
* ④ 下载该范文 → `docx.slots.scan` → 按模板真实位点生成**填充方案**(金额一律走 `$quote` 值引用,不经过模型上下文)
|
|
10
|
+
* ⑤ `contract.docx.slots.fill`(template/out/plan)
|
|
11
|
+
* ⑥ `contract.quotescreen.submit`(上传 + 装配要素 + 存识别记录 → `open_web` 开 `tab=Extract`)
|
|
12
|
+
*
|
|
13
|
+
* 两条硬约束:
|
|
14
|
+
* - **金额不手写**:`plan` 里所有金额位点都是 `{"$quote":"<ops.json>#totals.final_total"}`,真值由本地进程读;
|
|
15
|
+
* `收费标准` 这类「数字 + 单位」的展示串也在本地拼好(`#totals.charge_standard`)。
|
|
16
|
+
* - **标准条款不发明**:服务内容行、付款阶段说明与比例、款项期数,全部**照抄模板自身的行**——
|
|
17
|
+
* 这就是「付款按标准运维合同的标准生成」的字面含义;只有金额按百分比算。
|
|
18
|
+
*/
|
|
19
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
20
|
+
import { join, resolve } from 'node:path';
|
|
21
|
+
import { contractValidationError } from '../errors.js';
|
|
22
|
+
import { contractDocxSlotsOperations } from './docx-slots.js';
|
|
23
|
+
import { contractFileDownloadOperations } from './file-download.js';
|
|
24
|
+
import { contractPerformanceOperations } from './performance.js';
|
|
25
|
+
import { requireNonEmptyString } from './shared.js';
|
|
26
|
+
// ---------------------------------------------------------------- 固定常量
|
|
27
|
+
const SALES_LIST_ID = '846297265322576591';
|
|
28
|
+
const SALES_OBJ_ID = '846297265322573825';
|
|
29
|
+
const APP_ID = '0';
|
|
30
|
+
const API_PREFIX = '/api/ebuilder';
|
|
31
|
+
const LIST_QUERY_OPERATION = 'contract.performance.list.query';
|
|
32
|
+
const CUSTOMER_FIELD_ID = '846297265322574105';
|
|
33
|
+
const CONTRACT_NO_FIELD_ID = '846297265322574097';
|
|
34
|
+
/** 范文库(「合同范文管理」EB 表单)——与 `contract.modeltext.list` 同一对象。 */
|
|
35
|
+
const MODEL_TEXT_OBJ_ID = '1290191829260230657';
|
|
36
|
+
const MODEL_TEXT_LIST_ID = '1290191833571975256';
|
|
37
|
+
const LIST_DATAS_PATH = '/api/ebuilder/form/list/getListDatas';
|
|
38
|
+
/** 运维/维护类模板的命中优先级(越靠前越专指「年度维护服务合同」)。 */
|
|
39
|
+
const TEMPLATE_KEYWORDS = ['年度维护服务合同', '维护服务合同', '运维服务合同', '运维合同', '维护服务', '维保服务', '运维', '维保', '维护'];
|
|
40
|
+
const DEFAULT_PERCENT = 10;
|
|
41
|
+
/** 甲方占位(模板里写作 `***有限公司`),按客户全称替换。 */
|
|
42
|
+
const PARTY_PLACEHOLDER = '***有限公司';
|
|
43
|
+
const PLAN_SCAN_OPERATION = 'contract.docx.slots.scan';
|
|
44
|
+
const FILE_DOWNLOAD_OPERATION = 'contract.file.download';
|
|
45
|
+
// ---------------------------------------------------------------- 纯函数(可单测)
|
|
46
|
+
function isRecord(value) {
|
|
47
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
48
|
+
}
|
|
49
|
+
function text(value) {
|
|
50
|
+
if (value === null || value === undefined)
|
|
51
|
+
return '';
|
|
52
|
+
if (typeof value === 'string')
|
|
53
|
+
return value.trim();
|
|
54
|
+
if (typeof value === 'number' || typeof value === 'boolean')
|
|
55
|
+
return String(value);
|
|
56
|
+
return '';
|
|
57
|
+
}
|
|
58
|
+
export function round2(value) {
|
|
59
|
+
return Number(value.toFixed(2));
|
|
60
|
+
}
|
|
61
|
+
/** 展示串金额 → 数值(去掉 ¥ ¥ 千分位 空格 元)。空值/非数字 → 0。 */
|
|
62
|
+
export function parseMoney(value) {
|
|
63
|
+
const raw = text(value).replace(/[,,¥¥\s元]/gu, '');
|
|
64
|
+
if (!raw)
|
|
65
|
+
return 0;
|
|
66
|
+
const parsed = Number(raw);
|
|
67
|
+
return Number.isFinite(parsed) ? parsed : 0;
|
|
68
|
+
}
|
|
69
|
+
/** 客户名称 like(+ 可选合同号 eq)的查询条件,走 searchParamJson。 */
|
|
70
|
+
export function buildSalesLookupSearchParam(customer, contractNo) {
|
|
71
|
+
const key = `field_${CUSTOMER_FIELD_ID}`;
|
|
72
|
+
const common = {
|
|
73
|
+
[key]: [{ [key]: customer, [`${key}_condition_type`]: 'like' }],
|
|
74
|
+
};
|
|
75
|
+
if (contractNo) {
|
|
76
|
+
const noKey = `field_${CONTRACT_NO_FIELD_ID}`;
|
|
77
|
+
Object.assign(common, { [noKey]: [{ [noKey]: contractNo, [`${noKey}_condition_type`]: 'eq' }] });
|
|
78
|
+
}
|
|
79
|
+
return JSON.stringify({ searchType: '2', type: 'and', groupFields: {}, commonSearchFields: common });
|
|
80
|
+
}
|
|
81
|
+
/** 按关键词优先级给范文排序;返回命中列表(没命中返回空数组)。 */
|
|
82
|
+
export function rankTemplates(rows, keywords = TEMPLATE_KEYWORDS) {
|
|
83
|
+
const scored = [];
|
|
84
|
+
rows.forEach((row, order) => {
|
|
85
|
+
const name = text(row.file_name ?? row.fileName);
|
|
86
|
+
if (!name)
|
|
87
|
+
return;
|
|
88
|
+
const index = keywords.findIndex((keyword) => name.includes(keyword));
|
|
89
|
+
if (index < 0)
|
|
90
|
+
return;
|
|
91
|
+
scored.push({ row, score: index, order });
|
|
92
|
+
});
|
|
93
|
+
return scored
|
|
94
|
+
.sort((a, b) => (a.score === b.score ? a.order - b.order : a.score - b.score))
|
|
95
|
+
.map((item) => item.row);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* 从范文行里挖出附件 fileId。
|
|
99
|
+
*
|
|
100
|
+
* 范文行的附件字段值是 JSON 串(形如 `{"name":"…docx","id":"1333…","type":"FileComponent"}`),
|
|
101
|
+
* 字段名随环境变化,因此不按字段名取值,而是递归找「带 id 且像文件」的对象。
|
|
102
|
+
*/
|
|
103
|
+
export function extractAttachmentFileId(row) {
|
|
104
|
+
const visit = (value, depth) => {
|
|
105
|
+
if (depth > 6)
|
|
106
|
+
return null;
|
|
107
|
+
if (typeof value === 'string') {
|
|
108
|
+
const raw = value.trim();
|
|
109
|
+
if (!raw.startsWith('{') && !raw.startsWith('['))
|
|
110
|
+
return null;
|
|
111
|
+
try {
|
|
112
|
+
return visit(JSON.parse(raw), depth + 1);
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (Array.isArray(value)) {
|
|
119
|
+
for (const item of value) {
|
|
120
|
+
const hit = visit(item, depth + 1);
|
|
121
|
+
if (hit)
|
|
122
|
+
return hit;
|
|
123
|
+
}
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
if (isRecord(value)) {
|
|
127
|
+
const id = text(value.id);
|
|
128
|
+
const looksLikeFile = text(value.type) === 'FileComponent'
|
|
129
|
+
|| typeof value.fileExtendName === 'string'
|
|
130
|
+
|| /\.(docx?|pdf)$/iu.test(text(value.name));
|
|
131
|
+
if (id && looksLikeFile)
|
|
132
|
+
return id;
|
|
133
|
+
for (const item of Object.values(value)) {
|
|
134
|
+
const hit = visit(item, depth + 1);
|
|
135
|
+
if (hit)
|
|
136
|
+
return hit;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return null;
|
|
140
|
+
};
|
|
141
|
+
return visit(row, 0);
|
|
142
|
+
}
|
|
143
|
+
/** 扫描结果里 `fullText` 偶发整段重复(模板里同一段被拆成两半),去掉重复的一半。 */
|
|
144
|
+
export function dedupeDoubled(value) {
|
|
145
|
+
const text0 = value.trim();
|
|
146
|
+
if (text0.length < 8 || text0.length % 2 !== 0)
|
|
147
|
+
return text0;
|
|
148
|
+
const half = text0.length / 2;
|
|
149
|
+
return text0.slice(0, half) === text0.slice(half) ? text0.slice(0, half) : text0;
|
|
150
|
+
}
|
|
151
|
+
/** 范文里的 `***有限公司` 按客户全称替换;没有占位符时原样返回。 */
|
|
152
|
+
export function replaceParty(value, customerName) {
|
|
153
|
+
return value.split(PARTY_PLACEHOLDER).join(customerName);
|
|
154
|
+
}
|
|
155
|
+
/** 从范文文件名里取我方签约主体(如「上海泛微软件有限公司年度维护服务合同模板V1.docx」→ 上海泛微软件有限公司)。 */
|
|
156
|
+
export function ourCompanyFromTemplate(fileName) {
|
|
157
|
+
const matched = /^([^\s/\\]{2,40}?(?:股份有限公司|有限公司))/u.exec(fileName.trim());
|
|
158
|
+
return matched ? matched[1] : null;
|
|
159
|
+
}
|
|
160
|
+
/** 日期 YYYY-MM-DD → 合同里的 `YYYY年M月D日`。 */
|
|
161
|
+
export function chineseDate(iso) {
|
|
162
|
+
const matched = /^(\d{4})-(\d{2})-(\d{2})$/u.exec(iso.trim());
|
|
163
|
+
if (!matched)
|
|
164
|
+
return iso;
|
|
165
|
+
return `${Number(matched[1])}年${Number(matched[2])}月${Number(matched[3])}日`;
|
|
166
|
+
}
|
|
167
|
+
/** 运维合同金额 = 销售合同总额 × 百分比(两位小数);展示串在同一处拼好,不经过模型。 */
|
|
168
|
+
export function computeMaintenanceAmount(baseTotal, percent) {
|
|
169
|
+
const base = round2(parseMoney(baseTotal));
|
|
170
|
+
const maintenance = round2((base * percent) / 100);
|
|
171
|
+
return {
|
|
172
|
+
base,
|
|
173
|
+
percent,
|
|
174
|
+
maintenance,
|
|
175
|
+
formula: `${base} × ${percent}% = ${maintenance}`,
|
|
176
|
+
chargeStandard: `${maintenance}元/年*1年`,
|
|
177
|
+
zeroBase: base === 0,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* 按模板真实位点生成填充方案:
|
|
182
|
+
* - 段落/单元格:占位与签署日期按实际值写;
|
|
183
|
+
* - 金额区块(含「收费标准」列):写成按百分比算出的维护费;
|
|
184
|
+
* - 付款区块:**原样沿用模板的标准付款行**,只把付款金额换成 `$quote` 引用;
|
|
185
|
+
* - 其余区块(如服务内容):原样沿用模板行。
|
|
186
|
+
*/
|
|
187
|
+
export function buildFillPlan(input) {
|
|
188
|
+
const { slots, customerName, signDateIso, opsJsonPath } = input;
|
|
189
|
+
const ref = (path) => ({ $quote: `${opsJsonPath}#${path}` });
|
|
190
|
+
const planSlots = [];
|
|
191
|
+
const planRegions = [];
|
|
192
|
+
const writes = { paragraphs: [], cells: [], regions: [] };
|
|
193
|
+
const standardTerms = { amountRows: [], paymentRows: [], otherRegionRows: {} };
|
|
194
|
+
for (const slot of slots) {
|
|
195
|
+
if (slot.type === 'paragraph') {
|
|
196
|
+
const source = dedupeDoubled(text(slot.fullText) || text(slot.current));
|
|
197
|
+
if (!source || !source.includes(PARTY_PLACEHOLDER))
|
|
198
|
+
continue;
|
|
199
|
+
planSlots.push({ slotId: slot.slotId, value: replaceParty(source, customerName) });
|
|
200
|
+
writes.paragraphs.push(slot.slotId);
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
if (slot.type === 'cell') {
|
|
204
|
+
const label = text(slot.label);
|
|
205
|
+
const current = text(slot.current);
|
|
206
|
+
if (label === '甲方' && current.includes(PARTY_PLACEHOLDER)) {
|
|
207
|
+
planSlots.push({ slotId: slot.slotId, value: customerName });
|
|
208
|
+
writes.cells.push(slot.slotId);
|
|
209
|
+
}
|
|
210
|
+
else if (label === '签订时间' || label === '生效日期') {
|
|
211
|
+
planSlots.push({ slotId: slot.slotId, value: chineseDate(signDateIso) });
|
|
212
|
+
writes.cells.push(slot.slotId);
|
|
213
|
+
}
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
if (slot.type !== 'table-region')
|
|
217
|
+
continue;
|
|
218
|
+
const columns = (slot.columns ?? []).map((column) => column.name);
|
|
219
|
+
const currentRows = slot.currentRows ?? [];
|
|
220
|
+
writes.regions.push(slot.slotId);
|
|
221
|
+
// 金额区块(费用构成):只认带「收费标准」列的那张表(另一张是服务内容清单)
|
|
222
|
+
if (columns.includes('收费标准')) {
|
|
223
|
+
const rows = [{
|
|
224
|
+
编号: '1',
|
|
225
|
+
内容: '系统维护费',
|
|
226
|
+
收费标准: ref('totals.charge_standard'),
|
|
227
|
+
金额: ref('totals.final_total'),
|
|
228
|
+
}];
|
|
229
|
+
planRegions.push({
|
|
230
|
+
slotId: slot.slotId,
|
|
231
|
+
rows,
|
|
232
|
+
subtotal: ref('totals.final_total'),
|
|
233
|
+
sumColumn: '金额',
|
|
234
|
+
});
|
|
235
|
+
standardTerms.amountRows = rows;
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
// 付款区块:沿用模板的标准付款行,只替换金额
|
|
239
|
+
const paymentRow = currentRows[0];
|
|
240
|
+
if (slot.kind === 'payment' && paymentRow) {
|
|
241
|
+
const rows = currentRows.map((row) => {
|
|
242
|
+
const record = {};
|
|
243
|
+
columns.forEach((name, index) => {
|
|
244
|
+
record[name] = /金额|费用/u.test(name) ? ref('totals.final_total') : text(row.values[index]);
|
|
245
|
+
});
|
|
246
|
+
return record;
|
|
247
|
+
});
|
|
248
|
+
planRegions.push({
|
|
249
|
+
slotId: slot.slotId,
|
|
250
|
+
rows,
|
|
251
|
+
subtotal: ref('totals.final_total'),
|
|
252
|
+
sumColumn: columns.find((name) => /金额|费用/u.test(name)) ?? '',
|
|
253
|
+
});
|
|
254
|
+
standardTerms.paymentRows = rows;
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
// 其它区块(服务内容等):照抄模板行,不改标准内容
|
|
258
|
+
const rows = currentRows.map((row) => {
|
|
259
|
+
const record = {};
|
|
260
|
+
columns.forEach((name, index) => {
|
|
261
|
+
record[name] = text(row.values[index]);
|
|
262
|
+
});
|
|
263
|
+
return record;
|
|
264
|
+
});
|
|
265
|
+
planRegions.push({ slotId: slot.slotId, rows });
|
|
266
|
+
standardTerms.otherRegionRows[slot.slotId] = rows;
|
|
267
|
+
}
|
|
268
|
+
const plan = {
|
|
269
|
+
slots: planSlots,
|
|
270
|
+
details: [],
|
|
271
|
+
regions: planRegions,
|
|
272
|
+
clauses: [],
|
|
273
|
+
unsupported: [],
|
|
274
|
+
totals: { grandTotal: ref('totals.final_total'), installments: [ref('totals.final_total')] },
|
|
275
|
+
};
|
|
276
|
+
return { plan, standardTerms, writes };
|
|
277
|
+
}
|
|
278
|
+
// ---------------------------------------------------------------- operation 装配
|
|
279
|
+
function findOperation(list, name) {
|
|
280
|
+
const operation = list.find((item) => item.name === name);
|
|
281
|
+
if (!operation)
|
|
282
|
+
throw contractValidationError('operation_unknown', `缺少 ${name},无法完成运维合同起草。`);
|
|
283
|
+
return operation;
|
|
284
|
+
}
|
|
285
|
+
/** 查范文库原始行(要拿附件 fileId,`contract.modeltext.list` 的投影里没有)。 */
|
|
286
|
+
async function queryModelTexts(context) {
|
|
287
|
+
const value = (await context.host.contractRequest({
|
|
288
|
+
method: 'POST',
|
|
289
|
+
path: LIST_DATAS_PATH,
|
|
290
|
+
headers: { ebbusinessid: MODEL_TEXT_LIST_ID },
|
|
291
|
+
query: { passid: MODEL_TEXT_OBJ_ID, cid: MODEL_TEXT_OBJ_ID },
|
|
292
|
+
body: {
|
|
293
|
+
current: 1,
|
|
294
|
+
requiredMatch: 1,
|
|
295
|
+
tableuid: '',
|
|
296
|
+
mapResult: '1',
|
|
297
|
+
recheckQuery: '1',
|
|
298
|
+
terminal: 'PC',
|
|
299
|
+
searchParamData: { type: 'and', searchType: '2', commonSearchFields: {}, groupFields: {} },
|
|
300
|
+
listId: MODEL_TEXT_LIST_ID,
|
|
301
|
+
isFollow: 0,
|
|
302
|
+
isShareToMe: 0,
|
|
303
|
+
filterCondition: {},
|
|
304
|
+
browser: 'Chrome',
|
|
305
|
+
},
|
|
306
|
+
}));
|
|
307
|
+
const data = isRecord(value?.data) ? value.data : {};
|
|
308
|
+
for (const candidate of [data.data, data.rows, data.records, data.list]) {
|
|
309
|
+
if (Array.isArray(candidate))
|
|
310
|
+
return candidate.filter(isRecord);
|
|
311
|
+
}
|
|
312
|
+
return [];
|
|
313
|
+
}
|
|
314
|
+
export const contractOpsDraftOperations = [
|
|
315
|
+
{
|
|
316
|
+
name: 'contract.ops.draft',
|
|
317
|
+
risk: 'read',
|
|
318
|
+
inputSchema: {
|
|
319
|
+
type: 'object',
|
|
320
|
+
additionalProperties: false,
|
|
321
|
+
properties: {
|
|
322
|
+
customer: { type: 'string', description: '客户全称(必填):用它查该客户的销售合同' },
|
|
323
|
+
salesContractNo: { type: 'string', description: '用户已选定的销售合同号;给了就跳过"多条让用户选"' },
|
|
324
|
+
percent: { type: 'number', description: '计费百分比,默认 10(即销售合同总额的 10%)' },
|
|
325
|
+
outDir: { type: 'string', description: '产物目录(必填):范文 docx、ops.json、plan.json、生成的合同 docx 都放这里' },
|
|
326
|
+
today: { type: 'string', description: '仅测试/复核用:以该日期(YYYY-MM-DD)作为签订与生效日期' },
|
|
327
|
+
flow: { type: 'string', description: '合同流程类型,默认「老客户增值」;四类之一' },
|
|
328
|
+
},
|
|
329
|
+
required: ['customer', 'outDir'],
|
|
330
|
+
},
|
|
331
|
+
async execute(input, context) {
|
|
332
|
+
const customer = requireNonEmptyString(input.customer, 'customer');
|
|
333
|
+
const outDir = resolve(requireNonEmptyString(input.outDir, 'outDir'));
|
|
334
|
+
const salesContractNo = text(input.salesContractNo);
|
|
335
|
+
const flow = text(input.flow) || '老客户增值';
|
|
336
|
+
const percentRaw = input.percent === undefined || input.percent === null || input.percent === ''
|
|
337
|
+
? DEFAULT_PERCENT
|
|
338
|
+
: Number(input.percent);
|
|
339
|
+
if (!Number.isFinite(percentRaw) || percentRaw <= 0 || percentRaw > 100) {
|
|
340
|
+
throw contractValidationError('percent_invalid', `percent 必须在 0~100 之间(收到 ${String(input.percent)})`);
|
|
341
|
+
}
|
|
342
|
+
const percent = round2(percentRaw);
|
|
343
|
+
const todayIso = /^\d{4}-\d{2}-\d{2}$/u.test(text(input.today))
|
|
344
|
+
? text(input.today)
|
|
345
|
+
: new Date().toISOString().slice(0, 10);
|
|
346
|
+
const base = {
|
|
347
|
+
customer,
|
|
348
|
+
percent,
|
|
349
|
+
ledger: { menu: '直销合同', listId: SALES_LIST_ID, objId: SALES_OBJ_ID, apiPrefix: API_PREFIX },
|
|
350
|
+
outDir,
|
|
351
|
+
flow,
|
|
352
|
+
warnings: [],
|
|
353
|
+
};
|
|
354
|
+
// ① 客户 → 销售合同
|
|
355
|
+
const lookup = await findOperation(contractPerformanceOperations, LIST_QUERY_OPERATION).execute({
|
|
356
|
+
apiPrefix: API_PREFIX,
|
|
357
|
+
listId: SALES_LIST_ID,
|
|
358
|
+
appId: APP_ID,
|
|
359
|
+
objId: SALES_OBJ_ID,
|
|
360
|
+
searchParamJson: buildSalesLookupSearchParam(customer, salesContractNo || undefined),
|
|
361
|
+
pageSize: 50,
|
|
362
|
+
maxPages: 1,
|
|
363
|
+
}, context);
|
|
364
|
+
const rows = (Array.isArray(lookup.data?.rows) ? lookup.data.rows : []).filter(isRecord);
|
|
365
|
+
const total = Number(lookup.data?.pagination?.total ?? rows.length);
|
|
366
|
+
const candidates = rows.slice(0, 20).map((row, index) => ({
|
|
367
|
+
index: index + 1,
|
|
368
|
+
contractNo: text(row.hth),
|
|
369
|
+
customerName: text(row.khmc),
|
|
370
|
+
progress: text(row.cljd),
|
|
371
|
+
amount: text(row.htzje),
|
|
372
|
+
contractType: text(row.htzl),
|
|
373
|
+
performanceMonth: text(row.htyjny),
|
|
374
|
+
signDate: text(row.qdrq),
|
|
375
|
+
}));
|
|
376
|
+
if (total === 0) {
|
|
377
|
+
return {
|
|
378
|
+
status: 'COMPLETE',
|
|
379
|
+
data: {
|
|
380
|
+
...base,
|
|
381
|
+
status: 'NO_SALES_CONTRACT',
|
|
382
|
+
salesContract: null,
|
|
383
|
+
candidates: [],
|
|
384
|
+
nextAction: 'report_fixed',
|
|
385
|
+
message: `客户「${customer}」没有可用的销售合同,无法按百分比起草运维合同。`,
|
|
386
|
+
},
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
if (total > 1 && !salesContractNo) {
|
|
390
|
+
return {
|
|
391
|
+
status: 'COMPLETE',
|
|
392
|
+
data: {
|
|
393
|
+
...base,
|
|
394
|
+
status: 'NEED_CONTRACT_CHOICE',
|
|
395
|
+
salesContract: null,
|
|
396
|
+
candidates,
|
|
397
|
+
counts: { total, returned: candidates.length },
|
|
398
|
+
nextAction: 'ask_user_to_choose',
|
|
399
|
+
nextCommand: `contract run contract.ops.draft --input '{"customer":"${customer}","salesContractNo":"<用户选中的合同号>","outDir":"${outDir.replace(/\\/gu, '\\\\')}"}'`,
|
|
400
|
+
message: `客户「${customer}」名下有 ${total} 份销售合同,请让用户自己选一份作为计费基数(不要自行取第一条);选定后带 salesContractNo 重跑本命令。`,
|
|
401
|
+
},
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
const salesRow = rows[0] ?? {};
|
|
405
|
+
const salesContract = {
|
|
406
|
+
contractNo: text(salesRow.hth),
|
|
407
|
+
customerName: text(salesRow.khmc),
|
|
408
|
+
progress: text(salesRow.cljd),
|
|
409
|
+
amount: text(salesRow.htzje),
|
|
410
|
+
contractType: text(salesRow.htzl),
|
|
411
|
+
signDate: text(salesRow.qdrq),
|
|
412
|
+
performanceMonth: text(salesRow.htyjny),
|
|
413
|
+
};
|
|
414
|
+
// ② 金额
|
|
415
|
+
const amount = computeMaintenanceAmount(salesRow.htzje, percent);
|
|
416
|
+
if (amount.zeroBase) {
|
|
417
|
+
base.warnings.push(`销售合同「${salesContract.contractNo}」的合同总金额为 0(处理进度=${salesContract.progress || '空'}),按 ${percent}% 算出的运维合同金额也是 0;请人工确认计费基数。`);
|
|
418
|
+
}
|
|
419
|
+
// ③ 范文模板
|
|
420
|
+
const modelTexts = await queryModelTexts(context);
|
|
421
|
+
const matched = rankTemplates(modelTexts);
|
|
422
|
+
const templateCandidates = (matched.length ? matched : modelTexts).map((row) => ({
|
|
423
|
+
templateId: text(row.id ?? row.rowKey ?? row.form_data_id),
|
|
424
|
+
fileName: text(row.file_name ?? row.fileName),
|
|
425
|
+
fileId: extractAttachmentFileId(row),
|
|
426
|
+
matched: matched.includes(row),
|
|
427
|
+
}));
|
|
428
|
+
if (!matched.length) {
|
|
429
|
+
return {
|
|
430
|
+
status: 'COMPLETE',
|
|
431
|
+
data: {
|
|
432
|
+
...base,
|
|
433
|
+
status: 'NEED_TEMPLATE_CHOICE',
|
|
434
|
+
salesContract,
|
|
435
|
+
amount,
|
|
436
|
+
template: null,
|
|
437
|
+
templateCandidates,
|
|
438
|
+
nextAction: 'ask_user_to_choose',
|
|
439
|
+
message: `范文库里没有名称含「${TEMPLATE_KEYWORDS.slice(0, 3).join(' / ')}」的模板,请让用户在返回的 ${templateCandidates.length} 篇范文里指定要用的那一篇。`,
|
|
440
|
+
},
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
const templateRow = matched[0];
|
|
444
|
+
const templateFileName = text(templateRow.file_name ?? templateRow.fileName);
|
|
445
|
+
const templateId = text(templateRow.id ?? templateRow.rowKey ?? templateRow.form_data_id);
|
|
446
|
+
const templateFileId = extractAttachmentFileId(templateRow);
|
|
447
|
+
if (!templateFileId) {
|
|
448
|
+
throw contractValidationError('template_file_id_missing', `范文「${templateFileName}」没有解析出附件 fileId,无法下载模板;请改用 contract.recommend.doc 拿 file_id 后重试。`);
|
|
449
|
+
}
|
|
450
|
+
// ④ 下载 + 扫描 + 出方案
|
|
451
|
+
const safeName = templateFileName.replace(/[\\/:*?"<>|]/gu, '_') || 'template.docx';
|
|
452
|
+
const templatePath = join(outDir, safeName);
|
|
453
|
+
await findOperation(contractFileDownloadOperations, FILE_DOWNLOAD_OPERATION).execute({ fileId: templateFileId, savePath: templatePath }, context);
|
|
454
|
+
const scan = await findOperation(contractDocxSlotsOperations, PLAN_SCAN_OPERATION).execute({ template: templatePath }, context);
|
|
455
|
+
const slots = (Array.isArray(scan.data?.slots) ? scan.data.slots : []).filter((slot) => isRecord(slot) && typeof slot.slotId === 'string');
|
|
456
|
+
mkdirSync(outDir, { recursive: true });
|
|
457
|
+
const opsJsonPath = join(outDir, 'ops.json');
|
|
458
|
+
writeFileSync(opsJsonPath, `${JSON.stringify({
|
|
459
|
+
customer,
|
|
460
|
+
salesContractNo: salesContract.contractNo,
|
|
461
|
+
percent,
|
|
462
|
+
totals: {
|
|
463
|
+
base_total: amount.base,
|
|
464
|
+
percent: amount.percent,
|
|
465
|
+
final_total: amount.maintenance,
|
|
466
|
+
charge_standard: amount.chargeStandard,
|
|
467
|
+
},
|
|
468
|
+
sections: [{ name: '系统维护费', amount: amount.maintenance }],
|
|
469
|
+
}, null, 2)}\n`, 'utf8');
|
|
470
|
+
const { plan, standardTerms, writes } = buildFillPlan({
|
|
471
|
+
slots,
|
|
472
|
+
customerName: customer,
|
|
473
|
+
signDateIso: todayIso,
|
|
474
|
+
opsJsonPath,
|
|
475
|
+
});
|
|
476
|
+
const planPath = join(outDir, 'plan.json');
|
|
477
|
+
writeFileSync(planPath, `${JSON.stringify(plan, null, 2)}\n`, 'utf8');
|
|
478
|
+
const outDocx = join(outDir, `${customer}协同办公系统(e-cology)软件年度维护合同.docx`);
|
|
479
|
+
const ourCompany = ourCompanyFromTemplate(templateFileName) ?? '上海泛微软件有限公司';
|
|
480
|
+
const submitArgs = {
|
|
481
|
+
contractPath: outDocx,
|
|
482
|
+
flow,
|
|
483
|
+
customerName: customer,
|
|
484
|
+
totalAmount: { $quote: `${opsJsonPath}#totals.final_total` },
|
|
485
|
+
contractTitle: `${customer}协同办公系统(e-cology)软件年度维护合同`,
|
|
486
|
+
ourCompany,
|
|
487
|
+
sections: [{ name: '系统维护费', amount: { $quote: `${opsJsonPath}#totals.final_total` } }],
|
|
488
|
+
tab: 'Extract',
|
|
489
|
+
};
|
|
490
|
+
base.warnings.push(`流程类型按「${flow}」;四类流程是业务判断,⛔ 未经用户确认不得直接调 submit(判不准先让用户选)。`);
|
|
491
|
+
return {
|
|
492
|
+
status: 'COMPLETE',
|
|
493
|
+
data: {
|
|
494
|
+
...base,
|
|
495
|
+
status: 'READY',
|
|
496
|
+
salesContract,
|
|
497
|
+
amount,
|
|
498
|
+
template: {
|
|
499
|
+
templateId,
|
|
500
|
+
fileName: templateFileName,
|
|
501
|
+
fileId: templateFileId,
|
|
502
|
+
localPath: templatePath,
|
|
503
|
+
ourCompany,
|
|
504
|
+
},
|
|
505
|
+
templateCandidates,
|
|
506
|
+
standardTerms,
|
|
507
|
+
plan,
|
|
508
|
+
artifacts: { opsJson: opsJsonPath, plan: planPath, outDocx },
|
|
509
|
+
writes,
|
|
510
|
+
nextCommands: [
|
|
511
|
+
{
|
|
512
|
+
operation: 'contract.docx.slots.fill',
|
|
513
|
+
args: { template: templatePath, out: outDocx, plan: planPath },
|
|
514
|
+
note: '生成合同文本;`validate.fails` 必须为空(含占位符残留 0)才算通过。',
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
operation: 'contract.quotescreen.submit',
|
|
518
|
+
args: submitArgs,
|
|
519
|
+
note: '上传 + 装配要素 + 存识别记录,返回 pageUrl;再用 open_web 打开 tab=Extract(打开页面 ≠ 流程已发起)。',
|
|
520
|
+
},
|
|
521
|
+
],
|
|
522
|
+
message: `已按销售合同「${salesContract.contractNo}」的合同总金额 ${amount.base} 元 × ${percent}% 算出运维合同金额 ${amount.maintenance} 元,并选中系统范文「${templateFileName}」;填充方案与产物已落盘,按 nextCommands 依次执行即可生成合同文本并发起审批流程。`,
|
|
523
|
+
},
|
|
524
|
+
};
|
|
525
|
+
},
|
|
526
|
+
},
|
|
527
|
+
];
|
|
@@ -68,3 +68,12 @@ export function clauseLibraryPageUrl(baseUrl) {
|
|
|
68
68
|
export function aiSettingPageUrl(baseUrl) {
|
|
69
69
|
return `${baseOf(baseUrl)}/sp/contract/business/ai-setting`;
|
|
70
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* ebdf 数据卡片页(单份合同详情):`/sp/ebdfpage/card/0/{objId}/{数据ID}`。
|
|
73
|
+
*
|
|
74
|
+
* `card` 后的 `0` 恒为 0(appId 位);`objId` 是表单对象 ID,`数据ID` 是该行返回的 `id`。
|
|
75
|
+
* 与其它 sp 地址一致:路径片段不做整体编码,调用方负责保证两个 ID 是裸 ID。
|
|
76
|
+
*/
|
|
77
|
+
export function dataCardPageUrl(baseUrl, objId, dataId) {
|
|
78
|
+
return `${baseOf(baseUrl)}/sp/ebdfpage/card/0/${objId}/${dataId}`;
|
|
79
|
+
}
|