@wirecat/drive-cli 0.58.0 → 0.60.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 (191) hide show
  1. package/dist/bin/drive.js +6 -2
  2. package/dist/bin/drive.js.map +1 -1
  3. package/dist/bundle/{all-profiles-ANDWOJDL.js → all-profiles-537I27Z4.js} +14 -13
  4. package/dist/bundle/{anthropic-EZPZUWGS.js → anthropic-X4NWVHDF.js} +9 -9
  5. package/dist/bundle/{app-server-67WL423B.js → app-server-KSHJKKS7.js} +53 -51
  6. package/dist/bundle/{bun-NIIYUR5F.js → bun-WTBGGCUC.js} +2 -2
  7. package/dist/bundle/{bun-sqlite-A5ZKTIYC.js → bun-sqlite-T7Y3JFFD.js} +8 -8
  8. package/dist/bundle/{chunk-5NPFHWLP.js → chunk-22ATLSNK.js} +5 -5
  9. package/dist/bundle/{chunk-ALTG7BZQ.js → chunk-246P2DCT.js} +19 -19
  10. package/dist/bundle/{chunk-NYINLKWT.js → chunk-2AXA5SKP.js} +1 -1
  11. package/dist/bundle/{chunk-BAEIAQWH.js → chunk-3TQHIHZI.js} +2 -2
  12. package/dist/bundle/{chunk-MBNKNWOG.js → chunk-4CBZEAQ7.js} +35 -34
  13. package/dist/bundle/{chunk-SWFA36F3.js → chunk-4VHBDVY2.js} +20 -14
  14. package/dist/bundle/{chunk-Z5GDNCTJ.js → chunk-4XZXH2NM.js} +2 -2
  15. package/dist/bundle/{chunk-A4DHPOFQ.js → chunk-57QVQGBE.js} +53 -39
  16. package/dist/bundle/{chunk-SPVPKHBQ.js → chunk-5AMRCBMP.js} +78 -40
  17. package/dist/bundle/{chunk-ED5JNYN5.js → chunk-5XHLQZAG.js} +30 -28
  18. package/dist/bundle/{chunk-BLJVCJZU.js → chunk-67QXMO2G.js} +26 -26
  19. package/dist/bundle/{chunk-EFEI724Z.js → chunk-6HTKB4WC.js} +1 -1
  20. package/dist/bundle/{chunk-U2RSVKR5.js → chunk-73MNUSP3.js} +1 -1
  21. package/dist/bundle/{chunk-4UU4ONKY.js → chunk-73TTP6ET.js} +5326 -636
  22. package/dist/bundle/{chunk-4ICWGMHN.js → chunk-77C5XRH3.js} +7 -7
  23. package/dist/bundle/{chunk-W6KMNO3C.js → chunk-77YTRBL6.js} +11 -11
  24. package/dist/bundle/{chunk-YHRJUZ3O.js → chunk-ALWTUDZF.js} +6 -4
  25. package/dist/bundle/{chunk-ESF2B22R.js → chunk-AXWXQNTC.js} +14 -11
  26. package/dist/bundle/{chunk-FD7A6745.js → chunk-CKGHRWVR.js} +4 -4
  27. package/dist/bundle/{chunk-X4F3M6L6.js → chunk-D6WIWOQC.js} +4 -4
  28. package/dist/bundle/{chunk-TCJRJ3TE.js → chunk-DMHGWL5D.js} +13 -13
  29. package/dist/bundle/{chunk-AFZ33AC7.js → chunk-DQDKLZAK.js} +179 -50
  30. package/dist/bundle/{chunk-ITD7WI23.js → chunk-EBLA7GXY.js} +1 -1
  31. package/dist/bundle/{chunk-UTDL7MKT.js → chunk-EHAI773E.js} +2 -2
  32. package/dist/bundle/{chunk-RRHC5SBB.js → chunk-FO4TCH6P.js} +2 -2
  33. package/dist/bundle/{chunk-7VFD3UJQ.js → chunk-FTZNUZO7.js} +3 -3
  34. package/dist/bundle/{chunk-JEMKSWVI.js → chunk-FZOCQQ66.js} +12 -12
  35. package/dist/bundle/{chunk-P5MCZ635.js → chunk-GD6TQ6U4.js} +11 -88
  36. package/dist/bundle/{chunk-PYPLD7JO.js → chunk-GVRS5AIH.js} +2 -2
  37. package/dist/bundle/{chunk-2TASMYGM.js → chunk-HCJG7ENG.js} +3 -3
  38. package/dist/bundle/{chunk-TIXIB32T.js → chunk-HFGR33KD.js} +153 -101
  39. package/dist/bundle/{chunk-ASPIEEXN.js → chunk-HIP43OGZ.js} +1 -1
  40. package/dist/bundle/{chunk-IBJOO5FG.js → chunk-HQVIK6PM.js} +37 -19
  41. package/dist/bundle/{chunk-AL7MY7MW.js → chunk-IRZ7OF3F.js} +1 -1
  42. package/dist/bundle/{chunk-OOR6PEHV.js → chunk-IXN7Y6JA.js} +1 -1
  43. package/dist/bundle/{chunk-4EEOJ54H.js → chunk-JGUJJNGZ.js} +5930 -3061
  44. package/dist/bundle/{chunk-6THTUYPT.js → chunk-JQLIM6BH.js} +5 -5
  45. package/dist/bundle/{chunk-LSSIVBQI.js → chunk-K6XVRA6U.js} +1 -1
  46. package/dist/bundle/chunk-KEXTTZJM.js +35 -0
  47. package/dist/bundle/{chunk-3RG27IWA.js → chunk-LJ77Y3TK.js} +5 -5
  48. package/dist/bundle/{chunk-I4VUHZSD.js → chunk-LQSRVQ3V.js} +4 -3
  49. package/dist/bundle/{chunk-NKL5XXOM.js → chunk-MVNPE5FZ.js} +8 -8
  50. package/dist/bundle/{chunk-6SARLV3Z.js → chunk-MXP35VPO.js} +4 -4
  51. package/dist/bundle/{chunk-J36Z6BDZ.js → chunk-N7S2UPF3.js} +652 -373
  52. package/dist/bundle/{chunk-4GZLX2ME.js → chunk-O37ESNAP.js} +40 -33
  53. package/dist/bundle/{chunk-OZEJA67C.js → chunk-OMKUBCNN.js} +8 -8
  54. package/dist/bundle/{chunk-XQMMB6ST.js → chunk-OYNUBWD2.js} +2 -22
  55. package/dist/bundle/{chunk-OUQVZTF5.js → chunk-PDYHEWKG.js} +7 -42
  56. package/dist/bundle/{chunk-QVIJMV22.js → chunk-PETFPXLU.js} +3 -3
  57. package/dist/bundle/{chunk-TNX77VPM.js → chunk-PPL5ASW2.js} +4908 -1588
  58. package/dist/bundle/{chunk-GDRO4YMH.js → chunk-QIJWSKZL.js} +4 -4
  59. package/dist/bundle/{chunk-EFX6FIDM.js → chunk-S36HRPNS.js} +1 -1
  60. package/dist/bundle/{chunk-WICYDOVL.js → chunk-SBHSNOU4.js} +91 -23
  61. package/dist/bundle/{chunk-7YUZAEBG.js → chunk-SZXI4OXX.js} +2 -2
  62. package/dist/bundle/{chunk-O3K46QRL.js → chunk-TKW4QWCY.js} +20 -6
  63. package/dist/bundle/{chunk-UBZ2LH7N.js → chunk-TVQDMP2F.js} +1533 -602
  64. package/dist/bundle/{chunk-7AL57FCK.js → chunk-TXMTMEHW.js} +4 -4
  65. package/dist/bundle/{chunk-X5XWUQNU.js → chunk-UNJE63JK.js} +2 -2
  66. package/dist/bundle/chunk-UTFATA4K.js +93 -0
  67. package/dist/bundle/{chunk-34XHR5FL.js → chunk-UVLSWLPZ.js} +16 -16
  68. package/dist/bundle/chunk-UVYVIHEA.js +34 -0
  69. package/dist/bundle/{chunk-IH4UCM5K.js → chunk-V2VMBM7O.js} +2 -2
  70. package/dist/bundle/{chunk-KCBHOYNZ.js → chunk-V7QMHMR3.js} +8 -13
  71. package/dist/bundle/{chunk-IXXQZCNK.js → chunk-VRW6ZDTH.js} +32 -19
  72. package/dist/bundle/{chunk-VXI67T7U.js → chunk-VVCZS42A.js} +1 -1
  73. package/dist/bundle/{chunk-A7FMNTCK.js → chunk-W62CON5K.js} +4 -4
  74. package/dist/bundle/{chunk-BKM2CGG2.js → chunk-XDIEQ2CE.js} +3 -3
  75. package/dist/bundle/{chunk-OG5ERX4S.js → chunk-XFXRGQXJ.js} +2 -2
  76. package/dist/bundle/{chunk-UMJLXAJI.js → chunk-YDN2RH5S.js} +2 -2
  77. package/dist/bundle/{chunk-TMW526H3.js → chunk-YGG7UA3C.js} +5 -5
  78. package/dist/bundle/{chunk-D72FL3L3.js → chunk-YYHKVOVK.js} +35 -35
  79. package/dist/bundle/{chunk-3GXNODTB.js → chunk-ZPQS7XJA.js} +4 -4
  80. package/dist/bundle/{chunk-JZ67M3HR.js → chunk-ZYCLPJ7U.js} +1 -1
  81. package/dist/bundle/command-contract-NUIWUVYB.js +39 -0
  82. package/dist/bundle/{decode-2R6DTGRX.js → decode-35N57AFW.js} +8 -8
  83. package/dist/bundle/{dispatch-DEXAEMIN.js → dispatch-CWXZW3PL.js} +9 -9
  84. package/dist/bundle/drive.js +12 -12
  85. package/dist/bundle/{echarts-CLB22SZS.js → echarts-3P3QZWMU.js} +2 -2
  86. package/dist/bundle/{embed-RJJWOLKN.js → embed-Q6Q5IOJQ.js} +9 -9
  87. package/dist/bundle/{embedder-DWYS5JYJ.js → embedder-D44JDTAA.js} +12 -12
  88. package/dist/bundle/entry-ZHCNI7XO.js +22 -0
  89. package/dist/bundle/{failure-GBZ4L5QO.js → failure-GRMMSDCZ.js} +4 -4
  90. package/dist/bundle/first-run-3DC2SDWM.js +30 -0
  91. package/dist/bundle/first-screen-YJF4YODC.js +37 -0
  92. package/dist/bundle/{google-L776ETP4.js → google-6ZZDKFBN.js} +13 -13
  93. package/dist/bundle/{google-api-AI5ZJJ2M.js → google-api-E6MOJ4ZD.js} +57 -56
  94. package/dist/bundle/grants-GWXDH5GM.js +105 -0
  95. package/dist/bundle/{identity-MDLWK2TX.js → identity-TID7S5NE.js} +6 -6
  96. package/dist/bundle/{instructions-BXZZNAMS.js → instructions-ANJN4HV3.js} +1 -1
  97. package/dist/bundle/{login-6HHQLRHY.js → login-BGMK2ABH.js} +65 -66
  98. package/dist/bundle/{mcp-ZZUYI44D.js → mcp-WBHKX5E3.js} +2 -2
  99. package/dist/bundle/{node-R6ZNQ3NT.js → node-VOB45ES2.js} +2 -2
  100. package/dist/bundle/{node-sqlite-AVNHGMVL.js → node-sqlite-TSX6XQY2.js} +14 -8
  101. package/dist/bundle/oauth-CEOYXW6C.js +22 -0
  102. package/dist/bundle/{open-BXPLXJC2.js → open-3USWHGNR.js} +8 -7
  103. package/dist/bundle/{openai-CRO5GDBY.js → openai-YZ5VGPIP.js} +17 -17
  104. package/dist/bundle/{process-P36JP33R.js → process-44JS2W7L.js} +1 -1
  105. package/dist/bundle/{program-4DWVWSGQ.js → program-TZLAFKJV.js} +158 -103
  106. package/dist/bundle/prompt-SG7LAOXW.js +17 -0
  107. package/dist/bundle/{reasons-IHPNUP5W.js → reasons-ZK3U3CIN.js} +5 -5
  108. package/dist/bundle/{recognize-NAISVA56.js → recognize-OFW7HWTM.js} +7 -7
  109. package/dist/bundle/{remote-KCUHG5HV.js → remote-YBDRZQZ5.js} +10 -10
  110. package/dist/bundle/{rerank-Q3POCDSK.js → rerank-TQQNS5FJ.js} +10 -10
  111. package/dist/bundle/{serve-5CUOYLSG.js → serve-OPZXMVLH.js} +14 -13
  112. package/dist/bundle/{server-FXW3GARV.js → server-2D6DDIK5.js} +44 -43
  113. package/dist/bundle/server-R6G2O772.js +70 -0
  114. package/dist/bundle/{services-PEYBXZ3R.js → services-34WKT3NN.js} +101 -31
  115. package/dist/bundle/{sqlite-runtime-YMPWN5PM.js → sqlite-runtime-WPUMKLUV.js} +9 -8
  116. package/dist/bundle/{start-PFWEF44R.js → start-ZXUJZ4JV.js} +7 -7
  117. package/dist/bundle/{state-5TQ7IOJH.js → state-AV2RB3AQ.js} +9 -9
  118. package/dist/bundle/{store-P4OYYFW5.js → store-3M7N2Q5T.js} +20 -16
  119. package/dist/bundle/{store-E2VWY4O6.js → store-YKV4GAMS.js} +49 -22
  120. package/dist/bundle/store-maintenance-command-WDXNY4ZF.js +60 -0
  121. package/dist/bundle/tokens-F63RXXEF.js +103 -0
  122. package/dist/commands/config.d.ts.map +1 -1
  123. package/dist/commands/config.js +14 -5
  124. package/dist/commands/config.js.map +1 -1
  125. package/dist/commands/context.d.ts +4 -2
  126. package/dist/commands/context.d.ts.map +1 -1
  127. package/dist/commands/context.js.map +1 -1
  128. package/dist/commands/documents.d.ts +1 -0
  129. package/dist/commands/documents.d.ts.map +1 -1
  130. package/dist/commands/documents.js +14 -1
  131. package/dist/commands/documents.js.map +1 -1
  132. package/dist/commands/knowledge.d.ts +4 -0
  133. package/dist/commands/knowledge.d.ts.map +1 -1
  134. package/dist/commands/knowledge.js +8 -7
  135. package/dist/commands/knowledge.js.map +1 -1
  136. package/dist/commands/session.d.ts.map +1 -1
  137. package/dist/commands/session.js +5 -2
  138. package/dist/commands/session.js.map +1 -1
  139. package/dist/config.d.ts +7 -0
  140. package/dist/config.d.ts.map +1 -1
  141. package/dist/config.js +22 -3
  142. package/dist/config.js.map +1 -1
  143. package/dist/contract-overrides.js +5 -5
  144. package/dist/contract-overrides.js.map +1 -1
  145. package/dist/errors.js +4 -4
  146. package/dist/errors.js.map +1 -1
  147. package/dist/knowledge-query.d.ts +2 -0
  148. package/dist/knowledge-query.d.ts.map +1 -1
  149. package/dist/login.d.ts.map +1 -1
  150. package/dist/login.js +3 -5
  151. package/dist/login.js.map +1 -1
  152. package/dist/program.d.ts.map +1 -1
  153. package/dist/program.js +13 -4
  154. package/dist/program.js.map +1 -1
  155. package/dist/provider-json.d.ts +2 -0
  156. package/dist/provider-json.d.ts.map +1 -1
  157. package/dist/provider-json.js +13 -0
  158. package/dist/provider-json.js.map +1 -1
  159. package/dist/reasons.d.ts +1 -1
  160. package/dist/reasons.d.ts.map +1 -1
  161. package/dist/reasons.js +2 -22
  162. package/dist/reasons.js.map +1 -1
  163. package/dist/registry.d.ts +1 -1
  164. package/dist/registry.d.ts.map +1 -1
  165. package/dist/registry.js +2 -1
  166. package/dist/registry.js.map +1 -1
  167. package/dist/store.d.ts +2 -0
  168. package/dist/store.d.ts.map +1 -1
  169. package/dist/store.js +9 -0
  170. package/dist/store.js.map +1 -1
  171. package/dist/tokens.js +5 -5
  172. package/dist/tokens.js.map +1 -1
  173. package/dist/upload.js +1 -1
  174. package/dist/upload.js.map +1 -1
  175. package/dist/version.d.ts +1 -1
  176. package/dist/version.js +1 -1
  177. package/package.json +3 -3
  178. package/skills/drive-cli/SKILL.md +2 -1
  179. package/dist/bundle/chunk-7VUHY5LP.js +0 -18
  180. package/dist/bundle/chunk-Y6M2G7JK.js +0 -3609
  181. package/dist/bundle/command-contract-ZCXFT764.js +0 -39
  182. package/dist/bundle/entry-E6H7IUPV.js +0 -21
  183. package/dist/bundle/first-run-DI2JIG44.js +0 -30
  184. package/dist/bundle/first-screen-X5N4TCKD.js +0 -37
  185. package/dist/bundle/grants-HKGYAWL6.js +0 -104
  186. package/dist/bundle/oauth-UVU52X57.js +0 -22
  187. package/dist/bundle/prompt-AFWVGRDG.js +0 -17
  188. package/dist/bundle/server-FTLPSLRU.js +0 -69
  189. package/dist/bundle/store-maintenance-command-MWVERNK7.js +0 -58
  190. package/dist/bundle/tokens-OVG4CJO4.js +0 -102
  191. /package/dist/bundle/{chunk-HPXYN7F3.js → chunk-LK2E2ELG.js} +0 -0
@@ -3,7 +3,7 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  answerOf,
5
5
  messengerContext
6
- } from "./chunk-ED5JNYN5.js";
6
+ } from "./chunk-5XHLQZAG.js";
7
7
  import {
8
8
  chatEventAnswer,
9
9
  memberAnswer,
@@ -12,7 +12,7 @@ import {
12
12
  serveRelay,
13
13
  typedQuery,
14
14
  withQuery
15
- } from "./chunk-IXXQZCNK.js";
15
+ } from "./chunk-VRW6ZDTH.js";
16
16
  import {
17
17
  stringWidth,
18
18
  wrapAnsi
@@ -40,47 +40,51 @@ import {
40
40
  snakeKeys,
41
41
  storeTable,
42
42
  withoutProviderRefs
43
- } from "./chunk-4UU4ONKY.js";
43
+ } from "./chunk-73TTP6ET.js";
44
44
  import {
45
45
  envName
46
- } from "./chunk-Z5GDNCTJ.js";
46
+ } from "./chunk-4XZXH2NM.js";
47
47
  import {
48
48
  holdLock,
49
49
  lockPath,
50
50
  releaseLock,
51
51
  servingProfiles,
52
52
  takeLock
53
- } from "./chunk-7VFD3UJQ.js";
53
+ } from "./chunk-FTZNUZO7.js";
54
54
  import {
55
55
  holdersOf
56
- } from "./chunk-U2RSVKR5.js";
56
+ } from "./chunk-73MNUSP3.js";
57
57
  import {
58
58
  checkedOptions,
59
59
  range
60
- } from "./chunk-2TASMYGM.js";
60
+ } from "./chunk-HCJG7ENG.js";
61
61
  import {
62
+ FETCHING,
62
63
  RULES_VERSION,
63
64
  applyTaskRulesOnArrival,
65
+ capability,
64
66
  newSendId,
65
67
  onlineDeps,
66
68
  openRequestTask,
69
+ patiently,
67
70
  senderIsMe,
68
71
  servicesFor,
69
72
  syncsOneChat
70
- } from "./chunk-4EEOJ54H.js";
73
+ } from "./chunk-JGUJJNGZ.js";
71
74
  import {
72
75
  codeOf,
73
76
  currentRun,
74
- levelFor
75
- } from "./chunk-TIXIB32T.js";
77
+ levelFor,
78
+ parseDuration
79
+ } from "./chunk-HFGR33KD.js";
76
80
  import {
77
81
  failureKey
78
- } from "./chunk-UMJLXAJI.js";
82
+ } from "./chunk-YDN2RH5S.js";
79
83
  import {
80
84
  messagesFor,
81
85
  systemFor,
82
86
  validateImages
83
- } from "./chunk-UTDL7MKT.js";
87
+ } from "./chunk-EHAI773E.js";
84
88
  import {
85
89
  MIGRATIONS,
86
90
  drainNoteIndex,
@@ -109,29 +113,29 @@ import {
109
113
  storeClients,
110
114
  storeContents,
111
115
  vectorIndexCounts
112
- } from "./chunk-TNX77VPM.js";
116
+ } from "./chunk-PPL5ASW2.js";
113
117
  import {
114
118
  queryFieldsOf
115
- } from "./chunk-SWFA36F3.js";
119
+ } from "./chunk-4VHBDVY2.js";
116
120
  import {
117
121
  storePath
118
- } from "./chunk-7VUHY5LP.js";
122
+ } from "./chunk-KEXTTZJM.js";
119
123
  import {
120
124
  openCache
121
- } from "./chunk-KCBHOYNZ.js";
125
+ } from "./chunk-V7QMHMR3.js";
122
126
  import {
123
127
  readSecret
124
- } from "./chunk-BKM2CGG2.js";
128
+ } from "./chunk-XDIEQ2CE.js";
125
129
  import {
126
130
  Credentials,
127
131
  pathsAreOverridden,
128
132
  resolvePaths,
129
133
  writeSecurely
130
- } from "./chunk-ALTG7BZQ.js";
134
+ } from "./chunk-246P2DCT.js";
131
135
  import {
132
136
  singleLine,
133
137
  visibleControls
134
- } from "./chunk-ASPIEEXN.js";
138
+ } from "./chunk-HIP43OGZ.js";
135
139
  import {
136
140
  array,
137
141
  boolean,
@@ -155,10 +159,10 @@ import {
155
159
  transform,
156
160
  trim,
157
161
  union
158
- } from "./chunk-O3K46QRL.js";
162
+ } from "./chunk-TKW4QWCY.js";
159
163
  import {
160
164
  CliError
161
- } from "./chunk-ITD7WI23.js";
165
+ } from "./chunk-EBLA7GXY.js";
162
166
  import {
163
167
  __commonJS,
164
168
  __name,
@@ -5498,11 +5502,11 @@ var require_liquid_node = __commonJS({
5498
5502
  }
5499
5503
  });
5500
5504
 
5501
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
5505
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
5502
5506
  import { chmodSync, constants, copyFileSync, existsSync as existsSync7, mkdirSync, realpathSync, renameSync as renameSync2, rmSync as rmSync2, statfsSync, statSync as statSync3, writeFileSync } from "node:fs";
5503
5507
  import { dirname, resolve } from "node:path";
5504
5508
 
5505
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/sealed.js
5509
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/sealed.js
5506
5510
  import { createCipheriv, createDecipheriv, createHash, randomBytes, scrypt, timingSafeEqual } from "node:crypto";
5507
5511
  import { closeSync, createReadStream, createWriteStream, existsSync, openSync, readSync, renameSync, rmSync, statSync } from "node:fs";
5508
5512
  import { Transform } from "node:stream";
@@ -5609,7 +5613,7 @@ var unsealFile = /* @__PURE__ */ __name(async (from, to, password) => {
5609
5613
  renameSync(pending, to);
5610
5614
  }, "unsealFile");
5611
5615
 
5612
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/store/compatibility.js
5616
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/compatibility.js
5613
5617
  var SPEAKS = MIGRATIONS.at(-1)?.version ?? 0;
5614
5618
  var fileSchemaOf = /* @__PURE__ */ __name((database) => {
5615
5619
  const tracked = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'schema_migrations'").get();
@@ -5633,7 +5637,7 @@ var compatibilityOf = /* @__PURE__ */ __name((file2, migrations = MIGRATIONS) =>
5633
5637
  };
5634
5638
  }, "compatibilityOf");
5635
5639
 
5636
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/store/repair.js
5640
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/repair.js
5637
5641
  import { createHash as createHash2 } from "node:crypto";
5638
5642
  var COPY_MARK = "__repair_";
5639
5643
  var COPY_NAME = /__repair_[0-9a-f]{8}(_\d+)?$/;
@@ -5887,7 +5891,7 @@ var deleteCopy = /* @__PURE__ */ __name((database, name) => {
5887
5891
  return found;
5888
5892
  }, "deleteCopy");
5889
5893
 
5890
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/cli/store-info.js
5894
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/cli/store-info.js
5891
5895
  import { existsSync as existsSync2, statSync as statSync2 } from "node:fs";
5892
5896
  var pendingIfKnown = /* @__PURE__ */ __name((database) => database.prepare("SELECT 1 FROM pragma_table_info('messages') WHERE name = 'normalized_text'").get() ? pendingNormalization(database) : null, "pendingIfKnown");
5893
5897
  var bytesOf = /* @__PURE__ */ __name((path) => existsSync2(path) ? statSync2(path).size : 0, "bytesOf");
@@ -5934,7 +5938,7 @@ var storeInfoCommand = /* @__PURE__ */ __name(() => annotate(new Command("info")
5934
5938
  renderAnswer(this, outputFor(this), itemOf(answer));
5935
5939
  }), "storeInfoCommand");
5936
5940
 
5937
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
5941
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
5938
5942
  var ENCRYPT_OPTION = [
5939
5943
  "--encrypt",
5940
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"
@@ -5953,7 +5957,7 @@ var passwordOf = /* @__PURE__ */ __name(async (command, { twice }) => {
5953
5957
  return password;
5954
5958
  }, "passwordOf");
5955
5959
 
5956
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/replies/rules.js
5960
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/replies/rules.js
5957
5961
  import { existsSync as existsSync3, readFileSync } from "node:fs";
5958
5962
  import { join } from "node:path";
5959
5963
  var REPLY_ACTIONS = ["reply", "task"];
@@ -6124,7 +6128,7 @@ var problem = /* @__PURE__ */ __name((issue) => {
6124
6128
  }, "problem");
6125
6129
  var broken = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply rules ${path} cannot be read (${why}) \u2014 fix the file`), "broken");
6126
6130
 
6127
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/replies/state.js
6131
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/replies/state.js
6128
6132
  import { existsSync as existsSync4, readFileSync as readFileSync2 } from "node:fs";
6129
6133
  import { join as join2 } from "node:path";
6130
6134
  var ANSWERED_KEPT = 1e3;
@@ -6177,7 +6181,7 @@ var recordReply = /* @__PURE__ */ __name((state, rule2, message, now) => {
6177
6181
  }, "recordReply");
6178
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");
6179
6183
 
6180
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/replies/decide.js
6184
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/replies/decide.js
6181
6185
  var skip = /* @__PURE__ */ __name((why) => ({ skip: why }), "skip");
6182
6186
  var decide = /* @__PURE__ */ __name((rule2, incoming, state, now) => {
6183
6187
  const { message, chat, owner, sender } = incoming;
@@ -6283,7 +6287,7 @@ var filled = /* @__PURE__ */ __name((template2, senderName) => {
6283
6287
  return template2.replaceAll("{firstName}", name.split(/\s+/)[0] ?? name).replaceAll("{name}", name);
6284
6288
  }, "filled");
6285
6289
 
6286
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/replies/template.js
6290
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/replies/template.js
6287
6291
  var import_liquidjs = __toESM(require_liquid_node(), 1);
6288
6292
  var TEMPLATE_LIMITS = {
6289
6293
  parse: 32768,
@@ -6443,7 +6447,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
6443
6447
  }
6444
6448
  }, "renderReplyTemplate");
6445
6449
 
6446
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
6450
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
6447
6451
  var DRY_RUN_DAYS = 7;
6448
6452
  var PAGE = 500;
6449
6453
  var dryRun = /* @__PURE__ */ __name(async (store, account, rules, { since, until = Date.now(), only, audience, render }) => {
@@ -6557,7 +6561,7 @@ var storedSince = /* @__PURE__ */ __name(async (store, account, chat, since) =>
6557
6561
  }
6558
6562
  }, "storedSince");
6559
6563
 
6560
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
6564
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
6561
6565
  var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
6562
6566
  const host = new URL(baseUrl).host;
6563
6567
  return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
@@ -6588,7 +6592,7 @@ var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) =>
6588
6592
  };
6589
6593
  }, "embeddingKeys");
6590
6594
 
6591
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/models/openai.js
6595
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/models/openai.js
6592
6596
  var options = strictObject({
6593
6597
  temperature: range(0, 2),
6594
6598
  top_p: range(0, 1),
@@ -6637,7 +6641,7 @@ var openai = {
6637
6641
  }, "complete")
6638
6642
  };
6639
6643
 
6640
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/models/index.js
6644
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/models/index.js
6641
6645
  var modelGateway = /* @__PURE__ */ __name((deps) => ({
6642
6646
  complete: /* @__PURE__ */ __name(async (request) => {
6643
6647
  if (deps.signal?.aborted)
@@ -6652,7 +6656,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
6652
6656
  if (!adapter && target.provider === "openai")
6653
6657
  adapter = openai;
6654
6658
  if (!adapter && target.provider === "anthropic")
6655
- adapter = (await import("./anthropic-EZPZUWGS.js")).anthropic;
6659
+ adapter = (await import("./anthropic-X4NWVHDF.js")).anthropic;
6656
6660
  if (!adapter)
6657
6661
  throw new CliError("validation_error", `no model adapter for ${target.provider}`);
6658
6662
  if (request.images !== void 0 && adapter.images !== true)
@@ -6693,7 +6697,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
6693
6697
  }, "complete")
6694
6698
  }), "modelGateway");
6695
6699
 
6696
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/replies/consents.js
6700
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/replies/consents.js
6697
6701
  import { existsSync as existsSync5, readFileSync as readFileSync3 } from "node:fs";
6698
6702
  import { join as join3 } from "node:path";
6699
6703
  var shape = strictObject({
@@ -6718,7 +6722,7 @@ var mayModelReply = /* @__PURE__ */ __name((path, provider, chat) => {
6718
6722
  return consent.provider === provider && !consent.deniedChats.includes(chat);
6719
6723
  }, "mayModelReply");
6720
6724
 
6721
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/replies/rendering.js
6725
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/replies/rendering.js
6722
6726
  var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, options2 = {
6723
6727
  ai: true
6724
6728
  }) => async (rule2, message, chat, now) => {
@@ -6765,7 +6769,7 @@ var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, o
6765
6769
  return result2;
6766
6770
  }, "replyRenderer");
6767
6771
 
6768
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/replies/serve.js
6772
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/replies/serve.js
6769
6773
  var NOT_ALLOWED = "replies.send is not allow";
6770
6774
  var NO_RULES = "no rules";
6771
6775
  var ONLY_TASK = "opened a task, sent nothing";
@@ -6858,7 +6862,84 @@ var replyTo = /* @__PURE__ */ __name(async (deps, message) => {
6858
6862
  return { skip: why };
6859
6863
  }, "replyTo");
6860
6864
 
6861
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
6865
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/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.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
6862
6943
  var FIRST_FETCH_MS = 6e4;
6863
6944
  var DAY_MS = 864e5;
6864
6945
  var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, firstMs = FIRST_FETCH_MS, everyMs = DAY_MS }) => {
@@ -6912,7 +6993,7 @@ var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, fi
6912
6993
  };
6913
6994
  }, "memberFetches");
6914
6995
 
6915
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
6996
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
6916
6997
  var record2 = /* @__PURE__ */ __name((context, app, severity, attributes) => recordLogFor(context.streams.diagnostic, app, { command: currentRun().command || "serve" })[severity](attributes), "record");
6917
6998
  var noticeFor = /* @__PURE__ */ __name((context, app, severity = "warn") => ({ text, ...attributes }) => {
6918
6999
  if (context.format === "pretty") {
@@ -6945,7 +7026,7 @@ var recordDiagnostics = /* @__PURE__ */ __name((context, app) => {
6945
7026
  return context;
6946
7027
  }, "recordDiagnostics");
6947
7028
 
6948
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
7029
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
6949
7030
  var STEMS_EVERY_MS = 3e4;
6950
7031
  var STEMS_SLICE_MS = 2e3;
6951
7032
  var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY_MS, sliceMs = STEMS_SLICE_MS }) => {
@@ -6985,7 +7066,7 @@ var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY
6985
7066
  };
6986
7067
  }, "stemFills");
6987
7068
 
6988
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/render/messages.js
7069
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/render/messages.js
6989
7070
  import { styleText } from "node:util";
6990
7071
  var TIME_WIDTH = 8;
6991
7072
  var INDENT = " ".repeat(TIME_WIDTH + 2);
@@ -7161,7 +7242,7 @@ var editedAt = /* @__PURE__ */ __name((message, options2) => {
7161
7242
  return day(edited) === day(message.timestamp) ? time : `${day(edited)} ${time}`;
7162
7243
  }, "editedAt");
7163
7244
 
7164
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
7245
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
7165
7246
  var defined = /* @__PURE__ */ __name((value) => Object.fromEntries(Object.entries(value).filter(([, one]) => one !== void 0)), "defined");
7166
7247
  var attachmentItem = /* @__PURE__ */ __name((attachment) => defined({
7167
7248
  kind: attachment.kind,
@@ -7256,7 +7337,7 @@ var viewOf = /* @__PURE__ */ __name((context, messenger) => ({
7256
7337
  locale: messenger.app.locale
7257
7338
  }), "viewOf");
7258
7339
 
7259
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
7340
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
7260
7341
  var observed = /* @__PURE__ */ __name((value) => ({
7261
7342
  value: value.value,
7262
7343
  observed_at: value.observedAt,
@@ -7323,7 +7404,7 @@ var watchEventItem = /* @__PURE__ */ __name((value, account) => {
7323
7404
  }
7324
7405
  }, "watchEventItem");
7325
7406
 
7326
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
7407
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
7327
7408
  var watchCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("watch"), {
7328
7409
  output: { entity: "watch_item" },
7329
7410
  effects: REMOTE_READ,
@@ -7478,7 +7559,7 @@ var describe = /* @__PURE__ */ __name((event, render) => {
7478
7559
  }
7479
7560
  }, "describe");
7480
7561
 
7481
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
7562
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
7482
7563
  var serveCommand = /* @__PURE__ */ __name((messenger) => {
7483
7564
  const command = annotate(new Command("serve"), {
7484
7565
  output: { entity: "serve_summary" },
@@ -7521,7 +7602,7 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
7521
7602
  const counts = {};
7522
7603
  const rules = replying(context, messenger, Date.parse(startedAt));
7523
7604
  const tasks = tasking(context, warn);
7524
- const { handled } = environmentOf(this);
7605
+ const { handled, startSyncDelayMs } = environmentOf(this);
7525
7606
  const count3 = /* @__PURE__ */ __name((event) => {
7526
7607
  counts[event.event] = (counts[event.event] ?? 0) + 1;
7527
7608
  if (event.event === "message") {
@@ -7545,6 +7626,50 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
7545
7626
  }).chats.fetchMembers(chatId, {}), "fetch"),
7546
7627
  warn
7547
7628
  });
7629
+ const fetching = messenger.fetching ?? FETCHING;
7630
+ const catchingUp = startSync({
7631
+ chats: /* @__PURE__ */ __name(async (stop) => {
7632
+ const list = capability(connection, "chats", "list its chats");
7633
+ const all = [];
7634
+ for (let offset = 0; ; ) {
7635
+ const page = await patiently(() => list({ offset, limit: 100 }), context.renderer.note, stop);
7636
+ for (const chat of page.items)
7637
+ all.push(chat);
7638
+ offset += page.items.length;
7639
+ if (!page.hasMore || page.items.length === 0)
7640
+ return all;
7641
+ }
7642
+ }, "chats"),
7643
+ newestHeld: /* @__PURE__ */ __name((chatId) => context.withStore(async (store, account) => {
7644
+ const [newest] = await store.messages.messagesWindow(account, chatId, {
7645
+ at: startedAt,
7646
+ before: 1,
7647
+ after: 0
7648
+ });
7649
+ return newest ? Date.parse(newest.timestamp) : void 0;
7650
+ }, { name: "serve catch-up" }), "newestHeld"),
7651
+ fetch: /* @__PURE__ */ __name((chatId, sinceMs, stop) => context.withStore((store, account) => servicesFor({
7652
+ ...onlineDeps(messenger, connection, context.guard, {
7653
+ profile: context.profile,
7654
+ env: context.env
7655
+ }),
7656
+ store: /* @__PURE__ */ __name(async () => store, "store"),
7657
+ account: /* @__PURE__ */ __name(async () => account, "account")
7658
+ }).archive.fetch(chatId, {
7659
+ limit: START_SYNC_PER_CHAT,
7660
+ pageSize: fetching.page,
7661
+ pauseMs: parseDuration(fetching.pause, "pause"),
7662
+ sinceMs,
7663
+ catchUp: false,
7664
+ note: context.renderer.note,
7665
+ stop,
7666
+ onPage: /* @__PURE__ */ __name(() => {
7667
+ }, "onPage")
7668
+ }), { name: "serve catch-up" }), "fetch"),
7669
+ note,
7670
+ warn,
7671
+ ...startSyncDelayMs === void 0 ? {} : { delayMs: startSyncDelayMs }
7672
+ });
7548
7673
  const stems = stemFills({
7549
7674
  withStore: /* @__PURE__ */ __name((work) => context.withStore((store) => work(store), { name: "serve stems" }), "withStore"),
7550
7675
  warn
@@ -7559,12 +7684,15 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
7559
7684
  rules.connected(open);
7560
7685
  members.start();
7561
7686
  stems.start();
7687
+ if (messenger.history !== "store" && typeof open.chats === "function")
7688
+ catchingUp.start();
7562
7689
  }, "connected")
7563
7690
  });
7564
7691
  } finally {
7565
7692
  await relaying;
7566
7693
  await relay?.close();
7567
7694
  rules.stop();
7695
+ await catchingUp.stop();
7568
7696
  await members.stop();
7569
7697
  await stems.stop();
7570
7698
  await rules.settled();
@@ -7579,6 +7707,7 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
7579
7707
  ...rules.summary(),
7580
7708
  ...members.summary().fetched + members.summary().failed > 0 ? { members: members.summary() } : {},
7581
7709
  ...stems.summary().stemmed > 0 ? { stems: stems.summary() } : {},
7710
+ ...catchingUp.summary() ? { caught_up: catchingUp.summary() } : {},
7582
7711
  ...tasks.summary()
7583
7712
  }));
7584
7713
  });
@@ -7694,7 +7823,7 @@ var tasking = /* @__PURE__ */ __name((context, warn) => {
7694
7823
  };
7695
7824
  }, "tasking");
7696
7825
 
7697
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
7826
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
7698
7827
  import { existsSync as existsSync6 } from "node:fs";
7699
7828
  var PATH = "store tables list";
7700
7829
  var STORE_TABLES_QUERY = {
@@ -7737,7 +7866,7 @@ var storeTablesCommand = /* @__PURE__ */ __name((messenger) => {
7737
7866
  return tables;
7738
7867
  }, "storeTablesCommand");
7739
7868
 
7740
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
7869
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
7741
7870
  var SEARCH_INDEXES = ["messages_fts", "chats_fts", "identities_fts"];
7742
7871
  var WORD_INDEX = "message_words";
7743
7872
  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-base@0.73.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/errors.js
7
+ // node_modules/.pnpm/@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/errors.js
8
8
  var errorCodes = [
9
9
  "validation_error",
10
10
  "configuration_error",
@@ -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-ITD7WI23.js";
5
+ } from "./chunk-EBLA7GXY.js";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/models/types.js
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/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)
@@ -15,12 +15,12 @@ import {
15
15
  string,
16
16
  text,
17
17
  unknown
18
- } from "./chunk-O3K46QRL.js";
18
+ } from "./chunk-TKW4QWCY.js";
19
19
  import {
20
20
  __name
21
21
  } from "./chunk-ZVVMGPBJ.js";
22
22
 
23
- // node_modules/.pnpm/@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/log.js
23
+ // node_modules/.pnpm/@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/log.js
24
24
  var LOG_SEVERITIES = ["trace", "debug", "info", "warn", "error", "fatal"];
25
25
  var logRecordSchema = strictObject({
26
26
  time: isoTime,
@@ -2,16 +2,16 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  alive
5
- } from "./chunk-U2RSVKR5.js";
5
+ } from "./chunk-73MNUSP3.js";
6
6
  import {
7
7
  resolvePaths,
8
8
  writeSecurely
9
- } from "./chunk-ALTG7BZQ.js";
9
+ } from "./chunk-246P2DCT.js";
10
10
  import {
11
11
  __name
12
12
  } from "./chunk-ZVVMGPBJ.js";
13
13
 
14
- // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/background/lock.js
14
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/background/lock.js
15
15
  import { existsSync, linkSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
16
16
  import { dirname, join } from "node:path";
17
17
  var lockPath = /* @__PURE__ */ __name((app, profile, env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "serve", `${profile}.lock`), "lockPath");