@wirecat/mail-cli 0.12.0 → 0.14.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 (115) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +4 -0
  3. package/dist/bin/mail.js +6 -2
  4. package/dist/bundle/{all-profiles-OJPRIFKU.js → all-profiles-O7HQNZOF.js} +10 -9
  5. package/dist/bundle/{anthropic-3AXHD4WH.js → anthropic-SNA6PTVO.js} +6 -6
  6. package/dist/bundle/{app-server-V4KHCUGE.js → app-server-LBKMJMKN.js} +48 -45
  7. package/dist/bundle/{bun-ISYNUTQJ.js → bun-KF5QK2YN.js} +2 -2
  8. package/dist/bundle/{bun-sqlite-FH3D4AXL.js → bun-sqlite-2DKMM2PT.js} +5 -5
  9. package/dist/bundle/{chunk-YDUES6ET.js → chunk-2A4BAMNF.js} +4 -4
  10. package/dist/bundle/{chunk-XTIQFMZH.js → chunk-2F7D6YMB.js} +4 -4
  11. package/dist/bundle/{chunk-SW5NVASW.js → chunk-2KVR7FF3.js} +12 -89
  12. package/dist/bundle/{chunk-JAWJZTFL.js → chunk-3EAAEF5U.js} +18 -18
  13. package/dist/bundle/{chunk-TTKNBUMT.js → chunk-3YGYB3LJ.js} +43 -6
  14. package/dist/bundle/{chunk-GYNHU56E.js → chunk-5C74F7XX.js} +4 -4
  15. package/dist/bundle/{chunk-5TACUBRJ.js → chunk-6CZQJ5XR.js} +8 -8
  16. package/dist/bundle/{chunk-OHC4GVWV.js → chunk-6EZ7XGRG.js} +2 -2
  17. package/dist/bundle/{chunk-6UT3MXOB.js → chunk-7GSE57K3.js} +3 -3
  18. package/dist/bundle/{chunk-AJ4JS2ZR.js → chunk-7LDC275M.js} +8 -7
  19. package/dist/bundle/{chunk-QPQSMJBW.js → chunk-AOVOIXGR.js} +10 -10
  20. package/dist/bundle/{chunk-DN54W657.js → chunk-B5XAETYU.js} +4 -4
  21. package/dist/bundle/chunk-BP3TZ4EY.js +91 -0
  22. package/dist/bundle/{chunk-4DPICEPQ.js → chunk-CCHHEMPM.js} +2 -2
  23. package/dist/bundle/chunk-DIP3ENSY.js +34 -0
  24. package/dist/bundle/{chunk-4GPPRLIG.js → chunk-DPKHVBP3.js} +5 -5
  25. package/dist/bundle/{chunk-K2F7YMMM.js → chunk-E7BTD4P6.js} +8 -13
  26. package/dist/bundle/{chunk-VEXXVLBM.js → chunk-ER6PJAPK.js} +3 -3
  27. package/dist/bundle/{chunk-JIIEJLAX.js → chunk-EW3XTUPB.js} +4 -4
  28. package/dist/bundle/{chunk-6LNRNQHJ.js → chunk-F5SZVO3A.js} +6 -4
  29. package/dist/bundle/{chunk-UDJIC6YL.js → chunk-FTGCXIQA.js} +54 -29
  30. package/dist/bundle/{chunk-V6K2GX2Y.js → chunk-G53HRGTK.js} +17 -17
  31. package/dist/bundle/{chunk-L3PVAY3M.js → chunk-H2ZURG7Q.js} +2 -2
  32. package/dist/bundle/{chunk-F3QDSQ7V.js → chunk-H7OQ4YZV.js} +27 -26
  33. package/dist/bundle/{chunk-S64N24ON.js → chunk-I62OTHDE.js} +3 -3
  34. package/dist/bundle/{chunk-AO32MFDY.js → chunk-I7EWIIBC.js} +2 -2
  35. package/dist/bundle/{chunk-JNUKTAMZ.js → chunk-ILHTNOIV.js} +1 -1
  36. package/dist/bundle/{chunk-GAIVTJ3E.js → chunk-IPKXRW6W.js} +24 -23
  37. package/dist/bundle/{chunk-NSDOYHIS.js → chunk-IVDUR5Y4.js} +20 -8
  38. package/dist/bundle/{chunk-KJP2B65C.js → chunk-KBFIKUCA.js} +29 -28
  39. package/dist/bundle/{chunk-IWHXM2S7.js → chunk-KLLKDOO2.js} +3207 -1149
  40. package/dist/bundle/{chunk-4D52FA34.js → chunk-KQ5P5NLL.js} +1 -1
  41. package/dist/bundle/{chunk-PLPSFJO6.js → chunk-M2YIJDBL.js} +6 -6
  42. package/dist/bundle/{chunk-IG2WXKIT.js → chunk-MQK2UNG4.js} +8 -8
  43. package/dist/bundle/{chunk-YRZ23RCS.js → chunk-MXG4L7NH.js} +249 -8
  44. package/dist/bundle/{chunk-LXHLQ6RK.js → chunk-NGZW2JPK.js} +7 -9
  45. package/dist/bundle/{chunk-GFCNSU3B.js → chunk-NVQUK2DH.js} +176 -47
  46. package/dist/bundle/{chunk-6QNPJSRM.js → chunk-OGK7LMYT.js} +6 -6
  47. package/dist/bundle/{chunk-N6P55LDU.js → chunk-P547HU26.js} +10 -10
  48. package/dist/bundle/{chunk-NBQQ2ZTF.js → chunk-P62Z3Q35.js} +14 -14
  49. package/dist/bundle/{chunk-TZGQPTZ2.js → chunk-PQLBPYJR.js} +1 -1
  50. package/dist/bundle/{chunk-BYQ3Z6UL.js → chunk-Q5EYTU3Q.js} +3 -3
  51. package/dist/bundle/{chunk-PSXAC6OO.js → chunk-QWRBAQZ7.js} +1 -1
  52. package/dist/bundle/{chunk-QB54TE52.js → chunk-QZXHMQCM.js} +1 -1
  53. package/dist/bundle/{chunk-FYMQPAE5.js → chunk-RE5SEGSR.js} +4 -4
  54. package/dist/bundle/{chunk-KVN4RY7E.js → chunk-UHHARH5X.js} +421 -205
  55. package/dist/bundle/{chunk-44LVUMS2.js → chunk-UJEO3VWA.js} +1 -1
  56. package/dist/bundle/{chunk-IXYKM7OJ.js → chunk-UMWR5PKA.js} +13 -13
  57. package/dist/bundle/{chunk-WL7CYT7O.js → chunk-V5ZID7KC.js} +1 -1
  58. package/dist/bundle/{chunk-2TTCKOQ7.js → chunk-VA3JKERH.js} +2 -2
  59. package/dist/bundle/{chunk-G2WDY5XB.js → chunk-VERSKGJV.js} +2 -2
  60. package/dist/bundle/{chunk-GUFWLTOW.js → chunk-W643XZIR.js} +2 -2
  61. package/dist/bundle/{chunk-X37KLD23.js → chunk-WBJQEB6E.js} +12 -12
  62. package/dist/bundle/{chunk-SYBMOE6F.js → chunk-WVWNKZI4.js} +6195 -5014
  63. package/dist/bundle/chunk-X5XIFNTI.js +35 -0
  64. package/dist/bundle/{chunk-LIQ5LICB.js → chunk-XPREXN3W.js} +3 -3
  65. package/dist/bundle/{chunk-35Y3INBK.js → chunk-XRJIQC6P.js} +2 -2
  66. package/dist/bundle/{chunk-T3AGR4TI.js → chunk-YG4OI3HJ.js} +966 -204
  67. package/dist/bundle/{chunk-HVVLSCFB.js → chunk-ZCPUKUST.js} +1 -1
  68. package/dist/bundle/command-contract-B3OGAIDB.js +34 -0
  69. package/dist/bundle/{decode-FM4C2WWG.js → decode-X7Y2VSYZ.js} +5 -5
  70. package/dist/bundle/{dispatch-K3HG4RYT.js → dispatch-OWNO2CMC.js} +8 -8
  71. package/dist/bundle/{dist-7LNVI7VB.js → dist-L7FNC74Q.js} +42 -13
  72. package/dist/bundle/{echarts-5C2A72XM.js → echarts-5AB3LFVD.js} +2 -2
  73. package/dist/bundle/{embed-N56P6YVY.js → embed-VBS5LRCE.js} +6 -6
  74. package/dist/bundle/{embedder-QLYKFLOL.js → embedder-VFSYBDKK.js} +9 -9
  75. package/dist/bundle/{failure-5ZLVZTRU.js → failure-E534GZDF.js} +2 -2
  76. package/dist/bundle/{first-run-VMF4PJ7Q.js → first-run-NO2ODH2W.js} +11 -11
  77. package/dist/bundle/first-screen-7VJLGMJJ.js +32 -0
  78. package/dist/bundle/{instructions-QA5FHDOJ.js → instructions-52W6ZQTU.js} +1 -1
  79. package/dist/bundle/mail.js +12 -12
  80. package/dist/bundle/{mcp-LO2XDBBC.js → mcp-MNI62HHE.js} +2 -2
  81. package/dist/bundle/{node-OXJZWUYZ.js → node-TL2PBNKO.js} +2 -2
  82. package/dist/bundle/{node-sqlite-7GCEI67B.js → node-sqlite-757HNQAD.js} +11 -5
  83. package/dist/bundle/{oauth-VTPIYBTP.js → oauth-VDRNJ7KN.js} +7 -7
  84. package/dist/bundle/{open-7XX3YF2X.js → open-NUWYOKPO.js} +5 -4
  85. package/dist/bundle/{openai-D3KRCXSY.js → openai-YLBFVK5X.js} +14 -14
  86. package/dist/bundle/{process-KFI7SXQD.js → process-PWAGP6YY.js} +1 -1
  87. package/dist/bundle/{program-4B25STRN.js → program-PPUPVL7O.js} +2253 -885
  88. package/dist/bundle/{prompt-TBZT3APW.js → prompt-M5U66RVJ.js} +5 -5
  89. package/dist/bundle/{recognize-WQSE5ZPL.js → recognize-DCMDZA2U.js} +4 -4
  90. package/dist/bundle/{remote-J5HHRNVQ.js → remote-4SHI5WJG.js} +7 -7
  91. package/dist/bundle/{rerank-DP2Y3WDT.js → rerank-DYMZMNPQ.js} +7 -7
  92. package/dist/bundle/{serve-VXPOQDQO.js → serve-HO3WME4G.js} +11 -10
  93. package/dist/bundle/server-244FHPY4.js +64 -0
  94. package/dist/bundle/{server-OSBNGA2F.js → server-R3TIPRZN.js} +39 -37
  95. package/dist/bundle/{sqlite-runtime-XY32WOIT.js → sqlite-runtime-DWRITUIH.js} +6 -5
  96. package/dist/bundle/{state-KPOPMR6O.js → state-QOMUDOGF.js} +6 -6
  97. package/dist/bundle/{store-FWRGNGP3.js → store-LHHMOE5V.js} +36 -18
  98. package/dist/bundle/{store-UBI2YCRC.js → store-RGO6IABA.js} +17 -13
  99. package/dist/bundle/store-maintenance-command-LU2ZBDUY.js +54 -0
  100. package/dist/commands/session.js +1 -1
  101. package/dist/commands/session.js.map +1 -1
  102. package/dist/commands/status.d.ts.map +1 -1
  103. package/dist/commands/status.js +12 -7
  104. package/dist/commands/status.js.map +1 -1
  105. package/dist/config.d.ts +2 -0
  106. package/dist/config.d.ts.map +1 -1
  107. package/dist/version.d.ts +1 -1
  108. package/dist/version.js +1 -1
  109. package/package.json +3 -3
  110. package/dist/bundle/chunk-MDIRW3AT.js +0 -18
  111. package/dist/bundle/command-contract-TW44FY47.js +0 -33
  112. package/dist/bundle/first-screen-ZN7ODW5K.js +0 -31
  113. package/dist/bundle/server-XHWSCXVX.js +0 -62
  114. package/dist/bundle/store-maintenance-command-3ZXPEIGF.js +0 -52
  115. /package/dist/bundle/{chunk-MRLSUCHT.js → chunk-NUN6OGOV.js} +0 -0
@@ -2,19 +2,22 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  renderMessages
5
- } from "./chunk-GUFWLTOW.js";
5
+ } from "./chunk-W643XZIR.js";
6
6
  import {
7
7
  answerOf,
8
8
  messengerContext
9
- } from "./chunk-GAIVTJ3E.js";
9
+ } from "./chunk-IPKXRW6W.js";
10
10
  import {
11
+ FETCHING,
11
12
  RULES_VERSION,
12
13
  applyTaskRulesOnArrival,
14
+ capability,
13
15
  chatEventAnswer,
14
16
  memberAnswer,
15
17
  newSendId,
16
18
  onlineDeps,
17
19
  openRequestTask,
20
+ patiently,
18
21
  pollVoteAnswer,
19
22
  queryTerms,
20
23
  senderIsMe,
@@ -23,19 +26,19 @@ import {
23
26
  syncsOneChat,
24
27
  typedQuery,
25
28
  withQuery
26
- } from "./chunk-SYBMOE6F.js";
29
+ } from "./chunk-WVWNKZI4.js";
27
30
  import {
28
31
  checkedOptions,
29
32
  range
30
- } from "./chunk-S64N24ON.js";
33
+ } from "./chunk-I62OTHDE.js";
31
34
  import {
32
35
  messagesFor,
33
36
  systemFor,
34
37
  validateImages
35
- } from "./chunk-OHC4GVWV.js";
38
+ } from "./chunk-6EZ7XGRG.js";
36
39
  import {
37
40
  readSecret
38
- } from "./chunk-LIQ5LICB.js";
41
+ } from "./chunk-XPREXN3W.js";
39
42
  import {
40
43
  Command,
41
44
  LOCAL_READ,
@@ -56,29 +59,30 @@ import {
56
59
  modelTarget,
57
60
  nextStep,
58
61
  outputFor,
62
+ parseDuration,
59
63
  recalledAccount,
60
64
  recordLogFor,
61
65
  renderAnswer,
62
66
  snakeKeys,
63
67
  storeTable,
64
68
  withoutProviderRefs
65
- } from "./chunk-T3AGR4TI.js";
69
+ } from "./chunk-YG4OI3HJ.js";
66
70
  import {
67
71
  levelFor
68
- } from "./chunk-AJ4JS2ZR.js";
72
+ } from "./chunk-7LDC275M.js";
69
73
  import {
70
74
  failureKey
71
- } from "./chunk-SW5NVASW.js";
75
+ } from "./chunk-2KVR7FF3.js";
72
76
  import {
73
77
  holdLock,
74
78
  lockPath,
75
79
  releaseLock,
76
80
  servingProfiles,
77
81
  takeLock
78
- } from "./chunk-BYQ3Z6UL.js";
82
+ } from "./chunk-Q5EYTU3Q.js";
79
83
  import {
80
84
  holdersOf
81
- } from "./chunk-44LVUMS2.js";
85
+ } from "./chunk-UJEO3VWA.js";
82
86
  import {
83
87
  MIGRATIONS,
84
88
  drainNoteIndex,
@@ -105,26 +109,26 @@ import {
105
109
  storeClients,
106
110
  storeContents,
107
111
  vectorIndexCounts
108
- } from "./chunk-IWHXM2S7.js";
112
+ } from "./chunk-KLLKDOO2.js";
109
113
  import {
110
114
  formatLocator,
111
115
  parseLocator
112
- } from "./chunk-YRZ23RCS.js";
116
+ } from "./chunk-MXG4L7NH.js";
113
117
  import {
114
118
  queryFieldsOf
115
- } from "./chunk-KVN4RY7E.js";
119
+ } from "./chunk-UHHARH5X.js";
116
120
  import {
117
121
  storePath
118
- } from "./chunk-MDIRW3AT.js";
122
+ } from "./chunk-X5XIFNTI.js";
119
123
  import {
120
124
  openCache
121
- } from "./chunk-K2F7YMMM.js";
125
+ } from "./chunk-E7BTD4P6.js";
122
126
  import {
123
127
  Credentials,
124
128
  pathsAreOverridden,
125
129
  resolvePaths,
126
130
  writeSecurely
127
- } from "./chunk-JAWJZTFL.js";
131
+ } from "./chunk-3EAAEF5U.js";
128
132
  import {
129
133
  array,
130
134
  boolean,
@@ -148,10 +152,10 @@ import {
148
152
  transform,
149
153
  trim,
150
154
  union
151
- } from "./chunk-NSDOYHIS.js";
155
+ } from "./chunk-IVDUR5Y4.js";
152
156
  import {
153
157
  CliError
154
- } from "./chunk-4DPICEPQ.js";
158
+ } from "./chunk-CCHHEMPM.js";
155
159
  import {
156
160
  __commonJS,
157
161
  __name,
@@ -5491,11 +5495,11 @@ var require_liquid_node = __commonJS({
5491
5495
  }
5492
5496
  });
5493
5497
 
5494
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
5498
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
5495
5499
  import { chmodSync, constants, copyFileSync, existsSync as existsSync7, mkdirSync, realpathSync, renameSync as renameSync2, rmSync as rmSync2, statfsSync, statSync as statSync3, writeFileSync } from "node:fs";
5496
5500
  import { dirname, resolve } from "node:path";
5497
5501
 
5498
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/sealed.js
5502
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/sealed.js
5499
5503
  import { createCipheriv, createDecipheriv, createHash, randomBytes, scrypt, timingSafeEqual } from "node:crypto";
5500
5504
  import { closeSync, createReadStream, createWriteStream, existsSync, openSync, readSync, renameSync, rmSync, statSync } from "node:fs";
5501
5505
  import { Transform } from "node:stream";
@@ -5602,7 +5606,7 @@ var unsealFile = /* @__PURE__ */ __name(async (from, to, password) => {
5602
5606
  renameSync(pending, to);
5603
5607
  }, "unsealFile");
5604
5608
 
5605
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/store/compatibility.js
5609
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/compatibility.js
5606
5610
  var SPEAKS = MIGRATIONS.at(-1)?.version ?? 0;
5607
5611
  var fileSchemaOf = /* @__PURE__ */ __name((database) => {
5608
5612
  const tracked = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'schema_migrations'").get();
@@ -5626,7 +5630,7 @@ var compatibilityOf = /* @__PURE__ */ __name((file2, migrations = MIGRATIONS) =>
5626
5630
  };
5627
5631
  }, "compatibilityOf");
5628
5632
 
5629
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/store/repair.js
5633
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/repair.js
5630
5634
  import { createHash as createHash2 } from "node:crypto";
5631
5635
  var COPY_MARK = "__repair_";
5632
5636
  var COPY_NAME = /__repair_[0-9a-f]{8}(_\d+)?$/;
@@ -5880,7 +5884,7 @@ var deleteCopy = /* @__PURE__ */ __name((database, name) => {
5880
5884
  return found;
5881
5885
  }, "deleteCopy");
5882
5886
 
5883
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/cli/store-info.js
5887
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/cli/store-info.js
5884
5888
  import { existsSync as existsSync2, statSync as statSync2 } from "node:fs";
5885
5889
  var pendingIfKnown = /* @__PURE__ */ __name((database) => database.prepare("SELECT 1 FROM pragma_table_info('messages') WHERE name = 'normalized_text'").get() ? pendingNormalization(database) : null, "pendingIfKnown");
5886
5890
  var bytesOf = /* @__PURE__ */ __name((path) => existsSync2(path) ? statSync2(path).size : 0, "bytesOf");
@@ -5927,7 +5931,7 @@ var storeInfoCommand = /* @__PURE__ */ __name(() => annotate(new Command("info")
5927
5931
  renderAnswer(this, outputFor(this), itemOf(answer));
5928
5932
  }), "storeInfoCommand");
5929
5933
 
5930
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
5934
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
5931
5935
  var ENCRYPT_OPTION = [
5932
5936
  "--encrypt",
5933
5937
  "compress and encrypt with a password, typed at a hidden prompt or piped on stdin; it is never kept \u2014 lose it and the file cannot be opened"
@@ -5946,7 +5950,7 @@ var passwordOf = /* @__PURE__ */ __name(async (command, { twice }) => {
5946
5950
  return password;
5947
5951
  }, "passwordOf");
5948
5952
 
5949
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/replies/rules.js
5953
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/replies/rules.js
5950
5954
  import { existsSync as existsSync3, readFileSync } from "node:fs";
5951
5955
  import { join } from "node:path";
5952
5956
  var REPLY_ACTIONS = ["reply", "task"];
@@ -6117,7 +6121,7 @@ var problem = /* @__PURE__ */ __name((issue) => {
6117
6121
  }, "problem");
6118
6122
  var broken = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply rules ${path} cannot be read (${why}) \u2014 fix the file`), "broken");
6119
6123
 
6120
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/replies/state.js
6124
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/replies/state.js
6121
6125
  import { existsSync as existsSync4, readFileSync as readFileSync2 } from "node:fs";
6122
6126
  import { join as join2 } from "node:path";
6123
6127
  var ANSWERED_KEPT = 1e3;
@@ -6170,7 +6174,7 @@ var recordReply = /* @__PURE__ */ __name((state, rule2, message, now) => {
6170
6174
  }, "recordReply");
6171
6175
  var broken2 = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply state ${path} cannot be read (${why}) \u2014 fix or move the file`), "broken");
6172
6176
 
6173
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/replies/decide.js
6177
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/replies/decide.js
6174
6178
  var skip = /* @__PURE__ */ __name((why) => ({ skip: why }), "skip");
6175
6179
  var decide = /* @__PURE__ */ __name((rule2, incoming, state, now) => {
6176
6180
  const { message, chat, owner, sender } = incoming;
@@ -6276,7 +6280,7 @@ var filled = /* @__PURE__ */ __name((template2, senderName) => {
6276
6280
  return template2.replaceAll("{firstName}", name.split(/\s+/)[0] ?? name).replaceAll("{name}", name);
6277
6281
  }, "filled");
6278
6282
 
6279
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/replies/template.js
6283
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/replies/template.js
6280
6284
  var import_liquidjs = __toESM(require_liquid_node(), 1);
6281
6285
  var TEMPLATE_LIMITS = {
6282
6286
  parse: 32768,
@@ -6436,7 +6440,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
6436
6440
  }
6437
6441
  }, "renderReplyTemplate");
6438
6442
 
6439
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
6443
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
6440
6444
  var DRY_RUN_DAYS = 7;
6441
6445
  var PAGE = 500;
6442
6446
  var dryRun = /* @__PURE__ */ __name(async (store, account, rules, { since, until = Date.now(), only, audience, render }) => {
@@ -6550,7 +6554,7 @@ var storedSince = /* @__PURE__ */ __name(async (store, account, chat, since) =>
6550
6554
  }
6551
6555
  }, "storedSince");
6552
6556
 
6553
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
6557
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
6554
6558
  var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
6555
6559
  const host = new URL(baseUrl).host;
6556
6560
  return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
@@ -6581,7 +6585,7 @@ var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) =>
6581
6585
  };
6582
6586
  }, "embeddingKeys");
6583
6587
 
6584
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/models/openai.js
6588
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/models/openai.js
6585
6589
  var options = strictObject({
6586
6590
  temperature: range(0, 2),
6587
6591
  top_p: range(0, 1),
@@ -6630,7 +6634,7 @@ var openai = {
6630
6634
  }, "complete")
6631
6635
  };
6632
6636
 
6633
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/models/index.js
6637
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/models/index.js
6634
6638
  var modelGateway = /* @__PURE__ */ __name((deps) => ({
6635
6639
  complete: /* @__PURE__ */ __name(async (request) => {
6636
6640
  if (deps.signal?.aborted)
@@ -6645,7 +6649,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
6645
6649
  if (!adapter && target.provider === "openai")
6646
6650
  adapter = openai;
6647
6651
  if (!adapter && target.provider === "anthropic")
6648
- adapter = (await import("./anthropic-3AXHD4WH.js")).anthropic;
6652
+ adapter = (await import("./anthropic-SNA6PTVO.js")).anthropic;
6649
6653
  if (!adapter)
6650
6654
  throw new CliError("validation_error", `no model adapter for ${target.provider}`);
6651
6655
  if (request.images !== void 0 && adapter.images !== true)
@@ -6686,7 +6690,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
6686
6690
  }, "complete")
6687
6691
  }), "modelGateway");
6688
6692
 
6689
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/replies/consents.js
6693
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/replies/consents.js
6690
6694
  import { existsSync as existsSync5, readFileSync as readFileSync3 } from "node:fs";
6691
6695
  import { join as join3 } from "node:path";
6692
6696
  var shape = strictObject({
@@ -6711,7 +6715,7 @@ var mayModelReply = /* @__PURE__ */ __name((path, provider, chat) => {
6711
6715
  return consent.provider === provider && !consent.deniedChats.includes(chat);
6712
6716
  }, "mayModelReply");
6713
6717
 
6714
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/replies/rendering.js
6718
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/replies/rendering.js
6715
6719
  var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, options2 = {
6716
6720
  ai: true
6717
6721
  }) => async (rule2, message, chat, now) => {
@@ -6758,7 +6762,7 @@ var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, o
6758
6762
  return result2;
6759
6763
  }, "replyRenderer");
6760
6764
 
6761
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/replies/serve.js
6765
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/replies/serve.js
6762
6766
  var NOT_ALLOWED = "replies.send is not allow";
6763
6767
  var NO_RULES = "no rules";
6764
6768
  var ONLY_TASK = "opened a task, sent nothing";
@@ -6851,7 +6855,84 @@ var replyTo = /* @__PURE__ */ __name(async (deps, message) => {
6851
6855
  return { skip: why };
6852
6856
  }, "replyTo");
6853
6857
 
6854
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
6858
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-catch-up.js
6859
+ var START_SYNC_DELAY_MS = 3e4;
6860
+ var START_SYNC_BUDGET_MS = 5 * 6e4;
6861
+ var START_SYNC_WINDOW_MS = 7 * 864e5;
6862
+ var START_SYNC_PER_CHAT = 500;
6863
+ 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 }) => {
6864
+ const controller = new AbortController();
6865
+ let timer;
6866
+ let pass = Promise.resolve();
6867
+ let started = false;
6868
+ let done;
6869
+ const run = /* @__PURE__ */ __name(async () => {
6870
+ const stop = AbortSignal.any([controller.signal, AbortSignal.timeout(budgetMs)]);
6871
+ const floor = now() - windowMs;
6872
+ const moved = [];
6873
+ for (const chat of await chats(stop)) {
6874
+ const lastAt = Date.parse(chat.lastMessageAt ?? "");
6875
+ if (Number.isNaN(lastAt) || lastAt < floor)
6876
+ continue;
6877
+ moved.push({ chat, lastAt, held: await newestHeld(chat.id) });
6878
+ }
6879
+ const anywhere = moved.reduce((top, { held }) => held === void 0 ? top : Math.max(top, held), -Infinity);
6880
+ if (!Number.isFinite(anywhere))
6881
+ return;
6882
+ const behind = moved.filter(({ lastAt, held }) => lastAt > (held ?? anywhere)).sort((one, other) => other.lastAt - one.lastAt);
6883
+ if (behind.length === 0)
6884
+ return;
6885
+ const summary = { chats: 0, fetched: 0, failed: 0, stopped: false };
6886
+ done = summary;
6887
+ for (const { chat, held } of behind) {
6888
+ if (stop.aborted)
6889
+ break;
6890
+ try {
6891
+ summary.fetched += (await fetch2(chat.id, Math.max(held ?? anywhere, floor), stop)).fetched;
6892
+ summary.chats += 1;
6893
+ } catch (error) {
6894
+ if (stop.aborted)
6895
+ break;
6896
+ summary.failed += 1;
6897
+ const errorCode = failureKey(error);
6898
+ warn({
6899
+ code: "start_sync_chat_failed",
6900
+ chatId: chat.id,
6901
+ errorCode,
6902
+ text: `what ${chat.id} received while serve was down was not fetched: ${errorCode}`
6903
+ });
6904
+ }
6905
+ }
6906
+ summary.stopped = stop.aborted && summary.chats + summary.failed < behind.length;
6907
+ note({
6908
+ code: "start_sync",
6909
+ 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` : "")
6910
+ });
6911
+ }, "run");
6912
+ return {
6913
+ start: /* @__PURE__ */ __name(() => {
6914
+ if (started || controller.signal.aborted)
6915
+ return;
6916
+ started = true;
6917
+ timer = setTimeout(() => {
6918
+ pass = run().catch((error) => {
6919
+ if (controller.signal.aborted)
6920
+ return;
6921
+ const errorCode = failureKey(error);
6922
+ warn({ code: "start_sync_failed", errorCode, text: `the catch-up on start failed: ${errorCode}` });
6923
+ });
6924
+ }, delayMs);
6925
+ }, "start"),
6926
+ stop: /* @__PURE__ */ __name(async () => {
6927
+ controller.abort();
6928
+ clearTimeout(timer);
6929
+ await pass;
6930
+ }, "stop"),
6931
+ summary: /* @__PURE__ */ __name(() => done, "summary")
6932
+ };
6933
+ }, "startSync");
6934
+
6935
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
6855
6936
  var FIRST_FETCH_MS = 6e4;
6856
6937
  var DAY_MS = 864e5;
6857
6938
  var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, firstMs = FIRST_FETCH_MS, everyMs = DAY_MS }) => {
@@ -6905,7 +6986,7 @@ var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, fi
6905
6986
  };
6906
6987
  }, "memberFetches");
6907
6988
 
6908
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
6989
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
6909
6990
  var record2 = /* @__PURE__ */ __name((context, app, severity, attributes) => recordLogFor(context.streams.diagnostic, app, { command: currentRun().command || "serve" })[severity](attributes), "record");
6910
6991
  var noticeFor = /* @__PURE__ */ __name((context, app, severity = "warn") => ({ text, ...attributes }) => {
6911
6992
  if (context.format === "pretty") {
@@ -6938,7 +7019,7 @@ var recordDiagnostics = /* @__PURE__ */ __name((context, app) => {
6938
7019
  return context;
6939
7020
  }, "recordDiagnostics");
6940
7021
 
6941
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
7022
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
6942
7023
  var STEMS_EVERY_MS = 3e4;
6943
7024
  var STEMS_SLICE_MS = 2e3;
6944
7025
  var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY_MS, sliceMs = STEMS_SLICE_MS }) => {
@@ -6978,7 +7059,7 @@ var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY
6978
7059
  };
6979
7060
  }, "stemFills");
6980
7061
 
6981
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
7062
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
6982
7063
  var defined = /* @__PURE__ */ __name((value) => Object.fromEntries(Object.entries(value).filter(([, one]) => one !== void 0)), "defined");
6983
7064
  var attachmentItem = /* @__PURE__ */ __name((attachment) => defined({
6984
7065
  kind: attachment.kind,
@@ -7073,7 +7154,7 @@ var viewOf = /* @__PURE__ */ __name((context, messenger) => ({
7073
7154
  locale: messenger.app.locale
7074
7155
  }), "viewOf");
7075
7156
 
7076
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
7157
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
7077
7158
  var observed = /* @__PURE__ */ __name((value) => ({
7078
7159
  value: value.value,
7079
7160
  observed_at: value.observedAt,
@@ -7140,7 +7221,7 @@ var watchEventItem = /* @__PURE__ */ __name((value, account) => {
7140
7221
  }
7141
7222
  }, "watchEventItem");
7142
7223
 
7143
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
7224
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
7144
7225
  var watchCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("watch"), {
7145
7226
  output: { entity: "watch_item" },
7146
7227
  effects: REMOTE_READ,
@@ -7295,7 +7376,7 @@ var describe = /* @__PURE__ */ __name((event, render) => {
7295
7376
  }
7296
7377
  }, "describe");
7297
7378
 
7298
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
7379
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
7299
7380
  var serveCommand = /* @__PURE__ */ __name((messenger) => {
7300
7381
  const command = annotate(new Command("serve"), {
7301
7382
  output: { entity: "serve_summary" },
@@ -7338,7 +7419,7 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
7338
7419
  const counts = {};
7339
7420
  const rules = replying(context, messenger, Date.parse(startedAt));
7340
7421
  const tasks = tasking(context, warn);
7341
- const { handled } = environmentOf(this);
7422
+ const { handled, startSyncDelayMs } = environmentOf(this);
7342
7423
  const count3 = /* @__PURE__ */ __name((event) => {
7343
7424
  counts[event.event] = (counts[event.event] ?? 0) + 1;
7344
7425
  if (event.event === "message") {
@@ -7362,6 +7443,50 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
7362
7443
  }).chats.fetchMembers(chatId, {}), "fetch"),
7363
7444
  warn
7364
7445
  });
7446
+ const fetching = messenger.fetching ?? FETCHING;
7447
+ const catchingUp = startSync({
7448
+ chats: /* @__PURE__ */ __name(async (stop) => {
7449
+ const list = capability(connection, "chats", "list its chats");
7450
+ const all = [];
7451
+ for (let offset = 0; ; ) {
7452
+ const page = await patiently(() => list({ offset, limit: 100 }), context.renderer.note, stop);
7453
+ for (const chat of page.items)
7454
+ all.push(chat);
7455
+ offset += page.items.length;
7456
+ if (!page.hasMore || page.items.length === 0)
7457
+ return all;
7458
+ }
7459
+ }, "chats"),
7460
+ newestHeld: /* @__PURE__ */ __name((chatId) => context.withStore(async (store, account) => {
7461
+ const [newest] = await store.messages.messagesWindow(account, chatId, {
7462
+ at: startedAt,
7463
+ before: 1,
7464
+ after: 0
7465
+ });
7466
+ return newest ? Date.parse(newest.timestamp) : void 0;
7467
+ }, { name: "serve catch-up" }), "newestHeld"),
7468
+ fetch: /* @__PURE__ */ __name((chatId, sinceMs, stop) => context.withStore((store, account) => servicesFor({
7469
+ ...onlineDeps(messenger, connection, context.guard, {
7470
+ profile: context.profile,
7471
+ env: context.env
7472
+ }),
7473
+ store: /* @__PURE__ */ __name(async () => store, "store"),
7474
+ account: /* @__PURE__ */ __name(async () => account, "account")
7475
+ }).archive.fetch(chatId, {
7476
+ limit: START_SYNC_PER_CHAT,
7477
+ pageSize: fetching.page,
7478
+ pauseMs: parseDuration(fetching.pause, "pause"),
7479
+ sinceMs,
7480
+ catchUp: false,
7481
+ note: context.renderer.note,
7482
+ stop,
7483
+ onPage: /* @__PURE__ */ __name(() => {
7484
+ }, "onPage")
7485
+ }), { name: "serve catch-up" }), "fetch"),
7486
+ note,
7487
+ warn,
7488
+ ...startSyncDelayMs === void 0 ? {} : { delayMs: startSyncDelayMs }
7489
+ });
7365
7490
  const stems = stemFills({
7366
7491
  withStore: /* @__PURE__ */ __name((work) => context.withStore((store) => work(store), { name: "serve stems" }), "withStore"),
7367
7492
  warn
@@ -7376,12 +7501,15 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
7376
7501
  rules.connected(open);
7377
7502
  members.start();
7378
7503
  stems.start();
7504
+ if (messenger.history !== "store" && typeof open.chats === "function")
7505
+ catchingUp.start();
7379
7506
  }, "connected")
7380
7507
  });
7381
7508
  } finally {
7382
7509
  await relaying;
7383
7510
  await relay?.close();
7384
7511
  rules.stop();
7512
+ await catchingUp.stop();
7385
7513
  await members.stop();
7386
7514
  await stems.stop();
7387
7515
  await rules.settled();
@@ -7396,6 +7524,7 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
7396
7524
  ...rules.summary(),
7397
7525
  ...members.summary().fetched + members.summary().failed > 0 ? { members: members.summary() } : {},
7398
7526
  ...stems.summary().stemmed > 0 ? { stems: stems.summary() } : {},
7527
+ ...catchingUp.summary() ? { caught_up: catchingUp.summary() } : {},
7399
7528
  ...tasks.summary()
7400
7529
  }));
7401
7530
  });
@@ -7511,7 +7640,7 @@ var tasking = /* @__PURE__ */ __name((context, warn) => {
7511
7640
  };
7512
7641
  }, "tasking");
7513
7642
 
7514
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
7643
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
7515
7644
  import { existsSync as existsSync6 } from "node:fs";
7516
7645
  var PATH = "store tables list";
7517
7646
  var STORE_TABLES_QUERY = {
@@ -7554,7 +7683,7 @@ var storeTablesCommand = /* @__PURE__ */ __name((messenger) => {
7554
7683
  return tables;
7555
7684
  }, "storeTablesCommand");
7556
7685
 
7557
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
7686
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
7558
7687
  var SEARCH_INDEXES = ["messages_fts", "chats_fts", "identities_fts"];
7559
7688
  var WORD_INDEX = "message_words";
7560
7689
  var schemaOf = /* @__PURE__ */ __name((database) => {
@@ -5,23 +5,23 @@ import {
5
5
  installFiles,
6
6
  megabytes,
7
7
  sharedModelsDirectory
8
- } from "./chunk-6LNRNQHJ.js";
8
+ } from "./chunk-F5SZVO3A.js";
9
9
  import {
10
10
  importFrom
11
11
  } from "./chunk-Y5E2WNWB.js";
12
12
  import {
13
13
  CliError
14
- } from "./chunk-4DPICEPQ.js";
14
+ } from "./chunk-CCHHEMPM.js";
15
15
  import {
16
16
  __name
17
17
  } from "./chunk-ZVVMGPBJ.js";
18
18
 
19
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/embeddings/embed.js
19
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/embeddings/embed.js
20
20
  import { readFileSync as readFileSync2 } from "node:fs";
21
21
  import { availableParallelism } from "node:os";
22
22
  import { basename, join as join2 } from "node:path";
23
23
 
24
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/embeddings/onnx-runtime.js
24
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/embeddings/onnx-runtime.js
25
25
  import { createHash } from "node:crypto";
26
26
  import { copyFileSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
27
27
  import { join } from "node:path";
@@ -678,7 +678,7 @@ var Unzip = /* @__PURE__ */ (function() {
678
678
  return Unzip2;
679
679
  })();
680
680
 
681
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/embeddings/onnx-runtime.js
681
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/embeddings/onnx-runtime.js
682
682
  var ONNX_RUNTIME_VERSION = "1.30.0";
683
683
  var release = /* @__PURE__ */ __name((name, sha256, bytes) => ({
684
684
  name,
@@ -858,7 +858,7 @@ var openSession = /* @__PURE__ */ __name(async (bytes, threads, options = {}) =>
858
858
  return { ort, session: await ort.InferenceSession.create(bytes, options) };
859
859
  }, "openSession");
860
860
 
861
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/embeddings/embed.js
861
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/embeddings/embed.js
862
862
  var textModelsDirectory = /* @__PURE__ */ __name((env = process.env) => sharedModelsDirectory("text", env), "textModelsDirectory");
863
863
  var placedText = /* @__PURE__ */ __name((model, directory) => model.files.map((file) => [file, join2(directory, model.id, file.name)]), "placedText");
864
864
  var isTextModelInstalled = /* @__PURE__ */ __name((model, directory) => filesPresent(placedText(model, directory)), "isTextModelInstalled");
@@ -2,17 +2,17 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  LEVELS
5
- } from "./chunk-AJ4JS2ZR.js";
5
+ } from "./chunk-7LDC275M.js";
6
6
  import {
7
7
  looksLikeReference,
8
8
  parseReference,
9
9
  providerLabel,
10
10
  providerNamed
11
- } from "./chunk-YRZ23RCS.js";
11
+ } from "./chunk-MXG4L7NH.js";
12
12
  import {
13
13
  resolvePaths,
14
14
  writeSecurely
15
- } from "./chunk-JAWJZTFL.js";
15
+ } from "./chunk-3EAAEF5U.js";
16
16
  import {
17
17
  array,
18
18
  getDotPath,
@@ -31,17 +31,17 @@ import {
31
31
  string,
32
32
  transform,
33
33
  unknown
34
- } from "./chunk-NSDOYHIS.js";
34
+ } from "./chunk-IVDUR5Y4.js";
35
35
  import {
36
36
  CliError,
37
37
  singleLine,
38
38
  visibleControls
39
- } from "./chunk-4DPICEPQ.js";
39
+ } from "./chunk-CCHHEMPM.js";
40
40
  import {
41
41
  __name
42
42
  } from "./chunk-ZVVMGPBJ.js";
43
43
 
44
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/domain/ref-arguments.js
44
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/ref-arguments.js
45
45
  var TAKES = {
46
46
  chat: "a chat: chat:<provider>/<account>/<chat>, its id or its title",
47
47
  message: "a message: msg:<provider>/<account>/<chat>/<message>, or a chat and the message's id"
@@ -101,7 +101,7 @@ var ensureAccount = /* @__PURE__ */ __name(async (reference, scope, profilesOn)
101
101
  throw wrongAccount(reference, scope, profiles);
102
102
  }, "ensureAccount");
103
103
 
104
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/resolve.js
104
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/resolve.js
105
105
  var isId = /* @__PURE__ */ __name((reference) => /^-?\d+$/.test(reference.trim()), "isId");
106
106
  var foldName = /* @__PURE__ */ __name((name) => name.normalize("NFC").replace(/[\uFE0E\uFE0F\u200D]/g, "").toLowerCase(), "foldName");
107
107
  var pickChat = /* @__PURE__ */ __name((reference, chats) => {
@@ -146,7 +146,7 @@ ${lines}`, { candidates });
146
146
  }, "ambiguous");
147
147
  var isPresent = /* @__PURE__ */ __name((value) => value !== null && value !== void 0, "isPresent");
148
148
 
149
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/domain/formatting.js
149
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/formatting.js
150
150
  var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "the messenger formatter returned invalid text spans"), "invalid");
151
151
  var validateFormattedText = /* @__PURE__ */ __name((formatted) => {
152
152
  const { text, spans } = formatted;
@@ -206,7 +206,7 @@ var visibleFormattedText = /* @__PURE__ */ __name((formatted) => {
206
206
  };
207
207
  }, "visibleFormattedText");
208
208
 
209
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/moderation/check.js
209
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/moderation/check.js
210
210
  var INVITE = /max\.ru\/join\/|(t|telegram)\.me\/(\+|joinchat\/)|tg:\/\/join/i;
211
211
  var LINK = /https?:\/\/\S+/i;
212
212
  var STRENGTH = { report: 0, delete: 1, remove: 2 };
@@ -394,7 +394,7 @@ var nextPoint = /* @__PURE__ */ __name((rows, found) => {
394
394
  }, "nextPoint");
395
395
  var someUndone = /* @__PURE__ */ __name((rows) => rows.some(undone), "someUndone");
396
396
 
397
- // node_modules/.pnpm/@wirecat+cli-core@0.550.0_@wirecat+cli-base@0.74.0_commander@15.0.0_esbuild@0.28.2_type_14b809de162f39c654f85ad24a8cdf95/node_modules/@wirecat/cli-core/dist/moderation/rules.js
397
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/moderation/rules.js
398
398
  import { existsSync, readFileSync } from "node:fs";
399
399
  import { join } from "node:path";
400
400
  var RULE_ACTIONS = ["report", "delete", "remove"];