@wirecat/zoom-cli 0.64.0 → 0.66.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 (157) hide show
  1. package/dist/answer-entities.d.ts +13 -0
  2. package/dist/answer-entities.d.ts.map +1 -1
  3. package/dist/answer-entities.js +5 -0
  4. package/dist/answer-entities.js.map +1 -1
  5. package/dist/answers.d.ts +8 -0
  6. package/dist/answers.d.ts.map +1 -1
  7. package/dist/archive-import.d.ts +1 -1
  8. package/dist/archive-import.d.ts.map +1 -1
  9. package/dist/archive-import.js +2 -1
  10. package/dist/archive-import.js.map +1 -1
  11. package/dist/bin/zm.js +6 -2
  12. package/dist/bin/zm.js.map +1 -1
  13. package/dist/bundle/{all-profiles-W2OVBZ7S.js → all-profiles-D5CFH2OK.js} +11 -8
  14. package/dist/bundle/answer-policy-YAYMKRRD.js +101 -0
  15. package/dist/bundle/{anthropic-P4BKQNBO.js → anthropic-K2E2JS4S.js} +7 -4
  16. package/dist/bundle/{app-server-AYUW45ND.js → app-server-TVXDG6HZ.js} +68 -61
  17. package/dist/bundle/{bun-MNGPTYDQ.js → bun-O4WHGL2F.js} +2 -2
  18. package/dist/bundle/{bun-sqlite-PTPUSXAO.js → bun-sqlite-HGBEHQI3.js} +6 -3
  19. package/dist/bundle/{chunk-TYKZCJD7.js → chunk-2T5BOLBS.js} +35 -35
  20. package/dist/bundle/{chunk-H3DMYF3W.js → chunk-2VPHQFO5.js} +8 -8
  21. package/dist/bundle/{chunk-JMSKDW5G.js → chunk-2YLNUZ3T.js} +5 -3
  22. package/dist/bundle/{chunk-AAC6VNSL.js → chunk-3B7L2UX4.js} +3 -3
  23. package/dist/bundle/{chunk-6NBQJJT6.js → chunk-3WTKZ2ZS.js} +13 -11
  24. package/dist/bundle/{chunk-H65B6A7Y.js → chunk-3Y2F65AY.js} +8 -8
  25. package/dist/bundle/{chunk-A2FOW3ZC.js → chunk-5A26IBAR.js} +162 -107
  26. package/dist/bundle/{chunk-BO5YVG3X.js → chunk-5GD2XZ6X.js} +132 -40
  27. package/dist/bundle/{chunk-7D56BQZL.js → chunk-5HPALDUO.js} +2 -2
  28. package/dist/bundle/{chunk-5FN4Q5H5.js → chunk-62GOOZO3.js} +8 -13
  29. package/dist/bundle/{chunk-J25UNZIL.js → chunk-67RNZGAG.js} +12 -10
  30. package/dist/bundle/{chunk-3AAO5N4L.js → chunk-6GSJLNP4.js} +2 -2
  31. package/dist/bundle/{chunk-UNO4G5NX.js → chunk-6TIKPRVQ.js} +11 -7
  32. package/dist/bundle/{chunk-HQHUPTZR.js → chunk-756RS4PH.js} +1393 -712
  33. package/dist/bundle/{chunk-R4NTPYXZ.js → chunk-7JMBEPW2.js} +2 -2
  34. package/dist/bundle/{chunk-HIGFBTEI.js → chunk-7KCTPGOF.js} +2 -2
  35. package/dist/bundle/{chunk-TJODNJKE.js → chunk-7PF56S6U.js} +33 -22
  36. package/dist/bundle/{chunk-LEQCRVPD.js → chunk-7SQJCKR6.js} +1 -1
  37. package/dist/bundle/{chunk-BWPKSUXW.js → chunk-A2SCXNA7.js} +4518 -402
  38. package/dist/bundle/{chunk-QK54GOGE.js → chunk-AU4JHT3R.js} +7 -9
  39. package/dist/bundle/{chunk-63MRRNDL.js → chunk-AZ7ICKIA.js} +8 -8
  40. package/dist/bundle/chunk-BLT3LR3U.js +34 -0
  41. package/dist/bundle/{chunk-UABUBDYB.js → chunk-BXSAROQP.js} +2 -2
  42. package/dist/bundle/{chunk-Q3EDUZ5R.js → chunk-CAW6IMFZ.js} +25 -18
  43. package/dist/bundle/{chunk-UCPL55YP.js → chunk-CR4CXOLX.js} +17 -17
  44. package/dist/bundle/{chunk-SMT6SFBK.js → chunk-CZ4KLUJG.js} +2 -2
  45. package/dist/bundle/{chunk-COTC7HF3.js → chunk-D72URWJE.js} +1 -39
  46. package/dist/bundle/{chunk-X6M5DK66.js → chunk-EXXM4RNI.js} +14 -12
  47. package/dist/bundle/{chunk-CZKV4USJ.js → chunk-FWFFQV4D.js} +59 -4
  48. package/dist/bundle/{chunk-JJZAGKUK.js → chunk-GHAPWKG2.js} +5 -3
  49. package/dist/bundle/{chunk-JRPYHDCO.js → chunk-GI6QVSCW.js} +4 -4
  50. package/dist/bundle/{chunk-Y7TWNMTW.js → chunk-GKXFL35E.js} +198 -65
  51. package/dist/bundle/{chunk-K6OSD6DG.js → chunk-GNGBG5BT.js} +81 -35
  52. package/dist/bundle/{chunk-RJLNVHIU.js → chunk-H5ZVZAOD.js} +3 -3
  53. package/dist/bundle/{chunk-XZSQLVED.js → chunk-HKQWV3KT.js} +5 -3
  54. package/dist/bundle/chunk-IDWHJ35K.js +166 -0
  55. package/dist/bundle/{chunk-JM43EKTY.js → chunk-IKQ73INC.js} +1928 -679
  56. package/dist/bundle/chunk-ILHTNOIV.js +23 -0
  57. package/dist/bundle/{chunk-OPP5CWAX.js → chunk-J4EZL6HY.js} +61 -56
  58. package/dist/bundle/{chunk-54UEJGYB.js → chunk-JX3V35A5.js} +3 -3
  59. package/dist/bundle/{chunk-7VJIKJNW.js → chunk-K5CIN4JP.js} +8 -8
  60. package/dist/bundle/{chunk-KJCCT3QY.js → chunk-KDKFGQWG.js} +17 -14
  61. package/dist/bundle/{chunk-RK3JBC4U.js → chunk-L7IK4FOA.js} +2 -2
  62. package/dist/bundle/{chunk-7EOW47PV.js → chunk-LN2S3RA3.js} +4 -4
  63. package/dist/bundle/{chunk-I5QX2HAT.js → chunk-N5JRRBEG.js} +214 -107
  64. package/dist/bundle/chunk-N67BLTBV.js +2443 -0
  65. package/dist/bundle/{chunk-23LOMA2I.js → chunk-N6JMJN5A.js} +48 -26
  66. package/dist/bundle/{chunk-CZFV6XTW.js → chunk-NMQUCHTX.js} +3 -3
  67. package/dist/bundle/{chunk-TJH5IQVZ.js → chunk-NO24PJNW.js} +1 -1
  68. package/dist/bundle/{chunk-UFI5SX3F.js → chunk-O5FKJV3T.js} +14 -12
  69. package/dist/bundle/{chunk-IIP4J3PD.js → chunk-P2G4KGTR.js} +94 -12
  70. package/dist/bundle/{chunk-OWXMQVVN.js → chunk-P2SYZNM4.js} +1 -1
  71. package/dist/bundle/{chunk-EQYPTGCT.js → chunk-P3XVLHIQ.js} +6 -4
  72. package/dist/bundle/chunk-PQLBPYJR.js +46 -0
  73. package/dist/bundle/{chunk-5BCNJB2A.js → chunk-Q47C3QZW.js} +675 -507
  74. package/dist/bundle/{chunk-IIGXCYEL.js → chunk-QAPU2JNO.js} +13 -13
  75. package/dist/bundle/{chunk-WFIJOFS5.js → chunk-QJHRYUMJ.js} +1 -1
  76. package/dist/bundle/{chunk-YNYMWXXH.js → chunk-QV5ZGRK3.js} +40 -11
  77. package/dist/bundle/{chunk-3IMEAZIM.js → chunk-RMKHYUHK.js} +9 -20
  78. package/dist/bundle/{chunk-AF4HONAZ.js → chunk-RO44LANT.js} +6449 -4436
  79. package/dist/bundle/{chunk-3DGQJASQ.js → chunk-S4GDDO5S.js} +1 -1
  80. package/dist/bundle/chunk-S6S3KVJI.js +45 -0
  81. package/dist/bundle/{chunk-SJIBJQJN.js → chunk-SU4WPBQE.js} +44 -14
  82. package/dist/bundle/{chunk-7NDSBTKR.js → chunk-TFDVFD4N.js} +91 -2546
  83. package/dist/bundle/{chunk-HQHYPKSU.js → chunk-TMVKZMDO.js} +54 -37
  84. package/dist/bundle/{chunk-PBJY5VR6.js → chunk-TN7K66PU.js} +1 -1
  85. package/dist/bundle/{chunk-ZW4N73FO.js → chunk-TUEEXECZ.js} +5 -5
  86. package/dist/bundle/{chunk-H5LLZ5XA.js → chunk-U3ZUT557.js} +1 -1
  87. package/dist/bundle/{chunk-4XVRA6P5.js → chunk-U4RVOSX3.js} +1 -1
  88. package/dist/bundle/{chunk-5YLR24D5.js → chunk-UOIXBEFR.js} +13 -6
  89. package/dist/bundle/chunk-UYV2JGLQ.js +34 -0
  90. package/dist/bundle/{chunk-7SWNZ44U.js → chunk-XFUID5NY.js} +4 -4
  91. package/dist/bundle/{chunk-BMYZWBAX.js → chunk-XWDSEJWP.js} +6 -6
  92. package/dist/bundle/{chunk-JZKNHA44.js → chunk-Y3EIK4XW.js} +1 -1
  93. package/dist/bundle/{chunk-24WCZURP.js → chunk-YLEQN6PB.js} +5 -3
  94. package/dist/bundle/{chunk-2UONVSJQ.js → chunk-Z6U3MEGJ.js} +2 -2
  95. package/dist/bundle/{chunk-L4JGVSBN.js → chunk-ZKTXUDSR.js} +33 -28
  96. package/dist/bundle/{chunk-FSYO3PUW.js → chunk-ZNFPDTQM.js} +2 -2
  97. package/dist/bundle/{chunk-C3RRIJ5C.js → chunk-ZTL7ANSG.js} +9 -42
  98. package/dist/bundle/{cli-Y2ZO3D5U.js → cli-HWQIL2AC.js} +124 -73
  99. package/dist/bundle/command-contract-CQFJXWX6.js +40 -0
  100. package/dist/bundle/config-R2Y6ZVQS.js +83 -0
  101. package/dist/bundle/{decode-GO6GAYH2.js → decode-XPAPPUGE.js} +6 -3
  102. package/dist/bundle/dispatch-AKVJGP2S.js +412 -0
  103. package/dist/bundle/{dist-MIJKAGXW.js → dist-LDIUQBM7.js} +23 -16
  104. package/dist/bundle/{echarts-NWK7LALR.js → echarts-FMACRZQC.js} +2 -2
  105. package/dist/bundle/{embed-2DOSN4DV.js → embed-LK45GRQ7.js} +7 -4
  106. package/dist/bundle/{embedder-3Q3C2WKC.js → embedder-QPBC5XBY.js} +12 -9
  107. package/dist/bundle/failure-7OULAOWQ.js +25 -0
  108. package/dist/bundle/first-run-J5FG773Q.js +28 -0
  109. package/dist/bundle/first-screen-MULOBUHN.js +38 -0
  110. package/dist/bundle/{folders-RSWEBHDZ.js → folders-RHPUVMDI.js} +5 -2
  111. package/dist/bundle/{instructions-M3FZPQVI.js → instructions-E5FXYCWF.js} +1 -1
  112. package/dist/bundle/{main-R77BPRRS.js → main-FJHE5YHU.js} +28 -22
  113. package/dist/bundle/{mcp-YJEQYYTR.js → mcp-MNI62HHE.js} +5 -3
  114. package/dist/bundle/{meetings-IV4Y4WRH.js → meetings-MYIDGYGW.js} +19 -6
  115. package/dist/bundle/{node-I3GEHYGL.js → node-4SNKUPXT.js} +2 -2
  116. package/dist/bundle/{node-sqlite-W6MR2TVQ.js → node-sqlite-SYZUTVPC.js} +12 -3
  117. package/dist/bundle/{oauth-M6YL4QXP.js → oauth-QPS5VTN6.js} +8 -5
  118. package/dist/bundle/{open-2VITLJAN.js → open-OVCASRSJ.js} +6 -2
  119. package/dist/bundle/openai-VEVT7D7L.js +25 -0
  120. package/dist/bundle/{output-file-XJJ3XMLQ.js → output-file-K5JEL33Z.js} +7 -4
  121. package/dist/bundle/{process-UBA4L4B2.js → process-HQZOTT6U.js} +1 -1
  122. package/dist/bundle/{program-5R5MRXUM.js → program-A546WC4F.js} +120 -112
  123. package/dist/bundle/{prompt-AVIXIM7Z.js → prompt-CYBKP7S5.js} +6 -3
  124. package/dist/bundle/{recognize-DJKTJOYU.js → recognize-3H3YDCFI.js} +5 -2
  125. package/dist/bundle/{remote-S3DTNYRP.js → remote-VAYVTJBS.js} +8 -5
  126. package/dist/bundle/{rerank-FMCDP6VF.js → rerank-XA4GA5PS.js} +8 -5
  127. package/dist/bundle/{run-log-T4MV2VEH.js → run-log-XAFHMI3F.js} +59 -54
  128. package/dist/bundle/{serve-5SGFJFMC.js → serve-KGHEDUHB.js} +18 -14
  129. package/dist/bundle/server-IDNSJXF3.js +71 -0
  130. package/dist/bundle/{server-PCMCY7WK.js → server-ZYTSMDTP.js} +47 -42
  131. package/dist/bundle/{services-SKRQ2POT.js → services-ZHMZC2OQ.js} +106 -28
  132. package/dist/bundle/{speech-FSDICIKO.js → speech-7CJEFKM3.js} +14 -11
  133. package/dist/bundle/{state-KPUSPWO6.js → state-U6KSYVOH.js} +7 -4
  134. package/dist/bundle/{store-W7LFPKG2.js → store-DJE3LAEG.js} +17 -13
  135. package/dist/bundle/{store-7MP2ZGQ7.js → store-WS4CQGYU.js} +40 -18
  136. package/dist/bundle/store-connection-T5WGOOPH.js +81 -0
  137. package/dist/bundle/store-maintenance-command-5CBQCEQQ.js +61 -0
  138. package/dist/bundle/{streaming-Q44ESD3E.js → streaming-QMHH7L6N.js} +7 -4
  139. package/dist/bundle/{tokens-TAFCHANI.js → tokens-PWQ56OXO.js} +7 -4
  140. package/dist/bundle/zm.js +150 -1
  141. package/dist/local-transcription.d.ts.map +1 -1
  142. package/dist/local-transcription.js +1 -0
  143. package/dist/local-transcription.js.map +1 -1
  144. package/dist/version.d.ts +1 -1
  145. package/dist/version.js +1 -1
  146. package/package.json +5 -4
  147. package/dist/bundle/answer-policy-HOA43GNA.js +0 -96
  148. package/dist/bundle/chunk-JRPAZ2WD.js +0 -3635
  149. package/dist/bundle/command-contract-DGTZIH2F.js +0 -38
  150. package/dist/bundle/config-N2UHDKGG.js +0 -78
  151. package/dist/bundle/first-run-S75VKIT3.js +0 -23
  152. package/dist/bundle/first-screen-DQNRT6GH.js +0 -36
  153. package/dist/bundle/openai-OG6B3JCU.js +0 -22
  154. package/dist/bundle/server-EYGZLKKQ.js +0 -66
  155. package/dist/bundle/store-connection-3HNZFJC4.js +0 -76
  156. package/dist/bundle/store-maintenance-command-6WBLTUZP.js +0 -55
  157. /package/dist/bundle/{chunk-WJWLHLQ7.js → chunk-NUN6OGOV.js} +0 -0
@@ -1,9 +1,12 @@
1
1
  import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ renderMessages
5
+ } from "./chunk-ZNFPDTQM.js";
3
6
  import {
4
7
  answerOf,
5
8
  messengerContext
6
- } from "./chunk-BO5YVG3X.js";
9
+ } from "./chunk-5GD2XZ6X.js";
7
10
  import {
8
11
  chatEventAnswer,
9
12
  memberAnswer,
@@ -12,24 +15,27 @@ import {
12
15
  serveRelay,
13
16
  typedQuery,
14
17
  withQuery
15
- } from "./chunk-23LOMA2I.js";
18
+ } from "./chunk-N6JMJN5A.js";
16
19
  import {
17
20
  holdLock,
18
21
  lockPath,
19
22
  releaseLock,
20
23
  servingProfiles,
21
24
  takeLock
22
- } from "./chunk-RJLNVHIU.js";
25
+ } from "./chunk-H5ZVZAOD.js";
23
26
  import {
27
+ FETCHING,
24
28
  RULES_VERSION,
25
29
  applyTaskRulesOnArrival,
30
+ capability,
26
31
  newSendId,
27
32
  onlineDeps,
28
33
  openRequestTask,
34
+ patiently,
29
35
  senderIsMe,
30
36
  servicesFor,
31
37
  syncsOneChat
32
- } from "./chunk-AF4HONAZ.js";
38
+ } from "./chunk-RO44LANT.js";
33
39
  import {
34
40
  Command,
35
41
  LOCAL_READ,
@@ -53,38 +59,24 @@ import {
53
59
  snakeKeys,
54
60
  storeTable,
55
61
  withoutProviderRefs
56
- } from "./chunk-BWPKSUXW.js";
62
+ } from "./chunk-A2SCXNA7.js";
57
63
  import {
58
64
  envName
59
- } from "./chunk-2UONVSJQ.js";
65
+ } from "./chunk-Z6U3MEGJ.js";
60
66
  import {
61
67
  holdersOf
62
- } from "./chunk-JZKNHA44.js";
68
+ } from "./chunk-Y3EIK4XW.js";
63
69
  import {
64
70
  codeOf,
65
- currentRun
66
- } from "./chunk-A2FOW3ZC.js";
71
+ currentRun,
72
+ parseDuration
73
+ } from "./chunk-5A26IBAR.js";
67
74
  import {
68
75
  failureKey
69
- } from "./chunk-3AAO5N4L.js";
70
- import {
71
- renderMessages
72
- } from "./chunk-FSYO3PUW.js";
76
+ } from "./chunk-6GSJLNP4.js";
73
77
  import {
74
78
  levelFor
75
- } from "./chunk-7D56BQZL.js";
76
- import {
77
- readSecret
78
- } from "./chunk-54UEJGYB.js";
79
- import {
80
- checkedOptions,
81
- range
82
- } from "./chunk-JJZAGKUK.js";
83
- import {
84
- messagesFor,
85
- systemFor,
86
- validateImages
87
- } from "./chunk-SMT6SFBK.js";
79
+ } from "./chunk-5HPALDUO.js";
88
80
  import {
89
81
  MIGRATIONS,
90
82
  drainNoteIndex,
@@ -111,23 +103,39 @@ import {
111
103
  storeClients,
112
104
  storeContents,
113
105
  vectorIndexCounts
114
- } from "./chunk-JM43EKTY.js";
106
+ } from "./chunk-IKQ73INC.js";
115
107
  import {
116
108
  formatLocator,
117
109
  parseLocator
118
- } from "./chunk-I5QX2HAT.js";
110
+ } from "./chunk-N5JRRBEG.js";
111
+ import {
112
+ readSecret
113
+ } from "./chunk-JX3V35A5.js";
114
+ import {
115
+ checkedOptions,
116
+ range
117
+ } from "./chunk-GHAPWKG2.js";
118
+ import {
119
+ messagesFor,
120
+ systemFor,
121
+ validateImages
122
+ } from "./chunk-CZ4KLUJG.js";
119
123
  import {
120
124
  storePath
121
- } from "./chunk-RK3JBC4U.js";
125
+ } from "./chunk-L7IK4FOA.js";
122
126
  import {
123
127
  openCache
124
- } from "./chunk-5FN4Q5H5.js";
128
+ } from "./chunk-62GOOZO3.js";
125
129
  import {
126
130
  queryFieldsOf
127
- } from "./chunk-SJIBJQJN.js";
131
+ } from "./chunk-SU4WPBQE.js";
128
132
  import {
129
- CliError,
130
133
  Credentials,
134
+ pathsAreOverridden,
135
+ resolvePaths,
136
+ writeSecurely
137
+ } from "./chunk-TFDVFD4N.js";
138
+ import {
131
139
  array,
132
140
  boolean,
133
141
  check,
@@ -140,20 +148,20 @@ import {
140
148
  object,
141
149
  optional,
142
150
  parse,
143
- pathsAreOverridden,
144
151
  picklist,
145
152
  pipe,
146
153
  record,
147
154
  regex,
148
- resolvePaths,
149
155
  safeParse,
150
156
  strictObject,
151
157
  string,
152
158
  transform,
153
159
  trim,
154
- union,
155
- writeSecurely
156
- } from "./chunk-7NDSBTKR.js";
160
+ union
161
+ } from "./chunk-N67BLTBV.js";
162
+ import {
163
+ CliError
164
+ } from "./chunk-S6S3KVJI.js";
157
165
  import {
158
166
  __commonJS,
159
167
  __name,
@@ -5493,11 +5501,11 @@ var require_liquid_node = __commonJS({
5493
5501
  }
5494
5502
  });
5495
5503
 
5496
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
5504
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
5497
5505
  import { chmodSync, constants, copyFileSync, existsSync as existsSync7, mkdirSync, realpathSync, renameSync as renameSync2, rmSync as rmSync2, statfsSync, statSync as statSync3, writeFileSync } from "node:fs";
5498
5506
  import { dirname, resolve } from "node:path";
5499
5507
 
5500
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/sealed.js
5508
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/sealed.js
5501
5509
  import { createCipheriv, createDecipheriv, createHash, randomBytes, scrypt, timingSafeEqual } from "node:crypto";
5502
5510
  import { closeSync, createReadStream, createWriteStream, existsSync, openSync, readSync, renameSync, rmSync, statSync } from "node:fs";
5503
5511
  import { Transform } from "node:stream";
@@ -5604,7 +5612,7 @@ var unsealFile = /* @__PURE__ */ __name(async (from, to, password) => {
5604
5612
  renameSync(pending, to);
5605
5613
  }, "unsealFile");
5606
5614
 
5607
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/store/compatibility.js
5615
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/store/compatibility.js
5608
5616
  var SPEAKS = MIGRATIONS.at(-1)?.version ?? 0;
5609
5617
  var fileSchemaOf = /* @__PURE__ */ __name((database) => {
5610
5618
  const tracked = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'schema_migrations'").get();
@@ -5628,7 +5636,7 @@ var compatibilityOf = /* @__PURE__ */ __name((file2, migrations = MIGRATIONS) =>
5628
5636
  };
5629
5637
  }, "compatibilityOf");
5630
5638
 
5631
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/store/repair.js
5639
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/store/repair.js
5632
5640
  import { createHash as createHash2 } from "node:crypto";
5633
5641
  var COPY_MARK = "__repair_";
5634
5642
  var COPY_NAME = /__repair_[0-9a-f]{8}(_\d+)?$/;
@@ -5882,7 +5890,7 @@ var deleteCopy = /* @__PURE__ */ __name((database, name) => {
5882
5890
  return found;
5883
5891
  }, "deleteCopy");
5884
5892
 
5885
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/cli/store-info.js
5893
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/cli/store-info.js
5886
5894
  import { existsSync as existsSync2, statSync as statSync2 } from "node:fs";
5887
5895
  var pendingIfKnown = /* @__PURE__ */ __name((database) => database.prepare("SELECT 1 FROM pragma_table_info('messages') WHERE name = 'normalized_text'").get() ? pendingNormalization(database) : null, "pendingIfKnown");
5888
5896
  var bytesOf = /* @__PURE__ */ __name((path) => existsSync2(path) ? statSync2(path).size : 0, "bytesOf");
@@ -5930,7 +5938,7 @@ var storeInfoCommand = /* @__PURE__ */ __name(() => annotate(new Command("info")
5930
5938
  }), "storeInfoCommand");
5931
5939
  var sharedStoreCommand = /* @__PURE__ */ __name(() => annotate(new Command("store"), { effects: LOCAL_READ }).description("the shared local store every WireCat tool reads").addCommand(storeInfoCommand()), "sharedStoreCommand");
5932
5940
 
5933
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
5941
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
5934
5942
  var ENCRYPT_OPTION = [
5935
5943
  "--encrypt",
5936
5944
  "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"
@@ -5949,7 +5957,7 @@ var passwordOf = /* @__PURE__ */ __name(async (command, { twice }) => {
5949
5957
  return password;
5950
5958
  }, "passwordOf");
5951
5959
 
5952
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/replies/rules.js
5960
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/replies/rules.js
5953
5961
  import { existsSync as existsSync3, readFileSync } from "node:fs";
5954
5962
  import { join } from "node:path";
5955
5963
  var REPLY_ACTIONS = ["reply", "task"];
@@ -6120,7 +6128,7 @@ var problem = /* @__PURE__ */ __name((issue) => {
6120
6128
  }, "problem");
6121
6129
  var broken = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply rules ${path} cannot be read (${why}) \u2014 fix the file`), "broken");
6122
6130
 
6123
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/replies/state.js
6131
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/replies/state.js
6124
6132
  import { existsSync as existsSync4, readFileSync as readFileSync2 } from "node:fs";
6125
6133
  import { join as join2 } from "node:path";
6126
6134
  var ANSWERED_KEPT = 1e3;
@@ -6173,7 +6181,7 @@ var recordReply = /* @__PURE__ */ __name((state, rule2, message, now) => {
6173
6181
  }, "recordReply");
6174
6182
  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");
6175
6183
 
6176
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/replies/decide.js
6184
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/replies/decide.js
6177
6185
  var skip = /* @__PURE__ */ __name((why) => ({ skip: why }), "skip");
6178
6186
  var decide = /* @__PURE__ */ __name((rule2, incoming, state, now) => {
6179
6187
  const { message, chat, owner, sender } = incoming;
@@ -6279,7 +6287,7 @@ var filled = /* @__PURE__ */ __name((template2, senderName) => {
6279
6287
  return template2.replaceAll("{firstName}", name.split(/\s+/)[0] ?? name).replaceAll("{name}", name);
6280
6288
  }, "filled");
6281
6289
 
6282
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/replies/template.js
6290
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/replies/template.js
6283
6291
  var import_liquidjs = __toESM(require_liquid_node(), 1);
6284
6292
  var TEMPLATE_LIMITS = {
6285
6293
  parse: 32768,
@@ -6439,7 +6447,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
6439
6447
  }
6440
6448
  }, "renderReplyTemplate");
6441
6449
 
6442
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
6450
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
6443
6451
  var DRY_RUN_DAYS = 7;
6444
6452
  var PAGE = 500;
6445
6453
  var dryRun = /* @__PURE__ */ __name(async (store, account, rules, { since, until = Date.now(), only, audience, render }) => {
@@ -6553,7 +6561,7 @@ var storedSince = /* @__PURE__ */ __name(async (store, account, chat, since) =>
6553
6561
  }
6554
6562
  }, "storedSince");
6555
6563
 
6556
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
6564
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
6557
6565
  var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
6558
6566
  const host = new URL(baseUrl).host;
6559
6567
  return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
@@ -6584,7 +6592,7 @@ var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) =>
6584
6592
  };
6585
6593
  }, "embeddingKeys");
6586
6594
 
6587
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/models/openai.js
6595
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/models/openai.js
6588
6596
  var options = strictObject({
6589
6597
  temperature: range(0, 2),
6590
6598
  top_p: range(0, 1),
@@ -6633,7 +6641,7 @@ var openai = {
6633
6641
  }, "complete")
6634
6642
  };
6635
6643
 
6636
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/models/index.js
6644
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/models/index.js
6637
6645
  var modelGateway = /* @__PURE__ */ __name((deps) => ({
6638
6646
  complete: /* @__PURE__ */ __name(async (request) => {
6639
6647
  if (deps.signal?.aborted)
@@ -6648,7 +6656,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
6648
6656
  if (!adapter && target.provider === "openai")
6649
6657
  adapter = openai;
6650
6658
  if (!adapter && target.provider === "anthropic")
6651
- adapter = (await import("./anthropic-P4BKQNBO.js")).anthropic;
6659
+ adapter = (await import("./anthropic-K2E2JS4S.js")).anthropic;
6652
6660
  if (!adapter)
6653
6661
  throw new CliError("validation_error", `no model adapter for ${target.provider}`);
6654
6662
  if (request.images !== void 0 && adapter.images !== true)
@@ -6689,7 +6697,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
6689
6697
  }, "complete")
6690
6698
  }), "modelGateway");
6691
6699
 
6692
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/replies/consents.js
6700
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/replies/consents.js
6693
6701
  import { existsSync as existsSync5, readFileSync as readFileSync3 } from "node:fs";
6694
6702
  import { join as join3 } from "node:path";
6695
6703
  var shape = strictObject({
@@ -6714,7 +6722,7 @@ var mayModelReply = /* @__PURE__ */ __name((path, provider, chat) => {
6714
6722
  return consent.provider === provider && !consent.deniedChats.includes(chat);
6715
6723
  }, "mayModelReply");
6716
6724
 
6717
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/replies/rendering.js
6725
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/replies/rendering.js
6718
6726
  var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, options2 = {
6719
6727
  ai: true
6720
6728
  }) => async (rule2, message, chat, now) => {
@@ -6761,7 +6769,7 @@ var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, o
6761
6769
  return result2;
6762
6770
  }, "replyRenderer");
6763
6771
 
6764
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/replies/serve.js
6772
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/replies/serve.js
6765
6773
  var NOT_ALLOWED = "replies.send is not allow";
6766
6774
  var NO_RULES = "no rules";
6767
6775
  var ONLY_TASK = "opened a task, sent nothing";
@@ -6854,7 +6862,84 @@ var replyTo = /* @__PURE__ */ __name(async (deps, message) => {
6854
6862
  return { skip: why };
6855
6863
  }, "replyTo");
6856
6864
 
6857
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
6865
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-catch-up.js
6866
+ var START_SYNC_DELAY_MS = 3e4;
6867
+ var START_SYNC_BUDGET_MS = 5 * 6e4;
6868
+ var START_SYNC_WINDOW_MS = 7 * 864e5;
6869
+ var START_SYNC_PER_CHAT = 500;
6870
+ 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 }) => {
6871
+ const controller = new AbortController();
6872
+ let timer;
6873
+ let pass = Promise.resolve();
6874
+ let started = false;
6875
+ let done;
6876
+ const run = /* @__PURE__ */ __name(async () => {
6877
+ const stop = AbortSignal.any([controller.signal, AbortSignal.timeout(budgetMs)]);
6878
+ const floor = now() - windowMs;
6879
+ const moved = [];
6880
+ for (const chat of await chats(stop)) {
6881
+ const lastAt = Date.parse(chat.lastMessageAt ?? "");
6882
+ if (Number.isNaN(lastAt) || lastAt < floor)
6883
+ continue;
6884
+ moved.push({ chat, lastAt, held: await newestHeld(chat.id) });
6885
+ }
6886
+ const anywhere = moved.reduce((top, { held }) => held === void 0 ? top : Math.max(top, held), -Infinity);
6887
+ if (!Number.isFinite(anywhere))
6888
+ return;
6889
+ const behind = moved.filter(({ lastAt, held }) => lastAt > (held ?? anywhere)).sort((one, other) => other.lastAt - one.lastAt);
6890
+ if (behind.length === 0)
6891
+ return;
6892
+ const summary = { chats: 0, fetched: 0, failed: 0, stopped: false };
6893
+ done = summary;
6894
+ for (const { chat, held } of behind) {
6895
+ if (stop.aborted)
6896
+ break;
6897
+ try {
6898
+ summary.fetched += (await fetch2(chat.id, Math.max(held ?? anywhere, floor), stop)).fetched;
6899
+ summary.chats += 1;
6900
+ } catch (error) {
6901
+ if (stop.aborted)
6902
+ break;
6903
+ summary.failed += 1;
6904
+ const errorCode = failureKey(error);
6905
+ warn({
6906
+ code: "start_sync_chat_failed",
6907
+ chatId: chat.id,
6908
+ errorCode,
6909
+ text: `what ${chat.id} received while serve was down was not fetched: ${errorCode}`
6910
+ });
6911
+ }
6912
+ }
6913
+ summary.stopped = stop.aborted && summary.chats + summary.failed < behind.length;
6914
+ note({
6915
+ code: "start_sync",
6916
+ 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` : "")
6917
+ });
6918
+ }, "run");
6919
+ return {
6920
+ start: /* @__PURE__ */ __name(() => {
6921
+ if (started || controller.signal.aborted)
6922
+ return;
6923
+ started = true;
6924
+ timer = setTimeout(() => {
6925
+ pass = run().catch((error) => {
6926
+ if (controller.signal.aborted)
6927
+ return;
6928
+ const errorCode = failureKey(error);
6929
+ warn({ code: "start_sync_failed", errorCode, text: `the catch-up on start failed: ${errorCode}` });
6930
+ });
6931
+ }, delayMs);
6932
+ }, "start"),
6933
+ stop: /* @__PURE__ */ __name(async () => {
6934
+ controller.abort();
6935
+ clearTimeout(timer);
6936
+ await pass;
6937
+ }, "stop"),
6938
+ summary: /* @__PURE__ */ __name(() => done, "summary")
6939
+ };
6940
+ }, "startSync");
6941
+
6942
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
6858
6943
  var FIRST_FETCH_MS = 6e4;
6859
6944
  var DAY_MS = 864e5;
6860
6945
  var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, firstMs = FIRST_FETCH_MS, everyMs = DAY_MS }) => {
@@ -6908,7 +6993,7 @@ var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, fi
6908
6993
  };
6909
6994
  }, "memberFetches");
6910
6995
 
6911
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
6996
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
6912
6997
  var record2 = /* @__PURE__ */ __name((context, app, severity, attributes) => recordLogFor(context.streams.diagnostic, app, { command: currentRun().command || "serve" })[severity](attributes), "record");
6913
6998
  var noticeFor = /* @__PURE__ */ __name((context, app, severity = "warn") => ({ text, ...attributes }) => {
6914
6999
  if (context.format === "pretty") {
@@ -6941,7 +7026,7 @@ var recordDiagnostics = /* @__PURE__ */ __name((context, app) => {
6941
7026
  return context;
6942
7027
  }, "recordDiagnostics");
6943
7028
 
6944
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
7029
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
6945
7030
  var STEMS_EVERY_MS = 3e4;
6946
7031
  var STEMS_SLICE_MS = 2e3;
6947
7032
  var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY_MS, sliceMs = STEMS_SLICE_MS }) => {
@@ -6981,7 +7066,7 @@ var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY
6981
7066
  };
6982
7067
  }, "stemFills");
6983
7068
 
6984
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
7069
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
6985
7070
  var defined = /* @__PURE__ */ __name((value) => Object.fromEntries(Object.entries(value).filter(([, one]) => one !== void 0)), "defined");
6986
7071
  var attachmentItem = /* @__PURE__ */ __name((attachment) => defined({
6987
7072
  kind: attachment.kind,
@@ -7076,7 +7161,7 @@ var viewOf = /* @__PURE__ */ __name((context, messenger) => ({
7076
7161
  locale: messenger.app.locale
7077
7162
  }), "viewOf");
7078
7163
 
7079
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
7164
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
7080
7165
  var observed = /* @__PURE__ */ __name((value) => ({
7081
7166
  value: value.value,
7082
7167
  observed_at: value.observedAt,
@@ -7143,7 +7228,7 @@ var watchEventItem = /* @__PURE__ */ __name((value, account) => {
7143
7228
  }
7144
7229
  }, "watchEventItem");
7145
7230
 
7146
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
7231
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
7147
7232
  var watchCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("watch"), {
7148
7233
  output: { entity: "watch_item" },
7149
7234
  effects: REMOTE_READ,
@@ -7298,7 +7383,7 @@ var describe = /* @__PURE__ */ __name((event, render) => {
7298
7383
  }
7299
7384
  }, "describe");
7300
7385
 
7301
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
7386
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
7302
7387
  var serveCommand = /* @__PURE__ */ __name((messenger) => {
7303
7388
  const command = annotate(new Command("serve"), {
7304
7389
  output: { entity: "serve_summary" },
@@ -7341,7 +7426,7 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
7341
7426
  const counts = {};
7342
7427
  const rules = replying(context, messenger, Date.parse(startedAt));
7343
7428
  const tasks = tasking(context, warn);
7344
- const { handled } = environmentOf(this);
7429
+ const { handled, startSyncDelayMs } = environmentOf(this);
7345
7430
  const count3 = /* @__PURE__ */ __name((event) => {
7346
7431
  counts[event.event] = (counts[event.event] ?? 0) + 1;
7347
7432
  if (event.event === "message") {
@@ -7365,6 +7450,50 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
7365
7450
  }).chats.fetchMembers(chatId, {}), "fetch"),
7366
7451
  warn
7367
7452
  });
7453
+ const fetching = messenger.fetching ?? FETCHING;
7454
+ const catchingUp = startSync({
7455
+ chats: /* @__PURE__ */ __name(async (stop) => {
7456
+ const list = capability(connection, "chats", "list its chats");
7457
+ const all = [];
7458
+ for (let offset = 0; ; ) {
7459
+ const page = await patiently(() => list({ offset, limit: 100 }), context.renderer.note, stop);
7460
+ for (const chat of page.items)
7461
+ all.push(chat);
7462
+ offset += page.items.length;
7463
+ if (!page.hasMore || page.items.length === 0)
7464
+ return all;
7465
+ }
7466
+ }, "chats"),
7467
+ newestHeld: /* @__PURE__ */ __name((chatId) => context.withStore(async (store, account) => {
7468
+ const [newest] = await store.messages.messagesWindow(account, chatId, {
7469
+ at: startedAt,
7470
+ before: 1,
7471
+ after: 0
7472
+ });
7473
+ return newest ? Date.parse(newest.timestamp) : void 0;
7474
+ }, { name: "serve catch-up" }), "newestHeld"),
7475
+ fetch: /* @__PURE__ */ __name((chatId, sinceMs, stop) => context.withStore((store, account) => servicesFor({
7476
+ ...onlineDeps(messenger, connection, context.guard, {
7477
+ profile: context.profile,
7478
+ env: context.env
7479
+ }),
7480
+ store: /* @__PURE__ */ __name(async () => store, "store"),
7481
+ account: /* @__PURE__ */ __name(async () => account, "account")
7482
+ }).archive.fetch(chatId, {
7483
+ limit: START_SYNC_PER_CHAT,
7484
+ pageSize: fetching.page,
7485
+ pauseMs: parseDuration(fetching.pause, "pause"),
7486
+ sinceMs,
7487
+ catchUp: false,
7488
+ note: context.renderer.note,
7489
+ stop,
7490
+ onPage: /* @__PURE__ */ __name(() => {
7491
+ }, "onPage")
7492
+ }), { name: "serve catch-up" }), "fetch"),
7493
+ note,
7494
+ warn,
7495
+ ...startSyncDelayMs === void 0 ? {} : { delayMs: startSyncDelayMs }
7496
+ });
7368
7497
  const stems = stemFills({
7369
7498
  withStore: /* @__PURE__ */ __name((work) => context.withStore((store) => work(store), { name: "serve stems" }), "withStore"),
7370
7499
  warn
@@ -7379,12 +7508,15 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
7379
7508
  rules.connected(open);
7380
7509
  members.start();
7381
7510
  stems.start();
7511
+ if (messenger.history !== "store" && typeof open.chats === "function")
7512
+ catchingUp.start();
7382
7513
  }, "connected")
7383
7514
  });
7384
7515
  } finally {
7385
7516
  await relaying;
7386
7517
  await relay?.close();
7387
7518
  rules.stop();
7519
+ await catchingUp.stop();
7388
7520
  await members.stop();
7389
7521
  await stems.stop();
7390
7522
  await rules.settled();
@@ -7399,6 +7531,7 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
7399
7531
  ...rules.summary(),
7400
7532
  ...members.summary().fetched + members.summary().failed > 0 ? { members: members.summary() } : {},
7401
7533
  ...stems.summary().stemmed > 0 ? { stems: stems.summary() } : {},
7534
+ ...catchingUp.summary() ? { caught_up: catchingUp.summary() } : {},
7402
7535
  ...tasks.summary()
7403
7536
  }));
7404
7537
  });
@@ -7514,7 +7647,7 @@ var tasking = /* @__PURE__ */ __name((context, warn) => {
7514
7647
  };
7515
7648
  }, "tasking");
7516
7649
 
7517
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
7650
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
7518
7651
  import { existsSync as existsSync6 } from "node:fs";
7519
7652
  var PATH = "store tables list";
7520
7653
  var STORE_TABLES_QUERY = {
@@ -7557,7 +7690,7 @@ var storeTablesCommand = /* @__PURE__ */ __name((messenger) => {
7557
7690
  return tables;
7558
7691
  }, "storeTablesCommand");
7559
7692
 
7560
- // node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
7693
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
7561
7694
  var SEARCH_INDEXES = ["messages_fts", "chats_fts", "identities_fts"];
7562
7695
  var WORD_INDEX = "message_words";
7563
7696
  var schemaOf = /* @__PURE__ */ __name((database) => {