@wirecat/drive-cli 0.44.0 → 0.45.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/drive.js +35 -40
- package/dist/bundle/all-profiles-LTHNCWQW.js +26 -0
- package/dist/bundle/anthropic-NOJEF3V2.js +71 -0
- package/dist/bundle/bun-ADJVI4HY.js +169 -0
- package/dist/bundle/bun-sqlite-GNXLBF2A.js +70 -0
- package/dist/bundle/chunk-2FTZBZOB.js +2315 -0
- package/dist/bundle/chunk-2YU3CXFD.js +3391 -0
- package/dist/bundle/chunk-35GRI4DI.js +375 -0
- package/dist/bundle/chunk-37MAA6F2.js +5624 -0
- package/dist/bundle/chunk-3V6NPZY7.js +2352 -0
- package/dist/bundle/chunk-4TIC23D2.js +9 -0
- package/dist/bundle/chunk-4TQSNQVV.js +1071 -0
- package/dist/bundle/chunk-4UE7AVHZ.js +150 -0
- package/dist/bundle/chunk-5DPV7X27.js +663 -0
- package/dist/bundle/chunk-5FONRUG6.js +24805 -0
- package/dist/bundle/chunk-5ZVLM6YR.js +19 -0
- package/dist/bundle/chunk-64WJYT2F.js +3954 -0
- package/dist/bundle/chunk-65GGKAQ7.js +82 -0
- package/dist/bundle/chunk-66N2DGGC.js +515 -0
- package/dist/bundle/chunk-6KFA6HOM.js +2941 -0
- package/dist/bundle/chunk-6Y2BYFXQ.js +65 -0
- package/dist/bundle/chunk-7NCG2SHR.js +74 -0
- package/dist/bundle/chunk-7PVNJAQ2.js +73 -0
- package/dist/bundle/chunk-7XWUOCGW.js +190 -0
- package/dist/bundle/chunk-A6ZKTNTZ.js +168 -0
- package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
- package/dist/bundle/chunk-AH3SNVCV.js +498 -0
- package/dist/bundle/chunk-AN3GVZTU.js +76 -0
- package/dist/bundle/chunk-BPBIBVFH.js +166 -0
- package/dist/bundle/chunk-C4XP5T73.js +264 -0
- package/dist/bundle/chunk-C6SMAEED.js +18102 -0
- package/dist/bundle/chunk-CDI67JSB.js +1092 -0
- package/dist/bundle/chunk-CEO5HPRL.js +25 -0
- package/dist/bundle/chunk-CFT7UHF6.js +15572 -0
- package/dist/bundle/chunk-DC4T3FNP.js +1913 -0
- package/dist/bundle/chunk-DCTXOMOR.js +35 -0
- package/dist/bundle/chunk-DFDN6AUB.js +21 -0
- package/dist/bundle/chunk-EVWXODYV.js +754 -0
- package/dist/bundle/chunk-GKHM6I64.js +2356 -0
- package/dist/bundle/chunk-GNI7INK6.js +18 -0
- package/dist/bundle/chunk-GTYY6BIE.js +58 -0
- package/dist/bundle/chunk-GX4WEMAG.js +164 -0
- package/dist/bundle/chunk-HA3WCVGY.js +8179 -0
- package/dist/bundle/chunk-HLONHTSG.js +281 -0
- package/dist/bundle/chunk-HOIUIKWS.js +236 -0
- package/dist/bundle/chunk-HTQTIKWP.js +928 -0
- package/dist/bundle/chunk-I5EJHKNC.js +111 -0
- package/dist/bundle/chunk-ICKNJIGE.js +31 -0
- package/dist/bundle/chunk-IGB5CJCA.js +62 -0
- package/dist/bundle/chunk-IP4OK7RQ.js +24 -0
- package/dist/bundle/chunk-IVQ6342B.js +2 -0
- package/dist/bundle/chunk-K4N2DKE5.js +17 -0
- package/dist/bundle/chunk-LNB7BIZL.js +844 -0
- package/dist/bundle/chunk-LVDHWNJF.js +193 -0
- package/dist/bundle/chunk-LW2G4U6W.js +570 -0
- package/dist/bundle/chunk-LWT55XC5.js +60 -0
- package/dist/bundle/chunk-LY26NW3I.js +6848 -0
- package/dist/bundle/chunk-MJR2OTO4.js +1714 -0
- package/dist/bundle/chunk-MWUITL6N.js +42 -0
- package/dist/bundle/chunk-N47CYWEM.js +454 -0
- package/dist/bundle/chunk-NKZ6V4JW.js +263 -0
- package/dist/bundle/chunk-NQ6LLDDC.js +161 -0
- package/dist/bundle/chunk-NZIHPYY5.js +215 -0
- package/dist/bundle/chunk-OECPFZLP.js +3541 -0
- package/dist/bundle/chunk-P5KGFT7U.js +18 -0
- package/dist/bundle/chunk-PDH2QQQV.js +484 -0
- package/dist/bundle/chunk-PIN5RZ3D.js +63 -0
- package/dist/bundle/chunk-PJDO7AFZ.js +421 -0
- package/dist/bundle/chunk-PWKXHDBQ.js +18078 -0
- package/dist/bundle/chunk-QLZGLPJL.js +100 -0
- package/dist/bundle/chunk-SBZB7HMU.js +1055 -0
- package/dist/bundle/chunk-SGOPYPVW.js +835 -0
- package/dist/bundle/chunk-TDC6JGDA.js +630 -0
- package/dist/bundle/chunk-TOYPN2XX.js +288 -0
- package/dist/bundle/chunk-UC44ZMQV.js +78 -0
- package/dist/bundle/chunk-V7GN5BI7.js +99 -0
- package/dist/bundle/chunk-VO4KOLQZ.js +119 -0
- package/dist/bundle/chunk-WPGCDWPU.js +1855 -0
- package/dist/bundle/chunk-WQMVSQPP.js +886 -0
- package/dist/bundle/chunk-WZUJKUBK.js +384 -0
- package/dist/bundle/chunk-X5DFDGWS.js +2 -0
- package/dist/bundle/chunk-XFLCVHSQ.js +50 -0
- package/dist/bundle/chunk-XPEWOPJR.js +431 -0
- package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
- package/dist/bundle/chunk-Y5EJSZXV.js +220 -0
- package/dist/bundle/chunk-YE3J6DLY.js +106 -0
- package/dist/bundle/chunk-YFLKH3NZ.js +48 -0
- package/dist/bundle/chunk-YJX4X564.js +138 -0
- package/dist/bundle/chunk-YJZBJ2TM.js +71 -0
- package/dist/bundle/chunk-Z4O6C7WR.js +1973 -0
- package/dist/bundle/chunk-ZIHLE7LG.js +15992 -0
- package/dist/bundle/chunk-ZPMLLONT.js +1054 -0
- package/dist/bundle/chunk-ZQNXKWUY.js +35584 -0
- package/dist/bundle/chunk-ZS635F4O.js +45 -0
- package/dist/bundle/chunk-ZU732VCC.js +122 -0
- package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
- package/dist/bundle/command-contract-HX35D7KV.js +38 -0
- package/dist/bundle/dist-MWTMOYWT.js +7577 -0
- package/dist/bundle/dist-PY3MVR3G.js +21 -0
- package/dist/bundle/drive.js +50 -0
- package/dist/bundle/echarts-RFTK737T.js +42501 -0
- package/dist/bundle/embed-5NAGJUMD.js +37 -0
- package/dist/bundle/embedder-EWXLIGBY.js +110 -0
- package/dist/bundle/entry-YCPJ6H6U.js +15 -0
- package/dist/bundle/failure-XBWHHBEW.js +37 -0
- package/dist/bundle/first-run-LNAZDBB4.js +24 -0
- package/dist/bundle/first-screen-P5NNFJD7.js +36 -0
- package/dist/bundle/google-5FFKRHHC.js +32 -0
- package/dist/bundle/google-api-TJCFOOAP.js +82 -0
- package/dist/bundle/identity-53ZMPL2O.js +10 -0
- package/dist/bundle/instructions-FHNL7CMW.js +9 -0
- package/dist/bundle/login-VXXZZR6G.js +158 -0
- package/dist/bundle/mcp-2CJCJXSW.js +95 -0
- package/dist/bundle/mcp-F4XZO76F.js +507 -0
- package/dist/bundle/mcp-IXFC2VVR.js +165 -0
- package/dist/bundle/mdast-util-from-markdown-FXEPSNER.js +1958 -0
- package/dist/bundle/mdast-util-gfm-SZM5GBDF.js +2103 -0
- package/dist/bundle/micromark-extension-gfm-GRL24TU6.js +1838 -0
- package/dist/bundle/node-P4E63KXA.js +2340 -0
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/node-ZMCACJVS.js +176 -0
- package/dist/bundle/node-sqlite-QJQ5S7KS.js +46 -0
- package/dist/bundle/oauth-TZFDPAFE.js +18 -0
- package/dist/bundle/open-IYM25QTL.js +20 -0
- package/dist/bundle/process-ZPTLNVQS.js +91 -0
- package/dist/bundle/program-YX7DZMPR.js +24100 -0
- package/dist/bundle/prompt-TGWTVIEK.js +13 -0
- package/dist/bundle/reasons-Q5LOQESQ.js +11 -0
- package/dist/bundle/recognize-AGPMWKIY.js +191 -0
- package/dist/bundle/remote-QV7QSLAK.js +28 -0
- package/dist/bundle/rerank-HZKJJCS4.js +51 -0
- package/dist/bundle/serve-NRJQOVT4.js +20 -0
- package/dist/bundle/server-2UQDEWTS.js +818 -0
- package/dist/bundle/server-R4JUHFSW.js +56 -0
- package/dist/bundle/services-NZQWVMOE.js +333 -0
- package/dist/bundle/sqlite-runtime-6MXHTYYU.js +17 -0
- package/dist/bundle/state-IF2FLTSY.js +34 -0
- package/dist/bundle/store-HBD54IRL.js +142 -0
- package/dist/bundle/store-HVIBXOXS.js +125 -0
- package/dist/bundle/store-maintenance-command-U3F4RGJB.js +57 -0
- package/dist/bundle/terminal-TFCTWLOS.js +11 -0
- package/dist/bundle/tokens-5D5YUA2Q.js +103 -0
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +87 -37
- package/dist/commands/mcp.js.map +1 -1
- package/dist/contract-overrides.d.ts.map +1 -1
- package/dist/contract-overrides.js +78 -53
- package/dist/contract-overrides.js.map +1 -1
- package/dist/mcp.d.ts +13 -5
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +20 -10
- package/dist/mcp.js.map +1 -1
- package/dist/program.js +4 -4
- package/dist/program.js.map +1 -1
- package/dist/registry.d.ts +2 -2
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +3 -3
- package/dist/registry.js.map +1 -1
- package/dist/state.d.ts +5 -2
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +5 -2
- package/dist/state.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +7 -5
- package/skills/drive-cli/SKILL.md +1 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
readSecret
|
|
5
|
+
} from "./chunk-65GGKAQ7.js";
|
|
6
|
+
import "./chunk-YJZBJ2TM.js";
|
|
7
|
+
import "./chunk-6KFA6HOM.js";
|
|
8
|
+
import "./chunk-GKHM6I64.js";
|
|
9
|
+
import "./chunk-Y5E2WNWB.js";
|
|
10
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
11
|
+
export {
|
|
12
|
+
readSecret
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
REASONS
|
|
5
|
+
} from "./chunk-V7GN5BI7.js";
|
|
6
|
+
import "./chunk-IVQ6342B.js";
|
|
7
|
+
import "./chunk-GKHM6I64.js";
|
|
8
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
9
|
+
export {
|
|
10
|
+
REASONS
|
|
11
|
+
};
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import "./chunk-6KFA6HOM.js";
|
|
4
|
+
import {
|
|
5
|
+
CliError
|
|
6
|
+
} from "./chunk-GKHM6I64.js";
|
|
7
|
+
import {
|
|
8
|
+
importFrom
|
|
9
|
+
} from "./chunk-Y5E2WNWB.js";
|
|
10
|
+
import {
|
|
11
|
+
__name
|
|
12
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
13
|
+
|
|
14
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/speech/recognize.js
|
|
15
|
+
import { createRequire } from "node:module";
|
|
16
|
+
|
|
17
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/speech/ogg-limit.js
|
|
18
|
+
var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "local transcription needs a complete mono or stereo Ogg Opus recording"), "invalid");
|
|
19
|
+
var checkOggDuration = /* @__PURE__ */ __name((bytes) => {
|
|
20
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
21
|
+
let offset = 0;
|
|
22
|
+
let serial;
|
|
23
|
+
let packet = 0;
|
|
24
|
+
let length = 0;
|
|
25
|
+
const prefix = [];
|
|
26
|
+
while (offset < bytes.length) {
|
|
27
|
+
if (offset + 27 > bytes.length || view.getUint32(offset, false) !== 1332176723 || bytes[offset + 4] !== 0)
|
|
28
|
+
throw invalid();
|
|
29
|
+
const stream = view.getUint32(offset + 14, true);
|
|
30
|
+
if (serial !== void 0 && serial !== stream)
|
|
31
|
+
throw invalid();
|
|
32
|
+
serial = stream;
|
|
33
|
+
const segments = bytes[offset + 26] ?? 0;
|
|
34
|
+
let data = offset + 27 + segments;
|
|
35
|
+
if (data > bytes.length || Boolean((bytes[offset + 5] ?? 0) & 1) !== length > 0)
|
|
36
|
+
throw invalid();
|
|
37
|
+
for (let index = 0; index < segments; index++) {
|
|
38
|
+
const size = bytes[offset + 27 + index] ?? 0;
|
|
39
|
+
if (data + size > bytes.length)
|
|
40
|
+
throw invalid();
|
|
41
|
+
const take = Math.min(size, 19 - prefix.length);
|
|
42
|
+
for (let i = 0; i < take; i++)
|
|
43
|
+
prefix.push(bytes[data + i] ?? 0);
|
|
44
|
+
length += size;
|
|
45
|
+
data += size;
|
|
46
|
+
if (size === 255)
|
|
47
|
+
continue;
|
|
48
|
+
if (packet === 0) {
|
|
49
|
+
if (length < 19 || String.fromCharCode(...prefix.slice(0, 8)) !== "OpusHead" || ![1, 2].includes(prefix[9] ?? 0) || prefix[18] !== 0)
|
|
50
|
+
throw invalid();
|
|
51
|
+
} else if (packet === 1) {
|
|
52
|
+
if (length < 8 || String.fromCharCode(...prefix.slice(0, 8)) !== "OpusTags")
|
|
53
|
+
throw invalid();
|
|
54
|
+
} else {
|
|
55
|
+
if (length < 1)
|
|
56
|
+
throw invalid();
|
|
57
|
+
const toc = prefix[0] ?? 0;
|
|
58
|
+
const config = toc >> 3;
|
|
59
|
+
const frame = config >= 16 ? 120 << (config & 3) : config >= 12 ? 480 << (config & 1) : (config & 3) === 3 ? 2880 : 480 << (config & 3);
|
|
60
|
+
const count = (toc & 3) === 0 ? 1 : (toc & 3) === 3 ? length >= 2 ? (prefix[1] ?? 0) & 63 : 0 : 2;
|
|
61
|
+
if (count < 1 || frame * count > 5760)
|
|
62
|
+
throw invalid();
|
|
63
|
+
}
|
|
64
|
+
packet++;
|
|
65
|
+
length = 0;
|
|
66
|
+
prefix.length = 0;
|
|
67
|
+
}
|
|
68
|
+
offset = data;
|
|
69
|
+
}
|
|
70
|
+
if (length !== 0 || packet < 3)
|
|
71
|
+
throw invalid();
|
|
72
|
+
}, "checkOggDuration");
|
|
73
|
+
|
|
74
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/speech/recognize.js
|
|
75
|
+
var SAMPLE_RATE = 16e3;
|
|
76
|
+
var LEAD = SAMPLE_RATE / 2;
|
|
77
|
+
var toModelRate = /* @__PURE__ */ __name((samples, rate) => {
|
|
78
|
+
const step = rate / SAMPLE_RATE;
|
|
79
|
+
const length = Math.floor(samples.length / step);
|
|
80
|
+
const pcm = new Float32Array(LEAD + length);
|
|
81
|
+
for (let i = 0; i < length; i++) {
|
|
82
|
+
const from = Math.floor(i * step);
|
|
83
|
+
const to = Math.max(from + 1, Math.floor((i + 1) * step));
|
|
84
|
+
let sum = 0;
|
|
85
|
+
for (let j = from; j < to; j++)
|
|
86
|
+
sum += samples[j] ?? 0;
|
|
87
|
+
pcm[LEAD + i] = sum / (to - from);
|
|
88
|
+
}
|
|
89
|
+
return pcm;
|
|
90
|
+
}, "toModelRate");
|
|
91
|
+
var decodeOgg = /* @__PURE__ */ __name(async (bytes) => {
|
|
92
|
+
checkOggDuration(bytes);
|
|
93
|
+
const { OggOpusDecoder } = await importFrom(new URL("speech/recognize.js", import.meta.resolve("@wirecat/cli-core")).href, "ogg-opus-decoder");
|
|
94
|
+
const decoder = new OggOpusDecoder();
|
|
95
|
+
await decoder.ready;
|
|
96
|
+
try {
|
|
97
|
+
const { channelData, sampleRate, samplesDecoded } = await decoder.decodeFile(bytes);
|
|
98
|
+
const samples = channelData[0];
|
|
99
|
+
if (!samples || samplesDecoded === 0)
|
|
100
|
+
throw new Error("no Ogg Opus audio in it");
|
|
101
|
+
return { samples, rate: sampleRate };
|
|
102
|
+
} finally {
|
|
103
|
+
decoder.free();
|
|
104
|
+
}
|
|
105
|
+
}, "decodeOgg");
|
|
106
|
+
var WINDOW = 512;
|
|
107
|
+
var detector = /* @__PURE__ */ __name((vadModel) => ({
|
|
108
|
+
sileroVad: {
|
|
109
|
+
model: vadModel,
|
|
110
|
+
// At the default 0.5 a quietly spoken stretch in the middle of a voice message never counted as
|
|
111
|
+
// speech and was lost; 0.3 keeps it for both models and changes nothing on clear speech (126508, 2026-09-30).
|
|
112
|
+
threshold: 0.3,
|
|
113
|
+
minSilenceDuration: 0.5,
|
|
114
|
+
minSpeechDuration: 0.25,
|
|
115
|
+
maxSpeechDuration: 20,
|
|
116
|
+
windowSize: WINDOW
|
|
117
|
+
},
|
|
118
|
+
sampleRate: SAMPLE_RATE,
|
|
119
|
+
numThreads: 1,
|
|
120
|
+
provider: "cpu",
|
|
121
|
+
debug: 0,
|
|
122
|
+
bufferSizeInSeconds: 30
|
|
123
|
+
}), "detector");
|
|
124
|
+
var loaded;
|
|
125
|
+
var loadSherpa = /* @__PURE__ */ __name(() => {
|
|
126
|
+
if (loaded)
|
|
127
|
+
return loaded;
|
|
128
|
+
const load = createRequire(new URL("speech/recognize.js", import.meta.resolve("@wirecat/cli-core")).href);
|
|
129
|
+
const wasm = {};
|
|
130
|
+
load("sherpa-onnx/sherpa-onnx-wasm-nodejs.js")(wasm);
|
|
131
|
+
const stdout = wasm.FS?.getStream(1);
|
|
132
|
+
if (stdout)
|
|
133
|
+
stdout.nfd = 2;
|
|
134
|
+
const asr = load("sherpa-onnx/sherpa-onnx-asr.js");
|
|
135
|
+
const vad = load("sherpa-onnx/sherpa-onnx-vad.js");
|
|
136
|
+
loaded = {
|
|
137
|
+
createOfflineRecognizer: /* @__PURE__ */ __name((config) => new asr.OfflineRecognizer(config, wasm), "createOfflineRecognizer"),
|
|
138
|
+
createVad: /* @__PURE__ */ __name((config) => vad.createVad(wasm, config), "createVad")
|
|
139
|
+
};
|
|
140
|
+
return loaded;
|
|
141
|
+
}, "loadSherpa");
|
|
142
|
+
var openRecognizer = /* @__PURE__ */ __name((model, path, vadModel) => {
|
|
143
|
+
const sherpa = loadSherpa();
|
|
144
|
+
const engine = sherpa.createOfflineRecognizer({
|
|
145
|
+
featConfig: { sampleRate: SAMPLE_RATE, featureDim: model.featureDim },
|
|
146
|
+
modelConfig: { ...model.config(path), numThreads: 1, provider: "cpu", debug: 0 },
|
|
147
|
+
decodingMethod: "greedy_search"
|
|
148
|
+
});
|
|
149
|
+
const vad = sherpa.createVad(detector(vadModel));
|
|
150
|
+
const piece = /* @__PURE__ */ __name((samples) => {
|
|
151
|
+
const stream = engine.createStream();
|
|
152
|
+
try {
|
|
153
|
+
stream.acceptWaveform(SAMPLE_RATE, samples);
|
|
154
|
+
engine.decode(stream);
|
|
155
|
+
return engine.getResult(stream).text.trim();
|
|
156
|
+
} finally {
|
|
157
|
+
stream.free();
|
|
158
|
+
}
|
|
159
|
+
}, "piece");
|
|
160
|
+
return {
|
|
161
|
+
recognize: /* @__PURE__ */ __name((pcm) => {
|
|
162
|
+
vad.reset();
|
|
163
|
+
const parts = [];
|
|
164
|
+
const drain = /* @__PURE__ */ __name(() => {
|
|
165
|
+
while (!vad.isEmpty()) {
|
|
166
|
+
parts.push(piece(vad.front().samples));
|
|
167
|
+
vad.pop();
|
|
168
|
+
}
|
|
169
|
+
}, "drain");
|
|
170
|
+
for (let i = 0; i + WINDOW <= pcm.length; i += WINDOW) {
|
|
171
|
+
vad.acceptWaveform(pcm.subarray(i, i + WINDOW));
|
|
172
|
+
drain();
|
|
173
|
+
}
|
|
174
|
+
vad.flush();
|
|
175
|
+
drain();
|
|
176
|
+
return parts.filter(Boolean).join(" ");
|
|
177
|
+
}, "recognize"),
|
|
178
|
+
free: /* @__PURE__ */ __name(() => {
|
|
179
|
+
vad.free();
|
|
180
|
+
engine.free();
|
|
181
|
+
}, "free")
|
|
182
|
+
};
|
|
183
|
+
}, "openRecognizer");
|
|
184
|
+
export {
|
|
185
|
+
SAMPLE_RATE,
|
|
186
|
+
decodeOgg,
|
|
187
|
+
detector,
|
|
188
|
+
loadSherpa,
|
|
189
|
+
openRecognizer,
|
|
190
|
+
toModelRate
|
|
191
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
DEFAULT_OPENAI_MODEL,
|
|
5
|
+
OPENAI_MODELS,
|
|
6
|
+
OPENAI_URL,
|
|
7
|
+
isLocal,
|
|
8
|
+
openRemote,
|
|
9
|
+
remoteKey,
|
|
10
|
+
remoteModel
|
|
11
|
+
} from "./chunk-ZU732VCC.js";
|
|
12
|
+
import "./chunk-35GRI4DI.js";
|
|
13
|
+
import "./chunk-5DPV7X27.js";
|
|
14
|
+
import "./chunk-C4XP5T73.js";
|
|
15
|
+
import "./chunk-P5KGFT7U.js";
|
|
16
|
+
import "./chunk-6KFA6HOM.js";
|
|
17
|
+
import "./chunk-GKHM6I64.js";
|
|
18
|
+
import "./chunk-Y5E2WNWB.js";
|
|
19
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
20
|
+
export {
|
|
21
|
+
DEFAULT_OPENAI_MODEL,
|
|
22
|
+
OPENAI_MODELS,
|
|
23
|
+
OPENAI_URL,
|
|
24
|
+
isLocal,
|
|
25
|
+
openRemote,
|
|
26
|
+
remoteKey,
|
|
27
|
+
remoteModel
|
|
28
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
defaultThreads,
|
|
5
|
+
loadModel,
|
|
6
|
+
truncated
|
|
7
|
+
} from "./chunk-35GRI4DI.js";
|
|
8
|
+
import "./chunk-5DPV7X27.js";
|
|
9
|
+
import "./chunk-C4XP5T73.js";
|
|
10
|
+
import "./chunk-P5KGFT7U.js";
|
|
11
|
+
import "./chunk-6KFA6HOM.js";
|
|
12
|
+
import "./chunk-GKHM6I64.js";
|
|
13
|
+
import "./chunk-Y5E2WNWB.js";
|
|
14
|
+
import {
|
|
15
|
+
__name
|
|
16
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
17
|
+
|
|
18
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/embeddings/rerank.js
|
|
19
|
+
var openReranker = /* @__PURE__ */ __name(async (model, directory, { threads = defaultThreads() } = {}) => {
|
|
20
|
+
const { ort, tokenizer, session } = await loadModel(model, directory, threads);
|
|
21
|
+
const typeIds = session.inputNames.includes("token_type_ids");
|
|
22
|
+
const output = session.outputNames[0];
|
|
23
|
+
const one = /* @__PURE__ */ __name(async (question, passage) => {
|
|
24
|
+
const encoded = tokenizer.encode(question, { text_pair: passage, return_token_type_ids: true });
|
|
25
|
+
const ids = truncated(encoded.ids, model.maxTokens);
|
|
26
|
+
const shape = [1, ids.length];
|
|
27
|
+
const feeds = {
|
|
28
|
+
input_ids: new ort.Tensor("int64", BigInt64Array.from(ids, BigInt), shape),
|
|
29
|
+
attention_mask: new ort.Tensor("int64", new BigInt64Array(ids.length).fill(1n), shape)
|
|
30
|
+
};
|
|
31
|
+
if (typeIds)
|
|
32
|
+
feeds.token_type_ids = new ort.Tensor("int64", BigInt64Array.from(truncated(encoded.token_type_ids, model.maxTokens), BigInt), shape);
|
|
33
|
+
const logit = (await session.run(feeds))[output]?.data[0];
|
|
34
|
+
if (typeof logit !== "number" || !Number.isFinite(logit))
|
|
35
|
+
throw new Error(`${model.id} gave no score`);
|
|
36
|
+
return logit;
|
|
37
|
+
}, "one");
|
|
38
|
+
return {
|
|
39
|
+
model,
|
|
40
|
+
score: /* @__PURE__ */ __name(async (question, passages) => {
|
|
41
|
+
const scores = [];
|
|
42
|
+
for (const passage of passages)
|
|
43
|
+
scores.push(await one(question, passage));
|
|
44
|
+
return scores;
|
|
45
|
+
}, "score"),
|
|
46
|
+
close: /* @__PURE__ */ __name(() => session.release(), "close")
|
|
47
|
+
};
|
|
48
|
+
}, "openReranker");
|
|
49
|
+
export {
|
|
50
|
+
openReranker
|
|
51
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
MCP_PATH,
|
|
5
|
+
serveOverHttp
|
|
6
|
+
} from "./chunk-LVDHWNJF.js";
|
|
7
|
+
import "./chunk-UC44ZMQV.js";
|
|
8
|
+
import "./chunk-TOYPN2XX.js";
|
|
9
|
+
import "./chunk-5FONRUG6.js";
|
|
10
|
+
import "./chunk-NQ6LLDDC.js";
|
|
11
|
+
import "./chunk-7PVNJAQ2.js";
|
|
12
|
+
import "./chunk-PIN5RZ3D.js";
|
|
13
|
+
import "./chunk-6KFA6HOM.js";
|
|
14
|
+
import "./chunk-GKHM6I64.js";
|
|
15
|
+
import "./chunk-Y5E2WNWB.js";
|
|
16
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
17
|
+
export {
|
|
18
|
+
MCP_PATH,
|
|
19
|
+
serveOverHttp
|
|
20
|
+
};
|