@wirecat/tg-cli 0.127.0 → 0.129.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/contracts/wirecat.json +26 -0
- package/dist/bin/tg.js +2 -2
- package/dist/bundle/{adapter-EZFS2UR6.js → adapter-2XFPXBTA.js} +60 -52
- package/dist/bundle/{all-profiles-TNIUBQK6.js → all-profiles-GXFPZLYU.js} +20 -30
- package/dist/bundle/{anthropic-NGIS5LTL.js → anthropic-FHS5XNK5.js} +5 -5
- package/dist/bundle/{app-server-RPU76G7D.js → app-server-IZMFSFP2.js} +56 -63
- package/dist/bundle/{bot-api-QJ6U6BLG.js → bot-api-LQP75V5I.js} +61 -53
- package/dist/bundle/{bot-history-THULK2C6.js → bot-history-EJQOD4AQ.js} +22 -18
- package/dist/bundle/{bun-QLSLLP27.js → bun-GBAZFRCV.js} +2 -2
- package/dist/bundle/{bun-sqlite-SH5245ZY.js → bun-sqlite-JB4BX6X7.js} +6 -6
- package/dist/bundle/chunk-2JZJPVBH.js +334 -0
- package/dist/bundle/{chunk-DNNYE6PS.js → chunk-2LPODKIF.js} +18 -15
- package/dist/bundle/chunk-3KZG63EH.js +170 -0
- package/dist/bundle/chunk-3XMUP55N.js +372 -0
- package/dist/bundle/{chunk-BWHVHPAQ.js → chunk-4BJAQNJ5.js} +9 -9
- package/dist/bundle/{chunk-M4OP5ASJ.js → chunk-66PL7P4C.js} +1 -1
- package/dist/bundle/{chunk-JWEKUAVZ.js → chunk-66UG67CE.js} +12 -12
- package/dist/bundle/{chunk-R52ZZZKZ.js → chunk-6JBRQ6PM.js} +55 -22
- package/dist/bundle/{chunk-Y7UA7HGL.js → chunk-6M3FAHPS.js} +3 -3
- package/dist/bundle/{chunk-TGKTIDYS.js → chunk-7F3LOHRB.js} +290 -504
- package/dist/bundle/{chunk-XS5C5TQ7.js → chunk-AUNNJDVD.js} +25 -8
- package/dist/bundle/{chunk-ERUB3KU3.js → chunk-B5RGPZDZ.js} +7 -7
- package/dist/bundle/{chunk-YRZXOQOB.js → chunk-B6NQJAUC.js} +2 -2
- package/dist/bundle/{chunk-4FFKCC7Y.js → chunk-BMSS3PCY.js} +62 -36
- package/dist/bundle/{chunk-VMV5CMLH.js → chunk-C4ALE7CH.js} +1 -1
- package/dist/bundle/{chunk-K4VO7S6Q.js → chunk-CKJ73EF3.js} +1 -1
- package/dist/bundle/{chunk-IX3GUNGV.js → chunk-CLG2ISQH.js} +4 -4
- package/dist/bundle/{chunk-MTU3UP5U.js → chunk-EB2JE722.js} +1 -1
- package/dist/bundle/{chunk-EGNQSWPH.js → chunk-EUL7HMUL.js} +2 -2
- package/dist/bundle/{chunk-2R6ZSE3O.js → chunk-F6CV4KUN.js} +2 -2
- package/dist/bundle/{chunk-7KCBPAQS.js → chunk-F6MLJ3V5.js} +2 -2
- package/dist/bundle/{chunk-ZSS3BH6Z.js → chunk-FH4YIBBH.js} +4 -4
- package/dist/bundle/chunk-FIO5NMK3.js +771 -0
- package/dist/bundle/{chunk-FSDLSEZA.js → chunk-G2SMVYBU.js} +2 -2
- package/dist/bundle/{chunk-FIVFP53N.js → chunk-GA3URWIF.js} +1 -1
- package/dist/bundle/{chunk-4CQ3PV3V.js → chunk-GGGBPWUS.js} +10 -15
- package/dist/bundle/{chunk-3CV5TBBR.js → chunk-GSHTLLCJ.js} +2 -2
- package/dist/bundle/{chunk-IWJ5OLU6.js → chunk-GYCKRIRK.js} +3 -3
- package/dist/bundle/{chunk-H7GAFD4N.js → chunk-HHUK3XO5.js} +1 -1
- package/dist/bundle/{chunk-NM5GBJME.js → chunk-HT6OFANN.js} +19 -19
- package/dist/bundle/{chunk-GHVRCLJI.js → chunk-I5PILOTU.js} +1 -1
- package/dist/bundle/chunk-IBSHQWIJ.js +29 -0
- package/dist/bundle/{chunk-5SN6KFPC.js → chunk-IRWSZJYL.js} +65 -60
- package/dist/bundle/{chunk-3I3TGKVG.js → chunk-IV6SIKVH.js} +4 -4
- package/dist/bundle/{chunk-URFBZNLU.js → chunk-JUFLELQ7.js} +2 -2
- package/dist/bundle/{chunk-5FDYMMEQ.js → chunk-KY3JLXW2.js} +4 -4
- package/dist/bundle/{chunk-YZGIQY2R.js → chunk-LPT5T6PU.js} +37 -28
- package/dist/bundle/chunk-LQPZDDDP.js +259 -0
- package/dist/bundle/{chunk-CXWAKV2O.js → chunk-M327UNS6.js} +6 -6
- package/dist/bundle/{chunk-4MKRKW6V.js → chunk-MS6YEIG5.js} +13 -13
- package/dist/bundle/{chunk-UY2TRFYN.js → chunk-MVFSWKTM.js} +12 -12
- package/dist/bundle/{chunk-45URY64S.js → chunk-NRCY3WBC.js} +2 -2
- package/dist/bundle/{chunk-SN52ZGFN.js → chunk-O2ULG7OO.js} +3 -3
- package/dist/bundle/{chunk-JF7D2Y4K.js → chunk-OJMDKWWL.js} +670 -519
- package/dist/bundle/{chunk-UW34Z7J3.js → chunk-OKTRB4ZQ.js} +1 -1
- package/dist/bundle/{chunk-7GE6KMLB.js → chunk-OOQVHMCS.js} +15 -15
- package/dist/bundle/{chunk-P5NJECXX.js → chunk-OWVQMK7G.js} +939 -909
- package/dist/bundle/{chunk-YIPOWJPN.js → chunk-P4FZJO5F.js} +2 -2
- package/dist/bundle/{chunk-LD42OGKK.js → chunk-PS7ZS5HD.js} +4 -4
- package/dist/bundle/{chunk-J6FHZXNS.js → chunk-PWQKGFS2.js} +49 -55
- package/dist/bundle/{chunk-APSMQIA4.js → chunk-QBNEWEJC.js} +3 -3
- package/dist/bundle/{chunk-Y65BQJOY.js → chunk-QDEP2QOA.js} +3 -3
- package/dist/bundle/{chunk-FD44T7HC.js → chunk-QFVIHBLD.js} +1 -1
- package/dist/bundle/{chunk-5KZKVKWU.js → chunk-QJDHRBXL.js} +7 -7
- package/dist/bundle/{chunk-LOG65WHO.js → chunk-QJLCEOAP.js} +1 -1
- package/dist/bundle/{chunk-XUAVZ6YX.js → chunk-RAFK5KXU.js} +9 -9
- package/dist/bundle/{chunk-UIQMBOXU.js → chunk-RPWYTOLI.js} +5 -5
- package/dist/bundle/{chunk-QPVCFSVU.js → chunk-RZPMFVWM.js} +6 -6
- package/dist/bundle/chunk-S5UTBEV3.js +1974 -0
- package/dist/bundle/{chunk-X4ECHJNG.js → chunk-SYZXOEHY.js} +98 -6
- package/dist/bundle/{chunk-BNM6KNUQ.js → chunk-SZB5WRMI.js} +2 -2
- package/dist/bundle/{chunk-5AOFOJQA.js → chunk-TGRB4SSZ.js} +4 -4
- package/dist/bundle/{chunk-Y62I2T36.js → chunk-VSPSHBAC.js} +2 -2
- package/dist/bundle/{chunk-JFQZ6BWI.js → chunk-VTJ3AOTT.js} +17 -17
- package/dist/bundle/{chunk-HPM47WO3.js → chunk-VXWDQDRU.js} +6130 -6675
- package/dist/bundle/{chunk-S3XUJPPL.js → chunk-X5H5NERR.js} +6 -6
- package/dist/bundle/{chunk-3WI53AA4.js → chunk-XHX5D5VE.js} +1174 -2636
- package/dist/bundle/chunk-XXW6PFAX.js +16 -0
- package/dist/bundle/{chunk-NBN5OYXH.js → chunk-ZRQQOGAZ.js} +4 -4
- package/dist/bundle/command-contract-G752BLKA.js +37 -0
- package/dist/bundle/{command-server-entry-UG2CLYXI.js → command-server-entry-YR6ONDWO.js} +27 -24
- package/dist/bundle/decode-VUKGWFSW.js +296 -0
- package/dist/bundle/{dispatch-PRAIGIFS.js → dispatch-ST5FK2KI.js} +8 -8
- package/dist/bundle/{echarts-CN6ZVAJZ.js → echarts-GOV5M733.js} +2 -2
- package/dist/bundle/{embed-M4EHIKA5.js → embed-2IVIYNAJ.js} +6 -6
- package/dist/bundle/{embedder-K2XL2UB4.js → embedder-2HU7JYZK.js} +9 -9
- package/dist/bundle/{entry-6M55YL2H.js → entry-CSTCXYI5.js} +9 -9
- package/dist/bundle/{failure-7Y34AUJT.js → failure-GMUQKQ5K.js} +2 -2
- package/dist/bundle/{first-run-TLJILIOF.js → first-run-3IZGXZT5.js} +12 -11
- package/dist/bundle/first-screen-7QSNCZIK.js +35 -0
- package/dist/bundle/{instructions-QLC2AXAB.js → instructions-YSXV6FAC.js} +1 -1
- package/dist/bundle/{mcp-TDKGDB4V.js → mcp-VFIOZDVY.js} +2 -2
- package/dist/bundle/meeting-combined-X4E3LSIJ.js +23 -0
- package/dist/bundle/meeting-model-FQBDHGRU.js +24 -0
- package/dist/bundle/meeting-semantic-ONNEOJX5.js +21 -0
- package/dist/bundle/{node-BAA3T4CH.js → node-FMQWCZRS.js} +2 -2
- package/dist/bundle/{node-sqlite-FNYVHQCO.js → node-sqlite-YN5OKOC6.js} +7 -7
- package/dist/bundle/{oauth-32T5KL5E.js → oauth-EW7PTZVT.js} +7 -7
- package/dist/bundle/{open-4VQ6FUEI.js → open-Q2RDY344.js} +5 -5
- package/dist/bundle/{openai-HDOKCN3Z.js → openai-STON6G3O.js} +28 -26
- package/dist/bundle/{process-GOUBIWKC.js → process-OQUC2TW3.js} +1 -1
- package/dist/bundle/{program-QFXJL2R5.js → program-7JJHTZ25.js} +66 -57
- package/dist/bundle/{prompt-YYODWYFO.js → prompt-WHVF7UTW.js} +5 -5
- package/dist/bundle/{proxy-transport-DP7SIMIC.js → proxy-transport-A4MRO3PF.js} +5 -5
- package/dist/bundle/{recognize-7ZULX5HL.js → recognize-YDQWMXNI.js} +4 -4
- package/dist/bundle/{remote-TUG7M5Y5.js → remote-477LQHP6.js} +9 -9
- package/dist/bundle/{rerank-D2EZWG66.js → rerank-4YPB26FG.js} +7 -7
- package/dist/bundle/{serve-MP3GA2XX.js → serve-FXJNUOTS.js} +9 -9
- package/dist/bundle/{server-D277L3H3.js → server-2S6HFBGR.js} +52 -42
- package/dist/bundle/server-UOSUTZNE.js +69 -0
- package/dist/bundle/{sqlite-runtime-XHZXEOLY.js → sqlite-runtime-RXYNJYMC.js} +6 -6
- package/dist/bundle/{state-YI3W6HGO.js → state-I2GGYGRL.js} +6 -6
- package/dist/bundle/{store-CIZPJFWE.js → store-KX3AAQZH.js} +25 -20
- package/dist/bundle/{store-C4RFPYPK.js → store-VQXIB6KV.js} +17 -13
- package/dist/bundle/store-maintenance-command-LW2MMDLY.js +60 -0
- package/dist/bundle/tg.js +13 -13
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/bundle/chunk-ZIPUVOGT.js +0 -76
- package/dist/bundle/command-contract-DY6Y4TES.js +0 -34
- package/dist/bundle/decode-3NEUZJ2N.js +0 -162
- package/dist/bundle/first-screen-WME7ILW2.js +0 -32
- package/dist/bundle/server-GEP7QXGI.js +0 -62
- package/dist/bundle/store-maintenance-command-JNDYWFD2.js +0 -52
- /package/dist/bundle/{chunk-XWBPP2HX.js → chunk-ZI3YTXSF.js} +0 -0
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.129.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = "0.
|
|
1
|
+
export const VERSION = "0.129.0";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/tg-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.129.0",
|
|
4
4
|
"description": "A local command line interface for a personal Telegram account, built for agents and scripts",
|
|
5
5
|
"mcpName": "dev.wirecat/tg-cli",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"@mtcute/node": "0.32.7",
|
|
75
|
-
"@wirecat/cli-base": "0.
|
|
76
|
-
"@wirecat/cli-core": "0.
|
|
75
|
+
"@wirecat/cli-base": "0.101.0",
|
|
76
|
+
"@wirecat/cli-core": "0.665.0",
|
|
77
77
|
"commander": "15.0.0",
|
|
78
78
|
"undici": "8.12.3",
|
|
79
79
|
"valibot": "1.5.0"
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
__name
|
|
5
|
-
} from "./chunk-ZVVMGPBJ.js";
|
|
6
|
-
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.659.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._7ae9f69690019eb17dc9f8442c19cb73/node_modules/@wirecat/cli-core/dist/mcp/stdio-wire.js
|
|
8
|
-
import { PassThrough, Writable } from "node:stream";
|
|
9
|
-
var lineReader = /* @__PURE__ */ __name((onMessage) => {
|
|
10
|
-
let rest = "";
|
|
11
|
-
return (chunk) => {
|
|
12
|
-
const lines = (rest + chunk.toString()).split("\n");
|
|
13
|
-
rest = lines.pop() ?? "";
|
|
14
|
-
for (const line of lines) {
|
|
15
|
-
try {
|
|
16
|
-
const message = JSON.parse(line);
|
|
17
|
-
if (message !== null && typeof message === "object")
|
|
18
|
-
onMessage(message);
|
|
19
|
-
} catch {
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
}, "lineReader");
|
|
24
|
-
var answeredWire = /* @__PURE__ */ __name((source, sink) => {
|
|
25
|
-
const asked = /* @__PURE__ */ new Set();
|
|
26
|
-
let settle;
|
|
27
|
-
const input = new PassThrough();
|
|
28
|
-
const onData = lineReader(({ id, method }) => {
|
|
29
|
-
if (id !== void 0 && typeof method === "string")
|
|
30
|
-
asked.add(JSON.stringify(id));
|
|
31
|
-
});
|
|
32
|
-
const output = new Writable({
|
|
33
|
-
write: /* @__PURE__ */ __name((chunk, _encoding, done) => {
|
|
34
|
-
noteAnswer(chunk);
|
|
35
|
-
sink.write(chunk, done);
|
|
36
|
-
}, "write")
|
|
37
|
-
});
|
|
38
|
-
const noteAnswer = lineReader(({ id, method }) => {
|
|
39
|
-
if (id === void 0 || method !== void 0)
|
|
40
|
-
return;
|
|
41
|
-
asked.delete(JSON.stringify(id));
|
|
42
|
-
if (asked.size === 0)
|
|
43
|
-
settle?.();
|
|
44
|
-
});
|
|
45
|
-
const forward = /* @__PURE__ */ __name((chunk) => {
|
|
46
|
-
onData(chunk);
|
|
47
|
-
input.write(chunk);
|
|
48
|
-
}, "forward");
|
|
49
|
-
source.on("data", forward);
|
|
50
|
-
const ended = new Promise((resolve) => {
|
|
51
|
-
source.once("end", resolve);
|
|
52
|
-
source.once("close", resolve);
|
|
53
|
-
});
|
|
54
|
-
return {
|
|
55
|
-
input,
|
|
56
|
-
output,
|
|
57
|
-
ended,
|
|
58
|
-
answered: /* @__PURE__ */ __name(() => new Promise((resolve) => {
|
|
59
|
-
if (asked.size === 0)
|
|
60
|
-
resolve();
|
|
61
|
-
else
|
|
62
|
-
settle = resolve;
|
|
63
|
-
}), "answered"),
|
|
64
|
-
/** Lets go of the real stdin, so it no longer holds the process open. */
|
|
65
|
-
release: /* @__PURE__ */ __name(() => {
|
|
66
|
-
source.off("data", forward);
|
|
67
|
-
if (source.listenerCount("data") === 0)
|
|
68
|
-
source.pause();
|
|
69
|
-
input.end();
|
|
70
|
-
}, "release")
|
|
71
|
-
};
|
|
72
|
-
}, "answeredWire");
|
|
73
|
-
|
|
74
|
-
export {
|
|
75
|
-
answeredWire
|
|
76
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
SCHEMA_DIALECT,
|
|
5
|
-
commandContract,
|
|
6
|
-
commandPathOf,
|
|
7
|
-
findCommand,
|
|
8
|
-
outputOf
|
|
9
|
-
} from "./chunk-5FDYMMEQ.js";
|
|
10
|
-
import "./chunk-TGKTIDYS.js";
|
|
11
|
-
import "./chunk-5KZKVKWU.js";
|
|
12
|
-
import "./chunk-Y65BQJOY.js";
|
|
13
|
-
import "./chunk-45URY64S.js";
|
|
14
|
-
import "./chunk-FD44T7HC.js";
|
|
15
|
-
import "./chunk-UIQMBOXU.js";
|
|
16
|
-
import "./chunk-IWJ5OLU6.js";
|
|
17
|
-
import "./chunk-3I3TGKVG.js";
|
|
18
|
-
import "./chunk-3WI53AA4.js";
|
|
19
|
-
import "./chunk-APSMQIA4.js";
|
|
20
|
-
import "./chunk-ERUB3KU3.js";
|
|
21
|
-
import "./chunk-XWBPP2HX.js";
|
|
22
|
-
import "./chunk-Y62I2T36.js";
|
|
23
|
-
import "./chunk-NM5GBJME.js";
|
|
24
|
-
import "./chunk-XS5C5TQ7.js";
|
|
25
|
-
import "./chunk-Y5E2WNWB.js";
|
|
26
|
-
import "./chunk-7KCBPAQS.js";
|
|
27
|
-
import "./chunk-ZVVMGPBJ.js";
|
|
28
|
-
export {
|
|
29
|
-
SCHEMA_DIALECT,
|
|
30
|
-
commandContract,
|
|
31
|
-
commandPathOf,
|
|
32
|
-
findCommand,
|
|
33
|
-
outputOf
|
|
34
|
-
};
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
SAMPLE_RATE,
|
|
5
|
-
decodeOgg
|
|
6
|
-
} from "./chunk-NBN5OYXH.js";
|
|
7
|
-
import "./chunk-NM5GBJME.js";
|
|
8
|
-
import "./chunk-XS5C5TQ7.js";
|
|
9
|
-
import {
|
|
10
|
-
importFrom
|
|
11
|
-
} from "./chunk-Y5E2WNWB.js";
|
|
12
|
-
import {
|
|
13
|
-
CliError
|
|
14
|
-
} from "./chunk-7KCBPAQS.js";
|
|
15
|
-
import {
|
|
16
|
-
__name
|
|
17
|
-
} from "./chunk-ZVVMGPBJ.js";
|
|
18
|
-
|
|
19
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.659.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._7ae9f69690019eb17dc9f8442c19cb73/node_modules/@wirecat/cli-core/dist/speech/decode.js
|
|
20
|
-
import { spawn } from "node:child_process";
|
|
21
|
-
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
22
|
-
import { createRequire } from "node:module";
|
|
23
|
-
import { tmpdir } from "node:os";
|
|
24
|
-
import { join } from "node:path";
|
|
25
|
-
import { pathToFileURL } from "node:url";
|
|
26
|
-
var LONGEST_AUDIO_SECONDS = 3600;
|
|
27
|
-
var FFMPEG_TIMEOUT_MS = 12e4;
|
|
28
|
-
var FFMPEG_FORMATS = "mov,mp4,m4a,3gp,3g2,mj2,aac,mp3,wav,amr,caf,aiff,flac,ogg,matroska,webm,asf";
|
|
29
|
-
var text = /* @__PURE__ */ __name((bytes, from, length) => String.fromCharCode(...bytes.subarray(from, from + length)), "text");
|
|
30
|
-
var contains = /* @__PURE__ */ __name((bytes, needle, within) => Buffer.from(bytes.buffer, bytes.byteOffset, Math.min(bytes.length, within)).includes(needle, 0, "latin1"), "contains");
|
|
31
|
-
var formatOf = /* @__PURE__ */ __name((bytes) => {
|
|
32
|
-
if (text(bytes, 0, 4) === "OggS") {
|
|
33
|
-
if (contains(bytes, "OpusHead", 128))
|
|
34
|
-
return "opus";
|
|
35
|
-
if (contains(bytes, "vorbis", 128))
|
|
36
|
-
return "vorbis";
|
|
37
|
-
return "other";
|
|
38
|
-
}
|
|
39
|
-
if (text(bytes, 0, 4) === "fLaC")
|
|
40
|
-
return "flac";
|
|
41
|
-
const frame = bytes[0] === 255 && ((bytes[1] ?? 0) & 224) === 224 && ((bytes[1] ?? 0) >> 1 & 3) !== 0;
|
|
42
|
-
if (text(bytes, 0, 3) === "ID3" || frame)
|
|
43
|
-
return "mp3";
|
|
44
|
-
return "other";
|
|
45
|
-
}, "formatOf");
|
|
46
|
-
var everyChannel = /* @__PURE__ */ __name((decoded) => {
|
|
47
|
-
if (!decoded.channelData[0] || decoded.samplesDecoded === 0)
|
|
48
|
-
throw new CliError("validation_error", "no audio in that file");
|
|
49
|
-
return decoded.channelData.map((samples) => ({ samples, rate: decoded.sampleRate }));
|
|
50
|
-
}, "everyChannel");
|
|
51
|
-
var load = /* @__PURE__ */ __name((name) => importFrom(new URL("speech/decode.js", import.meta.resolve("@wirecat/cli-core")).href, pathToFileURL(createRequire(new URL("speech/decode.js", import.meta.resolve("@wirecat/cli-core")).href).resolve(name)).href), "load");
|
|
52
|
-
var decodeVorbis = /* @__PURE__ */ __name(async (bytes) => {
|
|
53
|
-
const { OggVorbisDecoder } = await load("@wasm-audio-decoders/ogg-vorbis");
|
|
54
|
-
const decoder = new OggVorbisDecoder();
|
|
55
|
-
await decoder.ready;
|
|
56
|
-
try {
|
|
57
|
-
return everyChannel(await decoder.decodeFile(bytes));
|
|
58
|
-
} finally {
|
|
59
|
-
decoder.free();
|
|
60
|
-
}
|
|
61
|
-
}, "decodeVorbis");
|
|
62
|
-
var decodeFlac = /* @__PURE__ */ __name(async (bytes) => {
|
|
63
|
-
const { FLACDecoder } = await load("@wasm-audio-decoders/flac");
|
|
64
|
-
const decoder = new FLACDecoder();
|
|
65
|
-
await decoder.ready;
|
|
66
|
-
try {
|
|
67
|
-
return everyChannel(await decoder.decodeFile(bytes));
|
|
68
|
-
} finally {
|
|
69
|
-
decoder.free();
|
|
70
|
-
}
|
|
71
|
-
}, "decodeFlac");
|
|
72
|
-
var decodeMp3 = /* @__PURE__ */ __name(async (bytes) => {
|
|
73
|
-
const { MPEGDecoder } = await load("mpg123-decoder");
|
|
74
|
-
const decoder = new MPEGDecoder();
|
|
75
|
-
await decoder.ready;
|
|
76
|
-
try {
|
|
77
|
-
return everyChannel(decoder.decode(bytes));
|
|
78
|
-
} finally {
|
|
79
|
-
decoder.free();
|
|
80
|
-
}
|
|
81
|
-
}, "decodeMp3");
|
|
82
|
-
var runFfmpeg = /* @__PURE__ */ __name(async (bytes) => {
|
|
83
|
-
const directory = await mkdtemp(join(tmpdir(), "wirecat-audio-"));
|
|
84
|
-
try {
|
|
85
|
-
const input = join(directory, "audio");
|
|
86
|
-
await writeFile(input, bytes, { mode: 384 });
|
|
87
|
-
const largest = LONGEST_AUDIO_SECONDS * SAMPLE_RATE * 4;
|
|
88
|
-
const output = await new Promise((resolve, reject) => {
|
|
89
|
-
const child = spawn("ffmpeg", [
|
|
90
|
-
"-nostdin",
|
|
91
|
-
"-hide_banner",
|
|
92
|
-
"-loglevel",
|
|
93
|
-
"error",
|
|
94
|
-
"-protocol_whitelist",
|
|
95
|
-
"file",
|
|
96
|
-
"-format_whitelist",
|
|
97
|
-
FFMPEG_FORMATS,
|
|
98
|
-
"-i",
|
|
99
|
-
input,
|
|
100
|
-
"-vn",
|
|
101
|
-
"-ac",
|
|
102
|
-
"1",
|
|
103
|
-
"-ar",
|
|
104
|
-
String(SAMPLE_RATE),
|
|
105
|
-
"-f",
|
|
106
|
-
"f32le",
|
|
107
|
-
"pipe:1"
|
|
108
|
-
], { stdio: ["ignore", "pipe", "pipe"], timeout: FFMPEG_TIMEOUT_MS });
|
|
109
|
-
const chunks = [];
|
|
110
|
-
let size = 0;
|
|
111
|
-
let errors = "";
|
|
112
|
-
child.stdout.on("data", (chunk) => {
|
|
113
|
-
size += chunk.length;
|
|
114
|
-
if (size > largest)
|
|
115
|
-
child.kill();
|
|
116
|
-
else
|
|
117
|
-
chunks.push(chunk);
|
|
118
|
-
});
|
|
119
|
-
child.stderr.on("data", (chunk) => {
|
|
120
|
-
errors = (errors + chunk.toString()).slice(-500);
|
|
121
|
-
});
|
|
122
|
-
child.on("error", (error) => reject(error.code === "ENOENT" ? new CliError("validation_error", "only ffmpeg reads this audio format, and ffmpeg is not installed") : error));
|
|
123
|
-
child.on("close", (code) => {
|
|
124
|
-
if (size > largest)
|
|
125
|
-
reject(new CliError("validation_error", `the audio is longer than ${LONGEST_AUDIO_SECONDS / 60} minutes`));
|
|
126
|
-
else if (code === 0)
|
|
127
|
-
resolve(Buffer.concat(chunks));
|
|
128
|
-
else
|
|
129
|
-
reject(new CliError("validation_error", `ffmpeg could not read the audio: ${errors.trim() || code}`));
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
const samples = new Float32Array(Math.floor(output.length / 4));
|
|
133
|
-
Buffer.from(samples.buffer).set(output.subarray(0, samples.length * 4));
|
|
134
|
-
return { samples, rate: SAMPLE_RATE };
|
|
135
|
-
} finally {
|
|
136
|
-
await rm(directory, { recursive: true, force: true });
|
|
137
|
-
}
|
|
138
|
-
}, "runFfmpeg");
|
|
139
|
-
var BUNDLED = {
|
|
140
|
-
opus: decodeOgg,
|
|
141
|
-
vorbis: decodeVorbis,
|
|
142
|
-
flac: decodeFlac,
|
|
143
|
-
mp3: decodeMp3
|
|
144
|
-
};
|
|
145
|
-
var tooLong = /* @__PURE__ */ __name((pcm) => pcm.samples.length / pcm.rate > LONGEST_AUDIO_SECONDS, "tooLong");
|
|
146
|
-
var decodeChannels = /* @__PURE__ */ __name(async (bytes, ffmpeg = runFfmpeg) => {
|
|
147
|
-
const format = formatOf(bytes);
|
|
148
|
-
const decoded = format === "other" ? { channels: [await ffmpeg(bytes)], mixed: true } : await BUNDLED[format](bytes).then((channels) => ({ channels, mixed: false }), (error) => ffmpeg(bytes).then((pcm) => ({ channels: [pcm], mixed: true }), () => {
|
|
149
|
-
throw error;
|
|
150
|
-
}));
|
|
151
|
-
if (decoded.channels.some(tooLong))
|
|
152
|
-
throw new CliError("validation_error", `the audio is longer than ${LONGEST_AUDIO_SECONDS / 60} minutes`);
|
|
153
|
-
return decoded;
|
|
154
|
-
}, "decodeChannels");
|
|
155
|
-
var decodeAudio = /* @__PURE__ */ __name(async (bytes, ffmpeg = runFfmpeg) => (await decodeChannels(bytes, ffmpeg)).channels[0], "decodeAudio");
|
|
156
|
-
export {
|
|
157
|
-
LONGEST_AUDIO_SECONDS,
|
|
158
|
-
decodeAudio,
|
|
159
|
-
decodeChannels,
|
|
160
|
-
formatOf,
|
|
161
|
-
runFfmpeg
|
|
162
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
WIRECAT_TOOLS,
|
|
5
|
-
firstScreen,
|
|
6
|
-
installHelp
|
|
7
|
-
} from "./chunk-S3XUJPPL.js";
|
|
8
|
-
import "./chunk-2ABQZVK4.js";
|
|
9
|
-
import "./chunk-5FDYMMEQ.js";
|
|
10
|
-
import "./chunk-TGKTIDYS.js";
|
|
11
|
-
import "./chunk-5KZKVKWU.js";
|
|
12
|
-
import "./chunk-Y65BQJOY.js";
|
|
13
|
-
import "./chunk-45URY64S.js";
|
|
14
|
-
import "./chunk-FD44T7HC.js";
|
|
15
|
-
import "./chunk-UIQMBOXU.js";
|
|
16
|
-
import "./chunk-IWJ5OLU6.js";
|
|
17
|
-
import "./chunk-3I3TGKVG.js";
|
|
18
|
-
import "./chunk-3WI53AA4.js";
|
|
19
|
-
import "./chunk-APSMQIA4.js";
|
|
20
|
-
import "./chunk-ERUB3KU3.js";
|
|
21
|
-
import "./chunk-XWBPP2HX.js";
|
|
22
|
-
import "./chunk-Y62I2T36.js";
|
|
23
|
-
import "./chunk-NM5GBJME.js";
|
|
24
|
-
import "./chunk-XS5C5TQ7.js";
|
|
25
|
-
import "./chunk-Y5E2WNWB.js";
|
|
26
|
-
import "./chunk-7KCBPAQS.js";
|
|
27
|
-
import "./chunk-ZVVMGPBJ.js";
|
|
28
|
-
export {
|
|
29
|
-
WIRECAT_TOOLS,
|
|
30
|
-
firstScreen,
|
|
31
|
-
installHelp
|
|
32
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
PER_RUN,
|
|
5
|
-
createServer,
|
|
6
|
-
envelope,
|
|
7
|
-
serveOverHttpUntilStopped,
|
|
8
|
-
serveOverStdio
|
|
9
|
-
} from "./chunk-J6FHZXNS.js";
|
|
10
|
-
import "./chunk-YZGIQY2R.js";
|
|
11
|
-
import "./chunk-ZIPUVOGT.js";
|
|
12
|
-
import "./chunk-4FFKCC7Y.js";
|
|
13
|
-
import "./chunk-R52ZZZKZ.js";
|
|
14
|
-
import "./chunk-X4ECHJNG.js";
|
|
15
|
-
import "./chunk-LOG65WHO.js";
|
|
16
|
-
import "./chunk-5D4AEUVA.js";
|
|
17
|
-
import "./chunk-5AOFOJQA.js";
|
|
18
|
-
import "./chunk-DNNYE6PS.js";
|
|
19
|
-
import "./chunk-P5NJECXX.js";
|
|
20
|
-
import "./chunk-4MKRKW6V.js";
|
|
21
|
-
import "./chunk-LD42OGKK.js";
|
|
22
|
-
import "./chunk-FIVFP53N.js";
|
|
23
|
-
import "./chunk-SN52ZGFN.js";
|
|
24
|
-
import "./chunk-XUAVZ6YX.js";
|
|
25
|
-
import "./chunk-JFQZ6BWI.js";
|
|
26
|
-
import "./chunk-QPVCFSVU.js";
|
|
27
|
-
import "./chunk-GHVRCLJI.js";
|
|
28
|
-
import "./chunk-FSDLSEZA.js";
|
|
29
|
-
import "./chunk-HPM47WO3.js";
|
|
30
|
-
import "./chunk-4CQ3PV3V.js";
|
|
31
|
-
import "./chunk-K4VO7S6Q.js";
|
|
32
|
-
import "./chunk-ZSS3BH6Z.js";
|
|
33
|
-
import "./chunk-M4OP5ASJ.js";
|
|
34
|
-
import "./chunk-D72URWJE.js";
|
|
35
|
-
import "./chunk-CXWAKV2O.js";
|
|
36
|
-
import "./chunk-VMV5CMLH.js";
|
|
37
|
-
import "./chunk-5FDYMMEQ.js";
|
|
38
|
-
import "./chunk-TGKTIDYS.js";
|
|
39
|
-
import "./chunk-5KZKVKWU.js";
|
|
40
|
-
import "./chunk-Y65BQJOY.js";
|
|
41
|
-
import "./chunk-45URY64S.js";
|
|
42
|
-
import "./chunk-FD44T7HC.js";
|
|
43
|
-
import "./chunk-UIQMBOXU.js";
|
|
44
|
-
import "./chunk-IWJ5OLU6.js";
|
|
45
|
-
import "./chunk-3I3TGKVG.js";
|
|
46
|
-
import "./chunk-3WI53AA4.js";
|
|
47
|
-
import "./chunk-APSMQIA4.js";
|
|
48
|
-
import "./chunk-ERUB3KU3.js";
|
|
49
|
-
import "./chunk-XWBPP2HX.js";
|
|
50
|
-
import "./chunk-Y62I2T36.js";
|
|
51
|
-
import "./chunk-NM5GBJME.js";
|
|
52
|
-
import "./chunk-XS5C5TQ7.js";
|
|
53
|
-
import "./chunk-Y5E2WNWB.js";
|
|
54
|
-
import "./chunk-7KCBPAQS.js";
|
|
55
|
-
import "./chunk-ZVVMGPBJ.js";
|
|
56
|
-
export {
|
|
57
|
-
PER_RUN,
|
|
58
|
-
createServer,
|
|
59
|
-
envelope,
|
|
60
|
-
serveOverHttpUntilStopped,
|
|
61
|
-
serveOverStdio
|
|
62
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
addStoreMaintenanceCommands,
|
|
5
|
-
buildStems,
|
|
6
|
-
storeMaintenanceCommands,
|
|
7
|
-
storeSummary
|
|
8
|
-
} from "./chunk-5SN6KFPC.js";
|
|
9
|
-
import "./chunk-DNNYE6PS.js";
|
|
10
|
-
import "./chunk-P5NJECXX.js";
|
|
11
|
-
import "./chunk-4MKRKW6V.js";
|
|
12
|
-
import "./chunk-LD42OGKK.js";
|
|
13
|
-
import "./chunk-FIVFP53N.js";
|
|
14
|
-
import "./chunk-SN52ZGFN.js";
|
|
15
|
-
import "./chunk-XUAVZ6YX.js";
|
|
16
|
-
import "./chunk-JFQZ6BWI.js";
|
|
17
|
-
import "./chunk-QPVCFSVU.js";
|
|
18
|
-
import "./chunk-2ABQZVK4.js";
|
|
19
|
-
import "./chunk-Y7UA7HGL.js";
|
|
20
|
-
import "./chunk-FSDLSEZA.js";
|
|
21
|
-
import "./chunk-HPM47WO3.js";
|
|
22
|
-
import "./chunk-4CQ3PV3V.js";
|
|
23
|
-
import "./chunk-K4VO7S6Q.js";
|
|
24
|
-
import "./chunk-ZSS3BH6Z.js";
|
|
25
|
-
import "./chunk-M4OP5ASJ.js";
|
|
26
|
-
import "./chunk-D72URWJE.js";
|
|
27
|
-
import "./chunk-CXWAKV2O.js";
|
|
28
|
-
import "./chunk-VMV5CMLH.js";
|
|
29
|
-
import "./chunk-TGKTIDYS.js";
|
|
30
|
-
import "./chunk-5KZKVKWU.js";
|
|
31
|
-
import "./chunk-Y65BQJOY.js";
|
|
32
|
-
import "./chunk-45URY64S.js";
|
|
33
|
-
import "./chunk-FD44T7HC.js";
|
|
34
|
-
import "./chunk-UIQMBOXU.js";
|
|
35
|
-
import "./chunk-IWJ5OLU6.js";
|
|
36
|
-
import "./chunk-3I3TGKVG.js";
|
|
37
|
-
import "./chunk-3WI53AA4.js";
|
|
38
|
-
import "./chunk-APSMQIA4.js";
|
|
39
|
-
import "./chunk-ERUB3KU3.js";
|
|
40
|
-
import "./chunk-XWBPP2HX.js";
|
|
41
|
-
import "./chunk-Y62I2T36.js";
|
|
42
|
-
import "./chunk-NM5GBJME.js";
|
|
43
|
-
import "./chunk-XS5C5TQ7.js";
|
|
44
|
-
import "./chunk-Y5E2WNWB.js";
|
|
45
|
-
import "./chunk-7KCBPAQS.js";
|
|
46
|
-
import "./chunk-ZVVMGPBJ.js";
|
|
47
|
-
export {
|
|
48
|
-
addStoreMaintenanceCommands,
|
|
49
|
-
buildStems,
|
|
50
|
-
storeMaintenanceCommands,
|
|
51
|
-
storeSummary
|
|
52
|
-
};
|
|
File without changes
|