@wirecat/zoom-cli 0.69.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 (177) hide show
  1. package/README.md +1 -1
  2. package/dist/account-removal.d.ts +6 -0
  3. package/dist/account-removal.d.ts.map +1 -0
  4. package/dist/account-removal.js +43 -0
  5. package/dist/account-removal.js.map +1 -0
  6. package/dist/answer-entities.d.ts +2 -0
  7. package/dist/answer-entities.d.ts.map +1 -1
  8. package/dist/bin/zm.js +2 -2
  9. package/dist/bundle/{all-profiles-ZQWPCJEK.js → all-profiles-O4YNVPZX.js} +9 -9
  10. package/dist/bundle/answer-policy-PPSPMCLH.js +104 -0
  11. package/dist/bundle/{anthropic-7FUQ2HYJ.js → anthropic-7GGRX3RX.js} +20 -9
  12. package/dist/bundle/{app-server-DNPE2EQB.js → app-server-CPMKM3HI.js} +50 -50
  13. package/dist/bundle/{bun-ZVQFCFCC.js → bun-POHZKEPV.js} +2 -2
  14. package/dist/bundle/{bun-sqlite-EB2UMUPJ.js → bun-sqlite-PGYMBPEL.js} +4 -4
  15. package/dist/bundle/{chunk-R2ULMWB4.js → chunk-2FV5JUQU.js} +39 -593
  16. package/dist/bundle/{chunk-R3JYPY3J.js → chunk-2KESWII5.js} +2 -2
  17. package/dist/bundle/{chunk-S2EAGDS7.js → chunk-2RUAMDVV.js} +11 -11
  18. package/dist/bundle/{chunk-H3MFBYTQ.js → chunk-2U27KIKU.js} +5 -5
  19. package/dist/bundle/{chunk-KAPJQGHE.js → chunk-2U6SER67.js} +1 -1
  20. package/dist/bundle/chunk-4LAQDZXU.js +1635 -0
  21. package/dist/bundle/{chunk-SQT47CFW.js → chunk-4QPQ7MDA.js} +1 -1
  22. package/dist/bundle/{chunk-MNOVYS43.js → chunk-4QUFFB2U.js} +3 -3
  23. package/dist/bundle/{chunk-V74QFMSL.js → chunk-54YDWBYG.js} +1 -1
  24. package/dist/bundle/{chunk-MSDCZ6GT.js → chunk-5J4AMBMM.js} +4 -4
  25. package/dist/bundle/{chunk-GR3QDHBU.js → chunk-5K7OGPGA.js} +5 -5
  26. package/dist/bundle/{chunk-WY4NYPPS.js → chunk-5LJTU4LY.js} +12 -12
  27. package/dist/bundle/{chunk-MJMVIFSC.js → chunk-633QXP57.js} +10 -8
  28. package/dist/bundle/{chunk-EPPSMCEV.js → chunk-64ZHF6PJ.js} +1 -1
  29. package/dist/bundle/{chunk-ZRHMB3LQ.js → chunk-77TCCHMP.js} +1 -1
  30. package/dist/bundle/{chunk-BOAMDYLY.js → chunk-7QC4M4HS.js} +2 -2
  31. package/dist/bundle/{chunk-O7L44JK2.js → chunk-7ROXXRGG.js} +3933 -1525
  32. package/dist/bundle/{chunk-MVDPZRFE.js → chunk-ALIT5QFT.js} +1 -1
  33. package/dist/bundle/{chunk-6N2D6JGX.js → chunk-BBTQIVFP.js} +1 -1
  34. package/dist/bundle/{chunk-QXM7S3Y3.js → chunk-BGTEVIW4.js} +5 -5
  35. package/dist/bundle/{chunk-JX5JJZC3.js → chunk-CFQF6IGY.js} +2 -2
  36. package/dist/bundle/{chunk-5GOE6PQK.js → chunk-CKPCVEXU.js} +5 -5
  37. package/dist/bundle/{chunk-6KMTQX3D.js → chunk-CRFOGYDG.js} +1 -1
  38. package/dist/bundle/{chunk-5H6VTEEC.js → chunk-CT4WVR4N.js} +2 -2
  39. package/dist/bundle/{chunk-3TPRYZUW.js → chunk-DHWBSXG3.js} +23 -23
  40. package/dist/bundle/{chunk-IPBZKUC3.js → chunk-DIQLXAAZ.js} +3 -3
  41. package/dist/bundle/{chunk-JZ4YOAHA.js → chunk-DK6ICIGL.js} +4558 -1670
  42. package/dist/bundle/{chunk-OSBHEM2A.js → chunk-DRBQDCDU.js} +10 -10
  43. package/dist/bundle/{chunk-G6IX2MD2.js → chunk-DSVZEXYJ.js} +1104 -948
  44. package/dist/bundle/{chunk-B6JMVB6R.js → chunk-EOSVN2ER.js} +1 -1
  45. package/dist/bundle/{chunk-MOTKS7XG.js → chunk-FSHCAWZS.js} +29354 -16490
  46. package/dist/bundle/{chunk-TKXLWFM2.js → chunk-GGS6D4W4.js} +3 -3
  47. package/dist/bundle/{chunk-4APZQYCH.js → chunk-GL3MYFMX.js} +4 -4
  48. package/dist/bundle/{chunk-LDRQ5NAP.js → chunk-GXF5HFFP.js} +3 -3
  49. package/dist/bundle/{chunk-5ZF6QVMC.js → chunk-HB6XJQ3Y.js} +4 -4
  50. package/dist/bundle/{chunk-QW5VPZEH.js → chunk-I4DFFR7F.js} +23 -1
  51. package/dist/bundle/{chunk-DHD25JII.js → chunk-IAV5BG3I.js} +1 -1
  52. package/dist/bundle/{chunk-52DCABMU.js → chunk-IED3NS7G.js} +30 -38
  53. package/dist/bundle/{chunk-LQX74VKG.js → chunk-INVTDIF6.js} +1 -1
  54. package/dist/bundle/{chunk-CKK6JOC4.js → chunk-KMV7GZB6.js} +2 -2
  55. package/dist/bundle/{chunk-XRZDYWF6.js → chunk-LE7MDAQG.js} +2 -2
  56. package/dist/bundle/{chunk-B5D7NZI7.js → chunk-M76MXMLY.js} +1 -1
  57. package/dist/bundle/{chunk-37B7A4RP.js → chunk-MEED7YFG.js} +1 -1
  58. package/dist/bundle/{chunk-LEA4BGK7.js → chunk-MRI6QMZ3.js} +11 -11
  59. package/dist/bundle/{chunk-6TICX3MN.js → chunk-MW4EGDDV.js} +2 -2
  60. package/dist/bundle/{chunk-SZ3Z4ZNO.js → chunk-N2FNMION.js} +1 -1
  61. package/dist/bundle/{chunk-CUZHKYC2.js → chunk-OHWMIUCT.js} +450 -641
  62. package/dist/bundle/{chunk-KNE6VFHZ.js → chunk-OORMSM6O.js} +1 -1
  63. package/dist/bundle/{chunk-Z6TTGTMU.js → chunk-OWEBWDHV.js} +76 -6
  64. package/dist/bundle/{chunk-5ZJXKASF.js → chunk-P3XC6EDU.js} +17 -21
  65. package/dist/bundle/chunk-Q2SUFGSH.js +136 -0
  66. package/dist/bundle/{chunk-TFFEFEG2.js → chunk-Q3XLZIY3.js} +18 -18
  67. package/dist/bundle/{chunk-IEC4E65G.js → chunk-Q5PI72CR.js} +5 -1
  68. package/dist/bundle/{chunk-V4MM6GST.js → chunk-QTHIU7CO.js} +1 -1
  69. package/dist/bundle/{chunk-JHFP3Z5S.js → chunk-QVSLSWAL.js} +8 -8
  70. package/dist/bundle/{chunk-QLGG7S6F.js → chunk-RN4EHCC5.js} +22 -4
  71. package/dist/bundle/{chunk-BL36NSV5.js → chunk-RQG5VOGH.js} +12 -2
  72. package/dist/bundle/{chunk-RPQ3JOD3.js → chunk-SELXER2Q.js} +5 -5
  73. package/dist/bundle/{chunk-KX5MZVPX.js → chunk-TM4JSVGQ.js} +60 -53
  74. package/dist/bundle/{chunk-TN77LX6W.js → chunk-UG447QY2.js} +1 -1
  75. package/dist/bundle/{chunk-HC56J5LB.js → chunk-ULDXZ6LH.js} +66 -59
  76. package/dist/bundle/chunk-USQ23X5V.js +1227 -0
  77. package/dist/bundle/{chunk-UEZ6URJR.js → chunk-VJXHIUFP.js} +19 -19
  78. package/dist/bundle/{chunk-TWIC6JJG.js → chunk-VRH7VRTK.js} +7 -7
  79. package/dist/bundle/{chunk-NRRI37NJ.js → chunk-WOIHSQAL.js} +44 -0
  80. package/dist/bundle/{chunk-L62EJDNZ.js → chunk-X277FBTF.js} +3 -3
  81. package/dist/bundle/{chunk-XITUFTON.js → chunk-X3ZDN3U7.js} +1 -1
  82. package/dist/bundle/{chunk-GXDOTUUO.js → chunk-X4GWR6GO.js} +9 -9
  83. package/dist/bundle/chunk-XI3VIQKW.js +756 -0
  84. package/dist/bundle/{chunk-FBLUKCIR.js → chunk-XRFHQGOD.js} +1 -1
  85. package/dist/bundle/{chunk-HW5QTRFF.js → chunk-YD2RYVMK.js} +36 -36
  86. package/dist/bundle/{chunk-XJBYGMZ4.js → chunk-YPO2U2YB.js} +669 -458
  87. package/dist/bundle/{chunk-C6TEYKXV.js → chunk-ZBFL5JPT.js} +8 -7
  88. package/dist/bundle/{chunk-7AUP2WT3.js → chunk-ZBKWRYRS.js} +2 -2
  89. package/dist/bundle/{chunk-HSI7YOYK.js → chunk-ZVI6TFQR.js} +100 -43
  90. package/dist/bundle/{cli-P3BZUE6S.js → cli-KHMEUXNG.js} +123 -68
  91. package/dist/bundle/command-contract-4K6XXZYE.js +41 -0
  92. package/dist/bundle/config-EEDB632I.js +90 -0
  93. package/dist/bundle/{decode-QWOQXM7M.js → decode-7RP4HSVE.js} +4 -4
  94. package/dist/bundle/{dispatch-5MGDLOK4.js → dispatch-IZCAK47P.js} +1 -1
  95. package/dist/bundle/{dist-OUE4MF37.js → dist-BFT2SUBV.js} +87 -51
  96. package/dist/bundle/{echarts-65IMPY43.js → echarts-T2BSQ2YV.js} +2 -2
  97. package/dist/bundle/{embed-4IULBCKL.js → embed-BAS6YPDT.js} +5 -5
  98. package/dist/bundle/{embedder-JW4W6IZI.js → embedder-5XD5FCAO.js} +8 -8
  99. package/dist/bundle/{failure-CR64C4XA.js → failure-R2OIHCE5.js} +1 -1
  100. package/dist/bundle/{first-run-CH6C674R.js → first-run-23WWZ2PW.js} +8 -8
  101. package/dist/bundle/first-screen-6HFUYVFR.js +39 -0
  102. package/dist/bundle/{folders-VU4IN35Y.js → folders-ZXTOFY4T.js} +3 -3
  103. package/dist/bundle/{instructions-G5QIH2TM.js → instructions-XZPROPKY.js} +1 -1
  104. package/dist/bundle/{main-O4ZJIEWP.js → main-TZXKGL3L.js} +18 -18
  105. package/dist/bundle/{meetings-77CCAVYD.js → meetings-JB2ISPND.js} +6 -4
  106. package/dist/bundle/{node-E6VQHU4Y.js → node-A3B3MJWX.js} +2 -2
  107. package/dist/bundle/{node-sqlite-RJZ4PGLD.js → node-sqlite-QVWDLGDX.js} +5 -5
  108. package/dist/bundle/{oauth-F4JKNRW4.js → oauth-YA6IYV4O.js} +6 -6
  109. package/dist/bundle/{open-NYOGMIAA.js → open-SY7TXJBS.js} +4 -4
  110. package/dist/bundle/{openai-5U6EQTFQ.js → openai-2AU24NRN.js} +10 -10
  111. package/dist/bundle/{output-file-6COFGPUL.js → output-file-YGQYZCBJ.js} +4 -4
  112. package/dist/bundle/{process-OBWUKBMX.js → process-6HNBTJIY.js} +1 -1
  113. package/dist/bundle/{program-MU7DEJTO.js → program-77BUCJ4H.js} +132 -100
  114. package/dist/bundle/{prompt-2QWQTHWT.js → prompt-YDG73YDS.js} +6 -4
  115. package/dist/bundle/{recognize-SNUNTUC3.js → recognize-ECXDGTB7.js} +3 -3
  116. package/dist/bundle/{remote-2CTCIQGF.js → remote-K4JHGBVJ.js} +6 -6
  117. package/dist/bundle/{rerank-XDA7NJNH.js → rerank-IU2YYD4T.js} +6 -6
  118. package/dist/bundle/{run-log-NSG3DJVX.js → run-log-LFEXNZ74.js} +54 -54
  119. package/dist/bundle/{serve-TWQFHOV2.js → serve-3XWIF3HI.js} +8 -8
  120. package/dist/bundle/{server-RIQ6HMH2.js → server-56VYOHWP.js} +42 -42
  121. package/dist/bundle/server-YSTMUZ22.js +72 -0
  122. package/dist/bundle/{services-NKZQJQIV.js → services-X7IPEGQ5.js} +118 -36
  123. package/dist/bundle/{speech-ZOB76SXA.js → speech-E2OBQWYA.js} +12 -12
  124. package/dist/bundle/{state-7YYEIXQ5.js → state-4GMJYK4H.js} +5 -5
  125. package/dist/bundle/{store-OX4HRBLO.js → store-KPI7GB5Y.js} +49 -22
  126. package/dist/bundle/{store-E6RTSSNR.js → store-LA4TV4DM.js} +39 -16
  127. package/dist/bundle/store-connection-AZTIF6IH.js +83 -0
  128. package/dist/bundle/store-maintenance-command-LR572PS4.js +61 -0
  129. package/dist/bundle/{streaming-O53PIORL.js → streaming-EJ3NM2C2.js} +5 -5
  130. package/dist/bundle/{tokens-QKNEP2GJ.js → tokens-BE6CJMR5.js} +5 -5
  131. package/dist/bundle/zm.js +3 -3
  132. package/dist/bundle/{zoom-app-TSI2MGVK.js → zoom-app-QEJBTIJ4.js} +6 -6
  133. package/dist/contract-overrides.d.ts.map +1 -1
  134. package/dist/contract-overrides.js +0 -6
  135. package/dist/contract-overrides.js.map +1 -1
  136. package/dist/first-screen.d.ts.map +1 -1
  137. package/dist/first-screen.js +1 -0
  138. package/dist/first-screen.js.map +1 -1
  139. package/dist/ingestion-search-commands.d.ts.map +1 -1
  140. package/dist/ingestion-search-commands.js +0 -10
  141. package/dist/ingestion-search-commands.js.map +1 -1
  142. package/dist/meeting-integration-commands.d.ts.map +1 -1
  143. package/dist/meeting-integration-commands.js +8 -6
  144. package/dist/meeting-integration-commands.js.map +1 -1
  145. package/dist/meeting-integration.d.ts +3 -1
  146. package/dist/meeting-integration.d.ts.map +1 -1
  147. package/dist/permissions.js +1 -1
  148. package/dist/permissions.js.map +1 -1
  149. package/dist/setup-commands.d.ts.map +1 -1
  150. package/dist/setup-commands.js +11 -0
  151. package/dist/setup-commands.js.map +1 -1
  152. package/dist/store-connection.d.ts.map +1 -1
  153. package/dist/store-connection.js +4 -3
  154. package/dist/store-connection.js.map +1 -1
  155. package/dist/tokens.d.ts +2 -0
  156. package/dist/tokens.d.ts.map +1 -1
  157. package/dist/tokens.js +11 -0
  158. package/dist/tokens.js.map +1 -1
  159. package/dist/unified-search.d.ts +4 -4
  160. package/dist/unified-search.d.ts.map +1 -1
  161. package/dist/unified-search.js +1 -24
  162. package/dist/unified-search.js.map +1 -1
  163. package/dist/version.d.ts +1 -1
  164. package/dist/version.js +1 -1
  165. package/package.json +3 -3
  166. package/skills/zoom-cli/SKILL.md +2 -2
  167. package/dist/bundle/answer-policy-VBDYLUXI.js +0 -104
  168. package/dist/bundle/chunk-2SYWVIQJ.js +0 -33
  169. package/dist/bundle/chunk-6AMMTXEA.js +0 -12473
  170. package/dist/bundle/chunk-F5DYBWH7.js +0 -299
  171. package/dist/bundle/chunk-T5X4LGXE.js +0 -380
  172. package/dist/bundle/command-contract-TOLB32NJ.js +0 -41
  173. package/dist/bundle/config-4KLLIADY.js +0 -90
  174. package/dist/bundle/first-screen-OCAW5ZN6.js +0 -39
  175. package/dist/bundle/server-XO6XQQTJ.js +0 -72
  176. package/dist/bundle/store-connection-55QPNUDS.js +0 -83
  177. package/dist/bundle/store-maintenance-command-Q5MSU6OK.js +0 -62
@@ -9,30 +9,50 @@ import {
9
9
  id,
10
10
  text,
11
11
  time
12
- } from "./chunk-T5X4LGXE.js";
12
+ } from "./chunk-USQ23X5V.js";
13
+ import {
14
+ readSharedSection,
15
+ sharedConfigPath,
16
+ writeSharedSection
17
+ } from "./chunk-5K7OGPGA.js";
13
18
  import {
14
19
  TAG_TYPES
15
- } from "./chunk-F5DYBWH7.js";
20
+ } from "./chunk-XI3VIQKW.js";
16
21
  import {
17
22
  filesPresent,
18
23
  sharedModelsDirectory
19
- } from "./chunk-LDRQ5NAP.js";
24
+ } from "./chunk-GXF5HFFP.js";
25
+ import {
26
+ storePath
27
+ } from "./chunk-KMV7GZB6.js";
20
28
  import {
21
- createRecordLog,
22
- resolvePaths,
23
- traceIdOf,
24
29
  writeSecurely
25
- } from "./chunk-KNE6VFHZ.js";
30
+ } from "./chunk-OORMSM6O.js";
26
31
  import {
27
32
  array,
28
33
  boolean,
34
+ check,
35
+ getDotPath,
36
+ integer,
37
+ maxLength,
38
+ maxValue,
39
+ minLength,
40
+ minValue,
29
41
  nullable,
30
42
  number,
31
43
  optional,
32
44
  picklist,
45
+ pipe,
46
+ record,
33
47
  reference,
34
- strictObject
35
- } from "./chunk-NRRI37NJ.js";
48
+ regex,
49
+ safeParse,
50
+ startsWith,
51
+ strictObject,
52
+ string,
53
+ trim,
54
+ url
55
+ } from "./chunk-WOIHSQAL.js";
36
56
  import {
37
57
  CliError,
38
58
  isCliError
@@ -41,487 +61,7 @@ import {
41
61
  __name
42
62
  } from "./chunk-ZVVMGPBJ.js";
43
63
 
44
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/runs/run.js
45
- import { randomUUID } from "node:crypto";
46
- import { appendFileSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
47
- import { userInfo } from "node:os";
48
- import { join, sep } from "node:path";
49
-
50
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/runs/log-keys.js
51
- var snake = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snake");
52
- var camel = /* @__PURE__ */ __name((key) => key.replace(/_([a-z0-9])/g, (_, letter) => letter.toUpperCase()), "camel");
53
- var renamed = /* @__PURE__ */ __name((record, name) => Object.fromEntries(Object.entries(record).map(([key, value]) => [name(key), value])), "renamed");
54
- var logAttributes = /* @__PURE__ */ __name((event) => renamed(event, snake), "logAttributes");
55
- var fromLogAttributes = /* @__PURE__ */ __name((attributes) => renamed(attributes, camel), "fromLogAttributes");
56
- var snakeLogger = /* @__PURE__ */ __name((logger) => ({
57
- debug: /* @__PURE__ */ __name((event, message) => logger.debug(logAttributes(event), message), "debug"),
58
- info: /* @__PURE__ */ __name((event, message) => logger.info(logAttributes(event), message), "info"),
59
- warn: /* @__PURE__ */ __name((event, message) => logger.warn(logAttributes(event), message), "warn"),
60
- error: /* @__PURE__ */ __name((event, message) => logger.error(logAttributes(event), message), "error")
61
- }), "snakeLogger");
62
-
63
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/runs/log-attributes.js
64
- var diagnostic = {
65
- event: true,
66
- operation: true,
67
- opcode: true,
68
- seq: true,
69
- status: true,
70
- method: true,
71
- endpointTemplate: true,
72
- bytes: true,
73
- ids: true,
74
- counts: true,
75
- durationMs: true,
76
- outcome: true,
77
- errorCode: true,
78
- providerError: true,
79
- level: true,
80
- transport: true,
81
- attempt: true,
82
- waitMs: true,
83
- code: true,
84
- detail: true,
85
- reason: true,
86
- ageMs: true
87
- };
88
- var send = {
89
- profile: true,
90
- chatId: true,
91
- outcome: true,
92
- kind: true,
93
- action: true,
94
- people: true,
95
- messageId: true,
96
- key: true,
97
- count: true,
98
- forEveryone: true,
99
- sendId: true,
100
- operationId: true,
101
- parentOperationId: true,
102
- replyTo: true,
103
- threadId: true,
104
- sendAs: true,
105
- resultChatId: true,
106
- length: true,
107
- attachments: true,
108
- scheduledFor: true,
109
- notify: true,
110
- origin: true,
111
- reservation: true,
112
- errorCode: true
113
- };
114
- var background = [
115
- "job",
116
- "pid",
117
- "schedule",
118
- "exitCode",
119
- "tool",
120
- "tier",
121
- "actorType",
122
- "actorId",
123
- "agent",
124
- "targetType",
125
- "targetId"
126
- ];
127
- var crash = ["errorClass", "frames"];
128
- var dropped = ["dropped"];
129
- var LOG_ATTRIBUTES = [
130
- ...new Set([...Object.keys(diagnostic), ...Object.keys(send), ...background, ...crash, ...dropped].map((key) => Object.keys(logAttributes({ [key]: true }))[0]))
131
- ].sort();
132
-
133
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/runs/run.js
134
- var KEEP_RUNS_FOR_DAYS = 30;
135
- var KEEP_SUCCESSFUL_RUNS_FOR_DAYS = 7;
136
- var RUNS_SIZE_LIMIT_MB = 200;
137
- var runsDirFor = /* @__PURE__ */ __name((app, env = process.env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "runs"), "runsDirFor");
138
- var startRun = /* @__PURE__ */ __name((options) => {
139
- const now = options.now ?? (() => /* @__PURE__ */ new Date());
140
- const startedAt = options.startedAt ?? now();
141
- const id2 = options.runId ?? newRunId(startedAt, options.command);
142
- const dir = join(options.runsDir, day(startedAt), id2);
143
- pruneRuns(options.runsDir, {
144
- keepDays: options.keepDays ?? KEEP_RUNS_FOR_DAYS,
145
- keepSuccessDays: options.keepSuccessDays ?? KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
146
- maxBytes: options.maxBytes ?? RUNS_SIZE_LIMIT_MB * 1024 * 1024,
147
- now: startedAt
148
- });
149
- refuseRealStateInTests(dir);
150
- const metadata = {
151
- runId: id2,
152
- command: options.command,
153
- ...options.profile === void 0 ? {} : { profile: options.profile },
154
- startedAt: startedAt.toISOString(),
155
- status: "running",
156
- cliVersion: options.cliVersion,
157
- runtime: runtime(),
158
- platform: process.platform,
159
- arch: process.arch,
160
- ...options.traceId === void 0 ? {} : { traceId: options.traceId },
161
- ...options.context
162
- };
163
- let file;
164
- const opened = /* @__PURE__ */ __name(() => {
165
- if (file)
166
- return file;
167
- mkdirSync(dir, { recursive: true, mode: 448 });
168
- const events = join(dir, "events.jsonl");
169
- writeFileSync(events, "", { flag: "a", mode: 384 });
170
- file = snakeLogger(createRecordLog({
171
- to: events,
172
- runId: id2,
173
- command: options.command,
174
- resource: { service: options.service, version: options.cliVersion },
175
- allow: LOG_ATTRIBUTES,
176
- ...options.traceId === void 0 ? {} : { traceId: options.traceId },
177
- ...options.onError === void 0 ? {} : { onError: options.onError }
178
- }));
179
- writeRunFile(dir, metadata);
180
- return file;
181
- }, "opened");
182
- if (!options.lazy)
183
- opened();
184
- let finished = false;
185
- const operations = /* @__PURE__ */ new Set();
186
- const codes = /* @__PURE__ */ new Set();
187
- const noted = /* @__PURE__ */ __name((level) => (event, message) => {
188
- const { operation, errorCode, error_code, code } = event;
189
- if (typeof operation === "string")
190
- operations.add(operation);
191
- for (const value of [errorCode, error_code, code])
192
- if (typeof value === "string")
193
- codes.add(value);
194
- if (finished)
195
- return;
196
- opened()[level](event, message);
197
- }, "noted");
198
- const logger = { debug: noted("debug"), info: noted("info"), warn: noted("warn"), error: noted("error") };
199
- return {
200
- id: id2,
201
- dir,
202
- logger,
203
- finish: /* @__PURE__ */ __name(async (status, extra = {}) => {
204
- if (finished)
205
- return;
206
- finished = true;
207
- const completedAt = now();
208
- const final = {
209
- ...metadata,
210
- ...extra,
211
- status,
212
- completedAt: completedAt.toISOString(),
213
- durationMs: completedAt.getTime() - startedAt.getTime(),
214
- operations: [...operations].sort(),
215
- codes: [...codes].sort()
216
- };
217
- if (file || status !== "success") {
218
- opened();
219
- writeRunFile(dir, final);
220
- return;
221
- }
222
- try {
223
- mkdirSync(join(dir, ".."), { recursive: true, mode: 448 });
224
- appendIndex(join(dir, ".."), runFileOf(final));
225
- } catch (error) {
226
- options.onError?.(error);
227
- }
228
- }, "finish")
229
- };
230
- }, "startRun");
231
- var refuseRealStateInTests = /* @__PURE__ */ __name((dir, env = process.env) => {
232
- if (env.VITEST === void 0)
233
- return;
234
- let home;
235
- try {
236
- home = userInfo().homedir;
237
- } catch {
238
- return;
239
- }
240
- if (dir.startsWith(join(home, ".local", "share") + sep))
241
- throw new Error(`a test opened a run in the real data folder: ${dir}`);
242
- }, "refuseRealStateInTests");
243
- var runtime = /* @__PURE__ */ __name(() => {
244
- const bun = process.versions.bun;
245
- return bun ? `bun ${bun}` : `node ${process.versions.node}`;
246
- }, "runtime");
247
- var newRunId = /* @__PURE__ */ __name((startedAt, command) => {
248
- const stamp = startedAt.toISOString().replace(/[-:]/g, "").replace(/\.\d+Z$/, "Z");
249
- const slug = command.replace(/[^a-z0-9]+/gi, "-").toLowerCase();
250
- return `${stamp}-${slug}-${randomUUID().slice(0, 6)}`;
251
- }, "newRunId");
252
- var INDEX = "index.jsonl";
253
- var appendIndex = /* @__PURE__ */ __name((dayDir, written) => {
254
- appendFileSync(join(dayDir, INDEX), `${JSON.stringify(written)}
255
- `, { mode: 384 });
256
- }, "appendIndex");
257
- var writeRunFile = /* @__PURE__ */ __name((dir, metadata) => {
258
- const written = runFileOf(metadata);
259
- writeSecurely(join(dir, "run.json"), `${JSON.stringify(written, null, 2)}
260
- `, 384);
261
- try {
262
- appendIndex(join(dir, ".."), written);
263
- } catch {
264
- }
265
- }, "writeRunFile");
266
- 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");
267
- var listRuns = /* @__PURE__ */ __name((runsDir, { since, atLeast = Number.POSITIVE_INFINITY, filter = {} } = {}) => {
268
- const first = since === void 0 ? void 0 : day(new Date(since));
269
- const runs = [];
270
- for (const date of days(runsDir).sort().reverse()) {
271
- if (first !== void 0 && date < first || runs.length >= atLeast)
272
- break;
273
- for (const metadata of runsOfDay(join(runsDir, date))) {
274
- if (matchesListFilter(metadata, filter))
275
- runs.push(metadata);
276
- }
277
- }
278
- return runs;
279
- }, "listRuns");
280
- var indexedRuns = /* @__PURE__ */ __name((dayDir) => {
281
- const latest = /* @__PURE__ */ new Map();
282
- let raw = "";
283
- try {
284
- raw = readFileSync(join(dayDir, INDEX), "utf8");
285
- } catch {
286
- }
287
- for (const line of raw.split("\n")) {
288
- if (line.trim() === "")
289
- continue;
290
- try {
291
- const metadata = metadataOf(JSON.parse(line));
292
- if (typeof metadata.runId === "string")
293
- latest.set(metadata.runId, metadata);
294
- } catch {
295
- }
296
- }
297
- return latest;
298
- }, "indexedRuns");
299
- var runsOfDay = /* @__PURE__ */ __name((dayDir) => {
300
- const latest = indexedRuns(dayDir);
301
- for (const entry of safeReaddir(dayDir)) {
302
- if (entry === INDEX || entry.startsWith(".") || latest.has(entry))
303
- continue;
304
- const metadata = readRun(join(dayDir, entry));
305
- if (metadata)
306
- latest.set(metadata.runId, metadata);
307
- }
308
- return [...latest.values()].sort((a, b) => a.runId < b.runId ? 1 : a.runId > b.runId ? -1 : 0);
309
- }, "runsOfDay");
310
- var findRun = /* @__PURE__ */ __name((runsDir, id2) => {
311
- const stamped = /^(\d{4})(\d{2})(\d{2})T/.exec(id2);
312
- const likely = stamped ? [`${stamped[1]}-${stamped[2]}-${stamped[3]}`] : [];
313
- const dates = [.../* @__PURE__ */ new Set([...likely, ...days(runsDir)])];
314
- for (const date of dates) {
315
- const dir = join(runsDir, date, id2);
316
- const metadata = readRun(dir);
317
- if (metadata)
318
- return { dir, metadata };
319
- }
320
- for (const date of dates) {
321
- const metadata = indexedRuns(join(runsDir, date)).get(id2);
322
- if (metadata)
323
- return { dir: join(runsDir, date, id2), metadata };
324
- }
325
- return void 0;
326
- }, "findRun");
327
- var readEvents = /* @__PURE__ */ __name((dir) => {
328
- let raw;
329
- try {
330
- raw = readFileSync(join(dir, "events.jsonl"), "utf8");
331
- } catch {
332
- return [];
333
- }
334
- const events = [];
335
- for (const line of raw.split("\n")) {
336
- if (line.trim() === "")
337
- continue;
338
- try {
339
- const parsed = JSON.parse(line);
340
- if (parsed !== null && typeof parsed === "object")
341
- events.push(eventOf(parsed));
342
- } catch {
343
- }
344
- }
345
- return events;
346
- }, "readEvents");
347
- var eventOf = /* @__PURE__ */ __name((line) => {
348
- const { attributes, time: time2, severity } = line;
349
- if (attributes === null || typeof attributes !== "object")
350
- return logAttributes(line);
351
- return { time: time2, severity, ...logAttributes(attributes) };
352
- }, "eventOf");
353
- var pruneRuns = /* @__PURE__ */ __name((runsDir, { keepDays, keepSuccessDays = keepDays, maxBytes, now }) => {
354
- const cutoff = day(new Date(now.getTime() - keepDays * DAY_MS));
355
- const successCutoff = day(new Date(now.getTime() - Math.min(keepSuccessDays, keepDays) * DAY_MS));
356
- let removed = 0;
357
- for (const date of days(runsDir)) {
358
- if (date >= cutoff) {
359
- if (date < successCutoff)
360
- dropSuccesses(join(runsDir, date));
361
- continue;
362
- }
363
- try {
364
- rmSync(join(runsDir, date), { recursive: true, force: true });
365
- removed += 1;
366
- } catch {
367
- }
368
- }
369
- if (maxBytes !== void 0)
370
- removed += fitSize(runsDir, maxBytes, now);
371
- return removed;
372
- }, "pruneRuns");
373
- var DAY_MS = 24 * 60 * 60 * 1e3;
374
- var SUCCESSES_DROPPED = ".successes-dropped";
375
- var SIZE_CHECKED = ".size-checked";
376
- var dropSuccesses = /* @__PURE__ */ __name((dayDir) => {
377
- const marker = join(dayDir, SUCCESSES_DROPPED);
378
- try {
379
- statSync(marker);
380
- return;
381
- } catch {
382
- }
383
- try {
384
- const kept = [];
385
- for (const [id2, metadata] of indexedRuns(dayDir)) {
386
- if (metadata.status === "success")
387
- rmSync(join(dayDir, id2), { recursive: true, force: true });
388
- else
389
- kept.push(JSON.stringify(runFileOf(metadata)));
390
- }
391
- for (const entry of safeReaddir(dayDir)) {
392
- if (entry === INDEX || entry.startsWith("."))
393
- continue;
394
- if (readRun(join(dayDir, entry))?.status === "success")
395
- rmSync(join(dayDir, entry), { recursive: true, force: true });
396
- }
397
- writeSecurely(join(dayDir, INDEX), kept.map((line) => `${line}
398
- `).join(""), 384);
399
- writeFileSync(marker, "", { mode: 384 });
400
- } catch {
401
- }
402
- }, "dropSuccesses");
403
- var sizeOf = /* @__PURE__ */ __name((path) => {
404
- let total = 0;
405
- for (const entry of safeReaddir(path)) {
406
- const full = join(path, entry);
407
- try {
408
- const stat = statSync(full);
409
- total += stat.isDirectory() ? sizeOf(full) : stat.size;
410
- } catch {
411
- }
412
- }
413
- return total;
414
- }, "sizeOf");
415
- var fitSize = /* @__PURE__ */ __name((runsDir, maxBytes, now) => {
416
- const stamp = join(runsDir, SIZE_CHECKED);
417
- const today = day(now);
418
- try {
419
- if (readFileSync(stamp, "utf8").trim() === today)
420
- return 0;
421
- } catch {
422
- }
423
- const dates = days(runsDir).sort();
424
- const sizes = new Map(dates.map((date) => [date, sizeOf(join(runsDir, date))]));
425
- let total = [...sizes.values()].reduce((sum, size) => sum + size, 0);
426
- let removed = 0;
427
- for (const date of dates) {
428
- if (total <= maxBytes || date === today)
429
- break;
430
- dropSuccesses(join(runsDir, date));
431
- const after = sizeOf(join(runsDir, date));
432
- total -= (sizes.get(date) ?? 0) - after;
433
- sizes.set(date, after);
434
- }
435
- for (const date of dates) {
436
- if (total <= maxBytes || date === today)
437
- break;
438
- try {
439
- rmSync(join(runsDir, date), { recursive: true, force: true });
440
- total -= sizes.get(date) ?? 0;
441
- removed += 1;
442
- } catch {
443
- }
444
- }
445
- try {
446
- mkdirSync(runsDir, { recursive: true, mode: 448 });
447
- writeFileSync(stamp, today, { mode: 384 });
448
- } catch {
449
- }
450
- return removed;
451
- }, "fitSize");
452
- var day = /* @__PURE__ */ __name((date) => date.toISOString().slice(0, 10), "day");
453
- var days = /* @__PURE__ */ __name((runsDir) => safeReaddir(runsDir).filter((entry) => /^\d{4}-\d{2}-\d{2}$/.test(entry)), "days");
454
- var readRun = /* @__PURE__ */ __name((dir) => {
455
- try {
456
- return metadataOf(JSON.parse(readFileSync(join(dir, "run.json"), "utf8")));
457
- } catch {
458
- return void 0;
459
- }
460
- }, "readRun");
461
- var safeReaddir = /* @__PURE__ */ __name((dir) => {
462
- try {
463
- return readdirSync(dir);
464
- } catch {
465
- return [];
466
- }
467
- }, "safeReaddir");
468
- var runFileOf = /* @__PURE__ */ __name(({ partial, ...metadata }) => ({
469
- ...logAttributes(metadata),
470
- ...partial ? { partial: { ...logAttributes(partial), failures: partial.failures.map((failure) => logAttributes(failure)) } } : {}
471
- }), "runFileOf");
472
- var metadataOf = /* @__PURE__ */ __name((parsed) => {
473
- const { partial, ...metadata } = fromLogAttributes(parsed);
474
- if (partial === null || typeof partial !== "object")
475
- return metadata;
476
- const { failures, ...rest } = fromLogAttributes(partial);
477
- return {
478
- ...metadata,
479
- partial: {
480
- ...rest,
481
- failures: Array.isArray(failures) ? failures.map((failure) => fromLogAttributes(failure)) : []
482
- }
483
- };
484
- }, "metadataOf");
485
-
486
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/runs/scope.js
487
- import { AsyncLocalStorage } from "node:async_hooks";
488
- import { randomBytes } from "node:crypto";
489
- var scopes = new AsyncLocalStorage();
490
- var processScope;
491
- var currentRun = /* @__PURE__ */ __name(() => {
492
- const scope = scopes.getStore();
493
- if (scope)
494
- return scope;
495
- processScope ??= {
496
- runId: newRunId(/* @__PURE__ */ new Date(), "process"),
497
- command: "",
498
- startedAt: Date.now(),
499
- ...traceOf(process.env)
500
- };
501
- return processScope;
502
- }, "currentRun");
503
- var inRun = /* @__PURE__ */ __name((scope, body) => scopes.run(scope, body), "inRun");
504
- var runEvent = /* @__PURE__ */ __name((event) => scopes.getStore()?.events?.(event), "runEvent");
505
- var typedCommand = /* @__PURE__ */ __name((tool, words, profile = currentRun().profile) => [tool, profile, words].filter((part) => part !== void 0 && part !== "").join(" "), "typedCommand");
506
- var useAsProcessRun = /* @__PURE__ */ __name((scope) => {
507
- processScope = scope;
508
- }, "useAsProcessRun");
509
- var processRun = /* @__PURE__ */ __name(() => processScope, "processRun");
510
- var enclosingTraceId = /* @__PURE__ */ __name(() => scopes.getStore()?.traceId, "enclosingTraceId");
511
- var traceOf = /* @__PURE__ */ __name((env) => {
512
- const traceId = traceIdOf(env.TRACEPARENT);
513
- return traceId === void 0 ? {} : { traceId };
514
- }, "traceOf");
515
- var childTrace = /* @__PURE__ */ __name(() => {
516
- const hex = /* @__PURE__ */ __name((bytes) => randomBytes(bytes).toString("hex"), "hex");
517
- const traceId = hex(16);
518
- return { traceId, traceparent: `00-${traceId}-${hex(8)}-01` };
519
- }, "childTrace");
520
- var attempts = new AsyncLocalStorage();
521
- var withAttempt = /* @__PURE__ */ __name((attempt, work) => attempts.run(attempt, work), "withAttempt");
522
- var currentAttempt = /* @__PURE__ */ __name(() => attempts.getStore(), "currentAttempt");
523
-
524
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/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
525
65
  var DURATION = /^(\d+)(ms|s|m|h|d)$/;
526
66
  var UNIT_MS = { ms: 1, s: 1e3, m: 6e4, h: 36e5, d: 864e5 };
527
67
  var parseDuration = /* @__PURE__ */ __name((value, source) => {
@@ -535,120 +75,18 @@ var parseDuration = /* @__PURE__ */ __name((value, source) => {
535
75
  return ms;
536
76
  }, "parseDuration");
537
77
 
538
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/sends/guarded.js
539
- import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
540
- var sentIds = /* @__PURE__ */ __name((typed, message) => ({
541
- messageId: message.id,
542
- ...message.chatId && message.chatId !== typed ? { resultChatId: message.chatId } : {}
543
- }), "sentIds");
544
- var current = new AsyncLocalStorage2();
545
- var writesInFlight = new AsyncLocalStorage2();
546
- var parents = /* @__PURE__ */ new WeakMap();
547
- var stopped = /* @__PURE__ */ new WeakMap();
548
- var scopesFor = /* @__PURE__ */ __name((scope = writesInFlight.getStore()) => {
549
- const result = [];
550
- for (let at = scope; at; at = parents.get(at))
551
- result.push(at);
552
- return result;
553
- }, "scopesFor");
554
- var withWriteScope = /* @__PURE__ */ __name((scope, body) => {
555
- const parent = writesInFlight.getStore();
556
- if (parent && parent !== scope)
557
- parents.set(scope, parent);
558
- return writesInFlight.run(scope, body);
559
- }, "withWriteScope");
560
- var stopWrites = /* @__PURE__ */ __name((scope, reason) => {
561
- stopped.set(scope, reason);
562
- for (const write of scope)
563
- write.cut();
564
- }, "stopWrites");
565
- var refuseStopped = /* @__PURE__ */ __name((scopes2) => {
566
- for (const scope of scopes2)
567
- if (stopped.has(scope))
568
- throw stopped.get(scope);
569
- }, "refuseStopped");
570
- var currentOperation = /* @__PURE__ */ __name(() => current.getStore(), "currentOperation");
571
- var guardedWrite = /* @__PURE__ */ __name(async (guard, attempt, act, settled = () => ({}), prepare) => {
572
- const scopes2 = scopesFor();
573
- refuseStopped(scopes2);
574
- try {
575
- await guard.ask?.(attempt);
576
- refuseStopped(scopes2);
577
- if (guard.reserve) {
578
- guard.check(attempt, { reserve: false });
579
- await guard.reserve(attempt);
580
- } else
581
- guard.check(attempt);
582
- } catch (error) {
583
- guard.record({ ...attempt, outcome: "refused", errorCode: codeOf(error) });
584
- throw error;
585
- }
586
- try {
587
- refuseStopped(scopes2);
588
- } catch (error) {
589
- guard.record({ ...attempt, outcome: "failed", errorCode: codeOf(error) });
590
- throw error;
591
- }
592
- let recorded = false;
593
- const once = /* @__PURE__ */ __name((entry) => {
594
- if (recorded)
595
- return;
596
- recorded = true;
597
- guard.record(entry);
598
- }, "once");
599
- let cancelled = false;
600
- const flight = {
601
- operationId: attempt.operationId,
602
- preparing: prepare !== void 0,
603
- cut: /* @__PURE__ */ __name(() => {
604
- cancelled = true;
605
- once({
606
- ...attempt,
607
- outcome: flight.preparing ? "failed" : "outcome_unknown",
608
- errorCode: flight.preparing ? "timeout" : "outcome_unknown"
609
- });
610
- }, "cut")
611
- };
612
- for (const scope of scopes2)
613
- scope.add(flight);
614
- try {
615
- if (prepare !== void 0)
616
- await prepare();
617
- if (cancelled)
618
- throw new CliError("timeout", "the command ended before sending; nothing was sent", { sent: false });
619
- flight.preparing = false;
620
- const done = await current.run(attempt.operationId, act);
621
- if (cancelled)
622
- throw new CliError("outcome_unknown", "the command ended with a write in flight; check its result before continuing", { operation_id: attempt.operationId });
623
- once({ ...attempt, ...settled(done), outcome: "sent" });
624
- return done;
625
- } catch (error) {
626
- const code = codeOf(error);
627
- once({ ...attempt, outcome: code === "outcome_unknown" ? "outcome_unknown" : "failed", errorCode: code });
628
- if (code === "outcome_unknown" && error instanceof Error)
629
- throw new CliError("outcome_unknown", error.message, {
630
- ...error.details,
631
- operation_id: attempt.operationId,
632
- retryable: false
633
- });
634
- if (flight.preparing && isCliError(error) && error.details.sent === void 0)
635
- throw new CliError(error.code, error.message, { ...error.details, sent: false });
636
- throw error;
637
- } finally {
638
- for (const scope of scopes2)
639
- scope.delete(flight);
640
- }
641
- }, "guardedWrite");
642
- var codeOf = /* @__PURE__ */ __name((error) => typeof error?.code === "string" ? error.code : "unknown", "codeOf");
643
-
644
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/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";
645
81
  var huggingFace = /* @__PURE__ */ __name((repository, commit) => (name) => `https://huggingface.co/${repository}/resolve/${commit}/${name}`, "huggingFace");
646
82
  var e5 = huggingFace("Xenova/multilingual-e5-small", "761b726dd34fb83930e26aab4e9ac3899aa1fa78");
83
+ var e5Large = huggingFace("Xenova/multilingual-e5-large", "00fc3aeb3dbb95842de2ac1961d33c6319acf57b");
647
84
  var gemma = huggingFace("onnx-community/embeddinggemma-300m-ONNX", "5090578d9565bb06545b4552f76e6bc2c93e4a66");
648
85
  var TEXT_MODELS = [
649
86
  {
650
87
  id: "e5-small",
651
88
  title: "multilingual-e5-small, 8-bit",
89
+ size: "small",
652
90
  languages: "about 100 languages, Russian and English among them",
653
91
  licence: "MIT",
654
92
  dims: 384,
@@ -682,12 +120,17 @@ var TEXT_MODELS = [
682
120
  {
683
121
  id: "embeddinggemma",
684
122
  title: "EmbeddingGemma 300M, 4-bit",
123
+ size: "medium",
685
124
  languages: "over 100 languages \u2014 the best of the two on chat, about seven times slower",
686
125
  licence: "Gemma Terms of Use",
687
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",
688
129
  dims: 768,
689
130
  maxTokens: 2048,
690
- 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,
691
134
  pooling: "sentence_embedding",
692
135
  prefix: { query: "task: search result | query: ", passage: "title: none | text: " },
693
136
  onnx: "onnx/model_q4.onnx",
@@ -718,16 +161,122 @@ var TEXT_MODELS = [
718
161
  bytes: 1156830
719
162
  }
720
163
  ]
164
+ },
165
+ {
166
+ id: "e5-large",
167
+ title: "multilingual-e5-large, 8-bit",
168
+ size: "large",
169
+ languages: "about 100 languages, Russian and English among them \u2014 reads better than e5-small, several times slower",
170
+ licence: "MIT",
171
+ dims: 1024,
172
+ maxTokens: 512,
173
+ // 2026-11-07, one 8-thread session on the Ryzen AI 9 HX 470 while other benchmarks ran: 3.4 chunks/s.
174
+ chunksPerSecond: 4,
175
+ pooling: "mean",
176
+ prefix: { query: "query: ", passage: "passage: " },
177
+ onnx: "onnx/model_quantized.onnx",
178
+ files: [
179
+ {
180
+ name: "onnx/model_quantized.onnx",
181
+ url: e5Large("onnx/model_quantized.onnx"),
182
+ sha256: "0a8d65db9a36f810ba5da15249f13145fcdc7890e6656f1fd38cd8b7c4db1fca",
183
+ bytes: 561768762
184
+ },
185
+ {
186
+ name: "tokenizer.json",
187
+ url: e5Large("tokenizer.json"),
188
+ sha256: "62c24cdc13d4c9952d63718d6c9fa4c287974249e16b7ade6d5a85e7bbb75626",
189
+ bytes: 17082660
190
+ },
191
+ {
192
+ name: "tokenizer_config.json",
193
+ url: e5Large("tokenizer_config.json"),
194
+ sha256: "efb5c0d09722e5fe59a462cd2a9976ee216d55b037597d997cd3fe833216da15",
195
+ bytes: 418
196
+ }
197
+ ]
721
198
  }
722
199
  ];
723
- var DEFAULT_TEXT_MODEL = "e5-small";
724
- var textModel = /* @__PURE__ */ __name((id2) => {
725
- const found = TEXT_MODELS.find((model) => model.id === id2);
200
+ var DEFAULT_TEXT_MODEL = "embeddinggemma";
201
+ var PREVIOUS_DEFAULT_TEXT_MODEL = "e5-small";
202
+ var SECTION = "text_models";
203
+ var slug = pipe(string(), regex(/^[a-z0-9][a-z0-9._-]{0,62}$/, "is not a model id: a-z, 0-9, . _ -"));
204
+ var words = pipe(string(), trim(), minLength(1), maxLength(300));
205
+ var fileName = pipe(string(), check((name) => /^[\w.-]+(\/[\w.-]+)*$/.test(name) && !name.split("/").some((part) => part === ".." || part === "."), "is not a file inside the model's folder"));
206
+ var modelFile = strictObject({
207
+ name: fileName,
208
+ url: pipe(string(), url(), startsWith("https://", "has to be an https address")),
209
+ sha256: pipe(string(), regex(/^[0-9a-f]{64}$/, "has to be a sha256 in hex")),
210
+ bytes: pipe(number(), integer(), minValue(1))
211
+ });
212
+ var CustomTextModelShape = pipe(strictObject({
213
+ id: slug,
214
+ title: words,
215
+ languages: words,
216
+ licence: words,
217
+ terms: optional(pipe(string(), url())),
218
+ dims: pipe(number(), integer(), minValue(1), maxValue(8192)),
219
+ maxTokens: pipe(number(), integer(), minValue(16), maxValue(32768)),
220
+ chunksPerSecond: optional(pipe(number(), minValue(0.01))),
221
+ pooling: picklist(["mean", "sentence_embedding"]),
222
+ prefix: strictObject({
223
+ query: pipe(string(), maxLength(200)),
224
+ passage: pipe(string(), maxLength(200))
225
+ }),
226
+ onnx: fileName,
227
+ externalData: optional(fileName),
228
+ files: pipe(array(modelFile), minLength(1), maxLength(16))
229
+ }), check((model) => !TEXT_MODELS.some((one) => one.id === model.id), "takes the id of a model this version ships; choose another"), check((model) => {
230
+ const names = model.files.map(({ name }) => name);
231
+ return [model.onnx, model.externalData, "tokenizer.json", "tokenizer_config.json"].every((name) => name === void 0 || names.includes(name));
232
+ }, "has to list its onnx file, its external data and tokenizer.json and tokenizer_config.json among files"));
233
+ var TextModelsSection = strictObject({
234
+ use: optional(slug),
235
+ custom: optional(array(CustomTextModelShape))
236
+ });
237
+ var textModelsFile = /* @__PURE__ */ __name((env = process.env) => sharedConfigPath(storePath(env), env), "textModelsFile");
238
+ var readTextModelsSection = /* @__PURE__ */ __name((env = process.env) => {
239
+ const path = textModelsFile(env);
240
+ const section = readSharedSection(path, SECTION);
241
+ if (section === void 0)
242
+ return {};
243
+ const checked = safeParse(TextModelsSection, section);
244
+ if (!checked.success) {
245
+ const issue = checked.issues[0];
246
+ const at = issue ? getDotPath(issue) : null;
247
+ throw new CliError("configuration_error", `${path}: ${SECTION}${at ? `.${at}` : ""} ${issue?.message ?? "is not valid"}`);
248
+ }
249
+ const ids = checked.output.custom?.map(({ id: id2 }) => id2) ?? [];
250
+ const twice = ids.find((id2, at) => ids.indexOf(id2) !== at);
251
+ if (twice)
252
+ throw new CliError("configuration_error", `${path}: ${SECTION}.custom names ${twice} twice`);
253
+ return checked.output;
254
+ }, "readTextModelsSection");
255
+ var writeTextModelsSection = /* @__PURE__ */ __name((section, env = process.env) => writeSharedSection(textModelsFile(env), SECTION, section.use === void 0 && !section.custom?.length ? void 0 : section), "writeTextModelsSection");
256
+ var textModels = /* @__PURE__ */ __name((env = process.env) => [
257
+ ...TEXT_MODELS,
258
+ ...(readTextModelsSection(env).custom ?? []).map((model) => ({ ...model, custom: true }))
259
+ ], "textModels");
260
+ var textModel = /* @__PURE__ */ __name((id2, env = process.env) => {
261
+ const known = textModels(env);
262
+ const found = known.find((model) => model.id === id2);
726
263
  if (!found) {
727
- throw new CliError("validation_error", `no text model ${id2} \u2014 one of: ${TEXT_MODELS.map((model) => model.id).join(", ")}`);
264
+ throw new CliError("validation_error", `no text model ${id2} \u2014 one of: ${known.map((model) => model.id).join(", ")}`);
728
265
  }
729
266
  return found;
730
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");
273
+ var chosenTextModel = /* @__PURE__ */ __name((env = process.env) => {
274
+ const use = readTextModelsSection(env).use;
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" };
279
+ }, "chosenTextModel");
731
280
  var mmarco = huggingFace("cross-encoder/mmarco-mMiniLMv2-L12-H384-v1", "1427fd652930e4ba29e8149678df786c240d8825");
732
281
  var bge = huggingFace("onnx-community/bge-reranker-v2-m3-ONNX", "6f5ff65298512715a1e669753bc754d2bc8f367b");
733
282
  var RERANK_MODELS = [
@@ -797,19 +346,250 @@ var rerankModel = /* @__PURE__ */ __name((id2) => {
797
346
  }
798
347
  return found;
799
348
  }, "rerankModel");
800
- var vectorModelKey = /* @__PURE__ */ __name((model) => `local:${model.id}:${model.dims}`, "vectorModelKey");
349
+ var vectorModelKey = /* @__PURE__ */ __name((model) => {
350
+ const weights = model.custom ? model.files.find(({ name }) => name === model.onnx)?.sha256.slice(0, 12) : void 0;
351
+ return `local:${model.id}${weights ? `@${weights}` : ""}:${model.dims}`;
352
+ }, "vectorModelKey");
801
353
  var meaningFloor = /* @__PURE__ */ __name((key) => key === "local:e5-small:384" ? 0.8 : 0, "meaningFloor");
802
354
 
803
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/services/history-limits.js
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";
400
+ var sentIds = /* @__PURE__ */ __name((typed, message) => ({
401
+ messageId: message.id,
402
+ ...message.chatId && message.chatId !== typed ? { resultChatId: message.chatId } : {}
403
+ }), "sentIds");
404
+ var current = new AsyncLocalStorage();
405
+ var writesInFlight = new AsyncLocalStorage();
406
+ var parents = /* @__PURE__ */ new WeakMap();
407
+ var stopped = /* @__PURE__ */ new WeakMap();
408
+ var scopesFor = /* @__PURE__ */ __name((scope = writesInFlight.getStore()) => {
409
+ const result = [];
410
+ for (let at = scope; at; at = parents.get(at))
411
+ result.push(at);
412
+ return result;
413
+ }, "scopesFor");
414
+ var withWriteScope = /* @__PURE__ */ __name((scope, body) => {
415
+ const parent = writesInFlight.getStore();
416
+ if (parent && parent !== scope)
417
+ parents.set(scope, parent);
418
+ return writesInFlight.run(scope, body);
419
+ }, "withWriteScope");
420
+ var stopWrites = /* @__PURE__ */ __name((scope, reason) => {
421
+ stopped.set(scope, reason);
422
+ for (const write of scope)
423
+ write.cut();
424
+ }, "stopWrites");
425
+ var refuseStopped = /* @__PURE__ */ __name((scopes) => {
426
+ for (const scope of scopes)
427
+ if (stopped.has(scope))
428
+ throw stopped.get(scope);
429
+ }, "refuseStopped");
430
+ var currentOperation = /* @__PURE__ */ __name(() => current.getStore(), "currentOperation");
431
+ var guardedWrite = /* @__PURE__ */ __name(async (guard, attempt, act, settled = () => ({}), prepare) => {
432
+ const scopes = scopesFor();
433
+ refuseStopped(scopes);
434
+ try {
435
+ await guard.ask?.(attempt);
436
+ refuseStopped(scopes);
437
+ if (guard.reserve) {
438
+ guard.check(attempt, { reserve: false });
439
+ await guard.reserve(attempt);
440
+ } else
441
+ guard.check(attempt);
442
+ } catch (error) {
443
+ guard.record({ ...attempt, outcome: "refused", errorCode: codeOf(error) });
444
+ throw error;
445
+ }
446
+ try {
447
+ refuseStopped(scopes);
448
+ } catch (error) {
449
+ guard.record({ ...attempt, outcome: "failed", errorCode: codeOf(error) });
450
+ throw error;
451
+ }
452
+ let recorded = false;
453
+ const once = /* @__PURE__ */ __name((entry) => {
454
+ if (recorded)
455
+ return;
456
+ recorded = true;
457
+ guard.record(entry);
458
+ }, "once");
459
+ let cancelled = false;
460
+ const flight = {
461
+ operationId: attempt.operationId,
462
+ preparing: prepare !== void 0,
463
+ cut: /* @__PURE__ */ __name(() => {
464
+ cancelled = true;
465
+ once({
466
+ ...attempt,
467
+ outcome: flight.preparing ? "failed" : "outcome_unknown",
468
+ errorCode: flight.preparing ? "timeout" : "outcome_unknown"
469
+ });
470
+ }, "cut")
471
+ };
472
+ for (const scope of scopes)
473
+ scope.add(flight);
474
+ try {
475
+ if (prepare !== void 0)
476
+ await prepare();
477
+ if (cancelled)
478
+ throw new CliError("timeout", "the command ended before sending; nothing was sent", { sent: false });
479
+ flight.preparing = false;
480
+ const done = await current.run(attempt.operationId, act);
481
+ if (cancelled)
482
+ throw new CliError("outcome_unknown", "the command ended with a write in flight; check its result before continuing", { operation_id: attempt.operationId });
483
+ once({ ...attempt, ...settled(done), outcome: "sent" });
484
+ return done;
485
+ } catch (error) {
486
+ const code = codeOf(error);
487
+ once({ ...attempt, outcome: code === "outcome_unknown" ? "outcome_unknown" : "failed", errorCode: code });
488
+ if (code === "outcome_unknown" && error instanceof Error)
489
+ throw new CliError("outcome_unknown", error.message, {
490
+ ...error.details,
491
+ operation_id: attempt.operationId,
492
+ retryable: false
493
+ });
494
+ if (flight.preparing && isCliError(error) && error.details.sent === void 0)
495
+ throw new CliError(error.code, error.message, { ...error.details, sent: false });
496
+ throw error;
497
+ } finally {
498
+ for (const scope of scopes)
499
+ scope.delete(flight);
500
+ }
501
+ }, "guardedWrite");
502
+ var codeOf = /* @__PURE__ */ __name((error) => typeof error?.code === "string" ? error.code : "unknown", "codeOf");
503
+
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
505
+ var endpoint = /* @__PURE__ */ __name((value) => {
506
+ try {
507
+ const url2 = new URL(value);
508
+ return ["https:", "http:"].includes(url2.protocol) && !url2.username && !url2.password && !url2.search && !url2.hash;
509
+ } catch {
510
+ return false;
511
+ }
512
+ }, "endpoint");
513
+
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
515
+ var MODEL_FIELDS = ["provider", "model", "base_url"];
516
+ var modelSettingsShape = record(pipe(string(), regex(/^[a-z][a-z0-9-]*$/)), strictObject({
517
+ provider: optional(picklist(["off", "openai", "anthropic"])),
518
+ model: optional(pipe(string(), trim(), minLength(1), maxLength(200))),
519
+ base_url: optional(pipe(string(), check((value) => endpoint(value), "use an HTTP/S endpoint without credentials, query or fragment")))
520
+ }));
521
+ var resolveModelSettings = /* @__PURE__ */ __name((prefix, layers, env) => {
522
+ const configured = layers.map(([from, scope]) => [from, scope?.models ?? {}]);
523
+ const purposes = /* @__PURE__ */ new Set([
524
+ "default",
525
+ "analysis",
526
+ "replies",
527
+ ...configured.flatMap(([, models2]) => Object.keys(models2))
528
+ ]);
529
+ for (const name of Object.keys(env)) {
530
+ const match = new RegExp(`^${prefix}_MODELS_([A-Z][A-Z0-9_]*)_(PROVIDER|MODEL|BASE_URL)$`).exec(name);
531
+ if (match?.[1])
532
+ purposes.add(match[1].toLowerCase().replaceAll("_", "-"));
533
+ }
534
+ const models = {};
535
+ const sources = {};
536
+ for (const purpose of purposes) {
537
+ const resolved = {};
538
+ for (const field of MODEL_FIELDS) {
539
+ const variable = `${prefix}_MODELS_${purpose.replaceAll("-", "_").toUpperCase()}_${field.toUpperCase()}`;
540
+ const candidates = [
541
+ [variable, env[variable]?.trim() || void 0],
542
+ ...configured.map(([from, model]) => [
543
+ `${from}: models.${purpose}.${field}`,
544
+ model[purpose]?.[field]
545
+ ]),
546
+ ...purpose === "default" ? [] : [
547
+ [
548
+ `${prefix}_MODELS_DEFAULT_${field.toUpperCase()}`,
549
+ env[`${prefix}_MODELS_DEFAULT_${field.toUpperCase()}`]?.trim() || void 0
550
+ ],
551
+ ...configured.map(([from, model]) => [
552
+ `${from}: models.default.${field}`,
553
+ model.default?.[field]
554
+ ])
555
+ ]
556
+ ];
557
+ const selected = candidates.find(([, value]) => value !== void 0);
558
+ if (selected)
559
+ resolved[field] = selected[1];
560
+ sources[`models.${purpose}.${field}`] = selected?.[0] ?? "default";
561
+ }
562
+ if (Object.keys(resolved).length)
563
+ models[purpose] = resolved;
564
+ }
565
+ const checked = safeParse(modelSettingsShape, models);
566
+ if (!checked.success)
567
+ throw new CliError("configuration_error", `models.${getDotPath(checked.issues[0]) ?? "settings"} is invalid`);
568
+ return { models: checked.output, sources };
569
+ }, "resolveModelSettings");
570
+ var modelTarget = /* @__PURE__ */ __name((settings, purpose) => {
571
+ const configured = { ...settings.models?.default, ...settings.models?.[purpose] };
572
+ if (configured.provider === void 0 || configured.provider === "off")
573
+ return void 0;
574
+ if (!configured.model)
575
+ throw new CliError("configuration_error", `set models.${purpose}.model before calling its provider`);
576
+ return {
577
+ provider: configured.provider,
578
+ model: configured.model,
579
+ ...configured.base_url === void 0 ? {} : { baseUrl: configured.base_url }
580
+ };
581
+ }, "modelTarget");
582
+
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
804
584
  var HISTORY_MAX_DAYS = 1095;
805
585
  var DEFAULT_HISTORY_LIMITS = { dialogDays: 1095, groupDays: 365, groupMembersMax: 50 };
806
- var DAY_MS2 = 24 * 60 * 60 * 1e3;
586
+ var DAY_MS = 24 * 60 * 60 * 1e3;
807
587
  var historyWindow = /* @__PURE__ */ __name((shape, limits, now) => {
808
588
  const group = shape !== void 0 && shape.kind !== "dialog" && shape.kind !== "saved";
809
589
  if (group && (shape.participantsCount ?? 0) > limits.groupMembersMax)
810
590
  return { skip: "group_too_large", members: shape.participantsCount ?? 0 };
811
- const days2 = group ? limits.groupDays : limits.dialogDays;
812
- 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 };
813
593
  }, "historyWindow");
814
594
  var limitBatch = /* @__PURE__ */ __name((batch, shapes, included, limits, now = Date.now()) => {
815
595
  const skipped = /* @__PURE__ */ new Map();
@@ -847,7 +627,7 @@ var limitBatch = /* @__PURE__ */ __name((batch, shapes, included, limits, now =
847
627
  return { batch: { ...batch, messages }, skipped };
848
628
  }, "limitBatch");
849
629
 
850
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/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
851
631
  var closeSuggestion = strictObject({
852
632
  as: picklist(["done", "dismissed"]),
853
633
  /** The agent's name. */
@@ -909,7 +689,7 @@ var task = strictObject({
909
689
  updated_at: optional(time)
910
690
  });
911
691
 
912
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/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
913
693
  var agendaChat = strictObject({
914
694
  chat: reference,
915
695
  title: nullable(text),
@@ -979,7 +759,7 @@ var agenda = strictObject({
979
759
  unlisted_categories: array(strictObject({ name: text, open_tasks: number() }))
980
760
  });
981
761
 
982
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/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
983
763
  var attachment = strictObject({
984
764
  /** The message it came with, as a locator; absent inside that message. */
985
765
  message: optional(reference),
@@ -1017,7 +797,7 @@ var attachment = strictObject({
1017
797
  });
1018
798
  var hitFile = strictObject({ position: count, kind: text, name: optional(text), size: optional(count) });
1019
799
 
1020
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/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
1021
801
  var conversation = strictObject({
1022
802
  id,
1023
803
  chat: reference,
@@ -1032,7 +812,7 @@ var conversation = strictObject({
1032
812
  rules_version: count
1033
813
  });
1034
814
 
1035
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/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
1036
816
  var tagging = strictObject({
1037
817
  tag: text,
1038
818
  type: picklist(TAG_TYPES),
@@ -1045,7 +825,7 @@ var tagging = strictObject({
1045
825
  created_at: time
1046
826
  });
1047
827
 
1048
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/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
1049
829
  import { join as join2 } from "node:path";
1050
830
  var clip = /* @__PURE__ */ __name((name) => `https://huggingface.co/Xenova/clip-vit-base-patch32/resolve/d15189d7028b43f1d3e65039190477f6af591c2a/${name}`, "clip");
1051
831
  var IMAGE_MODELS = [
@@ -1099,7 +879,7 @@ var imageModelsDirectory = /* @__PURE__ */ __name((env = process.env) => sharedM
1099
879
  var placedImage = /* @__PURE__ */ __name((model, directory) => model.files.map((file) => [file, join2(directory, model.id, file.name)]), "placedImage");
1100
880
  var isImageModelInstalled = /* @__PURE__ */ __name((model, directory) => filesPresent(placedImage(model, directory)), "isImageModelInstalled");
1101
881
 
1102
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/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
1103
883
  var WEIGHTS = {
1104
884
  bot: 3,
1105
885
  scam: 3,
@@ -1124,43 +904,68 @@ var LINK = /https?:\/\/|t\.me\/|www\./i;
1124
904
  var DIGITS = /\d{5,}/;
1125
905
  var oddName = /* @__PURE__ */ __name((name) => !name?.trim() || DIGITS.test(name) || LINK.test(name), "oddName");
1126
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
+
1127
947
  export {
1128
- logAttributes,
1129
- fromLogAttributes,
1130
- snakeLogger,
1131
- LOG_ATTRIBUTES,
1132
- KEEP_RUNS_FOR_DAYS,
1133
- KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
1134
- RUNS_SIZE_LIMIT_MB,
1135
- runsDirFor,
1136
- startRun,
1137
- runtime,
1138
- newRunId,
1139
- listRuns,
1140
- findRun,
1141
- readEvents,
1142
- pruneRuns,
1143
- currentRun,
1144
- inRun,
1145
- runEvent,
1146
- typedCommand,
1147
- useAsProcessRun,
1148
- processRun,
1149
- enclosingTraceId,
1150
- traceOf,
1151
- childTrace,
1152
- withAttempt,
1153
- currentAttempt,
948
+ runBudget,
1154
949
  sentIds,
1155
950
  withWriteScope,
1156
951
  stopWrites,
1157
952
  currentOperation,
1158
953
  guardedWrite,
1159
954
  codeOf,
955
+ endpoint,
956
+ modelSettingsShape,
957
+ resolveModelSettings,
958
+ modelTarget,
1160
959
  parseDuration,
1161
- TEXT_MODELS,
1162
960
  DEFAULT_TEXT_MODEL,
961
+ PREVIOUS_DEFAULT_TEXT_MODEL,
962
+ CustomTextModelShape,
963
+ textModelsFile,
964
+ readTextModelsSection,
965
+ writeTextModelsSection,
966
+ textModels,
1163
967
  textModel,
968
+ chosenTextModel,
1164
969
  RERANK_MODELS,
1165
970
  DEFAULT_RERANK_MODEL,
1166
971
  rerankModel,
@@ -1179,6 +984,10 @@ export {
1179
984
  LINK,
1180
985
  oddName,
1181
986
  conversation,
987
+ checkpointPath,
988
+ readCheckpoint,
989
+ saveCheckpoint,
990
+ progressOf,
1182
991
  tagging,
1183
992
  IMAGE_MODELS,
1184
993
  DEFAULT_IMAGE_MODEL,