@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
@@ -9,26 +9,23 @@ import {
9
9
  id,
10
10
  text,
11
11
  time
12
- } from "./chunk-VE2VNECR.js";
12
+ } from "./chunk-USQ23X5V.js";
13
13
  import {
14
14
  readSharedSection,
15
15
  sharedConfigPath,
16
16
  writeSharedSection
17
- } from "./chunk-UVPL7YAY.js";
17
+ } from "./chunk-5K7OGPGA.js";
18
18
  import {
19
19
  TAG_TYPES
20
- } from "./chunk-AT2XKNFN.js";
20
+ } from "./chunk-XI3VIQKW.js";
21
21
  import {
22
22
  filesPresent,
23
23
  sharedModelsDirectory
24
- } from "./chunk-VSLDWT4E.js";
24
+ } from "./chunk-GXF5HFFP.js";
25
25
  import {
26
26
  storePath
27
- } from "./chunk-GVT5363M.js";
27
+ } from "./chunk-KMV7GZB6.js";
28
28
  import {
29
- createRecordLog,
30
- resolvePaths,
31
- traceIdOf,
32
29
  writeSecurely
33
30
  } from "./chunk-OORMSM6O.js";
34
31
  import {
@@ -64,487 +61,7 @@ import {
64
61
  __name
65
62
  } from "./chunk-ZVVMGPBJ.js";
66
63
 
67
- // 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/runs/run.js
68
- import { randomUUID } from "node:crypto";
69
- import { appendFileSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
70
- import { userInfo } from "node:os";
71
- import { join, sep } from "node:path";
72
-
73
- // 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/runs/log-keys.js
74
- var snake = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snake");
75
- var camel = /* @__PURE__ */ __name((key) => key.replace(/_([a-z0-9])/g, (_, letter) => letter.toUpperCase()), "camel");
76
- var renamed = /* @__PURE__ */ __name((record2, name) => Object.fromEntries(Object.entries(record2).map(([key, value]) => [name(key), value])), "renamed");
77
- var logAttributes = /* @__PURE__ */ __name((event) => renamed(event, snake), "logAttributes");
78
- var fromLogAttributes = /* @__PURE__ */ __name((attributes) => renamed(attributes, camel), "fromLogAttributes");
79
- var snakeLogger = /* @__PURE__ */ __name((logger) => ({
80
- debug: /* @__PURE__ */ __name((event, message) => logger.debug(logAttributes(event), message), "debug"),
81
- info: /* @__PURE__ */ __name((event, message) => logger.info(logAttributes(event), message), "info"),
82
- warn: /* @__PURE__ */ __name((event, message) => logger.warn(logAttributes(event), message), "warn"),
83
- error: /* @__PURE__ */ __name((event, message) => logger.error(logAttributes(event), message), "error")
84
- }), "snakeLogger");
85
-
86
- // 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/runs/log-attributes.js
87
- var diagnostic = {
88
- event: true,
89
- operation: true,
90
- opcode: true,
91
- seq: true,
92
- status: true,
93
- method: true,
94
- endpointTemplate: true,
95
- bytes: true,
96
- ids: true,
97
- counts: true,
98
- durationMs: true,
99
- outcome: true,
100
- errorCode: true,
101
- providerError: true,
102
- level: true,
103
- transport: true,
104
- attempt: true,
105
- waitMs: true,
106
- code: true,
107
- detail: true,
108
- reason: true,
109
- ageMs: true
110
- };
111
- var send = {
112
- profile: true,
113
- chatId: true,
114
- outcome: true,
115
- kind: true,
116
- action: true,
117
- people: true,
118
- messageId: true,
119
- key: true,
120
- count: true,
121
- forEveryone: true,
122
- sendId: true,
123
- operationId: true,
124
- parentOperationId: true,
125
- replyTo: true,
126
- threadId: true,
127
- sendAs: true,
128
- resultChatId: true,
129
- length: true,
130
- attachments: true,
131
- scheduledFor: true,
132
- notify: true,
133
- origin: true,
134
- reservation: true,
135
- errorCode: true
136
- };
137
- var background = [
138
- "job",
139
- "pid",
140
- "schedule",
141
- "exitCode",
142
- "tool",
143
- "tier",
144
- "actorType",
145
- "actorId",
146
- "agent",
147
- "targetType",
148
- "targetId"
149
- ];
150
- var crash = ["errorClass", "frames"];
151
- var dropped = ["dropped"];
152
- var LOG_ATTRIBUTES = [
153
- ...new Set([...Object.keys(diagnostic), ...Object.keys(send), ...background, ...crash, ...dropped].map((key) => Object.keys(logAttributes({ [key]: true }))[0]))
154
- ].sort();
155
-
156
- // 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/runs/run.js
157
- var KEEP_RUNS_FOR_DAYS = 30;
158
- var KEEP_SUCCESSFUL_RUNS_FOR_DAYS = 7;
159
- var RUNS_SIZE_LIMIT_MB = 200;
160
- var runsDirFor = /* @__PURE__ */ __name((app, env = process.env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "runs"), "runsDirFor");
161
- var startRun = /* @__PURE__ */ __name((options) => {
162
- const now = options.now ?? (() => /* @__PURE__ */ new Date());
163
- const startedAt = options.startedAt ?? now();
164
- const id2 = options.runId ?? newRunId(startedAt, options.command);
165
- const dir = join(options.runsDir, day(startedAt), id2);
166
- pruneRuns(options.runsDir, {
167
- keepDays: options.keepDays ?? KEEP_RUNS_FOR_DAYS,
168
- keepSuccessDays: options.keepSuccessDays ?? KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
169
- maxBytes: options.maxBytes ?? RUNS_SIZE_LIMIT_MB * 1024 * 1024,
170
- now: startedAt
171
- });
172
- refuseRealStateInTests(dir);
173
- const metadata = {
174
- runId: id2,
175
- command: options.command,
176
- ...options.profile === void 0 ? {} : { profile: options.profile },
177
- startedAt: startedAt.toISOString(),
178
- status: "running",
179
- cliVersion: options.cliVersion,
180
- runtime: runtime(),
181
- platform: process.platform,
182
- arch: process.arch,
183
- ...options.traceId === void 0 ? {} : { traceId: options.traceId },
184
- ...options.context
185
- };
186
- let file;
187
- const opened = /* @__PURE__ */ __name(() => {
188
- if (file)
189
- return file;
190
- mkdirSync(dir, { recursive: true, mode: 448 });
191
- const events = join(dir, "events.jsonl");
192
- writeFileSync(events, "", { flag: "a", mode: 384 });
193
- file = snakeLogger(createRecordLog({
194
- to: events,
195
- runId: id2,
196
- command: options.command,
197
- resource: { service: options.service, version: options.cliVersion },
198
- allow: LOG_ATTRIBUTES,
199
- ...options.traceId === void 0 ? {} : { traceId: options.traceId },
200
- ...options.onError === void 0 ? {} : { onError: options.onError }
201
- }));
202
- writeRunFile(dir, metadata);
203
- return file;
204
- }, "opened");
205
- if (!options.lazy)
206
- opened();
207
- let finished = false;
208
- const operations = /* @__PURE__ */ new Set();
209
- const codes = /* @__PURE__ */ new Set();
210
- const noted = /* @__PURE__ */ __name((level) => (event, message) => {
211
- const { operation, errorCode, error_code, code } = event;
212
- if (typeof operation === "string")
213
- operations.add(operation);
214
- for (const value of [errorCode, error_code, code])
215
- if (typeof value === "string")
216
- codes.add(value);
217
- if (finished)
218
- return;
219
- opened()[level](event, message);
220
- }, "noted");
221
- const logger = { debug: noted("debug"), info: noted("info"), warn: noted("warn"), error: noted("error") };
222
- return {
223
- id: id2,
224
- dir,
225
- logger,
226
- finish: /* @__PURE__ */ __name(async (status, extra = {}) => {
227
- if (finished)
228
- return;
229
- finished = true;
230
- const completedAt = now();
231
- const final = {
232
- ...metadata,
233
- ...extra,
234
- status,
235
- completedAt: completedAt.toISOString(),
236
- durationMs: completedAt.getTime() - startedAt.getTime(),
237
- operations: [...operations].sort(),
238
- codes: [...codes].sort()
239
- };
240
- if (file || status !== "success") {
241
- opened();
242
- writeRunFile(dir, final);
243
- return;
244
- }
245
- try {
246
- mkdirSync(join(dir, ".."), { recursive: true, mode: 448 });
247
- appendIndex(join(dir, ".."), runFileOf(final));
248
- } catch (error) {
249
- options.onError?.(error);
250
- }
251
- }, "finish")
252
- };
253
- }, "startRun");
254
- var refuseRealStateInTests = /* @__PURE__ */ __name((dir, env = process.env) => {
255
- if (env.VITEST === void 0)
256
- return;
257
- let home;
258
- try {
259
- home = userInfo().homedir;
260
- } catch {
261
- return;
262
- }
263
- if (dir.startsWith(join(home, ".local", "share") + sep))
264
- throw new Error(`a test opened a run in the real data folder: ${dir}`);
265
- }, "refuseRealStateInTests");
266
- var runtime = /* @__PURE__ */ __name(() => {
267
- const bun = process.versions.bun;
268
- return bun ? `bun ${bun}` : `node ${process.versions.node}`;
269
- }, "runtime");
270
- var newRunId = /* @__PURE__ */ __name((startedAt, command) => {
271
- const stamp = startedAt.toISOString().replace(/[-:]/g, "").replace(/\.\d+Z$/, "Z");
272
- const slug2 = command.replace(/[^a-z0-9]+/gi, "-").toLowerCase();
273
- return `${stamp}-${slug2}-${randomUUID().slice(0, 6)}`;
274
- }, "newRunId");
275
- var INDEX = "index.jsonl";
276
- var appendIndex = /* @__PURE__ */ __name((dayDir, written) => {
277
- appendFileSync(join(dayDir, INDEX), `${JSON.stringify(written)}
278
- `, { mode: 384 });
279
- }, "appendIndex");
280
- var writeRunFile = /* @__PURE__ */ __name((dir, metadata) => {
281
- const written = runFileOf(metadata);
282
- writeSecurely(join(dir, "run.json"), `${JSON.stringify(written, null, 2)}
283
- `, 384);
284
- try {
285
- appendIndex(join(dir, ".."), written);
286
- } catch {
287
- }
288
- }, "writeRunFile");
289
- var matchesListFilter = /* @__PURE__ */ __name((run, filter) => (filter.runId === void 0 || run.runId === filter.runId) && (filter.command === void 0 || run.command === filter.command) && (filter.profile === void 0 || run.profile === filter.profile) && (filter.status === void 0 || run.status === filter.status) && (filter.errorCode === void 0 || run.errorCode === filter.errorCode), "matchesListFilter");
290
- var listRuns = /* @__PURE__ */ __name((runsDir, { since, atLeast = Number.POSITIVE_INFINITY, filter = {} } = {}) => {
291
- const first = since === void 0 ? void 0 : day(new Date(since));
292
- const runs = [];
293
- for (const date of days(runsDir).sort().reverse()) {
294
- if (first !== void 0 && date < first || runs.length >= atLeast)
295
- break;
296
- for (const metadata of runsOfDay(join(runsDir, date))) {
297
- if (matchesListFilter(metadata, filter))
298
- runs.push(metadata);
299
- }
300
- }
301
- return runs;
302
- }, "listRuns");
303
- var indexedRuns = /* @__PURE__ */ __name((dayDir) => {
304
- const latest = /* @__PURE__ */ new Map();
305
- let raw = "";
306
- try {
307
- raw = readFileSync(join(dayDir, INDEX), "utf8");
308
- } catch {
309
- }
310
- for (const line of raw.split("\n")) {
311
- if (line.trim() === "")
312
- continue;
313
- try {
314
- const metadata = metadataOf(JSON.parse(line));
315
- if (typeof metadata.runId === "string")
316
- latest.set(metadata.runId, metadata);
317
- } catch {
318
- }
319
- }
320
- return latest;
321
- }, "indexedRuns");
322
- var runsOfDay = /* @__PURE__ */ __name((dayDir) => {
323
- const latest = indexedRuns(dayDir);
324
- for (const entry of safeReaddir(dayDir)) {
325
- if (entry === INDEX || entry.startsWith(".") || latest.has(entry))
326
- continue;
327
- const metadata = readRun(join(dayDir, entry));
328
- if (metadata)
329
- latest.set(metadata.runId, metadata);
330
- }
331
- return [...latest.values()].sort((a, b) => a.runId < b.runId ? 1 : a.runId > b.runId ? -1 : 0);
332
- }, "runsOfDay");
333
- var findRun = /* @__PURE__ */ __name((runsDir, id2) => {
334
- const stamped = /^(\d{4})(\d{2})(\d{2})T/.exec(id2);
335
- const likely = stamped ? [`${stamped[1]}-${stamped[2]}-${stamped[3]}`] : [];
336
- const dates = [.../* @__PURE__ */ new Set([...likely, ...days(runsDir)])];
337
- for (const date of dates) {
338
- const dir = join(runsDir, date, id2);
339
- const metadata = readRun(dir);
340
- if (metadata)
341
- return { dir, metadata };
342
- }
343
- for (const date of dates) {
344
- const metadata = indexedRuns(join(runsDir, date)).get(id2);
345
- if (metadata)
346
- return { dir: join(runsDir, date, id2), metadata };
347
- }
348
- return void 0;
349
- }, "findRun");
350
- var readEvents = /* @__PURE__ */ __name((dir) => {
351
- let raw;
352
- try {
353
- raw = readFileSync(join(dir, "events.jsonl"), "utf8");
354
- } catch {
355
- return [];
356
- }
357
- const events = [];
358
- for (const line of raw.split("\n")) {
359
- if (line.trim() === "")
360
- continue;
361
- try {
362
- const parsed = JSON.parse(line);
363
- if (parsed !== null && typeof parsed === "object")
364
- events.push(eventOf(parsed));
365
- } catch {
366
- }
367
- }
368
- return events;
369
- }, "readEvents");
370
- var eventOf = /* @__PURE__ */ __name((line) => {
371
- const { attributes, time: time2, severity } = line;
372
- if (attributes === null || typeof attributes !== "object")
373
- return logAttributes(line);
374
- return { time: time2, severity, ...logAttributes(attributes) };
375
- }, "eventOf");
376
- var pruneRuns = /* @__PURE__ */ __name((runsDir, { keepDays, keepSuccessDays = keepDays, maxBytes, now }) => {
377
- const cutoff = day(new Date(now.getTime() - keepDays * DAY_MS));
378
- const successCutoff = day(new Date(now.getTime() - Math.min(keepSuccessDays, keepDays) * DAY_MS));
379
- let removed = 0;
380
- for (const date of days(runsDir)) {
381
- if (date >= cutoff) {
382
- if (date < successCutoff)
383
- dropSuccesses(join(runsDir, date));
384
- continue;
385
- }
386
- try {
387
- rmSync(join(runsDir, date), { recursive: true, force: true });
388
- removed += 1;
389
- } catch {
390
- }
391
- }
392
- if (maxBytes !== void 0)
393
- removed += fitSize(runsDir, maxBytes, now);
394
- return removed;
395
- }, "pruneRuns");
396
- var DAY_MS = 24 * 60 * 60 * 1e3;
397
- var SUCCESSES_DROPPED = ".successes-dropped";
398
- var SIZE_CHECKED = ".size-checked";
399
- var dropSuccesses = /* @__PURE__ */ __name((dayDir) => {
400
- const marker = join(dayDir, SUCCESSES_DROPPED);
401
- try {
402
- statSync(marker);
403
- return;
404
- } catch {
405
- }
406
- try {
407
- const kept = [];
408
- for (const [id2, metadata] of indexedRuns(dayDir)) {
409
- if (metadata.status === "success")
410
- rmSync(join(dayDir, id2), { recursive: true, force: true });
411
- else
412
- kept.push(JSON.stringify(runFileOf(metadata)));
413
- }
414
- for (const entry of safeReaddir(dayDir)) {
415
- if (entry === INDEX || entry.startsWith("."))
416
- continue;
417
- if (readRun(join(dayDir, entry))?.status === "success")
418
- rmSync(join(dayDir, entry), { recursive: true, force: true });
419
- }
420
- writeSecurely(join(dayDir, INDEX), kept.map((line) => `${line}
421
- `).join(""), 384);
422
- writeFileSync(marker, "", { mode: 384 });
423
- } catch {
424
- }
425
- }, "dropSuccesses");
426
- var sizeOf = /* @__PURE__ */ __name((path) => {
427
- let total = 0;
428
- for (const entry of safeReaddir(path)) {
429
- const full = join(path, entry);
430
- try {
431
- const stat = statSync(full);
432
- total += stat.isDirectory() ? sizeOf(full) : stat.size;
433
- } catch {
434
- }
435
- }
436
- return total;
437
- }, "sizeOf");
438
- var fitSize = /* @__PURE__ */ __name((runsDir, maxBytes, now) => {
439
- const stamp = join(runsDir, SIZE_CHECKED);
440
- const today = day(now);
441
- try {
442
- if (readFileSync(stamp, "utf8").trim() === today)
443
- return 0;
444
- } catch {
445
- }
446
- const dates = days(runsDir).sort();
447
- const sizes = new Map(dates.map((date) => [date, sizeOf(join(runsDir, date))]));
448
- let total = [...sizes.values()].reduce((sum, size) => sum + size, 0);
449
- let removed = 0;
450
- for (const date of dates) {
451
- if (total <= maxBytes || date === today)
452
- break;
453
- dropSuccesses(join(runsDir, date));
454
- const after = sizeOf(join(runsDir, date));
455
- total -= (sizes.get(date) ?? 0) - after;
456
- sizes.set(date, after);
457
- }
458
- for (const date of dates) {
459
- if (total <= maxBytes || date === today)
460
- break;
461
- try {
462
- rmSync(join(runsDir, date), { recursive: true, force: true });
463
- total -= sizes.get(date) ?? 0;
464
- removed += 1;
465
- } catch {
466
- }
467
- }
468
- try {
469
- mkdirSync(runsDir, { recursive: true, mode: 448 });
470
- writeFileSync(stamp, today, { mode: 384 });
471
- } catch {
472
- }
473
- return removed;
474
- }, "fitSize");
475
- var day = /* @__PURE__ */ __name((date) => date.toISOString().slice(0, 10), "day");
476
- var days = /* @__PURE__ */ __name((runsDir) => safeReaddir(runsDir).filter((entry) => /^\d{4}-\d{2}-\d{2}$/.test(entry)), "days");
477
- var readRun = /* @__PURE__ */ __name((dir) => {
478
- try {
479
- return metadataOf(JSON.parse(readFileSync(join(dir, "run.json"), "utf8")));
480
- } catch {
481
- return void 0;
482
- }
483
- }, "readRun");
484
- var safeReaddir = /* @__PURE__ */ __name((dir) => {
485
- try {
486
- return readdirSync(dir);
487
- } catch {
488
- return [];
489
- }
490
- }, "safeReaddir");
491
- var runFileOf = /* @__PURE__ */ __name(({ partial, ...metadata }) => ({
492
- ...logAttributes(metadata),
493
- ...partial ? { partial: { ...logAttributes(partial), failures: partial.failures.map((failure) => logAttributes(failure)) } } : {}
494
- }), "runFileOf");
495
- var metadataOf = /* @__PURE__ */ __name((parsed) => {
496
- const { partial, ...metadata } = fromLogAttributes(parsed);
497
- if (partial === null || typeof partial !== "object")
498
- return metadata;
499
- const { failures, ...rest } = fromLogAttributes(partial);
500
- return {
501
- ...metadata,
502
- partial: {
503
- ...rest,
504
- failures: Array.isArray(failures) ? failures.map((failure) => fromLogAttributes(failure)) : []
505
- }
506
- };
507
- }, "metadataOf");
508
-
509
- // 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/runs/scope.js
510
- import { AsyncLocalStorage } from "node:async_hooks";
511
- import { randomBytes } from "node:crypto";
512
- var scopes = new AsyncLocalStorage();
513
- var processScope;
514
- var currentRun = /* @__PURE__ */ __name(() => {
515
- const scope = scopes.getStore();
516
- if (scope)
517
- return scope;
518
- processScope ??= {
519
- runId: newRunId(/* @__PURE__ */ new Date(), "process"),
520
- command: "",
521
- startedAt: Date.now(),
522
- ...traceOf(process.env)
523
- };
524
- return processScope;
525
- }, "currentRun");
526
- var inRun = /* @__PURE__ */ __name((scope, body) => scopes.run(scope, body), "inRun");
527
- var runEvent = /* @__PURE__ */ __name((event) => scopes.getStore()?.events?.(event), "runEvent");
528
- var typedCommand = /* @__PURE__ */ __name((tool, words2, profile = currentRun().profile) => [tool, profile, words2].filter((part) => part !== void 0 && part !== "").join(" "), "typedCommand");
529
- var useAsProcessRun = /* @__PURE__ */ __name((scope) => {
530
- processScope = scope;
531
- }, "useAsProcessRun");
532
- var processRun = /* @__PURE__ */ __name(() => processScope, "processRun");
533
- var enclosingTraceId = /* @__PURE__ */ __name(() => scopes.getStore()?.traceId, "enclosingTraceId");
534
- var traceOf = /* @__PURE__ */ __name((env) => {
535
- const traceId = traceIdOf(env.TRACEPARENT);
536
- return traceId === void 0 ? {} : { traceId };
537
- }, "traceOf");
538
- var childTrace = /* @__PURE__ */ __name(() => {
539
- const hex = /* @__PURE__ */ __name((bytes) => randomBytes(bytes).toString("hex"), "hex");
540
- const traceId = hex(16);
541
- return { traceId, traceparent: `00-${traceId}-${hex(8)}-01` };
542
- }, "childTrace");
543
- var attempts = new AsyncLocalStorage();
544
- var withAttempt = /* @__PURE__ */ __name((attempt, work) => attempts.run(attempt, work), "withAttempt");
545
- var currentAttempt = /* @__PURE__ */ __name(() => attempts.getStore(), "currentAttempt");
546
-
547
- // 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/domain/duration.js
64
+ // 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/domain/duration.js
548
65
  var DURATION = /^(\d+)(ms|s|m|h|d)$/;
549
66
  var UNIT_MS = { ms: 1, s: 1e3, m: 6e4, h: 36e5, d: 864e5 };
550
67
  var parseDuration = /* @__PURE__ */ __name((value, source) => {
@@ -558,7 +75,9 @@ var parseDuration = /* @__PURE__ */ __name((value, source) => {
558
75
  return ms;
559
76
  }, "parseDuration");
560
77
 
561
- // 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/embeddings/models.js
78
+ // 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/embeddings/models.js
79
+ import { existsSync } from "node:fs";
80
+ import { join } from "node:path";
562
81
  var huggingFace = /* @__PURE__ */ __name((repository, commit) => (name) => `https://huggingface.co/${repository}/resolve/${commit}/${name}`, "huggingFace");
563
82
  var e5 = huggingFace("Xenova/multilingual-e5-small", "761b726dd34fb83930e26aab4e9ac3899aa1fa78");
564
83
  var e5Large = huggingFace("Xenova/multilingual-e5-large", "00fc3aeb3dbb95842de2ac1961d33c6319acf57b");
@@ -605,9 +124,13 @@ var TEXT_MODELS = [
605
124
  languages: "over 100 languages \u2014 the best of the two on chat, about seven times slower",
606
125
  licence: "Gemma Terms of Use",
607
126
  terms: "https://ai.google.dev/gemma/terms",
127
+ // Gemma Terms of Use §3.1: every copy carries this notice and the use restrictions of §3.2.
128
+ notice: "Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms. Its use is restricted by the Gemma Prohibited Use Policy: https://ai.google.dev/gemma/prohibited_use_policy",
608
129
  dims: 768,
609
130
  maxTokens: 2048,
610
- chunksPerSecond: 2,
131
+ // 2026-11-08, 1,200-character chunks, 8 threads on the Ryzen AI 9 HX 470: 8.3 chunks/s against e5-small's 52.7, so
132
+ // 5 on the scale e5-small's 31 sets. It was 2, which held a memo sync to 39 chunks.
133
+ chunksPerSecond: 5,
611
134
  pooling: "sentence_embedding",
612
135
  prefix: { query: "task: search result | query: ", passage: "title: none | text: " },
613
136
  onnx: "onnx/model_q4.onnx",
@@ -674,7 +197,8 @@ var TEXT_MODELS = [
674
197
  ]
675
198
  }
676
199
  ];
677
- var DEFAULT_TEXT_MODEL = "e5-small";
200
+ var DEFAULT_TEXT_MODEL = "embeddinggemma";
201
+ var PREVIOUS_DEFAULT_TEXT_MODEL = "e5-small";
678
202
  var SECTION = "text_models";
679
203
  var slug = pipe(string(), regex(/^[a-z0-9][a-z0-9._-]{0,62}$/, "is not a model id: a-z, 0-9, . _ -"));
680
204
  var words = pipe(string(), trim(), minLength(1), maxLength(300));
@@ -741,9 +265,17 @@ var textModel = /* @__PURE__ */ __name((id2, env = process.env) => {
741
265
  }
742
266
  return found;
743
267
  }, "textModel");
268
+ var downloaded = /* @__PURE__ */ __name((id2, env) => {
269
+ const model = TEXT_MODELS.find((one) => one.id === id2);
270
+ const directory = sharedModelsDirectory("text", env);
271
+ return model !== void 0 && filesPresent(model.files.map((file) => [file, join(directory, model.id, file.name)]));
272
+ }, "downloaded");
744
273
  var chosenTextModel = /* @__PURE__ */ __name((env = process.env) => {
745
274
  const use = readTextModelsSection(env).use;
746
- return use === void 0 ? { id: DEFAULT_TEXT_MODEL, from: "default" } : { id: use, from: "chosen" };
275
+ if (use !== void 0)
276
+ return { id: use, from: "chosen" };
277
+ const kept = !downloaded(DEFAULT_TEXT_MODEL, env) && existsSync(join(sharedModelsDirectory("text", env), PREVIOUS_DEFAULT_TEXT_MODEL));
278
+ return { id: kept ? PREVIOUS_DEFAULT_TEXT_MODEL : DEFAULT_TEXT_MODEL, from: "default" };
747
279
  }, "chosenTextModel");
748
280
  var mmarco = huggingFace("cross-encoder/mmarco-mMiniLMv2-L12-H384-v1", "1427fd652930e4ba29e8149678df786c240d8825");
749
281
  var bge = huggingFace("onnx-community/bge-reranker-v2-m3-ONNX", "6f5ff65298512715a1e669753bc754d2bc8f367b");
@@ -820,14 +352,57 @@ var vectorModelKey = /* @__PURE__ */ __name((model) => {
820
352
  }, "vectorModelKey");
821
353
  var meaningFloor = /* @__PURE__ */ __name((key) => key === "local:e5-small:384" ? 0.8 : 0, "meaningFloor");
822
354
 
823
- // 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/guarded.js
824
- import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
355
+ // 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/background/budget.js
356
+ var DEADLINE_MARGIN_MS = 5e3;
357
+ var DEADLINE_MARGIN_SHARE = 0.15;
358
+ var DEFAULT_REQUEST_MS = 2e3;
359
+ var deadlineMargin = /* @__PURE__ */ __name((deadline) => Math.max(DEADLINE_MARGIN_MS, deadline.ms * DEADLINE_MARGIN_SHARE), "deadlineMargin");
360
+ var requestsFor = /* @__PURE__ */ __name((deadline, requestMs = DEFAULT_REQUEST_MS) => deadline === void 0 ? null : Math.max(1, Math.floor((deadline.ms - deadlineMargin(deadline)) / requestMs)), "requestsFor");
361
+ var runBudget = /* @__PURE__ */ __name(({ requests, deadline, requestMs, signal, now = Date.now } = {}) => {
362
+ const fits = requestsFor(deadline, requestMs);
363
+ const limit = fits === null ? requests ?? null : Math.min(fits, requests ?? fits);
364
+ const margin = deadline ? deadlineMargin(deadline) : 0;
365
+ let used = 0;
366
+ let stopped2 = null;
367
+ let last;
368
+ let slowest = 0;
369
+ return {
370
+ take() {
371
+ if (stopped2)
372
+ return stopped2;
373
+ const at = now();
374
+ if (last !== void 0)
375
+ slowest = Math.max(slowest, at - last);
376
+ if (signal?.aborted)
377
+ stopped2 = "cancelled";
378
+ else if (limit !== null && used >= limit)
379
+ stopped2 = "requests";
380
+ else if (deadline && at + margin + slowest >= deadline.endsAt)
381
+ stopped2 = "deadline";
382
+ if (stopped2)
383
+ return stopped2;
384
+ used += 1;
385
+ last = at;
386
+ return null;
387
+ },
388
+ get used() {
389
+ return used;
390
+ },
391
+ limit,
392
+ get stopped() {
393
+ return stopped2;
394
+ }
395
+ };
396
+ }, "runBudget");
397
+
398
+ // 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/guarded.js
399
+ import { AsyncLocalStorage } from "node:async_hooks";
825
400
  var sentIds = /* @__PURE__ */ __name((typed, message) => ({
826
401
  messageId: message.id,
827
402
  ...message.chatId && message.chatId !== typed ? { resultChatId: message.chatId } : {}
828
403
  }), "sentIds");
829
- var current = new AsyncLocalStorage2();
830
- var writesInFlight = new AsyncLocalStorage2();
404
+ var current = new AsyncLocalStorage();
405
+ var writesInFlight = new AsyncLocalStorage();
831
406
  var parents = /* @__PURE__ */ new WeakMap();
832
407
  var stopped = /* @__PURE__ */ new WeakMap();
833
408
  var scopesFor = /* @__PURE__ */ __name((scope = writesInFlight.getStore()) => {
@@ -847,18 +422,18 @@ var stopWrites = /* @__PURE__ */ __name((scope, reason) => {
847
422
  for (const write of scope)
848
423
  write.cut();
849
424
  }, "stopWrites");
850
- var refuseStopped = /* @__PURE__ */ __name((scopes2) => {
851
- for (const scope of scopes2)
425
+ var refuseStopped = /* @__PURE__ */ __name((scopes) => {
426
+ for (const scope of scopes)
852
427
  if (stopped.has(scope))
853
428
  throw stopped.get(scope);
854
429
  }, "refuseStopped");
855
430
  var currentOperation = /* @__PURE__ */ __name(() => current.getStore(), "currentOperation");
856
431
  var guardedWrite = /* @__PURE__ */ __name(async (guard, attempt, act, settled = () => ({}), prepare) => {
857
- const scopes2 = scopesFor();
858
- refuseStopped(scopes2);
432
+ const scopes = scopesFor();
433
+ refuseStopped(scopes);
859
434
  try {
860
435
  await guard.ask?.(attempt);
861
- refuseStopped(scopes2);
436
+ refuseStopped(scopes);
862
437
  if (guard.reserve) {
863
438
  guard.check(attempt, { reserve: false });
864
439
  await guard.reserve(attempt);
@@ -869,7 +444,7 @@ var guardedWrite = /* @__PURE__ */ __name(async (guard, attempt, act, settled =
869
444
  throw error;
870
445
  }
871
446
  try {
872
- refuseStopped(scopes2);
447
+ refuseStopped(scopes);
873
448
  } catch (error) {
874
449
  guard.record({ ...attempt, outcome: "failed", errorCode: codeOf(error) });
875
450
  throw error;
@@ -894,7 +469,7 @@ var guardedWrite = /* @__PURE__ */ __name(async (guard, attempt, act, settled =
894
469
  });
895
470
  }, "cut")
896
471
  };
897
- for (const scope of scopes2)
472
+ for (const scope of scopes)
898
473
  scope.add(flight);
899
474
  try {
900
475
  if (prepare !== void 0)
@@ -920,13 +495,13 @@ var guardedWrite = /* @__PURE__ */ __name(async (guard, attempt, act, settled =
920
495
  throw new CliError(error.code, error.message, { ...error.details, sent: false });
921
496
  throw error;
922
497
  } finally {
923
- for (const scope of scopes2)
498
+ for (const scope of scopes)
924
499
  scope.delete(flight);
925
500
  }
926
501
  }, "guardedWrite");
927
502
  var codeOf = /* @__PURE__ */ __name((error) => typeof error?.code === "string" ? error.code : "unknown", "codeOf");
928
503
 
929
- // 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/models/endpoint.js
504
+ // 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/models/endpoint.js
930
505
  var endpoint = /* @__PURE__ */ __name((value) => {
931
506
  try {
932
507
  const url2 = new URL(value);
@@ -936,7 +511,7 @@ var endpoint = /* @__PURE__ */ __name((value) => {
936
511
  }
937
512
  }, "endpoint");
938
513
 
939
- // 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/models/settings.js
514
+ // 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/models/settings.js
940
515
  var MODEL_FIELDS = ["provider", "model", "base_url"];
941
516
  var modelSettingsShape = record(pipe(string(), regex(/^[a-z][a-z0-9-]*$/)), strictObject({
942
517
  provider: optional(picklist(["off", "openai", "anthropic"])),
@@ -1005,16 +580,16 @@ var modelTarget = /* @__PURE__ */ __name((settings, purpose) => {
1005
580
  };
1006
581
  }, "modelTarget");
1007
582
 
1008
- // 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/services/history-limits.js
583
+ // 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/services/history-limits.js
1009
584
  var HISTORY_MAX_DAYS = 1095;
1010
585
  var DEFAULT_HISTORY_LIMITS = { dialogDays: 1095, groupDays: 365, groupMembersMax: 50 };
1011
- var DAY_MS2 = 24 * 60 * 60 * 1e3;
586
+ var DAY_MS = 24 * 60 * 60 * 1e3;
1012
587
  var historyWindow = /* @__PURE__ */ __name((shape, limits, now) => {
1013
588
  const group = shape !== void 0 && shape.kind !== "dialog" && shape.kind !== "saved";
1014
589
  if (group && (shape.participantsCount ?? 0) > limits.groupMembersMax)
1015
590
  return { skip: "group_too_large", members: shape.participantsCount ?? 0 };
1016
- const days2 = group ? limits.groupDays : limits.dialogDays;
1017
- return { keepFrom: now - Math.min(days2, HISTORY_MAX_DAYS) * DAY_MS2 };
591
+ const days = group ? limits.groupDays : limits.dialogDays;
592
+ return { keepFrom: now - Math.min(days, HISTORY_MAX_DAYS) * DAY_MS };
1018
593
  }, "historyWindow");
1019
594
  var limitBatch = /* @__PURE__ */ __name((batch, shapes, included, limits, now = Date.now()) => {
1020
595
  const skipped = /* @__PURE__ */ new Map();
@@ -1052,7 +627,7 @@ var limitBatch = /* @__PURE__ */ __name((batch, shapes, included, limits, now =
1052
627
  return { batch: { ...batch, messages }, skipped };
1053
628
  }, "limitBatch");
1054
629
 
1055
- // 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/entities/task.js
630
+ // 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/entities/task.js
1056
631
  var closeSuggestion = strictObject({
1057
632
  as: picklist(["done", "dismissed"]),
1058
633
  /** The agent's name. */
@@ -1114,7 +689,7 @@ var task = strictObject({
1114
689
  updated_at: optional(time)
1115
690
  });
1116
691
 
1117
- // 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/entities/agenda.js
692
+ // 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/entities/agenda.js
1118
693
  var agendaChat = strictObject({
1119
694
  chat: reference,
1120
695
  title: nullable(text),
@@ -1184,7 +759,7 @@ var agenda = strictObject({
1184
759
  unlisted_categories: array(strictObject({ name: text, open_tasks: number() }))
1185
760
  });
1186
761
 
1187
- // 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/entities/attachment.js
762
+ // 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/entities/attachment.js
1188
763
  var attachment = strictObject({
1189
764
  /** The message it came with, as a locator; absent inside that message. */
1190
765
  message: optional(reference),
@@ -1222,7 +797,7 @@ var attachment = strictObject({
1222
797
  });
1223
798
  var hitFile = strictObject({ position: count, kind: text, name: optional(text), size: optional(count) });
1224
799
 
1225
- // 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/entities/conversation.js
800
+ // 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/entities/conversation.js
1226
801
  var conversation = strictObject({
1227
802
  id,
1228
803
  chat: reference,
@@ -1237,7 +812,7 @@ var conversation = strictObject({
1237
812
  rules_version: count
1238
813
  });
1239
814
 
1240
- // 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/entities/tagging.js
815
+ // 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/entities/tagging.js
1241
816
  var tagging = strictObject({
1242
817
  tag: text,
1243
818
  type: picklist(TAG_TYPES),
@@ -1250,7 +825,7 @@ var tagging = strictObject({
1250
825
  created_at: time
1251
826
  });
1252
827
 
1253
- // 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/images/picture/models.js
828
+ // 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/images/picture/models.js
1254
829
  import { join as join2 } from "node:path";
1255
830
  var clip = /* @__PURE__ */ __name((name) => `https://huggingface.co/Xenova/clip-vit-base-patch32/resolve/d15189d7028b43f1d3e65039190477f6af591c2a/${name}`, "clip");
1256
831
  var IMAGE_MODELS = [
@@ -1304,7 +879,7 @@ var imageModelsDirectory = /* @__PURE__ */ __name((env = process.env) => sharedM
1304
879
  var placedImage = /* @__PURE__ */ __name((model, directory) => model.files.map((file) => [file, join2(directory, model.id, file.name)]), "placedImage");
1305
880
  var isImageModelInstalled = /* @__PURE__ */ __name((model, directory) => filesPresent(placedImage(model, directory)), "isImageModelInstalled");
1306
881
 
1307
- // 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/botcheck/reasons.js
882
+ // 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/botcheck/reasons.js
1308
883
  var WEIGHTS = {
1309
884
  bot: 3,
1310
885
  scam: 3,
@@ -1329,33 +904,48 @@ var LINK = /https?:\/\/|t\.me\/|www\./i;
1329
904
  var DIGITS = /\d{5,}/;
1330
905
  var oddName = /* @__PURE__ */ __name((name) => !name?.trim() || DIGITS.test(name) || LINK.test(name), "oddName");
1331
906
 
907
+ // 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/background/checkpoints.js
908
+ import { existsSync as existsSync2, readFileSync, rmSync } from "node:fs";
909
+ import { join as join3 } from "node:path";
910
+ var PART = /^[\w@+-][\w.@+-]{0,99}$/;
911
+ var checkpointPath = /* @__PURE__ */ __name((state, profile, job) => {
912
+ for (const part of [profile, job]) {
913
+ if (!PART.test(part) || part.includes("..")) {
914
+ throw new CliError("validation_error", `a checkpoint is named by letters, digits, ".", "@" and "-" \u2014 not "${part}"`);
915
+ }
916
+ }
917
+ return join3(state, "checkpoints", profile, `${job}.json`);
918
+ }, "checkpointPath");
919
+ var readCheckpoint = /* @__PURE__ */ __name((path) => {
920
+ try {
921
+ return existsSync2(path) ? JSON.parse(readFileSync(path, "utf8")) : void 0;
922
+ } catch {
923
+ return void 0;
924
+ }
925
+ }, "readCheckpoint");
926
+ var saveCheckpoint = /* @__PURE__ */ __name((path, point, now = /* @__PURE__ */ new Date()) => {
927
+ const saved = { ...point, updated_at: now.toISOString() };
928
+ writeSecurely(path, `${JSON.stringify(saved, null, 2)}
929
+ `, 384);
930
+ return saved;
931
+ }, "saveCheckpoint");
932
+ var progressOf = /* @__PURE__ */ __name((input) => {
933
+ const total = input.total ?? null;
934
+ const updated = input.updatedAt ?? null;
935
+ return {
936
+ job: input.job,
937
+ profile: input.profile,
938
+ done: input.done,
939
+ total,
940
+ remaining: total === null ? null : Math.max(0, total - input.done),
941
+ state: input.complete ?? (total !== null && input.done >= total) ? "complete" : "partial",
942
+ updated_at: updated,
943
+ cursor_age_ms: updated === null ? null : Math.max(0, (input.now ?? /* @__PURE__ */ new Date()).getTime() - Date.parse(updated))
944
+ };
945
+ }, "progressOf");
946
+
1332
947
  export {
1333
- logAttributes,
1334
- fromLogAttributes,
1335
- snakeLogger,
1336
- LOG_ATTRIBUTES,
1337
- KEEP_RUNS_FOR_DAYS,
1338
- KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
1339
- RUNS_SIZE_LIMIT_MB,
1340
- runsDirFor,
1341
- startRun,
1342
- runtime,
1343
- newRunId,
1344
- listRuns,
1345
- findRun,
1346
- readEvents,
1347
- pruneRuns,
1348
- currentRun,
1349
- inRun,
1350
- runEvent,
1351
- typedCommand,
1352
- useAsProcessRun,
1353
- processRun,
1354
- enclosingTraceId,
1355
- traceOf,
1356
- childTrace,
1357
- withAttempt,
1358
- currentAttempt,
948
+ runBudget,
1359
949
  sentIds,
1360
950
  withWriteScope,
1361
951
  stopWrites,
@@ -1368,6 +958,7 @@ export {
1368
958
  modelTarget,
1369
959
  parseDuration,
1370
960
  DEFAULT_TEXT_MODEL,
961
+ PREVIOUS_DEFAULT_TEXT_MODEL,
1371
962
  CustomTextModelShape,
1372
963
  textModelsFile,
1373
964
  readTextModelsSection,
@@ -1393,6 +984,10 @@ export {
1393
984
  LINK,
1394
985
  oddName,
1395
986
  conversation,
987
+ checkpointPath,
988
+ readCheckpoint,
989
+ saveCheckpoint,
990
+ progressOf,
1396
991
  tagging,
1397
992
  IMAGE_MODELS,
1398
993
  DEFAULT_IMAGE_MODEL,