@wirecat/mail-cli 0.9.0 → 0.10.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 (151) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/bin/mail.js +2 -2
  3. package/dist/bundle/{all-profiles-X6ROLLMF.js → all-profiles-OJPRIFKU.js} +9 -9
  4. package/dist/bundle/{anthropic-MPARKCMJ.js → anthropic-3AXHD4WH.js} +6 -6
  5. package/dist/bundle/{app-server-JQ5XCXWT.js → app-server-V4KHCUGE.js} +45 -46
  6. package/dist/bundle/{bun-H7LT5433.js → bun-ISYNUTQJ.js} +2 -2
  7. package/dist/bundle/{bun-sqlite-AGK2BHAN.js → bun-sqlite-FH3D4AXL.js} +5 -5
  8. package/dist/bundle/{chunk-IYC3IHEZ.js → chunk-2TTCKOQ7.js} +2 -2
  9. package/dist/bundle/{chunk-5NYUCY5W.js → chunk-35Y3INBK.js} +2 -2
  10. package/dist/bundle/{chunk-UHBCL66Y.js → chunk-44LVUMS2.js} +1 -1
  11. package/dist/bundle/{chunk-U6BDAY55.js → chunk-4D52FA34.js} +1 -1
  12. package/dist/bundle/{chunk-L3KMVMRJ.js → chunk-4DPICEPQ.js} +2 -2
  13. package/dist/bundle/{chunk-6FBBDIX6.js → chunk-4GPPRLIG.js} +7 -42
  14. package/dist/bundle/{chunk-BNPCRWZ6.js → chunk-5TACUBRJ.js} +8 -8
  15. package/dist/bundle/{chunk-PC3AFEEA.js → chunk-6LNRNQHJ.js} +4 -4
  16. package/dist/bundle/{chunk-3LMWAO6A.js → chunk-6QNPJSRM.js} +6 -6
  17. package/dist/bundle/{chunk-PXQ7A5HQ.js → chunk-6UT3MXOB.js} +3 -3
  18. package/dist/bundle/{chunk-SEL7SJCM.js → chunk-AJ4JS2ZR.js} +36 -11
  19. package/dist/bundle/{chunk-RGM66WZ3.js → chunk-BYQ3Z6UL.js} +3 -3
  20. package/dist/bundle/{chunk-FEA5E7WQ.js → chunk-DN54W657.js} +2 -2
  21. package/dist/bundle/{chunk-J4MY3QIN.js → chunk-F3QDSQ7V.js} +34 -28
  22. package/dist/bundle/{chunk-YXQIZORE.js → chunk-FYMQPAE5.js} +4 -4
  23. package/dist/bundle/{chunk-2FDROA4Q.js → chunk-G2WDY5XB.js} +2 -2
  24. package/dist/bundle/{chunk-KWHFDVAF.js → chunk-GAIVTJ3E.js} +121 -32
  25. package/dist/bundle/{chunk-INVEYTAL.js → chunk-GFCNSU3B.js} +48 -48
  26. package/dist/bundle/{chunk-SYFBRZ5F.js → chunk-GUFWLTOW.js} +2 -2
  27. package/dist/bundle/{chunk-YLSV3WOO.js → chunk-GYNHU56E.js} +4 -4
  28. package/dist/bundle/{chunk-CHK3V7FG.js → chunk-HVVLSCFB.js} +1 -1
  29. package/dist/bundle/{chunk-4EFKQXA5.js → chunk-IG2WXKIT.js} +8 -8
  30. package/dist/bundle/{chunk-24MHYGNE.js → chunk-IWHXM2S7.js} +1620 -671
  31. package/dist/bundle/{chunk-TVZFDVZP.js → chunk-IXYKM7OJ.js} +13 -13
  32. package/dist/bundle/{chunk-ZISFMUYB.js → chunk-JAWJZTFL.js} +18 -18
  33. package/dist/bundle/{chunk-PEF637VV.js → chunk-JIIEJLAX.js} +4 -4
  34. package/dist/bundle/{chunk-DLB2JPLU.js → chunk-JNUKTAMZ.js} +1 -1
  35. package/dist/bundle/{chunk-25N52S7U.js → chunk-K2F7YMMM.js} +6 -6
  36. package/dist/bundle/{chunk-OZGDPG6I.js → chunk-KJP2B65C.js} +30 -30
  37. package/dist/bundle/{chunk-3Y7H3CXI.js → chunk-KQXLRAHT.js} +2 -5
  38. package/dist/bundle/{chunk-EUJTQY43.js → chunk-KVN4RY7E.js} +52 -53
  39. package/dist/bundle/{chunk-JZMPDFM4.js → chunk-L3PVAY3M.js} +2 -2
  40. package/dist/bundle/{chunk-64FN5JK6.js → chunk-LIQ5LICB.js} +3 -3
  41. package/dist/bundle/{chunk-DQHAXX33.js → chunk-LXHLQ6RK.js} +7 -7
  42. package/dist/bundle/{chunk-HZ42NO25.js → chunk-MDIRW3AT.js} +2 -2
  43. package/dist/bundle/{chunk-K3RWO7LR.js → chunk-N6P55LDU.js} +84 -8
  44. package/dist/bundle/{chunk-PTDJXPXG.js → chunk-NBQQ2ZTF.js} +19 -14
  45. package/dist/bundle/{chunk-NAIJNJZZ.js → chunk-NSDOYHIS.js} +10 -8
  46. package/dist/bundle/{chunk-VOGSDGVL.js → chunk-OHC4GVWV.js} +2 -2
  47. package/dist/bundle/{chunk-QO4K6R7K.js → chunk-PLPSFJO6.js} +6 -6
  48. package/dist/bundle/{chunk-3W6VSSQQ.js → chunk-PSXAC6OO.js} +1 -1
  49. package/dist/bundle/{chunk-4MIC7S7B.js → chunk-QB54TE52.js} +1 -1
  50. package/dist/bundle/{chunk-QXXBDW6N.js → chunk-QPQSMJBW.js} +10 -10
  51. package/dist/bundle/{chunk-SUB4DRMA.js → chunk-S64N24ON.js} +3 -3
  52. package/dist/bundle/{chunk-M55XFZMG.js → chunk-SW5NVASW.js} +9 -9
  53. package/dist/bundle/{chunk-N6YA4OQI.js → chunk-SYBMOE6F.js} +865 -838
  54. package/dist/bundle/{chunk-Z3TZTOR2.js → chunk-T3AGR4TI.js} +4840 -894
  55. package/dist/bundle/{chunk-JYVZDJNO.js → chunk-TTKNBUMT.js} +45 -5
  56. package/dist/bundle/{chunk-ROZBXOES.js → chunk-TZGQPTZ2.js} +1 -1
  57. package/dist/bundle/{chunk-FUDHVV4R.js → chunk-UDJIC6YL.js} +67 -30
  58. package/dist/bundle/{chunk-HWLAV2HM.js → chunk-V6K2GX2Y.js} +17 -17
  59. package/dist/bundle/{chunk-65SVO3T7.js → chunk-VEXXVLBM.js} +3 -3
  60. package/dist/bundle/{chunk-NTWORG4T.js → chunk-WL7CYT7O.js} +1 -1
  61. package/dist/bundle/{chunk-DL32PWLR.js → chunk-X37KLD23.js} +14 -14
  62. package/dist/bundle/{chunk-5PWKPRTD.js → chunk-XTIQFMZH.js} +4 -4
  63. package/dist/bundle/{chunk-GPCKNZIA.js → chunk-YDUES6ET.js} +4 -4
  64. package/dist/bundle/{chunk-TKFQ3GNY.js → chunk-YRZ23RCS.js} +164 -59
  65. package/dist/bundle/command-contract-TW44FY47.js +33 -0
  66. package/dist/bundle/{decode-ZATANRER.js → decode-FM4C2WWG.js} +5 -5
  67. package/dist/bundle/{dispatch-5C6XNGEE.js → dispatch-K3HG4RYT.js} +8 -8
  68. package/dist/bundle/{dist-JN22LNLZ.js → dist-7LNVI7VB.js} +17 -13
  69. package/dist/bundle/{echarts-WKTVUY3O.js → echarts-5C2A72XM.js} +2 -2
  70. package/dist/bundle/{embed-AVKPYK4V.js → embed-N56P6YVY.js} +6 -6
  71. package/dist/bundle/{embedder-PSV2E5TR.js → embedder-QLYKFLOL.js} +9 -9
  72. package/dist/bundle/{failure-YRGRZBTX.js → failure-5ZLVZTRU.js} +2 -2
  73. package/dist/bundle/{first-run-YN4SF5RZ.js → first-run-VMF4PJ7Q.js} +11 -11
  74. package/dist/bundle/first-screen-ZN7ODW5K.js +31 -0
  75. package/dist/bundle/{instructions-W5SJW23S.js → instructions-QA5FHDOJ.js} +1 -1
  76. package/dist/bundle/mail.js +12 -12
  77. package/dist/bundle/{mcp-B25MZCS7.js → mcp-LO2XDBBC.js} +2 -2
  78. package/dist/bundle/{node-BHBFRH6H.js → node-OXJZWUYZ.js} +2 -2
  79. package/dist/bundle/{node-sqlite-7FHC3W5U.js → node-sqlite-7GCEI67B.js} +5 -5
  80. package/dist/bundle/{oauth-ORPM6FLL.js → oauth-VTPIYBTP.js} +7 -7
  81. package/dist/bundle/{open-AY5KLPWO.js → open-7XX3YF2X.js} +4 -4
  82. package/dist/bundle/{openai-U7VALRI7.js → openai-D3KRCXSY.js} +14 -14
  83. package/dist/bundle/{process-7AWARSC5.js → process-KFI7SXQD.js} +1 -1
  84. package/dist/bundle/{program-2W4J47LM.js → program-OJUWUHHC.js} +1334 -857
  85. package/dist/bundle/{prompt-STNX6JL7.js → prompt-TBZT3APW.js} +5 -5
  86. package/dist/bundle/{recognize-2XWWTN6Y.js → recognize-WQSE5ZPL.js} +4 -4
  87. package/dist/bundle/{remote-OIC32DKQ.js → remote-J5HHRNVQ.js} +7 -7
  88. package/dist/bundle/{rerank-IFTSO576.js → rerank-DP2Y3WDT.js} +7 -7
  89. package/dist/bundle/{serve-P2D2AJAU.js → serve-VXPOQDQO.js} +9 -9
  90. package/dist/bundle/{server-DFEJBMXO.js → server-OSBNGA2F.js} +37 -38
  91. package/dist/bundle/server-XHWSCXVX.js +62 -0
  92. package/dist/bundle/{sqlite-runtime-DD4Y35DQ.js → sqlite-runtime-XY32WOIT.js} +5 -5
  93. package/dist/bundle/{state-XUSQMIKJ.js → state-KPOPMR6O.js} +6 -6
  94. package/dist/bundle/{store-T3PKOLER.js → store-FWRGNGP3.js} +25 -17
  95. package/dist/bundle/{store-EQC5DKSY.js → store-UBI2YCRC.js} +13 -13
  96. package/dist/bundle/store-maintenance-command-3ZXPEIGF.js +52 -0
  97. package/dist/commands/login.d.ts.map +1 -1
  98. package/dist/commands/login.js +2 -1
  99. package/dist/commands/login.js.map +1 -1
  100. package/dist/commands/session-start.d.ts.map +1 -1
  101. package/dist/commands/session-start.js +3 -3
  102. package/dist/commands/session-start.js.map +1 -1
  103. package/dist/commands/sync.d.ts.map +1 -1
  104. package/dist/commands/sync.js +22 -7
  105. package/dist/commands/sync.js.map +1 -1
  106. package/dist/config.d.ts +6 -0
  107. package/dist/config.d.ts.map +1 -1
  108. package/dist/mail/imap/connection.d.ts.map +1 -1
  109. package/dist/mail/imap/connection.js +6 -4
  110. package/dist/mail/imap/connection.js.map +1 -1
  111. package/dist/mail/imap/errors.d.ts +7 -0
  112. package/dist/mail/imap/errors.d.ts.map +1 -1
  113. package/dist/mail/imap/errors.js +8 -4
  114. package/dist/mail/imap/errors.js.map +1 -1
  115. package/dist/mail/imap/read.d.ts.map +1 -1
  116. package/dist/mail/imap/read.js +36 -20
  117. package/dist/mail/imap/read.js.map +1 -1
  118. package/dist/mail/imap/search.d.ts +7 -2
  119. package/dist/mail/imap/search.d.ts.map +1 -1
  120. package/dist/mail/imap/search.js +13 -7
  121. package/dist/mail/imap/search.js.map +1 -1
  122. package/dist/mail/imap/write.d.ts.map +1 -1
  123. package/dist/mail/imap/write.js +2 -1
  124. package/dist/mail/imap/write.js.map +1 -1
  125. package/dist/mail/organise.d.ts.map +1 -1
  126. package/dist/mail/organise.js +92 -87
  127. package/dist/mail/organise.js.map +1 -1
  128. package/dist/mail/send.d.ts.map +1 -1
  129. package/dist/mail/send.js +26 -5
  130. package/dist/mail/send.js.map +1 -1
  131. package/dist/oauth.d.ts +0 -3
  132. package/dist/oauth.d.ts.map +1 -1
  133. package/dist/oauth.js +2 -33
  134. package/dist/oauth.js.map +1 -1
  135. package/dist/providers.d.ts.map +1 -1
  136. package/dist/providers.js +2 -1
  137. package/dist/providers.js.map +1 -1
  138. package/dist/reasons.d.ts.map +1 -1
  139. package/dist/reasons.js +0 -3
  140. package/dist/reasons.js.map +1 -1
  141. package/dist/version.d.ts +1 -1
  142. package/dist/version.d.ts.map +1 -1
  143. package/dist/version.js +1 -1
  144. package/dist/version.js.map +1 -1
  145. package/package.json +3 -3
  146. package/dist/bundle/chunk-EVG7MOAH.js +0 -3604
  147. package/dist/bundle/command-contract-T3H5CAX3.js +0 -34
  148. package/dist/bundle/first-screen-IJJZJP6Q.js +0 -32
  149. package/dist/bundle/server-6D7W5Q4A.js +0 -63
  150. package/dist/bundle/store-maintenance-command-7YQZXE4V.js +0 -52
  151. /package/dist/bundle/{chunk-EKRM2QJB.js → chunk-MRLSUCHT.js} +0 -0
@@ -8,12 +8,14 @@ import {
8
8
  sameOrdinaryFile,
9
9
  syncDirectory,
10
10
  writeFileAtomic
11
- } from "./chunk-TVZFDVZP.js";
11
+ } from "./chunk-IXYKM7OJ.js";
12
12
  import {
13
13
  MAX_ACTIONS,
14
14
  ModerationRules,
15
15
  act,
16
+ chatReferenceOf,
16
17
  defaultRules,
18
+ ensureAccount,
17
19
  gather,
18
20
  isId,
19
21
  judge,
@@ -24,10 +26,10 @@ import {
24
26
  someUndone,
25
27
  validateFormattedText,
26
28
  visibleFormattedText
27
- } from "./chunk-K3RWO7LR.js";
29
+ } from "./chunk-N6P55LDU.js";
28
30
  import {
29
31
  MAX_MODEL_IMAGE_BYTES
30
- } from "./chunk-VOGSDGVL.js";
32
+ } from "./chunk-OHC4GVWV.js";
31
33
  import {
32
34
  Command,
33
35
  DEFAULT_IMAGE_MODEL,
@@ -66,17 +68,32 @@ import {
66
68
  typedCommand,
67
69
  vectorModelKey,
68
70
  withAttempt
69
- } from "./chunk-Z3TZTOR2.js";
71
+ } from "./chunk-T3AGR4TI.js";
70
72
  import {
71
73
  isCliFailure
72
- } from "./chunk-M55XFZMG.js";
74
+ } from "./chunk-SW5NVASW.js";
73
75
  import {
74
76
  isNewer,
75
77
  updateCommand
76
- } from "./chunk-5PWKPRTD.js";
78
+ } from "./chunk-XTIQFMZH.js";
77
79
  import {
78
80
  remoteKey
79
- } from "./chunk-PXQ7A5HQ.js";
81
+ } from "./chunk-6UT3MXOB.js";
82
+ import {
83
+ Unzip,
84
+ UnzipInflate,
85
+ defaultThreads,
86
+ installNativeRuntime,
87
+ isTextModelInstalled,
88
+ openEmbedder,
89
+ placedText,
90
+ runEmbedders,
91
+ textModelsDirectory
92
+ } from "./chunk-6QNPJSRM.js";
93
+ import {
94
+ installFiles,
95
+ megabytes
96
+ } from "./chunk-6LNRNQHJ.js";
80
97
  import {
81
98
  AGENDA_COLUMNS,
82
99
  CHAT_COLUMNS,
@@ -132,7 +149,7 @@ import {
132
149
  threadConversation,
133
150
  validateAst,
134
151
  validateFields
135
- } from "./chunk-24MHYGNE.js";
152
+ } from "./chunk-IWHXM2S7.js";
136
153
  import {
137
154
  COUNTER_FIELDS,
138
155
  INTERNAL_NOTES,
@@ -151,13 +168,13 @@ import {
151
168
  parseReference,
152
169
  providerNamed,
153
170
  rankingOptions
154
- } from "./chunk-TKFQ3GNY.js";
171
+ } from "./chunk-YRZ23RCS.js";
155
172
  import {
156
173
  TASK_KINDS,
157
174
  TASK_STATES,
158
175
  createTaskService,
159
176
  isClosedState
160
- } from "./chunk-DQHAXX33.js";
177
+ } from "./chunk-LXHLQ6RK.js";
161
178
  import {
162
179
  EVENT_QUERY,
163
180
  MEETING_PROJECT_EVIDENCE_QUERY,
@@ -198,39 +215,24 @@ import {
198
215
  validateQuery,
199
216
  walkQuery,
200
217
  zonedMoment
201
- } from "./chunk-EUJTQY43.js";
218
+ } from "./chunk-KVN4RY7E.js";
202
219
  import {
203
220
  DEFAULT_STEMMERS,
204
221
  createStemmer,
205
222
  fold,
206
223
  normalize
207
- } from "./chunk-4EFKQXA5.js";
224
+ } from "./chunk-IG2WXKIT.js";
208
225
  import {
209
226
  DEFAULT_TASK_CATEGORIES,
210
227
  FALLBACK_CATEGORY
211
- } from "./chunk-QO4K6R7K.js";
212
- import {
213
- Unzip,
214
- UnzipInflate,
215
- defaultThreads,
216
- installNativeRuntime,
217
- isTextModelInstalled,
218
- openEmbedder,
219
- placedText,
220
- runEmbedders,
221
- textModelsDirectory
222
- } from "./chunk-3LMWAO6A.js";
223
- import {
224
- installFiles,
225
- megabytes
226
- } from "./chunk-PC3AFEEA.js";
228
+ } from "./chunk-PLPSFJO6.js";
227
229
  import {
228
230
  storePath,
229
231
  wirecatDirectory
230
- } from "./chunk-HZ42NO25.js";
232
+ } from "./chunk-MDIRW3AT.js";
231
233
  import {
232
234
  resolvePaths
233
- } from "./chunk-ZISFMUYB.js";
235
+ } from "./chunk-JAWJZTFL.js";
234
236
  import {
235
237
  array,
236
238
  boolean,
@@ -247,7 +249,7 @@ import {
247
249
  safeParse,
248
250
  strictObject,
249
251
  string
250
- } from "./chunk-NAIJNJZZ.js";
252
+ } from "./chunk-NSDOYHIS.js";
251
253
  import {
252
254
  importFrom,
253
255
  resolveFrom
@@ -256,7 +258,7 @@ import {
256
258
  CliError,
257
259
  isCliError,
258
260
  singleLine
259
- } from "./chunk-L3KMVMRJ.js";
261
+ } from "./chunk-4DPICEPQ.js";
260
262
  import {
261
263
  __commonJS,
262
264
  __name,
@@ -16872,10 +16874,10 @@ var require_lib3 = __commonJS({
16872
16874
  }
16873
16875
  });
16874
16876
 
16875
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/ports/traits.js
16877
+ // 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/ports/traits.js
16876
16878
  var syncsOneChat = /* @__PURE__ */ __name((messenger) => messenger.history !== "store" || messenger.historyOnDemand === true, "syncsOneChat");
16877
16879
 
16878
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/conversations/link.js
16880
+ // 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/conversations/link.js
16879
16881
  var RULES_VERSION = 5;
16880
16882
  var LOOK_BACK = 50;
16881
16883
  var SAME_SENDER_WITHIN = 10;
@@ -16965,7 +16967,7 @@ var latest = /* @__PURE__ */ __name((window3, matches) => {
16965
16967
  var sameThread = /* @__PURE__ */ __name((a, b) => a.threadId === b.threadId, "sameThread");
16966
16968
  var link = /* @__PURE__ */ __name((message, parentId, source, kind, confidence, method) => ({ messageId: message.id, parentId, source, kind, confidence, method }), "link");
16967
16969
 
16968
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/cli/messenger/lacks.js
16970
+ // 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/lacks.js
16969
16971
  var COMMAND_NEEDS = {
16970
16972
  "account update": ["updateProfile", "change the profile"],
16971
16973
  "account sessions list": ["sessions", "list the account's sessions"],
@@ -17015,7 +17017,7 @@ var hideNever = /* @__PURE__ */ __name((messenger, group) => {
17015
17017
  return group;
17016
17018
  }, "hideNever");
17017
17019
 
17018
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/members-audit.js
17020
+ // 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/services/members-audit.js
17019
17021
  var AUDIT_PAGE = 200;
17020
17022
  var AUDIT_BUDGET = 10;
17021
17023
  var AUDIT_PAUSE_MS = 1e3;
@@ -17095,7 +17097,7 @@ var burstJoins = /* @__PURE__ */ __name((members) => {
17095
17097
  return found;
17096
17098
  }, "burstJoins");
17097
17099
 
17098
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/meetings/cli/query-options.js
17100
+ // 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/meetings/cli/query-options.js
17099
17101
  var queryWordsAfterOptions = /* @__PURE__ */ __name((command) => {
17100
17102
  command.allowUnknownOption();
17101
17103
  const parse = command.parseOptions.bind(command);
@@ -17115,7 +17117,7 @@ var queryWordsAfterOptions = /* @__PURE__ */ __name((command) => {
17115
17117
  return command;
17116
17118
  }, "queryWordsAfterOptions");
17117
17119
 
17118
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/meetings/cli/passage.js
17120
+ // 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/meetings/cli/passage.js
17119
17121
  var count = /* @__PURE__ */ __name((value) => {
17120
17122
  if (!/^(0|[1-9]\d*)$/.test(value) || !Number.isSafeInteger(Number(value)))
17121
17123
  throw new CliError("validation_error", "expected a nonnegative safe integer");
@@ -17157,7 +17159,7 @@ var addMeetingPassageCommandDefinition = /* @__PURE__ */ __name((program, deps)
17157
17159
  var createMeetingPassageCommand = sharedCommand(createMeetingPassageCommandDefinition);
17158
17160
  var addMeetingPassageCommand = sharedCommand(addMeetingPassageCommandDefinition);
17159
17161
 
17160
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/meetings/cli/project-evidence.js
17162
+ // 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/meetings/cli/project-evidence.js
17161
17163
  var integer = /* @__PURE__ */ __name((value) => {
17162
17164
  if (!/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
17163
17165
  throw new CliError("validation_error", "expected a positive safe integer");
@@ -17180,7 +17182,7 @@ ${fieldsHelp(MEETING_PROJECT_EVIDENCE_QUERY)}`).option("--limit <n>", "hits in o
17180
17182
  }, "addMeetingProjectEvidenceCommandDefinition");
17181
17183
  var addMeetingProjectEvidenceCommand = sharedCommand(addMeetingProjectEvidenceCommandDefinition);
17182
17184
 
17183
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/meetings/cli/search.js
17185
+ // 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/meetings/cli/search.js
17184
17186
  var ZONED = /(?:Z|[+-]\d{2}:?\d{2})$/i;
17185
17187
  var moment = /* @__PURE__ */ __name((flag, end, readIn) => (value) => {
17186
17188
  const zone = timezoneOf();
@@ -17266,7 +17268,7 @@ var addMeetingSearchCommandDefinition = /* @__PURE__ */ __name((program, deps) =
17266
17268
  var createMeetingSearchCommand = sharedCommand(createMeetingSearchCommandDefinition);
17267
17269
  var addMeetingSearchCommand = sharedCommand(addMeetingSearchCommandDefinition);
17268
17270
 
17269
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/meetings/cli/index.js
17271
+ // 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/meetings/cli/index.js
17270
17272
  var integer3 = /* @__PURE__ */ __name((text2) => {
17271
17273
  if (!/^[1-9]\d*$/.test(text2) || !Number.isSafeInteger(Number(text2)))
17272
17274
  throw new InvalidArgumentError("expected a positive integer");
@@ -17386,7 +17388,7 @@ ${fieldsHelp(EVENT_QUERY, MEETING_QUERY_GUIDE)}`);
17386
17388
  }, "addMeetingCommandsDefinition");
17387
17389
  var addMeetingCommands = sharedCommand(addMeetingCommandsDefinition);
17388
17390
 
17389
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/cli/list-query.js
17391
+ // 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/list-query.js
17390
17392
  var LIST_QUERY_GUIDE = "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md";
17391
17393
  var QUERY_ARGUMENT = "field:value terms that narrow the list \u2014 the fields are below";
17392
17394
  var withQuery = /* @__PURE__ */ __name((command, registry) => {
@@ -17519,7 +17521,7 @@ var termField = /* @__PURE__ */ __name((name, type, example, more = {}) => nativ
17519
17521
  var queryHelp = /* @__PURE__ */ __name((registry) => `
17520
17522
  ${fieldsHelp(registry, LIST_QUERY_GUIDE)}`, "queryHelp");
17521
17523
 
17522
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/cli/paging.js
17524
+ // 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/paging.js
17523
17525
  var positiveCount = /* @__PURE__ */ __name((flag) => (value) => {
17524
17526
  if (!/^\d+$/.test(value.trim()) || Number(value) < 1)
17525
17527
  throw new CliError("validation_error", `${flag} takes a whole number from 1 upwards, not "${value}"`);
@@ -17528,7 +17530,7 @@ var positiveCount = /* @__PURE__ */ __name((flag) => (value) => {
17528
17530
  var withPaging = /* @__PURE__ */ __name((command) => command.option("--limit <n>", "how many to show", positiveCount("--limit")).option("--page <n>", "which page, starting at 1", positiveCount("--page")).option("--all", "every row, no paging"), "withPaging");
17529
17531
  var window = /* @__PURE__ */ __name(({ limit, page, all }) => all ? { offset: 0 } : { limit, offset: (page - 1) * limit }, "window");
17530
17532
 
17531
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/cli/messenger/chat-answers.js
17533
+ // 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/chat-answers.js
17532
17534
  var defined = /* @__PURE__ */ __name((record2) => Object.fromEntries(Object.entries(record2).filter(([, value]) => value !== void 0)), "defined");
17533
17535
  var chatRef = /* @__PURE__ */ __name((account, chat) => formatReference({ type: "chat", provider: account.provider, account: account.account, chat }), "chatRef");
17534
17536
  var settingsOf = /* @__PURE__ */ __name((settings) => defined({
@@ -17790,7 +17792,7 @@ var sessionAnswer = /* @__PURE__ */ __name(({ current, client, device, location,
17790
17792
  ...createdAt === void 0 ? {} : { created_at: createdAt }
17791
17793
  }), "sessionAnswer");
17792
17794
 
17793
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/deps.js
17795
+ // 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/services/deps.js
17794
17796
  var accountStore = /* @__PURE__ */ __name(async (deps) => (await deps.store()).forAccount(await deps.account()), "accountStore");
17795
17797
  var crossAccount = /* @__PURE__ */ __name((deps, _reason) => deps.store(), "crossAccount");
17796
17798
  var NO_LOCAL_STORE = "this answer comes from the messenger, not from the local store";
@@ -17824,7 +17826,6 @@ var storeIfOpen = /* @__PURE__ */ __name(async (deps) => {
17824
17826
  }, "storeIfOpen");
17825
17827
  var fromStore = /* @__PURE__ */ __name((deps) => deps.offline || deps.reads === "store", "fromStore");
17826
17828
  var nothingStored = /* @__PURE__ */ __name((messenger) => `nothing stored for this chat yet \u2014 keep \`${typedCommand(messenger.app.command, "serve")}\` running`, "nothingStored");
17827
- var PUSHED = "this messenger's history is read from the local store";
17828
17829
  var OFFLINE = "--offline answers only from what is kept locally: `chats list|show`, `messages list|show|context|download`, `contacts list|show` and `review`";
17829
17830
  var onlineDeps = /* @__PURE__ */ __name((messenger, adapter, guard, where = {}) => ({
17830
17831
  messenger,
@@ -17855,7 +17856,7 @@ var storedDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({
17855
17856
  }), "storedDeps");
17856
17857
  var storeModeDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({ ...storedDeps(messenger, store, account, guard), offline: false, reads: "store" }), "storeModeDeps");
17857
17858
 
17858
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/ports/messenger.js
17859
+ // 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/ports/messenger.js
17859
17860
  var throughWrapper = /* @__PURE__ */ __name((inner, handled, wrap = (_, call) => call) => new Proxy(handled, {
17860
17861
  get: /* @__PURE__ */ __name((own, key) => {
17861
17862
  if (key in own)
@@ -17872,12 +17873,304 @@ var capability = /* @__PURE__ */ __name((adapter, method, what) => {
17872
17873
  return found.bind(adapter);
17873
17874
  }, "capability");
17874
17875
 
17875
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/sends/send-id.js
17876
+ // 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/sends/send-id.js
17876
17877
  import { randomBytes } from "node:crypto";
17877
17878
  var newSendId = /* @__PURE__ */ __name(() => randomBytes(8).readBigInt64BE().toString(), "newSendId");
17878
17879
  var newOperationId = newSendId;
17879
17880
 
17880
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/moment.js
17881
+ // 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/services/questions.js
17882
+ var LINKS = /https?:\/\/\S+/g;
17883
+ var unanswered = /* @__PURE__ */ __name((messages, { answerers: answerers2, before: before2 }) => questions(messages, { answerers: answerers2 }).filter(({ question, answer }) => answer === void 0 && Date.parse(question.timestamp) < before2).map(({ question }) => question), "unanswered");
17884
+ var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2, asker = "others" }) => {
17885
+ const fromOwner = /* @__PURE__ */ __name((message) => message.outgoing === true, "fromOwner");
17886
+ const answers = asker === "owner" ? (message) => !fromOwner(message) : (message) => fromOwner(message) || message.senderId !== null && answerers2.has(message.senderId);
17887
+ const byId2 = new Map(messages.map((message) => [message.id, message]));
17888
+ const repliesToAnswerer = /* @__PURE__ */ __name((message) => {
17889
+ if (asker === "owner")
17890
+ return false;
17891
+ const to = message.replyTo?.id ?? message.replyToId;
17892
+ const quoted = to === void 0 ? void 0 : byId2.get(to);
17893
+ if (quoted)
17894
+ return answers(quoted);
17895
+ return message.replyTo !== null && (message.replyTo.outgoing === true || answerers2.has(message.replyTo.senderId ?? ""));
17896
+ }, "repliesToAnswerer");
17897
+ return messages.flatMap((message, index) => {
17898
+ if (asker === "owner" ? !fromOwner(message) : answers(message))
17899
+ return [];
17900
+ const transcript = "transcript" in message && typeof message.transcript === "string" ? message.transcript : "";
17901
+ if (![message.text, transcript].join("\n").replace(LINKS, "").includes("?") && !repliesToAnswerer(message))
17902
+ return [];
17903
+ const later = messages.slice(index + 1);
17904
+ const reply = later.find((one) => (one.replyTo?.id ?? one.replyToId) === message.id && answers(one));
17905
+ const next = later.find((other) => other.senderId !== message.senderId);
17906
+ const answer = [reply, next && answers(next) ? next : void 0].filter((one) => one !== void 0).sort((a, b) => Date.parse(a.timestamp) - Date.parse(b.timestamp))[0];
17907
+ return [{ question: message, ...answer ? { answer } : {} }];
17908
+ });
17909
+ }, "questions");
17910
+
17911
+ // 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/services/task-categories.js
17912
+ var names = /* @__PURE__ */ __name((categories) => categories.map(({ name }) => name).join(", "), "names");
17913
+ var taskCategoryOf = /* @__PURE__ */ __name((categories = DEFAULT_TASK_CATEGORIES, flag = "--category") => (typed) => {
17914
+ const name = typed.trim().toLowerCase();
17915
+ if (categories.some((one) => one.name === name))
17916
+ return name;
17917
+ throw new CliError("validation_error", `${flag} takes ${names(categories)} \u2014 not "${singleLine(typed)}"; tasks categories says what each means`, { reason: "task.category-unknown" });
17918
+ }, "taskCategoryOf");
17919
+ var stemmers;
17920
+ var stemmersOf = /* @__PURE__ */ __name(() => stemmers ??= {
17921
+ english: createStemmer({ cyrillic: "russian", latin: "english" }),
17922
+ spanish: createStemmer({ cyrillic: "russian", latin: "spanish" })
17923
+ }, "stemmersOf");
17924
+ var SPANISH_LETTERS = /[ñáéíóú¿¡]/u;
17925
+ var SPANISH_WORDS = new Set("de del la las el los que por para una unos unas hay tengo hola gracias".split(" "));
17926
+ var readsSpanish = /* @__PURE__ */ __name((text2) => SPANISH_LETTERS.test(text2.toLowerCase()) || (text2.toLowerCase().match(new RegExp("\\p{L}+", "gu")) ?? []).some((word) => SPANISH_WORDS.has(word)), "readsSpanish");
17927
+ var stemsByList = /* @__PURE__ */ new WeakMap();
17928
+ var triggerStems = /* @__PURE__ */ __name((categories) => {
17929
+ const known2 = stemsByList.get(categories);
17930
+ if (known2)
17931
+ return known2;
17932
+ const { english, spanish } = stemmersOf();
17933
+ const built = categories.map(({ name, triggers }) => ({
17934
+ name,
17935
+ english: new Set(Object.values(triggers).flatMap((words2) => words2.flatMap((word) => english.stemTokens(word)))),
17936
+ spanish: new Set(triggers.es.flatMap((word) => spanish.stemTokens(word)))
17937
+ }));
17938
+ stemsByList.set(categories, built);
17939
+ return built;
17940
+ }, "triggerStems");
17941
+ var hitsByList = /* @__PURE__ */ __name((text2, categories) => {
17942
+ const stem = stemmersOf();
17943
+ const english = stem.english.stemTokens(text2);
17944
+ const spanish = readsSpanish(text2) ? stem.spanish.stemTokens(text2) : [];
17945
+ const counted2 = [];
17946
+ for (const triggers of triggerStems(categories)) {
17947
+ const hit = /* @__PURE__ */ new Set();
17948
+ english.forEach((word, at) => {
17949
+ const other = spanish[at];
17950
+ if (triggers.english.has(word))
17951
+ hit.add(word);
17952
+ else if (other !== void 0 && triggers.spanish.has(other))
17953
+ hit.add(other);
17954
+ });
17955
+ counted2.push({ name: triggers.name, hits: hit.size });
17956
+ }
17957
+ return counted2;
17958
+ }, "hitsByList");
17959
+ var categorize = /* @__PURE__ */ __name((text2, categories = DEFAULT_TASK_CATEGORIES) => {
17960
+ let best = { name: FALLBACK_CATEGORY, hits: 0 };
17961
+ for (const counted2 of hitsByList(text2, categories))
17962
+ if (counted2.hits > best.hits)
17963
+ best = counted2;
17964
+ return best.name;
17965
+ }, "categorize");
17966
+
17967
+ // 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/services/task-rules.js
17968
+ var taskAccount = /* @__PURE__ */ __name(({ provider, account }) => `${provider}:${account}`, "taskAccount");
17969
+ var RULES_IN = {
17970
+ dialog: "all",
17971
+ group: "addressed",
17972
+ unknown: "addressed",
17973
+ channel: "none",
17974
+ saved: "none"
17975
+ };
17976
+ var WATCH_TAG = "watch-tasks";
17977
+ var scopeOf = /* @__PURE__ */ __name((kind, watched) => watched && RULES_IN[kind] === "addressed" ? "all" : RULES_IN[kind], "scopeOf");
17978
+ var watchedChats = /* @__PURE__ */ __name(async (store, account) => new Set((await store.tags.tags(account, { tag: WATCH_TAG, type: "chat" })).flatMap((one) => one.chatId ? [one.chatId] : [])), "watchedChats");
17979
+ var withWatched = /* @__PURE__ */ __name(async (store, account, review) => {
17980
+ const watched = await watchedChats(store, account);
17981
+ return { chats: review.chats.map((chat) => ({ ...chat, watched: watched.has(chat.id) })) };
17982
+ }, "withWatched");
17983
+ var repliesToOwner = /* @__PURE__ */ __name((message, messages) => {
17984
+ const to = message.replyTo?.id ?? message.replyToId;
17985
+ const quoted = to === void 0 ? void 0 : messages.find((one) => one.id === to);
17986
+ return quoted ? quoted.outgoing === true : message.replyTo?.outgoing === true;
17987
+ }, "repliesToOwner");
17988
+ var applyTaskRules = /* @__PURE__ */ __name(async (review, { store, account, now, categories, openLimit, dryRun = false, onHeld }) => {
17989
+ const tasks = createTaskService({ store, ...now ? { now } : {} });
17990
+ const owner = taskAccount(account);
17991
+ const result = { added: 0, closed: 0, review: 0 };
17992
+ const sourceOf2 = /* @__PURE__ */ __name((message) => formatLocator({ provider: account.provider, account: account.account, chat: message.chatId, message: message.id }), "sourceOf");
17993
+ const open7 = /* @__PURE__ */ __name(async (message, group, kind) => {
17994
+ const { created, review: review2 = 0 } = await tasks.add({
17995
+ source: sourceOf2(message),
17996
+ sourceKind: "message",
17997
+ account: owner,
17998
+ group,
17999
+ kind,
18000
+ origin: "rule",
18001
+ category: categorize(message.text, categories)
18002
+ });
18003
+ if (created)
18004
+ result.added += 1;
18005
+ result.review += review2;
18006
+ }, "open");
18007
+ const close = /* @__PURE__ */ __name(async (message, kind, answer) => {
18008
+ for (const task2 of await store.findBySource(owner, sourceOf2(message))) {
18009
+ if (task2.kind !== kind || isClosedState(task2.state))
18010
+ continue;
18011
+ result.closed += 1;
18012
+ if (dryRun)
18013
+ continue;
18014
+ await tasks.close(task2.id, { as: "done", by: "rule" });
18015
+ if (answer)
18016
+ await store.answer(task2.id, {
18017
+ resolution: answer.outgoing ? "answered by the owner" : "answered in the group",
18018
+ by: sourceOf2(answer)
18019
+ });
18020
+ }
18021
+ }, "close");
18022
+ const hasTask = /* @__PURE__ */ __name(async (message) => (await store.findBySource(owner, sourceOf2(message))).length > 0, "hasTask");
18023
+ for (const chat of review.chats) {
18024
+ const scope = scopeOf(chat.kind, chat.watched === true);
18025
+ if (scope === "none")
18026
+ continue;
18027
+ const opens = [];
18028
+ const memberReply = /* @__PURE__ */ __name((question) => chat.watched === true ? chat.messages.find((one) => (one.replyTo?.id ?? one.replyToId) === question.id && one.senderId !== question.senderId) : void 0, "memberReply");
18029
+ for (const found of questions(chat.messages, { answerers: /* @__PURE__ */ new Set() })) {
18030
+ const { question } = found;
18031
+ const answer = found.answer ?? memberReply(question);
18032
+ if (answer)
18033
+ await close(question, "question", answer);
18034
+ else if (scope === "all" || question.text.includes("?") && repliesToOwner(question, chat.messages))
18035
+ opens.push({ message: question, kind: "question" });
18036
+ }
18037
+ for (const [index, message] of chat.messages.entries()) {
18038
+ if (message.outgoing || !message.mentions?.includes(account.account))
18039
+ continue;
18040
+ if (ownerAnswered(chat.messages, index))
18041
+ await close(message, "mention");
18042
+ else
18043
+ opens.push({ message, kind: "mention" });
18044
+ }
18045
+ opens.sort((a, b) => Date.parse(a.message.timestamp) - Date.parse(b.message.timestamp));
18046
+ const keep2 = dryRun ? 0 : openLimit === void 0 ? opens.length : Math.min(openLimit, opens.length);
18047
+ let held = 0;
18048
+ for (const [index, { message, kind }] of opens.entries()) {
18049
+ if (index >= opens.length - keep2)
18050
+ await open7(message, chat.id, kind);
18051
+ else if (!await hasTask(message)) {
18052
+ held += 1;
18053
+ onHeld?.({ source: sourceOf2(message), kind, category: categorize(message.text, categories) });
18054
+ }
18055
+ }
18056
+ if (held > 0) {
18057
+ result.held = (result.held ?? 0) + held;
18058
+ result.heldChats = (result.heldChats ?? 0) + 1;
18059
+ }
18060
+ }
18061
+ return result;
18062
+ }, "applyTaskRules");
18063
+ var ARRIVAL_WINDOW = 50;
18064
+ var kindOf2 = /* @__PURE__ */ __name(async (store, account, chat) => await store.chats.chatKind(account, chat) ?? "unknown", "kindOf");
18065
+ var applyTaskRulesOnArrival = /* @__PURE__ */ __name(async (store, account, message) => {
18066
+ const page = await store.messages.messages(account, message.chatId, { limit: ARRIVAL_WINDOW });
18067
+ const messages = [...page.items.filter((one) => one.id !== message.id), message].sort((a, b) => Date.parse(a.timestamp) - Date.parse(b.timestamp));
18068
+ return applyTaskRules({
18069
+ chats: [
18070
+ {
18071
+ id: message.chatId,
18072
+ messages,
18073
+ kind: await kindOf2(store, account, message.chatId),
18074
+ watched: (await watchedChats(store, account)).has(message.chatId)
18075
+ }
18076
+ ]
18077
+ }, { store: store.tasks, account, categories: await store.tasks.categories() });
18078
+ }, "applyTaskRulesOnArrival");
18079
+ var STORED_PASS_LIMIT = 1e3;
18080
+ var applyTaskRulesToStored = /* @__PURE__ */ __name(async (store, account, since, newerThan, openLimit) => {
18081
+ const result = { added: 0, closed: 0, review: 0, until: since ?? null };
18082
+ const categories = await store.tasks.categories();
18083
+ const watched = await watchedChats(store, account);
18084
+ for (const chat of await store.chats.chatStats(account)) {
18085
+ if (chat.lastStoredAt === null || since !== void 0 && chat.lastStoredAt <= since)
18086
+ continue;
18087
+ if (RULES_IN[chat.kind] === "none" || newerThan !== void 0 && (chat.newestAt === null || chat.newestAt < newerThan)) {
18088
+ if (result.until === null || chat.lastStoredAt > result.until)
18089
+ result.until = chat.lastStoredAt;
18090
+ continue;
18091
+ }
18092
+ const fresh = since === void 0 ? 0 : await store.messages.countMessages(account, chat.chatId, { since });
18093
+ if (since !== void 0 && fresh === 0) {
18094
+ if (result.until === null || chat.lastStoredAt > result.until)
18095
+ result.until = chat.lastStoredAt;
18096
+ continue;
18097
+ }
18098
+ const page = await store.messages.messages(account, chat.chatId, {
18099
+ limit: Math.min(ARRIVAL_WINDOW + fresh, STORED_PASS_LIMIT)
18100
+ });
18101
+ const pass = await applyTaskRules({ chats: [{ id: chat.chatId, messages: page.items, kind: chat.kind, watched: watched.has(chat.chatId) }] }, { store: store.tasks, account, categories, ...openLimit === void 0 ? {} : { openLimit } });
18102
+ result.added += pass.added;
18103
+ result.closed += pass.closed;
18104
+ result.review += pass.review;
18105
+ if (pass.held) {
18106
+ result.held = (result.held ?? 0) + pass.held;
18107
+ result.heldChats = (result.heldChats ?? 0) + (pass.heldChats ?? 0);
18108
+ }
18109
+ if (result.until === null || chat.lastStoredAt > result.until)
18110
+ result.until = chat.lastStoredAt;
18111
+ }
18112
+ return result;
18113
+ }, "applyTaskRulesToStored");
18114
+ var FIRST_PASS_DAYS = 14;
18115
+ var applyTaskRulesSinceLastPass = /* @__PURE__ */ __name(async (store, account, now = /* @__PURE__ */ new Date()) => {
18116
+ const since = await store.sync.taskRulesStop(account);
18117
+ const newerThan = since === null ? new Date(now.getTime() - FIRST_PASS_DAYS * 864e5).toISOString() : void 0;
18118
+ const openLimit = since === null ? await store.tasks.firstPassPerChat() : void 0;
18119
+ const { until, ...result } = await applyTaskRulesToStored(store, account, since ?? void 0, newerThan, openLimit);
18120
+ if (until !== null && until !== since)
18121
+ await store.sync.setTaskRulesStop(account, until);
18122
+ return result;
18123
+ }, "applyTaskRulesSinceLastPass");
18124
+ var openRequestTask = /* @__PURE__ */ __name(async (store, account, message) => {
18125
+ const { created } = await createTaskService({ store: store.tasks }).add({
18126
+ source: formatLocator({
18127
+ provider: account.provider,
18128
+ account: account.account,
18129
+ chat: message.chatId,
18130
+ message: message.id
18131
+ }),
18132
+ sourceKind: "message",
18133
+ account: taskAccount(account),
18134
+ group: message.chatId,
18135
+ kind: "request",
18136
+ origin: "rule",
18137
+ category: categorize(message.text, await store.tasks.categories())
18138
+ });
18139
+ return created;
18140
+ }, "openRequestTask");
18141
+ var ownerAnswered = /* @__PURE__ */ __name((messages, index) => {
18142
+ const message = messages[index];
18143
+ if (!message)
18144
+ return false;
18145
+ const senders = new Map(messages.map((one) => [one.id, one.senderId]));
18146
+ return messages.slice(index + 1).some((one) => {
18147
+ if (one.outgoing !== true)
18148
+ return false;
18149
+ const to = one.replyTo?.id ?? one.replyToId;
18150
+ if (to === message.id)
18151
+ return true;
18152
+ const repliedSender = one.replyTo?.senderId ?? (to === void 0 ? void 0 : senders.get(to));
18153
+ return repliedSender != null && repliedSender === message.senderId;
18154
+ });
18155
+ }, "ownerAnswered");
18156
+ var applyTaskRulesToChats = /* @__PURE__ */ __name(async (store, account, chatIds, { last = ARRIVAL_WINDOW, yes = false } = {}) => {
18157
+ const categories = await store.tasks.categories();
18158
+ const watched = await watchedChats(store, account);
18159
+ const passes = [];
18160
+ for (const chat of chatIds) {
18161
+ const page = await store.messages.messages(account, chat, { limit: Math.min(last, STORED_PASS_LIMIT) });
18162
+ const tasks = [];
18163
+ const pass = await applyTaskRules({
18164
+ chats: [
18165
+ { id: chat, messages: page.items, kind: await kindOf2(store, account, chat), watched: watched.has(chat) }
18166
+ ]
18167
+ }, { store: store.tasks, account, categories, dryRun: !yes, onHeld: /* @__PURE__ */ __name((task2) => tasks.push(task2), "onHeld") });
18168
+ passes.push({ chat, messages: page.items.length, ...pass, tasks });
18169
+ }
18170
+ return passes;
18171
+ }, "applyTaskRulesToChats");
18172
+
18173
+ // 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/services/moment.js
17881
18174
  var AGO = /^(\d+)(m|h|d)$/;
17882
18175
  var AGO_MS = { m: 6e4, h: 36e5, d: 864e5 };
17883
18176
  var DATE = /^\d{4}-\d{2}-\d{2}/;
@@ -17917,290 +18210,7 @@ var dateWindow = /* @__PURE__ */ __name(({ sinceTime, untilTime, zone, now = Dat
17917
18210
  };
17918
18211
  }, "dateWindow");
17919
18212
 
17920
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/questions.js
17921
- var LINKS = /https?:\/\/\S+/g;
17922
- var unanswered = /* @__PURE__ */ __name((messages, { answerers: answerers2, before: before2 }) => questions(messages, { answerers: answerers2 }).filter(({ question, answer }) => answer === void 0 && Date.parse(question.timestamp) < before2).map(({ question }) => question), "unanswered");
17923
- var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2 }) => {
17924
- const answers = /* @__PURE__ */ __name((message) => message.outgoing === true || message.senderId !== null && answerers2.has(message.senderId), "answers");
17925
- const byId2 = new Map(messages.map((message) => [message.id, message]));
17926
- const repliesToAnswerer = /* @__PURE__ */ __name((message) => {
17927
- const to = message.replyTo?.id ?? message.replyToId;
17928
- const quoted = to === void 0 ? void 0 : byId2.get(to);
17929
- if (quoted)
17930
- return answers(quoted);
17931
- return message.replyTo !== null && (message.replyTo.outgoing === true || answerers2.has(message.replyTo.senderId ?? ""));
17932
- }, "repliesToAnswerer");
17933
- return messages.flatMap((message, index) => {
17934
- if (answers(message))
17935
- return [];
17936
- const transcript = "transcript" in message && typeof message.transcript === "string" ? message.transcript : "";
17937
- if (![message.text, transcript].join("\n").replace(LINKS, "").includes("?") && !repliesToAnswerer(message))
17938
- return [];
17939
- const later = messages.slice(index + 1);
17940
- const reply = later.find((one) => (one.replyTo?.id ?? one.replyToId) === message.id && answers(one));
17941
- const next = later.find((other) => other.senderId !== message.senderId);
17942
- const answer = [reply, next && answers(next) ? next : void 0].filter((one) => one !== void 0).sort((a, b) => Date.parse(a.timestamp) - Date.parse(b.timestamp))[0];
17943
- return [{ question: message, ...answer ? { answer } : {} }];
17944
- });
17945
- }, "questions");
17946
-
17947
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/task-categories.js
17948
- var names = /* @__PURE__ */ __name((categories) => categories.map(({ name }) => name).join(", "), "names");
17949
- var taskCategoryOf = /* @__PURE__ */ __name((categories = DEFAULT_TASK_CATEGORIES, flag = "--category") => (typed) => {
17950
- const name = typed.trim().toLowerCase();
17951
- if (categories.some((one) => one.name === name))
17952
- return name;
17953
- throw new CliError("validation_error", `${flag} takes ${names(categories)} \u2014 not "${singleLine(typed)}"; tasks categories says what each means`, { reason: "task.category-unknown" });
17954
- }, "taskCategoryOf");
17955
- var stemmers;
17956
- var stemmersOf = /* @__PURE__ */ __name(() => stemmers ??= {
17957
- english: createStemmer({ cyrillic: "russian", latin: "english" }),
17958
- spanish: createStemmer({ cyrillic: "russian", latin: "spanish" })
17959
- }, "stemmersOf");
17960
- var SPANISH_LETTERS = /[ñáéíóú¿¡]/u;
17961
- var SPANISH_WORDS = new Set("de del la las el los que por para una unos unas hay tengo hola gracias".split(" "));
17962
- var readsSpanish = /* @__PURE__ */ __name((text2) => SPANISH_LETTERS.test(text2.toLowerCase()) || (text2.toLowerCase().match(new RegExp("\\p{L}+", "gu")) ?? []).some((word) => SPANISH_WORDS.has(word)), "readsSpanish");
17963
- var stemsByList = /* @__PURE__ */ new WeakMap();
17964
- var triggerStems = /* @__PURE__ */ __name((categories) => {
17965
- const known2 = stemsByList.get(categories);
17966
- if (known2)
17967
- return known2;
17968
- const { english, spanish } = stemmersOf();
17969
- const built = categories.map(({ name, triggers }) => ({
17970
- name,
17971
- english: new Set(Object.values(triggers).flatMap((words2) => words2.flatMap((word) => english.stemTokens(word)))),
17972
- spanish: new Set(triggers.es.flatMap((word) => spanish.stemTokens(word)))
17973
- }));
17974
- stemsByList.set(categories, built);
17975
- return built;
17976
- }, "triggerStems");
17977
- var categorize = /* @__PURE__ */ __name((text2, categories = DEFAULT_TASK_CATEGORIES) => {
17978
- const stem = stemmersOf();
17979
- const english = stem.english.stemTokens(text2);
17980
- const spanish = readsSpanish(text2) ? stem.spanish.stemTokens(text2) : [];
17981
- let best = { name: FALLBACK_CATEGORY, hits: 0 };
17982
- for (const triggers of triggerStems(categories)) {
17983
- const hit = /* @__PURE__ */ new Set();
17984
- english.forEach((word, at) => {
17985
- const other = spanish[at];
17986
- if (triggers.english.has(word))
17987
- hit.add(word);
17988
- else if (other !== void 0 && triggers.spanish.has(other))
17989
- hit.add(other);
17990
- });
17991
- if (hit.size > best.hits)
17992
- best = { name: triggers.name, hits: hit.size };
17993
- }
17994
- return best.name;
17995
- }, "categorize");
17996
-
17997
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/task-rules.js
17998
- var taskAccount = /* @__PURE__ */ __name(({ provider, account }) => `${provider}:${account}`, "taskAccount");
17999
- var RULES_IN = {
18000
- dialog: "all",
18001
- group: "addressed",
18002
- unknown: "addressed",
18003
- channel: "none",
18004
- saved: "none"
18005
- };
18006
- var WATCH_TAG = "watch-tasks";
18007
- var scopeOf = /* @__PURE__ */ __name((kind, watched) => watched && RULES_IN[kind] === "addressed" ? "all" : RULES_IN[kind], "scopeOf");
18008
- var watchedChats = /* @__PURE__ */ __name(async (store, account) => new Set((await store.tags.tags(account, { tag: WATCH_TAG, type: "chat" })).flatMap((one) => one.chatId ? [one.chatId] : [])), "watchedChats");
18009
- var withWatched = /* @__PURE__ */ __name(async (store, account, review) => {
18010
- const watched = await watchedChats(store, account);
18011
- return { chats: review.chats.map((chat) => ({ ...chat, watched: watched.has(chat.id) })) };
18012
- }, "withWatched");
18013
- var repliesToOwner = /* @__PURE__ */ __name((message, messages) => {
18014
- const to = message.replyTo?.id ?? message.replyToId;
18015
- const quoted = to === void 0 ? void 0 : messages.find((one) => one.id === to);
18016
- return quoted ? quoted.outgoing === true : message.replyTo?.outgoing === true;
18017
- }, "repliesToOwner");
18018
- var applyTaskRules = /* @__PURE__ */ __name(async (review, { store, account, now, categories, openLimit, dryRun = false, onHeld }) => {
18019
- const tasks = createTaskService({ store, ...now ? { now } : {} });
18020
- const owner = taskAccount(account);
18021
- const result = { added: 0, closed: 0, review: 0 };
18022
- const sourceOf2 = /* @__PURE__ */ __name((message) => formatLocator({ provider: account.provider, account: account.account, chat: message.chatId, message: message.id }), "sourceOf");
18023
- const open7 = /* @__PURE__ */ __name(async (message, group, kind) => {
18024
- const { created, review: review2 = 0 } = await tasks.add({
18025
- source: sourceOf2(message),
18026
- sourceKind: "message",
18027
- account: owner,
18028
- group,
18029
- kind,
18030
- origin: "rule",
18031
- category: categorize(message.text, categories)
18032
- });
18033
- if (created)
18034
- result.added += 1;
18035
- result.review += review2;
18036
- }, "open");
18037
- const close = /* @__PURE__ */ __name(async (message, kind, answer) => {
18038
- for (const task2 of await store.findBySource(owner, sourceOf2(message))) {
18039
- if (task2.kind !== kind || isClosedState(task2.state))
18040
- continue;
18041
- result.closed += 1;
18042
- if (dryRun)
18043
- continue;
18044
- await tasks.close(task2.id, { as: "done", by: "rule" });
18045
- if (answer)
18046
- await store.answer(task2.id, {
18047
- resolution: answer.outgoing ? "answered by the owner" : "answered in the group",
18048
- by: sourceOf2(answer)
18049
- });
18050
- }
18051
- }, "close");
18052
- const hasTask = /* @__PURE__ */ __name(async (message) => (await store.findBySource(owner, sourceOf2(message))).length > 0, "hasTask");
18053
- for (const chat of review.chats) {
18054
- const scope = scopeOf(chat.kind, chat.watched === true);
18055
- if (scope === "none")
18056
- continue;
18057
- const opens = [];
18058
- const memberReply = /* @__PURE__ */ __name((question) => chat.watched === true ? chat.messages.find((one) => (one.replyTo?.id ?? one.replyToId) === question.id && one.senderId !== question.senderId) : void 0, "memberReply");
18059
- for (const found of questions(chat.messages, { answerers: /* @__PURE__ */ new Set() })) {
18060
- const { question } = found;
18061
- const answer = found.answer ?? memberReply(question);
18062
- if (answer)
18063
- await close(question, "question", answer);
18064
- else if (scope === "all" || question.text.includes("?") && repliesToOwner(question, chat.messages))
18065
- opens.push({ message: question, kind: "question" });
18066
- }
18067
- for (const [index, message] of chat.messages.entries()) {
18068
- if (message.outgoing || !message.mentions?.includes(account.account))
18069
- continue;
18070
- if (ownerAnswered(chat.messages, index))
18071
- await close(message, "mention");
18072
- else
18073
- opens.push({ message, kind: "mention" });
18074
- }
18075
- opens.sort((a, b) => Date.parse(a.message.timestamp) - Date.parse(b.message.timestamp));
18076
- const keep2 = dryRun ? 0 : openLimit === void 0 ? opens.length : Math.min(openLimit, opens.length);
18077
- let held = 0;
18078
- for (const [index, { message, kind }] of opens.entries()) {
18079
- if (index >= opens.length - keep2)
18080
- await open7(message, chat.id, kind);
18081
- else if (!await hasTask(message)) {
18082
- held += 1;
18083
- onHeld?.({ source: sourceOf2(message), kind, category: categorize(message.text, categories) });
18084
- }
18085
- }
18086
- if (held > 0) {
18087
- result.held = (result.held ?? 0) + held;
18088
- result.heldChats = (result.heldChats ?? 0) + 1;
18089
- }
18090
- }
18091
- return result;
18092
- }, "applyTaskRules");
18093
- var ARRIVAL_WINDOW = 50;
18094
- var kindOf2 = /* @__PURE__ */ __name(async (store, account, chat) => await store.chats.chatKind(account, chat) ?? "unknown", "kindOf");
18095
- var applyTaskRulesOnArrival = /* @__PURE__ */ __name(async (store, account, message) => {
18096
- const page = await store.messages.messages(account, message.chatId, { limit: ARRIVAL_WINDOW });
18097
- const messages = [...page.items.filter((one) => one.id !== message.id), message].sort((a, b) => Date.parse(a.timestamp) - Date.parse(b.timestamp));
18098
- return applyTaskRules({
18099
- chats: [
18100
- {
18101
- id: message.chatId,
18102
- messages,
18103
- kind: await kindOf2(store, account, message.chatId),
18104
- watched: (await watchedChats(store, account)).has(message.chatId)
18105
- }
18106
- ]
18107
- }, { store: store.tasks, account, categories: await store.tasks.categories() });
18108
- }, "applyTaskRulesOnArrival");
18109
- var STORED_PASS_LIMIT = 1e3;
18110
- var applyTaskRulesToStored = /* @__PURE__ */ __name(async (store, account, since, newerThan, openLimit) => {
18111
- const result = { added: 0, closed: 0, review: 0, until: since ?? null };
18112
- const categories = await store.tasks.categories();
18113
- const watched = await watchedChats(store, account);
18114
- for (const chat of await store.chats.chatStats(account)) {
18115
- if (chat.lastStoredAt === null || since !== void 0 && chat.lastStoredAt <= since)
18116
- continue;
18117
- if (RULES_IN[chat.kind] === "none" || newerThan !== void 0 && (chat.newestAt === null || chat.newestAt < newerThan)) {
18118
- if (result.until === null || chat.lastStoredAt > result.until)
18119
- result.until = chat.lastStoredAt;
18120
- continue;
18121
- }
18122
- const fresh = since === void 0 ? 0 : await store.messages.countMessages(account, chat.chatId, { since });
18123
- if (since !== void 0 && fresh === 0) {
18124
- if (result.until === null || chat.lastStoredAt > result.until)
18125
- result.until = chat.lastStoredAt;
18126
- continue;
18127
- }
18128
- const page = await store.messages.messages(account, chat.chatId, {
18129
- limit: Math.min(ARRIVAL_WINDOW + fresh, STORED_PASS_LIMIT)
18130
- });
18131
- const pass = await applyTaskRules({ chats: [{ id: chat.chatId, messages: page.items, kind: chat.kind, watched: watched.has(chat.chatId) }] }, { store: store.tasks, account, categories, ...openLimit === void 0 ? {} : { openLimit } });
18132
- result.added += pass.added;
18133
- result.closed += pass.closed;
18134
- result.review += pass.review;
18135
- if (pass.held) {
18136
- result.held = (result.held ?? 0) + pass.held;
18137
- result.heldChats = (result.heldChats ?? 0) + (pass.heldChats ?? 0);
18138
- }
18139
- if (result.until === null || chat.lastStoredAt > result.until)
18140
- result.until = chat.lastStoredAt;
18141
- }
18142
- return result;
18143
- }, "applyTaskRulesToStored");
18144
- var FIRST_PASS_DAYS = 14;
18145
- var applyTaskRulesSinceLastPass = /* @__PURE__ */ __name(async (store, account, now = /* @__PURE__ */ new Date()) => {
18146
- const since = await store.sync.taskRulesStop(account);
18147
- const newerThan = since === null ? new Date(now.getTime() - FIRST_PASS_DAYS * 864e5).toISOString() : void 0;
18148
- const openLimit = since === null ? await store.tasks.firstPassPerChat() : void 0;
18149
- const { until, ...result } = await applyTaskRulesToStored(store, account, since ?? void 0, newerThan, openLimit);
18150
- if (until !== null && until !== since)
18151
- await store.sync.setTaskRulesStop(account, until);
18152
- return result;
18153
- }, "applyTaskRulesSinceLastPass");
18154
- var openRequestTask = /* @__PURE__ */ __name(async (store, account, message) => {
18155
- const { created } = await createTaskService({ store: store.tasks }).add({
18156
- source: formatLocator({
18157
- provider: account.provider,
18158
- account: account.account,
18159
- chat: message.chatId,
18160
- message: message.id
18161
- }),
18162
- sourceKind: "message",
18163
- account: taskAccount(account),
18164
- group: message.chatId,
18165
- kind: "request",
18166
- origin: "rule",
18167
- category: categorize(message.text, await store.tasks.categories())
18168
- });
18169
- return created;
18170
- }, "openRequestTask");
18171
- var ownerAnswered = /* @__PURE__ */ __name((messages, index) => {
18172
- const message = messages[index];
18173
- if (!message)
18174
- return false;
18175
- const senders = new Map(messages.map((one) => [one.id, one.senderId]));
18176
- return messages.slice(index + 1).some((one) => {
18177
- if (one.outgoing !== true)
18178
- return false;
18179
- const to = one.replyTo?.id ?? one.replyToId;
18180
- if (to === message.id)
18181
- return true;
18182
- const repliedSender = one.replyTo?.senderId ?? (to === void 0 ? void 0 : senders.get(to));
18183
- return repliedSender != null && repliedSender === message.senderId;
18184
- });
18185
- }, "ownerAnswered");
18186
- var applyTaskRulesToChats = /* @__PURE__ */ __name(async (store, account, chatIds, { last = ARRIVAL_WINDOW, yes = false } = {}) => {
18187
- const categories = await store.tasks.categories();
18188
- const watched = await watchedChats(store, account);
18189
- const passes = [];
18190
- for (const chat of chatIds) {
18191
- const page = await store.messages.messages(account, chat, { limit: Math.min(last, STORED_PASS_LIMIT) });
18192
- const tasks = [];
18193
- const pass = await applyTaskRules({
18194
- chats: [
18195
- { id: chat, messages: page.items, kind: await kindOf2(store, account, chat), watched: watched.has(chat) }
18196
- ]
18197
- }, { store: store.tasks, account, categories, dryRun: !yes, onHeld: /* @__PURE__ */ __name((task2) => tasks.push(task2), "onHeld") });
18198
- passes.push({ chat, messages: page.items.length, ...pass, tasks });
18199
- }
18200
- return passes;
18201
- }, "applyTaskRulesToChats");
18202
-
18203
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/sends/upload.js
18213
+ // 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/sends/upload.js
18204
18214
  import { openAsBlob, realpathSync } from "node:fs";
18205
18215
  import { open, stat } from "node:fs/promises";
18206
18216
  import { basename, dirname, extname, isAbsolute, relative, resolve, sep } from "node:path";
@@ -18402,7 +18412,7 @@ var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes, read) => {
18402
18412
  return { name, source };
18403
18413
  }, "readStickerFile");
18404
18414
 
18405
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/botcheck/check.js
18415
+ // 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/botcheck/check.js
18406
18416
  var DAY_MS = 864e5;
18407
18417
  var NEW_DAYS = 30;
18408
18418
  var SAME_TEXT_MIN = 20;
@@ -18479,7 +18489,7 @@ var scorePerson = /* @__PURE__ */ __name(({ subject, provider, activity, photos,
18479
18489
  };
18480
18490
  }, "scorePerson");
18481
18491
 
18482
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/botcheck/registries.js
18492
+ // 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/botcheck/registries.js
18483
18493
  var REGISTRIES = {
18484
18494
  cas: { title: "Combot Anti-Spam (CAS)", docs: "https://cas.chat/api" },
18485
18495
  lols: { title: "lols.bot", docs: "https://api.lols.bot/lols-bot.json" }
@@ -18564,7 +18574,7 @@ var notCovered = /* @__PURE__ */ __name((messenger, now = /* @__PURE__ */ new Da
18564
18574
  detail: `lists Telegram accounts only, not ${messenger} ones`
18565
18575
  })), "notCovered");
18566
18576
 
18567
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/botcheck/service.js
18577
+ // 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/botcheck/service.js
18568
18578
  var ACTIVITY_MESSAGES = 1e3;
18569
18579
  var botCheckService = /* @__PURE__ */ __name((deps) => {
18570
18580
  const subjectOf = /* @__PURE__ */ __name(async (reference) => {
@@ -18652,7 +18662,7 @@ var botCheckService = /* @__PURE__ */ __name((deps) => {
18652
18662
  };
18653
18663
  }, "botCheckService");
18654
18664
 
18655
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/domain/thread.js
18665
+ // 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/thread.js
18656
18666
  var threadIdOf = /* @__PURE__ */ __name((value) => {
18657
18667
  if (value === void 0)
18658
18668
  return void 0;
@@ -18662,7 +18672,7 @@ var threadIdOf = /* @__PURE__ */ __name((value) => {
18662
18672
  return id2;
18663
18673
  }, "threadIdOf");
18664
18674
 
18665
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/chat-stats.js
18675
+ // 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/services/chat-stats.js
18666
18676
  var TOP_POSTS = 5;
18667
18677
  var JOINS = /* @__PURE__ */ new Set(["join", "add"]);
18668
18678
  var LEAVES = /* @__PURE__ */ new Set(["leave", "remove"]);
@@ -18779,7 +18789,7 @@ var median = /* @__PURE__ */ __name((values) => {
18779
18789
  return Math.round(sorted.length % 2 === 0 ? ((sorted[middle - 1] ?? upper) + upper) / 2 : upper);
18780
18790
  }, "median");
18781
18791
 
18782
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/member-history.js
18792
+ // 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/services/member-history.js
18783
18793
  var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
18784
18794
  const events = [];
18785
18795
  for (const stay of stays) {
@@ -18811,7 +18821,7 @@ var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
18811
18821
  return events.filter(({ at }) => Date.parse(at) >= since).sort((a, b) => Date.parse(a.at) - Date.parse(b.at) || a.id.localeCompare(b.id));
18812
18822
  }, "memberEvents");
18813
18823
 
18814
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/message-resolution.js
18824
+ // 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/services/message-resolution.js
18815
18825
  var readChatId = /* @__PURE__ */ __name(async (deps, reference, store, account) => {
18816
18826
  if (deps.reads !== "store")
18817
18827
  return keptChatId(deps.messenger, reference, store, account);
@@ -18830,10 +18840,12 @@ var readChatId = /* @__PURE__ */ __name(async (deps, reference, store, account)
18830
18840
  var LEFT_EMPTY = "you left this chat, and the store holds none of its messages";
18831
18841
  var storedChatId = /* @__PURE__ */ __name((messenger, reference, store, account, { includeLeft = false } = {}) => {
18832
18842
  const renamed = /* @__PURE__ */ __name((id2) => store.chats.renamedChatId(account, id2), "renamed");
18843
+ const profilesOn = profilesOnAccount(store, messenger.app?.command, account.provider);
18833
18844
  const among = chatIdAmong(messenger, reference, account, {
18834
18845
  held: /* @__PURE__ */ __name(() => store.chats.chats(account, {}), "held"),
18835
18846
  renamed,
18836
- left: /* @__PURE__ */ __name(async (id2) => leftIn(await store.chats.chats(account, byId(id2))), "left")
18847
+ left: /* @__PURE__ */ __name(async (id2) => leftIn(await store.chats.chats(account, byId(id2))), "left"),
18848
+ profilesOn
18837
18849
  });
18838
18850
  if (!includeLeft)
18839
18851
  return among;
@@ -18842,7 +18854,8 @@ var storedChatId = /* @__PURE__ */ __name((messenger, reference, store, account,
18842
18854
  throw error;
18843
18855
  return chatIdAmong(messenger, reference, account, {
18844
18856
  held: /* @__PURE__ */ __name(() => store.chats.chats(account, { includeLeft: true }), "held"),
18845
- renamed
18857
+ renamed,
18858
+ profilesOn
18846
18859
  });
18847
18860
  });
18848
18861
  }, "storedChatId");
@@ -18871,13 +18884,22 @@ var byId = /* @__PURE__ */ __name((id2) => ({
18871
18884
  where: { sql: "chats.external_id = ?", params: [id2] }
18872
18885
  }), "byId");
18873
18886
  var leftIn = /* @__PURE__ */ __name(({ items }) => items.some((one) => one.membershipState === "left"), "leftIn");
18874
- var chatIdAmong = /* @__PURE__ */ __name(async (messenger, reference, account, { held, renamed, left }) => {
18887
+ var profilesOnAccount = /* @__PURE__ */ __name((store, app, provider) => async (account) => {
18888
+ if (app === void 0)
18889
+ return void 0;
18890
+ return Object.entries((await store.accounts.profiles())[app] ?? {}).filter(([, key]) => key.provider === provider && key.account === account).map(([name]) => name);
18891
+ }, "profilesOnAccount");
18892
+ var chatIdAmong = /* @__PURE__ */ __name(async (messenger, reference, account, { held, renamed, left, profilesOn }) => {
18875
18893
  const trimmed = reference.trim();
18876
18894
  if (messenger.savedChatId && ["me", "self", "saved"].includes(trimmed.toLowerCase())) {
18877
18895
  return messenger.savedChatId(account);
18878
18896
  }
18879
- if (/^-?\d+$/.test(trimmed)) {
18880
- const id2 = await renamed(trimmed) ?? trimmed;
18897
+ const named2 = chatReferenceOf(trimmed, account.provider);
18898
+ if (named2)
18899
+ await ensureAccount(named2, { account: account.account }, profilesOn);
18900
+ if (named2 || /^-?\d+$/.test(trimmed)) {
18901
+ const typed = named2?.chat ?? trimmed;
18902
+ const id2 = await renamed(typed) ?? typed;
18881
18903
  if (await left?.(id2))
18882
18904
  throw new CliError("not_found", `you left chat ${id2}`);
18883
18905
  return id2;
@@ -18958,7 +18980,7 @@ var senderAmong = /* @__PURE__ */ __name(async (store, accounts, reference) => {
18958
18980
  }
18959
18981
  }, "senderAmong");
18960
18982
 
18961
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/chats.js
18983
+ // 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/services/chats.js
18962
18984
  var EVENTS_DAYS = 7;
18963
18985
  var TRACKED_DAYS = 30;
18964
18986
  var STATS_PAGE = 1e3;
@@ -19006,10 +19028,10 @@ var chatsService = /* @__PURE__ */ __name((deps) => ({
19006
19028
  show: /* @__PURE__ */ __name(async (chat) => {
19007
19029
  if (fromStore(deps)) {
19008
19030
  const store = await accountStore(deps);
19009
- const pushed2 = deps.reads === "store";
19010
- const missing4 = /* @__PURE__ */ __name((id3) => new CliError("not_found", pushed2 ? nothingStored(deps.messenger) : `no stored chat ${id3}`), "missing");
19031
+ const pushed3 = deps.reads === "store";
19032
+ const missing4 = /* @__PURE__ */ __name((id3) => new CliError("not_found", pushed3 ? nothingStored(deps.messenger) : `no stored chat ${id3}`), "missing");
19011
19033
  const id2 = await chatIdIn(deps.messenger, chat, store, { includeLeft: true }).catch((error) => {
19012
- throw pushed2 && codeOf(error) === "not_found" ? missing4(chat) : error;
19034
+ throw pushed3 && codeOf(error) === "not_found" ? missing4(chat) : error;
19013
19035
  });
19014
19036
  const found = (await store.chats.chats({ includeLeft: true })).items.find((one) => one.id === id2);
19015
19037
  if (!found)
@@ -19253,7 +19275,7 @@ var storedMembers = /* @__PURE__ */ __name(async (store, chatId) => {
19253
19275
  return members.length === 0 ? null : members;
19254
19276
  }, "storedMembers");
19255
19277
 
19256
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/inbox.js
19278
+ // 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/services/inbox.js
19257
19279
  var INBOX_CHATS = 20;
19258
19280
  var REVIEW_DAYS = 3;
19259
19281
  var UNANSWERED_HOURS = 24;
@@ -19461,7 +19483,7 @@ var inboxService = /* @__PURE__ */ __name((deps) => {
19461
19483
  };
19462
19484
  }, "inboxService");
19463
19485
 
19464
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/person-context.js
19486
+ // 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/services/person-context.js
19465
19487
  var CONTEXT_MESSAGES = 10;
19466
19488
  var CONTEXT_BYTES = 64 * 1024;
19467
19489
  var toContext = /* @__PURE__ */ __name((key, message, chatTitle) => ({
@@ -19623,7 +19645,7 @@ var recordContext = /* @__PURE__ */ __name(async (store, record2, reads, { messa
19623
19645
  mentions: mentions.slice(0, messages)
19624
19646
  };
19625
19647
  cut ||= direct.length > messages || groups.length > messages || mentions.length > messages;
19626
- const kept = withinBytes(lists, bytes2);
19648
+ const kept2 = withinBytes(lists, bytes2);
19627
19649
  return {
19628
19650
  shared: shared.sort((a, b) => Date.parse(b.lastMessageAt ?? "") - Date.parse(a.lastMessageAt ?? "")),
19629
19651
  last: {
@@ -19631,14 +19653,14 @@ var recordContext = /* @__PURE__ */ __name(async (store, record2, reads, { messa
19631
19653
  fromMe: each.find((message) => message.outgoing === true) ?? null,
19632
19654
  fromThemAnywhere: theirs[0] ?? null
19633
19655
  },
19634
- recent: { direct: kept.direct, groups: kept.groups },
19635
- mentions: kept.mentions,
19656
+ recent: { direct: kept2.direct, groups: kept2.groups },
19657
+ mentions: kept2.mentions,
19636
19658
  events: {
19637
19659
  upcoming: upcoming.items.map(contextEvent),
19638
19660
  recent: past.items.filter(({ id: id2 }) => !upcomingIds.has(id2)).map(contextEvent)
19639
19661
  },
19640
19662
  limits: { messages, bytes: bytes2 },
19641
- hasMore: cut || kept.cut,
19663
+ hasMore: cut || kept2.cut,
19642
19664
  complete: notRead.length === 0,
19643
19665
  notRead
19644
19666
  };
@@ -19722,10 +19744,10 @@ var personMessages = /* @__PURE__ */ __name(async (store, asked, reference, { ch
19722
19744
  };
19723
19745
  }, "personMessages");
19724
19746
 
19725
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
19747
+ // 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/services/meeting-evidence.js
19726
19748
  import { createHash } from "node:crypto";
19727
19749
 
19728
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/meeting-reference.js
19750
+ // 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/services/meeting-reference.js
19729
19751
  var missing2 = /* @__PURE__ */ __name(() => new CliError("not_found", "the meeting evidence is unavailable for this account"), "missing");
19730
19752
  var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId, reference, options = {}) => {
19731
19753
  const parsed = parseMeetingReference(reference);
@@ -19743,7 +19765,7 @@ var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId,
19743
19765
  return { parsed, meeting };
19744
19766
  }, "authorizedMeetingMetadata");
19745
19767
 
19746
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
19768
+ // 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/services/meeting-evidence.js
19747
19769
  var hash = /* @__PURE__ */ __name((value) => createHash("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
19748
19770
  var checkMeetingCancelled = /* @__PURE__ */ __name((signal) => {
19749
19771
  if (signal?.aborted)
@@ -19942,7 +19964,7 @@ var readMeetingEvidence = /* @__PURE__ */ __name(async (store, accountId, refere
19942
19964
  return { ...packet, fingerprint: hash(packet) };
19943
19965
  }, "readMeetingEvidence");
19944
19966
 
19945
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/person-meeting-context.js
19967
+ // 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/services/person-meeting-context.js
19946
19968
  var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference, options) => {
19947
19969
  const { meetings = 10, cues = 5, bytes: bytes2 = 64 * 1024, scanLimit = 1e3, since, signal } = options;
19948
19970
  const requestedAccounts = options.accountIds;
@@ -20041,7 +20063,7 @@ var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference,
20041
20063
  };
20042
20064
  }, "personMeetingContext");
20043
20065
 
20044
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/person-preparation.js
20066
+ // 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/services/person-preparation.js
20045
20067
  var PREPARE_BYTES = 96 * 1024;
20046
20068
  var MEETINGS = 5;
20047
20069
  var CUES = 3;
@@ -20158,7 +20180,7 @@ var meetingsOf = /* @__PURE__ */ __name(async (store, uid, stored, since, left)
20158
20180
  }
20159
20181
  }, "meetingsOf");
20160
20182
 
20161
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/person-profile.js
20183
+ // 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/services/person-profile.js
20162
20184
  var personProfile = /* @__PURE__ */ __name(async (deps, person, known2) => {
20163
20185
  const online = deps.offline ? void 0 : await deps.connection();
20164
20186
  const held = await storeIfOpen(deps);
@@ -20228,7 +20250,7 @@ var quiet = /* @__PURE__ */ __name((facts) => facts.chats.map(({ id: id2, title,
20228
20250
  complete: false
20229
20251
  })), "quiet");
20230
20252
 
20231
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/person-timeline.js
20253
+ // 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/services/person-timeline.js
20232
20254
  var TIMELINE_ITEMS = 50;
20233
20255
  var TIMELINE_MAX = 500;
20234
20256
  var SCOPES = ["personal", "work"];
@@ -20283,7 +20305,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
20283
20305
  };
20284
20306
  }, "personTimeline");
20285
20307
 
20286
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/people.js
20308
+ // 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/services/people.js
20287
20309
  var peopleService = /* @__PURE__ */ __name((deps) => {
20288
20310
  const localCard = /* @__PURE__ */ __name(async (card, includeNotes = false) => {
20289
20311
  const held = await storeIfOpen(deps);
@@ -20510,7 +20532,7 @@ var withoutPhone = /* @__PURE__ */ __name((answer) => {
20510
20532
  return rest;
20511
20533
  }, "withoutPhone");
20512
20534
 
20513
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/task-tag-filters.js
20535
+ // 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/services/task-tag-filters.js
20514
20536
  var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
20515
20537
  const tags = /* @__PURE__ */ new Map();
20516
20538
  for (const node of query ? walkQuery(query.root) : [])
@@ -20519,7 +20541,7 @@ var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
20519
20541
  return tags;
20520
20542
  }, "taskTagFilters");
20521
20543
 
20522
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/tasks.js
20544
+ // 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/services/tasks.js
20523
20545
  var TASK_QUERY = {
20524
20546
  entity: "task",
20525
20547
  backend: "sql",
@@ -20746,7 +20768,7 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
20746
20768
  const link4 = {
20747
20769
  from: (await store.tasks.details(target2.id)).ref,
20748
20770
  kind: "evidence",
20749
- origin: origin === "owner" ? "owner" : "suggested"
20771
+ ...origin === "owner" ? { origin: "owner", by: "owner" } : { origin: "suggested", confirmed: false }
20750
20772
  };
20751
20773
  try {
20752
20774
  await store.notes.addLink({ ...link4, to: note ? note.ref : source });
@@ -20912,15 +20934,15 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
20912
20934
  account: account.account,
20913
20935
  chat: await storedChatId(deps.messenger, chat, store2, account, { includeLeft: true })
20914
20936
  })));
20915
- const origin = by === "owner" ? "owner" : "suggested";
20937
+ const origin = by === "owner" ? { origin: "owner", by: "owner" } : { origin: "suggested", confirmed: false };
20916
20938
  for (const target2 of [...written, ...chatRefs]) {
20917
20939
  try {
20918
- await store2.notes.addLink({ from, to: target2, kind, origin });
20940
+ await store2.notes.addLink({ from, to: target2, kind, ...origin });
20919
20941
  } catch (error) {
20920
20942
  const unsaved = error instanceof CliError && error.code === "not_found" && target2.startsWith("msg:");
20921
20943
  if (!unsaved && !(error instanceof CliError && error.code === "validation_error"))
20922
20944
  throw error;
20923
- await store2.notes.addLink({ from, targetText: target2, kind, origin });
20945
+ await store2.notes.addLink({ from, targetText: target2, kind, ...origin });
20924
20946
  }
20925
20947
  }
20926
20948
  if (!written.some((target2) => target2.startsWith("msg:")))
@@ -20999,7 +21021,7 @@ var taskView = /* @__PURE__ */ __name(async (store, account, task2) => {
20999
21021
  };
21000
21022
  }, "taskView");
21001
21023
 
21002
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/chat-coverage.js
21024
+ // 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/services/chat-coverage.js
21003
21025
  var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
21004
21026
  const ids = [...new Set(chatIds)];
21005
21027
  if (ids.length === 0)
@@ -21025,7 +21047,250 @@ var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
21025
21047
  }));
21026
21048
  }, "chatCoverage");
21027
21049
 
21028
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/context/evidence-response.js
21050
+ // 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/services/agenda.js
21051
+ var DAY = 864e5;
21052
+ var AGENDA_DEFAULTS = { unanswered: DAY, waiting: 7 * DAY };
21053
+ var CLAIMS = ["none", "mine", "others", "any"];
21054
+ var TASK_FIELDS = /* @__PURE__ */ new Set(["tag", "category", "claimed"]);
21055
+ var AGENDA_QUERY = {
21056
+ entity: "agenda",
21057
+ backend: "sql",
21058
+ fields: queryFieldsOf(agenda, {
21059
+ exclude: ["at", "account", "stored_at", "stale"],
21060
+ relations: {
21061
+ chat_kind: {
21062
+ type: "enum",
21063
+ values: CHAT_KINDS,
21064
+ example: "chat_kind:channel",
21065
+ relation: "the kind of the chats in owed, waiting and unsynced"
21066
+ },
21067
+ tag: { type: "kw", example: "tag:urgent", relation: "a tag put on a listed task with tags add --task" },
21068
+ category: { type: "kw", example: "category:money", relation: "a listed task's category" },
21069
+ claimed: {
21070
+ type: "enum",
21071
+ values: CLAIMS,
21072
+ example: "claimed:any",
21073
+ relation: "whose claim a listed task is under: none, mine (--holder), others, or any"
21074
+ }
21075
+ }
21076
+ }),
21077
+ defaults: ["chat_kind:(dialog OR group)", "claimed:(none OR mine)"]
21078
+ };
21079
+ var agendaService = /* @__PURE__ */ __name((deps, now = Date.now) => ({
21080
+ show: /* @__PURE__ */ __name(async ({ dueWithin = DAY, waiting = AGENDA_DEFAULTS.waiting, unanswered: unanswered2 = AGENDA_DEFAULTS.unanswered, within = 30 * DAY, query, holder } = {}) => {
21081
+ const [store, account] = [await deps.store(), await deps.account()];
21082
+ const at = now();
21083
+ const parts = query ? split(query) : { tasks: void 0, chats: void 0 };
21084
+ const find = /* @__PURE__ */ __name((where2) => store.tasks.find({ project: inboxKey(taskAccount(account)), status: "open", limit: 500, ...where2 ? { where: where2 } : {} }).catch((error) => {
21085
+ if (error instanceof Error && "code" in error && error.code === "not_found")
21086
+ return [];
21087
+ throw error;
21088
+ }), "find");
21089
+ const open7 = await find();
21090
+ const tags = await taskTagFilters(store, parts.tasks);
21091
+ const listed2 = parts.tasks ? await find(queryFilter(parts.tasks, taskColumns2(holder, at, tags), { command: "tasks agenda" })) : open7;
21092
+ const tasks = listed2.map((task2) => ({ task: task2, reasons: reasonsOf(task2, at, dueWithin) })).filter(({ reasons }) => reasons.length > 0).sort((a, b) => urgency(a.task) - urgency(b.task)).map(({ task: task2, reasons }) => ({
21093
+ id: task2.id,
21094
+ key: task2.key,
21095
+ title: task2.title,
21096
+ type: task2.type,
21097
+ category: task2.category,
21098
+ source: task2.source,
21099
+ dueAt: task2.dueAt,
21100
+ nextCheckAt: task2.nextCheckAt,
21101
+ claimedBy: task2.claimedBy,
21102
+ claimedUntil: task2.claimedUntil,
21103
+ closeSuggestion: task2.closeSuggestion,
21104
+ createdAt: task2.createdAt,
21105
+ reasons
21106
+ }));
21107
+ const assigned = listed2.map((task2) => ({
21108
+ task: task2,
21109
+ assignees: task2.assignments.filter((one) => one.role === "assignee").map((one) => one.to)
21110
+ })).filter(({ assignees }) => assignees.length > 0).sort((a, b) => Date.parse(a.task.createdAt) - Date.parse(b.task.createdAt)).map(({ task: task2, assignees }) => ({
21111
+ id: task2.id,
21112
+ key: task2.key,
21113
+ title: task2.title,
21114
+ type: task2.type,
21115
+ category: task2.category,
21116
+ source: task2.source,
21117
+ dueAt: task2.dueAt,
21118
+ createdAt: task2.createdAt,
21119
+ assignees
21120
+ }));
21121
+ const where = parts.chats ? queryFilter(parts.chats, AGENDA_COLUMNS, { command: "tasks agenda" }) : void 0;
21122
+ const activity = await store.chats.chatActivity(account, at - within, where);
21123
+ const chats = activity.chats.map(({ lastMessageId, ...chat }) => ({
21124
+ ...chat,
21125
+ lastMessage: lastMessageId === null ? null : formatLocator({
21126
+ provider: account.provider,
21127
+ account: account.account,
21128
+ chat: chat.chatId,
21129
+ message: lastMessageId
21130
+ }),
21131
+ openTasks: open7.filter((task2) => chatOf(task2.source) === chat.chatId).map((task2) => task2.id)
21132
+ }));
21133
+ const silentFor = /* @__PURE__ */ __name((chat) => at - Date.parse(chat.lastMessageAt), "silentFor");
21134
+ const shown = {
21135
+ owed: chats.filter((chat) => chat.lastFromOwner === false && silentFor(chat) >= unanswered2),
21136
+ waiting: chats.filter((chat) => chat.lastFromOwner === true && silentFor(chat) >= waiting),
21137
+ unsynced: chats.filter((chat) => chat.lastMessage === null)
21138
+ };
21139
+ const covered = new Map((await chatCoverage(store, account, Object.values(shown).flatMap((list2) => list2.map(({ chatId }) => chatId)))).map((one) => [one.chatId, one]));
21140
+ const withCoverage = /* @__PURE__ */ __name((list2) => list2.map((chat) => ({ ...chat, coverage: covered.get(chat.chatId) })), "withCoverage");
21141
+ const inList = new Set((await store.tasks.categories()).map(({ name }) => name));
21142
+ const unlisted = /* @__PURE__ */ new Map();
21143
+ for (const { category } of open7)
21144
+ if (category && !inList.has(category))
21145
+ unlisted.set(category, (unlisted.get(category) ?? 0) + 1);
21146
+ return {
21147
+ at: new Date(at).toISOString(),
21148
+ since: new Date(at - within).toISOString(),
21149
+ account: taskAccount(account),
21150
+ storedAt: activity.storedAt,
21151
+ stale: activity.storedAt === null || at - Date.parse(activity.storedAt) > DAY,
21152
+ tasks,
21153
+ owed: withCoverage(shown.owed),
21154
+ waiting: withCoverage(shown.waiting),
21155
+ unsynced: withCoverage(shown.unsynced),
21156
+ assigned,
21157
+ unlistedCategories: [...unlisted].sort().map(([name, openTasks]) => ({ name, openTasks }))
21158
+ };
21159
+ }, "show")
21160
+ }), "agendaService");
21161
+ var split = /* @__PURE__ */ __name((query) => {
21162
+ const clauses = [];
21163
+ const flatten = /* @__PURE__ */ __name((node) => {
21164
+ if (node.kind === "boolean" && node.clauses.every((clause) => clause.occur === "must"))
21165
+ for (const clause of node.clauses)
21166
+ flatten(clause.node);
21167
+ else
21168
+ clauses.push(node);
21169
+ }, "flatten");
21170
+ flatten(query.root);
21171
+ const side = /* @__PURE__ */ __name((node) => {
21172
+ const fields = new Set(walkQuery(node).map((term) => TASK_FIELDS.has(term.field) ? "tasks" : "chats"));
21173
+ if (fields.size > 1)
21174
+ queryError("query.unsupported-placement", node.span, "join task fields (tag, category, claimed) and chat_kind with AND, not OR or NOT", { command: "tasks agenda" });
21175
+ return [...fields][0];
21176
+ }, "side");
21177
+ const of = /* @__PURE__ */ __name((which) => {
21178
+ const own = clauses.filter((node) => side(node) === which);
21179
+ if (own.length === 0)
21180
+ return void 0;
21181
+ return {
21182
+ ...query,
21183
+ root: { kind: "boolean", clauses: own.map((node) => ({ occur: "must", node })), span: query.root.span }
21184
+ };
21185
+ }, "of");
21186
+ return { tasks: of("tasks"), chats: of("chats") };
21187
+ }, "split");
21188
+ var taskColumns2 = /* @__PURE__ */ __name((holder, at, tags) => ({
21189
+ tag: { where: /* @__PURE__ */ __name((node) => tags.get(node.value) ?? { sql: "0", params: [] }, "where") },
21190
+ category: { type: "kw", sql: "t.category" },
21191
+ claimed: {
21192
+ where: /* @__PURE__ */ __name((node) => {
21193
+ const claim = node.value.toLowerCase();
21194
+ if (claim === "any")
21195
+ return { sql: "1", params: [] };
21196
+ if (claim === "none")
21197
+ return { sql: "t.claimed_by IS NULL OR t.claimed_until < ?", params: [at] };
21198
+ if (claim === "mine")
21199
+ return {
21200
+ sql: "t.claimed_by IS NOT NULL AND t.claimed_by = ? AND t.claimed_until >= ?",
21201
+ params: [holder ?? null, at]
21202
+ };
21203
+ return {
21204
+ sql: "t.claimed_by IS NOT NULL AND t.claimed_by IS NOT ? AND t.claimed_until >= ?",
21205
+ params: [holder ?? null, at]
21206
+ };
21207
+ }, "where")
21208
+ }
21209
+ }), "taskColumns");
21210
+ var reasonsOf = /* @__PURE__ */ __name((task2, at, dueWithin) => {
21211
+ const due = task2.dueAt === null ? void 0 : Date.parse(task2.dueAt);
21212
+ const check2 = task2.nextCheckAt === null ? void 0 : Date.parse(task2.nextCheckAt);
21213
+ const reasons = [];
21214
+ if (due !== void 0 && due <= at)
21215
+ reasons.push("overdue");
21216
+ else if (due !== void 0 && due <= at + dueWithin)
21217
+ reasons.push("due");
21218
+ if (check2 !== void 0 && check2 <= at)
21219
+ reasons.push("check");
21220
+ if (due === void 0 && check2 === void 0)
21221
+ reasons.push("unplanned");
21222
+ if (task2.closeSuggestion !== null)
21223
+ reasons.push("close-suggested");
21224
+ return reasons;
21225
+ }, "reasonsOf");
21226
+ var urgency = /* @__PURE__ */ __name((task2) => {
21227
+ const dates = [task2.dueAt, task2.nextCheckAt].filter((one) => one !== null).map(Date.parse);
21228
+ return dates.length > 0 ? Math.min(...dates) : Date.parse(task2.createdAt);
21229
+ }, "urgency");
21230
+ var chatOf = /* @__PURE__ */ __name((source) => source !== null && isLocator(source) ? parseLocator(source).chat : void 0, "chatOf");
21231
+ var agendaItem = /* @__PURE__ */ __name((shown) => {
21232
+ const split2 = shown.account.indexOf(":");
21233
+ const [provider, account] = [shown.account.slice(0, split2), shown.account.slice(split2 + 1)];
21234
+ const chat = /* @__PURE__ */ __name((one) => ({
21235
+ chat: formatReference({ type: "chat", provider, account, chat: one.chatId }),
21236
+ title: one.title,
21237
+ kind: one.kind,
21238
+ last_message: one.lastMessage,
21239
+ last_message_at: one.lastMessageAt,
21240
+ last_from_owner: one.lastFromOwner,
21241
+ open_tasks: one.openTasks,
21242
+ completeness: {
21243
+ state: one.coverage.completeness.state,
21244
+ up_to_date: one.coverage.completeness.upToDate,
21245
+ gaps: one.coverage.completeness.gaps,
21246
+ reaches_start: one.coverage.completeness.reachesStart,
21247
+ fetched_at: one.coverage.completeness.fetchedAt
21248
+ },
21249
+ held: {
21250
+ messages: one.coverage.held.messages,
21251
+ oldest_at: one.coverage.held.oldestAt,
21252
+ newest_at: one.coverage.held.newestAt
21253
+ }
21254
+ }), "chat");
21255
+ return {
21256
+ at: shown.at,
21257
+ account: shown.account,
21258
+ stored_at: shown.storedAt,
21259
+ stale: shown.stale,
21260
+ tasks: shown.tasks.map((task2) => ({
21261
+ id: task2.id,
21262
+ key: task2.key,
21263
+ title: task2.title,
21264
+ kind: task2.type,
21265
+ category: task2.category,
21266
+ source: task2.source,
21267
+ due_at: task2.dueAt,
21268
+ next_check_at: task2.nextCheckAt,
21269
+ claimed_by: task2.claimedBy,
21270
+ claimed_until: task2.claimedUntil,
21271
+ close_suggestion: task2.closeSuggestion,
21272
+ created_at: task2.createdAt,
21273
+ reasons: task2.reasons
21274
+ })),
21275
+ owed: shown.owed.map(chat),
21276
+ waiting: shown.waiting.map(chat),
21277
+ unsynced: shown.unsynced.map(chat),
21278
+ assigned: shown.assigned.map((task2) => ({
21279
+ id: task2.id,
21280
+ key: task2.key,
21281
+ title: task2.title,
21282
+ kind: task2.type,
21283
+ category: task2.category,
21284
+ source: task2.source,
21285
+ due_at: task2.dueAt,
21286
+ created_at: task2.createdAt,
21287
+ assignees: task2.assignees
21288
+ })),
21289
+ unlisted_categories: shown.unlistedCategories.map(({ name, openTasks }) => ({ name, open_tasks: openTasks }))
21290
+ };
21291
+ }, "agendaItem");
21292
+
21293
+ // 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/context/evidence-response.js
21029
21294
  var contextSourceKey = /* @__PURE__ */ __name((source) => JSON.stringify([source.kind, source.accountId, source.provider, source.account]), "contextSourceKey");
21030
21295
  var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
21031
21296
  const fail2 = /* @__PURE__ */ __name(() => {
@@ -21089,7 +21354,7 @@ var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
21089
21354
  }
21090
21355
  }, "validateContextEvidencePage");
21091
21356
 
21092
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/context/read-budget.js
21357
+ // 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/context/read-budget.js
21093
21358
  var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
21094
21359
  if (!limits || typeof limits !== "object" || Array.isArray(limits))
21095
21360
  throw new CliError("validation_error", "limits needs a context read allowance");
@@ -21142,7 +21407,7 @@ var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
21142
21407
  };
21143
21408
  }, "contextReadBudget");
21144
21409
 
21145
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/context-evidence.js
21410
+ // 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/services/context-evidence.js
21146
21411
  var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits) => {
21147
21412
  if (!port || typeof port.read !== "function")
21148
21413
  throw new CliError("configuration_error", "context evidence reader is unavailable");
@@ -21186,7 +21451,7 @@ var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits)
21186
21451
  };
21187
21452
  }, "createContextEvidenceReader");
21188
21453
 
21189
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/excerpt.js
21454
+ // 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/services/excerpt.js
21190
21455
  var queryWords = /* @__PURE__ */ __name((query) => query.toLowerCase().split(/\s+/).map((word) => word.replace(/^[\p{L}_]+:/u, "").replace(/~\d+$/u, "").replace(/^[^\p{L}\p{N}]+|[^\p{L}\p{N}]+$/gu, "")).filter((word) => word.length > 2 && !["and", "or", "not"].includes(word)), "queryWords");
21191
21456
  var excerpt = /* @__PURE__ */ __name((text2, query, size2 = 240, options = {}) => {
21192
21457
  const flat = text2.replace(/\s+/g, " ").trim();
@@ -21202,18 +21467,18 @@ var excerpt = /* @__PURE__ */ __name((text2, query, size2 = 240, options = {}) =
21202
21467
  }, "excerpt");
21203
21468
  var withExcerpt = /* @__PURE__ */ __name(({ matchedText, ...hit }, query) => ({ ...hit, excerpt: excerpt(matchedText ?? hit.text, query) }), "withExcerpt");
21204
21469
 
21205
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/media-archive.js
21470
+ // 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/services/media-archive.js
21206
21471
  import { setTimeout as sleep } from "node:timers/promises";
21207
21472
 
21208
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
21473
+ // 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/services/media-archive-files.js
21209
21474
  import { lstat } from "node:fs/promises";
21210
21475
 
21211
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
21476
+ // 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/persistence/native/recording-partial-store.js
21212
21477
  import { createHash as createHash3, randomUUID as randomUUID2 } from "node:crypto";
21213
21478
  import { open as open3, rename as rename2, unlink as unlink2 } from "node:fs/promises";
21214
21479
  import { join as join2 } from "node:path";
21215
21480
 
21216
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-metadata.js
21481
+ // 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/persistence/native/recording-partial-metadata.js
21217
21482
  import { createHash as createHash2 } from "node:crypto";
21218
21483
  var metadataLimit = 16384;
21219
21484
  var partialIdentity = /* @__PURE__ */ __name((locator) => JSON.stringify([locator.provider, locator.account, locator.occurrenceId, locator.assetId]), "partialIdentity");
@@ -21273,7 +21538,7 @@ var readPartialMetadata = /* @__PURE__ */ __name(async (path, locator, maxBytes,
21273
21538
  }
21274
21539
  }, "readPartialMetadata");
21275
21540
 
21276
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-writer.js
21541
+ // 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/persistence/native/recording-partial-writer.js
21277
21542
  import { randomUUID } from "node:crypto";
21278
21543
  import { open as open2, rename, unlink } from "node:fs/promises";
21279
21544
  import { join } from "node:path";
@@ -21365,7 +21630,7 @@ var partialWriter = /* @__PURE__ */ __name(async (input) => {
21365
21630
  };
21366
21631
  }, "partialWriter");
21367
21632
 
21368
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
21633
+ // 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/persistence/native/recording-partial-store.js
21369
21634
  var NativeRecordingPartialStore = class {
21370
21635
  static {
21371
21636
  __name(this, "NativeRecordingPartialStore");
@@ -21472,12 +21737,12 @@ var NativeRecordingPartialStore = class {
21472
21737
  }
21473
21738
  };
21474
21739
 
21475
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
21740
+ // 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/persistence/native/recording-publication.js
21476
21741
  import { createHash as createHash4 } from "node:crypto";
21477
21742
  import { link as link2 } from "node:fs/promises";
21478
21743
  import { basename as basename2, dirname as dirname2, join as join4, resolve as resolve2 } from "node:path";
21479
21744
 
21480
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-files.js
21745
+ // 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/persistence/native/recording-publication-files.js
21481
21746
  import { unlink as unlink3 } from "node:fs/promises";
21482
21747
  var verifiedPublicationFile = /* @__PURE__ */ __name(async (path, expected, signal, writable = false) => {
21483
21748
  signal?.throwIfAborted();
@@ -21512,7 +21777,7 @@ var commitPublication = /* @__PURE__ */ __name(async (root, partialPath, finalPa
21512
21777
  signal?.throwIfAborted();
21513
21778
  }, "commitPublication");
21514
21779
 
21515
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-journal.js
21780
+ // 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/persistence/native/recording-publication-journal.js
21516
21781
  import { randomUUID as randomUUID3 } from "node:crypto";
21517
21782
  import { open as open4, rename as rename3, unlink as unlink4 } from "node:fs/promises";
21518
21783
  import { join as join3 } from "node:path";
@@ -21585,7 +21850,7 @@ var writePublicationJournal = /* @__PURE__ */ __name(async (root, path, prefix,
21585
21850
  }
21586
21851
  }, "writePublicationJournal");
21587
21852
 
21588
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
21853
+ // 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/persistence/native/recording-publication.js
21589
21854
  var NativeRecordingPublication = class {
21590
21855
  static {
21591
21856
  __name(this, "NativeRecordingPublication");
@@ -21658,7 +21923,7 @@ var NativeRecordingPublication = class {
21658
21923
  }
21659
21924
  };
21660
21925
 
21661
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/media-archive-manifest.js
21926
+ // 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/services/media-archive-manifest.js
21662
21927
  import { createHash as createHash5 } from "node:crypto";
21663
21928
  import { readdir } from "node:fs/promises";
21664
21929
  import { isAbsolute as isAbsolute2, join as join5, resolve as resolve3 } from "node:path";
@@ -21745,7 +22010,7 @@ var commitMediaEntry = /* @__PURE__ */ __name((root, one, beforePublish) => writ
21745
22010
  beforePublish
21746
22011
  }), "commitMediaEntry");
21747
22012
 
21748
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
22013
+ // 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/services/media-archive-files.js
21749
22014
  var validator = '"media-completed-v1"';
21750
22015
  var maximumFileBytes = 64 * 1024 * 1024 * 1024;
21751
22016
  var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file, beforeWrite, signal, metadata = {}) => {
@@ -21846,7 +22111,7 @@ var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file,
21846
22111
  return entry;
21847
22112
  }, "archiveMediaFile");
21848
22113
 
21849
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/media-archive-locks.js
22114
+ // 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/services/media-archive-locks.js
21850
22115
  import { mkdir, realpath } from "node:fs/promises";
21851
22116
  import { join as join6, resolve as resolve4 } from "node:path";
21852
22117
  var archiveLocations = /* @__PURE__ */ __name(async (initial, signal) => {
@@ -21913,7 +22178,7 @@ var withMediaArchiveLocks = /* @__PURE__ */ __name(async (directory2, signal, ru
21913
22178
  throw new CliError("validation_error", "archive locations changed during locking; run the command again");
21914
22179
  }, "withMediaArchiveLocks");
21915
22180
 
21916
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/media-archive.js
22181
+ // 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/services/media-archive.js
21917
22182
  var validateMediaSince = /* @__PURE__ */ __name((value, flag = "--since-time") => {
21918
22183
  if (value === void 0)
21919
22184
  return void 0;
@@ -22066,7 +22331,7 @@ var archiveMedia = /* @__PURE__ */ __name(async (ports, options) => {
22066
22331
  }, { create: true });
22067
22332
  }, "archiveMedia");
22068
22333
 
22069
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/media-archive-move.js
22334
+ // 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/services/media-archive-move.js
22070
22335
  import { realpath as realpath2, unlink as unlink5 } from "node:fs/promises";
22071
22336
  import { basename as basename3, dirname as dirname3, join as join7, resolve as resolve5 } from "node:path";
22072
22337
  var canonicalDestination = /* @__PURE__ */ __name(async (directory2) => {
@@ -22219,7 +22484,7 @@ var moveMediaArchive = /* @__PURE__ */ __name(async (options) => {
22219
22484
  }, { additional: [target2], createAdditional: !options.dryRun });
22220
22485
  }, "moveMediaArchive");
22221
22486
 
22222
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/model-downloads.js
22487
+ // 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/services/model-downloads.js
22223
22488
  var bytesOf = /* @__PURE__ */ __name((model) => model.files.reduce((sum2, file) => sum2 + file.bytes, 0), "bytesOf");
22224
22489
  var nativeRuntime = /* @__PURE__ */ __name(async ({ env, progress = /* @__PURE__ */ __name(() => {
22225
22490
  }, "progress") }) => {
@@ -22242,7 +22507,7 @@ var downloadTextModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
22242
22507
  }
22243
22508
  await nativeRuntime({ env, progress });
22244
22509
  progress(`${model.id}: loading it once to check it works`);
22245
- const { openEmbedder: openEmbedder2 } = await import("./embed-AVKPYK4V.js");
22510
+ const { openEmbedder: openEmbedder2 } = await import("./embed-N56P6YVY.js");
22246
22511
  const embedder = await openEmbedder2(model, directory2);
22247
22512
  try {
22248
22513
  const [vector] = await embedder.embed(["check"], "query");
@@ -22263,7 +22528,7 @@ var downloadRerankModel = /* @__PURE__ */ __name(async (id2, { env, progress = /
22263
22528
  }
22264
22529
  await nativeRuntime({ env, progress });
22265
22530
  progress(`${model.id}: loading it once to check it works`);
22266
- const { openReranker } = await import("./rerank-IFTSO576.js");
22531
+ const { openReranker } = await import("./rerank-DP2Y3WDT.js");
22267
22532
  const reranker = await openReranker(model, directory2);
22268
22533
  try {
22269
22534
  await reranker.score("check", ["check"]);
@@ -22281,7 +22546,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
22281
22546
  await installFiles(placedImage(model, directory2), { progress });
22282
22547
  }
22283
22548
  progress(`${model.id}: loading it once to check it works`);
22284
- const { openPictureEmbedder } = await import("./embedder-PSV2E5TR.js");
22549
+ const { openPictureEmbedder } = await import("./embedder-QLYKFLOL.js");
22285
22550
  const embedder = await openPictureEmbedder(model, directory2);
22286
22551
  try {
22287
22552
  const vector = await embedder.embedQuery("check");
@@ -22293,7 +22558,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
22293
22558
  return { model, directory: directory2 };
22294
22559
  }, "downloadImageModel");
22295
22560
 
22296
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/project-gathering-around.js
22561
+ // 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/services/project-gathering-around.js
22297
22562
  var storedMessageNeighbours = /* @__PURE__ */ __name((messages) => ({
22298
22563
  async around(ref, window3) {
22299
22564
  const at = parseLocator(ref);
@@ -22388,9 +22653,9 @@ var storedNeighbours = /* @__PURE__ */ __name((store) => {
22388
22653
  };
22389
22654
  }, "storedNeighbours");
22390
22655
 
22391
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/project-gathering-request.js
22656
+ // 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/services/project-gathering-request.js
22392
22657
  import { createHash as createHash6 } from "node:crypto";
22393
- var DAY = 864e5;
22658
+ var DAY2 = 864e5;
22394
22659
  var MAX_TIME = 864e13;
22395
22660
  var CONTEXT_CHUNK_DAYS = 90;
22396
22661
  var LIMITS = {
@@ -22591,10 +22856,10 @@ var projectGatheringRequest = /* @__PURE__ */ __name((input, now) => {
22591
22856
  const window3 = explicit ? (() => {
22592
22857
  const after = whole(input.after, "after", 0, MAX_TIME);
22593
22858
  const before2 = whole(input.before ?? asOf ?? now, "before", after + 1, MAX_TIME);
22594
- if (before2 - after > LIMITS.lookbackDays * DAY)
22859
+ if (before2 - after > LIMITS.lookbackDays * DAY2)
22595
22860
  fail(`window must not exceed ${LIMITS.lookbackDays} days`, "after");
22596
22861
  return { after, before: before2, asOf: asOf ?? before2 };
22597
- })() : { after: Math.max(0, (asOf ?? now) - lookbackDays2 * DAY), before: asOf ?? now, asOf: asOf ?? now };
22862
+ })() : { after: Math.max(0, (asOf ?? now) - lookbackDays2 * DAY2), before: asOf ?? now, asOf: asOf ?? now };
22598
22863
  if (input.budgets !== void 0 && (!input.budgets || typeof input.budgets !== "object"))
22599
22864
  fail("budgets needs whole-run limits", "budgets");
22600
22865
  const given = input.budgets ?? {};
@@ -22644,8 +22909,8 @@ var projectGatheringRequest = /* @__PURE__ */ __name((input, now) => {
22644
22909
  }, "projectGatheringRequest");
22645
22910
  var contextChunks = /* @__PURE__ */ __name((after, before2) => {
22646
22911
  const chunks = [];
22647
- for (let end = before2; end > after; end -= CONTEXT_CHUNK_DAYS * DAY)
22648
- chunks.push({ after: Math.max(after, end - CONTEXT_CHUNK_DAYS * DAY), before: end });
22912
+ for (let end = before2; end > after; end -= CONTEXT_CHUNK_DAYS * DAY2)
22913
+ chunks.push({ after: Math.max(after, end - CONTEXT_CHUNK_DAYS * DAY2), before: end });
22649
22914
  return chunks;
22650
22915
  }, "contextChunks");
22651
22916
  var projectUnits = /* @__PURE__ */ __name((plan, window3) => {
@@ -22704,7 +22969,7 @@ var decodeCheckpoint = /* @__PURE__ */ __name((text2, plan) => {
22704
22969
  return value;
22705
22970
  }, "decodeCheckpoint");
22706
22971
 
22707
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/project-gathering.js
22972
+ // 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/services/project-gathering.js
22708
22973
  var terminal = /* @__PURE__ */ new Set(["done", "unavailable", "failed"]);
22709
22974
  var PAGE = 20;
22710
22975
  var PEOPLE = 20;
@@ -23108,7 +23373,7 @@ var peopleOf = /* @__PURE__ */ __name((items, senderOf) => {
23108
23373
  return [...byKey.values()].sort((a, b) => b.items - a.items || a.name.localeCompare(b.name));
23109
23374
  }, "peopleOf");
23110
23375
 
23111
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidate-matching.js
23376
+ // 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/services/meeting-project-candidate-matching.js
23112
23377
  var normalizedText = /* @__PURE__ */ __name((text2) => text2.normalize("NFKC").toLowerCase().replace(/\s+/gu, " "), "normalizedText");
23113
23378
  var termsOf = /* @__PURE__ */ __name((entry) => [
23114
23379
  { name: entry.name, kind: "canonical" },
@@ -23152,7 +23417,7 @@ var matchVocabularyTerms = /* @__PURE__ */ __name((catalog, texts) => {
23152
23417
  return result.sort((a, b) => Number(a.entry.id) - Number(b.entry.id));
23153
23418
  }, "matchVocabularyTerms");
23154
23419
 
23155
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/project-gathering-mentions.js
23420
+ // 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/services/project-gathering-mentions.js
23156
23421
  var KINDS = ["project", "tag", "topic"];
23157
23422
  var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering, options = {}) => {
23158
23423
  if (typeof vocabulary?.vocabulary !== "function")
@@ -23207,7 +23472,7 @@ var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering,
23207
23472
  };
23208
23473
  }, "findEvidenceMentions");
23209
23474
 
23210
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/stored-project-gathering.js
23475
+ // 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/services/stored-project-gathering.js
23211
23476
  var PROJECT_ID = /^project:[1-9]\d*$/;
23212
23477
  var canonicalProjectRef = /* @__PURE__ */ __name(async (store, reference) => {
23213
23478
  if (PROJECT_ID.test(reference)) {
@@ -23307,9 +23572,14 @@ var linkedChatsOf = /* @__PURE__ */ __name(async (store, project) => {
23307
23572
  continue;
23308
23573
  const reference = parseReference(relation.from);
23309
23574
  if (reference.type === "chat")
23310
- chats.push(reference);
23575
+ chats.push({
23576
+ provider: reference.provider,
23577
+ account: reference.account,
23578
+ chat: reference.chat,
23579
+ role: relation.role
23580
+ });
23311
23581
  }
23312
- return chats.map(({ provider, account, chat }) => ({ provider, account, chat }));
23582
+ return chats;
23313
23583
  }, "linkedChatsOf");
23314
23584
  var gatherStoredProject = /* @__PURE__ */ __name(async (store, input) => {
23315
23585
  if (input.asOf !== void 0 && input.after !== void 0 && input.asOf <= input.after)
@@ -23327,7 +23597,7 @@ var gatherStoredProject = /* @__PURE__ */ __name(async (store, input) => {
23327
23597
  const members = await memberLanesOf(store, project.ref, new Set(contacts.flatMap((one) => one.reference ?? [])), room);
23328
23598
  const people = [...contacts, ...members.lanes];
23329
23599
  const linked = await linkedChatsOf(store, project.ref);
23330
- const linkedChats = linked.slice(0, LINKED_CHATS);
23600
+ const linkedChats = linked.slice(0, LINKED_CHATS).map(({ provider, account, chat }) => ({ provider, account, chat }));
23331
23601
  const budgets = {
23332
23602
  ...input.maxReads === void 0 ? {} : { maxReads: input.maxReads },
23333
23603
  ...input.limit === void 0 ? {} : { maxItems: input.limit },
@@ -23373,7 +23643,7 @@ var gatherStoredProject = /* @__PURE__ */ __name(async (store, input) => {
23373
23643
  return { projectRef: project.ref, unreadSources: [...unread, ...unreadChats, ...members.left], ...gathered, mentions };
23374
23644
  }, "gatherStoredProject");
23375
23645
 
23376
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/account.js
23646
+ // 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/services/account.js
23377
23647
  var accountService = /* @__PURE__ */ __name((deps) => {
23378
23648
  const online = /* @__PURE__ */ __name(async (command) => {
23379
23649
  if (deps.offline)
@@ -23445,7 +23715,7 @@ var accountService = /* @__PURE__ */ __name((deps) => {
23445
23715
  };
23446
23716
  }, "accountService");
23447
23717
 
23448
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/domain/send-time.js
23718
+ // 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/send-time.js
23449
23719
  var MINUTE = 6e4;
23450
23720
  var YEAR = 365 * 24 * 60 * MINUTE;
23451
23721
  var DELAY = /^(\d+)(m|h|d)$/;
@@ -23464,7 +23734,7 @@ var sendTime = /* @__PURE__ */ __name((value, now = Date.now(), flag = "--at-tim
23464
23734
  return new Date(at - at % MINUTE).toISOString();
23465
23735
  }, "sendTime");
23466
23736
 
23467
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/admin.js
23737
+ // 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/services/admin.js
23468
23738
  var recordMembership = /* @__PURE__ */ __name(async (deps, operationId, done2, change, fix, write) => {
23469
23739
  try {
23470
23740
  const held = await accountStoreIfOpen(deps);
@@ -23711,7 +23981,7 @@ var linkLimits = /* @__PURE__ */ __name(({ approval, expires, maxUses }) => {
23711
23981
  return expires === void 0 ? void 0 : sendTime(expires, Date.now(), "--expire-time");
23712
23982
  }, "linkLimits");
23713
23983
 
23714
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/mail-search.js
23984
+ // 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/services/mail-search.js
23715
23985
  var THREADS_PAGE = 500;
23716
23986
  var threadsOf = /* @__PURE__ */ __name(async (store, key) => {
23717
23987
  const account = await store.accounts.storedAccount(key).catch(() => void 0);
@@ -23790,7 +24060,7 @@ var readMail = /* @__PURE__ */ __name(async (store, locator, { before: before2 =
23790
24060
  return thread.slice(Math.max(0, at - before2), at + after + 1).map((hit) => hit.id === message ? { ...hit, anchor: true } : hit);
23791
24061
  }, "readMail");
23792
24062
 
23793
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/search-kind.js
24063
+ // 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/services/search-kind.js
23794
24064
  var NO_MAIL = "no_mail";
23795
24065
  var MAIL = "email";
23796
24066
  var listContextOf = /* @__PURE__ */ __name(async (store, account, app, stored) => {
@@ -23837,7 +24107,7 @@ var accountsOfKind = /* @__PURE__ */ __name((kind, chosen, held, explicit, comma
23837
24107
  return chosenMail.map(({ provider, account }) => ({ provider, account }));
23838
24108
  }, "accountsOfKind");
23839
24109
 
23840
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/messages-search.js
24110
+ // 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/services/messages-search.js
23841
24111
  var MAIL_FIELDS = /* @__PURE__ */ new Set(["to", "cc", "bcc", "subject", "mailbox", "label", "is"]);
23842
24112
  var positiveSources = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "in" ? [node.value.toLowerCase()] : [] : node.clauses.filter(({ occur }) => occur !== "must_not").flatMap(({ node: node2 }) => positiveSources(node2)), "positiveSources");
23843
24113
  var prepareLucene = /* @__PURE__ */ __name(async (store, account, request, messenger) => {
@@ -24185,7 +24455,7 @@ var statsLucene = /* @__PURE__ */ __name(async (store, account, request, messeng
24185
24455
  };
24186
24456
  }, "statsLucene");
24187
24457
 
24188
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/rankings-selection.js
24458
+ // 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/services/rankings-selection.js
24189
24459
  var RANKING_SELECTION_BYTES = 64 * 1024;
24190
24460
  var object = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0, "object");
24191
24461
  function invalid(message = "ranking selection is invalid \u2014 obtain a new drilldown from stats top") {
@@ -24354,7 +24624,7 @@ var readRankingSelection = /* @__PURE__ */ __name(async (store, input) => {
24354
24624
  };
24355
24625
  }, "readRankingSelection");
24356
24626
 
24357
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/search-record.js
24627
+ // 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/services/search-record.js
24358
24628
  var canonical = /* @__PURE__ */ __name((value, nested = false) => Array.isArray(value) ? value.map((one) => canonical(one, true)) : value !== null && typeof value === "object" ? Object.fromEntries(Object.entries(value).filter(([, one]) => one !== void 0 && (nested || one !== false)).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([key, one]) => [key, canonical(one, true)])) : value, "canonical");
24359
24629
  var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
24360
24630
  command,
@@ -24364,7 +24634,7 @@ var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
24364
24634
  fieldsVersion: FIELD_VERSION
24365
24635
  }), "searchRecordOf");
24366
24636
 
24367
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/admin-statistics.js
24637
+ // 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/services/admin-statistics.js
24368
24638
  function invalid2(message) {
24369
24639
  throw new CliError("validation_error", message);
24370
24640
  }
@@ -24658,252 +24928,10 @@ var adminStatisticsService = /* @__PURE__ */ __name((deps) => ({
24658
24928
  }, "evidence")
24659
24929
  }), "adminStatisticsService");
24660
24930
 
24661
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/agenda.js
24662
- var DAY2 = 864e5;
24663
- var CLAIMS = ["none", "mine", "others", "any"];
24664
- var TASK_FIELDS = /* @__PURE__ */ new Set(["tag", "category", "claimed"]);
24665
- var AGENDA_QUERY = {
24666
- entity: "agenda",
24667
- backend: "sql",
24668
- fields: queryFieldsOf(agenda, {
24669
- exclude: ["at", "account", "stored_at", "stale"],
24670
- relations: {
24671
- chat_kind: {
24672
- type: "enum",
24673
- values: CHAT_KINDS,
24674
- example: "chat_kind:channel",
24675
- relation: "the kind of the chats in owed, waiting and unsynced"
24676
- },
24677
- tag: { type: "kw", example: "tag:urgent", relation: "a tag put on a listed task with tags add --task" },
24678
- category: { type: "kw", example: "category:money", relation: "a listed task's category" },
24679
- claimed: {
24680
- type: "enum",
24681
- values: CLAIMS,
24682
- example: "claimed:any",
24683
- relation: "whose claim a listed task is under: none, mine (--holder), others, or any"
24684
- }
24685
- }
24686
- }),
24687
- defaults: ["chat_kind:(dialog OR group)", "claimed:(none OR mine)"]
24688
- };
24689
- var agendaService = /* @__PURE__ */ __name((deps, now = Date.now) => ({
24690
- show: /* @__PURE__ */ __name(async ({ dueWithin = DAY2, waiting = 7 * DAY2, unanswered: unanswered2 = DAY2, within = 30 * DAY2, query, holder } = {}) => {
24691
- const [store, account] = [await deps.store(), await deps.account()];
24692
- const at = now();
24693
- const parts = query ? split(query) : { tasks: void 0, chats: void 0 };
24694
- const find = /* @__PURE__ */ __name((where2) => store.tasks.find({ project: inboxKey(taskAccount(account)), status: "open", limit: 500, ...where2 ? { where: where2 } : {} }).catch((error) => {
24695
- if (error instanceof Error && "code" in error && error.code === "not_found")
24696
- return [];
24697
- throw error;
24698
- }), "find");
24699
- const open7 = await find();
24700
- const tags = await taskTagFilters(store, parts.tasks);
24701
- const listed2 = parts.tasks ? await find(queryFilter(parts.tasks, taskColumns2(holder, at, tags), { command: "tasks agenda" })) : open7;
24702
- const tasks = listed2.map((task2) => ({ task: task2, reasons: reasonsOf(task2, at, dueWithin) })).filter(({ reasons }) => reasons.length > 0).sort((a, b) => urgency(a.task) - urgency(b.task)).map(({ task: task2, reasons }) => ({
24703
- id: task2.id,
24704
- key: task2.key,
24705
- title: task2.title,
24706
- type: task2.type,
24707
- category: task2.category,
24708
- source: task2.source,
24709
- dueAt: task2.dueAt,
24710
- nextCheckAt: task2.nextCheckAt,
24711
- claimedBy: task2.claimedBy,
24712
- claimedUntil: task2.claimedUntil,
24713
- closeSuggestion: task2.closeSuggestion,
24714
- createdAt: task2.createdAt,
24715
- reasons
24716
- }));
24717
- const assigned = listed2.map((task2) => ({
24718
- task: task2,
24719
- assignees: task2.assignments.filter((one) => one.role === "assignee").map((one) => one.to)
24720
- })).filter(({ assignees }) => assignees.length > 0).sort((a, b) => Date.parse(a.task.createdAt) - Date.parse(b.task.createdAt)).map(({ task: task2, assignees }) => ({
24721
- id: task2.id,
24722
- key: task2.key,
24723
- title: task2.title,
24724
- type: task2.type,
24725
- category: task2.category,
24726
- source: task2.source,
24727
- dueAt: task2.dueAt,
24728
- createdAt: task2.createdAt,
24729
- assignees
24730
- }));
24731
- const where = parts.chats ? queryFilter(parts.chats, AGENDA_COLUMNS, { command: "tasks agenda" }) : void 0;
24732
- const activity = await store.chats.chatActivity(account, at - within, where);
24733
- const chats = activity.chats.map(({ lastMessageId, ...chat }) => ({
24734
- ...chat,
24735
- lastMessage: lastMessageId === null ? null : formatLocator({
24736
- provider: account.provider,
24737
- account: account.account,
24738
- chat: chat.chatId,
24739
- message: lastMessageId
24740
- }),
24741
- openTasks: open7.filter((task2) => chatOf(task2.source) === chat.chatId).map((task2) => task2.id)
24742
- }));
24743
- const silentFor = /* @__PURE__ */ __name((chat) => at - Date.parse(chat.lastMessageAt), "silentFor");
24744
- const shown = {
24745
- owed: chats.filter((chat) => chat.lastFromOwner === false && silentFor(chat) >= unanswered2),
24746
- waiting: chats.filter((chat) => chat.lastFromOwner === true && silentFor(chat) >= waiting),
24747
- unsynced: chats.filter((chat) => chat.lastMessage === null)
24748
- };
24749
- const covered = new Map((await chatCoverage(store, account, Object.values(shown).flatMap((list2) => list2.map(({ chatId }) => chatId)))).map((one) => [one.chatId, one]));
24750
- const withCoverage = /* @__PURE__ */ __name((list2) => list2.map((chat) => ({ ...chat, coverage: covered.get(chat.chatId) })), "withCoverage");
24751
- const inList = new Set((await store.tasks.categories()).map(({ name }) => name));
24752
- const unlisted = /* @__PURE__ */ new Map();
24753
- for (const { category } of open7)
24754
- if (category && !inList.has(category))
24755
- unlisted.set(category, (unlisted.get(category) ?? 0) + 1);
24756
- return {
24757
- at: new Date(at).toISOString(),
24758
- since: new Date(at - within).toISOString(),
24759
- account: taskAccount(account),
24760
- storedAt: activity.storedAt,
24761
- stale: activity.storedAt === null || at - Date.parse(activity.storedAt) > DAY2,
24762
- tasks,
24763
- owed: withCoverage(shown.owed),
24764
- waiting: withCoverage(shown.waiting),
24765
- unsynced: withCoverage(shown.unsynced),
24766
- assigned,
24767
- unlistedCategories: [...unlisted].sort().map(([name, openTasks]) => ({ name, openTasks }))
24768
- };
24769
- }, "show")
24770
- }), "agendaService");
24771
- var split = /* @__PURE__ */ __name((query) => {
24772
- const clauses = [];
24773
- const flatten = /* @__PURE__ */ __name((node) => {
24774
- if (node.kind === "boolean" && node.clauses.every((clause) => clause.occur === "must"))
24775
- for (const clause of node.clauses)
24776
- flatten(clause.node);
24777
- else
24778
- clauses.push(node);
24779
- }, "flatten");
24780
- flatten(query.root);
24781
- const side = /* @__PURE__ */ __name((node) => {
24782
- const fields = new Set(walkQuery(node).map((term) => TASK_FIELDS.has(term.field) ? "tasks" : "chats"));
24783
- if (fields.size > 1)
24784
- queryError("query.unsupported-placement", node.span, "join task fields (tag, category, claimed) and chat_kind with AND, not OR or NOT", { command: "tasks agenda" });
24785
- return [...fields][0];
24786
- }, "side");
24787
- const of = /* @__PURE__ */ __name((which) => {
24788
- const own = clauses.filter((node) => side(node) === which);
24789
- if (own.length === 0)
24790
- return void 0;
24791
- return {
24792
- ...query,
24793
- root: { kind: "boolean", clauses: own.map((node) => ({ occur: "must", node })), span: query.root.span }
24794
- };
24795
- }, "of");
24796
- return { tasks: of("tasks"), chats: of("chats") };
24797
- }, "split");
24798
- var taskColumns2 = /* @__PURE__ */ __name((holder, at, tags) => ({
24799
- tag: { where: /* @__PURE__ */ __name((node) => tags.get(node.value) ?? { sql: "0", params: [] }, "where") },
24800
- category: { type: "kw", sql: "t.category" },
24801
- claimed: {
24802
- where: /* @__PURE__ */ __name((node) => {
24803
- const claim = node.value.toLowerCase();
24804
- if (claim === "any")
24805
- return { sql: "1", params: [] };
24806
- if (claim === "none")
24807
- return { sql: "t.claimed_by IS NULL OR t.claimed_until < ?", params: [at] };
24808
- if (claim === "mine")
24809
- return {
24810
- sql: "t.claimed_by IS NOT NULL AND t.claimed_by = ? AND t.claimed_until >= ?",
24811
- params: [holder ?? null, at]
24812
- };
24813
- return {
24814
- sql: "t.claimed_by IS NOT NULL AND t.claimed_by IS NOT ? AND t.claimed_until >= ?",
24815
- params: [holder ?? null, at]
24816
- };
24817
- }, "where")
24818
- }
24819
- }), "taskColumns");
24820
- var reasonsOf = /* @__PURE__ */ __name((task2, at, dueWithin) => {
24821
- const due = task2.dueAt === null ? void 0 : Date.parse(task2.dueAt);
24822
- const check2 = task2.nextCheckAt === null ? void 0 : Date.parse(task2.nextCheckAt);
24823
- const reasons = [];
24824
- if (due !== void 0 && due <= at)
24825
- reasons.push("overdue");
24826
- else if (due !== void 0 && due <= at + dueWithin)
24827
- reasons.push("due");
24828
- if (check2 !== void 0 && check2 <= at)
24829
- reasons.push("check");
24830
- if (due === void 0 && check2 === void 0)
24831
- reasons.push("unplanned");
24832
- if (task2.closeSuggestion !== null)
24833
- reasons.push("close-suggested");
24834
- return reasons;
24835
- }, "reasonsOf");
24836
- var urgency = /* @__PURE__ */ __name((task2) => {
24837
- const dates = [task2.dueAt, task2.nextCheckAt].filter((one) => one !== null).map(Date.parse);
24838
- return dates.length > 0 ? Math.min(...dates) : Date.parse(task2.createdAt);
24839
- }, "urgency");
24840
- var chatOf = /* @__PURE__ */ __name((source) => source !== null && isLocator(source) ? parseLocator(source).chat : void 0, "chatOf");
24841
- var agendaItem = /* @__PURE__ */ __name((shown) => {
24842
- const split2 = shown.account.indexOf(":");
24843
- const [provider, account] = [shown.account.slice(0, split2), shown.account.slice(split2 + 1)];
24844
- const chat = /* @__PURE__ */ __name((one) => ({
24845
- chat: formatReference({ type: "chat", provider, account, chat: one.chatId }),
24846
- title: one.title,
24847
- kind: one.kind,
24848
- last_message: one.lastMessage,
24849
- last_message_at: one.lastMessageAt,
24850
- last_from_owner: one.lastFromOwner,
24851
- open_tasks: one.openTasks,
24852
- completeness: {
24853
- state: one.coverage.completeness.state,
24854
- up_to_date: one.coverage.completeness.upToDate,
24855
- gaps: one.coverage.completeness.gaps,
24856
- reaches_start: one.coverage.completeness.reachesStart,
24857
- fetched_at: one.coverage.completeness.fetchedAt
24858
- },
24859
- held: {
24860
- messages: one.coverage.held.messages,
24861
- oldest_at: one.coverage.held.oldestAt,
24862
- newest_at: one.coverage.held.newestAt
24863
- }
24864
- }), "chat");
24865
- return {
24866
- at: shown.at,
24867
- account: shown.account,
24868
- stored_at: shown.storedAt,
24869
- stale: shown.stale,
24870
- tasks: shown.tasks.map((task2) => ({
24871
- id: task2.id,
24872
- key: task2.key,
24873
- title: task2.title,
24874
- kind: task2.type,
24875
- category: task2.category,
24876
- source: task2.source,
24877
- due_at: task2.dueAt,
24878
- next_check_at: task2.nextCheckAt,
24879
- claimed_by: task2.claimedBy,
24880
- claimed_until: task2.claimedUntil,
24881
- close_suggestion: task2.closeSuggestion,
24882
- created_at: task2.createdAt,
24883
- reasons: task2.reasons
24884
- })),
24885
- owed: shown.owed.map(chat),
24886
- waiting: shown.waiting.map(chat),
24887
- unsynced: shown.unsynced.map(chat),
24888
- assigned: shown.assigned.map((task2) => ({
24889
- id: task2.id,
24890
- key: task2.key,
24891
- title: task2.title,
24892
- kind: task2.type,
24893
- category: task2.category,
24894
- source: task2.source,
24895
- due_at: task2.dueAt,
24896
- created_at: task2.createdAt,
24897
- assignees: task2.assignees
24898
- })),
24899
- unlisted_categories: shown.unlistedCategories.map(({ name, openTasks }) => ({ name, open_tasks: openTasks }))
24900
- };
24901
- }, "agendaItem");
24902
-
24903
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/archive.js
24931
+ // 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/services/archive.js
24904
24932
  import { setTimeout as sleep3 } from "node:timers/promises";
24905
24933
 
24906
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/backfill-estimate.js
24934
+ // 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/services/backfill-estimate.js
24907
24935
  var REQUEST_MS = 400;
24908
24936
  var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, maxPages, pauseMs }) => {
24909
24937
  const lowest = ranges[0];
@@ -24926,13 +24954,13 @@ var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, max
24926
24954
  };
24927
24955
  }, "estimateBackfill");
24928
24956
 
24929
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/domain/recovery.js
24957
+ // 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/recovery.js
24930
24958
  var withRecovery = /* @__PURE__ */ __name((error) => ({
24931
24959
  ...error,
24932
24960
  retryable: typeof error.retryable === "boolean" ? error.retryable : error.code === "rate_limited" || error.status === 429
24933
24961
  }), "withRecovery");
24934
24962
 
24935
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/batch.js
24963
+ // 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/services/batch.js
24936
24964
  var actionable = /* @__PURE__ */ __name((error) => {
24937
24965
  if (isCliFailure(error))
24938
24966
  return withRecovery({ code: error.code, message: error.message, ...error.details });
@@ -25015,7 +25043,7 @@ var mergeBatches = /* @__PURE__ */ __name((a, b) => {
25015
25043
  };
25016
25044
  }, "mergeBatches");
25017
25045
 
25018
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/patience.js
25046
+ // 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/services/patience.js
25019
25047
  import { setTimeout as sleep2 } from "node:timers/promises";
25020
25048
  var LONGEST_WAIT_MS = 5 * 60 * 1e3;
25021
25049
  var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
@@ -25038,7 +25066,7 @@ var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
25038
25066
  }
25039
25067
  }, "patiently");
25040
25068
 
25041
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/images/context/index.js
25069
+ // 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/images/context/index.js
25042
25070
  var CONTEXT_MESSAGES2 = 3;
25043
25071
  var CONTEXT_MINUTES = 10;
25044
25072
  var MAX_CHARS = 1200;
@@ -25062,12 +25090,12 @@ var context = {
25062
25090
  }, "describe")
25063
25091
  };
25064
25092
 
25065
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/images/registry.js
25093
+ // 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/images/registry.js
25066
25094
  var BUILT_INS = [context];
25067
25095
  var providers = [...BUILT_INS];
25068
25096
  var registeredImageProviders = /* @__PURE__ */ __name(() => providers, "registeredImageProviders");
25069
25097
 
25070
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/conversations.js
25098
+ // 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/services/conversations.js
25071
25099
  var READ_PAGE = 5e3;
25072
25100
  var CHAIN = 50;
25073
25101
  var CONVERSATION_QUERY = {
@@ -25219,7 +25247,7 @@ var sized = /* @__PURE__ */ __name((size2) => {
25219
25247
  return size2;
25220
25248
  }, "sized");
25221
25249
 
25222
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/embeddings-maintenance.js
25250
+ // 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/services/embeddings-maintenance.js
25223
25251
  var REFRESH_BOUNDS = { maxChats: 20, maxChunks: 2e3 };
25224
25252
  var MESSAGE_PAGE = 5e3;
25225
25253
  var PER_SESSION = 8;
@@ -25238,7 +25266,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = DEFAULT_TEXT_MODEL)
25238
25266
  price: remote.price,
25239
25267
  installed: true,
25240
25268
  perBatch: PER_REQUEST * concurrency,
25241
- open: /* @__PURE__ */ __name(async () => (await import("./remote-OIC32DKQ.js")).openRemote(remote, apiKey, { concurrency }), "open")
25269
+ open: /* @__PURE__ */ __name(async () => (await import("./remote-J5HHRNVQ.js")).openRemote(remote, apiKey, { concurrency }), "open")
25242
25270
  };
25243
25271
  }
25244
25272
  const model = textModel(choice);
@@ -25255,7 +25283,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = DEFAULT_TEXT_MODEL)
25255
25283
  if (!isTextModelInstalled(model, directory2))
25256
25284
  throw notDownloaded(model.id);
25257
25285
  if (apart) {
25258
- const { openProcess } = await import("./process-7AWARSC5.js");
25286
+ const { openProcess } = await import("./process-KFI7SXQD.js");
25259
25287
  return openProcess(model, directory2, { threads: threads ?? defaultThreads() });
25260
25288
  }
25261
25289
  return openEmbedder(model, directory2, { threads: threads ?? defaultThreads() });
@@ -25544,7 +25572,7 @@ var shaped = /* @__PURE__ */ __name(({ chatId, builtAt, algorithmVersion, pendin
25544
25572
  return { ...one, state };
25545
25573
  }, "shaped");
25546
25574
 
25547
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/search-catchup.js
25575
+ // 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/services/search-catchup.js
25548
25576
  var CATCH_UP_BOUNDS = { maxChunks: 500, maxMessages: 1e4, timeMs: 3e4 };
25549
25577
  var validateCatchUpBounds = /* @__PURE__ */ __name((options) => {
25550
25578
  for (const [key, value, maximum] of [
@@ -25597,7 +25625,7 @@ var catchUpSearch = /* @__PURE__ */ __name(async (deps, chat, options, signal, c
25597
25625
  }
25598
25626
  }, "catchUpSearch");
25599
25627
 
25600
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/archive.js
25628
+ // 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/services/archive.js
25601
25629
  var pushed = /* @__PURE__ */ __name((deps, what) => {
25602
25630
  if (deps.reads === "store") {
25603
25631
  throw new CliError("validation_error", `${what} asks for older history, and this messenger pushes its history instead \u2014 keep \`${typedCommand(deps.messenger.app.command, "serve")}\` running`);
@@ -25918,7 +25946,7 @@ var timeOfKey = /* @__PURE__ */ __name(async (store, account, chatId, key, byTim
25918
25946
  return message?.timestamp ?? fallback;
25919
25947
  }, "timeOfKey");
25920
25948
 
25921
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/archive-gaps.js
25949
+ // 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/services/archive-gaps.js
25922
25950
  import { createHash as createHash7, randomUUID as randomUUID4 } from "node:crypto";
25923
25951
  var GAP_BOUNDS = { maxGaps: 5, limit: 500, timeMs: 3e4 };
25924
25952
  var validateRepair = /* @__PURE__ */ __name((messenger, options) => {
@@ -26055,12 +26083,12 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
26055
26083
  return { plan, repair };
26056
26084
  }, "gapsService");
26057
26085
 
26058
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/attachments.js
26086
+ // 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/services/attachments.js
26059
26087
  import { createHash as createHash9 } from "node:crypto";
26060
26088
  import { constants as constants2, mkdirSync as mkdirSync2 } from "node:fs";
26061
26089
  import { lstat as lstat4, open as open6, readFile, stat as stat2 } from "node:fs/promises";
26062
26090
 
26063
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/attachments/directory.js
26091
+ // 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/attachments/directory.js
26064
26092
  import { lstat as lstat2, readdir as readdir2, realpath as realpath3 } from "node:fs/promises";
26065
26093
  import { basename as basename4, join as join8, relative as relative2, sep as sep2 } from "node:path";
26066
26094
  var MAX_FILES = 1e4;
@@ -26131,15 +26159,15 @@ var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory2, app,
26131
26159
  return choices;
26132
26160
  }, "directoryPaths");
26133
26161
 
26134
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/attachments/documents.js
26162
+ // 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/attachments/documents.js
26135
26163
  import { posix } from "node:path";
26136
26164
 
26137
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/attachments/container.js
26165
+ // 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/attachments/container.js
26138
26166
  import { setImmediate as tick } from "node:timers/promises";
26139
26167
  import { crc32 } from "node:zlib";
26140
26168
  var import_xmldom = __toESM(require_lib(), 1);
26141
26169
 
26142
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/attachments/encoding.js
26170
+ // 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/attachments/encoding.js
26143
26171
  var import_chardet = __toESM(require_lib2(), 1);
26144
26172
  var import_iconv_lite = __toESM(require_lib3(), 1);
26145
26173
  var SAMPLE = 65536;
@@ -26241,7 +26269,7 @@ var decodeXml = /* @__PURE__ */ __name((bytes2) => {
26241
26269
  return result.text;
26242
26270
  }, "decodeXml");
26243
26271
 
26244
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/attachments/container.js
26272
+ // 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/attachments/container.js
26245
26273
  var MAX_PART = 10 * 1024 * 1024;
26246
26274
  var MAX_ENTRIES = 1e3;
26247
26275
  var decoder = new TextDecoder("utf-8", { fatal: true });
@@ -26456,7 +26484,7 @@ var elements = /* @__PURE__ */ __name((node, name, namespace) => {
26456
26484
  return found;
26457
26485
  }, "elements");
26458
26486
 
26459
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/attachments/sheets.js
26487
+ // 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/attachments/sheets.js
26460
26488
  var columnName = /* @__PURE__ */ __name((column) => {
26461
26489
  let name = "";
26462
26490
  for (let rest = column; rest > 0; rest = Math.floor((rest - 1) / 26))
@@ -26511,7 +26539,7 @@ var sheetText = /* @__PURE__ */ __name((sheets2, maxChars = MAX_TEXT_CHARS) => {
26511
26539
  return { text: parts.join("").trim(), truncated: false };
26512
26540
  }, "sheetText");
26513
26541
 
26514
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/attachments/documents.js
26542
+ // 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/attachments/documents.js
26515
26543
  var OFFICE = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
26516
26544
  var TEXT = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
26517
26545
  var TABLE = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
@@ -26911,10 +26939,10 @@ var readDocument = /* @__PURE__ */ __name(async (bytes2, kind, signal) => {
26911
26939
  }
26912
26940
  }, "readDocument");
26913
26941
 
26914
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/attachments/extract.js
26942
+ // 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/attachments/extract.js
26915
26943
  import { extname as extname3 } from "node:path";
26916
26944
 
26917
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/readers/engine.js
26945
+ // 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/readers/engine.js
26918
26946
  import { readFileSync } from "node:fs";
26919
26947
  import { dirname as dirname4, extname as extname2, join as join9 } from "node:path";
26920
26948
  import { fileURLToPath } from "node:url";
@@ -26975,7 +27003,7 @@ var derived = /* @__PURE__ */ __name((bytes2, extractor, read) => {
26975
27003
  }
26976
27004
  }, "derived");
26977
27005
 
26978
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/readers/image/index.js
27006
+ // 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/readers/image/index.js
26979
27007
  var IMAGES = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png", ".webp", ".gif", ".heic", ".tif", ".tiff", ".bmp"]);
26980
27008
  var image2 = {
26981
27009
  id: "image",
@@ -26984,7 +27012,7 @@ var image2 = {
26984
27012
  read: /* @__PURE__ */ __name(async () => ({ status: "needs-agent" }), "read")
26985
27013
  };
26986
27014
 
26987
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/readers/doc/index.js
27015
+ // 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/readers/doc/index.js
26988
27016
  var OLE = "\xD0\xCF\xE0\xA1\xB1\xE1";
26989
27017
  var doc = {
26990
27018
  id: "doc",
@@ -26996,7 +27024,7 @@ var doc = {
26996
27024
  }), "read")
26997
27025
  };
26998
27026
 
26999
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/readers/docx/index.js
27027
+ // 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/readers/docx/index.js
27000
27028
  var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
27001
27029
  var docx = {
27002
27030
  id: "docx",
@@ -27009,7 +27037,7 @@ var docx = {
27009
27037
  }), "read")
27010
27038
  };
27011
27039
 
27012
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/attachments/markup.js
27040
+ // 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/attachments/markup.js
27013
27041
  var import_iconv_lite2 = __toESM(require_lib3(), 1);
27014
27042
  var RTF_SKIPPED = /* @__PURE__ */ new Set([
27015
27043
  "fonttbl",
@@ -27128,10 +27156,10 @@ var rtfText = /* @__PURE__ */ __name((source) => {
27128
27156
  flush();
27129
27157
  if (ignorable)
27130
27158
  continue;
27131
- const kept = skip >= text2.length ? "" : text2.slice(skip);
27159
+ const kept2 = skip >= text2.length ? "" : text2.slice(skip);
27132
27160
  skip = Math.max(0, skip - text2.length);
27133
- if (kept)
27134
- push(kept);
27161
+ if (kept2)
27162
+ push(kept2);
27135
27163
  }
27136
27164
  }
27137
27165
  flush();
@@ -27151,10 +27179,10 @@ var replaceTags = /* @__PURE__ */ __name((source, tag, replacement) => {
27151
27179
  var dropHidden = /* @__PURE__ */ __name((source) => {
27152
27180
  const unclosed = /* @__PURE__ */ new Set();
27153
27181
  let out = "";
27154
- let kept = 0;
27182
+ let kept2 = 0;
27155
27183
  for (const open7 of source.matchAll(HTML_DROPPED_OPEN)) {
27156
27184
  const name = open7[1].toLowerCase();
27157
- if (open7.index < kept || unclosed.has(name))
27185
+ if (open7.index < kept2 || unclosed.has(name))
27158
27186
  continue;
27159
27187
  const gt = source.indexOf(">", open7.index + open7[0].length);
27160
27188
  if (gt < 0)
@@ -27166,10 +27194,10 @@ var dropHidden = /* @__PURE__ */ __name((source) => {
27166
27194
  unclosed.add(name);
27167
27195
  continue;
27168
27196
  }
27169
- out += source.slice(kept, open7.index);
27170
- kept = end.index + end[0].length;
27197
+ out += source.slice(kept2, open7.index);
27198
+ kept2 = end.index + end[0].length;
27171
27199
  }
27172
- return out + source.slice(kept);
27200
+ return out + source.slice(kept2);
27173
27201
  }, "dropHidden");
27174
27202
  var htmlText = /* @__PURE__ */ __name((source) => {
27175
27203
  const uncommented = source.replace(/<!--[\s\S]*?(-->|$)/g, (comment, close) => close ? "" : comment);
@@ -27185,7 +27213,7 @@ var htmlText = /* @__PURE__ */ __name((source) => {
27185
27213
  }, "htmlText");
27186
27214
  var safeChar = /* @__PURE__ */ __name((code, fallback) => code > 0 && code <= 1114111 ? String.fromCodePoint(code) : fallback, "safeChar");
27187
27215
 
27188
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/readers/html/page.js
27216
+ // 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/readers/html/page.js
27189
27217
  var clean = /* @__PURE__ */ __name((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "", "clean");
27190
27218
  var namesIn = /* @__PURE__ */ __name((value) => [value].flat().map((entry) => typeof entry === "string" ? clean(entry) : clean(entry?.name)).filter(Boolean).join(", "), "namesIn");
27191
27219
  var jsonLdNodes = /* @__PURE__ */ __name((document) => {
@@ -27241,7 +27269,7 @@ var markdownSections = /* @__PURE__ */ __name((text2) => {
27241
27269
  return found.map((section, index) => ({ ...section, end: found[index + 1]?.start ?? text2.length }));
27242
27270
  }, "markdownSections");
27243
27271
 
27244
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/readers/html/index.js
27272
+ // 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/readers/html/index.js
27245
27273
  var HTML = /* @__PURE__ */ new Set([".html", ".htm", ".xhtml"]);
27246
27274
  var first = /* @__PURE__ */ __name((...values) => values.find((value) => typeof value === "string" && value !== ""), "first");
27247
27275
  var loaded = /* @__PURE__ */ __name(async (load, name) => {
@@ -27312,7 +27340,7 @@ var html = {
27312
27340
  }, "read")
27313
27341
  };
27314
27342
 
27315
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/readers/office/index.js
27343
+ // 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/readers/office/index.js
27316
27344
  var office = {
27317
27345
  id: "office",
27318
27346
  version: documentExtractor("odt"),
@@ -27323,7 +27351,7 @@ var office = {
27323
27351
  }, "read")
27324
27352
  };
27325
27353
 
27326
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/readers/pdf/index.js
27354
+ // 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/readers/pdf/index.js
27327
27355
  var pdf = {
27328
27356
  id: "pdf",
27329
27357
  version: "unpdf",
@@ -27390,7 +27418,7 @@ var pdf = {
27390
27418
  }), "read")
27391
27419
  };
27392
27420
 
27393
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/readers/plain/index.js
27421
+ // 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/readers/plain/index.js
27394
27422
  var PLAIN = /* @__PURE__ */ new Set([".txt", ".md", ".markdown", ".csv", ".tsv", ".json", ".log"]);
27395
27423
  var isPlain = /* @__PURE__ */ __name((hint) => PLAIN.has(extensionOf(hint)) || hint.mime?.startsWith("text/") || hint.mime === "application/json", "isPlain");
27396
27424
  var readPlain = /* @__PURE__ */ __name((bytes2) => {
@@ -27410,7 +27438,7 @@ var plain = {
27410
27438
  read: /* @__PURE__ */ __name(async (bytes2) => readPlain(bytes2), "read")
27411
27439
  };
27412
27440
 
27413
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/readers/rtf/index.js
27441
+ // 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/readers/rtf/index.js
27414
27442
  var rtf = {
27415
27443
  id: "rtf",
27416
27444
  version: "v1",
@@ -27418,10 +27446,10 @@ var rtf = {
27418
27446
  read: /* @__PURE__ */ __name(async (bytes2) => derived(bytes2, "rtf:v1", rtfText), "read")
27419
27447
  };
27420
27448
 
27421
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
27449
+ // 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/readers/sheets/index.js
27422
27450
  import { basename as basename5 } from "node:path";
27423
27451
 
27424
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/attachments/csv-spans.js
27452
+ // 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/attachments/csv-spans.js
27425
27453
  var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) => {
27426
27454
  const cells = [];
27427
27455
  let row = 1, column = 1, start = 0, quoted = false, truncated = false;
@@ -27459,7 +27487,7 @@ var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) =
27459
27487
  return { cells, truncated };
27460
27488
  }, "delimitedSpans");
27461
27489
 
27462
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
27490
+ // 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/readers/sheets/index.js
27463
27491
  var DELIMITED = {
27464
27492
  ".csv": ",",
27465
27493
  ".tsv": " ",
@@ -27498,7 +27526,7 @@ var sheets = {
27498
27526
  }, "read")
27499
27527
  };
27500
27528
 
27501
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/readers/registry.js
27529
+ // 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/readers/registry.js
27502
27530
  var BUILT_INS2 = [office, pdf, docx, doc, rtf, html, sheets, plain, image2];
27503
27531
  var HEAD_BYTES = 1024;
27504
27532
  var readers = [...BUILT_INS2];
@@ -27508,7 +27536,7 @@ var readWithRegistry = /* @__PURE__ */ __name(async (bytes2, hint, context2) =>
27508
27536
  return reader ? reader.read(bytes2, hint, context2) : { status: "unsupported" };
27509
27537
  }, "readWithRegistry");
27510
27538
 
27511
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/attachments/extract.js
27539
+ // 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/attachments/extract.js
27512
27540
  var importEngine = /* @__PURE__ */ __name((name) => importFrom(new URL("attachments/extract.js", import.meta.resolve("@wirecat/cli-core")).href, name), "importEngine");
27513
27541
  var extensionOf2 = /* @__PURE__ */ __name(({ name, path }) => extname3(name ?? path).toLowerCase(), "extensionOf");
27514
27542
  var extractText = /* @__PURE__ */ __name(async (bytes2, hint, load, signal, env = process.env) => {
@@ -28587,7 +28615,7 @@ function imageSize(input) {
28587
28615
  }
28588
28616
  __name(imageSize, "imageSize");
28589
28617
 
28590
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/attachments/ocr.js
28618
+ // 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/attachments/ocr.js
28591
28619
  var MAX_PAGES = 20;
28592
28620
  var MAX_PIXELS = 2e7;
28593
28621
  var cancelled2 = /* @__PURE__ */ __name((signal) => {
@@ -28738,7 +28766,7 @@ var ocrPdf = /* @__PURE__ */ __name(async (bytes2, pipeline2, load, signal) => {
28738
28766
  }
28739
28767
  }, "ocrPdf");
28740
28768
 
28741
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/attachments/pdf-preview.js
28769
+ // 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/attachments/pdf-preview.js
28742
28770
  var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = importEngine, env = process.env) => {
28743
28771
  const limits = pdfPreviewLimits(env);
28744
28772
  const cancelled4 = /* @__PURE__ */ __name(() => {
@@ -28815,7 +28843,7 @@ var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = impo
28815
28843
  }
28816
28844
  }, "pdfPreview");
28817
28845
 
28818
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/attachments/transfer.js
28846
+ // 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/attachments/transfer.js
28819
28847
  import { createHash as createHash8 } from "node:crypto";
28820
28848
  import { constants } from "node:fs";
28821
28849
  import { lstat as lstat3, open as open5 } from "node:fs/promises";
@@ -28923,7 +28951,7 @@ var transferMime = /* @__PURE__ */ __name((head, hint, name = null) => {
28923
28951
  return hint !== null && /^[a-z0-9.+-]+\/[a-z0-9.+-]+$/i.test(hint) ? hint : "application/octet-stream";
28924
28952
  }, "transferMime");
28925
28953
 
28926
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/file-download.js
28954
+ // 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/services/file-download.js
28927
28955
  import { createWriteStream, mkdirSync } from "node:fs";
28928
28956
  import { link as link3, rm } from "node:fs/promises";
28929
28957
  import { join as join10, resolve as resolve6 } from "node:path";
@@ -28946,10 +28974,10 @@ var recordPaths = /* @__PURE__ */ __name(async (messages, chat, message, files,
28946
28974
  ...files[index]?.providerRef === void 0 ? {} : { providerRef: files[index]?.providerRef }
28947
28975
  }));
28948
28976
  try {
28949
- const kept = await messages.keepDownloaded(chat, message, downloaded);
28950
- if (kept < downloaded.length && downloaded.some(({ providerRef }) => Object.keys(providerRef ?? {}).length > 0))
28977
+ const kept2 = await messages.keepDownloaded(chat, message, downloaded);
28978
+ if (kept2 < downloaded.length && downloaded.some(({ providerRef }) => Object.keys(providerRef ?? {}).length > 0))
28951
28979
  warn(`message ${message}: a new file reference from the messenger was not saved; the next download asks again`);
28952
- return kept;
28980
+ return kept2;
28953
28981
  } catch (error) {
28954
28982
  onFailure?.(error);
28955
28983
  warn(`not recorded in the local store where message ${message}'s files went: ${error.message}`);
@@ -29037,7 +29065,7 @@ var save = /* @__PURE__ */ __name(async (file, directory2, fallbackName, { uniqu
29037
29065
  }
29038
29066
  }, "save");
29039
29067
 
29040
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/attachments.js
29068
+ // 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/services/attachments.js
29041
29069
  var ATTACHMENT_QUERY = {
29042
29070
  entity: "attachment",
29043
29071
  backend: "sql",
@@ -29460,7 +29488,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
29460
29488
  }, "setText")
29461
29489
  }), "attachmentsService");
29462
29490
 
29463
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/chat-documents.js
29491
+ // 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/services/chat-documents.js
29464
29492
  var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
29465
29493
  list: /* @__PURE__ */ __name(async (chat, { limit, offset, ref }) => {
29466
29494
  const store = await accountStore(deps);
@@ -29490,7 +29518,7 @@ var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
29490
29518
  }, "list")
29491
29519
  }), "chatDocumentsService");
29492
29520
 
29493
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/retention.js
29521
+ // 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/services/retention.js
29494
29522
  var observationDuration = /* @__PURE__ */ __name((text2, flag) => {
29495
29523
  const match = /^(\d+(?:\.\d+)?)([smhdw])$/.exec(text2);
29496
29524
  const units2 = { s: 1e3, m: 6e4, h: 36e5, d: 864e5, w: 6048e5 };
@@ -29577,7 +29605,7 @@ var isRetentionSelection = /* @__PURE__ */ __name((selection) => {
29577
29605
  }
29578
29606
  }, "isRetentionSelection");
29579
29607
 
29580
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/counters.js
29608
+ // 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/services/counters.js
29581
29609
  var counterFields = /* @__PURE__ */ __name((text2 = "views,reactions,comments") => {
29582
29610
  const fields = text2.split(",").map((one) => one.trim());
29583
29611
  if (!fields.length || fields.some((one) => !COUNTER_FIELDS.includes(one)) || new Set(fields).size !== fields.length)
@@ -29784,7 +29812,7 @@ var countersService = /* @__PURE__ */ __name((deps) => {
29784
29812
  };
29785
29813
  }, "countersService");
29786
29814
 
29787
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/search-refresh.js
29815
+ // 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/services/search-refresh.js
29788
29816
  var SYNC_KEY = "messages.sync-first";
29789
29817
  var SYNC_BOUNDS = { maxChats: 5, timeMs: 3e4, maxMessages: 500 };
29790
29818
  var keyOf2 = /* @__PURE__ */ __name((chat) => JSON.stringify([chat.account.provider, chat.account.account, chat.chatId]), "keyOf");
@@ -29916,7 +29944,7 @@ var withRefresh = /* @__PURE__ */ __name((found, refreshed) => ({
29916
29944
  ...!refreshed || refreshed.complete ? {} : { coverage: { ...found.coverage, state: "stale" } }
29917
29945
  }), "withRefresh");
29918
29946
 
29919
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/embeddings-search.js
29947
+ // 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/services/embeddings-search.js
29920
29948
  var CANDIDATES = 50;
29921
29949
  var WORD_HITS = 200;
29922
29950
  var RRF_K = 60;
@@ -30191,13 +30219,13 @@ var meanOf = /* @__PURE__ */ __name((vectors) => {
30191
30219
  return mean.map((value) => value / length);
30192
30220
  }, "meanOf");
30193
30221
 
30194
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/embeddings.js
30222
+ // 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/services/embeddings.js
30195
30223
  var embeddingsService = /* @__PURE__ */ __name((deps) => ({
30196
30224
  ...embeddingsMaintenance(deps),
30197
30225
  ...embeddingsSearch(deps)
30198
30226
  }), "embeddingsService");
30199
30227
 
30200
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/folders.js
30228
+ // 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/services/folders.js
30201
30229
  var foldersService = /* @__PURE__ */ __name((deps) => {
30202
30230
  const online = /* @__PURE__ */ __name(async (command) => {
30203
30231
  if (deps.offline)
@@ -30338,7 +30366,7 @@ var foldersService = /* @__PURE__ */ __name((deps) => {
30338
30366
  };
30339
30367
  }, "foldersService");
30340
30368
 
30341
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/mentions.js
30369
+ // 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/services/mentions.js
30342
30370
  var REVIEW_COUNT = 500;
30343
30371
  var mentionsService = /* @__PURE__ */ __name((deps) => {
30344
30372
  const located = /* @__PURE__ */ __name(async () => {
@@ -30417,7 +30445,7 @@ var mentionsService = /* @__PURE__ */ __name((deps) => {
30417
30445
  };
30418
30446
  }, "mentionsService");
30419
30447
 
30420
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/domain/message-link.js
30448
+ // 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/message-link.js
30421
30449
  var fileLinks = /* @__PURE__ */ __name((attachments) => hitFiles(attachments).map(({ position, kind, name }) => ({
30422
30450
  position,
30423
30451
  kind,
@@ -30426,26 +30454,21 @@ var fileLinks = /* @__PURE__ */ __name((attachments) => hitFiles(attachments).ma
30426
30454
  reason: "unsupported_provider"
30427
30455
  })), "fileLinks");
30428
30456
  var messageLinkTarget = /* @__PURE__ */ __name((reference, message, provider) => {
30429
- if (isLocator(reference)) {
30457
+ const named2 = chatReferenceOf(reference, provider, "message");
30458
+ if (named2?.message !== void 0) {
30430
30459
  if (message !== void 0)
30431
30460
  throw new CliError("validation_error", "a locator already names the message");
30432
- let target2;
30433
- try {
30434
- target2 = parseLocator(reference);
30435
- } catch {
30436
- throw new CliError("validation_error", "expected msg:<provider>/<account>/<chat>/<message>");
30437
- }
30438
- if (target2.provider !== provider)
30439
- throw new CliError("validation_error", "that locator belongs to another messenger");
30440
- validMessageId(target2.message);
30441
- return { chat: target2.chat, message: target2.message, account: target2.account };
30461
+ validMessageId(named2.message);
30462
+ return { chat: named2.chat, message: named2.message, account: named2.account, text: named2.text };
30442
30463
  }
30443
30464
  if (message === void 0)
30444
30465
  throw new CliError("validation_error", "which message? give its id after the chat");
30445
30466
  validMessageId(message);
30467
+ if (named2)
30468
+ return { chat: named2.chat, message, account: named2.account, text: named2.text };
30446
30469
  if (!reference.trim())
30447
30470
  throw new CliError("validation_error", "which chat? give its id or title");
30448
- return { chat: reference, message, account: void 0 };
30471
+ return { chat: reference, message, account: void 0, text: reference };
30449
30472
  }, "messageLinkTarget");
30450
30473
  var validMessageId = /* @__PURE__ */ __name((id2) => {
30451
30474
  if (!id2 || id2.length > 256 || /\s/u.test(id2) || [...id2].some((part) => {
@@ -30471,7 +30494,7 @@ var validatePermalink = /* @__PURE__ */ __name((link4) => {
30471
30494
  return { url: link4.url, access: link4.access, reason: link4.reason };
30472
30495
  }, "validatePermalink");
30473
30496
 
30474
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/domain/pin-duration.js
30497
+ // 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/pin-duration.js
30475
30498
  var spokenSeconds = /* @__PURE__ */ __name((seconds) => {
30476
30499
  if (seconds % 86400 === 0 && seconds > 86400)
30477
30500
  return `${seconds / 86400}d`;
@@ -30503,7 +30526,7 @@ var pinDurationOf = /* @__PURE__ */ __name((value, allowed, flag = "--expire-tim
30503
30526
  return seconds;
30504
30527
  }, "pinDurationOf");
30505
30528
 
30506
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/sends/send-as.js
30529
+ // 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/sends/send-as.js
30507
30530
  var sendAsCheck = /* @__PURE__ */ __name((connection, sendAs) => {
30508
30531
  if (sendAs === void 0) {
30509
30532
  const saved = connection.savedSender?.bind(connection);
@@ -30528,7 +30551,7 @@ var typedSendAs = /* @__PURE__ */ __name((typed) => {
30528
30551
  return sendAs;
30529
30552
  }, "typedSendAs");
30530
30553
 
30531
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/search/total.js
30554
+ // 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/search/total.js
30532
30555
  var TOTAL_CAP = 1e4;
30533
30556
  var totalOf = /* @__PURE__ */ __name((count4, shown, hasMore, exact = true) => {
30534
30557
  const least = shown + (hasMore ? 1 : 0);
@@ -30539,17 +30562,17 @@ var totalOf = /* @__PURE__ */ __name((count4, shown, hasMore, exact = true) => {
30539
30562
  return { value: count4, relation: exact ? "eq" : "gte" };
30540
30563
  }, "totalOf");
30541
30564
 
30542
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/search/lucene/meaning-parts.js
30565
+ // 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/search/lucene/meaning-parts.js
30543
30566
  var WORD_FIELDS = /* @__PURE__ */ new Set(["text", "exact"]);
30544
30567
  var fieldsOfQuery = /* @__PURE__ */ __name((root, everything) => {
30545
30568
  let narrows = false;
30546
- const kept = /* @__PURE__ */ __name((node) => {
30569
+ const kept2 = /* @__PURE__ */ __name((node) => {
30547
30570
  if (node.kind === "boolean")
30548
30571
  return {
30549
30572
  ...node,
30550
30573
  clauses: node.clauses.map(({ occur, node: node2 }) => {
30551
30574
  if (occur !== "must_not")
30552
- return { occur, node: kept(node2) };
30575
+ return { occur, node: kept2(node2) };
30553
30576
  narrows = true;
30554
30577
  return { occur, node: node2 };
30555
30578
  })
@@ -30560,7 +30583,7 @@ var fieldsOfQuery = /* @__PURE__ */ __name((root, everything) => {
30560
30583
  }
30561
30584
  return { ...everything, span: node.span };
30562
30585
  }, "kept");
30563
- const fields = kept(root);
30586
+ const fields = kept2(root);
30564
30587
  return narrows ? fields : void 0;
30565
30588
  }, "fieldsOfQuery");
30566
30589
  var meaningWords = /* @__PURE__ */ __name((root) => {
@@ -30568,7 +30591,7 @@ var meaningWords = /* @__PURE__ */ __name((root) => {
30568
30591
  return wanted(root).join(" ").trim();
30569
30592
  }, "meaningWords");
30570
30593
 
30571
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/search/question-plan.js
30594
+ // 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/search/question-plan.js
30572
30595
  var words = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}]+/gu) ?? [], "words");
30573
30596
  var scaffolding = new Set(words("what which how many much who where when is are was were do does did can could should we the a an for of to under from in on at has have \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u043A\u0430\u043A\u043E\u0439 \u043A\u0430\u043A\u0430\u044F \u043A\u0430\u043A\u0438\u0435 \u043A\u0430\u043A\u043E\u0435 \u043A\u0442\u043E \u043A\u043E\u043C\u0443 \u043A\u0435\u043C \u0433\u0434\u0435 \u043A\u043E\u0433\u0434\u0430 \u043A\u0430\u043A \u0447\u0442\u043E \u0432\u043E \u043F\u043E \u043D\u0430 \u0432 \u043A \u0441 \u0443 \u0447\u0435\u0440\u0435\u0437 \u043B\u0438 \u0434\u043E\u043B\u0436\u0435\u043D \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0443\u0436\u043D\u043E \u0438\u0434\u0451\u0442 \u0438\u0434\u0435\u0442 \u043C\u043E\u0436\u043D\u043E \u043C\u043E\u0436\u0435\u0442 \u043C\u043E\u0433\u0443\u0442"));
30574
30597
  var questionWord = /\b(?:what|which|how|who|where|when|can|could|should)\b|(?:^|\s)(?:сколько|какой|какая|какие|какое|кто|кому|кем|где|когда|как|что|можно|может|могут|ли)(?:\s|$)/iu;
@@ -30683,7 +30706,7 @@ function planQuestion(text2, strict = false) {
30683
30706
  }
30684
30707
  __name(planQuestion, "planQuestion");
30685
30708
 
30686
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/messages-combined.js
30709
+ // 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/services/messages-combined.js
30687
30710
  var COMBINED_DEFAULTS = { candidateDepth: 300, rrfK: 60, rerank: "all", chatCap: 0 };
30688
30711
  var tokensOf = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}\p{Co}\p{M}]+/gu) ?? [], "tokensOf");
30689
30712
  var searchCombined = /* @__PURE__ */ __name(async (store, account, request, messenger = {}, options = COMBINED_DEFAULTS) => {
@@ -30876,7 +30899,7 @@ var signals = /* @__PURE__ */ __name((hit, terms, corrections, execution, mode,
30876
30899
  return mode === "coverage" ? coverage * 4 : mode === "proximity" ? proximity : mode === "phrase" ? phrase : coverage * 4 + proximity + phrase;
30877
30900
  }, "signals");
30878
30901
 
30879
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/messages-discovery.js
30902
+ // 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/services/messages-discovery.js
30880
30903
  var MEANING_DEPTH = 100;
30881
30904
  var RRF_K2 = 60;
30882
30905
  var RERANK_DEPTH = 50;
@@ -31204,7 +31227,7 @@ var mixedWithReranker = /* @__PURE__ */ __name((head, scores) => {
31204
31227
  })).sort((a, b) => b.mixed - a.mixed).map(({ hit }) => hit);
31205
31228
  }, "mixedWithReranker");
31206
31229
 
31207
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/thread-context.js
31230
+ // 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/services/thread-context.js
31208
31231
  var THREAD_BOUNDS = { maxHops: 8, maxMessages: 50, maxBytes: 65536, withinMs: 864e5 };
31209
31232
  var bytes = /* @__PURE__ */ __name((items, links) => Buffer.byteLength(JSON.stringify({ items, links }), "utf8"), "bytes");
31210
31233
  var threadBounds = /* @__PURE__ */ __name((options = {}) => {
@@ -31403,7 +31426,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
31403
31426
  return result;
31404
31427
  }, "readThreadContext");
31405
31428
 
31406
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/messages-archive-search.js
31429
+ // 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/services/messages-archive-search.js
31407
31430
  var SEARCH_FILL_MS = 200;
31408
31431
  var statsStore = /* @__PURE__ */ __name(async (store, account, request, messenger = {}) => {
31409
31432
  const stop = Date.now() + SEARCH_FILL_MS;
@@ -31470,12 +31493,12 @@ var accountOf2 = /* @__PURE__ */ __name((hit) => {
31470
31493
  }, "accountOf");
31471
31494
  var keyOf3 = /* @__PURE__ */ __name(({ provider, account }) => `${provider}/${account}`, "keyOf");
31472
31495
 
31473
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/pictures.js
31496
+ // 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/services/pictures.js
31474
31497
  import { createHash as createHash10 } from "node:crypto";
31475
31498
  import { readFile as readFile2, stat as stat3 } from "node:fs/promises";
31476
31499
  import { setTimeout as sleep4 } from "node:timers/promises";
31477
31500
 
31478
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/domain/models.js
31501
+ // 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/models.js
31479
31502
  var GROUP_SETTINGS = [
31480
31503
  "allCanPin",
31481
31504
  "onlyAdminsAdd",
@@ -31489,7 +31512,7 @@ var ADMIN_RIGHTS = ["read", "members", "admins", "info", "pin", "link", "post",
31489
31512
  var senderIsMe = /* @__PURE__ */ __name((message, account) => message.outgoing === true || message.senderId !== null && String(message.senderId) === account, "senderIsMe");
31490
31513
  var MEDIA_KINDS = ["photo", "video", "file", "audio", "link"];
31491
31514
 
31492
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/pictures.js
31515
+ // 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/services/pictures.js
31493
31516
  var PICTURE_MAX_BYTES = 25 * 1024 * 1024;
31494
31517
  var PICTURE_FLOOR = 0.25;
31495
31518
  var PAGE4 = 50;
@@ -31506,7 +31529,7 @@ var picturesService = /* @__PURE__ */ __name((deps) => {
31506
31529
  const directory2 = imageModelsDirectory(deps.env);
31507
31530
  if (!isImageModelInstalled(model2, directory2))
31508
31531
  throw new CliError("not_found", missingModel(model2.id), { reason: "model.not-downloaded", model: model2.id });
31509
- const { openPictureEmbedder } = await import("./embedder-PSV2E5TR.js");
31532
+ const { openPictureEmbedder } = await import("./embedder-QLYKFLOL.js");
31510
31533
  return openPictureEmbedder(model2, directory2);
31511
31534
  }, "open");
31512
31535
  const embedder = /* @__PURE__ */ __name(() => {
@@ -31703,7 +31726,7 @@ var withPictures = /* @__PURE__ */ __name((messages, pictures) => ({
31703
31726
  }, "search")
31704
31727
  }), "withPictures");
31705
31728
 
31706
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/messages-meaning.js
31729
+ // 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/services/messages-meaning.js
31707
31730
  var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, shared, within) => {
31708
31731
  const target2 = embeddingTarget(deps, DEFAULT_TEXT_MODEL);
31709
31732
  const skipped = /* @__PURE__ */ __name((reason, step) => ({
@@ -31752,7 +31775,7 @@ var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, sh
31752
31775
  }
31753
31776
  }, "meaningLane");
31754
31777
 
31755
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/messages-rerank.js
31778
+ // 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/services/messages-rerank.js
31756
31779
  var rerankLane = /* @__PURE__ */ __name((deps) => {
31757
31780
  const choice = deps.reranker ?? DEFAULT_RERANK_MODEL;
31758
31781
  if (choice === "off")
@@ -31764,9 +31787,9 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
31764
31787
  return { skipped: { reason: `${model.id} is not downloaded`, step: "models.download", model: model.id } };
31765
31788
  try {
31766
31789
  const warm = deps.embedders;
31767
- const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-7AWARSC5.js")).openRerankerProcess(model, directory2, {
31790
+ const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-KFI7SXQD.js")).openRerankerProcess(model, directory2, {
31768
31791
  threads: defaultThreads()
31769
- })) : await (await import("./rerank-IFTSO576.js")).openReranker(model, directory2);
31792
+ })) : await (await import("./rerank-DP2Y3WDT.js")).openReranker(model, directory2);
31770
31793
  return {
31771
31794
  model: model.id,
31772
31795
  score: /* @__PURE__ */ __name((question, passages) => reranker.score(plainWords(question), passages), "score"),
@@ -31786,17 +31809,17 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
31786
31809
  };
31787
31810
  }, "rerankLane");
31788
31811
 
31789
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/document-pictures.js
31812
+ // 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/services/document-pictures.js
31790
31813
  var openPictureEmbedderFor = /* @__PURE__ */ __name(async ({ env, command } = {}) => {
31791
31814
  const model = imageModel(DEFAULT_IMAGE_MODEL);
31792
31815
  const directory2 = imageModelsDirectory(env);
31793
31816
  if (!isImageModelInstalled(model, directory2))
31794
31817
  throw new CliError("not_found", `the picture model is not downloaded \u2014 ${command === void 0 ? "install it with a WireCat CLI that has `images models download` (tg, max or wa); they share the model folder" : `\`${command} images models download ${model.id}\` fetches it`}`, { reason: "model.not-downloaded", model: model.id });
31795
- const { openPictureEmbedder } = await import("./embedder-PSV2E5TR.js");
31818
+ const { openPictureEmbedder } = await import("./embedder-QLYKFLOL.js");
31796
31819
  return openPictureEmbedder(model, directory2);
31797
31820
  }, "openPictureEmbedderFor");
31798
31821
 
31799
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/document-source.js
31822
+ // 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/services/document-source.js
31800
31823
  var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) => {
31801
31824
  const metadata = note.frontMatter;
31802
31825
  const account = accounts.find(({ id: id2 }) => String(id2) === note.folderId);
@@ -31811,7 +31834,7 @@ var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) =>
31811
31834
  };
31812
31835
  }, "documentSource");
31813
31836
 
31814
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/notes-title-tier.js
31837
+ // 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/services/notes-title-tier.js
31815
31838
  var plainQueryWords = /* @__PURE__ */ __name((query) => {
31816
31839
  let root;
31817
31840
  try {
@@ -31838,7 +31861,7 @@ var titleTiers = /* @__PURE__ */ __name((hits, words2) => {
31838
31861
  return [...hits].sort((a, b) => rank(a) - rank(b));
31839
31862
  }, "titleTiers");
31840
31863
 
31841
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/notes-search.js
31864
+ // 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/services/notes-search.js
31842
31865
  var storeQuery = /* @__PURE__ */ __name(async (store, text2, { exact, timezone } = {}) => resolvedQuery(store, parsedQuery(text2, exact), timezone), "storeQuery");
31843
31866
  var parsedQuery = /* @__PURE__ */ __name((text2, exact) => validateFields(parseLucene(text2, { ...SEARCH_QUERY, defaultField: exact ? "exact" : "text" })).root, "parsedQuery");
31844
31867
  var resolvedQuery = /* @__PURE__ */ __name(async (store, root, timezone) => {
@@ -32248,7 +32271,7 @@ var searchNotesOf = /* @__PURE__ */ __name(async (store, account, text2, { accou
32248
32271
  };
32249
32272
  }, "searchNotesOf");
32250
32273
 
32251
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/events-search.js
32274
+ // 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/services/events-search.js
32252
32275
  var MAX_EVENTS_OFFSET = 1e3;
32253
32276
  var iso3 = /* @__PURE__ */ __name((at) => at === null ? null : new Date(at).toISOString(), "iso");
32254
32277
  var accountIdsOf = /* @__PURE__ */ __name(async (store, accounts) => {
@@ -32360,7 +32383,7 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
32360
32383
  };
32361
32384
  }, "searchEvents");
32362
32385
 
32363
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/search-all.js
32386
+ // 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/services/search-all.js
32364
32387
  var RESOURCES_SEARCHED = ["messages", "mail", "notes", "events"];
32365
32388
  var skippable = /* @__PURE__ */ __name((error) => error instanceof CliError && (error.code === "validation_error" || error.code === "not_found"), "skippable");
32366
32389
  var filtersBeside = /* @__PURE__ */ __name((text2) => {
@@ -32569,7 +32592,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
32569
32592
  };
32570
32593
  }, "searchAll");
32571
32594
 
32572
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/search-all-meetings.js
32595
+ // 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/services/search-all-meetings.js
32573
32596
  var RESOURCES_SEARCHED_WITH_MEETINGS = [...RESOURCES_SEARCHED, "meetings"];
32574
32597
  var whole2 = /* @__PURE__ */ __name((value, minimum, maximum, label) => {
32575
32598
  if (!Number.isSafeInteger(value) || value < minimum || value > maximum)
@@ -32817,9 +32840,9 @@ var searchAllOfSource = /* @__PURE__ */ __name(async (store, account, source, re
32817
32840
  return { ...found, skipped: [...skipped, ...empty2, ...unnamed, ...found.skipped] };
32818
32841
  }, "searchAllOfSource");
32819
32842
 
32820
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/server-search.js
32843
+ // 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/services/server-search.js
32821
32844
  var SERVER_SEARCH_KEY = "messages.server-search";
32822
- var SERVER_BOUNDS = { timeMs: 5e3, perCall: 100, maxCalls: 3, maxMessageBytes: 5e6 };
32845
+ var SERVER_BOUNDS = { timeMs: 5e3, perCall: 100, maxCalls: 3, textBytes: 262144 };
32823
32846
  var DEFAULT_BACKEND = "both";
32824
32847
  var sourceKey = /* @__PURE__ */ __name((chatId, id2) => JSON.stringify([chatId, id2]), "sourceKey");
32825
32848
  var merge = /* @__PURE__ */ __name((one, other) => {
@@ -33006,7 +33029,7 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
33006
33029
  return { report, sources };
33007
33030
  }, "searchServer");
33008
33031
 
33009
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/messages.js
33032
+ // 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/services/messages.js
33010
33033
  var DELETE_AT_ONCE = 10;
33011
33034
  var filesOf = /* @__PURE__ */ __name(({ attachments }) => {
33012
33035
  const files = fileLinks(attachments);
@@ -33015,6 +33038,13 @@ var filesOf = /* @__PURE__ */ __name(({ attachments }) => {
33015
33038
  var messagesService = /* @__PURE__ */ __name((deps) => {
33016
33039
  const { guard } = deps;
33017
33040
  const inStore = /* @__PURE__ */ __name(async (read) => read(await deps.store(), await deps.account()), "inStore");
33041
+ const ownTarget = /* @__PURE__ */ __name(async (target2, account) => {
33042
+ if (account.provider !== deps.messenger.provider)
33043
+ throw new CliError("validation_error", "that locator belongs to another account; select its profile first");
33044
+ if (target2.account === void 0)
33045
+ return;
33046
+ await ensureAccount({ text: target2.text, account: target2.account }, { account: account.account, ...deps.profile === void 0 ? {} : { profile: deps.profile } });
33047
+ }, "ownTarget");
33018
33048
  const serverThenStore = /* @__PURE__ */ __name(async (store, account, query) => {
33019
33049
  const server = await searchServer(deps, query);
33020
33050
  const only = query.backend === "server" && server ? [...server.sources.keys()].map((key) => {
@@ -33049,8 +33079,8 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
33049
33079
  await guardedWrite(guard, { operationId, chatId, kind: "pin", key: pinned ? "messages.pin" : "messages.unpin", messageId: message, notify }, () => act2(chatId, message, { notify, ...duration2 === void 0 ? {} : { duration: duration2 } }));
33050
33080
  return { operationId, chatId, messageId: message, pinned };
33051
33081
  }, "pinning");
33052
- const topicPage = /* @__PURE__ */ __name(async (chat, threadId, { limit, before: before2, beforeTime, after }) => {
33053
- if (beforeTime !== void 0 || after !== void 0)
33082
+ const topicPage = /* @__PURE__ */ __name(async (chat, threadId, { limit, before: before2, beforeTime, after, until }) => {
33083
+ if (beforeTime !== void 0 || after !== void 0 || until !== void 0)
33054
33084
  throw new CliError("validation_error", "a topic is read back from its newest message, or from --before-id");
33055
33085
  if (threadId === "1")
33056
33086
  throw new CliError("validation_error", "the General topic's messages carry no topic id \u2014 read the whole chat without --topic");
@@ -33060,11 +33090,11 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
33060
33090
  }
33061
33091
  return capability(await deps.connection(), "topicHistory", "read one forum topic")(chat, threadId, window3);
33062
33092
  }, "topicPage");
33063
- const listPage = /* @__PURE__ */ __name(async (chat, { limit, before: before2, beforeTime, after, threadId: typedThread, starred }) => {
33093
+ const listPage = /* @__PURE__ */ __name(async (chat, { limit, before: before2, beforeTime, after, until, threadId: typedThread, starred }) => {
33064
33094
  if (starred !== void 0) {
33065
33095
  if (!fromStore(deps))
33066
33096
  throw new CliError("validation_error", "starred: reads the local store; not while reading from the messenger");
33067
- if (typedThread !== void 0 || beforeTime !== void 0 || after !== void 0)
33097
+ if (typedThread !== void 0 || beforeTime !== void 0 || after !== void 0 || until !== void 0)
33068
33098
  throw new CliError("validation_error", "starred: pages back through the whole chat; give only id< with it");
33069
33099
  return inStore(async (store, account) => store.messages.messages(account, await readChatId(deps, chat, store, account), {
33070
33100
  limit,
@@ -33074,28 +33104,28 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
33074
33104
  }
33075
33105
  const threadId = threadIdOf(typedThread);
33076
33106
  if (threadId !== void 0)
33077
- return topicPage(chat, threadId, { limit, before: before2, beforeTime, after });
33078
- if (beforeTime !== void 0) {
33079
- if (deps.offline)
33080
- throw new CliError("validation_error", "reading back from a time asks the messenger; not with --offline");
33081
- if (fromStore(deps))
33082
- throw new CliError("validation_error", `${PUSHED}, which pages back from a message only`);
33083
- const connection = await deps.connection();
33084
- return capability(connection, "historyBefore", "read back from a time")(chat, { limit, time: beforeTime });
33107
+ return topicPage(chat, threadId, { limit, before: before2, beforeTime, after, until });
33108
+ if (fromStore(deps)) {
33109
+ const window4 = after ? { limit, after, ...until === void 0 ? {} : { until } } : {
33110
+ limit,
33111
+ ...before2 === void 0 ? {} : { before: before2 },
33112
+ // historyBefore reads strictly before its moment; the store's end is inclusive.
33113
+ ...beforeTime === void 0 ? {} : { until: beforeTime - 1 }
33114
+ };
33115
+ return inStore(async (store, account) => store.messages.messages(account, await readChatId(deps, chat, store, account), window4));
33085
33116
  }
33117
+ const connection = await deps.connection();
33118
+ if (beforeTime !== void 0)
33119
+ return capability(connection, "historyBefore", "read back from a time")(chat, { limit, time: beforeTime });
33086
33120
  if (after !== void 0) {
33087
- if (deps.offline)
33088
- throw new CliError("validation_error", "reading forward asks the messenger; the store pages only backwards");
33089
- if (fromStore(deps))
33090
- throw new CliError("validation_error", `${PUSHED}, which pages only backwards`);
33091
- const connection = await deps.connection();
33092
- return capability(connection, "historyAfter", "read forward from a message")(chat, { limit, after });
33121
+ const page = await capability(connection, "historyAfter", "read forward from a message")(chat, { limit, after });
33122
+ if (until === void 0)
33123
+ return page;
33124
+ const items = page.items.filter((one) => Date.parse(one.timestamp) <= until);
33125
+ return { items, hasMore: page.hasMore && items.length === page.items.length };
33093
33126
  }
33094
33127
  const window3 = { limit, ...before2 === void 0 ? {} : { before: before2 } };
33095
- if (fromStore(deps)) {
33096
- return inStore(async (store, account) => store.messages.messages(account, await readChatId(deps, chat, store, account), window3));
33097
- }
33098
- return capability(await deps.connection(), "history", "read a chat's history")(chat, window3);
33128
+ return capability(connection, "history", "read a chat's history")(chat, window3);
33099
33129
  }, "listPage");
33100
33130
  return {
33101
33131
  // A provider caps its pages (Telegram at 100), so a larger --limit reads on from the last page's edge.
@@ -33123,11 +33153,8 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
33123
33153
  }, "list"),
33124
33154
  around: /* @__PURE__ */ __name(async (reference, message, window3) => {
33125
33155
  const target2 = messageLinkTarget(reference, message, deps.messenger.provider);
33126
- if (target2.account !== void 0) {
33127
- const account = await deps.account();
33128
- if (account.provider !== deps.messenger.provider || target2.account !== account.account)
33129
- throw new CliError("validation_error", "that locator belongs to another account; select its profile first");
33130
- }
33156
+ if (target2.account !== void 0)
33157
+ await ownTarget(target2, await deps.account());
33131
33158
  if (fromStore(deps)) {
33132
33159
  return inStore(async (store, account) => store.messages.around(account, await readChatId(deps, target2.chat, store, account), target2.message, window3));
33133
33160
  }
@@ -33135,8 +33162,7 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
33135
33162
  }, "around"),
33136
33163
  thread: /* @__PURE__ */ __name((reference, message, options) => inStore(async (store, account) => {
33137
33164
  const target2 = messageLinkTarget(reference, message, deps.messenger.provider);
33138
- if (account.provider !== deps.messenger.provider || target2.account !== void 0 && target2.account !== account.account)
33139
- throw new CliError("validation_error", "that locator belongs to another account; select its profile first");
33165
+ await ownTarget(target2, account);
33140
33166
  return readThreadContext(store, account, await storedChatId(deps.messenger, target2.chat, store, account, { includeLeft: true }), target2.message, options);
33141
33167
  }), "thread"),
33142
33168
  comments: /* @__PURE__ */ __name(async (chat, typedPost, window3) => {
@@ -33155,8 +33181,7 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
33155
33181
  link: /* @__PURE__ */ __name(async (reference, message) => {
33156
33182
  const target2 = messageLinkTarget(reference, message, deps.messenger.provider);
33157
33183
  const account = await deps.account();
33158
- if (account.provider !== deps.messenger.provider || target2.account !== void 0 && target2.account !== account.account)
33159
- throw new CliError("validation_error", "that locator belongs to another account; select its profile first");
33184
+ await ownTarget(target2, account);
33160
33185
  if (fromStore(deps)) {
33161
33186
  const store = await deps.store();
33162
33187
  const chat2 = await readChatId(deps, target2.chat, store, account);
@@ -33193,8 +33218,8 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
33193
33218
  }, "link"),
33194
33219
  download: /* @__PURE__ */ __name(async (reference, message) => {
33195
33220
  const target2 = messageLinkTarget(reference, message, deps.messenger.provider);
33196
- if (target2.account !== void 0 && target2.account !== (await deps.account()).account)
33197
- throw new CliError("validation_error", "that locator belongs to another account; select its profile first");
33221
+ if (target2.account !== void 0)
33222
+ await ownTarget(target2, await deps.account());
33198
33223
  const connection = await deps.connection();
33199
33224
  const download = capability(connection, "download", "download attachments");
33200
33225
  return download((await connection.resolve(target2.chat)).id, target2.message);
@@ -33445,7 +33470,7 @@ var checkMediaOptions = /* @__PURE__ */ __name((messenger, asked, attachments) =
33445
33470
  throw new CliError("validation_error", `${MEDIA_FLAGS[first2]} needs a --photo or --file`);
33446
33471
  }, "checkMediaOptions");
33447
33472
 
33448
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/domain/channel-tags.js
33473
+ // 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/channel-tags.js
33449
33474
  var CHANNEL_TAG_RULES_VERSION = "keywords-v1";
33450
33475
  var RULES = {
33451
33476
  ai: [/\b(ai|gpt|llm|machine learning|artificial intelligence)\b/iu, /нейросет|искусственн/iu],
@@ -33460,7 +33485,7 @@ var classifyChannel = /* @__PURE__ */ __name((metadata) => Object.entries(RULES)
33460
33485
  return fields.length ? [{ tag, score: fields.length / 3, fields }] : [];
33461
33486
  }), "classifyChannel");
33462
33487
 
33463
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/metadata.js
33488
+ // 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/services/metadata.js
33464
33489
  var metadataService = /* @__PURE__ */ __name((deps) => {
33465
33490
  const held = /* @__PURE__ */ __name(async (reference, { includeLeft = false } = {}) => {
33466
33491
  const store = await deps.store();
@@ -33546,7 +33571,7 @@ var metadataService = /* @__PURE__ */ __name((deps) => {
33546
33571
  };
33547
33572
  }, "metadataService");
33548
33573
 
33549
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/moderation/run.js
33574
+ // 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/run.js
33550
33575
  var FIRST_LOOK_MS = 24 * 36e5;
33551
33576
  var moderateWith = /* @__PURE__ */ __name(async (run) => {
33552
33577
  const { chatId, title, rules, point, since, dryRun } = run;
@@ -33583,7 +33608,7 @@ var moderateWith = /* @__PURE__ */ __name(async (run) => {
33583
33608
  return { chatId, rows, notes };
33584
33609
  }, "moderateWith");
33585
33610
 
33586
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/moderation.js
33611
+ // 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/services/moderation.js
33587
33612
  var moderationService = /* @__PURE__ */ __name((deps) => {
33588
33613
  const file = /* @__PURE__ */ __name(() => new ModerationRules(moderationPathFor(deps.messenger.app, deps.profile ?? "default", deps.env ?? process.env)), "file");
33589
33614
  const group = /* @__PURE__ */ __name(async (chat) => {
@@ -33661,7 +33686,7 @@ var moderatorOf = /* @__PURE__ */ __name((adapter, deps) => ({
33661
33686
  }, "removePerson")
33662
33687
  }), "moderatorOf");
33663
33688
 
33664
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/private-people.js
33689
+ // 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/services/private-people.js
33665
33690
  var noteItem = /* @__PURE__ */ __name((provider, note) => ({
33666
33691
  id: note.id,
33667
33692
  contact: formatReference({ type: "contact", provider, id: note.personId }),
@@ -33705,7 +33730,7 @@ var privatePeopleService = /* @__PURE__ */ __name((deps) => {
33705
33730
  };
33706
33731
  }, "privatePeopleService");
33707
33732
 
33708
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/rankings.js
33733
+ // 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/services/rankings.js
33709
33734
  var empty = /* @__PURE__ */ __name(() => ({
33710
33735
  total: 0,
33711
33736
  population: 0,
@@ -33961,7 +33986,7 @@ var rankingsService = /* @__PURE__ */ __name((deps) => ({
33961
33986
  }, "evidence")
33962
33987
  }), "rankingsService");
33963
33988
 
33964
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/searches.js
33989
+ // 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/services/searches.js
33965
33990
  var savedSearchItem = /* @__PURE__ */ __name((one) => ({
33966
33991
  id: one.id,
33967
33992
  name: one.name,
@@ -34090,7 +34115,7 @@ var searchesService = /* @__PURE__ */ __name((deps) => {
34090
34115
  };
34091
34116
  }, "searchesService");
34092
34117
 
34093
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/tags.js
34118
+ // 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/services/tags.js
34094
34119
  var TAGGING_QUERY = {
34095
34120
  entity: "tagging",
34096
34121
  backend: "sql",
@@ -34174,7 +34199,7 @@ var tagsService = /* @__PURE__ */ __name((deps) => {
34174
34199
  };
34175
34200
  }, "tagsService");
34176
34201
 
34177
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/topics.js
34202
+ // 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/services/topics.js
34178
34203
  var actionOf = /* @__PURE__ */ __name(({ title, closed, pinned, hidden, icon }) => {
34179
34204
  const set = [closed, pinned, hidden].filter((one) => one !== void 0).length;
34180
34205
  if (title !== void 0 || icon !== void 0 || set !== 1)
@@ -34373,7 +34398,7 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
34373
34398
  };
34374
34399
  }, "topicsService");
34375
34400
 
34376
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/evidence.js
34401
+ // 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/services/evidence.js
34377
34402
  import { createHash as createHash11, randomUUID as randomUUID5 } from "node:crypto";
34378
34403
  var hash2 = /* @__PURE__ */ __name((value) => createHash11("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
34379
34404
  var positive = /* @__PURE__ */ __name((value, name, minimum = 1) => {
@@ -34447,7 +34472,7 @@ var prepareEvidencePacket = /* @__PURE__ */ __name(({ kind, source, page, limits
34447
34472
  return { ...content, id: randomUUID5(), fingerprint: hash2(content) };
34448
34473
  }, "prepareEvidencePacket");
34449
34474
 
34450
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/evidence-read.js
34475
+ // 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/services/evidence-read.js
34451
34476
  var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, limit, before: before2 }, messenger = {}) => {
34452
34477
  if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100)
34453
34478
  throw new CliError("validation_error", "evidence message limit must be an integer from 1 to 100");
@@ -34467,7 +34492,7 @@ var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, l
34467
34492
  return { ...packet, nextBeforeId: older && last ? last.id : null };
34468
34493
  }, "readEvidencePacket");
34469
34494
 
34470
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/meeting-project-discovery.js
34495
+ // 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/services/meeting-project-discovery.js
34471
34496
  var scopeKeys = [
34472
34497
  "accountId",
34473
34498
  "meetingId",
@@ -34489,7 +34514,7 @@ var optionKeys = /* @__PURE__ */ new Set([
34489
34514
  "maxVocabularyReadBytes"
34490
34515
  ]);
34491
34516
 
34492
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/context/communication-selection.js
34517
+ // 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/context/communication-selection.js
34493
34518
  var communicationFields = {
34494
34519
  sources: pipe(array(strictObject({
34495
34520
  id: pipe(string(), regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)),
@@ -34521,7 +34546,7 @@ var communicationRequest = /* @__PURE__ */ __name((value, preparationAfter) => {
34521
34546
  return { ...input, after, before: before2 };
34522
34547
  }, "communicationRequest");
34523
34548
 
34524
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/meeting-preparation-validation.js
34549
+ // 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/services/meeting-preparation-validation.js
34525
34550
  var MEETING_PREPARATION_LIMITS = {
34526
34551
  meetings: { min: 1, max: 20, default: 5 },
34527
34552
  cues: { min: 1, max: 100, default: 10 },
@@ -34594,7 +34619,7 @@ var validateMeetingPreparationRequest = /* @__PURE__ */ __name((externalId, orig
34594
34619
  };
34595
34620
  }, "validateMeetingPreparationRequest");
34596
34621
 
34597
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/meeting-communications-selection.js
34622
+ // 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/services/meeting-communications-selection.js
34598
34623
  var validatePreparationCommunications = /* @__PURE__ */ __name((section, request, after) => {
34599
34624
  const fail2 = /* @__PURE__ */ __name(() => {
34600
34625
  throw new CliError("invalid_response", "Preparation communications returned another selection or invalid evidence");
@@ -34642,7 +34667,7 @@ var validatePreparationCommunications = /* @__PURE__ */ __name((section, request
34642
34667
  }
34643
34668
  }, "validatePreparationCommunications");
34644
34669
 
34645
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/package-upgrade.js
34670
+ // 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/services/package-upgrade.js
34646
34671
  var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageName, check: check2 }, ports) => {
34647
34672
  const installer = ports.installer();
34648
34673
  const argv = updateCommand(installer, packageName);
@@ -34707,7 +34732,7 @@ var dayAfter = /* @__PURE__ */ __name((published) => {
34707
34732
  return Number.isNaN(time) ? null : new Date(time + 24 * 60 * 60 * 1e3).toISOString();
34708
34733
  }, "dayAfter");
34709
34734
 
34710
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/services/index.js
34735
+ // 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/services/index.js
34711
34736
  var servicesFor = /* @__PURE__ */ __name((deps) => {
34712
34737
  const pictures = picturesService(deps);
34713
34738
  const base = {
@@ -34743,7 +34768,7 @@ var servicesFor = /* @__PURE__ */ __name((deps) => {
34743
34768
  return deps.messenger.services ? { ...base, ...deps.messenger.services(base, deps) } : base;
34744
34769
  }, "servicesFor");
34745
34770
 
34746
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/background/relay.js
34771
+ // 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/background/relay.js
34747
34772
  import { createHash as createHash12 } from "node:crypto";
34748
34773
  import { chmodSync, lstatSync, mkdirSync as mkdirSync3, rmSync } from "node:fs";
34749
34774
  import { createConnection, createServer } from "node:net";
@@ -34964,7 +34989,7 @@ var relayCommand = /* @__PURE__ */ __name((path, request, options) => new Promis
34964
34989
  }, () => finish({ error: stopped() }));
34965
34990
  }), "relayCommand");
34966
34991
 
34967
- // node_modules/.pnpm/@wirecat+cli-core@0.542.0_@wirecat+cli-base@0.72.0_commander@15.0.0_esbuild@0.28.2_type_30804e4648080c93f4901a09634b7e87/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-relay.js
34992
+ // 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-relay.js
34968
34993
  var lentConnection = /* @__PURE__ */ __name((connection, watchers) => throughWrapper(connection, {
34969
34994
  close: /* @__PURE__ */ __name(async () => {
34970
34995
  }, "close"),
@@ -35058,34 +35083,18 @@ export {
35058
35083
  REGISTRIES,
35059
35084
  registriesCover,
35060
35085
  chatCoverage,
35061
- excerpt,
35062
- validateMediaSince,
35063
- checkMediaArchive,
35064
- archiveMedia,
35065
- moveMediaArchive,
35066
- downloadTextModel,
35067
- downloadRerankModel,
35068
- downloadImageModel,
35069
- gatherStoredProject,
35086
+ threadIdOf,
35070
35087
  throughWrapper,
35071
35088
  capability,
35089
+ syncsOneChat,
35072
35090
  newSendId,
35073
35091
  newOperationId,
35074
- sendTime,
35075
- syncsOneChat,
35076
- readMail,
35077
- storedChatId,
35078
- chatIdIn,
35079
- momentOf,
35080
- aheadOf,
35081
- dateWindow,
35082
- RANKING_SELECTION_BYTES,
35083
- readRankingSelection,
35084
- isAdminSelection,
35085
- threadIdOf,
35086
35092
  AUDIT_PAGE,
35087
35093
  AUDIT_BUDGET,
35088
35094
  AUDIT_MIN_SCORE,
35095
+ storedChatId,
35096
+ chatIdIn,
35097
+ profilesOnAccount,
35089
35098
  EVENTS_DAYS,
35090
35099
  TRACKED_DAYS,
35091
35100
  CHAT_KINDS,
@@ -35096,6 +35105,23 @@ export {
35096
35105
  applyTaskRulesToChats,
35097
35106
  AGENDA_QUERY,
35098
35107
  agendaItem,
35108
+ excerpt,
35109
+ validateMediaSince,
35110
+ checkMediaArchive,
35111
+ archiveMedia,
35112
+ moveMediaArchive,
35113
+ downloadTextModel,
35114
+ downloadRerankModel,
35115
+ downloadImageModel,
35116
+ gatherStoredProject,
35117
+ sendTime,
35118
+ readMail,
35119
+ momentOf,
35120
+ aheadOf,
35121
+ dateWindow,
35122
+ RANKING_SELECTION_BYTES,
35123
+ readRankingSelection,
35124
+ isAdminSelection,
35099
35125
  batchProgress,
35100
35126
  mergeBatches,
35101
35127
  patiently,
@@ -35191,6 +35217,7 @@ export {
35191
35217
  pageOf,
35192
35218
  pagedList,
35193
35219
  nativeTerms,
35220
+ nativeTermLists,
35194
35221
  queryTerms,
35195
35222
  timeBounds,
35196
35223
  searchText,