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
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, resolve } from 'node:path';
|
|
3
|
+
import { contractValidationError } from '../errors.js';
|
|
4
|
+
import { resolveOperation } from './op-resolver.js';
|
|
5
|
+
/**
|
|
6
|
+
* 合同比对报告渲染(2026-11-19 新增,取代已删除的 `contract.comparescreen.run`)。
|
|
7
|
+
*
|
|
8
|
+
* 背景:`comparescreen.run` 把「上传 + 全量比对 + 报告 HTML + 行为卡片」揉成一条命令,
|
|
9
|
+
* 卡片部分随「行为卡片全面废止」下线,报告交付也改为 HTML 落盘 + `open_web` 打开
|
|
10
|
+
* `file:///`。本 operation 只保留报告这一件事,不再出任何卡片:
|
|
11
|
+
* files(2) / baseFileId+compareFileId / ref(落盘的 diff 结果)
|
|
12
|
+
* → contract.compare.diff(需要时)
|
|
13
|
+
* → 按 `contract-compare-report.md` 的口径渲染 HTML → 落盘 → 返回路径
|
|
14
|
+
*
|
|
15
|
+
* 设计对齐 `review-report.ts`:模板内嵌在代码里(打包场景下读外部模板会静默失效),
|
|
16
|
+
* 只有显式传 `template` 才读外部文件;内嵌模板与
|
|
17
|
+
* `references/contract-compare-report-template.html` 互为镜像,两者必须一致。
|
|
18
|
+
*
|
|
19
|
+
* 默认比对(「比对一下 / 看看两版差异」)不走本命令,用 `compare.upload` →
|
|
20
|
+
* `compare.page` → `open_web`,由页面自行渲染差异。
|
|
21
|
+
*/
|
|
22
|
+
const DEFAULT_BASE = 'https://www.e-cology.com.cn';
|
|
23
|
+
function isRecord(value) {
|
|
24
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
25
|
+
}
|
|
26
|
+
function str(value) {
|
|
27
|
+
return typeof value === 'string' ? value : typeof value === 'number' ? String(value) : '';
|
|
28
|
+
}
|
|
29
|
+
function num(value) {
|
|
30
|
+
const parsed = Number(value);
|
|
31
|
+
return Number.isFinite(parsed) ? parsed : 0;
|
|
32
|
+
}
|
|
33
|
+
/** 只用于文件名、条款名等纯文本位置;接口给的 base/compare 已带高亮,不能二次转义。 */
|
|
34
|
+
function esc(value) {
|
|
35
|
+
return str(value)
|
|
36
|
+
.replace(/&/gu, '&')
|
|
37
|
+
.replace(/</gu, '<')
|
|
38
|
+
.replace(/>/gu, '>');
|
|
39
|
+
}
|
|
40
|
+
function readJson(path) {
|
|
41
|
+
const raw = readFileSync(path, 'utf8').replace(/^\uFEFF/u, '');
|
|
42
|
+
const parsed = JSON.parse(raw);
|
|
43
|
+
if (!isRecord(parsed))
|
|
44
|
+
throw new Error('JSON 根节点必须是对象');
|
|
45
|
+
return parsed;
|
|
46
|
+
}
|
|
47
|
+
async function callOperation(name, input, context) {
|
|
48
|
+
const operation = resolveOperation(name);
|
|
49
|
+
const result = await operation.execute(input, context);
|
|
50
|
+
return isRecord(result?.data) ? result.data : {};
|
|
51
|
+
}
|
|
52
|
+
function stampNow() {
|
|
53
|
+
const now = new Date();
|
|
54
|
+
const pad = (value) => String(value).padStart(2, '0');
|
|
55
|
+
return `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())} ${pad(now.getHours())}:${pad(now.getMinutes())}`;
|
|
56
|
+
}
|
|
57
|
+
/** 按接口 type 逐条计数,合计恒等于 changes.length;同一处被拆成多条时照实各计一条。 */
|
|
58
|
+
function statOf(changes, percentage, serviceTime) {
|
|
59
|
+
let insert = 0;
|
|
60
|
+
let deleted = 0;
|
|
61
|
+
let changed = 0;
|
|
62
|
+
for (const item of changes) {
|
|
63
|
+
const type = str(item.type).toLowerCase();
|
|
64
|
+
if (type === 'insert')
|
|
65
|
+
insert += 1;
|
|
66
|
+
else if (type === 'delete')
|
|
67
|
+
deleted += 1;
|
|
68
|
+
else if (type === 'change' || type === 'replace')
|
|
69
|
+
changed += 1;
|
|
70
|
+
}
|
|
71
|
+
return { total: changes.length, insert, delete: deleted, change: changed, percentage, serviceTime };
|
|
72
|
+
}
|
|
73
|
+
function typeLabel(type) {
|
|
74
|
+
const value = type.toLowerCase();
|
|
75
|
+
if (value === 'insert')
|
|
76
|
+
return { label: '新增', cls: 'ins', color: '#237804' };
|
|
77
|
+
if (value === 'delete')
|
|
78
|
+
return { label: '删除', cls: 'del', color: '#a8071a' };
|
|
79
|
+
if (value === 'change' || value === 'replace')
|
|
80
|
+
return { label: '修改', cls: 'chg', color: '#b26a00' };
|
|
81
|
+
return { label: type || '差异', cls: 'oth', color: '#5c6570' };
|
|
82
|
+
}
|
|
83
|
+
/** 章节归属:正文章标题不带「第X章」,带编号的只出现在目录,故按关键词与页码定位。 */
|
|
84
|
+
function zoneOf(item) {
|
|
85
|
+
const content = [str(item.baseOriginal), str(item.compareOriginal), str(item.countText)].join(' ');
|
|
86
|
+
if (/(联系人|联系电话|电话|传真|邮箱|开户行|账号|税号|地址)/u.test(content))
|
|
87
|
+
return 'party';
|
|
88
|
+
if (/(签订时间|签订日期|签订地点|合同编号|合同名称)/u.test(content))
|
|
89
|
+
return 'cover';
|
|
90
|
+
return 'body';
|
|
91
|
+
}
|
|
92
|
+
function clauseOf(item) {
|
|
93
|
+
const content = [str(item.baseOriginal), str(item.compareOriginal), str(item.countText)].join(' ');
|
|
94
|
+
if (/(签订时间|签订日期)/u.test(content))
|
|
95
|
+
return '签订时间';
|
|
96
|
+
if (/签订地点/u.test(content))
|
|
97
|
+
return '签订地点';
|
|
98
|
+
if (/联系人/u.test(content))
|
|
99
|
+
return '联系人';
|
|
100
|
+
if (/电话/u.test(content))
|
|
101
|
+
return '联系电话';
|
|
102
|
+
if (/传真/u.test(content))
|
|
103
|
+
return '传真';
|
|
104
|
+
if (/邮箱/u.test(content))
|
|
105
|
+
return '电子邮箱';
|
|
106
|
+
if (/地址/u.test(content))
|
|
107
|
+
return '地址';
|
|
108
|
+
if (/合同编号/u.test(content))
|
|
109
|
+
return '合同编号';
|
|
110
|
+
if (/合同名称/u.test(content))
|
|
111
|
+
return '合同名称';
|
|
112
|
+
return '其他条款';
|
|
113
|
+
}
|
|
114
|
+
function pageOf(item) {
|
|
115
|
+
const side = isRecord(item.right) ? item.right : isRecord(item.left) ? item.left : {};
|
|
116
|
+
const positions = Array.isArray(side.positions) ? side.positions : [];
|
|
117
|
+
const first = positions.length > 0 && isRecord(positions[0]) ? positions[0] : {};
|
|
118
|
+
const page = num(first.page);
|
|
119
|
+
return page >= 0 ? page + 1 : 0;
|
|
120
|
+
}
|
|
121
|
+
function slimChanges(changes) {
|
|
122
|
+
return changes.map((item) => ({
|
|
123
|
+
type: str(item.type),
|
|
124
|
+
zone: zoneOf(item),
|
|
125
|
+
clause: clauseOf(item),
|
|
126
|
+
page: pageOf(item),
|
|
127
|
+
base: str(item.baseOriginal),
|
|
128
|
+
compare: str(item.compareOriginal),
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
// ---------------------------------------------------------------- 报告渲染
|
|
132
|
+
const ZONE_GROUPS = [
|
|
133
|
+
['cover', '封面(正文前)'],
|
|
134
|
+
['party', '缔约信息区(正文前)'],
|
|
135
|
+
['body', '正文条款'],
|
|
136
|
+
];
|
|
137
|
+
function detailRows(changes) {
|
|
138
|
+
return changes
|
|
139
|
+
.map((item, index) => {
|
|
140
|
+
const meta = typeLabel(str(item.type));
|
|
141
|
+
return `<tr><td class="num">${index + 1}</td>`
|
|
142
|
+
+ `<td><span class="tag" style="color:${meta.color}">${esc(meta.label)}</span></td>`
|
|
143
|
+
+ `<td class="cell base">${str(item.base)}</td>`
|
|
144
|
+
+ `<td class="cell cmp">${str(item.compare)}</td></tr>`;
|
|
145
|
+
})
|
|
146
|
+
.join('');
|
|
147
|
+
}
|
|
148
|
+
function diffBlocks(changes) {
|
|
149
|
+
const section2 = [];
|
|
150
|
+
const noDiff = [];
|
|
151
|
+
for (const [key, label] of ZONE_GROUPS) {
|
|
152
|
+
const group = changes.filter((item) => zoneOf(item) === key);
|
|
153
|
+
if (group.length === 0) {
|
|
154
|
+
noDiff.push(label);
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
const rows = group
|
|
158
|
+
.map((item) => {
|
|
159
|
+
const meta = typeLabel(str(item.type));
|
|
160
|
+
const page = pageOf(item);
|
|
161
|
+
const clause = clauseOf(item);
|
|
162
|
+
const position = `${label} · ${clause}${page > 0 ? `(第 ${page} 页)` : ''}`;
|
|
163
|
+
return `<tr><td class="clause">${esc(clause)}</td>`
|
|
164
|
+
+ `<td><span class="tag" style="color:${meta.color}">${esc(meta.label)}</span></td>`
|
|
165
|
+
+ `<td class="where">${esc(position)}</td>`
|
|
166
|
+
+ `<td class="cell base">${str(item.base)}</td>`
|
|
167
|
+
+ `<td class="cell cmp">${str(item.compare)}</td></tr>`;
|
|
168
|
+
})
|
|
169
|
+
.join('');
|
|
170
|
+
section2.push('<div class="grp">'
|
|
171
|
+
+ `<div class="grp-hd"><span class="grp-name">${esc(label)}</span>`
|
|
172
|
+
+ `<span class="grp-cnt">${group.length} 处差异</span></div>`
|
|
173
|
+
+ '<table class="diff2"><thead><tr><th style="width:20%">差异条款</th><th style="width:62px">类型</th>'
|
|
174
|
+
+ '<th style="width:22%">位置</th><th>改动前</th><th>改动后</th></tr></thead>'
|
|
175
|
+
+ `<tbody>${rows}</tbody></table></div>`);
|
|
176
|
+
}
|
|
177
|
+
return { section2: section2.join('\n'), noDiff };
|
|
178
|
+
}
|
|
179
|
+
function noDiffBlock(labels) {
|
|
180
|
+
if (labels.length === 0)
|
|
181
|
+
return '';
|
|
182
|
+
const rows = labels.map((label) => `<tr><td>${esc(label)}</td><td class="none">0 处差异</td></tr>`).join('');
|
|
183
|
+
return '<div class="grp">'
|
|
184
|
+
+ '<div class="grp-hd"><span class="grp-name">未检出差异的区块</span>'
|
|
185
|
+
+ '<span class="grp-cnt" style="background:#237804">0 处差异</span></div>'
|
|
186
|
+
+ '<div class="grp-sub">以下区块逐条比对后未发现差异</div>'
|
|
187
|
+
+ `<table class="chap"><tbody>${rows}</tbody></table></div>`;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* 内嵌模板:与 `references/contract-compare-report-template.html` 互为镜像。
|
|
191
|
+
* 占位符(12 个):GENERATED_AT / BASIC_FILE / TARGET_FILE / TOTAL / INSERT / DELETE /
|
|
192
|
+
* CHANGE / PERCENTAGE / SERVICE_TIME / DIFF_ROWS / SECTION2_BLOCKS / NO_DIFF_BLOCK
|
|
193
|
+
*/
|
|
194
|
+
const DEFAULT_TEMPLATE = `<!DOCTYPE html>
|
|
195
|
+
<html lang="zh-CN">
|
|
196
|
+
<head>
|
|
197
|
+
<meta charset="UTF-8">
|
|
198
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
199
|
+
<title>合同比对报告 · {{BASIC_FILE}}</title>
|
|
200
|
+
<style>
|
|
201
|
+
.rp *{box-sizing:border-box}
|
|
202
|
+
.rp{font-family:"Microsoft YaHei","PingFang SC",sans-serif;color:#1f2329;line-height:1.7;font-size:13.5px;background:#f5f6f8;padding:20px 16px 32px}
|
|
203
|
+
.rp .card{background:#fff;border:1px solid #e3e6eb;border-radius:10px;padding:20px 22px;margin-bottom:14px}
|
|
204
|
+
.rp h1{font-size:19px;margin:0 0 4px;font-weight:700}
|
|
205
|
+
.rp .sub{color:#8a939e;font-size:12.5px;margin-bottom:16px}
|
|
206
|
+
.rp h2{font-size:15px;margin:0 0 12px;padding-left:9px;border-left:3px solid #1a56b8;line-height:1.3}
|
|
207
|
+
.rp h3{font-size:13.5px;margin:0 0 10px;color:#5c6570;font-weight:600}
|
|
208
|
+
.rp table{width:100%;border-collapse:collapse}
|
|
209
|
+
.rp .who{background:#fafbfc;border:1px solid #eef0f4;border-radius:8px;padding:14px 16px;margin-bottom:14px}
|
|
210
|
+
.rp .who .row{display:flex;gap:10px;margin-bottom:8px;align-items:flex-start}
|
|
211
|
+
.rp .who .row:last-child{margin-bottom:0}
|
|
212
|
+
.rp .who .lab{flex:0 0 92px;color:#8a939e;font-size:12.5px}
|
|
213
|
+
.rp .who .val{flex:1;font-weight:600;word-wrap:break-word}
|
|
214
|
+
.rp .who .arrow{flex:0 0 auto;color:#1a56b8;font-weight:700}
|
|
215
|
+
.rp .stats{display:flex;gap:10px;margin-bottom:14px;flex-wrap:wrap}
|
|
216
|
+
.rp .stat{flex:1 1 96px;background:#fff;border:1px solid #e3e6eb;border-radius:10px;padding:12px 14px;text-align:center}
|
|
217
|
+
.rp .stat .k{font-size:12px;color:#8a939e;margin-bottom:4px}
|
|
218
|
+
.rp .stat .n{font-size:22px;font-weight:700;line-height:1.15;color:#1f2329}
|
|
219
|
+
.rp .stat.tot .n{color:#1a56b8}
|
|
220
|
+
.rp .stat.ins .n{color:#237804}
|
|
221
|
+
.rp .stat.del .n{color:#a8071a}
|
|
222
|
+
.rp .stat.chg .n{color:#b26a00}
|
|
223
|
+
.rp .diff th,.rp .diff2 th{text-align:left;font-size:12.5px;color:#5c6570;font-weight:500;padding:9px 10px;background:#fafbfc;border-bottom:1px solid #e3e6eb}
|
|
224
|
+
.rp .diff td,.rp .diff2 td{padding:12px 10px;border-bottom:1px solid #f0f2f5;vertical-align:top}
|
|
225
|
+
.rp .diff tr:last-child td,.rp .diff2 tr:last-child td{border-bottom:none}
|
|
226
|
+
.rp .num{width:38px;color:#a0a8b3;text-align:center}
|
|
227
|
+
.rp .tag{display:inline-block;font-size:11.5px;padding:1px 9px;border-radius:999px;border:1px solid;white-space:nowrap}
|
|
228
|
+
.rp .cell{font-size:13px;line-height:1.8;word-wrap:break-word}
|
|
229
|
+
.rp .base{background:#fcfcfd}
|
|
230
|
+
.rp .cmp{background:#fbfdff}
|
|
231
|
+
.rp .clause{font-weight:600;font-size:13px}
|
|
232
|
+
.rp .where{color:#8a939e;font-size:12px;line-height:1.6}
|
|
233
|
+
.rp details{border:1px solid #e3e6eb;border-radius:10px;background:#fff;overflow:hidden}
|
|
234
|
+
.rp details>summary{cursor:pointer;padding:15px 20px;font-size:15px;font-weight:700;list-style:none;display:flex;align-items:center;gap:10px;background:#fff}
|
|
235
|
+
.rp details>summary::-webkit-details-marker{display:none}
|
|
236
|
+
.rp details>summary .arw{color:#1a56b8;font-size:13px;transition:transform .2s}
|
|
237
|
+
.rp details[open]>summary .arw{transform:rotate(90deg)}
|
|
238
|
+
.rp details>summary .hint{margin-left:auto;font-size:12px;color:#8a939e;font-weight:400}
|
|
239
|
+
.rp .body{padding:0 20px 18px}
|
|
240
|
+
.rp .grp{border:1px solid #eef0f4;border-radius:8px;margin-bottom:12px;overflow:hidden}
|
|
241
|
+
.rp .grp-hd{background:#fafbfc;padding:10px 14px;display:flex;align-items:center;gap:8px}
|
|
242
|
+
.rp .grp-name{font-weight:700;font-size:13.5px}
|
|
243
|
+
.rp .grp-cnt{font-size:11.5px;color:#fff;background:#1a56b8;border-radius:999px;padding:1px 9px}
|
|
244
|
+
.rp .grp-sub{padding:8px 14px 0;color:#8a939e;font-size:12px}
|
|
245
|
+
.rp .diff2{margin-top:6px}
|
|
246
|
+
.rp .chap td{padding:7px 12px;border-bottom:1px solid #f5f6f8;font-size:12.5px}
|
|
247
|
+
.rp .chap .none{color:#237804;text-align:right}
|
|
248
|
+
.rp .disc{font-size:12px;color:#8a939e;background:#fafbfc;border-radius:8px;padding:10px 14px;line-height:1.8;margin-top:12px}
|
|
249
|
+
.rp .foot{color:#a0a8b3;font-size:12px;text-align:center;margin-top:10px}
|
|
250
|
+
@media print{.rp{background:#fff;padding:0}.rp .card{border:none}}
|
|
251
|
+
</style>
|
|
252
|
+
</head>
|
|
253
|
+
<body style="margin:0;background:#f5f6f8">
|
|
254
|
+
|
|
255
|
+
<div class="rp">
|
|
256
|
+
|
|
257
|
+
<!-- ===== 第一部分:比对信息 ===== -->
|
|
258
|
+
<div class="card">
|
|
259
|
+
<h1>合同比对报告</h1>
|
|
260
|
+
<div class="sub">生成时间 {{GENERATED_AT}} | 数据来源:contract.compare.diff 实际返回</div>
|
|
261
|
+
|
|
262
|
+
<h2>一、比对信息</h2>
|
|
263
|
+
|
|
264
|
+
<h3>1. 比对双方</h3>
|
|
265
|
+
<div class="who">
|
|
266
|
+
<div class="row"><div class="lab">基准合同</div><div class="val">{{BASIC_FILE}}</div></div>
|
|
267
|
+
<div class="row"><div class="lab"></div><div class="arrow">↓ 与 ↓</div></div>
|
|
268
|
+
<div class="row"><div class="lab">比对合同</div><div class="val">{{TARGET_FILE}}</div></div>
|
|
269
|
+
</div>
|
|
270
|
+
|
|
271
|
+
<h3>2. 差异统计</h3>
|
|
272
|
+
<div class="stats">
|
|
273
|
+
<div class="stat tot"><div class="k">变化合计</div><div class="n">{{TOTAL}}</div></div>
|
|
274
|
+
<div class="stat ins"><div class="k">新增</div><div class="n">{{INSERT}}</div></div>
|
|
275
|
+
<div class="stat del"><div class="k">删除</div><div class="n">{{DELETE}}</div></div>
|
|
276
|
+
<div class="stat chg"><div class="k">修改</div><div class="n">{{CHANGE}}</div></div>
|
|
277
|
+
</div>
|
|
278
|
+
<div class="disc" style="margin-bottom:14px">
|
|
279
|
+
自基准合同至比对合同,共发生 <b>{{TOTAL}}</b> 处变化:新增 <b>{{INSERT}}</b> 处、删除 <b>{{DELETE}}</b> 处、修改 <b>{{CHANGE}}</b> 处。
|
|
280
|
+
文本相似度 <b>{{PERCENTAGE}}</b>,比对耗时 {{SERVICE_TIME}}。
|
|
281
|
+
</div>
|
|
282
|
+
|
|
283
|
+
<h3>3. 差异详情</h3>
|
|
284
|
+
<table class="diff">
|
|
285
|
+
<thead><tr><th style="width:38px">#</th><th style="width:68px">类型</th><th>基准合同内容</th><th>比对合同内容</th></tr></thead>
|
|
286
|
+
<tbody>{{DIFF_ROWS}}</tbody>
|
|
287
|
+
</table>
|
|
288
|
+
<div class="disc">上表为接口返回的原文片段,彩色文字即接口标注的改动位置(橙色=修改、绿色=新增、红色=删除),前后文字为上下文。</div>
|
|
289
|
+
</div>
|
|
290
|
+
|
|
291
|
+
<!-- ===== 第二部分:默认展开 ===== -->
|
|
292
|
+
<details open>
|
|
293
|
+
<summary>
|
|
294
|
+
<span class="arw">▶</span>
|
|
295
|
+
<span>二、按合同章节 / 条款展示差异点</span>
|
|
296
|
+
<span class="hint">可折叠</span>
|
|
297
|
+
</summary>
|
|
298
|
+
<div class="body">
|
|
299
|
+
{{SECTION2_BLOCKS}}
|
|
300
|
+
|
|
301
|
+
{{NO_DIFF_BLOCK}}
|
|
302
|
+
</div>
|
|
303
|
+
</details>
|
|
304
|
+
|
|
305
|
+
<div class="foot">本报告由系统根据实际比对结果自动生成,未对差异内容做任何增补或推断。</div>
|
|
306
|
+
</div>
|
|
307
|
+
|
|
308
|
+
</body>
|
|
309
|
+
</html>`;
|
|
310
|
+
/**
|
|
311
|
+
* 按固定模板渲染比对报告 HTML。
|
|
312
|
+
* 模板占位符全部由本函数填充;`contract-compare-report.md` 是口径唯一事实源。
|
|
313
|
+
*/
|
|
314
|
+
export function renderCompareReport(args, template) {
|
|
315
|
+
const { stat } = args;
|
|
316
|
+
const similarity = stat.percentage > 0 ? `${(stat.percentage * 100).toFixed(2)}%` : '未返回';
|
|
317
|
+
const cost = stat.serviceTime > 0 ? `${Math.round(stat.serviceTime)} ms` : '未返回';
|
|
318
|
+
const detail = stat.total > 0
|
|
319
|
+
? detailRows(args.changes)
|
|
320
|
+
: '<tr><td colspan="4" class="cell">两版未检出差异。</td></tr>';
|
|
321
|
+
const { section2, noDiff } = diffBlocks(args.changes);
|
|
322
|
+
const values = {
|
|
323
|
+
GENERATED_AT: esc(args.generatedAt),
|
|
324
|
+
BASIC_FILE: esc(args.baseFileName),
|
|
325
|
+
TARGET_FILE: esc(args.compareFileName),
|
|
326
|
+
TOTAL: String(stat.total),
|
|
327
|
+
INSERT: String(stat.insert),
|
|
328
|
+
DELETE: String(stat.delete),
|
|
329
|
+
CHANGE: String(stat.change),
|
|
330
|
+
PERCENTAGE: similarity,
|
|
331
|
+
SERVICE_TIME: cost,
|
|
332
|
+
DIFF_ROWS: detail,
|
|
333
|
+
SECTION2_BLOCKS: section2 || '<div class="grp-sub">未检出差异。</div>',
|
|
334
|
+
NO_DIFF_BLOCK: noDiffBlock(noDiff),
|
|
335
|
+
};
|
|
336
|
+
let html = template;
|
|
337
|
+
for (const [key, value] of Object.entries(values)) {
|
|
338
|
+
html = html.split(`{{${key}}}`).join(value);
|
|
339
|
+
}
|
|
340
|
+
const leftover = html.match(/\{\{[A-Z_]+\}\}/gu);
|
|
341
|
+
if (leftover) {
|
|
342
|
+
throw contractValidationError('template_placeholder_unknown', `模板存在未知占位符:${[...new Set(leftover)].join(', ')}`);
|
|
343
|
+
}
|
|
344
|
+
return html;
|
|
345
|
+
}
|
|
346
|
+
// ---------------------------------------------------------------- operation
|
|
347
|
+
export const contractCompareReportOperation = {
|
|
348
|
+
name: 'contract.compare.report',
|
|
349
|
+
async execute(input, context) {
|
|
350
|
+
const paths = Array.isArray(input.files) ? input.files : [];
|
|
351
|
+
let baseFileId = str(input.baseFileId).trim();
|
|
352
|
+
let compareFileId = str(input.compareFileId).trim();
|
|
353
|
+
let baseFileName = str(input.baseFileName).trim();
|
|
354
|
+
let compareFileName = str(input.compareFileName).trim();
|
|
355
|
+
const refPath = str(input.ref).trim();
|
|
356
|
+
let envelope = {};
|
|
357
|
+
if (refPath) {
|
|
358
|
+
const abs = resolve(refPath);
|
|
359
|
+
let parsed;
|
|
360
|
+
try {
|
|
361
|
+
parsed = readJson(abs);
|
|
362
|
+
}
|
|
363
|
+
catch (error) {
|
|
364
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
365
|
+
throw contractValidationError('ref_unreadable', `无法读取比对结果 JSON:${message}`);
|
|
366
|
+
}
|
|
367
|
+
envelope = isRecord(parsed.result) ? parsed.result : parsed;
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
if (paths.length > 0) {
|
|
371
|
+
if (paths.length !== 2) {
|
|
372
|
+
throw contractValidationError('files_count_invalid', '文档比对需要恰好 2 个文件:基准文件在前,比对文件在后');
|
|
373
|
+
}
|
|
374
|
+
const uploaded = await callOperation('contract.compare.upload', { paths }, context);
|
|
375
|
+
const files = Array.isArray(uploaded.files) ? uploaded.files : [];
|
|
376
|
+
if (files.length !== 2 || !str(files[0]?.fileId) || !str(files[1]?.fileId)) {
|
|
377
|
+
throw contractValidationError('upload_no_fileid', '比对文件上传未拿到 fileId,已停止');
|
|
378
|
+
}
|
|
379
|
+
baseFileId = str(files[0].fileId);
|
|
380
|
+
compareFileId = str(files[1].fileId);
|
|
381
|
+
baseFileName = baseFileName || str(files[0].name);
|
|
382
|
+
compareFileName = compareFileName || str(files[1].name);
|
|
383
|
+
}
|
|
384
|
+
if (!baseFileId || !compareFileId) {
|
|
385
|
+
throw contractValidationError('file_ids_required', '请提供 files(2 个本地路径)、baseFileId + compareFileId,或 ref(落盘的比对结果 JSON)');
|
|
386
|
+
}
|
|
387
|
+
const diffData = await callOperation('contract.compare.diff', { baseFileId, compareFileId }, context);
|
|
388
|
+
envelope = isRecord(diffData.result) ? diffData.result : {};
|
|
389
|
+
}
|
|
390
|
+
const body = isRecord(envelope.data) ? envelope.data : {};
|
|
391
|
+
if (String(body.compareStatus ?? '') !== 'true') {
|
|
392
|
+
throw contractValidationError('compare_failed', `比对未成功:${str(envelope.msg) || '接口未返回 compareStatus=true'};`
|
|
393
|
+
+ '不要重试、不要补调 diff 复查,改走 compare.upload → compare.page → open_web');
|
|
394
|
+
}
|
|
395
|
+
const compare = isRecord(body.contractCompare) ? body.contractCompare : {};
|
|
396
|
+
const changes = Array.isArray(compare.changes) ? compare.changes : [];
|
|
397
|
+
baseFileName = str(compare.basicFileName) || baseFileName;
|
|
398
|
+
compareFileName = str(compare.targetFileName) || compareFileName;
|
|
399
|
+
const stat = statOf(changes, num(compare.percentage), num(compare.serviceTime));
|
|
400
|
+
const templatePath = str(input.template).trim();
|
|
401
|
+
let template = DEFAULT_TEMPLATE;
|
|
402
|
+
if (templatePath) {
|
|
403
|
+
const abs = resolve(templatePath);
|
|
404
|
+
try {
|
|
405
|
+
template = readFileSync(abs, 'utf8');
|
|
406
|
+
}
|
|
407
|
+
catch (error) {
|
|
408
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
409
|
+
throw contractValidationError('template_not_found', `模板文件读取失败:${message}`);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
const html = renderCompareReport({ baseFileName, compareFileName, changes, stat, generatedAt: stampNow() }, template);
|
|
413
|
+
const outPath = resolve(str(input.out).trim());
|
|
414
|
+
mkdirSync(dirname(outPath), { recursive: true });
|
|
415
|
+
writeFileSync(outPath, html, 'utf8');
|
|
416
|
+
const dumpData = str(input.dumpData).trim();
|
|
417
|
+
let dumped = '';
|
|
418
|
+
if (dumpData) {
|
|
419
|
+
dumped = resolve(dumpData);
|
|
420
|
+
mkdirSync(dirname(dumped), { recursive: true });
|
|
421
|
+
writeFileSync(dumped, JSON.stringify({ baseFileName, compareFileName, stats: stat, changes: slimChanges(changes) }, null, 2), 'utf8');
|
|
422
|
+
}
|
|
423
|
+
return {
|
|
424
|
+
status: 'COMPLETE',
|
|
425
|
+
data: {
|
|
426
|
+
ok: true,
|
|
427
|
+
out: outPath,
|
|
428
|
+
stats: stat,
|
|
429
|
+
changes: slimChanges(changes),
|
|
430
|
+
htmlLength: Buffer.byteLength(html, 'utf8'),
|
|
431
|
+
...(dumped ? { dumpData: dumped } : {}),
|
|
432
|
+
note: '报告已落盘;交付方式为产物文件(present_files 登记)+ open_web 打开该文件的 file:/// 绝对路径(不出卡片)',
|
|
433
|
+
},
|
|
434
|
+
};
|
|
435
|
+
},
|
|
436
|
+
};
|
|
437
|
+
export const contractCompareReportOperations = [contractCompareReportOperation];
|
|
@@ -53,6 +53,8 @@ export const contractCompareOperations = [
|
|
|
53
53
|
for (const rawPath of paths) {
|
|
54
54
|
const path = requireNonEmptyString(rawPath, 'paths[]', 1000);
|
|
55
55
|
// 比对走独立 module,不能与审查/流程上传混用。
|
|
56
|
+
// 比对文件不属于任何合同流程,没有助手 URL 的 flowId,因此这里不带 prewarmFlowId:
|
|
57
|
+
// 预审预热自动跳过(预热与取结果必须用同一个动态 flowId,不能用固定值兜底)。
|
|
56
58
|
files.push(await uploadFile(host, { path, module: 'docCompared' }));
|
|
57
59
|
}
|
|
58
60
|
return {
|
|
@@ -3,6 +3,9 @@ import { dirname, resolve } from 'node:path';
|
|
|
3
3
|
import { contractValidationError } from '../errors.js';
|
|
4
4
|
import { readZip, rewriteZip } from '../ooxml/zip.js';
|
|
5
5
|
import { allTableGrids, collectRanges, deleteTableRows, insertTableRows, parseTables, paragraphText, setCellText, setParagraphText, } from '../ooxml/docx-table.js';
|
|
6
|
+
import { findMoneyPlaceholder, hasCurrencySymbol } from './money.js';
|
|
7
|
+
import { RESIDUE_PATTERNS, residueTextOfDocx, scanResidue } from './placeholder-scan.js';
|
|
8
|
+
import { assertQuoteRefsResolved, resolveQuoteRefs } from './quote-ref.js';
|
|
6
9
|
/**
|
|
7
10
|
* 模板位点扫描 + 按填充方案回填(2026-11-16 新增,模板驱动)。
|
|
8
11
|
*
|
|
@@ -475,9 +478,69 @@ function pickColumnValue(item, columnName) {
|
|
|
475
478
|
}
|
|
476
479
|
return null;
|
|
477
480
|
}
|
|
481
|
+
function describeIssues(issues) {
|
|
482
|
+
const head = issues
|
|
483
|
+
.slice(0, 5)
|
|
484
|
+
.map((issue) => `${issue.label}${issue.slotId ? `(${issue.slotId})` : ''}=${issue.value}`)
|
|
485
|
+
.join('、');
|
|
486
|
+
return issues.length > 5 ? `${head} 等 ${issues.length} 处` : head;
|
|
487
|
+
}
|
|
488
|
+
function auditPlanValues(plan, scannedSlots) {
|
|
489
|
+
const slotById = new Map(scannedSlots.map((slot) => [slot.slotId, slot]));
|
|
490
|
+
const placeholder = [];
|
|
491
|
+
const displayMoney = [];
|
|
492
|
+
const inspect = (slotId, label, value, isMoney) => {
|
|
493
|
+
if (value === null || value === undefined || value === '')
|
|
494
|
+
return;
|
|
495
|
+
const text = String(value);
|
|
496
|
+
// 占位符不论落在哪个位点都是事故:它只是模型侧的展示形态
|
|
497
|
+
const token = findMoneyPlaceholder(text);
|
|
498
|
+
if (token) {
|
|
499
|
+
placeholder.push({ slotId, label, value: text, placeholder: token });
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
// 形状保持的展示文本(¥144,000.00)无法与真实金额区分,只能在金额位点上拒收。
|
|
503
|
+
// 只拦货币符号:`144000元` 之类数字完整的写法含义唯一,拒收属误伤。
|
|
504
|
+
if (isMoney && hasCurrencySymbol(text)) {
|
|
505
|
+
displayMoney.push({ slotId, label, value: text, placeholder: null });
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
for (const slot of Array.isArray(plan.slots) ? plan.slots : []) {
|
|
509
|
+
const slotId = typeof slot?.slotId === 'string' ? slot.slotId : '';
|
|
510
|
+
if (!slotId)
|
|
511
|
+
continue;
|
|
512
|
+
const scanned = slotById.get(slotId);
|
|
513
|
+
inspect(slotId, scanned?.label ?? '未知位点', slot?.value, scanned?.constraint === 'money');
|
|
514
|
+
}
|
|
515
|
+
for (const detail of Array.isArray(plan.details) ? plan.details : []) {
|
|
516
|
+
const slotId = typeof detail?.slotId === 'string' ? detail.slotId : '';
|
|
517
|
+
const scanned = slotId ? slotById.get(slotId) : undefined;
|
|
518
|
+
const columns = scanned && scanned.type === 'detail-area' ? scanned.columns.map((column) => column.name) : [];
|
|
519
|
+
const label = scanned?.label ?? '明细区';
|
|
520
|
+
inspect(slotId, `${label}·小计`, detail?.subtotal ?? detail?.total, true);
|
|
521
|
+
for (const item of Array.isArray(detail?.items) ? detail.items : []) {
|
|
522
|
+
if (typeof item !== 'object' || item === null)
|
|
523
|
+
continue;
|
|
524
|
+
for (const [key, value] of Object.entries(item)) {
|
|
525
|
+
// 有模板列名时以列名语义为准;没有时退回按键名判语义(判不出按文本列,不误报)
|
|
526
|
+
const isMoney = columns.length > 0
|
|
527
|
+
? columns.some((name) => normalizeKey(name) === normalizeKey(key) && inferConstraint(name) === 'money')
|
|
528
|
+
: inferConstraint(key) === 'money';
|
|
529
|
+
inspect(slotId, `${label}·${key}`, value, isMoney);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
if (plan.totals && typeof plan.totals === 'object') {
|
|
534
|
+
inspect('totals.grandTotal', '合同总额', plan.totals.grandTotal, true);
|
|
535
|
+
const installments = Array.isArray(plan.totals.installments) ? plan.totals.installments : [];
|
|
536
|
+
installments.forEach((value, index) => {
|
|
537
|
+
inspect(`totals.installments[${index}]`, `第 ${index + 1} 期金额`, value, true);
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
return { placeholder, displayMoney };
|
|
541
|
+
}
|
|
478
542
|
/**
|
|
479
543
|
* 轻量 XML 良构校验(标签配对 + 残余栈),不依赖第三方解析库。
|
|
480
|
-
*
|
|
481
544
|
* 2026-11-16 实测教训:引擎曾对**标签已破碎、Word 打不开**的产物返回 `ok=true`——
|
|
482
545
|
* 因为回读只用正则抽 `<w:t>` 文本,不做结构校验,错误被完全掩盖。
|
|
483
546
|
* 因此把「产物必须是良构 XML」提升为独立交付判据,任何 FAIL 一律不得交付。
|
|
@@ -582,14 +645,23 @@ export const contractDocxSlotsOperations = [
|
|
|
582
645
|
if (!outInput)
|
|
583
646
|
throw contractValidationError('out_required', 'out(输出 docx 绝对路径)为必填');
|
|
584
647
|
const planInput = input.plan;
|
|
585
|
-
const
|
|
648
|
+
const planRaw = typeof planInput === 'string'
|
|
586
649
|
? (existsSync(resolve(planInput))
|
|
587
650
|
? JSON.parse(readFileSync(resolve(planInput), 'utf8').replace(/^\uFEFF/u, ''))
|
|
588
651
|
: (() => { throw contractValidationError('plan_not_found', `填充方案文件不存在:${planInput}`); })())
|
|
589
652
|
: planInput;
|
|
590
|
-
if (typeof
|
|
653
|
+
if (typeof planRaw !== 'object' || planRaw === null || Array.isArray(planRaw)) {
|
|
591
654
|
throw contractValidationError('plan_required', 'plan 必须是填充方案对象或其 JSON 文件路径');
|
|
592
655
|
}
|
|
656
|
+
// ── 值引用解析(2026-11-20 P1):plan 里任何位置都可以写
|
|
657
|
+
// {"$quote":"<报价书解析结果.json 绝对路径>#<字段路径>"},由本进程读真值填进来。
|
|
658
|
+
// 模型只需要说「取哪个字段」(结构不被脱敏),金额从头到尾不经过模型上下文。
|
|
659
|
+
// 必须在写前守卫之前完成,守卫才能对**解析后的真值**再做一次体检。
|
|
660
|
+
const refOutcome = resolveQuoteRefs(planRaw);
|
|
661
|
+
assertQuoteRefsResolved(refOutcome, (errors) => `填充方案有 ${errors.length} 处 $quote 引用取不到值:`
|
|
662
|
+
+ errors.slice(0, 5).map((item) => `${item.at}(${item.ref}:${item.reason})`).join(';')
|
|
663
|
+
+ '。请核对引用的文件路径与字段路径;报价书解析结果需先用 contract.quote.parse / contract.quote.normalize 的 out 参数落盘。');
|
|
664
|
+
const plan = refOutcome.value;
|
|
593
665
|
const strict = input.strict !== false;
|
|
594
666
|
const allowRowInsert = input.allowRowInsert !== false;
|
|
595
667
|
const slotWrites = Array.isArray(plan.slots) ? plan.slots : [];
|
|
@@ -597,6 +669,9 @@ export const contractDocxSlotsOperations = [
|
|
|
597
669
|
const unsupported = Array.isArray(plan.unsupported) ? plan.unsupported : [];
|
|
598
670
|
const totals = typeof plan.totals === 'object' && plan.totals !== null ? plan.totals : null;
|
|
599
671
|
let xml = readDocumentXml(templatePath);
|
|
672
|
+
const templateXml = xml;
|
|
673
|
+
// 位点清单只扫一次:写前用于守卫(哪些位点是金额约束),写后用于核对必填覆盖
|
|
674
|
+
const templateSlots = scanSlots(templateXml).slots;
|
|
600
675
|
const gridsBefore = allTableGrids(xml);
|
|
601
676
|
const tablesBefore = parseTables(xml).length;
|
|
602
677
|
const warnings = [];
|
|
@@ -606,6 +681,21 @@ export const contractDocxSlotsOperations = [
|
|
|
606
681
|
// 2026-11-16 实测:删 6 行后 3r17c1 / 3r18c1 / 3r21c1 全部写空,
|
|
607
682
|
// 回读报「位点不存在」,而 applied 仍把它们计入成功数,属双重静默失败。
|
|
608
683
|
const rowShifts = [];
|
|
684
|
+
// ── 阶段 0:写前守卫。必须在做任何写入之前判定,确保残次品根本不会落盘。
|
|
685
|
+
// 2026-11-20 事故:占位符被当成值写入,写后五项校验全过,残次品直接交付。
|
|
686
|
+
const audit = auditPlanValues(plan, templateSlots);
|
|
687
|
+
if (audit.placeholder.length > 0) {
|
|
688
|
+
throw contractValidationError('plan_value_placeholder', `填充方案有 ${audit.placeholder.length} 处脱敏占位符:${describeIssues(audit.placeholder)}。`
|
|
689
|
+
+ '占位符只是模型上下文里的展示形态,本地进程收到的是字面量、没有任何还原环节,'
|
|
690
|
+
+ '写进 docx 就会得到金额错误的合同,因此拒绝写入。'
|
|
691
|
+
+ '正确动作:改用报价单解析结果里的纯数值(如 809166.76 或 "809166.76")重写这些位点后重跑,'
|
|
692
|
+
+ '不要传 [[MONEY_*]];这不是「金额拿不到」,不要向用户索要金额。', { placeholder: audit.placeholder });
|
|
693
|
+
}
|
|
694
|
+
if (audit.displayMoney.length > 0) {
|
|
695
|
+
throw contractValidationError('plan_value_display_text', `填充方案有 ${audit.displayMoney.length} 处金额位点传的是带货币符号的展示文本:`
|
|
696
|
+
+ `${describeIssues(audit.displayMoney)}。展示文本与脱敏值无法区分、也不会被还原,`
|
|
697
|
+
+ '请改传纯数值(如 144000 或 "144000.00"),数值以报价单解析结果的 totals / sections 为准。', { displayMoney: audit.displayMoney });
|
|
698
|
+
}
|
|
609
699
|
// ── 阶段 1:明细区行数调整(插行 / 删行),必须在写单元格之前完成,否则行号会漂移
|
|
610
700
|
for (const detail of detailPlans) {
|
|
611
701
|
const parsed = typeof detail?.slotId === 'string' ? parseSlotId(detail.slotId) : null;
|
|
@@ -836,7 +926,7 @@ export const contractDocxSlotsOperations = [
|
|
|
836
926
|
const checks = [];
|
|
837
927
|
const fails = [];
|
|
838
928
|
// 5.1 必填位点必须已覆盖
|
|
839
|
-
const scanned =
|
|
929
|
+
const scanned = templateSlots;
|
|
840
930
|
const requiredSlots = scanned.filter((slot) => slot.required);
|
|
841
931
|
const covered = new Set([...applied]);
|
|
842
932
|
const uncovered = requiredSlots
|
|
@@ -972,6 +1062,22 @@ export const contractDocxSlotsOperations = [
|
|
|
972
1062
|
else {
|
|
973
1063
|
checks.push({ level: 'PASS', item: 'XML 良构', detail: '标签全部配对' });
|
|
974
1064
|
}
|
|
1065
|
+
// 5.8 占位符残留:交付硬判据(2026-11-20 新增)
|
|
1066
|
+
//
|
|
1067
|
+
// 前七项的语义都是「写进去了没有」——必填有值、回读一致、金额勾稽、结构未变、XML 良构。
|
|
1068
|
+
// 它们**都无法发现「写进去的值本身是占位符」**:占位符满足必填、写的等于读的、
|
|
1069
|
+
// 非数字直接跳过金额勾稽、结构也没变。2026-11-20 实测事故(付款表 4 行写成占位符文本)
|
|
1070
|
+
// 正是五项校验全过、残次品照常交付。因此交付前必须回读全文扫残留,命中即不得交付。
|
|
1071
|
+
const residue = scanResidue(residueTextOfDocx(readZip(readFileSync(outPath))));
|
|
1072
|
+
const residueKeys = Object.keys(residue);
|
|
1073
|
+
if (residueKeys.length > 0) {
|
|
1074
|
+
const summary = residueKeys.map((key) => `${key}×${residue[key]}`).join('、');
|
|
1075
|
+
fails.push(`占位符残留:${summary}`);
|
|
1076
|
+
checks.push({ level: 'FAIL', item: '占位符残留', detail: summary });
|
|
1077
|
+
}
|
|
1078
|
+
else {
|
|
1079
|
+
checks.push({ level: 'PASS', item: '占位符残留', detail: `0 处(清单 ${RESIDUE_PATTERNS.length} 项)` });
|
|
1080
|
+
}
|
|
975
1081
|
const validateOk = fails.length === 0;
|
|
976
1082
|
return {
|
|
977
1083
|
status: 'COMPLETE',
|
|
@@ -987,11 +1093,12 @@ export const contractDocxSlotsOperations = [
|
|
|
987
1093
|
detailAdjust,
|
|
988
1094
|
rowShifts,
|
|
989
1095
|
details: detailResults,
|
|
1096
|
+
resolvedQuoteRefs: refOutcome.resolved,
|
|
990
1097
|
validate: { ok: validateOk, checks, fails },
|
|
991
1098
|
selfCheckPassed: validateOk,
|
|
992
1099
|
selfCheck: fails,
|
|
993
1100
|
note: validateOk
|
|
994
|
-
? `通过:${applied.length}
|
|
1101
|
+
? `通过:${applied.length} 个位点写入,必填覆盖、回读一致、金额勾稽、表结构、XML 良构与占位符残留校验均通过`
|
|
995
1102
|
: '不通过:见 validate.fails;未通过校验的产物不得交付',
|
|
996
1103
|
},
|
|
997
1104
|
};
|