@wirecat/mail-cli 0.32.0 → 0.33.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 (117) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/bin/mail.js +2 -2
  3. package/dist/bundle/{all-profiles-OTCWJSJS.js → all-profiles-W3CGXEEJ.js} +10 -10
  4. package/dist/bundle/{anthropic-GUXHDK32.js → anthropic-UMDO5AKP.js} +5 -5
  5. package/dist/bundle/{app-server-GX7DOE4O.js → app-server-4SICQ5RP.js} +50 -50
  6. package/dist/bundle/{bun-V5QLYBZU.js → bun-QVVCH4MJ.js} +2 -2
  7. package/dist/bundle/{bun-sqlite-AXD5CCO3.js → bun-sqlite-CHD4AIUK.js} +6 -6
  8. package/dist/bundle/{chunk-KLGZX6QT.js → chunk-2BFXHCZW.js} +2 -2
  9. package/dist/bundle/{chunk-AJY2IT25.js → chunk-2L6D54BR.js} +8 -8
  10. package/dist/bundle/{chunk-RNBG75HW.js → chunk-2P44S7XK.js} +26 -29
  11. package/dist/bundle/{chunk-Z6OKVD3R.js → chunk-2X344EUT.js} +8 -8
  12. package/dist/bundle/{chunk-M4OP5ASJ.js → chunk-35AH33VJ.js} +1 -1
  13. package/dist/bundle/{chunk-2IYAZRTC.js → chunk-47YNANPZ.js} +2 -2
  14. package/dist/bundle/{chunk-7C6FGWDH.js → chunk-6IS4BEN4.js} +4 -4
  15. package/dist/bundle/{chunk-CAQ5GW3A.js → chunk-6VCQ4CTK.js} +1 -1
  16. package/dist/bundle/{chunk-HUWQ7LXZ.js → chunk-74BYHR44.js} +584 -588
  17. package/dist/bundle/{chunk-U346WBJ5.js → chunk-7OYZU5SP.js} +4 -4
  18. package/dist/bundle/{chunk-SWXKS7JK.js → chunk-AEKWEYIG.js} +17 -17
  19. package/dist/bundle/{chunk-JRGPPS6H.js → chunk-BF73DBAA.js} +13 -13
  20. package/dist/bundle/{chunk-7KCBPAQS.js → chunk-BI5P7JWM.js} +2 -2
  21. package/dist/bundle/{chunk-7MEVD5PI.js → chunk-BRRHYXUP.js} +19 -19
  22. package/dist/bundle/{chunk-PALY5PGE.js → chunk-BZY5W35X.js} +7 -7
  23. package/dist/bundle/{chunk-ZAD7K4TI.js → chunk-CHNNKHLL.js} +7468 -7317
  24. package/dist/bundle/{chunk-GPOTPA3S.js → chunk-CIG4UVP6.js} +12 -12
  25. package/dist/bundle/{chunk-7GW4D3OW.js → chunk-CZ6ZXDSO.js} +43 -35
  26. package/dist/bundle/{chunk-ANYADN3S.js → chunk-DI74RP6R.js} +18 -18
  27. package/dist/bundle/{chunk-IX3GUNGV.js → chunk-EW3JFV7J.js} +4 -4
  28. package/dist/bundle/{chunk-TWHIZJAZ.js → chunk-FSMCXQH2.js} +2 -2
  29. package/dist/bundle/{chunk-SEJBS7SI.js → chunk-GZYICXO4.js} +1 -1
  30. package/dist/bundle/{chunk-WNGMI6AZ.js → chunk-H46MANPR.js} +3 -3
  31. package/dist/bundle/{chunk-QHXOXYAT.js → chunk-HFFHL7SV.js} +55 -55
  32. package/dist/bundle/{chunk-GSXCMQWV.js → chunk-I3UAD4EI.js} +30 -30
  33. package/dist/bundle/{chunk-IBCGCYRU.js → chunk-IBIFX2LK.js} +2 -2
  34. package/dist/bundle/{chunk-FA3B2DHZ.js → chunk-IPSLQX64.js} +2 -2
  35. package/dist/bundle/{chunk-3URYKAJP.js → chunk-JADBHKBP.js} +1 -1
  36. package/dist/bundle/{chunk-GDDCKTBR.js → chunk-JCQ47WR4.js} +5 -5
  37. package/dist/bundle/{chunk-JUS4Y4BW.js → chunk-JUYUWMTG.js} +4 -4
  38. package/dist/bundle/{chunk-TDTCCHAI.js → chunk-KLLT572M.js} +3 -3
  39. package/dist/bundle/{chunk-O7OP5NQO.js → chunk-L3MKFI3Y.js} +2 -2
  40. package/dist/bundle/{chunk-T577U52I.js → chunk-LACMDMDI.js} +9 -9
  41. package/dist/bundle/{chunk-CD3TAITM.js → chunk-LB5FTCPZ.js} +3 -4
  42. package/dist/bundle/{chunk-6TRKNME5.js → chunk-LFBD6RTX.js} +2 -2
  43. package/dist/bundle/{chunk-PCMQYGEM.js → chunk-LKGJMM6W.js} +6 -6
  44. package/dist/bundle/{chunk-SDAYOJLL.js → chunk-LXAX6AZU.js} +6 -6
  45. package/dist/bundle/{chunk-6SJ7HHAE.js → chunk-LXUHYDNE.js} +1 -1
  46. package/dist/bundle/{chunk-MT2WDBG2.js → chunk-MJ7DUSHT.js} +14 -14
  47. package/dist/bundle/{chunk-U57QRUP7.js → chunk-MNJ3BMPZ.js} +3 -3
  48. package/dist/bundle/{chunk-HFA6AZWA.js → chunk-MT7T5N2N.js} +4 -4
  49. package/dist/bundle/{chunk-MVMNZ3Q3.js → chunk-OFMYFFEF.js} +461 -402
  50. package/dist/bundle/{chunk-OUM4ZO53.js → chunk-OOYIPK4F.js} +1 -1
  51. package/dist/bundle/{chunk-MENP3FF5.js → chunk-OWAJN74H.js} +15 -15
  52. package/dist/bundle/{chunk-SZZJOSIS.js → chunk-QN423PC6.js} +3 -3
  53. package/dist/bundle/{chunk-KLFF54AF.js → chunk-QO7BK4WD.js} +8 -8
  54. package/dist/bundle/{chunk-2UMEZY6D.js → chunk-RENCSP47.js} +3 -3
  55. package/dist/bundle/{chunk-FIVFP53N.js → chunk-RXUVXAMM.js} +1 -1
  56. package/dist/bundle/{chunk-IVD3JTN5.js → chunk-S6CHYNFE.js} +2 -2
  57. package/dist/bundle/{chunk-ZDP6A2VL.js → chunk-SDWYOYGN.js} +4 -4
  58. package/dist/bundle/{chunk-PCWAZVAD.js → chunk-SW7YGW3T.js} +7 -7
  59. package/dist/bundle/{chunk-MSK7RNOM.js → chunk-SYUIAMVA.js} +178 -154
  60. package/dist/bundle/{chunk-XXXVVNGI.js → chunk-TBZLGT7R.js} +17 -17
  61. package/dist/bundle/{chunk-4YNUQGDP.js → chunk-TK77DCE5.js} +1 -1
  62. package/dist/bundle/{chunk-MHXZ62CU.js → chunk-UAV74EY4.js} +1 -1
  63. package/dist/bundle/{chunk-WQOGHND4.js → chunk-UG2QDGAH.js} +1 -1
  64. package/dist/bundle/{chunk-ECZSYLSL.js → chunk-UWF3SSRL.js} +25 -8
  65. package/dist/bundle/{chunk-LVFI3TCG.js → chunk-UX76GMQM.js} +6 -6
  66. package/dist/bundle/{chunk-6XNTELM5.js → chunk-UYZDH5LK.js} +1 -1
  67. package/dist/bundle/{chunk-NMN5JUYL.js → chunk-XN5KH24X.js} +5 -5
  68. package/dist/bundle/{chunk-U7RLFLTM.js → chunk-XQXYAOBV.js} +30 -29
  69. package/dist/bundle/{chunk-LVJWN2PR.js → chunk-Y2P2LC5R.js} +21 -11
  70. package/dist/bundle/command-contract-NRNQAFFE.js +36 -0
  71. package/dist/bundle/{command-server-entry-BVXOPKXH.js → command-server-entry-G2ZHCN5J.js} +25 -25
  72. package/dist/bundle/{decode-STN3EHT7.js → decode-U6V6D6XH.js} +5 -5
  73. package/dist/bundle/{dispatch-DSVN7MNG.js → dispatch-RHIK22OA.js} +8 -8
  74. package/dist/bundle/{dist-B2JWWTNN.js → dist-X5G2IMYG.js} +15 -15
  75. package/dist/bundle/{echarts-QIXLXS3G.js → echarts-UZJ6AREV.js} +2 -2
  76. package/dist/bundle/{embed-4NC4ELYP.js → embed-FEXLUH3T.js} +6 -6
  77. package/dist/bundle/{embedder-HBRDIFQC.js → embedder-NHQARKFJ.js} +9 -9
  78. package/dist/bundle/{failure-COTPFUP4.js → failure-7DIA4OET.js} +2 -2
  79. package/dist/bundle/{first-run-6QF67AAZ.js → first-run-PS5NR2QG.js} +12 -12
  80. package/dist/bundle/first-screen-C2WTLOG2.js +34 -0
  81. package/dist/bundle/{instructions-MD2RZT5Z.js → instructions-SDDUBGH4.js} +1 -1
  82. package/dist/bundle/mail.js +12 -12
  83. package/dist/bundle/{mcp-TDKGDB4V.js → mcp-GN4FTJX5.js} +2 -2
  84. package/dist/bundle/{node-IEVT2FSJ.js → node-ELCNUOCE.js} +2 -2
  85. package/dist/bundle/{node-sqlite-EOTTDMOG.js → node-sqlite-2E5MKZMH.js} +7 -7
  86. package/dist/bundle/{oauth-A5BEFGCI.js → oauth-JGPEIY3M.js} +7 -7
  87. package/dist/bundle/{open-HWN2EZYG.js → open-6DEMCZAB.js} +5 -5
  88. package/dist/bundle/{openai-PJKJ4CIU.js → openai-IVKDU5AH.js} +15 -15
  89. package/dist/bundle/{process-6Q23D3TO.js → process-67DAKAAQ.js} +1 -1
  90. package/dist/bundle/{program-WR43NPAV.js → program-ESJDQMAJ.js} +461 -466
  91. package/dist/bundle/{prompt-E7Q2662O.js → prompt-ZBWOT5KG.js} +5 -5
  92. package/dist/bundle/{recognize-4F4PIL4B.js → recognize-UUBH2DOH.js} +4 -4
  93. package/dist/bundle/{remote-RGJXO7XK.js → remote-UYTNWNOB.js} +9 -9
  94. package/dist/bundle/{rerank-EDY7PHMG.js → rerank-X2633CQN.js} +7 -7
  95. package/dist/bundle/{serve-Q4XF6ID2.js → serve-CP7Q4OVW.js} +9 -9
  96. package/dist/bundle/{server-5I72DSDF.js → server-I7MXRSAG.js} +42 -42
  97. package/dist/bundle/server-QGTMJ7SF.js +67 -0
  98. package/dist/bundle/{sqlite-runtime-PU3Z2H7C.js → sqlite-runtime-BX55LI5G.js} +6 -6
  99. package/dist/bundle/{state-CWSXJBU2.js → state-LLNJQXFH.js} +6 -6
  100. package/dist/bundle/{store-KQPKS3PX.js → store-K4KU5N75.js} +19 -19
  101. package/dist/bundle/{store-ZAMKKM2A.js → store-N27XI3VV.js} +17 -17
  102. package/dist/bundle/store-maintenance-command-VPAFQCNA.js +58 -0
  103. package/dist/commands/messages.js +1 -1
  104. package/dist/commands/messages.js.map +1 -1
  105. package/dist/mail/cleanup.d.ts.map +1 -1
  106. package/dist/mail/cleanup.js +4 -3
  107. package/dist/mail/cleanup.js.map +1 -1
  108. package/dist/mail/rules/apply.js +1 -1
  109. package/dist/mail/rules/apply.js.map +1 -1
  110. package/dist/version.d.ts +1 -1
  111. package/dist/version.js +1 -1
  112. package/package.json +3 -3
  113. package/dist/bundle/command-contract-DZ6XRIOI.js +0 -36
  114. package/dist/bundle/first-screen-LXSZMK2P.js +0 -34
  115. package/dist/bundle/server-2Y5NSP2U.js +0 -67
  116. package/dist/bundle/store-maintenance-command-PMTTDR6J.js +0 -58
  117. /package/dist/bundle/{chunk-XWBPP2HX.js → chunk-BDCC2J2Z.js} +0 -0
@@ -8,7 +8,7 @@ import {
8
8
  sameOrdinaryFile,
9
9
  syncDirectory,
10
10
  writeFileAtomic
11
- } from "./chunk-JRGPPS6H.js";
11
+ } from "./chunk-BF73DBAA.js";
12
12
  import {
13
13
  MAX_ACTIONS,
14
14
  ModerationRules,
@@ -17,11 +17,12 @@ import {
17
17
  gather,
18
18
  judge,
19
19
  moderationPathFor,
20
+ moderationProfiles,
20
21
  nextPoint,
21
22
  someUndone,
22
23
  validateFormattedText,
23
24
  visibleFormattedText
24
- } from "./chunk-LVJWN2PR.js";
25
+ } from "./chunk-Y2P2LC5R.js";
25
26
  import {
26
27
  EmptyAnswer,
27
28
  MAX_MODEL_IMAGE_BYTES,
@@ -30,10 +31,11 @@ import {
30
31
  range,
31
32
  systemFor,
32
33
  validateImages
33
- } from "./chunk-ZDP6A2VL.js";
34
+ } from "./chunk-SDWYOYGN.js";
34
35
  import {
35
36
  Command,
36
37
  CustomTextModelShape,
38
+ DEFAULT_CONFIG,
37
39
  DEFAULT_IMAGE_MODEL,
38
40
  DEFAULT_RERANK_MODEL,
39
41
  DEFAULT_TEXT_MODEL,
@@ -78,8 +80,9 @@ import {
78
80
  textModel,
79
81
  textModels,
80
82
  vectorModelKey,
83
+ withAgentLevels,
81
84
  writeTextModelsSection
82
- } from "./chunk-MSK7RNOM.js";
85
+ } from "./chunk-SYUIAMVA.js";
83
86
  import {
84
87
  CEILING_KEY,
85
88
  STORE_ONLY_KEYS,
@@ -87,11 +90,11 @@ import {
87
90
  levelFor,
88
91
  skipFlagFor,
89
92
  stops
90
- } from "./chunk-PCWAZVAD.js";
93
+ } from "./chunk-SW7YGW3T.js";
91
94
  import {
92
95
  isNewer,
93
96
  updateCommand
94
- } from "./chunk-7C6FGWDH.js";
97
+ } from "./chunk-6IS4BEN4.js";
95
98
  import {
96
99
  AGENDA_COLUMNS,
97
100
  BUSINESS_FIND_MAX,
@@ -105,15 +108,18 @@ import {
105
108
  MAX_FILE_BYTES,
106
109
  MAX_TEXT_CHARS,
107
110
  MENTION_QUERY,
111
+ MINUTE,
108
112
  NOT_FILES,
109
113
  PRESET_VERSION,
114
+ RRF_K,
110
115
  TASK_RELATION_KINDS,
111
116
  TRACKED_CHAT_COLUMNS,
117
+ YEAR,
118
+ aheadOf,
112
119
  amountsOf,
113
120
  attachmentColumns,
114
121
  attachmentMaxBytes,
115
122
  calendarKey,
116
- calendarMoment,
117
123
  certaintyOf,
118
124
  chunkHash,
119
125
  chunkTextOf,
@@ -126,6 +132,7 @@ import {
126
132
  dueDayOf,
127
133
  fetchedKey,
128
134
  foldedWords,
135
+ fuseRanked,
129
136
  googleDocumentLinks,
130
137
  hasStems,
131
138
  hasText,
@@ -143,11 +150,12 @@ import {
143
150
  profilesOn,
144
151
  queryFilter,
145
152
  rankingContextRange,
153
+ readMoment,
146
154
  threadConversation,
147
155
  validateAst,
148
156
  validateFields,
149
157
  withoutField
150
- } from "./chunk-ZAD7K4TI.js";
158
+ } from "./chunk-CHNNKHLL.js";
151
159
  import {
152
160
  COUNTER_FIELDS,
153
161
  MESSAGE_PARSING,
@@ -172,7 +180,7 @@ import {
172
180
  rankingOptions,
173
181
  rankingQuestion,
174
182
  searchError
175
- } from "./chunk-ANYADN3S.js";
183
+ } from "./chunk-DI74RP6R.js";
176
184
  import {
177
185
  LOG_ATTRIBUTES,
178
186
  TASK_KINDS,
@@ -195,7 +203,7 @@ import {
195
203
  sourceOf3 as sourceOf2,
196
204
  typedCommand,
197
205
  withAttempt
198
- } from "./chunk-U7RLFLTM.js";
206
+ } from "./chunk-XQXYAOBV.js";
199
207
  import {
200
208
  BACKENDS,
201
209
  EVENT_QUERY,
@@ -260,40 +268,39 @@ import {
260
268
  validateMeetingPassage,
261
269
  validateQuery,
262
270
  walkQuery,
263
- windowOf,
264
- zonedMoment
265
- } from "./chunk-MVMNZ3Q3.js";
271
+ windowOf
272
+ } from "./chunk-OFMYFFEF.js";
266
273
  import {
267
274
  isCliFailure,
268
275
  sqliteCode
269
- } from "./chunk-O7OP5NQO.js";
276
+ } from "./chunk-L3MKFI3Y.js";
270
277
  import {
271
278
  DEFAULT_STEMMERS,
272
279
  createStemmer
273
- } from "./chunk-KLFF54AF.js";
280
+ } from "./chunk-QO7BK4WD.js";
274
281
  import {
275
282
  fold,
276
283
  normalize
277
- } from "./chunk-4YNUQGDP.js";
284
+ } from "./chunk-TK77DCE5.js";
278
285
  import {
279
286
  localOnly,
280
287
  refuseOffComputer,
281
288
  remoteKey
282
- } from "./chunk-T577U52I.js";
289
+ } from "./chunk-LACMDMDI.js";
283
290
  import {
284
291
  PLAIN_HTTP_REFUSED,
285
292
  endpoint,
286
293
  endpointFetch,
287
294
  modelAddressAllowed,
288
295
  onThisComputer
289
- } from "./chunk-GDDCKTBR.js";
296
+ } from "./chunk-JCQ47WR4.js";
290
297
  import {
291
298
  DEFAULT_TASK_CATEGORIES,
292
299
  FALLBACK_CATEGORY,
293
300
  readSharedSection,
294
301
  sharedConfigPath,
295
302
  writeSharedSection
296
- } from "./chunk-PALY5PGE.js";
303
+ } from "./chunk-BZY5W35X.js";
297
304
  import {
298
305
  Unzip,
299
306
  UnzipInflate,
@@ -304,15 +311,15 @@ import {
304
311
  placedText,
305
312
  runEmbedders,
306
313
  textModelsDirectory
307
- } from "./chunk-LVFI3TCG.js";
314
+ } from "./chunk-UX76GMQM.js";
308
315
  import {
309
316
  installFiles,
310
317
  megabytes
311
- } from "./chunk-JUS4Y4BW.js";
318
+ } from "./chunk-JUYUWMTG.js";
312
319
  import {
313
320
  storePath,
314
321
  wirecatDirectory
315
- } from "./chunk-FA3B2DHZ.js";
322
+ } from "./chunk-IPSLQX64.js";
316
323
  import {
317
324
  Credentials,
318
325
  logRecordOf,
@@ -320,7 +327,7 @@ import {
320
327
  realSleep,
321
328
  resolvePaths,
322
329
  writeSecurely
323
- } from "./chunk-7MEVD5PI.js";
330
+ } from "./chunk-BRRHYXUP.js";
324
331
  import {
325
332
  array,
326
333
  boolean,
@@ -348,7 +355,7 @@ import {
348
355
  trim,
349
356
  union,
350
357
  unknown
351
- } from "./chunk-ECZSYLSL.js";
358
+ } from "./chunk-UWF3SSRL.js";
352
359
  import {
353
360
  importFrom,
354
361
  resolveFrom
@@ -357,7 +364,7 @@ import {
357
364
  CliError,
358
365
  isCliError,
359
366
  singleLine
360
- } from "./chunk-7KCBPAQS.js";
367
+ } from "./chunk-BI5P7JWM.js";
361
368
  import {
362
369
  __commonJS,
363
370
  __name,
@@ -16973,10 +16980,10 @@ var require_lib3 = __commonJS({
16973
16980
  }
16974
16981
  });
16975
16982
 
16976
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/ports/traits.js
16983
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/ports/traits.js
16977
16984
  var syncsOneChat = /* @__PURE__ */ __name((messenger) => messenger.history !== "store" || messenger.historyOnDemand === true, "syncsOneChat");
16978
16985
 
16979
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/conversations/link.js
16986
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/conversations/link.js
16980
16987
  var RULES_VERSION = 5;
16981
16988
  var LOOK_BACK = 50;
16982
16989
  var SAME_SENDER_WITHIN = 10;
@@ -17066,7 +17073,7 @@ var latest = /* @__PURE__ */ __name((window3, matches) => {
17066
17073
  var sameThread = /* @__PURE__ */ __name((a, b) => a.threadId === b.threadId, "sameThread");
17067
17074
  var link = /* @__PURE__ */ __name((message, parentId, source, kind, confidence, method) => ({ messageId: message.id, parentId, source, kind, confidence, method }), "link");
17068
17075
 
17069
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/sends/upload.js
17076
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/sends/upload.js
17070
17077
  import { openAsBlob, realpathSync } from "node:fs";
17071
17078
  import { open, stat } from "node:fs/promises";
17072
17079
  import { basename, dirname, extname, isAbsolute, relative, resolve, sep } from "node:path";
@@ -17245,7 +17252,7 @@ var checkFilename = /* @__PURE__ */ __name((filename, files) => {
17245
17252
  throw new CliError("validation_error", "--filename is a name, not a path: no / or \\, at most 255 characters");
17246
17253
  }, "checkFilename");
17247
17254
  var listOf2 = /* @__PURE__ */ __name((value) => value === void 0 ? [] : typeof value === "string" ? [value] : value, "listOf");
17248
- var readAttachments = /* @__PURE__ */ __name(async ({ photo, file, voice, asFile, filename, text: text2 }, read) => {
17255
+ var readAttachments = /* @__PURE__ */ __name(async ({ photo, file, voice, asFile, filename, text: text2 }, read2) => {
17249
17256
  const photos = listOf2(photo);
17250
17257
  const files = listOf2(file);
17251
17258
  if (voice !== void 0 && (photos.length > 0 || files.length > 0 || (text2 ?? "").trim() !== "")) {
@@ -17257,21 +17264,21 @@ var readAttachments = /* @__PURE__ */ __name(async ({ photo, file, voice, asFile
17257
17264
  checkFilename(filename, files);
17258
17265
  const uploads = [];
17259
17266
  for (const one of photos)
17260
- uploads.push(await readUpload("photo", one, read));
17267
+ uploads.push(await readUpload("photo", one, read2));
17261
17268
  for (const one of files)
17262
17269
  uploads.push({
17263
- ...await readUpload("file", one, read),
17270
+ ...await readUpload("file", one, read2),
17264
17271
  ...filename === void 0 ? {} : { name: filename },
17265
17272
  ...asFile ? { asFile: true } : {}
17266
17273
  });
17267
17274
  if (voice !== void 0)
17268
- uploads.push(await readUpload("voice", voice, read));
17275
+ uploads.push(await readUpload("voice", voice, read2));
17269
17276
  return uploads;
17270
17277
  }, "readAttachments");
17271
- var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes, read) => {
17278
+ var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes, read2) => {
17272
17279
  if (extname(path).toLowerCase() !== ".webp")
17273
17280
  throw new CliError("validation_error", `a sticker is a .webp \u2014 send ${path} as a photo or a file instead`);
17274
- const { name, source } = await readUpload("file", path, read);
17281
+ const { name, source } = await readUpload("file", path, read2);
17275
17282
  if (SIGNATURES[".webp"]?.(await fileHead(path)) !== true)
17276
17283
  throw new CliError("validation_error", `${path} is named .webp but is not a WebP image \u2014 nothing was sent`);
17277
17284
  const size2 = uploadSize(source);
@@ -17280,10 +17287,10 @@ var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes, read) => {
17280
17287
  return { name, source };
17281
17288
  }, "readStickerFile");
17282
17289
 
17283
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/sends/guard.js
17290
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/sends/guard.js
17284
17291
  import { randomUUID } from "node:crypto";
17285
17292
 
17286
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/sends/flood.js
17293
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/sends/flood.js
17287
17294
  import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
17288
17295
  import { dirname as dirname2, join } from "node:path";
17289
17296
  var MOST_DEADLINES = 50;
@@ -17367,11 +17374,11 @@ var FloodMemory = class {
17367
17374
  }
17368
17375
  };
17369
17376
 
17370
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/sends/journal.js
17377
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/sends/journal.js
17371
17378
  import { appendFileSync, mkdirSync as mkdirSync3, readFileSync as readFileSync2 } from "node:fs";
17372
17379
  import { dirname as dirname4, join as join2 } from "node:path";
17373
17380
 
17374
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/sends/file-lock.js
17381
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/sends/file-lock.js
17375
17382
  import { closeSync, mkdirSync as mkdirSync2, openSync, statSync, unlinkSync } from "node:fs";
17376
17383
  import { dirname as dirname3 } from "node:path";
17377
17384
  var LOCK_WAIT_MS = 5e3;
@@ -17438,7 +17445,7 @@ var lockTime = /* @__PURE__ */ __name((lock) => {
17438
17445
  }
17439
17446
  }, "lockTime");
17440
17447
 
17441
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/sends/journal.js
17448
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/sends/journal.js
17442
17449
  var sendsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join2(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "sends", `${profile}.jsonl`), "sendsPathFor");
17443
17450
  var SendJournal = class {
17444
17451
  static {
@@ -17515,7 +17522,7 @@ var withSendId = /* @__PURE__ */ __name((entry) => {
17515
17522
  return cid === void 0 || rest.sendId !== void 0 ? rest : { ...rest, sendId: String(cid) };
17516
17523
  }, "withSendId");
17517
17524
 
17518
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/sends/recipients.js
17525
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/sends/recipients.js
17519
17526
  import { existsSync, readFileSync as readFileSync3, rmSync } from "node:fs";
17520
17527
  import { join as join3 } from "node:path";
17521
17528
  var recipientsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join3(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "profiles", `${profile}.recipients.json`), "recipientsPathFor");
@@ -17627,7 +17634,7 @@ var RecipientList = class {
17627
17634
  }
17628
17635
  };
17629
17636
 
17630
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/sends/guard.js
17637
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/sends/guard.js
17631
17638
  var HOUR_MS = 60 * 60 * 1e3;
17632
17639
  var countsTowardLimit = /* @__PURE__ */ __name(({ kind = "message", action, notify }) => kind === "message" || kind === "forward" || kind === "edit" || kind === "delete" || kind === "pin" && notify === true || action === "create" || action === "members.add" || action === "requests.accept" || action === "join" || action === "contact-import", "countsTowardLimit");
17633
17640
  var weightOf = /* @__PURE__ */ __name(({ kind = "message", action, count: count4, people }) => kind === "delete" || kind === "message" && action === void 0 ? Math.max(1, count4 ?? 1) : action === "create" || action === "members.add" || action === "requests.accept" || action === "contact-import" ? Math.max(1, people ?? count4 ?? 1) : 1, "weightOf");
@@ -17815,7 +17822,7 @@ var guardFor = /* @__PURE__ */ __name((app, settings, warn, env = process.env, a
17815
17822
  }), "guardFor");
17816
17823
  var journalFailure = /* @__PURE__ */ __name((error) => error?.code ?? (error instanceof Error ? error.name : "error"), "journalFailure");
17817
17824
 
17818
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/messenger/lacks.js
17825
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/cli/messenger/lacks.js
17819
17826
  var COMMAND_NEEDS = {
17820
17827
  "account update": ["updateProfile", "change the profile"],
17821
17828
  "account sessions list": ["sessions", "list the account's sessions"],
@@ -17865,7 +17872,7 @@ var hideNever = /* @__PURE__ */ __name((messenger, group) => {
17865
17872
  return group;
17866
17873
  }, "hideNever");
17867
17874
 
17868
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/members-audit.js
17875
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/members-audit.js
17869
17876
  var AUDIT_PAGE = 200;
17870
17877
  var AUDIT_BUDGET = 10;
17871
17878
  var AUDIT_PAUSE_MS = 1e3;
@@ -17945,7 +17952,36 @@ var burstJoins = /* @__PURE__ */ __name((members) => {
17945
17952
  return found;
17946
17953
  }, "burstJoins");
17947
17954
 
17948
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/cli/management.js
17955
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/moment.js
17956
+ var read = /* @__PURE__ */ __name((reference, flag, now, at) => {
17957
+ const found = readMoment(reference, flag, { ...at, now });
17958
+ if (found === void 0)
17959
+ throw new CliError("validation_error", `${flag} takes an ISO 8601 time, today, yesterday, or 30m, 2h, 1d ago \u2014 not "${reference.trim()}"`);
17960
+ return found;
17961
+ }, "read");
17962
+ var momentOf = /* @__PURE__ */ __name((reference, flag = "--since", now = Date.now(), at = {}) => read(reference, flag, now, at).time, "momentOf");
17963
+ var dateWindow = /* @__PURE__ */ __name(({ sinceTime, untilTime, zone, now = Date.now(), names: names2 = ["--since-time", "--until-time"] }) => {
17964
+ const at = zone === void 0 ? {} : { zone };
17965
+ const lower = sinceTime === void 0 ? void 0 : read(sinceTime, names2[0], now, at);
17966
+ const upper = untilTime === void 0 ? void 0 : read(untilTime, names2[1], now, { ...at, end: true });
17967
+ const since = lower?.time;
17968
+ const until = upper?.time;
17969
+ const readInZone = lower?.local === true || upper?.local === true;
17970
+ const window3 = {
17971
+ ...since === void 0 ? {} : { since: new Date(since).toISOString() },
17972
+ ...until === void 0 ? {} : { until: new Date(until).toISOString() }
17973
+ };
17974
+ return {
17975
+ ...since === void 0 ? {} : { since },
17976
+ ...until === void 0 ? {} : { until },
17977
+ meta: {
17978
+ ...readInZone ? { timezone: timezoneOf(zone) } : {},
17979
+ ...since === void 0 && until === void 0 ? {} : { window: window3 }
17980
+ }
17981
+ };
17982
+ }, "dateWindow");
17983
+
17984
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/cli/management.js
17949
17985
  var REMOTE_READ = { remote: "read", local: "read" };
17950
17986
  var REMOTE_WRITE = { remote: "write", local: "write" };
17951
17987
  var minutes = /* @__PURE__ */ __name((text2) => {
@@ -18020,7 +18056,7 @@ var addMeetingManagementCommands = /* @__PURE__ */ __name((group, deps) => {
18020
18056
  }).description("the invitation text the service writes for a meeting"))).action(async (id2, _flags, command) => inRun(command, async () => print({ item: { ...await management.invitation(id2), untrusted: ["invitation"] } }, command)));
18021
18057
  }, "addMeetingManagementCommands");
18022
18058
 
18023
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/cli/query-options.js
18059
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/cli/query-options.js
18024
18060
  var queryWordsAfterOptions = /* @__PURE__ */ __name((command) => {
18025
18061
  command.allowUnknownOption();
18026
18062
  const parse2 = command.parseOptions.bind(command);
@@ -18040,7 +18076,7 @@ var queryWordsAfterOptions = /* @__PURE__ */ __name((command) => {
18040
18076
  return command;
18041
18077
  }, "queryWordsAfterOptions");
18042
18078
 
18043
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/cli/passage.js
18079
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/cli/passage.js
18044
18080
  var count = /* @__PURE__ */ __name((value) => {
18045
18081
  if (!/^(0|[1-9]\d*)$/.test(value) || !Number.isSafeInteger(Number(value)))
18046
18082
  throw new CliError("validation_error", "expected a nonnegative safe integer");
@@ -18082,7 +18118,7 @@ var addMeetingPassageCommandDefinition = /* @__PURE__ */ __name((program, deps)
18082
18118
  var createMeetingPassageCommand = sharedCommand(createMeetingPassageCommandDefinition);
18083
18119
  var addMeetingPassageCommand = sharedCommand(addMeetingPassageCommandDefinition);
18084
18120
 
18085
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/cli/project-evidence.js
18121
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/cli/project-evidence.js
18086
18122
  var integer2 = /* @__PURE__ */ __name((value) => {
18087
18123
  if (!/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
18088
18124
  throw new CliError("validation_error", "expected a positive safe integer");
@@ -18105,24 +18141,12 @@ ${fieldsHelp(MEETING_PROJECT_EVIDENCE_QUERY)}`).option("--limit <n>", "hits in o
18105
18141
  }, "addMeetingProjectEvidenceCommandDefinition");
18106
18142
  var addMeetingProjectEvidenceCommand = sharedCommand(addMeetingProjectEvidenceCommandDefinition);
18107
18143
 
18108
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/cli/search.js
18109
- var ZONED = /(?:Z|[+-]\d{2}:?\d{2})$/i;
18110
- var AGO = /^(\d+)(m|h|d)$/;
18111
- var AGO_MS = { m: 6e4, h: 36e5, d: 864e5 };
18144
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/cli/search.js
18112
18145
  var moment = /* @__PURE__ */ __name((flag, end, readIn) => (value) => {
18113
- const [, amount, unit] = AGO.exec(value.trim()) ?? [];
18114
- if (amount && unit)
18115
- return Date.now() - Number(amount) * (AGO_MS[unit] ?? 0);
18116
- const zone = timezoneOf();
18117
- let time;
18118
- try {
18119
- time = zonedMoment(value, zone, { start: 0, end: value.length }, { end });
18120
- } catch {
18121
- throw new CliError("validation_error", `${flag} takes an ISO date, a time with or without an offset, or 30m, 2h, 7d ago`);
18122
- }
18123
- if (!ZONED.test(value.trim()))
18124
- readIn(zone);
18125
- return time;
18146
+ const { since, until, meta } = dateWindow(end ? { untilTime: value, names: [flag, flag] } : { sinceTime: value, names: [flag, flag] });
18147
+ if (meta.timezone)
18148
+ readIn(meta.timezone);
18149
+ return end ? until : since;
18126
18150
  }, "moment");
18127
18151
  var integer3 = /* @__PURE__ */ __name((value) => {
18128
18152
  if (!/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
@@ -18136,7 +18160,7 @@ var createMeetingSearchCommandDefinition = /* @__PURE__ */ __name((program) => {
18136
18160
  program.addCommand(search);
18137
18161
  }
18138
18162
  const readIn = /* @__PURE__ */ __name((zone) => command.setOptionValue("timesReadIn", zone), "readIn");
18139
- const command = search.command("meetings").description("find words in stored meetings, indexing new ones first").argument("<query>", 'words, OR, (groups), -word, "a phrase", "a b"~N (within N lines), exact:word, from:"Name" (who said the line); date>=30d, project:, tag:, topic: choose meetings; a word also matches its other forms and spellings speech recognition garbled').option("--meeting-id <id>", "only this stored meeting", integer3).option("--identity-id <id>", "meetings with this participant identity; does not say who spoke a hit", integer3).option("--person-id <id>", "meetings with a participant linked to this person", integer3).option("--event-id <id>", "only meetings linked to this stored event", integer3).option("--series-id <id>", "only meetings in this stored series", integer3).option("--project <project>", "meetings confirmed in this project, by name, key or alias").option("--tag <name>", "meetings with this tag, by name or alias").option("--topic-name <name>", "meetings with this topic, by name or alias").option("--since-time <time>", "meetings starting at or after this ISO 8601 date or time, or 30m, 2h, 7d ago", moment("--since-time", false, readIn)).option("--until-time <time>", "meetings starting at or before this ISO 8601 date or time; a date alone covers that whole local day", moment("--until-time", true, readIn)).option("--limit <n>", "how many hits, 1 through 1000 (default 100)", integer3).option("--cursor <cursor>", "continue from the previous page's page.next_cursor, with the same query and filters").option("--max-read-bytes <bytes>", "most stored bytes to read, 1 through 67108864 (default 4194304)", integer3);
18163
+ const command = search.command("meetings").description("find words in stored meetings, indexing new ones first").argument("<query>", 'words, OR, (groups), -word, "a phrase", "a b"~N (within N lines), exact:word, from:"Name" (who said the line); date>=30d, project:, tag:, topic: choose meetings; a word also matches its other forms and spellings speech recognition garbled').option("--meeting-id <id>", "only this stored meeting", integer3).option("--identity-id <id>", "meetings with this participant identity; does not say who spoke a hit", integer3).option("--person-id <id>", "meetings with a participant linked to this person", integer3).option("--event-id <id>", "only meetings linked to this stored event", integer3).option("--series-id <id>", "only meetings in this stored series", integer3).option("--project <project>", "meetings confirmed in this project, by name, key or alias").option("--tag <name>", "meetings with this tag, by name or alias").option("--topic-name <name>", "meetings with this topic, by name or alias").option("--since-time <time>", "meetings starting at or after this ISO 8601 date or time, or 30m, 2h, 7d ago", moment("--since-time", false, readIn)).option("--until-time <time>", "meetings starting at or before this ISO 8601 date or time; a date alone covers that whole local day", moment("--until-time", true, readIn)).option("--limit <n>", "how many hits, 1 through 1000; the profile's defaults.limit when absent", integer3).option("--cursor <cursor>", "continue from the previous page's page.next_cursor, with the same query and filters").option("--max-read-bytes <bytes>", "most stored bytes to read, 1 through 67108864 (default 4194304)", integer3);
18140
18164
  annotate(command, {
18141
18165
  origin: "handwritten",
18142
18166
  effects: { remote: "none", local: "read" },
@@ -18144,7 +18168,7 @@ var createMeetingSearchCommandDefinition = /* @__PURE__ */ __name((program) => {
18144
18168
  });
18145
18169
  return command;
18146
18170
  }, "createMeetingSearchCommandDefinition");
18147
- var meetingHitSearchRequest = /* @__PURE__ */ __name((query, options2, signal) => {
18171
+ var meetingHitSearchRequest = /* @__PURE__ */ __name((query, options2, limit, signal) => {
18148
18172
  const request = {
18149
18173
  meetingId: options2.meetingId,
18150
18174
  participantIdentityId: options2.identityId,
@@ -18156,7 +18180,7 @@ var meetingHitSearchRequest = /* @__PURE__ */ __name((query, options2, signal) =
18156
18180
  topic: options2.topicName ?? options2.topic,
18157
18181
  since: options2.sinceTime,
18158
18182
  until: options2.untilTime,
18159
- limit: options2.limit,
18183
+ limit: options2.limit ?? limit,
18160
18184
  after: options2.cursor,
18161
18185
  maxReadBytes: options2.maxReadBytes,
18162
18186
  signal
@@ -18189,14 +18213,14 @@ var meetingSearchMeta = /* @__PURE__ */ __name((options2) => {
18189
18213
  ...Object.keys(window3).length === 0 ? {} : { window: window3 }
18190
18214
  };
18191
18215
  }, "meetingSearchMeta");
18192
- var addMeetingSearchCommandDefinition = /* @__PURE__ */ __name((program, deps) => createMeetingSearchCommand(program).action(async (query, options2) => {
18193
- const request = meetingHitSearchRequest(query, options2, deps.signal());
18194
- deps.output(meetingHitsList(await deps.search(query, request, options2), request.limit ?? 100, "search meetings", meetingSearchArguments(query, options2), meetingSearchMeta(options2)));
18216
+ var addMeetingSearchCommandDefinition = /* @__PURE__ */ __name((program, deps) => createMeetingSearchCommand(program).action(async (query, options2, command) => {
18217
+ const request = meetingHitSearchRequest(query, options2, deps.pagingOf(command).limit, deps.signal());
18218
+ deps.output(meetingHitsList(await deps.search(query, request, options2), request.limit, "search meetings", meetingSearchArguments(query, options2), meetingSearchMeta(options2)));
18195
18219
  }), "addMeetingSearchCommandDefinition");
18196
18220
  var createMeetingSearchCommand = sharedCommand(createMeetingSearchCommandDefinition);
18197
18221
  var addMeetingSearchCommand = sharedCommand(addMeetingSearchCommandDefinition);
18198
18222
 
18199
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/cli/index.js
18223
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/cli/index.js
18200
18224
  var integer4 = /* @__PURE__ */ __name((text2) => {
18201
18225
  if (!/^[1-9]\d*$/.test(text2) || !Number.isSafeInteger(Number(text2)))
18202
18226
  throw new InvalidArgumentError("expected a positive integer");
@@ -18207,13 +18231,6 @@ var lookbackDays = /* @__PURE__ */ __name((text2) => {
18207
18231
  throw new InvalidArgumentError("expected an integer from 0 through 31 days");
18208
18232
  return Number(text2);
18209
18233
  }, "lookbackDays");
18210
- var date = /* @__PURE__ */ __name((text2) => {
18211
- try {
18212
- return zonedMoment(text2, timezoneOf(), { start: 0, end: text2.length });
18213
- } catch {
18214
- throw new InvalidArgumentError("expected an ISO date, or a time with or without an offset");
18215
- }
18216
- }, "date");
18217
18234
  var LOCAL_READ = { remote: "none", local: "read" };
18218
18235
  var REMOTE_READ2 = { remote: "read", local: "read" };
18219
18236
  var backendOf = /* @__PURE__ */ __name((value) => {
@@ -18229,11 +18246,7 @@ var addMeetingCommandsDefinition = /* @__PURE__ */ __name((program, deps) => {
18229
18246
  const group = annotate(program.command("meetings").description("stored meetings and their records"), {
18230
18247
  effects: { remote: "none", local: "none" }
18231
18248
  });
18232
- const output = /* @__PURE__ */ __name((command) => command.option("--json", "one JSON value").option("--jsonl", "one JSON object per item").hook("preAction", (cmd) => {
18233
- const opts = cmd.optsWithGlobals();
18234
- if (opts.json && opts.jsonl)
18235
- throw new MeetingError("validation_error", "choose --json or --jsonl");
18236
- }), "output");
18249
+ const output = /* @__PURE__ */ __name((command) => command, "output");
18237
18250
  const print = /* @__PURE__ */ __name((value, command) => {
18238
18251
  const opts = command.optsWithGlobals();
18239
18252
  deps.write(value, opts.json ? "json" : opts.jsonl ? "jsonl" : "text");
@@ -18253,13 +18266,14 @@ ${BACKEND_HELP}`);
18253
18266
  query: defineQuery(MEETING_QUERY),
18254
18267
  output: { entity: "meeting" }
18255
18268
  });
18256
- backendOption(output(list2)).option("--limit <n>", "meetings per page", integer4, 100).option("--page <n>", "page number", integer4, 1).action(async (words3, opts, command) => {
18269
+ backendOption(output(list2)).option("--limit <n>", "meetings per page; the profile's defaults.limit when absent", integer4).option("--page <n>", "which page, starting at 1", integer4).action(async (words3, opts, command) => {
18257
18270
  const query = meetingsQuery(words3.join(" "));
18271
+ const { limit, page } = deps.pagingOf(command);
18258
18272
  await deps.inRun(command, async () => {
18259
18273
  const { server: _server, ...answer } = await meetingsListThrough(deps.source, deps.store, {
18260
18274
  accountId: deps.accountId,
18261
- limit: opts.limit,
18262
- offset: (opts.page - 1) * opts.limit,
18275
+ limit,
18276
+ offset: (page - 1) * limit,
18263
18277
  ...query ? { query } : {}
18264
18278
  }, access(command, opts.backend));
18265
18279
  print(answer, command);
@@ -18320,7 +18334,7 @@ ${BACKEND_HELP}`))).action(async (meeting, opts, command) => {
18320
18334
  output: { entity: "meeting_ingestion" },
18321
18335
  // Only a sync that stops itself at its budget may outlive the one-shot deadline.
18322
18336
  ...deps.budgetOf ? { cooperative: true, partial: true } : {}
18323
- }).description("bring the stored meetings up to date from the connected account, oldest first; a run that stops before its deadline keeps what it saved and the next one goes on from there")).option("--since-time <time>", "fetch meetings starting at or after this ISO 8601 date or time", date).option("--lookback-days <days>", "revisit recent occurrences for late transcripts (0\u201331)", lookbackDays).option("--rescan", "read the last 30 days again, not only what came after the last sync").action(async (opts, command) => {
18337
+ }).description("bring the stored meetings up to date from the connected account, oldest first; a run that stops before its deadline keeps what it saved and the next one goes on from there")).option("--since-time <time>", "fetch meetings starting at or after this ISO 8601 date or time, or 30m, 2h, 7d ago", (text2) => dateWindow({ sinceTime: text2, ...deps.timezone ? { zone: deps.timezone } : {}, now: deps.now?.() }).since).option("--lookback-days <days>", "revisit recent occurrences for late transcripts (0\u201331)", lookbackDays).option("--rescan", "read the last 30 days again, not only what came after the last sync").action(async (opts, command) => {
18324
18338
  const source = deps.source;
18325
18339
  if (!source)
18326
18340
  throw new MeetingError("configuration_error", "meeting source is unavailable");
@@ -18385,7 +18399,7 @@ ${fieldsHelp(EVENT_QUERY, MEETING_QUERY_GUIDE)}`);
18385
18399
  }, "addMeetingCommandsDefinition");
18386
18400
  var addMeetingCommands = sharedCommand(addMeetingCommandsDefinition);
18387
18401
 
18388
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/list-query.js
18402
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/cli/list-query.js
18389
18403
  var LIST_QUERY_GUIDE = "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md";
18390
18404
  var QUERY_ARGUMENT = "field:value terms that narrow the list \u2014 the fields are below";
18391
18405
  var withQuery = /* @__PURE__ */ __name((command, registry) => {
@@ -18405,9 +18419,9 @@ var unfilteredQuery = /* @__PURE__ */ __name((entity, schema2) => ({
18405
18419
  }), "unfilteredQuery");
18406
18420
  var withTomorrow = /* @__PURE__ */ __name((query, registry, zone = timezoneOf(), now = Date.now()) => {
18407
18421
  const times = new Set(registry.fields.filter(({ type }) => type === "time").map(({ name }) => name));
18408
- const date2 = /* @__PURE__ */ new Date(`${new Intl.DateTimeFormat("en-CA", { timeZone: zone }).format(now)}T00:00:00Z`);
18409
- date2.setUTCDate(date2.getUTCDate() + 1);
18410
- const tomorrow = date2.toISOString().slice(0, 10);
18422
+ const date = /* @__PURE__ */ new Date(`${new Intl.DateTimeFormat("en-CA", { timeZone: zone }).format(now)}T00:00:00Z`);
18423
+ date.setUTCDate(date.getUTCDate() + 1);
18424
+ const tomorrow = date.toISOString().slice(0, 10);
18411
18425
  const day2 = /* @__PURE__ */ __name((value) => value.toLowerCase() === "tomorrow" ? tomorrow : value, "day");
18412
18426
  const map = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? times.has(node.field) ? { ...node, value: day2(node.value), ...node.upper === void 0 ? {} : { upper: day2(node.upper) } } : node : { ...node, clauses: node.clauses.map((clause) => ({ ...clause, node: map(clause.node) })) }, "map");
18413
18427
  return { ...query, root: map(query.root) };
@@ -18519,16 +18533,34 @@ var termField = /* @__PURE__ */ __name((name, type, example, more = {}) => nativ
18519
18533
  var queryHelp = /* @__PURE__ */ __name((registry) => `
18520
18534
  ${fieldsHelp(registry, LIST_QUERY_GUIDE)}`, "queryHelp");
18521
18535
 
18522
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/paging.js
18536
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/cli/paging.js
18523
18537
  var positiveCount = /* @__PURE__ */ __name((flag) => (value) => {
18524
18538
  if (!/^\d+$/.test(value.trim()) || Number(value) < 1)
18525
18539
  throw new CliError("validation_error", `${flag} takes a whole number from 1 upwards, not "${value}"`);
18526
18540
  return Number(value);
18527
18541
  }, "positiveCount");
18542
+ var configuredLimit = /* @__PURE__ */ __name((command, most = Number.POSITIVE_INFINITY) => {
18543
+ const { resolveSettings, env } = environmentOf(command);
18544
+ const { limit: _typed, ...flags } = command.optsWithGlobals();
18545
+ const configured = resolveSettings?.(flags, { needsProfile: false, ...env ? { env } : {} }).limit ?? DEFAULT_CONFIG.defaults.limit;
18546
+ return Math.min(configured, most);
18547
+ }, "configuredLimit");
18528
18548
  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");
18529
18549
  var window = /* @__PURE__ */ __name(({ limit, page, all }) => all ? { offset: 0 } : { limit, offset: (page - 1) * limit }, "window");
18550
+ var pagingOf = /* @__PURE__ */ __name((command) => {
18551
+ const environment = environmentOf(command);
18552
+ const flags = command.optsWithGlobals();
18553
+ if (!environment.resolveSettings)
18554
+ return { limit: flags.limit ?? DEFAULT_CONFIG.defaults.limit, page: flags.page ?? 1 };
18555
+ const { limit, page } = environment.resolveSettings(withAgentLevels(command, command.optsWithGlobals()), {
18556
+ env: environment.env ?? process.env,
18557
+ needsProfile: false,
18558
+ readOnly: true
18559
+ });
18560
+ return { limit: limit ?? DEFAULT_CONFIG.defaults.limit, page: page ?? 1 };
18561
+ }, "pagingOf");
18530
18562
 
18531
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/messenger/chat-answers.js
18563
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/cli/messenger/chat-answers.js
18532
18564
  var defined = /* @__PURE__ */ __name((record2) => Object.fromEntries(Object.entries(record2).filter(([, value]) => value !== void 0)), "defined");
18533
18565
  var chatRef = /* @__PURE__ */ __name((account, chat) => formatReference({ type: "chat", provider: account.provider, account: account.account, chat }), "chatRef");
18534
18566
  var settingsOf = /* @__PURE__ */ __name((settings) => defined({
@@ -18790,7 +18822,7 @@ var sessionAnswer = /* @__PURE__ */ __name(({ current, client, device, location,
18790
18822
  ...createdAt === void 0 ? {} : { created_at: createdAt }
18791
18823
  }), "sessionAnswer");
18792
18824
 
18793
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/deps.js
18825
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/deps.js
18794
18826
  var accountStore = /* @__PURE__ */ __name(async (deps) => (await deps.store()).forAccount(await deps.account()), "accountStore");
18795
18827
  var crossAccount = /* @__PURE__ */ __name((deps, _reason) => deps.store(), "crossAccount");
18796
18828
  var NO_LOCAL_STORE = "this answer comes from the messenger, not from the local store";
@@ -18852,7 +18884,7 @@ var storedDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({
18852
18884
  }), "storedDeps");
18853
18885
  var storeModeDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({ ...storedDeps(messenger, store, account, guard), offline: false, reads: "store" }), "storeModeDeps");
18854
18886
 
18855
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/ports/messenger.js
18887
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/ports/messenger.js
18856
18888
  var throughWrapper = /* @__PURE__ */ __name((inner, handled, wrap = (_, call) => call) => new Proxy(handled, {
18857
18889
  get: /* @__PURE__ */ __name((own, key) => {
18858
18890
  if (key in own)
@@ -18869,14 +18901,14 @@ var capability = /* @__PURE__ */ __name((adapter, method, what) => {
18869
18901
  return found.bind(adapter);
18870
18902
  }, "capability");
18871
18903
 
18872
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/sends/send-id.js
18904
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/sends/send-id.js
18873
18905
  import { randomBytes } from "node:crypto";
18874
18906
  var newSendId = /* @__PURE__ */ __name(() => randomBytes(8).readBigInt64BE().toString(), "newSendId");
18875
18907
  var newOperationId = newSendId;
18876
18908
 
18877
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/questions.js
18909
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/questions.js
18878
18910
  var LINKS = /https?:\/\/\S+/g;
18879
- 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");
18911
+ var unanswered = /* @__PURE__ */ __name((messages, { answerers: answerers2, before }) => questions(messages, { answerers: answerers2 }).filter(({ question, answer }) => answer === void 0 && Date.parse(question.timestamp) < before).map(({ question }) => question), "unanswered");
18880
18912
  var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2, asker = "others" }) => {
18881
18913
  const fromOwner2 = /* @__PURE__ */ __name((message) => message.outgoing === true, "fromOwner");
18882
18914
  const answers = asker === "owner" ? (message) => !fromOwner2(message) : (message) => fromOwner2(message) || message.senderId !== null && answerers2.has(message.senderId);
@@ -18904,7 +18936,7 @@ var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2, asker
18904
18936
  });
18905
18937
  }, "questions");
18906
18938
 
18907
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/task-categories.js
18939
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/task-categories.js
18908
18940
  var names = /* @__PURE__ */ __name((categories) => categories.map(({ name }) => name).join(", "), "names");
18909
18941
  var taskCategoryOf = /* @__PURE__ */ __name((categories = DEFAULT_TASK_CATEGORIES, flag = "--category") => (typed) => {
18910
18942
  const name = typed.trim().toLowerCase();
@@ -18961,7 +18993,7 @@ var categorize = /* @__PURE__ */ __name((text2, categories = DEFAULT_TASK_CATEGO
18961
18993
  return best.name;
18962
18994
  }, "categorize");
18963
18995
 
18964
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/task-rules.js
18996
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/task-rules.js
18965
18997
  var taskAccount = /* @__PURE__ */ __name(({ provider, account }) => `${provider}:${account}`, "taskAccount");
18966
18998
  var RULES_IN = {
18967
18999
  dialog: "all",
@@ -19167,47 +19199,7 @@ var applyTaskRulesToChats = /* @__PURE__ */ __name(async (store, account, chatId
19167
19199
  return passes;
19168
19200
  }, "applyTaskRulesToChats");
19169
19201
 
19170
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/moment.js
19171
- var AGO2 = /^(\d+)(m|h|d)$/;
19172
- var AGO_MS2 = { m: 6e4, h: 36e5, d: 864e5 };
19173
- var DATE = /^\d{4}-\d{2}-\d{2}/;
19174
- var momentOf = /* @__PURE__ */ __name((reference, flag = "--since", now = Date.now(), at = {}) => {
19175
- const wanted = reference.trim();
19176
- const [, amount, unit] = AGO2.exec(wanted) ?? [];
19177
- const time = amount && unit ? now - Number(amount) * (AGO_MS2[unit] ?? 0) : DATE.test(wanted) ? calendarMoment(wanted, flag, at) : Number.NaN;
19178
- if (Number.isNaN(time)) {
19179
- throw new CliError("validation_error", `${flag} takes an ISO 8601 time or 30m, 2h, 1d ago \u2014 not "${wanted}"`);
19180
- }
19181
- return time;
19182
- }, "momentOf");
19183
- var aheadOf = /* @__PURE__ */ __name((reference, flag, now = Date.now(), at = {}) => {
19184
- const wanted = reference.trim();
19185
- const [, amount, unit] = AGO2.exec(wanted) ?? [];
19186
- const time = amount && unit ? now + Number(amount) * (AGO_MS2[unit] ?? 0) : DATE.test(wanted) ? calendarMoment(wanted, flag, at) : Number.NaN;
19187
- if (Number.isNaN(time)) {
19188
- throw new CliError("validation_error", `${flag} takes an ISO 8601 time or 30m, 2h, 3d from now \u2014 not "${wanted}"`);
19189
- }
19190
- return time;
19191
- }, "aheadOf");
19192
- var dateWindow = /* @__PURE__ */ __name(({ sinceTime, untilTime, zone, now = Date.now(), names: names2 = ["--since-time", "--until-time"] }) => {
19193
- const since = sinceTime === void 0 ? void 0 : momentOf(sinceTime, names2[0], now, { zone });
19194
- const until = untilTime === void 0 ? void 0 : momentOf(untilTime, names2[1], now, { zone, end: true });
19195
- const readInZone = [sinceTime, untilTime].some((value) => value !== void 0 && DATE.test(value.trim()) && !/(?:Z|[+-]\d{2}:?\d{2})$/i.test(value.trim()));
19196
- const window3 = {
19197
- ...since === void 0 ? {} : { since: new Date(since).toISOString() },
19198
- ...until === void 0 ? {} : { until: new Date(until).toISOString() }
19199
- };
19200
- return {
19201
- ...since === void 0 ? {} : { since },
19202
- ...until === void 0 ? {} : { until },
19203
- meta: {
19204
- ...readInZone ? { timezone: timezoneOf(zone) } : {},
19205
- ...since === void 0 && until === void 0 ? {} : { window: window3 }
19206
- }
19207
- };
19208
- }, "dateWindow");
19209
-
19210
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/patience.js
19202
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/patience.js
19211
19203
  import { setTimeout as sleep } from "node:timers/promises";
19212
19204
  var LONGEST_WAIT_MS = 5 * 60 * 1e3;
19213
19205
  var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
@@ -19230,10 +19222,10 @@ var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
19230
19222
  }
19231
19223
  }, "patiently");
19232
19224
 
19233
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/archive.js
19225
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/archive.js
19234
19226
  import { setTimeout as sleep2 } from "node:timers/promises";
19235
19227
 
19236
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/backfill-estimate.js
19228
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/backfill-estimate.js
19237
19229
  var REQUEST_MS = 400;
19238
19230
  var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, maxPages, pauseMs }) => {
19239
19231
  const lowest = ranges[0];
@@ -19256,13 +19248,13 @@ var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, max
19256
19248
  };
19257
19249
  }, "estimateBackfill");
19258
19250
 
19259
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/recovery.js
19251
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/recovery.js
19260
19252
  var withRecovery = /* @__PURE__ */ __name((error) => ({
19261
19253
  ...error,
19262
19254
  retryable: typeof error.retryable === "boolean" ? error.retryable : error.code === "rate_limited" || error.status === 429
19263
19255
  }), "withRecovery");
19264
19256
 
19265
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/batch.js
19257
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/batch.js
19266
19258
  var actionable = /* @__PURE__ */ __name((error) => {
19267
19259
  if (isCliFailure(error))
19268
19260
  return withRecovery({ code: error.code, message: error.message, ...error.details });
@@ -19345,7 +19337,7 @@ var mergeBatches = /* @__PURE__ */ __name((a, b) => {
19345
19337
  };
19346
19338
  }, "mergeBatches");
19347
19339
 
19348
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/search/groups.js
19340
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/search/groups.js
19349
19341
  var ALL = "all";
19350
19342
  var OWNER_NOTES = { provider: "notes", account: INTERNAL_NOTES };
19351
19343
  var NOT_GROUP_NAMES = /* @__PURE__ */ new Set([ALL, "bots"]);
@@ -19417,7 +19409,7 @@ var groupEntries = /* @__PURE__ */ __name((saved) => ({
19417
19409
  [ALL]: [ALL]
19418
19410
  }), "groupEntries");
19419
19411
 
19420
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/search-kind.js
19412
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/search-kind.js
19421
19413
  var NO_MAIL = "no_mail";
19422
19414
  var MAIL = "email";
19423
19415
  var groupLockOf = /* @__PURE__ */ __name((app, env) => {
@@ -19491,7 +19483,7 @@ var accountsOfKind = /* @__PURE__ */ __name((kind, chosen, held, explicit, comma
19491
19483
  return chosenMail.map(({ provider, account }) => ({ provider, account }));
19492
19484
  }, "accountsOfKind");
19493
19485
 
19494
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/message-resolution.js
19486
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/message-resolution.js
19495
19487
  var readChatId = /* @__PURE__ */ __name(async (deps, reference, store, account) => {
19496
19488
  if (deps.reads !== "store")
19497
19489
  return keptChatId(deps.messenger, reference, store, account);
@@ -19692,14 +19684,14 @@ var chatsMatchingIn = /* @__PURE__ */ __name(async (store, accounts, pattern) =>
19692
19684
  }, "chatsMatchingIn");
19693
19685
  var isText = /* @__PURE__ */ __name((value) => typeof value === "string" && value !== "", "isText");
19694
19686
 
19695
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/images/context/index.js
19687
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/images/context/index.js
19696
19688
  var CONTEXT_MESSAGES = 3;
19697
19689
  var CONTEXT_MINUTES = 10;
19698
19690
  var MAX_CHARS = 1200;
19699
19691
  var line = /* @__PURE__ */ __name(({ sender, text: text2 }) => sender ? `${sender}: ${text2.trim()}` : text2.trim(), "line");
19700
19692
  var near = /* @__PURE__ */ __name((messages, sentAt) => messages.filter(({ text: text2, sentAt: at }) => text2.trim() && Math.abs(at - sentAt) <= CONTEXT_MINUTES * 6e4).slice(0, CONTEXT_MESSAGES), "near");
19701
- var contextText = /* @__PURE__ */ __name(({ chatTitle: chatTitle2, sender, caption, sentAt, before: before2, after }) => {
19702
- const earlier = near(before2, sentAt).reverse();
19693
+ var contextText = /* @__PURE__ */ __name(({ chatTitle: chatTitle2, sender, caption, sentAt, before, after }) => {
19694
+ const earlier = near(before, sentAt).reverse();
19703
19695
  const later = near(after, sentAt);
19704
19696
  if (!caption.trim() && earlier.length === 0 && later.length === 0)
19705
19697
  return void 0;
@@ -19716,12 +19708,12 @@ var context = {
19716
19708
  }, "describe")
19717
19709
  };
19718
19710
 
19719
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/images/registry.js
19711
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/images/registry.js
19720
19712
  var BUILT_INS = [context];
19721
19713
  var providers = [...BUILT_INS];
19722
19714
  var registeredImageProviders = /* @__PURE__ */ __name(() => providers, "registeredImageProviders");
19723
19715
 
19724
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/conversations.js
19716
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/conversations.js
19725
19717
  var READ_PAGE = 5e3;
19726
19718
  var CHAIN = 50;
19727
19719
  var CONVERSATION_QUERY = {
@@ -19802,7 +19794,7 @@ var conversationsService = /* @__PURE__ */ __name((deps) => {
19802
19794
  const { store, chatId } = await found(chat);
19803
19795
  if (!(await store.conversations.conversationState(chatId))?.builtAt)
19804
19796
  throw notBuilt(chatId);
19805
- const where = query ? queryFilter(query, CONVERSATION_COLUMNS, { command: "conversations list" }) : void 0;
19797
+ const where = query ? queryFilter(query, CONVERSATION_COLUMNS, { command: "conversations list", zone: timezoneOf() }) : void 0;
19806
19798
  const page = await store.conversations.conversations(chatId, { limit, offset, ...where ? { where } : {} });
19807
19799
  const account = await deps.account();
19808
19800
  return { items: page.items.map((one) => conversationItem(account, one)), hasMore: page.hasMore };
@@ -19873,7 +19865,7 @@ var sized = /* @__PURE__ */ __name((size2) => {
19873
19865
  return size2;
19874
19866
  }, "sized");
19875
19867
 
19876
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/embeddings-maintenance.js
19868
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/embeddings-maintenance.js
19877
19869
  var REFRESH_BOUNDS = { maxChats: 20, maxChunks: 2e3 };
19878
19870
  var MESSAGE_PAGE = 5e3;
19879
19871
  var PER_SESSION = 8;
@@ -19892,7 +19884,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = chosenTextModel(dep
19892
19884
  price: remote.price,
19893
19885
  installed: true,
19894
19886
  perBatch: PER_REQUEST * concurrency,
19895
- open: /* @__PURE__ */ __name(async () => (await import("./remote-RGJXO7XK.js")).openRemote(remote, apiKey, {
19887
+ open: /* @__PURE__ */ __name(async () => (await import("./remote-UYTNWNOB.js")).openRemote(remote, apiKey, {
19896
19888
  concurrency,
19897
19889
  env: deps.env ?? process.env
19898
19890
  }), "open")
@@ -19912,7 +19904,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = chosenTextModel(dep
19912
19904
  if (!isTextModelInstalled(model, directory2))
19913
19905
  throw notDownloaded(model.id);
19914
19906
  if (apart) {
19915
- const { openProcess } = await import("./process-6Q23D3TO.js");
19907
+ const { openProcess } = await import("./process-67DAKAAQ.js");
19916
19908
  return openProcess(model, directory2, { threads: threads ?? defaultThreads() });
19917
19909
  }
19918
19910
  return openEmbedder(model, directory2, { threads: threads ?? defaultThreads() });
@@ -20201,7 +20193,7 @@ var shaped = /* @__PURE__ */ __name(({ chatId, builtAt, algorithmVersion, pendin
20201
20193
  return { ...one, state };
20202
20194
  }, "shaped");
20203
20195
 
20204
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/search-catchup.js
20196
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/search-catchup.js
20205
20197
  var CATCH_UP_BOUNDS = { maxChunks: 500, maxMessages: 1e4, timeMs: 3e4 };
20206
20198
  var validateCatchUpBounds = /* @__PURE__ */ __name((options2) => {
20207
20199
  for (const [key, value, maximum] of [
@@ -20254,7 +20246,7 @@ var catchUpSearch = /* @__PURE__ */ __name(async (deps, chat, options2, signal,
20254
20246
  }
20255
20247
  }, "catchUpSearch");
20256
20248
 
20257
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/archive.js
20249
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/archive.js
20258
20250
  var pushed = /* @__PURE__ */ __name((deps, what) => {
20259
20251
  if (deps.reads === "store") {
20260
20252
  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`);
@@ -20488,7 +20480,7 @@ var recordSkip = /* @__PURE__ */ __name(async (store, account, chatId, skip) =>
20488
20480
  const at = (/* @__PURE__ */ new Date()).toISOString();
20489
20481
  await store.chats.recordHistorySkips(account, /* @__PURE__ */ new Map([[chatId, { ...skip, messages: 0, oldestAt: at, newestAt: at, unread: true }]]));
20490
20482
  }, "recordSkip");
20491
- var abortable = /* @__PURE__ */ __name(async (read, signal) => {
20483
+ var abortable = /* @__PURE__ */ __name(async (read2, signal) => {
20492
20484
  signal.throwIfAborted();
20493
20485
  let listener = /* @__PURE__ */ __name(() => {
20494
20486
  }, "listener");
@@ -20497,7 +20489,7 @@ var abortable = /* @__PURE__ */ __name(async (read, signal) => {
20497
20489
  signal.addEventListener("abort", listener, { once: true });
20498
20490
  });
20499
20491
  try {
20500
- return await Promise.race([read(), interrupted]);
20492
+ return await Promise.race([read2(), interrupted]);
20501
20493
  } finally {
20502
20494
  signal.removeEventListener("abort", listener);
20503
20495
  }
@@ -20507,7 +20499,7 @@ var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetchin
20507
20499
  throw new CliError("validation_error", "invalid history window");
20508
20500
  const byTime = fetching.orderBy === "time";
20509
20501
  const keyed = keyOf2(fetching);
20510
- let before2 = window3 === void 0 ? void 0 : byTime ? new Date(window3.to + (fetching.beforeInclusive ? 0 : 1)).toISOString() : String(window3.to + 1);
20502
+ let before = window3 === void 0 ? void 0 : byTime ? new Date(window3.to + (fetching.beforeInclusive ? 0 : 1)).toISOString() : String(window3.to + 1);
20511
20503
  let requests = 0;
20512
20504
  let windowComplete = false;
20513
20505
  let chatId;
@@ -20525,8 +20517,8 @@ var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetchin
20525
20517
  page = await patiently(() => {
20526
20518
  requests += 1;
20527
20519
  onRequest?.();
20528
- const read = /* @__PURE__ */ __name(() => history({ limit: Math.min(pageSize, limit - fetched), ...before2 ? { before: before2 } : {} }), "read");
20529
- return window3 ? abortable(read, stop) : read();
20520
+ const read2 = /* @__PURE__ */ __name(() => history({ limit: Math.min(pageSize, limit - fetched), ...before ? { before } : {} }), "read");
20521
+ return window3 ? abortable(read2, stop) : read2();
20530
20522
  }, note, stop);
20531
20523
  } catch (error) {
20532
20524
  if (stop.aborted)
@@ -20563,7 +20555,7 @@ var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetchin
20563
20555
  onPage({ fetched, chatId, oldest: window3.from });
20564
20556
  break;
20565
20557
  }
20566
- if (window3 === void 0 && before2 === void 0)
20558
+ if (window3 === void 0 && before === void 0)
20567
20559
  await store.sync.setSyncState(account, fetchedKey(chatId), String(top));
20568
20560
  onPage({ fetched, chatId, oldest: held.from });
20569
20561
  idle = fresh === 0 ? idle + 1 : 0;
@@ -20585,7 +20577,7 @@ var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetchin
20585
20577
  break;
20586
20578
  }
20587
20579
  const boundary = window3 === void 0 ? held.from : low;
20588
- before2 = byTime ? new Date(boundary + (fresh > 0 && !(window3 && fetching.beforeInclusive) ? 1 : 0)).toISOString() : String(boundary);
20580
+ before = byTime ? new Date(boundary + (fresh > 0 && !(window3 && fetching.beforeInclusive) ? 1 : 0)).toISOString() : String(boundary);
20589
20581
  note(`${fetched} messages so far, back to ${fromAt.slice(0, 10)}`);
20590
20582
  const wait = fetching.jitter ? pauseMs * (1 + Math.random()) : pauseMs;
20591
20583
  await sleep2(wait, void 0, { signal: stop }).catch(() => {
@@ -20600,7 +20592,7 @@ var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetchin
20600
20592
  fetched,
20601
20593
  complete: reachedStart && ranges.length === 1,
20602
20594
  ranges,
20603
- ...issue ? { issue, resume: { ...before2 === void 0 ? {} : { before: before2 } } } : {},
20595
+ ...issue ? { issue, resume: { ...before === void 0 ? {} : { before } } } : {},
20604
20596
  ...window3 === void 0 ? {} : { windowComplete, requests },
20605
20597
  ...reachedSince ? { reachedSince: true } : {},
20606
20598
  ...reachedLast ? { reachedLast: true } : {},
@@ -20635,7 +20627,7 @@ var timeOfKey = /* @__PURE__ */ __name(async (store, account, chatId, key, byTim
20635
20627
  return message?.timestamp ?? fallback;
20636
20628
  }, "timeOfKey");
20637
20629
 
20638
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/botcheck/check.js
20630
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/botcheck/check.js
20639
20631
  var DAY_MS = 864e5;
20640
20632
  var NEW_DAYS = 30;
20641
20633
  var SAME_TEXT_MIN = 20;
@@ -20712,7 +20704,7 @@ var scorePerson = /* @__PURE__ */ __name(({ subject, provider, activity, photos,
20712
20704
  };
20713
20705
  }, "scorePerson");
20714
20706
 
20715
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/http/time-limit.js
20707
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/http/time-limit.js
20716
20708
  var timeLimit = /* @__PURE__ */ __name((ms) => {
20717
20709
  const controller = new AbortController();
20718
20710
  const timer = setTimeout(() => controller.abort(new DOMException("The operation timed out.", "TimeoutError")), ms);
@@ -20728,7 +20720,7 @@ var withTimeLimit = /* @__PURE__ */ __name(async (ms, run2) => {
20728
20720
  }
20729
20721
  }, "withTimeLimit");
20730
20722
 
20731
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/botcheck/registries.js
20723
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/botcheck/registries.js
20732
20724
  var REGISTRIES = {
20733
20725
  cas: { title: "Combot Anti-Spam (CAS)", docs: "https://cas.chat/api" },
20734
20726
  lols: { title: "lols.bot", docs: "https://api.lols.bot/lols-bot.json" }
@@ -20815,7 +20807,7 @@ var notCovered = /* @__PURE__ */ __name((messenger, now = /* @__PURE__ */ new Da
20815
20807
  detail: `lists Telegram accounts only, not ${messenger} ones`
20816
20808
  })), "notCovered");
20817
20809
 
20818
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/botcheck/service.js
20810
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/botcheck/service.js
20819
20811
  var ACTIVITY_MESSAGES = 1e3;
20820
20812
  var botCheckService = /* @__PURE__ */ __name((deps) => {
20821
20813
  const subjectOf = /* @__PURE__ */ __name(async (reference) => {
@@ -20903,7 +20895,7 @@ var botCheckService = /* @__PURE__ */ __name((deps) => {
20903
20895
  };
20904
20896
  }, "botCheckService");
20905
20897
 
20906
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/thread.js
20898
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/thread.js
20907
20899
  var threadIdOf = /* @__PURE__ */ __name((value) => {
20908
20900
  if (value === void 0)
20909
20901
  return void 0;
@@ -20913,7 +20905,7 @@ var threadIdOf = /* @__PURE__ */ __name((value) => {
20913
20905
  return id2;
20914
20906
  }, "threadIdOf");
20915
20907
 
20916
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/chat-stats.js
20908
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/chat-stats.js
20917
20909
  var TOP_POSTS = 5;
20918
20910
  var JOINS = /* @__PURE__ */ new Set(["join", "add"]);
20919
20911
  var LEAVES = /* @__PURE__ */ new Set(["leave", "remove"]);
@@ -20995,9 +20987,9 @@ var seriesOf = /* @__PURE__ */ __name((messages, events, by, timezone) => {
20995
20987
  const day2 = dayOf(Date.parse(timestamp));
20996
20988
  if (by === "day")
20997
20989
  return day2;
20998
- const date2 = /* @__PURE__ */ new Date(`${day2}T00:00:00Z`);
20999
- date2.setUTCDate(date2.getUTCDate() - (date2.getUTCDay() + 6) % 7);
21000
- return date2.toISOString().slice(0, 10);
20990
+ const date = /* @__PURE__ */ new Date(`${day2}T00:00:00Z`);
20991
+ date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 6) % 7);
20992
+ return date.toISOString().slice(0, 10);
21001
20993
  }, "keyOf");
21002
20994
  const rows = /* @__PURE__ */ new Map();
21003
20995
  const row = /* @__PURE__ */ __name((key) => {
@@ -21030,7 +21022,7 @@ var median = /* @__PURE__ */ __name((values) => {
21030
21022
  return Math.round(sorted.length % 2 === 0 ? ((sorted[middle - 1] ?? upper) + upper) / 2 : upper);
21031
21023
  }, "median");
21032
21024
 
21033
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/member-history.js
21025
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/member-history.js
21034
21026
  var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
21035
21027
  const events = [];
21036
21028
  for (const stay of stays) {
@@ -21046,9 +21038,9 @@ var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
21046
21038
  }
21047
21039
  const last = /* @__PURE__ */ new Map();
21048
21040
  for (const revision of revisions) {
21049
- const before2 = last.get(revision.id);
21041
+ const before = last.get(revision.id);
21050
21042
  last.set(revision.id, revision);
21051
- if (!before2)
21043
+ if (!before)
21052
21044
  continue;
21053
21045
  events.push({
21054
21046
  at: revision.capturedAt,
@@ -21056,13 +21048,13 @@ var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
21056
21048
  id: revision.id,
21057
21049
  name: revision.name,
21058
21050
  username: revision.username,
21059
- before: { name: before2.name, username: before2.username, marks: before2.marks }
21051
+ before: { name: before.name, username: before.username, marks: before.marks }
21060
21052
  });
21061
21053
  }
21062
21054
  return events.filter(({ at }) => Date.parse(at) >= since).sort((a, b) => Date.parse(a.at) - Date.parse(b.at) || a.id.localeCompare(b.id));
21063
21055
  }, "memberEvents");
21064
21056
 
21065
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/chats.js
21057
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/chats.js
21066
21058
  var EVENTS_DAYS = 7;
21067
21059
  var TRACKED_DAYS = 30;
21068
21060
  var STATS_PAGE = 1e3;
@@ -21098,7 +21090,7 @@ var deepChecks = /* @__PURE__ */ __name(async (deps, items, deep, pauseMs, regis
21098
21090
  var chatsService = /* @__PURE__ */ __name((deps) => ({
21099
21091
  list: /* @__PURE__ */ __name(async (window3, query) => {
21100
21092
  if (fromStore(deps)) {
21101
- const where = query ? queryFilter(query, CHAT_COLUMNS, { command: "chats list" }) : void 0;
21093
+ const where = query ? queryFilter(query, CHAT_COLUMNS, { command: "chats list", zone: timezoneOf() }) : void 0;
21102
21094
  return (await accountStore(deps)).chats.chats({ ...window3, ...where ? { where } : {} });
21103
21095
  }
21104
21096
  const [term] = query ? walkQuery(query.root) : [];
@@ -21197,10 +21189,10 @@ var chatsService = /* @__PURE__ */ __name((deps) => ({
21197
21189
  throw new CliError("validation_error", "`chats members check` reads the member list from the messenger; not with --offline");
21198
21190
  }
21199
21191
  const connection = await deps.connection();
21200
- const { chatId: id2, members: read, more, participants } = await readMembers(connection, chat, budget, pauseMs);
21192
+ const { chatId: id2, members: read2, more, participants } = await readMembers(connection, chat, budget, pauseMs);
21201
21193
  const held = await accountStoreIfOpen(deps);
21202
21194
  const stored = held ? await storedFacts(held, id2) : void 0;
21203
- const { items: judged, unknown: unknown3 } = auditMembers(read, {
21195
+ const { items: judged, unknown: unknown3 } = auditMembers(read2, {
21204
21196
  firstMessages: stored?.firstMessages,
21205
21197
  self: connection.self(),
21206
21198
  minScore
@@ -21208,7 +21200,7 @@ var chatsService = /* @__PURE__ */ __name((deps) => ({
21208
21200
  const items = deep > 0 ? await deepChecks(deps, judged, deep, pauseMs, registry) : judged;
21209
21201
  return {
21210
21202
  chatId: id2,
21211
- read: read.length,
21203
+ read: read2.length,
21212
21204
  participantsCount: participants ?? stored?.participantsCount ?? null,
21213
21205
  more,
21214
21206
  unknown: unknown3,
@@ -21222,11 +21214,11 @@ var chatsService = /* @__PURE__ */ __name((deps) => ({
21222
21214
  throw new CliError("validation_error", "`chats members fetch` reads the member list from the messenger; not with --offline");
21223
21215
  }
21224
21216
  const startedAt = (/* @__PURE__ */ new Date()).toISOString();
21225
- const read = await readMembers(await deps.connection(), chat, budget, pauseMs);
21217
+ const read2 = await readMembers(await deps.connection(), chat, budget, pauseMs);
21226
21218
  const observedAt = (/* @__PURE__ */ new Date()).toISOString();
21227
- const { chatId, members, more } = read;
21219
+ const { chatId, members, more } = read2;
21228
21220
  const store = await accountStore(deps);
21229
- const participants = read.participants ?? (await store.chats.chats({})).items.find(({ id: id2 }) => id2 === chatId)?.participantsCount ?? null;
21221
+ const participants = read2.participants ?? (await store.chats.chats({})).items.find(({ id: id2 }) => id2 === chatId)?.participantsCount ?? null;
21230
21222
  const complete = !more && participants !== null && members.length >= participants;
21231
21223
  const change = await store.roster.saveRoster(chatId, {
21232
21224
  members,
@@ -21240,7 +21232,7 @@ var chatsService = /* @__PURE__ */ __name((deps) => ({
21240
21232
  return { chatId, read: members.length, participants, complete, more, ...change, tracked };
21241
21233
  }, "fetchMembers"),
21242
21234
  tracked: /* @__PURE__ */ __name(async (query) => {
21243
- const where = query ? queryFilter(query, TRACKED_CHAT_COLUMNS, { command: "chats tracking list" }) : void 0;
21235
+ const where = query ? queryFilter(query, TRACKED_CHAT_COLUMNS, { command: "chats tracking list", zone: timezoneOf() }) : void 0;
21244
21236
  return (await accountStore(deps)).roster.trackedChats(where ? { where } : {});
21245
21237
  }, "tracked"),
21246
21238
  memberHistory: /* @__PURE__ */ __name(async (chat, { since }) => {
@@ -21306,16 +21298,16 @@ var storedFacts = /* @__PURE__ */ __name(async (store, chatId) => {
21306
21298
  const chat = (await store.chats.chats({})).items.find((one) => one.id === chatId);
21307
21299
  const [completeness] = await store.chats.chatCompleteness([chatId]);
21308
21300
  const firstMessages = /* @__PURE__ */ new Map();
21309
- let before2;
21301
+ let before;
21310
21302
  for (; ; ) {
21311
- const page = await store.messages.messages(chatId, { limit: STATS_PAGE, ...before2 ? { before: before2 } : {} });
21303
+ const page = await store.messages.messages(chatId, { limit: STATS_PAGE, ...before ? { before } : {} });
21312
21304
  for (const message of [...page.items].reverse())
21313
21305
  if (message.senderId)
21314
21306
  firstMessages.set(message.senderId, message);
21315
21307
  const oldest = page.items[0];
21316
21308
  if (!page.hasMore || !oldest)
21317
21309
  break;
21318
- before2 = oldest.id;
21310
+ before = oldest.id;
21319
21311
  }
21320
21312
  return {
21321
21313
  participantsCount: chat?.participantsCount ?? null,
@@ -21325,39 +21317,39 @@ var storedFacts = /* @__PURE__ */ __name(async (store, chatId) => {
21325
21317
  }, "storedFacts");
21326
21318
  var storedSince = /* @__PURE__ */ __name(async (store, chatId, since) => {
21327
21319
  const pages = [];
21328
- let before2;
21320
+ let before;
21329
21321
  for (; ; ) {
21330
- const page = await store.messages.messages(chatId, { limit: STATS_PAGE, since, ...before2 ? { before: before2 } : {} });
21322
+ const page = await store.messages.messages(chatId, { limit: STATS_PAGE, since, ...before ? { before } : {} });
21331
21323
  pages.unshift(page.items);
21332
21324
  const oldest = page.items[0];
21333
21325
  if (!page.hasMore || !oldest)
21334
21326
  return pages.flat();
21335
- before2 = oldest.id;
21327
+ before = oldest.id;
21336
21328
  }
21337
21329
  }, "storedSince");
21338
21330
  var readMembers = /* @__PURE__ */ __name(async (connection, chat, budget, pauseMs) => {
21339
21331
  const members = capability(connection, "members", "list a group's members");
21340
- const read = [];
21332
+ const read2 = [];
21341
21333
  let chatId;
21342
21334
  let participants = null;
21343
21335
  let more = true;
21344
21336
  for (let page = 0; page < budget && more; page++) {
21345
21337
  if (page > 0)
21346
21338
  await new Promise((resolve7) => setTimeout(resolve7, pauseMs));
21347
- const found = await members(chatId ?? chat, { limit: AUDIT_PAGE, offset: read.length });
21339
+ const found = await members(chatId ?? chat, { limit: AUDIT_PAGE, offset: read2.length });
21348
21340
  chatId = found.chatId;
21349
21341
  participants = found.participantsCount ?? participants;
21350
- read.push(...found.items);
21342
+ read2.push(...found.items);
21351
21343
  more = found.hasMore && found.items.length > 0;
21352
21344
  }
21353
- return { chatId: chatId ?? chat, members: read, more, participants };
21345
+ return { chatId: chatId ?? chat, members: read2, more, participants };
21354
21346
  }, "readMembers");
21355
21347
  var storedMembers = /* @__PURE__ */ __name(async (store, chatId) => {
21356
21348
  const members = (await store.roster.members(chatId)).filter((one) => one.id !== store.account.account);
21357
21349
  return members.length === 0 ? null : members;
21358
21350
  }, "storedMembers");
21359
21351
 
21360
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/inbox.js
21352
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/inbox.js
21361
21353
  var INBOX_CHATS = 20;
21362
21354
  var REVIEW_DAYS = 3;
21363
21355
  var UNANSWERED_HOURS = 24;
@@ -21402,9 +21394,9 @@ var capped = /* @__PURE__ */ __name((chats, most) => ({
21402
21394
  var unreadIn = /* @__PURE__ */ __name(async (adapter, { limit, all = false, kinds }) => {
21403
21395
  const page = await everyChat(adapter);
21404
21396
  const { heard: waiting, quiet: quiet2 } = heard(byRecency(ofKinds(page.items, kinds).filter((chat) => (chat.unreadCount ?? 0) > 0 || chat.markedUnread === true)), all);
21405
- const { read, skipped } = capped(waiting, INBOX_CHATS);
21397
+ const { read: read2, skipped } = capped(waiting, INBOX_CHATS);
21406
21398
  const chats = [];
21407
- for (const { id: id2, title, kind, unreadCount } of read) {
21399
+ for (const { id: id2, title, kind, unreadCount } of read2) {
21408
21400
  const count4 = unreadCount ?? 0;
21409
21401
  if (count4 === 0) {
21410
21402
  const newest = (await adapter.history(id2, { limit })).items.findLast((message) => !message.outgoing);
@@ -21427,10 +21419,10 @@ var newIn = /* @__PURE__ */ __name(async (adapter, { since, points, limit, all =
21427
21419
  const changed = byRecency(ofKinds(changedAll, kinds));
21428
21420
  const cut = changed.reduce((latest2, chat) => Math.max(latest2, Date.parse(chat.lastMessageAt ?? "")), since);
21429
21421
  const { heard: wanted, quiet: quiet2 } = heard(changed, all);
21430
- const { read, skipped } = capped(wanted, INBOX_CHATS);
21422
+ const { read: read2, skipped } = capped(wanted, INBOX_CHATS);
21431
21423
  const chats = [];
21432
21424
  const checked2 = {};
21433
- for (const { id: id2, title, kind, unreadCount } of read) {
21425
+ for (const { id: id2, title, kind, unreadCount } of read2) {
21434
21426
  const { items } = await adapter.history(id2, { limit });
21435
21427
  const fresh = items.filter((message) => {
21436
21428
  const time = Date.parse(message.timestamp);
@@ -21458,9 +21450,9 @@ var REVIEW_PAGE = 100;
21458
21450
  var REVIEW_PER_CHAT = 300;
21459
21451
  var window2 = /* @__PURE__ */ __name(async (adapter, chat, since, cut) => {
21460
21452
  const messages = [];
21461
- let before2;
21453
+ let before;
21462
21454
  while (true) {
21463
- const page = await adapter.history(chat, { limit: REVIEW_PAGE, ...before2 === void 0 ? {} : { before: before2 } });
21455
+ const page = await adapter.history(chat, { limit: REVIEW_PAGE, ...before === void 0 ? {} : { before } });
21464
21456
  const time = /* @__PURE__ */ __name((message) => Date.parse(message.timestamp), "time");
21465
21457
  messages.unshift(...page.items.filter((message) => time(message) > since && time(message) <= cut));
21466
21458
  const oldest = page.items[0];
@@ -21468,7 +21460,7 @@ var window2 = /* @__PURE__ */ __name(async (adapter, chat, since, cut) => {
21468
21460
  return { messages, more: false };
21469
21461
  if (messages.length >= REVIEW_PER_CHAT)
21470
21462
  return { messages: messages.slice(-REVIEW_PER_CHAT), more: true };
21471
- before2 = oldest.id;
21463
+ before = oldest.id;
21472
21464
  }
21473
21465
  }, "window");
21474
21466
  var reviewIn = /* @__PURE__ */ __name(async (adapter, { since, points, chat, kinds, all = false, unansweredAfterHours, now = Date.now(), enrich, onReviewed }) => {
@@ -21478,10 +21470,10 @@ var reviewIn = /* @__PURE__ */ __name(async (adapter, { since, points, chat, kin
21478
21470
  const cut = changed.reduce((latest2, one) => Math.max(latest2, Date.parse(one.lastMessageAt ?? "")), since);
21479
21471
  const only = chat === void 0 ? void 0 : (await adapter.resolve(chat)).id;
21480
21472
  const { heard: wanted, quiet: quiet2 } = only === void 0 ? heard(ofKinds(changed, kinds), all) : { heard: changed.filter((one) => one.id === only), quiet: 0 };
21481
- const { read, skipped } = capped(wanted, REVIEW_CHATS);
21473
+ const { read: read2, skipped } = capped(wanted, REVIEW_CHATS);
21482
21474
  const chats = [];
21483
21475
  const checked2 = {};
21484
- for (const { id: id2, title, kind } of read) {
21476
+ for (const { id: id2, title, kind } of read2) {
21485
21477
  const { messages, more } = await window2(adapter, id2, startOf(id2), cut);
21486
21478
  if (messages.length > 0)
21487
21479
  chats.push({ id: id2, title, kind, messages, more });
@@ -21565,7 +21557,7 @@ var inboxService = /* @__PURE__ */ __name((deps) => {
21565
21557
  };
21566
21558
  }, "inboxService");
21567
21559
 
21568
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/person-meetings.js
21560
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/person-meetings.js
21569
21561
  var SCAN = 1e3;
21570
21562
  var personMeetings = /* @__PURE__ */ __name(async (store, people, accounts, { limit = 10, since, until } = {}) => {
21571
21563
  const byId2 = new Map(accounts.map((one) => [one.id, one]));
@@ -21617,7 +21609,7 @@ var personMeetings = /* @__PURE__ */ __name(async (store, people, accounts, { li
21617
21609
  return { items, total: newest.length, hasMore: cut || newest.length > limit };
21618
21610
  }, "personMeetings");
21619
21611
 
21620
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/person-context.js
21612
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/person-context.js
21621
21613
  var CONTEXT_MESSAGES2 = 10;
21622
21614
  var CONTEXT_BYTES = 64 * 1024;
21623
21615
  var toContext = /* @__PURE__ */ __name((key, message, chatTitle2) => ({
@@ -21817,12 +21809,12 @@ var recordContext = /* @__PURE__ */ __name(async (store, record2, reads, readabl
21817
21809
  };
21818
21810
  cut ||= direct.length > messages || groups.length > messages || mentions.length > messages;
21819
21811
  const kept2 = withinBytes(lists, bytes2);
21820
- const read = [
21812
+ const read2 = [
21821
21813
  ...reads.map(({ key, scope }) => ({ ...key, scope })),
21822
21814
  ...calendars.map(({ provider, account, scope }) => ({ provider, account, scope })),
21823
21815
  ...recorded.items.flatMap(({ account }) => readable.filter((one) => nameOf(one) === nameOf(account)))
21824
21816
  ].map(({ provider, account, scope }) => ({ provider, account, scope }));
21825
- const accounts = [...new Map(read.map((one) => [nameOf(one), one])).values()].sort((a, b) => nameOf(a).localeCompare(nameOf(b)));
21817
+ const accounts = [...new Map(read2.map((one) => [nameOf(one), one])).values()].sort((a, b) => nameOf(a).localeCompare(nameOf(b)));
21826
21818
  return {
21827
21819
  accounts,
21828
21820
  shared: shared.sort((a, b) => Date.parse(b.lastMessageAt ?? "") - Date.parse(a.lastMessageAt ?? "")),
@@ -21923,10 +21915,10 @@ var personMessages = /* @__PURE__ */ __name(async (store, asked, reference, { ch
21923
21915
  };
21924
21916
  }, "personMessages");
21925
21917
 
21926
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
21918
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
21927
21919
  import { createHash } from "node:crypto";
21928
21920
 
21929
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/meeting-reference.js
21921
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/meeting-reference.js
21930
21922
  var missing2 = /* @__PURE__ */ __name(() => new CliError("not_found", "the meeting evidence is unavailable for this account"), "missing");
21931
21923
  var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId, reference, options2 = {}) => {
21932
21924
  const parsed = parseMeetingReference(reference);
@@ -21944,7 +21936,7 @@ var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId,
21944
21936
  return { parsed, meeting };
21945
21937
  }, "authorizedMeetingMetadata");
21946
21938
 
21947
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
21939
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
21948
21940
  var hash = /* @__PURE__ */ __name((value) => createHash("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
21949
21941
  var checkMeetingCancelled = /* @__PURE__ */ __name((signal) => {
21950
21942
  if (signal?.aborted)
@@ -22143,7 +22135,7 @@ var readMeetingEvidence = /* @__PURE__ */ __name(async (store, accountId, refere
22143
22135
  return { ...packet, fingerprint: hash(packet) };
22144
22136
  }, "readMeetingEvidence");
22145
22137
 
22146
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/person-meeting-context.js
22138
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/person-meeting-context.js
22147
22139
  var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference, options2) => {
22148
22140
  const { meetings = 10, cues = 5, bytes: bytes2 = 64 * 1024, scanLimit = 1e3, since, signal } = options2;
22149
22141
  const requestedAccounts = options2.accountIds;
@@ -22242,7 +22234,7 @@ var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference,
22242
22234
  };
22243
22235
  }, "personMeetingContext");
22244
22236
 
22245
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/person-preparation.js
22237
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/person-preparation.js
22246
22238
  var PREPARE_BYTES = 96 * 1024;
22247
22239
  var MEETINGS = 5;
22248
22240
  var CUES = 3;
@@ -22351,11 +22343,11 @@ var meetingsOf = /* @__PURE__ */ __name(async (store, uid, stored, since, left)
22351
22343
  bytes: Math.min(left(), 4 * 1024 * 1024),
22352
22344
  ...since === void 0 ? {} : { since }
22353
22345
  });
22354
- const read = new Set(found.items.map((item2) => parseMeetingReference(item2.reference).accountId));
22346
+ const read2 = new Set(found.items.map((item2) => parseMeetingReference(item2.reference).accountId));
22355
22347
  return {
22356
22348
  items: found.items,
22357
22349
  hasMore: found.coverage.truncatedBy !== null || found.coverage.scanLimitReached,
22358
- accounts: stored.filter(({ id: id2 }) => read.has(id2)).map(accountName),
22350
+ accounts: stored.filter(({ id: id2 }) => read2.has(id2)).map(accountName),
22359
22351
  pending: found.coverage.pending
22360
22352
  };
22361
22353
  } catch (error) {
@@ -22365,18 +22357,18 @@ var meetingsOf = /* @__PURE__ */ __name(async (store, uid, stored, since, left)
22365
22357
  }
22366
22358
  }, "meetingsOf");
22367
22359
 
22368
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/person-profile.js
22360
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/person-profile.js
22369
22361
  var personProfile = /* @__PURE__ */ __name(async (deps, person, known2) => {
22370
22362
  const online = deps.offline ? void 0 : await deps.connection();
22371
22363
  const held = await storeIfOpen(deps);
22372
- const read = online?.profile ? await online.profile(person) : known2 ? factsOfCard(known2) : await storedFacts2(held ?? { store: await deps.store(), account: await deps.account() }, person);
22364
+ const read2 = online?.profile ? await online.profile(person) : known2 ? factsOfCard(known2) : await storedFacts2(held ?? { store: await deps.store(), account: await deps.account() }, person);
22373
22365
  if (!held)
22374
- return { ...read, chats: quiet(read), aliases: [] };
22375
- if (online?.profile && read.phone) {
22376
- await unlessBusy(() => held.store.people.savePeople(held.account, [{ id: read.id, name: read.name, phone: read.phone }]));
22366
+ return { ...read2, chats: quiet(read2), aliases: [] };
22367
+ if (online?.profile && read2.phone) {
22368
+ await unlessBusy(() => held.store.people.savePeople(held.account, [{ id: read2.id, name: read2.name, phone: read2.phone }]));
22377
22369
  }
22378
- const phone = read.phone ?? await held.store.people.phoneOf(held.account, read.id);
22379
- const facts = phone ? { ...read, phone } : read;
22370
+ const phone = read2.phone ?? await held.store.people.phoneOf(held.account, read2.id);
22371
+ const facts = phone ? { ...read2, phone } : read2;
22380
22372
  return {
22381
22373
  ...facts,
22382
22374
  chats: await activityIn(held.store, held.account, facts),
@@ -22435,7 +22427,7 @@ var quiet = /* @__PURE__ */ __name((facts) => facts.chats.map(({ id: id2, title,
22435
22427
  complete: false
22436
22428
  })), "quiet");
22437
22429
 
22438
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/person-timeline.js
22430
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/person-timeline.js
22439
22431
  var TIMELINE_ITEMS = 50;
22440
22432
  var TIMELINE_MAX = 500;
22441
22433
  var SCOPES = ["personal", "work"];
@@ -22457,7 +22449,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
22457
22449
  throw new CliError("permission_error", `this profile reads ${allowed.join(" and ")}, not ${scope}`, {
22458
22450
  reason: "selection.out-of-scope"
22459
22451
  });
22460
- const read = scope === void 0 ? [...allowed] : [scope];
22452
+ const read2 = scope === void 0 ? [...allowed] : [scope];
22461
22453
  const found = pickPerson(reference, await store.people.people(asked.provider, { account: asked.account }));
22462
22454
  const record2 = await store.people.personOf({ provider: asked.provider, id: found.id });
22463
22455
  if (!record2)
@@ -22465,7 +22457,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
22465
22457
  const personId = Number(record2.uid);
22466
22458
  const pending = store.involvements.pending();
22467
22459
  const rows = store.involvements.forPerson(personId, {
22468
- scopes: read,
22460
+ scopes: read2,
22469
22461
  ...since === void 0 ? {} : { since },
22470
22462
  ...until === void 0 ? {} : { until },
22471
22463
  only: asked,
@@ -22477,7 +22469,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
22477
22469
  const hasMore = rows.length > limit;
22478
22470
  return {
22479
22471
  person: { uid: record2.uid, name: record2.name },
22480
- scopes: read,
22472
+ scopes: read2,
22481
22473
  items: shown.map((row) => ({
22482
22474
  at: new Date(row.occurredAt).toISOString(),
22483
22475
  subject: row.subjectType,
@@ -22497,7 +22489,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
22497
22489
  };
22498
22490
  }, "personTimeline");
22499
22491
 
22500
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/chat-coverage.js
22492
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/chat-coverage.js
22501
22493
  var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
22502
22494
  const ids = [...new Set(chatIds)];
22503
22495
  if (ids.length === 0)
@@ -22523,14 +22515,14 @@ var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
22523
22515
  }));
22524
22516
  }, "chatCoverage");
22525
22517
 
22526
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/context/evidence-response.js
22518
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/context/evidence-response.js
22527
22519
  var contextSourceKey = /* @__PURE__ */ __name((source) => JSON.stringify([source.kind, source.accountId, source.provider, source.account]), "contextSourceKey");
22528
22520
  var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
22529
22521
  const fail2 = /* @__PURE__ */ __name(() => {
22530
22522
  throw new CliError("invalid_response", "context reader returned invalid or out-of-scope evidence");
22531
22523
  }, "fail");
22532
22524
  try {
22533
- const { source, chat, senders, after, before: before2, limit, maxReadBytes } = contextEvidenceRequest(request);
22525
+ const { source, chat, senders, after, before, limit, maxReadBytes } = contextEvidenceRequest(request);
22534
22526
  if (!page || contextSourceKey(contextSource(page.source)) !== contextSourceKey(source))
22535
22527
  fail2();
22536
22528
  if (!Array.isArray(page.items) || page.items.length > limit || !Number.isSafeInteger(page.readBytes) || page.readBytes < 0 || page.readBytes > maxReadBytes)
@@ -22549,7 +22541,7 @@ var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
22549
22541
  for (const item2 of page.items) {
22550
22542
  if (!item2 || item2.provider !== source.provider || item2.account !== source.account || typeof item2.text !== "string" || typeof item2.ref !== "string")
22551
22543
  fail2();
22552
- if (!Number.isSafeInteger(item2.at) || item2.at < after || item2.at >= before2 || !Number.isSafeInteger(item2.updatedAt) || item2.updatedAt < 0)
22544
+ if (!Number.isSafeInteger(item2.at) || item2.at < after || item2.at >= before || !Number.isSafeInteger(item2.updatedAt) || item2.updatedAt < 0)
22553
22545
  fail2();
22554
22546
  if (item2.revision !== null && (!Number.isSafeInteger(item2.revision) || item2.revision < 1))
22555
22547
  fail2();
@@ -22587,7 +22579,7 @@ var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
22587
22579
  }
22588
22580
  }, "validateContextEvidencePage");
22589
22581
 
22590
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/context/read-budget.js
22582
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/context/read-budget.js
22591
22583
  var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
22592
22584
  if (!limits || typeof limits !== "object" || Array.isArray(limits))
22593
22585
  throw new CliError("validation_error", "limits needs a context read allowance");
@@ -22640,7 +22632,7 @@ var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
22640
22632
  };
22641
22633
  }, "contextReadBudget");
22642
22634
 
22643
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/context-evidence.js
22635
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/context-evidence.js
22644
22636
  var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits) => {
22645
22637
  if (!port || typeof port.read !== "function")
22646
22638
  throw new CliError("configuration_error", "context evidence reader is unavailable");
@@ -22648,7 +22640,7 @@ var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits)
22648
22640
  throw new CliError("validation_error", "allowed needs 1\u20138 explicitly authorized sources");
22649
22641
  const keys = new Set(allowed.map(contextSource).map(contextSourceKey));
22650
22642
  const budget = contextReadBudget(limits);
22651
- const read = port.read.bind(port);
22643
+ const read2 = port.read.bind(port);
22652
22644
  return {
22653
22645
  usage: budget.usage,
22654
22646
  async read(original) {
@@ -22671,7 +22663,7 @@ var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits)
22671
22663
  signal
22672
22664
  });
22673
22665
  try {
22674
- const page = await read(request);
22666
+ const page = await read2(request);
22675
22667
  signal?.throwIfAborted();
22676
22668
  validateContextEvidencePage(page, request);
22677
22669
  reservation.complete(page.readBytes);
@@ -22684,7 +22676,7 @@ var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits)
22684
22676
  };
22685
22677
  }, "createContextEvidenceReader");
22686
22678
 
22687
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/excerpt.js
22679
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/excerpt.js
22688
22680
  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");
22689
22681
  var excerpt = /* @__PURE__ */ __name((text2, query, size2 = 240, options2 = {}) => {
22690
22682
  const flat = text2.replace(/\s+/g, " ").trim();
@@ -22700,7 +22692,7 @@ var excerpt = /* @__PURE__ */ __name((text2, query, size2 = 240, options2 = {})
22700
22692
  }, "excerpt");
22701
22693
  var withExcerpt = /* @__PURE__ */ __name(({ matchedText, ...hit }, query) => ({ ...hit, excerpt: excerpt(matchedText ?? hit.text, query) }), "withExcerpt");
22702
22694
 
22703
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/project-gathering-around.js
22695
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-gathering-around.js
22704
22696
  var storedMessageNeighbours = /* @__PURE__ */ __name((messages) => ({
22705
22697
  async around(ref, window3) {
22706
22698
  const at = parseLocator(ref);
@@ -22795,7 +22787,7 @@ var storedNeighbours = /* @__PURE__ */ __name((store) => {
22795
22787
  };
22796
22788
  }, "storedNeighbours");
22797
22789
 
22798
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/project-gathering-request.js
22790
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-gathering-request.js
22799
22791
  import { createHash as createHash2 } from "node:crypto";
22800
22792
  var DAY = 864e5;
22801
22793
  var MAX_TIME = 864e13;
@@ -22997,10 +22989,10 @@ var projectGatheringRequest = /* @__PURE__ */ __name((input, now) => {
22997
22989
  const lookbackDays2 = explicit ? null : whole(input.lookbackDays ?? 60, "lookbackDays", 1, LIMITS.lookbackDays);
22998
22990
  const window3 = explicit ? (() => {
22999
22991
  const after = whole(input.after, "after", 0, MAX_TIME);
23000
- const before2 = whole(input.before ?? asOf ?? now, "before", after + 1, MAX_TIME);
23001
- if (before2 - after > LIMITS.lookbackDays * DAY)
22992
+ const before = whole(input.before ?? asOf ?? now, "before", after + 1, MAX_TIME);
22993
+ if (before - after > LIMITS.lookbackDays * DAY)
23002
22994
  fail(`window must not exceed ${LIMITS.lookbackDays} days`, "after");
23003
- return { after, before: before2, asOf: asOf ?? before2 };
22995
+ return { after, before, asOf: asOf ?? before };
23004
22996
  })() : { after: Math.max(0, (asOf ?? now) - lookbackDays2 * DAY), before: asOf ?? now, asOf: asOf ?? now };
23005
22997
  if (input.budgets !== void 0 && (!input.budgets || typeof input.budgets !== "object"))
23006
22998
  fail("budgets needs whole-run limits", "budgets");
@@ -23049,9 +23041,9 @@ var projectGatheringRequest = /* @__PURE__ */ __name((input, now) => {
23049
23041
  signal: input.signal
23050
23042
  };
23051
23043
  }, "projectGatheringRequest");
23052
- var contextChunks = /* @__PURE__ */ __name((after, before2) => {
23044
+ var contextChunks = /* @__PURE__ */ __name((after, before) => {
23053
23045
  const chunks = [];
23054
- for (let end = before2; end > after; end -= CONTEXT_CHUNK_DAYS * DAY)
23046
+ for (let end = before; end > after; end -= CONTEXT_CHUNK_DAYS * DAY)
23055
23047
  chunks.push({ after: Math.max(after, end - CONTEXT_CHUNK_DAYS * DAY), before: end });
23056
23048
  return chunks;
23057
23049
  }, "contextChunks");
@@ -23111,7 +23103,7 @@ var decodeCheckpoint = /* @__PURE__ */ __name((text2, plan) => {
23111
23103
  return value;
23112
23104
  }, "decodeCheckpoint");
23113
23105
 
23114
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/project-gathering.js
23106
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-gathering.js
23115
23107
  var terminal = /* @__PURE__ */ new Set(["done", "unavailable", "failed"]);
23116
23108
  var PAGE2 = 20;
23117
23109
  var PEOPLE = 20;
@@ -23515,7 +23507,7 @@ var peopleOf = /* @__PURE__ */ __name((items, senderOf) => {
23515
23507
  return [...byKey.values()].sort((a, b) => b.items - a.items || a.name.localeCompare(b.name));
23516
23508
  }, "peopleOf");
23517
23509
 
23518
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidate-matching.js
23510
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidate-matching.js
23519
23511
  var normalizedText = /* @__PURE__ */ __name((text2) => text2.normalize("NFKC").toLowerCase().replace(/\s+/gu, " "), "normalizedText");
23520
23512
  var termsOf = /* @__PURE__ */ __name((entry) => [
23521
23513
  { name: entry.name, kind: "canonical" },
@@ -23559,7 +23551,7 @@ var matchVocabularyTerms = /* @__PURE__ */ __name((catalog, texts) => {
23559
23551
  return result.sort((a, b) => Number(a.entry.id) - Number(b.entry.id));
23560
23552
  }, "matchVocabularyTerms");
23561
23553
 
23562
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/project-gathering-mentions.js
23554
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-gathering-mentions.js
23563
23555
  var KINDS = ["project", "tag", "topic"];
23564
23556
  var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering, options2 = {}) => {
23565
23557
  if (typeof vocabulary?.vocabulary !== "function")
@@ -23614,7 +23606,7 @@ var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering,
23614
23606
  };
23615
23607
  }, "findEvidenceMentions");
23616
23608
 
23617
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/project-purposes.js
23609
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-purposes.js
23618
23610
  var BUILT_IN_PURPOSES = ["work", "sales", "support", "other"];
23619
23611
  var DEFAULT_PURPOSES = ["work"];
23620
23612
  var LINK_PURPOSE = "work";
@@ -23644,7 +23636,7 @@ var purposeList = /* @__PURE__ */ __name((value, previous = []) => [
23644
23636
  ...value.split(",").map((one) => one.trim()).filter(Boolean)
23645
23637
  ], "purposeList");
23646
23638
 
23647
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/stored-project-gathering.js
23639
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/stored-project-gathering.js
23648
23640
  var storedChatCount = /* @__PURE__ */ __name((store) => async (account, chatId, { since, until }) => {
23649
23641
  const window3 = { since: new Date(since).toISOString(), until: new Date(until - 1).toISOString() };
23650
23642
  const [messages, newest, oldest] = await Promise.all([
@@ -23955,7 +23947,7 @@ var purposeHintOf = /* @__PURE__ */ __name((linked, rows, of) => {
23955
23947
  return { chat: top.ref, relationship: link4.relationship, items, of };
23956
23948
  }, "purposeHintOf");
23957
23949
 
23958
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/people.js
23950
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/people.js
23959
23951
  var peopleService = /* @__PURE__ */ __name((deps) => {
23960
23952
  const localCard = /* @__PURE__ */ __name(async (card, includeNotes = false) => {
23961
23953
  const held = await storeIfOpen(deps);
@@ -24071,11 +24063,11 @@ var peopleService = /* @__PURE__ */ __name((deps) => {
24071
24063
  const people = await capability(await deps.connection(), "addressBook", "list its contacts")();
24072
24064
  const store = await deps.store();
24073
24065
  const account = await deps.account();
24074
- const before2 = await store.people.people(account.provider, { account: account.account });
24066
+ const before = await store.people.people(account.provider, { account: account.account });
24075
24067
  let added = 0;
24076
24068
  let changed = 0;
24077
24069
  for (const person of people) {
24078
- const known2 = before2.get(person.id);
24070
+ const known2 = before.get(person.id);
24079
24071
  if (!known2)
24080
24072
  added += 1;
24081
24073
  else if (known2.name !== person.name || known2.username !== person.username)
@@ -24220,7 +24212,7 @@ var withoutPhone = /* @__PURE__ */ __name((answer) => {
24220
24212
  return rest;
24221
24213
  }, "withoutPhone");
24222
24214
 
24223
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/task-stats.js
24215
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/task-stats.js
24224
24216
  var TASK_STATS_BY = ["chat", "meeting", "project"];
24225
24217
  var PERIOD_FIELD = "created";
24226
24218
  var refuseNestedPeriod = /* @__PURE__ */ __name((node, top = true) => {
@@ -24254,14 +24246,14 @@ var taskStatsOf = /* @__PURE__ */ __name(async (store, accounts, { by = "chat",
24254
24246
  const several = Array.isArray(accounts);
24255
24247
  const list2 = several ? [...new Map(accounts.map((one) => [taskAccount(one), one])).values()] : [accounts];
24256
24248
  const time = /* @__PURE__ */ __name((sql) => ({ type: "time", sql }), "time");
24257
- const read = { ...columns, [PERIOD_FIELD]: time("t.created_at"), closed: time("t.closed_at") };
24249
+ const read2 = { ...columns, [PERIOD_FIELD]: time("t.created_at"), closed: time("t.closed_at") };
24258
24250
  const fixed = [
24259
24251
  ...group === void 0 ? [] : [{ sql: "t.source_group = ?", params: [group] }],
24260
24252
  ...kind === void 0 ? [] : [{ sql: "t.type = ?", params: [kind] }],
24261
24253
  ...by === "meeting" ? [{ sql: "t.source_kind = 'meeting'", params: [] }] : []
24262
24254
  ];
24263
- const options2 = { command: "stats tasks show", now, ...timezone === void 0 ? {} : { zone: timezone } };
24264
- const where = /* @__PURE__ */ __name((ast, more = []) => and([...fixed, ...more, ...ast ? [queryFilter(ast, read, options2)] : []]), "where");
24255
+ const options2 = { command: "stats tasks show", now, zone: timezoneOf(timezone) };
24256
+ const where = /* @__PURE__ */ __name((ast, more = []) => and([...fixed, ...more, ...ast ? [queryFilter(ast, read2, options2)] : []]), "where");
24265
24257
  const scopes = by === "project" ? [{ scope: { board: true } }] : list2.map((one) => ({ account: one, scope: { account: taskAccount(one) } }));
24266
24258
  const rowsOf2 = /* @__PURE__ */ __name(async (filter) => (await Promise.all(scopes.map(async ({ account, scope }) => (await store.tasks.statRows(scope, filter)).map((row) => account ? { ...row, account } : row)))).flat(), "rowsOf");
24267
24259
  const all = await rowsOf2(where(withoutField(query, PERIOD_FIELD)));
@@ -24351,7 +24343,7 @@ var meetingNames = /* @__PURE__ */ __name(async (store, groups) => {
24351
24343
  }));
24352
24344
  }, "meetingNames");
24353
24345
 
24354
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/task-tag-filters.js
24346
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/task-tag-filters.js
24355
24347
  var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
24356
24348
  const tags = /* @__PURE__ */ new Map();
24357
24349
  for (const node of query ? walkQuery(query.root) : [])
@@ -24360,7 +24352,7 @@ var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
24360
24352
  return tags;
24361
24353
  }, "taskTagFilters");
24362
24354
 
24363
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/tasks.js
24355
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/tasks.js
24364
24356
  var TASK_QUERY = {
24365
24357
  entity: "task",
24366
24358
  backend: "sql",
@@ -24553,7 +24545,7 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
24553
24545
  const reviewAfterLink = /* @__PURE__ */ __name(async (store, id2) => !isClosedState((await store.tasks.get(id2))?.state ?? "done") ? store.tasks.reviewDuplicates(id2, { linked: true }) : 0, "reviewAfterLink");
24554
24546
  return {
24555
24547
  list: /* @__PURE__ */ __name(({ query, limit, offset, previews }) => inStore(async (store, account) => {
24556
- const where = query ? queryFilter(query, await queryColumns(store, account, query), { command: "tasks list" }) : void 0;
24548
+ const where = query ? queryFilter(query, await queryColumns(store, account, query), { command: "tasks list", zone: timezoneOf() }) : void 0;
24557
24549
  const rows = await store.tasks.query(taskAccount(account), where, { limit: limit + 1, offset });
24558
24550
  const shown = rows.slice(0, limit);
24559
24551
  return {
@@ -24860,7 +24852,7 @@ var taskView = /* @__PURE__ */ __name(async (store, account, task2) => {
24860
24852
  };
24861
24853
  }, "taskView");
24862
24854
 
24863
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/mail/owed.js
24855
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/mail/owed.js
24864
24856
  var mailTurn = /* @__PURE__ */ __name((newest) => {
24865
24857
  if (newest === null)
24866
24858
  return null;
@@ -24869,7 +24861,7 @@ var mailTurn = /* @__PURE__ */ __name((newest) => {
24869
24861
  return newest.addressed ? "owed" : null;
24870
24862
  }, "mailTurn");
24871
24863
 
24872
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/agenda-mail.js
24864
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/agenda-mail.js
24873
24865
  var absent = /* @__PURE__ */ __name((error) => {
24874
24866
  if (error instanceof CliError && error.code === "not_found")
24875
24867
  return void 0;
@@ -24879,7 +24871,7 @@ var mailActivity = /* @__PURE__ */ __name(async (store, account, since, chats) =
24879
24871
  const stored = await store.accounts.storedAccount(account).catch(absent);
24880
24872
  if (!stored)
24881
24873
  return { chats: [], storedAt: null, coverage: /* @__PURE__ */ __name(() => [], "coverage") };
24882
- const where = chats ? queryFilter(chats, MAIL_AGENDA_COLUMNS, { command: "tasks agenda" }) : void 0;
24874
+ const where = chats ? queryFilter(chats, MAIL_AGENDA_COLUMNS, { command: "tasks agenda", zone: timezoneOf() }) : void 0;
24883
24875
  const threads = await store.mail.threadActivity(stored.id, since, where);
24884
24876
  const synced = await store.sync.syncState(account, "mail_coverage");
24885
24877
  const window3 = (() => {
@@ -24927,7 +24919,7 @@ var mailActivity = /* @__PURE__ */ __name(async (store, account, since, chats) =
24927
24919
  };
24928
24920
  }, "mailActivity");
24929
24921
 
24930
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/agenda.js
24922
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/agenda.js
24931
24923
  var DAY2 = 864e5;
24932
24924
  var AGENDA_DEFAULTS = { unanswered: DAY2, waiting: 7 * DAY2 };
24933
24925
  var CLAIMS = ["none", "mine", "others", "any"];
@@ -24975,7 +24967,7 @@ var agendaService = /* @__PURE__ */ __name((deps, now = Date.now) => ({
24975
24967
  }), "find");
24976
24968
  const open7 = await find();
24977
24969
  const tags = await taskTagFilters(store, parts.tasks);
24978
- const listed2 = parts.tasks ? await find(queryFilter(parts.tasks, taskColumns2(holder, at, tags), { command: "tasks agenda" })) : open7;
24970
+ const listed2 = parts.tasks ? await find(queryFilter(parts.tasks, taskColumns2(holder, at, tags), { command: "tasks agenda", zone: timezoneOf() })) : open7;
24979
24971
  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 }) => ({
24980
24972
  id: task2.id,
24981
24973
  key: task2.key,
@@ -25006,7 +24998,7 @@ var agendaService = /* @__PURE__ */ __name((deps, now = Date.now) => ({
25006
24998
  assignees
25007
24999
  }));
25008
25000
  const mail = account.provider === "email" ? await mailActivity(store, account, at - within, parts.chats) : void 0;
25009
- const activity = mail ?? await store.chats.chatActivity(account, at - within, parts.chats ? queryFilter(parts.chats, AGENDA_COLUMNS, { command: "tasks agenda" }) : void 0);
25001
+ const activity = mail ?? await store.chats.chatActivity(account, at - within, parts.chats ? queryFilter(parts.chats, AGENDA_COLUMNS, { command: "tasks agenda", zone: timezoneOf() }) : void 0);
25010
25002
  const turnOf = /* @__PURE__ */ __name((chat) => "turn" in chat ? chat.turn : chat.lastFromOwner === null ? null : chat.lastFromOwner ? "waiting" : "owed", "turnOf");
25011
25003
  const chats = activity.chats.map(({ lastMessageId, ...chat }) => ({
25012
25004
  turn: turnOf({ lastMessageId, ...chat }),
@@ -25181,18 +25173,18 @@ var agendaItem = /* @__PURE__ */ __name((shown) => {
25181
25173
  };
25182
25174
  }, "agendaItem");
25183
25175
 
25184
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/media-archive.js
25176
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/media-archive.js
25185
25177
  import { setTimeout as sleep3 } from "node:timers/promises";
25186
25178
 
25187
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
25179
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
25188
25180
  import { lstat } from "node:fs/promises";
25189
25181
 
25190
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
25182
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
25191
25183
  import { createHash as createHash4, randomUUID as randomUUID3 } from "node:crypto";
25192
25184
  import { open as open3, rename as rename2, unlink as unlink2 } from "node:fs/promises";
25193
25185
  import { join as join5 } from "node:path";
25194
25186
 
25195
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-metadata.js
25187
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-metadata.js
25196
25188
  import { createHash as createHash3 } from "node:crypto";
25197
25189
  var metadataLimit = 16384;
25198
25190
  var partialIdentity = /* @__PURE__ */ __name((locator) => JSON.stringify([locator.provider, locator.account, locator.occurrenceId, locator.assetId]), "partialIdentity");
@@ -25252,7 +25244,7 @@ var readPartialMetadata = /* @__PURE__ */ __name(async (path, locator, maxBytes,
25252
25244
  }
25253
25245
  }, "readPartialMetadata");
25254
25246
 
25255
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-writer.js
25247
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-writer.js
25256
25248
  import { randomUUID as randomUUID2 } from "node:crypto";
25257
25249
  import { open as open2, rename, unlink } from "node:fs/promises";
25258
25250
  import { join as join4 } from "node:path";
@@ -25344,7 +25336,7 @@ var partialWriter = /* @__PURE__ */ __name(async (input) => {
25344
25336
  };
25345
25337
  }, "partialWriter");
25346
25338
 
25347
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
25339
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
25348
25340
  var NativeRecordingPartialStore = class {
25349
25341
  static {
25350
25342
  __name(this, "NativeRecordingPartialStore");
@@ -25451,12 +25443,12 @@ var NativeRecordingPartialStore = class {
25451
25443
  }
25452
25444
  };
25453
25445
 
25454
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
25446
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
25455
25447
  import { createHash as createHash5 } from "node:crypto";
25456
25448
  import { link as link2 } from "node:fs/promises";
25457
25449
  import { basename as basename2, dirname as dirname5, join as join7, resolve as resolve2 } from "node:path";
25458
25450
 
25459
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-files.js
25451
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-files.js
25460
25452
  import { unlink as unlink3 } from "node:fs/promises";
25461
25453
  var verifiedPublicationFile = /* @__PURE__ */ __name(async (path, expected2, signal, writable = false) => {
25462
25454
  signal?.throwIfAborted();
@@ -25491,7 +25483,7 @@ var commitPublication = /* @__PURE__ */ __name(async (root, partialPath, finalPa
25491
25483
  signal?.throwIfAborted();
25492
25484
  }, "commitPublication");
25493
25485
 
25494
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-journal.js
25486
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-journal.js
25495
25487
  import { randomUUID as randomUUID4 } from "node:crypto";
25496
25488
  import { open as open4, rename as rename3, unlink as unlink4 } from "node:fs/promises";
25497
25489
  import { join as join6 } from "node:path";
@@ -25564,7 +25556,7 @@ var writePublicationJournal = /* @__PURE__ */ __name(async (root, path, prefix,
25564
25556
  }
25565
25557
  }, "writePublicationJournal");
25566
25558
 
25567
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
25559
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
25568
25560
  var NativeRecordingPublication = class {
25569
25561
  static {
25570
25562
  __name(this, "NativeRecordingPublication");
@@ -25637,7 +25629,7 @@ var NativeRecordingPublication = class {
25637
25629
  }
25638
25630
  };
25639
25631
 
25640
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/media-archive-manifest.js
25632
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/media-archive-manifest.js
25641
25633
  import { createHash as createHash6 } from "node:crypto";
25642
25634
  import { readdir } from "node:fs/promises";
25643
25635
  import { isAbsolute as isAbsolute2, join as join8, resolve as resolve3 } from "node:path";
@@ -25724,7 +25716,7 @@ var commitMediaEntry = /* @__PURE__ */ __name((root, one, beforePublish) => writ
25724
25716
  beforePublish
25725
25717
  }), "commitMediaEntry");
25726
25718
 
25727
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
25719
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
25728
25720
  var validator = '"media-completed-v1"';
25729
25721
  var maximumFileBytes = 64 * 1024 * 1024 * 1024;
25730
25722
  var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file, beforeWrite, signal, metadata = {}) => {
@@ -25825,7 +25817,7 @@ var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file,
25825
25817
  return entry;
25826
25818
  }, "archiveMediaFile");
25827
25819
 
25828
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/media-archive-locks.js
25820
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/media-archive-locks.js
25829
25821
  import { mkdir, realpath } from "node:fs/promises";
25830
25822
  import { join as join9, resolve as resolve4 } from "node:path";
25831
25823
  var archiveLocations = /* @__PURE__ */ __name(async (initial, signal) => {
@@ -25892,17 +25884,7 @@ var withMediaArchiveLocks = /* @__PURE__ */ __name(async (directory2, signal, ru
25892
25884
  throw new CliError("validation_error", "archive locations changed during locking; run the command again");
25893
25885
  }, "withMediaArchiveLocks");
25894
25886
 
25895
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/media-archive.js
25896
- var validateMediaSince = /* @__PURE__ */ __name((value, flag = "--since-time") => {
25897
- if (value === void 0)
25898
- return void 0;
25899
- if (!/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.\d{1,3})?(?:Z|[+-]\d\d:\d\d)$/.test(value) || !Number.isFinite(Date.parse(value)))
25900
- throw new CliError("validation_error", `${flag} needs an ISO timestamp with a time zone`);
25901
- const date2 = value.slice(0, 10);
25902
- if ((/* @__PURE__ */ new Date(`${date2}T00:00:00Z`)).toISOString().slice(0, 10) !== date2)
25903
- throw new CliError("validation_error", `${flag} has an invalid calendar date`);
25904
- return Date.parse(value);
25905
- }, "validateMediaSince");
25887
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/media-archive.js
25906
25888
  var checkMediaArchive = /* @__PURE__ */ __name((directory2, signal) => withMediaArchiveLocks(directory2, signal, async (root) => {
25907
25889
  const entries = await readMediaManifests(root, signal);
25908
25890
  if (!entries.length)
@@ -25953,7 +25935,7 @@ var saveMessage = /* @__PURE__ */ __name(async (root, account, message, ports, k
25953
25935
  return { saved, existing };
25954
25936
  }, "saveMessage");
25955
25937
  var archiveMedia = /* @__PURE__ */ __name(async (ports, options2) => {
25956
- const since = validateMediaSince(options2.sinceTime);
25938
+ const since = options2.sinceTime === void 0 ? void 0 : momentOf(options2.sinceTime, "--since-time");
25957
25939
  const pageSize = options2.pageSize ?? 100;
25958
25940
  const pauseMs = options2.pauseMs ?? 1e3;
25959
25941
  if (!Number.isSafeInteger(pageSize) || pageSize < 1 || pageSize > 1e3 || !Number.isSafeInteger(pauseMs) || pauseMs < 0)
@@ -25975,10 +25957,10 @@ var archiveMedia = /* @__PURE__ */ __name(async (ports, options2) => {
25975
25957
  let saved = 0, existing = 0, chats = 0;
25976
25958
  const walk = /* @__PURE__ */ __name(async (chat) => {
25977
25959
  const seen = /* @__PURE__ */ new Set();
25978
- let before2;
25960
+ let before;
25979
25961
  for (; ; ) {
25980
25962
  await beforeWrite();
25981
- const page = await ports.messages.list(chat, { limit: pageSize, ...before2 ? { before: before2 } : {} });
25963
+ const page = await ports.messages.list(chat, { limit: pageSize, ...before ? { before } : {} });
25982
25964
  let fresh = 0;
25983
25965
  let reachedSince = false;
25984
25966
  let oldest;
@@ -26004,7 +25986,7 @@ var archiveMedia = /* @__PURE__ */ __name(async (ports, options2) => {
26004
25986
  break;
26005
25987
  if (!oldest || !fresh)
26006
25988
  throw new CliError("invalid_response", "media history pagination did not advance; archive is incomplete");
26007
- before2 = options2.orderByTime ? new Date(Date.parse(oldest.timestamp) + 1).toISOString() : page.items[0]?.id;
25989
+ before = options2.orderByTime ? new Date(Date.parse(oldest.timestamp) + 1).toISOString() : page.items[0]?.id;
26008
25990
  if (pauseMs)
26009
25991
  await sleep3(pauseMs, void 0, { signal: options2.signal });
26010
25992
  }
@@ -26045,7 +26027,7 @@ var archiveMedia = /* @__PURE__ */ __name(async (ports, options2) => {
26045
26027
  }, { create: true });
26046
26028
  }, "archiveMedia");
26047
26029
 
26048
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/media-archive-move.js
26030
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/media-archive-move.js
26049
26031
  import { realpath as realpath2, unlink as unlink5 } from "node:fs/promises";
26050
26032
  import { basename as basename3, dirname as dirname6, join as join10, resolve as resolve5 } from "node:path";
26051
26033
  var canonicalDestination = /* @__PURE__ */ __name(async (directory2) => {
@@ -26086,9 +26068,7 @@ var removeLocalCopy = /* @__PURE__ */ __name(async (root, entry, beforeWrite, si
26086
26068
  }
26087
26069
  }, "removeLocalCopy");
26088
26070
  var moveMediaArchive = /* @__PURE__ */ __name(async (options2) => {
26089
- const cutoff = validateMediaSince(options2.beforeTime, "--before-time");
26090
- if (cutoff === void 0)
26091
- throw new CliError("validation_error", "--before-time is required");
26071
+ const cutoff = momentOf(options2.beforeTime, "--before-time");
26092
26072
  const target2 = await canonicalDestination(options2.archiveDirectory);
26093
26073
  const source = await realpath2(options2.directory);
26094
26074
  if (source === target2)
@@ -26198,7 +26178,7 @@ var moveMediaArchive = /* @__PURE__ */ __name(async (options2) => {
26198
26178
  }, { additional: [target2], createAdditional: !options2.dryRun });
26199
26179
  }, "moveMediaArchive");
26200
26180
 
26201
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/model-downloads.js
26181
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/model-downloads.js
26202
26182
  import { writeFileSync as writeFileSync2 } from "node:fs";
26203
26183
  import { join as join11 } from "node:path";
26204
26184
  var bytesOf = /* @__PURE__ */ __name((model) => model.files.reduce((sum2, file) => sum2 + file.bytes, 0), "bytesOf");
@@ -26223,7 +26203,7 @@ var downloadTextModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
26223
26203
  `);
26224
26204
  await nativeRuntime({ env, progress });
26225
26205
  progress(`${model.id}: loading it once to check it works`);
26226
- const { openEmbedder: openEmbedder2 } = await import("./embed-4NC4ELYP.js");
26206
+ const { openEmbedder: openEmbedder2 } = await import("./embed-FEXLUH3T.js");
26227
26207
  const embedder = await openEmbedder2(model, directory2);
26228
26208
  try {
26229
26209
  const [vector] = await embedder.embed(["check"], "query");
@@ -26244,7 +26224,7 @@ var downloadRerankModel = /* @__PURE__ */ __name(async (id2, { env, progress = /
26244
26224
  }
26245
26225
  await nativeRuntime({ env, progress });
26246
26226
  progress(`${model.id}: loading it once to check it works`);
26247
- const { openReranker } = await import("./rerank-EDY7PHMG.js");
26227
+ const { openReranker } = await import("./rerank-X2633CQN.js");
26248
26228
  const reranker = await openReranker(model, directory2);
26249
26229
  try {
26250
26230
  await reranker.score("check", ["check"]);
@@ -26262,7 +26242,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
26262
26242
  await installFiles(placedImage(model, directory2), { progress, ...bytes2 ? { bytes: bytes2 } : {} });
26263
26243
  }
26264
26244
  progress(`${model.id}: loading it once to check it works`);
26265
- const { openPictureEmbedder } = await import("./embedder-HBRDIFQC.js");
26245
+ const { openPictureEmbedder } = await import("./embedder-NHQARKFJ.js");
26266
26246
  const embedder = await openPictureEmbedder(model, directory2);
26267
26247
  try {
26268
26248
  const vector = await embedder.embedQuery("check");
@@ -26274,7 +26254,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
26274
26254
  return { model, directory: directory2 };
26275
26255
  }, "downloadImageModel");
26276
26256
 
26277
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/money-words.js
26257
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/money-words.js
26278
26258
  var MONEY_REQUEST = "money-request";
26279
26259
  var MONEY_DONE = "money-done";
26280
26260
  var PROMISE = "promise";
@@ -26308,10 +26288,10 @@ var MONEY_WORDS = [
26308
26288
  }
26309
26289
  ];
26310
26290
 
26311
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/money-words.js
26291
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/money-words.js
26312
26292
  var moneyClassesOf = /* @__PURE__ */ __name((text2) => listsHit(text2, MONEY_WORDS), "moneyClassesOf");
26313
26293
 
26314
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/status-words.js
26294
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/status-words.js
26315
26295
  var words = /* @__PURE__ */ __name((forms) => new RegExp(`(?<![\\p{L}\\p{N}])(?:${forms.join("|")})(?![\\p{L}\\p{N}])`, "iu"), "words");
26316
26296
  var MONEY_DONE_FORMS = words([
26317
26297
  "\u043E\u043F\u043B\u0430\u0442\u0438\u043B[\u0430\u0438]?",
@@ -26351,7 +26331,7 @@ var PROMISE_FORMS = words([
26351
26331
  "estar\xE1 listo"
26352
26332
  ]);
26353
26333
 
26354
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/project-status/items.js
26334
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/items.js
26355
26335
  var EXCERPT_CHARS = 80;
26356
26336
  var excerpt2 = /* @__PURE__ */ __name((text2) => {
26357
26337
  const flat = text2.replace(/\s+/g, " ").trim();
@@ -26373,7 +26353,7 @@ var whoOf = /* @__PURE__ */ __name((message) => ({
26373
26353
  var fromOwner = /* @__PURE__ */ __name((message) => message.outgoing === true, "fromOwner");
26374
26354
  var day = /* @__PURE__ */ __name((at) => new Date(at).toISOString().slice(0, 10), "day");
26375
26355
 
26376
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/project-status/signals/amounts.js
26356
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/signals/amounts.js
26377
26357
  var MONEY = DEFAULT_TASK_CATEGORIES.filter((category) => category.name === "money");
26378
26358
  var verbOf = /* @__PURE__ */ __name((text2) => {
26379
26359
  if (MONEY_DONE_FORMS.test(text2))
@@ -26454,7 +26434,7 @@ var amounts = {
26454
26434
  attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.state === "asked" ? [{ chat: item2.chat, weight: 2, why: "money asked" }] : []), "attention")
26455
26435
  };
26456
26436
 
26457
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/project-status/signals/children.js
26437
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/signals/children.js
26458
26438
  var children = {
26459
26439
  id: "children",
26460
26440
  version: 1,
@@ -26483,7 +26463,7 @@ var children = {
26483
26463
  }, "read")
26484
26464
  };
26485
26465
 
26486
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/project-status/signals/coverage.js
26466
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/signals/coverage.js
26487
26467
  var coverage = {
26488
26468
  id: "coverage",
26489
26469
  version: 1,
@@ -26512,7 +26492,7 @@ var coverage = {
26512
26492
  attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.state !== "complete" && item2.data.beforeHeld ? [{ chat: item2.chat, weight: 3, why: "held in part" }] : []), "attention")
26513
26493
  };
26514
26494
 
26515
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/project-status/signals/payments.js
26495
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/signals/payments.js
26516
26496
  var holding2 = /* @__PURE__ */ __name((row) => row.review !== "rejected", "holding");
26517
26497
  var item = /* @__PURE__ */ __name((row, at, data) => ({
26518
26498
  signal: "payments",
@@ -26562,7 +26542,7 @@ var payments = {
26562
26542
  }, "read")
26563
26543
  };
26564
26544
 
26565
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/project-status/signals/promises.js
26545
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/signals/promises.js
26566
26546
  var PATTERNS_PER_CHAT = 3;
26567
26547
  var DAY3 = 864e5;
26568
26548
  var KINDS2 = /* @__PURE__ */ new Set(["promise", "request"]);
@@ -26651,7 +26631,7 @@ var promises = {
26651
26631
  }, "read")
26652
26632
  };
26653
26633
 
26654
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/project-status/signals/questions.js
26634
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/signals/questions.js
26655
26635
  var PER_SIDE = 5;
26656
26636
  var WEEK = 7 * 864e5;
26657
26637
  var NOBODY = /* @__PURE__ */ new Set();
@@ -26682,7 +26662,7 @@ var questions2 = {
26682
26662
  }, "attention")
26683
26663
  };
26684
26664
 
26685
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/project-status/signals/reply-next.js
26665
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/signals/reply-next.js
26686
26666
  var targetOf = /* @__PURE__ */ __name((message, chat, owners) => {
26687
26667
  const byId2 = /* @__PURE__ */ __name((id2) => chat.messages.find((one) => one.id === id2), "byId");
26688
26668
  const quoted = message.replyTo ?? (message.replyToId === void 0 ? void 0 : byId2(message.replyToId));
@@ -26750,7 +26730,7 @@ var replyNext = {
26750
26730
  attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.next === "owner" ? [{ chat: item2.chat, weight: 2, why: "your move" }] : []), "attention")
26751
26731
  };
26752
26732
 
26753
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/project-status/signals/topics.js
26733
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/signals/topics.js
26754
26734
  var escaped = /* @__PURE__ */ __name((text2) => text2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
26755
26735
  var wholeWord = /* @__PURE__ */ __name((word) => new RegExp(`(?<![\\p{L}\\p{N}])${escaped(word)}(?![\\p{L}\\p{N}])`, "u"), "wholeWord");
26756
26736
  var matcherOf = /* @__PURE__ */ __name((query) => {
@@ -26796,7 +26776,7 @@ var topics = {
26796
26776
  }, "read")
26797
26777
  };
26798
26778
 
26799
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/project-status/signals/index.js
26779
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/signals/index.js
26800
26780
  var STATUS_SIGNALS = [
26801
26781
  replyNext,
26802
26782
  questions2,
@@ -26808,7 +26788,7 @@ var STATUS_SIGNALS = [
26808
26788
  children
26809
26789
  ];
26810
26790
 
26811
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/project-status/index.js
26791
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/index.js
26812
26792
  var DAY4 = 864e5;
26813
26793
  var STATUS_WINDOW = 300;
26814
26794
  var STATUS_CHATS = 16;
@@ -26997,7 +26977,7 @@ var projectStatus = /* @__PURE__ */ __name(async (store, input) => {
26997
26977
  };
26998
26978
  }, "projectStatus");
26999
26979
 
27000
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/account.js
26980
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/account.js
27001
26981
  var accountService = /* @__PURE__ */ __name((deps) => {
27002
26982
  const online = /* @__PURE__ */ __name(async (command) => {
27003
26983
  if (deps.offline)
@@ -27069,26 +27049,18 @@ var accountService = /* @__PURE__ */ __name((deps) => {
27069
27049
  };
27070
27050
  }, "accountService");
27071
27051
 
27072
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/send-time.js
27073
- var MINUTE = 6e4;
27074
- var YEAR = 365 * 24 * 60 * MINUTE;
27075
- var DELAY = /^(\d+)(m|h|d)$/;
27076
- var UNIT_MS = { m: MINUTE, h: 60 * MINUTE, d: 24 * 60 * MINUTE };
27052
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/send-time.js
27077
27053
  var sendTime = /* @__PURE__ */ __name((value, now = Date.now(), flag = "--at-time", zone) => {
27078
- const trimmed = value.trim();
27079
- const [, amount, unit] = DELAY.exec(trimmed) ?? [];
27080
- const at = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/.test(trimmed) ? calendarMoment(trimmed.replace(" ", "T"), flag, zone === void 0 ? {} : { zone }) : amount && unit ? now + Number(amount) * (UNIT_MS[unit] ?? 0) : Number.NaN;
27081
- if (Number.isNaN(at)) {
27082
- throw new CliError("validation_error", `${flag} takes a time like 2026-09-25T09:00 or a delay like 30m, 2h, 1d \u2014 not "${value}"`);
27083
- }
27084
- if (at < now + MINUTE)
27085
- throw new CliError("validation_error", `${flag} has to be at least a minute from now`);
27086
- if (at > now + YEAR)
27087
- throw new CliError("validation_error", `${flag} can be at most a year from now`);
27054
+ const at = aheadOf(value, flag, now, {
27055
+ ...zone === void 0 ? {} : { zone },
27056
+ refuseDate: true,
27057
+ soonest: MINUTE,
27058
+ latest: YEAR
27059
+ });
27088
27060
  return new Date(at - at % MINUTE).toISOString();
27089
27061
  }, "sendTime");
27090
27062
 
27091
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/admin.js
27063
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/admin.js
27092
27064
  var recordMembership = /* @__PURE__ */ __name(async (deps, operationId, done2, change, fix, write) => {
27093
27065
  try {
27094
27066
  const held = await accountStoreIfOpen(deps);
@@ -27335,7 +27307,7 @@ var linkLimits = /* @__PURE__ */ __name(({ approval, expires, maxUses }) => {
27335
27307
  return expires === void 0 ? void 0 : sendTime(expires, Date.now(), "--expire-time");
27336
27308
  }, "linkLimits");
27337
27309
 
27338
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/mail-search.js
27310
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/mail-search.js
27339
27311
  var THREADS_PAGE = 500;
27340
27312
  var threadsOf = /* @__PURE__ */ __name(async (store, key) => {
27341
27313
  const account = await store.accounts.storedAccount(key).catch(() => void 0);
@@ -27372,18 +27344,14 @@ var withMailThreads = /* @__PURE__ */ __name((store) => {
27372
27344
  get: /* @__PURE__ */ __name((target2, key, receiver) => key === "chats" ? chats : Reflect.get(target2, key, receiver), "get")
27373
27345
  });
27374
27346
  }, "withMailThreads");
27375
- var before = /* @__PURE__ */ __name((newest) => (a, b) => {
27376
- if (!newest) {
27377
- if ((a.exact ?? false) !== (b.exact ?? false))
27378
- return a.exact ? -1 : 1;
27379
- if (a.score !== b.score)
27380
- return a.score === null ? 1 : b.score === null ? -1 : b.score - a.score;
27381
- }
27382
- return b.timestamp.localeCompare(a.timestamp);
27383
- }, "before");
27384
27347
  var mergeMail = /* @__PURE__ */ __name((messages, mail, limit, newest = false) => {
27385
27348
  const moved = new Set(mail.items.map(({ locator }) => locator));
27386
- const items = [...messages.items.filter(({ locator }) => !moved.has(locator)), ...mail.items].sort(before(newest));
27349
+ const kept2 = messages.items.filter(({ locator }) => !moved.has(locator));
27350
+ const items = newest ? [...kept2, ...mail.items].sort((a, b) => b.timestamp.localeCompare(a.timestamp)) : fuseRanked([kept2, mail.items], (hit) => ({
27351
+ exact: hit.exact,
27352
+ ranked: hit.score !== null,
27353
+ at: Date.parse(hit.timestamp)
27354
+ }));
27387
27355
  return {
27388
27356
  items: items.slice(0, limit),
27389
27357
  hasMore: messages.hasMore || mail.hasMore || items.length > limit
@@ -27400,7 +27368,7 @@ var mailAround = /* @__PURE__ */ __name(async (store, hit, count4) => {
27400
27368
  return void 0;
27401
27369
  return emails.slice(Math.max(0, at - count4), at + count4 + 1).map((email) => email.externalId === hit.id ? { ...messageOfEmail(email, hit.chatId), anchor: true } : messageOfEmail(email, hit.chatId));
27402
27370
  }, "mailAround");
27403
- var readMail = /* @__PURE__ */ __name(async (store, locator, { before: before2 = 0, after = 0 } = {}) => {
27371
+ var readMail = /* @__PURE__ */ __name(async (store, locator, { before = 0, after = 0 } = {}) => {
27404
27372
  const { provider, account, chat, message } = parseLocator(locator);
27405
27373
  if (provider !== "email")
27406
27374
  throw new CliError("validation_error", `${locator} is not an email \u2014 it names ${provider}`);
@@ -27411,10 +27379,10 @@ var readMail = /* @__PURE__ */ __name(async (store, locator, { before: before2 =
27411
27379
  const at = thread.findIndex(({ id: id2 }) => id2 === message);
27412
27380
  if (at < 0)
27413
27381
  throw new CliError("not_found", `no stored email ${message} in that thread`);
27414
- return thread.slice(Math.max(0, at - before2), at + after + 1).map((hit) => hit.id === message ? { ...hit, anchor: true } : hit);
27382
+ return thread.slice(Math.max(0, at - before), at + after + 1).map((hit) => hit.id === message ? { ...hit, anchor: true } : hit);
27415
27383
  }, "readMail");
27416
27384
 
27417
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/messages-search.js
27385
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/messages-search.js
27418
27386
  var PERSON_FIELDS = /* @__PURE__ */ new Set(["from", "to", "cc", "bcc"]);
27419
27387
  var MAIL_FIELDS = /* @__PURE__ */ new Set(["to", "cc", "bcc", "subject", "mailbox", "label", "is", "list"]);
27420
27388
  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");
@@ -27781,7 +27749,7 @@ var statsLucene = /* @__PURE__ */ __name(async (store, account, request, messeng
27781
27749
  };
27782
27750
  }, "statsLucene");
27783
27751
 
27784
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/rankings-selection.js
27752
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/rankings-selection.js
27785
27753
  var RANKING_SELECTION_BYTES = 64 * 1024;
27786
27754
  var object2 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0, "object");
27787
27755
  function invalid(message = "ranking selection is invalid \u2014 obtain a new drilldown from stats top") {
@@ -27950,7 +27918,7 @@ var readRankingSelection = /* @__PURE__ */ __name(async (store, input) => {
27950
27918
  };
27951
27919
  }, "readRankingSelection");
27952
27920
 
27953
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/search-record.js
27921
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/search-record.js
27954
27922
  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");
27955
27923
  var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
27956
27924
  command,
@@ -27960,7 +27928,7 @@ var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
27960
27928
  fieldsVersion: FIELD_VERSION
27961
27929
  }), "searchRecordOf");
27962
27930
 
27963
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/admin-statistics.js
27931
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/admin-statistics.js
27964
27932
  function invalid2(message) {
27965
27933
  throw new CliError("validation_error", message);
27966
27934
  }
@@ -28254,7 +28222,7 @@ var adminStatisticsService = /* @__PURE__ */ __name((deps) => ({
28254
28222
  }, "evidence")
28255
28223
  }), "adminStatisticsService");
28256
28224
 
28257
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/archive-gaps.js
28225
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/archive-gaps.js
28258
28226
  import { createHash as createHash7, randomUUID as randomUUID5 } from "node:crypto";
28259
28227
  var GAP_BOUNDS = { maxGaps: 5, limit: 500, timeMs: 3e4 };
28260
28228
  var validateRepair = /* @__PURE__ */ __name((messenger, options2) => {
@@ -28310,12 +28278,12 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
28310
28278
  if (prepare)
28311
28279
  validateCatchUp(deps, prepare);
28312
28280
  deps.guard.check({ chatId: null, key: "store.gaps.repair" }, { reserve: false });
28313
- const before2 = await plan(chat);
28314
- if (options2.fingerprint !== void 0 && options2.fingerprint !== before2.fingerprint)
28281
+ const before = await plan(chat);
28282
+ if (options2.fingerprint !== void 0 && options2.fingerprint !== before.fingerprint)
28315
28283
  throw new CliError("validation_error", "the gap plan changed; inspect it again before repairing");
28316
28284
  const store = await deps.store();
28317
28285
  const holder = randomUUID5();
28318
- if (!await store.sync.claim(before2.account, before2.chat, "gaps", holder, timeMs + 5e3))
28286
+ if (!await store.sync.claim(before.account, before.chat, "gaps", holder, timeMs + 5e3))
28319
28287
  throw new CliError("validation_error", "another gap repair holds this chat; retry after it finishes");
28320
28288
  const started = Date.now();
28321
28289
  const controller = new AbortController();
@@ -28327,7 +28295,7 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
28327
28295
  let stopped;
28328
28296
  try {
28329
28297
  for (let round = 0; round < maxGaps; round += 1) {
28330
- const current = await plan(before2.chat);
28298
+ const current = await plan(before.chat);
28331
28299
  const gap = current.gaps.at(-1);
28332
28300
  if (!gap)
28333
28301
  break;
@@ -28338,7 +28306,7 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
28338
28306
  let result;
28339
28307
  let windowFetched = 0;
28340
28308
  try {
28341
- result = await abortable(() => archiveService(deps).fetch(before2.chat, {
28309
+ result = await abortable(() => archiveService(deps).fetch(before.chat, {
28342
28310
  window: gap,
28343
28311
  onRequest: /* @__PURE__ */ __name(() => {
28344
28312
  requests += 1;
@@ -28367,14 +28335,14 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
28367
28335
  }
28368
28336
  repaired.push(gap);
28369
28337
  }
28370
- const after = await plan(before2.chat);
28338
+ const after = await plan(before.chat);
28371
28339
  const remainingMs = timeMs - (Date.now() - started);
28372
- const prepared = !prepare ? void 0 : remainingMs <= 0 || signal.aborted ? { complete: false, reason: "time_or_abort_bound" } : await catchUpSearch(deps, before2.chat, { ...prepare, timeMs: Math.min(prepare.timeMs ?? 3e4, remainingMs) }, signal);
28340
+ const prepared = !prepare ? void 0 : remainingMs <= 0 || signal.aborted ? { complete: false, reason: "time_or_abort_bound" } : await catchUpSearch(deps, before.chat, { ...prepare, timeMs: Math.min(prepare.timeMs ?? 3e4, remainingMs) }, signal);
28373
28341
  return {
28374
28342
  version: 1,
28375
28343
  scope: "interior",
28376
- chat: before2.chat,
28377
- before: before2,
28344
+ chat: before.chat,
28345
+ before,
28378
28346
  after,
28379
28347
  repaired,
28380
28348
  fetched,
@@ -28385,18 +28353,18 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
28385
28353
  };
28386
28354
  } finally {
28387
28355
  clearTimeout(timer);
28388
- await store.sync.release(before2.account, before2.chat, "gaps", holder);
28356
+ await store.sync.release(before.account, before.chat, "gaps", holder);
28389
28357
  }
28390
28358
  }, "repair");
28391
28359
  return { plan, repair };
28392
28360
  }, "gapsService");
28393
28361
 
28394
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/attachments.js
28362
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/attachments.js
28395
28363
  import { createHash as createHash10 } from "node:crypto";
28396
28364
  import { constants as constants2, mkdirSync as mkdirSync5 } from "node:fs";
28397
28365
  import { lstat as lstat5, open as open6, readFile as readFile2, stat as stat2 } from "node:fs/promises";
28398
28366
 
28399
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/attachments/directory.js
28367
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/directory.js
28400
28368
  import { lstat as lstat2, readdir as readdir2, realpath as realpath3 } from "node:fs/promises";
28401
28369
  import { basename as basename4, join as join12, relative as relative2, sep as sep2 } from "node:path";
28402
28370
  var MAX_FILES = 1e4;
@@ -28467,15 +28435,15 @@ var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory2, app,
28467
28435
  return choices;
28468
28436
  }, "directoryPaths");
28469
28437
 
28470
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/attachments/documents.js
28438
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/documents.js
28471
28439
  import { posix } from "node:path";
28472
28440
 
28473
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/attachments/container.js
28441
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/container.js
28474
28442
  import { setImmediate as tick } from "node:timers/promises";
28475
28443
  import { crc32 } from "node:zlib";
28476
28444
  var import_xmldom = __toESM(require_lib(), 1);
28477
28445
 
28478
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/attachments/encoding.js
28446
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/encoding.js
28479
28447
  var import_chardet = __toESM(require_lib2(), 1);
28480
28448
  var import_iconv_lite = __toESM(require_lib3(), 1);
28481
28449
  var SAMPLE = 65536;
@@ -28577,7 +28545,7 @@ var decodeXml = /* @__PURE__ */ __name((bytes2) => {
28577
28545
  return result.text;
28578
28546
  }, "decodeXml");
28579
28547
 
28580
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/attachments/container.js
28548
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/container.js
28581
28549
  var MAX_PART = 10 * 1024 * 1024;
28582
28550
  var MAX_ENTRIES = 1e3;
28583
28551
  var decoder = new TextDecoder("utf-8", { fatal: true });
@@ -28792,7 +28760,7 @@ var elements = /* @__PURE__ */ __name((node, name, namespace) => {
28792
28760
  return found;
28793
28761
  }, "elements");
28794
28762
 
28795
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/attachments/sheets.js
28763
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/sheets.js
28796
28764
  var columnName = /* @__PURE__ */ __name((column) => {
28797
28765
  let name = "";
28798
28766
  for (let rest = column; rest > 0; rest = Math.floor((rest - 1) / 26))
@@ -28847,7 +28815,7 @@ var sheetText = /* @__PURE__ */ __name((sheets2, maxChars = MAX_TEXT_CHARS) => {
28847
28815
  return { text: parts.join("").trim(), truncated: false };
28848
28816
  }, "sheetText");
28849
28817
 
28850
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/attachments/documents.js
28818
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/documents.js
28851
28819
  var OFFICE = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
28852
28820
  var TEXT = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
28853
28821
  var TABLE = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
@@ -29247,10 +29215,10 @@ var readDocument = /* @__PURE__ */ __name(async (bytes2, kind, signal) => {
29247
29215
  }
29248
29216
  }, "readDocument");
29249
29217
 
29250
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/attachments/extract.js
29218
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/extract.js
29251
29219
  import { extname as extname3 } from "node:path";
29252
29220
 
29253
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/readers/engine.js
29221
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/engine.js
29254
29222
  import { readFileSync as readFileSync4 } from "node:fs";
29255
29223
  import { dirname as dirname7, extname as extname2, join as join13 } from "node:path";
29256
29224
  import { fileURLToPath } from "node:url";
@@ -29273,7 +29241,7 @@ var versionOf = /* @__PURE__ */ __name((name) => {
29273
29241
  }
29274
29242
  return name;
29275
29243
  }, "versionOf");
29276
- var withEngine = /* @__PURE__ */ __name(async (load, name, read) => {
29244
+ var withEngine = /* @__PURE__ */ __name(async (load, name, read2) => {
29277
29245
  let engine;
29278
29246
  try {
29279
29247
  const loaded2 = await load(name);
@@ -29285,7 +29253,7 @@ var withEngine = /* @__PURE__ */ __name(async (load, name, read) => {
29285
29253
  }
29286
29254
  const extractor = `${name === "mammoth" ? "docx" : name === "word-extractor" ? "doc" : "pdf"}:${versionOf(name)}`;
29287
29255
  try {
29288
- return await read(engine, extractor);
29256
+ return await read2(engine, extractor);
29289
29257
  } catch (error) {
29290
29258
  if (error instanceof ReaderLimit)
29291
29259
  return { status: "too-large" };
@@ -29297,12 +29265,12 @@ var withEngine = /* @__PURE__ */ __name(async (load, name, read) => {
29297
29265
  var startsWith = /* @__PURE__ */ __name((bytes2, magic) => bytes2.length >= magic.length && [...magic].every((char, index) => bytes2[index] === char.charCodeAt(0)), "startsWith");
29298
29266
  var extensionOf = /* @__PURE__ */ __name(({ name, path }) => extname2(name ?? path).toLowerCase(), "extensionOf");
29299
29267
  var capped2 = /* @__PURE__ */ __name((text2) => text2.length > MAX_TEXT_CHARS ? text2.slice(0, MAX_TEXT_CHARS) : text2, "capped");
29300
- var derived = /* @__PURE__ */ __name((bytes2, extractor, read) => {
29268
+ var derived = /* @__PURE__ */ __name((bytes2, extractor, read2) => {
29301
29269
  const decoded = decodeText(bytes2);
29302
29270
  if ("error" in decoded)
29303
29271
  return { status: "unreadable", extractor, error: decoded.error };
29304
29272
  try {
29305
- const text2 = read(decoded.text);
29273
+ const text2 = read2(decoded.text);
29306
29274
  return text2 === "" ? { status: "needs-agent", extractor } : { status: "extracted", text: capped2(text2), extractor };
29307
29275
  } catch (error) {
29308
29276
  if (error instanceof ReaderLimit)
@@ -29311,7 +29279,7 @@ var derived = /* @__PURE__ */ __name((bytes2, extractor, read) => {
29311
29279
  }
29312
29280
  }, "derived");
29313
29281
 
29314
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/readers/image/index.js
29282
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/image/index.js
29315
29283
  var IMAGES = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png", ".webp", ".gif", ".heic", ".tif", ".tiff", ".bmp"]);
29316
29284
  var image2 = {
29317
29285
  id: "image",
@@ -29320,7 +29288,7 @@ var image2 = {
29320
29288
  read: /* @__PURE__ */ __name(async () => ({ status: "needs-agent" }), "read")
29321
29289
  };
29322
29290
 
29323
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/readers/doc/index.js
29291
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/doc/index.js
29324
29292
  var OLE = "\xD0\xCF\xE0\xA1\xB1\xE1";
29325
29293
  var doc = {
29326
29294
  id: "doc",
@@ -29332,7 +29300,7 @@ var doc = {
29332
29300
  }), "read")
29333
29301
  };
29334
29302
 
29335
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/readers/docx/index.js
29303
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/docx/index.js
29336
29304
  var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
29337
29305
  var docx = {
29338
29306
  id: "docx",
@@ -29345,10 +29313,10 @@ var docx = {
29345
29313
  }), "read")
29346
29314
  };
29347
29315
 
29348
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/attachments/markup.js
29316
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/markup.js
29349
29317
  var import_iconv_lite2 = __toESM(require_lib3(), 1);
29350
29318
 
29351
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/html-entities.js
29319
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/html-entities.js
29352
29320
  var NAMED = {
29353
29321
  amp: "&",
29354
29322
  lt: "<",
@@ -29400,7 +29368,7 @@ var decodeEntities = /* @__PURE__ */ __name((text2) => text2.replace(/&(#x[0-9a-
29400
29368
  return body[1] === "x" || body[1] === "X" ? character(Number.parseInt(body.slice(2), 16), entity) : character(Number(body.slice(1)), entity);
29401
29369
  }), "decodeEntities");
29402
29370
 
29403
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/attachments/markup.js
29371
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/markup.js
29404
29372
  var RTF_SKIPPED = /* @__PURE__ */ new Set([
29405
29373
  "fonttbl",
29406
29374
  "colortbl",
@@ -29566,7 +29534,7 @@ var htmlText = /* @__PURE__ */ __name((source) => {
29566
29534
  return decodeEntities(replaceTags(blocks, /<[^>]*>/g, "")).replace(/(?<![ \t\u00a0])[ \t\u00a0]+\n/g, "\n").replace(/\n{3,}/g, "\n\n").trim();
29567
29535
  }, "htmlText");
29568
29536
 
29569
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/readers/html/page.js
29537
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/html/page.js
29570
29538
  var clean = /* @__PURE__ */ __name((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "", "clean");
29571
29539
  var namesIn = /* @__PURE__ */ __name((value) => [value].flat().map((entry) => typeof entry === "string" ? clean(entry) : clean(entry?.name)).filter(Boolean).join(", "), "namesIn");
29572
29540
  var jsonLdNodes = /* @__PURE__ */ __name((document) => {
@@ -29622,7 +29590,7 @@ var markdownSections = /* @__PURE__ */ __name((text2) => {
29622
29590
  return found.map((section, index) => ({ ...section, end: found[index + 1]?.start ?? text2.length }));
29623
29591
  }, "markdownSections");
29624
29592
 
29625
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/readers/html/index.js
29593
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/html/index.js
29626
29594
  var HTML = /* @__PURE__ */ new Set([".html", ".htm", ".xhtml"]);
29627
29595
  var first = /* @__PURE__ */ __name((...values) => values.find((value) => typeof value === "string" && value !== ""), "first");
29628
29596
  var loaded = /* @__PURE__ */ __name(async (load, name) => {
@@ -29693,7 +29661,7 @@ var html = {
29693
29661
  }, "read")
29694
29662
  };
29695
29663
 
29696
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/readers/office/index.js
29664
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/office/index.js
29697
29665
  var office = {
29698
29666
  id: "office",
29699
29667
  version: documentExtractor("odt"),
@@ -29704,7 +29672,7 @@ var office = {
29704
29672
  }, "read")
29705
29673
  };
29706
29674
 
29707
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/readers/pdf/index.js
29675
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/pdf/index.js
29708
29676
  var pdf = {
29709
29677
  id: "pdf",
29710
29678
  version: "unpdf",
@@ -29771,7 +29739,7 @@ var pdf = {
29771
29739
  }), "read")
29772
29740
  };
29773
29741
 
29774
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/readers/plain/index.js
29742
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/plain/index.js
29775
29743
  var PLAIN = /* @__PURE__ */ new Set([".txt", ".md", ".markdown", ".csv", ".tsv", ".json", ".log"]);
29776
29744
  var isPlain = /* @__PURE__ */ __name((hint) => PLAIN.has(extensionOf(hint)) || hint.mime?.startsWith("text/") || hint.mime === "application/json", "isPlain");
29777
29745
  var readPlain = /* @__PURE__ */ __name((bytes2) => {
@@ -29791,7 +29759,7 @@ var plain = {
29791
29759
  read: /* @__PURE__ */ __name(async (bytes2) => readPlain(bytes2), "read")
29792
29760
  };
29793
29761
 
29794
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/readers/rtf/index.js
29762
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/rtf/index.js
29795
29763
  var rtf = {
29796
29764
  id: "rtf",
29797
29765
  version: "v1",
@@ -29799,10 +29767,10 @@ var rtf = {
29799
29767
  read: /* @__PURE__ */ __name(async (bytes2) => derived(bytes2, "rtf:v1", rtfText), "read")
29800
29768
  };
29801
29769
 
29802
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
29770
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
29803
29771
  import { basename as basename5 } from "node:path";
29804
29772
 
29805
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/attachments/csv-spans.js
29773
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/csv-spans.js
29806
29774
  var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) => {
29807
29775
  const cells = [];
29808
29776
  let row = 1, column = 1, start = 0, quoted = false, truncated = false;
@@ -29840,7 +29808,7 @@ var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) =
29840
29808
  return { cells, truncated };
29841
29809
  }, "delimitedSpans");
29842
29810
 
29843
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
29811
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
29844
29812
  var DELIMITED = {
29845
29813
  ".csv": ",",
29846
29814
  ".tsv": " ",
@@ -29879,7 +29847,7 @@ var sheets = {
29879
29847
  }, "read")
29880
29848
  };
29881
29849
 
29882
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/readers/registry.js
29850
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/registry.js
29883
29851
  var BUILT_INS2 = [office, pdf, docx, doc, rtf, html, sheets, plain, image2];
29884
29852
  var HEAD_BYTES = 1024;
29885
29853
  var readers = [...BUILT_INS2];
@@ -29889,7 +29857,7 @@ var readWithRegistry = /* @__PURE__ */ __name(async (bytes2, hint, context2) =>
29889
29857
  return reader ? reader.read(bytes2, hint, context2) : { status: "unsupported" };
29890
29858
  }, "readWithRegistry");
29891
29859
 
29892
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/attachments/extract.js
29860
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/extract.js
29893
29861
  var importEngine = /* @__PURE__ */ __name((name) => importFrom(new URL("attachments/extract.js", import.meta.resolve("@wirecat/cli-core")).href, name), "importEngine");
29894
29862
  var extensionOf2 = /* @__PURE__ */ __name(({ name, path }) => extname3(name ?? path).toLowerCase(), "extensionOf");
29895
29863
  var extractText = /* @__PURE__ */ __name(async (bytes2, hint, load, signal, env = process.env) => {
@@ -30968,7 +30936,7 @@ function imageSize(input) {
30968
30936
  }
30969
30937
  __name(imageSize, "imageSize");
30970
30938
 
30971
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/attachments/ocr.js
30939
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/ocr.js
30972
30940
  var MAX_PAGES = 20;
30973
30941
  var MAX_PIXELS = 2e7;
30974
30942
  var cancelled2 = /* @__PURE__ */ __name((signal) => {
@@ -31128,7 +31096,7 @@ var ocrPdf = /* @__PURE__ */ __name(async (bytes2, pipeline2, load, signal) => {
31128
31096
  }
31129
31097
  }, "ocrPdf");
31130
31098
 
31131
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/attachments/pdf-preview.js
31099
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/pdf-preview.js
31132
31100
  var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = importEngine, env = process.env) => {
31133
31101
  const limits = pdfPreviewLimits(env);
31134
31102
  const cancelled3 = /* @__PURE__ */ __name(() => {
@@ -31205,7 +31173,7 @@ var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = impo
31205
31173
  }
31206
31174
  }, "pdfPreview");
31207
31175
 
31208
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/attachments/picture-reading.js
31176
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/picture-reading.js
31209
31177
  import { spawn } from "node:child_process";
31210
31178
  import { mkdtempSync, readFileSync as readFileSync5, rmSync as rmSync2, writeFileSync as writeFileSync3 } from "node:fs";
31211
31179
  import { tmpdir } from "node:os";
@@ -31359,16 +31327,16 @@ Read the attached picture.`,
31359
31327
  text2 = readFileSync5(answer, "utf8");
31360
31328
  } catch {
31361
31329
  }
31362
- const read = text2.trim();
31363
- if (read === "")
31330
+ const read2 = text2.trim();
31331
+ if (read2 === "")
31364
31332
  throw new CliError("invalid_response", `${TITLE[agent]} answered nothing`, { reason: "picture-reading.failed" });
31365
- return read;
31333
+ return read2;
31366
31334
  } finally {
31367
31335
  rmSync2(folder, { recursive: true, force: true });
31368
31336
  }
31369
31337
  }, "readPictureWithAgent");
31370
31338
 
31371
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/attachments/transfer.js
31339
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/transfer.js
31372
31340
  import { createHash as createHash8 } from "node:crypto";
31373
31341
  import { constants } from "node:fs";
31374
31342
  import { lstat as lstat3, open as open5 } from "node:fs/promises";
@@ -31387,17 +31355,17 @@ var retainedBytes = /* @__PURE__ */ __name(async (path, options2, captureFile =
31387
31355
  }, "cancelled");
31388
31356
  cancelled3();
31389
31357
  try {
31390
- const before2 = await lstat3(path);
31391
- if (!before2.isFile() || before2.isSymbolicLink())
31358
+ const before = await lstat3(path);
31359
+ if (!before.isFile() || before.isSymbolicLink())
31392
31360
  throw new CliError("validation_error", "the retained attachment must be a regular file");
31393
- if (before2.size > maxBytes)
31361
+ if (before.size > maxBytes)
31394
31362
  throw new CliError("validation_error", `the retained attachment exceeds ${maxBytes / 1024 / 1024} MiB; configure MESSAGING_ATTACHMENT_MAX_MIB`);
31395
- if (offsetBytes > before2.size)
31363
+ if (offsetBytes > before.size)
31396
31364
  throw new CliError("validation_error", "the byte offset is past the end of this attachment");
31397
31365
  const handle = await open5(path, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0));
31398
31366
  try {
31399
31367
  const opened = await handle.stat();
31400
- if (!opened.isFile() || opened.ino !== before2.ino || opened.dev !== before2.dev || opened.size !== before2.size)
31368
+ if (!opened.isFile() || opened.ino !== before.ino || opened.dev !== before.dev || opened.size !== before.size)
31401
31369
  throw new CliError("validation_error", "the retained attachment changed; restart its transfer");
31402
31370
  const bytes2 = Buffer.alloc(Math.min(chunkBytes, opened.size - offsetBytes));
31403
31371
  const capturedFile = captureFile ? Buffer.alloc(opened.size) : void 0;
@@ -31476,7 +31444,7 @@ var transferMime = /* @__PURE__ */ __name((head, hint, name = null) => {
31476
31444
  return hint !== null && /^[a-z0-9.+-]+\/[a-z0-9.+-]+$/i.test(hint) ? hint : "application/octet-stream";
31477
31445
  }, "transferMime");
31478
31446
 
31479
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/file-download.js
31447
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/file-download.js
31480
31448
  import { createWriteStream, mkdirSync as mkdirSync4 } from "node:fs";
31481
31449
  import { link as link3, rm } from "node:fs/promises";
31482
31450
  import { join as join15, resolve as resolve6 } from "node:path";
@@ -31590,12 +31558,12 @@ var save = /* @__PURE__ */ __name(async (file, directory2, fallbackName, { uniqu
31590
31558
  }
31591
31559
  }, "save");
31592
31560
 
31593
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/pictures.js
31561
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/pictures.js
31594
31562
  import { createHash as createHash9 } from "node:crypto";
31595
31563
  import { lstat as lstat4, readFile } from "node:fs/promises";
31596
31564
  import { setTimeout as sleep4 } from "node:timers/promises";
31597
31565
 
31598
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/models.js
31566
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/models.js
31599
31567
  var GROUP_SETTINGS = [
31600
31568
  "allCanPin",
31601
31569
  "onlyAdminsAdd",
@@ -31609,7 +31577,7 @@ var ADMIN_RIGHTS = ["read", "members", "admins", "info", "pin", "link", "post",
31609
31577
  var senderIsMe = /* @__PURE__ */ __name((message, account) => message.outgoing === true || message.senderId !== null && String(message.senderId) === account, "senderIsMe");
31610
31578
  var MEDIA_KINDS = ["photo", "video", "file", "audio", "link"];
31611
31579
 
31612
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/pictures.js
31580
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/pictures.js
31613
31581
  var PICTURE_MAX_BYTES = 25 * 1024 * 1024;
31614
31582
  var PICTURE_FLOOR = 0.25;
31615
31583
  var PAGE3 = 50;
@@ -31617,7 +31585,7 @@ var SAVE_EVERY = 8;
31617
31585
  var PICTURES_OFF = "picture search is off for this profile \u2014 set pictureSearch to true in its config to turn it on";
31618
31586
  var missingModel = /* @__PURE__ */ __name((id2) => `the picture model is not downloaded \u2014 \`images models download ${id2}\` fetches it`, "missingModel");
31619
31587
  var plainWords = /* @__PURE__ */ __name((query) => query.replace(/\b(?:text|content|transcript|filename):("[^"]*"|\S+)/gi, "$1").replace(/\b[a-z_]+:("[^"]*"|\[[^\]]*\]|\{[^}]*\}|\([^)]*\)|\S+)/gi, " ").replace(/\b(?:AND|OR|NOT)\b/g, " ").replace(/[()"+\-~^*?\\[\]{}!|&]/g, " ").replace(/\s+/g, " ").trim(), "plainWords");
31620
- var pictureBytes = /* @__PURE__ */ __name(async (picture, files, read) => {
31588
+ var pictureBytes = /* @__PURE__ */ __name(async (picture, files, read2) => {
31621
31589
  if (picture.localPath) {
31622
31590
  try {
31623
31591
  const found = await lstat4(picture.localPath);
@@ -31638,7 +31606,7 @@ var pictureBytes = /* @__PURE__ */ __name(async (picture, files, read) => {
31638
31606
  return void 0;
31639
31607
  parts.push(part);
31640
31608
  }
31641
- await read(file);
31609
+ await read2(file);
31642
31610
  return Buffer.concat(parts);
31643
31611
  }, "pictureBytes");
31644
31612
  var picturesService = /* @__PURE__ */ __name((deps) => {
@@ -31650,7 +31618,7 @@ var picturesService = /* @__PURE__ */ __name((deps) => {
31650
31618
  const directory2 = imageModelsDirectory(deps.env);
31651
31619
  if (!isImageModelInstalled(model2, directory2))
31652
31620
  throw new CliError("not_found", missingModel(model2.id), { reason: "model.not-downloaded", model: model2.id });
31653
- const { openPictureEmbedder } = await import("./embedder-HBRDIFQC.js");
31621
+ const { openPictureEmbedder } = await import("./embedder-NHQARKFJ.js");
31654
31622
  return openPictureEmbedder(model2, directory2);
31655
31623
  }, "open");
31656
31624
  const embedder = /* @__PURE__ */ __name(() => {
@@ -31824,7 +31792,7 @@ var withPictures = /* @__PURE__ */ __name((messages, pictures) => ({
31824
31792
  }, "search")
31825
31793
  }), "withPictures");
31826
31794
 
31827
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/attachments.js
31795
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/attachments.js
31828
31796
  var ATTACHMENT_QUERY = {
31829
31797
  entity: "attachment",
31830
31798
  backend: "sql",
@@ -31988,7 +31956,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
31988
31956
  };
31989
31957
  const batch = batchProgress(deps.env);
31990
31958
  const fetched = /* @__PURE__ */ new Set();
31991
- let read = 0;
31959
+ let read2 = 0;
31992
31960
  let beforePk = cursor === void 0 ? void 0 : Number(cursor);
31993
31961
  let scanned = 0;
31994
31962
  const pending = [];
@@ -32011,12 +31979,12 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
32011
31979
  if (extraction && bytes2 !== void 0 && (!ocr || status === "extracted") && (status === "extracted" || file.read?.error !== null)) {
32012
31980
  if (await keep(store, file, extraction, bytes2, sha) === false) {
32013
31981
  run2.unchanged += 1;
32014
- read += 1;
31982
+ read2 += 1;
32015
31983
  return;
32016
31984
  }
32017
31985
  }
32018
31986
  if (status !== "missing" && status !== "too-large" && status !== "engine-missing")
32019
- read += 1;
31987
+ read2 += 1;
32020
31988
  if (extraction?.status === "engine-missing" && !run2.enginesMissing.includes(extraction.engine))
32021
31989
  run2.enginesMissing.push(extraction.engine);
32022
31990
  if (status === "extracted")
@@ -32072,9 +32040,9 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
32072
32040
  limit: PAGE4
32073
32041
  });
32074
32042
  for (const file of page) {
32075
- while (pending.length && (pending.length >= concurrency || limit !== void 0 && read + pending.length >= limit))
32043
+ while (pending.length && (pending.length >= concurrency || limit !== void 0 && read2 + pending.length >= limit))
32076
32044
  await pending.shift();
32077
- if (batch.stopped || signal?.aborted || limit !== void 0 && read >= limit || scanLimit !== void 0 && scanned >= scanLimit) {
32045
+ if (batch.stopped || signal?.aborted || limit !== void 0 && read2 >= limit || scanLimit !== void 0 && scanned >= scanLimit) {
32078
32046
  run2.complete = false;
32079
32047
  if (beforePk !== void 0)
32080
32048
  run2.cursor = String(beforePk);
@@ -32133,7 +32101,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
32133
32101
  if (node.field === "chat" && node.operator !== "wildcard" && !chats.has(node.value))
32134
32102
  chats.set(node.value, await chatIdIn(deps.messenger, node.value, store, { includeLeft: true }));
32135
32103
  }
32136
- const where = query ? queryFilter(query, attachmentColumns(chats), { command: "attachments list" }) : void 0;
32104
+ const where = query ? queryFilter(query, attachmentColumns(chats), { command: "attachments list", zone: timezoneOf() }) : void 0;
32137
32105
  const views = await store.attachments.attachments({ ...where ? { where } : {}, offset, limit: limit + 1 });
32138
32106
  return { items: views.slice(0, limit).map((view) => itemOf2(account, view)), hasMore: views.length > limit };
32139
32107
  }, "list"),
@@ -32273,8 +32241,8 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
32273
32241
  const mime = transferMime(Buffer.from(bytes2.subarray(0, 16)), null);
32274
32242
  if (!mime.startsWith("image/"))
32275
32243
  throw notPicture;
32276
- const read = await readPictureWithAgent({ ...reader, bytes: bytes2, mime, env, ...signal ? { signal } : {} });
32277
- const text2 = read.slice(0, MAX_TEXT_CHARS);
32244
+ const read2 = await readPictureWithAgent({ ...reader, bytes: bytes2, mime, env, ...signal ? { signal } : {} });
32245
+ const text2 = read2.slice(0, MAX_TEXT_CHARS);
32278
32246
  const extractor = pictureExtractor(reader.agent, reader.model);
32279
32247
  await store.attachments.keepAttachmentText(chosen.pk, {
32280
32248
  text: text2,
@@ -32295,7 +32263,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
32295
32263
  }, "readPicture")
32296
32264
  }), "attachmentsService");
32297
32265
 
32298
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/chat-documents.js
32266
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/chat-documents.js
32299
32267
  var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
32300
32268
  list: /* @__PURE__ */ __name(async (chat, { limit, offset, ref }) => {
32301
32269
  const store = await accountStore(deps);
@@ -32325,7 +32293,7 @@ var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
32325
32293
  }, "list")
32326
32294
  }), "chatDocumentsService");
32327
32295
 
32328
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/retention.js
32296
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/retention.js
32329
32297
  var observationDuration = /* @__PURE__ */ __name((text2, flag) => {
32330
32298
  const match = /^(\d+(?:\.\d+)?)([smhdw])$/.exec(text2);
32331
32299
  const units2 = { s: 1e3, m: 6e4, h: 36e5, d: 864e5, w: 6048e5 };
@@ -32412,7 +32380,7 @@ var isRetentionSelection = /* @__PURE__ */ __name((selection) => {
32412
32380
  }
32413
32381
  }, "isRetentionSelection");
32414
32382
 
32415
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/counters.js
32383
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/counters.js
32416
32384
  var counterFields = /* @__PURE__ */ __name((text2 = "views,reactions,comments") => {
32417
32385
  const fields = text2.split(",").map((one) => one.trim());
32418
32386
  if (!fields.length || fields.some((one) => !COUNTER_FIELDS.includes(one)) || new Set(fields).size !== fields.length)
@@ -32619,7 +32587,7 @@ var countersService = /* @__PURE__ */ __name((deps) => {
32619
32587
  };
32620
32588
  }, "countersService");
32621
32589
 
32622
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/search-refresh.js
32590
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/search-refresh.js
32623
32591
  var SYNC_KEY = "messages.sync-first";
32624
32592
  var SYNC_BOUNDS = { maxChats: 5, timeMs: 3e4, maxMessages: 500 };
32625
32593
  var keyOf3 = /* @__PURE__ */ __name((chat) => JSON.stringify([chat.account.provider, chat.account.account, chat.chatId]), "keyOf");
@@ -32751,10 +32719,10 @@ var withRefresh = /* @__PURE__ */ __name((found, refreshed) => ({
32751
32719
  ...!refreshed || refreshed.complete ? {} : { coverage: { ...found.coverage, state: "stale" } }
32752
32720
  }), "withRefresh");
32753
32721
 
32754
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/embeddings-search.js
32722
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/embeddings-search.js
32755
32723
  var CANDIDATES = 50;
32756
32724
  var WORD_HITS = 200;
32757
- var RRF_K = 60;
32725
+ var RRF_K2 = 60;
32758
32726
  var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
32759
32727
  const command = deps.messenger.app.command;
32760
32728
  const byWords = /* @__PURE__ */ __name(async (query, prepared, conversations, since) => {
@@ -32793,9 +32761,16 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
32793
32761
  });
32794
32762
  outside.set(JSON.stringify(account), { account, chats });
32795
32763
  }
32796
- const ranked = items.flatMap(({ id: id2, score }, index) => {
32764
+ let ranked = items.flatMap(({ id: id2, score, timestamp }, index) => {
32797
32765
  const summary = summaries.get(index);
32798
- return summary ? [{ summary, chunk: { firstMessageId: id2, lastMessageId: id2 }, score }] : [];
32766
+ return summary ? [
32767
+ {
32768
+ summary,
32769
+ chunk: { firstMessageId: id2, lastMessageId: id2 },
32770
+ ranked: score !== null,
32771
+ at: Date.parse(timestamp)
32772
+ }
32773
+ ] : [];
32799
32774
  });
32800
32775
  const mailAccounts = prepared.scopeAccounts.filter(({ provider }) => provider === MAIL);
32801
32776
  if (mailAccounts.length && conversations === void 0) {
@@ -32809,6 +32784,7 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
32809
32784
  return { items: [] };
32810
32785
  throw error;
32811
32786
  });
32787
+ const emails = [];
32812
32788
  for (const account of mailAccounts) {
32813
32789
  const found = mail.items.filter((hit) => {
32814
32790
  const at = parseLocator(hit.locator);
@@ -32824,10 +32800,15 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
32824
32800
  continue;
32825
32801
  const summary = threadConversation(place, Date.now());
32826
32802
  sources.set(summary.id, account);
32827
- ranked.push({ summary, chunk: { firstMessageId: hit.id, lastMessageId: hit.id }, score: hit.score });
32803
+ emails.push({
32804
+ summary,
32805
+ chunk: { firstMessageId: hit.id, lastMessageId: hit.id },
32806
+ ranked: hit.score !== null,
32807
+ at: Date.parse(hit.timestamp)
32808
+ });
32828
32809
  }
32829
32810
  }
32830
- ranked.sort((a, b) => (b.score ?? Number.NEGATIVE_INFINITY) - (a.score ?? Number.NEGATIVE_INFINITY));
32811
+ ranked = fuseRanked([ranked, emails], (one) => one);
32831
32812
  }
32832
32813
  const seen = /* @__PURE__ */ new Set();
32833
32814
  const hits = ranked.flatMap(({ summary, chunk }) => {
@@ -32988,11 +32969,11 @@ var fused = /* @__PURE__ */ __name((meaning, words3, minimumCosine) => {
32988
32969
  by: ["meaning"],
32989
32970
  stale,
32990
32971
  ...matchedIn ? { matchedIn } : {},
32991
- fused: 1 / (RRF_K + index + 1)
32972
+ fused: 1 / (RRF_K2 + index + 1)
32992
32973
  });
32993
32974
  });
32994
32975
  words3.forEach(({ summary, chunk }, index) => {
32995
- const share = 1 / (RRF_K + index + 1);
32976
+ const share = 1 / (RRF_K2 + index + 1);
32996
32977
  const held = merged2.get(summary.id);
32997
32978
  if (held) {
32998
32979
  held.fused += share;
@@ -33026,13 +33007,13 @@ var meanOf = /* @__PURE__ */ __name((vectors) => {
33026
33007
  return mean2.map((value) => value / length);
33027
33008
  }, "meanOf");
33028
33009
 
33029
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/embeddings.js
33010
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/embeddings.js
33030
33011
  var embeddingsService = /* @__PURE__ */ __name((deps) => ({
33031
33012
  ...embeddingsMaintenance(deps),
33032
33013
  ...embeddingsSearch(deps)
33033
33014
  }), "embeddingsService");
33034
33015
 
33035
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/folders.js
33016
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/folders.js
33036
33017
  var foldersService = /* @__PURE__ */ __name((deps) => {
33037
33018
  const online = /* @__PURE__ */ __name(async (command) => {
33038
33019
  if (deps.offline)
@@ -33173,7 +33154,7 @@ var foldersService = /* @__PURE__ */ __name((deps) => {
33173
33154
  };
33174
33155
  }, "foldersService");
33175
33156
 
33176
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/mentions.js
33157
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/mentions.js
33177
33158
  var REVIEW_COUNT = 500;
33178
33159
  var mentionsService = /* @__PURE__ */ __name((deps) => {
33179
33160
  const located = /* @__PURE__ */ __name(async () => {
@@ -33234,8 +33215,8 @@ var mentionsService = /* @__PURE__ */ __name((deps) => {
33234
33215
  const found = await store.mentions.mention(id2);
33235
33216
  if (!found)
33236
33217
  throw new CliError("not_found", `no mention ${id2} in this account`);
33237
- const { before: before2, after, sameValue, candidates, ...rest } = found;
33238
- return { ...mention(rest), before: before2, after, sameValue, candidates };
33218
+ const { before, after, sameValue, candidates, ...rest } = found;
33219
+ return { ...mention(rest), before, after, sameValue, candidates };
33239
33220
  }, "show"),
33240
33221
  confirm: /* @__PURE__ */ __name(async (id2, target2, by, inChat = false) => {
33241
33222
  let owner;
@@ -33252,7 +33233,7 @@ var mentionsService = /* @__PURE__ */ __name((deps) => {
33252
33233
  };
33253
33234
  }, "mentionsService");
33254
33235
 
33255
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/message-link.js
33236
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/message-link.js
33256
33237
  var fileLinks = /* @__PURE__ */ __name((attachments) => hitFiles(attachments).map(({ position, kind, name }) => ({
33257
33238
  position,
33258
33239
  kind,
@@ -33301,7 +33282,7 @@ var validatePermalink = /* @__PURE__ */ __name((link4) => {
33301
33282
  return { url: link4.url, access: link4.access, reason: link4.reason };
33302
33283
  }, "validatePermalink");
33303
33284
 
33304
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/pin-duration.js
33285
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/pin-duration.js
33305
33286
  var spokenSeconds = /* @__PURE__ */ __name((seconds) => {
33306
33287
  if (seconds % 86400 === 0 && seconds > 86400)
33307
33288
  return `${seconds / 86400}d`;
@@ -33333,7 +33314,7 @@ var pinDurationOf = /* @__PURE__ */ __name((value, allowed, flag = "--expire-tim
33333
33314
  return seconds;
33334
33315
  }, "pinDurationOf");
33335
33316
 
33336
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/sends/send-as.js
33317
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/sends/send-as.js
33337
33318
  var sendAsCheck = /* @__PURE__ */ __name((connection, sendAs) => {
33338
33319
  if (sendAs === void 0) {
33339
33320
  const saved = connection.savedSender?.bind(connection);
@@ -33358,7 +33339,7 @@ var typedSendAs = /* @__PURE__ */ __name((typed) => {
33358
33339
  return sendAs;
33359
33340
  }, "typedSendAs");
33360
33341
 
33361
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/search/total.js
33342
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/search/total.js
33362
33343
  var TOTAL_CAP = 1e4;
33363
33344
  var totalOf = /* @__PURE__ */ __name((count4, shown, hasMore, exact = true) => {
33364
33345
  const least = shown + (hasMore ? 1 : 0);
@@ -33369,7 +33350,7 @@ var totalOf = /* @__PURE__ */ __name((count4, shown, hasMore, exact = true) => {
33369
33350
  return { value: count4, relation: exact ? "eq" : "gte" };
33370
33351
  }, "totalOf");
33371
33352
 
33372
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/search/lucene/meaning-parts.js
33353
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/search/lucene/meaning-parts.js
33373
33354
  var WORD_FIELDS = /* @__PURE__ */ new Set(["text", "exact"]);
33374
33355
  var fieldsOfQuery = /* @__PURE__ */ __name((root, everything) => {
33375
33356
  let narrows = false;
@@ -33398,12 +33379,14 @@ var meaningWords = /* @__PURE__ */ __name((root) => {
33398
33379
  return wanted(root).join(" ").trim();
33399
33380
  }, "meaningWords");
33400
33381
 
33401
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/search/question-plan.js
33382
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/search/question-plan.js
33402
33383
  var words2 = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}]+/gu) ?? [], "words");
33403
33384
  var scaffolding = new Set(words2("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"));
33404
33385
  var questionWord = /\b(?:what|which|how|who|where|when|can|could|should)\b|(?:^|\s)(?:сколько|какой|какая|какие|какое|кто|кому|кем|где|когда|как|что|можно|может|могут|ли)(?:\s|$)/iu;
33405
33386
  var QUESTION_STARTS = new Set(words2("what which how who whom whose where when why can could should would did do does is are was were will \u0447\u0442\u043E \u043A\u0442\u043E \u043A\u043E\u0433\u043E \u043A\u043E\u043C\u0443 \u043A\u0435\u043C \u0433\u0434\u0435 \u043A\u043E\u0433\u0434\u0430 \u043A\u0430\u043A \u043A\u0430\u043A\u043E\u0439 \u043A\u0430\u043A\u0430\u044F \u043A\u0430\u043A\u043E\u0435 \u043A\u0430\u043A\u0438\u0435 \u043A\u0430\u043A\u0443\u044E \u043A\u0430\u043A\u0438\u043C \u043A\u0430\u043A\u043E\u0433\u043E \u043A\u0430\u043A\u0438\u0445 \u043F\u043E\u0447\u0435\u043C\u0443 \u0437\u0430\u0447\u0435\u043C \u043E\u0442\u043A\u0443\u0434\u0430 \u043A\u0443\u0434\u0430 \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u043B\u0438 \u043C\u043E\u0436\u043D\u043E \u0440\u0430\u0437\u0432\u0435 \u0447\u0435\u0439 \u0447\u044C\u044F \u0447\u044C\u0451 \u0447\u044C\u0438"));
33406
33387
  var QUESTION_FILLER = new Set(words2("about any did does why whom whose would will \u044D\u0442\u043E \u043C\u044B \u0432\u044B \u044F \u043E\u043D\u0438 \u043E\u043D \u043E\u043D\u0430 \u043E \u043E\u0431 \u043F\u0440\u043E \u043B\u0438"));
33388
+ var LINKING = new Set(words2("and or but not nor with without this that these those there their they them you your our its his her all any and for into onto over then than also just and \u043F\u0440\u0438 \u0434\u043B\u044F \u0431\u0435\u0437 \u043D\u0430\u0434 \u043F\u043E\u0434 \u0438\u043B\u0438 \u043B\u0438\u0431\u043E \u0435\u0433\u043E \u0435\u0451 \u0438\u0445 \u0432\u0441\u0435 \u0432\u0441\u0451 \u0443\u0436\u0435 \u0435\u0449\u0451 \u0442\u0430\u043A \u0442\u043E\u0436\u0435 \u0442\u0430\u043A\u0436\u0435 \u0431\u044B\u043B \u0431\u044B\u043B\u0430 \u0431\u044B\u043B\u0438 \u0431\u044B\u043B\u043E \u0431\u0443\u0434\u0435\u0442 \u044D\u0442\u043E \u044D\u0442\u0430 \u044D\u0442\u043E\u0442 \u044D\u0442\u0438 \u0442\u0430\u043C \u0442\u0443\u0442"));
33389
+ var isFunctionWord = /* @__PURE__ */ __name((word) => scaffolding.has(word) || QUESTION_STARTS.has(word) || QUESTION_FILLER.has(word) || LINKING.has(word), "isFunctionWord");
33407
33390
  function planQuestion(text2, strict = false) {
33408
33391
  if (strict)
33409
33392
  return {
@@ -33531,7 +33514,7 @@ var questionLookup = /* @__PURE__ */ __name((text2) => {
33531
33514
  return terms.length ? anyOfTerms(terms, plan.scope) : void 0;
33532
33515
  }, "questionLookup");
33533
33516
 
33534
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/messages-combined.js
33517
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/messages-combined.js
33535
33518
  var COMBINED_DEFAULTS = { candidateDepth: 300, rrfK: 60, rerank: "all", chatCap: 0 };
33536
33519
  var tokensOf = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}\p{Co}\p{M}]+/gu) ?? [], "tokensOf");
33537
33520
  var searchCombined = /* @__PURE__ */ __name(async (store, account, request, messenger = {}, options2 = COMBINED_DEFAULTS) => {
@@ -33559,6 +33542,13 @@ var searchCombined = /* @__PURE__ */ __name(async (store, account, request, mess
33559
33542
  const corrections = expanding ? await correctWords(store.searchIndex, [...new Set(eligible.map((leaf) => normalize(leaf.value)))]) : /* @__PURE__ */ new Map();
33560
33543
  check2();
33561
33544
  const bySpan = new Map(eligible.map((leaf) => [leaf.span.start, leaf]));
33545
+ const widenable = /* @__PURE__ */ __name((node) => node.kind === "predicate" && bySpan.has(node.span.start) && [...normalize(node.value)].length >= 3 && !isFunctionWord(normalize(node.value)), "widenable");
33546
+ const beginning = /* @__PURE__ */ __name((node) => ({
33547
+ ...node,
33548
+ operator: "wildcard",
33549
+ value: `${normalize(node.value)}*`,
33550
+ widened: true
33551
+ }), "beginning");
33562
33552
  const transform2 = /* @__PURE__ */ __name((node, source, exact2 = false) => {
33563
33553
  if (node.kind === "boolean")
33564
33554
  return {
@@ -33569,8 +33559,8 @@ var searchCombined = /* @__PURE__ */ __name(async (store, account, request, mess
33569
33559
  return { ...node, field: "exact" };
33570
33560
  if (!bySpan.has(node.span.start))
33571
33561
  return node;
33572
- if (source === "beginnings" && [...normalize(node.value)].length >= 3)
33573
- return { ...node, operator: "wildcard", value: `${normalize(node.value)}*` };
33562
+ if (source === "beginnings" && widenable(node))
33563
+ return beginning(node);
33574
33564
  if (source !== "corrected")
33575
33565
  return node;
33576
33566
  const fixes = corrections.get(normalize(node.value));
@@ -33579,7 +33569,7 @@ var searchCombined = /* @__PURE__ */ __name(async (store, account, request, mess
33579
33569
  const clauses = fixes.map((value) => ({ occur: "should", node: { ...node, field: "exact", value } }));
33580
33570
  return { kind: "boolean", clauses, span: node.span };
33581
33571
  }, "transform");
33582
- const read = /* @__PURE__ */ __name(async (root, limit) => {
33572
+ const read2 = /* @__PURE__ */ __name(async (root, limit) => {
33583
33573
  check2();
33584
33574
  const nodes = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? 1 : 1 + node.clauses.reduce((sum2, clause) => sum2 + nodes(clause.node), 0), "nodes");
33585
33575
  if (nodes(root) > QUERY_LIMITS.nodes)
@@ -33589,16 +33579,16 @@ var searchCombined = /* @__PURE__ */ __name(async (store, account, request, mess
33589
33579
  return found;
33590
33580
  }, "read");
33591
33581
  if (!expanding) {
33592
- const found = await read(execution.root, request.limit);
33582
+ const found = await read2(execution.root, request.limit);
33593
33583
  return finish(found.items, found.hasMore, [], false, false);
33594
33584
  }
33595
- const exact = await read(transform2(execution.root, "words", true), depth);
33596
- const stemmed = await read(execution.root, depth);
33597
- const prefix = await read(transform2(execution.root, "beginnings"), depth);
33598
- const fixed = corrections.size ? await read(transform2(execution.root, "corrected"), depth) : { items: [], hasMore: false };
33585
+ const exact = await read2(transform2(execution.root, "words", true), depth);
33586
+ const stemmed = await read2(execution.root, depth);
33587
+ const prefix = await read2(transform2(execution.root, "beginnings"), depth);
33588
+ const fixed = corrections.size ? await read2(transform2(execution.root, "corrected"), depth) : { items: [], hasMore: false };
33599
33589
  const fixedPrefixRoot = transform2(execution.root, "corrected");
33600
- const correctedBeginnings = /* @__PURE__ */ __name((node) => node.kind === "boolean" ? { ...node, clauses: node.clauses.map((clause) => ({ ...clause, node: correctedBeginnings(clause.node) })) } : bySpan.has(node.span.start) && [...normalize(node.value)].length >= 3 ? { ...node, field: "exact", operator: "wildcard", value: `${normalize(node.value)}*` } : node, "correctedBeginnings");
33601
- const fixedPrefix = corrections.size ? await read(correctedBeginnings(fixedPrefixRoot), depth) : { items: [], hasMore: false };
33590
+ const correctedBeginnings = /* @__PURE__ */ __name((node) => node.kind === "boolean" ? { ...node, clauses: node.clauses.map((clause) => ({ ...clause, node: correctedBeginnings(clause.node) })) } : widenable(node) ? { ...beginning(node), field: "exact" } : node, "correctedBeginnings");
33591
+ const fixedPrefix = corrections.size ? await read2(correctedBeginnings(fixedPrefixRoot), depth) : { items: [], hasMore: false };
33602
33592
  const ranked = /* @__PURE__ */ new Map();
33603
33593
  const add = /* @__PURE__ */ __name((lists, source) => {
33604
33594
  const shares = /* @__PURE__ */ new Map();
@@ -33725,9 +33715,9 @@ var signals = /* @__PURE__ */ __name((hit, terms, corrections, execution, mode,
33725
33715
  return mode === "coverage" ? coverage2 * 4 : mode === "proximity" ? proximity : mode === "phrase" ? phrase2 : coverage2 * 4 + proximity + phrase2;
33726
33716
  }, "signals");
33727
33717
 
33728
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/messages-discovery.js
33718
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/messages-discovery.js
33729
33719
  var MEANING_DEPTH = 100;
33730
- var RRF_K2 = 60;
33720
+ var RRF_K3 = 60;
33731
33721
  var RERANK_DEPTH = 50;
33732
33722
  var RERANK_WEIGHT = 0.7;
33733
33723
  var RERANK_CHUNK = 5;
@@ -34015,10 +34005,10 @@ var fusedWithMeaning = /* @__PURE__ */ __name((words3, near2, described) => {
34015
34005
  const merged2 = /* @__PURE__ */ new Map();
34016
34006
  const by = /* @__PURE__ */ __name((hit, foundBy) => hit.discovery ? { ...hit, discovery: { ...hit.discovery, foundBy } } : hit, "by");
34017
34007
  words3.forEach((hit, rank) => {
34018
- merged2.set(hit.locator, { hit: by(hit, ["words"]), rrf: 1 / (RRF_K2 + rank + 1) });
34008
+ merged2.set(hit.locator, { hit: by(hit, ["words"]), rrf: 1 / (RRF_K3 + rank + 1) });
34019
34009
  });
34020
34010
  near2.forEach(({ cosine: _, ...m }, rank) => {
34021
- const share = 1 / (RRF_K2 + rank + 1);
34011
+ const share = 1 / (RRF_K3 + rank + 1);
34022
34012
  const held = merged2.get(m.locator);
34023
34013
  if (held) {
34024
34014
  held.rrf += share;
@@ -34044,14 +34034,14 @@ var scaled = /* @__PURE__ */ __name((values) => {
34044
34034
  }, "scaled");
34045
34035
  var mixedWithReranker = /* @__PURE__ */ __name((head, scores) => {
34046
34036
  const fused2 = scaled(head.map((m) => m.score ?? 0));
34047
- const read = scaled(scores);
34037
+ const read2 = scaled(scores);
34048
34038
  return head.map((m, i) => ({
34049
34039
  hit: m.discovery ? { ...m, discovery: { ...m.discovery, rerankerScore: scores[i] } } : m,
34050
- mixed: (1 - RERANK_WEIGHT) * fused2[i] + RERANK_WEIGHT * read[i]
34040
+ mixed: (1 - RERANK_WEIGHT) * fused2[i] + RERANK_WEIGHT * read2[i]
34051
34041
  })).sort((a, b) => b.mixed - a.mixed).map(({ hit }) => hit);
34052
34042
  }, "mixedWithReranker");
34053
34043
 
34054
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/thread-context.js
34044
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/thread-context.js
34055
34045
  var THREAD_BOUNDS = { maxHops: 8, maxMessages: 50, maxBytes: 65536, withinMs: 864e5 };
34056
34046
  var bytes = /* @__PURE__ */ __name((items, links) => Buffer.byteLength(JSON.stringify({ items, links }), "utf8"), "bytes");
34057
34047
  var threadBounds = /* @__PURE__ */ __name((options2 = {}) => {
@@ -34097,7 +34087,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
34097
34087
  stopped("aborted");
34098
34088
  return result;
34099
34089
  }
34100
- const around = /* @__PURE__ */ __name((id2, before2 = 0, after = 0) => store.messages.around(account, chat, id2, { before: before2, after }).catch((error) => {
34090
+ const around = /* @__PURE__ */ __name((id2, before = 0, after = 0) => store.messages.around(account, chat, id2, { before, after }).catch((error) => {
34101
34091
  if (isCliFailure(error) && error.code === "not_found")
34102
34092
  return [];
34103
34093
  throw error;
@@ -34114,12 +34104,12 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
34114
34104
  const wantedBefore = options2.before ?? 5;
34115
34105
  const wantedAfter = options2.after ?? 5;
34116
34106
  const available = bounds.maxMessages - 1;
34117
- let before2 = Math.min(wantedBefore, Math.ceil(available / 2));
34118
- const after = Math.min(wantedAfter, available - before2);
34119
- before2 = Math.min(wantedBefore, available - after);
34120
- if (anchor && before2 + after < wantedBefore + wantedAfter)
34107
+ let before = Math.min(wantedBefore, Math.ceil(available / 2));
34108
+ const after = Math.min(wantedAfter, available - before);
34109
+ before = Math.min(wantedBefore, available - after);
34110
+ if (anchor && before + after < wantedBefore + wantedAfter)
34121
34111
  stopped("messages");
34122
- const neighbours = anchor ? await around(message, before2, after) : [];
34112
+ const neighbours = anchor ? await around(message, before, after) : [];
34123
34113
  const nearest2 = neighbours.sort((a, b) => Number(a.id !== message) - Number(b.id !== message) || Math.abs(Date.parse(a.timestamp) - Date.parse(anchor?.timestamp ?? "")) - Math.abs(Date.parse(b.timestamp) - Date.parse(anchor?.timestamp ?? "")));
34124
34114
  for (const item2 of nearest2) {
34125
34115
  if (item2.threadId !== anchor?.threadId) {
@@ -34250,7 +34240,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
34250
34240
  return result;
34251
34241
  }, "readThreadContext");
34252
34242
 
34253
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/messages-archive-search.js
34243
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/messages-archive-search.js
34254
34244
  var SEARCH_FILL_MS = 200;
34255
34245
  var statsStore = /* @__PURE__ */ __name(async (store, account, request, messenger = {}) => {
34256
34246
  const stop = Date.now() + SEARCH_FILL_MS;
@@ -34319,7 +34309,7 @@ var accountOf2 = /* @__PURE__ */ __name((hit) => {
34319
34309
  }, "accountOf");
34320
34310
  var keyOf4 = /* @__PURE__ */ __name(({ provider, account }) => `${provider}/${account}`, "keyOf");
34321
34311
 
34322
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/meaning-model.js
34312
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/meaning-model.js
34323
34313
  var meaningModel = /* @__PURE__ */ __name(async (store, env = process.env) => {
34324
34314
  const chosen = chosenTextModel(env);
34325
34315
  if (chosen.from === "chosen" || chosen.id !== DEFAULT_TEXT_MODEL)
@@ -34329,12 +34319,12 @@ var meaningModel = /* @__PURE__ */ __name(async (store, env = process.env) => {
34329
34319
  const previous = models.find(({ id: id2 }) => id2 === PREVIOUS_DEFAULT_TEXT_MODEL);
34330
34320
  if (!current || !previous || !isTextModelInstalled(previous, textModelsDirectory(env)))
34331
34321
  return chosen.id;
34332
- const [now, before2] = [vectorModelKey(current), vectorModelKey(previous)];
34333
- const counts = await store.vectors.vectorCounts([now, before2]);
34334
- return (counts.get(before2) ?? 0) > (counts.get(now) ?? 0) ? previous.id : current.id;
34322
+ const [now, before] = [vectorModelKey(current), vectorModelKey(previous)];
34323
+ const counts = await store.vectors.vectorCounts([now, before]);
34324
+ return (counts.get(before) ?? 0) > (counts.get(now) ?? 0) ? previous.id : current.id;
34335
34325
  }, "meaningModel");
34336
34326
 
34337
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/messages-meaning.js
34327
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/messages-meaning.js
34338
34328
  var meaningText = /* @__PURE__ */ __name((question) => {
34339
34329
  try {
34340
34330
  const text2 = questionLookup(question) === void 0 ? question : questionText(question);
@@ -34413,7 +34403,7 @@ var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, sh
34413
34403
  }
34414
34404
  }, "meaningLane");
34415
34405
 
34416
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/messages-rerank.js
34406
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/messages-rerank.js
34417
34407
  var rerankLane = /* @__PURE__ */ __name((deps) => {
34418
34408
  const choice = deps.reranker ?? DEFAULT_RERANK_MODEL;
34419
34409
  if (choice === "off")
@@ -34425,9 +34415,9 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
34425
34415
  return { skipped: { reason: `${model.id} is not downloaded`, step: "models.download", model: model.id } };
34426
34416
  try {
34427
34417
  const warm = deps.embedders;
34428
- const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-6Q23D3TO.js")).openRerankerProcess(model, directory2, {
34418
+ const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-67DAKAAQ.js")).openRerankerProcess(model, directory2, {
34429
34419
  threads: defaultThreads()
34430
- })) : await (await import("./rerank-EDY7PHMG.js")).openReranker(model, directory2);
34420
+ })) : await (await import("./rerank-X2633CQN.js")).openReranker(model, directory2);
34431
34421
  return {
34432
34422
  model: model.id,
34433
34423
  score: /* @__PURE__ */ __name((question, passages) => reranker.score(plainWords(question), passages), "score"),
@@ -34447,7 +34437,7 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
34447
34437
  };
34448
34438
  }, "rerankLane");
34449
34439
 
34450
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/search/question-period.js
34440
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/search/question-period.js
34451
34441
  var DAY5 = 864e5;
34452
34442
  var SPAN = { start: 0, end: 0 };
34453
34443
  var phrase = /* @__PURE__ */ __name((source) => new RegExp(`(?<![\\p{L}\\p{N}])(?:${source})(?![\\p{L}\\p{N}])`, "giu"), "phrase");
@@ -34572,17 +34562,17 @@ var questionPeriod = /* @__PURE__ */ __name((text2, now, zone) => {
34572
34562
  };
34573
34563
  }, "questionPeriod");
34574
34564
 
34575
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/document-pictures.js
34565
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/document-pictures.js
34576
34566
  var openPictureEmbedderFor = /* @__PURE__ */ __name(async ({ env, command } = {}) => {
34577
34567
  const model = imageModel(DEFAULT_IMAGE_MODEL);
34578
34568
  const directory2 = imageModelsDirectory(env);
34579
34569
  if (!isImageModelInstalled(model, directory2))
34580
34570
  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 });
34581
- const { openPictureEmbedder } = await import("./embedder-HBRDIFQC.js");
34571
+ const { openPictureEmbedder } = await import("./embedder-NHQARKFJ.js");
34582
34572
  return openPictureEmbedder(model, directory2);
34583
34573
  }, "openPictureEmbedderFor");
34584
34574
 
34585
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/document-source.js
34575
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/document-source.js
34586
34576
  var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) => {
34587
34577
  const metadata = note.frontMatter;
34588
34578
  const account = accounts.find(({ id: id2 }) => String(id2) === note.folderId);
@@ -34593,7 +34583,7 @@ var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) =>
34593
34583
  account: account.account,
34594
34584
  ...file?.url ? { url: file.url } : {}
34595
34585
  };
34596
- const remote = note.source === "file" && (account !== void 0 && kindIn(account.provider) === "documents" || metadata?.source === "google-drive");
34586
+ const remote = note.source === "file" && (account !== void 0 && isDocumentAccountProvider(account.provider) || isDocumentAccountProvider(metadata?.source));
34597
34587
  const profile = remote && account ? Object.entries(profiles).flatMap(([command, named2]) => Object.entries(named2).map(([name, key]) => ({ command, name, key }))).find(({ key }) => key.provider === account.provider && key.account === account.account || isFolderProvider(key.provider) && key.account === account.name) : void 0;
34598
34588
  const url = file?.url ?? (remote && typeof metadata?.sourceUrl === "string" ? metadata.sourceUrl : void 0);
34599
34589
  return {
@@ -34604,7 +34594,7 @@ var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) =>
34604
34594
  };
34605
34595
  }, "documentSource");
34606
34596
 
34607
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
34597
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
34608
34598
  var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
34609
34599
  const host = new URL(baseUrl).host;
34610
34600
  return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
@@ -34637,7 +34627,7 @@ var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) =>
34637
34627
  };
34638
34628
  }, "embeddingKeys");
34639
34629
 
34640
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/models/openai.js
34630
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/models/openai.js
34641
34631
  var options = strictObject({
34642
34632
  temperature: range(0, 2),
34643
34633
  top_p: range(0, 1),
@@ -34704,7 +34694,7 @@ var openai = {
34704
34694
  }), "complete")
34705
34695
  };
34706
34696
 
34707
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/models/index.js
34697
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/models/index.js
34708
34698
  var modelGateway = /* @__PURE__ */ __name((deps) => ({
34709
34699
  complete: /* @__PURE__ */ __name(async (request) => {
34710
34700
  if (deps.signal?.aborted)
@@ -34719,7 +34709,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
34719
34709
  if (!adapter && target2.provider === "openai")
34720
34710
  adapter = openai;
34721
34711
  if (!adapter && target2.provider === "anthropic")
34722
- adapter = (await import("./anthropic-GUXHDK32.js")).anthropic;
34712
+ adapter = (await import("./anthropic-UMDO5AKP.js")).anthropic;
34723
34713
  if (!adapter)
34724
34714
  throw new CliError("validation_error", `no model adapter for ${target2.provider}`);
34725
34715
  if (request.images !== void 0 && adapter.images !== true)
@@ -34779,7 +34769,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
34779
34769
  }, "complete")
34780
34770
  }), "modelGateway");
34781
34771
 
34782
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/enrichment-setting.js
34772
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/enrichment-setting.js
34783
34773
  var SECTION2 = "enrichment";
34784
34774
  var ENRICHMENT_PROVIDERS = ["openai", "anthropic"];
34785
34775
  var DEFAULT_BASE_URLS = {
@@ -34854,7 +34844,7 @@ var costOf = /* @__PURE__ */ __name((usage, setting) => {
34854
34844
  return price ? Math.round((usage.input * price.input + usage.output * price.output) * 1e6) / 1e6 : null;
34855
34845
  }, "costOf");
34856
34846
 
34857
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/enrichment.js
34847
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/enrichment.js
34858
34848
  var ENRICH_PER_RUN = 600;
34859
34849
  var MAX_LINE = 400;
34860
34850
  var line2 = pipe(unknown(), transform((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim().slice(0, MAX_LINE) : ""));
@@ -34930,7 +34920,7 @@ var enrichmentState = /* @__PURE__ */ __name(async (store, env, estimateFor, key
34930
34920
  };
34931
34921
  }, "enrichmentState");
34932
34922
 
34933
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/notes-title-tier.js
34923
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/notes-title-tier.js
34934
34924
  var plainQueryWords = /* @__PURE__ */ __name((query) => {
34935
34925
  let root;
34936
34926
  try {
@@ -34957,7 +34947,7 @@ var titleTiers = /* @__PURE__ */ __name((hits, words3) => {
34957
34947
  return [...hits].sort((a, b) => rank(a) - rank(b));
34958
34948
  }, "titleTiers");
34959
34949
 
34960
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/notes-search.js
34950
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/notes-search.js
34961
34951
  var storeQuery = /* @__PURE__ */ __name(async (store, text2, { exact, timezone } = {}) => resolvedQuery(store, parsedQuery(text2, exact), timezone), "storeQuery");
34962
34952
  var parsedQuery = /* @__PURE__ */ __name((text2, exact) => validateFields(parseLucene(text2, { ...SEARCH_QUERY, defaultField: exact ? "exact" : "text" })).root, "parsedQuery");
34963
34953
  var resolvedQuery = /* @__PURE__ */ __name(async (store, root, timezone) => {
@@ -35051,7 +35041,6 @@ var nearestAmong = /* @__PURE__ */ __name(async (store, query, refs, options2) =
35051
35041
  var MAX_LINE2 = 200;
35052
35042
  var MAX_NOTES_OFFSET = 1e3;
35053
35043
  var CANDIDATES2 = 50;
35054
- var RRF_K3 = 60;
35055
35044
  var firstLine2 = /* @__PURE__ */ __name((text2, query) => {
35056
35045
  const words3 = query.toLowerCase().split(/\s+/).map((word) => word.replace(/^[^\p{L}\p{N}]+|[^\p{L}\p{N}]+$/gu, "")).filter((word) => word.length > 2 && !["and", "or", "not"].includes(word));
35057
35046
  const lines3 = text2.split("\n");
@@ -35260,7 +35249,7 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
35260
35249
  const held = ranked.get(ref) ?? { note, at, score: 0, foundBy: [] };
35261
35250
  held.foundBy.push(by);
35262
35251
  ranked.set(ref, held);
35263
- const vote = 1 / (RRF_K3 + rank + 1);
35252
+ const vote = 1 / (RRF_K + rank + 1);
35264
35253
  if (by === "meaning" && lookup !== void 0 && held.foundBy.includes("words"))
35265
35254
  held.score = Math.max(held.score, vote);
35266
35255
  else
@@ -35386,7 +35375,7 @@ var searchNotesOf = /* @__PURE__ */ __name(async (store, account, text2, { accou
35386
35375
  };
35387
35376
  }, "searchNotesOf");
35388
35377
 
35389
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/events-search.js
35378
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/events-search.js
35390
35379
  var MAX_EVENTS_OFFSET = 1e3;
35391
35380
  var iso3 = /* @__PURE__ */ __name((at) => at === null ? null : new Date(at).toISOString(), "iso");
35392
35381
  var accountIdsOf = /* @__PURE__ */ __name(async (store, accounts) => {
@@ -35482,7 +35471,7 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
35482
35471
  const ranked = /* @__PURE__ */ new Map();
35483
35472
  const add = /* @__PURE__ */ __name((list2, half) => list2.forEach((hit, rank) => {
35484
35473
  const held = ranked.get(keyOf5(hit)) ?? { hit, score: 0, by: [] };
35485
- held.score += 1 / (RRF_K3 + rank + 1);
35474
+ held.score += 1 / (RRF_K + rank + 1);
35486
35475
  held.by.push(half);
35487
35476
  ranked.set(keyOf5(hit), held);
35488
35477
  }), "add");
@@ -35504,7 +35493,7 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
35504
35493
  };
35505
35494
  }, "searchEvents");
35506
35495
 
35507
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/search-all-business.js
35496
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/search-all-business.js
35508
35497
  var OWN_BUSINESS = { provider: "business", account: INTERNAL_NOTES };
35509
35498
  var BUSINESS_WORDS_ONLY = "invoices, payments, orders, contracts, subscriptions, products and wallets are found by the words of their numbers and names only";
35510
35499
  var placeOf = /* @__PURE__ */ __name(({ source, imported }) => source ?? (imported === void 0 ? OWN_BUSINESS : { provider: imported, account: "" }), "placeOf");
@@ -35534,7 +35523,7 @@ var searchBusiness = /* @__PURE__ */ __name(async (store, { words: words3, anyWo
35534
35523
  };
35535
35524
  }, "searchBusiness");
35536
35525
 
35537
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/meeting-hit-search.js
35526
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/meeting-hit-search.js
35538
35527
  var resolveMeetingSelection = /* @__PURE__ */ __name(async (store, request) => {
35539
35528
  const { project, tag, topic, ...input } = request;
35540
35529
  input.signal?.throwIfAborted();
@@ -35572,7 +35561,7 @@ var resolveMeetingSelection = /* @__PURE__ */ __name(async (store, request) => {
35572
35561
  return { input, selection };
35573
35562
  }, "resolveMeetingSelection");
35574
35563
 
35575
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/search-all-meetings.js
35564
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/search-all-meetings.js
35576
35565
  var MOST_HITS_PER_MEETING = 3;
35577
35566
  var PAGE_ROWS = 200;
35578
35567
  var MOST_PAGES = 25;
@@ -35633,8 +35622,8 @@ var meetingLane = /* @__PURE__ */ __name(async (store, caller, request) => {
35633
35622
  const meetings = all.filter((one) => holdsKind(one.provider, "meetings"));
35634
35623
  const stored = meetings.filter((one) => scopes.includes(one.scope));
35635
35624
  const chosen = request.accounts;
35636
- const read = chosen ? stored.filter((one) => chosen.some((key) => sameAccount3(key, one))) : stored;
35637
- const skipped = (chosen ?? []).filter((key) => !read.some((one) => sameAccount3(key, one))).map(({ provider, account }) => {
35625
+ const read2 = chosen ? stored.filter((one) => chosen.some((key) => sameAccount3(key, one))) : stored;
35626
+ const skipped = (chosen ?? []).filter((key) => !read2.some((one) => sameAccount3(key, one))).map(({ provider, account }) => {
35638
35627
  const other = meetings.find((one) => sameAccount3({ provider, account }, one));
35639
35628
  return {
35640
35629
  source: `${provider}:${account}`,
@@ -35642,7 +35631,7 @@ var meetingLane = /* @__PURE__ */ __name(async (store, caller, request) => {
35642
35631
  reason: !other ? "no meetings stored for it" : unknownCaller ? "this account is not in the store yet, so no scope is read" : `a ${other.scope} account; this run reads ${scopes.join(" and ")} accounts`
35643
35632
  };
35644
35633
  });
35645
- const [first2] = read;
35634
+ const [first2] = read2;
35646
35635
  if (!first2) {
35647
35636
  if (!skipped.length && request.asked)
35648
35637
  skipped.push({
@@ -35650,7 +35639,7 @@ var meetingLane = /* @__PURE__ */ __name(async (store, caller, request) => {
35650
35639
  code: "not_found",
35651
35640
  reason: !meetings.length ? "no meeting account stored" : unknownCaller ? "this account is not in the store yet" : "no meeting account in this scope"
35652
35641
  });
35653
- return { items: [], hasMore: false, read, skipped, coverage: [] };
35642
+ return { items: [], hasMore: false, read: read2, skipped, coverage: [] };
35654
35643
  }
35655
35644
  const lifted = liftMeetingFields(request.text, { accountId: first2.id }, void 0, request.timezone);
35656
35645
  const parsed = parseMeetingQuery(lifted.query);
@@ -35662,7 +35651,7 @@ var meetingLane = /* @__PURE__ */ __name(async (store, caller, request) => {
35662
35651
  const lists = [];
35663
35652
  const coverage2 = [];
35664
35653
  const answered = [];
35665
- for (const account of read) {
35654
+ for (const account of read2) {
35666
35655
  try {
35667
35656
  const found = await accountHits(store, account, query, { ...input, accountId: account.id }, request);
35668
35657
  lists.push(found.ranked);
@@ -35800,7 +35789,7 @@ var titleItem = /* @__PURE__ */ __name((account, meeting, query) => ({
35800
35789
  foundBy: ["title"]
35801
35790
  }), "titleItem");
35802
35791
 
35803
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/search-harder.js
35792
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/search-harder.js
35804
35793
  var SECTION3 = "search_harder";
35805
35794
  var HARDER_MODELS = {
35806
35795
  anthropic: "claude-haiku-5-5",
@@ -36046,7 +36035,7 @@ var reorderHarder = /* @__PURE__ */ __name(async (question, hits, { laterPage, a
36046
36035
  };
36047
36036
  }, "reorderHarder");
36048
36037
 
36049
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/search-all.js
36038
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/search-all.js
36050
36039
  var RESOURCES_SEARCHED = ["messages", "mail", "notes", "events", "crm", "business", "meetings"];
36051
36040
  var refusal = /* @__PURE__ */ __name((error, text2) => {
36052
36041
  const { reason, span } = error.details ?? {};
@@ -36152,11 +36141,11 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
36152
36141
  if (kind === "messages" && found.coverage)
36153
36142
  coverage2 = found.coverage;
36154
36143
  hasMore ||= found.hasMore;
36155
- const read = found.coverage?.accounts ?? given ?? (await store.accounts.accounts()).filter(({ provider }) => holdsKind(provider, kind));
36144
+ const read2 = found.coverage?.accounts ?? given ?? (await store.accounts.accounts()).filter(({ provider }) => holdsKind(provider, kind));
36156
36145
  for (const one of found.skipped ?? [])
36157
36146
  if (!skipped.some(({ source }) => source === one.source))
36158
36147
  skipped.push(one);
36159
- accounts.push(...read.map(({ provider, account: account2 }) => ({ resource: kind, provider, account: account2 })));
36148
+ accounts.push(...read2.map(({ provider, account: account2 }) => ({ resource: kind, provider, account: account2 })));
36160
36149
  const itemOf3 = /* @__PURE__ */ __name((hit, foundBy) => {
36161
36150
  const at = parseLocator(hit.locator);
36162
36151
  return {
@@ -36183,7 +36172,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
36183
36172
  reason: "the query uses NOT, or a filter under OR or in a group, which meaning cannot follow",
36184
36173
  model: chosenTextModel(request.env).id
36185
36174
  }
36186
- } : await meaning(request.text, read, embedders);
36175
+ } : await meaning(request.text, read2, embedders);
36187
36176
  if ("skipped" in lane) {
36188
36177
  by[kind] = { by: "words", meaningSkipped: lane.skipped };
36189
36178
  return byWords;
@@ -36192,14 +36181,14 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
36192
36181
  const near2 = await nearEligible(store, account, query, messenger, lane.ranked, filters ? { text: filters } : {});
36193
36182
  const fused2 = /* @__PURE__ */ new Map();
36194
36183
  byWords.forEach((item2, rank) => {
36195
- fused2.set(item2.ref, { item: item2, score: 1 / (RRF_K3 + rank + 1) });
36184
+ fused2.set(item2.ref, { item: item2, score: 1 / (RRF_K + rank + 1) });
36196
36185
  });
36197
36186
  near2.forEach((hit, rank) => {
36198
36187
  cosines.set(hit.locator, hit.cosine);
36199
36188
  const held = fused2.get(hit.locator);
36200
36189
  if (held)
36201
36190
  held.item.foundBy = ["words", "meaning"];
36202
- const vote = 1 / (RRF_K3 + rank + 1);
36191
+ const vote = 1 / (RRF_K + rank + 1);
36203
36192
  if (held && discovers)
36204
36193
  held.score = Math.max(held.score, vote);
36205
36194
  else
@@ -36242,7 +36231,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
36242
36231
  text: hit.excerpt,
36243
36232
  foundBy: hit.found_by
36244
36233
  })));
36245
- const read = chosen2 ?? [
36234
+ const read2 = chosen2 ?? [
36246
36235
  ...[
36247
36236
  INTERNAL_NOTES,
36248
36237
  ...(await store.notes.folders()).map(({ id: id2 }) => id2),
@@ -36251,14 +36240,14 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
36251
36240
  ].map((account2) => ({ provider: "notes", account: account2 })),
36252
36241
  ...(await importAccounts(store)).map(({ provider, account: account2 }) => ({ provider, account: account2 }))
36253
36242
  ];
36254
- accounts.push(...read.map(({ provider, account: account2 }) => ({ resource, provider, account: account2 })));
36243
+ accounts.push(...read2.map(({ provider, account: account2 }) => ({ resource, provider, account: account2 })));
36255
36244
  } else if (resource === "events") {
36256
- const read = scope?.events ?? await calendarAccounts(store);
36257
- if (!read.length)
36245
+ const read2 = scope?.events ?? await calendarAccounts(store);
36246
+ if (!read2.length)
36258
36247
  continue;
36259
36248
  const found = await searchEvents(store, request.text, {
36260
36249
  limit: depth,
36261
- accounts: read,
36250
+ accounts: read2,
36262
36251
  embedders,
36263
36252
  ...command === void 0 ? {} : { command },
36264
36253
  ...request.env === void 0 ? {} : { env: request.env },
@@ -36286,7 +36275,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
36286
36275
  text: hit.excerpt,
36287
36276
  foundBy: hit.found_by
36288
36277
  })));
36289
- accounts.push(...read.map(({ provider, account: account2 }) => ({ resource, provider, account: account2 })));
36278
+ accounts.push(...read2.map(({ provider, account: account2 }) => ({ resource, provider, account: account2 })));
36290
36279
  } else if (resource === "crm") {
36291
36280
  const { words: words3, anyWord } = titleWords2(request.text);
36292
36281
  const chosen2 = scope?.crm;
@@ -36311,8 +36300,8 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
36311
36300
  foundBy: deal.matched.includes("title") ? ["title"] : ["words"],
36312
36301
  ...deal.corrections ? { match: "corrected", corrections: deal.corrections } : {}
36313
36302
  })));
36314
- const read = chosen2 ?? [...await crmAccounts(store), { provider: "crm", account: INTERNAL_NOTES }];
36315
- for (const { provider, account: account2 } of read)
36303
+ const read2 = chosen2 ?? [...await crmAccounts(store), { provider: "crm", account: INTERNAL_NOTES }];
36304
+ for (const { provider, account: account2 } of read2)
36316
36305
  accounts.push({ resource, provider, account: account2 });
36317
36306
  } else if (resource === "business") {
36318
36307
  const { words: words3, anyWord } = titleWords2(request.text, BUSINESS_WORDS_ONLY);
@@ -36403,8 +36392,8 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
36403
36392
  ...harder === void 0 ? {} : { harder }
36404
36393
  };
36405
36394
  }, "searchAll");
36406
- var withMeetingDocuments = /* @__PURE__ */ __name(async (store, lists, read) => {
36407
- if (!read.size)
36395
+ var withMeetingDocuments = /* @__PURE__ */ __name(async (store, lists, read2) => {
36396
+ if (!read2.size)
36408
36397
  return lists;
36409
36398
  const documentOf = /* @__PURE__ */ __name((item2) => item2.kind === "document" && /^document:\d+$/.test(item2.ref) ? Number(item2.ref.slice("document:".length)) : void 0, "documentOf");
36410
36399
  const documents = lists.flat().flatMap((item2) => documentOf(item2) ?? []);
@@ -36421,7 +36410,7 @@ var withMeetingDocuments = /* @__PURE__ */ __name(async (store, lists, read) =>
36421
36410
  return [item2];
36422
36411
  if (owner.role === "transcript" && meetings.has(owner.meetingId))
36423
36412
  return [];
36424
- if (!read.has(owner.accountId))
36413
+ if (!read2.has(owner.accountId))
36425
36414
  return [item2];
36426
36415
  return [
36427
36416
  {
@@ -36459,7 +36448,7 @@ var insidePeriodFirst = /* @__PURE__ */ __name((ordered, period) => {
36459
36448
  return ordered.map((item2, rank) => ({ item: item2, score: 1 - rank / PERIOD_DEPTH + (inside2(item2) ? PERIOD_BOOST : 0) })).sort((a, b) => b.score - a.score).map(({ item: item2 }) => item2);
36460
36449
  }, "insidePeriodFirst");
36461
36450
 
36462
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/server-search.js
36451
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/server-search.js
36463
36452
  var SERVER_SEARCH_KEY = "messages.server-search";
36464
36453
  var SERVER_BOUNDS = { timeMs: 5e3, perCall: 100, maxCalls: 3, textBytes: 262144 };
36465
36454
  var DEFAULT_BACKEND = "both";
@@ -36495,13 +36484,13 @@ var serverReads = /* @__PURE__ */ __name((account) => ({
36495
36484
  leaf: /* @__PURE__ */ __name((node) => {
36496
36485
  if (node.field === "text" || node.field === "exact")
36497
36486
  return { words: node.value === "" ? [] : [node.value] };
36498
- const { chat, sender, date: date2 } = node.resolution ?? {};
36487
+ const { chat, sender, date } = node.resolution ?? {};
36499
36488
  if (chat)
36500
36489
  return sameAccount4(chat.account, account) ? { words: [], chat: chat.chatId } : void 0;
36501
36490
  if (sender?.provider === account.provider)
36502
36491
  return { words: [], from: sender.id };
36503
- if (date2) {
36504
- const { from, to } = windowOf(date2);
36492
+ if (date) {
36493
+ const { from, to } = windowOf(date);
36505
36494
  return {
36506
36495
  words: [],
36507
36496
  ...from === void 0 ? {} : { minDate: from },
@@ -36650,7 +36639,7 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
36650
36639
  return { report, sources };
36651
36640
  }, "searchServer");
36652
36641
 
36653
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/messages.js
36642
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/messages.js
36654
36643
  var DELETE_AT_ONCE = 10;
36655
36644
  var filesOf = /* @__PURE__ */ __name(({ attachments }) => {
36656
36645
  const files = fileLinks(attachments);
@@ -36658,7 +36647,7 @@ var filesOf = /* @__PURE__ */ __name(({ attachments }) => {
36658
36647
  }, "filesOf");
36659
36648
  var messagesService = /* @__PURE__ */ __name((deps) => {
36660
36649
  const { guard } = deps;
36661
- const inStore = /* @__PURE__ */ __name(async (read) => read(await deps.store(), await deps.account()), "inStore");
36650
+ const inStore = /* @__PURE__ */ __name(async (read2) => read2(await deps.store(), await deps.account()), "inStore");
36662
36651
  const ownTarget = /* @__PURE__ */ __name(async (target2, account) => {
36663
36652
  if (account.provider !== deps.messenger.provider)
36664
36653
  throw new CliError("validation_error", "that locator belongs to another account; select its profile first");
@@ -36700,18 +36689,18 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
36700
36689
  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 } }));
36701
36690
  return { operationId, chatId, messageId: message, pinned };
36702
36691
  }, "pinning");
36703
- const topicPage = /* @__PURE__ */ __name(async (chat, threadId, { limit, before: before2, beforeTime, after, until }) => {
36692
+ const topicPage = /* @__PURE__ */ __name(async (chat, threadId, { limit, before, beforeTime, after, until }) => {
36704
36693
  if (beforeTime !== void 0 || after !== void 0 || until !== void 0)
36705
36694
  throw new CliError("validation_error", "a topic is read back from its newest message, or from --before-id");
36706
36695
  if (threadId === "1")
36707
36696
  throw new CliError("validation_error", "the General topic's messages carry no topic id \u2014 read the whole chat without --topic");
36708
- const window3 = { limit, ...before2 === void 0 ? {} : { before: before2 } };
36697
+ const window3 = { limit, ...before === void 0 ? {} : { before } };
36709
36698
  if (fromStore(deps)) {
36710
36699
  return inStore(async (store, account) => store.messages.messages(account, await readChatId(deps, chat, store, account), { ...window3, threadId }));
36711
36700
  }
36712
36701
  return capability(await deps.connection(), "topicHistory", "read one forum topic")(chat, threadId, window3);
36713
36702
  }, "topicPage");
36714
- const listPage = /* @__PURE__ */ __name(async (chat, { limit, before: before2, beforeTime, after, until, threadId: typedThread, starred }) => {
36703
+ const listPage = /* @__PURE__ */ __name(async (chat, { limit, before, beforeTime, after, until, threadId: typedThread, starred }) => {
36715
36704
  if (starred !== void 0) {
36716
36705
  if (!fromStore(deps))
36717
36706
  throw new CliError("validation_error", "starred: reads the local store; not while reading from the messenger");
@@ -36719,17 +36708,17 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
36719
36708
  throw new CliError("validation_error", "starred: pages back through the whole chat; give only id< with it");
36720
36709
  return inStore(async (store, account) => store.messages.messages(account, await readChatId(deps, chat, store, account), {
36721
36710
  limit,
36722
- ...before2 === void 0 ? {} : { before: before2 },
36711
+ ...before === void 0 ? {} : { before },
36723
36712
  starred
36724
36713
  }));
36725
36714
  }
36726
36715
  const threadId = threadIdOf(typedThread);
36727
36716
  if (threadId !== void 0)
36728
- return topicPage(chat, threadId, { limit, before: before2, beforeTime, after, until });
36717
+ return topicPage(chat, threadId, { limit, before, beforeTime, after, until });
36729
36718
  if (fromStore(deps)) {
36730
36719
  const window4 = after ? { limit, after, ...until === void 0 ? {} : { until } } : {
36731
36720
  limit,
36732
- ...before2 === void 0 ? {} : { before: before2 },
36721
+ ...before === void 0 ? {} : { before },
36733
36722
  // historyBefore reads strictly before its moment; the store's end is inclusive.
36734
36723
  ...beforeTime === void 0 ? {} : { until: beforeTime - 1 }
36735
36724
  };
@@ -36745,7 +36734,7 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
36745
36734
  const items = page.items.filter((one) => Date.parse(one.timestamp) <= until);
36746
36735
  return { items, hasMore: page.hasMore && items.length === page.items.length };
36747
36736
  }
36748
- const window3 = { limit, ...before2 === void 0 ? {} : { before: before2 } };
36737
+ const window3 = { limit, ...before === void 0 ? {} : { before } };
36749
36738
  return capability(connection, "history", "read a chat's history")(chat, window3);
36750
36739
  }, "listPage");
36751
36740
  return {
@@ -37090,7 +37079,7 @@ var checkMediaOptions = /* @__PURE__ */ __name((messenger, asked, attachments) =
37090
37079
  throw new CliError("validation_error", `${MEDIA_FLAGS[first2]} needs a --photo or --file`);
37091
37080
  }, "checkMediaOptions");
37092
37081
 
37093
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/channel-tags.js
37082
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/channel-tags.js
37094
37083
  var CHANNEL_TAG_RULES_VERSION = "keywords-v1";
37095
37084
  var RULES2 = {
37096
37085
  ai: [/\b(ai|gpt|llm|machine learning|artificial intelligence)\b/iu, /нейросет|искусственн/iu],
@@ -37105,7 +37094,7 @@ var classifyChannel = /* @__PURE__ */ __name((metadata) => Object.entries(RULES2
37105
37094
  return fields.length ? [{ tag, score: fields.length / 3, fields }] : [];
37106
37095
  }), "classifyChannel");
37107
37096
 
37108
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/metadata.js
37097
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/metadata.js
37109
37098
  var metadataService = /* @__PURE__ */ __name((deps) => {
37110
37099
  const held = /* @__PURE__ */ __name(async (reference, { includeLeft = false } = {}) => {
37111
37100
  const store = await deps.store();
@@ -37120,8 +37109,8 @@ var metadataService = /* @__PURE__ */ __name((deps) => {
37120
37109
  const found = (await store.chats.chats(account, {})).items.find((chat) => chat.id === chatId);
37121
37110
  if (!found || found.kind !== "group" && found.kind !== "channel")
37122
37111
  throw new CliError("validation_error", "metadata sync applies to groups and channels");
37123
- const read = /* @__PURE__ */ __name(async (adapter) => capability(adapter, "group", "read group or channel metadata")(chatId), "read");
37124
- const card = deps.withConnection ? await deps.withConnection(read) : await read(await deps.connection());
37112
+ const read2 = /* @__PURE__ */ __name(async (adapter) => capability(adapter, "group", "read group or channel metadata")(chatId), "read");
37113
+ const card = deps.withConnection ? await deps.withConnection(read2) : await read2(await deps.connection());
37125
37114
  return store.chats.saveChatMetadata(account, {
37126
37115
  chatId,
37127
37116
  title: card.title,
@@ -37191,7 +37180,7 @@ var metadataService = /* @__PURE__ */ __name((deps) => {
37191
37180
  };
37192
37181
  }, "metadataService");
37193
37182
 
37194
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/moderation/run.js
37183
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/moderation/run.js
37195
37184
  var FIRST_LOOK_MS = 24 * 36e5;
37196
37185
  var moderateWith = /* @__PURE__ */ __name(async (run2) => {
37197
37186
  const { chatId, title, rules, point, since, dryRun } = run2;
@@ -37228,9 +37217,16 @@ var moderateWith = /* @__PURE__ */ __name(async (run2) => {
37228
37217
  return { chatId, rows, notes };
37229
37218
  }, "moderateWith");
37230
37219
 
37231
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/moderation.js
37220
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/moderation.js
37232
37221
  var moderationService = /* @__PURE__ */ __name((deps) => {
37233
- const file = /* @__PURE__ */ __name(() => new ModerationRules(moderationPathFor(deps.messenger.app, deps.profile ?? "default", deps.env ?? process.env)), "file");
37222
+ const file = /* @__PURE__ */ __name(() => {
37223
+ const env = deps.env ?? process.env;
37224
+ if (deps.profile === void 0) {
37225
+ const choices = moderationProfiles(deps.messenger.app, env);
37226
+ throw new CliError("validation_error", `name a profile: moderation rules are kept per profile \u2014 ${choices.length ? `profiles here: ${choices.join(", ")}` : "there is none on this computer yet"}`, { profiles: choices });
37227
+ }
37228
+ return new ModerationRules(moderationPathFor(deps.messenger.app, deps.profile, env));
37229
+ }, "file");
37234
37230
  const group = /* @__PURE__ */ __name(async (chat) => {
37235
37231
  if (deps.offline)
37236
37232
  throw new CliError("validation_error", "a group's rules are kept by its id, which the messenger gives");
@@ -37306,7 +37302,7 @@ var moderatorOf = /* @__PURE__ */ __name((adapter, deps) => ({
37306
37302
  }, "removePerson")
37307
37303
  }), "moderatorOf");
37308
37304
 
37309
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/private-people.js
37305
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/private-people.js
37310
37306
  var noteItem = /* @__PURE__ */ __name((provider, note) => ({
37311
37307
  id: note.id,
37312
37308
  contact: formatReference({ type: "contact", provider, id: note.personId }),
@@ -37350,7 +37346,7 @@ var privatePeopleService = /* @__PURE__ */ __name((deps) => {
37350
37346
  };
37351
37347
  }, "privatePeopleService");
37352
37348
 
37353
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/rankings.js
37349
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/rankings.js
37354
37350
  var empty = /* @__PURE__ */ __name(() => ({
37355
37351
  total: 0,
37356
37352
  population: 0,
@@ -37606,7 +37602,7 @@ var rankingsService = /* @__PURE__ */ __name((deps) => ({
37606
37602
  }, "evidence")
37607
37603
  }), "rankingsService");
37608
37604
 
37609
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/reply-stats.js
37605
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/reply-stats.js
37610
37606
  var FIELDS = ["date", "chat", "kind", "muted"];
37611
37607
  var WAITING_TAIL = 100;
37612
37608
  var plainOnly = /* @__PURE__ */ __name((text2, command) => {
@@ -37635,7 +37631,7 @@ var scopeOf3 = /* @__PURE__ */ __name((root, accounts) => {
37635
37631
  visit(clause.node);
37636
37632
  return;
37637
37633
  }
37638
- const { chat, date: date2 } = node.resolution ?? {};
37634
+ const { chat, date } = node.resolution ?? {};
37639
37635
  if (chat)
37640
37636
  scope.chats.push(chat);
37641
37637
  else if (node.field === "kind")
@@ -37647,13 +37643,13 @@ var scopeOf3 = /* @__PURE__ */ __name((root, accounts) => {
37647
37643
  reason: "query.conflict"
37648
37644
  });
37649
37645
  scope.muted = muted;
37650
- } else if (date2) {
37651
- if (date2.lower !== void 0) {
37652
- const lower = date2.lower + (date2.lower_inclusive ? 0 : 1);
37646
+ } else if (date) {
37647
+ if (date.lower !== void 0) {
37648
+ const lower = date.lower + (date.lower_inclusive ? 0 : 1);
37653
37649
  scope.since = Math.max(scope.since ?? lower, lower);
37654
37650
  }
37655
- if (date2.upper !== void 0) {
37656
- const upper = date2.upper - (date2.upper_inclusive ? 0 : 1);
37651
+ if (date.upper !== void 0) {
37652
+ const upper = date.upper - (date.upper_inclusive ? 0 : 1);
37657
37653
  scope.until = Math.min(scope.until ?? upper, upper);
37658
37654
  }
37659
37655
  }
@@ -37740,7 +37736,7 @@ var replyStatsService = /* @__PURE__ */ __name((deps) => {
37740
37736
  };
37741
37737
  }, "replyStatsService");
37742
37738
 
37743
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/searches.js
37739
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/searches.js
37744
37740
  var savedSearchItem = /* @__PURE__ */ __name((one) => ({
37745
37741
  id: one.id,
37746
37742
  name: one.name,
@@ -37866,7 +37862,7 @@ var searchesService = /* @__PURE__ */ __name((deps) => {
37866
37862
  };
37867
37863
  }, "searchesService");
37868
37864
 
37869
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/tags.js
37865
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/tags.js
37870
37866
  var TAGGING_QUERY = {
37871
37867
  entity: "tagging",
37872
37868
  backend: "sql",
@@ -37940,7 +37936,7 @@ var tagsService = /* @__PURE__ */ __name((deps) => {
37940
37936
  return { target: viewOf(account, target2), removed, unchanged: tags.filter((tag) => !removed.includes(tag)) };
37941
37937
  }), "remove"),
37942
37938
  list: /* @__PURE__ */ __name(({ query, limit, offset }) => inStore(async (store, account) => {
37943
- const where = query ? queryFilter(query, TAGGING_COLUMNS, { command: "tags list" }) : void 0;
37939
+ const where = query ? queryFilter(query, TAGGING_COLUMNS, { command: "tags list", zone: timezoneOf() }) : void 0;
37944
37940
  const rows = await store.tags.tags(account, {
37945
37941
  ...where ? { where } : {},
37946
37942
  window: { limit: limit + 1, offset }
@@ -37950,7 +37946,7 @@ var tagsService = /* @__PURE__ */ __name((deps) => {
37950
37946
  };
37951
37947
  }, "tagsService");
37952
37948
 
37953
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/topics.js
37949
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/topics.js
37954
37950
  var actionOf = /* @__PURE__ */ __name(({ title, closed, pinned, hidden, icon }) => {
37955
37951
  const set = [closed, pinned, hidden].filter((one) => one !== void 0).length;
37956
37952
  if (title !== void 0 || icon !== void 0 || set !== 1)
@@ -38149,10 +38145,10 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
38149
38145
  };
38150
38146
  }, "topicsService");
38151
38147
 
38152
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/crm/sync.js
38148
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/crm/sync.js
38153
38149
  var CLOCK_MARGIN = 60 * 6e4;
38154
38150
 
38155
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/crm/writer.js
38151
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/crm/writer.js
38156
38152
  var CRM_ASSIGN_OTHERS_KEY = "crm.assign-others";
38157
38153
  var CRM_WRITE_DEFAULTS = {
38158
38154
  "deals.delete": "ask",
@@ -38160,7 +38156,7 @@ var CRM_WRITE_DEFAULTS = {
38160
38156
  [CRM_ASSIGN_OTHERS_KEY]: "deny"
38161
38157
  };
38162
38158
 
38163
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/evidence.js
38159
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/evidence.js
38164
38160
  import { createHash as createHash11, randomUUID as randomUUID6 } from "node:crypto";
38165
38161
  var hash2 = /* @__PURE__ */ __name((value) => createHash11("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
38166
38162
  var positive2 = /* @__PURE__ */ __name((value, name, minimum = 1) => {
@@ -38234,14 +38230,14 @@ var prepareEvidencePacket = /* @__PURE__ */ __name(({ kind, source, page, limits
38234
38230
  return { ...content, id: randomUUID6(), fingerprint: hash2(content) };
38235
38231
  }, "prepareEvidencePacket");
38236
38232
 
38237
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/evidence-read.js
38238
- var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, limit, before: before2 }, messenger = {}) => {
38233
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/evidence-read.js
38234
+ var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, limit, before }, messenger = {}) => {
38239
38235
  if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100)
38240
38236
  throw new CliError("validation_error", "evidence message limit must be an integer from 1 to 100");
38241
- if (before2 !== void 0 && !before2.trim())
38237
+ if (before !== void 0 && !before.trim())
38242
38238
  throw new CliError("validation_error", "evidence before id must not be empty");
38243
38239
  const chatId = await storedChatId(messenger, chat, store, account, { includeLeft: true });
38244
- const page = await store.messages.messages(account, chatId, { limit, ...before2 === void 0 ? {} : { before: before2 } });
38240
+ const page = await store.messages.messages(account, chatId, { limit, ...before === void 0 ? {} : { before } });
38245
38241
  const items = page.items.toReversed();
38246
38242
  const packet = prepareEvidencePacket({
38247
38243
  kind: "chats",
@@ -38254,7 +38250,7 @@ var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, l
38254
38250
  return { ...packet, nextBeforeId: older && last ? last.id : null };
38255
38251
  }, "readEvidencePacket");
38256
38252
 
38257
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/meeting-project-discovery.js
38253
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/meeting-project-discovery.js
38258
38254
  var scopeKeys = [
38259
38255
  "accountId",
38260
38256
  "meetingId",
@@ -38276,7 +38272,7 @@ var optionKeys = /* @__PURE__ */ new Set([
38276
38272
  "maxVocabularyReadBytes"
38277
38273
  ]);
38278
38274
 
38279
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/text-model-choice.js
38275
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/text-model-choice.js
38280
38276
  import { createHash as createHash12 } from "node:crypto";
38281
38277
  import { existsSync as existsSync2 } from "node:fs";
38282
38278
  var useTextModel = /* @__PURE__ */ __name(async (id2, { env, command }) => {
@@ -38284,8 +38280,8 @@ var useTextModel = /* @__PURE__ */ __name(async (id2, { env, command }) => {
38284
38280
  if (!isTextModelInstalled(model, textModelsDirectory(env)))
38285
38281
  throw new CliError("not_found", `${model.id} is not downloaded \u2014 \`${command} models download ${model.id}\` first`, { reason: "model.not-downloaded", model: model.id });
38286
38282
  const previous = chosenTextModel(env).id;
38287
- const before2 = textModels(env).find((one) => one.id === previous);
38288
- const toEmbed = previous === model.id ? 0 : before2 ? await missingVectors(before2, model, env) : null;
38283
+ const before = textModels(env).find((one) => one.id === previous);
38284
+ const toEmbed = previous === model.id ? 0 : before ? await missingVectors(before, model, env) : null;
38289
38285
  writeTextModelsSection({ ...readTextModelsSection(env), use: model.id }, env);
38290
38286
  return {
38291
38287
  model,
@@ -38407,14 +38403,14 @@ var addCustomTextModel = /* @__PURE__ */ __name(async (id2, payload, { env, fetc
38407
38403
  return { ...checked2.output, custom: true };
38408
38404
  }, "addCustomTextModel");
38409
38405
 
38410
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/calendar/sync.js
38406
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/calendar/sync.js
38411
38407
  var DAY6 = 864e5;
38412
38408
  var SLOTS_EVERY = 7 * DAY6;
38413
38409
 
38414
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/calendar/feeds.js
38410
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/calendar/feeds.js
38415
38411
  var FEED_LIMITS = { maxBytes: 10 * 1024 * 1024, timeoutMs: 3e4, redirects: 5 };
38416
38412
 
38417
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/calendar/reads.js
38413
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/calendar/reads.js
38418
38414
  var LIST = "events list";
38419
38415
  var EVENT_TYPES = [
38420
38416
  "default",
@@ -38473,7 +38469,7 @@ var EVENTS_QUERY = {
38473
38469
  } : field)
38474
38470
  };
38475
38471
 
38476
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/calendar/writer.js
38472
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/calendar/writer.js
38477
38473
  var EVENTS_NOTIFY_KEY = "events.notify";
38478
38474
  var EVENTS_DELETE_SERIES_KEY = "events.delete.series";
38479
38475
  var EVENTS_REMIND_HOOK_KEY = "events.remind.hook";
@@ -38491,7 +38487,7 @@ var CALENDAR_WRITE_DEFAULTS = {
38491
38487
  [EVENTS_REMIND_HOOK_KEY]: "deny"
38492
38488
  };
38493
38489
 
38494
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/context/communication-selection.js
38490
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/context/communication-selection.js
38495
38491
  var communicationFields = {
38496
38492
  sources: pipe(array(strictObject({
38497
38493
  id: pipe(string(), regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)),
@@ -38514,16 +38510,16 @@ var communicationRequest = /* @__PURE__ */ __name((value, preparationAfter) => {
38514
38510
  const words3 = input.query.match(/[\p{L}\p{N}]+/gu) ?? [];
38515
38511
  if (Buffer.byteLength(input.query) > 2048 || !words3.length || words3.length > 16)
38516
38512
  throw new CliError("validation_error", "communications.query needs 1\u201316 literal words within 2048 UTF-8 bytes");
38517
- const before2 = input.before ?? preparationAfter;
38518
- const after = input.after ?? Math.max(0, before2 - 14 * 864e5);
38519
- if (before2 > preparationAfter || after >= before2 || before2 - after > 90 * 864e5)
38513
+ const before = input.before ?? preparationAfter;
38514
+ const after = input.after ?? Math.max(0, before - 14 * 864e5);
38515
+ if (before > preparationAfter || after >= before || before - after > 90 * 864e5)
38520
38516
  throw new CliError("validation_error", "communications window must be nonempty, span at most 90 days and end by preparation after");
38521
38517
  if (new Set(input.sources.map((s) => s.id)).size !== input.sources.length)
38522
38518
  throw new CliError("validation_error", "communications.sources must not repeat a selection");
38523
- return { ...input, after, before: before2 };
38519
+ return { ...input, after, before };
38524
38520
  }, "communicationRequest");
38525
38521
 
38526
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/meeting-preparation-validation.js
38522
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/meeting-preparation-validation.js
38527
38523
  var MEETING_PREPARATION_LIMITS = {
38528
38524
  meetings: { min: 1, max: 20, default: 5 },
38529
38525
  cues: { min: 1, max: 100, default: 10 },
@@ -38596,7 +38592,7 @@ var validateMeetingPreparationRequest = /* @__PURE__ */ __name((externalId, orig
38596
38592
  };
38597
38593
  }, "validateMeetingPreparationRequest");
38598
38594
 
38599
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/meeting-communications-selection.js
38595
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/meeting-communications-selection.js
38600
38596
  var validatePreparationCommunications = /* @__PURE__ */ __name((section, request, after) => {
38601
38597
  const fail2 = /* @__PURE__ */ __name(() => {
38602
38598
  throw new CliError("invalid_response", "Preparation communications returned another selection or invalid evidence");
@@ -38644,7 +38640,7 @@ var validatePreparationCommunications = /* @__PURE__ */ __name((section, request
38644
38640
  }
38645
38641
  }, "validatePreparationCommunications");
38646
38642
 
38647
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/package-upgrade.js
38643
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/package-upgrade.js
38648
38644
  var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageName, check: check2 }, ports) => {
38649
38645
  const installer = ports.installer();
38650
38646
  const argv = updateCommand(installer, packageName);
@@ -38676,9 +38672,9 @@ var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageNa
38676
38672
  const installed = await ports.installed?.();
38677
38673
  if (installed === void 0)
38678
38674
  return restart(result, ports);
38679
- const read = { ...result, installed };
38675
+ const read2 = { ...result, installed };
38680
38676
  if (!isNewer(latest2, installed))
38681
- return restart(read, ports);
38677
+ return restart(read2, ports);
38682
38678
  const heldBack = {
38683
38679
  // pnpm 11 resolves `@latest` to the newest version older than minimumReleaseAge, 1 day by default.
38684
38680
  until: installer === "pnpm" ? dayAfter(await ports.publishedAt?.(latest2)) : null,
@@ -38686,8 +38682,8 @@ var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageNa
38686
38682
  command: argv.map((word) => word === `${packageName}@latest` ? `${packageName}@${latest2}` : word).join(" ")
38687
38683
  };
38688
38684
  if (installed === current)
38689
- return { result: { ...read, heldBack }, reason: "held_back", left: [] };
38690
- return { ...await restart({ ...read, heldBack }, ports), reason: "held_back" };
38685
+ return { result: { ...read2, heldBack }, reason: "held_back", left: [] };
38686
+ return { ...await restart({ ...read2, heldBack }, ports), reason: "held_back" };
38691
38687
  }, "upgradePackage");
38692
38688
  var restart = /* @__PURE__ */ __name(async (result, ports) => {
38693
38689
  const servers = await ports.afterUpdate?.();
@@ -38709,7 +38705,7 @@ var dayAfter = /* @__PURE__ */ __name((published) => {
38709
38705
  return Number.isNaN(time) ? null : new Date(time + 24 * 60 * 60 * 1e3).toISOString();
38710
38706
  }, "dayAfter");
38711
38707
 
38712
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/index.js
38708
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/index.js
38713
38709
  var servicesFor = /* @__PURE__ */ __name((deps) => {
38714
38710
  const pictures = picturesService(deps);
38715
38711
  const base = {
@@ -38746,7 +38742,7 @@ var servicesFor = /* @__PURE__ */ __name((deps) => {
38746
38742
  return deps.messenger.services ? { ...base, ...deps.messenger.services(base, deps) } : base;
38747
38743
  }, "servicesFor");
38748
38744
 
38749
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/background/relay.js
38745
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/background/relay.js
38750
38746
  import { createHash as createHash13 } from "node:crypto";
38751
38747
  import { chmodSync, lstatSync, mkdirSync as mkdirSync6, rmSync as rmSync3 } from "node:fs";
38752
38748
  import { createConnection, createServer } from "node:net";
@@ -38967,7 +38963,7 @@ var relayCommand = /* @__PURE__ */ __name((path, request, options2) => new Promi
38967
38963
  }, () => finish({ error: stopped() }));
38968
38964
  }), "relayCommand");
38969
38965
 
38970
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-relay.js
38966
+ // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-relay.js
38971
38967
  var lentConnection = /* @__PURE__ */ __name((connection, watchers) => throughWrapper(connection, {
38972
38968
  close: /* @__PURE__ */ __name(async () => {
38973
38969
  }, "close"),
@@ -39097,7 +39093,8 @@ export {
39097
39093
  BUILT_IN_PURPOSES,
39098
39094
  purposeList,
39099
39095
  gatherStoredProject,
39100
- validateMediaSince,
39096
+ momentOf,
39097
+ dateWindow,
39101
39098
  checkMediaArchive,
39102
39099
  archiveMedia,
39103
39100
  moveMediaArchive,
@@ -39109,9 +39106,6 @@ export {
39109
39106
  sendTime,
39110
39107
  readMail,
39111
39108
  prepareLucene,
39112
- momentOf,
39113
- aheadOf,
39114
- dateWindow,
39115
39109
  RANKING_SELECTION_BYTES,
39116
39110
  readRankingSelection,
39117
39111
  isAdminSelection,
@@ -39263,8 +39257,10 @@ export {
39263
39257
  lentConnection,
39264
39258
  serveRelay,
39265
39259
  positiveCount,
39260
+ configuredLimit,
39266
39261
  withPaging,
39267
39262
  window,
39263
+ pagingOf,
39268
39264
  chatRef,
39269
39265
  chatAnswer,
39270
39266
  memberAnswer,