@wirecat/amo-cli 0.2.0 → 0.4.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 (183) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +19 -14
  3. package/contracts/wirecat.json +58 -19
  4. package/dist/amo/button.d.ts +53 -0
  5. package/dist/amo/button.d.ts.map +1 -0
  6. package/dist/amo/button.js +234 -0
  7. package/dist/amo/button.js.map +1 -0
  8. package/dist/amo/oauth.d.ts +12 -3
  9. package/dist/amo/oauth.d.ts.map +1 -1
  10. package/dist/amo/oauth.js +19 -6
  11. package/dist/amo/oauth.js.map +1 -1
  12. package/dist/bin/amo.js +2 -2
  13. package/dist/bundle/agent-43BMVBX2.js +40 -0
  14. package/dist/bundle/{all-profiles-3KQVWDV4.js → all-profiles-PRNXEZRH.js} +63 -21
  15. package/dist/bundle/amo.js +28 -26
  16. package/dist/bundle/{anthropic-N5NOX7K7.js → anthropic-FDI24DU2.js} +5 -5
  17. package/dist/bundle/{app-server-2MST5EZ5.js → app-server-WAKJVDLN.js} +79 -68
  18. package/dist/bundle/{bun-4NHWOFX2.js → bun-YPXUXMBI.js} +2 -2
  19. package/dist/bundle/{bun-sqlite-DRSXPWPR.js → bun-sqlite-UBQ5M47X.js} +6 -6
  20. package/dist/bundle/chunk-23AQD7JU.js +559 -0
  21. package/dist/bundle/{chunk-2I5UVMLW.js → chunk-2AIG2SSJ.js} +1733 -1160
  22. package/dist/bundle/{chunk-DQV2IKCF.js → chunk-2UJ7ZZZC.js} +10 -3
  23. package/dist/bundle/{chunk-ODNQU7DH.js → chunk-3K6T2G52.js} +43 -64
  24. package/dist/bundle/chunk-3PCVQCCV.js +108 -0
  25. package/dist/bundle/{chunk-UMVRT7VQ.js → chunk-3WG4MTQI.js} +1 -1
  26. package/dist/bundle/chunk-4PQECIU2.js +30 -0
  27. package/dist/bundle/{chunk-T2UDLX76.js → chunk-5HZMXHRH.js} +6 -6
  28. package/dist/bundle/{chunk-P3WQRTYZ.js → chunk-5II6TAJE.js} +1 -1
  29. package/dist/bundle/{chunk-RPWAJYI6.js → chunk-5SJEJYQZ.js} +3 -3
  30. package/dist/bundle/{chunk-5QFHNBGB.js → chunk-6PILR4AX.js} +2 -2
  31. package/dist/bundle/{chunk-TNUFLULO.js → chunk-6QMSKJB4.js} +8 -8
  32. package/dist/bundle/{chunk-5RLUHTK6.js → chunk-745FMNI5.js} +1 -1
  33. package/dist/bundle/{chunk-AUBB72VF.js → chunk-7OVTUADG.js} +41 -10
  34. package/dist/bundle/{chunk-7U5HJEPZ.js → chunk-A4W7J6VN.js} +34 -22
  35. package/dist/bundle/chunk-ABMPZL2P.js +734 -0
  36. package/dist/bundle/{chunk-EROSAUNP.js → chunk-AN6IJYH3.js} +5 -5
  37. package/dist/bundle/{chunk-SZ2V62HB.js → chunk-AP3CWDRK.js} +2 -2
  38. package/dist/bundle/{chunk-ESZSMZKT.js → chunk-ASU63X5C.js} +2 -2
  39. package/dist/bundle/{chunk-EPOV5UIO.js → chunk-BCIZAUDV.js} +11 -11
  40. package/dist/bundle/{chunk-7PKFYX7V.js → chunk-CEBX63XY.js} +8 -8
  41. package/dist/bundle/{chunk-7GTUZY7M.js → chunk-CYHIM5SL.js} +3 -3
  42. package/dist/bundle/chunk-DWA5TZMP.js +209 -0
  43. package/dist/bundle/{chunk-LDEBZ3IX.js → chunk-DWD3KDJA.js} +1 -1
  44. package/dist/bundle/{chunk-GQ7VFIYM.js → chunk-E3EWS6DF.js} +23 -7
  45. package/dist/bundle/{chunk-NJYAL3UW.js → chunk-EAX5RO7S.js} +1 -1
  46. package/dist/bundle/{chunk-LJQUYECN.js → chunk-EBNCUQLV.js} +1 -1
  47. package/dist/bundle/{chunk-UBRREVLJ.js → chunk-ELAKOEIO.js} +2 -2
  48. package/dist/bundle/{chunk-DAY6TSPF.js → chunk-FEUNZG7U.js} +62 -50
  49. package/dist/bundle/{chunk-63F65DHU.js → chunk-FQRP6JWX.js} +2 -2
  50. package/dist/bundle/{chunk-SMSTGO2G.js → chunk-G3LAYJJJ.js} +4 -4
  51. package/dist/bundle/{chunk-LGQXGOPJ.js → chunk-GBQ76X6T.js} +2 -2
  52. package/dist/bundle/{chunk-CHUKWON6.js → chunk-GJBOZAUD.js} +3 -3
  53. package/dist/bundle/{chunk-A33TIM5D.js → chunk-GMHRPX5M.js} +225 -225
  54. package/dist/bundle/{chunk-O2UCU52O.js → chunk-GQKEMBM6.js} +171 -569
  55. package/dist/bundle/{chunk-EQUKVVHX.js → chunk-HDZNSOV5.js} +7 -7
  56. package/dist/bundle/{chunk-ZM7I52EP.js → chunk-HZZ56JO7.js} +3 -4
  57. package/dist/bundle/{chunk-XQL7FEF4.js → chunk-IBEHYGG6.js} +9 -9
  58. package/dist/bundle/{chunk-U7RLVJ34.js → chunk-IPNIF5JE.js} +4 -4
  59. package/dist/bundle/{chunk-QDMXZZG4.js → chunk-KBAOJISR.js} +18 -8
  60. package/dist/bundle/{chunk-ADEWU4P4.js → chunk-KORZEYZN.js} +1 -1
  61. package/dist/bundle/{chunk-JMDLPBXK.js → chunk-KQZTX4LM.js} +17 -17
  62. package/dist/bundle/{chunk-NHXJYS4R.js → chunk-KRD375P7.js} +32 -28
  63. package/dist/bundle/{chunk-ULXQ5MJM.js → chunk-LAR2DLTI.js} +4 -4
  64. package/dist/bundle/{chunk-NC76INB2.js → chunk-LZ4IWN43.js} +3088 -2266
  65. package/dist/bundle/{chunk-BVMNXI53.js → chunk-M33XHJTM.js} +25 -25
  66. package/dist/bundle/{chunk-WCYCUTSK.js → chunk-M54YKD3I.js} +7 -7
  67. package/dist/bundle/{chunk-LSND5QYI.js → chunk-MW7HUD6R.js} +9 -9
  68. package/dist/bundle/{chunk-AHJ4W2IL.js → chunk-NFWD4QX3.js} +2 -2
  69. package/dist/bundle/{chunk-PM77PRB6.js → chunk-NKYWQTS2.js} +189 -163
  70. package/dist/bundle/{chunk-LRBPT7LQ.js → chunk-NXNUCGGO.js} +6 -6
  71. package/dist/bundle/{chunk-5D4Z2B5B.js → chunk-O3WE5IGP.js} +9 -9
  72. package/dist/bundle/chunk-OYMHPQF7.js +52 -0
  73. package/dist/bundle/{chunk-VVHRQ46X.js → chunk-PIOR6PIO.js} +2 -2
  74. package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
  75. package/dist/bundle/{chunk-XEFAMLSD.js → chunk-PL7TNKAY.js} +3 -3
  76. package/dist/bundle/chunk-PLU2IQXC.js +80 -0
  77. package/dist/bundle/{chunk-73CXFE36.js → chunk-QGFURWEP.js} +29 -1
  78. package/dist/bundle/{chunk-CDY2NJFE.js → chunk-RQPB2BSH.js} +2 -2
  79. package/dist/bundle/{chunk-QRQYUHCZ.js → chunk-S6DTLAOB.js} +12 -12
  80. package/dist/bundle/{chunk-DJD7TBYG.js → chunk-SCMB4LI6.js} +76 -74
  81. package/dist/bundle/{chunk-TGEQNS6G.js → chunk-SFZVMKB6.js} +1 -1
  82. package/dist/bundle/{chunk-PFO76YFP.js → chunk-SHOSFYI7.js} +18 -18
  83. package/dist/bundle/{chunk-5SBLU7D7.js → chunk-SMM7GS4Q.js} +1 -1
  84. package/dist/bundle/{chunk-EQ7A6NA6.js → chunk-SNBYFQHT.js} +1 -1
  85. package/dist/bundle/{chunk-GNTJMB6X.js → chunk-SZX7EPPY.js} +4 -4
  86. package/dist/bundle/{chunk-VX37MPTJ.js → chunk-TCSVW7BA.js} +1 -1
  87. package/dist/bundle/{chunk-P5LYZRKW.js → chunk-TEGQVVCZ.js} +1992 -885
  88. package/dist/bundle/{chunk-Q2VNBY4Y.js → chunk-TIR3AB35.js} +758 -1205
  89. package/dist/bundle/{chunk-5HGGG3QO.js → chunk-U46RNOEQ.js} +16 -3
  90. package/dist/bundle/{chunk-Y37A3232.js → chunk-UCM7C773.js} +130 -8
  91. package/dist/bundle/{chunk-L6AFE73L.js → chunk-UEN5NWNW.js} +1 -1
  92. package/dist/bundle/{chunk-6RS7OYTD.js → chunk-V2QWX6B3.js} +3 -3
  93. package/dist/bundle/{chunk-3IRJDH2U.js → chunk-V5SETIQK.js} +2 -100
  94. package/dist/bundle/{chunk-JR6TSMFX.js → chunk-VEFAYLKX.js} +103 -70
  95. package/dist/bundle/{chunk-CUZRHF34.js → chunk-VG26HDKH.js} +4 -4
  96. package/dist/bundle/{chunk-4ZAK773N.js → chunk-VG2ERHFJ.js} +3 -3
  97. package/dist/bundle/{chunk-CHH42KI4.js → chunk-WAFB3IWJ.js} +8 -8
  98. package/dist/bundle/{chunk-5Z5PEEKP.js → chunk-WASBOYI2.js} +4 -4
  99. package/dist/bundle/{chunk-DXGGCGRP.js → chunk-WEWJA42Q.js} +14 -14
  100. package/dist/bundle/chunk-WR2FPZTE.js +353 -0
  101. package/dist/bundle/chunk-XEYT2EQT.js +338 -0
  102. package/dist/bundle/{chunk-DOSJONCX.js → chunk-YFRTEJ6V.js} +7 -7
  103. package/dist/bundle/{chunk-XRTD2GCU.js → chunk-YHVHDRED.js} +19 -258
  104. package/dist/bundle/{chunk-JH3UOHRE.js → chunk-YREKMP24.js} +4 -4
  105. package/dist/bundle/{chunk-V77XNPXG.js → chunk-Z2B3VNRI.js} +11 -11
  106. package/dist/bundle/{chunk-FKR3M62D.js → chunk-ZJC2XJQC.js} +13 -13
  107. package/dist/bundle/{chunk-5E5R65CA.js → chunk-ZKRWNL4T.js} +2 -2
  108. package/dist/bundle/{cli-QVWTXADI.js → cli-QDPKC2HJ.js} +150 -103
  109. package/dist/bundle/command-contract-KWNCP3MQ.js +39 -0
  110. package/dist/bundle/{command-server-entry-5VL5U5EE.js → command-server-entry-TX7WNN7G.js} +28 -28
  111. package/dist/bundle/{decode-SQ5WGNDX.js → decode-BLPC7OYE.js} +5 -5
  112. package/dist/bundle/{dispatch-LA4DFXJD.js → dispatch-5JUT55CS.js} +8 -8
  113. package/dist/bundle/dist-PAKDDIBT.js +191 -0
  114. package/dist/bundle/{echarts-25Z3RINX.js → echarts-54D3FOCL.js} +2 -2
  115. package/dist/bundle/{embed-BNOTNXMA.js → embed-O7KMDYM7.js} +6 -6
  116. package/dist/bundle/{embedder-BCUT7KKV.js → embedder-4PE67CLX.js} +9 -9
  117. package/dist/bundle/{failure-PKAC6XCT.js → failure-NNQYTB3Z.js} +2 -2
  118. package/dist/bundle/{first-run-EO5K5GME.js → first-run-EAU5SHBI.js} +12 -12
  119. package/dist/bundle/first-screen-APSNGZYZ.js +39 -0
  120. package/dist/bundle/{instructions-VLM3QAYB.js → instructions-ONXP5DZQ.js} +1 -1
  121. package/dist/bundle/{mcp-7ILNMJH5.js → mcp-ZNULRPZ4.js} +2 -2
  122. package/dist/bundle/meeting-combined-W2XIYXFU.js +24 -0
  123. package/dist/bundle/{meeting-model-GHMMUQ34.js → meeting-model-FWIZRKVN.js} +11 -11
  124. package/dist/bundle/{meeting-semantic-BMP6323L.js → meeting-semantic-M4YVJ57W.js} +6 -6
  125. package/dist/bundle/{node-CT3N3TNL.js → node-UTQCYQF5.js} +2 -2
  126. package/dist/bundle/{node-sqlite-MELD2SBX.js → node-sqlite-APJG6MGL.js} +7 -7
  127. package/dist/bundle/{oauth-YBH5OKC2.js → oauth-TY7RMIBL.js} +8 -8
  128. package/dist/bundle/{open-WNSBWTAG.js → open-WDVEQL75.js} +5 -5
  129. package/dist/bundle/{openai-XSNMNLW6.js → openai-H5UJHSEZ.js} +15 -15
  130. package/dist/bundle/{process-I2QKOMM7.js → process-MGMXXPMY.js} +1 -1
  131. package/dist/bundle/{program-G6O3IJR2.js → program-IF36C6VR.js} +969 -1127
  132. package/dist/bundle/{prompt-SOG4AKPM.js → prompt-4RLIWLMF.js} +5 -5
  133. package/dist/bundle/{recognize-WMQLWMXH.js → recognize-UIRTMWM4.js} +4 -4
  134. package/dist/bundle/{remote-4BTFOLFY.js → remote-L3MNWZQK.js} +9 -9
  135. package/dist/bundle/{rerank-LJ3TWRNV.js → rerank-F4KZQTY6.js} +7 -7
  136. package/dist/bundle/{serve-B6UANKXN.js → serve-37AUYTWS.js} +10 -10
  137. package/dist/bundle/server-CRF4QSZR.js +86 -0
  138. package/dist/bundle/{server-YRH6GJ5Z.js → server-UBG676ZJ.js} +73 -61
  139. package/dist/bundle/source-Z7GH7T4B.js +44 -0
  140. package/dist/bundle/{sqlite-runtime-R7QFWFE7.js → sqlite-runtime-CI3RW7VA.js} +6 -6
  141. package/dist/bundle/{state-DIJ5YUOE.js → state-JOHLSLUO.js} +6 -6
  142. package/dist/bundle/{store-MYTYDV6A.js → store-2MBG4IUS.js} +28 -21
  143. package/dist/bundle/{store-6WFWW7EC.js → store-OSOUXBYL.js} +28 -23
  144. package/dist/bundle/store-SNW6U32Y.js +34 -0
  145. package/dist/bundle/store-maintenance-command-W7V54SLT.js +73 -0
  146. package/dist/bundle/surface-ESJS2FUI.js +72 -0
  147. package/dist/bundle/writer-BJDQMKUV.js +46 -0
  148. package/dist/commands/account.d.ts +3 -2
  149. package/dist/commands/account.d.ts.map +1 -1
  150. package/dist/commands/account.js +38 -77
  151. package/dist/commands/account.js.map +1 -1
  152. package/dist/commands/crm-shared.d.ts.map +1 -1
  153. package/dist/commands/crm-shared.js +2 -0
  154. package/dist/commands/crm-shared.js.map +1 -1
  155. package/dist/commands/session.d.ts +23 -6
  156. package/dist/commands/session.d.ts.map +1 -1
  157. package/dist/commands/session.js +122 -77
  158. package/dist/commands/session.js.map +1 -1
  159. package/dist/identity.js +1 -1
  160. package/dist/identity.js.map +1 -1
  161. package/dist/program.d.ts.map +1 -1
  162. package/dist/program.js +0 -2
  163. package/dist/program.js.map +1 -1
  164. package/dist/reasons.js +2 -2
  165. package/dist/reasons.js.map +1 -1
  166. package/dist/setup/flow.d.ts.map +1 -1
  167. package/dist/setup/flow.js +74 -4
  168. package/dist/setup/flow.js.map +1 -1
  169. package/dist/setup/texts.en.json +22 -1
  170. package/dist/setup/texts.es.json +22 -1
  171. package/dist/setup/texts.ru.json +22 -1
  172. package/dist/version.d.ts +1 -1
  173. package/dist/version.js +1 -1
  174. package/package.json +3 -3
  175. package/skills/amo-cli/references/setup.md +8 -2
  176. package/dist/bundle/command-contract-QBUQBXH7.js +0 -39
  177. package/dist/bundle/first-screen-GMN3T6RW.js +0 -39
  178. package/dist/bundle/meeting-combined-LAMF7S2B.js +0 -24
  179. package/dist/bundle/server-S6XD6V6E.js +0 -77
  180. package/dist/bundle/source-DGFTA2TN.js +0 -42
  181. package/dist/bundle/store-CHWY2USQ.js +0 -32
  182. package/dist/bundle/store-maintenance-command-B5TMKFMG.js +0 -68
  183. package/dist/bundle/writer-GP7VIMAU.js +0 -44
@@ -8,29 +8,33 @@ import {
8
8
  sameOrdinaryFile,
9
9
  syncDirectory,
10
10
  writeFileAtomic
11
- } from "./chunk-FKR3M62D.js";
11
+ } from "./chunk-ZJC2XJQC.js";
12
12
  import {
13
- LIST_QUERY_GUIDE,
14
13
  MAIL,
15
14
  OWNER_NOTES,
16
15
  accountsOfKind,
17
16
  crmViewerOf,
18
- dateWindow,
19
17
  groupLockOf,
20
18
  listContextOf,
21
19
  listedAccounts,
22
- momentOf,
23
- nativeTerms,
24
20
  newOperationId,
25
21
  newSendId
26
- } from "./chunk-2I5UVMLW.js";
22
+ } from "./chunk-2AIG2SSJ.js";
27
23
  import {
28
24
  WIRECAT_TOOLS
29
- } from "./chunk-73CXFE36.js";
25
+ } from "./chunk-QGFURWEP.js";
30
26
  import {
31
27
  isNewer,
32
28
  updateCommand
33
- } from "./chunk-GNTJMB6X.js";
29
+ } from "./chunk-SZX7EPPY.js";
30
+ import {
31
+ capability
32
+ } from "./chunk-4PQECIU2.js";
33
+ import {
34
+ LIST_QUERY_GUIDE,
35
+ dateWindow,
36
+ momentOf
37
+ } from "./chunk-ABMPZL2P.js";
34
38
  import {
35
39
  EmptyAnswer,
36
40
  MAX_MODEL_IMAGE_BYTES,
@@ -39,7 +43,7 @@ import {
39
43
  range,
40
44
  systemFor,
41
45
  validateImages
42
- } from "./chunk-ULXQ5MJM.js";
46
+ } from "./chunk-LAR2DLTI.js";
43
47
  import {
44
48
  anyOfTerms,
45
49
  isFunctionWord,
@@ -50,9 +54,8 @@ import {
50
54
  questionText,
51
55
  resolveMeetingSelection,
52
56
  words
53
- } from "./chunk-V77XNPXG.js";
57
+ } from "./chunk-Z2B3VNRI.js";
54
58
  import {
55
- DEFAULT_CONFIG,
56
59
  DEFAULT_IMAGE_MODEL,
57
60
  LINK,
58
61
  WEIGHTS,
@@ -62,26 +65,19 @@ import {
62
65
  codeOf,
63
66
  conversation,
64
67
  envName,
65
- environmentOf,
66
68
  guardedWrite,
67
69
  historyWindow,
68
70
  imageModel,
69
71
  imageModelsDirectory,
70
72
  isImageModelInstalled,
71
- itemOf,
72
- listOf,
73
- nextStep,
74
73
  oddName,
75
74
  parseDuration,
76
75
  placedImage,
77
76
  readOnlyLockOf,
78
- renderAnswer,
79
77
  sentIds,
80
- snakeKeys,
81
78
  tagging,
82
- task,
83
- withAgentLevels
84
- } from "./chunk-PM77PRB6.js";
79
+ task
80
+ } from "./chunk-NKYWQTS2.js";
85
81
  import {
86
82
  CustomTextModelShape,
87
83
  DEFAULT_RERANK_MODEL,
@@ -95,7 +91,7 @@ import {
95
91
  textModels,
96
92
  vectorModelKey,
97
93
  writeTextModelsSection
98
- } from "./chunk-5D4Z2B5B.js";
94
+ } from "./chunk-O3WE5IGP.js";
99
95
  import {
100
96
  AGENDA_COLUMNS,
101
97
  BUSINESS_FIND_MAX,
@@ -108,14 +104,11 @@ import {
108
104
  MAX_FILE_BYTES,
109
105
  MAX_TEXT_CHARS,
110
106
  MENTION_QUERY,
111
- MINUTE,
112
107
  NOT_FILES,
113
108
  PRESET_VERSION,
114
109
  STOP_WORDS,
115
110
  TASK_RELATION_KINDS,
116
111
  TRACKED_CHAT_COLUMNS,
117
- YEAR,
118
- aheadOf,
119
112
  amountsOf,
120
113
  attachmentColumns,
121
114
  attachmentMaxBytes,
@@ -149,12 +142,17 @@ import {
149
142
  rankingContextRange,
150
143
  threadConversation,
151
144
  withoutField
152
- } from "./chunk-P5LYZRKW.js";
145
+ } from "./chunk-TEGQVVCZ.js";
153
146
  import {
154
147
  DEFAULT_STEMMERS,
155
148
  createStemmer,
156
149
  cutsDeep
157
- } from "./chunk-TNUFLULO.js";
150
+ } from "./chunk-6QMSKJB4.js";
151
+ import {
152
+ MINUTE,
153
+ YEAR,
154
+ aheadOf
155
+ } from "./chunk-PLU2IQXC.js";
158
156
  import {
159
157
  FIELD_VERSION,
160
158
  RRF_K,
@@ -163,7 +161,7 @@ import {
163
161
  plainQuery,
164
162
  validateAst,
165
163
  validateFields
166
- } from "./chunk-XQL7FEF4.js";
164
+ } from "./chunk-IBEHYGG6.js";
167
165
  import {
168
166
  TASK_KINDS,
169
167
  TASK_STATES,
@@ -177,30 +175,23 @@ import {
177
175
  sourceOf3 as sourceOf2,
178
176
  typedCommand,
179
177
  withAttempt
180
- } from "./chunk-BVMNXI53.js";
178
+ } from "./chunk-M33XHJTM.js";
181
179
  import {
182
180
  isCliFailure,
183
181
  sqliteCode
184
- } from "./chunk-UBRREVLJ.js";
182
+ } from "./chunk-ELAKOEIO.js";
185
183
  import {
186
184
  localOnly,
187
185
  refuseOffComputer,
188
186
  remoteKey
189
- } from "./chunk-EPOV5UIO.js";
187
+ } from "./chunk-BCIZAUDV.js";
190
188
  import {
191
189
  PLAIN_HTTP_REFUSED,
192
190
  endpoint,
193
191
  endpointFetch,
194
192
  modelAddressAllowed,
195
193
  onThisComputer
196
- } from "./chunk-GQ7VFIYM.js";
197
- import {
198
- DEFAULT_TASK_CATEGORIES,
199
- FALLBACK_CATEGORY,
200
- readSharedSection,
201
- sharedConfigPath,
202
- writeSharedSection
203
- } from "./chunk-DOSJONCX.js";
194
+ } from "./chunk-E3EWS6DF.js";
204
195
  import {
205
196
  Unzip,
206
197
  UnzipInflate,
@@ -211,11 +202,11 @@ import {
211
202
  placedText,
212
203
  runEmbedders,
213
204
  textModelsDirectory
214
- } from "./chunk-ODNQU7DH.js";
205
+ } from "./chunk-3K6T2G52.js";
215
206
  import {
216
207
  installFiles,
217
208
  megabytes
218
- } from "./chunk-U7RLVJ34.js";
209
+ } from "./chunk-IPNIF5JE.js";
219
210
  import {
220
211
  MAX_ACTIONS,
221
212
  ModerationRules,
@@ -229,7 +220,7 @@ import {
229
220
  someUndone,
230
221
  validateFormattedText,
231
222
  visibleFormattedText
232
- } from "./chunk-LSND5QYI.js";
223
+ } from "./chunk-MW7HUD6R.js";
233
224
  import {
234
225
  COUNTER_FIELDS,
235
226
  RANKING_TOKENIZER_VERSION,
@@ -246,7 +237,7 @@ import {
246
237
  pickPerson,
247
238
  rankingOptions,
248
239
  rankingQuestion
249
- } from "./chunk-PFO76YFP.js";
240
+ } from "./chunk-SHOSFYI7.js";
250
241
  import {
251
242
  MESSAGE_PARSING,
252
243
  QUERY_LIMITS,
@@ -256,11 +247,11 @@ import {
256
247
  isQueryLimit,
257
248
  outOfTime,
258
249
  searchError
259
- } from "./chunk-DQV2IKCF.js";
250
+ } from "./chunk-2UJ7ZZZC.js";
260
251
  import {
261
252
  fold,
262
253
  normalize
263
- } from "./chunk-TGEQNS6G.js";
254
+ } from "./chunk-SFZVMKB6.js";
264
255
  import {
265
256
  INTERNAL_NOTES,
266
257
  UNKNOWN_PROVIDER,
@@ -275,10 +266,10 @@ import {
275
266
  kindIn,
276
267
  parseLocator,
277
268
  parseReference
278
- } from "./chunk-QRQYUHCZ.js";
269
+ } from "./chunk-S6DTLAOB.js";
279
270
  import {
280
271
  normalizeTag
281
- } from "./chunk-63F65DHU.js";
272
+ } from "./chunk-FQRP6JWX.js";
282
273
  import {
283
274
  OPERATORS_BY_TYPE,
284
275
  READ_BUDGET_EXCEEDED,
@@ -303,19 +294,25 @@ import {
303
294
  validateQuery,
304
295
  walkQuery,
305
296
  windowOf
306
- } from "./chunk-A33TIM5D.js";
297
+ } from "./chunk-GMHRPX5M.js";
298
+ import {
299
+ DEFAULT_TASK_CATEGORIES,
300
+ FALLBACK_CATEGORY,
301
+ readSharedSection,
302
+ sharedConfigPath,
303
+ writeSharedSection
304
+ } from "./chunk-YFRTEJ6V.js";
307
305
  import {
308
306
  storePath,
309
307
  wirecatDirectory
310
- } from "./chunk-5E5R65CA.js";
308
+ } from "./chunk-ZKRWNL4T.js";
311
309
  import {
312
310
  Credentials,
313
311
  pathsAreOverridden,
314
312
  resolvePaths
315
- } from "./chunk-DJD7TBYG.js";
313
+ } from "./chunk-SCMB4LI6.js";
316
314
  import {
317
315
  array,
318
- boolean,
319
316
  check,
320
317
  getDotPath,
321
318
  integer,
@@ -330,7 +327,6 @@ import {
330
327
  parse,
331
328
  picklist,
332
329
  pipe,
333
- record,
334
330
  regex,
335
331
  safeInteger,
336
332
  safeParse,
@@ -340,7 +336,7 @@ import {
340
336
  trim,
341
337
  union,
342
338
  unknown
343
- } from "./chunk-AUBB72VF.js";
339
+ } from "./chunk-7OVTUADG.js";
344
340
  import {
345
341
  importFrom,
346
342
  resolveFrom
@@ -349,7 +345,7 @@ import {
349
345
  CliError,
350
346
  isCliError,
351
347
  singleLine
352
- } from "./chunk-SZ2V62HB.js";
348
+ } from "./chunk-AP3CWDRK.js";
353
349
  import {
354
350
  __commonJS,
355
351
  __name,
@@ -2258,24 +2254,24 @@ var require_dom = __commonJS({
2258
2254
  function walkDOM(node, context2, callbacks) {
2259
2255
  var stack = [{ node, context: context2, phase: walkDOM.ENTER }];
2260
2256
  while (stack.length > 0) {
2261
- var frame2 = stack.pop();
2262
- if (frame2.phase === walkDOM.ENTER) {
2263
- var childContext = callbacks.enter(frame2.node, frame2.context);
2257
+ var frame = stack.pop();
2258
+ if (frame.phase === walkDOM.ENTER) {
2259
+ var childContext = callbacks.enter(frame.node, frame.context);
2264
2260
  if (childContext === walkDOM.STOP) {
2265
2261
  return walkDOM.STOP;
2266
2262
  }
2267
- stack.push({ node: frame2.node, context: childContext, phase: walkDOM.EXIT });
2263
+ stack.push({ node: frame.node, context: childContext, phase: walkDOM.EXIT });
2268
2264
  if (childContext === null || childContext === void 0) {
2269
2265
  continue;
2270
2266
  }
2271
- var child = frame2.node.lastChild;
2267
+ var child = frame.node.lastChild;
2272
2268
  while (child) {
2273
2269
  stack.push({ node: child, context: childContext, phase: walkDOM.ENTER });
2274
2270
  child = child.previousSibling;
2275
2271
  }
2276
2272
  } else {
2277
2273
  if (callbacks.exit) {
2278
- callbacks.exit(frame2.node, frame2.context);
2274
+ callbacks.exit(frame.node, frame.context);
2279
2275
  }
2280
2276
  }
2281
2277
  }
@@ -16965,10 +16961,10 @@ var require_lib3 = __commonJS({
16965
16961
  }
16966
16962
  });
16967
16963
 
16968
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/ports/traits.js
16964
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/ports/traits.js
16969
16965
  var syncsOneChat = /* @__PURE__ */ __name((messenger) => messenger.history !== "store" || messenger.historyOnDemand === true, "syncsOneChat");
16970
16966
 
16971
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/questions.js
16967
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/questions.js
16972
16968
  var LINKS = /https?:\/\/\S+/g;
16973
16969
  var unanswered = /* @__PURE__ */ __name((messages, { answerers: answerers2, before }) => questions(messages, { answerers: answerers2 }).filter(({ question, answer }) => answer === void 0 && Date.parse(question.timestamp) < before).map(({ question }) => question), "unanswered");
16974
16970
  var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2, asker = "others" }) => {
@@ -16998,7 +16994,7 @@ var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2, asker
16998
16994
  });
16999
16995
  }, "questions");
17000
16996
 
17001
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/task-categories.js
16997
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/task-categories.js
17002
16998
  var names = /* @__PURE__ */ __name((categories) => categories.map(({ name }) => name).join(", "), "names");
17003
16999
  var taskCategoryOf = /* @__PURE__ */ __name((categories = DEFAULT_TASK_CATEGORIES, flag = "--category") => (typed) => {
17004
17000
  const name = typed.trim().toLowerCase();
@@ -17055,7 +17051,7 @@ var categorize = /* @__PURE__ */ __name((text2, categories = DEFAULT_TASK_CATEGO
17055
17051
  return best.name;
17056
17052
  }, "categorize");
17057
17053
 
17058
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/task-rules.js
17054
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/task-rules.js
17059
17055
  var taskAccount = /* @__PURE__ */ __name(({ provider, account }) => `${provider}:${account}`, "taskAccount");
17060
17056
  var RULES_IN = {
17061
17057
  dialog: "all",
@@ -17261,8 +17257,8 @@ var applyTaskRulesToChats = /* @__PURE__ */ __name(async (store, account, chatId
17261
17257
  return passes;
17262
17258
  }, "applyTaskRulesToChats");
17263
17259
 
17264
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/conversations/link.js
17265
- var RULES_VERSION = 5;
17260
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/conversations/link.js
17261
+ var RULES_VERSION = 6;
17266
17262
  var LOOK_BACK = 50;
17267
17263
  var SAME_SENDER_WITHIN = 10;
17268
17264
  var SAME_SENDER_MS = 5 * 6e4;
@@ -17270,31 +17266,39 @@ var linkMessages = /* @__PURE__ */ __name((messages, { handles = /* @__PURE__ */
17270
17266
  const links = [];
17271
17267
  const parents = /* @__PURE__ */ new Map();
17272
17268
  const conversationOf = /* @__PURE__ */ new Map();
17269
+ const held = /* @__PURE__ */ new Map();
17273
17270
  const conversations = [];
17274
- const window3 = [];
17271
+ const window2 = [];
17275
17272
  for (const message of messages) {
17276
17273
  check2?.();
17277
17274
  const found = [
17278
- ...replyLink(message, conversationOf),
17279
- ...mentionLinks(message, window3, handles),
17280
- ...sameSenderLink(message, window3)
17275
+ ...replyLink(message, held),
17276
+ ...mentionLinks(message, window2, handles),
17277
+ ...sameSenderLink(message, window2)
17281
17278
  ];
17282
17279
  links.push(...found);
17283
- const parent = choose(found, answers, message.id, conversationOf);
17280
+ const parent = choose(found, answers, message, held);
17284
17281
  parents.set(message.id, parent);
17285
17282
  const conversation2 = parent === null ? conversations.length : conversationOf.get(parent);
17286
17283
  if (conversation2 === conversations.length)
17287
17284
  conversations.push([]);
17288
17285
  conversations[conversation2]?.push(message.id);
17289
17286
  conversationOf.set(message.id, conversation2);
17290
- window3.push(message);
17291
- if (window3.length > LOOK_BACK)
17292
- window3.shift();
17287
+ held.set(message.id, { threadId: message.threadId, text: message.text.trim() !== "" });
17288
+ window2.push(message);
17289
+ if (window2.length > LOOK_BACK)
17290
+ window2.shift();
17293
17291
  }
17294
17292
  return { links, parents, conversations };
17295
17293
  }, "linkMessages");
17296
- var replyLink = /* @__PURE__ */ __name((message, held) => message.replyToId !== void 0 && held.has(message.replyToId) ? [link(message, message.replyToId, "provider", "reply", 1, "reply")] : [], "replyLink");
17297
- var mentionLinks = /* @__PURE__ */ __name((message, window3, handles) => {
17294
+ var replyLink = /* @__PURE__ */ __name((message, held) => message.replyToId !== void 0 && inThread(held, message.replyToId, message) ? [link(message, message.replyToId, "provider", "reply", 1, "reply")] : [], "replyLink");
17295
+ var inThread = /* @__PURE__ */ __name((held, id2, message) => {
17296
+ const parent = held.get(id2);
17297
+ if (!parent)
17298
+ return false;
17299
+ return parent.threadId === message.threadId || id2 === message.threadId && parent.text;
17300
+ }, "inThread");
17301
+ var mentionLinks = /* @__PURE__ */ __name((message, window2, handles) => {
17298
17302
  const links = [];
17299
17303
  const people = new Set([...mentioned(message.text, handles)].flatMap((handle) => handles.get(handle) ?? []));
17300
17304
  for (const id2 of message.mentions ?? [])
@@ -17302,17 +17306,17 @@ var mentionLinks = /* @__PURE__ */ __name((message, window3, handles) => {
17302
17306
  for (const sender of people) {
17303
17307
  if (sender === message.senderId)
17304
17308
  continue;
17305
- const target2 = latest(window3, (candidate) => candidate.senderId === sender && sameThread(candidate, message));
17309
+ const target2 = latest(window2, (candidate) => candidate.senderId === sender && sameThread(candidate, message));
17306
17310
  if (target2)
17307
17311
  links.push(link(message, target2.id, "rule", "mention", 0.8, "mention-v1"));
17308
17312
  }
17309
17313
  return links;
17310
17314
  }, "mentionLinks");
17311
- var sameSenderLink = /* @__PURE__ */ __name((message, window3) => {
17315
+ var sameSenderLink = /* @__PURE__ */ __name((message, window2) => {
17312
17316
  if (message.senderId === null)
17313
17317
  return [];
17314
17318
  const at = Date.parse(message.timestamp);
17315
- const target2 = latest(window3.slice(-SAME_SENDER_WITHIN), (candidate) => candidate.senderId === message.senderId && sameThread(candidate, message) && at - Date.parse(candidate.timestamp) <= SAME_SENDER_MS);
17319
+ const target2 = latest(window2.slice(-SAME_SENDER_WITHIN), (candidate) => candidate.senderId === message.senderId && sameThread(candidate, message) && at - Date.parse(candidate.timestamp) <= SAME_SENDER_MS);
17316
17320
  return target2 ? [link(message, target2.id, "rule", "same_sender", 0.5, "same-sender-v2")] : [];
17317
17321
  }, "sameSenderLink");
17318
17322
  var mentioned = /* @__PURE__ */ __name((text2, handles) => {
@@ -17325,14 +17329,14 @@ var mentioned = /* @__PURE__ */ __name((text2, handles) => {
17325
17329
  found.add(opening);
17326
17330
  return found;
17327
17331
  }, "mentioned");
17328
- var choose = /* @__PURE__ */ __name((links, answers, id2, held) => {
17332
+ var choose = /* @__PURE__ */ __name((links, answers, message, held) => {
17329
17333
  const provider = links.find((one) => one.source === "provider");
17330
17334
  if (provider)
17331
17335
  return provider.parentId;
17332
- const answer = answers.get(id2);
17336
+ const answer = answers.get(message.id);
17333
17337
  if (answer === null)
17334
17338
  return null;
17335
- if (answer !== void 0 && held.has(answer))
17339
+ if (answer !== void 0 && inThread(held, answer, message))
17336
17340
  return answer;
17337
17341
  let best;
17338
17342
  for (const one of links)
@@ -17340,9 +17344,9 @@ var choose = /* @__PURE__ */ __name((links, answers, id2, held) => {
17340
17344
  best = one;
17341
17345
  return best?.parentId ?? null;
17342
17346
  }, "choose");
17343
- var latest = /* @__PURE__ */ __name((window3, matches) => {
17344
- for (let index = window3.length - 1; index >= 0; index--) {
17345
- const candidate = window3[index];
17347
+ var latest = /* @__PURE__ */ __name((window2, matches) => {
17348
+ for (let index = window2.length - 1; index >= 0; index--) {
17349
+ const candidate = window2[index];
17346
17350
  if (candidate && matches(candidate))
17347
17351
  return candidate;
17348
17352
  }
@@ -17351,7 +17355,7 @@ var latest = /* @__PURE__ */ __name((window3, matches) => {
17351
17355
  var sameThread = /* @__PURE__ */ __name((a, b) => a.threadId === b.threadId, "sameThread");
17352
17356
  var link = /* @__PURE__ */ __name((message, parentId, source, kind, confidence, method) => ({ messageId: message.id, parentId, source, kind, confidence, method }), "link");
17353
17357
 
17354
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/sends/upload.js
17358
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/sends/upload.js
17355
17359
  import { openAsBlob, realpathSync } from "node:fs";
17356
17360
  import { open, stat } from "node:fs/promises";
17357
17361
  import { basename, dirname, extname, isAbsolute, relative, resolve, sep } from "node:path";
@@ -17433,7 +17437,6 @@ var CREDENTIAL_RUNS = [
17433
17437
  ];
17434
17438
  var WIRECAT_APPS = [
17435
17439
  ...WIRECAT_TOOLS.map(({ appName, envPrefix }) => ({ appName, prefix: envPrefix })),
17436
- { appName: "amo-cli", prefix: "AMO" },
17437
17440
  { appName: "beeline-cli", prefix: "BEELINE" },
17438
17441
  { appName: "zm", prefix: "ZM" },
17439
17442
  { appName: "cli-messaging", prefix: "MESSAGING" },
@@ -17532,10 +17535,10 @@ var checkFilename = /* @__PURE__ */ __name((filename, files) => {
17532
17535
  if (filename.trim() === "" || /[/\\\0]/.test(filename) || filename.length > 255)
17533
17536
  throw new CliError("validation_error", "--filename is a name, not a path: no / or \\, at most 255 characters");
17534
17537
  }, "checkFilename");
17535
- var listOf2 = /* @__PURE__ */ __name((value) => value === void 0 ? [] : typeof value === "string" ? [value] : value, "listOf");
17538
+ var listOf = /* @__PURE__ */ __name((value) => value === void 0 ? [] : typeof value === "string" ? [value] : value, "listOf");
17536
17539
  var readAttachments = /* @__PURE__ */ __name(async ({ photo, file, voice, asFile, filename, text: text2 }, read) => {
17537
- const photos = listOf2(photo);
17538
- const files = listOf2(file);
17540
+ const photos = listOf(photo);
17541
+ const files = listOf(file);
17539
17542
  if (voice !== void 0 && (photos.length > 0 || files.length > 0 || (text2 ?? "").trim() !== "")) {
17540
17543
  throw new CliError("validation_error", "a voice message goes alone \u2014 no text, no file, no photo beside it");
17541
17544
  }
@@ -17568,24 +17571,7 @@ var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes, read) => {
17568
17571
  return { name, source };
17569
17572
  }, "readStickerFile");
17570
17573
 
17571
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/ports/messenger.js
17572
- var throughWrapper = /* @__PURE__ */ __name((inner, handled, wrap = (_, call) => call) => new Proxy(handled, {
17573
- get: /* @__PURE__ */ __name((own, key) => {
17574
- if (key in own)
17575
- return own[key];
17576
- const value = inner[key];
17577
- return typeof value === "function" ? wrap(String(key), (...args) => value.apply(inner, args)) : value;
17578
- }, "get"),
17579
- has: /* @__PURE__ */ __name((own, key) => key in own || key in inner, "has")
17580
- }), "throughWrapper");
17581
- var capability = /* @__PURE__ */ __name((adapter, method, what) => {
17582
- const found = adapter[method];
17583
- if (typeof found !== "function")
17584
- throw new CliError("validation_error", `this messenger cannot ${what}`);
17585
- return found.bind(adapter);
17586
- }, "capability");
17587
-
17588
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/deps.js
17574
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/deps.js
17589
17575
  var accountStore = /* @__PURE__ */ __name(async (deps) => (await deps.store()).forAccount(await deps.account()), "accountStore");
17590
17576
  var crossAccount = /* @__PURE__ */ __name((deps, _reason) => deps.store(), "crossAccount");
17591
17577
  var NO_LOCAL_STORE = "this answer comes from the messenger, not from the local store";
@@ -17647,7 +17633,7 @@ var storedDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({
17647
17633
  }), "storedDeps");
17648
17634
  var storeModeDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({ ...storedDeps(messenger, store, account, guard), offline: false, reads: "store" }), "storeModeDeps");
17649
17635
 
17650
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/botcheck/check.js
17636
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/botcheck/check.js
17651
17637
  var DAY_MS = 864e5;
17652
17638
  var NEW_DAYS = 30;
17653
17639
  var SAME_TEXT_MIN = 20;
@@ -17724,7 +17710,7 @@ var scorePerson = /* @__PURE__ */ __name(({ subject, provider, activity, photos,
17724
17710
  };
17725
17711
  }, "scorePerson");
17726
17712
 
17727
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/http/time-limit.js
17713
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/http/time-limit.js
17728
17714
  var timeLimit = /* @__PURE__ */ __name((ms) => {
17729
17715
  const controller = new AbortController();
17730
17716
  const timer = setTimeout(() => controller.abort(new DOMException("The operation timed out.", "TimeoutError")), ms);
@@ -17740,7 +17726,7 @@ var withTimeLimit = /* @__PURE__ */ __name(async (ms, run2) => {
17740
17726
  }
17741
17727
  }, "withTimeLimit");
17742
17728
 
17743
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/botcheck/registries.js
17729
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/botcheck/registries.js
17744
17730
  var REGISTRIES = {
17745
17731
  cas: { title: "Combot Anti-Spam (CAS)", docs: "https://cas.chat/api" },
17746
17732
  lols: { title: "lols.bot", docs: "https://api.lols.bot/lols-bot.json" }
@@ -17827,7 +17813,7 @@ var notCovered = /* @__PURE__ */ __name((messenger, now = /* @__PURE__ */ new Da
17827
17813
  detail: `lists Telegram accounts only, not ${messenger} ones`
17828
17814
  })), "notCovered");
17829
17815
 
17830
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/botcheck/service.js
17816
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/botcheck/service.js
17831
17817
  var ACTIVITY_MESSAGES = 1e3;
17832
17818
  var botCheckService = /* @__PURE__ */ __name((deps) => {
17833
17819
  const subjectOf = /* @__PURE__ */ __name(async (reference) => {
@@ -17915,7 +17901,7 @@ var botCheckService = /* @__PURE__ */ __name((deps) => {
17915
17901
  };
17916
17902
  }, "botCheckService");
17917
17903
 
17918
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/domain/thread.js
17904
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/domain/thread.js
17919
17905
  var threadIdOf = /* @__PURE__ */ __name((value) => {
17920
17906
  if (value === void 0)
17921
17907
  return void 0;
@@ -17925,7 +17911,7 @@ var threadIdOf = /* @__PURE__ */ __name((value) => {
17925
17911
  return id2;
17926
17912
  }, "threadIdOf");
17927
17913
 
17928
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/chat-stats.js
17914
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/chat-stats.js
17929
17915
  var TOP_POSTS = 5;
17930
17916
  var JOINS = /* @__PURE__ */ new Set(["join", "add"]);
17931
17917
  var LEAVES = /* @__PURE__ */ new Set(["leave", "remove"]);
@@ -18042,7 +18028,7 @@ var median = /* @__PURE__ */ __name((values) => {
18042
18028
  return Math.round(sorted.length % 2 === 0 ? ((sorted[middle - 1] ?? upper) + upper) / 2 : upper);
18043
18029
  }, "median");
18044
18030
 
18045
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/member-history.js
18031
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/member-history.js
18046
18032
  var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
18047
18033
  const events = [];
18048
18034
  for (const stay of stays) {
@@ -18074,7 +18060,7 @@ var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
18074
18060
  return events.filter(({ at }) => Date.parse(at) >= since).sort((a, b) => Date.parse(a.at) - Date.parse(b.at) || a.id.localeCompare(b.id));
18075
18061
  }, "memberEvents");
18076
18062
 
18077
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/members-audit.js
18063
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/members-audit.js
18078
18064
  var AUDIT_PAGE = 200;
18079
18065
  var AUDIT_BUDGET = 10;
18080
18066
  var AUDIT_PAUSE_MS = 1e3;
@@ -18154,7 +18140,7 @@ var burstJoins = /* @__PURE__ */ __name((members) => {
18154
18140
  return found;
18155
18141
  }, "burstJoins");
18156
18142
 
18157
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/message-resolution.js
18143
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/message-resolution.js
18158
18144
  var readChatId = /* @__PURE__ */ __name(async (deps, reference, store, account) => {
18159
18145
  if (deps.reads !== "store")
18160
18146
  return keptChatId(deps.messenger, reference, store, account);
@@ -18255,9 +18241,9 @@ var chatIdAmong = /* @__PURE__ */ __name(async (messenger, reference, account, {
18255
18241
  }, "chatIdAmong");
18256
18242
  var ambiguousAcross = /* @__PURE__ */ __name((reference, what, candidates) => {
18257
18243
  const width = Math.max(...candidates.map(({ provider, id: id2 }) => `${provider} ${id2}`.length));
18258
- const lines3 = candidates.map(({ provider, id: id2, label }) => ` ${`${provider} ${id2}`.padEnd(width)} ${label}`);
18244
+ const lines = candidates.map(({ provider, id: id2, label }) => ` ${`${provider} ${id2}`.padEnd(width)} ${label}`);
18259
18245
  return new CliError("validation_error", `"${singleLine(reference)}" matches ${candidates.length} ${what} in different accounts \u2014 name one by its id, or narrow the search with in:<messenger>:
18260
- ${lines3.join("\n")}`, { candidates: candidates.map(({ provider, id: id2 }) => ({ provider, id: id2 })) });
18246
+ ${lines.join("\n")}`, { candidates: candidates.map(({ provider, id: id2 }) => ({ provider, id: id2 })) });
18261
18247
  }, "ambiguousAcross");
18262
18248
  var missing = /* @__PURE__ */ __name((error) => {
18263
18249
  if (codeOf(error) === "not_found")
@@ -18355,7 +18341,7 @@ var chatsMatchingIn = /* @__PURE__ */ __name(async (store, accounts, pattern) =>
18355
18341
  }, "chatsMatchingIn");
18356
18342
  var isText = /* @__PURE__ */ __name((value) => typeof value === "string" && value !== "", "isText");
18357
18343
 
18358
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/chats.js
18344
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/chats.js
18359
18345
  var EVENTS_DAYS = 7;
18360
18346
  var TRACKED_DAYS = 30;
18361
18347
  var STATS_PAGE = 1e3;
@@ -18389,15 +18375,15 @@ var deepChecks = /* @__PURE__ */ __name(async (deps, items, deep, pauseMs, regis
18389
18375
  return checked2;
18390
18376
  }, "deepChecks");
18391
18377
  var chatsService = /* @__PURE__ */ __name((deps) => ({
18392
- list: /* @__PURE__ */ __name(async (window3, query) => {
18378
+ list: /* @__PURE__ */ __name(async (window2, query) => {
18393
18379
  if (fromStore(deps)) {
18394
18380
  const where = query ? queryFilter(query, CHAT_COLUMNS, { command: "chats list", zone: timezoneOf() }) : void 0;
18395
- return (await accountStore(deps)).chats.chats({ ...window3, ...where ? { where } : {} });
18381
+ return (await accountStore(deps)).chats.chats({ ...window2, ...where ? { where } : {} });
18396
18382
  }
18397
18383
  const [term] = query ? walkQuery(query.root) : [];
18398
18384
  if (term)
18399
18385
  queryError("query.unsupported-field", term.span, "the messenger cannot filter its chat list; the fields answer from the local store, with --offline", { command: "chats list" }, { supported: [] });
18400
- return capability(await deps.connection(), "chats", "list chats")(window3);
18386
+ return capability(await deps.connection(), "chats", "list chats")(window2);
18401
18387
  }, "list"),
18402
18388
  account: /* @__PURE__ */ __name(() => deps.account(), "account"),
18403
18389
  show: /* @__PURE__ */ __name(async (chat) => {
@@ -18421,17 +18407,17 @@ var chatsService = /* @__PURE__ */ __name((deps) => ({
18421
18407
  const held = await accountStoreIfOpen(deps);
18422
18408
  return held ? { ...card, members: await storedMembers(held, card.id) } : card;
18423
18409
  }, "show"),
18424
- members: /* @__PURE__ */ __name(async (chat, window3) => {
18410
+ members: /* @__PURE__ */ __name(async (chat, window2) => {
18425
18411
  if (!deps.offline) {
18426
18412
  const connection = await deps.connection();
18427
18413
  if (!fromStore(deps) || connection.members)
18428
- return capability(connection, "members", "list a group's members")(chat, window3);
18414
+ return capability(connection, "members", "list a group's members")(chat, window2);
18429
18415
  }
18430
18416
  const store = await accountStore(deps);
18431
18417
  const chatId = await chatIdIn(deps.messenger, chat, store, { includeLeft: true });
18432
18418
  const everyone = await store.roster.members(chatId);
18433
- const end = window3.limit === void 0 ? everyone.length : window3.offset + window3.limit;
18434
- return { chatId, items: everyone.slice(window3.offset, end), hasMore: everyone.length > end };
18419
+ const end = window2.limit === void 0 ? everyone.length : window2.offset + window2.limit;
18420
+ return { chatId, items: everyone.slice(window2.offset, end), hasMore: everyone.length > end };
18435
18421
  }, "members"),
18436
18422
  events: /* @__PURE__ */ __name(async (chat, { since }) => {
18437
18423
  const from = since ?? Date.now() - EVENTS_DAYS * 864e5;
@@ -18650,7 +18636,7 @@ var storedMembers = /* @__PURE__ */ __name(async (store, chatId) => {
18650
18636
  return members.length === 0 ? null : members;
18651
18637
  }, "storedMembers");
18652
18638
 
18653
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/inbox.js
18639
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/inbox.js
18654
18640
  var INBOX_CHATS = 20;
18655
18641
  var REVIEW_DAYS = 3;
18656
18642
  var UNANSWERED_HOURS = 24;
@@ -18670,7 +18656,7 @@ var storeReader = /* @__PURE__ */ __name((deps, store, account) => ({
18670
18656
  const end = limit === void 0 ? all.length : offset + limit;
18671
18657
  return { items: all.slice(offset, end), hasMore: all.length > end };
18672
18658
  }, "chats"),
18673
- history: /* @__PURE__ */ __name((chat, window3) => store.messages.messages(account, chat, window3), "history"),
18659
+ history: /* @__PURE__ */ __name((chat, window2) => store.messages.messages(account, chat, window2), "history"),
18674
18660
  resolve: /* @__PURE__ */ __name(async (reference) => {
18675
18661
  const id2 = await readChatId(deps, reference, store, account);
18676
18662
  const found = (await store.chats.chats(account, {})).items.find((one) => one.id === id2);
@@ -18858,7 +18844,7 @@ var inboxService = /* @__PURE__ */ __name((deps) => {
18858
18844
  };
18859
18845
  }, "inboxService");
18860
18846
 
18861
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/excerpt.js
18847
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/excerpt.js
18862
18848
  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");
18863
18849
  var excerpt = /* @__PURE__ */ __name((text2, query, size2 = 240, options2 = {}) => {
18864
18850
  const flat = text2.replace(/\s+/g, " ").trim();
@@ -18874,7 +18860,7 @@ var excerpt = /* @__PURE__ */ __name((text2, query, size2 = 240, options2 = {})
18874
18860
  }, "excerpt");
18875
18861
  var withExcerpt = /* @__PURE__ */ __name(({ matchedText, ...hit }, query) => ({ ...hit, excerpt: excerpt(matchedText ?? hit.text, query) }), "withExcerpt");
18876
18862
 
18877
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/person-meetings.js
18863
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/person-meetings.js
18878
18864
  var SCAN = 1e3;
18879
18865
  var SNIPPET = 200;
18880
18866
  var SNIPPET_ROWS = 6;
@@ -18939,7 +18925,7 @@ var personMeetings = /* @__PURE__ */ __name(async (store, people, accounts, { li
18939
18925
  return { items, total: newest.length, hasMore: cut || newest.length > limit };
18940
18926
  }, "personMeetings");
18941
18927
 
18942
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/person-context.js
18928
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/person-context.js
18943
18929
  var CONTEXT_MESSAGES = 10;
18944
18930
  var CONTEXT_BYTES = 64 * 1024;
18945
18931
  var toContext = /* @__PURE__ */ __name((key, message, chatTitle2) => ({
@@ -19028,25 +19014,25 @@ var readableAccounts = /* @__PURE__ */ __name(async (store, asked, scopes) => {
19028
19014
  return stored.filter((one) => allowed.includes(one.scope));
19029
19015
  }, "readableAccounts");
19030
19016
  var readableScopes = /* @__PURE__ */ __name(async (store, asked, scopes) => (await allowedOf(store, asked, scopes)).allowed, "readableScopes");
19031
- var readsOf = /* @__PURE__ */ __name((record2, asked, readable) => {
19017
+ var readsOf = /* @__PURE__ */ __name((record, asked, readable) => {
19032
19018
  const scopeOf5 = new Map(readable.map((one) => [nameOf(one), one.scope]));
19033
- return record2.identities.flatMap((identity) => (identity.provider === asked.provider ? [asked.account] : identity.accounts).flatMap((account) => {
19019
+ return record.identities.flatMap((identity) => (identity.provider === asked.provider ? [asked.account] : identity.accounts).flatMap((account) => {
19034
19020
  const scope = scopeOf5.get(nameOf({ provider: identity.provider, account }));
19035
19021
  return identity.accounts.includes(account) && scope !== void 0 ? [{ key: { provider: identity.provider, account }, scope, identity }] : [];
19036
19022
  }));
19037
19023
  }, "readsOf");
19038
19024
  var personContext = /* @__PURE__ */ __name(async (store, asked, reference, options2 = {}) => {
19039
19025
  const found = pickPerson(reference, await store.people.people(asked.provider, { account: asked.account }));
19040
- const record2 = await store.people.personOf({ provider: asked.provider, id: found.id });
19041
- if (!record2)
19026
+ const record = await store.people.personOf({ provider: asked.provider, id: found.id });
19027
+ if (!record)
19042
19028
  throw new CliError("not_found", `no person ${found.id} in the store`);
19043
19029
  const readable = await readableAccounts(store, asked, options2.scopes);
19044
19030
  return {
19045
- person: { ...record2, provider: asked.provider, id: found.id },
19046
- ...await recordContext(store, record2, readsOf(record2, asked, readable), readable, options2)
19031
+ person: { ...record, provider: asked.provider, id: found.id },
19032
+ ...await recordContext(store, record, readsOf(record, asked, readable), readable, options2)
19047
19033
  };
19048
19034
  }, "personContext");
19049
- var recordContext = /* @__PURE__ */ __name(async (store, record2, reads, readable, { messages = CONTEXT_MESSAGES, bytes: bytes2 = CONTEXT_BYTES, since, now = Date.now(), calendarIds, scopes } = {}) => {
19035
+ var recordContext = /* @__PURE__ */ __name(async (store, record, reads, readable, { messages = CONTEXT_MESSAGES, bytes: bytes2 = CONTEXT_BYTES, since, now = Date.now(), calendarIds, scopes } = {}) => {
19050
19036
  const recent = /* @__PURE__ */ __name((message) => since === void 0 || Date.parse(message.timestamp) >= since, "recent");
19051
19037
  const allowed = new Set(scopes ?? readable.map((one) => one.scope));
19052
19038
  const inScope = /* @__PURE__ */ __name(async (key, scope, hits) => {
@@ -19108,7 +19094,7 @@ var recordContext = /* @__PURE__ */ __name(async (store, record2, reads, readabl
19108
19094
  mentions.push(...(await inScope(key, scope, named2.items)).filter((hit) => hit.senderId !== identity.id).map((hit) => toContext(key, hit, hit.chatTitle ?? null)).filter(recent));
19109
19095
  cut ||= named2.hasMore;
19110
19096
  }
19111
- const personId = Number(record2.uid);
19097
+ const personId = Number(record.uid);
19112
19098
  const calendars = [];
19113
19099
  for (const one of readable)
19114
19100
  if ((await store.calendar.calendars(one.id)).length)
@@ -19120,7 +19106,7 @@ var recordContext = /* @__PURE__ */ __name(async (store, record2, reads, readabl
19120
19106
  const upcomingIds = new Set(upcoming.items.map(({ id: id2 }) => id2));
19121
19107
  const past = accountIds.length ? await eventsOnce(store, { personId, accountIds, to: now, newest: true, ...since === void 0 ? {} : { from: since } }, messages) : nothing;
19122
19108
  cut ||= upcoming.cut || past.cut;
19123
- const recorded = await personMeetings(store, [record2.uid], readable, {
19109
+ const recorded = await personMeetings(store, [record.uid], readable, {
19124
19110
  limit: messages,
19125
19111
  ...since === void 0 ? {} : { since }
19126
19112
  });
@@ -19222,8 +19208,8 @@ var lean = /* @__PURE__ */ __name((key, message, detail) => {
19222
19208
  var kindOf2 = /* @__PURE__ */ __name((chat, chatId, person) => chat && chat.kind !== "unknown" ? chat.kind : chatId === person ? "dialog" : chat?.kind ?? "unknown", "kindOf");
19223
19209
  var personMessages = /* @__PURE__ */ __name(async (store, asked, reference, { chats, limit = CHAT_MESSAGES, detail = 0 }) => {
19224
19210
  const found = pickPerson(reference, await store.people.people(asked.provider, { account: asked.account }));
19225
- const record2 = await store.people.personOf({ provider: asked.provider, id: found.id });
19226
- if (!record2)
19211
+ const record = await store.people.personOf({ provider: asked.provider, id: found.id });
19212
+ if (!record)
19227
19213
  throw new CliError("not_found", `no person ${found.id} in the store`);
19228
19214
  const stored = (await store.chats.chats(asked, {})).items;
19229
19215
  const held = new Map((await store.chats.chatCompleteness(asked, chats)).map((one) => [one.chatId, one.state]));
@@ -19239,16 +19225,16 @@ var personMessages = /* @__PURE__ */ __name(async (store, asked, reference, { ch
19239
19225
  });
19240
19226
  }
19241
19227
  return {
19242
- person: { uid: record2.uid, provider: asked.provider, id: found.id, name: found.name ?? record2.name },
19228
+ person: { uid: record.uid, provider: asked.provider, id: found.id, name: found.name ?? record.name },
19243
19229
  chats: answer,
19244
19230
  limits: { messages: limit }
19245
19231
  };
19246
19232
  }, "personMessages");
19247
19233
 
19248
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
19234
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
19249
19235
  import { createHash } from "node:crypto";
19250
19236
 
19251
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/meeting-reference.js
19237
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/meeting-reference.js
19252
19238
  var missing2 = /* @__PURE__ */ __name(() => new CliError("not_found", "the meeting evidence is unavailable for this account"), "missing");
19253
19239
  var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId, reference, options2 = {}) => {
19254
19240
  const parsed = parseMeetingReference(reference);
@@ -19266,7 +19252,7 @@ var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId,
19266
19252
  return { parsed, meeting };
19267
19253
  }, "authorizedMeetingMetadata");
19268
19254
 
19269
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
19255
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
19270
19256
  var hash = /* @__PURE__ */ __name((value) => createHash("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
19271
19257
  var checkMeetingCancelled = /* @__PURE__ */ __name((signal) => {
19272
19258
  if (signal?.aborted)
@@ -19465,7 +19451,7 @@ var readMeetingEvidence = /* @__PURE__ */ __name(async (store, accountId, refere
19465
19451
  return { ...packet, fingerprint: hash(packet) };
19466
19452
  }, "readMeetingEvidence");
19467
19453
 
19468
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/person-meeting-context.js
19454
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/person-meeting-context.js
19469
19455
  var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference, options2) => {
19470
19456
  const { meetings = 10, cues = 5, bytes: bytes2 = 64 * 1024, scanLimit = 1e3, since, signal } = options2;
19471
19457
  const requestedAccounts = options2.accountIds;
@@ -19564,7 +19550,7 @@ var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference,
19564
19550
  };
19565
19551
  }, "personMeetingContext");
19566
19552
 
19567
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/person-preparation.js
19553
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/person-preparation.js
19568
19554
  var PREPARE_BYTES = 96 * 1024;
19569
19555
  var MEETINGS = 5;
19570
19556
  var CUES = 3;
@@ -19687,7 +19673,7 @@ var meetingsOf = /* @__PURE__ */ __name(async (store, uid, stored, since, left)
19687
19673
  }
19688
19674
  }, "meetingsOf");
19689
19675
 
19690
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/person-profile.js
19676
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/person-profile.js
19691
19677
  var personProfile = /* @__PURE__ */ __name(async (deps, person, known2) => {
19692
19678
  const online = deps.offline ? void 0 : await deps.connection();
19693
19679
  const held = await storeIfOpen(deps);
@@ -19757,7 +19743,7 @@ var quiet = /* @__PURE__ */ __name((facts) => facts.chats.map(({ id: id2, title,
19757
19743
  complete: false
19758
19744
  })), "quiet");
19759
19745
 
19760
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/person-timeline.js
19746
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/person-timeline.js
19761
19747
  var TIMELINE_ITEMS = 50;
19762
19748
  var TIMELINE_MAX = 500;
19763
19749
  var SCOPES = ["personal", "work"];
@@ -19781,10 +19767,10 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
19781
19767
  });
19782
19768
  const read = scope === void 0 ? [...allowed] : [scope];
19783
19769
  const found = pickPerson(reference, await store.people.people(asked.provider, { account: asked.account }));
19784
- const record2 = await store.people.personOf({ provider: asked.provider, id: found.id });
19785
- if (!record2)
19770
+ const record = await store.people.personOf({ provider: asked.provider, id: found.id });
19771
+ if (!record)
19786
19772
  throw new CliError("not_found", `no person ${found.id} in the store`);
19787
- const personId = Number(record2.uid);
19773
+ const personId = Number(record.uid);
19788
19774
  const pending = store.involvements.pending();
19789
19775
  const rows = store.involvements.forPerson(personId, {
19790
19776
  scopes: read,
@@ -19798,7 +19784,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
19798
19784
  const last = shown.at(-1);
19799
19785
  const hasMore = rows.length > limit;
19800
19786
  return {
19801
- person: { uid: record2.uid, name: record2.name },
19787
+ person: { uid: record.uid, name: record.name },
19802
19788
  scopes: read,
19803
19789
  items: shown.map((row) => ({
19804
19790
  at: new Date(row.occurredAt).toISOString(),
@@ -19819,7 +19805,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
19819
19805
  };
19820
19806
  }, "personTimeline");
19821
19807
 
19822
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/chat-coverage.js
19808
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/chat-coverage.js
19823
19809
  var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
19824
19810
  const ids = [...new Set(chatIds)];
19825
19811
  if (ids.length === 0)
@@ -19845,7 +19831,7 @@ var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
19845
19831
  }));
19846
19832
  }, "chatCoverage");
19847
19833
 
19848
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/context/evidence-response.js
19834
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/context/evidence-response.js
19849
19835
  var contextSourceKey = /* @__PURE__ */ __name((source) => JSON.stringify([source.kind, source.accountId, source.provider, source.account]), "contextSourceKey");
19850
19836
  var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
19851
19837
  const fail2 = /* @__PURE__ */ __name(() => {
@@ -19909,7 +19895,7 @@ var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
19909
19895
  }
19910
19896
  }, "validateContextEvidencePage");
19911
19897
 
19912
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/context/read-budget.js
19898
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/context/read-budget.js
19913
19899
  var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
19914
19900
  if (!limits || typeof limits !== "object" || Array.isArray(limits))
19915
19901
  throw new CliError("validation_error", "limits needs a context read allowance");
@@ -19962,7 +19948,7 @@ var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
19962
19948
  };
19963
19949
  }, "contextReadBudget");
19964
19950
 
19965
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/context-evidence.js
19951
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/context-evidence.js
19966
19952
  var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits) => {
19967
19953
  if (!port || typeof port.read !== "function")
19968
19954
  throw new CliError("configuration_error", "context evidence reader is unavailable");
@@ -20006,13 +19992,13 @@ var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits)
20006
19992
  };
20007
19993
  }, "createContextEvidenceReader");
20008
19994
 
20009
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/project-gathering-around.js
19995
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/project-gathering-around.js
20010
19996
  var storedMessageNeighbours = /* @__PURE__ */ __name((messages) => ({
20011
- async around(ref, window3) {
19997
+ async around(ref, window2) {
20012
19998
  const at = parseLocator(ref);
20013
19999
  if (at.provider === "email")
20014
20000
  return [];
20015
- const rows = await messages.around({ provider: at.provider, account: at.account }, at.chat, at.message, window3);
20001
+ const rows = await messages.around({ provider: at.provider, account: at.account }, at.chat, at.message, window2);
20016
20002
  return rows.filter((row) => !row.anchor).map((row) => ({
20017
20003
  ref: formatLocator({ ...at, message: row.id }),
20018
20004
  at: Date.parse(row.timestamp),
@@ -20022,7 +20008,7 @@ var storedMessageNeighbours = /* @__PURE__ */ __name((messages) => ({
20022
20008
  }
20023
20009
  }), "storedMessageNeighbours");
20024
20010
  var wordsOf = /* @__PURE__ */ __name((text2) => (text2.match(/[\p{L}\p{N}\p{M}]+/gu) ?? []).map(fold), "wordsOf");
20025
- var documentMatches = /* @__PURE__ */ __name((text2, queries, window3) => {
20011
+ var documentMatches = /* @__PURE__ */ __name((text2, queries, window2) => {
20026
20012
  const paragraphs = text2.split(/\n\s*\n/).map((part) => part.replace(/\s+/g, " ").trim()).filter(Boolean);
20027
20013
  const query = queries.join(" ");
20028
20014
  const words3 = new Set(wordsOf(query));
@@ -20030,15 +20016,15 @@ var documentMatches = /* @__PURE__ */ __name((text2, queries, window3) => {
20030
20016
  const hit = matching2[0];
20031
20017
  if (hit === void 0 || paragraphs.length < 2)
20032
20018
  return { around: [], moreMatches: 0 };
20033
- const from = Math.max(0, hit - window3.before);
20034
- const around = paragraphs.slice(from, hit + window3.after + 1).map((part, index) => ({
20019
+ const from = Math.max(0, hit - window2.before);
20020
+ const around = paragraphs.slice(from, hit + window2.after + 1).map((part, index) => ({
20035
20021
  text: excerpt(part, query, 200, { literal: true }),
20036
20022
  found: from + index === hit
20037
20023
  }));
20038
20024
  return { around, moreMatches: matching2.length - 1 };
20039
20025
  }, "documentMatches");
20040
- var attachNeighbours = /* @__PURE__ */ __name(async (items, reader, window3, budget, known2, signal) => {
20041
- if (!reader || window3.before + window3.after === 0)
20026
+ var attachNeighbours = /* @__PURE__ */ __name(async (items, reader, window2, budget, known2, signal) => {
20027
+ if (!reader || window2.before + window2.after === 0)
20042
20028
  return;
20043
20029
  for (const item2 of items) {
20044
20030
  if (item2.kind !== "message" && item2.kind !== "mail")
@@ -20050,9 +20036,9 @@ var attachNeighbours = /* @__PURE__ */ __name(async (items, reader, window3, bud
20050
20036
  }
20051
20037
  signal?.throwIfAborted();
20052
20038
  try {
20053
- const rows = await reader.around(item2.ref, window3);
20039
+ const rows = await reader.around(item2.ref, window2);
20054
20040
  const around = [];
20055
- for (const row of rows.slice(0, window3.before + window3.after)) {
20041
+ for (const row of rows.slice(0, window2.before + window2.after)) {
20056
20042
  const text2 = excerpt(row.text, "", 200);
20057
20043
  const bytes2 = Buffer.byteLength(text2);
20058
20044
  if (bytes2 > budget.remaining()) {
@@ -20075,10 +20061,10 @@ var attachNeighbours = /* @__PURE__ */ __name(async (items, reader, window3, bud
20075
20061
  var storedNeighbours = /* @__PURE__ */ __name((store) => {
20076
20062
  const messages = storedMessageNeighbours(store.messages);
20077
20063
  return {
20078
- async around(ref, window3) {
20064
+ async around(ref, window2) {
20079
20065
  const at = parseLocator(ref);
20080
20066
  if (at.provider !== "email")
20081
- return messages.around(ref, window3);
20067
+ return messages.around(ref, window2);
20082
20068
  const account = await store.accounts.storedAccount({ provider: at.provider, account: at.account });
20083
20069
  const email = await store.mail.email(account.id, at.message);
20084
20070
  if (!email)
@@ -20089,8 +20075,8 @@ var storedNeighbours = /* @__PURE__ */ __name((store) => {
20089
20075
  if (index < 0)
20090
20076
  return [];
20091
20077
  return [
20092
- ...emails.slice(Math.max(0, index - window3.before), index),
20093
- ...emails.slice(index + 1, index + 1 + window3.after)
20078
+ ...emails.slice(Math.max(0, index - window2.before), index),
20079
+ ...emails.slice(index + 1, index + 1 + window2.after)
20094
20080
  ].map((one) => ({
20095
20081
  ref: formatLocator({ ...at, message: one.externalId }),
20096
20082
  at: one.sentAt ?? one.receivedAt ?? 0,
@@ -20101,7 +20087,7 @@ var storedNeighbours = /* @__PURE__ */ __name((store) => {
20101
20087
  };
20102
20088
  }, "storedNeighbours");
20103
20089
 
20104
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/project-gathering-request.js
20090
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/project-gathering-request.js
20105
20091
  import { createHash as createHash2 } from "node:crypto";
20106
20092
  var DAY = 864e5;
20107
20093
  var MAX_TIME = 864e13;
@@ -20301,7 +20287,7 @@ var projectGatheringRequest = /* @__PURE__ */ __name((input, now) => {
20301
20287
  fail("an explicit window needs after; before defaults to asOf", "after");
20302
20288
  const asOf = input.asOf === void 0 ? null : whole(input.asOf, "asOf", 1, MAX_TIME);
20303
20289
  const lookbackDays = explicit ? null : whole(input.lookbackDays ?? 60, "lookbackDays", 1, LIMITS.lookbackDays);
20304
- const window3 = explicit ? (() => {
20290
+ const window2 = explicit ? (() => {
20305
20291
  const after = whole(input.after, "after", 0, MAX_TIME);
20306
20292
  const before = whole(input.before ?? asOf ?? now, "before", after + 1, MAX_TIME);
20307
20293
  if (before - after > LIMITS.lookbackDays * DAY)
@@ -20326,7 +20312,7 @@ var projectGatheringRequest = /* @__PURE__ */ __name((input, now) => {
20326
20312
  sources.map(contextSourceKey),
20327
20313
  input.scope,
20328
20314
  lookbackDays,
20329
- explicit ? [window3.after, input.before ?? null] : null,
20315
+ explicit ? [window2.after, input.before ?? null] : null,
20330
20316
  asOf,
20331
20317
  fetch2
20332
20318
  ])).digest("hex");
@@ -20344,7 +20330,7 @@ var projectGatheringRequest = /* @__PURE__ */ __name((input, now) => {
20344
20330
  linkedKey,
20345
20331
  scope: input.scope,
20346
20332
  lookbackDays,
20347
- window: window3,
20333
+ window: window2,
20348
20334
  fetch: fetch2,
20349
20335
  index,
20350
20336
  around,
@@ -20361,8 +20347,8 @@ var contextChunks = /* @__PURE__ */ __name((after, before) => {
20361
20347
  chunks.push({ after: Math.max(after, end - CONTEXT_CHUNK_DAYS * DAY), before: end });
20362
20348
  return chunks;
20363
20349
  }, "contextChunks");
20364
- var projectUnits = /* @__PURE__ */ __name((plan, window3) => {
20365
- const chunks = contextChunks(window3.after, window3.before);
20350
+ var projectUnits = /* @__PURE__ */ __name((plan, window2) => {
20351
+ const chunks = contextChunks(window2.after, window2.before);
20366
20352
  const literal = chunks.flatMap((chunk) => plan.lanes.filter((lane) => lane.query !== null).flatMap((lane) => plan.sources.map((source, sourceIndex) => ({
20367
20353
  lane,
20368
20354
  source,
@@ -20417,7 +20403,7 @@ var decodeCheckpoint = /* @__PURE__ */ __name((text2, plan) => {
20417
20403
  return value;
20418
20404
  }, "decodeCheckpoint");
20419
20405
 
20420
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/project-gathering.js
20406
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/project-gathering.js
20421
20407
  var terminal = /* @__PURE__ */ new Set(["done", "unavailable", "failed"]);
20422
20408
  var PAGE = 20;
20423
20409
  var PEOPLE = 20;
@@ -20432,14 +20418,14 @@ var heldForWindow = /* @__PURE__ */ __name((row, after) => {
20432
20418
  const oldest = row.held.oldestAt === null ? Number.NaN : Date.parse(row.held.oldestAt);
20433
20419
  return upToDate === true && !gaps && oldest <= after;
20434
20420
  }, "heldForWindow");
20435
- var fetchLinkedChats = /* @__PURE__ */ __name(async (ports, plan, window3, now, signal) => {
20421
+ var fetchLinkedChats = /* @__PURE__ */ __name(async (ports, plan, window2, now, signal) => {
20436
20422
  const wanted = [];
20437
20423
  for (const linked of plan.linkedChats) {
20438
20424
  if (linked.source === null)
20439
20425
  continue;
20440
20426
  const account = { provider: linked.provider, account: linked.account };
20441
20427
  const [row] = await ports.coverage(account, [linked.chat]);
20442
- if (!heldForWindow(row, window3.after))
20428
+ if (!heldForWindow(row, window2.after))
20443
20429
  wanted.push({ ...linked, account });
20444
20430
  }
20445
20431
  const deadline = now() + plan.budgets.maxFetchMs;
@@ -20459,8 +20445,8 @@ var fetchLinkedChats = /* @__PURE__ */ __name(async (ports, plan, window3, now,
20459
20445
  const answer = await ports.fetcher.fetch({
20460
20446
  account: linked.account,
20461
20447
  chatId: linked.chat,
20462
- after: window3.after,
20463
- before: window3.before,
20448
+ after: window2.after,
20449
+ before: window2.before,
20464
20450
  until: deadline,
20465
20451
  signal: signal ? AbortSignal.any([signal, budget.signal]) : budget.signal,
20466
20452
  ...onProgress ? { onProgress: /* @__PURE__ */ __name((progress) => onProgress({ ...progress, chat: linked.ref, index, of: wanted.length }), "onProgress") } : {}
@@ -20498,8 +20484,8 @@ var gatherProjectEvidence = /* @__PURE__ */ __name(async (ports, request) => {
20498
20484
  const started = now();
20499
20485
  const plan = projectGatheringRequest(request, started);
20500
20486
  const previous = plan.checkpoint === void 0 ? null : decodeCheckpoint(plan.checkpoint, plan);
20501
- const window3 = previous ?? plan.window;
20502
- const units2 = projectUnits(plan, window3);
20487
+ const window2 = previous ?? plan.window;
20488
+ const units2 = projectUnits(plan, window2);
20503
20489
  if (request.budgets?.maxReads === void 0)
20504
20490
  plan.budgets.maxReads = Math.min(512, Math.max(48, units2.length));
20505
20491
  if (previous && previous.units.length !== units2.length)
@@ -20514,7 +20500,7 @@ var gatherProjectEvidence = /* @__PURE__ */ __name(async (ports, request) => {
20514
20500
  param: "fetch"
20515
20501
  });
20516
20502
  if (plan.fetch === "before-read" && ports.fetcher && ports.coverage && previous === null)
20517
- fetched = await fetchLinkedChats(ports, plan, window3, now, signal);
20503
+ fetched = await fetchLinkedChats(ports, plan, window2, now, signal);
20518
20504
  const readFrom = now();
20519
20505
  const indexed = { state: "as-is", mail: 0, documents: 0, code: null };
20520
20506
  const kinds = [...new Set(plan.sources.map((source) => source.kind))].filter((kind) => kind !== "message");
@@ -20727,9 +20713,9 @@ var gatherProjectEvidence = /* @__PURE__ */ __name(async (ports, request) => {
20727
20713
  version: 1,
20728
20714
  runKey: plan.runKey,
20729
20715
  fingerprint: plan.fingerprint,
20730
- after: window3.after,
20731
- before: window3.before,
20732
- asOf: window3.asOf,
20716
+ after: window2.after,
20717
+ before: window2.before,
20718
+ asOf: window2.asOf,
20733
20719
  fetched,
20734
20720
  units: progress.map((u) => u.state === "read-limited" ? { ...u, state: "partial" } : u),
20735
20721
  ...plan.linkedKey === void 0 ? {} : { linkedChats: plan.linkedKey },
@@ -20764,9 +20750,9 @@ var gatherProjectEvidence = /* @__PURE__ */ __name(async (ports, request) => {
20764
20750
  resumed: previous !== null,
20765
20751
  project: plan.project,
20766
20752
  window: {
20767
- after: window3.after,
20768
- before: window3.before,
20769
- asOf: window3.asOf,
20753
+ after: window2.after,
20754
+ before: window2.before,
20755
+ asOf: window2.asOf,
20770
20756
  lookbackDays: plan.lookbackDays,
20771
20757
  basis: plan.lookbackDays === null ? "explicit" : "lookback",
20772
20758
  timeBasis: "per-item-time-kind"
@@ -20821,7 +20807,7 @@ var peopleOf = /* @__PURE__ */ __name((items, senderOf) => {
20821
20807
  return [...byKey.values()].sort((a, b) => b.items - a.items || a.name.localeCompare(b.name));
20822
20808
  }, "peopleOf");
20823
20809
 
20824
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidate-matching.js
20810
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidate-matching.js
20825
20811
  var normalizedText = /* @__PURE__ */ __name((text2) => text2.normalize("NFKC").toLowerCase().replace(/\s+/gu, " "), "normalizedText");
20826
20812
  var termsOf = /* @__PURE__ */ __name((entry) => [
20827
20813
  { name: entry.name, kind: "canonical" },
@@ -20865,7 +20851,7 @@ var matchVocabularyTerms = /* @__PURE__ */ __name((catalog, texts) => {
20865
20851
  return result.sort((a, b) => Number(a.entry.id) - Number(b.entry.id));
20866
20852
  }, "matchVocabularyTerms");
20867
20853
 
20868
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/project-gathering-mentions.js
20854
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/project-gathering-mentions.js
20869
20855
  var KINDS = ["project", "tag", "topic"];
20870
20856
  var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering, options2 = {}) => {
20871
20857
  if (typeof vocabulary?.vocabulary !== "function")
@@ -20920,7 +20906,7 @@ var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering,
20920
20906
  };
20921
20907
  }, "findEvidenceMentions");
20922
20908
 
20923
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/project-purposes.js
20909
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/project-purposes.js
20924
20910
  var BUILT_IN_PURPOSES = ["work", "sales", "support", "other"];
20925
20911
  var DEFAULT_PURPOSES = ["work"];
20926
20912
  var LINK_PURPOSE = "work";
@@ -20950,12 +20936,12 @@ var purposeList = /* @__PURE__ */ __name((value, previous = []) => [
20950
20936
  ...value.split(",").map((one) => one.trim()).filter(Boolean)
20951
20937
  ], "purposeList");
20952
20938
 
20953
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/stored-project-gathering.js
20939
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/stored-project-gathering.js
20954
20940
  var storedChatCount = /* @__PURE__ */ __name((store) => async (account, chatId, { since, until }) => {
20955
- const window3 = { since: new Date(since).toISOString(), until: new Date(until - 1).toISOString() };
20941
+ const window2 = { since: new Date(since).toISOString(), until: new Date(until - 1).toISOString() };
20956
20942
  const [messages, newest, oldest] = await Promise.all([
20957
- store.messages.countMessages(account, chatId, window3),
20958
- store.messages.messages(account, chatId, { limit: 1, since: window3.since, until: until - 1 }),
20943
+ store.messages.countMessages(account, chatId, window2),
20944
+ store.messages.messages(account, chatId, { limit: 1, since: window2.since, until: until - 1 }),
20959
20945
  store.messages.messages(account, chatId, { limit: 1, after: { time: since - 1 }, until: until - 1 })
20960
20946
  ]);
20961
20947
  return {
@@ -21261,7 +21247,7 @@ var purposeHintOf = /* @__PURE__ */ __name((linked, rows, of) => {
21261
21247
  return { chat: top.ref, relationship: link4.relationship, items, of };
21262
21248
  }, "purposeHintOf");
21263
21249
 
21264
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/people.js
21250
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/people.js
21265
21251
  var peopleService = /* @__PURE__ */ __name((deps) => {
21266
21252
  const localCard = /* @__PURE__ */ __name(async (card, includeNotes = false) => {
21267
21253
  const held = await storeIfOpen(deps);
@@ -21462,9 +21448,9 @@ var linkPeople = /* @__PURE__ */ __name(async (store, account, person, other, {
21462
21448
  throw new CliError("validation_error", "an agent proposing a link gives a reason: --reason <why they are one>", {
21463
21449
  reason: "proposal.reason-required"
21464
21450
  });
21465
- const record2 = await store.people.personOf(one);
21466
- if (record2.identities.some(({ provider, id: id2 }) => provider === two.provider && id2 === two.id))
21467
- return record2;
21451
+ const record = await store.people.personOf(one);
21452
+ if (record.identities.some(({ provider, id: id2 }) => provider === two.provider && id2 === two.id))
21453
+ return record;
21468
21454
  const proposed = await store.people.proposeLink({
21469
21455
  identity: two,
21470
21456
  with: one,
@@ -21472,7 +21458,7 @@ var linkPeople = /* @__PURE__ */ __name(async (store, account, person, other, {
21472
21458
  by: { bot: by },
21473
21459
  reason: why
21474
21460
  });
21475
- return { ...record2, proposal: proposed.id };
21461
+ return { ...record, proposal: proposed.id };
21476
21462
  }, "linkPeople");
21477
21463
  var phoneOf = /* @__PURE__ */ __name((typed) => {
21478
21464
  const digits = typed.replace(/[\s()+-]/g, "");
@@ -21526,7 +21512,7 @@ var withoutPhone = /* @__PURE__ */ __name((answer) => {
21526
21512
  return rest;
21527
21513
  }, "withoutPhone");
21528
21514
 
21529
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/task-stats.js
21515
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/task-stats.js
21530
21516
  var TASK_STATS_BY = ["chat", "meeting", "project"];
21531
21517
  var PERIOD_FIELD = "created";
21532
21518
  var refuseNestedPeriod = /* @__PURE__ */ __name((node, top = true) => {
@@ -21657,7 +21643,7 @@ var meetingNames = /* @__PURE__ */ __name(async (store, groups) => {
21657
21643
  }));
21658
21644
  }, "meetingNames");
21659
21645
 
21660
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/task-tag-filters.js
21646
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/task-tag-filters.js
21661
21647
  var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
21662
21648
  const tags = /* @__PURE__ */ new Map();
21663
21649
  for (const node of query ? walkQuery(query.root) : [])
@@ -21666,7 +21652,7 @@ var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
21666
21652
  return tags;
21667
21653
  }, "taskTagFilters");
21668
21654
 
21669
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/tasks.js
21655
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/tasks.js
21670
21656
  var TASK_QUERY = {
21671
21657
  entity: "task",
21672
21658
  backend: "sql",
@@ -21793,8 +21779,8 @@ var taskStateOf = oneOf(TASK_STATES, "task state", "--state");
21793
21779
  var closedStateOf = oneOf(["done", "dismissed"], "way to close a task", "--as");
21794
21780
  var taskLinkKindOf = oneOf(TASK_LINK_OPTION_KINDS, "link kind", "--kind");
21795
21781
  var tasksService = /* @__PURE__ */ __name((deps, categories) => {
21796
- const listOf3 = /* @__PURE__ */ __name(async (store) => categories ?? await store.tasks.categories(), "listOf");
21797
- const categoryOf = /* @__PURE__ */ __name(async (store, name) => taskCategoryOf(await listOf3(store))(name), "categoryOf");
21782
+ const listOf2 = /* @__PURE__ */ __name(async (store) => categories ?? await store.tasks.categories(), "listOf");
21783
+ const categoryOf = /* @__PURE__ */ __name(async (store, name) => taskCategoryOf(await listOf2(store))(name), "categoryOf");
21798
21784
  const inStore = /* @__PURE__ */ __name(async (work) => work(await deps.store(), await deps.account()), "inStore");
21799
21785
  const service = /* @__PURE__ */ __name((store) => createTaskService({ store: store.tasks }), "service");
21800
21786
  const groupOf = /* @__PURE__ */ __name(async (store, account, chat) => chat === void 0 ? void 0 : storedChatId(deps.messenger, chat, store, account, { includeLeft: true }), "groupOf");
@@ -21946,7 +21932,7 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
21946
21932
  kind: type,
21947
21933
  origin,
21948
21934
  ...plan.dueAt ? { dueAt: plan.dueAt } : {},
21949
- category: chosen ?? categorize(await sourceText(), await listOf3(store))
21935
+ category: chosen ?? categorize(await sourceText(), await listOf2(store))
21950
21936
  });
21951
21937
  const task2 = await store.tasks.get(added.id) ?? added;
21952
21938
  if (created && choice.new)
@@ -21959,7 +21945,7 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
21959
21945
  const card = await planOf(store, task2.id, plan, origin);
21960
21946
  return { task: await taskView(store, account, task2), created, ...followed, card };
21961
21947
  }), "add"),
21962
- categories: /* @__PURE__ */ __name(() => inStore(async (store) => listOf3(store)), "categories"),
21948
+ categories: /* @__PURE__ */ __name(() => inStore(async (store) => listOf2(store)), "categories"),
21963
21949
  unlistedCategories: /* @__PURE__ */ __name(() => inStore(async (store) => store.tasks.unlistedCategories()), "unlistedCategories"),
21964
21950
  categoriesFile: /* @__PURE__ */ __name(() => inStore(async (store) => store.tasks.categoriesFile()), "categoriesFile"),
21965
21951
  duplicates: /* @__PURE__ */ __name(({ decision, limit, offset }) => inStore(async (store, account) => store.tasks.pairs(taskAccount(account), { decision, limit, offset })), "duplicates"),
@@ -22166,7 +22152,7 @@ var taskView = /* @__PURE__ */ __name(async (store, account, task2) => {
22166
22152
  };
22167
22153
  }, "taskView");
22168
22154
 
22169
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/cli/messenger/lacks.js
22155
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/cli/messenger/lacks.js
22170
22156
  var COMMAND_NEEDS = {
22171
22157
  "account update": ["updateProfile", "change the profile"],
22172
22158
  "account sessions list": ["sessions", "list the account's sessions"],
@@ -22178,13 +22164,26 @@ var COMMAND_NEEDS = {
22178
22164
  "chats folders create": ["createFolder", "create a folder"],
22179
22165
  "chats folders update": ["updateFolder", "change a folder"],
22180
22166
  "chats folders delete": ["deleteFolder", "delete a folder"],
22167
+ "chats links show": ["group", "read a group"],
22168
+ "chats links reset": ["resetInviteLink", "replace an invite link"],
22169
+ "chats requests list": ["joinRequests", "read join requests"],
22170
+ "chats requests confirm": ["answerJoinRequest", "answer join requests"],
22171
+ "chats requests reject": ["answerJoinRequest", "answer join requests"],
22172
+ "chats admins add": ["addAdmin", "make someone an admin"],
22173
+ "chats admins remove": ["removeAdmin", "take admin rights back"],
22181
22174
  "contacts add": ["addContact", "add a contact"],
22182
22175
  "contacts remove": ["removeContact", "remove a contact"],
22183
22176
  "contacts rename": ["renameContact", "rename a contact"],
22184
22177
  "contacts import": ["importContacts", "import contacts"],
22178
+ "contacts block": ["block", "block a person"],
22179
+ "contacts unblock": ["unblock", "unblock a person"],
22180
+ "messages forward": ["forward", "forward a message"],
22185
22181
  "messages comments": ["comments", "read comments on a channel post"],
22186
22182
  "messages pin": ["pin", "pin a message"],
22187
- "messages unpin": ["unpin", "unpin a message"]
22183
+ "messages unpin": ["unpin", "unpin a message"],
22184
+ "messages scheduled cancel": ["cancelScheduled", "cancel a scheduled message"],
22185
+ "messages scheduled edit": ["editScheduled", "edit a scheduled message"],
22186
+ "messages scheduled send": ["sendScheduled", "send a scheduled message now"]
22188
22187
  };
22189
22188
  var STORE_ANSWERS = /* @__PURE__ */ new Set(["chats events"]);
22190
22189
  var lackedNeed = /* @__PURE__ */ __name((messenger, path) => {
@@ -22210,302 +22209,15 @@ var hideNever = /* @__PURE__ */ __name((messenger, group) => {
22210
22209
  if (need && messenger.never?.includes(need[0]))
22211
22210
  child._hidden = true;
22212
22211
  walk(child, at);
22212
+ if (child.commands.length > 0 && child.commands.every((one) => one._hidden))
22213
+ child._hidden = true;
22213
22214
  }
22214
22215
  }, "walk");
22215
22216
  walk(group, [group.name()]);
22216
22217
  return group;
22217
22218
  }, "hideNever");
22218
22219
 
22219
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/cli/paging.js
22220
- var positiveCount = /* @__PURE__ */ __name((flag) => (value) => {
22221
- if (!/^\d+$/.test(value.trim()) || Number(value) < 1)
22222
- throw new CliError("validation_error", `${flag} takes a whole number from 1 upwards, not "${value}"`);
22223
- return Number(value);
22224
- }, "positiveCount");
22225
- var configuredLimit = /* @__PURE__ */ __name((command, most = Number.POSITIVE_INFINITY) => {
22226
- const { resolveSettings, env } = environmentOf(command);
22227
- const { limit: _typed, ...flags } = command.optsWithGlobals();
22228
- const configured = resolveSettings?.(flags, { needsProfile: false, ...env ? { env } : {} }).limit ?? DEFAULT_CONFIG.defaults.limit;
22229
- return Math.min(configured, most);
22230
- }, "configuredLimit");
22231
- var withPaging = /* @__PURE__ */ __name((command) => command.option("--limit <n>", "how many to show", positiveCount("--limit")).option("--page <n>", "which page, starting at 1", positiveCount("--page")).option("--all", "every row, no paging"), "withPaging");
22232
- var window2 = /* @__PURE__ */ __name(({ limit, page, all }) => all ? { offset: 0 } : { limit, offset: (page - 1) * limit }, "window");
22233
- var pagingOf = /* @__PURE__ */ __name((command) => {
22234
- const environment = environmentOf(command);
22235
- const flags = command.optsWithGlobals();
22236
- if (!environment.resolveSettings)
22237
- return { limit: flags.limit ?? DEFAULT_CONFIG.defaults.limit, page: flags.page ?? 1 };
22238
- const { limit, page } = environment.resolveSettings(withAgentLevels(command, command.optsWithGlobals()), {
22239
- env: environment.env ?? process.env,
22240
- needsProfile: false,
22241
- readOnly: true
22242
- });
22243
- return { limit: limit ?? DEFAULT_CONFIG.defaults.limit, page: page ?? 1 };
22244
- }, "pagingOf");
22245
-
22246
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/cli/messenger/chat-answers.js
22247
- var defined = /* @__PURE__ */ __name((record2) => Object.fromEntries(Object.entries(record2).filter(([, value]) => value !== void 0)), "defined");
22248
- var chatRef = /* @__PURE__ */ __name((account, chat) => formatReference({ type: "chat", provider: account.provider, account: account.account, chat }), "chatRef");
22249
- var settingsOf = /* @__PURE__ */ __name((settings) => defined({
22250
- all_can_pin: settings.allCanPin,
22251
- only_admins_add: settings.onlyAdminsAdd,
22252
- only_admins_call: settings.onlyAdminsCall,
22253
- only_owner_edits_info: settings.onlyOwnerEditsInfo,
22254
- members_see_link: settings.membersSeeLink,
22255
- join_approval: settings.joinApproval,
22256
- only_admins_send: settings.onlyAdminsSend,
22257
- only_admins_edit_info: settings.onlyAdminsEditInfo,
22258
- disappearing_seconds: settings.disappearingSeconds
22259
- }), "settingsOf");
22260
- var chatAnswer = /* @__PURE__ */ __name((account, chat) => defined({
22261
- ref: chatRef(account, chat.id),
22262
- id: chat.id,
22263
- title: chat.title,
22264
- kind: chat.kind,
22265
- unread_count: chat.unreadCount,
22266
- unread_mentions: chat.unreadMentions,
22267
- last_message_at: chat.lastMessageAt,
22268
- participants_count: chat.participantsCount,
22269
- muted: chat.muted,
22270
- muted_until: chat.mutedUntil ?? void 0,
22271
- archived: chat.archived,
22272
- marked_unread: chat.markedUnread,
22273
- membership_state: chat.membershipState,
22274
- parent_chat_id: chat.parentChatId ?? void 0,
22275
- scope: chat.scope,
22276
- provider_metadata: chat.providerMetadata,
22277
- description: chat.description,
22278
- invite_link: chat.link,
22279
- settings: chat.settings ? settingsOf(chat.settings) : void 0,
22280
- members: chat.members?.map(memberAnswer)
22281
- }), "chatAnswer");
22282
- var memberAnswer = /* @__PURE__ */ __name((member) => {
22283
- const group = member;
22284
- return defined({
22285
- id: member.id,
22286
- name: member.name,
22287
- username: member.username,
22288
- role: group.role,
22289
- last_seen_at: group.lastSeenAt,
22290
- registered_at: group.registeredAt,
22291
- joined_at: group.joinedAt,
22292
- invited_by: group.invitedBy,
22293
- is_bot: group.isBot,
22294
- deleted: group.deleted,
22295
- flagged: group.flagged,
22296
- has_photo: group.hasPhoto,
22297
- score: group.score,
22298
- reasons: group.reasons,
22299
- check: group.check ? snakeKeys(group.check) : void 0
22300
- });
22301
- }, "memberAnswer");
22302
- var contactRef = /* @__PURE__ */ __name((provider, id2) => formatReference({ type: "contact", provider, id: id2 }), "contactRef");
22303
- var contactAnswer = /* @__PURE__ */ __name((account, contact) => {
22304
- const card = contact;
22305
- return defined({
22306
- ref: contactRef(account.provider, contact.id),
22307
- id: contact.id,
22308
- name: contact.name,
22309
- username: contact.username,
22310
- alias: contact.alias,
22311
- display_name: contact.displayName,
22312
- description: contact.description,
22313
- last_messaged_at: contact.lastMessagedAt,
22314
- chats: card.chats?.map((chat) => ({
22315
- ref: chatRef(account, chat.id),
22316
- id: chat.id,
22317
- title: chat.title,
22318
- kind: chat.kind,
22319
- last_message_at: chat.lastMessageAt
22320
- })),
22321
- notes: card.notes?.map(({ id: id2, text: text2, revision, createdAt, updatedAt }) => ({
22322
- id: id2,
22323
- text: text2,
22324
- revision,
22325
- created_at: createdAt,
22326
- updated_at: updatedAt
22327
- }))
22328
- });
22329
- }, "contactAnswer");
22330
- var contactShown = /* @__PURE__ */ __name((account, card, profile) => {
22331
- const { id: _id, name: _name, bio, chats, ...facts } = profile;
22332
- const listed2 = new Map(card.chats.map((chat) => [chat.id, chat]));
22333
- const active = new Set(chats.map(({ id: id2 }) => id2));
22334
- const shared2 = [
22335
- ...chats.map((chat) => ({
22336
- ref: chatRef(account, chat.id),
22337
- id: chat.id,
22338
- title: chat.title,
22339
- kind: chat.kind,
22340
- last_message_at: listed2.get(chat.id)?.lastMessageAt ?? chat.lastAt,
22341
- their_messages: chat.theirMessages,
22342
- first_at: chat.firstAt,
22343
- last_at: chat.lastAt,
22344
- complete: chat.complete
22345
- })),
22346
- ...card.chats.filter(({ id: id2 }) => !active.has(id2)).map((chat) => ({
22347
- ref: chatRef(account, chat.id),
22348
- id: chat.id,
22349
- title: chat.title,
22350
- kind: chat.kind,
22351
- last_message_at: chat.lastMessageAt
22352
- }))
22353
- ];
22354
- const answer = contactAnswer(account, card);
22355
- return {
22356
- ...answer,
22357
- ...snakeKeys(facts),
22358
- description: answer.description ?? bio,
22359
- chats: shared2
22360
- };
22361
- }, "contactShown");
22362
- var chatEventAnswer = /* @__PURE__ */ __name((chatId, event2) => defined({
22363
- chat_id: chatId,
22364
- time: event2.timestamp,
22365
- type: event2.event,
22366
- message_id: event2.messageId,
22367
- by: event2.by,
22368
- people: event2.people,
22369
- title: event2.title
22370
- }), "chatEventAnswer");
22371
- var HISTORY_TYPES = { joined: "join", left: "leave", changed: "profile" };
22372
- var memberEventAnswer = /* @__PURE__ */ __name((chatId, event2) => defined({
22373
- chat_id: chatId,
22374
- time: event2.at,
22375
- type: HISTORY_TYPES[event2.event],
22376
- by: event2.invitedBy === void 0 ? void 0 : { id: event2.invitedBy, name: null },
22377
- people: [{ id: event2.id, name: event2.name, username: event2.username }],
22378
- before: event2.before ? { name: event2.before.name, username: event2.before.username } : void 0
22379
- }), "memberEventAnswer");
22380
- var inviteLinkAnswer = /* @__PURE__ */ __name((link4) => defined({
22381
- link: link4.link,
22382
- approval: link4.approval,
22383
- expires_at: link4.expiresAt,
22384
- max_uses: link4.maxUses,
22385
- primary: link4.primary,
22386
- revoked: link4.revoked,
22387
- pending_count: link4.pending,
22388
- joined_count: link4.joined
22389
- }), "inviteLinkAnswer");
22390
- var joinRequestAnswer = /* @__PURE__ */ __name((request) => defined({
22391
- person_id: request.person.id,
22392
- name: request.person.name,
22393
- username: request.person.username,
22394
- requested_at: request.requestedAt,
22395
- about: request.about
22396
- }), "joinRequestAnswer");
22397
- var pollVoteAnswer = /* @__PURE__ */ __name((vote) => ({
22398
- person_id: vote.person.id,
22399
- name: vote.person.name,
22400
- username: vote.person.username,
22401
- answers: vote.answers,
22402
- voted_at: vote.votedAt
22403
- }), "pollVoteAnswer");
22404
- var reactorAnswer = /* @__PURE__ */ __name((reactor) => ({
22405
- person: { id: reactor.person.id, name: reactor.person.name, username: reactor.person.username },
22406
- reaction: reactor.reaction,
22407
- reacted_at: reactor.reactedAt
22408
- }), "reactorAnswer");
22409
- var topicAnswer = /* @__PURE__ */ __name((topic) => defined({
22410
- id: topic.id,
22411
- title: topic.title,
22412
- closed: topic.closed,
22413
- pinned: topic.pinned,
22414
- hidden: topic.hidden,
22415
- unread_count: topic.unreadCount,
22416
- last_message_at: topic.lastMessageAt,
22417
- created_at: topic.createdAt,
22418
- untrusted: ["title"]
22419
- }), "topicAnswer");
22420
- var folderAnswer = /* @__PURE__ */ __name((folder) => {
22421
- const shown = "chats" in folder ? folder : void 0;
22422
- const listed2 = shown ? void 0 : folder;
22423
- return defined({
22424
- id: folder.id,
22425
- title: folder.title,
22426
- chat_ids: listed2 ? listed2.chatIds : shown?.chats.map((chat) => chat.id) ?? [],
22427
- emoji: folder.emoji,
22428
- include: folder.include,
22429
- skip: folder.skip,
22430
- excluded_chat_ids: listed2?.excludedChatIds ?? shown?.excluded.map((chat) => chat.id),
22431
- pinned_chat_ids: listed2?.pinnedChatIds ?? shown?.pinned.map((chat) => chat.id),
22432
- chats: shown?.chats,
22433
- pinned_chats: shown?.pinned,
22434
- excluded_chats: shown?.excluded
22435
- });
22436
- }, "folderAnswer");
22437
- var lines = /* @__PURE__ */ __name((line3) => (body) => (body.items ?? (body.item === void 0 ? [] : [body.item])).map((item2) => `${line3(item2).trimEnd()}
22438
- `).join(""), "lines");
22439
- var pageOf = /* @__PURE__ */ __name(({ limit, page, all }, { items, hasMore }) => all ? { limit: Math.max(1, items.length), has_more: false, page: 1 } : { limit, has_more: hasMore, page }, "pageOf");
22440
- var wholeList = /* @__PURE__ */ __name((command, items, extra = {}) => listOf(command, { items, limit: Math.max(1, items.length), has_more: false, ...extra }), "wholeList");
22441
- var chatShown = /* @__PURE__ */ __name((account, card) => {
22442
- const listed2 = card.members?.length;
22443
- const short = listed2 !== void 0 && card.participantsCount !== null && listed2 < card.participantsCount;
22444
- return itemOf(chatAnswer(account, card), short ? {
22445
- missing: [
22446
- {
22447
- field: "members",
22448
- why: `${listed2} listed; the chat reports ${card.participantsCount} \u2014 the list may omit your account or be partial`,
22449
- step: "chats.members"
22450
- }
22451
- ],
22452
- next: [nextStep("chats.members", { args: { chat: card.id } })]
22453
- } : {});
22454
- }, "chatShown");
22455
- var scoreFloor = /* @__PURE__ */ __name((ast) => {
22456
- const term = nativeTerms(ast, "chats members check").get("score");
22457
- if (!term)
22458
- return AUDIT_MIN_SCORE;
22459
- const upper = term.operator === "range" ? term.upper ?? "*" : term.value;
22460
- if (term.operator !== "range" || upper !== "*")
22461
- queryError("query.unsupported-operator", term.span, "score takes a lower bound: score>=3", {
22462
- command: "chats members check",
22463
- guide: LIST_QUERY_GUIDE
22464
- });
22465
- const floor = Number(term.value);
22466
- return Math.ceil(term.lower_inclusive === false ? floor + 1 : floor);
22467
- }, "scoreFloor");
22468
- var auditAnswer = /* @__PURE__ */ __name((audit) => wholeList("chats members check", audit.items.map(memberAnswer), {
22469
- ...audit.more ? { meta: { truncated: true } } : {},
22470
- ...audit.completeness && audit.completeness.state !== "complete" ? {
22471
- missing: [
22472
- {
22473
- field: "reasons",
22474
- why: "never_wrote counts only stored messages, and the store does not hold the chat whole",
22475
- ...audit.fetch ? { step: "messages.sync" } : {}
22476
- }
22477
- ],
22478
- ...audit.fetch ? { next: [nextStep("messages.sync", { args: { chat: audit.chatId } })] } : {}
22479
- } : {}
22480
- }), "auditAnswer");
22481
- var renderItem = /* @__PURE__ */ __name((command, output, value, next = []) => renderAnswer(command, output, itemOf(snakeKeys(value), { next })), "renderItem");
22482
- var withPage = /* @__PURE__ */ __name((command) => command.option("--limit <n>", "how many to show", positiveCount("--limit")).option("--page <n>", "which page, starting at 1", positiveCount("--page")), "withPage");
22483
- var documentLinkAnswer = /* @__PURE__ */ __name(({ url, documentId, title, inStore, locator, sentAt, sender }) => ({
22484
- url,
22485
- document_id: documentId,
22486
- title,
22487
- in_store: inStore,
22488
- ref: locator,
22489
- sent_at: sentAt,
22490
- sender
22491
- }), "documentLinkAnswer");
22492
- var accountAnswer = /* @__PURE__ */ __name((provider, { id: id2, name, username, phone }) => ({
22493
- provider,
22494
- id: id2,
22495
- name,
22496
- username,
22497
- ...phone === void 0 ? {} : { phone }
22498
- }), "accountAnswer");
22499
- var sessionAnswer = /* @__PURE__ */ __name(({ current, client, device, location, lastActiveAt, createdAt }) => ({
22500
- current,
22501
- client,
22502
- device,
22503
- location,
22504
- last_active_at: lastActiveAt,
22505
- ...createdAt === void 0 ? {} : { created_at: createdAt }
22506
- }), "sessionAnswer");
22507
-
22508
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/context/communication-selection.js
22220
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/context/communication-selection.js
22509
22221
  var communicationFields = {
22510
22222
  sources: pipe(array(strictObject({
22511
22223
  id: pipe(string(), regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)),
@@ -22537,7 +22249,7 @@ var communicationRequest = /* @__PURE__ */ __name((value, preparationAfter) => {
22537
22249
  return { ...input, after, before };
22538
22250
  }, "communicationRequest");
22539
22251
 
22540
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/mail/owed.js
22252
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/mail/owed.js
22541
22253
  var mailTurn = /* @__PURE__ */ __name((newest) => {
22542
22254
  if (newest === null)
22543
22255
  return null;
@@ -22546,7 +22258,7 @@ var mailTurn = /* @__PURE__ */ __name((newest) => {
22546
22258
  return newest.addressed ? "owed" : null;
22547
22259
  }, "mailTurn");
22548
22260
 
22549
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/agenda-mail.js
22261
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/agenda-mail.js
22550
22262
  var absent = /* @__PURE__ */ __name((error) => {
22551
22263
  if (error instanceof CliError && error.code === "not_found")
22552
22264
  return void 0;
@@ -22559,7 +22271,7 @@ var mailActivity = /* @__PURE__ */ __name(async (store, account, since, chats) =
22559
22271
  const where = chats ? queryFilter(chats, MAIL_AGENDA_COLUMNS, { command: "tasks agenda", zone: timezoneOf() }) : void 0;
22560
22272
  const threads = await store.mail.threadActivity(stored.id, since, where);
22561
22273
  const synced = await store.sync.syncState(account, "mail_coverage");
22562
- const window3 = (() => {
22274
+ const window2 = (() => {
22563
22275
  try {
22564
22276
  return JSON.parse(synced?.value ?? "{}");
22565
22277
  } catch {
@@ -22581,7 +22293,7 @@ var mailActivity = /* @__PURE__ */ __name(async (store, account, since, chats) =
22581
22293
  coverage: /* @__PURE__ */ __name((ids) => ids.map((chatId) => {
22582
22294
  const thread = byId2.get(chatId);
22583
22295
  const newest = thread?.newest?.at ?? thread?.lastEmailAt;
22584
- const until = window3.until === void 0 ? Number.NaN : Date.parse(window3.until);
22296
+ const until = window2.until === void 0 ? Number.NaN : Date.parse(window2.until);
22585
22297
  return {
22586
22298
  chatId,
22587
22299
  title: thread?.subject ?? null,
@@ -22589,7 +22301,7 @@ var mailActivity = /* @__PURE__ */ __name(async (store, account, since, chats) =
22589
22301
  chatId,
22590
22302
  // Sync holds a window of the mailbox, never a thread's whole history.
22591
22303
  state: synced ? "partial" : "unknown",
22592
- upToDate: window3.state === "window" && newest !== void 0 && !Number.isNaN(until) ? newest <= until : null,
22304
+ upToDate: window2.state === "window" && newest !== void 0 && !Number.isNaN(until) ? newest <= until : null,
22593
22305
  gaps: false,
22594
22306
  reachesStart: false,
22595
22307
  fetchedAt: synced?.at ?? null
@@ -22604,7 +22316,7 @@ var mailActivity = /* @__PURE__ */ __name(async (store, account, since, chats) =
22604
22316
  };
22605
22317
  }, "mailActivity");
22606
22318
 
22607
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/agenda.js
22319
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/agenda.js
22608
22320
  var DAY2 = 864e5;
22609
22321
  var AGENDA_DEFAULTS = { unanswered: DAY2, waiting: 7 * DAY2 };
22610
22322
  var CLAIMS = ["none", "mine", "others", "any"];
@@ -22858,7 +22570,7 @@ var agendaItem = /* @__PURE__ */ __name((shown) => {
22858
22570
  };
22859
22571
  }, "agendaItem");
22860
22572
 
22861
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/model-downloads.js
22573
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/model-downloads.js
22862
22574
  import { writeFileSync } from "node:fs";
22863
22575
  import { join } from "node:path";
22864
22576
  var bytesOf = /* @__PURE__ */ __name((model) => model.files.reduce((sum2, file) => sum2 + file.bytes, 0), "bytesOf");
@@ -22883,7 +22595,7 @@ var downloadTextModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
22883
22595
  `);
22884
22596
  await nativeRuntime({ env, progress });
22885
22597
  progress(`${model.id}: loading it once to check it works`);
22886
- const { openEmbedder: openEmbedder2 } = await import("./embed-BNOTNXMA.js");
22598
+ const { openEmbedder: openEmbedder2 } = await import("./embed-O7KMDYM7.js");
22887
22599
  const embedder = await openEmbedder2(model, directory2);
22888
22600
  try {
22889
22601
  const [vector] = await embedder.embed(["check"], "query");
@@ -22904,7 +22616,7 @@ var downloadRerankModel = /* @__PURE__ */ __name(async (id2, { env, progress = /
22904
22616
  }
22905
22617
  await nativeRuntime({ env, progress });
22906
22618
  progress(`${model.id}: loading it once to check it works`);
22907
- const { openReranker } = await import("./rerank-LJ3TWRNV.js");
22619
+ const { openReranker } = await import("./rerank-F4KZQTY6.js");
22908
22620
  const reranker = await openReranker(model, directory2);
22909
22621
  try {
22910
22622
  await reranker.score("check", ["check"]);
@@ -22922,7 +22634,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
22922
22634
  await installFiles(placedImage(model, directory2), { progress, ...bytes2 ? { bytes: bytes2 } : {} });
22923
22635
  }
22924
22636
  progress(`${model.id}: loading it once to check it works`);
22925
- const { openPictureEmbedder } = await import("./embedder-BCUT7KKV.js");
22637
+ const { openPictureEmbedder } = await import("./embedder-4PE67CLX.js");
22926
22638
  const embedder = await openPictureEmbedder(model, directory2);
22927
22639
  try {
22928
22640
  const vector = await embedder.embedQuery("check");
@@ -22934,7 +22646,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
22934
22646
  return { model, directory: directory2 };
22935
22647
  }, "downloadImageModel");
22936
22648
 
22937
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/rankings-selection.js
22649
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/rankings-selection.js
22938
22650
  var RANKING_SELECTION_BYTES = 64 * 1024;
22939
22651
  var object2 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0, "object");
22940
22652
  function invalid(message = "ranking selection is invalid \u2014 obtain a new drilldown from stats top") {
@@ -23103,7 +22815,7 @@ var readRankingSelection = /* @__PURE__ */ __name(async (store, input) => {
23103
22815
  };
23104
22816
  }, "readRankingSelection");
23105
22817
 
23106
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/mail-search.js
22818
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/mail-search.js
23107
22819
  var THREADS_PAGE = 500;
23108
22820
  var threadsOf = /* @__PURE__ */ __name(async (store, key) => {
23109
22821
  const account = await store.accounts.storedAccount(key).catch(() => void 0);
@@ -23127,9 +22839,9 @@ var threadsOf = /* @__PURE__ */ __name(async (store, key) => {
23127
22839
  var withMailThreads = /* @__PURE__ */ __name((store) => {
23128
22840
  const chats = {
23129
22841
  ...store.chats,
23130
- chats: /* @__PURE__ */ __name(async (account, window3) => {
23131
- const held = await store.chats.chats(account, window3);
23132
- if (window3.limit !== void 0 || window3.offset !== void 0)
22842
+ chats: /* @__PURE__ */ __name(async (account, window2) => {
22843
+ const held = await store.chats.chats(account, window2);
22844
+ if (window2.limit !== void 0 || window2.offset !== void 0)
23133
22845
  return held;
23134
22846
  const known2 = new Set(held.items.map(({ id: id2 }) => id2));
23135
22847
  const threads = (await threadsOf(store, account)).filter(({ id: id2 }) => !known2.has(id2));
@@ -23178,7 +22890,7 @@ var readMail = /* @__PURE__ */ __name(async (store, locator, { before = 0, after
23178
22890
  return thread.slice(Math.max(0, at - before), at + after + 1).map((hit) => hit.id === message ? { ...hit, anchor: true } : hit);
23179
22891
  }, "readMail");
23180
22892
 
23181
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/messages-search.js
22893
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/messages-search.js
23182
22894
  var PERSON_FIELDS = /* @__PURE__ */ new Set(["from", "to", "cc", "bcc"]);
23183
22895
  var MAIL_FIELDS = /* @__PURE__ */ new Set(["to", "cc", "bcc", "subject", "mailbox", "label", "is", "list"]);
23184
22896
  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");
@@ -23551,7 +23263,7 @@ var statsLucene = /* @__PURE__ */ __name(async (store, account, request, messeng
23551
23263
  };
23552
23264
  }, "statsLucene");
23553
23265
 
23554
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/search-record.js
23266
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/search-record.js
23555
23267
  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");
23556
23268
  var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
23557
23269
  command,
@@ -23561,7 +23273,7 @@ var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
23561
23273
  fieldsVersion: FIELD_VERSION
23562
23274
  }), "searchRecordOf");
23563
23275
 
23564
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/admin-statistics.js
23276
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/admin-statistics.js
23565
23277
  function invalid2(message) {
23566
23278
  throw new CliError("validation_error", message);
23567
23279
  }
@@ -23745,7 +23457,7 @@ var adminStatisticsService = /* @__PURE__ */ __name((deps) => ({
23745
23457
  }
23746
23458
  if (pinned && (query.source || query.ast || query.exact || query.timezone && query.timezone !== prepared.timezone))
23747
23459
  invalid2("a saved report keeps its resolved query, accounts and timezone");
23748
- const window3 = dateWindow({
23460
+ const window2 = dateWindow({
23749
23461
  ...query.sinceTime ? { sinceTime: query.sinceTime } : {},
23750
23462
  ...query.untilTime ? { untilTime: query.untilTime } : {},
23751
23463
  zone: prepared.timezone,
@@ -23756,8 +23468,8 @@ var adminStatisticsService = /* @__PURE__ */ __name((deps) => ({
23756
23468
  cutoff,
23757
23469
  olderThan: query.olderThan === void 0 && pinned ? pinned.options.olderThan : duration(query.olderThan ?? "24h", "older_than"),
23758
23470
  within: query.within === void 0 && pinned ? pinned.options.within : duration(query.within ?? "7d", "--within"),
23759
- joinSince: window3.since ?? pinned?.options.joinSince ?? cutoff - 30 * 864e5,
23760
- joinUntil: window3.until ?? pinned?.options.joinUntil ?? cutoff,
23471
+ joinSince: window2.since ?? pinned?.options.joinSince ?? cutoff - 30 * 864e5,
23472
+ joinUntil: window2.until ?? pinned?.options.joinUntil ?? cutoff,
23761
23473
  minViews: count(query.minViews ?? pinned?.options.minViews ?? 1, "min_views"),
23762
23474
  maxReplies: count(query.maxReplies ?? pinned?.options.maxReplies ?? 0, "max_replies"),
23763
23475
  answerers: query.answerers === void 0 && pinned ? pinned.options.answerers : await answerers(store, query.answerers ?? [], prepared.execution.accounts)
@@ -23790,7 +23502,7 @@ var adminStatisticsService = /* @__PURE__ */ __name((deps) => ({
23790
23502
  return {
23791
23503
  ...result,
23792
23504
  report,
23793
- timeMeta: window3.meta,
23505
+ timeMeta: window2.meta,
23794
23506
  detectorVersion: 1,
23795
23507
  items: result.items.map((original) => {
23796
23508
  const identityKnown = known2.has(JSON.stringify([original.account.provider, original.account.account, original.id]));
@@ -23855,7 +23567,7 @@ var adminStatisticsService = /* @__PURE__ */ __name((deps) => ({
23855
23567
  }, "evidence")
23856
23568
  }), "adminStatisticsService");
23857
23569
 
23858
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/patience.js
23570
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/patience.js
23859
23571
  import { setTimeout as sleep } from "node:timers/promises";
23860
23572
  var LONGEST_WAIT_MS = 5 * 60 * 1e3;
23861
23573
  var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
@@ -23878,10 +23590,10 @@ var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
23878
23590
  }
23879
23591
  }, "patiently");
23880
23592
 
23881
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/archive.js
23593
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/archive.js
23882
23594
  import { setTimeout as sleep2 } from "node:timers/promises";
23883
23595
 
23884
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/backfill-estimate.js
23596
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/backfill-estimate.js
23885
23597
  var REQUEST_MS = 400;
23886
23598
  var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, maxPages, pauseMs }) => {
23887
23599
  const lowest = ranges[0];
@@ -23904,13 +23616,13 @@ var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, max
23904
23616
  };
23905
23617
  }, "estimateBackfill");
23906
23618
 
23907
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/domain/recovery.js
23619
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/domain/recovery.js
23908
23620
  var withRecovery = /* @__PURE__ */ __name((error) => ({
23909
23621
  ...error,
23910
23622
  retryable: typeof error.retryable === "boolean" ? error.retryable : error.code === "rate_limited" || error.status === 429
23911
23623
  }), "withRecovery");
23912
23624
 
23913
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/batch.js
23625
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/batch.js
23914
23626
  var actionable = /* @__PURE__ */ __name((error) => {
23915
23627
  if (isCliFailure(error))
23916
23628
  return withRecovery({ code: error.code, message: error.message, ...error.details });
@@ -23993,7 +23705,7 @@ var mergeBatches = /* @__PURE__ */ __name((a, b) => {
23993
23705
  };
23994
23706
  }, "mergeBatches");
23995
23707
 
23996
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/images/context/index.js
23708
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/images/context/index.js
23997
23709
  var CONTEXT_MESSAGES2 = 3;
23998
23710
  var CONTEXT_MINUTES = 10;
23999
23711
  var MAX_CHARS = 1200;
@@ -24005,8 +23717,8 @@ var contextText = /* @__PURE__ */ __name(({ chatTitle: chatTitle2, sender, capti
24005
23717
  if (!caption.trim() && earlier.length === 0 && later.length === 0)
24006
23718
  return void 0;
24007
23719
  const own = line({ sender, text: `[photo] ${caption}`, sentAt });
24008
- const lines3 = [...chatTitle2?.trim() ? [chatTitle2.trim()] : [], ...earlier.map(line), own, ...later.map(line)];
24009
- return lines3.join("\n").slice(0, MAX_CHARS);
23720
+ const lines = [...chatTitle2?.trim() ? [chatTitle2.trim()] : [], ...earlier.map(line), own, ...later.map(line)];
23721
+ return lines.join("\n").slice(0, MAX_CHARS);
24010
23722
  }, "contextText");
24011
23723
  var context = {
24012
23724
  id: "context",
@@ -24017,12 +23729,12 @@ var context = {
24017
23729
  }, "describe")
24018
23730
  };
24019
23731
 
24020
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/images/registry.js
23732
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/images/registry.js
24021
23733
  var BUILT_INS = [context];
24022
23734
  var providers = [...BUILT_INS];
24023
23735
  var registeredImageProviders = /* @__PURE__ */ __name(() => providers, "registeredImageProviders");
24024
23736
 
24025
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/conversations.js
23737
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/conversations.js
24026
23738
  var READ_PAGE = 5e3;
24027
23739
  var CHAIN = 50;
24028
23740
  var CONVERSATION_QUERY = {
@@ -24174,7 +23886,7 @@ var sized = /* @__PURE__ */ __name((size2) => {
24174
23886
  return size2;
24175
23887
  }, "sized");
24176
23888
 
24177
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/embeddings-maintenance.js
23889
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/embeddings-maintenance.js
24178
23890
  var REFRESH_BOUNDS = { maxChats: 20, maxChunks: 2e3 };
24179
23891
  var MESSAGE_PAGE = 5e3;
24180
23892
  var PER_SESSION = 8;
@@ -24193,7 +23905,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = chosenTextModel(dep
24193
23905
  price: remote.price,
24194
23906
  installed: true,
24195
23907
  perBatch: PER_REQUEST * concurrency,
24196
- open: /* @__PURE__ */ __name(async () => (await import("./remote-4BTFOLFY.js")).openRemote(remote, apiKey, {
23908
+ open: /* @__PURE__ */ __name(async () => (await import("./remote-L3MNWZQK.js")).openRemote(remote, apiKey, {
24197
23909
  concurrency,
24198
23910
  env: deps.env ?? process.env
24199
23911
  }), "open")
@@ -24213,7 +23925,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = chosenTextModel(dep
24213
23925
  if (!isTextModelInstalled(model, directory2))
24214
23926
  throw notDownloaded(model.id);
24215
23927
  if (apart) {
24216
- const { openProcess } = await import("./process-I2QKOMM7.js");
23928
+ const { openProcess } = await import("./process-MGMXXPMY.js");
24217
23929
  return openProcess(model, directory2, { threads: threads ?? defaultThreads() });
24218
23930
  }
24219
23931
  return openEmbedder(model, directory2, { threads: threads ?? defaultThreads() });
@@ -24260,8 +23972,8 @@ var embeddingsMaintenance = /* @__PURE__ */ __name((deps) => {
24260
23972
  if (batch.length === 0)
24261
23973
  break;
24262
23974
  after = batch.at(-1)?.hash;
24263
- const ready = batch.flatMap(({ hash: hash3, lines: lines3 }) => {
24264
- const text2 = chunkTextOf(lines3);
23975
+ const ready = batch.flatMap(({ hash: hash3, lines }) => {
23976
+ const text2 = chunkTextOf(lines);
24265
23977
  return chunkHash(text2) === hash3 ? [{ hash: hash3, text: text2 }] : [];
24266
23978
  });
24267
23979
  skipped += batch.length - ready.length;
@@ -24502,7 +24214,7 @@ var shaped = /* @__PURE__ */ __name(({ chatId, builtAt, algorithmVersion, pendin
24502
24214
  return { ...one, state };
24503
24215
  }, "shaped");
24504
24216
 
24505
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/search-catchup.js
24217
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/search-catchup.js
24506
24218
  var CATCH_UP_BOUNDS = { maxChunks: 500, maxMessages: 1e4, timeMs: 3e4 };
24507
24219
  var validateCatchUpBounds = /* @__PURE__ */ __name((options2) => {
24508
24220
  for (const [key, value, maximum] of [
@@ -24555,7 +24267,7 @@ var catchUpSearch = /* @__PURE__ */ __name(async (deps, chat, options2, signal,
24555
24267
  }
24556
24268
  }, "catchUpSearch");
24557
24269
 
24558
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/archive.js
24270
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/archive.js
24559
24271
  var pushed = /* @__PURE__ */ __name((deps, what) => {
24560
24272
  if (deps.reads === "store") {
24561
24273
  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`);
@@ -24583,11 +24295,11 @@ var archiveService = /* @__PURE__ */ __name((deps) => {
24583
24295
  left: /* @__PURE__ */ __name(async (options2) => (await deps.store()).chats.leftChats(await deps.account(), options2), "left"),
24584
24296
  export: /* @__PURE__ */ __name(async (chat, { since } = {}) => {
24585
24297
  const { store, account, chatId } = await found(chat);
24586
- const window3 = { limit: Number.MAX_SAFE_INTEGER, ...since === void 0 ? {} : { since } };
24298
+ const window2 = { limit: Number.MAX_SAFE_INTEGER, ...since === void 0 ? {} : { since } };
24587
24299
  return {
24588
24300
  account,
24589
24301
  title: (await store.chats.chatStats(account, chatId))[0]?.title ?? chatId,
24590
- messages: (await store.messages.messages(account, chatId, window3)).items
24302
+ messages: (await store.messages.messages(account, chatId, window2)).items
24591
24303
  };
24592
24304
  }, "export"),
24593
24305
  exportable: /* @__PURE__ */ __name(async ({ chats, kinds }) => {
@@ -24661,14 +24373,16 @@ var archiveService = /* @__PURE__ */ __name((deps) => {
24661
24373
  }
24662
24374
  const windowed = limit?.keepFrom !== void 0 && !(limit.keepFrom <= (options2.sinceMs ?? Number.NEGATIVE_INFINITY));
24663
24375
  const fetched = await fetchInto({
24664
- history: /* @__PURE__ */ __name((window3) => history(chat, { ...window3, reactions: false }), "history"),
24376
+ history: /* @__PURE__ */ __name((window2) => history(chat, { ...window2, reactions: false }), "history"),
24665
24377
  store,
24666
24378
  account,
24667
24379
  fetching: deps.messenger.fetching ?? FETCHING,
24668
24380
  ...options2,
24669
24381
  ...windowed ? { sinceMs: limit.keepFrom } : {}
24670
24382
  });
24671
- const result = windowed && fetched.reachedSince ? { ...fetched, limited: "older_than_window" } : fetched;
24383
+ const replies = fetched.chat && !options2.window ? await savedReplies(connection, store, account, fetched.chat, options2.stop) : 0;
24384
+ const read = replies > 0 ? { ...fetched, fetched: fetched.fetched + replies } : fetched;
24385
+ const result = windowed && read.reachedSince ? { ...read, limited: "older_than_window" } : read;
24672
24386
  if (result.limited && limit?.keepFrom !== void 0)
24673
24387
  await recordSkip(store, account, result.chat ?? limit.chatId, {
24674
24388
  reason: "older_than_window",
@@ -24701,7 +24415,8 @@ var archiveService = /* @__PURE__ */ __name((deps) => {
24701
24415
  const catchingUp = Boolean(options2.catchUp ?? deps.searchCatchUp);
24702
24416
  const upToDate = heldToNewest(await deps.store(), await deps.account(), deps.messenger.fetching ?? FETCHING, {
24703
24417
  ...options2,
24704
- catchUp: catchingUp ? options2.catchUp ?? {} : false
24418
+ catchUp: catchingUp ? options2.catchUp ?? {} : false,
24419
+ threads: connection.threadReplies !== void 0
24705
24420
  });
24706
24421
  const finished = /* @__PURE__ */ __name(() => options2.onChat?.({ chats: chats.length, done: answer.items.length, fetched: answer.fetched }), "finished");
24707
24422
  finished();
@@ -24777,10 +24492,10 @@ var limitOf = /* @__PURE__ */ __name(async (deps, store, account, chat, options2
24777
24492
  const stored = chatId === void 0 ? void 0 : (await store.chats.historyShapes(account, [chatId])).get(chatId);
24778
24493
  if (stored?.included)
24779
24494
  return void 0;
24780
- const window3 = historyWindow(stored ?? options2.shape, deps.historyLimits, Date.now());
24495
+ const window2 = historyWindow(stored ?? options2.shape, deps.historyLimits, Date.now());
24781
24496
  return {
24782
24497
  ...chatId === void 0 ? {} : { chatId },
24783
- ..."skip" in window3 ? { skip: { members: window3.members } } : { keepFrom: window3.keepFrom }
24498
+ ..."skip" in window2 ? { skip: { members: window2.members } } : { keepFrom: window2.keepFrom }
24784
24499
  };
24785
24500
  }, "limitOf");
24786
24501
  var recordSkip = /* @__PURE__ */ __name(async (store, account, chatId, skip) => {
@@ -24803,12 +24518,12 @@ var abortable = /* @__PURE__ */ __name(async (read, signal) => {
24803
24518
  signal.removeEventListener("abort", listener);
24804
24519
  }
24805
24520
  }, "abortable");
24806
- var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetching, limit, pageSize, pauseMs, sinceMs, last, note, stop, onPage, window: window3, onRequest }) => {
24807
- if (window3 && (!Number.isSafeInteger(window3.from) || !Number.isSafeInteger(window3.to + 1) || window3.from > window3.to))
24521
+ var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetching, limit, pageSize, pauseMs, sinceMs, last, note, stop, onPage, window: window2, onRequest }) => {
24522
+ if (window2 && (!Number.isSafeInteger(window2.from) || !Number.isSafeInteger(window2.to + 1) || window2.from > window2.to))
24808
24523
  throw new CliError("validation_error", "invalid history window");
24809
24524
  const byTime = fetching.orderBy === "time";
24810
24525
  const keyed = keyOf(fetching);
24811
- let before = window3 === void 0 ? void 0 : byTime ? new Date(window3.to + (fetching.beforeInclusive ? 0 : 1)).toISOString() : String(window3.to + 1);
24526
+ let before = window2 === void 0 ? void 0 : byTime ? new Date(window2.to + (fetching.beforeInclusive ? 0 : 1)).toISOString() : String(window2.to + 1);
24812
24527
  let requests = 0;
24813
24528
  let windowComplete = false;
24814
24529
  let chatId;
@@ -24827,7 +24542,7 @@ var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetchin
24827
24542
  requests += 1;
24828
24543
  onRequest?.();
24829
24544
  const read = /* @__PURE__ */ __name(() => history({ limit: Math.min(pageSize, limit - fetched), ...before ? { before } : {} }), "read");
24830
- return window3 ? abortable(read, stop) : read();
24545
+ return window2 ? abortable(read, stop) : read();
24831
24546
  }, note, stop);
24832
24547
  } catch (error) {
24833
24548
  if (stop.aborted)
@@ -24841,7 +24556,7 @@ var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetchin
24841
24556
  break;
24842
24557
  const first2 = page.items[0];
24843
24558
  if (!first2) {
24844
- if (window3 === void 0)
24559
+ if (window2 === void 0)
24845
24560
  reachedStart = true;
24846
24561
  break;
24847
24562
  }
@@ -24851,27 +24566,27 @@ var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetchin
24851
24566
  throw new CliError("validation_error", "this messenger's message ids do not order a chat, so it cannot fetch its history");
24852
24567
  }
24853
24568
  const low = Math.min(...keys);
24854
- top ??= window3?.to ?? Math.max(...keys);
24569
+ top ??= window2?.to ?? Math.max(...keys);
24855
24570
  const fresh = page.items.filter((message) => !seen.has(message.id)).length;
24856
24571
  for (const message of page.items)
24857
24572
  seen.add(message.id);
24858
24573
  fetched += fresh;
24859
- const coveredFrom = window3 === void 0 ? low : Math.max(window3.from, low + (byTime && page.hasMore ? 1 : 0));
24574
+ const coveredFrom = window2 === void 0 ? low : Math.max(window2.from, low + (byTime && page.hasMore ? 1 : 0));
24860
24575
  const held = coveredFrom <= top ? await store.sync.markRange(account, chatId, coveredFrom, top) : { from: low, to: top };
24861
- if (window3 !== void 0 && (low < window3.from || !byTime && low === window3.from)) {
24862
- await store.sync.markRange(account, chatId, window3.from, window3.to);
24576
+ if (window2 !== void 0 && (low < window2.from || !byTime && low === window2.from)) {
24577
+ await store.sync.markRange(account, chatId, window2.from, window2.to);
24863
24578
  windowComplete = true;
24864
- onPage({ fetched, chatId, oldest: window3.from });
24579
+ onPage({ fetched, chatId, oldest: window2.from });
24865
24580
  break;
24866
24581
  }
24867
- if (window3 === void 0 && before === void 0)
24582
+ if (window2 === void 0 && before === void 0)
24868
24583
  await store.sync.setSyncState(account, fetchedKey(chatId), String(top));
24869
24584
  onPage({ fetched, chatId, oldest: held.from });
24870
24585
  idle = fresh === 0 ? idle + 1 : 0;
24871
- if (idle > (byTime ? 1 : 0) || window3 !== void 0 && byTime && fresh === 0)
24586
+ if (idle > (byTime ? 1 : 0) || window2 !== void 0 && byTime && fresh === 0)
24872
24587
  break;
24873
24588
  if (!page.hasMore) {
24874
- if (window3 === void 0)
24589
+ if (window2 === void 0)
24875
24590
  reachedStart = true;
24876
24591
  break;
24877
24592
  }
@@ -24885,8 +24600,8 @@ var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetchin
24885
24600
  reachedLast = true;
24886
24601
  break;
24887
24602
  }
24888
- const boundary = window3 === void 0 ? held.from : low;
24889
- before = byTime ? new Date(boundary + (fresh > 0 && !(window3 && fetching.beforeInclusive) ? 1 : 0)).toISOString() : String(boundary);
24603
+ const boundary = window2 === void 0 ? held.from : low;
24604
+ before = byTime ? new Date(boundary + (fresh > 0 && !(window2 && fetching.beforeInclusive) ? 1 : 0)).toISOString() : String(boundary);
24890
24605
  note(`${fetched} messages so far, back to ${fromAt.slice(0, 10)}`);
24891
24606
  const wait = fetching.jitter ? pauseMs * (1 + Math.random()) : pauseMs;
24892
24607
  await sleep2(wait, void 0, { signal: stop }).catch(() => {
@@ -24902,14 +24617,14 @@ var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetchin
24902
24617
  complete: reachedStart && ranges.length === 1,
24903
24618
  ranges,
24904
24619
  ...issue ? { issue, resume: { ...before === void 0 ? {} : { before } } } : {},
24905
- ...window3 === void 0 ? {} : { windowComplete, requests },
24620
+ ...window2 === void 0 ? {} : { windowComplete, requests },
24906
24621
  ...reachedSince ? { reachedSince: true } : {},
24907
24622
  ...reachedLast ? { reachedLast: true } : {},
24908
24623
  ...stop.aborted ? { stopped: true } : {}
24909
24624
  };
24910
24625
  }, "fetchInto");
24911
24626
  var heldToNewest = /* @__PURE__ */ __name((store, account, fetching, options2) => async (chat) => {
24912
- if (options2.window || options2.catchUp || options2.last !== void 0)
24627
+ if (options2.threads || options2.window || options2.catchUp || options2.last !== void 0)
24913
24628
  return false;
24914
24629
  const lastAt = Date.parse(chat.lastMessageAt ?? "");
24915
24630
  if (Number.isNaN(lastAt))
@@ -24929,6 +24644,18 @@ var heldToNewest = /* @__PURE__ */ __name((store, account, fetching, options2) =
24929
24644
  const startedAt = Date.parse(await timeOfKey(store, account, chat.id, top.from, fetching.orderBy === "time", ""));
24930
24645
  return !Number.isNaN(startedAt) && startedAt < options2.sinceMs;
24931
24646
  }, "heldToNewest");
24647
+ var threadsKey = /* @__PURE__ */ __name((chatId) => `threads:${chatId}`, "threadsKey");
24648
+ var savedReplies = /* @__PURE__ */ __name(async (connection, store, account, chatId, stop) => {
24649
+ if (!connection.threadReplies || stop.aborted)
24650
+ return 0;
24651
+ const startedAt = Date.now();
24652
+ const point = Number((await store.sync.syncState(account, threadsKey(chatId)))?.value);
24653
+ const replies = await connection.threadReplies(chatId, Number.isFinite(point) ? { since: point } : {});
24654
+ if (replies.length > 0)
24655
+ await store.messages.saveMessages(account, chatId, replies, { via: "history", seenAt: startedAt });
24656
+ await store.sync.setSyncState(account, threadsKey(chatId), String(startedAt));
24657
+ return replies.length;
24658
+ }, "savedReplies");
24932
24659
  var timeOfKey = /* @__PURE__ */ __name(async (store, account, chatId, key, byTime, fallback) => {
24933
24660
  if (byTime)
24934
24661
  return new Date(key).toISOString();
@@ -24936,20 +24663,20 @@ var timeOfKey = /* @__PURE__ */ __name(async (store, account, chatId, key, byTim
24936
24663
  return message?.timestamp ?? fallback;
24937
24664
  }, "timeOfKey");
24938
24665
 
24939
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/attachments/extract.js
24666
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/attachments/extract.js
24940
24667
  import { extname as extname3 } from "node:path";
24941
24668
 
24942
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/readers/engine.js
24669
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/readers/engine.js
24943
24670
  import { readFileSync } from "node:fs";
24944
24671
  import { dirname as dirname2, extname as extname2, join as join2 } from "node:path";
24945
24672
  import { fileURLToPath } from "node:url";
24946
24673
 
24947
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/attachments/container.js
24674
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/attachments/container.js
24948
24675
  import { setImmediate as tick } from "node:timers/promises";
24949
24676
  import { crc32 } from "node:zlib";
24950
24677
  var import_xmldom = __toESM(require_lib(), 1);
24951
24678
 
24952
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/attachments/encoding.js
24679
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/attachments/encoding.js
24953
24680
  var import_chardet = __toESM(require_lib2(), 1);
24954
24681
  var import_iconv_lite = __toESM(require_lib3(), 1);
24955
24682
  var SAMPLE = 65536;
@@ -25051,7 +24778,7 @@ var decodeXml = /* @__PURE__ */ __name((bytes2) => {
25051
24778
  return result.text;
25052
24779
  }, "decodeXml");
25053
24780
 
25054
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/attachments/container.js
24781
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/attachments/container.js
25055
24782
  var MAX_PART = 10 * 1024 * 1024;
25056
24783
  var MAX_ENTRIES = 1e3;
25057
24784
  var decoder = new TextDecoder("utf-8", { fatal: true });
@@ -25266,7 +24993,7 @@ var elements = /* @__PURE__ */ __name((node, name, namespace) => {
25266
24993
  return found;
25267
24994
  }, "elements");
25268
24995
 
25269
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/readers/engine.js
24996
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/readers/engine.js
25270
24997
  var BUILT_IN = ["unpdf", "mammoth", "word-extractor", "linkedom", "defuddle/node"];
25271
24998
  var ENGINES = [...BUILT_IN, "@napi-rs/canvas"];
25272
24999
  var isMissing = /* @__PURE__ */ __name((error, name) => error?.code === "ERR_MODULE_NOT_FOUND" && String(error.message).includes(name), "isMissing");
@@ -25324,7 +25051,7 @@ var derived = /* @__PURE__ */ __name((bytes2, extractor, read) => {
25324
25051
  }
25325
25052
  }, "derived");
25326
25053
 
25327
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/readers/image/index.js
25054
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/readers/image/index.js
25328
25055
  var IMAGES = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png", ".webp", ".gif", ".heic", ".tif", ".tiff", ".bmp"]);
25329
25056
  var image = {
25330
25057
  id: "image",
@@ -25333,7 +25060,7 @@ var image = {
25333
25060
  read: /* @__PURE__ */ __name(async () => ({ status: "needs-agent" }), "read")
25334
25061
  };
25335
25062
 
25336
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/readers/doc/index.js
25063
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/readers/doc/index.js
25337
25064
  var OLE = "\xD0\xCF\xE0\xA1\xB1\xE1";
25338
25065
  var doc = {
25339
25066
  id: "doc",
@@ -25345,7 +25072,7 @@ var doc = {
25345
25072
  }), "read")
25346
25073
  };
25347
25074
 
25348
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/readers/docx/index.js
25075
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/readers/docx/index.js
25349
25076
  var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
25350
25077
  var docx = {
25351
25078
  id: "docx",
@@ -25358,10 +25085,10 @@ var docx = {
25358
25085
  }), "read")
25359
25086
  };
25360
25087
 
25361
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/attachments/markup.js
25088
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/attachments/markup.js
25362
25089
  var import_iconv_lite2 = __toESM(require_lib3(), 1);
25363
25090
 
25364
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/domain/html-entities.js
25091
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/domain/html-entities.js
25365
25092
  var NAMED = {
25366
25093
  amp: "&",
25367
25094
  lt: "<",
@@ -25413,7 +25140,7 @@ var decodeEntities = /* @__PURE__ */ __name((text2) => text2.replace(/&(#x[0-9a-
25413
25140
  return body[1] === "x" || body[1] === "X" ? character(Number.parseInt(body.slice(2), 16), entity) : character(Number(body.slice(1)), entity);
25414
25141
  }), "decodeEntities");
25415
25142
 
25416
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/attachments/markup.js
25143
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/attachments/markup.js
25417
25144
  var RTF_SKIPPED = /* @__PURE__ */ new Set([
25418
25145
  "fonttbl",
25419
25146
  "colortbl",
@@ -25579,7 +25306,7 @@ var htmlText = /* @__PURE__ */ __name((source) => {
25579
25306
  return decodeEntities(replaceTags(blocks, /<[^>]*>/g, "")).replace(/(?<![ \t\u00a0])[ \t\u00a0]+\n/g, "\n").replace(/\n{3,}/g, "\n\n").trim();
25580
25307
  }, "htmlText");
25581
25308
 
25582
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/readers/html/page.js
25309
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/readers/html/page.js
25583
25310
  var clean = /* @__PURE__ */ __name((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "", "clean");
25584
25311
  var namesIn = /* @__PURE__ */ __name((value) => [value].flat().map((entry) => typeof entry === "string" ? clean(entry) : clean(entry?.name)).filter(Boolean).join(", "), "namesIn");
25585
25312
  var jsonLdNodes = /* @__PURE__ */ __name((document) => {
@@ -25635,7 +25362,7 @@ var markdownSections = /* @__PURE__ */ __name((text2) => {
25635
25362
  return found.map((section, index) => ({ ...section, end: found[index + 1]?.start ?? text2.length }));
25636
25363
  }, "markdownSections");
25637
25364
 
25638
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/readers/html/index.js
25365
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/readers/html/index.js
25639
25366
  var HTML = /* @__PURE__ */ new Set([".html", ".htm", ".xhtml"]);
25640
25367
  var first = /* @__PURE__ */ __name((...values) => values.find((value) => typeof value === "string" && value !== ""), "first");
25641
25368
  var loaded = /* @__PURE__ */ __name(async (load, name) => {
@@ -25706,10 +25433,10 @@ var html = {
25706
25433
  }, "read")
25707
25434
  };
25708
25435
 
25709
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/attachments/documents.js
25436
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/attachments/documents.js
25710
25437
  import { posix } from "node:path";
25711
25438
 
25712
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/attachments/sheets.js
25439
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/attachments/sheets.js
25713
25440
  var columnName = /* @__PURE__ */ __name((column) => {
25714
25441
  let name = "";
25715
25442
  for (let rest = column; rest > 0; rest = Math.floor((rest - 1) / 26))
@@ -25764,7 +25491,7 @@ var sheetText = /* @__PURE__ */ __name((sheets2, maxChars = MAX_TEXT_CHARS) => {
25764
25491
  return { text: parts.join("").trim(), truncated: false };
25765
25492
  }, "sheetText");
25766
25493
 
25767
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/attachments/documents.js
25494
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/attachments/documents.js
25768
25495
  var OFFICE = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
25769
25496
  var TEXT = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
25770
25497
  var TABLE = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
@@ -26164,7 +25891,7 @@ var readDocument = /* @__PURE__ */ __name(async (bytes2, kind, signal) => {
26164
25891
  }
26165
25892
  }, "readDocument");
26166
25893
 
26167
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/readers/office/index.js
25894
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/readers/office/index.js
26168
25895
  var office = {
26169
25896
  id: "office",
26170
25897
  version: documentExtractor("odt"),
@@ -26175,7 +25902,7 @@ var office = {
26175
25902
  }, "read")
26176
25903
  };
26177
25904
 
26178
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/readers/pdf/index.js
25905
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/readers/pdf/index.js
26179
25906
  var pdf = {
26180
25907
  id: "pdf",
26181
25908
  version: "unpdf",
@@ -26242,7 +25969,7 @@ var pdf = {
26242
25969
  }), "read")
26243
25970
  };
26244
25971
 
26245
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/readers/plain/index.js
25972
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/readers/plain/index.js
26246
25973
  var PLAIN = /* @__PURE__ */ new Set([".txt", ".md", ".markdown", ".csv", ".tsv", ".json", ".log"]);
26247
25974
  var isPlain = /* @__PURE__ */ __name((hint) => PLAIN.has(extensionOf(hint)) || hint.mime?.startsWith("text/") || hint.mime === "application/json", "isPlain");
26248
25975
  var readPlain = /* @__PURE__ */ __name((bytes2) => {
@@ -26262,7 +25989,7 @@ var plain = {
26262
25989
  read: /* @__PURE__ */ __name(async (bytes2) => readPlain(bytes2), "read")
26263
25990
  };
26264
25991
 
26265
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/readers/rtf/index.js
25992
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/readers/rtf/index.js
26266
25993
  var rtf = {
26267
25994
  id: "rtf",
26268
25995
  version: "v1",
@@ -26270,10 +25997,10 @@ var rtf = {
26270
25997
  read: /* @__PURE__ */ __name(async (bytes2) => derived(bytes2, "rtf:v1", rtfText), "read")
26271
25998
  };
26272
25999
 
26273
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
26000
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
26274
26001
  import { basename as basename2 } from "node:path";
26275
26002
 
26276
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/attachments/csv-spans.js
26003
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/attachments/csv-spans.js
26277
26004
  var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) => {
26278
26005
  const cells = [];
26279
26006
  let row = 1, column = 1, start = 0, quoted = false, truncated = false;
@@ -26311,7 +26038,7 @@ var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) =
26311
26038
  return { cells, truncated };
26312
26039
  }, "delimitedSpans");
26313
26040
 
26314
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
26041
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
26315
26042
  var DELIMITED = {
26316
26043
  ".csv": ",",
26317
26044
  ".tsv": " ",
@@ -26350,7 +26077,7 @@ var sheets = {
26350
26077
  }, "read")
26351
26078
  };
26352
26079
 
26353
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/readers/registry.js
26080
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/readers/registry.js
26354
26081
  var BUILT_INS2 = [office, pdf, docx, doc, rtf, html, sheets, plain, image];
26355
26082
  var HEAD_BYTES = 1024;
26356
26083
  var readers = [...BUILT_INS2];
@@ -26360,7 +26087,7 @@ var readWithRegistry = /* @__PURE__ */ __name(async (bytes2, hint, context2) =>
26360
26087
  return reader ? reader.read(bytes2, hint, context2) : { status: "unsupported" };
26361
26088
  }, "readWithRegistry");
26362
26089
 
26363
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/attachments/extract.js
26090
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/attachments/extract.js
26364
26091
  var importEngine = /* @__PURE__ */ __name((name) => importFrom(new URL("attachments/extract.js", import.meta.resolve("@wirecat/cli-core")).href, name), "importEngine");
26365
26092
  var extensionOf2 = /* @__PURE__ */ __name(({ name, path }) => extname3(name ?? path).toLowerCase(), "extensionOf");
26366
26093
  var extractText = /* @__PURE__ */ __name(async (bytes2, hint, load, signal, env = process.env) => {
@@ -26398,7 +26125,7 @@ var engineStates = /* @__PURE__ */ __name((resolve7 = (name) => resolveFrom(new
26398
26125
  }
26399
26126
  })), "engineStates");
26400
26127
 
26401
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/domain/models.js
26128
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/domain/models.js
26402
26129
  var GROUP_SETTINGS = [
26403
26130
  "allCanPin",
26404
26131
  "onlyAdminsAdd",
@@ -26412,7 +26139,7 @@ var ADMIN_RIGHTS = ["read", "members", "admins", "info", "pin", "link", "post",
26412
26139
  var senderIsMe = /* @__PURE__ */ __name((message, account) => message.outgoing === true || message.senderId !== null && String(message.senderId) === account, "senderIsMe");
26413
26140
  var MEDIA_KINDS = ["photo", "video", "file", "audio", "link"];
26414
26141
 
26415
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/sends/send-as.js
26142
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/sends/send-as.js
26416
26143
  var sendAsCheck = /* @__PURE__ */ __name((connection, sendAs) => {
26417
26144
  if (sendAs === void 0) {
26418
26145
  const saved = connection.savedSender?.bind(connection);
@@ -26437,7 +26164,7 @@ var typedSendAs = /* @__PURE__ */ __name((typed) => {
26437
26164
  return sendAs;
26438
26165
  }, "typedSendAs");
26439
26166
 
26440
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/search/respell.js
26167
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/search/respell.js
26441
26168
  var LATIN = {
26442
26169
  \u0430: "a",
26443
26170
  \u0431: "b",
@@ -26492,7 +26219,7 @@ var respelled = /* @__PURE__ */ __name(async (vocabulary, words3) => {
26492
26219
  return found;
26493
26220
  }, "respelled");
26494
26221
 
26495
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/search/total.js
26222
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/search/total.js
26496
26223
  var TOTAL_CAP = 1e4;
26497
26224
  var totalOf = /* @__PURE__ */ __name((count3, shown, hasMore, exact = true) => {
26498
26225
  const least = shown + (hasMore ? 1 : 0);
@@ -26503,7 +26230,7 @@ var totalOf = /* @__PURE__ */ __name((count3, shown, hasMore, exact = true) => {
26503
26230
  return { value: count3, relation: exact ? "eq" : "gte" };
26504
26231
  }, "totalOf");
26505
26232
 
26506
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/search/lucene/meaning-parts.js
26233
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/search/lucene/meaning-parts.js
26507
26234
  var WORD_FIELDS = /* @__PURE__ */ new Set(["text", "exact"]);
26508
26235
  var fieldsOfQuery = /* @__PURE__ */ __name((root, everything) => {
26509
26236
  let narrows = false;
@@ -26532,7 +26259,7 @@ var meaningWords = /* @__PURE__ */ __name((root) => {
26532
26259
  return wanted(root).join(" ").trim();
26533
26260
  }, "meaningWords");
26534
26261
 
26535
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/messages-combined.js
26262
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/messages-combined.js
26536
26263
  var COMBINED_DEFAULTS = { candidateDepth: 300, rrfK: 60, rerank: "all", chatCap: 0 };
26537
26264
  var tokensOf = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}\p{Co}\p{M}]+/gu) ?? [], "tokensOf");
26538
26265
  var searchCombined = /* @__PURE__ */ __name(async (store, account, request, messenger = {}, options2 = COMBINED_DEFAULTS) => {
@@ -26733,7 +26460,7 @@ var signals = /* @__PURE__ */ __name((hit, terms, corrections, execution, mode,
26733
26460
  return mode === "coverage" ? coverage2 * 4 : mode === "proximity" ? proximity : mode === "phrase" ? phrase2 : coverage2 * 4 + proximity + phrase2;
26734
26461
  }, "signals");
26735
26462
 
26736
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/messages-discovery.js
26463
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/messages-discovery.js
26737
26464
  var MEANING_DEPTH = 100;
26738
26465
  var RRF_K2 = 60;
26739
26466
  var RERANK_DEPTH = 50;
@@ -27059,10 +26786,11 @@ var mixedWithReranker = /* @__PURE__ */ __name((head, scores) => {
27059
26786
  })).sort((a, b) => b.mixed - a.mixed).map(({ hit }) => hit);
27060
26787
  }, "mixedWithReranker");
27061
26788
 
27062
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/named-chat.js
26789
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/named-chat.js
27063
26790
  var LEAST_USES = 3;
27064
26791
  var SAMPLE2 = 50;
27065
26792
  var CAPITALISED = 0.8;
26793
+ var NAMED_SHARE = 0.05;
27066
26794
  var namedChat = /* @__PURE__ */ __name(async (store, account, messenger, accounts, words3) => {
27067
26795
  for (const word of words3) {
27068
26796
  if (word.length < 3 || new RegExp("^\\p{N}+$", "u").test(word))
@@ -27075,6 +26803,7 @@ var namedChat = /* @__PURE__ */ __name(async (store, account, messenger, account
27075
26803
  messenger
27076
26804
  );
27077
26805
  const groups = (await store.queries.countQuery(execution, "chat")).sort((a, b) => b.count - a.count);
26806
+ const total = groups.reduce((sum2, { count: count3 }) => sum2 + count3, 0);
27078
26807
  const dialogs = [];
27079
26808
  for (const group of groups) {
27080
26809
  if (dialogs.length === 2)
@@ -27087,6 +26816,8 @@ var namedChat = /* @__PURE__ */ __name(async (store, account, messenger, account
27087
26816
  const [best, next] = dialogs;
27088
26817
  if (!best || best.count < LEAST_USES || next && next.count * 2 > best.count)
27089
26818
  continue;
26819
+ if (best.count < total * NAMED_SHARE)
26820
+ continue;
27090
26821
  const { items } = await store.queries.matchQuery({
27091
26822
  ...execution,
27092
26823
  chat: { account: best.source, chatId: best.chatId }
@@ -27109,7 +26840,7 @@ var queryWords2 = /* @__PURE__ */ __name((query) => {
27109
26840
  }, "queryWords");
27110
26841
  var without = /* @__PURE__ */ __name((query, word) => query.replace(new RegExp(`(?<![\\p{L}\\p{N}])${word}(?![\\p{L}\\p{N}])`, "giu"), " ").replace(/\s+/gu, " ").trim(), "without");
27111
26842
 
27112
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/thread-context.js
26843
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/thread-context.js
27113
26844
  var THREAD_BOUNDS = { maxHops: 8, maxMessages: 50, maxBytes: 65536, withinMs: 864e5 };
27114
26845
  var bytes = /* @__PURE__ */ __name((items, links) => Buffer.byteLength(JSON.stringify({ items, links }), "utf8"), "bytes");
27115
26846
  var threadBounds = /* @__PURE__ */ __name((options2 = {}) => {
@@ -27308,7 +27039,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
27308
27039
  return result;
27309
27040
  }, "readThreadContext");
27310
27041
 
27311
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/messages-archive-search.js
27042
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/messages-archive-search.js
27312
27043
  var SEARCH_FILL_MS = 200;
27313
27044
  var statsStore = /* @__PURE__ */ __name(async (store, account, request, messenger = {}) => {
27314
27045
  const stop = Date.now() + SEARCH_FILL_MS;
@@ -27416,7 +27147,7 @@ var accountOf2 = /* @__PURE__ */ __name((hit) => {
27416
27147
  }, "accountOf");
27417
27148
  var keyOf2 = /* @__PURE__ */ __name(({ provider, account }) => `${provider}/${account}`, "keyOf");
27418
27149
 
27419
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
27150
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
27420
27151
  var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
27421
27152
  const host = new URL(baseUrl).host;
27422
27153
  return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
@@ -27449,7 +27180,7 @@ var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) =>
27449
27180
  };
27450
27181
  }, "embeddingKeys");
27451
27182
 
27452
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/models/openai.js
27183
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/models/openai.js
27453
27184
  var options = strictObject({
27454
27185
  temperature: range(0, 2),
27455
27186
  top_p: range(0, 1),
@@ -27516,7 +27247,7 @@ var openai = {
27516
27247
  }), "complete")
27517
27248
  };
27518
27249
 
27519
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/models/index.js
27250
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/models/index.js
27520
27251
  var modelGateway = /* @__PURE__ */ __name((deps) => ({
27521
27252
  complete: /* @__PURE__ */ __name(async (request) => {
27522
27253
  if (deps.signal?.aborted)
@@ -27531,7 +27262,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
27531
27262
  if (!adapter && target2.provider === "openai")
27532
27263
  adapter = openai;
27533
27264
  if (!adapter && target2.provider === "anthropic")
27534
- adapter = (await import("./anthropic-N5NOX7K7.js")).anthropic;
27265
+ adapter = (await import("./anthropic-FDI24DU2.js")).anthropic;
27535
27266
  if (!adapter)
27536
27267
  throw new CliError("validation_error", `no model adapter for ${target2.provider}`);
27537
27268
  if (request.images !== void 0 && adapter.images !== true)
@@ -27591,7 +27322,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
27591
27322
  }, "complete")
27592
27323
  }), "modelGateway");
27593
27324
 
27594
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/searches.js
27325
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/searches.js
27595
27326
  var savedSearchItem = /* @__PURE__ */ __name((one) => ({
27596
27327
  id: one.id,
27597
27328
  name: one.name,
@@ -27717,7 +27448,7 @@ var searchesService = /* @__PURE__ */ __name((deps) => {
27717
27448
  };
27718
27449
  }, "searchesService");
27719
27450
 
27720
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/text-model-choice.js
27451
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/text-model-choice.js
27721
27452
  import { createHash as createHash3 } from "node:crypto";
27722
27453
  import { existsSync } from "node:fs";
27723
27454
  var useTextModel = /* @__PURE__ */ __name(async (id2, { env, command }) => {
@@ -27848,11 +27579,11 @@ var addCustomTextModel = /* @__PURE__ */ __name(async (id2, payload, { env, fetc
27848
27579
  return { ...checked2.output, custom: true };
27849
27580
  }, "addCustomTextModel");
27850
27581
 
27851
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/calendar/sync.js
27582
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/calendar/sync.js
27852
27583
  var DAY3 = 864e5;
27853
27584
  var SLOTS_EVERY = 7 * DAY3;
27854
27585
 
27855
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/calendar/reads.js
27586
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/calendar/reads.js
27856
27587
  var localDate = /* @__PURE__ */ __name((at, zone) => new Intl.DateTimeFormat("en-CA", { timeZone: zone, year: "numeric", month: "2-digit", day: "2-digit" }).format(at), "localDate");
27857
27588
  var plusDays = /* @__PURE__ */ __name((date, days) => {
27858
27589
  const [year, month, day2] = date.split("-").map(Number);
@@ -27916,10 +27647,10 @@ var EVENTS_QUERY = {
27916
27647
  } : field)
27917
27648
  };
27918
27649
 
27919
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/calendar/feeds.js
27650
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/calendar/feeds.js
27920
27651
  var FEED_LIMITS = { maxBytes: 10 * 1024 * 1024, timeoutMs: 3e4, redirects: 5 };
27921
27652
 
27922
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/calendar/writer.js
27653
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/calendar/writer.js
27923
27654
  var EVENTS_NOTIFY_KEY = "events.notify";
27924
27655
  var EVENTS_DELETE_SERIES_KEY = "events.delete.series";
27925
27656
  var EVENTS_REMIND_HOOK_KEY = "events.remind.hook";
@@ -27937,7 +27668,7 @@ var CALENDAR_WRITE_DEFAULTS = {
27937
27668
  [EVENTS_REMIND_HOOK_KEY]: "deny"
27938
27669
  };
27939
27670
 
27940
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/meeting-passage-format.js
27671
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/meeting-passage-format.js
27941
27672
  var visible = /* @__PURE__ */ __name((text2) => text2.replace(/[\p{Cc}\p{Cf}]/gu, (value) => value === "\n" || value === " " ? value : `\\u{${value.codePointAt(0)?.toString(16)}}`), "visible");
27942
27673
  var markdown = /* @__PURE__ */ __name((text2) => visible(text2).replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replace(/[\\`*_[\]#|~]/g, "\\$&"), "markdown");
27943
27674
  var timestamp = /* @__PURE__ */ __name((ms) => {
@@ -27957,22 +27688,22 @@ var formatMeetingPassage = /* @__PURE__ */ __name((packet, format = "text", maxB
27957
27688
  const source = ref(packet.source);
27958
27689
  const context2 = packet.kind === "meeting_context";
27959
27690
  const coverage2 = context2 ? `Cues: ${packet.coverage.included}; before: ${packet.coverage.before}/${packet.limits.before}; after: ${packet.coverage.after}/${packet.limits.after}; more before: ${packet.coverage.has_before}; more after: ${packet.coverage.has_after}; clipped: ${packet.coverage.truncated_by ?? "none"}; archive: ${packet.coverage.archive_completeness}.` : `Cues: ${packet.coverage.included}; more: ${packet.coverage.hasMore}; clipped: ${packet.coverage.truncatedBy ?? "none"}; unavailable revisions: ${packet.coverage.skippedUnavailable}; archive: ${packet.coverage.archiveCompleteness}.`;
27960
- const lines3 = [`Source: ${source}`, coverage2];
27691
+ const lines = [`Source: ${source}`, coverage2];
27961
27692
  if (context2) {
27962
- lines3.push(`Target: ${ref(packet.target_ref)}; revision: ${packet.revision}.`);
27693
+ lines.push(`Target: ${ref(packet.target_ref)}; revision: ${packet.revision}.`);
27963
27694
  if (packet.coverage.before_ref)
27964
- lines3.push(`Before anchor (inclusive): ${ref(packet.coverage.before_ref)}`);
27695
+ lines.push(`Before anchor (inclusive): ${ref(packet.coverage.before_ref)}`);
27965
27696
  if (packet.coverage.after_ref)
27966
- lines3.push(`After anchor (inclusive): ${ref(packet.coverage.after_ref)}`);
27697
+ lines.push(`After anchor (inclusive): ${ref(packet.coverage.after_ref)}`);
27967
27698
  } else {
27968
27699
  if (packet.coverage.nextReference)
27969
- lines3.push(`Continue after: ${ref(packet.coverage.nextReference)}`);
27700
+ lines.push(`Continue after: ${ref(packet.coverage.nextReference)}`);
27970
27701
  if (packet.coverage.nextTranscriptId !== null)
27971
- lines3.push(`Continue after transcript: ${packet.coverage.nextTranscriptId}`);
27702
+ lines.push(`Continue after transcript: ${packet.coverage.nextTranscriptId}`);
27972
27703
  }
27973
27704
  if (!packet.items.length)
27974
- lines3.push("No cues included; check coverage and limits before concluding content is absent.");
27975
- let bytes2 = Buffer.byteLength(lines3.join("\n"), "utf8") + 1;
27705
+ lines.push("No cues included; check coverage and limits before concluding content is absent.");
27706
+ let bytes2 = Buffer.byteLength(lines.join("\n"), "utf8") + 1;
27976
27707
  if (bytes2 > maxBytes)
27977
27708
  throw new CliError("validation_error", "compact passage exceeds its output byte budget");
27978
27709
  for (const item2 of packet.items) {
@@ -28000,13 +27731,13 @@ ${body}`;
28000
27731
  bytes2 += Buffer.byteLength(part, "utf8") + 1;
28001
27732
  if (bytes2 > maxBytes)
28002
27733
  throw new CliError("validation_error", "compact passage exceeds its output byte budget");
28003
- lines3.push(part);
27734
+ lines.push(part);
28004
27735
  }
28005
- return `${lines3.join("\n")}
27736
+ return `${lines.join("\n")}
28006
27737
  `;
28007
27738
  }, "formatMeetingPassage");
28008
27739
 
28009
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/meeting-preparation-validation.js
27740
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/meeting-preparation-validation.js
28010
27741
  var MEETING_PREPARATION_LIMITS = {
28011
27742
  meetings: { min: 1, max: 20, default: 5 },
28012
27743
  cues: { min: 1, max: 100, default: 10 },
@@ -28079,7 +27810,7 @@ var validateMeetingPreparationRequest = /* @__PURE__ */ __name((externalId, orig
28079
27810
  };
28080
27811
  }, "validateMeetingPreparationRequest");
28081
27812
 
28082
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/meeting-communications-selection.js
27813
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/meeting-communications-selection.js
28083
27814
  var validatePreparationCommunications = /* @__PURE__ */ __name((section, request, after) => {
28084
27815
  const fail2 = /* @__PURE__ */ __name(() => {
28085
27816
  throw new CliError("invalid_response", "Preparation communications returned another selection or invalid evidence");
@@ -28127,7 +27858,7 @@ var validatePreparationCommunications = /* @__PURE__ */ __name((section, request
28127
27858
  }
28128
27859
  }, "validatePreparationCommunications");
28129
27860
 
28130
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/package-upgrade.js
27861
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/package-upgrade.js
28131
27862
  var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageName, check: check2 }, ports) => {
28132
27863
  const installer = ports.installer();
28133
27864
  const argv = updateCommand(installer, packageName);
@@ -28192,18 +27923,18 @@ var dayAfter = /* @__PURE__ */ __name((published) => {
28192
27923
  return Number.isNaN(time) ? null : new Date(time + 24 * 60 * 60 * 1e3).toISOString();
28193
27924
  }, "dayAfter");
28194
27925
 
28195
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/media-archive.js
27926
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/media-archive.js
28196
27927
  import { setTimeout as sleep3 } from "node:timers/promises";
28197
27928
 
28198
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
27929
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
28199
27930
  import { lstat } from "node:fs/promises";
28200
27931
 
28201
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
27932
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
28202
27933
  import { createHash as createHash5, randomUUID as randomUUID2 } from "node:crypto";
28203
27934
  import { open as open3, rename as rename2, unlink as unlink2 } from "node:fs/promises";
28204
27935
  import { join as join4 } from "node:path";
28205
27936
 
28206
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-metadata.js
27937
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-metadata.js
28207
27938
  import { createHash as createHash4 } from "node:crypto";
28208
27939
  var metadataLimit = 16384;
28209
27940
  var partialIdentity = /* @__PURE__ */ __name((locator) => JSON.stringify([locator.provider, locator.account, locator.occurrenceId, locator.assetId]), "partialIdentity");
@@ -28263,7 +27994,7 @@ var readPartialMetadata = /* @__PURE__ */ __name(async (path, locator, maxBytes,
28263
27994
  }
28264
27995
  }, "readPartialMetadata");
28265
27996
 
28266
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-writer.js
27997
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-writer.js
28267
27998
  import { randomUUID } from "node:crypto";
28268
27999
  import { open as open2, rename, unlink } from "node:fs/promises";
28269
28000
  import { join as join3 } from "node:path";
@@ -28355,7 +28086,7 @@ var partialWriter = /* @__PURE__ */ __name(async (input) => {
28355
28086
  };
28356
28087
  }, "partialWriter");
28357
28088
 
28358
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
28089
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
28359
28090
  var NativeRecordingPartialStore = class {
28360
28091
  static {
28361
28092
  __name(this, "NativeRecordingPartialStore");
@@ -28462,12 +28193,12 @@ var NativeRecordingPartialStore = class {
28462
28193
  }
28463
28194
  };
28464
28195
 
28465
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
28196
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
28466
28197
  import { createHash as createHash6 } from "node:crypto";
28467
28198
  import { link as link2 } from "node:fs/promises";
28468
28199
  import { basename as basename3, dirname as dirname3, join as join6, resolve as resolve2 } from "node:path";
28469
28200
 
28470
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-files.js
28201
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-files.js
28471
28202
  import { unlink as unlink3 } from "node:fs/promises";
28472
28203
  var verifiedPublicationFile = /* @__PURE__ */ __name(async (path, expected2, signal, writable = false) => {
28473
28204
  signal?.throwIfAborted();
@@ -28502,7 +28233,7 @@ var commitPublication = /* @__PURE__ */ __name(async (root, partialPath, finalPa
28502
28233
  signal?.throwIfAborted();
28503
28234
  }, "commitPublication");
28504
28235
 
28505
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-journal.js
28236
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-journal.js
28506
28237
  import { randomUUID as randomUUID3 } from "node:crypto";
28507
28238
  import { open as open4, rename as rename3, unlink as unlink4 } from "node:fs/promises";
28508
28239
  import { join as join5 } from "node:path";
@@ -28575,7 +28306,7 @@ var writePublicationJournal = /* @__PURE__ */ __name(async (root, path, prefix,
28575
28306
  }
28576
28307
  }, "writePublicationJournal");
28577
28308
 
28578
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
28309
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
28579
28310
  var NativeRecordingPublication = class {
28580
28311
  static {
28581
28312
  __name(this, "NativeRecordingPublication");
@@ -28648,7 +28379,7 @@ var NativeRecordingPublication = class {
28648
28379
  }
28649
28380
  };
28650
28381
 
28651
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/media-archive-manifest.js
28382
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/media-archive-manifest.js
28652
28383
  import { createHash as createHash7 } from "node:crypto";
28653
28384
  import { readdir } from "node:fs/promises";
28654
28385
  import { isAbsolute as isAbsolute2, join as join7, resolve as resolve3 } from "node:path";
@@ -28735,7 +28466,7 @@ var commitMediaEntry = /* @__PURE__ */ __name((root, one, beforePublish) => writ
28735
28466
  beforePublish
28736
28467
  }), "commitMediaEntry");
28737
28468
 
28738
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
28469
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
28739
28470
  var validator = '"media-completed-v1"';
28740
28471
  var maximumFileBytes = 64 * 1024 * 1024 * 1024;
28741
28472
  var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file, beforeWrite, signal, metadata = {}) => {
@@ -28836,7 +28567,7 @@ var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file,
28836
28567
  return entry;
28837
28568
  }, "archiveMediaFile");
28838
28569
 
28839
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/media-archive-locks.js
28570
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/media-archive-locks.js
28840
28571
  import { mkdir, realpath } from "node:fs/promises";
28841
28572
  import { join as join8, resolve as resolve4 } from "node:path";
28842
28573
  var archiveLocations = /* @__PURE__ */ __name(async (initial, signal) => {
@@ -28903,7 +28634,7 @@ var withMediaArchiveLocks = /* @__PURE__ */ __name(async (directory2, signal, ru
28903
28634
  throw new CliError("validation_error", "archive locations changed during locking; run the command again");
28904
28635
  }, "withMediaArchiveLocks");
28905
28636
 
28906
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/media-archive.js
28637
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/media-archive.js
28907
28638
  var checkMediaArchive = /* @__PURE__ */ __name((directory2, signal) => withMediaArchiveLocks(directory2, signal, async (root) => {
28908
28639
  const entries = await readMediaManifests(root, signal);
28909
28640
  if (!entries.length)
@@ -29046,7 +28777,7 @@ var archiveMedia = /* @__PURE__ */ __name(async (ports, options2) => {
29046
28777
  }, { create: true });
29047
28778
  }, "archiveMedia");
29048
28779
 
29049
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/media-archive-move.js
28780
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/media-archive-move.js
29050
28781
  import { realpath as realpath2, unlink as unlink5 } from "node:fs/promises";
29051
28782
  import { basename as basename4, dirname as dirname4, join as join9, resolve as resolve5 } from "node:path";
29052
28783
  var canonicalDestination = /* @__PURE__ */ __name(async (directory2) => {
@@ -29197,7 +28928,7 @@ var moveMediaArchive = /* @__PURE__ */ __name(async (options2) => {
29197
28928
  }, { additional: [target2], createAdditional: !options2.dryRun });
29198
28929
  }, "moveMediaArchive");
29199
28930
 
29200
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/domain/money-words.js
28931
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/domain/money-words.js
29201
28932
  var MONEY_REQUEST = "money-request";
29202
28933
  var MONEY_DONE = "money-done";
29203
28934
  var PROMISE = "promise";
@@ -29231,10 +28962,10 @@ var MONEY_WORDS = [
29231
28962
  }
29232
28963
  ];
29233
28964
 
29234
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/money-words.js
28965
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/money-words.js
29235
28966
  var moneyClassesOf = /* @__PURE__ */ __name((text2) => listsHit(text2, MONEY_WORDS), "moneyClassesOf");
29236
28967
 
29237
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/domain/status-words.js
28968
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/domain/status-words.js
29238
28969
  var words2 = /* @__PURE__ */ __name((forms) => new RegExp(`(?<![\\p{L}\\p{N}])(?:${forms.join("|")})(?![\\p{L}\\p{N}])`, "iu"), "words");
29239
28970
  var MONEY_DONE_FORMS = words2([
29240
28971
  "\u043E\u043F\u043B\u0430\u0442\u0438\u043B[\u0430\u0438]?",
@@ -29274,7 +29005,7 @@ var PROMISE_FORMS = words2([
29274
29005
  "estar\xE1 listo"
29275
29006
  ]);
29276
29007
 
29277
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/project-status/items.js
29008
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/project-status/items.js
29278
29009
  var EXCERPT_CHARS = 80;
29279
29010
  var excerpt2 = /* @__PURE__ */ __name((text2) => {
29280
29011
  const flat = text2.replace(/\s+/g, " ").trim();
@@ -29296,7 +29027,7 @@ var whoOf = /* @__PURE__ */ __name((message) => ({
29296
29027
  var fromOwner = /* @__PURE__ */ __name((message) => message.outgoing === true, "fromOwner");
29297
29028
  var day = /* @__PURE__ */ __name((at) => new Date(at).toISOString().slice(0, 10), "day");
29298
29029
 
29299
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/project-status/signals/amounts.js
29030
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/project-status/signals/amounts.js
29300
29031
  var MONEY = DEFAULT_TASK_CATEGORIES.filter((category) => category.name === "money");
29301
29032
  var verbOf = /* @__PURE__ */ __name((text2) => {
29302
29033
  if (MONEY_DONE_FORMS.test(text2))
@@ -29377,7 +29108,7 @@ var amounts = {
29377
29108
  attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.state === "asked" ? [{ chat: item2.chat, weight: 2, why: "money asked" }] : []), "attention")
29378
29109
  };
29379
29110
 
29380
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/project-status/signals/children.js
29111
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/project-status/signals/children.js
29381
29112
  var children = {
29382
29113
  id: "children",
29383
29114
  version: 1,
@@ -29406,7 +29137,7 @@ var children = {
29406
29137
  }, "read")
29407
29138
  };
29408
29139
 
29409
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/project-status/signals/coverage.js
29140
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/project-status/signals/coverage.js
29410
29141
  var coverage = {
29411
29142
  id: "coverage",
29412
29143
  version: 1,
@@ -29435,7 +29166,7 @@ var coverage = {
29435
29166
  attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.state !== "complete" && item2.data.beforeHeld ? [{ chat: item2.chat, weight: 3, why: "held in part" }] : []), "attention")
29436
29167
  };
29437
29168
 
29438
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/project-status/signals/payments.js
29169
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/project-status/signals/payments.js
29439
29170
  var holding = /* @__PURE__ */ __name((row) => row.review !== "rejected", "holding");
29440
29171
  var item = /* @__PURE__ */ __name((row, at, data) => ({
29441
29172
  signal: "payments",
@@ -29485,7 +29216,7 @@ var payments = {
29485
29216
  }, "read")
29486
29217
  };
29487
29218
 
29488
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/project-status/signals/promises.js
29219
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/project-status/signals/promises.js
29489
29220
  var PATTERNS_PER_CHAT = 3;
29490
29221
  var DAY4 = 864e5;
29491
29222
  var KINDS2 = /* @__PURE__ */ new Set(["promise", "request"]);
@@ -29574,7 +29305,7 @@ var promises = {
29574
29305
  }, "read")
29575
29306
  };
29576
29307
 
29577
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/project-status/signals/questions.js
29308
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/project-status/signals/questions.js
29578
29309
  var PER_SIDE = 5;
29579
29310
  var WEEK = 7 * 864e5;
29580
29311
  var NOBODY = /* @__PURE__ */ new Set();
@@ -29605,7 +29336,7 @@ var questions2 = {
29605
29336
  }, "attention")
29606
29337
  };
29607
29338
 
29608
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/project-status/signals/reply-next.js
29339
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/project-status/signals/reply-next.js
29609
29340
  var targetOf = /* @__PURE__ */ __name((message, chat, owners) => {
29610
29341
  const byId2 = /* @__PURE__ */ __name((id2) => chat.messages.find((one) => one.id === id2), "byId");
29611
29342
  const quoted = message.replyTo ?? (message.replyToId === void 0 ? void 0 : byId2(message.replyToId));
@@ -29673,7 +29404,7 @@ var replyNext = {
29673
29404
  attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.next === "owner" ? [{ chat: item2.chat, weight: 2, why: "your move" }] : []), "attention")
29674
29405
  };
29675
29406
 
29676
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/project-status/signals/topics.js
29407
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/project-status/signals/topics.js
29677
29408
  var escaped = /* @__PURE__ */ __name((text2) => text2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
29678
29409
  var wholeWord = /* @__PURE__ */ __name((word) => new RegExp(`(?<![\\p{L}\\p{N}])${escaped(word)}(?![\\p{L}\\p{N}])`, "u"), "wholeWord");
29679
29410
  var matcherOf = /* @__PURE__ */ __name((query) => {
@@ -29719,7 +29450,7 @@ var topics = {
29719
29450
  }, "read")
29720
29451
  };
29721
29452
 
29722
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/project-status/signals/index.js
29453
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/project-status/signals/index.js
29723
29454
  var STATUS_SIGNALS = [
29724
29455
  replyNext,
29725
29456
  questions2,
@@ -29731,7 +29462,7 @@ var STATUS_SIGNALS = [
29731
29462
  children
29732
29463
  ];
29733
29464
 
29734
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/project-status/index.js
29465
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/project-status/index.js
29735
29466
  var DAY5 = 864e5;
29736
29467
  var STATUS_WINDOW = 300;
29737
29468
  var STATUS_CHATS = 16;
@@ -29920,7 +29651,7 @@ var projectStatus = /* @__PURE__ */ __name(async (store, input) => {
29920
29651
  };
29921
29652
  }, "projectStatus");
29922
29653
 
29923
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/account.js
29654
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/account.js
29924
29655
  var accountService = /* @__PURE__ */ __name((deps) => {
29925
29656
  const online = /* @__PURE__ */ __name(async (command) => {
29926
29657
  if (deps.offline)
@@ -29992,7 +29723,7 @@ var accountService = /* @__PURE__ */ __name((deps) => {
29992
29723
  };
29993
29724
  }, "accountService");
29994
29725
 
29995
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/domain/send-time.js
29726
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/domain/send-time.js
29996
29727
  var sendTime = /* @__PURE__ */ __name((value, now = Date.now(), flag = "--at-time", zone) => {
29997
29728
  const at = aheadOf(value, flag, now, {
29998
29729
  ...zone === void 0 ? {} : { zone },
@@ -30003,7 +29734,7 @@ var sendTime = /* @__PURE__ */ __name((value, now = Date.now(), flag = "--at-tim
30003
29734
  return new Date(at - at % MINUTE).toISOString();
30004
29735
  }, "sendTime");
30005
29736
 
30006
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/admin.js
29737
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/admin.js
30007
29738
  var recordMembership = /* @__PURE__ */ __name(async (deps, operationId, done2, change, fix, write) => {
30008
29739
  try {
30009
29740
  const held = await accountStoreIfOpen(deps);
@@ -30034,9 +29765,9 @@ var adminService = /* @__PURE__ */ __name((deps) => {
30034
29765
  }, "create"),
30035
29766
  join: /* @__PURE__ */ __name(async (link4) => {
30036
29767
  const connection = await online("chats join");
30037
- const join14 = capability(connection, "join", "join a chat by its link");
29768
+ const join13 = capability(connection, "join", "join a chat by its link");
30038
29769
  const operationId = newOperationId();
30039
- const joined = await guardedWrite(deps.guard, { operationId, chatId: null, kind: "chat", action: "join" }, () => join14(link4.trim()), (answer) => "requested" in answer ? {} : { chatId: answer.id });
29770
+ const joined = await guardedWrite(deps.guard, { operationId, chatId: null, kind: "chat", action: "join" }, () => join13(link4.trim()), (answer) => "requested" in answer ? {} : { chatId: answer.id });
30040
29771
  if ("requested" in joined)
30041
29772
  return { operationId, requested: true };
30042
29773
  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`;
@@ -30122,17 +29853,17 @@ var adminService = /* @__PURE__ */ __name((deps) => {
30122
29853
  }));
30123
29854
  return { operationId, chatId, ...made };
30124
29855
  }, "createLink"),
30125
- requests: /* @__PURE__ */ __name(async (chat, window3) => {
29856
+ requests: /* @__PURE__ */ __name(async (chat, window2) => {
30126
29857
  if (deps.offline)
30127
29858
  throw new CliError("validation_error", "join requests are read from the messenger; not with --offline");
30128
- if (window3.search !== void 0 && window3.link !== void 0)
29859
+ if (window2.search !== void 0 && window2.link !== void 0)
30129
29860
  throw new CliError("validation_error", "a name and a link narrow the list two ways; use one");
30130
- if (window3.search?.trim() === "" || window3.link?.trim() === "")
29861
+ if (window2.search?.trim() === "" || window2.link?.trim() === "")
30131
29862
  throw new CliError("validation_error", "a name or a link needs a value");
30132
29863
  const connection = await deps.connection();
30133
29864
  const list2 = capability(connection, "joinRequests", "read join requests");
30134
29865
  const { id: chatId } = await connection.resolve(chat);
30135
- return { chatId, ...await list2(chatId, window3) };
29866
+ return { chatId, ...await list2(chatId, window2) };
30136
29867
  }, "requests"),
30137
29868
  answerRequest: /* @__PURE__ */ __name(async (chat, person, accept) => {
30138
29869
  const connection = await online(`chats requests ${accept ? "accept" : "decline"}`);
@@ -30165,13 +29896,13 @@ var adminService = /* @__PURE__ */ __name((deps) => {
30165
29896
  }, () => answerAll(chatId, accept, link4));
30166
29897
  return { operationId, chatId, accepted: accept, counted: counted2 };
30167
29898
  }, "answerAllRequests"),
30168
- links: /* @__PURE__ */ __name(async (chat, window3) => {
29899
+ links: /* @__PURE__ */ __name(async (chat, window2) => {
30169
29900
  if (deps.offline)
30170
29901
  throw new CliError("validation_error", "invite links are read from the messenger; not with --offline");
30171
29902
  const connection = await deps.connection();
30172
29903
  const list2 = capability(connection, "inviteLinks", "list invite links");
30173
29904
  const { id: chatId } = await connection.resolve(chat);
30174
- return { chatId, ...await list2(chatId, window3) };
29905
+ return { chatId, ...await list2(chatId, window2) };
30175
29906
  }, "links"),
30176
29907
  revokeLink: /* @__PURE__ */ __name(async (chat, link4) => {
30177
29908
  if (link4.trim() === "")
@@ -30250,7 +29981,7 @@ var linkLimits = /* @__PURE__ */ __name(({ approval, expires, maxUses }) => {
30250
29981
  return expires === void 0 ? void 0 : sendTime(expires, Date.now(), "--expire-time");
30251
29982
  }, "linkLimits");
30252
29983
 
30253
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/archive-gaps.js
29984
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/archive-gaps.js
30254
29985
  import { createHash as createHash8, randomUUID as randomUUID4 } from "node:crypto";
30255
29986
  var GAP_BOUNDS = { maxGaps: 5, limit: 500, timeMs: 3e4 };
30256
29987
  var validateRepair = /* @__PURE__ */ __name((messenger, options2) => {
@@ -30387,12 +30118,12 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
30387
30118
  return { plan, repair };
30388
30119
  }, "gapsService");
30389
30120
 
30390
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/attachments.js
30121
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/attachments.js
30391
30122
  import { createHash as createHash11 } from "node:crypto";
30392
30123
  import { constants as constants2, mkdirSync as mkdirSync2 } from "node:fs";
30393
30124
  import { lstat as lstat5, open as open6, readFile as readFile2, stat as stat2 } from "node:fs/promises";
30394
30125
 
30395
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/attachments/directory.js
30126
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/attachments/directory.js
30396
30127
  import { lstat as lstat2, readdir as readdir2, realpath as realpath3 } from "node:fs/promises";
30397
30128
  import { basename as basename5, join as join10, relative as relative2, sep as sep2 } from "node:path";
30398
30129
  var MAX_FILES = 1e4;
@@ -31089,10 +30820,10 @@ var PNMTypes = {
31089
30820
  PF: "pfm"
31090
30821
  };
31091
30822
  var handlers = {
31092
- default: /* @__PURE__ */ __name((lines3) => {
30823
+ default: /* @__PURE__ */ __name((lines) => {
31093
30824
  let dimensions = [];
31094
- while (lines3.length > 0) {
31095
- const line3 = lines3.shift();
30825
+ while (lines.length > 0) {
30826
+ const line3 = lines.shift();
31096
30827
  if (line3[0] === "#") {
31097
30828
  continue;
31098
30829
  }
@@ -31107,10 +30838,10 @@ var handlers = {
31107
30838
  }
31108
30839
  throw new TypeError("Invalid PNM");
31109
30840
  }, "default"),
31110
- pam: /* @__PURE__ */ __name((lines3) => {
30841
+ pam: /* @__PURE__ */ __name((lines) => {
31111
30842
  const size2 = {};
31112
- while (lines3.length > 0) {
31113
- const line3 = lines3.shift();
30843
+ while (lines.length > 0) {
30844
+ const line3 = lines.shift();
31114
30845
  if (line3.length > 16 || line3.charCodeAt(0) > 128) {
31115
30846
  continue;
31116
30847
  }
@@ -31136,9 +30867,9 @@ var PNM = {
31136
30867
  calculate(input) {
31137
30868
  const signature = toUTF8String(input, 0, 2);
31138
30869
  const type = PNMTypes[signature];
31139
- const lines3 = toUTF8String(input, 3).split(/[\r\n]+/);
30870
+ const lines = toUTF8String(input, 3).split(/[\r\n]+/);
31140
30871
  const handler = handlers[type] || handlers.default;
31141
- return handler(lines3);
30872
+ return handler(lines);
31142
30873
  }
31143
30874
  };
31144
30875
 
@@ -31504,7 +31235,7 @@ function imageSize(input) {
31504
31235
  }
31505
31236
  __name(imageSize, "imageSize");
31506
31237
 
31507
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/attachments/ocr.js
31238
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/attachments/ocr.js
31508
31239
  var MAX_PAGES = 20;
31509
31240
  var MAX_PIXELS = 2e7;
31510
31241
  var cancelled2 = /* @__PURE__ */ __name((signal) => {
@@ -31664,7 +31395,7 @@ var ocrPdf = /* @__PURE__ */ __name(async (bytes2, pipeline2, load, signal) => {
31664
31395
  }
31665
31396
  }, "ocrPdf");
31666
31397
 
31667
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/attachments/pdf-preview.js
31398
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/attachments/pdf-preview.js
31668
31399
  var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = importEngine, env = process.env) => {
31669
31400
  const limits = pdfPreviewLimits(env);
31670
31401
  const cancelled3 = /* @__PURE__ */ __name(() => {
@@ -31741,7 +31472,7 @@ var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = impo
31741
31472
  }
31742
31473
  }, "pdfPreview");
31743
31474
 
31744
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/attachments/picture-reading.js
31475
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/attachments/picture-reading.js
31745
31476
  import { spawn } from "node:child_process";
31746
31477
  import { mkdtempSync, readFileSync as readFileSync2, rmSync, writeFileSync as writeFileSync2 } from "node:fs";
31747
31478
  import { tmpdir } from "node:os";
@@ -31904,7 +31635,7 @@ Read the attached picture.`,
31904
31635
  }
31905
31636
  }, "readPictureWithAgent");
31906
31637
 
31907
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/attachments/transfer.js
31638
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/attachments/transfer.js
31908
31639
  import { createHash as createHash9 } from "node:crypto";
31909
31640
  import { constants } from "node:fs";
31910
31641
  import { lstat as lstat3, open as open5 } from "node:fs/promises";
@@ -32012,7 +31743,7 @@ var transferMime = /* @__PURE__ */ __name((head, hint, name = null) => {
32012
31743
  return hint !== null && /^[a-z0-9.+-]+\/[a-z0-9.+-]+$/i.test(hint) ? hint : "application/octet-stream";
32013
31744
  }, "transferMime");
32014
31745
 
32015
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/file-download.js
31746
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/file-download.js
32016
31747
  import { createWriteStream, mkdirSync } from "node:fs";
32017
31748
  import { link as link3, rm } from "node:fs/promises";
32018
31749
  import { join as join12, resolve as resolve6 } from "node:path";
@@ -32126,7 +31857,7 @@ var save = /* @__PURE__ */ __name(async (file, directory2, fallbackName, { uniqu
32126
31857
  }
32127
31858
  }, "save");
32128
31859
 
32129
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/pictures.js
31860
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/pictures.js
32130
31861
  import { createHash as createHash10 } from "node:crypto";
32131
31862
  import { lstat as lstat4, readFile } from "node:fs/promises";
32132
31863
  import { setTimeout as sleep4 } from "node:timers/promises";
@@ -32170,7 +31901,7 @@ var picturesService = /* @__PURE__ */ __name((deps) => {
32170
31901
  const directory2 = imageModelsDirectory(deps.env);
32171
31902
  if (!isImageModelInstalled(model2, directory2))
32172
31903
  throw new CliError("not_found", missingModel(model2.id), { reason: "model.not-downloaded", model: model2.id });
32173
- const { openPictureEmbedder } = await import("./embedder-BCUT7KKV.js");
31904
+ const { openPictureEmbedder } = await import("./embedder-4PE67CLX.js");
32174
31905
  return openPictureEmbedder(model2, directory2);
32175
31906
  }, "open");
32176
31907
  const embedder = /* @__PURE__ */ __name(() => {
@@ -32344,7 +32075,7 @@ var withPictures = /* @__PURE__ */ __name((messages, pictures) => ({
32344
32075
  }, "search")
32345
32076
  }), "withPictures");
32346
32077
 
32347
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/attachments.js
32078
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/attachments.js
32348
32079
  var ATTACHMENT_QUERY = {
32349
32080
  entity: "attachment",
32350
32081
  backend: "sql",
@@ -32433,7 +32164,7 @@ var keep = /* @__PURE__ */ __name(async (store, file, extraction, bytes2, sha) =
32433
32164
  });
32434
32165
  }
32435
32166
  }, "keep");
32436
- var itemOf2 = /* @__PURE__ */ __name((account, view) => ({
32167
+ var itemOf = /* @__PURE__ */ __name((account, view) => ({
32437
32168
  message: formatLocator({ ...account, chat: view.chatId, message: view.messageId }),
32438
32169
  kind: view.kind,
32439
32170
  position: view.position + 1,
@@ -32655,13 +32386,13 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
32655
32386
  }
32656
32387
  const where = query ? queryFilter(query, attachmentColumns(chats), { command: "attachments list", zone: timezoneOf() }) : void 0;
32657
32388
  const views = await store.attachments.attachments({ ...where ? { where } : {}, offset, limit: limit + 1 });
32658
- return { items: views.slice(0, limit).map((view) => itemOf2(account, view)), hasMore: views.length > limit };
32389
+ return { items: views.slice(0, limit).map((view) => itemOf(account, view)), hasMore: views.length > limit };
32659
32390
  }, "list"),
32660
- show: /* @__PURE__ */ __name(async ({ chat, message, attachment: attachment2, page, load, ...window3 }) => {
32661
- validateWindow(window3);
32391
+ show: /* @__PURE__ */ __name(async ({ chat, message, attachment: attachment2, page, load, ...window2 }) => {
32392
+ validateWindow(window2);
32662
32393
  if (page !== void 0 && (!Number.isSafeInteger(page) || page < 1))
32663
32394
  throw new CliError("validation_error", "PDF page must be a position from 1");
32664
- if (page !== void 0 && (window3.offsetBytes !== void 0 || window3.chunkBytes !== void 0))
32395
+ if (page !== void 0 && (window2.offsetBytes !== void 0 || window2.chunkBytes !== void 0))
32665
32396
  throw new CliError("validation_error", "PDF page cannot be combined with byte offset or chunk size");
32666
32397
  if (attachment2 !== void 0 && (!Number.isSafeInteger(attachment2) || attachment2 < 1))
32667
32398
  throw new CliError("validation_error", "attachment must be a position from 1");
@@ -32676,13 +32407,13 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
32676
32407
  throw new CliError("not_found", "download this attachment before transferring it");
32677
32408
  if (refusedPlace(chosen.localPath, deps.messenger.app, deps.env ?? process.env))
32678
32409
  throw new CliError("validation_error", "cannot transfer known credential files, the WireCat apps' own files or the message store");
32679
- const { head, capturedFile, ...bytes2 } = await retainedBytes(chosen.localPath, window3, page !== void 0, deps.env);
32410
+ const { head, capturedFile, ...bytes2 } = await retainedBytes(chosen.localPath, window2, page !== void 0, deps.env);
32680
32411
  const mimeType = transferMime(head, null, chosen.name);
32681
32412
  let preview = {};
32682
32413
  if (page !== void 0) {
32683
32414
  if (mimeType !== "application/pdf" || !capturedFile)
32684
32415
  throw new CliError("validation_error", "page preview requires a retained PDF");
32685
- const rendered = await pdfPreview(capturedFile, page, window3.signal, load, deps.env);
32416
+ const rendered = await pdfPreview(capturedFile, page, window2.signal, load, deps.env);
32686
32417
  preview = {
32687
32418
  mimeType: "image/png",
32688
32419
  totalBytes: rendered.bytes.length,
@@ -32815,7 +32546,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
32815
32546
  }, "readPicture")
32816
32547
  }), "attachmentsService");
32817
32548
 
32818
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/chat-documents.js
32549
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/chat-documents.js
32819
32550
  var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
32820
32551
  list: /* @__PURE__ */ __name(async (chat, { limit, offset, ref }) => {
32821
32552
  const store = await accountStore(deps);
@@ -32845,7 +32576,7 @@ var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
32845
32576
  }, "list")
32846
32577
  }), "chatDocumentsService");
32847
32578
 
32848
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/retention.js
32579
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/retention.js
32849
32580
  var observationDuration = /* @__PURE__ */ __name((text2, flag) => {
32850
32581
  const match = /^(\d+(?:\.\d+)?)([smhdw])$/.exec(text2);
32851
32582
  const units2 = { s: 1e3, m: 6e4, h: 36e5, d: 864e5, w: 6048e5 };
@@ -32858,15 +32589,15 @@ var retentionService = /* @__PURE__ */ __name((deps) => ({
32858
32589
  report: /* @__PURE__ */ __name(async (chat, query = {}) => {
32859
32590
  const cutoff = Date.now();
32860
32591
  const zone = timezoneOf(query.timezone);
32861
- const window3 = dateWindow({
32592
+ const window2 = dateWindow({
32862
32593
  ...query.sinceTime === void 0 ? {} : { sinceTime: query.sinceTime },
32863
32594
  ...query.untilTime === void 0 ? {} : { untilTime: query.untilTime },
32864
32595
  zone,
32865
32596
  now: cutoff
32866
32597
  });
32867
32598
  const options2 = {
32868
- since: window3.since ?? cutoff - 90 * 864e5,
32869
- until: window3.until ?? cutoff,
32599
+ since: window2.since ?? cutoff - 90 * 864e5,
32600
+ until: window2.until ?? cutoff,
32870
32601
  cutoff,
32871
32602
  checkpoints: (query.checkpoints ?? "1d,7d,30d").split(",").map((one) => observationDuration(one.trim(), "--checkpoints")),
32872
32603
  within: observationDuration(query.within ?? "7d", "--within"),
@@ -32892,7 +32623,7 @@ var retentionService = /* @__PURE__ */ __name((deps) => ({
32892
32623
  })),
32893
32624
  account,
32894
32625
  report: "retention",
32895
- timeMeta: window3.meta
32626
+ timeMeta: window2.meta
32896
32627
  };
32897
32628
  }, "report"),
32898
32629
  evidence: /* @__PURE__ */ __name(async (target2, reference, selection, query) => {
@@ -32932,7 +32663,7 @@ var isRetentionSelection = /* @__PURE__ */ __name((selection) => {
32932
32663
  }
32933
32664
  }, "isRetentionSelection");
32934
32665
 
32935
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/counters.js
32666
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/counters.js
32936
32667
  var counterFields = /* @__PURE__ */ __name((text2 = "views,reactions,comments") => {
32937
32668
  const fields = text2.split(",").map((one) => one.trim());
32938
32669
  if (!fields.length || fields.some((one) => !COUNTER_FIELDS.includes(one)) || new Set(fields).size !== fields.length)
@@ -33139,7 +32870,7 @@ var countersService = /* @__PURE__ */ __name((deps) => {
33139
32870
  };
33140
32871
  }, "countersService");
33141
32872
 
33142
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/search-refresh.js
32873
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/search-refresh.js
33143
32874
  var SYNC_KEY = "messages.sync-first";
33144
32875
  var SYNC_BOUNDS = { maxChats: 5, timeMs: 3e4, maxMessages: 500 };
33145
32876
  var keyOf3 = /* @__PURE__ */ __name((chat) => JSON.stringify([chat.account.provider, chat.account.account, chat.chatId]), "keyOf");
@@ -33271,11 +33002,18 @@ var withRefresh = /* @__PURE__ */ __name((found, refreshed) => ({
33271
33002
  ...!refreshed || refreshed.complete ? {} : { coverage: { ...found.coverage, state: "stale" } }
33272
33003
  }), "withRefresh");
33273
33004
 
33274
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/embeddings-search.js
33005
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/embeddings-search.js
33275
33006
  var CANDIDATES = 50;
33276
33007
  var ACROSS_CHATS = 500;
33008
+ var OWN_BLOCK = 5;
33277
33009
  var PER_CHAT = 20;
33010
+ var BIG_CHAT = 100;
33278
33011
  var WORD_HITS = 200;
33012
+ var SHOWN_LINES = 3;
33013
+ var SHOWN_CHARS = 200;
33014
+ var SHOWN_HEAD = 80;
33015
+ var CHUNK_READ = 60;
33016
+ var REPLIES_READ = 60;
33279
33017
  var RRF_K3 = 60;
33280
33018
  var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
33281
33019
  const command = deps.messenger.app.command;
@@ -33294,6 +33032,7 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
33294
33032
  }, deps.messenger);
33295
33033
  const { items } = await store.queries.matchQuery({
33296
33034
  ...lexical.execution,
33035
+ rareWordsFirst: true,
33297
33036
  ...prepared.selectedChat ? {} : { perChat: PER_CHAT },
33298
33037
  ...prepared.selectedChat ? { chat: prepared.selectedChat } : {},
33299
33038
  ...conversations === void 0 ? {} : { conversationIds: conversations },
@@ -33376,11 +33115,13 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
33376
33115
  });
33377
33116
  return { hits, outside, sources, respellings };
33378
33117
  }, "byWords");
33379
- const search = /* @__PURE__ */ __name(async (query, { chat, model: choice, since, limit, filter, source, timezone, syncFirst, signal, refresh, timeLimitMs }) => {
33118
+ const search = /* @__PURE__ */ __name(async (query, { chat, model: choice, since, limit, filter, source, timezone, syncFirst, signal, refresh, timeLimitMs, like }) => {
33380
33119
  if (!query.trim())
33381
33120
  searchError("query.invalid-syntax", { start: 0, end: query.length }, "give words to search for");
33382
33121
  if (new TextEncoder().encode(query).length > QUERY_LIMITS.bytes)
33383
33122
  searchError("query.too-large", { start: 0, end: query.length }, "query is longer than 8 KiB");
33123
+ if (like !== void 0 && new TextEncoder().encode(like).length > QUERY_LIMITS.bytes)
33124
+ throw new CliError("validation_error", "--like is longer than 8 KiB: one sentence is enough");
33384
33125
  const refreshed = await refreshSearch(deps, {
33385
33126
  chat,
33386
33127
  limit,
@@ -33419,42 +33160,59 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
33419
33160
  respellings: /* @__PURE__ */ new Map()
33420
33161
  };
33421
33162
  });
33422
- const meaning = [];
33163
+ const texts = like?.trim() ? [query, like] : [query];
33164
+ const meaning = texts.map(() => []);
33165
+ const own = [];
33423
33166
  const sources = words3.sources;
33424
33167
  if (target2.installed && prepared.scopeAccounts.length && eligibility?.conversations.length !== 0) {
33425
33168
  await withEmbedder(deps, target2, choice, {}, async (embedder) => {
33426
- const [vector] = await embedder.embed([query], "query");
33427
- for (const one of prepared.scopeAccounts) {
33428
- const scope = scopeOf5(one);
33429
- if (scope === null)
33430
- continue;
33431
- const whole2 = "chatId" in scope || one.provider === MAIL;
33432
- const hits = await store.vectors.nearestConversations(one, {
33433
- ...scope,
33434
- ...since === void 0 ? {} : { since },
33435
- model: target2.key,
33436
- limit: whole2 ? Math.max(limit, CANDIDATES) : Math.max(limit, ACROSS_CHATS),
33437
- query: vector,
33438
- ...eligibility ? { conversations: eligibility.conversations } : {}
33439
- });
33440
- const images = await store.vectors.nearestImages(one, {
33441
- ...scope,
33442
- ...since === void 0 ? {} : { since },
33443
- model: target2.key,
33444
- limit: Math.max(limit, CANDIDATES),
33445
- query: vector
33446
- });
33447
- const found = [
33448
- ...hits,
33449
- ...images.filter((hit) => !eligibility || eligibility.conversations.includes(hit.summary.id))
33450
- ].sort((a, b) => b.score - a.score);
33451
- for (const hit of found)
33452
- sources.set(hit.summary.id, one);
33453
- meaning.push(...whole2 ? found.map((hit) => ({ hit, lead: hit.score })) : shared(found, limit));
33454
- }
33169
+ const vectors = await embedder.embed(texts, "query");
33170
+ for (const [at, vector] of vectors.entries())
33171
+ for (const one of prepared.scopeAccounts) {
33172
+ const scope = scopeOf5(one);
33173
+ if (scope === null)
33174
+ continue;
33175
+ const whole2 = "chatId" in scope || one.provider === MAIL;
33176
+ const hits2 = await store.vectors.nearestConversations(one, {
33177
+ ...scope,
33178
+ ...since === void 0 ? {} : { since },
33179
+ model: target2.key,
33180
+ limit: whole2 ? Math.max(limit, CANDIDATES) : Math.max(limit, ACROSS_CHATS),
33181
+ query: vector,
33182
+ ...eligibility ? { conversations: eligibility.conversations } : {}
33183
+ });
33184
+ const images = at > 0 ? [] : await store.vectors.nearestImages(one, {
33185
+ ...scope,
33186
+ ...since === void 0 ? {} : { since },
33187
+ model: target2.key,
33188
+ limit: Math.max(limit, CANDIDATES),
33189
+ query: vector
33190
+ });
33191
+ const found = [
33192
+ ...hits2,
33193
+ ...images.filter((hit) => !eligibility || eligibility.conversations.includes(hit.summary.id))
33194
+ ].sort((a, b) => b.score - a.score);
33195
+ const mine = at > 0 ? [] : await store.vectors.nearestConversations(one, {
33196
+ ...scope,
33197
+ ...since === void 0 ? {} : { since },
33198
+ model: target2.key,
33199
+ limit: OWN_BLOCK,
33200
+ query: vector,
33201
+ fromOwner: true,
33202
+ ...eligibility ? { conversations: eligibility.conversations } : {}
33203
+ });
33204
+ for (const hit of found)
33205
+ sources.set(hit.summary.id, one);
33206
+ for (const hit of mine) {
33207
+ sources.set(hit.summary.id, one);
33208
+ own.push(hit);
33209
+ }
33210
+ meaning[at]?.push(...whole2 ? found.map((hit) => ({ hit, lead: hit.score })) : shared(found, limit));
33211
+ }
33455
33212
  });
33456
33213
  }
33457
- meaning.sort((a, b) => b.lead - a.lead);
33214
+ for (const list2 of meaning)
33215
+ list2.sort((a, b) => b.lead - a.lead);
33458
33216
  const scoped = [];
33459
33217
  const elsewhere = [];
33460
33218
  for (const one of prepared.scopeAccounts) {
@@ -33475,20 +33233,54 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
33475
33233
  ].sort();
33476
33234
  if (scoped.length > 1)
33477
33235
  readiness.scopes = scoped;
33236
+ const located = /* @__PURE__ */ __name((hit) => {
33237
+ const source2 = sources.get(hit.summary.id);
33238
+ return {
33239
+ ...hit,
33240
+ source: source2,
33241
+ locator: formatLocator({ ...source2, chat: hit.summary.chatId, message: hit.chunk.firstMessageId })
33242
+ };
33243
+ }, "located");
33244
+ const hits = fused(meaning.map((list2) => list2.map(({ hit }) => hit)), words3.hits, meaningFloor(target2.key)).slice(0, limit).map(located);
33245
+ const shown = new Set(hits.map((hit) => hit.summary.id));
33246
+ const ownOf = /* @__PURE__ */ __name((keep2) => own.filter(keep2).sort((a, b) => b.score - a.score).slice(0, OWN_BLOCK).map((hit) => located({ ...hit, by: ["meaning"] })), "ownOf");
33247
+ const ownHits = ownOf((hit) => !shown.has(hit.summary.id));
33248
+ const ownSpare = ownOf((hit) => shown.has(hit.summary.id));
33249
+ const asked = wordStems(query);
33250
+ const stems = [...asked, ...wordStems(texts.join(" "))];
33251
+ const replies = (async () => {
33252
+ const found = /* @__PURE__ */ new Map();
33253
+ const bySource = /* @__PURE__ */ new Map();
33254
+ for (const hit of [...hits, ...ownHits, ...ownSpare]) {
33255
+ const source2 = hit.source ?? account;
33256
+ const group = bySource.get(JSON.stringify(source2)) ?? { source: source2, hits: [] };
33257
+ group.hits.push(hit);
33258
+ bySource.set(JSON.stringify(source2), group);
33259
+ }
33260
+ for (const { source: source2, hits: group } of bySource.values()) {
33261
+ const read = await store.conversations.chunkReplies(source2, group.map(({ summary, chunk }) => ({ conversationId: summary.id, ...chunk })), REPLIES_READ);
33262
+ for (const [index, hit] of group.entries())
33263
+ found.set(hit, read[index] ?? []);
33264
+ }
33265
+ return found;
33266
+ })();
33267
+ const withLines = /* @__PURE__ */ __name(async (hit, ownFirst) => {
33268
+ const read = await store.conversations.chunkMessages(hit.source ?? account, hit.summary.id, hit.chunk, CHUNK_READ);
33269
+ const lines = [
33270
+ ...shownLines(read, stems, ownFirst, asked),
33271
+ ...shownLines((await replies).get(hit) ?? [], stems, false, [], 1)
33272
+ ];
33273
+ return lines.length ? { ...hit, lines } : hit;
33274
+ }, "withLines");
33478
33275
  return {
33479
33276
  accounts: prepared.scopeAccounts,
33480
33277
  model: target2.id,
33481
33278
  meaning: target2.installed ? "searched" : "unavailable",
33482
33279
  ...wordsOutOfTime ? { words: "out-of-time" } : {},
33483
33280
  ...words3.respellings.size ? { respelled: Object.fromEntries(words3.respellings) } : {},
33484
- hits: fused(meaning.map(({ hit }) => hit), words3.hits, meaningFloor(target2.key)).slice(0, limit).map((hit) => {
33485
- const source2 = sources.get(hit.summary.id);
33486
- return {
33487
- ...hit,
33488
- source: source2,
33489
- locator: formatLocator({ ...source2, chat: hit.summary.chatId, message: hit.chunk.firstMessageId })
33490
- };
33491
- }),
33281
+ hits: await Promise.all(hits.map((hit) => withLines(hit, false))),
33282
+ ...ownHits.length ? { own: await Promise.all(ownHits.map((hit) => withLines(hit, true))) } : {},
33283
+ ...ownSpare.length ? { ownSpare: await Promise.all(ownSpare.map((hit) => withLines(hit, true))) } : {},
33492
33284
  readiness,
33493
33285
  ...locallyRefreshed ? { prepared: locallyRefreshed } : {},
33494
33286
  ...refreshed ? { refreshed, coverage: { state: refreshed.complete ? "partial" : "stale" } } : {},
@@ -33498,7 +33290,7 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
33498
33290
  return {
33499
33291
  /** Over every chat, a query that names someone by a name their private chat uses has that chat's hits first. */
33500
33292
  search: /* @__PURE__ */ __name(async (query, options2) => {
33501
- const found = await search(query, options2);
33293
+ const { ownSpare, ...found } = await search(query, options2);
33502
33294
  if (options2.chat !== void 0 || options2.filter !== void 0 || found.accounts?.length !== 1)
33503
33295
  return found;
33504
33296
  const named2 = await namedChat(await deps.store(), await deps.account(), deps.messenger, found.accounts, queryWords2(query)).catch((error) => {
@@ -33512,10 +33304,15 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
33512
33304
  const { syncFirst: _, refresh: __, ...plain2 } = options2;
33513
33305
  const inside2 = await search(rest || query, { ...plain2, chat: named2.chatId });
33514
33306
  const shown = new Set(inside2.hits.map(({ summary }) => summary.id));
33307
+ const hits = [...inside2.hits, ...found.hits.filter(({ summary }) => !shown.has(summary.id))].slice(0, options2.limit);
33308
+ const kept2 = new Set(hits.map(({ summary }) => summary.id));
33309
+ const own = [...found.own ?? [], ...(ownSpare ?? []).filter(({ summary }) => !kept2.has(summary.id))].sort((a, b) => (b.score ?? 0) - (a.score ?? 0)).slice(0, OWN_BLOCK);
33310
+ const { own: _shown, ...plainFound } = found;
33515
33311
  return {
33516
- ...found,
33312
+ ...plainFound,
33313
+ ...own.length ? { own } : {},
33517
33314
  named: { word: named2.word, chatId: named2.chatId, title: named2.title },
33518
- hits: [...inside2.hits, ...found.hits.filter(({ summary }) => !shown.has(summary.id))].slice(0, options2.limit)
33315
+ hits
33519
33316
  };
33520
33317
  }, "search"),
33521
33318
  related: /* @__PURE__ */ __name(async (chat, message, { model: choice, limit }) => {
@@ -33555,23 +33352,32 @@ var shared = /* @__PURE__ */ __name((hits, limit) => {
33555
33352
  for (const hit of hits)
33556
33353
  chats.set(hit.summary.chatId, [...chats.get(hit.summary.chatId) ?? [], hit]);
33557
33354
  return [...chats.values()].flatMap((own) => {
33558
- const level = own[Math.min(PER_CHAT, own.length) - 1]?.score ?? 0;
33559
- return own.slice(0, Math.max(limit, PER_CHAT)).map((hit) => ({ hit, lead: hit.score - level }));
33355
+ const share = own.length >= BIG_CHAT ? BIG_CHAT : PER_CHAT;
33356
+ const level = own[Math.min(share, own.length) - 1]?.score ?? 0;
33357
+ return own.slice(0, Math.max(limit, share)).map((hit, at) => ({ hit, lead: share > PER_CHAT && at >= PER_CHAT ? hit.score - 10 : hit.score - level }));
33560
33358
  });
33561
33359
  }, "shared");
33562
33360
  var fused = /* @__PURE__ */ __name((meaning, words3, minimumCosine) => {
33563
33361
  const merged2 = /* @__PURE__ */ new Map();
33564
- meaning.filter(({ score }) => score > minimumCosine).forEach(({ summary, chunk, score, stale, matchedIn }, index) => {
33565
- merged2.set(matchedIn ? `${summary.id}#${chunk.firstMessageId}` : summary.id, {
33566
- summary,
33567
- chunk,
33568
- score,
33569
- by: ["meaning"],
33570
- stale,
33571
- ...matchedIn ? { matchedIn } : {},
33572
- fused: 1 / (RRF_K3 + index + 1)
33362
+ for (const list2 of meaning)
33363
+ list2.filter(({ score }) => score > minimumCosine).forEach(({ summary, chunk, score, stale, matchedIn }, index) => {
33364
+ const key = matchedIn ? `${summary.id}#${chunk.firstMessageId}` : summary.id;
33365
+ const share = 1 / (RRF_K3 + index + 1);
33366
+ const held = merged2.get(key);
33367
+ if (!held) {
33368
+ merged2.set(key, {
33369
+ summary,
33370
+ chunk,
33371
+ score,
33372
+ by: ["meaning"],
33373
+ stale,
33374
+ ...matchedIn ? { matchedIn } : {},
33375
+ fused: share
33376
+ });
33377
+ return;
33378
+ }
33379
+ held.fused += share;
33573
33380
  });
33574
- });
33575
33381
  words3.forEach(({ summary, chunk }, index) => {
33576
33382
  const share = 1 / (RRF_K3 + index + 1);
33577
33383
  const held = merged2.get(summary.id);
@@ -33583,6 +33389,35 @@ var fused = /* @__PURE__ */ __name((meaning, words3, minimumCosine) => {
33583
33389
  });
33584
33390
  return [...merged2.values()].sort((a, b) => b.fused - a.fused || (b.score ?? -2) - (a.score ?? -2)).map(({ fused: _, ...hit }) => hit);
33585
33391
  }, "fused");
33392
+ var wordStems = /* @__PURE__ */ __name((text2) => [...new Set(queryWords2(text2).map((word) => word.slice(0, 5)))], "wordStems");
33393
+ var shownLines = /* @__PURE__ */ __name((read, stems, ownFirst, asked, count3 = SHOWN_LINES) => {
33394
+ const scored = read.map(({ text: text2, ...line3 }, at) => {
33395
+ const flat = text2.replace(/\s+/g, " ").trim();
33396
+ const lower = flat.toLowerCase();
33397
+ const found = stems.filter((stem) => lower.includes(stem));
33398
+ const first2 = found.reduce((least, stem) => Math.min(least, lower.indexOf(stem)), Number.POSITIVE_INFINITY);
33399
+ return { ...line3, flat, at, score: found.length + (ownFirst && line3.outgoing ? 100 : 0), first: first2 };
33400
+ });
33401
+ const picked = [...scored].sort((a, b) => b.score - a.score || a.at - b.at).slice(0, count3);
33402
+ const matches = /* @__PURE__ */ __name((flat) => asked.filter((stem) => flat.toLowerCase().includes(stem)).length, "matches");
33403
+ const asking = scored.reduce((best, line3) => matches(line3.flat) > (best ? matches(best.flat) : 0) ? line3 : best, void 0);
33404
+ const reply = asking && scored[asking.at + 1];
33405
+ if (reply && !picked.includes(reply))
33406
+ picked.push(reply);
33407
+ return picked.sort((a, b) => a.at - b.at).map(({ sender, flat, outgoing, first: first2 }) => {
33408
+ const who = outgoing ? `${sender ?? "you"}${sender ? " (you)" : ""}: ` : sender ? `${sender}: ` : "";
33409
+ return `${who}${cutAround(flat, first2)}`;
33410
+ });
33411
+ }, "shownLines");
33412
+ var cutAround = /* @__PURE__ */ __name((flat, first2) => {
33413
+ if (flat.length <= SHOWN_CHARS)
33414
+ return flat;
33415
+ if (!Number.isFinite(first2) || first2 < SHOWN_CHARS - 25)
33416
+ return `${flat.slice(0, SHOWN_CHARS)}\u2026`;
33417
+ const tail = SHOWN_CHARS - SHOWN_HEAD;
33418
+ const from = Math.min(first2 - 30, flat.length - tail);
33419
+ return `${flat.slice(0, SHOWN_HEAD)}\u2026${flat.slice(from, from + tail)}${from + tail < flat.length ? "\u2026" : ""}`;
33420
+ }, "cutAround");
33586
33421
  var searchReadiness = /* @__PURE__ */ __name((chats, meaning, outside) => {
33587
33422
  const built = new Set(chats.filter(({ state }) => state !== "not-built").map(({ chat }) => chat));
33588
33423
  const ids = /* @__PURE__ */ __name((keep2) => chats.filter(keep2).map(({ chat }) => chat), "ids");
@@ -33607,13 +33442,13 @@ var meanOf = /* @__PURE__ */ __name((vectors) => {
33607
33442
  return mean2.map((value) => value / length);
33608
33443
  }, "meanOf");
33609
33444
 
33610
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/embeddings.js
33445
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/embeddings.js
33611
33446
  var embeddingsService = /* @__PURE__ */ __name((deps) => ({
33612
33447
  ...embeddingsMaintenance(deps),
33613
33448
  ...embeddingsSearch(deps)
33614
33449
  }), "embeddingsService");
33615
33450
 
33616
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/folders.js
33451
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/folders.js
33617
33452
  var foldersService = /* @__PURE__ */ __name((deps) => {
33618
33453
  const online = /* @__PURE__ */ __name(async (command) => {
33619
33454
  if (deps.offline)
@@ -33746,15 +33581,15 @@ var foldersService = /* @__PURE__ */ __name((deps) => {
33746
33581
  if (link4.trim() === "")
33747
33582
  throw new CliError("validation_error", "give the folder's link");
33748
33583
  const connection = await online("chats folders join");
33749
- const join14 = capability(connection, "joinFolder", "join a shared folder");
33584
+ const join13 = capability(connection, "joinFolder", "join a shared folder");
33750
33585
  const operationId = newOperationId();
33751
- const folder = await guardedWrite(deps.guard, { operationId, chatId: null, kind: "account", action: "folder-join" }, () => join14(link4.trim()));
33586
+ const folder = await guardedWrite(deps.guard, { operationId, chatId: null, kind: "account", action: "folder-join" }, () => join13(link4.trim()));
33752
33587
  return { operationId, folder };
33753
33588
  }, "join")
33754
33589
  };
33755
33590
  }, "foldersService");
33756
33591
 
33757
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/mentions.js
33592
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/mentions.js
33758
33593
  var REVIEW_COUNT = 500;
33759
33594
  var mentionsService = /* @__PURE__ */ __name((deps) => {
33760
33595
  const located = /* @__PURE__ */ __name(async () => {
@@ -33768,7 +33603,7 @@ var mentionsService = /* @__PURE__ */ __name((deps) => {
33768
33603
  };
33769
33604
  }, "located");
33770
33605
  return {
33771
- domains: /* @__PURE__ */ __name(async (query, window3) => {
33606
+ domains: /* @__PURE__ */ __name(async (query, window2) => {
33772
33607
  const asked = `kind:url NOT status:dismissed${query.trim() ? ` AND (${query})` : ""}`;
33773
33608
  const ast = validateQuery(parseLucene(asked, { ...MENTION_QUERY, defaultField: "value" }), MENTION_QUERY);
33774
33609
  const links = (await (await accountStore(deps)).mentions.mentions(ast, { offset: 0 })).items;
@@ -33793,23 +33628,23 @@ var mentionsService = /* @__PURE__ */ __name((deps) => {
33793
33628
  sites.set(domain, site);
33794
33629
  }
33795
33630
  const ranked = [...sites.values()].map(({ chatIds, ...site }) => ({ ...site, chats: chatIds.size })).sort((a, b) => b.links - a.links || a.domain.localeCompare(b.domain));
33796
- const end = window3.limit === void 0 ? void 0 : window3.offset + window3.limit;
33797
- return { items: ranked.slice(window3.offset, end), hasMore: end !== void 0 && ranked.length > end };
33631
+ const end = window2.limit === void 0 ? void 0 : window2.offset + window2.limit;
33632
+ return { items: ranked.slice(window2.offset, end), hasMore: end !== void 0 && ranked.length > end };
33798
33633
  }, "domains"),
33799
- list: /* @__PURE__ */ __name(async (query, window3) => {
33634
+ list: /* @__PURE__ */ __name(async (query, window2) => {
33800
33635
  const ast = query.trim() ? validateQuery(parseLucene(query, { ...MENTION_QUERY, defaultField: "value" }), MENTION_QUERY) : void 0;
33801
33636
  const { store, mention } = await located();
33802
- const page = await store.mentions.mentions(ast, window3);
33637
+ const page = await store.mentions.mentions(ast, window2);
33803
33638
  const state = await (await deps.store()).mentions.mentionsState();
33804
33639
  return { items: page.items.map(mention), hasMore: page.hasMore, state };
33805
33640
  }, "list"),
33806
33641
  newCount: /* @__PURE__ */ __name(async (foundAfter) => {
33807
33642
  const found = parseLucene("status:found", { ...MENTION_QUERY, defaultField: "value" });
33808
- const window3 = { offset: 0, limit: REVIEW_COUNT, ...foundAfter === void 0 ? {} : { foundAfter } };
33809
- const page = await (await accountStore(deps)).mentions.mentions(found, window3);
33643
+ const window2 = { offset: 0, limit: REVIEW_COUNT, ...foundAfter === void 0 ? {} : { foundAfter } };
33644
+ const page = await (await accountStore(deps)).mentions.mentions(found, window2);
33810
33645
  return { count: page.items.length, more: page.hasMore };
33811
33646
  }, "newCount"),
33812
- places: /* @__PURE__ */ __name(async (window3) => (await deps.store()).mentions.places(window3), "places"),
33647
+ places: /* @__PURE__ */ __name(async (window2) => (await deps.store()).mentions.places(window2), "places"),
33813
33648
  show: /* @__PURE__ */ __name(async (id2) => {
33814
33649
  const { store, mention } = await located();
33815
33650
  const found = await store.mentions.mention(id2);
@@ -33833,7 +33668,7 @@ var mentionsService = /* @__PURE__ */ __name((deps) => {
33833
33668
  };
33834
33669
  }, "mentionsService");
33835
33670
 
33836
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/domain/message-link.js
33671
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/domain/message-link.js
33837
33672
  var fileLinks = /* @__PURE__ */ __name((attachments) => hitFiles(attachments).map(({ position, kind, name }) => ({
33838
33673
  position,
33839
33674
  kind,
@@ -33882,7 +33717,7 @@ var validatePermalink = /* @__PURE__ */ __name((link4) => {
33882
33717
  return { url: link4.url, access: link4.access, reason: link4.reason };
33883
33718
  }, "validatePermalink");
33884
33719
 
33885
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/domain/pin-duration.js
33720
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/domain/pin-duration.js
33886
33721
  var spokenSeconds = /* @__PURE__ */ __name((seconds) => {
33887
33722
  if (seconds % 86400 === 0 && seconds > 86400)
33888
33723
  return `${seconds / 86400}d`;
@@ -33914,7 +33749,7 @@ var pinDurationOf = /* @__PURE__ */ __name((value, allowed, flag = "--expire-tim
33914
33749
  return seconds;
33915
33750
  }, "pinDurationOf");
33916
33751
 
33917
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/meaning-model.js
33752
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/meaning-model.js
33918
33753
  var meaningModel = /* @__PURE__ */ __name(async (store, env = process.env) => {
33919
33754
  const chosen = chosenTextModel(env);
33920
33755
  if (chosen.from === "chosen" || chosen.id !== DEFAULT_TEXT_MODEL)
@@ -33929,7 +33764,7 @@ var meaningModel = /* @__PURE__ */ __name(async (store, env = process.env) => {
33929
33764
  return (counts.get(before) ?? 0) > (counts.get(now) ?? 0) ? previous.id : current.id;
33930
33765
  }, "meaningModel");
33931
33766
 
33932
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/messages-meaning.js
33767
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/messages-meaning.js
33933
33768
  var meaningText = /* @__PURE__ */ __name((question) => {
33934
33769
  try {
33935
33770
  const text2 = questionLookup(question) === void 0 ? question : questionText(question);
@@ -34008,7 +33843,7 @@ var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, sh
34008
33843
  }
34009
33844
  }, "meaningLane");
34010
33845
 
34011
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/messages-rerank.js
33846
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/messages-rerank.js
34012
33847
  var rerankLane = /* @__PURE__ */ __name((deps) => {
34013
33848
  const choice = deps.reranker ?? DEFAULT_RERANK_MODEL;
34014
33849
  if (choice === "off")
@@ -34020,9 +33855,9 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
34020
33855
  return { skipped: { reason: `${model.id} is not downloaded`, step: "models.download", model: model.id } };
34021
33856
  try {
34022
33857
  const warm = deps.embedders;
34023
- const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-I2QKOMM7.js")).openRerankerProcess(model, directory2, {
33858
+ const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-MGMXXPMY.js")).openRerankerProcess(model, directory2, {
34024
33859
  threads: defaultThreads()
34025
- })) : await (await import("./rerank-LJ3TWRNV.js")).openReranker(model, directory2);
33860
+ })) : await (await import("./rerank-F4KZQTY6.js")).openReranker(model, directory2);
34026
33861
  return {
34027
33862
  model: model.id,
34028
33863
  score: /* @__PURE__ */ __name((question, passages) => reranker.score(plainWords(question), passages), "score"),
@@ -34042,7 +33877,7 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
34042
33877
  };
34043
33878
  }, "rerankLane");
34044
33879
 
34045
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/search/question-period.js
33880
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/search/question-period.js
34046
33881
  var DAY6 = 864e5;
34047
33882
  var SPAN = { start: 0, end: 0 };
34048
33883
  var phrase = /* @__PURE__ */ __name((source) => new RegExp(`(?<![\\p{L}\\p{N}])(?:${source})(?![\\p{L}\\p{N}])`, "giu"), "phrase");
@@ -34167,17 +34002,17 @@ var questionPeriod = /* @__PURE__ */ __name((text2, now, zone) => {
34167
34002
  };
34168
34003
  }, "questionPeriod");
34169
34004
 
34170
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/document-pictures.js
34005
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/document-pictures.js
34171
34006
  var openPictureEmbedderFor = /* @__PURE__ */ __name(async ({ env, command } = {}) => {
34172
34007
  const model = imageModel(DEFAULT_IMAGE_MODEL);
34173
34008
  const directory2 = imageModelsDirectory(env);
34174
34009
  if (!isImageModelInstalled(model, directory2))
34175
34010
  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 });
34176
- const { openPictureEmbedder } = await import("./embedder-BCUT7KKV.js");
34011
+ const { openPictureEmbedder } = await import("./embedder-4PE67CLX.js");
34177
34012
  return openPictureEmbedder(model, directory2);
34178
34013
  }, "openPictureEmbedderFor");
34179
34014
 
34180
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/document-source.js
34015
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/document-source.js
34181
34016
  var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) => {
34182
34017
  const metadata = note.frontMatter;
34183
34018
  const account = accounts.find(({ id: id2 }) => String(id2) === note.folderId);
@@ -34199,7 +34034,7 @@ var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) =>
34199
34034
  };
34200
34035
  }, "documentSource");
34201
34036
 
34202
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/enrichment-setting.js
34037
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/enrichment-setting.js
34203
34038
  var SECTION2 = "enrichment";
34204
34039
  var ENRICHMENT_PROVIDERS = ["openai", "anthropic"];
34205
34040
  var DEFAULT_BASE_URLS = {
@@ -34274,7 +34109,7 @@ var costOf = /* @__PURE__ */ __name((usage, setting) => {
34274
34109
  return price ? Math.round((usage.input * price.input + usage.output * price.output) * 1e6) / 1e6 : null;
34275
34110
  }, "costOf");
34276
34111
 
34277
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/enrichment.js
34112
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/enrichment.js
34278
34113
  var ENRICH_PER_RUN = 600;
34279
34114
  var MAX_LINE = 400;
34280
34115
  var line2 = pipe(unknown(), transform((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim().slice(0, MAX_LINE) : ""));
@@ -34350,7 +34185,7 @@ var enrichmentState = /* @__PURE__ */ __name(async (store, env, estimateFor, key
34350
34185
  };
34351
34186
  }, "enrichmentState");
34352
34187
 
34353
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/notes-title-tier.js
34188
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/notes-title-tier.js
34354
34189
  var plainQueryWords = /* @__PURE__ */ __name((query) => {
34355
34190
  let root;
34356
34191
  try {
@@ -34377,7 +34212,7 @@ var titleTiers = /* @__PURE__ */ __name((hits, words3) => {
34377
34212
  return [...hits].sort((a, b) => rank(a) - rank(b));
34378
34213
  }, "titleTiers");
34379
34214
 
34380
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/notes-search.js
34215
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/notes-search.js
34381
34216
  var storeQuery = /* @__PURE__ */ __name(async (store, text2, { exact, timezone } = {}) => resolvedQuery(store, parsedQuery(text2, exact), timezone), "storeQuery");
34382
34217
  var parsedQuery = /* @__PURE__ */ __name((text2, exact) => validateFields(parseLucene(text2, { ...SEARCH_QUERY, defaultField: exact ? "exact" : "text" })).root, "parsedQuery");
34383
34218
  var resolvedQuery = /* @__PURE__ */ __name(async (store, root, timezone) => {
@@ -34473,9 +34308,9 @@ var MAX_NOTES_OFFSET = 1e3;
34473
34308
  var CANDIDATES2 = 50;
34474
34309
  var firstLine2 = /* @__PURE__ */ __name((text2, query) => {
34475
34310
  const words3 = query.toLowerCase().split(/\s+/).map((word) => word.replace(/^[^\p{L}\p{N}]+|[^\p{L}\p{N}]+$/gu, "")).filter((word) => word.length > 2 && !["and", "or", "not"].includes(word));
34476
- const lines3 = text2.split("\n");
34477
- const found = lines3.find((line3) => words3.some((word) => line3.toLowerCase().includes(word)));
34478
- return (found ?? lines3.find((line3) => line3.trim() !== "") ?? "").trim().slice(0, MAX_LINE2);
34311
+ const lines = text2.split("\n");
34312
+ const found = lines.find((line3) => words3.some((word) => line3.toLowerCase().includes(word)));
34313
+ return (found ?? lines.find((line3) => line3.trim() !== "") ?? "").trim().slice(0, MAX_LINE2);
34479
34314
  }, "firstLine");
34480
34315
  var pictureLane = /* @__PURE__ */ __name(async (store, query, { folderIds, source, limit, env, command, embedder }) => {
34481
34316
  const words3 = plainWords(query);
@@ -34607,7 +34442,7 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
34607
34442
  ]);
34608
34443
  const asked = lookup ?? query;
34609
34444
  const text2 = [asked.trim() ? `(${asked})` : "", filter ?? ""].filter(Boolean).join(" AND ");
34610
- const window3 = offset + limit;
34445
+ const window2 = offset + limit;
34611
34446
  const scope = {
34612
34447
  ...folderIds === void 0 ? {} : { folderIds },
34613
34448
  ...withInternal ? { withInternal: true } : {},
@@ -34630,7 +34465,7 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
34630
34465
  ...withInternal ? { withInternal: true } : {},
34631
34466
  ...source === void 0 ? {} : { source }
34632
34467
  };
34633
- const depth = Math.max(window3, CANDIDATES2);
34468
+ const depth = Math.max(window2, CANDIDATES2);
34634
34469
  try {
34635
34470
  const within = narrowing === void 0 ? void 0 : await filterRefs(store, narrowing, scope);
34636
34471
  let nearest2;
@@ -34659,7 +34494,7 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
34659
34494
  const titleWords3 = plainQueryWords(rest);
34660
34495
  const titled = titleWords3 === void 0 ? { items: [], hasMore: false } : await searchNotesQuery(store, {
34661
34496
  text: [titleQuery(titleWords3), filter ?? ""].filter(Boolean).join(" AND "),
34662
- limit: Math.max(window3, CANDIDATES2),
34497
+ limit: Math.max(window2, CANDIDATES2),
34663
34498
  ...scope
34664
34499
  });
34665
34500
  const tier = titleWords3 === void 0 ? [] : titleTiers(titled.items, titleWords3);
@@ -34667,7 +34502,7 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
34667
34502
  const slice = meaning === void 0 && tier.length === 0;
34668
34503
  const matched = await searchNotesQuery(store, {
34669
34504
  text: text2,
34670
- limit: slice ? limit : Math.max(window3, CANDIDATES2) + tier.length,
34505
+ limit: slice ? limit : Math.max(window2, CANDIDATES2) + tier.length,
34671
34506
  offset: slice ? offset : 0,
34672
34507
  exact,
34673
34508
  ...scope
@@ -34692,8 +34527,8 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
34692
34527
  ...tier.map(({ ref, note, at }) => [ref, { note, at, score: 0, foundBy: ["title"] }]),
34693
34528
  ...[...ranked.entries()].sort(([, a], [, b]) => b.score - a.score)
34694
34529
  ];
34695
- const page = slice ? ordered : ordered.slice(offset, window3);
34696
- const hasMore = slice ? matched.hasMore : ordered.length > window3 || matched.hasMore || titled.hasMore;
34530
+ const page = slice ? ordered : ordered.slice(offset, window2);
34531
+ const hasMore = slice ? matched.hasMore : ordered.length > window2 || matched.hasMore || titled.hasMore;
34697
34532
  const total = await notesTotal(store, text2, { exact, scope, shown: offset + page.length, hasMore }, [...tier.map(({ ref }) => ref), ...meaningRefs ?? []], meaningComplete);
34698
34533
  const hits = [];
34699
34534
  const counts = /* @__PURE__ */ new Map();
@@ -34730,13 +34565,13 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
34730
34565
  ref,
34731
34566
  name
34732
34567
  ]));
34733
- for (const record2 of counts.values()) {
34734
- if (record2.ref && names2.has(record2.ref))
34735
- record2.name = names2.get(record2.ref) ?? record2.name;
34736
- if (record2.ref?.startsWith("person:"))
34737
- record2.name = (await store.people.personByUid(record2.ref.slice("person:".length)))?.name ?? record2.name;
34738
- if (record2.ref?.startsWith("note:") || record2.ref?.startsWith("document:"))
34739
- record2.name = (await store.notes.note(record2.ref).catch(() => void 0))?.title ?? record2.name;
34568
+ for (const record of counts.values()) {
34569
+ if (record.ref && names2.has(record.ref))
34570
+ record.name = names2.get(record.ref) ?? record.name;
34571
+ if (record.ref?.startsWith("person:"))
34572
+ record.name = (await store.people.personByUid(record.ref.slice("person:".length)))?.name ?? record.name;
34573
+ if (record.ref?.startsWith("note:") || record.ref?.startsWith("document:"))
34574
+ record.name = (await store.notes.note(record.ref).catch(() => void 0))?.title ?? record.name;
34740
34575
  }
34741
34576
  const lane = withPictures2 ? await pictureLane(store, words3, {
34742
34577
  folderIds,
@@ -34759,7 +34594,7 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
34759
34594
  items: hits,
34760
34595
  total,
34761
34596
  hasMore,
34762
- ...hasMore && window3 <= MAX_NOTES_OFFSET ? { nextOffset: window3 } : {},
34597
+ ...hasMore && window2 <= MAX_NOTES_OFFSET ? { nextOffset: window2 } : {},
34763
34598
  linked: [...counts.values()].sort((a, b) => b.notes - a.notes || (a.name ?? a.ref ?? "").localeCompare(b.name ?? b.ref ?? "")),
34764
34599
  ...lane
34765
34600
  };
@@ -34805,7 +34640,7 @@ var searchNotesOf = /* @__PURE__ */ __name(async (store, account, text2, { accou
34805
34640
  };
34806
34641
  }, "searchNotesOf");
34807
34642
 
34808
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/events-search.js
34643
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/events-search.js
34809
34644
  var MAX_EVENTS_OFFSET = 1e3;
34810
34645
  var iso3 = /* @__PURE__ */ __name((at) => at === null ? null : new Date(at).toISOString(), "iso");
34811
34646
  var accountIdsOf = /* @__PURE__ */ __name(async (store, accounts) => {
@@ -34852,7 +34687,7 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
34852
34687
  if (accountIds?.length === 0)
34853
34688
  return { query, by: "words", items: [], hasMore: false };
34854
34689
  const words3 = plainQueryWords(asked === void 0 ? query : questionText(query));
34855
- const window3 = offset + limit;
34690
+ const window2 = offset + limit;
34856
34691
  let meaningSkipped;
34857
34692
  let meaning;
34858
34693
  if (exact)
@@ -34864,7 +34699,7 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
34864
34699
  else
34865
34700
  try {
34866
34701
  meaning = await nearestEvents(store, words3, {
34867
- limit: Math.max(window3, CANDIDATES3),
34702
+ limit: Math.max(window2, CANDIDATES3),
34868
34703
  ...accountIds ? { accountIds } : {},
34869
34704
  ...env === void 0 ? {} : { env },
34870
34705
  ...command === void 0 ? {} : { command },
@@ -34877,7 +34712,7 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
34877
34712
  }
34878
34713
  const found = await store.calendar.search({
34879
34714
  root,
34880
- limit: meaning === void 0 ? limit : Math.max(window3, CANDIDATES3),
34715
+ limit: meaning === void 0 ? limit : Math.max(window2, CANDIDATES3),
34881
34716
  offset: meaning === void 0 ? offset : 0,
34882
34717
  ...accountIds === void 0 ? {} : { accountIds },
34883
34718
  ...newest ? { newest: true } : {},
@@ -34895,7 +34730,7 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
34895
34730
  ...skipped,
34896
34731
  items: found.items.map((hit) => foundEvent(hit, query, ["words"])),
34897
34732
  hasMore: found.hasMore,
34898
- ...found.hasMore && window3 <= MAX_EVENTS_OFFSET ? { nextOffset: window3 } : {},
34733
+ ...found.hasMore && window2 <= MAX_EVENTS_OFFSET ? { nextOffset: window2 } : {},
34899
34734
  ...truncated
34900
34735
  };
34901
34736
  const ranked = /* @__PURE__ */ new Map();
@@ -34909,29 +34744,29 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
34909
34744
  add(meaning, "meaning");
34910
34745
  const cosines = new Map(meaning.map((hit) => [keyOf4(hit), hit.score]));
34911
34746
  const ordered = [...ranked.values()].sort((a, b) => b.score - a.score);
34912
- const hasMore = ordered.length > window3 || found.hasMore;
34747
+ const hasMore = ordered.length > window2 || found.hasMore;
34913
34748
  return {
34914
34749
  query,
34915
34750
  by,
34916
- items: ordered.slice(offset, window3).map(({ hit, by: halves }) => {
34751
+ items: ordered.slice(offset, window2).map(({ hit, by: halves }) => {
34917
34752
  const cosine = cosines.get(keyOf4(hit));
34918
34753
  return { ...foundEvent(hit, query, halves), ...cosine === void 0 ? {} : { meaning_score: cosine } };
34919
34754
  }),
34920
34755
  hasMore,
34921
- ...hasMore && window3 <= MAX_EVENTS_OFFSET ? { nextOffset: window3 } : {},
34756
+ ...hasMore && window2 <= MAX_EVENTS_OFFSET ? { nextOffset: window2 } : {},
34922
34757
  ...truncated
34923
34758
  };
34924
34759
  }, "searchEvents");
34925
34760
 
34926
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/search-all-business.js
34761
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/search-all-business.js
34927
34762
  var OWN_BUSINESS = { provider: "business", account: INTERNAL_NOTES };
34928
34763
  var BUSINESS_WORDS_ONLY = "invoices, payments, orders, contracts, subscriptions, products and wallets are found by the words of their numbers and names only";
34929
34764
  var placeOf = /* @__PURE__ */ __name(({ source, imported }) => source ?? (imported === void 0 ? OWN_BUSINESS : { provider: imported, account: "" }), "placeOf");
34930
- var searchBusiness = /* @__PURE__ */ __name(async (store, { words: words3, anyWord, window: window3, accounts }) => {
34765
+ var searchBusiness = /* @__PURE__ */ __name(async (store, { words: words3, anyWord, window: window2, accounts }) => {
34931
34766
  const found = await store.business.find({
34932
34767
  words: words3,
34933
34768
  anyWord,
34934
- limit: Math.min(window3, BUSINESS_FIND_MAX),
34769
+ limit: Math.min(window2, BUSINESS_FIND_MAX),
34935
34770
  ...accounts === void 0 ? {} : { accounts }
34936
34771
  });
34937
34772
  const page = found.items;
@@ -34953,7 +34788,7 @@ var searchBusiness = /* @__PURE__ */ __name(async (store, { words: words3, anyWo
34953
34788
  };
34954
34789
  }, "searchBusiness");
34955
34790
 
34956
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/search-all-meetings.js
34791
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/search-all-meetings.js
34957
34792
  var MOST_HITS_PER_MEETING = 3;
34958
34793
  var PAGE_ROWS = 200;
34959
34794
  var MOST_PAGES = 25;
@@ -35075,7 +34910,7 @@ var merged = /* @__PURE__ */ __name((lists) => {
35075
34910
  best.at++;
35076
34911
  }
35077
34912
  }, "merged");
35078
- var accountHits = /* @__PURE__ */ __name(async (store, account, query, input, { text: text2, window: window3, signal, question, exact }) => {
34913
+ var accountHits = /* @__PURE__ */ __name(async (store, account, query, input, { text: text2, window: window2, signal, question, exact }) => {
35079
34914
  const ranked = [];
35080
34915
  const perMeeting = /* @__PURE__ */ new Map();
35081
34916
  const keep2 = /* @__PURE__ */ __name((one) => {
@@ -35096,13 +34931,13 @@ var accountHits = /* @__PURE__ */ __name(async (store, account, query, input, {
35096
34931
  query: titles,
35097
34932
  ...input.since === void 0 ? {} : { since: input.since },
35098
34933
  ...input.until === void 0 ? {} : { until: input.until },
35099
- limit: window3 + 1
34934
+ limit: window2 + 1
35100
34935
  }))
35101
34936
  if (!exact || holdsExactly(query.root, titleWords(meeting.title ?? "")))
35102
34937
  keep2({ item: titleItem(account, meeting, text2), tier: 1, started: meeting.startedAt ?? 0 });
35103
34938
  }
35104
34939
  let after;
35105
- let rows = Math.min(PAGE_ROWS, window3 + 1);
34940
+ let rows = Math.min(PAGE_ROWS, window2 + 1);
35106
34941
  for (let page = 1; ; page++) {
35107
34942
  let found;
35108
34943
  try {
@@ -35128,7 +34963,7 @@ var accountHits = /* @__PURE__ */ __name(async (store, account, query, input, {
35128
34963
  started: hit.source?.startedAt ?? 0
35129
34964
  }))
35130
34965
  passages++;
35131
- if (passages > window3 || !found.hasMore || found.nextCursor === null)
34966
+ if (passages > window2 || !found.hasMore || found.nextCursor === null)
35132
34967
  break;
35133
34968
  if (page === MOST_PAGES) {
35134
34969
  hasMore = true;
@@ -35138,8 +34973,8 @@ var accountHits = /* @__PURE__ */ __name(async (store, account, query, input, {
35138
34973
  }
35139
34974
  ranked.sort((one, other) => one.tier - other.tier || other.started - one.started);
35140
34975
  return {
35141
- ranked: ranked.slice(0, window3),
35142
- coverage: { indexing, hasMore: hasMore || ranked.length > window3 }
34976
+ ranked: ranked.slice(0, window2),
34977
+ coverage: { indexing, hasMore: hasMore || ranked.length > window2 }
35143
34978
  };
35144
34979
  }, "accountHits");
35145
34980
  var meetingItem = /* @__PURE__ */ __name((account, hit, query) => ({
@@ -35181,7 +35016,7 @@ var titleItem = /* @__PURE__ */ __name((account, meeting, query) => ({
35181
35016
  foundBy: ["title"]
35182
35017
  }), "titleItem");
35183
35018
 
35184
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/search-harder.js
35019
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/search-harder.js
35185
35020
  var SECTION3 = "search_harder";
35186
35021
  var HARDER_MODELS = {
35187
35022
  anthropic: "claude-haiku-5-5",
@@ -35427,7 +35262,7 @@ var reorderHarder = /* @__PURE__ */ __name(async (question, hits, { laterPage, a
35427
35262
  };
35428
35263
  }, "reorderHarder");
35429
35264
 
35430
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/search-all.js
35265
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/search-all.js
35431
35266
  var RESOURCES_SEARCHED = ["messages", "mail", "notes", "events", "crm", "business", "meetings"];
35432
35267
  var refusal = /* @__PURE__ */ __name((error, text2) => {
35433
35268
  const { reason, span } = error.details ?? {};
@@ -35498,8 +35333,8 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
35498
35333
  if (!Number.isInteger(offset) || offset < 0 || offset > MAX_SEARCH_OFFSET)
35499
35334
  throw new CliError("validation_error", `offset takes a whole number from 0 to ${MAX_SEARCH_OFFSET}`);
35500
35335
  const period = questionPeriod(request.text, request.now ?? Date.now(), timezoneOf(request.timezone));
35501
- const window3 = offset + request.limit;
35502
- const depth = Math.max(window3, period ? PERIOD_DEPTH : 0, request.harder ? HARDER_CANDIDATES : 0);
35336
+ const window2 = offset + request.limit;
35337
+ const depth = Math.max(window2, period ? PERIOD_DEPTH : 0, request.harder ? HARDER_CANDIDATES : 0);
35503
35338
  const chosen = request.source === void 0 ? { only: request.only ?? RESOURCES_SEARCHED, scope: request.scope, skipped: [] } : await sourceScope(store, account, request.source, request.only ?? RESOURCES_SEARCHED, messenger);
35504
35339
  const { only, scope } = chosen;
35505
35340
  const command = messenger.hintCommand === void 0 ? messenger.app?.command : messenger.hintCommand ?? void 0;
@@ -35547,7 +35382,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
35547
35382
  if (!skipped.some(({ source }) => source === one.source))
35548
35383
  skipped.push(one);
35549
35384
  accounts.push(...read.map(({ provider, account: account2 }) => ({ resource: kind, provider, account: account2 })));
35550
- const itemOf3 = /* @__PURE__ */ __name((hit, foundBy) => {
35385
+ const itemOf2 = /* @__PURE__ */ __name((hit, foundBy) => {
35551
35386
  const at = parseLocator(hit.locator);
35552
35387
  return {
35553
35388
  kind: kind === "mail" ? "mail" : "message",
@@ -35564,7 +35399,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
35564
35399
  foundBy
35565
35400
  };
35566
35401
  }, "itemOf");
35567
- const byWords = found.items.map((hit) => itemOf3(hit, ["words"]));
35402
+ const byWords = found.items.map((hit) => itemOf2(hit, ["words"]));
35568
35403
  if (!meaning || request.exact || kind === "messages" && request.backend === "server")
35569
35404
  return byWords;
35570
35405
  const filters = filtersBeside(request.text);
@@ -35593,7 +35428,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
35593
35428
  if (held && discovers)
35594
35429
  held.score = Math.max(held.score, vote);
35595
35430
  else
35596
- fused2.set(hit.locator, { item: held?.item ?? itemOf3(hit, ["meaning"]), score: (held?.score ?? 0) + vote });
35431
+ fused2.set(hit.locator, { item: held?.item ?? itemOf2(hit, ["meaning"]), score: (held?.score ?? 0) + vote });
35597
35432
  });
35598
35433
  return [...fused2.values()].sort((a, b) => b.score - a.score).map(({ item: item2 }) => item2);
35599
35434
  }, "messagesOf");
@@ -35788,7 +35623,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
35788
35623
  ordered = done2.items;
35789
35624
  harder = done2.harder;
35790
35625
  }
35791
- const more = hasMore || ordered.length > window3;
35626
+ const more = hasMore || ordered.length > window2;
35792
35627
  const { backend: _backend, server: _server, harder: _harder, ...local } = asked;
35793
35628
  const unmatched = [];
35794
35629
  if (!ordered.length && !offset && !discover)
@@ -35799,9 +35634,9 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
35799
35634
  }
35800
35635
  return {
35801
35636
  query: asked.text,
35802
- items: ordered.slice(offset, window3),
35637
+ items: ordered.slice(offset, window2),
35803
35638
  hasMore: more,
35804
- ...more && window3 <= MAX_SEARCH_OFFSET ? { nextOffset: window3 } : {},
35639
+ ...more && window2 <= MAX_SEARCH_OFFSET ? { nextOffset: window2 } : {},
35805
35640
  searched,
35806
35641
  accounts,
35807
35642
  skipped,
@@ -35872,7 +35707,7 @@ var insidePeriodFirst = /* @__PURE__ */ __name((ordered, period) => {
35872
35707
  return ordered.map((item2, rank) => ({ item: item2, score: 1 - rank / PERIOD_DEPTH + (inside2(item2) ? PERIOD_BOOST : 0) })).sort((a, b) => b.score - a.score).map(({ item: item2 }) => item2);
35873
35708
  }, "insidePeriodFirst");
35874
35709
 
35875
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/server-search.js
35710
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/server-search.js
35876
35711
  var SERVER_SEARCH_KEY = "messages.server-search";
35877
35712
  var SERVER_BOUNDS = { timeMs: 5e3, perCall: 100, maxCalls: 3, textBytes: 262144 };
35878
35713
  var DEFAULT_BACKEND = "both";
@@ -36063,8 +35898,12 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
36063
35898
  return { report, sources };
36064
35899
  }, "searchServer");
36065
35900
 
36066
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/messages.js
35901
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/messages.js
36067
35902
  var DELETE_AT_ONCE = 10;
35903
+ var atOnce = /* @__PURE__ */ __name((ids) => {
35904
+ if (ids.length > DELETE_AT_ONCE)
35905
+ throw new CliError("validation_error", `at most ${DELETE_AT_ONCE} messages at once, got ${ids.length}`);
35906
+ }, "atOnce");
36068
35907
  var filesOf = /* @__PURE__ */ __name(({ attachments }) => {
36069
35908
  const files = fileLinks(attachments);
36070
35909
  return files.length > 0 ? { files } : {};
@@ -36100,6 +35939,15 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
36100
35939
  ...query.saved === void 0 ? {} : { saved: query.saved }
36101
35940
  }).catch(() => void 0);
36102
35941
  }, "remember");
35942
+ const waiting = /* @__PURE__ */ __name(async (connection, chat, ids) => {
35943
+ const list2 = capability(connection, "scheduled", "list scheduled messages");
35944
+ const { id: chatId } = await connection.resolve(chat);
35945
+ const queued = await list2(chatId);
35946
+ const unknown3 = ids.filter((id2) => !queued.some((message) => message.id === id2));
35947
+ if (unknown3.length > 0)
35948
+ throw new CliError("not_found", `nothing scheduled in this chat has the id ${unknown3.join(", ")} \u2014 a scheduled message has an id of its own, not the one of a sent message; \`messages scheduled ${chat}\` lists them`, { sent: false });
35949
+ return { chatId, found: ids.map((id2) => queued.find((message) => message.id === id2)) };
35950
+ }, "waiting");
36103
35951
  const pinning = /* @__PURE__ */ __name(async ({ chat, message }, pinned, asked, requested) => {
36104
35952
  const allowed = deps.messenger.pinDurations;
36105
35953
  if (requested !== void 0 && !allowed?.includes(requested))
@@ -36118,11 +35966,11 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
36118
35966
  throw new CliError("validation_error", "a topic is read back from its newest message, or from --before-id");
36119
35967
  if (threadId === "1")
36120
35968
  throw new CliError("validation_error", "the General topic's messages carry no topic id \u2014 read the whole chat without --topic");
36121
- const window3 = { limit, ...before === void 0 ? {} : { before } };
35969
+ const window2 = { limit, ...before === void 0 ? {} : { before } };
36122
35970
  if (fromStore(deps)) {
36123
- return inStore(async (store, account) => store.messages.messages(account, await readChatId(deps, chat, store, account), { ...window3, threadId }));
35971
+ return inStore(async (store, account) => store.messages.messages(account, await readChatId(deps, chat, store, account), { ...window2, threadId }));
36124
35972
  }
36125
- return capability(await deps.connection(), "topicHistory", "read one forum topic")(chat, threadId, window3);
35973
+ return capability(await deps.connection(), "topicHistory", "read one forum topic")(chat, threadId, window2);
36126
35974
  }, "topicPage");
36127
35975
  const listPage = /* @__PURE__ */ __name(async (chat, { limit, before, beforeTime, after, until, threadId: typedThread, starred }) => {
36128
35976
  if (starred !== void 0) {
@@ -36140,13 +35988,13 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
36140
35988
  if (threadId !== void 0)
36141
35989
  return topicPage(chat, threadId, { limit, before, beforeTime, after, until });
36142
35990
  if (fromStore(deps)) {
36143
- const window4 = after ? { limit, after, ...until === void 0 ? {} : { until } } : {
35991
+ const window3 = after ? { limit, after, ...until === void 0 ? {} : { until } } : {
36144
35992
  limit,
36145
35993
  ...before === void 0 ? {} : { before },
36146
35994
  // historyBefore reads strictly before its moment; the store's end is inclusive.
36147
35995
  ...beforeTime === void 0 ? {} : { until: beforeTime - 1 }
36148
35996
  };
36149
- return inStore(async (store, account) => store.messages.messages(account, await readChatId(deps, chat, store, account), window4));
35997
+ return inStore(async (store, account) => store.messages.messages(account, await readChatId(deps, chat, store, account), window3));
36150
35998
  }
36151
35999
  const connection = await deps.connection();
36152
36000
  if (beforeTime !== void 0)
@@ -36158,24 +36006,24 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
36158
36006
  const items = page.items.filter((one) => Date.parse(one.timestamp) <= until);
36159
36007
  return { items, hasMore: page.hasMore && items.length === page.items.length };
36160
36008
  }
36161
- const window3 = { limit, ...before === void 0 ? {} : { before } };
36162
- return capability(connection, "history", "read a chat's history")(chat, window3);
36009
+ const window2 = { limit, ...before === void 0 ? {} : { before } };
36010
+ return capability(connection, "history", "read a chat's history")(chat, window2);
36163
36011
  }, "listPage");
36164
36012
  return {
36165
36013
  // A provider caps its pages (Telegram at 100), so a larger --limit reads on from the last page's edge.
36166
36014
  // Only by id: where `before` is a send time (MAX), messages sharing the edge moment would be skipped.
36167
36015
  reader: /* @__PURE__ */ __name(() => deps.account(), "reader"),
36168
- list: /* @__PURE__ */ __name(async (chat, window3) => {
36169
- const forward = window3.after !== void 0;
36170
- let page = await listPage(chat, window3);
36016
+ list: /* @__PURE__ */ __name(async (chat, window2) => {
36017
+ const forward = window2.after !== void 0;
36018
+ let page = await listPage(chat, window2);
36171
36019
  let items = page.items;
36172
36020
  const byId2 = (deps.messenger.fetching?.orderBy ?? "id") === "id";
36173
- while (byId2 && page.hasMore && items.length < window3.limit) {
36021
+ while (byId2 && page.hasMore && items.length < window2.limit) {
36174
36022
  const edge = forward ? items.at(-1) : items[0];
36175
36023
  if (!edge)
36176
36024
  break;
36177
- const { beforeTime: _first, ...rest } = window3;
36178
- const next = forward ? { ...rest, limit: window3.limit - items.length, after: { id: edge.id } } : { ...rest, limit: window3.limit - items.length, before: edge.id };
36025
+ const { beforeTime: _first, ...rest } = window2;
36026
+ const next = forward ? { ...rest, limit: window2.limit - items.length, after: { id: edge.id } } : { ...rest, limit: window2.limit - items.length, before: edge.id };
36179
36027
  page = await listPage(chat, next);
36180
36028
  const seen = new Set(items.map((one) => one.id));
36181
36029
  const fresh = page.items.filter((one) => !seen.has(one.id));
@@ -36185,21 +36033,21 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
36185
36033
  }
36186
36034
  return { items, hasMore: page.hasMore };
36187
36035
  }, "list"),
36188
- around: /* @__PURE__ */ __name(async (reference, message, window3) => {
36036
+ around: /* @__PURE__ */ __name(async (reference, message, window2) => {
36189
36037
  const target2 = messageLinkTarget(reference, message, deps.messenger.provider);
36190
36038
  if (target2.account !== void 0)
36191
36039
  await ownTarget(target2, await deps.account());
36192
36040
  if (fromStore(deps)) {
36193
- return inStore(async (store, account) => store.messages.around(account, await readChatId(deps, target2.chat, store, account), target2.message, window3));
36041
+ return inStore(async (store, account) => store.messages.around(account, await readChatId(deps, target2.chat, store, account), target2.message, window2));
36194
36042
  }
36195
- return capability(await deps.connection(), "around", "read the messages around one")(target2.chat, target2.message, window3);
36043
+ return capability(await deps.connection(), "around", "read the messages around one")(target2.chat, target2.message, window2);
36196
36044
  }, "around"),
36197
36045
  thread: /* @__PURE__ */ __name((reference, message, options2) => inStore(async (store, account) => {
36198
36046
  const target2 = messageLinkTarget(reference, message, deps.messenger.provider);
36199
36047
  await ownTarget(target2, account);
36200
36048
  return readThreadContext(store, account, await storedChatId(deps.messenger, target2.chat, store, account, { includeLeft: true }), target2.message, options2);
36201
36049
  }), "thread"),
36202
- comments: /* @__PURE__ */ __name(async (chat, typedPost, window3) => {
36050
+ comments: /* @__PURE__ */ __name(async (chat, typedPost, window2) => {
36203
36051
  const post = typedPost.trim();
36204
36052
  if (post === "")
36205
36053
  throw new CliError("validation_error", "which post? give its message id in the channel");
@@ -36210,7 +36058,7 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
36210
36058
  const comments = capability(connection, "comments", "read comments on a channel post");
36211
36059
  const { id: channelId } = await connection.resolve(chat);
36212
36060
  const discussion = await discussionOf(channelId, post);
36213
- return { discussion, ...await comments(channelId, post, window3) };
36061
+ return { discussion, ...await comments(channelId, post, window2) };
36214
36062
  }, "comments"),
36215
36063
  link: /* @__PURE__ */ __name(async (reference, message) => {
36216
36064
  const target2 = messageLinkTarget(reference, message, deps.messenger.provider);
@@ -36405,6 +36253,53 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
36405
36253
  await guardedWrite(guard, { operationId, chatId, kind: "delete", count: messages.length, forEveryone }, () => remove(chatId, messages, { forEveryone }));
36406
36254
  return { operationId, chatId, deleted: messages, forEveryone };
36407
36255
  }, "delete"),
36256
+ cancelScheduled: /* @__PURE__ */ __name(async ({ chat, ids }) => {
36257
+ atOnce(ids);
36258
+ const connection = await deps.connection();
36259
+ const cancel = capability(connection, "cancelScheduled", "cancel a scheduled message");
36260
+ const { chatId } = await waiting(connection, chat, ids);
36261
+ const operationId = newOperationId();
36262
+ await guardedWrite(guard, { operationId, chatId, kind: "delete", key: "messages.scheduled.cancel", count: ids.length }, () => cancel(chatId, ids));
36263
+ return { operationId, chatId, cancelled: ids };
36264
+ }, "cancelScheduled"),
36265
+ editScheduled: /* @__PURE__ */ __name(async ({ chat, id: id2, text: typed, markdown: markdown2, html: html2, at }) => {
36266
+ if (typed === void 0 && at === void 0)
36267
+ throw new CliError("validation_error", "nothing to change \u2014 give the new text, --at-time, or both");
36268
+ const connection = await deps.connection();
36269
+ const edit = capability(connection, "editScheduled", "edit a scheduled message");
36270
+ const prepared = typed === void 0 ? void 0 : await formatted(connection, typed, { markdown: markdown2, html: html2 });
36271
+ const change = prepared && (deps.agentText ? visibleFormattedText(prepared) : prepared);
36272
+ if (change !== void 0 && change.text.trim() === "")
36273
+ throw new CliError("validation_error", "no new text \u2014 the marks leave nothing");
36274
+ const { chatId, found: [current] } = await waiting(connection, chat, [id2]);
36275
+ const scheduledFor = at ?? current?.scheduledFor ?? current?.timestamp;
36276
+ if (scheduledFor === void 0)
36277
+ throw new CliError("invalid_response", "the scheduled message has no time");
36278
+ const operationId = newOperationId();
36279
+ const message = await guardedWrite(guard, {
36280
+ operationId,
36281
+ chatId,
36282
+ kind: "edit",
36283
+ key: "messages.scheduled.edit",
36284
+ messageId: id2,
36285
+ scheduledFor,
36286
+ ...change === void 0 ? {} : { length: change.text.length }
36287
+ }, () => edit(chatId, id2, {
36288
+ at: scheduledFor,
36289
+ ...change === void 0 ? {} : { text: change.text },
36290
+ ...change === void 0 || change.spans.length === 0 ? {} : { formatting: change.spans }
36291
+ }));
36292
+ return { operationId, message, scheduledFor };
36293
+ }, "editScheduled"),
36294
+ sendScheduled: /* @__PURE__ */ __name(async ({ chat, ids }) => {
36295
+ atOnce(ids);
36296
+ const connection = await deps.connection();
36297
+ const send = capability(connection, "sendScheduled", "send a scheduled message now");
36298
+ const { chatId } = await waiting(connection, chat, ids);
36299
+ const operationId = newOperationId();
36300
+ const messages = await guardedWrite(guard, { operationId, chatId, kind: "message", key: "messages.scheduled.send", count: ids.length }, () => send(chatId, ids));
36301
+ return { operationId, chatId, sent: ids, messages };
36302
+ }, "sendScheduled"),
36408
36303
  forward: /* @__PURE__ */ __name(async ({ chat, message, to, silent, sendId, sendAs, threadId: typedThread }) => {
36409
36304
  const connection = await deps.connection();
36410
36305
  const forward = capability(connection, "forward", "forward a message");
@@ -36503,7 +36398,7 @@ var checkMediaOptions = /* @__PURE__ */ __name((messenger, asked, attachments) =
36503
36398
  throw new CliError("validation_error", `${MEDIA_FLAGS[first2]} needs a --photo or --file`);
36504
36399
  }, "checkMediaOptions");
36505
36400
 
36506
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/domain/channel-tags.js
36401
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/domain/channel-tags.js
36507
36402
  var CHANNEL_TAG_RULES_VERSION = "keywords-v1";
36508
36403
  var RULES2 = {
36509
36404
  ai: [/\b(ai|gpt|llm|machine learning|artificial intelligence)\b/iu, /нейросет|искусственн/iu],
@@ -36518,7 +36413,7 @@ var classifyChannel = /* @__PURE__ */ __name((metadata) => Object.entries(RULES2
36518
36413
  return fields.length ? [{ tag, score: fields.length / 3, fields }] : [];
36519
36414
  }), "classifyChannel");
36520
36415
 
36521
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/metadata.js
36416
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/metadata.js
36522
36417
  var metadataService = /* @__PURE__ */ __name((deps) => {
36523
36418
  const held = /* @__PURE__ */ __name(async (reference, { includeLeft = false } = {}) => {
36524
36419
  const store = await deps.store();
@@ -36604,7 +36499,7 @@ var metadataService = /* @__PURE__ */ __name((deps) => {
36604
36499
  };
36605
36500
  }, "metadataService");
36606
36501
 
36607
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/moderation/run.js
36502
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/moderation/run.js
36608
36503
  var FIRST_LOOK_MS = 24 * 36e5;
36609
36504
  var moderateWith = /* @__PURE__ */ __name(async (run2) => {
36610
36505
  const { chatId, title, rules, point, since, dryRun } = run2;
@@ -36641,7 +36536,7 @@ var moderateWith = /* @__PURE__ */ __name(async (run2) => {
36641
36536
  return { chatId, rows, notes };
36642
36537
  }, "moderateWith");
36643
36538
 
36644
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/moderation.js
36539
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/moderation.js
36645
36540
  var moderationService = /* @__PURE__ */ __name((deps) => {
36646
36541
  const file = /* @__PURE__ */ __name(() => {
36647
36542
  const env = deps.env ?? process.env;
@@ -36726,7 +36621,7 @@ var moderatorOf = /* @__PURE__ */ __name((adapter, deps) => ({
36726
36621
  }, "removePerson")
36727
36622
  }), "moderatorOf");
36728
36623
 
36729
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/private-people.js
36624
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/private-people.js
36730
36625
  var noteItem = /* @__PURE__ */ __name((provider, note) => ({
36731
36626
  id: note.id,
36732
36627
  contact: formatReference({ type: "contact", provider, id: note.personId }),
@@ -36770,7 +36665,7 @@ var privatePeopleService = /* @__PURE__ */ __name((deps) => {
36770
36665
  };
36771
36666
  }, "privatePeopleService");
36772
36667
 
36773
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/rankings.js
36668
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/rankings.js
36774
36669
  var empty = /* @__PURE__ */ __name(() => ({
36775
36670
  total: 0,
36776
36671
  population: 0,
@@ -37026,7 +36921,7 @@ var rankingsService = /* @__PURE__ */ __name((deps) => ({
37026
36921
  }, "evidence")
37027
36922
  }), "rankingsService");
37028
36923
 
37029
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/reply-stats.js
36924
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/reply-stats.js
37030
36925
  var FIELDS = ["date", "chat", "kind", "muted"];
37031
36926
  var WAITING_TAIL = 100;
37032
36927
  var plainOnly = /* @__PURE__ */ __name((text2, command) => {
@@ -37160,7 +37055,7 @@ var replyStatsService = /* @__PURE__ */ __name((deps) => {
37160
37055
  };
37161
37056
  }, "replyStatsService");
37162
37057
 
37163
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/tags.js
37058
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/tags.js
37164
37059
  var TAGGING_QUERY = {
37165
37060
  entity: "tagging",
37166
37061
  backend: "sql",
@@ -37244,7 +37139,7 @@ var tagsService = /* @__PURE__ */ __name((deps) => {
37244
37139
  };
37245
37140
  }, "tagsService");
37246
37141
 
37247
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/topics.js
37142
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/topics.js
37248
37143
  var actionOf = /* @__PURE__ */ __name(({ title, closed, pinned, hidden, icon }) => {
37249
37144
  const set = [closed, pinned, hidden].filter((one) => one !== void 0).length;
37250
37145
  if (title !== void 0 || icon !== void 0 || set !== 1)
@@ -37443,7 +37338,7 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
37443
37338
  };
37444
37339
  }, "topicsService");
37445
37340
 
37446
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/evidence.js
37341
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/evidence.js
37447
37342
  import { createHash as createHash12, randomUUID as randomUUID5 } from "node:crypto";
37448
37343
  var hash2 = /* @__PURE__ */ __name((value) => createHash12("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
37449
37344
  var positive2 = /* @__PURE__ */ __name((value, name, minimum = 1) => {
@@ -37517,7 +37412,7 @@ var prepareEvidencePacket = /* @__PURE__ */ __name(({ kind, source, page, limits
37517
37412
  return { ...content, id: randomUUID5(), fingerprint: hash2(content) };
37518
37413
  }, "prepareEvidencePacket");
37519
37414
 
37520
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/evidence-read.js
37415
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/evidence-read.js
37521
37416
  var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, limit, before }, messenger = {}) => {
37522
37417
  if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100)
37523
37418
  throw new CliError("validation_error", "evidence message limit must be an integer from 1 to 100");
@@ -37537,7 +37432,7 @@ var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, l
37537
37432
  return { ...packet, nextBeforeId: older && last ? last.id : null };
37538
37433
  }, "readEvidencePacket");
37539
37434
 
37540
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/meeting-project-discovery.js
37435
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/meeting-project-discovery.js
37541
37436
  var scopeKeys = [
37542
37437
  "accountId",
37543
37438
  "meetingId",
@@ -37559,7 +37454,7 @@ var optionKeys = /* @__PURE__ */ new Set([
37559
37454
  "maxVocabularyReadBytes"
37560
37455
  ]);
37561
37456
 
37562
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/services/index.js
37457
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/index.js
37563
37458
  var servicesFor = /* @__PURE__ */ __name((deps) => {
37564
37459
  const pictures = picturesService(deps);
37565
37460
  const base = {
@@ -37596,312 +37491,6 @@ var servicesFor = /* @__PURE__ */ __name((deps) => {
37596
37491
  return deps.messenger.services ? { ...base, ...deps.messenger.services(base, deps) } : base;
37597
37492
  }, "servicesFor");
37598
37493
 
37599
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/background/relay.js
37600
- import { createHash as createHash13 } from "node:crypto";
37601
- import { chmodSync, lstatSync, mkdirSync as mkdirSync3, rmSync as rmSync2 } from "node:fs";
37602
- import { createConnection, createServer } from "node:net";
37603
- import { tmpdir as tmpdir2 } from "node:os";
37604
- import { dirname as dirname5, isAbsolute as isAbsolute3, join as join13 } from "node:path";
37605
- import { PassThrough, Writable } from "node:stream";
37606
- var RELAY_PROTOCOL = 1;
37607
- var requestSchema = strictObject({
37608
- argv: array(string()),
37609
- env: record(string(), string()),
37610
- cwd: pipe(string(), check((path) => isAbsolute3(path))),
37611
- tty: boolean(),
37612
- stdinTty: boolean()
37613
- });
37614
- var MAX_CLIENT_LINE = 1024 * 1024;
37615
- var MAX_SERVE_LINE = 64 * 1024 * 1024;
37616
- var MAX_SOCKET_PATH = 100;
37617
- var relayPath = /* @__PURE__ */ __name((lockPath) => {
37618
- const beside = lockPath.replace(/\.lock$/, ".sock");
37619
- if (beside.length <= MAX_SOCKET_PATH)
37620
- return beside;
37621
- const hash3 = createHash13("sha256").update(beside).digest("hex").slice(0, 16);
37622
- const name = join13(`wirecat-relay-${process.getuid?.() ?? "user"}`, `${hash3}.sock`);
37623
- const temporary = join13(tmpdir2(), name);
37624
- if (temporary.length <= MAX_SOCKET_PATH || process.platform === "win32")
37625
- return temporary;
37626
- return join13("/tmp", name);
37627
- }, "relayPath");
37628
- var privateDirectory = /* @__PURE__ */ __name((dir) => {
37629
- mkdirSync3(dir, { recursive: true, mode: 448 });
37630
- const stat3 = lstatSync(dir);
37631
- const mine = process.getuid === void 0 || stat3.uid === process.getuid();
37632
- if (!stat3.isDirectory() || !mine || (stat3.mode & 63) !== 0) {
37633
- throw new CliError("permission_error", `${dir} is not a private directory, so serve does not listen there`);
37634
- }
37635
- }, "privateDirectory");
37636
- var lines2 = /* @__PURE__ */ __name((socket, max, onLine, onTooLong) => {
37637
- let buffered = "";
37638
- socket.setEncoding("utf8");
37639
- socket.on("data", (chunk) => {
37640
- buffered += chunk;
37641
- for (let end = buffered.indexOf("\n"); end >= 0; end = buffered.indexOf("\n")) {
37642
- const line3 = buffered.slice(0, end);
37643
- buffered = buffered.slice(end + 1);
37644
- if (line3)
37645
- onLine(line3);
37646
- }
37647
- if (buffered.length > max)
37648
- onTooLong();
37649
- });
37650
- }, "lines");
37651
- var frame = /* @__PURE__ */ __name((socket, value) => {
37652
- if (!socket.destroyed)
37653
- socket.write(`${JSON.stringify(value)}
37654
- `);
37655
- }, "frame");
37656
- var listenRelay = /* @__PURE__ */ __name(async (path, run2) => {
37657
- privateDirectory(dirname5(path));
37658
- rmSync2(path, { force: true });
37659
- const open7 = /* @__PURE__ */ new Set();
37660
- const running = /* @__PURE__ */ new Set();
37661
- const server = createServer((socket) => {
37662
- open7.add(socket);
37663
- const stop = new AbortController();
37664
- const stdin = new PassThrough();
37665
- let started = false;
37666
- socket.on("error", () => {
37667
- });
37668
- socket.on("close", () => {
37669
- open7.delete(socket);
37670
- stop.abort(new CliError("cancelled", "the client went away", { retryable: false }));
37671
- if (!stdin.writableEnded)
37672
- stdin.end();
37673
- });
37674
- lines2(socket, MAX_CLIENT_LINE, (line3) => {
37675
- let message;
37676
- try {
37677
- message = JSON.parse(line3);
37678
- } catch {
37679
- socket.destroy();
37680
- return;
37681
- }
37682
- if (!started) {
37683
- started = true;
37684
- if (message.v !== RELAY_PROTOCOL) {
37685
- frame(socket, { diagnostic: `serve speaks relay protocol ${RELAY_PROTOCOL}; restart it`, exit: 1 });
37686
- socket.end();
37687
- return;
37688
- }
37689
- const parsed = safeParse(requestSchema, message.run);
37690
- if (!parsed.success) {
37691
- socket.destroy();
37692
- return;
37693
- }
37694
- stdin.isTTY = parsed.output.stdinTty;
37695
- if (parsed.output.stdinTty)
37696
- stdin.end();
37697
- const job = serve(socket, parsed.output, stdin, stop.signal, run2);
37698
- running.add(job);
37699
- void job.then(() => running.delete(job), () => running.delete(job));
37700
- return;
37701
- }
37702
- if (typeof message.stdin === "string" && !stdin.writableEnded)
37703
- stdin.write(Buffer.from(message.stdin, "base64"));
37704
- if (message.stdinEnd === true && !stdin.writableEnded)
37705
- stdin.end();
37706
- }, () => socket.destroy());
37707
- });
37708
- await new Promise((resolve7, reject) => {
37709
- server.once("error", reject);
37710
- server.listen(path, () => {
37711
- server.off("error", reject);
37712
- resolve7();
37713
- });
37714
- });
37715
- chmodSync(path, 384);
37716
- return {
37717
- close: /* @__PURE__ */ __name(async () => {
37718
- for (const socket of open7)
37719
- socket.destroy();
37720
- await new Promise((resolve7) => server.close(() => resolve7()));
37721
- await Promise.allSettled(running);
37722
- rmSync2(path, { force: true });
37723
- }, "close")
37724
- };
37725
- }, "listenRelay");
37726
- var serve = /* @__PURE__ */ __name(async (socket, request, stdin, signal, run2) => {
37727
- const streams = {
37728
- data: /* @__PURE__ */ __name((text2) => frame(socket, { data: text2 }), "data"),
37729
- diagnostic: /* @__PURE__ */ __name((text2) => frame(socket, { diagnostic: text2 }), "diagnostic"),
37730
- progress: /* @__PURE__ */ __name((text2) => frame(socket, { progress: text2 }), "progress")
37731
- };
37732
- const stdout = new Writable({
37733
- write: /* @__PURE__ */ __name((chunk, _encoding, done2) => {
37734
- frame(socket, { raw: Buffer.from(chunk).toString("base64") });
37735
- done2();
37736
- }, "write")
37737
- });
37738
- let code = 1;
37739
- try {
37740
- code = await run2(request, { streams, stdin, stdout, signal });
37741
- } finally {
37742
- frame(socket, { exit: code });
37743
- socket.end();
37744
- }
37745
- }, "serve");
37746
- var relayCommand = /* @__PURE__ */ __name((path, request, options2) => new Promise((resolve7, reject) => {
37747
- const { streams, stdin, stdout, signal, deadlineMs, writes, holder, listens = false } = options2;
37748
- const socket = createConnection(path);
37749
- let connected = false;
37750
- let settled = false;
37751
- let timer;
37752
- const forward = /* @__PURE__ */ __name((chunk) => frame(socket, { stdin: Buffer.from(chunk).toString("base64") }), "forward");
37753
- const ended = /* @__PURE__ */ __name(() => frame(socket, { stdinEnd: true }), "ended");
37754
- const brokenPipe = /* @__PURE__ */ __name((error) => {
37755
- if (error.code === "EPIPE")
37756
- finish({ code: 0 });
37757
- }, "brokenPipe");
37758
- const finish = /* @__PURE__ */ __name((outcome2) => {
37759
- if (settled)
37760
- return;
37761
- settled = true;
37762
- if (timer)
37763
- clearTimeout(timer);
37764
- stdout.off("error", brokenPipe);
37765
- signal.removeEventListener("abort", aborted);
37766
- stdin.off("data", forward).off("end", ended);
37767
- stdin.pause();
37768
- socket.destroy();
37769
- if ("code" in outcome2)
37770
- resolve7(outcome2.code);
37771
- else
37772
- reject(outcome2.error);
37773
- }, "finish");
37774
- const stopped = /* @__PURE__ */ __name(() => writes ? new CliError("outcome_unknown", `${holder} stopped before the command finished; it may have run \u2014 check before repeating it`, { retryable: false }) : new CliError("provider_unavailable", `${holder} stopped before the command finished`, { retryable: true }), "stopped");
37775
- const aborted = /* @__PURE__ */ __name(() => finish(listens ? { code: 0 } : { error: signal.reason }), "aborted");
37776
- if (signal.aborted)
37777
- return aborted();
37778
- signal.addEventListener("abort", aborted, { once: true });
37779
- stdout.on("error", brokenPipe);
37780
- if (deadlineMs !== void 0)
37781
- timer = setTimeout(() => finish({ error: stopped() }), deadlineMs);
37782
- socket.on("connect", () => {
37783
- connected = true;
37784
- frame(socket, { v: RELAY_PROTOCOL, run: request });
37785
- if (request.stdinTty)
37786
- ended();
37787
- else {
37788
- stdin.on("data", forward).once("end", ended);
37789
- stdin.resume();
37790
- }
37791
- });
37792
- socket.on("error", (error) => {
37793
- if (connected)
37794
- return finish({ error: stopped() });
37795
- finish({
37796
- error: new CliError("provider_unavailable", `${holder} holds the connection but does not answer its relay (${error.code ?? error.message}) \u2014 restart it`, { retryable: false, sent: false })
37797
- });
37798
- });
37799
- socket.on("close", () => finish({ error: stopped() }));
37800
- lines2(socket, MAX_SERVE_LINE, (line3) => {
37801
- let message;
37802
- try {
37803
- message = JSON.parse(line3);
37804
- } catch {
37805
- return finish({ error: stopped() });
37806
- }
37807
- if (typeof message.data === "string")
37808
- streams.data(message.data);
37809
- if (typeof message.diagnostic === "string")
37810
- streams.diagnostic(message.diagnostic);
37811
- if (typeof message.progress === "string")
37812
- streams.progress?.(message.progress);
37813
- if (typeof message.raw === "string")
37814
- stdout.write(Buffer.from(message.raw, "base64"));
37815
- if (typeof message.exit === "number")
37816
- finish({ code: message.exit });
37817
- }, () => finish({ error: stopped() }));
37818
- }), "relayCommand");
37819
-
37820
- // node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.113.0_commander@15.0.0_esbuild@0.28.2_typ_9a2e508bb6f63e7e29f0d776540ec8fd/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-relay.js
37821
- var lentConnection = /* @__PURE__ */ __name((connection, watchers) => throughWrapper(connection, {
37822
- close: /* @__PURE__ */ __name(async () => {
37823
- }, "close"),
37824
- feed: void 0,
37825
- storedChats: void 0,
37826
- listen: void 0,
37827
- listenHistory: void 0,
37828
- ...connection.watch && watchers ? {
37829
- // A watcher that throws (its output limit, a closed reader) ends its own watch, never serve's.
37830
- watch: /* @__PURE__ */ __name(async (onEvent, signal, onReady) => {
37831
- let watcher;
37832
- try {
37833
- await new Promise((resolve7, reject) => {
37834
- watcher = /* @__PURE__ */ __name((event2) => {
37835
- try {
37836
- onEvent(event2);
37837
- } catch (error) {
37838
- reject(error);
37839
- }
37840
- }, "watcher");
37841
- watchers.add(watcher);
37842
- signal.addEventListener("abort", () => resolve7(), { once: true });
37843
- onReady?.();
37844
- if (signal.aborted)
37845
- resolve7();
37846
- });
37847
- } finally {
37848
- if (watcher)
37849
- watchers.delete(watcher);
37850
- }
37851
- }, "watch")
37852
- } : { watch: void 0 }
37853
- }), "lentConnection");
37854
- var serveRelay = /* @__PURE__ */ __name((command, messenger) => {
37855
- let held;
37856
- let relay;
37857
- const watchers = /* @__PURE__ */ new Set();
37858
- const borrowed = /* @__PURE__ */ __name(() => {
37859
- const connection = held;
37860
- if (!connection)
37861
- throw new CliError("provider_unavailable", "serve is not connected yet", { retryable: true });
37862
- return lentConnection(connection, watchers);
37863
- }, "borrowed");
37864
- return {
37865
- messenger: {
37866
- ...messenger,
37867
- connect: /* @__PURE__ */ __name(async (...args) => {
37868
- held = await messenger.connect(...args);
37869
- return held;
37870
- }, "connect")
37871
- },
37872
- arrived: /* @__PURE__ */ __name((event2) => {
37873
- for (const watcher of watchers)
37874
- watcher(event2);
37875
- }, "arrived"),
37876
- /** Listens beside the lock; the address goes into it, which is how a client finds it. */
37877
- open: /* @__PURE__ */ __name(async (lockPath, profile) => {
37878
- const environment = environmentOf(command);
37879
- const runCommand = environment.runCommand;
37880
- if (!runCommand)
37881
- return void 0;
37882
- const readOnly = readOnlyLockOf(messenger.app, environment.env ?? process.env);
37883
- const path = relayPath(lockPath);
37884
- relay = await listenRelay(path, (request, io) => runCommand(request.argv, {
37885
- env: {
37886
- ...request.env,
37887
- ...readOnly ? { [`${messenger.app.envPrefix}_READ_ONLY`]: "1" } : {}
37888
- },
37889
- streams: io.streams,
37890
- stdin: io.stdin,
37891
- stdout: io.stdout,
37892
- tty: request.tty,
37893
- signal: io.signal,
37894
- answer: /* @__PURE__ */ __name(() => null, "answer"),
37895
- relayed: { profile, cwd: request.cwd, connection: borrowed }
37896
- }));
37897
- return { path, protocol: RELAY_PROTOCOL };
37898
- }, "open"),
37899
- close: /* @__PURE__ */ __name(async () => {
37900
- await relay?.close();
37901
- }, "close")
37902
- };
37903
- }, "serveRelay");
37904
-
37905
37494
  export {
37906
37495
  communicationFields,
37907
37496
  OFFLINE,
@@ -37913,8 +37502,6 @@ export {
37913
37502
  registriesCover,
37914
37503
  chatCoverage,
37915
37504
  threadIdOf,
37916
- throughWrapper,
37917
- capability,
37918
37505
  syncsOneChat,
37919
37506
  unanswered,
37920
37507
  AUDIT_PAGE,
@@ -38068,42 +37655,8 @@ export {
38068
37655
  validatePreparationCommunications,
38069
37656
  upgradePackage,
38070
37657
  servicesFor,
38071
- RELAY_PROTOCOL,
38072
- relayCommand,
38073
37658
  COMMAND_NEEDS,
38074
37659
  lackedNeed,
38075
37660
  refuseLacking,
38076
- hideNever,
38077
- lentConnection,
38078
- serveRelay,
38079
- positiveCount,
38080
- configuredLimit,
38081
- withPaging,
38082
- window2 as window,
38083
- pagingOf,
38084
- chatRef,
38085
- chatAnswer,
38086
- memberAnswer,
38087
- contactRef,
38088
- contactAnswer,
38089
- contactShown,
38090
- chatEventAnswer,
38091
- memberEventAnswer,
38092
- inviteLinkAnswer,
38093
- joinRequestAnswer,
38094
- pollVoteAnswer,
38095
- reactorAnswer,
38096
- topicAnswer,
38097
- folderAnswer,
38098
- lines,
38099
- pageOf,
38100
- wholeList,
38101
- chatShown,
38102
- scoreFloor,
38103
- auditAnswer,
38104
- renderItem,
38105
- withPage,
38106
- documentLinkAnswer,
38107
- accountAnswer,
38108
- sessionAnswer
37661
+ hideNever
38109
37662
  };