@wirecat/tg-cli 0.112.0 → 0.114.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 (108) hide show
  1. package/dist/bin/tg.js +6 -2
  2. package/dist/bundle/{adapter-ILDV2YSZ.js → adapter-YAEHX3QB.js} +45 -45
  3. package/dist/bundle/{all-profiles-4SH2Q4WV.js → all-profiles-R5CW42HQ.js} +8 -8
  4. package/dist/bundle/{anthropic-64SM23YO.js → anthropic-F25RHYV2.js} +5 -5
  5. package/dist/bundle/{app-server-SSYZWCDJ.js → app-server-FAG6FNXR.js} +43 -42
  6. package/dist/bundle/{bot-api-OHAGQMES.js → bot-api-KOIAXTQR.js} +46 -46
  7. package/dist/bundle/{bot-history-AUFO7UL2.js → bot-history-PRAOZEWC.js} +16 -15
  8. package/dist/bundle/{bun-AHZX63TR.js → bun-XIMM6EHD.js} +2 -2
  9. package/dist/bundle/{bun-sqlite-KBIIODPV.js → bun-sqlite-DSUCO4TR.js} +4 -4
  10. package/dist/bundle/{chunk-JYOQMYNJ.js → chunk-2PAKHXIV.js} +31 -30
  11. package/dist/bundle/{chunk-KLNQXUDX.js → chunk-34USFPBF.js} +20 -18
  12. package/dist/bundle/{chunk-QMJGHSGN.js → chunk-3EZ43DAF.js} +3 -3
  13. package/dist/bundle/{chunk-NKACHGB2.js → chunk-3R43O3GG.js} +74 -15
  14. package/dist/bundle/{chunk-KYYAHIG2.js → chunk-4JOKO4IW.js} +6992 -5870
  15. package/dist/bundle/{chunk-XSYJKEA5.js → chunk-5HKMEXVQ.js} +35 -35
  16. package/dist/bundle/{chunk-NQKPXVLX.js → chunk-6SPLZI5P.js} +2 -2
  17. package/dist/bundle/{chunk-BIERCQVG.js → chunk-7FOT4XD2.js} +2232 -922
  18. package/dist/bundle/{chunk-4JXZKMXV.js → chunk-AL36NHO6.js} +5122 -949
  19. package/dist/bundle/{chunk-4IDJ7QCG.js → chunk-ALHKUQDZ.js} +4 -4
  20. package/dist/bundle/{chunk-2IGZLBTE.js → chunk-C34IDOA5.js} +2 -2
  21. package/dist/bundle/{chunk-KGYPSBTI.js → chunk-C7K7AP6G.js} +81 -33
  22. package/dist/bundle/{chunk-PDVSMGWO.js → chunk-CDCBFMEI.js} +2 -2
  23. package/dist/bundle/{chunk-TOBJGMMA.js → chunk-CS5DQ6KM.js} +15 -14
  24. package/dist/bundle/{chunk-DNYGJAEP.js → chunk-DQQEN3X4.js} +4 -4
  25. package/dist/bundle/{chunk-SC2DUQAK.js → chunk-E2IRSRTB.js} +1 -1
  26. package/dist/bundle/{chunk-QL4WBCL5.js → chunk-EARO464A.js} +13 -7
  27. package/dist/bundle/{chunk-5BNYW5RA.js → chunk-EQJG44KE.js} +4 -4
  28. package/dist/bundle/{chunk-WWKXTKCE.js → chunk-HA35XN2Z.js} +6 -4
  29. package/dist/bundle/{chunk-EO7PQE3J.js → chunk-I6BKSGZQ.js} +364 -178
  30. package/dist/bundle/{chunk-TUJEJ4D5.js → chunk-IN25CJ3D.js} +13 -13
  31. package/dist/bundle/{chunk-MCXVGHL6.js → chunk-J5U2HKGZ.js} +41 -28
  32. package/dist/bundle/{chunk-3GL4AOOG.js → chunk-KIZT2MI6.js} +1 -1
  33. package/dist/bundle/{chunk-3AJO4GER.js → chunk-KZQXOZFC.js} +5 -5
  34. package/dist/bundle/chunk-L4CMCC3V.js +34 -0
  35. package/dist/bundle/{chunk-COTC7HF3.js → chunk-LPUFOWL3.js} +1 -1
  36. package/dist/bundle/{chunk-ICEJKOKO.js → chunk-M3IWROIF.js} +7 -7
  37. package/dist/bundle/{chunk-K7VOCHVS.js → chunk-MQTTVQ3V.js} +6 -6
  38. package/dist/bundle/{chunk-D5JP2YWG.js → chunk-NJ2I4KFZ.js} +2 -2
  39. package/dist/bundle/{chunk-PXUHQO66.js → chunk-NKP3RUM4.js} +11 -11
  40. package/dist/bundle/{chunk-WI2S6INJ.js → chunk-NMVFFWF2.js} +6 -6
  41. package/dist/bundle/{chunk-GW7JRFTF.js → chunk-NTF34HJP.js} +3 -3
  42. package/dist/bundle/{chunk-EPAOLRUL.js → chunk-NUVBC3LJ.js} +8 -3
  43. package/dist/bundle/{chunk-7MFJFVUN.js → chunk-O7CBGHI7.js} +1 -1
  44. package/dist/bundle/{chunk-5W72OARG.js → chunk-OFDMD3YF.js} +8 -8
  45. package/dist/bundle/{chunk-RANORATG.js → chunk-OWHF6BON.js} +4 -4
  46. package/dist/bundle/{chunk-UXCWUEN7.js → chunk-P4YBABUC.js} +5 -40
  47. package/dist/bundle/{chunk-RPNRCFEE.js → chunk-QCXYJKPF.js} +2 -2
  48. package/dist/bundle/{chunk-6KGENDPF.js → chunk-RBC7JQ4Y.js} +2 -2
  49. package/dist/bundle/{chunk-GM44UNGL.js → chunk-RFRI2HFT.js} +1 -1
  50. package/dist/bundle/{chunk-UQOSZ2XX.js → chunk-TKNCJMYN.js} +1467 -707
  51. package/dist/bundle/{chunk-RHYMEHYK.js → chunk-TRRRRGMI.js} +2 -2
  52. package/dist/bundle/{chunk-UVRD447S.js → chunk-TTTDZOBW.js} +3 -3
  53. package/dist/bundle/{chunk-E4EJ2UTT.js → chunk-ULFTCR5W.js} +2 -2
  54. package/dist/bundle/{chunk-JPRYFDOJ.js → chunk-VHO66SMY.js} +174 -45
  55. package/dist/bundle/{chunk-GSGS62LX.js → chunk-VVKEWWSO.js} +1 -1
  56. package/dist/bundle/{chunk-JIGYVVWA.js → chunk-WIRDTH3J.js} +121 -31
  57. package/dist/bundle/{chunk-BTAET4U3.js → chunk-WOQGUIXE.js} +1 -1
  58. package/dist/bundle/{chunk-3W7BU2BL.js → chunk-XDOPONC3.js} +8 -13
  59. package/dist/bundle/{chunk-DFUTZGEV.js → chunk-Y3AQHPAJ.js} +1 -1
  60. package/dist/bundle/{chunk-JLB5LEXJ.js → chunk-Y4LCSCSH.js} +3 -3
  61. package/dist/bundle/{chunk-RC7EBLHM.js → chunk-YPABTT7A.js} +8 -8
  62. package/dist/bundle/{chunk-JXTYTAWE.js → chunk-YQ64ZNLD.js} +14 -13
  63. package/dist/bundle/{chunk-SFJFBIYP.js → chunk-ZFMOPKPT.js} +2 -2
  64. package/dist/bundle/command-contract-SOTDPG22.js +31 -0
  65. package/dist/bundle/{decode-FR3QHHJI.js → decode-7U4SXPAN.js} +4 -4
  66. package/dist/bundle/{echarts-VTV4C2OS.js → echarts-GKEZEAL7.js} +2 -2
  67. package/dist/bundle/{embed-US7X5P5D.js → embed-IDZDQMSW.js} +5 -5
  68. package/dist/bundle/{embedder-63Z7ZBYG.js → embedder-RY5R2PGO.js} +8 -8
  69. package/dist/bundle/{entry-B4J7IAG3.js → entry-P6YZ3ZV6.js} +8 -5
  70. package/dist/bundle/{first-run-MXPPUGII.js → first-run-66KTCVQK.js} +9 -9
  71. package/dist/bundle/first-screen-NY46X6QU.js +29 -0
  72. package/dist/bundle/{identity-AQWKU7SM.js → identity-GXVKGCNU.js} +3 -3
  73. package/dist/bundle/{instructions-GBR6DJTK.js → instructions-P5E34PQR.js} +1 -1
  74. package/dist/bundle/{mcp-YJEQYYTR.js → mcp-FUSDPAOL.js} +2 -2
  75. package/dist/bundle/{node-QXGPMDH2.js → node-GKPRXS5Y.js} +2 -2
  76. package/dist/bundle/{node-sqlite-L6CAMXQ2.js → node-sqlite-VUXFVPJ6.js} +10 -4
  77. package/dist/bundle/{oauth-5RK6J4SG.js → oauth-7SQIPMOY.js} +6 -6
  78. package/dist/bundle/{open-A3IAG7U6.js → open-W3BN2SIO.js} +4 -3
  79. package/dist/bundle/{openai-YKNGCHVV.js → openai-LQTK3ZMC.js} +13 -13
  80. package/dist/bundle/{process-CGLNXFIU.js → process-U2P5Z6UF.js} +1 -1
  81. package/dist/bundle/{program-AEDR6R5P.js → program-DIPSLR6O.js} +48 -48
  82. package/dist/bundle/{prompt-65CSCL2T.js → prompt-GESHKSM5.js} +4 -4
  83. package/dist/bundle/{proxy-transport-U3QOYMQF.js → proxy-transport-C2EUUT32.js} +4 -4
  84. package/dist/bundle/{recognize-ECRO6CFK.js → recognize-FEQTIJET.js} +3 -3
  85. package/dist/bundle/{remote-6IEFZFGO.js → remote-UXOPBPKS.js} +6 -6
  86. package/dist/bundle/{rerank-23GXWT2V.js → rerank-L4JM4REK.js} +6 -6
  87. package/dist/bundle/{serve-S65YTPZN.js → serve-DDWW44DB.js} +10 -9
  88. package/dist/bundle/{server-MVTBK7GV.js → server-UTWBIZHB.js} +32 -32
  89. package/dist/bundle/server-ZI7WDAW6.js +56 -0
  90. package/dist/bundle/{state-TH3UVQAW.js → state-EV7FGEK4.js} +5 -5
  91. package/dist/bundle/{store-2WFTUSNG.js → store-EXBUF4OG.js} +11 -10
  92. package/dist/bundle/store-maintenance-command-UBZE2Z6T.js +46 -0
  93. package/dist/bundle/tg.js +4 -4
  94. package/dist/commands/context.d.ts.map +1 -1
  95. package/dist/commands/context.js +6 -4
  96. package/dist/commands/context.js.map +1 -1
  97. package/dist/reasons.d.ts.map +1 -1
  98. package/dist/reasons.js +5 -0
  99. package/dist/reasons.js.map +1 -1
  100. package/dist/version.d.ts +1 -1
  101. package/dist/version.js +1 -1
  102. package/package.json +3 -3
  103. package/dist/bundle/chunk-B3Y2KZRS.js +0 -3588
  104. package/dist/bundle/command-contract-4KVJJZ46.js +0 -32
  105. package/dist/bundle/first-screen-GFYHUBBD.js +0 -30
  106. package/dist/bundle/server-IH24WEAC.js +0 -56
  107. package/dist/bundle/store-maintenance-command-PUOU2CL6.js +0 -45
  108. /package/dist/bundle/{chunk-WJWLHLQ7.js → chunk-NUN6OGOV.js} +0 -0
@@ -2,12 +2,12 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  resolvePaths
5
- } from "./chunk-KLNQXUDX.js";
5
+ } from "./chunk-34USFPBF.js";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/store/path.js
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/store/path.js
11
11
  import { join } from "node:path";
12
12
  var wirecatDirectory = /* @__PURE__ */ __name((env = process.env, platform) => resolvePaths({ appName: "WireCat", prefix: "WIRECAT", env, ...platform ? { platform } : {} }).state, "wirecatDirectory");
13
13
  var storePath = /* @__PURE__ */ __name((env = process.env) => env.MESSAGING_STORE ?? join(wirecatDirectory(env), "wirecat.db"), "storePath");
@@ -3,15 +3,15 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  readSharedSection,
5
5
  writeSharedSection
6
- } from "./chunk-WI2S6INJ.js";
6
+ } from "./chunk-NMVFFWF2.js";
7
7
  import {
8
8
  CliError
9
- } from "./chunk-QL4WBCL5.js";
9
+ } from "./chunk-EARO464A.js";
10
10
  import {
11
11
  __name
12
12
  } from "./chunk-ZVVMGPBJ.js";
13
13
 
14
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/cli/setup-answers.js
14
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/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";
@@ -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-QL4WBCL5.js";
5
+ } from "./chunk-EARO464A.js";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/cli/input-policy.js
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/input-policy.js
11
11
  var MAX_BUFFERED_INPUT = 16 * 1024 * 1024;
12
12
  var MAX_SECRET_INPUT = 64 * 1024;
13
13
  var policies = /* @__PURE__ */ new WeakMap();
@@ -3,15 +3,18 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  answerOf,
5
5
  messengerContext
6
- } from "./chunk-JIGYVVWA.js";
6
+ } from "./chunk-WIRDTH3J.js";
7
7
  import {
8
+ FETCHING,
8
9
  RULES_VERSION,
9
10
  applyTaskRulesOnArrival,
11
+ capability,
10
12
  chatEventAnswer,
11
13
  memberAnswer,
12
14
  newSendId,
13
15
  onlineDeps,
14
16
  openRequestTask,
17
+ patiently,
15
18
  pollVoteAnswer,
16
19
  queryTerms,
17
20
  senderIsMe,
@@ -20,7 +23,7 @@ import {
20
23
  syncsOneChat,
21
24
  typedQuery,
22
25
  withQuery
23
- } from "./chunk-KYYAHIG2.js";
26
+ } from "./chunk-4JOKO4IW.js";
24
27
  import {
25
28
  stringWidth,
26
29
  wrapAnsi
@@ -45,38 +48,39 @@ import {
45
48
  modelTarget,
46
49
  nextStep,
47
50
  outputFor,
51
+ parseDuration,
48
52
  recalledAccount,
49
53
  recordLogFor,
50
54
  renderAnswer,
51
55
  snakeKeys,
52
56
  storeTable,
53
57
  withoutProviderRefs
54
- } from "./chunk-4JXZKMXV.js";
58
+ } from "./chunk-AL36NHO6.js";
55
59
  import {
56
60
  failureKey
57
- } from "./chunk-RC7EBLHM.js";
61
+ } from "./chunk-YPABTT7A.js";
58
62
  import {
59
63
  envName
60
- } from "./chunk-2IGZLBTE.js";
64
+ } from "./chunk-C34IDOA5.js";
61
65
  import {
62
66
  holdLock,
63
67
  lockPath,
64
68
  releaseLock,
65
69
  servingProfiles,
66
70
  takeLock
67
- } from "./chunk-GW7JRFTF.js";
71
+ } from "./chunk-NTF34HJP.js";
68
72
  import {
69
73
  holdersOf
70
- } from "./chunk-3GL4AOOG.js";
74
+ } from "./chunk-KIZT2MI6.js";
71
75
  import {
72
76
  checkedOptions,
73
77
  range
74
- } from "./chunk-6KGENDPF.js";
78
+ } from "./chunk-RBC7JQ4Y.js";
75
79
  import {
76
80
  messagesFor,
77
81
  systemFor,
78
82
  validateImages
79
- } from "./chunk-RPNRCFEE.js";
83
+ } from "./chunk-QCXYJKPF.js";
80
84
  import {
81
85
  MIGRATIONS,
82
86
  drainNoteIndex,
@@ -105,19 +109,19 @@ import {
105
109
  storeClients,
106
110
  storeContents,
107
111
  vectorIndexCounts
108
- } from "./chunk-BIERCQVG.js";
112
+ } from "./chunk-7FOT4XD2.js";
109
113
  import {
110
114
  queryFieldsOf
111
- } from "./chunk-EO7PQE3J.js";
115
+ } from "./chunk-I6BKSGZQ.js";
112
116
  import {
113
117
  storePath
114
- } from "./chunk-RHYMEHYK.js";
118
+ } from "./chunk-TRRRRGMI.js";
115
119
  import {
116
120
  openCache
117
- } from "./chunk-3W7BU2BL.js";
121
+ } from "./chunk-XDOPONC3.js";
118
122
  import {
119
123
  readSecret
120
- } from "./chunk-QMJGHSGN.js";
124
+ } from "./chunk-3EZ43DAF.js";
121
125
  import {
122
126
  Credentials,
123
127
  pathsAreOverridden,
@@ -125,7 +129,7 @@ import {
125
129
  singleLine,
126
130
  visibleControls,
127
131
  writeSecurely
128
- } from "./chunk-KLNQXUDX.js";
132
+ } from "./chunk-34USFPBF.js";
129
133
  import {
130
134
  CliError,
131
135
  array,
@@ -150,7 +154,7 @@ import {
150
154
  transform,
151
155
  trim,
152
156
  union
153
- } from "./chunk-QL4WBCL5.js";
157
+ } from "./chunk-EARO464A.js";
154
158
  import {
155
159
  __commonJS,
156
160
  __name,
@@ -5490,11 +5494,11 @@ var require_liquid_node = __commonJS({
5490
5494
  }
5491
5495
  });
5492
5496
 
5493
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
5497
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
5494
5498
  import { chmodSync, constants, copyFileSync, existsSync as existsSync7, mkdirSync, realpathSync, renameSync as renameSync2, rmSync as rmSync2, statfsSync, statSync as statSync3, writeFileSync } from "node:fs";
5495
5499
  import { dirname, resolve } from "node:path";
5496
5500
 
5497
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/sealed.js
5501
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/sealed.js
5498
5502
  import { createCipheriv, createDecipheriv, createHash, randomBytes, scrypt, timingSafeEqual } from "node:crypto";
5499
5503
  import { closeSync, createReadStream, createWriteStream, existsSync, openSync, readSync, renameSync, rmSync, statSync } from "node:fs";
5500
5504
  import { Transform } from "node:stream";
@@ -5601,7 +5605,7 @@ var unsealFile = /* @__PURE__ */ __name(async (from, to, password) => {
5601
5605
  renameSync(pending, to);
5602
5606
  }, "unsealFile");
5603
5607
 
5604
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/store/compatibility.js
5608
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/store/compatibility.js
5605
5609
  var SPEAKS = MIGRATIONS.at(-1)?.version ?? 0;
5606
5610
  var fileSchemaOf = /* @__PURE__ */ __name((database) => {
5607
5611
  const tracked = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'schema_migrations'").get();
@@ -5625,7 +5629,7 @@ var compatibilityOf = /* @__PURE__ */ __name((file2, migrations = MIGRATIONS) =>
5625
5629
  };
5626
5630
  }, "compatibilityOf");
5627
5631
 
5628
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/store/repair.js
5632
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/store/repair.js
5629
5633
  import { createHash as createHash2 } from "node:crypto";
5630
5634
  var COPY_MARK = "__repair_";
5631
5635
  var COPY_NAME = /__repair_[0-9a-f]{8}(_\d+)?$/;
@@ -5879,7 +5883,7 @@ var deleteCopy = /* @__PURE__ */ __name((database, name) => {
5879
5883
  return found;
5880
5884
  }, "deleteCopy");
5881
5885
 
5882
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/cli/store-info.js
5886
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/store-info.js
5883
5887
  import { existsSync as existsSync2, statSync as statSync2 } from "node:fs";
5884
5888
  var pendingIfKnown = /* @__PURE__ */ __name((database) => database.prepare("SELECT 1 FROM pragma_table_info('messages') WHERE name = 'normalized_text'").get() ? pendingNormalization(database) : null, "pendingIfKnown");
5885
5889
  var bytesOf = /* @__PURE__ */ __name((path) => existsSync2(path) ? statSync2(path).size : 0, "bytesOf");
@@ -5926,7 +5930,7 @@ var storeInfoCommand = /* @__PURE__ */ __name(() => annotate(new Command("info")
5926
5930
  renderAnswer(this, outputFor(this), itemOf(answer));
5927
5931
  }), "storeInfoCommand");
5928
5932
 
5929
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
5933
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
5930
5934
  var ENCRYPT_OPTION = [
5931
5935
  "--encrypt",
5932
5936
  "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"
@@ -5945,7 +5949,7 @@ var passwordOf = /* @__PURE__ */ __name(async (command, { twice }) => {
5945
5949
  return password;
5946
5950
  }, "passwordOf");
5947
5951
 
5948
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/replies/rules.js
5952
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/replies/rules.js
5949
5953
  import { existsSync as existsSync3, readFileSync } from "node:fs";
5950
5954
  import { join } from "node:path";
5951
5955
  var REPLY_ACTIONS = ["reply", "task"];
@@ -6116,7 +6120,7 @@ var problem = /* @__PURE__ */ __name((issue) => {
6116
6120
  }, "problem");
6117
6121
  var broken = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply rules ${path} cannot be read (${why}) \u2014 fix the file`), "broken");
6118
6122
 
6119
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/replies/state.js
6123
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/replies/state.js
6120
6124
  import { existsSync as existsSync4, readFileSync as readFileSync2 } from "node:fs";
6121
6125
  import { join as join2 } from "node:path";
6122
6126
  var ANSWERED_KEPT = 1e3;
@@ -6169,7 +6173,7 @@ var recordReply = /* @__PURE__ */ __name((state, rule2, message, now) => {
6169
6173
  }, "recordReply");
6170
6174
  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");
6171
6175
 
6172
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/replies/decide.js
6176
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/replies/decide.js
6173
6177
  var skip = /* @__PURE__ */ __name((why) => ({ skip: why }), "skip");
6174
6178
  var decide = /* @__PURE__ */ __name((rule2, incoming, state, now) => {
6175
6179
  const { message, chat, owner, sender } = incoming;
@@ -6275,7 +6279,7 @@ var filled = /* @__PURE__ */ __name((template2, senderName) => {
6275
6279
  return template2.replaceAll("{firstName}", name.split(/\s+/)[0] ?? name).replaceAll("{name}", name);
6276
6280
  }, "filled");
6277
6281
 
6278
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/replies/template.js
6282
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/replies/template.js
6279
6283
  var import_liquidjs = __toESM(require_liquid_node(), 1);
6280
6284
  var TEMPLATE_LIMITS = {
6281
6285
  parse: 32768,
@@ -6435,7 +6439,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
6435
6439
  }
6436
6440
  }, "renderReplyTemplate");
6437
6441
 
6438
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
6442
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
6439
6443
  var DRY_RUN_DAYS = 7;
6440
6444
  var PAGE = 500;
6441
6445
  var dryRun = /* @__PURE__ */ __name(async (store, account, rules, { since, until = Date.now(), only, audience, render }) => {
@@ -6549,7 +6553,7 @@ var storedSince = /* @__PURE__ */ __name(async (store, account, chat, since) =>
6549
6553
  }
6550
6554
  }, "storedSince");
6551
6555
 
6552
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
6556
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
6553
6557
  var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
6554
6558
  const host = new URL(baseUrl).host;
6555
6559
  return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
@@ -6580,7 +6584,7 @@ var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) =>
6580
6584
  };
6581
6585
  }, "embeddingKeys");
6582
6586
 
6583
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/models/openai.js
6587
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/models/openai.js
6584
6588
  var options = strictObject({
6585
6589
  temperature: range(0, 2),
6586
6590
  top_p: range(0, 1),
@@ -6629,7 +6633,7 @@ var openai = {
6629
6633
  }, "complete")
6630
6634
  };
6631
6635
 
6632
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/models/index.js
6636
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/models/index.js
6633
6637
  var modelGateway = /* @__PURE__ */ __name((deps) => ({
6634
6638
  complete: /* @__PURE__ */ __name(async (request) => {
6635
6639
  if (deps.signal?.aborted)
@@ -6644,7 +6648,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
6644
6648
  if (!adapter && target.provider === "openai")
6645
6649
  adapter = openai;
6646
6650
  if (!adapter && target.provider === "anthropic")
6647
- adapter = (await import("./anthropic-64SM23YO.js")).anthropic;
6651
+ adapter = (await import("./anthropic-F25RHYV2.js")).anthropic;
6648
6652
  if (!adapter)
6649
6653
  throw new CliError("validation_error", `no model adapter for ${target.provider}`);
6650
6654
  if (request.images !== void 0 && adapter.images !== true)
@@ -6685,7 +6689,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
6685
6689
  }, "complete")
6686
6690
  }), "modelGateway");
6687
6691
 
6688
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/replies/consents.js
6692
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/replies/consents.js
6689
6693
  import { existsSync as existsSync5, readFileSync as readFileSync3 } from "node:fs";
6690
6694
  import { join as join3 } from "node:path";
6691
6695
  var shape = strictObject({
@@ -6710,7 +6714,7 @@ var mayModelReply = /* @__PURE__ */ __name((path, provider, chat) => {
6710
6714
  return consent.provider === provider && !consent.deniedChats.includes(chat);
6711
6715
  }, "mayModelReply");
6712
6716
 
6713
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/replies/rendering.js
6717
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/replies/rendering.js
6714
6718
  var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, options2 = {
6715
6719
  ai: true
6716
6720
  }) => async (rule2, message, chat, now) => {
@@ -6757,7 +6761,7 @@ var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, o
6757
6761
  return result2;
6758
6762
  }, "replyRenderer");
6759
6763
 
6760
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/replies/serve.js
6764
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/replies/serve.js
6761
6765
  var NOT_ALLOWED = "replies.send is not allow";
6762
6766
  var NO_RULES = "no rules";
6763
6767
  var ONLY_TASK = "opened a task, sent nothing";
@@ -6850,7 +6854,84 @@ var replyTo = /* @__PURE__ */ __name(async (deps, message) => {
6850
6854
  return { skip: why };
6851
6855
  }, "replyTo");
6852
6856
 
6853
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
6857
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-catch-up.js
6858
+ var START_SYNC_DELAY_MS = 3e4;
6859
+ var START_SYNC_BUDGET_MS = 5 * 6e4;
6860
+ var START_SYNC_WINDOW_MS = 7 * 864e5;
6861
+ var START_SYNC_PER_CHAT = 500;
6862
+ var startSync = /* @__PURE__ */ __name(({ chats, newestHeld, fetch: fetch2, note, warn, delayMs = START_SYNC_DELAY_MS, budgetMs = START_SYNC_BUDGET_MS, windowMs = START_SYNC_WINDOW_MS, now = Date.now }) => {
6863
+ const controller = new AbortController();
6864
+ let timer;
6865
+ let pass = Promise.resolve();
6866
+ let started = false;
6867
+ let done;
6868
+ const run = /* @__PURE__ */ __name(async () => {
6869
+ const stop = AbortSignal.any([controller.signal, AbortSignal.timeout(budgetMs)]);
6870
+ const floor = now() - windowMs;
6871
+ const moved = [];
6872
+ for (const chat of await chats(stop)) {
6873
+ const lastAt = Date.parse(chat.lastMessageAt ?? "");
6874
+ if (Number.isNaN(lastAt) || lastAt < floor)
6875
+ continue;
6876
+ moved.push({ chat, lastAt, held: await newestHeld(chat.id) });
6877
+ }
6878
+ const anywhere = moved.reduce((top, { held }) => held === void 0 ? top : Math.max(top, held), -Infinity);
6879
+ if (!Number.isFinite(anywhere))
6880
+ return;
6881
+ const behind = moved.filter(({ lastAt, held }) => lastAt > (held ?? anywhere)).sort((one, other) => other.lastAt - one.lastAt);
6882
+ if (behind.length === 0)
6883
+ return;
6884
+ const summary = { chats: 0, fetched: 0, failed: 0, stopped: false };
6885
+ done = summary;
6886
+ for (const { chat, held } of behind) {
6887
+ if (stop.aborted)
6888
+ break;
6889
+ try {
6890
+ summary.fetched += (await fetch2(chat.id, Math.max(held ?? anywhere, floor), stop)).fetched;
6891
+ summary.chats += 1;
6892
+ } catch (error) {
6893
+ if (stop.aborted)
6894
+ break;
6895
+ summary.failed += 1;
6896
+ const errorCode = failureKey(error);
6897
+ warn({
6898
+ code: "start_sync_chat_failed",
6899
+ chatId: chat.id,
6900
+ errorCode,
6901
+ text: `what ${chat.id} received while serve was down was not fetched: ${errorCode}`
6902
+ });
6903
+ }
6904
+ }
6905
+ summary.stopped = stop.aborted && summary.chats + summary.failed < behind.length;
6906
+ note({
6907
+ code: "start_sync",
6908
+ text: `caught up ${summary.fetched} message(s) in ${summary.chats} chat(s) that moved while serve was down` + (summary.stopped ? ` \u2014 stopped at the time limit, ${behind.length - summary.chats - summary.failed} left` : "")
6909
+ });
6910
+ }, "run");
6911
+ return {
6912
+ start: /* @__PURE__ */ __name(() => {
6913
+ if (started || controller.signal.aborted)
6914
+ return;
6915
+ started = true;
6916
+ timer = setTimeout(() => {
6917
+ pass = run().catch((error) => {
6918
+ if (controller.signal.aborted)
6919
+ return;
6920
+ const errorCode = failureKey(error);
6921
+ warn({ code: "start_sync_failed", errorCode, text: `the catch-up on start failed: ${errorCode}` });
6922
+ });
6923
+ }, delayMs);
6924
+ }, "start"),
6925
+ stop: /* @__PURE__ */ __name(async () => {
6926
+ controller.abort();
6927
+ clearTimeout(timer);
6928
+ await pass;
6929
+ }, "stop"),
6930
+ summary: /* @__PURE__ */ __name(() => done, "summary")
6931
+ };
6932
+ }, "startSync");
6933
+
6934
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
6854
6935
  var FIRST_FETCH_MS = 6e4;
6855
6936
  var DAY_MS = 864e5;
6856
6937
  var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, firstMs = FIRST_FETCH_MS, everyMs = DAY_MS }) => {
@@ -6904,7 +6985,7 @@ var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, fi
6904
6985
  };
6905
6986
  }, "memberFetches");
6906
6987
 
6907
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
6988
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
6908
6989
  var record2 = /* @__PURE__ */ __name((context, app, severity, attributes) => recordLogFor(context.streams.diagnostic, app, { command: currentRun().command || "serve" })[severity](attributes), "record");
6909
6990
  var noticeFor = /* @__PURE__ */ __name((context, app, severity = "warn") => ({ text, ...attributes }) => {
6910
6991
  if (context.format === "pretty") {
@@ -6937,7 +7018,7 @@ var recordDiagnostics = /* @__PURE__ */ __name((context, app) => {
6937
7018
  return context;
6938
7019
  }, "recordDiagnostics");
6939
7020
 
6940
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
7021
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
6941
7022
  var STEMS_EVERY_MS = 3e4;
6942
7023
  var STEMS_SLICE_MS = 2e3;
6943
7024
  var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY_MS, sliceMs = STEMS_SLICE_MS }) => {
@@ -6977,7 +7058,7 @@ var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY
6977
7058
  };
6978
7059
  }, "stemFills");
6979
7060
 
6980
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/render/messages.js
7061
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/render/messages.js
6981
7062
  import { styleText } from "node:util";
6982
7063
  var TIME_WIDTH = 8;
6983
7064
  var INDENT = " ".repeat(TIME_WIDTH + 2);
@@ -7153,7 +7234,7 @@ var editedAt = /* @__PURE__ */ __name((message, options2) => {
7153
7234
  return day(edited) === day(message.timestamp) ? time : `${day(edited)} ${time}`;
7154
7235
  }, "editedAt");
7155
7236
 
7156
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
7237
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
7157
7238
  var defined = /* @__PURE__ */ __name((value) => Object.fromEntries(Object.entries(value).filter(([, one]) => one !== void 0)), "defined");
7158
7239
  var attachmentItem = /* @__PURE__ */ __name((attachment) => defined({
7159
7240
  kind: attachment.kind,
@@ -7248,7 +7329,7 @@ var viewOf = /* @__PURE__ */ __name((context, messenger) => ({
7248
7329
  locale: messenger.app.locale
7249
7330
  }), "viewOf");
7250
7331
 
7251
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
7332
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
7252
7333
  var observed = /* @__PURE__ */ __name((value) => ({
7253
7334
  value: value.value,
7254
7335
  observed_at: value.observedAt,
@@ -7315,7 +7396,7 @@ var watchEventItem = /* @__PURE__ */ __name((value, account) => {
7315
7396
  }
7316
7397
  }, "watchEventItem");
7317
7398
 
7318
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
7399
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
7319
7400
  var watchCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("watch"), {
7320
7401
  output: { entity: "watch_item" },
7321
7402
  effects: REMOTE_READ,
@@ -7470,7 +7551,7 @@ var describe = /* @__PURE__ */ __name((event, render) => {
7470
7551
  }
7471
7552
  }, "describe");
7472
7553
 
7473
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
7554
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
7474
7555
  var serveCommand = /* @__PURE__ */ __name((messenger) => {
7475
7556
  const command = annotate(new Command("serve"), {
7476
7557
  output: { entity: "serve_summary" },
@@ -7513,7 +7594,7 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
7513
7594
  const counts = {};
7514
7595
  const rules = replying(context, messenger, Date.parse(startedAt));
7515
7596
  const tasks = tasking(context, warn);
7516
- const { handled } = environmentOf(this);
7597
+ const { handled, startSyncDelayMs } = environmentOf(this);
7517
7598
  const count3 = /* @__PURE__ */ __name((event) => {
7518
7599
  counts[event.event] = (counts[event.event] ?? 0) + 1;
7519
7600
  if (event.event === "message") {
@@ -7537,6 +7618,50 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
7537
7618
  }).chats.fetchMembers(chatId, {}), "fetch"),
7538
7619
  warn
7539
7620
  });
7621
+ const fetching = messenger.fetching ?? FETCHING;
7622
+ const catchingUp = startSync({
7623
+ chats: /* @__PURE__ */ __name(async (stop) => {
7624
+ const list = capability(connection, "chats", "list its chats");
7625
+ const all = [];
7626
+ for (let offset = 0; ; ) {
7627
+ const page = await patiently(() => list({ offset, limit: 100 }), context.renderer.note, stop);
7628
+ for (const chat of page.items)
7629
+ all.push(chat);
7630
+ offset += page.items.length;
7631
+ if (!page.hasMore || page.items.length === 0)
7632
+ return all;
7633
+ }
7634
+ }, "chats"),
7635
+ newestHeld: /* @__PURE__ */ __name((chatId) => context.withStore(async (store, account) => {
7636
+ const [newest] = await store.messages.messagesWindow(account, chatId, {
7637
+ at: startedAt,
7638
+ before: 1,
7639
+ after: 0
7640
+ });
7641
+ return newest ? Date.parse(newest.timestamp) : void 0;
7642
+ }, { name: "serve catch-up" }), "newestHeld"),
7643
+ fetch: /* @__PURE__ */ __name((chatId, sinceMs, stop) => context.withStore((store, account) => servicesFor({
7644
+ ...onlineDeps(messenger, connection, context.guard, {
7645
+ profile: context.profile,
7646
+ env: context.env
7647
+ }),
7648
+ store: /* @__PURE__ */ __name(async () => store, "store"),
7649
+ account: /* @__PURE__ */ __name(async () => account, "account")
7650
+ }).archive.fetch(chatId, {
7651
+ limit: START_SYNC_PER_CHAT,
7652
+ pageSize: fetching.page,
7653
+ pauseMs: parseDuration(fetching.pause, "pause"),
7654
+ sinceMs,
7655
+ catchUp: false,
7656
+ note: context.renderer.note,
7657
+ stop,
7658
+ onPage: /* @__PURE__ */ __name(() => {
7659
+ }, "onPage")
7660
+ }), { name: "serve catch-up" }), "fetch"),
7661
+ note,
7662
+ warn,
7663
+ ...startSyncDelayMs === void 0 ? {} : { delayMs: startSyncDelayMs }
7664
+ });
7540
7665
  const stems = stemFills({
7541
7666
  withStore: /* @__PURE__ */ __name((work) => context.withStore((store) => work(store), { name: "serve stems" }), "withStore"),
7542
7667
  warn
@@ -7551,12 +7676,15 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
7551
7676
  rules.connected(open);
7552
7677
  members.start();
7553
7678
  stems.start();
7679
+ if (messenger.history !== "store" && typeof open.chats === "function")
7680
+ catchingUp.start();
7554
7681
  }, "connected")
7555
7682
  });
7556
7683
  } finally {
7557
7684
  await relaying;
7558
7685
  await relay?.close();
7559
7686
  rules.stop();
7687
+ await catchingUp.stop();
7560
7688
  await members.stop();
7561
7689
  await stems.stop();
7562
7690
  await rules.settled();
@@ -7571,6 +7699,7 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
7571
7699
  ...rules.summary(),
7572
7700
  ...members.summary().fetched + members.summary().failed > 0 ? { members: members.summary() } : {},
7573
7701
  ...stems.summary().stemmed > 0 ? { stems: stems.summary() } : {},
7702
+ ...catchingUp.summary() ? { caught_up: catchingUp.summary() } : {},
7574
7703
  ...tasks.summary()
7575
7704
  }));
7576
7705
  });
@@ -7686,7 +7815,7 @@ var tasking = /* @__PURE__ */ __name((context, warn) => {
7686
7815
  };
7687
7816
  }, "tasking");
7688
7817
 
7689
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
7818
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
7690
7819
  import { existsSync as existsSync6 } from "node:fs";
7691
7820
  var PATH = "store tables list";
7692
7821
  var STORE_TABLES_QUERY = {
@@ -7729,7 +7858,7 @@ var storeTablesCommand = /* @__PURE__ */ __name((messenger) => {
7729
7858
  return tables;
7730
7859
  }, "storeTablesCommand");
7731
7860
 
7732
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
7861
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
7733
7862
  var SEARCH_INDEXES = ["messages_fts", "chats_fts", "identities_fts"];
7734
7863
  var WORD_INDEX = "message_words";
7735
7864
  var schemaOf = /* @__PURE__ */ __name((database) => {
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.531.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.71.0_commander@15._cfa5eacb532b7a1817693c3848e83d75/node_modules/@wirecat/cli-core/dist/mcp/stdio-wire.js
7
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/mcp/stdio-wire.js
8
8
  import { PassThrough, Writable } from "node:stream";
9
9
  var lineReader = /* @__PURE__ */ __name((onMessage) => {
10
10
  let rest = "";