@wirecat/zoom-cli 0.76.0 → 0.78.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -11
- package/contracts/wirecat.json +53 -105
- package/dist/answer-entities.d.ts +1 -141
- package/dist/answer-entities.d.ts.map +1 -1
- package/dist/answer-entities.js +0 -31
- package/dist/answer-entities.js.map +1 -1
- package/dist/api.d.ts +18 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +179 -54
- package/dist/api.js.map +1 -1
- package/dist/archive-commands.d.ts +0 -3
- package/dist/archive-commands.d.ts.map +1 -1
- package/dist/archive-commands.js +1 -54
- package/dist/archive-commands.js.map +1 -1
- package/dist/bin/zm.js +2 -2
- package/dist/bundle/{all-profiles-AAMFP7IN.js → all-profiles-7JN3N3E6.js} +11 -11
- package/dist/bundle/answer-policy-G2BNMPEX.js +122 -0
- package/dist/bundle/{anthropic-6KIS53QB.js → anthropic-U6O7UYGZ.js} +6 -6
- package/dist/bundle/{app-server-6QYNNYEU.js → app-server-G7BTC6CE.js} +78 -68
- package/dist/bundle/{bun-QVVCH4MJ.js → bun-VLROVUFK.js} +2 -2
- package/dist/bundle/{bun-sqlite-Y2ZFMNQ3.js → bun-sqlite-C5JLANDE.js} +7 -7
- package/dist/bundle/{chunk-25GMFXPF.js → chunk-2AWWMROP.js} +3244 -3674
- package/dist/bundle/{chunk-YESHGC3M.js → chunk-2LMD3JUD.js} +2 -2
- package/dist/bundle/{chunk-LGBLYFKI.js → chunk-2O66KMOR.js} +6 -2
- package/dist/bundle/{chunk-JADBHKBP.js → chunk-2USGT7LE.js} +1 -1
- package/dist/bundle/{chunk-M7WYBGQT.js → chunk-3A3B3JX4.js} +8 -8
- package/dist/bundle/{chunk-RJK5ADMH.js → chunk-3NZJKY7A.js} +103 -42
- package/dist/bundle/chunk-3QWYRZME.js +773 -0
- package/dist/bundle/{chunk-D2TGXSHQ.js → chunk-4QCLPSJ7.js} +5 -5
- package/dist/bundle/{chunk-XC4V6YCS.js → chunk-4XPVRZXE.js} +1 -1
- package/dist/bundle/{chunk-EZJSAYWZ.js → chunk-532FNLON.js} +31 -87
- package/dist/bundle/{chunk-QLUU3BV2.js → chunk-53TV72JG.js} +6 -6
- package/dist/bundle/{chunk-VJANMYEC.js → chunk-5DLK4OXF.js} +3 -3
- package/dist/bundle/chunk-5SM2IOAS.js +389 -0
- package/dist/bundle/{chunk-65VRWNDP.js → chunk-6MFEWAK4.js} +4 -4
- package/dist/bundle/{chunk-IUSY4ZJK.js → chunk-6NTNAEZF.js} +2379 -2114
- package/dist/bundle/{chunk-DQHS336B.js → chunk-7AMKSXMB.js} +7 -6
- package/dist/bundle/{chunk-IXPBSDKB.js → chunk-7EVB4UV7.js} +4 -4
- package/dist/bundle/chunk-7HEZQCHL.js +555 -0
- package/dist/bundle/{chunk-TYAFL66K.js → chunk-7IIQU5RA.js} +15 -31
- package/dist/bundle/{chunk-TK77DCE5.js → chunk-7K5O2VWO.js} +1 -1
- package/dist/bundle/{chunk-VG63EXRC.js → chunk-AEVSVVTP.js} +2 -2
- package/dist/bundle/chunk-B4V4DRVO.js +229 -0
- package/dist/bundle/{chunk-2HKUQ7DR.js → chunk-B6TUEQ4O.js} +3 -3
- package/dist/bundle/chunk-BAHXR4PA.js +259 -0
- package/dist/bundle/{chunk-ZFYNJERV.js → chunk-BGO7IEHY.js} +6 -6
- package/dist/bundle/{chunk-PFLJJQWW.js → chunk-BIUHLXL2.js} +54 -55
- package/dist/bundle/{chunk-5T7TBK5Y.js → chunk-C26V2XNV.js} +1 -1
- package/dist/bundle/chunk-C56OYYFG.js +170 -0
- package/dist/bundle/{chunk-MDTEAKA5.js → chunk-DLJPN47R.js} +8 -6
- package/dist/bundle/{chunk-FBVJGJDM.js → chunk-EV7QCFQR.js} +27 -574
- package/dist/bundle/{chunk-ORM73DZO.js → chunk-F2KZNAFF.js} +2 -2
- package/dist/bundle/{chunk-QY6GE7CL.js → chunk-F7IDYQLM.js} +2 -2
- package/dist/bundle/{chunk-WNXC42IU.js → chunk-FCGRXUAU.js} +9 -9
- package/dist/bundle/{chunk-ELW3LMJZ.js → chunk-FHOQWPQ6.js} +397 -157
- package/dist/bundle/{chunk-NQ356ERO.js → chunk-FMMCGQNT.js} +77 -10
- package/dist/bundle/{chunk-K3K3WKDB.js → chunk-FNLXFQN6.js} +1 -1
- package/dist/bundle/{chunk-YGKM2ZWF.js → chunk-FURKMNC2.js} +3 -3
- package/dist/bundle/{chunk-XRH2NKW4.js → chunk-FXHZHQKU.js} +6 -6
- package/dist/bundle/{chunk-GZYICXO4.js → chunk-GQ6EJDMV.js} +1 -1
- package/dist/bundle/{chunk-VABYJQYE.js → chunk-H34KEXTN.js} +24 -22
- package/dist/bundle/{chunk-HWYSJ4SL.js → chunk-H74NENWA.js} +3 -3
- package/dist/bundle/{chunk-Y2BGABXP.js → chunk-H7SRM26V.js} +3 -3
- package/dist/bundle/{chunk-VRA4RVQU.js → chunk-HGBZBQAE.js} +3 -3
- package/dist/bundle/{chunk-EZXW3ZCR.js → chunk-HI4QICF7.js} +12 -12
- package/dist/bundle/{chunk-LEVOI6Z3.js → chunk-HOJOVUO6.js} +14 -13
- package/dist/bundle/{chunk-XWQKRKMT.js → chunk-HUSIS3XO.js} +71 -252
- package/dist/bundle/chunk-IBINGDYF.js +335 -0
- package/dist/bundle/{chunk-55SWKR6Y.js → chunk-INJK7FNM.js} +337 -597
- package/dist/bundle/{chunk-CXHUOPN5.js → chunk-JOIAE3NO.js} +7 -7
- package/dist/bundle/{chunk-OFODCJ2A.js → chunk-KBTINKQF.js} +3 -3
- package/dist/bundle/{chunk-VCFSUGPE.js → chunk-KEAKNNXU.js} +4 -4
- package/dist/bundle/{chunk-XHVFX74L.js → chunk-LBTANUUH.js} +2 -2
- package/dist/bundle/chunk-LBV4673S.js +72 -0
- package/dist/bundle/chunk-LERF2FIK.js +295 -0
- package/dist/bundle/{chunk-UYZDH5LK.js → chunk-LX532BXO.js} +1 -1
- package/dist/bundle/{chunk-IVFNHIU4.js → chunk-M2M3U4UU.js} +81 -5
- package/dist/bundle/{chunk-JWMOHEDL.js → chunk-M5R2DURM.js} +10 -10
- package/dist/bundle/{chunk-4ERYXY4Y.js → chunk-MJMHUU3J.js} +1 -1
- package/dist/bundle/{chunk-GYTAHH5Y.js → chunk-MSMFYW6N.js} +2 -2
- package/dist/bundle/{chunk-X73YEFQE.js → chunk-MVLLWSV7.js} +20 -118
- package/dist/bundle/{chunk-RXUVXAMM.js → chunk-NO2LIHWA.js} +1 -1
- package/dist/bundle/{chunk-Y4WEAWU7.js → chunk-NS5XSCHC.js} +1 -1
- package/dist/bundle/{chunk-ZETM63M6.js → chunk-OAE6XR7E.js} +9 -60
- package/dist/bundle/{chunk-CS62FET6.js → chunk-OAYAGQ7C.js} +22 -22
- package/dist/bundle/{chunk-T2QVWRJF.js → chunk-OI4563JI.js} +39 -67
- package/dist/bundle/{chunk-WKT5RPSY.js → chunk-OOLNK3Y5.js} +8 -8
- package/dist/bundle/{chunk-EBIK5Q73.js → chunk-ORSTSBWU.js} +1 -1
- package/dist/bundle/{chunk-GB5LI5RM.js → chunk-P5QO7Y3H.js} +6 -6
- package/dist/bundle/{chunk-3D5PETD2.js → chunk-PJMQE4PW.js} +29 -9
- package/dist/bundle/{chunk-KEFDP6NL.js → chunk-Q4AKIAIA.js} +12 -12
- package/dist/bundle/{chunk-CPOFLYPU.js → chunk-Q4CNLEAY.js} +29 -29
- package/dist/bundle/{chunk-UAV74EY4.js → chunk-RJIJR6KH.js} +1 -1
- package/dist/bundle/{chunk-GPIQY4YB.js → chunk-TEFHNXXX.js} +14 -14
- package/dist/bundle/{chunk-FMJ4QSSU.js → chunk-TFDD4Q5Z.js} +10 -10
- package/dist/bundle/{chunk-HUHH25AG.js → chunk-TXDCIM5D.js} +3017 -1599
- package/dist/bundle/{chunk-FGRFIXG2.js → chunk-U2Z35B3W.js} +2 -2
- package/dist/bundle/{chunk-WZJ7ZYR4.js → chunk-UHBQM54J.js} +4 -4
- package/dist/bundle/{chunk-6VCQ4CTK.js → chunk-UIBKGH5P.js} +1 -1
- package/dist/bundle/{chunk-5EII5RIL.js → chunk-UKYO3HNO.js} +1 -1
- package/dist/bundle/{chunk-7RORMNKP.js → chunk-V53TIJLY.js} +2 -2
- package/dist/bundle/{chunk-OOYIPK4F.js → chunk-VMA7SILL.js} +1 -1
- package/dist/bundle/chunk-VW36ZSAE.js +88 -0
- package/dist/bundle/chunk-WEAMGNST.js +31 -0
- package/dist/bundle/{chunk-EPPE6ZTS.js → chunk-WJTXO2EI.js} +1 -1
- package/dist/bundle/{chunk-4JPOELCT.js → chunk-WOYPWXZK.js} +4 -4
- package/dist/bundle/{chunk-OINDAHXC.js → chunk-XCOGI4JE.js} +4 -4
- package/dist/bundle/{chunk-CE5Y7PQU.js → chunk-XOG7B7K5.js} +4 -4
- package/dist/bundle/chunk-XSF5OBVZ.js +224 -0
- package/dist/bundle/{chunk-B7ZREOBD.js → chunk-XXD4YPHQ.js} +12 -12
- package/dist/bundle/{chunk-35AH33VJ.js → chunk-YAPDU3SV.js} +1 -1
- package/dist/bundle/{chunk-R47GYLNN.js → chunk-YHQ3TEGB.js} +29 -27
- package/dist/bundle/{chunk-LOEK6IFQ.js → chunk-YLNUKNGD.js} +87 -35
- package/dist/bundle/{chunk-6SXCGS3A.js → chunk-YNYQGZUW.js} +7 -7
- package/dist/bundle/{chunk-OWZETMRE.js → chunk-YZKVCTZI.js} +8 -8
- package/dist/bundle/{chunk-UG2QDGAH.js → chunk-ZCVO6GAT.js} +1 -1
- package/dist/bundle/{chunk-YEBWRWE3.js → chunk-ZDZASHSQ.js} +17 -17
- package/dist/bundle/chunk-ZZJ5IWNT.js +101 -0
- package/dist/bundle/{cli-FHMLYHUZ.js → cli-YALONJ4V.js} +135 -84
- package/dist/bundle/command-contract-DMR5EOIN.js +45 -0
- package/dist/bundle/{command-server-entry-YEZM52R5.js → command-server-entry-W4XTBUZE.js} +35 -31
- package/dist/bundle/config-4TLDRXRL.js +109 -0
- package/dist/bundle/{decode-SIYRMJOK.js → decode-IFQHVCFX.js} +16 -8
- package/dist/bundle/{dispatch-SMER3WDX.js → dispatch-GOJB4TDK.js} +9 -9
- package/dist/bundle/{dist-BSJETSFE.js → dist-H7XFUMRX.js} +25 -22
- package/dist/bundle/{echarts-UZJ6AREV.js → echarts-HPUHPJCO.js} +2 -2
- package/dist/bundle/{embed-A7DSHVI7.js → embed-ESU3WZYW.js} +7 -7
- package/dist/bundle/{embedder-WQBR4UGS.js → embedder-BV6O76B3.js} +10 -10
- package/dist/bundle/{failure-73UQXQTW.js → failure-SWVCYFQX.js} +3 -3
- package/dist/bundle/first-run-OEJGAQAE.js +29 -0
- package/dist/bundle/first-screen-QLM4IABL.js +45 -0
- package/dist/bundle/{folders-BH4SV6SI.js → folders-VQGKBM3P.js} +5 -5
- package/dist/bundle/{instructions-SDDUBGH4.js → instructions-UUX57I3V.js} +1 -1
- package/dist/bundle/{main-KL4FN5F3.js → main-UIKADOFB.js} +24 -24
- package/dist/bundle/{mcp-GN4FTJX5.js → mcp-VMS6PBCU.js} +2 -2
- package/dist/bundle/meeting-combined-SKJISCC7.js +26 -0
- package/dist/bundle/meeting-model-YG3Z5KCB.js +26 -0
- package/dist/bundle/meeting-semantic-F6GUICB7.js +23 -0
- package/dist/bundle/{meetings-URPXBHV7.js → meetings-KIBUPLPW.js} +37 -7
- package/dist/bundle/{node-ELCNUOCE.js → node-AM3JCAWB.js} +2 -2
- package/dist/bundle/{node-sqlite-QLSNHZBM.js → node-sqlite-VM6VS3RU.js} +8 -8
- package/dist/bundle/{oauth-LZ64S7Y3.js → oauth-AX5Z32H6.js} +8 -8
- package/dist/bundle/{open-WB4HUPQT.js → open-SSGOOOZG.js} +6 -6
- package/dist/bundle/openai-YIP73X2B.js +28 -0
- package/dist/bundle/{output-file-AHPQA5LR.js → output-file-FR226A64.js} +6 -6
- package/dist/bundle/{process-67DAKAAQ.js → process-5ZEK2VFY.js} +1 -1
- package/dist/bundle/{program-CIMACIBE.js → program-ROJAJHCB.js} +424 -251
- package/dist/bundle/{prompt-GG53UBDJ.js → prompt-6Y7A4453.js} +6 -6
- package/dist/bundle/{recognize-CFJ3CAEH.js → recognize-R5W25WKH.js} +5 -5
- package/dist/bundle/{remote-BLEM7C3Q.js → remote-PA4FQUZK.js} +11 -11
- package/dist/bundle/{rerank-ERN6PC66.js → rerank-CYX3UFTM.js} +8 -8
- package/dist/bundle/run-log-FHERL3H6.js +136 -0
- package/dist/bundle/{serve-FJPPTJXH.js → serve-MM5QEZJW.js} +15 -15
- package/dist/bundle/{server-FLUSDUGM.js → server-JQQAH7E5.js} +64 -54
- package/dist/bundle/server-W2BBONCQ.js +85 -0
- package/dist/bundle/{services-LXC6DVUQ.js → services-Y2DOQONM.js} +85 -54
- package/dist/bundle/{speech-WFEZTKXA.js → speech-O6WLX34V.js} +34 -18
- package/dist/bundle/{sqlite-runtime-KN33VSP7.js → sqlite-runtime-LQTBZMFH.js} +7 -7
- package/dist/bundle/{state-TXS4ZHIT.js → state-AIDPZLVH.js} +7 -7
- package/dist/bundle/{store-ZUREZYZB.js → store-BA4FQS5V.js} +26 -20
- package/dist/bundle/{store-MUOXLVL4.js → store-UNDS2TBG.js} +30 -22
- package/dist/bundle/store-connection-ADBJ36T4.js +102 -0
- package/dist/bundle/store-maintenance-command-IB6ML4UI.js +77 -0
- package/dist/bundle/{streaming-ZSCHRC5S.js → streaming-UFHT5MR2.js} +7 -7
- package/dist/bundle/{tokens-YVDOY4EV.js → tokens-Z32UKGQB.js} +10 -10
- package/dist/bundle/zm.js +9 -9
- package/dist/bundle/{zoom-app-O6GIMB7Y.js → zoom-app-6U46XBTG.js} +8 -8
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +3 -0
- package/dist/commands.js.map +1 -1
- package/dist/first-screen.d.ts.map +1 -1
- package/dist/first-screen.js +3 -5
- package/dist/first-screen.js.map +1 -1
- package/dist/meeting-integration-commands.d.ts.map +1 -1
- package/dist/meeting-integration-commands.js +46 -28
- package/dist/meeting-integration-commands.js.map +1 -1
- package/dist/meeting-source.d.ts.map +1 -1
- package/dist/meeting-source.js +15 -1
- package/dist/meeting-source.js.map +1 -1
- package/dist/permissions.d.ts +8 -4
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js +25 -24
- package/dist/permissions.js.map +1 -1
- package/dist/program-bindings.d.ts.map +1 -1
- package/dist/program-bindings.js +8 -5
- package/dist/program-bindings.js.map +1 -1
- package/dist/program.d.ts +2 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js.map +1 -1
- package/dist/remote-meetings.d.ts +38 -8
- package/dist/remote-meetings.d.ts.map +1 -1
- package/dist/remote-meetings.js +52 -29
- package/dist/remote-meetings.js.map +1 -1
- package/dist/run.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/zoom-app.d.ts.map +1 -1
- package/dist/zoom-app.js +1 -0
- package/dist/zoom-app.js.map +1 -1
- package/package.json +5 -4
- package/skills/zoom-cli/SKILL.md +88 -236
- package/skills/zoom-cli/references/archive.md +59 -0
- package/skills/zoom-cli/references/people-and-projects.md +51 -0
- package/skills/zoom-cli/references/prepare.md +78 -0
- package/skills/zoom-cli/references/search.md +71 -0
- package/skills/zoom-cli/references/setup.md +31 -0
- package/skills/zoom-cli/references/zoom-live.md +27 -0
- package/dist/bundle/answer-policy-ETAELI4A.js +0 -110
- package/dist/bundle/chunk-64N7MY3I.js +0 -161
- package/dist/bundle/command-contract-HUZ4I23S.js +0 -41
- package/dist/bundle/config-KVTWN7QZ.js +0 -97
- package/dist/bundle/first-run-SY6XSUZ3.js +0 -29
- package/dist/bundle/first-screen-ZDMODGWS.js +0 -39
- package/dist/bundle/openai-KN6JE4QU.js +0 -28
- package/dist/bundle/run-log-S67YPJF6.js +0 -124
- package/dist/bundle/server-UNJY3TSJ.js +0 -74
- package/dist/bundle/store-connection-NRNEBUPU.js +0 -90
- package/dist/bundle/store-maintenance-command-OBOPYFZ5.js +0 -65
- /package/dist/bundle/{chunk-BDCC2J2Z.js → chunk-SHTHNBHG.js} +0 -0
|
@@ -2,19 +2,19 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
isCliFailure
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AEVSVVTP.js";
|
|
6
6
|
import {
|
|
7
7
|
secretNamed,
|
|
8
8
|
withoutSecrets
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ORSTSBWU.js";
|
|
10
10
|
import {
|
|
11
11
|
isContentKey
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OAYAGQ7C.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.681.0_@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typ_3bf07d813b3b8f6ae0583ce017092c7c/node_modules/@wirecat/cli-core/dist/runs/events.js
|
|
18
18
|
var providerErrorKey = /* @__PURE__ */ __name((value) => typeof value === "string" && /^[A-Za-z][A-Za-z0-9._-]{0,63}$/.test(value) ? value : void 0, "providerErrorKey");
|
|
19
19
|
var renderEvent = /* @__PURE__ */ __name((event) => {
|
|
20
20
|
if (event.event === "store")
|
|
@@ -66,11 +66,11 @@ var MARK = { request: "\u2192", response: "\u2190", cache: "\u2022", warning: "!
|
|
|
66
66
|
var age = /* @__PURE__ */ __name((ms) => ms < 1e3 ? `${ms}ms` : `${Math.round(ms / 1e3)}s`, "age");
|
|
67
67
|
var size = /* @__PURE__ */ __name((bytes) => bytes < 1e3 ? `${bytes} B` : `${(bytes / 1e3).toFixed(1)} kB`, "size");
|
|
68
68
|
|
|
69
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
69
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.681.0_@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typ_3bf07d813b3b8f6ae0583ce017092c7c/node_modules/@wirecat/cli-core/dist/runs/run-context.js
|
|
70
70
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
71
71
|
import { createHash } from "node:crypto";
|
|
72
72
|
|
|
73
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
73
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.681.0_@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typ_3bf07d813b3b8f6ae0583ce017092c7c/node_modules/@wirecat/cli-core/dist/runs/error-detail.js
|
|
74
74
|
import { homedir } from "node:os";
|
|
75
75
|
var MESSAGE_AT_MOST = 500;
|
|
76
76
|
var CAUSES_AT_MOST = 5;
|
|
@@ -183,7 +183,7 @@ var redactText = /* @__PURE__ */ __name((text) => {
|
|
|
183
183
|
return out.length > MESSAGE_AT_MOST ? `${out.slice(0, MESSAGE_AT_MOST)}\u2026` : out;
|
|
184
184
|
}, "redactText");
|
|
185
185
|
|
|
186
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
186
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.681.0_@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typ_3bf07d813b3b8f6ae0583ce017092c7c/node_modules/@wirecat/cli-core/dist/runs/run-context.js
|
|
187
187
|
var REDACTED = "[redacted]";
|
|
188
188
|
var keepsSuccess = /* @__PURE__ */ __name(({ record, fromFlag, env, caller, persistent = false }) => {
|
|
189
189
|
if (!record)
|
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
MAX_SECRET_INPUT,
|
|
5
5
|
bufferedInput,
|
|
6
6
|
inputPolicy
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MSMFYW6N.js";
|
|
8
8
|
import {
|
|
9
9
|
CliError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FNLXFQN6.js";
|
|
11
11
|
import {
|
|
12
12
|
__name
|
|
13
13
|
} from "./chunk-ZVVMGPBJ.js";
|
|
14
14
|
|
|
15
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.681.0_@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typ_3bf07d813b3b8f6ae0583ce017092c7c/node_modules/@wirecat/cli-core/dist/terminal/prompt.js
|
|
16
16
|
import { createInterface } from "node:readline";
|
|
17
17
|
import { Writable } from "node:stream";
|
|
18
18
|
var EMPTY_TRIES = 3;
|
|
@@ -2,12 +2,12 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
singleLine
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WJTXO2EI.js";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-ZVVMGPBJ.js";
|
|
9
9
|
|
|
10
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
10
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/names.js
|
|
11
11
|
var FIRST_PARTY_TOOLS = [
|
|
12
12
|
{ name: "tg", package: "@wirecat/tg-cli" },
|
|
13
13
|
{ name: "max", package: "@wirecat/max-cli" },
|
|
@@ -31,7 +31,7 @@ var DESCRIBE_FLAG = "--wcat-describe";
|
|
|
31
31
|
var DESCRIBE_MAX_BYTES = 64 * 1024;
|
|
32
32
|
var DISPATCH_FLAG = "--wcat-dispatch";
|
|
33
33
|
|
|
34
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
34
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/describe.js
|
|
35
35
|
var DESCRIBE_FORMAT = 1;
|
|
36
36
|
var DESCRIBE_MANIFEST_FORMAT = 2;
|
|
37
37
|
var describeAnswer = /* @__PURE__ */ __name((tool, manifest) => {
|
|
@@ -74,7 +74,7 @@ var parseDescribe = /* @__PURE__ */ __name((text) => {
|
|
|
74
74
|
};
|
|
75
75
|
}, "parseDescribe");
|
|
76
76
|
|
|
77
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
77
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/shim.js
|
|
78
78
|
import { lstatSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
79
79
|
import { join } from "node:path";
|
|
80
80
|
var SHIM_FORMAT = 2;
|
|
@@ -2,12 +2,12 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
resolvePaths
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OAYAGQ7C.js";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-ZVVMGPBJ.js";
|
|
9
9
|
|
|
10
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.681.0_@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typ_3bf07d813b3b8f6ae0583ce017092c7c/node_modules/@wirecat/cli-core/dist/store/path.js
|
|
11
11
|
import { realpathSync } from "node:fs";
|
|
12
12
|
import { userInfo } from "node:os";
|
|
13
13
|
import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
QUERY_LIMITS,
|
|
5
|
+
queryError
|
|
6
|
+
} from "./chunk-TFDD4Q5Z.js";
|
|
7
|
+
import {
|
|
8
|
+
CliError,
|
|
9
|
+
isCliError
|
|
10
|
+
} from "./chunk-FNLXFQN6.js";
|
|
11
|
+
import {
|
|
12
|
+
__name
|
|
13
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
14
|
+
|
|
15
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.681.0_@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typ_3bf07d813b3b8f6ae0583ce017092c7c/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
|
|
16
|
+
var QUERY_VERSION = 1;
|
|
17
|
+
var QUERY_LIMITS2 = {
|
|
18
|
+
...QUERY_LIMITS,
|
|
19
|
+
pattern: 1024,
|
|
20
|
+
states: 1e4,
|
|
21
|
+
expansions: 1e4,
|
|
22
|
+
candidates: 5e4,
|
|
23
|
+
bodyBytes: 8388608,
|
|
24
|
+
milliseconds: 2e3,
|
|
25
|
+
work: 1e7
|
|
26
|
+
};
|
|
27
|
+
var SEARCH_QUERY = {
|
|
28
|
+
command: "search",
|
|
29
|
+
guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md"
|
|
30
|
+
};
|
|
31
|
+
var MESSAGE_PARSING = { ...SEARCH_QUERY, proximity: true };
|
|
32
|
+
var MOST_WORDS_APART = 50;
|
|
33
|
+
function searchError(reason, span, alternative) {
|
|
34
|
+
queryError(reason, span, alternative, SEARCH_QUERY);
|
|
35
|
+
}
|
|
36
|
+
__name(searchError, "searchError");
|
|
37
|
+
var ANSWER_MS = 1e3;
|
|
38
|
+
var searchTimeLimit = /* @__PURE__ */ __name((deadline, now = Date.now()) => deadline?.explicit ? Math.max(QUERY_LIMITS2.milliseconds, deadline.endsAt - now - ANSWER_MS) : void 0, "searchTimeLimit");
|
|
39
|
+
function outOfTime(limitMs = QUERY_LIMITS2.milliseconds) {
|
|
40
|
+
throw new CliError("timeout", `search stopped at its time limit of ${limitMs / 1e3}s \u2014 the query is valid; add chat: or date: to search less of the store`, { reason: "query.time-limit", budget: "time", limit_ms: limitMs, complete: false });
|
|
41
|
+
}
|
|
42
|
+
__name(outOfTime, "outOfTime");
|
|
43
|
+
var isQueryLimit = /* @__PURE__ */ __name((error) => isCliError(error) && (error.details.reason === "query.too-large" || error.details.reason === "query.time-limit"), "isQueryLimit");
|
|
44
|
+
function exhausted(budget) {
|
|
45
|
+
throw new CliError("validation_error", `search exceeded its ${budget} budget \u2014 narrow the chat or date range`, {
|
|
46
|
+
reason: "query.too-large",
|
|
47
|
+
budget,
|
|
48
|
+
complete: false
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
__name(exhausted, "exhausted");
|
|
52
|
+
function tooWideTerm([term], budget) {
|
|
53
|
+
if (term === void 0)
|
|
54
|
+
exhausted(budget);
|
|
55
|
+
const part = term.replace(/[*?]+/gu, " ").trim().split(/\s+/u).sort((a, b) => b.length - a.length)[0] ?? term;
|
|
56
|
+
throw new CliError("validation_error", `search exceeded its ${budget} budget: ${term} is checked word by word, and too many messages hold it \u2014 write *${part}* (any word holding it, read from the index), more of the word, or add chat: or date:`, { reason: "query.too-large", budget, term, complete: false });
|
|
57
|
+
}
|
|
58
|
+
__name(tooWideTerm, "tooWideTerm");
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
QUERY_VERSION,
|
|
62
|
+
QUERY_LIMITS2 as QUERY_LIMITS,
|
|
63
|
+
SEARCH_QUERY,
|
|
64
|
+
MESSAGE_PARSING,
|
|
65
|
+
MOST_WORDS_APART,
|
|
66
|
+
searchError,
|
|
67
|
+
searchTimeLimit,
|
|
68
|
+
outOfTime,
|
|
69
|
+
isQueryLimit,
|
|
70
|
+
exhausted,
|
|
71
|
+
tooWideTerm
|
|
72
|
+
};
|
|
@@ -0,0 +1,295 @@
|
|
|
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-XOG7B7K5.js";
|
|
7
|
+
import {
|
|
8
|
+
importFrom
|
|
9
|
+
} from "./chunk-Y5E2WNWB.js";
|
|
10
|
+
import {
|
|
11
|
+
CliError
|
|
12
|
+
} from "./chunk-FNLXFQN6.js";
|
|
13
|
+
import {
|
|
14
|
+
__name
|
|
15
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
16
|
+
|
|
17
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.681.0_@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typ_3bf07d813b3b8f6ae0583ce017092c7c/node_modules/@wirecat/cli-core/dist/speech/decode.js
|
|
18
|
+
import { spawn } from "node:child_process";
|
|
19
|
+
import { mkdtemp, open, readFile, rm, writeFile } from "node:fs/promises";
|
|
20
|
+
import { createRequire } from "node:module";
|
|
21
|
+
import { tmpdir } from "node:os";
|
|
22
|
+
import { join } from "node:path";
|
|
23
|
+
import { pathToFileURL } from "node:url";
|
|
24
|
+
var LONGEST_AUDIO_SECONDS = 3600;
|
|
25
|
+
var FFMPEG_TIMEOUT_MS = 12e4;
|
|
26
|
+
var FFMPEG_FORMATS = "mov,mp4,m4a,3gp,3g2,mj2,aac,mp3,wav,amr,caf,aiff,flac,ogg,matroska,webm,asf";
|
|
27
|
+
var text = /* @__PURE__ */ __name((bytes, from, length) => String.fromCharCode(...bytes.subarray(from, from + length)), "text");
|
|
28
|
+
var contains = /* @__PURE__ */ __name((bytes, needle, within) => Buffer.from(bytes.buffer, bytes.byteOffset, Math.min(bytes.length, within)).includes(needle, 0, "latin1"), "contains");
|
|
29
|
+
var formatOf = /* @__PURE__ */ __name((bytes) => {
|
|
30
|
+
if (text(bytes, 0, 4) === "OggS") {
|
|
31
|
+
if (contains(bytes, "OpusHead", 128))
|
|
32
|
+
return "opus";
|
|
33
|
+
if (contains(bytes, "vorbis", 128))
|
|
34
|
+
return "vorbis";
|
|
35
|
+
return "other";
|
|
36
|
+
}
|
|
37
|
+
if (text(bytes, 0, 4) === "fLaC")
|
|
38
|
+
return "flac";
|
|
39
|
+
const frame = bytes[0] === 255 && ((bytes[1] ?? 0) & 224) === 224 && ((bytes[1] ?? 0) >> 1 & 3) !== 0;
|
|
40
|
+
if (text(bytes, 0, 3) === "ID3" || frame)
|
|
41
|
+
return "mp3";
|
|
42
|
+
return "other";
|
|
43
|
+
}, "formatOf");
|
|
44
|
+
var everyChannel = /* @__PURE__ */ __name((decoded) => {
|
|
45
|
+
if (!decoded.channelData[0] || decoded.samplesDecoded === 0)
|
|
46
|
+
throw new CliError("validation_error", "no audio in that file");
|
|
47
|
+
return decoded.channelData.map((samples) => ({ samples, rate: decoded.sampleRate }));
|
|
48
|
+
}, "everyChannel");
|
|
49
|
+
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");
|
|
50
|
+
var decodeVorbis = /* @__PURE__ */ __name(async (bytes) => {
|
|
51
|
+
const { OggVorbisDecoder } = await load("@wasm-audio-decoders/ogg-vorbis");
|
|
52
|
+
const decoder = new OggVorbisDecoder();
|
|
53
|
+
await decoder.ready;
|
|
54
|
+
try {
|
|
55
|
+
return everyChannel(await decoder.decodeFile(bytes));
|
|
56
|
+
} finally {
|
|
57
|
+
decoder.free();
|
|
58
|
+
}
|
|
59
|
+
}, "decodeVorbis");
|
|
60
|
+
var decodeFlac = /* @__PURE__ */ __name(async (bytes) => {
|
|
61
|
+
const { FLACDecoder } = await load("@wasm-audio-decoders/flac");
|
|
62
|
+
const decoder = new FLACDecoder();
|
|
63
|
+
await decoder.ready;
|
|
64
|
+
try {
|
|
65
|
+
return everyChannel(await decoder.decodeFile(bytes));
|
|
66
|
+
} finally {
|
|
67
|
+
decoder.free();
|
|
68
|
+
}
|
|
69
|
+
}, "decodeFlac");
|
|
70
|
+
var decodeMp3 = /* @__PURE__ */ __name(async (bytes) => {
|
|
71
|
+
const { MPEGDecoder } = await load("mpg123-decoder");
|
|
72
|
+
const decoder = new MPEGDecoder();
|
|
73
|
+
await decoder.ready;
|
|
74
|
+
try {
|
|
75
|
+
return everyChannel(decoder.decode(bytes));
|
|
76
|
+
} finally {
|
|
77
|
+
decoder.free();
|
|
78
|
+
}
|
|
79
|
+
}, "decodeMp3");
|
|
80
|
+
var tooLongError = /* @__PURE__ */ __name(() => new CliError("validation_error", `the audio is longer than ${LONGEST_AUDIO_SECONDS / 60} minutes`), "tooLongError");
|
|
81
|
+
var FLOAT = 3;
|
|
82
|
+
var LONGEST_HEADER = 64 * 1024;
|
|
83
|
+
var EXTENSIBLE = 65534;
|
|
84
|
+
var wavStream = /* @__PURE__ */ __name((most) => {
|
|
85
|
+
let head = Buffer.alloc(0);
|
|
86
|
+
let channels = 0;
|
|
87
|
+
let rate = 0;
|
|
88
|
+
let rest = Buffer.alloc(0);
|
|
89
|
+
let length = 0;
|
|
90
|
+
let parts = [];
|
|
91
|
+
const header = /* @__PURE__ */ __name(() => {
|
|
92
|
+
if (head.length < 12)
|
|
93
|
+
return false;
|
|
94
|
+
if (head.toString("latin1", 0, 4) !== "RIFF" || head.toString("latin1", 8, 12) !== "WAVE")
|
|
95
|
+
throw new CliError("validation_error", "ffmpeg did not answer with WAV audio");
|
|
96
|
+
for (let at = 12; at + 8 <= head.length; ) {
|
|
97
|
+
const id = head.toString("latin1", at, at + 4);
|
|
98
|
+
const size = head.readUInt32LE(at + 4);
|
|
99
|
+
if (id === "data") {
|
|
100
|
+
rest = head.subarray(at + 8);
|
|
101
|
+
head = Buffer.alloc(0);
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
if (at + 8 + size > head.length)
|
|
105
|
+
return false;
|
|
106
|
+
if (id === "fmt ") {
|
|
107
|
+
const tag = head.readUInt16LE(at + 8);
|
|
108
|
+
channels = head.readUInt16LE(at + 10);
|
|
109
|
+
rate = head.readUInt32LE(at + 12);
|
|
110
|
+
if (tag !== FLOAT && tag !== EXTENSIBLE || head.readUInt16LE(at + 22) !== 32 || channels < 1)
|
|
111
|
+
throw new CliError("validation_error", "ffmpeg did not answer with 32-bit float samples");
|
|
112
|
+
parts = Array.from({ length: channels }, () => []);
|
|
113
|
+
}
|
|
114
|
+
at += 8 + size + size % 2;
|
|
115
|
+
}
|
|
116
|
+
return false;
|
|
117
|
+
}, "header");
|
|
118
|
+
return {
|
|
119
|
+
push: /* @__PURE__ */ __name((chunk) => {
|
|
120
|
+
if (channels === 0 || head.length > 0) {
|
|
121
|
+
head = Buffer.concat([head, chunk]);
|
|
122
|
+
if (head.length > LONGEST_HEADER)
|
|
123
|
+
throw new CliError("validation_error", "ffmpeg's WAV header never ended");
|
|
124
|
+
if (!header())
|
|
125
|
+
return true;
|
|
126
|
+
chunk = Buffer.alloc(0);
|
|
127
|
+
}
|
|
128
|
+
const bytes = rest.length ? Buffer.concat([rest, chunk]) : chunk;
|
|
129
|
+
const frame = channels * 4;
|
|
130
|
+
const frames = Math.floor(bytes.length / frame);
|
|
131
|
+
rest = Buffer.from(bytes.subarray(frames * frame));
|
|
132
|
+
if (frames === 0)
|
|
133
|
+
return length <= most;
|
|
134
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, frames * frame);
|
|
135
|
+
for (let channel = 0; channel < channels; channel++) {
|
|
136
|
+
const samples = new Float32Array(frames);
|
|
137
|
+
for (let index = 0; index < frames; index++)
|
|
138
|
+
samples[index] = view.getFloat32(index * frame + channel * 4, true);
|
|
139
|
+
parts[channel]?.push(samples);
|
|
140
|
+
}
|
|
141
|
+
length += frames;
|
|
142
|
+
return length <= most;
|
|
143
|
+
}, "push"),
|
|
144
|
+
end: /* @__PURE__ */ __name(() => {
|
|
145
|
+
if (channels === 0)
|
|
146
|
+
throw new CliError("validation_error", "no audio in that file");
|
|
147
|
+
return parts.map((pieces, channel) => {
|
|
148
|
+
const samples = new Float32Array(length);
|
|
149
|
+
let at = 0;
|
|
150
|
+
for (const piece of pieces) {
|
|
151
|
+
samples.set(piece, at);
|
|
152
|
+
at += piece.length;
|
|
153
|
+
}
|
|
154
|
+
parts[channel] = [];
|
|
155
|
+
return { samples, rate };
|
|
156
|
+
});
|
|
157
|
+
}, "end")
|
|
158
|
+
};
|
|
159
|
+
}, "wavStream");
|
|
160
|
+
var runFfmpegFile = /* @__PURE__ */ __name((path) => new Promise((resolve, reject) => {
|
|
161
|
+
const child = spawn("ffmpeg", [
|
|
162
|
+
"-nostdin",
|
|
163
|
+
"-hide_banner",
|
|
164
|
+
"-loglevel",
|
|
165
|
+
"error",
|
|
166
|
+
"-protocol_whitelist",
|
|
167
|
+
"file",
|
|
168
|
+
"-format_whitelist",
|
|
169
|
+
FFMPEG_FORMATS,
|
|
170
|
+
"-i",
|
|
171
|
+
path,
|
|
172
|
+
"-vn",
|
|
173
|
+
"-af",
|
|
174
|
+
"aformat=channel_layouts=mono|stereo",
|
|
175
|
+
"-ar",
|
|
176
|
+
String(SAMPLE_RATE),
|
|
177
|
+
"-c:a",
|
|
178
|
+
"pcm_f32le",
|
|
179
|
+
"-bitexact",
|
|
180
|
+
"-f",
|
|
181
|
+
"wav",
|
|
182
|
+
"pipe:1"
|
|
183
|
+
], { stdio: ["ignore", "pipe", "pipe"], timeout: FFMPEG_TIMEOUT_MS });
|
|
184
|
+
const wav = wavStream(LONGEST_AUDIO_SECONDS * SAMPLE_RATE);
|
|
185
|
+
let long = false;
|
|
186
|
+
let broken;
|
|
187
|
+
let errors = "";
|
|
188
|
+
child.stdout.on("data", (chunk) => {
|
|
189
|
+
if (long || broken)
|
|
190
|
+
return;
|
|
191
|
+
try {
|
|
192
|
+
long = !wav.push(chunk);
|
|
193
|
+
} catch (error) {
|
|
194
|
+
broken = error;
|
|
195
|
+
}
|
|
196
|
+
if (long || broken)
|
|
197
|
+
child.kill();
|
|
198
|
+
});
|
|
199
|
+
child.stderr.on("data", (chunk) => {
|
|
200
|
+
errors = (errors + chunk.toString()).slice(-500);
|
|
201
|
+
});
|
|
202
|
+
child.on("error", (error) => reject(error.code === "ENOENT" ? new CliError("validation_error", "only ffmpeg reads this audio format, and ffmpeg is not installed") : error));
|
|
203
|
+
child.on("close", (code) => {
|
|
204
|
+
if (long)
|
|
205
|
+
return reject(tooLongError());
|
|
206
|
+
if (broken)
|
|
207
|
+
return reject(broken);
|
|
208
|
+
if (code !== 0)
|
|
209
|
+
return reject(new CliError("validation_error", `ffmpeg could not read the audio: ${errors.trim() || code}`));
|
|
210
|
+
try {
|
|
211
|
+
resolve(wav.end());
|
|
212
|
+
} catch (error) {
|
|
213
|
+
reject(error);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
}), "runFfmpegFile");
|
|
217
|
+
var runFfmpeg = /* @__PURE__ */ __name(async (bytes) => {
|
|
218
|
+
const directory = await mkdtemp(join(tmpdir(), "wirecat-audio-"));
|
|
219
|
+
try {
|
|
220
|
+
const input = join(directory, "audio");
|
|
221
|
+
await writeFile(input, bytes, { mode: 384 });
|
|
222
|
+
return await runFfmpegFile(input);
|
|
223
|
+
} finally {
|
|
224
|
+
await rm(directory, { recursive: true, force: true });
|
|
225
|
+
}
|
|
226
|
+
}, "runFfmpeg");
|
|
227
|
+
var BUNDLED = {
|
|
228
|
+
opus: decodeOgg,
|
|
229
|
+
vorbis: decodeVorbis,
|
|
230
|
+
flac: decodeFlac,
|
|
231
|
+
mp3: decodeMp3
|
|
232
|
+
};
|
|
233
|
+
var tooLong = /* @__PURE__ */ __name((pcm) => pcm.samples.length / pcm.rate > LONGEST_AUDIO_SECONDS, "tooLong");
|
|
234
|
+
var fromFfmpeg = /* @__PURE__ */ __name((answer) => Array.isArray(answer) ? { channels: answer, mixed: false } : { channels: [answer], mixed: true }, "fromFfmpeg");
|
|
235
|
+
var decodeChannels = /* @__PURE__ */ __name(async (bytes, ffmpeg = runFfmpeg) => {
|
|
236
|
+
const format = formatOf(bytes);
|
|
237
|
+
const decoded = format === "other" ? fromFfmpeg(await ffmpeg(bytes)) : await BUNDLED[format](bytes).then((channels) => ({ channels, mixed: false }), (error) => ffmpeg(bytes).then(fromFfmpeg, () => {
|
|
238
|
+
throw error;
|
|
239
|
+
}));
|
|
240
|
+
if (decoded.channels.length === 0)
|
|
241
|
+
throw new CliError("validation_error", "no audio in that file");
|
|
242
|
+
if (decoded.channels.some(tooLong))
|
|
243
|
+
throw tooLongError();
|
|
244
|
+
return decoded;
|
|
245
|
+
}, "decodeChannels");
|
|
246
|
+
var decodeChannelsFile = /* @__PURE__ */ __name(async (path, { maxBytes = 64 * 1024 * 1024, ffmpegFile = runFfmpegFile } = {}) => {
|
|
247
|
+
const file = await open(path, "r");
|
|
248
|
+
let start;
|
|
249
|
+
let size;
|
|
250
|
+
try {
|
|
251
|
+
size = (await file.stat()).size;
|
|
252
|
+
const head = Buffer.alloc(Math.min(size, 128));
|
|
253
|
+
await file.read(head, 0, head.length, 0);
|
|
254
|
+
start = head;
|
|
255
|
+
} finally {
|
|
256
|
+
await file.close();
|
|
257
|
+
}
|
|
258
|
+
if (formatOf(start) === "other") {
|
|
259
|
+
const channels = await ffmpegFile(path);
|
|
260
|
+
if (channels.some(tooLong))
|
|
261
|
+
throw tooLongError();
|
|
262
|
+
return { channels, mixed: false };
|
|
263
|
+
}
|
|
264
|
+
if (size > maxBytes)
|
|
265
|
+
throw new CliError("validation_error", `the audio file is larger than ${Math.round(maxBytes / 1024 / 1024)} MB`, {
|
|
266
|
+
reason: "file.too-large"
|
|
267
|
+
});
|
|
268
|
+
return decodeChannels(new Uint8Array(await readFile(path)), () => ffmpegFile(path));
|
|
269
|
+
}, "decodeChannelsFile");
|
|
270
|
+
var mixDown = /* @__PURE__ */ __name((channels) => {
|
|
271
|
+
const [first] = channels;
|
|
272
|
+
if (!first)
|
|
273
|
+
throw new CliError("validation_error", "no audio in that file");
|
|
274
|
+
if (channels.length === 1)
|
|
275
|
+
return first;
|
|
276
|
+
const length = channels.reduce((longest, { samples: samples2 }) => Math.max(longest, samples2.length), 0);
|
|
277
|
+
const samples = new Float32Array(length);
|
|
278
|
+
for (const channel of channels)
|
|
279
|
+
for (let index = 0; index < channel.samples.length; index++)
|
|
280
|
+
samples[index] = (samples[index] ?? 0) + (channel.samples[index] ?? 0) / channels.length;
|
|
281
|
+
return { samples, rate: first.rate };
|
|
282
|
+
}, "mixDown");
|
|
283
|
+
var decodeAudio = /* @__PURE__ */ __name(async (bytes, ffmpeg = runFfmpeg) => mixDown((await decodeChannels(bytes, ffmpeg)).channels), "decodeAudio");
|
|
284
|
+
|
|
285
|
+
export {
|
|
286
|
+
LONGEST_AUDIO_SECONDS,
|
|
287
|
+
formatOf,
|
|
288
|
+
wavStream,
|
|
289
|
+
runFfmpegFile,
|
|
290
|
+
runFfmpeg,
|
|
291
|
+
decodeChannels,
|
|
292
|
+
decodeChannelsFile,
|
|
293
|
+
mixDown,
|
|
294
|
+
decodeAudio
|
|
295
|
+
};
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__name
|
|
5
5
|
} from "./chunk-ZVVMGPBJ.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.681.0_@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typ_3bf07d813b3b8f6ae0583ce017092c7c/node_modules/@wirecat/cli-core/dist/http/listen.js
|
|
8
8
|
import { createServer } from "node:http";
|
|
9
9
|
import { Readable } from "node:stream";
|
|
10
10
|
var MAX_BODY = 4 * 1024 * 1024;
|
|
@@ -1,21 +1,96 @@
|
|
|
1
1
|
import { createRequire as __bundleRequire } from "node:module";
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
|
+
aiKeys,
|
|
5
|
+
aiOrigin,
|
|
6
|
+
aiSettingPath,
|
|
7
|
+
readAiSetting
|
|
8
|
+
} from "./chunk-XSF5OBVZ.js";
|
|
9
|
+
import {
|
|
10
|
+
OPENAI_URL,
|
|
11
|
+
localOnly,
|
|
12
|
+
localOnlyRefusal
|
|
13
|
+
} from "./chunk-FCGRXUAU.js";
|
|
14
|
+
import {
|
|
15
|
+
readOnlyLockOf,
|
|
16
|
+
readOnlyRefusal
|
|
17
|
+
} from "./chunk-F7IDYQLM.js";
|
|
18
|
+
import {
|
|
19
|
+
onThisComputer
|
|
20
|
+
} from "./chunk-FURKMNC2.js";
|
|
21
|
+
import {
|
|
22
|
+
OPENAI_TRANSCRIBE_MODEL,
|
|
4
23
|
VAD,
|
|
5
24
|
isInstalled,
|
|
6
25
|
modelPath,
|
|
7
26
|
modelsDirectory,
|
|
8
27
|
speechModel,
|
|
9
28
|
vadPath
|
|
10
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-XCOGI4JE.js";
|
|
30
|
+
import {
|
|
31
|
+
typedCommand
|
|
32
|
+
} from "./chunk-7HEZQCHL.js";
|
|
11
33
|
import {
|
|
12
34
|
CliError
|
|
13
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-FNLXFQN6.js";
|
|
14
36
|
import {
|
|
15
37
|
__name
|
|
16
38
|
} from "./chunk-ZVVMGPBJ.js";
|
|
17
39
|
|
|
18
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.681.0_@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typ_3bf07d813b3b8f6ae0583ce017092c7c/node_modules/@wirecat/cli-core/dist/speech/cloud.js
|
|
41
|
+
var addressOf = /* @__PURE__ */ __name((env) => {
|
|
42
|
+
const setting = readAiSetting(aiSettingPath(env));
|
|
43
|
+
return setting?.provider === "openai" && setting.base_url ? setting.base_url : OPENAI_URL;
|
|
44
|
+
}, "addressOf");
|
|
45
|
+
var cloudSpeech = /* @__PURE__ */ __name((deps) => {
|
|
46
|
+
if (deps.settings.configured.transcribeWith !== "openai")
|
|
47
|
+
return null;
|
|
48
|
+
const baseUrl = addressOf(deps.env);
|
|
49
|
+
const origin = aiOrigin({ provider: "openai", base_url: baseUrl });
|
|
50
|
+
const host = new URL(origin).host;
|
|
51
|
+
const official = origin === "https://api.openai.com";
|
|
52
|
+
const leavesComputer = !onThisComputer(baseUrl);
|
|
53
|
+
const lock = readOnlyLockOf(deps.app, deps.env);
|
|
54
|
+
if (lock && leavesComputer)
|
|
55
|
+
throw readOnlyRefusal(lock, `send audio to ${host}`);
|
|
56
|
+
if (leavesComputer && localOnly(deps.env))
|
|
57
|
+
throw localOnlyRefusal("the recordings", host);
|
|
58
|
+
const apiKey = aiKeys(deps.app, deps.env, deps.keyring).read(origin)?.key;
|
|
59
|
+
const setKey = typedCommand(deps.app.command, official ? "models ai set openai --model <model> --secret-stdin" : `models ai set openai --base-url ${baseUrl} --secret-stdin`);
|
|
60
|
+
if (!apiKey && leavesComputer)
|
|
61
|
+
throw new CliError("authentication_error", `no key for ${host} \u2014 \`${setKey}\`${official ? ", or OPENAI_API_KEY" : ""}`, {
|
|
62
|
+
reason: "transcription.no-key"
|
|
63
|
+
});
|
|
64
|
+
const configuredModel = deps.settings.configured.transcribeModel;
|
|
65
|
+
const model = typeof configuredModel === "string" && configuredModel.trim() ? configuredModel.trim() : OPENAI_TRANSCRIBE_MODEL;
|
|
66
|
+
let told = false;
|
|
67
|
+
return {
|
|
68
|
+
baseUrl,
|
|
69
|
+
leavesComputer,
|
|
70
|
+
recognition: { engine: official ? "openai" : host, model },
|
|
71
|
+
recognize: /* @__PURE__ */ __name(async (audio, options = {}) => {
|
|
72
|
+
if (!told) {
|
|
73
|
+
told = true;
|
|
74
|
+
deps.notify(leavesComputer ? `the recordings' audio leaves this computer: it goes to ${host} (${model}) to be transcribed` : `the recordings' audio goes to ${host} on this computer (${model}) to be transcribed`);
|
|
75
|
+
}
|
|
76
|
+
const { transcribeOpenAI: transcribeOpenAI2 } = await import("./openai-YIP73X2B.js");
|
|
77
|
+
return transcribeOpenAI2(audio, {
|
|
78
|
+
apiKey: apiKey ?? "",
|
|
79
|
+
model,
|
|
80
|
+
baseUrl,
|
|
81
|
+
label: official ? "OpenAI" : host,
|
|
82
|
+
keyHint: setKey,
|
|
83
|
+
env: deps.env,
|
|
84
|
+
...options.bundle ? { bundle: true } : {},
|
|
85
|
+
...deps.vadModel ? { vadModel: deps.vadModel } : {},
|
|
86
|
+
...deps.fetch ? { fetch: deps.fetch } : {},
|
|
87
|
+
...deps.signal ? { signal: deps.signal } : {}
|
|
88
|
+
});
|
|
89
|
+
}, "recognize")
|
|
90
|
+
};
|
|
91
|
+
}, "cloudSpeech");
|
|
92
|
+
|
|
93
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.681.0_@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typ_3bf07d813b3b8f6ae0583ce017092c7c/node_modules/@wirecat/cli-core/dist/speech/local.js
|
|
19
94
|
import { createHash } from "node:crypto";
|
|
20
95
|
import { isAbsolute } from "node:path";
|
|
21
96
|
import { setImmediate } from "node:timers/promises";
|
|
@@ -50,7 +125,7 @@ var recognizeLocalPieces = /* @__PURE__ */ __name(async (id, audio, options = {}
|
|
|
50
125
|
const directory = options.directory ?? modelsDirectory(options.env);
|
|
51
126
|
if (!isInstalled(model, directory))
|
|
52
127
|
throw notInstalled(model.id);
|
|
53
|
-
const { openRecognizer, toModelRate } = await import("./recognize-
|
|
128
|
+
const { openRecognizer, toModelRate } = await import("./recognize-R5W25WKH.js");
|
|
54
129
|
const engine = (options.open ?? openRecognizer)(model, modelPath(directory, model), vadPath(directory));
|
|
55
130
|
try {
|
|
56
131
|
if (!engine.pieces)
|
|
@@ -81,7 +156,7 @@ var openLocalSpeechRecognizer = /* @__PURE__ */ __name(async (id, input = {}) =>
|
|
|
81
156
|
cancelled(options.signal);
|
|
82
157
|
if (!isInstalled(model, directory))
|
|
83
158
|
throw notInstalled(description.model);
|
|
84
|
-
const { openRecognizer, toModelRate } = await import("./recognize-
|
|
159
|
+
const { openRecognizer, toModelRate } = await import("./recognize-R5W25WKH.js");
|
|
85
160
|
cancelled(options.signal);
|
|
86
161
|
const engine = (options.open ?? openRecognizer)(model, modelPath(directory, model), vadPath(directory));
|
|
87
162
|
let closing = false;
|
|
@@ -128,6 +203,7 @@ var openLocalSpeechRecognizer = /* @__PURE__ */ __name(async (id, input = {}) =>
|
|
|
128
203
|
}, "openLocalSpeechRecognizer");
|
|
129
204
|
|
|
130
205
|
export {
|
|
206
|
+
cloudSpeech,
|
|
131
207
|
localSpeechRecognitionModel,
|
|
132
208
|
recognizeLocalPieces,
|
|
133
209
|
openLocalSpeechRecognizer
|