@wirecat/zoom-cli 0.56.0 → 0.58.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 +1 -1
- package/dist/bin/zm.js +35 -5
- package/dist/bundle/all-profiles-RS5IWIGR.js +25 -0
- package/dist/bundle/answer-policy-R7VZMCGE.js +96 -0
- package/dist/bundle/anthropic-5QHQR4WF.js +70 -0
- package/dist/bundle/app-server-7LANSZGE.js +232 -0
- package/dist/bundle/bun-O6RL6LRQ.js +169 -0
- package/dist/bundle/bun-sqlite-PEJM6CS4.js +69 -0
- package/dist/bundle/chunk-24DLFGES.js +97 -0
- package/dist/bundle/chunk-27P22POE.js +1109 -0
- package/dist/bundle/chunk-3SCTDFNO.js +3398 -0
- package/dist/bundle/chunk-3SERIWJD.js +36139 -0
- package/dist/bundle/chunk-4AURKUDZ.js +60 -0
- package/dist/bundle/chunk-4NGLRHWO.js +24 -0
- package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
- package/dist/bundle/chunk-5DVW77VC.js +789 -0
- package/dist/bundle/chunk-6CYLVFXM.js +9 -0
- package/dist/bundle/chunk-6FL25KC5.js +264 -0
- package/dist/bundle/chunk-7D2CD3E3.js +193 -0
- package/dist/bundle/chunk-7GVNQOV6.js +17 -0
- package/dist/bundle/chunk-7H3ZRDLW.js +630 -0
- package/dist/bundle/chunk-7Z4ANTAK.js +1095 -0
- package/dist/bundle/chunk-A6323R5P.js +22 -0
- package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
- package/dist/bundle/chunk-AIXLOMH4.js +63 -0
- package/dist/bundle/chunk-AQDWGJZT.js +188 -0
- package/dist/bundle/chunk-B32SF7J3.js +18 -0
- package/dist/bundle/chunk-BAQLQIMI.js +1938 -0
- package/dist/bundle/chunk-BGILD4CI.js +1109 -0
- package/dist/bundle/chunk-BXZ6WSVF.js +100 -0
- package/dist/bundle/chunk-CTGI4ES2.js +138 -0
- package/dist/bundle/chunk-CVIKKIGE.js +76 -0
- package/dist/bundle/chunk-DDYR6DYL.js +78 -0
- package/dist/bundle/chunk-DFDN6AUB.js +21 -0
- package/dist/bundle/chunk-DP5DX45H.js +151 -0
- package/dist/bundle/chunk-DXKVEOSS.js +53 -0
- package/dist/bundle/chunk-DXZTLB24.js +120 -0
- package/dist/bundle/chunk-G27MRA24.js +82 -0
- package/dist/bundle/chunk-HTQTIKWP.js +928 -0
- package/dist/bundle/chunk-IYAGQXED.js +433 -0
- package/dist/bundle/chunk-K76WFW4I.js +124 -0
- package/dist/bundle/chunk-KVHRHBLY.js +884 -0
- package/dist/bundle/chunk-L2UIJDWB.js +31 -0
- package/dist/bundle/chunk-L3VS3H34.js +482 -0
- package/dist/bundle/chunk-MBT7GP7K.js +1970 -0
- package/dist/bundle/chunk-MFS52LTZ.js +570 -0
- package/dist/bundle/chunk-MMT46EN4.js +29 -0
- package/dist/bundle/chunk-MNUTWGSA.js +6094 -0
- package/dist/bundle/chunk-N7GAQ27N.js +82 -0
- package/dist/bundle/chunk-NDXAZB5Z.js +409 -0
- package/dist/bundle/chunk-NOKFJJPA.js +1028 -0
- package/dist/bundle/chunk-NW7IMGRR.js +6848 -0
- package/dist/bundle/chunk-O5EHUB2V.js +2 -0
- package/dist/bundle/chunk-OBZWUNO4.js +160 -0
- package/dist/bundle/chunk-PACC5N6T.js +240 -0
- package/dist/bundle/chunk-PF25S7L4.js +422 -0
- package/dist/bundle/chunk-PKTFZAXG.js +48 -0
- package/dist/bundle/chunk-PNBEREOU.js +35626 -0
- package/dist/bundle/chunk-POOGFSRA.js +385 -0
- package/dist/bundle/chunk-PP3JGQQE.js +3517 -0
- package/dist/bundle/chunk-Q2Z3VCM4.js +2 -0
- package/dist/bundle/chunk-QCFHL4ES.js +45 -0
- package/dist/bundle/chunk-QFGBMS67.js +492 -0
- package/dist/bundle/chunk-RUP467ZX.js +948 -0
- package/dist/bundle/chunk-RXDIG23Z.js +166 -0
- package/dist/bundle/chunk-SIA7HJE2.js +8192 -0
- package/dist/bundle/chunk-SL3SXQZ5.js +100 -0
- package/dist/bundle/chunk-SV5L36WK.js +19 -0
- package/dist/bundle/chunk-T6AAM7UT.js +846 -0
- package/dist/bundle/chunk-U6QW67SU.js +18673 -0
- package/dist/bundle/chunk-UKR7KH3H.js +288 -0
- package/dist/bundle/chunk-UOFOMU3T.js +836 -0
- package/dist/bundle/chunk-URO44C5T.js +3570 -0
- package/dist/bundle/chunk-UXM7I35J.js +281 -0
- package/dist/bundle/chunk-UYJUTZTT.js +73 -0
- package/dist/bundle/chunk-VOAVOK4I.js +1146 -0
- package/dist/bundle/chunk-VSUY7PDW.js +192 -0
- package/dist/bundle/chunk-VYUSEJE4.js +98 -0
- package/dist/bundle/chunk-XFCSPOLZ.js +25 -0
- package/dist/bundle/chunk-XT7XVPEM.js +538 -0
- package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
- package/dist/bundle/chunk-YIFIY7ZE.js +58 -0
- package/dist/bundle/chunk-YIMI6O7R.js +5292 -0
- package/dist/bundle/chunk-YJRMMZI5.js +275 -0
- package/dist/bundle/chunk-YSHSCBPM.js +2315 -0
- package/dist/bundle/chunk-ZC5UXEIH.js +215 -0
- package/dist/bundle/chunk-ZHXIXDH5.js +161 -0
- package/dist/bundle/chunk-ZTOAAYFV.js +122 -0
- package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
- package/dist/bundle/cli-IQTASP44.js +831 -0
- package/dist/bundle/command-contract-WHZPF7NA.js +38 -0
- package/dist/bundle/config-IP5SGHKN.js +79 -0
- package/dist/bundle/dist-WT73DF46.js +136 -0
- package/dist/bundle/dist-XUFQCJXW.js +7577 -0
- package/dist/bundle/echarts-LD3AI55P.js +42501 -0
- package/dist/bundle/embed-XEMH4LNX.js +35 -0
- package/dist/bundle/embedder-ZCYKSKAE.js +108 -0
- package/dist/bundle/first-run-LGYDLIUM.js +23 -0
- package/dist/bundle/first-screen-LYQKPNF4.js +36 -0
- package/dist/bundle/folders-5ZBUQHAM.js +13 -0
- package/dist/bundle/instructions-RZMSW3OC.js +11 -0
- package/dist/bundle/main-NKY3JGXY.js +130 -0
- package/dist/bundle/mcp-7OXUHLTO.js +189 -0
- package/dist/bundle/mcp-OQBZXELQ.js +165 -0
- package/dist/bundle/mcp-VISEXTVC.js +92 -0
- package/dist/bundle/meetings-XPBHVZAU.js +215 -0
- package/dist/bundle/node-P4E63KXA.js +2340 -0
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/node-ZRLYQL7J.js +176 -0
- package/dist/bundle/node-sqlite-BBEDYBWO.js +45 -0
- package/dist/bundle/oauth-UHVRGKZU.js +17 -0
- package/dist/bundle/open-J4FCAUAJ.js +19 -0
- package/dist/bundle/output-file-SXV2ANW7.js +63 -0
- package/dist/bundle/process-LL77573L.js +91 -0
- package/dist/bundle/program-EPMIJCGA.js +5845 -0
- package/dist/bundle/prompt-LUUMQTMY.js +12 -0
- package/dist/bundle/recognize-EMHQX4XF.js +190 -0
- package/dist/bundle/remote-ZXS6D7VB.js +26 -0
- package/dist/bundle/rerank-WP7RKZNB.js +49 -0
- package/dist/bundle/run-log-GS2L66G6.js +111 -0
- package/dist/bundle/serve-L6KLLXK2.js +19 -0
- package/dist/bundle/server-NOFYENP5.js +53 -0
- package/dist/bundle/server-P5TXAPBY.js +66 -0
- package/dist/bundle/services-SPOEWVK3.js +330 -0
- package/dist/bundle/speech-6OBAKMND.js +44 -0
- package/dist/bundle/state-HN5EJKXQ.js +33 -0
- package/dist/bundle/store-LEU3M6IN.js +124 -0
- package/dist/bundle/store-ZP2URKET.js +141 -0
- package/dist/bundle/store-connection-I53XZ2TS.js +76 -0
- package/dist/bundle/store-maintenance-command-PSCHEHHY.js +54 -0
- package/dist/bundle/streaming-AK6Q2ZGQ.js +15 -0
- package/dist/bundle/tokens-CCM3D4ZT.js +17 -0
- package/dist/bundle/zm.js +8 -0
- package/dist/contract-overrides.d.ts.map +1 -1
- package/dist/contract-overrides.js +29 -17
- package/dist/contract-overrides.js.map +1 -1
- package/dist/mcp-command.d.ts +3 -2
- package/dist/mcp-command.d.ts.map +1 -1
- package/dist/mcp-command.js +62 -10
- package/dist/mcp-command.js.map +1 -1
- package/dist/program-bindings.d.ts.map +1 -1
- package/dist/program-bindings.js +1 -0
- package/dist/program-bindings.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +7 -5
- package/skills/zoom-cli/SKILL.md +2 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
envName,
|
|
5
|
+
readOnlyLockOf
|
|
6
|
+
} from "./chunk-XFCSPOLZ.js";
|
|
7
|
+
import {
|
|
8
|
+
CAPABILITY_STATEMENTS,
|
|
9
|
+
storeCapable
|
|
10
|
+
} from "./chunk-SL3SXQZ5.js";
|
|
11
|
+
import {
|
|
12
|
+
CliError,
|
|
13
|
+
catchCrashes
|
|
14
|
+
} from "./chunk-YIMI6O7R.js";
|
|
15
|
+
import {
|
|
16
|
+
importFrom
|
|
17
|
+
} from "./chunk-Y5E2WNWB.js";
|
|
18
|
+
import {
|
|
19
|
+
__name
|
|
20
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
21
|
+
|
|
22
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/cli/entry.js
|
|
23
|
+
import { spawn as spawn2 } from "node:child_process";
|
|
24
|
+
|
|
25
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/sqlite-runtime.js
|
|
26
|
+
import { spawn, spawnSync } from "node:child_process";
|
|
27
|
+
import { readFileSync } from "node:fs";
|
|
28
|
+
import { dirname } from "node:path";
|
|
29
|
+
var RESTARTED = "CLI_MESSAGING_SQLITE_RESTARTED";
|
|
30
|
+
var USER_LIBRARY_PATH = "CLI_MESSAGING_USER_LD_LIBRARY_PATH";
|
|
31
|
+
var FORWARDED = ["SIGTERM", "SIGHUP", "SIGQUIT"];
|
|
32
|
+
var ensureSqlite = /* @__PURE__ */ __name(async (runtime = nodeRuntime()) => {
|
|
33
|
+
const { env } = runtime;
|
|
34
|
+
if (env[RESTARTED]) {
|
|
35
|
+
if (env[USER_LIBRARY_PATH] === void 0)
|
|
36
|
+
delete env.LD_LIBRARY_PATH;
|
|
37
|
+
else
|
|
38
|
+
env.LD_LIBRARY_PATH = env[USER_LIBRARY_PATH];
|
|
39
|
+
delete env[USER_LIBRARY_PATH];
|
|
40
|
+
delete env[RESTARTED];
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (runtime.bun || runtime.platform !== "linux")
|
|
44
|
+
return;
|
|
45
|
+
const maps = runtime.maps();
|
|
46
|
+
if (!maps.includes("libsqlite3"))
|
|
47
|
+
return;
|
|
48
|
+
if (await runtime.capable())
|
|
49
|
+
return;
|
|
50
|
+
const library = await runtime.library(maps.includes("ld-musl"));
|
|
51
|
+
if (!library)
|
|
52
|
+
return;
|
|
53
|
+
const restarted = {
|
|
54
|
+
...env,
|
|
55
|
+
LD_LIBRARY_PATH: [dirname(library.path), env.LD_LIBRARY_PATH].filter(Boolean).join(":"),
|
|
56
|
+
[RESTARTED]: "1"
|
|
57
|
+
};
|
|
58
|
+
if (env.LD_LIBRARY_PATH !== void 0)
|
|
59
|
+
restarted[USER_LIBRARY_PATH] = env.LD_LIBRARY_PATH;
|
|
60
|
+
if (!runtime.works(restarted, library.version))
|
|
61
|
+
return;
|
|
62
|
+
await runtime.restart(restarted);
|
|
63
|
+
}, "ensureSqlite");
|
|
64
|
+
var trialScript = /* @__PURE__ */ __name((version) => `
|
|
65
|
+
const { DatabaseSync } = await import("node:sqlite")
|
|
66
|
+
const database = new DatabaseSync(":memory:")
|
|
67
|
+
if (database.prepare("SELECT sqlite_version() AS v").get().v !== ${JSON.stringify(version)}) process.exit(1)
|
|
68
|
+
for (const statement of ${JSON.stringify(CAPABILITY_STATEMENTS)}) database.exec(statement)
|
|
69
|
+
`, "trialScript");
|
|
70
|
+
var nodeRuntime = /* @__PURE__ */ __name(() => ({
|
|
71
|
+
env: process.env,
|
|
72
|
+
platform: process.platform,
|
|
73
|
+
bun: "Bun" in globalThis,
|
|
74
|
+
maps: /* @__PURE__ */ __name(() => {
|
|
75
|
+
try {
|
|
76
|
+
return readFileSync("/proc/self/maps", "utf8");
|
|
77
|
+
} catch {
|
|
78
|
+
return "";
|
|
79
|
+
}
|
|
80
|
+
}, "maps"),
|
|
81
|
+
capable: /* @__PURE__ */ __name(() => storeCapable().then(() => true, () => false), "capable"),
|
|
82
|
+
library: /* @__PURE__ */ __name(async (musl) => {
|
|
83
|
+
try {
|
|
84
|
+
const { libraryFor, SQLITE_VERSION } = await importFrom(new URL("sqlite-runtime.js", import.meta.resolve("@wirecat/cli-core")).href, "@wirecat/cli-core-sqlite");
|
|
85
|
+
const path = libraryFor({ musl });
|
|
86
|
+
return path === void 0 ? void 0 : { path, version: SQLITE_VERSION };
|
|
87
|
+
} catch {
|
|
88
|
+
return void 0;
|
|
89
|
+
}
|
|
90
|
+
}, "library"),
|
|
91
|
+
works: /* @__PURE__ */ __name((env, version) => spawnSync(process.execPath, ["--no-warnings", "--input-type=module", "-e", trialScript(version)], {
|
|
92
|
+
env,
|
|
93
|
+
stdio: "ignore",
|
|
94
|
+
timeout: 1e4
|
|
95
|
+
}).status === 0, "works"),
|
|
96
|
+
restart: /* @__PURE__ */ __name((env) => relay(spawn(process.execPath, [...process.execArgv, ...process.argv.slice(1)], { env, stdio: "inherit" })), "restart")
|
|
97
|
+
}), "nodeRuntime");
|
|
98
|
+
var relay = /* @__PURE__ */ __name((child, host = process) => new Promise(() => {
|
|
99
|
+
for (const signal of FORWARDED)
|
|
100
|
+
host.on(signal, () => child.kill(signal));
|
|
101
|
+
host.on("SIGINT", () => {
|
|
102
|
+
});
|
|
103
|
+
child.on("error", () => host.exit(1));
|
|
104
|
+
child.on("exit", (code, signal) => {
|
|
105
|
+
if (signal) {
|
|
106
|
+
host.removeAllListeners(signal);
|
|
107
|
+
host.kill(host.pid, signal);
|
|
108
|
+
} else
|
|
109
|
+
host.exit(code ?? 1);
|
|
110
|
+
});
|
|
111
|
+
}), "relay");
|
|
112
|
+
|
|
113
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/cli/argv-log.js
|
|
114
|
+
import { appendFileSync } from "node:fs";
|
|
115
|
+
var logParsedArgv = /* @__PURE__ */ __name((file, action) => {
|
|
116
|
+
const words = [];
|
|
117
|
+
const options = [];
|
|
118
|
+
for (let at = action; at; at = at.parent) {
|
|
119
|
+
if (at.parent)
|
|
120
|
+
words.unshift(at.name());
|
|
121
|
+
for (const option of at.options) {
|
|
122
|
+
const key = option.attributeName();
|
|
123
|
+
if (at.getOptionValueSource(key) !== "cli" || !option.long)
|
|
124
|
+
continue;
|
|
125
|
+
if (option.negate === (at.getOptionValue(key) === false))
|
|
126
|
+
options.push(option.long);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
appendFileSync(file, `${JSON.stringify({ command: words.join(" "), options })}
|
|
130
|
+
`);
|
|
131
|
+
}, "logParsedArgv");
|
|
132
|
+
var logVersion = /* @__PURE__ */ __name((file) => {
|
|
133
|
+
appendFileSync(file, `${JSON.stringify({ command: "", options: ["--version"] })}
|
|
134
|
+
`);
|
|
135
|
+
}, "logVersion");
|
|
136
|
+
|
|
137
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/cli/entry.js
|
|
138
|
+
var processIo = /* @__PURE__ */ __name(() => ({
|
|
139
|
+
argv: process.argv,
|
|
140
|
+
env: process.env,
|
|
141
|
+
platform: process.platform,
|
|
142
|
+
stdin: process.stdin,
|
|
143
|
+
stdout: process.stdout,
|
|
144
|
+
stderr: process.stderr,
|
|
145
|
+
signals: process,
|
|
146
|
+
setExitCode: /* @__PURE__ */ __name((code) => {
|
|
147
|
+
process.exitCode = code;
|
|
148
|
+
}, "setExitCode"),
|
|
149
|
+
spawn: spawn2
|
|
150
|
+
}), "processIo");
|
|
151
|
+
var startCli = /* @__PURE__ */ __name(async (entry) => {
|
|
152
|
+
const io = { ...processIo(), ...entry.io };
|
|
153
|
+
const args = io.argv.slice(2);
|
|
154
|
+
if (args.length === 1 && (args[0] === "--version" || args[0] === "-V"))
|
|
155
|
+
return printVersion(entry.app, io);
|
|
156
|
+
const tty = io.stdout.isTTY === true;
|
|
157
|
+
const release = catchCrashes({
|
|
158
|
+
cli: entry.app.command,
|
|
159
|
+
interactive: entry.interactive?.(args, tty) ?? tty,
|
|
160
|
+
...entry.reasons ? { reasons: entry.reasons } : {},
|
|
161
|
+
target: io.signals
|
|
162
|
+
});
|
|
163
|
+
const controller = new AbortController();
|
|
164
|
+
let closed = false;
|
|
165
|
+
let unwritable = false;
|
|
166
|
+
const interrupted = /* @__PURE__ */ __name((signal) => () => controller.abort(new CliError("cancelled", `command interrupted by ${signal}`, { reason: signal, retryable: false })), "interrupted");
|
|
167
|
+
const sigint = interrupted("SIGINT");
|
|
168
|
+
const sigterm = interrupted("SIGTERM");
|
|
169
|
+
const outputFailed = /* @__PURE__ */ __name((error) => {
|
|
170
|
+
if (error.code === "EPIPE") {
|
|
171
|
+
closed = true;
|
|
172
|
+
controller.abort(new CliError("cancelled", "output pipe closed", { retryable: false }));
|
|
173
|
+
} else {
|
|
174
|
+
unwritable = true;
|
|
175
|
+
controller.abort(new CliError("configuration_error", "could not write command output"));
|
|
176
|
+
}
|
|
177
|
+
}, "outputFailed");
|
|
178
|
+
const headless = /* @__PURE__ */ __name((command) => {
|
|
179
|
+
const flags = command?.optsWithGlobals() ?? {};
|
|
180
|
+
return Boolean(flags.json || flags.jsonl || flags.input === false || io.env.CI) || !tty;
|
|
181
|
+
}, "headless");
|
|
182
|
+
const context = {
|
|
183
|
+
args,
|
|
184
|
+
env: io.env,
|
|
185
|
+
tty,
|
|
186
|
+
signal: controller.signal,
|
|
187
|
+
atStart: /* @__PURE__ */ __name(async (command) => {
|
|
188
|
+
if (command.optsWithGlobals().dryRun === true)
|
|
189
|
+
return;
|
|
190
|
+
const [{ setupAtStart }, { commandPathOf }] = await Promise.all([
|
|
191
|
+
import("./first-run-LGYDLIUM.js"),
|
|
192
|
+
import("./command-contract-WHZPF7NA.js")
|
|
193
|
+
]);
|
|
194
|
+
await setupAtStart({
|
|
195
|
+
command: entry.app.command,
|
|
196
|
+
env: io.env,
|
|
197
|
+
contentLanguages: entry.app.contentLanguages,
|
|
198
|
+
path: commandPathOf(command),
|
|
199
|
+
headless: headless(command),
|
|
200
|
+
readOnlyLock: readOnlyLockOf(entry.app, io.env),
|
|
201
|
+
input: io.stdin
|
|
202
|
+
});
|
|
203
|
+
}, "atStart"),
|
|
204
|
+
ask: /* @__PURE__ */ __name(async (question, command) => {
|
|
205
|
+
if (headless(command) || io.stdin.isTTY !== true)
|
|
206
|
+
return false;
|
|
207
|
+
const { readSecret } = await import("./prompt-LUUMQTMY.js");
|
|
208
|
+
const answer = await readSecret(`${question} [y/N] `, {
|
|
209
|
+
input: io.stdin,
|
|
210
|
+
output: io.stderr,
|
|
211
|
+
echo: true,
|
|
212
|
+
signal: controller.signal
|
|
213
|
+
});
|
|
214
|
+
return /^(y|yes)$/i.test(answer.trim());
|
|
215
|
+
}, "ask"),
|
|
216
|
+
openBrowser: /* @__PURE__ */ __name((url, browser) => openBrowser(io, url, browser), "openBrowser"),
|
|
217
|
+
outputClosed: /* @__PURE__ */ __name(() => closed, "outputClosed")
|
|
218
|
+
};
|
|
219
|
+
let code;
|
|
220
|
+
try {
|
|
221
|
+
if (entry.sqlite)
|
|
222
|
+
await ensureSqlite();
|
|
223
|
+
io.signals.on("SIGINT", sigint).on("SIGTERM", sigterm);
|
|
224
|
+
io.stdout.on("error", outputFailed);
|
|
225
|
+
io.stderr.on("error", outputFailed);
|
|
226
|
+
const returned = await entry.run(context);
|
|
227
|
+
if (typeof returned === "number")
|
|
228
|
+
code = returned;
|
|
229
|
+
} catch (error) {
|
|
230
|
+
code = commanderExit(error) ?? entry.fail(error, context);
|
|
231
|
+
} finally {
|
|
232
|
+
io.signals.off("SIGINT", sigint).off("SIGTERM", sigterm);
|
|
233
|
+
release();
|
|
234
|
+
}
|
|
235
|
+
if (closed)
|
|
236
|
+
io.setExitCode(0);
|
|
237
|
+
else if (unwritable)
|
|
238
|
+
io.setExitCode(3);
|
|
239
|
+
else if (code !== void 0)
|
|
240
|
+
io.setExitCode(code);
|
|
241
|
+
}, "startCli");
|
|
242
|
+
var printVersion = /* @__PURE__ */ __name((app, io) => {
|
|
243
|
+
const argvLog = io.env[envName(app, "TEST_ARGV_LOG")];
|
|
244
|
+
if (argvLog)
|
|
245
|
+
logVersion(argvLog);
|
|
246
|
+
io.stdout.write(`${app.version}
|
|
247
|
+
`);
|
|
248
|
+
}, "printVersion");
|
|
249
|
+
var commanderExit = /* @__PURE__ */ __name((error) => {
|
|
250
|
+
if (!(error instanceof Error))
|
|
251
|
+
return void 0;
|
|
252
|
+
const { code, exitCode } = error;
|
|
253
|
+
if (typeof code !== "string" || !code.startsWith("commander.") || typeof exitCode !== "number")
|
|
254
|
+
return void 0;
|
|
255
|
+
if (exitCode === 0)
|
|
256
|
+
return 0;
|
|
257
|
+
return code === "commander.help" ? 2 : void 0;
|
|
258
|
+
}, "commanderExit");
|
|
259
|
+
var openBrowser = /* @__PURE__ */ __name((io, url, browser) => {
|
|
260
|
+
const [command, prefix] = browser !== void 0 ? [browser, []] : io.platform === "darwin" ? ["open", []] : io.platform === "win32" ? ["rundll32.exe", ["url.dll,FileProtocolHandler"]] : ["xdg-open", []];
|
|
261
|
+
return new Promise((resolve, reject) => {
|
|
262
|
+
const child = io.spawn(command, [...prefix, url], { detached: true, stdio: "ignore", windowsHide: true });
|
|
263
|
+
child.once("error", () => reject(new CliError("configuration_error", `could not start ${command} \u2014 open the printed URL in a browser`)));
|
|
264
|
+
child.once("spawn", () => {
|
|
265
|
+
child.unref();
|
|
266
|
+
resolve();
|
|
267
|
+
});
|
|
268
|
+
});
|
|
269
|
+
}, "openBrowser");
|
|
270
|
+
|
|
271
|
+
export {
|
|
272
|
+
logParsedArgv,
|
|
273
|
+
logVersion,
|
|
274
|
+
startCli
|
|
275
|
+
};
|