@wirecat/mail-cli 0.38.0 → 0.39.0

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 (395) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +9 -7
  3. package/contracts/wirecat.json +63 -2
  4. package/dist/bin/mail.js +11 -11
  5. package/dist/bundle/{chunk-HIKPVWCL.js → chunk-BXH2YUBR.js} +32 -5
  6. package/dist/bundle/mail.js +4 -166
  7. package/dist/bundle/program-ZSF2VJI6.js +17329 -0
  8. package/dist/commands/account-remove.js +1 -2
  9. package/dist/commands/account.js +1 -1
  10. package/dist/commands/attachments.js +1 -2
  11. package/dist/commands/context.js +1 -1
  12. package/dist/commands/doctor.js +1 -1
  13. package/dist/commands/drafts-send.js +1 -2
  14. package/dist/commands/drafts.js +1 -2
  15. package/dist/commands/export.js +1 -2
  16. package/dist/commands/folders.js +1 -2
  17. package/dist/commands/import.js +1 -1
  18. package/dist/commands/messages.js +1 -1
  19. package/dist/commands/organising.js +1 -2
  20. package/dist/commands/read.js +2 -4
  21. package/dist/commands/restore.js +1 -1
  22. package/dist/commands/rules.js +1 -2
  23. package/dist/commands/send.js +1 -2
  24. package/dist/commands/session-start.js +1 -1
  25. package/dist/commands/session.js +1 -1
  26. package/dist/commands/stats.js +1 -1
  27. package/dist/commands/status.js +3 -5
  28. package/dist/commands/sync.js +1 -1
  29. package/dist/commands/tags.js +1 -2
  30. package/dist/config.js +1 -1
  31. package/dist/identity.js +26 -0
  32. package/dist/mail/changes.js +3 -2
  33. package/dist/mail/cleanup.js +3 -2
  34. package/dist/mail/domain-age.js +1 -1
  35. package/dist/mail/memo-trash.js +47 -0
  36. package/dist/mail/organise.js +1 -1
  37. package/dist/mail/save.js +1 -1
  38. package/dist/mail/send.js +1 -1
  39. package/dist/oauth.js +1 -3
  40. package/dist/profile.js +1 -1
  41. package/dist/program.js +1 -2
  42. package/dist/providers.js +4 -4
  43. package/dist/store.js +1 -1
  44. package/dist/version.js +1 -1
  45. package/package.json +5 -5
  46. package/dist/bin/mail.d.ts +0 -3
  47. package/dist/bin/mail.d.ts.map +0 -1
  48. package/dist/bin/mail.js.map +0 -1
  49. package/dist/bundle/agent-U43CYLAP.js +0 -41
  50. package/dist/bundle/all-profiles-OCUZMXMI.js +0 -320
  51. package/dist/bundle/anthropic-CABWJABQ.js +0 -90
  52. package/dist/bundle/app-server-TTWPIGWG.js +0 -257
  53. package/dist/bundle/bun-F4M4KCNA.js +0 -169
  54. package/dist/bundle/bun-sqlite-YKYG25CR.js +0 -75
  55. package/dist/bundle/chunk-24UGTK32.js +0 -185
  56. package/dist/bundle/chunk-2HDXD6LM.js +0 -615
  57. package/dist/bundle/chunk-2SQLHBDP.js +0 -54
  58. package/dist/bundle/chunk-2YO3PLOE.js +0 -2843
  59. package/dist/bundle/chunk-3TYER5IK.js +0 -80
  60. package/dist/bundle/chunk-4FXDUXZP.js +0 -192
  61. package/dist/bundle/chunk-5ICUC66S.js +0 -76
  62. package/dist/bundle/chunk-725OPCHI.js +0 -4070
  63. package/dist/bundle/chunk-77YTUOKN.js +0 -1255
  64. package/dist/bundle/chunk-7ECP5ZQR.js +0 -2
  65. package/dist/bundle/chunk-7EJWHADX.js +0 -323
  66. package/dist/bundle/chunk-7KO5FSAW.js +0 -64
  67. package/dist/bundle/chunk-A3KNH3Q4.js +0 -353
  68. package/dist/bundle/chunk-AGO3OVKW.js +0 -40856
  69. package/dist/bundle/chunk-AQ5RIOUE.js +0 -633
  70. package/dist/bundle/chunk-BA5B5ZF4.js +0 -12177
  71. package/dist/bundle/chunk-C4PUDTGD.js +0 -106
  72. package/dist/bundle/chunk-C7JPYWYQ.js +0 -77
  73. package/dist/bundle/chunk-CJJFOT7W.js +0 -52
  74. package/dist/bundle/chunk-CLTFTGBP.js +0 -560
  75. package/dist/bundle/chunk-D72URWJE.js +0 -532
  76. package/dist/bundle/chunk-DFDN6AUB.js +0 -21
  77. package/dist/bundle/chunk-DKGKPJA3.js +0 -3752
  78. package/dist/bundle/chunk-DNCLQPOM.js +0 -7
  79. package/dist/bundle/chunk-DPV53EZC.js +0 -206
  80. package/dist/bundle/chunk-DYCE72XB.js +0 -794
  81. package/dist/bundle/chunk-EDWY73H7.js +0 -133
  82. package/dist/bundle/chunk-EJQAP6A6.js +0 -1007
  83. package/dist/bundle/chunk-ESNZL7SB.js +0 -330
  84. package/dist/bundle/chunk-FFER7KJI.js +0 -407
  85. package/dist/bundle/chunk-FTH6WGYO.js +0 -24
  86. package/dist/bundle/chunk-FWGNDKJK.js +0 -195
  87. package/dist/bundle/chunk-G46PNDWL.js +0 -58
  88. package/dist/bundle/chunk-G5HG7ZWQ.js +0 -1169
  89. package/dist/bundle/chunk-G6NY7LFB.js +0 -230
  90. package/dist/bundle/chunk-GMWKNWWY.js +0 -388
  91. package/dist/bundle/chunk-GZ7WBU5Y.js +0 -18
  92. package/dist/bundle/chunk-HFDDVGDH.js +0 -9512
  93. package/dist/bundle/chunk-HFRH5YJ6.js +0 -86
  94. package/dist/bundle/chunk-HI6MTNID.js +0 -338
  95. package/dist/bundle/chunk-HO4JGD4Q.js +0 -16
  96. package/dist/bundle/chunk-HTQTIKWP.js +0 -928
  97. package/dist/bundle/chunk-HUAHLO6N.js +0 -29
  98. package/dist/bundle/chunk-HYUUAH2N.js +0 -188
  99. package/dist/bundle/chunk-I4AWLFYH.js +0 -377
  100. package/dist/bundle/chunk-I4PZOWYG.js +0 -334
  101. package/dist/bundle/chunk-IDCZ4LWS.js +0 -150
  102. package/dist/bundle/chunk-ISQ23VKV.js +0 -123
  103. package/dist/bundle/chunk-KLRCTMES.js +0 -100
  104. package/dist/bundle/chunk-KP5JDYY6.js +0 -2669
  105. package/dist/bundle/chunk-KYRYD4CR.js +0 -38
  106. package/dist/bundle/chunk-LB2CF3GG.js +0 -730
  107. package/dist/bundle/chunk-LC7ZD2RW.js +0 -92
  108. package/dist/bundle/chunk-M65NILSA.js +0 -259
  109. package/dist/bundle/chunk-NQFG7AES.js +0 -364
  110. package/dist/bundle/chunk-OAO3JKQD.js +0 -463
  111. package/dist/bundle/chunk-OEEWVKJX.js +0 -53
  112. package/dist/bundle/chunk-OVHC7OV4.js +0 -218
  113. package/dist/bundle/chunk-PL5P7UKW.js +0 -25216
  114. package/dist/bundle/chunk-PT4VLN3K.js +0 -161
  115. package/dist/bundle/chunk-QETNCUWB.js +0 -1703
  116. package/dist/bundle/chunk-QK3Z7BCC.js +0 -95
  117. package/dist/bundle/chunk-QWF3TFW4.js +0 -1342
  118. package/dist/bundle/chunk-RHEDE7D4.js +0 -80
  119. package/dist/bundle/chunk-RI5YZ23Y.js +0 -1068
  120. package/dist/bundle/chunk-ROUZN6UQ.js +0 -1997
  121. package/dist/bundle/chunk-RQD7CAGF.js +0 -288
  122. package/dist/bundle/chunk-S6JG4YUH.js +0 -72
  123. package/dist/bundle/chunk-SBLHQAH3.js +0 -360
  124. package/dist/bundle/chunk-SXLIADMY.js +0 -52
  125. package/dist/bundle/chunk-SYCM6SQ5.js +0 -2470
  126. package/dist/bundle/chunk-T3W4V4A6.js +0 -63
  127. package/dist/bundle/chunk-TCT5D2X2.js +0 -6848
  128. package/dist/bundle/chunk-TES7MB6I.js +0 -82
  129. package/dist/bundle/chunk-TQDSBLQB.js +0 -2
  130. package/dist/bundle/chunk-TXDR6YSF.js +0 -23
  131. package/dist/bundle/chunk-TY7NDMFY.js +0 -46
  132. package/dist/bundle/chunk-UGFMQWAZ.js +0 -1044
  133. package/dist/bundle/chunk-VA6PHTMV.js +0 -690
  134. package/dist/bundle/chunk-VK24UQSD.js +0 -142
  135. package/dist/bundle/chunk-VUHH4MQW.js +0 -73464
  136. package/dist/bundle/chunk-W3BOR6AT.js +0 -2333
  137. package/dist/bundle/chunk-WA53OJ7V.js +0 -160
  138. package/dist/bundle/chunk-XGVMQMTS.js +0 -1197
  139. package/dist/bundle/chunk-XQUUANA2.js +0 -24600
  140. package/dist/bundle/chunk-Y5E2WNWB.js +0 -35
  141. package/dist/bundle/chunk-YP4FYLFI.js +0 -170
  142. package/dist/bundle/chunk-ZDBWBCEO.js +0 -108
  143. package/dist/bundle/chunk-ZKVUAH5N.js +0 -274
  144. package/dist/bundle/chunk-ZVVMGPBJ.js +0 -50
  145. package/dist/bundle/command-contract-V2WIL6RL.js +0 -40
  146. package/dist/bundle/command-server-entry-ZC5YF4EC.js +0 -169
  147. package/dist/bundle/decode-NXAGEUAD.js +0 -296
  148. package/dist/bundle/dispatch-USKS7J74.js +0 -411
  149. package/dist/bundle/dist-HFUVURJG.js +0 -7577
  150. package/dist/bundle/dist-PAKDDIBT.js +0 -191
  151. package/dist/bundle/dist-XN2CRP3U.js +0 -318
  152. package/dist/bundle/echarts-QMAA7HH5.js +0 -42501
  153. package/dist/bundle/embed-3P3LSM2O.js +0 -37
  154. package/dist/bundle/embedder-2SANUF2X.js +0 -110
  155. package/dist/bundle/failure-D4FGOIWF.js +0 -24
  156. package/dist/bundle/first-run-HEZKQLJL.js +0 -28
  157. package/dist/bundle/first-screen-7TQZ4I6X.js +0 -41
  158. package/dist/bundle/instructions-4H7UREH2.js +0 -11
  159. package/dist/bundle/mcp-5HFPWC3W.js +0 -167
  160. package/dist/bundle/meeting-combined-HF2NL4PU.js +0 -26
  161. package/dist/bundle/meeting-model-B7RVFB7L.js +0 -24
  162. package/dist/bundle/meeting-semantic-YQTL7YVQ.js +0 -21
  163. package/dist/bundle/node-KM3CUABH.js +0 -2340
  164. package/dist/bundle/node-P3PUHKYH.js +0 -176
  165. package/dist/bundle/node-TLZSIHIJ.js +0 -21
  166. package/dist/bundle/node-sqlite-OFHTCHJH.js +0 -73
  167. package/dist/bundle/oauth-IVB5RP7T.js +0 -19
  168. package/dist/bundle/open-KDGDLCWV.js +0 -22
  169. package/dist/bundle/openai-NVUBKA7Z.js +0 -237
  170. package/dist/bundle/process-AFIXYXWL.js +0 -91
  171. package/dist/bundle/program-JQ7EFODJ.js +0 -47008
  172. package/dist/bundle/prompt-QG7FC2SA.js +0 -16
  173. package/dist/bundle/public-FBD7MQUM.js +0 -204
  174. package/dist/bundle/recognize-ZBR5KNID.js +0 -25
  175. package/dist/bundle/remote-QOTHNO2M.js +0 -30
  176. package/dist/bundle/rerank-JD2NIUW6.js +0 -51
  177. package/dist/bundle/serve-QZT3FKK7.js +0 -198
  178. package/dist/bundle/server-M6JJ7IKS.js +0 -219
  179. package/dist/bundle/server-TAMXMWK6.js +0 -87
  180. package/dist/bundle/sqlite-runtime-N2PY7C7J.js +0 -19
  181. package/dist/bundle/state-OGRUMU7P.js +0 -35
  182. package/dist/bundle/store-7UE63OQR.js +0 -313
  183. package/dist/bundle/store-DGJKE4ZJ.js +0 -186
  184. package/dist/bundle/store-maintenance-command-WIDKMZLK.js +0 -74
  185. package/dist/bundle/surface-LTEEEZU4.js +0 -73
  186. package/dist/commands/account-remove.d.ts +0 -3
  187. package/dist/commands/account-remove.d.ts.map +0 -1
  188. package/dist/commands/account-remove.js.map +0 -1
  189. package/dist/commands/account.d.ts +0 -3
  190. package/dist/commands/account.d.ts.map +0 -1
  191. package/dist/commands/account.js.map +0 -1
  192. package/dist/commands/attachments.d.ts +0 -3
  193. package/dist/commands/attachments.d.ts.map +0 -1
  194. package/dist/commands/attachments.js.map +0 -1
  195. package/dist/commands/context.d.ts +0 -79
  196. package/dist/commands/context.d.ts.map +0 -1
  197. package/dist/commands/context.js.map +0 -1
  198. package/dist/commands/doctor.d.ts +0 -68
  199. package/dist/commands/doctor.d.ts.map +0 -1
  200. package/dist/commands/doctor.js.map +0 -1
  201. package/dist/commands/drafts-send.d.ts +0 -7
  202. package/dist/commands/drafts-send.d.ts.map +0 -1
  203. package/dist/commands/drafts-send.js.map +0 -1
  204. package/dist/commands/drafts.d.ts +0 -3
  205. package/dist/commands/drafts.d.ts.map +0 -1
  206. package/dist/commands/drafts.js.map +0 -1
  207. package/dist/commands/export.d.ts +0 -3
  208. package/dist/commands/export.d.ts.map +0 -1
  209. package/dist/commands/export.js.map +0 -1
  210. package/dist/commands/folders.d.ts +0 -3
  211. package/dist/commands/folders.d.ts.map +0 -1
  212. package/dist/commands/folders.js.map +0 -1
  213. package/dist/commands/import.d.ts +0 -3
  214. package/dist/commands/import.d.ts.map +0 -1
  215. package/dist/commands/import.js.map +0 -1
  216. package/dist/commands/login.d.ts +0 -5
  217. package/dist/commands/login.d.ts.map +0 -1
  218. package/dist/commands/login.js.map +0 -1
  219. package/dist/commands/mailbox.d.ts +0 -17
  220. package/dist/commands/mailbox.d.ts.map +0 -1
  221. package/dist/commands/mailbox.js.map +0 -1
  222. package/dist/commands/messages.d.ts +0 -4
  223. package/dist/commands/messages.d.ts.map +0 -1
  224. package/dist/commands/messages.js.map +0 -1
  225. package/dist/commands/organising.d.ts +0 -98
  226. package/dist/commands/organising.d.ts.map +0 -1
  227. package/dist/commands/organising.js.map +0 -1
  228. package/dist/commands/read.d.ts +0 -6
  229. package/dist/commands/read.d.ts.map +0 -1
  230. package/dist/commands/read.js.map +0 -1
  231. package/dist/commands/restore.d.ts +0 -3
  232. package/dist/commands/restore.d.ts.map +0 -1
  233. package/dist/commands/restore.js.map +0 -1
  234. package/dist/commands/rules.d.ts +0 -3
  235. package/dist/commands/rules.d.ts.map +0 -1
  236. package/dist/commands/rules.js.map +0 -1
  237. package/dist/commands/send.d.ts +0 -51
  238. package/dist/commands/send.d.ts.map +0 -1
  239. package/dist/commands/send.js.map +0 -1
  240. package/dist/commands/server-search.d.ts +0 -8
  241. package/dist/commands/server-search.d.ts.map +0 -1
  242. package/dist/commands/server-search.js.map +0 -1
  243. package/dist/commands/session-start.d.ts +0 -3
  244. package/dist/commands/session-start.d.ts.map +0 -1
  245. package/dist/commands/session-start.js.map +0 -1
  246. package/dist/commands/session.d.ts +0 -3
  247. package/dist/commands/session.d.ts.map +0 -1
  248. package/dist/commands/session.js.map +0 -1
  249. package/dist/commands/stats.d.ts +0 -3
  250. package/dist/commands/stats.d.ts.map +0 -1
  251. package/dist/commands/stats.js.map +0 -1
  252. package/dist/commands/status.d.ts +0 -3
  253. package/dist/commands/status.d.ts.map +0 -1
  254. package/dist/commands/status.js.map +0 -1
  255. package/dist/commands/sync.d.ts +0 -11
  256. package/dist/commands/sync.d.ts.map +0 -1
  257. package/dist/commands/sync.js.map +0 -1
  258. package/dist/commands/tags.d.ts +0 -3
  259. package/dist/commands/tags.d.ts.map +0 -1
  260. package/dist/commands/tags.js.map +0 -1
  261. package/dist/commands/words.d.ts +0 -8
  262. package/dist/commands/words.d.ts.map +0 -1
  263. package/dist/commands/words.js.map +0 -1
  264. package/dist/config.d.ts +0 -239
  265. package/dist/config.d.ts.map +0 -1
  266. package/dist/config.js.map +0 -1
  267. package/dist/discovery.d.ts +0 -31
  268. package/dist/discovery.d.ts.map +0 -1
  269. package/dist/discovery.js.map +0 -1
  270. package/dist/export/format.d.ts +0 -19
  271. package/dist/export/format.d.ts.map +0 -1
  272. package/dist/export/format.js.map +0 -1
  273. package/dist/export/journal.d.ts +0 -34
  274. package/dist/export/journal.d.ts.map +0 -1
  275. package/dist/export/journal.js.map +0 -1
  276. package/dist/export/write.d.ts +0 -14
  277. package/dist/export/write.d.ts.map +0 -1
  278. package/dist/export/write.js.map +0 -1
  279. package/dist/identity.d.ts +0 -7
  280. package/dist/identity.d.ts.map +0 -1
  281. package/dist/identity.js.map +0 -1
  282. package/dist/mail/backend.d.ts +0 -138
  283. package/dist/mail/backend.d.ts.map +0 -1
  284. package/dist/mail/backend.js.map +0 -1
  285. package/dist/mail/changes.d.ts +0 -99
  286. package/dist/mail/changes.d.ts.map +0 -1
  287. package/dist/mail/changes.js.map +0 -1
  288. package/dist/mail/cleanup.d.ts +0 -41
  289. package/dist/mail/cleanup.d.ts.map +0 -1
  290. package/dist/mail/cleanup.js.map +0 -1
  291. package/dist/mail/compose.d.ts +0 -75
  292. package/dist/mail/compose.d.ts.map +0 -1
  293. package/dist/mail/compose.js.map +0 -1
  294. package/dist/mail/domain-age.d.ts +0 -29
  295. package/dist/mail/domain-age.d.ts.map +0 -1
  296. package/dist/mail/domain-age.js.map +0 -1
  297. package/dist/mail/drafts.d.ts +0 -54
  298. package/dist/mail/drafts.d.ts.map +0 -1
  299. package/dist/mail/drafts.js.map +0 -1
  300. package/dist/mail/imap/account.d.ts +0 -5
  301. package/dist/mail/imap/account.d.ts.map +0 -1
  302. package/dist/mail/imap/account.js.map +0 -1
  303. package/dist/mail/imap/connection.d.ts +0 -72
  304. package/dist/mail/imap/connection.d.ts.map +0 -1
  305. package/dist/mail/imap/connection.js.map +0 -1
  306. package/dist/mail/imap/errors.d.ts +0 -11
  307. package/dist/mail/imap/errors.d.ts.map +0 -1
  308. package/dist/mail/imap/errors.js.map +0 -1
  309. package/dist/mail/imap/index.d.ts +0 -7
  310. package/dist/mail/imap/index.d.ts.map +0 -1
  311. package/dist/mail/imap/index.js.map +0 -1
  312. package/dist/mail/imap/messages.d.ts +0 -17
  313. package/dist/mail/imap/messages.d.ts.map +0 -1
  314. package/dist/mail/imap/messages.js.map +0 -1
  315. package/dist/mail/imap/read.d.ts +0 -7
  316. package/dist/mail/imap/read.d.ts.map +0 -1
  317. package/dist/mail/imap/read.js.map +0 -1
  318. package/dist/mail/imap/search.d.ts +0 -19
  319. package/dist/mail/imap/search.d.ts.map +0 -1
  320. package/dist/mail/imap/search.js.map +0 -1
  321. package/dist/mail/imap/write.d.ts +0 -5
  322. package/dist/mail/imap/write.d.ts.map +0 -1
  323. package/dist/mail/imap/write.js.map +0 -1
  324. package/dist/mail/locate.d.ts +0 -32
  325. package/dist/mail/locate.d.ts.map +0 -1
  326. package/dist/mail/locate.js.map +0 -1
  327. package/dist/mail/mbox.d.ts +0 -9
  328. package/dist/mail/mbox.d.ts.map +0 -1
  329. package/dist/mail/mbox.js.map +0 -1
  330. package/dist/mail/organise.d.ts +0 -101
  331. package/dist/mail/organise.d.ts.map +0 -1
  332. package/dist/mail/organise.js.map +0 -1
  333. package/dist/mail/restore.d.ts +0 -22
  334. package/dist/mail/restore.d.ts.map +0 -1
  335. package/dist/mail/restore.js.map +0 -1
  336. package/dist/mail/rethread.d.ts +0 -14
  337. package/dist/mail/rethread.d.ts.map +0 -1
  338. package/dist/mail/rethread.js.map +0 -1
  339. package/dist/mail/rules/apply.d.ts +0 -48
  340. package/dist/mail/rules/apply.d.ts.map +0 -1
  341. package/dist/mail/rules/apply.js.map +0 -1
  342. package/dist/mail/rules/file.d.ts +0 -9
  343. package/dist/mail/rules/file.d.ts.map +0 -1
  344. package/dist/mail/rules/file.js.map +0 -1
  345. package/dist/mail/rules/filters.d.ts +0 -11
  346. package/dist/mail/rules/filters.d.ts.map +0 -1
  347. package/dist/mail/rules/filters.js.map +0 -1
  348. package/dist/mail/rules/folders.d.ts +0 -11
  349. package/dist/mail/rules/folders.d.ts.map +0 -1
  350. package/dist/mail/rules/folders.js.map +0 -1
  351. package/dist/mail/rules/query.d.ts +0 -16
  352. package/dist/mail/rules/query.d.ts.map +0 -1
  353. package/dist/mail/rules/query.js.map +0 -1
  354. package/dist/mail/rules/store.d.ts +0 -9
  355. package/dist/mail/rules/store.d.ts.map +0 -1
  356. package/dist/mail/rules/store.js.map +0 -1
  357. package/dist/mail/save.d.ts +0 -9
  358. package/dist/mail/save.d.ts.map +0 -1
  359. package/dist/mail/save.js.map +0 -1
  360. package/dist/mail/send-as.d.ts +0 -21
  361. package/dist/mail/send-as.d.ts.map +0 -1
  362. package/dist/mail/send-as.js.map +0 -1
  363. package/dist/mail/send.d.ts +0 -76
  364. package/dist/mail/send.d.ts.map +0 -1
  365. package/dist/mail/send.js.map +0 -1
  366. package/dist/mail/smtp.d.ts +0 -4
  367. package/dist/mail/smtp.d.ts.map +0 -1
  368. package/dist/mail/smtp.js.map +0 -1
  369. package/dist/oauth.d.ts +0 -75
  370. package/dist/oauth.d.ts.map +0 -1
  371. package/dist/oauth.js.map +0 -1
  372. package/dist/profile.d.ts +0 -20
  373. package/dist/profile.d.ts.map +0 -1
  374. package/dist/profile.js.map +0 -1
  375. package/dist/program.d.ts +0 -6
  376. package/dist/program.d.ts.map +0 -1
  377. package/dist/program.js.map +0 -1
  378. package/dist/providers.d.ts +0 -255
  379. package/dist/providers.d.ts.map +0 -1
  380. package/dist/providers.js.map +0 -1
  381. package/dist/reasons.d.ts +0 -9
  382. package/dist/reasons.d.ts.map +0 -1
  383. package/dist/reasons.js.map +0 -1
  384. package/dist/secret.d.ts +0 -31
  385. package/dist/secret.d.ts.map +0 -1
  386. package/dist/secret.js.map +0 -1
  387. package/dist/store.d.ts +0 -12
  388. package/dist/store.d.ts.map +0 -1
  389. package/dist/store.js.map +0 -1
  390. package/dist/version.d.ts +0 -2
  391. package/dist/version.d.ts.map +0 -1
  392. package/dist/version.js.map +0 -1
  393. package/dist/wcat.d.ts +0 -3
  394. package/dist/wcat.d.ts.map +0 -1
  395. package/dist/wcat.js.map +0 -1
@@ -1,230 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- importFrom
5
- } from "./chunk-Y5E2WNWB.js";
6
- import {
7
- CliError
8
- } from "./chunk-S6JG4YUH.js";
9
- import {
10
- __name
11
- } from "./chunk-ZVVMGPBJ.js";
12
-
13
- // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/speech/recognize.js
14
- import { createRequire } from "node:module";
15
-
16
- // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/speech/ogg-limit.js
17
- var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "local transcription needs a complete mono or stereo Ogg Opus recording"), "invalid");
18
- var checkOggDuration = /* @__PURE__ */ __name((bytes) => {
19
- const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
20
- let offset = 0;
21
- let serial;
22
- let packet = 0;
23
- let length = 0;
24
- const prefix = [];
25
- while (offset < bytes.length) {
26
- if (offset + 27 > bytes.length || view.getUint32(offset, false) !== 1332176723 || bytes[offset + 4] !== 0)
27
- throw invalid();
28
- const stream = view.getUint32(offset + 14, true);
29
- if (serial !== void 0 && serial !== stream)
30
- throw invalid();
31
- serial = stream;
32
- const segments = bytes[offset + 26] ?? 0;
33
- let data = offset + 27 + segments;
34
- if (data > bytes.length || Boolean((bytes[offset + 5] ?? 0) & 1) !== length > 0)
35
- throw invalid();
36
- for (let index = 0; index < segments; index++) {
37
- const size = bytes[offset + 27 + index] ?? 0;
38
- if (data + size > bytes.length)
39
- throw invalid();
40
- const take = Math.min(size, 19 - prefix.length);
41
- for (let i = 0; i < take; i++)
42
- prefix.push(bytes[data + i] ?? 0);
43
- length += size;
44
- data += size;
45
- if (size === 255)
46
- continue;
47
- if (packet === 0) {
48
- if (length < 19 || String.fromCharCode(...prefix.slice(0, 8)) !== "OpusHead" || ![1, 2].includes(prefix[9] ?? 0) || prefix[18] !== 0)
49
- throw invalid();
50
- } else if (packet === 1) {
51
- if (length < 8 || String.fromCharCode(...prefix.slice(0, 8)) !== "OpusTags")
52
- throw invalid();
53
- } else {
54
- if (length < 1)
55
- throw invalid();
56
- const toc = prefix[0] ?? 0;
57
- const config = toc >> 3;
58
- const frame = config >= 16 ? 120 << (config & 3) : config >= 12 ? 480 << (config & 1) : (config & 3) === 3 ? 2880 : 480 << (config & 3);
59
- const count = (toc & 3) === 0 ? 1 : (toc & 3) === 3 ? length >= 2 ? (prefix[1] ?? 0) & 63 : 0 : 2;
60
- if (count < 1 || frame * count > 5760)
61
- throw invalid();
62
- }
63
- packet++;
64
- length = 0;
65
- prefix.length = 0;
66
- }
67
- offset = data;
68
- }
69
- if (length !== 0 || packet < 3)
70
- throw invalid();
71
- }, "checkOggDuration");
72
-
73
- // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/speech/recognize.js
74
- var SAMPLE_RATE = 16e3;
75
- var LEAD = SAMPLE_RATE / 2;
76
- var toModelRate = /* @__PURE__ */ __name((samples, rate) => {
77
- const step = rate / SAMPLE_RATE;
78
- const length = Math.floor(samples.length / step);
79
- const pcm = new Float32Array(LEAD + length);
80
- for (let i = 0; i < length; i++) {
81
- const from = Math.floor(i * step);
82
- const to = Math.max(from + 1, Math.floor((i + 1) * step));
83
- let sum = 0;
84
- for (let j = from; j < to; j++)
85
- sum += samples[j] ?? 0;
86
- pcm[LEAD + i] = sum / (to - from);
87
- }
88
- return pcm;
89
- }, "toModelRate");
90
- var decodeOgg = /* @__PURE__ */ __name(async (bytes) => {
91
- checkOggDuration(bytes);
92
- const { OggOpusDecoder } = await importFrom(new URL("speech/recognize.js", import.meta.resolve("@wirecat/cli-core")).href, "ogg-opus-decoder");
93
- const decoder = new OggOpusDecoder();
94
- await decoder.ready;
95
- try {
96
- const { channelData, sampleRate, samplesDecoded } = await decoder.decodeFile(bytes);
97
- if (!channelData[0] || samplesDecoded === 0)
98
- throw new Error("no Ogg Opus audio in it");
99
- return channelData.map((samples) => ({ samples, rate: sampleRate }));
100
- } finally {
101
- decoder.free();
102
- }
103
- }, "decodeOgg");
104
- var WINDOW = 512;
105
- var detector = /* @__PURE__ */ __name((vadModel) => ({
106
- sileroVad: {
107
- model: vadModel,
108
- // At the default 0.5 a quietly spoken stretch in the middle of a voice message never counted as
109
- // speech and was lost; 0.3 keeps it for both models and changes nothing on clear speech (126508, 2026-09-30).
110
- threshold: 0.3,
111
- minSilenceDuration: 0.5,
112
- minSpeechDuration: 0.25,
113
- maxSpeechDuration: 20,
114
- windowSize: WINDOW
115
- },
116
- sampleRate: SAMPLE_RATE,
117
- numThreads: 1,
118
- provider: "cpu",
119
- debug: 0,
120
- bufferSizeInSeconds: 30
121
- }), "detector");
122
- var cut = /* @__PURE__ */ __name((vad, pcm, each) => {
123
- vad.reset();
124
- const last = Math.max(0, pcm.length - LEAD);
125
- const drain = /* @__PURE__ */ __name(() => {
126
- for (; !vad.isEmpty(); vad.pop()) {
127
- const { start, samples } = vad.front();
128
- each({
129
- start: Math.min(last, Math.max(0, start - LEAD)) / SAMPLE_RATE,
130
- end: Math.min(last, Math.max(0, start + samples.length - LEAD)) / SAMPLE_RATE,
131
- samples
132
- });
133
- }
134
- }, "drain");
135
- for (let i = 0; i + WINDOW <= pcm.length; i += WINDOW) {
136
- vad.acceptWaveform(pcm.subarray(i, i + WINDOW));
137
- drain();
138
- }
139
- vad.flush();
140
- drain();
141
- }, "cut");
142
- var openSpeechCutter = /* @__PURE__ */ __name((vadModel) => {
143
- const vad = loadSherpa().createVad(detector(vadModel));
144
- return {
145
- cut: /* @__PURE__ */ __name((pcm) => {
146
- const spans = [];
147
- cut(vad, pcm, ({ start, end }) => spans.push({ start, end }));
148
- return spans;
149
- }, "cut"),
150
- free: /* @__PURE__ */ __name(() => vad.free(), "free")
151
- };
152
- }, "openSpeechCutter");
153
- var loaded;
154
- var loadSherpa = /* @__PURE__ */ __name(() => {
155
- if (loaded)
156
- return loaded;
157
- const load = createRequire(new URL("speech/recognize.js", import.meta.resolve("@wirecat/cli-core")).href);
158
- const wasm = {};
159
- load("sherpa-onnx/sherpa-onnx-wasm-nodejs.js")(wasm);
160
- const stdout = wasm.FS?.getStream(1);
161
- if (stdout)
162
- stdout.nfd = 2;
163
- const asr = load("sherpa-onnx/sherpa-onnx-asr.js");
164
- const vad = load("sherpa-onnx/sherpa-onnx-vad.js");
165
- loaded = {
166
- createOfflineRecognizer: /* @__PURE__ */ __name((config) => new asr.OfflineRecognizer(config, wasm), "createOfflineRecognizer"),
167
- createVad: /* @__PURE__ */ __name((config) => vad.createVad(wasm, config), "createVad")
168
- };
169
- return loaded;
170
- }, "loadSherpa");
171
- var openRecognizer = /* @__PURE__ */ __name((model, path, vadModel) => {
172
- const sherpa = loadSherpa();
173
- const engine = sherpa.createOfflineRecognizer({
174
- featConfig: { sampleRate: SAMPLE_RATE, featureDim: model.featureDim },
175
- modelConfig: { ...model.config(path), numThreads: 1, provider: "cpu", debug: 0 },
176
- decodingMethod: "greedy_search"
177
- });
178
- const vad = sherpa.createVad(detector(vadModel));
179
- const piece = /* @__PURE__ */ __name((samples) => {
180
- const stream = engine.createStream();
181
- try {
182
- stream.acceptWaveform(SAMPLE_RATE, samples);
183
- engine.decode(stream);
184
- return engine.getResult(stream).text.trim();
185
- } finally {
186
- stream.free();
187
- }
188
- }, "piece");
189
- const pieces = /* @__PURE__ */ __name((pcm) => {
190
- const heard = [];
191
- cut(vad, pcm, ({ start, end, samples }) => {
192
- const text = piece(samples);
193
- if (text)
194
- heard.push({ start, end, text });
195
- });
196
- return heard;
197
- }, "pieces");
198
- const piecesUntil = /* @__PURE__ */ __name(async (pcm, signal) => {
199
- const spans = [];
200
- cut(vad, pcm, (span) => spans.push(span));
201
- const heard = [];
202
- for (const { start, end, samples } of spans) {
203
- await new Promise((resolve) => setImmediate(resolve));
204
- signal.throwIfAborted();
205
- const text = piece(samples);
206
- if (text)
207
- heard.push({ start, end, text });
208
- }
209
- return heard;
210
- }, "piecesUntil");
211
- return {
212
- recognize: /* @__PURE__ */ __name((pcm) => pieces(pcm).map(({ text }) => text).join(" "), "recognize"),
213
- pieces,
214
- piecesUntil,
215
- free: /* @__PURE__ */ __name(() => {
216
- vad.free();
217
- engine.free();
218
- }, "free")
219
- };
220
- }, "openRecognizer");
221
-
222
- export {
223
- SAMPLE_RATE,
224
- toModelRate,
225
- decodeOgg,
226
- detector,
227
- openSpeechCutter,
228
- loadSherpa,
229
- openRecognizer
230
- };
@@ -1,388 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- CHECK_EVERY_MS,
5
- isNewer,
6
- readNoticeState,
7
- writeUpdateState
8
- } from "./chunk-VK24UQSD.js";
9
- import {
10
- executableEnvironment,
11
- executableOnPath
12
- } from "./chunk-TY7NDMFY.js";
13
- import {
14
- Command,
15
- Option,
16
- annotate
17
- } from "./chunk-BA5B5ZF4.js";
18
- import {
19
- require_cross_spawn
20
- } from "./chunk-D72URWJE.js";
21
- import {
22
- refuseOwnerHomeInTests
23
- } from "./chunk-2YO3PLOE.js";
24
- import {
25
- CliError
26
- } from "./chunk-S6JG4YUH.js";
27
- import {
28
- __name,
29
- __toESM
30
- } from "./chunk-ZVVMGPBJ.js";
31
-
32
- // node_modules/.pnpm/@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/skill/index.js
33
- import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
34
- import { homedir } from "node:os";
35
- import { basename, dirname, join, relative, resolve, sep } from "node:path";
36
- import { fileURLToPath, pathToFileURL } from "node:url";
37
- var import_cross_spawn = __toESM(require_cross_spawn(), 1);
38
- var SKILL_TARGETS = ["claude", "agents"];
39
- var homeOf = /* @__PURE__ */ __name((env) => {
40
- refuseOwnerHomeInTests(env);
41
- return env.HOME || env.USERPROFILE || homedir();
42
- }, "homeOf");
43
- var skillPath = /* @__PURE__ */ __name((target, appName, env) => join(homeOf(env), target === "claude" ? ".claude" : ".agents", "skills", appName, "SKILL.md"), "skillPath");
44
- var FRONTMATTER = /^---(\r?\n)([\s\S]*?\r?\n)?---(\r?\n|$)/;
45
- var scalar = /* @__PURE__ */ __name((key, indent) => new RegExp(`^${indent}${key}:[ \\t]*["']?([^"'\\r\\n]*?)["']?[ \\t]*\\r?\\n?$`), "scalar");
46
- var frontmatterLines = /* @__PURE__ */ __name((content) => (FRONTMATTER.exec(content)?.[2] ?? "").split(/(?<=\n)/), "frontmatterLines");
47
- var metadataBlock = /* @__PURE__ */ __name((lines) => {
48
- const start = lines.findIndex((line) => /^metadata:/.test(line));
49
- if (start === -1)
50
- return void 0;
51
- if (!/^metadata:[ \t]*\r?\n?$/.test(lines[start])) {
52
- throw new CliError("configuration_error", "SKILL.md: write `metadata` as an indented block, not on one line");
53
- }
54
- let end = start + 1;
55
- while (end < lines.length && /^[ \t]/.test(lines[end]))
56
- end++;
57
- return [start, end];
58
- }, "metadataBlock");
59
- var skillVersion = /* @__PURE__ */ __name((content) => {
60
- const lines = frontmatterLines(content);
61
- const block = metadataBlock(lines);
62
- const nested = block && lines.slice(block[0] + 1, block[1]).find((line2) => scalar("version", "[ \\t]+").test(line2));
63
- const line = nested ?? lines.find((line2) => scalar("version", "").test(line2));
64
- return line === void 0 ? void 0 : scalar("version", "[ \\t]*").exec(line)?.[1];
65
- }, "skillVersion");
66
- var skillName = /* @__PURE__ */ __name((content) => {
67
- const line = frontmatterLines(content).find((line2) => scalar("name", "").test(line2));
68
- return line === void 0 ? void 0 : scalar("name", "").exec(line)?.[1];
69
- }, "skillName");
70
- var withVersion = /* @__PURE__ */ __name((content, version) => {
71
- const match = FRONTMATTER.exec(content);
72
- if (!match)
73
- return `---
74
- metadata:
75
- version: "${version}"
76
- ---
77
- ${content}`;
78
- const [whole, eol = "\n", body = "", close = ""] = match;
79
- const lines = body.split(/(?<=\n)/).filter((line) => line !== "");
80
- const block = metadataBlock(lines);
81
- if (!block) {
82
- lines.push(`metadata:${eol}`, ` version: "${version}"${eol}`);
83
- } else {
84
- const [start, end] = block;
85
- const indent = /^[ \t]+/.exec(lines[start + 1] ?? "")?.[0] ?? " ";
86
- const at = lines.slice(start + 1, end).findIndex((line) => scalar("version", "[ \\t]+").test(line));
87
- if (at === -1)
88
- lines.splice(start + 1, 0, `${indent}version: "${version}"${eol}`);
89
- else {
90
- const old = lines[start + 1 + at];
91
- const lineEol = /\r?\n$/.exec(old)?.[0] ?? "";
92
- lines[start + 1 + at] = `${/^[ \t]+/.exec(old)?.[0]}version: "${version}"${lineEol}`;
93
- }
94
- }
95
- return `---${eol}${lines.join("")}---${close}${content.slice(whole.length)}`;
96
- }, "withVersion");
97
- var skillFiles = /* @__PURE__ */ __name((skill) => {
98
- const root = dirname(fileURLToPath(skill));
99
- const found = [];
100
- const walk = /* @__PURE__ */ __name((folder) => {
101
- for (const entry of readdirSync(folder, { withFileTypes: true })) {
102
- if (entry.name.startsWith("."))
103
- continue;
104
- const path = join(folder, entry.name);
105
- if (entry.isDirectory())
106
- walk(path);
107
- else if (entry.isFile() && path !== join(root, "SKILL.md"))
108
- found.push(relative(root, path).split(sep).join("/"));
109
- }
110
- }, "walk");
111
- walk(root);
112
- return found.sort();
113
- }, "skillFiles");
114
- var writeSkillFolder = /* @__PURE__ */ __name((app, skill, folder) => {
115
- const source = readFileSync(skill, "utf8");
116
- const name = skillName(source);
117
- if (name !== app.appName) {
118
- throw new CliError("configuration_error", `SKILL.md is named ${name === void 0 ? "nothing" : `"${name}"`}, but installs into a directory "${app.appName}"; the two must match`);
119
- }
120
- const root = dirname(fileURLToPath(skill));
121
- for (const file of skillFiles(skill)) {
122
- const target = join(folder, file);
123
- mkdirSync(dirname(target), { recursive: true });
124
- writeFileSync(target, readFileSync(join(root, file)));
125
- }
126
- const path = join(folder, "SKILL.md");
127
- mkdirSync(folder, { recursive: true });
128
- writeFileSync(path, withVersion(source, app.version));
129
- return path;
130
- }, "writeSkillFolder");
131
- var installSkill = /* @__PURE__ */ __name((app, skill, { targets = SKILL_TARGETS, env = process.env } = {}) => targets.map((target) => writeSkillFolder(app, skill, dirname(skillPath(target, app.appName, env)))), "installSkill");
132
- var skillStatus = /* @__PURE__ */ __name((app, env = process.env) => SKILL_TARGETS.map((target) => {
133
- const path = skillPath(target, app.appName, env);
134
- return { target, ...copyStatus(app, path) ?? { path, installed: null, state: "missing" } };
135
- }), "skillStatus");
136
- var copyStatus = /* @__PURE__ */ __name((app, path) => {
137
- let content;
138
- try {
139
- content = readFileSync(path, "utf8");
140
- } catch {
141
- return void 0;
142
- }
143
- const installed = skillVersion(content);
144
- if (installed === void 0)
145
- return { path, installed: null, state: "unversioned" };
146
- return { path, installed, state: isNewer(app.version, installed) ? "stale" : "current" };
147
- }, "copyStatus");
148
- var runProgram = /* @__PURE__ */ __name((file, args, env) => {
149
- const result = import_cross_spawn.default.sync(executableOnPath(file, env), [...args], {
150
- encoding: "utf8",
151
- timeout: 3e4,
152
- maxBuffer: 256e3,
153
- env: executableEnvironment(env)
154
- });
155
- return { status: result.status, ...result.error ? { error: result.error } : {}, stdout: result.stdout ?? "" };
156
- }, "runProgram");
157
- var hermesHome = /* @__PURE__ */ __name((env, platform = process.platform) => {
158
- refuseOwnerHomeInTests(env, platform);
159
- const set = env.HERMES_HOME?.trim();
160
- if (set)
161
- return set;
162
- if (platform === "win32")
163
- return join(env.LOCALAPPDATA || join(homeOf(env), "AppData", "Local"), "hermes");
164
- return join(homeOf(env), ".hermes");
165
- }, "hermesHome");
166
- var hermesCopyPath = /* @__PURE__ */ __name((appName, env) => join(hermesHome(env), "skills", appName, "SKILL.md"), "hermesCopyPath");
167
- var EXTERNAL_DIRS = "skills.external_dirs";
168
- var externalDirs = /* @__PURE__ */ __name((env, run) => {
169
- const answer = run("hermes", ["config", "get", EXTERNAL_DIRS, "--json"], env);
170
- if (answer.error || answer.status !== 0)
171
- return void 0;
172
- let value;
173
- try {
174
- value = JSON.parse(answer.stdout);
175
- } catch {
176
- return void 0;
177
- }
178
- if (value === null)
179
- return [];
180
- if (typeof value === "string")
181
- return [value];
182
- return Array.isArray(value) && value.every((entry) => typeof entry === "string") ? value : void 0;
183
- }, "externalDirs");
184
- var expanded = /* @__PURE__ */ __name((entry, env) => resolve(entry.replace(/^~(?=$|[\\/])/, homeOf(env)).replace(/\$\{(\w+)\}|\$(\w+)/g, (whole, braced, bare) => env[braced ?? bare ?? ""] ?? whole)), "expanded");
185
- var lists = /* @__PURE__ */ __name((dirs, folder, env) => dirs.some((entry) => expanded(entry, env) === resolve(folder)), "lists");
186
- var removeOwnCopy = /* @__PURE__ */ __name((app, skill, env) => {
187
- const path = hermesCopyPath(app.appName, env);
188
- const shipped = new Set(skillFiles(skill));
189
- const top = /* @__PURE__ */ new Set(["SKILL.md", ...[...shipped].map((file) => file.split("/")[0])]);
190
- try {
191
- if (!readdirSync(dirname(path)).every((entry) => top.has(entry)))
192
- return void 0;
193
- if (!skillFiles(pathToFileURL(path)).every((file) => shipped.has(file)))
194
- return void 0;
195
- if (skillName(readFileSync(path, "utf8")) !== app.appName)
196
- return void 0;
197
- rmSync(dirname(path), { recursive: true });
198
- return path;
199
- } catch {
200
- return void 0;
201
- }
202
- }, "removeOwnCopy");
203
- var readFolder = /* @__PURE__ */ __name((folder, env, run) => {
204
- const dirs = externalDirs(env, run);
205
- if (dirs === void 0)
206
- return "Hermes could not be asked for skills.external_dirs";
207
- if (lists(dirs, folder, env))
208
- return void 0;
209
- const set = run("hermes", ["config", "set", EXTERNAL_DIRS, JSON.stringify([...dirs, folder])], env);
210
- if (set.error || set.status !== 0)
211
- return "hermes config set failed";
212
- const after = externalDirs(env, run);
213
- return after !== void 0 && lists(after, folder, env) ? void 0 : "Hermes did not keep the folder";
214
- }, "readFolder");
215
- var installHermesSkill = /* @__PURE__ */ __name((app, skill, { env = process.env, run = runProgram } = {}) => {
216
- if (!existsSync(hermesHome(env)) && run("hermes", ["--version"], env).error)
217
- throw new CliError("not_found", "Hermes is not installed here; install Hermes first, or set HERMES_HOME");
218
- const [shared] = installSkill(app, skill, { targets: ["agents"], env });
219
- const reason = readFolder(dirname(dirname(shared)), env, run);
220
- if (reason === void 0) {
221
- const removed = removeOwnCopy(app, skill, env);
222
- return { written: [shared], hermes: { via: "external_dirs", path: shared, ...removed ? { removed } : {} } };
223
- }
224
- const copy = writeSkillFolder(app, skill, dirname(hermesCopyPath(app.appName, env)));
225
- return { written: [shared, copy], hermes: { via: "copy", path: copy, reason } };
226
- }, "installHermesSkill");
227
- var hermesSkillStatus = /* @__PURE__ */ __name((app, { env = process.env, run = runProgram } = {}) => {
228
- const own = copyStatus(app, hermesCopyPath(app.appName, env));
229
- if (own)
230
- return { ...own, via: "copy" };
231
- const shared = skillPath("agents", app.appName, env);
232
- const dirs = existsSync(hermesHome(env)) ? externalDirs(env, run) : void 0;
233
- const read = dirs !== void 0 && lists(dirs, dirname(dirname(shared)), env) ? copyStatus(app, shared) : void 0;
234
- if (read)
235
- return { ...read, via: "external_dirs" };
236
- return { path: shared, installed: null, state: "missing", via: null };
237
- }, "hermesSkillStatus");
238
- var skillParts = /* @__PURE__ */ __name((skill) => {
239
- try {
240
- return Object.fromEntries(skillFiles(skill).filter((file) => file.endsWith(".md")).reverse().map((file) => [basename(file, ".md"), new URL(file, skill)]));
241
- } catch {
242
- return {};
243
- }
244
- }, "skillParts");
245
- var skillCommand = /* @__PURE__ */ __name((app, skill, environment, more = {}) => {
246
- const command = new Command("skill").description("the instructions an agent is given for this tool");
247
- const machine = /* @__PURE__ */ __name((self) => {
248
- const { json, jsonl } = self.optsWithGlobals();
249
- return json === true || jsonl === true;
250
- }, "machine");
251
- const shown = { ...skillParts(skill), ...more };
252
- const named = Object.keys(shown);
253
- const show = annotate(command.command("show"), { effects: { remote: "none", local: "read" } }).summary("print the tool's instructions for AI agents").description(`print SKILL.md \u2014 \`${app.command} skill install\` puts it where Claude Code, Codex, Gemini CLI and OpenClaw look for it, and where Hermes does on request; --for prints the copy already there`);
254
- if (named.length > 0)
255
- show.argument("[name]", `a part of this skill, or a skill shipped for a task: ${named.join(", ")}`);
256
- show.addOption(new Option("--for <agents>", "print the copy installed for these agents instead of this version's").choices(SKILL_TARGETS));
257
- show.action(function(given) {
258
- const name = typeof given === "string" ? given : void 0;
259
- const { renderer, streams, env } = environment(this);
260
- const { for: target } = this.opts();
261
- if (target !== void 0) {
262
- if (name !== void 0)
263
- throw new CliError("validation_error", `only ${app.appName} is installed; leave out "${name}" with --for`);
264
- const path = skillPath(target, app.appName, env ?? process.env);
265
- let content2;
266
- try {
267
- content2 = readFileSync(path, "utf8").trimEnd();
268
- } catch {
269
- throw new CliError("not_found", `no skill is installed for ${target} at ${path} \u2014 \`${app.command} skill install --for ${target}\` writes it`);
270
- }
271
- if (machine(this))
272
- renderer.result({ name: app.appName, target, path, installed: skillVersion(content2) ?? null, content: content2 });
273
- else
274
- streams.data(content2);
275
- return;
276
- }
277
- const source = name === void 0 ? skill : shown[name];
278
- if (!source) {
279
- throw new CliError("validation_error", `no skill "${name}" \u2014 there are: ${named.join(", ")}`);
280
- }
281
- const content = name === void 0 ? readFileSync(source, "utf8").trimEnd() : readFileSync(source, "utf8").trimEnd().replaceAll("{{command}}", app.command);
282
- if (machine(this))
283
- renderer.result({ name: name ?? app.appName, content });
284
- else
285
- streams.data(content);
286
- });
287
- annotate(command.command("install"), { effects: { remote: "none", local: "write" } }).summary("install the tool's instructions for AI agents").description(`write SKILL.md to ~/.claude/skills/${app.appName}/ (Claude Code) and ~/.agents/skills/${app.appName}/ (Codex, Gemini CLI, OpenClaw); --for hermes also has Hermes read ~/.agents/skills, which changes Hermes's own settings, so all leaves it out`).addOption(new Option("--for <agents>", "which agents to install for").choices(["claude", "agents", "hermes", "all"]).default("all")).action(function({ for: chosen }) {
288
- const { renderer, env } = environment(this);
289
- if (chosen === "hermes") {
290
- const { written: written2, hermes } = installHermesSkill(app, skill, env ? { env } : {});
291
- renderer.result({ name: app.appName, version: app.version, written: written2, hermes });
292
- renderer.success(hermes.via === "external_dirs" ? `${app.appName} ${app.version} skill installed: ${hermes.path}; Hermes reads ${dirname(dirname(hermes.path))} (skills.external_dirs)` : `${app.appName} ${app.version} skill installed: ${hermes.path}, a copy for Hermes (${hermes.reason})`);
293
- if (hermes.removed)
294
- renderer.note(`removed the earlier copy Hermes would also have found: ${hermes.removed}`);
295
- return;
296
- }
297
- const targets = chosen === "all" ? SKILL_TARGETS : [chosen];
298
- const written = installSkill(app, skill, { targets, ...env ? { env } : {} });
299
- renderer.result({ name: app.appName, version: app.version, written });
300
- renderer.success(`${app.appName} ${app.version} skill installed: ${written.join(", ")}`);
301
- });
302
- annotate(command.command("status"), {
303
- effects: { remote: "none", local: "read" },
304
- examples: [`${app.command} skill status`, `${app.command} skill status --json`]
305
- }).summary("whether the installed instructions for AI agents match this version").description(`for each place \`${app.command} skill install\` writes to, and for the copy Hermes reads: the path, the version installed there, and whether it is current, stale, missing or unversioned`).action(function() {
306
- const { renderer, env } = environment(this);
307
- const targets = skillStatus(app, env ?? process.env);
308
- const hermes = hermesSkillStatus(app, env ? { env } : {});
309
- renderer.result({ name: app.appName, version: app.version, targets, hermes });
310
- });
311
- return command;
312
- }, "skillCommand");
313
- var isAgent = /* @__PURE__ */ __name((env) => Boolean(env.AI_AGENT || env.CLAUDECODE), "isAgent");
314
- var needsInstall = /* @__PURE__ */ __name((app, env) => {
315
- const states = skillStatus(app, env).map(({ state }) => state);
316
- return states.every((state) => state === "missing") || states.some((state) => state === "stale" || state === "unversioned");
317
- }, "needsInstall");
318
- var skillHint = /* @__PURE__ */ __name(({ app, argv, env, statePath, enabled = true, now = Date.now }) => {
319
- try {
320
- if (!enabled || !isAgent(env))
321
- return void 0;
322
- if (argv.includes("skill") || argv.includes("complete"))
323
- return void 0;
324
- const at = now();
325
- const shown = readNoticeState(statePath).skillHintAt;
326
- if (shown !== void 0 && at - shown < CHECK_EVERY_MS)
327
- return void 0;
328
- if (!needsInstall(app, env))
329
- return void 0;
330
- writeUpdateState(statePath, { skillHintAt: at });
331
- return `agents: \`${app.command} skill install\` installs this tool's guide`;
332
- } catch {
333
- return void 0;
334
- }
335
- }, "skillHint");
336
- var skillResource = /* @__PURE__ */ __name((app, skill) => {
337
- const uri = `${app.command}://skill`;
338
- return {
339
- uri,
340
- name: "skill",
341
- title: `${app.appName} SKILL.md`,
342
- description: `How to use ${app.command}: the guide an agent is given for this tool.`,
343
- mimeType: "text/markdown",
344
- read: /* @__PURE__ */ __name(() => ({ contents: [{ uri, mimeType: "text/markdown", text: readFileSync(skill, "utf8") }] }), "read"),
345
- instruction: `- The full guide is the resource ${uri}; \`${app.command} skill install\` installs it as an agent skill.`
346
- };
347
- }, "skillResource");
348
- var skillResources = /* @__PURE__ */ __name((app, skill) => {
349
- const main = skillResource(app, skill);
350
- let parts = [];
351
- try {
352
- parts = skillFiles(skill).filter((file) => file.endsWith(".md"));
353
- } catch {
354
- }
355
- if (parts.length === 0)
356
- return [main];
357
- return [
358
- {
359
- ...main,
360
- instruction: `- The guide is the resource ${main.uri}; the parts it links are ${main.uri}/<path>, read only the one a task needs. \`${app.command} skill install\` installs it as an agent skill.`
361
- },
362
- ...parts.map((file) => {
363
- const uri = `${main.uri}/${file}`;
364
- return {
365
- uri,
366
- name: `skill/${file}`,
367
- title: `${app.appName} ${file}`,
368
- description: `A part of the ${app.command} guide that ${main.uri} links to.`,
369
- mimeType: "text/markdown",
370
- read: /* @__PURE__ */ __name(() => ({
371
- contents: [{ uri, mimeType: "text/markdown", text: readFileSync(new URL(file, skill), "utf8") }]
372
- }), "read"),
373
- instruction: ""
374
- };
375
- })
376
- ];
377
- }, "skillResources");
378
-
379
- export {
380
- skillVersion,
381
- writeSkillFolder,
382
- installSkill,
383
- skillStatus,
384
- hermesCopyPath,
385
- skillCommand,
386
- skillHint,
387
- skillResources
388
- };
@@ -1,18 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- __name
5
- } from "./chunk-ZVVMGPBJ.js";
6
-
7
- // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/stdin-field.js
8
- var fields = /* @__PURE__ */ new WeakMap();
9
- var readsStdin = /* @__PURE__ */ __name((command, field) => {
10
- fields.set(command, field);
11
- return command;
12
- }, "readsStdin");
13
- var stdinFieldOf = /* @__PURE__ */ __name((command) => fields.get(command), "stdinFieldOf");
14
-
15
- export {
16
- readsStdin,
17
- stdinFieldOf
18
- };