@wirecat/cli-template 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/.github/workflows/ci.yml +18 -0
  2. package/.github/workflows/release-pr.yml +37 -0
  3. package/CHANGELOG.md +14 -0
  4. package/bin/release +10 -3
  5. package/biome.json +6 -0
  6. package/contracts/plan.json +2 -1
  7. package/dist/bin/clidev.js +2 -2
  8. package/dist/bundle/{all-profiles-FS7AEOE7.js → all-profiles-CCT2XPJL.js} +7 -7
  9. package/dist/bundle/{anthropic-5RN7BGDI.js → anthropic-QLLP7EE4.js} +4 -4
  10. package/dist/bundle/{app-server-WGTKZQKJ.js → app-server-ELI5TGL7.js} +36 -36
  11. package/dist/bundle/{bun-ILPS6AYA.js → bun-C7JS2V7G.js} +2 -2
  12. package/dist/bundle/{bun-sqlite-WK2IGBGD.js → bun-sqlite-OM72TCYT.js} +3 -3
  13. package/dist/bundle/{chunk-ADFSSIV4.js → chunk-2Y5NBD7U.js} +4 -4
  14. package/dist/bundle/{chunk-7EUX7AZV.js → chunk-33JGD2CR.js} +3 -3
  15. package/dist/bundle/{chunk-JFXWLQ2L.js → chunk-3VVIEZRY.js} +2 -2
  16. package/dist/bundle/{chunk-CGFQT3LQ.js → chunk-6PHTRAZA.js} +1 -1
  17. package/dist/bundle/{chunk-VS5LGSTM.js → chunk-6VCFDEHT.js} +1 -1
  18. package/dist/bundle/{chunk-NENYWEXF.js → chunk-7OQF5ZMN.js} +1 -1
  19. package/dist/bundle/{chunk-6WOJIAYA.js → chunk-AKUMR7PE.js} +2 -2
  20. package/dist/bundle/{chunk-BPMKAZSS.js → chunk-ASO23RNM.js} +152 -79
  21. package/dist/bundle/{chunk-VOTEB3AN.js → chunk-AUVPTFUS.js} +1 -1
  22. package/dist/bundle/{chunk-JJZCPBH3.js → chunk-BOCIYBBO.js} +53 -44
  23. package/dist/bundle/{chunk-QGOOPPEW.js → chunk-BXZRTMXA.js} +5 -5
  24. package/dist/bundle/{chunk-SKBRW5U3.js → chunk-DVLM23HB.js} +2 -2
  25. package/dist/bundle/{chunk-YIVY2WI3.js → chunk-E4KQOKQ5.js} +1 -1
  26. package/dist/bundle/{chunk-ZSY4WAGI.js → chunk-EQDVQN4E.js} +299 -258
  27. package/dist/bundle/{chunk-RFJKNFVF.js → chunk-FF3AGTHY.js} +6 -6
  28. package/dist/bundle/{chunk-TXHCL75B.js → chunk-GG5PXNMH.js} +25 -22
  29. package/dist/bundle/{chunk-DEHBTFIC.js → chunk-GUCMIUNB.js} +2 -2
  30. package/dist/bundle/{chunk-RYOAQCVJ.js → chunk-HVAEHUSZ.js} +2 -2
  31. package/dist/bundle/{chunk-CTBHQRX6.js → chunk-ITPFCKCL.js} +13 -13
  32. package/dist/bundle/{chunk-Z5NL6YNU.js → chunk-J2RUBXCI.js} +6 -6
  33. package/dist/bundle/{chunk-7Z4HR6GO.js → chunk-KRXN3FV3.js} +1 -1
  34. package/dist/bundle/{chunk-OF56L2JU.js → chunk-LFLN6PVS.js} +4 -4
  35. package/dist/bundle/{chunk-YNROUY3R.js → chunk-LN53L2V5.js} +11 -11
  36. package/dist/bundle/{chunk-WDWP5N6M.js → chunk-MLSN3UP4.js} +26 -26
  37. package/dist/bundle/{chunk-3MDNAYQA.js → chunk-O6PBO4BU.js} +1 -1
  38. package/dist/bundle/{chunk-5KAYQKBK.js → chunk-QJS4WWYK.js} +63 -63
  39. package/dist/bundle/{chunk-EA3TMI4A.js → chunk-QLBS6OC2.js} +2362 -1225
  40. package/dist/bundle/{chunk-5HHIPDNW.js → chunk-QVPTZDRA.js} +2 -2
  41. package/dist/bundle/{chunk-OGTRPW2K.js → chunk-R5CPFSPI.js} +7 -7
  42. package/dist/bundle/{chunk-2MWNE4L3.js → chunk-R5IY4O25.js} +4 -4
  43. package/dist/bundle/{chunk-C3GNOEJP.js → chunk-RGKXMVOZ.js} +3 -3
  44. package/dist/bundle/{chunk-G45R7M42.js → chunk-RT46AWIH.js} +1 -1
  45. package/dist/bundle/{chunk-MEXT6XDP.js → chunk-RUHNHEAF.js} +3 -3
  46. package/dist/bundle/{chunk-ORV4EGNC.js → chunk-S465TCR3.js} +8 -8
  47. package/dist/bundle/{chunk-WM5AMTRY.js → chunk-SQKP6V4S.js} +27 -13
  48. package/dist/bundle/{chunk-VPCXYY46.js → chunk-SQOXYNKF.js} +1 -1
  49. package/dist/bundle/{chunk-NVPWZF67.js → chunk-URPKIONS.js} +8 -8
  50. package/dist/bundle/{chunk-HTYLT6ME.js → chunk-UW4PJZVJ.js} +282 -170
  51. package/dist/bundle/{chunk-ENDBOYQR.js → chunk-WKUJCPSP.js} +89 -45
  52. package/dist/bundle/{chunk-FMO6F5Q2.js → chunk-WQBBSVZM.js} +2 -2
  53. package/dist/bundle/{chunk-LRHX62ZF.js → chunk-WRLOK7XC.js} +3 -3
  54. package/dist/bundle/{chunk-MBBOINK4.js → chunk-X44ZT64I.js} +3 -3
  55. package/dist/bundle/{chunk-ATHZEV2Z.js → chunk-XKL5FRH3.js} +3 -3
  56. package/dist/bundle/{chunk-ETJXPB6A.js → chunk-XS56LIQ7.js} +4 -4
  57. package/dist/bundle/{chunk-3WDYHOAF.js → chunk-YIH3PYWJ.js} +1 -1
  58. package/dist/bundle/{chunk-EILS4BTQ.js → chunk-ZRNBKTPP.js} +26 -26
  59. package/dist/bundle/clidev.js +3 -3
  60. package/dist/bundle/{command-contract-ZDU73EPH.js → command-contract-RV5ZOEAT.js} +11 -11
  61. package/dist/bundle/{decode-QMLOGZ6R.js → decode-V7HNHZBC.js} +3 -3
  62. package/dist/bundle/{echarts-DRDGGHJT.js → echarts-Y42YP2OL.js} +2 -2
  63. package/dist/bundle/{embed-PIR2LJR2.js → embed-JSQZL7JF.js} +4 -4
  64. package/dist/bundle/{embedder-6KBRPAEQ.js → embedder-7BHRCXWL.js} +7 -7
  65. package/dist/bundle/{first-run-JO3CMY3Z.js → first-run-BJ36KGST.js} +8 -8
  66. package/dist/bundle/first-screen-5YHQVNY4.js +26 -0
  67. package/dist/bundle/{instructions-EOQOXY6V.js → instructions-UWERND54.js} +1 -1
  68. package/dist/bundle/{mcp-7HBLFGCW.js → mcp-P4FSBSRS.js} +2 -2
  69. package/dist/bundle/{node-52WF2326.js → node-PZDNPKN7.js} +2 -2
  70. package/dist/bundle/{node-sqlite-LIK6OYNF.js → node-sqlite-4F5NLRNT.js} +4 -4
  71. package/dist/bundle/{oauth-7FVF7HQQ.js → oauth-VDXNA3DK.js} +5 -5
  72. package/dist/bundle/{open-CRZDEATN.js → open-EUJRQQNS.js} +3 -3
  73. package/dist/bundle/{openai-WAJ6WREQ.js → openai-EIBV2K72.js} +12 -12
  74. package/dist/bundle/{process-YIQPKLZI.js → process-XD5ZIFIL.js} +1 -1
  75. package/dist/bundle/{program-ZFFFPBRS.js → program-TJTVMIOX.js} +866 -495
  76. package/dist/bundle/{prompt-QQIVHO3M.js → prompt-LYUZNHDK.js} +3 -3
  77. package/dist/bundle/{recognize-4KLBZDEC.js → recognize-LQMHLOD5.js} +2 -2
  78. package/dist/bundle/{remote-BABMZTHA.js → remote-34HUWSZI.js} +5 -5
  79. package/dist/bundle/{rerank-P3IQQJIL.js → rerank-ONBASQ5Z.js} +5 -5
  80. package/dist/bundle/{serve-25SSAKRZ.js → serve-UJ7FDYAM.js} +7 -7
  81. package/dist/bundle/{server-P4XUYY5A.js → server-GNT76BXM.js} +28 -28
  82. package/dist/bundle/server-J4YIXKMI.js +52 -0
  83. package/dist/bundle/{state-QCQALQBJ.js → state-IW5OO6IZ.js} +4 -4
  84. package/dist/bundle/{store-ZECPRGGH.js → store-55UB27H2.js} +12 -10
  85. package/dist/bundle/store-maintenance-command-BLDKUZ3L.js +42 -0
  86. package/dist/commands/session.js +1 -1
  87. package/dist/commands/session.js.map +1 -1
  88. package/dist/program.d.ts.map +1 -1
  89. package/dist/program.js +1 -0
  90. package/dist/program.js.map +1 -1
  91. package/dist/version.d.ts +1 -1
  92. package/dist/version.js +1 -1
  93. package/docs/dev/skills/release/SKILL.md +9 -3
  94. package/docs/dev/skills/release/fresh-audit.md +1 -1
  95. package/kit/dist/new.js +1 -0
  96. package/package.json +4 -4
  97. package/src/commands/session.ts +1 -1
  98. package/src/program.ts +1 -0
  99. package/src/version.ts +1 -1
  100. package/dist/bundle/first-screen-3T5IXTFL.js +0 -26
  101. package/dist/bundle/server-G4GCDMYI.js +0 -52
  102. package/dist/bundle/store-maintenance-command-ECUO5G6L.js +0 -42
@@ -3,7 +3,7 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  answerOf,
5
5
  messengerContext
6
- } from "./chunk-JJZCPBH3.js";
6
+ } from "./chunk-BOCIYBBO.js";
7
7
  import {
8
8
  FETCHING,
9
9
  RULES_VERSION,
@@ -24,10 +24,10 @@ import {
24
24
  typedQuery,
25
25
  withQuery,
26
26
  withTimeLimit
27
- } from "./chunk-ZSY4WAGI.js";
27
+ } from "./chunk-EQDVQN4E.js";
28
28
  import {
29
29
  readSecret
30
- } from "./chunk-LRHX62ZF.js";
30
+ } from "./chunk-WRLOK7XC.js";
31
31
  import {
32
32
  stringWidth,
33
33
  wrapAnsi
@@ -38,16 +38,16 @@ import {
38
38
  releaseLock,
39
39
  servingProfiles,
40
40
  takeLock
41
- } from "./chunk-C3GNOEJP.js";
41
+ } from "./chunk-RGKXMVOZ.js";
42
42
  import {
43
43
  checkedOptions,
44
44
  range
45
- } from "./chunk-RYOAQCVJ.js";
45
+ } from "./chunk-HVAEHUSZ.js";
46
46
  import {
47
47
  messagesFor,
48
48
  systemFor,
49
49
  validateImages
50
- } from "./chunk-FMO6F5Q2.js";
50
+ } from "./chunk-WQBBSVZM.js";
51
51
  import {
52
52
  Command,
53
53
  LOCAL_READ,
@@ -76,13 +76,13 @@ import {
76
76
  snakeKeys,
77
77
  storeTable,
78
78
  withoutProviderRefs
79
- } from "./chunk-HTYLT6ME.js";
79
+ } from "./chunk-UW4PJZVJ.js";
80
80
  import {
81
81
  failureKey
82
- } from "./chunk-ORV4EGNC.js";
82
+ } from "./chunk-S465TCR3.js";
83
83
  import {
84
84
  holdersOf
85
- } from "./chunk-VOTEB3AN.js";
85
+ } from "./chunk-AUVPTFUS.js";
86
86
  import {
87
87
  MIGRATIONS,
88
88
  drainNoteIndex,
@@ -104,6 +104,7 @@ import {
104
104
  resetNoteIndex,
105
105
  resetSearchIndex,
106
106
  resetStems,
107
+ rollBack,
107
108
  rowCounts,
108
109
  searchIndexState,
109
110
  stemmerCache,
@@ -111,16 +112,16 @@ import {
111
112
  storeClients,
112
113
  storeContents,
113
114
  vectorIndexCounts
114
- } from "./chunk-EA3TMI4A.js";
115
+ } from "./chunk-QLBS6OC2.js";
115
116
  import {
116
117
  queryFieldsOf
117
- } from "./chunk-5KAYQKBK.js";
118
+ } from "./chunk-QJS4WWYK.js";
118
119
  import {
119
120
  openCache
120
- } from "./chunk-RFJKNFVF.js";
121
+ } from "./chunk-FF3AGTHY.js";
121
122
  import {
122
123
  storePath
123
- } from "./chunk-6WOJIAYA.js";
124
+ } from "./chunk-AKUMR7PE.js";
124
125
  import {
125
126
  CliError,
126
127
  Credentials,
@@ -151,7 +152,7 @@ import {
151
152
  union,
152
153
  visibleControls,
153
154
  writeSecurely
154
- } from "./chunk-WDWP5N6M.js";
155
+ } from "./chunk-MLSN3UP4.js";
155
156
  import {
156
157
  __commonJS,
157
158
  __name,
@@ -5491,11 +5492,11 @@ var require_liquid_node = __commonJS({
5491
5492
  }
5492
5493
  });
5493
5494
 
5494
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
5495
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
5495
5496
  import { chmodSync, constants, copyFileSync, existsSync as existsSync7, mkdirSync, realpathSync, renameSync as renameSync2, rmSync as rmSync2, statfsSync, statSync as statSync3, writeFileSync } from "node:fs";
5496
5497
  import { dirname, resolve } from "node:path";
5497
5498
 
5498
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/sealed.js
5499
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/sealed.js
5499
5500
  import { createCipheriv, createDecipheriv, createHash, randomBytes, scrypt, timingSafeEqual } from "node:crypto";
5500
5501
  import { closeSync, createReadStream, createWriteStream, existsSync, openSync, readSync, renameSync, rmSync, statSync } from "node:fs";
5501
5502
  import { Transform } from "node:stream";
@@ -5602,7 +5603,7 @@ var unsealFile = /* @__PURE__ */ __name(async (from, to, password) => {
5602
5603
  renameSync(pending, to);
5603
5604
  }, "unsealFile");
5604
5605
 
5605
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/store/compatibility.js
5606
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/store/compatibility.js
5606
5607
  var SPEAKS = MIGRATIONS.at(-1)?.version ?? 0;
5607
5608
  var fileSchemaOf = /* @__PURE__ */ __name((database) => {
5608
5609
  const tracked = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'schema_migrations'").get();
@@ -5626,7 +5627,7 @@ var compatibilityOf = /* @__PURE__ */ __name((file2, migrations = MIGRATIONS) =>
5626
5627
  };
5627
5628
  }, "compatibilityOf");
5628
5629
 
5629
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/store/repair.js
5630
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/store/repair.js
5630
5631
  import { createHash as createHash2 } from "node:crypto";
5631
5632
  var COPY_MARK = "__repair_";
5632
5633
  var COPY_NAME = /__repair_[0-9a-f]{8}(_\d+)?$/;
@@ -5880,7 +5881,7 @@ var deleteCopy = /* @__PURE__ */ __name((database, name) => {
5880
5881
  return found;
5881
5882
  }, "deleteCopy");
5882
5883
 
5883
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/cli/store-info.js
5884
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/cli/store-info.js
5884
5885
  import { existsSync as existsSync2, statSync as statSync2 } from "node:fs";
5885
5886
  var pendingIfKnown = /* @__PURE__ */ __name((database) => database.prepare("SELECT 1 FROM pragma_table_info('messages') WHERE name = 'normalized_text'").get() ? pendingNormalization(database) : null, "pendingIfKnown");
5886
5887
  var bytesOf = /* @__PURE__ */ __name((path) => existsSync2(path) ? statSync2(path).size : 0, "bytesOf");
@@ -5927,7 +5928,7 @@ var storeInfoCommand = /* @__PURE__ */ __name(() => annotate(new Command("info")
5927
5928
  renderAnswer(this, outputFor(this), itemOf(answer));
5928
5929
  }), "storeInfoCommand");
5929
5930
 
5930
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
5931
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
5931
5932
  var ENCRYPT_OPTION = [
5932
5933
  "--encrypt",
5933
5934
  "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"
@@ -5946,7 +5947,7 @@ var passwordOf = /* @__PURE__ */ __name(async (command, { twice }) => {
5946
5947
  return password;
5947
5948
  }, "passwordOf");
5948
5949
 
5949
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/replies/rules.js
5950
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/replies/rules.js
5950
5951
  import { existsSync as existsSync3, readFileSync } from "node:fs";
5951
5952
  import { join } from "node:path";
5952
5953
  var REPLY_ACTIONS = ["reply", "task"];
@@ -6117,7 +6118,7 @@ var problem = /* @__PURE__ */ __name((issue) => {
6117
6118
  }, "problem");
6118
6119
  var broken = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply rules ${path} cannot be read (${why}) \u2014 fix the file`), "broken");
6119
6120
 
6120
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/replies/state.js
6121
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/replies/state.js
6121
6122
  import { existsSync as existsSync4, readFileSync as readFileSync2 } from "node:fs";
6122
6123
  import { join as join2 } from "node:path";
6123
6124
  var ANSWERED_KEPT = 1e3;
@@ -6170,7 +6171,7 @@ var recordReply = /* @__PURE__ */ __name((state, rule2, message, now) => {
6170
6171
  }, "recordReply");
6171
6172
  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");
6172
6173
 
6173
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/replies/decide.js
6174
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/replies/decide.js
6174
6175
  var skip = /* @__PURE__ */ __name((why) => ({ skip: why }), "skip");
6175
6176
  var decide = /* @__PURE__ */ __name((rule2, incoming, state, now) => {
6176
6177
  const { message, chat, owner, sender } = incoming;
@@ -6276,7 +6277,7 @@ var filled = /* @__PURE__ */ __name((template2, senderName) => {
6276
6277
  return template2.replaceAll("{firstName}", name.split(/\s+/)[0] ?? name).replaceAll("{name}", name);
6277
6278
  }, "filled");
6278
6279
 
6279
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/replies/template.js
6280
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/replies/template.js
6280
6281
  var import_liquidjs = __toESM(require_liquid_node(), 1);
6281
6282
  var TEMPLATE_LIMITS = {
6282
6283
  parse: 32768,
@@ -6436,7 +6437,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
6436
6437
  }
6437
6438
  }, "renderReplyTemplate");
6438
6439
 
6439
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
6440
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
6440
6441
  var DRY_RUN_DAYS = 7;
6441
6442
  var PAGE = 500;
6442
6443
  var dryRun = /* @__PURE__ */ __name(async (store, account, rules, { since, until = Date.now(), only, audience, render }) => {
@@ -6550,7 +6551,7 @@ var storedSince = /* @__PURE__ */ __name(async (store, account, chat, since) =>
6550
6551
  }
6551
6552
  }, "storedSince");
6552
6553
 
6553
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
6554
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
6554
6555
  var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
6555
6556
  const host = new URL(baseUrl).host;
6556
6557
  return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
@@ -6581,7 +6582,7 @@ var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) =>
6581
6582
  };
6582
6583
  }, "embeddingKeys");
6583
6584
 
6584
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/models/openai.js
6585
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/models/openai.js
6585
6586
  var options = strictObject({
6586
6587
  temperature: range(0, 2),
6587
6588
  top_p: range(0, 1),
@@ -6630,7 +6631,7 @@ var openai = {
6630
6631
  }), "complete")
6631
6632
  };
6632
6633
 
6633
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/models/index.js
6634
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/models/index.js
6634
6635
  var modelGateway = /* @__PURE__ */ __name((deps) => ({
6635
6636
  complete: /* @__PURE__ */ __name(async (request) => {
6636
6637
  if (deps.signal?.aborted)
@@ -6645,7 +6646,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
6645
6646
  if (!adapter && target.provider === "openai")
6646
6647
  adapter = openai;
6647
6648
  if (!adapter && target.provider === "anthropic")
6648
- adapter = (await import("./anthropic-5RN7BGDI.js")).anthropic;
6649
+ adapter = (await import("./anthropic-QLLP7EE4.js")).anthropic;
6649
6650
  if (!adapter)
6650
6651
  throw new CliError("validation_error", `no model adapter for ${target.provider}`);
6651
6652
  if (request.images !== void 0 && adapter.images !== true)
@@ -6686,7 +6687,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
6686
6687
  }, "complete")
6687
6688
  }), "modelGateway");
6688
6689
 
6689
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/replies/consents.js
6690
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/replies/consents.js
6690
6691
  import { existsSync as existsSync5, readFileSync as readFileSync3 } from "node:fs";
6691
6692
  import { join as join3 } from "node:path";
6692
6693
  var shape = strictObject({
@@ -6711,7 +6712,7 @@ var mayModelReply = /* @__PURE__ */ __name((path, provider, chat) => {
6711
6712
  return consent.provider === provider && !consent.deniedChats.includes(chat);
6712
6713
  }, "mayModelReply");
6713
6714
 
6714
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/replies/rendering.js
6715
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/replies/rendering.js
6715
6716
  var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, options2 = {
6716
6717
  ai: true
6717
6718
  }) => async (rule2, message, chat, now) => {
@@ -6758,7 +6759,7 @@ var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, o
6758
6759
  return result2;
6759
6760
  }, "replyRenderer");
6760
6761
 
6761
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/replies/serve.js
6762
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/replies/serve.js
6762
6763
  var NOT_ALLOWED = "replies.send is not allow";
6763
6764
  var NO_RULES = "no rules";
6764
6765
  var ONLY_TASK = "opened a task, sent nothing";
@@ -6851,7 +6852,7 @@ var replyTo = /* @__PURE__ */ __name(async (deps, message) => {
6851
6852
  return { skip: why };
6852
6853
  }, "replyTo");
6853
6854
 
6854
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-catch-up.js
6855
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-catch-up.js
6855
6856
  var START_SYNC_DELAY_MS = 3e4;
6856
6857
  var START_SYNC_BUDGET_MS = 5 * 6e4;
6857
6858
  var START_SYNC_WINDOW_MS = 7 * 864e5;
@@ -6928,7 +6929,7 @@ var startSync = /* @__PURE__ */ __name(({ chats, newestHeld, fetch: fetch2, note
6928
6929
  };
6929
6930
  }, "startSync");
6930
6931
 
6931
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
6932
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
6932
6933
  var FIRST_FETCH_MS = 6e4;
6933
6934
  var DAY_MS = 864e5;
6934
6935
  var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, firstMs = FIRST_FETCH_MS, everyMs = DAY_MS }) => {
@@ -6982,7 +6983,7 @@ var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, fi
6982
6983
  };
6983
6984
  }, "memberFetches");
6984
6985
 
6985
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
6986
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
6986
6987
  var record2 = /* @__PURE__ */ __name((context, app, severity, attributes) => recordLogFor(context.streams.diagnostic, app, { command: currentRun().command || "serve" })[severity](attributes), "record");
6987
6988
  var noticeFor = /* @__PURE__ */ __name((context, app, severity = "warn") => ({ text, ...attributes }) => {
6988
6989
  if (context.format === "pretty") {
@@ -7015,7 +7016,7 @@ var recordDiagnostics = /* @__PURE__ */ __name((context, app) => {
7015
7016
  return context;
7016
7017
  }, "recordDiagnostics");
7017
7018
 
7018
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
7019
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
7019
7020
  var STEMS_EVERY_MS = 3e4;
7020
7021
  var STEMS_SLICE_MS = 2e3;
7021
7022
  var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY_MS, sliceMs = STEMS_SLICE_MS }) => {
@@ -7055,7 +7056,7 @@ var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY
7055
7056
  };
7056
7057
  }, "stemFills");
7057
7058
 
7058
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/render/messages.js
7059
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/render/messages.js
7059
7060
  import { styleText } from "node:util";
7060
7061
  var TIME_WIDTH = 8;
7061
7062
  var INDENT = " ".repeat(TIME_WIDTH + 2);
@@ -7231,7 +7232,7 @@ var editedAt = /* @__PURE__ */ __name((message, options2) => {
7231
7232
  return day(edited) === day(message.timestamp) ? time : `${day(edited)} ${time}`;
7232
7233
  }, "editedAt");
7233
7234
 
7234
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
7235
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
7235
7236
  var defined = /* @__PURE__ */ __name((value) => Object.fromEntries(Object.entries(value).filter(([, one]) => one !== void 0)), "defined");
7236
7237
  var attachmentItem = /* @__PURE__ */ __name((attachment) => defined({
7237
7238
  kind: attachment.kind,
@@ -7326,7 +7327,7 @@ var viewOf = /* @__PURE__ */ __name((context, messenger) => ({
7326
7327
  locale: messenger.app.locale
7327
7328
  }), "viewOf");
7328
7329
 
7329
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
7330
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
7330
7331
  var observed = /* @__PURE__ */ __name((value) => ({
7331
7332
  value: value.value,
7332
7333
  observed_at: value.observedAt,
@@ -7393,7 +7394,7 @@ var watchEventItem = /* @__PURE__ */ __name((value, account) => {
7393
7394
  }
7394
7395
  }, "watchEventItem");
7395
7396
 
7396
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
7397
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
7397
7398
  var watchCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("watch"), {
7398
7399
  output: { entity: "watch_item" },
7399
7400
  effects: REMOTE_READ,
@@ -7548,7 +7549,7 @@ var describe = /* @__PURE__ */ __name((event, render) => {
7548
7549
  }
7549
7550
  }, "describe");
7550
7551
 
7551
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
7552
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
7552
7553
  var serveCommand = /* @__PURE__ */ __name((messenger) => {
7553
7554
  const command = annotate(new Command("serve"), {
7554
7555
  output: { entity: "serve_summary" },
@@ -7812,7 +7813,7 @@ var tasking = /* @__PURE__ */ __name((context, warn) => {
7812
7813
  };
7813
7814
  }, "tasking");
7814
7815
 
7815
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
7816
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
7816
7817
  import { existsSync as existsSync6 } from "node:fs";
7817
7818
  var PATH = "store tables list";
7818
7819
  var STORE_TABLES_QUERY = {
@@ -7855,7 +7856,7 @@ var storeTablesCommand = /* @__PURE__ */ __name((messenger) => {
7855
7856
  return tables;
7856
7857
  }, "storeTablesCommand");
7857
7858
 
7858
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
7859
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
7859
7860
  var SEARCH_INDEXES = ["messages_fts", "chats_fts", "identities_fts"];
7860
7861
  var WORD_INDEX = "message_words";
7861
7862
  var schemaOf = /* @__PURE__ */ __name((database) => {
@@ -8131,7 +8132,11 @@ var migrateCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command(
8131
8132
  }
8132
8133
  const answer = await reading(path, (database) => {
8133
8134
  const from = schemaOf(database).version;
8134
- migrate(database, { command: messenger.app.command, version: messenger.app.version });
8135
+ migrate(database, {
8136
+ command: messenger.app.command,
8137
+ version: messenger.app.version,
8138
+ rollback: { store: path, warn: /* @__PURE__ */ __name((line) => renderer.warn(line), "warn") }
8139
+ });
8135
8140
  const { normalized, indexed, terms } = buildWordIndex(database, (note) => renderer.note(note));
8136
8141
  const stemmed = buildStems(database, (note) => renderer.note(note));
8137
8142
  const notes = buildNoteIndex(database, (note) => renderer.note(note));
@@ -8270,7 +8275,7 @@ var decryptCommand = /* @__PURE__ */ __name(() => annotate(new Command("decrypt"
8270
8275
  await unsealFile(from, to, await passwordOf(this, { twice: false }));
8271
8276
  result(this, { path: to, from, bytes: bytesOf2(to) });
8272
8277
  }), "decryptCommand");
8273
- 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) {
8278
+ 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) {
8274
8279
  const path = storePath(environmentOf(this).env ?? process.env);
8275
8280
  const given = resolve(file2);
8276
8281
  if (!existsSync7(given))
@@ -8293,6 +8298,8 @@ var restoreFrom = /* @__PURE__ */ __name(async (command, messenger, backup, give
8293
8298
  if (existsSync7(path) && realpathSync(backup) === realpathSync(path)) {
8294
8299
  throw new CliError("validation_error", `${backup} is the store itself`);
8295
8300
  }
8301
+ if (await isRollbackCopy(backup))
8302
+ return rollBackFrom(command, messenger, backup);
8296
8303
  const schema = await backupSchema(backup);
8297
8304
  const stamp = stampNow();
8298
8305
  const kept = existsSync7(path) ? `${path}.before-restore-${stamp}` : null;
@@ -8319,6 +8326,43 @@ var restoreFrom = /* @__PURE__ */ __name(async (command, messenger, backup, give
8319
8326
  renderer.note(`the backup is behind this build; the next command migrates it \u2014 \`${lineOf(command, "store migrate")}\` now`);
8320
8327
  }
8321
8328
  }, "restoreFrom");
8329
+ var isRollbackCopy = /* @__PURE__ */ __name(async (file2) => {
8330
+ try {
8331
+ return await readingOnly(file2, (database) => database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'rollback_meta'").get() !== void 0);
8332
+ } catch {
8333
+ return false;
8334
+ }
8335
+ }, "isRollbackCopy");
8336
+ var rollBackFrom = /* @__PURE__ */ __name(async (command, messenger, copy) => {
8337
+ const { renderer } = outputFor(command);
8338
+ const path = storePath(environmentOf(command).env ?? process.env);
8339
+ if (!existsSync7(path))
8340
+ throw new CliError("not_found", `no store at ${path} to roll back`);
8341
+ const waitMs = environmentOf(command).storeLockWaitMs;
8342
+ await quiesce(path, messenger, "restore", (message) => renderer.warn(message), waitMs);
8343
+ const { database } = await openSqlite(path);
8344
+ let rolled;
8345
+ try {
8346
+ rolled = rollBack(database, copy);
8347
+ } finally {
8348
+ database.close();
8349
+ }
8350
+ result(command, {
8351
+ path,
8352
+ restoredFrom: copy,
8353
+ rolledBack: true,
8354
+ schema: rolled.from,
8355
+ was: rolled.was,
8356
+ tables: rolled.restored,
8357
+ rebuilt: rolled.rebuilt,
8358
+ foreignKeyViolations: rolled.foreignKeyViolations
8359
+ });
8360
+ const taken = new Date(rolled.createdAt).toISOString();
8361
+ 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`);
8362
+ renderer.note("open it with the older tool and run its `store rebuild`: the search indexes are behind the tables");
8363
+ renderer.note(`a tool that speaks schema ${rolled.to} or later migrates it again on its next run`);
8364
+ renderer.note("restart every serve and mcp of either CLI that was running, so they read the restored store");
8365
+ }, "rollBackFrom");
8322
8366
  var backupSchema = /* @__PURE__ */ __name(async (backup) => {
8323
8367
  let read;
8324
8368
  try {
@@ -2,12 +2,12 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  CliError
5
- } from "./chunk-WDWP5N6M.js";
5
+ } from "./chunk-MLSN3UP4.js";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/models/types.js
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/models/types.js
11
11
  var MAX_MODEL_IMAGE_BYTES = 4 * 1024 * 1024;
12
12
  var validateImages = /* @__PURE__ */ __name((images) => {
13
13
  if (images === void 0)
@@ -4,15 +4,15 @@ import {
4
4
  MAX_SECRET_INPUT,
5
5
  bufferedInput,
6
6
  inputPolicy
7
- } from "./chunk-5HHIPDNW.js";
7
+ } from "./chunk-QVPTZDRA.js";
8
8
  import {
9
9
  CliError
10
- } from "./chunk-WDWP5N6M.js";
10
+ } from "./chunk-MLSN3UP4.js";
11
11
  import {
12
12
  __name
13
13
  } from "./chunk-ZVVMGPBJ.js";
14
14
 
15
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/terminal/prompt.js
15
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/terminal/prompt.js
16
16
  import { createInterface } from "node:readline";
17
17
  import { Writable } from "node:stream";
18
18
  var readSecret = /* @__PURE__ */ __name(async (prompt, { input = process.stdin, output = process.stderr, echo = false, signal: givenSignal } = {}) => {
@@ -2,15 +2,15 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  unit
5
- } from "./chunk-Z5NL6YNU.js";
5
+ } from "./chunk-J2RUBXCI.js";
6
6
  import {
7
7
  CliError
8
- } from "./chunk-WDWP5N6M.js";
8
+ } from "./chunk-MLSN3UP4.js";
9
9
  import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
12
12
 
13
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/embeddings/remote.js
13
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/embeddings/remote.js
14
14
  import { setTimeout } from "node:timers/promises";
15
15
  var OPENAI_URL = "https://api.openai.com/v1";
16
16
  var OPENAI_MODELS = {
@@ -3,15 +3,15 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  readSharedSection,
5
5
  writeSharedSection
6
- } from "./chunk-QGOOPPEW.js";
6
+ } from "./chunk-BXZRTMXA.js";
7
7
  import {
8
8
  CliError
9
- } from "./chunk-WDWP5N6M.js";
9
+ } from "./chunk-MLSN3UP4.js";
10
10
  import {
11
11
  __name
12
12
  } from "./chunk-ZVVMGPBJ.js";
13
13
 
14
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/cli/setup-answers.js
14
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/cli/setup-answers.js
15
15
  var PERMISSION_ANSWERS = ["readonly", "allow"];
16
16
  var QUESTIONS = ["languages", "tools", "permissions"];
17
17
  var SECTION = "setup";
@@ -5,15 +5,15 @@ import {
5
5
  readLock,
6
6
  releaseLock,
7
7
  takeLock
8
- } from "./chunk-C3GNOEJP.js";
8
+ } from "./chunk-RGKXMVOZ.js";
9
9
  import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
12
12
 
13
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/mcp/http/state.js
13
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/mcp/http/state.js
14
14
  import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs";
15
15
 
16
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/mcp/http/activity.js
16
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/mcp/http/activity.js
17
17
  import { randomBytes } from "node:crypto";
18
18
  import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
19
19
  import { dirname } from "node:path";
@@ -86,7 +86,7 @@ var activityRecorder = /* @__PURE__ */ __name((path, now = Date.now) => {
86
86
  };
87
87
  }, "activityRecorder");
88
88
 
89
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/mcp/http/state.js
89
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/mcp/http/state.js
90
90
  var ACCESS_SECONDS = 60 * 60;
91
91
  var REFRESH_SECONDS = 30 * 24 * 60 * 60;
92
92
  var readStored = /* @__PURE__ */ __name((path) => existsSync2(path) ? JSON.parse(readFileSync2(path, "utf8")) : { clients: [], tokens: [] }, "readStored");
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/runs/secrets.js
7
+ // node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/runs/secrets.js
8
8
  var SECRET_WORDS = /* @__PURE__ */ new Set([
9
9
  "authorization",
10
10
  "cookie",