@wirecat/cli-memo 0.131.51 → 0.131.53

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 (120) hide show
  1. package/dist/bin/memo.js +2 -2
  2. package/dist/bundle/{all-profiles-3R3VE3W2.js → all-profiles-PJR2VHDP.js} +5 -5
  3. package/dist/bundle/{anthropic-QVYJRACM.js → anthropic-ZUDIWREK.js} +3 -3
  4. package/dist/bundle/{app-server-T3D2PIGZ.js → app-server-EYNQ4L2V.js} +35 -35
  5. package/dist/bundle/auto-JV4T2URZ.js +86 -0
  6. package/dist/bundle/{bun-DTDD2OHK.js → bun-W2ZP6I6Z.js} +2 -2
  7. package/dist/bundle/{bun-sqlite-DWICJAH3.js → bun-sqlite-T2CTJ6AR.js} +2 -2
  8. package/dist/bundle/{chunk-QFC7V5VW.js → chunk-26QKDK5P.js} +5 -5
  9. package/dist/bundle/{chunk-H65NWA3X.js → chunk-2NVP4FZH.js} +1 -1
  10. package/dist/bundle/{chunk-O5UP2KZL.js → chunk-34GJQ4ZR.js} +1 -1
  11. package/dist/bundle/{chunk-RL2DSQCD.js → chunk-3MWNNJII.js} +8 -8
  12. package/dist/bundle/{chunk-OBVKXHOH.js → chunk-4335SGVD.js} +2287 -1326
  13. package/dist/bundle/{chunk-OJFRMK2W.js → chunk-4VQ7FPNW.js} +3 -3
  14. package/dist/bundle/{chunk-5ZGOT57S.js → chunk-5UM2OEOR.js} +2 -2
  15. package/dist/bundle/{chunk-WPW6ULD7.js → chunk-643B3X4D.js} +2 -2
  16. package/dist/bundle/{chunk-56BBTOS2.js → chunk-6NJ5OI2S.js} +1 -1
  17. package/dist/bundle/{chunk-3OL3QRFS.js → chunk-7ZO2LAFF.js} +5 -5
  18. package/dist/bundle/{chunk-6MEVHKIO.js → chunk-AF2ZDP3M.js} +1 -1
  19. package/dist/bundle/{chunk-REROHDUR.js → chunk-AYY5CYJJ.js} +1 -1
  20. package/dist/bundle/{chunk-SXVPRYEF.js → chunk-B5VQSSL2.js} +15 -12
  21. package/dist/bundle/{chunk-E7TMOUWZ.js → chunk-BC7N6IQ6.js} +1 -1
  22. package/dist/bundle/{chunk-PX2B5ZRL.js → chunk-BEO6VJ2E.js} +102 -60
  23. package/dist/bundle/{chunk-4RHIJMRX.js → chunk-CADGAURO.js} +30 -28
  24. package/dist/bundle/{chunk-LYUVULFK.js → chunk-CQPZUKTI.js} +311 -268
  25. package/dist/bundle/{chunk-AEVTXHTY.js → chunk-D63QZQR7.js} +4 -4
  26. package/dist/bundle/{chunk-HRLQQLVD.js → chunk-DDD3CXHR.js} +20 -20
  27. package/dist/bundle/{chunk-ROP27ZJU.js → chunk-F3BUTC2N.js} +51 -36
  28. package/dist/bundle/{chunk-V3TELYLZ.js → chunk-FUINFNUC.js} +1 -1
  29. package/dist/bundle/{chunk-XGNNI3S3.js → chunk-GESLAB4N.js} +2 -2
  30. package/dist/bundle/{chunk-YPLKNKAD.js → chunk-I3TF3CDE.js} +4 -4
  31. package/dist/bundle/{chunk-GSCGRBEQ.js → chunk-IRFHHNSX.js} +182 -154
  32. package/dist/bundle/{chunk-FJ3DAE4M.js → chunk-IVDBHH3N.js} +1 -1
  33. package/dist/bundle/{chunk-E3WIMCV5.js → chunk-JB43Q2QL.js} +1 -1
  34. package/dist/bundle/{chunk-66A646SL.js → chunk-JBQP2M7J.js} +7 -7
  35. package/dist/bundle/{chunk-5JY464PN.js → chunk-JGY2PJ3N.js} +12 -12
  36. package/dist/bundle/{chunk-ETD2DRJD.js → chunk-KK2ATSEC.js} +6 -6
  37. package/dist/bundle/{chunk-JINNS3FI.js → chunk-KTVYCPJW.js} +1 -1
  38. package/dist/bundle/{chunk-JBSMBHTM.js → chunk-LBGZT3W4.js} +5 -5
  39. package/dist/bundle/{chunk-UQ2OA6EM.js → chunk-LCE5LBZC.js} +4 -4
  40. package/dist/bundle/{chunk-ZC2LNXGO.js → chunk-LCP4TVBX.js} +1 -1
  41. package/dist/bundle/{chunk-O5Z74SBZ.js → chunk-MFVZXEQN.js} +23 -21
  42. package/dist/bundle/{chunk-MVV32ZTO.js → chunk-MGDBKE7E.js} +7 -15
  43. package/dist/bundle/{chunk-PWYCF76F.js → chunk-MU4MPJCU.js} +2 -2
  44. package/dist/bundle/{chunk-XN5YDZY7.js → chunk-MV5W4FLV.js} +1 -1
  45. package/dist/bundle/{chunk-6O37NSG6.js → chunk-O7CBAY6J.js} +4 -4
  46. package/dist/bundle/{chunk-4A6JOJLR.js → chunk-OKERVM3M.js} +4 -4
  47. package/dist/bundle/{chunk-GBWOMPZ7.js → chunk-OSPAMIIY.js} +3 -3
  48. package/dist/bundle/{chunk-QIFK3EZM.js → chunk-P3MKPY7D.js} +37 -9
  49. package/dist/bundle/{chunk-4GWFRZ2U.js → chunk-P5UTNYA7.js} +58 -1
  50. package/dist/bundle/{chunk-ECLBZGWI.js → chunk-PHP3T567.js} +3 -3
  51. package/dist/bundle/{chunk-CPLYNBAJ.js → chunk-PSJB456T.js} +1 -1
  52. package/dist/bundle/{chunk-4MWP6Z3W.js → chunk-RSBROHX4.js} +1 -1
  53. package/dist/bundle/{chunk-CZOBBAXM.js → chunk-RX6JTLKD.js} +7 -7
  54. package/dist/bundle/{chunk-JCNBJ3FN.js → chunk-SR3ZNX24.js} +370 -152
  55. package/dist/bundle/{chunk-UDAATSWZ.js → chunk-T5WGWLY2.js} +10 -10
  56. package/dist/bundle/{chunk-AWLAMVNY.js → chunk-UBZN4EWJ.js} +4 -4
  57. package/dist/bundle/{chunk-526KVXRI.js → chunk-VBYV6XQI.js} +2 -2
  58. package/dist/bundle/{chunk-YZB5IL4L.js → chunk-VPCNLTME.js} +2 -2
  59. package/dist/bundle/{chunk-BUHTAMPF.js → chunk-VQTU4ILC.js} +1 -1
  60. package/dist/bundle/{chunk-FZ4GVE36.js → chunk-VXZ7FWKU.js} +2 -2
  61. package/dist/bundle/{chunk-PNNM72BO.js → chunk-WNQUOEUV.js} +7 -4
  62. package/dist/bundle/{chunk-7C3MP5LH.js → chunk-WXFNUZZU.js} +5 -5
  63. package/dist/bundle/{chunk-H7RSMNHL.js → chunk-WYZDNDQ5.js} +489 -407
  64. package/dist/bundle/{chunk-N3UA5PO4.js → chunk-ZTM4UUCP.js} +9 -9
  65. package/dist/bundle/{command-contract-OTVOQLZS.js → command-contract-EWPKHGAZ.js} +11 -11
  66. package/dist/bundle/{decode-ISKRNDDM.js → decode-UWT3Y66W.js} +2 -2
  67. package/dist/bundle/{echarts-TINXXXCB.js → echarts-7VGTR45R.js} +2 -2
  68. package/dist/bundle/{embed-R2KJDGEX.js → embed-CM2QSTNK.js} +3 -3
  69. package/dist/bundle/{embedder-X2Y5RLKE.js → embedder-CDCAMVV7.js} +6 -6
  70. package/dist/bundle/{entry-2MUKT36Z.js → entry-WHEWBNJL.js} +4 -4
  71. package/dist/bundle/failure-XQ7TMBYM.js +66 -0
  72. package/dist/bundle/{first-run-6BSAM4BD.js → first-run-ZBIQO5RZ.js} +5 -5
  73. package/dist/bundle/{first-screen-ALXB4ONR.js → first-screen-CUAY5N6E.js} +12 -12
  74. package/dist/bundle/{instructions-E5NBM2NJ.js → instructions-LYKSTUGQ.js} +1 -1
  75. package/dist/bundle/{mcp-YUPBMZPV.js → mcp-I72UY3QP.js} +35 -35
  76. package/dist/bundle/memo.js +6 -6
  77. package/dist/bundle/{node-NBHZ4XWV.js → node-LFRTSZBZ.js} +2 -2
  78. package/dist/bundle/{node-sqlite-3CBWCPNC.js → node-sqlite-Y47T5FTT.js} +3 -3
  79. package/dist/bundle/{oauth-L5XC2THD.js → oauth-YM5C6VS3.js} +4 -4
  80. package/dist/bundle/{open-WR6QQPVB.js → open-WPA4DW5G.js} +2 -2
  81. package/dist/bundle/{openai-MCPELYCJ.js → openai-RCPT23DA.js} +7 -7
  82. package/dist/bundle/{process-EAEC2FBD.js → process-P2X2KFMR.js} +1 -1
  83. package/dist/bundle/{program-WKKBFQIW.js → program-LE3UATKG.js} +62 -60
  84. package/dist/bundle/{prompt-M4Z35LQ5.js → prompt-65WPTVYC.js} +2 -2
  85. package/dist/bundle/{recognize-VT6NKW6D.js → recognize-MEFMK7HT.js} +1 -1
  86. package/dist/bundle/{remote-6QTPH5PJ.js → remote-4XIR3ZYK.js} +4 -4
  87. package/dist/bundle/{rerank-MJYLXZ4K.js → rerank-YRLAXFFL.js} +4 -4
  88. package/dist/bundle/{serve-KQ6OL3OH.js → serve-6SPZH6CY.js} +6 -6
  89. package/dist/bundle/server-FB75UHSF.js +48 -0
  90. package/dist/bundle/server-IELXA6S2.js +61 -0
  91. package/dist/bundle/{server-UJIH2SBV.js → server-MU43SKL5.js} +50 -50
  92. package/dist/bundle/{state-2PDCOSJN.js → state-G34NVZ7F.js} +3 -3
  93. package/dist/bundle/{store-SXYAS5EI.js → store-6U4SYK4Q.js} +17 -9
  94. package/dist/bundle/store-maintenance-command-ONVPBZLT.js +48 -0
  95. package/dist/bundle/update-TO3RIYTH.js +69 -0
  96. package/dist/doctor/command.d.ts +30 -0
  97. package/dist/doctor/command.d.ts.map +1 -1
  98. package/dist/doctor/command.js +1 -1
  99. package/dist/doctor/command.js.map +1 -1
  100. package/dist/failure.js +2 -2
  101. package/dist/failure.js.map +1 -1
  102. package/dist/knowledge/relationships-scan.d.ts.map +1 -1
  103. package/dist/knowledge/relationships-scan.js +4 -3
  104. package/dist/knowledge/relationships-scan.js.map +1 -1
  105. package/dist/knowledge/relationships.d.ts +5 -1
  106. package/dist/knowledge/relationships.d.ts.map +1 -1
  107. package/dist/run/import.d.ts.map +1 -1
  108. package/dist/run/import.js +3 -2
  109. package/dist/run/import.js.map +1 -1
  110. package/dist/version.d.ts +1 -1
  111. package/dist/version.js +1 -1
  112. package/package.json +2 -2
  113. package/skills/morning-digest/SKILL.md +38 -13
  114. package/dist/bundle/auto-XJCSM7WE.js +0 -86
  115. package/dist/bundle/failure-KYUARIL2.js +0 -66
  116. package/dist/bundle/server-AVAJTC5G.js +0 -61
  117. package/dist/bundle/server-QAFF3RP5.js +0 -48
  118. package/dist/bundle/store-maintenance-command-ARTXRVYD.js +0 -48
  119. package/dist/bundle/update-MOZKRB2Z.js +0 -69
  120. /package/dist/bundle/{chunk-4ZSY3MKL.js → chunk-2H36DXV7.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-O5Z74SBZ.js";
6
+ } from "./chunk-MFVZXEQN.js";
7
7
  import {
8
8
  FETCHING,
9
9
  QUICK_HEALTH_CHECKS,
@@ -29,7 +29,7 @@ import {
29
29
  typedQuery,
30
30
  withQuery,
31
31
  withTimeLimit
32
- } from "./chunk-H7RSMNHL.js";
32
+ } from "./chunk-WYZDNDQ5.js";
33
33
  import {
34
34
  stringWidth,
35
35
  wrapAnsi
@@ -61,23 +61,20 @@ import {
61
61
  snakeKeys,
62
62
  storeTable,
63
63
  withoutProviderRefs
64
- } from "./chunk-GSCGRBEQ.js";
65
- import {
66
- failureKey
67
- } from "./chunk-MVV32ZTO.js";
64
+ } from "./chunk-IRFHHNSX.js";
68
65
  import {
69
66
  envName
70
- } from "./chunk-56BBTOS2.js";
67
+ } from "./chunk-6NJ5OI2S.js";
71
68
  import {
72
69
  holdLock,
73
70
  lockPath,
74
71
  releaseLock,
75
72
  servingProfiles,
76
73
  takeLock
77
- } from "./chunk-PWYCF76F.js";
74
+ } from "./chunk-MU4MPJCU.js";
78
75
  import {
79
76
  holdersOf
80
- } from "./chunk-REROHDUR.js";
77
+ } from "./chunk-AYY5CYJJ.js";
81
78
  import {
82
79
  CORPORA,
83
80
  MIGRATIONS,
@@ -113,28 +110,35 @@ import {
113
110
  storeClients,
114
111
  storeContents,
115
112
  vectorIndexCounts
116
- } from "./chunk-OBVKXHOH.js";
113
+ } from "./chunk-4335SGVD.js";
114
+ import {
115
+ queryFieldsOf,
116
+ readDamageMark,
117
+ readHealthMark,
118
+ recordDeepCheck
119
+ } from "./chunk-SR3ZNX24.js";
117
120
  import {
118
- queryFieldsOf
119
- } from "./chunk-JCNBJ3FN.js";
121
+ failureKey,
122
+ isStoreDamage
123
+ } from "./chunk-P5UTNYA7.js";
120
124
  import {
121
125
  readSecret
122
- } from "./chunk-WPW6ULD7.js";
126
+ } from "./chunk-643B3X4D.js";
123
127
  import {
124
128
  checkedOptions,
125
129
  range
126
- } from "./chunk-H65NWA3X.js";
130
+ } from "./chunk-2NVP4FZH.js";
127
131
  import {
128
132
  messagesFor,
129
133
  systemFor,
130
134
  validateImages
131
- } from "./chunk-JINNS3FI.js";
135
+ } from "./chunk-KTVYCPJW.js";
132
136
  import {
133
137
  storePath
134
- } from "./chunk-4MWP6Z3W.js";
138
+ } from "./chunk-RSBROHX4.js";
135
139
  import {
136
140
  openCache
137
- } from "./chunk-3OL3QRFS.js";
141
+ } from "./chunk-7ZO2LAFF.js";
138
142
  import {
139
143
  Credentials,
140
144
  pathsAreOverridden,
@@ -5509,11 +5513,11 @@ var require_liquid_node = __commonJS({
5509
5513
  }
5510
5514
  });
5511
5515
 
5512
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
5516
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
5513
5517
  import { chmodSync, constants, copyFileSync, existsSync as existsSync9, mkdirSync, realpathSync as realpathSync2, renameSync as renameSync3, rmSync as rmSync3, statfsSync as statfsSync2, statSync as statSync4, writeFileSync as writeFileSync2 } from "node:fs";
5514
5518
  import { dirname as dirname2, resolve } from "node:path";
5515
5519
 
5516
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/sealed.js
5520
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/sealed.js
5517
5521
  import { createCipheriv, createDecipheriv, createHash, randomBytes, scrypt, timingSafeEqual } from "node:crypto";
5518
5522
  import { closeSync, createReadStream, createWriteStream, existsSync, openSync, readSync, renameSync, rmSync, statSync } from "node:fs";
5519
5523
  import { Transform } from "node:stream";
@@ -5620,7 +5624,7 @@ var unsealFile = /* @__PURE__ */ __name(async (from, to, password) => {
5620
5624
  renameSync(pending, to);
5621
5625
  }, "unsealFile");
5622
5626
 
5623
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/store/compatibility.js
5627
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/store/compatibility.js
5624
5628
  var SPEAKS = MIGRATIONS.at(-1)?.version ?? 0;
5625
5629
  var fileSchemaOf = /* @__PURE__ */ __name((database) => {
5626
5630
  const tracked = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'schema_migrations'").get();
@@ -5644,7 +5648,7 @@ var compatibilityOf = /* @__PURE__ */ __name((file2, migrations = MIGRATIONS) =>
5644
5648
  };
5645
5649
  }, "compatibilityOf");
5646
5650
 
5647
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/store/repair.js
5651
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/store/repair.js
5648
5652
  import { createHash as createHash2 } from "node:crypto";
5649
5653
  var COPY_MARK = "__repair_";
5650
5654
  var COPY_NAME = /__repair_[0-9a-f]{8}(_\d+)?$/;
@@ -5898,13 +5902,13 @@ var deleteCopy = /* @__PURE__ */ __name((database, name) => {
5898
5902
  return found;
5899
5903
  }, "deleteCopy");
5900
5904
 
5901
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/cli/store-info.js
5905
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/cli/store-info.js
5902
5906
  import { existsSync as existsSync4, statSync as statSync3 } from "node:fs";
5903
5907
 
5904
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/cli/store-recover.js
5908
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/cli/store-recover.js
5905
5909
  import { existsSync as existsSync3 } from "node:fs";
5906
5910
 
5907
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/store/recover.js
5911
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/store/recover.js
5908
5912
  import { execFileSync, spawn } from "node:child_process";
5909
5913
  import { existsSync as existsSync2, readFileSync, realpathSync, renameSync as renameSync2, rmSync as rmSync2, statfsSync, statSync as statSync2, writeFileSync } from "node:fs";
5910
5914
  import { basename, dirname, join } from "node:path";
@@ -6202,7 +6206,14 @@ var recoverLocked = /* @__PURE__ */ __name(async ({ path, command, version, sqli
6202
6206
  }, "stopWatching");
6203
6207
  try {
6204
6208
  const dataVersion = /* @__PURE__ */ __name(() => Number(watch.prepare("PRAGMA data_version").get()?.data_version), "dataVersion");
6205
- const rowsBefore = tableRows(watch);
6209
+ let rowsBefore;
6210
+ try {
6211
+ rowsBefore = tableRows(watch);
6212
+ } catch (error) {
6213
+ if (!isStoreDamage(error))
6214
+ throw error;
6215
+ throw new CliError("configuration_error", "the store file's header or schema is damaged, so its tables cannot be listed and it cannot be recovered; the file was left as it was", { reason: "store.unreadable" });
6216
+ }
6206
6217
  const before = { data: dataVersion(), inode: statSync2(path).ino };
6207
6218
  const stamp = new Date(now()).toISOString().replace(/[:.]/g, "-");
6208
6219
  const target = `${path}.recovering-${stamp}`;
@@ -6230,6 +6241,7 @@ var recoverLocked = /* @__PURE__ */ __name(async ({ path, command, version, sqli
6230
6241
  let dangling;
6231
6242
  let json;
6232
6243
  let fetch2;
6244
+ let schema;
6233
6245
  try {
6234
6246
  kept = tableRows(opened.database);
6235
6247
  migrate(opened.database, { command, ...version ? { version } : {} });
@@ -6239,6 +6251,7 @@ var recoverLocked = /* @__PURE__ */ __name(async ({ path, command, version, sqli
6239
6251
  note("looking for rows that point at rows that were lost");
6240
6252
  dangling = danglingRows(opened.database);
6241
6253
  fetch2 = mailToFetch(opened.database);
6254
+ schema = fileSchemaOf(opened.database).version;
6242
6255
  opened.database.exec("PRAGMA wal_checkpoint(TRUNCATE)");
6243
6256
  } catch (error) {
6244
6257
  opened.database.close();
@@ -6266,6 +6279,7 @@ var recoverLocked = /* @__PURE__ */ __name(async ({ path, command, version, sqli
6266
6279
  for (const suffix of STORE_PARTS)
6267
6280
  if (existsSync2(`${target}${suffix}`))
6268
6281
  renameSync2(`${target}${suffix}`, `${path}${suffix}`);
6282
+ recordDeepCheck(path, health, { cli: command, ...version ? { version } : {}, schema, now });
6269
6283
  const lost = Object.entries(rowsBefore).map(([table, before2]) => ({ table, before: before2, read: read[table] ?? 0, kept: kept[table] ?? 0 })).filter(({ before: before2, read: read2, kept: kept2 }) => before2 === null || before2 > kept2 || read2 > kept2);
6270
6284
  const seconds = /* @__PURE__ */ __name((from, to) => Math.round((to - from) / 100) / 10, "seconds");
6271
6285
  return {
@@ -6291,7 +6305,7 @@ var recoverLocked = /* @__PURE__ */ __name(async ({ path, command, version, sqli
6291
6305
  }
6292
6306
  }, "recoverLocked");
6293
6307
 
6294
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/cli/store-recover.js
6308
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/cli/store-recover.js
6295
6309
  var COUNTED = [
6296
6310
  "accounts",
6297
6311
  "chats",
@@ -6306,15 +6320,17 @@ var COUNTED = [
6306
6320
  "mentions"
6307
6321
  ];
6308
6322
  var stopTimers = /* @__PURE__ */ __name((timers) => `systemctl --user stop ${timers.join(" ")}`, "stopTimers");
6309
- var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command) => {
6323
+ var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command, version) => {
6310
6324
  const path = storePath(env);
6311
6325
  if (!existsSync3(path))
6312
6326
  return { path, exists: false, ok: true, next: [] };
6313
6327
  const health = await storeHealth(path, { deep: true });
6314
6328
  let rows = {};
6329
+ let schema = null;
6315
6330
  try {
6316
6331
  const { database } = await openSqlite(path, { readOnly: true });
6317
6332
  try {
6333
+ schema = fileSchemaOf(database).version;
6318
6334
  const all = tableRows(database);
6319
6335
  rows = Object.fromEntries(COUNTED.filter((table) => table in all).map((table) => [table, all[table] ?? null]));
6320
6336
  } finally {
@@ -6322,7 +6338,9 @@ var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command) => {
6322
6338
  }
6323
6339
  } catch {
6324
6340
  }
6325
- const explanation = explainDamage(health, command);
6341
+ recordDeepCheck(path, health, { cli: command, ...version ? { version } : {}, schema });
6342
+ const mark = readDamageMark(path);
6343
+ const explanation = explainDamage(health, command, mark);
6326
6344
  const inUse = storeHolders(path) ?? null;
6327
6345
  const timers = activeTimers() ?? null;
6328
6346
  const sqlite3 = sqlite3Program();
@@ -6343,6 +6361,8 @@ var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command) => {
6343
6361
  invalidJson: health.invalidJson ?? [],
6344
6362
  rows,
6345
6363
  explanation,
6364
+ damageMark: mark ? (({ inode: _, ...seen }) => seen)(mark) : null,
6365
+ lastKnownGood: readHealthMark(path)?.last_ok_at ?? null,
6346
6366
  inUse,
6347
6367
  timers,
6348
6368
  sqlite3: { version: sqlite3.version, usable: sqlite3.usable },
@@ -6390,13 +6410,14 @@ var recoveryNotes = /* @__PURE__ */ __name((answer) => {
6390
6410
  const why = answer.explanation;
6391
6411
  return [
6392
6412
  ...why ? [why.what, ...why.impact, why.externalUnaffected] : [],
6413
+ answer.lastKnownGood ? `the store last passed a deep check at ${answer.lastKnownGood}` : "no deep check that passed is on record for this store",
6393
6414
  ...answer.next.map((line) => `next: ${line}`)
6394
6415
  ];
6395
6416
  }, "recoveryNotes");
6396
6417
  var storeRecoverCommand = /* @__PURE__ */ __name(({ command, version }) => {
6397
6418
  const recover = annotate(new Command("recover"), { effects: LOCAL_READ, examples: [`${command} store recover`] }).summary("what is damaged in the store and how to recover it").description("check every page and search index of the store, say what is damaged, what it means and the commands that recover it; changes nothing").action(async function() {
6398
6419
  const output = outputFor(this);
6399
- const answer = await storeRecoveryCheck(environmentOf(this).env ?? process.env, command);
6420
+ const answer = await storeRecoveryCheck(environmentOf(this).env ?? process.env, command, version);
6400
6421
  renderAnswer(this, output, itemOf(snakeKeys(answer)));
6401
6422
  if (output.format === "pretty")
6402
6423
  for (const line of recoveryNotes(answer))
@@ -6417,7 +6438,7 @@ var storeRecoverCommand = /* @__PURE__ */ __name(({ command, version }) => {
6417
6438
  return recover;
6418
6439
  }, "storeRecoverCommand");
6419
6440
 
6420
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/cli/store-info.js
6441
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/cli/store-info.js
6421
6442
  var pendingIfKnown = /* @__PURE__ */ __name((database) => database.prepare("SELECT 1 FROM pragma_table_info('messages') WHERE name = 'normalized_text'").get() ? pendingNormalization(database) : null, "pendingIfKnown");
6422
6443
  var bytesOf = /* @__PURE__ */ __name((path) => existsSync4(path) ? statSync3(path).size : 0, "bytesOf");
6423
6444
  var messageOf = /* @__PURE__ */ __name((error) => error instanceof Error ? error.message : String(error), "messageOf");
@@ -6463,7 +6484,7 @@ var storeInfoCommand = /* @__PURE__ */ __name(() => annotate(new Command("info")
6463
6484
  renderAnswer(this, outputFor(this), itemOf(answer));
6464
6485
  }), "storeInfoCommand");
6465
6486
 
6466
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
6487
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
6467
6488
  var ENCRYPT_OPTION = [
6468
6489
  "--encrypt",
6469
6490
  "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"
@@ -6482,7 +6503,7 @@ var passwordOf = /* @__PURE__ */ __name(async (command, { twice }) => {
6482
6503
  return password;
6483
6504
  }, "passwordOf");
6484
6505
 
6485
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/replies/rules.js
6506
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/replies/rules.js
6486
6507
  import { existsSync as existsSync5, readFileSync as readFileSync2 } from "node:fs";
6487
6508
  import { join as join2 } from "node:path";
6488
6509
  var REPLY_ACTIONS = ["reply", "task"];
@@ -6653,7 +6674,7 @@ var problem = /* @__PURE__ */ __name((issue) => {
6653
6674
  }, "problem");
6654
6675
  var broken = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply rules ${path} cannot be read (${why}) \u2014 fix the file`), "broken");
6655
6676
 
6656
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/replies/state.js
6677
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/replies/state.js
6657
6678
  import { existsSync as existsSync6, readFileSync as readFileSync3 } from "node:fs";
6658
6679
  import { join as join3 } from "node:path";
6659
6680
  var ANSWERED_KEPT = 1e3;
@@ -6706,7 +6727,7 @@ var recordReply = /* @__PURE__ */ __name((state, rule2, message, now) => {
6706
6727
  }, "recordReply");
6707
6728
  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");
6708
6729
 
6709
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/replies/decide.js
6730
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/replies/decide.js
6710
6731
  var skip = /* @__PURE__ */ __name((why) => ({ skip: why }), "skip");
6711
6732
  var decide = /* @__PURE__ */ __name((rule2, incoming, state, now) => {
6712
6733
  const { message, chat, owner, sender } = incoming;
@@ -6812,7 +6833,7 @@ var filled = /* @__PURE__ */ __name((template2, senderName) => {
6812
6833
  return template2.replaceAll("{firstName}", name.split(/\s+/)[0] ?? name).replaceAll("{name}", name);
6813
6834
  }, "filled");
6814
6835
 
6815
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/replies/template.js
6836
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/replies/template.js
6816
6837
  var import_liquidjs = __toESM(require_liquid_node(), 1);
6817
6838
  var TEMPLATE_LIMITS = {
6818
6839
  parse: 32768,
@@ -6972,7 +6993,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
6972
6993
  }
6973
6994
  }, "renderReplyTemplate");
6974
6995
 
6975
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
6996
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
6976
6997
  var DRY_RUN_DAYS = 7;
6977
6998
  var PAGE = 500;
6978
6999
  var dryRun = /* @__PURE__ */ __name(async (store, account, rules, { since, until = Date.now(), only, audience, render }) => {
@@ -7086,7 +7107,7 @@ var storedSince = /* @__PURE__ */ __name(async (store, account, chat, since) =>
7086
7107
  }
7087
7108
  }, "storedSince");
7088
7109
 
7089
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
7110
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
7090
7111
  var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
7091
7112
  const host = new URL(baseUrl).host;
7092
7113
  return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
@@ -7117,7 +7138,7 @@ var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) =>
7117
7138
  };
7118
7139
  }, "embeddingKeys");
7119
7140
 
7120
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/models/openai.js
7141
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/models/openai.js
7121
7142
  var options = strictObject({
7122
7143
  temperature: range(0, 2),
7123
7144
  top_p: range(0, 1),
@@ -7166,7 +7187,7 @@ var openai = {
7166
7187
  }), "complete")
7167
7188
  };
7168
7189
 
7169
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/models/index.js
7190
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/models/index.js
7170
7191
  var modelGateway = /* @__PURE__ */ __name((deps) => ({
7171
7192
  complete: /* @__PURE__ */ __name(async (request) => {
7172
7193
  if (deps.signal?.aborted)
@@ -7181,7 +7202,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
7181
7202
  if (!adapter && target.provider === "openai")
7182
7203
  adapter = openai;
7183
7204
  if (!adapter && target.provider === "anthropic")
7184
- adapter = (await import("./anthropic-QVYJRACM.js")).anthropic;
7205
+ adapter = (await import("./anthropic-ZUDIWREK.js")).anthropic;
7185
7206
  if (!adapter)
7186
7207
  throw new CliError("validation_error", `no model adapter for ${target.provider}`);
7187
7208
  if (request.images !== void 0 && adapter.images !== true)
@@ -7222,7 +7243,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
7222
7243
  }, "complete")
7223
7244
  }), "modelGateway");
7224
7245
 
7225
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/replies/consents.js
7246
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/replies/consents.js
7226
7247
  import { existsSync as existsSync7, readFileSync as readFileSync4 } from "node:fs";
7227
7248
  import { join as join4 } from "node:path";
7228
7249
  var shape = strictObject({
@@ -7247,7 +7268,7 @@ var mayModelReply = /* @__PURE__ */ __name((path, provider, chat) => {
7247
7268
  return consent.provider === provider && !consent.deniedChats.includes(chat);
7248
7269
  }, "mayModelReply");
7249
7270
 
7250
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/replies/rendering.js
7271
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/replies/rendering.js
7251
7272
  var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, options2 = {
7252
7273
  ai: true
7253
7274
  }) => async (rule2, message, chat, now) => {
@@ -7294,7 +7315,7 @@ var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, o
7294
7315
  return result2;
7295
7316
  }, "replyRenderer");
7296
7317
 
7297
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/replies/serve.js
7318
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/replies/serve.js
7298
7319
  var NOT_ALLOWED = "replies.send is not allow";
7299
7320
  var NO_RULES = "no rules";
7300
7321
  var ONLY_TASK = "opened a task, sent nothing";
@@ -7387,7 +7408,7 @@ var replyTo = /* @__PURE__ */ __name(async (deps, message) => {
7387
7408
  return { skip: why };
7388
7409
  }, "replyTo");
7389
7410
 
7390
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-catch-up.js
7411
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-catch-up.js
7391
7412
  var START_SYNC_DELAY_MS = 3e4;
7392
7413
  var START_SYNC_BUDGET_MS = 5 * 6e4;
7393
7414
  var START_SYNC_WINDOW_MS = 7 * 864e5;
@@ -7464,7 +7485,7 @@ var startSync = /* @__PURE__ */ __name(({ chats, newestHeld, fetch: fetch2, note
7464
7485
  };
7465
7486
  }, "startSync");
7466
7487
 
7467
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
7488
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
7468
7489
  var FIRST_FETCH_MS = 6e4;
7469
7490
  var DAY_MS = 864e5;
7470
7491
  var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, firstMs = FIRST_FETCH_MS, everyMs = DAY_MS }) => {
@@ -7518,7 +7539,7 @@ var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, fi
7518
7539
  };
7519
7540
  }, "memberFetches");
7520
7541
 
7521
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
7542
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
7522
7543
  var record2 = /* @__PURE__ */ __name((context, app, severity, attributes) => recordLogFor(context.streams.diagnostic, app, { command: currentRun().command || "serve" })[severity](attributes), "record");
7523
7544
  var noticeFor = /* @__PURE__ */ __name((context, app, severity = "warn") => ({ text, ...attributes }) => {
7524
7545
  if (context.format === "pretty") {
@@ -7551,7 +7572,7 @@ var recordDiagnostics = /* @__PURE__ */ __name((context, app) => {
7551
7572
  return context;
7552
7573
  }, "recordDiagnostics");
7553
7574
 
7554
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
7575
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
7555
7576
  var STEMS_EVERY_MS = 3e4;
7556
7577
  var STEMS_SLICE_MS = 2e3;
7557
7578
  var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY_MS, sliceMs = STEMS_SLICE_MS }) => {
@@ -7591,7 +7612,7 @@ var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY
7591
7612
  };
7592
7613
  }, "stemFills");
7593
7614
 
7594
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/render/messages.js
7615
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/render/messages.js
7595
7616
  import { styleText } from "node:util";
7596
7617
  var TIME_WIDTH = 8;
7597
7618
  var INDENT = " ".repeat(TIME_WIDTH + 2);
@@ -7767,7 +7788,7 @@ var editedAt = /* @__PURE__ */ __name((message, options2) => {
7767
7788
  return day(edited) === day(message.timestamp) ? time : `${day(edited)} ${time}`;
7768
7789
  }, "editedAt");
7769
7790
 
7770
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
7791
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
7771
7792
  var defined = /* @__PURE__ */ __name((value) => Object.fromEntries(Object.entries(value).filter(([, one]) => one !== void 0)), "defined");
7772
7793
  var attachmentItem = /* @__PURE__ */ __name((attachment) => defined({
7773
7794
  kind: attachment.kind,
@@ -7862,7 +7883,7 @@ var viewOf = /* @__PURE__ */ __name((context, messenger) => ({
7862
7883
  locale: messenger.app.locale
7863
7884
  }), "viewOf");
7864
7885
 
7865
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
7886
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
7866
7887
  var observed = /* @__PURE__ */ __name((value) => ({
7867
7888
  value: value.value,
7868
7889
  observed_at: value.observedAt,
@@ -7929,7 +7950,7 @@ var watchEventItem = /* @__PURE__ */ __name((value, account) => {
7929
7950
  }
7930
7951
  }, "watchEventItem");
7931
7952
 
7932
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
7953
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
7933
7954
  var watchCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("watch"), {
7934
7955
  output: { entity: "watch_item" },
7935
7956
  effects: REMOTE_READ,
@@ -8084,7 +8105,7 @@ var describe = /* @__PURE__ */ __name((event, render) => {
8084
8105
  }
8085
8106
  }, "describe");
8086
8107
 
8087
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
8108
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
8088
8109
  var serveCommand = /* @__PURE__ */ __name((messenger) => {
8089
8110
  const command = annotate(new Command("serve"), {
8090
8111
  output: { entity: "serve_summary" },
@@ -8348,7 +8369,7 @@ var tasking = /* @__PURE__ */ __name((context, warn) => {
8348
8369
  };
8349
8370
  }, "tasking");
8350
8371
 
8351
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
8372
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
8352
8373
  import { existsSync as existsSync8 } from "node:fs";
8353
8374
  var PATH = "store tables list";
8354
8375
  var STORE_TABLES_QUERY = {
@@ -8391,7 +8412,7 @@ var storeTablesCommand = /* @__PURE__ */ __name((messenger) => {
8391
8412
  return tables;
8392
8413
  }, "storeTablesCommand");
8393
8414
 
8394
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_d9de6622c75caef4cd0a02912b39a001/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
8415
+ // node_modules/.pnpm/@wirecat+cli-core@0.606.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_66b8ac22c245eeaba8c329faa5b17078/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
8395
8416
  var SEARCH_INDEXES = ["messages_fts", "chats_fts", "identities_fts"];
8396
8417
  var WORD_INDEX = "message_words";
8397
8418
  var schemaOf = /* @__PURE__ */ __name((database) => {
@@ -8417,11 +8438,26 @@ var readingOnly = /* @__PURE__ */ __name(async (path, read) => {
8417
8438
  database.close();
8418
8439
  }
8419
8440
  }, "readingOnly");
8420
- var storeSummary = /* @__PURE__ */ __name(async (env, { deep = false, command } = {}) => {
8441
+ var withoutInode = /* @__PURE__ */ __name(({ inode: _, ...mark }) => mark, "withoutInode");
8442
+ var fileSchema = /* @__PURE__ */ __name(async (path) => {
8443
+ try {
8444
+ return await readingOnly(path, (database) => fileSchemaOf(database).version);
8445
+ } catch {
8446
+ return null;
8447
+ }
8448
+ }, "fileSchema");
8449
+ var storeSummary = /* @__PURE__ */ __name(async (env, { deep = false, command, version } = {}) => {
8421
8450
  const path = storePath(env);
8422
8451
  if (!existsSync9(path))
8423
8452
  return { path, exists: false };
8424
8453
  const checked = await storeHealth(path, { deep });
8454
+ const recorded = deep ? recordDeepCheck(path, checked, {
8455
+ cli: command ?? "unknown",
8456
+ ...version ? { version } : {},
8457
+ schema: await fileSchema(path)
8458
+ }) : null;
8459
+ const mark = readDamageMark(path);
8460
+ const lastKnownGood = readHealthMark(path)?.last_ok_at ?? null;
8425
8461
  const health = {
8426
8462
  checked: checked.checked,
8427
8463
  covers: deep ? "every page and every search index" : QUICK_HEALTH_CHECKS,
@@ -8432,18 +8468,24 @@ var storeSummary = /* @__PURE__ */ __name(async (env, { deep = false, command }
8432
8468
  ...checked.invalidJson?.length ? { invalidJson: checked.invalidJson } : {},
8433
8469
  ...checked.searchIndexes?.some((index) => !index.ok) ? { damagedSearchIndexes: checked.searchIndexes.filter((index) => !index.ok).map((index) => index.name) } : {}
8434
8470
  };
8435
- const damage = command ? explainDamage(checked, command) : null;
8436
- const healthOf = { health, ...damage ? { damage } : {} };
8471
+ const damage = command ? explainDamage(checked, command, mark) : null;
8472
+ const healthOf = {
8473
+ health,
8474
+ lastKnownGood,
8475
+ ...mark ? { damageMark: withoutInode(mark) } : {},
8476
+ ...recorded?.cleared ? { damageMarkCleared: withoutInode(recorded.cleared) } : {},
8477
+ ...damage ? { damage } : {}
8478
+ };
8437
8479
  try {
8438
8480
  return await reading(path, (database) => {
8439
- const { version, writable } = schemaOf(database);
8481
+ const { version: version2, writable } = schemaOf(database);
8440
8482
  return {
8441
8483
  path,
8442
8484
  exists: true,
8443
- schema: version,
8485
+ schema: version2,
8444
8486
  speaks: SPEAKS,
8445
8487
  writable,
8446
- ...version > 0 ? { chats: count2(database, "chats"), messages: count2(database, "messages") } : {},
8488
+ ...version2 > 0 ? { chats: count2(database, "chats"), messages: count2(database, "messages") } : {},
8447
8489
  ...healthOf
8448
8490
  };
8449
8491
  });