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
@@ -4,7 +4,7 @@ import {
4
4
  cacheScopeSuffix,
5
5
  readCache,
6
6
  writeCache
7
- } from "./chunk-GHXCDPTM.js";
7
+ } from "./chunk-DGMYACGJ.js";
8
8
  import {
9
9
  EB_BASE,
10
10
  SCHEMA_DATETIME_MINUTE,
@@ -13,7 +13,7 @@ import {
13
13
  meetingSuccess,
14
14
  queryBody,
15
15
  schemaOf
16
- } from "./chunk-72CKAUAG.js";
16
+ } from "./chunk-JWWTI63L.js";
17
17
 
18
18
  // src/shortcuts/meeting/operations/eb/usage-cache.ts
19
19
  var USAGE_TTL_MS = 5 * 60 * 1e3;
@@ -88,14 +88,30 @@ async function clearCache(env, key) {
88
88
  try {
89
89
  const { rm } = await import("node:fs/promises");
90
90
  const { join } = await import("node:path");
91
- const { meetingStateDir } = await import("./env-LB7NBL2O.js");
91
+ const { meetingStateDir } = await import("./env-3MBHAWBL.js");
92
92
  await rm(join(meetingStateDir(env.ctx), "cache", `${key}.json`), { force: true });
93
93
  } catch {
94
94
  }
95
95
  }
96
96
 
97
97
  // src/shortcuts/meeting/operations/eb/room-recommend.ts
98
- var ROOMS_TTL_MS = 24 * 60 * 60 * 1e3;
98
+ function inferRoomFloor(name, desc = "") {
99
+ const cnDigits = { \u4E00: 1, \u4E8C: 2, \u4E09: 3, \u56DB: 4, \u4E94: 5, \u516D: 6, \u4E03: 7, \u516B: 8, \u4E5D: 9, \u5341: 10 };
100
+ const fromText = (text) => {
101
+ const cn = text.match(/([一二三四五六七八九十])\s*(?:楼|层)/u);
102
+ if (cn) return cnDigits[cn[1]] ?? null;
103
+ const en = text.match(/(\d{1,2})\s*(?:F|f|楼|层)(?!\d)/u);
104
+ if (en) return Number(en[1]);
105
+ return null;
106
+ };
107
+ const byText = fromText(name) ?? fromText(desc);
108
+ if (byText) return byText;
109
+ const lead = name.match(/^\s*(\d{3,4})/u);
110
+ if (!lead) return null;
111
+ const digits = lead[1];
112
+ return digits.length === 4 ? Number(digits.slice(0, 2)) : Number(digits[0]);
113
+ }
114
+ var ROOMS_TTL_MS = 7 * 24 * 60 * 60 * 1e3;
99
115
  var STALE_NOTICE_MS = 4 * 60 * 60 * 1e3;
100
116
  var FREQUENT_TTL_MS = 7 * 24 * 60 * 60 * 1e3;
101
117
  var FREQUENT_WINDOW_DAYS = 180;
@@ -151,11 +167,12 @@ function normalizeRoom(row) {
151
167
  // ⛔ 2026-11-04 真机发现:以前没映射 room_desc,`roomDesc` 永远是 undefined,
152
168
  // 于是「带客户优先接待类」里**按描述文案判定**那一半从来没生效过(只有名称含「接待」的能命中)。
153
169
  // 例:广州会议室四 的描述「用来接待重要来宾…」明明写着,却被当普通房间。
154
- roomDesc: toText(main.room_desc).trim()
170
+ roomDesc: toText(main.room_desc).trim(),
171
+ floor: inferRoomFloor(toText(main.room_name).trim(), toText(main.room_desc).trim())
155
172
  };
156
173
  }
157
174
  async function loadRooms(env, options = {}) {
158
- const key = `rooms-v3-${await cacheScopeSuffix(env)}`;
175
+ const key = `rooms-v4-${await cacheScopeSuffix(env)}`;
159
176
  const warnings = [];
160
177
  if (!options.refresh) {
161
178
  const cached = await readCache(env, key, { ttlMs: ROOMS_TTL_MS });
@@ -204,7 +221,7 @@ async function loadFrequentRooms(env, options = {}) {
204
221
  const counts = /* @__PURE__ */ new Map();
205
222
  let requests = 0;
206
223
  try {
207
- const { getMeetingOperation } = await import("./registry-BKBZPBAJ.js");
224
+ const { getMeetingOperation } = await import("./registry-XPWPGHYE.js");
208
225
  const listOp = getMeetingOperation("meeting.eb.meeting.list");
209
226
  let seen = 0;
210
227
  let total = 0;
@@ -294,7 +311,15 @@ async function recommendRooms(env, input) {
294
311
  }
295
312
  if (requirement.roomAttr && room.roomAttr !== requirement.roomAttr) continue;
296
313
  if (requirement.mrType && room.mrType !== requirement.mrType) continue;
297
- if (requirement.placeKeyword && !room.place.includes(requirement.placeKeyword)) continue;
314
+ if (input.floor !== void 0 && input.floor !== null && room.floor !== input.floor) continue;
315
+ if (requirement.placeKeyword) {
316
+ const floorHint = inferRoomFloor(String(requirement.placeKeyword));
317
+ if (floorHint !== null && /楼|层|F/iu.test(String(requirement.placeKeyword))) {
318
+ if (room.floor !== floorHint) continue;
319
+ } else if (!room.place.includes(requirement.placeKeyword)) {
320
+ continue;
321
+ }
322
+ }
298
323
  if (requirement.nameKeyword && !room.name.includes(requirement.nameKeyword)) continue;
299
324
  if (requirement.equipmentsKeyword && !room.equipments.includes(requirement.equipmentsKeyword)) continue;
300
325
  const reasons = [];
@@ -347,6 +372,7 @@ async function recommendRooms(env, input) {
347
372
  place: room.place,
348
373
  equipments: room.equipments,
349
374
  roomAttrText: room.roomAttrText,
375
+ ...room.floor !== null && room.floor !== void 0 ? { floor: room.floor } : {},
350
376
  ...String(room.roomDesc ?? "").trim() !== "" ? { roomDesc: String(room.roomDesc).trim() } : {},
351
377
  frequentCount: freq?.count ?? 0,
352
378
  score,
@@ -421,7 +447,8 @@ var ebRoomRecommendOperation = {
421
447
  mrType: { type: "string", description: "\u4F1A\u8BAE\u5BA4\u7C7B\u578B id\uFF08mr_type\uFF09" },
422
448
  roomAttr: { type: "string", enum: ["0", "1", "2"], description: "\u4F1A\u8BAE\u5BA4\u5C5E\u6027\uFF1A0 \u5B9E\u4F53 / 1 \u865A\u62DF / 2 \u7EC4\u5408" },
423
449
  equipmentsKeyword: { type: "string", description: "\u8BBE\u5907\u5173\u952E\u8BCD\uFF08\u6A21\u7CCA\u5339\u914D equipments\uFF0C\u5982 \u6295\u5F71/\u89C6\u9891\uFF09" },
424
- hasCustomer: { type: "boolean", description: "\u672C\u6B21\u4F1A\u8BAE\u662F\u5426\u5E26\u5BA2\u6237\uFF1Atrue \u65F6\u4F18\u5148\u63A8\u8350\u63A5\u5F85\u7C7B\u4F1A\u8BAE\u5BA4\uFF08\u63CF\u8FF0/\u540D\u79F0\u542B \u63A5\u5F85/\u62DB\u5F85/\u5BA2\u6237/\u5546\u52A1/\u8D35\u5BBE \u7684\u52A0\u5206\uFF09" },
450
+ hasCustomer: { type: "boolean", description: "\u672C\u6B21\u4F1A\u8BAE\u662F\u5426\u5E26\u5BA2\u6237\uFF1Atrue \u65F6\u4F18\u5148\u63A8\u8350\u63A5\u5F85\u7C7B\u4F1A\u8BAE\u5BA4\uFF08\u540D\u79F0\u6216\u63CF\u8FF0\u542B \u63A5\u5F85/\u62DB\u5F85/\u8D35\u5BBE/\u5546\u52A1 \u7684\u52A0 35 \u5206\uFF09" },
451
+ floor: { type: "number", description: "\u53EA\u8981\u67D0\u5C42\uFF08\u5982 1 \u8868\u793A\u4E00\u697C\uFF09\uFF1A\u6309\u4F1A\u8BAE\u5BA4\u540D\u79F0/\u63CF\u8FF0\u63A8\u65AD\u697C\u5C42\u8FC7\u6EE4\uFF08120\u4F1A\u8BAE\u5BA4=1\u697C\u30011007\u4F1A\u8BAE\u5BA4=10\u697C\u3001601-8=6\u697C\uFF09" },
425
452
  topN: { type: "number", description: "\u8FD4\u56DE\u5019\u9009\u6570\u91CF\uFF08\u9ED8\u8BA4 3\uFF0C\u6700\u591A 10\uFF09" },
426
453
  refresh: { type: "boolean", description: "true=\u5237\u65B0\u4F1A\u8BAE\u5BA4\u5168\u91CF\u4E0E\u5E38\u7528\u8BB0\u5F55\u7F13\u5B58" },
427
454
  includeBusy: { type: "boolean", description: "true=\u628A\u8BE5\u65F6\u6BB5\u5DF2\u88AB\u5360\u7528\u7684\u4F1A\u8BAE\u5BA4\u4E5F\u8FD4\u56DE\uFF08\u6392\u5728\u6700\u540E\uFF0C\u5E26\u8BF4\u660E\uFF09" }
@@ -444,6 +471,8 @@ var ebRoomRecommendOperation = {
444
471
  // 2026-11-04 修:以前漏了它 —— 用户传了 hasCustomer,打分却读 requirement.hasCustomer,永远 false
445
472
  ...args.hasCustomer === true ? { hasCustomer: true } : {}
446
473
  },
474
+ // ⛔ floor 是 RecommendRoomInput 的**顶层**字段(放 requirement 里会被忽略,2026-11-06 踩到)
475
+ ...Number.isFinite(Number(args.floor)) ? { floor: Number(args.floor) } : {},
447
476
  ...args.topN !== void 0 ? { topN: Number(args.topN) } : {},
448
477
  ...args.refresh === true ? { refreshRooms: true, refreshFrequent: true } : {},
449
478
  ...args.includeBusy === true ? { includeBusy: true } : {}
@@ -463,7 +492,7 @@ async function rememberFrequentRoom(env, roomId) {
463
492
  const id = String(roomId ?? "").trim();
464
493
  if (!id) return false;
465
494
  const scope = await cacheScopeSuffix(env);
466
- const roomsCached = await readCache(env, `rooms-v3-${scope}`, { ttlMs: ROOMS_TTL_MS });
495
+ const roomsCached = await readCache(env, `rooms-v4-${scope}`, { ttlMs: ROOMS_TTL_MS });
467
496
  const name = roomsCached?.data?.find((room) => room.id === id)?.name ?? "";
468
497
  if (!name) return false;
469
498
  const session = await env.host.getSession().catch(() => null);
@@ -485,6 +514,7 @@ export {
485
514
  filterUsages,
486
515
  loadDayUsages,
487
516
  invalidateDayUsages,
517
+ inferRoomFloor,
488
518
  loadRooms,
489
519
  loadFrequentRooms,
490
520
  recommendRooms,
@@ -2,7 +2,7 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  CliError
5
- } from "./chunk-LUSPKZKY.js";
5
+ } from "./chunk-UG5G54VL.js";
6
6
 
7
7
  // src/shortcuts/hrm/errors.ts
8
8
  var HrmCliError = class extends CliError {
@@ -0,0 +1,76 @@
1
+ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
+ const require = __esbuildCreateRequire(import.meta.url);
3
+ import {
4
+ isCliError,
5
+ isStructuredError
6
+ } from "./chunk-UG5G54VL.js";
7
+
8
+ // src/core/error-codes.ts
9
+ var MAX_MESSAGE_LENGTH = 500;
10
+ function truncate(value) {
11
+ const flat = value.replace(/\s+/g, " ").trim();
12
+ return flat.length > MAX_MESSAGE_LENGTH ? `${flat.slice(0, MAX_MESSAGE_LENGTH)}\u2026` : flat;
13
+ }
14
+ function httpStatusOf(error) {
15
+ if (!error || typeof error !== "object") return void 0;
16
+ const details = error.details;
17
+ if (!details || typeof details !== "object") return void 0;
18
+ const status = details.httpStatus;
19
+ return typeof status === "number" ? status : void 0;
20
+ }
21
+ function codeFromStructured(type, subtype, httpStatus) {
22
+ if (httpStatus === 403) return "E-0005";
23
+ if (httpStatus === 401) return subtype.includes("expired") ? "E-0002" : "E-0001";
24
+ if (type === "authentication") {
25
+ return /expired|invalid_token|token_expired/u.test(subtype) ? "E-0002" : "E-0001";
26
+ }
27
+ if (type === "permission" || type === "authorization") return "E-0005";
28
+ if (type === "validation" || type === "usage") return "E-0003";
29
+ if (type === "network" || type === "upstream" || type === "http") return "E-0004";
30
+ return "E-9999";
31
+ }
32
+ function codeFromExitCode(exitCode) {
33
+ switch (exitCode) {
34
+ case 2 /* UsageError */:
35
+ return "E-0003";
36
+ case 3 /* AuthError */:
37
+ return "E-0001";
38
+ case 4 /* NetworkError */:
39
+ return "E-0004";
40
+ case 6 /* PolicyError */:
41
+ return "E-0005";
42
+ default:
43
+ return "E-9999";
44
+ }
45
+ }
46
+ function toPlatformError(error) {
47
+ if (isStructuredError(error)) {
48
+ const message2 = truncate(error.message || "\u672A\u77E5\u9519\u8BEF");
49
+ return {
50
+ code: codeFromStructured(error.type, error.subtype, httpStatusOf(error)),
51
+ message: message2
52
+ };
53
+ }
54
+ if (isCliError(error)) {
55
+ return {
56
+ code: codeFromExitCode(error.exitCode),
57
+ message: truncate(error.message || "\u672A\u77E5\u9519\u8BEF")
58
+ };
59
+ }
60
+ const message = error instanceof Error ? error.message : String(error);
61
+ return { code: "E-9999", message: truncate(message || "\u672A\u77E5\u9519\u8BEF") };
62
+ }
63
+ function shouldReportPlatformError(error) {
64
+ if (!isCliError(error)) return true;
65
+ return error.exitCode !== 0 /* Success */ && error.exitCode !== 10 /* ConfirmationRequired */;
66
+ }
67
+ function reportPlatformError(error) {
68
+ if (!shouldReportPlatformError(error)) return;
69
+ process.stderr.write(JSON.stringify(toPlatformError(error)) + "\n");
70
+ }
71
+
72
+ export {
73
+ toPlatformError,
74
+ shouldReportPlatformError,
75
+ reportPlatformError
76
+ };
@@ -7,6 +7,7 @@ import {
7
7
  E10_XIAOE_NETWORK_UNAVAILABLE_MESSAGE,
8
8
  E10_XIAOE_RECOVERY_FAILED_MESSAGE,
9
9
  getActiveProfile,
10
+ getE10AuthRoot,
10
11
  hasXiaoEEnv,
11
12
  isXiaoERuntimeAgent,
12
13
  lastXiaoEFailure,
@@ -16,10 +17,276 @@ import {
16
17
  startFetchTiming,
17
18
  summarizeXiaoEFailureKind,
18
19
  tryXiaoEUnifiedLogin
19
- } from "./chunk-FOAA27U5.js";
20
+ } from "./chunk-U6R6FZHD.js";
20
21
  import {
21
- CliError
22
- } from "./chunk-LUSPKZKY.js";
22
+ CliError,
23
+ toErrorEnvelope
24
+ } from "./chunk-UG5G54VL.js";
25
+
26
+ // src/internal/e10/auth/error-log.ts
27
+ import { randomUUID } from "node:crypto";
28
+ import { appendFile, chmod, mkdir, readFile, rmdir, stat, unlink, writeFile } from "node:fs/promises";
29
+ import { dirname, resolve } from "node:path";
30
+ var XIAOE_AUTH_ERROR_LOG_NAME = "xiaoe-auth-errors.ndjson";
31
+ var DEFAULT_LOG_LIMIT = 50;
32
+ var XIAOE_AUTH_ERROR_LOG_LOCK_SUFFIX = ".lock";
33
+ var XIAOE_AUTH_ERROR_LOG_LOCK_RETRY_MS = 25;
34
+ var XIAOE_AUTH_ERROR_LOG_LOCK_TIMEOUT_MS = 5e3;
35
+ var XIAOE_AUTH_ERROR_LOG_STALE_LOCK_MS = 3e4;
36
+ var MAX_XIAOE_AUTH_ERROR_LOG_LIMIT = 500;
37
+ var XIAOE_AUTH_ERROR_LOG_RETENTION_DAYS = 15;
38
+ var XIAOE_AUTH_ERROR_LOG_RETENTION_MS = XIAOE_AUTH_ERROR_LOG_RETENTION_DAYS * 24 * 60 * 60 * 1e3;
39
+ function getXiaoEAuthErrorLogPath() {
40
+ return resolve(getE10AuthRoot(), "logs", XIAOE_AUTH_ERROR_LOG_NAME);
41
+ }
42
+ function waitForXiaoEAuthLogLock() {
43
+ return new Promise((resolveWait) => setTimeout(resolveWait, XIAOE_AUTH_ERROR_LOG_LOCK_RETRY_MS));
44
+ }
45
+ async function acquireXiaoEAuthLogLock(path) {
46
+ const lockPath = `${path}${XIAOE_AUTH_ERROR_LOG_LOCK_SUFFIX}`;
47
+ const startedAt = Date.now();
48
+ for (; ; ) {
49
+ try {
50
+ await mkdir(lockPath, { mode: 448 });
51
+ return async () => {
52
+ await rmdir(lockPath).catch((error) => {
53
+ if (error?.code !== "ENOENT") throw error;
54
+ });
55
+ };
56
+ } catch (error) {
57
+ if (error?.code !== "EEXIST") throw error;
58
+ }
59
+ try {
60
+ const lockStat = await stat(lockPath);
61
+ if (Date.now() - lockStat.mtimeMs > XIAOE_AUTH_ERROR_LOG_STALE_LOCK_MS) {
62
+ await rmdir(lockPath);
63
+ continue;
64
+ }
65
+ } catch (error) {
66
+ if (error?.code === "ENOENT") continue;
67
+ throw error;
68
+ }
69
+ if (Date.now() - startedAt >= XIAOE_AUTH_ERROR_LOG_LOCK_TIMEOUT_MS) {
70
+ throw new Error(`Timed out waiting for XiaoE auth error log lock: ${lockPath}`);
71
+ }
72
+ await waitForXiaoEAuthLogLock();
73
+ }
74
+ }
75
+ async function withXiaoEAuthLogLock(path, action) {
76
+ await mkdir(dirname(path), { recursive: true, mode: 448 });
77
+ await chmod(dirname(path), 448).catch(() => void 0);
78
+ const release = await acquireXiaoEAuthLogLock(path);
79
+ try {
80
+ return await action();
81
+ } finally {
82
+ await release();
83
+ }
84
+ }
85
+ async function readXiaoEAuthErrorLogContent(path) {
86
+ try {
87
+ return await readFile(path, "utf8");
88
+ } catch (error) {
89
+ if (error?.code === "ENOENT") return "";
90
+ throw error;
91
+ }
92
+ }
93
+ function pruneExpiredXiaoEAuthErrorLogContent(content, now = Date.now()) {
94
+ const cutoff = now - XIAOE_AUTH_ERROR_LOG_RETENTION_MS;
95
+ const keptLines = [];
96
+ let expiredRemoved = 0;
97
+ for (const line of content.split(/\r?\n/u)) {
98
+ if (!line.trim()) continue;
99
+ try {
100
+ const value = JSON.parse(line);
101
+ if (isLogEntry(value)) {
102
+ const timestamp = Date.parse(value.timestamp);
103
+ if (Number.isFinite(timestamp) && timestamp < cutoff) {
104
+ expiredRemoved += 1;
105
+ continue;
106
+ }
107
+ }
108
+ } catch {
109
+ }
110
+ keptLines.push(line);
111
+ }
112
+ return {
113
+ content: keptLines.length ? `${keptLines.join("\n")}
114
+ ` : "",
115
+ expiredRemoved
116
+ };
117
+ }
118
+ async function persistPrunedXiaoEAuthErrorLog(path, content, expiredRemoved) {
119
+ if (!expiredRemoved) return;
120
+ await writeFile(path, content, { encoding: "utf8", mode: 384 });
121
+ await chmod(path, 384).catch(() => void 0);
122
+ }
123
+ function xiaoEAuthLogSecrets(env) {
124
+ return Object.entries(env).filter(([key, value]) => Boolean(
125
+ value && (key.startsWith("XIAOE_") || key.startsWith("WEAVER_XIAOE_")) && /(?:TOKEN|AUTH|ETEAMSID|COOKIE|SESSION|SECRET|PASSWORD)/iu.test(key)
126
+ )).map(([, value]) => value);
127
+ }
128
+ function redactSensitiveText(value, secrets = []) {
129
+ let text = value;
130
+ for (const secret of secrets) {
131
+ if (secret && secret.length >= 6) text = text.split(secret).join("<redacted>");
132
+ }
133
+ return text.replace(/(https?:\/\/[^\s?#]+)\?[^\s#]*/giu, "$1?<redacted>").replace(/\b(Bearer\s+)[A-Za-z0-9._~+/=-]+/giu, "$1<redacted>").replace(
134
+ /((?:eteamsid|access[_-]?token|refresh[_-]?token|auth(?:orization)?|cookie|session[_-]?id|secret|password)\s*[:=]\s*)(["']?)[^\s,;}"']+/giu,
135
+ "$1$2<redacted>"
136
+ ).replace(
137
+ /(["'](?:eteamsid|access[_-]?token|refresh[_-]?token|authorization|cookie|session[_-]?id|secret|password)["']\s*:\s*["'])[^"']*(["'])/giu,
138
+ "$1<redacted>$2"
139
+ ).replace(/\b[A-Za-z0-9_-]{48,}\b/gu, "<redacted>");
140
+ }
141
+ function sanitizeBaseUrl(value, secrets) {
142
+ if (!value) return void 0;
143
+ try {
144
+ const url = new URL(value);
145
+ url.username = "";
146
+ url.password = "";
147
+ url.search = "";
148
+ url.hash = "";
149
+ return redactSensitiveText(url.toString().replace(/\/$/u, ""), secrets);
150
+ } catch {
151
+ return redactSensitiveText(value, secrets);
152
+ }
153
+ }
154
+ function sanitizeFailure(failure, secrets) {
155
+ return {
156
+ stage: failure.stage,
157
+ kind: failure.kind,
158
+ message: redactSensitiveText(failure.message, secrets),
159
+ ...failure.causeCode ? { causeCode: redactSensitiveText(failure.causeCode, secrets) } : {},
160
+ ...failure.httpStatus === void 0 ? {} : { httpStatus: failure.httpStatus },
161
+ ...failure.request ? { request: sanitizeExchangeRequest(failure.request, secrets) } : {}
162
+ };
163
+ }
164
+ function sanitizeExchangeRequest(request, secrets) {
165
+ const endpoint = sanitizeBaseUrl(request.endpoint, secrets) || redactSensitiveText(request.endpoint, secrets);
166
+ const finalEndpoint = request.finalEndpoint ? sanitizeBaseUrl(request.finalEndpoint, secrets) || redactSensitiveText(request.finalEndpoint, secrets) : void 0;
167
+ const domain = sanitizeBaseUrl(request.body.domain, secrets) || redactSensitiveText(request.body.domain, secrets);
168
+ return {
169
+ transport: request.transport,
170
+ method: "POST",
171
+ endpoint,
172
+ ...finalEndpoint && finalEndpoint !== endpoint ? { finalEndpoint } : {},
173
+ redirect: request.redirect,
174
+ headers: {
175
+ "content-type": "application/json",
176
+ authorization: "<redacted>"
177
+ },
178
+ authorizationPresent: request.authorizationPresent,
179
+ authorizationLength: request.authorizationLength,
180
+ body: { domain },
181
+ bodyBytes: request.bodyBytes,
182
+ timeoutMs: request.timeoutMs,
183
+ elapsedMs: request.elapsedMs,
184
+ ...request.redirectCount ? { redirectCount: request.redirectCount } : {}
185
+ };
186
+ }
187
+ function sanitizeError(error, secrets) {
188
+ if (error === void 0) return void 0;
189
+ const envelope = toErrorEnvelope(error);
190
+ return {
191
+ ...envelope,
192
+ message: redactSensitiveText(envelope.message, secrets),
193
+ // Error details can contain arbitrary server payloads. The normalized
194
+ // diagnostics fields above are the only details persisted to disk.
195
+ ...envelope.details === void 0 ? {} : { details: "<omitted from persistent auth log>" }
196
+ };
197
+ }
198
+ function createEntry(input) {
199
+ const secrets = input.secrets || [];
200
+ const diagnostics = input.diagnostics;
201
+ const baseUrl = sanitizeBaseUrl(input.baseUrl || diagnostics?.baseUrl, secrets);
202
+ const lastError = diagnostics?.lastError ? redactSensitiveText(diagnostics.lastError, secrets) : void 0;
203
+ const failures = diagnostics?.failures?.map((failure) => sanitizeFailure(failure, secrets));
204
+ const error = sanitizeError(input.error, secrets);
205
+ return {
206
+ schemaVersion: 1,
207
+ id: randomUUID(),
208
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
209
+ source: input.source,
210
+ ...input.profile ? { profile: redactSensitiveText(input.profile, secrets) } : {},
211
+ ...baseUrl ? { baseUrl } : {},
212
+ ...diagnostics?.clientType ? { clientType: diagnostics.clientType } : {},
213
+ ...diagnostics?.platformCredentialDetected === void 0 ? {} : { platformCredentialDetected: diagnostics.platformCredentialDetected },
214
+ attemptedSteps: (diagnostics?.attemptedSteps || []).map((step) => redactSensitiveText(step, secrets)),
215
+ ...lastError ? { lastError } : {},
216
+ ...failures?.length ? { failures } : {},
217
+ ...input.resultSessionExpired ? { resultSessionExpired: true } : {},
218
+ ...error ? { error } : {}
219
+ };
220
+ }
221
+ async function appendXiaoEAuthErrorLog(input) {
222
+ const path = getXiaoEAuthErrorLogPath();
223
+ const entry = createEntry(input);
224
+ await withXiaoEAuthLogLock(path, async () => {
225
+ const current = await readXiaoEAuthErrorLogContent(path);
226
+ const pruned = pruneExpiredXiaoEAuthErrorLogContent(current);
227
+ await persistPrunedXiaoEAuthErrorLog(path, pruned.content, pruned.expiredRemoved);
228
+ await appendFile(path, `${JSON.stringify(entry)}
229
+ `, { encoding: "utf8", mode: 384 });
230
+ await chmod(path, 384).catch(() => void 0);
231
+ });
232
+ return entry;
233
+ }
234
+ function isLogEntry(value) {
235
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
236
+ const candidate = value;
237
+ return candidate.schemaVersion === 1 && typeof candidate.id === "string" && typeof candidate.timestamp === "string" && (candidate.source === "login" || candidate.source === "recovery") && Array.isArray(candidate.attemptedSteps);
238
+ }
239
+ function normalizeXiaoEAuthErrorLogLimit(value) {
240
+ if (value === void 0 || value === null || value === "") return DEFAULT_LOG_LIMIT;
241
+ const limit = Number(value);
242
+ if (!Number.isInteger(limit) || limit < 1 || limit > MAX_XIAOE_AUTH_ERROR_LOG_LIMIT) {
243
+ throw new RangeError(`limit must be an integer between 1 and ${MAX_XIAOE_AUTH_ERROR_LOG_LIMIT}`);
244
+ }
245
+ return limit;
246
+ }
247
+ async function readXiaoEAuthErrorLog(limit = DEFAULT_LOG_LIMIT) {
248
+ const normalizedLimit = normalizeXiaoEAuthErrorLogLimit(limit);
249
+ const path = getXiaoEAuthErrorLogPath();
250
+ const { content, expiredRemoved } = await withXiaoEAuthLogLock(path, async () => {
251
+ const current = await readXiaoEAuthErrorLogContent(path);
252
+ const pruned = pruneExpiredXiaoEAuthErrorLogContent(current);
253
+ await persistPrunedXiaoEAuthErrorLog(path, pruned.content, pruned.expiredRemoved);
254
+ return pruned;
255
+ });
256
+ let invalidLines = 0;
257
+ const entries = [];
258
+ for (const line of content.split(/\r?\n/u)) {
259
+ if (!line.trim()) continue;
260
+ try {
261
+ const value = JSON.parse(line);
262
+ if (isLogEntry(value)) entries.push(value);
263
+ else invalidLines += 1;
264
+ } catch {
265
+ invalidLines += 1;
266
+ }
267
+ }
268
+ const recent = entries.slice(-normalizedLimit).reverse();
269
+ return {
270
+ path,
271
+ total: entries.length,
272
+ returned: recent.length,
273
+ invalidLines,
274
+ expiredRemoved,
275
+ entries: recent
276
+ };
277
+ }
278
+ async function clearXiaoEAuthErrorLog() {
279
+ const path = getXiaoEAuthErrorLogPath();
280
+ return withXiaoEAuthLogLock(path, async () => {
281
+ try {
282
+ await unlink(path);
283
+ return { path, cleared: true };
284
+ } catch (error) {
285
+ if (error?.code === "ENOENT") return { path, cleared: false };
286
+ throw error;
287
+ }
288
+ });
289
+ }
23
290
 
24
291
  // src/internal/e10/auth-recovery.ts
25
292
  var AUTH_REQUIRED_CODES = /* @__PURE__ */ new Set(["-2", "401"]);
@@ -180,6 +447,12 @@ function recoveryLogger(ctx) {
180
447
  warn: (message) => adapter.debug(message)
181
448
  };
182
449
  }
450
+ function reportAuthLogWriteFailure(ctx, error) {
451
+ const logger = ctx.logger;
452
+ logger?.debug?.(
453
+ `Could not persist XiaoE auth error log: ${error instanceof Error ? error.message : String(error)}`
454
+ );
455
+ }
183
456
  async function recoverXiaoEAuthSession(ctx, currentSession) {
184
457
  return (await recoverXiaoEAuthSessionWithDiagnostics(ctx, currentSession)).session;
185
458
  }
@@ -203,18 +476,39 @@ ${baseUrl}`;
203
476
  if (existing) return existing;
204
477
  const diagnostics = { attemptedSteps: [] };
205
478
  const recovery = (async () => {
206
- const login = await tryXiaoEUnifiedLogin({
207
- env: ctx.env,
208
- baseUrl,
209
- profileBaseUrl: baseUrl,
210
- allowBundledEnvScript: true,
211
- allowTokenScript: true,
212
- tenantKeyFallback: currentSession?.tenantKey || config.tenantKey,
213
- profileHint: profile,
214
- diagnostics,
215
- logger: recoveryLogger(ctx)
216
- });
217
- return { session: login?.session || null, diagnostics };
479
+ try {
480
+ const login = await tryXiaoEUnifiedLogin({
481
+ env: ctx.env,
482
+ baseUrl,
483
+ profileBaseUrl: baseUrl,
484
+ allowBundledEnvScript: true,
485
+ allowTokenScript: true,
486
+ tenantKeyFallback: currentSession?.tenantKey || config.tenantKey,
487
+ profileHint: profile,
488
+ diagnostics,
489
+ logger: recoveryLogger(ctx)
490
+ });
491
+ if (!login) {
492
+ await appendXiaoEAuthErrorLog({
493
+ source: "recovery",
494
+ profile,
495
+ baseUrl,
496
+ diagnostics,
497
+ secrets: xiaoEAuthLogSecrets(ctx.env)
498
+ }).catch((error) => reportAuthLogWriteFailure(ctx, error));
499
+ }
500
+ return { session: login?.session || null, diagnostics };
501
+ } catch (error) {
502
+ await appendXiaoEAuthErrorLog({
503
+ source: "recovery",
504
+ profile,
505
+ baseUrl,
506
+ diagnostics,
507
+ error,
508
+ secrets: xiaoEAuthLogSecrets(ctx.env)
509
+ }).catch((logError) => reportAuthLogWriteFailure(ctx, logError));
510
+ throw error;
511
+ }
218
512
  })();
219
513
  recoveryInFlight.set(key, recovery);
220
514
  try {
@@ -231,9 +525,19 @@ function sameE10SessionIdentity(current, recovered) {
231
525
  }
232
526
 
233
527
  // src/internal/e10/context.ts
528
+ function xiaoEFailureForErrorDetails(failure) {
529
+ return {
530
+ stage: failure.stage,
531
+ kind: failure.kind,
532
+ message: failure.message,
533
+ ...failure.causeCode ? { causeCode: failure.causeCode } : {},
534
+ ...failure.httpStatus === void 0 ? {} : { httpStatus: failure.httpStatus }
535
+ };
536
+ }
234
537
  function xiaoERecoveryFailedError(diagnostics, resultSessionExpired = false) {
235
538
  const failureKind = summarizeXiaoEFailureKind(diagnostics);
236
539
  const lastFailure = lastXiaoEFailure(diagnostics);
540
+ const publicFailures = diagnostics?.failures?.map(xiaoEFailureForErrorDetails);
237
541
  const networkUnavailable = failureKind === "network";
238
542
  const hostCredentialMissing = diagnostics?.clientType === "cloud" && diagnostics.platformCredentialDetected === false && diagnostics.attemptedSteps.includes("platform_token:missing") && diagnostics.attemptedSteps.includes("environment_map:empty");
239
543
  const details = diagnostics ? {
@@ -244,7 +548,7 @@ function xiaoERecoveryFailedError(diagnostics, resultSessionExpired = false) {
244
548
  ...diagnostics.lastError ? { lastError: diagnostics.lastError } : {},
245
549
  ...failureKind ? { errorKind: failureKind } : {},
246
550
  ...lastFailure ? { failureStage: lastFailure.stage } : {},
247
- ...diagnostics.failures?.length ? { failures: diagnostics.failures } : {},
551
+ ...publicFailures?.length ? { failures: publicFailures } : {},
248
552
  ...hostCredentialMissing ? { reason: "host_credential_not_injected" } : {},
249
553
  ...resultSessionExpired ? { resultSessionExpired: true } : {}
250
554
  } : void 0;
@@ -268,12 +572,26 @@ async function getE10Session(ctx, load = {}) {
268
572
  return E10AuthSession.fromOptions(options, ctx.cwd, load);
269
573
  }
270
574
  async function requireE10Session(ctx, load = {}) {
575
+ const options = ctx.getGlobalOptions();
271
576
  let session = await getE10Session(ctx, load);
272
577
  if (session?.isExpired() && canAutomaticallyRecoverXiaoE(ctx, session)) {
273
578
  const outcome = await recoverXiaoEAuthSessionWithDiagnostics(ctx, session).catch(() => null);
274
579
  session = outcome?.session || null;
275
580
  if (!session || session.isExpired()) {
276
- throw xiaoERecoveryFailedError(outcome?.diagnostics, session?.isExpired() === true);
581
+ const resultSessionExpired = session?.isExpired() === true;
582
+ const error = xiaoERecoveryFailedError(outcome?.diagnostics, resultSessionExpired);
583
+ if (resultSessionExpired) {
584
+ await appendXiaoEAuthErrorLog({
585
+ source: "recovery",
586
+ profile: options.profile || getActiveProfile(),
587
+ baseUrl: session?.getBaseUrl(),
588
+ diagnostics: outcome?.diagnostics,
589
+ resultSessionExpired: true,
590
+ error,
591
+ secrets: xiaoEAuthLogSecrets(ctx.env)
592
+ }).catch(() => void 0);
593
+ }
594
+ throw error;
277
595
  }
278
596
  }
279
597
  if (!session && canAutomaticallyRecoverXiaoE(ctx)) {
@@ -760,8 +1078,15 @@ function cloneForHook(value) {
760
1078
  }
761
1079
 
762
1080
  export {
1081
+ getXiaoEAuthErrorLogPath,
1082
+ xiaoEAuthLogSecrets,
1083
+ appendXiaoEAuthErrorLog,
1084
+ normalizeXiaoEAuthErrorLogLimit,
1085
+ readXiaoEAuthErrorLog,
1086
+ clearXiaoEAuthErrorLog,
763
1087
  isE10SessionExpiredResponse,
764
1088
  isE10AuthenticationRequired,
1089
+ getE10Session,
765
1090
  requireE10Session,
766
1091
  E10ApiError,
767
1092
  createE10RequestRuntime
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-AJ62BGAW.js";
7
7
  import {
8
8
  CliError
9
- } from "./chunk-LUSPKZKY.js";
9
+ } from "./chunk-UG5G54VL.js";
10
10
 
11
11
  // src/core/refs.ts
12
12
  import { createHash, randomBytes } from "node:crypto";