@wirecat/attio-cli 0.0.0-stage → 0.1.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/CHANGELOG.md +20 -0
- package/LICENSE +204 -0
- package/README.md +248 -2
- package/contracts/wirecat.json +2321 -0
- package/dist/bin/attio.d.ts +3 -0
- package/dist/bin/attio.d.ts.map +1 -0
- package/dist/bin/attio.js +40 -0
- package/dist/bin/attio.js.map +1 -0
- package/dist/bundle/agent-KLBL3FYD.js +37 -0
- package/dist/bundle/all-profiles-C2NMRQPE.js +320 -0
- package/dist/bundle/anthropic-KOU2ILDK.js +91 -0
- package/dist/bundle/app-server-TINV4NNY.js +249 -0
- package/dist/bundle/attio.js +183 -0
- package/dist/bundle/bun-GVNM6IWY.js +169 -0
- package/dist/bundle/bun-sqlite-IF6B3EQI.js +76 -0
- package/dist/bundle/chunk-2343HKEW.js +362 -0
- package/dist/bundle/chunk-2H2MWGBD.js +988 -0
- package/dist/bundle/chunk-2P7ENEQ7.js +288 -0
- package/dist/bundle/chunk-4EYKJLWI.js +771 -0
- package/dist/bundle/chunk-4HQDT5PF.js +338 -0
- package/dist/bundle/chunk-4QE4L7UL.js +142 -0
- package/dist/bundle/chunk-4XHWGJXT.js +6848 -0
- package/dist/bundle/chunk-5DCRHSBI.js +72 -0
- package/dist/bundle/chunk-5ETXE5KF.js +372 -0
- package/dist/bundle/chunk-5WAGTWCS.js +156 -0
- package/dist/bundle/chunk-6B5PSQQ7.js +319 -0
- package/dist/bundle/chunk-6BVPS2YY.js +230 -0
- package/dist/bundle/chunk-6L5EUGLP.js +188 -0
- package/dist/bundle/chunk-7NFEMS4A.js +1028 -0
- package/dist/bundle/chunk-A7YQTQ5U.js +733 -0
- package/dist/bundle/chunk-AEPOHR4Z.js +82 -0
- package/dist/bundle/chunk-ARRQVUJ2.js +334 -0
- package/dist/bundle/chunk-BHNFRL3H.js +95 -0
- package/dist/bundle/chunk-CBPL3GID.js +23 -0
- package/dist/bundle/chunk-D72URWJE.js +532 -0
- package/dist/bundle/chunk-DFDN6AUB.js +21 -0
- package/dist/bundle/chunk-DVN54VPI.js +16 -0
- package/dist/bundle/chunk-DW3V7GTY.js +388 -0
- package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
- package/dist/bundle/chunk-ETSOG6TZ.js +65288 -0
- package/dist/bundle/chunk-FJV3MO57.js +29 -0
- package/dist/bundle/chunk-HLLRNP2G.js +170 -0
- package/dist/bundle/chunk-HQJ2TABD.js +18 -0
- package/dist/bundle/chunk-ICUXAOEM.js +42063 -0
- package/dist/bundle/chunk-IGALQ74S.js +358 -0
- package/dist/bundle/chunk-IPHUAWFG.js +100 -0
- package/dist/bundle/chunk-IYMWUL6E.js +633 -0
- package/dist/bundle/chunk-JKCXDIGC.js +52 -0
- package/dist/bundle/chunk-JTOKDROB.js +95 -0
- package/dist/bundle/chunk-JZMGOVCZ.js +80 -0
- package/dist/bundle/chunk-KB3YJJPN.js +794 -0
- package/dist/bundle/chunk-KD4EUUER.js +37 -0
- package/dist/bundle/chunk-LB6D4QF2.js +2333 -0
- package/dist/bundle/chunk-LWUJZ2E3.js +108 -0
- package/dist/bundle/chunk-MCQOXTAL.js +53 -0
- package/dist/bundle/chunk-MMGCGPKM.js +3571 -0
- package/dist/bundle/chunk-MXDIXBIV.js +24 -0
- package/dist/bundle/chunk-MYVWV5L5.js +407 -0
- package/dist/bundle/chunk-MZNRIH3T.js +1233 -0
- package/dist/bundle/chunk-NEFILPPV.js +353 -0
- package/dist/bundle/chunk-O6CVJGGL.js +131 -0
- package/dist/bundle/chunk-OPXCRQTV.js +161 -0
- package/dist/bundle/chunk-PKNFA5TU.js +38 -0
- package/dist/bundle/chunk-PL5P7UKW.js +25216 -0
- package/dist/bundle/chunk-PO6PLQYL.js +50 -0
- package/dist/bundle/chunk-PWUQC2GI.js +218 -0
- package/dist/bundle/chunk-QCEEPJNN.js +185 -0
- package/dist/bundle/chunk-QG4WCLGB.js +1332 -0
- package/dist/bundle/chunk-QNQ2OF24.js +9578 -0
- package/dist/bundle/chunk-RCKRXBJF.js +1392 -0
- package/dist/bundle/chunk-RK4GN2II.js +2000 -0
- package/dist/bundle/chunk-RRH7UK7L.js +106 -0
- package/dist/bundle/chunk-S4UUN6LD.js +1410 -0
- package/dist/bundle/chunk-S7WJXELM.js +58 -0
- package/dist/bundle/chunk-SBRFKB77.js +1197 -0
- package/dist/bundle/chunk-SP6DPFZ4.js +4072 -0
- package/dist/bundle/chunk-SWJDLFDM.js +557 -0
- package/dist/bundle/chunk-TWCVCW5T.js +66 -0
- package/dist/bundle/chunk-V2R2BJJU.js +63 -0
- package/dist/bundle/chunk-V5K3M7FE.js +78 -0
- package/dist/bundle/chunk-V6ALLFEE.js +1068 -0
- package/dist/bundle/chunk-V6EVJXLO.js +259 -0
- package/dist/bundle/chunk-VJ4CPL6F.js +54 -0
- package/dist/bundle/chunk-VL25A6V2.js +41 -0
- package/dist/bundle/chunk-WBEZZGZE.js +12645 -0
- package/dist/bundle/chunk-WIYAMDPP.js +73 -0
- package/dist/bundle/chunk-WRJGITBX.js +76 -0
- package/dist/bundle/chunk-XHIVZPQ2.js +7 -0
- package/dist/bundle/chunk-XQUUANA2.js +24600 -0
- package/dist/bundle/chunk-XTQIXZVM.js +2788 -0
- package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
- package/dist/bundle/chunk-YKN4Y35P.js +206 -0
- package/dist/bundle/chunk-ZMJZQGCN.js +46 -0
- package/dist/bundle/chunk-ZPSH27BB.js +274 -0
- package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
- package/dist/bundle/command-contract-3FR7BK72.js +37 -0
- package/dist/bundle/command-server-entry-4XR4GDS7.js +166 -0
- package/dist/bundle/decode-24EITKP4.js +297 -0
- package/dist/bundle/definitions-HU62PG4L.js +43364 -0
- package/dist/bundle/dispatch-VE6CXCJW.js +411 -0
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/dist-ZSNEZYVF.js +7577 -0
- package/dist/bundle/echarts-LEVLEF7L.js +42501 -0
- package/dist/bundle/embed-G6FGY3VZ.js +38 -0
- package/dist/bundle/embedder-B6LNMXZZ.js +111 -0
- package/dist/bundle/failure-ASVFQXMF.js +25 -0
- package/dist/bundle/first-run-NVXVVALW.js +29 -0
- package/dist/bundle/first-screen-N3IPK5AT.js +37 -0
- package/dist/bundle/instructions-F3KPYMJK.js +11 -0
- package/dist/bundle/mcp-BUCB5ZPE.js +167 -0
- package/dist/bundle/meeting-combined-7FREWXMB.js +24 -0
- package/dist/bundle/meeting-model-GJPAIUQL.js +25 -0
- package/dist/bundle/meeting-semantic-YWY645AH.js +22 -0
- package/dist/bundle/node-KM3CUABH.js +2340 -0
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/node-WVUZSDLD.js +176 -0
- package/dist/bundle/node-sqlite-V4NNKABG.js +74 -0
- package/dist/bundle/oauth-7CENTQIN.js +20 -0
- package/dist/bundle/open-OLTONZBG.js +23 -0
- package/dist/bundle/openai-M6ES74YN.js +238 -0
- package/dist/bundle/process-VFIFK5KO.js +91 -0
- package/dist/bundle/program-N72VUDXM.js +33418 -0
- package/dist/bundle/prompt-TNWPBEBB.js +17 -0
- package/dist/bundle/recognize-PV2WOUWS.js +26 -0
- package/dist/bundle/remote-3F6JACS5.js +31 -0
- package/dist/bundle/rerank-33C67PIV.js +52 -0
- package/dist/bundle/schemas-RLDEALIJ.js +21410 -0
- package/dist/bundle/serve-3DEMACSQ.js +199 -0
- package/dist/bundle/server-AAK2HWQM.js +79 -0
- package/dist/bundle/server-LIBRGMUZ.js +212 -0
- package/dist/bundle/sqlite-runtime-SMAREHYG.js +20 -0
- package/dist/bundle/state-WPHAVJIU.js +36 -0
- package/dist/bundle/store-A7V4FEXE.js +177 -0
- package/dist/bundle/store-PMAPJNXT.js +291 -0
- package/dist/bundle/store-maintenance-command-QHRHAEYN.js +66 -0
- package/dist/bundle/surface-MN4RTNYW.js +65 -0
- package/dist/commands/api.d.ts +12 -0
- package/dist/commands/api.d.ts.map +1 -0
- package/dist/commands/api.js +27 -0
- package/dist/commands/api.js.map +1 -0
- package/dist/commands/comments.d.ts +3 -0
- package/dist/commands/comments.d.ts.map +1 -0
- package/dist/commands/comments.js +114 -0
- package/dist/commands/comments.js.map +1 -0
- package/dist/commands/crm.d.ts +4 -0
- package/dist/commands/crm.d.ts.map +1 -0
- package/dist/commands/crm.js +66 -0
- package/dist/commands/crm.js.map +1 -0
- package/dist/commands/session.d.ts +7 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +22 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +14 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +37 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +31 -0
- package/dist/context.js.map +1 -0
- package/dist/generated/definitions.d.ts +3 -0
- package/dist/generated/definitions.d.ts.map +1 -0
- package/dist/generated/definitions.js +43360 -0
- package/dist/generated/definitions.js.map +1 -0
- package/dist/generated/manifest.d.ts +6 -0
- package/dist/generated/manifest.d.ts.map +1 -0
- package/dist/generated/manifest.js +5158 -0
- package/dist/generated/manifest.js.map +1 -0
- package/dist/generated/schemas.d.ts +383 -0
- package/dist/generated/schemas.d.ts.map +1 -0
- package/dist/generated/schemas.js +21196 -0
- package/dist/generated/schemas.js.map +1 -0
- package/dist/generated/types.d.ts +10156 -0
- package/dist/generated/types.d.ts.map +1 -0
- package/dist/generated/types.js +5 -0
- package/dist/generated/types.js.map +1 -0
- package/dist/generated/wirecat-config.d.ts +15 -0
- package/dist/generated/wirecat-config.d.ts.map +1 -0
- package/dist/generated/wirecat-config.js +328 -0
- package/dist/generated/wirecat-config.js.map +1 -0
- package/dist/hooks.d.ts +3 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +7 -0
- package/dist/hooks.js.map +1 -0
- package/dist/identity.d.ts +33 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +31 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/program.d.ts +6 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +54 -0
- package/dist/program.js.map +1 -0
- package/dist/sample/comments.d.ts +61 -0
- package/dist/sample/comments.d.ts.map +1 -0
- package/dist/sample/comments.js +39 -0
- package/dist/sample/comments.js.map +1 -0
- package/dist/sample/records.d.ts +16 -0
- package/dist/sample/records.d.ts.map +1 -0
- package/dist/sample/records.js +22 -0
- package/dist/sample/records.js.map +1 -0
- package/dist/sample/transport.d.ts +42 -0
- package/dist/sample/transport.d.ts.map +1 -0
- package/dist/sample/transport.js +153 -0
- package/dist/sample/transport.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/dist/wcat.d.ts +3 -0
- package/dist/wcat.d.ts.map +1 -0
- package/dist/wcat.js +4 -0
- package/dist/wcat.js.map +1 -0
- package/package.json +87 -4
- package/skills/attio-cli/SKILL.md +58 -0
- package/skills/attio-cli/references/api/api-activities.md +62 -0
- package/skills/attio-cli/references/api/api-activity-records.md +96 -0
- package/skills/attio-cli/references/api/api-attributes.md +148 -0
- package/skills/attio-cli/references/api/api-call-recordings.md +53 -0
- package/skills/attio-cli/references/api/api-comments.md +36 -0
- package/skills/attio-cli/references/api/api-emails.md +23 -0
- package/skills/attio-cli/references/api/api-entries.md +127 -0
- package/skills/attio-cli/references/api/api-files.md +63 -0
- package/skills/attio-cli/references/api/api-lists.md +44 -0
- package/skills/attio-cli/references/api/api-meetings.md +82 -0
- package/skills/attio-cli/references/api/api-meta.md +8 -0
- package/skills/attio-cli/references/api/api-notes.md +64 -0
- package/skills/attio-cli/references/api/api-objects.md +55 -0
- package/skills/attio-cli/references/api/api-records.md +168 -0
- package/skills/attio-cli/references/api/api-sequences.md +15 -0
- package/skills/attio-cli/references/api/api-sql.md +15 -0
- package/skills/attio-cli/references/api/api-tasks.md +67 -0
- package/skills/attio-cli/references/api/api-threads.md +35 -0
- package/skills/attio-cli/references/api/api-transcripts.md +17 -0
- package/skills/attio-cli/references/api/api-views.md +133 -0
- package/skills/attio-cli/references/api/api-webhooks.md +62 -0
- package/skills/attio-cli/references/api/api-workspace-blocklist.md +39 -0
- package/skills/attio-cli/references/api/api-workspace-members.md +19 -0
- package/skills/attio-cli/references/api.md +35 -0
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
// cli-dev-bundle:from:cli-dev-bundle:from
|
|
8
|
+
import * as module from "node:module";
|
|
9
|
+
import { dirname } from "node:path";
|
|
10
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
11
|
+
var resolveFrom = /* @__PURE__ */ __name((parent, specifier) => {
|
|
12
|
+
if (globalThis.Bun) {
|
|
13
|
+
if (specifier.includes(":")) return import.meta.resolve(specifier);
|
|
14
|
+
try {
|
|
15
|
+
return pathToFileURL(globalThis.Bun.resolveSync(specifier, dirname(fileURLToPath(parent)))).href;
|
|
16
|
+
} catch {
|
|
17
|
+
return import.meta.resolve(specifier);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (!module.registerHooks) return import.meta.resolve(specifier);
|
|
21
|
+
const hooks = module.registerHooks({
|
|
22
|
+
resolve: /* @__PURE__ */ __name((asked, context, next) => next(asked, asked === specifier ? { ...context, parentURL: parent } : context), "resolve")
|
|
23
|
+
});
|
|
24
|
+
try {
|
|
25
|
+
return import.meta.resolve(specifier);
|
|
26
|
+
} finally {
|
|
27
|
+
hooks.deregister();
|
|
28
|
+
}
|
|
29
|
+
}, "resolveFrom");
|
|
30
|
+
var importFrom = /* @__PURE__ */ __name(async (parent, specifier) => import(resolveFrom(parent, specifier)), "importFrom");
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
resolveFrom,
|
|
34
|
+
importFrom
|
|
35
|
+
};
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
singleLine
|
|
5
|
+
} from "./chunk-5DCRHSBI.js";
|
|
6
|
+
import {
|
|
7
|
+
__name
|
|
8
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
9
|
+
|
|
10
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.118.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
|
+
var FIRST_PARTY_TOOLS = [
|
|
12
|
+
{ name: "tg", package: "@wirecat/tg-cli" },
|
|
13
|
+
{ name: "max", package: "@wirecat/max-cli" },
|
|
14
|
+
{ name: "wa", package: "@wirecat/whatsapp-cli" },
|
|
15
|
+
{ name: "zm", package: "@wirecat/zoom-cli" },
|
|
16
|
+
{ name: "drive", package: "@wirecat/drive-cli" },
|
|
17
|
+
{ name: "memo", package: "@wirecat/cli-memo" },
|
|
18
|
+
{ name: "mail", package: "@wirecat/mail-cli" },
|
|
19
|
+
// memo reads email today; the name is held for a tool of its own.
|
|
20
|
+
{ name: "email" }
|
|
21
|
+
];
|
|
22
|
+
var BUILT_IN_COMMANDS = ["help", "version", "shortcuts", "doctor", "update", "upgrade", "app"];
|
|
23
|
+
var RESERVED_NAMES = [
|
|
24
|
+
...FIRST_PARTY_TOOLS.map((tool) => tool.name),
|
|
25
|
+
...BUILT_IN_COMMANDS,
|
|
26
|
+
"wcat"
|
|
27
|
+
];
|
|
28
|
+
var TOOL_NAME = /^[a-z][a-z0-9-]{0,39}$/;
|
|
29
|
+
var PROGRAM_PREFIX = "wcat-";
|
|
30
|
+
var DESCRIBE_FLAG = "--wcat-describe";
|
|
31
|
+
var DESCRIBE_MAX_BYTES = 64 * 1024;
|
|
32
|
+
var DISPATCH_FLAG = "--wcat-dispatch";
|
|
33
|
+
|
|
34
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.118.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
|
+
var DESCRIBE_FORMAT = 1;
|
|
36
|
+
var DESCRIBE_MANIFEST_FORMAT = 2;
|
|
37
|
+
var describeAnswer = /* @__PURE__ */ __name((tool, manifest) => {
|
|
38
|
+
const answer = {
|
|
39
|
+
wcat_describe: DESCRIBE_FORMAT,
|
|
40
|
+
name: tool.command,
|
|
41
|
+
version: tool.version,
|
|
42
|
+
description: tool.description,
|
|
43
|
+
...tool.docs ? { docs_url: tool.docs } : {}
|
|
44
|
+
};
|
|
45
|
+
if (!manifest)
|
|
46
|
+
return answer;
|
|
47
|
+
const full = {
|
|
48
|
+
...answer,
|
|
49
|
+
wcat_describe: DESCRIBE_MANIFEST_FORMAT,
|
|
50
|
+
desktop: manifest.desktop,
|
|
51
|
+
manifest_sha256: manifest.sha256
|
|
52
|
+
};
|
|
53
|
+
return Buffer.byteLength(`${JSON.stringify(full)}
|
|
54
|
+
`) > DESCRIBE_MAX_BYTES ? answer : full;
|
|
55
|
+
}, "describeAnswer");
|
|
56
|
+
var MAX_TEXT = 200;
|
|
57
|
+
var clean = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim() !== "" ? singleLine(value.trim()).slice(0, MAX_TEXT) : void 0, "clean");
|
|
58
|
+
var parseDescribe = /* @__PURE__ */ __name((text) => {
|
|
59
|
+
let answer;
|
|
60
|
+
try {
|
|
61
|
+
answer = JSON.parse(text);
|
|
62
|
+
} catch {
|
|
63
|
+
return void 0;
|
|
64
|
+
}
|
|
65
|
+
if (typeof answer !== "object" || answer === null || !("wcat_describe" in answer))
|
|
66
|
+
return void 0;
|
|
67
|
+
const { version, description, docs_url: docs, manifest_sha256: sha } = answer;
|
|
68
|
+
const url = clean(docs);
|
|
69
|
+
return {
|
|
70
|
+
version: clean(version) ?? "",
|
|
71
|
+
description: clean(description) ?? "",
|
|
72
|
+
...url && /^https?:\/\//.test(url) ? { docs: url } : {},
|
|
73
|
+
...typeof sha === "string" && /^[0-9a-f]{64}$/.test(sha) ? { manifestSha256: sha } : {}
|
|
74
|
+
};
|
|
75
|
+
}, "parseDescribe");
|
|
76
|
+
|
|
77
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.118.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
|
+
import { lstatSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
79
|
+
import { join } from "node:path";
|
|
80
|
+
var SHIM_FORMAT = 2;
|
|
81
|
+
var MARK = /^(?:#|REM) wirecat-shim (\d+) (launcher|shortcut) (\S+)\r?$/m;
|
|
82
|
+
var NOTE = {
|
|
83
|
+
launcher: "Written by @wirecat/cli-base. Any WireCat tool rewrites it when it breaks; it is safe to delete.",
|
|
84
|
+
shortcut: "Made by `wcat shortcuts add`; `wcat shortcuts remove` takes it out."
|
|
85
|
+
};
|
|
86
|
+
var shellQuote = /* @__PURE__ */ __name((text) => `'${text.replaceAll("'", `'\\''`)}'`, "shellQuote");
|
|
87
|
+
var launcherBody = /* @__PURE__ */ __name((dir, target, name) => [
|
|
88
|
+
'ok() { [ -f "$1" ] && [ -x "$1" ]; }',
|
|
89
|
+
`dir=${shellQuote(dir)}`,
|
|
90
|
+
`target=${shellQuote(join(dir, target))}`,
|
|
91
|
+
'if ! ok "$target"; then',
|
|
92
|
+
' for t in "$dir"/wcat-*; do',
|
|
93
|
+
' if ok "$t"; then target=$t; break; fi',
|
|
94
|
+
" done",
|
|
95
|
+
"fi",
|
|
96
|
+
`if ok "$target"; then exec "$target" ${DISPATCH_FLAG} "$@"; fi`,
|
|
97
|
+
'if [ -z "$WIRECAT_LAUNCHER_SKIP" ]; then',
|
|
98
|
+
" WIRECAT_LAUNCHER_SKIP=1; export WIRECAT_LAUNCHER_SKIP",
|
|
99
|
+
" set -f; oldifs=$IFS; IFS=:",
|
|
100
|
+
" for d in $PATH; do",
|
|
101
|
+
` if [ -n "$d" ] && [ "$d" != "$dir" ] && ok "$d/${name}"; then IFS=$oldifs; exec "$d/${name}" "$@"; fi`,
|
|
102
|
+
" done",
|
|
103
|
+
" IFS=$oldifs; set +f",
|
|
104
|
+
"fi",
|
|
105
|
+
`printf '%s\\n' "${name}: $target is missing and no other ${name}-* program was found in $dir or on PATH." \\`,
|
|
106
|
+
` "This launcher is safe to delete: $dir/${name}" >&2`,
|
|
107
|
+
"exit 127"
|
|
108
|
+
], "launcherBody");
|
|
109
|
+
var shimFiles = /* @__PURE__ */ __name((kind, { dir, name, target, platform }) => {
|
|
110
|
+
const mark = `wirecat-shim ${SHIM_FORMAT} ${kind} ${target}`;
|
|
111
|
+
const extra = kind === "launcher" ? ` ${DISPATCH_FLAG}` : "";
|
|
112
|
+
if (platform !== "win32")
|
|
113
|
+
return [
|
|
114
|
+
{
|
|
115
|
+
path: join(dir, name),
|
|
116
|
+
text: [
|
|
117
|
+
"#!/bin/sh",
|
|
118
|
+
`# ${mark}`,
|
|
119
|
+
`# ${NOTE[kind]}`,
|
|
120
|
+
...kind === "launcher" ? launcherBody(dir, target, name) : [`exec ${shellQuote(join(dir, target))} "$@"`],
|
|
121
|
+
""
|
|
122
|
+
].join("\n")
|
|
123
|
+
}
|
|
124
|
+
];
|
|
125
|
+
return [
|
|
126
|
+
{
|
|
127
|
+
path: join(dir, `${name}.cmd`),
|
|
128
|
+
text: ["@ECHO off", `REM ${mark}`, `REM ${NOTE[kind]}`, `"%~dp0${target}"${extra} %*`, ""].join("\r\n")
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
path: join(dir, `${name}.ps1`),
|
|
132
|
+
text: [
|
|
133
|
+
`# ${mark}`,
|
|
134
|
+
`# ${NOTE[kind]}`,
|
|
135
|
+
// PowerShell hands a .cmd its arguments unquoted, so `a&b` would run `b`; npm and pnpm write a .ps1 beside
|
|
136
|
+
// their .cmd, and it is started instead whenever it is there.
|
|
137
|
+
`$stem = Join-Path $PSScriptRoot "${target.replace(/\.(cmd|exe|bat)$/i, "")}"`,
|
|
138
|
+
`$target = if (Test-Path -LiteralPath "$stem.ps1") { "$stem.ps1" } else { Join-Path $PSScriptRoot "${target}" }`,
|
|
139
|
+
"if ($MyInvocation.ExpectingInput) {",
|
|
140
|
+
` $input | & $target${extra} @args`,
|
|
141
|
+
"} else {",
|
|
142
|
+
` & $target${extra} @args`,
|
|
143
|
+
"}",
|
|
144
|
+
"exit $LASTEXITCODE",
|
|
145
|
+
""
|
|
146
|
+
].join("\r\n")
|
|
147
|
+
}
|
|
148
|
+
];
|
|
149
|
+
}, "shimFiles");
|
|
150
|
+
var parseShim = /* @__PURE__ */ __name((text) => {
|
|
151
|
+
const found = MARK.exec(text.split("\n", 3).join("\n"));
|
|
152
|
+
if (!found)
|
|
153
|
+
return void 0;
|
|
154
|
+
return { format: Number(found[1]), kind: found[2], target: found[3] };
|
|
155
|
+
}, "parseShim");
|
|
156
|
+
var MAX_SHIM_BYTES = 4096;
|
|
157
|
+
var fileState = /* @__PURE__ */ __name((path) => {
|
|
158
|
+
let stat;
|
|
159
|
+
try {
|
|
160
|
+
stat = lstatSync(path);
|
|
161
|
+
} catch (error) {
|
|
162
|
+
return error.code === "ENOENT" ? { state: "missing" } : { state: "foreign" };
|
|
163
|
+
}
|
|
164
|
+
if (!stat.isFile() || stat.size > MAX_SHIM_BYTES)
|
|
165
|
+
return { state: "foreign" };
|
|
166
|
+
try {
|
|
167
|
+
const text = readFileSync(path, "utf8");
|
|
168
|
+
const mark = parseShim(text);
|
|
169
|
+
return mark ? { state: "ours", mark, text } : { state: "foreign" };
|
|
170
|
+
} catch {
|
|
171
|
+
return { state: "foreign" };
|
|
172
|
+
}
|
|
173
|
+
}, "fileState");
|
|
174
|
+
var exists = /* @__PURE__ */ __name((path) => {
|
|
175
|
+
try {
|
|
176
|
+
return statSync(path).isFile();
|
|
177
|
+
} catch {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
}, "exists");
|
|
181
|
+
var writeShim = /* @__PURE__ */ __name(({ path, text }) => {
|
|
182
|
+
const temporary = `${path}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
|
|
183
|
+
try {
|
|
184
|
+
writeFileSync(temporary, text, { mode: 493 });
|
|
185
|
+
renameSync(temporary, path);
|
|
186
|
+
} finally {
|
|
187
|
+
rmSync(temporary, { force: true });
|
|
188
|
+
}
|
|
189
|
+
}, "writeShim");
|
|
190
|
+
|
|
191
|
+
export {
|
|
192
|
+
FIRST_PARTY_TOOLS,
|
|
193
|
+
BUILT_IN_COMMANDS,
|
|
194
|
+
TOOL_NAME,
|
|
195
|
+
PROGRAM_PREFIX,
|
|
196
|
+
DESCRIBE_FLAG,
|
|
197
|
+
DESCRIBE_MAX_BYTES,
|
|
198
|
+
DISPATCH_FLAG,
|
|
199
|
+
describeAnswer,
|
|
200
|
+
parseDescribe,
|
|
201
|
+
SHIM_FORMAT,
|
|
202
|
+
shimFiles,
|
|
203
|
+
fileState,
|
|
204
|
+
exists,
|
|
205
|
+
writeShim
|
|
206
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
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-base@0.118.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/executable.js
|
|
8
|
+
import { existsSync } from "node:fs";
|
|
9
|
+
import { win32 } from "node:path";
|
|
10
|
+
var variable = /* @__PURE__ */ __name((env, name) => Object.entries(env).find(([key]) => key.toUpperCase() === name)?.[1], "variable");
|
|
11
|
+
var executableOnPath = /* @__PURE__ */ __name((command, env, platform = process.platform, exists = existsSync) => {
|
|
12
|
+
if (platform !== "win32" || win32.isAbsolute(command))
|
|
13
|
+
return command;
|
|
14
|
+
if (/[\\/]/.test(command))
|
|
15
|
+
return command;
|
|
16
|
+
const extensions = win32.extname(command) ? [""] : (variable(env, "PATHEXT") ?? ".EXE;.COM;.CMD;.BAT").split(";").filter((ext) => /^\.[a-z0-9]+$/i.test(ext));
|
|
17
|
+
for (const entry of (variable(env, "PATH") ?? "").split(";")) {
|
|
18
|
+
const directory = entry.replace(/^"(.*)"$/, "$1");
|
|
19
|
+
for (const extension of extensions) {
|
|
20
|
+
const candidate = win32.join(directory, command + extension);
|
|
21
|
+
if (exists(candidate))
|
|
22
|
+
return candidate;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return command;
|
|
26
|
+
}, "executableOnPath");
|
|
27
|
+
var executableEnvironment = /* @__PURE__ */ __name((env, platform = process.platform) => {
|
|
28
|
+
if (platform !== "win32")
|
|
29
|
+
return env;
|
|
30
|
+
const configured = variable(env, "COMSPEC");
|
|
31
|
+
const system = variable(env, "SYSTEMROOT");
|
|
32
|
+
const shell = configured ? configured : system && win32.isAbsolute(system) ? win32.join(system, "System32", "cmd.exe") : void 0;
|
|
33
|
+
if (!shell)
|
|
34
|
+
return env;
|
|
35
|
+
const result = { ...env };
|
|
36
|
+
for (const key of Object.keys(result))
|
|
37
|
+
if (key.toUpperCase() === "COMSPEC")
|
|
38
|
+
delete result[key];
|
|
39
|
+
result.comspec = shell;
|
|
40
|
+
return result;
|
|
41
|
+
}, "executableEnvironment");
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
executableOnPath,
|
|
45
|
+
executableEnvironment
|
|
46
|
+
};
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
wirecatDirectory
|
|
5
|
+
} from "./chunk-VJ4CPL6F.js";
|
|
6
|
+
import {
|
|
7
|
+
CliError
|
|
8
|
+
} from "./chunk-5DCRHSBI.js";
|
|
9
|
+
import {
|
|
10
|
+
__name
|
|
11
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
12
|
+
|
|
13
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.700.0_@wirecat+cli-base@0.118.0_commander@15.0.0_esbuild@0.28.2_typ_365b7216b918b4ff8396dc0e09311081/node_modules/@wirecat/cli-core/dist/speech/models.js
|
|
14
|
+
var huggingFace = /* @__PURE__ */ __name((repository, commit) => (name) => `https://huggingface.co/csukuangfj/${repository}/resolve/${commit}/${name}`, "huggingFace");
|
|
15
|
+
var gigaam = huggingFace("sherpa-onnx-nemo-transducer-punct-giga-am-v3-russian-2025-12-16", "a6039be7cee829a9044a69ac0ebaf1c191217c97");
|
|
16
|
+
var gigaamCtc = huggingFace("sherpa-onnx-nemo-ctc-punct-giga-am-v3-russian-2025-12-16", "4fb5407ff028a69fec516cdf4c10fac9ddea7c16");
|
|
17
|
+
var parakeet = huggingFace("sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8", "2bda32ec70b097a55adaa07d9a7173915b43cc78");
|
|
18
|
+
var MODELS = [
|
|
19
|
+
{
|
|
20
|
+
id: "gigaam-v3",
|
|
21
|
+
title: "GigaAM v3, with punctuation",
|
|
22
|
+
languages: "Russian \u2014 the best of the three for Russian",
|
|
23
|
+
language: "ru",
|
|
24
|
+
featureDim: 64,
|
|
25
|
+
files: [
|
|
26
|
+
{
|
|
27
|
+
name: "encoder.int8.onnx",
|
|
28
|
+
url: gigaam("encoder.int8.onnx"),
|
|
29
|
+
sha256: "369f35a71bf288d3b8e0391fabd8dba5f2314088d440bca474056b7b4b6e66bf",
|
|
30
|
+
bytes: 224570820
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "decoder.onnx",
|
|
34
|
+
url: gigaam("decoder.onnx"),
|
|
35
|
+
sha256: "38fc7475443ea2a26f63211ca350f73ac50fff824ab7a3876ee2bd610c53bbc4",
|
|
36
|
+
bytes: 4600132
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "joiner.onnx",
|
|
40
|
+
url: gigaam("joiner.onnx"),
|
|
41
|
+
sha256: "602ff7017a93311aad34df1437c8d7f49911353c13d6eae7a6ee7b041339465c",
|
|
42
|
+
bytes: 2712896
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "tokens.txt",
|
|
46
|
+
url: gigaam("tokens.txt"),
|
|
47
|
+
sha256: "39abae20e692998290c574e606f11a9edef2902a1995463fcff63d1490cf22b7",
|
|
48
|
+
bytes: 13354
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
config: /* @__PURE__ */ __name((path) => ({
|
|
52
|
+
transducer: { encoder: path("encoder.int8.onnx"), decoder: path("decoder.onnx"), joiner: path("joiner.onnx") },
|
|
53
|
+
tokens: path("tokens.txt"),
|
|
54
|
+
modelType: "nemo_transducer"
|
|
55
|
+
}), "config")
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: "gigaam-v3-ctc",
|
|
59
|
+
title: "GigaAM v3 CTC, with punctuation \u2014 a little faster",
|
|
60
|
+
languages: "Russian \u2014 a little faster, rougher with capital letters",
|
|
61
|
+
language: "ru",
|
|
62
|
+
featureDim: 64,
|
|
63
|
+
files: [
|
|
64
|
+
{
|
|
65
|
+
name: "model.int8.onnx",
|
|
66
|
+
url: gigaamCtc("model.int8.onnx"),
|
|
67
|
+
sha256: "d5fea8df94263c285e54b21e5774b707c707192d3bdbeffd7b1eb07fb6743b35",
|
|
68
|
+
bytes: 224893661
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "tokens.txt",
|
|
72
|
+
url: gigaamCtc("tokens.txt"),
|
|
73
|
+
sha256: "142de7570b3de5b3035ce111a89c228e80e6085273731d944093ddf24fa539cd",
|
|
74
|
+
bytes: 2007
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
config: /* @__PURE__ */ __name((path) => ({ nemoCtc: { model: path("model.int8.onnx") }, tokens: path("tokens.txt") }), "config")
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: "parakeet-v3",
|
|
81
|
+
title: "NVIDIA Parakeet TDT 0.6B v3",
|
|
82
|
+
/** The model card's list: huggingface.co/nvidia/parakeet-tdt-0.6b-v3, read 2026-09-24. */
|
|
83
|
+
languages: "25: bg cs da de el en es et fi fr hr hu it lt lv mt nl pl pt ro ru sk sl sv uk",
|
|
84
|
+
featureDim: 80,
|
|
85
|
+
files: [
|
|
86
|
+
{
|
|
87
|
+
name: "encoder.int8.onnx",
|
|
88
|
+
url: parakeet("encoder.int8.onnx"),
|
|
89
|
+
sha256: "acfc2b4456377e15d04f0243af540b7fe7c992f8d898d751cf134c3a55fd2247",
|
|
90
|
+
bytes: 652184281
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "decoder.int8.onnx",
|
|
94
|
+
url: parakeet("decoder.int8.onnx"),
|
|
95
|
+
sha256: "179e50c43d1a9de79c8a24149a2f9bac6eb5981823f2a2ed88d655b24248db4e",
|
|
96
|
+
bytes: 11845275
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "joiner.int8.onnx",
|
|
100
|
+
url: parakeet("joiner.int8.onnx"),
|
|
101
|
+
sha256: "3164c13fc2821009440d20fcb5fdc78bff28b4db2f8d0f0b329101719c0948b3",
|
|
102
|
+
bytes: 6355277
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: "tokens.txt",
|
|
106
|
+
url: parakeet("tokens.txt"),
|
|
107
|
+
sha256: "d58544679ea4bc6ac563d1f545eb7d474bd6cfa467f0a6e2c1dc1c7d37e3c35d",
|
|
108
|
+
bytes: 93939
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
config: /* @__PURE__ */ __name((path) => ({
|
|
112
|
+
transducer: {
|
|
113
|
+
encoder: path("encoder.int8.onnx"),
|
|
114
|
+
decoder: path("decoder.int8.onnx"),
|
|
115
|
+
joiner: path("joiner.int8.onnx")
|
|
116
|
+
},
|
|
117
|
+
tokens: path("tokens.txt"),
|
|
118
|
+
modelType: "nemo_transducer"
|
|
119
|
+
}), "config")
|
|
120
|
+
}
|
|
121
|
+
];
|
|
122
|
+
var OPENAI_TRANSCRIBE_MODEL = "gpt-transcribe";
|
|
123
|
+
var VAD = {
|
|
124
|
+
name: "silero_vad.onnx",
|
|
125
|
+
url: "https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/silero_vad.onnx",
|
|
126
|
+
sha256: "9e2449e1087496d8d4caba907f23e0bd3f78d91fa552479bb9c23ac09cbb1fd6",
|
|
127
|
+
bytes: 643854
|
|
128
|
+
};
|
|
129
|
+
var DEFAULT_ORDER = ["parakeet-v3", "gigaam-v3", "gigaam-v3-ctc"];
|
|
130
|
+
var orderedModels = /* @__PURE__ */ __name((order = DEFAULT_ORDER) => [.../* @__PURE__ */ new Set([...order, ...DEFAULT_ORDER])].map(speechModel), "orderedModels");
|
|
131
|
+
var findModel = /* @__PURE__ */ __name((id) => MODELS.find((model) => model.id === id), "findModel");
|
|
132
|
+
var speechModel = /* @__PURE__ */ __name((id) => {
|
|
133
|
+
const model = findModel(id);
|
|
134
|
+
if (!model) {
|
|
135
|
+
throw new CliError("validation_error", `no speech model "${id}" \u2014 one of ${MODELS.map((known) => known.id).join(", ")}`);
|
|
136
|
+
}
|
|
137
|
+
return model;
|
|
138
|
+
}, "speechModel");
|
|
139
|
+
|
|
140
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.700.0_@wirecat+cli-base@0.118.0_commander@15.0.0_esbuild@0.28.2_typ_365b7216b918b4ff8396dc0e09311081/node_modules/@wirecat/cli-core/dist/speech/install.js
|
|
141
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
142
|
+
import { createReadStream, createWriteStream, mkdirSync, statSync } from "node:fs";
|
|
143
|
+
import { rename, rm } from "node:fs/promises";
|
|
144
|
+
import { dirname, join } from "node:path";
|
|
145
|
+
import { Readable, Transform } from "node:stream";
|
|
146
|
+
import { pipeline } from "node:stream/promises";
|
|
147
|
+
var sharedModelsDirectory = /* @__PURE__ */ __name((kind, env = process.env) => join(wirecatDirectory(env), "models", kind), "sharedModelsDirectory");
|
|
148
|
+
var modelsDirectory = /* @__PURE__ */ __name((env = process.env) => sharedModelsDirectory("audio", env), "modelsDirectory");
|
|
149
|
+
var STALL_MS = 6e4;
|
|
150
|
+
var watchdog = /* @__PURE__ */ __name((ms) => {
|
|
151
|
+
const controller = new AbortController();
|
|
152
|
+
let timer = setTimeout(() => controller.abort(), ms);
|
|
153
|
+
return {
|
|
154
|
+
signal: controller.signal,
|
|
155
|
+
poke: /* @__PURE__ */ __name(() => {
|
|
156
|
+
clearTimeout(timer);
|
|
157
|
+
timer = setTimeout(() => controller.abort(), ms);
|
|
158
|
+
}, "poke"),
|
|
159
|
+
stop: /* @__PURE__ */ __name(() => clearTimeout(timer), "stop")
|
|
160
|
+
};
|
|
161
|
+
}, "watchdog");
|
|
162
|
+
var modelPath = /* @__PURE__ */ __name((directory, model) => (name) => join(directory, model.id, name), "modelPath");
|
|
163
|
+
var vadPath = /* @__PURE__ */ __name((directory) => join(directory, VAD.name), "vadPath");
|
|
164
|
+
var placed = /* @__PURE__ */ __name((model, directory) => [
|
|
165
|
+
...model.files.map((file) => [file, modelPath(directory, model)(file.name)]),
|
|
166
|
+
[VAD, vadPath(directory)]
|
|
167
|
+
], "placed");
|
|
168
|
+
var isInstalled = /* @__PURE__ */ __name((model, directory) => filesPresent(placed(model, directory)), "isInstalled");
|
|
169
|
+
var filesPresent = /* @__PURE__ */ __name((files) => files.every(([file, path]) => sizeOf(path) === file.bytes), "filesPresent");
|
|
170
|
+
var sizeOf = /* @__PURE__ */ __name((path) => {
|
|
171
|
+
try {
|
|
172
|
+
return statSync(path).size;
|
|
173
|
+
} catch {
|
|
174
|
+
return void 0;
|
|
175
|
+
}
|
|
176
|
+
}, "sizeOf");
|
|
177
|
+
var installedBytes = /* @__PURE__ */ __name((model) => model.files.reduce((sum, file) => sum + file.bytes, 0), "installedBytes");
|
|
178
|
+
var install = /* @__PURE__ */ __name(async (model, directory, { fetch: get = fetch, progress, bytes, verifyExisting } = {}) => {
|
|
179
|
+
mkdirSync(join(directory, model.id), { recursive: true, mode: 448 });
|
|
180
|
+
await installFiles(placed(model, directory), { fetch: get, progress, bytes, verifyExisting });
|
|
181
|
+
}, "install");
|
|
182
|
+
var installFiles = /* @__PURE__ */ __name(async (files, { fetch: get = fetch, progress, bytes = /* @__PURE__ */ __name(() => {
|
|
183
|
+
}, "bytes"), verifyExisting } = {}) => {
|
|
184
|
+
if (verifyExisting)
|
|
185
|
+
for (const [file, path] of files) {
|
|
186
|
+
if (sizeOf(path) !== void 0) {
|
|
187
|
+
const hash = createHash("sha256");
|
|
188
|
+
for await (const chunk of createReadStream(path))
|
|
189
|
+
hash.update(chunk);
|
|
190
|
+
if (hash.digest("hex") !== file.sha256) {
|
|
191
|
+
progress?.(`${path}: not the file this version expects, downloading it again`);
|
|
192
|
+
await rm(path, { force: true });
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
const total = files.reduce((sum, [file]) => sum + file.bytes, 0);
|
|
197
|
+
const missing = files.filter(([file, path]) => sizeOf(path) !== file.bytes);
|
|
198
|
+
let done = total - missing.reduce((sum, [file]) => sum + file.bytes, 0);
|
|
199
|
+
bytes(done, total);
|
|
200
|
+
for (const [file, path] of missing) {
|
|
201
|
+
mkdirSync(dirname(path), { recursive: true, mode: 448 });
|
|
202
|
+
progress?.(`downloading ${file.name} (${megabytes(file.bytes)})`);
|
|
203
|
+
const before = done;
|
|
204
|
+
await fetchVerified(file, path, get, (received) => {
|
|
205
|
+
done = before + received;
|
|
206
|
+
bytes(done, total);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}, "installFiles");
|
|
210
|
+
var fetchVerified = /* @__PURE__ */ __name(async (file, path, get, received) => {
|
|
211
|
+
const stalled = watchdog(STALL_MS);
|
|
212
|
+
try {
|
|
213
|
+
await fetchInto(file, path, get, stalled, received);
|
|
214
|
+
} catch (error) {
|
|
215
|
+
if (stalled.signal.aborted) {
|
|
216
|
+
throw new CliError("timeout", `${file.name} stopped downloading for ${STALL_MS / 1e3} s \u2014 nothing was installed`);
|
|
217
|
+
}
|
|
218
|
+
throw error;
|
|
219
|
+
} finally {
|
|
220
|
+
stalled.stop();
|
|
221
|
+
}
|
|
222
|
+
}, "fetchVerified");
|
|
223
|
+
var fetchInto = /* @__PURE__ */ __name(async (file, path, get, stalled, received) => {
|
|
224
|
+
const response = await get(file.url, { signal: stalled.signal });
|
|
225
|
+
if (!response.ok || !response.body) {
|
|
226
|
+
await response.body?.cancel();
|
|
227
|
+
throw new CliError("network_error", `${file.name} could not be downloaded: HTTP ${response.status}`);
|
|
228
|
+
}
|
|
229
|
+
const partial = `${path}.${randomUUID()}.part`;
|
|
230
|
+
const hash = createHash("sha256");
|
|
231
|
+
let bytes = 0;
|
|
232
|
+
const hashing = new Transform({
|
|
233
|
+
transform(chunk, _encoding, done) {
|
|
234
|
+
stalled.poke();
|
|
235
|
+
bytes += chunk.length;
|
|
236
|
+
if (bytes > file.bytes) {
|
|
237
|
+
done(new CliError("invalid_response", `${file.name} is larger than this version expects \u2014 nothing was installed`));
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
hash.update(chunk);
|
|
241
|
+
received(bytes);
|
|
242
|
+
done(null, chunk);
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
try {
|
|
246
|
+
await pipeline(Readable.fromWeb(response.body), hashing, createWriteStream(partial, { flags: "wx", mode: 384 }));
|
|
247
|
+
const actual = hash.digest("hex");
|
|
248
|
+
if (actual !== file.sha256) {
|
|
249
|
+
throw new CliError("invalid_response", `${file.name} is not the file this version expects (sha256 ${actual}) \u2014 nothing was installed`);
|
|
250
|
+
}
|
|
251
|
+
await rename(partial, path);
|
|
252
|
+
} finally {
|
|
253
|
+
await rm(partial, { force: true });
|
|
254
|
+
}
|
|
255
|
+
}, "fetchInto");
|
|
256
|
+
var megabytes = /* @__PURE__ */ __name((bytes) => bytes < 1e6 ? "under 1 MB" : `${Math.round(bytes / 1e6)} MB`, "megabytes");
|
|
257
|
+
|
|
258
|
+
export {
|
|
259
|
+
OPENAI_TRANSCRIBE_MODEL,
|
|
260
|
+
VAD,
|
|
261
|
+
DEFAULT_ORDER,
|
|
262
|
+
orderedModels,
|
|
263
|
+
speechModel,
|
|
264
|
+
sharedModelsDirectory,
|
|
265
|
+
modelsDirectory,
|
|
266
|
+
modelPath,
|
|
267
|
+
vadPath,
|
|
268
|
+
isInstalled,
|
|
269
|
+
filesPresent,
|
|
270
|
+
installedBytes,
|
|
271
|
+
install,
|
|
272
|
+
installFiles,
|
|
273
|
+
megabytes
|
|
274
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
10
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
11
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
12
|
+
}) : x)(function(x) {
|
|
13
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
14
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
15
|
+
});
|
|
16
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
17
|
+
try {
|
|
18
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
19
|
+
} catch (e) {
|
|
20
|
+
throw mod = 0, e;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var __export = (target, all) => {
|
|
24
|
+
for (var name in all)
|
|
25
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
26
|
+
};
|
|
27
|
+
var __copyProps = (to, from, except, desc) => {
|
|
28
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
29
|
+
for (let key of __getOwnPropNames(from))
|
|
30
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
31
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
32
|
+
}
|
|
33
|
+
return to;
|
|
34
|
+
};
|
|
35
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
36
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
37
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
38
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
39
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
40
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
41
|
+
mod
|
|
42
|
+
));
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
__name,
|
|
46
|
+
__require,
|
|
47
|
+
__commonJS,
|
|
48
|
+
__export,
|
|
49
|
+
__toESM
|
|
50
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
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-O6CVJGGL.js";
|
|
10
|
+
import "./chunk-WBEZZGZE.js";
|
|
11
|
+
import "./chunk-2343HKEW.js";
|
|
12
|
+
import "./chunk-JKCXDIGC.js";
|
|
13
|
+
import "./chunk-ARRQVUJ2.js";
|
|
14
|
+
import "./chunk-V2R2BJJU.js";
|
|
15
|
+
import "./chunk-TWCVCW5T.js";
|
|
16
|
+
import "./chunk-RK4GN2II.js";
|
|
17
|
+
import "./chunk-5WAGTWCS.js";
|
|
18
|
+
import "./chunk-FJV3MO57.js";
|
|
19
|
+
import "./chunk-SP6DPFZ4.js";
|
|
20
|
+
import "./chunk-XHIVZPQ2.js";
|
|
21
|
+
import "./chunk-5ETXE5KF.js";
|
|
22
|
+
import "./chunk-SBRFKB77.js";
|
|
23
|
+
import "./chunk-ZPSH27BB.js";
|
|
24
|
+
import "./chunk-VJ4CPL6F.js";
|
|
25
|
+
import "./chunk-XTQIXZVM.js";
|
|
26
|
+
import "./chunk-MZNRIH3T.js";
|
|
27
|
+
import "./chunk-S4UUN6LD.js";
|
|
28
|
+
import "./chunk-Y5E2WNWB.js";
|
|
29
|
+
import "./chunk-5DCRHSBI.js";
|
|
30
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
31
|
+
export {
|
|
32
|
+
SCHEMA_DIALECT,
|
|
33
|
+
commandContract,
|
|
34
|
+
commandPathOf,
|
|
35
|
+
findCommand,
|
|
36
|
+
outputOf
|
|
37
|
+
};
|