weaver-work-cli 0.1.78 → 0.1.81

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 (250) hide show
  1. package/README.md +3 -1
  2. package/dist/chunks/{archive-ENBSUMHV.js → archive-KVV4SM7J.js} +3 -3
  3. package/dist/chunks/{archive-oa-7BFPQ6M5.js → archive-oa-VRSPNLY4.js} +3 -3
  4. package/dist/chunks/{asset-V5SUD3PW.js → asset-JZ5MN6OL.js} +306 -10
  5. package/dist/chunks/{asset-idle-3CEL7WFX.js → asset-idle-B4SAL43V.js} +3 -3
  6. package/dist/chunks/{attachment-content-TFOC3Y3X.js → attachment-content-7W4XQTA7.js} +3 -3
  7. package/dist/chunks/{blog-FLI4SS3P.js → blog-XCBM467O.js} +3 -3
  8. package/dist/chunks/{caizhilian-7WCTKCCP.js → caizhilian-NZVUKCZD.js} +5 -5
  9. package/dist/chunks/{calendar-G726HUUH.js → calendar-OVM2SGYJ.js} +3 -3
  10. package/dist/chunks/{chunk-XNN5PZTI.js → chunk-3WZMDOI3.js} +1 -1
  11. package/dist/chunks/{chunk-FAC4IFGQ.js → chunk-56F2GGE4.js} +5 -5
  12. package/dist/chunks/{chunk-LCM5SSGJ.js → chunk-5MM2IZ27.js} +423 -36
  13. package/dist/chunks/{chunk-BWFCTE43.js → chunk-5NQZO3CO.js} +48 -5
  14. package/dist/chunks/{chunk-ZOTXXGUM.js → chunk-5RIK6OLF.js} +7 -7
  15. package/dist/chunks/{chunk-5E2FDXBU.js → chunk-64RYQOXA.js} +1 -1
  16. package/dist/chunks/{chunk-Z44YFIN6.js → chunk-7BP3HU74.js} +2 -2
  17. package/dist/chunks/{chunk-3Q5F4C5B.js → chunk-AW3HQUOC.js} +5 -5
  18. package/dist/chunks/{chunk-7M5OYRK2.js → chunk-BD3M2YVN.js} +3 -3
  19. package/dist/chunks/{chunk-JEQHNNSS.js → chunk-BFVUBCYO.js} +14 -0
  20. package/dist/chunks/{chunk-PAWXVT6H.js → chunk-CLVEXDEJ.js} +4 -5
  21. package/dist/chunks/{chunk-TBCKK6LH.js → chunk-DWCMKEMO.js} +2 -2
  22. package/dist/chunks/{chunk-USYFVIUR.js → chunk-E3XUYWYA.js} +4 -4
  23. package/dist/chunks/{chunk-E2EY3DMS.js → chunk-FIPTUAOW.js} +2 -2
  24. package/dist/chunks/{chunk-IBTGXLOT.js → chunk-GQEIHXY5.js} +6 -6
  25. package/dist/chunks/{chunk-TD5IOEGN.js → chunk-JUPKXW4P.js} +1 -1
  26. package/dist/chunks/{chunk-UZ2E3VNI.js → chunk-KZ3JR3GE.js} +3 -3
  27. package/dist/chunks/{chunk-4PBN7NJY.js → chunk-L2PKMZIU.js} +1 -1
  28. package/dist/chunks/{chunk-DACQKJ6O.js → chunk-LXWWOHM6.js} +4 -4
  29. package/dist/chunks/{chunk-7DE3VMZD.js → chunk-LYFPWZBD.js} +6 -1
  30. package/dist/chunks/{chunk-2UV4IZIT.js → chunk-MTIV6JEN.js} +2 -2
  31. package/dist/chunks/{chunk-5VQ7JHV4.js → chunk-MWFKLXVU.js} +68 -46
  32. package/dist/chunks/{chunk-PMRNIGKZ.js → chunk-RVVRTW4P.js} +2 -2
  33. package/dist/chunks/{chunk-FPWCCRKT.js → chunk-UASZW22U.js} +3 -3
  34. package/dist/chunks/{chunk-RVEKGVZU.js → chunk-VMUVVTT4.js} +2 -2
  35. package/dist/chunks/{chunk-7SQN5IZR.js → chunk-W4BGNYKR.js} +12 -2
  36. package/dist/chunks/{chunk-OVTCWLNQ.js → chunk-W4R3SXJV.js} +15 -7
  37. package/dist/chunks/{chunk-UDBQJLQF.js → chunk-WF5G5SV3.js} +2 -2
  38. package/dist/chunks/{chunk-VNEU7OUN.js → chunk-WM5ZE67G.js} +1 -1
  39. package/dist/chunks/{chunk-QVKRNL7L.js → chunk-WQ4ZHAEZ.js} +10 -2
  40. package/dist/chunks/{chunk-SWFTWNWL.js → chunk-X7OZKI6F.js} +12 -12
  41. package/dist/chunks/{chunk-WNFDR5PC.js → chunk-Y6HRTEDD.js} +21 -11
  42. package/dist/chunks/{chunk-2KW7AI6P.js → chunk-YFDKTTYX.js} +8 -5
  43. package/dist/chunks/{chunk-BP7BONZO.js → chunk-YLPGCOAM.js} +76 -69
  44. package/dist/chunks/{chunk-LQLIXBJF.js → chunk-YXIPZFMX.js} +1 -1
  45. package/dist/chunks/{cli-WA7FOQKC.js → cli-VCQIDBDQ.js} +37 -37
  46. package/dist/chunks/{commands-J52MJ6NF.js → commands-THGXVOEL.js} +9 -5
  47. package/dist/chunks/{conflict-D4GVAURN.js → conflict-T7URCNS6.js} +2 -2
  48. package/dist/chunks/{contract-GW7US3UF.js → contract-ZLGLQ45G.js} +3 -3
  49. package/dist/chunks/{cowork-GZDODGKF.js → cowork-2MBNOUYS.js} +21 -8
  50. package/dist/chunks/{create-flow-ERDGW3FZ.js → create-flow-OFZC36MV.js} +6 -6
  51. package/dist/chunks/{data-HTQZRPPI.js → data-6O7ANJVT.js} +3 -3
  52. package/dist/chunks/{ebuilder-form-GHNIZ7ET.js → ebuilder-form-OJ3KJVQI.js} +4 -4
  53. package/dist/chunks/{ehr-P6T7OAAV.js → ehr-NWMI5Q7S.js} +8 -32
  54. package/dist/chunks/{employee-QX57HEWS.js → employee-O2EPUYIH.js} +2 -2
  55. package/dist/chunks/{entry-mode-SQU5WTX6.js → entry-mode-TVACGU7K.js} +3 -3
  56. package/dist/chunks/{env-DASBNSEM.js → env-EWG4ZAWP.js} +2 -2
  57. package/dist/chunks/{esb-ATRKVHCD.js → esb-56FV2PIA.js} +5 -5
  58. package/dist/chunks/{factory-A3NAKZAA.js → factory-GQSEJRDY.js} +1 -1
  59. package/dist/chunks/{fna-IKYI3SST.js → fna-YLA3RKRW.js} +3 -3
  60. package/dist/chunks/{group-chat-7SEAVAJR.js → group-chat-5R6L3LCG.js} +3 -3
  61. package/dist/chunks/{host-UY4LQPN4.js → host-42MLO4KX.js} +4 -4
  62. package/dist/chunks/{host-XXGDQM7D.js → host-J72VEDW5.js} +4 -4
  63. package/dist/chunks/{host-EJSJSLVK.js → host-QKCRQS2C.js} +4 -4
  64. package/dist/chunks/{host-EYNLB6S4.js → host-W3BVEATN.js} +4 -4
  65. package/dist/chunks/{host-OT4KNR3G.js → host-YJINI5GG.js} +4 -4
  66. package/dist/chunks/{host-6UOXYOOY.js → host-ZVGBZOHY.js} +4 -4
  67. package/dist/chunks/{hrm-5JQ7QZ6A.js → hrm-3JFZNB42.js} +66 -26
  68. package/dist/chunks/{im-2YJW3EI5.js → im-HKIRPCGD.js} +5 -5
  69. package/dist/chunks/{invoice-37HR6L3W.js → invoice-4PREIOTG.js} +185 -49
  70. package/dist/chunks/{jiuchuanhui-KBWUZ7WT.js → jiuchuanhui-K3PLNENZ.js} +3 -3
  71. package/dist/chunks/{lazy-dispatch-ZDKLS5MR.js → lazy-dispatch-MKGEWZNM.js} +8 -8
  72. package/dist/chunks/{mail-YBKUM6HM.js → mail-6QPVWKXM.js} +3 -3
  73. package/dist/chunks/{meeting-7AEQGBAT.js → meeting-QPPEPBSN.js} +20 -16
  74. package/dist/chunks/{minute-doc-REI6RUE4.js → minute-doc-JMIDZK5D.js} +1 -1
  75. package/dist/chunks/{okr-HW7IULIR.js → okr-67C5LQYD.js} +3 -3
  76. package/dist/chunks/{operations-4P2UYVLH.js → operations-YLKRNAPI.js} +5 -5
  77. package/dist/chunks/{org-MWWIFNAO.js → org-L5XDM2RQ.js} +2 -2
  78. package/dist/chunks/{performance-PM2G6L3E.js → performance-33QZZR4I.js} +3 -3
  79. package/dist/chunks/{plan-3YYGZ7ZM.js → plan-W4BPONRL.js} +3 -3
  80. package/dist/chunks/{project-6PRGBLO2.js → project-OKSEH6AF.js} +3 -3
  81. package/dist/chunks/{reception-7G3J2MA6.js → reception-H5M7SPHT.js} +3 -3
  82. package/dist/chunks/{recruit-stage-TLZJUFHD.js → recruit-stage-O2JGNVMO.js} +16 -86
  83. package/dist/chunks/{registry-4S3RXXWS.js → registry-45VEUYTC.js} +4 -4
  84. package/dist/chunks/{registry-3VTB3KLV.js → registry-BMTQ55G5.js} +5 -5
  85. package/dist/chunks/{registry-KQ4TNUWO.js → registry-PYONXFUF.js} +3 -3
  86. package/dist/chunks/{registry-UVTI323K.js → registry-SAMJ4VH2.js} +14 -14
  87. package/dist/chunks/{registry-AC33ZZVH.js → registry-YY62OFKQ.js} +1 -1
  88. package/dist/chunks/{room-recommend-ELEJUYBN.js → room-recommend-NRLAZJCI.js} +4 -4
  89. package/dist/chunks/{schedule-XBKY7VEA.js → schedule-LNBOCBP5.js} +4 -4
  90. package/dist/chunks/{smart-extract-T5Z4AULN.js → smart-extract-JOTX6UZC.js} +3 -3
  91. package/dist/chunks/{update-77ZUIYSG.js → update-BERR64TI.js} +3 -3
  92. package/dist/chunks/{workflow-SYCBS5XD.js → workflow-ZDQY3TI7.js} +5 -5
  93. package/dist/core/runtime-agent.js +19 -3
  94. package/dist/index.js +4 -4
  95. package/dist/internal/e10/auth/agent-host-key.js +10 -1
  96. package/dist/internal/e10/auth/commands.js +20 -4
  97. package/dist/internal/e10/auth/xiaoe.js +15 -3
  98. package/dist/shortcuts/asset/host.js +39 -1
  99. package/dist/shortcuts/asset/index.js +16 -2
  100. package/dist/shortcuts/asset/manifest.js +115 -1
  101. package/dist/shortcuts/asset/operations/audit-report.js +144 -0
  102. package/dist/shortcuts/asset/operations/registry.js +4 -0
  103. package/dist/shortcuts/asset/operations/write.js +7 -1
  104. package/dist/shortcuts/cowork/operations/read.js +13 -6
  105. package/dist/shortcuts/cowork/operations/shared.js +15 -0
  106. package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +1 -14
  107. package/dist/shortcuts/ehr/operations/recruit-write.js +4 -24
  108. package/dist/shortcuts/ehr/operations/recruit.js +23 -13
  109. package/dist/shortcuts/hrm/host.js +51 -4
  110. package/dist/shortcuts/hrm/index.js +45 -26
  111. package/dist/shortcuts/hrm/manifest.js +17 -0
  112. package/dist/shortcuts/hrm/operations/employee.js +3 -7
  113. package/dist/shortcuts/hrm/operations/org.js +2 -4
  114. package/dist/shortcuts/hrm/operations/position.js +2 -4
  115. package/dist/shortcuts/hrm/operations/shared.js +21 -0
  116. package/dist/shortcuts/hrm/operations.js +34 -0
  117. package/dist/shortcuts/im/constants.js +163 -0
  118. package/dist/shortcuts/im/host.js +12 -5
  119. package/dist/shortcuts/im/operations/at-mention.js +4 -2
  120. package/dist/shortcuts/im/operations/file-user.js +3 -1
  121. package/dist/shortcuts/im/operations/msg-sync.js +219 -2
  122. package/dist/shortcuts/im/operations/msg-write.js +70 -30
  123. package/dist/shortcuts/invoice/invoice-record.js +20 -1
  124. package/dist/shortcuts/invoice/manifest.js +13 -7
  125. package/dist/shortcuts/invoice/operations/reim-auto.js +94 -36
  126. package/dist/shortcuts/invoice/projection.js +7 -3
  127. package/dist/shortcuts/invoice/read-enrichment.js +78 -8
  128. package/dist/shortcuts/meeting/host.js +4 -0
  129. package/dist/shortcuts/meeting/operations/eb/create-flow.js +45 -5
  130. package/dist/shortcuts/meeting/operations/env.js +15 -1
  131. package/dist/shortcuts/meeting/operations/rooms.js +7 -0
  132. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +3 -22
  133. package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +1 -5
  134. package/dist/shortcuts/recruit-stage/operations/list.js +3 -2
  135. package/dist/shortcuts/recruit-stage/operations/profile.js +3 -2
  136. package/dist/shortcuts/recruit-stage/operations/resume-import.js +8 -55
  137. package/dist/shortcuts/recruit-stage/operations/search.js +2 -2
  138. package/dist/shortcuts/recruit-stage/operations/shortlist.js +3 -2
  139. package/dist/shortcuts/recruit-stage/operations/tag.js +5 -0
  140. package/dist/shortcuts/recruit-stage/shared.js +3 -11
  141. package/dist/shortcuts/workflow/operations/form.js +2 -1
  142. package/docs/agent-invoice.md +26 -8
  143. package/docs/e10-auth.md +14 -1
  144. package/docs/hrm.md +5 -1
  145. package/docs/invoice.md +28 -8
  146. package/docs/operation-manual.md +6 -4
  147. package/docs/ziguanjia.md +5 -1
  148. package/package.json +1 -1
  149. package/scripts/package-skill.mjs +14 -2
  150. package/skill-template/business-info.json +6 -1
  151. package/skill-template/domains/hrm.md +1 -1
  152. package/skill-template/domains/yepiaotong.md +29 -11
  153. package/skill-template/domains/ziguanjia.md +7 -2
  154. package/skills/weaver-e10-caizhilian/references/source-manifest.json +3 -3
  155. package/skills/weaver-e10-cowork/SKILL.md +13 -1
  156. package/skills/weaver-e10-hrm/SKILL.md +16 -2
  157. package/skills/weaver-e10-hrm/references/org.md +1 -1
  158. package/skills/weaver-e10-jucailin/SKILL.md +11 -12
  159. package/skills/weaver-e10-jucailin/agents/openai.yaml +4 -4
  160. package/skills/weaver-e10-jucailin/references/recruit-implement-consult-sop.md +1 -1
  161. package/skills/weaver-e10-jucailin/references/recruit-implement-kb-data-update-channels.md +1 -1
  162. package/skills/weaver-e10-jucailin/references/recruit-implement-kb-talent-base-form.md +1 -1
  163. package/skills/weaver-e10-jucailin/references/recruit-output-links.md +1 -2
  164. package/skills/weaver-e10-jucailin/references/recruit-read.md +5 -27
  165. package/skills/weaver-e10-jucailin/references/recruit-write.md +19 -21
  166. package/skills/weaver-e10-jucailin/references/safety-boundaries.md +2 -2
  167. package/skills/weaver-e10-mail/SKILL.md +11 -3
  168. package/skills/weaver-e10-mail/references/mail-agent-entry.md +1 -1
  169. package/skills/weaver-e10-meeting/SKILL.md +39 -1
  170. package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
  171. package/skills/weaver-e10-plan/references/source-manifest.json +3 -3
  172. package/skills/weaver-e10-recruit-stage/SKILL.md +57 -42
  173. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +27 -22
  174. package/skills/weaver-e10-recruit-stage/lib/interview-conflict.mjs +1 -1
  175. package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +20 -5
  176. package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +96 -22
  177. package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +8 -3
  178. package/skills/weaver-e10-recruit-stage/lib/report-attachment.mjs +7 -6
  179. package/skills/weaver-e10-recruit-stage/lib/resume-import-once.mjs +308 -0
  180. package/skills/weaver-e10-recruit-stage/references/env-ziyong.md +2 -2
  181. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +6 -7
  182. package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +5 -5
  183. package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +4 -5
  184. package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +2 -8
  185. package/skills/weaver-e10-recruit-stage/references/recruit-jd-template.md +0 -2
  186. package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +1 -2
  187. package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +7 -5
  188. package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +2 -2
  189. package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +3 -3
  190. package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +20 -21
  191. package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +12 -7
  192. package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +2 -3
  193. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +1 -3
  194. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +75 -52
  195. package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +11 -17
  196. package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +1 -1
  197. package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +3 -4
  198. package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +456 -93
  199. package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +2 -2
  200. package/skills/weaver-e10-recruit-stage/templates/match-report.html +1 -1
  201. package/skills/weaver-e10-shared/SKILL.md +1 -1
  202. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +1 -1
  203. package/skills/weaver-e10-shared-report.html +874 -0
  204. package/skills/weaver-e10-shijingran/references/source-manifest.json +3 -3
  205. package/skills/weaver-e10-skill-maker/references/post-generation-install.md +6 -0
  206. package/skills/weaver-e10-workflow/SKILL.md +4 -4
  207. package/skills/weaver-e10-workflow/aiDeepRead/config.json +138 -142
  208. package/skills/weaver-e10-workflow/references/workflow-deep-read.md +7 -7
  209. package/skills/weaver-e10-yepiaotong/SKILL.md +33 -21
  210. package/skills/weaver-e10-yepiaotong/references/invoice-add.md +2 -2
  211. package/skills/weaver-e10-yepiaotong/references/invoice-agent-entry.md +5 -1
  212. package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +2 -0
  213. package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +2 -0
  214. package/skills/weaver-e10-yepiaotong/references/invoice-file-upload.md +3 -1
  215. package/skills/weaver-e10-yepiaotong/references/invoice-import.md +2 -2
  216. package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +30 -2
  217. package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +8 -0
  218. package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +4 -4
  219. package/skills/weaver-e10-yepiaotong/references/name-fuzzy-search.md +3 -3
  220. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +19 -9
  221. package/skills/weaver-e10-yepiaotong/references/reim-customer-search.md +25 -32
  222. package/skills/weaver-e10-yepiaotong/references/reim-eligibility-rules.md +70 -21
  223. package/skills/weaver-e10-yepiaotong/references/reim-fill-validation.md +23 -12
  224. package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +52 -17
  225. package/skills/weaver-e10-yepiaotong/references/reim-preapproval-rules.md +23 -19
  226. package/skills/weaver-e10-yepiaotong/references/reim-travel-invoice-matching.md +6 -4
  227. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +127 -63
  228. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +89 -71
  229. package/skills/weaver-e10-yepiaotong/references/travel-application-fill.md +2 -2
  230. package/skills/weaver-e10-yepiaotong/references/workflow-direct-fill.md +28 -20
  231. package/skills/weaver-e10-yepiaotong.zip +0 -0
  232. package/skills/weaver-e10-yimiaoban/SKILL.md +12 -9
  233. package/skills/weaver-e10-yimiaoban/references/constants.md +291 -0
  234. package/skills/weaver-e10-yimiaoban/references/ding-write.md +1 -0
  235. package/skills/weaver-e10-yimiaoban/references/group-read.md +1 -0
  236. package/skills/weaver-e10-yimiaoban/references/group-write.md +1 -0
  237. package/skills/weaver-e10-yimiaoban/references/msg-read.md +10 -1
  238. package/skills/weaver-e10-yimiaoban/references/msg-write.md +3 -1
  239. package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +1 -0
  240. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +175 -36
  241. package/skills/weaver-e10-ziguanjia/SKILL.md +26 -6
  242. package/skills/weaver-e10-ziguanjia/references/source-manifest.json +1373 -96
  243. package/skills/weaver-e10-ziguanjia/references/ziguanjia-audit.md +63 -0
  244. package/skills/weaver-e10-ziguanjia/references/ziguanjia-disabled-capabilities.md +5 -1
  245. package/skills/weaver-e10-ziguanjia/references/ziguanjia-idle.md +52 -0
  246. package/skills/weaver-e10-ziguanjia/references/ziguanjia-report.md +59 -0
  247. package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
  248. package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
  249. package/scripts/pysite/__pycache__/sitecustomize.cpython-314.pyc +0 -0
  250. package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +0 -89
@@ -41,23 +41,9 @@ async function requireRecruitCache(env) {
41
41
  }
42
42
  return env.recruitContext.load(env.host);
43
43
  }
44
- // ── 产物链接(2026-10-29 周军锋要求:写操作完成后自动生成链接返回对话框)──
45
- // URL 模板与 recruit-stage 同源:详情单页 /sp/ebdpage/view/{ebdDetailPageId}?talentId=(实证)或 /sp/ebdfpage/card/0/{objId}/{dataId};
44
+ // ── 产物链接 ──
45
+ // 人才卡片地址一律由技能侧固定路由表产出;CLI 不回传任何原生明细页地址(2026-12-01 收口)。
46
46
  // 列表 /sp/ebdfpage/list/{listId} —— **只打开列表**(2026-11-06 用户定稿)。
47
- // 停用旧「列表 + 滑出详情」形态 .../list/{listId}/card/0/{objId}/{dataId}/...:它会在打开列表时一同打开记录详情单页。
48
- // 详情与列表由两个独立链接分别给出;listId 取环境缓存,id 缺失返回 null 不编造。
49
- function recruitTalentCardUrl(cache, baseUrl, talentId) {
50
- if (!talentId)
51
- return null;
52
- const base = baseUrl.replace(/\/+$/, "");
53
- if (cache.ebdDetailPageId) {
54
- const extra = String(cache.selfUse) === "1" ? "&recruitType=useSelf" : "";
55
- return `${base}/sp/ebdpage/view/${cache.ebdDetailPageId}?talentId=${talentId}${extra}`;
56
- }
57
- // 缓存缺页面 id 时退化为 EB 卡片单页,objId 运行时解析,禁止返回 null
58
- const objId = String(cache.forms?.talent_pool?.objId || cache.forms?.talent?.objId || "");
59
- return objId ? `${base}/sp/ebdfpage/card/0/${objId}/${talentId}` : null;
60
- }
61
47
  /** 只打开列表页:不带 /card/... 段、不带记录 id query,避免一同滑出详情单页。 */
62
48
  function recruitOpenListUrl(cache, baseUrl, listKey) {
63
49
  const menu = cache.lists?.[listKey];
@@ -660,8 +646,6 @@ const candidateCreateApply = {
660
646
  talentId: newId,
661
647
  initTalentBatch: initMsg,
662
648
  searchHint: `可用 ehr.recruit.candidate.search 按 name=${name} 或 mobile=${mobile} 回查`,
663
- talentCardUrl: recruitTalentCardUrl(cache, lease.baseUrl, newId),
664
- talentListLocateUrl: recruitOpenListUrl(cache, lease.baseUrl, 'talent'),
665
649
  });
666
650
  },
667
651
  };
@@ -1162,7 +1146,6 @@ const interviewArrangeApply = {
1162
1146
  candidate: `${plan.candidateName}(talentId=${args.talentId})`,
1163
1147
  time: plan.interviewTime,
1164
1148
  interviewer: plan.interviewer,
1165
- talentCardUrl: recruitTalentCardUrl(cache, lease.baseUrl, args.talentId),
1166
1149
  interviewLocateUrl: recruitOpenListUrl(cache, lease.baseUrl, 'interview'),
1167
1150
  });
1168
1151
  },
@@ -1416,7 +1399,6 @@ const offerSendApply = {
1416
1399
  sendOffer: 'SUCCESS',
1417
1400
  runEsb: { successNum: esbResult.successNum, failNum: esbResult.failNum, msg: esbResult.successMsg },
1418
1401
  nextStep: '回查 offer_status_select 应已变更为「已发送待反馈」',
1419
- talentCardUrl: recruitTalentCardUrl(cache, lease.baseUrl, payload.talentId),
1420
1402
  offerListUrl: recruitOpenListUrl(cache, lease.baseUrl, 'offer'),
1421
1403
  });
1422
1404
  },
@@ -1923,8 +1905,7 @@ const feedbackEditApply = {
1923
1905
  verify: backFeedback
1924
1906
  ? { result: backFeedback.result, comment: backFeedback.judgement, changed }
1925
1907
  : '回查未取到该反馈',
1926
- ...(changed ? {} : { warning: '回查未确认变更生效,请人工在 E10 中核对面试反馈,禁止自动重试' }),
1927
- talentCardUrl: recruitTalentCardUrl(cache, lease.baseUrl, payload.talentId),
1908
+ ...(changed ? {} : { warning: '回查未确认变更生效,请人工在 E10 中核对面试反馈,禁止自动重试' })
1928
1909
  });
1929
1910
  },
1930
1911
  };
@@ -2064,8 +2045,7 @@ const feedbackUrgeApply = {
2064
2045
  return ehrSuccess('ehr.recruit.candidate.interview.feedback.urge.apply', {
2065
2046
  status: 'COMPLETE',
2066
2047
  feedbackRecordId: payload.feedbackRecordId,
2067
- runEsb: { successNum: esbResult.successNum, failNum: esbResult.failNum, msg: esbResult.successMsg },
2068
- talentCardUrl: recruitTalentCardUrl(cache, lease.baseUrl, payload.talentId),
2048
+ runEsb: { successNum: esbResult.successNum, failNum: esbResult.failNum, msg: esbResult.successMsg }
2069
2049
  });
2070
2050
  },
2071
2051
  };
@@ -125,11 +125,30 @@ const LIST_KEYWORDS = {
125
125
  demand: ['招聘需求', '需求'],
126
126
  position: ['招聘职位', '职位列表', '职位管理'],
127
127
  entry: ['入职管理'],
128
- offer: ['录用管理', 'offer管理', 'offer'],
128
+ // 🔴 2026-12-01 修正:不要出现裸 'offer'——includes 会先命中「offer设置」(配置表),
129
+ // 把「录用台账查询」变成读配置。台账在标准环境叫「录用管理」,自用环境叫「offer发放」。
130
+ offer: ['录用管理', 'offer发放', 'offer管理'],
129
131
  interview: ['面试管理', '面试安排列表', '面试安排'],
130
132
  candidate: ['应聘者', '候选人', '应聘批次', '应聘管理'],
131
133
  biz_config: ['业务配置映射表'],
132
134
  };
135
+ /** 同名但语义相反的菜单:匹配前先排除(offer 设置是配置表,不是录用台账)。 */
136
+ const LIST_EXCLUDE_KEYWORDS = {
137
+ offer: ['offer设置', 'offer配置', '录用设置'],
138
+ };
139
+ /** 从菜单树里挑出某业务对应的列表入口:先排除语义相反的菜单,再「完全等值优先」、包含匹配兜底。 */
140
+ export function pickListMenu(searchMenus, biz) {
141
+ const keywords = LIST_KEYWORDS[biz] || [];
142
+ const excludes = LIST_EXCLUDE_KEYWORDS[biz] || [];
143
+ const usable = searchMenus.filter((menu) => {
144
+ const name = (menu.menuName || '').trim();
145
+ return !excludes.some((bad) => name.includes(bad));
146
+ });
147
+ const exact = usable.find((menu) => keywords.some((keyword) => (menu.menuName || '').trim() === keyword));
148
+ if (exact)
149
+ return exact;
150
+ return usable.find((menu) => keywords.some((keyword) => (menu.menuName || '').includes(keyword))) || null;
151
+ }
133
152
  /** 列表类型 -> 缓存键 + 表单逻辑名(candidate.list 四列表映射,同 recruit-list.mjs TYPES) */
134
153
  export const LIST_TYPES = {
135
154
  demand: { listKey: 'demand', formType: 'demand_manage', title: '招聘需求' },
@@ -438,13 +457,8 @@ async function resolveRecruitMenus(host, appId) {
438
457
  biz_config: searchMenus.find((m) => (m.menuName || '').trim() === '业务配置映射表') || null,
439
458
  all_search: searchMenus, pages,
440
459
  };
441
- for (const [biz, keywords] of Object.entries(LIST_KEYWORDS)) {
442
- for (const menu of searchMenus) {
443
- if (keywords.some((keyword) => (menu.menuName || '').includes(keyword))) {
444
- lists[biz] = menu;
445
- break;
446
- }
447
- }
460
+ for (const biz of Object.keys(LIST_KEYWORDS)) {
461
+ lists[biz] = pickListMenu(searchMenus, biz);
448
462
  }
449
463
  if (!menuFailed && flat.length > 0
450
464
  && Object.keys(LIST_KEYWORDS).filter((k) => k !== 'biz_config').every((k) => !lists[k])) {
@@ -1624,13 +1638,9 @@ const candidateCard = {
1624
1638
  const workRows = rowsWith('co_name');
1625
1639
  const eduRows = rowsWith('school');
1626
1640
  const projectRows = rowsWith('pj_name');
1627
- const baseUrl = (await env.host.getSession()).baseUrl.replace(/\/+$/, '');
1628
1641
  return ehrSuccess('ehr.recruit.candidate.card', {
1629
1642
  talentId: id,
1630
- cardLink: cache.ebdDetailPageId
1631
- // selfUse 缓存值为字符串 "0"/"1",必须 === '1'(字符串 "0" truthy 会误拼 recruitType)
1632
- ? `${baseUrl}/sp/ebdpage/view/${cache.ebdDetailPageId}?talentId=${id}${String(cache.selfUse ?? '') === '1' ? '&recruitType=useSelf' : ''}`
1633
- : null,
1643
+ // 人才卡片地址由技能侧固定路由产出(2026-12-01 收口):本回包不输出任何卡片链接字段,避免 AI 搬运原生旧页。
1634
1644
  baseInfo: {
1635
1645
  name: talent?.hrm?.name,
1636
1646
  mobile: talent?.telephone,
@@ -39,6 +39,29 @@ function businessCode(value) {
39
39
  return code;
40
40
  return undefined;
41
41
  }
42
+ /**
43
+ * 飞书审计 H-01:E10 侧「接口未装配 / 本租户未开通」的典型服务端文案。
44
+ * 实测 employee.detail / org.detail 回「系统内部错误」、subordinate.by-id 回「没有权限」,
45
+ * 原样抛出去用户只看到一句「系统内部错误」,无法自助判断该找谁。
46
+ * 这里把这类服务端失败改写成可操作的提示,原始文案保留在 `details.message` 便于排查。
47
+ */
48
+ const UNAVAILABLE_MESSAGE = /系统内部错误|接口标识不存在|接口不存在|接口未实现|未装配|尚未启用/;
49
+ const PERMISSION_MESSAGE = /没有权限|无权限|权限不足|未授权/;
50
+ /**
51
+ * `confirmed=true` 表示服务端文案已明确指向「未装配 / 未开通」(如「接口标识不存在」);
52
+ * 仅凭 HTTP 500 不能下这个结论,因此 `confirmed=false` 时如实写成两种可能,避免误导。
53
+ */
54
+ function operationUnavailableMessage(operation, confirmed = false) {
55
+ const scope = operation ? `(${operation})` : '';
56
+ const cause = confirmed
57
+ ? 'E10 服务端未装配或未开通对应接口'
58
+ : 'E10 服务端返回 HTTP 500(可能是对应接口未装配 / 未开通,也可能是服务端临时故障)';
59
+ return `组织管理查询能力${scope}在当前租户不可用:${cause}。请联系管理员确认本租户已开通组织管理模块、并装配对应的 ebuilder / ESB 应用后重试。这不是 CLI 参数或会话问题;若为临时故障可稍后重试。`;
60
+ }
61
+ function permissionDeniedMessage(rawMessage, operation) {
62
+ const scope = operation ? `(${operation})` : '';
63
+ return `当前账号缺少该组织数据的可见范围${scope}:${rawMessage}。请联系管理员为当前账号开启组织管理读接口 / 对应组织数据可见范围后重试。CLI 参数与会话均正常,重试不会成功。`;
64
+ }
42
65
  function assertPath(requestPath) {
43
66
  if (typeof requestPath !== 'string' || !requestPath.startsWith('/') || requestPath.startsWith('//')) {
44
67
  throw hrmValidationError('path_invalid', '请求路径必须是相对绝对路径');
@@ -120,6 +143,14 @@ export function createHrmHost(ctx, dependencies = {}) {
120
143
  }
121
144
  if (response.parseError) {
122
145
  if (response.status < 200 || response.status >= 300) {
146
+ // 500 且正文不是 JSON:多半是网关层直接报「接口不存在 / 系统内部错误」。
147
+ if (response.status === 500) {
148
+ throw new HrmCliError('api', 'operation_unavailable', operationUnavailableMessage(operation), {
149
+ code: response.status,
150
+ details: { status: response.status },
151
+ exitCode: 1,
152
+ });
153
+ }
123
154
  throw new HrmCliError('api', 'http_error', `泛微接口 HTTP ${response.status}`, {
124
155
  code: response.status,
125
156
  details: { status: response.status },
@@ -129,18 +160,34 @@ export function createHrmHost(ctx, dependencies = {}) {
129
160
  throw hrmNetworkError('protocol', `接口返回不是合法 JSON(HTTP ${response.status})`, { retryable: false });
130
161
  }
131
162
  if (response.status < 200 || response.status >= 300) {
163
+ const rawMessage = businessMessage(response.value);
164
+ const confirmedUnavailable = UNAVAILABLE_MESSAGE.test(rawMessage);
165
+ if (response.status === 500 || confirmedUnavailable) {
166
+ throw new HrmCliError('api', 'operation_unavailable', operationUnavailableMessage(operation, confirmedUnavailable), { code: response.status, details: { status: response.status, message: rawMessage }, exitCode: 1 });
167
+ }
168
+ if (response.status === 403 || PERMISSION_MESSAGE.test(rawMessage)) {
169
+ throw new HrmCliError('api', 'permission_denied', permissionDeniedMessage(rawMessage, operation), {
170
+ code: response.status,
171
+ details: { status: response.status, message: rawMessage },
172
+ exitCode: 1,
173
+ });
174
+ }
132
175
  throw new HrmCliError('api', 'http_error', `泛微接口 HTTP ${response.status}`, {
133
176
  code: response.status,
134
- details: { status: response.status, message: businessMessage(response.value) },
177
+ details: { status: response.status, message: rawMessage },
135
178
  exitCode: 1,
136
179
  });
137
180
  }
138
181
  if (!isBusinessSuccess(response.value)) {
139
182
  const code = businessCode(response.value);
140
183
  const message = businessMessage(response.value);
141
- // 403 = AI 开放接口 / HRM 读权限未开启,提示明确处置而非盲目重试。
142
- if (code === 403) {
143
- throw new HrmCliError('api', 'permission_denied', message || '当前租户未开启组织管理读接口,请联系管理员开启后再试', {
184
+ // 403 = AI 开放接口 / HRM 读权限未开启;「没有权限」也可能藏在 HTTP 200 的 WeaResult 里。
185
+ if (code === 403 || PERMISSION_MESSAGE.test(message)) {
186
+ throw new HrmCliError('api', 'permission_denied', permissionDeniedMessage(message || '当前账号无该组织数据的访问权限', operation), { code, details: { code, message }, exitCode: 1 });
187
+ }
188
+ // 500 / 「系统内部错误」/「接口标识不存在」= 服务端未装配或未开通,不要原样抛给用户。
189
+ if (UNAVAILABLE_MESSAGE.test(message)) {
190
+ throw new HrmCliError('api', 'operation_unavailable', operationUnavailableMessage(operation, true), {
144
191
  code,
145
192
  details: { code, message },
146
193
  exitCode: 1,
@@ -122,6 +122,49 @@ function failureEnvelope(error) {
122
122
  error: toErrorEnvelope(error),
123
123
  };
124
124
  }
125
+ /** 首屏最多展示几条 withheld 摘要;超出的用 withheldTruncated 提示去看 --full。 */
126
+ const WITHHELD_BRIEF_MAX = 6;
127
+ const WITHHELD_REASON_MAX_CHARS = 80;
128
+ /**
129
+ * `hrm schema` 的默认精简首屏。
130
+ *
131
+ * 2026-11-30 飞书审计 HR-02:原先首屏只给 operations,模型看不到任何「不支持什么」,
132
+ * 遇到组织变更/岗位调整等诉求只能试错。这里与全局 G-10 对齐:先给 withheldCount,
133
+ * 再给最多 6 条 name + 截断 reason(与 `manifestView --list` 的 80 字口径一致),
134
+ * 完整原因走 `hrm schema --full`。
135
+ */
136
+ export function hrmSchemaBrief() {
137
+ const withheld = hrmManifest.withheldOperations;
138
+ return {
139
+ schemaVersion: hrmManifest.schemaVersion,
140
+ name: hrmManifest.name,
141
+ version: hrmManifest.version,
142
+ withheldCount: withheld.length,
143
+ withheldOperations: withheld.slice(0, WITHHELD_BRIEF_MAX).map((item) => ({
144
+ name: item.name,
145
+ reason: item.reason.length > WITHHELD_REASON_MAX_CHARS
146
+ ? `${item.reason.slice(0, WITHHELD_REASON_MAX_CHARS)}…`
147
+ : item.reason,
148
+ })),
149
+ ...(withheld.length > WITHHELD_BRIEF_MAX ? { withheldTruncated: true } : {}),
150
+ operations: hrmManifest.operations.map((o) => {
151
+ const anyOf = Array.isArray(o.inputSchema?.anyOf) ? o.inputSchema.anyOf : null;
152
+ // 查询类的「至少一个收敛条件」用 inputSchema.anyOf 表达,精简视图原先只打印
153
+ // required(=[]),看起来像「无需入参」,实测空入参会被 E-0003 empty_condition 拒。
154
+ const atLeastOne = anyOf
155
+ ? [...new Set(anyOf.flatMap((branch) => branch?.required ?? []))]
156
+ : [];
157
+ return {
158
+ name: o.name,
159
+ summary: o.summary,
160
+ risk: o.risk,
161
+ params: Object.keys(o.inputSchema?.properties ?? {}),
162
+ required: o.inputSchema?.required ?? [],
163
+ ...(atLeastOne.length ? { atLeastOne } : {}),
164
+ };
165
+ }),
166
+ };
167
+ }
125
168
  async function executeAndPrint(ctx, operation, input) {
126
169
  try {
127
170
  const result = await executeHrmOperation(operation, input, {
@@ -159,32 +202,8 @@ export const hrmShortcut = {
159
202
  ctx.output.write(hrmManifest, { json: true });
160
203
  return;
161
204
  }
162
- // 精简版:name + summary + 参数名 + 必填项,供 Agent 快速路由,避免全量 schema 撑爆上下文。
163
- //
164
- // `atLeastOne`:查询类的「至少一个收敛条件」用 inputSchema.anyOf 表达,
165
- // 精简视图原先只打印 required(=[]),看起来像「无需入参」,实测空入参会被
166
- // E-0003 empty_condition 拒(hrm.employee.query / org.query / position.query)。
167
- // 这里把 anyOf 各分支的 required 并成扁平列表回给调用方,避免再靠报错反推。
168
- const brief = {
169
- schemaVersion: hrmManifest.schemaVersion,
170
- name: hrmManifest.name,
171
- version: hrmManifest.version,
172
- operations: hrmManifest.operations.map((o) => {
173
- const anyOf = Array.isArray(o.inputSchema?.anyOf) ? o.inputSchema.anyOf : null;
174
- const atLeastOne = anyOf
175
- ? [...new Set(anyOf.flatMap((branch) => branch?.required ?? []))]
176
- : [];
177
- return {
178
- name: o.name,
179
- summary: o.summary,
180
- risk: o.risk,
181
- params: Object.keys(o.inputSchema?.properties ?? {}),
182
- required: o.inputSchema?.required ?? [],
183
- ...(atLeastOne.length ? { atLeastOne } : {}),
184
- };
185
- }),
186
- };
187
- ctx.output.write(brief, { json: true });
205
+ // 精简版:name + summary + 参数名 + 必填项 + 不支持能力摘要,供 Agent 一次看清可用与不可用边界。
206
+ ctx.output.write(hrmSchemaBrief(), { json: true });
188
207
  }));
189
208
  hrm.command('run')
190
209
  .description('Run an hrm operation with JSON input')
@@ -5,6 +5,12 @@ import { hrmOperationDefinitions } from './operations/registry.js';
5
5
  * - `hrm.org.virtuals`:多维(组织维度)清单**不单独暴露**——维度获取与匹配已并入
6
6
  * `hrm.org.resolve` 内部;「列出该租户有哪些多维」属暂不支持的诉求,
7
7
  * 不要构造一个不存在的维度名去套 `availableVirtuals`,也不要绕过。
8
+ * - `hrm.org.change` / `hrm.position.adjust`:组织变更、岗位调整是**写操作**,本模块
9
+ * 全部为只读查询(见 SKILL.md 首段),不提供任何写能力;替代路径是 E10 界面自助操作。
10
+ *
11
+ * 2026-11-30 飞书审计 HR-02:这份清单原先只用于运行时过滤,模型在 `hrm schema` 首屏
12
+ * 完全看不到,遇到写操作诉求只能试错。现在同时透出 `withheldCount` 与首屏摘要,
13
+ * SKILL.md 也补了「不支持的能力」章节。
8
14
  */
9
15
  const WITHHELD = [
10
16
  {
@@ -15,6 +21,14 @@ const WITHHELD = [
15
21
  name: 'hrm.org.virtuals',
16
22
  reason: '多维(组织维度)清单不单独暴露:维度获取与名称匹配已并入 hrm.org.resolve 内部(其 not_found 会顺带回 availableVirtuals 供纠错)。「列出该租户有哪些多维」暂不支持,不要构造不存在的维度名去套 availableVirtuals,也不要编造或绕过。',
17
23
  },
24
+ {
25
+ name: 'hrm.org.change',
26
+ reason: '组织变更(新增/修改/删除部门、分部)是写操作,本模块全部为只读查询,不提供该能力;替代做法:请到 E10 组织管理界面自助操作,不要编造 hrm 写 operation。',
27
+ },
28
+ {
29
+ name: 'hrm.position.adjust',
30
+ reason: '岗位调整(人员调岗、新增/删除岗位)是写操作,本模块全部为只读查询,不提供该能力;替代做法:请到 E10 组织管理界面自助操作,不要编造 hrm 写 operation。',
31
+ },
18
32
  ];
19
33
  function buildOperations() {
20
34
  return hrmOperationDefinitions().map((definition) => ({
@@ -35,5 +49,8 @@ export const hrmManifest = {
35
49
  sourceSkill: 'weaver-e10-hrm',
36
50
  capabilities: ['employee', 'org', 'position'],
37
51
  operations: buildOperations(),
52
+ // 2026-11-30 飞书审计 HR-02:首屏必须先给总数,模型才知道边界之外还有多少条,
53
+ // 再看摘要或 --full 明细;与其他域 G-10 的口径保持一致。
54
+ withheldCount: WITHHELD.length,
38
55
  withheldOperations: WITHHELD,
39
56
  };
@@ -1,6 +1,6 @@
1
1
  import { HrmCliError, hrmValidationError } from '../errors.js';
2
2
  import { READ, SCHEMA_ID, SCHEMA_ID_LIST, SCHEMA_PAGE, hrmSuccess, schemaOf, } from './types.js';
3
- import { browserBaseBody, inferEmployeeField, orgLink, personLink, resolveDepartmentIdByName, toNumber, toPositiveInt, toStringIdList, } from './shared.js';
3
+ import { browserBaseBody, inferEmployeeField, orgLink, personLink, requireId, resolveDepartmentIdByName, toNumber, toPositiveInt, toStringIdList, } from './shared.js';
4
4
  const EMPLOYEE_STATUS = ['normal', '6'];
5
5
  const SUBORDINATE_SCOPE = ['direct', 'indirect', 'all'];
6
6
  const SUBORDINATE_BYID_SCOPE = ['direct', 'indirect'];
@@ -385,9 +385,7 @@ const employeeDetail = {
385
385
  full: { type: 'boolean', description: '默认 false:只回核心业务字段(姓名/工号/组织/岗位/上级/助理/联系方式/办公地点等,体积约为完整卡片的 1/5);true:回完整人员卡片(含 password、last_android、hideFieldList、setting、*_admin 等登录/管理元数据)' },
386
386
  }, { required: ['id'] }),
387
387
  handler: async (args, { host }) => {
388
- const id = String(args.id).trim();
389
- if (!id)
390
- throw hrmValidationError('id_required', 'id 必填');
388
+ const id = requireId(args.id);
391
389
  const session = await host.getSession();
392
390
  const baseUrl = session.baseUrl.replace(/\/+$/, '');
393
391
  // readOnly=true 必需:非只读且非本人/非基础信息管理员时服务端会拒绝(checkCardHasRight)。
@@ -463,9 +461,7 @@ const subordinateById = {
463
461
  pageSize: { ...SCHEMA_ID, description: '每页条数,默认 10' },
464
462
  }, { required: ['id'] }),
465
463
  handler: async (args, { host }) => {
466
- const id = String(args.id).trim();
467
- if (!id)
468
- throw hrmValidationError('id_required', 'id 必填');
464
+ const id = requireId(args.id);
469
465
  const scope = args.scope === undefined ? 'direct' : String(args.scope);
470
466
  const path = scope === 'indirect'
471
467
  ? `/api/bs/hrm/user/myIndirectSubordinates/${id}`
@@ -1,6 +1,6 @@
1
1
  import { hrmValidationError } from '../errors.js';
2
2
  import { READ, SCHEMA_ID, SCHEMA_PAGE, hrmSuccess, schemaOf, } from './types.js';
3
- import { browserBaseBody, orgLink, pickDefined, toNumber, toPositiveInt, toStringIdList, } from './shared.js';
3
+ import { browserBaseBody, orgLink, pickDefined, requireId, toNumber, toPositiveInt, toStringIdList, } from './shared.js';
4
4
  const ORG_TYPES = ['subcompany', 'department'];
5
5
  /**
6
6
  * 组织浏览接口(分部 subcompany / 部门 department)统一入口。
@@ -98,9 +98,7 @@ const orgDetail = {
98
98
  risk: READ,
99
99
  inputSchema: schemaOf({ id: SCHEMA_ID }, { required: ['id'] }),
100
100
  handler: async (args, { host }) => {
101
- const id = String(args.id).trim();
102
- if (!id)
103
- throw hrmValidationError('id_required', 'id 必填');
101
+ const id = requireId(args.id);
104
102
  const session = await host.getSession();
105
103
  const baseUrl = session.baseUrl.replace(/\/+$/, '');
106
104
  const resp = await host.request({
@@ -1,6 +1,6 @@
1
1
  import { hrmValidationError } from '../errors.js';
2
2
  import { READ, SCHEMA_ID, hrmSuccess, schemaOf, } from './types.js';
3
- import { positionLink, toNumber, } from './shared.js';
3
+ import { positionLink, requireId, toNumber, } from './shared.js';
4
4
  /** 岗位浏览按钮 formDatas 7 字段默认算子声明(录制原样;快捷搜索时保持占位)。 */
5
5
  function positionFormDatas() {
6
6
  const d = {};
@@ -92,9 +92,7 @@ const positionDetail = {
92
92
  risk: READ,
93
93
  inputSchema: schemaOf({ id: SCHEMA_ID }, { required: ['id'] }),
94
94
  handler: async (args, { host }) => {
95
- const id = String(args.id).trim();
96
- if (!id)
97
- throw hrmValidationError('id_required', 'id 必填');
95
+ const id = requireId(args.id);
98
96
  const session = await host.getSession();
99
97
  const baseUrl = session.baseUrl.replace(/\/+$/, '');
100
98
  const resp = await host.request({
@@ -36,6 +36,27 @@ export function toPositiveInt(value, field) {
36
36
  }
37
37
  return truncated;
38
38
  }
39
+ /**
40
+ * 必填 ID 归一化:缺失 / 空白 → `${field}_required`,非纯数字 → `${field}_invalid`。
41
+ *
42
+ * 禁止再写 `String(args.id).trim()` 后判空——`String(undefined)` 得到的是字符串
43
+ * `"undefined"`(truthy),判空永远不触发,最终把 `.../undefined` 打到上游拿到 500
44
+ * 「系统内部错误」,把「用户没传参数」误报成「系统故障」。
45
+ * 长整型 id 一律按字符串返回,避免精度丢失。
46
+ */
47
+ export function requireId(value, field = 'id') {
48
+ if (value === undefined || value === null) {
49
+ throw hrmValidationError(`${field}_required`, `${field} 必填(E10 长整型 id,按字符串传递)`);
50
+ }
51
+ const text = typeof value === 'string' ? value.trim() : String(value).trim();
52
+ if (text === '') {
53
+ throw hrmValidationError(`${field}_required`, `${field} 必填(E10 长整型 id,按字符串传递)`);
54
+ }
55
+ if (!/^\d+$/.test(text)) {
56
+ throw hrmValidationError(`${field}_invalid`, `${field} 必须是数字 id,收到 ${JSON.stringify(text)}`);
57
+ }
58
+ return text;
59
+ }
39
60
  /** ID 归一化为字符串数组。长整型 id 一律按字符串传递,避免精度丢失。 */
40
61
  export function toStringIdList(value, field) {
41
62
  if (value === undefined || value === null)
@@ -1,9 +1,43 @@
1
1
  import { getHrmOperation } from './operations/registry.js';
2
2
  import { assertNoForbiddenKeys, asObject } from './operations/shared.js';
3
+ import { hrmValidationError } from './errors.js';
4
+ /** 值是否「等于没传」:undefined / null / 纯空白字符串。 */
5
+ function isMissing(value) {
6
+ if (value === undefined || value === null)
7
+ return true;
8
+ return typeof value === 'string' && value.trim() === '';
9
+ }
10
+ /**
11
+ * 入口层必填校验。
12
+ *
13
+ * `inputSchema` 只是给 Agent / `hrm schema` 看的文档,**不参与运行时校验**
14
+ * (见 operations/types.ts 的注释)。此前所有参数校验都靠各 handler 自己写,
15
+ * 一旦写成 `String(args.id).trim()`,`String(undefined) === 'undefined'` 就会
16
+ * 绕过判空、把 `/api/.../undefined` 打到上游并换回 500「系统内部错误」(E-9999),
17
+ * 让「参数缺失」伪装成「系统故障」(2026-12-01 审计反馈的 4 个 detail 类操作)。
18
+ *
19
+ * 这里按 schema 的 `required` 兜一层:缺参在任何 HTTP 请求发出前就以
20
+ * validation 错误(E-0003 / 退出码 2)拒绝。`anyOf`「至少一个收敛条件」仍由
21
+ * 各 handler 给出更具体的提示(如 empty_condition),不在入口重复判定。
22
+ */
23
+ function assertRequiredInput(definition, input) {
24
+ const required = definition.inputSchema.required;
25
+ if (!Array.isArray(required) || required.length === 0)
26
+ return;
27
+ const missing = required
28
+ .filter((key) => typeof key === 'string')
29
+ .filter((key) => isMissing(input[key]));
30
+ if (missing.length === 0)
31
+ return;
32
+ // 单字段缺失沿用 `id_required` / `dept_required` 这种既有口径,多字段缺失用 required_missing。
33
+ const subtype = missing.length === 1 ? `${missing[0]}_required` : 'required_missing';
34
+ throw hrmValidationError(subtype, `缺少必填参数:${missing.join('、')}(用 weaver-work-cli hrm schema --operation ${definition.name} 查看完整入参)`, { operation: definition.name, missing });
35
+ }
3
36
  export async function executeHrmOperation(operation, rawInput, context) {
4
37
  const definition = getHrmOperation(operation);
5
38
  const input = asObject(rawInput);
6
39
  assertNoForbiddenKeys(input);
40
+ assertRequiredInput(definition, input);
7
41
  const host = {
8
42
  request(request) {
9
43
  return context.host.request({
@@ -0,0 +1,163 @@
1
+ /**
2
+ * 易秒办常量与位定义(具名化,消除散落在 operation 里的魔法数字)。
3
+ *
4
+ * 这些常量来自原始 skill 的纯知识文档(im-msg-kind-mkind.md / im-searchGroup.md /
5
+ * im-group-onoff-bits.md / im-sysmsg-fields.md)与服务端 path.go,权威说明见
6
+ * skills/weaver-e10-yimiaoban/references/constants.md。
7
+ *
8
+ * 🔴 只定义常量、不改变任何 operation 现有行为;引用方按需取用。
9
+ */
10
+ /** 消息 kind(具体类型,单一值,5 位编码)。 */
11
+ export const MSG_KIND = {
12
+ TXT_NORMAL: 1001,
13
+ TXT_LINK: 1002,
14
+ TXT_AT: 1003,
15
+ HISTORY: 1004,
16
+ TXT_GRAY: 1005,
17
+ ANNOUNCE: 1006,
18
+ PIC: 2001,
19
+ EMOJI: 2002,
20
+ VOICE: 3001,
21
+ FILE: 4001,
22
+ LOCAL: 5001,
23
+ VIDEO: 6001,
24
+ TOPIC: 6002,
25
+ BIDA: 6003,
26
+ NOTICE: 7000,
27
+ ITEM: 8000,
28
+ IMG_TXT: 9000,
29
+ SEQUENCE: 9001,
30
+ RICH_TXT: 9002,
31
+ };
32
+ /** 消息 kind → 中文名(ByKind 过滤接口输出用)。 */
33
+ export const MSG_KIND_NAME = {
34
+ 1001: '文字', 1002: '链接', 1003: '@消息', 1004: '聊天记录', 1005: '灰色消息', 1006: '公告',
35
+ 2001: '图片', 2002: '表情', 3001: '语音', 4001: '文件', 5001: '位置',
36
+ 6001: '视频', 6002: '话题', 6003: '必达', 7000: '通知提醒', 8000: '事项',
37
+ 9000: '图文链接', 9001: '群接龙', 9002: '富文本',
38
+ };
39
+ /** 消息 mkind(按位消息类型掩码,可组合)。 */
40
+ export const MKIND = {
41
+ TXT_NORMAL: 1, // 1<<0
42
+ TXT_LINK: 2, // 1<<1
43
+ TXT_AT: 4, // 1<<2
44
+ HISTORY: 8, // 1<<3
45
+ TXT_GRAY: 16, // 1<<4
46
+ ANNOUNCE: 32, // 1<<5
47
+ PIC: 64, // 1<<6
48
+ EMOJI: 128, // 1<<7
49
+ VOICE: 256, // 1<<8
50
+ FILE: 512, // 1<<9
51
+ LOCAL: 1024, // 1<<10
52
+ VIDEO: 2048, // 1<<11
53
+ TOPIC: 4096, // 1<<12
54
+ BIDA: 8192, // 1<<13
55
+ NOTICE: 16384, // 1<<14
56
+ ITEM: 32768, // 1<<15
57
+ IMG_TXT: 65536, // 1<<16
58
+ SEQUENCE: 131072, // 1<<17
59
+ RICH_TXT: 262144, // 1<<18
60
+ };
61
+ /** mkind 掩码 → kind 对应表(mkindToKindList 顺序)。 */
62
+ export const MKIND_TO_KIND = [
63
+ [MKIND.TXT_NORMAL, MSG_KIND.TXT_NORMAL],
64
+ [MKIND.TXT_LINK, MSG_KIND.TXT_LINK],
65
+ [MKIND.TXT_AT, MSG_KIND.TXT_AT],
66
+ [MKIND.HISTORY, MSG_KIND.HISTORY],
67
+ [MKIND.TXT_GRAY, MSG_KIND.TXT_GRAY],
68
+ [MKIND.ANNOUNCE, MSG_KIND.ANNOUNCE],
69
+ [MKIND.PIC, MSG_KIND.PIC],
70
+ [MKIND.EMOJI, MSG_KIND.EMOJI],
71
+ [MKIND.VOICE, MSG_KIND.VOICE],
72
+ [MKIND.FILE, MSG_KIND.FILE],
73
+ [MKIND.LOCAL, MSG_KIND.LOCAL],
74
+ [MKIND.VIDEO, MSG_KIND.VIDEO],
75
+ [MKIND.TOPIC, MSG_KIND.TOPIC],
76
+ [MKIND.BIDA, MSG_KIND.BIDA],
77
+ [MKIND.NOTICE, MSG_KIND.NOTICE],
78
+ [MKIND.ITEM, MSG_KIND.ITEM],
79
+ [MKIND.IMG_TXT, MSG_KIND.IMG_TXT],
80
+ [MKIND.SEQUENCE, MSG_KIND.SEQUENCE],
81
+ [MKIND.RICH_TXT, MSG_KIND.RICH_TXT],
82
+ ];
83
+ /** 按位解析 mkind → kind 列表。mkind 为 0/空返回空数组。 */
84
+ export function mkindToKindList(mkind) {
85
+ const out = [];
86
+ if (!mkind)
87
+ return out;
88
+ for (const [mask, kind] of MKIND_TO_KIND) {
89
+ if ((mkind & mask) === mask)
90
+ out.push(kind);
91
+ }
92
+ return out;
93
+ }
94
+ /**
95
+ * 转必达(createDing):源消息体 type → { mkind, tag }。
96
+ * 与源脚本 sendDing.js analyzeSourceMsg 一致:文件/图片/视频各有专用 mkind+tag,
97
+ * 其余类型(文本及原脚本未细分的链接/公告/语音/位置/话题/富文本等)落文本兜底 tag='3'、mkind=1。
98
+ * 🔴 保持源脚本行为,不擅自扩展 tag 语义(tag 仅 0图/1视频/2文件/3文本 四种)。
99
+ */
100
+ export const DING_SOURCE_TYPE = {
101
+ 4: { mkind: MKIND.FILE, tag: '2' }, // 文件
102
+ 2: { mkind: MKIND.PIC, tag: '0' }, // 图片
103
+ 7: { mkind: MKIND.VIDEO, tag: '1' }, // 视频
104
+ };
105
+ export const DING_SOURCE_DEFAULT = { mkind: MKIND.TXT_NORMAL, tag: '3' };
106
+ /** 群搜索 cond.mask(SEARCH_GROUP_COND,17 位)。CLI 已实现前 7 类,其余为源文档定义。 */
107
+ export const SEARCH_GROUP_MASK = {
108
+ TYPE: 1, // 1<<0
109
+ KEY: 2, // 1<<1
110
+ LABELS: 4, // 1<<2
111
+ MEMBERS: 8, // 1<<3
112
+ PRECISE: 16, // 1<<4
113
+ OWNER: 32, // 1<<5
114
+ CREATOR: 64, // 1<<6
115
+ MANAGER: 128, // 1<<7
116
+ CREATE_RANGE: 256, // 1<<8
117
+ ACTIVE_RANGE: 512, // 1<<9
118
+ TOP: 1024, // 1<<10
119
+ NORMAL: 2048, // 1<<11
120
+ SHARE_JOIN: 4096, // 1<<12
121
+ ID: 8192, // 1<<13
122
+ SORT: 16384, // 1<<14
123
+ TOPIC: 32768, // 1<<15
124
+ GTID: 65536, // 1<<16
125
+ };
126
+ /** 群 mark(MASK_GROUP_MARK,响应字段按位)。 */
127
+ export const GROUP_MARK = {
128
+ ALL: 1, // 1<<0 全员群
129
+ DEPT: 2, // 1<<1 部门群
130
+ EXTERNAL: 4, // 1<<2 外部群
131
+ ITEM: 8, // 1<<3 事项群
132
+ TOPIC: 16, // 1<<4 话题群
133
+ CROSS_SYSTEM: 64, // 1<<6 跨系统群
134
+ };
135
+ /** 群 on_off 开关位:第 N 位 = flag N,值 = 1<<(N-1)。位 15/26 语义反向。 */
136
+ export const GROUP_ONOFF_NAMES = {
137
+ 1: '群匿名', 2: '群搜索', 3: '申请加入', 4: '内部群搜索', 5: '仅管理员邀请',
138
+ 6: '仅管理员改资料', 7: '仅管理员@全体', 8: '群禁言', 9: '群分享', 10: '新人看历史',
139
+ 11: '外部人员加入', 12: '群组广场显示', 13: '群密聊', 14: '群动态规则', 15: '私密话题(反向)',
140
+ 16: '仅管理员置顶', 17: '群存在置顶', 18: '按群身份@', 19: '仅管理员按身份@', 20: '仅管理员管事项',
141
+ 21: '群设置只读', 22: '触发人数过多禁言(只读)', 23: '设置过成员禁言(只读)', 24: '存在群身份(只读)',
142
+ 25: '仅管理员配机器人', 26: '启用机器人(反向)', 27: '话题群定时提醒',
143
+ };
144
+ /** 读取群 on_off 需要的 queryGroupInfo mask 位。 */
145
+ export const MASK_GROUP_ONOFF = 262144; // 1<<18
146
+ /** 系统消息 group 字段的「按位修改」位(modSysMsgGroup 用)。 */
147
+ export const SYSMSG_GROUP_BITS = {
148
+ groupName: 1 << 1, imgid: 1 << 3, ext: 1 << 8, i18nName: 1 << 11,
149
+ enable: 1 << 12, top: 1 << 13, remind: 1 << 14, clear: 1 << 15, unread: 1 << 16,
150
+ sunread: 1 << 18, action: 1 << 19, describe: 1 << 20, link: 1 << 21,
151
+ terminal: 1 << 22, subscript: 1 << 23, ssource: 1 << 24, saddr: 1 << 25,
152
+ scycle: 1 << 26, sshow: 1 << 27, mark: 1 << 28, defmark: 1 << 29,
153
+ id18nDesc: 1 << 30, application: 1 << 31, markSeq: 1 << 32, pcLink: 1 << 33,
154
+ pageOpen: 1 << 34, viewScope: 1 << 35, order: 1 << 36, ignore: 1 << 37,
155
+ jumpAll: 1 << 38, showType: 1 << 39, moduleTag: 1 << 40, delSession: 1 << 44,
156
+ initSession: 1 << 45, location: 1 << 46, locInfo: 1 << 47, pcLocInfo: 1 << 48,
157
+ hideSender: 1 << 49,
158
+ };
159
+ /** 系统消息 type 字段的「按位修改」位(modSysMsgType 用)。 */
160
+ export const SYSMSG_TYPE_BITS = {
161
+ typeName: 1 << 1, imgid: 1 << 2, lt: 1 << 3, lu: 1 << 4,
162
+ ht: 1 << 5, url: 1 << 6, ext: 1 << 7, i18nName: 1 << 8, tab: 1 << 9,
163
+ };