weaver-work-cli 0.1.62 → 0.1.63
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-BLDYBZDX.js} +5 -4
- package/dist/chunks/{archive-oa-HEDSIUUY.js → archive-oa-3GJ3TWXR.js} +5 -4
- package/dist/chunks/{asset-HYH4W357.js → asset-AFXJN4CK.js} +5 -4
- package/dist/chunks/{asset-idle-N7REBNGL.js → asset-idle-VUJXWGWJ.js} +5 -4
- package/dist/chunks/{attachment-content-VYYA75FR.js → attachment-content-VMJA7NSQ.js} +3 -3
- package/dist/chunks/{blog-SLMZZICV.js → blog-EREB35VU.js} +5 -4
- package/dist/chunks/{caizhilian-RV43KKBT.js → caizhilian-ATM2JO5S.js} +5 -5
- package/dist/chunks/{calendar-DMVZ4OLY.js → calendar-E26ZIH7S.js} +5 -4
- package/dist/chunks/{chunk-6XSSAUNW.js → chunk-4OB22YKE.js} +48 -12
- package/dist/chunks/{chunk-UBGWIXU3.js → chunk-5CY37VLS.js} +131 -38
- package/dist/chunks/{chunk-EGANE35F.js → chunk-6G2JARDK.js} +1 -1
- package/dist/chunks/{chunk-WIWDVETN.js → chunk-6VCQLZXE.js} +75 -76
- package/dist/chunks/{chunk-E5YD5JWR.js → chunk-BY3WDJO5.js} +1 -1
- package/dist/chunks/{chunk-IW7A2IQY.js → chunk-C4YQJFZV.js} +43 -15
- package/dist/chunks/{chunk-BQYX2UX5.js → chunk-C5PIGPGX.js} +5 -3
- package/dist/chunks/{chunk-UBRWONP4.js → chunk-EOZHSNND.js} +2 -2
- package/dist/chunks/{chunk-UQFPF4EX.js → chunk-G3ZM57PD.js} +2 -2
- package/dist/chunks/{chunk-XT77MP54.js → chunk-GOBNIGWS.js} +410 -24
- package/dist/chunks/{chunk-KY3R42RS.js → chunk-GQK6WLOS.js} +5 -3
- package/dist/chunks/{chunk-BIA2NKUG.js → chunk-HEJPVXD3.js} +5 -5
- package/dist/chunks/{chunk-ILALC2N6.js → chunk-I4C2KR2G.js} +1 -1
- package/dist/chunks/{chunk-YI2YMW5N.js → chunk-IGICM3WJ.js} +2 -2
- package/dist/chunks/chunk-IN6NXQ26.js +680 -0
- package/dist/chunks/{chunk-VBFBMM7G.js → chunk-LOVAIGM2.js} +387 -70
- package/dist/chunks/{chunk-H6YOMI3U.js → chunk-OMAGCLUE.js} +5 -3
- package/dist/chunks/{chunk-VNYOUAWV.js → chunk-QAMIIFP6.js} +11 -11
- package/dist/chunks/{chunk-QBDXJS2W.js → chunk-QZYKZ7MQ.js} +16 -8
- package/dist/chunks/{chunk-V2LASYKO.js → chunk-RR45ELVE.js} +30 -24
- package/dist/chunks/{chunk-NRYDJN4J.js → chunk-RV2JAA5I.js} +89 -8
- package/dist/chunks/{chunk-TEZHIB6T.js → chunk-SDPC7BG2.js} +5 -3
- package/dist/chunks/{chunk-T2KVJFWJ.js → chunk-SHBDXEUE.js} +4 -7
- package/dist/chunks/{chunk-P6TXQK75.js → chunk-THMBDCRA.js} +5 -3
- package/dist/chunks/chunk-TJN4PIYO.js +47 -0
- package/dist/chunks/{chunk-DTCQFTHW.js → chunk-TNFIUZ4H.js} +3 -3
- package/dist/chunks/{chunk-JFAWZX53.js → chunk-UPVAQJKS.js} +282 -131
- package/dist/chunks/{chunk-KXJA42EA.js → chunk-WPBZQVLS.js} +1 -1
- package/dist/chunks/{conflict-GFJRS6I7.js → conflict-AMNTM3FV.js} +2 -2
- package/dist/chunks/{contract-U3ZGNRWB.js → contract-PLO2V2NO.js} +2333 -4426
- package/dist/chunks/{cowork-EX7PKIDK.js → cowork-FZAXE6FO.js} +5 -4
- package/dist/chunks/{create-flow-EJZD434E.js → create-flow-2DAUN7HU.js} +16 -6
- package/dist/chunks/{data-FOODGAMF.js → data-7NXMWET4.js} +3 -3
- package/dist/chunks/{ebuilder-form-I2EOKODG.js → ebuilder-form-DEYHX6M7.js} +4 -4
- package/dist/chunks/{ehr-TE4RFNID.js → ehr-QQH2DYYA.js} +244 -151
- package/dist/chunks/{employee-DR5Y64TI.js → employee-PGMY6NI6.js} +1 -1
- package/dist/chunks/{entry-mode-ZOLSXEGX.js → entry-mode-2JTVEKMP.js} +3 -3
- package/dist/chunks/{env-TID5NFR6.js → env-2JZMXC6I.js} +2 -2
- package/dist/chunks/{esb-7L6MHYLB.js → esb-I5ZFHJUK.js} +8 -8
- package/dist/chunks/{factory-OG7BPMH5.js → factory-XIATYHU6.js} +1 -1
- package/dist/chunks/{fna-6V2ENR3Y.js → fna-3V2TL6B2.js} +5 -4
- package/dist/chunks/{group-chat-5DKPWIHL.js → group-chat-CVYUZCOQ.js} +3 -3
- package/dist/chunks/{host-TJ5VVHM7.js → host-4DP7C7YQ.js} +4 -4
- package/dist/chunks/{host-3DLYA54R.js → host-4KQCAEWA.js} +4 -4
- package/dist/chunks/{host-ONZC6AE7.js → host-4X2F3JPQ.js} +4 -4
- package/dist/chunks/{host-OGBHL75G.js → host-BD7NAM33.js} +4 -4
- package/dist/chunks/{host-VTPAWDZV.js → host-CBONEAZS.js} +4 -4
- package/dist/chunks/{host-GOJHHTPY.js → host-L37QVNIV.js} +4 -4
- package/dist/chunks/{hrm-2N7NFQDZ.js → hrm-OL3IKN7C.js} +6 -6
- package/dist/chunks/{im-XCH47ZBN.js → im-YXQWUF3R.js} +4 -4
- package/dist/chunks/{invoice-5KJ7T774.js → invoice-4WY32PR2.js} +4 -4
- package/dist/chunks/{jiuchuanhui-PL6DRPBM.js → jiuchuanhui-L6SHLONH.js} +5 -4
- package/dist/chunks/{lazy-dispatch-UATEN7H7.js → lazy-dispatch-OYE6QV24.js} +5 -5
- package/dist/chunks/{mail-Q7Z4CQ4D.js → mail-PZV2KNRU.js} +5 -4
- package/dist/chunks/{meeting-5E3BNARL.js → meeting-6SOBCC6N.js} +16 -15
- package/dist/chunks/{minute-doc-NXRE5C77.js → minute-doc-KSJSJNOH.js} +4 -4
- package/dist/chunks/{okr-3O3XNYOK.js → okr-B76FW5M2.js} +5 -4
- package/dist/chunks/{operations-EZWG72FH.js → operations-YOMEGFLV.js} +5 -5
- package/dist/chunks/{performance-Y7CPNSOR.js → performance-4VBKUPFO.js} +5 -4
- package/dist/chunks/{plan-BLGPZF5M.js → plan-HBNZRQTI.js} +5 -4
- package/dist/chunks/{project-6MZMLJMP.js → project-IV6FWK74.js} +5 -4
- package/dist/chunks/{reception-F2VT2X52.js → reception-BR5YURT6.js} +3 -3
- package/dist/chunks/{recruit-stage-4ETIBMIW.js → recruit-stage-4HQ6OGXT.js} +654 -336
- package/dist/chunks/{registry-I4DVPDMU.js → registry-7LICMV5J.js} +12 -12
- package/dist/chunks/{registry-3FYSWV3U.js → registry-JFQEFC7E.js} +3 -3
- package/dist/chunks/{registry-3UGIWH53.js → registry-JMNOXRST.js} +2 -2
- package/dist/chunks/{registry-7RS74TCK.js → registry-MZJQX65Q.js} +5 -5
- package/dist/chunks/{room-recommend-GWCVKCXW.js → room-recommend-43GLLE7Y.js} +4 -4
- package/dist/chunks/{schedule-6AN63MJQ.js → schedule-ZQ42BEW6.js} +4 -4
- package/dist/chunks/{smart-extract-SR4SJJKN.js → smart-extract-QKAEAZGM.js} +3 -3
- package/dist/chunks/{workflow-KF7FA2UQ.js → workflow-6HV7H5PC.js} +10 -7
- package/dist/index.js +34 -34
- package/dist/internal/e10/auth/commands.js +21 -1
- 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/index.js +14 -39
- package/dist/shortcuts/contract/manifest.js +115 -270
- package/dist/shortcuts/contract/operations/compare-report.js +437 -0
- package/dist/shortcuts/contract/operations/compare.js +2 -0
- 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} +98 -25
- package/dist/shortcuts/contract/operations/ledger.js +315 -1
- package/dist/shortcuts/contract/operations/metrics.js +93 -0
- package/dist/shortcuts/contract/operations/modeltext.js +3 -3
- package/dist/shortcuts/contract/operations/page.js +8 -4
- package/dist/shortcuts/contract/operations/performance.js +53 -0
- package/dist/shortcuts/contract/operations/quote-recognize.js +289 -0
- package/dist/shortcuts/contract/operations/quote-submit.js +264 -0
- 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/triage.js +13 -6
- 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/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 +116 -7
- 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/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 +28 -0
- 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 +237 -347
- 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 +109 -185
- package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +12 -4
- 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 +21 -12
- package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +10 -18
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +18 -17
- 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 +73 -104
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +32 -37
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +12 -10
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +70 -82
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +37 -33
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +94 -27
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +5 -5
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +9 -15
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +9 -4
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +59 -32
- package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +7 -5
- package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +21 -13
- package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +13 -13
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +6 -5
- package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +250 -0
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +11 -20
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +203 -54
- package/skills/weaver-e10-jinchengda/references/contract-request-status.md +4 -11
- package/skills/weaver-e10-jinchengda/references/contract-request-write.md +11 -17
- 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-workflow-discovery.md +10 -16
- package/skills/weaver-e10-jinchengda/references/orchestration.md +31 -33
- 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 +83 -531
- 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 +3 -1
- package/skills/weaver-e10-meeting/references/create-guardrails.md +14 -8
- 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/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-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 +10 -10
- 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
|
@@ -4,7 +4,6 @@ import { contractValidationError } from '../errors.js';
|
|
|
4
4
|
import { BUILTIN } from './elements-spec.js';
|
|
5
5
|
import { buildMinimal, buildPayload, loadSourceLines, loadSourceMap } from './elements-build.js';
|
|
6
6
|
import { resolveOperation } from './op-resolver.js';
|
|
7
|
-
import { verifyBrowsertoolText } from './card-action.js';
|
|
8
7
|
/**
|
|
9
8
|
* 合同首屏第 2 轮编排(本地,零依赖)。
|
|
10
9
|
*
|
|
@@ -21,7 +20,8 @@ import { verifyBrowsertoolText } from './card-action.js';
|
|
|
21
20
|
* 2. **要素不猜**:recognizeResult 由内置字段表或调用方给出,拿不到就跳过;
|
|
22
21
|
* 3. 任一步失败都继续往下走,最后统一在结果里汇报,并由 data.ok 表达链路成败。
|
|
23
22
|
*
|
|
24
|
-
* 退出语义:信封 ok 表示「命令执行成功」;data.ok
|
|
23
|
+
* 退出语义:信封 ok 表示「命令执行成功」;data.ok 表示「已产出可用 open_web 打开的合同智能页地址」。
|
|
24
|
+
* 2026-11-19 起本链路不再渲染卡片、不再生成摘要,交付物就是 pageUrl。
|
|
25
25
|
* 校验/降级信息不抛错,完整放进 warnings / steps,避免把细节吞成一句失败。
|
|
26
26
|
*/
|
|
27
27
|
const DEFAULT_BASE = 'https://www.e-cology.com.cn';
|
|
@@ -65,6 +65,43 @@ async function callOperation(name, input, context) {
|
|
|
65
65
|
const result = await operation.execute(input, context);
|
|
66
66
|
return (result?.data ?? {});
|
|
67
67
|
}
|
|
68
|
+
const CONTRACT_AIID = '1256652614210789601';
|
|
69
|
+
/** 合同智能页合法 `tab` 枚举;缺省 `Extract`(发起合同流程 / 要素提取)。 */
|
|
70
|
+
const ALLOWED_TABS = ['Extract', 'Summary', 'RiskReview', 'Credit', 'termComponent'];
|
|
71
|
+
/**
|
|
72
|
+
* 拼合同智能页地址(2026-11-19 定稿,口径见 `contract-open-web-pages.md` §1)。
|
|
73
|
+
* - `aiid` 固定常量;`formId` **不上传**;**`fieldId` 不上 URL**(附件字段由系统按 `workflowId` 定位);
|
|
74
|
+
* - `flowId` 与 `workflowId` 取值相同且**必须同时出现**;
|
|
75
|
+
* - 结构字符 `?` `&` `=` `[` `]` 原样,动态值逐个 encodeURIComponent 一次;
|
|
76
|
+
* - 多文件(主合同 + 随附协议)按 `files[N]` / `spfiles[N]` 逐份写入,索引从 0 开始(2026-11-19 修正:
|
|
77
|
+
* 此前只写死 `[0]`,导致随附文件已上传却不进页面地址)。
|
|
78
|
+
*/
|
|
79
|
+
export function buildContractPageUrl(args) {
|
|
80
|
+
const { baseUrl, workflowId, files, aiExtraId, tab } = args;
|
|
81
|
+
if (!baseUrl || !workflowId || !files.length)
|
|
82
|
+
return '';
|
|
83
|
+
const parts = [
|
|
84
|
+
`${baseUrl.replace(/\/+$/u, '')}/sp/contract/business/ai-contract`,
|
|
85
|
+
`?aiid=${CONTRACT_AIID}`,
|
|
86
|
+
`&flowId=${workflowId}`,
|
|
87
|
+
`&workflowId=${workflowId}`,
|
|
88
|
+
`&authModule=workflow`,
|
|
89
|
+
`&mode=edit`,
|
|
90
|
+
`&module=WEA_FORM`,
|
|
91
|
+
`&contractTermIds=`,
|
|
92
|
+
];
|
|
93
|
+
files.forEach((file, index) => {
|
|
94
|
+
const name = encodeURIComponent(file.fileName);
|
|
95
|
+
parts.push(`&files[${index}][id]=${file.fileId}`);
|
|
96
|
+
parts.push(`&files[${index}][name]=${name}`);
|
|
97
|
+
parts.push(`&spfiles[${index}][fileid]=${file.fileId}`);
|
|
98
|
+
parts.push(`&spfiles[${index}][name]=${name}`);
|
|
99
|
+
});
|
|
100
|
+
if (aiExtraId)
|
|
101
|
+
parts.push(`&aiExtraId=${encodeURIComponent(aiExtraId)}`);
|
|
102
|
+
parts.push(`&tab=${tab}`);
|
|
103
|
+
return parts.join('');
|
|
104
|
+
}
|
|
68
105
|
export const contractFirstScreenOperation = {
|
|
69
106
|
name: 'contract.firstscreen.run',
|
|
70
107
|
async execute(input, context) {
|
|
@@ -88,23 +125,22 @@ export const contractFirstScreenOperation = {
|
|
|
88
125
|
const steps = [];
|
|
89
126
|
const warnings = [];
|
|
90
127
|
const step = (name, ok, note = '') => steps.push({ step: name, ok, note });
|
|
128
|
+
// tab 按用户本轮行为取值(open-web-pages §3.1);缺省 Extract,不接受自造值。
|
|
129
|
+
// 放在开头的纯参数校验段:非法 tab 直接失败,不写盘、不发起任何上传。
|
|
130
|
+
const tab = truthyText(input.tab) || 'Extract';
|
|
131
|
+
if (!ALLOWED_TABS.includes(tab)) {
|
|
132
|
+
throw contractValidationError('tab_invalid', `tab 只允许 ${ALLOWED_TABS.join(' / ')},收到:${tab}`);
|
|
133
|
+
}
|
|
91
134
|
// ── ai_fill 拆分:一条参数同时拿 elements 与 summary,省掉模型单独写两个文件
|
|
92
|
-
let summaryData = truthyText(input.summaryData) ? resolve(truthyText(input.summaryData)) : '';
|
|
93
135
|
const aiFillPath = truthyText(input.aiFill) ? resolve(truthyText(input.aiFill)) : '';
|
|
94
136
|
if (aiFillPath) {
|
|
95
137
|
if (isFile(aiFillPath)) {
|
|
96
138
|
try {
|
|
97
139
|
const fill = readJson(aiFillPath);
|
|
98
140
|
const elements = fill.elements;
|
|
99
|
-
const summary = fill.summary;
|
|
100
141
|
if (elements && typeof elements === 'object' && !Array.isArray(elements)) {
|
|
101
142
|
writeFileSync(join(outDir, 'elements.json'), JSON.stringify(elements, null, 2), 'utf8');
|
|
102
143
|
}
|
|
103
|
-
if (summary && typeof summary === 'object' && !Array.isArray(summary) && !summaryData) {
|
|
104
|
-
const target = join(outDir, 'summary_data.json');
|
|
105
|
-
writeFileSync(target, JSON.stringify(summary, null, 2), 'utf8');
|
|
106
|
-
summaryData = target;
|
|
107
|
-
}
|
|
108
144
|
}
|
|
109
145
|
catch (error) {
|
|
110
146
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -136,18 +172,14 @@ export const contractFirstScreenOperation = {
|
|
|
136
172
|
let company = (truthyText(input.companyName) || truthyText(triageData.counterparty)).trim();
|
|
137
173
|
let hasCounterparty = input.counterparty === true || Boolean(company);
|
|
138
174
|
const baseUrl = (truthyText(input.baseUrl) || DEFAULT_BASE).replace(/\/+$/u, '');
|
|
139
|
-
const aiid = truthyText(input.aiid);
|
|
140
175
|
const result = {
|
|
141
176
|
ok: false,
|
|
142
177
|
file: filePath,
|
|
143
178
|
flow,
|
|
144
|
-
reviewFileId: null,
|
|
145
179
|
workflowFileId: null,
|
|
146
180
|
workflowUrl: null,
|
|
147
181
|
aiExtraId: null,
|
|
148
182
|
attachmentFieldId: null,
|
|
149
|
-
summaryHtml: null,
|
|
150
|
-
cardHtml: null,
|
|
151
183
|
prefill: false,
|
|
152
184
|
warnings,
|
|
153
185
|
steps,
|
|
@@ -155,29 +187,11 @@ export const contractFirstScreenOperation = {
|
|
|
155
187
|
};
|
|
156
188
|
if (triageErr)
|
|
157
189
|
warnings.push(`triage.json 解析失败:${triageErr}`);
|
|
158
|
-
// ══ 批次A
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
try {
|
|
164
|
-
const data = await callOperation('contract.review.upload', { paths }, context);
|
|
165
|
-
const files = Array.isArray(data.files) ? data.files : [];
|
|
166
|
-
const fileIds = files.map((item) => truthyText(item?.fileId)).filter((id) => id);
|
|
167
|
-
return {
|
|
168
|
-
skip: false,
|
|
169
|
-
ok: true,
|
|
170
|
-
fileId: fileIds[0],
|
|
171
|
-
fileIds,
|
|
172
|
-
count: paths.length,
|
|
173
|
-
err: '',
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
catch (error) {
|
|
177
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
178
|
-
return { skip: false, ok: false, fileId: undefined, fileIds: [], count: paths.length, err: message.slice(0, 200) };
|
|
179
|
-
}
|
|
180
|
-
};
|
|
190
|
+
// ══ 批次A:发起流程 ∥ 抽正文(互不依赖)
|
|
191
|
+
// 2026-11-19 定稿:**合同上传只有流程通道一条**(module=workflow),
|
|
192
|
+
// 不存在单独的预审上传通道(`contract.review.upload` 已下线)。
|
|
193
|
+
// 流程上传在收口时自动触发预审预热,因此打开 `tab=RiskReview` 时结果已在跑。
|
|
194
|
+
// 合同智能页只用流程通道的 workflowFileId。
|
|
181
195
|
// 主文件与随附文件逐个上传;表单附件字段本身支持多附件
|
|
182
196
|
const launchTask = async () => {
|
|
183
197
|
const targets = [filePath, ...attach];
|
|
@@ -213,29 +227,14 @@ export const contractFirstScreenOperation = {
|
|
|
213
227
|
// 正文抽取依赖 pdf/docx 解析,仍留在 Python 阶段1;此处不代跑、不编造
|
|
214
228
|
return { state: 'missing' };
|
|
215
229
|
};
|
|
216
|
-
const [
|
|
217
|
-
result.parallel.batchA = ['
|
|
230
|
+
const [rLc, rTg] = await Promise.all([launchTask(), triageTask()]);
|
|
231
|
+
result.parallel.batchA = ['flow.launch', 'triage.extract'];
|
|
218
232
|
if (rTg.state === 'missing') {
|
|
219
233
|
warnings.push('未找到 triage.json:请先跑阶段1(Python 抽正文)再执行本命令');
|
|
220
234
|
}
|
|
221
235
|
else {
|
|
222
236
|
step('triage.extract', true, 'triage.json 已存在');
|
|
223
237
|
}
|
|
224
|
-
if (rUp.skip) {
|
|
225
|
-
step('review.upload', true, 'skipped: skipUpload');
|
|
226
|
-
}
|
|
227
|
-
else if (rUp.ok && rUp.fileId) {
|
|
228
|
-
result.reviewFileId = rUp.fileId;
|
|
229
|
-
result.reviewFileIds = rUp.fileIds;
|
|
230
|
-
let note = String(rUp.fileId);
|
|
231
|
-
if (rUp.count > 1)
|
|
232
|
-
note = `${note} (${rUp.count} files)`;
|
|
233
|
-
step('review.upload', true, note);
|
|
234
|
-
}
|
|
235
|
-
else {
|
|
236
|
-
step('review.upload', false, rUp.err);
|
|
237
|
-
warnings.push('预审上传失败,预审卡将不可用(不影响发起流程)');
|
|
238
|
-
}
|
|
239
238
|
const launchData = (rLc.d ?? {});
|
|
240
239
|
const launchFileId = truthyText(launchData.file?.fileId);
|
|
241
240
|
if (launchFileId) {
|
|
@@ -298,8 +297,12 @@ export const contractFirstScreenOperation = {
|
|
|
298
297
|
out.warn.push('未找到 elements.json(ai_fill.elements 未落盘),要素预填仅含默认值');
|
|
299
298
|
}
|
|
300
299
|
// 多文件:origin 按命中行归属记到对应文件;数量不一致时整体丢弃映射
|
|
301
|
-
|
|
302
|
-
|
|
300
|
+
// 2026-11-19:附件统一取流程通道(workflowFileIds 与 targets 主文件+随附 顺序一致),
|
|
301
|
+
// 这是唯一来源(预审上传通道已下线)。
|
|
302
|
+
const workflowIds = Array.isArray(result.workflowFileIds) ? result.workflowFileIds : [];
|
|
303
|
+
let fileIds = workflowIds.length
|
|
304
|
+
? workflowIds
|
|
305
|
+
: (result.workflowFileId ? [String(result.workflowFileId)] : []);
|
|
303
306
|
let sourceMap = loadSourceMap(outDir);
|
|
304
307
|
if (!sourceMap) {
|
|
305
308
|
fileIds = null;
|
|
@@ -403,53 +406,8 @@ export const contractFirstScreenOperation = {
|
|
|
403
406
|
}
|
|
404
407
|
return out;
|
|
405
408
|
};
|
|
406
|
-
const
|
|
407
|
-
|
|
408
|
-
if (!(summaryData && isFile(summaryData))) {
|
|
409
|
-
out.steps.push(['summary.render', true, 'skipped: 未提供 summary_data.json']);
|
|
410
|
-
return out;
|
|
411
|
-
}
|
|
412
|
-
const textPath = join(outDir, 'contract_text.txt');
|
|
413
|
-
try {
|
|
414
|
-
const validated = await callOperation('contract.summary.validate', {
|
|
415
|
-
summary: summaryData,
|
|
416
|
-
...(isFile(textPath) ? { text: textPath } : {}),
|
|
417
|
-
}, context);
|
|
418
|
-
const fails = Array.isArray(validated.fails) ? validated.fails : [];
|
|
419
|
-
if (validated.ok === false || fails.length) {
|
|
420
|
-
const note = fails.length ? fails.join('; ') : '摘要校验未通过';
|
|
421
|
-
out.steps.push(['summary.validate', false, note]);
|
|
422
|
-
out.warn.push(`摘要校验未通过,已阻断渲染:${note.slice(0, 300)}`);
|
|
423
|
-
return out;
|
|
424
|
-
}
|
|
425
|
-
const warns = Array.isArray(validated.warns) ? validated.warns : [];
|
|
426
|
-
out.steps.push(['summary.validate', true, `warn=${warns.length}`]);
|
|
427
|
-
}
|
|
428
|
-
catch (error) {
|
|
429
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
430
|
-
out.steps.push(['summary.validate', false, message.slice(0, 200)]);
|
|
431
|
-
out.warn.push(`摘要校验未通过,已阻断渲染:${message.slice(0, 300)}`);
|
|
432
|
-
return out;
|
|
433
|
-
}
|
|
434
|
-
const htmlPath = join(outDir, 'summary.html');
|
|
435
|
-
try {
|
|
436
|
-
await callOperation('contract.summary.render', { data: summaryData, out: htmlPath }, context);
|
|
437
|
-
if (isFile(htmlPath)) {
|
|
438
|
-
out.html = htmlPath;
|
|
439
|
-
out.steps.push(['summary.render', true, `${statSync(htmlPath).size} bytes`]);
|
|
440
|
-
}
|
|
441
|
-
else {
|
|
442
|
-
out.steps.push(['summary.render', false, '未生成 summary.html']);
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
catch (error) {
|
|
446
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
447
|
-
out.steps.push(['summary.render', false, message.slice(0, 200)]);
|
|
448
|
-
}
|
|
449
|
-
return out;
|
|
450
|
-
};
|
|
451
|
-
const [rRec, rSum] = await Promise.all([recordTask(), summaryTask()]);
|
|
452
|
-
result.parallel.batchB = ['save-recognize-record', 'summary.validate+render'];
|
|
409
|
+
const rRec = await recordTask();
|
|
410
|
+
result.parallel.batchB = ['save-recognize-record'];
|
|
453
411
|
for (const [name, ok, note] of rRec.steps)
|
|
454
412
|
step(name, ok, note);
|
|
455
413
|
if (rRec.ok) {
|
|
@@ -458,129 +416,60 @@ export const contractFirstScreenOperation = {
|
|
|
458
416
|
result.prefill = true;
|
|
459
417
|
}
|
|
460
418
|
warnings.push(...rRec.warn);
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
//
|
|
467
|
-
const
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
419
|
+
// ══ 收口(2026-11-19):不再渲染卡片、不再生成摘要,交付物是合同智能页地址
|
|
420
|
+
// 页面统一走 open_web 打开 /sp/contract/business/ai-contract,靠 tab 定位功能区;
|
|
421
|
+
// 本 operation 只负责把地址拼好回传。地址里不出现 formId,也不出现 fieldId
|
|
422
|
+
// (附件字段由系统按 workflowId 定位);attachmentFieldId 只喂 save-recognize-record。
|
|
423
|
+
const fileId = truthyText(result.workflowFileId);
|
|
424
|
+
// 多文件:workflowFileIds 与 targets(主文件 + 随附)顺序一致,逐份写入 files[N] / spfiles[N]
|
|
425
|
+
const pageNames = [basename(filePath), ...attach.map((item) => basename(item))];
|
|
426
|
+
const pageFileIds = Array.isArray(result.workflowFileIds) && result.workflowFileIds.length
|
|
427
|
+
? result.workflowFileIds.map((item) => truthyText(item)).filter((item) => item)
|
|
428
|
+
: (fileId ? [fileId] : []);
|
|
429
|
+
const pageFiles = pageFileIds.map((id, index) => ({
|
|
430
|
+
fileId: id,
|
|
431
|
+
fileName: pageNames[index] ?? basename(filePath),
|
|
432
|
+
}));
|
|
433
|
+
const pageUrl = buildContractPageUrl({
|
|
476
434
|
baseUrl,
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
};
|
|
482
|
-
|
|
483
|
-
result.
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
warnings.push('
|
|
435
|
+
workflowId: truthyText(result.workflowId),
|
|
436
|
+
files: pageFiles,
|
|
437
|
+
aiExtraId: truthyText(result.aiExtraId),
|
|
438
|
+
tab,
|
|
439
|
+
});
|
|
440
|
+
result.pageUrl = pageUrl;
|
|
441
|
+
result.aiid = CONTRACT_AIID;
|
|
442
|
+
result.tab = tab;
|
|
443
|
+
if (!pageUrl) {
|
|
444
|
+
warnings.push('缺少 workflowId / fileId,无法拼装合同智能页地址');
|
|
487
445
|
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
}
|
|
491
|
-
const cardOut = join(outDir, 'card.html');
|
|
492
|
-
try {
|
|
493
|
-
const cardData = await callOperation('contract.card.action', {
|
|
494
|
-
context: cardCtx,
|
|
495
|
-
fileId: result.workflowFileId || undefined,
|
|
496
|
-
fileName: basename(filePath),
|
|
497
|
-
flowKey: flow,
|
|
498
|
-
companyName: company || undefined,
|
|
499
|
-
summaryHtml: result.summaryHtml || undefined,
|
|
500
|
-
aiExtraId: result.prefill && result.aiExtraId ? String(result.aiExtraId) : undefined,
|
|
501
|
-
attachmentFieldId: result.prefill && result.attachmentFieldId ? String(result.attachmentFieldId) : undefined,
|
|
502
|
-
baseUrl,
|
|
503
|
-
...(aiid ? { aiid } : {}),
|
|
504
|
-
out: cardOut,
|
|
505
|
-
}, context);
|
|
506
|
-
if (cardData.noCard === true) {
|
|
507
|
-
// 引擎过滤后无可用动作:属正常收口,不算渲染失败
|
|
508
|
-
result.cardOk = null;
|
|
509
|
-
step('render_action_card', true, 'NO_CARD 无可用动作');
|
|
510
|
-
warnings.push('动作引擎过滤后无可用卡片动作');
|
|
511
|
-
}
|
|
512
|
-
else if (cardData.selfCheckPassed === false && Array.isArray(cardData.selfCheck) && cardData.selfCheck.length) {
|
|
513
|
-
result.cardOk = false;
|
|
514
|
-
step('render_action_card', false, cardData.selfCheck.join(' / ').slice(0, 300));
|
|
515
|
-
warnings.push(`卡片自检未通过:${cardData.selfCheck.join(' / ').slice(0, 600)}`);
|
|
516
|
-
}
|
|
517
|
-
else if (isFile(cardOut)) {
|
|
518
|
-
result.cardHtml = cardOut;
|
|
519
|
-
result.cardOk = true;
|
|
520
|
-
step('render_action_card', true, `${statSync(cardOut).size} bytes`);
|
|
521
|
-
}
|
|
522
|
-
else {
|
|
523
|
-
result.cardOk = false;
|
|
524
|
-
step('render_action_card', false, '未生成 card.html');
|
|
525
|
-
warnings.push('卡片渲染未产出文件');
|
|
526
|
-
}
|
|
527
|
-
// 自检结论随卡片一起回传:首屏同样是交付口,判据必须与 contract.card.action 一致,
|
|
528
|
-
// 否则调用方无法确认这张卡到底过没过校验。
|
|
529
|
-
result.selfCheck = Array.isArray(cardData.selfCheck) ? cardData.selfCheck : [];
|
|
530
|
-
result.selfCheckChecks = Array.isArray(cardData.selfCheckChecks) ? cardData.selfCheckChecks : [];
|
|
531
|
-
result.selfCheckPassed = cardData.noCard === true ? null : cardData.selfCheckPassed === true;
|
|
532
|
-
}
|
|
533
|
-
catch (error) {
|
|
534
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
535
|
-
result.cardOk = false;
|
|
536
|
-
step('render_action_card', false, message.slice(0, 300));
|
|
537
|
-
warnings.push(`卡片渲染失败:${message.slice(0, 600)}`);
|
|
538
|
-
}
|
|
539
|
-
// 卡片失败不得被摘要产物掩盖
|
|
540
|
-
result.ok = result.cardOk === false ? false : Boolean(result.cardHtml || result.summaryHtml);
|
|
541
|
-
// 成品文本校验:对象合规不等于文本可解析。手改少一层转义时,
|
|
542
|
-
// 只有这里能拦住;不通过就不回传内容,避免坏卡片被下游原样输出。
|
|
543
|
-
const cardRaw = result.cardHtml && isFile(result.cardHtml) ? readFileSync(result.cardHtml, 'utf8') : '';
|
|
544
|
-
if (cardRaw) {
|
|
545
|
-
const textCheck = verifyBrowsertoolText(cardRaw);
|
|
546
|
-
result.textCheck = textCheck.problems;
|
|
547
|
-
result.textPassed = textCheck.passed;
|
|
548
|
-
if (textCheck.passed) {
|
|
549
|
-
step('verify_browsertool', true, `${textCheck.bytes} bytes`);
|
|
550
|
-
}
|
|
551
|
-
else {
|
|
552
|
-
result.cardOk = false;
|
|
553
|
-
result.ok = false;
|
|
554
|
-
step('verify_browsertool', false, textCheck.problems.join(' / ').slice(0, 300));
|
|
555
|
-
warnings.push(`卡片成品文本校验未通过,已停止回传:${textCheck.problems.join(' / ').slice(0, 600)}`);
|
|
556
|
-
}
|
|
446
|
+
if (!result.prefill) {
|
|
447
|
+
warnings.push('要素预填不可用:页面仍可打开,表单要素需人工填写');
|
|
557
448
|
}
|
|
449
|
+
// data.ok:已产出可被 open_web 直接打开的合同智能页地址,且合同附件已挂到流程通道
|
|
450
|
+
result.ok = Boolean(pageUrl && fileId);
|
|
558
451
|
const resultPath = join(outDir, 'first_screen_result.json');
|
|
559
452
|
writeFileSync(resultPath, JSON.stringify(result, null, 2), 'utf8');
|
|
560
|
-
const cardHtmlContent = input.printCard === true && result.cardOk === true && cardRaw ? cardRaw : undefined;
|
|
561
453
|
return {
|
|
562
454
|
status: 'COMPLETE',
|
|
563
455
|
data: {
|
|
564
456
|
ok: result.ok,
|
|
565
|
-
cardOk: result.cardOk ?? null,
|
|
566
|
-
selfCheck: result.selfCheck ?? [],
|
|
567
|
-
selfCheckPassed: result.selfCheckPassed ?? null,
|
|
568
|
-
selfCheckChecks: result.selfCheckChecks ?? [],
|
|
569
|
-
textCheck: result.textCheck ?? [],
|
|
570
457
|
prefill: result.prefill,
|
|
571
458
|
aiExtraId: result.aiExtraId,
|
|
572
|
-
|
|
573
|
-
|
|
459
|
+
pageUrl,
|
|
460
|
+
aiid: CONTRACT_AIID,
|
|
461
|
+
tab,
|
|
462
|
+
// workflowId 就是助手 URL 上的 flowId:取审查结果(review.export / review.digest)
|
|
463
|
+
// 必须回传同一个值,因此这里显式回传,省得调用方再从 pageUrl 里抠。
|
|
464
|
+
workflowId: truthyText(result.workflowId),
|
|
574
465
|
workflowUrl: result.workflowUrl,
|
|
575
|
-
reviewFileId: result.reviewFileId,
|
|
576
466
|
workflowFileId: result.workflowFileId,
|
|
577
467
|
attachmentFieldId: result.attachmentFieldId,
|
|
578
468
|
parallel: result.parallel,
|
|
579
469
|
warnings: result.warnings,
|
|
580
470
|
steps: result.steps,
|
|
581
471
|
result: resultPath,
|
|
582
|
-
|
|
583
|
-
note: '信封 ok 表示命令执行成功;data.ok 表示链路至少产出卡片或摘要。降级信息见 warnings',
|
|
472
|
+
note: '信封 ok 表示命令执行成功;data.ok 表示已产出可直接用 open_web 打开的合同智能页地址(pageUrl)。降级信息见 warnings',
|
|
584
473
|
},
|
|
585
474
|
};
|
|
586
475
|
},
|
|
@@ -4,6 +4,7 @@ import { loadFormContext, inspectUploadField, resolveUploadFieldId } from './for
|
|
|
4
4
|
import { requireNonEmptyString } from './shared.js';
|
|
5
5
|
import { assertContractDocument, uploadFile } from './upload.js';
|
|
6
6
|
import { lookupFileModule } from '../upload-cache.js';
|
|
7
|
+
import { ensurePrewarmed } from '../prewarm.js';
|
|
7
8
|
/**
|
|
8
9
|
* 四个合同流程的固定 workflowId / fieldId。
|
|
9
10
|
* 这些是业务常量(不是环境 ID),但流程页面里的其他 ID 仍需运行时解析。
|
|
@@ -128,6 +129,20 @@ export const contractFlowOperations = [
|
|
|
128
129
|
let fileSource;
|
|
129
130
|
let reuploadReason;
|
|
130
131
|
if (canReuse) {
|
|
132
|
+
// 复用分支也要**真预热**:这个 fileId 可能是别处上传的,本轮从未预热过。
|
|
133
|
+
// `ensurePrewarmed` 自带本地去重(同一 flowId + fileId 一轮只打一次接口),重复调用无额外开销。
|
|
134
|
+
// flowId 取本轮流程的 workflowId —— 它就是助手 URL 上的 flowId,预热与取结果必须同键同值。
|
|
135
|
+
let prewarmed = false;
|
|
136
|
+
let prewarmError;
|
|
137
|
+
try {
|
|
138
|
+
const summary = await ensurePrewarmed(host, [presetFileId], { flowId: flow.workflowId });
|
|
139
|
+
prewarmed = summary.results[0]?.ok === true;
|
|
140
|
+
if (!prewarmed)
|
|
141
|
+
prewarmError = summary.results[0]?.error ?? '未知原因';
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
prewarmError = error instanceof Error ? error.message : String(error);
|
|
145
|
+
}
|
|
131
146
|
uploaded = {
|
|
132
147
|
fileId: presetFileId,
|
|
133
148
|
name: '',
|
|
@@ -135,7 +150,8 @@ export const contractFlowOperations = [
|
|
|
135
150
|
md5: '',
|
|
136
151
|
module: 'workflow',
|
|
137
152
|
reused: true,
|
|
138
|
-
prewarmed
|
|
153
|
+
prewarmed,
|
|
154
|
+
...(prewarmError ? { prewarmError } : {}),
|
|
139
155
|
};
|
|
140
156
|
fileSource = 'reused';
|
|
141
157
|
}
|
|
@@ -154,6 +170,8 @@ export const contractFlowOperations = [
|
|
|
154
170
|
uploaded = await uploadFile(host, {
|
|
155
171
|
path: rawPath,
|
|
156
172
|
module: 'workflow',
|
|
173
|
+
// 预热的 flowId = 本轮流程 workflowId(助手 URL 上的同一个值)
|
|
174
|
+
prewarmFlowId: flow.workflowId,
|
|
157
175
|
extraFields: {
|
|
158
176
|
authModule: 'workflow',
|
|
159
177
|
source: 'form',
|
|
@@ -2,9 +2,10 @@ import { mkdirSync, writeFileSync } from 'node:fs';
|
|
|
2
2
|
import { dirname, resolve } from 'node:path';
|
|
3
3
|
import { contractValidationError } from '../errors.js';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* 业绩核算六菜单「台账页卡 / ebdf 列表卡」组件卡生成器(本地,零依赖):`contract.ledger.card`。
|
|
6
6
|
*
|
|
7
|
-
* 迁移自 `scripts/render_ebdf_list_card.py`(2026-11-12
|
|
7
|
+
* 迁移自 `scripts/render_ebdf_list_card.py`(2026-11-12 第二批);
|
|
8
|
+
* 2026-11-19 由 `contract.card.ebdf-list` 改名而来(`card.*` 命名空间随行为卡片废止一并清空)。
|
|
8
9
|
*
|
|
9
10
|
* 为什么固化:这六类列表以前用外部浏览器打开,用户拿不到 E10 列表组件;
|
|
10
11
|
* 改造成 ebdf 列表页组件卡后,pageId / 组件名极易抄错,因此全部固化,
|
|
@@ -14,7 +15,7 @@ import { contractValidationError } from '../errors.js';
|
|
|
14
15
|
* 12 项自检全部与 Python 版一致。
|
|
15
16
|
*/
|
|
16
17
|
/** 菜单 → pageId(2026-11-10 用户确认,勿改)。用 Map 保持插入顺序,子串匹配依赖该顺序。 */
|
|
17
|
-
const MENU_PAGES = new Map([
|
|
18
|
+
export const MENU_PAGES = new Map([
|
|
18
19
|
['直销合同', '881124906081886244'],
|
|
19
20
|
['直销业绩', '846297265322576586'],
|
|
20
21
|
['合同收款', '846297265322576589'],
|
|
@@ -22,7 +23,7 @@ const MENU_PAGES = new Map([
|
|
|
22
23
|
['渠道订单', '881210951456350225'],
|
|
23
24
|
['渠道订单-商务', '881211329321197671'],
|
|
24
25
|
]);
|
|
25
|
-
const ALIASES = new Map([
|
|
26
|
+
export const ALIASES = new Map([
|
|
26
27
|
['e-cology合同', '直销合同'],
|
|
27
28
|
['e-cology 合同', '直销合同'],
|
|
28
29
|
['合同数据', '直销合同'],
|
|
@@ -52,14 +53,19 @@ const ALIASES = new Map([
|
|
|
52
53
|
* 不在本表内,继续用 ebdf 列表卡打开。渠道订单同时含 e-office 与 e-teams 产品数据,
|
|
53
54
|
* 默认落 e-teams 标签(用户确认),用户可在页面自行切换。
|
|
54
55
|
*/
|
|
55
|
-
const LEDGER_VIEW_KEYS = new Map([
|
|
56
|
+
export const LEDGER_VIEW_KEYS = new Map([
|
|
56
57
|
['直销合同', 'ecology'],
|
|
57
58
|
['直销业绩', 'directPerf'],
|
|
58
59
|
['渠道订单', 'etOrder'],
|
|
59
60
|
['渠道订单-商务', 'agree'],
|
|
60
61
|
]);
|
|
61
|
-
/**
|
|
62
|
-
|
|
62
|
+
/**
|
|
63
|
+
* 台账页 filters 可用键与值类型(来源:组件说明「默认筛选」)。
|
|
64
|
+
*
|
|
65
|
+
* 导出供 `contract.ledger.route` 复用:入口路由判定「条件能否预置到卡片」时
|
|
66
|
+
* 必须读这份白名单,**不得另抄一份**,否则卡片与判定会各说一套。
|
|
67
|
+
*/
|
|
68
|
+
export const LEDGER_FILTER_KINDS = {
|
|
63
69
|
ecology: {
|
|
64
70
|
khmc: 'text',
|
|
65
71
|
hth: 'text',
|
|
@@ -110,6 +116,44 @@ const DATE_TEXT = /^\d{4}-\d{2}-\d{2}$/u;
|
|
|
110
116
|
const AMOUNT_TEXT = /^-?\d+(\.\d+)?$/u;
|
|
111
117
|
/** 人员 ID:E10 人员主键是纯数字长串(如 732851919151005700);姓名一律视为非法值。 */
|
|
112
118
|
const PERSON_ID_TEXT = /^\d{6,32}$/u;
|
|
119
|
+
/**
|
|
120
|
+
* 归一化人员浏览框筛选值 → [{ id, name }]。
|
|
121
|
+
*
|
|
122
|
+
* 人员浏览框必须传数组对象,只传人员 ID 字符串时页面回显会丢失姓名。
|
|
123
|
+
* 为兼容旧调用,仍接受单个 { id, name } 对象;纯 ID 字符串按 name 为空处理。
|
|
124
|
+
*/
|
|
125
|
+
function normalizePersonFilterValue(key, raw) {
|
|
126
|
+
if (raw === null || raw === undefined || raw === '')
|
|
127
|
+
return [];
|
|
128
|
+
const list = Array.isArray(raw) ? raw : [raw];
|
|
129
|
+
const out = [];
|
|
130
|
+
for (const item of list) {
|
|
131
|
+
if (item === null || item === undefined || item === '')
|
|
132
|
+
continue;
|
|
133
|
+
if (typeof item === 'string') {
|
|
134
|
+
const text = item.trim();
|
|
135
|
+
if (!PERSON_ID_TEXT.test(text)) {
|
|
136
|
+
throw contractValidationError('ledger_filter_person_invalid', `${key} 的人员应为 [{ id, name }],收到 ${pyReprText(text)};可先用 hrm.employee.query 取人员 ID 与姓名。`);
|
|
137
|
+
}
|
|
138
|
+
out.push({ id: text, name: '' });
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
if (typeof item !== 'object' || Array.isArray(item)) {
|
|
142
|
+
throw contractValidationError('ledger_filter_person_invalid', `${key} 的人员应为 [{ id, name }] 数组,元素需为对象,收到 ${pyReprText(pyStr(item))}。`);
|
|
143
|
+
}
|
|
144
|
+
const record = item;
|
|
145
|
+
const id = String(record.id ?? '').trim();
|
|
146
|
+
const name = String(record.name ?? '').trim();
|
|
147
|
+
if (!PERSON_ID_TEXT.test(id)) {
|
|
148
|
+
throw contractValidationError('ledger_filter_person_invalid', `${key} 的人员元素缺少合法 id(纯数字人员主键),收到 ${pyReprText(id)};可先用 hrm.employee.query 取 id。`);
|
|
149
|
+
}
|
|
150
|
+
if (!name) {
|
|
151
|
+
throw contractValidationError('ledger_filter_person_invalid', `${key} 的人员元素缺少 name(人员姓名),请按 { id, name } 两项传入。`);
|
|
152
|
+
}
|
|
153
|
+
out.push({ id, name });
|
|
154
|
+
}
|
|
155
|
+
return out;
|
|
156
|
+
}
|
|
113
157
|
const FIELD_KEY = /^field_\d+$/u;
|
|
114
158
|
const PAGE_ID = /^\d{6,}$/u;
|
|
115
159
|
const ORIGIN = /^https?:\/\/[^/]+$/u;
|
|
@@ -182,6 +226,37 @@ function cleanOrigin(raw) {
|
|
|
182
226
|
}
|
|
183
227
|
return origin;
|
|
184
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* 解析卡片所需 origin。
|
|
231
|
+
*
|
|
232
|
+
* 2026-11-19:显式入参缺省时回落到**会话 baseUrl 的 scheme+host**。
|
|
233
|
+
* 事故背景:文档一直写 `"origin":"{baseUrl}"`,而 CLI 拒收这个占位符
|
|
234
|
+
* (`origin_placeholder`),且全库没有替换器——模型拿不到业务域名时,
|
|
235
|
+
* 会转而去「接管浏览器查页面」。这里按 `contract.modeltext.list` 的既有模式
|
|
236
|
+
* (`session.baseUrl` 拼接)自行解析,去掉模型对 host 的依赖。
|
|
237
|
+
*
|
|
238
|
+
* 显式传了非法 origin 仍然报错,不做静默兜底。
|
|
239
|
+
*/
|
|
240
|
+
async function resolveOrigin(raw, context) {
|
|
241
|
+
const provided = stripOrEmpty(raw);
|
|
242
|
+
if (provided)
|
|
243
|
+
return cleanOrigin(provided);
|
|
244
|
+
const session = await context.host.getSession();
|
|
245
|
+
const base = stripOrEmpty(session?.baseUrl);
|
|
246
|
+
if (!base) {
|
|
247
|
+
throw contractValidationError('origin_unavailable', '缺少 origin,且当前会话没有 baseUrl 可回落;请显式传 scheme+host(形如 https://your-e10.example.com)');
|
|
248
|
+
}
|
|
249
|
+
// 会话 baseUrl 可能带路径(如 https://host/sp/contract),取 scheme+host 再交给 cleanOrigin 校验。
|
|
250
|
+
let normalized = base;
|
|
251
|
+
try {
|
|
252
|
+
const parsed = new URL(base);
|
|
253
|
+
normalized = `${parsed.protocol}//${parsed.host}`;
|
|
254
|
+
}
|
|
255
|
+
catch {
|
|
256
|
+
// 不是完整 URL 时原样交给 cleanOrigin 报错,不静默兜底
|
|
257
|
+
}
|
|
258
|
+
return cleanOrigin(normalized);
|
|
259
|
+
}
|
|
185
260
|
function parseComParams(pairs, rawJson) {
|
|
186
261
|
const pairList = Array.isArray(pairs) ? pairs : [];
|
|
187
262
|
const jsonText = typeof rawJson === 'string' && rawJson.trim() ? rawJson : '';
|
|
@@ -326,17 +401,7 @@ function parseLedgerFilters(pairs, rawJson, viewKey) {
|
|
|
326
401
|
continue;
|
|
327
402
|
}
|
|
328
403
|
if (kind === 'person') {
|
|
329
|
-
|
|
330
|
-
throw contractValidationError('ledger_filter_person_invalid', `${key} 只接受单个人员 ID 字符串(如 "732851919151005700"),不要传数组;多人请分别出卡或改走取数链路。`);
|
|
331
|
-
}
|
|
332
|
-
if (raw !== null && typeof raw === 'object') {
|
|
333
|
-
throw contractValidationError('ledger_filter_person_invalid', `${key} 需要人员 ID 字符串,不能传对象。`);
|
|
334
|
-
}
|
|
335
|
-
const personId = raw === null || raw === undefined ? '' : typeof raw === 'string' ? raw.trim() : pyStr(raw);
|
|
336
|
-
if (personId && !PERSON_ID_TEXT.test(personId)) {
|
|
337
|
-
throw contractValidationError('ledger_filter_person_invalid', `${key} 需要纯数字人员 ID,收到 ${pyReprText(personId)};传姓名页面不生效,可先用 hrm.employee.query 取 id。`);
|
|
338
|
-
}
|
|
339
|
-
out[key] = personId;
|
|
404
|
+
out[key] = normalizePersonFilterValue(key, raw);
|
|
340
405
|
continue;
|
|
341
406
|
}
|
|
342
407
|
if (Array.isArray(raw) || (raw !== null && typeof raw === 'object')) {
|
|
@@ -435,8 +500,16 @@ function selfCheckLedger(card, viewKey) {
|
|
|
435
500
|
}
|
|
436
501
|
}
|
|
437
502
|
else if (kind === 'person') {
|
|
438
|
-
if (
|
|
439
|
-
bad.push(`filters
|
|
503
|
+
if (!Array.isArray(value)) {
|
|
504
|
+
bad.push(`filters 人员键必须是 [{ id, name }] 数组:${key}`);
|
|
505
|
+
}
|
|
506
|
+
else if (value.some((item) => !item
|
|
507
|
+
|| typeof item !== 'object'
|
|
508
|
+
|| Array.isArray(item)
|
|
509
|
+
|| typeof item.id !== 'string'
|
|
510
|
+
|| !PERSON_ID_TEXT.test(String(item.id))
|
|
511
|
+
|| typeof item.name !== 'string')) {
|
|
512
|
+
bad.push(`filters 人员键元素必须是含 id(人员主键)与 name(姓名的对象):${key}`);
|
|
440
513
|
}
|
|
441
514
|
}
|
|
442
515
|
else if (typeof value !== 'string') {
|
|
@@ -506,9 +579,9 @@ function selfCheck(card, pageId) {
|
|
|
506
579
|
* 注意:returned `card` 可直接作为 `<browsertool>` 内的 JSON 使用;
|
|
507
580
|
* `selfCheck` 非空表示结构不达标,禁止交付。
|
|
508
581
|
*/
|
|
509
|
-
export const
|
|
510
|
-
name: 'contract.card
|
|
511
|
-
async execute(input) {
|
|
582
|
+
export const contractLedgerCardOperation = {
|
|
583
|
+
name: 'contract.ledger.card',
|
|
584
|
+
async execute(input, context) {
|
|
512
585
|
const rawPageId = stripOrEmpty(input.pageId);
|
|
513
586
|
let menu;
|
|
514
587
|
let pageId;
|
|
@@ -525,7 +598,7 @@ export const contractCardEbdfListOperation = {
|
|
|
525
598
|
menu = resolved.menu;
|
|
526
599
|
pageId = resolved.pageId;
|
|
527
600
|
}
|
|
528
|
-
const origin =
|
|
601
|
+
const origin = await resolveOrigin(input.origin, context);
|
|
529
602
|
const viewKey = LEDGER_VIEW_KEYS.get(menu);
|
|
530
603
|
const titleInput = stripOrEmpty(input.title);
|
|
531
604
|
const title = titleInput || menu;
|
|
@@ -590,4 +663,4 @@ export const contractCardEbdfListOperation = {
|
|
|
590
663
|
};
|
|
591
664
|
},
|
|
592
665
|
};
|
|
593
|
-
export const
|
|
666
|
+
export const contractLedgerCardOperations = [contractLedgerCardOperation];
|