weaver-work-cli 0.1.62 → 0.1.64
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/dist/chunks/{archive-S2VKZWQ3.js → archive-WUZKAEZ6.js} +5 -4
- package/dist/chunks/{archive-oa-HEDSIUUY.js → archive-oa-PN46RTI2.js} +5 -4
- package/dist/chunks/{asset-HYH4W357.js → asset-ZPC5VWZM.js} +5 -4
- package/dist/chunks/{asset-idle-N7REBNGL.js → asset-idle-DHGP3NYY.js} +5 -4
- package/dist/chunks/{attachment-content-VYYA75FR.js → attachment-content-JQDW3BIB.js} +3 -3
- package/dist/chunks/{blog-SLMZZICV.js → blog-JC47AIXK.js} +5 -4
- package/dist/chunks/{caizhilian-RV43KKBT.js → caizhilian-IKIHM77A.js} +5 -5
- package/dist/chunks/{calendar-DMVZ4OLY.js → calendar-GZTSJ57Y.js} +5 -4
- package/dist/chunks/{chunk-H6YOMI3U.js → chunk-26FCCU5O.js} +5 -3
- package/dist/chunks/{chunk-E5YD5JWR.js → chunk-3PCXBG4H.js} +1 -1
- package/dist/chunks/{chunk-UBRWONP4.js → chunk-3W5NMGDS.js} +2 -2
- package/dist/chunks/{chunk-DTCQFTHW.js → chunk-4AFWOGOV.js} +3 -3
- package/dist/chunks/{chunk-VNYOUAWV.js → chunk-5QQKLR6H.js} +11 -11
- package/dist/chunks/{chunk-BQYX2UX5.js → chunk-6T5X6YWX.js} +5 -3
- package/dist/chunks/{chunk-KXJA42EA.js → chunk-AFZTMYGC.js} +1 -1
- package/dist/chunks/{chunk-YI2YMW5N.js → chunk-AGSO3PIK.js} +2 -2
- package/dist/chunks/{chunk-IW7A2IQY.js → chunk-C4YQJFZV.js} +43 -15
- package/dist/chunks/{chunk-WIWDVETN.js → chunk-FDBAFANU.js} +76 -76
- package/dist/chunks/{chunk-NRYDJN4J.js → chunk-FJUOUSV3.js} +89 -8
- package/dist/chunks/{chunk-EGANE35F.js → chunk-HLT6B26P.js} +1 -1
- package/dist/chunks/{chunk-P6TXQK75.js → chunk-HWA2A25Y.js} +5 -3
- package/dist/chunks/{chunk-T2KVJFWJ.js → chunk-I3MOFD6Q.js} +4 -7
- package/dist/chunks/chunk-IN6NXQ26.js +680 -0
- package/dist/chunks/{chunk-UBGWIXU3.js → chunk-INVYKG4I.js} +140 -45
- package/dist/chunks/{chunk-QBDXJS2W.js → chunk-K7QKQRSL.js} +168 -62
- package/dist/chunks/{chunk-BIA2NKUG.js → chunk-KDFEHDIB.js} +5 -5
- package/dist/chunks/{chunk-ILALC2N6.js → chunk-KYDXWYFB.js} +1 -1
- package/dist/chunks/{chunk-V2LASYKO.js → chunk-Q6D6PSMH.js} +30 -24
- package/dist/chunks/{chunk-UQFPF4EX.js → chunk-RMOH2GMF.js} +2 -2
- package/dist/chunks/{chunk-VBFBMM7G.js → chunk-SCMHG23G.js} +387 -70
- package/dist/chunks/chunk-TJN4PIYO.js +47 -0
- package/dist/chunks/{chunk-JFAWZX53.js → chunk-UPVAQJKS.js} +282 -131
- package/dist/chunks/{chunk-KY3R42RS.js → chunk-VLY5RTVO.js} +5 -3
- package/dist/chunks/{chunk-TEZHIB6T.js → chunk-WSHIOSGM.js} +5 -3
- package/dist/chunks/{chunk-6XSSAUNW.js → chunk-XHSEK2VM.js} +48 -12
- package/dist/chunks/{chunk-XT77MP54.js → chunk-YTFNMQO4.js} +410 -24
- package/dist/chunks/{conflict-GFJRS6I7.js → conflict-UUC7AFUI.js} +2 -2
- package/dist/chunks/{contract-U3ZGNRWB.js → contract-INMS7SYQ.js} +3051 -4497
- package/dist/chunks/{cowork-EX7PKIDK.js → cowork-34CBYVQP.js} +5 -4
- package/dist/chunks/{create-flow-EJZD434E.js → create-flow-YOR4QTAJ.js} +18 -6
- package/dist/chunks/{data-FOODGAMF.js → data-QKWI5325.js} +14 -3
- package/dist/chunks/{ebuilder-form-I2EOKODG.js → ebuilder-form-ZONRROK4.js} +4 -4
- package/dist/chunks/{ehr-TE4RFNID.js → ehr-2CONM7R6.js} +244 -151
- package/dist/chunks/{employee-DR5Y64TI.js → employee-PGMY6NI6.js} +1 -1
- package/dist/chunks/{entry-mode-ZOLSXEGX.js → entry-mode-S2ENJ6GZ.js} +3 -3
- package/dist/chunks/{env-TID5NFR6.js → env-ZSAXU5PJ.js} +2 -2
- package/dist/chunks/{esb-7L6MHYLB.js → esb-FQASCY2H.js} +8 -8
- package/dist/chunks/{factory-OG7BPMH5.js → factory-N76QQA53.js} +1 -1
- package/dist/chunks/{fna-6V2ENR3Y.js → fna-FCLVIWAS.js} +5 -4
- package/dist/chunks/{group-chat-5DKPWIHL.js → group-chat-UM665WDZ.js} +3 -3
- package/dist/chunks/{host-VTPAWDZV.js → host-2ED2KC4X.js} +4 -4
- package/dist/chunks/{host-TJ5VVHM7.js → host-2UYZEY2V.js} +4 -4
- package/dist/chunks/{host-3DLYA54R.js → host-46NYKDQP.js} +4 -4
- package/dist/chunks/{host-OGBHL75G.js → host-7IPZKIM4.js} +4 -4
- package/dist/chunks/{host-GOJHHTPY.js → host-P7G22WNM.js} +4 -4
- package/dist/chunks/{host-ONZC6AE7.js → host-XLCBLNJD.js} +4 -4
- package/dist/chunks/{hrm-2N7NFQDZ.js → hrm-XKL27NX2.js} +6 -6
- package/dist/chunks/{im-XCH47ZBN.js → im-NDYIMASG.js} +4 -4
- package/dist/chunks/{invoice-5KJ7T774.js → invoice-MOGNB6HN.js} +4 -4
- package/dist/chunks/{jiuchuanhui-PL6DRPBM.js → jiuchuanhui-3T5X7SB7.js} +5 -4
- package/dist/chunks/{lazy-dispatch-UATEN7H7.js → lazy-dispatch-4WOIL3ZQ.js} +5 -5
- package/dist/chunks/{mail-Q7Z4CQ4D.js → mail-P7VMUKQW.js} +5 -4
- package/dist/chunks/{meeting-5E3BNARL.js → meeting-MMTYDHXA.js} +16 -15
- package/dist/chunks/{minute-doc-NXRE5C77.js → minute-doc-LCSBWGJ3.js} +4 -4
- package/dist/chunks/{okr-3O3XNYOK.js → okr-VZXRQGS4.js} +5 -4
- package/dist/chunks/{operations-EZWG72FH.js → operations-MI2BSKZX.js} +5 -5
- package/dist/chunks/{performance-Y7CPNSOR.js → performance-OPEQNW7Y.js} +873 -17
- package/dist/chunks/{plan-BLGPZF5M.js → plan-TJAS4N5X.js} +5 -4
- package/dist/chunks/{project-6MZMLJMP.js → project-CYBGU6K6.js} +5 -4
- package/dist/chunks/{reception-F2VT2X52.js → reception-3FT2F66K.js} +3 -3
- package/dist/chunks/{recruit-stage-4ETIBMIW.js → recruit-stage-WPGB5BDJ.js} +654 -336
- package/dist/chunks/{registry-3FYSWV3U.js → registry-BAWCWV4D.js} +3 -3
- package/dist/chunks/{registry-I4DVPDMU.js → registry-FNI5E76J.js} +12 -12
- package/dist/chunks/{registry-3UGIWH53.js → registry-JMNOXRST.js} +2 -2
- package/dist/chunks/{registry-7RS74TCK.js → registry-QRMXRSCT.js} +5 -5
- package/dist/chunks/{room-recommend-GWCVKCXW.js → room-recommend-I7QQRHEL.js} +4 -4
- package/dist/chunks/{schedule-6AN63MJQ.js → schedule-3P7EWGNZ.js} +4 -4
- package/dist/chunks/{smart-extract-SR4SJJKN.js → smart-extract-FOBSVNYW.js} +3 -3
- package/dist/chunks/{workflow-KF7FA2UQ.js → workflow-U2KKTVQY.js} +10 -7
- package/dist/index.js +34 -34
- package/dist/internal/e10/auth/commands.js +203 -44
- package/dist/internal/e10/auth/xiaoe.js +6 -2
- package/dist/internal/e10/auth-recovery.js +28 -2
- package/dist/internal/e10/request-runtime.js +15 -3
- package/dist/internal/e10/request-trace.js +65 -0
- package/dist/shortcuts/contract/data/metric-catalog.js +149 -0
- package/dist/shortcuts/contract/error-actions.js +112 -0
- package/dist/shortcuts/contract/errors.js +9 -1
- package/dist/shortcuts/contract/index.js +14 -39
- package/dist/shortcuts/contract/manifest.js +130 -274
- package/dist/shortcuts/contract/operations/compare-report.js +437 -0
- package/dist/shortcuts/contract/operations/compare.js +2 -0
- package/dist/shortcuts/contract/operations/docx-slots.js +112 -5
- package/dist/shortcuts/contract/operations/docx-verify.js +2 -70
- package/dist/shortcuts/contract/operations/elements-build.js +82 -56
- package/dist/shortcuts/contract/operations/elements-spec.js +140 -3
- package/dist/shortcuts/contract/operations/first-screen.js +96 -207
- package/dist/shortcuts/contract/operations/flow.js +19 -1
- package/dist/shortcuts/contract/operations/{card-ebdf-list.js → ledger-card.js} +123 -27
- package/dist/shortcuts/contract/operations/ledger.js +343 -1
- package/dist/shortcuts/contract/operations/metrics.js +93 -0
- package/dist/shortcuts/contract/operations/modeltext.js +3 -3
- package/dist/shortcuts/contract/operations/money.js +90 -0
- package/dist/shortcuts/contract/operations/page.js +8 -4
- package/dist/shortcuts/contract/operations/performance.js +53 -0
- package/dist/shortcuts/contract/operations/placeholder-scan.js +104 -0
- package/dist/shortcuts/contract/operations/quote-recognize.js +326 -0
- package/dist/shortcuts/contract/operations/quote-ref.js +179 -0
- package/dist/shortcuts/contract/operations/quote-submit.js +281 -0
- package/dist/shortcuts/contract/operations/quote.js +66 -12
- package/dist/shortcuts/contract/operations/recommend.js +42 -1
- package/dist/shortcuts/contract/operations/registry.js +16 -23
- package/dist/shortcuts/contract/operations/{card-risk-report.js → review-report.js} +24 -114
- package/dist/shortcuts/contract/operations/review.js +33 -167
- package/dist/shortcuts/contract/operations/save-recognize.js +173 -43
- package/dist/shortcuts/contract/operations/solutions-spec.js +79 -0
- package/dist/shortcuts/contract/operations/triage.js +68 -15
- package/dist/shortcuts/contract/operations/{template.js → type-clause-read.js} +10 -25
- package/dist/shortcuts/contract/operations/upload.js +17 -11
- package/dist/shortcuts/contract/prewarm-cache.js +6 -2
- package/dist/shortcuts/contract/prewarm.js +33 -23
- package/dist/shortcuts/contract/recommend-cache.js +191 -0
- package/dist/shortcuts/data/operations/shared.js +14 -1
- package/dist/shortcuts/ehr/operations/recruit-interview-overview.js +85 -62
- package/dist/shortcuts/ehr/operations/recruit-position.js +21 -13
- package/dist/shortcuts/ehr/operations/recruit-short-cache.js +59 -0
- package/dist/shortcuts/ehr/operations/recruit-tag.js +17 -11
- package/dist/shortcuts/ehr/operations/recruit-write.js +118 -70
- package/dist/shortcuts/ehr/operations/recruit.js +338 -121
- package/dist/shortcuts/hrm/operations/employee.js +64 -17
- package/dist/shortcuts/hrm/operations/resolve.js +419 -369
- package/dist/shortcuts/im/host.js +38 -22
- package/dist/shortcuts/meeting/operations/eb/conflict.js +60 -2
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +138 -15
- package/dist/shortcuts/meeting/operations/eb/create-form-link.js +380 -0
- package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +1 -3
- package/dist/shortcuts/performance/flow-utils.js +363 -0
- package/dist/shortcuts/performance/manifest.js +2 -2
- package/dist/shortcuts/performance/operations/flow-detail.js +85 -0
- package/dist/shortcuts/performance/operations/flow-list.js +213 -0
- package/dist/shortcuts/performance/operations/flow-score.js +241 -0
- package/dist/shortcuts/performance/operations/registry.js +6 -0
- package/dist/shortcuts/recruit-stage/batch-store.js +44 -0
- package/dist/shortcuts/recruit-stage/context.js +75 -9
- package/dist/shortcuts/recruit-stage/manifest.js +1 -1
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +33 -22
- package/dist/shortcuts/recruit-stage/operations/list.js +187 -37
- package/dist/shortcuts/recruit-stage/operations/registry.js +2 -0
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +231 -313
- package/dist/shortcuts/recruit-stage/operations/search.js +5 -5
- package/dist/shortcuts/recruit-stage/operations/tag.js +286 -0
- package/dist/shortcuts/workflow/endpoints.js +2 -0
- package/dist/shortcuts/workflow/operations/form.js +12 -15
- package/dist/shortcuts/workflow/operations/read.js +8 -8
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoListRows.js +3 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +7 -6
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +4 -3
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +1 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +33 -6
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.prepareQuery.js +153 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/workflowClarification.js +232 -0
- package/dist/shortcuts/workflow/operations.js +5 -0
- package/docs/contract.md +2 -2
- package/docs/e10-auth.md +55 -2
- package/docs/ehr.md +1 -1
- package/package.json +1 -1
- package/skills/weaver-e10-hrm/SKILL.md +3 -3
- package/skills/weaver-e10-hrm/references/employee.md +13 -2
- package/skills/weaver-e10-jinchengda/SKILL.md +283 -345
- package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +7 -14
- package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +21 -12
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +126 -202
- package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +13 -5
- package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +28 -20
- package/skills/weaver-e10-jinchengda/references/contract-clause-recommender.md +12 -17
- package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +7 -13
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +47 -16
- package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +10 -18
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +19 -18
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +114 -61
- package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +8 -2
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +78 -112
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +67 -333
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +18 -15
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +80 -84
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +38 -34
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +132 -47
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +108 -217
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +14 -20
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +13 -7
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +86 -46
- package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +12 -10
- package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +22 -14
- package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +18 -18
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +27 -26
- package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +252 -0
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +15 -23
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +290 -104
- package/skills/weaver-e10-jinchengda/references/contract-request-status.md +5 -12
- package/skills/weaver-e10-jinchengda/references/contract-request-write.md +12 -18
- package/skills/weaver-e10-jinchengda/references/contract-signing-subjects.md +11 -17
- package/skills/weaver-e10-jinchengda/references/contract-subject-create.md +5 -11
- package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +56 -7
- package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +12 -12
- package/skills/weaver-e10-jinchengda/references/contract-workflow-discovery.md +10 -16
- package/skills/weaver-e10-jinchengda/references/orchestration.md +33 -35
- package/skills/weaver-e10-jucailin/SKILL.md +6 -7
- package/skills/weaver-e10-jucailin/agents/openai.yaml +52 -0
- package/skills/weaver-e10-jucailin/references/recruit-interview-overview.md +8 -6
- package/skills/weaver-e10-jucailin/references/recruit-read.md +4 -0
- package/skills/weaver-e10-jucailin/references/recruit-screening-to-interview-sop.md +2 -2
- package/skills/weaver-e10-jucailin/references/recruit-write.md +4 -4
- package/skills/weaver-e10-meeting/SKILL.md +87 -534
- package/skills/weaver-e10-meeting/references/commands-table.md +61 -0
- package/skills/weaver-e10-meeting/references/create-commands.md +136 -0
- package/skills/weaver-e10-meeting/references/create-flow.md +9 -7
- package/skills/weaver-e10-meeting/references/create-guardrails.md +23 -17
- package/skills/weaver-e10-meeting/references/custom-fields.md +40 -0
- package/skills/weaver-e10-meeting/references/eb-contracts.md +60 -0
- package/skills/weaver-e10-meeting/references/invitation.md +69 -0
- package/skills/weaver-e10-meeting/references/meeting-eb.md +26 -26
- package/skills/weaver-e10-meeting/references/meeting-invitation.md +2 -2
- package/skills/weaver-e10-meeting/references/meeting-minute-file.md +2 -2
- package/skills/weaver-e10-meeting/references/meeting-verification.md +1 -1
- package/skills/weaver-e10-meeting/references/minutes-pipeline.md +119 -0
- package/skills/weaver-e10-meeting/references/pitfalls.md +1 -1
- package/skills/weaver-e10-meeting/references/room-recommend.md +88 -0
- package/skills/weaver-e10-performance/SKILL.md +45 -5
- package/skills/weaver-e10-performance/agents/openai.yaml +26 -2
- package/skills/weaver-e10-performance/references/flow-api.md +128 -0
- package/skills/weaver-e10-performance/references/flow-assess.md +149 -0
- package/skills/weaver-e10-recruit-stage/SKILL.md +317 -266
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +22 -27
- package/skills/weaver-e10-recruit-stage/references/env-ziyong.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +30 -27
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +2 -6
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +12 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +2 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +23 -19
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-template.md +3 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +18 -16
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +25 -23
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +10 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +11 -11
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +150 -85
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +14 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +173 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-taxonomy.json +76 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +3 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +2 -2
- package/skills/weaver-e10-workflow/SKILL.md +49 -32
- package/skills/weaver-e10-workflow/references/todo-dialogue.md +67 -34
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +65 -51
- package/skills/weaver-e10-workflow/references/workflow-agent-entry.md +18 -11
- package/skills/weaver-e10-workflow/references/workflow-create.md +2 -2
- package/skills/weaver-e10-workflow/references/workflow-memory.md +19 -37
- package/skills/weaver-e10-workflow/references/workflow-query.md +25 -22
- package/skills/weaver-e10-workflow/references/workflow-view.md +1 -1
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +318 -110
- package/skills/weaver-e10-yimiaoban/SKILL.md +17 -14
- package/skills/weaver-e10-yimiaoban/references/person.md +1 -1
- package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +1 -1
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +9 -9
- package/dist/chunks/chunk-6QYNE6HE.js +0 -658
- package/dist/chunks/chunk-SHYQUBY3.js +0 -48
- package/dist/shortcuts/contract/operations/card-action.js +0 -1266
- package/dist/shortcuts/contract/operations/card-plan.js +0 -393
- package/dist/shortcuts/contract/operations/card.js +0 -232
- package/dist/shortcuts/contract/operations/compare-screen.js +0 -378
- package/dist/shortcuts/contract/operations/quote-to-contract.js +0 -495
- package/dist/shortcuts/contract/operations/quotescreen.js +0 -529
- package/dist/shortcuts/contract/operations/summary-validate.js +0 -293
- package/dist/shortcuts/contract/operations/summary.js +0 -187
- package/dist/shortcuts/ehr/recruit-stage/batch-store.js +0 -78
- package/dist/shortcuts/ehr/recruit-stage/context.js +0 -231
- package/dist/shortcuts/ehr/recruit-stage/continuation.js +0 -74
- package/dist/shortcuts/ehr/recruit-stage/errors.js +0 -65
- package/dist/shortcuts/ehr/recruit-stage/fs-scan.js +0 -165
- package/dist/shortcuts/ehr/recruit-stage/host.js +0 -109
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +0 -1065
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-feedback.js +0 -295
- package/dist/shortcuts/ehr/recruit-stage/operations/jd-create.js +0 -961
- package/dist/shortcuts/ehr/recruit-stage/operations/list.js +0 -431
- package/dist/shortcuts/ehr/recruit-stage/operations/registry.js +0 -50
- package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +0 -1655
- package/dist/shortcuts/ehr/recruit-stage/operations/search.js +0 -158
- package/dist/shortcuts/ehr/recruit-stage/operations/types.js +0 -34
- package/dist/shortcuts/ehr/recruit-stage/runtime.js +0 -31
- package/dist/shortcuts/ehr/recruit-stage/school-tiers.json +0 -318
- package/dist/shortcuts/ehr/recruit-stage/shared.js +0 -887
- package/skills/weaver-e10-jinchengda/references/contract-action-card-template.html +0 -22
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +0 -554
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +0 -279
- package/skills/weaver-e10-jinchengda/references/contract-card-render-internals.md +0 -483
- package/skills/weaver-e10-jinchengda/references/contract-template-selector.md +0 -46
- package/skills/weaver-e10-recruit-stage/lib/recruit-resume-photo.py +0 -194
|
@@ -2,9 +2,10 @@ import { mkdirSync, writeFileSync } from 'node:fs';
|
|
|
2
2
|
import { dirname, resolve } from 'node:path';
|
|
3
3
|
import { contractValidationError } from '../errors.js';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* 业绩核算六菜单「台账页卡 / ebdf 列表卡」组件卡生成器(本地,零依赖):`contract.ledger.card`。
|
|
6
6
|
*
|
|
7
|
-
* 迁移自 `scripts/render_ebdf_list_card.py`(2026-11-12
|
|
7
|
+
* 迁移自 `scripts/render_ebdf_list_card.py`(2026-11-12 第二批);
|
|
8
|
+
* 2026-11-19 由 `contract.card.ebdf-list` 改名而来(`card.*` 命名空间随行为卡片废止一并清空)。
|
|
8
9
|
*
|
|
9
10
|
* 为什么固化:这六类列表以前用外部浏览器打开,用户拿不到 E10 列表组件;
|
|
10
11
|
* 改造成 ebdf 列表页组件卡后,pageId / 组件名极易抄错,因此全部固化,
|
|
@@ -14,7 +15,7 @@ import { contractValidationError } from '../errors.js';
|
|
|
14
15
|
* 12 项自检全部与 Python 版一致。
|
|
15
16
|
*/
|
|
16
17
|
/** 菜单 → pageId(2026-11-10 用户确认,勿改)。用 Map 保持插入顺序,子串匹配依赖该顺序。 */
|
|
17
|
-
const MENU_PAGES = new Map([
|
|
18
|
+
export const MENU_PAGES = new Map([
|
|
18
19
|
['直销合同', '881124906081886244'],
|
|
19
20
|
['直销业绩', '846297265322576586'],
|
|
20
21
|
['合同收款', '846297265322576589'],
|
|
@@ -22,7 +23,7 @@ const MENU_PAGES = new Map([
|
|
|
22
23
|
['渠道订单', '881210951456350225'],
|
|
23
24
|
['渠道订单-商务', '881211329321197671'],
|
|
24
25
|
]);
|
|
25
|
-
const ALIASES = new Map([
|
|
26
|
+
export const ALIASES = new Map([
|
|
26
27
|
['e-cology合同', '直销合同'],
|
|
27
28
|
['e-cology 合同', '直销合同'],
|
|
28
29
|
['合同数据', '直销合同'],
|
|
@@ -52,14 +53,19 @@ const ALIASES = new Map([
|
|
|
52
53
|
* 不在本表内,继续用 ebdf 列表卡打开。渠道订单同时含 e-office 与 e-teams 产品数据,
|
|
53
54
|
* 默认落 e-teams 标签(用户确认),用户可在页面自行切换。
|
|
54
55
|
*/
|
|
55
|
-
const LEDGER_VIEW_KEYS = new Map([
|
|
56
|
+
export const LEDGER_VIEW_KEYS = new Map([
|
|
56
57
|
['直销合同', 'ecology'],
|
|
57
58
|
['直销业绩', 'directPerf'],
|
|
58
59
|
['渠道订单', 'etOrder'],
|
|
59
60
|
['渠道订单-商务', 'agree'],
|
|
60
61
|
]);
|
|
61
|
-
/**
|
|
62
|
-
|
|
62
|
+
/**
|
|
63
|
+
* 台账页 filters 可用键与值类型(来源:组件说明「默认筛选」)。
|
|
64
|
+
*
|
|
65
|
+
* 导出供 `contract.ledger.route` 复用:入口路由判定「条件能否预置到卡片」时
|
|
66
|
+
* 必须读这份白名单,**不得另抄一份**,否则卡片与判定会各说一套。
|
|
67
|
+
*/
|
|
68
|
+
export const LEDGER_FILTER_KINDS = {
|
|
63
69
|
ecology: {
|
|
64
70
|
khmc: 'text',
|
|
65
71
|
hth: 'text',
|
|
@@ -110,6 +116,44 @@ const DATE_TEXT = /^\d{4}-\d{2}-\d{2}$/u;
|
|
|
110
116
|
const AMOUNT_TEXT = /^-?\d+(\.\d+)?$/u;
|
|
111
117
|
/** 人员 ID:E10 人员主键是纯数字长串(如 732851919151005700);姓名一律视为非法值。 */
|
|
112
118
|
const PERSON_ID_TEXT = /^\d{6,32}$/u;
|
|
119
|
+
/**
|
|
120
|
+
* 归一化人员浏览框筛选值 → [{ id, name }]。
|
|
121
|
+
*
|
|
122
|
+
* 人员浏览框必须传数组对象,只传人员 ID 字符串时页面回显会丢失姓名。
|
|
123
|
+
* 为兼容旧调用,仍接受单个 { id, name } 对象;纯 ID 字符串按 name 为空处理。
|
|
124
|
+
*/
|
|
125
|
+
function normalizePersonFilterValue(key, raw) {
|
|
126
|
+
if (raw === null || raw === undefined || raw === '')
|
|
127
|
+
return [];
|
|
128
|
+
const list = Array.isArray(raw) ? raw : [raw];
|
|
129
|
+
const out = [];
|
|
130
|
+
for (const item of list) {
|
|
131
|
+
if (item === null || item === undefined || item === '')
|
|
132
|
+
continue;
|
|
133
|
+
if (typeof item === 'string') {
|
|
134
|
+
const text = item.trim();
|
|
135
|
+
if (!PERSON_ID_TEXT.test(text)) {
|
|
136
|
+
throw contractValidationError('ledger_filter_person_invalid', `${key} 的人员应为 [{ id, name }],收到 ${pyReprText(text)};可先用 hrm.employee.query 取人员 ID 与姓名。`);
|
|
137
|
+
}
|
|
138
|
+
out.push({ id: text, name: '' });
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
if (typeof item !== 'object' || Array.isArray(item)) {
|
|
142
|
+
throw contractValidationError('ledger_filter_person_invalid', `${key} 的人员应为 [{ id, name }] 数组,元素需为对象,收到 ${pyReprText(pyStr(item))}。`);
|
|
143
|
+
}
|
|
144
|
+
const record = item;
|
|
145
|
+
const id = String(record.id ?? '').trim();
|
|
146
|
+
const name = String(record.name ?? '').trim();
|
|
147
|
+
if (!PERSON_ID_TEXT.test(id)) {
|
|
148
|
+
throw contractValidationError('ledger_filter_person_invalid', `${key} 的人员元素缺少合法 id(纯数字人员主键),收到 ${pyReprText(id)};可先用 hrm.employee.query 取 id。`);
|
|
149
|
+
}
|
|
150
|
+
if (!name) {
|
|
151
|
+
throw contractValidationError('ledger_filter_person_invalid', `${key} 的人员元素缺少 name(人员姓名),请按 { id, name } 两项传入。`);
|
|
152
|
+
}
|
|
153
|
+
out.push({ id, name });
|
|
154
|
+
}
|
|
155
|
+
return out;
|
|
156
|
+
}
|
|
113
157
|
const FIELD_KEY = /^field_\d+$/u;
|
|
114
158
|
const PAGE_ID = /^\d{6,}$/u;
|
|
115
159
|
const ORIGIN = /^https?:\/\/[^/]+$/u;
|
|
@@ -182,9 +226,63 @@ function cleanOrigin(raw) {
|
|
|
182
226
|
}
|
|
183
227
|
return origin;
|
|
184
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* 解析卡片所需 origin。
|
|
231
|
+
*
|
|
232
|
+
* 2026-11-19:显式入参缺省时回落到**会话 baseUrl 的 scheme+host**。
|
|
233
|
+
* 事故背景:文档一直写 `"origin":"{baseUrl}"`,而 CLI 拒收这个占位符
|
|
234
|
+
* (`origin_placeholder`),且全库没有替换器——模型拿不到业务域名时,
|
|
235
|
+
* 会转而去「接管浏览器查页面」。这里按 `contract.modeltext.list` 的既有模式
|
|
236
|
+
* (`session.baseUrl` 拼接)自行解析,去掉模型对 host 的依赖。
|
|
237
|
+
*
|
|
238
|
+
* 显式传了非法 origin 仍然报错,不做静默兜底。
|
|
239
|
+
*/
|
|
240
|
+
async function resolveOrigin(raw, context) {
|
|
241
|
+
const provided = stripOrEmpty(raw);
|
|
242
|
+
if (provided)
|
|
243
|
+
return cleanOrigin(provided);
|
|
244
|
+
const session = await context.host.getSession();
|
|
245
|
+
const base = stripOrEmpty(session?.baseUrl);
|
|
246
|
+
if (!base) {
|
|
247
|
+
throw contractValidationError('origin_unavailable', '缺少 origin,且当前会话没有 baseUrl 可回落;请显式传 scheme+host(形如 https://your-e10.example.com)');
|
|
248
|
+
}
|
|
249
|
+
// 会话 baseUrl 可能带路径(如 https://host/sp/contract),取 scheme+host 再交给 cleanOrigin 校验。
|
|
250
|
+
let normalized = base;
|
|
251
|
+
try {
|
|
252
|
+
const parsed = new URL(base);
|
|
253
|
+
normalized = `${parsed.protocol}//${parsed.host}`;
|
|
254
|
+
}
|
|
255
|
+
catch {
|
|
256
|
+
// 不是完整 URL 时原样交给 cleanOrigin 报错,不静默兜底
|
|
257
|
+
}
|
|
258
|
+
return cleanOrigin(normalized);
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* 读取 `comParamsJson` 入参文本——**只接受 JSON 字符串**(2026-11-20 定稿)。
|
|
262
|
+
*
|
|
263
|
+
* 事故:此前两个解析函数都写 `typeof rawJson === 'string' && rawJson.trim() ? rawJson : ''`,
|
|
264
|
+
* 于是入参传对象 / 数组时被当成「没传」,条件被**静默丢弃**,接口还返回 `ok=true`、
|
|
265
|
+
* `filters` 为空——卡片打开后没有任何筛选,且全程没有任何报错,排查成本极高。
|
|
266
|
+
* 现在非字符串一律报 `com_params_invalid`,绝不静默置空;要传结构化条件请先 `JSON.stringify`。
|
|
267
|
+
*/
|
|
268
|
+
function requireComParamsJsonText(rawJson) {
|
|
269
|
+
if (rawJson === null || rawJson === undefined || rawJson === '')
|
|
270
|
+
return '';
|
|
271
|
+
if (typeof rawJson === 'string')
|
|
272
|
+
return rawJson.trim();
|
|
273
|
+
if (Array.isArray(rawJson)) {
|
|
274
|
+
throw contractValidationError('com_params_invalid', `comParamsJson 必须是 JSON 字符串,收到数组 ${pyReprText(rawJson)};`
|
|
275
|
+
+ '请先 JSON.stringify 成字符串再传(按 key=value 传请改用 comParamPairs)。');
|
|
276
|
+
}
|
|
277
|
+
if (typeof rawJson === 'object') {
|
|
278
|
+
throw contractValidationError('com_params_invalid', `comParamsJson 必须是 JSON 字符串,收到对象 ${pyStr(rawJson)};`
|
|
279
|
+
+ '请先 JSON.stringify 成字符串再传,直接传对象会被丢弃筛选条件。');
|
|
280
|
+
}
|
|
281
|
+
throw contractValidationError('com_params_invalid', `comParamsJson 必须是 JSON 字符串,收到 ${pyReprText(rawJson)}。`);
|
|
282
|
+
}
|
|
185
283
|
function parseComParams(pairs, rawJson) {
|
|
186
284
|
const pairList = Array.isArray(pairs) ? pairs : [];
|
|
187
|
-
const jsonText =
|
|
285
|
+
const jsonText = requireComParamsJsonText(rawJson);
|
|
188
286
|
if (pairList.length && jsonText) {
|
|
189
287
|
throw contractValidationError('com_params_conflict', 'comParamPairs 与 comParamsJson 只能二选一');
|
|
190
288
|
}
|
|
@@ -274,7 +372,7 @@ function buildCard(pageId, origin, title, callId, comParams) {
|
|
|
274
372
|
function parseLedgerFilters(pairs, rawJson, viewKey) {
|
|
275
373
|
const allowed = LEDGER_FILTER_KINDS[viewKey] ?? {};
|
|
276
374
|
const pairList = Array.isArray(pairs) ? pairs : [];
|
|
277
|
-
const jsonText =
|
|
375
|
+
const jsonText = requireComParamsJsonText(rawJson);
|
|
278
376
|
if (pairList.length && jsonText) {
|
|
279
377
|
throw contractValidationError('com_params_conflict', 'comParamPairs 与 comParamsJson 只能二选一');
|
|
280
378
|
}
|
|
@@ -326,17 +424,7 @@ function parseLedgerFilters(pairs, rawJson, viewKey) {
|
|
|
326
424
|
continue;
|
|
327
425
|
}
|
|
328
426
|
if (kind === 'person') {
|
|
329
|
-
|
|
330
|
-
throw contractValidationError('ledger_filter_person_invalid', `${key} 只接受单个人员 ID 字符串(如 "732851919151005700"),不要传数组;多人请分别出卡或改走取数链路。`);
|
|
331
|
-
}
|
|
332
|
-
if (raw !== null && typeof raw === 'object') {
|
|
333
|
-
throw contractValidationError('ledger_filter_person_invalid', `${key} 需要人员 ID 字符串,不能传对象。`);
|
|
334
|
-
}
|
|
335
|
-
const personId = raw === null || raw === undefined ? '' : typeof raw === 'string' ? raw.trim() : pyStr(raw);
|
|
336
|
-
if (personId && !PERSON_ID_TEXT.test(personId)) {
|
|
337
|
-
throw contractValidationError('ledger_filter_person_invalid', `${key} 需要纯数字人员 ID,收到 ${pyReprText(personId)};传姓名页面不生效,可先用 hrm.employee.query 取 id。`);
|
|
338
|
-
}
|
|
339
|
-
out[key] = personId;
|
|
427
|
+
out[key] = normalizePersonFilterValue(key, raw);
|
|
340
428
|
continue;
|
|
341
429
|
}
|
|
342
430
|
if (Array.isArray(raw) || (raw !== null && typeof raw === 'object')) {
|
|
@@ -435,8 +523,16 @@ function selfCheckLedger(card, viewKey) {
|
|
|
435
523
|
}
|
|
436
524
|
}
|
|
437
525
|
else if (kind === 'person') {
|
|
438
|
-
if (
|
|
439
|
-
bad.push(`filters
|
|
526
|
+
if (!Array.isArray(value)) {
|
|
527
|
+
bad.push(`filters 人员键必须是 [{ id, name }] 数组:${key}`);
|
|
528
|
+
}
|
|
529
|
+
else if (value.some((item) => !item
|
|
530
|
+
|| typeof item !== 'object'
|
|
531
|
+
|| Array.isArray(item)
|
|
532
|
+
|| typeof item.id !== 'string'
|
|
533
|
+
|| !PERSON_ID_TEXT.test(String(item.id))
|
|
534
|
+
|| typeof item.name !== 'string')) {
|
|
535
|
+
bad.push(`filters 人员键元素必须是含 id(人员主键)与 name(姓名的对象):${key}`);
|
|
440
536
|
}
|
|
441
537
|
}
|
|
442
538
|
else if (typeof value !== 'string') {
|
|
@@ -506,9 +602,9 @@ function selfCheck(card, pageId) {
|
|
|
506
602
|
* 注意:returned `card` 可直接作为 `<browsertool>` 内的 JSON 使用;
|
|
507
603
|
* `selfCheck` 非空表示结构不达标,禁止交付。
|
|
508
604
|
*/
|
|
509
|
-
export const
|
|
510
|
-
name: 'contract.card
|
|
511
|
-
async execute(input) {
|
|
605
|
+
export const contractLedgerCardOperation = {
|
|
606
|
+
name: 'contract.ledger.card',
|
|
607
|
+
async execute(input, context) {
|
|
512
608
|
const rawPageId = stripOrEmpty(input.pageId);
|
|
513
609
|
let menu;
|
|
514
610
|
let pageId;
|
|
@@ -525,7 +621,7 @@ export const contractCardEbdfListOperation = {
|
|
|
525
621
|
menu = resolved.menu;
|
|
526
622
|
pageId = resolved.pageId;
|
|
527
623
|
}
|
|
528
|
-
const origin =
|
|
624
|
+
const origin = await resolveOrigin(input.origin, context);
|
|
529
625
|
const viewKey = LEDGER_VIEW_KEYS.get(menu);
|
|
530
626
|
const titleInput = stripOrEmpty(input.title);
|
|
531
627
|
const title = titleInput || menu;
|
|
@@ -590,4 +686,4 @@ export const contractCardEbdfListOperation = {
|
|
|
590
686
|
};
|
|
591
687
|
},
|
|
592
688
|
};
|
|
593
|
-
export const
|
|
689
|
+
export const contractLedgerCardOperations = [contractLedgerCardOperation];
|
|
@@ -2,6 +2,7 @@ import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
|
2
2
|
import { homedir } from 'node:os';
|
|
3
3
|
import { basename, join } from 'node:path';
|
|
4
4
|
import { contractValidationError } from '../errors.js';
|
|
5
|
+
import { ALIASES, LEDGER_VIEW_KEYS, MENU_PAGES, contractLedgerCardOperation } from './ledger-card.js';
|
|
5
6
|
/**
|
|
6
7
|
* 台账数据处理的本地 operation(2026-11-13 从 scripts/ledger_aggregate.py 与
|
|
7
8
|
* scripts/ledger_guard.py 迁移,遵守「能力下沉 CLI」规范)。
|
|
@@ -165,7 +166,7 @@ function buildFallbackCard(menu, comParams, origin) {
|
|
|
165
166
|
variant: info.variant,
|
|
166
167
|
viewKey: info.viewKey,
|
|
167
168
|
pageId: info.pageId,
|
|
168
|
-
command: 'weaver-work-cli --json contract run contract.card
|
|
169
|
+
command: 'weaver-work-cli --json contract run contract.ledger.card --input <args.json>',
|
|
169
170
|
args,
|
|
170
171
|
note,
|
|
171
172
|
usage: '把 args 写入 UTF-8 JSON 文件后执行上面 command,输出即 <browsertool> 卡片',
|
|
@@ -436,3 +437,344 @@ export const contractLedgerOperations = [
|
|
|
436
437
|
},
|
|
437
438
|
},
|
|
438
439
|
];
|
|
440
|
+
// ------------------------------------------------- 台账入口路由(2026-11-19)
|
|
441
|
+
/**
|
|
442
|
+
* 统计信号:只有「要一个算出来的结果」才算统计诉求。
|
|
443
|
+
*
|
|
444
|
+
* 判错根因是拿「业绩」这个词当聚合信号——它只是台账名与字段名;
|
|
445
|
+
* 年 / 季 / 月只是收窄范围的筛选条件;「某个人的 / 某个团队的」只是筛选维度。
|
|
446
|
+
* 真正的信号只有聚合动作、比较排名、判断核对、产物诉求四类。
|
|
447
|
+
*/
|
|
448
|
+
const STAT_SIGNALS = [
|
|
449
|
+
{ key: 'aggregate', label: '聚合动作', pattern: /多少|几份|几单|几个|合计|总共|累计|占比|平均|总额|加起来/u },
|
|
450
|
+
{ key: 'compare', label: '比较与排名', pattern: /排名|第几|同比|环比|对比|比较|趋势|top\s*\d+|前\s*\d+\s*名/u },
|
|
451
|
+
{ key: 'judge', label: '判断与核对', pattern: /达标|完成率|对不上|对得上|差多少|差额|有没有验收|有没有收款|是否验收/u },
|
|
452
|
+
{ key: 'report', label: '产物诉求', pattern: /报表|仪表盘|图表|看板|导出/u },
|
|
453
|
+
];
|
|
454
|
+
const ROUTE_CONDITION_NAMES = [
|
|
455
|
+
'person',
|
|
456
|
+
'team',
|
|
457
|
+
'yearMonth',
|
|
458
|
+
'dateRange',
|
|
459
|
+
'customer',
|
|
460
|
+
'contractNo',
|
|
461
|
+
];
|
|
462
|
+
/** 每个台账标签支持的条件 → 台账筛选键;缺项即「该条件落不到这张卡上」。 */
|
|
463
|
+
const CONDITION_TO_FILTER = {
|
|
464
|
+
directPerf: { person: 'xsjl', team: 'tdfzr', yearMonth: 'yjny', customer: 'khmc', contractNo: 'hth' },
|
|
465
|
+
ecology: { person: 'xsjl2', dateRange: 'qdrq', customer: 'khmc', contractNo: 'hth' },
|
|
466
|
+
etOrder: { dateRange: 'qdrq', customer: 'khmc' },
|
|
467
|
+
agree: { dateRange: 'qdrq', customer: 'dls', contractNo: 'xyh' },
|
|
468
|
+
};
|
|
469
|
+
/** 这两本台账只有 ebdf 列表卡,语义键一律预置不上,条件只能交给页面筛选。 */
|
|
470
|
+
const EBDF_ONLY_MENUS = ['合同收款', '项目验收'];
|
|
471
|
+
/**
|
|
472
|
+
* 原话没点名台账、也没带条件时的兜底意图提示(2026-11-19)。
|
|
473
|
+
*
|
|
474
|
+
* 文档口径(contract-performance-query.md §0):「看看我的合同」属「链路 1(组件卡)」,
|
|
475
|
+
* 应出台账卡;此前一律回落到 `直销业绩`,等于把「我的合同」当成「我的业绩」。
|
|
476
|
+
* 只在**菜单名与别名都没命中**时生效,命中的是完整短语(不用「合同」这类会误伤的裸词)。
|
|
477
|
+
*/
|
|
478
|
+
const MENU_INTENT_HINTS = [
|
|
479
|
+
{ pattern: /我的合同|看合同|查合同|合同台账|合同清单/u, menu: '直销合同' },
|
|
480
|
+
{ pattern: /我的业绩|看业绩|查业绩|业绩台账/u, menu: '直销业绩' },
|
|
481
|
+
];
|
|
482
|
+
/**
|
|
483
|
+
* 从用户原话里认台账名(2026-11-19 新增)。
|
|
484
|
+
*
|
|
485
|
+
* 事故背景:`menu` 为空时只看 conditions、从不看原话,导致「打开直销合同」这类
|
|
486
|
+
* 不带条件的诉求一律回落到 `直销业绩`——用户点名了台账却拿到另一本。
|
|
487
|
+
*
|
|
488
|
+
* 匹配顺序(都按 key 长度倒序,保证「渠道订单-商务」先于「渠道订单」):
|
|
489
|
+
* 1. 六个正式菜单名;
|
|
490
|
+
* 2. 别名,但只认「能定死一本台账」的:`ALIASES` 里排除掉会跨台账命中的宽词
|
|
491
|
+
* (`收款` / `验收` / `业绩` / `合同数据` 等)。命中宽词时**不猜**;
|
|
492
|
+
* 3. 兜底意图提示 `MENU_INTENT_HINTS`(如「我的合同」)。
|
|
493
|
+
* 命中多个不同菜单时同样不猜。
|
|
494
|
+
*/
|
|
495
|
+
const UNAMBIGUOUS_ALIAS_EXCLUDE = new Set([
|
|
496
|
+
'业绩', '个人业绩', '机构业绩', '大区业绩', '团队业绩',
|
|
497
|
+
'收款', '验收', '合同数据', 'e-cology合同', 'e-cology 合同',
|
|
498
|
+
]);
|
|
499
|
+
function inferMenuFromQuery(query) {
|
|
500
|
+
const text = query.trim();
|
|
501
|
+
if (!text)
|
|
502
|
+
return null;
|
|
503
|
+
const byLengthDesc = (list) => [...list].sort((a, b) => b.length - a.length);
|
|
504
|
+
const menuHit = byLengthDesc([...MENU_PAGES.keys()]).find((name) => text.includes(name));
|
|
505
|
+
if (menuHit)
|
|
506
|
+
return { menu: menuHit, hit: menuHit, via: 'menu' };
|
|
507
|
+
const aliasNames = byLengthDesc([...ALIASES.keys()].filter((name) => !UNAMBIGUOUS_ALIAS_EXCLUDE.has(name)));
|
|
508
|
+
const aliasHits = aliasNames.filter((name) => text.includes(name));
|
|
509
|
+
const targets = new Set(aliasHits.map((name) => ALIASES.get(name)));
|
|
510
|
+
if (targets.size === 1 && aliasHits.length) {
|
|
511
|
+
const hit = aliasHits[0];
|
|
512
|
+
return { menu: ALIASES.get(hit), hit, via: 'alias' };
|
|
513
|
+
}
|
|
514
|
+
const hint = MENU_INTENT_HINTS.find((item) => item.pattern.test(text));
|
|
515
|
+
if (hint)
|
|
516
|
+
return { menu: hint.menu, hit: hint.pattern.source, via: 'hint' };
|
|
517
|
+
return null;
|
|
518
|
+
}
|
|
519
|
+
/** `2026-11` → `["2026-11-01","2026-11-30"]`;非年月格式返回 null。 */ function yearMonthToRange(text) {
|
|
520
|
+
const matched = /^(\d{4})-(\d{1,2})$/u.exec(text.trim());
|
|
521
|
+
if (!matched)
|
|
522
|
+
return null;
|
|
523
|
+
const year = Number(matched[1]);
|
|
524
|
+
const month = Number(matched[2]);
|
|
525
|
+
if (month < 1 || month > 12)
|
|
526
|
+
return null;
|
|
527
|
+
const lastDay = new Date(Date.UTC(year, month, 0)).getUTCDate();
|
|
528
|
+
const mm = String(month).padStart(2, '0');
|
|
529
|
+
return [`${year}-${mm}-01`, `${year}-${mm}-${String(lastDay).padStart(2, '0')}`];
|
|
530
|
+
}
|
|
531
|
+
/** 人员值必须能归一化成 `[{ id, name }]`,否则算「落不到卡上」。 */
|
|
532
|
+
function normalizeRoutePerson(raw) {
|
|
533
|
+
if (raw === null || raw === undefined || raw === '')
|
|
534
|
+
return null;
|
|
535
|
+
const list = Array.isArray(raw) ? raw : [raw];
|
|
536
|
+
const out = [];
|
|
537
|
+
for (const item of list) {
|
|
538
|
+
if (!isRecord(item))
|
|
539
|
+
return null;
|
|
540
|
+
const id = String(item.id ?? '').trim();
|
|
541
|
+
const name = String(item.name ?? '').trim();
|
|
542
|
+
if (!/^\d{6,32}$/u.test(id) || !name)
|
|
543
|
+
return null;
|
|
544
|
+
out.push({ id, name });
|
|
545
|
+
}
|
|
546
|
+
return out.length ? out : null;
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* 台账入口路由判定(本地,零接口)。
|
|
550
|
+
*
|
|
551
|
+
* 主判据是「条件能不能全部落到台账筛选键上」,不是「有没有统计词」:
|
|
552
|
+
* - 命中统计信号 / 显式要聚合对比核对产物 → `ledger-query`;
|
|
553
|
+
* - 其余一律 `card`,能预置的条件预置好,落不了的留给页面筛选。
|
|
554
|
+
*
|
|
555
|
+
* 本 operation 与 `contract.ledger.card` 共用 LEDGER_FILTER_KINDS 白名单,
|
|
556
|
+
* 判定与出卡不会各说一套。
|
|
557
|
+
*/
|
|
558
|
+
export const contractLedgerRouteOperation = {
|
|
559
|
+
name: 'contract.ledger.route',
|
|
560
|
+
risk: 'read',
|
|
561
|
+
inputSchema: {
|
|
562
|
+
type: 'object',
|
|
563
|
+
additionalProperties: false,
|
|
564
|
+
properties: {
|
|
565
|
+
query: { type: 'string', description: '用户原话,用于识别统计信号' },
|
|
566
|
+
menu: { type: 'string', description: '台账名称;缺省时按条件推断' },
|
|
567
|
+
intent: {
|
|
568
|
+
type: 'string',
|
|
569
|
+
description: '显式诉求:detail(只看明细)/ aggregate / compare / crosscheck / report',
|
|
570
|
+
},
|
|
571
|
+
conditions: {
|
|
572
|
+
type: 'object',
|
|
573
|
+
description: '条件对象:person / team / yearMonth / dateRange / customer / contractNo',
|
|
574
|
+
},
|
|
575
|
+
},
|
|
576
|
+
},
|
|
577
|
+
async execute(input, context) {
|
|
578
|
+
const query = typeof input.query === 'string' ? input.query : '';
|
|
579
|
+
const intent = typeof input.intent === 'string' ? input.intent.trim().toLowerCase() : '';
|
|
580
|
+
const conditions = isRecord(input.conditions) ? input.conditions : {};
|
|
581
|
+
const menuInput = typeof input.menu === 'string' ? input.menu.trim() : '';
|
|
582
|
+
const matchedSignals = STAT_SIGNALS
|
|
583
|
+
.filter((signal) => signal.pattern.test(query))
|
|
584
|
+
.map((signal) => ({ key: signal.key, label: signal.label }));
|
|
585
|
+
let menu = menuInput;
|
|
586
|
+
let menuNote = '';
|
|
587
|
+
if (!menu) {
|
|
588
|
+
// 先看用户说没说出台账名:长名优先(渠道订单-商务 先于 渠道订单),
|
|
589
|
+
// 只认「拿到菜单后能定死一本台账」的别名,避免「业绩」这类宽词误命中。
|
|
590
|
+
const fromQuery = inferMenuFromQuery(query);
|
|
591
|
+
if (fromQuery) {
|
|
592
|
+
menu = fromQuery.menu;
|
|
593
|
+
if (fromQuery.via === 'alias') {
|
|
594
|
+
menuNote = `按用户原话里的「${fromQuery.hit}」判定为「${fromQuery.menu}」`;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
else if (conditions.person || conditions.team || conditions.yearMonth) {
|
|
598
|
+
menu = '直销业绩';
|
|
599
|
+
}
|
|
600
|
+
else if (conditions.dateRange || conditions.customer || conditions.contractNo) {
|
|
601
|
+
menu = '直销合同';
|
|
602
|
+
}
|
|
603
|
+
else {
|
|
604
|
+
menu = '直销业绩';
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
const isEbdf = EBDF_ONLY_MENUS.includes(menu);
|
|
608
|
+
const viewKey = LEDGER_VIEW_KEYS.get(menu) ?? null;
|
|
609
|
+
if (!isEbdf && !viewKey) {
|
|
610
|
+
throw contractValidationError('menu_unknown', `未知台账 ${menu},可选:直销合同、直销业绩、渠道订单、渠道订单-商务、合同收款、项目验收`);
|
|
611
|
+
}
|
|
612
|
+
const mapping = viewKey ? CONDITION_TO_FILTER[viewKey] ?? {} : {};
|
|
613
|
+
const prefill = {};
|
|
614
|
+
const unsupported = [];
|
|
615
|
+
const approximations = [];
|
|
616
|
+
if (menuNote)
|
|
617
|
+
approximations.push(menuNote);
|
|
618
|
+
const hasValue = (name) => {
|
|
619
|
+
const value = conditions[name];
|
|
620
|
+
return value !== undefined && value !== null && value !== '';
|
|
621
|
+
};
|
|
622
|
+
if (isEbdf) {
|
|
623
|
+
for (const name of ROUTE_CONDITION_NAMES) {
|
|
624
|
+
if (hasValue(name))
|
|
625
|
+
unsupported.push(name);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
else {
|
|
629
|
+
if (hasValue('person')) {
|
|
630
|
+
const person = normalizeRoutePerson(conditions.person);
|
|
631
|
+
const key = mapping.person;
|
|
632
|
+
if (person && key)
|
|
633
|
+
prefill[key] = person;
|
|
634
|
+
else
|
|
635
|
+
unsupported.push('person');
|
|
636
|
+
}
|
|
637
|
+
if (hasValue('team')) {
|
|
638
|
+
const team = normalizeRoutePerson(conditions.team);
|
|
639
|
+
const key = mapping.team;
|
|
640
|
+
if (team && key) {
|
|
641
|
+
prefill[key] = team;
|
|
642
|
+
approximations.push('团队按「团队负责人」字段近似预置,团队口径请在页面确认');
|
|
643
|
+
}
|
|
644
|
+
else {
|
|
645
|
+
unsupported.push('team');
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
if (hasValue('yearMonth')) {
|
|
649
|
+
const text = String(conditions.yearMonth).trim();
|
|
650
|
+
const monthKey = mapping.yearMonth;
|
|
651
|
+
const rangeKey = mapping.dateRange;
|
|
652
|
+
if (monthKey && /^\d{4}-\d{1,2}$/u.test(text)) {
|
|
653
|
+
prefill[monthKey] = text;
|
|
654
|
+
}
|
|
655
|
+
else if (rangeKey) {
|
|
656
|
+
const range = yearMonthToRange(text);
|
|
657
|
+
if (range)
|
|
658
|
+
prefill[rangeKey] = range;
|
|
659
|
+
else
|
|
660
|
+
unsupported.push('yearMonth');
|
|
661
|
+
}
|
|
662
|
+
else {
|
|
663
|
+
unsupported.push('yearMonth');
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
if (hasValue('dateRange')) {
|
|
667
|
+
const raw = conditions.dateRange;
|
|
668
|
+
const valid = Array.isArray(raw)
|
|
669
|
+
&& raw.length === 2
|
|
670
|
+
&& raw.every((item) => typeof item === 'string' && /^\d{4}-\d{2}-\d{2}$/u.test(item));
|
|
671
|
+
const key = mapping.dateRange;
|
|
672
|
+
if (valid && key)
|
|
673
|
+
prefill[key] = raw;
|
|
674
|
+
else
|
|
675
|
+
unsupported.push('dateRange');
|
|
676
|
+
}
|
|
677
|
+
if (hasValue('customer')) {
|
|
678
|
+
const text = String(conditions.customer).trim();
|
|
679
|
+
const key = mapping.customer;
|
|
680
|
+
if (key && text) {
|
|
681
|
+
prefill[key] = text;
|
|
682
|
+
if (viewKey === 'agree')
|
|
683
|
+
approximations.push('渠道订单-商务的客户条件落到「代理商名称」');
|
|
684
|
+
}
|
|
685
|
+
else {
|
|
686
|
+
unsupported.push('customer');
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
if (hasValue('contractNo')) {
|
|
690
|
+
const text = String(conditions.contractNo).trim();
|
|
691
|
+
const key = mapping.contractNo;
|
|
692
|
+
if (key && text)
|
|
693
|
+
prefill[key] = text;
|
|
694
|
+
else
|
|
695
|
+
unsupported.push('contractNo');
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
const canPrefillAll = unsupported.length === 0;
|
|
699
|
+
const strongIntent = ['aggregate', 'compare', 'crosscheck', 'report'].includes(intent);
|
|
700
|
+
const reasons = [];
|
|
701
|
+
let route;
|
|
702
|
+
if (strongIntent) {
|
|
703
|
+
route = 'ledger-query';
|
|
704
|
+
reasons.push(`显式诉求 intent=${intent}:要的是页面给不出的结论`);
|
|
705
|
+
}
|
|
706
|
+
else if (matchedSignals.length) {
|
|
707
|
+
route = 'ledger-query';
|
|
708
|
+
reasons.push(`命中统计信号:${matchedSignals.map((item) => item.label).join('、')}`);
|
|
709
|
+
}
|
|
710
|
+
else if (intent === 'detail') {
|
|
711
|
+
route = 'card';
|
|
712
|
+
reasons.push('显式 intent=detail:只看明细,直接出卡');
|
|
713
|
+
}
|
|
714
|
+
else if (isEbdf) {
|
|
715
|
+
route = 'card';
|
|
716
|
+
reasons.push('合同收款 / 项目验收只有 ebdf 列表卡,条件必须交给页面筛选');
|
|
717
|
+
}
|
|
718
|
+
else if (canPrefillAll) {
|
|
719
|
+
route = 'card';
|
|
720
|
+
reasons.push('条件全部可预置到台账筛选键,直接出卡并预置');
|
|
721
|
+
}
|
|
722
|
+
else {
|
|
723
|
+
route = 'card';
|
|
724
|
+
reasons.push('未命中统计信号,按看台账处理;落不了的条件留给页面筛选');
|
|
725
|
+
}
|
|
726
|
+
const prefillKeys = Object.keys(prefill);
|
|
727
|
+
// comParamsJson 是**字符串**入参:提示里必须给双层序列化后的字符串字面量。
|
|
728
|
+
// 事故(2026-11-20):这里原本只 JSON.stringify 一次,渲染出 `comParamsJson={"xsjl":[…]}`,
|
|
729
|
+
// 模型照抄成对象形态;而卡片接口对非字符串入参是静默丢弃条件、不报错,条件就没了。
|
|
730
|
+
const prefillHint = prefillKeys.length
|
|
731
|
+
? `,comParamsJson=${JSON.stringify(JSON.stringify(prefill))}`
|
|
732
|
+
: '';
|
|
733
|
+
// ── route=card 时**顺带把卡片也生成好**(2026-11-20,省 1 轮)
|
|
734
|
+
// 卡片构造是纯本地计算(`contract.ledger.card` 不访问业务接口),进程内调用即可。
|
|
735
|
+
// 失败**绝不影响路由结论**:路由是判定,卡片是产物;产物失败降级回 nextCommand 提示。
|
|
736
|
+
let card = null;
|
|
737
|
+
let cardSelfCheck = null;
|
|
738
|
+
let cardError = null;
|
|
739
|
+
if (route === 'card') {
|
|
740
|
+
try {
|
|
741
|
+
const built = await contractLedgerCardOperation.execute({ menu, comParamsJson: JSON.stringify(prefill) }, context);
|
|
742
|
+
card = built?.data?.card ?? null;
|
|
743
|
+
cardSelfCheck = built?.data?.selfCheck ?? null;
|
|
744
|
+
}
|
|
745
|
+
catch (error) {
|
|
746
|
+
cardError = error instanceof Error ? error.message : String(error);
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
const nextCommand = route === 'card'
|
|
750
|
+
? (card
|
|
751
|
+
? '(卡片已随本响应返回:顶层 data.card 直接作为 <browsertool> 输出,无需再调 contract.ledger.card)'
|
|
752
|
+
: 'weaver-work-cli --json contract run contract.ledger.card --input <args.json>'
|
|
753
|
+
+ `(menu=${menu}${prefillHint})`)
|
|
754
|
+
: 'contract.ledger.metrics 取口径 → contract.performance.list.query 取数 → contract.ledger.aggregate 汇总';
|
|
755
|
+
return {
|
|
756
|
+
status: 'COMPLETE',
|
|
757
|
+
data: {
|
|
758
|
+
route,
|
|
759
|
+
menu,
|
|
760
|
+
variant: isEbdf ? 'ebdf-list' : 'ledger',
|
|
761
|
+
viewKey,
|
|
762
|
+
prefill,
|
|
763
|
+
canPrefillAll,
|
|
764
|
+
unsupportedConditions: unsupported,
|
|
765
|
+
approximations,
|
|
766
|
+
matchedSignals,
|
|
767
|
+
reasons,
|
|
768
|
+
nextCommand,
|
|
769
|
+
card,
|
|
770
|
+
cardSelfCheck,
|
|
771
|
+
...(cardError ? { cardError } : {}),
|
|
772
|
+
conditions,
|
|
773
|
+
note: 'route=card 时禁止先进取数链路;只有统计信号或显式 intent 才走 ledger-query。'
|
|
774
|
+
+ '「业绩」二字、年月、「某个人的 / 某个团队的」都不是统计信号。本 operation 不访问业务接口。'
|
|
775
|
+
+ 'route=card 时顶层已带构建好的 data.card(本地零接口),直接用;data.card 为 null 时才按 nextCommand 自建。',
|
|
776
|
+
},
|
|
777
|
+
};
|
|
778
|
+
},
|
|
779
|
+
};
|
|
780
|
+
export const contractLedgerRouteOperations = [contractLedgerRouteOperation];
|