weaver-work-cli 0.1.42 → 0.1.45

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 (401) hide show
  1. package/README.md +21 -0
  2. package/dist/chunks/{archive-J4I6MCKF.js → archive-ZQ4A4TV6.js} +399 -47
  3. package/dist/chunks/{archive-oa-BRZKKTO4.js → archive-oa-BBDP7AKJ.js} +12 -5
  4. package/dist/chunks/{asset-L7D4FAOZ.js → asset-ZOJVBWZH.js} +11 -4
  5. package/dist/chunks/{asset-idle-DADLLV75.js → asset-idle-XGB5IPGT.js} +7 -3
  6. package/dist/chunks/{attachment-content-K4C7VLWQ.js → attachment-content-CE3GMWTS.js} +5 -4
  7. package/dist/chunks/{blog-BVGQ7NZL.js → blog-QSHLZSFW.js} +11 -4
  8. package/dist/chunks/caizhilian-KCQYFH72.js +204 -0
  9. package/dist/chunks/{calendar-Q7NQY5Z2.js → calendar-DLGMRJQA.js} +12 -5
  10. package/dist/chunks/{chunk-W7BEHOSR.js → chunk-3WBIQLMB.js} +2 -2
  11. package/dist/chunks/{chunk-4PD5NWAX.js → chunk-3YV7PKRL.js} +2 -2
  12. package/dist/chunks/{chunk-JPRO6ER2.js → chunk-3ZMAQQ3W.js} +185 -60
  13. package/dist/chunks/{chunk-R4CHUSKC.js → chunk-4EXOIQDI.js} +40 -10
  14. package/dist/chunks/{chunk-OOUTBLZ4.js → chunk-56EZERK4.js} +1 -1
  15. package/dist/chunks/chunk-6N4JPNFL.js +76 -0
  16. package/dist/chunks/{chunk-SA6VBIHY.js → chunk-6NXT4ICB.js} +342 -17
  17. package/dist/chunks/{chunk-ZUX3P6BQ.js → chunk-727FH2NI.js} +1 -1
  18. package/dist/chunks/chunk-762M5XJS.js +215 -0
  19. package/dist/chunks/{chunk-GEWYMQME.js → chunk-77YP6I52.js} +1 -1
  20. package/dist/chunks/chunk-7BDPM5ST.js +11 -0
  21. package/dist/chunks/{chunk-G4UR6NXN.js → chunk-CZNZKOHR.js} +3 -3
  22. package/dist/chunks/{chunk-GHXCDPTM.js → chunk-DGMYACGJ.js} +1 -1
  23. package/dist/chunks/{chunk-4RAE6JXP.js → chunk-DLY5GUXX.js} +6 -3
  24. package/dist/chunks/{chunk-BYBSCN4X.js → chunk-G7PQWD4L.js} +6 -3
  25. package/dist/chunks/{chunk-EKWAQSLU.js → chunk-GR76ZDDX.js} +432 -2248
  26. package/dist/chunks/{chunk-APVFJUQH.js → chunk-HFXK54M4.js} +3 -3
  27. package/dist/chunks/{chunk-EZALDOQH.js → chunk-HP7JIYMT.js} +5 -2
  28. package/dist/chunks/{chunk-ZEDWSH32.js → chunk-IC62NFM5.js} +1 -1
  29. package/dist/chunks/{chunk-3KTFS4IA.js → chunk-JB34OE7R.js} +808 -85
  30. package/dist/chunks/{chunk-72CKAUAG.js → chunk-JWWTI63L.js} +59 -7
  31. package/dist/chunks/{chunk-P26ZWSKU.js → chunk-KIHNAS25.js} +5 -2
  32. package/dist/chunks/{chunk-NKZRQXST.js → chunk-LGKWL4OH.js} +200 -47
  33. package/dist/chunks/chunk-LRCPNDZA.js +2529 -0
  34. package/dist/chunks/{chunk-QKNKR4RH.js → chunk-LXFVWZLM.js} +4 -4
  35. package/dist/chunks/{chunk-NOODWMCL.js → chunk-O6CMPO65.js} +25 -2
  36. package/dist/chunks/{chunk-BIPYLLVS.js → chunk-OAE3AZBQ.js} +15 -15
  37. package/dist/chunks/chunk-P5GQRWDC.js +60 -0
  38. package/dist/chunks/{caizhilian-SAADNFD6.js → chunk-PGO4ILMQ.js} +44 -517
  39. package/dist/chunks/{chunk-2LV74IWP.js → chunk-Q4OYAQYH.js} +1 -1
  40. package/dist/chunks/{chunk-LDZQPUIA.js → chunk-T4MWQAQB.js} +8 -6
  41. package/dist/chunks/{chunk-BBKDXQEC.js → chunk-TGAGQV4I.js} +3 -3
  42. package/dist/chunks/{chunk-GPMFD4RD.js → chunk-TXUG266F.js} +1 -1
  43. package/dist/chunks/{chunk-FOAA27U5.js → chunk-U6R6FZHD.js} +184 -18
  44. package/dist/chunks/{chunk-LUSPKZKY.js → chunk-UG5G54VL.js} +1 -0
  45. package/dist/chunks/{chunk-NIAJ5ZCG.js → chunk-UL5XUQ25.js} +5 -2
  46. package/dist/chunks/{chunk-IZ7S7QUS.js → chunk-VIMCY4DI.js} +6 -6
  47. package/dist/chunks/chunk-VRPH24IC.js +76 -0
  48. package/dist/chunks/{chunk-FMPJJYYI.js → chunk-WRXSAVKO.js} +1 -1
  49. package/dist/chunks/{chunk-YRSZQUD2.js → chunk-YIKSL36S.js} +3 -3
  50. package/dist/chunks/{chunk-3SO6QL6U.js → chunk-YWX377BY.js} +5 -2
  51. package/dist/chunks/{chunk-BYATLLEF.js → chunk-Z3GDFVJR.js} +1 -1
  52. package/dist/chunks/{chunk-LADPYOWC.js → chunk-Z6UUBY37.js} +3 -3
  53. package/dist/chunks/{conflict-F2OMZRTO.js → conflict-IYJETSGT.js} +4 -3
  54. package/dist/chunks/{continuation-2CKSBLA6.js → continuation-3S37AUSH.js} +4 -3
  55. package/dist/chunks/{continuation-RN6PZN2M.js → continuation-3XLYYTKV.js} +4 -3
  56. package/dist/chunks/continuation-GW6PRWK3.js +12 -0
  57. package/dist/chunks/{continuation-HZIZRZBX.js → continuation-HFW2YT5S.js} +4 -3
  58. package/dist/chunks/{continuation-NLECEJPX.js → continuation-KI7DRRZN.js} +4 -3
  59. package/dist/chunks/{contract-5BETHRSG.js → contract-3QLAGYQL.js} +5803 -4593
  60. package/dist/chunks/{cowork-3MN6EQQO.js → cowork-3ACICHDQ.js} +11 -4
  61. package/dist/chunks/{create-flow-5FQNNMVO.js → create-flow-7JLC7UID.js} +8 -7
  62. package/dist/chunks/{ebuilder-form-SBHOYBUD.js → ebuilder-form-GWDTKEI2.js} +14 -9
  63. package/dist/chunks/{ehr-KMOJULKG.js → ehr-MYRDCHZ4.js} +357 -43
  64. package/dist/chunks/{employee-SAK2QYXX.js → employee-NOHNXC46.js} +3 -3
  65. package/dist/chunks/{env-LB7NBL2O.js → env-3MBHAWBL.js} +4 -3
  66. package/dist/chunks/{esb-W2PJCFCX.js → esb-4BQHNP5C.js} +12 -7
  67. package/dist/chunks/{factory-6ZFQXQ46.js → factory-TZEVU4DU.js} +3 -2
  68. package/dist/chunks/{fna-ZQPCUV4R.js → fna-ZVB2IILI.js} +14 -8
  69. package/dist/chunks/{group-chat-2HHAJN46.js → group-chat-KL3HFKRM.js} +5 -4
  70. package/dist/chunks/{host-YTODKMSL.js → host-3TNBMDTR.js} +5 -5
  71. package/dist/chunks/host-7NTIBSPK.js +25 -0
  72. package/dist/chunks/{host-4CBHGOHT.js → host-7OWWPLM4.js} +5 -5
  73. package/dist/chunks/{host-ATKVNZAT.js → host-G3VU7SDW.js} +5 -5
  74. package/dist/chunks/{host-BQH22NTQ.js → host-M4XP5URR.js} +5 -5
  75. package/dist/chunks/{host-X2CSLFM6.js → host-TUOIOEMC.js} +5 -5
  76. package/dist/chunks/{hrm-FFM4UJFS.js → hrm-UNKCCCGP.js} +11 -7
  77. package/dist/chunks/{im-VEHKDQPB.js → im-NJB7ZYMH.js} +8 -7
  78. package/dist/chunks/{invoice-LVIKSIIF.js → invoice-OQP3TMKQ.js} +636 -1768
  79. package/dist/chunks/{jiuchuanhui-X6DINO5P.js → jiuchuanhui-ASFZBMPU.js} +14 -6
  80. package/dist/chunks/{lazy-dispatch-KSWTN5L6.js → lazy-dispatch-UH6HGK2I.js} +7 -6
  81. package/dist/chunks/{mail-VDKRGUD3.js → mail-M3HJF5ER.js} +16 -14
  82. package/dist/chunks/{meeting-CLC6HP3Z.js → meeting-C67EHQ4Z.js} +21 -14
  83. package/dist/chunks/{okr-CHG4OO3U.js → okr-EVX7FB5G.js} +12 -5
  84. package/dist/chunks/{operations-5QL3AECO.js → operations-62N6EP3C.js} +4 -3
  85. package/dist/chunks/operations-J7PUIVWZ.js +15 -0
  86. package/dist/chunks/{plan-XWR75667.js → plan-2QJQEPBO.js} +12 -5
  87. package/dist/chunks/{project-5BXOOKMG.js → project-XELELW2T.js} +11 -4
  88. package/dist/chunks/reception-5WITA44R.js +1899 -0
  89. package/dist/chunks/{recruit-stage-DGMFNNDE.js → recruit-stage-AHY5QAMF.js} +745 -149
  90. package/dist/chunks/{registry-RHMW6ANW.js → registry-AQVGHUM6.js} +7 -6
  91. package/dist/chunks/{registry-OZSMDVPP.js → registry-PVUZQDDQ.js} +3 -3
  92. package/dist/chunks/{registry-7FFOXIAW.js → registry-QJCZ2GVG.js} +7 -6
  93. package/dist/chunks/{registry-Z43434VG.js → registry-VWXWPVAG.js} +4 -4
  94. package/dist/chunks/registry-XPWPGHYE.js +24 -0
  95. package/dist/chunks/{room-recommend-62H7ZQQ6.js → room-recommend-CNWE5WQK.js} +8 -5
  96. package/dist/chunks/{schedule-FNXKH3DQ.js → schedule-YYNYBQIE.js} +6 -5
  97. package/dist/chunks/{workflow-ADHKCAJK.js → workflow-BSYT5TGL.js} +15 -8
  98. package/dist/cmd/action.js +6 -0
  99. package/dist/cmd/identity/index.js +45 -0
  100. package/dist/cmd/index.js +2 -0
  101. package/dist/core/continuation-ttl.js +18 -0
  102. package/dist/core/error-codes.js +85 -0
  103. package/dist/core/logger.js +11 -0
  104. package/dist/index.js +37 -31
  105. package/dist/internal/e10/auth/commands.js +195 -8
  106. package/dist/internal/e10/auth/error-log.js +312 -0
  107. package/dist/internal/e10/auth/session.js +17 -3
  108. package/dist/internal/e10/auth/xiaoe.js +176 -13
  109. package/dist/internal/e10/auth-recovery.js +39 -12
  110. package/dist/internal/e10/context.js +29 -3
  111. package/dist/internal/skills/install.js +9 -1
  112. package/dist/shortcuts/archive/continuation.js +2 -1
  113. package/dist/shortcuts/archive/index.js +3 -0
  114. package/dist/shortcuts/archive/operations/borrow-list.js +105 -14
  115. package/dist/shortcuts/archive/operations/confirm.js +2 -1
  116. package/dist/shortcuts/archive/operations/flow-url.js +182 -22
  117. package/dist/shortcuts/archive/operations/getPageUrl.js +75 -0
  118. package/dist/shortcuts/archive/operations/prelib.js +33 -4
  119. package/dist/shortcuts/archive/operations/shared.js +52 -0
  120. package/dist/shortcuts/archive-oa/continuation.js +2 -1
  121. package/dist/shortcuts/archive-oa/index.js +2 -0
  122. package/dist/shortcuts/archive-oa/operations/confirm.js +2 -1
  123. package/dist/shortcuts/asset/continuation.js +2 -1
  124. package/dist/shortcuts/asset/index.js +2 -0
  125. package/dist/shortcuts/asset-idle/index.js +2 -0
  126. package/dist/shortcuts/blog/continuation.js +2 -1
  127. package/dist/shortcuts/blog/index.js +2 -0
  128. package/dist/shortcuts/caizhilian/continuation.js +2 -1
  129. package/dist/shortcuts/caizhilian/index.js +2 -0
  130. package/dist/shortcuts/caizhilian/operations/confirm.js +3 -2
  131. package/dist/shortcuts/calendar/continuation.js +2 -1
  132. package/dist/shortcuts/calendar/index.js +2 -0
  133. package/dist/shortcuts/calendar/operations/write.js +1 -1
  134. package/dist/shortcuts/contract/continuation.js +2 -1
  135. package/dist/shortcuts/contract/host.js +111 -4
  136. package/dist/shortcuts/contract/index.js +21 -0
  137. package/dist/shortcuts/contract/manifest.js +125 -0
  138. package/dist/shortcuts/contract/ooxml/clause-insert.js +249 -0
  139. package/dist/shortcuts/contract/operations/clause-insert.js +56 -0
  140. package/dist/shortcuts/contract/operations/customer.js +192 -0
  141. package/dist/shortcuts/contract/operations/file-download.js +75 -0
  142. package/dist/shortcuts/contract/operations/flow.js +44 -2
  143. package/dist/shortcuts/contract/operations/form-info.js +162 -62
  144. package/dist/shortcuts/contract/operations/registry.js +8 -0
  145. package/dist/shortcuts/contract/operations/review.js +116 -1
  146. package/dist/shortcuts/contract/operations/summary.js +177 -0
  147. package/dist/shortcuts/contract/operations/upload.js +64 -4
  148. package/dist/shortcuts/contract/operations/write.js +2 -1
  149. package/dist/shortcuts/contract/upload-cache.js +104 -0
  150. package/dist/shortcuts/cowork/continuation.js +2 -1
  151. package/dist/shortcuts/cowork/index.js +2 -0
  152. package/dist/shortcuts/ebuilder-form/continuation.js +2 -1
  153. package/dist/shortcuts/ebuilder-form/index.js +2 -0
  154. package/dist/shortcuts/ebuilder-form/operations/write.js +3 -2
  155. package/dist/shortcuts/ehr/continuation.js +2 -1
  156. package/dist/shortcuts/ehr/index.js +2 -0
  157. package/dist/shortcuts/ehr/operations/attend-write.js +1 -1
  158. package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +186 -5
  159. package/dist/shortcuts/ehr/operations/recruit-position.js +239 -6
  160. package/dist/shortcuts/ehr/operations/recruit-write.js +18 -19
  161. package/dist/shortcuts/ehr/operations/recruit.js +17 -5
  162. package/dist/shortcuts/esb/continuation.js +2 -1
  163. package/dist/shortcuts/esb/index.js +2 -0
  164. package/dist/shortcuts/esb/operations/trigger.js +2 -1
  165. package/dist/shortcuts/fna/continuation.js +2 -1
  166. package/dist/shortcuts/fna/index.js +2 -0
  167. package/dist/shortcuts/fna/operations/invoice-writeoff.js +1 -1
  168. package/dist/shortcuts/fna/operations/loan.js +1 -1
  169. package/dist/shortcuts/hrm/index.js +2 -0
  170. package/dist/shortcuts/hrm/operations/employee.js +29 -1
  171. package/dist/shortcuts/im/continuation.js +2 -1
  172. package/dist/shortcuts/index.js +5 -0
  173. package/dist/shortcuts/invoice/continuation.js +2 -1
  174. package/dist/shortcuts/invoice/index.js +14 -15
  175. package/dist/shortcuts/invoice/invoice-record.js +93 -0
  176. package/dist/shortcuts/invoice/manifest.js +190 -393
  177. package/dist/shortcuts/invoice/operations/add.js +2 -1
  178. package/dist/shortcuts/invoice/operations/delete.js +2 -1
  179. package/dist/shortcuts/invoice/operations/import.js +2 -1
  180. package/dist/shortcuts/invoice/operations/issuing-contract-detail.js +86 -0
  181. package/dist/shortcuts/invoice/operations/issuing-contracts.js +210 -0
  182. package/dist/shortcuts/invoice/operations/registry.js +17 -17
  183. package/dist/shortcuts/invoice/operations/reim-auto.js +4 -569
  184. package/dist/shortcuts/invoice/operations/reim.js +52 -341
  185. package/dist/shortcuts/invoice/operations/shared.js +21 -4
  186. package/dist/shortcuts/invoice/operations/update.js +2 -1
  187. package/dist/shortcuts/invoice/projection.js +10 -62
  188. package/dist/shortcuts/jiuchuanhui/continuation.js +2 -1
  189. package/dist/shortcuts/jiuchuanhui/index.js +2 -0
  190. package/dist/shortcuts/jiuchuanhui/operations/datajson.js +2 -1
  191. package/dist/shortcuts/jiuchuanhui/operations/esb.js +2 -1
  192. package/dist/shortcuts/mail/continuation.js +2 -1
  193. package/dist/shortcuts/mail/index.js +2 -0
  194. package/dist/shortcuts/mail/operations/mail-blacklist.js +1 -1
  195. package/dist/shortcuts/mail/operations/mail-contacts.js +1 -1
  196. package/dist/shortcuts/mail/operations/mail-send.js +1 -1
  197. package/dist/shortcuts/mail/operations/mail-sign.js +1 -1
  198. package/dist/shortcuts/mail/operations/mail-template.js +1 -1
  199. package/dist/shortcuts/meeting/continuation.js +2 -1
  200. package/dist/shortcuts/meeting/index.js +2 -0
  201. package/dist/shortcuts/meeting/operations/change.js +1 -1
  202. package/dist/shortcuts/meeting/operations/create.js +1 -1
  203. package/dist/shortcuts/meeting/operations/eb/create-flow.js +198 -65
  204. package/dist/shortcuts/meeting/operations/eb/decision.js +1 -1
  205. package/dist/shortcuts/meeting/operations/eb/draft-memory.js +56 -0
  206. package/dist/shortcuts/meeting/operations/eb/factory.js +59 -4
  207. package/dist/shortcuts/meeting/operations/eb/person-cache.js +2 -2
  208. package/dist/shortcuts/meeting/operations/eb/room-recommend.js +47 -5
  209. package/dist/shortcuts/meeting/operations/invitation-publish.js +132 -0
  210. package/dist/shortcuts/meeting/operations/lifecycle.js +1 -1
  211. package/dist/shortcuts/meeting/operations/receipts.js +1 -1
  212. package/dist/shortcuts/meeting/operations/registry.js +2 -0
  213. package/dist/shortcuts/meeting/operations/signs.js +1 -1
  214. package/dist/shortcuts/okr/continuation.js +2 -1
  215. package/dist/shortcuts/okr/index.js +2 -0
  216. package/dist/shortcuts/okr/operations/write.js +1 -1
  217. package/dist/shortcuts/plan/continuation.js +2 -1
  218. package/dist/shortcuts/plan/index.js +2 -0
  219. package/dist/shortcuts/plan/operations/write.js +1 -1
  220. package/dist/shortcuts/project/continuation.js +2 -1
  221. package/dist/shortcuts/project/index.js +2 -0
  222. package/dist/shortcuts/reception/constants.js +53 -0
  223. package/dist/shortcuts/reception/errors.js +54 -0
  224. package/dist/shortcuts/reception/host.js +125 -0
  225. package/dist/shortcuts/reception/index.js +198 -0
  226. package/dist/shortcuts/reception/manifest.js +177 -0
  227. package/dist/shortcuts/reception/operations/ask.js +71 -0
  228. package/dist/shortcuts/reception/operations/browsertool.js +58 -0
  229. package/dist/shortcuts/reception/operations/compose.js +129 -0
  230. package/dist/shortcuts/reception/operations/customparams.js +74 -0
  231. package/dist/shortcuts/reception/operations/doc.js +238 -0
  232. package/dist/shortcuts/reception/operations/docrender.js +36 -0
  233. package/dist/shortcuts/reception/operations/panels.js +179 -0
  234. package/dist/shortcuts/reception/operations/registry.js +26 -0
  235. package/dist/shortcuts/reception/operations/render-assets.js +184 -0
  236. package/dist/shortcuts/reception/operations/render.js +123 -0
  237. package/dist/shortcuts/reception/operations/runs.js +38 -0
  238. package/dist/shortcuts/reception/operations/schedule.js +127 -0
  239. package/dist/shortcuts/reception/operations/shared.js +196 -0
  240. package/dist/shortcuts/reception/operations/snapshot.js +68 -0
  241. package/dist/shortcuts/reception/operations/types.js +1 -0
  242. package/dist/shortcuts/reception/operations.js +33 -0
  243. package/dist/shortcuts/reception/upload.js +218 -0
  244. package/dist/shortcuts/recruit-stage/context.js +145 -33
  245. package/dist/shortcuts/recruit-stage/continuation.js +2 -1
  246. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +86 -16
  247. package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +6 -4
  248. package/dist/shortcuts/recruit-stage/operations/jd-create.js +289 -48
  249. package/dist/shortcuts/recruit-stage/operations/resume-import.js +207 -25
  250. package/dist/shortcuts/recruit-stage/shared.js +161 -18
  251. package/dist/shortcuts/workflow/continuation.js +2 -1
  252. package/dist/shortcuts/workflow/index.js +4 -0
  253. package/dist/shortcuts/workflow/operations/form.js +32 -8
  254. package/dist/shortcuts/workflow/operations/read.js +8 -3
  255. package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.js +92 -5
  256. package/dist/shortcuts/workflow/operations/todoSmartConvert/priorityExpr.js +509 -0
  257. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoListRows.js +22 -1
  258. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +32 -6
  259. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +57 -11
  260. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +165 -52
  261. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +57 -14
  262. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +44 -18
  263. package/dist/shortcuts/workflow/operations/write.js +1 -1
  264. package/docs/_catalog.md +3 -0
  265. package/docs/agent-invoice.md +1 -1
  266. package/docs/archive-oa.md +1 -1
  267. package/docs/caizhilian.md +1 -1
  268. package/docs/calendar.md +1 -1
  269. package/docs/contract.md +2 -1
  270. package/docs/e10-auth.md +19 -1
  271. package/docs/ehr.md +2 -2
  272. package/docs/esb.md +1 -1
  273. package/docs/im.md +1 -1
  274. package/docs/invoice.md +8 -12
  275. package/docs/okr.md +1 -1
  276. package/docs/reception.md +119 -0
  277. package/docs/todo-smart-convert/data-contract.md +7 -0
  278. package/package.json +1 -1
  279. package/scripts/clean.mjs +43 -2
  280. package/skill-template/business-info.json +18 -2
  281. package/skill-template/domains/caizhilian.md +1 -1
  282. package/skill-template/domains/jinchengda.md +2 -0
  283. package/skill-template/domains/reception-flow.md +18 -0
  284. package/skill-template/domains/yepiaotong.md +4 -7
  285. package/skills/weaver-e10-archive-oa/references/source-manifest.json +14 -14
  286. package/skills/weaver-e10-blog/references/blog-publish.md +1 -1
  287. package/skills/weaver-e10-blog/references/source-manifest.json +7 -7
  288. package/skills/weaver-e10-caizhilian/references/source-manifest.json +21 -21
  289. package/skills/weaver-e10-caizhilian/references/write-protocol.md +2 -2
  290. package/skills/weaver-e10-calendar/references/calendar-write.md +1 -1
  291. package/skills/weaver-e10-cowork/SKILL.md +1 -1
  292. package/skills/weaver-e10-ebuilder-form/SKILL.md +1 -1
  293. package/skills/weaver-e10-ebuilder-form/references/custom-api.md +1 -1
  294. package/skills/weaver-e10-ebuilder-form/references/openapi-write.md +1 -1
  295. package/skills/weaver-e10-esb/SKILL.md +2 -2
  296. package/skills/weaver-e10-esb/references/source-manifest.json +22 -22
  297. package/skills/weaver-e10-esb/references/trigger.md +2 -2
  298. package/skills/weaver-e10-jinchengda/SKILL.md +198 -205
  299. package/skills/weaver-e10-jinchengda/references/contract-action-card.md +759 -0
  300. package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +250 -0
  301. package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +146 -7
  302. package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +178 -0
  303. package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +1 -1
  304. package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +1 -1
  305. package/skills/weaver-e10-jinchengda/references/contract-command-index.md +75 -0
  306. package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +137 -0
  307. package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +163 -0
  308. package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +52 -3
  309. package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +92 -5
  310. package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +602 -0
  311. package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +209 -0
  312. package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +126 -0
  313. package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +312 -0
  314. package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +555 -0
  315. package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +47 -12
  316. package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +469 -0
  317. package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +154 -1
  318. package/skills/weaver-e10-jinchengda/references/contract-request-write.md +1 -1
  319. package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +224 -0
  320. package/skills/weaver-e10-jinchengda/references/orchestration.md +355 -0
  321. package/skills/weaver-e10-jinchengda/references/source-manifest.json +29 -29
  322. package/skills/weaver-e10-jucailin/SKILL.md +1 -1
  323. package/skills/weaver-e10-jucailin/references/attend-write.md +2 -2
  324. package/skills/weaver-e10-jucailin/references/recruit-create.md +15 -4
  325. package/skills/weaver-e10-jucailin/references/recruit-write.md +3 -3
  326. package/skills/weaver-e10-meeting/SKILL.md +64 -14
  327. package/skills/weaver-e10-meeting/references/meeting-change.md +1 -1
  328. package/skills/weaver-e10-meeting/references/meeting-create.md +1 -1
  329. package/skills/weaver-e10-meeting/references/meeting-lifecycle.md +1 -1
  330. package/skills/weaver-e10-meeting/references/meeting-verification.md +1 -1
  331. package/skills/weaver-e10-okr/references/okr-align.md +1 -1
  332. package/skills/weaver-e10-okr/references/okr-keyresult.md +1 -1
  333. package/skills/weaver-e10-okr/references/okr-write.md +1 -1
  334. package/skills/weaver-e10-okr/references/source-manifest.json +8 -8
  335. package/skills/weaver-e10-plan/references/plan-report-write.md +1 -1
  336. package/skills/weaver-e10-plan/references/source-manifest.json +20 -20
  337. package/skills/weaver-e10-qiyecheng/references/loan-management.md +1 -1
  338. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +18 -18
  339. package/skills/weaver-e10-reception-flow/SKILL.md +173 -0
  340. 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
  341. package/skills/weaver-e10-reception-flow/data/fields-snapshot.json +213 -0
  342. package/skills/weaver-e10-reception-flow/references/browsertool.md +68 -0
  343. package/skills/weaver-e10-reception-flow/references/env-pitfalls.md +51 -0
  344. package/skills/weaver-e10-reception-flow/references/fields-snapshot.md +227 -0
  345. package/skills/weaver-e10-reception-flow/references/guide.md +179 -0
  346. package/skills/weaver-e10-reception-flow/scripts/locate.sh +14 -0
  347. package/skills/weaver-e10-reception-flow/scripts/render.py +724 -0
  348. package/skills/weaver-e10-recruit-stage/SKILL.md +19 -10
  349. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +10 -2
  350. package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +1 -1
  351. package/skills/weaver-e10-recruit-stage/lib/xiaoe-session.mjs +66 -0
  352. package/skills/weaver-e10-recruit-stage/references/position-templates.md +204 -0
  353. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +13 -1
  354. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +29 -6
  355. package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +27 -14
  356. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +21 -2
  357. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +9 -1
  358. package/skills/weaver-e10-shijingran/SKILL.md +5 -5
  359. package/skills/weaver-e10-shijingran/references/source-manifest.json +37 -36
  360. package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +2 -0
  361. package/skills/weaver-e10-wenshuding/SKILL.md +17 -7
  362. package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +28 -0
  363. package/skills/weaver-e10-wenshuding/references/archive-flow.md +24 -8
  364. package/skills/weaver-e10-wenshuding/references/archive-prelib-list.md +3 -0
  365. package/skills/weaver-e10-wenshuding/references/archive-prelib-open.md +4 -0
  366. package/skills/weaver-e10-wenshuding/references/archive-search.md +3 -1
  367. package/skills/weaver-e10-wenshuding/references/source-manifest.json +3 -3
  368. package/skills/weaver-e10-workflow/SKILL.md +19 -17
  369. package/skills/weaver-e10-workflow/aigroup/default.json +10 -6
  370. package/skills/weaver-e10-workflow/references/source-manifest.json +32 -32
  371. package/skills/weaver-e10-workflow/references/todo-smart-convert.md +36 -3
  372. package/skills/weaver-e10-workflow/references/workflow-memory.md +1 -1
  373. package/skills/weaver-e10-workflow/references/workflow-query.md +9 -6
  374. package/skills/weaver-e10-workflow/tools/todo-summary.cjs +152 -1
  375. package/skills/weaver-e10-yepiaotong/SKILL.md +19 -26
  376. package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +13 -10
  377. package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +2 -0
  378. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +194 -155
  379. package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +28 -32
  380. package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +5 -1
  381. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +8 -10
  382. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +211 -616
  383. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +149 -117
  384. package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +17 -20
  385. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +20 -39
  386. package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +55 -22
  387. package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +7 -17
  388. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +88 -92
  389. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +144 -354
  390. package/skills/weaver-e10-yimiaoban/SKILL.md +18 -6
  391. package/skills/weaver-e10-yimiaoban/references/msg-write.md +31 -1
  392. package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +1 -1
  393. package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +72 -0
  394. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +11 -11
  395. package/dist/chunks/chunk-TTPJJJC4.js +0 -465
  396. package/dist/chunks/registry-BKBZPBAJ.js +0 -23
  397. package/dist/shortcuts/invoice/markdown.js +0 -172
  398. package/dist/shortcuts/invoice/operations/issuing-qys.js +0 -424
  399. package/skills/weaver-e10-meeting.zip +0 -0
  400. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +0 -131
  401. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-form-fill-rules.md +0 -179
@@ -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
- };
@@ -1,172 +0,0 @@
1
- import { invoiceValidationError } from './errors.js';
2
- export const OUTPUT_FORMATS = ['json', 'markdown'];
3
- /** 支持 markdown 渲染的 operation 及其固定视图(渲染档自带字段口径)。 */
4
- const MARKDOWN_VIEWS = {
5
- 'invoice.list': 'summary',
6
- 'invoice.enterprise.list': 'summary',
7
- 'invoice.get': 'detail',
8
- };
9
- export const MARKDOWN_OPERATIONS = new Set(Object.keys(MARKDOWN_VIEWS));
10
- export function normalizeFormat(value) {
11
- if (value === undefined || value === null || value === '')
12
- return undefined;
13
- const format = String(value).trim();
14
- if (!OUTPUT_FORMATS.includes(format)) {
15
- throw invoiceValidationError('format_invalid', `--format 只支持 ${OUTPUT_FORMATS.join(' / ')}`);
16
- }
17
- return format;
18
- }
19
- /** 该 operation 在 markdown 档下使用的语义视图。 */
20
- export function markdownViewFor(operation) {
21
- const view = MARKDOWN_VIEWS[operation];
22
- if (!view) {
23
- throw invoiceValidationError('format_unsupported', `${operation} 不支持 --format markdown(仅 ${[...MARKDOWN_OPERATIONS].join('、')})`);
24
- }
25
- return view;
26
- }
27
- export function assertMarkdownSupported(operation, format) {
28
- if (format === 'markdown')
29
- markdownViewFor(operation);
30
- }
31
- function text(value) {
32
- if (value === undefined || value === null)
33
- return '';
34
- return String(value).replace(/^\uFEFF/u, '').trim();
35
- }
36
- /** markdown 表格里不能出现裸 `|` 和换行,否则列会错位。 */
37
- function cell(value, fallback = '—') {
38
- const raw = text(value);
39
- if (!raw)
40
- return fallback;
41
- return raw.replace(/\|/gu, '\\|').replace(/\r?\n/gu, ' ');
42
- }
43
- /** 金额统一带千分位与两位小数;非数值原样返回,缺值给 `—`。 */
44
- function money(value) {
45
- const raw = text(value);
46
- if (!raw)
47
- return '—';
48
- const num = Number(raw);
49
- if (!Number.isFinite(num))
50
- return raw;
51
- const [int, frac = ''] = Math.abs(num).toFixed(2).split('.');
52
- return `${num < 0 ? '-' : ''}¥${int.replace(/\B(?=(\d{3})+(?!\d))/gu, ',')}.${frac}`;
53
- }
54
- function shortType(value) {
55
- const raw = text(value);
56
- if (!raw)
57
- return '—';
58
- if (raw.includes('专用'))
59
- return '专票';
60
- if (raw.includes('普通'))
61
- return '普票';
62
- return raw;
63
- }
64
- function scopeLabel(scope) {
65
- if (scope === 'enterprise')
66
- return '企业票夹';
67
- if (scope === 'personal')
68
- return '个人票夹';
69
- return '票夹';
70
- }
71
- function reimCell(item) {
72
- const requests = Array.isArray(item.reimRequests) ? item.reimRequests.filter(Boolean) : [];
73
- if (!requests.length)
74
- return '未挂单';
75
- return `已挂单→${requests.map((name) => text(name)).join('、')}`;
76
- }
77
- function linkCell(record) {
78
- const number = text(record.number);
79
- const url = text(record.detailUrl);
80
- if (!number)
81
- return '—';
82
- return url ? `[${number}](${url})` : number;
83
- }
84
- function renderList(operation, data) {
85
- const items = Array.isArray(data.items) ? data.items : [];
86
- const lines = [];
87
- const scope = operation === 'invoice.enterprise.list' ? 'enterprise' : data.scope;
88
- const head = [`**${scopeLabel(scope)} · 共 ${text(data.total) || items.length} 张 · 合计 ${money(data.totalAmount)}**`];
89
- const pageNote = `本页 ${items.length} 条${data.hasMore ? ',还有更多' : ''}`;
90
- lines.push(`${head[0]}(${pageNote})`);
91
- if (data.totalAmountExcludingTax !== undefined) {
92
- lines.push(`不含税合计 ${money(data.totalAmountExcludingTax)}`);
93
- }
94
- lines.push('');
95
- lines.push('| # | 发票号码 | 开票日期 | 票种 | 价税合计 | 购方 | 销方 | 报销 |');
96
- lines.push('| --- | --- | --- | --- | --- | --- | --- | --- |');
97
- if (!items.length) {
98
- lines.push('| — | — | — | — | — | — | — | — |');
99
- return lines.join('\n');
100
- }
101
- items.forEach((item, index) => {
102
- const record = item && typeof item === 'object' ? item : {};
103
- lines.push([
104
- '',
105
- index + 1,
106
- linkCell(record),
107
- cell(record.date),
108
- shortType(record.typeName),
109
- money(record.total),
110
- cell(record.buyer),
111
- cell(record.payer),
112
- cell(reimCell(record), '未挂单'),
113
- '',
114
- ].join(' | ').trim());
115
- });
116
- return lines.join('\n');
117
- }
118
- function renderDetail(data) {
119
- const items = Array.isArray(data.items) ? data.items : [];
120
- if (!items.length)
121
- return '未查到发票详情。';
122
- return items.map((item) => {
123
- const record = item && typeof item === 'object' ? item : {};
124
- const numberCell = linkCell(record);
125
- const title = numberCell === '—' ? (text(record.fid) || '发票') : numberCell;
126
- const lines = [];
127
- // 号码本身即详情页入口(title 已带链接),不再单列一行 [打开详情]。
128
- lines.push(`**${title}** · ${cell(record.typeName, '未知票种')}`);
129
- lines.push('');
130
- lines.push('| 项目 | 值 |');
131
- lines.push('| --- | --- |');
132
- const rows = [
133
- // 发票号码/代码放在首两行:票面标识必须出现在「项目」列里,便于核对与复制;
134
- // 号码带 detailUrl 超链接,点击直达 E10 发票详情页。
135
- // 数电票(全电发票)没有发票代码,空值按 — 显示,不要伪造。
136
- ['发票号码', numberCell],
137
- ['发票代码', cell(record.code)],
138
- ['开票日期', cell(record.date)],
139
- ['不含税金额', money(record.amount)],
140
- ['税额', money(record.taxAmount)],
141
- ['价税合计', money(record.total)],
142
- ['销方', cell(record.payer)],
143
- ['购方', cell(record.buyer)],
144
- ['费用说明', cell(record.expenseNote)],
145
- ['开票人', cell(record.issuer)],
146
- ['查验标记', checkStateText(record.checkState)],
147
- ['报销', reimCell(record)],
148
- ['附件', attachmentText(record.attachments)],
149
- ];
150
- for (const [label, value] of rows)
151
- lines.push(`| ${label} | ${value} |`);
152
- return lines.join('\n');
153
- }).join('\n\n---\n\n');
154
- }
155
- /** `checkState` 是查验标记(0=未做过查验登记),措辞必须与票面 valid 区分开。 */
156
- function checkStateText(value) {
157
- if (value === undefined || value === null)
158
- return '—';
159
- return Number(value) === 0 ? '未查验(0)' : `已查验(${text(value)})`;
160
- }
161
- function attachmentText(attachments) {
162
- const list = Array.isArray(attachments) ? attachments : [];
163
- if (!list.length)
164
- return '无';
165
- return `${list.length} 个:${list.map((entry) => text(entry?.name) || text(entry?.id) || '未命名').join('、')}`;
166
- }
167
- /** 渲染入口:按 operation 选择模板。data 必须是投影后的语义视图。 */
168
- export function renderInvoiceMarkdown(operation, data) {
169
- const view = markdownViewFor(operation);
170
- const body = view === 'detail' ? renderDetail(data) : renderList(operation, data);
171
- return `${body}\n`;
172
- }