@wirecat/drive-cli 0.51.0 → 0.52.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 (144) hide show
  1. package/dist/bin/drive.js +2 -2
  2. package/dist/bundle/{all-profiles-H3APJWSO.js → all-profiles-CYW6XBBS.js} +8 -8
  3. package/dist/bundle/{anthropic-P7DXFYFE.js → anthropic-KW6KU36Y.js} +5 -5
  4. package/dist/bundle/{app-server-IQUR7ZC2.js → app-server-TCJZ333E.js} +53 -52
  5. package/dist/bundle/{bun-LZUEW2ML.js → bun-7SYKSCLA.js} +2 -2
  6. package/dist/bundle/{bun-sqlite-6LUE7UA6.js → bun-sqlite-RI7DR6RZ.js} +4 -4
  7. package/dist/bundle/{chunk-7ZNM6KXP.js → chunk-234MHU76.js} +7 -7
  8. package/dist/bundle/{chunk-U7DPS46V.js → chunk-2623YE5I.js} +107 -96
  9. package/dist/bundle/{chunk-UW7VXKKZ.js → chunk-2AUXBJRX.js} +19 -19
  10. package/dist/bundle/{chunk-OQVJQSEH.js → chunk-2UIMEMWU.js} +3 -3
  11. package/dist/bundle/{chunk-NO34DAIB.js → chunk-33NVQGUY.js} +6 -6
  12. package/dist/bundle/{chunk-D3UFQC7K.js → chunk-43QVYW3K.js} +49 -49
  13. package/dist/bundle/{chunk-WX2NQO2D.js → chunk-4A2PIGC6.js} +1 -1
  14. package/dist/bundle/{chunk-D222O57O.js → chunk-4CPLOMRK.js} +6 -6
  15. package/dist/bundle/{chunk-U3OS6V6S.js → chunk-4Z6TCU5T.js} +1 -1
  16. package/dist/bundle/{chunk-POFLDSTX.js → chunk-54O62JWP.js} +10 -10
  17. package/dist/bundle/{chunk-HBRTKJ3J.js → chunk-5PLJKSG4.js} +7 -7
  18. package/dist/bundle/{chunk-PRBPVOW4.js → chunk-6DHQTUB2.js} +1 -1
  19. package/dist/bundle/{chunk-BVDAP3FQ.js → chunk-725OHXKR.js} +9 -9
  20. package/dist/bundle/chunk-7SH4JHYW.js +379 -0
  21. package/dist/bundle/{chunk-FCZ762RV.js → chunk-7XKAVMCF.js} +8 -8
  22. package/dist/bundle/{chunk-PNUS224S.js → chunk-7YMDL4JQ.js} +8 -6
  23. package/dist/bundle/{chunk-FV5WG4WU.js → chunk-A4UNTWAX.js} +29 -25
  24. package/dist/bundle/{chunk-I7EP3VPJ.js → chunk-ALJWBGD5.js} +1 -1
  25. package/dist/bundle/{chunk-CX7HQ6KK.js → chunk-BSSCTWWK.js} +12 -12
  26. package/dist/bundle/{chunk-HYT3FJVB.js → chunk-C6Z25IBJ.js} +49 -24
  27. package/dist/bundle/{chunk-XCXUP76D.js → chunk-CB7SBYLO.js} +27 -27
  28. package/dist/bundle/{chunk-YXHMEFL7.js → chunk-CITFEQ6S.js} +1 -1
  29. package/dist/bundle/{chunk-Y73IZWRI.js → chunk-CKBHR7QO.js} +1 -1
  30. package/dist/bundle/{chunk-AKW5MNQP.js → chunk-CM7GAXGD.js} +5 -5
  31. package/dist/bundle/{chunk-OKSS7YUN.js → chunk-DLAFGSTN.js} +1 -1
  32. package/dist/bundle/{chunk-MPTD5P53.js → chunk-DO4PDQY5.js} +2 -2
  33. package/dist/bundle/{chunk-P3T2SZW2.js → chunk-DW46P2DY.js} +1 -1
  34. package/dist/bundle/{chunk-ZKAAFY4C.js → chunk-F7UUZATI.js} +11 -11
  35. package/dist/bundle/{chunk-XBENRRBS.js → chunk-FCJAHD4R.js} +2 -2
  36. package/dist/bundle/{chunk-5C7RKU7O.js → chunk-FDWYPONW.js} +46 -34
  37. package/dist/bundle/{chunk-TVJU245P.js → chunk-FG4XXZZE.js} +2 -2
  38. package/dist/bundle/{chunk-BMI5VCR4.js → chunk-FJW3DDCF.js} +5 -5
  39. package/dist/bundle/{chunk-LZKPT7GY.js → chunk-G6QF5KWF.js} +35 -35
  40. package/dist/bundle/{chunk-K6JSVXDN.js → chunk-G7DCVJ4F.js} +5 -5
  41. package/dist/bundle/{chunk-Q5CLTK5R.js → chunk-GR5GGZKH.js} +3 -3
  42. package/dist/bundle/{chunk-SZWQFR5X.js → chunk-GVCN3GLZ.js} +16 -4
  43. package/dist/bundle/{chunk-CT6Z6Z64.js → chunk-H47W2J6S.js} +523 -778
  44. package/dist/bundle/{chunk-HGWMX7BM.js → chunk-HQVJK5E7.js} +44 -22
  45. package/dist/bundle/{chunk-35IHF562.js → chunk-HX7Y2ASG.js} +350 -281
  46. package/dist/bundle/{chunk-7LYVWMKD.js → chunk-I7UH5CTA.js} +8 -8
  47. package/dist/bundle/{chunk-YVQJPLPU.js → chunk-IDUNJCFO.js} +2 -2
  48. package/dist/bundle/{chunk-6FXFYXTR.js → chunk-IWFBAWZK.js} +15 -15
  49. package/dist/bundle/{chunk-3KTDFSSK.js → chunk-JEOYFKUK.js} +2 -2
  50. package/dist/bundle/{chunk-4GFAOETW.js → chunk-KYVXMEBC.js} +3 -3
  51. package/dist/bundle/{chunk-PT6XDCOY.js → chunk-LJAX6YCF.js} +2 -2
  52. package/dist/bundle/{chunk-XXLTVVMT.js → chunk-LONV6HIK.js} +20 -20
  53. package/dist/bundle/{chunk-G75FZQAZ.js → chunk-NHBUTCNR.js} +10 -10
  54. package/dist/bundle/{chunk-OASIFIXM.js → chunk-NPSZPUK6.js} +2 -2
  55. package/dist/bundle/{chunk-Z3GWVRW3.js → chunk-NSIFQ5OP.js} +1 -1
  56. package/dist/bundle/{chunk-TSZJXI4N.js → chunk-O6IOL6RX.js} +21 -21
  57. package/dist/bundle/{chunk-YLC4JVQZ.js → chunk-PAXKALHV.js} +5 -5
  58. package/dist/bundle/{chunk-AUW45JPI.js → chunk-PDGECM5D.js} +7 -7
  59. package/dist/bundle/{chunk-NRWDEBJB.js → chunk-PEOCBV2Z.js} +8 -8
  60. package/dist/bundle/{chunk-VCPS7Q2W.js → chunk-PQJYM5ES.js} +3 -3
  61. package/dist/bundle/{chunk-TEH76MZK.js → chunk-PQYVPCJ2.js} +26 -26
  62. package/dist/bundle/{chunk-WYWXOIGT.js → chunk-PSNHPFSK.js} +1 -1
  63. package/dist/bundle/{chunk-Y4YBW5S4.js → chunk-Q765VPZY.js} +2 -2
  64. package/dist/bundle/{chunk-YOABRW2M.js → chunk-R276546S.js} +1 -1
  65. package/dist/bundle/{chunk-SRIPLP7N.js → chunk-RNSP57TC.js} +4 -4
  66. package/dist/bundle/{chunk-WACVI3CS.js → chunk-UC22Q5KU.js} +11 -11
  67. package/dist/bundle/{chunk-VH4GVA2N.js → chunk-UR32UWTQ.js} +2 -2
  68. package/dist/bundle/{chunk-Z6KTSXE3.js → chunk-VJZST5RD.js} +2 -2
  69. package/dist/bundle/{chunk-LLMHJE5Q.js → chunk-VSOLLTYT.js} +2 -2
  70. package/dist/bundle/{chunk-PQGIV36R.js → chunk-VZ2I62HN.js} +2 -2
  71. package/dist/bundle/{chunk-DEVPGI27.js → chunk-W7IK7E4B.js} +17 -17
  72. package/dist/bundle/{chunk-NVHPYKYC.js → chunk-WBTVGFXI.js} +11 -11
  73. package/dist/bundle/{chunk-2TPENYCK.js → chunk-WLFUBNFX.js} +4 -4
  74. package/dist/bundle/{chunk-SRONUWOM.js → chunk-WQJBAWQP.js} +515 -344
  75. package/dist/bundle/{chunk-K3EK4MTU.js → chunk-WQRGA75U.js} +15 -3
  76. package/dist/bundle/{chunk-XE2GEE3E.js → chunk-WUX7AUOQ.js} +26 -26
  77. package/dist/bundle/{chunk-J2S7QDOP.js → chunk-X6ID5EAR.js} +16 -16
  78. package/dist/bundle/{chunk-JI5KFKTL.js → chunk-XOLQSCMF.js} +6 -6
  79. package/dist/bundle/{chunk-EY4CUQW2.js → chunk-YKZ4IPLB.js} +26 -9
  80. package/dist/bundle/{chunk-GK2VUKQY.js → chunk-YNFELLNQ.js} +2 -2
  81. package/dist/bundle/{chunk-F3PPSIKI.js → chunk-YVPHJHIL.js} +3 -3
  82. package/dist/bundle/{chunk-4YG2FZ53.js → chunk-Z47LOJUS.js} +7 -7
  83. package/dist/bundle/{chunk-DDD3FS6G.js → chunk-ZDLIO76S.js} +2 -2
  84. package/dist/bundle/{chunk-UMY4IQE2.js → chunk-ZNZUZGSV.js} +54 -47
  85. package/dist/bundle/{chunk-UM4E2OFL.js → chunk-ZSXRDF6I.js} +1 -1
  86. package/dist/bundle/{chunk-N33EOINW.js → chunk-ZWSG7OCA.js} +4 -4
  87. package/dist/bundle/command-contract-I2YB5IXI.js +38 -0
  88. package/dist/bundle/{decode-4EENADOV.js → decode-EDN2ARXZ.js} +19 -17
  89. package/dist/bundle/drive.js +7 -7
  90. package/dist/bundle/{echarts-ZFC37XW7.js → echarts-GXY34GHA.js} +2 -2
  91. package/dist/bundle/{embed-UZMNP26C.js → embed-3GSQIQXE.js} +5 -5
  92. package/dist/bundle/{embedder-7VDWDBKF.js → embedder-6ULWRG3R.js} +8 -8
  93. package/dist/bundle/{entry-JJKCHVIK.js → entry-IPRJLFHO.js} +6 -6
  94. package/dist/bundle/failure-4CVEVY45.js +37 -0
  95. package/dist/bundle/{first-run-FJTEUJBF.js → first-run-FGHGWHC2.js} +9 -9
  96. package/dist/bundle/first-screen-M62KTPZG.js +36 -0
  97. package/dist/bundle/{google-JBJASYKY.js → google-BD3ZNFVJ.js} +9 -9
  98. package/dist/bundle/google-api-BDUWZMRV.js +83 -0
  99. package/dist/bundle/{identity-XE73ALJH.js → identity-QLBSASO5.js} +2 -2
  100. package/dist/bundle/{instructions-Q4ASITKO.js → instructions-K5BEQM4C.js} +1 -1
  101. package/dist/bundle/{login-BD2WQT5F.js → login-VNZKRSAD.js} +65 -64
  102. package/dist/bundle/{mcp-G6U2Q63E.js → mcp-5SNSMI2M.js} +82 -81
  103. package/dist/bundle/mcp-JZSYPQA4.js +96 -0
  104. package/dist/bundle/{mcp-ZYZ4DFW2.js → mcp-WSGVVZWI.js} +2 -2
  105. package/dist/bundle/{node-CYM7VXFR.js → node-ZYWB7IET.js} +2 -2
  106. package/dist/bundle/{node-sqlite-RK4MHW57.js → node-sqlite-J3OODPYK.js} +4 -4
  107. package/dist/bundle/{oauth-CQXQRHJR.js → oauth-L4VTCBLF.js} +6 -6
  108. package/dist/bundle/{open-WSE4NBD2.js → open-SGUN7ZVF.js} +3 -3
  109. package/dist/bundle/openai-RLVISEDH.js +251 -0
  110. package/dist/bundle/{process-7HHZZZLA.js → process-ZXO2MWRJ.js} +1 -1
  111. package/dist/bundle/{program-ZMQYZNV5.js → program-6S5EH7BS.js} +103 -101
  112. package/dist/bundle/{prompt-YSBBQJGF.js → prompt-AUWTBLO7.js} +4 -4
  113. package/dist/bundle/{reasons-366PI7OV.js → reasons-M5AKCNCU.js} +3 -3
  114. package/dist/bundle/{recognize-AZKGPCAS.js → recognize-ORX2UBQW.js} +5 -3
  115. package/dist/bundle/{remote-EYSK3XKD.js → remote-AGIJY73X.js} +6 -6
  116. package/dist/bundle/{rerank-LOW6VIDF.js → rerank-R6PE44M5.js} +6 -6
  117. package/dist/bundle/{serve-UJ52HGA7.js → serve-VOBAQHAQ.js} +8 -8
  118. package/dist/bundle/server-24PS4M7U.js +70 -0
  119. package/dist/bundle/server-G6HFZ2CK.js +57 -0
  120. package/dist/bundle/{services-B4QUSCFN.js → services-HZFTTZSF.js} +35 -28
  121. package/dist/bundle/{sqlite-runtime-GEURBVK5.js → sqlite-runtime-DTGPR2T2.js} +4 -4
  122. package/dist/bundle/{state-OJNSKOXO.js → state-WG3JKJM3.js} +5 -5
  123. package/dist/bundle/{store-62SBP45X.js → store-33VHIMEO.js} +14 -14
  124. package/dist/bundle/{store-FTS2HVVB.js → store-EV72MT5U.js} +16 -16
  125. package/dist/bundle/store-maintenance-command-ZTUEI4EC.js +58 -0
  126. package/dist/bundle/tokens-XDQXUFDQ.js +104 -0
  127. package/dist/knowledge-query.d.ts +1 -1
  128. package/dist/store.d.ts.map +1 -1
  129. package/dist/store.js +1 -0
  130. package/dist/store.js.map +1 -1
  131. package/dist/version.d.ts +1 -1
  132. package/dist/version.js +1 -1
  133. package/package.json +3 -3
  134. package/dist/bundle/command-contract-R6CGYG7L.js +0 -38
  135. package/dist/bundle/failure-VBQBKCD5.js +0 -37
  136. package/dist/bundle/first-screen-NSPQWNMQ.js +0 -36
  137. package/dist/bundle/google-api-2FKF4UUN.js +0 -82
  138. package/dist/bundle/mcp-H3XD47NW.js +0 -95
  139. package/dist/bundle/server-CA2VLY25.js +0 -56
  140. package/dist/bundle/server-TW75RDEP.js +0 -69
  141. package/dist/bundle/store-maintenance-command-FQMB3R4E.js +0 -57
  142. package/dist/bundle/tokens-JALZUGEM.js +0 -103
  143. /package/dist/bundle/{chunk-2WNDZFGG.js → chunk-62EDJKGP.js} +0 -0
  144. /package/dist/bundle/{chunk-UO5O3665.js → chunk-FQRJWVEB.js} +0 -0
@@ -7,7 +7,15 @@ import {
7
7
  engineMissing,
8
8
  extractText,
9
9
  importEngine
10
- } from "./chunk-XE2GEE3E.js";
10
+ } from "./chunk-WUX7AUOQ.js";
11
+ import {
12
+ acquireLock,
13
+ openOrdinaryFile,
14
+ readBoundedUtf8File,
15
+ sameOrdinaryFile,
16
+ syncDirectory,
17
+ writeFileAtomic
18
+ } from "./chunk-7SH4JHYW.js";
11
19
  import {
12
20
  MAX_ACTIONS,
13
21
  ModerationRules,
@@ -23,7 +31,7 @@ import {
23
31
  someUndone,
24
32
  validateFormattedText,
25
33
  visibleFormattedText
26
- } from "./chunk-4YG2FZ53.js";
34
+ } from "./chunk-Z47LOJUS.js";
27
35
  import {
28
36
  DEFAULT_IMAGE_MODEL,
29
37
  DEFAULT_RERANK_MODEL,
@@ -50,23 +58,23 @@ import {
50
58
  typedCommand,
51
59
  vectorModelKey,
52
60
  withAttempt
53
- } from "./chunk-XXLTVVMT.js";
61
+ } from "./chunk-LONV6HIK.js";
54
62
  import {
55
63
  isCliFailure
56
- } from "./chunk-LLMHJE5Q.js";
64
+ } from "./chunk-VSOLLTYT.js";
57
65
  import {
58
66
  isNewer,
59
67
  updateCommand
60
- } from "./chunk-PNUS224S.js";
68
+ } from "./chunk-7YMDL4JQ.js";
61
69
  import {
62
70
  MAX_MODEL_IMAGE_BYTES
63
- } from "./chunk-PQGIV36R.js";
71
+ } from "./chunk-VZ2I62HN.js";
64
72
  import {
65
73
  OPENAI_URL,
66
74
  openRemote,
67
75
  remoteKey,
68
76
  remoteModel
69
- } from "./chunk-OQVJQSEH.js";
77
+ } from "./chunk-2UIMEMWU.js";
70
78
  import {
71
79
  defaultThreads,
72
80
  installNativeRuntime,
@@ -75,11 +83,11 @@ import {
75
83
  placedText,
76
84
  runEmbedders,
77
85
  textModelsDirectory
78
- } from "./chunk-AKW5MNQP.js";
86
+ } from "./chunk-CM7GAXGD.js";
79
87
  import {
80
88
  installFiles,
81
89
  megabytes
82
- } from "./chunk-CX7HQ6KK.js";
90
+ } from "./chunk-BSSCTWWK.js";
83
91
  import {
84
92
  AGENDA_COLUMNS,
85
93
  CHAT_COLUMNS,
@@ -133,12 +141,12 @@ import {
133
141
  threadConversation,
134
142
  validateAst,
135
143
  validateFields
136
- } from "./chunk-SRONUWOM.js";
144
+ } from "./chunk-WQJBAWQP.js";
137
145
  import {
138
146
  MAX_TEXT_CHARS,
139
147
  attachmentMaxBytes,
140
148
  pdfPreviewLimits
141
- } from "./chunk-3KTDFSSK.js";
149
+ } from "./chunk-JEOYFKUK.js";
142
150
  import {
143
151
  COUNTER_FIELDS,
144
152
  INTERNAL_NOTES,
@@ -157,13 +165,13 @@ import {
157
165
  parseReference,
158
166
  providerNamed,
159
167
  rankingOptions
160
- } from "./chunk-7ZNM6KXP.js";
168
+ } from "./chunk-234MHU76.js";
161
169
  import {
162
170
  TASK_KINDS,
163
171
  TASK_ORIGINS,
164
172
  TASK_STATES,
165
173
  createTaskService
166
- } from "./chunk-AUW45JPI.js";
174
+ } from "./chunk-PDGECM5D.js";
167
175
  import {
168
176
  MEETING_FINDINGS_KIND,
169
177
  canonicalMeetingReference,
@@ -182,7 +190,7 @@ import {
182
190
  validateMeetingHitSearch,
183
191
  validateMeetingPassage,
184
192
  validateMeetingSeriesHistory
185
- } from "./chunk-UMY4IQE2.js";
193
+ } from "./chunk-ZNZUZGSV.js";
186
194
  import {
187
195
  dateRange,
188
196
  implicitTextTerms,
@@ -192,25 +200,25 @@ import {
192
200
  timezoneOf,
193
201
  validateQuery,
194
202
  walkQuery
195
- } from "./chunk-G75FZQAZ.js";
203
+ } from "./chunk-NHBUTCNR.js";
196
204
  import {
197
205
  DEFAULT_STEMMERS,
198
206
  createStemmer,
199
207
  fold,
200
208
  normalize
201
- } from "./chunk-FCZ762RV.js";
209
+ } from "./chunk-7XKAVMCF.js";
202
210
  import {
203
211
  DEFAULT_TASK_CATEGORIES,
204
212
  FALLBACK_CATEGORY
205
- } from "./chunk-JI5KFKTL.js";
213
+ } from "./chunk-XOLQSCMF.js";
206
214
  import {
207
215
  storePath,
208
216
  wirecatDirectory
209
- } from "./chunk-Z6KTSXE3.js";
217
+ } from "./chunk-VJZST5RD.js";
210
218
  import {
211
219
  resolvePaths,
212
220
  singleLine
213
- } from "./chunk-HGWMX7BM.js";
221
+ } from "./chunk-HQVJK5E7.js";
214
222
  import {
215
223
  CliError,
216
224
  array,
@@ -226,12 +234,12 @@ import {
226
234
  safeParse,
227
235
  strictObject,
228
236
  string
229
- } from "./chunk-EY4CUQW2.js";
237
+ } from "./chunk-YKZ4IPLB.js";
230
238
  import {
231
239
  __name
232
240
  } from "./chunk-ZVVMGPBJ.js";
233
241
 
234
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/deps.js
242
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/deps.js
235
243
  var accountStore = /* @__PURE__ */ __name(async (deps) => (await deps.store()).forAccount(await deps.account()), "accountStore");
236
244
  var crossAccount = /* @__PURE__ */ __name((deps, _reason) => deps.store(), "crossAccount");
237
245
  var NO_LOCAL_STORE = "this answer comes from the messenger, not from the local store";
@@ -309,7 +317,7 @@ var storeOnlyDeps = /* @__PURE__ */ __name((store, account2, { app, env }) => {
309
317
  return { ...storedDeps(messenger, store, account2, guard), ...env === void 0 ? {} : { env } };
310
318
  }, "storeOnlyDeps");
311
319
 
312
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/botcheck/check.js
320
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/botcheck/check.js
313
321
  var DAY_MS = 864e5;
314
322
  var NEW_DAYS = 30;
315
323
  var SAME_TEXT_MIN = 20;
@@ -386,7 +394,7 @@ var scorePerson = /* @__PURE__ */ __name(({ subject, provider, activity, photos,
386
394
  };
387
395
  }, "scorePerson");
388
396
 
389
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/botcheck/registries.js
397
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/botcheck/registries.js
390
398
  var REGISTRIES = {
391
399
  cas: { title: "Combot Anti-Spam (CAS)", docs: "https://cas.chat/api" },
392
400
  lols: { title: "lols.bot", docs: "https://api.lols.bot/lols-bot.json" }
@@ -471,7 +479,7 @@ var notCovered = /* @__PURE__ */ __name((messenger, now = /* @__PURE__ */ new Da
471
479
  detail: `lists Telegram accounts only, not ${messenger} ones`
472
480
  })), "notCovered");
473
481
 
474
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/botcheck/service.js
482
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/botcheck/service.js
475
483
  var ACTIVITY_MESSAGES = 1e3;
476
484
  var botCheckService = /* @__PURE__ */ __name((deps) => {
477
485
  const subjectOf = /* @__PURE__ */ __name(async (reference) => {
@@ -559,7 +567,33 @@ var botCheckService = /* @__PURE__ */ __name((deps) => {
559
567
  };
560
568
  }, "botCheckService");
561
569
 
562
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/context/evidence-response.js
570
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/chat-coverage.js
571
+ var chatCoverage = /* @__PURE__ */ __name(async (store, account2, chatIds) => {
572
+ const ids = [...new Set(chatIds)];
573
+ if (ids.length === 0)
574
+ return [];
575
+ const found = new Map((await store.chats.chatCompleteness(account2, ids)).map((one) => [one.chatId, one]));
576
+ return Promise.all(ids.map(async (chatId) => {
577
+ const [stats] = await store.chats.chatStats(account2, chatId);
578
+ const title = stats?.title ?? await store.chats.chatTitle(account2, chatId);
579
+ const completeness = found.get(chatId) ?? {
580
+ chatId,
581
+ state: "unknown",
582
+ upToDate: null,
583
+ gaps: false,
584
+ reachesStart: false,
585
+ fetchedAt: null
586
+ };
587
+ return {
588
+ chatId,
589
+ title,
590
+ completeness,
591
+ held: { messages: stats?.messages ?? 0, oldestAt: stats?.oldestAt ?? null, newestAt: stats?.newestAt ?? null }
592
+ };
593
+ }));
594
+ }, "chatCoverage");
595
+
596
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/context/evidence-response.js
563
597
  var contextSourceKey = /* @__PURE__ */ __name((source) => JSON.stringify([source.kind, source.accountId, source.provider, source.account]), "contextSourceKey");
564
598
  var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
565
599
  const fail3 = /* @__PURE__ */ __name(() => {
@@ -623,7 +657,7 @@ var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
623
657
  }
624
658
  }, "validateContextEvidencePage");
625
659
 
626
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/context/read-budget.js
660
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/context/read-budget.js
627
661
  var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
628
662
  if (!limits || typeof limits !== "object" || Array.isArray(limits))
629
663
  throw new CliError("validation_error", "limits needs a context read allowance");
@@ -676,7 +710,7 @@ var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
676
710
  };
677
711
  }, "contextReadBudget");
678
712
 
679
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/context-evidence.js
713
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/context-evidence.js
680
714
  var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits) => {
681
715
  if (!port || typeof port.read !== "function")
682
716
  throw new CliError("configuration_error", "context evidence reader is unavailable");
@@ -720,7 +754,7 @@ var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits)
720
754
  };
721
755
  }, "createContextEvidenceReader");
722
756
 
723
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/excerpt.js
757
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/excerpt.js
724
758
  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");
725
759
  var excerpt = /* @__PURE__ */ __name((text2, query, size4 = 240, options = {}) => {
726
760
  const flat = text2.replace(/\s+/g, " ").trim();
@@ -736,380 +770,18 @@ var excerpt = /* @__PURE__ */ __name((text2, query, size4 = 240, options = {}) =
736
770
  }, "excerpt");
737
771
  var withExcerpt = /* @__PURE__ */ __name(({ matchedText, ...hit }, query) => ({ ...hit, excerpt: excerpt(matchedText ?? hit.text, query) }), "withExcerpt");
738
772
 
739
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/media-archive.js
773
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/media-archive.js
740
774
  import { setTimeout as sleep } from "node:timers/promises";
741
775
 
742
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
743
- import { lstat as lstat4 } from "node:fs/promises";
744
-
745
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
746
- import { createHash as createHash2, randomUUID as randomUUID4 } from "node:crypto";
747
- import { open as open5, rename as rename3, unlink as unlink6 } from "node:fs/promises";
748
- import { join as join5 } from "node:path";
749
-
750
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/files/atomic-write.js
751
- import { randomUUID } from "node:crypto";
752
- import { constants } from "node:fs";
753
- import { link, open, realpath, rename, unlink } from "node:fs/promises";
754
- import { basename, dirname, join } from "node:path";
755
- var openFolder = /* @__PURE__ */ __name((folder) => process.platform === "win32" ? Promise.resolve(void 0) : open(folder, constants.O_RDONLY | (constants.O_DIRECTORY ?? 0) | (constants.O_NOFOLLOW ?? 0)), "openFolder");
756
- var writeFileAtomic = /* @__PURE__ */ __name(async (path, content, { mode = 384, overwrite = true, signal, beforePublish } = {}) => {
757
- signal?.throwIfAborted();
758
- const folder = await realpath(dirname(path));
759
- const target = join(folder, basename(path));
760
- const directory = await openFolder(folder);
761
- try {
762
- const temporary = join(folder, `.${basename(path)}.${randomUUID()}.tmp`);
763
- let handle = await open(temporary, "wx", mode);
764
- let published = false;
765
- try {
766
- await handle.writeFile(content);
767
- await handle.sync();
768
- await handle.close();
769
- handle = void 0;
770
- signal?.throwIfAborted();
771
- await beforePublish?.();
772
- if (overwrite)
773
- await rename(temporary, target);
774
- else
775
- await link(temporary, target);
776
- published = overwrite;
777
- await directory?.sync();
778
- } finally {
779
- await handle?.close().catch(() => void 0);
780
- if (!published)
781
- await unlink(temporary).catch(() => void 0);
782
- }
783
- } finally {
784
- await directory?.close().catch(() => void 0);
785
- }
786
- }, "writeFileAtomic");
787
-
788
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/files/ordinary-file.js
789
- import { constants as constants2 } from "node:fs";
790
- import { lstat, open as open2 } from "node:fs/promises";
791
- var deviceOf = /* @__PURE__ */ __name((dev) => process.platform === "win32" ? BigInt.asUintN(32, dev) : dev, "deviceOf");
792
- var sameIdentity = /* @__PURE__ */ __name((left, right) => left.ino === right.ino && deviceOf(left.dev) === deviceOf(right.dev), "sameIdentity");
793
- var openOrdinaryFile = /* @__PURE__ */ __name(async (path, options = {}) => {
794
- const before2 = await lstat(path, { bigint: true });
795
- if (before2.isSymbolicLink())
796
- throw new CliError("validation_error", "archive path must be an ordinary file without a symlink");
797
- if (!before2.isFile())
798
- throw new CliError("validation_error", "archive path must be an ordinary file");
799
- const access = options.writable ? constants2.O_RDWR : constants2.O_RDONLY;
800
- const flags = process.platform === "win32" ? access : access | (constants2.O_NOFOLLOW ?? 0) | (constants2.O_NONBLOCK ?? 0);
801
- const file = await open2(path, flags);
802
- try {
803
- const opened = await file.stat({ bigint: true });
804
- const after = await lstat(path, { bigint: true });
805
- if (!opened.isFile() || !after.isFile() || before2.ino !== opened.ino || before2.ino !== after.ino)
806
- throw new CliError("validation_error", "archive file changed while opening");
807
- if (process.platform === "win32" && before2.dev === 0n && after.dev === 0n) {
808
- const witness = await open2(path, flags);
809
- try {
810
- const identified = await witness.stat({ bigint: true });
811
- const final = await lstat(path, { bigint: true });
812
- if (opened.dev === 0n || !identified.isFile() || !final.isFile() || !sameIdentity(identified, opened) || final.ino !== before2.ino || final.dev !== 0n && deviceOf(final.dev) !== deviceOf(opened.dev))
813
- throw new CliError("validation_error", "archive file changed while opening");
814
- } finally {
815
- await witness.close();
816
- }
817
- } else if (deviceOf(before2.dev) !== deviceOf(opened.dev) || deviceOf(before2.dev) !== deviceOf(after.dev)) {
818
- throw new CliError("validation_error", "archive file changed while opening");
819
- }
820
- return file;
821
- } catch (error) {
822
- await file.close();
823
- throw error;
824
- }
825
- }, "openOrdinaryFile");
826
- var sameOrdinaryFile = /* @__PURE__ */ __name(async (path, created) => {
827
- let file;
828
- try {
829
- file = await openOrdinaryFile(path);
830
- } catch (error) {
831
- if (error instanceof CliError || typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT")
832
- return false;
833
- throw error;
834
- }
835
- try {
836
- return sameIdentity(created, await file.stat({ bigint: true }));
837
- } finally {
838
- await file.close();
839
- }
840
- }, "sameOrdinaryFile");
841
- var syncDirectory = /* @__PURE__ */ __name(async (path) => {
842
- if (process.platform === "win32")
843
- return;
844
- const directory = await open2(path, constants2.O_RDONLY | (constants2.O_DIRECTORY ?? 0) | (constants2.O_NOFOLLOW ?? 0));
845
- try {
846
- if (!(await directory.stat()).isDirectory())
847
- throw new CliError("validation_error", "archive publication directory must be ordinary");
848
- await directory.sync();
849
- } finally {
850
- await directory.close();
851
- }
852
- }, "syncDirectory");
853
-
854
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/files/bounded-utf8.js
855
- var readBoundedUtf8File = /* @__PURE__ */ __name(async (path, { maxBytes }) => {
856
- if (!Number.isSafeInteger(maxBytes) || maxBytes < 1 || maxBytes > 16 * 1024 * 1024)
857
- throw new CliError("validation_error", "file maxBytes takes 1\u201316777216 bytes");
858
- const file = await openOrdinaryFile(path);
859
- try {
860
- if ((await file.stat()).size > maxBytes)
861
- throw new CliError("validation_error", "input file exceeds its byte budget");
862
- const chunks = [], buffer = Buffer.alloc(Math.min(65536, maxBytes + 1));
863
- let bytes2 = 0;
864
- for (; ; ) {
865
- const { bytesRead } = await file.read(buffer, 0, Math.min(buffer.length, maxBytes - bytes2 + 1), null);
866
- if (bytesRead === 0)
867
- break;
868
- bytes2 += bytesRead;
869
- if (bytes2 > maxBytes)
870
- throw new CliError("validation_error", "input file exceeds its byte budget");
871
- chunks.push(Buffer.from(buffer.subarray(0, bytesRead)));
872
- }
873
- try {
874
- return new TextDecoder("utf-8", { fatal: true }).decode(Buffer.concat(chunks, bytes2));
875
- } catch {
876
- throw new CliError("validation_error", "input file must contain valid UTF-8");
877
- }
878
- } finally {
879
- await file.close();
880
- }
881
- }, "readBoundedUtf8File");
882
-
883
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/files/lock.js
884
- import { mkdir as mkdir2 } from "node:fs/promises";
885
- import { basename as basename2, dirname as dirname2 } from "node:path";
776
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
777
+ import { lstat } from "node:fs/promises";
886
778
 
887
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/files/native-writer-lease.js
888
- import { randomUUID as randomUUID2 } from "node:crypto";
889
- import { lstat as lstat3, mkdir, open as open3, realpath as realpath3, rmdir as rmdir2, unlink as unlink4 } from "node:fs/promises";
890
- import { hostname as hostname2 } from "node:os";
891
- import { join as join3 } from "node:path";
892
-
893
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/files/native-lease-inspection.js
894
- import { lstat as lstat2, readdir, realpath as realpath2, unlink as unlink2 } from "node:fs/promises";
779
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
780
+ import { createHash as createHash2, randomUUID as randomUUID2 } from "node:crypto";
781
+ import { open as open2, rename as rename2, unlink as unlink2 } from "node:fs/promises";
895
782
  import { join as join2 } from "node:path";
896
783
 
897
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/files/native-lease-owner.js
898
- import { hostname } from "node:os";
899
- var missingLeaseFile = /* @__PURE__ */ __name((error) => typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT", "missingLeaseFile");
900
- var readLeaseOwner = /* @__PURE__ */ __name(async (path, name, signal) => {
901
- signal?.throwIfAborted();
902
- try {
903
- const file = await openOrdinaryFile(path);
904
- try {
905
- if ((await file.stat()).size > 4096)
906
- return null;
907
- const buffer = Buffer.alloc(4097);
908
- let size4 = 0;
909
- while (size4 < buffer.length) {
910
- signal?.throwIfAborted();
911
- const { bytesRead } = await file.read(buffer, size4, buffer.length - size4, size4);
912
- if (bytesRead === 0)
913
- break;
914
- size4 += bytesRead;
915
- }
916
- signal?.throwIfAborted();
917
- if (size4 > 4096)
918
- return null;
919
- const owner = JSON.parse(buffer.subarray(0, size4).toString("utf8"));
920
- if (owner?.version !== 1 || !Number.isSafeInteger(owner.pid) || owner.pid <= 0 || typeof owner.host !== "string" || !owner.host.trim() || !/^[a-f0-9-]{36}$/.test(owner.nonce) || name !== `${owner.pid}-${owner.nonce}.json`)
921
- return null;
922
- return owner;
923
- } finally {
924
- await file.close();
925
- }
926
- } catch {
927
- signal?.throwIfAborted();
928
- return null;
929
- }
930
- }, "readLeaseOwner");
931
- var leaseOwnerStatus = /* @__PURE__ */ __name((owner) => {
932
- if (owner.host !== hostname())
933
- return "foreign";
934
- try {
935
- process.kill(owner.pid, 0);
936
- return "active";
937
- } catch (error) {
938
- return typeof error === "object" && error !== null && "code" in error && error.code === "ESRCH" ? "stale" : "active";
939
- }
940
- }, "leaseOwnerStatus");
941
-
942
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/files/native-lease-inspection.js
943
- var leaseInspection = /* @__PURE__ */ __name((markerDirectory) => {
944
- const inspect = /* @__PURE__ */ __name(async (destination, options = {}) => {
945
- options.signal?.throwIfAborted();
946
- const root = await realpath2(destination);
947
- options.signal?.throwIfAborted();
948
- const folder = join2(root, markerDirectory);
949
- let names2;
950
- try {
951
- if ((await lstat2(folder)).isSymbolicLink())
952
- throw new Error("symlink");
953
- names2 = await readdir(folder);
954
- } catch (error) {
955
- options.signal?.throwIfAborted();
956
- if (missingLeaseFile(error))
957
- return [];
958
- throw new CliError("configuration_error", "archive lock directory could not be read");
959
- }
960
- options.signal?.throwIfAborted();
961
- const result = [];
962
- for (const name of names2.sort()) {
963
- options.signal?.throwIfAborted();
964
- const owner = await readLeaseOwner(join2(folder, name), name, options.signal);
965
- result.push({
966
- name,
967
- status: owner ? leaseOwnerStatus(owner) : "unrecognized",
968
- pid: owner?.pid ?? null,
969
- host: owner?.host ?? null
970
- });
971
- }
972
- return result;
973
- }, "inspect");
974
- const recover = /* @__PURE__ */ __name(async (destination, options = {}) => {
975
- options.signal?.throwIfAborted();
976
- const root = await realpath2(destination);
977
- const locks = await inspect(root, options);
978
- const removed = [];
979
- if (options.apply)
980
- for (const lock of locks) {
981
- options.signal?.throwIfAborted();
982
- if (lock.status !== "stale")
983
- continue;
984
- const path = join2(root, markerDirectory, lock.name);
985
- const owner = await readLeaseOwner(path, lock.name, options.signal);
986
- if (!owner || leaseOwnerStatus(owner) !== "stale")
987
- continue;
988
- try {
989
- await unlink2(path);
990
- removed.push(lock.name);
991
- } catch (error) {
992
- if (!missingLeaseFile(error))
993
- throw new CliError("configuration_error", "stale archive lock could not be removed");
994
- }
995
- }
996
- return { locks, removed };
997
- }, "recover");
998
- return { inspect, recover };
999
- }, "leaseInspection");
1000
-
1001
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/files/native-lease-release.js
1002
- import { rmdir, unlink as unlink3 } from "node:fs/promises";
1003
- var ownedNativeLease = /* @__PURE__ */ __name((path, name, owner, folder, identity) => {
1004
- let releasing;
1005
- const held = /* @__PURE__ */ __name(async () => {
1006
- if (!await sameOrdinaryFile(path, identity))
1007
- return false;
1008
- const current = await readLeaseOwner(path, name);
1009
- return current?.host === owner.host && current.pid === owner.pid && current.nonce === owner.nonce;
1010
- }, "held");
1011
- const release = /* @__PURE__ */ __name(async () => {
1012
- if (!await held())
1013
- throw new CliError("configuration_error", "owned archive lock changed before release");
1014
- await unlink3(path);
1015
- await rmdir(folder).catch(() => void 0);
1016
- }, "release");
1017
- return {
1018
- held,
1019
- release: /* @__PURE__ */ __name(() => releasing ??= release().catch((error) => {
1020
- releasing = void 0;
1021
- throw error;
1022
- }), "release")
1023
- };
1024
- }, "ownedNativeLease");
1025
-
1026
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/files/native-writer-lease.js
1027
- var validName = /* @__PURE__ */ __name((value) => typeof value === "string" && value.length > 0 && value !== "." && value !== ".." && !/[\\/\0:]/.test(value), "validName");
1028
- var nativeWriterLeaseStore = /* @__PURE__ */ __name((layout) => {
1029
- const { markerDirectory, legacyMarker } = layout;
1030
- if (!validName(markerDirectory) || legacyMarker !== void 0 && (!validName(legacyMarker) || legacyMarker === markerDirectory))
1031
- throw new CliError("validation_error", "archive lock layout requires distinct ordinary entry names");
1032
- const inspection = leaseInspection(markerDirectory);
1033
- return {
1034
- ...inspection,
1035
- acquire: /* @__PURE__ */ __name(async (destination, { signal } = {}) => {
1036
- signal?.throwIfAborted();
1037
- const root = await realpath3(destination);
1038
- signal?.throwIfAborted();
1039
- const folder = join3(root, markerDirectory);
1040
- const owner = { version: 1, pid: process.pid, host: hostname2(), nonce: randomUUID2() };
1041
- const name = `${owner.pid}-${owner.nonce}.json`;
1042
- const path = join3(folder, name);
1043
- const marker = /* @__PURE__ */ __name(async (attempt = 1) => {
1044
- await mkdir(folder, { recursive: true });
1045
- try {
1046
- if ((await lstat3(folder)).isSymbolicLink())
1047
- throw new CliError("validation_error", "archive lock directory must not be a symlink");
1048
- await inspection.recover(root, { apply: true, signal });
1049
- signal?.throwIfAborted();
1050
- return await open3(path, "wx", 384);
1051
- } catch (error) {
1052
- if (attempt < 5 && missingLeaseFile(error))
1053
- return marker(attempt + 1);
1054
- throw error;
1055
- }
1056
- }, "marker");
1057
- const file = await marker();
1058
- let retained = false;
1059
- let identity;
1060
- try {
1061
- identity = await file.stat({ bigint: true });
1062
- await file.writeFile(JSON.stringify(owner));
1063
- await file.sync();
1064
- await file.close();
1065
- signal?.throwIfAborted();
1066
- const inspected = await inspection.inspect(root, { signal });
1067
- const own = inspected.find((lock) => lock.name === name);
1068
- if (own?.status !== "active" || own.pid !== owner.pid || own.host !== owner.host)
1069
- throw new CliError("configuration_error", "archive writer lost its lock before acquisition");
1070
- const locks = inspected.filter((lock) => lock.name !== name);
1071
- if (locks.length)
1072
- return { status: "busy", locks };
1073
- if (legacyMarker) {
1074
- try {
1075
- await lstat3(join3(root, legacyMarker));
1076
- return { status: "legacy" };
1077
- } catch (error) {
1078
- if (!missingLeaseFile(error))
1079
- throw error;
1080
- }
1081
- }
1082
- signal?.throwIfAborted();
1083
- retained = true;
1084
- return { status: "acquired", lease: ownedNativeLease(path, name, owner, folder, identity) };
1085
- } finally {
1086
- await file.close().catch(() => void 0);
1087
- if (!retained) {
1088
- if (identity && await sameOrdinaryFile(path, identity))
1089
- await unlink4(path).catch(() => void 0);
1090
- await rmdir2(folder).catch(() => void 0);
1091
- }
1092
- }
1093
- }, "acquire")
1094
- };
1095
- }, "nativeWriterLeaseStore");
1096
-
1097
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/files/lock.js
1098
- var acquireLock = /* @__PURE__ */ __name(async (path, { signal } = {}) => {
1099
- const folder = dirname2(path);
1100
- await mkdir2(folder, { recursive: true, mode: 448 });
1101
- const acquired = await nativeWriterLeaseStore({ markerDirectory: basename2(path) }).acquire(folder, {
1102
- ...signal ? { signal } : {}
1103
- });
1104
- if (acquired.status === "acquired")
1105
- return acquired.lease;
1106
- throw new CliError("validation_error", `${basename2(path)} is locked by another process`, {
1107
- reason: "file.locked",
1108
- ...acquired.status === "busy" ? { holders: acquired.locks } : {}
1109
- });
1110
- }, "acquireLock");
1111
-
1112
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-metadata.js
784
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-metadata.js
1113
785
  import { createHash } from "node:crypto";
1114
786
  var metadataLimit = 16384;
1115
787
  var partialIdentity = /* @__PURE__ */ __name((locator) => JSON.stringify([locator.provider, locator.account, locator.occurrenceId, locator.assetId]), "partialIdentity");
@@ -1169,10 +841,10 @@ var readPartialMetadata = /* @__PURE__ */ __name(async (path, locator, maxBytes,
1169
841
  }
1170
842
  }, "readPartialMetadata");
1171
843
 
1172
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-writer.js
1173
- import { randomUUID as randomUUID3 } from "node:crypto";
1174
- import { open as open4, rename as rename2, unlink as unlink5 } from "node:fs/promises";
1175
- import { join as join4 } from "node:path";
844
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-writer.js
845
+ import { randomUUID } from "node:crypto";
846
+ import { open, rename, unlink } from "node:fs/promises";
847
+ import { join } from "node:path";
1176
848
  var partialWriter = /* @__PURE__ */ __name(async (input) => {
1177
849
  const { file, signal, partial } = input;
1178
850
  const owned = await file.stat({ bigint: true });
@@ -1198,8 +870,8 @@ var partialWriter = /* @__PURE__ */ __name(async (input) => {
1198
870
  const content = JSON.stringify({ ...partial, offset: size4, sha256: hash3.copy().digest("hex") });
1199
871
  if (Buffer.byteLength(content) > metadataLimit)
1200
872
  throw new CliError("validation_error", "recording partial metadata exceeds its byte limit");
1201
- const temp = join4(input.root, `${input.prefix}${randomUUID3()}.tmp`);
1202
- const metadata = await open4(temp, "wx", 384);
873
+ const temp = join(input.root, `${input.prefix}${randomUUID()}.tmp`);
874
+ const metadata = await open(temp, "wx", 384);
1203
875
  try {
1204
876
  try {
1205
877
  await metadata.writeFile(content);
@@ -1208,11 +880,11 @@ var partialWriter = /* @__PURE__ */ __name(async (input) => {
1208
880
  await metadata.close();
1209
881
  }
1210
882
  await usable();
1211
- await rename2(temp, input.metadataPath);
883
+ await rename(temp, input.metadataPath);
1212
884
  await syncDirectory(input.root);
1213
885
  signal?.throwIfAborted();
1214
886
  } finally {
1215
- await unlink5(temp).catch((error) => {
887
+ await unlink(temp).catch((error) => {
1216
888
  if (!missing(error))
1217
889
  throw error;
1218
890
  });
@@ -1261,7 +933,7 @@ var partialWriter = /* @__PURE__ */ __name(async (input) => {
1261
933
  };
1262
934
  }, "partialWriter");
1263
935
 
1264
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
936
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
1265
937
  var NativeRecordingPartialStore = class {
1266
938
  static {
1267
939
  __name(this, "NativeRecordingPartialStore");
@@ -1283,9 +955,9 @@ var NativeRecordingPartialStore = class {
1283
955
  this.options = Object.freeze({ ...options });
1284
956
  if (typeof root !== "string" || !root || root.includes("\0") || !/^\.[a-zA-Z0-9][a-zA-Z0-9._-]{0,95}-$/.test(options.prefix) || typeof options.persistent !== "boolean" || !Number.isSafeInteger(options.maxBytes) || options.maxBytes <= 0 || Object.values(this.locator).some((value) => typeof value !== "string" || !value.trim() || /[\0\r\n]/.test(value)))
1285
957
  throw new CliError("validation_error", "invalid native recording partial options");
1286
- const key = options.persistent ? createHash2("sha256").update(partialIdentity(this.locator)).digest("hex") : randomUUID4();
1287
- this.path = join5(root, `${options.prefix}${key}.part`);
1288
- this.metadataPath = join5(root, `${options.prefix}${key}.json`);
958
+ const key = options.persistent ? createHash2("sha256").update(partialIdentity(this.locator)).digest("hex") : randomUUID2();
959
+ this.path = join2(root, `${options.prefix}${key}.part`);
960
+ this.metadataPath = join2(root, `${options.prefix}${key}.json`);
1289
961
  }
1290
962
  scope(locator) {
1291
963
  if (partialIdentity(locator) !== partialIdentity(this.locator))
@@ -1326,17 +998,17 @@ var NativeRecordingPartialStore = class {
1326
998
  if (resume) {
1327
999
  file = await openOrdinaryFile(this.path, { writable: true });
1328
1000
  } else {
1329
- const temp = join5(this.root, `${this.options.prefix}${randomUUID4()}.tmp`);
1330
- file = await open5(temp, "wx+", 384);
1001
+ const temp = join2(this.root, `${this.options.prefix}${randomUUID2()}.tmp`);
1002
+ file = await open2(temp, "wx+", 384);
1331
1003
  try {
1332
- await rename3(temp, this.path);
1333
- await unlink6(this.metadataPath).catch((error) => {
1004
+ await rename2(temp, this.path);
1005
+ await unlink2(this.metadataPath).catch((error) => {
1334
1006
  if (!missing(error))
1335
1007
  throw error;
1336
1008
  });
1337
1009
  } catch (error) {
1338
1010
  await file.close();
1339
- await unlink6(temp).catch(() => void 0);
1011
+ await unlink2(temp).catch(() => void 0);
1340
1012
  throw error;
1341
1013
  }
1342
1014
  }
@@ -1368,13 +1040,13 @@ var NativeRecordingPartialStore = class {
1368
1040
  }
1369
1041
  };
1370
1042
 
1371
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
1043
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
1372
1044
  import { createHash as createHash3 } from "node:crypto";
1373
- import { link as link2 } from "node:fs/promises";
1374
- import { basename as basename3, dirname as dirname3, join as join7, resolve } from "node:path";
1045
+ import { link } from "node:fs/promises";
1046
+ import { basename, dirname, join as join4, resolve } from "node:path";
1375
1047
 
1376
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-files.js
1377
- import { unlink as unlink7 } from "node:fs/promises";
1048
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-files.js
1049
+ import { unlink as unlink3 } from "node:fs/promises";
1378
1050
  var verifiedPublicationFile = /* @__PURE__ */ __name(async (path, expected, signal, writable = false) => {
1379
1051
  signal?.throwIfAborted();
1380
1052
  const file = await openOrdinaryFile(path, { writable });
@@ -1403,15 +1075,15 @@ var commitPublication = /* @__PURE__ */ __name(async (root, partialPath, finalPa
1403
1075
  signal?.throwIfAborted();
1404
1076
  await assertPublicationIdentity(finalPath, final);
1405
1077
  await assertPublicationIdentity(partialPath, partial);
1406
- await unlink7(partialPath);
1078
+ await unlink3(partialPath);
1407
1079
  await syncDirectory(root);
1408
1080
  signal?.throwIfAborted();
1409
1081
  }, "commitPublication");
1410
1082
 
1411
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-journal.js
1412
- import { randomUUID as randomUUID5 } from "node:crypto";
1413
- import { open as open6, rename as rename4, unlink as unlink8 } from "node:fs/promises";
1414
- import { join as join6 } from "node:path";
1083
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-journal.js
1084
+ import { randomUUID as randomUUID3 } from "node:crypto";
1085
+ import { open as open3, rename as rename3, unlink as unlink4 } from "node:fs/promises";
1086
+ import { join as join3 } from "node:path";
1415
1087
  var readPublicationJournal = /* @__PURE__ */ __name(async (path, codec, limit, signal) => {
1416
1088
  signal?.throwIfAborted();
1417
1089
  let file;
@@ -1455,8 +1127,8 @@ var writePublicationJournal = /* @__PURE__ */ __name(async (root, path, prefix,
1455
1127
  if (Buffer.byteLength(content) > limit)
1456
1128
  throw new CliError("validation_error", "recording recovery record exceeds its metadata limit");
1457
1129
  codec.decode(JSON.parse(content));
1458
- const temp = join6(root, `${prefix}${randomUUID5()}.tmp`);
1459
- const handle = await open6(temp, "wx", 384);
1130
+ const temp = join3(root, `${prefix}${randomUUID3()}.tmp`);
1131
+ const handle = await open3(temp, "wx", 384);
1460
1132
  let identity;
1461
1133
  try {
1462
1134
  try {
@@ -1469,19 +1141,19 @@ var writePublicationJournal = /* @__PURE__ */ __name(async (root, path, prefix,
1469
1141
  signal?.throwIfAborted();
1470
1142
  if (!identity || !await sameOrdinaryFile(temp, identity))
1471
1143
  throw new CliError("validation_error", "recording publication journal changed");
1472
- await rename4(temp, path);
1144
+ await rename3(temp, path);
1473
1145
  await syncDirectory(root);
1474
1146
  signal?.throwIfAborted();
1475
1147
  } finally {
1476
1148
  if (identity && await sameOrdinaryFile(temp, identity))
1477
- await unlink8(temp).catch((error) => {
1149
+ await unlink4(temp).catch((error) => {
1478
1150
  if (!missing(error))
1479
1151
  throw error;
1480
1152
  });
1481
1153
  }
1482
1154
  }, "writePublicationJournal");
1483
1155
 
1484
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
1156
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
1485
1157
  var NativeRecordingPublication = class {
1486
1158
  static {
1487
1159
  __name(this, "NativeRecordingPublication");
@@ -1493,12 +1165,12 @@ var NativeRecordingPublication = class {
1493
1165
  options;
1494
1166
  constructor(root, locator, options) {
1495
1167
  this.root = root;
1496
- if (!root || root.includes("\0") || !/^\.[a-zA-Z0-9][a-zA-Z0-9._-]{0,95}-$/.test(options.prefix) || !options.filename || basename3(options.filename) !== options.filename || /[\\/\0]/.test(options.filename) || [".", ".."].includes(options.filename) || !Number.isSafeInteger(options.maxBytes) || options.maxBytes <= 0 || !Number.isSafeInteger(options.metadataLimit) || options.metadataLimit <= 0 || options.metadataLimit > 1048576 || [locator.provider, locator.account, locator.occurrenceId, locator.assetId].some((value) => typeof value !== "string" || !value.trim() || /[\0\r\n]/.test(value)))
1168
+ if (!root || root.includes("\0") || !/^\.[a-zA-Z0-9][a-zA-Z0-9._-]{0,95}-$/.test(options.prefix) || !options.filename || basename(options.filename) !== options.filename || /[\\/\0]/.test(options.filename) || [".", ".."].includes(options.filename) || !Number.isSafeInteger(options.maxBytes) || options.maxBytes <= 0 || !Number.isSafeInteger(options.metadataLimit) || options.metadataLimit <= 0 || options.metadataLimit > 1048576 || [locator.provider, locator.account, locator.occurrenceId, locator.assetId].some((value) => typeof value !== "string" || !value.trim() || /[\0\r\n]/.test(value)))
1497
1169
  throw new CliError("validation_error", "invalid native recording publication options");
1498
1170
  this.scope = partialIdentity(locator);
1499
1171
  this.options = Object.freeze({ ...options, codec: Object.freeze({ ...options.codec }) });
1500
- this.journalPath = join7(root, `${options.prefix}${createHash3("sha256").update(this.scope).digest("hex")}.json`);
1501
- this.finalPath = join7(root, options.filename);
1172
+ this.journalPath = join4(root, `${options.prefix}${createHash3("sha256").update(this.scope).digest("hex")}.json`);
1173
+ this.finalPath = join4(root, options.filename);
1502
1174
  if (this.finalPath === this.journalPath)
1503
1175
  throw new CliError("validation_error", "recording publication paths must be distinct");
1504
1176
  }
@@ -1509,7 +1181,7 @@ var NativeRecordingPublication = class {
1509
1181
  return writePublicationJournal(this.root, this.journalPath, this.options.prefix, value, this.options.codec, this.options.metadataLimit, this.options.signal);
1510
1182
  }
1511
1183
  validate(partialPath, expected) {
1512
- if (resolve(dirname3(partialPath)) !== resolve(this.root) || resolve(partialPath) === resolve(this.finalPath) || resolve(partialPath) === resolve(this.journalPath) || !Number.isSafeInteger(expected.size) || expected.size < 0 || expected.size > this.options.maxBytes || typeof expected.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(expected.sha256))
1184
+ if (resolve(dirname(partialPath)) !== resolve(this.root) || resolve(partialPath) === resolve(this.finalPath) || resolve(partialPath) === resolve(this.journalPath) || !Number.isSafeInteger(expected.size) || expected.size < 0 || expected.size > this.options.maxBytes || typeof expected.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(expected.sha256))
1513
1185
  throw new CliError("validation_error", "invalid recording publication evidence");
1514
1186
  this.options.signal?.throwIfAborted();
1515
1187
  }
@@ -1521,7 +1193,7 @@ var NativeRecordingPublication = class {
1521
1193
  await partial.sync();
1522
1194
  this.options.signal?.throwIfAborted();
1523
1195
  await assertPublicationIdentity(partialPath, partial);
1524
- await link2(partialPath, this.finalPath);
1196
+ await link(partialPath, this.finalPath);
1525
1197
  await assertPublicationIdentity(this.finalPath, partial);
1526
1198
  await commitPublication(this.root, partialPath, this.finalPath, partial, partial, commit, this.options.signal);
1527
1199
  } finally {
@@ -1554,10 +1226,10 @@ var NativeRecordingPublication = class {
1554
1226
  }
1555
1227
  };
1556
1228
 
1557
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/media-archive-manifest.js
1229
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/media-archive-manifest.js
1558
1230
  import { createHash as createHash4 } from "node:crypto";
1559
- import { readdir as readdir2 } from "node:fs/promises";
1560
- import { isAbsolute, join as join8, resolve as resolve2 } from "node:path";
1231
+ import { readdir } from "node:fs/promises";
1232
+ import { isAbsolute, join as join5, resolve as resolve2 } from "node:path";
1561
1233
  var mediaKey = /* @__PURE__ */ __name((one) => createHash4("sha256").update(JSON.stringify([one.provider, one.account, one.chat, one.message, one.position])).digest("hex"), "mediaKey");
1562
1234
  var mediaManifestName = /* @__PURE__ */ __name((one) => `.media-archive-${mediaKey(one)}.json`, "mediaManifestName");
1563
1235
  var missingMediaFile = /* @__PURE__ */ __name((error) => typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT", "missingMediaFile");
@@ -1599,13 +1271,13 @@ var mediaFingerprint = /* @__PURE__ */ __name(async (path, signal) => {
1599
1271
  }, "mediaFingerprint");
1600
1272
  var readMediaManifests = /* @__PURE__ */ __name(async (root, signal) => {
1601
1273
  const entries = [];
1602
- for (const name of await readdir2(root)) {
1274
+ for (const name of await readdir(root)) {
1603
1275
  signal?.throwIfAborted();
1604
1276
  if (!name.startsWith(".media-archive-") || !name.endsWith(".json"))
1605
1277
  continue;
1606
1278
  let one;
1607
1279
  try {
1608
- one = parseMediaEntry(JSON.parse(await readBoundedUtf8File(join8(root, name), { maxBytes: 16384 })));
1280
+ one = parseMediaEntry(JSON.parse(await readBoundedUtf8File(join5(root, name), { maxBytes: 16384 })));
1609
1281
  } catch {
1610
1282
  throw new CliError("validation_error", "invalid media archive manifest");
1611
1283
  }
@@ -1625,23 +1297,23 @@ var verifyMediaEntry = /* @__PURE__ */ __name(async (root, one, signal) => {
1625
1297
  throw new CliError("validation_error", "media archive relocation cycle or excessive depth");
1626
1298
  visited.add(location);
1627
1299
  location = resolve2(entry.relocatedTo);
1628
- const target = parseMediaEntry(JSON.parse(await readBoundedUtf8File(join8(location, mediaManifestName(one)), { maxBytes: 16384 })));
1300
+ const target = parseMediaEntry(JSON.parse(await readBoundedUtf8File(join5(location, mediaManifestName(one)), { maxBytes: 16384 })));
1629
1301
  if (!sameMediaCopy(one, target))
1630
1302
  return false;
1631
1303
  entry = target;
1632
1304
  }
1633
1305
  if (visited.has(location))
1634
1306
  return false;
1635
- const actual = await mediaFingerprint(join8(location, one.path), signal);
1307
+ const actual = await mediaFingerprint(join5(location, one.path), signal);
1636
1308
  return actual.size === one.size && actual.sha256 === one.sha256;
1637
1309
  }, "verifyMediaEntry");
1638
1310
  var sameMediaCopy = /* @__PURE__ */ __name((a, b) => mediaKey(a) === mediaKey(b) && a.size === b.size && a.sha256 === b.sha256 && a.kind === b.kind && a.messageTime === b.messageTime && a.mime === b.mime, "sameMediaCopy");
1639
- var commitMediaEntry = /* @__PURE__ */ __name((root, one, beforePublish) => writeFileAtomic(join8(root, mediaManifestName(one)), JSON.stringify(parseMediaEntry(one)), {
1311
+ var commitMediaEntry = /* @__PURE__ */ __name((root, one, beforePublish) => writeFileAtomic(join5(root, mediaManifestName(one)), JSON.stringify(parseMediaEntry(one)), {
1640
1312
  overwrite: false,
1641
1313
  beforePublish
1642
1314
  }), "commitMediaEntry");
1643
1315
 
1644
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
1316
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
1645
1317
  var validator = '"media-completed-v1"';
1646
1318
  var maximumFileBytes = 64 * 1024 * 1024 * 1024;
1647
1319
  var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file, beforeWrite, signal, metadata = {}) => {
@@ -1685,7 +1357,7 @@ var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file,
1685
1357
  }, "commit");
1686
1358
  let exists = false;
1687
1359
  try {
1688
- await lstat4(publication.finalPath);
1360
+ await lstat(publication.finalPath);
1689
1361
  exists = true;
1690
1362
  } catch (error) {
1691
1363
  if (!missingMediaFile(error))
@@ -1742,9 +1414,9 @@ var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file,
1742
1414
  return entry;
1743
1415
  }, "archiveMediaFile");
1744
1416
 
1745
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/media-archive-locks.js
1746
- import { mkdir as mkdir3, realpath as realpath4 } from "node:fs/promises";
1747
- import { join as join9, resolve as resolve3 } from "node:path";
1417
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/media-archive-locks.js
1418
+ import { mkdir, realpath } from "node:fs/promises";
1419
+ import { join as join6, resolve as resolve3 } from "node:path";
1748
1420
  var archiveLocations = /* @__PURE__ */ __name(async (initial, signal) => {
1749
1421
  const roots = /* @__PURE__ */ new Set();
1750
1422
  const queued = new Set(initial.map((directory) => resolve3(directory)));
@@ -1753,7 +1425,7 @@ var archiveLocations = /* @__PURE__ */ __name(async (initial, signal) => {
1753
1425
  signal?.throwIfAborted();
1754
1426
  let root;
1755
1427
  try {
1756
- root = await realpath4(pending[at]);
1428
+ root = await realpath(pending[at]);
1757
1429
  } catch (error) {
1758
1430
  if (missingMediaFile(error))
1759
1431
  continue;
@@ -1778,18 +1450,18 @@ var archiveLocations = /* @__PURE__ */ __name(async (initial, signal) => {
1778
1450
  var withMediaArchiveLocks = /* @__PURE__ */ __name(async (directory, signal, run, options = {}) => {
1779
1451
  signal?.throwIfAborted();
1780
1452
  if (options.create)
1781
- await mkdir3(directory, { recursive: true, mode: 448 });
1782
- const root = await realpath4(directory);
1453
+ await mkdir(directory, { recursive: true, mode: 448 });
1454
+ const root = await realpath(directory);
1783
1455
  if (options.createAdditional)
1784
1456
  for (const other of options.additional ?? [])
1785
- await mkdir3(other, { recursive: true, mode: 448 });
1457
+ await mkdir(other, { recursive: true, mode: 448 });
1786
1458
  const initial = [root, ...options.additional ?? []];
1787
1459
  for (let attempt = 0; attempt < 3; attempt++) {
1788
1460
  const locations = await archiveLocations(initial, signal);
1789
1461
  const leases = [];
1790
1462
  try {
1791
1463
  for (const location of locations)
1792
- leases.push(await acquireLock(join9(location, ".media-writers"), { signal }));
1464
+ leases.push(await acquireLock(join6(location, ".media-writers"), { signal }));
1793
1465
  const current = await archiveLocations(initial, signal);
1794
1466
  if (current.some((location) => !locations.includes(location)))
1795
1467
  continue;
@@ -1809,7 +1481,7 @@ var withMediaArchiveLocks = /* @__PURE__ */ __name(async (directory, signal, run
1809
1481
  throw new CliError("validation_error", "archive locations changed during locking; run the command again");
1810
1482
  }, "withMediaArchiveLocks");
1811
1483
 
1812
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/media-archive.js
1484
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/media-archive.js
1813
1485
  var validateMediaSince = /* @__PURE__ */ __name((value, flag = "--since-time") => {
1814
1486
  if (value === void 0)
1815
1487
  return void 0;
@@ -1962,22 +1634,22 @@ var archiveMedia = /* @__PURE__ */ __name(async (ports, options) => {
1962
1634
  }, { create: true });
1963
1635
  }, "archiveMedia");
1964
1636
 
1965
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/media-archive-move.js
1966
- import { realpath as realpath5, unlink as unlink9 } from "node:fs/promises";
1967
- import { basename as basename4, dirname as dirname4, join as join10, resolve as resolve4 } from "node:path";
1637
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/media-archive-move.js
1638
+ import { realpath as realpath2, unlink as unlink5 } from "node:fs/promises";
1639
+ import { basename as basename2, dirname as dirname2, join as join7, resolve as resolve4 } from "node:path";
1968
1640
  var canonicalDestination = /* @__PURE__ */ __name(async (directory) => {
1969
1641
  const path = resolve4(directory);
1970
1642
  try {
1971
- return await realpath5(path);
1643
+ return await realpath2(path);
1972
1644
  } catch (error) {
1973
- if (!missingMediaFile(error) || dirname4(path) === path)
1645
+ if (!missingMediaFile(error) || dirname2(path) === path)
1974
1646
  throw error;
1975
- return join10(await canonicalDestination(dirname4(path)), basename4(path));
1647
+ return join7(await canonicalDestination(dirname2(path)), basename2(path));
1976
1648
  }
1977
1649
  }, "canonicalDestination");
1978
1650
  var image = /* @__PURE__ */ __name((entry) => ["photo", "image"].includes(entry.kind) || entry.mime?.startsWith("image/"), "image");
1979
1651
  var removeLocalCopy = /* @__PURE__ */ __name(async (root, entry, beforeWrite, signal) => {
1980
- const path = join10(root, entry.path);
1652
+ const path = join7(root, entry.path);
1981
1653
  let file;
1982
1654
  try {
1983
1655
  file = await openOrdinaryFile(path);
@@ -1996,7 +1668,7 @@ var removeLocalCopy = /* @__PURE__ */ __name(async (root, entry, beforeWrite, si
1996
1668
  await beforeWrite();
1997
1669
  if (!await sameOrdinaryFile(path, identity))
1998
1670
  throw new CliError("validation_error", "local image was replaced; it was preserved");
1999
- await unlink9(path);
1671
+ await unlink5(path);
2000
1672
  await syncDirectory(root);
2001
1673
  } finally {
2002
1674
  await file.close();
@@ -2007,7 +1679,7 @@ var moveMediaArchive = /* @__PURE__ */ __name(async (options) => {
2007
1679
  if (cutoff === void 0)
2008
1680
  throw new CliError("validation_error", "--before-time is required");
2009
1681
  const target = await canonicalDestination(options.archiveDirectory);
2010
- const source = await realpath5(options.directory);
1682
+ const source = await realpath2(options.directory);
2011
1683
  if (source === target)
2012
1684
  throw new CliError("validation_error", "choose a different archive destination");
2013
1685
  return withMediaArchiveLocks(source, options.signal, async (root, beforeWrite) => {
@@ -2064,7 +1736,7 @@ var moveMediaArchive = /* @__PURE__ */ __name(async (options) => {
2064
1736
  for (const entry of candidates) {
2065
1737
  await beforeWrite();
2066
1738
  if (!known2.has(mediaKey(entry))) {
2067
- const file = await openOrdinaryFile(join10(root, entry.path));
1739
+ const file = await openOrdinaryFile(join7(root, entry.path));
2068
1740
  try {
2069
1741
  const identity = {
2070
1742
  provider: entry.provider,
@@ -2091,7 +1763,7 @@ var moveMediaArchive = /* @__PURE__ */ __name(async (options) => {
2091
1763
  if (!await verifyMediaEntry(root, receipt, options.signal))
2092
1764
  throw new CliError("validation_error", "archive destination changed before rotation; the original was preserved");
2093
1765
  await beforeWrite();
2094
- await writeFileAtomic(join10(root, mediaManifestName(entry)), JSON.stringify(receipt), {
1766
+ await writeFileAtomic(join7(root, mediaManifestName(entry)), JSON.stringify(receipt), {
2095
1767
  beforePublish: beforeWrite,
2096
1768
  signal: options.signal
2097
1769
  });
@@ -2115,7 +1787,7 @@ var moveMediaArchive = /* @__PURE__ */ __name(async (options) => {
2115
1787
  }, { additional: [target], createAdditional: !options.dryRun });
2116
1788
  }, "moveMediaArchive");
2117
1789
 
2118
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/model-downloads.js
1790
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/model-downloads.js
2119
1791
  var bytesOf = /* @__PURE__ */ __name((model) => model.files.reduce((sum2, file) => sum2 + file.bytes, 0), "bytesOf");
2120
1792
  var nativeRuntime = /* @__PURE__ */ __name(async ({ env, progress = /* @__PURE__ */ __name(() => {
2121
1793
  }, "progress") }) => {
@@ -2138,7 +1810,7 @@ var downloadTextModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
2138
1810
  }
2139
1811
  await nativeRuntime({ env, progress });
2140
1812
  progress(`${model.id}: loading it once to check it works`);
2141
- const { openEmbedder: openEmbedder2 } = await import("./embed-UZMNP26C.js");
1813
+ const { openEmbedder: openEmbedder2 } = await import("./embed-3GSQIQXE.js");
2142
1814
  const embedder = await openEmbedder2(model, directory);
2143
1815
  try {
2144
1816
  const [vector] = await embedder.embed(["check"], "query");
@@ -2159,7 +1831,7 @@ var downloadRerankModel = /* @__PURE__ */ __name(async (id2, { env, progress = /
2159
1831
  }
2160
1832
  await nativeRuntime({ env, progress });
2161
1833
  progress(`${model.id}: loading it once to check it works`);
2162
- const { openReranker } = await import("./rerank-LOW6VIDF.js");
1834
+ const { openReranker } = await import("./rerank-R6PE44M5.js");
2163
1835
  const reranker = await openReranker(model, directory);
2164
1836
  try {
2165
1837
  await reranker.score("check", ["check"]);
@@ -2177,7 +1849,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
2177
1849
  await installFiles(placedImage(model, directory), { progress });
2178
1850
  }
2179
1851
  progress(`${model.id}: loading it once to check it works`);
2180
- const { openPictureEmbedder } = await import("./embedder-7VDWDBKF.js");
1852
+ const { openPictureEmbedder } = await import("./embedder-6ULWRG3R.js");
2181
1853
  const embedder = await openPictureEmbedder(model, directory);
2182
1854
  try {
2183
1855
  const vector = await embedder.embedQuery("check");
@@ -2189,7 +1861,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
2189
1861
  return { model, directory };
2190
1862
  }, "downloadImageModel");
2191
1863
 
2192
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/project-gathering-around.js
1864
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/project-gathering-around.js
2193
1865
  var storedMessageNeighbours = /* @__PURE__ */ __name((messages) => ({
2194
1866
  async around(ref, window2) {
2195
1867
  const at = parseLocator(ref);
@@ -2285,7 +1957,7 @@ var storedNeighbours = /* @__PURE__ */ __name((store) => {
2285
1957
  };
2286
1958
  }, "storedNeighbours");
2287
1959
 
2288
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/project-gathering-request.js
1960
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/project-gathering-request.js
2289
1961
  import { createHash as createHash5 } from "node:crypto";
2290
1962
  var DAY = 864e5;
2291
1963
  var MAX_TIME = 864e13;
@@ -2600,7 +2272,7 @@ var decodeCheckpoint = /* @__PURE__ */ __name((text2, plan) => {
2600
2272
  return value;
2601
2273
  }, "decodeCheckpoint");
2602
2274
 
2603
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/project-gathering.js
2275
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/project-gathering.js
2604
2276
  var terminal = /* @__PURE__ */ new Set(["done", "unavailable", "failed"]);
2605
2277
  var PAGE = 20;
2606
2278
  var PEOPLE = 20;
@@ -2671,9 +2343,9 @@ var gatherProjectEvidence = /* @__PURE__ */ __name(async (ports, request) => {
2671
2343
  const matchedAgain = /* @__PURE__ */ new Map();
2672
2344
  const oversized = /* @__PURE__ */ new Map();
2673
2345
  let stopped = null;
2674
- const open10 = /* @__PURE__ */ __name((u) => !terminal.has(u.state) && u.state !== "read-limited", "open");
2346
+ const open7 = /* @__PURE__ */ __name((u) => !terminal.has(u.state) && u.state !== "read-limited", "open");
2675
2347
  const linkedLanes = new Set(plan.linkedChats.flatMap((c) => c.lane === null ? [] : [c.lane]));
2676
- const openLanes = new Set(progress.flatMap((u, index) => open10(u) ? [units2[index]?.lane.id] : []));
2348
+ const openLanes = new Set(progress.flatMap((u, index) => open7(u) ? [units2[index]?.lane.id] : []));
2677
2349
  const shares = [...linkedLanes].filter((id2) => openLanes.has(id2)).length + ([...openLanes].some((id2) => id2 !== void 0 && !linkedLanes.has(id2)) ? 1 : 0);
2678
2350
  const linkedLimit = Math.max(PAGE, Math.floor(plan.budgets.maxItems / Math.max(1, shares)));
2679
2351
  const linkedTaken = /* @__PURE__ */ new Map();
@@ -2732,9 +2404,9 @@ var gatherProjectEvidence = /* @__PURE__ */ __name(async (ports, request) => {
2732
2404
  if (linkedLanes.has(lane.id))
2733
2405
  linkedTaken.set(lane.id, (linkedTaken.get(lane.id) ?? 0) + 1);
2734
2406
  }, "take");
2735
- const shallowest = progress.reduce((low, u) => open10(u) ? Math.min(low, u.pages) : low, Number.POSITIVE_INFINITY);
2407
+ const shallowest = progress.reduce((low, u) => open7(u) ? Math.min(low, u.pages) : low, Number.POSITIVE_INFINITY);
2736
2408
  for (let round = shallowest; !stopped; round++) {
2737
- const due = progress.flatMap((u, index) => open10(u) && u.pages <= round && !capped2.has(units2[index]?.lane.id ?? "") ? [index] : []);
2409
+ const due = progress.flatMap((u, index) => open7(u) && u.pages <= round && !capped2.has(units2[index]?.lane.id ?? "") ? [index] : []);
2738
2410
  if (!due.length)
2739
2411
  break;
2740
2412
  for (const index of due) {
@@ -2950,7 +2622,7 @@ var peopleOf = /* @__PURE__ */ __name((items, senderOf) => {
2950
2622
  return [...byKey.values()].sort((a, b) => b.items - a.items || a.name.localeCompare(b.name));
2951
2623
  }, "peopleOf");
2952
2624
 
2953
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidate-matching.js
2625
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidate-matching.js
2954
2626
  var normalizedText = /* @__PURE__ */ __name((text2) => text2.normalize("NFKC").toLowerCase().replace(/\s+/gu, " "), "normalizedText");
2955
2627
  var termsOf = /* @__PURE__ */ __name((entry) => [
2956
2628
  { name: entry.name, kind: "canonical" },
@@ -3015,7 +2687,7 @@ var matchProjectCandidates = /* @__PURE__ */ __name((catalog, input) => matchVoc
3015
2687
  omittedMatches: omitted
3016
2688
  })), "matchProjectCandidates");
3017
2689
 
3018
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/project-gathering-mentions.js
2690
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/project-gathering-mentions.js
3019
2691
  var KINDS = ["project", "tag", "topic"];
3020
2692
  var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering, options = {}) => {
3021
2693
  if (typeof vocabulary?.vocabulary !== "function")
@@ -3070,7 +2742,7 @@ var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering,
3070
2742
  };
3071
2743
  }, "findEvidenceMentions");
3072
2744
 
3073
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/ports/messenger.js
2745
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/ports/messenger.js
3074
2746
  var throughWrapper = /* @__PURE__ */ __name((inner, handled, wrap = (_, call) => call) => new Proxy(handled, {
3075
2747
  get: /* @__PURE__ */ __name((own, key) => {
3076
2748
  if (key in own)
@@ -3087,12 +2759,12 @@ var capability = /* @__PURE__ */ __name((adapter, method, what) => {
3087
2759
  return found.bind(adapter);
3088
2760
  }, "capability");
3089
2761
 
3090
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/sends/send-id.js
2762
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/sends/send-id.js
3091
2763
  import { randomBytes } from "node:crypto";
3092
2764
  var newSendId = /* @__PURE__ */ __name(() => randomBytes(8).readBigInt64BE().toString(), "newSendId");
3093
2765
  var newOperationId = newSendId;
3094
2766
 
3095
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/account.js
2767
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/account.js
3096
2768
  var accountService = /* @__PURE__ */ __name((deps) => {
3097
2769
  const online = /* @__PURE__ */ __name(async (command) => {
3098
2770
  if (deps.offline)
@@ -3164,7 +2836,7 @@ var accountService = /* @__PURE__ */ __name((deps) => {
3164
2836
  };
3165
2837
  }, "accountService");
3166
2838
 
3167
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/domain/send-time.js
2839
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/send-time.js
3168
2840
  var MINUTE = 6e4;
3169
2841
  var YEAR = 365 * 24 * 60 * MINUTE;
3170
2842
  var DELAY = /^(\d+)(m|h|d)$/;
@@ -3183,7 +2855,7 @@ var sendTime = /* @__PURE__ */ __name((value, now = Date.now(), flag = "--at-tim
3183
2855
  return new Date(at - at % MINUTE).toISOString();
3184
2856
  }, "sendTime");
3185
2857
 
3186
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/admin.js
2858
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/admin.js
3187
2859
  var recordMembership = /* @__PURE__ */ __name(async (deps, operationId, done2, change, fix, write) => {
3188
2860
  try {
3189
2861
  const held = await accountStoreIfOpen(deps);
@@ -3212,11 +2884,11 @@ var adminService = /* @__PURE__ */ __name((deps) => {
3212
2884
  const chat = await guardedWrite(deps.guard, { operationId, chatId: null, kind: "chat", action: "create", personIds, people: personIds.length }, () => create(title.trim(), personIds, { channel }), (made) => ({ chatId: made.id }));
3213
2885
  return { operationId, chat };
3214
2886
  }, "create"),
3215
- join: /* @__PURE__ */ __name(async (link5) => {
2887
+ join: /* @__PURE__ */ __name(async (link4) => {
3216
2888
  const connection = await online("chats join");
3217
- const join13 = capability(connection, "join", "join a chat by its link");
2889
+ const join10 = capability(connection, "join", "join a chat by its link");
3218
2890
  const operationId = newOperationId();
3219
- const joined = await guardedWrite(deps.guard, { operationId, chatId: null, kind: "chat", action: "join" }, () => join13(link5.trim()), (answer) => "requested" in answer ? {} : { chatId: answer.id });
2891
+ const joined = await guardedWrite(deps.guard, { operationId, chatId: null, kind: "chat", action: "join" }, () => join10(link4.trim()), (answer) => "requested" in answer ? {} : { chatId: answer.id });
3220
2892
  if ("requested" in joined)
3221
2893
  return { operationId, requested: true };
3222
2894
  const fix = deps.reads === "store" ? reportedFix(deps, joined.id, "left", "join") : `an online \`${typedCommand(deps.messenger.app.command, "chats list")}\` that shows the chat corrects it`;
@@ -3323,12 +2995,12 @@ var adminService = /* @__PURE__ */ __name((deps) => {
3323
2995
  const { already } = await guardedWrite(deps.guard, { operationId, chatId, kind: "chat", action: accept ? "requests.accept" : "requests.decline", people: 1 }, () => answer(chatId, personId, accept));
3324
2996
  return { operationId, chatId, personId, accepted: accept, already };
3325
2997
  }, "answerRequest"),
3326
- answerAllRequests: /* @__PURE__ */ __name(async (chat, accept, { link: link5 }) => {
2998
+ answerAllRequests: /* @__PURE__ */ __name(async (chat, accept, { link: link4 }) => {
3327
2999
  const connection = await online(`chats requests ${accept ? "accept" : "decline"} --all`);
3328
3000
  const list2 = capability(connection, "joinRequests", "read join requests");
3329
3001
  const answerAll = capability(connection, "answerAllJoinRequests", "answer every join request at once");
3330
3002
  const { id: chatId } = await connection.resolve(chat);
3331
- const page = await list2(chatId, { limit: 100, ...link5 === void 0 ? {} : { link: link5 } });
3003
+ const page = await list2(chatId, { limit: 100, ...link4 === void 0 ? {} : { link: link4 } });
3332
3004
  const counted2 = page.total ?? page.items.length;
3333
3005
  if (page.total === void 0 && page.hasMore)
3334
3006
  throw new CliError("validation_error", "too many requests to count; answer them by person, or by --link");
@@ -3342,7 +3014,7 @@ var adminService = /* @__PURE__ */ __name((deps) => {
3342
3014
  action: accept ? "requests.accept" : "requests.decline",
3343
3015
  count: counted2,
3344
3016
  people: counted2
3345
- }, () => answerAll(chatId, accept, link5));
3017
+ }, () => answerAll(chatId, accept, link4));
3346
3018
  return { operationId, chatId, accepted: accept, counted: counted2 };
3347
3019
  }, "answerAllRequests"),
3348
3020
  links: /* @__PURE__ */ __name(async (chat, window2) => {
@@ -3353,18 +3025,18 @@ var adminService = /* @__PURE__ */ __name((deps) => {
3353
3025
  const { id: chatId } = await connection.resolve(chat);
3354
3026
  return { chatId, ...await list2(chatId, window2) };
3355
3027
  }, "links"),
3356
- revokeLink: /* @__PURE__ */ __name(async (chat, link5) => {
3357
- if (link5.trim() === "")
3028
+ revokeLink: /* @__PURE__ */ __name(async (chat, link4) => {
3029
+ if (link4.trim() === "")
3358
3030
  throw new CliError("validation_error", "which link? give it as `chats links list` shows it");
3359
3031
  const connection = await online("chats links remove");
3360
3032
  const revoke = capability(connection, "revokeInviteLink", "revoke an invite link");
3361
3033
  const { id: chatId } = await connection.resolve(chat);
3362
3034
  const operationId = newOperationId();
3363
- const answer = await guardedWrite(deps.guard, { operationId, chatId, kind: "chat", action: "link.revoke" }, () => revoke(chatId, link5.trim()));
3035
+ const answer = await guardedWrite(deps.guard, { operationId, chatId, kind: "chat", action: "link.revoke" }, () => revoke(chatId, link4.trim()));
3364
3036
  return { operationId, chatId, ...answer };
3365
3037
  }, "revokeLink"),
3366
- updateLink: /* @__PURE__ */ __name(async (chat, link5, { approval, expires, maxUses }) => {
3367
- if (link5.trim() === "")
3038
+ updateLink: /* @__PURE__ */ __name(async (chat, link4, { approval, expires, maxUses }) => {
3039
+ if (link4.trim() === "")
3368
3040
  throw new CliError("validation_error", "which link? give it as `chats links list` shows it");
3369
3041
  if (approval === void 0 && expires === void 0 && maxUses === void 0)
3370
3042
  throw new CliError("validation_error", "nothing to change: give --approval, --no-approval, --expire-time or --max-uses");
@@ -3379,7 +3051,7 @@ var adminService = /* @__PURE__ */ __name((deps) => {
3379
3051
  ...maxUses === void 0 ? {} : { maxUses }
3380
3052
  };
3381
3053
  const operationId = newOperationId();
3382
- const answer = await guardedWrite(deps.guard, { operationId, chatId, kind: "chat", action: "link.update" }, () => update(chatId, link5.trim(), change));
3054
+ const answer = await guardedWrite(deps.guard, { operationId, chatId, kind: "chat", action: "link.update" }, () => update(chatId, link4.trim(), change));
3383
3055
  return { operationId, chatId, ...answer };
3384
3056
  }, "updateLink"),
3385
3057
  addMembers: /* @__PURE__ */ __name(async (chat, people, options) => {
@@ -3430,10 +3102,10 @@ var linkLimits = /* @__PURE__ */ __name(({ approval, expires, maxUses }) => {
3430
3102
  return expires === void 0 ? void 0 : sendTime(expires, Date.now(), "--expire-time");
3431
3103
  }, "linkLimits");
3432
3104
 
3433
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/ports/traits.js
3105
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/ports/traits.js
3434
3106
  var syncsOneChat = /* @__PURE__ */ __name((messenger) => messenger.history !== "store" || messenger.historyOnDemand === true, "syncsOneChat");
3435
3107
 
3436
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/mail-search.js
3108
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/mail-search.js
3437
3109
  var THREADS_PAGE = 500;
3438
3110
  var threadsOf = /* @__PURE__ */ __name(async (store, key) => {
3439
3111
  const account2 = await store.accounts.storedAccount(key).catch(() => void 0);
@@ -3512,7 +3184,7 @@ var readMail = /* @__PURE__ */ __name(async (store, locator, { before: before2 =
3512
3184
  return thread.slice(Math.max(0, at - before2), at + after + 1).map((hit) => hit.id === message ? { ...hit, anchor: true } : hit);
3513
3185
  }, "readMail");
3514
3186
 
3515
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/message-resolution.js
3187
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/message-resolution.js
3516
3188
  var readChatId = /* @__PURE__ */ __name(async (deps, reference, store, account2) => {
3517
3189
  if (deps.reads !== "store")
3518
3190
  return keptChatId(deps.messenger, reference, store, account2);
@@ -3659,7 +3331,7 @@ var senderAmong = /* @__PURE__ */ __name(async (store, accounts, reference) => {
3659
3331
  }
3660
3332
  }, "senderAmong");
3661
3333
 
3662
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/search-kind.js
3334
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/search-kind.js
3663
3335
  var NO_MAIL = "no_mail";
3664
3336
  var MAIL = "email";
3665
3337
  var listContextOf = /* @__PURE__ */ __name(async (store, account2, app, stored) => {
@@ -3706,7 +3378,7 @@ var accountsOfKind = /* @__PURE__ */ __name((kind, chosen, held, explicit, comma
3706
3378
  return chosenMail.map(({ provider, account: account2 }) => ({ provider, account: account2 }));
3707
3379
  }, "accountsOfKind");
3708
3380
 
3709
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/messages-search.js
3381
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/messages-search.js
3710
3382
  var MAIL_FIELDS = /* @__PURE__ */ new Set(["to", "cc", "bcc", "subject", "mailbox", "label", "is"]);
3711
3383
  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");
3712
3384
  var prepareLucene = /* @__PURE__ */ __name(async (store, account2, request, messenger) => {
@@ -3992,6 +3664,23 @@ var searchLucene = /* @__PURE__ */ __name(async (store, account2, request, messe
3992
3664
  ...request.kind === "mail" ? { accounts: mailAccounts.map(({ provider, account: account3 }) => ({ resource: "mail", provider, account: account3 })) } : {}
3993
3665
  };
3994
3666
  }, "searchLucene");
3667
+ var countLucene = /* @__PURE__ */ __name(async (store, account2, request, messenger, cap) => {
3668
+ const prepared = await prepareLucene(store, account2, request, messenger);
3669
+ if (!prepared.scopeAccounts.length)
3670
+ return 0;
3671
+ const count2 = /* @__PURE__ */ __name((execution) => store.queries.countMatches(execution, cap), "count");
3672
+ const mailAccounts = prepared.scopeAccounts.filter(({ provider }) => provider === MAIL);
3673
+ const messages = await count2(prepared.execution);
3674
+ let mail = 0;
3675
+ if (mailAccounts.length)
3676
+ try {
3677
+ mail = await count2({ ...prepared.execution, accounts: mailAccounts, corpus: "mail" });
3678
+ } catch (error) {
3679
+ if (!(request.kind !== "mail" && error instanceof CliError && error.code === "validation_error"))
3680
+ throw error;
3681
+ }
3682
+ return messages === void 0 || mail === void 0 ? void 0 : messages + mail;
3683
+ }, "countLucene");
3995
3684
  var correctionsOf = /* @__PURE__ */ __name((items) => {
3996
3685
  const found = /* @__PURE__ */ new Map();
3997
3686
  for (const { corrections = [] } of items)
@@ -4037,7 +3726,7 @@ var statsLucene = /* @__PURE__ */ __name(async (store, account2, request, messen
4037
3726
  };
4038
3727
  }, "statsLucene");
4039
3728
 
4040
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/moment.js
3729
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/moment.js
4041
3730
  var AGO = /^(\d+)(m|h|d)$/;
4042
3731
  var AGO_MS = { m: 6e4, h: 36e5, d: 864e5 };
4043
3732
  var DATE = /^\d{4}-\d{2}-\d{2}/;
@@ -4077,7 +3766,7 @@ var dateWindow = /* @__PURE__ */ __name(({ sinceTime, untilTime, zone, now = Dat
4077
3766
  };
4078
3767
  }, "dateWindow");
4079
3768
 
4080
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/rankings-selection.js
3769
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/rankings-selection.js
4081
3770
  var RANKING_SELECTION_BYTES = 64 * 1024;
4082
3771
  var object = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0, "object");
4083
3772
  function invalid(message = "ranking selection is invalid \u2014 obtain a new drilldown from stats top") {
@@ -4246,7 +3935,7 @@ var readRankingSelection = /* @__PURE__ */ __name(async (store, input) => {
4246
3935
  };
4247
3936
  }, "readRankingSelection");
4248
3937
 
4249
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/search-record.js
3938
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/search-record.js
4250
3939
  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");
4251
3940
  var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
4252
3941
  command,
@@ -4256,7 +3945,7 @@ var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
4256
3945
  fieldsVersion: FIELD_VERSION
4257
3946
  }), "searchRecordOf");
4258
3947
 
4259
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/admin-statistics.js
3948
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/admin-statistics.js
4260
3949
  function invalid2(message) {
4261
3950
  throw new CliError("validation_error", message);
4262
3951
  }
@@ -4550,33 +4239,7 @@ var adminStatisticsService = /* @__PURE__ */ __name((deps) => ({
4550
4239
  }, "evidence")
4551
4240
  }), "adminStatisticsService");
4552
4241
 
4553
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/chat-coverage.js
4554
- var chatCoverage = /* @__PURE__ */ __name(async (store, account2, chatIds) => {
4555
- const ids = [...new Set(chatIds)];
4556
- if (ids.length === 0)
4557
- return [];
4558
- const found = new Map((await store.chats.chatCompleteness(account2, ids)).map((one) => [one.chatId, one]));
4559
- return Promise.all(ids.map(async (chatId) => {
4560
- const [stats] = await store.chats.chatStats(account2, chatId);
4561
- const title = stats?.title ?? await store.chats.chatTitle(account2, chatId);
4562
- const completeness = found.get(chatId) ?? {
4563
- chatId,
4564
- state: "unknown",
4565
- upToDate: null,
4566
- gaps: false,
4567
- reachesStart: false,
4568
- fetchedAt: null
4569
- };
4570
- return {
4571
- chatId,
4572
- title,
4573
- completeness,
4574
- held: { messages: stats?.messages ?? 0, oldestAt: stats?.oldestAt ?? null, newestAt: stats?.newestAt ?? null }
4575
- };
4576
- }));
4577
- }, "chatCoverage");
4578
-
4579
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/domain/thread.js
4242
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/thread.js
4580
4243
  var threadIdOf = /* @__PURE__ */ __name((value) => {
4581
4244
  if (value === void 0)
4582
4245
  return void 0;
@@ -4586,7 +4249,7 @@ var threadIdOf = /* @__PURE__ */ __name((value) => {
4586
4249
  return id2;
4587
4250
  }, "threadIdOf");
4588
4251
 
4589
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/questions.js
4252
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/questions.js
4590
4253
  var LINKS = /https?:\/\/\S+/g;
4591
4254
  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");
4592
4255
  var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2 }) => {
@@ -4613,7 +4276,7 @@ var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2 }) =>
4613
4276
  });
4614
4277
  }, "questions");
4615
4278
 
4616
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/chat-stats.js
4279
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/chat-stats.js
4617
4280
  var TOP_POSTS = 5;
4618
4281
  var JOINS = /* @__PURE__ */ new Set(["join", "add"]);
4619
4282
  var LEAVES = /* @__PURE__ */ new Set(["leave", "remove"]);
@@ -4730,7 +4393,7 @@ var median = /* @__PURE__ */ __name((values) => {
4730
4393
  return Math.round(sorted.length % 2 === 0 ? ((sorted[middle - 1] ?? upper) + upper) / 2 : upper);
4731
4394
  }, "median");
4732
4395
 
4733
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/member-history.js
4396
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/member-history.js
4734
4397
  var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
4735
4398
  const events = [];
4736
4399
  for (const stay of stays) {
@@ -4762,7 +4425,7 @@ var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
4762
4425
  return events.filter(({ at }) => Date.parse(at) >= since).sort((a, b) => Date.parse(a.at) - Date.parse(b.at) || a.id.localeCompare(b.id));
4763
4426
  }, "memberEvents");
4764
4427
 
4765
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/members-audit.js
4428
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/members-audit.js
4766
4429
  var AUDIT_PAGE = 200;
4767
4430
  var AUDIT_BUDGET = 10;
4768
4431
  var AUDIT_PAUSE_MS = 1e3;
@@ -4842,7 +4505,7 @@ var burstJoins = /* @__PURE__ */ __name((members) => {
4842
4505
  return found;
4843
4506
  }, "burstJoins");
4844
4507
 
4845
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/chats.js
4508
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/chats.js
4846
4509
  var EVENTS_DAYS = 7;
4847
4510
  var TRACKED_DAYS = 30;
4848
4511
  var STATS_PAGE = 1e3;
@@ -4902,7 +4565,7 @@ var chatsService = /* @__PURE__ */ __name((deps) => ({
4902
4565
  }
4903
4566
  const connection = await deps.connection();
4904
4567
  const shown = await connection.chat(chat);
4905
- const card = connection.group && (shown.kind === "group" || shown.kind === "channel") ? (({ description, link: link5, settings }) => ({ ...shown, description, link: link5, settings }))(await connection.group(shown.id)) : shown;
4568
+ const card = connection.group && (shown.kind === "group" || shown.kind === "channel") ? (({ description, link: link4, settings }) => ({ ...shown, description, link: link4, settings }))(await connection.group(shown.id)) : shown;
4906
4569
  if (card.members !== null || card.kind === "channel")
4907
4570
  return card;
4908
4571
  const held = await accountStoreIfOpen(deps);
@@ -4929,11 +4592,11 @@ var chatsService = /* @__PURE__ */ __name((deps) => ({
4929
4592
  }
4930
4593
  return capability(await deps.connection(), "chatEvents", "read who joined or left")(chat, { since: from });
4931
4594
  }, "events"),
4932
- inspect: /* @__PURE__ */ __name(async (link5) => {
4595
+ inspect: /* @__PURE__ */ __name(async (link4) => {
4933
4596
  if (deps.offline) {
4934
4597
  throw new CliError("validation_error", "`chats inspect` asks the messenger about the link; not with --offline");
4935
4598
  }
4936
- return capability(await deps.connection(), "inspect", "read a link")(link5);
4599
+ return capability(await deps.connection(), "inspect", "read a link")(link4);
4937
4600
  }, "inspect"),
4938
4601
  stats: /* @__PURE__ */ __name(async (chat, { since, by, timezone }) => {
4939
4602
  const store = await accountStore(deps);
@@ -5137,7 +4800,7 @@ var storedMembers = /* @__PURE__ */ __name(async (store, chatId) => {
5137
4800
  return members.length === 0 ? null : members;
5138
4801
  }, "storedMembers");
5139
4802
 
5140
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/task-categories.js
4803
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/task-categories.js
5141
4804
  var names = /* @__PURE__ */ __name((categories) => categories.map(({ name }) => name).join(", "), "names");
5142
4805
  var taskCategoryOf = /* @__PURE__ */ __name((categories = DEFAULT_TASK_CATEGORIES, flag = "--category") => (typed) => {
5143
4806
  const name = typed.trim().toLowerCase();
@@ -5187,7 +4850,7 @@ var categorize = /* @__PURE__ */ __name((text2, categories = DEFAULT_TASK_CATEGO
5187
4850
  return best.name;
5188
4851
  }, "categorize");
5189
4852
 
5190
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/task-rules.js
4853
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/task-rules.js
5191
4854
  var taskAccount = /* @__PURE__ */ __name(({ provider, account: account2 }) => `${provider}:${account2}`, "taskAccount");
5192
4855
  var RULES_IN = {
5193
4856
  dialog: "all",
@@ -5213,7 +4876,7 @@ var applyTaskRules = /* @__PURE__ */ __name(async (review, { store, account: acc
5213
4876
  const owner = taskAccount(account2);
5214
4877
  const result = { added: 0, closed: 0, review: 0 };
5215
4878
  const sourceOf2 = /* @__PURE__ */ __name((message) => formatLocator({ provider: account2.provider, account: account2.account, chat: message.chatId, message: message.id }), "sourceOf");
5216
- const open10 = /* @__PURE__ */ __name(async (message, group, kind) => {
4879
+ const open7 = /* @__PURE__ */ __name(async (message, group, kind) => {
5217
4880
  const { created, review: review2 = 0 } = await tasks.add({
5218
4881
  source: sourceOf2(message),
5219
4882
  sourceKind: "message",
@@ -5270,7 +4933,7 @@ var applyTaskRules = /* @__PURE__ */ __name(async (review, { store, account: acc
5270
4933
  let held = 0;
5271
4934
  for (const [index, { message, kind }] of opens.entries()) {
5272
4935
  if (index >= opens.length - keep2)
5273
- await open10(message, chat.id, kind);
4936
+ await open7(message, chat.id, kind);
5274
4937
  else if (!await hasTask(message)) {
5275
4938
  held += 1;
5276
4939
  onHeld?.({ source: sourceOf2(message), kind, category: categorize(message.text, categories) });
@@ -5393,7 +5056,7 @@ var applyTaskRulesToChats = /* @__PURE__ */ __name(async (store, account2, chatI
5393
5056
  return passes;
5394
5057
  }, "applyTaskRulesToChats");
5395
5058
 
5396
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/task-tag-filters.js
5059
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/task-tag-filters.js
5397
5060
  var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
5398
5061
  const tags = /* @__PURE__ */ new Map();
5399
5062
  for (const node of query ? walkQuery(query.root) : [])
@@ -5402,7 +5065,7 @@ var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
5402
5065
  return tags;
5403
5066
  }, "taskTagFilters");
5404
5067
 
5405
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/agenda.js
5068
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/agenda.js
5406
5069
  var DAY2 = 864e5;
5407
5070
  var CLAIMS = ["none", "mine", "others", "any"];
5408
5071
  var TASK_FIELDS = /* @__PURE__ */ new Set(["tag", "category", "claimed"]);
@@ -5440,9 +5103,9 @@ var agendaService = /* @__PURE__ */ __name((deps, now = Date.now) => ({
5440
5103
  return [];
5441
5104
  throw error;
5442
5105
  }), "find");
5443
- const open10 = await find();
5106
+ const open7 = await find();
5444
5107
  const tags = await taskTagFilters(store, parts.tasks);
5445
- const listed = parts.tasks ? await find(queryFilter(parts.tasks, taskColumns(holder, at, tags), { command: "tasks agenda" })) : open10;
5108
+ const listed = parts.tasks ? await find(queryFilter(parts.tasks, taskColumns(holder, at, tags), { command: "tasks agenda" })) : open7;
5446
5109
  const tasks = listed.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 }) => ({
5447
5110
  id: task2.id,
5448
5111
  key: task2.key,
@@ -5482,7 +5145,7 @@ var agendaService = /* @__PURE__ */ __name((deps, now = Date.now) => ({
5482
5145
  chat: chat.chatId,
5483
5146
  message: lastMessageId
5484
5147
  }),
5485
- openTasks: open10.filter((task2) => chatOf(task2.source) === chat.chatId).map((task2) => task2.id)
5148
+ openTasks: open7.filter((task2) => chatOf(task2.source) === chat.chatId).map((task2) => task2.id)
5486
5149
  }));
5487
5150
  const silentFor = /* @__PURE__ */ __name((chat) => at - Date.parse(chat.lastMessageAt), "silentFor");
5488
5151
  const shown = {
@@ -5494,7 +5157,7 @@ var agendaService = /* @__PURE__ */ __name((deps, now = Date.now) => ({
5494
5157
  const withCoverage = /* @__PURE__ */ __name((list2) => list2.map((chat) => ({ ...chat, coverage: covered.get(chat.chatId) })), "withCoverage");
5495
5158
  const inList = new Set((await store.tasks.categories()).map(({ name }) => name));
5496
5159
  const unlisted = /* @__PURE__ */ new Map();
5497
- for (const { category } of open10)
5160
+ for (const { category } of open7)
5498
5161
  if (category && !inList.has(category))
5499
5162
  unlisted.set(category, (unlisted.get(category) ?? 0) + 1);
5500
5163
  return {
@@ -5644,10 +5307,10 @@ var agendaItem = /* @__PURE__ */ __name((shown) => {
5644
5307
  };
5645
5308
  }, "agendaItem");
5646
5309
 
5647
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/archive.js
5310
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/archive.js
5648
5311
  import { setTimeout as sleep3 } from "node:timers/promises";
5649
5312
 
5650
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/backfill-estimate.js
5313
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/backfill-estimate.js
5651
5314
  var REQUEST_MS = 400;
5652
5315
  var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, maxPages, pauseMs }) => {
5653
5316
  const lowest = ranges[0];
@@ -5670,13 +5333,13 @@ var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, max
5670
5333
  };
5671
5334
  }, "estimateBackfill");
5672
5335
 
5673
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/domain/recovery.js
5336
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/recovery.js
5674
5337
  var withRecovery = /* @__PURE__ */ __name((error) => ({
5675
5338
  ...error,
5676
5339
  retryable: typeof error.retryable === "boolean" ? error.retryable : error.code === "rate_limited" || error.status === 429
5677
5340
  }), "withRecovery");
5678
5341
 
5679
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/batch.js
5342
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/batch.js
5680
5343
  var actionable = /* @__PURE__ */ __name((error) => {
5681
5344
  if (isCliFailure(error))
5682
5345
  return withRecovery({ code: error.code, message: error.message, ...error.details });
@@ -5759,7 +5422,7 @@ var mergeBatches = /* @__PURE__ */ __name((a, b) => {
5759
5422
  };
5760
5423
  }, "mergeBatches");
5761
5424
 
5762
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/patience.js
5425
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/patience.js
5763
5426
  import { setTimeout as sleep2 } from "node:timers/promises";
5764
5427
  var LONGEST_WAIT_MS = 5 * 60 * 1e3;
5765
5428
  var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
@@ -5782,7 +5445,7 @@ var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
5782
5445
  }
5783
5446
  }, "patiently");
5784
5447
 
5785
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/conversations/link.js
5448
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/conversations/link.js
5786
5449
  var RULES_VERSION = 5;
5787
5450
  var LOOK_BACK = 50;
5788
5451
  var SAME_SENDER_WITHIN = 10;
@@ -5814,7 +5477,7 @@ var linkMessages = /* @__PURE__ */ __name((messages, { handles = /* @__PURE__ */
5814
5477
  }
5815
5478
  return { links, parents, conversations };
5816
5479
  }, "linkMessages");
5817
- var replyLink = /* @__PURE__ */ __name((message, held) => message.replyToId !== void 0 && held.has(message.replyToId) ? [link3(message, message.replyToId, "provider", "reply", 1, "reply")] : [], "replyLink");
5480
+ var replyLink = /* @__PURE__ */ __name((message, held) => message.replyToId !== void 0 && held.has(message.replyToId) ? [link2(message, message.replyToId, "provider", "reply", 1, "reply")] : [], "replyLink");
5818
5481
  var mentionLinks = /* @__PURE__ */ __name((message, window2, handles) => {
5819
5482
  const links = [];
5820
5483
  const people = new Set([...mentioned(message.text, handles)].flatMap((handle) => handles.get(handle) ?? []));
@@ -5825,7 +5488,7 @@ var mentionLinks = /* @__PURE__ */ __name((message, window2, handles) => {
5825
5488
  continue;
5826
5489
  const target = latest(window2, (candidate) => candidate.senderId === sender && sameThread(candidate, message));
5827
5490
  if (target)
5828
- links.push(link3(message, target.id, "rule", "mention", 0.8, "mention-v1"));
5491
+ links.push(link2(message, target.id, "rule", "mention", 0.8, "mention-v1"));
5829
5492
  }
5830
5493
  return links;
5831
5494
  }, "mentionLinks");
@@ -5834,7 +5497,7 @@ var sameSenderLink = /* @__PURE__ */ __name((message, window2) => {
5834
5497
  return [];
5835
5498
  const at = Date.parse(message.timestamp);
5836
5499
  const target = latest(window2.slice(-SAME_SENDER_WITHIN), (candidate) => candidate.senderId === message.senderId && sameThread(candidate, message) && at - Date.parse(candidate.timestamp) <= SAME_SENDER_MS);
5837
- return target ? [link3(message, target.id, "rule", "same_sender", 0.5, "same-sender-v2")] : [];
5500
+ return target ? [link2(message, target.id, "rule", "same_sender", 0.5, "same-sender-v2")] : [];
5838
5501
  }, "sameSenderLink");
5839
5502
  var mentioned = /* @__PURE__ */ __name((text2, handles) => {
5840
5503
  const found = /* @__PURE__ */ new Set();
@@ -5870,9 +5533,9 @@ var latest = /* @__PURE__ */ __name((window2, matches) => {
5870
5533
  return void 0;
5871
5534
  }, "latest");
5872
5535
  var sameThread = /* @__PURE__ */ __name((a, b) => a.threadId === b.threadId, "sameThread");
5873
- var link3 = /* @__PURE__ */ __name((message, parentId, source, kind, confidence, method) => ({ messageId: message.id, parentId, source, kind, confidence, method }), "link");
5536
+ var link2 = /* @__PURE__ */ __name((message, parentId, source, kind, confidence, method) => ({ messageId: message.id, parentId, source, kind, confidence, method }), "link");
5874
5537
 
5875
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/images/context/index.js
5538
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/images/context/index.js
5876
5539
  var CONTEXT_MESSAGES = 3;
5877
5540
  var CONTEXT_MINUTES = 10;
5878
5541
  var MAX_CHARS = 1200;
@@ -5896,12 +5559,12 @@ var context = {
5896
5559
  }, "describe")
5897
5560
  };
5898
5561
 
5899
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/images/registry.js
5562
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/images/registry.js
5900
5563
  var BUILT_INS = [context];
5901
5564
  var providers = [...BUILT_INS];
5902
5565
  var registeredImageProviders = /* @__PURE__ */ __name(() => providers, "registeredImageProviders");
5903
5566
 
5904
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/conversations.js
5567
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/conversations.js
5905
5568
  var READ_PAGE = 5e3;
5906
5569
  var CHAIN = 50;
5907
5570
  var CONVERSATION_QUERY = {
@@ -6032,7 +5695,7 @@ var conversationsService = /* @__PURE__ */ __name((deps) => {
6032
5695
  }, "clearAnswers"),
6033
5696
  links: /* @__PURE__ */ __name(async (chat, message) => {
6034
5697
  const { store, chatId } = await found(chat);
6035
- const chosenOf = /* @__PURE__ */ __name((links) => links.find((link5) => !link5.stale), "chosenOf");
5698
+ const chosenOf = /* @__PURE__ */ __name((links) => links.find((link4) => !link4.stale), "chosenOf");
6036
5699
  const own = await store.conversations.links(chatId, message);
6037
5700
  const chosen = chosenOf(own);
6038
5701
  const chain = [];
@@ -6042,7 +5705,7 @@ var conversationsService = /* @__PURE__ */ __name((deps) => {
6042
5705
  chain.push(parent);
6043
5706
  parent = chosenOf(await store.conversations.links(chatId, parent))?.parentId ?? null;
6044
5707
  }
6045
- return { chat: chatId, message, links: own.map((link5) => ({ ...link5, chosen: link5 === chosen })), chain };
5708
+ return { chat: chatId, message, links: own.map((link4) => ({ ...link4, chosen: link4 === chosen })), chain };
6046
5709
  }, "links")
6047
5710
  };
6048
5711
  }, "conversationsService");
@@ -6053,7 +5716,7 @@ var sized = /* @__PURE__ */ __name((size4) => {
6053
5716
  return size4;
6054
5717
  }, "sized");
6055
5718
 
6056
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/embeddings-maintenance.js
5719
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/embeddings-maintenance.js
6057
5720
  var REFRESH_BOUNDS = { maxChats: 20, maxChunks: 2e3 };
6058
5721
  var MESSAGE_PAGE = 5e3;
6059
5722
  var PER_SESSION = 8;
@@ -6072,7 +5735,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = DEFAULT_TEXT_MODEL)
6072
5735
  price: remote.price,
6073
5736
  installed: true,
6074
5737
  perBatch: PER_REQUEST * concurrency,
6075
- open: /* @__PURE__ */ __name(async () => (await import("./remote-EYSK3XKD.js")).openRemote(remote, apiKey, { concurrency }), "open")
5738
+ open: /* @__PURE__ */ __name(async () => (await import("./remote-AGIJY73X.js")).openRemote(remote, apiKey, { concurrency }), "open")
6076
5739
  };
6077
5740
  }
6078
5741
  const model = textModel(choice);
@@ -6089,7 +5752,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = DEFAULT_TEXT_MODEL)
6089
5752
  if (!isTextModelInstalled(model, directory))
6090
5753
  throw notDownloaded(model.id);
6091
5754
  if (apart) {
6092
- const { openProcess } = await import("./process-7HHZZZLA.js");
5755
+ const { openProcess } = await import("./process-ZXO2MWRJ.js");
6093
5756
  return openProcess(model, directory, { threads: threads ?? defaultThreads() });
6094
5757
  }
6095
5758
  return openEmbedder(model, directory, { threads: threads ?? defaultThreads() });
@@ -6378,7 +6041,7 @@ var shaped = /* @__PURE__ */ __name(({ chatId, builtAt, algorithmVersion, pendin
6378
6041
  return { ...one, state };
6379
6042
  }, "shaped");
6380
6043
 
6381
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/search-catchup.js
6044
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/search-catchup.js
6382
6045
  var CATCH_UP_BOUNDS = { maxChunks: 500, maxMessages: 1e4, timeMs: 3e4 };
6383
6046
  var validateCatchUpBounds = /* @__PURE__ */ __name((options) => {
6384
6047
  for (const [key, value, maximum] of [
@@ -6431,7 +6094,7 @@ var catchUpSearch = /* @__PURE__ */ __name(async (deps, chat, options, signal, c
6431
6094
  }
6432
6095
  }, "catchUpSearch");
6433
6096
 
6434
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/archive.js
6097
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/archive.js
6435
6098
  var pushed = /* @__PURE__ */ __name((deps, what) => {
6436
6099
  if (deps.reads === "store") {
6437
6100
  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`);
@@ -6748,8 +6411,8 @@ var timeOfKey = /* @__PURE__ */ __name(async (store, account2, chatId, key, byTi
6748
6411
  return message?.timestamp ?? fallback;
6749
6412
  }, "timeOfKey");
6750
6413
 
6751
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/archive-gaps.js
6752
- import { createHash as createHash6, randomUUID as randomUUID6 } from "node:crypto";
6414
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/archive-gaps.js
6415
+ import { createHash as createHash6, randomUUID as randomUUID4 } from "node:crypto";
6753
6416
  var GAP_BOUNDS = { maxGaps: 5, limit: 500, timeMs: 3e4 };
6754
6417
  var validateRepair = /* @__PURE__ */ __name((messenger, options) => {
6755
6418
  const maxGaps = options.maxGaps ?? GAP_BOUNDS.maxGaps;
@@ -6808,7 +6471,7 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
6808
6471
  if (options.fingerprint !== void 0 && options.fingerprint !== before2.fingerprint)
6809
6472
  throw new CliError("validation_error", "the gap plan changed; inspect it again before repairing");
6810
6473
  const store = await deps.store();
6811
- const holder = randomUUID6();
6474
+ const holder = randomUUID4();
6812
6475
  if (!await store.sync.claim(before2.account, before2.chat, "gaps", holder, timeMs + 5e3))
6813
6476
  throw new CliError("validation_error", "another gap repair holds this chat; retry after it finishes");
6814
6477
  const started = Date.now();
@@ -6885,19 +6548,19 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
6885
6548
  return { plan, repair };
6886
6549
  }, "gapsService");
6887
6550
 
6888
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/attachments.js
6551
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/attachments.js
6889
6552
  import { createHash as createHash8 } from "node:crypto";
6890
- import { constants as constants4 } from "node:fs";
6891
- import { open as open9, readFile, stat as stat2 } from "node:fs/promises";
6553
+ import { constants as constants2 } from "node:fs";
6554
+ import { open as open6, readFile, stat as stat2 } from "node:fs/promises";
6892
6555
 
6893
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/attachments/directory.js
6894
- import { lstat as lstat5, readdir as readdir3, realpath as realpath6 } from "node:fs/promises";
6895
- import { basename as basename6, join as join11, relative as relative2, sep as sep2 } from "node:path";
6556
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/attachments/directory.js
6557
+ import { lstat as lstat2, readdir as readdir2, realpath as realpath3 } from "node:fs/promises";
6558
+ import { basename as basename4, join as join8, relative as relative2, sep as sep2 } from "node:path";
6896
6559
 
6897
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/sends/upload.js
6560
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/sends/upload.js
6898
6561
  import { openAsBlob, realpathSync } from "node:fs";
6899
- import { open as open7, stat } from "node:fs/promises";
6900
- import { basename as basename5, dirname as dirname5, extname, isAbsolute as isAbsolute2, relative, resolve as resolve5, sep } from "node:path";
6562
+ import { open as open4, stat } from "node:fs/promises";
6563
+ import { basename as basename3, dirname as dirname3, extname, isAbsolute as isAbsolute2, relative, resolve as resolve5, sep } from "node:path";
6901
6564
  var MAX_BUFFERED_UPLOAD_BYTES = 256 * 1024 * 1024;
6902
6565
  var uploadSize = /* @__PURE__ */ __name((source) => source.kind === "file" ? source.size : source.bytes.byteLength, "uploadSize");
6903
6566
  var PHOTO = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png", ".webp"]);
@@ -6913,7 +6576,7 @@ var SIGNATURES = {
6913
6576
  }, ".webp")
6914
6577
  };
6915
6578
  var fileHead = /* @__PURE__ */ __name(async (path) => {
6916
- const file = await open7(path, "r");
6579
+ const file = await open4(path, "r");
6917
6580
  try {
6918
6581
  const head = new Uint8Array(12);
6919
6582
  const { bytesRead } = await file.read(head, 0, head.length, 0);
@@ -6998,7 +6661,7 @@ var refusedPlace = /* @__PURE__ */ __name((path, app, env, platform = process.pl
6998
6661
  real = resolve5(realpathSync(ancestor), relative(ancestor, resolve5(path)));
6999
6662
  break;
7000
6663
  } catch {
7001
- const parent = dirname5(ancestor);
6664
+ const parent = dirname3(ancestor);
7002
6665
  if (parent === ancestor)
7003
6666
  break;
7004
6667
  ancestor = parent;
@@ -7050,7 +6713,7 @@ var readUpload = /* @__PURE__ */ __name(async (kind, path, { app, env = process.
7050
6713
  if (head !== void 0 && SIGNATURES[extension]?.(head) !== true) {
7051
6714
  throw new CliError("validation_error", `${path} is not a ${typesText(photoTypes ?? [])} image inside`);
7052
6715
  }
7053
- return { kind, name: basename5(path), source: { kind: "file", path: resolve5(path), size: size4 } };
6716
+ return { kind, name: basename3(path), source: { kind: "file", path: resolve5(path), size: size4 } };
7054
6717
  }, "readUpload");
7055
6718
  var checkFilename = /* @__PURE__ */ __name((filename, files) => {
7056
6719
  if (files.length === 0)
@@ -7096,28 +6759,28 @@ var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes, read) => {
7096
6759
  return { name, source };
7097
6760
  }, "readStickerFile");
7098
6761
 
7099
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/attachments/directory.js
6762
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/attachments/directory.js
7100
6763
  var MAX_FILES = 1e4;
7101
6764
  var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory, app, env) => {
7102
6765
  if (refusedPlace(directory, app, env))
7103
6766
  throw new CliError("validation_error", "--from-dir cannot read credential folders, the CLI's own folders or the message store");
7104
- const root = await realpath6(directory).catch(() => {
6767
+ const root = await realpath3(directory).catch(() => {
7105
6768
  throw new CliError("validation_error", "--from-dir must name an existing directory");
7106
6769
  });
7107
- const names2 = await readdir3(root).catch(() => {
6770
+ const names2 = await readdir2(root).catch(() => {
7108
6771
  throw new CliError("validation_error", "--from-dir must name a readable directory");
7109
6772
  });
7110
6773
  if (names2.length > MAX_FILES)
7111
6774
  throw new CliError("validation_error", "--from-dir holds too many files; use a smaller directory");
7112
6775
  const files = /* @__PURE__ */ new Map();
7113
6776
  for (const name of names2) {
7114
- const path = join11(root, name);
7115
- const info = await lstat5(path);
6777
+ const path = join8(root, name);
6778
+ const info = await lstat2(path);
7116
6779
  if (info.isSymbolicLink())
7117
6780
  throw new CliError("validation_error", "--from-dir cannot read symbolic links");
7118
6781
  if (!info.isFile())
7119
6782
  continue;
7120
- const canonical2 = await realpath6(path);
6783
+ const canonical2 = await realpath3(path);
7121
6784
  if (refusedPlace(canonical2, app, env))
7122
6785
  throw new CliError("validation_error", "--from-dir cannot read credential files, the CLI's own files or the message store");
7123
6786
  const inside2 = relative2(root, canonical2);
@@ -7135,20 +6798,20 @@ var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory, app,
7135
6798
  group.push(file);
7136
6799
  groups.set(file.messageId, group);
7137
6800
  if (file.name)
7138
- counts.set(basename6(file.name), (counts.get(basename6(file.name)) ?? 0) + 1);
6801
+ counts.set(basename4(file.name), (counts.get(basename4(file.name)) ?? 0) + 1);
7139
6802
  }
7140
6803
  const choices = /* @__PURE__ */ new Map();
7141
6804
  for (const group of groups.values()) {
7142
6805
  group.sort((a, b) => a.position - b.position);
7143
6806
  const candidates = group.map((file, index) => {
7144
6807
  const prefix = `${file.messageId}-${index + 1}`;
7145
- return [...files].filter(([name]) => name === prefix || name.startsWith(`${prefix}.`) || file.name !== null && name === `${prefix}-${basename6(file.name)}`).map(([, path]) => path);
6808
+ return [...files].filter(([name]) => name === prefix || name.startsWith(`${prefix}.`) || file.name !== null && name === `${prefix}-${basename4(file.name)}`).map(([, path]) => path);
7146
6809
  });
7147
6810
  if (candidates.some((paths) => paths.length > 1))
7148
6811
  throw new CliError("validation_error", "more than one directory file matches a download ordinal");
7149
6812
  const complete = candidates.every((paths) => paths.length === 1);
7150
6813
  group.forEach((file, index) => {
7151
- const own = file.name === null ? void 0 : basename6(file.name);
6814
+ const own = file.name === null ? void 0 : basename4(file.name);
7152
6815
  const named2 = own && counts.get(own) === 1 ? files.get(own) : void 0;
7153
6816
  const canonical2 = complete ? candidates[index]?.[0] : void 0;
7154
6817
  if (named2 && canonical2 && named2 !== canonical2 || !complete && own && files.has(own) && (counts.get(own) ?? 0) > 1)
@@ -8206,7 +7869,7 @@ function imageSize(input) {
8206
7869
  }
8207
7870
  __name(imageSize, "imageSize");
8208
7871
 
8209
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/attachments/ocr.js
7872
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/attachments/ocr.js
8210
7873
  var MAX_PAGES = 20;
8211
7874
  var MAX_PIXELS = 2e7;
8212
7875
  var cancelled = /* @__PURE__ */ __name((signal) => {
@@ -8357,7 +8020,7 @@ var ocrPdf = /* @__PURE__ */ __name(async (bytes2, pipeline2, load, signal) => {
8357
8020
  }
8358
8021
  }, "ocrPdf");
8359
8022
 
8360
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/attachments/pdf-preview.js
8023
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/attachments/pdf-preview.js
8361
8024
  var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = importEngine, env = process.env) => {
8362
8025
  const limits = pdfPreviewLimits(env);
8363
8026
  const cancelled4 = /* @__PURE__ */ __name(() => {
@@ -8434,10 +8097,10 @@ var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = impo
8434
8097
  }
8435
8098
  }, "pdfPreview");
8436
8099
 
8437
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/attachments/transfer.js
8100
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/attachments/transfer.js
8438
8101
  import { createHash as createHash7 } from "node:crypto";
8439
- import { constants as constants3 } from "node:fs";
8440
- import { lstat as lstat6, open as open8 } from "node:fs/promises";
8102
+ import { constants } from "node:fs";
8103
+ import { lstat as lstat3, open as open5 } from "node:fs/promises";
8441
8104
  var MAX_CHUNK_BYTES = 1024 * 1024;
8442
8105
  var validateWindow = /* @__PURE__ */ __name(({ offsetBytes = 0, chunkBytes = 524288, ifSha256 }) => {
8443
8106
  if (!Number.isSafeInteger(offsetBytes) || offsetBytes < 0 || !Number.isSafeInteger(chunkBytes) || chunkBytes < 1 || chunkBytes > MAX_CHUNK_BYTES || ifSha256 !== void 0 && !/^[a-f0-9]{64}$/i.test(ifSha256))
@@ -8453,14 +8116,14 @@ var retainedBytes = /* @__PURE__ */ __name(async (path, options, captureFile = f
8453
8116
  }, "cancelled");
8454
8117
  cancelled4();
8455
8118
  try {
8456
- const before2 = await lstat6(path);
8119
+ const before2 = await lstat3(path);
8457
8120
  if (!before2.isFile() || before2.isSymbolicLink())
8458
8121
  throw new CliError("validation_error", "the retained attachment must be a regular file");
8459
8122
  if (before2.size > maxBytes)
8460
8123
  throw new CliError("validation_error", `the retained attachment exceeds ${maxBytes / 1024 / 1024} MiB; configure MESSAGING_ATTACHMENT_MAX_MIB`);
8461
8124
  if (offsetBytes > before2.size)
8462
8125
  throw new CliError("validation_error", "the byte offset is past the end of this attachment");
8463
- const handle = await open8(path, constants3.O_RDONLY | (constants3.O_NOFOLLOW ?? 0) | (constants3.O_NONBLOCK ?? 0));
8126
+ const handle = await open5(path, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0));
8464
8127
  try {
8465
8128
  const opened = await handle.stat();
8466
8129
  if (!opened.isFile() || opened.ino !== before2.ino || opened.dev !== before2.dev || opened.size !== before2.size)
@@ -8542,7 +8205,7 @@ var transferMime = /* @__PURE__ */ __name((head, hint, name = null) => {
8542
8205
  return hint !== null && /^[a-z0-9.+-]+\/[a-z0-9.+-]+$/i.test(hint) ? hint : "application/octet-stream";
8543
8206
  }, "transferMime");
8544
8207
 
8545
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/attachments.js
8208
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/attachments.js
8546
8209
  var ATTACHMENT_QUERY = {
8547
8210
  entity: "attachment",
8548
8211
  backend: "sql",
@@ -8563,7 +8226,7 @@ var ATTACHMENT_QUERY = {
8563
8226
  var PAGE3 = 200;
8564
8227
  var outcome = /* @__PURE__ */ __name(async (file, path, load, signal, noFollow = false, ocr, env = process.env) => {
8565
8228
  const maxBytes = attachmentMaxBytes(env);
8566
- const tooLarge = /* @__PURE__ */ __name(() => ({
8229
+ const tooLarge2 = /* @__PURE__ */ __name(() => ({
8567
8230
  status: "too-large",
8568
8231
  issue: withRecovery({
8569
8232
  code: "validation_error",
@@ -8579,15 +8242,15 @@ var outcome = /* @__PURE__ */ __name(async (file, path, load, signal, noFollow =
8579
8242
  if (known2 === "unsupported")
8580
8243
  return { status: "unsupported" };
8581
8244
  if (size4 > maxBytes)
8582
- return tooLarge();
8583
- const handle = await open9(path, constants4.O_RDONLY | (noFollow ? constants4.O_NOFOLLOW : 0));
8245
+ return tooLarge2();
8246
+ const handle = await open6(path, constants2.O_RDONLY | (noFollow ? constants2.O_NOFOLLOW : 0));
8584
8247
  let bytes2;
8585
8248
  try {
8586
8249
  const opened = await handle.stat();
8587
8250
  if (!opened.isFile())
8588
8251
  return { status: "missing" };
8589
8252
  if (opened.size > maxBytes)
8590
- return tooLarge();
8253
+ return tooLarge2();
8591
8254
  bytes2 = new Uint8Array(await readFile(handle, { signal }));
8592
8255
  } finally {
8593
8256
  await handle.close();
@@ -8923,7 +8586,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
8923
8586
  }, "setText")
8924
8587
  }), "attachmentsService");
8925
8588
 
8926
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/chat-documents.js
8589
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/chat-documents.js
8927
8590
  var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
8928
8591
  list: /* @__PURE__ */ __name(async (chat, { limit, offset, ref }) => {
8929
8592
  const store = await accountStore(deps);
@@ -8953,7 +8616,7 @@ var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
8953
8616
  }, "list")
8954
8617
  }), "chatDocumentsService");
8955
8618
 
8956
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/retention.js
8619
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/retention.js
8957
8620
  var observationDuration = /* @__PURE__ */ __name((text2, flag) => {
8958
8621
  const match = /^(\d+(?:\.\d+)?)([smhdw])$/.exec(text2);
8959
8622
  const units2 = { s: 1e3, m: 6e4, h: 36e5, d: 864e5, w: 6048e5 };
@@ -9040,7 +8703,7 @@ var isRetentionSelection = /* @__PURE__ */ __name((selection) => {
9040
8703
  }
9041
8704
  }, "isRetentionSelection");
9042
8705
 
9043
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/counters.js
8706
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/counters.js
9044
8707
  var counterFields = /* @__PURE__ */ __name((text2 = "views,reactions,comments") => {
9045
8708
  const fields = text2.split(",").map((one) => one.trim());
9046
8709
  if (!fields.length || fields.some((one) => !COUNTER_FIELDS.includes(one)) || new Set(fields).size !== fields.length)
@@ -9247,7 +8910,7 @@ var countersService = /* @__PURE__ */ __name((deps) => {
9247
8910
  };
9248
8911
  }, "countersService");
9249
8912
 
9250
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/search-refresh.js
8913
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/search-refresh.js
9251
8914
  var SYNC_KEY = "messages.sync-first";
9252
8915
  var SYNC_BOUNDS = { maxChats: 5, timeMs: 3e4, maxMessages: 500 };
9253
8916
  var keyOf2 = /* @__PURE__ */ __name((chat) => JSON.stringify([chat.account.provider, chat.account.account, chat.chatId]), "keyOf");
@@ -9379,7 +9042,7 @@ var withRefresh = /* @__PURE__ */ __name((found, refreshed) => ({
9379
9042
  ...!refreshed || refreshed.complete ? {} : { coverage: { ...found.coverage, state: "stale" } }
9380
9043
  }), "withRefresh");
9381
9044
 
9382
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/embeddings-search.js
9045
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/embeddings-search.js
9383
9046
  var CANDIDATES = 50;
9384
9047
  var WORD_HITS = 200;
9385
9048
  var RRF_K = 60;
@@ -9654,13 +9317,13 @@ var meanOf = /* @__PURE__ */ __name((vectors) => {
9654
9317
  return mean.map((value) => value / length);
9655
9318
  }, "meanOf");
9656
9319
 
9657
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/embeddings.js
9320
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/embeddings.js
9658
9321
  var embeddingsService = /* @__PURE__ */ __name((deps) => ({
9659
9322
  ...embeddingsMaintenance(deps),
9660
9323
  ...embeddingsSearch(deps)
9661
9324
  }), "embeddingsService");
9662
9325
 
9663
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/folders.js
9326
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/folders.js
9664
9327
  var foldersService = /* @__PURE__ */ __name((deps) => {
9665
9328
  const online = /* @__PURE__ */ __name(async (command) => {
9666
9329
  if (deps.offline)
@@ -9789,19 +9452,19 @@ var foldersService = /* @__PURE__ */ __name((deps) => {
9789
9452
  await guardedWrite(deps.guard, { operationId, chatId: null, kind: "account", action: "folder-order" }, () => reorder(folders.map((one) => one.id)));
9790
9453
  return { operationId, folders: folders.map(({ id: id2, title }) => ({ id: id2, title })) };
9791
9454
  }, "order"),
9792
- join: /* @__PURE__ */ __name(async (link5) => {
9793
- if (link5.trim() === "")
9455
+ join: /* @__PURE__ */ __name(async (link4) => {
9456
+ if (link4.trim() === "")
9794
9457
  throw new CliError("validation_error", "give the folder's link");
9795
9458
  const connection = await online("chats folders join");
9796
- const join13 = capability(connection, "joinFolder", "join a shared folder");
9459
+ const join10 = capability(connection, "joinFolder", "join a shared folder");
9797
9460
  const operationId = newOperationId();
9798
- const folder = await guardedWrite(deps.guard, { operationId, chatId: null, kind: "account", action: "folder-join" }, () => join13(link5.trim()));
9461
+ const folder = await guardedWrite(deps.guard, { operationId, chatId: null, kind: "account", action: "folder-join" }, () => join10(link4.trim()));
9799
9462
  return { operationId, folder };
9800
9463
  }, "join")
9801
9464
  };
9802
9465
  }, "foldersService");
9803
9466
 
9804
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/inbox.js
9467
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/inbox.js
9805
9468
  var INBOX_CHATS = 20;
9806
9469
  var REVIEW_DAYS = 3;
9807
9470
  var UNANSWERED_HOURS = 24;
@@ -9954,7 +9617,7 @@ var reviewIn = /* @__PURE__ */ __name(async (adapter, { since, points, chat, kin
9954
9617
  await onReviewed?.(reviewed);
9955
9618
  if (unansweredAfterHours === void 0)
9956
9619
  return reviewed;
9957
- const open10 = [];
9620
+ const open7 = [];
9958
9621
  for (const one of reviewed.chats) {
9959
9622
  const admins = answerers2.get(one.id);
9960
9623
  const questions2 = unanswered(one.messages, {
@@ -9962,10 +9625,10 @@ var reviewIn = /* @__PURE__ */ __name(async (adapter, { since, points, chat, kin
9962
9625
  before: now - unansweredAfterHours * 36e5
9963
9626
  });
9964
9627
  if (questions2.length > 0) {
9965
- open10.push({ ...one, messages: questions2, answeredBy: admins === void 0 ? "owner" : "owner-and-admins" });
9628
+ open7.push({ ...one, messages: questions2, answeredBy: admins === void 0 ? "owner" : "owner-and-admins" });
9966
9629
  }
9967
9630
  }
9968
- return { ...reviewed, chats: open10, unanswered: { olderThanHours: unansweredAfterHours } };
9631
+ return { ...reviewed, chats: open7, unanswered: { olderThanHours: unansweredAfterHours } };
9969
9632
  }, "reviewIn");
9970
9633
  var inboxService = /* @__PURE__ */ __name((deps) => {
9971
9634
  const reader = /* @__PURE__ */ __name(async () => {
@@ -10009,7 +9672,7 @@ var inboxService = /* @__PURE__ */ __name((deps) => {
10009
9672
  };
10010
9673
  }, "inboxService");
10011
9674
 
10012
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/mentions.js
9675
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/mentions.js
10013
9676
  var REVIEW_COUNT = 500;
10014
9677
  var mentionsService = /* @__PURE__ */ __name((deps) => {
10015
9678
  const located = /* @__PURE__ */ __name(async () => {
@@ -10088,7 +9751,7 @@ var mentionsService = /* @__PURE__ */ __name((deps) => {
10088
9751
  };
10089
9752
  }, "mentionsService");
10090
9753
 
10091
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/domain/message-link.js
9754
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/message-link.js
10092
9755
  var messageLinkTarget = /* @__PURE__ */ __name((reference, message, provider) => {
10093
9756
  if (isLocator(reference)) {
10094
9757
  if (message !== void 0)
@@ -10118,24 +9781,24 @@ var validMessageId = /* @__PURE__ */ __name((id2) => {
10118
9781
  }))
10119
9782
  throw new CliError("validation_error", "a message id must be nonempty, at most 256 characters, without spaces or controls");
10120
9783
  }, "validMessageId");
10121
- var validatePermalink = /* @__PURE__ */ __name((link5) => {
10122
- if (link5.url === null) {
10123
- if (link5.access !== "unavailable" || !["unsupported_chat", "unsupported_provider", "offline"].includes(link5.reason))
9784
+ var validatePermalink = /* @__PURE__ */ __name((link4) => {
9785
+ if (link4.url === null) {
9786
+ if (link4.access !== "unavailable" || !["unsupported_chat", "unsupported_provider", "offline"].includes(link4.reason))
10124
9787
  throw new CliError("validation_error", "the messenger returned invalid permalink metadata");
10125
- return { url: link5.url, access: link5.access, reason: link5.reason };
9788
+ return { url: link4.url, access: link4.access, reason: link4.reason };
10126
9789
  }
10127
9790
  let url;
10128
9791
  try {
10129
- url = new URL(link5.url);
9792
+ url = new URL(link4.url);
10130
9793
  } catch {
10131
9794
  throw new CliError("validation_error", "the messenger returned an invalid permalink");
10132
9795
  }
10133
- if (url.protocol !== "https:" || url.username || url.password || /\s/u.test(link5.url) || link5.reason !== null || !["public", "restricted", "unknown"].includes(link5.access))
9796
+ if (url.protocol !== "https:" || url.username || url.password || /\s/u.test(link4.url) || link4.reason !== null || !["public", "restricted", "unknown"].includes(link4.access))
10134
9797
  throw new CliError("validation_error", "the messenger returned an invalid permalink");
10135
- return { url: link5.url, access: link5.access, reason: link5.reason };
9798
+ return { url: link4.url, access: link4.access, reason: link4.reason };
10136
9799
  }, "validatePermalink");
10137
9800
 
10138
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/domain/pin-duration.js
9801
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/pin-duration.js
10139
9802
  var spokenSeconds = /* @__PURE__ */ __name((seconds) => {
10140
9803
  if (seconds % 86400 === 0 && seconds > 86400)
10141
9804
  return `${seconds / 86400}d`;
@@ -10167,7 +9830,7 @@ var pinDurationOf = /* @__PURE__ */ __name((value, allowed, flag = "--expire-tim
10167
9830
  return seconds;
10168
9831
  }, "pinDurationOf");
10169
9832
 
10170
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/sends/send-as.js
9833
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/sends/send-as.js
10171
9834
  var sendAsCheck = /* @__PURE__ */ __name((connection, sendAs) => {
10172
9835
  if (sendAs === void 0) {
10173
9836
  const saved = connection.savedSender?.bind(connection);
@@ -10192,7 +9855,18 @@ var typedSendAs = /* @__PURE__ */ __name((typed) => {
10192
9855
  return sendAs;
10193
9856
  }, "typedSendAs");
10194
9857
 
10195
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/search/question-plan.js
9858
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/search/total.js
9859
+ var TOTAL_CAP = 1e4;
9860
+ var totalOf = /* @__PURE__ */ __name((count2, shown, hasMore, exact = true) => {
9861
+ const least = shown + (hasMore ? 1 : 0);
9862
+ if (count2 === void 0 || count2 < least)
9863
+ return { value: least, relation: "gte" };
9864
+ if (count2 > TOTAL_CAP)
9865
+ return { value: TOTAL_CAP, relation: "gte" };
9866
+ return { value: count2, relation: exact ? "eq" : "gte" };
9867
+ }, "totalOf");
9868
+
9869
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/search/question-plan.js
10196
9870
  var words = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}]+/gu) ?? [], "words");
10197
9871
  var scaffolding = new Set(words("what which how many much who where when is are was were do does did can could should we the a an for of to under from in on at has have \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u043A\u0430\u043A\u043E\u0439 \u043A\u0430\u043A\u0430\u044F \u043A\u0430\u043A\u0438\u0435 \u043A\u0430\u043A\u043E\u0435 \u043A\u0442\u043E \u043A\u043E\u043C\u0443 \u043A\u0435\u043C \u0433\u0434\u0435 \u043A\u043E\u0433\u0434\u0430 \u043A\u0430\u043A \u0447\u0442\u043E \u0432\u043E \u043F\u043E \u043D\u0430 \u0432 \u043A \u0441 \u0443 \u0447\u0435\u0440\u0435\u0437 \u043B\u0438 \u0434\u043E\u043B\u0436\u0435\u043D \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0443\u0436\u043D\u043E \u0438\u0434\u0451\u0442 \u0438\u0434\u0435\u0442 \u043C\u043E\u0436\u043D\u043E \u043C\u043E\u0436\u0435\u0442 \u043C\u043E\u0433\u0443\u0442"));
10198
9872
  var questionWord = /\b(?:what|which|how|who|where|when|can|could|should)\b|(?:^|\s)(?:сколько|какой|какая|какие|какое|кто|кому|кем|где|когда|как|что|можно|может|могут|ли)(?:\s|$)/iu;
@@ -10308,7 +9982,7 @@ function planQuestion(text2, strict = false) {
10308
9982
  }
10309
9983
  __name(planQuestion, "planQuestion");
10310
9984
 
10311
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/messages-combined.js
9985
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/messages-combined.js
10312
9986
  var COMBINED_DEFAULTS = { candidateDepth: 300, rrfK: 60, rerank: "all", chatCap: 0 };
10313
9987
  var tokensOf = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}\p{Co}\p{M}]+/gu) ?? [], "tokensOf");
10314
9988
  var searchCombined = /* @__PURE__ */ __name(async (store, account2, request, messenger = {}, options = COMBINED_DEFAULTS) => {
@@ -10501,7 +10175,7 @@ var signals = /* @__PURE__ */ __name((hit, terms, corrections, execution, mode,
10501
10175
  return mode === "coverage" ? coverage * 4 : mode === "proximity" ? proximity : mode === "phrase" ? phrase : coverage * 4 + proximity + phrase;
10502
10176
  }, "signals");
10503
10177
 
10504
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/messages-discovery.js
10178
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/messages-discovery.js
10505
10179
  var MEANING_DEPTH = 100;
10506
10180
  var RRF_K2 = 60;
10507
10181
  var RERANK_DEPTH = 50;
@@ -10512,11 +10186,12 @@ var FOLLOW_UP_HITS = 5;
10512
10186
  var FOLLOW_UPS_PER_HIT = 2;
10513
10187
  var RARE_AT = 3;
10514
10188
  var FOLLOW_UP_CANDIDATES = 20;
10189
+ var discoveryRequest = /* @__PURE__ */ __name((asked) => asked.ast !== void 0 || asked.exact || !asked.text ? asked : {
10190
+ ...asked,
10191
+ text: asked.text.replace(new RegExp("(?<=\\p{L})\\?(?=\\s|$)", "gu"), "").replace(/"(?:[^"\\]|\\.)*"|(?<=\d):(?=\d)/gu, (found) => found === ":" ? " " : found)
10192
+ }, "discoveryRequest");
10515
10193
  var searchDiscovery = /* @__PURE__ */ __name(async (store, account2, asked, messenger = {}, meaning, rerank) => {
10516
- const request = asked.ast !== void 0 || asked.exact || !asked.text ? asked : {
10517
- ...asked,
10518
- text: asked.text.replace(new RegExp("(?<=\\p{L})\\?(?=\\s|$)", "gu"), "").replace(/"(?:[^"\\]|\\.)*"|(?<=\d):(?=\d)/gu, (found) => found === ":" ? " " : found)
10519
- };
10194
+ const request = discoveryRequest(asked);
10520
10195
  const original = await prepareLucene(store, account2, request, messenger);
10521
10196
  const text2 = request.text ?? "";
10522
10197
  const plan = planQuestion(text2, request.ast !== void 0 || !!request.exact || !!request.newest);
@@ -10805,7 +10480,7 @@ var mixedWithReranker = /* @__PURE__ */ __name((head, scores) => {
10805
10480
  })).sort((a, b) => b.mixed - a.mixed).map(({ hit }) => hit);
10806
10481
  }, "mixedWithReranker");
10807
10482
 
10808
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/thread-context.js
10483
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/thread-context.js
10809
10484
  var THREAD_BOUNDS = { maxHops: 8, maxMessages: 50, maxBytes: 65536, withinMs: 864e5 };
10810
10485
  var bytes = /* @__PURE__ */ __name((items, links) => Buffer.byteLength(JSON.stringify({ items, links }), "utf8"), "bytes");
10811
10486
  var threadBounds = /* @__PURE__ */ __name((options = {}) => {
@@ -10905,14 +10580,14 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account2, chat, mes
10905
10580
  const rows = await store.conversations.links(account2, chat, id2, { limit: bounds.maxMessages + 1 });
10906
10581
  if (rows.length > bounds.maxMessages)
10907
10582
  stopped("links");
10908
- cache.set(id2, rows.slice(0, bounds.maxMessages).map((link5) => ({
10909
- ...link5,
10910
- stale: link5.stale || link5.source !== "agent" && state.algorithmVersion !== RULES_VERSION
10583
+ cache.set(id2, rows.slice(0, bounds.maxMessages).map((link4) => ({
10584
+ ...link4,
10585
+ stale: link4.stale || link4.source !== "agent" && state.algorithmVersion !== RULES_VERSION
10911
10586
  })));
10912
10587
  }
10913
10588
  return cache.get(id2);
10914
10589
  }, "linksOf");
10915
- const chosen = /* @__PURE__ */ __name((links) => links.find((link5) => !link5.stale), "chosen");
10590
+ const chosen = /* @__PURE__ */ __name((links) => links.find((link4) => !link4.stale), "chosen");
10916
10591
  const queue = [{ id: message, hops: 0 }];
10917
10592
  const queued = /* @__PURE__ */ new Set([message]);
10918
10593
  const parents = /* @__PURE__ */ new Map();
@@ -10943,8 +10618,8 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account2, chat, mes
10943
10618
  const displayed = node.id === message ? { ...body, anchor: true } : body;
10944
10619
  const own = await linksOf(node.id);
10945
10620
  const parent = chosen(own);
10946
- const evidence = own.filter((link5) => link5 === parent || link5.stale).map((link5) => ({ ...link5, messageId: node.id, chosen: link5 === parent })).filter((link5) => !result.links.some((old) => old.messageId === link5.messageId && old.parentId === link5.parentId && old.source === link5.source && old.kind === link5.kind && old.method === link5.method));
10947
- result.stale ||= evidence.some((link5) => link5.stale);
10621
+ const evidence = own.filter((link4) => link4 === parent || link4.stale).map((link4) => ({ ...link4, messageId: node.id, chosen: link4 === parent })).filter((link4) => !result.links.some((old) => old.messageId === link4.messageId && old.parentId === link4.parentId && old.source === link4.source && old.kind === link4.kind && old.method === link4.method));
10622
+ result.stale ||= evidence.some((link4) => link4.stale);
10948
10623
  if (bytes([...result.items, displayed], [...result.links, ...evidence]) > bounds.maxBytes) {
10949
10624
  stopped("bytes");
10950
10625
  break;
@@ -10980,9 +10655,9 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account2, chat, mes
10980
10655
  const childLinks = await linksOf(child.messageId);
10981
10656
  if (chosen(childLinks)?.parentId === node.id)
10982
10657
  add(child.messageId);
10983
- else if (childLinks.some((link5) => link5.stale && link5.parentId === node.id)) {
10658
+ else if (childLinks.some((link4) => link4.stale && link4.parentId === node.id)) {
10984
10659
  result.stale = true;
10985
- const stale = childLinks.filter((link5) => link5.stale && link5.parentId === node.id).map((link5) => ({ ...link5, messageId: child.messageId, chosen: false })).filter((link5) => !result.links.some((old) => old.messageId === link5.messageId && old.parentId === link5.parentId && old.source === link5.source && old.kind === link5.kind && old.method === link5.method));
10660
+ const stale = childLinks.filter((link4) => link4.stale && link4.parentId === node.id).map((link4) => ({ ...link4, messageId: child.messageId, chosen: false })).filter((link4) => !result.links.some((old) => old.messageId === link4.messageId && old.parentId === link4.parentId && old.source === link4.source && old.kind === link4.kind && old.method === link4.method));
10986
10661
  if (bytes(result.items, [...result.links, ...stale]) <= bounds.maxBytes)
10987
10662
  result.links.push(...stale);
10988
10663
  else
@@ -11004,7 +10679,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account2, chat, mes
11004
10679
  return result;
11005
10680
  }, "readThreadContext");
11006
10681
 
11007
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/messages-archive-search.js
10682
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/messages-archive-search.js
11008
10683
  var SEARCH_FILL_MS = 200;
11009
10684
  var statsStore = /* @__PURE__ */ __name(async (store, account2, request, messenger = {}) => {
11010
10685
  const stop = Date.now() + SEARCH_FILL_MS;
@@ -11039,8 +10714,15 @@ var searchStore = /* @__PURE__ */ __name(async (store, account2, request, messen
11039
10714
  if (!Number.isInteger(offset) || offset < 0 || offset > MAX_SEARCH_OFFSET)
11040
10715
  throw new CliError("validation_error", `offset takes a whole number from 0 to ${MAX_SEARCH_OFFSET}`);
11041
10716
  const found = await searchPage(store, account2, { ...request, limit: request.limit + offset }, messenger, meaning, rerank);
10717
+ const discovery = found.query?.discovery;
10718
+ const total = discovery ? totalOf(discovery.candidates, found.items.length, found.hasMore, !discovery.truncated) : totalOf(await countLucene(store, account2, { ...request.discover ? discoveryRequest(request) : request, limit: request.limit + offset }, messenger, TOTAL_CAP).catch((error) => {
10719
+ if (isCliError(error) && error.details.reason === "query.too-large")
10720
+ return void 0;
10721
+ throw error;
10722
+ }), found.items.length, found.hasMore);
11042
10723
  return {
11043
10724
  ...found,
10725
+ total,
11044
10726
  items: found.items.slice(offset),
11045
10727
  ...found.hasMore && offset + request.limit <= MAX_SEARCH_OFFSET ? { nextOffset: offset + request.limit } : {}
11046
10728
  };
@@ -11064,12 +10746,12 @@ var accountOf2 = /* @__PURE__ */ __name((hit) => {
11064
10746
  }, "accountOf");
11065
10747
  var keyOf3 = /* @__PURE__ */ __name(({ provider, account: account2 }) => `${provider}/${account2}`, "keyOf");
11066
10748
 
11067
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/pictures.js
10749
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/pictures.js
11068
10750
  import { createHash as createHash9 } from "node:crypto";
11069
10751
  import { readFile as readFile2, stat as stat3 } from "node:fs/promises";
11070
10752
  import { setTimeout as sleep4 } from "node:timers/promises";
11071
10753
 
11072
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/domain/models.js
10754
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/models.js
11073
10755
  var GROUP_SETTINGS = [
11074
10756
  "allCanPin",
11075
10757
  "onlyAdminsAdd",
@@ -11083,10 +10765,10 @@ var ADMIN_RIGHTS = ["read", "members", "admins", "info", "pin", "link", "post",
11083
10765
  var senderIsMe = /* @__PURE__ */ __name((message, account2) => message.outgoing === true || message.senderId !== null && String(message.senderId) === account2, "senderIsMe");
11084
10766
  var MEDIA_KINDS = ["photo", "video", "file", "audio", "link"];
11085
10767
 
11086
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/file-download.js
10768
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/file-download.js
11087
10769
  import { createWriteStream, mkdirSync } from "node:fs";
11088
- import { link as link4, rm } from "node:fs/promises";
11089
- import { basename as basename7, join as join12, resolve as resolve6 } from "node:path";
10770
+ import { link as link3, rm } from "node:fs/promises";
10771
+ import { basename as basename5, join as join9, resolve as resolve6 } from "node:path";
11090
10772
  import { Readable, Transform } from "node:stream";
11091
10773
  import { pipeline } from "node:stream/promises";
11092
10774
  var refreshedFiles = /* @__PURE__ */ __name((files) => files.flatMap(({ kind, name, position, providerRef }) => providerRef === void 0 || Object.keys(providerRef).length === 0 ? [] : [
@@ -11161,7 +10843,7 @@ var EXTENSIONS = {
11161
10843
  };
11162
10844
  var BY_KIND = { photo: "jpg" };
11163
10845
  var safeName = /* @__PURE__ */ __name((name, platform = process.platform) => {
11164
- let plain = name === void 0 ? "" : basename7(name.replaceAll("\\", "/")).replace(/[\p{Cc}​-‏‪-‮⁦-⁩]/gu, "").replace(/^\.+/, "");
10846
+ let plain = name === void 0 ? "" : basename5(name.replaceAll("\\", "/")).replace(/[\p{Cc}​-‏‪-‮⁦-⁩]/gu, "").replace(/^\.+/, "");
11165
10847
  if (platform === "win32") {
11166
10848
  plain = plain.replace(/[<>:"|?*]/g, "_").replace(/[. ]+$/, "");
11167
10849
  if (/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(plain))
@@ -11175,7 +10857,7 @@ var save = /* @__PURE__ */ __name(async (file, directory, fallbackName, { unique
11175
10857
  const extension = EXTENSIONS[file.mime ?? ""] ?? BY_KIND[file.kind];
11176
10858
  return own ?? (extension ? `${fallbackName}.${extension}` : fallbackName);
11177
10859
  }, "fileName");
11178
- const partial = join12(directory, `.${fileName()}.${process.pid}.part`);
10860
+ const partial = join9(directory, `.${fileName()}.${process.pid}.part`);
11179
10861
  let bytes2 = 0;
11180
10862
  const counting = new Transform({
11181
10863
  transform(chunk, _encoding, done2) {
@@ -11188,8 +10870,8 @@ var save = /* @__PURE__ */ __name(async (file, directory, fallbackName, { unique
11188
10870
  const name = fileName();
11189
10871
  const names2 = unique && own ? [name, `${fallbackName}-${own}`] : [name];
11190
10872
  for (const candidate of names2) {
11191
- const path2 = resolve6(join12(directory, candidate));
11192
- const taken = await link4(partial, path2).then(() => false, (error) => {
10873
+ const path2 = resolve6(join9(directory, candidate));
10874
+ const taken = await link3(partial, path2).then(() => false, (error) => {
11193
10875
  if (error.code === "EEXIST")
11194
10876
  return true;
11195
10877
  throw error;
@@ -11197,7 +10879,7 @@ var save = /* @__PURE__ */ __name(async (file, directory, fallbackName, { unique
11197
10879
  if (!taken)
11198
10880
  return { kind: file.kind, path: path2, bytes: bytes2 };
11199
10881
  }
11200
- const path = resolve6(join12(directory, names2.at(-1) ?? name));
10882
+ const path = resolve6(join9(directory, names2.at(-1) ?? name));
11201
10883
  if (unique)
11202
10884
  return { kind: file.kind, path, bytes: bytes2, existing: true };
11203
10885
  throw new CliError("validation_error", `${path} already exists \u2014 nothing was overwritten; choose --output-dir`);
@@ -11206,7 +10888,7 @@ var save = /* @__PURE__ */ __name(async (file, directory, fallbackName, { unique
11206
10888
  }
11207
10889
  }, "save");
11208
10890
 
11209
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/pictures.js
10891
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/pictures.js
11210
10892
  var PICTURE_MAX_BYTES = 25 * 1024 * 1024;
11211
10893
  var PICTURE_FLOOR = 0.25;
11212
10894
  var PAGE4 = 50;
@@ -11216,18 +10898,18 @@ var missingModel = /* @__PURE__ */ __name((id2) => `the picture model is not dow
11216
10898
  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");
11217
10899
  var picturesService = /* @__PURE__ */ __name((deps) => {
11218
10900
  let opened;
11219
- const open10 = /* @__PURE__ */ __name(async () => {
10901
+ const open7 = /* @__PURE__ */ __name(async () => {
11220
10902
  if (deps.pictureEmbedder)
11221
10903
  return deps.pictureEmbedder();
11222
10904
  const model2 = imageModel(DEFAULT_IMAGE_MODEL);
11223
10905
  const directory = imageModelsDirectory(deps.env);
11224
10906
  if (!isImageModelInstalled(model2, directory))
11225
10907
  throw new CliError("not_found", missingModel(model2.id), { reason: "model.not-downloaded", model: model2.id });
11226
- const { openPictureEmbedder } = await import("./embedder-7VDWDBKF.js");
10908
+ const { openPictureEmbedder } = await import("./embedder-6ULWRG3R.js");
11227
10909
  return openPictureEmbedder(model2, directory);
11228
10910
  }, "open");
11229
10911
  const embedder = /* @__PURE__ */ __name(() => {
11230
- opened ??= open10().catch((error) => {
10912
+ opened ??= open7().catch((error) => {
11231
10913
  opened = void 0;
11232
10914
  throw error;
11233
10915
  });
@@ -11420,7 +11102,7 @@ var withPictures = /* @__PURE__ */ __name((messages, pictures) => ({
11420
11102
  }, "search")
11421
11103
  }), "withPictures");
11422
11104
 
11423
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/messages-meaning.js
11105
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/messages-meaning.js
11424
11106
  var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, shared) => {
11425
11107
  const target = embeddingTarget(deps, DEFAULT_TEXT_MODEL);
11426
11108
  const skipped = /* @__PURE__ */ __name((reason, step) => ({
@@ -11468,7 +11150,7 @@ var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, sh
11468
11150
  }
11469
11151
  }, "meaningLane");
11470
11152
 
11471
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/messages-rerank.js
11153
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/messages-rerank.js
11472
11154
  var rerankLane = /* @__PURE__ */ __name((deps) => {
11473
11155
  const choice = deps.reranker ?? DEFAULT_RERANK_MODEL;
11474
11156
  if (choice === "off")
@@ -11480,9 +11162,9 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
11480
11162
  return { skipped: { reason: `${model.id} is not downloaded`, step: "models.download", model: model.id } };
11481
11163
  try {
11482
11164
  const warm = deps.embedders;
11483
- const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-7HHZZZLA.js")).openRerankerProcess(model, directory, {
11165
+ const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-ZXO2MWRJ.js")).openRerankerProcess(model, directory, {
11484
11166
  threads: defaultThreads()
11485
- })) : await (await import("./rerank-LOW6VIDF.js")).openReranker(model, directory);
11167
+ })) : await (await import("./rerank-R6PE44M5.js")).openReranker(model, directory);
11486
11168
  return {
11487
11169
  model: model.id,
11488
11170
  score: /* @__PURE__ */ __name((question, passages) => reranker.score(plainWords(question), passages), "score"),
@@ -11502,7 +11184,7 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
11502
11184
  };
11503
11185
  }, "rerankLane");
11504
11186
 
11505
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/document-pictures.js
11187
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/document-pictures.js
11506
11188
  import { createHash as createHash10 } from "node:crypto";
11507
11189
  var refOf = /* @__PURE__ */ __name((target) => target.ref ?? `document:${target.documentId}`, "refOf");
11508
11190
  var openPictureEmbedderFor = /* @__PURE__ */ __name(async ({ env, command } = {}) => {
@@ -11510,7 +11192,7 @@ var openPictureEmbedderFor = /* @__PURE__ */ __name(async ({ env, command } = {}
11510
11192
  const directory = imageModelsDirectory(env);
11511
11193
  if (!isImageModelInstalled(model, directory))
11512
11194
  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 });
11513
- const { openPictureEmbedder } = await import("./embedder-7VDWDBKF.js");
11195
+ const { openPictureEmbedder } = await import("./embedder-6ULWRG3R.js");
11514
11196
  return openPictureEmbedder(model, directory);
11515
11197
  }, "openPictureEmbedderFor");
11516
11198
  var savePicture = /* @__PURE__ */ __name(async (store, target, bytes2, options = {}) => {
@@ -11531,7 +11213,7 @@ var savePicture = /* @__PURE__ */ __name(async (store, target, bytes2, options =
11531
11213
  }, "savePicture");
11532
11214
  var removePicture = /* @__PURE__ */ __name((store, target) => store.notes.removePicture(refOf(target)), "removePicture");
11533
11215
 
11534
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/document-source.js
11216
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/document-source.js
11535
11217
  var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) => {
11536
11218
  const metadata = note.frontMatter;
11537
11219
  const account2 = accounts.find(({ id: id2 }) => String(id2) === note.folderId);
@@ -11546,7 +11228,7 @@ var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) =>
11546
11228
  };
11547
11229
  }, "documentSource");
11548
11230
 
11549
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/notes-title-tier.js
11231
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/notes-title-tier.js
11550
11232
  var plainQueryWords = /* @__PURE__ */ __name((query) => {
11551
11233
  let root;
11552
11234
  try {
@@ -11573,7 +11255,7 @@ var titleTiers = /* @__PURE__ */ __name((hits, words2) => {
11573
11255
  return [...hits].sort((a, b) => rank(a) - rank(b));
11574
11256
  }, "titleTiers");
11575
11257
 
11576
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/notes-search.js
11258
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/notes-search.js
11577
11259
  var storeQuery = /* @__PURE__ */ __name(async (store, text2, { exact, timezone } = {}) => resolvedQuery(store, parsedQuery(text2, exact), timezone), "storeQuery");
11578
11260
  var parsedQuery = /* @__PURE__ */ __name((text2, exact) => validateFields(parseLucene(text2, { ...SEARCH_QUERY, defaultField: exact ? "exact" : "text" })).root, "parsedQuery");
11579
11261
  var resolvedQuery = /* @__PURE__ */ __name(async (store, root, timezone) => {
@@ -11663,7 +11345,17 @@ var embedChunks = /* @__PURE__ */ __name(async (store, source, { model: choice,
11663
11345
  var embedNotes = /* @__PURE__ */ __name((store, options = {}) => embedChunks(store, store.notes, options), "embedNotes");
11664
11346
  var embedEvents = /* @__PURE__ */ __name((store, options = {}) => embedChunks(store, store.calendar, options), "embedEvents");
11665
11347
  var embedMail = /* @__PURE__ */ __name((store, options = {}) => embedChunks(store, store.mail, options), "embedMail");
11666
- var nearestNotes = /* @__PURE__ */ __name(async (store, query, { model: choice, limit, folderIds, withInternal, source, env, threads, command, embedders }) => {
11348
+ var nearestNotes = /* @__PURE__ */ __name(async (store, query, options) => {
11349
+ const { key, vector, floor } = await queryVector(store, query, options);
11350
+ const nearest = await store.notes.nearest(key, vector, {
11351
+ limit: options.limit,
11352
+ ...options.folderIds ? { folderIds: options.folderIds } : {},
11353
+ ...options.withInternal ? { withInternal: true } : {},
11354
+ ...options.source ? { source: options.source } : {}
11355
+ });
11356
+ return nearest.filter(({ score }) => score > floor);
11357
+ }, "nearestNotes");
11358
+ var queryVector = /* @__PURE__ */ __name(async (store, query, { model: choice, folderIds, withInternal, source, env, threads, command, embedders }) => {
11667
11359
  if (!query.trim())
11668
11360
  throw new CliError("validation_error", "say what to find in the notes");
11669
11361
  const { model, directory, key } = localModel(choice, env, command);
@@ -11675,15 +11367,12 @@ var nearestNotes = /* @__PURE__ */ __name(async (store, query, { model: choice,
11675
11367
  if (!await store.notes.embedded(key, scope))
11676
11368
  throw new CliError("not_found", `nothing searched here has vectors of ${model.id} yet, so only words were matched`);
11677
11369
  const [vector] = await withLocal(model, directory, threads, (embedder) => embedder.embed([query], "query"), embedders);
11678
- const floor = meaningFloor(key);
11679
- const nearest = await store.notes.nearest(key, vector, {
11680
- limit,
11681
- ...folderIds ? { folderIds } : {},
11682
- ...withInternal ? { withInternal: true } : {},
11683
- ...source ? { source } : {}
11684
- });
11685
- return nearest.filter(({ score }) => score > floor);
11686
- }, "nearestNotes");
11370
+ return { key, vector, floor: meaningFloor(key) };
11371
+ }, "queryVector");
11372
+ var nearestAmong = /* @__PURE__ */ __name(async (store, query, refs, options) => {
11373
+ const { key, vector, floor } = await queryVector(store, query, options);
11374
+ return (await store.notes.scoreNotes(key, vector, refs)).filter(({ score }) => score > floor);
11375
+ }, "nearestAmong");
11687
11376
  var MAX_LINE = 200;
11688
11377
  var MAX_NOTES_OFFSET = 1e3;
11689
11378
  var CANDIDATES2 = 50;
@@ -11791,6 +11480,49 @@ var matching = /* @__PURE__ */ __name(async (store, refs, root, scope) => {
11791
11480
  });
11792
11481
  return new Map(found.items.map(({ ref, note, at }) => [ref, { note, at }]));
11793
11482
  }, "matching");
11483
+ var RANK_WITHIN = 2e3;
11484
+ var filterRefs = /* @__PURE__ */ __name(async (store, narrowing, scope) => {
11485
+ const resolved = await resolvedQuery(store, narrowing, scope.timezone);
11486
+ try {
11487
+ const found = await store.notes.matchingRefs({
11488
+ root: resolved.root,
11489
+ limit: RANK_WITHIN,
11490
+ ...scope.folderIds ? { folderIds: scope.folderIds } : {},
11491
+ ...scope.withInternal ? { withInternal: true } : {},
11492
+ ...scope.source ? { source: scope.source } : {},
11493
+ ...resolved.stemmer ? { stemmer: resolved.stemmer } : {}
11494
+ });
11495
+ return found.hasMore ? void 0 : found.refs;
11496
+ } catch (error) {
11497
+ if (tooLarge(error))
11498
+ return void 0;
11499
+ throw error;
11500
+ }
11501
+ }, "filterRefs");
11502
+ var tooLarge = /* @__PURE__ */ __name((error) => isCliError(error) && error.details.reason === "query.too-large", "tooLarge");
11503
+ var notesTotal = /* @__PURE__ */ __name(async (store, text2, { exact, scope, shown, hasMore }, others, othersComplete) => {
11504
+ let words2;
11505
+ try {
11506
+ const { root, stemmer } = await storeQuery(store, text2, {
11507
+ exact,
11508
+ ...scope.timezone ? { timezone: scope.timezone } : {}
11509
+ });
11510
+ words2 = await store.notes.matchingRefs({
11511
+ root,
11512
+ limit: TOTAL_CAP,
11513
+ ...scope.folderIds ? { folderIds: scope.folderIds } : {},
11514
+ ...scope.withInternal ? { withInternal: true } : {},
11515
+ ...scope.source ? { source: scope.source } : {},
11516
+ ...stemmer ? { stemmer } : {}
11517
+ });
11518
+ } catch (error) {
11519
+ if (tooLarge(error))
11520
+ return totalOf(void 0, shown, hasMore);
11521
+ throw error;
11522
+ }
11523
+ const count2 = (/* @__PURE__ */ new Set([...words2.refs, ...others])).size + (words2.hasMore ? 1 : 0);
11524
+ return totalOf(count2, shown, hasMore, othersComplete);
11525
+ }, "notesTotal");
11794
11526
  var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offset = 0, tag, filter: expression, folderIds, withInternal, source: given, exact = false, timezone, env, command, embedders, pictures: withPictures2 = false, pictureLimit = 5, pictureEmbedder } = {}) => {
11795
11527
  const typed = noteSourceOfQuery(query);
11796
11528
  const source = given ?? typed.source;
@@ -11813,24 +11545,37 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
11813
11545
  };
11814
11546
  let meaningSkipped;
11815
11547
  let meaning;
11548
+ let meaningRefs;
11549
+ let meaningComplete = true;
11816
11550
  if (exact)
11817
11551
  meaningSkipped = "--exact searches words as written";
11818
11552
  else if (words2) {
11553
+ const lane2 = {
11554
+ command,
11555
+ ...env === void 0 ? {} : { env },
11556
+ ...embedders === void 0 ? {} : { embedders },
11557
+ ...folderIds === void 0 ? {} : { folderIds },
11558
+ ...withInternal ? { withInternal: true } : {},
11559
+ ...source === void 0 ? {} : { source }
11560
+ };
11561
+ const depth = Math.max(window2, CANDIDATES2);
11819
11562
  try {
11820
- const nearest = await nearestNotes(store, words2, {
11821
- limit: Math.max(window2, CANDIDATES2),
11822
- command,
11823
- ...env === void 0 ? {} : { env },
11824
- ...embedders === void 0 ? {} : { embedders },
11825
- ...folderIds === void 0 ? {} : { folderIds },
11826
- ...withInternal ? { withInternal: true } : {},
11827
- ...source === void 0 ? {} : { source }
11828
- });
11563
+ const within = narrowing === void 0 ? void 0 : await filterRefs(store, narrowing, scope);
11564
+ let nearest;
11565
+ if (within === void 0) {
11566
+ nearest = await nearestNotes(store, words2, { ...lane2, limit: depth });
11567
+ meaningComplete = nearest.length < depth;
11568
+ } else {
11569
+ const ranked2 = within.length ? await nearestAmong(store, words2, within, lane2) : [];
11570
+ meaningRefs = new Set(ranked2.map(({ ref }) => ref));
11571
+ nearest = ranked2.slice(0, depth);
11572
+ }
11829
11573
  const allowed = await matching(store, nearest.map(({ ref }) => ref), narrowing, scope);
11830
11574
  meaning = nearest.flatMap(({ ref }) => {
11831
11575
  const found = allowed.get(ref);
11832
11576
  return found ? [{ ref, ...found }] : [];
11833
11577
  });
11578
+ meaningRefs ??= new Set(meaning.map(({ ref }) => ref));
11834
11579
  } catch (error) {
11835
11580
  if (!(error instanceof CliError && error.code === "not_found"))
11836
11581
  throw error;
@@ -11871,6 +11616,7 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
11871
11616
  ];
11872
11617
  const page = slice ? ordered : ordered.slice(offset, window2);
11873
11618
  const hasMore = slice ? matched.hasMore : ordered.length > window2 || matched.hasMore || titled.hasMore;
11619
+ const total = await notesTotal(store, text2, { exact, scope, shown: offset + page.length, hasMore }, [...tier.map(({ ref }) => ref), ...meaningRefs ?? []], meaningComplete);
11874
11620
  const hits = [];
11875
11621
  const counts = /* @__PURE__ */ new Map();
11876
11622
  const accounts = await store.accounts.storedAccounts();
@@ -11894,9 +11640,9 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
11894
11640
  links,
11895
11641
  found_by: foundBy
11896
11642
  });
11897
- for (const link5 of new Map(links.map((link6) => [link6.to ?? `?${link6.target_text}`, link6])).values()) {
11898
- const key = link5.to ?? `?${link5.target_text}`;
11899
- const known2 = counts.get(key) ?? { ref: link5.to, name: link5.target_text, notes: 0 };
11643
+ for (const link4 of new Map(links.map((link5) => [link5.to ?? `?${link5.target_text}`, link5])).values()) {
11644
+ const key = link4.to ?? `?${link4.target_text}`;
11645
+ const known2 = counts.get(key) ?? { ref: link4.to, name: link4.target_text, notes: 0 };
11900
11646
  known2.notes++;
11901
11647
  counts.set(key, known2);
11902
11648
  }
@@ -11932,6 +11678,7 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
11932
11678
  by: meaning === void 0 ? "words" : "words and meaning",
11933
11679
  ...meaningSkipped === void 0 ? {} : { meaning_skipped: meaningSkipped },
11934
11680
  hits,
11681
+ total,
11935
11682
  has_more: hasMore,
11936
11683
  ...hasMore && window2 <= MAX_NOTES_OFFSET ? { next_offset: window2 } : {},
11937
11684
  linked: [...counts.values()].sort((a, b) => b.notes - a.notes || (a.name ?? a.ref ?? "").localeCompare(b.name ?? b.ref ?? "")),
@@ -11970,7 +11717,7 @@ var searchNotesOf = /* @__PURE__ */ __name(async (store, account2, text2, { acco
11970
11717
  };
11971
11718
  }, "searchNotesOf");
11972
11719
 
11973
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/events-search.js
11720
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/events-search.js
11974
11721
  var MAX_EVENTS_OFFSET = 1e3;
11975
11722
  var iso = /* @__PURE__ */ __name((at) => at === null ? null : new Date(at).toISOString(), "iso");
11976
11723
  var accountIdsOf = /* @__PURE__ */ __name(async (store, accounts) => {
@@ -12082,7 +11829,7 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
12082
11829
  };
12083
11830
  }, "searchEvents");
12084
11831
 
12085
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/search-all.js
11832
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/search-all.js
12086
11833
  var RESOURCES_SEARCHED = ["messages", "mail", "notes", "events"];
12087
11834
  var skippable = /* @__PURE__ */ __name((error) => error instanceof CliError && (error.code === "validation_error" || error.code === "not_found"), "skippable");
12088
11835
  var filtersBeside = /* @__PURE__ */ __name((text2) => {
@@ -12290,7 +12037,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account2, request, messenge
12290
12037
  };
12291
12038
  }, "searchAll");
12292
12039
 
12293
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/search-all-meetings.js
12040
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/search-all-meetings.js
12294
12041
  var RESOURCES_SEARCHED_WITH_MEETINGS = [...RESOURCES_SEARCHED, "meetings"];
12295
12042
  var whole2 = /* @__PURE__ */ __name((value, minimum, maximum, label) => {
12296
12043
  if (!Number.isSafeInteger(value) || value < minimum || value > maximum)
@@ -12537,7 +12284,7 @@ var searchAllOfSource = /* @__PURE__ */ __name(async (store, account2, source, r
12537
12284
  return { ...found, skipped: [...skipped, ...empty2, ...unnamed, ...found.skipped] };
12538
12285
  }, "searchAllOfSource");
12539
12286
 
12540
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/server-search.js
12287
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/server-search.js
12541
12288
  var SERVER_SEARCH_KEY = "messages.server-search";
12542
12289
  var SERVER_BOUNDS = { timeMs: 5e3, perCall: 100, maxCalls: 3 };
12543
12290
  var DEFAULT_BACKEND = "both";
@@ -12662,7 +12409,7 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
12662
12409
  const calls = unique.slice(0, SERVER_BOUNDS.maxCalls);
12663
12410
  const pending = new Set(calls);
12664
12411
  const found = [];
12665
- let open10 = true;
12412
+ let open7 = true;
12666
12413
  const fail3 = /* @__PURE__ */ __name((branch, reason) => {
12667
12414
  pending.delete(branch);
12668
12415
  report.complete = false;
@@ -12671,19 +12418,19 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
12671
12418
  const ask = /* @__PURE__ */ __name(async (adapter) => {
12672
12419
  const search = capability(adapter, "searchMessages", "search messages on its server");
12673
12420
  await Promise.all(calls.map(async (branch) => {
12674
- if (!open10)
12421
+ if (!open7)
12675
12422
  return;
12676
12423
  report.calls += 1;
12677
12424
  try {
12678
12425
  const page = await search(asQuery(branch), { limit: SERVER_BOUNDS.perCall, signal: stop });
12679
- if (!open10)
12426
+ if (!open7)
12680
12427
  return;
12681
12428
  pending.delete(branch);
12682
12429
  if (page.hasMore)
12683
12430
  report.complete = false;
12684
12431
  found.push(page);
12685
12432
  } catch (error) {
12686
- if (!open10)
12433
+ if (!open7)
12687
12434
  return;
12688
12435
  fail3(branch, error instanceof CliError && error.code === "rate_limited" ? "rate_limited" : "search_failed");
12689
12436
  }
@@ -12695,11 +12442,11 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
12695
12442
  run.then(() => "done", () => "failed"),
12696
12443
  bound2
12697
12444
  ]);
12698
- open10 = false;
12445
+ open7 = false;
12699
12446
  for (const branch of [...pending])
12700
12447
  fail3(branch, outcome2 === "failed" ? "search_failed" : "time_or_abort_bound");
12701
12448
  } finally {
12702
- open10 = false;
12449
+ open7 = false;
12703
12450
  clearTimeout(timer);
12704
12451
  }
12705
12452
  const chats = new Map(found.flatMap(({ chats: chats2 }) => chats2).map((chat) => [chat.id, chat]));
@@ -12726,7 +12473,7 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
12726
12473
  return { report, sources };
12727
12474
  }, "searchServer");
12728
12475
 
12729
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/messages.js
12476
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/messages.js
12730
12477
  var DELETE_AT_ONCE = 10;
12731
12478
  var messagesService = /* @__PURE__ */ __name((deps) => {
12732
12479
  const { guard } = deps;
@@ -13152,7 +12899,7 @@ var checkMediaOptions = /* @__PURE__ */ __name((messenger, asked, attachments) =
13152
12899
  throw new CliError("validation_error", `${MEDIA_FLAGS[first]} needs a --photo or --file`);
13153
12900
  }, "checkMediaOptions");
13154
12901
 
13155
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/domain/channel-tags.js
12902
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/channel-tags.js
13156
12903
  var CHANNEL_TAG_RULES_VERSION = "keywords-v1";
13157
12904
  var RULES = {
13158
12905
  ai: [/\b(ai|gpt|llm|machine learning|artificial intelligence)\b/iu, /нейросет|искусственн/iu],
@@ -13167,7 +12914,7 @@ var classifyChannel = /* @__PURE__ */ __name((metadata) => Object.entries(RULES)
13167
12914
  return fields.length ? [{ tag, score: fields.length / 3, fields }] : [];
13168
12915
  }), "classifyChannel");
13169
12916
 
13170
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/metadata.js
12917
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/metadata.js
13171
12918
  var metadataService = /* @__PURE__ */ __name((deps) => {
13172
12919
  const held = /* @__PURE__ */ __name(async (reference, { includeLeft = false } = {}) => {
13173
12920
  const store = await deps.store();
@@ -13253,7 +13000,7 @@ var metadataService = /* @__PURE__ */ __name((deps) => {
13253
13000
  };
13254
13001
  }, "metadataService");
13255
13002
 
13256
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/moderation/run.js
13003
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/moderation/run.js
13257
13004
  var FIRST_LOOK_MS = 24 * 36e5;
13258
13005
  var moderateWith = /* @__PURE__ */ __name(async (run) => {
13259
13006
  const { chatId, title, rules, point, since, dryRun } = run;
@@ -13290,7 +13037,7 @@ var moderateWith = /* @__PURE__ */ __name(async (run) => {
13290
13037
  return { chatId, rows, notes };
13291
13038
  }, "moderateWith");
13292
13039
 
13293
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/moderation.js
13040
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/moderation.js
13294
13041
  var moderationService = /* @__PURE__ */ __name((deps) => {
13295
13042
  const file = /* @__PURE__ */ __name(() => new ModerationRules(moderationPathFor(deps.messenger.app, deps.profile ?? "default", deps.env ?? process.env)), "file");
13296
13043
  const group = /* @__PURE__ */ __name(async (chat) => {
@@ -13368,7 +13115,7 @@ var moderatorOf = /* @__PURE__ */ __name((adapter, deps) => ({
13368
13115
  }, "removePerson")
13369
13116
  }), "moderatorOf");
13370
13117
 
13371
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/person-context.js
13118
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/person-context.js
13372
13119
  var CONTEXT_MESSAGES2 = 10;
13373
13120
  var CONTEXT_BYTES = 64 * 1024;
13374
13121
  var toContext = /* @__PURE__ */ __name((key, message, chatTitle) => ({
@@ -13624,10 +13371,10 @@ var personMessages = /* @__PURE__ */ __name(async (store, asked, reference, { ch
13624
13371
  };
13625
13372
  }, "personMessages");
13626
13373
 
13627
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
13374
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
13628
13375
  import { createHash as createHash11 } from "node:crypto";
13629
13376
 
13630
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-reference.js
13377
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-reference.js
13631
13378
  var missing3 = /* @__PURE__ */ __name(() => new CliError("not_found", "the meeting evidence is unavailable for this account"), "missing");
13632
13379
  var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId, reference, options = {}) => {
13633
13380
  const parsed = parseMeetingReference(reference);
@@ -13675,7 +13422,7 @@ var resolveMeetingReference = /* @__PURE__ */ __name(async (store, accountId, re
13675
13422
  };
13676
13423
  }, "resolveMeetingReference");
13677
13424
 
13678
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
13425
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
13679
13426
  var hash = /* @__PURE__ */ __name((value) => createHash11("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
13680
13427
  var checkMeetingCancelled = /* @__PURE__ */ __name((signal) => {
13681
13428
  if (signal?.aborted)
@@ -13874,7 +13621,7 @@ var readMeetingEvidence = /* @__PURE__ */ __name(async (store, accountId, refere
13874
13621
  return { ...packet, fingerprint: hash(packet) };
13875
13622
  }, "readMeetingEvidence");
13876
13623
 
13877
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/person-meeting-context.js
13624
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/person-meeting-context.js
13878
13625
  var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference, options) => {
13879
13626
  const { meetings = 10, cues = 5, bytes: bytes2 = 64 * 1024, scanLimit = 1e3, since, signal } = options;
13880
13627
  const requestedAccounts = options.accountIds;
@@ -13973,7 +13720,7 @@ var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference,
13973
13720
  };
13974
13721
  }, "personMeetingContext");
13975
13722
 
13976
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/person-preparation.js
13723
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/person-preparation.js
13977
13724
  var PREPARE_BYTES = 96 * 1024;
13978
13725
  var MEETINGS = 5;
13979
13726
  var CUES = 3;
@@ -14090,7 +13837,7 @@ var meetingsOf = /* @__PURE__ */ __name(async (store, uid, stored, since, left)
14090
13837
  }
14091
13838
  }, "meetingsOf");
14092
13839
 
14093
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/person-profile.js
13840
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/person-profile.js
14094
13841
  var personProfile = /* @__PURE__ */ __name(async (deps, person, known2) => {
14095
13842
  const online = deps.offline ? void 0 : await deps.connection();
14096
13843
  const held = await storeIfOpen(deps);
@@ -14160,7 +13907,7 @@ var quiet = /* @__PURE__ */ __name((facts) => facts.chats.map(({ id: id2, title,
14160
13907
  complete: false
14161
13908
  })), "quiet");
14162
13909
 
14163
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/person-timeline.js
13910
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/person-timeline.js
14164
13911
  var TIMELINE_ITEMS = 50;
14165
13912
  var TIMELINE_MAX = 500;
14166
13913
  var SCOPES = ["personal", "work"];
@@ -14215,7 +13962,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
14215
13962
  };
14216
13963
  }, "personTimeline");
14217
13964
 
14218
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/people.js
13965
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/people.js
14219
13966
  var peopleService = /* @__PURE__ */ __name((deps) => {
14220
13967
  const localCard = /* @__PURE__ */ __name(async (card, includeNotes = false) => {
14221
13968
  const held = await storeIfOpen(deps);
@@ -14442,7 +14189,7 @@ var withoutPhone = /* @__PURE__ */ __name((answer) => {
14442
14189
  return rest;
14443
14190
  }, "withoutPhone");
14444
14191
 
14445
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/private-people.js
14192
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/private-people.js
14446
14193
  var noteItem = /* @__PURE__ */ __name((provider, note) => ({
14447
14194
  id: note.id,
14448
14195
  contact: formatReference({ type: "contact", provider, id: note.personId }),
@@ -14486,7 +14233,7 @@ var privatePeopleService = /* @__PURE__ */ __name((deps) => {
14486
14233
  };
14487
14234
  }, "privatePeopleService");
14488
14235
 
14489
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/rankings.js
14236
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/rankings.js
14490
14237
  var empty = /* @__PURE__ */ __name(() => ({
14491
14238
  total: 0,
14492
14239
  population: 0,
@@ -14742,7 +14489,7 @@ var rankingsService = /* @__PURE__ */ __name((deps) => ({
14742
14489
  }, "evidence")
14743
14490
  }), "rankingsService");
14744
14491
 
14745
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/searches.js
14492
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/searches.js
14746
14493
  var savedSearchItem = /* @__PURE__ */ __name((one) => ({
14747
14494
  id: one.id,
14748
14495
  name: one.name,
@@ -14871,7 +14618,7 @@ var searchesService = /* @__PURE__ */ __name((deps) => {
14871
14618
  };
14872
14619
  }, "searchesService");
14873
14620
 
14874
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/tags.js
14621
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/tags.js
14875
14622
  var TAGGING_QUERY = {
14876
14623
  entity: "tagging",
14877
14624
  backend: "sql",
@@ -14955,7 +14702,7 @@ var tagsService = /* @__PURE__ */ __name((deps) => {
14955
14702
  };
14956
14703
  }, "tagsService");
14957
14704
 
14958
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/tasks.js
14705
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/tasks.js
14959
14706
  var TASK_QUERY = {
14960
14707
  entity: "task",
14961
14708
  backend: "sql",
@@ -15087,13 +14834,13 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
15087
14834
  store.notes.links({ from: details.ref }),
15088
14835
  store.notes.links({ to: details.ref })
15089
14836
  ]);
15090
- return { ...details, links, linkedFrom: incoming.filter((link5) => link5.from.startsWith("task:")) };
14837
+ return { ...details, links, linkedFrom: incoming.filter((link4) => link4.from.startsWith("task:")) };
15091
14838
  }, "cardOf");
15092
14839
  const planOf = /* @__PURE__ */ __name(async (store, id2, plan, by) => {
15093
14840
  if (plan.category !== void 0)
15094
14841
  plan = { ...plan, category: await categoryOf(store, plan.category) };
15095
- const open10 = (await store.tasks.details(id2)).status === "open";
15096
- if (!open10 && (plan.dueAt != null || plan.nextCheckAt != null))
14842
+ const open7 = (await store.tasks.details(id2)).status === "open";
14843
+ if (!open7 && (plan.dueAt != null || plan.nextCheckAt != null))
15097
14844
  throw new CliError("validation_error", "a closed task takes no due date or next check; it stays closed");
15098
14845
  const { assignees, ...fields } = plan;
15099
14846
  const author = by === "owner" ? "owner" : { bot: by };
@@ -15179,17 +14926,17 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
15179
14926
  if (choice.attach !== void 0) {
15180
14927
  const target = await owned(store, account2, choice.attach);
15181
14928
  const similarity = await store.tasks.compare(subject, target.id);
15182
- const link5 = {
14929
+ const link4 = {
15183
14930
  from: (await store.tasks.details(target.id)).ref,
15184
14931
  kind: "evidence",
15185
14932
  origin: origin === "owner" ? "owner" : "suggested"
15186
14933
  };
15187
14934
  try {
15188
- await store.notes.addLink({ ...link5, to: note ? note.ref : source });
14935
+ await store.notes.addLink({ ...link4, to: note ? note.ref : source });
15189
14936
  } catch (error) {
15190
14937
  if (!(error instanceof CliError && error.code === "not_found" && !note))
15191
14938
  throw error;
15192
- await store.notes.addLink({ ...link5, targetText: source });
14939
+ await store.notes.addLink({ ...link4, targetText: source });
15193
14940
  }
15194
14941
  await store.tasks.recordPair({ source, other: target.id, decision: "attached", similarity, by });
15195
14942
  const review = await reviewAfterLink(store, target.id);
@@ -15435,7 +15182,7 @@ var taskView = /* @__PURE__ */ __name(async (store, account2, task2) => {
15435
15182
  };
15436
15183
  }, "taskView");
15437
15184
 
15438
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/topics.js
15185
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/topics.js
15439
15186
  var actionOf = /* @__PURE__ */ __name(({ title, closed, pinned, hidden }) => {
15440
15187
  const set = [closed, pinned, hidden].filter((one) => one !== void 0).length;
15441
15188
  if (title !== void 0 || set !== 1)
@@ -15620,8 +15367,8 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
15620
15367
  };
15621
15368
  }, "topicsService");
15622
15369
 
15623
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/evidence.js
15624
- import { createHash as createHash12, randomUUID as randomUUID7 } from "node:crypto";
15370
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/evidence.js
15371
+ import { createHash as createHash12, randomUUID as randomUUID5 } from "node:crypto";
15625
15372
  var hash2 = /* @__PURE__ */ __name((value) => createHash12("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
15626
15373
  var positive = /* @__PURE__ */ __name((value, name, minimum = 1) => {
15627
15374
  if (!Number.isSafeInteger(value) || value < minimum)
@@ -15691,10 +15438,10 @@ var prepareEvidencePacket = /* @__PURE__ */ __name(({ kind, source, page, limits
15691
15438
  },
15692
15439
  items
15693
15440
  };
15694
- return { ...content, id: randomUUID7(), fingerprint: hash2(content) };
15441
+ return { ...content, id: randomUUID5(), fingerprint: hash2(content) };
15695
15442
  }, "prepareEvidencePacket");
15696
15443
 
15697
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/evidence-read.js
15444
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/evidence-read.js
15698
15445
  var readEvidencePacket = /* @__PURE__ */ __name(async (store, account2, { chat, limit, before: before2 }, messenger = {}) => {
15699
15446
  if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100)
15700
15447
  throw new CliError("validation_error", "evidence message limit must be an integer from 1 to 100");
@@ -15714,7 +15461,7 @@ var readEvidencePacket = /* @__PURE__ */ __name(async (store, account2, { chat,
15714
15461
  return { ...packet, nextBeforeId: older && last ? last.id : null };
15715
15462
  }, "readEvidencePacket");
15716
15463
 
15717
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-hit-search.js
15464
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-hit-search.js
15718
15465
  var refreshMeetingIndex = /* @__PURE__ */ __name(async (meetings, accountId, signal) => {
15719
15466
  let before2 = Number.POSITIVE_INFINITY;
15720
15467
  for (; ; ) {
@@ -15776,7 +15523,7 @@ var searchMeetingHits = /* @__PURE__ */ __name(async (store, query, request, opt
15776
15523
  return { ...result, selection };
15777
15524
  }, "searchMeetingHits");
15778
15525
 
15779
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-links.js
15526
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-links.js
15780
15527
  var readMeetingLinks = /* @__PURE__ */ __name(async (store, request) => {
15781
15528
  const { maxMessages, url, ...selecting } = request;
15782
15529
  const { input, selection } = await resolveMeetingSelection(store, selecting);
@@ -15789,7 +15536,7 @@ var readMeetingLinks = /* @__PURE__ */ __name(async (store, request) => {
15789
15536
  for (const found of findMentions(line2.text)) {
15790
15537
  if (found.kind !== "url" || url !== void 0 && found.value !== url)
15791
15538
  continue;
15792
- const link5 = links.get(found.value) ?? {
15539
+ const link4 = links.get(found.value) ?? {
15793
15540
  url: found.value,
15794
15541
  domain: found.domain,
15795
15542
  documentId: googleDocumentId(found.value),
@@ -15799,13 +15546,13 @@ var readMeetingLinks = /* @__PURE__ */ __name(async (store, request) => {
15799
15546
  senders: [],
15800
15547
  meetings: []
15801
15548
  };
15802
- link5.count += 1;
15803
- link5.lastAt = line2.sentAt;
15804
- if (line2.sender !== null && !link5.senders.includes(line2.sender))
15805
- link5.senders.push(line2.sender);
15806
- if (!link5.meetings.some((one) => one.meetingId === line2.meetingId))
15807
- link5.meetings.push({ meetingId: line2.meetingId, accountId: line2.accountId, title: line2.title });
15808
- links.set(found.value, link5);
15549
+ link4.count += 1;
15550
+ link4.lastAt = line2.sentAt;
15551
+ if (line2.sender !== null && !link4.senders.includes(line2.sender))
15552
+ link4.senders.push(line2.sender);
15553
+ if (!link4.meetings.some((one) => one.meetingId === line2.meetingId))
15554
+ link4.meetings.push({ meetingId: line2.meetingId, accountId: line2.accountId, title: line2.title });
15555
+ links.set(found.value, link4);
15809
15556
  }
15810
15557
  return {
15811
15558
  items: [...links.values()].sort((a, b) => b.count - a.count || b.lastAt - a.lastAt),
@@ -15815,10 +15562,10 @@ var readMeetingLinks = /* @__PURE__ */ __name(async (store, request) => {
15815
15562
  };
15816
15563
  }, "readMeetingLinks");
15817
15564
 
15818
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidates.js
15565
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidates.js
15819
15566
  import { createHash as createHash13 } from "node:crypto";
15820
15567
 
15821
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidate-validation.js
15568
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidate-validation.js
15822
15569
  function invalid3(field, response = false) {
15823
15570
  throw new CliError(response ? "invalid_response" : "validation_error", `invalid project candidate ${field}`);
15824
15571
  }
@@ -15937,7 +15684,7 @@ var candidateCatalog = /* @__PURE__ */ __name((catalog, limits) => {
15937
15684
  }
15938
15685
  }, "candidateCatalog");
15939
15686
 
15940
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidates.js
15687
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidates.js
15941
15688
  var createMeetingProjectCandidateReader = /* @__PURE__ */ __name((scope, accountId, ports) => {
15942
15689
  const fixed = snapshotMeetingScope(scope);
15943
15690
  if (!Number.isSafeInteger(accountId) || accountId < 1 || typeof ports?.vocabulary?.vocabulary !== "function")
@@ -15990,7 +15737,7 @@ var createMeetingProjectCandidateReader = /* @__PURE__ */ __name((scope, account
15990
15737
  };
15991
15738
  }, "createMeetingProjectCandidateReader");
15992
15739
 
15993
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-project-discovery.js
15740
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-project-discovery.js
15994
15741
  import { createHash as createHash14 } from "node:crypto";
15995
15742
  var scopeKeys = [
15996
15743
  "accountId",
@@ -16125,7 +15872,7 @@ var readMeetingProjectDiscovery = /* @__PURE__ */ __name(async (ports, projectNa
16125
15872
  };
16126
15873
  }, "readMeetingProjectDiscovery");
16127
15874
 
16128
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-review.js
15875
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-review.js
16129
15876
  var readMeetingReview = /* @__PURE__ */ __name(async (store, request) => {
16130
15877
  const { limit, ...selecting } = request;
16131
15878
  const { input, selection } = await resolveMeetingSelection(store, selecting);
@@ -16133,7 +15880,7 @@ var readMeetingReview = /* @__PURE__ */ __name(async (store, request) => {
16133
15880
  return { ...review, selection };
16134
15881
  }, "readMeetingReview");
16135
15882
 
16136
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-searches.js
15883
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-searches.js
16137
15884
  var KIND = ["meetings-search"];
16138
15885
  var meetingSearchesService = /* @__PURE__ */ __name((searches) => {
16139
15886
  const found = /* @__PURE__ */ __name(async (reference) => {
@@ -16163,7 +15910,7 @@ var meetingSearchesService = /* @__PURE__ */ __name((searches) => {
16163
15910
  };
16164
15911
  }, "meetingSearchesService");
16165
15912
 
16166
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-stats.js
15913
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-stats.js
16167
15914
  var readMeetingStats = /* @__PURE__ */ __name(async (store, request) => {
16168
15915
  const { timeZone, maxRows, ...selecting } = request;
16169
15916
  const { input, selection } = await resolveMeetingSelection(store, selecting);
@@ -16175,7 +15922,7 @@ var readMeetingStats = /* @__PURE__ */ __name(async (store, request) => {
16175
15922
  return { ...stats, selection };
16176
15923
  }, "readMeetingStats");
16177
15924
 
16178
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-hit-context.js
15925
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-hit-context.js
16179
15926
  import { createHash as createHash15 } from "node:crypto";
16180
15927
  var contextCue = /* @__PURE__ */ __name((cue) => ({
16181
15928
  ref: cue.reference,
@@ -16293,7 +16040,7 @@ var readMeetingHitContext = /* @__PURE__ */ __name(async (store, accountId, refe
16293
16040
  return { ...packet, fingerprint: createHash15("sha256").update(JSON.stringify(packet)).digest("hex") };
16294
16041
  }, "readMeetingHitContext");
16295
16042
 
16296
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-passage-format.js
16043
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-passage-format.js
16297
16044
  var visible = /* @__PURE__ */ __name((text2) => text2.replace(/[\p{Cc}\p{Cf}]/gu, (value) => value === "\n" || value === " " ? value : `\\u{${value.codePointAt(0)?.toString(16)}}`), "visible");
16298
16045
  var markdown = /* @__PURE__ */ __name((text2) => visible(text2).replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replace(/[\\`*_[\]#|~]/g, "\\$&"), "markdown");
16299
16046
  var timestamp = /* @__PURE__ */ __name((ms) => {
@@ -16369,7 +16116,7 @@ var readMeetingPassage = /* @__PURE__ */ __name(async (store, accountId, referen
16369
16116
  return { packet, content };
16370
16117
  }, "readMeetingPassage");
16371
16118
 
16372
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-batch.js
16119
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-batch.js
16373
16120
  var createMeetingBatchReader = /* @__PURE__ */ __name((store, accountId) => {
16374
16121
  if (!Number.isSafeInteger(accountId) || accountId < 1)
16375
16122
  throw new CliError("validation_error", "choose a positive meeting account");
@@ -16383,10 +16130,10 @@ var createMeetingBatchReader = /* @__PURE__ */ __name((store, accountId) => {
16383
16130
  };
16384
16131
  }, "createMeetingBatchReader");
16385
16132
 
16386
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-combined.js
16133
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-combined.js
16387
16134
  import { createHash as createHash16 } from "node:crypto";
16388
16135
 
16389
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-semantic.js
16136
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-semantic.js
16390
16137
  var positive2 = /* @__PURE__ */ __name((value, name, max) => {
16391
16138
  if (!Number.isSafeInteger(value) || value < 1 || value > max)
16392
16139
  throw new CliError("validation_error", `Invalid ${name}`);
@@ -16538,7 +16285,7 @@ var applyMeetingEmbedding = /* @__PURE__ */ __name(async (store, accountId, embe
16538
16285
  };
16539
16286
  }, "applyMeetingEmbedding");
16540
16287
 
16541
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-combined.js
16288
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-combined.js
16542
16289
  var DEPTH = 200;
16543
16290
  var cursorOf3 = /* @__PURE__ */ __name((value, key) => {
16544
16291
  if (value === void 0)
@@ -16675,7 +16422,7 @@ var searchMeetingsCombined = /* @__PURE__ */ __name(async (store, embedder, type
16675
16422
  };
16676
16423
  }, "searchMeetingsCombined");
16677
16424
 
16678
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-context.js
16425
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-context.js
16679
16426
  var meetingReferences = /* @__PURE__ */ __name((values) => values.map((value) => formatMeetingReference(parseMeetingReference(value))), "meetingReferences");
16680
16427
  var checkCancelled = /* @__PURE__ */ __name((signal) => {
16681
16428
  if (!signal?.aborted)
@@ -16780,7 +16527,7 @@ var createMeetingContextService = /* @__PURE__ */ __name(async (store, input, op
16780
16527
  };
16781
16528
  }, "createMeetingContextService");
16782
16529
 
16783
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-model.js
16530
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-model.js
16784
16531
  var integer = /* @__PURE__ */ __name((value, name, max) => {
16785
16532
  if (!Number.isSafeInteger(value) || value < 1 || value > max)
16786
16533
  throw new CliError("validation_error", `Invalid ${name}`);
@@ -17007,7 +16754,7 @@ var openMeetingEmbedder = /* @__PURE__ */ __name(async (choice, options = {}) =>
17007
16754
  };
17008
16755
  }, "openMeetingEmbedder");
17009
16756
 
17010
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/context/communication-selection.js
16757
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/context/communication-selection.js
17011
16758
  var communicationFields = {
17012
16759
  sources: pipe(array(strictObject({
17013
16760
  id: pipe(string(), regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)),
@@ -17039,7 +16786,7 @@ var communicationRequest = /* @__PURE__ */ __name((value, preparationAfter) => {
17039
16786
  return { ...input, after, before: before2 };
17040
16787
  }, "communicationRequest");
17041
16788
 
17042
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-preparation-validation.js
16789
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-preparation-validation.js
17043
16790
  var MEETING_PREPARATION_LIMITS = {
17044
16791
  meetings: { min: 1, max: 20, default: 5 },
17045
16792
  cues: { min: 1, max: 100, default: 10 },
@@ -17125,7 +16872,7 @@ var preparationRequest = /* @__PURE__ */ __name((accountId, externalId, original
17125
16872
  return { ...input, history };
17126
16873
  }, "preparationRequest");
17127
16874
 
17128
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-communications-preparation.js
16875
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-communications-preparation.js
17129
16876
  var readPreparationCommunications = /* @__PURE__ */ __name(async (plan, signal) => {
17130
16877
  const section = {
17131
16878
  readUsage: plan.reader.usage(),
@@ -17230,7 +16977,7 @@ var appendPreparationCommunications = /* @__PURE__ */ __name((result, read) => {
17230
16977
  result.knowledge.coverage.otherSources = "see-communications";
17231
16978
  }, "appendPreparationCommunications");
17232
16979
 
17233
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-communications-selection.js
16980
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-communications-selection.js
17234
16981
  var captureCommunicationSelections = /* @__PURE__ */ __name((port) => {
17235
16982
  if (port === void 0)
17236
16983
  return void 0;
@@ -17335,7 +17082,7 @@ var validatePreparationCommunications = /* @__PURE__ */ __name((section, request
17335
17082
  }
17336
17083
  }, "validatePreparationCommunications");
17337
17084
 
17338
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-knowledge-preparation.js
17085
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-knowledge-preparation.js
17339
17086
  var invalid4 = /* @__PURE__ */ __name(() => {
17340
17087
  throw new CliError("invalid_response", "Preparation knowledge returned an invalid selection");
17341
17088
  }, "invalid");
@@ -17404,7 +17151,7 @@ var appendKnowledgePreparation = /* @__PURE__ */ __name(async (store, result, in
17404
17151
  }
17405
17152
  }, "appendKnowledgePreparation");
17406
17153
 
17407
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-notes-preparation.js
17154
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-notes-preparation.js
17408
17155
  var invalid5 = /* @__PURE__ */ __name(() => {
17409
17156
  throw new CliError("invalid_response", "Preparation notes returned an invalid selection");
17410
17157
  }, "invalid");
@@ -17478,7 +17225,7 @@ var appendNotesPreparation = /* @__PURE__ */ __name(async (store, result, input)
17478
17225
  }
17479
17226
  }, "appendNotesPreparation");
17480
17227
 
17481
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-project-preparation.js
17228
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-project-preparation.js
17482
17229
  var PAGE_LIMIT = 4;
17483
17230
  var size2 = /* @__PURE__ */ __name((value) => Buffer.byteLength(JSON.stringify(value), "utf8"), "size");
17484
17231
  var appendProjectPreparation = /* @__PURE__ */ __name(async (ports, result, input) => {
@@ -17528,7 +17275,7 @@ var appendProjectPreparation = /* @__PURE__ */ __name(async (ports, result, inpu
17528
17275
  }
17529
17276
  }, "appendProjectPreparation");
17530
17277
 
17531
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-related-preparation.js
17278
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-related-preparation.js
17532
17279
  var appendRelatedPreparation = /* @__PURE__ */ __name(async (store, result, input) => {
17533
17280
  if (!result.series || !result.items.length || result.coverage.outputLimited)
17534
17281
  return;
@@ -17600,7 +17347,7 @@ var appendRelatedPreparation = /* @__PURE__ */ __name(async (store, result, inpu
17600
17347
  }
17601
17348
  }, "appendRelatedPreparation");
17602
17349
 
17603
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-preparation.js
17350
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-preparation.js
17604
17351
  var size3 = /* @__PURE__ */ __name((value) => Buffer.byteLength(JSON.stringify(value), "utf8"), "size");
17605
17352
  var createMeetingPreparationService = /* @__PURE__ */ __name((scope, accountId, ports) => {
17606
17353
  const fixed = snapshotMeetingScope(scope);
@@ -17738,7 +17485,7 @@ var createMeetingPreparationService = /* @__PURE__ */ __name((scope, accountId,
17738
17485
  };
17739
17486
  }, "createMeetingPreparationService");
17740
17487
 
17741
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-task-proposal.js
17488
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-task-proposal.js
17742
17489
  import { createHash as createHash17 } from "node:crypto";
17743
17490
  var proposeMeetingTask = /* @__PURE__ */ __name(async (store, accountId, reference, kind) => {
17744
17491
  if (!TASK_KINDS.includes(kind))
@@ -17758,7 +17505,7 @@ var proposeMeetingTask = /* @__PURE__ */ __name(async (store, accountId, referen
17758
17505
  };
17759
17506
  }, "proposeMeetingTask");
17760
17507
 
17761
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/meeting-tasks.js
17508
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/meeting-tasks.js
17762
17509
  var accountSnapshot = /* @__PURE__ */ __name((key) => {
17763
17510
  const { provider, account: account2, scope } = key;
17764
17511
  if (!provider.trim() || provider.includes(":") || !account2.trim())
@@ -17821,7 +17568,7 @@ var readMeetingTask = /* @__PURE__ */ __name(async (store, account2, id2) => {
17821
17568
  }
17822
17569
  }, "readMeetingTask");
17823
17570
 
17824
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/package-upgrade.js
17571
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/package-upgrade.js
17825
17572
  var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageName, check }, ports) => {
17826
17573
  const installer = ports.installer();
17827
17574
  const argv = updateCommand(installer, packageName);
@@ -17886,7 +17633,7 @@ var dayAfter = /* @__PURE__ */ __name((published) => {
17886
17633
  return Number.isNaN(time) ? null : new Date(time + 24 * 60 * 60 * 1e3).toISOString();
17887
17634
  }, "dayAfter");
17888
17635
 
17889
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/proposal-tasks.js
17636
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/proposal-tasks.js
17890
17637
  var proposalSource = /* @__PURE__ */ __name((id2) => `proposed-action:${id2}`, "proposalSource");
17891
17638
  var approveAsTask = /* @__PURE__ */ __name(async (store, id2) => {
17892
17639
  const proposal = await store.proposedActions.get(id2);
@@ -17915,7 +17662,7 @@ var approveAsTask = /* @__PURE__ */ __name(async (store, id2) => {
17915
17662
  return { proposal: await store.proposedActions.approve(proposal.id, { task: task2.id }), task: task2 };
17916
17663
  }, "approveAsTask");
17917
17664
 
17918
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/stored-meeting-project-candidate-validation.js
17665
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/stored-meeting-project-candidate-validation.js
17919
17666
  var storedCandidateRequest = /* @__PURE__ */ __name((reference, accountId, options) => {
17920
17667
  const invalid6 = /* @__PURE__ */ __name((field) => {
17921
17668
  throw new CliError("validation_error", `invalid stored project candidate ${field}`);
@@ -17957,7 +17704,7 @@ var storedCandidateRequest = /* @__PURE__ */ __name((reference, accountId, optio
17957
17704
  return { reference, limits, after, afterTranscriptId, signal };
17958
17705
  }, "storedCandidateRequest");
17959
17706
 
17960
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/stored-meeting-project-candidates.js
17707
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/stored-meeting-project-candidates.js
17961
17708
  var createStoredMeetingProjectCandidateReader = /* @__PURE__ */ __name((scope, accountId, ports) => {
17962
17709
  const fixed = snapshotMeetingScope(scope);
17963
17710
  const store = ports?.meetings;
@@ -18049,7 +17796,7 @@ var createStoredMeetingProjectCandidateReader = /* @__PURE__ */ __name((scope, a
18049
17796
  };
18050
17797
  }, "createStoredMeetingProjectCandidateReader");
18051
17798
 
18052
- // node_modules/.pnpm/@wirecat+cli-core@0.496.0_@wirecat+cli-base@0.65.5_commander@15.0.0_esbuild@0.28.2_type_dcbd09250bc4763d29eff57ceeaf10b7/node_modules/@wirecat/cli-core/dist/services/index.js
17799
+ // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/services/index.js
18053
17800
  var servicesFor = /* @__PURE__ */ __name((deps) => {
18054
17801
  const pictures = picturesService(deps);
18055
17802
  const base = {
@@ -18099,12 +17846,9 @@ export {
18099
17846
  storeOnlyDeps,
18100
17847
  REGISTRIES,
18101
17848
  registriesCover,
17849
+ chatCoverage,
18102
17850
  createContextEvidenceReader,
18103
17851
  excerpt,
18104
- writeFileAtomic,
18105
- syncDirectory,
18106
- readBoundedUtf8File,
18107
- acquireLock,
18108
17852
  validateMediaSince,
18109
17853
  checkMediaArchive,
18110
17854
  archiveMedia,
@@ -18135,7 +17879,6 @@ export {
18135
17879
  searchRecordOf,
18136
17880
  isAdminSelection,
18137
17881
  adminStatisticsService,
18138
- chatCoverage,
18139
17882
  threadIdOf,
18140
17883
  AUDIT_PAGE,
18141
17884
  AUDIT_BUDGET,
@@ -18194,6 +17937,7 @@ export {
18194
17937
  pinDurationOf,
18195
17938
  sendAsCheck,
18196
17939
  typedSendAs,
17940
+ TOTAL_CAP,
18197
17941
  THREAD_BOUNDS,
18198
17942
  readThreadContext,
18199
17943
  MAX_SEARCH_OFFSET,
@@ -18217,6 +17961,7 @@ export {
18217
17961
  embedEvents,
18218
17962
  embedMail,
18219
17963
  nearestNotes,
17964
+ RANK_WITHIN,
18220
17965
  searchNotes,
18221
17966
  searchNotesOf,
18222
17967
  calendarAccounts,