@wirecat/zoom-cli 0.68.0 → 0.70.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 (156) 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/bin/zm.js +2 -2
  7. package/dist/bundle/{all-profiles-R66UM3HM.js → all-profiles-GE2TFJJP.js} +9 -9
  8. package/dist/bundle/answer-policy-GOXSDYDD.js +104 -0
  9. package/dist/bundle/{anthropic-4ZI2BPLG.js → anthropic-FA6NHENI.js} +9 -7
  10. package/dist/bundle/{app-server-64O5IQI5.js → app-server-IRADMSNX.js} +50 -50
  11. package/dist/bundle/{bun-HUHQD76Z.js → bun-ZYZGGCX5.js} +2 -2
  12. package/dist/bundle/{bun-sqlite-VOVHPTIF.js → bun-sqlite-Y24TUIGS.js} +4 -4
  13. package/dist/bundle/{chunk-W42BJ65M.js → chunk-2JEM2YNV.js} +1 -1
  14. package/dist/bundle/{chunk-3BRV2YU2.js → chunk-2QFPVUM3.js} +2 -2
  15. package/dist/bundle/{chunk-KAPJQGHE.js → chunk-2U6SER67.js} +1 -1
  16. package/dist/bundle/{chunk-77I67HWF.js → chunk-3KC7C465.js} +7 -7
  17. package/dist/bundle/{chunk-YQRNFG2E.js → chunk-4DSIWYGO.js} +7661 -13544
  18. package/dist/bundle/{chunk-7DUYFITC.js → chunk-56OV5ASY.js} +11 -11
  19. package/dist/bundle/{chunk-AVEIQMHZ.js → chunk-5XWCBLUR.js} +1 -1
  20. package/dist/bundle/{chunk-HXOAPH47.js → chunk-6HJFIMT7.js} +1 -1
  21. package/dist/bundle/{chunk-SSPSNSC5.js → chunk-6IF5ZHDS.js} +1 -1
  22. package/dist/bundle/{chunk-BOAMDYLY.js → chunk-7QC4M4HS.js} +2 -2
  23. package/dist/bundle/{chunk-6T3P226D.js → chunk-AISJCF7A.js} +4 -4
  24. package/dist/bundle/chunk-AT2XKNFN.js +342 -0
  25. package/dist/bundle/{chunk-BSM43OMN.js → chunk-AUNW7N4I.js} +1 -1
  26. package/dist/bundle/{chunk-R7LFGEDE.js → chunk-BSS6HX4O.js} +2 -2
  27. package/dist/bundle/{chunk-FMQS7HCC.js → chunk-BVWF4B33.js} +251 -10
  28. package/dist/bundle/{chunk-DGNPJGD3.js → chunk-CEJJBZAE.js} +9 -15
  29. package/dist/bundle/{chunk-L4WVLRXM.js → chunk-CHGUNZ3L.js} +3 -3
  30. package/dist/bundle/{chunk-LBOSTBAY.js → chunk-CIZ25UPK.js} +3841 -2497
  31. package/dist/bundle/{chunk-TN3FH2GQ.js → chunk-CSEBB4OP.js} +8 -8
  32. package/dist/bundle/{chunk-JO4YADNV.js → chunk-D3PNCJD5.js} +5 -5
  33. package/dist/bundle/{chunk-US5C3WAY.js → chunk-DCUWJITQ.js} +30 -30
  34. package/dist/bundle/{chunk-QXTREL2M.js → chunk-DNR4B5YV.js} +2 -2
  35. package/dist/bundle/{chunk-PUTGTW6W.js → chunk-DXCTW3MV.js} +1 -1
  36. package/dist/bundle/{chunk-B6JMVB6R.js → chunk-EOSVN2ER.js} +1 -1
  37. package/dist/bundle/{chunk-ZRD3NDOX.js → chunk-GB5X3GBE.js} +23 -1
  38. package/dist/bundle/{chunk-32FPA7P2.js → chunk-GVT5363M.js} +2 -2
  39. package/dist/bundle/{chunk-EWIBLDQQ.js → chunk-IINZIP73.js} +7 -7
  40. package/dist/bundle/{chunk-5JAYUG3X.js → chunk-IS3ZTT2Z.js} +5 -5
  41. package/dist/bundle/{chunk-LYWUG43B.js → chunk-IWPXWGF7.js} +34 -34
  42. package/dist/bundle/{chunk-JRCYFCPL.js → chunk-J3SKXICS.js} +350 -136
  43. package/dist/bundle/{chunk-UDJTRFRV.js → chunk-JRO2FWO2.js} +1 -1
  44. package/dist/bundle/chunk-JULBAECW.js +126 -0
  45. package/dist/bundle/{chunk-FNQASORM.js → chunk-KM736RMJ.js} +1 -1
  46. package/dist/bundle/{chunk-4TLPOY22.js → chunk-KWRCP55G.js} +11 -11
  47. package/dist/bundle/{chunk-SRP6SFFD.js → chunk-L24UOUWG.js} +1 -1
  48. package/dist/bundle/{chunk-AJ7CMUGD.js → chunk-LAG5O2FV.js} +218 -231
  49. package/dist/bundle/{chunk-UU5PLDRA.js → chunk-LXXCLQCW.js} +2 -2
  50. package/dist/bundle/{chunk-65T3PU75.js → chunk-M6JIXMQZ.js} +5 -1
  51. package/dist/bundle/{chunk-LV7QRR5S.js → chunk-M7E44TMT.js} +5 -5
  52. package/dist/bundle/{chunk-6XO7RTJY.js → chunk-M7VUXXGS.js} +110 -8
  53. package/dist/bundle/{chunk-A63ZFOQJ.js → chunk-MVOMLJYQ.js} +3 -3
  54. package/dist/bundle/{chunk-DVA6MQWK.js → chunk-OA37BWE5.js} +1 -1
  55. package/dist/bundle/{chunk-77KFLU5F.js → chunk-OAQLVV6W.js} +2 -2
  56. package/dist/bundle/{chunk-KNE6VFHZ.js → chunk-OORMSM6O.js} +1 -1
  57. package/dist/bundle/{chunk-TZUKDM72.js → chunk-PV6OHXHN.js} +16 -16
  58. package/dist/bundle/{chunk-2OSBCYJT.js → chunk-QL7EMFIC.js} +18 -18
  59. package/dist/bundle/{chunk-4YFJYSSK.js → chunk-QO2KPU26.js} +45 -29
  60. package/dist/bundle/{chunk-GOXDBCDM.js → chunk-RB33VTUW.js} +297 -397
  61. package/dist/bundle/{chunk-TDGZMC6K.js → chunk-RIPAUCKJ.js} +59 -55
  62. package/dist/bundle/{chunk-6CJ7NHIP.js → chunk-RO3ZR4VP.js} +12 -12
  63. package/dist/bundle/{chunk-BL36NSV5.js → chunk-RQG5VOGH.js} +12 -2
  64. package/dist/bundle/{chunk-YTF2WPV4.js → chunk-RRRJCHUC.js} +2162 -1250
  65. package/dist/bundle/chunk-RWIILYKW.js +66 -0
  66. package/dist/bundle/{chunk-YJY3W2ZT.js → chunk-SNIY3JDN.js} +21 -18
  67. package/dist/bundle/{chunk-EH5QGQFR.js → chunk-SVF3NDAO.js} +3 -3
  68. package/dist/bundle/{chunk-VLD7Y4SY.js → chunk-UVPL7YAY.js} +5 -5
  69. package/dist/bundle/{chunk-2T6XHWDX.js → chunk-V2E7QFZ3.js} +1 -1
  70. package/dist/bundle/{chunk-K67V24AT.js → chunk-V5GRSOCZ.js} +4 -4
  71. package/dist/bundle/{chunk-DWSUSWAX.js → chunk-VE2VNECR.js} +131 -12
  72. package/dist/bundle/{chunk-RRYUD2EF.js → chunk-VJ5ZU4UF.js} +22 -4
  73. package/dist/bundle/{chunk-7QNJICKZ.js → chunk-VNU5L37V.js} +26 -26
  74. package/dist/bundle/{chunk-6TJ62LZQ.js → chunk-VSLDWT4E.js} +3 -3
  75. package/dist/bundle/{chunk-P2TISY3R.js → chunk-W7ZEEC4K.js} +1 -1
  76. package/dist/bundle/{chunk-NRRI37NJ.js → chunk-WOIHSQAL.js} +44 -0
  77. package/dist/bundle/{chunk-EJDV5IIF.js → chunk-X4ZF4XXI.js} +1 -1
  78. package/dist/bundle/{chunk-FBLUKCIR.js → chunk-XRFHQGOD.js} +1 -1
  79. package/dist/bundle/{chunk-KUB2U5NT.js → chunk-XWQNJKTP.js} +5 -5
  80. package/dist/bundle/chunk-Y6C3N7YG.js +12434 -0
  81. package/dist/bundle/{chunk-474WF55M.js → chunk-YJSPBUGB.js} +63 -32
  82. package/dist/bundle/{chunk-RP3U3J53.js → chunk-YTN2JN6N.js} +7 -7
  83. package/dist/bundle/{chunk-Y5LP5SHV.js → chunk-YUHM2OJM.js} +10 -10
  84. package/dist/bundle/{chunk-7AUP2WT3.js → chunk-ZBKWRYRS.js} +2 -2
  85. package/dist/bundle/{chunk-355PHJYX.js → chunk-ZS55EERO.js} +1 -1
  86. package/dist/bundle/{chunk-TUNQ6NE2.js → chunk-ZSKE7N2U.js} +3 -3
  87. package/dist/bundle/{chunk-PIHBD3YS.js → chunk-ZV3INEKM.js} +4 -4
  88. package/dist/bundle/{cli-VQJ7ZRYR.js → cli-VRSQ7HAE.js} +76 -60
  89. package/dist/bundle/command-contract-RPRKHVU6.js +41 -0
  90. package/dist/bundle/config-QU6A6VIO.js +90 -0
  91. package/dist/bundle/{decode-L3ENO2XH.js → decode-523PUQMR.js} +4 -4
  92. package/dist/bundle/{dispatch-5MGDLOK4.js → dispatch-IZCAK47P.js} +1 -1
  93. package/dist/bundle/{dist-WQLS7U23.js → dist-6WWKPEVW.js} +98 -22
  94. package/dist/bundle/{echarts-5LLJ6JXC.js → echarts-S5UMX2D3.js} +2 -2
  95. package/dist/bundle/{embed-37MYTCU7.js → embed-ODPDVHUK.js} +5 -5
  96. package/dist/bundle/{embedder-GNGHVJAO.js → embedder-PAXRBSZE.js} +8 -8
  97. package/dist/bundle/{failure-CR64C4XA.js → failure-R2OIHCE5.js} +1 -1
  98. package/dist/bundle/{first-run-NR5JKYP3.js → first-run-NVTDR5VO.js} +8 -8
  99. package/dist/bundle/first-screen-5RWZDWLK.js +39 -0
  100. package/dist/bundle/{folders-VU4IN35Y.js → folders-ZXTOFY4T.js} +3 -3
  101. package/dist/bundle/{instructions-P72XX4AK.js → instructions-DUB7E6C5.js} +1 -1
  102. package/dist/bundle/{main-QYFCYSTW.js → main-A7JSYQI6.js} +18 -18
  103. package/dist/bundle/{meetings-66UQINKI.js → meetings-BDZQV3HR.js} +4 -4
  104. package/dist/bundle/{node-ZB4RNICS.js → node-E25KP53H.js} +2 -2
  105. package/dist/bundle/{node-sqlite-XPRKBDF3.js → node-sqlite-PHWDFZCP.js} +5 -5
  106. package/dist/bundle/{oauth-WJRDUU5J.js → oauth-G2K46IYP.js} +6 -6
  107. package/dist/bundle/{open-S2YSIEOW.js → open-INWS5HIZ.js} +4 -4
  108. package/dist/bundle/{openai-CRNZFNZD.js → openai-T44ORVGQ.js} +10 -10
  109. package/dist/bundle/{output-file-6COFGPUL.js → output-file-YGQYZCBJ.js} +4 -4
  110. package/dist/bundle/{process-XNN4WG6N.js → process-UJ2JHMJN.js} +1 -1
  111. package/dist/bundle/{program-BRPJKRCX.js → program-LYTGFV6L.js} +115 -72
  112. package/dist/bundle/{prompt-7RQOL25I.js → prompt-VTUCRCE4.js} +6 -4
  113. package/dist/bundle/{recognize-N5WADGQB.js → recognize-3CEPOW2F.js} +3 -3
  114. package/dist/bundle/{remote-WHYV35IF.js → remote-DRQEXEZL.js} +6 -6
  115. package/dist/bundle/{rerank-FBMZVWSH.js → rerank-UL4KNNVN.js} +6 -6
  116. package/dist/bundle/{run-log-TOCHREH2.js → run-log-UZAB5CWF.js} +54 -54
  117. package/dist/bundle/{serve-4BABX4WS.js → serve-P5UWUOWQ.js} +8 -8
  118. package/dist/bundle/server-F3NPVMS2.js +72 -0
  119. package/dist/bundle/{server-CDVI6LOB.js → server-M6XK2Y3X.js} +42 -42
  120. package/dist/bundle/{services-PIY33I7R.js → services-4HRYNY62.js} +66 -30
  121. package/dist/bundle/{speech-LS5Q4FL2.js → speech-BBPBMFAO.js} +12 -12
  122. package/dist/bundle/{state-YUX5R2R7.js → state-GDSUNUSY.js} +5 -5
  123. package/dist/bundle/{store-BD7HAXAA.js → store-LBQ6FZP2.js} +41 -15
  124. package/dist/bundle/{store-ERMGBF2B.js → store-VWLABMLF.js} +57 -17
  125. package/dist/bundle/store-connection-XEBFP56U.js +83 -0
  126. package/dist/bundle/store-maintenance-command-G43JN57J.js +61 -0
  127. package/dist/bundle/{streaming-O53PIORL.js → streaming-EJ3NM2C2.js} +5 -5
  128. package/dist/bundle/{tokens-QKNEP2GJ.js → tokens-BE6CJMR5.js} +5 -5
  129. package/dist/bundle/zm.js +3 -3
  130. package/dist/bundle/{zoom-app-XJXZ4ZBX.js → zoom-app-YIEJLWCW.js} +6 -6
  131. package/dist/first-screen.d.ts.map +1 -1
  132. package/dist/first-screen.js +1 -0
  133. package/dist/first-screen.js.map +1 -1
  134. package/dist/permissions.js +1 -1
  135. package/dist/permissions.js.map +1 -1
  136. package/dist/setup-commands.d.ts.map +1 -1
  137. package/dist/setup-commands.js +11 -0
  138. package/dist/setup-commands.js.map +1 -1
  139. package/dist/tokens.d.ts +2 -0
  140. package/dist/tokens.d.ts.map +1 -1
  141. package/dist/tokens.js +11 -0
  142. package/dist/tokens.js.map +1 -1
  143. package/dist/version.d.ts +1 -1
  144. package/dist/version.js +1 -1
  145. package/package.json +2 -2
  146. package/dist/bundle/answer-policy-UCGUO53A.js +0 -104
  147. package/dist/bundle/chunk-AYEVBAGO.js +0 -178
  148. package/dist/bundle/chunk-EZRPSZJS.js +0 -33
  149. package/dist/bundle/chunk-NUJMJQXV.js +0 -787
  150. package/dist/bundle/chunk-YOAEZSDG.js +0 -22
  151. package/dist/bundle/command-contract-JPUWWYIV.js +0 -41
  152. package/dist/bundle/config-YGLLR77A.js +0 -90
  153. package/dist/bundle/first-screen-RCR7ATO2.js +0 -39
  154. package/dist/bundle/server-XOFQKFVO.js +0 -72
  155. package/dist/bundle/store-connection-JBR6CMTJ.js +0 -83
  156. package/dist/bundle/store-maintenance-command-I5DUSO2C.js +0 -62
@@ -9,30 +9,53 @@ import {
9
9
  id,
10
10
  text,
11
11
  time
12
- } from "./chunk-DWSUSWAX.js";
12
+ } from "./chunk-VE2VNECR.js";
13
+ import {
14
+ readSharedSection,
15
+ sharedConfigPath,
16
+ writeSharedSection
17
+ } from "./chunk-UVPL7YAY.js";
13
18
  import {
14
19
  TAG_TYPES
15
- } from "./chunk-AYEVBAGO.js";
20
+ } from "./chunk-AT2XKNFN.js";
16
21
  import {
17
22
  filesPresent,
18
23
  sharedModelsDirectory
19
- } from "./chunk-6TJ62LZQ.js";
24
+ } from "./chunk-VSLDWT4E.js";
25
+ import {
26
+ storePath
27
+ } from "./chunk-GVT5363M.js";
20
28
  import {
21
29
  createRecordLog,
22
30
  resolvePaths,
23
31
  traceIdOf,
24
32
  writeSecurely
25
- } from "./chunk-KNE6VFHZ.js";
33
+ } from "./chunk-OORMSM6O.js";
26
34
  import {
27
35
  array,
28
36
  boolean,
37
+ check,
38
+ getDotPath,
39
+ integer,
40
+ maxLength,
41
+ maxValue,
42
+ minLength,
43
+ minValue,
29
44
  nullable,
30
45
  number,
31
46
  optional,
32
47
  picklist,
48
+ pipe,
49
+ record,
33
50
  reference,
34
- strictObject
35
- } from "./chunk-NRRI37NJ.js";
51
+ regex,
52
+ safeParse,
53
+ startsWith,
54
+ strictObject,
55
+ string,
56
+ trim,
57
+ url
58
+ } from "./chunk-WOIHSQAL.js";
36
59
  import {
37
60
  CliError,
38
61
  isCliError
@@ -41,16 +64,16 @@ import {
41
64
  __name
42
65
  } from "./chunk-ZVVMGPBJ.js";
43
66
 
44
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_90db47d7f41d7a563eea7bc9cc13c345/node_modules/@wirecat/cli-core/dist/runs/run.js
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
45
68
  import { randomUUID } from "node:crypto";
46
69
  import { appendFileSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
47
70
  import { userInfo } from "node:os";
48
71
  import { join, sep } from "node:path";
49
72
 
50
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_90db47d7f41d7a563eea7bc9cc13c345/node_modules/@wirecat/cli-core/dist/runs/log-keys.js
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
51
74
  var snake = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snake");
52
75
  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");
76
+ var renamed = /* @__PURE__ */ __name((record2, name) => Object.fromEntries(Object.entries(record2).map(([key, value]) => [name(key), value])), "renamed");
54
77
  var logAttributes = /* @__PURE__ */ __name((event) => renamed(event, snake), "logAttributes");
55
78
  var fromLogAttributes = /* @__PURE__ */ __name((attributes) => renamed(attributes, camel), "fromLogAttributes");
56
79
  var snakeLogger = /* @__PURE__ */ __name((logger) => ({
@@ -60,7 +83,7 @@ var snakeLogger = /* @__PURE__ */ __name((logger) => ({
60
83
  error: /* @__PURE__ */ __name((event, message) => logger.error(logAttributes(event), message), "error")
61
84
  }), "snakeLogger");
62
85
 
63
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_90db47d7f41d7a563eea7bc9cc13c345/node_modules/@wirecat/cli-core/dist/runs/log-attributes.js
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
64
87
  var diagnostic = {
65
88
  event: true,
66
89
  operation: true,
@@ -130,7 +153,7 @@ var LOG_ATTRIBUTES = [
130
153
  ...new Set([...Object.keys(diagnostic), ...Object.keys(send), ...background, ...crash, ...dropped].map((key) => Object.keys(logAttributes({ [key]: true }))[0]))
131
154
  ].sort();
132
155
 
133
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_90db47d7f41d7a563eea7bc9cc13c345/node_modules/@wirecat/cli-core/dist/runs/run.js
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
134
157
  var KEEP_RUNS_FOR_DAYS = 30;
135
158
  var KEEP_SUCCESSFUL_RUNS_FOR_DAYS = 7;
136
159
  var RUNS_SIZE_LIMIT_MB = 200;
@@ -246,8 +269,8 @@ var runtime = /* @__PURE__ */ __name(() => {
246
269
  }, "runtime");
247
270
  var newRunId = /* @__PURE__ */ __name((startedAt, command) => {
248
271
  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)}`;
272
+ const slug2 = command.replace(/[^a-z0-9]+/gi, "-").toLowerCase();
273
+ return `${stamp}-${slug2}-${randomUUID().slice(0, 6)}`;
251
274
  }, "newRunId");
252
275
  var INDEX = "index.jsonl";
253
276
  var appendIndex = /* @__PURE__ */ __name((dayDir, written) => {
@@ -483,7 +506,7 @@ var metadataOf = /* @__PURE__ */ __name((parsed) => {
483
506
  };
484
507
  }, "metadataOf");
485
508
 
486
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_90db47d7f41d7a563eea7bc9cc13c345/node_modules/@wirecat/cli-core/dist/runs/scope.js
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
487
510
  import { AsyncLocalStorage } from "node:async_hooks";
488
511
  import { randomBytes } from "node:crypto";
489
512
  var scopes = new AsyncLocalStorage();
@@ -502,7 +525,7 @@ var currentRun = /* @__PURE__ */ __name(() => {
502
525
  }, "currentRun");
503
526
  var inRun = /* @__PURE__ */ __name((scope, body) => scopes.run(scope, body), "inRun");
504
527
  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");
528
+ var typedCommand = /* @__PURE__ */ __name((tool, words2, profile = currentRun().profile) => [tool, profile, words2].filter((part) => part !== void 0 && part !== "").join(" "), "typedCommand");
506
529
  var useAsProcessRun = /* @__PURE__ */ __name((scope) => {
507
530
  processScope = scope;
508
531
  }, "useAsProcessRun");
@@ -521,7 +544,7 @@ var attempts = new AsyncLocalStorage();
521
544
  var withAttempt = /* @__PURE__ */ __name((attempt, work) => attempts.run(attempt, work), "withAttempt");
522
545
  var currentAttempt = /* @__PURE__ */ __name(() => attempts.getStore(), "currentAttempt");
523
546
 
524
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_90db47d7f41d7a563eea7bc9cc13c345/node_modules/@wirecat/cli-core/dist/domain/duration.js
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
525
548
  var DURATION = /^(\d+)(ms|s|m|h|d)$/;
526
549
  var UNIT_MS = { ms: 1, s: 1e3, m: 6e4, h: 36e5, d: 864e5 };
527
550
  var parseDuration = /* @__PURE__ */ __name((value, source) => {
@@ -535,120 +558,16 @@ var parseDuration = /* @__PURE__ */ __name((value, source) => {
535
558
  return ms;
536
559
  }, "parseDuration");
537
560
 
538
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_90db47d7f41d7a563eea7bc9cc13c345/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.604.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_90db47d7f41d7a563eea7bc9cc13c345/node_modules/@wirecat/cli-core/dist/embeddings/models.js
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
645
562
  var huggingFace = /* @__PURE__ */ __name((repository, commit) => (name) => `https://huggingface.co/${repository}/resolve/${commit}/${name}`, "huggingFace");
646
563
  var e5 = huggingFace("Xenova/multilingual-e5-small", "761b726dd34fb83930e26aab4e9ac3899aa1fa78");
564
+ var e5Large = huggingFace("Xenova/multilingual-e5-large", "00fc3aeb3dbb95842de2ac1961d33c6319acf57b");
647
565
  var gemma = huggingFace("onnx-community/embeddinggemma-300m-ONNX", "5090578d9565bb06545b4552f76e6bc2c93e4a66");
648
566
  var TEXT_MODELS = [
649
567
  {
650
568
  id: "e5-small",
651
569
  title: "multilingual-e5-small, 8-bit",
570
+ size: "small",
652
571
  languages: "about 100 languages, Russian and English among them",
653
572
  licence: "MIT",
654
573
  dims: 384,
@@ -682,6 +601,7 @@ var TEXT_MODELS = [
682
601
  {
683
602
  id: "embeddinggemma",
684
603
  title: "EmbeddingGemma 300M, 4-bit",
604
+ size: "medium",
685
605
  languages: "over 100 languages \u2014 the best of the two on chat, about seven times slower",
686
606
  licence: "Gemma Terms of Use",
687
607
  terms: "https://ai.google.dev/gemma/terms",
@@ -718,16 +638,113 @@ var TEXT_MODELS = [
718
638
  bytes: 1156830
719
639
  }
720
640
  ]
641
+ },
642
+ {
643
+ id: "e5-large",
644
+ title: "multilingual-e5-large, 8-bit",
645
+ size: "large",
646
+ languages: "about 100 languages, Russian and English among them \u2014 reads better than e5-small, several times slower",
647
+ licence: "MIT",
648
+ dims: 1024,
649
+ maxTokens: 512,
650
+ // 2026-11-07, one 8-thread session on the Ryzen AI 9 HX 470 while other benchmarks ran: 3.4 chunks/s.
651
+ chunksPerSecond: 4,
652
+ pooling: "mean",
653
+ prefix: { query: "query: ", passage: "passage: " },
654
+ onnx: "onnx/model_quantized.onnx",
655
+ files: [
656
+ {
657
+ name: "onnx/model_quantized.onnx",
658
+ url: e5Large("onnx/model_quantized.onnx"),
659
+ sha256: "0a8d65db9a36f810ba5da15249f13145fcdc7890e6656f1fd38cd8b7c4db1fca",
660
+ bytes: 561768762
661
+ },
662
+ {
663
+ name: "tokenizer.json",
664
+ url: e5Large("tokenizer.json"),
665
+ sha256: "62c24cdc13d4c9952d63718d6c9fa4c287974249e16b7ade6d5a85e7bbb75626",
666
+ bytes: 17082660
667
+ },
668
+ {
669
+ name: "tokenizer_config.json",
670
+ url: e5Large("tokenizer_config.json"),
671
+ sha256: "efb5c0d09722e5fe59a462cd2a9976ee216d55b037597d997cd3fe833216da15",
672
+ bytes: 418
673
+ }
674
+ ]
721
675
  }
722
676
  ];
723
677
  var DEFAULT_TEXT_MODEL = "e5-small";
724
- var textModel = /* @__PURE__ */ __name((id2) => {
725
- const found = TEXT_MODELS.find((model) => model.id === id2);
678
+ var SECTION = "text_models";
679
+ var slug = pipe(string(), regex(/^[a-z0-9][a-z0-9._-]{0,62}$/, "is not a model id: a-z, 0-9, . _ -"));
680
+ var words = pipe(string(), trim(), minLength(1), maxLength(300));
681
+ 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"));
682
+ var modelFile = strictObject({
683
+ name: fileName,
684
+ url: pipe(string(), url(), startsWith("https://", "has to be an https address")),
685
+ sha256: pipe(string(), regex(/^[0-9a-f]{64}$/, "has to be a sha256 in hex")),
686
+ bytes: pipe(number(), integer(), minValue(1))
687
+ });
688
+ var CustomTextModelShape = pipe(strictObject({
689
+ id: slug,
690
+ title: words,
691
+ languages: words,
692
+ licence: words,
693
+ terms: optional(pipe(string(), url())),
694
+ dims: pipe(number(), integer(), minValue(1), maxValue(8192)),
695
+ maxTokens: pipe(number(), integer(), minValue(16), maxValue(32768)),
696
+ chunksPerSecond: optional(pipe(number(), minValue(0.01))),
697
+ pooling: picklist(["mean", "sentence_embedding"]),
698
+ prefix: strictObject({
699
+ query: pipe(string(), maxLength(200)),
700
+ passage: pipe(string(), maxLength(200))
701
+ }),
702
+ onnx: fileName,
703
+ externalData: optional(fileName),
704
+ files: pipe(array(modelFile), minLength(1), maxLength(16))
705
+ }), check((model) => !TEXT_MODELS.some((one) => one.id === model.id), "takes the id of a model this version ships; choose another"), check((model) => {
706
+ const names = model.files.map(({ name }) => name);
707
+ return [model.onnx, model.externalData, "tokenizer.json", "tokenizer_config.json"].every((name) => name === void 0 || names.includes(name));
708
+ }, "has to list its onnx file, its external data and tokenizer.json and tokenizer_config.json among files"));
709
+ var TextModelsSection = strictObject({
710
+ use: optional(slug),
711
+ custom: optional(array(CustomTextModelShape))
712
+ });
713
+ var textModelsFile = /* @__PURE__ */ __name((env = process.env) => sharedConfigPath(storePath(env), env), "textModelsFile");
714
+ var readTextModelsSection = /* @__PURE__ */ __name((env = process.env) => {
715
+ const path = textModelsFile(env);
716
+ const section = readSharedSection(path, SECTION);
717
+ if (section === void 0)
718
+ return {};
719
+ const checked = safeParse(TextModelsSection, section);
720
+ if (!checked.success) {
721
+ const issue = checked.issues[0];
722
+ const at = issue ? getDotPath(issue) : null;
723
+ throw new CliError("configuration_error", `${path}: ${SECTION}${at ? `.${at}` : ""} ${issue?.message ?? "is not valid"}`);
724
+ }
725
+ const ids = checked.output.custom?.map(({ id: id2 }) => id2) ?? [];
726
+ const twice = ids.find((id2, at) => ids.indexOf(id2) !== at);
727
+ if (twice)
728
+ throw new CliError("configuration_error", `${path}: ${SECTION}.custom names ${twice} twice`);
729
+ return checked.output;
730
+ }, "readTextModelsSection");
731
+ var writeTextModelsSection = /* @__PURE__ */ __name((section, env = process.env) => writeSharedSection(textModelsFile(env), SECTION, section.use === void 0 && !section.custom?.length ? void 0 : section), "writeTextModelsSection");
732
+ var textModels = /* @__PURE__ */ __name((env = process.env) => [
733
+ ...TEXT_MODELS,
734
+ ...(readTextModelsSection(env).custom ?? []).map((model) => ({ ...model, custom: true }))
735
+ ], "textModels");
736
+ var textModel = /* @__PURE__ */ __name((id2, env = process.env) => {
737
+ const known = textModels(env);
738
+ const found = known.find((model) => model.id === id2);
726
739
  if (!found) {
727
- throw new CliError("validation_error", `no text model ${id2} \u2014 one of: ${TEXT_MODELS.map((model) => model.id).join(", ")}`);
740
+ throw new CliError("validation_error", `no text model ${id2} \u2014 one of: ${known.map((model) => model.id).join(", ")}`);
728
741
  }
729
742
  return found;
730
743
  }, "textModel");
744
+ var chosenTextModel = /* @__PURE__ */ __name((env = process.env) => {
745
+ const use = readTextModelsSection(env).use;
746
+ return use === void 0 ? { id: DEFAULT_TEXT_MODEL, from: "default" } : { id: use, from: "chosen" };
747
+ }, "chosenTextModel");
731
748
  var mmarco = huggingFace("cross-encoder/mmarco-mMiniLMv2-L12-H384-v1", "1427fd652930e4ba29e8149678df786c240d8825");
732
749
  var bge = huggingFace("onnx-community/bge-reranker-v2-m3-ONNX", "6f5ff65298512715a1e669753bc754d2bc8f367b");
733
750
  var RERANK_MODELS = [
@@ -797,10 +814,198 @@ var rerankModel = /* @__PURE__ */ __name((id2) => {
797
814
  }
798
815
  return found;
799
816
  }, "rerankModel");
800
- var vectorModelKey = /* @__PURE__ */ __name((model) => `local:${model.id}:${model.dims}`, "vectorModelKey");
817
+ var vectorModelKey = /* @__PURE__ */ __name((model) => {
818
+ const weights = model.custom ? model.files.find(({ name }) => name === model.onnx)?.sha256.slice(0, 12) : void 0;
819
+ return `local:${model.id}${weights ? `@${weights}` : ""}:${model.dims}`;
820
+ }, "vectorModelKey");
801
821
  var meaningFloor = /* @__PURE__ */ __name((key) => key === "local:e5-small:384" ? 0.8 : 0, "meaningFloor");
802
822
 
803
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_90db47d7f41d7a563eea7bc9cc13c345/node_modules/@wirecat/cli-core/dist/services/history-limits.js
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";
825
+ var sentIds = /* @__PURE__ */ __name((typed, message) => ({
826
+ messageId: message.id,
827
+ ...message.chatId && message.chatId !== typed ? { resultChatId: message.chatId } : {}
828
+ }), "sentIds");
829
+ var current = new AsyncLocalStorage2();
830
+ var writesInFlight = new AsyncLocalStorage2();
831
+ var parents = /* @__PURE__ */ new WeakMap();
832
+ var stopped = /* @__PURE__ */ new WeakMap();
833
+ var scopesFor = /* @__PURE__ */ __name((scope = writesInFlight.getStore()) => {
834
+ const result = [];
835
+ for (let at = scope; at; at = parents.get(at))
836
+ result.push(at);
837
+ return result;
838
+ }, "scopesFor");
839
+ var withWriteScope = /* @__PURE__ */ __name((scope, body) => {
840
+ const parent = writesInFlight.getStore();
841
+ if (parent && parent !== scope)
842
+ parents.set(scope, parent);
843
+ return writesInFlight.run(scope, body);
844
+ }, "withWriteScope");
845
+ var stopWrites = /* @__PURE__ */ __name((scope, reason) => {
846
+ stopped.set(scope, reason);
847
+ for (const write of scope)
848
+ write.cut();
849
+ }, "stopWrites");
850
+ var refuseStopped = /* @__PURE__ */ __name((scopes2) => {
851
+ for (const scope of scopes2)
852
+ if (stopped.has(scope))
853
+ throw stopped.get(scope);
854
+ }, "refuseStopped");
855
+ var currentOperation = /* @__PURE__ */ __name(() => current.getStore(), "currentOperation");
856
+ var guardedWrite = /* @__PURE__ */ __name(async (guard, attempt, act, settled = () => ({}), prepare) => {
857
+ const scopes2 = scopesFor();
858
+ refuseStopped(scopes2);
859
+ try {
860
+ await guard.ask?.(attempt);
861
+ refuseStopped(scopes2);
862
+ if (guard.reserve) {
863
+ guard.check(attempt, { reserve: false });
864
+ await guard.reserve(attempt);
865
+ } else
866
+ guard.check(attempt);
867
+ } catch (error) {
868
+ guard.record({ ...attempt, outcome: "refused", errorCode: codeOf(error) });
869
+ throw error;
870
+ }
871
+ try {
872
+ refuseStopped(scopes2);
873
+ } catch (error) {
874
+ guard.record({ ...attempt, outcome: "failed", errorCode: codeOf(error) });
875
+ throw error;
876
+ }
877
+ let recorded = false;
878
+ const once = /* @__PURE__ */ __name((entry) => {
879
+ if (recorded)
880
+ return;
881
+ recorded = true;
882
+ guard.record(entry);
883
+ }, "once");
884
+ let cancelled = false;
885
+ const flight = {
886
+ operationId: attempt.operationId,
887
+ preparing: prepare !== void 0,
888
+ cut: /* @__PURE__ */ __name(() => {
889
+ cancelled = true;
890
+ once({
891
+ ...attempt,
892
+ outcome: flight.preparing ? "failed" : "outcome_unknown",
893
+ errorCode: flight.preparing ? "timeout" : "outcome_unknown"
894
+ });
895
+ }, "cut")
896
+ };
897
+ for (const scope of scopes2)
898
+ scope.add(flight);
899
+ try {
900
+ if (prepare !== void 0)
901
+ await prepare();
902
+ if (cancelled)
903
+ throw new CliError("timeout", "the command ended before sending; nothing was sent", { sent: false });
904
+ flight.preparing = false;
905
+ const done = await current.run(attempt.operationId, act);
906
+ if (cancelled)
907
+ throw new CliError("outcome_unknown", "the command ended with a write in flight; check its result before continuing", { operation_id: attempt.operationId });
908
+ once({ ...attempt, ...settled(done), outcome: "sent" });
909
+ return done;
910
+ } catch (error) {
911
+ const code = codeOf(error);
912
+ once({ ...attempt, outcome: code === "outcome_unknown" ? "outcome_unknown" : "failed", errorCode: code });
913
+ if (code === "outcome_unknown" && error instanceof Error)
914
+ throw new CliError("outcome_unknown", error.message, {
915
+ ...error.details,
916
+ operation_id: attempt.operationId,
917
+ retryable: false
918
+ });
919
+ if (flight.preparing && isCliError(error) && error.details.sent === void 0)
920
+ throw new CliError(error.code, error.message, { ...error.details, sent: false });
921
+ throw error;
922
+ } finally {
923
+ for (const scope of scopes2)
924
+ scope.delete(flight);
925
+ }
926
+ }, "guardedWrite");
927
+ var codeOf = /* @__PURE__ */ __name((error) => typeof error?.code === "string" ? error.code : "unknown", "codeOf");
928
+
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
930
+ var endpoint = /* @__PURE__ */ __name((value) => {
931
+ try {
932
+ const url2 = new URL(value);
933
+ return ["https:", "http:"].includes(url2.protocol) && !url2.username && !url2.password && !url2.search && !url2.hash;
934
+ } catch {
935
+ return false;
936
+ }
937
+ }, "endpoint");
938
+
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
940
+ var MODEL_FIELDS = ["provider", "model", "base_url"];
941
+ var modelSettingsShape = record(pipe(string(), regex(/^[a-z][a-z0-9-]*$/)), strictObject({
942
+ provider: optional(picklist(["off", "openai", "anthropic"])),
943
+ model: optional(pipe(string(), trim(), minLength(1), maxLength(200))),
944
+ base_url: optional(pipe(string(), check((value) => endpoint(value), "use an HTTP/S endpoint without credentials, query or fragment")))
945
+ }));
946
+ var resolveModelSettings = /* @__PURE__ */ __name((prefix, layers, env) => {
947
+ const configured = layers.map(([from, scope]) => [from, scope?.models ?? {}]);
948
+ const purposes = /* @__PURE__ */ new Set([
949
+ "default",
950
+ "analysis",
951
+ "replies",
952
+ ...configured.flatMap(([, models2]) => Object.keys(models2))
953
+ ]);
954
+ for (const name of Object.keys(env)) {
955
+ const match = new RegExp(`^${prefix}_MODELS_([A-Z][A-Z0-9_]*)_(PROVIDER|MODEL|BASE_URL)$`).exec(name);
956
+ if (match?.[1])
957
+ purposes.add(match[1].toLowerCase().replaceAll("_", "-"));
958
+ }
959
+ const models = {};
960
+ const sources = {};
961
+ for (const purpose of purposes) {
962
+ const resolved = {};
963
+ for (const field of MODEL_FIELDS) {
964
+ const variable = `${prefix}_MODELS_${purpose.replaceAll("-", "_").toUpperCase()}_${field.toUpperCase()}`;
965
+ const candidates = [
966
+ [variable, env[variable]?.trim() || void 0],
967
+ ...configured.map(([from, model]) => [
968
+ `${from}: models.${purpose}.${field}`,
969
+ model[purpose]?.[field]
970
+ ]),
971
+ ...purpose === "default" ? [] : [
972
+ [
973
+ `${prefix}_MODELS_DEFAULT_${field.toUpperCase()}`,
974
+ env[`${prefix}_MODELS_DEFAULT_${field.toUpperCase()}`]?.trim() || void 0
975
+ ],
976
+ ...configured.map(([from, model]) => [
977
+ `${from}: models.default.${field}`,
978
+ model.default?.[field]
979
+ ])
980
+ ]
981
+ ];
982
+ const selected = candidates.find(([, value]) => value !== void 0);
983
+ if (selected)
984
+ resolved[field] = selected[1];
985
+ sources[`models.${purpose}.${field}`] = selected?.[0] ?? "default";
986
+ }
987
+ if (Object.keys(resolved).length)
988
+ models[purpose] = resolved;
989
+ }
990
+ const checked = safeParse(modelSettingsShape, models);
991
+ if (!checked.success)
992
+ throw new CliError("configuration_error", `models.${getDotPath(checked.issues[0]) ?? "settings"} is invalid`);
993
+ return { models: checked.output, sources };
994
+ }, "resolveModelSettings");
995
+ var modelTarget = /* @__PURE__ */ __name((settings, purpose) => {
996
+ const configured = { ...settings.models?.default, ...settings.models?.[purpose] };
997
+ if (configured.provider === void 0 || configured.provider === "off")
998
+ return void 0;
999
+ if (!configured.model)
1000
+ throw new CliError("configuration_error", `set models.${purpose}.model before calling its provider`);
1001
+ return {
1002
+ provider: configured.provider,
1003
+ model: configured.model,
1004
+ ...configured.base_url === void 0 ? {} : { baseUrl: configured.base_url }
1005
+ };
1006
+ }, "modelTarget");
1007
+
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
804
1009
  var HISTORY_MAX_DAYS = 1095;
805
1010
  var DEFAULT_HISTORY_LIMITS = { dialogDays: 1095, groupDays: 365, groupMembersMax: 50 };
806
1011
  var DAY_MS2 = 24 * 60 * 60 * 1e3;
@@ -847,7 +1052,7 @@ var limitBatch = /* @__PURE__ */ __name((batch, shapes, included, limits, now =
847
1052
  return { batch: { ...batch, messages }, skipped };
848
1053
  }, "limitBatch");
849
1054
 
850
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_90db47d7f41d7a563eea7bc9cc13c345/node_modules/@wirecat/cli-core/dist/entities/task.js
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
851
1056
  var closeSuggestion = strictObject({
852
1057
  as: picklist(["done", "dismissed"]),
853
1058
  /** The agent's name. */
@@ -909,7 +1114,7 @@ var task = strictObject({
909
1114
  updated_at: optional(time)
910
1115
  });
911
1116
 
912
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_90db47d7f41d7a563eea7bc9cc13c345/node_modules/@wirecat/cli-core/dist/entities/agenda.js
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
913
1118
  var agendaChat = strictObject({
914
1119
  chat: reference,
915
1120
  title: nullable(text),
@@ -979,7 +1184,7 @@ var agenda = strictObject({
979
1184
  unlisted_categories: array(strictObject({ name: text, open_tasks: number() }))
980
1185
  });
981
1186
 
982
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_90db47d7f41d7a563eea7bc9cc13c345/node_modules/@wirecat/cli-core/dist/entities/attachment.js
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
983
1188
  var attachment = strictObject({
984
1189
  /** The message it came with, as a locator; absent inside that message. */
985
1190
  message: optional(reference),
@@ -1017,7 +1222,7 @@ var attachment = strictObject({
1017
1222
  });
1018
1223
  var hitFile = strictObject({ position: count, kind: text, name: optional(text), size: optional(count) });
1019
1224
 
1020
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_90db47d7f41d7a563eea7bc9cc13c345/node_modules/@wirecat/cli-core/dist/entities/conversation.js
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
1021
1226
  var conversation = strictObject({
1022
1227
  id,
1023
1228
  chat: reference,
@@ -1032,7 +1237,7 @@ var conversation = strictObject({
1032
1237
  rules_version: count
1033
1238
  });
1034
1239
 
1035
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_90db47d7f41d7a563eea7bc9cc13c345/node_modules/@wirecat/cli-core/dist/entities/tagging.js
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
1036
1241
  var tagging = strictObject({
1037
1242
  tag: text,
1038
1243
  type: picklist(TAG_TYPES),
@@ -1045,7 +1250,7 @@ var tagging = strictObject({
1045
1250
  created_at: time
1046
1251
  });
1047
1252
 
1048
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_90db47d7f41d7a563eea7bc9cc13c345/node_modules/@wirecat/cli-core/dist/images/picture/models.js
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
1049
1254
  import { join as join2 } from "node:path";
1050
1255
  var clip = /* @__PURE__ */ __name((name) => `https://huggingface.co/Xenova/clip-vit-base-patch32/resolve/d15189d7028b43f1d3e65039190477f6af591c2a/${name}`, "clip");
1051
1256
  var IMAGE_MODELS = [
@@ -1099,7 +1304,7 @@ var imageModelsDirectory = /* @__PURE__ */ __name((env = process.env) => sharedM
1099
1304
  var placedImage = /* @__PURE__ */ __name((model, directory) => model.files.map((file) => [file, join2(directory, model.id, file.name)]), "placedImage");
1100
1305
  var isImageModelInstalled = /* @__PURE__ */ __name((model, directory) => filesPresent(placedImage(model, directory)), "isImageModelInstalled");
1101
1306
 
1102
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_90db47d7f41d7a563eea7bc9cc13c345/node_modules/@wirecat/cli-core/dist/botcheck/reasons.js
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
1103
1308
  var WEIGHTS = {
1104
1309
  bot: 3,
1105
1310
  scam: 3,
@@ -1157,10 +1362,19 @@ export {
1157
1362
  currentOperation,
1158
1363
  guardedWrite,
1159
1364
  codeOf,
1365
+ endpoint,
1366
+ modelSettingsShape,
1367
+ resolveModelSettings,
1368
+ modelTarget,
1160
1369
  parseDuration,
1161
- TEXT_MODELS,
1162
1370
  DEFAULT_TEXT_MODEL,
1371
+ CustomTextModelShape,
1372
+ textModelsFile,
1373
+ readTextModelsSection,
1374
+ writeTextModelsSection,
1375
+ textModels,
1163
1376
  textModel,
1377
+ chosenTextModel,
1164
1378
  RERANK_MODELS,
1165
1379
  DEFAULT_RERANK_MODEL,
1166
1380
  rerankModel,