weaver-work-cli 0.1.73 → 0.1.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -1
- package/dist/chunks/{archive-THZV4ND4.js → archive-OZJ6PYUR.js} +14 -9
- package/dist/chunks/{archive-oa-PQ23OLEV.js → archive-oa-BHL5RK2F.js} +10 -7
- package/dist/chunks/{asset-RGPROZYH.js → asset-HKRFRQR2.js} +10 -7
- package/dist/chunks/{asset-idle-Z2PDX7NA.js → asset-idle-GGIR4KE7.js} +7 -4
- package/dist/chunks/{attachment-content-R3RPVOYE.js → attachment-content-4OV65NK5.js} +3 -3
- package/dist/chunks/{blog-7U3QZPIF.js → blog-HYDP4DV3.js} +10 -7
- package/dist/chunks/{caizhilian-3AB42GCV.js → caizhilian-JS4RQZ6Z.js} +10 -7
- package/dist/chunks/{calendar-KINM64E4.js → calendar-SWRY4DIT.js} +10 -7
- package/dist/chunks/chunk-257JXJGD.js +30 -0
- package/dist/chunks/{chunk-LLCMOZ5L.js → chunk-2AUFKU2D.js} +11 -11
- package/dist/chunks/chunk-2BZ7TY4M.js +49 -0
- package/dist/chunks/{chunk-WM33BSIL.js → chunk-2QCCXPNU.js} +1 -1
- package/dist/chunks/{chunk-TV46Q4NY.js → chunk-4FCBEWNB.js} +74 -68
- package/dist/chunks/{chunk-NUP4RYZK.js → chunk-5D2V7ZAN.js} +2 -2
- package/dist/chunks/{chunk-DRUND2PJ.js → chunk-5QUTQHXF.js} +225 -152
- package/dist/chunks/{chunk-4BXR6CNB.js → chunk-5ZJGPEIB.js} +2 -2
- package/dist/chunks/chunk-7DE3VMZD.js +35 -0
- package/dist/chunks/chunk-BNKUHN4N.js +1346 -0
- package/dist/chunks/{chunk-2CHGUYMG.js → chunk-BSR5TM7U.js} +4 -4
- package/dist/chunks/{chunk-4I26YMBY.js → chunk-ERZY6GYL.js} +7 -3
- package/dist/chunks/{chunk-4YXAK6OA.js → chunk-FEZK536Z.js} +12 -7
- package/dist/chunks/{chunk-F4HM25K4.js → chunk-I6NOHKEK.js} +1 -1
- package/dist/chunks/{chunk-JMJBPP4B.js → chunk-J7FAAHWH.js} +2 -2
- package/dist/chunks/{chunk-54ST55IJ.js → chunk-JJONWB5N.js} +11 -1
- package/dist/chunks/chunk-JOY3HZXL.js +467 -0
- package/dist/chunks/{chunk-GWJLAF6B.js → chunk-JWF2R6EQ.js} +0 -462
- package/dist/chunks/{chunk-BWYVS62Z.js → chunk-KEA4XQPO.js} +4 -4
- package/dist/chunks/chunk-KINXYJXM.js +205 -0
- package/dist/chunks/{chunk-IBSJJGXL.js → chunk-KWJEICD4.js} +2 -2
- package/dist/chunks/{chunk-GAMGDNTF.js → chunk-LJI4N6FV.js} +1 -1
- package/dist/chunks/{chunk-IU6UB2TD.js → chunk-MXCRKXOP.js} +48 -6
- package/dist/chunks/{chunk-PAFOLIYQ.js → chunk-NWYHCZTY.js} +1 -1
- package/dist/chunks/chunk-OJ4JPD25.js +428 -0
- package/dist/chunks/{chunk-L7TYG5SN.js → chunk-OQCK5SAU.js} +2 -2
- package/dist/chunks/chunk-PG5YSNYY.js +1166 -0
- package/dist/chunks/{chunk-XZBYRYWX.js → chunk-QJWVYOOV.js} +2 -2
- package/dist/chunks/{chunk-AMAPQVBT.js → chunk-QVKRNL7L.js} +286 -305
- package/dist/chunks/chunk-SU6IJD6D.js +49 -0
- package/dist/chunks/{chunk-ZWLWXHJC.js → chunk-TA2RBUTH.js} +2 -2
- package/dist/chunks/{chunk-6HT73VOI.js → chunk-U6Y32KEV.js} +2 -2
- package/dist/chunks/chunk-UUJK76HV.js +209 -0
- package/dist/chunks/{chunk-R3MK2RBN.js → chunk-VOMDD2C5.js} +1 -1
- package/dist/chunks/chunk-Y3C6MDL7.js +28 -0
- package/dist/chunks/chunk-ZM7RN2IM.js +38 -0
- package/dist/chunks/{chunk-2XED2FKY.js → chunk-ZUB4M4N3.js} +38 -36
- package/dist/chunks/{chunk-7QFVXP2X.js → chunk-ZWIMLT6P.js} +8 -7
- package/dist/chunks/cli-FULPXIKJ.js +226 -0
- package/dist/chunks/commands-BNWFNTD3.js +70 -0
- package/dist/chunks/{conflict-VPAR7E6F.js → conflict-5BKCDV2F.js} +2 -2
- package/dist/chunks/{contract-DDXAO2DZ.js → contract-WI23OXVC.js} +12446 -5964
- package/dist/chunks/{cowork-34QCHMDD.js → cowork-DZBBVNMQ.js} +11 -8
- package/dist/chunks/{create-flow-52PU2OBI.js → create-flow-7ZRBRKX7.js} +6 -6
- package/dist/chunks/{data-CLQ62QGD.js → data-PAZVE6QE.js} +6 -3
- package/dist/chunks/{ebuilder-form-W5R7Q22S.js → ebuilder-form-5SQXIGXN.js} +9 -6
- package/dist/chunks/{ehr-LCNAVMK5.js → ehr-CX5F4ZAU.js} +23 -16
- package/dist/chunks/{entry-mode-6Z3ZV3DE.js → entry-mode-I2BYNONZ.js} +3 -3
- package/dist/chunks/{env-RDKWAARB.js → env-ZAQZ7EHN.js} +2 -2
- package/dist/chunks/{esb-ANKPUU65.js → esb-DQTXDIBF.js} +10 -7
- package/dist/chunks/{factory-434B7RAT.js → factory-XRI6KZ7H.js} +1 -1
- package/dist/chunks/{fna-AKBSG5HI.js → fna-FK6HQVJL.js} +13 -8
- package/dist/chunks/{group-chat-PROTW22R.js → group-chat-MLWNYM2P.js} +3 -3
- package/dist/chunks/{host-WO4L5G5I.js → host-3EPREGXS.js} +6 -3
- package/dist/chunks/{host-XIYG4F4B.js → host-J74JGYAW.js} +6 -3
- package/dist/chunks/{host-7FJW4E7R.js → host-KUMU3DDK.js} +6 -3
- package/dist/chunks/{host-5R2SNFWD.js → host-MEC4VQZA.js} +6 -3
- package/dist/chunks/{host-PDJAKCT7.js → host-T6NNQGVZ.js} +6 -3
- package/dist/chunks/{host-CGXUFQO4.js → host-VI7Q45PM.js} +6 -3
- package/dist/chunks/{hrm-WGODDTEH.js → hrm-KKVAW4P5.js} +8 -5
- package/dist/chunks/{im-YKTKAJU3.js → im-47CIWQNL.js} +7 -4
- package/dist/chunks/{invoice-PVYCCCVM.js → invoice-CDYRBNIG.js} +21 -16
- package/dist/chunks/{jiuchuanhui-RKOQW7BY.js → jiuchuanhui-M7QTRHZK.js} +17 -10
- package/dist/chunks/{lazy-dispatch-DW45AFQ5.js → lazy-dispatch-FKQJZFI5.js} +22 -8
- package/dist/chunks/{mail-BNB5S4NW.js → mail-NRBS5N6Y.js} +11 -8
- package/dist/chunks/{meeting-O2KDJH66.js → meeting-WC5LD3IO.js} +22 -18
- package/dist/chunks/{minute-doc-JUCG56GY.js → minute-doc-OQUMDTKG.js} +4 -4
- package/dist/chunks/{okr-LWFGWOE7.js → okr-EHKSKMPL.js} +10 -7
- package/dist/chunks/{operations-532PN5OB.js → operations-V5VM5MS2.js} +7 -4
- package/dist/chunks/{performance-7W5COCFU.js → performance-ZJADXJPN.js} +6 -3
- package/dist/chunks/{plan-ZVY3IYTL.js → plan-OTDNBDJ7.js} +10 -7
- package/dist/chunks/{project-SA62B7MH.js → project-4XVBQ3HX.js} +10 -7
- package/dist/chunks/{reception-NGIONPQ3.js → reception-3FAHOOH7.js} +8 -4
- package/dist/chunks/{recruit-stage-WOSN6MGP.js → recruit-stage-3WTVWW2K.js} +199 -74
- package/dist/chunks/register-SQOPIR2G.js +16 -0
- package/dist/chunks/{registry-R72GWXOG.js → registry-F4YFZLOD.js} +7 -3
- package/dist/chunks/registry-NBTBXR4L.js +30 -0
- package/dist/chunks/{registry-N7P3W2RD.js → registry-TJGCVRCW.js} +7 -4
- package/dist/chunks/{room-recommend-KCGIVUFR.js → room-recommend-KL62XB2Y.js} +4 -4
- package/dist/chunks/root-YZG2TS5W.js +16 -0
- package/dist/chunks/{schedule-6UP27HQ4.js → schedule-XOISYUPB.js} +4 -4
- package/dist/chunks/{smart-extract-DDOQSPRB.js → smart-extract-UYGNV3BM.js} +15 -7
- package/dist/chunks/update-AV5VOXGY.js +13 -0
- package/dist/chunks/{workflow-V5ALD6QZ.js → workflow-V54LJPXL.js} +15 -10
- package/dist/cli.js +40 -0
- package/dist/cmd/action.js +3 -1
- package/dist/cmd/doctor/index.js +1 -1
- package/dist/cmd/e10/index.js +1 -1
- package/dist/cmd/identity/index.js +5 -8
- package/dist/cmd/index.js +2 -0
- package/dist/cmd/setup/index.js +1 -1
- package/dist/cmd/update/index.js +38 -0
- package/dist/core/manifest-view.js +1 -1
- package/dist/core/output.js +8 -1
- package/dist/core/runtime-agent.js +13 -0
- package/dist/core/update-notice.js +23 -0
- package/dist/index.js +105 -198
- package/dist/internal/e10/auth/agent-host-key.js +16 -0
- package/dist/internal/e10/auth/agent-hosts.js +45 -9
- package/dist/internal/e10/auth/commands.js +66 -36
- package/dist/internal/e10/auth/session.js +30 -15
- package/dist/internal/e10/auth/xiaoe.js +4 -20
- package/dist/internal/e10/auth-recovery.js +44 -4
- package/dist/internal/e10/context.js +5 -2
- package/dist/internal/update/bootstrap.js +96 -0
- package/dist/internal/update/npm.js +78 -0
- package/dist/internal/update/service.js +252 -0
- package/dist/internal/update/store.js +135 -0
- package/dist/shortcuts/archive/index.js +2 -2
- package/dist/shortcuts/archive/manifest.js +1 -0
- package/dist/shortcuts/archive/operations/search.js +3 -1
- package/dist/shortcuts/archive-oa/index.js +1 -1
- package/dist/shortcuts/asset/index.js +1 -1
- package/dist/shortcuts/asset-idle/index.js +1 -1
- package/dist/shortcuts/blog/index.js +1 -1
- package/dist/shortcuts/caizhilian/index.js +1 -1
- package/dist/shortcuts/calendar/index.js +1 -1
- package/dist/shortcuts/contract/data/bi-config.js +156 -0
- package/dist/shortcuts/contract/data/collection-ledger-html.js +189 -0
- package/dist/shortcuts/contract/data/collection-node-catalog.js +226 -0
- package/dist/shortcuts/contract/data/metric-catalog.js +154 -20
- package/dist/shortcuts/contract/data/report-renderers.js +414 -0
- package/dist/shortcuts/contract/data/report-spec.js +132 -0
- package/dist/shortcuts/contract/error-actions.js +114 -0
- package/dist/shortcuts/contract/host.js +12 -3
- package/dist/shortcuts/contract/index.js +17 -1
- package/dist/shortcuts/contract/manifest.js +398 -3
- package/dist/shortcuts/contract/ooxml/docx-table.js +48 -0
- package/dist/shortcuts/contract/operations/bi-preview.js +131 -0
- package/dist/shortcuts/contract/operations/bizreview-report.js +496 -0
- package/dist/shortcuts/contract/operations/collection-node.js +229 -0
- package/dist/shortcuts/contract/operations/docx-slots.js +735 -16
- package/dist/shortcuts/contract/operations/draft-build.js +940 -0
- package/dist/shortcuts/contract/operations/draft-submit.js +229 -0
- package/dist/shortcuts/contract/operations/first-screen.js +3 -2
- package/dist/shortcuts/contract/operations/generated-submit.js +175 -0
- package/dist/shortcuts/contract/operations/ledger-report.js +233 -0
- package/dist/shortcuts/contract/operations/ledger-stat.js +1400 -0
- package/dist/shortcuts/contract/operations/ledger.js +4 -1
- package/dist/shortcuts/contract/operations/metrics.js +9 -3
- package/dist/shortcuts/contract/operations/ops-draft.js +527 -0
- package/dist/shortcuts/contract/operations/page.js +9 -0
- package/dist/shortcuts/contract/operations/quote-submit.js +55 -229
- package/dist/shortcuts/contract/operations/registry.js +20 -0
- package/dist/shortcuts/contract/operations/sign-launch.js +256 -0
- package/dist/shortcuts/contract/operations/viewlink.js +334 -0
- package/dist/shortcuts/cowork/index.js +2 -2
- package/dist/shortcuts/ebuilder-form/index.js +1 -1
- package/dist/shortcuts/ehr/index.js +2 -2
- package/dist/shortcuts/ehr/manifest.js +1 -1
- package/dist/shortcuts/ehr/operations/recruit-position.js +7 -2
- package/dist/shortcuts/ehr/operations/recruit-write.js +7 -6
- package/dist/shortcuts/ehr/operations/recruit.js +318 -248
- package/dist/shortcuts/ehr/operations/shared.js +22 -2
- package/dist/shortcuts/esb/index.js +1 -1
- package/dist/shortcuts/fna/index.js +1 -1
- package/dist/shortcuts/fna/manifest.js +1 -0
- package/dist/shortcuts/fna/operations/expense-chart.js +3 -1
- package/dist/shortcuts/hrm/index.js +1 -1
- package/dist/shortcuts/invoice/index.js +1 -1
- package/dist/shortcuts/jiuchuanhui/index.js +2 -2
- package/dist/shortcuts/jiuchuanhui/manifest.js +3 -0
- package/dist/shortcuts/mail/index.js +2 -2
- package/dist/shortcuts/meeting/index.js +1 -1
- package/dist/shortcuts/meeting/manifest.js +1 -0
- package/dist/shortcuts/meeting/operations/eb/catalog.js +5 -3
- package/dist/shortcuts/meeting/operations/eb/conflict.js +3 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +10 -9
- package/dist/shortcuts/meeting/operations/eb/factory.js +2 -0
- package/dist/shortcuts/meeting/operations/eb/member-expand.js +3 -2
- package/dist/shortcuts/meeting/operations/invitation-publish.js +3 -3
- package/dist/shortcuts/meeting/operations/invitation.js +4 -4
- package/dist/shortcuts/meeting/operations/link.js +3 -1
- package/dist/shortcuts/okr/index.js +1 -1
- package/dist/shortcuts/performance/index.js +1 -1
- package/dist/shortcuts/plan/index.js +1 -1
- package/dist/shortcuts/project/index.js +1 -1
- package/dist/shortcuts/reception/manifest.js +2 -2
- package/dist/shortcuts/recruit-stage/context.js +10 -2
- package/dist/shortcuts/recruit-stage/index.js +16 -3
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +1 -1
- package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +1 -1
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +17 -8
- package/dist/shortcuts/recruit-stage/operations/list.js +1 -1
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +178 -35
- package/dist/shortcuts/recruit-stage/operations/search.js +2 -2
- package/dist/shortcuts/recruit-stage/operations/shortlist.js +4 -2
- package/dist/shortcuts/recruit-stage/shared.js +27 -53
- package/dist/shortcuts/smart-extract/manifest.js +1 -0
- package/dist/shortcuts/smart-extract/operations/fill.js +7 -2
- package/dist/shortcuts/smart-extract/operations/validate.js +4 -1
- package/dist/shortcuts/workflow/index.js +2 -2
- package/dist/shortcuts/workflow/manifest.js +1 -0
- package/dist/shortcuts/workflow/operations/aiDeepRead/render.js +4 -1
- package/dist/shortcuts/workflow/operations/deepRead.js +23 -2
- package/dist/shortcuts/workflow/operations/form.js +8 -2
- package/docs/contract.md +6 -1
- package/docs/e10-auth.md +25 -7
- package/docs/operation-manual.md +15 -0
- package/package.json +2 -2
- package/scripts/pysite/__pycache__/sitecustomize.cpython-314.pyc +0 -0
- package/skill-template/business-info.json +28 -0
- package/skill-template/domains/jinchengda.md +13 -1
- package/skills/weaver-e10-archive-oa/references/source-manifest.json +3 -3
- package/skills/weaver-e10-caizhilian/references/auth-and-install.md +2 -1
- package/skills/weaver-e10-caizhilian/references/source-manifest.json +3 -3
- package/skills/weaver-e10-esb/references/source-manifest.json +3 -3
- package/skills/weaver-e10-jinchengda/SKILL.md +90 -32
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +45 -0
- package/skills/weaver-e10-jinchengda/references/contract-bizreview-report-template.html +68 -0
- package/skills/weaver-e10-jinchengda/references/contract-bizreview.md +216 -0
- package/skills/weaver-e10-jinchengda/references/contract-clause-negotiate.md +215 -0
- package/skills/weaver-e10-jinchengda/references/contract-collection-node.md +113 -0
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +19 -3
- package/skills/weaver-e10-jinchengda/references/contract-decisions.md +114 -0
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +53 -44
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-firstscreen-guide.md +200 -0
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +18 -1
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +138 -3
- package/skills/weaver-e10-jinchengda/references/contract-ledger-report.md +158 -0
- package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +3 -1
- package/skills/weaver-e10-jinchengda/references/contract-material-gap.md +139 -0
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +10 -3
- package/skills/weaver-e10-jinchengda/references/contract-ops-draft.md +106 -0
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +176 -56
- package/skills/weaver-e10-jinchengda/references/contract-sign-launch.md +123 -0
- package/skills/weaver-e10-jinchengda/references/contract-smart-draft.md +410 -0
- package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-viewlink.md +110 -0
- package/skills/weaver-e10-jinchengda/references/orchestration.md +38 -24
- package/skills/weaver-e10-meeting/SKILL.md +13 -0
- package/skills/weaver-e10-okr/SKILL.md +11 -0
- package/skills/weaver-e10-okr/references/source-manifest.json +7 -6
- package/skills/weaver-e10-performance/SKILL.md +131 -39
- package/skills/weaver-e10-performance/agents/openai.yaml +48 -17
- package/skills/weaver-e10-performance/references/default-assembly.md +3 -0
- package/skills/weaver-e10-performance/references/extraction-guide.md +17 -3
- package/skills/weaver-e10-performance/references/flow-assess.md +38 -5
- package/skills/weaver-e10-performance/references/scheme-setting-page.md +20 -3
- package/skills/weaver-e10-performance/scripts/assemble_scheme.py +461 -0
- package/skills/weaver-e10-performance/scripts/parse_appraisal_doc.py +41 -0
- package/skills/weaver-e10-plan/SKILL.md +10 -0
- package/skills/weaver-e10-plan/references/source-manifest.json +13 -13
- package/skills/weaver-e10-qiyecheng/SKILL.md +2 -2
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +9 -9
- package/skills/weaver-e10-recruit-stage/SKILL.md +188 -169
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +55 -37
- package/skills/weaver-e10-recruit-stage/lib/interview-conflict.mjs +3 -0
- package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +168 -35
- package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +175 -7
- package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +3 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +15 -1
- package/skills/weaver-e10-recruit-stage/lib/report-attachment.mjs +38 -0
- package/skills/weaver-e10-recruit-stage/lib/xiaoe-session.mjs +5 -1
- package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/env-ziyong.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +12 -8
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +16 -11
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +10 -6
- package/skills/weaver-e10-recruit-stage/references/recruit-check-install.md +5 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-detail-process.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +7 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-failure-fallback.md +6 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +7 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +31 -23
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-template.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +5 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +16 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-my-positions.md +6 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +147 -34
- package/skills/weaver-e10-recruit-stage/references/recruit-platform-compat.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +16 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-creator.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +8 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +6 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +24 -15
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +7 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +7 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +8 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +5 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +5 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +5 -1
- package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +41 -28
- package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +23 -26
- package/skills/weaver-e10-recruit-stage/templates/match-report.html +32 -30
- package/skills/weaver-e10-shared/SKILL.md +40 -5
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +11 -1
- package/skills/weaver-e10-shared/references/json-output-contract.md +144 -8
- package/skills/weaver-e10-shared/references/weaver-e10-installation.md +11 -0
- package/skills/weaver-e10-shijingran/references/source-manifest.json +3 -3
- package/skills/weaver-e10-wenshuding/references/source-manifest.json +3 -3
- package/skills/weaver-e10-workflow/references/source-manifest.json +3 -3
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +5 -5
- package/dist/chunks/chunk-ICP53R52.js +0 -2849
- package/dist/chunks/registry-RIQ67ZT7.js +0 -27
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { dirname } from 'node:path';
|
|
3
|
+
import { contractValidationError } from '../errors.js';
|
|
4
|
+
const PREVIEW_PATH = '/api/analyze/designer/bi/component/chart/previewData';
|
|
5
|
+
function isRecord(value) {
|
|
6
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
7
|
+
}
|
|
8
|
+
function parseConfig(value) {
|
|
9
|
+
if (typeof value === 'string') {
|
|
10
|
+
const text = value.trim();
|
|
11
|
+
if (!text)
|
|
12
|
+
throw contractValidationError('config_required', 'config 不能为空');
|
|
13
|
+
try {
|
|
14
|
+
JSON.parse(text);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
throw contractValidationError('config_invalid', 'config 必须是合法 JSON(或其字符串)');
|
|
18
|
+
}
|
|
19
|
+
return text;
|
|
20
|
+
}
|
|
21
|
+
if (isRecord(value) || Array.isArray(value))
|
|
22
|
+
return JSON.stringify(value);
|
|
23
|
+
throw contractValidationError('config_required', 'config 必须是 BI 组件配置对象或其 JSON 字符串');
|
|
24
|
+
}
|
|
25
|
+
/** BI 响应里出现这些字段就说明业务失败,不能当成功返回。 */
|
|
26
|
+
function assertBiResult(value) {
|
|
27
|
+
if (!isRecord(value)) {
|
|
28
|
+
throw contractValidationError('bi_response_invalid', 'BI 接口返回的不是 JSON 对象');
|
|
29
|
+
}
|
|
30
|
+
const root = value;
|
|
31
|
+
const code = root.code ?? root.status;
|
|
32
|
+
const failed = root.success === false || root.ok === false
|
|
33
|
+
|| (code !== undefined && code !== 0 && code !== 200 && code !== '0' && code !== '200');
|
|
34
|
+
if (failed) {
|
|
35
|
+
const message = root.msg ?? root.message ?? root.errorMsg ?? 'BI 接口返回业务失败';
|
|
36
|
+
throw contractValidationError('bi_business_error', String(message), { code });
|
|
37
|
+
}
|
|
38
|
+
return root;
|
|
39
|
+
}
|
|
40
|
+
/** 从配置里兜底取数据集上下文(用户通常只从页面复制 config)。 */
|
|
41
|
+
function inferFromConfig(configText) {
|
|
42
|
+
try {
|
|
43
|
+
const config = JSON.parse(configText);
|
|
44
|
+
const dataset = isRecord(config.dataset) ? config.dataset : {};
|
|
45
|
+
return {
|
|
46
|
+
dataSetId: typeof dataset.dataSetId === 'string' ? dataset.dataSetId : undefined,
|
|
47
|
+
analyzeId: typeof dataset.analyzeId === 'string' ? dataset.analyzeId : undefined,
|
|
48
|
+
datasetAppId: typeof dataset.appId === 'string' ? dataset.appId : undefined,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return {};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export const contractLedgerBiOperation = {
|
|
56
|
+
name: 'contract.ledger.bi',
|
|
57
|
+
risk: 'read',
|
|
58
|
+
inputSchema: {
|
|
59
|
+
type: 'object',
|
|
60
|
+
additionalProperties: false,
|
|
61
|
+
properties: {
|
|
62
|
+
pageId: { type: 'string', minLength: 1, description: 'BI 组件的 pageId(组件预览地址里的 pageId 参数)' },
|
|
63
|
+
config: {
|
|
64
|
+
anyOf: [{ type: 'string' }, { type: 'object' }],
|
|
65
|
+
description: 'BI 组件配置:可从 BI 设计器页面的 previewData 请求体里复制(dataset / filter / measures / dimensions)',
|
|
66
|
+
},
|
|
67
|
+
dataSetId: { type: 'string', description: '数据集 ID;不给则从 config.dataset.dataSetId 推断' },
|
|
68
|
+
analyzeId: { type: 'string', description: '分析 ID;不给则从 config.dataset.analyzeId 推断' },
|
|
69
|
+
datasetAppId: { type: 'string', description: 'datasetAppId,默认 846297243998732291' },
|
|
70
|
+
filter: { type: 'string', description: '页面级筛选 JSON 字符串,默认 []' },
|
|
71
|
+
page: { type: 'string', description: '页面参数,浏览器实测值为 [object Object];默认原样带' },
|
|
72
|
+
isBiAnalyzeCom: { type: 'boolean', description: '默认 true(与浏览器一致)' },
|
|
73
|
+
out: { type: 'string', maxLength: 4096, description: '把 BI 原始响应写到该路径(响应较大时用它取全量)' },
|
|
74
|
+
timeoutMs: { type: 'integer', minimum: 1000, maximum: 120000, description: '单次请求超时,默认 30000' },
|
|
75
|
+
},
|
|
76
|
+
required: ['pageId', 'config'],
|
|
77
|
+
},
|
|
78
|
+
async execute(input, context) {
|
|
79
|
+
const pageId = String(input.pageId).trim();
|
|
80
|
+
if (!pageId)
|
|
81
|
+
throw contractValidationError('page_id_required', 'pageId 必填');
|
|
82
|
+
const configText = parseConfig(input.config);
|
|
83
|
+
const inferred = inferFromConfig(configText);
|
|
84
|
+
const dataSetId = typeof input.dataSetId === 'string' && input.dataSetId ? input.dataSetId : inferred.dataSetId;
|
|
85
|
+
const analyzeId = typeof input.analyzeId === 'string' && input.analyzeId ? input.analyzeId : inferred.analyzeId;
|
|
86
|
+
const datasetAppId = typeof input.datasetAppId === 'string' && input.datasetAppId
|
|
87
|
+
? input.datasetAppId
|
|
88
|
+
: inferred.datasetAppId ?? '846297243998732291';
|
|
89
|
+
const form = new URLSearchParams();
|
|
90
|
+
form.set('pageId', pageId);
|
|
91
|
+
form.set('page', typeof input.page === 'string' && input.page ? input.page : '[object Object]');
|
|
92
|
+
form.set('datasetAppId', datasetAppId);
|
|
93
|
+
form.set('config', configText);
|
|
94
|
+
form.set('filter', typeof input.filter === 'string' && input.filter ? input.filter : '[]');
|
|
95
|
+
form.set('isBiAnalyzeCom', input.isBiAnalyzeCom === false ? 'false' : 'true');
|
|
96
|
+
if (dataSetId)
|
|
97
|
+
form.set('dataSetId', dataSetId);
|
|
98
|
+
if (analyzeId)
|
|
99
|
+
form.set('analyzeId', analyzeId);
|
|
100
|
+
const raw = await context.host.contractRequest({
|
|
101
|
+
method: 'POST',
|
|
102
|
+
path: PREVIEW_PATH,
|
|
103
|
+
query: { pageId },
|
|
104
|
+
form,
|
|
105
|
+
headers: { accept: 'application/json, text/plain, */*' },
|
|
106
|
+
okOnHttpSuccess: true,
|
|
107
|
+
timeoutMs: typeof input.timeoutMs === 'number' ? input.timeoutMs : 30_000,
|
|
108
|
+
});
|
|
109
|
+
const parsed = assertBiResult(raw);
|
|
110
|
+
const warnings = [];
|
|
111
|
+
if (!dataSetId)
|
|
112
|
+
warnings.push('未拿到 dataSetId:BI 接口可能返回空结果,请显式传 dataSetId 或在 config.dataset 里带上');
|
|
113
|
+
if (!analyzeId)
|
|
114
|
+
warnings.push('未拿到 analyzeId:同上');
|
|
115
|
+
if (typeof input.out === 'string' && input.out) {
|
|
116
|
+
mkdirSync(dirname(input.out), { recursive: true });
|
|
117
|
+
writeFileSync(input.out, `${JSON.stringify(parsed, null, 2)}\n`, 'utf8');
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
status: 'COMPLETE',
|
|
121
|
+
data: {
|
|
122
|
+
pageId,
|
|
123
|
+
context: { dataSetId: dataSetId ?? null, analyzeId: analyzeId ?? null, datasetAppId },
|
|
124
|
+
response: parsed,
|
|
125
|
+
topKeys: Object.keys(parsed),
|
|
126
|
+
...(typeof input.out === 'string' && input.out ? { out: input.out } : {}),
|
|
127
|
+
warnings,
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
};
|
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, resolve } from 'node:path';
|
|
3
|
+
import { contractValidationError } from '../errors.js';
|
|
4
|
+
/**
|
|
5
|
+
* 合同商务审核报告渲染器(本地,零依赖):`contract.bizreview.report`。
|
|
6
|
+
*
|
|
7
|
+
* 定位(与 `contract.review.report` 的分工):
|
|
8
|
+
* - `contract.review.report` = **风险审查**(引擎侧 `sclx=8` 结论:这份合同有什么风险);
|
|
9
|
+
* - `contract.bizreview.report` = **商务审核 · 完备性检查**(模型侧判定:这份合同**说没说清楚**、
|
|
10
|
+
* 主体 / 金额 / 交付 / 付款等要素**齐不齐**,缺什么、哪句话有歧义、哪里要删)。
|
|
11
|
+
*
|
|
12
|
+
* 约定:
|
|
13
|
+
* - `data` 必填:模型按合同正文判出的结构化结论(items / passed),本 operation 不判风险、不读正文;
|
|
14
|
+
* - `out` 必填:只以 HTML 产物文件交付,不出卡片、不注入面板;
|
|
15
|
+
* - `action` 三态归一:补充 / 修改 / 删除(另有「核对」用于必须人工确认但无法自动判定的项);
|
|
16
|
+
* - 每条必须能落到**原文位置**(`location`)与**原文摘录**(`original`),报告据此对照修改;
|
|
17
|
+
* - 输出 HTML 内**不得出现双引号**(与风险审查报告同一纪律,由 lint 兜底);
|
|
18
|
+
* - 模板内嵌在源码中:CLI 以 npm 包装安装后 `dist/` 与 `skills/` 相对位置不稳定,
|
|
19
|
+
* 依赖外部模板文件会在打包场景下静默失效;显式传 `template` 才读外部文件
|
|
20
|
+
* (`skills/weaver-e10-jinchengda/references/contract-bizreview-report-template.html` 与之互为镜像)。
|
|
21
|
+
*/
|
|
22
|
+
const DEFAULT_TEMPLATE = `<section id='{{CARD_ID}}' style='padding:16px 18px;font-family:sans-serif;background:#fafbfd;border-radius:12px'>
|
|
23
|
+
|
|
24
|
+
<div style='margin-bottom:16px'>
|
|
25
|
+
<div style='font-size:17px;font-weight:700;color:#1f2430'>合同商务审核报告 · 完备性检查</div>
|
|
26
|
+
<div style='font-size:12px;color:#7a8497;margin-top:4px'>{{CONTRACT_NAME}}</div>
|
|
27
|
+
<div style='font-size:12px;color:#7a8497;margin-top:2px'>审核口径:合同是否把主体 / 金额 / 交付 / 付款等要素说清楚、说齐全;逐条给出补充、修改或删除建议</div>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div style='background:#fff;border:1px solid #e8ebf2;border-radius:12px;padding:16px;margin-bottom:14px'>
|
|
31
|
+
<div style='font-size:14px;font-weight:700;color:#1f2430;margin-bottom:12px'>审核基本信息</div>
|
|
32
|
+
<table style='border-collapse:collapse;width:100%;font-size:13px'>{{TINFO}}</table>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div style='font-size:14px;font-weight:700;color:#1f2430;margin:0 0 10px 2px'>检查统计</div>
|
|
36
|
+
<div style='display:flex;gap:12px;margin-bottom:12px;flex-wrap:wrap'>
|
|
37
|
+
<div style='flex:1;min-width:130px;background:#fff;border:1px solid #e8ebf2;border-radius:12px;padding:16px;text-align:center'>
|
|
38
|
+
<div style='font-size:26px;font-weight:700;color:#1f2430'>{{STAT_TOTAL}}</div>
|
|
39
|
+
<div style='font-size:12px;color:#7a8497;margin-top:4px'>检查要素总数</div>
|
|
40
|
+
</div>
|
|
41
|
+
<div style='flex:1;min-width:130px;background:#fff;border:1px solid #e8ebf2;border-radius:12px;padding:16px;text-align:center'>
|
|
42
|
+
<div style='font-size:26px;font-weight:700;color:#b45309'>{{STAT_PENDING}}</div>
|
|
43
|
+
<div style='font-size:12px;color:#7a8497;margin-top:4px'>待补充完善</div>
|
|
44
|
+
</div>
|
|
45
|
+
<div style='flex:1;min-width:130px;background:#fff;border:1px solid #e8ebf2;border-radius:12px;padding:16px;text-align:center'>
|
|
46
|
+
<div style='font-size:26px;font-weight:700;color:#1a9c5b'>{{STAT_PASSED}}</div>
|
|
47
|
+
<div style='font-size:12px;color:#7a8497;margin-top:4px'>已完备</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<div style='margin-bottom:18px'>{{ACTION_CHIPS}}</div>
|
|
52
|
+
|
|
53
|
+
<div style='font-size:14px;font-weight:700;color:#1f2430;margin:18px 0 10px 2px'>待处理明细({{ITEM_COUNT}} 条)</div>
|
|
54
|
+
{{ITEMS}}
|
|
55
|
+
|
|
56
|
+
<div style='background:#fff;border:1px solid #e8ebf2;border-radius:12px;padding:16px;margin-top:6px'>
|
|
57
|
+
<div style='font-size:14px;font-weight:700;color:#1f2430;margin-bottom:4px'>已完备要素({{PASS_COUNT}} 条)</div>
|
|
58
|
+
<div style='font-size:12px;color:#7a8497;margin-bottom:12px'>以下要素在合同里已写清楚,本次无需补充</div>
|
|
59
|
+
{{PASS_TAGS}}
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div style='background:#fff;border:1px solid #e8ebf2;border-radius:12px;padding:14px 16px;margin-top:12px'>
|
|
63
|
+
<div style='font-size:13px;font-weight:700;color:#1f2430;margin-bottom:6px'>口径说明</div>
|
|
64
|
+
<div style='font-size:12px;color:#7a8497;line-height:1.8'>{{NOTES}}</div>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
</section>
|
|
68
|
+
`;
|
|
69
|
+
// ---------------------------------------------------------------- 工具
|
|
70
|
+
/** Python `str(x or '')`。 */
|
|
71
|
+
function truthyText(value) {
|
|
72
|
+
if (value === null || value === undefined || value === false || value === '' || value === 0)
|
|
73
|
+
return '';
|
|
74
|
+
return String(value);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* 等价 Python `html.escape(s, quote=True)` 后再把 `"` 换成 `'`。
|
|
78
|
+
* 顺序必须一致:& 先转,避免二次转义。渲染结果里因此不会出现任何双引号。
|
|
79
|
+
*/
|
|
80
|
+
function esc(value) {
|
|
81
|
+
const text = truthyText(value);
|
|
82
|
+
return text
|
|
83
|
+
.replace(/&/gu, '&')
|
|
84
|
+
.replace(/</gu, '<')
|
|
85
|
+
.replace(/>/gu, '>')
|
|
86
|
+
.replace(/"/gu, ''')
|
|
87
|
+
.replace(/'/gu, ''');
|
|
88
|
+
}
|
|
89
|
+
function readJson(path) {
|
|
90
|
+
const raw = readFileSync(path, 'utf8').replace(/^\uFEFF/u, '');
|
|
91
|
+
const parsed = JSON.parse(raw);
|
|
92
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
93
|
+
throw contractValidationError('data_invalid', '商务审核结果 JSON 根节点必须是对象');
|
|
94
|
+
}
|
|
95
|
+
return parsed;
|
|
96
|
+
}
|
|
97
|
+
function isFile(path) {
|
|
98
|
+
try {
|
|
99
|
+
return existsSync(path) && statSync(path).isFile();
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function safeName(value, fallback = '合同商务审核报告') {
|
|
106
|
+
const base = truthyText(value).trim() || fallback;
|
|
107
|
+
let out = base;
|
|
108
|
+
for (const bad of ['\\', '/', ':', '*', '?', '"', '<', '>', '|', "'", '\r', '\n']) {
|
|
109
|
+
out = out.split(bad).join('_');
|
|
110
|
+
}
|
|
111
|
+
return out.slice(0, 80);
|
|
112
|
+
}
|
|
113
|
+
export const ACTION_LABEL = {
|
|
114
|
+
add: '补充',
|
|
115
|
+
modify: '修改',
|
|
116
|
+
delete: '删除',
|
|
117
|
+
confirm: '核对',
|
|
118
|
+
};
|
|
119
|
+
const ACTION_COLOR = {
|
|
120
|
+
add: '#1d6fd8',
|
|
121
|
+
modify: '#b45309',
|
|
122
|
+
delete: '#c0392b',
|
|
123
|
+
confirm: '#64748b',
|
|
124
|
+
};
|
|
125
|
+
const ACTION_BG = {
|
|
126
|
+
add: '#eef4fd',
|
|
127
|
+
modify: '#fdf3e3',
|
|
128
|
+
delete: '#fdecea',
|
|
129
|
+
confirm: '#f1f5f9',
|
|
130
|
+
};
|
|
131
|
+
const ACTION_SUGGEST_LABEL = {
|
|
132
|
+
add: '建议补充为',
|
|
133
|
+
modify: '建议修改为',
|
|
134
|
+
delete: '建议删除(含理由)',
|
|
135
|
+
confirm: '建议核对',
|
|
136
|
+
};
|
|
137
|
+
/** 动作别名 → 三态(补充 / 修改 / 删除,另有核对)。识别不了按「修改」处理,不阻断出报告。 */
|
|
138
|
+
const ACTION_ALIASES = {
|
|
139
|
+
add: 'add', '补充': 'add', '新增': 'add', '增加': 'add', '添加': 'add', '加': 'add',
|
|
140
|
+
'缺': 'add', '缺失': 'add', '漏': 'add', '漏项': 'add', '未约定': 'add',
|
|
141
|
+
modify: 'modify', '修改': 'modify', '修正': 'modify', '完善': 'modify', '调整': 'modify', '改写': 'modify', '澄清': 'modify',
|
|
142
|
+
delete: 'delete', '删除': 'delete', '删掉': 'delete', '移除': 'delete', '去掉': 'delete', '作废': 'delete',
|
|
143
|
+
confirm: 'confirm', '核对': 'confirm', '确认': 'confirm', '复核': 'confirm', '待确认': 'confirm',
|
|
144
|
+
};
|
|
145
|
+
const STATUS_ALIASES = [
|
|
146
|
+
[['missing', 'notstated', 'not_stated', 'none', '未约定', '未提及', '没有', '无', '未写'], '未约定'],
|
|
147
|
+
[['blank', 'empty', 'placeholder', '留空', '空白', '未填写', '未填', '占位符', '待填'], '留空待填'],
|
|
148
|
+
[['ambiguous', 'vague', 'unclear', '不明确', '表述不清', '模糊', '笼统', '有歧义'], '表述不明确'],
|
|
149
|
+
[['conflict', 'contradiction', 'inconsistent', '矛盾', '前后不一致', '自相矛盾'], '前后矛盾'],
|
|
150
|
+
[['incomplete', 'partial', '不完整', '不齐全', '缺项', '缺失部分'], '不完整'],
|
|
151
|
+
[['ok', 'fine', '完备', '齐全', '明确', '已约定'], '已完备'],
|
|
152
|
+
];
|
|
153
|
+
const SEVERITY_ALIASES = [
|
|
154
|
+
[['high', 'h', '严重', '高', '重大'], '高'],
|
|
155
|
+
[['medium', 'm', '中', '一般'], '中'],
|
|
156
|
+
[['low', 'l', '低', '轻微', '提示'], '低'],
|
|
157
|
+
];
|
|
158
|
+
function normalizeAction(raw) {
|
|
159
|
+
const text = truthyText(raw).trim();
|
|
160
|
+
if (!text)
|
|
161
|
+
return 'modify';
|
|
162
|
+
const hit = ACTION_ALIASES[text] ?? ACTION_ALIASES[text.toLowerCase()];
|
|
163
|
+
return hit ?? 'modify';
|
|
164
|
+
}
|
|
165
|
+
function normalizeStatus(raw) {
|
|
166
|
+
const text = truthyText(raw).trim();
|
|
167
|
+
if (!text)
|
|
168
|
+
return '未约定';
|
|
169
|
+
const lower = text.toLowerCase();
|
|
170
|
+
for (const [aliases, label] of STATUS_ALIASES) {
|
|
171
|
+
if (aliases.includes(lower) || aliases.includes(text))
|
|
172
|
+
return label;
|
|
173
|
+
}
|
|
174
|
+
return text;
|
|
175
|
+
}
|
|
176
|
+
function normalizeSeverity(raw) {
|
|
177
|
+
const text = truthyText(raw).trim();
|
|
178
|
+
if (!text)
|
|
179
|
+
return '';
|
|
180
|
+
const lower = text.toLowerCase();
|
|
181
|
+
for (const [aliases, label] of SEVERITY_ALIASES) {
|
|
182
|
+
if (aliases.includes(lower) || aliases.includes(text))
|
|
183
|
+
return label;
|
|
184
|
+
}
|
|
185
|
+
return '';
|
|
186
|
+
}
|
|
187
|
+
function pickArray(raw, keys) {
|
|
188
|
+
for (const key of keys) {
|
|
189
|
+
if (Array.isArray(raw[key]))
|
|
190
|
+
return raw[key];
|
|
191
|
+
}
|
|
192
|
+
return [];
|
|
193
|
+
}
|
|
194
|
+
/** 归一化商务审核结果:动作三态、状态中文、按位置排序;空条目计入 `skipped`。 */
|
|
195
|
+
export function normalizeBizReviewData(raw, meta = {}) {
|
|
196
|
+
if (Array.isArray(raw)) {
|
|
197
|
+
throw contractValidationError('data_invalid', '商务审核结果必须是对象(含 items / passed),不能是数组');
|
|
198
|
+
}
|
|
199
|
+
const rawItems = pickArray(raw, ['items', 'findings', 'issues', 'details']);
|
|
200
|
+
const rawPassed = pickArray(raw, ['passed', 'complete', 'okItems', 'done']);
|
|
201
|
+
const items = [];
|
|
202
|
+
let skipped = 0;
|
|
203
|
+
for (const entry of rawItems) {
|
|
204
|
+
if (!entry || typeof entry !== 'object') {
|
|
205
|
+
skipped += 1;
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
const item = entry;
|
|
209
|
+
const element = truthyText(item.element ?? item.name ?? item.title ?? item.field).trim();
|
|
210
|
+
if (!element) {
|
|
211
|
+
skipped += 1;
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
const action = normalizeAction(item.action ?? item.op ?? item.change);
|
|
215
|
+
items.push({
|
|
216
|
+
category: truthyText(item.category ?? item.group ?? item.dimension).trim(),
|
|
217
|
+
element,
|
|
218
|
+
action,
|
|
219
|
+
actionLabel: ACTION_LABEL[action],
|
|
220
|
+
status: normalizeStatus(item.status ?? item.state),
|
|
221
|
+
severity: normalizeSeverity(item.severity ?? item.level),
|
|
222
|
+
location: truthyText(item.location ?? item.position ?? item.origin ?? item.anchor).trim(),
|
|
223
|
+
original: truthyText(item.original ?? item.text ?? item.clause).trim(),
|
|
224
|
+
problem: truthyText(item.problem ?? item.issue ?? item.explanation ?? item.reason).trim(),
|
|
225
|
+
suggestion: truthyText(item.suggestion ?? item.advice ?? item.fix ?? item.proposal).trim(),
|
|
226
|
+
basis: truthyText(item.basis ?? item.basics ?? item.reference).trim(),
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
const passed = [];
|
|
230
|
+
for (const entry of rawPassed) {
|
|
231
|
+
if (typeof entry === 'string') {
|
|
232
|
+
const element = entry.trim();
|
|
233
|
+
if (element)
|
|
234
|
+
passed.push({ category: '', element, note: '' });
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
if (!entry || typeof entry !== 'object') {
|
|
238
|
+
skipped += 1;
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
const item = entry;
|
|
242
|
+
const element = truthyText(item.element ?? item.name ?? item.title).trim();
|
|
243
|
+
if (!element) {
|
|
244
|
+
skipped += 1;
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
passed.push({
|
|
248
|
+
category: truthyText(item.category ?? item.group).trim(),
|
|
249
|
+
element,
|
|
250
|
+
note: truthyText(item.note ?? item.detail ?? item.summary).trim(),
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
if (!items.length && !passed.length) {
|
|
254
|
+
throw contractValidationError('items_empty', '商务审核结果为空:请先按合同正文判出结论,在 items(待补充/修改/删除)或 passed(已完备)里至少给一条');
|
|
255
|
+
}
|
|
256
|
+
const data = {
|
|
257
|
+
contract: truthyText(meta.contract) || truthyText(raw.contract) || truthyText(raw.contractName),
|
|
258
|
+
partyA: truthyText(meta.partyA) || truthyText(raw.partyA),
|
|
259
|
+
partyB: truthyText(meta.partyB) || truthyText(raw.partyB),
|
|
260
|
+
standpoint: truthyText(meta.standpoint) || truthyText(raw.standpoint) || truthyText(raw.role),
|
|
261
|
+
reviewDate: truthyText(meta.reviewDate) || truthyText(raw.reviewDate) || truthyText(raw.date),
|
|
262
|
+
reviewer: truthyText(raw.reviewer),
|
|
263
|
+
items,
|
|
264
|
+
passed,
|
|
265
|
+
notes: pickArray(raw, ['notes', 'noteLines']).map((line) => truthyText(line)).filter(Boolean),
|
|
266
|
+
skipped,
|
|
267
|
+
};
|
|
268
|
+
data.cardId = truthyText(meta.cardId) || truthyText(raw.cardId) || `cb-report-${Date.now().toString(36)}`;
|
|
269
|
+
data.fileBase = safeName(`商务审核报告_${truthyText(data.contract) || '合同'}_${truthyText(data.reviewDate).split('-').join('') || 'report'}`);
|
|
270
|
+
return data;
|
|
271
|
+
}
|
|
272
|
+
// ---------------------------------------------------------------- 渲染
|
|
273
|
+
function infoRows(d) {
|
|
274
|
+
const rows = [
|
|
275
|
+
['合同名称', d.contract],
|
|
276
|
+
['甲方', d.partyA],
|
|
277
|
+
['乙方', d.partyB],
|
|
278
|
+
['审核立场', d.standpoint],
|
|
279
|
+
['审核类型', '商务审核 · 完备性检查'],
|
|
280
|
+
['审核日期', d.reviewDate],
|
|
281
|
+
['审核人', d.reviewer],
|
|
282
|
+
];
|
|
283
|
+
const out = [];
|
|
284
|
+
for (const [key, value] of rows) {
|
|
285
|
+
if (!truthyText(value))
|
|
286
|
+
continue;
|
|
287
|
+
out.push("<tr><td style='padding:7px 10px;background:#f7f9fc;width:110px;color:#7a8497;border-radius:6px'>"
|
|
288
|
+
+ esc(key) + "</td><td style='padding:7px 10px'>" + esc(value) + '</td></tr>');
|
|
289
|
+
}
|
|
290
|
+
return out.join('');
|
|
291
|
+
}
|
|
292
|
+
/** 动作分布:补充 X · 修改 Y · 删除 Z · 核对 W(为 0 的动作不出现)。 */
|
|
293
|
+
export function actionChips(d) {
|
|
294
|
+
const order = ['add', 'modify', 'delete', 'confirm'];
|
|
295
|
+
const out = [];
|
|
296
|
+
for (const action of order) {
|
|
297
|
+
const count = d.items.filter((item) => item.action === action).length;
|
|
298
|
+
if (!count)
|
|
299
|
+
continue;
|
|
300
|
+
out.push("<span style='display:inline-block;background:" + ACTION_BG[action] + ';color:' + ACTION_COLOR[action]
|
|
301
|
+
+ ";border-radius:8px;padding:5px 10px;font-size:12px;margin:0 8px 8px 0'>"
|
|
302
|
+
+ esc(ACTION_LABEL[action]) + ' ' + String(count) + ' 项</span>');
|
|
303
|
+
}
|
|
304
|
+
if (!out.length) {
|
|
305
|
+
out.push("<span style='display:inline-block;color:#1a9c5b;font-size:12px'>本次没有需要补充 / 修改 / 删除的要素</span>");
|
|
306
|
+
}
|
|
307
|
+
return out.join('');
|
|
308
|
+
}
|
|
309
|
+
function itemCards(d) {
|
|
310
|
+
const out = [];
|
|
311
|
+
d.items.forEach((item, index) => {
|
|
312
|
+
const no = index + 1;
|
|
313
|
+
const color = ACTION_COLOR[item.action];
|
|
314
|
+
const bg = ACTION_BG[item.action];
|
|
315
|
+
const metaBits = [];
|
|
316
|
+
if (item.category)
|
|
317
|
+
metaBits.push('类别:' + esc(item.category));
|
|
318
|
+
if (item.status)
|
|
319
|
+
metaBits.push('现状:' + esc(item.status));
|
|
320
|
+
if (item.severity)
|
|
321
|
+
metaBits.push('优先度:' + esc(item.severity));
|
|
322
|
+
out.push("<div style='background:#fff;border:1px solid #e8ebf2;border-left:3px solid " + color
|
|
323
|
+
+ ";border-radius:10px;padding:14px 16px;margin-bottom:12px'>"
|
|
324
|
+
+ "<div style='display:flex;align-items:center;gap:8px;margin-bottom:8px;flex-wrap:wrap'>"
|
|
325
|
+
+ "<span style='background:" + bg + ';color:' + color + ";border-radius:10px;padding:2px 8px;font-size:11px'>"
|
|
326
|
+
+ esc(item.actionLabel) + '</span>'
|
|
327
|
+
+ "<span style='font-size:14px;font-weight:700;color:#1f2430'>" + String(no) + '. ' + esc(item.element) + '</span>'
|
|
328
|
+
+ (metaBits.length
|
|
329
|
+
? "<span style='font-size:11px;color:#7a8497'>" + metaBits.join(' · ') + '</span>'
|
|
330
|
+
: '')
|
|
331
|
+
+ '</div>'
|
|
332
|
+
+ "<div style='font-size:12px;color:#7a8497;margin-bottom:4px'>原文位置</div>"
|
|
333
|
+
+ "<div style='font-size:13px;color:#3c4453;margin-bottom:10px'>"
|
|
334
|
+
+ (item.location ? esc(item.location) : '未给出位置:请按合同正文定位后人工核对') + '</div>'
|
|
335
|
+
+ "<div style='font-size:12px;color:#7a8497;margin-bottom:4px'>合同原文</div>"
|
|
336
|
+
+ "<div style='background:#f7f9fc;border-radius:6px;padding:10px;font-size:13px;color:#3c4453;line-height:1.7;margin-bottom:10px'>"
|
|
337
|
+
+ (item.original ? esc(item.original) : '(合同未约定,或未找到对应表述)') + '</div>'
|
|
338
|
+
+ (item.problem
|
|
339
|
+
? "<div style='font-size:12px;color:#7a8497;margin-bottom:4px'>问题说明</div>"
|
|
340
|
+
+ "<div style='font-size:13px;color:#b45309;line-height:1.7;margin-bottom:10px'>" + esc(item.problem) + '</div>'
|
|
341
|
+
: '')
|
|
342
|
+
+ (item.suggestion
|
|
343
|
+
? "<div style='font-size:12px;color:#7a8497;margin-bottom:4px'>" + esc(ACTION_SUGGEST_LABEL[item.action]) + '</div>'
|
|
344
|
+
+ "<div style='background:#f0f9f4;border:1px solid #cfeadd;border-radius:6px;padding:10px;font-size:13px;color:#1a6b45;line-height:1.7'>"
|
|
345
|
+
+ esc(item.suggestion) + '</div>'
|
|
346
|
+
: '')
|
|
347
|
+
+ (item.basis
|
|
348
|
+
? "<div style='font-size:12px;color:#7a8497;margin-top:10px'>依据:<span style='color:#3c4453'>" + esc(item.basis) + '</span></div>'
|
|
349
|
+
: '')
|
|
350
|
+
+ '</div>');
|
|
351
|
+
});
|
|
352
|
+
if (!out.length) {
|
|
353
|
+
out.push("<div style='background:#fff;border:1px solid #e8ebf2;border-radius:10px;padding:14px 16px;font-size:13px;color:#1a9c5b'>"
|
|
354
|
+
+ '本次检查未发现需要补充 / 修改 / 删除的条目</div>');
|
|
355
|
+
}
|
|
356
|
+
return out.join('');
|
|
357
|
+
}
|
|
358
|
+
function passTags(d) {
|
|
359
|
+
const out = [];
|
|
360
|
+
d.passed.forEach((item, index) => {
|
|
361
|
+
const suffix = item.category ? '(' + esc(item.category) + ')' : '';
|
|
362
|
+
const note = item.note ? "<div style='font-size:11px;color:#7a8497;margin-top:3px'>" + esc(item.note) + '</div>' : '';
|
|
363
|
+
out.push("<span style='display:inline-block;vertical-align:top;background:#f0f9f4;border:1px solid #cfeadd;color:#1a6b45;"
|
|
364
|
+
+ "border-radius:8px;padding:5px 10px;font-size:12px;margin:0 8px 8px 0'>"
|
|
365
|
+
+ String(index + 1) + '. ' + esc(item.element) + suffix + note + '</span>');
|
|
366
|
+
});
|
|
367
|
+
if (!out.length) {
|
|
368
|
+
out.push("<span style='font-size:12px;color:#7a8497'>无</span>");
|
|
369
|
+
}
|
|
370
|
+
return out.join('');
|
|
371
|
+
}
|
|
372
|
+
function notesBlock(d) {
|
|
373
|
+
const lines = d.notes.length
|
|
374
|
+
? d.notes.map((line) => '· ' + esc(line))
|
|
375
|
+
: [
|
|
376
|
+
'· 完备性检查只看「说没说清楚、齐不齐」,不做风险等级判定;风险条款判定走合同预审(风险审查)。',
|
|
377
|
+
'· 「原文位置」用于对照修改:建议按位置逐条回到合同正文确认后再改,避免改错条款。',
|
|
378
|
+
'· 金额、日期、比例等要素以合同正文为唯一依据;本报告不重算任何数值。',
|
|
379
|
+
];
|
|
380
|
+
return lines.join('<br>');
|
|
381
|
+
}
|
|
382
|
+
export function bizReviewStats(d) {
|
|
383
|
+
const byAction = { add: 0, modify: 0, delete: 0, confirm: 0 };
|
|
384
|
+
for (const item of d.items)
|
|
385
|
+
byAction[item.action] += 1;
|
|
386
|
+
return {
|
|
387
|
+
total: d.items.length + d.passed.length,
|
|
388
|
+
pending: d.items.length,
|
|
389
|
+
passed: d.passed.length,
|
|
390
|
+
byAction,
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
export function renderBizReviewReport(d, template) {
|
|
394
|
+
const stats = bizReviewStats(d);
|
|
395
|
+
const cardId = truthyText(d.cardId) || 'cb-report-000';
|
|
396
|
+
return template
|
|
397
|
+
.split('{{CARD_ID}}').join(esc(cardId))
|
|
398
|
+
.split('{{CONTRACT_NAME}}').join(esc(d.contract || '未提供合同名称'))
|
|
399
|
+
.split('{{TINFO}}').join(infoRows(d))
|
|
400
|
+
.split('{{STAT_TOTAL}}').join(String(stats.total))
|
|
401
|
+
.split('{{STAT_PENDING}}').join(String(stats.pending))
|
|
402
|
+
.split('{{STAT_PASSED}}').join(String(stats.passed))
|
|
403
|
+
.split('{{ACTION_CHIPS}}').join(actionChips(d))
|
|
404
|
+
.split('{{ITEM_COUNT}}').join(String(d.items.length))
|
|
405
|
+
.split('{{ITEMS}}').join(itemCards(d))
|
|
406
|
+
.split('{{PASS_COUNT}}').join(String(d.passed.length))
|
|
407
|
+
.split('{{PASS_TAGS}}').join(passTags(d))
|
|
408
|
+
.split('{{NOTES}}').join(notesBlock(d));
|
|
409
|
+
}
|
|
410
|
+
/** 交付前自检:双引号数量、ES5 语法禁用项(与风险审查报告同一把尺子)。 */
|
|
411
|
+
export function lintBizReviewHtml(html) {
|
|
412
|
+
const problems = [];
|
|
413
|
+
const doubleQuotes = (html.match(/"/gu) ?? []).length;
|
|
414
|
+
if (doubleQuotes)
|
|
415
|
+
problems.push(`html 内含 ${doubleQuotes} 个双引号(必须为 0)`);
|
|
416
|
+
for (const bad of ['=>', 'const ', 'let ', '??', '?.', '`']) {
|
|
417
|
+
if (html.includes(bad))
|
|
418
|
+
problems.push(`html 内出现 ES5 禁用语法: ${bad}`);
|
|
419
|
+
}
|
|
420
|
+
const start = html.indexOf('<script>');
|
|
421
|
+
const end = html.lastIndexOf('</script>');
|
|
422
|
+
const js = (start >= 0 && end > start) ? html.slice(start + 8, end) : '';
|
|
423
|
+
return { problems, js };
|
|
424
|
+
}
|
|
425
|
+
const META_KEYS = ['contract', 'partyA', 'partyB', 'standpoint', 'reviewDate', 'cardId'];
|
|
426
|
+
/**
|
|
427
|
+
* 渲染合同商务审核(完备性检查)报告 HTML 产物。
|
|
428
|
+
*
|
|
429
|
+
* `data` 必填(模型判出的结构化结论 JSON),`out` 必填(报告只以 HTML 产物文件交付)。
|
|
430
|
+
*/
|
|
431
|
+
export const contractBizReviewReportOperation = {
|
|
432
|
+
name: 'contract.bizreview.report',
|
|
433
|
+
async execute(input) {
|
|
434
|
+
const dataPath = typeof input.data === 'string' && input.data.trim() ? resolve(input.data.trim()) : '';
|
|
435
|
+
if (!dataPath) {
|
|
436
|
+
throw contractValidationError('data_required', '缺少 data:请先按合同正文判出完备性结论(items / passed)并落成 JSON,再传该文件路径');
|
|
437
|
+
}
|
|
438
|
+
if (!isFile(dataPath)) {
|
|
439
|
+
throw contractValidationError('data_not_found', `商务审核结果文件不存在:${dataPath}`);
|
|
440
|
+
}
|
|
441
|
+
const raw = readJson(dataPath);
|
|
442
|
+
const meta = {};
|
|
443
|
+
for (const key of META_KEYS) {
|
|
444
|
+
if (input[key] !== undefined && input[key] !== null && input[key] !== '')
|
|
445
|
+
meta[key] = input[key];
|
|
446
|
+
}
|
|
447
|
+
const data = normalizeBizReviewData(raw, meta);
|
|
448
|
+
const templatePath = typeof input.template === 'string' && input.template.trim()
|
|
449
|
+
? resolve(input.template.trim())
|
|
450
|
+
: '';
|
|
451
|
+
let template = DEFAULT_TEMPLATE;
|
|
452
|
+
if (templatePath) {
|
|
453
|
+
if (!isFile(templatePath)) {
|
|
454
|
+
throw contractValidationError('template_not_found', `模板文件不存在:${templatePath}`);
|
|
455
|
+
}
|
|
456
|
+
template = readFileSync(templatePath, 'utf8');
|
|
457
|
+
}
|
|
458
|
+
const html = renderBizReviewReport(data, template);
|
|
459
|
+
const { problems, js } = lintBizReviewHtml(html);
|
|
460
|
+
const dumpPath = typeof input.dumpData === 'string' && input.dumpData.trim()
|
|
461
|
+
? resolve(input.dumpData.trim())
|
|
462
|
+
: '';
|
|
463
|
+
let dumpDataOut;
|
|
464
|
+
if (dumpPath) {
|
|
465
|
+
mkdirSync(dirname(dumpPath), { recursive: true });
|
|
466
|
+
writeFileSync(dumpPath, JSON.stringify(data, null, 2), 'utf8');
|
|
467
|
+
dumpDataOut = dumpPath;
|
|
468
|
+
}
|
|
469
|
+
const outInput = typeof input.out === 'string' ? input.out.trim() : '';
|
|
470
|
+
if (!outInput) {
|
|
471
|
+
throw contractValidationError('out_required', '缺少 out:报告只以 HTML 产物文件交付,必须显式给出输出绝对路径');
|
|
472
|
+
}
|
|
473
|
+
const htmlOut = resolve(outInput);
|
|
474
|
+
mkdirSync(dirname(htmlOut), { recursive: true });
|
|
475
|
+
writeFileSync(htmlOut, html, 'utf8');
|
|
476
|
+
const stats = bizReviewStats(data);
|
|
477
|
+
return {
|
|
478
|
+
status: 'COMPLETE',
|
|
479
|
+
data: {
|
|
480
|
+
itemTotal: stats.total,
|
|
481
|
+
pending: stats.pending,
|
|
482
|
+
passed: stats.passed,
|
|
483
|
+
byAction: stats.byAction,
|
|
484
|
+
...(data.skipped ? { skippedItems: data.skipped } : {}),
|
|
485
|
+
htmlLength: html.length,
|
|
486
|
+
lint: problems.length ? 'FAIL' : 'OK',
|
|
487
|
+
lintProblems: problems,
|
|
488
|
+
...(js ? { scriptLength: js.length } : {}),
|
|
489
|
+
...(dumpDataOut ? { dumpData: dumpDataOut } : {}),
|
|
490
|
+
out: htmlOut,
|
|
491
|
+
note: '报告已落盘;交付方式为产物文件 + open_web 打开该文件的 file:/// 绝对路径(不出卡片)',
|
|
492
|
+
},
|
|
493
|
+
};
|
|
494
|
+
},
|
|
495
|
+
};
|
|
496
|
+
export const contractBizReviewReportOperations = [contractBizReviewReportOperation];
|