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,680 @@
|
|
|
1
|
+
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
|
+
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
hrmEmployeeOperations
|
|
5
|
+
} from "./chunk-C4YQJFZV.js";
|
|
6
|
+
import {
|
|
7
|
+
hrmOrgOperations
|
|
8
|
+
} from "./chunk-5QYE52LG.js";
|
|
9
|
+
import {
|
|
10
|
+
READ,
|
|
11
|
+
SCHEMA_ID,
|
|
12
|
+
browserBaseBody,
|
|
13
|
+
hrmSuccess,
|
|
14
|
+
orgLink,
|
|
15
|
+
pickDefined,
|
|
16
|
+
positionLink,
|
|
17
|
+
schemaOf,
|
|
18
|
+
toNumber,
|
|
19
|
+
toStringIdList
|
|
20
|
+
} from "./chunk-JEQHNNSS.js";
|
|
21
|
+
import {
|
|
22
|
+
hrmValidationError
|
|
23
|
+
} from "./chunk-56EZERK4.js";
|
|
24
|
+
|
|
25
|
+
// src/shortcuts/hrm/operations/position.ts
|
|
26
|
+
function positionFormDatas() {
|
|
27
|
+
const d = {};
|
|
28
|
+
for (const f of ["name", "full_name", "code", "parent", "department", "jobsetid", "grade_id"]) {
|
|
29
|
+
d[f] = [{ [`${f}Opt`]: { id: "in", content: "\u5305\u542B", disabled: false } }];
|
|
30
|
+
}
|
|
31
|
+
return d;
|
|
32
|
+
}
|
|
33
|
+
function formatPosRow(r, baseUrl) {
|
|
34
|
+
return {
|
|
35
|
+
id: r.id,
|
|
36
|
+
name: r.name || r.content || "",
|
|
37
|
+
code: r.code || "",
|
|
38
|
+
title: r.title || "",
|
|
39
|
+
leaf: r.leaf !== false,
|
|
40
|
+
link: positionLink(baseUrl, r.id)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function formatPosListItem(r, baseUrl) {
|
|
44
|
+
return {
|
|
45
|
+
id: r.id,
|
|
46
|
+
name: r.name,
|
|
47
|
+
fullName: r.fullName || "",
|
|
48
|
+
code: r.code || "",
|
|
49
|
+
parent: r.parent || "",
|
|
50
|
+
parentId: r.parentId || "",
|
|
51
|
+
department: r.department || "",
|
|
52
|
+
userCount: r.userCount || "0",
|
|
53
|
+
partTimeCount: r.partTimeCount || "0",
|
|
54
|
+
cancelStatus: r.cancelStatus,
|
|
55
|
+
jobsetid: r.jobsetid || "",
|
|
56
|
+
link: positionLink(baseUrl, r.id)
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
var positionQuery = {
|
|
60
|
+
name: "hrm.position.query",
|
|
61
|
+
resource: "position",
|
|
62
|
+
method: "position.query",
|
|
63
|
+
action: "hrm.position.query",
|
|
64
|
+
summary: "\u6309\u540D\u79F0/\u7F16\u53F7\u67E5\u5C97\u4F4D\uFF08\u5FEB\u6377\u641C\u7D22\u540D\u79F0\u7F16\u53F7\u5408\u4E00\uFF1B\u663E\u5F0F name/code \u8D70\u9AD8\u7EA7\u6761\u4EF6\uFF09",
|
|
65
|
+
risk: READ,
|
|
66
|
+
inputSchema: schemaOf({
|
|
67
|
+
keyword: { type: "string", description: "\u5FEB\u6377\u641C\u7D22\u5173\u952E\u8BCD\uFF0C\u540D\u79F0\u4E0E\u7F16\u53F7\u5408\u4E00\u5339\u914D" },
|
|
68
|
+
name: { type: "string", description: "\u5C97\u4F4D\u540D\u79F0\uFF08\u5305\u542B\u5339\u914D\uFF09" },
|
|
69
|
+
code: { type: "string", description: "\u5C97\u4F4D\u7F16\u53F7\uFF08\u7CBE\u786E\u5339\u914D\uFF09" }
|
|
70
|
+
}),
|
|
71
|
+
handler: async (args, { host }) => {
|
|
72
|
+
const name = args.name === void 0 ? "" : String(args.name).trim();
|
|
73
|
+
const code = args.code === void 0 ? "" : String(args.code).trim();
|
|
74
|
+
const keyword = args.keyword === void 0 ? "" : String(args.keyword).trim();
|
|
75
|
+
if (!name && !code && !keyword) {
|
|
76
|
+
throw hrmValidationError("empty_condition", "\u5C97\u4F4D\u67E5\u8BE2\u5FC5\u987B\u643A\u5E26\u81F3\u5C11\u4E00\u4E2A\u6536\u655B\u6761\u4EF6\uFF1Akeyword \u6216 name / code");
|
|
77
|
+
}
|
|
78
|
+
const formDatas = positionFormDatas();
|
|
79
|
+
const quickSearchDatas = {};
|
|
80
|
+
if (name) {
|
|
81
|
+
formDatas.name = [{ nameOpt: { id: "in", content: "\u5305\u542B", disabled: false } }, { nameInput: name }];
|
|
82
|
+
} else if (code) {
|
|
83
|
+
formDatas.code = [{ codeOpt: { id: "eq", content: "\u7B49\u4E8E", disabled: false } }, { codeInput: code }];
|
|
84
|
+
} else {
|
|
85
|
+
quickSearchDatas.name = keyword;
|
|
86
|
+
}
|
|
87
|
+
const resp = await host.request({
|
|
88
|
+
method: "POST",
|
|
89
|
+
path: "/api/app/hrm/common/browser/data/position",
|
|
90
|
+
body: { cmd: "list", current: 1, pageSize: 200, formDatas, quickSearchDatas, type: "and" }
|
|
91
|
+
});
|
|
92
|
+
const d = resp?.data ?? {};
|
|
93
|
+
const rawRows = Array.isArray(d.data) ? d.data : [];
|
|
94
|
+
const session = await host.getSession();
|
|
95
|
+
const baseUrl = session.baseUrl.replace(/\/+$/, "");
|
|
96
|
+
const rows = rawRows.map((r) => formatPosRow(r, baseUrl));
|
|
97
|
+
return hrmSuccess("hrm.position.query", { rows, total: Number(d.total ?? rows.length) });
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
var positionDetail = {
|
|
101
|
+
name: "hrm.position.detail",
|
|
102
|
+
resource: "position",
|
|
103
|
+
method: "position.detail",
|
|
104
|
+
action: "hrm.position.detail",
|
|
105
|
+
summary: "\u6309\u5C97\u4F4D id \u53D6\u5C97\u4F4D\u8BE6\u60C5\u8868\u5355\uFF08\u53EA\u8BFB type=info\uFF0C\u542B\u804C\u52A1/\u804C\u7EA7\u540D\u79F0\uFF09",
|
|
106
|
+
risk: READ,
|
|
107
|
+
inputSchema: schemaOf(
|
|
108
|
+
{ id: SCHEMA_ID },
|
|
109
|
+
{ required: ["id"] }
|
|
110
|
+
),
|
|
111
|
+
handler: async (args, { host }) => {
|
|
112
|
+
const id = String(args.id).trim();
|
|
113
|
+
if (!id) throw hrmValidationError("id_required", "id \u5FC5\u586B");
|
|
114
|
+
const session = await host.getSession();
|
|
115
|
+
const baseUrl = session.baseUrl.replace(/\/+$/, "");
|
|
116
|
+
const resp = await host.request({
|
|
117
|
+
method: "GET",
|
|
118
|
+
path: "/api/bs/hrm/post/getEditOrAddPostForm",
|
|
119
|
+
query: { id, type: "info" },
|
|
120
|
+
headers: { Referer: `${baseUrl}/sp/hrm/positionCard/${id}` }
|
|
121
|
+
});
|
|
122
|
+
const raw = resp?.data?.data ?? {};
|
|
123
|
+
const parentName = Array.isArray(raw.parent) && raw.parent[0]?.name ? String(raw.parent[0].name) : "";
|
|
124
|
+
const jobsetName = Array.isArray(raw.jobsetid) && raw.jobsetid[0]?.name ? String(raw.jobsetid[0].name) : "";
|
|
125
|
+
const jobsetTypeName = Array.isArray(raw.jobset_type_id) && raw.jobset_type_id[0]?.name ? String(raw.jobset_type_id[0].name) : "";
|
|
126
|
+
const grade = Array.isArray(raw.grade) ? raw.grade.map((g) => g && typeof g === "object" ? g.name ?? g : g) : raw.grade;
|
|
127
|
+
return hrmSuccess("hrm.position.detail", {
|
|
128
|
+
id,
|
|
129
|
+
name: raw.name,
|
|
130
|
+
code: raw.code,
|
|
131
|
+
...parentName ? { parentName } : {},
|
|
132
|
+
...jobsetName ? { jobsetName } : {},
|
|
133
|
+
...jobsetTypeName ? { jobsetTypeName } : {},
|
|
134
|
+
...grade !== void 0 ? { grade } : {},
|
|
135
|
+
link: positionLink(baseUrl, id)
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
var positionList = {
|
|
140
|
+
name: "hrm.position.list",
|
|
141
|
+
resource: "position",
|
|
142
|
+
method: "position.list",
|
|
143
|
+
action: "hrm.position.list",
|
|
144
|
+
summary: "\u6309\u7EC4\u7EC7/\u540D\u79F0/\u7F16\u53F7\u6279\u91CF\u67E5\u8BE2\u5C97\u4F4D\uFF08\u5C97\u4F4D\u5730\u5740\u7C3F\uFF0C\u4E00\u6B21\u6027 + \u81EA\u52A8\u7FFB\u9875\uFF1B\u65E0\u8FC7\u6EE4\u9700\u663E\u5F0F all=true\uFF09",
|
|
145
|
+
risk: READ,
|
|
146
|
+
inputSchema: schemaOf({
|
|
147
|
+
org: SCHEMA_ID,
|
|
148
|
+
name: { type: "string", description: "\u5C97\u4F4D\u540D\u79F0\u8FC7\u6EE4\uFF08\u4E0E code \u4E8C\u9009\u4E00\uFF09" },
|
|
149
|
+
code: { type: "string", description: "\u5C97\u4F4D\u7F16\u53F7\u8FC7\u6EE4\uFF08\u4E0E name \u4E8C\u9009\u4E00\uFF09" },
|
|
150
|
+
all: { type: "boolean", description: "\u663E\u5F0F\u786E\u8BA4\u5168\u91CF\u62C9\u53D6\uFF08\u65E0 org/name/code \u8FC7\u6EE4\u65F6\u5FC5\u586B true\uFF09" },
|
|
151
|
+
pageSize: SCHEMA_ID
|
|
152
|
+
}),
|
|
153
|
+
handler: async (args, { host }) => {
|
|
154
|
+
const hasFilter = args.org !== void 0 || args.name !== void 0 || args.code !== void 0;
|
|
155
|
+
if (!hasFilter && args.all !== true) {
|
|
156
|
+
throw hrmValidationError("full_pull_blocked", "\u7981\u6B62\u65E0\u6761\u4EF6\u5168\u91CF\u62C9\u53D6\u5C97\u4F4D\uFF08\u5F53\u524D\u73AF\u5883\u5C97\u4F4D\u53EF\u8FBE\u6570\u5343\u6761\uFF09\u3002\u8BF7\u63D0\u4F9B org\uFF08\u7EC4\u7EC7 id\uFF09\u6216 name / code \u8FC7\u6EE4\uFF1B\u786E\u9700\u5168\u91CF\u8BF7\u663E\u5F0F\u4F20 all=true");
|
|
157
|
+
}
|
|
158
|
+
const body = {
|
|
159
|
+
moduleType: "positionAddressBook",
|
|
160
|
+
leftOrgId: args.org !== void 0 ? String(args.org) : "",
|
|
161
|
+
tableType: "none",
|
|
162
|
+
isContainBlock: "0",
|
|
163
|
+
includeSub: true,
|
|
164
|
+
saCondition: {
|
|
165
|
+
name: [{ name_condition: "in" }],
|
|
166
|
+
fullName: [{ fullName_condition: "in" }],
|
|
167
|
+
code: [{ code_condition: "in" }],
|
|
168
|
+
department: [{ department_condition: "in" }]
|
|
169
|
+
},
|
|
170
|
+
saMatchType: "and"
|
|
171
|
+
};
|
|
172
|
+
if (args.name !== void 0 || args.code !== void 0) {
|
|
173
|
+
body.keyword = String(args.name ?? args.code);
|
|
174
|
+
body.keywordMatchFieldList = args.name !== void 0 ? ["name"] : ["code"];
|
|
175
|
+
} else {
|
|
176
|
+
body.keyword = "";
|
|
177
|
+
body.keywordMatchFieldList = [];
|
|
178
|
+
}
|
|
179
|
+
const pageSize = toNumber(args.pageSize, "pageSize") ?? 100;
|
|
180
|
+
const collected = [];
|
|
181
|
+
let total = 0;
|
|
182
|
+
const maxPages = 500;
|
|
183
|
+
for (let current = 1; current <= maxPages; current++) {
|
|
184
|
+
const resp = await host.request({
|
|
185
|
+
method: "POST",
|
|
186
|
+
path: "/api/bs/hrm/position/queryListByOrgTree",
|
|
187
|
+
body: { ...body, current, pageSize }
|
|
188
|
+
});
|
|
189
|
+
const d = resp?.data ?? {};
|
|
190
|
+
const rows = Array.isArray(d.data) ? d.data : [];
|
|
191
|
+
collected.push(...rows);
|
|
192
|
+
total = Number(d.total ?? total);
|
|
193
|
+
if (!rows.length || collected.length >= total) break;
|
|
194
|
+
}
|
|
195
|
+
const session = await host.getSession();
|
|
196
|
+
const baseUrl = session.baseUrl.replace(/\/+$/, "");
|
|
197
|
+
const list = collected.map((r) => formatPosListItem(r, baseUrl));
|
|
198
|
+
return hrmSuccess("hrm.position.list", { rows: list, total: total || list.length }, { pageSize });
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
var hrmPositionOperations = [
|
|
202
|
+
positionQuery,
|
|
203
|
+
positionDetail,
|
|
204
|
+
positionList
|
|
205
|
+
];
|
|
206
|
+
|
|
207
|
+
// src/shortcuts/hrm/operations/resolve.ts
|
|
208
|
+
var ORG_TYPES = ["department", "subcompany"];
|
|
209
|
+
var BROWSE_PAGE_SIZE = 100;
|
|
210
|
+
var MAX_CANDIDATES = 20;
|
|
211
|
+
var MAX_CANDIDATES_LIMIT = 200;
|
|
212
|
+
var SUGGESTION_LIMIT = 5;
|
|
213
|
+
var NEAR_NAME_THRESHOLD = 0.6;
|
|
214
|
+
var VIRTUAL_PATH = "/api/bs/hrm/companyVirtual/listCompanyVirtual";
|
|
215
|
+
var DEPT_PATH = "/api/hrm/common/browser/data/department";
|
|
216
|
+
var SUB_PATH = "/api/hrm/common/browser/data/subcompany";
|
|
217
|
+
var ORG_DETAIL_PATH = "/api/bs/hrm/organization/getForm";
|
|
218
|
+
var BROWSER_REFERER = "/hrm/addressbook/department";
|
|
219
|
+
function optionalText(value) {
|
|
220
|
+
if (value === void 0 || value === null) return void 0;
|
|
221
|
+
const text = String(value).trim();
|
|
222
|
+
return text === "" ? void 0 : text;
|
|
223
|
+
}
|
|
224
|
+
function optionalId(value, field) {
|
|
225
|
+
if (value === void 0 || value === null || value === "") return void 0;
|
|
226
|
+
return toStringIdList(value, field)?.[0];
|
|
227
|
+
}
|
|
228
|
+
function normalizeName(value) {
|
|
229
|
+
return String(value ?? "").replace(/\s+/g, " ").trim();
|
|
230
|
+
}
|
|
231
|
+
function matchByName(items, keyword) {
|
|
232
|
+
const key = normalizeName(keyword).toLowerCase();
|
|
233
|
+
if (!key) return { matchType: "none", items: [] };
|
|
234
|
+
const exact = items.filter((item) => normalizeName(item.name).toLowerCase() === key);
|
|
235
|
+
if (exact.length > 0) return { matchType: "exact", items: exact };
|
|
236
|
+
const fuzzy = items.filter((item) => normalizeName(item.name).toLowerCase().includes(key));
|
|
237
|
+
return fuzzy.length > 0 ? { matchType: "fuzzy", items: fuzzy } : { matchType: "none", items: [] };
|
|
238
|
+
}
|
|
239
|
+
async function fetchVirtuals(host, baseUrl) {
|
|
240
|
+
const resp = await host.request({
|
|
241
|
+
method: "GET",
|
|
242
|
+
path: VIRTUAL_PATH,
|
|
243
|
+
headers: { Referer: `${baseUrl}${BROWSER_REFERER}` }
|
|
244
|
+
});
|
|
245
|
+
const raw = resp?.data;
|
|
246
|
+
if (!Array.isArray(raw)) return [];
|
|
247
|
+
return raw.map((item) => ({ id: String(item?.id ?? ""), name: normalizeName(item?.content ?? item?.name) })).filter((item) => item.id !== "" && item.name !== "");
|
|
248
|
+
}
|
|
249
|
+
async function browseOrg(host, baseUrl, options) {
|
|
250
|
+
const { type, virtualId, name, exact } = options;
|
|
251
|
+
const body = {
|
|
252
|
+
...browserBaseBody(),
|
|
253
|
+
virtualType: "ALL",
|
|
254
|
+
cmd: "list",
|
|
255
|
+
current: 1,
|
|
256
|
+
// 浏览分页只服务于「取候选」:输出侧另有 maxCandidates 截断,故按上限放宽(仍 ≤ 200)。
|
|
257
|
+
pageSize: options.pageSize ?? BROWSE_PAGE_SIZE,
|
|
258
|
+
formDatas: {
|
|
259
|
+
name: [
|
|
260
|
+
{
|
|
261
|
+
nameCondition: { id: exact ? "eq" : "in", content: exact ? "\u7B49\u4E8E" : "\u5305\u542B", disabled: false },
|
|
262
|
+
name
|
|
263
|
+
}
|
|
264
|
+
]
|
|
265
|
+
},
|
|
266
|
+
quickSearchDatas: {},
|
|
267
|
+
type: "and",
|
|
268
|
+
stopDepartment: false,
|
|
269
|
+
// companyId = 多维 id;不传会默认落到「行政组织」维度。
|
|
270
|
+
companyId: virtualId
|
|
271
|
+
};
|
|
272
|
+
if (type === "department") body.enableSubcompany = false;
|
|
273
|
+
const resp = await host.request({
|
|
274
|
+
method: "POST",
|
|
275
|
+
path: type === "department" ? DEPT_PATH : SUB_PATH,
|
|
276
|
+
body,
|
|
277
|
+
headers: { Referer: `${baseUrl}${BROWSER_REFERER}` }
|
|
278
|
+
});
|
|
279
|
+
const data = resp?.data ?? {};
|
|
280
|
+
const rows = Array.isArray(data.data) ? data.data : [];
|
|
281
|
+
return { rows, total: Number(data.total ?? rows.length) };
|
|
282
|
+
}
|
|
283
|
+
function parentPathOf(row) {
|
|
284
|
+
const direct = normalizeName(row?.supDepartment ?? row?.supSubDepartment ?? "");
|
|
285
|
+
if (direct) return direct.replace(/\s*\|\s*/g, "/");
|
|
286
|
+
const title = typeof row?.title === "string" ? row.title : "";
|
|
287
|
+
const sep = title.indexOf("|");
|
|
288
|
+
return sep >= 0 ? normalizeName(title.slice(sep + 1)).replace(/\s*\|\s*/g, "/") : "";
|
|
289
|
+
}
|
|
290
|
+
function fullPathOf(row) {
|
|
291
|
+
const parentPath = parentPathOf(row);
|
|
292
|
+
const name = normalizeName(row?.name ?? "");
|
|
293
|
+
return parentPath ? `${parentPath}/${name}` : name;
|
|
294
|
+
}
|
|
295
|
+
function formatOrg(row, baseUrl, virtualName) {
|
|
296
|
+
const parentPath = parentPathOf(row);
|
|
297
|
+
return {
|
|
298
|
+
id: String(row?.id ?? ""),
|
|
299
|
+
name: normalizeName(row?.name ?? ""),
|
|
300
|
+
type: String(row?.type ?? ""),
|
|
301
|
+
fullPath: fullPathOf(row),
|
|
302
|
+
...parentPath ? { parentPath } : {},
|
|
303
|
+
...row?.parent ? { parentId: String(row.parent) } : {},
|
|
304
|
+
...row?.subcompanyid ? { subcompanyId: String(row.subcompanyid) } : {},
|
|
305
|
+
...row?.virtualid ? { virtualId: String(row.virtualid) } : {},
|
|
306
|
+
...virtualName ? { virtualName } : {},
|
|
307
|
+
...row?.hasSub === true ? { hasSub: true } : {},
|
|
308
|
+
...pickDefined(row, ["code", "shortname", "description", "remark", "status"]),
|
|
309
|
+
link: orgLink(baseUrl, row?.id)
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
function formatCandidate(row, baseUrl) {
|
|
313
|
+
return {
|
|
314
|
+
id: String(row?.id ?? ""),
|
|
315
|
+
name: normalizeName(row?.name ?? ""),
|
|
316
|
+
type: String(row?.type ?? ""),
|
|
317
|
+
fullPath: fullPathOf(row),
|
|
318
|
+
...row?.code ? { code: String(row.code) } : {},
|
|
319
|
+
link: orgLink(baseUrl, row?.id)
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
function capCandidates(items, limit) {
|
|
323
|
+
return items.length > limit ? { items: items.slice(0, limit), truncated: true } : { items, truncated: false };
|
|
324
|
+
}
|
|
325
|
+
function resolveCandidateLimit(value) {
|
|
326
|
+
if (value === void 0 || value === null || value === "") return MAX_CANDIDATES;
|
|
327
|
+
const limit = toNumber(value, "maxCandidates");
|
|
328
|
+
if (limit === void 0) return MAX_CANDIDATES;
|
|
329
|
+
if (!Number.isInteger(limit) || limit < 1 || limit > MAX_CANDIDATES_LIMIT) {
|
|
330
|
+
throw hrmValidationError("number_invalid", `maxCandidates \u5FC5\u987B\u662F 1~${MAX_CANDIDATES_LIMIT} \u7684\u6574\u6570`);
|
|
331
|
+
}
|
|
332
|
+
return limit;
|
|
333
|
+
}
|
|
334
|
+
function editDistance(a, b) {
|
|
335
|
+
const m = a.length;
|
|
336
|
+
const n = b.length;
|
|
337
|
+
if (m === 0) return n;
|
|
338
|
+
if (n === 0) return m;
|
|
339
|
+
let prev = Array.from({ length: n + 1 }, (_, index) => index);
|
|
340
|
+
for (let i = 1; i <= m; i += 1) {
|
|
341
|
+
const current = new Array(n + 1);
|
|
342
|
+
current[0] = i;
|
|
343
|
+
for (let j = 1; j <= n; j += 1) {
|
|
344
|
+
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
|
|
345
|
+
current[j] = Math.min(prev[j] + 1, current[j - 1] + 1, prev[j - 1] + cost);
|
|
346
|
+
}
|
|
347
|
+
prev = current;
|
|
348
|
+
}
|
|
349
|
+
return prev[n];
|
|
350
|
+
}
|
|
351
|
+
function similarity(a, b) {
|
|
352
|
+
const longest = Math.max(a.length, b.length);
|
|
353
|
+
return longest === 0 ? 1 : 1 - editDistance(a, b) / longest;
|
|
354
|
+
}
|
|
355
|
+
function nearNameSuggestions(items, keyword, limit) {
|
|
356
|
+
const key = normalizeName(keyword).toLowerCase();
|
|
357
|
+
if (!key) return [];
|
|
358
|
+
return items.map((item) => ({ item, name: normalizeName(item.name).toLowerCase() })).filter((entry) => entry.name !== "" && !entry.name.includes(key)).map((entry) => ({ item: entry.item, score: similarity(key, entry.name) })).filter((entry) => entry.score >= NEAR_NAME_THRESHOLD).sort((a, b) => b.score - a.score).slice(0, limit).map((entry) => entry.item);
|
|
359
|
+
}
|
|
360
|
+
async function probeNearOrgNames(host, baseUrl, options) {
|
|
361
|
+
const { type, virtualId, keyword, pageSize } = options;
|
|
362
|
+
const keys = [];
|
|
363
|
+
for (const candidate of [keyword.slice(-2), keyword.slice(0, 2)]) {
|
|
364
|
+
const key = candidate.trim();
|
|
365
|
+
if (key.length >= 2 && key !== keyword && !keys.includes(key)) keys.push(key);
|
|
366
|
+
}
|
|
367
|
+
for (const key of keys) {
|
|
368
|
+
const result = await browseOrg(host, baseUrl, { type, virtualId, name: key, exact: false, pageSize });
|
|
369
|
+
if (result.rows.length > 0) return { rows: result.rows, total: result.total, key };
|
|
370
|
+
}
|
|
371
|
+
return { rows: [], total: 0, key: "" };
|
|
372
|
+
}
|
|
373
|
+
function typeLabel(type) {
|
|
374
|
+
if (type === "department") return "\u90E8\u95E8";
|
|
375
|
+
if (type === "subcompany") return "\u5206\u90E8";
|
|
376
|
+
return "\u7EC4\u7EC7\uFF08\u90E8\u95E8/\u5206\u90E8\uFF09";
|
|
377
|
+
}
|
|
378
|
+
async function fetchOrgById(host, baseUrl, id) {
|
|
379
|
+
const resp = await host.request({
|
|
380
|
+
method: "GET",
|
|
381
|
+
path: ORG_DETAIL_PATH,
|
|
382
|
+
query: { id, readOnly: true, includeSub: true, quote: true, isMobile: false },
|
|
383
|
+
headers: { Referer: `${baseUrl}/sp/hrm/orgCard/${id}` }
|
|
384
|
+
});
|
|
385
|
+
const raw = resp?.data?.data ?? {};
|
|
386
|
+
const parentName = Array.isArray(raw.parent) && raw.parent[0]?.name ? String(raw.parent[0].name) : "";
|
|
387
|
+
const subcompanyName = Array.isArray(raw.subcompany) && raw.subcompany[0]?.name ? String(raw.subcompany[0].name) : "";
|
|
388
|
+
return {
|
|
389
|
+
id,
|
|
390
|
+
name: normalizeName(raw.name),
|
|
391
|
+
type: raw.type,
|
|
392
|
+
...pickDefined(raw, ["code", "fullPath", "status"]),
|
|
393
|
+
...parentName ? { parentName } : {},
|
|
394
|
+
...subcompanyName ? { subcompanyName } : {},
|
|
395
|
+
link: orgLink(baseUrl, id)
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
var orgResolve = {
|
|
399
|
+
name: "hrm.org.resolve",
|
|
400
|
+
resource: "org",
|
|
401
|
+
method: "org.resolve",
|
|
402
|
+
action: "hrm.org.resolve",
|
|
403
|
+
summary: "\u6309\u300C\u591A\u7EF4\u540D\u79F0 + \u90E8\u95E8/\u5206\u90E8\u540D\u79F0\u300D\u89E3\u6790\u7EC4\u7EC7\uFF1A\u81EA\u52A8\u53D6\u5168\u91CF\u591A\u7EF4\u2192\u7CBE\u786E\u4F18\u5148/\u6A21\u7CCA\u515C\u5E95\u5339\u914D\u2192\u6309\u7EF4\u5EA6\u67E5\u7EC4\u7EC7\uFF1B\u6B67\u4E49\u65F6\u8FD4\u56DE\u5019\u9009\u5F85\u7528\u6237\u786E\u8BA4",
|
|
404
|
+
risk: READ,
|
|
405
|
+
inputSchema: schemaOf(
|
|
406
|
+
{
|
|
407
|
+
virtual: { type: "string", description: "\u591A\u7EF4\u540D\u79F0\uFF08\u5982\u300C\u884C\u653F\u7EC4\u7EC7\u300D\u300C1\u53F7\u7EF4\u5EA6\u300D\uFF09\uFF1B\u7CBE\u786E\u4F18\u5148\uFF0C\u672A\u547D\u4E2D\u6309\u5305\u542B\u6A21\u7CCA\u5339\u914D" },
|
|
408
|
+
name: { type: "string", description: "\u90E8\u95E8\u6216\u5206\u90E8\u540D\u79F0\uFF1B\u7CBE\u786E\u4F18\u5148\uFF0C\u672A\u547D\u4E2D\u6309\u5305\u542B\u6A21\u7CCA\u5339\u914D" },
|
|
409
|
+
type: { type: "string", enum: [...ORG_TYPES], description: `department \u90E8\u95E8 / subcompany \u5206\u90E8\uFF1B\u4E0D\u4F20\u65F6\u540C\u65F6\u68C0\u7D22\u4E24\u8005\u3001\u6309\u90E8\u95E8\u4F18\u5148\u5B9A\u4F4D\uFF0C\u5E76\u628A\u540C\u540D\u53E6\u4E00\u7C7B\u578B\u8282\u70B9\u56DE\u5728 alsoMatched` },
|
|
410
|
+
virtualId: { ...SCHEMA_ID, description: "\u591A\u7EF4 id\uFF1B\u7528\u6237\u786E\u8BA4\u540E\u590D\u8C03\u53EF\u76F4\u63A5\u4F20\uFF0C\u8DF3\u8FC7\u7EF4\u5EA6\u540D\u79F0\u5339\u914D" },
|
|
411
|
+
orgId: { ...SCHEMA_ID, description: "\u7EC4\u7EC7\u8282\u70B9 id\uFF1B\u7528\u6237\u786E\u8BA4\u540E\u590D\u8C03\u53EF\u76F4\u63A5\u4F20\uFF0C\u8DF3\u8FC7\u540D\u79F0\u5339\u914D" },
|
|
412
|
+
maxCandidates: { ...SCHEMA_ID, description: `\u6B67\u4E49\u65F6\u6700\u591A\u56DE\u4F20\u7684\u5019\u9009\u6761\u6570\uFF0C1~${MAX_CANDIDATES_LIMIT}\uFF0C\u9ED8\u8BA4 ${MAX_CANDIDATES}` }
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
description: "\u9996\u8C03\u5FC5\u586B virtual + name\uFF1B\u590D\u8C03\u53EF\u7528 virtualId / orgId \u76F4\u63A5\u5B9A\u4F4D\u3002\u7ED3\u679C\u4EE5 data.status \u5224\u5B9A\uFF08resolved / ambiguous / not_found\uFF09\u3002"
|
|
416
|
+
}
|
|
417
|
+
),
|
|
418
|
+
handler: async (args, { host }) => {
|
|
419
|
+
const typeArg = optionalText(args.type);
|
|
420
|
+
if (typeArg && !ORG_TYPES.includes(typeArg)) {
|
|
421
|
+
throw hrmValidationError("enum_invalid", `type \u53D6\u503C\u5FC5\u987B\u662F ${ORG_TYPES.join(" / ")} \u4E4B\u4E00`);
|
|
422
|
+
}
|
|
423
|
+
const nameArg = optionalText(args.name) ?? "";
|
|
424
|
+
const virtualArg = optionalText(args.virtual) ?? "";
|
|
425
|
+
const virtualIdArg = optionalId(args.virtualId, "virtualId");
|
|
426
|
+
const orgIdArg = optionalId(args.orgId, "orgId");
|
|
427
|
+
const candidateLimit = resolveCandidateLimit(args.maxCandidates);
|
|
428
|
+
const browsePageSize = Math.max(BROWSE_PAGE_SIZE, candidateLimit);
|
|
429
|
+
if (!virtualArg && !virtualIdArg) {
|
|
430
|
+
throw hrmValidationError("virtual_required", "\u5FC5\u987B\u63D0\u4F9B\u591A\u7EF4\u540D\u79F0 virtual\uFF0C\u6216\u7528\u6237\u5DF2\u786E\u8BA4\u7684\u591A\u7EF4 id virtualId");
|
|
431
|
+
}
|
|
432
|
+
if (!nameArg && !orgIdArg) {
|
|
433
|
+
throw hrmValidationError("name_required", "\u5FC5\u987B\u63D0\u4F9B\u90E8\u95E8/\u5206\u90E8\u540D\u79F0 name\uFF0C\u6216\u7528\u6237\u5DF2\u786E\u8BA4\u7684\u7EC4\u7EC7 id orgId");
|
|
434
|
+
}
|
|
435
|
+
const session = await host.getSession();
|
|
436
|
+
const baseUrl = session.baseUrl.replace(/\/+$/, "");
|
|
437
|
+
const dimensions = await fetchVirtuals(host, baseUrl);
|
|
438
|
+
let virtual;
|
|
439
|
+
if (virtualIdArg) {
|
|
440
|
+
const hit = dimensions.find((item) => item.id === virtualIdArg);
|
|
441
|
+
virtual = { id: virtualIdArg, name: hit?.name ?? "", keyword: virtualArg || virtualIdArg, matchType: "id" };
|
|
442
|
+
} else {
|
|
443
|
+
const outcome = matchByName(dimensions, virtualArg);
|
|
444
|
+
if (outcome.matchType === "none") {
|
|
445
|
+
const near = nearNameSuggestions(dimensions, virtualArg, SUGGESTION_LIMIT);
|
|
446
|
+
const nearText = near.length ? `\u8FD1\u4F3C\u540D\u79F0\uFF1A${near.map((item) => item.name).join("\u3001")}\u3002\u8BF7\u5148\u8BA9\u7528\u6237\u786E\u8BA4\u662F\u5426\u6307\u5176\u4E2D\u4E4B\u4E00\uFF0C**\u4E0D\u8981\u81EA\u884C\u66FF\u6362\u540D\u79F0\u91CD\u8BD5**\uFF1B\u786E\u8BA4\u540E\u628A\u5BF9\u5E94 id \u4F5C\u4E3A virtualId \u590D\u8C03\u3002` : "";
|
|
447
|
+
const listText = dimensions.length ? `\u5F53\u524D\u79DF\u6237\u53EF\u7528\u591A\u7EF4\uFF08${dimensions.length} \u4E2A\uFF09\uFF1A${dimensions.map((item) => item.name).join("\u3001")}\u3002` : "\u672A\u53D6\u5230\u591A\u7EF4\u6E05\u5355\u3002";
|
|
448
|
+
return hrmSuccess(
|
|
449
|
+
"hrm.org.resolve",
|
|
450
|
+
{
|
|
451
|
+
status: "not_found",
|
|
452
|
+
stage: "virtual",
|
|
453
|
+
matchType: "none",
|
|
454
|
+
virtual: null,
|
|
455
|
+
type: typeArg ?? null,
|
|
456
|
+
suggestions: near.map((item) => ({ id: item.id, name: item.name })),
|
|
457
|
+
suggestionTotal: near.length,
|
|
458
|
+
candidates: [],
|
|
459
|
+
candidateTotal: 0,
|
|
460
|
+
truncated: false,
|
|
461
|
+
availableVirtuals: dimensions,
|
|
462
|
+
message: `\u591A\u7EF4\u300C${virtualArg}\u300D\u4E0D\u5B58\u5728\u3002${nearText}${listText}`
|
|
463
|
+
},
|
|
464
|
+
{ virtualTotal: dimensions.length }
|
|
465
|
+
);
|
|
466
|
+
}
|
|
467
|
+
if (outcome.items.length > 1) {
|
|
468
|
+
const capped2 = capCandidates(outcome.items.map((item) => ({ id: item.id, name: item.name })), candidateLimit);
|
|
469
|
+
return hrmSuccess(
|
|
470
|
+
"hrm.org.resolve",
|
|
471
|
+
{
|
|
472
|
+
status: "ambiguous",
|
|
473
|
+
stage: "virtual",
|
|
474
|
+
matchType: outcome.matchType,
|
|
475
|
+
virtual: null,
|
|
476
|
+
type: typeArg ?? null,
|
|
477
|
+
candidates: capped2.items,
|
|
478
|
+
candidateTotal: outcome.items.length,
|
|
479
|
+
truncated: capped2.truncated,
|
|
480
|
+
message: `\u591A\u7EF4\u300C${virtualArg}\u300D${outcome.matchType === "exact" ? "\u7CBE\u786E" : "\u6A21\u7CCA"}\u5339\u914D\u5230 ${outcome.items.length} \u4E2A\u7EF4\u5EA6\uFF0C\u8BF7\u8BA9\u7528\u6237\u786E\u8BA4\u4F7F\u7528\u54EA\u4E00\u4E2A\uFF0C\u7136\u540E\u7528\u8FD4\u56DE\u7684 id \u4F5C\u4E3A virtualId \u91CD\u65B0\u8C03\u7528\u672C\u64CD\u4F5C\u3002`
|
|
481
|
+
},
|
|
482
|
+
{ virtualTotal: dimensions.length }
|
|
483
|
+
);
|
|
484
|
+
}
|
|
485
|
+
virtual = {
|
|
486
|
+
id: outcome.items[0].id,
|
|
487
|
+
name: outcome.items[0].name,
|
|
488
|
+
keyword: virtualArg,
|
|
489
|
+
matchType: outcome.matchType
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
if (orgIdArg) {
|
|
493
|
+
const org = await fetchOrgById(host, baseUrl, orgIdArg);
|
|
494
|
+
return hrmSuccess(
|
|
495
|
+
"hrm.org.resolve",
|
|
496
|
+
{
|
|
497
|
+
status: "resolved",
|
|
498
|
+
stage: "org",
|
|
499
|
+
matchType: "id",
|
|
500
|
+
virtual,
|
|
501
|
+
type: org.type ?? typeArg ?? null,
|
|
502
|
+
org,
|
|
503
|
+
candidates: [],
|
|
504
|
+
candidateTotal: 0,
|
|
505
|
+
truncated: false,
|
|
506
|
+
message: `\u5DF2\u6309\u7EC4\u7EC7 id \u8BFB\u53D6${typeLabel(org.type ?? null)}\u300C${org.name || orgIdArg}\u300D\uFF08\u591A\u7EF4\uFF1A${virtual.name || virtual.id}\uFF09\u3002`
|
|
507
|
+
},
|
|
508
|
+
{ searchedTypes: [] }
|
|
509
|
+
);
|
|
510
|
+
}
|
|
511
|
+
const searchedTypes = typeArg ? [typeArg] : ["department", "subcompany"];
|
|
512
|
+
const queried = [];
|
|
513
|
+
const exactHits = [];
|
|
514
|
+
for (const type of searchedTypes) {
|
|
515
|
+
const result = await browseOrg(host, baseUrl, { type, virtualId: virtual.id, name: nameArg, exact: true, pageSize: browsePageSize });
|
|
516
|
+
queried.push(type);
|
|
517
|
+
if (result.rows.length > 0) exactHits.push({ type, rows: result.rows });
|
|
518
|
+
}
|
|
519
|
+
const uniqueHit = exactHits.find((hit) => hit.rows.length === 1);
|
|
520
|
+
if (uniqueHit) {
|
|
521
|
+
const org = formatOrg(uniqueHit.rows[0], baseUrl, virtual.name);
|
|
522
|
+
const alsoMatched = capCandidates(
|
|
523
|
+
exactHits.filter((hit) => hit !== uniqueHit).flatMap((hit) => hit.rows).map((row) => formatCandidate(row, baseUrl)),
|
|
524
|
+
candidateLimit
|
|
525
|
+
);
|
|
526
|
+
const alsoNote = alsoMatched.items.length ? `\u26A0\uFE0F \u53E6\u6709\u540C\u540D\u8282\u70B9 ${alsoMatched.items.length} \u4E2A\uFF08${alsoMatched.items.map((item) => typeLabel(String(item.type ?? ""))).join("\u3001")}\uFF09\uFF0C\u89C1 alsoMatched\uFF1B\u5982\u9700\u6539\u7528\u5B83\u4EEC\uFF0C\u6309 type \u6216 orgId \u590D\u8C03\u3002` : "";
|
|
527
|
+
return hrmSuccess(
|
|
528
|
+
"hrm.org.resolve",
|
|
529
|
+
{
|
|
530
|
+
status: "resolved",
|
|
531
|
+
stage: "org",
|
|
532
|
+
matchType: "exact",
|
|
533
|
+
virtual,
|
|
534
|
+
type: uniqueHit.type,
|
|
535
|
+
org,
|
|
536
|
+
...alsoMatched.items.length ? { alsoMatched: alsoMatched.items, alsoMatchedTruncated: alsoMatched.truncated } : {},
|
|
537
|
+
candidates: [],
|
|
538
|
+
candidateTotal: 1,
|
|
539
|
+
truncated: false,
|
|
540
|
+
message: `\u7CBE\u786E\u547D\u4E2D${typeLabel(uniqueHit.type)}\u300C${org.name}\u300D\uFF08\u591A\u7EF4\uFF1A${virtual.name}\uFF09\u3002${alsoNote}`
|
|
541
|
+
},
|
|
542
|
+
{ searchedTypes: queried }
|
|
543
|
+
);
|
|
544
|
+
}
|
|
545
|
+
if (exactHits.length > 0) {
|
|
546
|
+
const pool2 = exactHits.flatMap((hit) => hit.rows);
|
|
547
|
+
const capped2 = capCandidates(pool2.map((row) => formatCandidate(row, baseUrl)), candidateLimit);
|
|
548
|
+
return hrmSuccess(
|
|
549
|
+
"hrm.org.resolve",
|
|
550
|
+
{
|
|
551
|
+
status: "ambiguous",
|
|
552
|
+
stage: "org",
|
|
553
|
+
matchType: "exact",
|
|
554
|
+
virtual,
|
|
555
|
+
type: exactHits.length === 1 ? exactHits[0].type : typeArg ?? null,
|
|
556
|
+
candidates: capped2.items,
|
|
557
|
+
candidateTotal: pool2.length,
|
|
558
|
+
truncated: capped2.truncated,
|
|
559
|
+
message: `\u540D\u79F0\u300C${nameArg}\u300D\u5728\u591A\u7EF4\u300C${virtual.name}\u300D\u4E0B\u7CBE\u786E\u5339\u914D\u5230 ${pool2.length} \u4E2A\u8282\u70B9\uFF08\u540C\u540D\u4E0D\u540C\u5C42\u7EA7\uFF09\uFF0C\u8BF7\u8BA9\u7528\u6237\u786E\u8BA4\u4F7F\u7528\u54EA\u4E00\u4E2A\uFF0C\u7136\u540E\u7528\u8FD4\u56DE\u7684 id \u4F5C\u4E3A orgId \u91CD\u65B0\u8C03\u7528\u672C\u64CD\u4F5C\u3002`
|
|
560
|
+
},
|
|
561
|
+
{ searchedTypes: queried }
|
|
562
|
+
);
|
|
563
|
+
}
|
|
564
|
+
const fuzzyRows = [];
|
|
565
|
+
let fuzzyServerTotal = 0;
|
|
566
|
+
for (const type of searchedTypes) {
|
|
567
|
+
const result = await browseOrg(host, baseUrl, { type, virtualId: virtual.id, name: nameArg, exact: false, pageSize: browsePageSize });
|
|
568
|
+
if (result.rows.length > 0) fuzzyRows.push(...result.rows);
|
|
569
|
+
fuzzyServerTotal += result.total;
|
|
570
|
+
}
|
|
571
|
+
const exactLike = fuzzyRows.filter((row) => normalizeName(row.name).toLowerCase() === nameArg.toLowerCase());
|
|
572
|
+
const pool = exactLike.length > 0 ? exactLike : fuzzyRows;
|
|
573
|
+
if (pool.length === 0) {
|
|
574
|
+
const probe = await probeNearOrgNames(host, baseUrl, {
|
|
575
|
+
type: searchedTypes[0],
|
|
576
|
+
virtualId: virtual.id,
|
|
577
|
+
keyword: nameArg,
|
|
578
|
+
pageSize: browsePageSize
|
|
579
|
+
});
|
|
580
|
+
const suggestions = capCandidates(probe.rows.map((row) => formatCandidate(row, baseUrl)), SUGGESTION_LIMIT);
|
|
581
|
+
const nearText = suggestions.items.length ? `\u8FD1\u4F3C\u540D\u79F0\uFF08\u542B\u76F8\u4F3C\u5173\u952E\u5B57\u300C${probe.key}\u300D\uFF0C\u5171 ${probe.total} \u4E2A\uFF0C\u672C\u6B21\u5217 ${suggestions.items.length} \u4E2A\uFF0C\u89C1 suggestions\uFF09\uFF1A${suggestions.items.map((item) => item.name).join("\u3001")}\u3002\u8BF7\u8BA9\u7528\u6237\u786E\u8BA4\u540D\u79F0\uFF0C**\u4E0D\u8981\u81EA\u884C\u66FF\u6362\u540D\u79F0\u91CD\u8BD5**\u3002` : "";
|
|
582
|
+
return hrmSuccess(
|
|
583
|
+
"hrm.org.resolve",
|
|
584
|
+
{
|
|
585
|
+
status: "not_found",
|
|
586
|
+
stage: "org",
|
|
587
|
+
matchType: "none",
|
|
588
|
+
virtual,
|
|
589
|
+
type: typeArg ?? null,
|
|
590
|
+
suggestions: suggestions.items,
|
|
591
|
+
suggestionTotal: probe.rows.length ? probe.total : 0,
|
|
592
|
+
candidates: [],
|
|
593
|
+
candidateTotal: 0,
|
|
594
|
+
truncated: false,
|
|
595
|
+
message: `\u591A\u7EF4\u300C${virtual.name}\u300D\u4E0B\u672A\u627E\u5230\u540D\u79F0\u5305\u542B\u300C${nameArg}\u300D\u7684${typeLabel(typeArg ? typeArg : null)}${typeArg ? "" : "\uFF08\u5DF2\u540C\u65F6\u68C0\u7D22\u90E8\u95E8\u4E0E\u5206\u90E8\uFF09"}\u3002${nearText}\u5982\u786E\u65E0\u540D\u79F0\u53EF\u5339\u914D\uFF0C\u8BF7\u8BA9\u7528\u6237\u8865\u5145\u66F4\u591A\u5173\u952E\u5B57\u3002`
|
|
596
|
+
},
|
|
597
|
+
{ searchedTypes }
|
|
598
|
+
);
|
|
599
|
+
}
|
|
600
|
+
const effectiveMatch = exactLike.length > 0 ? "exact" : "fuzzy";
|
|
601
|
+
if (pool.length === 1) {
|
|
602
|
+
const org = formatOrg(pool[0], baseUrl, virtual.name);
|
|
603
|
+
return hrmSuccess(
|
|
604
|
+
"hrm.org.resolve",
|
|
605
|
+
{
|
|
606
|
+
status: "resolved",
|
|
607
|
+
stage: "org",
|
|
608
|
+
matchType: effectiveMatch,
|
|
609
|
+
virtual,
|
|
610
|
+
type: String(pool[0].type ?? ""),
|
|
611
|
+
org,
|
|
612
|
+
candidates: [],
|
|
613
|
+
candidateTotal: 1,
|
|
614
|
+
truncated: false,
|
|
615
|
+
message: `${effectiveMatch === "exact" ? "\u7CBE\u786E" : "\u6A21\u7CCA"}\u547D\u4E2D\u552F\u4E00${typeLabel(String(pool[0].type ?? ""))}\u300C${org.name}\u300D\uFF08\u591A\u7EF4\uFF1A${virtual.name}\uFF09\u3002${effectiveMatch === "fuzzy" ? "\u547D\u4E2D\u65B9\u5F0F\u4E3A\u6A21\u7CCA\u5305\u542B\u5339\u914D\uFF0C\u5982\u4E0E\u9884\u671F\u4E0D\u7B26\u8BF7\u8BA9\u7528\u6237\u6838\u5BF9\u540D\u79F0\u3002" : ""}`
|
|
616
|
+
},
|
|
617
|
+
{ searchedTypes }
|
|
618
|
+
);
|
|
619
|
+
}
|
|
620
|
+
const capped = capCandidates(pool.map((row) => formatCandidate(row, baseUrl)), candidateLimit);
|
|
621
|
+
const candidateTotal = effectiveMatch === "exact" ? pool.length : Math.max(fuzzyServerTotal, pool.length);
|
|
622
|
+
const truncated = capped.items.length < candidateTotal;
|
|
623
|
+
return hrmSuccess(
|
|
624
|
+
"hrm.org.resolve",
|
|
625
|
+
{
|
|
626
|
+
status: "ambiguous",
|
|
627
|
+
stage: "org",
|
|
628
|
+
matchType: effectiveMatch,
|
|
629
|
+
virtual,
|
|
630
|
+
type: typeArg ?? null,
|
|
631
|
+
candidates: capped.items,
|
|
632
|
+
candidateTotal,
|
|
633
|
+
truncated,
|
|
634
|
+
message: `\u540D\u79F0\u300C${nameArg}\u300D\u5728\u591A\u7EF4\u300C${virtual.name}\u300D\u4E0B${effectiveMatch === "exact" ? "\u7CBE\u786E" : "\u6A21\u7CCA"}\u5339\u914D\u5230 ${candidateTotal} \u4E2A${typeLabel(typeArg ? typeArg : null)}${truncated ? `\uFF0C\u672C\u6B21\u4EC5\u5217\u51FA\u524D ${capped.items.length} \u4E2A` : ""}\u3002\u8BF7\u8BA9\u7528\u6237\u6309 fullPath \u786E\u8BA4\u5C42\u7EA7\uFF0C\u786E\u8BA4\u540E\u7528\u8FD4\u56DE\u7684 id \u4F5C\u4E3A orgId \u91CD\u65B0\u8C03\u7528\u672C\u64CD\u4F5C\u3002`
|
|
635
|
+
},
|
|
636
|
+
{ searchedTypes }
|
|
637
|
+
);
|
|
638
|
+
}
|
|
639
|
+
};
|
|
640
|
+
var hrmResolveOperations = [
|
|
641
|
+
orgResolve
|
|
642
|
+
];
|
|
643
|
+
|
|
644
|
+
// src/shortcuts/hrm/operations/registry.ts
|
|
645
|
+
function buildRegistry() {
|
|
646
|
+
const registry = /* @__PURE__ */ new Map();
|
|
647
|
+
const definitions = [
|
|
648
|
+
...hrmEmployeeOperations,
|
|
649
|
+
...hrmOrgOperations,
|
|
650
|
+
...hrmResolveOperations,
|
|
651
|
+
...hrmPositionOperations
|
|
652
|
+
];
|
|
653
|
+
for (const definition of definitions) {
|
|
654
|
+
if (registry.has(definition.name)) {
|
|
655
|
+
throw new Error(`duplicate hrm operation: ${definition.name}`);
|
|
656
|
+
}
|
|
657
|
+
registry.set(definition.name, definition);
|
|
658
|
+
}
|
|
659
|
+
return registry;
|
|
660
|
+
}
|
|
661
|
+
var hrmOperationRegistry = buildRegistry();
|
|
662
|
+
function hrmOperationDefinitions() {
|
|
663
|
+
return [...hrmOperationRegistry.values()];
|
|
664
|
+
}
|
|
665
|
+
function getHrmOperation(operation) {
|
|
666
|
+
const definition = hrmOperationRegistry.get(operation);
|
|
667
|
+
if (!definition) {
|
|
668
|
+
throw hrmValidationError("operation_unknown", `\u7EC4\u7EC7\u7BA1\u7406\u4E0D\u652F\u6301\u64CD\u4F5C\uFF1A${operation}`);
|
|
669
|
+
}
|
|
670
|
+
return definition;
|
|
671
|
+
}
|
|
672
|
+
function hasHrmOperation(operation) {
|
|
673
|
+
return hrmOperationRegistry.has(operation);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
export {
|
|
677
|
+
hrmOperationDefinitions,
|
|
678
|
+
getHrmOperation,
|
|
679
|
+
hasHrmOperation
|
|
680
|
+
};
|