@wirecat/zoom-cli 0.69.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.
- package/README.md +1 -1
- package/dist/account-removal.d.ts +6 -0
- package/dist/account-removal.d.ts.map +1 -0
- package/dist/account-removal.js +43 -0
- package/dist/account-removal.js.map +1 -0
- package/dist/bin/zm.js +2 -2
- package/dist/bundle/{all-profiles-ZQWPCJEK.js → all-profiles-GE2TFJJP.js} +9 -9
- package/dist/bundle/answer-policy-GOXSDYDD.js +104 -0
- package/dist/bundle/{anthropic-7FUQ2HYJ.js → anthropic-FA6NHENI.js} +9 -7
- package/dist/bundle/{app-server-DNPE2EQB.js → app-server-IRADMSNX.js} +50 -50
- package/dist/bundle/{bun-ZVQFCFCC.js → bun-ZYZGGCX5.js} +2 -2
- package/dist/bundle/{bun-sqlite-EB2UMUPJ.js → bun-sqlite-Y24TUIGS.js} +4 -4
- package/dist/bundle/{chunk-B5D7NZI7.js → chunk-2JEM2YNV.js} +1 -1
- package/dist/bundle/{chunk-JX5JJZC3.js → chunk-2QFPVUM3.js} +2 -2
- package/dist/bundle/{chunk-KAPJQGHE.js → chunk-2U6SER67.js} +1 -1
- package/dist/bundle/{chunk-TWIC6JJG.js → chunk-3KC7C465.js} +7 -7
- package/dist/bundle/{chunk-MOTKS7XG.js → chunk-4DSIWYGO.js} +863 -423
- package/dist/bundle/{chunk-LEA4BGK7.js → chunk-56OV5ASY.js} +11 -11
- package/dist/bundle/{chunk-TN77LX6W.js → chunk-5XWCBLUR.js} +1 -1
- package/dist/bundle/{chunk-SZ3Z4ZNO.js → chunk-6HJFIMT7.js} +1 -1
- package/dist/bundle/{chunk-SQT47CFW.js → chunk-6IF5ZHDS.js} +1 -1
- package/dist/bundle/{chunk-BOAMDYLY.js → chunk-7QC4M4HS.js} +2 -2
- package/dist/bundle/{chunk-MSDCZ6GT.js → chunk-AISJCF7A.js} +4 -4
- package/dist/bundle/{chunk-F5DYBWH7.js → chunk-AT2XKNFN.js} +51 -8
- package/dist/bundle/{chunk-V74QFMSL.js → chunk-AUNW7N4I.js} +1 -1
- package/dist/bundle/{chunk-6TICX3MN.js → chunk-BSS6HX4O.js} +2 -2
- package/dist/bundle/{chunk-5ZJXKASF.js → chunk-BVWF4B33.js} +10 -10
- package/dist/bundle/{chunk-GXDOTUUO.js → chunk-CEJJBZAE.js} +9 -9
- package/dist/bundle/{chunk-IPBZKUC3.js → chunk-CHGUNZ3L.js} +3 -3
- package/dist/bundle/{chunk-O7L44JK2.js → chunk-CIZ25UPK.js} +2259 -1046
- package/dist/bundle/{chunk-JHFP3Z5S.js → chunk-CSEBB4OP.js} +8 -8
- package/dist/bundle/{chunk-RPQ3JOD3.js → chunk-D3PNCJD5.js} +5 -5
- package/dist/bundle/{chunk-R2ULMWB4.js → chunk-DCUWJITQ.js} +29 -29
- package/dist/bundle/{chunk-R3JYPY3J.js → chunk-DNR4B5YV.js} +2 -2
- package/dist/bundle/{chunk-EPPSMCEV.js → chunk-DXCTW3MV.js} +1 -1
- package/dist/bundle/{chunk-B6JMVB6R.js → chunk-EOSVN2ER.js} +1 -1
- package/dist/bundle/{chunk-QW5VPZEH.js → chunk-GB5X3GBE.js} +23 -1
- package/dist/bundle/{chunk-CKK6JOC4.js → chunk-GVT5363M.js} +2 -2
- package/dist/bundle/{chunk-C6TEYKXV.js → chunk-IINZIP73.js} +7 -7
- package/dist/bundle/{chunk-H3MFBYTQ.js → chunk-IS3ZTT2Z.js} +5 -5
- package/dist/bundle/{chunk-HW5QTRFF.js → chunk-IWPXWGF7.js} +33 -33
- package/dist/bundle/{chunk-CUZHKYC2.js → chunk-J3SKXICS.js} +350 -136
- package/dist/bundle/{chunk-ZRHMB3LQ.js → chunk-JRO2FWO2.js} +1 -1
- package/dist/bundle/chunk-JULBAECW.js +126 -0
- package/dist/bundle/{chunk-XITUFTON.js → chunk-KM736RMJ.js} +1 -1
- package/dist/bundle/{chunk-S2EAGDS7.js → chunk-KWRCP55G.js} +11 -11
- package/dist/bundle/{chunk-6KMTQX3D.js → chunk-L24UOUWG.js} +1 -1
- package/dist/bundle/{chunk-G6IX2MD2.js → chunk-LAG5O2FV.js} +180 -222
- package/dist/bundle/{chunk-XRZDYWF6.js → chunk-LXXCLQCW.js} +2 -2
- package/dist/bundle/{chunk-IEC4E65G.js → chunk-M6JIXMQZ.js} +5 -1
- package/dist/bundle/{chunk-QXM7S3Y3.js → chunk-M7E44TMT.js} +5 -5
- package/dist/bundle/{chunk-Z6TTGTMU.js → chunk-M7VUXXGS.js} +19 -4
- package/dist/bundle/{chunk-MNOVYS43.js → chunk-MVOMLJYQ.js} +3 -3
- package/dist/bundle/{chunk-MVDPZRFE.js → chunk-OA37BWE5.js} +1 -1
- package/dist/bundle/{chunk-5H6VTEEC.js → chunk-OAQLVV6W.js} +2 -2
- package/dist/bundle/{chunk-KNE6VFHZ.js → chunk-OORMSM6O.js} +1 -1
- package/dist/bundle/{chunk-UEZ6URJR.js → chunk-PV6OHXHN.js} +16 -16
- package/dist/bundle/{chunk-TFFEFEG2.js → chunk-QL7EMFIC.js} +18 -18
- package/dist/bundle/{chunk-HSI7YOYK.js → chunk-QO2KPU26.js} +16 -16
- package/dist/bundle/{chunk-XJBYGMZ4.js → chunk-RB33VTUW.js} +243 -387
- package/dist/bundle/{chunk-HC56J5LB.js → chunk-RIPAUCKJ.js} +54 -54
- package/dist/bundle/{chunk-WY4NYPPS.js → chunk-RO3ZR4VP.js} +12 -12
- package/dist/bundle/{chunk-BL36NSV5.js → chunk-RQG5VOGH.js} +12 -2
- package/dist/bundle/{chunk-JZ4YOAHA.js → chunk-RRRJCHUC.js} +1767 -1038
- package/dist/bundle/{chunk-37B7A4RP.js → chunk-RWIILYKW.js} +1 -1
- package/dist/bundle/{chunk-3TPRYZUW.js → chunk-SNIY3JDN.js} +18 -18
- package/dist/bundle/{chunk-TKXLWFM2.js → chunk-SVF3NDAO.js} +3 -3
- package/dist/bundle/{chunk-GR3QDHBU.js → chunk-UVPL7YAY.js} +5 -5
- package/dist/bundle/{chunk-6N2D6JGX.js → chunk-V2E7QFZ3.js} +1 -1
- package/dist/bundle/{chunk-4APZQYCH.js → chunk-V5GRSOCZ.js} +4 -4
- package/dist/bundle/{chunk-T5X4LGXE.js → chunk-VE2VNECR.js} +12 -12
- package/dist/bundle/{chunk-QLGG7S6F.js → chunk-VJ5ZU4UF.js} +22 -4
- package/dist/bundle/{chunk-52DCABMU.js → chunk-VNU5L37V.js} +26 -26
- package/dist/bundle/{chunk-LDRQ5NAP.js → chunk-VSLDWT4E.js} +3 -3
- package/dist/bundle/{chunk-LQX74VKG.js → chunk-W7ZEEC4K.js} +1 -1
- package/dist/bundle/{chunk-NRRI37NJ.js → chunk-WOIHSQAL.js} +44 -0
- package/dist/bundle/{chunk-V4MM6GST.js → chunk-X4ZF4XXI.js} +1 -1
- package/dist/bundle/{chunk-FBLUKCIR.js → chunk-XRFHQGOD.js} +1 -1
- package/dist/bundle/{chunk-5GOE6PQK.js → chunk-XWQNJKTP.js} +5 -5
- package/dist/bundle/{chunk-6AMMTXEA.js → chunk-Y6C3N7YG.js} +26 -65
- package/dist/bundle/{chunk-KX5MZVPX.js → chunk-YJSPBUGB.js} +50 -32
- package/dist/bundle/{chunk-MJMVIFSC.js → chunk-YTN2JN6N.js} +7 -7
- package/dist/bundle/{chunk-OSBHEM2A.js → chunk-YUHM2OJM.js} +10 -10
- package/dist/bundle/{chunk-7AUP2WT3.js → chunk-ZBKWRYRS.js} +2 -2
- package/dist/bundle/{chunk-DHD25JII.js → chunk-ZS55EERO.js} +1 -1
- package/dist/bundle/{chunk-L62EJDNZ.js → chunk-ZSKE7N2U.js} +3 -3
- package/dist/bundle/{chunk-5ZF6QVMC.js → chunk-ZV3INEKM.js} +4 -4
- package/dist/bundle/{cli-P3BZUE6S.js → cli-VRSQ7HAE.js} +60 -58
- package/dist/bundle/command-contract-RPRKHVU6.js +41 -0
- package/dist/bundle/config-QU6A6VIO.js +90 -0
- package/dist/bundle/{decode-QWOQXM7M.js → decode-523PUQMR.js} +4 -4
- package/dist/bundle/{dispatch-5MGDLOK4.js → dispatch-IZCAK47P.js} +1 -1
- package/dist/bundle/{dist-OUE4MF37.js → dist-6WWKPEVW.js} +41 -25
- package/dist/bundle/{echarts-65IMPY43.js → echarts-S5UMX2D3.js} +2 -2
- package/dist/bundle/{embed-4IULBCKL.js → embed-ODPDVHUK.js} +5 -5
- package/dist/bundle/{embedder-JW4W6IZI.js → embedder-PAXRBSZE.js} +8 -8
- package/dist/bundle/{failure-CR64C4XA.js → failure-R2OIHCE5.js} +1 -1
- package/dist/bundle/{first-run-CH6C674R.js → first-run-NVTDR5VO.js} +8 -8
- package/dist/bundle/first-screen-5RWZDWLK.js +39 -0
- package/dist/bundle/{folders-VU4IN35Y.js → folders-ZXTOFY4T.js} +3 -3
- package/dist/bundle/{instructions-G5QIH2TM.js → instructions-DUB7E6C5.js} +1 -1
- package/dist/bundle/{main-O4ZJIEWP.js → main-A7JSYQI6.js} +18 -18
- package/dist/bundle/{meetings-77CCAVYD.js → meetings-BDZQV3HR.js} +4 -4
- package/dist/bundle/{node-E6VQHU4Y.js → node-E25KP53H.js} +2 -2
- package/dist/bundle/{node-sqlite-RJZ4PGLD.js → node-sqlite-PHWDFZCP.js} +5 -5
- package/dist/bundle/{oauth-F4JKNRW4.js → oauth-G2K46IYP.js} +6 -6
- package/dist/bundle/{open-NYOGMIAA.js → open-INWS5HIZ.js} +4 -4
- package/dist/bundle/{openai-5U6EQTFQ.js → openai-T44ORVGQ.js} +10 -10
- package/dist/bundle/{output-file-6COFGPUL.js → output-file-YGQYZCBJ.js} +4 -4
- package/dist/bundle/{process-OBWUKBMX.js → process-UJ2JHMJN.js} +1 -1
- package/dist/bundle/{program-MU7DEJTO.js → program-LYTGFV6L.js} +115 -72
- package/dist/bundle/{prompt-2QWQTHWT.js → prompt-VTUCRCE4.js} +6 -4
- package/dist/bundle/{recognize-SNUNTUC3.js → recognize-3CEPOW2F.js} +3 -3
- package/dist/bundle/{remote-2CTCIQGF.js → remote-DRQEXEZL.js} +6 -6
- package/dist/bundle/{rerank-XDA7NJNH.js → rerank-UL4KNNVN.js} +6 -6
- package/dist/bundle/{run-log-NSG3DJVX.js → run-log-UZAB5CWF.js} +54 -54
- package/dist/bundle/{serve-TWQFHOV2.js → serve-P5UWUOWQ.js} +8 -8
- package/dist/bundle/server-F3NPVMS2.js +72 -0
- package/dist/bundle/{server-RIQ6HMH2.js → server-M6XK2Y3X.js} +42 -42
- package/dist/bundle/{services-NKZQJQIV.js → services-4HRYNY62.js} +60 -30
- package/dist/bundle/{speech-ZOB76SXA.js → speech-BBPBMFAO.js} +12 -12
- package/dist/bundle/{state-7YYEIXQ5.js → state-GDSUNUSY.js} +5 -5
- package/dist/bundle/{store-E6RTSSNR.js → store-LBQ6FZP2.js} +33 -16
- package/dist/bundle/{store-OX4HRBLO.js → store-VWLABMLF.js} +27 -18
- package/dist/bundle/store-connection-XEBFP56U.js +83 -0
- package/dist/bundle/store-maintenance-command-G43JN57J.js +61 -0
- package/dist/bundle/{streaming-O53PIORL.js → streaming-EJ3NM2C2.js} +5 -5
- package/dist/bundle/{tokens-QKNEP2GJ.js → tokens-BE6CJMR5.js} +5 -5
- package/dist/bundle/zm.js +3 -3
- package/dist/bundle/{zoom-app-TSI2MGVK.js → zoom-app-YIEJLWCW.js} +6 -6
- package/dist/first-screen.d.ts.map +1 -1
- package/dist/first-screen.js +1 -0
- package/dist/first-screen.js.map +1 -1
- package/dist/permissions.js +1 -1
- package/dist/permissions.js.map +1 -1
- package/dist/setup-commands.d.ts.map +1 -1
- package/dist/setup-commands.js +11 -0
- package/dist/setup-commands.js.map +1 -1
- package/dist/tokens.d.ts +2 -0
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +11 -0
- package/dist/tokens.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/bundle/answer-policy-VBDYLUXI.js +0 -104
- package/dist/bundle/chunk-2SYWVIQJ.js +0 -33
- package/dist/bundle/command-contract-TOLB32NJ.js +0 -41
- package/dist/bundle/config-4KLLIADY.js +0 -90
- package/dist/bundle/first-screen-OCAW5ZN6.js +0 -39
- package/dist/bundle/server-XO6XQQTJ.js +0 -72
- package/dist/bundle/store-connection-55QPNUDS.js +0 -83
- package/dist/bundle/store-maintenance-command-Q5MSU6OK.js +0 -62
|
@@ -9,30 +9,53 @@ import {
|
|
|
9
9
|
id,
|
|
10
10
|
text,
|
|
11
11
|
time
|
|
12
|
-
} from "./chunk-
|
|
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-
|
|
20
|
+
} from "./chunk-AT2XKNFN.js";
|
|
16
21
|
import {
|
|
17
22
|
filesPresent,
|
|
18
23
|
sharedModelsDirectory
|
|
19
|
-
} from "./chunk-
|
|
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-
|
|
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
|
-
|
|
35
|
-
|
|
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.
|
|
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.
|
|
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((
|
|
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.
|
|
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.
|
|
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
|
|
250
|
-
return `${stamp}-${
|
|
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.
|
|
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,
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
725
|
-
|
|
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: ${
|
|
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) =>
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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,
|