@wirecat/tg-cli 0.102.0 → 0.103.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/dist/bin/tg.js +31 -19
- package/dist/bundle/{adapter-M2HRSFFL.js → adapter-QG3YFFOY.js} +49 -48
- package/dist/bundle/{all-profiles-GOD2QNTK.js → all-profiles-ECXH3TBF.js} +13 -13
- package/dist/bundle/{anthropic-LKU7RWMA.js → anthropic-5MKO3QX7.js} +10 -10
- package/dist/bundle/{bot-api-X3MPFVPL.js → bot-api-4DQPIOMK.js} +50 -49
- package/dist/bundle/{bot-history-OUMVVG22.js → bot-history-UN74XXLU.js} +19 -19
- package/dist/bundle/{bun-LIZ6MKFS.js → bun-PS73VF2C.js} +5 -5
- package/dist/bundle/{bun-sqlite-2IFQYQ44.js → bun-sqlite-RAWGPH23.js} +8 -8
- package/dist/bundle/{chunk-ZZLKX62Z.js → chunk-2ABQZVK4.js} +3 -3
- package/dist/bundle/{chunk-5D6OJREA.js → chunk-3CP7RK5R.js} +4 -4
- package/dist/bundle/{chunk-QL7CQ6VZ.js → chunk-3IXKDIPH.js} +48 -48
- package/dist/bundle/{chunk-F2TG3BA2.js → chunk-3QX6SOEO.js} +9 -9
- package/dist/bundle/{chunk-MGG7JSNO.js → chunk-537O7OVE.js} +6 -6
- package/dist/bundle/{chunk-M5UH5CF3.js → chunk-57XGUIXA.js} +8 -8
- package/dist/bundle/{chunk-WMOEOVWZ.js → chunk-5D4AEUVA.js} +3 -3
- package/dist/bundle/{chunk-ENE5CSVY.js → chunk-5HPAPVCB.js} +276 -260
- package/dist/bundle/{chunk-OEJ5DMCX.js → chunk-67SRVSPU.js} +10 -10
- package/dist/bundle/{chunk-CLWYQNSC.js → chunk-6N25NZOE.js} +9 -9
- package/dist/bundle/{chunk-4QB4WDLT.js → chunk-AAMJZJYC.js} +15 -15
- package/dist/bundle/{chunk-AVWK4NCW.js → chunk-ADLS6FVG.js} +13 -13
- package/dist/bundle/{chunk-2SUTCDGO.js → chunk-AUKAZRF6.js} +5 -5
- package/dist/bundle/{chunk-OHBHHBYL.js → chunk-BV4N333Y.js} +6 -6
- package/dist/bundle/{chunk-UR6ASUSG.js → chunk-BYYSVINK.js} +6 -6
- package/dist/bundle/{chunk-Y4XSWI22.js → chunk-CMQ34EZL.js} +6 -6
- package/dist/bundle/{chunk-ERQDBK5I.js → chunk-COZ74WW4.js} +4 -4
- package/dist/bundle/{chunk-7BFO3DY6.js → chunk-DFDN6AUB.js} +2 -2
- package/dist/bundle/{chunk-264DAFJV.js → chunk-DLF3H6NP.js} +7 -7
- package/dist/bundle/{chunk-BQYTIYGB.js → chunk-DWQ4QT6X.js} +96 -96
- package/dist/bundle/{chunk-DE7LFMY2.js → chunk-EMC57SOZ.js} +11 -11
- package/dist/bundle/{chunk-GSKFAE3I.js → chunk-EQHQ2AX3.js} +148 -55
- package/dist/bundle/{chunk-XXTJUZMB.js → chunk-F27OI4J2.js} +4 -4
- package/dist/bundle/{chunk-2XBSVRT2.js → chunk-FG2QTYEF.js} +4 -4
- package/dist/bundle/{chunk-334UBWOB.js → chunk-FSPDODVT.js} +14 -14
- package/dist/bundle/{chunk-YHB57PFN.js → chunk-G5IMOOPB.js} +4 -4
- package/dist/bundle/{chunk-AUOXTGTU.js → chunk-GO354DJ5.js} +4 -4
- package/dist/bundle/{chunk-FOUE7XLK.js → chunk-H2UTBYFC.js} +4 -4
- package/dist/bundle/{chunk-V52SBQYF.js → chunk-HCDZWFXO.js} +17 -17
- package/dist/bundle/{chunk-5VSR5ENL.js → chunk-KCVDWZWS.js} +11 -11
- package/dist/bundle/{chunk-TV5DGHBT.js → chunk-KQ5BUI5T.js} +248 -248
- package/dist/bundle/{chunk-U4RRZUNP.js → chunk-LAYPLF7G.js} +35 -282
- package/dist/bundle/{chunk-5KU4UQBM.js → chunk-MFS52LTZ.js} +4 -4
- package/dist/bundle/{chunk-FBWOQMPE.js → chunk-MHHDVR4G.js} +227 -283
- package/dist/bundle/{chunk-VUJ34PEQ.js → chunk-NIVZHTN4.js} +15 -15
- package/dist/bundle/{chunk-JFSVXMN6.js → chunk-NKN54EDN.js} +6 -6
- package/dist/bundle/chunk-O5EHUB2V.js +2 -0
- package/dist/bundle/{chunk-PSH7K6TL.js → chunk-OGVBRRWY.js} +25 -25
- package/dist/bundle/{chunk-Q2NYEX4A.js → chunk-Q2LBOPKO.js} +57 -27
- package/dist/bundle/{chunk-UK3GAN7Q.js → chunk-QF7VVIF4.js} +11 -11
- package/dist/bundle/{chunk-WVEHUKCZ.js → chunk-RD7SSY7H.js} +4 -4
- package/dist/bundle/{chunk-TXBUDJ3P.js → chunk-RKQIEJFR.js} +5 -5
- package/dist/bundle/chunk-RMC2S3F4.js +264 -0
- package/dist/bundle/{chunk-4PDEQL6T.js → chunk-S5M4HFOZ.js} +6 -6
- package/dist/bundle/{chunk-BBC546ZA.js → chunk-SSALGKMJ.js} +6 -6
- package/dist/bundle/{chunk-QEPZUFPL.js → chunk-SSV37M5T.js} +59 -59
- package/dist/bundle/{chunk-DG62L57H.js → chunk-T4SDOYPY.js} +20 -20
- package/dist/bundle/{chunk-HLAZ65AW.js → chunk-TEO2KP52.js} +5 -5
- package/dist/bundle/{chunk-ZRNRQFTF.js → chunk-TPFLD4OM.js} +5 -5
- package/dist/bundle/{chunk-PYTOIDSM.js → chunk-VMU4SGCE.js} +7 -7
- package/dist/bundle/{chunk-W5EB4JLV.js → chunk-VZN5LD26.js} +6 -6
- package/dist/bundle/{chunk-ZJVZXJOG.js → chunk-WAGDZB62.js} +5 -5
- package/dist/bundle/{chunk-CRZPQQHE.js → chunk-WULARSC4.js} +26 -26
- package/dist/bundle/{chunk-BJG6JA5U.js → chunk-Y5E2WNWB.js} +4 -4
- package/dist/bundle/{chunk-OCWARAFE.js → chunk-YI72UVTJ.js} +5 -5
- package/dist/bundle/{chunk-SRU3OF4R.js → chunk-Z2DPNTSU.js} +5 -5
- package/dist/bundle/{chunk-5DFGJPT6.js → chunk-ZHXSRYJ5.js} +6 -6
- package/dist/bundle/{chunk-AFV74GK3.js → chunk-ZVVMGPBJ.js} +2 -2
- package/dist/bundle/command-contract-ZGFJTLB2.js +32 -0
- package/dist/bundle/{dist-RJMT44PL.js → dist-I7OZPHAZ.js} +3 -3
- package/dist/bundle/{echarts-27W2CIBD.js → echarts-UEQDIHVQ.js} +5 -5
- package/dist/bundle/{embed-FGJ273X2.js → embed-5DPZKRW5.js} +9 -8
- package/dist/bundle/{embedder-7ELL3CQ3.js → embedder-NBQXDXAO.js} +12 -11
- package/dist/bundle/entry-EE6YRAP4.js +14 -0
- package/dist/bundle/first-run-OSEVVWNT.js +24 -0
- package/dist/bundle/first-screen-753THOU6.js +30 -0
- package/dist/bundle/identity-LNH33PN3.js +11 -0
- package/dist/bundle/instructions-PYGVIT7I.js +9 -0
- package/dist/bundle/{mcp-4Y37G2UY.js → mcp-OQBZXELQ.js} +5 -5
- package/dist/bundle/{node-RSL3HANO.js → node-3OBKCX6M.js} +5 -5
- package/dist/bundle/{node-IUL5HSYI.js → node-P4E63KXA.js} +5 -5
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/{node-sqlite-7R3PYQGJ.js → node-sqlite-DMMTDRFB.js} +8 -8
- package/dist/bundle/oauth-FX5DDCRS.js +18 -0
- package/dist/bundle/open-G6QRQAAL.js +20 -0
- package/dist/bundle/{process-RMV3AKLB.js → process-47MMIFIJ.js} +5 -5
- package/dist/bundle/{program-PIUYQHBF.js → program-LBHBWRK5.js} +52 -51
- package/dist/bundle/prompt-CJ6Y4JYC.js +13 -0
- package/dist/bundle/proxy-transport-YSBYG26I.js +17 -0
- package/dist/bundle/{recognize-3GMOLZF4.js → recognize-7BLTOI45.js} +9 -9
- package/dist/bundle/remote-Q4A4JY6U.js +27 -0
- package/dist/bundle/{rerank-W3OSXXBN.js → rerank-CQAR46L3.js} +10 -9
- package/dist/bundle/{serve-ZCPO44NO.js → serve-2UO2YMMG.js} +13 -13
- package/dist/bundle/{server-YWL4HDOP.js → server-6XYURULQ.js} +53 -50
- package/dist/bundle/{server-FXU4QFRB.js → server-FMKC4RLL.js} +37 -35
- package/dist/bundle/{state-MJPTDIB5.js → state-RNWN2RDY.js} +9 -9
- package/dist/bundle/{store-6VNQG56O.js → store-BBHTR477.js} +14 -14
- package/dist/bundle/store-maintenance-command-GD6OLRXH.js +44 -0
- package/dist/bundle/tg.js +8 -8
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/dist/bundle/chunk-2SJOUK6J.js +0 -2
- package/dist/bundle/command-contract-A6VZN3ZR.js +0 -31
- package/dist/bundle/entry-SEE5YWIX.js +0 -14
- package/dist/bundle/first-run-BD7FEC3W.js +0 -24
- package/dist/bundle/first-screen-ASZV6LSA.js +0 -29
- package/dist/bundle/identity-QR4F42T6.js +0 -11
- package/dist/bundle/instructions-L74K64PV.js +0 -9
- package/dist/bundle/node-UPPL626U.js +0 -21
- package/dist/bundle/oauth-4ESGXF6U.js +0 -18
- package/dist/bundle/open-DFYEUGTA.js +0 -20
- package/dist/bundle/prompt-H7GYQQLL.js +0 -13
- package/dist/bundle/proxy-transport-G4MA6BGU.js +0 -17
- package/dist/bundle/remote-IRWTCI2B.js +0 -26
- package/dist/bundle/store-maintenance-command-62TQTMER.js +0 -43
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
wirecatDirectory
|
|
5
|
+
} from "./chunk-TPFLD4OM.js";
|
|
6
|
+
import {
|
|
7
|
+
CliError
|
|
8
|
+
} from "./chunk-67SRVSPU.js";
|
|
9
|
+
import {
|
|
10
|
+
__name
|
|
11
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
12
|
+
|
|
13
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/speech/install.js
|
|
14
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
15
|
+
import { createReadStream, createWriteStream, mkdirSync, statSync } from "node:fs";
|
|
16
|
+
import { rename, rm } from "node:fs/promises";
|
|
17
|
+
import { dirname, join } from "node:path";
|
|
18
|
+
import { Readable, Transform } from "node:stream";
|
|
19
|
+
import { pipeline } from "node:stream/promises";
|
|
20
|
+
|
|
21
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/speech/models.js
|
|
22
|
+
var huggingFace = /* @__PURE__ */ __name((repository, commit) => (name) => `https://huggingface.co/csukuangfj/${repository}/resolve/${commit}/${name}`, "huggingFace");
|
|
23
|
+
var gigaam = huggingFace("sherpa-onnx-nemo-transducer-punct-giga-am-v3-russian-2025-12-16", "a6039be7cee829a9044a69ac0ebaf1c191217c97");
|
|
24
|
+
var gigaamCtc = huggingFace("sherpa-onnx-nemo-ctc-punct-giga-am-v3-russian-2025-12-16", "4fb5407ff028a69fec516cdf4c10fac9ddea7c16");
|
|
25
|
+
var parakeet = huggingFace("sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8", "2bda32ec70b097a55adaa07d9a7173915b43cc78");
|
|
26
|
+
var MODELS = [
|
|
27
|
+
{
|
|
28
|
+
id: "gigaam-v3",
|
|
29
|
+
title: "GigaAM v3, with punctuation",
|
|
30
|
+
languages: "Russian \u2014 the best of the three for Russian",
|
|
31
|
+
featureDim: 64,
|
|
32
|
+
files: [
|
|
33
|
+
{
|
|
34
|
+
name: "encoder.int8.onnx",
|
|
35
|
+
url: gigaam("encoder.int8.onnx"),
|
|
36
|
+
sha256: "369f35a71bf288d3b8e0391fabd8dba5f2314088d440bca474056b7b4b6e66bf",
|
|
37
|
+
bytes: 224570820
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "decoder.onnx",
|
|
41
|
+
url: gigaam("decoder.onnx"),
|
|
42
|
+
sha256: "38fc7475443ea2a26f63211ca350f73ac50fff824ab7a3876ee2bd610c53bbc4",
|
|
43
|
+
bytes: 4600132
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "joiner.onnx",
|
|
47
|
+
url: gigaam("joiner.onnx"),
|
|
48
|
+
sha256: "602ff7017a93311aad34df1437c8d7f49911353c13d6eae7a6ee7b041339465c",
|
|
49
|
+
bytes: 2712896
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "tokens.txt",
|
|
53
|
+
url: gigaam("tokens.txt"),
|
|
54
|
+
sha256: "39abae20e692998290c574e606f11a9edef2902a1995463fcff63d1490cf22b7",
|
|
55
|
+
bytes: 13354
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
config: /* @__PURE__ */ __name((path) => ({
|
|
59
|
+
transducer: { encoder: path("encoder.int8.onnx"), decoder: path("decoder.onnx"), joiner: path("joiner.onnx") },
|
|
60
|
+
tokens: path("tokens.txt"),
|
|
61
|
+
modelType: "nemo_transducer"
|
|
62
|
+
}), "config")
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: "gigaam-v3-ctc",
|
|
66
|
+
title: "GigaAM v3 CTC, with punctuation \u2014 a little faster",
|
|
67
|
+
languages: "Russian \u2014 a little faster, rougher with capital letters",
|
|
68
|
+
featureDim: 64,
|
|
69
|
+
files: [
|
|
70
|
+
{
|
|
71
|
+
name: "model.int8.onnx",
|
|
72
|
+
url: gigaamCtc("model.int8.onnx"),
|
|
73
|
+
sha256: "d5fea8df94263c285e54b21e5774b707c707192d3bdbeffd7b1eb07fb6743b35",
|
|
74
|
+
bytes: 224893661
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "tokens.txt",
|
|
78
|
+
url: gigaamCtc("tokens.txt"),
|
|
79
|
+
sha256: "142de7570b3de5b3035ce111a89c228e80e6085273731d944093ddf24fa539cd",
|
|
80
|
+
bytes: 2007
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
config: /* @__PURE__ */ __name((path) => ({ nemoCtc: { model: path("model.int8.onnx") }, tokens: path("tokens.txt") }), "config")
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: "parakeet-v3",
|
|
87
|
+
title: "NVIDIA Parakeet TDT 0.6B v3",
|
|
88
|
+
/** The model card's list: huggingface.co/nvidia/parakeet-tdt-0.6b-v3, read 2026-09-24. */
|
|
89
|
+
languages: "25: bg cs da de el en es et fi fr hr hu it lt lv mt nl pl pt ro ru sk sl sv uk",
|
|
90
|
+
featureDim: 80,
|
|
91
|
+
files: [
|
|
92
|
+
{
|
|
93
|
+
name: "encoder.int8.onnx",
|
|
94
|
+
url: parakeet("encoder.int8.onnx"),
|
|
95
|
+
sha256: "acfc2b4456377e15d04f0243af540b7fe7c992f8d898d751cf134c3a55fd2247",
|
|
96
|
+
bytes: 652184281
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "decoder.int8.onnx",
|
|
100
|
+
url: parakeet("decoder.int8.onnx"),
|
|
101
|
+
sha256: "179e50c43d1a9de79c8a24149a2f9bac6eb5981823f2a2ed88d655b24248db4e",
|
|
102
|
+
bytes: 11845275
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: "joiner.int8.onnx",
|
|
106
|
+
url: parakeet("joiner.int8.onnx"),
|
|
107
|
+
sha256: "3164c13fc2821009440d20fcb5fdc78bff28b4db2f8d0f0b329101719c0948b3",
|
|
108
|
+
bytes: 6355277
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "tokens.txt",
|
|
112
|
+
url: parakeet("tokens.txt"),
|
|
113
|
+
sha256: "d58544679ea4bc6ac563d1f545eb7d474bd6cfa467f0a6e2c1dc1c7d37e3c35d",
|
|
114
|
+
bytes: 93939
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
config: /* @__PURE__ */ __name((path) => ({
|
|
118
|
+
transducer: {
|
|
119
|
+
encoder: path("encoder.int8.onnx"),
|
|
120
|
+
decoder: path("decoder.int8.onnx"),
|
|
121
|
+
joiner: path("joiner.int8.onnx")
|
|
122
|
+
},
|
|
123
|
+
tokens: path("tokens.txt"),
|
|
124
|
+
modelType: "nemo_transducer"
|
|
125
|
+
}), "config")
|
|
126
|
+
}
|
|
127
|
+
];
|
|
128
|
+
var VAD = {
|
|
129
|
+
name: "silero_vad.onnx",
|
|
130
|
+
url: "https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/silero_vad.onnx",
|
|
131
|
+
sha256: "9e2449e1087496d8d4caba907f23e0bd3f78d91fa552479bb9c23ac09cbb1fd6",
|
|
132
|
+
bytes: 643854
|
|
133
|
+
};
|
|
134
|
+
var DEFAULT_ORDER = ["parakeet-v3", "gigaam-v3", "gigaam-v3-ctc"];
|
|
135
|
+
var orderedModels = /* @__PURE__ */ __name((order = DEFAULT_ORDER) => [.../* @__PURE__ */ new Set([...order, ...DEFAULT_ORDER])].map(speechModel), "orderedModels");
|
|
136
|
+
var findModel = /* @__PURE__ */ __name((id) => MODELS.find((model) => model.id === id), "findModel");
|
|
137
|
+
var speechModel = /* @__PURE__ */ __name((id) => {
|
|
138
|
+
const model = findModel(id);
|
|
139
|
+
if (!model) {
|
|
140
|
+
throw new CliError("validation_error", `no speech model "${id}" \u2014 one of ${MODELS.map((known) => known.id).join(", ")}`);
|
|
141
|
+
}
|
|
142
|
+
return model;
|
|
143
|
+
}, "speechModel");
|
|
144
|
+
|
|
145
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/speech/install.js
|
|
146
|
+
var sharedModelsDirectory = /* @__PURE__ */ __name((kind, env = process.env) => join(wirecatDirectory(env), "models", kind), "sharedModelsDirectory");
|
|
147
|
+
var modelsDirectory = /* @__PURE__ */ __name((env = process.env) => sharedModelsDirectory("audio", env), "modelsDirectory");
|
|
148
|
+
var STALL_MS = 6e4;
|
|
149
|
+
var watchdog = /* @__PURE__ */ __name((ms) => {
|
|
150
|
+
const controller = new AbortController();
|
|
151
|
+
let timer = setTimeout(() => controller.abort(), ms);
|
|
152
|
+
return {
|
|
153
|
+
signal: controller.signal,
|
|
154
|
+
poke: /* @__PURE__ */ __name(() => {
|
|
155
|
+
clearTimeout(timer);
|
|
156
|
+
timer = setTimeout(() => controller.abort(), ms);
|
|
157
|
+
}, "poke"),
|
|
158
|
+
stop: /* @__PURE__ */ __name(() => clearTimeout(timer), "stop")
|
|
159
|
+
};
|
|
160
|
+
}, "watchdog");
|
|
161
|
+
var modelPath = /* @__PURE__ */ __name((directory, model) => (name) => join(directory, model.id, name), "modelPath");
|
|
162
|
+
var vadPath = /* @__PURE__ */ __name((directory) => join(directory, VAD.name), "vadPath");
|
|
163
|
+
var placed = /* @__PURE__ */ __name((model, directory) => [
|
|
164
|
+
...model.files.map((file) => [file, modelPath(directory, model)(file.name)]),
|
|
165
|
+
[VAD, vadPath(directory)]
|
|
166
|
+
], "placed");
|
|
167
|
+
var isInstalled = /* @__PURE__ */ __name((model, directory) => filesPresent(placed(model, directory)), "isInstalled");
|
|
168
|
+
var filesPresent = /* @__PURE__ */ __name((files) => files.every(([file, path]) => sizeOf(path) === file.bytes), "filesPresent");
|
|
169
|
+
var sizeOf = /* @__PURE__ */ __name((path) => {
|
|
170
|
+
try {
|
|
171
|
+
return statSync(path).size;
|
|
172
|
+
} catch {
|
|
173
|
+
return void 0;
|
|
174
|
+
}
|
|
175
|
+
}, "sizeOf");
|
|
176
|
+
var installedBytes = /* @__PURE__ */ __name((model) => model.files.reduce((sum, file) => sum + file.bytes, 0), "installedBytes");
|
|
177
|
+
var install = /* @__PURE__ */ __name(async (model, directory, { fetch: get = fetch, progress, verifyExisting } = {}) => {
|
|
178
|
+
mkdirSync(join(directory, model.id), { recursive: true, mode: 448 });
|
|
179
|
+
await installFiles(placed(model, directory), { fetch: get, progress, verifyExisting });
|
|
180
|
+
}, "install");
|
|
181
|
+
var installFiles = /* @__PURE__ */ __name(async (files, { fetch: get = fetch, progress, verifyExisting } = {}) => {
|
|
182
|
+
if (verifyExisting)
|
|
183
|
+
for (const [file, path] of files) {
|
|
184
|
+
if (sizeOf(path) !== void 0) {
|
|
185
|
+
const hash = createHash("sha256");
|
|
186
|
+
for await (const chunk of createReadStream(path))
|
|
187
|
+
hash.update(chunk);
|
|
188
|
+
if (hash.digest("hex") !== file.sha256) {
|
|
189
|
+
progress?.(`${path}: not the file this version expects, downloading it again`);
|
|
190
|
+
await rm(path, { force: true });
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
for (const [file, path] of files) {
|
|
195
|
+
if (sizeOf(path) === file.bytes)
|
|
196
|
+
continue;
|
|
197
|
+
mkdirSync(dirname(path), { recursive: true, mode: 448 });
|
|
198
|
+
progress?.(`downloading ${file.name} (${megabytes(file.bytes)})`);
|
|
199
|
+
await fetchVerified(file, path, get);
|
|
200
|
+
}
|
|
201
|
+
}, "installFiles");
|
|
202
|
+
var fetchVerified = /* @__PURE__ */ __name(async (file, path, get) => {
|
|
203
|
+
const stalled = watchdog(STALL_MS);
|
|
204
|
+
try {
|
|
205
|
+
await fetchInto(file, path, get, stalled);
|
|
206
|
+
} catch (error) {
|
|
207
|
+
if (stalled.signal.aborted) {
|
|
208
|
+
throw new CliError("timeout", `${file.name} stopped downloading for ${STALL_MS / 1e3} s \u2014 nothing was installed`);
|
|
209
|
+
}
|
|
210
|
+
throw error;
|
|
211
|
+
} finally {
|
|
212
|
+
stalled.stop();
|
|
213
|
+
}
|
|
214
|
+
}, "fetchVerified");
|
|
215
|
+
var fetchInto = /* @__PURE__ */ __name(async (file, path, get, stalled) => {
|
|
216
|
+
const response = await get(file.url, { signal: stalled.signal });
|
|
217
|
+
if (!response.ok || !response.body) {
|
|
218
|
+
await response.body?.cancel();
|
|
219
|
+
throw new CliError("network_error", `${file.name} could not be downloaded: HTTP ${response.status}`);
|
|
220
|
+
}
|
|
221
|
+
const partial = `${path}.${randomUUID()}.part`;
|
|
222
|
+
const hash = createHash("sha256");
|
|
223
|
+
let bytes = 0;
|
|
224
|
+
const hashing = new Transform({
|
|
225
|
+
transform(chunk, _encoding, done) {
|
|
226
|
+
stalled.poke();
|
|
227
|
+
bytes += chunk.length;
|
|
228
|
+
if (bytes > file.bytes) {
|
|
229
|
+
done(new CliError("invalid_response", `${file.name} is larger than this version expects \u2014 nothing was installed`));
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
hash.update(chunk);
|
|
233
|
+
done(null, chunk);
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
try {
|
|
237
|
+
await pipeline(Readable.fromWeb(response.body), hashing, createWriteStream(partial, { flags: "wx", mode: 384 }));
|
|
238
|
+
const actual = hash.digest("hex");
|
|
239
|
+
if (actual !== file.sha256) {
|
|
240
|
+
throw new CliError("invalid_response", `${file.name} is not the file this version expects (sha256 ${actual}) \u2014 nothing was installed`);
|
|
241
|
+
}
|
|
242
|
+
await rename(partial, path);
|
|
243
|
+
} finally {
|
|
244
|
+
await rm(partial, { force: true });
|
|
245
|
+
}
|
|
246
|
+
}, "fetchInto");
|
|
247
|
+
var megabytes = /* @__PURE__ */ __name((bytes) => bytes < 1e6 ? "under 1 MB" : `${Math.round(bytes / 1e6)} MB`, "megabytes");
|
|
248
|
+
|
|
249
|
+
export {
|
|
250
|
+
VAD,
|
|
251
|
+
DEFAULT_ORDER,
|
|
252
|
+
orderedModels,
|
|
253
|
+
speechModel,
|
|
254
|
+
sharedModelsDirectory,
|
|
255
|
+
modelsDirectory,
|
|
256
|
+
modelPath,
|
|
257
|
+
vadPath,
|
|
258
|
+
isInstalled,
|
|
259
|
+
filesPresent,
|
|
260
|
+
installedBytes,
|
|
261
|
+
install,
|
|
262
|
+
installFiles,
|
|
263
|
+
megabytes
|
|
264
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { createRequire as
|
|
2
|
-
const require =
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
CliError
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-67SRVSPU.js";
|
|
6
6
|
import {
|
|
7
7
|
importFrom
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-Y5E2WNWB.js";
|
|
9
9
|
import {
|
|
10
10
|
__name
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
12
12
|
|
|
13
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/store/vector-extension.js
|
|
14
14
|
import { readFileSync } from "node:fs";
|
|
15
15
|
var musl = /* @__PURE__ */ __name(() => {
|
|
16
16
|
if (process.platform !== "linux")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createRequire as
|
|
2
|
-
const require =
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
CLIENT_INFO_META_KEY,
|
|
5
5
|
DEFAULT_MAX_SUBSCRIPTIONS,
|
|
@@ -24,14 +24,14 @@ import {
|
|
|
24
24
|
serverIdentityOf,
|
|
25
25
|
setNegotiatedProtocolVersion,
|
|
26
26
|
validateEnvelopeMeta
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-5D4AEUVA.js";
|
|
28
28
|
import {
|
|
29
29
|
agentOf,
|
|
30
30
|
clientHash
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-EMC57SOZ.js";
|
|
32
32
|
import {
|
|
33
33
|
__name
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
35
35
|
|
|
36
36
|
// node_modules/.pnpm/@modelcontextprotocol+server@2.4.0/node_modules/@modelcontextprotocol/server/dist/stdio.mjs
|
|
37
37
|
var swallowsErrorsAfterClose = /* @__PURE__ */ Symbol("swallowsErrorsAfterClose");
|
|
@@ -540,7 +540,7 @@ function toError(value) {
|
|
|
540
540
|
}
|
|
541
541
|
__name(toError, "toError");
|
|
542
542
|
|
|
543
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
543
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/mcp/caller.js
|
|
544
544
|
var CALLER_META_KEY = "wirecat.dev/caller";
|
|
545
545
|
var PROXY_CLIENT_NAME = "all-profiles";
|
|
546
546
|
var NAME = /^[\w .@()/+-]{1,64}$/;
|