weaver-work-cli 0.1.42 → 0.1.44

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 (318) hide show
  1. package/README.md +17 -0
  2. package/dist/chunks/{archive-J4I6MCKF.js → archive-P6TBQGKL.js} +13 -5
  3. package/dist/chunks/{archive-oa-BRZKKTO4.js → archive-oa-7TQ2NXOH.js} +12 -5
  4. package/dist/chunks/{asset-L7D4FAOZ.js → asset-3ELRG37G.js} +11 -4
  5. package/dist/chunks/{asset-idle-DADLLV75.js → asset-idle-WIGMUFMD.js} +7 -3
  6. package/dist/chunks/{attachment-content-K4C7VLWQ.js → attachment-content-E3276UOV.js} +5 -4
  7. package/dist/chunks/{blog-BVGQ7NZL.js → blog-C5NMZAAC.js} +11 -4
  8. package/dist/chunks/{caizhilian-SAADNFD6.js → caizhilian-5XSM2DFP.js} +13 -6
  9. package/dist/chunks/{calendar-Q7NQY5Z2.js → calendar-FI2WNSBO.js} +12 -5
  10. package/dist/chunks/{chunk-YRSZQUD2.js → chunk-3YBDYOC4.js} +3 -3
  11. package/dist/chunks/{chunk-OOUTBLZ4.js → chunk-56EZERK4.js} +1 -1
  12. package/dist/chunks/chunk-6N4JPNFL.js +76 -0
  13. package/dist/chunks/{chunk-ZUX3P6BQ.js → chunk-727FH2NI.js} +1 -1
  14. package/dist/chunks/chunk-7BDPM5ST.js +11 -0
  15. package/dist/chunks/{chunk-EKWAQSLU.js → chunk-BCVYBYYT.js} +432 -2248
  16. package/dist/chunks/{chunk-W7BEHOSR.js → chunk-CWYGFU5B.js} +2 -2
  17. package/dist/chunks/{chunk-NOODWMCL.js → chunk-D4ADSZ7H.js} +1 -1
  18. package/dist/chunks/{chunk-SA6VBIHY.js → chunk-ETNJSKMM.js} +214 -16
  19. package/dist/chunks/{chunk-BBKDXQEC.js → chunk-F4E4EM35.js} +3 -3
  20. package/dist/chunks/{chunk-IZ7S7QUS.js → chunk-FAZTGX7S.js} +6 -6
  21. package/dist/chunks/{chunk-NKZRQXST.js → chunk-FRZKBMSW.js} +52 -36
  22. package/dist/chunks/{chunk-BYBSCN4X.js → chunk-G7PQWD4L.js} +6 -3
  23. package/dist/chunks/{chunk-GEWYMQME.js → chunk-GAMZLAG2.js} +1 -1
  24. package/dist/chunks/{chunk-R4CHUSKC.js → chunk-GM6J7Q4B.js} +4 -4
  25. package/dist/chunks/{chunk-APVFJUQH.js → chunk-GRDRG6HP.js} +3 -3
  26. package/dist/chunks/{chunk-LDZQPUIA.js → chunk-HIT4Y6OI.js} +1 -1
  27. package/dist/chunks/{chunk-EZALDOQH.js → chunk-HP7JIYMT.js} +5 -2
  28. package/dist/chunks/{chunk-LADPYOWC.js → chunk-IAZ3UPY6.js} +3 -3
  29. package/dist/chunks/{chunk-ZEDWSH32.js → chunk-IC62NFM5.js} +1 -1
  30. package/dist/chunks/{chunk-P26ZWSKU.js → chunk-KIHNAS25.js} +5 -2
  31. package/dist/chunks/{chunk-BIPYLLVS.js → chunk-N4M2DDFE.js} +15 -15
  32. package/dist/chunks/{chunk-QKNKR4RH.js → chunk-OF4S23UB.js} +4 -4
  33. package/dist/chunks/{chunk-JPRO6ER2.js → chunk-PC7VKEB5.js} +57 -60
  34. package/dist/chunks/{chunk-4PD5NWAX.js → chunk-PUQS5MWL.js} +2 -2
  35. package/dist/chunks/{chunk-2LV74IWP.js → chunk-Q4OYAQYH.js} +1 -1
  36. package/dist/chunks/{chunk-72CKAUAG.js → chunk-QVSWRLLU.js} +7 -5
  37. package/dist/chunks/{chunk-4RAE6JXP.js → chunk-TA7FXXJD.js} +6 -3
  38. package/dist/chunks/{chunk-GPMFD4RD.js → chunk-TXUG266F.js} +1 -1
  39. package/dist/chunks/{chunk-FOAA27U5.js → chunk-UFIT2UU3.js} +16 -4
  40. package/dist/chunks/{chunk-LUSPKZKY.js → chunk-UG5G54VL.js} +1 -0
  41. package/dist/chunks/{chunk-NIAJ5ZCG.js → chunk-UL5XUQ25.js} +5 -2
  42. package/dist/chunks/{chunk-FMPJJYYI.js → chunk-WRXSAVKO.js} +1 -1
  43. package/dist/chunks/{chunk-G4UR6NXN.js → chunk-WSF4NNMR.js} +3 -3
  44. package/dist/chunks/chunk-XHK4MDR5.js +2497 -0
  45. package/dist/chunks/{chunk-3KTFS4IA.js → chunk-XNIK66I4.js} +19 -9
  46. package/dist/chunks/{chunk-3SO6QL6U.js → chunk-YWX377BY.js} +5 -2
  47. package/dist/chunks/{chunk-BYATLLEF.js → chunk-Z3GDFVJR.js} +1 -1
  48. package/dist/chunks/{chunk-GHXCDPTM.js → chunk-Z7VYWPZV.js} +1 -1
  49. package/dist/chunks/{conflict-F2OMZRTO.js → conflict-ARLSZJ6V.js} +4 -3
  50. package/dist/chunks/{continuation-2CKSBLA6.js → continuation-3S37AUSH.js} +4 -3
  51. package/dist/chunks/{continuation-RN6PZN2M.js → continuation-3XLYYTKV.js} +4 -3
  52. package/dist/chunks/{continuation-HZIZRZBX.js → continuation-HFW2YT5S.js} +4 -3
  53. package/dist/chunks/{continuation-NLECEJPX.js → continuation-KI7DRRZN.js} +4 -3
  54. package/dist/chunks/{contract-5BETHRSG.js → contract-DNIIW5VJ.js} +13 -5
  55. package/dist/chunks/{cowork-3MN6EQQO.js → cowork-GMLRGVIW.js} +11 -4
  56. package/dist/chunks/{create-flow-5FQNNMVO.js → create-flow-J22BO65E.js} +8 -7
  57. package/dist/chunks/{ebuilder-form-SBHOYBUD.js → ebuilder-form-ANV2FHYV.js} +12 -7
  58. package/dist/chunks/{ehr-KMOJULKG.js → ehr-GSTGAIY3.js} +266 -24
  59. package/dist/chunks/{employee-SAK2QYXX.js → employee-22BGJ3QS.js} +3 -3
  60. package/dist/chunks/{env-LB7NBL2O.js → env-BX3VRFS7.js} +4 -3
  61. package/dist/chunks/{esb-W2PJCFCX.js → esb-ATAIASX2.js} +12 -7
  62. package/dist/chunks/{factory-6ZFQXQ46.js → factory-PETTFME6.js} +3 -2
  63. package/dist/chunks/{fna-ZQPCUV4R.js → fna-YEKBSFSX.js} +14 -8
  64. package/dist/chunks/{group-chat-2HHAJN46.js → group-chat-BFVXAYFX.js} +5 -4
  65. package/dist/chunks/{host-ATKVNZAT.js → host-HRBXEPDQ.js} +5 -5
  66. package/dist/chunks/{host-BQH22NTQ.js → host-LR55CTHP.js} +5 -5
  67. package/dist/chunks/{host-X2CSLFM6.js → host-SUOY6VYQ.js} +5 -5
  68. package/dist/chunks/{host-4CBHGOHT.js → host-SZGV4UNT.js} +5 -5
  69. package/dist/chunks/{host-YTODKMSL.js → host-WIKN2EJ5.js} +5 -5
  70. package/dist/chunks/{hrm-FFM4UJFS.js → hrm-NRDO4W5G.js} +11 -7
  71. package/dist/chunks/{im-VEHKDQPB.js → im-IQ2HN23S.js} +8 -7
  72. package/dist/chunks/{invoice-LVIKSIIF.js → invoice-MNRW76PP.js} +636 -1768
  73. package/dist/chunks/{jiuchuanhui-X6DINO5P.js → jiuchuanhui-DTRBAX4N.js} +14 -6
  74. package/dist/chunks/{lazy-dispatch-KSWTN5L6.js → lazy-dispatch-ZVWAI25B.js} +7 -6
  75. package/dist/chunks/{mail-VDKRGUD3.js → mail-ZVAUXOJA.js} +16 -14
  76. package/dist/chunks/{meeting-CLC6HP3Z.js → meeting-FEVPZ67S.js} +21 -14
  77. package/dist/chunks/{okr-CHG4OO3U.js → okr-SDH3E5RA.js} +12 -5
  78. package/dist/chunks/{operations-5QL3AECO.js → operations-62N6EP3C.js} +4 -3
  79. package/dist/chunks/{plan-XWR75667.js → plan-E35JFDI7.js} +12 -5
  80. package/dist/chunks/{project-5BXOOKMG.js → project-73QXBAB2.js} +11 -4
  81. package/dist/chunks/reception-UWZVACBN.js +1899 -0
  82. package/dist/chunks/{recruit-stage-DGMFNNDE.js → recruit-stage-4MAOCKFY.js} +320 -57
  83. package/dist/chunks/registry-IM5G23LS.js +24 -0
  84. package/dist/chunks/{registry-RHMW6ANW.js → registry-JDUS4E7D.js} +7 -6
  85. package/dist/chunks/{registry-7FFOXIAW.js → registry-KNKSCJNT.js} +7 -6
  86. package/dist/chunks/{registry-Z43434VG.js → registry-PO7SI256.js} +4 -4
  87. package/dist/chunks/{registry-OZSMDVPP.js → registry-PVUZQDDQ.js} +3 -3
  88. package/dist/chunks/{room-recommend-62H7ZQQ6.js → room-recommend-H7KLXA5R.js} +6 -5
  89. package/dist/chunks/{schedule-FNXKH3DQ.js → schedule-ESZIBAUO.js} +6 -5
  90. package/dist/chunks/{workflow-ADHKCAJK.js → workflow-CWJFJLQU.js} +13 -8
  91. package/dist/cmd/action.js +6 -0
  92. package/dist/cmd/identity/index.js +45 -0
  93. package/dist/cmd/index.js +2 -0
  94. package/dist/core/continuation-ttl.js +18 -0
  95. package/dist/core/error-codes.js +85 -0
  96. package/dist/core/logger.js +11 -0
  97. package/dist/index.js +37 -31
  98. package/dist/internal/e10/auth/commands.js +163 -8
  99. package/dist/internal/e10/auth/error-log.js +182 -0
  100. package/dist/internal/e10/auth/session.js +17 -3
  101. package/dist/internal/e10/auth-recovery.js +39 -12
  102. package/dist/internal/e10/context.js +17 -2
  103. package/dist/internal/skills/install.js +9 -1
  104. package/dist/shortcuts/archive/continuation.js +2 -1
  105. package/dist/shortcuts/archive/index.js +3 -0
  106. package/dist/shortcuts/archive/operations/confirm.js +2 -1
  107. package/dist/shortcuts/archive-oa/continuation.js +2 -1
  108. package/dist/shortcuts/archive-oa/index.js +2 -0
  109. package/dist/shortcuts/archive-oa/operations/confirm.js +2 -1
  110. package/dist/shortcuts/asset/continuation.js +2 -1
  111. package/dist/shortcuts/asset/index.js +2 -0
  112. package/dist/shortcuts/asset-idle/index.js +2 -0
  113. package/dist/shortcuts/blog/continuation.js +2 -1
  114. package/dist/shortcuts/blog/index.js +2 -0
  115. package/dist/shortcuts/caizhilian/continuation.js +2 -1
  116. package/dist/shortcuts/caizhilian/index.js +2 -0
  117. package/dist/shortcuts/caizhilian/operations/confirm.js +3 -2
  118. package/dist/shortcuts/calendar/continuation.js +2 -1
  119. package/dist/shortcuts/calendar/index.js +2 -0
  120. package/dist/shortcuts/calendar/operations/write.js +1 -1
  121. package/dist/shortcuts/contract/continuation.js +2 -1
  122. package/dist/shortcuts/contract/index.js +2 -0
  123. package/dist/shortcuts/contract/operations/write.js +2 -1
  124. package/dist/shortcuts/cowork/continuation.js +2 -1
  125. package/dist/shortcuts/cowork/index.js +2 -0
  126. package/dist/shortcuts/ebuilder-form/continuation.js +2 -1
  127. package/dist/shortcuts/ebuilder-form/index.js +2 -0
  128. package/dist/shortcuts/ebuilder-form/operations/write.js +3 -2
  129. package/dist/shortcuts/ehr/continuation.js +2 -1
  130. package/dist/shortcuts/ehr/index.js +2 -0
  131. package/dist/shortcuts/ehr/operations/attend-write.js +1 -1
  132. package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +182 -3
  133. package/dist/shortcuts/ehr/operations/recruit-position.js +134 -2
  134. package/dist/shortcuts/ehr/operations/recruit-write.js +1 -1
  135. package/dist/shortcuts/esb/continuation.js +2 -1
  136. package/dist/shortcuts/esb/index.js +2 -0
  137. package/dist/shortcuts/esb/operations/trigger.js +2 -1
  138. package/dist/shortcuts/fna/continuation.js +2 -1
  139. package/dist/shortcuts/fna/index.js +2 -0
  140. package/dist/shortcuts/fna/operations/invoice-writeoff.js +1 -1
  141. package/dist/shortcuts/fna/operations/loan.js +1 -1
  142. package/dist/shortcuts/hrm/index.js +2 -0
  143. package/dist/shortcuts/im/continuation.js +2 -1
  144. package/dist/shortcuts/index.js +5 -0
  145. package/dist/shortcuts/invoice/continuation.js +2 -1
  146. package/dist/shortcuts/invoice/index.js +14 -15
  147. package/dist/shortcuts/invoice/invoice-record.js +93 -0
  148. package/dist/shortcuts/invoice/manifest.js +190 -393
  149. package/dist/shortcuts/invoice/operations/add.js +2 -1
  150. package/dist/shortcuts/invoice/operations/delete.js +2 -1
  151. package/dist/shortcuts/invoice/operations/import.js +2 -1
  152. package/dist/shortcuts/invoice/operations/issuing-contract-detail.js +86 -0
  153. package/dist/shortcuts/invoice/operations/issuing-contracts.js +210 -0
  154. package/dist/shortcuts/invoice/operations/registry.js +17 -17
  155. package/dist/shortcuts/invoice/operations/reim-auto.js +4 -569
  156. package/dist/shortcuts/invoice/operations/reim.js +52 -341
  157. package/dist/shortcuts/invoice/operations/shared.js +21 -4
  158. package/dist/shortcuts/invoice/operations/update.js +2 -1
  159. package/dist/shortcuts/invoice/projection.js +10 -62
  160. package/dist/shortcuts/jiuchuanhui/continuation.js +2 -1
  161. package/dist/shortcuts/jiuchuanhui/index.js +2 -0
  162. package/dist/shortcuts/jiuchuanhui/operations/datajson.js +2 -1
  163. package/dist/shortcuts/jiuchuanhui/operations/esb.js +2 -1
  164. package/dist/shortcuts/mail/continuation.js +2 -1
  165. package/dist/shortcuts/mail/index.js +2 -0
  166. package/dist/shortcuts/mail/operations/mail-blacklist.js +1 -1
  167. package/dist/shortcuts/mail/operations/mail-contacts.js +1 -1
  168. package/dist/shortcuts/mail/operations/mail-send.js +1 -1
  169. package/dist/shortcuts/mail/operations/mail-sign.js +1 -1
  170. package/dist/shortcuts/mail/operations/mail-template.js +1 -1
  171. package/dist/shortcuts/meeting/continuation.js +2 -1
  172. package/dist/shortcuts/meeting/index.js +2 -0
  173. package/dist/shortcuts/meeting/operations/change.js +1 -1
  174. package/dist/shortcuts/meeting/operations/create.js +1 -1
  175. package/dist/shortcuts/meeting/operations/eb/create-flow.js +16 -7
  176. package/dist/shortcuts/meeting/operations/eb/decision.js +1 -1
  177. package/dist/shortcuts/meeting/operations/eb/factory.js +1 -1
  178. package/dist/shortcuts/meeting/operations/lifecycle.js +1 -1
  179. package/dist/shortcuts/meeting/operations/receipts.js +1 -1
  180. package/dist/shortcuts/meeting/operations/signs.js +1 -1
  181. package/dist/shortcuts/okr/continuation.js +2 -1
  182. package/dist/shortcuts/okr/index.js +2 -0
  183. package/dist/shortcuts/okr/operations/write.js +1 -1
  184. package/dist/shortcuts/plan/continuation.js +2 -1
  185. package/dist/shortcuts/plan/index.js +2 -0
  186. package/dist/shortcuts/plan/operations/write.js +1 -1
  187. package/dist/shortcuts/project/continuation.js +2 -1
  188. package/dist/shortcuts/project/index.js +2 -0
  189. package/dist/shortcuts/reception/constants.js +53 -0
  190. package/dist/shortcuts/reception/errors.js +54 -0
  191. package/dist/shortcuts/reception/host.js +125 -0
  192. package/dist/shortcuts/reception/index.js +198 -0
  193. package/dist/shortcuts/reception/manifest.js +177 -0
  194. package/dist/shortcuts/reception/operations/ask.js +71 -0
  195. package/dist/shortcuts/reception/operations/browsertool.js +58 -0
  196. package/dist/shortcuts/reception/operations/compose.js +129 -0
  197. package/dist/shortcuts/reception/operations/customparams.js +74 -0
  198. package/dist/shortcuts/reception/operations/doc.js +238 -0
  199. package/dist/shortcuts/reception/operations/docrender.js +36 -0
  200. package/dist/shortcuts/reception/operations/panels.js +179 -0
  201. package/dist/shortcuts/reception/operations/registry.js +26 -0
  202. package/dist/shortcuts/reception/operations/render-assets.js +184 -0
  203. package/dist/shortcuts/reception/operations/render.js +123 -0
  204. package/dist/shortcuts/reception/operations/runs.js +38 -0
  205. package/dist/shortcuts/reception/operations/schedule.js +127 -0
  206. package/dist/shortcuts/reception/operations/shared.js +196 -0
  207. package/dist/shortcuts/reception/operations/snapshot.js +68 -0
  208. package/dist/shortcuts/reception/operations/types.js +1 -0
  209. package/dist/shortcuts/reception/operations.js +33 -0
  210. package/dist/shortcuts/reception/upload.js +218 -0
  211. package/dist/shortcuts/recruit-stage/context.js +145 -33
  212. package/dist/shortcuts/recruit-stage/continuation.js +2 -1
  213. package/dist/shortcuts/recruit-stage/operations/jd-create.js +106 -17
  214. package/dist/shortcuts/recruit-stage/operations/resume-import.js +166 -10
  215. package/dist/shortcuts/workflow/continuation.js +2 -1
  216. package/dist/shortcuts/workflow/index.js +2 -0
  217. package/dist/shortcuts/workflow/operations/form.js +32 -8
  218. package/dist/shortcuts/workflow/operations/write.js +1 -1
  219. package/docs/_catalog.md +3 -0
  220. package/docs/agent-invoice.md +1 -1
  221. package/docs/archive-oa.md +1 -1
  222. package/docs/caizhilian.md +1 -1
  223. package/docs/calendar.md +1 -1
  224. package/docs/contract.md +1 -1
  225. package/docs/e10-auth.md +16 -0
  226. package/docs/ehr.md +2 -2
  227. package/docs/esb.md +1 -1
  228. package/docs/im.md +1 -1
  229. package/docs/invoice.md +8 -12
  230. package/docs/okr.md +1 -1
  231. package/docs/reception.md +119 -0
  232. package/package.json +1 -1
  233. package/scripts/clean.mjs +43 -2
  234. package/skill-template/business-info.json +18 -2
  235. package/skill-template/domains/caizhilian.md +1 -1
  236. package/skill-template/domains/reception-flow.md +18 -0
  237. package/skill-template/domains/yepiaotong.md +4 -7
  238. package/skills/weaver-e10-archive-oa/references/source-manifest.json +14 -14
  239. package/skills/weaver-e10-blog/references/blog-publish.md +1 -1
  240. package/skills/weaver-e10-blog/references/source-manifest.json +7 -7
  241. package/skills/weaver-e10-caizhilian/references/source-manifest.json +21 -21
  242. package/skills/weaver-e10-caizhilian/references/write-protocol.md +2 -2
  243. package/skills/weaver-e10-calendar/references/calendar-write.md +1 -1
  244. package/skills/weaver-e10-cowork/SKILL.md +1 -1
  245. package/skills/weaver-e10-ebuilder-form/SKILL.md +1 -1
  246. package/skills/weaver-e10-ebuilder-form/references/custom-api.md +1 -1
  247. package/skills/weaver-e10-ebuilder-form/references/openapi-write.md +1 -1
  248. package/skills/weaver-e10-esb/SKILL.md +2 -2
  249. package/skills/weaver-e10-esb/references/source-manifest.json +22 -22
  250. package/skills/weaver-e10-esb/references/trigger.md +2 -2
  251. package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +1 -1
  252. package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +1 -1
  253. package/skills/weaver-e10-jinchengda/references/contract-request-write.md +1 -1
  254. package/skills/weaver-e10-jinchengda/references/source-manifest.json +29 -29
  255. package/skills/weaver-e10-jucailin/SKILL.md +1 -1
  256. package/skills/weaver-e10-jucailin/references/attend-write.md +2 -2
  257. package/skills/weaver-e10-jucailin/references/recruit-create.md +12 -3
  258. package/skills/weaver-e10-jucailin/references/recruit-write.md +1 -1
  259. package/skills/weaver-e10-meeting/SKILL.md +8 -6
  260. package/skills/weaver-e10-meeting/references/meeting-change.md +1 -1
  261. package/skills/weaver-e10-meeting/references/meeting-create.md +1 -1
  262. package/skills/weaver-e10-meeting/references/meeting-lifecycle.md +1 -1
  263. package/skills/weaver-e10-meeting/references/meeting-verification.md +1 -1
  264. package/skills/weaver-e10-okr/references/okr-align.md +1 -1
  265. package/skills/weaver-e10-okr/references/okr-keyresult.md +1 -1
  266. package/skills/weaver-e10-okr/references/okr-write.md +1 -1
  267. package/skills/weaver-e10-okr/references/source-manifest.json +8 -8
  268. package/skills/weaver-e10-plan/references/plan-report-write.md +1 -1
  269. package/skills/weaver-e10-plan/references/source-manifest.json +20 -20
  270. package/skills/weaver-e10-qiyecheng/references/loan-management.md +1 -1
  271. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +18 -18
  272. package/skills/weaver-e10-reception-flow/SKILL.md +173 -0
  273. package/skills/weaver-e10-reception-flow/assets//350/241/214/347/250/213/345/215/225/346/250/241/346/235/277-/346/263/233/345/276/256.docx +0 -0
  274. package/skills/weaver-e10-reception-flow/data/fields-snapshot.json +213 -0
  275. package/skills/weaver-e10-reception-flow/references/browsertool.md +68 -0
  276. package/skills/weaver-e10-reception-flow/references/env-pitfalls.md +51 -0
  277. package/skills/weaver-e10-reception-flow/references/fields-snapshot.md +227 -0
  278. package/skills/weaver-e10-reception-flow/references/guide.md +179 -0
  279. package/skills/weaver-e10-reception-flow/scripts/locate.sh +14 -0
  280. package/skills/weaver-e10-reception-flow/scripts/render.py +724 -0
  281. package/skills/weaver-e10-recruit-stage/SKILL.md +9 -5
  282. package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +1 -1
  283. package/skills/weaver-e10-recruit-stage/lib/xiaoe-session.mjs +66 -0
  284. package/skills/weaver-e10-recruit-stage/references/position-templates.md +202 -0
  285. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +22 -0
  286. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +14 -1
  287. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +6 -0
  288. package/skills/weaver-e10-shijingran/SKILL.md +5 -5
  289. package/skills/weaver-e10-shijingran/references/source-manifest.json +37 -36
  290. package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +2 -0
  291. package/skills/weaver-e10-wenshuding/references/source-manifest.json +3 -3
  292. package/skills/weaver-e10-workflow/references/source-manifest.json +32 -32
  293. package/skills/weaver-e10-yepiaotong/SKILL.md +19 -26
  294. package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +13 -10
  295. package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +2 -0
  296. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +194 -155
  297. package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +28 -32
  298. package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +5 -1
  299. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +8 -10
  300. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +211 -616
  301. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +149 -117
  302. package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +17 -20
  303. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +20 -39
  304. package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +55 -22
  305. package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +7 -17
  306. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +88 -92
  307. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +144 -354
  308. package/skills/weaver-e10-yimiaoban/SKILL.md +1 -1
  309. package/skills/weaver-e10-yimiaoban/references/msg-write.md +1 -1
  310. package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +1 -1
  311. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +7 -7
  312. package/dist/chunks/chunk-TTPJJJC4.js +0 -465
  313. package/dist/chunks/registry-BKBZPBAJ.js +0 -23
  314. package/dist/shortcuts/invoice/markdown.js +0 -172
  315. package/dist/shortcuts/invoice/operations/issuing-qys.js +0 -424
  316. package/skills/weaver-e10-meeting.zip +0 -0
  317. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +0 -131
  318. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-form-fill-rules.md +0 -179
@@ -190,7 +190,7 @@ weaver-work-cli --json im run <operation> --input-json '{"key":"value"}'
190
190
  3. 用户确认后调用 `<op>.apply`,传 `{"confirm":true,"continuation":"<prepare 返回的 token>"}`。
191
191
  4. `apply` 返回 `ok:true` 即成功,直接汇报结果并结束;**不要追加只读回查**。只有 `partial` / `write_uncertain` / 超时 / 响应丢失时才立即停止、如实说明"结果未知"、**不自动重试**,是否回查由用户决定(见「执行原则 6」)。
192
192
 
193
- continuation 由 CLI 用 HMAC-SHA256 签发、10 分钟有效、绑定 baseUrl/profile/userId 与目标指纹,**不手工拼、不复用、不跨操作**。任何一步出现登录失效/上下文变化(`context_mismatch`/`continuation_expired`/`target_changed`)都回到第一步重新 prepare。可安全重试的只有 `prepare` 这类纯只读准备。
193
+ continuation 由 CLI 用 HMAC-SHA256 签发、24 小时有效、绑定 baseUrl/profile/userId 与目标指纹,**不手工拼、不复用、不跨操作**。任何一步出现登录失效/上下文变化(`context_mismatch`/`continuation_expired`/`target_changed`)都回到第一步重新 prepare。可安全重试的只有 `prepare` 这类纯只读准备。
194
194
 
195
195
  ## 输出与展示规则
196
196
 
@@ -79,7 +79,7 @@ weaver-work-cli --json im run im.msg.send.group.apply --input-json '{"confirm":t
79
79
 
80
80
  ## 注意
81
81
 
82
- - apply 只接受 prepare 签发的 continuation;**不得手工拼 token**,不得复用/跨操作使用。超过 10 分钟或切换账号/租户后 continuation 失效,需重新 prepare。
82
+ - apply 只接受 prepare 签发的 continuation;**不得手工拼 token**,不得复用/跨操作使用。超过 24 小时或切换账号/租户后 continuation 失效,需重新 prepare。
83
83
  - `apply` 里不要重复传业务参数(发送目标/内容以 prepare 快照为准);重复调用 prepare 后必须用**最新** continuation。
84
84
  - 图片/文件发送成功与否**以 apply 响应为准**:`ok:true` 就是已发出,直接汇报,不要再拉群/单聊最新消息去找那条消息。仅当响应为 `partial`/`write_uncertain`/超时才停下说明"结果未知",**不要自动重发**(否则可能重复发送),是否回查由用户决定。
85
85
  - 撤回超时或非本人消息会业务失败(1505/1506/1507),按错误信息告知用户,不重试。
@@ -11,7 +11,7 @@
11
11
  5. **时间范围查询转 id 区间 + 强制收敛 7 天**:单聊/群聊/系统消息历史不支持服务端时间过滤,CLI 把 `from/to` 换算为消息 id 区间;跨度 > 7 天自动收敛为该范围最后 7 个自然日,`rangeShrink.notice` **必须原样转述给用户**;要更早历史就按 ≤ 7 天分段,不要替用户改口径。
12
12
  6. **本人 IM 身份只用于本机组装**:`group.search` 的 `members/owner/creator` 条件、撤回/必达消息体、建群自检、消息「我」的判定,由 CLI 用 `teamsCheck` 取得的本人 `imCid`/`imUid` 完成;调用方不要传、也传不了这些身份(`user`/`sender`/`operator` 会被 `forbidden_key` 拒绝),不要自行拼 `cid`/`uid` 顶替。
13
13
  7. **消息展示完整不截断**:拉到的 `content` 完整展示,无论多长;不得自行截断/省略/改写正文。输出顺序为最新在前;渲染表格时转义 `|`、保留换行提示(⏎)、媒体显示为 `[图片]/[视频]/[文件]名称` 且预览/下载链接保持可点击,必达消息保留 `[必达]` 前缀。
14
- 8. **写操作只认 CLI 签发的 continuation**:不手工拼、不复用、不跨操作;prepare 后 10 分钟有效;`apply` 不自动重试。
14
+ 8. **写操作只认 CLI 签发的 continuation**:不手工拼、不复用、不跨操作;prepare 后 24 小时有效;`apply` 不自动重试。
15
15
  9. **禁止发送空白消息**:`txt` 为空或全空白(空格/换行)不算内容,CLI 直接返回 `content_required`,需提示用户提供非空内容。
16
16
  10. **超时即失败**:普通请求超过 15 秒即视为失败(上传 15/60 秒),不再重试,向用户说明失败原因;禁止无限重试或静默换接口。
17
17
  11. **未匹配不猜测**:人员/群未匹配(`total=0`/空)时直接告知「未找到『XX』,请确认名称是否正确」并停止。🔴 禁止翻历史会话、拉会话列表、按相似名/部分名模糊搜索去猜人,也不要推荐"可能的人"。
@@ -2270,13 +2270,13 @@
2270
2270
  }
2271
2271
  },
2272
2272
  "artifactBaseline": {
2273
- "aggregateSha256": "4fcf441cb7e08c3c5e2de04c10144efd27c673788b28904786592c981d6b05e5",
2273
+ "aggregateSha256": "3d8fbde13725dcf27f52c016470b406461b00d23d331ca84226e2d9ddfa72a42",
2274
2274
  "files": [
2275
2275
  {
2276
2276
  "path": "docs/im.md",
2277
2277
  "role": "generated-cli",
2278
2278
  "size": 9895,
2279
- "sha256": "4977c1adddb0fa7f2c23e491b3900ac2f586d9d56862f2945169c0c7b5061c41"
2279
+ "sha256": "54c54726488db4b05da2ac28992432db91c5ac71abc048155de3035b2313c1f6"
2280
2280
  },
2281
2281
  {
2282
2282
  "path": "skill-template/domains/yimiaoban.md",
@@ -2330,7 +2330,7 @@
2330
2330
  "path": "skills/weaver-e10-yimiaoban/references/msg-write.md",
2331
2331
  "role": "generated-reference",
2332
2332
  "size": 7470,
2333
- "sha256": "802760db63773e89b15f50a766ce309870335256d936ab9637a6b5671044d68c"
2333
+ "sha256": "c2149ffb63f8a292e94e5bdb99cc47d77a76f680b2c5c1f651dae777af546e83"
2334
2334
  },
2335
2335
  {
2336
2336
  "path": "skills/weaver-e10-yimiaoban/references/person.md",
@@ -2342,7 +2342,7 @@
2342
2342
  "path": "skills/weaver-e10-yimiaoban/references/safety-boundaries.md",
2343
2343
  "role": "generated-reference",
2344
2344
  "size": 8020,
2345
- "sha256": "37c7236daf924b11af957deafc780c58cc8d9631edc31c34bcd340e585d61e04"
2345
+ "sha256": "58f71f23e698ed69cfbe25744db306ebca29787fae5479e812824b50a850c17f"
2346
2346
  },
2347
2347
  {
2348
2348
  "path": "skills/weaver-e10-yimiaoban/references/session-sysmsg.md",
@@ -2360,13 +2360,13 @@
2360
2360
  "path": "skills/weaver-e10-yimiaoban/SKILL.md",
2361
2361
  "role": "generated-reference",
2362
2362
  "size": 28802,
2363
- "sha256": "ac23200ff25a3c1704c5994e2217501d24873c9fe0f5242e603177ff242d3855"
2363
+ "sha256": "8ed05c23cac6f0cd81a9c94642c5aa6c02f8e6d8cb7ad5b96b03bf4ca19d90d4"
2364
2364
  },
2365
2365
  {
2366
2366
  "path": "src/shortcuts/im/continuation.ts",
2367
2367
  "role": "generated-cli",
2368
- "size": 3219,
2369
- "sha256": "e3ae35e19eca3129a396ce0403cd808ff186204512600159f885fd9dcf51945c"
2368
+ "size": 3297,
2369
+ "sha256": "288eca4b77580ac2bb6b15b77a0ed70bfff10a427a942a5cc8f9ea6ab05e6075"
2370
2370
  },
2371
2371
  {
2372
2372
  "path": "src/shortcuts/im/diagnostics.ts",
@@ -1,465 +0,0 @@
1
- import { createRequire as __esbuildCreateRequire } from 'node:module';
2
- const require = __esbuildCreateRequire(import.meta.url);
3
- import {
4
- createE10RequestRuntime,
5
- isE10SessionExpiredResponse,
6
- requireE10Session
7
- } from "./chunk-SA6VBIHY.js";
8
- import {
9
- E10_REAUTH_GUIDANCE,
10
- E10_SESSION_EXPIRED_MESSAGE,
11
- getActiveProfile
12
- } from "./chunk-FOAA27U5.js";
13
- import {
14
- CliError
15
- } from "./chunk-LUSPKZKY.js";
16
-
17
- // src/shortcuts/invoice/errors.ts
18
- var InvoiceCliError = class extends CliError {
19
- type;
20
- subtype;
21
- code;
22
- retryable;
23
- stage;
24
- details;
25
- partialData;
26
- constructor(type, subtype, message, options = {}) {
27
- super(message, options.exitCode ?? 5 /* InternalError */);
28
- this.name = "InvoiceCliError";
29
- this.type = type;
30
- this.subtype = subtype;
31
- this.code = options.code;
32
- this.retryable = options.retryable ?? false;
33
- this.stage = options.stage;
34
- this.details = options.details;
35
- this.partialData = options.partialData;
36
- }
37
- };
38
- function invoiceValidationError(subtype, message, details) {
39
- return new InvoiceCliError("validation", subtype, message, {
40
- details,
41
- exitCode: 2 /* UsageError */
42
- });
43
- }
44
- function invoiceAuthError(subtype, message, details) {
45
- return new InvoiceCliError("authentication", subtype, message, {
46
- details,
47
- exitCode: 3 /* AuthError */
48
- });
49
- }
50
- function invoiceNetworkError(subtype, message, options = {}) {
51
- return new InvoiceCliError("network", subtype, message, {
52
- ...options,
53
- retryable: options.retryable ?? true,
54
- exitCode: 4 /* NetworkError */
55
- });
56
- }
57
- function invoiceConfirmationError(action, details) {
58
- return new InvoiceCliError("confirmation", "required", "\u8BE5\u64CD\u4F5C\u9700\u8981\u660E\u786E\u786E\u8BA4", {
59
- details: { action, ...details },
60
- exitCode: 10 /* ConfirmationRequired */
61
- });
62
- }
63
- function invoicePartialError(message, partialData, details) {
64
- return new InvoiceCliError("partial", "write_uncertain", message, {
65
- details,
66
- partialData,
67
- exitCode: 11 /* Partial */
68
- });
69
- }
70
- function isInvoiceNetworkError(error) {
71
- return Boolean(
72
- error && typeof error === "object" && "type" in error && error.type === "network"
73
- );
74
- }
75
-
76
- // src/shortcuts/invoice/host.ts
77
- import { createHash } from "node:crypto";
78
- import { readFile } from "node:fs/promises";
79
- var MAX_DOWNLOAD_BYTES = 50 * 1024 * 1024;
80
- var TOKEN_SERVICE = "cn.weaver.weaver-work-cli.invoice-token";
81
- var INVOICE_SESSION_EXPIRED_CODE = "-2";
82
- function assertPath(requestPath) {
83
- if (typeof requestPath !== "string" || !requestPath.startsWith("/") || requestPath.startsWith("//")) {
84
- throw invoiceValidationError("path_invalid", "\u8BF7\u6C42\u8DEF\u5F84\u5FC5\u987B\u662F\u76F8\u5BF9\u7EDD\u5BF9\u8DEF\u5F84");
85
- }
86
- if (/^https?:/i.test(requestPath) || /[\r\n]/.test(requestPath) || requestPath.includes("/../")) {
87
- throw invoiceValidationError("path_invalid", "\u8BF7\u6C42\u8DEF\u5F84\u4E0D\u5141\u8BB8\u8DE8\u57DF\u6216\u8DEF\u5F84\u9003\u9038");
88
- }
89
- if (!requestPath.startsWith("/api/")) {
90
- throw invoiceValidationError("path_not_allowed", "\u4E1A\u7968\u901A\u53EA\u80FD\u8C03\u7528 /api/ \u8DEF\u5F84");
91
- }
92
- }
93
- function responseRoot(value) {
94
- return value?.res_base || value?.data?.res_base || value;
95
- }
96
- function responseMessage(value) {
97
- const root = responseRoot(value);
98
- return typeof root?.message === "string" ? root.message : typeof root?.msg === "string" ? root.msg : "\u6CDB\u5FAE\u63A5\u53E3\u8FD4\u56DE\u4E1A\u52A1\u5931\u8D25";
99
- }
100
- function responseCode(value) {
101
- const root = responseRoot(value);
102
- return root?.ret ?? root?.code;
103
- }
104
- function isInvoiceSessionExpired(value) {
105
- const code = responseCode(value);
106
- return code !== void 0 && String(code) === INVOICE_SESSION_EXPIRED_CODE;
107
- }
108
- function tokenAccount(session) {
109
- return createHash("sha256").update(`${session.profile}
110
- ${session.baseUrl}
111
- ${session.userId}`).digest("hex");
112
- }
113
- function createInvoiceTokenStore(session) {
114
- const account = tokenAccount(session);
115
- let entryPromise = null;
116
- async function entry() {
117
- if (!entryPromise) {
118
- entryPromise = import("@napi-rs/keyring").then(({ Entry }) => new Entry(TOKEN_SERVICE, account));
119
- }
120
- return entryPromise;
121
- }
122
- return {
123
- async load() {
124
- try {
125
- const value = await (await entry()).getPassword();
126
- return typeof value === "string" && value.trim() ? value : null;
127
- } catch {
128
- return null;
129
- }
130
- },
131
- async save(token) {
132
- if (!token.trim()) return false;
133
- try {
134
- await (await entry()).setPassword(token);
135
- return true;
136
- } catch {
137
- return false;
138
- }
139
- },
140
- async clear() {
141
- try {
142
- await (await entry()).deletePassword();
143
- return true;
144
- } catch {
145
- return false;
146
- }
147
- }
148
- };
149
- }
150
- async function clearInvoiceTokenForSession(session) {
151
- return createInvoiceTokenStore(session).clear();
152
- }
153
- function inferProfile(ctx) {
154
- const options = ctx.getGlobalOptions();
155
- return options.profile || getActiveProfile();
156
- }
157
- function trustedInvoiceHeaders(invoiceToken) {
158
- return invoiceToken ? { token: invoiceToken } : {};
159
- }
160
- function createInvoiceHost(ctx, dependencies = {}) {
161
- let e10Session = null;
162
- let sessionContext = null;
163
- let invoiceToken = null;
164
- let tokenStore = null;
165
- const requireSession = dependencies.requireSession || requireE10Session;
166
- const tokenStoreFactory = dependencies.tokenStoreFactory || createInvoiceTokenStore;
167
- async function ensureSession() {
168
- if (!e10Session) {
169
- e10Session = await requireSession(ctx);
170
- sessionContext = {
171
- baseUrl: e10Session.getBaseUrl(),
172
- profile: inferProfile(ctx),
173
- userId: e10Session.userId
174
- };
175
- }
176
- return e10Session;
177
- }
178
- async function getSession() {
179
- await ensureSession();
180
- return sessionContext;
181
- }
182
- async function ensureInvoiceToken(timeoutMs = 3e4) {
183
- await ensureSession();
184
- const context = await getSession();
185
- tokenStore ||= tokenStoreFactory(context);
186
- if (invoiceToken) return invoiceToken;
187
- invoiceToken = await tokenStore.load();
188
- if (invoiceToken) return invoiceToken;
189
- const tokenResponse = await invoiceRequest({
190
- method: "GET",
191
- path: "/api/inc/proxy/getToken",
192
- query: { appType: 1 },
193
- needsInvoiceToken: false,
194
- timeoutMs
195
- });
196
- const token = tokenResponse?.data?.token;
197
- if (typeof token !== "string" || !token.trim()) {
198
- throw invoiceAuthError("invoice_token_missing", "\u672A\u53D6\u5F97\u4E1A\u7968\u901A\u4E1A\u52A1 Token");
199
- }
200
- await tokenStore.save(token);
201
- invoiceToken = token;
202
- return token;
203
- }
204
- async function ensureContext(needsInvoiceToken, timeoutMs, path) {
205
- await ensureSession();
206
- const tokenEndpoint = path === "/api/inc/proxy/getToken" || path === "/api/app/inc/proxy/getToken";
207
- if (tokenEndpoint) return void 0;
208
- if (!needsInvoiceToken) {
209
- }
210
- return ensureInvoiceToken(timeoutMs);
211
- }
212
- async function clearCachedInvoiceToken() {
213
- invoiceToken = null;
214
- await tokenStore?.clear().catch(() => false);
215
- }
216
- async function runtime() {
217
- return createE10RequestRuntime(ctx, await ensureSession(), {
218
- interceptors: dependencies.interceptors,
219
- fetch: dependencies.fetch
220
- });
221
- }
222
- function businessError(value) {
223
- const code = responseCode(value);
224
- return new InvoiceCliError("api", "business_error", responseMessage(value), {
225
- code: String(code),
226
- details: { ret: code },
227
- exitCode: 1
228
- });
229
- }
230
- async function handleBusinessResponse(value, retry, canRetry) {
231
- const code = responseCode(value);
232
- if (code === void 0 || code === 0 || code === 200) return value;
233
- if (isInvoiceSessionExpired(value)) {
234
- await clearCachedInvoiceToken();
235
- if (canRetry) return retry();
236
- throw invoiceAuthError(
237
- "invoice_session_expired",
238
- `\u53D1\u7968\u4E1A\u52A1\u767B\u5F55\u6001\u5DF2\u5931\u6548\uFF0C\u5DF2\u6E05\u7406\u672C\u5730\u53D1\u7968 Token\u3002${E10_REAUTH_GUIDANCE}`,
239
- { ret: code }
240
- );
241
- }
242
- throw businessError(value);
243
- }
244
- async function invoiceRequest(request, canRetryExpiredToken = true) {
245
- const {
246
- method = "POST",
247
- path,
248
- query,
249
- headers,
250
- body,
251
- operation,
252
- needsInvoiceToken = true,
253
- timeoutMs = 3e4
254
- } = request;
255
- assertPath(path);
256
- const token = await ensureContext(needsInvoiceToken, timeoutMs, path);
257
- const response = await (await runtime()).requestJson({
258
- module: "invoice",
259
- operation,
260
- method,
261
- path,
262
- query,
263
- headers,
264
- body,
265
- timeoutMs,
266
- trustedHeaders: trustedInvoiceHeaders(token)
267
- });
268
- if (isE10SessionExpiredResponse(response)) {
269
- throw invoiceAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
270
- }
271
- if (response.parseError) {
272
- if (response.status < 200 || response.status >= 300) {
273
- throw new InvoiceCliError("api", "http_error", `\u6CDB\u5FAE\u63A5\u53E3 HTTP ${response.status}`, {
274
- code: response.status,
275
- details: { status: response.status },
276
- exitCode: 1
277
- });
278
- }
279
- throw invoiceNetworkError("protocol", `\u63A5\u53E3\u8FD4\u56DE\u4E0D\u662F\u5408\u6CD5 JSON\uFF08HTTP ${response.status}\uFF09`, { retryable: false });
280
- }
281
- if (response.status < 200 || response.status >= 300) {
282
- throw new InvoiceCliError("api", "http_error", `\u6CDB\u5FAE\u63A5\u53E3 HTTP ${response.status}`, {
283
- code: response.status,
284
- details: { status: response.status, message: responseMessage(response.value) },
285
- exitCode: 1
286
- });
287
- }
288
- let value = response.value;
289
- if (request.rewriteJsonText && response.text) {
290
- try {
291
- value = JSON.parse(request.rewriteJsonText(response.text));
292
- } catch {
293
- value = response.value;
294
- }
295
- }
296
- return handleBusinessResponse(value, () => invoiceRequest(request, false), canRetryExpiredToken && Boolean(token));
297
- }
298
- async function invoiceMultipartRequest(request, canRetryExpiredToken = true) {
299
- const {
300
- method = "POST",
301
- path,
302
- query,
303
- fields = {},
304
- file,
305
- headers,
306
- operation,
307
- needsInvoiceToken = true,
308
- timeoutMs = 3e4
309
- } = request;
310
- if (!file && !Object.values(fields).some((value) => value !== void 0 && value !== null && value !== "")) {
311
- throw invoiceValidationError("input_invalid", "multipart \u8BF7\u6C42\u9700\u8981\u6587\u4EF6\u3001URL \u6216\u8868\u5355\u5B57\u6BB5");
312
- }
313
- assertPath(path);
314
- const token = await ensureContext(needsInvoiceToken, timeoutMs, path);
315
- const form = new FormData();
316
- for (const [key, value] of Object.entries(fields)) {
317
- if (value === void 0 || value === null) continue;
318
- form.append(key, typeof value === "string" ? value : JSON.stringify(value));
319
- }
320
- if (file) {
321
- const content = await readFile(file.path);
322
- form.append("file", new Blob([content], { type: file.mimeType || "application/octet-stream" }), file.name);
323
- }
324
- const response = await (await runtime()).requestJson({
325
- module: "invoice",
326
- operation,
327
- method,
328
- path,
329
- query,
330
- headers,
331
- formData: form,
332
- timeoutMs,
333
- trustedHeaders: trustedInvoiceHeaders(token)
334
- });
335
- if (isE10SessionExpiredResponse(response)) {
336
- throw invoiceAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
337
- }
338
- if (response.parseError) {
339
- throw invoiceNetworkError("protocol", `\u63A5\u53E3\u8FD4\u56DE\u4E0D\u662F\u5408\u6CD5 JSON\uFF08HTTP ${response.status}\uFF09`, { retryable: false });
340
- }
341
- if (response.status < 200 || response.status >= 300) {
342
- throw new InvoiceCliError("api", "http_error", `\u6CDB\u5FAE\u63A5\u53E3 HTTP ${response.status}`, {
343
- code: response.status,
344
- details: { status: response.status, message: responseMessage(response.value) },
345
- exitCode: 1
346
- });
347
- }
348
- return handleBusinessResponse(response.value, () => invoiceMultipartRequest(request, false), canRetryExpiredToken && Boolean(token));
349
- }
350
- async function invoiceFormRequest(request, canRetryExpiredToken = true) {
351
- const {
352
- method = "POST",
353
- path,
354
- query,
355
- fields = {},
356
- operation,
357
- needsInvoiceToken = true,
358
- timeoutMs = 3e4
359
- } = request;
360
- assertPath(path);
361
- const token = await ensureContext(needsInvoiceToken, timeoutMs, path);
362
- const form = new URLSearchParams();
363
- for (const [key, value] of Object.entries(fields)) {
364
- if (value === void 0 || value === null) continue;
365
- form.set(key, typeof value === "string" ? value : JSON.stringify(value));
366
- }
367
- const response = await (await runtime()).requestJson({
368
- module: "invoice",
369
- operation,
370
- method,
371
- path,
372
- query,
373
- form,
374
- timeoutMs,
375
- trustedHeaders: trustedInvoiceHeaders(token)
376
- });
377
- if (isE10SessionExpiredResponse(response)) {
378
- throw invoiceAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
379
- }
380
- if (response.parseError) {
381
- throw invoiceNetworkError("protocol", `\u63A5\u53E3\u8FD4\u56DE\u4E0D\u662F\u5408\u6CD5 JSON\uFF08HTTP ${response.status}\uFF09`, { retryable: false });
382
- }
383
- if (response.status < 200 || response.status >= 300) {
384
- throw new InvoiceCliError("api", "http_error", `\u6CDB\u5FAE\u63A5\u53E3 HTTP ${response.status}`, {
385
- code: response.status,
386
- details: { status: response.status, message: responseMessage(response.value) },
387
- exitCode: 1
388
- });
389
- }
390
- return handleBusinessResponse(response.value, () => invoiceFormRequest(request, false), canRetryExpiredToken && Boolean(token));
391
- }
392
- async function invoiceDownload({ id, fid, needLog = false, operation, timeoutMs = 3e4 }, canRetryExpiredToken = true) {
393
- const token = await ensureContext(true, timeoutMs, "/api/inc/file/download");
394
- const response = await (await runtime()).requestBinary({
395
- module: "invoice",
396
- operation,
397
- method: "GET",
398
- path: "/api/inc/file/download",
399
- query: { id, fid, needLog },
400
- headers: { Accept: "application/octet-stream, application/pdf, */*" },
401
- timeoutMs,
402
- trustedHeaders: trustedInvoiceHeaders(token)
403
- });
404
- if (isE10SessionExpiredResponse(response)) {
405
- throw invoiceAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
406
- }
407
- const contentType = response.contentType;
408
- const declaredLength = Number(response.headers.get("content-length"));
409
- if (Number.isFinite(declaredLength) && declaredLength > MAX_DOWNLOAD_BYTES) {
410
- throw invoiceNetworkError("response_too_large", `\u4E0B\u8F7D\u6587\u4EF6\u8D85\u8FC7 ${MAX_DOWNLOAD_BYTES} \u5B57\u8282\u9650\u5236`, { retryable: false });
411
- }
412
- const content = response.content;
413
- const looksLikeJson = /^[\s\r\n]*[\[{]/u.test(content.subarray(0, 64).toString("utf8"));
414
- if (response.status < 200 || response.status >= 300 || contentType.includes("json") || looksLikeJson) {
415
- let value = {};
416
- try {
417
- value = JSON.parse(content.toString("utf8"));
418
- } catch {
419
- value = {};
420
- }
421
- if (isInvoiceSessionExpired(value)) {
422
- await clearCachedInvoiceToken();
423
- if (canRetryExpiredToken && token) return invoiceDownload({ id, fid, needLog, operation, timeoutMs }, false);
424
- throw invoiceAuthError(
425
- "invoice_session_expired",
426
- `\u53D1\u7968\u4E1A\u52A1\u767B\u5F55\u6001\u5DF2\u5931\u6548\uFF0C\u5DF2\u6E05\u7406\u672C\u5730\u53D1\u7968 Token\u3002${E10_REAUTH_GUIDANCE}`,
427
- { ret: responseCode(value), status: response.status }
428
- );
429
- }
430
- throw new InvoiceCliError("api", "download_failed", responseMessage(value) || `\u4E0B\u8F7D\u5931\u8D25\uFF08HTTP ${response.status}\uFF09`, {
431
- code: response.status,
432
- details: { status: response.status, ret: responseCode(value) },
433
- exitCode: 1
434
- });
435
- }
436
- if (!content.length) {
437
- throw invoiceNetworkError("protocol", "\u4E0B\u8F7D\u63A5\u53E3\u8FD4\u56DE\u7A7A\u6587\u4EF6", { retryable: false });
438
- }
439
- if (content.length > MAX_DOWNLOAD_BYTES) {
440
- throw invoiceNetworkError("response_too_large", `\u4E0B\u8F7D\u6587\u4EF6\u8D85\u8FC7 ${MAX_DOWNLOAD_BYTES} \u5B57\u8282\u9650\u5236`, { retryable: false });
441
- }
442
- return { content, contentType };
443
- }
444
- return {
445
- invoiceRequest,
446
- invoiceMultipartRequest,
447
- invoiceFormRequest,
448
- invoiceDownload,
449
- getSession,
450
- invalidateToken() {
451
- invoiceToken = null;
452
- void clearCachedInvoiceToken();
453
- }
454
- };
455
- }
456
-
457
- export {
458
- InvoiceCliError,
459
- invoiceValidationError,
460
- invoiceConfirmationError,
461
- invoicePartialError,
462
- isInvoiceNetworkError,
463
- clearInvoiceTokenForSession,
464
- createInvoiceHost
465
- };
@@ -1,23 +0,0 @@
1
- import { createRequire as __esbuildCreateRequire } from 'node:module';
2
- const require = __esbuildCreateRequire(import.meta.url);
3
- import {
4
- getMeetingOperation,
5
- hasMeetingOperation,
6
- meetingOperationDefinitions
7
- } from "./chunk-JPRO6ER2.js";
8
- import "./chunk-BIPYLLVS.js";
9
- import "./chunk-NKZRQXST.js";
10
- import "./chunk-R4CHUSKC.js";
11
- import "./chunk-IZ7S7QUS.js";
12
- import "./chunk-GHXCDPTM.js";
13
- import "./chunk-QKNKR4RH.js";
14
- import "./chunk-W7BEHOSR.js";
15
- import "./chunk-GEWYMQME.js";
16
- import "./chunk-72CKAUAG.js";
17
- import "./chunk-LUSPKZKY.js";
18
- import "./chunk-BUSC6UAE.js";
19
- export {
20
- getMeetingOperation,
21
- hasMeetingOperation,
22
- meetingOperationDefinitions
23
- };