@wirecat/zoom-cli 0.70.0 → 0.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/dist/answer-entities.d.ts +2 -0
  2. package/dist/answer-entities.d.ts.map +1 -1
  3. package/dist/bin/zm.js +2 -2
  4. package/dist/bundle/{all-profiles-GE2TFJJP.js → all-profiles-O4YNVPZX.js} +7 -7
  5. package/dist/bundle/{answer-policy-GOXSDYDD.js → answer-policy-PPSPMCLH.js} +52 -52
  6. package/dist/bundle/{anthropic-FA6NHENI.js → anthropic-7GGRX3RX.js} +13 -4
  7. package/dist/bundle/{app-server-IRADMSNX.js → app-server-CPMKM3HI.js} +46 -46
  8. package/dist/bundle/{bun-ZYZGGCX5.js → bun-POHZKEPV.js} +2 -2
  9. package/dist/bundle/{bun-sqlite-Y24TUIGS.js → bun-sqlite-PGYMBPEL.js} +2 -2
  10. package/dist/bundle/{chunk-DCUWJITQ.js → chunk-2FV5JUQU.js} +38 -592
  11. package/dist/bundle/{chunk-DNR4B5YV.js → chunk-2KESWII5.js} +2 -2
  12. package/dist/bundle/{chunk-KWRCP55G.js → chunk-2RUAMDVV.js} +10 -10
  13. package/dist/bundle/{chunk-IS3ZTT2Z.js → chunk-2U27KIKU.js} +2 -2
  14. package/dist/bundle/chunk-4LAQDZXU.js +1635 -0
  15. package/dist/bundle/{chunk-6IF5ZHDS.js → chunk-4QPQ7MDA.js} +1 -1
  16. package/dist/bundle/{chunk-MVOMLJYQ.js → chunk-4QUFFB2U.js} +3 -3
  17. package/dist/bundle/{chunk-AUNW7N4I.js → chunk-54YDWBYG.js} +1 -1
  18. package/dist/bundle/{chunk-AISJCF7A.js → chunk-5J4AMBMM.js} +4 -4
  19. package/dist/bundle/{chunk-UVPL7YAY.js → chunk-5K7OGPGA.js} +4 -4
  20. package/dist/bundle/{chunk-RO3ZR4VP.js → chunk-5LJTU4LY.js} +12 -12
  21. package/dist/bundle/{chunk-YTN2JN6N.js → chunk-633QXP57.js} +9 -7
  22. package/dist/bundle/{chunk-DXCTW3MV.js → chunk-64ZHF6PJ.js} +1 -1
  23. package/dist/bundle/{chunk-JRO2FWO2.js → chunk-77TCCHMP.js} +1 -1
  24. package/dist/bundle/{chunk-CIZ25UPK.js → chunk-7ROXXRGG.js} +2282 -1087
  25. package/dist/bundle/{chunk-OA37BWE5.js → chunk-ALIT5QFT.js} +1 -1
  26. package/dist/bundle/{chunk-V2E7QFZ3.js → chunk-BBTQIVFP.js} +1 -1
  27. package/dist/bundle/{chunk-M7E44TMT.js → chunk-BGTEVIW4.js} +5 -5
  28. package/dist/bundle/{chunk-2QFPVUM3.js → chunk-CFQF6IGY.js} +2 -2
  29. package/dist/bundle/{chunk-XWQNJKTP.js → chunk-CKPCVEXU.js} +5 -5
  30. package/dist/bundle/{chunk-L24UOUWG.js → chunk-CRFOGYDG.js} +1 -1
  31. package/dist/bundle/{chunk-OAQLVV6W.js → chunk-CT4WVR4N.js} +2 -2
  32. package/dist/bundle/{chunk-SNIY3JDN.js → chunk-DHWBSXG3.js} +20 -20
  33. package/dist/bundle/{chunk-CHGUNZ3L.js → chunk-DIQLXAAZ.js} +3 -3
  34. package/dist/bundle/{chunk-RRRJCHUC.js → chunk-DK6ICIGL.js} +3141 -982
  35. package/dist/bundle/{chunk-YUHM2OJM.js → chunk-DRBQDCDU.js} +9 -9
  36. package/dist/bundle/{chunk-LAG5O2FV.js → chunk-DSVZEXYJ.js} +1093 -895
  37. package/dist/bundle/{chunk-4DSIWYGO.js → chunk-FSHCAWZS.js} +29110 -16686
  38. package/dist/bundle/{chunk-SVF3NDAO.js → chunk-GGS6D4W4.js} +2 -2
  39. package/dist/bundle/{chunk-V5GRSOCZ.js → chunk-GL3MYFMX.js} +3 -3
  40. package/dist/bundle/{chunk-VSLDWT4E.js → chunk-GXF5HFFP.js} +3 -3
  41. package/dist/bundle/{chunk-ZV3INEKM.js → chunk-HB6XJQ3Y.js} +4 -4
  42. package/dist/bundle/{chunk-GB5X3GBE.js → chunk-I4DFFR7F.js} +2 -2
  43. package/dist/bundle/{chunk-ZS55EERO.js → chunk-IAV5BG3I.js} +1 -1
  44. package/dist/bundle/{chunk-VNU5L37V.js → chunk-IED3NS7G.js} +27 -35
  45. package/dist/bundle/{chunk-W7ZEEC4K.js → chunk-INVTDIF6.js} +1 -1
  46. package/dist/bundle/{chunk-GVT5363M.js → chunk-KMV7GZB6.js} +1 -1
  47. package/dist/bundle/{chunk-LXXCLQCW.js → chunk-LE7MDAQG.js} +2 -2
  48. package/dist/bundle/{chunk-2JEM2YNV.js → chunk-M76MXMLY.js} +1 -1
  49. package/dist/bundle/{chunk-RWIILYKW.js → chunk-MEED7YFG.js} +1 -1
  50. package/dist/bundle/{chunk-56OV5ASY.js → chunk-MRI6QMZ3.js} +9 -9
  51. package/dist/bundle/{chunk-BSS6HX4O.js → chunk-MW4EGDDV.js} +2 -2
  52. package/dist/bundle/{chunk-6HJFIMT7.js → chunk-N2FNMION.js} +1 -1
  53. package/dist/bundle/{chunk-J3SKXICS.js → chunk-OHWMIUCT.js} +139 -544
  54. package/dist/bundle/{chunk-M7VUXXGS.js → chunk-OWEBWDHV.js} +58 -3
  55. package/dist/bundle/{chunk-BVWF4B33.js → chunk-P3XC6EDU.js} +15 -19
  56. package/dist/bundle/{chunk-JULBAECW.js → chunk-Q2SUFGSH.js} +16 -6
  57. package/dist/bundle/{chunk-QL7EMFIC.js → chunk-Q3XLZIY3.js} +16 -16
  58. package/dist/bundle/{chunk-M6JIXMQZ.js → chunk-Q5PI72CR.js} +1 -1
  59. package/dist/bundle/{chunk-X4ZF4XXI.js → chunk-QTHIU7CO.js} +1 -1
  60. package/dist/bundle/{chunk-CSEBB4OP.js → chunk-QVSLSWAL.js} +7 -7
  61. package/dist/bundle/{chunk-VJ5ZU4UF.js → chunk-RN4EHCC5.js} +2 -2
  62. package/dist/bundle/{chunk-D3PNCJD5.js → chunk-SELXER2Q.js} +3 -3
  63. package/dist/bundle/{chunk-YJSPBUGB.js → chunk-TM4JSVGQ.js} +38 -49
  64. package/dist/bundle/{chunk-5XWCBLUR.js → chunk-UG447QY2.js} +1 -1
  65. package/dist/bundle/{chunk-RIPAUCKJ.js → chunk-ULDXZ6LH.js} +64 -57
  66. package/dist/bundle/chunk-USQ23X5V.js +1227 -0
  67. package/dist/bundle/{chunk-PV6OHXHN.js → chunk-VJXHIUFP.js} +14 -14
  68. package/dist/bundle/{chunk-3KC7C465.js → chunk-VRH7VRTK.js} +7 -7
  69. package/dist/bundle/{chunk-ZSKE7N2U.js → chunk-X277FBTF.js} +2 -2
  70. package/dist/bundle/{chunk-KM736RMJ.js → chunk-X3ZDN3U7.js} +1 -1
  71. package/dist/bundle/{chunk-CEJJBZAE.js → chunk-X4GWR6GO.js} +8 -8
  72. package/dist/bundle/chunk-XI3VIQKW.js +756 -0
  73. package/dist/bundle/{chunk-IWPXWGF7.js → chunk-YD2RYVMK.js} +33 -33
  74. package/dist/bundle/{chunk-RB33VTUW.js → chunk-YPO2U2YB.js} +473 -118
  75. package/dist/bundle/{chunk-IINZIP73.js → chunk-ZBFL5JPT.js} +7 -6
  76. package/dist/bundle/{chunk-QO2KPU26.js → chunk-ZVI6TFQR.js} +100 -43
  77. package/dist/bundle/{cli-VRSQ7HAE.js → cli-KHMEUXNG.js} +117 -64
  78. package/dist/bundle/command-contract-4K6XXZYE.js +41 -0
  79. package/dist/bundle/config-EEDB632I.js +90 -0
  80. package/dist/bundle/{decode-523PUQMR.js → decode-7RP4HSVE.js} +2 -2
  81. package/dist/bundle/{dist-6WWKPEVW.js → dist-BFT2SUBV.js} +60 -40
  82. package/dist/bundle/{echarts-S5UMX2D3.js → echarts-T2BSQ2YV.js} +2 -2
  83. package/dist/bundle/{embed-ODPDVHUK.js → embed-BAS6YPDT.js} +3 -3
  84. package/dist/bundle/{embedder-PAXRBSZE.js → embedder-5XD5FCAO.js} +6 -6
  85. package/dist/bundle/{first-run-NVTDR5VO.js → first-run-23WWZ2PW.js} +5 -5
  86. package/dist/bundle/first-screen-6HFUYVFR.js +39 -0
  87. package/dist/bundle/{instructions-DUB7E6C5.js → instructions-XZPROPKY.js} +1 -1
  88. package/dist/bundle/{main-A7JSYQI6.js → main-TZXKGL3L.js} +12 -12
  89. package/dist/bundle/{meetings-BDZQV3HR.js → meetings-JB2ISPND.js} +3 -1
  90. package/dist/bundle/{node-E25KP53H.js → node-A3B3MJWX.js} +2 -2
  91. package/dist/bundle/{node-sqlite-PHWDFZCP.js → node-sqlite-QVWDLGDX.js} +3 -3
  92. package/dist/bundle/{oauth-G2K46IYP.js → oauth-YA6IYV4O.js} +4 -4
  93. package/dist/bundle/{open-INWS5HIZ.js → open-SY7TXJBS.js} +2 -2
  94. package/dist/bundle/{openai-T44ORVGQ.js → openai-2AU24NRN.js} +8 -8
  95. package/dist/bundle/{process-UJ2JHMJN.js → process-6HNBTJIY.js} +1 -1
  96. package/dist/bundle/{program-LYTGFV6L.js → program-77BUCJ4H.js} +78 -89
  97. package/dist/bundle/{prompt-VTUCRCE4.js → prompt-YDG73YDS.js} +2 -2
  98. package/dist/bundle/{recognize-3CEPOW2F.js → recognize-ECXDGTB7.js} +1 -1
  99. package/dist/bundle/{remote-DRQEXEZL.js → remote-K4JHGBVJ.js} +4 -4
  100. package/dist/bundle/{rerank-UL4KNNVN.js → rerank-IU2YYD4T.js} +4 -4
  101. package/dist/bundle/{run-log-UZAB5CWF.js → run-log-LFEXNZ74.js} +50 -50
  102. package/dist/bundle/{serve-P5UWUOWQ.js → serve-3XWIF3HI.js} +6 -6
  103. package/dist/bundle/{server-M6XK2Y3X.js → server-56VYOHWP.js} +38 -38
  104. package/dist/bundle/server-YSTMUZ22.js +72 -0
  105. package/dist/bundle/{services-4HRYNY62.js → services-X7IPEGQ5.js} +85 -33
  106. package/dist/bundle/{speech-BBPBMFAO.js → speech-E2OBQWYA.js} +10 -10
  107. package/dist/bundle/{state-GDSUNUSY.js → state-4GMJYK4H.js} +3 -3
  108. package/dist/bundle/{store-VWLABMLF.js → store-KPI7GB5Y.js} +37 -19
  109. package/dist/bundle/{store-LBQ6FZP2.js → store-LA4TV4DM.js} +19 -13
  110. package/dist/bundle/store-connection-AZTIF6IH.js +83 -0
  111. package/dist/bundle/store-maintenance-command-LR572PS4.js +61 -0
  112. package/dist/bundle/zm.js +2 -2
  113. package/dist/bundle/{zoom-app-YIEJLWCW.js → zoom-app-QEJBTIJ4.js} +2 -2
  114. package/dist/contract-overrides.d.ts.map +1 -1
  115. package/dist/contract-overrides.js +0 -6
  116. package/dist/contract-overrides.js.map +1 -1
  117. package/dist/ingestion-search-commands.d.ts.map +1 -1
  118. package/dist/ingestion-search-commands.js +0 -10
  119. package/dist/ingestion-search-commands.js.map +1 -1
  120. package/dist/meeting-integration-commands.d.ts.map +1 -1
  121. package/dist/meeting-integration-commands.js +8 -6
  122. package/dist/meeting-integration-commands.js.map +1 -1
  123. package/dist/meeting-integration.d.ts +3 -1
  124. package/dist/meeting-integration.d.ts.map +1 -1
  125. package/dist/store-connection.d.ts.map +1 -1
  126. package/dist/store-connection.js +4 -3
  127. package/dist/store-connection.js.map +1 -1
  128. package/dist/unified-search.d.ts +4 -4
  129. package/dist/unified-search.d.ts.map +1 -1
  130. package/dist/unified-search.js +1 -24
  131. package/dist/unified-search.js.map +1 -1
  132. package/dist/version.d.ts +1 -1
  133. package/dist/version.js +1 -1
  134. package/package.json +3 -3
  135. package/skills/zoom-cli/SKILL.md +2 -2
  136. package/dist/bundle/chunk-AT2XKNFN.js +0 -342
  137. package/dist/bundle/chunk-VE2VNECR.js +0 -380
  138. package/dist/bundle/chunk-Y6C3N7YG.js +0 -12434
  139. package/dist/bundle/command-contract-RPRKHVU6.js +0 -41
  140. package/dist/bundle/config-QU6A6VIO.js +0 -90
  141. package/dist/bundle/first-screen-5RWZDWLK.js +0 -39
  142. package/dist/bundle/server-F3NPVMS2.js +0 -72
  143. package/dist/bundle/store-connection-XEBFP56U.js +0 -83
  144. package/dist/bundle/store-maintenance-command-G43JN57J.js +0 -61
@@ -2,25 +2,33 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  refuseLacking
5
- } from "./chunk-QL7EMFIC.js";
5
+ } from "./chunk-Q3XLZIY3.js";
6
6
  import {
7
7
  servingProfiles
8
- } from "./chunk-SVF3NDAO.js";
8
+ } from "./chunk-GGS6D4W4.js";
9
9
  import {
10
+ FloodMemory,
10
11
  OFFLINE,
12
+ RecipientList,
11
13
  capability,
14
+ ceilingRefusal,
12
15
  chatIdIn,
16
+ floodPathFor,
17
+ guardFor,
18
+ holdEnd,
13
19
  profilesOnAccount,
20
+ recipientsPathFor,
14
21
  servicesFor,
15
- throughWrapper
16
- } from "./chunk-RRRJCHUC.js";
22
+ throughWrapper,
23
+ withFileLockAsync
24
+ } from "./chunk-DK6ICIGL.js";
17
25
  import {
18
26
  chatReferenceOf,
19
27
  ensureAccount,
20
28
  foldName,
21
29
  isId,
22
30
  pickPerson
23
- } from "./chunk-BVWF4B33.js";
31
+ } from "./chunk-P3XC6EDU.js";
24
32
  import {
25
33
  asFirstWord,
26
34
  baseContext,
@@ -31,45 +39,33 @@ import {
31
39
  recalledAccount,
32
40
  rememberAccount,
33
41
  rootOf2 as rootOf
34
- } from "./chunk-LAG5O2FV.js";
42
+ } from "./chunk-DSVZEXYJ.js";
35
43
  import {
36
44
  providerErrorKey
37
- } from "./chunk-YTN2JN6N.js";
45
+ } from "./chunk-633QXP57.js";
38
46
  import {
39
- LOG_ATTRIBUTES,
40
47
  codeOf,
41
48
  currentOperation,
42
- currentRun,
43
- fromLogAttributes,
44
- limitBatch,
45
- logAttributes
46
- } from "./chunk-J3SKXICS.js";
47
- import {
48
- MESSENGER_CHANGE_REFUSAL,
49
- readOnlyRefusal
50
- } from "./chunk-5XWCBLUR.js";
49
+ limitBatch
50
+ } from "./chunk-OHWMIUCT.js";
51
51
  import {
52
52
  AUTHORITY_KEY,
53
53
  CEILING_KEY,
54
54
  DEFAULT_PERMISSIONS,
55
55
  WRITE_KEYS,
56
56
  keyForCommand,
57
- keyForWrite,
58
57
  levelFor,
59
58
  readKeysForCommand,
60
59
  skipFlagFor
61
- } from "./chunk-M6JIXMQZ.js";
60
+ } from "./chunk-Q5PI72CR.js";
62
61
  import {
63
62
  openStore
64
- } from "./chunk-4DSIWYGO.js";
63
+ } from "./chunk-FSHCAWZS.js";
65
64
  import {
66
65
  isCliFailure
67
- } from "./chunk-RWIILYKW.js";
66
+ } from "./chunk-MEED7YFG.js";
68
67
  import {
69
- logRecordOf,
70
- realSleep,
71
- resolvePaths,
72
- writeSecurely
68
+ resolvePaths
73
69
  } from "./chunk-OORMSM6O.js";
74
70
  import {
75
71
  CliError
@@ -78,7 +74,7 @@ import {
78
74
  __name
79
75
  } from "./chunk-ZVVMGPBJ.js";
80
76
 
81
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/messenger/ask.js
77
+ // node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_737712cd0065e7e21fd5896a79d0773d/node_modules/@wirecat/cli-core/dist/cli/messenger/ask.js
82
78
  import { openSync } from "node:fs";
83
79
  import { createInterface } from "node:readline";
84
80
  import { ReadStream } from "node:tty";
@@ -133,547 +129,7 @@ var terminalAsker = /* @__PURE__ */ __name((command) => async (key, request) =>
133
129
  throw new CliError("cancelled", `${key}: not done \u2014 the answer was no`);
134
130
  }, "terminalAsker");
135
131
 
136
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/sends/guard.js
137
- import { randomUUID } from "node:crypto";
138
-
139
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/sends/flood.js
140
- import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
141
- import { dirname, join } from "node:path";
142
- var MOST_DEADLINES = 50;
143
- var LIMITED_HOLD_MS = 60 * 60 * 1e3;
144
- var FROZEN_HOLD_MS = 24 * 60 * 60 * 1e3;
145
- var NO_END = "9999-12-31T23:59:59.999Z";
146
- var holdEnd = /* @__PURE__ */ __name((block, show = (iso) => iso) => block.until === null ? "until lifted" : `until ${show(block.until)}`, "holdEnd");
147
- var floodPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "flood", `${profile}.json`), "floodPathFor");
148
- var FloodMemory = class {
149
- static {
150
- __name(this, "FloodMemory");
151
- }
152
- path;
153
- now;
154
- constructor(path, now = Date.now) {
155
- this.path = path;
156
- this.now = now;
157
- }
158
- /** What is still in force; anything expired is left out. */
159
- read() {
160
- const now = this.now();
161
- let raw;
162
- try {
163
- raw = JSON.parse(readFileSync(this.path, "utf8"));
164
- } catch {
165
- return { deadlines: [] };
166
- }
167
- const alive = /* @__PURE__ */ __name((until) => typeof until === "string" && Date.parse(until) > now, "alive");
168
- const deadlines = Array.isArray(raw.deadlines) ? raw.deadlines.filter((one) => typeof one?.operation === "string" && alive(one.until)) : [];
169
- const block = raw.sendBlock && (raw.sendBlock.until === NO_END ? { ...raw.sendBlock, until: null } : raw.sendBlock);
170
- const held = block && (block.until === null || alive(block.until));
171
- return { deadlines, ...held ? { sendBlock: block } : {} };
172
- }
173
- /** The deadline this call is still under: one for its chat, or one for the call in every chat. */
174
- owed(operation, chatId) {
175
- return this.read().deadlines.filter((one) => one.operation === operation && (one.chatId === void 0 || one.chatId === chatId)).sort((a, b) => b.until.localeCompare(a.until))[0];
176
- }
177
- remember(deadline) {
178
- const { waitMs, ...rest } = deadline;
179
- const kept = { ...rest, until: new Date(this.now() + waitMs).toISOString() };
180
- const state = this.read();
181
- const others = state.deadlines.filter((one) => one.operation !== kept.operation || one.chatId !== kept.chatId);
182
- const deadlines = [...others, kept].sort((a, b) => b.until.localeCompare(a.until)).slice(0, MOST_DEADLINES);
183
- this.#write({ ...state, deadlines });
184
- return kept;
185
- }
186
- sendBlock() {
187
- return this.read().sendBlock;
188
- }
189
- /** A ban the messenger gave no end for holds until lifted; a spam limit or a freeze without one, for a while. */
190
- block(block) {
191
- const now = this.now();
192
- const holdMs = { limited: LIMITED_HOLD_MS, frozen: FROZEN_HOLD_MS, banned: void 0 }[block.state];
193
- const kept = {
194
- ...block,
195
- since: new Date(now).toISOString(),
196
- until: block.until ?? (holdMs === void 0 ? null : new Date(now + holdMs).toISOString())
197
- };
198
- this.#write({ ...this.read(), sendBlock: kept });
199
- return kept;
200
- }
201
- /** Lifts only a block of this state: an account found not frozen may still be limited for spam. */
202
- unblock(state) {
203
- const { sendBlock, ...rest } = this.read();
204
- if (sendBlock?.state === state)
205
- this.#write(rest);
206
- }
207
- /** Forgets every wait and lifts the hold, and answers with what was still in force. */
208
- clear() {
209
- const cleared = this.read();
210
- this.#write({ deadlines: [] });
211
- return cleared;
212
- }
213
- #write({ sendBlock, ...rest }) {
214
- const state = sendBlock ? { ...rest, sendBlock: { ...sendBlock, until: sendBlock.until ?? NO_END } } : rest;
215
- mkdirSync(dirname(this.path), { recursive: true, mode: 448 });
216
- const temporary = `${this.path}.${process.pid}.tmp`;
217
- writeFileSync(temporary, `${JSON.stringify(state)}
218
- `, { mode: 384 });
219
- renameSync(temporary, this.path);
220
- }
221
- };
222
-
223
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/sends/journal.js
224
- import { appendFileSync, mkdirSync as mkdirSync3, readFileSync as readFileSync2 } from "node:fs";
225
- import { dirname as dirname3, join as join2 } from "node:path";
226
-
227
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/sends/file-lock.js
228
- import { closeSync, mkdirSync as mkdirSync2, openSync as openSync2, statSync, unlinkSync } from "node:fs";
229
- import { dirname as dirname2 } from "node:path";
230
- var LOCK_WAIT_MS = 5e3;
231
- var LOCK_STALE_MS = 3e4;
232
- var RETRY_MS = 20;
233
- var pause = new Int32Array(new SharedArrayBuffer(4));
234
- var withFileLock = /* @__PURE__ */ __name((path, what2, body, waitMs = LOCK_WAIT_MS) => {
235
- const lock = lockFor(path);
236
- const deadline = Date.now() + waitMs;
237
- while (!taken(lock)) {
238
- if (Date.now() >= deadline)
239
- throw lockTimeout(what2, waitMs, lock);
240
- Atomics.wait(pause, 0, 0, RETRY_MS);
241
- }
242
- return holding(lock, body);
243
- }, "withFileLock");
244
- var withFileLockAsync = /* @__PURE__ */ __name(async (path, what2, body, waitMs = LOCK_WAIT_MS, sleep = realSleep) => {
245
- const lock = lockFor(path);
246
- const deadline = Date.now() + waitMs;
247
- while (!taken(lock)) {
248
- if (Date.now() >= deadline)
249
- throw lockTimeout(what2, waitMs, lock);
250
- await sleep(RETRY_MS);
251
- }
252
- return holding(lock, body);
253
- }, "withFileLockAsync");
254
- var lockFor = /* @__PURE__ */ __name((path) => {
255
- mkdirSync2(dirname2(path), { recursive: true, mode: 448 });
256
- return `${path}.lock`;
257
- }, "lockFor");
258
- var taken = /* @__PURE__ */ __name((lock) => {
259
- for (; ; ) {
260
- try {
261
- closeSync(openSync2(lock, "wx", 384));
262
- return true;
263
- } catch (error) {
264
- if (error.code !== "EEXIST")
265
- throw error;
266
- if (Date.now() - lockTime(lock) <= LOCK_STALE_MS)
267
- return false;
268
- try {
269
- unlinkSync(lock);
270
- } catch {
271
- }
272
- }
273
- }
274
- }, "taken");
275
- var holding = /* @__PURE__ */ __name((lock, body) => {
276
- try {
277
- return body();
278
- } finally {
279
- try {
280
- unlinkSync(lock);
281
- } catch {
282
- }
283
- }
284
- }, "holding");
285
- var lockTimeout = /* @__PURE__ */ __name((what2, waitMs, lock) => new CliError("timeout", `${what2} stayed locked for ${waitMs / 1e3}s (${lock})`), "lockTimeout");
286
- var lockTime = /* @__PURE__ */ __name((lock) => {
287
- try {
288
- return statSync(lock).mtimeMs;
289
- } catch {
290
- return Date.now();
291
- }
292
- }, "lockTime");
293
-
294
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/sends/journal.js
295
- var sendsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join2(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "sends", `${profile}.jsonl`), "sendsPathFor");
296
- var SendJournal = class {
297
- static {
298
- __name(this, "SendJournal");
299
- }
300
- path;
301
- resource;
302
- constructor(path, resource = { service: "unknown", version: "unknown" }) {
303
- this.path = path;
304
- this.resource = resource;
305
- }
306
- /**
307
- * Runs `body` with the journal to itself, across processes: two sends at the limit must not both
308
- * read "one left". A lock file opened with `wx`, because `flock` is not there on Windows.
309
- */
310
- locked(body) {
311
- return withFileLock(this.path, "the send journal", body);
312
- }
313
- /** `locked` without blocking the thread while another process holds the journal: what `serve` uses. */
314
- lockedAsync(body) {
315
- return withFileLockAsync(this.path, "the send journal", body);
316
- }
317
- append(entry) {
318
- const { at, ...attributes } = entry;
319
- const { runId, command, traceId } = currentRun();
320
- const record = logRecordOf({
321
- severity: entry.outcome === "sent" || entry.outcome === "reserved" ? "info" : "warn",
322
- event: logAttributes({ event: "send.recorded", ...attributes }),
323
- time: at,
324
- runId,
325
- ...traceId === void 0 ? {} : { traceId },
326
- command,
327
- resource: this.resource,
328
- allow: LOG_ATTRIBUTES
329
- });
330
- mkdirSync3(dirname3(this.path), { recursive: true, mode: 448 });
331
- appendFileSync(this.path, `${JSON.stringify(record)}
332
- `, { mode: 384 });
333
- }
334
- /**
335
- * Oldest first, each reservation folded into its outcome; one with no outcome yet is in flight,
336
- * or its process died. A line that does not parse is skipped: a torn last write must not block sending.
337
- */
338
- entries(filter) {
339
- const lines = this.#lines();
340
- const settled2 = new Set(lines.filter((entry) => entry.outcome !== "reserved").map((entry) => entry.reservation));
341
- const entries = lines.filter((entry) => entry.outcome !== "reserved" || !settled2.has(entry.reservation)).map(({ reservation, ...entry }) => entry.outcome === "reserved" ? { ...entry, reservation } : entry).map(withSendId);
342
- return filter === void 0 ? entries : entries.filter((entry) => (filter.outcome === void 0 || entry.outcome === filter.outcome) && (filter.chatId === void 0 || entry.chatId === filter.chatId) && (filter.operationId === void 0 || entry.operationId === filter.operationId) && (filter.errorCode === void 0 || entry.errorCode === filter.errorCode) && (filter.key === void 0 || entry.key === filter.key));
343
- }
344
- #lines() {
345
- let text;
346
- try {
347
- text = readFileSync2(this.path, "utf8");
348
- } catch {
349
- return [];
350
- }
351
- return text.split("\n").filter((line) => line.trim() !== "").flatMap((line) => {
352
- try {
353
- return [entryOf(JSON.parse(line))];
354
- } catch {
355
- return [];
356
- }
357
- });
358
- }
359
- };
360
- var entryOf = /* @__PURE__ */ __name((line) => {
361
- if (!("attributes" in line))
362
- return line;
363
- const { event: _, ...attributes } = line.attributes;
364
- return { at: line.time, ...fromLogAttributes(attributes) };
365
- }, "entryOf");
366
- var withSendId = /* @__PURE__ */ __name((entry) => {
367
- const { cid, ...rest } = entry;
368
- return cid === void 0 || rest.sendId !== void 0 ? rest : { ...rest, sendId: String(cid) };
369
- }, "withSendId");
370
-
371
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/sends/recipients.js
372
- import { existsSync, readFileSync as readFileSync3, rmSync } from "node:fs";
373
- import { join as join3 } from "node:path";
374
- var recipientsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join3(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "profiles", `${profile}.recipients.json`), "recipientsPathFor");
375
- var RecipientList = class {
376
- static {
377
- __name(this, "RecipientList");
378
- }
379
- path;
380
- command;
381
- lockWaitMs;
382
- /** `command` names the program in the hint that turns the list off. */
383
- constructor(path, command, lockWaitMs) {
384
- this.path = path;
385
- this.command = command;
386
- this.lockWaitMs = lockWaitMs;
387
- }
388
- /** `undefined` when the list is off. A file that cannot be read refuses rather than opening up. */
389
- read() {
390
- if (!existsSync(this.path))
391
- return void 0;
392
- try {
393
- const parsed = JSON.parse(readFileSync3(this.path, "utf8"));
394
- if (!Array.isArray(parsed.chats))
395
- throw new Error("no `chats` array");
396
- return parsed.chats;
397
- } catch (error) {
398
- throw new CliError("configuration_error", `the recipient list ${this.path} cannot be read (${error instanceof Error ? error.message : String(error)}) \u2014 fix the file or turn the list off with \`${this.command} recipients clear\``);
399
- }
400
- }
401
- list(filter = {}) {
402
- const chats = this.read();
403
- return {
404
- state: chats === void 0 ? "off" : chats.length === 0 ? "empty" : "on",
405
- items: (chats ?? []).filter((chat) => (filter.id === void 0 || chat.id === filter.id) && (filter.title === void 0 || chat.title?.toLocaleLowerCase() === filter.title.toLocaleLowerCase()))
406
- };
407
- }
408
- /** Whether it was new. Adding one again fills in a partner an older entry was stored without. */
409
- add(recipient) {
410
- return this.#locked(() => this.#added(recipient));
411
- }
412
- /** `add` waiting for the lock on timers: `recipients add` connects, so it runs inside `serve` when one holds the account. */
413
- addAsync(recipient) {
414
- return withFileLockAsync(this.path, "the recipient list", () => this.#added(recipient), this.lockWaitMs);
415
- }
416
- #added(recipient) {
417
- const chats = this.read() ?? [];
418
- const known = chats.find((chat) => chat.id === recipient.id);
419
- if (known) {
420
- if (recipient.partnerId && !known.partnerId) {
421
- this.#write(chats.map((chat) => chat === known ? { ...known, partnerId: recipient.partnerId } : chat));
422
- }
423
- return false;
424
- }
425
- this.#write([...chats, recipient]);
426
- return true;
427
- }
428
- /** The id or the title as it was stored; `undefined` when neither matched. */
429
- remove(reference) {
430
- return this.#locked(() => {
431
- const chats = this.read() ?? [];
432
- const wanted = reference.trim();
433
- const gone = chats.find((chat) => chat.id === wanted) ?? chats.find((chat) => chat.title?.toLocaleLowerCase() === wanted.toLocaleLowerCase());
434
- if (gone)
435
- this.#write(chats.filter((chat) => chat !== gone));
436
- return gone;
437
- });
438
- }
439
- /**
440
- * The chat the messenger now names `to`: its entry, and a partner of that id, follow it. Only an entry already there
441
- * changes, and no list is created, so the list never opens up. Whether anything changed.
442
- */
443
- async rekey(from, to) {
444
- if (from === to)
445
- return false;
446
- return withFileLockAsync(this.path, "the recipient list", () => {
447
- const chats = this.read();
448
- if (!chats?.some((chat) => chat.id === from || chat.partnerId === from))
449
- return false;
450
- const held = chats.some((chat) => chat.id === to);
451
- this.#write(chats.filter((chat) => !(held && chat.id === from)).map((chat) => ({
452
- ...chat,
453
- ...chat.id === from ? { id: to } : {},
454
- ...chat.partnerId === from ? { partnerId: to } : {}
455
- })));
456
- return true;
457
- }, this.lockWaitMs);
458
- }
459
- /** Whether there was a list to turn off. */
460
- off() {
461
- return this.#locked(() => {
462
- if (!existsSync(this.path))
463
- return false;
464
- rmSync(this.path);
465
- return true;
466
- });
467
- }
468
- /**
469
- * Every change reads and writes under one lock: a `serve` re-keying while the owner removes a chat must not write
470
- * the removed chat back. A lock held too long refuses the change and leaves the list as it was. Blocks the thread
471
- * while it waits: for callers that cannot be async, and `recipients remove` and `clear`, which never
472
- * connect and so never run inside `serve`.
473
- */
474
- #locked(body) {
475
- return withFileLock(this.path, "the recipient list", body, this.lockWaitMs);
476
- }
477
- #write(chats) {
478
- writeSecurely(this.path, `${JSON.stringify({ chats }, null, 2)}
479
- `, 384);
480
- }
481
- };
482
-
483
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/sends/guard.js
484
- var HOUR_MS = 60 * 60 * 1e3;
485
- var READS_UNDER_HOLD = /* @__PURE__ */ new Set([
486
- "attachments.extract",
487
- "conversations.embeddings",
488
- "conversations.links",
489
- "messages.server-search",
490
- "messages.sync-first",
491
- "stats.contacts.top.sync-first",
492
- "stats.messages.counters.sync",
493
- "stats.messages.show.sync-first",
494
- "stats.messages.top.sync-first",
495
- "store.gaps.repair"
496
- ]);
497
- var countsTowardLimit = /* @__PURE__ */ __name(({ kind = "message", action, notify }) => kind === "message" || kind === "forward" || kind === "edit" || kind === "delete" || kind === "pin" && notify === true || action === "create" || action === "members.add" || action === "requests.accept" || action === "join" || action === "contact-import", "countsTowardLimit");
498
- var weightOf = /* @__PURE__ */ __name(({ kind = "message", action, count, people }) => kind === "delete" || kind === "message" && action === void 0 ? Math.max(1, count ?? 1) : action === "create" || action === "members.add" || action === "requests.accept" || action === "contact-import" ? Math.max(1, people ?? count ?? 1) : 1, "weightOf");
499
- var timeOf = /* @__PURE__ */ __name((entry) => Date.parse(entry.scheduledFor ?? entry.at), "timeOf");
500
- var ceilingRefusal = /* @__PURE__ */ __name((key, command) => new CliError("permission_error", `${key} is not allowed: setup's answer keeps every WireCat tool read-only; the owner changes it at a terminal with \`${command} setup\``, { permission: key }), "ceilingRefusal");
501
- var levelRefusal = /* @__PURE__ */ __name((refused, fix = `${refused.command} ${refused.profile} config set permissions.${refused.key} allow`) => refused.named === CEILING_KEY ? ceilingRefusal(refused.key, refused.command) : new CliError("permission_error", `profile ${refused.profile} does not let ${refused.key} write (permissions.${refused.named} is ${refused.level}, from the ${refused.permissionSources[refused.named ?? ""] ?? "default"}); to allow it: ${fix}`, { permission: refused.key }), "levelRefusal");
502
- var sendGuard = /* @__PURE__ */ __name(({ profile, recipients, command = recipients.command, readOnlyLock, permissions, permissionSources = {}, permissionDefaults, permissionFix, ask = refuseToAsk, sendsPerHour, journal, flood, warn, now = /* @__PURE__ */ __name(() => /* @__PURE__ */ new Date(), "now") }) => {
503
- const currentPermissions = /* @__PURE__ */ __name(() => typeof permissions === "function" ? permissions() : permissions, "currentPermissions");
504
- let reservation;
505
- const answered = /* @__PURE__ */ new WeakSet();
506
- const refuseReadOnly = /* @__PURE__ */ __name(() => {
507
- if (readOnlyLock)
508
- throw readOnlyRefusal(readOnlyLock, MESSENGER_CHANGE_REFUSAL);
509
- }, "refuseReadOnly");
510
- const refuseHeld = /* @__PURE__ */ __name(({ key }) => {
511
- if (key !== void 0 && READS_UNDER_HOLD.has(key))
512
- return;
513
- const block = flood?.sendBlock();
514
- if (!block)
515
- return;
516
- throw new CliError("permission_error", `profile ${profile} holds its writes ${holdEnd(block)}: ${block.hint} \u2014 reads still work; do not retry: the owner checks the account with \`${command} ${profile} doctor --online\`, and lifts the hold with \`${command} ${profile} flood clear\` once it is over`, { sendBlock: block, standing: { state: block.state, hint: block.hint } });
517
- }, "refuseHeld");
518
- const permitted = /* @__PURE__ */ __name((request) => {
519
- const { chatId, kind = "message", action, personIds } = request;
520
- refuseReadOnly();
521
- const levels = currentPermissions();
522
- if (levels !== void 0) {
523
- const key = request.key ?? keyForWrite(kind, action);
524
- const { level, key: named } = levelFor(levels, key, permissionDefaults);
525
- if (level === "deny" || level === "readonly")
526
- throw levelRefusal({ profile, command, key, level, named, permissionSources }, permissionFix?.(request, key));
527
- if (level === "ask" && !answered.has(request)) {
528
- throw new CliError("confirmation_required", `${key} asks before it acts, and it was not asked`);
529
- }
530
- }
531
- const allowed = recipients.read();
532
- if (chatId !== null && allowed && !allowed.some((chat) => chat.id === chatId)) {
533
- throw new CliError("confirmation_required", `chat ${chatId} is not on the recipient list of profile ${profile} \u2014 the owner adds it with \`${command} ${profile} recipients add ${chatId}\``, { chat_id: chatId });
534
- }
535
- const strangers = allowed ? (personIds ?? []).filter((id) => !allowed.some((chat) => chat.partnerId === id)) : [];
536
- if (strangers.length > 0) {
537
- throw new CliError("confirmation_required", `${strangers.join(", ")} ${strangers.length === 1 ? "is" : "are"} not on the recipient list of profile ${profile} \u2014 the owner adds the one-to-one chat with each person (\`${command} ${profile} recipients add <chat>\`); a chat added to the list earlier is added again to be recognised`, { person_ids: strangers });
538
- }
539
- }, "permitted");
540
- const withinLimit = /* @__PURE__ */ __name((request, entries) => {
541
- const { chatId, sendId } = request;
542
- const asked = { ...request, people: request.personIds?.length ?? request.count };
543
- const count = weightOf(asked);
544
- if (count > sendsPerHour) {
545
- throw new CliError("rate_limited", `${count} at once is more than the hourly limit of profile ${profile} (sendsPerHour ${sendsPerHour}) \u2014 do fewer at a time`);
546
- }
547
- const at = request.scheduledFor ? Date.parse(request.scheduledFor) : now().getTime();
548
- const counted = entries.filter(countsTowardLimit).filter((entry) => entry.outcome === "sent" || entry.outcome === "outcome_unknown" || entry.outcome === "reserved").filter((entry) => Math.abs(timeOf(entry) - at) < HOUR_MS);
549
- const unsure = /* @__PURE__ */ __name((entry) => entry.outcome === "outcome_unknown", "unsure");
550
- const same = /* @__PURE__ */ __name((a, b) => a.sendId !== void 0 && a.sendId === b.sendId && a.chatId === b.chatId, "same");
551
- const last = [...counted].reverse().find((entry) => same(entry, { chatId, sendId }));
552
- if (sendId !== void 0 && last && unsure(last)) {
553
- if (last.sendAs !== request.sendAs) {
554
- throw new CliError("validation_error", "this send id was tried under another identity; repeat it with the same --send-as, or it may post twice", { operation_id: sendId, retryable: false });
555
- }
556
- return false;
557
- }
558
- const recent = counted.filter((entry, index) => !(unsure(entry) && counted.slice(index + 1).some((later) => same(later, entry)))).map((entry) => ({ time: timeOf(entry), weight: weightOf(entry) })).sort((a, b) => a.time - b.time);
559
- const used = recent.reduce((sum, { weight }) => sum + weight, 0);
560
- if (used + count > sendsPerHour) {
561
- let freed = 0;
562
- const opening = recent.find(({ weight }) => {
563
- freed += weight;
564
- return used - freed + count <= sendsPerHour;
565
- });
566
- const nextMs = (opening?.time ?? 0) + HOUR_MS;
567
- const next = new Date(nextMs).toISOString();
568
- throw new CliError("rate_limited", `profile ${profile} has sent ${used} messages in the hour around ${new Date(at).toISOString()}, and its limit is ${sendsPerHour} (sendsPerHour) \u2014 the next send is possible at ${next}`, { retry_after_ms: nextMs - now().getTime(), retry_at: next });
569
- }
570
- return true;
571
- }, "withinLimit");
572
- const counting = /* @__PURE__ */ __name((request) => {
573
- permitted(request);
574
- refuseHeld(request);
575
- const asked = { ...request, people: request.personIds?.length ?? request.count };
576
- const creatingTopic = request.kind === "chat" && request.action === "topic-create";
577
- if (!countsTowardLimit(asked) && !creatingTopic)
578
- return void 0;
579
- const checked = /* @__PURE__ */ __name((entries) => {
580
- if (!creatingTopic)
581
- return withinLimit(request, entries);
582
- if (request.sendId === void 0)
583
- throw new CliError("validation_error", "a topic creation needs an attempt id");
584
- if (entries.some((entry) => entry.action === "topic-create" && entry.sendId === request.sendId && ["sent", "outcome_unknown", "reserved"].includes(entry.outcome))) {
585
- throw new CliError("validation_error", "this topic creation was already attempted; check topics list and do not repeat an unknown creation", { operation_id: request.sendId, retryable: false });
586
- }
587
- return true;
588
- }, "checked");
589
- const reserving = /* @__PURE__ */ __name(() => {
590
- if (!checked(journal.entries()))
591
- return;
592
- const id = randomUUID();
593
- const { chatId, kind, action, sendId, operationId, scheduledFor, notify } = request;
594
- journal.append({
595
- at: now().toISOString(),
596
- profile,
597
- chatId,
598
- outcome: "reserved",
599
- reservation: id,
600
- ...kind ? { kind } : {},
601
- ...action ? { action } : {},
602
- ...asked.people === void 0 ? {} : kind === "delete" || kind === "message" || kind === void 0 ? { count: asked.people } : { people: asked.people },
603
- ...sendId === void 0 ? {} : { sendId },
604
- ...operationId === void 0 ? {} : { operationId },
605
- ...scheduledFor ? { scheduledFor } : {},
606
- ...notify === void 0 ? {} : { notify }
607
- });
608
- reservation = id;
609
- }, "reserving");
610
- return { checked, reserving };
611
- }, "counting");
612
- return {
613
- ask: /* @__PURE__ */ __name(async (request) => {
614
- refuseReadOnly();
615
- const levels = currentPermissions();
616
- if (levels === void 0)
617
- return;
618
- const key = request.key ?? keyForWrite(request.kind ?? "message", request.action);
619
- if (levelFor(levels, key, permissionDefaults).level !== "ask")
620
- return;
621
- refuseHeld(request);
622
- await ask(key, request);
623
- answered.add(request);
624
- }, "ask"),
625
- check: /* @__PURE__ */ __name((request, { reserve = true } = {}) => {
626
- const counted = counting(request);
627
- if (!counted)
628
- return;
629
- if (reserve)
630
- journal.locked(counted.reserving);
631
- else
632
- counted.checked(journal.entries());
633
- }, "check"),
634
- reserve: /* @__PURE__ */ __name(async (request) => {
635
- const counted = counting(request);
636
- if (counted)
637
- await journal.lockedAsync(counted.reserving);
638
- }, "reserve"),
639
- // After a send, a failure to write here must not become the command's answer: the message is
640
- // already with a person, and an error would invite the caller to send it again.
641
- record: /* @__PURE__ */ __name((entry) => {
642
- const { personIds: _, ...kept } = entry;
643
- const settles = entry.outcome === "refused" ? void 0 : reservation;
644
- reservation = void 0;
645
- try {
646
- journal.append({ at: now().toISOString(), profile, ...kept, ...settles ? { reservation: settles } : {} });
647
- } catch (error) {
648
- warn(`this send is not in the send journal: ${journalFailure(error)}`, {
649
- event: "warning",
650
- code: "send_not_journaled",
651
- operation: "sends.journal"
652
- });
653
- }
654
- }, "record")
655
- };
656
- }, "sendGuard");
657
- var refuseToAsk = /* @__PURE__ */ __name(async (key) => {
658
- throw new CliError("confirmation_required", `${key} asks before it acts (its permission level is ask), and nobody is here to answer \u2014 add ${skipFlagFor(key)} to go ahead`);
659
- }, "refuseToAsk");
660
- var guardFor = /* @__PURE__ */ __name((app, settings, warn, env = process.env, ask) => sendGuard({
661
- profile: settings.profile,
662
- command: app.command,
663
- ...settings.readOnlyLock ? { readOnlyLock: settings.readOnlyLock } : {},
664
- permissions: /* @__PURE__ */ __name(() => settings.permissions, "permissions"),
665
- permissionSources: settings.permissionSources,
666
- ...settings.permissionDefaults ? { permissionDefaults: settings.permissionDefaults } : {},
667
- ...ask ? { ask } : {},
668
- sendsPerHour: settings.sendsPerHour,
669
- journal: new SendJournal(sendsPathFor(app, settings.profile, env), { service: app.command, version: app.version }),
670
- recipients: new RecipientList(recipientsPathFor(app, settings.profile, env), app.command),
671
- flood: new FloodMemory(floodPathFor(app, settings.profile, env)),
672
- warn
673
- }), "guardFor");
674
- var journalFailure = /* @__PURE__ */ __name((error) => error?.code ?? (error instanceof Error ? error.name : "error"), "journalFailure");
675
-
676
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/permission-keys.js
132
+ // node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_737712cd0065e7e21fd5896a79d0773d/node_modules/@wirecat/cli-core/dist/cli/permission-keys.js
677
133
  var HOUSEKEEPING = /* @__PURE__ */ new Set([
678
134
  "help",
679
135
  "guide",
@@ -753,7 +209,7 @@ var refuseUnknownPermissionKeys = /* @__PURE__ */ __name((command, settings, too
753
209
  throw new CliError("validation_error", `--permission ${key} names no command`, { permission: key });
754
210
  }, "refuseUnknownPermissionKeys");
755
211
 
756
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/messenger/stored.js
212
+ // node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_737712cd0065e7e21fd5896a79d0773d/node_modules/@wirecat/cli-core/dist/cli/messenger/stored.js
757
213
  var REKEY_PACING = { lockMs: 50, pauseMs: 25 };
758
214
  var stored = /* @__PURE__ */ __name((messenger, { account, store, warn, events, pending, announcing, deletedWithoutChat, profile, rekeyed, rekeyPacing = REKEY_PACING, closing, namesFromStore, recipientIds, countsUnread = false, historyLimits, command = "cli" }) => {
759
215
  let warned = false;
@@ -874,13 +330,13 @@ var stored = /* @__PURE__ */ __name((messenger, { account, store, warn, events,
874
330
  }
875
331
  if (round !== rekeyRound)
876
332
  return;
877
- const taken2 = pass?.taken ?? rest.length;
878
- rekeysQueued -= taken2;
333
+ const taken = pass?.taken ?? rest.length;
334
+ rekeysQueued -= taken;
879
335
  for (const { from, to } of pass?.applied ?? [])
880
336
  await Promise.resolve().then(() => rekeyed?.(from, to)).catch((error) => notWritten("history.rekey", error));
881
337
  for (const { error } of pass?.refused ?? [])
882
338
  notWritten("history.rekey", error);
883
- rest = rest.slice(taken2);
339
+ rest = rest.slice(taken);
884
340
  if (rest.length > 0)
885
341
  await new Promise((resolve) => setTimeout(resolve, rekeyPacing.pauseMs));
886
342
  }
@@ -1329,11 +785,11 @@ var keep = /* @__PURE__ */ __name(async (store, account, event, seenAt, among, c
1329
785
  }
1330
786
  }, "keep");
1331
787
 
1332
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/sends/pace.js
1333
- import { readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
1334
- import { join as join4 } from "node:path";
788
+ // node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_737712cd0065e7e21fd5896a79d0773d/node_modules/@wirecat/cli-core/dist/sends/pace.js
789
+ import { readFileSync, renameSync, writeFileSync } from "node:fs";
790
+ import { join } from "node:path";
1335
791
  var DEFAULT_PACE = { perMinute: 60, burst: 20 };
1336
- var pacePathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join4(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "pace", `${profile}.json`), "pacePathFor");
792
+ var pacePathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "pace", `${profile}.json`), "pacePathFor");
1337
793
  var Pacer = class {
1338
794
  static {
1339
795
  __name(this, "Pacer");
@@ -1375,7 +831,7 @@ var Pacer = class {
1375
831
  }
1376
832
  read() {
1377
833
  try {
1378
- const tat = Number(JSON.parse(readFileSync4(this.path, "utf8")).tat);
834
+ const tat = Number(JSON.parse(readFileSync(this.path, "utf8")).tat);
1379
835
  return Number.isFinite(tat) ? tat : 0;
1380
836
  } catch {
1381
837
  return 0;
@@ -1383,8 +839,8 @@ var Pacer = class {
1383
839
  }
1384
840
  write(tat) {
1385
841
  const temporary = `${this.path}.${process.pid}.tmp`;
1386
- writeFileSync2(temporary, JSON.stringify({ tat }), { mode: 384 });
1387
- renameSync2(temporary, this.path);
842
+ writeFileSync(temporary, JSON.stringify({ tat }), { mode: 384 });
843
+ renameSync(temporary, this.path);
1388
844
  }
1389
845
  };
1390
846
  var ANNOUNCE_WAIT_MS = 5e3;
@@ -1419,7 +875,7 @@ var waitForTurn = /* @__PURE__ */ __name(async (pacer, options) => {
1419
875
  await (options.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms))))(waitMs);
1420
876
  }, "waitForTurn");
1421
877
 
1422
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/messenger/flooded.js
878
+ // node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_737712cd0065e7e21fd5896a79d0773d/node_modules/@wirecat/cli-core/dist/cli/messenger/flooded.js
1423
879
  var LONG_LIVED = /* @__PURE__ */ new Set(["self", "newSendId", "close", "formatMarkdown", "formatHtml", "storedChats"]);
1424
880
  var LISTENING = /* @__PURE__ */ new Set(["watch", "feed", "listen", "listenHistory"]);
1425
881
  var BLOCKING = /* @__PURE__ */ new Set(["frozen", "limited", "banned"]);
@@ -1516,7 +972,7 @@ var flooded = /* @__PURE__ */ __name((messenger, memory, { name, warn, pacer })
1516
972
  });
1517
973
  }, "flooded");
1518
974
 
1519
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/messenger/observed.js
975
+ // node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_737712cd0065e7e21fd5896a79d0773d/node_modules/@wirecat/cli-core/dist/cli/messenger/observed.js
1520
976
  var observed = /* @__PURE__ */ __name((messenger, events) => {
1521
977
  const timed = /* @__PURE__ */ __name(async (operation, named, work, after) => {
1522
978
  const write = currentOperation();
@@ -1615,7 +1071,7 @@ var byPart = /* @__PURE__ */ __name((batch, counts) => {
1615
1071
  counts[part] = (counts[part] ?? 0) + items.length;
1616
1072
  }, "byPart");
1617
1073
 
1618
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/messenger/context.js
1074
+ // node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_737712cd0065e7e21fd5896a79d0773d/node_modules/@wirecat/cli-core/dist/cli/messenger/context.js
1619
1075
  var lazyStore = /* @__PURE__ */ __name((env, command, version) => {
1620
1076
  let opened;
1621
1077
  return {
@@ -1957,6 +1413,7 @@ var messengerContext = /* @__PURE__ */ __name((command, messenger, resolving = {
1957
1413
  history: base.settings.record,
1958
1414
  searchCatchUp: base.settings.searchCatchUp,
1959
1415
  ...base.settings.historyLimits ? { historyLimits: base.settings.historyLimits } : {},
1416
+ historyMuted: base.settings.historyMuted,
1960
1417
  pictures: base.settings.pictureSearch,
1961
1418
  reranker: base.settings.searchReranker,
1962
1419
  guard,
@@ -2015,17 +1472,6 @@ var messengerContext = /* @__PURE__ */ __name((command, messenger, resolving = {
2015
1472
  export {
2016
1473
  answerOf,
2017
1474
  terminalAsker,
2018
- holdEnd,
2019
- floodPathFor,
2020
- FloodMemory,
2021
- sendsPathFor,
2022
- SendJournal,
2023
- recipientsPathFor,
2024
- RecipientList,
2025
- ceilingRefusal,
2026
- levelRefusal,
2027
- sendGuard,
2028
- guardFor,
2029
1475
  DEFAULT_PACE,
2030
1476
  pacePathFor,
2031
1477
  Pacer,