weaver-work-cli 0.1.62 → 0.1.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. package/dist/chunks/{archive-S2VKZWQ3.js → archive-BLDYBZDX.js} +5 -4
  2. package/dist/chunks/{archive-oa-HEDSIUUY.js → archive-oa-3GJ3TWXR.js} +5 -4
  3. package/dist/chunks/{asset-HYH4W357.js → asset-AFXJN4CK.js} +5 -4
  4. package/dist/chunks/{asset-idle-N7REBNGL.js → asset-idle-VUJXWGWJ.js} +5 -4
  5. package/dist/chunks/{attachment-content-VYYA75FR.js → attachment-content-VMJA7NSQ.js} +3 -3
  6. package/dist/chunks/{blog-SLMZZICV.js → blog-EREB35VU.js} +5 -4
  7. package/dist/chunks/{caizhilian-RV43KKBT.js → caizhilian-ATM2JO5S.js} +5 -5
  8. package/dist/chunks/{calendar-DMVZ4OLY.js → calendar-E26ZIH7S.js} +5 -4
  9. package/dist/chunks/{chunk-6XSSAUNW.js → chunk-4OB22YKE.js} +48 -12
  10. package/dist/chunks/{chunk-UBGWIXU3.js → chunk-5CY37VLS.js} +131 -38
  11. package/dist/chunks/{chunk-EGANE35F.js → chunk-6G2JARDK.js} +1 -1
  12. package/dist/chunks/{chunk-WIWDVETN.js → chunk-6VCQLZXE.js} +75 -76
  13. package/dist/chunks/{chunk-E5YD5JWR.js → chunk-BY3WDJO5.js} +1 -1
  14. package/dist/chunks/{chunk-IW7A2IQY.js → chunk-C4YQJFZV.js} +43 -15
  15. package/dist/chunks/{chunk-BQYX2UX5.js → chunk-C5PIGPGX.js} +5 -3
  16. package/dist/chunks/{chunk-UBRWONP4.js → chunk-EOZHSNND.js} +2 -2
  17. package/dist/chunks/{chunk-UQFPF4EX.js → chunk-G3ZM57PD.js} +2 -2
  18. package/dist/chunks/{chunk-XT77MP54.js → chunk-GOBNIGWS.js} +410 -24
  19. package/dist/chunks/{chunk-KY3R42RS.js → chunk-GQK6WLOS.js} +5 -3
  20. package/dist/chunks/{chunk-BIA2NKUG.js → chunk-HEJPVXD3.js} +5 -5
  21. package/dist/chunks/{chunk-ILALC2N6.js → chunk-I4C2KR2G.js} +1 -1
  22. package/dist/chunks/{chunk-YI2YMW5N.js → chunk-IGICM3WJ.js} +2 -2
  23. package/dist/chunks/chunk-IN6NXQ26.js +680 -0
  24. package/dist/chunks/{chunk-VBFBMM7G.js → chunk-LOVAIGM2.js} +387 -70
  25. package/dist/chunks/{chunk-H6YOMI3U.js → chunk-OMAGCLUE.js} +5 -3
  26. package/dist/chunks/{chunk-VNYOUAWV.js → chunk-QAMIIFP6.js} +11 -11
  27. package/dist/chunks/{chunk-QBDXJS2W.js → chunk-QZYKZ7MQ.js} +16 -8
  28. package/dist/chunks/{chunk-V2LASYKO.js → chunk-RR45ELVE.js} +30 -24
  29. package/dist/chunks/{chunk-NRYDJN4J.js → chunk-RV2JAA5I.js} +89 -8
  30. package/dist/chunks/{chunk-TEZHIB6T.js → chunk-SDPC7BG2.js} +5 -3
  31. package/dist/chunks/{chunk-T2KVJFWJ.js → chunk-SHBDXEUE.js} +4 -7
  32. package/dist/chunks/{chunk-P6TXQK75.js → chunk-THMBDCRA.js} +5 -3
  33. package/dist/chunks/chunk-TJN4PIYO.js +47 -0
  34. package/dist/chunks/{chunk-DTCQFTHW.js → chunk-TNFIUZ4H.js} +3 -3
  35. package/dist/chunks/{chunk-JFAWZX53.js → chunk-UPVAQJKS.js} +282 -131
  36. package/dist/chunks/{chunk-KXJA42EA.js → chunk-WPBZQVLS.js} +1 -1
  37. package/dist/chunks/{conflict-GFJRS6I7.js → conflict-AMNTM3FV.js} +2 -2
  38. package/dist/chunks/{contract-U3ZGNRWB.js → contract-PLO2V2NO.js} +2333 -4426
  39. package/dist/chunks/{cowork-EX7PKIDK.js → cowork-FZAXE6FO.js} +5 -4
  40. package/dist/chunks/{create-flow-EJZD434E.js → create-flow-2DAUN7HU.js} +16 -6
  41. package/dist/chunks/{data-FOODGAMF.js → data-7NXMWET4.js} +3 -3
  42. package/dist/chunks/{ebuilder-form-I2EOKODG.js → ebuilder-form-DEYHX6M7.js} +4 -4
  43. package/dist/chunks/{ehr-TE4RFNID.js → ehr-QQH2DYYA.js} +244 -151
  44. package/dist/chunks/{employee-DR5Y64TI.js → employee-PGMY6NI6.js} +1 -1
  45. package/dist/chunks/{entry-mode-ZOLSXEGX.js → entry-mode-2JTVEKMP.js} +3 -3
  46. package/dist/chunks/{env-TID5NFR6.js → env-2JZMXC6I.js} +2 -2
  47. package/dist/chunks/{esb-7L6MHYLB.js → esb-I5ZFHJUK.js} +8 -8
  48. package/dist/chunks/{factory-OG7BPMH5.js → factory-XIATYHU6.js} +1 -1
  49. package/dist/chunks/{fna-6V2ENR3Y.js → fna-3V2TL6B2.js} +5 -4
  50. package/dist/chunks/{group-chat-5DKPWIHL.js → group-chat-CVYUZCOQ.js} +3 -3
  51. package/dist/chunks/{host-TJ5VVHM7.js → host-4DP7C7YQ.js} +4 -4
  52. package/dist/chunks/{host-3DLYA54R.js → host-4KQCAEWA.js} +4 -4
  53. package/dist/chunks/{host-ONZC6AE7.js → host-4X2F3JPQ.js} +4 -4
  54. package/dist/chunks/{host-OGBHL75G.js → host-BD7NAM33.js} +4 -4
  55. package/dist/chunks/{host-VTPAWDZV.js → host-CBONEAZS.js} +4 -4
  56. package/dist/chunks/{host-GOJHHTPY.js → host-L37QVNIV.js} +4 -4
  57. package/dist/chunks/{hrm-2N7NFQDZ.js → hrm-OL3IKN7C.js} +6 -6
  58. package/dist/chunks/{im-XCH47ZBN.js → im-YXQWUF3R.js} +4 -4
  59. package/dist/chunks/{invoice-5KJ7T774.js → invoice-4WY32PR2.js} +4 -4
  60. package/dist/chunks/{jiuchuanhui-PL6DRPBM.js → jiuchuanhui-L6SHLONH.js} +5 -4
  61. package/dist/chunks/{lazy-dispatch-UATEN7H7.js → lazy-dispatch-OYE6QV24.js} +5 -5
  62. package/dist/chunks/{mail-Q7Z4CQ4D.js → mail-PZV2KNRU.js} +5 -4
  63. package/dist/chunks/{meeting-5E3BNARL.js → meeting-6SOBCC6N.js} +16 -15
  64. package/dist/chunks/{minute-doc-NXRE5C77.js → minute-doc-KSJSJNOH.js} +4 -4
  65. package/dist/chunks/{okr-3O3XNYOK.js → okr-B76FW5M2.js} +5 -4
  66. package/dist/chunks/{operations-EZWG72FH.js → operations-YOMEGFLV.js} +5 -5
  67. package/dist/chunks/{performance-Y7CPNSOR.js → performance-4VBKUPFO.js} +5 -4
  68. package/dist/chunks/{plan-BLGPZF5M.js → plan-HBNZRQTI.js} +5 -4
  69. package/dist/chunks/{project-6MZMLJMP.js → project-IV6FWK74.js} +5 -4
  70. package/dist/chunks/{reception-F2VT2X52.js → reception-BR5YURT6.js} +3 -3
  71. package/dist/chunks/{recruit-stage-4ETIBMIW.js → recruit-stage-4HQ6OGXT.js} +654 -336
  72. package/dist/chunks/{registry-I4DVPDMU.js → registry-7LICMV5J.js} +12 -12
  73. package/dist/chunks/{registry-3FYSWV3U.js → registry-JFQEFC7E.js} +3 -3
  74. package/dist/chunks/{registry-3UGIWH53.js → registry-JMNOXRST.js} +2 -2
  75. package/dist/chunks/{registry-7RS74TCK.js → registry-MZJQX65Q.js} +5 -5
  76. package/dist/chunks/{room-recommend-GWCVKCXW.js → room-recommend-43GLLE7Y.js} +4 -4
  77. package/dist/chunks/{schedule-6AN63MJQ.js → schedule-ZQ42BEW6.js} +4 -4
  78. package/dist/chunks/{smart-extract-SR4SJJKN.js → smart-extract-QKAEAZGM.js} +3 -3
  79. package/dist/chunks/{workflow-KF7FA2UQ.js → workflow-6HV7H5PC.js} +10 -7
  80. package/dist/index.js +34 -34
  81. package/dist/internal/e10/auth/commands.js +21 -1
  82. package/dist/internal/e10/auth/xiaoe.js +6 -2
  83. package/dist/internal/e10/auth-recovery.js +28 -2
  84. package/dist/internal/e10/request-runtime.js +15 -3
  85. package/dist/internal/e10/request-trace.js +65 -0
  86. package/dist/shortcuts/contract/data/metric-catalog.js +149 -0
  87. package/dist/shortcuts/contract/index.js +14 -39
  88. package/dist/shortcuts/contract/manifest.js +115 -270
  89. package/dist/shortcuts/contract/operations/compare-report.js +437 -0
  90. package/dist/shortcuts/contract/operations/compare.js +2 -0
  91. package/dist/shortcuts/contract/operations/first-screen.js +96 -207
  92. package/dist/shortcuts/contract/operations/flow.js +19 -1
  93. package/dist/shortcuts/contract/operations/{card-ebdf-list.js → ledger-card.js} +98 -25
  94. package/dist/shortcuts/contract/operations/ledger.js +315 -1
  95. package/dist/shortcuts/contract/operations/metrics.js +93 -0
  96. package/dist/shortcuts/contract/operations/modeltext.js +3 -3
  97. package/dist/shortcuts/contract/operations/page.js +8 -4
  98. package/dist/shortcuts/contract/operations/performance.js +53 -0
  99. package/dist/shortcuts/contract/operations/quote-recognize.js +289 -0
  100. package/dist/shortcuts/contract/operations/quote-submit.js +264 -0
  101. package/dist/shortcuts/contract/operations/recommend.js +42 -1
  102. package/dist/shortcuts/contract/operations/registry.js +16 -23
  103. package/dist/shortcuts/contract/operations/{card-risk-report.js → review-report.js} +24 -114
  104. package/dist/shortcuts/contract/operations/review.js +33 -167
  105. package/dist/shortcuts/contract/operations/save-recognize.js +173 -43
  106. package/dist/shortcuts/contract/operations/triage.js +13 -6
  107. package/dist/shortcuts/contract/operations/{template.js → type-clause-read.js} +10 -25
  108. package/dist/shortcuts/contract/operations/upload.js +17 -11
  109. package/dist/shortcuts/contract/prewarm-cache.js +6 -2
  110. package/dist/shortcuts/contract/prewarm.js +33 -23
  111. package/dist/shortcuts/contract/recommend-cache.js +191 -0
  112. package/dist/shortcuts/ehr/operations/recruit-interview-overview.js +85 -62
  113. package/dist/shortcuts/ehr/operations/recruit-position.js +21 -13
  114. package/dist/shortcuts/ehr/operations/recruit-short-cache.js +59 -0
  115. package/dist/shortcuts/ehr/operations/recruit-tag.js +17 -11
  116. package/dist/shortcuts/ehr/operations/recruit-write.js +118 -70
  117. package/dist/shortcuts/ehr/operations/recruit.js +338 -121
  118. package/dist/shortcuts/hrm/operations/employee.js +64 -17
  119. package/dist/shortcuts/hrm/operations/resolve.js +419 -369
  120. package/dist/shortcuts/im/host.js +38 -22
  121. package/dist/shortcuts/meeting/operations/eb/conflict.js +60 -2
  122. package/dist/shortcuts/meeting/operations/eb/create-flow.js +116 -7
  123. package/dist/shortcuts/meeting/operations/eb/create-form-link.js +380 -0
  124. package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
  125. package/dist/shortcuts/meeting/operations/eb/room-recommend.js +1 -3
  126. package/dist/shortcuts/recruit-stage/batch-store.js +44 -0
  127. package/dist/shortcuts/recruit-stage/context.js +75 -9
  128. package/dist/shortcuts/recruit-stage/manifest.js +1 -1
  129. package/dist/shortcuts/recruit-stage/operations/jd-create.js +33 -22
  130. package/dist/shortcuts/recruit-stage/operations/list.js +187 -37
  131. package/dist/shortcuts/recruit-stage/operations/registry.js +2 -0
  132. package/dist/shortcuts/recruit-stage/operations/resume-import.js +231 -313
  133. package/dist/shortcuts/recruit-stage/operations/search.js +5 -5
  134. package/dist/shortcuts/recruit-stage/operations/tag.js +286 -0
  135. package/dist/shortcuts/workflow/endpoints.js +2 -0
  136. package/dist/shortcuts/workflow/operations/form.js +12 -15
  137. package/dist/shortcuts/workflow/operations/read.js +8 -8
  138. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoListRows.js +3 -2
  139. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +7 -6
  140. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +4 -3
  141. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +1 -0
  142. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +33 -6
  143. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.prepareQuery.js +153 -0
  144. package/dist/shortcuts/workflow/operations/todoSmartConvert/workflowClarification.js +232 -0
  145. package/dist/shortcuts/workflow/operations.js +5 -0
  146. package/docs/contract.md +2 -2
  147. package/docs/e10-auth.md +28 -0
  148. package/docs/ehr.md +1 -1
  149. package/package.json +1 -1
  150. package/skills/weaver-e10-hrm/SKILL.md +3 -3
  151. package/skills/weaver-e10-hrm/references/employee.md +13 -2
  152. package/skills/weaver-e10-jinchengda/SKILL.md +237 -347
  153. package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +7 -14
  154. package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +21 -12
  155. package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +109 -185
  156. package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +12 -4
  157. package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +28 -20
  158. package/skills/weaver-e10-jinchengda/references/contract-clause-recommender.md +12 -17
  159. package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +7 -13
  160. package/skills/weaver-e10-jinchengda/references/contract-command-index.md +21 -12
  161. package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +10 -18
  162. package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +18 -17
  163. package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +114 -61
  164. package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +8 -2
  165. package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +73 -104
  166. package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +32 -37
  167. package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +12 -10
  168. package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +70 -82
  169. package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +37 -33
  170. package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +94 -27
  171. package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +5 -5
  172. package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +9 -15
  173. package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +9 -4
  174. package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +59 -32
  175. package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +7 -5
  176. package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +21 -13
  177. package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +13 -13
  178. package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +6 -5
  179. package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +250 -0
  180. package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +11 -20
  181. package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +203 -54
  182. package/skills/weaver-e10-jinchengda/references/contract-request-status.md +4 -11
  183. package/skills/weaver-e10-jinchengda/references/contract-request-write.md +11 -17
  184. package/skills/weaver-e10-jinchengda/references/contract-signing-subjects.md +11 -17
  185. package/skills/weaver-e10-jinchengda/references/contract-subject-create.md +5 -11
  186. package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +56 -7
  187. package/skills/weaver-e10-jinchengda/references/contract-workflow-discovery.md +10 -16
  188. package/skills/weaver-e10-jinchengda/references/orchestration.md +31 -33
  189. package/skills/weaver-e10-jucailin/SKILL.md +6 -7
  190. package/skills/weaver-e10-jucailin/agents/openai.yaml +52 -0
  191. package/skills/weaver-e10-jucailin/references/recruit-interview-overview.md +8 -6
  192. package/skills/weaver-e10-jucailin/references/recruit-read.md +4 -0
  193. package/skills/weaver-e10-jucailin/references/recruit-screening-to-interview-sop.md +2 -2
  194. package/skills/weaver-e10-jucailin/references/recruit-write.md +4 -4
  195. package/skills/weaver-e10-meeting/SKILL.md +83 -531
  196. package/skills/weaver-e10-meeting/references/commands-table.md +61 -0
  197. package/skills/weaver-e10-meeting/references/create-commands.md +136 -0
  198. package/skills/weaver-e10-meeting/references/create-flow.md +3 -1
  199. package/skills/weaver-e10-meeting/references/create-guardrails.md +14 -8
  200. package/skills/weaver-e10-meeting/references/custom-fields.md +40 -0
  201. package/skills/weaver-e10-meeting/references/eb-contracts.md +60 -0
  202. package/skills/weaver-e10-meeting/references/invitation.md +69 -0
  203. package/skills/weaver-e10-meeting/references/minutes-pipeline.md +119 -0
  204. package/skills/weaver-e10-meeting/references/pitfalls.md +1 -1
  205. package/skills/weaver-e10-meeting/references/room-recommend.md +88 -0
  206. package/skills/weaver-e10-recruit-stage/SKILL.md +317 -266
  207. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +22 -27
  208. package/skills/weaver-e10-recruit-stage/references/env-ziyong.md +1 -1
  209. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +30 -27
  210. package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +2 -6
  211. package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +12 -10
  212. package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +2 -0
  213. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +23 -19
  214. package/skills/weaver-e10-recruit-stage/references/recruit-jd-template.md +3 -1
  215. package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +18 -16
  216. package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +25 -23
  217. package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +10 -10
  218. package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +2 -2
  219. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +11 -11
  220. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +150 -85
  221. package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +14 -18
  222. package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +1 -1
  223. package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +173 -0
  224. package/skills/weaver-e10-recruit-stage/references/recruit-tag-taxonomy.json +76 -0
  225. package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +3 -1
  226. package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +2 -2
  227. package/skills/weaver-e10-workflow/SKILL.md +49 -32
  228. package/skills/weaver-e10-workflow/references/todo-dialogue.md +67 -34
  229. package/skills/weaver-e10-workflow/references/todo-smart-convert.md +65 -51
  230. package/skills/weaver-e10-workflow/references/workflow-agent-entry.md +18 -11
  231. package/skills/weaver-e10-workflow/references/workflow-create.md +2 -2
  232. package/skills/weaver-e10-workflow/references/workflow-memory.md +19 -37
  233. package/skills/weaver-e10-workflow/references/workflow-query.md +25 -22
  234. package/skills/weaver-e10-workflow/references/workflow-view.md +1 -1
  235. package/skills/weaver-e10-workflow/tools/todo-summary.cjs +318 -110
  236. package/skills/weaver-e10-yimiaoban/SKILL.md +10 -10
  237. package/skills/weaver-e10-yimiaoban/references/person.md +1 -1
  238. package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +1 -1
  239. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +9 -9
  240. package/dist/chunks/chunk-6QYNE6HE.js +0 -658
  241. package/dist/chunks/chunk-SHYQUBY3.js +0 -48
  242. package/dist/shortcuts/contract/operations/card-action.js +0 -1266
  243. package/dist/shortcuts/contract/operations/card-plan.js +0 -393
  244. package/dist/shortcuts/contract/operations/card.js +0 -232
  245. package/dist/shortcuts/contract/operations/compare-screen.js +0 -378
  246. package/dist/shortcuts/contract/operations/quote-to-contract.js +0 -495
  247. package/dist/shortcuts/contract/operations/quotescreen.js +0 -529
  248. package/dist/shortcuts/contract/operations/summary-validate.js +0 -293
  249. package/dist/shortcuts/contract/operations/summary.js +0 -187
  250. package/dist/shortcuts/ehr/recruit-stage/batch-store.js +0 -78
  251. package/dist/shortcuts/ehr/recruit-stage/context.js +0 -231
  252. package/dist/shortcuts/ehr/recruit-stage/continuation.js +0 -74
  253. package/dist/shortcuts/ehr/recruit-stage/errors.js +0 -65
  254. package/dist/shortcuts/ehr/recruit-stage/fs-scan.js +0 -165
  255. package/dist/shortcuts/ehr/recruit-stage/host.js +0 -109
  256. package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +0 -1065
  257. package/dist/shortcuts/ehr/recruit-stage/operations/interview-feedback.js +0 -295
  258. package/dist/shortcuts/ehr/recruit-stage/operations/jd-create.js +0 -961
  259. package/dist/shortcuts/ehr/recruit-stage/operations/list.js +0 -431
  260. package/dist/shortcuts/ehr/recruit-stage/operations/registry.js +0 -50
  261. package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +0 -1655
  262. package/dist/shortcuts/ehr/recruit-stage/operations/search.js +0 -158
  263. package/dist/shortcuts/ehr/recruit-stage/operations/types.js +0 -34
  264. package/dist/shortcuts/ehr/recruit-stage/runtime.js +0 -31
  265. package/dist/shortcuts/ehr/recruit-stage/school-tiers.json +0 -318
  266. package/dist/shortcuts/ehr/recruit-stage/shared.js +0 -887
  267. package/skills/weaver-e10-jinchengda/references/contract-action-card-template.html +0 -22
  268. package/skills/weaver-e10-jinchengda/references/contract-action-card.md +0 -554
  269. package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +0 -279
  270. package/skills/weaver-e10-jinchengda/references/contract-card-render-internals.md +0 -483
  271. package/skills/weaver-e10-jinchengda/references/contract-template-selector.md +0 -46
  272. package/skills/weaver-e10-recruit-stage/lib/recruit-resume-photo.py +0 -194
@@ -1,658 +0,0 @@
1
- import { createRequire as __esbuildCreateRequire } from 'node:module';
2
- const require = __esbuildCreateRequire(import.meta.url);
3
- import {
4
- hrmEmployeeOperations
5
- } from "./chunk-IW7A2IQY.js";
6
- import {
7
- hrmOrgOperations
8
- } from "./chunk-5QYE52LG.js";
9
- import {
10
- READ,
11
- SCHEMA_ID,
12
- browserBaseBody,
13
- hrmSuccess,
14
- orgLink,
15
- positionLink,
16
- schemaOf,
17
- toNumber
18
- } from "./chunk-JEQHNNSS.js";
19
- import {
20
- hrmValidationError
21
- } from "./chunk-56EZERK4.js";
22
-
23
- // src/shortcuts/hrm/operations/position.ts
24
- function positionFormDatas() {
25
- const d = {};
26
- for (const f of ["name", "full_name", "code", "parent", "department", "jobsetid", "grade_id"]) {
27
- d[f] = [{ [`${f}Opt`]: { id: "in", content: "\u5305\u542B", disabled: false } }];
28
- }
29
- return d;
30
- }
31
- function formatPosRow(r, baseUrl) {
32
- return {
33
- id: r.id,
34
- name: r.name || r.content || "",
35
- code: r.code || "",
36
- title: r.title || "",
37
- leaf: r.leaf !== false,
38
- link: positionLink(baseUrl, r.id)
39
- };
40
- }
41
- function formatPosListItem(r, baseUrl) {
42
- return {
43
- id: r.id,
44
- name: r.name,
45
- fullName: r.fullName || "",
46
- code: r.code || "",
47
- parent: r.parent || "",
48
- parentId: r.parentId || "",
49
- department: r.department || "",
50
- userCount: r.userCount || "0",
51
- partTimeCount: r.partTimeCount || "0",
52
- cancelStatus: r.cancelStatus,
53
- jobsetid: r.jobsetid || "",
54
- link: positionLink(baseUrl, r.id)
55
- };
56
- }
57
- var positionQuery = {
58
- name: "hrm.position.query",
59
- resource: "position",
60
- method: "position.query",
61
- action: "hrm.position.query",
62
- 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",
63
- risk: READ,
64
- inputSchema: schemaOf({
65
- keyword: { type: "string", description: "\u5FEB\u6377\u641C\u7D22\u5173\u952E\u8BCD\uFF0C\u540D\u79F0\u4E0E\u7F16\u53F7\u5408\u4E00\u5339\u914D" },
66
- name: { type: "string", description: "\u5C97\u4F4D\u540D\u79F0\uFF08\u5305\u542B\u5339\u914D\uFF09" },
67
- code: { type: "string", description: "\u5C97\u4F4D\u7F16\u53F7\uFF08\u7CBE\u786E\u5339\u914D\uFF09" }
68
- }),
69
- handler: async (args, { host }) => {
70
- const name = args.name === void 0 ? "" : String(args.name).trim();
71
- const code = args.code === void 0 ? "" : String(args.code).trim();
72
- const keyword = args.keyword === void 0 ? "" : String(args.keyword).trim();
73
- if (!name && !code && !keyword) {
74
- throw hrmValidationError("empty_condition", "\u5C97\u4F4D\u67E5\u8BE2\u5FC5\u987B\u643A\u5E26\u81F3\u5C11\u4E00\u4E2A\u6536\u655B\u6761\u4EF6\uFF1Akeyword \u6216 name / code");
75
- }
76
- const formDatas = positionFormDatas();
77
- const quickSearchDatas = {};
78
- if (name) {
79
- formDatas.name = [{ nameOpt: { id: "in", content: "\u5305\u542B", disabled: false } }, { nameInput: name }];
80
- } else if (code) {
81
- formDatas.code = [{ codeOpt: { id: "eq", content: "\u7B49\u4E8E", disabled: false } }, { codeInput: code }];
82
- } else {
83
- quickSearchDatas.name = keyword;
84
- }
85
- const resp = await host.request({
86
- method: "POST",
87
- path: "/api/app/hrm/common/browser/data/position",
88
- body: { cmd: "list", current: 1, pageSize: 200, formDatas, quickSearchDatas, type: "and" }
89
- });
90
- const d = resp?.data ?? {};
91
- const rawRows = Array.isArray(d.data) ? d.data : [];
92
- const session = await host.getSession();
93
- const baseUrl = session.baseUrl.replace(/\/+$/, "");
94
- const rows = rawRows.map((r) => formatPosRow(r, baseUrl));
95
- return hrmSuccess("hrm.position.query", { rows, total: Number(d.total ?? rows.length) });
96
- }
97
- };
98
- var positionDetail = {
99
- name: "hrm.position.detail",
100
- resource: "position",
101
- method: "position.detail",
102
- action: "hrm.position.detail",
103
- 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",
104
- risk: READ,
105
- inputSchema: schemaOf(
106
- { id: SCHEMA_ID },
107
- { required: ["id"] }
108
- ),
109
- handler: async (args, { host }) => {
110
- const id = String(args.id).trim();
111
- if (!id) throw hrmValidationError("id_required", "id \u5FC5\u586B");
112
- const session = await host.getSession();
113
- const baseUrl = session.baseUrl.replace(/\/+$/, "");
114
- const resp = await host.request({
115
- method: "GET",
116
- path: "/api/bs/hrm/post/getEditOrAddPostForm",
117
- query: { id, type: "info" },
118
- headers: { Referer: `${baseUrl}/sp/hrm/positionCard/${id}` }
119
- });
120
- const raw = resp?.data?.data ?? {};
121
- const parentName = Array.isArray(raw.parent) && raw.parent[0]?.name ? String(raw.parent[0].name) : "";
122
- const jobsetName = Array.isArray(raw.jobsetid) && raw.jobsetid[0]?.name ? String(raw.jobsetid[0].name) : "";
123
- const jobsetTypeName = Array.isArray(raw.jobset_type_id) && raw.jobset_type_id[0]?.name ? String(raw.jobset_type_id[0].name) : "";
124
- const grade = Array.isArray(raw.grade) ? raw.grade.map((g) => g && typeof g === "object" ? g.name ?? g : g) : raw.grade;
125
- return hrmSuccess("hrm.position.detail", {
126
- id,
127
- name: raw.name,
128
- code: raw.code,
129
- ...parentName ? { parentName } : {},
130
- ...jobsetName ? { jobsetName } : {},
131
- ...jobsetTypeName ? { jobsetTypeName } : {},
132
- ...grade !== void 0 ? { grade } : {},
133
- link: positionLink(baseUrl, id)
134
- });
135
- }
136
- };
137
- var positionList = {
138
- name: "hrm.position.list",
139
- resource: "position",
140
- method: "position.list",
141
- action: "hrm.position.list",
142
- 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",
143
- risk: READ,
144
- inputSchema: schemaOf({
145
- org: SCHEMA_ID,
146
- name: { type: "string", description: "\u5C97\u4F4D\u540D\u79F0\u8FC7\u6EE4\uFF08\u4E0E code \u4E8C\u9009\u4E00\uFF09" },
147
- code: { type: "string", description: "\u5C97\u4F4D\u7F16\u53F7\u8FC7\u6EE4\uFF08\u4E0E name \u4E8C\u9009\u4E00\uFF09" },
148
- all: { type: "boolean", description: "\u663E\u5F0F\u786E\u8BA4\u5168\u91CF\u62C9\u53D6\uFF08\u65E0 org/name/code \u8FC7\u6EE4\u65F6\u5FC5\u586B true\uFF09" },
149
- pageSize: SCHEMA_ID
150
- }),
151
- handler: async (args, { host }) => {
152
- const hasFilter = args.org !== void 0 || args.name !== void 0 || args.code !== void 0;
153
- if (!hasFilter && args.all !== true) {
154
- 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");
155
- }
156
- const body = {
157
- moduleType: "positionAddressBook",
158
- leftOrgId: args.org !== void 0 ? String(args.org) : "",
159
- tableType: "none",
160
- isContainBlock: "0",
161
- includeSub: true,
162
- saCondition: {
163
- name: [{ name_condition: "in" }],
164
- fullName: [{ fullName_condition: "in" }],
165
- code: [{ code_condition: "in" }],
166
- department: [{ department_condition: "in" }]
167
- },
168
- saMatchType: "and"
169
- };
170
- if (args.name !== void 0 || args.code !== void 0) {
171
- body.keyword = String(args.name ?? args.code);
172
- body.keywordMatchFieldList = args.name !== void 0 ? ["name"] : ["code"];
173
- } else {
174
- body.keyword = "";
175
- body.keywordMatchFieldList = [];
176
- }
177
- const pageSize = toNumber(args.pageSize, "pageSize") ?? 100;
178
- const collected = [];
179
- let total = 0;
180
- const maxPages = 500;
181
- for (let current = 1; current <= maxPages; current++) {
182
- const resp = await host.request({
183
- method: "POST",
184
- path: "/api/bs/hrm/position/queryListByOrgTree",
185
- body: { ...body, current, pageSize }
186
- });
187
- const d = resp?.data ?? {};
188
- const rows = Array.isArray(d.data) ? d.data : [];
189
- collected.push(...rows);
190
- total = Number(d.total ?? total);
191
- if (!rows.length || collected.length >= total) break;
192
- }
193
- const session = await host.getSession();
194
- const baseUrl = session.baseUrl.replace(/\/+$/, "");
195
- const list = collected.map((r) => formatPosListItem(r, baseUrl));
196
- return hrmSuccess("hrm.position.list", { rows: list, total: total || list.length }, { pageSize });
197
- }
198
- };
199
- var hrmPositionOperations = [
200
- positionQuery,
201
- positionDetail,
202
- positionList
203
- ];
204
-
205
- // src/shortcuts/hrm/operations/resolve.ts
206
- var VIRTUAL_PATH = "/api/bs/hrm/companyVirtual/listCompanyVirtual";
207
- var ORG_DETAIL_PATH = "/api/bs/hrm/organization/getForm";
208
- var ORG_TYPES = ["department", "subcompany"];
209
- var DEFAULT_MAX_CANDIDATES = 20;
210
- var MAX_CANDIDATES = 200;
211
- var MAX_SUGGESTIONS = 5;
212
- function text(value) {
213
- return value === void 0 || value === null ? "" : String(value).trim();
214
- }
215
- function normalizedName(value) {
216
- return text(value).normalize("NFKC").replace(/\s+/gu, "").toLocaleLowerCase();
217
- }
218
- function normalizePath(value) {
219
- return text(value).split(/[|/]+/u).map((part) => part.trim()).filter(Boolean).join("/");
220
- }
221
- function idValue(value, field) {
222
- const valueText = text(value);
223
- if (!/^\d+$/u.test(valueText)) {
224
- throw hrmValidationError("id_invalid", `${field} \u5FC5\u987B\u662F\u6570\u5B57 ID`);
225
- }
226
- return valueText;
227
- }
228
- function maxCandidatesValue(value) {
229
- if (value === void 0 || value === null || value === "") return DEFAULT_MAX_CANDIDATES;
230
- const numeric = Number(value);
231
- if (!Number.isInteger(numeric) || numeric < 1 || numeric > MAX_CANDIDATES) {
232
- throw hrmValidationError("number_invalid", `maxCandidates \u5FC5\u987B\u662F 1~${MAX_CANDIDATES} \u7684\u6574\u6570`);
233
- }
234
- return numeric;
235
- }
236
- function uniqueById(items) {
237
- const seen = /* @__PURE__ */ new Set();
238
- return items.filter((item) => {
239
- if (!item.id || seen.has(item.id)) return false;
240
- seen.add(item.id);
241
- return true;
242
- });
243
- }
244
- function readVirtuals(response) {
245
- const root = response?.data;
246
- const rows = Array.isArray(root) ? root : Array.isArray(root?.data) ? root.data : [];
247
- return uniqueById(rows.map((row) => ({
248
- id: text(row?.id ?? row?.value),
249
- name: text(row?.content ?? row?.name ?? row?.label)
250
- })).filter((item) => item.id && item.name));
251
- }
252
- function levenshtein(left, right) {
253
- const a = [...left];
254
- const b = [...right];
255
- let previous = Array.from({ length: b.length + 1 }, (_, index) => index);
256
- for (let row = 1; row <= a.length; row += 1) {
257
- const current = [row];
258
- for (let column = 1; column <= b.length; column += 1) {
259
- current[column] = Math.min(
260
- current[column - 1] + 1,
261
- previous[column] + 1,
262
- previous[column - 1] + (a[row - 1] === b[column - 1] ? 0 : 1)
263
- );
264
- }
265
- previous = current;
266
- }
267
- return previous[b.length];
268
- }
269
- function similarity(left, right) {
270
- const a = normalizedName(left);
271
- const b = normalizedName(right);
272
- const longest = Math.max([...a].length, [...b].length);
273
- return longest === 0 ? 1 : 1 - levenshtein(a, b) / longest;
274
- }
275
- function nearVirtuals(keyword, virtuals) {
276
- return virtuals.map((item) => ({ item, score: similarity(keyword, item.name) })).filter(({ score }) => score >= 0.6 && score < 1).sort((left, right) => right.score - left.score).map(({ item }) => item).slice(0, MAX_SUGGESTIONS);
277
- }
278
- function orgPath(row, type) {
279
- const direct = type === "department" ? row.supDepartment : row.supSubDepartment;
280
- if (text(direct)) return normalizePath(direct);
281
- const title = text(row.title);
282
- const name = text(row.name);
283
- if (title && name && title.startsWith(`${name}|`)) {
284
- return normalizePath(title.slice(name.length + 1));
285
- }
286
- return "";
287
- }
288
- function fullOrg(row, type, baseUrl, virtual) {
289
- const id = text(row.id);
290
- const name = text(row.name);
291
- const parentPath = orgPath(row, type);
292
- const rawFullPath = normalizePath(row.fullPath);
293
- const fullPath = rawFullPath || (parentPath ? `${parentPath}/${name}` : name);
294
- const virtualName = parentPath.split("/")[0] || virtual.name;
295
- const parentId = text(row.parent?.id ?? row.parent);
296
- const subcompanyId = text(row.subcompanyid ?? row.subcompanyId);
297
- const virtualId = text(row.virtualid ?? row.virtualId) || virtual.id;
298
- return {
299
- id,
300
- name,
301
- type: text(row.type) || type,
302
- ...text(row.code) ? { code: text(row.code) } : {},
303
- fullPath,
304
- ...parentPath ? { parentPath } : {},
305
- ...parentId ? { parentId } : {},
306
- ...subcompanyId ? { subcompanyId } : {},
307
- virtualId,
308
- virtualName,
309
- ...row.status !== void 0 ? { status: row.status } : {},
310
- link: orgLink(baseUrl, id)
311
- };
312
- }
313
- function orgCandidate(row, type, baseUrl, virtual) {
314
- const item = fullOrg(row, type, baseUrl, virtual);
315
- return {
316
- id: item.id,
317
- name: item.name,
318
- type: item.type,
319
- fullPath: item.fullPath,
320
- ...item.code ? { code: item.code } : {},
321
- link: item.link
322
- };
323
- }
324
- function browsePath(type) {
325
- return type === "department" ? "/api/hrm/common/browser/data/department" : "/api/hrm/common/browser/data/subcompany";
326
- }
327
- async function browseOrg(host, type, virtualId, keyword, condition, pageSize) {
328
- const response = await host.request({
329
- method: "POST",
330
- path: browsePath(type),
331
- body: {
332
- ...browserBaseBody(),
333
- virtualType: "ALL",
334
- cmd: "list",
335
- current: 1,
336
- pageSize,
337
- companyId: virtualId,
338
- formDatas: {
339
- name: [{
340
- nameCondition: {
341
- id: condition,
342
- content: condition === "eq" ? "\u7B49\u4E8E" : "\u5305\u542B",
343
- disabled: false
344
- },
345
- name: keyword
346
- }]
347
- },
348
- quickSearchDatas: {},
349
- type: "and",
350
- stopDepartment: false
351
- }
352
- });
353
- const data = response?.data ?? {};
354
- const rows = Array.isArray(data.data) ? data.data : [];
355
- const reportedTotal = Number(data.total);
356
- return {
357
- type,
358
- rows,
359
- total: Number.isFinite(reportedTotal) ? reportedTotal : rows.length
360
- };
361
- }
362
- async function browseTypes(host, types, virtualId, keyword, condition, pageSize) {
363
- return Promise.all(types.map((type) => browseOrg(host, type, virtualId, keyword, condition, pageSize)));
364
- }
365
- function exactRows(results, keyword) {
366
- const normalized = normalizedName(keyword);
367
- return results.map((result) => {
368
- const rows = result.rows.filter((row) => normalizedName(row.name) === normalized);
369
- return { ...result, rows, total: rows.length };
370
- });
371
- }
372
- function totalMatches(results) {
373
- return results.reduce((sum, result) => sum + Math.max(result.total, result.rows.length), 0);
374
- }
375
- function allRows(results) {
376
- return results.flatMap((result) => result.rows.map((row) => ({ type: result.type, row })));
377
- }
378
- function resolvedFromMatches(results, explicitType) {
379
- if (explicitType) {
380
- const result = results[0];
381
- const count = Math.max(result.total, result.rows.length);
382
- return {
383
- selected: count === 1 && result.rows[0] ? { type: result.type, row: result.rows[0] } : void 0,
384
- alternatives: [],
385
- ambiguous: count > 1
386
- };
387
- }
388
- const department = results.find((result) => result.type === "department");
389
- const subcompany = results.find((result) => result.type === "subcompany");
390
- const departmentCount = department ? Math.max(department.total, department.rows.length) : 0;
391
- const subcompanyCount = subcompany ? Math.max(subcompany.total, subcompany.rows.length) : 0;
392
- if (departmentCount === 1 && department?.rows[0]) {
393
- return {
394
- selected: { type: "department", row: department.rows[0] },
395
- alternatives: (subcompany?.rows ?? []).map((row) => ({ type: "subcompany", row })),
396
- ambiguous: false
397
- };
398
- }
399
- if (departmentCount > 1) return { alternatives: [], ambiguous: true };
400
- if (subcompanyCount === 1 && subcompany?.rows[0]) {
401
- return { selected: { type: "subcompany", row: subcompany.rows[0] }, alternatives: [], ambiguous: false };
402
- }
403
- return { alternatives: [], ambiguous: subcompanyCount > 1 };
404
- }
405
- function truncatedCandidates(results, maxCandidates, baseUrl, virtual) {
406
- const candidateTotal = totalMatches(results);
407
- const candidates = allRows(results).slice(0, maxCandidates).map(({ type, row }) => orgCandidate(row, type, baseUrl, virtual));
408
- return {
409
- candidates,
410
- candidateTotal,
411
- truncated: candidateTotal > candidates.length
412
- };
413
- }
414
- async function resolveOrgId(host, orgId, baseUrl, virtual) {
415
- const response = await host.request({
416
- method: "GET",
417
- path: ORG_DETAIL_PATH,
418
- query: { id: orgId, readOnly: true, includeSub: true, quote: true, isMobile: false },
419
- headers: { Referer: `${baseUrl}/sp/hrm/orgCard/${orgId}` }
420
- });
421
- const raw = response?.data?.data ?? {};
422
- const type = raw.type === "subcompany" ? "subcompany" : "department";
423
- const parentName = Array.isArray(raw.parent) ? text(raw.parent[0]?.name) : "";
424
- const subcompanyName = Array.isArray(raw.subcompany) ? text(raw.subcompany[0]?.name) : "";
425
- const fullPath = normalizePath(raw.fullPath);
426
- const pathParts = fullPath.split("/").filter(Boolean);
427
- return {
428
- id: text(raw.id) || orgId,
429
- name: text(raw.name),
430
- type,
431
- ...text(raw.code) ? { code: text(raw.code) } : {},
432
- ...fullPath ? { fullPath } : {},
433
- ...pathParts.length > 1 ? { parentPath: pathParts.slice(0, -1).join("/") } : {},
434
- ...parentName ? { parentName } : {},
435
- ...subcompanyName ? { subcompanyName } : {},
436
- virtualId: virtual.id,
437
- virtualName: virtual.name,
438
- ...raw.status !== void 0 ? { status: raw.status } : {},
439
- link: orgLink(baseUrl, orgId)
440
- };
441
- }
442
- function relaxedKeywords(name) {
443
- const characters = [...text(name)];
444
- if (characters.length <= 2) return [characters.join("")].filter(Boolean);
445
- const suffix = characters.slice(-2).join("");
446
- const prefix = characters.slice(0, 2).join("");
447
- return suffix === prefix ? [suffix] : [suffix, prefix];
448
- }
449
- async function nearOrgSuggestions(host, type, virtual, name, pageSize, baseUrl) {
450
- const results = [];
451
- const seen = /* @__PURE__ */ new Set();
452
- for (const keyword of relaxedKeywords(name)) {
453
- const result = await browseOrg(host, type, virtual.id, keyword, "in", pageSize);
454
- for (const row of result.rows) {
455
- const id = text(row.id);
456
- if (!id || seen.has(id)) continue;
457
- seen.add(id);
458
- results.push(orgCandidate(row, type, baseUrl, virtual));
459
- }
460
- }
461
- return results;
462
- }
463
- var orgResolve = {
464
- name: "hrm.org.resolve",
465
- resource: "org",
466
- method: "org.resolve",
467
- action: "hrm.org.resolve",
468
- summary: "\u6309\u591A\u7EF4\u540D\u79F0\u4E0E\u7EC4\u7EC7\u540D\u79F0\u89E3\u6790\u552F\u4E00\u90E8\u95E8/\u5206\u90E8\uFF1B\u6B67\u4E49\u6216\u8FD1\u4F3C\u540D\u79F0\u53EA\u8FD4\u56DE\u5019\u9009\uFF0C\u4E0D\u4EE3\u66FF\u7528\u6237\u9009\u62E9",
469
- risk: READ,
470
- inputSchema: schemaOf({
471
- virtual: { type: "string", minLength: 1, description: "\u591A\u7EF4\u540D\u79F0\uFF1B\u4E0E virtualId \u81F3\u5C11\u4F20\u4E00\u4E2A" },
472
- virtualId: SCHEMA_ID,
473
- name: { type: "string", minLength: 1, description: "\u7EC4\u7EC7\u540D\u79F0\uFF1B\u4E0E orgId \u81F3\u5C11\u4F20\u4E00\u4E2A" },
474
- orgId: SCHEMA_ID,
475
- type: { type: "string", enum: [...ORG_TYPES] },
476
- maxCandidates: { type: "integer", minimum: 1, maximum: MAX_CANDIDATES, default: DEFAULT_MAX_CANDIDATES }
477
- }),
478
- handler: async (args, { host }) => {
479
- const virtualKeyword = text(args.virtual);
480
- const name = text(args.name);
481
- const virtualId = args.virtualId === void 0 ? "" : idValue(args.virtualId, "virtualId");
482
- const orgId = args.orgId === void 0 ? "" : idValue(args.orgId, "orgId");
483
- if (!virtualKeyword && !virtualId) {
484
- throw hrmValidationError("virtual_required", "virtual \u6216 virtualId \u81F3\u5C11\u4F20\u4E00\u4E2A");
485
- }
486
- if (!name && !orgId) {
487
- throw hrmValidationError("name_required", "name \u6216 orgId \u81F3\u5C11\u4F20\u4E00\u4E2A");
488
- }
489
- const explicitType = args.type !== void 0;
490
- const requestedType = explicitType ? text(args.type) : "";
491
- if (explicitType && !ORG_TYPES.includes(requestedType)) {
492
- throw hrmValidationError("enum_invalid", `type \u53D6\u503C\u5FC5\u987B\u662F ${ORG_TYPES.join(" / ")} \u4E4B\u4E00`);
493
- }
494
- const types = explicitType ? [requestedType] : ["department", "subcompany"];
495
- const maxCandidates = maxCandidatesValue(args.maxCandidates);
496
- const pageSize = Math.max(100, maxCandidates);
497
- const virtualResponse = await host.request({ method: "GET", path: VIRTUAL_PATH });
498
- const virtuals = readVirtuals(virtualResponse);
499
- let virtual;
500
- let virtualMatchType = "exact";
501
- if (virtualId) {
502
- virtual = virtuals.find((item) => item.id === virtualId);
503
- virtualMatchType = "id";
504
- } else {
505
- const keyword = normalizedName(virtualKeyword);
506
- const exact = virtuals.filter((item) => normalizedName(item.name) === keyword);
507
- const matches2 = exact.length > 0 ? exact : virtuals.filter((item) => normalizedName(item.name).includes(keyword));
508
- virtualMatchType = exact.length > 0 ? "exact" : "fuzzy";
509
- if (matches2.length > 1) {
510
- const candidates = matches2.slice(0, maxCandidates);
511
- return hrmSuccess("hrm.org.resolve", {
512
- status: "ambiguous",
513
- stage: "virtual",
514
- virtual: null,
515
- matchType: virtualMatchType,
516
- candidates,
517
- candidateTotal: matches2.length,
518
- truncated: matches2.length > candidates.length,
519
- message: `\u591A\u7EF4\u300C${virtualKeyword}\u300D\u5339\u914D\u5230 ${matches2.length} \u4E2A\u5019\u9009\uFF0C\u8BF7\u786E\u8BA4\u540E\u628A\u5019\u9009 id \u4F5C\u4E3A virtualId \u590D\u8C03\u3002`
520
- });
521
- }
522
- virtual = matches2[0];
523
- }
524
- if (!virtual) {
525
- const suggestions2 = virtualKeyword ? nearVirtuals(virtualKeyword, virtuals) : [];
526
- const available = virtuals.map((item) => item.name).join("\u3001");
527
- const target = virtualId ? `ID ${virtualId}` : `\u300C${virtualKeyword}\u300D`;
528
- const suggestionText = suggestions2.length > 0 ? `\uFF1B\u8FD1\u4F3C\u540D\u79F0\uFF1A${suggestions2.map((item) => item.name).join("\u3001")}\u3002\u4E0D\u8981\u81EA\u884C\u66FF\u6362\u540D\u79F0\uFF0C\u8BF7\u5148\u8BA9\u7528\u6237\u786E\u8BA4` : "";
529
- return hrmSuccess("hrm.org.resolve", {
530
- status: "not_found",
531
- stage: "virtual",
532
- virtual: null,
533
- matchType: "none",
534
- candidates: [],
535
- candidateTotal: 0,
536
- suggestions: suggestions2,
537
- suggestionTotal: suggestions2.length,
538
- availableVirtuals: virtuals,
539
- message: `\u591A\u7EF4${target}\u4E0D\u5B58\u5728${suggestionText}\u3002\u5F53\u524D\u53EF\u7528\u591A\u7EF4\uFF1A${available || "\u65E0"}\u3002`
540
- });
541
- }
542
- const virtualResult = {
543
- id: virtual.id,
544
- name: virtual.name,
545
- keyword: virtualKeyword,
546
- matchType: virtualMatchType
547
- };
548
- const session = await host.getSession();
549
- const baseUrl = session.baseUrl.replace(/\/+$/u, "");
550
- if (orgId) {
551
- const org = await resolveOrgId(host, orgId, baseUrl, virtual);
552
- return hrmSuccess("hrm.org.resolve", {
553
- status: "resolved",
554
- stage: "org",
555
- matchType: "id",
556
- type: org.type,
557
- virtual: virtualResult,
558
- org,
559
- message: `\u5DF2\u6309 orgId \u5B9A\u4F4D\u7EC4\u7EC7\u300C${String(org.name || orgId)}\u300D\u3002`
560
- });
561
- }
562
- let matchType = "exact";
563
- let matches = await browseTypes(host, types, virtual.id, name, "eq", pageSize);
564
- let choice = resolvedFromMatches(matches, explicitType);
565
- if (!choice.selected && !choice.ambiguous) {
566
- const fuzzyResults = await browseTypes(host, types, virtual.id, name, "in", pageSize);
567
- const normalizedExact = exactRows(fuzzyResults, name);
568
- if (totalMatches(normalizedExact) > 0) {
569
- matches = normalizedExact;
570
- matchType = "exact";
571
- } else {
572
- matches = fuzzyResults;
573
- matchType = "fuzzy";
574
- }
575
- choice = resolvedFromMatches(matches, explicitType);
576
- }
577
- if (choice.selected) {
578
- const org = fullOrg(choice.selected.row, choice.selected.type, baseUrl, virtual);
579
- const alsoMatched = choice.alternatives.map(({ type, row }) => orgCandidate(row, type, baseUrl, virtual));
580
- const fuzzyMessage = matchType === "fuzzy" ? "\uFF08\u6A21\u7CCA\u5339\u914D\uFF09" : "";
581
- const alternativeMessage = alsoMatched.length > 0 ? `\uFF1B\u53E6\u6709\u540C\u540D\u8282\u70B9 ${alsoMatched.length} \u4E2A\uFF0C\u8BF7\u4E00\u5E76\u544A\u77E5\u7528\u6237` : "";
582
- return hrmSuccess("hrm.org.resolve", {
583
- status: "resolved",
584
- stage: "org",
585
- matchType,
586
- type: choice.selected.type,
587
- virtual: virtualResult,
588
- org,
589
- ...alsoMatched.length > 0 ? { alsoMatched } : {},
590
- message: `\u5DF2${fuzzyMessage}\u5B9A\u4F4D${choice.selected.type === "department" ? "\u90E8\u95E8" : "\u5206\u90E8"}\u300C${name}\u300D${alternativeMessage}\u3002`
591
- });
592
- }
593
- if (choice.ambiguous) {
594
- const candidateData = truncatedCandidates(matches, maxCandidates, baseUrl, virtual);
595
- const truncatedMessage = candidateData.truncated ? `\uFF0C\u4EC5\u5217\u51FA\u524D ${maxCandidates} \u4E2A` : "";
596
- return hrmSuccess("hrm.org.resolve", {
597
- status: "ambiguous",
598
- stage: "org",
599
- matchType,
600
- virtual: virtualResult,
601
- ...candidateData,
602
- message: `\u7EC4\u7EC7\u300C${name}\u300D\u5339\u914D\u5230 ${candidateData.candidateTotal} \u4E2A\u5019\u9009${truncatedMessage}\uFF0C\u8BF7\u786E\u8BA4\u540E\u628A\u5019\u9009 id \u4F5C\u4E3A orgId \u590D\u8C03\u3002`
603
- });
604
- }
605
- const suggestionType = requestedType || "department";
606
- const allSuggestions = await nearOrgSuggestions(host, suggestionType, virtual, name, pageSize, baseUrl);
607
- const suggestions = allSuggestions.slice(0, MAX_SUGGESTIONS);
608
- const suggestionMessage = suggestions.length > 0 ? `\uFF1B\u627E\u5230\u8FD1\u4F3C\u540D\u79F0 ${suggestions.map((item) => item.name).join("\u3001")}\uFF0C\u4E0D\u8981\u81EA\u884C\u66FF\u6362\u540D\u79F0\uFF0C\u8BF7\u5148\u8BA9\u7528\u6237\u786E\u8BA4` : "";
609
- return hrmSuccess("hrm.org.resolve", {
610
- status: "not_found",
611
- stage: "org",
612
- matchType: "none",
613
- virtual: virtualResult,
614
- suggestions,
615
- suggestionTotal: allSuggestions.length,
616
- message: `\u5728\u591A\u7EF4\u300C${virtual.name}\u300D\u4E2D\u672A\u627E\u5230\u7EC4\u7EC7\u300C${name}\u300D${suggestionMessage}\u3002`
617
- });
618
- }
619
- };
620
- var hrmResolveOperations = [orgResolve];
621
-
622
- // src/shortcuts/hrm/operations/registry.ts
623
- function buildRegistry() {
624
- const registry = /* @__PURE__ */ new Map();
625
- const definitions = [
626
- ...hrmEmployeeOperations,
627
- ...hrmOrgOperations,
628
- ...hrmResolveOperations,
629
- ...hrmPositionOperations
630
- ];
631
- for (const definition of definitions) {
632
- if (registry.has(definition.name)) {
633
- throw new Error(`duplicate hrm operation: ${definition.name}`);
634
- }
635
- registry.set(definition.name, definition);
636
- }
637
- return registry;
638
- }
639
- var hrmOperationRegistry = buildRegistry();
640
- function hrmOperationDefinitions() {
641
- return [...hrmOperationRegistry.values()];
642
- }
643
- function getHrmOperation(operation) {
644
- const definition = hrmOperationRegistry.get(operation);
645
- if (!definition) {
646
- throw hrmValidationError("operation_unknown", `\u7EC4\u7EC7\u7BA1\u7406\u4E0D\u652F\u6301\u64CD\u4F5C\uFF1A${operation}`);
647
- }
648
- return definition;
649
- }
650
- function hasHrmOperation(operation) {
651
- return hrmOperationRegistry.has(operation);
652
- }
653
-
654
- export {
655
- hrmOperationDefinitions,
656
- getHrmOperation,
657
- hasHrmOperation
658
- };