weaver-work-cli 0.1.62 → 0.1.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{archive-S2VKZWQ3.js → archive-WUZKAEZ6.js} +5 -4
- package/dist/chunks/{archive-oa-HEDSIUUY.js → archive-oa-PN46RTI2.js} +5 -4
- package/dist/chunks/{asset-HYH4W357.js → asset-ZPC5VWZM.js} +5 -4
- package/dist/chunks/{asset-idle-N7REBNGL.js → asset-idle-DHGP3NYY.js} +5 -4
- package/dist/chunks/{attachment-content-VYYA75FR.js → attachment-content-JQDW3BIB.js} +3 -3
- package/dist/chunks/{blog-SLMZZICV.js → blog-JC47AIXK.js} +5 -4
- package/dist/chunks/{caizhilian-RV43KKBT.js → caizhilian-IKIHM77A.js} +5 -5
- package/dist/chunks/{calendar-DMVZ4OLY.js → calendar-GZTSJ57Y.js} +5 -4
- package/dist/chunks/{chunk-H6YOMI3U.js → chunk-26FCCU5O.js} +5 -3
- package/dist/chunks/{chunk-E5YD5JWR.js → chunk-3PCXBG4H.js} +1 -1
- package/dist/chunks/{chunk-UBRWONP4.js → chunk-3W5NMGDS.js} +2 -2
- package/dist/chunks/{chunk-DTCQFTHW.js → chunk-4AFWOGOV.js} +3 -3
- package/dist/chunks/{chunk-VNYOUAWV.js → chunk-5QQKLR6H.js} +11 -11
- package/dist/chunks/{chunk-BQYX2UX5.js → chunk-6T5X6YWX.js} +5 -3
- package/dist/chunks/{chunk-KXJA42EA.js → chunk-AFZTMYGC.js} +1 -1
- package/dist/chunks/{chunk-YI2YMW5N.js → chunk-AGSO3PIK.js} +2 -2
- package/dist/chunks/{chunk-IW7A2IQY.js → chunk-C4YQJFZV.js} +43 -15
- package/dist/chunks/{chunk-WIWDVETN.js → chunk-FDBAFANU.js} +76 -76
- package/dist/chunks/{chunk-NRYDJN4J.js → chunk-FJUOUSV3.js} +89 -8
- package/dist/chunks/{chunk-EGANE35F.js → chunk-HLT6B26P.js} +1 -1
- package/dist/chunks/{chunk-P6TXQK75.js → chunk-HWA2A25Y.js} +5 -3
- package/dist/chunks/{chunk-T2KVJFWJ.js → chunk-I3MOFD6Q.js} +4 -7
- package/dist/chunks/chunk-IN6NXQ26.js +680 -0
- package/dist/chunks/{chunk-UBGWIXU3.js → chunk-INVYKG4I.js} +140 -45
- package/dist/chunks/{chunk-QBDXJS2W.js → chunk-K7QKQRSL.js} +168 -62
- package/dist/chunks/{chunk-BIA2NKUG.js → chunk-KDFEHDIB.js} +5 -5
- package/dist/chunks/{chunk-ILALC2N6.js → chunk-KYDXWYFB.js} +1 -1
- package/dist/chunks/{chunk-V2LASYKO.js → chunk-Q6D6PSMH.js} +30 -24
- package/dist/chunks/{chunk-UQFPF4EX.js → chunk-RMOH2GMF.js} +2 -2
- package/dist/chunks/{chunk-VBFBMM7G.js → chunk-SCMHG23G.js} +387 -70
- package/dist/chunks/chunk-TJN4PIYO.js +47 -0
- package/dist/chunks/{chunk-JFAWZX53.js → chunk-UPVAQJKS.js} +282 -131
- package/dist/chunks/{chunk-KY3R42RS.js → chunk-VLY5RTVO.js} +5 -3
- package/dist/chunks/{chunk-TEZHIB6T.js → chunk-WSHIOSGM.js} +5 -3
- package/dist/chunks/{chunk-6XSSAUNW.js → chunk-XHSEK2VM.js} +48 -12
- package/dist/chunks/{chunk-XT77MP54.js → chunk-YTFNMQO4.js} +410 -24
- package/dist/chunks/{conflict-GFJRS6I7.js → conflict-UUC7AFUI.js} +2 -2
- package/dist/chunks/{contract-U3ZGNRWB.js → contract-INMS7SYQ.js} +3051 -4497
- package/dist/chunks/{cowork-EX7PKIDK.js → cowork-34CBYVQP.js} +5 -4
- package/dist/chunks/{create-flow-EJZD434E.js → create-flow-YOR4QTAJ.js} +18 -6
- package/dist/chunks/{data-FOODGAMF.js → data-QKWI5325.js} +14 -3
- package/dist/chunks/{ebuilder-form-I2EOKODG.js → ebuilder-form-ZONRROK4.js} +4 -4
- package/dist/chunks/{ehr-TE4RFNID.js → ehr-2CONM7R6.js} +244 -151
- package/dist/chunks/{employee-DR5Y64TI.js → employee-PGMY6NI6.js} +1 -1
- package/dist/chunks/{entry-mode-ZOLSXEGX.js → entry-mode-S2ENJ6GZ.js} +3 -3
- package/dist/chunks/{env-TID5NFR6.js → env-ZSAXU5PJ.js} +2 -2
- package/dist/chunks/{esb-7L6MHYLB.js → esb-FQASCY2H.js} +8 -8
- package/dist/chunks/{factory-OG7BPMH5.js → factory-N76QQA53.js} +1 -1
- package/dist/chunks/{fna-6V2ENR3Y.js → fna-FCLVIWAS.js} +5 -4
- package/dist/chunks/{group-chat-5DKPWIHL.js → group-chat-UM665WDZ.js} +3 -3
- package/dist/chunks/{host-VTPAWDZV.js → host-2ED2KC4X.js} +4 -4
- package/dist/chunks/{host-TJ5VVHM7.js → host-2UYZEY2V.js} +4 -4
- package/dist/chunks/{host-3DLYA54R.js → host-46NYKDQP.js} +4 -4
- package/dist/chunks/{host-OGBHL75G.js → host-7IPZKIM4.js} +4 -4
- package/dist/chunks/{host-GOJHHTPY.js → host-P7G22WNM.js} +4 -4
- package/dist/chunks/{host-ONZC6AE7.js → host-XLCBLNJD.js} +4 -4
- package/dist/chunks/{hrm-2N7NFQDZ.js → hrm-XKL27NX2.js} +6 -6
- package/dist/chunks/{im-XCH47ZBN.js → im-NDYIMASG.js} +4 -4
- package/dist/chunks/{invoice-5KJ7T774.js → invoice-MOGNB6HN.js} +4 -4
- package/dist/chunks/{jiuchuanhui-PL6DRPBM.js → jiuchuanhui-3T5X7SB7.js} +5 -4
- package/dist/chunks/{lazy-dispatch-UATEN7H7.js → lazy-dispatch-4WOIL3ZQ.js} +5 -5
- package/dist/chunks/{mail-Q7Z4CQ4D.js → mail-P7VMUKQW.js} +5 -4
- package/dist/chunks/{meeting-5E3BNARL.js → meeting-MMTYDHXA.js} +16 -15
- package/dist/chunks/{minute-doc-NXRE5C77.js → minute-doc-LCSBWGJ3.js} +4 -4
- package/dist/chunks/{okr-3O3XNYOK.js → okr-VZXRQGS4.js} +5 -4
- package/dist/chunks/{operations-EZWG72FH.js → operations-MI2BSKZX.js} +5 -5
- package/dist/chunks/{performance-Y7CPNSOR.js → performance-OPEQNW7Y.js} +873 -17
- package/dist/chunks/{plan-BLGPZF5M.js → plan-TJAS4N5X.js} +5 -4
- package/dist/chunks/{project-6MZMLJMP.js → project-CYBGU6K6.js} +5 -4
- package/dist/chunks/{reception-F2VT2X52.js → reception-3FT2F66K.js} +3 -3
- package/dist/chunks/{recruit-stage-4ETIBMIW.js → recruit-stage-WPGB5BDJ.js} +654 -336
- package/dist/chunks/{registry-3FYSWV3U.js → registry-BAWCWV4D.js} +3 -3
- package/dist/chunks/{registry-I4DVPDMU.js → registry-FNI5E76J.js} +12 -12
- package/dist/chunks/{registry-3UGIWH53.js → registry-JMNOXRST.js} +2 -2
- package/dist/chunks/{registry-7RS74TCK.js → registry-QRMXRSCT.js} +5 -5
- package/dist/chunks/{room-recommend-GWCVKCXW.js → room-recommend-I7QQRHEL.js} +4 -4
- package/dist/chunks/{schedule-6AN63MJQ.js → schedule-3P7EWGNZ.js} +4 -4
- package/dist/chunks/{smart-extract-SR4SJJKN.js → smart-extract-FOBSVNYW.js} +3 -3
- package/dist/chunks/{workflow-KF7FA2UQ.js → workflow-U2KKTVQY.js} +10 -7
- package/dist/index.js +34 -34
- package/dist/internal/e10/auth/commands.js +203 -44
- package/dist/internal/e10/auth/xiaoe.js +6 -2
- package/dist/internal/e10/auth-recovery.js +28 -2
- package/dist/internal/e10/request-runtime.js +15 -3
- package/dist/internal/e10/request-trace.js +65 -0
- package/dist/shortcuts/contract/data/metric-catalog.js +149 -0
- package/dist/shortcuts/contract/error-actions.js +112 -0
- package/dist/shortcuts/contract/errors.js +9 -1
- package/dist/shortcuts/contract/index.js +14 -39
- package/dist/shortcuts/contract/manifest.js +130 -274
- package/dist/shortcuts/contract/operations/compare-report.js +437 -0
- package/dist/shortcuts/contract/operations/compare.js +2 -0
- package/dist/shortcuts/contract/operations/docx-slots.js +112 -5
- package/dist/shortcuts/contract/operations/docx-verify.js +2 -70
- package/dist/shortcuts/contract/operations/elements-build.js +82 -56
- package/dist/shortcuts/contract/operations/elements-spec.js +140 -3
- package/dist/shortcuts/contract/operations/first-screen.js +96 -207
- package/dist/shortcuts/contract/operations/flow.js +19 -1
- package/dist/shortcuts/contract/operations/{card-ebdf-list.js → ledger-card.js} +123 -27
- package/dist/shortcuts/contract/operations/ledger.js +343 -1
- package/dist/shortcuts/contract/operations/metrics.js +93 -0
- package/dist/shortcuts/contract/operations/modeltext.js +3 -3
- package/dist/shortcuts/contract/operations/money.js +90 -0
- package/dist/shortcuts/contract/operations/page.js +8 -4
- package/dist/shortcuts/contract/operations/performance.js +53 -0
- package/dist/shortcuts/contract/operations/placeholder-scan.js +104 -0
- package/dist/shortcuts/contract/operations/quote-recognize.js +326 -0
- package/dist/shortcuts/contract/operations/quote-ref.js +179 -0
- package/dist/shortcuts/contract/operations/quote-submit.js +281 -0
- package/dist/shortcuts/contract/operations/quote.js +66 -12
- package/dist/shortcuts/contract/operations/recommend.js +42 -1
- package/dist/shortcuts/contract/operations/registry.js +16 -23
- package/dist/shortcuts/contract/operations/{card-risk-report.js → review-report.js} +24 -114
- package/dist/shortcuts/contract/operations/review.js +33 -167
- package/dist/shortcuts/contract/operations/save-recognize.js +173 -43
- package/dist/shortcuts/contract/operations/solutions-spec.js +79 -0
- package/dist/shortcuts/contract/operations/triage.js +68 -15
- package/dist/shortcuts/contract/operations/{template.js → type-clause-read.js} +10 -25
- package/dist/shortcuts/contract/operations/upload.js +17 -11
- package/dist/shortcuts/contract/prewarm-cache.js +6 -2
- package/dist/shortcuts/contract/prewarm.js +33 -23
- package/dist/shortcuts/contract/recommend-cache.js +191 -0
- package/dist/shortcuts/data/operations/shared.js +14 -1
- package/dist/shortcuts/ehr/operations/recruit-interview-overview.js +85 -62
- package/dist/shortcuts/ehr/operations/recruit-position.js +21 -13
- package/dist/shortcuts/ehr/operations/recruit-short-cache.js +59 -0
- package/dist/shortcuts/ehr/operations/recruit-tag.js +17 -11
- package/dist/shortcuts/ehr/operations/recruit-write.js +118 -70
- package/dist/shortcuts/ehr/operations/recruit.js +338 -121
- package/dist/shortcuts/hrm/operations/employee.js +64 -17
- package/dist/shortcuts/hrm/operations/resolve.js +419 -369
- package/dist/shortcuts/im/host.js +38 -22
- package/dist/shortcuts/meeting/operations/eb/conflict.js +60 -2
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +138 -15
- package/dist/shortcuts/meeting/operations/eb/create-form-link.js +380 -0
- package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +1 -3
- package/dist/shortcuts/performance/flow-utils.js +363 -0
- package/dist/shortcuts/performance/manifest.js +2 -2
- package/dist/shortcuts/performance/operations/flow-detail.js +85 -0
- package/dist/shortcuts/performance/operations/flow-list.js +213 -0
- package/dist/shortcuts/performance/operations/flow-score.js +241 -0
- package/dist/shortcuts/performance/operations/registry.js +6 -0
- package/dist/shortcuts/recruit-stage/batch-store.js +44 -0
- package/dist/shortcuts/recruit-stage/context.js +75 -9
- package/dist/shortcuts/recruit-stage/manifest.js +1 -1
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +33 -22
- package/dist/shortcuts/recruit-stage/operations/list.js +187 -37
- package/dist/shortcuts/recruit-stage/operations/registry.js +2 -0
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +231 -313
- package/dist/shortcuts/recruit-stage/operations/search.js +5 -5
- package/dist/shortcuts/recruit-stage/operations/tag.js +286 -0
- package/dist/shortcuts/workflow/endpoints.js +2 -0
- package/dist/shortcuts/workflow/operations/form.js +12 -15
- package/dist/shortcuts/workflow/operations/read.js +8 -8
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoListRows.js +3 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +7 -6
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +4 -3
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +1 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +33 -6
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.prepareQuery.js +153 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/workflowClarification.js +232 -0
- package/dist/shortcuts/workflow/operations.js +5 -0
- package/docs/contract.md +2 -2
- package/docs/e10-auth.md +55 -2
- package/docs/ehr.md +1 -1
- package/package.json +1 -1
- package/skills/weaver-e10-hrm/SKILL.md +3 -3
- package/skills/weaver-e10-hrm/references/employee.md +13 -2
- package/skills/weaver-e10-jinchengda/SKILL.md +283 -345
- package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +7 -14
- package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +21 -12
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +126 -202
- package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +13 -5
- package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +28 -20
- package/skills/weaver-e10-jinchengda/references/contract-clause-recommender.md +12 -17
- package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +7 -13
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +47 -16
- package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +10 -18
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +19 -18
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +114 -61
- package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +8 -2
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +78 -112
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +67 -333
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +18 -15
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +80 -84
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +38 -34
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +132 -47
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +108 -217
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +14 -20
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +13 -7
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +86 -46
- package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +12 -10
- package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +22 -14
- package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +18 -18
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +27 -26
- package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +252 -0
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +15 -23
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +290 -104
- package/skills/weaver-e10-jinchengda/references/contract-request-status.md +5 -12
- package/skills/weaver-e10-jinchengda/references/contract-request-write.md +12 -18
- package/skills/weaver-e10-jinchengda/references/contract-signing-subjects.md +11 -17
- package/skills/weaver-e10-jinchengda/references/contract-subject-create.md +5 -11
- package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +56 -7
- package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +12 -12
- package/skills/weaver-e10-jinchengda/references/contract-workflow-discovery.md +10 -16
- package/skills/weaver-e10-jinchengda/references/orchestration.md +33 -35
- package/skills/weaver-e10-jucailin/SKILL.md +6 -7
- package/skills/weaver-e10-jucailin/agents/openai.yaml +52 -0
- package/skills/weaver-e10-jucailin/references/recruit-interview-overview.md +8 -6
- package/skills/weaver-e10-jucailin/references/recruit-read.md +4 -0
- package/skills/weaver-e10-jucailin/references/recruit-screening-to-interview-sop.md +2 -2
- package/skills/weaver-e10-jucailin/references/recruit-write.md +4 -4
- package/skills/weaver-e10-meeting/SKILL.md +87 -534
- package/skills/weaver-e10-meeting/references/commands-table.md +61 -0
- package/skills/weaver-e10-meeting/references/create-commands.md +136 -0
- package/skills/weaver-e10-meeting/references/create-flow.md +9 -7
- package/skills/weaver-e10-meeting/references/create-guardrails.md +23 -17
- package/skills/weaver-e10-meeting/references/custom-fields.md +40 -0
- package/skills/weaver-e10-meeting/references/eb-contracts.md +60 -0
- package/skills/weaver-e10-meeting/references/invitation.md +69 -0
- package/skills/weaver-e10-meeting/references/meeting-eb.md +26 -26
- package/skills/weaver-e10-meeting/references/meeting-invitation.md +2 -2
- package/skills/weaver-e10-meeting/references/meeting-minute-file.md +2 -2
- package/skills/weaver-e10-meeting/references/meeting-verification.md +1 -1
- package/skills/weaver-e10-meeting/references/minutes-pipeline.md +119 -0
- package/skills/weaver-e10-meeting/references/pitfalls.md +1 -1
- package/skills/weaver-e10-meeting/references/room-recommend.md +88 -0
- package/skills/weaver-e10-performance/SKILL.md +45 -5
- package/skills/weaver-e10-performance/agents/openai.yaml +26 -2
- package/skills/weaver-e10-performance/references/flow-api.md +128 -0
- package/skills/weaver-e10-performance/references/flow-assess.md +149 -0
- package/skills/weaver-e10-recruit-stage/SKILL.md +317 -266
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +22 -27
- package/skills/weaver-e10-recruit-stage/references/env-ziyong.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +30 -27
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +2 -6
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +12 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +2 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +23 -19
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-template.md +3 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +18 -16
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +25 -23
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +10 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +11 -11
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +150 -85
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +14 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +173 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-taxonomy.json +76 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +3 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +2 -2
- package/skills/weaver-e10-workflow/SKILL.md +49 -32
- package/skills/weaver-e10-workflow/references/todo-dialogue.md +67 -34
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +65 -51
- package/skills/weaver-e10-workflow/references/workflow-agent-entry.md +18 -11
- package/skills/weaver-e10-workflow/references/workflow-create.md +2 -2
- package/skills/weaver-e10-workflow/references/workflow-memory.md +19 -37
- package/skills/weaver-e10-workflow/references/workflow-query.md +25 -22
- package/skills/weaver-e10-workflow/references/workflow-view.md +1 -1
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +318 -110
- package/skills/weaver-e10-yimiaoban/SKILL.md +17 -14
- package/skills/weaver-e10-yimiaoban/references/person.md +1 -1
- package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +1 -1
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +9 -9
- package/dist/chunks/chunk-6QYNE6HE.js +0 -658
- package/dist/chunks/chunk-SHYQUBY3.js +0 -48
- package/dist/shortcuts/contract/operations/card-action.js +0 -1266
- package/dist/shortcuts/contract/operations/card-plan.js +0 -393
- package/dist/shortcuts/contract/operations/card.js +0 -232
- package/dist/shortcuts/contract/operations/compare-screen.js +0 -378
- package/dist/shortcuts/contract/operations/quote-to-contract.js +0 -495
- package/dist/shortcuts/contract/operations/quotescreen.js +0 -529
- package/dist/shortcuts/contract/operations/summary-validate.js +0 -293
- package/dist/shortcuts/contract/operations/summary.js +0 -187
- package/dist/shortcuts/ehr/recruit-stage/batch-store.js +0 -78
- package/dist/shortcuts/ehr/recruit-stage/context.js +0 -231
- package/dist/shortcuts/ehr/recruit-stage/continuation.js +0 -74
- package/dist/shortcuts/ehr/recruit-stage/errors.js +0 -65
- package/dist/shortcuts/ehr/recruit-stage/fs-scan.js +0 -165
- package/dist/shortcuts/ehr/recruit-stage/host.js +0 -109
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +0 -1065
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-feedback.js +0 -295
- package/dist/shortcuts/ehr/recruit-stage/operations/jd-create.js +0 -961
- package/dist/shortcuts/ehr/recruit-stage/operations/list.js +0 -431
- package/dist/shortcuts/ehr/recruit-stage/operations/registry.js +0 -50
- package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +0 -1655
- package/dist/shortcuts/ehr/recruit-stage/operations/search.js +0 -158
- package/dist/shortcuts/ehr/recruit-stage/operations/types.js +0 -34
- package/dist/shortcuts/ehr/recruit-stage/runtime.js +0 -31
- package/dist/shortcuts/ehr/recruit-stage/school-tiers.json +0 -318
- package/dist/shortcuts/ehr/recruit-stage/shared.js +0 -887
- package/skills/weaver-e10-jinchengda/references/contract-action-card-template.html +0 -22
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +0 -554
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +0 -279
- package/skills/weaver-e10-jinchengda/references/contract-card-render-internals.md +0 -483
- package/skills/weaver-e10-jinchengda/references/contract-template-selector.md +0 -46
- package/skills/weaver-e10-recruit-stage/lib/recruit-resume-photo.py +0 -194
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { buildDetailUrl, buildScoreRequest, estimateTotal, parseScoreColumn, unwrapWeaData, } from '../flow-utils.js';
|
|
2
|
+
import { pfConfirmationError, pfFail, pfValidationError } from '../errors.js';
|
|
3
|
+
import { schemeFingerprint } from '../scheme-validate.js';
|
|
4
|
+
import { pfSuccess, schemaOf } from './types.js';
|
|
5
|
+
const DETAIL_PATH = '/api/workrelate/performance/flow/detail';
|
|
6
|
+
const STAGE_PATH = '/api/workrelate/performance/flow/countBasicFlowTotal';
|
|
7
|
+
const SUBMIT_PATH = '/api/workrelate/performance/flow/updateScore';
|
|
8
|
+
const PAYLOAD_SCHEMA = {
|
|
9
|
+
type: 'array',
|
|
10
|
+
description: '评分行数组:[{dataRow, kps, targetValue?, actualValue?, remark?}];dataRow 与 kps 必填(公式行 kps 可省略)',
|
|
11
|
+
items: {
|
|
12
|
+
type: 'object',
|
|
13
|
+
additionalProperties: false,
|
|
14
|
+
properties: {
|
|
15
|
+
dataRow: { type: 'integer', description: '指标行号(必填,取自 flow.assess 的 indicators[].dataRow)' },
|
|
16
|
+
kps: { type: ['string', 'number'], description: '评分(必填;不得超过满分)' },
|
|
17
|
+
targetValue: { type: ['string', 'number'], description: '目标值(定量指标必填,可省略取详情已有值)' },
|
|
18
|
+
actualValue: { type: ['string', 'number'], description: '实际值(dataSource=1 或数据源模式允许编辑时必填)' },
|
|
19
|
+
remark: { type: 'string', description: '评分备注(可选,页面备注框同源)' },
|
|
20
|
+
},
|
|
21
|
+
required: ['dataRow'],
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
async function loadDetail(env, flowId, operation) {
|
|
25
|
+
const data = unwrapWeaData(await env.host.request({
|
|
26
|
+
path: `${DETAIL_PATH}/${encodeURIComponent(flowId)}`,
|
|
27
|
+
method: 'GET',
|
|
28
|
+
operation,
|
|
29
|
+
}), '考核详情');
|
|
30
|
+
const column = parseScoreColumn(data);
|
|
31
|
+
if (!column) {
|
|
32
|
+
throw pfValidationError('not_scorable', '当前用户对该考核不可评分(找不到可编辑评分列):可能不是本轮评分人,或考核不在评分阶段', { flowStatus: data?.flowStatus ?? null, canScore: data?.canScore ?? null });
|
|
33
|
+
}
|
|
34
|
+
return { data, column };
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* stage:评分暂存到考核详情页(低风险预览写)。
|
|
38
|
+
* 后端 countBasicFlowTotal(type=1) 会真实写入 HR_KPI_FLOW_STEP_LINK:页面立即可见、不流转、可被提交覆盖。
|
|
39
|
+
* 副作用:若最终不提交,页面会残留 AI 预填分。
|
|
40
|
+
*/
|
|
41
|
+
async function stage(args, env) {
|
|
42
|
+
if (args.confirm !== true) {
|
|
43
|
+
throw pfConfirmationError('performance.flow.score.stage', {
|
|
44
|
+
hint: '暂存会把评分写进考核详情页(不流转、可覆盖)。确认用户已知晓该副作用后,带 confirm=true 重试',
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
const flowId = String(args.flowId ?? '');
|
|
48
|
+
if (!flowId)
|
|
49
|
+
throw pfValidationError('flow_id_missing', '缺少考核流程 id(flowId)');
|
|
50
|
+
const { data, column } = await loadDetail(env, flowId, 'performance.flow.score.stage');
|
|
51
|
+
const built = buildScoreRequest(data, args.rows, column);
|
|
52
|
+
const response = await env.host.request({
|
|
53
|
+
path: STAGE_PATH,
|
|
54
|
+
body: {
|
|
55
|
+
stepId: column.stepId,
|
|
56
|
+
operater: column.scoreUserId,
|
|
57
|
+
flowid: flowId,
|
|
58
|
+
stepLinkData: built.body.kpiFlowStepLinkList,
|
|
59
|
+
type: '1',
|
|
60
|
+
},
|
|
61
|
+
operation: 'performance.flow.score.stage',
|
|
62
|
+
});
|
|
63
|
+
const computed = unwrapWeaData(response, '暂存评分');
|
|
64
|
+
const missingRemark = (Array.isArray(args.rows) ? args.rows : [])
|
|
65
|
+
.filter((row) => !row?.remark)
|
|
66
|
+
.map((row) => row?.dataRow);
|
|
67
|
+
return pfSuccess('performance.flow.score.stage', {
|
|
68
|
+
flowId,
|
|
69
|
+
staged: true,
|
|
70
|
+
computedTotal: computed?.score ?? computed?.finalScore ?? null,
|
|
71
|
+
backendTotalScore: computed?.totalScore ?? null,
|
|
72
|
+
estimatedTotal: estimateTotal(data, built.body.kpiFlowStepLinkList),
|
|
73
|
+
rows: built.rows,
|
|
74
|
+
detailUrl: buildDetailUrl(flowId, built.rows),
|
|
75
|
+
sideEffect: '评分已写入详情页(不流转、可覆盖);若不提交,页面会保留 AI 预填分,可在页面清除',
|
|
76
|
+
...(missingRemark.length
|
|
77
|
+
? { warnings: [`以下指标行未提供评分理由(remark),页面备注列会是空的:dataRow=${missingRemark.join('、')}——每行都应把评分理由写入 remark`] }
|
|
78
|
+
: {}),
|
|
79
|
+
next: '用户在详情页查看后,可自行点「确认并通过」,或让 AI 走 performance.flow.score.submit.prepare → apply',
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/** submit.prepare:组装提交内容 + 前置校验 + 确认摘要(不落库)。 */
|
|
83
|
+
async function submitPrepare(args, env) {
|
|
84
|
+
const flowId = String(args.flowId ?? '');
|
|
85
|
+
if (!flowId)
|
|
86
|
+
throw pfValidationError('flow_id_missing', '缺少考核流程 id(flowId)');
|
|
87
|
+
const { data, column } = await loadDetail(env, flowId, 'performance.flow.score.submit.prepare');
|
|
88
|
+
const built = buildScoreRequest(data, args.rows, column);
|
|
89
|
+
const fingerprint = schemeFingerprint(built.body);
|
|
90
|
+
const continuation = await env.continuation.issue({
|
|
91
|
+
operation: 'performance.flow.score.submit.apply',
|
|
92
|
+
fingerprint,
|
|
93
|
+
});
|
|
94
|
+
return pfSuccess('performance.flow.score.submit.prepare', {
|
|
95
|
+
continuation,
|
|
96
|
+
fingerprint,
|
|
97
|
+
preview: {
|
|
98
|
+
flowId,
|
|
99
|
+
name: built.meta.name,
|
|
100
|
+
kpiUserName: built.meta.kpiUserName,
|
|
101
|
+
assessmentCycle: built.meta.assessmentCycle,
|
|
102
|
+
maxScore: built.meta.maxScore,
|
|
103
|
+
estimatedTotal: estimateTotal(data, built.body.kpiFlowStepLinkList),
|
|
104
|
+
rows: built.rows,
|
|
105
|
+
missingRemark: (Array.isArray(args.rows) ? args.rows : []).filter((row) => !row?.remark).map((row) => row?.dataRow),
|
|
106
|
+
impact: '提交会流转评分节点;所有节点评完将结束考核(finished),可能触发 ESB 动作流与消息提醒',
|
|
107
|
+
},
|
|
108
|
+
}, {
|
|
109
|
+
continuation,
|
|
110
|
+
fingerprint,
|
|
111
|
+
confirmHint: '提交为高风险写入:向用户展示 preview 并取得明确同意后,带 confirm=true 与 continuation 调用 performance.flow.score.submit.apply',
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/** submit.apply:确认后写入评分(updateScore),成功自动回读核验。 */
|
|
115
|
+
async function submitApply(args, env) {
|
|
116
|
+
if (args.confirm !== true) {
|
|
117
|
+
throw pfConfirmationError('performance.flow.score.submit.apply', {
|
|
118
|
+
hint: '提交会流转考核流程节点,必须用户明确同意',
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (typeof args.continuation !== 'string' || !args.continuation) {
|
|
122
|
+
throw pfValidationError('continuation_missing', '缺少 continuation(先运行 performance.flow.score.submit.prepare)');
|
|
123
|
+
}
|
|
124
|
+
const verified = await env.continuation.verify(args.continuation, 'performance.flow.score.submit.apply');
|
|
125
|
+
const flowId = String(args.flowId ?? '');
|
|
126
|
+
if (!flowId)
|
|
127
|
+
throw pfValidationError('flow_id_missing', '缺少考核流程 id(flowId)');
|
|
128
|
+
const { data, column } = await loadDetail(env, flowId, 'performance.flow.score.submit.apply');
|
|
129
|
+
const built = buildScoreRequest(data, args.rows, column);
|
|
130
|
+
const fingerprint = schemeFingerprint(built.body);
|
|
131
|
+
if (String(verified.fingerprint) !== fingerprint) {
|
|
132
|
+
throw pfValidationError('fingerprint_mismatch', '提交内容与确认摘要不一致(评分或考核数据在 prepare 后发生变化),请重新 prepare 并再次确认', {
|
|
133
|
+
expected: verified.fingerprint,
|
|
134
|
+
actual: fingerprint,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
const body = { ...built.body, distributeCheck: args.skipDistributeCheck === true ? false : true };
|
|
138
|
+
let response;
|
|
139
|
+
try {
|
|
140
|
+
response = await env.host.request({
|
|
141
|
+
path: SUBMIT_PATH,
|
|
142
|
+
body,
|
|
143
|
+
operation: 'performance.flow.score.submit.apply',
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
const message = error?.message ?? String(error);
|
|
148
|
+
if (/数据已更新|182612/.test(message)) {
|
|
149
|
+
// 幂等守卫:同一操作人已提交过(OperateStatus=opKpsEnd)
|
|
150
|
+
throw pfFail('该考核已由你提交过(数据已更新,请刷新后重试)——不要重试,直接回读核对状态', { flowId });
|
|
151
|
+
}
|
|
152
|
+
throw error;
|
|
153
|
+
}
|
|
154
|
+
// 强制分布冲突:返回 remindType=warning|stop 且未流转
|
|
155
|
+
const remindType = response?.data?.remindType ?? response?.remindType ?? null;
|
|
156
|
+
if (remindType === 'stop') {
|
|
157
|
+
throw pfFail('绩效强制分布校验未通过(stop):本次未流转,请调整评分或联系管理员', { flowId, remindType });
|
|
158
|
+
}
|
|
159
|
+
if (remindType === 'warning') {
|
|
160
|
+
return pfSuccess('performance.flow.score.submit.apply', {
|
|
161
|
+
flowId,
|
|
162
|
+
submitted: false,
|
|
163
|
+
distributeConflict: 'warning',
|
|
164
|
+
message: '绩效分布比例冲突(warning):本次未流转。向用户说明后,可带 skipDistributeCheck=true 重新提交',
|
|
165
|
+
estimatedTotal: estimateTotal(data, built.body.kpiFlowStepLinkList),
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
unwrapWeaData(response, '提交评分');
|
|
169
|
+
// 回读核验
|
|
170
|
+
const after = unwrapWeaData(await env.host.request({
|
|
171
|
+
path: `${DETAIL_PATH}/${encodeURIComponent(flowId)}`,
|
|
172
|
+
method: 'GET',
|
|
173
|
+
operation: 'performance.flow.score.submit.apply',
|
|
174
|
+
}), '提交后回读');
|
|
175
|
+
const keys = { kpsKey: `kps${column.stepId}-${column.scoreUserId}` };
|
|
176
|
+
const verifyRows = (Array.isArray(after?.basicData) ? after.basicData : []).map((row) => ({
|
|
177
|
+
dataRow: row?.dataRow,
|
|
178
|
+
name: row?.type ?? null,
|
|
179
|
+
score: row?.[keys.kpsKey] ?? null,
|
|
180
|
+
}));
|
|
181
|
+
return pfSuccess('performance.flow.score.submit.apply', {
|
|
182
|
+
flowId,
|
|
183
|
+
submitted: true,
|
|
184
|
+
total: after?.score ?? null,
|
|
185
|
+
flowStatus: after?.flowStatus ?? null,
|
|
186
|
+
verify: { rows: verifyRows },
|
|
187
|
+
detailUrl: buildDetailUrl(flowId),
|
|
188
|
+
next: '已回读核对;如状态为已结束(finished),该考核本轮已完成',
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
export const flowScoreOperations = [
|
|
192
|
+
{
|
|
193
|
+
name: 'performance.flow.score.stage',
|
|
194
|
+
resource: 'performance.flow',
|
|
195
|
+
method: 'apply',
|
|
196
|
+
action: 'flow.score.stage',
|
|
197
|
+
summary: '评分暂存到考核详情页(低风险预览写:不流转、可覆盖、页面立即可见)',
|
|
198
|
+
capability: 'performance.flow.score',
|
|
199
|
+
risk: 'write',
|
|
200
|
+
requiresConfirmation: true,
|
|
201
|
+
inputSchema: schemaOf({
|
|
202
|
+
flowId: { type: 'string', description: '考核流程 id(字符串)' },
|
|
203
|
+
rows: PAYLOAD_SCHEMA,
|
|
204
|
+
confirm: { type: 'boolean', description: '必须 true(用户已知晓会写入详情页、不流转、可覆盖)' },
|
|
205
|
+
}, { required: ['flowId', 'rows', 'confirm'] }),
|
|
206
|
+
handler: stage,
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: 'performance.flow.score.submit.prepare',
|
|
210
|
+
resource: 'performance.flow',
|
|
211
|
+
method: 'prepare',
|
|
212
|
+
action: 'flow.score.submit',
|
|
213
|
+
summary: '提交评分前组装与校验(不落库):前置校验 kps/目标值/实际值/满分,返回确认摘要与 continuation',
|
|
214
|
+
capability: 'performance.flow.score',
|
|
215
|
+
risk: 'write',
|
|
216
|
+
requiresConfirmation: true,
|
|
217
|
+
inputSchema: schemaOf({
|
|
218
|
+
flowId: { type: 'string', description: '考核流程 id(字符串)' },
|
|
219
|
+
rows: PAYLOAD_SCHEMA,
|
|
220
|
+
}, { required: ['flowId', 'rows'] }),
|
|
221
|
+
handler: submitPrepare,
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: 'performance.flow.score.submit.apply',
|
|
225
|
+
resource: 'performance.flow',
|
|
226
|
+
method: 'apply',
|
|
227
|
+
action: 'flow.score.submit',
|
|
228
|
+
summary: '确认后提交评分(流转节点、可能结束考核并触发提醒),成功后自动回读',
|
|
229
|
+
capability: 'performance.flow.score',
|
|
230
|
+
risk: 'write',
|
|
231
|
+
requiresConfirmation: true,
|
|
232
|
+
inputSchema: schemaOf({
|
|
233
|
+
flowId: { type: 'string', description: '考核流程 id(字符串)' },
|
|
234
|
+
rows: PAYLOAD_SCHEMA,
|
|
235
|
+
confirm: { type: 'boolean', description: '必须 true(用户已明确同意提交)' },
|
|
236
|
+
continuation: { type: 'string', description: 'prepare 返回的 continuation' },
|
|
237
|
+
skipDistributeCheck: { type: 'boolean', description: '仅当用户确认接受分布冲突后跳过强制分布校验(warning 时用)' },
|
|
238
|
+
}, { required: ['flowId', 'rows', 'confirm', 'continuation'] }),
|
|
239
|
+
handler: submitApply,
|
|
240
|
+
},
|
|
241
|
+
];
|
|
@@ -3,11 +3,17 @@ import { schemeDraftOperations } from './scheme-draft.js';
|
|
|
3
3
|
import { schemePublishOperations } from './scheme-publish.js';
|
|
4
4
|
import { schemeDetailOperations } from './scheme-detail.js';
|
|
5
5
|
import { hrmResolveOperations } from './hrm-resolve.js';
|
|
6
|
+
import { flowListOperations } from './flow-list.js';
|
|
7
|
+
import { flowDetailOperations } from './flow-detail.js';
|
|
8
|
+
import { flowScoreOperations } from './flow-score.js';
|
|
6
9
|
const definitions = [
|
|
7
10
|
...hrmResolveOperations,
|
|
8
11
|
...schemeDetailOperations,
|
|
9
12
|
...schemeDraftOperations,
|
|
10
13
|
...schemePublishOperations,
|
|
14
|
+
...flowListOperations,
|
|
15
|
+
...flowDetailOperations,
|
|
16
|
+
...flowScoreOperations,
|
|
11
17
|
];
|
|
12
18
|
const registry = new Map();
|
|
13
19
|
for (const definition of definitions) {
|
|
@@ -76,3 +76,47 @@ export function loadBatchItems(file, expectedFingerprint) {
|
|
|
76
76
|
}
|
|
77
77
|
return items;
|
|
78
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* OCR 解析结果缓存(2026-11-18)。
|
|
81
|
+
*
|
|
82
|
+
* 为什么需要:prepare 已经调过一次 `resumeExtraction`,apply 若重新解析就是同一份原件解析两遍
|
|
83
|
+
* (单份多付 2.6~9.5 s)。批量场景的清单也无法把整份 JSON 塞进 continuation,只能落盘交接。
|
|
84
|
+
* 键 = fileId(同一份上传件的 id 唯一);24 小时内有效,过期或文件缺失自动回退重新解析。
|
|
85
|
+
* 设置 `E10_OCR_NO_CACHE=1` 可强制关闭(诊断/怀疑缓存有问题时用)。
|
|
86
|
+
*/
|
|
87
|
+
function ocrFile(fileId) {
|
|
88
|
+
const safe = String(fileId || '').replace(/[^0-9A-Za-z_-]/g, '');
|
|
89
|
+
if (!safe)
|
|
90
|
+
throw rsValidationError('ocr_cache_key_invalid', 'OCR 缓存键非法(fileId 为空)');
|
|
91
|
+
return join(batchDir(), `ocr-${safe}.json`);
|
|
92
|
+
}
|
|
93
|
+
export function saveOcrResult(fileId, structured) {
|
|
94
|
+
if (process.env.E10_OCR_NO_CACHE === '1')
|
|
95
|
+
return;
|
|
96
|
+
try {
|
|
97
|
+
const dir = batchDir();
|
|
98
|
+
cleanup(dir);
|
|
99
|
+
const p = ocrFile(fileId);
|
|
100
|
+
writeFileSync(p, JSON.stringify(structured), { mode: 0o600 });
|
|
101
|
+
try {
|
|
102
|
+
chmodSync(p, 0o600);
|
|
103
|
+
}
|
|
104
|
+
catch { /* Windows 上可能不支持 */ }
|
|
105
|
+
}
|
|
106
|
+
catch { /* 缓存写入失败不影响主流程 */ }
|
|
107
|
+
}
|
|
108
|
+
export function loadOcrResult(fileId, maxAgeMs = 24 * 3600 * 1000) {
|
|
109
|
+
if (process.env.E10_OCR_NO_CACHE === '1')
|
|
110
|
+
return null;
|
|
111
|
+
try {
|
|
112
|
+
const p = ocrFile(fileId);
|
|
113
|
+
const st = statSync(p);
|
|
114
|
+
if (Date.now() - st.mtimeMs > maxAgeMs)
|
|
115
|
+
return null;
|
|
116
|
+
const v = JSON.parse(readFileSync(p, 'utf8'));
|
|
117
|
+
return v && typeof v === 'object' && !Array.isArray(v) ? v : null;
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { join, resolve } from 'node:path';
|
|
1
|
+
import { join, resolve, dirname } from 'node:path';
|
|
2
2
|
import { existsSync } from 'node:fs';
|
|
3
|
-
import { readFile } from 'node:fs/promises';
|
|
3
|
+
import { readFile, writeFile, mkdir } from 'node:fs/promises';
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
5
|
import { createRecruitContextLoader, } from '../ehr/operations/recruit.js';
|
|
6
6
|
import { rsFail } from './errors.js';
|
|
@@ -75,6 +75,55 @@ async function readLegacyCacheExtra(baseUrl) {
|
|
|
75
75
|
return { defaultRecruitFlow: null, digitalHumanMenu: null };
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* 「默认招聘流程」探测失败标记的磁盘 TTL。
|
|
80
|
+
*
|
|
81
|
+
* 背景(2026-11-18 实测):某些环境(如自用 www.e-cology.com.cn)三条探测通道**全部取不到值**,
|
|
82
|
+
* 于是每次调用都要白付 3 个 RTT(listInit ~190 ms → getListDatas ~180 ms → 404 兜底 ~230 ms),
|
|
83
|
+
* 六个读类操作各付一遍。标记落盘后,TTL 内直接跳过探测(走 selfUse 常量/报未启用),
|
|
84
|
+
* 省 ~0.55 s/次;TTL 到期或换环境自动重新探测,成功解析时仍写正缓存。
|
|
85
|
+
* `E10_RS_NO_FLOW_CACHE=1` 可关闭(调试/首次对接新环境时用)。
|
|
86
|
+
*/
|
|
87
|
+
const FLOW_MISS_TTL_MS = 6 * 60 * 60 * 1000;
|
|
88
|
+
/**
|
|
89
|
+
* 失败标记**必须放在环境缓存目录之外**:`createRecruitContextLoader` 用「目录内恰好 1 个 json 就复用」
|
|
90
|
+
* 的启发式命中缓存,往同目录塞第二个 json 会直接把上下文缓存打冷(2026-11-18 实测:首次实现放同目录,
|
|
91
|
+
* 之后每次调用都退化成 40+ 请求的全量重建,比省下的 0.55 s 贵得多)。
|
|
92
|
+
*/
|
|
93
|
+
function flowMissPath(baseUrl) {
|
|
94
|
+
const hostDir = cacheDirFor(baseUrl); // .../env-cache/recruit-ops/<host>
|
|
95
|
+
const hostName = hostDir.split(/[\\/]/).pop() || 'unknown';
|
|
96
|
+
return join(hostDir, '..', `_recruit-stage`, `flow-miss-${hostName}.json`);
|
|
97
|
+
}
|
|
98
|
+
/** 读「上次探测失败」的时间戳(同环境 + 未过期才复用)。 */
|
|
99
|
+
async function readFlowMissAt(baseUrl) {
|
|
100
|
+
if (process.env.E10_RS_NO_FLOW_CACHE === '1')
|
|
101
|
+
return null;
|
|
102
|
+
try {
|
|
103
|
+
const raw = JSON.parse(await readFile(flowMissPath(baseUrl), 'utf8'));
|
|
104
|
+
if (raw?.baseUrl !== baseUrl || !raw?.missedAt)
|
|
105
|
+
return null;
|
|
106
|
+
if (Date.now() - raw.missedAt > FLOW_MISS_TTL_MS)
|
|
107
|
+
return null;
|
|
108
|
+
return raw.missedAt;
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
async function writeFlowMiss(baseUrl) {
|
|
115
|
+
if (process.env.E10_RS_NO_FLOW_CACHE === '1')
|
|
116
|
+
return;
|
|
117
|
+
try {
|
|
118
|
+
const dir = cacheDirFor(baseUrl);
|
|
119
|
+
if (!existsSync(dir))
|
|
120
|
+
return; // 目录不存在说明连环境缓存都没播种过,不额外造目录
|
|
121
|
+
const target = flowMissPath(baseUrl);
|
|
122
|
+
await mkdir(dirname(target), { recursive: true });
|
|
123
|
+
await writeFile(target, JSON.stringify({ baseUrl, missedAt: Date.now() }), 'utf8');
|
|
124
|
+
}
|
|
125
|
+
catch { /* 写失败不影响主流程 */ }
|
|
126
|
+
}
|
|
78
127
|
/** 从菜单树/list 里找「招聘流程」列表参数(本环境实测存在于 lists.all_search) */
|
|
79
128
|
function findFlowMenu(cache) {
|
|
80
129
|
const all = ((cache.lists || {}).all_search || []);
|
|
@@ -97,7 +146,10 @@ function isDefaultFlowRow(x) {
|
|
|
97
146
|
}
|
|
98
147
|
return false;
|
|
99
148
|
}
|
|
100
|
-
/**
|
|
149
|
+
/**
|
|
150
|
+
* 默认招聘流程解析:优先 legacy 缓存 → 招聘流程菜单列表 → 旧接口兜底。
|
|
151
|
+
* 探测成功写正缓存(memo);**探测失败**写带 TTL 的落盘标记,避免每个进程重复空跑 3 个 RTT。
|
|
152
|
+
*/
|
|
101
153
|
async function resolveDefaultRecruitFlow(host, baseUrl, appId, cache) {
|
|
102
154
|
const memoKey = baseUrl;
|
|
103
155
|
if (flowMemo.has(memoKey))
|
|
@@ -107,9 +159,13 @@ async function resolveDefaultRecruitFlow(host, baseUrl, appId, cache) {
|
|
|
107
159
|
flowMemo.set(memoKey, legacy.defaultRecruitFlow);
|
|
108
160
|
return legacy.defaultRecruitFlow;
|
|
109
161
|
}
|
|
162
|
+
// TTL 内已知探测失败 → 跳过三条探测通道(下面 ③ 的自用兜底仍会生效)
|
|
163
|
+
const missFresh = await readFlowMissAt(baseUrl);
|
|
110
164
|
let result = null;
|
|
165
|
+
/** 是否由服务端通道(①菜单列表 / ②旧接口)解析出来;③ 自用常量兜底不算 */
|
|
166
|
+
let serverResolved = false;
|
|
111
167
|
// ① 招聘流程菜单列表(本环境实测入口,原实现只调接口必然失败)
|
|
112
|
-
const menu = findFlowMenu(cache);
|
|
168
|
+
const menu = missFresh ? null : findFlowMenu(cache);
|
|
113
169
|
if (menu) {
|
|
114
170
|
try {
|
|
115
171
|
// getListDatas 的 passid/cid 必须是**表单 objId**,不是 listId;
|
|
@@ -144,15 +200,17 @@ async function resolveDefaultRecruitFlow(host, baseUrl, appId, cache) {
|
|
|
144
200
|
if (pick) {
|
|
145
201
|
const id = String(pick.form_data_id || pick.id || '');
|
|
146
202
|
const name = String(pick.name || pick.flow_name || pick.content || '');
|
|
147
|
-
if (id && name)
|
|
203
|
+
if (id && name) {
|
|
148
204
|
result = { id, name };
|
|
205
|
+
serverResolved = true;
|
|
206
|
+
}
|
|
149
207
|
}
|
|
150
208
|
}
|
|
151
209
|
}
|
|
152
210
|
catch { /* 菜单通道不可用 → 走接口兜底 */ }
|
|
153
211
|
}
|
|
154
|
-
// ②
|
|
155
|
-
if (!result) {
|
|
212
|
+
// ② 旧接口兜底(原实现唯一通道,部分环境保留);TTL 内已知探测失败时跳过,别再白打一次 404
|
|
213
|
+
if (!result && !missFresh) {
|
|
156
214
|
try {
|
|
157
215
|
const r = await host.request({
|
|
158
216
|
path: '/api/recruit/position/recruitFlow/list',
|
|
@@ -165,6 +223,7 @@ async function resolveDefaultRecruitFlow(host, baseUrl, appId, cache) {
|
|
|
165
223
|
const enabled = list.find(isDefaultFlowRow) || null;
|
|
166
224
|
if (enabled?.id) {
|
|
167
225
|
result = { id: String(enabled.id), name: String(enabled.name || enabled.flow_name || '') };
|
|
226
|
+
serverResolved = true;
|
|
168
227
|
}
|
|
169
228
|
}
|
|
170
229
|
catch { /* 接口形态不符/未开放 */ }
|
|
@@ -183,9 +242,16 @@ async function resolveDefaultRecruitFlow(host, baseUrl, appId, cache) {
|
|
|
183
242
|
result = { id: SELFUSE_DEFAULT_FLOW.id, name: SELFUSE_DEFAULT_FLOW.name };
|
|
184
243
|
}
|
|
185
244
|
}
|
|
186
|
-
|
|
187
|
-
if (result)
|
|
245
|
+
if (serverResolved) {
|
|
188
246
|
flowMemo.set(memoKey, result);
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
// 服务端三条通道都没解析出来 → 记一次「探测失败」,TTL 内后续进程不再空跑(见 FLOW_MISS_TTL_MS)。
|
|
250
|
+
// 进程内仍 memo 结果(自用常量兜底的值也好、null 也好),避免同进程重复走 ③。
|
|
251
|
+
if (!missFresh)
|
|
252
|
+
await writeFlowMiss(baseUrl);
|
|
253
|
+
flowMemo.set(memoKey, result);
|
|
254
|
+
}
|
|
189
255
|
return result;
|
|
190
256
|
}
|
|
191
257
|
async function resolveDigitalHumanMenu(host, baseUrl, cache) {
|
|
@@ -23,7 +23,7 @@ export const recruitStageManifest = {
|
|
|
23
23
|
host: 'e10-recruit-stage',
|
|
24
24
|
status: 'builtin',
|
|
25
25
|
sourceSkill: 'weaver-e10-recruit-stage',
|
|
26
|
-
capabilities: ['recruit.jd.create', 'recruit.resume.import', 'recruit.interview.arrange', 'recruit.interview.feedback', 'recruit.list', 'recruit.candidate.search'],
|
|
26
|
+
capabilities: ['recruit.jd.create', 'recruit.resume.import', 'recruit.interview.arrange', 'recruit.interview.feedback', 'recruit.list', 'recruit.candidate.search', 'recruit.tag'],
|
|
27
27
|
operations: buildOperations(),
|
|
28
28
|
withheldOperations: [],
|
|
29
29
|
};
|
|
@@ -140,6 +140,35 @@ function refToSubmit(d) {
|
|
|
140
140
|
// ② cache.menus(若某环境确实有)
|
|
141
141
|
// ③ allMenus 接口兜底(resolvePositionNewUrl 已在用,同一写法)
|
|
142
142
|
const WORK_PLACE_NAMES = ['办公地点', '工作地点'];
|
|
143
|
+
/**
|
|
144
|
+
* `allMenus` 菜单树:**进程内按 appId 记忆**(原本 findWorkPlaceMenu / resolvePositionNewUrl /
|
|
145
|
+
* resolveHomePageUrl 三处各发一次,2026-11-18 实测同一次 jd.prefill 里发了 2 次,其中一次 787 ms)。
|
|
146
|
+
* 只做进程内 memo,不落盘:菜单树随部署变化,跨进程复用风险大于收益。
|
|
147
|
+
*/
|
|
148
|
+
const allMenusMemo = new Map();
|
|
149
|
+
async function fetchAllMenusFlat(ctx) {
|
|
150
|
+
const key = `${ctx.baseUrl}|${ctx.appId}`;
|
|
151
|
+
const memo = allMenusMemo.get(key);
|
|
152
|
+
if (memo)
|
|
153
|
+
return memo;
|
|
154
|
+
try {
|
|
155
|
+
const r = await ctx.host.request({
|
|
156
|
+
path: `/api/cusapp/app/allMenus?isFront=1&appId=${ctx.appId}&terminalType=PC`,
|
|
157
|
+
method: 'GET',
|
|
158
|
+
});
|
|
159
|
+
const flat = [];
|
|
160
|
+
(function walk(ns) { for (const n of (ns || []))
|
|
161
|
+
if (n && typeof n === 'object') {
|
|
162
|
+
flat.push(n);
|
|
163
|
+
walk(n.children || n.childs);
|
|
164
|
+
} })(r?.data?.cusAppMenus || r?.data);
|
|
165
|
+
allMenusMemo.set(key, flat);
|
|
166
|
+
return flat;
|
|
167
|
+
}
|
|
168
|
+
catch {
|
|
169
|
+
return []; // 接口不可用:调用方按「没找到」处理
|
|
170
|
+
}
|
|
171
|
+
}
|
|
143
172
|
async function findWorkPlaceMenu(ctx) {
|
|
144
173
|
const { host, appId, cache } = ctx;
|
|
145
174
|
const ok = (m) => m && m.listId;
|
|
@@ -154,13 +183,7 @@ async function findWorkPlaceMenu(ctx) {
|
|
|
154
183
|
return { listId: String(hit2.listId), cusMenuId: String(hit2.cusMenuId || ''), menuName: String(hit2.menuName || '') };
|
|
155
184
|
// ③ allMenus 接口
|
|
156
185
|
try {
|
|
157
|
-
const
|
|
158
|
-
const flat = [];
|
|
159
|
-
(function walk(ns) { for (const n of (ns || []))
|
|
160
|
-
if (n && typeof n === 'object') {
|
|
161
|
-
flat.push(n);
|
|
162
|
-
walk(n.children || n.childs);
|
|
163
|
-
} })(r?.data?.cusAppMenus || r?.data);
|
|
186
|
+
const flat = await fetchAllMenusFlat(ctx);
|
|
164
187
|
const hit3 = findMenuNode(flat, WORK_PLACE_NAMES, (m) => ok(m));
|
|
165
188
|
if (hit3)
|
|
166
189
|
return { listId: String(hit3.listId), cusMenuId: String(hit3.cusMenuId || ''), menuName: String(hit3.menuName || '') };
|
|
@@ -353,13 +376,7 @@ async function resolvePositionNewUrl(ctx) {
|
|
|
353
376
|
const cached = cache.menus?.find?.((m) => m.combinationId && m.id && m.pageId && ['招聘职位', '职位列表', '职位管理'].some((n) => (m.menuName || '').includes(n)));
|
|
354
377
|
let node = cached || null;
|
|
355
378
|
if (!node) {
|
|
356
|
-
const
|
|
357
|
-
const flat = [];
|
|
358
|
-
(function walk(ns) { for (const n of (ns || []))
|
|
359
|
-
if (n && typeof n === 'object') {
|
|
360
|
-
flat.push(n);
|
|
361
|
-
walk(n.children || n.childs);
|
|
362
|
-
} })(r?.data?.cusAppMenus || r?.data);
|
|
379
|
+
const flat = await fetchAllMenusFlat(ctx);
|
|
363
380
|
node = findMenuNode(flat, ['招聘职位', '职位列表', '职位管理'], (n) => n.combinationId && n.id && n.pageId);
|
|
364
381
|
}
|
|
365
382
|
if (!node)
|
|
@@ -368,14 +385,8 @@ async function resolvePositionNewUrl(ctx) {
|
|
|
368
385
|
}
|
|
369
386
|
// 招聘首页(PAGE 型)URL
|
|
370
387
|
async function resolveHomePageUrl(ctx) {
|
|
371
|
-
const {
|
|
372
|
-
const
|
|
373
|
-
const flat = [];
|
|
374
|
-
(function walk(ns) { for (const n of (ns || []))
|
|
375
|
-
if (n && typeof n === 'object') {
|
|
376
|
-
flat.push(n);
|
|
377
|
-
walk(n.children || n.childs);
|
|
378
|
-
} })(r?.data?.cusAppMenus || r?.data);
|
|
388
|
+
const { baseUrl, appId } = ctx;
|
|
389
|
+
const flat = await fetchAllMenusFlat(ctx);
|
|
379
390
|
const node = findMenuNode(flat, ['招聘首页', '招聘主页'], (n) => n.pageType === 'PAGE' && n.pageId && n.id)
|
|
380
391
|
|| flat.find((n) => n.pageType === 'PAGE' && String(n.menuName || '').includes('首页'));
|
|
381
392
|
if (!node || !node.pageId || !node.id)
|