@wirecat/mail-cli 0.37.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 (392) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +9 -7
  3. package/contracts/wirecat.json +64 -2
  4. package/dist/bin/mail.js +11 -11
  5. package/dist/bundle/{chunk-BNURKCQG.js → chunk-BXH2YUBR.js} +33 -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 +29 -5
  29. package/dist/commands/tags.js +1 -2
  30. package/dist/config.js +1 -1
  31. package/dist/identity.js +27 -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-as.js +66 -0
  39. package/dist/mail/send.js +4 -2
  40. package/dist/oauth.js +1 -3
  41. package/dist/profile.js +1 -1
  42. package/dist/program.js +1 -2
  43. package/dist/providers.js +4 -4
  44. package/dist/store.js +1 -1
  45. package/dist/version.js +1 -1
  46. package/package.json +5 -5
  47. package/dist/bin/mail.d.ts +0 -3
  48. package/dist/bin/mail.d.ts.map +0 -1
  49. package/dist/bin/mail.js.map +0 -1
  50. package/dist/bundle/agent-OU4K7TKQ.js +0 -40
  51. package/dist/bundle/all-profiles-ICGWDPUU.js +0 -320
  52. package/dist/bundle/anthropic-TL4WFWGU.js +0 -90
  53. package/dist/bundle/app-server-YAR5EFOO.js +0 -256
  54. package/dist/bundle/bun-OPDGMZZQ.js +0 -169
  55. package/dist/bundle/bun-sqlite-WI3ZPANS.js +0 -75
  56. package/dist/bundle/chunk-2JHVQMVC.js +0 -16
  57. package/dist/bundle/chunk-2XBDILVW.js +0 -53
  58. package/dist/bundle/chunk-2YO3PLOE.js +0 -2843
  59. package/dist/bundle/chunk-3DHJF57U.js +0 -690
  60. package/dist/bundle/chunk-3HC5F3P7.js +0 -24
  61. package/dist/bundle/chunk-3SKTQ2HC.js +0 -288
  62. package/dist/bundle/chunk-3YM4B2GT.js +0 -63
  63. package/dist/bundle/chunk-3ZOOTTFW.js +0 -1007
  64. package/dist/bundle/chunk-4FTIHADB.js +0 -259
  65. package/dist/bundle/chunk-4IZ6R5FS.js +0 -730
  66. package/dist/bundle/chunk-4N7PP76S.js +0 -6848
  67. package/dist/bundle/chunk-7HRKUKKY.js +0 -1068
  68. package/dist/bundle/chunk-7PDGZFXD.js +0 -133
  69. package/dist/bundle/chunk-7YKWFERX.js +0 -330
  70. package/dist/bundle/chunk-BNVISIHP.js +0 -95
  71. package/dist/bundle/chunk-BQMJYSA4.js +0 -360
  72. package/dist/bundle/chunk-BYITYTRL.js +0 -86
  73. package/dist/bundle/chunk-CICUPYHT.js +0 -106
  74. package/dist/bundle/chunk-CQHLWMKK.js +0 -1333
  75. package/dist/bundle/chunk-CUW7Y2HJ.js +0 -334
  76. package/dist/bundle/chunk-D72URWJE.js +0 -532
  77. package/dist/bundle/chunk-DFDN6AUB.js +0 -21
  78. package/dist/bundle/chunk-DJZIFZOT.js +0 -52
  79. package/dist/bundle/chunk-DNCLQPOM.js +0 -7
  80. package/dist/bundle/chunk-DPV53EZC.js +0 -206
  81. package/dist/bundle/chunk-DTR7JO2M.js +0 -794
  82. package/dist/bundle/chunk-ES2FF42M.js +0 -2470
  83. package/dist/bundle/chunk-EV72K4IU.js +0 -274
  84. package/dist/bundle/chunk-EZQ5BYNL.js +0 -338
  85. package/dist/bundle/chunk-F2D3J5DR.js +0 -188
  86. package/dist/bundle/chunk-FTT7UDYV.js +0 -80
  87. package/dist/bundle/chunk-FXNCKPQ7.js +0 -64
  88. package/dist/bundle/chunk-G4VJN75G.js +0 -806
  89. package/dist/bundle/chunk-GGMAIIVE.js +0 -38
  90. package/dist/bundle/chunk-GPUC3FTU.js +0 -195
  91. package/dist/bundle/chunk-GQIMVR7C.js +0 -3752
  92. package/dist/bundle/chunk-HCRUGAIN.js +0 -1024
  93. package/dist/bundle/chunk-HES6YMYN.js +0 -161
  94. package/dist/bundle/chunk-HFY7536N.js +0 -9510
  95. package/dist/bundle/chunk-HTQTIKWP.js +0 -928
  96. package/dist/bundle/chunk-IA7LLLEI.js +0 -100
  97. package/dist/bundle/chunk-IUJDWEGJ.js +0 -615
  98. package/dist/bundle/chunk-IWFWWO37.js +0 -364
  99. package/dist/bundle/chunk-JG6LCSEX.js +0 -407
  100. package/dist/bundle/chunk-JLXXUEAM.js +0 -72
  101. package/dist/bundle/chunk-JNP3XGJI.js +0 -559
  102. package/dist/bundle/chunk-JZUYZ2XJ.js +0 -2076
  103. package/dist/bundle/chunk-K4DEQAEW.js +0 -1291
  104. package/dist/bundle/chunk-KCM3WSER.js +0 -388
  105. package/dist/bundle/chunk-KP5JDYY6.js +0 -2669
  106. package/dist/bundle/chunk-KUX54EGR.js +0 -40792
  107. package/dist/bundle/chunk-KXJ3JEDH.js +0 -2
  108. package/dist/bundle/chunk-KZD3H5QA.js +0 -108
  109. package/dist/bundle/chunk-LKH3UKLO.js +0 -230
  110. package/dist/bundle/chunk-NAOLBEFX.js +0 -12142
  111. package/dist/bundle/chunk-NB52JKLR.js +0 -323
  112. package/dist/bundle/chunk-NB7EOAUZ.js +0 -123
  113. package/dist/bundle/chunk-NISH4UXM.js +0 -58
  114. package/dist/bundle/chunk-NQSKI7XK.js +0 -52
  115. package/dist/bundle/chunk-OWPRJLHV.js +0 -353
  116. package/dist/bundle/chunk-OZKZT3ZI.js +0 -79
  117. package/dist/bundle/chunk-PL5P7UKW.js +0 -25216
  118. package/dist/bundle/chunk-Q7ICVP25.js +0 -18
  119. package/dist/bundle/chunk-QLJGYDWG.js +0 -1197
  120. package/dist/bundle/chunk-R44KVISE.js +0 -218
  121. package/dist/bundle/chunk-R73VWPNL.js +0 -192
  122. package/dist/bundle/chunk-RRTMPSQR.js +0 -29
  123. package/dist/bundle/chunk-S6JG4YUH.js +0 -72
  124. package/dist/bundle/chunk-TMJLGR4A.js +0 -4070
  125. package/dist/bundle/chunk-TXDR6YSF.js +0 -23
  126. package/dist/bundle/chunk-TY7NDMFY.js +0 -46
  127. package/dist/bundle/chunk-UDSL3MUU.js +0 -2333
  128. package/dist/bundle/chunk-UTS5NMR3.js +0 -54
  129. package/dist/bundle/chunk-VB7FZOYX.js +0 -633
  130. package/dist/bundle/chunk-VK24UQSD.js +0 -142
  131. package/dist/bundle/chunk-VYCB5EVI.js +0 -721
  132. package/dist/bundle/chunk-VZ5PPYDG.js +0 -77
  133. package/dist/bundle/chunk-WOPVBRPV.js +0 -29
  134. package/dist/bundle/chunk-XEQQJBBO.js +0 -92
  135. package/dist/bundle/chunk-XQUUANA2.js +0 -24600
  136. package/dist/bundle/chunk-XWBTD2WP.js +0 -76
  137. package/dist/bundle/chunk-XXPJF2VD.js +0 -2
  138. package/dist/bundle/chunk-Y5E2WNWB.js +0 -35
  139. package/dist/bundle/chunk-YODGIMMM.js +0 -185
  140. package/dist/bundle/chunk-YWDFYQOU.js +0 -82
  141. package/dist/bundle/chunk-Z4BLNAWI.js +0 -67228
  142. package/dist/bundle/chunk-ZSAPOC7B.js +0 -1247
  143. package/dist/bundle/chunk-ZTWTEXB2.js +0 -170
  144. package/dist/bundle/chunk-ZVVMGPBJ.js +0 -50
  145. package/dist/bundle/command-contract-UC6IGCCM.js +0 -39
  146. package/dist/bundle/command-server-entry-RA3ZX2KV.js +0 -168
  147. package/dist/bundle/decode-QVKRSRVF.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-ITIXJAXK.js +0 -317
  151. package/dist/bundle/dist-PAKDDIBT.js +0 -191
  152. package/dist/bundle/echarts-O3TNDAXJ.js +0 -42501
  153. package/dist/bundle/embed-2HOODFQT.js +0 -37
  154. package/dist/bundle/embedder-22AJGCZX.js +0 -110
  155. package/dist/bundle/failure-D4FGOIWF.js +0 -24
  156. package/dist/bundle/first-run-FU4MFXOA.js +0 -28
  157. package/dist/bundle/first-screen-A7SEI2ON.js +0 -40
  158. package/dist/bundle/instructions-AMH5RWVJ.js +0 -11
  159. package/dist/bundle/mcp-5HFPWC3W.js +0 -167
  160. package/dist/bundle/meeting-combined-KC6YGWA7.js +0 -24
  161. package/dist/bundle/meeting-model-QWGAOQHL.js +0 -24
  162. package/dist/bundle/meeting-semantic-7PVO6RNB.js +0 -21
  163. package/dist/bundle/node-EGMCBAO7.js +0 -176
  164. package/dist/bundle/node-KM3CUABH.js +0 -2340
  165. package/dist/bundle/node-TLZSIHIJ.js +0 -21
  166. package/dist/bundle/node-sqlite-JXUELLMP.js +0 -73
  167. package/dist/bundle/oauth-OYAYWH4K.js +0 -19
  168. package/dist/bundle/open-GLEUJGNA.js +0 -22
  169. package/dist/bundle/openai-PYTVNB6L.js +0 -237
  170. package/dist/bundle/process-SGHEN6MQ.js +0 -91
  171. package/dist/bundle/program-7CFNZ2DF.js +0 -51701
  172. package/dist/bundle/prompt-CYTILD7N.js +0 -16
  173. package/dist/bundle/public-XWMXEGEF.js +0 -196
  174. package/dist/bundle/recognize-26UNETSQ.js +0 -25
  175. package/dist/bundle/remote-PKXBQA5N.js +0 -30
  176. package/dist/bundle/rerank-LLKP7M6Q.js +0 -51
  177. package/dist/bundle/serve-ZRJEAPJI.js +0 -198
  178. package/dist/bundle/server-4OQ4G5JY.js +0 -218
  179. package/dist/bundle/server-VVRQ4A34.js +0 -86
  180. package/dist/bundle/sqlite-runtime-667VV4VY.js +0 -19
  181. package/dist/bundle/state-V3CAAJBE.js +0 -35
  182. package/dist/bundle/store-BJCIMIAH.js +0 -302
  183. package/dist/bundle/store-GLBBY4OZ.js +0 -184
  184. package/dist/bundle/store-maintenance-command-N7L5OVUE.js +0 -73
  185. package/dist/bundle/surface-26EUQNDT.js +0 -72
  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.d.ts +0 -76
  361. package/dist/mail/send.d.ts.map +0 -1
  362. package/dist/mail/send.js.map +0 -1
  363. package/dist/mail/smtp.d.ts +0 -4
  364. package/dist/mail/smtp.d.ts.map +0 -1
  365. package/dist/mail/smtp.js.map +0 -1
  366. package/dist/oauth.d.ts +0 -75
  367. package/dist/oauth.d.ts.map +0 -1
  368. package/dist/oauth.js.map +0 -1
  369. package/dist/profile.d.ts +0 -20
  370. package/dist/profile.d.ts.map +0 -1
  371. package/dist/profile.js.map +0 -1
  372. package/dist/program.d.ts +0 -6
  373. package/dist/program.d.ts.map +0 -1
  374. package/dist/program.js.map +0 -1
  375. package/dist/providers.d.ts +0 -255
  376. package/dist/providers.d.ts.map +0 -1
  377. package/dist/providers.js.map +0 -1
  378. package/dist/reasons.d.ts +0 -9
  379. package/dist/reasons.d.ts.map +0 -1
  380. package/dist/reasons.js.map +0 -1
  381. package/dist/secret.d.ts +0 -31
  382. package/dist/secret.d.ts.map +0 -1
  383. package/dist/secret.js.map +0 -1
  384. package/dist/store.d.ts +0 -12
  385. package/dist/store.d.ts.map +0 -1
  386. package/dist/store.js.map +0 -1
  387. package/dist/version.d.ts +0 -2
  388. package/dist/version.d.ts.map +0 -1
  389. package/dist/version.js.map +0 -1
  390. package/dist/wcat.d.ts +0 -3
  391. package/dist/wcat.d.ts.map +0 -1
  392. package/dist/wcat.js.map +0 -1
@@ -1,407 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- CliError
5
- } from "./chunk-S6JG4YUH.js";
6
- import {
7
- __name
8
- } from "./chunk-ZVVMGPBJ.js";
9
-
10
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/files/ordinary-file.js
11
- import { constants } from "node:fs";
12
- import { lstat, open } from "node:fs/promises";
13
- var deviceOf = /* @__PURE__ */ __name((dev) => process.platform === "win32" ? BigInt.asUintN(32, dev) : dev, "deviceOf");
14
- var sameIdentity = /* @__PURE__ */ __name((left, right) => left.ino === right.ino && deviceOf(left.dev) === deviceOf(right.dev), "sameIdentity");
15
- var openOrdinaryFile = /* @__PURE__ */ __name(async (path, options = {}) => {
16
- const before = await lstat(path, { bigint: true });
17
- if (before.isSymbolicLink())
18
- throw new CliError("validation_error", "archive path must be an ordinary file without a symlink");
19
- if (!before.isFile())
20
- throw new CliError("validation_error", "archive path must be an ordinary file");
21
- const access = options.writable ? constants.O_RDWR : constants.O_RDONLY;
22
- const flags = process.platform === "win32" ? access : access | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0);
23
- const file = await open(path, flags);
24
- try {
25
- const opened = await file.stat({ bigint: true });
26
- const after = await lstat(path, { bigint: true });
27
- if (!opened.isFile() || !after.isFile() || before.ino !== opened.ino || before.ino !== after.ino)
28
- throw new CliError("validation_error", "archive file changed while opening");
29
- if (process.platform === "win32" && before.dev === 0n && after.dev === 0n) {
30
- const witness = await open(path, flags);
31
- try {
32
- const identified = await witness.stat({ bigint: true });
33
- const final = await lstat(path, { bigint: true });
34
- if (opened.dev === 0n || !identified.isFile() || !final.isFile() || !sameIdentity(identified, opened) || final.ino !== before.ino || final.dev !== 0n && deviceOf(final.dev) !== deviceOf(opened.dev))
35
- throw new CliError("validation_error", "archive file changed while opening");
36
- } finally {
37
- await witness.close();
38
- }
39
- } else if (deviceOf(before.dev) !== deviceOf(opened.dev) || deviceOf(before.dev) !== deviceOf(after.dev)) {
40
- throw new CliError("validation_error", "archive file changed while opening");
41
- }
42
- return file;
43
- } catch (error) {
44
- await file.close();
45
- throw error;
46
- }
47
- }, "openOrdinaryFile");
48
- var sameOrdinaryFile = /* @__PURE__ */ __name(async (path, created) => {
49
- let file;
50
- try {
51
- file = await openOrdinaryFile(path);
52
- } catch (error) {
53
- if (error instanceof CliError || typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT")
54
- return false;
55
- throw error;
56
- }
57
- try {
58
- return sameIdentity(created, await file.stat({ bigint: true }));
59
- } finally {
60
- await file.close();
61
- }
62
- }, "sameOrdinaryFile");
63
- var syncDirectory = /* @__PURE__ */ __name(async (path) => {
64
- if (process.platform === "win32")
65
- return;
66
- const directory = await open(path, constants.O_RDONLY | (constants.O_DIRECTORY ?? 0) | (constants.O_NOFOLLOW ?? 0));
67
- try {
68
- if (!(await directory.stat()).isDirectory())
69
- throw new CliError("validation_error", "archive publication directory must be ordinary");
70
- await directory.sync();
71
- } finally {
72
- await directory.close();
73
- }
74
- }, "syncDirectory");
75
-
76
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/files/atomic-write.js
77
- import { randomUUID } from "node:crypto";
78
- import { constants as constants2 } from "node:fs";
79
- import { link, open as open2, realpath, rename, unlink } from "node:fs/promises";
80
- import { basename, dirname, join } from "node:path";
81
- var openFolder = /* @__PURE__ */ __name((folder) => process.platform === "win32" ? Promise.resolve(void 0) : open2(folder, constants2.O_RDONLY | (constants2.O_DIRECTORY ?? 0) | (constants2.O_NOFOLLOW ?? 0)), "openFolder");
82
- var writeFileAtomic = /* @__PURE__ */ __name(async (path, content, { mode = 384, overwrite = true, signal, beforePublish } = {}) => {
83
- signal?.throwIfAborted();
84
- const folder = await realpath(dirname(path));
85
- const target = join(folder, basename(path));
86
- const directory = await openFolder(folder);
87
- try {
88
- const temporary = join(folder, `.${basename(path)}.${randomUUID()}.tmp`);
89
- let handle = await open2(temporary, "wx", mode);
90
- let published = false;
91
- try {
92
- await handle.writeFile(content);
93
- await handle.sync();
94
- await handle.close();
95
- handle = void 0;
96
- signal?.throwIfAborted();
97
- await beforePublish?.();
98
- if (overwrite)
99
- await rename(temporary, target);
100
- else
101
- await link(temporary, target);
102
- published = overwrite;
103
- await directory?.sync();
104
- } finally {
105
- await handle?.close().catch(() => void 0);
106
- if (!published)
107
- await unlink(temporary).catch(() => void 0);
108
- }
109
- } finally {
110
- await directory?.close().catch(() => void 0);
111
- }
112
- }, "writeFileAtomic");
113
-
114
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/files/bounded-utf8.js
115
- var readBoundedUtf8File = /* @__PURE__ */ __name(async (path, { maxBytes }) => {
116
- if (!Number.isSafeInteger(maxBytes) || maxBytes < 1 || maxBytes > 16 * 1024 * 1024)
117
- throw new CliError("validation_error", "file maxBytes takes 1\u201316777216 bytes");
118
- const file = await openOrdinaryFile(path);
119
- try {
120
- if ((await file.stat()).size > maxBytes)
121
- throw new CliError("validation_error", "input file exceeds its byte budget");
122
- const chunks = [], buffer = Buffer.alloc(Math.min(65536, maxBytes + 1));
123
- let bytes = 0;
124
- for (; ; ) {
125
- const { bytesRead } = await file.read(buffer, 0, Math.min(buffer.length, maxBytes - bytes + 1), null);
126
- if (bytesRead === 0)
127
- break;
128
- bytes += bytesRead;
129
- if (bytes > maxBytes)
130
- throw new CliError("validation_error", "input file exceeds its byte budget");
131
- chunks.push(Buffer.from(buffer.subarray(0, bytesRead)));
132
- }
133
- try {
134
- return new TextDecoder("utf-8", { fatal: true }).decode(Buffer.concat(chunks, bytes));
135
- } catch {
136
- throw new CliError("validation_error", "input file must contain valid UTF-8");
137
- }
138
- } finally {
139
- await file.close();
140
- }
141
- }, "readBoundedUtf8File");
142
-
143
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/files/lock.js
144
- import { mkdir as mkdir2 } from "node:fs/promises";
145
- import { basename as basename2, dirname as dirname2 } from "node:path";
146
-
147
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/files/native-writer-lease.js
148
- import { randomUUID as randomUUID2 } from "node:crypto";
149
- import { lstat as lstat3, mkdir, open as open3, realpath as realpath3, rmdir as rmdir2, unlink as unlink4 } from "node:fs/promises";
150
- import { hostname as hostname2 } from "node:os";
151
- import { join as join3 } from "node:path";
152
-
153
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/files/native-lease-inspection.js
154
- import { lstat as lstat2, readdir, realpath as realpath2, unlink as unlink2 } from "node:fs/promises";
155
- import { join as join2 } from "node:path";
156
-
157
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/files/native-lease-owner.js
158
- import { hostname } from "node:os";
159
- var missingLeaseFile = /* @__PURE__ */ __name((error) => typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT", "missingLeaseFile");
160
- var readLeaseOwner = /* @__PURE__ */ __name(async (path, name, signal) => {
161
- signal?.throwIfAborted();
162
- try {
163
- const file = await openOrdinaryFile(path);
164
- try {
165
- if ((await file.stat()).size > 4096)
166
- return null;
167
- const buffer = Buffer.alloc(4097);
168
- let size = 0;
169
- while (size < buffer.length) {
170
- signal?.throwIfAborted();
171
- const { bytesRead } = await file.read(buffer, size, buffer.length - size, size);
172
- if (bytesRead === 0)
173
- break;
174
- size += bytesRead;
175
- }
176
- signal?.throwIfAborted();
177
- if (size > 4096)
178
- return null;
179
- const owner = JSON.parse(buffer.subarray(0, size).toString("utf8"));
180
- if (owner?.version !== 1 || !Number.isSafeInteger(owner.pid) || owner.pid <= 0 || typeof owner.host !== "string" || !owner.host.trim() || !/^[a-f0-9-]{36}$/.test(owner.nonce) || name !== `${owner.pid}-${owner.nonce}.json`)
181
- return null;
182
- return owner;
183
- } finally {
184
- await file.close();
185
- }
186
- } catch {
187
- signal?.throwIfAborted();
188
- return null;
189
- }
190
- }, "readLeaseOwner");
191
- var leaseOwnerStatus = /* @__PURE__ */ __name((owner) => {
192
- if (owner.host !== hostname())
193
- return "foreign";
194
- try {
195
- process.kill(owner.pid, 0);
196
- return "active";
197
- } catch (error) {
198
- return typeof error === "object" && error !== null && "code" in error && error.code === "ESRCH" ? "stale" : "active";
199
- }
200
- }, "leaseOwnerStatus");
201
-
202
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/files/native-lease-inspection.js
203
- var leaseInspection = /* @__PURE__ */ __name((markerDirectory) => {
204
- const inspect = /* @__PURE__ */ __name(async (destination, options = {}) => {
205
- options.signal?.throwIfAborted();
206
- const root = await realpath2(destination);
207
- options.signal?.throwIfAborted();
208
- const folder = join2(root, markerDirectory);
209
- let names;
210
- try {
211
- if ((await lstat2(folder)).isSymbolicLink())
212
- throw new Error("symlink");
213
- names = await readdir(folder);
214
- } catch (error) {
215
- options.signal?.throwIfAborted();
216
- if (missingLeaseFile(error))
217
- return [];
218
- throw new CliError("configuration_error", "archive lock directory could not be read");
219
- }
220
- options.signal?.throwIfAborted();
221
- const result = [];
222
- for (const name of names.sort()) {
223
- options.signal?.throwIfAborted();
224
- const owner = await readLeaseOwner(join2(folder, name), name, options.signal);
225
- result.push({
226
- name,
227
- status: owner ? leaseOwnerStatus(owner) : "unrecognized",
228
- pid: owner?.pid ?? null,
229
- host: owner?.host ?? null
230
- });
231
- }
232
- return result;
233
- }, "inspect");
234
- const recover = /* @__PURE__ */ __name(async (destination, options = {}) => {
235
- options.signal?.throwIfAborted();
236
- const root = await realpath2(destination);
237
- const locks = await inspect(root, options);
238
- const removed = [];
239
- if (options.apply)
240
- for (const lock of locks) {
241
- options.signal?.throwIfAborted();
242
- if (lock.status !== "stale")
243
- continue;
244
- const path = join2(root, markerDirectory, lock.name);
245
- const owner = await readLeaseOwner(path, lock.name, options.signal);
246
- if (!owner || leaseOwnerStatus(owner) !== "stale")
247
- continue;
248
- try {
249
- await unlink2(path);
250
- removed.push(lock.name);
251
- } catch (error) {
252
- if (!missingLeaseFile(error))
253
- throw new CliError("configuration_error", "stale archive lock could not be removed");
254
- }
255
- }
256
- return { locks, removed };
257
- }, "recover");
258
- return { inspect, recover };
259
- }, "leaseInspection");
260
-
261
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/files/native-lease-release.js
262
- import { rmdir, unlink as unlink3 } from "node:fs/promises";
263
- var ownedNativeLease = /* @__PURE__ */ __name((path, name, owner, folder, identity) => {
264
- let releasing;
265
- const held = /* @__PURE__ */ __name(async () => {
266
- if (!await sameOrdinaryFile(path, identity))
267
- return false;
268
- const current = await readLeaseOwner(path, name);
269
- return current?.host === owner.host && current.pid === owner.pid && current.nonce === owner.nonce;
270
- }, "held");
271
- const release = /* @__PURE__ */ __name(async () => {
272
- if (!await held())
273
- throw new CliError("configuration_error", "owned archive lock changed before release");
274
- await unlink3(path);
275
- await rmdir(folder).catch(() => void 0);
276
- }, "release");
277
- return {
278
- held,
279
- release: /* @__PURE__ */ __name(() => releasing ??= release().catch((error) => {
280
- releasing = void 0;
281
- throw error;
282
- }), "release")
283
- };
284
- }, "ownedNativeLease");
285
-
286
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/files/native-writer-lease.js
287
- var validName = /* @__PURE__ */ __name((value) => typeof value === "string" && value.length > 0 && value !== "." && value !== ".." && !/[\\/\0:]/.test(value), "validName");
288
- var nativeWriterLeaseStore = /* @__PURE__ */ __name((layout) => {
289
- const { markerDirectory, legacyMarker } = layout;
290
- if (!validName(markerDirectory) || legacyMarker !== void 0 && (!validName(legacyMarker) || legacyMarker === markerDirectory))
291
- throw new CliError("validation_error", "archive lock layout requires distinct ordinary entry names");
292
- const inspection = leaseInspection(markerDirectory);
293
- return {
294
- ...inspection,
295
- acquire: /* @__PURE__ */ __name(async (destination, { signal } = {}) => {
296
- signal?.throwIfAborted();
297
- const root = await realpath3(destination);
298
- signal?.throwIfAborted();
299
- const folder = join3(root, markerDirectory);
300
- const owner = { version: 1, pid: process.pid, host: hostname2(), nonce: randomUUID2() };
301
- const name = `${owner.pid}-${owner.nonce}.json`;
302
- const path = join3(folder, name);
303
- const marker = /* @__PURE__ */ __name(async (attempt = 1) => {
304
- await mkdir(folder, { recursive: true });
305
- try {
306
- if ((await lstat3(folder)).isSymbolicLink())
307
- throw new CliError("validation_error", "archive lock directory must not be a symlink");
308
- await inspection.recover(root, { apply: true, signal });
309
- signal?.throwIfAborted();
310
- return await open3(path, "wx", 384);
311
- } catch (error) {
312
- if (attempt < 5 && missingLeaseFile(error))
313
- return marker(attempt + 1);
314
- throw error;
315
- }
316
- }, "marker");
317
- const file = await marker();
318
- let retained = false;
319
- let identity;
320
- try {
321
- identity = await file.stat({ bigint: true });
322
- await file.writeFile(JSON.stringify(owner));
323
- await file.sync();
324
- await file.close();
325
- signal?.throwIfAborted();
326
- const inspected = await inspection.inspect(root, { signal });
327
- const own = inspected.find((lock) => lock.name === name);
328
- if (own?.status !== "active" || own.pid !== owner.pid || own.host !== owner.host)
329
- throw new CliError("configuration_error", "archive writer lost its lock before acquisition");
330
- const locks = inspected.filter((lock) => lock.name !== name);
331
- if (locks.length)
332
- return { status: "busy", locks };
333
- if (legacyMarker) {
334
- try {
335
- await lstat3(join3(root, legacyMarker));
336
- return { status: "legacy" };
337
- } catch (error) {
338
- if (!missingLeaseFile(error))
339
- throw error;
340
- }
341
- }
342
- signal?.throwIfAborted();
343
- retained = true;
344
- return { status: "acquired", lease: ownedNativeLease(path, name, owner, folder, identity) };
345
- } finally {
346
- await file.close().catch(() => void 0);
347
- if (!retained) {
348
- if (identity && await sameOrdinaryFile(path, identity))
349
- await unlink4(path).catch(() => void 0);
350
- await rmdir2(folder).catch(() => void 0);
351
- }
352
- }
353
- }, "acquire")
354
- };
355
- }, "nativeWriterLeaseStore");
356
-
357
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/files/lock.js
358
- var acquireLock = /* @__PURE__ */ __name(async (path, { signal } = {}) => {
359
- const folder = dirname2(path);
360
- await mkdir2(folder, { recursive: true, mode: 448 });
361
- const acquired = await nativeWriterLeaseStore({ markerDirectory: basename2(path) }).acquire(folder, {
362
- ...signal ? { signal } : {}
363
- });
364
- if (acquired.status === "acquired")
365
- return acquired.lease;
366
- throw new CliError("validation_error", `${basename2(path)} is locked by another process`, {
367
- reason: "file.locked",
368
- ...acquired.status === "busy" ? { holders: acquired.locks } : {}
369
- });
370
- }, "acquireLock");
371
-
372
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/files/safe-name.js
373
- import { basename as basename3, extname } from "node:path";
374
- var MOST_NAME_BYTES = 200;
375
- var bytesOf = /* @__PURE__ */ __name((text) => Buffer.byteLength(text, "utf8"), "bytesOf");
376
- var shortened = /* @__PURE__ */ __name((name, most) => {
377
- if (bytesOf(name) <= most)
378
- return name;
379
- const extension = extname(name);
380
- const kept = bytesOf(extension) <= 32 ? extension : "";
381
- let stem = "";
382
- for (const character of name.slice(0, name.length - kept.length)) {
383
- if (bytesOf(stem + character) + bytesOf(kept) > most)
384
- break;
385
- stem += character;
386
- }
387
- return stem + kept;
388
- }, "shortened");
389
- var safeName = /* @__PURE__ */ __name((name, platform = process.platform) => {
390
- let plain = name === void 0 ? "" : basename3(name.replaceAll("\\", "/")).replace(/[\p{Cc}​-‏‪-‮⁦-⁩]/gu, "").replace(/^\.+/, "");
391
- if (platform === "win32") {
392
- plain = plain.replace(/[<>:"|?*]/g, "_").replace(/[. ]+$/, "");
393
- if (/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(plain))
394
- return void 0;
395
- }
396
- return plain === "" ? void 0 : shortened(plain, MOST_NAME_BYTES);
397
- }, "safeName");
398
-
399
- export {
400
- writeFileAtomic,
401
- openOrdinaryFile,
402
- sameOrdinaryFile,
403
- syncDirectory,
404
- readBoundedUtf8File,
405
- acquireLock,
406
- safeName
407
- };
@@ -1,72 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- CliError,
5
- errorCodes
6
- } from "./chunk-S6JG4YUH.js";
7
- import {
8
- __name
9
- } from "./chunk-ZVVMGPBJ.js";
10
-
11
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/errors/failures.js
12
- var isCliFailure = /* @__PURE__ */ __name((value) => value instanceof Error && value.name === "CliError" && errorCodes.includes(value.code), "isCliFailure");
13
- var isCommanderFailure = /* @__PURE__ */ __name((value) => {
14
- const { code, exitCode } = value ?? {};
15
- return value instanceof Error && typeof code === "string" && code.startsWith("commander.") && typeof exitCode === "number";
16
- }, "isCommanderFailure");
17
- var USAGE_REASONS = {
18
- "commander.unknownCommand": "usage.unknown-command",
19
- "commander.unknownOption": "usage.unknown-option"
20
- };
21
- var usageReason = /* @__PURE__ */ __name((code) => USAGE_REASONS[code], "usageReason");
22
- var failureKey = /* @__PURE__ */ __name((error) => isCliFailure(error) ? error.code : error instanceof Error ? error.name : "error", "failureKey");
23
- var SQLITE_CORRUPT = 11;
24
- var SQLITE_NOTADB = 26;
25
- var DAMAGED_TEXT = /database disk image is malformed|file is not a database|fts5: corruption/i;
26
- var sqliteCode = /* @__PURE__ */ __name((error) => {
27
- const { errcode, errno, name } = error ?? {};
28
- const code = typeof errcode === "number" ? errcode : name === "SQLiteError" && typeof errno === "number" ? errno : null;
29
- return code === null ? void 0 : code & 255;
30
- }, "sqliteCode");
31
- var damageIn = /* @__PURE__ */ __name((error) => {
32
- if (isCliFailure(error) || isCommanderFailure(error))
33
- return void 0;
34
- let at = error;
35
- for (let depth = 0; depth < 5 && at instanceof Error; depth += 1) {
36
- const code = sqliteCode(at);
37
- if (code !== void 0 && [SQLITE_CORRUPT, SQLITE_NOTADB].includes(code) || DAMAGED_TEXT.test(at.message))
38
- return at;
39
- at = at.cause;
40
- }
41
- return void 0;
42
- }, "damageIn");
43
- var wrapping = /* @__PURE__ */ __name((error, original) => {
44
- Object.defineProperty(error, "cause", { value: original, configurable: true, writable: true });
45
- if (original instanceof Error && original.stack)
46
- error.stack = original.stack;
47
- return error;
48
- }, "wrapping");
49
- var storeDamaged = /* @__PURE__ */ __name((error, next) => damageIn(error) ? wrapping(new CliError("configuration_error", `the store file is damaged${next ? `; \`${next}\` says what is damaged and what to do` : ""}`, { reason: "store.damaged" }), error) : error, "storeDamaged");
50
- var damagedFile = /* @__PURE__ */ __name(async (files, work) => {
51
- try {
52
- return await work();
53
- } catch (error) {
54
- if (!damageIn(error))
55
- throw error;
56
- throw wrapping(new CliError("validation_error", `${files.join(" or ")} is damaged or not a database`, {
57
- reason: "store.file-damaged"
58
- }), error);
59
- }
60
- }, "damagedFile");
61
- var isStoreDamage = /* @__PURE__ */ __name((error) => damageIn(error) !== void 0, "isStoreDamage");
62
-
63
- export {
64
- isCliFailure,
65
- isCommanderFailure,
66
- usageReason,
67
- failureKey,
68
- sqliteCode,
69
- storeDamaged,
70
- damagedFile,
71
- isStoreDamage
72
- };