@wirecat/zoom-cli 0.70.0 → 0.72.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/answer-entities.d.ts +2 -0
- package/dist/answer-entities.d.ts.map +1 -1
- package/dist/answers.d.ts +56 -0
- package/dist/answers.d.ts.map +1 -1
- package/dist/bin/zm.js +2 -2
- package/dist/bundle/{all-profiles-GE2TFJJP.js → all-profiles-XFIPF4GF.js} +12 -12
- package/dist/bundle/answer-policy-AT6CDEE5.js +110 -0
- package/dist/bundle/{anthropic-FA6NHENI.js → anthropic-SSUBR3BC.js} +29 -13
- package/dist/bundle/{app-server-IRADMSNX.js → app-server-7DJHHF2F.js} +68 -56
- package/dist/bundle/{bun-ZYZGGCX5.js → bun-6HBYWQIX.js} +2 -2
- package/dist/bundle/{bun-sqlite-Y24TUIGS.js → bun-sqlite-4L3Q55NB.js} +10 -6
- package/dist/bundle/{chunk-JULBAECW.js → chunk-23J2ANZ7.js} +16 -6
- package/dist/bundle/{chunk-4DSIWYGO.js → chunk-24OFZNRC.js} +39296 -24139
- package/dist/bundle/{chunk-LXXCLQCW.js → chunk-2MIBRVSV.js} +2 -2
- package/dist/bundle/{chunk-CHGUNZ3L.js → chunk-37NF5CBJ.js} +4 -4
- package/dist/bundle/chunk-3KRTEX5M.js +53 -0
- package/dist/bundle/{chunk-VNU5L37V.js → chunk-4SY67IUA.js} +34 -42
- package/dist/bundle/{chunk-XWQNJKTP.js → chunk-4XQWF3U2.js} +6 -6
- package/dist/bundle/{chunk-OAQLVV6W.js → chunk-4YIGXTBP.js} +3 -3
- package/dist/bundle/{chunk-RB33VTUW.js → chunk-5AELTC52.js} +810 -210
- package/dist/bundle/chunk-5MGICK47.js +1243 -0
- package/dist/bundle/{chunk-RRRJCHUC.js → chunk-5X4IY5JH.js} +4504 -1622
- package/dist/bundle/{chunk-EOSVN2ER.js → chunk-63QXCE5Z.js} +242 -242
- package/dist/bundle/{chunk-OE7EIP5L.js → chunk-6DCLZLGX.js} +1 -1
- package/dist/bundle/chunk-7GLJSJ7M.js +16 -0
- package/dist/bundle/{chunk-KM736RMJ.js → chunk-7IFO43Q5.js} +2 -2
- package/dist/bundle/{chunk-IWPXWGF7.js → chunk-7JYMGXLI.js} +44 -42
- package/dist/bundle/{chunk-LAG5O2FV.js → chunk-7OD3522V.js} +4162 -3769
- package/dist/bundle/{chunk-DCUWJITQ.js → chunk-7S4D5SM2.js} +60 -608
- package/dist/bundle/{chunk-3KC7C465.js → chunk-7SUWPMZG.js} +10 -15
- package/dist/bundle/{chunk-6IF5ZHDS.js → chunk-ADKMBXY4.js} +1 -1
- package/dist/bundle/{chunk-56OV5ASY.js → chunk-B3SILJBU.js} +18 -18
- package/dist/bundle/{chunk-CIZ25UPK.js → chunk-CANRIRNZ.js} +8241 -5553
- package/dist/bundle/{chunk-YUHM2OJM.js → chunk-CW46FWKW.js} +38 -123
- package/dist/bundle/{chunk-VSLDWT4E.js → chunk-D24OQAHM.js} +4 -4
- package/dist/bundle/{chunk-ZBKWRYRS.js → chunk-D5EUMWD5.js} +3 -3
- package/dist/bundle/{chunk-CSEBB4OP.js → chunk-DEPXZJ2V.js} +21 -150
- package/dist/bundle/{chunk-YJSPBUGB.js → chunk-DOCVEKP2.js} +51 -67
- package/dist/bundle/{chunk-V2E7QFZ3.js → chunk-EFF2XBHP.js} +2 -2
- package/dist/bundle/{chunk-XRFHQGOD.js → chunk-EG25AY4L.js} +1 -1
- package/dist/bundle/{chunk-FEM2JQN2.js → chunk-ELJUBPY4.js} +1 -1
- package/dist/bundle/{chunk-2U6SER67.js → chunk-ERJYJ36F.js} +2 -2
- package/dist/bundle/chunk-FSCPQQS5.js +244 -0
- package/dist/bundle/{chunk-BVWF4B33.js → chunk-H53WFZBN.js} +16 -139
- package/dist/bundle/{chunk-VJ5ZU4UF.js → chunk-I7CUMZD6.js} +3 -3
- package/dist/bundle/{chunk-OA37BWE5.js → chunk-IACWKZWS.js} +1 -1
- package/dist/bundle/{chunk-BSS6HX4O.js → chunk-IFBIXU6C.js} +2 -2
- package/dist/bundle/{chunk-UVPL7YAY.js → chunk-IU4DUUB3.js} +7 -7
- package/dist/bundle/{chunk-W7ZEEC4K.js → chunk-IXO4SCKE.js} +1 -1
- package/dist/bundle/{chunk-J3SKXICS.js → chunk-JAEPK457.js} +359 -765
- package/dist/bundle/{chunk-ZV3INEKM.js → chunk-JFPUYQSP.js} +5 -5
- package/dist/bundle/{chunk-ZS55EERO.js → chunk-JG4MNYG2.js} +1 -1
- package/dist/bundle/{chunk-IINZIP73.js → chunk-JRCH4YZP.js} +17 -10
- package/dist/bundle/{chunk-2JEM2YNV.js → chunk-JZ4XNNL7.js} +1 -1
- package/dist/bundle/chunk-K6HR6HCO.js +32 -0
- package/dist/bundle/{chunk-SNIY3JDN.js → chunk-KFZL67JP.js} +328 -60
- package/dist/bundle/{chunk-CEJJBZAE.js → chunk-KPIQXFNB.js} +375 -10
- package/dist/bundle/{chunk-M7VUXXGS.js → chunk-KWURWGGB.js} +137 -7
- package/dist/bundle/{chunk-M6JIXMQZ.js → chunk-LA6QUVGQ.js} +3 -2
- package/dist/bundle/{chunk-AISJCF7A.js → chunk-LLUNHAZ7.js} +4 -4
- package/dist/bundle/{chunk-KWRCP55G.js → chunk-LTWJM3ED.js} +17 -17
- package/dist/bundle/{chunk-IS3ZTT2Z.js → chunk-M3DMXDX6.js} +6 -6
- package/dist/bundle/{chunk-VW6BF6M7.js → chunk-MCPOZNWG.js} +1 -1
- package/dist/bundle/{chunk-L24UOUWG.js → chunk-MSQHSW4C.js} +2 -2
- package/dist/bundle/chunk-N4QNYWWG.js +71 -0
- package/dist/bundle/chunk-NMZQTYKJ.js +18 -0
- package/dist/bundle/{chunk-DNR4B5YV.js → chunk-OHCLQJOV.js} +3 -3
- package/dist/bundle/{chunk-MVOMLJYQ.js → chunk-OP5PGE2N.js} +4 -4
- package/dist/bundle/{chunk-QL7EMFIC.js → chunk-OY6N2ABP.js} +29 -23
- package/dist/bundle/chunk-PJWSGXOB.js +185 -0
- package/dist/bundle/{chunk-YTN2JN6N.js → chunk-QA6KIL7Q.js} +12 -8
- package/dist/bundle/{chunk-6HJFIMT7.js → chunk-QQUY4MZY.js} +1 -1
- package/dist/bundle/{chunk-ZSKE7N2U.js → chunk-QW7YTRV2.js} +3 -3
- package/dist/bundle/chunk-RJTGENHZ.js +109 -0
- package/dist/bundle/{chunk-RIPAUCKJ.js → chunk-RLCVPECY.js} +74 -67
- package/dist/bundle/{chunk-M7E44TMT.js → chunk-RN5SU2RN.js} +6 -6
- package/dist/bundle/{chunk-P3ASN72F.js → chunk-RX5CJ55S.js} +1 -1
- package/dist/bundle/{chunk-7QC4M4HS.js → chunk-RZUJMAMK.js} +4 -4
- package/dist/bundle/{chunk-OORMSM6O.js → chunk-S7SXSHRC.js} +21 -21
- package/dist/bundle/{chunk-SVF3NDAO.js → chunk-SXZGCD6E.js} +3 -3
- package/dist/bundle/{chunk-DXCTW3MV.js → chunk-T27IMG6X.js} +3 -1
- package/dist/bundle/{chunk-PV6OHXHN.js → chunk-TF2WKPNW.js} +18 -18
- package/dist/bundle/{chunk-X4ZF4XXI.js → chunk-U32VL3MA.js} +1 -1
- package/dist/bundle/{chunk-RQG5VOGH.js → chunk-U3NJBGLA.js} +3 -3
- package/dist/bundle/{chunk-WOIHSQAL.js → chunk-UVZLK3M4.js} +33 -9
- package/dist/bundle/chunk-VIV64MQM.js +779 -0
- package/dist/bundle/{chunk-2QFPVUM3.js → chunk-W3YTVEWV.js} +69 -6
- package/dist/bundle/{chunk-AUNW7N4I.js → chunk-WLVG4RBZ.js} +1 -1
- package/dist/bundle/{chunk-JRO2FWO2.js → chunk-WOAYHCM2.js} +1 -1
- package/dist/bundle/{chunk-RO3ZR4VP.js → chunk-WXTYYWZI.js} +13 -13
- package/dist/bundle/{chunk-RWIILYKW.js → chunk-WZGKHTA4.js} +2 -2
- package/dist/bundle/{chunk-GB5X3GBE.js → chunk-X2MP634F.js} +14 -5
- package/dist/bundle/{chunk-RGJ7OWHU.js → chunk-XPWZSW6Y.js} +61 -21
- package/dist/bundle/{chunk-D3PNCJD5.js → chunk-YVVJ6Y5C.js} +7 -7
- package/dist/bundle/chunk-ZHA56THL.js +2355 -0
- package/dist/bundle/{chunk-QO2KPU26.js → chunk-ZVFYGTGJ.js} +101 -44
- package/dist/bundle/{chunk-V5GRSOCZ.js → chunk-ZW5KHKMA.js} +5 -5
- package/dist/bundle/{cli-VRSQ7HAE.js → cli-IYYI7GAM.js} +215 -100
- package/dist/bundle/command-contract-TX7NSUBM.js +42 -0
- package/dist/bundle/command-server-entry-FXX4LJWF.js +171 -0
- package/dist/bundle/config-YKNM33J7.js +96 -0
- package/dist/bundle/{decode-523PUQMR.js → decode-SRGOOGBW.js} +6 -6
- package/dist/bundle/{dispatch-IZCAK47P.js → dispatch-OUHRPFUL.js} +11 -11
- package/dist/bundle/{dist-6WWKPEVW.js → dist-UZLNLAIO.js} +97 -56
- package/dist/bundle/{echarts-S5UMX2D3.js → echarts-7CM2MCMW.js} +2 -2
- package/dist/bundle/{embed-ODPDVHUK.js → embed-VEE56BOB.js} +7 -7
- package/dist/bundle/{embedder-PAXRBSZE.js → embedder-SZFYR543.js} +10 -10
- package/dist/bundle/{failure-R2OIHCE5.js → failure-MZBNM7M5.js} +3 -3
- package/dist/bundle/first-run-KWC7RKF2.js +29 -0
- package/dist/bundle/first-screen-DWKMNSEI.js +40 -0
- package/dist/bundle/{folders-ZXTOFY4T.js → folders-UQXRSDJJ.js} +5 -5
- package/dist/bundle/{instructions-DUB7E6C5.js → instructions-R7OHVAWH.js} +1 -1
- package/dist/bundle/{main-A7JSYQI6.js → main-EFUN2O3K.js} +21 -20
- package/dist/bundle/{mcp-M4QN2E7R.js → mcp-7KQUJNFN.js} +2 -2
- package/dist/bundle/{meetings-BDZQV3HR.js → meetings-5I2BDNTA.js} +9 -7
- package/dist/bundle/{node-E25KP53H.js → node-3N2JGZ7V.js} +2 -2
- package/dist/bundle/{node-sqlite-PHWDFZCP.js → node-sqlite-2UVEE2WM.js} +11 -7
- package/dist/bundle/{oauth-G2K46IYP.js → oauth-AYGD7UU3.js} +8 -8
- package/dist/bundle/{open-INWS5HIZ.js → open-3GUVDLGD.js} +6 -6
- package/dist/bundle/openai-NHCDLWWY.js +28 -0
- package/dist/bundle/{output-file-YGQYZCBJ.js → output-file-72JFXVHQ.js} +6 -6
- package/dist/bundle/{process-UJ2JHMJN.js → process-YAHHUFR5.js} +1 -1
- package/dist/bundle/{program-LYTGFV6L.js → program-OSZROCTK.js} +113 -118
- package/dist/bundle/{prompt-VTUCRCE4.js → prompt-HMCW4XQJ.js} +6 -6
- package/dist/bundle/{recognize-3CEPOW2F.js → recognize-VF5CA7EM.js} +5 -5
- package/dist/bundle/{remote-DRQEXEZL.js → remote-5C6VTPR2.js} +10 -8
- package/dist/bundle/{rerank-UL4KNNVN.js → rerank-ER7NEDOI.js} +8 -8
- package/dist/bundle/run-log-JKTLKXSK.js +124 -0
- package/dist/bundle/{serve-P5UWUOWQ.js → serve-QJWXJOM7.js} +10 -10
- package/dist/bundle/{server-M6XK2Y3X.js → server-KCIK3Y2P.js} +50 -48
- package/dist/bundle/server-LLGFDLLJ.js +75 -0
- package/dist/bundle/{services-4HRYNY62.js → services-LQMYJQG3.js} +121 -52
- package/dist/bundle/{speech-BBPBMFAO.js → speech-74GJQNQH.js} +20 -17
- package/dist/bundle/{state-GDSUNUSY.js → state-4XDGCHDF.js} +7 -7
- package/dist/bundle/{store-LBQ6FZP2.js → store-5Y5HK2L2.js} +28 -19
- package/dist/bundle/{store-VWLABMLF.js → store-Y56AHJ2Y.js} +64 -31
- package/dist/bundle/store-connection-4WI32AYU.js +89 -0
- package/dist/bundle/store-maintenance-command-PCXO5AH4.js +65 -0
- package/dist/bundle/{streaming-EJ3NM2C2.js → streaming-E5CR6HSR.js} +7 -7
- package/dist/bundle/{tokens-BE6CJMR5.js → tokens-E2QNVC4F.js} +7 -7
- package/dist/bundle/zm.js +34 -10
- package/dist/bundle/{zoom-app-YIEJLWCW.js → zoom-app-NVL7HEAX.js} +8 -8
- package/dist/contract-overrides.d.ts.map +1 -1
- package/dist/contract-overrides.js +0 -6
- package/dist/contract-overrides.js.map +1 -1
- package/dist/ingestion-search-commands.d.ts.map +1 -1
- package/dist/ingestion-search-commands.js +0 -10
- package/dist/ingestion-search-commands.js.map +1 -1
- package/dist/meeting-integration-commands.d.ts.map +1 -1
- package/dist/meeting-integration-commands.js +8 -6
- package/dist/meeting-integration-commands.js.map +1 -1
- package/dist/meeting-integration.d.ts +3 -1
- package/dist/meeting-integration.d.ts.map +1 -1
- package/dist/store-connection.d.ts.map +1 -1
- package/dist/store-connection.js +4 -3
- package/dist/store-connection.js.map +1 -1
- package/dist/unified-search.d.ts +4 -4
- package/dist/unified-search.d.ts.map +1 -1
- package/dist/unified-search.js +1 -24
- package/dist/unified-search.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/skills/zoom-cli/SKILL.md +2 -2
- package/dist/bundle/answer-policy-GOXSDYDD.js +0 -104
- package/dist/bundle/chunk-5XWCBLUR.js +0 -27
- package/dist/bundle/chunk-AT2XKNFN.js +0 -342
- package/dist/bundle/chunk-GVT5363M.js +0 -35
- package/dist/bundle/chunk-VE2VNECR.js +0 -380
- package/dist/bundle/chunk-Y6C3N7YG.js +0 -12434
- package/dist/bundle/command-contract-RPRKHVU6.js +0 -41
- package/dist/bundle/config-QU6A6VIO.js +0 -90
- package/dist/bundle/first-run-NVTDR5VO.js +0 -28
- package/dist/bundle/first-screen-5RWZDWLK.js +0 -39
- package/dist/bundle/openai-T44ORVGQ.js +0 -25
- package/dist/bundle/run-log-UZAB5CWF.js +0 -118
- package/dist/bundle/server-F3NPVMS2.js +0 -72
- package/dist/bundle/store-connection-XEBFP56U.js +0 -83
- package/dist/bundle/store-maintenance-command-G43JN57J.js +0 -61
- /package/dist/bundle/{chunk-VOXIGICJ.js → chunk-YVNHQFLC.js} +0 -0
|
@@ -1,118 +1,27 @@
|
|
|
1
1
|
import { createRequire as __bundleRequire } from "node:module";
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
ensureSqlite,
|
|
5
|
+
isCommandServer
|
|
6
|
+
} from "./chunk-RJTGENHZ.js";
|
|
3
7
|
import {
|
|
4
8
|
envName,
|
|
5
9
|
readOnlyLockOf
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import {
|
|
8
|
-
CAPABILITY_STATEMENTS,
|
|
9
|
-
storeCapable
|
|
10
|
-
} from "./chunk-M7E44TMT.js";
|
|
10
|
+
} from "./chunk-N4QNYWWG.js";
|
|
11
11
|
import {
|
|
12
12
|
catchCrashes
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import {
|
|
15
|
-
importFrom
|
|
16
|
-
} from "./chunk-Y5E2WNWB.js";
|
|
13
|
+
} from "./chunk-UVZLK3M4.js";
|
|
17
14
|
import {
|
|
18
15
|
CliError
|
|
19
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ELJUBPY4.js";
|
|
20
17
|
import {
|
|
21
18
|
__name
|
|
22
19
|
} from "./chunk-ZVVMGPBJ.js";
|
|
23
20
|
|
|
24
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25
|
-
import { spawn
|
|
21
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/cli/entry.js
|
|
22
|
+
import { spawn } from "node:child_process";
|
|
26
23
|
|
|
27
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28
|
-
import { spawn, spawnSync } from "node:child_process";
|
|
29
|
-
import { readFileSync } from "node:fs";
|
|
30
|
-
import { dirname } from "node:path";
|
|
31
|
-
var RESTARTED = "CLI_MESSAGING_SQLITE_RESTARTED";
|
|
32
|
-
var USER_LIBRARY_PATH = "CLI_MESSAGING_USER_LD_LIBRARY_PATH";
|
|
33
|
-
var FORWARDED = ["SIGTERM", "SIGHUP", "SIGQUIT"];
|
|
34
|
-
var ensureSqlite = /* @__PURE__ */ __name(async (runtime = nodeRuntime()) => {
|
|
35
|
-
const { env } = runtime;
|
|
36
|
-
if (env[RESTARTED]) {
|
|
37
|
-
if (env[USER_LIBRARY_PATH] === void 0)
|
|
38
|
-
delete env.LD_LIBRARY_PATH;
|
|
39
|
-
else
|
|
40
|
-
env.LD_LIBRARY_PATH = env[USER_LIBRARY_PATH];
|
|
41
|
-
delete env[USER_LIBRARY_PATH];
|
|
42
|
-
delete env[RESTARTED];
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
if (runtime.bun || runtime.platform !== "linux")
|
|
46
|
-
return;
|
|
47
|
-
const maps = runtime.maps();
|
|
48
|
-
if (!maps.includes("libsqlite3"))
|
|
49
|
-
return;
|
|
50
|
-
if (await runtime.capable())
|
|
51
|
-
return;
|
|
52
|
-
const library = await runtime.library(maps.includes("ld-musl"));
|
|
53
|
-
if (!library)
|
|
54
|
-
return;
|
|
55
|
-
const restarted = {
|
|
56
|
-
...env,
|
|
57
|
-
LD_LIBRARY_PATH: [dirname(library.path), env.LD_LIBRARY_PATH].filter(Boolean).join(":"),
|
|
58
|
-
[RESTARTED]: "1"
|
|
59
|
-
};
|
|
60
|
-
if (env.LD_LIBRARY_PATH !== void 0)
|
|
61
|
-
restarted[USER_LIBRARY_PATH] = env.LD_LIBRARY_PATH;
|
|
62
|
-
if (!runtime.works(restarted, library.version))
|
|
63
|
-
return;
|
|
64
|
-
await runtime.restart(restarted);
|
|
65
|
-
}, "ensureSqlite");
|
|
66
|
-
var trialScript = /* @__PURE__ */ __name((version) => `
|
|
67
|
-
const { DatabaseSync } = await import("node:sqlite")
|
|
68
|
-
const database = new DatabaseSync(":memory:")
|
|
69
|
-
if (database.prepare("SELECT sqlite_version() AS v").get().v !== ${JSON.stringify(version)}) process.exit(1)
|
|
70
|
-
for (const statement of ${JSON.stringify(CAPABILITY_STATEMENTS)}) database.exec(statement)
|
|
71
|
-
`, "trialScript");
|
|
72
|
-
var nodeRuntime = /* @__PURE__ */ __name(() => ({
|
|
73
|
-
env: process.env,
|
|
74
|
-
platform: process.platform,
|
|
75
|
-
bun: "Bun" in globalThis,
|
|
76
|
-
maps: /* @__PURE__ */ __name(() => {
|
|
77
|
-
try {
|
|
78
|
-
return readFileSync("/proc/self/maps", "utf8");
|
|
79
|
-
} catch {
|
|
80
|
-
return "";
|
|
81
|
-
}
|
|
82
|
-
}, "maps"),
|
|
83
|
-
capable: /* @__PURE__ */ __name(() => storeCapable().then(() => true, () => false), "capable"),
|
|
84
|
-
library: /* @__PURE__ */ __name(async (musl) => {
|
|
85
|
-
try {
|
|
86
|
-
const { libraryFor, SQLITE_VERSION } = await importFrom(new URL("sqlite-runtime.js", import.meta.resolve("@wirecat/cli-core")).href, "@wirecat/cli-core-sqlite");
|
|
87
|
-
const path = libraryFor({ musl });
|
|
88
|
-
return path === void 0 ? void 0 : { path, version: SQLITE_VERSION };
|
|
89
|
-
} catch {
|
|
90
|
-
return void 0;
|
|
91
|
-
}
|
|
92
|
-
}, "library"),
|
|
93
|
-
works: /* @__PURE__ */ __name((env, version) => spawnSync(process.execPath, ["--no-warnings", "--input-type=module", "-e", trialScript(version)], {
|
|
94
|
-
env,
|
|
95
|
-
stdio: "ignore",
|
|
96
|
-
timeout: 1e4
|
|
97
|
-
}).status === 0, "works"),
|
|
98
|
-
restart: /* @__PURE__ */ __name((env) => relay(spawn(process.execPath, [...process.execArgv, ...process.argv.slice(1)], { env, stdio: "inherit" })), "restart")
|
|
99
|
-
}), "nodeRuntime");
|
|
100
|
-
var relay = /* @__PURE__ */ __name((child, host = process) => new Promise(() => {
|
|
101
|
-
for (const signal of FORWARDED)
|
|
102
|
-
host.on(signal, () => child.kill(signal));
|
|
103
|
-
host.on("SIGINT", () => {
|
|
104
|
-
});
|
|
105
|
-
child.on("error", () => host.exit(1));
|
|
106
|
-
child.on("exit", (code, signal) => {
|
|
107
|
-
if (signal) {
|
|
108
|
-
host.removeAllListeners(signal);
|
|
109
|
-
host.kill(host.pid, signal);
|
|
110
|
-
} else
|
|
111
|
-
host.exit(code ?? 1);
|
|
112
|
-
});
|
|
113
|
-
}), "relay");
|
|
114
|
-
|
|
115
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/argv-log.js
|
|
24
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/cli/argv-log.js
|
|
116
25
|
import { appendFileSync } from "node:fs";
|
|
117
26
|
var logParsedArgv = /* @__PURE__ */ __name((file, action) => {
|
|
118
27
|
const words = [];
|
|
@@ -136,7 +45,7 @@ var logVersion = /* @__PURE__ */ __name((file) => {
|
|
|
136
45
|
`);
|
|
137
46
|
}, "logVersion");
|
|
138
47
|
|
|
139
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/cli/entry.js
|
|
140
49
|
var processIo = /* @__PURE__ */ __name(() => ({
|
|
141
50
|
argv: process.argv,
|
|
142
51
|
env: process.env,
|
|
@@ -148,13 +57,17 @@ var processIo = /* @__PURE__ */ __name(() => ({
|
|
|
148
57
|
setExitCode: /* @__PURE__ */ __name((code) => {
|
|
149
58
|
process.exitCode = code;
|
|
150
59
|
}, "setExitCode"),
|
|
151
|
-
spawn
|
|
60
|
+
spawn
|
|
152
61
|
}), "processIo");
|
|
153
62
|
var startCli = /* @__PURE__ */ __name(async (entry) => {
|
|
154
63
|
const io = { ...processIo(), ...entry.io };
|
|
155
64
|
const args = io.argv.slice(2);
|
|
156
65
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-V"))
|
|
157
66
|
return printVersion(entry.app, io);
|
|
67
|
+
if (isCommandServer(args)) {
|
|
68
|
+
const { serveEntry } = await import("./command-server-entry-FXX4LJWF.js");
|
|
69
|
+
return serveEntry(entry, io, { firstRunAt, commanderExit });
|
|
70
|
+
}
|
|
158
71
|
const tty = io.stdout.isTTY === true;
|
|
159
72
|
const release = catchCrashes({
|
|
160
73
|
cli: entry.app.command,
|
|
@@ -186,27 +99,11 @@ var startCli = /* @__PURE__ */ __name(async (entry) => {
|
|
|
186
99
|
env: io.env,
|
|
187
100
|
tty,
|
|
188
101
|
signal: controller.signal,
|
|
189
|
-
atStart:
|
|
190
|
-
if (command.optsWithGlobals().dryRun === true)
|
|
191
|
-
return;
|
|
192
|
-
const [{ setupAtStart }, { commandPathOf }] = await Promise.all([
|
|
193
|
-
import("./first-run-NVTDR5VO.js"),
|
|
194
|
-
import("./command-contract-RPRKHVU6.js")
|
|
195
|
-
]);
|
|
196
|
-
await setupAtStart({
|
|
197
|
-
command: entry.app.command,
|
|
198
|
-
env: io.env,
|
|
199
|
-
contentLanguages: entry.app.contentLanguages,
|
|
200
|
-
path: commandPathOf(command),
|
|
201
|
-
headless: headless(command),
|
|
202
|
-
readOnlyLock: readOnlyLockOf(entry.app, io.env),
|
|
203
|
-
input: io.stdin
|
|
204
|
-
});
|
|
205
|
-
}, "atStart"),
|
|
102
|
+
atStart: firstRunAt(entry, io, headless),
|
|
206
103
|
ask: /* @__PURE__ */ __name(async (question, command) => {
|
|
207
104
|
if (headless(command) || io.stdin.isTTY !== true)
|
|
208
105
|
return false;
|
|
209
|
-
const { readSecret } = await import("./prompt-
|
|
106
|
+
const { readSecret } = await import("./prompt-HMCW4XQJ.js");
|
|
210
107
|
const answer = await readSecret(`${question} [y/N] `, {
|
|
211
108
|
input: io.stdin,
|
|
212
109
|
output: io.stderr,
|
|
@@ -219,7 +116,8 @@ var startCli = /* @__PURE__ */ __name(async (entry) => {
|
|
|
219
116
|
if (!headless(command))
|
|
220
117
|
await openBrowser(url, browser, io);
|
|
221
118
|
}, "openBrowser"),
|
|
222
|
-
outputClosed: /* @__PURE__ */ __name(() => closed, "outputClosed")
|
|
119
|
+
outputClosed: /* @__PURE__ */ __name(() => closed, "outputClosed"),
|
|
120
|
+
setExitCode: io.setExitCode
|
|
223
121
|
};
|
|
224
122
|
let code;
|
|
225
123
|
try {
|
|
@@ -244,6 +142,23 @@ var startCli = /* @__PURE__ */ __name(async (entry) => {
|
|
|
244
142
|
else if (code !== void 0)
|
|
245
143
|
io.setExitCode(code);
|
|
246
144
|
}, "startCli");
|
|
145
|
+
var firstRunAt = /* @__PURE__ */ __name((entry, io, headless) => async (command) => {
|
|
146
|
+
if (command.optsWithGlobals().dryRun === true)
|
|
147
|
+
return;
|
|
148
|
+
const [{ setupAtStart }, { commandPathOf }] = await Promise.all([
|
|
149
|
+
import("./first-run-KWC7RKF2.js"),
|
|
150
|
+
import("./command-contract-TX7NSUBM.js")
|
|
151
|
+
]);
|
|
152
|
+
await setupAtStart({
|
|
153
|
+
command: entry.app.command,
|
|
154
|
+
env: io.env,
|
|
155
|
+
contentLanguages: entry.app.contentLanguages,
|
|
156
|
+
path: commandPathOf(command),
|
|
157
|
+
headless: headless(command),
|
|
158
|
+
readOnlyLock: readOnlyLockOf(entry.app, io.env),
|
|
159
|
+
input: io.stdin
|
|
160
|
+
});
|
|
161
|
+
}, "firstRunAt");
|
|
247
162
|
var printVersion = /* @__PURE__ */ __name((app, io) => {
|
|
248
163
|
const argvLog = io.env[envName(app, "TEST_ARGV_LOG")];
|
|
249
164
|
if (argvLog)
|
|
@@ -261,7 +176,7 @@ var commanderExit = /* @__PURE__ */ __name((error) => {
|
|
|
261
176
|
return 0;
|
|
262
177
|
return code === "commander.help" ? 2 : void 0;
|
|
263
178
|
}, "commanderExit");
|
|
264
|
-
var openBrowser = /* @__PURE__ */ __name((url, browser, io = { platform: process.platform, spawn
|
|
179
|
+
var openBrowser = /* @__PURE__ */ __name((url, browser, io = { platform: process.platform, spawn }) => {
|
|
265
180
|
const [command, prefix] = browser !== void 0 ? [browser, []] : io.platform === "darwin" ? ["open", []] : io.platform === "win32" ? ["rundll32.exe", ["url.dll,FileProtocolHandler"]] : ["xdg-open", []];
|
|
266
181
|
return new Promise((resolve, reject) => {
|
|
267
182
|
const child = io.spawn(command, [...prefix, url], { detached: true, stdio: "ignore", windowsHide: true });
|
|
@@ -2,15 +2,15 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
wirecatDirectory
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3KRTEX5M.js";
|
|
6
6
|
import {
|
|
7
7
|
CliError
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ELJUBPY4.js";
|
|
9
9
|
import {
|
|
10
10
|
__name
|
|
11
11
|
} from "./chunk-ZVVMGPBJ.js";
|
|
12
12
|
|
|
13
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/speech/models.js
|
|
14
14
|
var huggingFace = /* @__PURE__ */ __name((repository, commit) => (name) => `https://huggingface.co/csukuangfj/${repository}/resolve/${commit}/${name}`, "huggingFace");
|
|
15
15
|
var gigaam = huggingFace("sherpa-onnx-nemo-transducer-punct-giga-am-v3-russian-2025-12-16", "a6039be7cee829a9044a69ac0ebaf1c191217c97");
|
|
16
16
|
var gigaamCtc = huggingFace("sherpa-onnx-nemo-ctc-punct-giga-am-v3-russian-2025-12-16", "4fb5407ff028a69fec516cdf4c10fac9ddea7c16");
|
|
@@ -137,7 +137,7 @@ var speechModel = /* @__PURE__ */ __name((id) => {
|
|
|
137
137
|
return model;
|
|
138
138
|
}, "speechModel");
|
|
139
139
|
|
|
140
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
140
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/speech/install.js
|
|
141
141
|
import { createHash, randomUUID } from "node:crypto";
|
|
142
142
|
import { createReadStream, createWriteStream, mkdirSync, statSync } from "node:fs";
|
|
143
143
|
import { rename, rm } from "node:fs/promises";
|
|
@@ -2,13 +2,13 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
checkCancelled
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ERJYJ36F.js";
|
|
6
6
|
import {
|
|
7
7
|
createOutputBuffer
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-S7SXSHRC.js";
|
|
9
9
|
import {
|
|
10
10
|
CliError
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ELJUBPY4.js";
|
|
12
12
|
import {
|
|
13
13
|
__name
|
|
14
14
|
} from "./chunk-ZVVMGPBJ.js";
|
|
@@ -2,164 +2,38 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
encodeWav
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-4YIGXTBP.js";
|
|
6
|
+
import {
|
|
7
|
+
providerWaitMs
|
|
8
|
+
} from "./chunk-FSCPQQS5.js";
|
|
6
9
|
import {
|
|
7
10
|
SAMPLE_RATE,
|
|
8
11
|
toModelRate
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OP5PGE2N.js";
|
|
10
13
|
import {
|
|
11
|
-
OPENAI_URL
|
|
12
|
-
|
|
14
|
+
OPENAI_URL,
|
|
15
|
+
refuseModelAddress
|
|
16
|
+
} from "./chunk-W3YTVEWV.js";
|
|
13
17
|
import {
|
|
14
18
|
OPENAI_TRANSCRIBE_MODEL,
|
|
15
19
|
VAD,
|
|
16
20
|
filesPresent,
|
|
17
21
|
modelsDirectory,
|
|
18
22
|
vadPath
|
|
19
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-D24OQAHM.js";
|
|
20
24
|
import {
|
|
21
25
|
DEFAULT_RETRY,
|
|
22
26
|
backoffMs
|
|
23
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-S7SXSHRC.js";
|
|
24
28
|
import {
|
|
25
|
-
CliError
|
|
26
|
-
|
|
27
|
-
} from "./chunk-FEM2JQN2.js";
|
|
29
|
+
CliError
|
|
30
|
+
} from "./chunk-ELJUBPY4.js";
|
|
28
31
|
import {
|
|
29
32
|
__name
|
|
30
33
|
} from "./chunk-ZVVMGPBJ.js";
|
|
31
34
|
|
|
32
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/speech/openai.js
|
|
33
36
|
import { setTimeout as wait } from "node:timers/promises";
|
|
34
|
-
|
|
35
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/http/body.js
|
|
36
|
-
var interrupted = /* @__PURE__ */ __name((signal) => isCliError(signal.reason) ? signal.reason : new CliError(signal.reason instanceof Error && signal.reason.name === "TimeoutError" ? "timeout" : "cancelled", "HTTP response read was interrupted"), "interrupted");
|
|
37
|
-
var checked = /* @__PURE__ */ __name((signal) => {
|
|
38
|
-
if (signal?.aborted)
|
|
39
|
-
throw interrupted(signal);
|
|
40
|
-
}, "checked");
|
|
41
|
-
var abortable = /* @__PURE__ */ __name(async (pending, signal) => {
|
|
42
|
-
if (!signal)
|
|
43
|
-
return pending;
|
|
44
|
-
let abort = /* @__PURE__ */ __name(() => {
|
|
45
|
-
}, "abort");
|
|
46
|
-
const stopped = new Promise((_, reject) => {
|
|
47
|
-
abort = /* @__PURE__ */ __name(() => reject(interrupted(signal)), "abort");
|
|
48
|
-
signal.addEventListener("abort", abort, { once: true });
|
|
49
|
-
if (signal.aborted)
|
|
50
|
-
abort();
|
|
51
|
-
});
|
|
52
|
-
try {
|
|
53
|
-
return await Promise.race([pending, stopped]);
|
|
54
|
-
} finally {
|
|
55
|
-
signal.removeEventListener("abort", abort);
|
|
56
|
-
}
|
|
57
|
-
}, "abortable");
|
|
58
|
-
var readJsonResponse = /* @__PURE__ */ __name(async (response, options) => {
|
|
59
|
-
const { maxBytes, signal } = options ?? {};
|
|
60
|
-
if (!Number.isSafeInteger(maxBytes) || maxBytes < 1)
|
|
61
|
-
throw new CliError("validation_error", "maxBytes must be a positive safe integer");
|
|
62
|
-
if (signal !== void 0 && !(signal instanceof AbortSignal))
|
|
63
|
-
throw new CliError("validation_error", "signal must be an AbortSignal");
|
|
64
|
-
if (signal?.aborted) {
|
|
65
|
-
void response.body?.cancel().catch(() => {
|
|
66
|
-
});
|
|
67
|
-
throw interrupted(signal);
|
|
68
|
-
}
|
|
69
|
-
const length = response.headers.get("content-length");
|
|
70
|
-
if (length !== null && (!/^\d+$/.test(length) || Number(length) > maxBytes)) {
|
|
71
|
-
void response.body?.cancel().catch(() => {
|
|
72
|
-
});
|
|
73
|
-
throw new CliError("invalid_response", "HTTP response exceeds the byte budget");
|
|
74
|
-
}
|
|
75
|
-
if (!response.body)
|
|
76
|
-
throw new CliError("invalid_response", "HTTP response has no body");
|
|
77
|
-
if (response.body.locked)
|
|
78
|
-
throw new CliError("invalid_response", "HTTP response body is already in use");
|
|
79
|
-
const reader = response.body.getReader();
|
|
80
|
-
const chunks = [];
|
|
81
|
-
let bytes = 0;
|
|
82
|
-
try {
|
|
83
|
-
for (; ; ) {
|
|
84
|
-
checked(signal);
|
|
85
|
-
const part = await abortable(reader.read(), signal);
|
|
86
|
-
checked(signal);
|
|
87
|
-
if (part.done)
|
|
88
|
-
break;
|
|
89
|
-
if (!(part.value instanceof Uint8Array))
|
|
90
|
-
throw new CliError("invalid_response", "HTTP response is not bytes");
|
|
91
|
-
bytes += part.value.byteLength;
|
|
92
|
-
if (bytes > maxBytes)
|
|
93
|
-
throw new CliError("invalid_response", "HTTP response exceeds the byte budget");
|
|
94
|
-
if (part.value.byteLength)
|
|
95
|
-
chunks.push(new Uint8Array(part.value));
|
|
96
|
-
}
|
|
97
|
-
const body = new Uint8Array(bytes);
|
|
98
|
-
let offset = 0;
|
|
99
|
-
for (const chunk of chunks) {
|
|
100
|
-
body.set(chunk, offset);
|
|
101
|
-
offset += chunk.byteLength;
|
|
102
|
-
}
|
|
103
|
-
try {
|
|
104
|
-
return JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(body));
|
|
105
|
-
} catch {
|
|
106
|
-
throw new CliError("invalid_response", "HTTP response is not valid UTF-8 JSON");
|
|
107
|
-
}
|
|
108
|
-
} catch (error) {
|
|
109
|
-
checked(signal);
|
|
110
|
-
if (isCliError(error))
|
|
111
|
-
throw error;
|
|
112
|
-
throw new CliError("network_error", "HTTP response could not be read");
|
|
113
|
-
} finally {
|
|
114
|
-
void reader.cancel().catch(() => {
|
|
115
|
-
});
|
|
116
|
-
reader.releaseLock();
|
|
117
|
-
}
|
|
118
|
-
}, "readJsonResponse");
|
|
119
|
-
|
|
120
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.80.8_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
|
|
121
|
-
var parseRetryAfter = /* @__PURE__ */ __name((header, now) => {
|
|
122
|
-
if (!header)
|
|
123
|
-
return void 0;
|
|
124
|
-
const trimmed = header.trim();
|
|
125
|
-
if (/^\d+$/.test(trimmed))
|
|
126
|
-
return Number(trimmed) * 1e3;
|
|
127
|
-
const at = Date.parse(trimmed);
|
|
128
|
-
if (Number.isNaN(at))
|
|
129
|
-
return void 0;
|
|
130
|
-
const delta = at - now().getTime();
|
|
131
|
-
return delta > 0 ? delta : void 0;
|
|
132
|
-
}, "parseRetryAfter");
|
|
133
|
-
var parseRateLimitReset = /* @__PURE__ */ __name((header, now) => {
|
|
134
|
-
if (!header)
|
|
135
|
-
return void 0;
|
|
136
|
-
const seconds = Number(header.trim());
|
|
137
|
-
if (!Number.isFinite(seconds))
|
|
138
|
-
return void 0;
|
|
139
|
-
const delta = seconds * 1e3 - now().getTime();
|
|
140
|
-
return delta > 0 ? delta : void 0;
|
|
141
|
-
}, "parseRateLimitReset");
|
|
142
|
-
var providerWaitMs = /* @__PURE__ */ __name((headers, now) => parseRetryAfter(headers.get("retry-after"), now) ?? parseRateLimitReset(headers.get("x-ratelimit-reset"), now), "providerWaitMs");
|
|
143
|
-
var retryableStatus = /* @__PURE__ */ __name((status) => status === 408 || status === 429 || status >= 500, "retryableStatus");
|
|
144
|
-
var statusToCode = /* @__PURE__ */ __name((status) => {
|
|
145
|
-
if (status === 400 || status === 422)
|
|
146
|
-
return "validation_error";
|
|
147
|
-
if (status === 401)
|
|
148
|
-
return "authentication_error";
|
|
149
|
-
if (status === 403)
|
|
150
|
-
return "permission_error";
|
|
151
|
-
if (status === 404)
|
|
152
|
-
return "not_found";
|
|
153
|
-
if (status === 408)
|
|
154
|
-
return "timeout";
|
|
155
|
-
if (status === 429)
|
|
156
|
-
return "rate_limited";
|
|
157
|
-
if (status === 502 || status === 503 || status === 504)
|
|
158
|
-
return "provider_unavailable";
|
|
159
|
-
return "provider_error";
|
|
160
|
-
}, "statusToCode");
|
|
161
|
-
|
|
162
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/speech/openai.js
|
|
163
37
|
var LONGEST_REQUEST_SECONDS = 600;
|
|
164
38
|
var JOINED_SECONDS = 0.2;
|
|
165
39
|
var PAD_SECONDS = 0.2;
|
|
@@ -172,7 +46,7 @@ var EXHAUSTED = /* @__PURE__ */ new Set([
|
|
|
172
46
|
"organization_usage_limit_exceeded"
|
|
173
47
|
]);
|
|
174
48
|
var RETRY = { ...DEFAULT_RETRY, retries: 4 };
|
|
175
|
-
var
|
|
49
|
+
var interrupted = /* @__PURE__ */ __name((signal) => {
|
|
176
50
|
if (!signal?.aborted)
|
|
177
51
|
return;
|
|
178
52
|
if (signal.reason instanceof CliError)
|
|
@@ -181,7 +55,7 @@ var interrupted2 = /* @__PURE__ */ __name((signal) => {
|
|
|
181
55
|
throw new CliError(timeout ? "timeout" : "cancelled", "the transcription was interrupted");
|
|
182
56
|
}, "interrupted");
|
|
183
57
|
var sleeping = /* @__PURE__ */ __name((ms, signal) => wait(ms, void 0, signal ? { signal } : {}).then(() => void 0, (error) => {
|
|
184
|
-
|
|
58
|
+
interrupted(signal);
|
|
185
59
|
throw error;
|
|
186
60
|
}), "sleeping");
|
|
187
61
|
var formOf = /* @__PURE__ */ __name((wav, options) => {
|
|
@@ -214,7 +88,7 @@ var send = /* @__PURE__ */ __name(async (wav, options) => {
|
|
|
214
88
|
const random = options.random ?? Math.random;
|
|
215
89
|
const url = `${(options.baseUrl ?? OPENAI_URL).replace(/\/+$/, "")}/audio/transcriptions`;
|
|
216
90
|
for (let attempt = 1; ; attempt++) {
|
|
217
|
-
|
|
91
|
+
interrupted(options.signal);
|
|
218
92
|
let response;
|
|
219
93
|
try {
|
|
220
94
|
response = await post(url, {
|
|
@@ -224,14 +98,14 @@ var send = /* @__PURE__ */ __name(async (wav, options) => {
|
|
|
224
98
|
...options.signal ? { signal: options.signal } : {}
|
|
225
99
|
});
|
|
226
100
|
} catch {
|
|
227
|
-
|
|
101
|
+
interrupted(options.signal);
|
|
228
102
|
if (attempt > retry.retries)
|
|
229
103
|
throw new CliError("network_error", "OpenAI could not be reached", { reason: "network.failed" });
|
|
230
104
|
await sleep(backoffMs(attempt, retry, random), options.signal);
|
|
231
105
|
continue;
|
|
232
106
|
}
|
|
233
107
|
if (response.ok) {
|
|
234
|
-
const body = await response.json().catch(() =>
|
|
108
|
+
const body = await response.json().catch(() => interrupted(options.signal));
|
|
235
109
|
if (typeof body?.text !== "string")
|
|
236
110
|
throw new CliError("invalid_response", "OpenAI answered without a transcript", {
|
|
237
111
|
reason: "provider.invalid-response"
|
|
@@ -281,7 +155,7 @@ var piecesOf = /* @__PURE__ */ __name((spans, limit) => {
|
|
|
281
155
|
return pieces;
|
|
282
156
|
}, "piecesOf");
|
|
283
157
|
var openCutter = /* @__PURE__ */ __name(async (vadModel) => {
|
|
284
|
-
const { openSpeechCutter } = await import("./recognize-
|
|
158
|
+
const { openSpeechCutter } = await import("./recognize-VF5CA7EM.js");
|
|
285
159
|
return openSpeechCutter(vadModel);
|
|
286
160
|
}, "openCutter");
|
|
287
161
|
var checkKeywords = /* @__PURE__ */ __name((keywords = []) => {
|
|
@@ -290,12 +164,13 @@ var checkKeywords = /* @__PURE__ */ __name((keywords = []) => {
|
|
|
290
164
|
throw new CliError("validation_error", "a keyword must be a non-empty single line without < or > \u2014 OpenAI refuses the whole request otherwise");
|
|
291
165
|
}, "checkKeywords");
|
|
292
166
|
var transcribeOpenAI = /* @__PURE__ */ __name(async (audio, options) => {
|
|
167
|
+
refuseModelAddress(options.env ?? process.env, options.baseUrl ?? OPENAI_URL, "audio");
|
|
293
168
|
if (!options.apiKey)
|
|
294
169
|
throw new CliError("authentication_error", "no OpenAI key \u2014 `models keys set openai`, or OPENAI_API_KEY", {
|
|
295
170
|
reason: "transcription.no-key"
|
|
296
171
|
});
|
|
297
172
|
checkKeywords(options.keywords);
|
|
298
|
-
|
|
173
|
+
interrupted(options.signal);
|
|
299
174
|
const pcm = toModelRate(audio.samples, audio.rate);
|
|
300
175
|
const duration = (pcm.length - LEAD) / SAMPLE_RATE;
|
|
301
176
|
if (options.bundle && duration <= LONGEST_REQUEST_SECONDS) {
|
|
@@ -327,10 +202,6 @@ var transcribeOpenAI = /* @__PURE__ */ __name(async (audio, options) => {
|
|
|
327
202
|
}, "transcribeOpenAI");
|
|
328
203
|
|
|
329
204
|
export {
|
|
330
|
-
readJsonResponse,
|
|
331
|
-
providerWaitMs,
|
|
332
|
-
retryableStatus,
|
|
333
|
-
statusToCode,
|
|
334
205
|
LONGEST_REQUEST_SECONDS,
|
|
335
206
|
piecesOf,
|
|
336
207
|
transcribeOpenAI
|