@wirecat/zoom-cli 0.56.0 → 0.58.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/bin/zm.js +35 -5
- package/dist/bundle/all-profiles-RS5IWIGR.js +25 -0
- package/dist/bundle/answer-policy-R7VZMCGE.js +96 -0
- package/dist/bundle/anthropic-5QHQR4WF.js +70 -0
- package/dist/bundle/app-server-7LANSZGE.js +232 -0
- package/dist/bundle/bun-O6RL6LRQ.js +169 -0
- package/dist/bundle/bun-sqlite-PEJM6CS4.js +69 -0
- package/dist/bundle/chunk-24DLFGES.js +97 -0
- package/dist/bundle/chunk-27P22POE.js +1109 -0
- package/dist/bundle/chunk-3SCTDFNO.js +3398 -0
- package/dist/bundle/chunk-3SERIWJD.js +36139 -0
- package/dist/bundle/chunk-4AURKUDZ.js +60 -0
- package/dist/bundle/chunk-4NGLRHWO.js +24 -0
- package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
- package/dist/bundle/chunk-5DVW77VC.js +789 -0
- package/dist/bundle/chunk-6CYLVFXM.js +9 -0
- package/dist/bundle/chunk-6FL25KC5.js +264 -0
- package/dist/bundle/chunk-7D2CD3E3.js +193 -0
- package/dist/bundle/chunk-7GVNQOV6.js +17 -0
- package/dist/bundle/chunk-7H3ZRDLW.js +630 -0
- package/dist/bundle/chunk-7Z4ANTAK.js +1095 -0
- package/dist/bundle/chunk-A6323R5P.js +22 -0
- package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
- package/dist/bundle/chunk-AIXLOMH4.js +63 -0
- package/dist/bundle/chunk-AQDWGJZT.js +188 -0
- package/dist/bundle/chunk-B32SF7J3.js +18 -0
- package/dist/bundle/chunk-BAQLQIMI.js +1938 -0
- package/dist/bundle/chunk-BGILD4CI.js +1109 -0
- package/dist/bundle/chunk-BXZ6WSVF.js +100 -0
- package/dist/bundle/chunk-CTGI4ES2.js +138 -0
- package/dist/bundle/chunk-CVIKKIGE.js +76 -0
- package/dist/bundle/chunk-DDYR6DYL.js +78 -0
- package/dist/bundle/chunk-DFDN6AUB.js +21 -0
- package/dist/bundle/chunk-DP5DX45H.js +151 -0
- package/dist/bundle/chunk-DXKVEOSS.js +53 -0
- package/dist/bundle/chunk-DXZTLB24.js +120 -0
- package/dist/bundle/chunk-G27MRA24.js +82 -0
- package/dist/bundle/chunk-HTQTIKWP.js +928 -0
- package/dist/bundle/chunk-IYAGQXED.js +433 -0
- package/dist/bundle/chunk-K76WFW4I.js +124 -0
- package/dist/bundle/chunk-KVHRHBLY.js +884 -0
- package/dist/bundle/chunk-L2UIJDWB.js +31 -0
- package/dist/bundle/chunk-L3VS3H34.js +482 -0
- package/dist/bundle/chunk-MBT7GP7K.js +1970 -0
- package/dist/bundle/chunk-MFS52LTZ.js +570 -0
- package/dist/bundle/chunk-MMT46EN4.js +29 -0
- package/dist/bundle/chunk-MNUTWGSA.js +6094 -0
- package/dist/bundle/chunk-N7GAQ27N.js +82 -0
- package/dist/bundle/chunk-NDXAZB5Z.js +409 -0
- package/dist/bundle/chunk-NOKFJJPA.js +1028 -0
- package/dist/bundle/chunk-NW7IMGRR.js +6848 -0
- package/dist/bundle/chunk-O5EHUB2V.js +2 -0
- package/dist/bundle/chunk-OBZWUNO4.js +160 -0
- package/dist/bundle/chunk-PACC5N6T.js +240 -0
- package/dist/bundle/chunk-PF25S7L4.js +422 -0
- package/dist/bundle/chunk-PKTFZAXG.js +48 -0
- package/dist/bundle/chunk-PNBEREOU.js +35626 -0
- package/dist/bundle/chunk-POOGFSRA.js +385 -0
- package/dist/bundle/chunk-PP3JGQQE.js +3517 -0
- package/dist/bundle/chunk-Q2Z3VCM4.js +2 -0
- package/dist/bundle/chunk-QCFHL4ES.js +45 -0
- package/dist/bundle/chunk-QFGBMS67.js +492 -0
- package/dist/bundle/chunk-RUP467ZX.js +948 -0
- package/dist/bundle/chunk-RXDIG23Z.js +166 -0
- package/dist/bundle/chunk-SIA7HJE2.js +8192 -0
- package/dist/bundle/chunk-SL3SXQZ5.js +100 -0
- package/dist/bundle/chunk-SV5L36WK.js +19 -0
- package/dist/bundle/chunk-T6AAM7UT.js +846 -0
- package/dist/bundle/chunk-U6QW67SU.js +18673 -0
- package/dist/bundle/chunk-UKR7KH3H.js +288 -0
- package/dist/bundle/chunk-UOFOMU3T.js +836 -0
- package/dist/bundle/chunk-URO44C5T.js +3570 -0
- package/dist/bundle/chunk-UXM7I35J.js +281 -0
- package/dist/bundle/chunk-UYJUTZTT.js +73 -0
- package/dist/bundle/chunk-VOAVOK4I.js +1146 -0
- package/dist/bundle/chunk-VSUY7PDW.js +192 -0
- package/dist/bundle/chunk-VYUSEJE4.js +98 -0
- package/dist/bundle/chunk-XFCSPOLZ.js +25 -0
- package/dist/bundle/chunk-XT7XVPEM.js +538 -0
- package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
- package/dist/bundle/chunk-YIFIY7ZE.js +58 -0
- package/dist/bundle/chunk-YIMI6O7R.js +5292 -0
- package/dist/bundle/chunk-YJRMMZI5.js +275 -0
- package/dist/bundle/chunk-YSHSCBPM.js +2315 -0
- package/dist/bundle/chunk-ZC5UXEIH.js +215 -0
- package/dist/bundle/chunk-ZHXIXDH5.js +161 -0
- package/dist/bundle/chunk-ZTOAAYFV.js +122 -0
- package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
- package/dist/bundle/cli-IQTASP44.js +831 -0
- package/dist/bundle/command-contract-WHZPF7NA.js +38 -0
- package/dist/bundle/config-IP5SGHKN.js +79 -0
- package/dist/bundle/dist-WT73DF46.js +136 -0
- package/dist/bundle/dist-XUFQCJXW.js +7577 -0
- package/dist/bundle/echarts-LD3AI55P.js +42501 -0
- package/dist/bundle/embed-XEMH4LNX.js +35 -0
- package/dist/bundle/embedder-ZCYKSKAE.js +108 -0
- package/dist/bundle/first-run-LGYDLIUM.js +23 -0
- package/dist/bundle/first-screen-LYQKPNF4.js +36 -0
- package/dist/bundle/folders-5ZBUQHAM.js +13 -0
- package/dist/bundle/instructions-RZMSW3OC.js +11 -0
- package/dist/bundle/main-NKY3JGXY.js +130 -0
- package/dist/bundle/mcp-7OXUHLTO.js +189 -0
- package/dist/bundle/mcp-OQBZXELQ.js +165 -0
- package/dist/bundle/mcp-VISEXTVC.js +92 -0
- package/dist/bundle/meetings-XPBHVZAU.js +215 -0
- package/dist/bundle/node-P4E63KXA.js +2340 -0
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/node-ZRLYQL7J.js +176 -0
- package/dist/bundle/node-sqlite-BBEDYBWO.js +45 -0
- package/dist/bundle/oauth-UHVRGKZU.js +17 -0
- package/dist/bundle/open-J4FCAUAJ.js +19 -0
- package/dist/bundle/output-file-SXV2ANW7.js +63 -0
- package/dist/bundle/process-LL77573L.js +91 -0
- package/dist/bundle/program-EPMIJCGA.js +5845 -0
- package/dist/bundle/prompt-LUUMQTMY.js +12 -0
- package/dist/bundle/recognize-EMHQX4XF.js +190 -0
- package/dist/bundle/remote-ZXS6D7VB.js +26 -0
- package/dist/bundle/rerank-WP7RKZNB.js +49 -0
- package/dist/bundle/run-log-GS2L66G6.js +111 -0
- package/dist/bundle/serve-L6KLLXK2.js +19 -0
- package/dist/bundle/server-NOFYENP5.js +53 -0
- package/dist/bundle/server-P5TXAPBY.js +66 -0
- package/dist/bundle/services-SPOEWVK3.js +330 -0
- package/dist/bundle/speech-6OBAKMND.js +44 -0
- package/dist/bundle/state-HN5EJKXQ.js +33 -0
- package/dist/bundle/store-LEU3M6IN.js +124 -0
- package/dist/bundle/store-ZP2URKET.js +141 -0
- package/dist/bundle/store-connection-I53XZ2TS.js +76 -0
- package/dist/bundle/store-maintenance-command-PSCHEHHY.js +54 -0
- package/dist/bundle/streaming-AK6Q2ZGQ.js +15 -0
- package/dist/bundle/tokens-CCM3D4ZT.js +17 -0
- package/dist/bundle/zm.js +8 -0
- package/dist/contract-overrides.d.ts.map +1 -1
- package/dist/contract-overrides.js +29 -17
- package/dist/contract-overrides.js.map +1 -1
- package/dist/mcp-command.d.ts +3 -2
- package/dist/mcp-command.d.ts.map +1 -1
- package/dist/mcp-command.js +62 -10
- package/dist/mcp-command.js.map +1 -1
- package/dist/program-bindings.d.ts.map +1 -1
- package/dist/program-bindings.js +1 -0
- package/dist/program-bindings.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +7 -5
- package/skills/zoom-cli/SKILL.md +2 -0
|
@@ -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-B32SF7J3.js";
|
|
6
|
+
import {
|
|
7
|
+
CliError
|
|
8
|
+
} from "./chunk-YIMI6O7R.js";
|
|
9
|
+
import {
|
|
10
|
+
__name
|
|
11
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
12
|
+
|
|
13
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/speech/models.js
|
|
14
|
+
var huggingFace = /* @__PURE__ */ __name((repository, commit) => (name) => `https://huggingface.co/csukuangfj/${repository}/resolve/${commit}/${name}`, "huggingFace");
|
|
15
|
+
var gigaam = huggingFace("sherpa-onnx-nemo-transducer-punct-giga-am-v3-russian-2025-12-16", "a6039be7cee829a9044a69ac0ebaf1c191217c97");
|
|
16
|
+
var gigaamCtc = huggingFace("sherpa-onnx-nemo-ctc-punct-giga-am-v3-russian-2025-12-16", "4fb5407ff028a69fec516cdf4c10fac9ddea7c16");
|
|
17
|
+
var parakeet = huggingFace("sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8", "2bda32ec70b097a55adaa07d9a7173915b43cc78");
|
|
18
|
+
var MODELS = [
|
|
19
|
+
{
|
|
20
|
+
id: "gigaam-v3",
|
|
21
|
+
title: "GigaAM v3, with punctuation",
|
|
22
|
+
languages: "Russian \u2014 the best of the three for Russian",
|
|
23
|
+
featureDim: 64,
|
|
24
|
+
files: [
|
|
25
|
+
{
|
|
26
|
+
name: "encoder.int8.onnx",
|
|
27
|
+
url: gigaam("encoder.int8.onnx"),
|
|
28
|
+
sha256: "369f35a71bf288d3b8e0391fabd8dba5f2314088d440bca474056b7b4b6e66bf",
|
|
29
|
+
bytes: 224570820
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "decoder.onnx",
|
|
33
|
+
url: gigaam("decoder.onnx"),
|
|
34
|
+
sha256: "38fc7475443ea2a26f63211ca350f73ac50fff824ab7a3876ee2bd610c53bbc4",
|
|
35
|
+
bytes: 4600132
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "joiner.onnx",
|
|
39
|
+
url: gigaam("joiner.onnx"),
|
|
40
|
+
sha256: "602ff7017a93311aad34df1437c8d7f49911353c13d6eae7a6ee7b041339465c",
|
|
41
|
+
bytes: 2712896
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "tokens.txt",
|
|
45
|
+
url: gigaam("tokens.txt"),
|
|
46
|
+
sha256: "39abae20e692998290c574e606f11a9edef2902a1995463fcff63d1490cf22b7",
|
|
47
|
+
bytes: 13354
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
config: /* @__PURE__ */ __name((path) => ({
|
|
51
|
+
transducer: { encoder: path("encoder.int8.onnx"), decoder: path("decoder.onnx"), joiner: path("joiner.onnx") },
|
|
52
|
+
tokens: path("tokens.txt"),
|
|
53
|
+
modelType: "nemo_transducer"
|
|
54
|
+
}), "config")
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: "gigaam-v3-ctc",
|
|
58
|
+
title: "GigaAM v3 CTC, with punctuation \u2014 a little faster",
|
|
59
|
+
languages: "Russian \u2014 a little faster, rougher with capital letters",
|
|
60
|
+
featureDim: 64,
|
|
61
|
+
files: [
|
|
62
|
+
{
|
|
63
|
+
name: "model.int8.onnx",
|
|
64
|
+
url: gigaamCtc("model.int8.onnx"),
|
|
65
|
+
sha256: "d5fea8df94263c285e54b21e5774b707c707192d3bdbeffd7b1eb07fb6743b35",
|
|
66
|
+
bytes: 224893661
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "tokens.txt",
|
|
70
|
+
url: gigaamCtc("tokens.txt"),
|
|
71
|
+
sha256: "142de7570b3de5b3035ce111a89c228e80e6085273731d944093ddf24fa539cd",
|
|
72
|
+
bytes: 2007
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
config: /* @__PURE__ */ __name((path) => ({ nemoCtc: { model: path("model.int8.onnx") }, tokens: path("tokens.txt") }), "config")
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: "parakeet-v3",
|
|
79
|
+
title: "NVIDIA Parakeet TDT 0.6B v3",
|
|
80
|
+
/** The model card's list: huggingface.co/nvidia/parakeet-tdt-0.6b-v3, read 2026-09-24. */
|
|
81
|
+
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",
|
|
82
|
+
featureDim: 80,
|
|
83
|
+
files: [
|
|
84
|
+
{
|
|
85
|
+
name: "encoder.int8.onnx",
|
|
86
|
+
url: parakeet("encoder.int8.onnx"),
|
|
87
|
+
sha256: "acfc2b4456377e15d04f0243af540b7fe7c992f8d898d751cf134c3a55fd2247",
|
|
88
|
+
bytes: 652184281
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "decoder.int8.onnx",
|
|
92
|
+
url: parakeet("decoder.int8.onnx"),
|
|
93
|
+
sha256: "179e50c43d1a9de79c8a24149a2f9bac6eb5981823f2a2ed88d655b24248db4e",
|
|
94
|
+
bytes: 11845275
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "joiner.int8.onnx",
|
|
98
|
+
url: parakeet("joiner.int8.onnx"),
|
|
99
|
+
sha256: "3164c13fc2821009440d20fcb5fdc78bff28b4db2f8d0f0b329101719c0948b3",
|
|
100
|
+
bytes: 6355277
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "tokens.txt",
|
|
104
|
+
url: parakeet("tokens.txt"),
|
|
105
|
+
sha256: "d58544679ea4bc6ac563d1f545eb7d474bd6cfa467f0a6e2c1dc1c7d37e3c35d",
|
|
106
|
+
bytes: 93939
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
config: /* @__PURE__ */ __name((path) => ({
|
|
110
|
+
transducer: {
|
|
111
|
+
encoder: path("encoder.int8.onnx"),
|
|
112
|
+
decoder: path("decoder.int8.onnx"),
|
|
113
|
+
joiner: path("joiner.int8.onnx")
|
|
114
|
+
},
|
|
115
|
+
tokens: path("tokens.txt"),
|
|
116
|
+
modelType: "nemo_transducer"
|
|
117
|
+
}), "config")
|
|
118
|
+
}
|
|
119
|
+
];
|
|
120
|
+
var VAD = {
|
|
121
|
+
name: "silero_vad.onnx",
|
|
122
|
+
url: "https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/silero_vad.onnx",
|
|
123
|
+
sha256: "9e2449e1087496d8d4caba907f23e0bd3f78d91fa552479bb9c23ac09cbb1fd6",
|
|
124
|
+
bytes: 643854
|
|
125
|
+
};
|
|
126
|
+
var DEFAULT_ORDER = ["parakeet-v3", "gigaam-v3", "gigaam-v3-ctc"];
|
|
127
|
+
var orderedModels = /* @__PURE__ */ __name((order = DEFAULT_ORDER) => [.../* @__PURE__ */ new Set([...order, ...DEFAULT_ORDER])].map(speechModel), "orderedModels");
|
|
128
|
+
var findModel = /* @__PURE__ */ __name((id) => MODELS.find((model) => model.id === id), "findModel");
|
|
129
|
+
var speechModel = /* @__PURE__ */ __name((id) => {
|
|
130
|
+
const model = findModel(id);
|
|
131
|
+
if (!model) {
|
|
132
|
+
throw new CliError("validation_error", `no speech model "${id}" \u2014 one of ${MODELS.map((known) => known.id).join(", ")}`);
|
|
133
|
+
}
|
|
134
|
+
return model;
|
|
135
|
+
}, "speechModel");
|
|
136
|
+
|
|
137
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/speech/install.js
|
|
138
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
139
|
+
import { createReadStream, createWriteStream, mkdirSync, statSync } from "node:fs";
|
|
140
|
+
import { rename, rm } from "node:fs/promises";
|
|
141
|
+
import { dirname, join } from "node:path";
|
|
142
|
+
import { Readable, Transform } from "node:stream";
|
|
143
|
+
import { pipeline } from "node:stream/promises";
|
|
144
|
+
var sharedModelsDirectory = /* @__PURE__ */ __name((kind, env = process.env) => join(wirecatDirectory(env), "models", kind), "sharedModelsDirectory");
|
|
145
|
+
var modelsDirectory = /* @__PURE__ */ __name((env = process.env) => sharedModelsDirectory("audio", env), "modelsDirectory");
|
|
146
|
+
var STALL_MS = 6e4;
|
|
147
|
+
var watchdog = /* @__PURE__ */ __name((ms) => {
|
|
148
|
+
const controller = new AbortController();
|
|
149
|
+
let timer = setTimeout(() => controller.abort(), ms);
|
|
150
|
+
return {
|
|
151
|
+
signal: controller.signal,
|
|
152
|
+
poke: /* @__PURE__ */ __name(() => {
|
|
153
|
+
clearTimeout(timer);
|
|
154
|
+
timer = setTimeout(() => controller.abort(), ms);
|
|
155
|
+
}, "poke"),
|
|
156
|
+
stop: /* @__PURE__ */ __name(() => clearTimeout(timer), "stop")
|
|
157
|
+
};
|
|
158
|
+
}, "watchdog");
|
|
159
|
+
var modelPath = /* @__PURE__ */ __name((directory, model) => (name) => join(directory, model.id, name), "modelPath");
|
|
160
|
+
var vadPath = /* @__PURE__ */ __name((directory) => join(directory, VAD.name), "vadPath");
|
|
161
|
+
var placed = /* @__PURE__ */ __name((model, directory) => [
|
|
162
|
+
...model.files.map((file) => [file, modelPath(directory, model)(file.name)]),
|
|
163
|
+
[VAD, vadPath(directory)]
|
|
164
|
+
], "placed");
|
|
165
|
+
var isInstalled = /* @__PURE__ */ __name((model, directory) => filesPresent(placed(model, directory)), "isInstalled");
|
|
166
|
+
var filesPresent = /* @__PURE__ */ __name((files) => files.every(([file, path]) => sizeOf(path) === file.bytes), "filesPresent");
|
|
167
|
+
var sizeOf = /* @__PURE__ */ __name((path) => {
|
|
168
|
+
try {
|
|
169
|
+
return statSync(path).size;
|
|
170
|
+
} catch {
|
|
171
|
+
return void 0;
|
|
172
|
+
}
|
|
173
|
+
}, "sizeOf");
|
|
174
|
+
var installedBytes = /* @__PURE__ */ __name((model) => model.files.reduce((sum, file) => sum + file.bytes, 0), "installedBytes");
|
|
175
|
+
var install = /* @__PURE__ */ __name(async (model, directory, { fetch: get = fetch, progress, verifyExisting } = {}) => {
|
|
176
|
+
mkdirSync(join(directory, model.id), { recursive: true, mode: 448 });
|
|
177
|
+
await installFiles(placed(model, directory), { fetch: get, progress, verifyExisting });
|
|
178
|
+
}, "install");
|
|
179
|
+
var installFiles = /* @__PURE__ */ __name(async (files, { fetch: get = fetch, progress, verifyExisting } = {}) => {
|
|
180
|
+
if (verifyExisting)
|
|
181
|
+
for (const [file, path] of files) {
|
|
182
|
+
if (sizeOf(path) !== void 0) {
|
|
183
|
+
const hash = createHash("sha256");
|
|
184
|
+
for await (const chunk of createReadStream(path))
|
|
185
|
+
hash.update(chunk);
|
|
186
|
+
if (hash.digest("hex") !== file.sha256) {
|
|
187
|
+
progress?.(`${path}: not the file this version expects, downloading it again`);
|
|
188
|
+
await rm(path, { force: true });
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
for (const [file, path] of files) {
|
|
193
|
+
if (sizeOf(path) === file.bytes)
|
|
194
|
+
continue;
|
|
195
|
+
mkdirSync(dirname(path), { recursive: true, mode: 448 });
|
|
196
|
+
progress?.(`downloading ${file.name} (${megabytes(file.bytes)})`);
|
|
197
|
+
await fetchVerified(file, path, get);
|
|
198
|
+
}
|
|
199
|
+
}, "installFiles");
|
|
200
|
+
var fetchVerified = /* @__PURE__ */ __name(async (file, path, get) => {
|
|
201
|
+
const stalled = watchdog(STALL_MS);
|
|
202
|
+
try {
|
|
203
|
+
await fetchInto(file, path, get, stalled);
|
|
204
|
+
} catch (error) {
|
|
205
|
+
if (stalled.signal.aborted) {
|
|
206
|
+
throw new CliError("timeout", `${file.name} stopped downloading for ${STALL_MS / 1e3} s \u2014 nothing was installed`);
|
|
207
|
+
}
|
|
208
|
+
throw error;
|
|
209
|
+
} finally {
|
|
210
|
+
stalled.stop();
|
|
211
|
+
}
|
|
212
|
+
}, "fetchVerified");
|
|
213
|
+
var fetchInto = /* @__PURE__ */ __name(async (file, path, get, stalled) => {
|
|
214
|
+
const response = await get(file.url, { signal: stalled.signal });
|
|
215
|
+
if (!response.ok || !response.body) {
|
|
216
|
+
await response.body?.cancel();
|
|
217
|
+
throw new CliError("network_error", `${file.name} could not be downloaded: HTTP ${response.status}`);
|
|
218
|
+
}
|
|
219
|
+
const partial = `${path}.${randomUUID()}.part`;
|
|
220
|
+
const hash = createHash("sha256");
|
|
221
|
+
let bytes = 0;
|
|
222
|
+
const hashing = new Transform({
|
|
223
|
+
transform(chunk, _encoding, done) {
|
|
224
|
+
stalled.poke();
|
|
225
|
+
bytes += chunk.length;
|
|
226
|
+
if (bytes > file.bytes) {
|
|
227
|
+
done(new CliError("invalid_response", `${file.name} is larger than this version expects \u2014 nothing was installed`));
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
hash.update(chunk);
|
|
231
|
+
done(null, chunk);
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
try {
|
|
235
|
+
await pipeline(Readable.fromWeb(response.body), hashing, createWriteStream(partial, { flags: "wx", mode: 384 }));
|
|
236
|
+
const actual = hash.digest("hex");
|
|
237
|
+
if (actual !== file.sha256) {
|
|
238
|
+
throw new CliError("invalid_response", `${file.name} is not the file this version expects (sha256 ${actual}) \u2014 nothing was installed`);
|
|
239
|
+
}
|
|
240
|
+
await rename(partial, path);
|
|
241
|
+
} finally {
|
|
242
|
+
await rm(partial, { force: true });
|
|
243
|
+
}
|
|
244
|
+
}, "fetchInto");
|
|
245
|
+
var megabytes = /* @__PURE__ */ __name((bytes) => bytes < 1e6 ? "under 1 MB" : `${Math.round(bytes / 1e6)} MB`, "megabytes");
|
|
246
|
+
|
|
247
|
+
export {
|
|
248
|
+
MODELS,
|
|
249
|
+
VAD,
|
|
250
|
+
DEFAULT_ORDER,
|
|
251
|
+
orderedModels,
|
|
252
|
+
findModel,
|
|
253
|
+
speechModel,
|
|
254
|
+
sharedModelsDirectory,
|
|
255
|
+
modelsDirectory,
|
|
256
|
+
modelPath,
|
|
257
|
+
vadPath,
|
|
258
|
+
isInstalled,
|
|
259
|
+
filesPresent,
|
|
260
|
+
installedBytes,
|
|
261
|
+
install,
|
|
262
|
+
installFiles,
|
|
263
|
+
megabytes
|
|
264
|
+
};
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
listen
|
|
5
|
+
} from "./chunk-DDYR6DYL.js";
|
|
6
|
+
import {
|
|
7
|
+
ownerLogin
|
|
8
|
+
} from "./chunk-UKR7KH3H.js";
|
|
9
|
+
import {
|
|
10
|
+
activityRecorder,
|
|
11
|
+
calledTools,
|
|
12
|
+
httpActivityFile,
|
|
13
|
+
httpLock
|
|
14
|
+
} from "./chunk-ZHXIXDH5.js";
|
|
15
|
+
import {
|
|
16
|
+
WebStandardStreamableHTTPServerTransport,
|
|
17
|
+
createMcpHandler,
|
|
18
|
+
getOAuthProtectedResourceMetadataUrl,
|
|
19
|
+
hostHeaderValidationResponse,
|
|
20
|
+
isLegacyRequest,
|
|
21
|
+
oauthMetadataResponse,
|
|
22
|
+
requireBearerAuth
|
|
23
|
+
} from "./chunk-5D4AEUVA.js";
|
|
24
|
+
import {
|
|
25
|
+
CliError
|
|
26
|
+
} from "./chunk-YIMI6O7R.js";
|
|
27
|
+
import {
|
|
28
|
+
__name
|
|
29
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
30
|
+
|
|
31
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/mcp/http/serve.js
|
|
32
|
+
import { randomUUID } from "node:crypto";
|
|
33
|
+
var MCP_PATH = "/mcp";
|
|
34
|
+
var AS_METADATA = "/.well-known/oauth-authorization-server";
|
|
35
|
+
var LOCAL = ["localhost", "127.0.0.1"];
|
|
36
|
+
var MAX_SESSIONS = 20;
|
|
37
|
+
var MAX_LOGIN_BODY = 64 * 1024;
|
|
38
|
+
var SESSION_IDLE_MS = 60 * 60 * 1e3;
|
|
39
|
+
var sessionMissing = /* @__PURE__ */ __name(() => new Response(JSON.stringify({ jsonrpc: "2.0", error: { code: -32001, message: "Session not found" }, id: null }), {
|
|
40
|
+
status: 404,
|
|
41
|
+
headers: { "content-type": "application/json" }
|
|
42
|
+
}), "sessionMissing");
|
|
43
|
+
var legacySessions = /* @__PURE__ */ __name((build, now) => {
|
|
44
|
+
const sessions = /* @__PURE__ */ new Map();
|
|
45
|
+
const drop = /* @__PURE__ */ __name(async (id) => {
|
|
46
|
+
const one = sessions.get(id);
|
|
47
|
+
sessions.delete(id);
|
|
48
|
+
await one?.close();
|
|
49
|
+
}, "drop");
|
|
50
|
+
const handle = /* @__PURE__ */ __name(async (request, auth) => {
|
|
51
|
+
for (const [id2, one] of sessions)
|
|
52
|
+
if (now() - one.seen > SESSION_IDLE_MS)
|
|
53
|
+
await drop(id2);
|
|
54
|
+
const id = request.headers.get("mcp-session-id");
|
|
55
|
+
if (id) {
|
|
56
|
+
const known = sessions.get(id);
|
|
57
|
+
if (!known || known.clientId !== auth.clientId)
|
|
58
|
+
return sessionMissing();
|
|
59
|
+
known.seen = now();
|
|
60
|
+
return known.transport.handleRequest(request, { authInfo: auth });
|
|
61
|
+
}
|
|
62
|
+
const server = build();
|
|
63
|
+
const transport = new WebStandardStreamableHTTPServerTransport({
|
|
64
|
+
sessionIdGenerator: /* @__PURE__ */ __name(() => randomUUID(), "sessionIdGenerator"),
|
|
65
|
+
onsessionclosed: /* @__PURE__ */ __name((closed) => void sessions.delete(closed), "onsessionclosed")
|
|
66
|
+
});
|
|
67
|
+
await server.connect(transport);
|
|
68
|
+
const response = await transport.handleRequest(request, { authInfo: auth });
|
|
69
|
+
if (!transport.sessionId) {
|
|
70
|
+
await server.close();
|
|
71
|
+
return response;
|
|
72
|
+
}
|
|
73
|
+
sessions.set(transport.sessionId, { transport, close: /* @__PURE__ */ __name(() => server.close(), "close"), clientId: auth.clientId, seen: now() });
|
|
74
|
+
while (sessions.size > MAX_SESSIONS)
|
|
75
|
+
await drop(sessions.keys().next().value);
|
|
76
|
+
return response;
|
|
77
|
+
}, "handle");
|
|
78
|
+
return {
|
|
79
|
+
handle,
|
|
80
|
+
close: /* @__PURE__ */ __name(async () => {
|
|
81
|
+
for (const id of [...sessions.keys()])
|
|
82
|
+
await drop(id);
|
|
83
|
+
}, "close")
|
|
84
|
+
};
|
|
85
|
+
}, "legacySessions");
|
|
86
|
+
var metadataRequest = /* @__PURE__ */ __name((request, path, base) => {
|
|
87
|
+
const url = new URL(request.url);
|
|
88
|
+
const inserted = base && path === `${AS_METADATA}${base}`;
|
|
89
|
+
if (!inserted && url.pathname === path)
|
|
90
|
+
return request;
|
|
91
|
+
url.pathname = inserted ? AS_METADATA : path;
|
|
92
|
+
return new Request(url, { method: request.method, headers: request.headers });
|
|
93
|
+
}, "metadataRequest");
|
|
94
|
+
var toolsIn = /* @__PURE__ */ __name(async (request) => {
|
|
95
|
+
if (request.method !== "POST")
|
|
96
|
+
return [];
|
|
97
|
+
try {
|
|
98
|
+
return calledTools(await request.clone().json());
|
|
99
|
+
} catch {
|
|
100
|
+
return [];
|
|
101
|
+
}
|
|
102
|
+
}, "toolsIn");
|
|
103
|
+
var serveOverHttp = /* @__PURE__ */ __name(async (build, options) => {
|
|
104
|
+
const { publicUrl, port, tokenFile, appName, onCode, onError, now, lockFile, version } = options;
|
|
105
|
+
const lock = lockFile ? httpLock(lockFile, {
|
|
106
|
+
pid: process.pid,
|
|
107
|
+
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
108
|
+
port,
|
|
109
|
+
publicUrl: publicUrl.href,
|
|
110
|
+
...version ? { version } : {}
|
|
111
|
+
}) : void 0;
|
|
112
|
+
if (lock?.held)
|
|
113
|
+
throw new CliError("validation_error", `${appName} already serves MCP over HTTP for this profile on port ${lock.held.port} (PID ${lock.held.pid}, since ${lock.held.startedAt})`);
|
|
114
|
+
const base = publicUrl.pathname === "/" ? "" : publicUrl.pathname.replace(/\/+$/, "");
|
|
115
|
+
const issuer = new URL(`${publicUrl.origin}${base}`);
|
|
116
|
+
const resource = new URL(`${base}${MCP_PATH}`, publicUrl.origin);
|
|
117
|
+
const mcpPath = resource.pathname;
|
|
118
|
+
const publicPath = /* @__PURE__ */ __name((path) => base && path !== base && !path.startsWith(`${base}/`) && !path.startsWith("/.well-known/") ? `${base}${path}` : path, "publicPath");
|
|
119
|
+
const login = ownerLogin({
|
|
120
|
+
issuer,
|
|
121
|
+
resource,
|
|
122
|
+
file: tokenFile,
|
|
123
|
+
appName,
|
|
124
|
+
onCode: /* @__PURE__ */ __name((code, expires) => {
|
|
125
|
+
lock?.update({ loginCode: code, loginCodeExpiresAt: expires.toISOString() });
|
|
126
|
+
onCode(code, expires);
|
|
127
|
+
}, "onCode"),
|
|
128
|
+
...now ? { now } : {}
|
|
129
|
+
});
|
|
130
|
+
const insecure = issuer.protocol === "http:" && LOCAL.includes(issuer.hostname);
|
|
131
|
+
const mcp = createMcpHandler(build, { legacy: "reject", ...onError ? { onerror: onError } : {} });
|
|
132
|
+
const legacy = legacySessions(build, now ?? Date.now);
|
|
133
|
+
const bearer = requireBearerAuth({
|
|
134
|
+
verifier: login.verifier,
|
|
135
|
+
resourceMetadataUrl: getOAuthProtectedResourceMetadataUrl(resource)
|
|
136
|
+
});
|
|
137
|
+
const activity = activityRecorder(httpActivityFile(tokenFile), now);
|
|
138
|
+
const allowedHosts = [.../* @__PURE__ */ new Set([publicUrl.hostname, ...LOCAL])];
|
|
139
|
+
const allowedOrigins = [publicUrl.origin];
|
|
140
|
+
const listening = await listen(async (request) => {
|
|
141
|
+
const refused = hostHeaderValidationResponse(request, allowedHosts);
|
|
142
|
+
if (refused)
|
|
143
|
+
return refused;
|
|
144
|
+
const path = publicPath(new URL(request.url).pathname);
|
|
145
|
+
const discovery = oauthMetadataResponse(metadataRequest(request, path, base), {
|
|
146
|
+
oauthMetadata: login.metadata,
|
|
147
|
+
resourceServerUrl: resource,
|
|
148
|
+
resourceName: appName,
|
|
149
|
+
...insecure ? { dangerouslyAllowInsecureIssuerUrl: true } : {}
|
|
150
|
+
});
|
|
151
|
+
if (discovery)
|
|
152
|
+
return discovery;
|
|
153
|
+
if (Number(request.headers.get("content-length") ?? 0) > MAX_LOGIN_BODY && path !== mcpPath)
|
|
154
|
+
return new Response("Request too large", { status: 413 });
|
|
155
|
+
const origin = request.headers.get("origin");
|
|
156
|
+
if (origin && !allowedOrigins.includes(origin))
|
|
157
|
+
return new Response("Origin not allowed", { status: 403 });
|
|
158
|
+
const answered = await login.handle(request, path);
|
|
159
|
+
if (answered)
|
|
160
|
+
return answered;
|
|
161
|
+
if (path !== mcpPath)
|
|
162
|
+
return new Response("Not found", { status: 404 });
|
|
163
|
+
const auth = await bearer(request);
|
|
164
|
+
if (auth instanceof Response)
|
|
165
|
+
return auth;
|
|
166
|
+
activity.record(auth.clientId, await toolsIn(request));
|
|
167
|
+
return await isLegacyRequest(request) ? legacy.handle(request, auth) : mcp.fetch(request, { authInfo: auth });
|
|
168
|
+
}, { host: "127.0.0.1", port }).catch((error) => {
|
|
169
|
+
login.close();
|
|
170
|
+
lock?.release();
|
|
171
|
+
throw error;
|
|
172
|
+
});
|
|
173
|
+
lock?.update({ listeningAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
174
|
+
return {
|
|
175
|
+
url: listening.url,
|
|
176
|
+
close: /* @__PURE__ */ __name(async () => {
|
|
177
|
+
login.close();
|
|
178
|
+
activity.flush();
|
|
179
|
+
try {
|
|
180
|
+
await listening.close();
|
|
181
|
+
await legacy.close();
|
|
182
|
+
await mcp.close();
|
|
183
|
+
} finally {
|
|
184
|
+
lock?.release();
|
|
185
|
+
}
|
|
186
|
+
}, "close")
|
|
187
|
+
};
|
|
188
|
+
}, "serveOverHttp");
|
|
189
|
+
|
|
190
|
+
export {
|
|
191
|
+
MCP_PATH,
|
|
192
|
+
serveOverHttp
|
|
193
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
resolvePaths
|
|
5
|
+
} from "./chunk-YIMI6O7R.js";
|
|
6
|
+
import {
|
|
7
|
+
__name
|
|
8
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
9
|
+
|
|
10
|
+
// dist/folders.js
|
|
11
|
+
var loginService = /* @__PURE__ */ __name((configDir) => `zoom-cli:${configDir}`, "loginService");
|
|
12
|
+
var zmPaths = /* @__PURE__ */ __name((options = {}) => resolvePaths({ appName: "zm", ...options }), "zmPaths");
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
loginService,
|
|
16
|
+
zmPaths
|
|
17
|
+
};
|