komodo-cli 2.0.5 → 2.0.6

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.
@@ -1,2150 +1,50 @@
1
- import {
2
- __commonJS,
3
- __export,
4
- __require,
5
- __toESM
6
- } from "./chunk-4VNS5WPM.js";
7
-
8
- // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
9
- var require_windows = __commonJS({
10
- "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module) {
11
- "use strict";
12
- module.exports = isexe;
13
- isexe.sync = sync;
14
- var fs = __require("fs");
15
- function checkPathExt(path3, options) {
16
- var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
17
- if (!pathext) {
18
- return true;
19
- }
20
- pathext = pathext.split(";");
21
- if (pathext.indexOf("") !== -1) {
22
- return true;
23
- }
24
- for (var i = 0; i < pathext.length; i++) {
25
- var p = pathext[i].toLowerCase();
26
- if (p && path3.substr(-p.length).toLowerCase() === p) {
27
- return true;
28
- }
29
- }
30
- return false;
31
- }
32
- function checkStat(stat, path3, options) {
33
- if (!stat.isSymbolicLink() && !stat.isFile()) {
34
- return false;
35
- }
36
- return checkPathExt(path3, options);
37
- }
38
- function isexe(path3, options, cb) {
39
- fs.stat(path3, function(er, stat) {
40
- cb(er, er ? false : checkStat(stat, path3, options));
41
- });
42
- }
43
- function sync(path3, options) {
44
- return checkStat(fs.statSync(path3), path3, options);
45
- }
46
- }
47
- });
48
-
49
- // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js
50
- var require_mode = __commonJS({
51
- "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports, module) {
52
- "use strict";
53
- module.exports = isexe;
54
- isexe.sync = sync;
55
- var fs = __require("fs");
56
- function isexe(path3, options, cb) {
57
- fs.stat(path3, function(er, stat) {
58
- cb(er, er ? false : checkStat(stat, options));
59
- });
60
- }
61
- function sync(path3, options) {
62
- return checkStat(fs.statSync(path3), options);
63
- }
64
- function checkStat(stat, options) {
65
- return stat.isFile() && checkMode(stat, options);
66
- }
67
- function checkMode(stat, options) {
68
- var mod = stat.mode;
69
- var uid = stat.uid;
70
- var gid = stat.gid;
71
- var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
72
- var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
73
- var u = parseInt("100", 8);
74
- var g = parseInt("010", 8);
75
- var o = parseInt("001", 8);
76
- var ug = u | g;
77
- var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
78
- return ret;
79
- }
80
- }
81
- });
82
-
83
- // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
84
- var require_isexe = __commonJS({
85
- "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module) {
86
- "use strict";
87
- var fs = __require("fs");
88
- var core;
89
- if (process.platform === "win32" || global.TESTING_WINDOWS) {
90
- core = require_windows();
91
- } else {
92
- core = require_mode();
93
- }
94
- module.exports = isexe;
95
- isexe.sync = sync;
96
- function isexe(path3, options, cb) {
97
- if (typeof options === "function") {
98
- cb = options;
99
- options = {};
100
- }
101
- if (!cb) {
102
- if (typeof Promise !== "function") {
103
- throw new TypeError("callback not provided");
104
- }
105
- return new Promise(function(resolve2, reject) {
106
- isexe(path3, options || {}, function(er, is) {
107
- if (er) {
108
- reject(er);
109
- } else {
110
- resolve2(is);
111
- }
112
- });
113
- });
114
- }
115
- core(path3, options || {}, function(er, is) {
116
- if (er) {
117
- if (er.code === "EACCES" || options && options.ignoreErrors) {
118
- er = null;
119
- is = false;
120
- }
121
- }
122
- cb(er, is);
123
- });
124
- }
125
- function sync(path3, options) {
126
- try {
127
- return core.sync(path3, options || {});
128
- } catch (er) {
129
- if (options && options.ignoreErrors || er.code === "EACCES") {
130
- return false;
131
- } else {
132
- throw er;
133
- }
134
- }
135
- }
136
- }
137
- });
138
-
139
- // ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
140
- var require_which = __commonJS({
141
- "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module) {
142
- "use strict";
143
- var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
144
- var path3 = __require("path");
145
- var COLON = isWindows ? ";" : ":";
146
- var isexe = require_isexe();
147
- var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
148
- var getPathInfo = (cmd, opt) => {
149
- const colon = opt.colon || COLON;
150
- const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
151
- // windows always checks the cwd first
152
- ...isWindows ? [process.cwd()] : [],
153
- ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
154
- "").split(colon)
155
- ];
156
- const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
157
- const pathExt = isWindows ? pathExtExe.split(colon) : [""];
158
- if (isWindows) {
159
- if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
160
- pathExt.unshift("");
161
- }
162
- return {
163
- pathEnv,
164
- pathExt,
165
- pathExtExe
166
- };
167
- };
168
- var which = (cmd, opt, cb) => {
169
- if (typeof opt === "function") {
170
- cb = opt;
171
- opt = {};
172
- }
173
- if (!opt)
174
- opt = {};
175
- const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
176
- const found = [];
177
- const step = (i) => new Promise((resolve2, reject) => {
178
- if (i === pathEnv.length)
179
- return opt.all && found.length ? resolve2(found) : reject(getNotFoundError(cmd));
180
- const ppRaw = pathEnv[i];
181
- const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
182
- const pCmd = path3.join(pathPart, cmd);
183
- const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
184
- resolve2(subStep(p, i, 0));
185
- });
186
- const subStep = (p, i, ii) => new Promise((resolve2, reject) => {
187
- if (ii === pathExt.length)
188
- return resolve2(step(i + 1));
189
- const ext = pathExt[ii];
190
- isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
191
- if (!er && is) {
192
- if (opt.all)
193
- found.push(p + ext);
194
- else
195
- return resolve2(p + ext);
196
- }
197
- return resolve2(subStep(p, i, ii + 1));
198
- });
199
- });
200
- return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
201
- };
202
- var whichSync = (cmd, opt) => {
203
- opt = opt || {};
204
- const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
205
- const found = [];
206
- for (let i = 0; i < pathEnv.length; i++) {
207
- const ppRaw = pathEnv[i];
208
- const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
209
- const pCmd = path3.join(pathPart, cmd);
210
- const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
211
- for (let j = 0; j < pathExt.length; j++) {
212
- const cur = p + pathExt[j];
213
- try {
214
- const is = isexe.sync(cur, { pathExt: pathExtExe });
215
- if (is) {
216
- if (opt.all)
217
- found.push(cur);
218
- else
219
- return cur;
220
- }
221
- } catch (ex) {
222
- }
223
- }
224
- }
225
- if (opt.all && found.length)
226
- return found;
227
- if (opt.nothrow)
228
- return null;
229
- throw getNotFoundError(cmd);
230
- };
231
- module.exports = which;
232
- which.sync = whichSync;
233
- }
234
- });
235
-
236
- // ../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js
237
- var require_path_key = __commonJS({
238
- "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(exports, module) {
239
- "use strict";
240
- var pathKey2 = (options = {}) => {
241
- const environment = options.env || process.env;
242
- const platform = options.platform || process.platform;
243
- if (platform !== "win32") {
244
- return "PATH";
245
- }
246
- return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
247
- };
248
- module.exports = pathKey2;
249
- module.exports.default = pathKey2;
250
- }
251
- });
252
-
253
- // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
254
- var require_resolveCommand = __commonJS({
255
- "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
256
- "use strict";
257
- var path3 = __require("path");
258
- var which = require_which();
259
- var getPathKey = require_path_key();
260
- function resolveCommandAttempt(parsed, withoutPathExt) {
261
- const env = parsed.options.env || process.env;
262
- const cwd = process.cwd();
263
- const hasCustomCwd = parsed.options.cwd != null;
264
- const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
265
- if (shouldSwitchCwd) {
266
- try {
267
- process.chdir(parsed.options.cwd);
268
- } catch (err) {
269
- }
270
- }
271
- let resolved;
272
- try {
273
- resolved = which.sync(parsed.command, {
274
- path: env[getPathKey({ env })],
275
- pathExt: withoutPathExt ? path3.delimiter : void 0
276
- });
277
- } catch (e) {
278
- } finally {
279
- if (shouldSwitchCwd) {
280
- process.chdir(cwd);
281
- }
282
- }
283
- if (resolved) {
284
- resolved = path3.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
285
- }
286
- return resolved;
287
- }
288
- function resolveCommand(parsed) {
289
- return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
290
- }
291
- module.exports = resolveCommand;
292
- }
293
- });
294
-
295
- // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js
296
- var require_escape = __commonJS({
297
- "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"(exports, module) {
298
- "use strict";
299
- var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
300
- function escapeCommand(arg) {
301
- arg = arg.replace(metaCharsRegExp, "^$1");
302
- return arg;
303
- }
304
- function escapeArgument(arg, doubleEscapeMetaChars) {
305
- arg = `${arg}`;
306
- arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
307
- arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
308
- arg = `"${arg}"`;
309
- arg = arg.replace(metaCharsRegExp, "^$1");
310
- if (doubleEscapeMetaChars) {
311
- arg = arg.replace(metaCharsRegExp, "^$1");
312
- }
313
- return arg;
314
- }
315
- module.exports.command = escapeCommand;
316
- module.exports.argument = escapeArgument;
317
- }
318
- });
319
-
320
- // ../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js
321
- var require_shebang_regex = __commonJS({
322
- "../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports, module) {
323
- "use strict";
324
- module.exports = /^#!(.*)/;
325
- }
326
- });
327
-
328
- // ../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js
329
- var require_shebang_command = __commonJS({
330
- "../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports, module) {
331
- "use strict";
332
- var shebangRegex = require_shebang_regex();
333
- module.exports = (string = "") => {
334
- const match = string.match(shebangRegex);
335
- if (!match) {
336
- return null;
337
- }
338
- const [path3, argument] = match[0].replace(/#! ?/, "").split(" ");
339
- const binary = path3.split("/").pop();
340
- if (binary === "env") {
341
- return argument;
342
- }
343
- return argument ? `${binary} ${argument}` : binary;
344
- };
345
- }
346
- });
347
-
348
- // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
349
- var require_readShebang = __commonJS({
350
- "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
351
- "use strict";
352
- var fs = __require("fs");
353
- var shebangCommand = require_shebang_command();
354
- function readShebang(command) {
355
- const size = 150;
356
- const buffer = Buffer.alloc(size);
357
- let fd;
358
- try {
359
- fd = fs.openSync(command, "r");
360
- fs.readSync(fd, buffer, 0, size, 0);
361
- fs.closeSync(fd);
362
- } catch (e) {
363
- }
364
- return shebangCommand(buffer.toString());
365
- }
366
- module.exports = readShebang;
367
- }
368
- });
369
-
370
- // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
371
- var require_parse = __commonJS({
372
- "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module) {
373
- "use strict";
374
- var path3 = __require("path");
375
- var resolveCommand = require_resolveCommand();
376
- var escape = require_escape();
377
- var readShebang = require_readShebang();
378
- var isWin = process.platform === "win32";
379
- var isExecutableRegExp = /\.(?:com|exe)$/i;
380
- var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
381
- function detectShebang(parsed) {
382
- parsed.file = resolveCommand(parsed);
383
- const shebang = parsed.file && readShebang(parsed.file);
384
- if (shebang) {
385
- parsed.args.unshift(parsed.file);
386
- parsed.command = shebang;
387
- return resolveCommand(parsed);
388
- }
389
- return parsed.file;
390
- }
391
- function parseNonShell(parsed) {
392
- if (!isWin) {
393
- return parsed;
394
- }
395
- const commandFile = detectShebang(parsed);
396
- const needsShell = !isExecutableRegExp.test(commandFile);
397
- if (parsed.options.forceShell || needsShell) {
398
- const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
399
- parsed.command = path3.normalize(parsed.command);
400
- parsed.command = escape.command(parsed.command);
401
- parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
402
- const shellCommand = [parsed.command].concat(parsed.args).join(" ");
403
- parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
404
- parsed.command = process.env.comspec || "cmd.exe";
405
- parsed.options.windowsVerbatimArguments = true;
406
- }
407
- return parsed;
408
- }
409
- function parse(command, args, options) {
410
- if (args && !Array.isArray(args)) {
411
- options = args;
412
- args = null;
413
- }
414
- args = args ? args.slice(0) : [];
415
- options = Object.assign({}, options);
416
- const parsed = {
417
- command,
418
- args,
419
- options,
420
- file: void 0,
421
- original: {
422
- command,
423
- args
424
- }
425
- };
426
- return options.shell ? parsed : parseNonShell(parsed);
427
- }
428
- module.exports = parse;
429
- }
430
- });
431
-
432
- // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js
433
- var require_enoent = __commonJS({
434
- "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js"(exports, module) {
435
- "use strict";
436
- var isWin = process.platform === "win32";
437
- function notFoundError(original, syscall) {
438
- return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
439
- code: "ENOENT",
440
- errno: "ENOENT",
441
- syscall: `${syscall} ${original.command}`,
442
- path: original.command,
443
- spawnargs: original.args
444
- });
445
- }
446
- function hookChildProcess(cp, parsed) {
447
- if (!isWin) {
448
- return;
449
- }
450
- const originalEmit = cp.emit;
451
- cp.emit = function(name, arg1) {
452
- if (name === "exit") {
453
- const err = verifyENOENT(arg1, parsed);
454
- if (err) {
455
- return originalEmit.call(cp, "error", err);
456
- }
457
- }
458
- return originalEmit.apply(cp, arguments);
459
- };
460
- }
461
- function verifyENOENT(status, parsed) {
462
- if (isWin && status === 1 && !parsed.file) {
463
- return notFoundError(parsed.original, "spawn");
464
- }
465
- return null;
466
- }
467
- function verifyENOENTSync(status, parsed) {
468
- if (isWin && status === 1 && !parsed.file) {
469
- return notFoundError(parsed.original, "spawnSync");
470
- }
471
- return null;
472
- }
473
- module.exports = {
474
- hookChildProcess,
475
- verifyENOENT,
476
- verifyENOENTSync,
477
- notFoundError
478
- };
479
- }
480
- });
481
-
482
- // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js
483
- var require_cross_spawn = __commonJS({
484
- "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports, module) {
485
- "use strict";
486
- var cp = __require("child_process");
487
- var parse = require_parse();
488
- var enoent = require_enoent();
489
- function spawn(command, args, options) {
490
- const parsed = parse(command, args, options);
491
- const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
492
- enoent.hookChildProcess(spawned, parsed);
493
- return spawned;
494
- }
495
- function spawnSync(command, args, options) {
496
- const parsed = parse(command, args, options);
497
- const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
498
- result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
499
- return result;
500
- }
501
- module.exports = spawn;
502
- module.exports.spawn = spawn;
503
- module.exports.sync = spawnSync;
504
- module.exports._parse = parse;
505
- module.exports._enoent = enoent;
506
- }
507
- });
508
-
509
- // ../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js
510
- var require_merge_stream = __commonJS({
511
- "../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js"(exports, module) {
512
- "use strict";
513
- var { PassThrough } = __require("stream");
514
- module.exports = function() {
515
- var sources = [];
516
- var output = new PassThrough({ objectMode: true });
517
- output.setMaxListeners(0);
518
- output.add = add;
519
- output.isEmpty = isEmpty;
520
- output.on("unpipe", remove);
521
- Array.prototype.slice.call(arguments).forEach(add);
522
- return output;
523
- function add(source) {
524
- if (Array.isArray(source)) {
525
- source.forEach(add);
526
- return this;
527
- }
528
- sources.push(source);
529
- source.once("end", remove.bind(null, source));
530
- source.once("error", output.emit.bind(output, "error"));
531
- source.pipe(output, { end: false });
532
- return this;
533
- }
534
- function isEmpty() {
535
- return sources.length == 0;
536
- }
537
- function remove(source) {
538
- sources = sources.filter(function(it) {
539
- return it !== source;
540
- });
541
- if (!sources.length && output.readable) {
542
- output.end();
543
- }
544
- }
545
- };
546
- }
547
- });
548
-
549
- // ../core/dist/index.js
550
- import { randomUUID as randomUUID2 } from "crypto";
551
- import { mkdir as mkdir3 } from "fs/promises";
552
- import { existsSync as existsSync3 } from "fs";
553
- import { resolve } from "path";
554
- import { execSync } from "child_process";
555
- import os2 from "os";
556
-
557
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js
558
- var import_cross_spawn = __toESM(require_cross_spawn(), 1);
559
- import { Buffer as Buffer3 } from "buffer";
560
- import path2 from "path";
561
- import childProcess from "child_process";
562
- import process6 from "process";
563
-
564
- // ../../node_modules/.pnpm/strip-final-newline@3.0.0/node_modules/strip-final-newline/index.js
565
- function stripFinalNewline(input) {
566
- const LF = typeof input === "string" ? "\n" : "\n".charCodeAt();
567
- const CR = typeof input === "string" ? "\r" : "\r".charCodeAt();
568
- if (input[input.length - 1] === LF) {
569
- input = input.slice(0, -1);
570
- }
571
- if (input[input.length - 1] === CR) {
572
- input = input.slice(0, -1);
573
- }
574
- return input;
575
- }
576
-
577
- // ../../node_modules/.pnpm/npm-run-path@5.3.0/node_modules/npm-run-path/index.js
578
- import process2 from "process";
579
- import path from "path";
580
- import { fileURLToPath } from "url";
581
-
582
- // ../../node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js
583
- function pathKey(options = {}) {
584
- const {
585
- env = process.env,
586
- platform = process.platform
587
- } = options;
588
- if (platform !== "win32") {
589
- return "PATH";
590
- }
591
- return Object.keys(env).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
592
- }
593
-
594
- // ../../node_modules/.pnpm/npm-run-path@5.3.0/node_modules/npm-run-path/index.js
595
- var npmRunPath = ({
596
- cwd = process2.cwd(),
597
- path: pathOption = process2.env[pathKey()],
598
- preferLocal = true,
599
- execPath = process2.execPath,
600
- addExecPath = true
601
- } = {}) => {
602
- const cwdString = cwd instanceof URL ? fileURLToPath(cwd) : cwd;
603
- const cwdPath = path.resolve(cwdString);
604
- const result = [];
605
- if (preferLocal) {
606
- applyPreferLocal(result, cwdPath);
607
- }
608
- if (addExecPath) {
609
- applyExecPath(result, execPath, cwdPath);
610
- }
611
- return [...result, pathOption].join(path.delimiter);
612
- };
613
- var applyPreferLocal = (result, cwdPath) => {
614
- let previous;
615
- while (previous !== cwdPath) {
616
- result.push(path.join(cwdPath, "node_modules/.bin"));
617
- previous = cwdPath;
618
- cwdPath = path.resolve(cwdPath, "..");
619
- }
620
- };
621
- var applyExecPath = (result, execPath, cwdPath) => {
622
- const execPathString = execPath instanceof URL ? fileURLToPath(execPath) : execPath;
623
- result.push(path.resolve(cwdPath, execPathString, ".."));
624
- };
625
- var npmRunPathEnv = ({ env = process2.env, ...options } = {}) => {
626
- env = { ...env };
627
- const pathName = pathKey({ env });
628
- options.path = env[pathName];
629
- env[pathName] = npmRunPath(options);
630
- return env;
631
- };
632
-
633
- // ../../node_modules/.pnpm/mimic-fn@4.0.0/node_modules/mimic-fn/index.js
634
- var copyProperty = (to, from, property, ignoreNonConfigurable) => {
635
- if (property === "length" || property === "prototype") {
636
- return;
637
- }
638
- if (property === "arguments" || property === "caller") {
639
- return;
640
- }
641
- const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
642
- const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
643
- if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
644
- return;
645
- }
646
- Object.defineProperty(to, property, fromDescriptor);
647
- };
648
- var canCopyProperty = function(toDescriptor, fromDescriptor) {
649
- return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
650
- };
651
- var changePrototype = (to, from) => {
652
- const fromPrototype = Object.getPrototypeOf(from);
653
- if (fromPrototype === Object.getPrototypeOf(to)) {
654
- return;
655
- }
656
- Object.setPrototypeOf(to, fromPrototype);
657
- };
658
- var wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/
659
- ${fromBody}`;
660
- var toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
661
- var toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
662
- var changeToString = (to, from, name) => {
663
- const withName = name === "" ? "" : `with ${name.trim()}() `;
664
- const newToString = wrappedToString.bind(null, withName, from.toString());
665
- Object.defineProperty(newToString, "name", toStringName);
666
- Object.defineProperty(to, "toString", { ...toStringDescriptor, value: newToString });
667
- };
668
- function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
669
- const { name } = to;
670
- for (const property of Reflect.ownKeys(from)) {
671
- copyProperty(to, from, property, ignoreNonConfigurable);
672
- }
673
- changePrototype(to, from);
674
- changeToString(to, from, name);
675
- return to;
676
- }
677
-
678
- // ../../node_modules/.pnpm/onetime@6.0.0/node_modules/onetime/index.js
679
- var calledFunctions = /* @__PURE__ */ new WeakMap();
680
- var onetime = (function_, options = {}) => {
681
- if (typeof function_ !== "function") {
682
- throw new TypeError("Expected a function");
683
- }
684
- let returnValue;
685
- let callCount = 0;
686
- const functionName = function_.displayName || function_.name || "<anonymous>";
687
- const onetime2 = function(...arguments_) {
688
- calledFunctions.set(onetime2, ++callCount);
689
- if (callCount === 1) {
690
- returnValue = function_.apply(this, arguments_);
691
- function_ = null;
692
- } else if (options.throw === true) {
693
- throw new Error(`Function \`${functionName}\` can only be called once`);
694
- }
695
- return returnValue;
696
- };
697
- mimicFunction(onetime2, function_);
698
- calledFunctions.set(onetime2, callCount);
699
- return onetime2;
700
- };
701
- onetime.callCount = (function_) => {
702
- if (!calledFunctions.has(function_)) {
703
- throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
704
- }
705
- return calledFunctions.get(function_);
706
- };
707
- var onetime_default = onetime;
708
-
709
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/error.js
710
- import process3 from "process";
711
-
712
- // ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/main.js
713
- import { constants as constants2 } from "os";
714
-
715
- // ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/realtime.js
716
- var getRealtimeSignals = () => {
717
- const length = SIGRTMAX - SIGRTMIN + 1;
718
- return Array.from({ length }, getRealtimeSignal);
719
- };
720
- var getRealtimeSignal = (value, index) => ({
721
- name: `SIGRT${index + 1}`,
722
- number: SIGRTMIN + index,
723
- action: "terminate",
724
- description: "Application-specific signal (realtime)",
725
- standard: "posix"
726
- });
727
- var SIGRTMIN = 34;
728
- var SIGRTMAX = 64;
729
-
730
- // ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/signals.js
731
- import { constants } from "os";
732
-
733
- // ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/core.js
734
- var SIGNALS = [
735
- {
736
- name: "SIGHUP",
737
- number: 1,
738
- action: "terminate",
739
- description: "Terminal closed",
740
- standard: "posix"
741
- },
742
- {
743
- name: "SIGINT",
744
- number: 2,
745
- action: "terminate",
746
- description: "User interruption with CTRL-C",
747
- standard: "ansi"
748
- },
749
- {
750
- name: "SIGQUIT",
751
- number: 3,
752
- action: "core",
753
- description: "User interruption with CTRL-\\",
754
- standard: "posix"
755
- },
756
- {
757
- name: "SIGILL",
758
- number: 4,
759
- action: "core",
760
- description: "Invalid machine instruction",
761
- standard: "ansi"
762
- },
763
- {
764
- name: "SIGTRAP",
765
- number: 5,
766
- action: "core",
767
- description: "Debugger breakpoint",
768
- standard: "posix"
769
- },
770
- {
771
- name: "SIGABRT",
772
- number: 6,
773
- action: "core",
774
- description: "Aborted",
775
- standard: "ansi"
776
- },
777
- {
778
- name: "SIGIOT",
779
- number: 6,
780
- action: "core",
781
- description: "Aborted",
782
- standard: "bsd"
783
- },
784
- {
785
- name: "SIGBUS",
786
- number: 7,
787
- action: "core",
788
- description: "Bus error due to misaligned, non-existing address or paging error",
789
- standard: "bsd"
790
- },
791
- {
792
- name: "SIGEMT",
793
- number: 7,
794
- action: "terminate",
795
- description: "Command should be emulated but is not implemented",
796
- standard: "other"
797
- },
798
- {
799
- name: "SIGFPE",
800
- number: 8,
801
- action: "core",
802
- description: "Floating point arithmetic error",
803
- standard: "ansi"
804
- },
805
- {
806
- name: "SIGKILL",
807
- number: 9,
808
- action: "terminate",
809
- description: "Forced termination",
810
- standard: "posix",
811
- forced: true
812
- },
813
- {
814
- name: "SIGUSR1",
815
- number: 10,
816
- action: "terminate",
817
- description: "Application-specific signal",
818
- standard: "posix"
819
- },
820
- {
821
- name: "SIGSEGV",
822
- number: 11,
823
- action: "core",
824
- description: "Segmentation fault",
825
- standard: "ansi"
826
- },
827
- {
828
- name: "SIGUSR2",
829
- number: 12,
830
- action: "terminate",
831
- description: "Application-specific signal",
832
- standard: "posix"
833
- },
834
- {
835
- name: "SIGPIPE",
836
- number: 13,
837
- action: "terminate",
838
- description: "Broken pipe or socket",
839
- standard: "posix"
840
- },
841
- {
842
- name: "SIGALRM",
843
- number: 14,
844
- action: "terminate",
845
- description: "Timeout or timer",
846
- standard: "posix"
847
- },
848
- {
849
- name: "SIGTERM",
850
- number: 15,
851
- action: "terminate",
852
- description: "Termination",
853
- standard: "ansi"
854
- },
855
- {
856
- name: "SIGSTKFLT",
857
- number: 16,
858
- action: "terminate",
859
- description: "Stack is empty or overflowed",
860
- standard: "other"
861
- },
862
- {
863
- name: "SIGCHLD",
864
- number: 17,
865
- action: "ignore",
866
- description: "Child process terminated, paused or unpaused",
867
- standard: "posix"
868
- },
869
- {
870
- name: "SIGCLD",
871
- number: 17,
872
- action: "ignore",
873
- description: "Child process terminated, paused or unpaused",
874
- standard: "other"
875
- },
876
- {
877
- name: "SIGCONT",
878
- number: 18,
879
- action: "unpause",
880
- description: "Unpaused",
881
- standard: "posix",
882
- forced: true
883
- },
884
- {
885
- name: "SIGSTOP",
886
- number: 19,
887
- action: "pause",
888
- description: "Paused",
889
- standard: "posix",
890
- forced: true
891
- },
892
- {
893
- name: "SIGTSTP",
894
- number: 20,
895
- action: "pause",
896
- description: 'Paused using CTRL-Z or "suspend"',
897
- standard: "posix"
898
- },
899
- {
900
- name: "SIGTTIN",
901
- number: 21,
902
- action: "pause",
903
- description: "Background process cannot read terminal input",
904
- standard: "posix"
905
- },
906
- {
907
- name: "SIGBREAK",
908
- number: 21,
909
- action: "terminate",
910
- description: "User interruption with CTRL-BREAK",
911
- standard: "other"
912
- },
913
- {
914
- name: "SIGTTOU",
915
- number: 22,
916
- action: "pause",
917
- description: "Background process cannot write to terminal output",
918
- standard: "posix"
919
- },
920
- {
921
- name: "SIGURG",
922
- number: 23,
923
- action: "ignore",
924
- description: "Socket received out-of-band data",
925
- standard: "bsd"
926
- },
927
- {
928
- name: "SIGXCPU",
929
- number: 24,
930
- action: "core",
931
- description: "Process timed out",
932
- standard: "bsd"
933
- },
934
- {
935
- name: "SIGXFSZ",
936
- number: 25,
937
- action: "core",
938
- description: "File too big",
939
- standard: "bsd"
940
- },
941
- {
942
- name: "SIGVTALRM",
943
- number: 26,
944
- action: "terminate",
945
- description: "Timeout or timer",
946
- standard: "bsd"
947
- },
948
- {
949
- name: "SIGPROF",
950
- number: 27,
951
- action: "terminate",
952
- description: "Timeout or timer",
953
- standard: "bsd"
954
- },
955
- {
956
- name: "SIGWINCH",
957
- number: 28,
958
- action: "ignore",
959
- description: "Terminal window size changed",
960
- standard: "bsd"
961
- },
962
- {
963
- name: "SIGIO",
964
- number: 29,
965
- action: "terminate",
966
- description: "I/O is available",
967
- standard: "other"
968
- },
969
- {
970
- name: "SIGPOLL",
971
- number: 29,
972
- action: "terminate",
973
- description: "Watched event",
974
- standard: "other"
975
- },
976
- {
977
- name: "SIGINFO",
978
- number: 29,
979
- action: "ignore",
980
- description: "Request for process information",
981
- standard: "other"
982
- },
983
- {
984
- name: "SIGPWR",
985
- number: 30,
986
- action: "terminate",
987
- description: "Device running out of power",
988
- standard: "systemv"
989
- },
990
- {
991
- name: "SIGSYS",
992
- number: 31,
993
- action: "core",
994
- description: "Invalid system call",
995
- standard: "other"
996
- },
997
- {
998
- name: "SIGUNUSED",
999
- number: 31,
1000
- action: "terminate",
1001
- description: "Invalid system call",
1002
- standard: "other"
1003
- }
1004
- ];
1005
-
1006
- // ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/signals.js
1007
- var getSignals = () => {
1008
- const realtimeSignals = getRealtimeSignals();
1009
- const signals2 = [...SIGNALS, ...realtimeSignals].map(normalizeSignal);
1010
- return signals2;
1011
- };
1012
- var normalizeSignal = ({
1013
- name,
1014
- number: defaultNumber,
1015
- description,
1016
- action,
1017
- forced = false,
1018
- standard
1019
- }) => {
1020
- const {
1021
- signals: { [name]: constantSignal }
1022
- } = constants;
1023
- const supported = constantSignal !== void 0;
1024
- const number = supported ? constantSignal : defaultNumber;
1025
- return { name, number, description, supported, action, forced, standard };
1026
- };
1027
-
1028
- // ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/main.js
1029
- var getSignalsByName = () => {
1030
- const signals2 = getSignals();
1031
- return Object.fromEntries(signals2.map(getSignalByName));
1032
- };
1033
- var getSignalByName = ({
1034
- name,
1035
- number,
1036
- description,
1037
- supported,
1038
- action,
1039
- forced,
1040
- standard
1041
- }) => [name, { name, number, description, supported, action, forced, standard }];
1042
- var signalsByName = getSignalsByName();
1043
- var getSignalsByNumber = () => {
1044
- const signals2 = getSignals();
1045
- const length = SIGRTMAX + 1;
1046
- const signalsA = Array.from(
1047
- { length },
1048
- (value, number) => getSignalByNumber(number, signals2)
1049
- );
1050
- return Object.assign({}, ...signalsA);
1051
- };
1052
- var getSignalByNumber = (number, signals2) => {
1053
- const signal = findSignalByNumber(number, signals2);
1054
- if (signal === void 0) {
1055
- return {};
1056
- }
1057
- const { name, description, supported, action, forced, standard } = signal;
1058
- return {
1059
- [number]: {
1060
- name,
1061
- number,
1062
- description,
1063
- supported,
1064
- action,
1065
- forced,
1066
- standard
1067
- }
1068
- };
1069
- };
1070
- var findSignalByNumber = (number, signals2) => {
1071
- const signal = signals2.find(({ name }) => constants2.signals[name] === number);
1072
- if (signal !== void 0) {
1073
- return signal;
1074
- }
1075
- return signals2.find((signalA) => signalA.number === number);
1076
- };
1077
- var signalsByNumber = getSignalsByNumber();
1078
-
1079
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/error.js
1080
- var getErrorPrefix = ({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }) => {
1081
- if (timedOut) {
1082
- return `timed out after ${timeout} milliseconds`;
1083
- }
1084
- if (isCanceled) {
1085
- return "was canceled";
1086
- }
1087
- if (errorCode !== void 0) {
1088
- return `failed with ${errorCode}`;
1089
- }
1090
- if (signal !== void 0) {
1091
- return `was killed with ${signal} (${signalDescription})`;
1092
- }
1093
- if (exitCode !== void 0) {
1094
- return `failed with exit code ${exitCode}`;
1095
- }
1096
- return "failed";
1097
- };
1098
- var makeError = ({
1099
- stdout,
1100
- stderr,
1101
- all,
1102
- error,
1103
- signal,
1104
- exitCode,
1105
- command,
1106
- escapedCommand,
1107
- timedOut,
1108
- isCanceled,
1109
- killed,
1110
- parsed: { options: { timeout, cwd = process3.cwd() } }
1111
- }) => {
1112
- exitCode = exitCode === null ? void 0 : exitCode;
1113
- signal = signal === null ? void 0 : signal;
1114
- const signalDescription = signal === void 0 ? void 0 : signalsByName[signal].description;
1115
- const errorCode = error && error.code;
1116
- const prefix = getErrorPrefix({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled });
1117
- const execaMessage = `Command ${prefix}: ${command}`;
1118
- const isError = Object.prototype.toString.call(error) === "[object Error]";
1119
- const shortMessage = isError ? `${execaMessage}
1120
- ${error.message}` : execaMessage;
1121
- const message = [shortMessage, stderr, stdout].filter(Boolean).join("\n");
1122
- if (isError) {
1123
- error.originalMessage = error.message;
1124
- error.message = message;
1125
- } else {
1126
- error = new Error(message);
1127
- }
1128
- error.shortMessage = shortMessage;
1129
- error.command = command;
1130
- error.escapedCommand = escapedCommand;
1131
- error.exitCode = exitCode;
1132
- error.signal = signal;
1133
- error.signalDescription = signalDescription;
1134
- error.stdout = stdout;
1135
- error.stderr = stderr;
1136
- error.cwd = cwd;
1137
- if (all !== void 0) {
1138
- error.all = all;
1139
- }
1140
- if ("bufferedData" in error) {
1141
- delete error.bufferedData;
1142
- }
1143
- error.failed = true;
1144
- error.timedOut = Boolean(timedOut);
1145
- error.isCanceled = isCanceled;
1146
- error.killed = killed && !timedOut;
1147
- return error;
1148
- };
1149
-
1150
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stdio.js
1151
- var aliases = ["stdin", "stdout", "stderr"];
1152
- var hasAlias = (options) => aliases.some((alias) => options[alias] !== void 0);
1153
- var normalizeStdio = (options) => {
1154
- if (!options) {
1155
- return;
1156
- }
1157
- const { stdio } = options;
1158
- if (stdio === void 0) {
1159
- return aliases.map((alias) => options[alias]);
1160
- }
1161
- if (hasAlias(options)) {
1162
- throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`);
1163
- }
1164
- if (typeof stdio === "string") {
1165
- return stdio;
1166
- }
1167
- if (!Array.isArray(stdio)) {
1168
- throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
1169
- }
1170
- const length = Math.max(stdio.length, aliases.length);
1171
- return Array.from({ length }, (value, index) => stdio[index]);
1172
- };
1173
-
1174
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/kill.js
1175
- import os from "os";
1176
-
1177
- // ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
1178
- var signals = [];
1179
- signals.push("SIGHUP", "SIGINT", "SIGTERM");
1180
- if (process.platform !== "win32") {
1181
- signals.push(
1182
- "SIGALRM",
1183
- "SIGABRT",
1184
- "SIGVTALRM",
1185
- "SIGXCPU",
1186
- "SIGXFSZ",
1187
- "SIGUSR2",
1188
- "SIGTRAP",
1189
- "SIGSYS",
1190
- "SIGQUIT",
1191
- "SIGIOT"
1192
- // should detect profiler and enable/disable accordingly.
1193
- // see #21
1194
- // 'SIGPROF'
1195
- );
1196
- }
1197
- if (process.platform === "linux") {
1198
- signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
1199
- }
1200
-
1201
- // ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
1202
- var processOk = (process7) => !!process7 && typeof process7 === "object" && typeof process7.removeListener === "function" && typeof process7.emit === "function" && typeof process7.reallyExit === "function" && typeof process7.listeners === "function" && typeof process7.kill === "function" && typeof process7.pid === "number" && typeof process7.on === "function";
1203
- var kExitEmitter = /* @__PURE__ */ Symbol.for("signal-exit emitter");
1204
- var global2 = globalThis;
1205
- var ObjectDefineProperty = Object.defineProperty.bind(Object);
1206
- var Emitter = class {
1207
- emitted = {
1208
- afterExit: false,
1209
- exit: false
1210
- };
1211
- listeners = {
1212
- afterExit: [],
1213
- exit: []
1214
- };
1215
- count = 0;
1216
- id = Math.random();
1217
- constructor() {
1218
- if (global2[kExitEmitter]) {
1219
- return global2[kExitEmitter];
1220
- }
1221
- ObjectDefineProperty(global2, kExitEmitter, {
1222
- value: this,
1223
- writable: false,
1224
- enumerable: false,
1225
- configurable: false
1226
- });
1227
- }
1228
- on(ev, fn) {
1229
- this.listeners[ev].push(fn);
1230
- }
1231
- removeListener(ev, fn) {
1232
- const list = this.listeners[ev];
1233
- const i = list.indexOf(fn);
1234
- if (i === -1) {
1235
- return;
1236
- }
1237
- if (i === 0 && list.length === 1) {
1238
- list.length = 0;
1239
- } else {
1240
- list.splice(i, 1);
1241
- }
1242
- }
1243
- emit(ev, code, signal) {
1244
- if (this.emitted[ev]) {
1245
- return false;
1246
- }
1247
- this.emitted[ev] = true;
1248
- let ret = false;
1249
- for (const fn of this.listeners[ev]) {
1250
- ret = fn(code, signal) === true || ret;
1251
- }
1252
- if (ev === "exit") {
1253
- ret = this.emit("afterExit", code, signal) || ret;
1254
- }
1255
- return ret;
1256
- }
1257
- };
1258
- var SignalExitBase = class {
1259
- };
1260
- var signalExitWrap = (handler) => {
1261
- return {
1262
- onExit(cb, opts) {
1263
- return handler.onExit(cb, opts);
1264
- },
1265
- load() {
1266
- return handler.load();
1267
- },
1268
- unload() {
1269
- return handler.unload();
1270
- }
1271
- };
1272
- };
1273
- var SignalExitFallback = class extends SignalExitBase {
1274
- onExit() {
1275
- return () => {
1276
- };
1277
- }
1278
- load() {
1279
- }
1280
- unload() {
1281
- }
1282
- };
1283
- var SignalExit = class extends SignalExitBase {
1284
- // "SIGHUP" throws an `ENOSYS` error on Windows,
1285
- // so use a supported signal instead
1286
- /* c8 ignore start */
1287
- #hupSig = process4.platform === "win32" ? "SIGINT" : "SIGHUP";
1288
- /* c8 ignore stop */
1289
- #emitter = new Emitter();
1290
- #process;
1291
- #originalProcessEmit;
1292
- #originalProcessReallyExit;
1293
- #sigListeners = {};
1294
- #loaded = false;
1295
- constructor(process7) {
1296
- super();
1297
- this.#process = process7;
1298
- this.#sigListeners = {};
1299
- for (const sig of signals) {
1300
- this.#sigListeners[sig] = () => {
1301
- const listeners = this.#process.listeners(sig);
1302
- let { count } = this.#emitter;
1303
- const p = process7;
1304
- if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
1305
- count += p.__signal_exit_emitter__.count;
1306
- }
1307
- if (listeners.length === count) {
1308
- this.unload();
1309
- const ret = this.#emitter.emit("exit", null, sig);
1310
- const s = sig === "SIGHUP" ? this.#hupSig : sig;
1311
- if (!ret)
1312
- process7.kill(process7.pid, s);
1313
- }
1314
- };
1315
- }
1316
- this.#originalProcessReallyExit = process7.reallyExit;
1317
- this.#originalProcessEmit = process7.emit;
1318
- }
1319
- onExit(cb, opts) {
1320
- if (!processOk(this.#process)) {
1321
- return () => {
1322
- };
1323
- }
1324
- if (this.#loaded === false) {
1325
- this.load();
1326
- }
1327
- const ev = opts?.alwaysLast ? "afterExit" : "exit";
1328
- this.#emitter.on(ev, cb);
1329
- return () => {
1330
- this.#emitter.removeListener(ev, cb);
1331
- if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
1332
- this.unload();
1333
- }
1334
- };
1335
- }
1336
- load() {
1337
- if (this.#loaded) {
1338
- return;
1339
- }
1340
- this.#loaded = true;
1341
- this.#emitter.count += 1;
1342
- for (const sig of signals) {
1343
- try {
1344
- const fn = this.#sigListeners[sig];
1345
- if (fn)
1346
- this.#process.on(sig, fn);
1347
- } catch (_) {
1348
- }
1349
- }
1350
- this.#process.emit = (ev, ...a) => {
1351
- return this.#processEmit(ev, ...a);
1352
- };
1353
- this.#process.reallyExit = (code) => {
1354
- return this.#processReallyExit(code);
1355
- };
1356
- }
1357
- unload() {
1358
- if (!this.#loaded) {
1359
- return;
1360
- }
1361
- this.#loaded = false;
1362
- signals.forEach((sig) => {
1363
- const listener = this.#sigListeners[sig];
1364
- if (!listener) {
1365
- throw new Error("Listener not defined for signal: " + sig);
1366
- }
1367
- try {
1368
- this.#process.removeListener(sig, listener);
1369
- } catch (_) {
1370
- }
1371
- });
1372
- this.#process.emit = this.#originalProcessEmit;
1373
- this.#process.reallyExit = this.#originalProcessReallyExit;
1374
- this.#emitter.count -= 1;
1375
- }
1376
- #processReallyExit(code) {
1377
- if (!processOk(this.#process)) {
1378
- return 0;
1379
- }
1380
- this.#process.exitCode = code || 0;
1381
- this.#emitter.emit("exit", this.#process.exitCode, null);
1382
- return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
1383
- }
1384
- #processEmit(ev, ...args) {
1385
- const og = this.#originalProcessEmit;
1386
- if (ev === "exit" && processOk(this.#process)) {
1387
- if (typeof args[0] === "number") {
1388
- this.#process.exitCode = args[0];
1389
- }
1390
- const ret = og.call(this.#process, ev, ...args);
1391
- this.#emitter.emit("exit", this.#process.exitCode, null);
1392
- return ret;
1393
- } else {
1394
- return og.call(this.#process, ev, ...args);
1395
- }
1396
- }
1397
- };
1398
- var process4 = globalThis.process;
1399
- var {
1400
- /**
1401
- * Called when the process is exiting, whether via signal, explicit
1402
- * exit, or running out of stuff to do.
1403
- *
1404
- * If the global process object is not suitable for instrumentation,
1405
- * then this will be a no-op.
1406
- *
1407
- * Returns a function that may be used to unload signal-exit.
1408
- */
1409
- onExit,
1410
- /**
1411
- * Load the listeners. Likely you never need to call this, unless
1412
- * doing a rather deep integration with signal-exit functionality.
1413
- * Mostly exposed for the benefit of testing.
1414
- *
1415
- * @internal
1416
- */
1417
- load,
1418
- /**
1419
- * Unload the listeners. Likely you never need to call this, unless
1420
- * doing a rather deep integration with signal-exit functionality.
1421
- * Mostly exposed for the benefit of testing.
1422
- *
1423
- * @internal
1424
- */
1425
- unload
1426
- } = signalExitWrap(processOk(process4) ? new SignalExit(process4) : new SignalExitFallback());
1427
-
1428
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/kill.js
1429
- var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
1430
- var spawnedKill = (kill, signal = "SIGTERM", options = {}) => {
1431
- const killResult = kill(signal);
1432
- setKillTimeout(kill, signal, options, killResult);
1433
- return killResult;
1434
- };
1435
- var setKillTimeout = (kill, signal, options, killResult) => {
1436
- if (!shouldForceKill(signal, options, killResult)) {
1437
- return;
1438
- }
1439
- const timeout = getForceKillAfterTimeout(options);
1440
- const t = setTimeout(() => {
1441
- kill("SIGKILL");
1442
- }, timeout);
1443
- if (t.unref) {
1444
- t.unref();
1445
- }
1446
- };
1447
- var shouldForceKill = (signal, { forceKillAfterTimeout }, killResult) => isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
1448
- var isSigterm = (signal) => signal === os.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM";
1449
- var getForceKillAfterTimeout = ({ forceKillAfterTimeout = true }) => {
1450
- if (forceKillAfterTimeout === true) {
1451
- return DEFAULT_FORCE_KILL_TIMEOUT;
1452
- }
1453
- if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {
1454
- throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
1455
- }
1456
- return forceKillAfterTimeout;
1457
- };
1458
- var spawnedCancel = (spawned, context) => {
1459
- const killResult = spawned.kill();
1460
- if (killResult) {
1461
- context.isCanceled = true;
1462
- }
1463
- };
1464
- var timeoutKill = (spawned, signal, reject) => {
1465
- spawned.kill(signal);
1466
- reject(Object.assign(new Error("Timed out"), { timedOut: true, signal }));
1467
- };
1468
- var setupTimeout = (spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => {
1469
- if (timeout === 0 || timeout === void 0) {
1470
- return spawnedPromise;
1471
- }
1472
- let timeoutId;
1473
- const timeoutPromise = new Promise((resolve2, reject) => {
1474
- timeoutId = setTimeout(() => {
1475
- timeoutKill(spawned, killSignal, reject);
1476
- }, timeout);
1477
- });
1478
- const safeSpawnedPromise = spawnedPromise.finally(() => {
1479
- clearTimeout(timeoutId);
1480
- });
1481
- return Promise.race([timeoutPromise, safeSpawnedPromise]);
1482
- };
1483
- var validateTimeout = ({ timeout }) => {
1484
- if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout < 0)) {
1485
- throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
1486
- }
1487
- };
1488
- var setExitHandler = async (spawned, { cleanup, detached }, timedPromise) => {
1489
- if (!cleanup || detached) {
1490
- return timedPromise;
1491
- }
1492
- const removeExitHandler = onExit(() => {
1493
- spawned.kill();
1494
- });
1495
- return timedPromise.finally(() => {
1496
- removeExitHandler();
1497
- });
1498
- };
1499
-
1500
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/pipe.js
1501
- import { createWriteStream } from "fs";
1502
- import { ChildProcess } from "child_process";
1503
-
1504
- // ../../node_modules/.pnpm/is-stream@3.0.0/node_modules/is-stream/index.js
1505
- function isStream(stream) {
1506
- return stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
1507
- }
1508
- function isWritableStream(stream) {
1509
- return isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
1510
- }
1511
-
1512
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/pipe.js
1513
- var isExecaChildProcess = (target) => target instanceof ChildProcess && typeof target.then === "function";
1514
- var pipeToTarget = (spawned, streamName, target) => {
1515
- if (typeof target === "string") {
1516
- spawned[streamName].pipe(createWriteStream(target));
1517
- return spawned;
1518
- }
1519
- if (isWritableStream(target)) {
1520
- spawned[streamName].pipe(target);
1521
- return spawned;
1522
- }
1523
- if (!isExecaChildProcess(target)) {
1524
- throw new TypeError("The second argument must be a string, a stream or an Execa child process.");
1525
- }
1526
- if (!isWritableStream(target.stdin)) {
1527
- throw new TypeError("The target child process's stdin must be available.");
1528
- }
1529
- spawned[streamName].pipe(target.stdin);
1530
- return target;
1531
- };
1532
- var addPipeMethods = (spawned) => {
1533
- if (spawned.stdout !== null) {
1534
- spawned.pipeStdout = pipeToTarget.bind(void 0, spawned, "stdout");
1535
- }
1536
- if (spawned.stderr !== null) {
1537
- spawned.pipeStderr = pipeToTarget.bind(void 0, spawned, "stderr");
1538
- }
1539
- if (spawned.all !== void 0) {
1540
- spawned.pipeAll = pipeToTarget.bind(void 0, spawned, "all");
1541
- }
1542
- };
1543
-
1544
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stream.js
1545
- import { createReadStream, readFileSync } from "fs";
1546
- import { setTimeout as setTimeout2 } from "timers/promises";
1547
-
1548
- // ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/contents.js
1549
- var getStreamContents = async (stream, { init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize }, { maxBuffer = Number.POSITIVE_INFINITY } = {}) => {
1550
- if (!isAsyncIterable(stream)) {
1551
- throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");
1552
- }
1553
- const state = init();
1554
- state.length = 0;
1555
- try {
1556
- for await (const chunk of stream) {
1557
- const chunkType = getChunkType(chunk);
1558
- const convertedChunk = convertChunk[chunkType](chunk, state);
1559
- appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
1560
- }
1561
- appendFinalChunk({ state, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer });
1562
- return finalize(state);
1563
- } catch (error) {
1564
- error.bufferedData = finalize(state);
1565
- throw error;
1566
- }
1567
- };
1568
- var appendFinalChunk = ({ state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer }) => {
1569
- const convertedChunk = getFinalChunk(state);
1570
- if (convertedChunk !== void 0) {
1571
- appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
1572
- }
1573
- };
1574
- var appendChunk = ({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer }) => {
1575
- const chunkSize = getSize(convertedChunk);
1576
- const newLength = state.length + chunkSize;
1577
- if (newLength <= maxBuffer) {
1578
- addNewChunk(convertedChunk, state, addChunk, newLength);
1579
- return;
1580
- }
1581
- const truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state.length);
1582
- if (truncatedChunk !== void 0) {
1583
- addNewChunk(truncatedChunk, state, addChunk, maxBuffer);
1584
- }
1585
- throw new MaxBufferError();
1586
- };
1587
- var addNewChunk = (convertedChunk, state, addChunk, newLength) => {
1588
- state.contents = addChunk(convertedChunk, state, newLength);
1589
- state.length = newLength;
1590
- };
1591
- var isAsyncIterable = (stream) => typeof stream === "object" && stream !== null && typeof stream[Symbol.asyncIterator] === "function";
1592
- var getChunkType = (chunk) => {
1593
- const typeOfChunk = typeof chunk;
1594
- if (typeOfChunk === "string") {
1595
- return "string";
1596
- }
1597
- if (typeOfChunk !== "object" || chunk === null) {
1598
- return "others";
1599
- }
1600
- if (globalThis.Buffer?.isBuffer(chunk)) {
1601
- return "buffer";
1602
- }
1603
- const prototypeName = objectToString.call(chunk);
1604
- if (prototypeName === "[object ArrayBuffer]") {
1605
- return "arrayBuffer";
1606
- }
1607
- if (prototypeName === "[object DataView]") {
1608
- return "dataView";
1609
- }
1610
- if (Number.isInteger(chunk.byteLength) && Number.isInteger(chunk.byteOffset) && objectToString.call(chunk.buffer) === "[object ArrayBuffer]") {
1611
- return "typedArray";
1612
- }
1613
- return "others";
1614
- };
1615
- var { toString: objectToString } = Object.prototype;
1616
- var MaxBufferError = class extends Error {
1617
- name = "MaxBufferError";
1618
- constructor() {
1619
- super("maxBuffer exceeded");
1620
- }
1621
- };
1622
-
1623
- // ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/utils.js
1624
- var identity = (value) => value;
1625
- var noop = () => void 0;
1626
- var getContentsProp = ({ contents }) => contents;
1627
- var throwObjectStream = (chunk) => {
1628
- throw new Error(`Streams in object mode are not supported: ${String(chunk)}`);
1629
- };
1630
- var getLengthProp = (convertedChunk) => convertedChunk.length;
1631
-
1632
- // ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array-buffer.js
1633
- async function getStreamAsArrayBuffer(stream, options) {
1634
- return getStreamContents(stream, arrayBufferMethods, options);
1635
- }
1636
- var initArrayBuffer = () => ({ contents: new ArrayBuffer(0) });
1637
- var useTextEncoder = (chunk) => textEncoder.encode(chunk);
1638
- var textEncoder = new TextEncoder();
1639
- var useUint8Array = (chunk) => new Uint8Array(chunk);
1640
- var useUint8ArrayWithOffset = (chunk) => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);
1641
- var truncateArrayBufferChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);
1642
- var addArrayBufferChunk = (convertedChunk, { contents, length: previousLength }, length) => {
1643
- const newContents = hasArrayBufferResize() ? resizeArrayBuffer(contents, length) : resizeArrayBufferSlow(contents, length);
1644
- new Uint8Array(newContents).set(convertedChunk, previousLength);
1645
- return newContents;
1646
- };
1647
- var resizeArrayBufferSlow = (contents, length) => {
1648
- if (length <= contents.byteLength) {
1649
- return contents;
1650
- }
1651
- const arrayBuffer = new ArrayBuffer(getNewContentsLength(length));
1652
- new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
1653
- return arrayBuffer;
1654
- };
1655
- var resizeArrayBuffer = (contents, length) => {
1656
- if (length <= contents.maxByteLength) {
1657
- contents.resize(length);
1658
- return contents;
1659
- }
1660
- const arrayBuffer = new ArrayBuffer(length, { maxByteLength: getNewContentsLength(length) });
1661
- new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
1662
- return arrayBuffer;
1663
- };
1664
- var getNewContentsLength = (length) => SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(SCALE_FACTOR));
1665
- var SCALE_FACTOR = 2;
1666
- var finalizeArrayBuffer = ({ contents, length }) => hasArrayBufferResize() ? contents : contents.slice(0, length);
1667
- var hasArrayBufferResize = () => "resize" in ArrayBuffer.prototype;
1668
- var arrayBufferMethods = {
1669
- init: initArrayBuffer,
1670
- convertChunk: {
1671
- string: useTextEncoder,
1672
- buffer: useUint8Array,
1673
- arrayBuffer: useUint8Array,
1674
- dataView: useUint8ArrayWithOffset,
1675
- typedArray: useUint8ArrayWithOffset,
1676
- others: throwObjectStream
1677
- },
1678
- getSize: getLengthProp,
1679
- truncateChunk: truncateArrayBufferChunk,
1680
- addChunk: addArrayBufferChunk,
1681
- getFinalChunk: noop,
1682
- finalize: finalizeArrayBuffer
1683
- };
1684
-
1685
- // ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/buffer.js
1686
- async function getStreamAsBuffer(stream, options) {
1687
- if (!("Buffer" in globalThis)) {
1688
- throw new Error("getStreamAsBuffer() is only supported in Node.js");
1689
- }
1690
- try {
1691
- return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(stream, options));
1692
- } catch (error) {
1693
- if (error.bufferedData !== void 0) {
1694
- error.bufferedData = arrayBufferToNodeBuffer(error.bufferedData);
1695
- }
1696
- throw error;
1697
- }
1698
- }
1699
- var arrayBufferToNodeBuffer = (arrayBuffer) => globalThis.Buffer.from(arrayBuffer);
1700
-
1701
- // ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/string.js
1702
- async function getStreamAsString(stream, options) {
1703
- return getStreamContents(stream, stringMethods, options);
1704
- }
1705
- var initString = () => ({ contents: "", textDecoder: new TextDecoder() });
1706
- var useTextDecoder = (chunk, { textDecoder }) => textDecoder.decode(chunk, { stream: true });
1707
- var addStringChunk = (convertedChunk, { contents }) => contents + convertedChunk;
1708
- var truncateStringChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);
1709
- var getFinalStringChunk = ({ textDecoder }) => {
1710
- const finalChunk = textDecoder.decode();
1711
- return finalChunk === "" ? void 0 : finalChunk;
1712
- };
1713
- var stringMethods = {
1714
- init: initString,
1715
- convertChunk: {
1716
- string: identity,
1717
- buffer: useTextDecoder,
1718
- arrayBuffer: useTextDecoder,
1719
- dataView: useTextDecoder,
1720
- typedArray: useTextDecoder,
1721
- others: throwObjectStream
1722
- },
1723
- getSize: getLengthProp,
1724
- truncateChunk: truncateStringChunk,
1725
- addChunk: addStringChunk,
1726
- getFinalChunk: getFinalStringChunk,
1727
- finalize: getContentsProp
1728
- };
1729
-
1730
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stream.js
1731
- var import_merge_stream = __toESM(require_merge_stream(), 1);
1732
- var validateInputOptions = (input) => {
1733
- if (input !== void 0) {
1734
- throw new TypeError("The `input` and `inputFile` options cannot be both set.");
1735
- }
1736
- };
1737
- var getInputSync = ({ input, inputFile }) => {
1738
- if (typeof inputFile !== "string") {
1739
- return input;
1740
- }
1741
- validateInputOptions(input);
1742
- return readFileSync(inputFile);
1743
- };
1744
- var handleInputSync = (options) => {
1745
- const input = getInputSync(options);
1746
- if (isStream(input)) {
1747
- throw new TypeError("The `input` option cannot be a stream in sync mode");
1748
- }
1749
- return input;
1750
- };
1751
- var getInput = ({ input, inputFile }) => {
1752
- if (typeof inputFile !== "string") {
1753
- return input;
1754
- }
1755
- validateInputOptions(input);
1756
- return createReadStream(inputFile);
1757
- };
1758
- var handleInput = (spawned, options) => {
1759
- const input = getInput(options);
1760
- if (input === void 0) {
1761
- return;
1762
- }
1763
- if (isStream(input)) {
1764
- input.pipe(spawned.stdin);
1765
- } else {
1766
- spawned.stdin.end(input);
1767
- }
1768
- };
1769
- var makeAllStream = (spawned, { all }) => {
1770
- if (!all || !spawned.stdout && !spawned.stderr) {
1771
- return;
1772
- }
1773
- const mixed = (0, import_merge_stream.default)();
1774
- if (spawned.stdout) {
1775
- mixed.add(spawned.stdout);
1776
- }
1777
- if (spawned.stderr) {
1778
- mixed.add(spawned.stderr);
1779
- }
1780
- return mixed;
1781
- };
1782
- var getBufferedData = async (stream, streamPromise) => {
1783
- if (!stream || streamPromise === void 0) {
1784
- return;
1785
- }
1786
- await setTimeout2(0);
1787
- stream.destroy();
1788
- try {
1789
- return await streamPromise;
1790
- } catch (error) {
1791
- return error.bufferedData;
1792
- }
1793
- };
1794
- var getStreamPromise = (stream, { encoding, buffer, maxBuffer }) => {
1795
- if (!stream || !buffer) {
1796
- return;
1797
- }
1798
- if (encoding === "utf8" || encoding === "utf-8") {
1799
- return getStreamAsString(stream, { maxBuffer });
1800
- }
1801
- if (encoding === null || encoding === "buffer") {
1802
- return getStreamAsBuffer(stream, { maxBuffer });
1803
- }
1804
- return applyEncoding(stream, maxBuffer, encoding);
1805
- };
1806
- var applyEncoding = async (stream, maxBuffer, encoding) => {
1807
- const buffer = await getStreamAsBuffer(stream, { maxBuffer });
1808
- return buffer.toString(encoding);
1809
- };
1810
- var getSpawnedResult = async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone) => {
1811
- const stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer });
1812
- const stderrPromise = getStreamPromise(stderr, { encoding, buffer, maxBuffer });
1813
- const allPromise = getStreamPromise(all, { encoding, buffer, maxBuffer: maxBuffer * 2 });
1814
- try {
1815
- return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);
1816
- } catch (error) {
1817
- return Promise.all([
1818
- { error, signal: error.signal, timedOut: error.timedOut },
1819
- getBufferedData(stdout, stdoutPromise),
1820
- getBufferedData(stderr, stderrPromise),
1821
- getBufferedData(all, allPromise)
1822
- ]);
1823
- }
1824
- };
1825
-
1826
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/promise.js
1827
- var nativePromisePrototype = (async () => {
1828
- })().constructor.prototype;
1829
- var descriptors = ["then", "catch", "finally"].map((property) => [
1830
- property,
1831
- Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)
1832
- ]);
1833
- var mergePromise = (spawned, promise) => {
1834
- for (const [property, descriptor] of descriptors) {
1835
- const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise);
1836
- Reflect.defineProperty(spawned, property, { ...descriptor, value });
1837
- }
1838
- };
1839
- var getSpawnedPromise = (spawned) => new Promise((resolve2, reject) => {
1840
- spawned.on("exit", (exitCode, signal) => {
1841
- resolve2({ exitCode, signal });
1842
- });
1843
- spawned.on("error", (error) => {
1844
- reject(error);
1845
- });
1846
- if (spawned.stdin) {
1847
- spawned.stdin.on("error", (error) => {
1848
- reject(error);
1849
- });
1850
- }
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
+ }) : x)(function(x) {
10
+ if (typeof require !== "undefined") return require.apply(this, arguments);
11
+ throw Error('Dynamic require of "' + x + '" is not supported');
1851
12
  });
1852
-
1853
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/command.js
1854
- import { Buffer as Buffer2 } from "buffer";
1855
- import { ChildProcess as ChildProcess2 } from "child_process";
1856
- var normalizeArgs = (file, args = []) => {
1857
- if (!Array.isArray(args)) {
1858
- return [file];
1859
- }
1860
- return [file, ...args];
1861
- };
1862
- var NO_ESCAPE_REGEXP = /^[\w.-]+$/;
1863
- var escapeArg = (arg) => {
1864
- if (typeof arg !== "string" || NO_ESCAPE_REGEXP.test(arg)) {
1865
- return arg;
1866
- }
1867
- return `"${arg.replaceAll('"', '\\"')}"`;
1868
- };
1869
- var joinCommand = (file, args) => normalizeArgs(file, args).join(" ");
1870
- var getEscapedCommand = (file, args) => normalizeArgs(file, args).map((arg) => escapeArg(arg)).join(" ");
1871
- var SPACES_REGEXP = / +/g;
1872
- var parseExpression = (expression) => {
1873
- const typeOfExpression = typeof expression;
1874
- if (typeOfExpression === "string") {
1875
- return expression;
1876
- }
1877
- if (typeOfExpression === "number") {
1878
- return String(expression);
1879
- }
1880
- if (typeOfExpression === "object" && expression !== null && !(expression instanceof ChildProcess2) && "stdout" in expression) {
1881
- const typeOfStdout = typeof expression.stdout;
1882
- if (typeOfStdout === "string") {
1883
- return expression.stdout;
1884
- }
1885
- if (Buffer2.isBuffer(expression.stdout)) {
1886
- return expression.stdout.toString();
1887
- }
1888
- throw new TypeError(`Unexpected "${typeOfStdout}" stdout in template expression`);
1889
- }
1890
- throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`);
1891
- };
1892
- var concatTokens = (tokens, nextTokens, isNew) => isNew || tokens.length === 0 || nextTokens.length === 0 ? [...tokens, ...nextTokens] : [
1893
- ...tokens.slice(0, -1),
1894
- `${tokens.at(-1)}${nextTokens[0]}`,
1895
- ...nextTokens.slice(1)
1896
- ];
1897
- var parseTemplate = ({ templates, expressions, tokens, index, template }) => {
1898
- const templateString = template ?? templates.raw[index];
1899
- const templateTokens = templateString.split(SPACES_REGEXP).filter(Boolean);
1900
- const newTokens = concatTokens(
1901
- tokens,
1902
- templateTokens,
1903
- templateString.startsWith(" ")
1904
- );
1905
- if (index === expressions.length) {
1906
- return newTokens;
1907
- }
1908
- const expression = expressions[index];
1909
- const expressionTokens = Array.isArray(expression) ? expression.map((expression2) => parseExpression(expression2)) : [parseExpression(expression)];
1910
- return concatTokens(
1911
- newTokens,
1912
- expressionTokens,
1913
- templateString.endsWith(" ")
1914
- );
1915
- };
1916
- var parseTemplates = (templates, expressions) => {
1917
- let tokens = [];
1918
- for (const [index, template] of templates.entries()) {
1919
- tokens = parseTemplate({ templates, expressions, tokens, index, template });
1920
- }
1921
- return tokens;
1922
- };
1923
-
1924
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/verbose.js
1925
- import { debuglog } from "util";
1926
- import process5 from "process";
1927
- var verboseDefault = debuglog("execa").enabled;
1928
- var padField = (field, padding) => String(field).padStart(padding, "0");
1929
- var getTimestamp = () => {
1930
- const date = /* @__PURE__ */ new Date();
1931
- return `${padField(date.getHours(), 2)}:${padField(date.getMinutes(), 2)}:${padField(date.getSeconds(), 2)}.${padField(date.getMilliseconds(), 3)}`;
1932
- };
1933
- var logCommand = (escapedCommand, { verbose }) => {
1934
- if (!verbose) {
1935
- return;
1936
- }
1937
- process5.stderr.write(`[${getTimestamp()}] ${escapedCommand}
1938
- `);
13
+ var __commonJS = (cb, mod) => function __require2() {
14
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
1939
15
  };
1940
-
1941
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js
1942
- var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
1943
- var getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
1944
- const env = extendEnv ? { ...process6.env, ...envOption } : envOption;
1945
- if (preferLocal) {
1946
- return npmRunPathEnv({ env, cwd: localDir, execPath });
1947
- }
1948
- return env;
1949
- };
1950
- var handleArguments = (file, args, options = {}) => {
1951
- const parsed = import_cross_spawn.default._parse(file, args, options);
1952
- file = parsed.command;
1953
- args = parsed.args;
1954
- options = parsed.options;
1955
- options = {
1956
- maxBuffer: DEFAULT_MAX_BUFFER,
1957
- buffer: true,
1958
- stripFinalNewline: true,
1959
- extendEnv: true,
1960
- preferLocal: false,
1961
- localDir: options.cwd || process6.cwd(),
1962
- execPath: process6.execPath,
1963
- encoding: "utf8",
1964
- reject: true,
1965
- cleanup: true,
1966
- all: false,
1967
- windowsHide: true,
1968
- verbose: verboseDefault,
1969
- ...options
1970
- };
1971
- options.env = getEnv(options);
1972
- options.stdio = normalizeStdio(options);
1973
- if (process6.platform === "win32" && path2.basename(file, ".exe") === "cmd") {
1974
- args.unshift("/q");
1975
- }
1976
- return { file, args, options, parsed };
16
+ var __export = (target, all) => {
17
+ for (var name in all)
18
+ __defProp(target, name, { get: all[name], enumerable: true });
1977
19
  };
1978
- var handleOutput = (options, value, error) => {
1979
- if (typeof value !== "string" && !Buffer3.isBuffer(value)) {
1980
- return error === void 0 ? void 0 : "";
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") {
22
+ for (let key of __getOwnPropNames(from))
23
+ if (!__hasOwnProp.call(to, key) && key !== except)
24
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
1981
25
  }
1982
- if (options.stripFinalNewline) {
1983
- return stripFinalNewline(value);
1984
- }
1985
- return value;
26
+ return to;
1986
27
  };
1987
- function execa(file, args, options) {
1988
- const parsed = handleArguments(file, args, options);
1989
- const command = joinCommand(file, args);
1990
- const escapedCommand = getEscapedCommand(file, args);
1991
- logCommand(escapedCommand, parsed.options);
1992
- validateTimeout(parsed.options);
1993
- let spawned;
1994
- try {
1995
- spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options);
1996
- } catch (error) {
1997
- const dummySpawned = new childProcess.ChildProcess();
1998
- const errorPromise = Promise.reject(makeError({
1999
- error,
2000
- stdout: "",
2001
- stderr: "",
2002
- all: "",
2003
- command,
2004
- escapedCommand,
2005
- parsed,
2006
- timedOut: false,
2007
- isCanceled: false,
2008
- killed: false
2009
- }));
2010
- mergePromise(dummySpawned, errorPromise);
2011
- return dummySpawned;
2012
- }
2013
- const spawnedPromise = getSpawnedPromise(spawned);
2014
- const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);
2015
- const processDone = setExitHandler(spawned, parsed.options, timedPromise);
2016
- const context = { isCanceled: false };
2017
- spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));
2018
- spawned.cancel = spawnedCancel.bind(null, spawned, context);
2019
- const handlePromise = async () => {
2020
- const [{ error, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);
2021
- const stdout = handleOutput(parsed.options, stdoutResult);
2022
- const stderr = handleOutput(parsed.options, stderrResult);
2023
- const all = handleOutput(parsed.options, allResult);
2024
- if (error || exitCode !== 0 || signal !== null) {
2025
- const returnedError = makeError({
2026
- error,
2027
- exitCode,
2028
- signal,
2029
- stdout,
2030
- stderr,
2031
- all,
2032
- command,
2033
- escapedCommand,
2034
- parsed,
2035
- timedOut,
2036
- isCanceled: context.isCanceled || (parsed.options.signal ? parsed.options.signal.aborted : false),
2037
- killed: spawned.killed
2038
- });
2039
- if (!parsed.options.reject) {
2040
- return returnedError;
2041
- }
2042
- throw returnedError;
2043
- }
2044
- return {
2045
- command,
2046
- escapedCommand,
2047
- exitCode: 0,
2048
- stdout,
2049
- stderr,
2050
- all,
2051
- failed: false,
2052
- timedOut: false,
2053
- isCanceled: false,
2054
- killed: false
2055
- };
2056
- };
2057
- const handlePromiseOnce = onetime_default(handlePromise);
2058
- handleInput(spawned, parsed.options);
2059
- spawned.all = makeAllStream(spawned, parsed.options);
2060
- addPipeMethods(spawned);
2061
- mergePromise(spawned, handlePromiseOnce);
2062
- return spawned;
2063
- }
2064
- function execaSync(file, args, options) {
2065
- const parsed = handleArguments(file, args, options);
2066
- const command = joinCommand(file, args);
2067
- const escapedCommand = getEscapedCommand(file, args);
2068
- logCommand(escapedCommand, parsed.options);
2069
- const input = handleInputSync(parsed.options);
2070
- let result;
2071
- try {
2072
- result = childProcess.spawnSync(parsed.file, parsed.args, { ...parsed.options, input });
2073
- } catch (error) {
2074
- throw makeError({
2075
- error,
2076
- stdout: "",
2077
- stderr: "",
2078
- all: "",
2079
- command,
2080
- escapedCommand,
2081
- parsed,
2082
- timedOut: false,
2083
- isCanceled: false,
2084
- killed: false
2085
- });
2086
- }
2087
- const stdout = handleOutput(parsed.options, result.stdout, result.error);
2088
- const stderr = handleOutput(parsed.options, result.stderr, result.error);
2089
- if (result.error || result.status !== 0 || result.signal !== null) {
2090
- const error = makeError({
2091
- stdout,
2092
- stderr,
2093
- error: result.error,
2094
- signal: result.signal,
2095
- exitCode: result.status,
2096
- command,
2097
- escapedCommand,
2098
- parsed,
2099
- timedOut: result.error && result.error.code === "ETIMEDOUT",
2100
- isCanceled: false,
2101
- killed: result.signal !== null
2102
- });
2103
- if (!parsed.options.reject) {
2104
- return error;
2105
- }
2106
- throw error;
2107
- }
2108
- return {
2109
- command,
2110
- escapedCommand,
2111
- exitCode: 0,
2112
- stdout,
2113
- stderr,
2114
- failed: false,
2115
- timedOut: false,
2116
- isCanceled: false,
2117
- killed: false
2118
- };
2119
- }
2120
- var normalizeScriptStdin = ({ input, inputFile, stdio }) => input === void 0 && inputFile === void 0 && stdio === void 0 ? { stdin: "inherit" } : {};
2121
- var normalizeScriptOptions = (options = {}) => ({
2122
- preferLocal: true,
2123
- ...normalizeScriptStdin(options),
2124
- ...options
2125
- });
2126
- function create$(options) {
2127
- function $2(templatesOrOptions, ...expressions) {
2128
- if (!Array.isArray(templatesOrOptions)) {
2129
- return create$({ ...options, ...templatesOrOptions });
2130
- }
2131
- const [file, ...args] = parseTemplates(templatesOrOptions, expressions);
2132
- return execa(file, args, normalizeScriptOptions(options));
2133
- }
2134
- $2.sync = (templates, ...expressions) => {
2135
- if (!Array.isArray(templates)) {
2136
- throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");
2137
- }
2138
- const [file, ...args] = parseTemplates(templates, expressions);
2139
- return execaSync(file, args, normalizeScriptOptions(options));
2140
- };
2141
- return $2;
2142
- }
2143
- var $ = create$();
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
+ // If the importer is in node compatibility mode or this is not an ESM
30
+ // file that has been converted to a CommonJS file using a Babel-
31
+ // compatible transform (i.e. "__esModule" has not been set), then set
32
+ // "default" to the CommonJS "module.exports" for node compatibility.
33
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
+ mod
35
+ ));
2144
36
 
2145
37
  // ../core/dist/index.js
38
+ import { randomUUID as randomUUID2 } from "crypto";
39
+ import { mkdir as mkdir3 } from "fs/promises";
40
+ import { existsSync as existsSync3 } from "fs";
41
+ import { resolve } from "path";
42
+ import { execSync } from "child_process";
43
+ import os from "os";
44
+ import { execa } from "execa";
2146
45
  import { writeFile } from "fs/promises";
2147
46
  import { join } from "path";
47
+ import { execa as execa2 } from "execa";
2148
48
  import { writeFile as writeFile2, readFile as readFile2 } from "fs/promises";
2149
49
  import { existsSync } from "fs";
2150
50
  import { join as join2 } from "path";
@@ -2631,8 +531,8 @@ function getErrorMap() {
2631
531
 
2632
532
  // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
2633
533
  var makeIssue = (params) => {
2634
- const { data, path: path3, errorMaps, issueData } = params;
2635
- const fullPath = [...path3, ...issueData.path || []];
534
+ const { data, path, errorMaps, issueData } = params;
535
+ const fullPath = [...path, ...issueData.path || []];
2636
536
  const fullIssue = {
2637
537
  ...issueData,
2638
538
  path: fullPath
@@ -2748,11 +648,11 @@ var errorUtil;
2748
648
 
2749
649
  // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
2750
650
  var ParseInputLazyPath = class {
2751
- constructor(parent, value, path3, key) {
651
+ constructor(parent, value, path, key) {
2752
652
  this._cachedPath = [];
2753
653
  this.parent = parent;
2754
654
  this.data = value;
2755
- this._path = path3;
655
+ this._path = path;
2756
656
  this._key = key;
2757
657
  }
2758
658
  get path() {
@@ -6195,22 +4095,23 @@ var coerce = {
6195
4095
  var NEVER = INVALID;
6196
4096
 
6197
4097
  // ../core/dist/index.js
4098
+ import { execa as execa3 } from "execa";
6198
4099
  import { existsSync as existsSync4 } from "fs";
6199
4100
  import { readFile as readFile4 } from "fs/promises";
6200
4101
  import { join as join5 } from "path";
6201
4102
  function detectOs() {
6202
- const platform = os2.platform();
4103
+ const platform = os.platform();
6203
4104
  if (platform === "darwin") return "darwin";
6204
4105
  if (platform === "win32") return "windows";
6205
4106
  return "linux";
6206
4107
  }
6207
4108
  function detectArch() {
6208
- const arch = os2.arch();
4109
+ const arch = os.arch();
6209
4110
  return arch === "arm64" ? "arm64" : "x64";
6210
4111
  }
6211
4112
  function detectGpu() {
6212
- const platform = os2.platform();
6213
- const arch = os2.arch();
4113
+ const platform = os.platform();
4114
+ const arch = os.arch();
6214
4115
  if (platform === "darwin" && arch === "arm64") {
6215
4116
  try {
6216
4117
  const result = execSync("sysctl -n machdep.cpu.brand_string", {
@@ -6278,8 +4179,8 @@ function detectHardware() {
6278
4179
  gpu: gpu.type,
6279
4180
  gpuName: gpu.name,
6280
4181
  cudaVersion: gpu.cudaVersion,
6281
- totalMemoryGb: Math.round(os2.totalmem() / (1024 * 1024 * 1024)),
6282
- cpuCores: os2.cpus().length
4182
+ totalMemoryGb: Math.round(os.totalmem() / (1024 * 1024 * 1024)),
4183
+ cpuCores: os.cpus().length
6283
4184
  };
6284
4185
  }
6285
4186
  function formatHardwareInfo(info) {
@@ -6730,22 +4631,22 @@ async function checkPythonInstalled() {
6730
4631
  }
6731
4632
  }
6732
4633
  async function createPythonEnvironment(options) {
6733
- const { name, path: path3, pythonVersion } = options;
4634
+ const { name, path, pythonVersion } = options;
6734
4635
  const hasUv = await checkUvInstalled();
6735
- const envPath = join(path3, ".venv");
4636
+ const envPath = join(path, ".venv");
6736
4637
  try {
6737
4638
  if (hasUv) {
6738
4639
  const args = ["venv", envPath];
6739
4640
  if (pythonVersion) {
6740
4641
  args.push("--python", pythonVersion);
6741
4642
  }
6742
- await execa("uv", args, { cwd: path3 });
4643
+ await execa("uv", args, { cwd: path });
6743
4644
  } else {
6744
4645
  const hasPython = await checkPythonInstalled();
6745
4646
  if (!hasPython) {
6746
4647
  return { success: false, error: "Python is not installed" };
6747
4648
  }
6748
- await execa("python3", ["-m", "venv", envPath], { cwd: path3 });
4649
+ await execa("python3", ["-m", "venv", envPath], { cwd: path });
6749
4650
  }
6750
4651
  return { success: true };
6751
4652
  } catch (error) {
@@ -6844,21 +4745,21 @@ async function restorePythonEnvironment(envPath, lockfile, onProgress) {
6844
4745
  };
6845
4746
  }
6846
4747
  }
6847
- async function detectPackageManager(path3) {
6848
- if (existsSync(join2(path3, "pnpm-lock.yaml"))) return "pnpm";
6849
- if (existsSync(join2(path3, "yarn.lock"))) return "yarn";
6850
- if (existsSync(join2(path3, "package-lock.json"))) return "npm";
4748
+ async function detectPackageManager(path) {
4749
+ if (existsSync(join2(path, "pnpm-lock.yaml"))) return "pnpm";
4750
+ if (existsSync(join2(path, "yarn.lock"))) return "yarn";
4751
+ if (existsSync(join2(path, "package-lock.json"))) return "npm";
6851
4752
  try {
6852
- await execa("pnpm", ["--version"]);
4753
+ await execa2("pnpm", ["--version"]);
6853
4754
  return "pnpm";
6854
4755
  } catch {
6855
4756
  return "npm";
6856
4757
  }
6857
4758
  }
6858
4759
  async function initNodeEnvironment(options) {
6859
- const { name, path: path3 } = options;
6860
- const packageManager = await detectPackageManager(path3);
6861
- const packageJsonPath = join2(path3, "package.json");
4760
+ const { name, path } = options;
4761
+ const packageManager = await detectPackageManager(path);
4762
+ const packageJsonPath = join2(path, "package.json");
6862
4763
  if (!existsSync(packageJsonPath)) {
6863
4764
  const packageJson = {
6864
4765
  name: name.toLowerCase().replace(/\s+/g, "-"),
@@ -6891,7 +4792,7 @@ async function installNodePackages(envPath, packages, onProgress) {
6891
4792
  for (const spec of packageSpecs) {
6892
4793
  onProgress?.(`Installing ${spec}...`);
6893
4794
  const args = packageManager === "yarn" ? ["add", spec] : ["install", spec];
6894
- await execa(packageManager, args, { cwd: envPath });
4795
+ await execa2(packageManager, args, { cwd: envPath });
6895
4796
  installedPackages.push(spec);
6896
4797
  }
6897
4798
  return { success: true, installedPackages };
@@ -6919,11 +4820,11 @@ async function freezeNodeEnvironment(envPath) {
6919
4820
  }
6920
4821
  if (!existsSync(lockfilePath)) {
6921
4822
  if (packageManager === "pnpm") {
6922
- await execa("pnpm", ["install", "--lockfile-only"], { cwd: envPath });
4823
+ await execa2("pnpm", ["install", "--lockfile-only"], { cwd: envPath });
6923
4824
  } else if (packageManager === "yarn") {
6924
- await execa("yarn", ["install", "--mode", "update-lockfile"], { cwd: envPath });
4825
+ await execa2("yarn", ["install", "--mode", "update-lockfile"], { cwd: envPath });
6925
4826
  } else {
6926
- await execa("npm", ["install", "--package-lock-only"], { cwd: envPath });
4827
+ await execa2("npm", ["install", "--package-lock-only"], { cwd: envPath });
6927
4828
  }
6928
4829
  }
6929
4830
  const lockfile = await readFile2(lockfilePath, "utf-8");
@@ -6952,11 +4853,11 @@ async function restoreNodeEnvironment(envPath, lockfile, onProgress) {
6952
4853
  await writeFile2(lockfilePath, lockfile);
6953
4854
  onProgress?.("Restoring environment from lockfile...");
6954
4855
  if (packageManager === "pnpm") {
6955
- await execa("pnpm", ["install", "--frozen-lockfile"], { cwd: envPath });
4856
+ await execa2("pnpm", ["install", "--frozen-lockfile"], { cwd: envPath });
6956
4857
  } else if (packageManager === "yarn") {
6957
- await execa("yarn", ["install", "--immutable"], { cwd: envPath });
4858
+ await execa2("yarn", ["install", "--immutable"], { cwd: envPath });
6958
4859
  } else {
6959
- await execa("npm", ["ci"], { cwd: envPath });
4860
+ await execa2("npm", ["ci"], { cwd: envPath });
6960
4861
  }
6961
4862
  return { success: true };
6962
4863
  } catch (error) {
@@ -7246,21 +5147,21 @@ var KNOWN_CONFLICTS = [
7246
5147
  suggestion: "Use jax.numpy instead of importing both"
7247
5148
  }
7248
5149
  ];
7249
- async function getInstalledPackages(path3, runtime) {
5150
+ async function getInstalledPackages(path, runtime) {
7250
5151
  if (runtime === "python") {
7251
- return getPythonPackages(path3);
5152
+ return getPythonPackages(path);
7252
5153
  } else {
7253
- return getNodePackages(path3);
5154
+ return getNodePackages(path);
7254
5155
  }
7255
5156
  }
7256
- async function getPythonPackages(path3) {
7257
- const venvPath = join5(path3, ".venv");
5157
+ async function getPythonPackages(path) {
5158
+ const venvPath = join5(path, ".venv");
7258
5159
  if (!existsSync4(venvPath)) {
7259
5160
  return [];
7260
5161
  }
7261
5162
  try {
7262
5163
  const pipPath = join5(venvPath, "bin", "pip");
7263
- const result = await execa(pipPath, ["list", "--format=json"], { cwd: path3 });
5164
+ const result = await execa3(pipPath, ["list", "--format=json"], { cwd: path });
7264
5165
  const packages = JSON.parse(result.stdout);
7265
5166
  return packages.map((pkg) => ({
7266
5167
  name: pkg.name,
@@ -7268,10 +5169,10 @@ async function getPythonPackages(path3) {
7268
5169
  }));
7269
5170
  } catch {
7270
5171
  try {
7271
- const result = await execa(
5172
+ const result = await execa3(
7272
5173
  "uv",
7273
5174
  ["pip", "list", "--format=json", "--python", join5(venvPath, "bin", "python")],
7274
- { cwd: path3 }
5175
+ { cwd: path }
7275
5176
  );
7276
5177
  const packages = JSON.parse(result.stdout);
7277
5178
  return packages.map((pkg) => ({
@@ -7283,8 +5184,8 @@ async function getPythonPackages(path3) {
7283
5184
  }
7284
5185
  }
7285
5186
  }
7286
- async function getNodePackages(path3) {
7287
- const packageJsonPath = join5(path3, "package.json");
5187
+ async function getNodePackages(path) {
5188
+ const packageJsonPath = join5(path, "package.json");
7288
5189
  if (!existsSync4(packageJsonPath)) {
7289
5190
  return [];
7290
5191
  }
@@ -7348,7 +5249,9 @@ function analyzeHealth(packages, conflicts) {
7348
5249
  }
7349
5250
 
7350
5251
  export {
7351
- onExit,
5252
+ __require,
5253
+ __commonJS,
5254
+ __toESM,
7352
5255
  loadState,
7353
5256
  Komodo,
7354
5257
  getInstalledPackages,