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
@@ -10,8 +10,8 @@ import { lookupAgentHost, resolveLoginProfileName, upsertAgentHost } from './age
10
10
  import { isIsolatedAgentHost, resolveAgentHostKey, resolveSessionHostKey } from './agent-host-key.js';
11
11
  import { getE10AuthRoot } from './paths.js';
12
12
  import { appendXiaoEAuthErrorLog, clearXiaoEAuthErrorLog, getXiaoEAuthErrorLogPath, normalizeXiaoEAuthErrorLogLimit, readXiaoEAuthErrorLog, xiaoEAuthLogSecrets, } from './error-log.js';
13
- import { XIAOE_AGENT_TYPE, createXiaoEUnifiedLoginUnavailableError, hasXiaoEEnv, inspectXiaoEUnifiedLoginSources, resolveDefaultE10BaseUrl, resolveXiaoEPreferredBaseUrl, tryXiaoEUnifiedLogin as tryXiaoEUnifiedSessionLogin, } from './xiaoe.js';
14
- export { DEFAULT_E10_BASE_URL, DEFAULT_E10_LOGIN_BASE_URL, XIAOE_AGENT_TYPE, hasXiaoEEnv, hasXiaoETokenScript, hasXiaoEUnifiedLoginSource, isXiaoEHostedEnvironment, inspectXiaoEUnifiedLoginSources, resolveDefaultE10BaseUrl, resolveXiaoEDefaultBaseUrl, resolveXiaoEPreferredBaseUrl, resolveXiaoEUnifiedLoginCredential, } from './xiaoe.js';
13
+ import { XIAOE_AGENT_TYPE, createXiaoEUnifiedLoginUnavailableError, hasXiaoEEnv, inspectXiaoEUnifiedLoginSources, resolveConfiguredE10BaseUrl, resolveDefaultE10BaseUrl, resolveXiaoEPreferredBaseUrl, tryXiaoEUnifiedLogin as tryXiaoEUnifiedSessionLogin, } from './xiaoe.js';
14
+ export { DEFAULT_E10_BASE_URL, DEFAULT_E10_LOGIN_BASE_URL, XIAOE_AGENT_TYPE, hasXiaoEEnv, hasXiaoETokenScript, hasXiaoEUnifiedLoginSource, isXiaoEHostedEnvironment, inspectXiaoEUnifiedLoginSources, resolveConfiguredE10BaseUrl, resolveDefaultE10BaseUrl, resolveXiaoEDefaultBaseUrl, resolveXiaoEPreferredBaseUrl, resolveXiaoEUnifiedLoginCredential, } from './xiaoe.js';
15
15
  const DEFAULT_AGENT_TYPE = 'weaver-work-cli';
16
16
  const EXPLICIT_AGENT_TYPE_ENV_KEYS = [
17
17
  'WORKBUDDY_AGENT_TYPE',
@@ -802,6 +802,18 @@ async function runXiaoELogin(ctx, options) {
802
802
  }).catch((logError) => ctx.logger.debug(`Could not persist XiaoE auth error log: ${logError instanceof Error ? logError.message : String(logError)}`));
803
803
  throw error;
804
804
  }
805
+ /**
806
+ * 浏览器登录与手填 ETEAMSID 的域名解析顺序:
807
+ * 显式参数 > 当前 profile 配置 > 宿主注入的默认域名(`WEAVER_XIAOE_DEFAULT_DOMAIN`、
808
+ * `WEAVER_XIAOE_E10_DOMAIN` 等)> 硬编码兜底域名。
809
+ *
810
+ * 宿主默认域排在 profile 之后是刻意的:profile 代表用户上一次显式登录选的租户,
811
+ * 环境变量只补「还没有任何线索」的场景,不能把已登录用户的租户顶掉。
812
+ */
813
+ export function resolveLoginBaseUrl(env, explicitCandidates) {
814
+ const explicit = explicitCandidates.find((value) => (value || '').trim()) || '';
815
+ return normalizeUrl(explicit || resolveConfiguredE10BaseUrl(env) || resolveDefaultE10BaseUrl(env));
816
+ }
805
817
  export async function runBrowserLogin(ctx, options, loginMode = {}) {
806
818
  const commandOpts = asOptions(options);
807
819
  const globalOptions = ctx.getGlobalOptions();
@@ -815,7 +827,7 @@ export async function runBrowserLogin(ctx, options, loginMode = {}) {
815
827
  explicitAgentType,
816
828
  });
817
829
  const hostKey = target.hostKey;
818
- const baseUrl = normalizeUrl(explicitBaseUrl || target.cfg.baseUrl || resolveDefaultE10BaseUrl(ctx.env));
830
+ const baseUrl = resolveLoginBaseUrl(ctx.env, [explicitBaseUrl, target.cfg.baseUrl]);
819
831
  const tenantKey = optionString(commandOpts, 'tenantKey');
820
832
  const explicitPort = optionString(commandOpts, 'port');
821
833
  const portText = explicitPort || '19800';
@@ -1323,7 +1335,11 @@ export function registerE10AuthCommands(parent, action) {
1323
1335
  explicitAgentType: optionString(commandOpts, 'agentType', 'agent_type'),
1324
1336
  });
1325
1337
  const cfg = target.cfg;
1326
- const baseUrl = normalizeUrl(optionString(commandOpts, 'baseUrl') || globalOptions.baseUrl || cfg.baseUrl || resolveDefaultE10BaseUrl(ctx.env));
1338
+ const baseUrl = resolveLoginBaseUrl(ctx.env, [
1339
+ optionString(commandOpts, 'baseUrl'),
1340
+ globalOptions.baseUrl,
1341
+ cfg.baseUrl,
1342
+ ]);
1327
1343
  const passportUrl = normalizeUrl(optionString(commandOpts, 'passportUrl') || globalOptions.passportUrl || cfg.passportUrl || baseUrl);
1328
1344
  const tenantKeyFallback = optionString(commandOpts, 'tenantKey');
1329
1345
  const agentType = resolveAgentType(commandOpts, ctx.env);
@@ -484,15 +484,27 @@ function normalizeBaseUrlValue(value) {
484
484
  return '';
485
485
  return /^https?:\/\//i.test(raw) ? raw : `https://${raw}`;
486
486
  }
487
- function resolveXiaoEConfiguredBaseUrl(env) {
487
+ /**
488
+ * 环境里显式配置的 E10 目标域(`WEAVER_XIAOE_DEFAULT_DOMAIN` 等默认域名,
489
+ * 其次 `WEAVER_XIAOE_E10_DOMAIN` / `WEAVER_XIAOE_E10_BASE_URL` 等单域名)。
490
+ *
491
+ * 只认「域名」类变量,**不**包含 `WEAVER_XIAOE_AUTH_MAP` 这类凭据映射:
492
+ * 映射里的域名是配合 ETEAMSID 换票用的,不该决定浏览器登录要打开哪个租户。
493
+ * `XIAOE_DOMAIN` 同理不属于这里——它是 XiaoE/erpa 换票服务地址。
494
+ */
495
+ export function resolveConfiguredE10BaseUrl(env = process.env) {
488
496
  const explicitDefault = envString(env, ...XIAOE_DEFAULT_DOMAIN_ENV_KEYS);
489
497
  if (explicitDefault)
490
498
  return normalizeBaseUrlValue(explicitDefault);
491
- // XIAOE_DOMAIN is the XiaoE/erpa service address used to exchange
492
- // XIAOE_USER_TOKEN. Only dedicated E10 variables may select the target E10.
493
499
  const singleDomain = envString(env, ...XIAOE_SINGLE_DOMAIN_ENV_KEYS);
494
500
  if (singleDomain)
495
501
  return normalizeBaseUrlValue(singleDomain);
502
+ return '';
503
+ }
504
+ function resolveXiaoEConfiguredBaseUrl(env) {
505
+ const configured = resolveConfiguredE10BaseUrl(env);
506
+ if (configured)
507
+ return configured;
496
508
  const firstCredential = listXiaoEUnifiedLoginCredentials(env)[0];
497
509
  if (firstCredential?.baseUrl)
498
510
  return normalizeUrl(firstCredential.baseUrl);
@@ -413,7 +413,45 @@ export function createZiguanjiaHost(ctx) {
413
413
  }
414
414
  return value;
415
415
  }
416
- return { ebuilderRequest, actionFlow, getSession, resolveFormId, getFormFields, resolveSubcompanyIdByName };
416
+ async function flowByApplication(request) {
417
+ const { esbFlowId, mainTable, operation, moduleSource, employeeId } = request;
418
+ assertPath(ESB_TRIGGER_PATH);
419
+ const session = await getSession();
420
+ const payload = {
421
+ esbFlowId,
422
+ employeeId: employeeId && employeeId.trim() !== '' ? employeeId : session.userId,
423
+ customParams: { mainTable },
424
+ };
425
+ if (moduleSource)
426
+ payload.moduleSource = moduleSource;
427
+ const response = await (await runtime()).requestJson({
428
+ module: 'asset',
429
+ operation,
430
+ method: 'POST',
431
+ path: ESB_TRIGGER_PATH,
432
+ body: payload,
433
+ bigIntStrings: true,
434
+ });
435
+ if (isE10SessionExpiredResponse(response)) {
436
+ throw ziguanjiaAuthError('session_expired', E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
437
+ }
438
+ if (response.parseError) {
439
+ throw ziguanjiaNetworkError('protocol', `接口返回不是合法 JSON(HTTP ${response.status})`, { retryable: false });
440
+ }
441
+ if (response.status < 200 || response.status >= 300) {
442
+ throw ziguanjiaBusinessError('http_error', `ESB 接口 HTTP ${response.status}`, { code: response.status });
443
+ }
444
+ const value = response.value;
445
+ const resultCode = value?.resultCode;
446
+ if (resultCode === undefined) {
447
+ throw ziguanjiaBusinessError('actionflow_no_code', '动作流返回缺少 resultCode', { details: { result: value } });
448
+ }
449
+ if (resultCode !== 200) {
450
+ throw ziguanjiaBusinessError('actionflow_failed', `动作流执行未成功(resultCode=${resultCode}):${value?.resultMsg || ''}`, { code: resultCode, details: { result: value }, retryable: resultCode === 507 || resultCode === 508 || resultCode === 511 });
451
+ }
452
+ return value;
453
+ }
454
+ return { ebuilderRequest, actionFlow, flowByApplication, getSession, resolveFormId, getFormFields, resolveSubcompanyIdByName };
417
455
  }
418
456
  /**
419
457
  * 拼卡片式查看链接 `/sp/ebdfpage/card/0/{表单ID}/{数据ID}`(去域名路径 + 当前环境地址)。
@@ -258,9 +258,23 @@ export const assetShortcut = {
258
258
  registerWrite(asset, 'purch', 'asset.purch', '提交采购申请(需 confirm + continuation)');
259
259
  registerWrite(asset, 'depre', 'asset.depre', '执行折旧计提(需 confirm + continuation)');
260
260
  withJsonInputOptions(asset.command('viewlink')
261
- .description('构造「查看详情」链接(scene + ids;depre_task 场景用 calc_month)'))
261
+ .description('构造「查看详情」链接(scene + ids;depre_task 场景用 calc_month)')
262
262
  .action(action(async (ctx, options) => {
263
263
  await executeAndPrint(ctx, 'asset.viewlink', await inputFrom(options));
264
- }));
264
+ })));
265
+ const audit = asset.command('audit').description('资产清查(取数 + 确认表写入,不纳入版本门禁)');
266
+ withJsonInputOptions(audit.command('list')
267
+ .description('分页查询资产清查数据(只读)')
268
+ .option('--cur-page <no>', '页码,从 1 起')
269
+ .option('--max-pages <n>', '最多翻页数(1..100,默认 20)')
270
+ .action(action(async (ctx, options) => {
271
+ const opts = asOptions(options);
272
+ await executeAndPrint(ctx, 'asset.audit.list', await inputFrom(options, {
273
+ cur_page: opts.curPage,
274
+ max_pages: opts.maxPages,
275
+ }));
276
+ })));
277
+ registerWrite(audit, 'confirm', 'asset.audit.confirm', '写入资产清查确认表(需 confirm + continuation)');
278
+ registerWrite(asset, 'report', 'asset.report.apply', '提交资产上报(需 confirm + continuation,moduleSource 固定 AISKILL)');
265
279
  },
266
280
  };
@@ -40,7 +40,25 @@ export const ziguanjiaViewLink = {
40
40
  depreViewportPath: DEPRE_VIEWPORT_PATH,
41
41
  sceneFormTags: VIEW_LINK_SCENE_TAGS,
42
42
  };
43
- export const ziguanjiaFixed = { EB_INTERFACE_PK, ES_UNIQUE_INDENT, VIEW_LINK_SCENE_TAGS, DEPRE_VIEWPORT_PATH };
43
+ /** esbFlowId(动作流 ID)类标识:与 uniqueIndent 不是同一类型,不可混用。 */
44
+ const ES_FLOW_ID = {
45
+ /** 资产清查取数(只读);门禁豁免。 */
46
+ auditList: '907938775240413184',
47
+ /** 资产清查确认表写入(写操作);门禁豁免。 */
48
+ auditConfirm: '913634865562390528',
49
+ /** 资产上报写入(写操作);门禁豁免,moduleSource 固定 AISKILL。 */
50
+ reportApply: '915199285606354944',
51
+ };
52
+ /** 资产上报写入固定来源标识:缺失时服务端无法识别 dataList 声明类型。 */
53
+ const REPORT_MODULE_SOURCE = 'AISKILL';
54
+ export const ziguanjiaFixed = {
55
+ EB_INTERFACE_PK,
56
+ ES_UNIQUE_INDENT,
57
+ ES_FLOW_ID,
58
+ REPORT_MODULE_SOURCE,
59
+ VIEW_LINK_SCENE_TAGS,
60
+ DEPRE_VIEWPORT_PATH,
61
+ };
44
62
  /**
45
63
  * 每条 operation 的一句话用途,写入 schema 的 summary。
46
64
  *
@@ -67,6 +85,9 @@ const OPERATION_SUMMARIES = {
67
85
  'asset.purch': '发起资产采购申请(高风险写操作,会落库);入参 purchase_name/detail1',
68
86
  'asset.depre': '发起资产折旧计提(高风险写操作,会落库);入参 calc_month/company_ids',
69
87
  'asset.viewlink': '生成资产相关页面的查看链接;入参 scene/ids(可带 calc_month/anchor)',
88
+ 'asset.audit.list': '分页查询资产清查数据(只读,动作流 esbFlowId 取数;不纳入版本门禁);按 curPage/hasMore 翻页',
89
+ 'asset.audit.confirm': '写入资产清查确认表(高风险写操作,会落库;不纳入版本门禁);入参 records(编号图/外观图 ID 与判定)',
90
+ 'asset.report.apply': '资产上报写入(高风险写操作,会落库;不纳入版本门禁);入参 dataList(图片 ID/名称/类型/规格),moduleSource 固定 AISKILL',
70
91
  };
71
92
  function withSummaries(operations) {
72
93
  return operations.map((item) => ({
@@ -486,6 +507,83 @@ export const ziguanjiaOperations = [
486
507
  anyOf: [{ required: ['ids'] }, { required: ['calc_month'] }],
487
508
  },
488
509
  },
510
+ {
511
+ name: 'asset.audit.list',
512
+ risk: 'read',
513
+ fixed: { esbFlowId: ES_FLOW_ID.auditList },
514
+ inputSchema: {
515
+ type: 'object',
516
+ additionalProperties: false,
517
+ properties: {
518
+ esbFlowId: { type: 'string', pattern: '^\\d+$', description: '清查取数动作流 ID;默认使用部署期常量,换环境须重新确认' },
519
+ cur_page: { type: 'integer', minimum: 1, default: 1, description: '页码,从 1 起;hasMore=true 时 +1 继续' },
520
+ max_pages: { type: 'integer', minimum: 1, maximum: 100, default: 20, description: '单次最多翻页数,防止动作流限流失控' },
521
+ },
522
+ },
523
+ },
524
+ {
525
+ name: 'asset.audit.confirm',
526
+ risk: 'high-risk-write',
527
+ requiresConfirmation: true,
528
+ fixed: { esbFlowId: ES_FLOW_ID.auditConfirm },
529
+ inputSchema: {
530
+ type: 'object',
531
+ additionalProperties: false,
532
+ properties: {
533
+ records: {
534
+ type: 'array',
535
+ minItems: 1,
536
+ description: '清查确认记录;每张资产卡片两条(编号图、外观图各一条)',
537
+ items: {
538
+ type: 'object',
539
+ additionalProperties: false,
540
+ properties: {
541
+ except_remark: { type: 'string', description: '备注,原样取用' },
542
+ asset_image: { type: 'string', minLength: 1, description: '编号图 file_id(来自 caizhilian 上传)' },
543
+ zcwgtp: { type: 'string', minLength: 1, description: '外观图 file_id(来自 caizhilian 上传)' },
544
+ sure_type: { type: 'string', enum: ['0', '1'], description: '两图均 100 分传 0;任一低于 100(含缺失)传 1' },
545
+ },
546
+ required: ['asset_image', 'zcwgtp', 'sure_type'],
547
+ },
548
+ },
549
+ confirm: { const: true },
550
+ continuation: { type: 'string', minLength: 1 },
551
+ },
552
+ required: ['records'],
553
+ },
554
+ },
555
+ {
556
+ name: 'asset.report.apply',
557
+ risk: 'high-risk-write',
558
+ requiresConfirmation: true,
559
+ fixed: { esbFlowId: ES_FLOW_ID.reportApply, moduleSource: REPORT_MODULE_SOURCE },
560
+ inputSchema: {
561
+ type: 'object',
562
+ additionalProperties: false,
563
+ properties: {
564
+ dataList: {
565
+ type: 'array',
566
+ minItems: 1,
567
+ description: '上报资产明细;字段名固定 asset_aspc(不得改写为 asset_spec)',
568
+ items: {
569
+ type: 'object',
570
+ additionalProperties: false,
571
+ properties: {
572
+ img_id: { type: 'string', minLength: 1, description: '图片上传后的 file_id' },
573
+ asset_name: { type: 'string', minLength: 1, description: '资产名称,空时以资产编号兜底' },
574
+ asset_type: { type: 'string', description: '资产类型' },
575
+ asset_aspc: { type: 'string', description: '规格型号(固定字段名)' },
576
+ count: { type: 'integer', minimum: 1, default: 1 },
577
+ },
578
+ required: ['img_id', 'asset_name'],
579
+ },
580
+ },
581
+ confirm: { const: true },
582
+ continuation: { type: 'string', minLength: 1 },
583
+ },
584
+ required: ['dataList'],
585
+ },
586
+ },
489
587
  ];
490
588
  export const ziguanjiaManifest = {
491
589
  schemaVersion: 1,
@@ -509,6 +607,22 @@ export const ziguanjiaManifest = {
509
607
  name: 'asset.file.upload',
510
608
  reason: '图片上传依赖 weaver-e10-caizhilian 文件上传模块,CLI 不内置文件上传能力,create 仅接受已上传得到的裸 file_id。',
511
609
  },
610
+ {
611
+ name: 'asset.idle.list',
612
+ reason: '闲置资产分析(动作流取数 + 聚合统计)由独立模块 asset-idle 提供(asset-idle.idle.list / asset-idle.idle.stats);本模块不重复命令面,Skill 侧路由到该模块。',
613
+ },
614
+ {
615
+ name: 'asset.audit.render',
616
+ reason: '资产清查 HTML 渲染、图片智能识别与匹配依赖源资料自带的 Python 脚本与 HTML 模板,Skill 安装会过滤 scripts/ 与 assets/,不能作为随包能力交付;CLI 只暴露取数与清查确认表写入。',
617
+ },
618
+ {
619
+ name: 'asset.report.render',
620
+ reason: '资产上报的图片识别与 HTML 列表渲染依赖源资料自带脚本/模板,不随 Skill 包分发;CLI 只暴露上报写入(dataList),图片上传委托 caizhilian 模块。',
621
+ },
622
+ {
623
+ name: 'asset.disposal.start',
624
+ reason: '闲置资产处置发起须经「资产处置申请」流程(workflow.createForm / createRequest),属 weaver-e10-workflow 能力;本模块不重复实现,且不直接回写资产数据。',
625
+ },
512
626
  ],
513
627
  };
514
628
  export function hasZiguanjiaOperation(operation) {
@@ -0,0 +1,144 @@
1
+ import { ziguanjiaFixed } from '../manifest.js';
2
+ import { ziguanjiaValidationError } from '../errors.js';
3
+ import { asObject, actionFlowResult, ok } from './shared.js';
4
+ import { ZiguanjiaPreparedWriteOperation } from './write.js';
5
+ const FLOW = ziguanjiaFixed.ES_FLOW_ID;
6
+ /** 清查取数返回值路径与 asset-idle 一致:actionData.responseData.customData.mainTable。 */
7
+ function pageData(result) {
8
+ const table = actionFlowResult(result).mainTable;
9
+ const raw = table?.dataList ?? table?.datas ?? table?.items ?? table?.auditList;
10
+ return {
11
+ items: Array.isArray(raw) ? raw : [],
12
+ hasMore: table?.hasMore === true || String(table?.hasMore ?? '').toLowerCase() === 'true',
13
+ };
14
+ }
15
+ /**
16
+ * 资产清查取数(只读,门禁豁免):动作流 esbFlowId=907938775240413184,
17
+ * curPage 从 1 起、hasMore=true 继续;不就"是否触发动作流"向用户征询确认。
18
+ */
19
+ export class ZiguanjiaAuditListOperation {
20
+ name = 'asset.audit.list';
21
+ async execute(input, context) {
22
+ const body = asObject(input, this.name);
23
+ const flowId = typeof body.esbFlowId === 'string' && /^\d+$/u.test(body.esbFlowId)
24
+ ? body.esbFlowId : String(FLOW.auditList);
25
+ const startPage = Number(body.cur_page ?? 1);
26
+ const maxPages = Number(body.max_pages ?? 20);
27
+ if (!Number.isInteger(startPage) || startPage < 1) {
28
+ throw ziguanjiaValidationError('cur_page_invalid', 'cur_page 必须是 >= 1 的整数');
29
+ }
30
+ if (!Number.isInteger(maxPages) || maxPages < 1 || maxPages > 100) {
31
+ throw ziguanjiaValidationError('max_pages_invalid', 'max_pages 必须是 1..100 的整数');
32
+ }
33
+ const all = [];
34
+ let curPage = startPage;
35
+ let hasMore = true;
36
+ let truncated = false;
37
+ while (hasMore) {
38
+ const result = await context.host.flowByApplication({
39
+ esbFlowId: flowId,
40
+ mainTable: { curPage: String(curPage) },
41
+ operation: this.name,
42
+ });
43
+ const page = pageData(result);
44
+ all.push(...page.items);
45
+ hasMore = page.hasMore;
46
+ if (!hasMore)
47
+ break;
48
+ if (curPage - startPage + 1 >= maxPages) {
49
+ truncated = true;
50
+ break;
51
+ }
52
+ curPage += 1;
53
+ }
54
+ return ok('COMPLETE', {
55
+ esbFlowId: flowId,
56
+ items: all,
57
+ count: all.length,
58
+ pages: truncated ? maxPages : curPage - startPage + 1,
59
+ hasMore,
60
+ truncated,
61
+ });
62
+ }
63
+ }
64
+ /**
65
+ * 资产清查确认表写入(高风险写,门禁豁免):动作流 esbFlowId=913634865562390528。
66
+ * 每张资产卡片两条(编号图 / 外观图各一条);except_remark 原样取用,sure_type 0/1。
67
+ */
68
+ export class ZiguanjiaAuditConfirmOperation extends ZiguanjiaPreparedWriteOperation {
69
+ skipVersionGate = true;
70
+ constructor() {
71
+ super('asset.audit.confirm');
72
+ }
73
+ async prepare(body, _context) {
74
+ const records = Array.isArray(body.records) ? body.records : [];
75
+ if (records.length === 0)
76
+ throw ziguanjiaValidationError('input_required', 'records 至少一条清查确认记录');
77
+ for (const [index, record] of records.entries()) {
78
+ if (!record || typeof record !== 'object') {
79
+ throw ziguanjiaValidationError('input_invalid', `records[${index}] 必须是对象`);
80
+ }
81
+ if (!record.asset_image || !record.zcwgtp) {
82
+ throw ziguanjiaValidationError('input_required', `records[${index}] 必须提供编号图与外观图 ID`);
83
+ }
84
+ if (record.sure_type !== '0' && record.sure_type !== '1') {
85
+ throw ziguanjiaValidationError('input_invalid', `records[${index}].sure_type 只能是 0 或 1`);
86
+ }
87
+ }
88
+ return {
89
+ preview: { operation: 'audit.confirm', esbFlowId: FLOW.auditConfirm, records },
90
+ confirmationText: `即将写入资产清查确认表(${records.length} 条记录)。确认后执行。`,
91
+ commit: { esbFlowId: FLOW.auditConfirm, records },
92
+ };
93
+ }
94
+ async apply(commit, context) {
95
+ const result = await context.host.flowByApplication({
96
+ esbFlowId: String(commit.esbFlowId),
97
+ mainTable: { dataList: commit.records },
98
+ operation: this.name,
99
+ });
100
+ return actionFlowResult(result);
101
+ }
102
+ }
103
+ /**
104
+ * 资产上报写入(高风险写,门禁豁免):动作流 esbFlowId=915199285606354944,
105
+ * moduleSource 固定 AISKILL,dataList 传数组对象(不 JSON 字符串、不双重编码)。
106
+ */
107
+ export class ZiguanjiaReportApplyOperation extends ZiguanjiaPreparedWriteOperation {
108
+ skipVersionGate = true;
109
+ constructor() {
110
+ super('asset.report.apply');
111
+ }
112
+ async prepare(body, _context) {
113
+ const dataList = Array.isArray(body.dataList) ? body.dataList : [];
114
+ if (dataList.length === 0)
115
+ throw ziguanjiaValidationError('input_required', 'dataList 至少一条上报记录');
116
+ for (const [index, item] of dataList.entries()) {
117
+ if (!item || typeof item !== 'object') {
118
+ throw ziguanjiaValidationError('input_invalid', `dataList[${index}] 必须是对象`);
119
+ }
120
+ if (!item.img_id || !item.asset_name) {
121
+ throw ziguanjiaValidationError('input_required', `dataList[${index}] 必须提供 img_id 与 asset_name`);
122
+ }
123
+ }
124
+ return {
125
+ preview: {
126
+ operation: 'report.apply',
127
+ esbFlowId: FLOW.reportApply,
128
+ moduleSource: ziguanjiaFixed.REPORT_MODULE_SOURCE,
129
+ dataList,
130
+ },
131
+ confirmationText: `即将提交资产上报(${dataList.length} 条记录)。确认后执行。`,
132
+ commit: { esbFlowId: FLOW.reportApply, dataList },
133
+ };
134
+ }
135
+ async apply(commit, context) {
136
+ const result = await context.host.flowByApplication({
137
+ esbFlowId: String(commit.esbFlowId),
138
+ mainTable: { dataList: commit.dataList },
139
+ operation: this.name,
140
+ moduleSource: ziguanjiaFixed.REPORT_MODULE_SOURCE,
141
+ });
142
+ return actionFlowResult(result);
143
+ }
144
+ }
@@ -2,6 +2,7 @@ import { ziguanjiaValidationError } from '../errors.js';
2
2
  import { ziguanjiaFixed, ziguanjiaOperations } from '../manifest.js';
3
3
  import { ZiguanjiaGateCheckOperation, ZiguanjiaQueryOperation, ZiguanjiaResolveOperation, } from './query.js';
4
4
  import { ZiguanjiaViewLinkOperation } from './viewlink.js';
5
+ import { ZiguanjiaAuditConfirmOperation, ZiguanjiaAuditListOperation, ZiguanjiaReportApplyOperation, } from './audit-report.js';
5
6
  import { ZiguanjiaCreateOperation, ZiguanjiaDepreOperation, ZiguanjiaPurchOperation, ZiguanjiaRepairCreateOperation, ZiguanjiaRepairQueryOperation, ZiguanjiaReturnCreateOperation, ZiguanjiaReturnQueryOperation, ZiguanjiaUpdateOperation, ZiguanjiaUseOperation, } from './write.js';
6
7
  const EB = ziguanjiaFixed.EB_INTERFACE_PK;
7
8
  function buildRegistry() {
@@ -63,6 +64,9 @@ function buildRegistry() {
63
64
  new ZiguanjiaPurchOperation(),
64
65
  new ZiguanjiaDepreOperation(),
65
66
  new ZiguanjiaViewLinkOperation(),
67
+ new ZiguanjiaAuditListOperation(),
68
+ new ZiguanjiaAuditConfirmOperation(),
69
+ new ZiguanjiaReportApplyOperation(),
66
70
  ];
67
71
  for (const handler of handlers) {
68
72
  if (registry.has(handler.name))
@@ -17,12 +17,18 @@ function todayStr() {
17
17
  */
18
18
  export class ZiguanjiaPreparedWriteOperation {
19
19
  name;
20
+ /**
21
+ * 版本门禁豁免(源资料约定资产清查 / 资产上报不纳入门禁)。
22
+ * 其余写操作保持默认 false,任何写库前都必须过门禁。
23
+ */
24
+ skipVersionGate = false;
20
25
  constructor(name) {
21
26
  this.name = name;
22
27
  }
23
28
  async execute(input, context) {
24
29
  const body = asObject(input, this.name);
25
- await ensureVersionGate(context.host, this.name);
30
+ if (!this.skipVersionGate)
31
+ await ensureVersionGate(context.host, this.name);
26
32
  if (body.confirm !== true || typeof body.continuation !== 'string' || body.continuation === '') {
27
33
  const prepared = await this.prepare(body, context);
28
34
  const token = await context.continuation.issue({ operation: this.name, ...prepared.commit });
@@ -1,5 +1,6 @@
1
+ import { coworkValidationError } from '../errors.js';
1
2
  import { READ, SCHEMA_ID, SCHEMA_PAGE_CURRENT, SCHEMA_PAGE_SIZE, coworkSuccess, schemaOf, } from './types.js';
2
- import { assertEnum, buildListBody, compact, normalizeList, toId, toPositiveInt, unwrapData, } from './shared.js';
3
+ import { assertEnum, buildListBody, compact, normalizeList, requireId, toId, toPositiveInt, unwrapData, } from './shared.js';
3
4
  /**
4
5
  * 列表 scope → 接口路径。11 个列表结构一致(JSON + 标准列表 envelope),
5
6
  * 因此收敛为单个 `cowork.list`:同一业务动作(查协作/事项/申请),用 scope 区分数据集,
@@ -169,7 +170,7 @@ const coworkView = {
169
170
  risk: READ,
170
171
  inputSchema: schemaOf({ id: { ...SCHEMA_ID, description: '协作 id' } }, { required: ['id'] }),
171
172
  handler: async (args, { host }) => {
172
- const id = toId(args.id, 'id');
173
+ const id = requireId(args.id, 'id');
173
174
  const response = await host.request({
174
175
  method: 'POST',
175
176
  path: '/api/cowork/view/viewCowork',
@@ -194,7 +195,7 @@ const coworkDiscussList = {
194
195
  orderAsc: { type: 'boolean', description: '是否升序,默认 false(倒序)' },
195
196
  }, { required: ['coworkId'] }),
196
197
  handler: async (args, { host }) => {
197
- const coworkId = toId(args.coworkId, 'coworkId');
198
+ const coworkId = requireId(args.coworkId, 'coworkId');
198
199
  const body = compact({
199
200
  coworkId,
200
201
  current: toPositiveInt(args.current, 'current') ?? 1,
@@ -230,8 +231,14 @@ const coworkParticipantList = {
230
231
  pageSize: SCHEMA_PAGE_SIZE,
231
232
  }, { required: ['scope', 'id'] }),
232
233
  handler: async (args, { host }) => {
234
+ // 2026-12-01 复测:scope、id 同为必填,空参时一次报全,避免"补一个再报一个"被误读成漏校验
235
+ const lacksScope = typeof args.scope !== 'string' || !args.scope;
236
+ const lacksId = args.id === undefined || args.id === null || String(args.id).trim() === '';
237
+ if (lacksScope && lacksId) {
238
+ throw coworkValidationError('params_required', '缺少必填参数:scope(all / share / quit)、id(协作 id)');
239
+ }
233
240
  const scope = assertEnum(args.scope, PARTICIPANT_SCOPES, 'scope');
234
- const id = toId(args.id, 'id');
241
+ const id = requireId(args.id, 'id');
235
242
  if (scope === 'share') {
236
243
  const response = await host.request({
237
244
  method: 'POST',
@@ -283,7 +290,7 @@ const coworkResource = {
283
290
  risk: READ,
284
291
  inputSchema: schemaOf({ id: { ...SCHEMA_ID, description: '协作 id' } }, { required: ['id'] }),
285
292
  handler: async (args, { host }) => {
286
- const id = toId(args.id, 'id');
293
+ const id = requireId(args.id, 'id');
287
294
  const response = await host.request({
288
295
  method: 'POST',
289
296
  path: '/api/cowork/view/resourceData',
@@ -306,7 +313,7 @@ const coworkVoteLog = {
306
313
  pageSize: SCHEMA_PAGE_SIZE,
307
314
  }, { required: ['id'] }),
308
315
  handler: async (args, { host }) => {
309
- const id = toId(args.id, 'id');
316
+ const id = requireId(args.id, 'id');
310
317
  const body = compact({
311
318
  id,
312
319
  current: toPositiveInt(args.current, 'current') ?? 1,
@@ -27,6 +27,21 @@ export function toId(value, field) {
27
27
  }
28
28
  return text;
29
29
  }
30
+ /**
31
+ * 必填协作 ID(2026-12-01 授权后复测)。
32
+ * `toId(undefined)` 返回 undefined,旧 handler 直接把 `form: { id: undefined }` 打到上游,
33
+ * 空参调用被服务端判成 400/500、错误码落成 E-9999。schema 里 required 的 ID 一律走本函数,
34
+ * 空值在本地拦成 E-0003(validation/id_required)。
35
+ */
36
+ export function requireId(value, field) {
37
+ if (value === undefined || value === null || value === '') {
38
+ throw coworkValidationError('id_required', `${field} 必填(协作 id 为数字 ID)`);
39
+ }
40
+ const id = toId(value, field);
41
+ if (!id)
42
+ throw coworkValidationError('id_required', `${field} 必填(协作 id 为数字 ID)`);
43
+ return id;
44
+ }
30
45
  export function toIdList(value, field) {
31
46
  if (value === undefined || value === null)
32
47
  return undefined;
@@ -957,18 +957,7 @@ const candidateImportApply = {
957
957
  const [batchOutcome, labelMatch, tagResult] = await Promise.all([batchTask, labelTask, tagTask]);
958
958
  const batchOk = batchOutcome.ok;
959
959
  const batchNote = batchOutcome.note;
960
- // ⑥ 产物链接:人才卡片单页 + 人才库列表定位(自用系统追加 recruitType=useSelf)
961
- const baseUrl = session.baseUrl.replace(/\/+$/, '');
962
- const extra = String(cache.selfUse) === '1' ? '&recruitType=useSelf' : '';
963
- const talentObjId = String(cache.forms?.talent_pool?.objId || cache.forms?.talent?.objId || '');
964
- const talentCardUrl = cache.ebdDetailPageId
965
- ? `${baseUrl}/sp/ebdpage/view/${cache.ebdDetailPageId}?talentId=${talentId}${extra}`
966
- : (talentObjId ? `${baseUrl}/sp/ebdfpage/card/0/${talentObjId}/${talentId}` : null);
967
- const talentListId = cache.lists.talent?.listId;
968
- // 列表只打开列表(2026-11-06 用户定稿);人才卡片单页由 talentCardUrl 单独给出。
969
- const talentListLocateUrl = talentListId
970
- ? `${baseUrl}/sp/ebdfpage/list/${talentListId}`
971
- : null;
960
+ // ⑥ 产物链接:人才卡片与人才库列表地址一律由技能侧固定路由表产出(CLI 不回传原生页面地址)。
972
961
  const warnings = [...(payload.warnings || [])];
973
962
  if (batchNote)
974
963
  warnings.push(batchNote);
@@ -1032,8 +1021,6 @@ const candidateImportApply = {
1032
1021
  labelMatch,
1033
1022
  tagsApplied: tagResult.applied,
1034
1023
  tagsSkipped: tagResult.skipped,
1035
- talentCardUrl,
1036
- talentListLocateUrl,
1037
1024
  }, warnings.length ? { warnings } : undefined);
1038
1025
  },
1039
1026
  };