weaver-work-cli 0.1.62 → 0.1.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{archive-S2VKZWQ3.js → archive-WUZKAEZ6.js} +5 -4
- package/dist/chunks/{archive-oa-HEDSIUUY.js → archive-oa-PN46RTI2.js} +5 -4
- package/dist/chunks/{asset-HYH4W357.js → asset-ZPC5VWZM.js} +5 -4
- package/dist/chunks/{asset-idle-N7REBNGL.js → asset-idle-DHGP3NYY.js} +5 -4
- package/dist/chunks/{attachment-content-VYYA75FR.js → attachment-content-JQDW3BIB.js} +3 -3
- package/dist/chunks/{blog-SLMZZICV.js → blog-JC47AIXK.js} +5 -4
- package/dist/chunks/{caizhilian-RV43KKBT.js → caizhilian-IKIHM77A.js} +5 -5
- package/dist/chunks/{calendar-DMVZ4OLY.js → calendar-GZTSJ57Y.js} +5 -4
- package/dist/chunks/{chunk-H6YOMI3U.js → chunk-26FCCU5O.js} +5 -3
- package/dist/chunks/{chunk-E5YD5JWR.js → chunk-3PCXBG4H.js} +1 -1
- package/dist/chunks/{chunk-UBRWONP4.js → chunk-3W5NMGDS.js} +2 -2
- package/dist/chunks/{chunk-DTCQFTHW.js → chunk-4AFWOGOV.js} +3 -3
- package/dist/chunks/{chunk-VNYOUAWV.js → chunk-5QQKLR6H.js} +11 -11
- package/dist/chunks/{chunk-BQYX2UX5.js → chunk-6T5X6YWX.js} +5 -3
- package/dist/chunks/{chunk-KXJA42EA.js → chunk-AFZTMYGC.js} +1 -1
- package/dist/chunks/{chunk-YI2YMW5N.js → chunk-AGSO3PIK.js} +2 -2
- package/dist/chunks/{chunk-IW7A2IQY.js → chunk-C4YQJFZV.js} +43 -15
- package/dist/chunks/{chunk-WIWDVETN.js → chunk-FDBAFANU.js} +76 -76
- package/dist/chunks/{chunk-NRYDJN4J.js → chunk-FJUOUSV3.js} +89 -8
- package/dist/chunks/{chunk-EGANE35F.js → chunk-HLT6B26P.js} +1 -1
- package/dist/chunks/{chunk-P6TXQK75.js → chunk-HWA2A25Y.js} +5 -3
- package/dist/chunks/{chunk-T2KVJFWJ.js → chunk-I3MOFD6Q.js} +4 -7
- package/dist/chunks/chunk-IN6NXQ26.js +680 -0
- package/dist/chunks/{chunk-UBGWIXU3.js → chunk-INVYKG4I.js} +140 -45
- package/dist/chunks/{chunk-QBDXJS2W.js → chunk-K7QKQRSL.js} +168 -62
- package/dist/chunks/{chunk-BIA2NKUG.js → chunk-KDFEHDIB.js} +5 -5
- package/dist/chunks/{chunk-ILALC2N6.js → chunk-KYDXWYFB.js} +1 -1
- package/dist/chunks/{chunk-V2LASYKO.js → chunk-Q6D6PSMH.js} +30 -24
- package/dist/chunks/{chunk-UQFPF4EX.js → chunk-RMOH2GMF.js} +2 -2
- package/dist/chunks/{chunk-VBFBMM7G.js → chunk-SCMHG23G.js} +387 -70
- package/dist/chunks/chunk-TJN4PIYO.js +47 -0
- package/dist/chunks/{chunk-JFAWZX53.js → chunk-UPVAQJKS.js} +282 -131
- package/dist/chunks/{chunk-KY3R42RS.js → chunk-VLY5RTVO.js} +5 -3
- package/dist/chunks/{chunk-TEZHIB6T.js → chunk-WSHIOSGM.js} +5 -3
- package/dist/chunks/{chunk-6XSSAUNW.js → chunk-XHSEK2VM.js} +48 -12
- package/dist/chunks/{chunk-XT77MP54.js → chunk-YTFNMQO4.js} +410 -24
- package/dist/chunks/{conflict-GFJRS6I7.js → conflict-UUC7AFUI.js} +2 -2
- package/dist/chunks/{contract-U3ZGNRWB.js → contract-INMS7SYQ.js} +3051 -4497
- package/dist/chunks/{cowork-EX7PKIDK.js → cowork-34CBYVQP.js} +5 -4
- package/dist/chunks/{create-flow-EJZD434E.js → create-flow-YOR4QTAJ.js} +18 -6
- package/dist/chunks/{data-FOODGAMF.js → data-QKWI5325.js} +14 -3
- package/dist/chunks/{ebuilder-form-I2EOKODG.js → ebuilder-form-ZONRROK4.js} +4 -4
- package/dist/chunks/{ehr-TE4RFNID.js → ehr-2CONM7R6.js} +244 -151
- package/dist/chunks/{employee-DR5Y64TI.js → employee-PGMY6NI6.js} +1 -1
- package/dist/chunks/{entry-mode-ZOLSXEGX.js → entry-mode-S2ENJ6GZ.js} +3 -3
- package/dist/chunks/{env-TID5NFR6.js → env-ZSAXU5PJ.js} +2 -2
- package/dist/chunks/{esb-7L6MHYLB.js → esb-FQASCY2H.js} +8 -8
- package/dist/chunks/{factory-OG7BPMH5.js → factory-N76QQA53.js} +1 -1
- package/dist/chunks/{fna-6V2ENR3Y.js → fna-FCLVIWAS.js} +5 -4
- package/dist/chunks/{group-chat-5DKPWIHL.js → group-chat-UM665WDZ.js} +3 -3
- package/dist/chunks/{host-VTPAWDZV.js → host-2ED2KC4X.js} +4 -4
- package/dist/chunks/{host-TJ5VVHM7.js → host-2UYZEY2V.js} +4 -4
- package/dist/chunks/{host-3DLYA54R.js → host-46NYKDQP.js} +4 -4
- package/dist/chunks/{host-OGBHL75G.js → host-7IPZKIM4.js} +4 -4
- package/dist/chunks/{host-GOJHHTPY.js → host-P7G22WNM.js} +4 -4
- package/dist/chunks/{host-ONZC6AE7.js → host-XLCBLNJD.js} +4 -4
- package/dist/chunks/{hrm-2N7NFQDZ.js → hrm-XKL27NX2.js} +6 -6
- package/dist/chunks/{im-XCH47ZBN.js → im-NDYIMASG.js} +4 -4
- package/dist/chunks/{invoice-5KJ7T774.js → invoice-MOGNB6HN.js} +4 -4
- package/dist/chunks/{jiuchuanhui-PL6DRPBM.js → jiuchuanhui-3T5X7SB7.js} +5 -4
- package/dist/chunks/{lazy-dispatch-UATEN7H7.js → lazy-dispatch-4WOIL3ZQ.js} +5 -5
- package/dist/chunks/{mail-Q7Z4CQ4D.js → mail-P7VMUKQW.js} +5 -4
- package/dist/chunks/{meeting-5E3BNARL.js → meeting-MMTYDHXA.js} +16 -15
- package/dist/chunks/{minute-doc-NXRE5C77.js → minute-doc-LCSBWGJ3.js} +4 -4
- package/dist/chunks/{okr-3O3XNYOK.js → okr-VZXRQGS4.js} +5 -4
- package/dist/chunks/{operations-EZWG72FH.js → operations-MI2BSKZX.js} +5 -5
- package/dist/chunks/{performance-Y7CPNSOR.js → performance-OPEQNW7Y.js} +873 -17
- package/dist/chunks/{plan-BLGPZF5M.js → plan-TJAS4N5X.js} +5 -4
- package/dist/chunks/{project-6MZMLJMP.js → project-CYBGU6K6.js} +5 -4
- package/dist/chunks/{reception-F2VT2X52.js → reception-3FT2F66K.js} +3 -3
- package/dist/chunks/{recruit-stage-4ETIBMIW.js → recruit-stage-WPGB5BDJ.js} +654 -336
- package/dist/chunks/{registry-3FYSWV3U.js → registry-BAWCWV4D.js} +3 -3
- package/dist/chunks/{registry-I4DVPDMU.js → registry-FNI5E76J.js} +12 -12
- package/dist/chunks/{registry-3UGIWH53.js → registry-JMNOXRST.js} +2 -2
- package/dist/chunks/{registry-7RS74TCK.js → registry-QRMXRSCT.js} +5 -5
- package/dist/chunks/{room-recommend-GWCVKCXW.js → room-recommend-I7QQRHEL.js} +4 -4
- package/dist/chunks/{schedule-6AN63MJQ.js → schedule-3P7EWGNZ.js} +4 -4
- package/dist/chunks/{smart-extract-SR4SJJKN.js → smart-extract-FOBSVNYW.js} +3 -3
- package/dist/chunks/{workflow-KF7FA2UQ.js → workflow-U2KKTVQY.js} +10 -7
- package/dist/index.js +34 -34
- package/dist/internal/e10/auth/commands.js +203 -44
- package/dist/internal/e10/auth/xiaoe.js +6 -2
- package/dist/internal/e10/auth-recovery.js +28 -2
- package/dist/internal/e10/request-runtime.js +15 -3
- package/dist/internal/e10/request-trace.js +65 -0
- package/dist/shortcuts/contract/data/metric-catalog.js +149 -0
- package/dist/shortcuts/contract/error-actions.js +112 -0
- package/dist/shortcuts/contract/errors.js +9 -1
- package/dist/shortcuts/contract/index.js +14 -39
- package/dist/shortcuts/contract/manifest.js +130 -274
- package/dist/shortcuts/contract/operations/compare-report.js +437 -0
- package/dist/shortcuts/contract/operations/compare.js +2 -0
- package/dist/shortcuts/contract/operations/docx-slots.js +112 -5
- package/dist/shortcuts/contract/operations/docx-verify.js +2 -70
- package/dist/shortcuts/contract/operations/elements-build.js +82 -56
- package/dist/shortcuts/contract/operations/elements-spec.js +140 -3
- package/dist/shortcuts/contract/operations/first-screen.js +96 -207
- package/dist/shortcuts/contract/operations/flow.js +19 -1
- package/dist/shortcuts/contract/operations/{card-ebdf-list.js → ledger-card.js} +123 -27
- package/dist/shortcuts/contract/operations/ledger.js +343 -1
- package/dist/shortcuts/contract/operations/metrics.js +93 -0
- package/dist/shortcuts/contract/operations/modeltext.js +3 -3
- package/dist/shortcuts/contract/operations/money.js +90 -0
- package/dist/shortcuts/contract/operations/page.js +8 -4
- package/dist/shortcuts/contract/operations/performance.js +53 -0
- package/dist/shortcuts/contract/operations/placeholder-scan.js +104 -0
- package/dist/shortcuts/contract/operations/quote-recognize.js +326 -0
- package/dist/shortcuts/contract/operations/quote-ref.js +179 -0
- package/dist/shortcuts/contract/operations/quote-submit.js +281 -0
- package/dist/shortcuts/contract/operations/quote.js +66 -12
- package/dist/shortcuts/contract/operations/recommend.js +42 -1
- package/dist/shortcuts/contract/operations/registry.js +16 -23
- package/dist/shortcuts/contract/operations/{card-risk-report.js → review-report.js} +24 -114
- package/dist/shortcuts/contract/operations/review.js +33 -167
- package/dist/shortcuts/contract/operations/save-recognize.js +173 -43
- package/dist/shortcuts/contract/operations/solutions-spec.js +79 -0
- package/dist/shortcuts/contract/operations/triage.js +68 -15
- package/dist/shortcuts/contract/operations/{template.js → type-clause-read.js} +10 -25
- package/dist/shortcuts/contract/operations/upload.js +17 -11
- package/dist/shortcuts/contract/prewarm-cache.js +6 -2
- package/dist/shortcuts/contract/prewarm.js +33 -23
- package/dist/shortcuts/contract/recommend-cache.js +191 -0
- package/dist/shortcuts/data/operations/shared.js +14 -1
- package/dist/shortcuts/ehr/operations/recruit-interview-overview.js +85 -62
- package/dist/shortcuts/ehr/operations/recruit-position.js +21 -13
- package/dist/shortcuts/ehr/operations/recruit-short-cache.js +59 -0
- package/dist/shortcuts/ehr/operations/recruit-tag.js +17 -11
- package/dist/shortcuts/ehr/operations/recruit-write.js +118 -70
- package/dist/shortcuts/ehr/operations/recruit.js +338 -121
- package/dist/shortcuts/hrm/operations/employee.js +64 -17
- package/dist/shortcuts/hrm/operations/resolve.js +419 -369
- package/dist/shortcuts/im/host.js +38 -22
- package/dist/shortcuts/meeting/operations/eb/conflict.js +60 -2
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +138 -15
- package/dist/shortcuts/meeting/operations/eb/create-form-link.js +380 -0
- package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +1 -3
- package/dist/shortcuts/performance/flow-utils.js +363 -0
- package/dist/shortcuts/performance/manifest.js +2 -2
- package/dist/shortcuts/performance/operations/flow-detail.js +85 -0
- package/dist/shortcuts/performance/operations/flow-list.js +213 -0
- package/dist/shortcuts/performance/operations/flow-score.js +241 -0
- package/dist/shortcuts/performance/operations/registry.js +6 -0
- package/dist/shortcuts/recruit-stage/batch-store.js +44 -0
- package/dist/shortcuts/recruit-stage/context.js +75 -9
- package/dist/shortcuts/recruit-stage/manifest.js +1 -1
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +33 -22
- package/dist/shortcuts/recruit-stage/operations/list.js +187 -37
- package/dist/shortcuts/recruit-stage/operations/registry.js +2 -0
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +231 -313
- package/dist/shortcuts/recruit-stage/operations/search.js +5 -5
- package/dist/shortcuts/recruit-stage/operations/tag.js +286 -0
- package/dist/shortcuts/workflow/endpoints.js +2 -0
- package/dist/shortcuts/workflow/operations/form.js +12 -15
- package/dist/shortcuts/workflow/operations/read.js +8 -8
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoListRows.js +3 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +7 -6
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +4 -3
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +1 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +33 -6
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.prepareQuery.js +153 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/workflowClarification.js +232 -0
- package/dist/shortcuts/workflow/operations.js +5 -0
- package/docs/contract.md +2 -2
- package/docs/e10-auth.md +55 -2
- package/docs/ehr.md +1 -1
- package/package.json +1 -1
- package/skills/weaver-e10-hrm/SKILL.md +3 -3
- package/skills/weaver-e10-hrm/references/employee.md +13 -2
- package/skills/weaver-e10-jinchengda/SKILL.md +283 -345
- package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +7 -14
- package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +21 -12
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +126 -202
- package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +13 -5
- package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +28 -20
- package/skills/weaver-e10-jinchengda/references/contract-clause-recommender.md +12 -17
- package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +7 -13
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +47 -16
- package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +10 -18
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +19 -18
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +114 -61
- package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +8 -2
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +78 -112
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +67 -333
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +18 -15
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +80 -84
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +38 -34
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +132 -47
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +108 -217
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +14 -20
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +13 -7
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +86 -46
- package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +12 -10
- package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +22 -14
- package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +18 -18
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +27 -26
- package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +252 -0
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +15 -23
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +290 -104
- package/skills/weaver-e10-jinchengda/references/contract-request-status.md +5 -12
- package/skills/weaver-e10-jinchengda/references/contract-request-write.md +12 -18
- package/skills/weaver-e10-jinchengda/references/contract-signing-subjects.md +11 -17
- package/skills/weaver-e10-jinchengda/references/contract-subject-create.md +5 -11
- package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +56 -7
- package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +12 -12
- package/skills/weaver-e10-jinchengda/references/contract-workflow-discovery.md +10 -16
- package/skills/weaver-e10-jinchengda/references/orchestration.md +33 -35
- package/skills/weaver-e10-jucailin/SKILL.md +6 -7
- package/skills/weaver-e10-jucailin/agents/openai.yaml +52 -0
- package/skills/weaver-e10-jucailin/references/recruit-interview-overview.md +8 -6
- package/skills/weaver-e10-jucailin/references/recruit-read.md +4 -0
- package/skills/weaver-e10-jucailin/references/recruit-screening-to-interview-sop.md +2 -2
- package/skills/weaver-e10-jucailin/references/recruit-write.md +4 -4
- package/skills/weaver-e10-meeting/SKILL.md +87 -534
- package/skills/weaver-e10-meeting/references/commands-table.md +61 -0
- package/skills/weaver-e10-meeting/references/create-commands.md +136 -0
- package/skills/weaver-e10-meeting/references/create-flow.md +9 -7
- package/skills/weaver-e10-meeting/references/create-guardrails.md +23 -17
- package/skills/weaver-e10-meeting/references/custom-fields.md +40 -0
- package/skills/weaver-e10-meeting/references/eb-contracts.md +60 -0
- package/skills/weaver-e10-meeting/references/invitation.md +69 -0
- package/skills/weaver-e10-meeting/references/meeting-eb.md +26 -26
- package/skills/weaver-e10-meeting/references/meeting-invitation.md +2 -2
- package/skills/weaver-e10-meeting/references/meeting-minute-file.md +2 -2
- package/skills/weaver-e10-meeting/references/meeting-verification.md +1 -1
- package/skills/weaver-e10-meeting/references/minutes-pipeline.md +119 -0
- package/skills/weaver-e10-meeting/references/pitfalls.md +1 -1
- package/skills/weaver-e10-meeting/references/room-recommend.md +88 -0
- package/skills/weaver-e10-performance/SKILL.md +45 -5
- package/skills/weaver-e10-performance/agents/openai.yaml +26 -2
- package/skills/weaver-e10-performance/references/flow-api.md +128 -0
- package/skills/weaver-e10-performance/references/flow-assess.md +149 -0
- package/skills/weaver-e10-recruit-stage/SKILL.md +317 -266
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +22 -27
- package/skills/weaver-e10-recruit-stage/references/env-ziyong.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +30 -27
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +2 -6
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +12 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +2 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +23 -19
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-template.md +3 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +18 -16
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +25 -23
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +10 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +11 -11
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +150 -85
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +14 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +173 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-taxonomy.json +76 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +3 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +2 -2
- package/skills/weaver-e10-workflow/SKILL.md +49 -32
- package/skills/weaver-e10-workflow/references/todo-dialogue.md +67 -34
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +65 -51
- package/skills/weaver-e10-workflow/references/workflow-agent-entry.md +18 -11
- package/skills/weaver-e10-workflow/references/workflow-create.md +2 -2
- package/skills/weaver-e10-workflow/references/workflow-memory.md +19 -37
- package/skills/weaver-e10-workflow/references/workflow-query.md +25 -22
- package/skills/weaver-e10-workflow/references/workflow-view.md +1 -1
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +318 -110
- package/skills/weaver-e10-yimiaoban/SKILL.md +17 -14
- package/skills/weaver-e10-yimiaoban/references/person.md +1 -1
- package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +1 -1
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +9 -9
- package/dist/chunks/chunk-6QYNE6HE.js +0 -658
- package/dist/chunks/chunk-SHYQUBY3.js +0 -48
- package/dist/shortcuts/contract/operations/card-action.js +0 -1266
- package/dist/shortcuts/contract/operations/card-plan.js +0 -393
- package/dist/shortcuts/contract/operations/card.js +0 -232
- package/dist/shortcuts/contract/operations/compare-screen.js +0 -378
- package/dist/shortcuts/contract/operations/quote-to-contract.js +0 -495
- package/dist/shortcuts/contract/operations/quotescreen.js +0 -529
- package/dist/shortcuts/contract/operations/summary-validate.js +0 -293
- package/dist/shortcuts/contract/operations/summary.js +0 -187
- package/dist/shortcuts/ehr/recruit-stage/batch-store.js +0 -78
- package/dist/shortcuts/ehr/recruit-stage/context.js +0 -231
- package/dist/shortcuts/ehr/recruit-stage/continuation.js +0 -74
- package/dist/shortcuts/ehr/recruit-stage/errors.js +0 -65
- package/dist/shortcuts/ehr/recruit-stage/fs-scan.js +0 -165
- package/dist/shortcuts/ehr/recruit-stage/host.js +0 -109
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +0 -1065
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-feedback.js +0 -295
- package/dist/shortcuts/ehr/recruit-stage/operations/jd-create.js +0 -961
- package/dist/shortcuts/ehr/recruit-stage/operations/list.js +0 -431
- package/dist/shortcuts/ehr/recruit-stage/operations/registry.js +0 -50
- package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +0 -1655
- package/dist/shortcuts/ehr/recruit-stage/operations/search.js +0 -158
- package/dist/shortcuts/ehr/recruit-stage/operations/types.js +0 -34
- package/dist/shortcuts/ehr/recruit-stage/runtime.js +0 -31
- package/dist/shortcuts/ehr/recruit-stage/school-tiers.json +0 -318
- package/dist/shortcuts/ehr/recruit-stage/shared.js +0 -887
- package/skills/weaver-e10-jinchengda/references/contract-action-card-template.html +0 -22
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +0 -554
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +0 -279
- package/skills/weaver-e10-jinchengda/references/contract-card-render-internals.md +0 -483
- package/skills/weaver-e10-jinchengda/references/contract-template-selector.md +0 -46
- package/skills/weaver-e10-recruit-stage/lib/recruit-resume-photo.py +0 -194
|
@@ -1,393 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from 'node:fs';
|
|
2
|
-
import { resolve } from 'node:path';
|
|
3
|
-
import { contractValidationError } from '../errors.js';
|
|
4
|
-
/**
|
|
5
|
-
* 合同动作推荐引擎(本地,零依赖)。
|
|
6
|
-
*
|
|
7
|
-
* 迁移自 `scripts/plan_actions.py`(2026-11-12 第一批)。
|
|
8
|
-
* 原脚本把注册表、requires、抑制、排序、截断固化为可执行逻辑,
|
|
9
|
-
* 模型只提供上下文状态 JSON,不再自行推断卡片条数。
|
|
10
|
-
*
|
|
11
|
-
* 语义对齐要求:本实现与 Python 版**逐字段等价**,包括
|
|
12
|
-
* Python 的真值规则(`[]` / `{}` 为假)、`"set"` 判定(`0` 视为未设置)、
|
|
13
|
-
* 以及 `(-weight, id)` 的排序与 4 张卡片截断。
|
|
14
|
-
*/
|
|
15
|
-
const MAX_CARDS = 4;
|
|
16
|
-
const EMPTY_HINT = '按 contract-action-engine.md §7 空结果处理:不出卡片,说明缺什么与补法';
|
|
17
|
-
/** scene = doc(默认)时的动作域。 */
|
|
18
|
-
const ACTIONS = [
|
|
19
|
-
{
|
|
20
|
-
id: 'generate-contract',
|
|
21
|
-
title: '按报价单生成合同',
|
|
22
|
-
weight: 100,
|
|
23
|
-
walk: 'sendQuestion',
|
|
24
|
-
desc: '用真实模板把标的与金额填成合同 docx | 缺 .docx 模板 | 3~5 步 · 确认 1 次',
|
|
25
|
-
requires: { docType: ['quote', 'tender'] },
|
|
26
|
-
blocked: ['generatedDocx'],
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
id: 'launch-flow',
|
|
30
|
-
// 两条成立路径(2026-11-16 修复):
|
|
31
|
-
// ① flowKey 已定且有流程文件 → 直开表单并回填(walk=e10Sdk);
|
|
32
|
-
// ② 报价单刚转出合同、flowKey 未定且未上传 → 只给提示语,点击走 sendQuestion。
|
|
33
|
-
//
|
|
34
|
-
// 旧实现 requires 硬要求 `flowKey` + `hasFileId`,与「生成后不上传、不传 flowKey」
|
|
35
|
-
// 的定稿规则直接冲突:过滤发生在 requires 阶段,抑制规则里的
|
|
36
|
-
// 「flowKey=null 不抑制 launch-flow」根本轮不到执行,该卡在本场景永远消失。
|
|
37
|
-
title: '发起「{flowKey}」合同流程',
|
|
38
|
-
weight: 100,
|
|
39
|
-
walk: 'e10Sdk',
|
|
40
|
-
desc: '生成正式审批单并进入流转 | 证据齐 | 4~7 步 · 确认 2 次',
|
|
41
|
-
requires: {},
|
|
42
|
-
any_of: [{ flowKey: 'set', hasFileId: true }, { generatedDocx: true, flowTypeUndetermined: true }],
|
|
43
|
-
blocked: ['submitted'],
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
id: 'review',
|
|
47
|
-
title: '合同预审',
|
|
48
|
-
weight: 92,
|
|
49
|
-
walk: 'sendQuestion',
|
|
50
|
-
desc: '发消息让 AI 出风险条款与修改建议 | 只读,不改原文',
|
|
51
|
-
requires: { hasFileId: true },
|
|
52
|
-
// 已经触发过审查(reviewStarted)就不再给「合同预审」,避免重复触发
|
|
53
|
-
blocked: ['reviewed', 'reviewStarted'],
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
id: 'export-review',
|
|
57
|
-
title: '导出审查报告',
|
|
58
|
-
weight: 84,
|
|
59
|
-
walk: 'artifact',
|
|
60
|
-
desc: '查看风险条款、问题说明与建议修改 | 只读 | 点开即看',
|
|
61
|
-
// 只有「已拿到审查结果」才允许导出;reviewStarted 但无结果时不得出现
|
|
62
|
-
requires: { reviewed: true },
|
|
63
|
-
blocked: [],
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
id: 'view-compare',
|
|
67
|
-
title: '查看比对详情',
|
|
68
|
-
weight: 82,
|
|
69
|
-
walk: 'e10Sdk',
|
|
70
|
-
desc: '左右对照看两版差异 | 只读,仅开页面',
|
|
71
|
-
requires: { compared: true },
|
|
72
|
-
blocked: [],
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
id: 'view-review',
|
|
76
|
-
title: '查看审查详情',
|
|
77
|
-
weight: 80,
|
|
78
|
-
walk: 'e10Sdk',
|
|
79
|
-
desc: '打开 AI 审查页看逐条判定与原文定位 | 只读,不改原文',
|
|
80
|
-
// 审查进行中(reviewStarted)与已出结果(reviewed)两种情况都要给:
|
|
81
|
-
// 前者是用户稍后回来看进度的唯一入口,后者可看逐条判定
|
|
82
|
-
requires: {},
|
|
83
|
-
any_of: [{ reviewed: true }, { reviewStarted: true }],
|
|
84
|
-
blocked: [],
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
id: 'export-compare-report',
|
|
88
|
-
title: '生成比对报告',
|
|
89
|
-
weight: 78,
|
|
90
|
-
walk: 'artifact',
|
|
91
|
-
desc: '出四指标统计与差异清单 | 只读 | 点开即看',
|
|
92
|
-
requires: { compared: true },
|
|
93
|
-
blocked: [],
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
id: 'credit',
|
|
97
|
-
title: '查对方资信',
|
|
98
|
-
weight: 72,
|
|
99
|
-
walk: 'e10Sdk',
|
|
100
|
-
desc: '看诉讼/被执行/工商变更 | 只开页面,只读',
|
|
101
|
-
requires: { hasCounterparty: true },
|
|
102
|
-
blocked: [],
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
id: 'request-status',
|
|
106
|
-
title: '查这份合同的审批进度',
|
|
107
|
-
weight: 70,
|
|
108
|
-
walk: 'sendQuestion',
|
|
109
|
-
desc: '看当前节点与审批意见 | 只读 | 1~2 步',
|
|
110
|
-
requires: { submitted: true, requestId: 'set' },
|
|
111
|
-
blocked: [],
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
id: 'compare',
|
|
115
|
-
title: '比对两份合同',
|
|
116
|
-
weight: 60,
|
|
117
|
-
walk: 'e10Sdk',
|
|
118
|
-
desc: '逐条比差异 | 需两份文件 | 2~3 步',
|
|
119
|
-
requires: { otherVersionAvailable: true },
|
|
120
|
-
blocked: ['compared'],
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
id: 'clause-rewrite',
|
|
124
|
-
title: '按建议改条款',
|
|
125
|
-
weight: 56,
|
|
126
|
-
walk: 'sendQuestion',
|
|
127
|
-
desc: '把建议条款写回合同 | 会改原文 | 需确认 2 次',
|
|
128
|
-
requires: { reviewed: true },
|
|
129
|
-
blocked: [],
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
id: 'summary',
|
|
133
|
-
title: '查看合同摘要',
|
|
134
|
-
weight: 28,
|
|
135
|
-
walk: 'artifact',
|
|
136
|
-
desc: '要素、标的与关键条款 | 只读 | 点开即看',
|
|
137
|
-
requires: { summaryReady: true },
|
|
138
|
-
blocked: [],
|
|
139
|
-
},
|
|
140
|
-
];
|
|
141
|
-
/** scene ≠ doc 时的动作域(query / config 不处理合同文件)。 */
|
|
142
|
-
const QUERY_ACTIONS = [
|
|
143
|
-
{
|
|
144
|
-
id: 'query-contracts',
|
|
145
|
-
title: '查我负责的合同',
|
|
146
|
-
weight: 100,
|
|
147
|
-
walk: 'sendQuestion',
|
|
148
|
-
desc: '按负责人查合同列表 | 只读',
|
|
149
|
-
requires: {},
|
|
150
|
-
blocked: [],
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
id: 'query-performance',
|
|
154
|
-
title: '查直销业绩',
|
|
155
|
-
weight: 90,
|
|
156
|
-
walk: 'sendQuestion',
|
|
157
|
-
desc: '按期间汇总直销业绩 | 只读',
|
|
158
|
-
requires: {},
|
|
159
|
-
blocked: [],
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
id: 'query-receipts',
|
|
163
|
-
title: '查合同收款',
|
|
164
|
-
weight: 80,
|
|
165
|
-
walk: 'sendQuestion',
|
|
166
|
-
desc: '按合同号查收款台账 | 只读',
|
|
167
|
-
requires: {},
|
|
168
|
-
blocked: [],
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
id: 'query-channel',
|
|
172
|
-
title: '查渠道订单',
|
|
173
|
-
weight: 70,
|
|
174
|
-
walk: 'sendQuestion',
|
|
175
|
-
desc: '按渠道查订单 | 只读',
|
|
176
|
-
requires: {},
|
|
177
|
-
blocked: [],
|
|
178
|
-
},
|
|
179
|
-
];
|
|
180
|
-
/**
|
|
181
|
-
* doc 场景的跨域补位动作(contract-action-engine.md §5)。
|
|
182
|
-
*
|
|
183
|
-
* 仅允许「与当前这份文件相关」的两条:客户历史合同、该合同收款。
|
|
184
|
-
* 业绩 / 渠道订单 / 我的合同属全局查询,塞进文件上下文里是噪音,禁止补位。
|
|
185
|
-
* 2026-11-16 修复:旧实现完全没有补位步骤,doc 域动作不足 2 条时也不补。
|
|
186
|
-
*/
|
|
187
|
-
const DOC_TOPUP_ACTIONS = [
|
|
188
|
-
{
|
|
189
|
-
id: 'query-customer-contracts',
|
|
190
|
-
title: '查该客户的合同',
|
|
191
|
-
weight: 96,
|
|
192
|
-
walk: 'sendQuestion',
|
|
193
|
-
desc: '按客户主体查历史合同 | 只读',
|
|
194
|
-
requires: { hasCounterparty: true },
|
|
195
|
-
blocked: [],
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
id: 'query-contract-receipt',
|
|
199
|
-
title: '查该合同收款',
|
|
200
|
-
weight: 88,
|
|
201
|
-
walk: 'sendQuestion',
|
|
202
|
-
desc: '按客户或合同号查收款台账 | 只读',
|
|
203
|
-
requires: {},
|
|
204
|
-
any_of: [{ hasContractNo: true }, { hasCounterparty: true }],
|
|
205
|
-
blocked: [],
|
|
206
|
-
},
|
|
207
|
-
];
|
|
208
|
-
/** Python 真值语义:None/False/0/""/[]/{} 均为假。 */
|
|
209
|
-
function pyTruthy(value) {
|
|
210
|
-
if (value === null || value === undefined || value === false)
|
|
211
|
-
return false;
|
|
212
|
-
if (value === true)
|
|
213
|
-
return true;
|
|
214
|
-
if (typeof value === 'number')
|
|
215
|
-
return value !== 0 && !Number.isNaN(value);
|
|
216
|
-
if (typeof value === 'string')
|
|
217
|
-
return value.length > 0;
|
|
218
|
-
if (Array.isArray(value))
|
|
219
|
-
return value.length > 0;
|
|
220
|
-
if (typeof value === 'object')
|
|
221
|
-
return Object.keys(value).length > 0;
|
|
222
|
-
return true;
|
|
223
|
-
}
|
|
224
|
-
/** Python `==`:数字与布尔可互相相等(0 == False、1 == True)。 */
|
|
225
|
-
function pyEq(left, right) {
|
|
226
|
-
const toNum = (value) => {
|
|
227
|
-
if (typeof value === 'boolean')
|
|
228
|
-
return value ? 1 : 0;
|
|
229
|
-
if (typeof value === 'number')
|
|
230
|
-
return value;
|
|
231
|
-
return null;
|
|
232
|
-
};
|
|
233
|
-
const ln = toNum(left);
|
|
234
|
-
const rn = toNum(right);
|
|
235
|
-
if (ln !== null && rn !== null)
|
|
236
|
-
return ln === rn;
|
|
237
|
-
if (left === null || left === undefined)
|
|
238
|
-
return right === null || right === undefined;
|
|
239
|
-
return left === right;
|
|
240
|
-
}
|
|
241
|
-
function asText(value) {
|
|
242
|
-
if (value === null || value === undefined)
|
|
243
|
-
return '';
|
|
244
|
-
return String(value);
|
|
245
|
-
}
|
|
246
|
-
/** 单个条件组:全部为真才通过。 */
|
|
247
|
-
function matchOne(cond, ctx) {
|
|
248
|
-
for (const [key, expect] of Object.entries(cond)) {
|
|
249
|
-
const actual = ctx[key];
|
|
250
|
-
if (expect === 'set') {
|
|
251
|
-
// Python: actual in (None, "", False),其中 0 == False 也视为未设置
|
|
252
|
-
if (actual === null || actual === undefined || actual === '' || actual === false)
|
|
253
|
-
return false;
|
|
254
|
-
if (typeof actual === 'number' && actual === 0)
|
|
255
|
-
return false;
|
|
256
|
-
continue;
|
|
257
|
-
}
|
|
258
|
-
if (Array.isArray(expect)) {
|
|
259
|
-
if (!expect.some((item) => pyEq(actual, item)))
|
|
260
|
-
return false;
|
|
261
|
-
continue;
|
|
262
|
-
}
|
|
263
|
-
if (pyTruthy(actual) !== pyTruthy(expect))
|
|
264
|
-
return false;
|
|
265
|
-
}
|
|
266
|
-
return true;
|
|
267
|
-
}
|
|
268
|
-
/** requires 判定:requires 全真 且(无 any_of 或任一分支全真)。 */
|
|
269
|
-
function matches(action, ctx) {
|
|
270
|
-
if (!matchOne(action.requires ?? {}, ctx))
|
|
271
|
-
return false;
|
|
272
|
-
const anyOf = action.any_of;
|
|
273
|
-
if (anyOf && anyOf.length) {
|
|
274
|
-
if (!anyOf.some((cond) => matchOne(cond, ctx)))
|
|
275
|
-
return false;
|
|
276
|
-
}
|
|
277
|
-
return true;
|
|
278
|
-
}
|
|
279
|
-
/** 抑制判定:终态不回推、已完成不重复、本轮刚执行的不立刻回推。 */
|
|
280
|
-
function suppressed(action, ctx) {
|
|
281
|
-
for (const key of action.blocked ?? []) {
|
|
282
|
-
if (pyTruthy(ctx[key]))
|
|
283
|
-
return true;
|
|
284
|
-
}
|
|
285
|
-
return ctx.lastAction === action.id;
|
|
286
|
-
}
|
|
287
|
-
export function planActions(ctx) {
|
|
288
|
-
const rawScene = ctx.scene;
|
|
289
|
-
const scene = pyTruthy(rawScene) ? String(rawScene) : 'doc';
|
|
290
|
-
const pool = scene === 'query' || scene === 'config' ? QUERY_ACTIONS : ACTIONS;
|
|
291
|
-
const scored = pool.filter((action) => matches(action, ctx) && !suppressed(action, ctx));
|
|
292
|
-
scored.sort((left, right) => {
|
|
293
|
-
if (right.weight !== left.weight)
|
|
294
|
-
return right.weight - left.weight;
|
|
295
|
-
if (left.id < right.id)
|
|
296
|
-
return -1;
|
|
297
|
-
if (left.id > right.id)
|
|
298
|
-
return 1;
|
|
299
|
-
return 0;
|
|
300
|
-
});
|
|
301
|
-
let picked = scored.slice(0, MAX_CARDS);
|
|
302
|
-
// 跨域补位(contract-action-engine.md §5):doc 场景动作少于 2 条时,
|
|
303
|
-
// 从「与当前文件相关」的查询动作里补足。补位必须在 requires 过滤之后、
|
|
304
|
-
// 截断之前执行,且不覆盖已有动作。
|
|
305
|
-
if (scene === 'doc' && picked.length < 2) {
|
|
306
|
-
const seen = new Set(picked.map((action) => action.id));
|
|
307
|
-
for (const action of DOC_TOPUP_ACTIONS) {
|
|
308
|
-
if (picked.length >= 2)
|
|
309
|
-
break;
|
|
310
|
-
if (seen.has(action.id))
|
|
311
|
-
continue;
|
|
312
|
-
if (!matches(action, ctx) || suppressed(action, ctx))
|
|
313
|
-
continue;
|
|
314
|
-
picked = [...picked, action];
|
|
315
|
-
seen.add(action.id);
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
const flowKey = pyTruthy(ctx.flowKey) ? String(ctx.flowKey) : '';
|
|
319
|
-
// flowKey 未定 → 该卡是「提示语」而非真实流程入口:标题不带流程名,点击发消息。
|
|
320
|
-
// 同时避免 title 模板拼出「发起「」合同流程」这种空壳文案。
|
|
321
|
-
const launchIsHint = !pyTruthy(ctx.flowKey);
|
|
322
|
-
const cards = picked.map((action) => {
|
|
323
|
-
if (action.id === 'launch-flow' && launchIsHint) {
|
|
324
|
-
return {
|
|
325
|
-
id: action.id,
|
|
326
|
-
title: '发起合同流程',
|
|
327
|
-
weight: action.weight,
|
|
328
|
-
walk: 'sendQuestion',
|
|
329
|
-
desc: '按这份合同发起审批 | 由对话侧判定类型后办理 | 点后继续',
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
return {
|
|
333
|
-
id: action.id,
|
|
334
|
-
title: action.title.split('{flowKey}').join(flowKey),
|
|
335
|
-
weight: action.weight,
|
|
336
|
-
walk: action.walk,
|
|
337
|
-
desc: action.desc,
|
|
338
|
-
};
|
|
339
|
-
});
|
|
340
|
-
return {
|
|
341
|
-
scene,
|
|
342
|
-
count: cards.length,
|
|
343
|
-
title: `可做的 ${cards.length} 件事`,
|
|
344
|
-
cards,
|
|
345
|
-
dropped: scored.slice(MAX_CARDS).map((action) => action.id),
|
|
346
|
-
hint: cards.length ? '' : EMPTY_HINT,
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
function resolveContext(input) {
|
|
350
|
-
const direct = input.context;
|
|
351
|
-
if (direct && typeof direct === 'object' && !Array.isArray(direct)) {
|
|
352
|
-
return direct;
|
|
353
|
-
}
|
|
354
|
-
const file = typeof input.contextFile === 'string' && input.contextFile.trim() ? input.contextFile.trim() : '';
|
|
355
|
-
const inline = typeof input.contextJson === 'string' && input.contextJson.trim() ? input.contextJson.trim() : '';
|
|
356
|
-
if (!file && !inline) {
|
|
357
|
-
throw contractValidationError('context_required', '必须提供上下文:context(对象)、contextFile(JSON 文件路径)或 contextJson(JSON 字符串)三选一');
|
|
358
|
-
}
|
|
359
|
-
let raw;
|
|
360
|
-
if (file) {
|
|
361
|
-
try {
|
|
362
|
-
raw = readFileSync(resolve(file), 'utf8').replace(/^\uFEFF/u, '');
|
|
363
|
-
}
|
|
364
|
-
catch (error) {
|
|
365
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
366
|
-
throw contractValidationError('context_unreadable', `无法读取上下文 JSON:${message}`);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
else {
|
|
370
|
-
raw = inline;
|
|
371
|
-
}
|
|
372
|
-
let parsed;
|
|
373
|
-
try {
|
|
374
|
-
parsed = JSON.parse(raw);
|
|
375
|
-
}
|
|
376
|
-
catch (error) {
|
|
377
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
378
|
-
throw contractValidationError('context_invalid', `上下文不是合法 JSON:${message}`);
|
|
379
|
-
}
|
|
380
|
-
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
381
|
-
throw contractValidationError('context_invalid', '上下文必须是 JSON 对象');
|
|
382
|
-
}
|
|
383
|
-
return parsed;
|
|
384
|
-
}
|
|
385
|
-
export const contractCardPlanOperation = {
|
|
386
|
-
name: 'contract.card.plan',
|
|
387
|
-
async execute(input) {
|
|
388
|
-
const ctx = resolveContext(input);
|
|
389
|
-
return { status: 'COMPLETE', data: planActions(ctx) };
|
|
390
|
-
},
|
|
391
|
-
};
|
|
392
|
-
export const contractCardPlanOperations = [contractCardPlanOperation];
|
|
393
|
-
export { asText };
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
import { readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { basename, resolve } from 'node:path';
|
|
3
|
-
import { contractValidationError } from '../errors.js';
|
|
4
|
-
import { CARD_PANEL_WIDTH } from './card-action.js';
|
|
5
|
-
import { requireNonEmptyString } from './shared.js';
|
|
6
|
-
import { renderSummaryHtml } from './summary.js';
|
|
7
|
-
/**
|
|
8
|
-
* 行为卡片 HTML 渲染(本地,零依赖)。
|
|
9
|
-
*
|
|
10
|
-
* 定位:模型只产出「卡片清单 + 摘要数据」的紧凑 JSON(约 2~3 KB),
|
|
11
|
-
* 卡片骨架、事件绑定、ES5 脚本、browsertool 外壳全部由本 operation 生成。
|
|
12
|
-
*
|
|
13
|
-
* 为什么值得做(2026-11-09):
|
|
14
|
-
* 1. 手写卡片 HTML 是"点不动"的高发区(双引号截断、括号错位、漏 initialArtifactKeys)。
|
|
15
|
-
* 生成器固定输出,这三类错误从结构上不可能发生——这是主要收益。
|
|
16
|
-
* 2. 卡片从「逐张重复 HTML」改为「紧凑数组 + 循环生成」,
|
|
17
|
-
* 常驻体积从约 6 KB 降到约 2 KB(脚本只写一次)。
|
|
18
|
-
*
|
|
19
|
-
* 注意:browsertool 必须内联完整 HTML,所以模型回复的体积下限仍由成品 HTML 决定。
|
|
20
|
-
* 本 operation 靠"结构复用"降低成品体积,不承诺数量级的 token 下降。
|
|
21
|
-
*/
|
|
22
|
-
const CARD_SCRIPT = `(function(){
|
|
23
|
-
var root=document.getElementById('__UID__');
|
|
24
|
-
if(!root){return;}
|
|
25
|
-
var st=root.querySelector('[data-status]');
|
|
26
|
-
function say(m){if(st){st.textContent=m;}}
|
|
27
|
-
function plug(){
|
|
28
|
-
if(window.xiaoePlugin){return window.xiaoePlugin;}
|
|
29
|
-
if(window.rawWindow&&window.rawWindow.xiaoePlugin){return window.rawWindow.xiaoePlugin;}
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
var wrap=document.createElement('div');
|
|
33
|
-
root.insertBefore(wrap,st);
|
|
34
|
-
var cards=[];
|
|
35
|
-
var cb=root.querySelector('[data-cards]');
|
|
36
|
-
try{cards=JSON.parse(cb?cb.value:'[]');}catch(e){cards=[];}
|
|
37
|
-
var ICON={send:'📧',shield:'🛡',search:'🔍',doc:'📋',compare:'🔄',calc:'📊',link:'🔗'};
|
|
38
|
-
function run(c){
|
|
39
|
-
var a=c.action||{};
|
|
40
|
-
if('sendQuestion'.indexOf(a.type)>-1){
|
|
41
|
-
var ps=plug();
|
|
42
|
-
if(!ps||!ps.session||typeof ps.session.sendQuestion!=='function'){say('当前环境不支持发送会话消息');return;}
|
|
43
|
-
try{ps.session.sendQuestion({question:a.question||c.title||'',files:[]});say('已发送,正在处理');}
|
|
44
|
-
catch(e){say('发送失败,请重试');}
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
var p=plug();
|
|
48
|
-
if(!p||!p.rightPanel||typeof p.rightPanel.open!=='function'){say('当前环境没有小e右侧面板');return;}
|
|
49
|
-
var cfg={};
|
|
50
|
-
if('e10Sdk'.indexOf(a.type)>-1){
|
|
51
|
-
var prm={app:a.app,compName:a.comp};
|
|
52
|
-
if(a.companyName){prm.companyName=a.companyName;}
|
|
53
|
-
if(a.customParams){prm.customParams=a.customParams;}
|
|
54
|
-
cfg.type='e10Sdk';
|
|
55
|
-
cfg.width=a.width||${CARD_PANEL_WIDTH};
|
|
56
|
-
cfg.contentProps={src:a.src,sdkOptions:{compName:'ui.CorsComponent',routerType:'MemoryRouter',routerProps:{initialEntries:a.entries},params:prm}};
|
|
57
|
-
}else if('artifact'.indexOf(a.type)>-1){
|
|
58
|
-
var sb=root.querySelector('[data-summary]');
|
|
59
|
-
var h=sb?sb.value:'';
|
|
60
|
-
if(!h){say('摘要内容为空');return;}
|
|
61
|
-
cfg.type='artifact';
|
|
62
|
-
cfg.width=a.width||${CARD_PANEL_WIDTH};
|
|
63
|
-
cfg.contentProps={initialArtifactKeys:['summary-1'],artifacts:[{id:'summary-1',name:'合同摘要.html',fileType:'html',raw:{html:h}}]};
|
|
64
|
-
}else{say('不支持的动作类型');return;}
|
|
65
|
-
try{p.rightPanel.open(cfg);say('已打开');}catch(e){say('面板打开失败,请检查右侧面板');}
|
|
66
|
-
}
|
|
67
|
-
for(var i=0;i<cards.length;i++){
|
|
68
|
-
(function(c){
|
|
69
|
-
var b=document.createElement('button');
|
|
70
|
-
b.type='button';
|
|
71
|
-
b.setAttribute('data-act',c.id||('act'+i));
|
|
72
|
-
b.style.cssText='width:100%;box-sizing:border-box;text-align:left;font-family:inherit;display:flex;align-items:center;gap:12px;background:#fff;border:1px solid #e3e6eb;border-radius:10px;padding:16px;margin-bottom:12px;cursor:pointer';
|
|
73
|
-
var ic=document.createElement('span');
|
|
74
|
-
ic.style.cssText='flex:0 0 auto;width:44px;height:44px;border-radius:10px;background:#eef4ff;display:flex;align-items:center;justify-content:center;font-size:20px';
|
|
75
|
-
ic.innerHTML=ICON[c.icon]||ICON.doc;
|
|
76
|
-
var tx=document.createElement('span');
|
|
77
|
-
tx.style.cssText='min-width:0';
|
|
78
|
-
var t1=document.createElement('span');
|
|
79
|
-
t1.style.cssText='display:block;margin-bottom:6px;font-size:15px;font-weight:700;color:#1f2329';
|
|
80
|
-
t1.textContent=c.title||'';
|
|
81
|
-
if(c.recommended){
|
|
82
|
-
var bd=document.createElement('span');
|
|
83
|
-
bd.style.cssText='font-size:11px;color:#fff;background:#1a56b8;border-radius:999px;padding:2px 10px;margin-left:8px';
|
|
84
|
-
bd.textContent='推荐';
|
|
85
|
-
t1.appendChild(bd);
|
|
86
|
-
}
|
|
87
|
-
var t2=document.createElement('span');
|
|
88
|
-
t2.style.cssText='display:block;font-size:13px;color:#5c6570;line-height:1.5';
|
|
89
|
-
t2.textContent=c.desc||'';
|
|
90
|
-
tx.appendChild(t1);tx.appendChild(t2);
|
|
91
|
-
b.appendChild(ic);b.appendChild(tx);
|
|
92
|
-
b.addEventListener('click',function(){run(c);});
|
|
93
|
-
b.addEventListener('mouseenter',function(){b.style.borderColor='#1a56b8';});
|
|
94
|
-
b.addEventListener('mouseleave',function(){b.style.borderColor='#e3e6eb';});
|
|
95
|
-
wrap.appendChild(b);
|
|
96
|
-
})(cards[i]);
|
|
97
|
-
}
|
|
98
|
-
say('共 '+cards.length+' 个可执行操作');
|
|
99
|
-
})();`;
|
|
100
|
-
function escAttr(value) {
|
|
101
|
-
return String(value ?? '')
|
|
102
|
-
.replace(/&/gu, '&')
|
|
103
|
-
.replace(/</gu, '<')
|
|
104
|
-
.replace(/>/gu, '>')
|
|
105
|
-
.replace(/'/gu, ''');
|
|
106
|
-
}
|
|
107
|
-
/** textarea 是 raw text:先把 & 转义,再把双引号转成实体,读 .value 时浏览器会还原。 */
|
|
108
|
-
function textareaRaw(value) {
|
|
109
|
-
return value
|
|
110
|
-
.replace(/&/gu, '&')
|
|
111
|
-
.replace(/"/gu, '"')
|
|
112
|
-
.replace(/<\/textarea/giu, '</textarea');
|
|
113
|
-
}
|
|
114
|
-
function makeUid() {
|
|
115
|
-
const now = new Date();
|
|
116
|
-
const pad = (value) => String(value).padStart(2, '0');
|
|
117
|
-
const stamp = `${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}`
|
|
118
|
-
+ `${pad(now.getHours())}${pad(now.getMinutes())}`;
|
|
119
|
-
const rand = Math.random().toString(36).slice(2, 6);
|
|
120
|
-
return `card-${stamp}-${rand}`;
|
|
121
|
-
}
|
|
122
|
-
function readJsonObject(path, label) {
|
|
123
|
-
let raw;
|
|
124
|
-
try {
|
|
125
|
-
raw = readFileSync(path, 'utf8').replace(/^\uFEFF/u, '');
|
|
126
|
-
}
|
|
127
|
-
catch (error) {
|
|
128
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
129
|
-
throw contractValidationError('data_unreadable', `无法读取${label} JSON:${message}`);
|
|
130
|
-
}
|
|
131
|
-
let parsed;
|
|
132
|
-
try {
|
|
133
|
-
parsed = JSON.parse(raw);
|
|
134
|
-
}
|
|
135
|
-
catch (error) {
|
|
136
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
137
|
-
throw contractValidationError('data_unreadable', `无法解析${label} JSON:${message}`);
|
|
138
|
-
}
|
|
139
|
-
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
140
|
-
throw contractValidationError('data_unreadable', `${label}必须是 JSON 对象`);
|
|
141
|
-
}
|
|
142
|
-
return parsed;
|
|
143
|
-
}
|
|
144
|
-
export const contractCardOperations = [
|
|
145
|
-
{
|
|
146
|
-
name: 'contract.card.render',
|
|
147
|
-
async execute(input, context) {
|
|
148
|
-
const dataPath = resolve(requireNonEmptyString(input.data, 'data', 4096).trim());
|
|
149
|
-
const outPath = resolve(requireNonEmptyString(input.out, 'out', 4096).trim());
|
|
150
|
-
const data = readJsonObject(dataPath, '卡片数据');
|
|
151
|
-
const cards = Array.isArray(data.cards) ? data.cards : [];
|
|
152
|
-
if (cards.length === 0) {
|
|
153
|
-
throw contractValidationError('cards_required', '卡片数据必须包含非空的 cards 数组');
|
|
154
|
-
}
|
|
155
|
-
let summaryHtml = '';
|
|
156
|
-
if (input.summary) {
|
|
157
|
-
const summaryPath = resolve(requireNonEmptyString(input.summary, 'summary', 4096).trim());
|
|
158
|
-
summaryHtml = renderSummaryHtml(readJsonObject(summaryPath, '摘要数据'));
|
|
159
|
-
}
|
|
160
|
-
let baseUrl = input.baseUrl ? requireNonEmptyString(input.baseUrl, 'baseUrl', 2048).trim() : '';
|
|
161
|
-
if (!baseUrl) {
|
|
162
|
-
const session = await context.host.getSession();
|
|
163
|
-
baseUrl = String(session?.baseUrl ?? '').trim();
|
|
164
|
-
}
|
|
165
|
-
baseUrl = baseUrl.replace(/\/+$/u, '');
|
|
166
|
-
if (!baseUrl) {
|
|
167
|
-
throw contractValidationError('base_url_missing', '无法确定当前 E10 环境地址,请显式传入 baseUrl');
|
|
168
|
-
}
|
|
169
|
-
const uid = typeof data.id === 'string' && data.id.trim() ? data.id.trim() : makeUid();
|
|
170
|
-
const hint = typeof data.hint === 'string' ? data.hint.trim() : '';
|
|
171
|
-
const title = typeof data.title === 'string' && data.title.trim() ? data.title.trim() : '可执行操作';
|
|
172
|
-
const width = typeof data.width === 'number' && data.width > 0 ? data.width : CARD_PANEL_WIDTH;
|
|
173
|
-
const cardsJson = JSON.stringify(cards);
|
|
174
|
-
const script = CARD_SCRIPT.replace(/__UID__/gu, uid);
|
|
175
|
-
const parts = [];
|
|
176
|
-
parts.push(`<section id='${escAttr(uid)}' style='padding:4px 2px;font-family:Microsoft YaHei,PingFang SC,sans-serif'>`);
|
|
177
|
-
if (hint) {
|
|
178
|
-
parts.push(`<div style='background:#eef4ff;border:1px solid #d6e4ff;border-radius:8px;padding:10px 12px;margin-bottom:12px;font-size:12.5px;color:#1d39c4;line-height:1.6'>${escAttr(hint)}</div>`);
|
|
179
|
-
}
|
|
180
|
-
parts.push(`<p data-status aria-live='polite' style='margin:8px 0 0;color:#b45309;font-size:12px;line-height:1.6'></p>`);
|
|
181
|
-
parts.push(`<textarea data-cards style='display:none'>${textareaRaw(cardsJson)}</textarea>`);
|
|
182
|
-
if (summaryHtml) {
|
|
183
|
-
parts.push(`<textarea data-summary style='display:none'>${textareaRaw(summaryHtml)}</textarea>`);
|
|
184
|
-
}
|
|
185
|
-
parts.push(`</section><script>${script}</script>`);
|
|
186
|
-
const html = parts.join('');
|
|
187
|
-
writeFileSync(outPath, html, 'utf8');
|
|
188
|
-
const bytes = Buffer.byteLength(html, 'utf8');
|
|
189
|
-
let browsertoolPath = '';
|
|
190
|
-
if (input.browsertool) {
|
|
191
|
-
browsertoolPath = resolve(requireNonEmptyString(input.browsertool, 'browsertool', 4096).trim());
|
|
192
|
-
const browsertool = {
|
|
193
|
-
version: 1,
|
|
194
|
-
callId: typeof data.callId === 'string' && data.callId.trim() ? data.callId.trim() : `${uid}-01`,
|
|
195
|
-
toolId: 'fill_form',
|
|
196
|
-
arguments: {
|
|
197
|
-
type: 'e10',
|
|
198
|
-
title,
|
|
199
|
-
src: `${baseUrl}/sp/contract/xiaoe-custom-page`,
|
|
200
|
-
width,
|
|
201
|
-
sdkRenderType: 'inline',
|
|
202
|
-
sdkOptions: {
|
|
203
|
-
compName: 'ui.CorsComponent',
|
|
204
|
-
routerType: 'MemoryRouter',
|
|
205
|
-
routerProps_pc: { initialEntries: ['/sp/contract/xiaoe-custom-page'] },
|
|
206
|
-
params_pc: {
|
|
207
|
-
app: '@weapp/contract',
|
|
208
|
-
compName: 'xiaoeCustomPage',
|
|
209
|
-
customParams: { html },
|
|
210
|
-
},
|
|
211
|
-
},
|
|
212
|
-
},
|
|
213
|
-
};
|
|
214
|
-
writeFileSync(browsertoolPath, JSON.stringify(browsertool), 'utf8');
|
|
215
|
-
}
|
|
216
|
-
return {
|
|
217
|
-
status: 'COMPLETE',
|
|
218
|
-
data: {
|
|
219
|
-
output: outPath,
|
|
220
|
-
fileName: basename(outPath),
|
|
221
|
-
fileSize: bytes,
|
|
222
|
-
uid,
|
|
223
|
-
cardCount: cards.length,
|
|
224
|
-
cardIds: cards.map((card) => String(card?.id ?? '')),
|
|
225
|
-
summaryEmbedded: Boolean(summaryHtml),
|
|
226
|
-
browsertool: browsertoolPath || undefined,
|
|
227
|
-
note: 'HTML 与 browsertool JSON 均由 CLI 生成;模型不要再手写卡片 HTML',
|
|
228
|
-
},
|
|
229
|
-
};
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
];
|