@elizaos/plugin-sql 1.0.0-alpha.7 → 1.0.0-beta.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.
@@ -0,0 +1,2100 @@
1
+ import {
2
+ __commonJS,
3
+ __name,
4
+ __require,
5
+ __toESM
6
+ } from "./chunk-I3JSTNED.js";
7
+
8
+ // ../../node_modules/isexe/windows.js
9
+ var require_windows = __commonJS({
10
+ "../../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
+ __name(checkPathExt, "checkPathExt");
33
+ function checkStat(stat, path3, options) {
34
+ if (!stat.isSymbolicLink() && !stat.isFile()) {
35
+ return false;
36
+ }
37
+ return checkPathExt(path3, options);
38
+ }
39
+ __name(checkStat, "checkStat");
40
+ function isexe(path3, options, cb) {
41
+ fs.stat(path3, function(er, stat) {
42
+ cb(er, er ? false : checkStat(stat, path3, options));
43
+ });
44
+ }
45
+ __name(isexe, "isexe");
46
+ function sync(path3, options) {
47
+ return checkStat(fs.statSync(path3), path3, options);
48
+ }
49
+ __name(sync, "sync");
50
+ }
51
+ });
52
+
53
+ // ../../node_modules/isexe/mode.js
54
+ var require_mode = __commonJS({
55
+ "../../node_modules/isexe/mode.js"(exports, module) {
56
+ "use strict";
57
+ module.exports = isexe;
58
+ isexe.sync = sync;
59
+ var fs = __require("fs");
60
+ function isexe(path3, options, cb) {
61
+ fs.stat(path3, function(er, stat) {
62
+ cb(er, er ? false : checkStat(stat, options));
63
+ });
64
+ }
65
+ __name(isexe, "isexe");
66
+ function sync(path3, options) {
67
+ return checkStat(fs.statSync(path3), options);
68
+ }
69
+ __name(sync, "sync");
70
+ function checkStat(stat, options) {
71
+ return stat.isFile() && checkMode(stat, options);
72
+ }
73
+ __name(checkStat, "checkStat");
74
+ function checkMode(stat, options) {
75
+ var mod = stat.mode;
76
+ var uid = stat.uid;
77
+ var gid = stat.gid;
78
+ var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
79
+ var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
80
+ var u = parseInt("100", 8);
81
+ var g = parseInt("010", 8);
82
+ var o = parseInt("001", 8);
83
+ var ug = u | g;
84
+ var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
85
+ return ret;
86
+ }
87
+ __name(checkMode, "checkMode");
88
+ }
89
+ });
90
+
91
+ // ../../node_modules/isexe/index.js
92
+ var require_isexe = __commonJS({
93
+ "../../node_modules/isexe/index.js"(exports, module) {
94
+ "use strict";
95
+ var fs = __require("fs");
96
+ var core;
97
+ if (process.platform === "win32" || global.TESTING_WINDOWS) {
98
+ core = require_windows();
99
+ } else {
100
+ core = require_mode();
101
+ }
102
+ module.exports = isexe;
103
+ isexe.sync = sync;
104
+ function isexe(path3, options, cb) {
105
+ if (typeof options === "function") {
106
+ cb = options;
107
+ options = {};
108
+ }
109
+ if (!cb) {
110
+ if (typeof Promise !== "function") {
111
+ throw new TypeError("callback not provided");
112
+ }
113
+ return new Promise(function(resolve, reject) {
114
+ isexe(path3, options || {}, function(er, is) {
115
+ if (er) {
116
+ reject(er);
117
+ } else {
118
+ resolve(is);
119
+ }
120
+ });
121
+ });
122
+ }
123
+ core(path3, options || {}, function(er, is) {
124
+ if (er) {
125
+ if (er.code === "EACCES" || options && options.ignoreErrors) {
126
+ er = null;
127
+ is = false;
128
+ }
129
+ }
130
+ cb(er, is);
131
+ });
132
+ }
133
+ __name(isexe, "isexe");
134
+ function sync(path3, options) {
135
+ try {
136
+ return core.sync(path3, options || {});
137
+ } catch (er) {
138
+ if (options && options.ignoreErrors || er.code === "EACCES") {
139
+ return false;
140
+ } else {
141
+ throw er;
142
+ }
143
+ }
144
+ }
145
+ __name(sync, "sync");
146
+ }
147
+ });
148
+
149
+ // ../../node_modules/cross-spawn/node_modules/which/which.js
150
+ var require_which = __commonJS({
151
+ "../../node_modules/cross-spawn/node_modules/which/which.js"(exports, module) {
152
+ "use strict";
153
+ var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
154
+ var path3 = __require("path");
155
+ var COLON = isWindows ? ";" : ":";
156
+ var isexe = require_isexe();
157
+ var getNotFoundError = /* @__PURE__ */ __name((cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }), "getNotFoundError");
158
+ var getPathInfo = /* @__PURE__ */ __name((cmd, opt) => {
159
+ const colon = opt.colon || COLON;
160
+ const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
161
+ // windows always checks the cwd first
162
+ ...isWindows ? [process.cwd()] : [],
163
+ ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
164
+ "").split(colon)
165
+ ];
166
+ const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
167
+ const pathExt = isWindows ? pathExtExe.split(colon) : [""];
168
+ if (isWindows) {
169
+ if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
170
+ pathExt.unshift("");
171
+ }
172
+ return {
173
+ pathEnv,
174
+ pathExt,
175
+ pathExtExe
176
+ };
177
+ }, "getPathInfo");
178
+ var which = /* @__PURE__ */ __name((cmd, opt, cb) => {
179
+ if (typeof opt === "function") {
180
+ cb = opt;
181
+ opt = {};
182
+ }
183
+ if (!opt)
184
+ opt = {};
185
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
186
+ const found = [];
187
+ const step = /* @__PURE__ */ __name((i) => new Promise((resolve, reject) => {
188
+ if (i === pathEnv.length)
189
+ return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
190
+ const ppRaw = pathEnv[i];
191
+ const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
192
+ const pCmd = path3.join(pathPart, cmd);
193
+ const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
194
+ resolve(subStep(p, i, 0));
195
+ }), "step");
196
+ const subStep = /* @__PURE__ */ __name((p, i, ii) => new Promise((resolve, reject) => {
197
+ if (ii === pathExt.length)
198
+ return resolve(step(i + 1));
199
+ const ext = pathExt[ii];
200
+ isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
201
+ if (!er && is) {
202
+ if (opt.all)
203
+ found.push(p + ext);
204
+ else
205
+ return resolve(p + ext);
206
+ }
207
+ return resolve(subStep(p, i, ii + 1));
208
+ });
209
+ }), "subStep");
210
+ return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
211
+ }, "which");
212
+ var whichSync = /* @__PURE__ */ __name((cmd, opt) => {
213
+ opt = opt || {};
214
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
215
+ const found = [];
216
+ for (let i = 0; i < pathEnv.length; i++) {
217
+ const ppRaw = pathEnv[i];
218
+ const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
219
+ const pCmd = path3.join(pathPart, cmd);
220
+ const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
221
+ for (let j = 0; j < pathExt.length; j++) {
222
+ const cur = p + pathExt[j];
223
+ try {
224
+ const is = isexe.sync(cur, { pathExt: pathExtExe });
225
+ if (is) {
226
+ if (opt.all)
227
+ found.push(cur);
228
+ else
229
+ return cur;
230
+ }
231
+ } catch (ex) {
232
+ }
233
+ }
234
+ }
235
+ if (opt.all && found.length)
236
+ return found;
237
+ if (opt.nothrow)
238
+ return null;
239
+ throw getNotFoundError(cmd);
240
+ }, "whichSync");
241
+ module.exports = which;
242
+ which.sync = whichSync;
243
+ }
244
+ });
245
+
246
+ // ../../node_modules/path-key/index.js
247
+ var require_path_key = __commonJS({
248
+ "../../node_modules/path-key/index.js"(exports, module) {
249
+ "use strict";
250
+ var pathKey2 = /* @__PURE__ */ __name((options = {}) => {
251
+ const environment = options.env || process.env;
252
+ const platform = options.platform || process.platform;
253
+ if (platform !== "win32") {
254
+ return "PATH";
255
+ }
256
+ return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
257
+ }, "pathKey");
258
+ module.exports = pathKey2;
259
+ module.exports.default = pathKey2;
260
+ }
261
+ });
262
+
263
+ // ../../node_modules/cross-spawn/lib/util/resolveCommand.js
264
+ var require_resolveCommand = __commonJS({
265
+ "../../node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
266
+ "use strict";
267
+ var path3 = __require("path");
268
+ var which = require_which();
269
+ var getPathKey = require_path_key();
270
+ function resolveCommandAttempt(parsed, withoutPathExt) {
271
+ const env = parsed.options.env || process.env;
272
+ const cwd = process.cwd();
273
+ const hasCustomCwd = parsed.options.cwd != null;
274
+ const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
275
+ if (shouldSwitchCwd) {
276
+ try {
277
+ process.chdir(parsed.options.cwd);
278
+ } catch (err) {
279
+ }
280
+ }
281
+ let resolved;
282
+ try {
283
+ resolved = which.sync(parsed.command, {
284
+ path: env[getPathKey({ env })],
285
+ pathExt: withoutPathExt ? path3.delimiter : void 0
286
+ });
287
+ } catch (e) {
288
+ } finally {
289
+ if (shouldSwitchCwd) {
290
+ process.chdir(cwd);
291
+ }
292
+ }
293
+ if (resolved) {
294
+ resolved = path3.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
295
+ }
296
+ return resolved;
297
+ }
298
+ __name(resolveCommandAttempt, "resolveCommandAttempt");
299
+ function resolveCommand(parsed) {
300
+ return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
301
+ }
302
+ __name(resolveCommand, "resolveCommand");
303
+ module.exports = resolveCommand;
304
+ }
305
+ });
306
+
307
+ // ../../node_modules/cross-spawn/lib/util/escape.js
308
+ var require_escape = __commonJS({
309
+ "../../node_modules/cross-spawn/lib/util/escape.js"(exports, module) {
310
+ "use strict";
311
+ var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
312
+ function escapeCommand(arg) {
313
+ arg = arg.replace(metaCharsRegExp, "^$1");
314
+ return arg;
315
+ }
316
+ __name(escapeCommand, "escapeCommand");
317
+ function escapeArgument(arg, doubleEscapeMetaChars) {
318
+ arg = `${arg}`;
319
+ arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
320
+ arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
321
+ arg = `"${arg}"`;
322
+ arg = arg.replace(metaCharsRegExp, "^$1");
323
+ if (doubleEscapeMetaChars) {
324
+ arg = arg.replace(metaCharsRegExp, "^$1");
325
+ }
326
+ return arg;
327
+ }
328
+ __name(escapeArgument, "escapeArgument");
329
+ module.exports.command = escapeCommand;
330
+ module.exports.argument = escapeArgument;
331
+ }
332
+ });
333
+
334
+ // ../../node_modules/shebang-regex/index.js
335
+ var require_shebang_regex = __commonJS({
336
+ "../../node_modules/shebang-regex/index.js"(exports, module) {
337
+ "use strict";
338
+ module.exports = /^#!(.*)/;
339
+ }
340
+ });
341
+
342
+ // ../../node_modules/shebang-command/index.js
343
+ var require_shebang_command = __commonJS({
344
+ "../../node_modules/shebang-command/index.js"(exports, module) {
345
+ "use strict";
346
+ var shebangRegex = require_shebang_regex();
347
+ module.exports = (string = "") => {
348
+ const match = string.match(shebangRegex);
349
+ if (!match) {
350
+ return null;
351
+ }
352
+ const [path3, argument] = match[0].replace(/#! ?/, "").split(" ");
353
+ const binary = path3.split("/").pop();
354
+ if (binary === "env") {
355
+ return argument;
356
+ }
357
+ return argument ? `${binary} ${argument}` : binary;
358
+ };
359
+ }
360
+ });
361
+
362
+ // ../../node_modules/cross-spawn/lib/util/readShebang.js
363
+ var require_readShebang = __commonJS({
364
+ "../../node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
365
+ "use strict";
366
+ var fs = __require("fs");
367
+ var shebangCommand = require_shebang_command();
368
+ function readShebang(command) {
369
+ const size = 150;
370
+ const buffer = Buffer.alloc(size);
371
+ let fd;
372
+ try {
373
+ fd = fs.openSync(command, "r");
374
+ fs.readSync(fd, buffer, 0, size, 0);
375
+ fs.closeSync(fd);
376
+ } catch (e) {
377
+ }
378
+ return shebangCommand(buffer.toString());
379
+ }
380
+ __name(readShebang, "readShebang");
381
+ module.exports = readShebang;
382
+ }
383
+ });
384
+
385
+ // ../../node_modules/cross-spawn/lib/parse.js
386
+ var require_parse = __commonJS({
387
+ "../../node_modules/cross-spawn/lib/parse.js"(exports, module) {
388
+ "use strict";
389
+ var path3 = __require("path");
390
+ var resolveCommand = require_resolveCommand();
391
+ var escape = require_escape();
392
+ var readShebang = require_readShebang();
393
+ var isWin = process.platform === "win32";
394
+ var isExecutableRegExp = /\.(?:com|exe)$/i;
395
+ var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
396
+ function detectShebang(parsed) {
397
+ parsed.file = resolveCommand(parsed);
398
+ const shebang = parsed.file && readShebang(parsed.file);
399
+ if (shebang) {
400
+ parsed.args.unshift(parsed.file);
401
+ parsed.command = shebang;
402
+ return resolveCommand(parsed);
403
+ }
404
+ return parsed.file;
405
+ }
406
+ __name(detectShebang, "detectShebang");
407
+ function parseNonShell(parsed) {
408
+ if (!isWin) {
409
+ return parsed;
410
+ }
411
+ const commandFile = detectShebang(parsed);
412
+ const needsShell = !isExecutableRegExp.test(commandFile);
413
+ if (parsed.options.forceShell || needsShell) {
414
+ const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
415
+ parsed.command = path3.normalize(parsed.command);
416
+ parsed.command = escape.command(parsed.command);
417
+ parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
418
+ const shellCommand = [parsed.command].concat(parsed.args).join(" ");
419
+ parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
420
+ parsed.command = process.env.comspec || "cmd.exe";
421
+ parsed.options.windowsVerbatimArguments = true;
422
+ }
423
+ return parsed;
424
+ }
425
+ __name(parseNonShell, "parseNonShell");
426
+ function parse(command, args, options) {
427
+ if (args && !Array.isArray(args)) {
428
+ options = args;
429
+ args = null;
430
+ }
431
+ args = args ? args.slice(0) : [];
432
+ options = Object.assign({}, options);
433
+ const parsed = {
434
+ command,
435
+ args,
436
+ options,
437
+ file: void 0,
438
+ original: {
439
+ command,
440
+ args
441
+ }
442
+ };
443
+ return options.shell ? parsed : parseNonShell(parsed);
444
+ }
445
+ __name(parse, "parse");
446
+ module.exports = parse;
447
+ }
448
+ });
449
+
450
+ // ../../node_modules/cross-spawn/lib/enoent.js
451
+ var require_enoent = __commonJS({
452
+ "../../node_modules/cross-spawn/lib/enoent.js"(exports, module) {
453
+ "use strict";
454
+ var isWin = process.platform === "win32";
455
+ function notFoundError(original, syscall) {
456
+ return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
457
+ code: "ENOENT",
458
+ errno: "ENOENT",
459
+ syscall: `${syscall} ${original.command}`,
460
+ path: original.command,
461
+ spawnargs: original.args
462
+ });
463
+ }
464
+ __name(notFoundError, "notFoundError");
465
+ function hookChildProcess(cp, parsed) {
466
+ if (!isWin) {
467
+ return;
468
+ }
469
+ const originalEmit = cp.emit;
470
+ cp.emit = function(name, arg1) {
471
+ if (name === "exit") {
472
+ const err = verifyENOENT(arg1, parsed);
473
+ if (err) {
474
+ return originalEmit.call(cp, "error", err);
475
+ }
476
+ }
477
+ return originalEmit.apply(cp, arguments);
478
+ };
479
+ }
480
+ __name(hookChildProcess, "hookChildProcess");
481
+ function verifyENOENT(status, parsed) {
482
+ if (isWin && status === 1 && !parsed.file) {
483
+ return notFoundError(parsed.original, "spawn");
484
+ }
485
+ return null;
486
+ }
487
+ __name(verifyENOENT, "verifyENOENT");
488
+ function verifyENOENTSync(status, parsed) {
489
+ if (isWin && status === 1 && !parsed.file) {
490
+ return notFoundError(parsed.original, "spawnSync");
491
+ }
492
+ return null;
493
+ }
494
+ __name(verifyENOENTSync, "verifyENOENTSync");
495
+ module.exports = {
496
+ hookChildProcess,
497
+ verifyENOENT,
498
+ verifyENOENTSync,
499
+ notFoundError
500
+ };
501
+ }
502
+ });
503
+
504
+ // ../../node_modules/cross-spawn/index.js
505
+ var require_cross_spawn = __commonJS({
506
+ "../../node_modules/cross-spawn/index.js"(exports, module) {
507
+ "use strict";
508
+ var cp = __require("child_process");
509
+ var parse = require_parse();
510
+ var enoent = require_enoent();
511
+ function spawn(command, args, options) {
512
+ const parsed = parse(command, args, options);
513
+ const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
514
+ enoent.hookChildProcess(spawned, parsed);
515
+ return spawned;
516
+ }
517
+ __name(spawn, "spawn");
518
+ function spawnSync(command, args, options) {
519
+ const parsed = parse(command, args, options);
520
+ const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
521
+ result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
522
+ return result;
523
+ }
524
+ __name(spawnSync, "spawnSync");
525
+ module.exports = spawn;
526
+ module.exports.spawn = spawn;
527
+ module.exports.sync = spawnSync;
528
+ module.exports._parse = parse;
529
+ module.exports._enoent = enoent;
530
+ }
531
+ });
532
+
533
+ // ../../node_modules/signal-exit/signals.js
534
+ var require_signals = __commonJS({
535
+ "../../node_modules/signal-exit/signals.js"(exports, module) {
536
+ "use strict";
537
+ module.exports = [
538
+ "SIGABRT",
539
+ "SIGALRM",
540
+ "SIGHUP",
541
+ "SIGINT",
542
+ "SIGTERM"
543
+ ];
544
+ if (process.platform !== "win32") {
545
+ module.exports.push(
546
+ "SIGVTALRM",
547
+ "SIGXCPU",
548
+ "SIGXFSZ",
549
+ "SIGUSR2",
550
+ "SIGTRAP",
551
+ "SIGSYS",
552
+ "SIGQUIT",
553
+ "SIGIOT"
554
+ // should detect profiler and enable/disable accordingly.
555
+ // see #21
556
+ // 'SIGPROF'
557
+ );
558
+ }
559
+ if (process.platform === "linux") {
560
+ module.exports.push(
561
+ "SIGIO",
562
+ "SIGPOLL",
563
+ "SIGPWR",
564
+ "SIGSTKFLT",
565
+ "SIGUNUSED"
566
+ );
567
+ }
568
+ }
569
+ });
570
+
571
+ // ../../node_modules/signal-exit/index.js
572
+ var require_signal_exit = __commonJS({
573
+ "../../node_modules/signal-exit/index.js"(exports, module) {
574
+ "use strict";
575
+ var process6 = global.process;
576
+ var processOk = /* @__PURE__ */ __name(function(process7) {
577
+ return 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";
578
+ }, "processOk");
579
+ if (!processOk(process6)) {
580
+ module.exports = function() {
581
+ return function() {
582
+ };
583
+ };
584
+ } else {
585
+ assert = __require("assert");
586
+ signals = require_signals();
587
+ isWin = /^win/i.test(process6.platform);
588
+ EE = __require("events");
589
+ if (typeof EE !== "function") {
590
+ EE = EE.EventEmitter;
591
+ }
592
+ if (process6.__signal_exit_emitter__) {
593
+ emitter = process6.__signal_exit_emitter__;
594
+ } else {
595
+ emitter = process6.__signal_exit_emitter__ = new EE();
596
+ emitter.count = 0;
597
+ emitter.emitted = {};
598
+ }
599
+ if (!emitter.infinite) {
600
+ emitter.setMaxListeners(Infinity);
601
+ emitter.infinite = true;
602
+ }
603
+ module.exports = function(cb, opts) {
604
+ if (!processOk(global.process)) {
605
+ return function() {
606
+ };
607
+ }
608
+ assert.equal(typeof cb, "function", "a callback must be provided for exit handler");
609
+ if (loaded === false) {
610
+ load();
611
+ }
612
+ var ev = "exit";
613
+ if (opts && opts.alwaysLast) {
614
+ ev = "afterexit";
615
+ }
616
+ var remove = /* @__PURE__ */ __name(function() {
617
+ emitter.removeListener(ev, cb);
618
+ if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) {
619
+ unload();
620
+ }
621
+ }, "remove");
622
+ emitter.on(ev, cb);
623
+ return remove;
624
+ };
625
+ unload = /* @__PURE__ */ __name(function unload2() {
626
+ if (!loaded || !processOk(global.process)) {
627
+ return;
628
+ }
629
+ loaded = false;
630
+ signals.forEach(function(sig) {
631
+ try {
632
+ process6.removeListener(sig, sigListeners[sig]);
633
+ } catch (er) {
634
+ }
635
+ });
636
+ process6.emit = originalProcessEmit;
637
+ process6.reallyExit = originalProcessReallyExit;
638
+ emitter.count -= 1;
639
+ }, "unload");
640
+ module.exports.unload = unload;
641
+ emit = /* @__PURE__ */ __name(function emit2(event, code, signal) {
642
+ if (emitter.emitted[event]) {
643
+ return;
644
+ }
645
+ emitter.emitted[event] = true;
646
+ emitter.emit(event, code, signal);
647
+ }, "emit");
648
+ sigListeners = {};
649
+ signals.forEach(function(sig) {
650
+ sigListeners[sig] = /* @__PURE__ */ __name(function listener() {
651
+ if (!processOk(global.process)) {
652
+ return;
653
+ }
654
+ var listeners = process6.listeners(sig);
655
+ if (listeners.length === emitter.count) {
656
+ unload();
657
+ emit("exit", null, sig);
658
+ emit("afterexit", null, sig);
659
+ if (isWin && sig === "SIGHUP") {
660
+ sig = "SIGINT";
661
+ }
662
+ process6.kill(process6.pid, sig);
663
+ }
664
+ }, "listener");
665
+ });
666
+ module.exports.signals = function() {
667
+ return signals;
668
+ };
669
+ loaded = false;
670
+ load = /* @__PURE__ */ __name(function load2() {
671
+ if (loaded || !processOk(global.process)) {
672
+ return;
673
+ }
674
+ loaded = true;
675
+ emitter.count += 1;
676
+ signals = signals.filter(function(sig) {
677
+ try {
678
+ process6.on(sig, sigListeners[sig]);
679
+ return true;
680
+ } catch (er) {
681
+ return false;
682
+ }
683
+ });
684
+ process6.emit = processEmit;
685
+ process6.reallyExit = processReallyExit;
686
+ }, "load");
687
+ module.exports.load = load;
688
+ originalProcessReallyExit = process6.reallyExit;
689
+ processReallyExit = /* @__PURE__ */ __name(function processReallyExit2(code) {
690
+ if (!processOk(global.process)) {
691
+ return;
692
+ }
693
+ process6.exitCode = code || /* istanbul ignore next */
694
+ 0;
695
+ emit("exit", process6.exitCode, null);
696
+ emit("afterexit", process6.exitCode, null);
697
+ originalProcessReallyExit.call(process6, process6.exitCode);
698
+ }, "processReallyExit");
699
+ originalProcessEmit = process6.emit;
700
+ processEmit = /* @__PURE__ */ __name(function processEmit2(ev, arg) {
701
+ if (ev === "exit" && processOk(global.process)) {
702
+ if (arg !== void 0) {
703
+ process6.exitCode = arg;
704
+ }
705
+ var ret = originalProcessEmit.apply(this, arguments);
706
+ emit("exit", process6.exitCode, null);
707
+ emit("afterexit", process6.exitCode, null);
708
+ return ret;
709
+ } else {
710
+ return originalProcessEmit.apply(this, arguments);
711
+ }
712
+ }, "processEmit");
713
+ }
714
+ var assert;
715
+ var signals;
716
+ var isWin;
717
+ var EE;
718
+ var emitter;
719
+ var unload;
720
+ var emit;
721
+ var sigListeners;
722
+ var loaded;
723
+ var load;
724
+ var originalProcessReallyExit;
725
+ var processReallyExit;
726
+ var originalProcessEmit;
727
+ var processEmit;
728
+ }
729
+ });
730
+
731
+ // ../../node_modules/execa/node_modules/get-stream/buffer-stream.js
732
+ var require_buffer_stream = __commonJS({
733
+ "../../node_modules/execa/node_modules/get-stream/buffer-stream.js"(exports, module) {
734
+ "use strict";
735
+ var { PassThrough: PassThroughStream } = __require("stream");
736
+ module.exports = (options) => {
737
+ options = { ...options };
738
+ const { array } = options;
739
+ let { encoding } = options;
740
+ const isBuffer = encoding === "buffer";
741
+ let objectMode = false;
742
+ if (array) {
743
+ objectMode = !(encoding || isBuffer);
744
+ } else {
745
+ encoding = encoding || "utf8";
746
+ }
747
+ if (isBuffer) {
748
+ encoding = null;
749
+ }
750
+ const stream = new PassThroughStream({ objectMode });
751
+ if (encoding) {
752
+ stream.setEncoding(encoding);
753
+ }
754
+ let length = 0;
755
+ const chunks = [];
756
+ stream.on("data", (chunk) => {
757
+ chunks.push(chunk);
758
+ if (objectMode) {
759
+ length = chunks.length;
760
+ } else {
761
+ length += chunk.length;
762
+ }
763
+ });
764
+ stream.getBufferedValue = () => {
765
+ if (array) {
766
+ return chunks;
767
+ }
768
+ return isBuffer ? Buffer.concat(chunks, length) : chunks.join("");
769
+ };
770
+ stream.getBufferedLength = () => length;
771
+ return stream;
772
+ };
773
+ }
774
+ });
775
+
776
+ // ../../node_modules/execa/node_modules/get-stream/index.js
777
+ var require_get_stream = __commonJS({
778
+ "../../node_modules/execa/node_modules/get-stream/index.js"(exports, module) {
779
+ "use strict";
780
+ var { constants: BufferConstants } = __require("buffer");
781
+ var stream = __require("stream");
782
+ var { promisify } = __require("util");
783
+ var bufferStream = require_buffer_stream();
784
+ var streamPipelinePromisified = promisify(stream.pipeline);
785
+ var MaxBufferError = class extends Error {
786
+ static {
787
+ __name(this, "MaxBufferError");
788
+ }
789
+ constructor() {
790
+ super("maxBuffer exceeded");
791
+ this.name = "MaxBufferError";
792
+ }
793
+ };
794
+ async function getStream2(inputStream, options) {
795
+ if (!inputStream) {
796
+ throw new Error("Expected a stream");
797
+ }
798
+ options = {
799
+ maxBuffer: Infinity,
800
+ ...options
801
+ };
802
+ const { maxBuffer } = options;
803
+ const stream2 = bufferStream(options);
804
+ await new Promise((resolve, reject) => {
805
+ const rejectPromise = /* @__PURE__ */ __name((error) => {
806
+ if (error && stream2.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
807
+ error.bufferedData = stream2.getBufferedValue();
808
+ }
809
+ reject(error);
810
+ }, "rejectPromise");
811
+ (async () => {
812
+ try {
813
+ await streamPipelinePromisified(inputStream, stream2);
814
+ resolve();
815
+ } catch (error) {
816
+ rejectPromise(error);
817
+ }
818
+ })();
819
+ stream2.on("data", () => {
820
+ if (stream2.getBufferedLength() > maxBuffer) {
821
+ rejectPromise(new MaxBufferError());
822
+ }
823
+ });
824
+ });
825
+ return stream2.getBufferedValue();
826
+ }
827
+ __name(getStream2, "getStream");
828
+ module.exports = getStream2;
829
+ module.exports.buffer = (stream2, options) => getStream2(stream2, { ...options, encoding: "buffer" });
830
+ module.exports.array = (stream2, options) => getStream2(stream2, { ...options, array: true });
831
+ module.exports.MaxBufferError = MaxBufferError;
832
+ }
833
+ });
834
+
835
+ // ../../node_modules/merge-stream/index.js
836
+ var require_merge_stream = __commonJS({
837
+ "../../node_modules/merge-stream/index.js"(exports, module) {
838
+ "use strict";
839
+ var { PassThrough } = __require("stream");
840
+ module.exports = function() {
841
+ var sources = [];
842
+ var output = new PassThrough({ objectMode: true });
843
+ output.setMaxListeners(0);
844
+ output.add = add;
845
+ output.isEmpty = isEmpty;
846
+ output.on("unpipe", remove);
847
+ Array.prototype.slice.call(arguments).forEach(add);
848
+ return output;
849
+ function add(source) {
850
+ if (Array.isArray(source)) {
851
+ source.forEach(add);
852
+ return this;
853
+ }
854
+ sources.push(source);
855
+ source.once("end", remove.bind(null, source));
856
+ source.once("error", output.emit.bind(output, "error"));
857
+ source.pipe(output, { end: false });
858
+ return this;
859
+ }
860
+ __name(add, "add");
861
+ function isEmpty() {
862
+ return sources.length == 0;
863
+ }
864
+ __name(isEmpty, "isEmpty");
865
+ function remove(source) {
866
+ sources = sources.filter(function(it) {
867
+ return it !== source;
868
+ });
869
+ if (!sources.length && output.readable) {
870
+ output.end();
871
+ }
872
+ }
873
+ __name(remove, "remove");
874
+ };
875
+ }
876
+ });
877
+
878
+ // ../../node_modules/execa/index.js
879
+ var import_cross_spawn = __toESM(require_cross_spawn(), 1);
880
+ import { Buffer as Buffer3 } from "node:buffer";
881
+ import path2 from "node:path";
882
+ import childProcess from "node:child_process";
883
+ import process5 from "node:process";
884
+
885
+ // ../../node_modules/strip-final-newline/index.js
886
+ function stripFinalNewline(input) {
887
+ const LF = typeof input === "string" ? "\n" : "\n".charCodeAt();
888
+ const CR = typeof input === "string" ? "\r" : "\r".charCodeAt();
889
+ if (input[input.length - 1] === LF) {
890
+ input = input.slice(0, -1);
891
+ }
892
+ if (input[input.length - 1] === CR) {
893
+ input = input.slice(0, -1);
894
+ }
895
+ return input;
896
+ }
897
+ __name(stripFinalNewline, "stripFinalNewline");
898
+
899
+ // ../../node_modules/npm-run-path/index.js
900
+ import process2 from "node:process";
901
+ import path from "node:path";
902
+ import { fileURLToPath } from "node:url";
903
+
904
+ // ../../node_modules/npm-run-path/node_modules/path-key/index.js
905
+ function pathKey(options = {}) {
906
+ const {
907
+ env = process.env,
908
+ platform = process.platform
909
+ } = options;
910
+ if (platform !== "win32") {
911
+ return "PATH";
912
+ }
913
+ return Object.keys(env).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
914
+ }
915
+ __name(pathKey, "pathKey");
916
+
917
+ // ../../node_modules/npm-run-path/index.js
918
+ var npmRunPath = /* @__PURE__ */ __name(({
919
+ cwd = process2.cwd(),
920
+ path: pathOption = process2.env[pathKey()],
921
+ preferLocal = true,
922
+ execPath = process2.execPath,
923
+ addExecPath = true
924
+ } = {}) => {
925
+ const cwdString = cwd instanceof URL ? fileURLToPath(cwd) : cwd;
926
+ const cwdPath = path.resolve(cwdString);
927
+ const result = [];
928
+ if (preferLocal) {
929
+ applyPreferLocal(result, cwdPath);
930
+ }
931
+ if (addExecPath) {
932
+ applyExecPath(result, execPath, cwdPath);
933
+ }
934
+ return [...result, pathOption].join(path.delimiter);
935
+ }, "npmRunPath");
936
+ var applyPreferLocal = /* @__PURE__ */ __name((result, cwdPath) => {
937
+ let previous;
938
+ while (previous !== cwdPath) {
939
+ result.push(path.join(cwdPath, "node_modules/.bin"));
940
+ previous = cwdPath;
941
+ cwdPath = path.resolve(cwdPath, "..");
942
+ }
943
+ }, "applyPreferLocal");
944
+ var applyExecPath = /* @__PURE__ */ __name((result, execPath, cwdPath) => {
945
+ const execPathString = execPath instanceof URL ? fileURLToPath(execPath) : execPath;
946
+ result.push(path.resolve(cwdPath, execPathString, ".."));
947
+ }, "applyExecPath");
948
+ var npmRunPathEnv = /* @__PURE__ */ __name(({ env = process2.env, ...options } = {}) => {
949
+ env = { ...env };
950
+ const pathName = pathKey({ env });
951
+ options.path = env[pathName];
952
+ env[pathName] = npmRunPath(options);
953
+ return env;
954
+ }, "npmRunPathEnv");
955
+
956
+ // ../../node_modules/mimic-fn/index.js
957
+ var copyProperty = /* @__PURE__ */ __name((to, from, property, ignoreNonConfigurable) => {
958
+ if (property === "length" || property === "prototype") {
959
+ return;
960
+ }
961
+ if (property === "arguments" || property === "caller") {
962
+ return;
963
+ }
964
+ const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
965
+ const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
966
+ if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
967
+ return;
968
+ }
969
+ Object.defineProperty(to, property, fromDescriptor);
970
+ }, "copyProperty");
971
+ var canCopyProperty = /* @__PURE__ */ __name(function(toDescriptor, fromDescriptor) {
972
+ return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
973
+ }, "canCopyProperty");
974
+ var changePrototype = /* @__PURE__ */ __name((to, from) => {
975
+ const fromPrototype = Object.getPrototypeOf(from);
976
+ if (fromPrototype === Object.getPrototypeOf(to)) {
977
+ return;
978
+ }
979
+ Object.setPrototypeOf(to, fromPrototype);
980
+ }, "changePrototype");
981
+ var wrappedToString = /* @__PURE__ */ __name((withName, fromBody) => `/* Wrapped ${withName}*/
982
+ ${fromBody}`, "wrappedToString");
983
+ var toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
984
+ var toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
985
+ var changeToString = /* @__PURE__ */ __name((to, from, name) => {
986
+ const withName = name === "" ? "" : `with ${name.trim()}() `;
987
+ const newToString = wrappedToString.bind(null, withName, from.toString());
988
+ Object.defineProperty(newToString, "name", toStringName);
989
+ Object.defineProperty(to, "toString", { ...toStringDescriptor, value: newToString });
990
+ }, "changeToString");
991
+ function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
992
+ const { name } = to;
993
+ for (const property of Reflect.ownKeys(from)) {
994
+ copyProperty(to, from, property, ignoreNonConfigurable);
995
+ }
996
+ changePrototype(to, from);
997
+ changeToString(to, from, name);
998
+ return to;
999
+ }
1000
+ __name(mimicFunction, "mimicFunction");
1001
+
1002
+ // ../../node_modules/onetime/index.js
1003
+ var calledFunctions = /* @__PURE__ */ new WeakMap();
1004
+ var onetime = /* @__PURE__ */ __name((function_, options = {}) => {
1005
+ if (typeof function_ !== "function") {
1006
+ throw new TypeError("Expected a function");
1007
+ }
1008
+ let returnValue;
1009
+ let callCount = 0;
1010
+ const functionName = function_.displayName || function_.name || "<anonymous>";
1011
+ const onetime2 = /* @__PURE__ */ __name(function(...arguments_) {
1012
+ calledFunctions.set(onetime2, ++callCount);
1013
+ if (callCount === 1) {
1014
+ returnValue = function_.apply(this, arguments_);
1015
+ function_ = null;
1016
+ } else if (options.throw === true) {
1017
+ throw new Error(`Function \`${functionName}\` can only be called once`);
1018
+ }
1019
+ return returnValue;
1020
+ }, "onetime");
1021
+ mimicFunction(onetime2, function_);
1022
+ calledFunctions.set(onetime2, callCount);
1023
+ return onetime2;
1024
+ }, "onetime");
1025
+ onetime.callCount = (function_) => {
1026
+ if (!calledFunctions.has(function_)) {
1027
+ throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
1028
+ }
1029
+ return calledFunctions.get(function_);
1030
+ };
1031
+ var onetime_default = onetime;
1032
+
1033
+ // ../../node_modules/execa/lib/error.js
1034
+ import process3 from "node:process";
1035
+
1036
+ // ../../node_modules/human-signals/build/src/main.js
1037
+ import { constants as constants2 } from "node:os";
1038
+
1039
+ // ../../node_modules/human-signals/build/src/realtime.js
1040
+ var getRealtimeSignals = /* @__PURE__ */ __name(() => {
1041
+ const length = SIGRTMAX - SIGRTMIN + 1;
1042
+ return Array.from({ length }, getRealtimeSignal);
1043
+ }, "getRealtimeSignals");
1044
+ var getRealtimeSignal = /* @__PURE__ */ __name((value, index) => ({
1045
+ name: `SIGRT${index + 1}`,
1046
+ number: SIGRTMIN + index,
1047
+ action: "terminate",
1048
+ description: "Application-specific signal (realtime)",
1049
+ standard: "posix"
1050
+ }), "getRealtimeSignal");
1051
+ var SIGRTMIN = 34;
1052
+ var SIGRTMAX = 64;
1053
+
1054
+ // ../../node_modules/human-signals/build/src/signals.js
1055
+ import { constants } from "node:os";
1056
+
1057
+ // ../../node_modules/human-signals/build/src/core.js
1058
+ var SIGNALS = [
1059
+ {
1060
+ name: "SIGHUP",
1061
+ number: 1,
1062
+ action: "terminate",
1063
+ description: "Terminal closed",
1064
+ standard: "posix"
1065
+ },
1066
+ {
1067
+ name: "SIGINT",
1068
+ number: 2,
1069
+ action: "terminate",
1070
+ description: "User interruption with CTRL-C",
1071
+ standard: "ansi"
1072
+ },
1073
+ {
1074
+ name: "SIGQUIT",
1075
+ number: 3,
1076
+ action: "core",
1077
+ description: "User interruption with CTRL-\\",
1078
+ standard: "posix"
1079
+ },
1080
+ {
1081
+ name: "SIGILL",
1082
+ number: 4,
1083
+ action: "core",
1084
+ description: "Invalid machine instruction",
1085
+ standard: "ansi"
1086
+ },
1087
+ {
1088
+ name: "SIGTRAP",
1089
+ number: 5,
1090
+ action: "core",
1091
+ description: "Debugger breakpoint",
1092
+ standard: "posix"
1093
+ },
1094
+ {
1095
+ name: "SIGABRT",
1096
+ number: 6,
1097
+ action: "core",
1098
+ description: "Aborted",
1099
+ standard: "ansi"
1100
+ },
1101
+ {
1102
+ name: "SIGIOT",
1103
+ number: 6,
1104
+ action: "core",
1105
+ description: "Aborted",
1106
+ standard: "bsd"
1107
+ },
1108
+ {
1109
+ name: "SIGBUS",
1110
+ number: 7,
1111
+ action: "core",
1112
+ description: "Bus error due to misaligned, non-existing address or paging error",
1113
+ standard: "bsd"
1114
+ },
1115
+ {
1116
+ name: "SIGEMT",
1117
+ number: 7,
1118
+ action: "terminate",
1119
+ description: "Command should be emulated but is not implemented",
1120
+ standard: "other"
1121
+ },
1122
+ {
1123
+ name: "SIGFPE",
1124
+ number: 8,
1125
+ action: "core",
1126
+ description: "Floating point arithmetic error",
1127
+ standard: "ansi"
1128
+ },
1129
+ {
1130
+ name: "SIGKILL",
1131
+ number: 9,
1132
+ action: "terminate",
1133
+ description: "Forced termination",
1134
+ standard: "posix",
1135
+ forced: true
1136
+ },
1137
+ {
1138
+ name: "SIGUSR1",
1139
+ number: 10,
1140
+ action: "terminate",
1141
+ description: "Application-specific signal",
1142
+ standard: "posix"
1143
+ },
1144
+ {
1145
+ name: "SIGSEGV",
1146
+ number: 11,
1147
+ action: "core",
1148
+ description: "Segmentation fault",
1149
+ standard: "ansi"
1150
+ },
1151
+ {
1152
+ name: "SIGUSR2",
1153
+ number: 12,
1154
+ action: "terminate",
1155
+ description: "Application-specific signal",
1156
+ standard: "posix"
1157
+ },
1158
+ {
1159
+ name: "SIGPIPE",
1160
+ number: 13,
1161
+ action: "terminate",
1162
+ description: "Broken pipe or socket",
1163
+ standard: "posix"
1164
+ },
1165
+ {
1166
+ name: "SIGALRM",
1167
+ number: 14,
1168
+ action: "terminate",
1169
+ description: "Timeout or timer",
1170
+ standard: "posix"
1171
+ },
1172
+ {
1173
+ name: "SIGTERM",
1174
+ number: 15,
1175
+ action: "terminate",
1176
+ description: "Termination",
1177
+ standard: "ansi"
1178
+ },
1179
+ {
1180
+ name: "SIGSTKFLT",
1181
+ number: 16,
1182
+ action: "terminate",
1183
+ description: "Stack is empty or overflowed",
1184
+ standard: "other"
1185
+ },
1186
+ {
1187
+ name: "SIGCHLD",
1188
+ number: 17,
1189
+ action: "ignore",
1190
+ description: "Child process terminated, paused or unpaused",
1191
+ standard: "posix"
1192
+ },
1193
+ {
1194
+ name: "SIGCLD",
1195
+ number: 17,
1196
+ action: "ignore",
1197
+ description: "Child process terminated, paused or unpaused",
1198
+ standard: "other"
1199
+ },
1200
+ {
1201
+ name: "SIGCONT",
1202
+ number: 18,
1203
+ action: "unpause",
1204
+ description: "Unpaused",
1205
+ standard: "posix",
1206
+ forced: true
1207
+ },
1208
+ {
1209
+ name: "SIGSTOP",
1210
+ number: 19,
1211
+ action: "pause",
1212
+ description: "Paused",
1213
+ standard: "posix",
1214
+ forced: true
1215
+ },
1216
+ {
1217
+ name: "SIGTSTP",
1218
+ number: 20,
1219
+ action: "pause",
1220
+ description: 'Paused using CTRL-Z or "suspend"',
1221
+ standard: "posix"
1222
+ },
1223
+ {
1224
+ name: "SIGTTIN",
1225
+ number: 21,
1226
+ action: "pause",
1227
+ description: "Background process cannot read terminal input",
1228
+ standard: "posix"
1229
+ },
1230
+ {
1231
+ name: "SIGBREAK",
1232
+ number: 21,
1233
+ action: "terminate",
1234
+ description: "User interruption with CTRL-BREAK",
1235
+ standard: "other"
1236
+ },
1237
+ {
1238
+ name: "SIGTTOU",
1239
+ number: 22,
1240
+ action: "pause",
1241
+ description: "Background process cannot write to terminal output",
1242
+ standard: "posix"
1243
+ },
1244
+ {
1245
+ name: "SIGURG",
1246
+ number: 23,
1247
+ action: "ignore",
1248
+ description: "Socket received out-of-band data",
1249
+ standard: "bsd"
1250
+ },
1251
+ {
1252
+ name: "SIGXCPU",
1253
+ number: 24,
1254
+ action: "core",
1255
+ description: "Process timed out",
1256
+ standard: "bsd"
1257
+ },
1258
+ {
1259
+ name: "SIGXFSZ",
1260
+ number: 25,
1261
+ action: "core",
1262
+ description: "File too big",
1263
+ standard: "bsd"
1264
+ },
1265
+ {
1266
+ name: "SIGVTALRM",
1267
+ number: 26,
1268
+ action: "terminate",
1269
+ description: "Timeout or timer",
1270
+ standard: "bsd"
1271
+ },
1272
+ {
1273
+ name: "SIGPROF",
1274
+ number: 27,
1275
+ action: "terminate",
1276
+ description: "Timeout or timer",
1277
+ standard: "bsd"
1278
+ },
1279
+ {
1280
+ name: "SIGWINCH",
1281
+ number: 28,
1282
+ action: "ignore",
1283
+ description: "Terminal window size changed",
1284
+ standard: "bsd"
1285
+ },
1286
+ {
1287
+ name: "SIGIO",
1288
+ number: 29,
1289
+ action: "terminate",
1290
+ description: "I/O is available",
1291
+ standard: "other"
1292
+ },
1293
+ {
1294
+ name: "SIGPOLL",
1295
+ number: 29,
1296
+ action: "terminate",
1297
+ description: "Watched event",
1298
+ standard: "other"
1299
+ },
1300
+ {
1301
+ name: "SIGINFO",
1302
+ number: 29,
1303
+ action: "ignore",
1304
+ description: "Request for process information",
1305
+ standard: "other"
1306
+ },
1307
+ {
1308
+ name: "SIGPWR",
1309
+ number: 30,
1310
+ action: "terminate",
1311
+ description: "Device running out of power",
1312
+ standard: "systemv"
1313
+ },
1314
+ {
1315
+ name: "SIGSYS",
1316
+ number: 31,
1317
+ action: "core",
1318
+ description: "Invalid system call",
1319
+ standard: "other"
1320
+ },
1321
+ {
1322
+ name: "SIGUNUSED",
1323
+ number: 31,
1324
+ action: "terminate",
1325
+ description: "Invalid system call",
1326
+ standard: "other"
1327
+ }
1328
+ ];
1329
+
1330
+ // ../../node_modules/human-signals/build/src/signals.js
1331
+ var getSignals = /* @__PURE__ */ __name(() => {
1332
+ const realtimeSignals = getRealtimeSignals();
1333
+ const signals = [...SIGNALS, ...realtimeSignals].map(normalizeSignal);
1334
+ return signals;
1335
+ }, "getSignals");
1336
+ var normalizeSignal = /* @__PURE__ */ __name(({
1337
+ name,
1338
+ number: defaultNumber,
1339
+ description,
1340
+ action,
1341
+ forced = false,
1342
+ standard
1343
+ }) => {
1344
+ const {
1345
+ signals: { [name]: constantSignal }
1346
+ } = constants;
1347
+ const supported = constantSignal !== void 0;
1348
+ const number = supported ? constantSignal : defaultNumber;
1349
+ return { name, number, description, supported, action, forced, standard };
1350
+ }, "normalizeSignal");
1351
+
1352
+ // ../../node_modules/human-signals/build/src/main.js
1353
+ var getSignalsByName = /* @__PURE__ */ __name(() => {
1354
+ const signals = getSignals();
1355
+ return Object.fromEntries(signals.map(getSignalByName));
1356
+ }, "getSignalsByName");
1357
+ var getSignalByName = /* @__PURE__ */ __name(({
1358
+ name,
1359
+ number,
1360
+ description,
1361
+ supported,
1362
+ action,
1363
+ forced,
1364
+ standard
1365
+ }) => [name, { name, number, description, supported, action, forced, standard }], "getSignalByName");
1366
+ var signalsByName = getSignalsByName();
1367
+ var getSignalsByNumber = /* @__PURE__ */ __name(() => {
1368
+ const signals = getSignals();
1369
+ const length = SIGRTMAX + 1;
1370
+ const signalsA = Array.from({ length }, (value, number) => getSignalByNumber(number, signals));
1371
+ return Object.assign({}, ...signalsA);
1372
+ }, "getSignalsByNumber");
1373
+ var getSignalByNumber = /* @__PURE__ */ __name((number, signals) => {
1374
+ const signal = findSignalByNumber(number, signals);
1375
+ if (signal === void 0) {
1376
+ return {};
1377
+ }
1378
+ const { name, description, supported, action, forced, standard } = signal;
1379
+ return {
1380
+ [number]: {
1381
+ name,
1382
+ number,
1383
+ description,
1384
+ supported,
1385
+ action,
1386
+ forced,
1387
+ standard
1388
+ }
1389
+ };
1390
+ }, "getSignalByNumber");
1391
+ var findSignalByNumber = /* @__PURE__ */ __name((number, signals) => {
1392
+ const signal = signals.find(({ name }) => constants2.signals[name] === number);
1393
+ if (signal !== void 0) {
1394
+ return signal;
1395
+ }
1396
+ return signals.find((signalA) => signalA.number === number);
1397
+ }, "findSignalByNumber");
1398
+ var signalsByNumber = getSignalsByNumber();
1399
+
1400
+ // ../../node_modules/execa/lib/error.js
1401
+ var getErrorPrefix = /* @__PURE__ */ __name(({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }) => {
1402
+ if (timedOut) {
1403
+ return `timed out after ${timeout} milliseconds`;
1404
+ }
1405
+ if (isCanceled) {
1406
+ return "was canceled";
1407
+ }
1408
+ if (errorCode !== void 0) {
1409
+ return `failed with ${errorCode}`;
1410
+ }
1411
+ if (signal !== void 0) {
1412
+ return `was killed with ${signal} (${signalDescription})`;
1413
+ }
1414
+ if (exitCode !== void 0) {
1415
+ return `failed with exit code ${exitCode}`;
1416
+ }
1417
+ return "failed";
1418
+ }, "getErrorPrefix");
1419
+ var makeError = /* @__PURE__ */ __name(({
1420
+ stdout,
1421
+ stderr,
1422
+ all,
1423
+ error,
1424
+ signal,
1425
+ exitCode,
1426
+ command,
1427
+ escapedCommand,
1428
+ timedOut,
1429
+ isCanceled,
1430
+ killed,
1431
+ parsed: { options: { timeout, cwd = process3.cwd() } }
1432
+ }) => {
1433
+ exitCode = exitCode === null ? void 0 : exitCode;
1434
+ signal = signal === null ? void 0 : signal;
1435
+ const signalDescription = signal === void 0 ? void 0 : signalsByName[signal].description;
1436
+ const errorCode = error && error.code;
1437
+ const prefix = getErrorPrefix({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled });
1438
+ const execaMessage = `Command ${prefix}: ${command}`;
1439
+ const isError = Object.prototype.toString.call(error) === "[object Error]";
1440
+ const shortMessage = isError ? `${execaMessage}
1441
+ ${error.message}` : execaMessage;
1442
+ const message = [shortMessage, stderr, stdout].filter(Boolean).join("\n");
1443
+ if (isError) {
1444
+ error.originalMessage = error.message;
1445
+ error.message = message;
1446
+ } else {
1447
+ error = new Error(message);
1448
+ }
1449
+ error.shortMessage = shortMessage;
1450
+ error.command = command;
1451
+ error.escapedCommand = escapedCommand;
1452
+ error.exitCode = exitCode;
1453
+ error.signal = signal;
1454
+ error.signalDescription = signalDescription;
1455
+ error.stdout = stdout;
1456
+ error.stderr = stderr;
1457
+ error.cwd = cwd;
1458
+ if (all !== void 0) {
1459
+ error.all = all;
1460
+ }
1461
+ if ("bufferedData" in error) {
1462
+ delete error.bufferedData;
1463
+ }
1464
+ error.failed = true;
1465
+ error.timedOut = Boolean(timedOut);
1466
+ error.isCanceled = isCanceled;
1467
+ error.killed = killed && !timedOut;
1468
+ return error;
1469
+ }, "makeError");
1470
+
1471
+ // ../../node_modules/execa/lib/stdio.js
1472
+ var aliases = ["stdin", "stdout", "stderr"];
1473
+ var hasAlias = /* @__PURE__ */ __name((options) => aliases.some((alias) => options[alias] !== void 0), "hasAlias");
1474
+ var normalizeStdio = /* @__PURE__ */ __name((options) => {
1475
+ if (!options) {
1476
+ return;
1477
+ }
1478
+ const { stdio } = options;
1479
+ if (stdio === void 0) {
1480
+ return aliases.map((alias) => options[alias]);
1481
+ }
1482
+ if (hasAlias(options)) {
1483
+ throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`);
1484
+ }
1485
+ if (typeof stdio === "string") {
1486
+ return stdio;
1487
+ }
1488
+ if (!Array.isArray(stdio)) {
1489
+ throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
1490
+ }
1491
+ const length = Math.max(stdio.length, aliases.length);
1492
+ return Array.from({ length }, (value, index) => stdio[index]);
1493
+ }, "normalizeStdio");
1494
+ var normalizeStdioNode = /* @__PURE__ */ __name((options) => {
1495
+ const stdio = normalizeStdio(options);
1496
+ if (stdio === "ipc") {
1497
+ return "ipc";
1498
+ }
1499
+ if (stdio === void 0 || typeof stdio === "string") {
1500
+ return [stdio, stdio, stdio, "ipc"];
1501
+ }
1502
+ if (stdio.includes("ipc")) {
1503
+ return stdio;
1504
+ }
1505
+ return [...stdio, "ipc"];
1506
+ }, "normalizeStdioNode");
1507
+
1508
+ // ../../node_modules/execa/lib/kill.js
1509
+ var import_signal_exit = __toESM(require_signal_exit(), 1);
1510
+ import os from "node:os";
1511
+ var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
1512
+ var spawnedKill = /* @__PURE__ */ __name((kill, signal = "SIGTERM", options = {}) => {
1513
+ const killResult = kill(signal);
1514
+ setKillTimeout(kill, signal, options, killResult);
1515
+ return killResult;
1516
+ }, "spawnedKill");
1517
+ var setKillTimeout = /* @__PURE__ */ __name((kill, signal, options, killResult) => {
1518
+ if (!shouldForceKill(signal, options, killResult)) {
1519
+ return;
1520
+ }
1521
+ const timeout = getForceKillAfterTimeout(options);
1522
+ const t = setTimeout(() => {
1523
+ kill("SIGKILL");
1524
+ }, timeout);
1525
+ if (t.unref) {
1526
+ t.unref();
1527
+ }
1528
+ }, "setKillTimeout");
1529
+ var shouldForceKill = /* @__PURE__ */ __name((signal, { forceKillAfterTimeout }, killResult) => isSigterm(signal) && forceKillAfterTimeout !== false && killResult, "shouldForceKill");
1530
+ var isSigterm = /* @__PURE__ */ __name((signal) => signal === os.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM", "isSigterm");
1531
+ var getForceKillAfterTimeout = /* @__PURE__ */ __name(({ forceKillAfterTimeout = true }) => {
1532
+ if (forceKillAfterTimeout === true) {
1533
+ return DEFAULT_FORCE_KILL_TIMEOUT;
1534
+ }
1535
+ if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {
1536
+ throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
1537
+ }
1538
+ return forceKillAfterTimeout;
1539
+ }, "getForceKillAfterTimeout");
1540
+ var spawnedCancel = /* @__PURE__ */ __name((spawned, context) => {
1541
+ const killResult = spawned.kill();
1542
+ if (killResult) {
1543
+ context.isCanceled = true;
1544
+ }
1545
+ }, "spawnedCancel");
1546
+ var timeoutKill = /* @__PURE__ */ __name((spawned, signal, reject) => {
1547
+ spawned.kill(signal);
1548
+ reject(Object.assign(new Error("Timed out"), { timedOut: true, signal }));
1549
+ }, "timeoutKill");
1550
+ var setupTimeout = /* @__PURE__ */ __name((spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => {
1551
+ if (timeout === 0 || timeout === void 0) {
1552
+ return spawnedPromise;
1553
+ }
1554
+ let timeoutId;
1555
+ const timeoutPromise = new Promise((resolve, reject) => {
1556
+ timeoutId = setTimeout(() => {
1557
+ timeoutKill(spawned, killSignal, reject);
1558
+ }, timeout);
1559
+ });
1560
+ const safeSpawnedPromise = spawnedPromise.finally(() => {
1561
+ clearTimeout(timeoutId);
1562
+ });
1563
+ return Promise.race([timeoutPromise, safeSpawnedPromise]);
1564
+ }, "setupTimeout");
1565
+ var validateTimeout = /* @__PURE__ */ __name(({ timeout }) => {
1566
+ if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout < 0)) {
1567
+ throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
1568
+ }
1569
+ }, "validateTimeout");
1570
+ var setExitHandler = /* @__PURE__ */ __name(async (spawned, { cleanup, detached }, timedPromise) => {
1571
+ if (!cleanup || detached) {
1572
+ return timedPromise;
1573
+ }
1574
+ const removeExitHandler = (0, import_signal_exit.default)(() => {
1575
+ spawned.kill();
1576
+ });
1577
+ return timedPromise.finally(() => {
1578
+ removeExitHandler();
1579
+ });
1580
+ }, "setExitHandler");
1581
+
1582
+ // ../../node_modules/execa/lib/pipe.js
1583
+ import { createWriteStream } from "node:fs";
1584
+ import { ChildProcess } from "node:child_process";
1585
+
1586
+ // ../../node_modules/execa/node_modules/is-stream/index.js
1587
+ function isStream(stream) {
1588
+ return stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
1589
+ }
1590
+ __name(isStream, "isStream");
1591
+ function isWritableStream(stream) {
1592
+ return isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
1593
+ }
1594
+ __name(isWritableStream, "isWritableStream");
1595
+
1596
+ // ../../node_modules/execa/lib/pipe.js
1597
+ var isExecaChildProcess = /* @__PURE__ */ __name((target) => target instanceof ChildProcess && typeof target.then === "function", "isExecaChildProcess");
1598
+ var pipeToTarget = /* @__PURE__ */ __name((spawned, streamName, target) => {
1599
+ if (typeof target === "string") {
1600
+ spawned[streamName].pipe(createWriteStream(target));
1601
+ return spawned;
1602
+ }
1603
+ if (isWritableStream(target)) {
1604
+ spawned[streamName].pipe(target);
1605
+ return spawned;
1606
+ }
1607
+ if (!isExecaChildProcess(target)) {
1608
+ throw new TypeError("The second argument must be a string, a stream or an Execa child process.");
1609
+ }
1610
+ if (!isWritableStream(target.stdin)) {
1611
+ throw new TypeError("The target child process's stdin must be available.");
1612
+ }
1613
+ spawned[streamName].pipe(target.stdin);
1614
+ return target;
1615
+ }, "pipeToTarget");
1616
+ var addPipeMethods = /* @__PURE__ */ __name((spawned) => {
1617
+ if (spawned.stdout !== null) {
1618
+ spawned.pipeStdout = pipeToTarget.bind(void 0, spawned, "stdout");
1619
+ }
1620
+ if (spawned.stderr !== null) {
1621
+ spawned.pipeStderr = pipeToTarget.bind(void 0, spawned, "stderr");
1622
+ }
1623
+ if (spawned.all !== void 0) {
1624
+ spawned.pipeAll = pipeToTarget.bind(void 0, spawned, "all");
1625
+ }
1626
+ }, "addPipeMethods");
1627
+
1628
+ // ../../node_modules/execa/lib/stream.js
1629
+ import { createReadStream, readFileSync } from "node:fs";
1630
+ var import_get_stream = __toESM(require_get_stream(), 1);
1631
+ var import_merge_stream = __toESM(require_merge_stream(), 1);
1632
+ var validateInputOptions = /* @__PURE__ */ __name((input) => {
1633
+ if (input !== void 0) {
1634
+ throw new TypeError("The `input` and `inputFile` options cannot be both set.");
1635
+ }
1636
+ }, "validateInputOptions");
1637
+ var getInputSync = /* @__PURE__ */ __name(({ input, inputFile }) => {
1638
+ if (typeof inputFile !== "string") {
1639
+ return input;
1640
+ }
1641
+ validateInputOptions(input);
1642
+ return readFileSync(inputFile);
1643
+ }, "getInputSync");
1644
+ var handleInputSync = /* @__PURE__ */ __name((options) => {
1645
+ const input = getInputSync(options);
1646
+ if (isStream(input)) {
1647
+ throw new TypeError("The `input` option cannot be a stream in sync mode");
1648
+ }
1649
+ return input;
1650
+ }, "handleInputSync");
1651
+ var getInput = /* @__PURE__ */ __name(({ input, inputFile }) => {
1652
+ if (typeof inputFile !== "string") {
1653
+ return input;
1654
+ }
1655
+ validateInputOptions(input);
1656
+ return createReadStream(inputFile);
1657
+ }, "getInput");
1658
+ var handleInput = /* @__PURE__ */ __name((spawned, options) => {
1659
+ const input = getInput(options);
1660
+ if (input === void 0) {
1661
+ return;
1662
+ }
1663
+ if (isStream(input)) {
1664
+ input.pipe(spawned.stdin);
1665
+ } else {
1666
+ spawned.stdin.end(input);
1667
+ }
1668
+ }, "handleInput");
1669
+ var makeAllStream = /* @__PURE__ */ __name((spawned, { all }) => {
1670
+ if (!all || !spawned.stdout && !spawned.stderr) {
1671
+ return;
1672
+ }
1673
+ const mixed = (0, import_merge_stream.default)();
1674
+ if (spawned.stdout) {
1675
+ mixed.add(spawned.stdout);
1676
+ }
1677
+ if (spawned.stderr) {
1678
+ mixed.add(spawned.stderr);
1679
+ }
1680
+ return mixed;
1681
+ }, "makeAllStream");
1682
+ var getBufferedData = /* @__PURE__ */ __name(async (stream, streamPromise) => {
1683
+ if (!stream || streamPromise === void 0) {
1684
+ return;
1685
+ }
1686
+ stream.destroy();
1687
+ try {
1688
+ return await streamPromise;
1689
+ } catch (error) {
1690
+ return error.bufferedData;
1691
+ }
1692
+ }, "getBufferedData");
1693
+ var getStreamPromise = /* @__PURE__ */ __name((stream, { encoding, buffer, maxBuffer }) => {
1694
+ if (!stream || !buffer) {
1695
+ return;
1696
+ }
1697
+ if (encoding) {
1698
+ return (0, import_get_stream.default)(stream, { encoding, maxBuffer });
1699
+ }
1700
+ return import_get_stream.default.buffer(stream, { maxBuffer });
1701
+ }, "getStreamPromise");
1702
+ var getSpawnedResult = /* @__PURE__ */ __name(async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone) => {
1703
+ const stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer });
1704
+ const stderrPromise = getStreamPromise(stderr, { encoding, buffer, maxBuffer });
1705
+ const allPromise = getStreamPromise(all, { encoding, buffer, maxBuffer: maxBuffer * 2 });
1706
+ try {
1707
+ return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);
1708
+ } catch (error) {
1709
+ return Promise.all([
1710
+ { error, signal: error.signal, timedOut: error.timedOut },
1711
+ getBufferedData(stdout, stdoutPromise),
1712
+ getBufferedData(stderr, stderrPromise),
1713
+ getBufferedData(all, allPromise)
1714
+ ]);
1715
+ }
1716
+ }, "getSpawnedResult");
1717
+
1718
+ // ../../node_modules/execa/lib/promise.js
1719
+ var nativePromisePrototype = (async () => {
1720
+ })().constructor.prototype;
1721
+ var descriptors = ["then", "catch", "finally"].map((property) => [
1722
+ property,
1723
+ Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)
1724
+ ]);
1725
+ var mergePromise = /* @__PURE__ */ __name((spawned, promise) => {
1726
+ for (const [property, descriptor] of descriptors) {
1727
+ const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise);
1728
+ Reflect.defineProperty(spawned, property, { ...descriptor, value });
1729
+ }
1730
+ }, "mergePromise");
1731
+ var getSpawnedPromise = /* @__PURE__ */ __name((spawned) => new Promise((resolve, reject) => {
1732
+ spawned.on("exit", (exitCode, signal) => {
1733
+ resolve({ exitCode, signal });
1734
+ });
1735
+ spawned.on("error", (error) => {
1736
+ reject(error);
1737
+ });
1738
+ if (spawned.stdin) {
1739
+ spawned.stdin.on("error", (error) => {
1740
+ reject(error);
1741
+ });
1742
+ }
1743
+ }), "getSpawnedPromise");
1744
+
1745
+ // ../../node_modules/execa/lib/command.js
1746
+ import { Buffer as Buffer2 } from "node:buffer";
1747
+ import { ChildProcess as ChildProcess2 } from "node:child_process";
1748
+ var normalizeArgs = /* @__PURE__ */ __name((file, args = []) => {
1749
+ if (!Array.isArray(args)) {
1750
+ return [file];
1751
+ }
1752
+ return [file, ...args];
1753
+ }, "normalizeArgs");
1754
+ var NO_ESCAPE_REGEXP = /^[\w.-]+$/;
1755
+ var DOUBLE_QUOTES_REGEXP = /"/g;
1756
+ var escapeArg = /* @__PURE__ */ __name((arg) => {
1757
+ if (typeof arg !== "string" || NO_ESCAPE_REGEXP.test(arg)) {
1758
+ return arg;
1759
+ }
1760
+ return `"${arg.replace(DOUBLE_QUOTES_REGEXP, '\\"')}"`;
1761
+ }, "escapeArg");
1762
+ var joinCommand = /* @__PURE__ */ __name((file, args) => normalizeArgs(file, args).join(" "), "joinCommand");
1763
+ var getEscapedCommand = /* @__PURE__ */ __name((file, args) => normalizeArgs(file, args).map((arg) => escapeArg(arg)).join(" "), "getEscapedCommand");
1764
+ var SPACES_REGEXP = / +/g;
1765
+ var parseCommand = /* @__PURE__ */ __name((command) => {
1766
+ const tokens = [];
1767
+ for (const token of command.trim().split(SPACES_REGEXP)) {
1768
+ const previousToken = tokens[tokens.length - 1];
1769
+ if (previousToken && previousToken.endsWith("\\")) {
1770
+ tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`;
1771
+ } else {
1772
+ tokens.push(token);
1773
+ }
1774
+ }
1775
+ return tokens;
1776
+ }, "parseCommand");
1777
+ var parseExpression = /* @__PURE__ */ __name((expression) => {
1778
+ const typeOfExpression = typeof expression;
1779
+ if (typeOfExpression === "string") {
1780
+ return expression;
1781
+ }
1782
+ if (typeOfExpression === "number") {
1783
+ return String(expression);
1784
+ }
1785
+ if (typeOfExpression === "object" && expression !== null && !(expression instanceof ChildProcess2) && "stdout" in expression) {
1786
+ const typeOfStdout = typeof expression.stdout;
1787
+ if (typeOfStdout === "string") {
1788
+ return expression.stdout;
1789
+ }
1790
+ if (Buffer2.isBuffer(expression.stdout)) {
1791
+ return expression.stdout.toString();
1792
+ }
1793
+ throw new TypeError(`Unexpected "${typeOfStdout}" stdout in template expression`);
1794
+ }
1795
+ throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`);
1796
+ }, "parseExpression");
1797
+ var concatTokens = /* @__PURE__ */ __name((tokens, nextTokens, isNew) => isNew || tokens.length === 0 || nextTokens.length === 0 ? [...tokens, ...nextTokens] : [
1798
+ ...tokens.slice(0, -1),
1799
+ `${tokens[tokens.length - 1]}${nextTokens[0]}`,
1800
+ ...nextTokens.slice(1)
1801
+ ], "concatTokens");
1802
+ var parseTemplate = /* @__PURE__ */ __name(({ templates, expressions, tokens, index, template }) => {
1803
+ const templateString = template ?? templates.raw[index];
1804
+ const templateTokens = templateString.split(SPACES_REGEXP).filter(Boolean);
1805
+ const newTokens = concatTokens(
1806
+ tokens,
1807
+ templateTokens,
1808
+ templateString.startsWith(" ")
1809
+ );
1810
+ if (index === expressions.length) {
1811
+ return newTokens;
1812
+ }
1813
+ const expression = expressions[index];
1814
+ const expressionTokens = Array.isArray(expression) ? expression.map((expression2) => parseExpression(expression2)) : [parseExpression(expression)];
1815
+ return concatTokens(
1816
+ newTokens,
1817
+ expressionTokens,
1818
+ templateString.endsWith(" ")
1819
+ );
1820
+ }, "parseTemplate");
1821
+ var parseTemplates = /* @__PURE__ */ __name((templates, expressions) => {
1822
+ let tokens = [];
1823
+ for (const [index, template] of templates.entries()) {
1824
+ tokens = parseTemplate({ templates, expressions, tokens, index, template });
1825
+ }
1826
+ return tokens;
1827
+ }, "parseTemplates");
1828
+
1829
+ // ../../node_modules/execa/lib/verbose.js
1830
+ import { debuglog } from "node:util";
1831
+ import process4 from "node:process";
1832
+ var verboseDefault = debuglog("execa").enabled;
1833
+ var padField = /* @__PURE__ */ __name((field, padding) => String(field).padStart(padding, "0"), "padField");
1834
+ var getTimestamp = /* @__PURE__ */ __name(() => {
1835
+ const date = /* @__PURE__ */ new Date();
1836
+ return `${padField(date.getHours(), 2)}:${padField(date.getMinutes(), 2)}:${padField(date.getSeconds(), 2)}.${padField(date.getMilliseconds(), 3)}`;
1837
+ }, "getTimestamp");
1838
+ var logCommand = /* @__PURE__ */ __name((escapedCommand, { verbose }) => {
1839
+ if (!verbose) {
1840
+ return;
1841
+ }
1842
+ process4.stderr.write(`[${getTimestamp()}] ${escapedCommand}
1843
+ `);
1844
+ }, "logCommand");
1845
+
1846
+ // ../../node_modules/execa/index.js
1847
+ var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
1848
+ var getEnv = /* @__PURE__ */ __name(({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
1849
+ const env = extendEnv ? { ...process5.env, ...envOption } : envOption;
1850
+ if (preferLocal) {
1851
+ return npmRunPathEnv({ env, cwd: localDir, execPath });
1852
+ }
1853
+ return env;
1854
+ }, "getEnv");
1855
+ var handleArguments = /* @__PURE__ */ __name((file, args, options = {}) => {
1856
+ const parsed = import_cross_spawn.default._parse(file, args, options);
1857
+ file = parsed.command;
1858
+ args = parsed.args;
1859
+ options = parsed.options;
1860
+ options = {
1861
+ maxBuffer: DEFAULT_MAX_BUFFER,
1862
+ buffer: true,
1863
+ stripFinalNewline: true,
1864
+ extendEnv: true,
1865
+ preferLocal: false,
1866
+ localDir: options.cwd || process5.cwd(),
1867
+ execPath: process5.execPath,
1868
+ encoding: "utf8",
1869
+ reject: true,
1870
+ cleanup: true,
1871
+ all: false,
1872
+ windowsHide: true,
1873
+ verbose: verboseDefault,
1874
+ ...options
1875
+ };
1876
+ options.env = getEnv(options);
1877
+ options.stdio = normalizeStdio(options);
1878
+ if (process5.platform === "win32" && path2.basename(file, ".exe") === "cmd") {
1879
+ args.unshift("/q");
1880
+ }
1881
+ return { file, args, options, parsed };
1882
+ }, "handleArguments");
1883
+ var handleOutput = /* @__PURE__ */ __name((options, value, error) => {
1884
+ if (typeof value !== "string" && !Buffer3.isBuffer(value)) {
1885
+ return error === void 0 ? void 0 : "";
1886
+ }
1887
+ if (options.stripFinalNewline) {
1888
+ return stripFinalNewline(value);
1889
+ }
1890
+ return value;
1891
+ }, "handleOutput");
1892
+ function execa(file, args, options) {
1893
+ const parsed = handleArguments(file, args, options);
1894
+ const command = joinCommand(file, args);
1895
+ const escapedCommand = getEscapedCommand(file, args);
1896
+ logCommand(escapedCommand, parsed.options);
1897
+ validateTimeout(parsed.options);
1898
+ let spawned;
1899
+ try {
1900
+ spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options);
1901
+ } catch (error) {
1902
+ const dummySpawned = new childProcess.ChildProcess();
1903
+ const errorPromise = Promise.reject(makeError({
1904
+ error,
1905
+ stdout: "",
1906
+ stderr: "",
1907
+ all: "",
1908
+ command,
1909
+ escapedCommand,
1910
+ parsed,
1911
+ timedOut: false,
1912
+ isCanceled: false,
1913
+ killed: false
1914
+ }));
1915
+ mergePromise(dummySpawned, errorPromise);
1916
+ return dummySpawned;
1917
+ }
1918
+ const spawnedPromise = getSpawnedPromise(spawned);
1919
+ const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);
1920
+ const processDone = setExitHandler(spawned, parsed.options, timedPromise);
1921
+ const context = { isCanceled: false };
1922
+ spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));
1923
+ spawned.cancel = spawnedCancel.bind(null, spawned, context);
1924
+ const handlePromise = /* @__PURE__ */ __name(async () => {
1925
+ const [{ error, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);
1926
+ const stdout = handleOutput(parsed.options, stdoutResult);
1927
+ const stderr = handleOutput(parsed.options, stderrResult);
1928
+ const all = handleOutput(parsed.options, allResult);
1929
+ if (error || exitCode !== 0 || signal !== null) {
1930
+ const returnedError = makeError({
1931
+ error,
1932
+ exitCode,
1933
+ signal,
1934
+ stdout,
1935
+ stderr,
1936
+ all,
1937
+ command,
1938
+ escapedCommand,
1939
+ parsed,
1940
+ timedOut,
1941
+ isCanceled: context.isCanceled || (parsed.options.signal ? parsed.options.signal.aborted : false),
1942
+ killed: spawned.killed
1943
+ });
1944
+ if (!parsed.options.reject) {
1945
+ return returnedError;
1946
+ }
1947
+ throw returnedError;
1948
+ }
1949
+ return {
1950
+ command,
1951
+ escapedCommand,
1952
+ exitCode: 0,
1953
+ stdout,
1954
+ stderr,
1955
+ all,
1956
+ failed: false,
1957
+ timedOut: false,
1958
+ isCanceled: false,
1959
+ killed: false
1960
+ };
1961
+ }, "handlePromise");
1962
+ const handlePromiseOnce = onetime_default(handlePromise);
1963
+ handleInput(spawned, parsed.options);
1964
+ spawned.all = makeAllStream(spawned, parsed.options);
1965
+ addPipeMethods(spawned);
1966
+ mergePromise(spawned, handlePromiseOnce);
1967
+ return spawned;
1968
+ }
1969
+ __name(execa, "execa");
1970
+ function execaSync(file, args, options) {
1971
+ const parsed = handleArguments(file, args, options);
1972
+ const command = joinCommand(file, args);
1973
+ const escapedCommand = getEscapedCommand(file, args);
1974
+ logCommand(escapedCommand, parsed.options);
1975
+ const input = handleInputSync(parsed.options);
1976
+ let result;
1977
+ try {
1978
+ result = childProcess.spawnSync(parsed.file, parsed.args, { ...parsed.options, input });
1979
+ } catch (error) {
1980
+ throw makeError({
1981
+ error,
1982
+ stdout: "",
1983
+ stderr: "",
1984
+ all: "",
1985
+ command,
1986
+ escapedCommand,
1987
+ parsed,
1988
+ timedOut: false,
1989
+ isCanceled: false,
1990
+ killed: false
1991
+ });
1992
+ }
1993
+ const stdout = handleOutput(parsed.options, result.stdout, result.error);
1994
+ const stderr = handleOutput(parsed.options, result.stderr, result.error);
1995
+ if (result.error || result.status !== 0 || result.signal !== null) {
1996
+ const error = makeError({
1997
+ stdout,
1998
+ stderr,
1999
+ error: result.error,
2000
+ signal: result.signal,
2001
+ exitCode: result.status,
2002
+ command,
2003
+ escapedCommand,
2004
+ parsed,
2005
+ timedOut: result.error && result.error.code === "ETIMEDOUT",
2006
+ isCanceled: false,
2007
+ killed: result.signal !== null
2008
+ });
2009
+ if (!parsed.options.reject) {
2010
+ return error;
2011
+ }
2012
+ throw error;
2013
+ }
2014
+ return {
2015
+ command,
2016
+ escapedCommand,
2017
+ exitCode: 0,
2018
+ stdout,
2019
+ stderr,
2020
+ failed: false,
2021
+ timedOut: false,
2022
+ isCanceled: false,
2023
+ killed: false
2024
+ };
2025
+ }
2026
+ __name(execaSync, "execaSync");
2027
+ var normalizeScriptStdin = /* @__PURE__ */ __name(({ input, inputFile, stdio }) => input === void 0 && inputFile === void 0 && stdio === void 0 ? { stdin: "inherit" } : {}, "normalizeScriptStdin");
2028
+ var normalizeScriptOptions = /* @__PURE__ */ __name((options = {}) => ({
2029
+ preferLocal: true,
2030
+ ...normalizeScriptStdin(options),
2031
+ ...options
2032
+ }), "normalizeScriptOptions");
2033
+ function create$(options) {
2034
+ function $2(templatesOrOptions, ...expressions) {
2035
+ if (!Array.isArray(templatesOrOptions)) {
2036
+ return create$({ ...options, ...templatesOrOptions });
2037
+ }
2038
+ const [file, ...args] = parseTemplates(templatesOrOptions, expressions);
2039
+ return execa(file, args, normalizeScriptOptions(options));
2040
+ }
2041
+ __name($2, "$");
2042
+ $2.sync = (templates, ...expressions) => {
2043
+ if (!Array.isArray(templates)) {
2044
+ throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");
2045
+ }
2046
+ const [file, ...args] = parseTemplates(templates, expressions);
2047
+ return execaSync(file, args, normalizeScriptOptions(options));
2048
+ };
2049
+ return $2;
2050
+ }
2051
+ __name(create$, "create$");
2052
+ var $ = create$();
2053
+ function execaCommand(command, options) {
2054
+ const [file, ...args] = parseCommand(command);
2055
+ return execa(file, args, options);
2056
+ }
2057
+ __name(execaCommand, "execaCommand");
2058
+ function execaCommandSync(command, options) {
2059
+ const [file, ...args] = parseCommand(command);
2060
+ return execaSync(file, args, options);
2061
+ }
2062
+ __name(execaCommandSync, "execaCommandSync");
2063
+ function execaNode(scriptPath, args, options = {}) {
2064
+ if (args && !Array.isArray(args) && typeof args === "object") {
2065
+ options = args;
2066
+ args = [];
2067
+ }
2068
+ const stdio = normalizeStdioNode(options);
2069
+ const defaultExecArgv = process5.execArgv.filter((arg) => !arg.startsWith("--inspect"));
2070
+ const {
2071
+ nodePath = process5.execPath,
2072
+ nodeOptions = defaultExecArgv
2073
+ } = options;
2074
+ return execa(
2075
+ nodePath,
2076
+ [
2077
+ ...nodeOptions,
2078
+ scriptPath,
2079
+ ...Array.isArray(args) ? args : []
2080
+ ],
2081
+ {
2082
+ ...options,
2083
+ stdin: void 0,
2084
+ stdout: void 0,
2085
+ stderr: void 0,
2086
+ stdio,
2087
+ shell: false
2088
+ }
2089
+ );
2090
+ }
2091
+ __name(execaNode, "execaNode");
2092
+ export {
2093
+ $,
2094
+ execa,
2095
+ execaCommand,
2096
+ execaCommandSync,
2097
+ execaNode,
2098
+ execaSync
2099
+ };
2100
+ //# sourceMappingURL=execa-I2XBH3EI.js.map