weaver-work-cli 0.1.40 → 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 (401) hide show
  1. package/README.md +17 -0
  2. package/dist/chunks/{archive-JHTONRST.js → archive-P6TBQGKL.js} +13 -5
  3. package/dist/chunks/{archive-oa-FCHLCPHC.js → archive-oa-7TQ2NXOH.js} +12 -5
  4. package/dist/chunks/{asset-RLIHC7DB.js → asset-3ELRG37G.js} +11 -4
  5. package/dist/chunks/{asset-idle-KVOFTLCP.js → asset-idle-WIGMUFMD.js} +7 -3
  6. package/dist/chunks/{attachment-content-RZYDB3MB.js → attachment-content-E3276UOV.js} +5 -4
  7. package/dist/chunks/{blog-42OZTJNP.js → blog-C5NMZAAC.js} +11 -4
  8. package/dist/chunks/{caizhilian-KRK547K5.js → caizhilian-5XSM2DFP.js} +13 -6
  9. package/dist/chunks/{calendar-RTWAMKHD.js → calendar-FI2WNSBO.js} +71 -26
  10. package/dist/chunks/{chunk-CXRQWOZ5.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-LN447PY2.js → chunk-BCVYBYYT.js} +432 -2247
  16. package/dist/chunks/{chunk-7E6MUOEK.js → chunk-CWYGFU5B.js} +2 -2
  17. package/dist/chunks/{chunk-NOODWMCL.js → chunk-D4ADSZ7H.js} +1 -1
  18. package/dist/chunks/{chunk-WFFNM65B.js → chunk-ETNJSKMM.js} +281 -29
  19. package/dist/chunks/{chunk-CAQNBBQA.js → chunk-F4E4EM35.js} +3 -3
  20. package/dist/chunks/{chunk-4CTESSKI.js → chunk-FAZTGX7S.js} +6 -6
  21. package/dist/chunks/chunk-FRZKBMSW.js +2562 -0
  22. package/dist/chunks/{chunk-BYBSCN4X.js → chunk-G7PQWD4L.js} +6 -3
  23. package/dist/chunks/{chunk-NJKREDA3.js → chunk-GAMZLAG2.js} +1 -1
  24. package/dist/chunks/{chunk-FLS4DPGP.js → chunk-GM6J7Q4B.js} +28 -15
  25. package/dist/chunks/{chunk-NETCCARD.js → chunk-GRDRG6HP.js} +3 -3
  26. package/dist/chunks/chunk-HIT4Y6OI.js +1238 -0
  27. package/dist/chunks/{chunk-EZALDOQH.js → chunk-HP7JIYMT.js} +5 -2
  28. package/dist/chunks/{chunk-IZSSVYAG.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-57IECMWX.js → chunk-N4M2DDFE.js} +29 -15
  32. package/dist/chunks/{chunk-JWRZM2H2.js → chunk-OF4S23UB.js} +4 -4
  33. package/dist/chunks/{chunk-VNBU55SL.js → chunk-PC7VKEB5.js} +80 -2458
  34. package/dist/chunks/{chunk-G2JSIUWF.js → chunk-PUQS5MWL.js} +91 -2
  35. package/dist/chunks/{chunk-E7OK5WD5.js → chunk-Q4OYAQYH.js} +5 -5
  36. package/dist/chunks/{chunk-7BRU4EFH.js → chunk-QVSWRLLU.js} +35 -6
  37. package/dist/chunks/{chunk-T6EGVBKU.js → chunk-TA7FXXJD.js} +6 -3
  38. package/dist/chunks/{chunk-GPMFD4RD.js → chunk-TXUG266F.js} +1 -1
  39. package/dist/chunks/{chunk-4TEDNCON.js → chunk-UFIT2UU3.js} +354 -56
  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-7U577Q7U.js → chunk-WSF4NNMR.js} +3 -3
  44. package/dist/chunks/chunk-XHK4MDR5.js +2497 -0
  45. package/dist/chunks/{chunk-LFMSDBZN.js → chunk-XNIK66I4.js} +326 -161
  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-I566ZYNF.js → chunk-Z7VYWPZV.js} +1 -1
  49. package/dist/chunks/{conflict-VR55AOOO.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-HI4FNPYE.js → contract-DNIIW5VJ.js} +13 -5
  55. package/dist/chunks/{cowork-HJLI353D.js → cowork-GMLRGVIW.js} +31 -14
  56. package/dist/chunks/create-flow-J22BO65E.js +56 -0
  57. package/dist/chunks/{ebuilder-form-HTGI63UU.js → ebuilder-form-ANV2FHYV.js} +12 -7
  58. package/dist/chunks/{ehr-GYXIYH3A.js → ehr-GSTGAIY3.js} +695 -1255
  59. package/dist/chunks/{employee-SAK2QYXX.js → employee-22BGJ3QS.js} +3 -3
  60. package/dist/chunks/{env-DW3G4HUO.js → env-BX3VRFS7.js} +4 -3
  61. package/dist/chunks/{esb-I5INCEFE.js → esb-ATAIASX2.js} +12 -7
  62. package/dist/chunks/{factory-TKXGXS6L.js → factory-PETTFME6.js} +3 -2
  63. package/dist/chunks/{fna-K2MHTQ24.js → fna-YEKBSFSX.js} +14 -8
  64. package/dist/chunks/{group-chat-VYBNMJLG.js → group-chat-BFVXAYFX.js} +7 -4
  65. package/dist/chunks/{host-D5SERMAJ.js → host-HRBXEPDQ.js} +5 -5
  66. package/dist/chunks/{host-JM4YVHFM.js → host-LR55CTHP.js} +5 -5
  67. package/dist/chunks/{host-L3VLITMT.js → host-SUOY6VYQ.js} +5 -5
  68. package/dist/chunks/{host-ZUQTJYYK.js → host-SZGV4UNT.js} +5 -5
  69. package/dist/chunks/{host-256GVCAH.js → host-WIKN2EJ5.js} +5 -5
  70. package/dist/chunks/{hrm-VLRBKTZB.js → hrm-NRDO4W5G.js} +11 -7
  71. package/dist/chunks/{im-QK3VTLXK.js → im-IQ2HN23S.js} +11 -10
  72. package/dist/chunks/{invoice-T5JTA32H.js → invoice-MNRW76PP.js} +636 -1768
  73. package/dist/chunks/{jiuchuanhui-P2FNEQVZ.js → jiuchuanhui-DTRBAX4N.js} +14 -6
  74. package/dist/chunks/{lazy-dispatch-XRRI46M6.js → lazy-dispatch-ZVWAI25B.js} +7 -6
  75. package/dist/chunks/{mail-3Y7MJ6PS.js → mail-ZVAUXOJA.js} +16 -14
  76. package/dist/chunks/{meeting-M7LTXGJE.js → meeting-FEVPZ67S.js} +21 -13
  77. package/dist/chunks/{okr-OBC6S67L.js → okr-SDH3E5RA.js} +12 -5
  78. package/dist/chunks/{operations-5QL3AECO.js → operations-62N6EP3C.js} +4 -3
  79. package/dist/chunks/{plan-5H6I53SK.js → plan-E35JFDI7.js} +12 -5
  80. package/dist/chunks/{project-L75QZV4S.js → project-73QXBAB2.js} +49 -25
  81. package/dist/chunks/reception-UWZVACBN.js +1899 -0
  82. package/dist/chunks/recruit-stage-4MAOCKFY.js +4770 -0
  83. package/dist/chunks/registry-IM5G23LS.js +24 -0
  84. package/dist/chunks/{registry-UGRBCBHO.js → registry-JDUS4E7D.js} +7 -6
  85. package/dist/chunks/{registry-RXPN6BBT.js → registry-KNKSCJNT.js} +7 -6
  86. package/dist/chunks/{registry-NYPYMZXG.js → registry-PO7SI256.js} +4 -4
  87. package/dist/chunks/{registry-QGHFNUWS.js → registry-PVUZQDDQ.js} +3 -3
  88. package/dist/chunks/{room-recommend-A3UDC3CA.js → room-recommend-H7KLXA5R.js} +6 -5
  89. package/dist/chunks/{schedule-5GCACCK7.js → schedule-ESZIBAUO.js} +6 -5
  90. package/dist/chunks/{workflow-M5ZJ7DWF.js → workflow-CWJFJLQU.js} +15 -10
  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 +41 -30
  98. package/dist/internal/e10/auth/commands.js +164 -8
  99. package/dist/internal/e10/auth/error-log.js +182 -0
  100. package/dist/internal/e10/auth/messages.js +6 -0
  101. package/dist/internal/e10/auth/session.js +34 -3
  102. package/dist/internal/e10/auth/xiaoe.js +286 -44
  103. package/dist/internal/e10/auth-recovery.js +72 -14
  104. package/dist/internal/e10/context.js +72 -13
  105. package/dist/internal/e10/index.js +1 -1
  106. package/dist/internal/e10/network-error.js +93 -0
  107. package/dist/internal/e10/request-runtime.js +6 -0
  108. package/dist/internal/skills/install.js +9 -1
  109. package/dist/shortcuts/archive/continuation.js +2 -1
  110. package/dist/shortcuts/archive/index.js +3 -0
  111. package/dist/shortcuts/archive/operations/confirm.js +2 -1
  112. package/dist/shortcuts/archive-oa/continuation.js +2 -1
  113. package/dist/shortcuts/archive-oa/index.js +2 -0
  114. package/dist/shortcuts/archive-oa/operations/confirm.js +2 -1
  115. package/dist/shortcuts/asset/continuation.js +2 -1
  116. package/dist/shortcuts/asset/index.js +2 -0
  117. package/dist/shortcuts/asset-idle/index.js +2 -0
  118. package/dist/shortcuts/blog/continuation.js +2 -1
  119. package/dist/shortcuts/blog/index.js +2 -0
  120. package/dist/shortcuts/caizhilian/continuation.js +2 -1
  121. package/dist/shortcuts/caizhilian/index.js +2 -0
  122. package/dist/shortcuts/caizhilian/operations/confirm.js +3 -2
  123. package/dist/shortcuts/calendar/continuation.js +2 -1
  124. package/dist/shortcuts/calendar/index.js +2 -0
  125. package/dist/shortcuts/calendar/operations/read.js +31 -22
  126. package/dist/shortcuts/calendar/operations/write.js +46 -2
  127. package/dist/shortcuts/contract/continuation.js +2 -1
  128. package/dist/shortcuts/contract/index.js +2 -0
  129. package/dist/shortcuts/contract/operations/write.js +2 -1
  130. package/dist/shortcuts/cowork/continuation.js +2 -1
  131. package/dist/shortcuts/cowork/index.js +2 -0
  132. package/dist/shortcuts/cowork/operations/discuss-write.js +5 -1
  133. package/dist/shortcuts/cowork/operations/item-write.js +1 -7
  134. package/dist/shortcuts/cowork/operations/member-write.js +3 -1
  135. package/dist/shortcuts/cowork/operations/permission-write.js +5 -1
  136. package/dist/shortcuts/cowork/operations/shared.js +7 -0
  137. package/dist/shortcuts/ebuilder-form/continuation.js +2 -1
  138. package/dist/shortcuts/ebuilder-form/index.js +2 -0
  139. package/dist/shortcuts/ebuilder-form/operations/write.js +3 -2
  140. package/dist/shortcuts/ehr/continuation.js +2 -1
  141. package/dist/shortcuts/ehr/index.js +2 -0
  142. package/dist/shortcuts/ehr/operations/attend-write.js +44 -2
  143. package/dist/shortcuts/ehr/operations/hr-contact.js +7 -4
  144. package/dist/shortcuts/ehr/operations/hr-report.js +13 -7
  145. package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +317 -63
  146. package/dist/shortcuts/ehr/operations/recruit-position.js +134 -2
  147. package/dist/shortcuts/ehr/operations/recruit-write.js +263 -18
  148. package/dist/shortcuts/ehr/operations/recruit.js +10 -4
  149. package/dist/shortcuts/ehr/operations/shared.js +47 -0
  150. package/dist/shortcuts/esb/continuation.js +2 -1
  151. package/dist/shortcuts/esb/index.js +2 -0
  152. package/dist/shortcuts/esb/operations/trigger.js +2 -1
  153. package/dist/shortcuts/fna/continuation.js +2 -1
  154. package/dist/shortcuts/fna/index.js +2 -0
  155. package/dist/shortcuts/fna/operations/invoice-writeoff.js +1 -1
  156. package/dist/shortcuts/fna/operations/loan.js +1 -1
  157. package/dist/shortcuts/hrm/index.js +2 -0
  158. package/dist/shortcuts/hrm/operations/org.js +118 -0
  159. package/dist/shortcuts/im/continuation.js +2 -1
  160. package/dist/shortcuts/index.js +10 -0
  161. package/dist/shortcuts/invoice/continuation.js +2 -1
  162. package/dist/shortcuts/invoice/index.js +14 -15
  163. package/dist/shortcuts/invoice/invoice-record.js +93 -0
  164. package/dist/shortcuts/invoice/manifest.js +190 -393
  165. package/dist/shortcuts/invoice/operations/add.js +2 -1
  166. package/dist/shortcuts/invoice/operations/delete.js +2 -1
  167. package/dist/shortcuts/invoice/operations/import.js +2 -1
  168. package/dist/shortcuts/invoice/operations/issuing-contract-detail.js +86 -0
  169. package/dist/shortcuts/invoice/operations/issuing-contracts.js +210 -0
  170. package/dist/shortcuts/invoice/operations/registry.js +17 -17
  171. package/dist/shortcuts/invoice/operations/reim-auto.js +4 -569
  172. package/dist/shortcuts/invoice/operations/reim.js +52 -341
  173. package/dist/shortcuts/invoice/operations/shared.js +21 -4
  174. package/dist/shortcuts/invoice/operations/update.js +2 -1
  175. package/dist/shortcuts/invoice/projection.js +10 -62
  176. package/dist/shortcuts/jiuchuanhui/continuation.js +2 -1
  177. package/dist/shortcuts/jiuchuanhui/index.js +2 -0
  178. package/dist/shortcuts/jiuchuanhui/operations/datajson.js +2 -1
  179. package/dist/shortcuts/jiuchuanhui/operations/esb.js +2 -1
  180. package/dist/shortcuts/mail/continuation.js +2 -1
  181. package/dist/shortcuts/mail/index.js +2 -0
  182. package/dist/shortcuts/mail/operations/mail-blacklist.js +1 -1
  183. package/dist/shortcuts/mail/operations/mail-contacts.js +1 -1
  184. package/dist/shortcuts/mail/operations/mail-send.js +1 -1
  185. package/dist/shortcuts/mail/operations/mail-sign.js +1 -1
  186. package/dist/shortcuts/mail/operations/mail-template.js +1 -1
  187. package/dist/shortcuts/meeting/continuation.js +2 -1
  188. package/dist/shortcuts/meeting/index.js +2 -0
  189. package/dist/shortcuts/meeting/operations/change.js +1 -1
  190. package/dist/shortcuts/meeting/operations/create.js +1 -1
  191. package/dist/shortcuts/meeting/operations/eb/catalog.js +4 -1
  192. package/dist/shortcuts/meeting/operations/eb/create-flow.js +101 -35
  193. package/dist/shortcuts/meeting/operations/eb/decision.js +1 -1
  194. package/dist/shortcuts/meeting/operations/eb/factory.js +34 -1
  195. package/dist/shortcuts/meeting/operations/eb/group-chat.js +25 -3
  196. package/dist/shortcuts/meeting/operations/eb/person-cache.js +96 -0
  197. package/dist/shortcuts/meeting/operations/eb/room-recommend.js +33 -11
  198. package/dist/shortcuts/meeting/operations/lifecycle.js +1 -1
  199. package/dist/shortcuts/meeting/operations/receipts.js +1 -1
  200. package/dist/shortcuts/meeting/operations/signs.js +1 -1
  201. package/dist/shortcuts/okr/continuation.js +2 -1
  202. package/dist/shortcuts/okr/index.js +2 -0
  203. package/dist/shortcuts/okr/operations/write.js +1 -1
  204. package/dist/shortcuts/plan/continuation.js +2 -1
  205. package/dist/shortcuts/plan/index.js +2 -0
  206. package/dist/shortcuts/plan/operations/write.js +1 -1
  207. package/dist/shortcuts/project/continuation.js +2 -1
  208. package/dist/shortcuts/project/index.js +2 -0
  209. package/dist/shortcuts/project/operations/read.js +6 -25
  210. package/dist/shortcuts/project/operations/shared.js +22 -0
  211. package/dist/shortcuts/project/operations/write.js +28 -2
  212. package/dist/shortcuts/reception/constants.js +53 -0
  213. package/dist/shortcuts/reception/errors.js +54 -0
  214. package/dist/shortcuts/reception/host.js +125 -0
  215. package/dist/shortcuts/reception/index.js +198 -0
  216. package/dist/shortcuts/reception/manifest.js +177 -0
  217. package/dist/shortcuts/reception/operations/ask.js +71 -0
  218. package/dist/shortcuts/reception/operations/browsertool.js +58 -0
  219. package/dist/shortcuts/reception/operations/compose.js +129 -0
  220. package/dist/shortcuts/reception/operations/customparams.js +74 -0
  221. package/dist/shortcuts/reception/operations/doc.js +238 -0
  222. package/dist/shortcuts/reception/operations/docrender.js +36 -0
  223. package/dist/shortcuts/reception/operations/panels.js +179 -0
  224. package/dist/shortcuts/reception/operations/registry.js +26 -0
  225. package/dist/shortcuts/reception/operations/render-assets.js +184 -0
  226. package/dist/shortcuts/reception/operations/render.js +123 -0
  227. package/dist/shortcuts/reception/operations/runs.js +38 -0
  228. package/dist/shortcuts/reception/operations/schedule.js +127 -0
  229. package/dist/shortcuts/reception/operations/shared.js +196 -0
  230. package/dist/shortcuts/reception/operations/snapshot.js +68 -0
  231. package/dist/shortcuts/reception/operations/types.js +1 -0
  232. package/dist/shortcuts/reception/operations.js +33 -0
  233. package/dist/shortcuts/reception/upload.js +218 -0
  234. package/dist/shortcuts/recruit-stage/context.js +231 -0
  235. package/dist/shortcuts/recruit-stage/continuation.js +74 -0
  236. package/dist/shortcuts/recruit-stage/errors.js +65 -0
  237. package/dist/shortcuts/recruit-stage/host.js +109 -0
  238. package/dist/shortcuts/recruit-stage/index.js +115 -0
  239. package/dist/shortcuts/recruit-stage/manifest.js +29 -0
  240. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +722 -0
  241. package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +269 -0
  242. package/dist/shortcuts/recruit-stage/operations/jd-create.js +719 -0
  243. package/dist/shortcuts/recruit-stage/operations/list.js +431 -0
  244. package/dist/shortcuts/recruit-stage/operations/registry.js +38 -0
  245. package/dist/shortcuts/recruit-stage/operations/resume-import.js +1354 -0
  246. package/dist/shortcuts/recruit-stage/operations/search.js +158 -0
  247. package/dist/shortcuts/recruit-stage/operations/types.js +25 -0
  248. package/dist/shortcuts/recruit-stage/school-tiers.json +318 -0
  249. package/dist/shortcuts/recruit-stage/shared.js +608 -0
  250. package/dist/shortcuts/workflow/continuation.js +2 -1
  251. package/dist/shortcuts/workflow/index.js +2 -0
  252. package/dist/shortcuts/workflow/operations/form.js +32 -8
  253. package/dist/shortcuts/workflow/operations/todoSmartConvert/detailFieldRules.js +4 -2
  254. package/dist/shortcuts/workflow/operations/todoSmartConvert/summaryCache.js +13 -6
  255. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoDetailCache.js +17 -24
  256. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoDetailFetcher.js +14 -9
  257. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +50 -8
  258. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +2 -1
  259. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.detail.js +17 -11
  260. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +7 -39
  261. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.groupSummary.js +3 -2
  262. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +51 -15
  263. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.pipeline.js +16 -1
  264. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +151 -63
  265. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.subGroup.js +56 -0
  266. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.summary.js +39 -14
  267. package/dist/shortcuts/workflow/operations/write.js +1 -1
  268. package/docs/_catalog.md +3 -0
  269. package/docs/agent-invoice.md +1 -1
  270. package/docs/archive-oa.md +1 -1
  271. package/docs/caizhilian.md +1 -1
  272. package/docs/calendar.md +1 -1
  273. package/docs/contract.md +1 -1
  274. package/docs/e10-auth.md +23 -1
  275. package/docs/ehr.md +2 -2
  276. package/docs/esb.md +1 -1
  277. package/docs/im.md +1 -1
  278. package/docs/invoice.md +8 -12
  279. package/docs/okr.md +1 -1
  280. package/docs/operation-manual.md +8 -0
  281. package/docs/reception.md +119 -0
  282. package/package.json +1 -1
  283. package/scripts/clean.mjs +43 -2
  284. package/scripts/install-skill-to-xiaoe.mjs +105 -0
  285. package/scripts/package-skill.mjs +4 -2
  286. package/skill-template/business-info.json +42 -2
  287. package/skill-template/domains/caizhilian.md +1 -1
  288. package/skill-template/domains/reception-flow.md +18 -0
  289. package/skill-template/domains/recruit-stage.md +29 -0
  290. package/skill-template/domains/yepiaotong.md +4 -7
  291. package/skills/weaver-e10-archive-oa/references/source-manifest.json +14 -14
  292. package/skills/weaver-e10-blog/references/blog-publish.md +1 -1
  293. package/skills/weaver-e10-blog/references/source-manifest.json +7 -7
  294. package/skills/weaver-e10-caizhilian/references/source-manifest.json +21 -21
  295. package/skills/weaver-e10-caizhilian/references/write-protocol.md +2 -2
  296. package/skills/weaver-e10-calendar/SKILL.md +2 -1
  297. package/skills/weaver-e10-calendar/references/calendar-write.md +55 -1
  298. package/skills/weaver-e10-cowork/SKILL.md +1 -1
  299. package/skills/weaver-e10-cowork/references/cowork-write.md +3 -1
  300. package/skills/weaver-e10-ebuilder-form/SKILL.md +1 -1
  301. package/skills/weaver-e10-ebuilder-form/references/custom-api.md +1 -1
  302. package/skills/weaver-e10-ebuilder-form/references/openapi-write.md +1 -1
  303. package/skills/weaver-e10-esb/SKILL.md +2 -2
  304. package/skills/weaver-e10-esb/references/source-manifest.json +22 -22
  305. package/skills/weaver-e10-esb/references/trigger.md +2 -2
  306. package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +1 -1
  307. package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +1 -1
  308. package/skills/weaver-e10-jinchengda/references/contract-request-write.md +1 -1
  309. package/skills/weaver-e10-jinchengda/references/source-manifest.json +29 -29
  310. package/skills/weaver-e10-jucailin/SKILL.md +1 -1
  311. package/skills/weaver-e10-jucailin/references/attend-write.md +10 -2
  312. package/skills/weaver-e10-jucailin/references/hr-contact.md +8 -0
  313. package/skills/weaver-e10-jucailin/references/hr-report.md +8 -0
  314. package/skills/weaver-e10-jucailin/references/recruit-create.md +14 -5
  315. package/skills/weaver-e10-jucailin/references/recruit-read.md +1 -1
  316. package/skills/weaver-e10-jucailin/references/recruit-write.md +5 -4
  317. package/skills/weaver-e10-mail/SKILL.md +1 -1
  318. package/skills/weaver-e10-meeting/SKILL.md +39 -7
  319. package/skills/weaver-e10-meeting/references/meeting-change.md +1 -1
  320. package/skills/weaver-e10-meeting/references/meeting-create.md +1 -1
  321. package/skills/weaver-e10-meeting/references/meeting-lifecycle.md +1 -1
  322. package/skills/weaver-e10-meeting/references/meeting-verification.md +1 -1
  323. package/skills/weaver-e10-okr/references/okr-align.md +1 -1
  324. package/skills/weaver-e10-okr/references/okr-keyresult.md +1 -1
  325. package/skills/weaver-e10-okr/references/okr-write.md +1 -1
  326. package/skills/weaver-e10-okr/references/source-manifest.json +8 -8
  327. package/skills/weaver-e10-plan/references/plan-report-write.md +1 -1
  328. package/skills/weaver-e10-plan/references/source-manifest.json +20 -20
  329. package/skills/weaver-e10-qiyecheng/references/loan-management.md +1 -1
  330. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +18 -18
  331. package/skills/weaver-e10-reception-flow/SKILL.md +173 -0
  332. 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
  333. package/skills/weaver-e10-reception-flow/data/fields-snapshot.json +213 -0
  334. package/skills/weaver-e10-reception-flow/references/browsertool.md +68 -0
  335. package/skills/weaver-e10-reception-flow/references/env-pitfalls.md +51 -0
  336. package/skills/weaver-e10-reception-flow/references/fields-snapshot.md +227 -0
  337. package/skills/weaver-e10-reception-flow/references/guide.md +179 -0
  338. package/skills/weaver-e10-reception-flow/scripts/locate.sh +14 -0
  339. package/skills/weaver-e10-reception-flow/scripts/render.py +724 -0
  340. package/skills/weaver-e10-recruit-stage/SKILL.md +230 -0
  341. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +119 -0
  342. package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +188 -0
  343. package/skills/weaver-e10-recruit-stage/lib/xiaoe-session.mjs +66 -0
  344. package/skills/weaver-e10-recruit-stage/references/position-templates.md +202 -0
  345. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +322 -0
  346. package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +127 -0
  347. package/skills/weaver-e10-recruit-stage/references/recruit-check-install.md +65 -0
  348. package/skills/weaver-e10-recruit-stage/references/recruit-detail-process.md +63 -0
  349. package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +142 -0
  350. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +95 -0
  351. package/skills/weaver-e10-recruit-stage/references/recruit-jd-template.md +56 -0
  352. package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +101 -0
  353. package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +148 -0
  354. package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +77 -0
  355. package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +59 -0
  356. package/skills/weaver-e10-recruit-stage/references/recruit-resolve-creator.md +69 -0
  357. package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +241 -0
  358. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +451 -0
  359. package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +128 -0
  360. package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +146 -0
  361. package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +69 -0
  362. package/skills/weaver-e10-shared/SKILL.md +1 -1
  363. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +10 -2
  364. package/skills/weaver-e10-shijingran/SKILL.md +7 -6
  365. package/skills/weaver-e10-shijingran/references/operations.md +3 -1
  366. package/skills/weaver-e10-shijingran/references/source-manifest.json +30 -28
  367. package/skills/weaver-e10-shijingran/references/write-operations.md +2 -0
  368. package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +2 -0
  369. package/skills/weaver-e10-wenshuding/references/source-manifest.json +3 -3
  370. package/skills/weaver-e10-workflow/SKILL.md +4 -2
  371. package/skills/weaver-e10-workflow/aigroup/default.json +11 -9
  372. package/skills/weaver-e10-workflow/references/source-manifest.json +32 -32
  373. package/skills/weaver-e10-workflow/references/todo-smart-convert.md +23 -13
  374. package/skills/weaver-e10-workflow/tools/todo-summary.cjs +62 -20
  375. package/skills/weaver-e10-yepiaotong/SKILL.md +28 -36
  376. package/skills/weaver-e10-yepiaotong/references/invoice-agent-entry.md +6 -3
  377. package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +13 -10
  378. package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +2 -0
  379. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +194 -155
  380. package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +28 -32
  381. package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +5 -1
  382. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +8 -10
  383. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +211 -616
  384. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +149 -117
  385. package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +17 -20
  386. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +20 -39
  387. package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +55 -22
  388. package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +7 -17
  389. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +88 -92
  390. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +144 -354
  391. package/skills/weaver-e10-yimiaoban/SKILL.md +1 -1
  392. package/skills/weaver-e10-yimiaoban/references/msg-write.md +1 -1
  393. package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +1 -1
  394. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +7 -7
  395. package/dist/chunks/chunk-SPRHHSVC.js +0 -465
  396. package/dist/chunks/registry-KMHCPAAD.js +0 -22
  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,14 +1,56 @@
1
1
  import { CliError, ExitCode } from '../../core/errors.js';
2
- import { E10_AUTH_REQUIRED_MESSAGE, E10_XIAOE_RECOVERY_FAILED_MESSAGE } from './auth/messages.js';
3
- import { E10AuthSession } from './auth/session.js';
2
+ import { E10_AUTH_REQUIRED_MESSAGE, E10_XIAOE_HOST_CREDENTIAL_MISSING_MESSAGE, E10_XIAOE_NETWORK_UNAVAILABLE_MESSAGE, E10_XIAOE_RECOVERY_FAILED_MESSAGE, } from './auth/messages.js';
3
+ import { lastXiaoEFailure, summarizeXiaoEFailureKind, } from './auth/xiaoe.js';
4
+ import { appendXiaoEAuthErrorLog, xiaoEAuthLogSecrets } from './auth/error-log.js';
5
+ import { E10AuthSession, getActiveProfile } from './auth/session.js';
4
6
  import { E10ApiClient } from './client.js';
5
- import { canAutomaticallyRecoverXiaoE, recoverXiaoEAuthSession } from './auth-recovery.js';
6
- function xiaoERecoveryFailedError() {
7
- return Object.assign(new CliError(E10_XIAOE_RECOVERY_FAILED_MESSAGE, ExitCode.AuthError), {
7
+ import { canAutomaticallyRecoverXiaoE, recoverXiaoEAuthSession, recoverXiaoEAuthSessionWithDiagnostics, } from './auth-recovery.js';
8
+ /**
9
+ * 把一次失败的静默恢复转成可定位的结构化错误。文案按归因分流:只有网络层
10
+ * 完全没打通时才提示「稍后重试」(此时登录态根本没被验证过,让人去重新登录
11
+ * 是误导);其余情况沿用原文案。诊断放进 `details`:`attemptedSteps` 说明
12
+ * 评估过哪些凭证通道及各自结果,`failures` 保留每一次失败的阶段、类别和
13
+ * `error.cause.code`,`lastError` 是最后一条真实原因(已脱敏截断),
14
+ * `resultSessionExpired` 表示票其实换到了、但被判为已过期。
15
+ */
16
+ function xiaoERecoveryFailedError(diagnostics, resultSessionExpired = false) {
17
+ const failureKind = summarizeXiaoEFailureKind(diagnostics);
18
+ const lastFailure = lastXiaoEFailure(diagnostics);
19
+ const networkUnavailable = failureKind === 'network';
20
+ // Web sandboxes only have the platform credential channel. If the runtime
21
+ // marker survived but the host credential pair did not, asking the user to
22
+ // log in again is misleading: the sandbox launcher dropped the injection.
23
+ const hostCredentialMissing = diagnostics?.clientType === 'cloud'
24
+ && diagnostics.platformCredentialDetected === false
25
+ && diagnostics.attemptedSteps.includes('platform_token:missing')
26
+ && diagnostics.attemptedSteps.includes('environment_map:empty');
27
+ const details = diagnostics
28
+ ? {
29
+ ...(diagnostics.baseUrl ? { baseUrl: diagnostics.baseUrl } : {}),
30
+ ...(diagnostics.clientType ? { clientType: diagnostics.clientType } : {}),
31
+ ...(diagnostics.platformCredentialDetected === undefined
32
+ ? {}
33
+ : { platformCredentialDetected: diagnostics.platformCredentialDetected }),
34
+ attemptedSteps: diagnostics.attemptedSteps,
35
+ ...(diagnostics.lastError ? { lastError: diagnostics.lastError } : {}),
36
+ ...(failureKind ? { errorKind: failureKind } : {}),
37
+ ...(lastFailure ? { failureStage: lastFailure.stage } : {}),
38
+ ...(diagnostics.failures?.length ? { failures: diagnostics.failures } : {}),
39
+ ...(hostCredentialMissing ? { reason: 'host_credential_not_injected' } : {}),
40
+ ...(resultSessionExpired ? { resultSessionExpired: true } : {}),
41
+ }
42
+ : undefined;
43
+ return Object.assign(new CliError(networkUnavailable
44
+ ? E10_XIAOE_NETWORK_UNAVAILABLE_MESSAGE
45
+ : hostCredentialMissing
46
+ ? E10_XIAOE_HOST_CREDENTIAL_MISSING_MESSAGE
47
+ : E10_XIAOE_RECOVERY_FAILED_MESSAGE, ExitCode.AuthError), {
8
48
  type: 'authentication',
9
- subtype: 'xiaoe_credential_unavailable',
10
- retryable: false,
11
- stage: 'xiaoe_unified_login',
49
+ subtype: networkUnavailable ? 'xiaoe_network_unavailable' : 'xiaoe_credential_unavailable',
50
+ // 网络错误是可重试的;凭证缺失/被拒重试也一样失败,不能让调用方空转。
51
+ retryable: networkUnavailable,
52
+ stage: lastFailure?.stage || 'xiaoe_unified_login',
53
+ ...(details ? { details } : {}),
12
54
  });
13
55
  }
14
56
  export async function getE10Session(ctx, load = {}) {
@@ -16,18 +58,35 @@ export async function getE10Session(ctx, load = {}) {
16
58
  return E10AuthSession.fromOptions(options, ctx.cwd, load);
17
59
  }
18
60
  export async function requireE10Session(ctx, load = {}) {
61
+ const options = ctx.getGlobalOptions();
19
62
  let session = await getE10Session(ctx, load);
20
63
  if (session?.isExpired() && canAutomaticallyRecoverXiaoE(ctx, session)) {
21
- session = await recoverXiaoEAuthSession(ctx, session).catch(() => null);
22
- if (!session || session.isExpired())
23
- throw xiaoERecoveryFailedError();
64
+ const outcome = await recoverXiaoEAuthSessionWithDiagnostics(ctx, session).catch(() => null);
65
+ session = outcome?.session || null;
66
+ if (!session || session.isExpired()) {
67
+ const resultSessionExpired = session?.isExpired() === true;
68
+ const error = xiaoERecoveryFailedError(outcome?.diagnostics, resultSessionExpired);
69
+ if (resultSessionExpired) {
70
+ await appendXiaoEAuthErrorLog({
71
+ source: 'recovery',
72
+ profile: options.profile || getActiveProfile(),
73
+ baseUrl: session?.getBaseUrl(),
74
+ diagnostics: outcome?.diagnostics,
75
+ resultSessionExpired: true,
76
+ error,
77
+ secrets: xiaoEAuthLogSecrets(ctx.env),
78
+ }).catch(() => undefined);
79
+ }
80
+ throw error;
81
+ }
24
82
  }
25
83
  if (!session && canAutomaticallyRecoverXiaoE(ctx)) {
26
84
  // Read-only probes use getE10Session; only a command requiring a session
27
85
  // may establish one from the current XiaoE host's credentials.
28
- session = await recoverXiaoEAuthSession(ctx).catch(() => null);
86
+ const outcome = await recoverXiaoEAuthSessionWithDiagnostics(ctx).catch(() => null);
87
+ session = outcome?.session || null;
29
88
  if (!session) {
30
- throw xiaoERecoveryFailedError();
89
+ throw xiaoERecoveryFailedError(outcome?.diagnostics);
31
90
  }
32
91
  }
33
92
  if (!session) {
@@ -1,4 +1,4 @@
1
1
  export { E10ApiClient } from './client.js';
2
2
  export { getE10Client, getE10Session, requireE10Client, requireE10Session } from './context.js';
3
3
  export { E10ApiError, E10RequestRuntime, createE10RequestRuntime } from './request-runtime.js';
4
- export { canAutomaticallyRecoverXiaoE, isE10AuthenticationRequired, recoverXiaoEAuthSession, } from './auth-recovery.js';
4
+ export { canAutomaticallyRecoverXiaoE, isE10AuthenticationRequired, recoverXiaoEAuthSession, recoverXiaoEAuthSessionWithDiagnostics, } from './auth-recovery.js';
@@ -0,0 +1,93 @@
1
+ /**
2
+ * 网络错误的统一识别。
3
+ *
4
+ * Node/undici 的 `fetch` 只抛 `TypeError: fetch failed`,真实原因(拒绝连接、
5
+ * DNS 失败、TLS 失败、连接/响应超时)放在 `error.cause.code` 上。丢掉这条 code,
6
+ * 「连不上 E10」就会被误报成「登录态不可用」,把用户引导去重新登录。
7
+ */
8
+ /** 明确属于「网络层没打通」的系统错误码(Node 常见 errno + undici 内部码)。 */
9
+ const NETWORK_ERROR_CODES = new Set([
10
+ 'ECONNREFUSED',
11
+ 'ECONNRESET',
12
+ 'ECONNABORTED',
13
+ 'EHOSTUNREACH',
14
+ 'EHOSTDOWN',
15
+ 'ENETUNREACH',
16
+ 'ENETDOWN',
17
+ 'ENETRESET',
18
+ 'ENOTFOUND',
19
+ 'EAI_AGAIN',
20
+ 'EPIPE',
21
+ 'ETIMEDOUT',
22
+ 'ESOCKETTIMEDOUT',
23
+ 'ERR_SOCKET_CONNECTION_TIMEOUT',
24
+ 'UND_ERR_CONNECT_TIMEOUT',
25
+ 'UND_ERR_HEADERS_TIMEOUT',
26
+ 'UND_ERR_BODY_TIMEOUT',
27
+ 'UND_ERR_SOCKET',
28
+ 'UND_ERR_CLOSED',
29
+ 'UND_ERR_ABORTED',
30
+ 'CERT_HAS_EXPIRED',
31
+ 'DEPTH_ZERO_SELF_SIGNED_CERT',
32
+ 'SELF_SIGNED_CERT_IN_CHAIN',
33
+ 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
34
+ 'ERR_TLS_CERT_ALTNAME_INVALID',
35
+ 'ERR_SSL_WRONG_VERSION_NUMBER',
36
+ ]);
37
+ /** `AbortController.abort()` 抛出的 DOMException 没有 errno,统一用这个码表示「超时」。 */
38
+ export const ABORT_ERROR_CODE = 'ABORT_ERR';
39
+ function asRecord(value) {
40
+ return value && typeof value === 'object' ? value : null;
41
+ }
42
+ /**
43
+ * 取错误链上最内层的系统错误码(`error.cause.code`);`AbortError` 归一化成
44
+ * `ABORT_ERR`。用 `seen` 防环:Node 的 cause 链偶尔会指回上层。
45
+ */
46
+ export function readErrorCauseCode(error, maxDepth = 5) {
47
+ let current = error;
48
+ const seen = new Set();
49
+ for (let depth = 0; depth < maxDepth; depth += 1) {
50
+ if (current === undefined || current === null || seen.has(current))
51
+ return undefined;
52
+ seen.add(current);
53
+ if (current instanceof Error && current.name === 'AbortError')
54
+ return ABORT_ERROR_CODE;
55
+ const record = asRecord(current);
56
+ if (!record)
57
+ return undefined;
58
+ if (record.name === 'AbortError')
59
+ return ABORT_ERROR_CODE;
60
+ const code = record.code;
61
+ if (typeof code === 'string' && code)
62
+ return code;
63
+ const errno = record.errno;
64
+ if (typeof errno === 'string' && errno)
65
+ return errno;
66
+ if (typeof errno === 'number')
67
+ return String(errno);
68
+ current = record.cause;
69
+ }
70
+ return undefined;
71
+ }
72
+ export function isAbortError(error) {
73
+ if (error instanceof Error && error.name === 'AbortError')
74
+ return true;
75
+ return asRecord(error)?.name === 'AbortError';
76
+ }
77
+ export function isNetworkErrorCode(code) {
78
+ return typeof code === 'string' && NETWORK_ERROR_CODES.has(code.toUpperCase());
79
+ }
80
+ /** undici 把底层原因藏起来时只剩这句话,但语义已经很明确了。 */
81
+ const TRANSPORT_MESSAGE_PATTERN = /fetch failed|socket hang up|other side closed|network|connection (?:refused|reset|closed)|timed? ?out|timeout|certificate|getaddrinfo|dns lookup/i;
82
+ export function looksLikeTransportMessage(message) {
83
+ return TRANSPORT_MESSAGE_PATTERN.test(message);
84
+ }
85
+ /**
86
+ * 给一次 fetch(含读响应体)套上超时。调用方必须在 `finally` 里 `clear()`,
87
+ * 否则进程会被这一个定时器拖住。
88
+ */
89
+ export function createTimeoutSignal(timeoutMs) {
90
+ const controller = new AbortController();
91
+ const timer = setTimeout(() => controller.abort(), timeoutMs);
92
+ return { signal: controller.signal, clear: () => clearTimeout(timer) };
93
+ }
@@ -1,6 +1,7 @@
1
1
  import { CliError, ExitCode } from '../../core/errors.js';
2
2
  import { classifyE10Redirect, isE10AuthenticationRequired, recoverXiaoEAuthSession, sameE10SessionIdentity, } from './auth-recovery.js';
3
3
  import { startFetchTiming } from './fetch-timing.js';
4
+ import { readErrorCauseCode } from './network-error.js';
4
5
  import { E10_XIAOE_RECOVERY_FAILED_MESSAGE } from './auth/messages.js';
5
6
  const DEFAULT_TIMEOUT_MS = 30_000;
6
7
  const DEFAULT_BIG_INT_STRINGS = true;
@@ -314,12 +315,17 @@ export class E10RequestRuntime {
314
315
  throw new E10ApiError('network', 'timeout', `请求超时(${timeoutMs}ms)`, {
315
316
  retryable: false,
316
317
  exitCode: ExitCode.NetworkError,
318
+ details: { timeoutMs },
317
319
  });
318
320
  }
319
321
  const message = error instanceof Error ? error.message : String(error);
322
+ // Node 的 `fetch failed` 不带原因,真正的 errno(ECONNREFUSED/ENOTFOUND…)
323
+ // 在 `error.cause.code` 上:保留下来才能区分「断网」与「服务端报错」。
324
+ const causeCode = readErrorCauseCode(error);
320
325
  throw new E10ApiError('network', 'transport', `请求失败:${message}`, {
321
326
  retryable: true,
322
327
  exitCode: ExitCode.NetworkError,
328
+ ...(causeCode ? { details: { causeCode } } : {}),
323
329
  });
324
330
  }
325
331
  finally {
@@ -272,6 +272,14 @@ function writeProductMetadata(target, productContent) {
272
272
  return;
273
273
  writeFileSync(resolve(target, 'product.json'), productContent, 'utf8');
274
274
  }
275
+ /**
276
+ * 拷贝白名单:整目录复制,只剔除本地依赖与系统垃圾。
277
+ *
278
+ * 历史实现把 `scripts/` 与 `assets/` 一并排除,导致带资产的技能装出来是残缺的——
279
+ * reception 缺 `scripts/render.py` 与 `assets/行程单模板-泛微.docx` 会直接跑不出 docx,
280
+ * builder 缺 `assets/dom-structure/` 也少一半能力。
281
+ * 技能包是受控的内部产物,资产就应当随包分发,因此只保留 node_modules 这一条硬排除。
282
+ */
275
283
  function shouldCopy(entry, sourceRoot, skipSkillProduct) {
276
284
  const relativePath = relative(sourceRoot, entry);
277
285
  const name = basename(entry);
@@ -282,7 +290,7 @@ function shouldCopy(entry, sourceRoot, skipSkillProduct) {
282
290
  if (name === '.DS_Store' || name.startsWith('.'))
283
291
  return false;
284
292
  const parts = relativePath.split(sep);
285
- return !parts.includes('node_modules') && !parts.includes('scripts') && !parts.includes('assets');
293
+ return !parts.includes('node_modules');
286
294
  }
287
295
  function countFiles(root) {
288
296
  let count = 0;
@@ -1,3 +1,4 @@
1
+ import { CONTINUATION_TTL_MS } from '../../core/continuation-ttl.js';
1
2
  import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
2
3
  import { existsSync } from 'node:fs';
3
4
  import { chmod, mkdir, readFile, writeFile } from 'node:fs/promises';
@@ -35,7 +36,7 @@ function signature(payload, key) {
35
36
  }
36
37
  export function createArchiveContinuationSigner(ctx) {
37
38
  return {
38
- async issue(payload, ttlMs = 10 * 60_000) {
39
+ async issue(payload, ttlMs = CONTINUATION_TTL_MS) {
39
40
  const issuedAt = Date.now();
40
41
  const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
41
42
  const sig = signature(body, await loadKey(ctx));
@@ -1,6 +1,7 @@
1
1
  import { readFile, writeFile } from 'node:fs/promises';
2
2
  import { resolve } from 'node:path';
3
3
  import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
4
+ import { reportPlatformError } from '../../core/error-codes.js';
4
5
  import { formatSearchCard, formatSearchHtml, formatSearchText } from './render/search-format.js';
5
6
  import { createArchiveContinuationSigner } from './continuation.js';
6
7
  import { createArchiveHost } from './host.js';
@@ -99,6 +100,7 @@ async function executeAndPrint(ctx, operation, input) {
99
100
  ctx.output.write(successEnvelope(result), { json: true });
100
101
  }
101
102
  catch (error) {
103
+ reportPlatformError(error);
102
104
  console.error(JSON.stringify(failureEnvelope(error), null, 2));
103
105
  process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
104
106
  }
@@ -140,6 +142,7 @@ async function executeSearchPrint(ctx, input, format, outputPath) {
140
142
  ctx.output.raw(formatSearchText(rows, meta));
141
143
  }
142
144
  catch (error) {
145
+ reportPlatformError(error);
143
146
  console.error(JSON.stringify(failureEnvelope(error), null, 2));
144
147
  process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
145
148
  }
@@ -1,3 +1,4 @@
1
+ import { CONTINUATION_TTL_MS } from '../../../core/continuation-ttl.js';
1
2
  import { archiveConfirmationError, archiveValidationError } from '../errors.js';
2
3
  /** apply 类写操作必须显式确认。 */
3
4
  export function requireConfirm(args, action) {
@@ -11,7 +12,7 @@ export function requireConfirm(args, action) {
11
12
  * prepare 阶段签发 continuation。
12
13
  * 环境指纹(baseUrl + 登录账号)写进票据,apply 时校验,避免跨环境/跨账号复用。
13
14
  */
14
- export async function issueLease(env, action, payload, ttlMs = 10 * 60_000) {
15
+ export async function issueLease(env, action, payload, ttlMs = CONTINUATION_TTL_MS) {
15
16
  const session = await env.host.getSession();
16
17
  const continuation = await env.continuation.issue({
17
18
  operation: action,
@@ -1,3 +1,4 @@
1
+ import { CONTINUATION_TTL_MS } from '../../core/continuation-ttl.js';
1
2
  import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
2
3
  import { existsSync } from 'node:fs';
3
4
  import { chmod, mkdir, readFile, writeFile } from 'node:fs/promises';
@@ -35,7 +36,7 @@ function signature(payload, key) {
35
36
  }
36
37
  export function createArchiveOaContinuationSigner(ctx) {
37
38
  return {
38
- async issue(payload, ttlMs = 10 * 60_000) {
39
+ async issue(payload, ttlMs = CONTINUATION_TTL_MS) {
39
40
  const issuedAt = Date.now();
40
41
  const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
41
42
  const sig = signature(body, await loadKey(ctx));
@@ -1,5 +1,6 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
3
+ import { reportPlatformError } from '../../core/error-codes.js';
3
4
  import { createArchiveOaContinuationSigner } from './continuation.js';
4
5
  import { createArchiveOaHost } from './host.js';
5
6
  import { archiveOaManifest } from './manifest.js';
@@ -116,6 +117,7 @@ async function executeAndPrint(ctx, operation, input) {
116
117
  ctx.output.write(successEnvelope(result), { json: true });
117
118
  }
118
119
  catch (error) {
120
+ reportPlatformError(error);
119
121
  console.error(JSON.stringify(failureEnvelope(error), null, 2));
120
122
  process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
121
123
  }
@@ -1,3 +1,4 @@
1
+ import { CONTINUATION_TTL_MS } from '../../../core/continuation-ttl.js';
1
2
  import { archiveOaConfirmationError, archiveOaValidationError } from '../errors.js';
2
3
  /** apply 类写操作必须显式确认。 */
3
4
  export function requireConfirm(args, action) {
@@ -11,7 +12,7 @@ export function requireConfirm(args, action) {
11
12
  * prepare 阶段签发 continuation。
12
13
  * 环境指纹(baseUrl + 登录账号)写进票据,apply 时校验,避免跨环境/跨账号复用。
13
14
  */
14
- export async function issueLease(env, action, payload, ttlMs = 10 * 60_000) {
15
+ export async function issueLease(env, action, payload, ttlMs = CONTINUATION_TTL_MS) {
15
16
  const session = await env.host.getSession();
16
17
  const continuation = await env.continuation.issue({
17
18
  operation: action,
@@ -1,3 +1,4 @@
1
+ import { CONTINUATION_TTL_MS } from '../../core/continuation-ttl.js';
1
2
  import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
2
3
  import { existsSync } from 'node:fs';
3
4
  import { chmod, mkdir, readFile, writeFile } from 'node:fs/promises';
@@ -35,7 +36,7 @@ function signature(payload, key) {
35
36
  }
36
37
  export function createZiguanjiaContinuationSigner(ctx) {
37
38
  return {
38
- async issue(payload, ttlMs = 10 * 60_000) {
39
+ async issue(payload, ttlMs = CONTINUATION_TTL_MS) {
39
40
  const issuedAt = Date.now();
40
41
  const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
41
42
  const sig = signature(body, await loadKey(ctx));
@@ -1,5 +1,6 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
3
+ import { reportPlatformError } from '../../core/error-codes.js';
3
4
  import { createZiguanjiaContinuationSigner } from './continuation.js';
4
5
  import { createZiguanjiaHost } from './host.js';
5
6
  import { ziguanjiaManifest } from './manifest.js';
@@ -85,6 +86,7 @@ async function executeAndPrint(ctx, operation, input) {
85
86
  ctx.output.write(successEnvelope(operation, result), { json: true });
86
87
  }
87
88
  catch (error) {
89
+ reportPlatformError(error);
88
90
  console.error(JSON.stringify(failureEnvelope(error), null, 2));
89
91
  process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
90
92
  }
@@ -1,5 +1,6 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
3
+ import { reportPlatformError } from '../../core/error-codes.js';
3
4
  import { createAssetIdleHost } from './host.js';
4
5
  import { assetIdleManifest } from './manifest.js';
5
6
  import { executeAssetIdleOperation } from './operations.js';
@@ -83,6 +84,7 @@ async function executeAndPrint(ctx, operation, input) {
83
84
  ctx.output.write(successEnvelope(operation, result), { json: true });
84
85
  }
85
86
  catch (error) {
87
+ reportPlatformError(error);
86
88
  console.error(JSON.stringify(failureEnvelope(error), null, 2));
87
89
  process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
88
90
  }
@@ -1,3 +1,4 @@
1
+ import { CONTINUATION_TTL_MS } from '../../core/continuation-ttl.js';
1
2
  import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
2
3
  import { existsSync } from 'node:fs';
3
4
  import { chmod, mkdir, readFile, writeFile } from 'node:fs/promises';
@@ -39,7 +40,7 @@ function signature(payload, key) {
39
40
  */
40
41
  export function createBlogContinuationSigner(ctx) {
41
42
  return {
42
- async issue(payload, ttlMs = 10 * 60_000) {
43
+ async issue(payload, ttlMs = CONTINUATION_TTL_MS) {
43
44
  const issuedAt = Date.now();
44
45
  const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
45
46
  const sig = signature(body, await loadKey(ctx));
@@ -1,5 +1,6 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
3
+ import { reportPlatformError } from '../../core/error-codes.js';
3
4
  import { createBlogContinuationSigner } from './continuation.js';
4
5
  import { blogValidationError } from './errors.js';
5
6
  import { createBlogHost } from './host.js';
@@ -101,6 +102,7 @@ async function executeAndPrint(ctx, operation, input) {
101
102
  ctx.output.write(successEnvelope(operation, result), { json: true });
102
103
  }
103
104
  catch (error) {
105
+ reportPlatformError(error);
104
106
  console.error(JSON.stringify(failureEnvelope(error), null, 2));
105
107
  process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
106
108
  }
@@ -1,3 +1,4 @@
1
+ import { CONTINUATION_TTL_MS } from '../../core/continuation-ttl.js';
1
2
  import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
2
3
  import { existsSync } from 'node:fs';
3
4
  import { chmod, mkdir, readFile, writeFile } from 'node:fs/promises';
@@ -35,7 +36,7 @@ function signature(payload, key) {
35
36
  }
36
37
  export function createCaizhilianContinuationSigner(ctx) {
37
38
  return {
38
- async issue(payload, ttlMs = 10 * 60_000) {
39
+ async issue(payload, ttlMs = CONTINUATION_TTL_MS) {
39
40
  const issuedAt = Date.now();
40
41
  const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
41
42
  const sig = signature(body, await loadKey(ctx));
@@ -1,5 +1,6 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
3
+ import { reportPlatformError } from '../../core/error-codes.js';
3
4
  import { createCaizhilianContinuationSigner } from './continuation.js';
4
5
  import { caizhilianValidationError } from './errors.js';
5
6
  import { createCaizhilianHost } from './host.js';
@@ -88,6 +89,7 @@ async function executeAndPrint(ctx, operation, input) {
88
89
  ctx.output.write(successEnvelope(operation, result), { json: true });
89
90
  }
90
91
  catch (error) {
92
+ reportPlatformError(error);
91
93
  console.error(JSON.stringify(failureEnvelope(error), null, 2));
92
94
  process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
93
95
  }
@@ -1,3 +1,4 @@
1
+ import { CONTINUATION_TTL_MS } from '../../../core/continuation-ttl.js';
1
2
  import { caizhilianConfirmationError, caizhilianValidationError } from '../errors.js';
2
3
  import { fingerprint } from './shared.js';
3
4
  /** apply 类写操作必须显式确认。 */
@@ -12,7 +13,7 @@ export function requireConfirm(args, action) {
12
13
  * prepare 阶段签发 continuation。
13
14
  * 环境指纹(baseUrl + 登录账号)写进票据,apply 时校验,避免跨环境/跨账号复用。
14
15
  */
15
- export async function issueLease(env, action, payload, ttlMs = 10 * 60_000) {
16
+ export async function issueLease(env, action, payload, ttlMs = CONTINUATION_TTL_MS) {
16
17
  const session = await env.host.getSession();
17
18
  const continuation = await env.continuation.issue({
18
19
  operation: action,
@@ -61,7 +62,7 @@ export function leaseArgsFingerprint(args) {
61
62
  return fingerprint(picked);
62
63
  }
63
64
  /** prepare 签发票据:自动附带入参指纹(apply 时由 assertLeaseArgs 校验)。 */
64
- export async function issueWriteLease(env, action, args, payload, ttlMs = 10 * 60_000) {
65
+ export async function issueWriteLease(env, action, args, payload, ttlMs = CONTINUATION_TTL_MS) {
65
66
  return issueLease(env, action, { ...payload, argsFingerprint: leaseArgsFingerprint(args) }, ttlMs);
66
67
  }
67
68
  /** apply 校验整体入参与 prepare 时一致(比 assertLeaseTarget 更严格的全量防漂移)。 */
@@ -1,3 +1,4 @@
1
+ import { CONTINUATION_TTL_MS } from '../../core/continuation-ttl.js';
1
2
  import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
2
3
  import { existsSync } from 'node:fs';
3
4
  import { chmod, mkdir, readFile, writeFile } from 'node:fs/promises';
@@ -35,7 +36,7 @@ function signature(payload, key) {
35
36
  }
36
37
  export function createCalendarContinuationSigner(ctx) {
37
38
  return {
38
- async issue(payload, ttlMs = 10 * 60_000) {
39
+ async issue(payload, ttlMs = CONTINUATION_TTL_MS) {
39
40
  const issuedAt = Date.now();
40
41
  const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
41
42
  const sig = signature(body, await loadKey(ctx));
@@ -1,5 +1,6 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
3
+ import { reportPlatformError } from '../../core/error-codes.js';
3
4
  import { createCalendarContinuationSigner } from './continuation.js';
4
5
  import { createCalendarHost } from './host.js';
5
6
  import { calendarManifest } from './manifest.js';
@@ -83,6 +84,7 @@ async function executeAndPrint(ctx, operation, input) {
83
84
  ctx.output.write(successEnvelope(operation, result), { json: true });
84
85
  }
85
86
  catch (error) {
87
+ reportPlatformError(error);
86
88
  console.error(JSON.stringify(failureEnvelope(error), null, 2));
87
89
  process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
88
90
  }
@@ -184,6 +184,36 @@ function firstId(value) {
184
184
  return String(value);
185
185
  return undefined;
186
186
  }
187
+ /**
188
+ * 取「日程」应用 appId 与日程表单 formId(用于详情卡片页链接)。
189
+ * 偶发空返回时 getObjsByTag 原样重试最多 3 次。任一获取失败返回 null。
190
+ * 创建日程后需用 formId 拼卡片页链接,故抽为可复用函数。
191
+ */
192
+ export async function fetchAgendaAppAndForm(host) {
193
+ const appIdsResponse = await host.request({
194
+ method: 'GET',
195
+ path: '/api/bs/ebuilder/app/tags/getAppIds',
196
+ operation: 'calendar.app.check',
197
+ query: { tag: AGENDA_APP_TAG },
198
+ }).catch(() => undefined);
199
+ const appId = firstId(appIdsResponse?.data);
200
+ let formId;
201
+ if (appId) {
202
+ for (let attempt = 0; attempt < 3 && !formId; attempt++) {
203
+ const formResponse = await host.request({
204
+ method: 'GET',
205
+ path: '/api/ebuilder/form/obj/getObjsByTag',
206
+ operation: 'calendar.app.check',
207
+ query: { tag: AGENDA_FORM_TAG, appId },
208
+ }).catch(() => undefined);
209
+ formId = firstId(formResponse?.data);
210
+ if (!formId && attempt < 2) {
211
+ await new Promise((resolve) => setTimeout(resolve, 800));
212
+ }
213
+ }
214
+ }
215
+ return { appId: appId ?? null, formId: formId ?? null };
216
+ }
187
217
  const calendarAppCheck = {
188
218
  name: 'calendar.app.check',
189
219
  resource: 'calendar',
@@ -194,14 +224,7 @@ const calendarAppCheck = {
194
224
  risk: 'read',
195
225
  inputSchema: schemaOf({}),
196
226
  handler: async (_args, { host }) => {
197
- // 1. getAppIds 取当前环境 appId
198
- const appIdsResponse = await host.request({
199
- method: 'GET',
200
- path: '/api/bs/ebuilder/app/tags/getAppIds',
201
- operation: 'calendar.app.check',
202
- query: { tag: AGENDA_APP_TAG },
203
- }).catch(() => undefined);
204
- const appId = firstId(appIdsResponse?.data);
227
+ const { appId, formId } = await fetchAgendaAppAndForm(host);
205
228
  if (!appId) {
206
229
  return calendarSuccess('calendar.app.check', {
207
230
  installed: false,
@@ -217,20 +240,6 @@ const calendarAppCheck = {
217
240
  query: { appId },
218
241
  }).catch(() => undefined);
219
242
  const commitVersion = versionResponse?.data?.commitVersion ?? versionResponse?.commitVersion;
220
- // 3. 查询日程表单 ID(偶发空返回,参数原样重试最多 3 次)
221
- let formId;
222
- for (let attempt = 0; attempt < 3 && !formId; attempt++) {
223
- const formResponse = await host.request({
224
- method: 'GET',
225
- path: '/api/ebuilder/form/obj/getObjsByTag',
226
- operation: 'calendar.app.check',
227
- query: { tag: AGENDA_FORM_TAG, appId },
228
- }).catch(() => undefined);
229
- formId = firstId(formResponse?.data);
230
- if (!formId && attempt < 2) {
231
- await new Promise((resolve) => setTimeout(resolve, 800));
232
- }
233
- }
234
243
  const hasVersion = typeof commitVersion === 'string' && commitVersion.trim() !== '';
235
244
  const installed = hasVersion && commitVersion !== null && commitVersion !== undefined;
236
245
  const versionOk = installed && compareVersion(commitVersion, MIN_APP_VERSION) >= 0;