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.
Files changed (299) hide show
  1. package/dist/chunks/{archive-S2VKZWQ3.js → archive-WUZKAEZ6.js} +5 -4
  2. package/dist/chunks/{archive-oa-HEDSIUUY.js → archive-oa-PN46RTI2.js} +5 -4
  3. package/dist/chunks/{asset-HYH4W357.js → asset-ZPC5VWZM.js} +5 -4
  4. package/dist/chunks/{asset-idle-N7REBNGL.js → asset-idle-DHGP3NYY.js} +5 -4
  5. package/dist/chunks/{attachment-content-VYYA75FR.js → attachment-content-JQDW3BIB.js} +3 -3
  6. package/dist/chunks/{blog-SLMZZICV.js → blog-JC47AIXK.js} +5 -4
  7. package/dist/chunks/{caizhilian-RV43KKBT.js → caizhilian-IKIHM77A.js} +5 -5
  8. package/dist/chunks/{calendar-DMVZ4OLY.js → calendar-GZTSJ57Y.js} +5 -4
  9. package/dist/chunks/{chunk-H6YOMI3U.js → chunk-26FCCU5O.js} +5 -3
  10. package/dist/chunks/{chunk-E5YD5JWR.js → chunk-3PCXBG4H.js} +1 -1
  11. package/dist/chunks/{chunk-UBRWONP4.js → chunk-3W5NMGDS.js} +2 -2
  12. package/dist/chunks/{chunk-DTCQFTHW.js → chunk-4AFWOGOV.js} +3 -3
  13. package/dist/chunks/{chunk-VNYOUAWV.js → chunk-5QQKLR6H.js} +11 -11
  14. package/dist/chunks/{chunk-BQYX2UX5.js → chunk-6T5X6YWX.js} +5 -3
  15. package/dist/chunks/{chunk-KXJA42EA.js → chunk-AFZTMYGC.js} +1 -1
  16. package/dist/chunks/{chunk-YI2YMW5N.js → chunk-AGSO3PIK.js} +2 -2
  17. package/dist/chunks/{chunk-IW7A2IQY.js → chunk-C4YQJFZV.js} +43 -15
  18. package/dist/chunks/{chunk-WIWDVETN.js → chunk-FDBAFANU.js} +76 -76
  19. package/dist/chunks/{chunk-NRYDJN4J.js → chunk-FJUOUSV3.js} +89 -8
  20. package/dist/chunks/{chunk-EGANE35F.js → chunk-HLT6B26P.js} +1 -1
  21. package/dist/chunks/{chunk-P6TXQK75.js → chunk-HWA2A25Y.js} +5 -3
  22. package/dist/chunks/{chunk-T2KVJFWJ.js → chunk-I3MOFD6Q.js} +4 -7
  23. package/dist/chunks/chunk-IN6NXQ26.js +680 -0
  24. package/dist/chunks/{chunk-UBGWIXU3.js → chunk-INVYKG4I.js} +140 -45
  25. package/dist/chunks/{chunk-QBDXJS2W.js → chunk-K7QKQRSL.js} +168 -62
  26. package/dist/chunks/{chunk-BIA2NKUG.js → chunk-KDFEHDIB.js} +5 -5
  27. package/dist/chunks/{chunk-ILALC2N6.js → chunk-KYDXWYFB.js} +1 -1
  28. package/dist/chunks/{chunk-V2LASYKO.js → chunk-Q6D6PSMH.js} +30 -24
  29. package/dist/chunks/{chunk-UQFPF4EX.js → chunk-RMOH2GMF.js} +2 -2
  30. package/dist/chunks/{chunk-VBFBMM7G.js → chunk-SCMHG23G.js} +387 -70
  31. package/dist/chunks/chunk-TJN4PIYO.js +47 -0
  32. package/dist/chunks/{chunk-JFAWZX53.js → chunk-UPVAQJKS.js} +282 -131
  33. package/dist/chunks/{chunk-KY3R42RS.js → chunk-VLY5RTVO.js} +5 -3
  34. package/dist/chunks/{chunk-TEZHIB6T.js → chunk-WSHIOSGM.js} +5 -3
  35. package/dist/chunks/{chunk-6XSSAUNW.js → chunk-XHSEK2VM.js} +48 -12
  36. package/dist/chunks/{chunk-XT77MP54.js → chunk-YTFNMQO4.js} +410 -24
  37. package/dist/chunks/{conflict-GFJRS6I7.js → conflict-UUC7AFUI.js} +2 -2
  38. package/dist/chunks/{contract-U3ZGNRWB.js → contract-INMS7SYQ.js} +3051 -4497
  39. package/dist/chunks/{cowork-EX7PKIDK.js → cowork-34CBYVQP.js} +5 -4
  40. package/dist/chunks/{create-flow-EJZD434E.js → create-flow-YOR4QTAJ.js} +18 -6
  41. package/dist/chunks/{data-FOODGAMF.js → data-QKWI5325.js} +14 -3
  42. package/dist/chunks/{ebuilder-form-I2EOKODG.js → ebuilder-form-ZONRROK4.js} +4 -4
  43. package/dist/chunks/{ehr-TE4RFNID.js → ehr-2CONM7R6.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-S2ENJ6GZ.js} +3 -3
  46. package/dist/chunks/{env-TID5NFR6.js → env-ZSAXU5PJ.js} +2 -2
  47. package/dist/chunks/{esb-7L6MHYLB.js → esb-FQASCY2H.js} +8 -8
  48. package/dist/chunks/{factory-OG7BPMH5.js → factory-N76QQA53.js} +1 -1
  49. package/dist/chunks/{fna-6V2ENR3Y.js → fna-FCLVIWAS.js} +5 -4
  50. package/dist/chunks/{group-chat-5DKPWIHL.js → group-chat-UM665WDZ.js} +3 -3
  51. package/dist/chunks/{host-VTPAWDZV.js → host-2ED2KC4X.js} +4 -4
  52. package/dist/chunks/{host-TJ5VVHM7.js → host-2UYZEY2V.js} +4 -4
  53. package/dist/chunks/{host-3DLYA54R.js → host-46NYKDQP.js} +4 -4
  54. package/dist/chunks/{host-OGBHL75G.js → host-7IPZKIM4.js} +4 -4
  55. package/dist/chunks/{host-GOJHHTPY.js → host-P7G22WNM.js} +4 -4
  56. package/dist/chunks/{host-ONZC6AE7.js → host-XLCBLNJD.js} +4 -4
  57. package/dist/chunks/{hrm-2N7NFQDZ.js → hrm-XKL27NX2.js} +6 -6
  58. package/dist/chunks/{im-XCH47ZBN.js → im-NDYIMASG.js} +4 -4
  59. package/dist/chunks/{invoice-5KJ7T774.js → invoice-MOGNB6HN.js} +4 -4
  60. package/dist/chunks/{jiuchuanhui-PL6DRPBM.js → jiuchuanhui-3T5X7SB7.js} +5 -4
  61. package/dist/chunks/{lazy-dispatch-UATEN7H7.js → lazy-dispatch-4WOIL3ZQ.js} +5 -5
  62. package/dist/chunks/{mail-Q7Z4CQ4D.js → mail-P7VMUKQW.js} +5 -4
  63. package/dist/chunks/{meeting-5E3BNARL.js → meeting-MMTYDHXA.js} +16 -15
  64. package/dist/chunks/{minute-doc-NXRE5C77.js → minute-doc-LCSBWGJ3.js} +4 -4
  65. package/dist/chunks/{okr-3O3XNYOK.js → okr-VZXRQGS4.js} +5 -4
  66. package/dist/chunks/{operations-EZWG72FH.js → operations-MI2BSKZX.js} +5 -5
  67. package/dist/chunks/{performance-Y7CPNSOR.js → performance-OPEQNW7Y.js} +873 -17
  68. package/dist/chunks/{plan-BLGPZF5M.js → plan-TJAS4N5X.js} +5 -4
  69. package/dist/chunks/{project-6MZMLJMP.js → project-CYBGU6K6.js} +5 -4
  70. package/dist/chunks/{reception-F2VT2X52.js → reception-3FT2F66K.js} +3 -3
  71. package/dist/chunks/{recruit-stage-4ETIBMIW.js → recruit-stage-WPGB5BDJ.js} +654 -336
  72. package/dist/chunks/{registry-3FYSWV3U.js → registry-BAWCWV4D.js} +3 -3
  73. package/dist/chunks/{registry-I4DVPDMU.js → registry-FNI5E76J.js} +12 -12
  74. package/dist/chunks/{registry-3UGIWH53.js → registry-JMNOXRST.js} +2 -2
  75. package/dist/chunks/{registry-7RS74TCK.js → registry-QRMXRSCT.js} +5 -5
  76. package/dist/chunks/{room-recommend-GWCVKCXW.js → room-recommend-I7QQRHEL.js} +4 -4
  77. package/dist/chunks/{schedule-6AN63MJQ.js → schedule-3P7EWGNZ.js} +4 -4
  78. package/dist/chunks/{smart-extract-SR4SJJKN.js → smart-extract-FOBSVNYW.js} +3 -3
  79. package/dist/chunks/{workflow-KF7FA2UQ.js → workflow-U2KKTVQY.js} +10 -7
  80. package/dist/index.js +34 -34
  81. package/dist/internal/e10/auth/commands.js +203 -44
  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/error-actions.js +112 -0
  88. package/dist/shortcuts/contract/errors.js +9 -1
  89. package/dist/shortcuts/contract/index.js +14 -39
  90. package/dist/shortcuts/contract/manifest.js +130 -274
  91. package/dist/shortcuts/contract/operations/compare-report.js +437 -0
  92. package/dist/shortcuts/contract/operations/compare.js +2 -0
  93. package/dist/shortcuts/contract/operations/docx-slots.js +112 -5
  94. package/dist/shortcuts/contract/operations/docx-verify.js +2 -70
  95. package/dist/shortcuts/contract/operations/elements-build.js +82 -56
  96. package/dist/shortcuts/contract/operations/elements-spec.js +140 -3
  97. package/dist/shortcuts/contract/operations/first-screen.js +96 -207
  98. package/dist/shortcuts/contract/operations/flow.js +19 -1
  99. package/dist/shortcuts/contract/operations/{card-ebdf-list.js → ledger-card.js} +123 -27
  100. package/dist/shortcuts/contract/operations/ledger.js +343 -1
  101. package/dist/shortcuts/contract/operations/metrics.js +93 -0
  102. package/dist/shortcuts/contract/operations/modeltext.js +3 -3
  103. package/dist/shortcuts/contract/operations/money.js +90 -0
  104. package/dist/shortcuts/contract/operations/page.js +8 -4
  105. package/dist/shortcuts/contract/operations/performance.js +53 -0
  106. package/dist/shortcuts/contract/operations/placeholder-scan.js +104 -0
  107. package/dist/shortcuts/contract/operations/quote-recognize.js +326 -0
  108. package/dist/shortcuts/contract/operations/quote-ref.js +179 -0
  109. package/dist/shortcuts/contract/operations/quote-submit.js +281 -0
  110. package/dist/shortcuts/contract/operations/quote.js +66 -12
  111. package/dist/shortcuts/contract/operations/recommend.js +42 -1
  112. package/dist/shortcuts/contract/operations/registry.js +16 -23
  113. package/dist/shortcuts/contract/operations/{card-risk-report.js → review-report.js} +24 -114
  114. package/dist/shortcuts/contract/operations/review.js +33 -167
  115. package/dist/shortcuts/contract/operations/save-recognize.js +173 -43
  116. package/dist/shortcuts/contract/operations/solutions-spec.js +79 -0
  117. package/dist/shortcuts/contract/operations/triage.js +68 -15
  118. package/dist/shortcuts/contract/operations/{template.js → type-clause-read.js} +10 -25
  119. package/dist/shortcuts/contract/operations/upload.js +17 -11
  120. package/dist/shortcuts/contract/prewarm-cache.js +6 -2
  121. package/dist/shortcuts/contract/prewarm.js +33 -23
  122. package/dist/shortcuts/contract/recommend-cache.js +191 -0
  123. package/dist/shortcuts/data/operations/shared.js +14 -1
  124. package/dist/shortcuts/ehr/operations/recruit-interview-overview.js +85 -62
  125. package/dist/shortcuts/ehr/operations/recruit-position.js +21 -13
  126. package/dist/shortcuts/ehr/operations/recruit-short-cache.js +59 -0
  127. package/dist/shortcuts/ehr/operations/recruit-tag.js +17 -11
  128. package/dist/shortcuts/ehr/operations/recruit-write.js +118 -70
  129. package/dist/shortcuts/ehr/operations/recruit.js +338 -121
  130. package/dist/shortcuts/hrm/operations/employee.js +64 -17
  131. package/dist/shortcuts/hrm/operations/resolve.js +419 -369
  132. package/dist/shortcuts/im/host.js +38 -22
  133. package/dist/shortcuts/meeting/operations/eb/conflict.js +60 -2
  134. package/dist/shortcuts/meeting/operations/eb/create-flow.js +138 -15
  135. package/dist/shortcuts/meeting/operations/eb/create-form-link.js +380 -0
  136. package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
  137. package/dist/shortcuts/meeting/operations/eb/room-recommend.js +1 -3
  138. package/dist/shortcuts/performance/flow-utils.js +363 -0
  139. package/dist/shortcuts/performance/manifest.js +2 -2
  140. package/dist/shortcuts/performance/operations/flow-detail.js +85 -0
  141. package/dist/shortcuts/performance/operations/flow-list.js +213 -0
  142. package/dist/shortcuts/performance/operations/flow-score.js +241 -0
  143. package/dist/shortcuts/performance/operations/registry.js +6 -0
  144. package/dist/shortcuts/recruit-stage/batch-store.js +44 -0
  145. package/dist/shortcuts/recruit-stage/context.js +75 -9
  146. package/dist/shortcuts/recruit-stage/manifest.js +1 -1
  147. package/dist/shortcuts/recruit-stage/operations/jd-create.js +33 -22
  148. package/dist/shortcuts/recruit-stage/operations/list.js +187 -37
  149. package/dist/shortcuts/recruit-stage/operations/registry.js +2 -0
  150. package/dist/shortcuts/recruit-stage/operations/resume-import.js +231 -313
  151. package/dist/shortcuts/recruit-stage/operations/search.js +5 -5
  152. package/dist/shortcuts/recruit-stage/operations/tag.js +286 -0
  153. package/dist/shortcuts/workflow/endpoints.js +2 -0
  154. package/dist/shortcuts/workflow/operations/form.js +12 -15
  155. package/dist/shortcuts/workflow/operations/read.js +8 -8
  156. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoListRows.js +3 -2
  157. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +7 -6
  158. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +4 -3
  159. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +1 -0
  160. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +33 -6
  161. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.prepareQuery.js +153 -0
  162. package/dist/shortcuts/workflow/operations/todoSmartConvert/workflowClarification.js +232 -0
  163. package/dist/shortcuts/workflow/operations.js +5 -0
  164. package/docs/contract.md +2 -2
  165. package/docs/e10-auth.md +55 -2
  166. package/docs/ehr.md +1 -1
  167. package/package.json +1 -1
  168. package/skills/weaver-e10-hrm/SKILL.md +3 -3
  169. package/skills/weaver-e10-hrm/references/employee.md +13 -2
  170. package/skills/weaver-e10-jinchengda/SKILL.md +283 -345
  171. package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +7 -14
  172. package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +21 -12
  173. package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +126 -202
  174. package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +13 -5
  175. package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +28 -20
  176. package/skills/weaver-e10-jinchengda/references/contract-clause-recommender.md +12 -17
  177. package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +7 -13
  178. package/skills/weaver-e10-jinchengda/references/contract-command-index.md +47 -16
  179. package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +10 -18
  180. package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +19 -18
  181. package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +114 -61
  182. package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +8 -2
  183. package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +78 -112
  184. package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +67 -333
  185. package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +18 -15
  186. package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +80 -84
  187. package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +38 -34
  188. package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +132 -47
  189. package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +108 -217
  190. package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +14 -20
  191. package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +13 -7
  192. package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +86 -46
  193. package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +12 -10
  194. package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +22 -14
  195. package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +18 -18
  196. package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +27 -26
  197. package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +252 -0
  198. package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +15 -23
  199. package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +290 -104
  200. package/skills/weaver-e10-jinchengda/references/contract-request-status.md +5 -12
  201. package/skills/weaver-e10-jinchengda/references/contract-request-write.md +12 -18
  202. package/skills/weaver-e10-jinchengda/references/contract-signing-subjects.md +11 -17
  203. package/skills/weaver-e10-jinchengda/references/contract-subject-create.md +5 -11
  204. package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +56 -7
  205. package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +12 -12
  206. package/skills/weaver-e10-jinchengda/references/contract-workflow-discovery.md +10 -16
  207. package/skills/weaver-e10-jinchengda/references/orchestration.md +33 -35
  208. package/skills/weaver-e10-jucailin/SKILL.md +6 -7
  209. package/skills/weaver-e10-jucailin/agents/openai.yaml +52 -0
  210. package/skills/weaver-e10-jucailin/references/recruit-interview-overview.md +8 -6
  211. package/skills/weaver-e10-jucailin/references/recruit-read.md +4 -0
  212. package/skills/weaver-e10-jucailin/references/recruit-screening-to-interview-sop.md +2 -2
  213. package/skills/weaver-e10-jucailin/references/recruit-write.md +4 -4
  214. package/skills/weaver-e10-meeting/SKILL.md +87 -534
  215. package/skills/weaver-e10-meeting/references/commands-table.md +61 -0
  216. package/skills/weaver-e10-meeting/references/create-commands.md +136 -0
  217. package/skills/weaver-e10-meeting/references/create-flow.md +9 -7
  218. package/skills/weaver-e10-meeting/references/create-guardrails.md +23 -17
  219. package/skills/weaver-e10-meeting/references/custom-fields.md +40 -0
  220. package/skills/weaver-e10-meeting/references/eb-contracts.md +60 -0
  221. package/skills/weaver-e10-meeting/references/invitation.md +69 -0
  222. package/skills/weaver-e10-meeting/references/meeting-eb.md +26 -26
  223. package/skills/weaver-e10-meeting/references/meeting-invitation.md +2 -2
  224. package/skills/weaver-e10-meeting/references/meeting-minute-file.md +2 -2
  225. package/skills/weaver-e10-meeting/references/meeting-verification.md +1 -1
  226. package/skills/weaver-e10-meeting/references/minutes-pipeline.md +119 -0
  227. package/skills/weaver-e10-meeting/references/pitfalls.md +1 -1
  228. package/skills/weaver-e10-meeting/references/room-recommend.md +88 -0
  229. package/skills/weaver-e10-performance/SKILL.md +45 -5
  230. package/skills/weaver-e10-performance/agents/openai.yaml +26 -2
  231. package/skills/weaver-e10-performance/references/flow-api.md +128 -0
  232. package/skills/weaver-e10-performance/references/flow-assess.md +149 -0
  233. package/skills/weaver-e10-recruit-stage/SKILL.md +317 -266
  234. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +22 -27
  235. package/skills/weaver-e10-recruit-stage/references/env-ziyong.md +1 -1
  236. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +30 -27
  237. package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +2 -6
  238. package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +12 -10
  239. package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +2 -0
  240. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +23 -19
  241. package/skills/weaver-e10-recruit-stage/references/recruit-jd-template.md +3 -1
  242. package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +18 -16
  243. package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +25 -23
  244. package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +10 -10
  245. package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +2 -2
  246. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +11 -11
  247. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +150 -85
  248. package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +14 -18
  249. package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +1 -1
  250. package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +173 -0
  251. package/skills/weaver-e10-recruit-stage/references/recruit-tag-taxonomy.json +76 -0
  252. package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +3 -1
  253. package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +2 -2
  254. package/skills/weaver-e10-workflow/SKILL.md +49 -32
  255. package/skills/weaver-e10-workflow/references/todo-dialogue.md +67 -34
  256. package/skills/weaver-e10-workflow/references/todo-smart-convert.md +65 -51
  257. package/skills/weaver-e10-workflow/references/workflow-agent-entry.md +18 -11
  258. package/skills/weaver-e10-workflow/references/workflow-create.md +2 -2
  259. package/skills/weaver-e10-workflow/references/workflow-memory.md +19 -37
  260. package/skills/weaver-e10-workflow/references/workflow-query.md +25 -22
  261. package/skills/weaver-e10-workflow/references/workflow-view.md +1 -1
  262. package/skills/weaver-e10-workflow/tools/todo-summary.cjs +318 -110
  263. package/skills/weaver-e10-yimiaoban/SKILL.md +17 -14
  264. package/skills/weaver-e10-yimiaoban/references/person.md +1 -1
  265. package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +1 -1
  266. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +9 -9
  267. package/dist/chunks/chunk-6QYNE6HE.js +0 -658
  268. package/dist/chunks/chunk-SHYQUBY3.js +0 -48
  269. package/dist/shortcuts/contract/operations/card-action.js +0 -1266
  270. package/dist/shortcuts/contract/operations/card-plan.js +0 -393
  271. package/dist/shortcuts/contract/operations/card.js +0 -232
  272. package/dist/shortcuts/contract/operations/compare-screen.js +0 -378
  273. package/dist/shortcuts/contract/operations/quote-to-contract.js +0 -495
  274. package/dist/shortcuts/contract/operations/quotescreen.js +0 -529
  275. package/dist/shortcuts/contract/operations/summary-validate.js +0 -293
  276. package/dist/shortcuts/contract/operations/summary.js +0 -187
  277. package/dist/shortcuts/ehr/recruit-stage/batch-store.js +0 -78
  278. package/dist/shortcuts/ehr/recruit-stage/context.js +0 -231
  279. package/dist/shortcuts/ehr/recruit-stage/continuation.js +0 -74
  280. package/dist/shortcuts/ehr/recruit-stage/errors.js +0 -65
  281. package/dist/shortcuts/ehr/recruit-stage/fs-scan.js +0 -165
  282. package/dist/shortcuts/ehr/recruit-stage/host.js +0 -109
  283. package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +0 -1065
  284. package/dist/shortcuts/ehr/recruit-stage/operations/interview-feedback.js +0 -295
  285. package/dist/shortcuts/ehr/recruit-stage/operations/jd-create.js +0 -961
  286. package/dist/shortcuts/ehr/recruit-stage/operations/list.js +0 -431
  287. package/dist/shortcuts/ehr/recruit-stage/operations/registry.js +0 -50
  288. package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +0 -1655
  289. package/dist/shortcuts/ehr/recruit-stage/operations/search.js +0 -158
  290. package/dist/shortcuts/ehr/recruit-stage/operations/types.js +0 -34
  291. package/dist/shortcuts/ehr/recruit-stage/runtime.js +0 -31
  292. package/dist/shortcuts/ehr/recruit-stage/school-tiers.json +0 -318
  293. package/dist/shortcuts/ehr/recruit-stage/shared.js +0 -887
  294. package/skills/weaver-e10-jinchengda/references/contract-action-card-template.html +0 -22
  295. package/skills/weaver-e10-jinchengda/references/contract-action-card.md +0 -554
  296. package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +0 -279
  297. package/skills/weaver-e10-jinchengda/references/contract-card-render-internals.md +0 -483
  298. package/skills/weaver-e10-jinchengda/references/contract-template-selector.md +0 -46
  299. 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
- };