@wirecat/tg-cli 0.107.0 → 0.109.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 +2 -2
- package/dist/bundle/{adapter-PN5AXCJ7.js → adapter-6JLFYFL5.js} +45 -44
- package/dist/bundle/{all-profiles-SDHNKZQQ.js → all-profiles-X7Y3T5S4.js} +8 -8
- package/dist/bundle/{anthropic-F3BXQLYB.js → anthropic-LGVXAADT.js} +5 -5
- package/dist/bundle/{app-server-XDKMWVCD.js → app-server-UI3AFSJX.js} +40 -39
- package/dist/bundle/{bot-api-YXJL4CEV.js → bot-api-TQYRNYJQ.js} +46 -45
- package/dist/bundle/{bot-history-SDLHR7PV.js → bot-history-DDNTNMNB.js} +15 -15
- package/dist/bundle/{bun-SMH7PKUS.js → bun-WXGS6HML.js} +2 -2
- package/dist/bundle/{bun-sqlite-KB6PSTWH.js → bun-sqlite-M6JEXKRT.js} +4 -4
- package/dist/bundle/{chunk-NCWB3KXP.js → chunk-25VC6U3A.js} +1 -1
- package/dist/bundle/{chunk-NUVHRCUK.js → chunk-2ILQYCBY.js} +390 -291
- package/dist/bundle/{chunk-X7M7YZPF.js → chunk-3PEZWXKO.js} +6 -6
- package/dist/bundle/{chunk-YSDA3EWT.js → chunk-4R4AH6FM.js} +117 -94
- package/dist/bundle/{chunk-TEHAIU6I.js → chunk-5SUFMBU5.js} +44 -44
- package/dist/bundle/chunk-76C5SSMR.js +379 -0
- package/dist/bundle/{chunk-STGY3EAZ.js → chunk-7AJ2IESO.js} +1 -1
- package/dist/bundle/{chunk-3UEFJ75D.js → chunk-7T7ILNCU.js} +2 -2
- package/dist/bundle/{chunk-O7VQHFMZ.js → chunk-AD3QPYI3.js} +2 -2
- package/dist/bundle/{chunk-IY7IEM56.js → chunk-AGVKIJB7.js} +6 -6
- package/dist/bundle/{chunk-OIHAM73W.js → chunk-BESIMQ5U.js} +1 -1
- package/dist/bundle/{chunk-CJJVFGFX.js → chunk-BHPCZCX7.js} +2 -2
- package/dist/bundle/{chunk-GJS26XEB.js → chunk-BZIZLEJN.js} +4 -4
- package/dist/bundle/{chunk-REJM262E.js → chunk-C3RX3UOE.js} +11 -11
- package/dist/bundle/{chunk-WXIGT6FY.js → chunk-CH2ESVV5.js} +22 -22
- package/dist/bundle/{chunk-DFZBGU4G.js → chunk-CHI6D4D6.js} +4 -4
- package/dist/bundle/{chunk-BYDDYOF4.js → chunk-CVLDXFRP.js} +8 -8
- package/dist/bundle/{chunk-MFS52LTZ.js → chunk-DLAFGSTN.js} +1 -1
- package/dist/bundle/{chunk-P4A27ETD.js → chunk-DO33KAMM.js} +94 -59
- package/dist/bundle/{chunk-GGAG3G7B.js → chunk-DZVYGBZB.js} +79 -56
- package/dist/bundle/{chunk-WAGDZB62.js → chunk-GUFM5RLW.js} +2 -2
- package/dist/bundle/{chunk-LA2OUJK5.js → chunk-IGIPIO4J.js} +11 -11
- package/dist/bundle/{chunk-5QBTHR57.js → chunk-INYO2QFW.js} +3 -3
- package/dist/bundle/{chunk-VMKPRAIB.js → chunk-IULYECPC.js} +12 -12
- package/dist/bundle/{chunk-DBZVF73F.js → chunk-IV2QWSPG.js} +2 -2
- package/dist/bundle/{chunk-YA44IPCS.js → chunk-KHKC236O.js} +2 -2
- package/dist/bundle/{chunk-TKCZYJAT.js → chunk-M62LF3QE.js} +2140 -1648
- package/dist/bundle/{chunk-RGNKRI5T.js → chunk-MF6NKU3Z.js} +81 -30
- package/dist/bundle/{chunk-MOZX3JX3.js → chunk-N56WXUCW.js} +2 -2
- package/dist/bundle/{chunk-T4SDOYPY.js → chunk-N5FSRC6H.js} +117 -70
- package/dist/bundle/{chunk-FG2QTYEF.js → chunk-NAVNCM5K.js} +1 -1
- package/dist/bundle/{chunk-NMTFZNFU.js → chunk-OHLMHBDI.js} +28 -28
- package/dist/bundle/{chunk-P5UG655O.js → chunk-P55L4S6N.js} +3 -3
- package/dist/bundle/{chunk-JZOXKRDG.js → chunk-P57R2P75.js} +7 -7
- package/dist/bundle/{chunk-BMXGEQDA.js → chunk-P5ILJ7MN.js} +5 -5
- package/dist/bundle/{chunk-PYRJO6B3.js → chunk-QQF7RDLR.js} +49 -24
- package/dist/bundle/{chunk-TFV4UPQZ.js → chunk-RD2NLJSU.js} +16 -4
- package/dist/bundle/{chunk-KROO42KC.js → chunk-S7B6MTXX.js} +6 -6
- package/dist/bundle/{chunk-NSQL3YRD.js → chunk-SH63Q4QR.js} +22 -22
- package/dist/bundle/{chunk-JAWXJILO.js → chunk-TMXNMO66.js} +3 -3
- package/dist/bundle/{chunk-44UANKAI.js → chunk-UIPBAT2T.js} +31 -14
- package/dist/bundle/{chunk-53RW4KLL.js → chunk-UUQ3BH2Z.js} +2 -2
- package/dist/bundle/{chunk-VMU4SGCE.js → chunk-VFVMB3NV.js} +8 -6
- package/dist/bundle/{chunk-AWBJSYX6.js → chunk-VYR2IIWW.js} +1 -1
- package/dist/bundle/{chunk-53QVFV34.js → chunk-WHYS6OSG.js} +2 -2
- package/dist/bundle/{chunk-WS3S7DXT.js → chunk-WNTXIQMB.js} +2 -2
- package/dist/bundle/{chunk-P5KMLJQR.js → chunk-XJVGCCQE.js} +666 -782
- package/dist/bundle/{chunk-67SRVSPU.js → chunk-XMMWKHNY.js} +26 -9
- package/dist/bundle/{chunk-A4DS5ANQ.js → chunk-YXCQ4DLZ.js} +1 -1
- package/dist/bundle/{chunk-465FPHSG.js → chunk-YYOIULA2.js} +8 -8
- package/dist/bundle/{chunk-WFG7KFM4.js → chunk-ZFMS5G4H.js} +2 -2
- package/dist/bundle/{chunk-BGVODG6P.js → chunk-ZHP44EML.js} +3 -3
- package/dist/bundle/{chunk-6FSG6QZH.js → chunk-ZMZKZL3Y.js} +1 -1
- package/dist/bundle/{chunk-H4LIQVPN.js → chunk-ZUOS7QUB.js} +11 -11
- package/dist/bundle/command-contract-E2MWR3T3.js +32 -0
- package/dist/bundle/{decode-WEP3HD56.js → decode-RKPOGPBE.js} +19 -17
- package/dist/bundle/{echarts-MRMILSAF.js → echarts-H5QQRBHI.js} +2 -2
- package/dist/bundle/{embed-LCLTUVUD.js → embed-7TVAPNP7.js} +5 -5
- package/dist/bundle/{embedder-O4WNEXUC.js → embedder-YOOHWWN6.js} +8 -8
- package/dist/bundle/{entry-7HDX6BDR.js → entry-SAKW5HEZ.js} +5 -5
- package/dist/bundle/{first-run-M7YVVQJS.js → first-run-C744N572.js} +9 -9
- package/dist/bundle/first-screen-7GKUEIWS.js +30 -0
- package/dist/bundle/{identity-EEMHQOTN.js → identity-NRWTZIQ4.js} +3 -3
- package/dist/bundle/{instructions-YIH3J4TI.js → instructions-6LWRAW47.js} +1 -1
- package/dist/bundle/{mcp-OQBZXELQ.js → mcp-WSGVVZWI.js} +2 -2
- package/dist/bundle/{node-YWT7RFN6.js → node-XN4PIVWW.js} +2 -2
- package/dist/bundle/node-sqlite-PCBGROGQ.js +62 -0
- package/dist/bundle/{oauth-CADZB7TT.js → oauth-PX6NGHUV.js} +6 -6
- package/dist/bundle/{open-AMRU27KK.js → open-BKJGJ6GX.js} +3 -3
- package/dist/bundle/openai-MJP7CZXP.js +250 -0
- package/dist/bundle/{process-JC76J5UD.js → process-4PRR3MLT.js} +1 -1
- package/dist/bundle/{program-FI6MTY2V.js → program-7YZUO42B.js} +48 -47
- package/dist/bundle/{prompt-SPYTHKHN.js → prompt-CILSZC2R.js} +4 -4
- package/dist/bundle/{proxy-transport-YSBYG26I.js → proxy-transport-FWGKTYBL.js} +4 -4
- package/dist/bundle/{recognize-G5VVM6MU.js → recognize-AVFDJAIL.js} +5 -3
- package/dist/bundle/{remote-Z3HW42CH.js → remote-2VYXGOM4.js} +6 -6
- package/dist/bundle/{rerank-QJ5NLZUU.js → rerank-6FU2JPCD.js} +6 -6
- package/dist/bundle/{serve-3I4C6Y5X.js → serve-3YQOHBR6.js} +8 -8
- package/dist/bundle/server-S2K4YDDG.js +56 -0
- package/dist/bundle/{server-2L4BONHN.js → server-TPK3LNEX.js} +32 -31
- package/dist/bundle/{state-IXZYPH46.js → state-LLUNBLZE.js} +5 -5
- package/dist/bundle/{store-KS4XIA2R.js → store-27FQ743G.js} +10 -10
- package/dist/bundle/store-maintenance-command-AFJMKEBK.js +45 -0
- package/dist/bundle/tg.js +4 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/bundle/command-contract-B4DA4MXP.js +0 -32
- package/dist/bundle/first-screen-MXW3UZFB.js +0 -30
- package/dist/bundle/node-sqlite-LVHTONMA.js +0 -46
- package/dist/bundle/server-7TJ337SR.js +0 -55
- package/dist/bundle/store-maintenance-command-I3L24P22.js +0 -44
- /package/dist/bundle/{chunk-O5EHUB2V.js → chunk-62EDJKGP.js} +0 -0
|
@@ -18,12 +18,12 @@ import {
|
|
|
18
18
|
jitCompatCheck,
|
|
19
19
|
refineSqliteCodecs,
|
|
20
20
|
sql
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-ZMZKZL3Y.js";
|
|
22
22
|
import {
|
|
23
23
|
__name
|
|
24
24
|
} from "./chunk-ZVVMGPBJ.js";
|
|
25
25
|
|
|
26
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/node.js
|
|
27
27
|
import { DatabaseSync } from "node:sqlite";
|
|
28
28
|
var nodeSQLiteCodecs = refineSqliteCodecs({
|
|
29
29
|
"integer:boolean": { normalize: booleanFromInteger },
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
loadVectorExtension,
|
|
5
|
+
vectorExtension
|
|
6
|
+
} from "./chunk-BHPCZCX7.js";
|
|
7
|
+
import "./chunk-N5FSRC6H.js";
|
|
8
|
+
import "./chunk-XMMWKHNY.js";
|
|
9
|
+
import "./chunk-Y5E2WNWB.js";
|
|
10
|
+
import {
|
|
11
|
+
__name
|
|
12
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
13
|
+
|
|
14
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/node_modules/@wirecat/cli-core/dist/store/drivers/node-sqlite.js
|
|
15
|
+
import { DatabaseSync } from "node:sqlite";
|
|
16
|
+
var openWithNodeSqlite = /* @__PURE__ */ __name(async (path) => cacheOverNodeSqlite(await nodeClient(path)), "openWithNodeSqlite");
|
|
17
|
+
var nodeClient = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
18
|
+
const extension = await vectorExtension();
|
|
19
|
+
const client = new DatabaseSync(path, { readOnly, allowExtension: true });
|
|
20
|
+
try {
|
|
21
|
+
loadVectorExtension(client, extension);
|
|
22
|
+
return client;
|
|
23
|
+
} catch (error) {
|
|
24
|
+
client.close();
|
|
25
|
+
throw error;
|
|
26
|
+
}
|
|
27
|
+
}, "nodeClient");
|
|
28
|
+
var STATEMENT_CACHE_SIZE = 1e3;
|
|
29
|
+
var cacheOverNodeSqlite = /* @__PURE__ */ __name((database, cacheSize = STATEMENT_CACHE_SIZE) => {
|
|
30
|
+
const statements = /* @__PURE__ */ new Map();
|
|
31
|
+
const prepare = /* @__PURE__ */ __name((sql) => {
|
|
32
|
+
const statement = database.prepare(sql);
|
|
33
|
+
return {
|
|
34
|
+
run: /* @__PURE__ */ __name((...parameters) => ({ changes: Number(statement.run(...parameters).changes) }), "run"),
|
|
35
|
+
get: /* @__PURE__ */ __name((...parameters) => statement.get(...parameters), "get"),
|
|
36
|
+
all: /* @__PURE__ */ __name((...parameters) => statement.all(...parameters), "all")
|
|
37
|
+
};
|
|
38
|
+
}, "prepare");
|
|
39
|
+
return {
|
|
40
|
+
exec: /* @__PURE__ */ __name((sql) => database.exec(sql), "exec"),
|
|
41
|
+
prepare: /* @__PURE__ */ __name((sql) => {
|
|
42
|
+
const cached = statements.get(sql);
|
|
43
|
+
if (cached)
|
|
44
|
+
statements.delete(sql);
|
|
45
|
+
const statement = cached ?? prepare(sql);
|
|
46
|
+
statements.set(sql, statement);
|
|
47
|
+
if (statements.size > cacheSize)
|
|
48
|
+
statements.delete(statements.keys().next().value);
|
|
49
|
+
return statement;
|
|
50
|
+
}, "prepare"),
|
|
51
|
+
close: /* @__PURE__ */ __name(() => {
|
|
52
|
+
statements.clear();
|
|
53
|
+
database.close();
|
|
54
|
+
}, "close")
|
|
55
|
+
};
|
|
56
|
+
}, "cacheOverNodeSqlite");
|
|
57
|
+
export {
|
|
58
|
+
STATEMENT_CACHE_SIZE,
|
|
59
|
+
cacheOverNodeSqlite,
|
|
60
|
+
nodeClient,
|
|
61
|
+
openWithNodeSqlite
|
|
62
|
+
};
|
|
@@ -3,13 +3,13 @@ const require = __bundleRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
ownerLogin,
|
|
5
5
|
revokeAll
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-N56WXUCW.js";
|
|
7
7
|
import "./chunk-5D4AEUVA.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-CHI6D4D6.js";
|
|
9
|
+
import "./chunk-TMXNMO66.js";
|
|
10
|
+
import "./chunk-25VC6U3A.js";
|
|
11
|
+
import "./chunk-N5FSRC6H.js";
|
|
12
|
+
import "./chunk-XMMWKHNY.js";
|
|
13
13
|
import "./chunk-Y5E2WNWB.js";
|
|
14
14
|
import "./chunk-ZVVMGPBJ.js";
|
|
15
15
|
export {
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
openCache,
|
|
7
7
|
openFile,
|
|
8
8
|
storeCapable
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-S7B6MTXX.js";
|
|
10
|
+
import "./chunk-N5FSRC6H.js";
|
|
11
|
+
import "./chunk-XMMWKHNY.js";
|
|
12
12
|
import "./chunk-Y5E2WNWB.js";
|
|
13
13
|
import "./chunk-ZVVMGPBJ.js";
|
|
14
14
|
export {
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
SAMPLE_RATE,
|
|
5
|
+
toModelRate
|
|
6
|
+
} from "./chunk-QQF7RDLR.js";
|
|
7
|
+
import "./chunk-76C5SSMR.js";
|
|
8
|
+
import {
|
|
9
|
+
OPENAI_URL
|
|
10
|
+
} from "./chunk-INYO2QFW.js";
|
|
11
|
+
import "./chunk-3PEZWXKO.js";
|
|
12
|
+
import {
|
|
13
|
+
OPENAI_TRANSCRIBE_MODEL,
|
|
14
|
+
VAD,
|
|
15
|
+
filesPresent,
|
|
16
|
+
modelsDirectory,
|
|
17
|
+
vadPath
|
|
18
|
+
} from "./chunk-IULYECPC.js";
|
|
19
|
+
import "./chunk-UUQ3BH2Z.js";
|
|
20
|
+
import {
|
|
21
|
+
DEFAULT_RETRY,
|
|
22
|
+
backoffMs
|
|
23
|
+
} from "./chunk-N5FSRC6H.js";
|
|
24
|
+
import {
|
|
25
|
+
CliError
|
|
26
|
+
} from "./chunk-XMMWKHNY.js";
|
|
27
|
+
import "./chunk-Y5E2WNWB.js";
|
|
28
|
+
import {
|
|
29
|
+
__name
|
|
30
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
31
|
+
|
|
32
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/node_modules/@wirecat/cli-core/dist/speech/openai.js
|
|
33
|
+
import { setTimeout as wait } from "node:timers/promises";
|
|
34
|
+
|
|
35
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/http/index.js
|
|
36
|
+
var parseRetryAfter = /* @__PURE__ */ __name((header, now) => {
|
|
37
|
+
if (!header)
|
|
38
|
+
return void 0;
|
|
39
|
+
const trimmed = header.trim();
|
|
40
|
+
if (/^\d+$/.test(trimmed))
|
|
41
|
+
return Number(trimmed) * 1e3;
|
|
42
|
+
const at = Date.parse(trimmed);
|
|
43
|
+
if (Number.isNaN(at))
|
|
44
|
+
return void 0;
|
|
45
|
+
const delta = at - now().getTime();
|
|
46
|
+
return delta > 0 ? delta : void 0;
|
|
47
|
+
}, "parseRetryAfter");
|
|
48
|
+
var parseRateLimitReset = /* @__PURE__ */ __name((header, now) => {
|
|
49
|
+
if (!header)
|
|
50
|
+
return void 0;
|
|
51
|
+
const seconds = Number(header.trim());
|
|
52
|
+
if (!Number.isFinite(seconds))
|
|
53
|
+
return void 0;
|
|
54
|
+
const delta = seconds * 1e3 - now().getTime();
|
|
55
|
+
return delta > 0 ? delta : void 0;
|
|
56
|
+
}, "parseRateLimitReset");
|
|
57
|
+
var providerWaitMs = /* @__PURE__ */ __name((headers, now) => parseRetryAfter(headers.get("retry-after"), now) ?? parseRateLimitReset(headers.get("x-ratelimit-reset"), now), "providerWaitMs");
|
|
58
|
+
|
|
59
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/node_modules/@wirecat/cli-core/dist/speech/wav.js
|
|
60
|
+
var encodeWav = /* @__PURE__ */ __name((samples, sampleRate = 16e3) => {
|
|
61
|
+
const bytes = Buffer.alloc(44 + samples.length * 2);
|
|
62
|
+
bytes.write("RIFF", 0, "ascii");
|
|
63
|
+
bytes.writeUInt32LE(bytes.length - 8, 4);
|
|
64
|
+
bytes.write("WAVEfmt ", 8, "ascii");
|
|
65
|
+
bytes.writeUInt32LE(16, 16);
|
|
66
|
+
bytes.writeUInt16LE(1, 20);
|
|
67
|
+
bytes.writeUInt16LE(1, 22);
|
|
68
|
+
bytes.writeUInt32LE(sampleRate, 24);
|
|
69
|
+
bytes.writeUInt32LE(sampleRate * 2, 28);
|
|
70
|
+
bytes.writeUInt16LE(2, 32);
|
|
71
|
+
bytes.writeUInt16LE(16, 34);
|
|
72
|
+
bytes.write("data", 36, "ascii");
|
|
73
|
+
bytes.writeUInt32LE(samples.length * 2, 40);
|
|
74
|
+
samples.forEach((sample, index) => {
|
|
75
|
+
bytes.writeInt16LE(Math.round(Math.max(-1, Math.min(1, sample || 0)) * 32767), 44 + index * 2);
|
|
76
|
+
});
|
|
77
|
+
return new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.length);
|
|
78
|
+
}, "encodeWav");
|
|
79
|
+
|
|
80
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/node_modules/@wirecat/cli-core/dist/speech/openai.js
|
|
81
|
+
var LONGEST_REQUEST_SECONDS = 600;
|
|
82
|
+
var JOINED_SECONDS = 0.2;
|
|
83
|
+
var PAD_SECONDS = 0.2;
|
|
84
|
+
var LEAD = SAMPLE_RATE / 2;
|
|
85
|
+
var EXHAUSTED = /* @__PURE__ */ new Set([
|
|
86
|
+
"insufficient_quota",
|
|
87
|
+
"credit_balance_exhausted",
|
|
88
|
+
"organization_spend_limit_exceeded",
|
|
89
|
+
"project_spend_limit_exceeded",
|
|
90
|
+
"organization_usage_limit_exceeded"
|
|
91
|
+
]);
|
|
92
|
+
var RETRY = { ...DEFAULT_RETRY, retries: 4 };
|
|
93
|
+
var interrupted = /* @__PURE__ */ __name((signal) => {
|
|
94
|
+
if (!signal?.aborted)
|
|
95
|
+
return;
|
|
96
|
+
if (signal.reason instanceof CliError)
|
|
97
|
+
throw signal.reason;
|
|
98
|
+
const timeout = signal.reason instanceof Error && signal.reason.name === "TimeoutError";
|
|
99
|
+
throw new CliError(timeout ? "timeout" : "cancelled", "the transcription was interrupted");
|
|
100
|
+
}, "interrupted");
|
|
101
|
+
var sleeping = /* @__PURE__ */ __name((ms, signal) => wait(ms, void 0, signal ? { signal } : {}).then(() => void 0, (error) => {
|
|
102
|
+
interrupted(signal);
|
|
103
|
+
throw error;
|
|
104
|
+
}), "sleeping");
|
|
105
|
+
var formOf = /* @__PURE__ */ __name((wav, options) => {
|
|
106
|
+
const form = new FormData();
|
|
107
|
+
form.append("file", new Blob([wav], { type: "audio/wav" }), "audio.wav");
|
|
108
|
+
form.append("model", options.model ?? OPENAI_TRANSCRIBE_MODEL);
|
|
109
|
+
for (const language of options.languages ?? [])
|
|
110
|
+
form.append("languages[]", language);
|
|
111
|
+
for (const keyword of options.keywords ?? [])
|
|
112
|
+
form.append("keywords[]", keyword);
|
|
113
|
+
if (options.prompt)
|
|
114
|
+
form.append("prompt", options.prompt);
|
|
115
|
+
return form;
|
|
116
|
+
}, "formOf");
|
|
117
|
+
var safe = /* @__PURE__ */ __name((value) => typeof value === "string" && /^[\w.-]{1,64}$/.test(value) ? value : void 0, "safe");
|
|
118
|
+
var failureOf = /* @__PURE__ */ __name(async (response) => {
|
|
119
|
+
try {
|
|
120
|
+
const body = await response.json();
|
|
121
|
+
const code = safe(body.error?.code);
|
|
122
|
+
const type = safe(body.error?.type);
|
|
123
|
+
return { ...code ? { code } : {}, ...type ? { type } : {} };
|
|
124
|
+
} catch {
|
|
125
|
+
return {};
|
|
126
|
+
}
|
|
127
|
+
}, "failureOf");
|
|
128
|
+
var send = /* @__PURE__ */ __name(async (wav, options) => {
|
|
129
|
+
const post = options.fetch ?? fetch;
|
|
130
|
+
const retry = options.retry ?? RETRY;
|
|
131
|
+
const sleep = options.sleep ?? sleeping;
|
|
132
|
+
const random = options.random ?? Math.random;
|
|
133
|
+
const url = `${(options.baseUrl ?? OPENAI_URL).replace(/\/+$/, "")}/audio/transcriptions`;
|
|
134
|
+
for (let attempt = 1; ; attempt++) {
|
|
135
|
+
interrupted(options.signal);
|
|
136
|
+
let response;
|
|
137
|
+
try {
|
|
138
|
+
response = await post(url, {
|
|
139
|
+
method: "POST",
|
|
140
|
+
headers: { authorization: `Bearer ${options.apiKey}` },
|
|
141
|
+
body: formOf(wav, options),
|
|
142
|
+
...options.signal ? { signal: options.signal } : {}
|
|
143
|
+
});
|
|
144
|
+
} catch {
|
|
145
|
+
interrupted(options.signal);
|
|
146
|
+
if (attempt > retry.retries)
|
|
147
|
+
throw new CliError("network_error", "OpenAI could not be reached", { reason: "network.failed" });
|
|
148
|
+
await sleep(backoffMs(attempt, retry, random), options.signal);
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
if (response.ok) {
|
|
152
|
+
const body = await response.json().catch(() => interrupted(options.signal));
|
|
153
|
+
if (typeof body?.text !== "string")
|
|
154
|
+
throw new CliError("invalid_response", "OpenAI answered without a transcript", {
|
|
155
|
+
reason: "provider.invalid-response"
|
|
156
|
+
});
|
|
157
|
+
return body.text.trim();
|
|
158
|
+
}
|
|
159
|
+
const { code, type } = await failureOf(response);
|
|
160
|
+
const status = response.status;
|
|
161
|
+
const said = `HTTP ${status}${code ? `, ${code}` : type ? `, ${type}` : ""}`;
|
|
162
|
+
if (status === 401)
|
|
163
|
+
throw new CliError("authentication_error", `OpenAI refused the key (${said}) \u2014 set it again with \`models keys set openai\``, { reason: "auth.failed" });
|
|
164
|
+
if (status === 403)
|
|
165
|
+
throw new CliError("permission_error", `OpenAI refused the request (${said}) \u2014 it answers this when the country or region is not supported, or the key's project may not use the model`, { reason: "access.denied" });
|
|
166
|
+
if (status === 413)
|
|
167
|
+
throw new CliError("validation_error", `OpenAI refused the audio as too large (${said})`, {
|
|
168
|
+
reason: "transcription.too-large"
|
|
169
|
+
});
|
|
170
|
+
if (EXHAUSTED.has(code ?? "") || EXHAUSTED.has(type ?? ""))
|
|
171
|
+
throw new CliError("permission_error", `OpenAI refused: the account's credit, spend limit or usage limit is used up (${said}) \u2014 see the billing page`, { reason: "transcription.quota-exhausted" });
|
|
172
|
+
const again = status === 408 || status === 429 || status >= 500;
|
|
173
|
+
const asked = providerWaitMs(response.headers, () => /* @__PURE__ */ new Date());
|
|
174
|
+
if (again && attempt <= retry.retries && (asked === void 0 || asked <= retry.maxRetryAfterMs)) {
|
|
175
|
+
await sleep(asked ?? backoffMs(attempt, retry, random), options.signal);
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
if (status === 429)
|
|
179
|
+
throw new CliError("rate_limited", `OpenAI answered ${said}`, {
|
|
180
|
+
reason: "provider.rate-limited",
|
|
181
|
+
...asked === void 0 ? {} : { retry_after_ms: asked }
|
|
182
|
+
});
|
|
183
|
+
if (status >= 500)
|
|
184
|
+
throw new CliError([502, 503, 504].includes(status) ? "provider_unavailable" : "provider_error", `OpenAI answered ${said}`, { reason: [502, 503, 504].includes(status) ? "provider.unavailable" : "provider.refused" });
|
|
185
|
+
throw new CliError("provider_error", `OpenAI answered ${said}`, { reason: "provider.refused" });
|
|
186
|
+
}
|
|
187
|
+
}, "send");
|
|
188
|
+
var piecesOf = /* @__PURE__ */ __name((spans, limit) => {
|
|
189
|
+
const pieces = [];
|
|
190
|
+
for (const span of spans) {
|
|
191
|
+
const last = pieces.at(-1);
|
|
192
|
+
const joined = last !== void 0 && span.start - last.end < JOINED_SECONDS;
|
|
193
|
+
const fits = last !== void 0 && limit !== void 0 && span.end - last.start <= limit;
|
|
194
|
+
if (last && (fits || joined && span.end - last.start <= LONGEST_REQUEST_SECONDS))
|
|
195
|
+
last.end = span.end;
|
|
196
|
+
else
|
|
197
|
+
pieces.push({ start: span.start, end: span.end });
|
|
198
|
+
}
|
|
199
|
+
return pieces;
|
|
200
|
+
}, "piecesOf");
|
|
201
|
+
var openCutter = /* @__PURE__ */ __name(async (vadModel) => {
|
|
202
|
+
const { openSpeechCutter } = await import("./recognize-AVFDJAIL.js");
|
|
203
|
+
return openSpeechCutter(vadModel);
|
|
204
|
+
}, "openCutter");
|
|
205
|
+
var checkKeywords = /* @__PURE__ */ __name((keywords = []) => {
|
|
206
|
+
const bad = keywords.find((keyword) => typeof keyword !== "string" || !keyword.trim() || /[<>\r\n]/.test(keyword));
|
|
207
|
+
if (bad !== void 0)
|
|
208
|
+
throw new CliError("validation_error", "a keyword must be a non-empty single line without < or > \u2014 OpenAI refuses the whole request otherwise");
|
|
209
|
+
}, "checkKeywords");
|
|
210
|
+
var transcribeOpenAI = /* @__PURE__ */ __name(async (audio, options) => {
|
|
211
|
+
if (!options.apiKey)
|
|
212
|
+
throw new CliError("authentication_error", "no OpenAI key \u2014 `models keys set openai`, or OPENAI_API_KEY", {
|
|
213
|
+
reason: "transcription.no-key"
|
|
214
|
+
});
|
|
215
|
+
checkKeywords(options.keywords);
|
|
216
|
+
interrupted(options.signal);
|
|
217
|
+
const pcm = toModelRate(audio.samples, audio.rate);
|
|
218
|
+
const duration = (pcm.length - LEAD) / SAMPLE_RATE;
|
|
219
|
+
if (options.bundle && duration <= LONGEST_REQUEST_SECONDS) {
|
|
220
|
+
const text = await send(encodeWav(pcm.subarray(LEAD)), options);
|
|
221
|
+
return text ? [{ start: 0, end: duration, text }] : [];
|
|
222
|
+
}
|
|
223
|
+
const vadModel = options.vadModel ?? vadPath(modelsDirectory(options.env));
|
|
224
|
+
if (!options.cutter && !filesPresent([[VAD, vadModel]]))
|
|
225
|
+
throw new CliError("not_found", "the voice detector that finds the speech is not on this machine \u2014 it comes with any speech model: `models download`", { reason: "model.not-downloaded", model: "silero_vad" });
|
|
226
|
+
const cutter = await (options.cutter ?? openCutter)(vadModel);
|
|
227
|
+
let spans;
|
|
228
|
+
try {
|
|
229
|
+
spans = cutter.cut(pcm);
|
|
230
|
+
} finally {
|
|
231
|
+
cutter.free();
|
|
232
|
+
}
|
|
233
|
+
const pieces = piecesOf(spans, options.bundle ? LONGEST_REQUEST_SECONDS : void 0);
|
|
234
|
+
const heard = [];
|
|
235
|
+
for (const [index, piece] of pieces.entries()) {
|
|
236
|
+
const end = Math.min(piece.end, duration);
|
|
237
|
+
const from = Math.max(piece.start - PAD_SECONDS, pieces[index - 1]?.end ?? 0);
|
|
238
|
+
const to = Math.min(end + PAD_SECONDS, pieces[index + 1]?.start ?? duration);
|
|
239
|
+
const samples = pcm.subarray(LEAD + Math.floor(from * SAMPLE_RATE), LEAD + Math.ceil(to * SAMPLE_RATE));
|
|
240
|
+
const text = await send(encodeWav(samples), options);
|
|
241
|
+
if (text)
|
|
242
|
+
heard.push({ start: Math.min(piece.start, end), end, text });
|
|
243
|
+
}
|
|
244
|
+
return heard;
|
|
245
|
+
}, "transcribeOpenAI");
|
|
246
|
+
export {
|
|
247
|
+
LONGEST_REQUEST_SECONDS,
|
|
248
|
+
piecesOf,
|
|
249
|
+
transcribeOpenAI
|
|
250
|
+
};
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
__name
|
|
6
6
|
} from "./chunk-ZVVMGPBJ.js";
|
|
7
7
|
|
|
8
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/node_modules/@wirecat/cli-core/dist/embeddings/process.js
|
|
9
9
|
import { spawn } from "node:child_process";
|
|
10
10
|
import { createInterface } from "node:readline";
|
|
11
11
|
import { fileURLToPath } from "node:url";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
proxiedFetch,
|
|
14
14
|
proxySecrets,
|
|
15
15
|
resolveSettings
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-IGIPIO4J.js";
|
|
17
17
|
import {
|
|
18
18
|
AGENTS,
|
|
19
19
|
MEMO_SCENARIOS,
|
|
@@ -65,27 +65,28 @@ import {
|
|
|
65
65
|
topicsCommand,
|
|
66
66
|
upgradeCommand,
|
|
67
67
|
watchCommand
|
|
68
|
-
} from "./chunk-
|
|
69
|
-
import "./chunk-
|
|
68
|
+
} from "./chunk-2ILQYCBY.js";
|
|
69
|
+
import "./chunk-BESIMQ5U.js";
|
|
70
70
|
import {
|
|
71
71
|
parseProxy,
|
|
72
72
|
proxyLabel
|
|
73
|
-
} from "./chunk-
|
|
74
|
-
import "./chunk-
|
|
75
|
-
import "./chunk-
|
|
73
|
+
} from "./chunk-NAVNCM5K.js";
|
|
74
|
+
import "./chunk-VYR2IIWW.js";
|
|
75
|
+
import "./chunk-MF6NKU3Z.js";
|
|
76
76
|
import {
|
|
77
77
|
installSkill
|
|
78
|
-
} from "./chunk-
|
|
79
|
-
import "./chunk-
|
|
80
|
-
import "./chunk-
|
|
81
|
-
import "./chunk-
|
|
82
|
-
import "./chunk-
|
|
78
|
+
} from "./chunk-UIPBAT2T.js";
|
|
79
|
+
import "./chunk-5SUFMBU5.js";
|
|
80
|
+
import "./chunk-SH63Q4QR.js";
|
|
81
|
+
import "./chunk-XJVGCCQE.js";
|
|
82
|
+
import "./chunk-76C5SSMR.js";
|
|
83
|
+
import "./chunk-BZIZLEJN.js";
|
|
83
84
|
import {
|
|
84
85
|
inSection
|
|
85
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-P57R2P75.js";
|
|
86
87
|
import "./chunk-2ABQZVK4.js";
|
|
87
|
-
import "./chunk-
|
|
88
|
-
import "./chunk-
|
|
88
|
+
import "./chunk-P5ILJ7MN.js";
|
|
89
|
+
import "./chunk-4R4AH6FM.js";
|
|
89
90
|
import {
|
|
90
91
|
Argument,
|
|
91
92
|
Command,
|
|
@@ -107,48 +108,48 @@ import {
|
|
|
107
108
|
runtime,
|
|
108
109
|
secretInputOf,
|
|
109
110
|
withDeadline
|
|
110
|
-
} from "./chunk-
|
|
111
|
-
import "./chunk-
|
|
112
|
-
import "./chunk-
|
|
113
|
-
import "./chunk-
|
|
111
|
+
} from "./chunk-DZVYGBZB.js";
|
|
112
|
+
import "./chunk-RD2NLJSU.js";
|
|
113
|
+
import "./chunk-CVLDXFRP.js";
|
|
114
|
+
import "./chunk-C3RX3UOE.js";
|
|
114
115
|
import {
|
|
115
116
|
installerOf,
|
|
116
117
|
latestVersion,
|
|
117
118
|
runUpdate,
|
|
118
119
|
updateNotice
|
|
119
|
-
} from "./chunk-
|
|
120
|
-
import "./chunk-
|
|
121
|
-
import "./chunk-
|
|
122
|
-
import "./chunk-
|
|
123
|
-
import "./chunk-
|
|
120
|
+
} from "./chunk-VFVMB3NV.js";
|
|
121
|
+
import "./chunk-DLAFGSTN.js";
|
|
122
|
+
import "./chunk-P55L4S6N.js";
|
|
123
|
+
import "./chunk-ZUOS7QUB.js";
|
|
124
|
+
import "./chunk-7T7ILNCU.js";
|
|
124
125
|
import {
|
|
125
126
|
TG,
|
|
126
127
|
VERSION
|
|
127
|
-
} from "./chunk-
|
|
128
|
-
import "./chunk-
|
|
128
|
+
} from "./chunk-ZFMS5G4H.js";
|
|
129
|
+
import "./chunk-CHI6D4D6.js";
|
|
129
130
|
import {
|
|
130
131
|
servingProfiles
|
|
131
|
-
} from "./chunk-
|
|
132
|
-
import "./chunk-
|
|
133
|
-
import "./chunk-
|
|
134
|
-
import "./chunk-
|
|
135
|
-
import "./chunk-
|
|
136
|
-
import "./chunk-
|
|
137
|
-
import "./chunk-
|
|
138
|
-
import "./chunk-
|
|
132
|
+
} from "./chunk-TMXNMO66.js";
|
|
133
|
+
import "./chunk-25VC6U3A.js";
|
|
134
|
+
import "./chunk-AD3QPYI3.js";
|
|
135
|
+
import "./chunk-KHKC236O.js";
|
|
136
|
+
import "./chunk-INYO2QFW.js";
|
|
137
|
+
import "./chunk-3PEZWXKO.js";
|
|
138
|
+
import "./chunk-IULYECPC.js";
|
|
139
|
+
import "./chunk-M62LF3QE.js";
|
|
139
140
|
import {
|
|
140
141
|
timezoneOf
|
|
141
|
-
} from "./chunk-
|
|
142
|
-
import "./chunk-
|
|
143
|
-
import "./chunk-
|
|
144
|
-
import "./chunk-
|
|
145
|
-
import "./chunk-
|
|
146
|
-
import "./chunk-
|
|
147
|
-
import "./chunk-
|
|
142
|
+
} from "./chunk-DO33KAMM.js";
|
|
143
|
+
import "./chunk-YYOIULA2.js";
|
|
144
|
+
import "./chunk-AGVKIJB7.js";
|
|
145
|
+
import "./chunk-62EDJKGP.js";
|
|
146
|
+
import "./chunk-UUQ3BH2Z.js";
|
|
147
|
+
import "./chunk-S7B6MTXX.js";
|
|
148
|
+
import "./chunk-ZMZKZL3Y.js";
|
|
148
149
|
import {
|
|
149
150
|
readSecret
|
|
150
|
-
} from "./chunk-
|
|
151
|
-
import "./chunk-
|
|
151
|
+
} from "./chunk-ZHP44EML.js";
|
|
152
|
+
import "./chunk-WHYS6OSG.js";
|
|
152
153
|
import {
|
|
153
154
|
configFilePath,
|
|
154
155
|
exitCodeFor,
|
|
@@ -157,11 +158,11 @@ import {
|
|
|
157
158
|
renderPretty,
|
|
158
159
|
resolvePaths,
|
|
159
160
|
singleLine
|
|
160
|
-
} from "./chunk-
|
|
161
|
+
} from "./chunk-N5FSRC6H.js";
|
|
161
162
|
import {
|
|
162
163
|
CliError,
|
|
163
164
|
isCliError
|
|
164
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-XMMWKHNY.js";
|
|
165
166
|
import "./chunk-Y5E2WNWB.js";
|
|
166
167
|
import {
|
|
167
168
|
__name
|
|
@@ -236,7 +237,7 @@ var withProxySecrets = /* @__PURE__ */ __name((config) => {
|
|
|
236
237
|
throw new CliError("validation_error", "a proxy password or MTProxy secret never goes on the command line \u2014 run `tg config set proxy -` and paste the URL");
|
|
237
238
|
if (proxy.kind === "mtproxy" && proxy.secret === void 0)
|
|
238
239
|
throw new CliError("validation_error", "an MTProxy link needs its secret \u2014 run `tg config set proxy -` and paste the whole link");
|
|
239
|
-
const { checkProxy } = await import("./proxy-transport-
|
|
240
|
+
const { checkProxy } = await import("./proxy-transport-FWGKTYBL.js");
|
|
240
241
|
asValidation(() => checkProxy(proxy));
|
|
241
242
|
const label = proxyLabel(proxy);
|
|
242
243
|
action.processedArgs[1] = label;
|
|
@@ -719,7 +720,7 @@ import { accessSync, constants, existsSync as existsSync2, mkdirSync } from "nod
|
|
|
719
720
|
import { join } from "node:path";
|
|
720
721
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
721
722
|
|
|
722
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
723
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/node_modules/@wirecat/cli-core/dist/update/index.js
|
|
723
724
|
import { realpathSync } from "node:fs";
|
|
724
725
|
import { fileURLToPath } from "node:url";
|
|
725
726
|
var QUIET_WORDS = [
|
|
@@ -1036,7 +1037,7 @@ var definition = {
|
|
|
1036
1037
|
};
|
|
1037
1038
|
var run2 = /* @__PURE__ */ __name(async (argv, environment = {}) => {
|
|
1038
1039
|
if (!botApi && needsBotApi(argv, environment.env ?? process.env))
|
|
1039
|
-
useBotApi((await import("./bot-api-
|
|
1040
|
+
useBotApi((await import("./bot-api-TQYRNYJQ.js")).telegramBotApiCommand);
|
|
1040
1041
|
const notice = updateNotice2(argv, {
|
|
1041
1042
|
...environment.tty === void 0 ? {} : { tty: environment.tty },
|
|
1042
1043
|
...environment.update ? { environment: environment.update } : {},
|
|
@@ -2,10 +2,10 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
readSecret
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-ZHP44EML.js";
|
|
6
|
+
import "./chunk-WHYS6OSG.js";
|
|
7
|
+
import "./chunk-N5FSRC6H.js";
|
|
8
|
+
import "./chunk-XMMWKHNY.js";
|
|
9
9
|
import "./chunk-Y5E2WNWB.js";
|
|
10
10
|
import "./chunk-ZVVMGPBJ.js";
|
|
11
11
|
export {
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
checkProxy,
|
|
5
5
|
proxiedTransport,
|
|
6
6
|
proxyFailure
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-GUFM5RLW.js";
|
|
8
|
+
import "./chunk-NAVNCM5K.js";
|
|
9
|
+
import "./chunk-N5FSRC6H.js";
|
|
10
|
+
import "./chunk-XMMWKHNY.js";
|
|
11
11
|
import "./chunk-Y5E2WNWB.js";
|
|
12
12
|
import "./chunk-ZVVMGPBJ.js";
|
|
13
13
|
export {
|
|
@@ -6,10 +6,11 @@ import {
|
|
|
6
6
|
detector,
|
|
7
7
|
loadSherpa,
|
|
8
8
|
openRecognizer,
|
|
9
|
+
openSpeechCutter,
|
|
9
10
|
toModelRate
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-QQF7RDLR.js";
|
|
12
|
+
import "./chunk-N5FSRC6H.js";
|
|
13
|
+
import "./chunk-XMMWKHNY.js";
|
|
13
14
|
import "./chunk-Y5E2WNWB.js";
|
|
14
15
|
import "./chunk-ZVVMGPBJ.js";
|
|
15
16
|
export {
|
|
@@ -18,5 +19,6 @@ export {
|
|
|
18
19
|
detector,
|
|
19
20
|
loadSherpa,
|
|
20
21
|
openRecognizer,
|
|
22
|
+
openSpeechCutter,
|
|
21
23
|
toModelRate
|
|
22
24
|
};
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
openRemote,
|
|
9
9
|
remoteKey,
|
|
10
10
|
remoteModel
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-INYO2QFW.js";
|
|
12
|
+
import "./chunk-3PEZWXKO.js";
|
|
13
|
+
import "./chunk-IULYECPC.js";
|
|
14
|
+
import "./chunk-UUQ3BH2Z.js";
|
|
15
|
+
import "./chunk-N5FSRC6H.js";
|
|
16
|
+
import "./chunk-XMMWKHNY.js";
|
|
17
17
|
import "./chunk-Y5E2WNWB.js";
|
|
18
18
|
import "./chunk-ZVVMGPBJ.js";
|
|
19
19
|
export {
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
defaultThreads,
|
|
5
5
|
loadModel,
|
|
6
6
|
truncated
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-3PEZWXKO.js";
|
|
8
|
+
import "./chunk-IULYECPC.js";
|
|
9
|
+
import "./chunk-UUQ3BH2Z.js";
|
|
10
|
+
import "./chunk-N5FSRC6H.js";
|
|
11
|
+
import "./chunk-XMMWKHNY.js";
|
|
12
12
|
import "./chunk-Y5E2WNWB.js";
|
|
13
13
|
import {
|
|
14
14
|
__name
|
|
15
15
|
} from "./chunk-ZVVMGPBJ.js";
|
|
16
16
|
|
|
17
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/node_modules/@wirecat/cli-core/dist/embeddings/rerank.js
|
|
18
18
|
var openReranker = /* @__PURE__ */ __name(async (model, directory, { threads = defaultThreads() } = {}) => {
|
|
19
19
|
const { ort, tokenizer, session } = await loadModel(model, directory, threads);
|
|
20
20
|
const typeIds = session.inputNames.includes("token_type_ids");
|