weaver-work-cli 0.1.73 → 0.1.76

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 (363) hide show
  1. package/README.md +37 -1
  2. package/dist/chunks/{archive-THZV4ND4.js → archive-ENBSUMHV.js} +14 -9
  3. package/dist/chunks/{archive-oa-PQ23OLEV.js → archive-oa-7BFPQ6M5.js} +10 -7
  4. package/dist/chunks/{asset-RGPROZYH.js → asset-V5SUD3PW.js} +10 -7
  5. package/dist/chunks/{asset-idle-Z2PDX7NA.js → asset-idle-3CEL7WFX.js} +7 -4
  6. package/dist/chunks/{attachment-content-R3RPVOYE.js → attachment-content-24RL44SE.js} +3 -3
  7. package/dist/chunks/{blog-7U3QZPIF.js → blog-FLI4SS3P.js} +10 -7
  8. package/dist/chunks/{caizhilian-3AB42GCV.js → caizhilian-7WCTKCCP.js} +10 -7
  9. package/dist/chunks/{calendar-KINM64E4.js → calendar-G726HUUH.js} +10 -7
  10. package/dist/chunks/chunk-257JXJGD.js +30 -0
  11. package/dist/chunks/chunk-2BZ7TY4M.js +49 -0
  12. package/dist/chunks/{chunk-4BXR6CNB.js → chunk-2KW7AI6P.js} +2 -2
  13. package/dist/chunks/{chunk-WM33BSIL.js → chunk-2QCCXPNU.js} +1 -1
  14. package/dist/chunks/chunk-2UV4IZIT.js +473 -0
  15. package/dist/chunks/{chunk-R3MK2RBN.js → chunk-5E2FDXBU.js} +1 -1
  16. package/dist/chunks/{chunk-DRUND2PJ.js → chunk-5QUTQHXF.js} +225 -152
  17. package/dist/chunks/chunk-7DE3VMZD.js +35 -0
  18. package/dist/chunks/{chunk-PAFOLIYQ.js → chunk-AZC53XSQ.js} +1 -1
  19. package/dist/chunks/{chunk-6HT73VOI.js → chunk-BWFCTE43.js} +2 -2
  20. package/dist/chunks/{chunk-4YXAK6OA.js → chunk-FEZK536Z.js} +12 -7
  21. package/dist/chunks/{chunk-IU6UB2TD.js → chunk-FPWCCRKT.js} +48 -6
  22. package/dist/chunks/{chunk-LLCMOZ5L.js → chunk-H6N6U2D6.js} +11 -11
  23. package/dist/chunks/{chunk-54ST55IJ.js → chunk-JJONWB5N.js} +11 -1
  24. package/dist/chunks/{chunk-GWJLAF6B.js → chunk-JWF2R6EQ.js} +0 -462
  25. package/dist/chunks/chunk-KINXYJXM.js +205 -0
  26. package/dist/chunks/{chunk-F4HM25K4.js → chunk-KJA7CRES.js} +1 -1
  27. package/dist/chunks/chunk-L5SCNJKX.js +1166 -0
  28. package/dist/chunks/{chunk-TV46Q4NY.js → chunk-MS7MKBGJ.js} +74 -68
  29. package/dist/chunks/{chunk-XZBYRYWX.js → chunk-NZQRW4KL.js} +2 -2
  30. package/dist/chunks/chunk-OJ4JPD25.js +428 -0
  31. package/dist/chunks/chunk-OVTCWLNQ.js +1346 -0
  32. package/dist/chunks/{chunk-NUP4RYZK.js → chunk-PMRNIGKZ.js} +2 -2
  33. package/dist/chunks/{chunk-2CHGUYMG.js → chunk-Q7RXCK2Y.js} +4 -4
  34. package/dist/chunks/{chunk-AMAPQVBT.js → chunk-QVKRNL7L.js} +286 -305
  35. package/dist/chunks/{chunk-7QFVXP2X.js → chunk-R4PN3OFK.js} +8 -7
  36. package/dist/chunks/{chunk-L7TYG5SN.js → chunk-RVEKGVZU.js} +2 -2
  37. package/dist/chunks/{chunk-2XED2FKY.js → chunk-SQFKBWTR.js} +38 -36
  38. package/dist/chunks/chunk-SU6IJD6D.js +49 -0
  39. package/dist/chunks/{chunk-IBSJJGXL.js → chunk-T7HVQ2WP.js} +2 -2
  40. package/dist/chunks/{chunk-ZWLWXHJC.js → chunk-TBCKK6LH.js} +2 -2
  41. package/dist/chunks/{chunk-JMJBPP4B.js → chunk-UDBQJLQF.js} +2 -2
  42. package/dist/chunks/chunk-UUJK76HV.js +209 -0
  43. package/dist/chunks/{chunk-4I26YMBY.js → chunk-WHI6YAUE.js} +7 -3
  44. package/dist/chunks/{chunk-BWYVS62Z.js → chunk-WJQJ7YEX.js} +4 -4
  45. package/dist/chunks/{chunk-GAMGDNTF.js → chunk-XNN5PZTI.js} +1 -1
  46. package/dist/chunks/chunk-Y3C6MDL7.js +28 -0
  47. package/dist/chunks/chunk-ZM7RN2IM.js +38 -0
  48. package/dist/chunks/cli-DFLV57LO.js +226 -0
  49. package/dist/chunks/commands-J52MJ6NF.js +70 -0
  50. package/dist/chunks/{conflict-VPAR7E6F.js → conflict-72Q6DM4I.js} +2 -2
  51. package/dist/chunks/{contract-DDXAO2DZ.js → contract-IRNRQ5FY.js} +12446 -5964
  52. package/dist/chunks/{cowork-34QCHMDD.js → cowork-GZDODGKF.js} +11 -8
  53. package/dist/chunks/{create-flow-52PU2OBI.js → create-flow-UGTDI7SP.js} +6 -6
  54. package/dist/chunks/{data-CLQ62QGD.js → data-HTQZRPPI.js} +6 -3
  55. package/dist/chunks/{ebuilder-form-W5R7Q22S.js → ebuilder-form-GHNIZ7ET.js} +9 -6
  56. package/dist/chunks/{ehr-LCNAVMK5.js → ehr-PHIBBUIG.js} +23 -16
  57. package/dist/chunks/{entry-mode-6Z3ZV3DE.js → entry-mode-5WOXFE67.js} +3 -3
  58. package/dist/chunks/{env-RDKWAARB.js → env-H4ALHESA.js} +2 -2
  59. package/dist/chunks/{esb-ANKPUU65.js → esb-ATRKVHCD.js} +10 -7
  60. package/dist/chunks/{factory-434B7RAT.js → factory-COX6AVK7.js} +1 -1
  61. package/dist/chunks/{fna-AKBSG5HI.js → fna-IKYI3SST.js} +13 -8
  62. package/dist/chunks/{group-chat-PROTW22R.js → group-chat-ZIWQQO4G.js} +3 -3
  63. package/dist/chunks/{host-5R2SNFWD.js → host-6UOXYOOY.js} +6 -3
  64. package/dist/chunks/{host-7FJW4E7R.js → host-EJSJSLVK.js} +6 -3
  65. package/dist/chunks/{host-WO4L5G5I.js → host-EYNLB6S4.js} +6 -3
  66. package/dist/chunks/{host-PDJAKCT7.js → host-OT4KNR3G.js} +6 -3
  67. package/dist/chunks/{host-CGXUFQO4.js → host-UY4LQPN4.js} +6 -3
  68. package/dist/chunks/{host-XIYG4F4B.js → host-XXGDQM7D.js} +6 -3
  69. package/dist/chunks/{hrm-WGODDTEH.js → hrm-5JQ7QZ6A.js} +8 -5
  70. package/dist/chunks/{im-YKTKAJU3.js → im-2YJW3EI5.js} +7 -4
  71. package/dist/chunks/{invoice-PVYCCCVM.js → invoice-37HR6L3W.js} +956 -566
  72. package/dist/chunks/{jiuchuanhui-RKOQW7BY.js → jiuchuanhui-KBWUZ7WT.js} +17 -10
  73. package/dist/chunks/{lazy-dispatch-DW45AFQ5.js → lazy-dispatch-MZ3EZYDL.js} +22 -8
  74. package/dist/chunks/{mail-BNB5S4NW.js → mail-YBKUM6HM.js} +11 -8
  75. package/dist/chunks/{meeting-O2KDJH66.js → meeting-XE6CTXYA.js} +22 -18
  76. package/dist/chunks/{minute-doc-JUCG56GY.js → minute-doc-4BA2R5EA.js} +4 -4
  77. package/dist/chunks/{okr-LWFGWOE7.js → okr-HW7IULIR.js} +10 -7
  78. package/dist/chunks/{operations-532PN5OB.js → operations-4P2UYVLH.js} +7 -4
  79. package/dist/chunks/{performance-7W5COCFU.js → performance-PM2G6L3E.js} +6 -3
  80. package/dist/chunks/{plan-ZVY3IYTL.js → plan-3YYGZ7ZM.js} +10 -7
  81. package/dist/chunks/{project-SA62B7MH.js → project-XREEXFU2.js} +10 -7
  82. package/dist/chunks/{reception-NGIONPQ3.js → reception-7G3J2MA6.js} +8 -4
  83. package/dist/chunks/{recruit-stage-WOSN6MGP.js → recruit-stage-TSQWOGQD.js} +199 -74
  84. package/dist/chunks/register-SQOPIR2G.js +16 -0
  85. package/dist/chunks/{registry-N7P3W2RD.js → registry-3VTB3KLV.js} +7 -4
  86. package/dist/chunks/registry-7UDUWYB5.js +30 -0
  87. package/dist/chunks/{registry-R72GWXOG.js → registry-F4YFZLOD.js} +7 -3
  88. package/dist/chunks/{room-recommend-KCGIVUFR.js → room-recommend-FO3HLPNB.js} +4 -4
  89. package/dist/chunks/root-YZG2TS5W.js +16 -0
  90. package/dist/chunks/{schedule-6UP27HQ4.js → schedule-DHNNOHVS.js} +4 -4
  91. package/dist/chunks/{smart-extract-DDOQSPRB.js → smart-extract-T5Z4AULN.js} +15 -7
  92. package/dist/chunks/update-AV5VOXGY.js +13 -0
  93. package/dist/chunks/{workflow-V5ALD6QZ.js → workflow-MAGCHWYZ.js} +15 -10
  94. package/dist/cli.js +40 -0
  95. package/dist/cmd/action.js +3 -1
  96. package/dist/cmd/doctor/index.js +1 -1
  97. package/dist/cmd/e10/index.js +1 -1
  98. package/dist/cmd/identity/index.js +5 -8
  99. package/dist/cmd/index.js +2 -0
  100. package/dist/cmd/setup/index.js +1 -1
  101. package/dist/cmd/update/index.js +38 -0
  102. package/dist/core/manifest-view.js +1 -1
  103. package/dist/core/output.js +8 -1
  104. package/dist/core/runtime-agent.js +13 -0
  105. package/dist/core/update-notice.js +23 -0
  106. package/dist/index.js +105 -198
  107. package/dist/internal/e10/auth/agent-host-key.js +16 -0
  108. package/dist/internal/e10/auth/agent-hosts.js +45 -9
  109. package/dist/internal/e10/auth/commands.js +66 -36
  110. package/dist/internal/e10/auth/session.js +30 -15
  111. package/dist/internal/e10/auth/xiaoe.js +4 -20
  112. package/dist/internal/e10/auth-recovery.js +44 -4
  113. package/dist/internal/e10/context.js +5 -2
  114. package/dist/internal/update/bootstrap.js +96 -0
  115. package/dist/internal/update/npm.js +78 -0
  116. package/dist/internal/update/service.js +252 -0
  117. package/dist/internal/update/store.js +135 -0
  118. package/dist/shortcuts/archive/index.js +2 -2
  119. package/dist/shortcuts/archive/manifest.js +1 -0
  120. package/dist/shortcuts/archive/operations/search.js +3 -1
  121. package/dist/shortcuts/archive-oa/index.js +1 -1
  122. package/dist/shortcuts/asset/index.js +1 -1
  123. package/dist/shortcuts/asset-idle/index.js +1 -1
  124. package/dist/shortcuts/blog/index.js +1 -1
  125. package/dist/shortcuts/caizhilian/index.js +1 -1
  126. package/dist/shortcuts/calendar/index.js +1 -1
  127. package/dist/shortcuts/contract/data/bi-config.js +156 -0
  128. package/dist/shortcuts/contract/data/collection-ledger-html.js +189 -0
  129. package/dist/shortcuts/contract/data/collection-node-catalog.js +226 -0
  130. package/dist/shortcuts/contract/data/metric-catalog.js +154 -20
  131. package/dist/shortcuts/contract/data/report-renderers.js +414 -0
  132. package/dist/shortcuts/contract/data/report-spec.js +132 -0
  133. package/dist/shortcuts/contract/error-actions.js +114 -0
  134. package/dist/shortcuts/contract/host.js +12 -3
  135. package/dist/shortcuts/contract/index.js +17 -1
  136. package/dist/shortcuts/contract/manifest.js +398 -3
  137. package/dist/shortcuts/contract/ooxml/docx-table.js +48 -0
  138. package/dist/shortcuts/contract/operations/bi-preview.js +131 -0
  139. package/dist/shortcuts/contract/operations/bizreview-report.js +496 -0
  140. package/dist/shortcuts/contract/operations/collection-node.js +229 -0
  141. package/dist/shortcuts/contract/operations/docx-slots.js +735 -16
  142. package/dist/shortcuts/contract/operations/draft-build.js +940 -0
  143. package/dist/shortcuts/contract/operations/draft-submit.js +229 -0
  144. package/dist/shortcuts/contract/operations/first-screen.js +3 -2
  145. package/dist/shortcuts/contract/operations/generated-submit.js +175 -0
  146. package/dist/shortcuts/contract/operations/ledger-report.js +233 -0
  147. package/dist/shortcuts/contract/operations/ledger-stat.js +1400 -0
  148. package/dist/shortcuts/contract/operations/ledger.js +4 -1
  149. package/dist/shortcuts/contract/operations/metrics.js +9 -3
  150. package/dist/shortcuts/contract/operations/ops-draft.js +527 -0
  151. package/dist/shortcuts/contract/operations/page.js +9 -0
  152. package/dist/shortcuts/contract/operations/quote-submit.js +55 -229
  153. package/dist/shortcuts/contract/operations/registry.js +20 -0
  154. package/dist/shortcuts/contract/operations/sign-launch.js +256 -0
  155. package/dist/shortcuts/contract/operations/viewlink.js +334 -0
  156. package/dist/shortcuts/cowork/index.js +2 -2
  157. package/dist/shortcuts/ebuilder-form/index.js +1 -1
  158. package/dist/shortcuts/ehr/index.js +2 -2
  159. package/dist/shortcuts/ehr/manifest.js +1 -1
  160. package/dist/shortcuts/ehr/operations/recruit-position.js +7 -2
  161. package/dist/shortcuts/ehr/operations/recruit-write.js +7 -6
  162. package/dist/shortcuts/ehr/operations/recruit.js +318 -248
  163. package/dist/shortcuts/ehr/operations/shared.js +22 -2
  164. package/dist/shortcuts/esb/index.js +1 -1
  165. package/dist/shortcuts/fna/index.js +1 -1
  166. package/dist/shortcuts/fna/manifest.js +1 -0
  167. package/dist/shortcuts/fna/operations/expense-chart.js +3 -1
  168. package/dist/shortcuts/hrm/index.js +1 -1
  169. package/dist/shortcuts/invoice/business-response.js +13 -0
  170. package/dist/shortcuts/invoice/calendar.js +24 -0
  171. package/dist/shortcuts/invoice/host.js +26 -15
  172. package/dist/shortcuts/invoice/index.js +3 -3
  173. package/dist/shortcuts/invoice/invoice-record.js +7 -2
  174. package/dist/shortcuts/invoice/manifest.js +179 -155
  175. package/dist/shortcuts/invoice/operations/get.js +9 -3
  176. package/dist/shortcuts/invoice/operations/issuing-red-requests.js +138 -0
  177. package/dist/shortcuts/invoice/operations/registry.js +4 -5
  178. package/dist/shortcuts/invoice/operations/reim-auto.js +40 -2
  179. package/dist/shortcuts/invoice/operations/reim-customer-projects.js +79 -0
  180. package/dist/shortcuts/invoice/operations/reim-customer.js +79 -30
  181. package/dist/shortcuts/invoice/operations/reim-relation.js +0 -146
  182. package/dist/shortcuts/invoice/operations/reim.js +2 -126
  183. package/dist/shortcuts/invoice/operations/shared.js +15 -17
  184. package/dist/shortcuts/invoice/preapproval-enrichment.js +180 -0
  185. package/dist/shortcuts/invoice/projection.js +14 -0
  186. package/dist/shortcuts/invoice/read-enrichment.js +123 -0
  187. package/dist/shortcuts/jiuchuanhui/index.js +2 -2
  188. package/dist/shortcuts/jiuchuanhui/manifest.js +3 -0
  189. package/dist/shortcuts/mail/index.js +2 -2
  190. package/dist/shortcuts/meeting/index.js +1 -1
  191. package/dist/shortcuts/meeting/manifest.js +1 -0
  192. package/dist/shortcuts/meeting/operations/eb/catalog.js +5 -3
  193. package/dist/shortcuts/meeting/operations/eb/conflict.js +3 -1
  194. package/dist/shortcuts/meeting/operations/eb/create-flow.js +10 -9
  195. package/dist/shortcuts/meeting/operations/eb/factory.js +2 -0
  196. package/dist/shortcuts/meeting/operations/eb/member-expand.js +3 -2
  197. package/dist/shortcuts/meeting/operations/invitation-publish.js +3 -3
  198. package/dist/shortcuts/meeting/operations/invitation.js +4 -4
  199. package/dist/shortcuts/meeting/operations/link.js +3 -1
  200. package/dist/shortcuts/okr/index.js +1 -1
  201. package/dist/shortcuts/performance/index.js +1 -1
  202. package/dist/shortcuts/plan/index.js +1 -1
  203. package/dist/shortcuts/project/index.js +1 -1
  204. package/dist/shortcuts/reception/manifest.js +2 -2
  205. package/dist/shortcuts/recruit-stage/context.js +10 -2
  206. package/dist/shortcuts/recruit-stage/index.js +16 -3
  207. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +1 -1
  208. package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +1 -1
  209. package/dist/shortcuts/recruit-stage/operations/jd-create.js +17 -8
  210. package/dist/shortcuts/recruit-stage/operations/list.js +1 -1
  211. package/dist/shortcuts/recruit-stage/operations/resume-import.js +178 -35
  212. package/dist/shortcuts/recruit-stage/operations/search.js +2 -2
  213. package/dist/shortcuts/recruit-stage/operations/shortlist.js +4 -2
  214. package/dist/shortcuts/recruit-stage/shared.js +27 -53
  215. package/dist/shortcuts/smart-extract/manifest.js +1 -0
  216. package/dist/shortcuts/smart-extract/operations/fill.js +7 -2
  217. package/dist/shortcuts/smart-extract/operations/validate.js +4 -1
  218. package/dist/shortcuts/workflow/index.js +2 -2
  219. package/dist/shortcuts/workflow/manifest.js +1 -0
  220. package/dist/shortcuts/workflow/operations/aiDeepRead/render.js +4 -1
  221. package/dist/shortcuts/workflow/operations/deepRead.js +23 -2
  222. package/dist/shortcuts/workflow/operations/form.js +8 -2
  223. package/docs/agent-invoice.md +28 -2
  224. package/docs/contract.md +6 -1
  225. package/docs/e10-auth.md +25 -7
  226. package/docs/invoice.md +60 -9
  227. package/docs/operation-manual.md +15 -0
  228. package/package.json +2 -2
  229. package/skill-template/business-info.json +28 -0
  230. package/skill-template/domains/jinchengda.md +13 -1
  231. package/skill-template/domains/yepiaotong.md +36 -7
  232. package/skills/weaver-e10-archive-oa/references/source-manifest.json +3 -3
  233. package/skills/weaver-e10-caizhilian/references/auth-and-install.md +2 -1
  234. package/skills/weaver-e10-caizhilian/references/source-manifest.json +3 -3
  235. package/skills/weaver-e10-esb/references/source-manifest.json +3 -3
  236. package/skills/weaver-e10-jinchengda/SKILL.md +90 -32
  237. package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +45 -0
  238. package/skills/weaver-e10-jinchengda/references/contract-bizreview-report-template.html +68 -0
  239. package/skills/weaver-e10-jinchengda/references/contract-bizreview.md +216 -0
  240. package/skills/weaver-e10-jinchengda/references/contract-clause-negotiate.md +215 -0
  241. package/skills/weaver-e10-jinchengda/references/contract-collection-node.md +113 -0
  242. package/skills/weaver-e10-jinchengda/references/contract-command-index.md +19 -3
  243. package/skills/weaver-e10-jinchengda/references/contract-decisions.md +114 -0
  244. package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +53 -44
  245. package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +1 -1
  246. package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +1 -1
  247. package/skills/weaver-e10-jinchengda/references/contract-firstscreen-guide.md +200 -0
  248. package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +18 -1
  249. package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +138 -3
  250. package/skills/weaver-e10-jinchengda/references/contract-ledger-report.md +158 -0
  251. package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +3 -1
  252. package/skills/weaver-e10-jinchengda/references/contract-material-gap.md +139 -0
  253. package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +2 -2
  254. package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +10 -3
  255. package/skills/weaver-e10-jinchengda/references/contract-ops-draft.md +106 -0
  256. package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +1 -1
  257. package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +176 -56
  258. package/skills/weaver-e10-jinchengda/references/contract-sign-launch.md +123 -0
  259. package/skills/weaver-e10-jinchengda/references/contract-smart-draft.md +410 -0
  260. package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +1 -1
  261. package/skills/weaver-e10-jinchengda/references/contract-viewlink.md +110 -0
  262. package/skills/weaver-e10-jinchengda/references/orchestration.md +38 -24
  263. package/skills/weaver-e10-meeting/SKILL.md +13 -0
  264. package/skills/weaver-e10-okr/SKILL.md +11 -0
  265. package/skills/weaver-e10-okr/references/source-manifest.json +7 -6
  266. package/skills/weaver-e10-performance/SKILL.md +131 -39
  267. package/skills/weaver-e10-performance/agents/openai.yaml +48 -17
  268. package/skills/weaver-e10-performance/references/default-assembly.md +3 -0
  269. package/skills/weaver-e10-performance/references/extraction-guide.md +17 -3
  270. package/skills/weaver-e10-performance/references/flow-assess.md +38 -5
  271. package/skills/weaver-e10-performance/references/scheme-setting-page.md +20 -3
  272. package/skills/weaver-e10-performance/scripts/assemble_scheme.py +461 -0
  273. package/skills/weaver-e10-performance/scripts/parse_appraisal_doc.py +41 -0
  274. package/skills/weaver-e10-plan/SKILL.md +10 -0
  275. package/skills/weaver-e10-plan/references/source-manifest.json +13 -13
  276. package/skills/weaver-e10-qiyecheng/SKILL.md +2 -2
  277. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +9 -9
  278. package/skills/weaver-e10-recruit-stage/SKILL.md +230 -202
  279. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +74 -46
  280. package/skills/weaver-e10-recruit-stage/lib/interview-conflict.mjs +3 -0
  281. package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +201 -36
  282. package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +336 -27
  283. package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +3 -0
  284. package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +15 -1
  285. package/skills/weaver-e10-recruit-stage/lib/report-attachment.mjs +38 -0
  286. package/skills/weaver-e10-recruit-stage/lib/xiaoe-session.mjs +5 -1
  287. package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +4 -0
  288. package/skills/weaver-e10-recruit-stage/references/env-ziyong.md +4 -0
  289. package/skills/weaver-e10-recruit-stage/references/position-templates.md +12 -8
  290. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +20 -18
  291. package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +11 -7
  292. package/skills/weaver-e10-recruit-stage/references/recruit-check-install.md +5 -1
  293. package/skills/weaver-e10-recruit-stage/references/recruit-detail-process.md +4 -0
  294. package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +8 -4
  295. package/skills/weaver-e10-recruit-stage/references/recruit-failure-fallback.md +6 -1
  296. package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +7 -3
  297. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +32 -25
  298. package/skills/weaver-e10-recruit-stage/references/recruit-jd-template.md +4 -0
  299. package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +4 -0
  300. package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +5 -1
  301. package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +4 -0
  302. package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +16 -10
  303. package/skills/weaver-e10-recruit-stage/references/recruit-my-positions.md +6 -2
  304. package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +148 -40
  305. package/skills/weaver-e10-recruit-stage/references/recruit-platform-compat.md +5 -1
  306. package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +32 -8
  307. package/skills/weaver-e10-recruit-stage/references/recruit-resolve-creator.md +4 -0
  308. package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +8 -4
  309. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +6 -2
  310. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +41 -41
  311. package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +7 -3
  312. package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +7 -3
  313. package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +8 -4
  314. package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +5 -1
  315. package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +5 -1
  316. package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +5 -1
  317. package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +41 -28
  318. package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +23 -26
  319. package/skills/weaver-e10-recruit-stage/templates/match-report.html +44 -36
  320. package/skills/weaver-e10-shared/SKILL.md +40 -5
  321. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +11 -1
  322. package/skills/weaver-e10-shared/references/json-output-contract.md +144 -8
  323. package/skills/weaver-e10-shared/references/weaver-e10-installation.md +11 -0
  324. package/skills/weaver-e10-shijingran/references/source-manifest.json +3 -3
  325. package/skills/weaver-e10-wenshuding/references/source-manifest.json +3 -3
  326. package/skills/weaver-e10-workflow/references/source-manifest.json +3 -3
  327. package/skills/weaver-e10-yepiaotong/SKILL.md +133 -61
  328. package/skills/weaver-e10-yepiaotong/references/invoice-add.md +3 -1
  329. package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +18 -2
  330. package/skills/weaver-e10-yepiaotong/references/invoice-disabled-capabilities.md +3 -3
  331. package/skills/weaver-e10-yepiaotong/references/invoice-download.md +1 -1
  332. package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +13 -1
  333. package/skills/weaver-e10-yepiaotong/references/invoice-file-upload.md +3 -1
  334. package/skills/weaver-e10-yepiaotong/references/invoice-import.md +6 -4
  335. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +42 -45
  336. package/skills/weaver-e10-yepiaotong/references/invoice-ocr-preview.md +1 -1
  337. package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +18 -2
  338. package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +14 -1
  339. package/skills/weaver-e10-yepiaotong/references/invoice-red-workflow.md +96 -0
  340. package/skills/weaver-e10-yepiaotong/references/invoice-reim-relation.md +56 -369
  341. package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +16 -6
  342. package/skills/weaver-e10-yepiaotong/references/name-fuzzy-search.md +38 -0
  343. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +163 -646
  344. package/skills/weaver-e10-yepiaotong/references/reim-customer-search.md +90 -44
  345. package/skills/weaver-e10-yepiaotong/references/reim-eligibility-rules.md +85 -0
  346. package/skills/weaver-e10-yepiaotong/references/reim-fill-validation.md +61 -0
  347. package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +91 -280
  348. package/skills/weaver-e10-yepiaotong/references/reim-preapproval-rules.md +98 -0
  349. package/skills/weaver-e10-yepiaotong/references/reim-travel-invoice-matching.md +48 -0
  350. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +234 -695
  351. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +395 -204
  352. package/skills/weaver-e10-yepiaotong/references/travel-application-fill.md +84 -0
  353. package/skills/weaver-e10-yepiaotong/references/workflow-direct-fill.md +165 -0
  354. package/skills/weaver-e10-yepiaotong.zip +0 -0
  355. package/dist/chunks/chunk-ICP53R52.js +0 -2849
  356. package/dist/chunks/registry-RIQ67ZT7.js +0 -27
  357. package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
  358. package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
  359. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +0 -93
  360. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +0 -774
  361. package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +0 -111
  362. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +0 -360
  363. package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +0 -167
@@ -1,20 +1,5 @@
1
1
  import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
- import {
4
- createE10RequestRuntime,
5
- isE10SessionExpiredResponse,
6
- requireE10Session
7
- } from "./chunk-IU6UB2TD.js";
8
- import {
9
- E10_REAUTH_GUIDANCE,
10
- E10_SESSION_EXPIRED_MESSAGE
11
- } from "./chunk-IZCQU5D5.js";
12
- import {
13
- getActiveProfile
14
- } from "./chunk-AMAPQVBT.js";
15
- import {
16
- CliError
17
- } from "./chunk-UG5G54VL.js";
18
3
  import {
19
4
  __commonJS,
20
5
  __require,
@@ -3314,446 +3299,6 @@ var require_commander = __commonJS({
3314
3299
  }
3315
3300
  });
3316
3301
 
3317
- // src/shortcuts/invoice/errors.ts
3318
- var InvoiceCliError = class extends CliError {
3319
- type;
3320
- subtype;
3321
- code;
3322
- retryable;
3323
- stage;
3324
- details;
3325
- partialData;
3326
- constructor(type, subtype, message, options = {}) {
3327
- super(message, options.exitCode ?? 5 /* InternalError */);
3328
- this.name = "InvoiceCliError";
3329
- this.type = type;
3330
- this.subtype = subtype;
3331
- this.code = options.code;
3332
- this.retryable = options.retryable ?? false;
3333
- this.stage = options.stage;
3334
- this.details = options.details;
3335
- this.partialData = options.partialData;
3336
- }
3337
- };
3338
- function invoiceValidationError(subtype, message, details) {
3339
- return new InvoiceCliError("validation", subtype, message, {
3340
- details,
3341
- exitCode: 2 /* UsageError */
3342
- });
3343
- }
3344
- function invoiceAuthError(subtype, message, details) {
3345
- return new InvoiceCliError("authentication", subtype, message, {
3346
- details,
3347
- exitCode: 3 /* AuthError */
3348
- });
3349
- }
3350
- function invoiceNetworkError(subtype, message, options = {}) {
3351
- return new InvoiceCliError("network", subtype, message, {
3352
- ...options,
3353
- retryable: options.retryable ?? true,
3354
- exitCode: 4 /* NetworkError */
3355
- });
3356
- }
3357
- function invoiceConfirmationError(action, details) {
3358
- return new InvoiceCliError("confirmation", "required", "\u8BE5\u64CD\u4F5C\u9700\u8981\u660E\u786E\u786E\u8BA4", {
3359
- details: { action, ...details },
3360
- exitCode: 10 /* ConfirmationRequired */
3361
- });
3362
- }
3363
- function invoicePartialError(message, partialData, details) {
3364
- return new InvoiceCliError("partial", "write_uncertain", message, {
3365
- details,
3366
- partialData,
3367
- exitCode: 11 /* Partial */
3368
- });
3369
- }
3370
- function isInvoiceNetworkError(error) {
3371
- return Boolean(
3372
- error && typeof error === "object" && "type" in error && error.type === "network"
3373
- );
3374
- }
3375
-
3376
- // src/shortcuts/invoice/host.ts
3377
- import { createHash } from "node:crypto";
3378
- import { readFile } from "node:fs/promises";
3379
- var MAX_DOWNLOAD_BYTES = 50 * 1024 * 1024;
3380
- var TOKEN_SERVICE = "cn.weaver.weaver-work-cli.invoice-token";
3381
- var INVOICE_SESSION_EXPIRED_CODE = "-2";
3382
- function assertPath(requestPath) {
3383
- if (typeof requestPath !== "string" || !requestPath.startsWith("/") || requestPath.startsWith("//")) {
3384
- throw invoiceValidationError("path_invalid", "\u8BF7\u6C42\u8DEF\u5F84\u5FC5\u987B\u662F\u76F8\u5BF9\u7EDD\u5BF9\u8DEF\u5F84");
3385
- }
3386
- if (/^https?:/i.test(requestPath) || /[\r\n]/.test(requestPath) || requestPath.includes("/../")) {
3387
- throw invoiceValidationError("path_invalid", "\u8BF7\u6C42\u8DEF\u5F84\u4E0D\u5141\u8BB8\u8DE8\u57DF\u6216\u8DEF\u5F84\u9003\u9038");
3388
- }
3389
- if (!requestPath.startsWith("/api/")) {
3390
- throw invoiceValidationError("path_not_allowed", "\u4E1A\u7968\u901A\u53EA\u80FD\u8C03\u7528 /api/ \u8DEF\u5F84");
3391
- }
3392
- }
3393
- function responseRoot(value) {
3394
- return value?.res_base || value?.data?.res_base || value;
3395
- }
3396
- function responseMessage(value) {
3397
- const root = responseRoot(value);
3398
- return typeof root?.message === "string" ? root.message : typeof root?.msg === "string" ? root.msg : "\u6CDB\u5FAE\u63A5\u53E3\u8FD4\u56DE\u4E1A\u52A1\u5931\u8D25";
3399
- }
3400
- function responseCode(value) {
3401
- const root = responseRoot(value);
3402
- return root?.ret ?? root?.code;
3403
- }
3404
- function isInvoiceSessionExpired(value) {
3405
- const code = responseCode(value);
3406
- return code !== void 0 && String(code) === INVOICE_SESSION_EXPIRED_CODE;
3407
- }
3408
- function tokenAccount(session) {
3409
- return createHash("sha256").update(`${session.profile}
3410
- ${session.baseUrl}
3411
- ${session.userId}`).digest("hex");
3412
- }
3413
- function createInvoiceTokenStore(session) {
3414
- const account = tokenAccount(session);
3415
- let entryPromise = null;
3416
- async function entry() {
3417
- if (!entryPromise) {
3418
- entryPromise = import("@napi-rs/keyring").then(({ Entry }) => new Entry(TOKEN_SERVICE, account));
3419
- }
3420
- return entryPromise;
3421
- }
3422
- return {
3423
- async load() {
3424
- try {
3425
- const value = await (await entry()).getPassword();
3426
- return typeof value === "string" && value.trim() ? value : null;
3427
- } catch {
3428
- return null;
3429
- }
3430
- },
3431
- async save(token) {
3432
- if (!token.trim()) return false;
3433
- try {
3434
- await (await entry()).setPassword(token);
3435
- return true;
3436
- } catch {
3437
- return false;
3438
- }
3439
- },
3440
- async clear() {
3441
- try {
3442
- await (await entry()).deletePassword();
3443
- return true;
3444
- } catch {
3445
- return false;
3446
- }
3447
- }
3448
- };
3449
- }
3450
- async function clearInvoiceTokenForSession(session) {
3451
- return createInvoiceTokenStore(session).clear();
3452
- }
3453
- function inferProfile(ctx) {
3454
- const options = ctx.getGlobalOptions();
3455
- return options.profile || getActiveProfile();
3456
- }
3457
- function trustedInvoiceHeaders(invoiceToken) {
3458
- return invoiceToken ? { token: invoiceToken } : {};
3459
- }
3460
- function createInvoiceHost(ctx, dependencies = {}) {
3461
- let e10Session = null;
3462
- let sessionContext = null;
3463
- let invoiceToken = null;
3464
- let tokenStore = null;
3465
- const requireSession = dependencies.requireSession || requireE10Session;
3466
- const tokenStoreFactory = dependencies.tokenStoreFactory || createInvoiceTokenStore;
3467
- async function ensureSession() {
3468
- if (!e10Session) {
3469
- e10Session = await requireSession(ctx);
3470
- sessionContext = {
3471
- baseUrl: e10Session.getBaseUrl(),
3472
- profile: inferProfile(ctx),
3473
- userId: e10Session.userId
3474
- };
3475
- }
3476
- return e10Session;
3477
- }
3478
- async function getSession() {
3479
- await ensureSession();
3480
- return sessionContext;
3481
- }
3482
- async function ensureInvoiceToken(timeoutMs = 3e4) {
3483
- await ensureSession();
3484
- const context = await getSession();
3485
- tokenStore ||= tokenStoreFactory(context);
3486
- if (invoiceToken) return invoiceToken;
3487
- invoiceToken = await tokenStore.load();
3488
- if (invoiceToken) return invoiceToken;
3489
- const tokenResponse = await invoiceRequest({
3490
- method: "GET",
3491
- path: "/api/inc/proxy/getToken",
3492
- query: { appType: 1 },
3493
- needsInvoiceToken: false,
3494
- timeoutMs
3495
- });
3496
- const token = tokenResponse?.data?.token;
3497
- if (typeof token !== "string" || !token.trim()) {
3498
- throw invoiceAuthError("invoice_token_missing", "\u672A\u53D6\u5F97\u4E1A\u7968\u901A\u4E1A\u52A1 Token");
3499
- }
3500
- await tokenStore.save(token);
3501
- invoiceToken = token;
3502
- return token;
3503
- }
3504
- async function ensureContext(needsInvoiceToken, timeoutMs, path) {
3505
- await ensureSession();
3506
- const tokenEndpoint = path === "/api/inc/proxy/getToken" || path === "/api/app/inc/proxy/getToken";
3507
- if (tokenEndpoint) return void 0;
3508
- if (!needsInvoiceToken) {
3509
- }
3510
- return ensureInvoiceToken(timeoutMs);
3511
- }
3512
- async function clearCachedInvoiceToken() {
3513
- invoiceToken = null;
3514
- await tokenStore?.clear().catch(() => false);
3515
- }
3516
- async function runtime() {
3517
- return createE10RequestRuntime(ctx, await ensureSession(), {
3518
- interceptors: dependencies.interceptors,
3519
- fetch: dependencies.fetch
3520
- });
3521
- }
3522
- function businessError(value) {
3523
- const code = responseCode(value);
3524
- return new InvoiceCliError("api", "business_error", responseMessage(value), {
3525
- code: String(code),
3526
- details: { ret: code },
3527
- exitCode: 1
3528
- });
3529
- }
3530
- async function handleBusinessResponse(value, retry, canRetry) {
3531
- const code = responseCode(value);
3532
- if (code === void 0 || code === 0 || code === 200) return value;
3533
- if (isInvoiceSessionExpired(value)) {
3534
- await clearCachedInvoiceToken();
3535
- if (canRetry) return retry();
3536
- throw invoiceAuthError(
3537
- "invoice_session_expired",
3538
- `\u53D1\u7968\u4E1A\u52A1\u767B\u5F55\u6001\u5DF2\u5931\u6548\uFF0C\u5DF2\u6E05\u7406\u672C\u5730\u53D1\u7968 Token\u3002${E10_REAUTH_GUIDANCE}`,
3539
- { ret: code }
3540
- );
3541
- }
3542
- throw businessError(value);
3543
- }
3544
- async function invoiceRequest(request, canRetryExpiredToken = true) {
3545
- const {
3546
- method = "POST",
3547
- path,
3548
- query,
3549
- headers,
3550
- body,
3551
- operation,
3552
- needsInvoiceToken = true,
3553
- timeoutMs = 3e4
3554
- } = request;
3555
- assertPath(path);
3556
- const token = await ensureContext(needsInvoiceToken, timeoutMs, path);
3557
- const response = await (await runtime()).requestJson({
3558
- module: "invoice",
3559
- operation,
3560
- method,
3561
- path,
3562
- query,
3563
- headers,
3564
- body,
3565
- timeoutMs,
3566
- trustedHeaders: trustedInvoiceHeaders(token)
3567
- });
3568
- if (isE10SessionExpiredResponse(response)) {
3569
- throw invoiceAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
3570
- }
3571
- if (response.parseError) {
3572
- if (response.status < 200 || response.status >= 300) {
3573
- throw new InvoiceCliError("api", "http_error", `\u6CDB\u5FAE\u63A5\u53E3 HTTP ${response.status}`, {
3574
- code: response.status,
3575
- details: { status: response.status },
3576
- exitCode: 1
3577
- });
3578
- }
3579
- throw invoiceNetworkError("protocol", `\u63A5\u53E3\u8FD4\u56DE\u4E0D\u662F\u5408\u6CD5 JSON\uFF08HTTP ${response.status}\uFF09`, { retryable: false });
3580
- }
3581
- if (response.status < 200 || response.status >= 300) {
3582
- throw new InvoiceCliError("api", "http_error", `\u6CDB\u5FAE\u63A5\u53E3 HTTP ${response.status}`, {
3583
- code: response.status,
3584
- details: { status: response.status, message: responseMessage(response.value) },
3585
- exitCode: 1
3586
- });
3587
- }
3588
- let value = response.value;
3589
- if (request.rewriteJsonText && response.text) {
3590
- try {
3591
- value = JSON.parse(request.rewriteJsonText(response.text));
3592
- } catch {
3593
- value = response.value;
3594
- }
3595
- }
3596
- return handleBusinessResponse(value, () => invoiceRequest(request, false), canRetryExpiredToken && Boolean(token));
3597
- }
3598
- async function invoiceMultipartRequest(request, canRetryExpiredToken = true) {
3599
- const {
3600
- method = "POST",
3601
- path,
3602
- query,
3603
- fields = {},
3604
- file,
3605
- headers,
3606
- operation,
3607
- needsInvoiceToken = true,
3608
- timeoutMs = 3e4
3609
- } = request;
3610
- if (!file && !Object.values(fields).some((value) => value !== void 0 && value !== null && value !== "")) {
3611
- throw invoiceValidationError("input_invalid", "multipart \u8BF7\u6C42\u9700\u8981\u6587\u4EF6\u3001URL \u6216\u8868\u5355\u5B57\u6BB5");
3612
- }
3613
- assertPath(path);
3614
- const token = await ensureContext(needsInvoiceToken, timeoutMs, path);
3615
- const form = new FormData();
3616
- for (const [key, value] of Object.entries(fields)) {
3617
- if (value === void 0 || value === null) continue;
3618
- form.append(key, typeof value === "string" ? value : JSON.stringify(value));
3619
- }
3620
- if (file) {
3621
- const content = await readFile(file.path);
3622
- form.append("file", new Blob([content], { type: file.mimeType || "application/octet-stream" }), file.name);
3623
- }
3624
- const response = await (await runtime()).requestJson({
3625
- module: "invoice",
3626
- operation,
3627
- method,
3628
- path,
3629
- query,
3630
- headers,
3631
- formData: form,
3632
- timeoutMs,
3633
- trustedHeaders: trustedInvoiceHeaders(token)
3634
- });
3635
- if (isE10SessionExpiredResponse(response)) {
3636
- throw invoiceAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
3637
- }
3638
- if (response.parseError) {
3639
- throw invoiceNetworkError("protocol", `\u63A5\u53E3\u8FD4\u56DE\u4E0D\u662F\u5408\u6CD5 JSON\uFF08HTTP ${response.status}\uFF09`, { retryable: false });
3640
- }
3641
- if (response.status < 200 || response.status >= 300) {
3642
- throw new InvoiceCliError("api", "http_error", `\u6CDB\u5FAE\u63A5\u53E3 HTTP ${response.status}`, {
3643
- code: response.status,
3644
- details: { status: response.status, message: responseMessage(response.value) },
3645
- exitCode: 1
3646
- });
3647
- }
3648
- return handleBusinessResponse(response.value, () => invoiceMultipartRequest(request, false), canRetryExpiredToken && Boolean(token));
3649
- }
3650
- async function invoiceFormRequest(request, canRetryExpiredToken = true) {
3651
- const {
3652
- method = "POST",
3653
- path,
3654
- query,
3655
- fields = {},
3656
- operation,
3657
- needsInvoiceToken = true,
3658
- timeoutMs = 3e4
3659
- } = request;
3660
- assertPath(path);
3661
- const token = await ensureContext(needsInvoiceToken, timeoutMs, path);
3662
- const form = new URLSearchParams();
3663
- for (const [key, value] of Object.entries(fields)) {
3664
- if (value === void 0 || value === null) continue;
3665
- form.set(key, typeof value === "string" ? value : JSON.stringify(value));
3666
- }
3667
- const response = await (await runtime()).requestJson({
3668
- module: "invoice",
3669
- operation,
3670
- method,
3671
- path,
3672
- query,
3673
- form,
3674
- timeoutMs,
3675
- trustedHeaders: trustedInvoiceHeaders(token)
3676
- });
3677
- if (isE10SessionExpiredResponse(response)) {
3678
- throw invoiceAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
3679
- }
3680
- if (response.parseError) {
3681
- throw invoiceNetworkError("protocol", `\u63A5\u53E3\u8FD4\u56DE\u4E0D\u662F\u5408\u6CD5 JSON\uFF08HTTP ${response.status}\uFF09`, { retryable: false });
3682
- }
3683
- if (response.status < 200 || response.status >= 300) {
3684
- throw new InvoiceCliError("api", "http_error", `\u6CDB\u5FAE\u63A5\u53E3 HTTP ${response.status}`, {
3685
- code: response.status,
3686
- details: { status: response.status, message: responseMessage(response.value) },
3687
- exitCode: 1
3688
- });
3689
- }
3690
- return handleBusinessResponse(response.value, () => invoiceFormRequest(request, false), canRetryExpiredToken && Boolean(token));
3691
- }
3692
- async function invoiceDownload({ id, fid, needLog = false, operation, timeoutMs = 3e4 }, canRetryExpiredToken = true) {
3693
- const token = await ensureContext(true, timeoutMs, "/api/inc/file/download");
3694
- const response = await (await runtime()).requestBinary({
3695
- module: "invoice",
3696
- operation,
3697
- method: "GET",
3698
- path: "/api/inc/file/download",
3699
- query: { id, fid, needLog },
3700
- headers: { Accept: "application/octet-stream, application/pdf, */*" },
3701
- timeoutMs,
3702
- trustedHeaders: trustedInvoiceHeaders(token)
3703
- });
3704
- if (isE10SessionExpiredResponse(response)) {
3705
- throw invoiceAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
3706
- }
3707
- const contentType = response.contentType;
3708
- const declaredLength = Number(response.headers.get("content-length"));
3709
- if (Number.isFinite(declaredLength) && declaredLength > MAX_DOWNLOAD_BYTES) {
3710
- throw invoiceNetworkError("response_too_large", `\u4E0B\u8F7D\u6587\u4EF6\u8D85\u8FC7 ${MAX_DOWNLOAD_BYTES} \u5B57\u8282\u9650\u5236`, { retryable: false });
3711
- }
3712
- const content = response.content;
3713
- const looksLikeJson = /^[\s\r\n]*[\[{]/u.test(content.subarray(0, 64).toString("utf8"));
3714
- if (response.status < 200 || response.status >= 300 || contentType.includes("json") || looksLikeJson) {
3715
- let value = {};
3716
- try {
3717
- value = JSON.parse(content.toString("utf8"));
3718
- } catch {
3719
- value = {};
3720
- }
3721
- if (isInvoiceSessionExpired(value)) {
3722
- await clearCachedInvoiceToken();
3723
- if (canRetryExpiredToken && token) return invoiceDownload({ id, fid, needLog, operation, timeoutMs }, false);
3724
- throw invoiceAuthError(
3725
- "invoice_session_expired",
3726
- `\u53D1\u7968\u4E1A\u52A1\u767B\u5F55\u6001\u5DF2\u5931\u6548\uFF0C\u5DF2\u6E05\u7406\u672C\u5730\u53D1\u7968 Token\u3002${E10_REAUTH_GUIDANCE}`,
3727
- { ret: responseCode(value), status: response.status }
3728
- );
3729
- }
3730
- throw new InvoiceCliError("api", "download_failed", responseMessage(value) || `\u4E0B\u8F7D\u5931\u8D25\uFF08HTTP ${response.status}\uFF09`, {
3731
- code: response.status,
3732
- details: { status: response.status, ret: responseCode(value) },
3733
- exitCode: 1
3734
- });
3735
- }
3736
- if (!content.length) {
3737
- throw invoiceNetworkError("protocol", "\u4E0B\u8F7D\u63A5\u53E3\u8FD4\u56DE\u7A7A\u6587\u4EF6", { retryable: false });
3738
- }
3739
- if (content.length > MAX_DOWNLOAD_BYTES) {
3740
- throw invoiceNetworkError("response_too_large", `\u4E0B\u8F7D\u6587\u4EF6\u8D85\u8FC7 ${MAX_DOWNLOAD_BYTES} \u5B57\u8282\u9650\u5236`, { retryable: false });
3741
- }
3742
- return { content, contentType };
3743
- }
3744
- return {
3745
- invoiceRequest,
3746
- invoiceMultipartRequest,
3747
- invoiceFormRequest,
3748
- invoiceDownload,
3749
- getSession,
3750
- invalidateToken() {
3751
- invoiceToken = null;
3752
- void clearCachedInvoiceToken();
3753
- }
3754
- };
3755
- }
3756
-
3757
3302
  // node_modules/commander/esm.mjs
3758
3303
  var import_index = __toESM(require_commander(), 1);
3759
3304
  var {
@@ -3772,13 +3317,6 @@ var {
3772
3317
  } = import_index.default;
3773
3318
 
3774
3319
  export {
3775
- InvoiceCliError,
3776
- invoiceValidationError,
3777
- invoiceConfirmationError,
3778
- invoicePartialError,
3779
- isInvoiceNetworkError,
3780
- clearInvoiceTokenForSession,
3781
- createInvoiceHost,
3782
3320
  Command,
3783
3321
  Option
3784
3322
  };
@@ -0,0 +1,205 @@
1
+ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
+ const require = __esbuildCreateRequire(import.meta.url);
3
+ import {
4
+ RefError,
5
+ pruneRefs,
6
+ refMaxBytes,
7
+ refMaxCount,
8
+ resolveRefInput
9
+ } from "./chunk-JJONWB5N.js";
10
+ import {
11
+ emitUpdateNotice,
12
+ withUpdateNotice
13
+ } from "./chunk-257JXJGD.js";
14
+ import {
15
+ shouldReportPlatformError,
16
+ toPlatformError
17
+ } from "./chunk-MD5CW4B6.js";
18
+ import {
19
+ CliError,
20
+ isCliError,
21
+ toErrorEnvelope
22
+ } from "./chunk-UG5G54VL.js";
23
+
24
+ // src/core/input.ts
25
+ var FileInputPolicyError = class extends CliError {
26
+ type = "policy";
27
+ subtype = "file_input_denied";
28
+ retryable = false;
29
+ constructor() {
30
+ super(
31
+ "\u4E0D\u5141\u8BB8\u901A\u8FC7 --input <path> \u8BFB\u53D6 JSON \u6587\u4EF6\u3002\u8BF7\u6539\u7528 --input-json\u3001--input -\uFF0C\u6216\u7528 --input-ref \u4F20\u9012\u4E0A\u4E00\u6B65\u7684\u7ED3\u679C\u3002",
32
+ 6 /* PolicyError */
33
+ );
34
+ this.name = "FileInputPolicyError";
35
+ }
36
+ };
37
+ function configuredPolicy(ctx) {
38
+ const io = ctx.config.get("io");
39
+ if (io && typeof io === "object" && !Array.isArray(io) && "fileInput" in io) {
40
+ return io.fileInput;
41
+ }
42
+ return ctx.config.get("io.fileInput");
43
+ }
44
+ function resolveFileInputPolicy(ctx, options) {
45
+ const allow = options.allowFileInput === true;
46
+ const deny = options.fileInput === false;
47
+ if (allow && deny) {
48
+ throw new CliError("\u4E0D\u80FD\u540C\u65F6\u4F20 --allow-file-input \u548C --no-file-input", 2 /* UsageError */);
49
+ }
50
+ if (allow) return "allow";
51
+ if (deny) return "deny";
52
+ const fromEnv = (ctx.env.WEAVER_WORK_CLI_FILE_INPUT ?? "").trim().toLowerCase();
53
+ if (fromEnv === "allow" || fromEnv === "warn" || fromEnv === "deny") return fromEnv;
54
+ const fromConfig = configuredPolicy(ctx);
55
+ if (fromConfig === "allow" || fromConfig === "warn" || fromConfig === "deny") return fromConfig;
56
+ return "warn";
57
+ }
58
+ function guardFileInput(ctx, options) {
59
+ const input = options.input;
60
+ if (input === void 0 || input === null || String(input).trim() === "" || input === "-") return;
61
+ const policy = resolveFileInputPolicy(ctx, options);
62
+ if (policy === "allow") return;
63
+ if (policy === "deny") throw new FileInputPolicyError();
64
+ process.stderr.write(
65
+ "[weaver-work-cli] \u4F7F\u7528 --input <path> \u8BFB\u53D6 JSON \u6587\u4EF6\uFF1B\u591A\u6B65\u4F20\u9012\u8BF7\u4F18\u5148\u7528 --input-ref\uFF0C\u7B80\u5355\u6570\u636E\u8BF7\u7528 --input-json\u3002\n"
66
+ );
67
+ }
68
+
69
+ // src/cmd/action.ts
70
+ function commandFromArgs(args) {
71
+ const last = args[args.length - 1];
72
+ return last && typeof last === "object" && "name" in last && "opts" in last ? last : void 0;
73
+ }
74
+ function optionsHolderFrom(args) {
75
+ return args.find((arg) => Boolean(
76
+ arg && typeof arg === "object" && !Array.isArray(arg) && !("opts" in arg) && ("inputRef" in arg || "pick" in arg || "pickAs" in arg || "allowFileInput" in arg || "fileInput" in arg)
77
+ ));
78
+ }
79
+ function applyRefInput(ctx, args) {
80
+ const holder = optionsHolderFrom(args);
81
+ if (!holder) return;
82
+ const refId = String(holder.inputRef ?? "").trim();
83
+ if (!refId) {
84
+ if (holder.pick || holder.pickAs) {
85
+ throw new RefError("input_ref_required", "--pick \u548C --pick-as \u5FC5\u987B\u4E0E --input-ref \u4E00\u8D77\u4F7F\u7528");
86
+ }
87
+ return;
88
+ }
89
+ if (holder.inputJson !== void 0 || holder.input !== void 0) {
90
+ throw new RefError("input_conflict", "\u4E0D\u80FD\u540C\u65F6\u4F20 --input-ref \u4E0E --input/--input-json");
91
+ }
92
+ const pick = holder.pick === void 0 || holder.pick === null || holder.pick === "" ? void 0 : String(holder.pick);
93
+ const pickAs = holder.pickAs === void 0 || holder.pickAs === null || holder.pickAs === "" ? void 0 : String(holder.pickAs);
94
+ holder.inputJson = JSON.stringify(resolveRefInput(ctx, {
95
+ refId,
96
+ ...pick ? { pick } : {},
97
+ ...pickAs ? { pickAs } : {}
98
+ }));
99
+ delete holder.inputRef;
100
+ delete holder.pick;
101
+ delete holder.pickAs;
102
+ }
103
+ function cleanupRefs(ctx) {
104
+ try {
105
+ pruneRefs(ctx, { maxCount: refMaxCount(ctx), maxBytes: refMaxBytes(ctx) });
106
+ } catch {
107
+ process.stderr.write("[weaver-work-cli] \u6682\u5B58\u7ED3\u679C\u6E05\u7406\u5931\u8D25\uFF1B\u672C\u6B21\u547D\u4EE4\u7EE7\u7EED\u6267\u884C\u3002\n");
108
+ }
109
+ }
110
+ function isRefsShow(command) {
111
+ const names = [];
112
+ let current = command;
113
+ while (current) {
114
+ const name = current.name();
115
+ if (name) names.unshift(name);
116
+ current = current.parent;
117
+ }
118
+ return names.slice(-2).join(" ") === "refs show";
119
+ }
120
+ function createAction(ctx) {
121
+ return (handler) => async (...args) => {
122
+ const commandCtx = ctx.forCommand(commandFromArgs(args));
123
+ try {
124
+ await commandCtx.hooks.beforeCommand(commandCtx);
125
+ applyRefInput(commandCtx, args);
126
+ const options = commandCtx.activeCommand?.opts();
127
+ if (options) guardFileInput(commandCtx, options);
128
+ if (!isRefsShow(commandCtx.activeCommand)) cleanupRefs(commandCtx);
129
+ const result = await handler(commandCtx, ...args);
130
+ await commandCtx.hooks.afterCommand(commandCtx, result);
131
+ } catch (error) {
132
+ await commandCtx.hooks.onError(commandCtx, error);
133
+ if (commandCtx.getGlobalOptions().json) {
134
+ const env = { schemaVersion: 1, ok: false, error: toErrorEnvelope(error) };
135
+ if (shouldReportPlatformError(error)) {
136
+ const pe = toPlatformError(error);
137
+ env.code = pe.code;
138
+ env.message = pe.message;
139
+ }
140
+ console.error(JSON.stringify(withUpdateNotice(env), null, 2));
141
+ process.exitCode = isCliError(error) ? error.exitCode : 1 /* GeneralError */;
142
+ return;
143
+ }
144
+ emitUpdateNotice();
145
+ if (shouldReportPlatformError(error)) {
146
+ process.stderr.write(JSON.stringify(toPlatformError(error)) + "\n");
147
+ }
148
+ if (isCliError(error)) {
149
+ commandCtx.logger.error(error.message);
150
+ process.exitCode = error.exitCode;
151
+ return;
152
+ }
153
+ const message = error instanceof Error ? error.message : String(error);
154
+ commandCtx.logger.error(message);
155
+ process.exitCode = 1 /* GeneralError */;
156
+ }
157
+ };
158
+ }
159
+
160
+ // src/cmd/register.ts
161
+ var IO_CHANNEL_OPTIONS = [
162
+ { flags: "--input-ref <ref>", description: "consume a persisted large result reference" },
163
+ { flags: "--pick <path>", description: "pick a sub path from --input-ref, e.g. items[0].fid" },
164
+ { flags: "--pick-as <field>", description: "map a scalar picked value to this input field, e.g. fid" },
165
+ { flags: "--allow-file-input", description: "allow reading JSON input from --input <path>" },
166
+ { flags: "--no-file-input", description: "reject JSON input from --input <path>" }
167
+ ];
168
+ function ensureRefInputOptions(command) {
169
+ if (command.commands.length === 0) {
170
+ for (const option of IO_CHANNEL_OPTIONS) {
171
+ const long = option.flags.split(" ")[0];
172
+ if (!command.options.some((existing) => existing.long === long)) {
173
+ command.option(option.flags, option.description);
174
+ }
175
+ }
176
+ return;
177
+ }
178
+ for (const child of command.commands) {
179
+ ensureRefInputOptions(child);
180
+ }
181
+ }
182
+ async function registerCommands(program, ctx, commands) {
183
+ ctx.commands = commands.map((command) => ({
184
+ name: command.name,
185
+ description: command.description,
186
+ category: command.category
187
+ }));
188
+ ctx.modules = ctx.commands;
189
+ for (const command of commands) {
190
+ if (command.hooks) {
191
+ ctx.hooks.register(command.hooks);
192
+ }
193
+ }
194
+ const action = createAction(ctx);
195
+ for (const command of commands) {
196
+ await command.register({ program, ctx, action });
197
+ }
198
+ ensureRefInputOptions(program);
199
+ }
200
+ var registerModules = registerCommands;
201
+
202
+ export {
203
+ registerCommands,
204
+ registerModules
205
+ };
@@ -5,7 +5,7 @@ import {
5
5
  ebBusinessSuccess,
6
6
  meetingSuccess,
7
7
  meetingValidationError
8
- } from "./chunk-4I26YMBY.js";
8
+ } from "./chunk-WHI6YAUE.js";
9
9
 
10
10
  // src/shortcuts/meeting/operations/env.ts
11
11
  import { existsSync } from "node:fs";