@wirecat/cli-memo 0.131.44 → 0.131.46

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 (149) hide show
  1. package/dist/bin/memo.js +2 -2
  2. package/dist/bundle/{all-profiles-MFZPFIHO.js → all-profiles-I2JBJDOR.js} +5 -5
  3. package/dist/bundle/{anthropic-KJBO3FCU.js → anthropic-CARSCLDG.js} +3 -3
  4. package/dist/bundle/{app-server-A2XCJDGI.js → app-server-SAMZMY3C.js} +35 -35
  5. package/dist/bundle/auto-KD7L4X6G.js +86 -0
  6. package/dist/bundle/{bun-BT7YVHDQ.js → bun-T6E2RGI5.js} +2 -2
  7. package/dist/bundle/{bun-sqlite-EG4TSO2G.js → bun-sqlite-WWDLRDBW.js} +2 -2
  8. package/dist/bundle/{chunk-GWI3XFJR.js → chunk-2FYCJ3KB.js} +3 -3
  9. package/dist/bundle/{chunk-KKDTX2LO.js → chunk-2K7E5YOZ.js} +4 -4
  10. package/dist/bundle/{chunk-E454LAVZ.js → chunk-2MKPY6NU.js} +1 -1
  11. package/dist/bundle/{chunk-N4XNQ67E.js → chunk-36DLHVMS.js} +7 -1
  12. package/dist/bundle/{chunk-45LXRNPA.js → chunk-37D3IHOG.js} +56 -56
  13. package/dist/bundle/{chunk-SP7FRSAG.js → chunk-3ZLDPPI4.js} +5 -5
  14. package/dist/bundle/{chunk-MQ66CMD3.js → chunk-5FBJQHCG.js} +2 -2
  15. package/dist/bundle/{chunk-K6UTFYOL.js → chunk-5FN27OVR.js} +4 -4
  16. package/dist/bundle/{chunk-5Q5JMJKP.js → chunk-6B75W6XW.js} +19 -9
  17. package/dist/bundle/{chunk-5HODYN65.js → chunk-7UNXTC2J.js} +43 -36
  18. package/dist/bundle/{chunk-OEOU4MLY.js → chunk-AAKU7TGI.js} +2 -2
  19. package/dist/bundle/{chunk-O4VDVY67.js → chunk-ADBD5GOY.js} +1 -1
  20. package/dist/bundle/{chunk-2HHWU7GF.js → chunk-AXCYTZJD.js} +5 -5
  21. package/dist/bundle/{chunk-Q2SZI7LP.js → chunk-BJSZECFV.js} +2 -2
  22. package/dist/bundle/{chunk-WJBLLOBC.js → chunk-CV5MM7HG.js} +1 -1
  23. package/dist/bundle/{chunk-GTN4Z7XH.js → chunk-CWBRCYDY.js} +3 -3
  24. package/dist/bundle/{chunk-GZCZKPUM.js → chunk-F7XQEYF3.js} +826 -459
  25. package/dist/bundle/{chunk-N6XUB5Z6.js → chunk-GPBUD6WS.js} +20 -20
  26. package/dist/bundle/{chunk-NXCYAOYY.js → chunk-HDNMDLWC.js} +1 -1
  27. package/dist/bundle/{chunk-IKLSYWX7.js → chunk-HE535VWC.js} +4 -4
  28. package/dist/bundle/{chunk-S4PKJOJP.js → chunk-HFQZYHLX.js} +3 -3
  29. package/dist/bundle/{chunk-YGNKWWOX.js → chunk-ICF3LNBX.js} +1 -1
  30. package/dist/bundle/{chunk-T2NE3S47.js → chunk-IEVJMRL2.js} +1 -1
  31. package/dist/bundle/{chunk-BJS2EWG5.js → chunk-IFGMJXND.js} +2 -2
  32. package/dist/bundle/{chunk-Q2XEAF7Q.js → chunk-IPNORZSF.js} +9 -9
  33. package/dist/bundle/{chunk-WNZVZE3L.js → chunk-IQJQLLAV.js} +4 -4
  34. package/dist/bundle/{chunk-CJQYTFN6.js → chunk-J6EUSJ3X.js} +3 -3
  35. package/dist/bundle/{chunk-QZDSHJMZ.js → chunk-JX6JZTOI.js} +27 -27
  36. package/dist/bundle/{chunk-QNLXDR4W.js → chunk-KGVDWSGM.js} +2 -2
  37. package/dist/bundle/{chunk-7VXPMICZ.js → chunk-LOSAAPRY.js} +6 -6
  38. package/dist/bundle/{chunk-XTLFCF35.js → chunk-LTZHG4BX.js} +7 -7
  39. package/dist/bundle/{chunk-ZIRR4BJ5.js → chunk-MKA3NOUU.js} +5 -5
  40. package/dist/bundle/{chunk-NXJZMS35.js → chunk-NFSFUVP2.js} +5 -5
  41. package/dist/bundle/{chunk-JFGPXSHH.js → chunk-PIHAI7NF.js} +4 -4
  42. package/dist/bundle/{chunk-6LXBT4F3.js → chunk-PZQCIEMC.js} +4 -2
  43. package/dist/bundle/{chunk-NEQGFKOR.js → chunk-QR5HJROX.js} +1 -1
  44. package/dist/bundle/{chunk-OBFWJJFV.js → chunk-QUUYSYCG.js} +2 -2
  45. package/dist/bundle/{chunk-NKAXCQNN.js → chunk-RF3R3W2I.js} +53 -44
  46. package/dist/bundle/{chunk-IXAHSLWQ.js → chunk-TFWTSBON.js} +89 -45
  47. package/dist/bundle/{chunk-HQXTNBEY.js → chunk-TOSRVNCY.js} +7 -7
  48. package/dist/bundle/{chunk-GZTKZRWO.js → chunk-TU34HVOY.js} +2 -2
  49. package/dist/bundle/{chunk-XIZPBRIW.js → chunk-UEMY6RSB.js} +1 -1
  50. package/dist/bundle/{chunk-OK372VP3.js → chunk-UI4MKFTZ.js} +10 -10
  51. package/dist/bundle/{chunk-BBT2TWCN.js → chunk-UT2K3TAH.js} +1 -1
  52. package/dist/bundle/{chunk-I6JHSNDD.js → chunk-UYITVRUC.js} +1 -1
  53. package/dist/bundle/{chunk-EYKJXPDD.js → chunk-V7QNIJOE.js} +7 -7
  54. package/dist/bundle/{chunk-MEO3B2OF.js → chunk-VOUTO3WF.js} +12 -12
  55. package/dist/bundle/{chunk-T3ZQDLBU.js → chunk-VUSM6XFE.js} +1 -1
  56. package/dist/bundle/{chunk-X3PFDJSJ.js → chunk-VZRGIWJM.js} +4 -4
  57. package/dist/bundle/{chunk-R2YMI2ZV.js → chunk-W2EY5PSH.js} +1 -1
  58. package/dist/bundle/{chunk-KD4A5HF6.js → chunk-WXCRRP4B.js} +1 -1
  59. package/dist/bundle/{chunk-5OOASLTP.js → chunk-XB43J5VQ.js} +8 -8
  60. package/dist/bundle/{chunk-POSVGIP5.js → chunk-XFT24B7A.js} +285 -165
  61. package/dist/bundle/{chunk-4J6U4RIU.js → chunk-YBBCGTZO.js} +1499 -767
  62. package/dist/bundle/{chunk-SWE4LSXN.js → chunk-YFZ45S6S.js} +1 -1
  63. package/dist/bundle/{chunk-GURLGLGY.js → chunk-YPD27HJI.js} +11 -11
  64. package/dist/bundle/{chunk-TK6P24AN.js → chunk-ZGQSWRCY.js} +258 -257
  65. package/dist/bundle/{command-contract-JJQE3MCP.js → command-contract-B6MBG7GI.js} +11 -11
  66. package/dist/bundle/{decode-AMWZXLFS.js → decode-E3TI4HEU.js} +2 -2
  67. package/dist/bundle/{echarts-UCAIOY4N.js → echarts-B46XTHOI.js} +2 -2
  68. package/dist/bundle/{embed-DYNZ4223.js → embed-BIUMRFOQ.js} +3 -3
  69. package/dist/bundle/{embedder-XG344VNB.js → embedder-IA3CG6LB.js} +6 -6
  70. package/dist/bundle/{entry-CIUBRSDD.js → entry-E3QEAAYL.js} +4 -4
  71. package/dist/bundle/failure-UKRO32A7.js +66 -0
  72. package/dist/bundle/{first-run-DFXU6DO2.js → first-run-6UQRVGZ4.js} +5 -5
  73. package/dist/bundle/{first-screen-QDTJRHSS.js → first-screen-W3BPVWCT.js} +12 -12
  74. package/dist/bundle/{instructions-MFAYYVVL.js → instructions-6AISOK6M.js} +1 -1
  75. package/dist/bundle/{mcp-5GUDJIDV.js → mcp-RX3COQPC.js} +35 -35
  76. package/dist/bundle/memo.js +6 -6
  77. package/dist/bundle/{node-UILGGXFZ.js → node-6GP2V36M.js} +2 -2
  78. package/dist/bundle/{node-sqlite-FJR5DRBC.js → node-sqlite-2CC5J5RZ.js} +3 -3
  79. package/dist/bundle/{oauth-2WCGPG4N.js → oauth-VOOLTPGW.js} +4 -4
  80. package/dist/bundle/{open-I7ZYXOHK.js → open-AGFSOJG6.js} +2 -2
  81. package/dist/bundle/{openai-4GB2FGUR.js → openai-KPRA5NIB.js} +7 -7
  82. package/dist/bundle/{process-NRZZD4IS.js → process-J74KA6F3.js} +1 -1
  83. package/dist/bundle/{program-HYJUSSU4.js → program-VAYJBUPU.js} +498 -300
  84. package/dist/bundle/{prompt-F5RHTE7V.js → prompt-PDQD5OD5.js} +2 -2
  85. package/dist/bundle/{recognize-UXXDJQEW.js → recognize-QH6FBB2L.js} +1 -1
  86. package/dist/bundle/{remote-IW5FTICS.js → remote-BREQR2BJ.js} +4 -4
  87. package/dist/bundle/{rerank-RRLNQ5C2.js → rerank-HWNJXOHL.js} +4 -4
  88. package/dist/bundle/{serve-GXJLUYCV.js → serve-A63VR5F4.js} +6 -6
  89. package/dist/bundle/server-3FKLHDFN.js +48 -0
  90. package/dist/bundle/{server-646V4VPF.js → server-6UZJQQ4E.js} +50 -50
  91. package/dist/bundle/server-XKZXPS7I.js +61 -0
  92. package/dist/bundle/{state-3NLLRTD2.js → state-GMJJEIPI.js} +3 -3
  93. package/dist/bundle/{store-3DFD7E66.js → store-HLK3ZQ7A.js} +11 -9
  94. package/dist/bundle/store-maintenance-command-2WOANSCK.js +48 -0
  95. package/dist/bundle/update-GIAB6TXY.js +69 -0
  96. package/dist/digest/command.d.ts.map +1 -1
  97. package/dist/digest/command.js +2 -1
  98. package/dist/digest/command.js.map +1 -1
  99. package/dist/digest/digest.d.ts +5 -0
  100. package/dist/digest/digest.d.ts.map +1 -1
  101. package/dist/digest/digest.js +19 -5
  102. package/dist/digest/digest.js.map +1 -1
  103. package/dist/digest/known.d.ts +7 -0
  104. package/dist/digest/known.d.ts.map +1 -0
  105. package/dist/digest/known.js +28 -0
  106. package/dist/digest/known.js.map +1 -0
  107. package/dist/digest/text.d.ts.map +1 -1
  108. package/dist/digest/text.js +13 -1
  109. package/dist/digest/text.js.map +1 -1
  110. package/dist/doctor/command.d.ts +1 -1
  111. package/dist/mail/findings-command.d.ts.map +1 -1
  112. package/dist/mail/findings-command.js +20 -3
  113. package/dist/mail/findings-command.js.map +1 -1
  114. package/dist/mail/findings-duplicates.d.ts +19 -0
  115. package/dist/mail/findings-duplicates.d.ts.map +1 -0
  116. package/dist/mail/findings-duplicates.js +159 -0
  117. package/dist/mail/findings-duplicates.js.map +1 -0
  118. package/dist/program.d.ts.map +1 -1
  119. package/dist/program.js +0 -63
  120. package/dist/program.js.map +1 -1
  121. package/dist/reasons.d.ts.map +1 -1
  122. package/dist/reasons.js +6 -0
  123. package/dist/reasons.js.map +1 -1
  124. package/dist/schedule/command.d.ts.map +1 -1
  125. package/dist/schedule/command.js +2 -0
  126. package/dist/schedule/command.js.map +1 -1
  127. package/dist/schedule/mail-triage-input.d.ts +24 -0
  128. package/dist/schedule/mail-triage-input.d.ts.map +1 -0
  129. package/dist/schedule/mail-triage-input.js +53 -0
  130. package/dist/schedule/mail-triage-input.js.map +1 -0
  131. package/dist/search/command.d.ts.map +1 -1
  132. package/dist/search/command.js +3 -1
  133. package/dist/search/command.js.map +1 -1
  134. package/dist/search/search.d.ts.map +1 -1
  135. package/dist/search/search.js +10 -2
  136. package/dist/search/search.js.map +1 -1
  137. package/dist/version.d.ts +1 -1
  138. package/dist/version.js +1 -1
  139. package/package.json +3 -3
  140. package/skills/cli-memo/SKILL.md +3 -1
  141. package/skills/mail-triage/SKILL.md +25 -27
  142. package/skills/morning-digest/SKILL.md +5 -4
  143. package/dist/bundle/auto-W3BUP6YI.js +0 -86
  144. package/dist/bundle/failure-JTQUF4RT.js +0 -66
  145. package/dist/bundle/server-DJUCOKNC.js +0 -48
  146. package/dist/bundle/server-ITBSOGIC.js +0 -61
  147. package/dist/bundle/store-maintenance-command-D7O6QCVF.js +0 -48
  148. package/dist/bundle/update-GQFRQVAV.js +0 -69
  149. /package/dist/bundle/{chunk-NJG67ZXD.js → chunk-B6ZCQNF4.js} +0 -0
@@ -3,7 +3,7 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  answerOf,
5
5
  messengerContext
6
- } from "./chunk-NKAXCQNN.js";
6
+ } from "./chunk-RF3R3W2I.js";
7
7
  import {
8
8
  FETCHING,
9
9
  RULES_VERSION,
@@ -24,7 +24,7 @@ import {
24
24
  typedQuery,
25
25
  withQuery,
26
26
  withTimeLimit
27
- } from "./chunk-TK6P24AN.js";
27
+ } from "./chunk-ZGQSWRCY.js";
28
28
  import {
29
29
  stringWidth,
30
30
  wrapAnsi
@@ -56,23 +56,23 @@ import {
56
56
  snakeKeys,
57
57
  storeTable,
58
58
  withoutProviderRefs
59
- } from "./chunk-POSVGIP5.js";
59
+ } from "./chunk-XFT24B7A.js";
60
60
  import {
61
61
  failureKey
62
- } from "./chunk-EYKJXPDD.js";
62
+ } from "./chunk-V7QNIJOE.js";
63
63
  import {
64
64
  envName
65
- } from "./chunk-BBT2TWCN.js";
65
+ } from "./chunk-UT2K3TAH.js";
66
66
  import {
67
67
  holdLock,
68
68
  lockPath,
69
69
  releaseLock,
70
70
  servingProfiles,
71
71
  takeLock
72
- } from "./chunk-MQ66CMD3.js";
72
+ } from "./chunk-5FBJQHCG.js";
73
73
  import {
74
74
  holdersOf
75
- } from "./chunk-T3ZQDLBU.js";
75
+ } from "./chunk-VUSM6XFE.js";
76
76
  import {
77
77
  MIGRATIONS,
78
78
  drainNoteIndex,
@@ -94,6 +94,7 @@ import {
94
94
  resetNoteIndex,
95
95
  resetSearchIndex,
96
96
  resetStems,
97
+ rollBack,
97
98
  rowCounts,
98
99
  searchIndexState,
99
100
  stemmerCache,
@@ -101,28 +102,28 @@ import {
101
102
  storeClients,
102
103
  storeContents,
103
104
  vectorIndexCounts
104
- } from "./chunk-4J6U4RIU.js";
105
+ } from "./chunk-YBBCGTZO.js";
105
106
  import {
106
107
  queryFieldsOf
107
- } from "./chunk-45LXRNPA.js";
108
+ } from "./chunk-37D3IHOG.js";
108
109
  import {
109
110
  readSecret
110
- } from "./chunk-QNLXDR4W.js";
111
+ } from "./chunk-KGVDWSGM.js";
111
112
  import {
112
113
  checkedOptions,
113
114
  range
114
- } from "./chunk-WJBLLOBC.js";
115
+ } from "./chunk-CV5MM7HG.js";
115
116
  import {
116
117
  messagesFor,
117
118
  systemFor,
118
119
  validateImages
119
- } from "./chunk-KD4A5HF6.js";
120
+ } from "./chunk-WXCRRP4B.js";
120
121
  import {
121
122
  storePath
122
- } from "./chunk-R2YMI2ZV.js";
123
+ } from "./chunk-W2EY5PSH.js";
123
124
  import {
124
125
  openCache
125
- } from "./chunk-SP7FRSAG.js";
126
+ } from "./chunk-3ZLDPPI4.js";
126
127
  import {
127
128
  Credentials,
128
129
  pathsAreOverridden,
@@ -5497,11 +5498,11 @@ var require_liquid_node = __commonJS({
5497
5498
  }
5498
5499
  });
5499
5500
 
5500
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
5501
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
5501
5502
  import { chmodSync, constants, copyFileSync, existsSync as existsSync7, mkdirSync, realpathSync, renameSync as renameSync2, rmSync as rmSync2, statfsSync, statSync as statSync3, writeFileSync } from "node:fs";
5502
5503
  import { dirname, resolve } from "node:path";
5503
5504
 
5504
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/sealed.js
5505
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/sealed.js
5505
5506
  import { createCipheriv, createDecipheriv, createHash, randomBytes, scrypt, timingSafeEqual } from "node:crypto";
5506
5507
  import { closeSync, createReadStream, createWriteStream, existsSync, openSync, readSync, renameSync, rmSync, statSync } from "node:fs";
5507
5508
  import { Transform } from "node:stream";
@@ -5608,7 +5609,7 @@ var unsealFile = /* @__PURE__ */ __name(async (from, to, password) => {
5608
5609
  renameSync(pending, to);
5609
5610
  }, "unsealFile");
5610
5611
 
5611
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/store/compatibility.js
5612
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/store/compatibility.js
5612
5613
  var SPEAKS = MIGRATIONS.at(-1)?.version ?? 0;
5613
5614
  var fileSchemaOf = /* @__PURE__ */ __name((database) => {
5614
5615
  const tracked = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'schema_migrations'").get();
@@ -5632,7 +5633,7 @@ var compatibilityOf = /* @__PURE__ */ __name((file2, migrations = MIGRATIONS) =>
5632
5633
  };
5633
5634
  }, "compatibilityOf");
5634
5635
 
5635
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/store/repair.js
5636
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/store/repair.js
5636
5637
  import { createHash as createHash2 } from "node:crypto";
5637
5638
  var COPY_MARK = "__repair_";
5638
5639
  var COPY_NAME = /__repair_[0-9a-f]{8}(_\d+)?$/;
@@ -5886,7 +5887,7 @@ var deleteCopy = /* @__PURE__ */ __name((database, name) => {
5886
5887
  return found;
5887
5888
  }, "deleteCopy");
5888
5889
 
5889
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/cli/store-info.js
5890
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/cli/store-info.js
5890
5891
  import { existsSync as existsSync2, statSync as statSync2 } from "node:fs";
5891
5892
  var pendingIfKnown = /* @__PURE__ */ __name((database) => database.prepare("SELECT 1 FROM pragma_table_info('messages') WHERE name = 'normalized_text'").get() ? pendingNormalization(database) : null, "pendingIfKnown");
5892
5893
  var bytesOf = /* @__PURE__ */ __name((path) => existsSync2(path) ? statSync2(path).size : 0, "bytesOf");
@@ -5933,7 +5934,7 @@ var storeInfoCommand = /* @__PURE__ */ __name(() => annotate(new Command("info")
5933
5934
  renderAnswer(this, outputFor(this), itemOf(answer));
5934
5935
  }), "storeInfoCommand");
5935
5936
 
5936
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
5937
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
5937
5938
  var ENCRYPT_OPTION = [
5938
5939
  "--encrypt",
5939
5940
  "compress and encrypt with a password, typed at a hidden prompt or piped on stdin; it is never kept \u2014 lose it and the file cannot be opened"
@@ -5952,7 +5953,7 @@ var passwordOf = /* @__PURE__ */ __name(async (command, { twice }) => {
5952
5953
  return password;
5953
5954
  }, "passwordOf");
5954
5955
 
5955
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/replies/rules.js
5956
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/replies/rules.js
5956
5957
  import { existsSync as existsSync3, readFileSync } from "node:fs";
5957
5958
  import { join } from "node:path";
5958
5959
  var REPLY_ACTIONS = ["reply", "task"];
@@ -6123,7 +6124,7 @@ var problem = /* @__PURE__ */ __name((issue) => {
6123
6124
  }, "problem");
6124
6125
  var broken = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply rules ${path} cannot be read (${why}) \u2014 fix the file`), "broken");
6125
6126
 
6126
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/replies/state.js
6127
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/replies/state.js
6127
6128
  import { existsSync as existsSync4, readFileSync as readFileSync2 } from "node:fs";
6128
6129
  import { join as join2 } from "node:path";
6129
6130
  var ANSWERED_KEPT = 1e3;
@@ -6176,7 +6177,7 @@ var recordReply = /* @__PURE__ */ __name((state, rule2, message, now) => {
6176
6177
  }, "recordReply");
6177
6178
  var broken2 = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply state ${path} cannot be read (${why}) \u2014 fix or move the file`), "broken");
6178
6179
 
6179
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/replies/decide.js
6180
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/replies/decide.js
6180
6181
  var skip = /* @__PURE__ */ __name((why) => ({ skip: why }), "skip");
6181
6182
  var decide = /* @__PURE__ */ __name((rule2, incoming, state, now) => {
6182
6183
  const { message, chat, owner, sender } = incoming;
@@ -6282,7 +6283,7 @@ var filled = /* @__PURE__ */ __name((template2, senderName) => {
6282
6283
  return template2.replaceAll("{firstName}", name.split(/\s+/)[0] ?? name).replaceAll("{name}", name);
6283
6284
  }, "filled");
6284
6285
 
6285
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/replies/template.js
6286
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/replies/template.js
6286
6287
  var import_liquidjs = __toESM(require_liquid_node(), 1);
6287
6288
  var TEMPLATE_LIMITS = {
6288
6289
  parse: 32768,
@@ -6442,7 +6443,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
6442
6443
  }
6443
6444
  }, "renderReplyTemplate");
6444
6445
 
6445
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
6446
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
6446
6447
  var DRY_RUN_DAYS = 7;
6447
6448
  var PAGE = 500;
6448
6449
  var dryRun = /* @__PURE__ */ __name(async (store, account, rules, { since, until = Date.now(), only, audience, render }) => {
@@ -6556,7 +6557,7 @@ var storedSince = /* @__PURE__ */ __name(async (store, account, chat, since) =>
6556
6557
  }
6557
6558
  }, "storedSince");
6558
6559
 
6559
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
6560
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
6560
6561
  var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
6561
6562
  const host = new URL(baseUrl).host;
6562
6563
  return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
@@ -6587,7 +6588,7 @@ var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) =>
6587
6588
  };
6588
6589
  }, "embeddingKeys");
6589
6590
 
6590
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/models/openai.js
6591
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/models/openai.js
6591
6592
  var options = strictObject({
6592
6593
  temperature: range(0, 2),
6593
6594
  top_p: range(0, 1),
@@ -6636,7 +6637,7 @@ var openai = {
6636
6637
  }), "complete")
6637
6638
  };
6638
6639
 
6639
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/models/index.js
6640
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/models/index.js
6640
6641
  var modelGateway = /* @__PURE__ */ __name((deps) => ({
6641
6642
  complete: /* @__PURE__ */ __name(async (request) => {
6642
6643
  if (deps.signal?.aborted)
@@ -6651,7 +6652,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
6651
6652
  if (!adapter && target.provider === "openai")
6652
6653
  adapter = openai;
6653
6654
  if (!adapter && target.provider === "anthropic")
6654
- adapter = (await import("./anthropic-KJBO3FCU.js")).anthropic;
6655
+ adapter = (await import("./anthropic-CARSCLDG.js")).anthropic;
6655
6656
  if (!adapter)
6656
6657
  throw new CliError("validation_error", `no model adapter for ${target.provider}`);
6657
6658
  if (request.images !== void 0 && adapter.images !== true)
@@ -6692,7 +6693,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
6692
6693
  }, "complete")
6693
6694
  }), "modelGateway");
6694
6695
 
6695
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/replies/consents.js
6696
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/replies/consents.js
6696
6697
  import { existsSync as existsSync5, readFileSync as readFileSync3 } from "node:fs";
6697
6698
  import { join as join3 } from "node:path";
6698
6699
  var shape = strictObject({
@@ -6717,7 +6718,7 @@ var mayModelReply = /* @__PURE__ */ __name((path, provider, chat) => {
6717
6718
  return consent.provider === provider && !consent.deniedChats.includes(chat);
6718
6719
  }, "mayModelReply");
6719
6720
 
6720
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/replies/rendering.js
6721
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/replies/rendering.js
6721
6722
  var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, options2 = {
6722
6723
  ai: true
6723
6724
  }) => async (rule2, message, chat, now) => {
@@ -6764,7 +6765,7 @@ var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, o
6764
6765
  return result2;
6765
6766
  }, "replyRenderer");
6766
6767
 
6767
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/replies/serve.js
6768
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/replies/serve.js
6768
6769
  var NOT_ALLOWED = "replies.send is not allow";
6769
6770
  var NO_RULES = "no rules";
6770
6771
  var ONLY_TASK = "opened a task, sent nothing";
@@ -6857,7 +6858,7 @@ var replyTo = /* @__PURE__ */ __name(async (deps, message) => {
6857
6858
  return { skip: why };
6858
6859
  }, "replyTo");
6859
6860
 
6860
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-catch-up.js
6861
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-catch-up.js
6861
6862
  var START_SYNC_DELAY_MS = 3e4;
6862
6863
  var START_SYNC_BUDGET_MS = 5 * 6e4;
6863
6864
  var START_SYNC_WINDOW_MS = 7 * 864e5;
@@ -6934,7 +6935,7 @@ var startSync = /* @__PURE__ */ __name(({ chats, newestHeld, fetch: fetch2, note
6934
6935
  };
6935
6936
  }, "startSync");
6936
6937
 
6937
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
6938
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
6938
6939
  var FIRST_FETCH_MS = 6e4;
6939
6940
  var DAY_MS = 864e5;
6940
6941
  var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, firstMs = FIRST_FETCH_MS, everyMs = DAY_MS }) => {
@@ -6988,7 +6989,7 @@ var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, fi
6988
6989
  };
6989
6990
  }, "memberFetches");
6990
6991
 
6991
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
6992
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
6992
6993
  var record2 = /* @__PURE__ */ __name((context, app, severity, attributes) => recordLogFor(context.streams.diagnostic, app, { command: currentRun().command || "serve" })[severity](attributes), "record");
6993
6994
  var noticeFor = /* @__PURE__ */ __name((context, app, severity = "warn") => ({ text, ...attributes }) => {
6994
6995
  if (context.format === "pretty") {
@@ -7021,7 +7022,7 @@ var recordDiagnostics = /* @__PURE__ */ __name((context, app) => {
7021
7022
  return context;
7022
7023
  }, "recordDiagnostics");
7023
7024
 
7024
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
7025
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
7025
7026
  var STEMS_EVERY_MS = 3e4;
7026
7027
  var STEMS_SLICE_MS = 2e3;
7027
7028
  var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY_MS, sliceMs = STEMS_SLICE_MS }) => {
@@ -7061,7 +7062,7 @@ var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY
7061
7062
  };
7062
7063
  }, "stemFills");
7063
7064
 
7064
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/render/messages.js
7065
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/render/messages.js
7065
7066
  import { styleText } from "node:util";
7066
7067
  var TIME_WIDTH = 8;
7067
7068
  var INDENT = " ".repeat(TIME_WIDTH + 2);
@@ -7237,7 +7238,7 @@ var editedAt = /* @__PURE__ */ __name((message, options2) => {
7237
7238
  return day(edited) === day(message.timestamp) ? time : `${day(edited)} ${time}`;
7238
7239
  }, "editedAt");
7239
7240
 
7240
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
7241
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
7241
7242
  var defined = /* @__PURE__ */ __name((value) => Object.fromEntries(Object.entries(value).filter(([, one]) => one !== void 0)), "defined");
7242
7243
  var attachmentItem = /* @__PURE__ */ __name((attachment) => defined({
7243
7244
  kind: attachment.kind,
@@ -7332,7 +7333,7 @@ var viewOf = /* @__PURE__ */ __name((context, messenger) => ({
7332
7333
  locale: messenger.app.locale
7333
7334
  }), "viewOf");
7334
7335
 
7335
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
7336
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
7336
7337
  var observed = /* @__PURE__ */ __name((value) => ({
7337
7338
  value: value.value,
7338
7339
  observed_at: value.observedAt,
@@ -7399,7 +7400,7 @@ var watchEventItem = /* @__PURE__ */ __name((value, account) => {
7399
7400
  }
7400
7401
  }, "watchEventItem");
7401
7402
 
7402
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
7403
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
7403
7404
  var watchCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("watch"), {
7404
7405
  output: { entity: "watch_item" },
7405
7406
  effects: REMOTE_READ,
@@ -7554,7 +7555,7 @@ var describe = /* @__PURE__ */ __name((event, render) => {
7554
7555
  }
7555
7556
  }, "describe");
7556
7557
 
7557
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
7558
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
7558
7559
  var serveCommand = /* @__PURE__ */ __name((messenger) => {
7559
7560
  const command = annotate(new Command("serve"), {
7560
7561
  output: { entity: "serve_summary" },
@@ -7818,7 +7819,7 @@ var tasking = /* @__PURE__ */ __name((context, warn) => {
7818
7819
  };
7819
7820
  }, "tasking");
7820
7821
 
7821
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
7822
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
7822
7823
  import { existsSync as existsSync6 } from "node:fs";
7823
7824
  var PATH = "store tables list";
7824
7825
  var STORE_TABLES_QUERY = {
@@ -7861,7 +7862,7 @@ var storeTablesCommand = /* @__PURE__ */ __name((messenger) => {
7861
7862
  return tables;
7862
7863
  }, "storeTablesCommand");
7863
7864
 
7864
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
7865
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
7865
7866
  var SEARCH_INDEXES = ["messages_fts", "chats_fts", "identities_fts"];
7866
7867
  var WORD_INDEX = "message_words";
7867
7868
  var schemaOf = /* @__PURE__ */ __name((database) => {
@@ -8137,7 +8138,11 @@ var migrateCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command(
8137
8138
  }
8138
8139
  const answer = await reading(path, (database) => {
8139
8140
  const from = schemaOf(database).version;
8140
- migrate(database, { command: messenger.app.command, version: messenger.app.version });
8141
+ migrate(database, {
8142
+ command: messenger.app.command,
8143
+ version: messenger.app.version,
8144
+ rollback: { store: path, warn: /* @__PURE__ */ __name((line) => renderer.warn(line), "warn") }
8145
+ });
8141
8146
  const { normalized, indexed, terms } = buildWordIndex(database, (note) => renderer.note(note));
8142
8147
  const stemmed = buildStems(database, (note) => renderer.note(note));
8143
8148
  const notes = buildNoteIndex(database, (note) => renderer.note(note));
@@ -8276,7 +8281,7 @@ var decryptCommand = /* @__PURE__ */ __name(() => annotate(new Command("decrypt"
8276
8281
  await unsealFile(from, to, await passwordOf(this, { twice: false }));
8277
8282
  result(this, { path: to, from, bytes: bytesOf2(to) });
8278
8283
  }), "decryptCommand");
8279
- var restoreCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("restore"), { output: { entity: "store_restore" }, effects: LOCAL_WRITE }).summary("restore a backup while keeping the current store").description("put a backup in place of the store; the store it replaces is kept beside it, never deleted").argument("<file>", "a file `store backup` wrote; one written with --encrypt asks for its password").action(async function(file2) {
8284
+ var restoreCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("restore"), { output: { entity: "store_restore" }, effects: LOCAL_WRITE }).summary("restore a backup and keep the current store, or roll back a breaking upgrade").description("put a backup in place of the store; the store it replaces is kept beside it, never deleted. Given a rollback copy (backups/<store>-rollback-schema-<version>-<time>.db, kept for a day before an upgrade older tools cannot open), put its tables back in the store and return it to that version instead").argument("<file>", "a file `store backup` wrote, or a rollback copy; one written with --encrypt asks for its password").action(async function(file2) {
8280
8285
  const path = storePath(environmentOf(this).env ?? process.env);
8281
8286
  const given = resolve(file2);
8282
8287
  if (!existsSync7(given))
@@ -8299,6 +8304,8 @@ var restoreFrom = /* @__PURE__ */ __name(async (command, messenger, backup, give
8299
8304
  if (existsSync7(path) && realpathSync(backup) === realpathSync(path)) {
8300
8305
  throw new CliError("validation_error", `${backup} is the store itself`);
8301
8306
  }
8307
+ if (await isRollbackCopy(backup))
8308
+ return rollBackFrom(command, messenger, backup);
8302
8309
  const schema = await backupSchema(backup);
8303
8310
  const stamp = stampNow();
8304
8311
  const kept = existsSync7(path) ? `${path}.before-restore-${stamp}` : null;
@@ -8325,6 +8332,43 @@ var restoreFrom = /* @__PURE__ */ __name(async (command, messenger, backup, give
8325
8332
  renderer.note(`the backup is behind this build; the next command migrates it \u2014 \`${lineOf(command, "store migrate")}\` now`);
8326
8333
  }
8327
8334
  }, "restoreFrom");
8335
+ var isRollbackCopy = /* @__PURE__ */ __name(async (file2) => {
8336
+ try {
8337
+ return await readingOnly(file2, (database) => database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'rollback_meta'").get() !== void 0);
8338
+ } catch {
8339
+ return false;
8340
+ }
8341
+ }, "isRollbackCopy");
8342
+ var rollBackFrom = /* @__PURE__ */ __name(async (command, messenger, copy) => {
8343
+ const { renderer } = outputFor(command);
8344
+ const path = storePath(environmentOf(command).env ?? process.env);
8345
+ if (!existsSync7(path))
8346
+ throw new CliError("not_found", `no store at ${path} to roll back`);
8347
+ const waitMs = environmentOf(command).storeLockWaitMs;
8348
+ await quiesce(path, messenger, "restore", (message) => renderer.warn(message), waitMs);
8349
+ const { database } = await openSqlite(path);
8350
+ let rolled;
8351
+ try {
8352
+ rolled = rollBack(database, copy);
8353
+ } finally {
8354
+ database.close();
8355
+ }
8356
+ result(command, {
8357
+ path,
8358
+ restoredFrom: copy,
8359
+ rolledBack: true,
8360
+ schema: rolled.from,
8361
+ was: rolled.was,
8362
+ tables: rolled.restored,
8363
+ rebuilt: rolled.rebuilt,
8364
+ foreignKeyViolations: rolled.foreignKeyViolations
8365
+ });
8366
+ const taken = new Date(rolled.createdAt).toISOString();
8367
+ renderer.note(`the store is back at schema ${rolled.from}; ${rolled.tables.length > 0 ? rolled.tables.join(", ") : "no table"} hold what they held at ${taken}, and what was written to them since is not kept`);
8368
+ renderer.note("open it with the older tool and run its `store rebuild`: the search indexes are behind the tables");
8369
+ renderer.note(`a tool that speaks schema ${rolled.to} or later migrates it again on its next run`);
8370
+ renderer.note("restart every serve and mcp of either CLI that was running, so they read the restored store");
8371
+ }, "rollBackFrom");
8328
8372
  var backupSchema = /* @__PURE__ */ __name(async (backup) => {
8329
8373
  let read;
8330
8374
  try {
@@ -7,7 +7,7 @@ import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/search/languages.js
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/search/languages.js
11
11
  var LANGUAGES = [
12
12
  { name: "russian", code: "ru", label: "Russian", script: "cyrillic", dictionary: "dictionary-ru" },
13
13
  { name: "english", code: "en", label: "English", script: "latin", dictionary: "dictionary-en" },
@@ -15,12 +15,12 @@ var LANGUAGES = [
15
15
  ];
16
16
  var languagesOf = /* @__PURE__ */ __name((script) => LANGUAGES.filter((one) => one.script === script).map(({ name }) => name), "languagesOf");
17
17
 
18
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/store/normalize.js
18
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/store/normalize.js
19
19
  var NORMALIZER_VERSION = 1;
20
20
  var fold = /* @__PURE__ */ __name((text) => text.normalize("NFKD").replace(new RegExp("\\p{M}+", "gu"), "").normalize("NFC").toLowerCase(), "fold");
21
21
  var normalize = /* @__PURE__ */ __name((text) => fold(text).replace(new RegExp("\\p{Cc}", "gu"), " ").replace(/\s+/gu, " ").trim(), "normalize");
22
22
 
23
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/search/snowball/base-stemmer.js
23
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/search/snowball/base-stemmer.js
24
24
  var BaseStemmer = class {
25
25
  static {
26
26
  __name(this, "BaseStemmer");
@@ -395,7 +395,7 @@ var BaseStemmer = class {
395
395
  }
396
396
  };
397
397
 
398
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/search/snowball/english-stemmer.js
398
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/search/snowball/english-stemmer.js
399
399
  var a_0 = [
400
400
  ["arsen", -1],
401
401
  ["commun", -1],
@@ -1096,7 +1096,7 @@ var english_stemmer_default = class extends BaseStemmer {
1096
1096
  stemWord = this.stem;
1097
1097
  };
1098
1098
 
1099
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/search/snowball/russian-stemmer.js
1099
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/search/snowball/russian-stemmer.js
1100
1100
  var a_02 = [
1101
1101
  ["\u0432", 1],
1102
1102
  ["\u0438\u0432", 2, 1],
@@ -1519,7 +1519,7 @@ var russian_stemmer_default = class extends BaseStemmer {
1519
1519
  stemWord = this.stem;
1520
1520
  };
1521
1521
 
1522
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/search/snowball/spanish-stemmer.js
1522
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/search/snowball/spanish-stemmer.js
1523
1523
  var a_03 = [
1524
1524
  ["", 6],
1525
1525
  ["\xE1", 1, 1],
@@ -2195,7 +2195,7 @@ var spanish_stemmer_default = class extends BaseStemmer {
2195
2195
  stemWord = this.stem;
2196
2196
  };
2197
2197
 
2198
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/search/stem.js
2198
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/search/stem.js
2199
2199
  var SNOWBALL_VERSION = "3.1.1";
2200
2200
  var CYRILLIC_STEMMERS = [...languagesOf("cyrillic"), "none"];
2201
2201
  var LATIN_STEMMERS = [...languagesOf("latin"), "none"];
@@ -7,12 +7,12 @@ import {
7
7
  agentOf,
8
8
  clientHash,
9
9
  currentCaller
10
- } from "./chunk-EYKJXPDD.js";
10
+ } from "./chunk-V7QNIJOE.js";
11
11
  import {
12
12
  __name
13
13
  } from "./chunk-ZVVMGPBJ.js";
14
14
 
15
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/mcp/caller.js
15
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/mcp/caller.js
16
16
  var callingAgent = /* @__PURE__ */ __name((fallback, caller = currentCaller()) => {
17
17
  const client = caller?.agent?.client?.name;
18
18
  if (client && client !== "unknown")
@@ -7,7 +7,7 @@ import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/http/public-url.js
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/http/public-url.js
11
11
  var EXAMPLE = "--public-url https://<name>.ts.net";
12
12
  var publicUrlOf = /* @__PURE__ */ __name((given, { missing, reaches, path = false }) => {
13
13
  if (!given)
@@ -8,17 +8,17 @@ import {
8
8
  readSetupAnswers,
9
9
  unanswered,
10
10
  writeSetupAnswers
11
- } from "./chunk-S4PKJOJP.js";
11
+ } from "./chunk-HFQZYHLX.js";
12
12
  import {
13
13
  DEFAULT_STEMMERS,
14
14
  LANGUAGES
15
- } from "./chunk-HQXTNBEY.js";
15
+ } from "./chunk-TOSRVNCY.js";
16
16
  import {
17
17
  sharedConfigPath
18
- } from "./chunk-X3PFDJSJ.js";
18
+ } from "./chunk-VZRGIWJM.js";
19
19
  import {
20
20
  storePath
21
- } from "./chunk-R2YMI2ZV.js";
21
+ } from "./chunk-W2EY5PSH.js";
22
22
  import {
23
23
  installerOf
24
24
  } from "./chunk-CID4MNRQ.js";
@@ -26,7 +26,7 @@ import {
26
26
  __name
27
27
  } from "./chunk-ZVVMGPBJ.js";
28
28
 
29
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/cli/first-run.js
29
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/cli/first-run.js
30
30
  import { spawnSync } from "node:child_process";
31
31
  import { accessSync, constants, realpathSync } from "node:fs";
32
32
  import { delimiter, join } from "node:path";
@@ -84,7 +84,7 @@ var suggested = /* @__PURE__ */ __name((env, contentLanguages) => {
84
84
  return (own.length ? own : LANGUAGES.filter(({ code }) => code === "en" || code === system)).map(({ name }) => name);
85
85
  }, "suggested");
86
86
  var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLanguages }) => {
87
- const { openStore } = await import("./store-3DFD7E66.js");
87
+ const { openStore } = await import("./store-HLK3ZQ7A.js");
88
88
  const store = await openStore({ env });
89
89
  let rebuild = false;
90
90
  try {
@@ -113,8 +113,8 @@ var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLang
113
113
  if (!rebuild)
114
114
  return;
115
115
  const [{ openCache }, { buildStems }] = await Promise.all([
116
- import("./open-I7ZYXOHK.js"),
117
- import("./store-maintenance-command-D7O6QCVF.js")
116
+ import("./open-AGFSOJG6.js"),
117
+ import("./store-maintenance-command-2WOANSCK.js")
118
118
  ]);
119
119
  const database = await openCache(storePath(env));
120
120
  try {
@@ -126,7 +126,7 @@ var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLang
126
126
  var askTools = /* @__PURE__ */ __name(async (run) => {
127
127
  const { command, env, io } = run;
128
128
  const installed = run.installed ?? ((name) => onPath(name, env));
129
- const { WIRECAT_TOOLS } = await import("./first-screen-QDTJRHSS.js");
129
+ const { WIRECAT_TOOLS } = await import("./first-screen-W3BPVWCT.js");
130
130
  const others = WIRECAT_TOOLS.filter((tool) => tool.command !== command);
131
131
  const missing = others.filter((tool) => !installed(tool.command));
132
132
  io.say("Other WireCat tools \u2014 they share this store, so one search finds everything:");
@@ -199,7 +199,7 @@ var setupAtStart = /* @__PURE__ */ __name(async (start) => {
199
199
  contentLanguages: start.contentLanguages,
200
200
  all: start.path[0] === "setup",
201
201
  io: {
202
- ask: /* @__PURE__ */ __name(async (prompt) => (await import("./prompt-F5RHTE7V.js")).readSecret(prompt, { input, echo: true }), "ask"),
202
+ ask: /* @__PURE__ */ __name(async (prompt) => (await import("./prompt-PDQD5OD5.js")).readSecret(prompt, { input, echo: true }), "ask"),
203
203
  say: /* @__PURE__ */ __name((text) => process.stderr.write(`${text}
204
204
  `), "say")
205
205
  }
@@ -7,7 +7,7 @@ import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/ports/app.js
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/ports/app.js
11
11
  var envName = /* @__PURE__ */ __name((app, name) => `${app.envPrefix}_${name}`, "envName");
12
12
  var readOnlyLockOf = /* @__PURE__ */ __name((app, env) => {
13
13
  const name = envName(app, "READ_ONLY");
@@ -10,7 +10,7 @@ import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
12
12
 
13
- // node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_4d927264f4292101afd5535290652319/node_modules/@wirecat/cli-core/dist/store/vector-extension.js
13
+ // node_modules/.pnpm/@wirecat+cli-core@0.597.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_e61f089635abd97613f35385460a4858/node_modules/@wirecat/cli-core/dist/store/vector-extension.js
14
14
  import { readFileSync } from "node:fs";
15
15
  var musl = /* @__PURE__ */ __name(() => {
16
16
  if (process.platform !== "linux")