@wirecat/drive-cli 0.61.0 → 0.63.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 (152) hide show
  1. package/dist/bin/drive.js +2 -2
  2. package/dist/browse.d.ts +20 -0
  3. package/dist/browse.d.ts.map +1 -0
  4. package/dist/browse.js +146 -0
  5. package/dist/browse.js.map +1 -0
  6. package/dist/bundle/{all-profiles-H4L3Z5UM.js → all-profiles-GZJS3UKC.js} +13 -14
  7. package/dist/bundle/{anthropic-PPGFISVP.js → anthropic-RGV3WXX5.js} +9 -9
  8. package/dist/bundle/{app-server-YXVK2FUZ.js → app-server-AA2PJ7PV.js} +57 -55
  9. package/dist/bundle/{bun-DKZAL6ML.js → bun-OXZYIA3R.js} +2 -2
  10. package/dist/bundle/{bun-sqlite-MTZY36QK.js → bun-sqlite-D45NSDM3.js} +8 -8
  11. package/dist/bundle/{chunk-KV4267S4.js → chunk-27YUUGXQ.js} +1 -1
  12. package/dist/bundle/{chunk-6IBM4Z3V.js → chunk-2HF2MRXI.js} +1 -1
  13. package/dist/bundle/{chunk-HGOYQUT7.js → chunk-2NIC72HH.js} +4 -2
  14. package/dist/bundle/{chunk-XZBR2O63.js → chunk-2TDUGC5D.js} +1501 -781
  15. package/dist/bundle/{chunk-DEPMQHXQ.js → chunk-2TFXK3R4.js} +4 -4
  16. package/dist/bundle/{chunk-JVBLXSAA.js → chunk-33MGFUED.js} +652 -249
  17. package/dist/bundle/{chunk-S4YK6TTG.js → chunk-3BZRKLJ6.js} +13 -13
  18. package/dist/bundle/{chunk-6SUGANRJ.js → chunk-3HK5WMI5.js} +6 -6
  19. package/dist/bundle/{chunk-YWIU4HOT.js → chunk-3QINVLZI.js} +1 -1
  20. package/dist/bundle/{chunk-XYCCGGKN.js → chunk-44SBK6KB.js} +1207 -643
  21. package/dist/bundle/{chunk-LARQTWIL.js → chunk-4CIZWCXV.js} +1 -1
  22. package/dist/bundle/{chunk-WZ5XK74U.js → chunk-4OSSOWDM.js} +1 -1
  23. package/dist/bundle/{chunk-XGNC5OJG.js → chunk-4S4JMW6I.js} +1 -1
  24. package/dist/bundle/{chunk-WIU733D2.js → chunk-534OBX5Y.js} +1 -1
  25. package/dist/bundle/{chunk-UO2IUDVK.js → chunk-5PPL7JDM.js} +2 -2
  26. package/dist/bundle/{chunk-OFFA54TW.js → chunk-6EY46GAN.js} +2 -2
  27. package/dist/bundle/{chunk-RFRCOAWS.js → chunk-6KQJSFYF.js} +22 -22
  28. package/dist/bundle/{chunk-6DN4VPA7.js → chunk-6MQSQ4LX.js} +33 -31
  29. package/dist/bundle/{chunk-NIX2MWHZ.js → chunk-7EMQ26BA.js} +39 -25
  30. package/dist/bundle/{chunk-X2CXW4HM.js → chunk-ABYGSJZ4.js} +7 -7
  31. package/dist/bundle/{chunk-I26VL4W7.js → chunk-AEX37ETW.js} +2 -2
  32. package/dist/bundle/{chunk-36CWGEVX.js → chunk-BKYMKVHT.js} +2 -2
  33. package/dist/bundle/{chunk-3WZH3WV3.js → chunk-CE2TJBLP.js} +3 -3
  34. package/dist/bundle/{chunk-YMBFZA3H.js → chunk-DJ3SDJZY.js} +8 -8
  35. package/dist/bundle/{chunk-DXPOVLQC.js → chunk-DJHLVUL6.js} +227 -90
  36. package/dist/bundle/{chunk-VPDAH7PJ.js → chunk-E4SDKMBJ.js} +59 -1
  37. package/dist/bundle/{chunk-NZ2EIZLX.js → chunk-EOOGWUTP.js} +10 -10
  38. package/dist/bundle/{chunk-VYXVPYA3.js → chunk-FEZF3TII.js} +6 -6
  39. package/dist/bundle/{chunk-Q4XVBKX4.js → chunk-FRIJUILO.js} +3 -3
  40. package/dist/bundle/{chunk-OLPJRD4S.js → chunk-FUITWY7O.js} +1 -1
  41. package/dist/bundle/{chunk-AM4RIWOZ.js → chunk-HZZCEQTH.js} +18 -4
  42. package/dist/bundle/{chunk-2RJA4BQB.js → chunk-J24ZFCWM.js} +39 -26
  43. package/dist/bundle/{chunk-QSGT4ZH4.js → chunk-J4DIHPZ6.js} +1 -1
  44. package/dist/bundle/{chunk-ZHYRHERD.js → chunk-L37LMMRJ.js} +2 -2
  45. package/dist/bundle/{chunk-XLFJLZJL.js → chunk-LMAVCYLQ.js} +22 -14
  46. package/dist/bundle/{chunk-E6J5YH2N.js → chunk-LZEOQW7S.js} +36 -36
  47. package/dist/bundle/{chunk-FE5JJXKA.js → chunk-MOTRI3SY.js} +2 -2
  48. package/dist/bundle/{chunk-PJTX2MOI.js → chunk-ND6LLYGF.js} +98 -81
  49. package/dist/bundle/{chunk-3I2D5TK2.js → chunk-NEFSGCVA.js} +10 -10
  50. package/dist/bundle/{chunk-OGNOQDWB.js → chunk-O2XOX4HB.js} +34 -10
  51. package/dist/bundle/{chunk-DCBFNBEB.js → chunk-OD4U7GUY.js} +20 -20
  52. package/dist/bundle/{chunk-BXR7BKM3.js → chunk-OTROVC4E.js} +1 -1
  53. package/dist/bundle/{chunk-UKOYQC5O.js → chunk-OXY6SSZG.js} +184 -29
  54. package/dist/bundle/{chunk-ZMNYK3FC.js → chunk-PDCCYHCH.js} +5 -5
  55. package/dist/bundle/{chunk-J5UDQD5S.js → chunk-PO5RQQIG.js} +5 -5
  56. package/dist/bundle/{chunk-PY7LKNOS.js → chunk-Q5DJTRKV.js} +2 -2
  57. package/dist/bundle/{chunk-E5EXJ2XS.js → chunk-QCKZ3GAA.js} +4 -4
  58. package/dist/bundle/{chunk-3SJQNS72.js → chunk-RKELRWH7.js} +5 -5
  59. package/dist/bundle/{chunk-6Y2FWJZ4.js → chunk-S4RXABDR.js} +3 -3
  60. package/dist/bundle/{chunk-BQMIDYBA.js → chunk-SXM6MHRR.js} +12 -12
  61. package/dist/bundle/chunk-TF23BZW5.js +64 -0
  62. package/dist/bundle/{chunk-N2RLJTIW.js → chunk-TWUH22Z5.js} +4 -4
  63. package/dist/bundle/chunk-UPOSDTPT.js +87 -0
  64. package/dist/bundle/{chunk-J4HQVHMN.js → chunk-UQLWMGSD.js} +5 -5
  65. package/dist/bundle/{chunk-K7LS3NGM.js → chunk-V3NVXIQR.js} +736 -230
  66. package/dist/bundle/{chunk-TKGAYKXW.js → chunk-VAUMOZU5.js} +228 -66
  67. package/dist/bundle/{chunk-BF6TQMNB.js → chunk-VJEOGKAN.js} +8 -10
  68. package/dist/bundle/{chunk-XGMDWIUP.js → chunk-VKPCONDQ.js} +4 -4
  69. package/dist/bundle/{chunk-73WSULMI.js → chunk-WYGWWHZP.js} +2 -2
  70. package/dist/bundle/{chunk-5W56YMQS.js → chunk-XDC3TWTL.js} +60 -51
  71. package/dist/bundle/{chunk-5W7D5H2R.js → chunk-XIUDS3OK.js} +1 -1
  72. package/dist/bundle/{chunk-3UPIJ7DW.js → chunk-XNVFKMVR.js} +21868 -4533
  73. package/dist/bundle/{chunk-O5CUFS7T.js → chunk-XR6ESRU6.js} +2 -2
  74. package/dist/bundle/{chunk-EPCJUL6M.js → chunk-Y6GNA7HE.js} +3 -3
  75. package/dist/bundle/{chunk-67HS46KM.js → chunk-YGU6ULU5.js} +12 -12
  76. package/dist/bundle/{chunk-HFM653T3.js → chunk-YIP7ELON.js} +768 -131
  77. package/dist/bundle/{chunk-3252WXOL.js → chunk-YUWPNG7B.js} +1 -1
  78. package/dist/bundle/{chunk-QR5VQXQ5.js → chunk-Z42YYLTS.js} +59 -37
  79. package/dist/bundle/{chunk-AWN22PJK.js → chunk-Z5KC7XBR.js} +3 -3
  80. package/dist/bundle/{chunk-ECEYAQGN.js → chunk-ZM5J6ZMB.js} +4 -2
  81. package/dist/bundle/{chunk-YPF6OS37.js → chunk-ZMOUUOT2.js} +1 -1
  82. package/dist/bundle/{chunk-CACYL36O.js → chunk-ZOJU7ZFI.js} +8 -8
  83. package/dist/bundle/command-contract-BRW3AP44.js +38 -0
  84. package/dist/bundle/{decode-62A3HGPW.js → decode-G5YEIPNC.js} +8 -8
  85. package/dist/bundle/{dispatch-IE7PBEQC.js → dispatch-GEFIXA6X.js} +9 -9
  86. package/dist/bundle/drive.js +11 -11
  87. package/dist/bundle/{echarts-BGBPRGR5.js → echarts-W2CWHNXR.js} +2 -2
  88. package/dist/bundle/{embed-J3IBVV2V.js → embed-OBFFPVF4.js} +9 -9
  89. package/dist/bundle/{embedder-QFPMDRT2.js → embedder-NGCBQHIG.js} +12 -12
  90. package/dist/bundle/entry-ET6HGM7A.js +22 -0
  91. package/dist/bundle/{failure-BKOGBMIC.js → failure-GV77W3CD.js} +4 -4
  92. package/dist/bundle/first-run-JG52UZVO.js +30 -0
  93. package/dist/bundle/first-screen-CIL3GFAA.js +36 -0
  94. package/dist/bundle/{google-RXM2XEPD.js → google-CIWUVJ5C.js} +13 -13
  95. package/dist/bundle/{google-api-NC65BZO4.js → google-api-Z3NSTBBR.js} +56 -57
  96. package/dist/bundle/grants-3S4RL3WB.js +104 -0
  97. package/dist/bundle/{identity-PI6F2GWA.js → identity-OM6GFZ7T.js} +6 -6
  98. package/dist/bundle/{instructions-6LPDSKAD.js → instructions-YQBQSYSS.js} +1 -1
  99. package/dist/bundle/{login-HTY7GT2S.js → login-7RYSDVN3.js} +62 -63
  100. package/dist/bundle/{mcp-PPVOM4SE.js → mcp-GWDA3HOA.js} +2 -2
  101. package/dist/bundle/{node-IB246NCQ.js → node-IVU33RL7.js} +2 -2
  102. package/dist/bundle/{node-sqlite-G2Y5SFJM.js → node-sqlite-SIH5BEW2.js} +9 -9
  103. package/dist/bundle/oauth-PT4JEHLL.js +22 -0
  104. package/dist/bundle/{open-WD4GFSJD.js → open-IAO2SNII.js} +8 -8
  105. package/dist/bundle/{openai-QVM4PMY7.js → openai-SGOUBHXP.js} +17 -17
  106. package/dist/bundle/{process-SWPJGPQC.js → process-BPBMV3AT.js} +1 -1
  107. package/dist/bundle/{program-WHYFAMXR.js → program-MYKKJ4F6.js} +231 -87
  108. package/dist/bundle/prompt-3ZM64DCB.js +17 -0
  109. package/dist/bundle/{reasons-Q34DQWB6.js → reasons-57J2D77K.js} +5 -5
  110. package/dist/bundle/{recognize-DM3YWHSE.js → recognize-A5C5RPB3.js} +7 -7
  111. package/dist/bundle/{remote-KXVWRK7J.js → remote-VWYFLRGO.js} +10 -10
  112. package/dist/bundle/{rerank-TINXM3MY.js → rerank-4NGQWREA.js} +10 -10
  113. package/dist/bundle/{serve-IY2WL656.js → serve-Y6LQTFH5.js} +12 -12
  114. package/dist/bundle/{server-VPY3OWPC.js → server-6AUHIIUA.js} +43 -44
  115. package/dist/bundle/server-PFHI35HA.js +69 -0
  116. package/dist/bundle/{services-PXNBOCOC.js → services-2W4J7EMW.js} +47 -32
  117. package/dist/bundle/{sqlite-runtime-5ZK2CV7Y.js → sqlite-runtime-P6BBDX2H.js} +9 -9
  118. package/dist/bundle/{start-LDVCN3DK.js → start-AFFA3LKM.js} +9 -7
  119. package/dist/bundle/{state-3MKTT3VS.js → state-PXKKXR3R.js} +9 -9
  120. package/dist/bundle/{store-4VQOT5IJ.js → store-CN6JEUC4.js} +28 -18
  121. package/dist/bundle/{store-7M4MSUJV.js → store-IVV2BAGZ.js} +78 -28
  122. package/dist/bundle/store-maintenance-command-MSY2QNEH.js +59 -0
  123. package/dist/bundle/tokens-P4LPNUFW.js +102 -0
  124. package/dist/commands/config.d.ts.map +1 -1
  125. package/dist/commands/config.js +5 -1
  126. package/dist/commands/config.js.map +1 -1
  127. package/dist/commands/folders.d.ts +2 -1
  128. package/dist/commands/folders.d.ts.map +1 -1
  129. package/dist/commands/folders.js +16 -3
  130. package/dist/commands/folders.js.map +1 -1
  131. package/dist/program.js +1 -1
  132. package/dist/program.js.map +1 -1
  133. package/dist/tokens.d.ts.map +1 -1
  134. package/dist/tokens.js +15 -6
  135. package/dist/tokens.js.map +1 -1
  136. package/dist/version.d.ts +1 -1
  137. package/dist/version.js +1 -1
  138. package/package.json +3 -3
  139. package/dist/bundle/chunk-BCWUDTYQ.js +0 -22
  140. package/dist/bundle/chunk-W767AUNR.js +0 -132
  141. package/dist/bundle/chunk-WUP2MJDN.js +0 -42
  142. package/dist/bundle/command-contract-T3EO5AYD.js +0 -39
  143. package/dist/bundle/entry-YQSYER66.js +0 -22
  144. package/dist/bundle/first-run-ZIFPVZAI.js +0 -30
  145. package/dist/bundle/first-screen-L5U26EY7.js +0 -37
  146. package/dist/bundle/grants-SEWUYYH3.js +0 -105
  147. package/dist/bundle/oauth-MWBKBI4T.js +0 -22
  148. package/dist/bundle/prompt-OVYCGZB7.js +0 -17
  149. package/dist/bundle/server-EMWVVT2C.js +0 -70
  150. package/dist/bundle/store-maintenance-command-NRATYBWD.js +0 -60
  151. package/dist/bundle/tokens-XUKLM3SL.js +0 -103
  152. /package/dist/bundle/{chunk-LU3WKZBA.js → chunk-ZQ3GWKDQ.js} +0 -0
@@ -7,15 +7,15 @@ import {
7
7
  agentJson,
8
8
  commandAvailability,
9
9
  failureContext
10
- } from "./chunk-UKOYQC5O.js";
10
+ } from "./chunk-OXY6SSZG.js";
11
11
  import {
12
12
  callerOf
13
- } from "./chunk-73WSULMI.js";
13
+ } from "./chunk-WYGWWHZP.js";
14
14
  import {
15
15
  QUERY_ARGUMENT,
16
16
  lentConnection,
17
17
  refuseLacking
18
- } from "./chunk-2RJA4BQB.js";
18
+ } from "./chunk-J24ZFCWM.js";
19
19
  import {
20
20
  DEFAULT_OUTPUT_BYTES,
21
21
  ENTITIES,
@@ -30,18 +30,18 @@ import {
30
30
  refuseStoreChange,
31
31
  sealed,
32
32
  startRecording
33
- } from "./chunk-JVBLXSAA.js";
33
+ } from "./chunk-33MGFUED.js";
34
34
  import {
35
35
  currentCaller,
36
36
  keepsSuccess,
37
37
  runContextOf,
38
38
  withCaller
39
- } from "./chunk-BF6TQMNB.js";
39
+ } from "./chunk-VJEOGKAN.js";
40
40
  import {
41
41
  onlineDeps,
42
42
  servicesFor,
43
43
  storeModeDeps
44
- } from "./chunk-XYCCGGKN.js";
44
+ } from "./chunk-44SBK6KB.js";
45
45
  import {
46
46
  authorityAllowed,
47
47
  botApiAllowed,
@@ -52,23 +52,26 @@ import {
52
52
  newRunId,
53
53
  readKeysForCommand,
54
54
  traceOf
55
- } from "./chunk-6DN4VPA7.js";
55
+ } from "./chunk-6MQSQ4LX.js";
56
56
  import {
57
57
  queryDescription
58
- } from "./chunk-NZ2EIZLX.js";
58
+ } from "./chunk-EOOGWUTP.js";
59
+ import {
60
+ storeDamaged
61
+ } from "./chunk-E4SDKMBJ.js";
59
62
  import {
60
63
  MAX_BUFFERED_INPUT
61
- } from "./chunk-O5CUFS7T.js";
64
+ } from "./chunk-XR6ESRU6.js";
62
65
  import {
63
66
  captureStreams
64
- } from "./chunk-DCBFNBEB.js";
67
+ } from "./chunk-OD4U7GUY.js";
65
68
  import {
66
69
  errorObjectOf,
67
70
  mcpErrorResult
68
- } from "./chunk-J4HQVHMN.js";
71
+ } from "./chunk-UQLWMGSD.js";
69
72
  import {
70
73
  traceIdOf
71
- } from "./chunk-OFFA54TW.js";
74
+ } from "./chunk-6EY46GAN.js";
72
75
  import {
73
76
  COMPACT_FLAG,
74
77
  SNAKE_CASE,
@@ -105,19 +108,19 @@ import {
105
108
  unknown,
106
109
  word,
107
110
  writes
108
- } from "./chunk-VYXVPYA3.js";
111
+ } from "./chunk-FEZF3TII.js";
109
112
  import {
110
113
  CliError,
111
114
  errorCodes
112
- } from "./chunk-WZ5XK74U.js";
115
+ } from "./chunk-4OSSOWDM.js";
113
116
  import {
114
117
  __name
115
118
  } from "./chunk-ZVVMGPBJ.js";
116
119
 
117
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/mcp/agent.js
120
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/mcp/agent.js
118
121
  import { Readable } from "node:stream";
119
122
 
120
- // node_modules/.pnpm/@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/lint.js
123
+ // node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/lint.js
121
124
  var LINT_SEVERITIES = ["high", "medium", "low"];
122
125
  var lintRuleSchema = strictObject({
123
126
  id: word,
@@ -245,7 +248,7 @@ var overrideSchema = strictObject({
245
248
  });
246
249
  var overridesSchema = array(overrideSchema);
247
250
 
248
- // node_modules/.pnpm/@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/audit.js
251
+ // node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/audit.js
249
252
  var auditRuleSchema = strictObject({ id: word, severity: picklist(LINT_SEVERITIES), summary: text });
250
253
  var defineAuditRules = /* @__PURE__ */ __name((input) => parseRegistry("audit rules", array(auditRuleSchema), input, (rules) => duplicates(rules.map((rule) => rule.id)).map((id) => `"${id}" is listed twice`)), "defineAuditRules");
251
254
  var AUDIT_RULES = defineAuditRules([
@@ -290,11 +293,13 @@ var parityGroupSchema = strictObject({
290
293
  /** Permanent differences, each with its reason; they count against the override budget of the group. */
291
294
  differences: array(strictObject({
292
295
  rule: word,
293
- /** `<clis> <path> <flag>`; with `absent`, only `<path> <flag>`: the CLI list is whoever else has it. */
296
+ /** `<clis> <path> <flag>`; with `absent` or `only`, only `<path> <flag>`: the CLI list is whoever else was compared. */
294
297
  target: text,
295
298
  expected: optional(text),
296
299
  /** The CLI that lacks the path or flag by design; the rest must agree, so other CLIs joining do not stale it. */
297
300
  absent: optional(word),
301
+ /** The one CLI that has the path or flag by design; every other CLI compared must lack it. */
302
+ only: optional(word),
298
303
  reason: pipe(text, minLength(10, "say why, in a sentence"))
299
304
  }))
300
305
  });
@@ -302,7 +307,8 @@ var defineParityGroups = /* @__PURE__ */ __name((input) => parseRegistry("parity
302
307
  ...duplicates(groups.map((group) => group.name)).map((name) => `"${name}" is listed twice`),
303
308
  ...groups.flatMap((group) => [
304
309
  ...duplicates(group.differences.map((entry) => `${entry.rule} ${entry.target}`)).map((both) => `${group.name}: "${both}" is listed twice`),
305
- ...group.differences.filter((entry) => entry.absent && entry.expected).map((entry) => `${group.name}: "${entry.target}" has \`absent\`, which measures the values itself; drop \`expected\``)
310
+ ...group.differences.filter((entry) => (entry.absent || entry.only) && entry.expected).map((entry) => `${group.name}: "${entry.target}" has \`${entry.absent ? "absent" : "only"}\`, which measures the values itself; drop \`expected\``),
311
+ ...group.differences.filter((entry) => entry.absent && entry.only).map((entry) => `${group.name}: "${entry.target}" has both \`absent\` and \`only\`; keep one`)
306
312
  ])
307
313
  ]), "defineParityGroups");
308
314
  var MEMO_HAS_NO_PROFILES = [
@@ -317,13 +323,19 @@ var MEMO_HAS_NO_PROFILES = [
317
323
  absent: "memo",
318
324
  reason: "memo has no profiles: it reads other CLIs' stores and selects their accounts with --source and --account (https://github.com/WireCatLabs/cli-base/issues/390)"
319
325
  }));
326
+ var MEMO_DOCTOR_DEEP = {
327
+ rule: "same-path-contract",
328
+ target: "doctor --deep",
329
+ only: "memo",
330
+ reason: "memo's doctor --deep also checks its own store (cli-memo #672); cli-core's shared doctor leaves --deep to each CLI, and no other CLI has one"
331
+ };
320
332
  var PARITY_GROUPS = defineParityGroups([
321
333
  { name: "messengers", members: ["tg", "max"], covers: "tree", differences: [] },
322
334
  {
323
335
  name: "all",
324
336
  members: ["tg", "max", "memo", "drive", "zm", "wa"],
325
337
  covers: ["commands", "doctor", "skill", "mcp", "upgrade", "search", "notes", "meetings"],
326
- differences: MEMO_HAS_NO_PROFILES
338
+ differences: [...MEMO_HAS_NO_PROFILES, MEMO_DOCTOR_DEEP]
327
339
  },
328
340
  // mail's `search messages` is cli-core's mail search, not the messengers' command: --complete took their 20-odd
329
341
  // differences as inherited (https://github.com/WireCatLabs/cli-base/issues/390). mail is compared everywhere else
@@ -332,7 +344,7 @@ var PARITY_GROUPS = defineParityGroups([
332
344
  name: "mail-shared",
333
345
  members: ["tg", "max", "memo", "drive", "zm", "wa", "mail"],
334
346
  covers: ["commands", "doctor", "skill", "mcp", "upgrade", "notes", "meetings"],
335
- differences: MEMO_HAS_NO_PROFILES
347
+ differences: [...MEMO_HAS_NO_PROFILES, MEMO_DOCTOR_DEEP]
336
348
  },
337
349
  // gcal is compared on what it already shares with every CLI; doctor, mcp, search and skill wait until the published
338
350
  // CLIs agree there (https://github.com/WireCatLabs/cli-base/issues/390), then gcal moves back into "all".
@@ -341,6 +353,14 @@ var PARITY_GROUPS = defineParityGroups([
341
353
  members: ["tg", "max", "memo", "drive", "zm", "wa", "gcal"],
342
354
  covers: ["commands", "upgrade", "notes", "meetings"],
343
355
  differences: []
356
+ },
357
+ // bitrix24-cli's search is cli-core's CRM `search all`, and beeline-cli's meetings take call recordings, not
358
+ // zoom-cli's: both are compared on the root commands every CLI shares, the way gcal and mail are on theirs.
359
+ {
360
+ name: "shared-roots",
361
+ members: ["tg", "max", "memo", "drive", "zm", "wa", "b24", "beeline"],
362
+ covers: ["commands", "doctor", "skill", "mcp", "upgrade"],
363
+ differences: [...MEMO_HAS_NO_PROFILES, MEMO_DOCTOR_DEEP]
344
364
  }
345
365
  ]);
346
366
  var requiredRootSchema = strictObject({ path: pipe(array(segment), minLength(1)), meaning: text });
@@ -354,7 +374,7 @@ var REQUIRED_ROOTS = defineRequiredRoots([
354
374
  { path: ["upgrade"], meaning: "updates the CLI" }
355
375
  ]);
356
376
 
357
- // node_modules/.pnpm/@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/fields.js
377
+ // node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/fields.js
358
378
  var fieldRuleSchema = strictObject({ id: word, rule: text });
359
379
  var defineFieldRules = /* @__PURE__ */ __name((input) => parseRegistry("output field rules", array(fieldRuleSchema), input, (rules) => duplicates(rules.map((rule) => rule.id)).map((id) => `"${id}" is listed twice`)), "defineFieldRules");
360
380
  var FIELD_RULES = defineFieldRules([
@@ -370,7 +390,7 @@ var FIELD_RULES = defineFieldRules([
370
390
  }
371
391
  ]);
372
392
 
373
- // node_modules/.pnpm/@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/identifiers.js
393
+ // node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/identifiers.js
374
394
  var key = pipe(string(), regex(SNAKE_CASE, "a snake_case key"));
375
395
  var identifierSchema = strictObject({ key, meaning: text, replaces: optional(array(key)) });
376
396
  var defineIdentifiers = /* @__PURE__ */ __name((input) => parseRegistry("identifiers", array(identifierSchema), input, (identifiers) => {
@@ -392,7 +412,7 @@ var IDENTIFIERS = defineIdentifiers([
392
412
  { key: "trace_id", meaning: "the distributed trace a run belongs to, from `traceparent`" }
393
413
  ]);
394
414
 
395
- // node_modules/.pnpm/@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-calendar.js
415
+ // node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-calendar.js
396
416
  var CALENDAR_FLAGS = [
397
417
  { name: "--end-time", value: "<time>", role: "value", type: "time", meaning: "when it ends" },
398
418
  {
@@ -466,7 +486,47 @@ var CALENDAR_FLAGS = [
466
486
  }
467
487
  ];
468
488
 
469
- // node_modules/.pnpm/@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-how.js
489
+ // node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-crm.js
490
+ var CRM_FLAGS = [
491
+ {
492
+ name: "--pipeline",
493
+ value: "<pipeline>",
494
+ role: "value",
495
+ type: "string",
496
+ meaning: "a CRM pipeline: pipeline:<id>, or a name only one pipeline has"
497
+ },
498
+ {
499
+ name: "--stage",
500
+ value: "<stage>",
501
+ role: "value",
502
+ type: "string",
503
+ meaning: "a stage of the record's pipeline, by the CRM's id or its name"
504
+ },
505
+ {
506
+ name: "--amount",
507
+ value: "<decimal>",
508
+ role: "value",
509
+ type: "string",
510
+ meaning: "a sum of money as a decimal, such as 1500.50, in --currency"
511
+ },
512
+ { name: "--currency", value: "<code>", role: "value", type: "string", meaning: "an ISO 4217 code, such as EUR" },
513
+ {
514
+ name: "--close-date",
515
+ value: "<date>",
516
+ role: "value",
517
+ type: "time",
518
+ meaning: "the day a deal or lead is expected to close, YYYY-MM-DD"
519
+ },
520
+ {
521
+ name: "--owner",
522
+ value: "<user>",
523
+ role: "value",
524
+ type: "id",
525
+ meaning: "the CRM user a record is assigned to, by the CRM's id"
526
+ }
527
+ ];
528
+
529
+ // node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-how.js
470
530
  var HOW_FLAGS = [
471
531
  {
472
532
  name: "--limit",
@@ -791,6 +851,7 @@ var HOW_FLAGS = [
791
851
  meaning: "tell the people it concerns about it: the chat's members, or an event's attendees"
792
852
  },
793
853
  { name: "--no-notify", role: "mode", type: "switch", meaning: "tell nobody about it" },
854
+ { name: "--open-new", role: "mode", type: "switch", meaning: "a read again for tasks also opens new tasks" },
794
855
  { name: "--offline", role: "mode", type: "switch", meaning: "answer from what was recorded and never connect" },
795
856
  {
796
857
  name: "--operation-id",
@@ -1460,7 +1521,7 @@ var HOW_FLAGS = [
1460
1521
  }
1461
1522
  ];
1462
1523
 
1463
- // node_modules/.pnpm/@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-mail.js
1524
+ // node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-mail.js
1464
1525
  var MAIL_FLAGS = [
1465
1526
  {
1466
1527
  name: "--cc",
@@ -1490,7 +1551,94 @@ var MAIL_FLAGS = [
1490
1551
  }
1491
1552
  ];
1492
1553
 
1493
- // node_modules/.pnpm/@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-what.js
1554
+ // node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-privacy.js
1555
+ var PRIVACY_FLAGS = [
1556
+ {
1557
+ name: "--about-text",
1558
+ value: "<who>",
1559
+ role: "value",
1560
+ type: "choice",
1561
+ meaning: "who sees the about text: everyone, contacts or nobody"
1562
+ },
1563
+ {
1564
+ name: "--calls",
1565
+ value: "<who>",
1566
+ role: "value",
1567
+ type: "choice",
1568
+ meaning: "whose calls ring: everyone, contacts or nobody"
1569
+ },
1570
+ {
1571
+ name: "--chat-invites",
1572
+ value: "<who>",
1573
+ role: "value",
1574
+ type: "choice",
1575
+ meaning: "who may add the account to groups and channels: everyone, contacts or nobody"
1576
+ },
1577
+ {
1578
+ name: "--find-by-phone",
1579
+ value: "<who>",
1580
+ role: "value",
1581
+ type: "choice",
1582
+ meaning: "who finds the account by its number: everyone, contacts or nobody"
1583
+ },
1584
+ {
1585
+ name: "--hide-online",
1586
+ value: "<on|off>",
1587
+ role: "value",
1588
+ type: "choice",
1589
+ meaning: "hide online status and last seen"
1590
+ },
1591
+ {
1592
+ name: "--last-seen",
1593
+ value: "<who>",
1594
+ role: "value",
1595
+ type: "choice",
1596
+ meaning: "who sees when the account was last online: everyone, contacts or nobody"
1597
+ },
1598
+ {
1599
+ name: "--phone-number",
1600
+ value: "<who>",
1601
+ role: "value",
1602
+ type: "choice",
1603
+ meaning: "who sees the number: everyone, contacts or nobody"
1604
+ },
1605
+ {
1606
+ name: "--profile-photo",
1607
+ value: "<who>",
1608
+ role: "value",
1609
+ type: "choice",
1610
+ meaning: "who sees the profile photo: everyone, contacts or nobody"
1611
+ },
1612
+ { name: "--read-receipts", value: "<on|off>", role: "value", type: "choice", meaning: "send read receipts" }
1613
+ ];
1614
+
1615
+ // node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-schedule.js
1616
+ var SCHEDULE_FLAGS = [
1617
+ {
1618
+ name: "--notify-on",
1619
+ value: "<when>",
1620
+ role: "value",
1621
+ type: "choice",
1622
+ meaning: "when a scheduled run tells the owner: always, failures or never"
1623
+ },
1624
+ {
1625
+ name: "--deliver-to",
1626
+ value: "<route>",
1627
+ role: "value",
1628
+ type: "string",
1629
+ meaning: "where a scheduled run's result also goes, by the owner's own CLI: telegram-bot:<profile>/<chat> or email:<profile>/<address>; repeat it for more. Not --to, which names who a message is for"
1630
+ },
1631
+ {
1632
+ name: "--max-cost-per-day",
1633
+ value: "<usd>",
1634
+ role: "budget",
1635
+ type: "number",
1636
+ meaning: "start no run for the rest of the day once the day's runs cost this much; 0 for no cap",
1637
+ unit: "US dollars"
1638
+ }
1639
+ ];
1640
+
1641
+ // node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-what.js
1494
1642
  var WHAT_FLAGS = [
1495
1643
  {
1496
1644
  name: "--analysis-provider",
@@ -1913,6 +2061,20 @@ var WHAT_FLAGS = [
1913
2061
  meaning: "look again from this day, for what arrived late"
1914
2062
  },
1915
2063
  { name: "--run", value: "<id>", role: "target", type: "id", meaning: "the run it is about" },
2064
+ {
2065
+ name: "--who",
2066
+ value: "<side>",
2067
+ role: "target",
2068
+ type: "choice",
2069
+ meaning: "whose replies are measured: me (the owner's) or others (the other side's)"
2070
+ },
2071
+ {
2072
+ name: "--write",
2073
+ value: "<id>",
2074
+ role: "target",
2075
+ type: "id",
2076
+ meaning: "one write of a run, by the operation_id its answer listed: undo or act on that write alone"
2077
+ },
1916
2078
  {
1917
2079
  name: "--target",
1918
2080
  value: "<ref>",
@@ -2115,63 +2277,6 @@ var WHAT_FLAGS = [
2115
2277
  type: "path",
2116
2278
  meaning: "an Ogg Opus file sent as a voice message"
2117
2279
  },
2118
- {
2119
- name: "--about-text",
2120
- value: "<who>",
2121
- role: "value",
2122
- type: "choice",
2123
- meaning: "who sees the about text: everyone, contacts or nobody"
2124
- },
2125
- {
2126
- name: "--calls",
2127
- value: "<who>",
2128
- role: "value",
2129
- type: "choice",
2130
- meaning: "whose calls ring: everyone, contacts or nobody"
2131
- },
2132
- {
2133
- name: "--chat-invites",
2134
- value: "<who>",
2135
- role: "value",
2136
- type: "choice",
2137
- meaning: "who may add the account to groups and channels: everyone, contacts or nobody"
2138
- },
2139
- {
2140
- name: "--find-by-phone",
2141
- value: "<who>",
2142
- role: "value",
2143
- type: "choice",
2144
- meaning: "who finds the account by its number: everyone, contacts or nobody"
2145
- },
2146
- {
2147
- name: "--hide-online",
2148
- value: "<on|off>",
2149
- role: "value",
2150
- type: "choice",
2151
- meaning: "hide online status and last seen"
2152
- },
2153
- {
2154
- name: "--last-seen",
2155
- value: "<who>",
2156
- role: "value",
2157
- type: "choice",
2158
- meaning: "who sees when the account was last online: everyone, contacts or nobody"
2159
- },
2160
- {
2161
- name: "--phone-number",
2162
- value: "<who>",
2163
- role: "value",
2164
- type: "choice",
2165
- meaning: "who sees the number: everyone, contacts or nobody"
2166
- },
2167
- {
2168
- name: "--profile-photo",
2169
- value: "<who>",
2170
- role: "value",
2171
- type: "choice",
2172
- meaning: "who sees the profile photo: everyone, contacts or nobody"
2173
- },
2174
- { name: "--read-receipts", value: "<on|off>", role: "value", type: "choice", meaning: "send read receipts" },
2175
2280
  {
2176
2281
  name: "--until",
2177
2282
  value: "<time>",
@@ -2274,6 +2379,13 @@ var WHAT_FLAGS = [
2274
2379
  type: "id",
2275
2380
  meaning: "never show this chat in it; repeat it for more"
2276
2381
  },
2382
+ {
2383
+ name: "--field",
2384
+ value: "<key=value>",
2385
+ role: "value",
2386
+ type: "string",
2387
+ meaning: "set one named field on a write, as key=value; repeat it for more"
2388
+ },
2277
2389
  {
2278
2390
  name: "--file",
2279
2391
  value: "<file>",
@@ -2488,7 +2600,7 @@ var WHAT_FLAGS = [
2488
2600
  }
2489
2601
  ];
2490
2602
 
2491
- // node_modules/.pnpm/@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/vocabulary.js
2603
+ // node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/vocabulary.js
2492
2604
  var FLAG_TYPES = [
2493
2605
  "switch",
2494
2606
  "count",
@@ -2629,6 +2741,7 @@ var verbs = [
2629
2741
  // Only when someone asks, never from a matching name: WC-ACCT-11 in docs/standards/accounts.md.
2630
2742
  ["link", "record that two identities are one person"],
2631
2743
  ["unlink", "undo a link"],
2744
+ ["allocate", "match a payment to the invoice or order it settles, in whole or in part"],
2632
2745
  ["lookup", "ask the messenger who is behind a phone number"],
2633
2746
  [
2634
2747
  "inspect",
@@ -2729,6 +2842,20 @@ var collections = [
2729
2842
  "derived records attached to a selected entity, with explicit coverage of included and omitted facets"
2730
2843
  ],
2731
2844
  ["organizations", "companies, teams, families or communities"],
2845
+ [
2846
+ "records",
2847
+ "documents of the owner's business, such as an invoice or a receipt, kept with the things they are about"
2848
+ ],
2849
+ ["invoices", "bills the owner sends or receives, with their amounts and due dates"],
2850
+ ["orders", "what a customer asked for and the owner owes or delivers"],
2851
+ ["payments", "money that moved in or out, each one matched to the invoices it settles"],
2852
+ ["deals", "sales the owner works on, each at a stage of a pipeline, with an amount and an outcome"],
2853
+ ["leads", "possible customers not yet qualified into a deal"],
2854
+ ["pipelines", "ordered sets of stages a deal moves through"],
2855
+ ["stages", "steps of a pipeline, each open, won or lost"],
2856
+ ["products", "goods and services the owner sells, with their prices"],
2857
+ ["users", "people who work in the owner's account at a service, such as a CRM's employees"],
2858
+ ["fields", "a record type's field definitions: code, label, type and options, such as a CRM's custom fields"],
2732
2859
  [
2733
2860
  "identities",
2734
2861
  "ways to reach a person or an organization: an account in one messenger or mailbox, an e-mail address, a phone"
@@ -2823,6 +2950,7 @@ var views = [
2823
2950
  ["newcomers", "members observed joining during the selected time window"],
2824
2951
  ["retention", "whether members of a selected cohort remain or return over time"],
2825
2952
  ["responses", "observed replies between participants and the time taken to answer"],
2953
+ ["waiting", "chats whose newest message waits on the owner's reply"],
2826
2954
  ["discussion", "source posts compared by known views and observed discussion replies"],
2827
2955
  ["unanswered", "questions without an observed qualifying answer"],
2828
2956
  ["me", "the account a profile's token belongs to"],
@@ -2837,6 +2965,7 @@ var roots = [
2837
2965
  ["serve", "the long-running process"],
2838
2966
  ["setup", "the guided first run: log in or link the account, then install the agent skill"],
2839
2967
  ["doctor", "check this machine's setup"],
2968
+ ["recover", "repair a damaged store: what it would do, then its run subcommand does it"],
2840
2969
  ["upgrade", "install a newer version of this tool"],
2841
2970
  ["commands", "the command tree as data"],
2842
2971
  ["guide", "scenarios: the commands for a common task, in order, and why each"],
@@ -2858,10 +2987,18 @@ var VOCABULARY = defineVocabulary({
2858
2987
  ],
2859
2988
  views: views.map(([entry, meaning]) => ({ word: entry, meaning })),
2860
2989
  roots: roots.map(([entry, meaning]) => ({ word: entry, meaning })),
2861
- flags: [...HOW_FLAGS, ...WHAT_FLAGS, ...CALENDAR_FLAGS, ...MAIL_FLAGS]
2990
+ flags: [
2991
+ ...HOW_FLAGS,
2992
+ ...WHAT_FLAGS,
2993
+ ...PRIVACY_FLAGS,
2994
+ ...CALENDAR_FLAGS,
2995
+ ...MAIL_FLAGS,
2996
+ ...CRM_FLAGS,
2997
+ ...SCHEDULE_FLAGS
2998
+ ]
2862
2999
  });
2863
3000
 
2864
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/mcp/agent.js
3001
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/mcp/agent.js
2865
3002
  var TYPES = new Map(VOCABULARY.flags.map((flag) => [flag.name, flag.type]));
2866
3003
  var snake = /* @__PURE__ */ __name((name) => name.replaceAll("|", "_or_").replace(/[^a-z0-9]+/gi, "_"), "snake");
2867
3004
  var longOf = /* @__PURE__ */ __name((option) => option.flags.match(/--[a-z0-9][a-z0-9-]*/)?.[0], "longOf");
@@ -3084,7 +3221,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
3084
3221
  }
3085
3222
  }, "runCommandForAgent");
3086
3223
 
3087
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/mcp/tool.js
3224
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/mcp/tool.js
3088
3225
  var limit = optional(pipe(number(), integer(), minValue(1), maxValue(100), description("how many")));
3089
3226
  var page = optional(pipe(number(), integer(), minValue(1), description("which page, from 1")));
3090
3227
  var message = pipe(
@@ -3340,10 +3477,10 @@ var answered = /* @__PURE__ */ __name((answer, maxBytes = DEFAULT_OUTPUT_BYTES,
3340
3477
  var failed = /* @__PURE__ */ __name((error, errors, effects) => {
3341
3478
  const judged = judgedEffects(effects);
3342
3479
  const context = { ...failureContext(errors), ...judged ? { effects: judged } : {} };
3343
- return mcpErrorResult(JSON.parse(agentJson(errorObjectOf(error, context))));
3480
+ return mcpErrorResult(JSON.parse(agentJson(errorObjectOf(storeDamaged(error), context))));
3344
3481
  }, "failed");
3345
3482
 
3346
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/mcp/surface.js
3483
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/mcp/surface.js
3347
3484
  import { randomUUID } from "node:crypto";
3348
3485
  var MATCHES = 8;
3349
3486
  var ANSWER = answerSchema();
@@ -1,10 +1,61 @@
1
1
  import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ CliError,
5
+ errorCodes
6
+ } from "./chunk-4OSSOWDM.js";
3
7
  import {
4
8
  __name
5
9
  } from "./chunk-ZVVMGPBJ.js";
6
10
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/runs/secrets.js
11
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/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 failureKey = /* @__PURE__ */ __name((error) => isCliFailure(error) ? error.code : error instanceof Error ? error.name : "error", "failureKey");
18
+ var SQLITE_CORRUPT = 11;
19
+ var SQLITE_NOTADB = 26;
20
+ var DAMAGED_TEXT = /database disk image is malformed|file is not a database|fts5: corruption/i;
21
+ var sqliteCode = /* @__PURE__ */ __name((error) => {
22
+ const { errcode, errno, name } = error ?? {};
23
+ const code = typeof errcode === "number" ? errcode : name === "SQLiteError" && typeof errno === "number" ? errno : null;
24
+ return code === null ? void 0 : code & 255;
25
+ }, "sqliteCode");
26
+ var damageIn = /* @__PURE__ */ __name((error) => {
27
+ if (isCliFailure(error) || isCommanderFailure(error))
28
+ return void 0;
29
+ let at = error;
30
+ for (let depth = 0; depth < 5 && at instanceof Error; depth += 1) {
31
+ const code = sqliteCode(at);
32
+ if (code !== void 0 && [SQLITE_CORRUPT, SQLITE_NOTADB].includes(code) || DAMAGED_TEXT.test(at.message))
33
+ return at;
34
+ at = at.cause;
35
+ }
36
+ return void 0;
37
+ }, "damageIn");
38
+ var wrapping = /* @__PURE__ */ __name((error, original) => {
39
+ Object.defineProperty(error, "cause", { value: original, configurable: true, writable: true });
40
+ if (original instanceof Error && original.stack)
41
+ error.stack = original.stack;
42
+ return error;
43
+ }, "wrapping");
44
+ 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");
45
+ var damagedFile = /* @__PURE__ */ __name(async (files, work) => {
46
+ try {
47
+ return await work();
48
+ } catch (error) {
49
+ if (!damageIn(error))
50
+ throw error;
51
+ throw wrapping(new CliError("validation_error", `${files.join(" or ")} is damaged or not a database`, {
52
+ reason: "store.file-damaged"
53
+ }), error);
54
+ }
55
+ }, "damagedFile");
56
+ var isStoreDamage = /* @__PURE__ */ __name((error) => damageIn(error) !== void 0, "isStoreDamage");
57
+
58
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/runs/secrets.js
8
59
  var SECRET_WORDS = /* @__PURE__ */ new Set([
9
60
  "authorization",
10
61
  "cookie",
@@ -87,6 +138,13 @@ var RUN = /(?<![A-Za-z0-9_+/-])[A-Za-z0-9_+/-]{20,}/g;
87
138
  var HEX = /(?<![A-Za-z0-9])(?=[0-9]*[a-f])[0-9a-f]{20,}(?![A-Za-z0-9])/g;
88
139
 
89
140
  export {
141
+ isCliFailure,
142
+ isCommanderFailure,
143
+ failureKey,
144
+ sqliteCode,
145
+ storeDamaged,
146
+ damagedFile,
147
+ isStoreDamage,
90
148
  secretNamed,
91
149
  holdsCredential,
92
150
  withoutSecrets