@lousy-agents/cli 5.3.5 → 5.3.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,5 +1,5 @@
1
- export const __rspack_esm_id = "346";
2
- export const __rspack_esm_ids = ["346"];
1
+ export const __rspack_esm_id = "433";
2
+ export const __rspack_esm_ids = ["433"];
3
3
  export const __webpack_modules__ = {
4
4
  6482(__unused_rspack_module, exports, __webpack_require__) {
5
5
  Object.defineProperty(exports, "__esModule", ({value:!0}));const node=__webpack_require__(4346);__webpack_require__(7067),__webpack_require__(4708),__webpack_require__(8522),__webpack_require__(7075),__webpack_require__(4573),__webpack_require__(7975),__webpack_require__(9912),__webpack_require__(3136),__webpack_require__(7030),__webpack_require__(3024),__webpack_require__(6760);const o=!!globalThis.process?.env?.FORCE_NODE_FETCH,fetch=!o&&globalThis.fetch||node.fetch,Blob=!o&&globalThis.Blob||node.Blob,File=!o&&globalThis.File||node.File,FormData=!o&&globalThis.FormData||node.FormData,Headers=!o&&globalThis.Headers||node.Headers,Request=!o&&globalThis.Request||node.Request,Response=!o&&globalThis.Response||node.Response,AbortController=!o&&globalThis.AbortController||node.AbortController;exports.AbortError=node.AbortError,exports.FetchError=node.FetchError,exports.blobFrom=node.blobFrom,exports.blobFromSync=node.blobFromSync,exports.fileFrom=node.fileFrom,exports.fileFromSync=node.fileFromSync,exports.isRedirect=node.isRedirect,exports.AbortController=AbortController,exports.Blob=Blob,exports.File=File,exports.FormData=FormData,exports.Headers=Headers,exports.Request=Request,exports.Response=Response,exports["default"]=fetch,exports.fetch=fetch;
@@ -112,7 +112,7 @@ module.exports = fetch;
112
112
 
113
113
 
114
114
  },
115
- 761(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
115
+ 7216(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
116
116
 
117
117
  // EXPORTS
118
118
  __webpack_require__.d(__webpack_exports__, {
@@ -153,8 +153,6 @@ var pathe_M_eThtNZ = __webpack_require__(2072);
153
153
  var defu = __webpack_require__(8437);
154
154
  // EXTERNAL MODULE: external "node:module"
155
155
  var external_node_module_ = __webpack_require__(8995);
156
- // EXTERNAL MODULE: external "module"
157
- var external_module_ = __webpack_require__(3339);
158
156
  // EXTERNAL MODULE: external "node:child_process"
159
157
  var external_node_child_process_ = __webpack_require__(1421);
160
158
  // EXTERNAL MODULE: external "node:path"
@@ -165,76 +163,63 @@ var external_node_process_ = __webpack_require__(1708);
165
163
  var external_node_stream_ = __webpack_require__(7075);
166
164
  // EXTERNAL MODULE: external "node:readline"
167
165
  var external_node_readline_ = __webpack_require__(481);
168
- ;// CONCATENATED MODULE: ../../node_modules/tinyexec/dist/main.js
166
+ ;// CONCATENATED MODULE: ../../node_modules/tinyexec/dist/main.mjs
169
167
 
170
168
 
171
169
 
172
170
 
173
171
 
174
172
 
175
- var main_l = Object.create;
176
- var main_u = Object.defineProperty;
177
- var main_d = Object.getOwnPropertyDescriptor;
178
- var main_f = Object.getOwnPropertyNames;
179
- var main_p = Object.getPrototypeOf;
180
- var main_m = Object.prototype.hasOwnProperty;
181
- var main_h = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports);
182
- var main_g = (e, t, n, r) => {
183
- if (t && typeof t === "object" || typeof t === "function") for (var i = main_f(t), a = 0, o = i.length, s; a < o; a++) {
184
- s = i[a];
185
- if (!main_m.call(e, s) && s !== n) main_u(e, s, {
186
- get: ((e) => t[e]).bind(null, s),
187
- enumerable: !(r = main_d(t, s)) || r.enumerable
188
- });
189
- }
190
- return e;
191
- };
192
- var main_ = (e, t, n) => (n = e != null ? main_l(main_p(e)) : {}, main_g(t || !e || !e.__esModule ? main_u(n, "default", {
193
- value: e,
194
- enumerable: true
195
- }) : n, e));
196
- var main_v = /* @__PURE__ */ (0,external_module_.createRequire)(import.meta.url);
197
- const main_y = /^path$/i;
198
- const main_b = {
173
+ //#region \0rolldown/runtime.js
174
+ var main_l = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports);
175
+ var main_u = /* @__PURE__ */ (0,external_node_module_.createRequire)(import.meta.url);
176
+ //#endregion
177
+ //#region src/env.ts
178
+ const main_d = /^path$/i;
179
+ const main_f = {
199
180
  key: "PATH",
200
181
  value: ""
201
182
  };
202
- function main_x(e) {
183
+ function main_p(e) {
203
184
  for (const t in e) {
204
- if (!Object.prototype.hasOwnProperty.call(e, t) || !main_y.test(t)) continue;
185
+ if (!Object.prototype.hasOwnProperty.call(e, t) || !main_d.test(t)) continue;
205
186
  const n = e[t];
206
- if (!n) return main_b;
187
+ if (!n) return main_f;
207
188
  return {
208
189
  key: t,
209
190
  value: n
210
191
  };
211
192
  }
212
- return main_b;
193
+ return main_f;
213
194
  }
214
- function main_S(e, t) {
195
+ function main_m(e, t) {
215
196
  const i = t.value.split(external_node_path_.delimiter);
216
- let o = e;
217
- let s;
197
+ const o = [];
198
+ let s = e;
199
+ let c;
218
200
  do {
219
- i.push((0,external_node_path_.resolve)(o, "node_modules", ".bin"));
220
- s = o;
221
- o = (0,external_node_path_.dirname)(o);
222
- } while (o !== s);
201
+ o.push((0,external_node_path_.resolve)(s, "node_modules", ".bin"));
202
+ c = s;
203
+ s = (0,external_node_path_.dirname)(s);
204
+ } while (s !== c);
205
+ const l = o.concat(i).join(external_node_path_.delimiter);
223
206
  return {
224
207
  key: t.key,
225
- value: i.join(external_node_path_.delimiter)
208
+ value: l
226
209
  };
227
210
  }
228
- function main_C(e, t) {
211
+ function main_h(e, t) {
229
212
  const n = {
230
213
  ...process.env,
231
214
  ...t
232
215
  };
233
- const r = main_S(e, main_x(n));
216
+ const r = main_m(e, main_p(n));
234
217
  n[r.key] = r.value;
235
218
  return n;
236
219
  }
237
- const main_w = (e) => {
220
+ //#endregion
221
+ //#region src/stream.ts
222
+ const main_g = (e) => {
238
223
  let t = e.length;
239
224
  const n = new external_node_stream_.PassThrough();
240
225
  const r = () => {
@@ -246,10 +231,12 @@ const main_w = (e) => {
246
231
  }
247
232
  return n;
248
233
  };
249
- var main_T = main_h((exports, t) => {
234
+ //#endregion
235
+ //#region node_modules/isexe/windows.js
236
+ var main_ = /* @__PURE__ */ main_l(((e, t) => {
250
237
  t.exports = a;
251
238
  a.sync = o;
252
- var n = main_v("fs");
239
+ var n = main_u("fs");
253
240
  function r(e, t) {
254
241
  var n = t.pathExt !== void 0 ? t.pathExt : process.env.PATHEXT;
255
242
  if (!n) return true;
@@ -273,11 +260,13 @@ var main_T = main_h((exports, t) => {
273
260
  function o(e, t) {
274
261
  return i(n.statSync(e), e, t);
275
262
  }
276
- });
277
- var main_E = main_h((exports, t) => {
263
+ }));
264
+ //#endregion
265
+ //#region node_modules/isexe/mode.js
266
+ var main_v = /* @__PURE__ */ main_l(((e, t) => {
278
267
  t.exports = r;
279
268
  r.sync = i;
280
- var n = main_v("fs");
269
+ var n = main_u("fs");
281
270
  function r(e, t, r) {
282
271
  n.stat(e, function(e, n) {
283
272
  r(e, e ? false : a(n, t));
@@ -299,56 +288,59 @@ var main_E = main_h((exports, t) => {
299
288
  var c = parseInt("010", 8);
300
289
  var l = parseInt("001", 8);
301
290
  var u = s | c;
302
- var d = n & l || n & c && i === o || n & s && r === a || n & u && a === 0;
303
- return d;
291
+ return n & l || n & c && i === o || n & s && r === a || n & u && a === 0;
304
292
  }
305
- });
306
- var main_D = main_h((exports, t) => {
307
- var n = main_v("fs");
308
- var r;
309
- if (process.platform === "win32" || global.TESTING_WINDOWS) r = main_T();
310
- else r = main_E();
311
- t.exports = i;
312
- i.sync = a;
313
- function i(e, t, n) {
293
+ }));
294
+ //#endregion
295
+ //#region node_modules/isexe/index.js
296
+ var main_y = /* @__PURE__ */ main_l(((e, t) => {
297
+ main_u("fs");
298
+ var n;
299
+ if (process.platform === "win32" || global.TESTING_WINDOWS) n = main_();
300
+ else n = main_v();
301
+ t.exports = r;
302
+ r.sync = i;
303
+ function r(e, t, i) {
314
304
  if (typeof t === "function") {
315
- n = t;
305
+ i = t;
316
306
  t = {};
317
307
  }
318
- if (!n) {
308
+ if (!i) {
319
309
  if (typeof Promise !== "function") throw new TypeError("callback not provided");
320
- return new Promise(function(n, r) {
321
- i(e, t || {}, function(e, t) {
322
- if (e) r(e);
310
+ return new Promise(function(n, i) {
311
+ r(e, t || {}, function(e, t) {
312
+ if (e) i(e);
323
313
  else n(t);
324
314
  });
325
315
  });
326
316
  }
327
- r(e, t || {}, function(e, r) {
317
+ n(e, t || {}, function(e, n) {
328
318
  if (e) {
329
319
  if (e.code === "EACCES" || t && t.ignoreErrors) {
330
320
  e = null;
331
- r = false;
321
+ n = false;
332
322
  }
333
323
  }
334
- n(e, r);
324
+ i(e, n);
335
325
  });
336
326
  }
337
- function a(e, t) {
327
+ function i(e, t) {
338
328
  try {
339
- return r.sync(e, t || {});
329
+ return n.sync(e, t || {});
340
330
  } catch (e) {
341
331
  if (t && t.ignoreErrors || e.code === "EACCES") return false;
342
332
  else throw e;
343
333
  }
344
334
  }
345
- });
346
- var main_O = main_h((exports, t) => {
335
+ }));
336
+ //#endregion
337
+ //#region node_modules/which/which.js
338
+ var main_b = /* @__PURE__ */ main_l(((e, t) => {
347
339
  const n = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
348
- const r = main_v("path");
340
+ const r = main_u("path");
349
341
  const i = n ? ";" : ":";
350
- const a = main_D();
351
- const o = (e) => Object.assign(new Error(`not found: ${e}`), { code: "ENOENT" });
342
+ const a = main_y();
343
+ const o = (e) => Object.assign(/* @__PURE__ */ new Error(`not found: ${e}`), { code: "ENOENT" });
352
344
  const s = (e, t) => {
353
345
  const r = t.colon || i;
354
346
  const a = e.match(/\//) || n && e.match(/\\/) ? [""] : [...n ? [process.cwd()] : [], ...(t.path || process.env.PATH || "").split(r)];
@@ -376,8 +368,7 @@ var main_O = main_h((exports, t) => {
376
368
  const c = i[n];
377
369
  const l = /^".*"$/.test(c) ? c.slice(1, -1) : c;
378
370
  const d = r.join(l, e);
379
- const p = !l && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d;
380
- a(f(p, n, 0));
371
+ a(f(!l && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d, n, 0));
381
372
  });
382
373
  const f = (e, n, r) => new Promise((i, o) => {
383
374
  if (r === c.length) return i(d(n + 1));
@@ -402,8 +393,7 @@ var main_O = main_h((exports, t) => {
402
393
  for (let e = 0; e < i.length; e++) {
403
394
  const n = f + i[e];
404
395
  try {
405
- const e = a.sync(n, { pathExt: c });
406
- if (e) if (t.all) l.push(n);
396
+ if (a.sync(n, { pathExt: c })) if (t.all) l.push(n);
407
397
  else return n;
408
398
  } catch (e) {}
409
399
  }
@@ -414,21 +404,24 @@ var main_O = main_h((exports, t) => {
414
404
  };
415
405
  t.exports = c;
416
406
  c.sync = l;
417
- });
418
- var main_k = main_h((exports, t) => {
407
+ }));
408
+ //#endregion
409
+ //#region node_modules/path-key/index.js
410
+ var main_x = /* @__PURE__ */ main_l(((e, t) => {
419
411
  const n = (e = {}) => {
420
412
  const t = e.env || process.env;
421
- const n = e.platform || process.platform;
422
- if (n !== "win32") return "PATH";
413
+ if ((e.platform || process.platform) !== "win32") return "PATH";
423
414
  return Object.keys(t).reverse().find((e) => e.toUpperCase() === "PATH") || "Path";
424
415
  };
425
416
  t.exports = n;
426
417
  t.exports.default = n;
427
- });
428
- var main_A = main_h((exports, t) => {
429
- const n = main_v("path");
430
- const r = main_O();
431
- const i = main_k();
418
+ }));
419
+ //#endregion
420
+ //#region node_modules/cross-spawn/lib/util/resolveCommand.js
421
+ var main_S = /* @__PURE__ */ main_l(((e, t) => {
422
+ const n = main_u("path");
423
+ const r = main_b();
424
+ const i = main_x();
432
425
  function a(e, t) {
433
426
  const a = e.options.env || process.env;
434
427
  const o = process.cwd();
@@ -453,8 +446,10 @@ var main_A = main_h((exports, t) => {
453
446
  return a(e) || a(e, true);
454
447
  }
455
448
  t.exports = o;
456
- });
457
- var main_j = main_h((exports, t) => {
449
+ }));
450
+ //#endregion
451
+ //#region node_modules/cross-spawn/lib/util/escape.js
452
+ var main_C = /* @__PURE__ */ main_l(((e, t) => {
458
453
  const n = /([()\][%!^"`<>&|;, *?])/g;
459
454
  function r(e) {
460
455
  e = e.replace(n, "^$1");
@@ -462,8 +457,8 @@ var main_j = main_h((exports, t) => {
462
457
  }
463
458
  function i(e, t) {
464
459
  e = `${e}`;
465
- e = e.replace(/(\\*)"/g, "$1$1\\\"");
466
- e = e.replace(/(\\*)$/, "$1$1");
460
+ e = e.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
461
+ e = e.replace(/(?=(\\+?)?)\1$/, "$1$1");
467
462
  e = `"${e}"`;
468
463
  e = e.replace(n, "^$1");
469
464
  if (t) e = e.replace(n, "^$1");
@@ -471,12 +466,16 @@ var main_j = main_h((exports, t) => {
471
466
  }
472
467
  t.exports.command = r;
473
468
  t.exports.argument = i;
474
- });
475
- var main_M = main_h((exports, t) => {
469
+ }));
470
+ //#endregion
471
+ //#region node_modules/shebang-regex/index.js
472
+ var main_w = /* @__PURE__ */ main_l(((e, t) => {
476
473
  t.exports = /^#!(.*)/;
477
- });
478
- var main_N = main_h((exports, t) => {
479
- const n = main_M();
474
+ }));
475
+ //#endregion
476
+ //#region node_modules/shebang-command/index.js
477
+ var main_T = /* @__PURE__ */ main_l(((e, t) => {
478
+ const n = main_w();
480
479
  t.exports = (e = "") => {
481
480
  const t = e.match(n);
482
481
  if (!t) return null;
@@ -485,10 +484,12 @@ var main_N = main_h((exports, t) => {
485
484
  if (a === "env") return i;
486
485
  return i ? `${a} ${i}` : a;
487
486
  };
488
- });
489
- var main_P = main_h((exports, t) => {
490
- const n = main_v("fs");
491
- const r = main_N();
487
+ }));
488
+ //#endregion
489
+ //#region node_modules/cross-spawn/lib/util/readShebang.js
490
+ var main_E = /* @__PURE__ */ main_l(((e, t) => {
491
+ const n = main_u("fs");
492
+ const r = main_T();
492
493
  function i(e) {
493
494
  const t = 150;
494
495
  const i = Buffer.alloc(t);
@@ -501,12 +502,14 @@ var main_P = main_h((exports, t) => {
501
502
  return r(i.toString());
502
503
  }
503
504
  t.exports = i;
504
- });
505
- var main_F = main_h((exports, t) => {
506
- const n = main_v("path");
507
- const r = main_A();
508
- const i = main_j();
509
- const a = main_P();
505
+ }));
506
+ //#endregion
507
+ //#region node_modules/cross-spawn/lib/parse.js
508
+ var main_D = /* @__PURE__ */ main_l(((e, t) => {
509
+ const n = main_u("path");
510
+ const r = main_S();
511
+ const i = main_C();
512
+ const a = main_E();
510
513
  const o = process.platform === "win32";
511
514
  const s = /\.(?:com|exe)$/i;
512
515
  const c = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
@@ -520,7 +523,7 @@ var main_F = main_h((exports, t) => {
520
523
  }
521
524
  return e.file;
522
525
  }
523
- function u(e) {
526
+ function d(e) {
524
527
  if (!o) return e;
525
528
  const t = l(e);
526
529
  const r = !s.test(t);
@@ -529,19 +532,18 @@ var main_F = main_h((exports, t) => {
529
532
  e.command = n.normalize(e.command);
530
533
  e.command = i.command(e.command);
531
534
  e.args = e.args.map((e) => i.argument(e, r));
532
- const a = [e.command].concat(e.args).join(" ");
533
535
  e.args = [
534
536
  "/d",
535
537
  "/s",
536
538
  "/c",
537
- `"${a}"`
539
+ `"${[e.command].concat(e.args).join(" ")}"`
538
540
  ];
539
541
  e.command = process.env.comspec || "cmd.exe";
540
542
  e.options.windowsVerbatimArguments = true;
541
543
  }
542
544
  return e;
543
545
  }
544
- function d(e, t, n) {
546
+ function f(e, t, n) {
545
547
  if (t && !Array.isArray(t)) {
546
548
  n = t;
547
549
  t = null;
@@ -558,14 +560,16 @@ var main_F = main_h((exports, t) => {
558
560
  args: t
559
561
  }
560
562
  };
561
- return n.shell ? r : u(r);
563
+ return n.shell ? r : d(r);
562
564
  }
563
- t.exports = d;
564
- });
565
- var main_I = main_h((exports, t) => {
565
+ t.exports = f;
566
+ }));
567
+ //#endregion
568
+ //#region node_modules/cross-spawn/lib/enoent.js
569
+ var main_O = /* @__PURE__ */ main_l(((e, t) => {
566
570
  const n = process.platform === "win32";
567
571
  function r(e, t) {
568
- return Object.assign(new Error(`${t} ${e.command} ENOENT`), {
572
+ return Object.assign(/* @__PURE__ */ new Error(`${t} ${e.command} ENOENT`), {
569
573
  code: "ENOENT",
570
574
  errno: "ENOENT",
571
575
  syscall: `${t} ${e.command}`,
@@ -578,7 +582,7 @@ var main_I = main_h((exports, t) => {
578
582
  const r = e.emit;
579
583
  e.emit = function(n, i) {
580
584
  if (n === "exit") {
581
- const n = a(i, t, "spawn");
585
+ const n = a(i, t);
582
586
  if (n) return r.call(e, "error", n);
583
587
  }
584
588
  return r.apply(e, arguments);
@@ -598,11 +602,13 @@ var main_I = main_h((exports, t) => {
598
602
  verifyENOENTSync: o,
599
603
  notFoundError: r
600
604
  };
601
- });
602
- var main_L = main_h((exports, t) => {
603
- const n = main_v("child_process");
604
- const r = main_F();
605
- const i = main_I();
605
+ }));
606
+ //#endregion
607
+ //#region node_modules/cross-spawn/index.js
608
+ var main_k = /* @__PURE__ */ main_l(((e, t) => {
609
+ const n = main_u("child_process");
610
+ const r = main_D();
611
+ const i = main_O();
606
612
  function a(e, t, a) {
607
613
  const o = r(e, t, a);
608
614
  const s = n.spawn(o.command, o.args, o.options);
@@ -620,14 +626,15 @@ var main_L = main_h((exports, t) => {
620
626
  t.exports.sync = o;
621
627
  t.exports._parse = r;
622
628
  t.exports._enoent = i;
623
- });
624
- var main_R = main_(main_L(), 1);
625
- var main_z = class extends Error {
629
+ }));
630
+ //#endregion
631
+ //#region src/non-zero-exit-error.ts
632
+ var main_A = main_k();
633
+ var main_j = class extends Error {
626
634
  result;
627
635
  output;
628
636
  get exitCode() {
629
637
  if (this.result.exitCode !== null) return this.result.exitCode;
630
- return void 0;
631
638
  }
632
639
  constructor(e, t) {
633
640
  super(`Process exited with non-zero status (${e.exitCode})`);
@@ -635,20 +642,20 @@ var main_z = class extends Error {
635
642
  this.output = t;
636
643
  }
637
644
  };
638
- const main_B = {
645
+ //#endregion
646
+ //#region src/main.ts
647
+ const main_M = {
639
648
  timeout: void 0,
640
649
  persist: false
641
650
  };
642
- const main_V = { windowsHide: true };
643
- function main_H(e, t) {
644
- const n = (0,external_node_path_.normalize)(e);
645
- const r = t ?? [];
651
+ const main_N = { windowsHide: true };
652
+ function main_P(e, t) {
646
653
  return {
647
- command: n,
648
- args: r
654
+ command: (0,external_node_path_.normalize)(e),
655
+ args: t ?? []
649
656
  };
650
657
  }
651
- function main_U(e) {
658
+ function main_F(e) {
652
659
  const t = new AbortController();
653
660
  for (const n of e) {
654
661
  if (n.aborted) {
@@ -662,12 +669,12 @@ function main_U(e) {
662
669
  }
663
670
  return t.signal;
664
671
  }
665
- async function main_W(e) {
672
+ async function main_I(e) {
666
673
  let t = "";
667
674
  for await (const n of e) t += n.toString();
668
675
  return t;
669
676
  }
670
- var main_G = class {
677
+ var main_L = class {
671
678
  _process;
672
679
  _aborted = false;
673
680
  _options;
@@ -684,11 +691,10 @@ var main_G = class {
684
691
  }
685
692
  get exitCode() {
686
693
  if (this._process && this._process.exitCode !== null) return this._process.exitCode;
687
- return void 0;
688
694
  }
689
695
  constructor(e, t, n) {
690
696
  this._options = {
691
- ...main_B,
697
+ ...main_M,
692
698
  ...n
693
699
  };
694
700
  this._command = e;
@@ -707,7 +713,7 @@ var main_G = class {
707
713
  return this._process?.killed === true;
708
714
  }
709
715
  pipe(e, t, n) {
710
- return main_q(e, t, {
716
+ return main_z(e, t, {
711
717
  ...n,
712
718
  stdin: this
713
719
  });
@@ -718,18 +724,18 @@ var main_G = class {
718
724
  const t = [];
719
725
  if (this._streamErr) t.push(this._streamErr);
720
726
  if (this._streamOut) t.push(this._streamOut);
721
- const n = main_w(t);
727
+ const n = main_g(t);
722
728
  const r = external_node_readline_.createInterface({ input: n });
723
729
  for await (const e of r) yield e.toString();
724
730
  await this._processClosed;
725
731
  e.removeAllListeners();
726
732
  if (this._thrownError) throw this._thrownError;
727
- if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new main_z(this);
733
+ if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new main_j(this);
728
734
  }
729
735
  async _waitForOutput() {
730
736
  const e = this._process;
731
737
  if (!e) throw new Error("No process was started");
732
- const [t, n] = await Promise.all([this._streamOut ? main_W(this._streamOut) : "", this._streamErr ? main_W(this._streamErr) : ""]);
738
+ const [t, n] = await Promise.all([this._streamOut ? main_I(this._streamOut) : "", this._streamErr ? main_I(this._streamErr) : ""]);
733
739
  await this._processClosed;
734
740
  if (this._options?.stdin) await this._options.stdin;
735
741
  e.removeAllListeners();
@@ -739,7 +745,7 @@ var main_G = class {
739
745
  stdout: t,
740
746
  exitCode: this.exitCode
741
747
  };
742
- if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new main_z(this, r);
748
+ if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new main_j(this, r);
743
749
  return r;
744
750
  }
745
751
  then(e, t) {
@@ -751,7 +757,7 @@ var main_G = class {
751
757
  const e = (0,external_node_process_.cwd)();
752
758
  const n = this._options;
753
759
  const r = {
754
- ...main_V,
760
+ ...main_N,
755
761
  ...n.nodeOptions
756
762
  };
757
763
  const i = [];
@@ -759,10 +765,10 @@ var main_G = class {
759
765
  if (n.timeout !== void 0) i.push(AbortSignal.timeout(n.timeout));
760
766
  if (n.signal !== void 0) i.push(n.signal);
761
767
  if (n.persist === true) r.detached = true;
762
- if (i.length > 0) r.signal = main_U(i);
763
- r.env = main_C(e, r.env);
764
- const { command: a, args: s } = main_H(this._command, this._args);
765
- const c = (0, main_R._parse)(a, s, r);
768
+ if (i.length > 0) r.signal = main_F(i);
769
+ r.env = main_h(e, r.env);
770
+ const { command: a, args: s } = main_P(this._command, this._args);
771
+ const c = (0, main_A._parse)(a, s, r);
766
772
  const l = (0,external_node_child_process_.spawn)(c.command, c.args, c.options);
767
773
  if (l.stderr) this._streamErr = l.stderr;
768
774
  if (l.stdout) this._streamOut = l.stdout;
@@ -792,12 +798,13 @@ var main_G = class {
792
798
  if (this._resolveClose) this._resolveClose();
793
799
  };
794
800
  };
795
- const main_K = (e, t, n) => {
796
- const r = new main_G(e, t, n);
801
+ const main_R = (e, t, n) => {
802
+ const r = new main_L(e, t, n);
797
803
  r.spawn();
798
804
  return r;
799
805
  };
800
- const main_q = main_K;
806
+ const main_z = main_R;
807
+ //#endregion
801
808
 
802
809
 
803
810
  ;// CONCATENATED MODULE: ../../node_modules/nypm/dist/index.mjs
@@ -808,8 +815,6 @@ const main_q = main_K;
808
815
 
809
816
 
810
817
 
811
-
812
- //#region src/_utils.ts
813
818
  async function findup(cwd, match, options = {}) {
814
819
  const segments = (0,pathe_M_eThtNZ.n)(cwd).split("/");
815
820
  while (segments.length > 0) {
@@ -837,7 +842,7 @@ function cached(fn) {
837
842
  const hasCorepack = cached(async () => {
838
843
  if (globalThis.process?.versions?.webcontainer) return false;
839
844
  try {
840
- const { exitCode } = await main_K("corepack", ["--version"]);
845
+ const { exitCode } = await main_R("corepack", ["--version"]);
841
846
  return exitCode === 0;
842
847
  } catch {
843
848
  return false;
@@ -845,7 +850,7 @@ const hasCorepack = cached(async () => {
845
850
  });
846
851
  async function executeCommand(command, args, options = {}) {
847
852
  const xArgs = command !== "npm" && command !== "bun" && command !== "deno" && options.corepack !== false && await hasCorepack() ? ["corepack", [command, ...args]] : [command, args];
848
- const { exitCode, stdout, stderr } = await main_K(xArgs[0], xArgs[1], { nodeOptions: {
853
+ const { exitCode, stdout, stderr } = await main_R(xArgs[0], xArgs[1], { nodeOptions: {
849
854
  cwd: (0,pathe_M_eThtNZ.r)(options.cwd || process.cwd()),
850
855
  env: options.env,
851
856
  stdio: options.silent ? "pipe" : "inherit"
@@ -922,9 +927,6 @@ function parsePackageManagerField(packageManager) {
922
927
  warnings: [`Abnormal characters found in \`packageManager\` field, sanitizing from \`${name}\` to \`${sanitized}\``]
923
928
  };
924
929
  }
925
-
926
- //#endregion
927
- //#region src/package-manager.ts
928
930
  const packageManagers = [
929
931
  {
930
932
  name: "npm",
@@ -955,13 +957,6 @@ const packageManagers = [
955
957
  files: ["deno.json"]
956
958
  }
957
959
  ];
958
- /**
959
- * Detect the package manager used in a directory (and up) by checking various sources:
960
- *
961
- * 1. Use `packageManager` field from package.json
962
- *
963
- * 2. Known lock files and other files
964
- */
965
960
  async function detectPackageManager(cwd, options = {}) {
966
961
  const detected = await findup((0,pathe_M_eThtNZ.r)(cwd || "."), async (path) => {
967
962
  if (!options.ignorePackageJSON) {
@@ -995,17 +990,11 @@ async function detectPackageManager(cwd, options = {}) {
995
990
  if (!detected && !options.ignoreArgv) {
996
991
  const scriptArg = process.argv[1];
997
992
  if (scriptArg) {
998
- for (const packageManager of packageManagers) if ((/* @__PURE__ */ new RegExp(`[/\\\\]\\.?${packageManager.command}`)).test(scriptArg)) return packageManager;
993
+ for (const packageManager of packageManagers) if (new RegExp(`[/\\\\]\\.?${packageManager.command}`).test(scriptArg)) return packageManager;
999
994
  }
1000
995
  }
1001
996
  return detected;
1002
997
  }
1003
-
1004
- //#endregion
1005
- //#region src/cmd.ts
1006
- /**
1007
- * Get the command to install dependencies with the package manager.
1008
- */
1009
998
  function installDependenciesCommand(packageManager, options = {}) {
1010
999
  const installCmd = options.short ? "i" : "install";
1011
1000
  const pmToFrozenLockfileInstallCommand = {
@@ -1017,9 +1006,6 @@ function installDependenciesCommand(packageManager, options = {}) {
1017
1006
  };
1018
1007
  return fmtCommand([packageManager, ...options.frozenLockFile ? pmToFrozenLockfileInstallCommand[packageManager] : [installCmd]]);
1019
1008
  }
1020
- /**
1021
- * Get the command to add a dependency with the package manager.
1022
- */
1023
1009
  function addDependencyCommand(packageManager, name, options = {}) {
1024
1010
  const names = Array.isArray(name) ? name : [name];
1025
1011
  if (packageManager === "deno") {
@@ -1045,9 +1031,6 @@ function addDependencyCommand(packageManager, name, options = {}) {
1045
1031
  ...names
1046
1032
  ]).filter(Boolean)]);
1047
1033
  }
1048
- /**
1049
- * Get the command to run a script with the package manager.
1050
- */
1051
1034
  function runScriptCommand(packageManager, name, options = {}) {
1052
1035
  return fmtCommand([packageManager, ...[
1053
1036
  packageManager === "deno" ? "task" : "run",
@@ -1055,9 +1038,6 @@ function runScriptCommand(packageManager, name, options = {}) {
1055
1038
  ...options.args || []
1056
1039
  ]]);
1057
1040
  }
1058
- /**
1059
- * Get the command to download and execute a package with the package manager.
1060
- */
1061
1041
  function dlxCommand(packageManager, name, options = {}) {
1062
1042
  const command = {
1063
1043
  npm: options.short ? "npx" : "npm exec",
@@ -1085,18 +1065,6 @@ function dlxCommand(packageManager, name, options = {}) {
1085
1065
  ...options.args || []
1086
1066
  ]);
1087
1067
  }
1088
-
1089
- //#endregion
1090
- //#region src/api.ts
1091
- /**
1092
- * Installs project dependencies.
1093
- *
1094
- * @param options - Options to pass to the API call.
1095
- * @param options.cwd - The directory to run the command in.
1096
- * @param options.silent - Whether to run the command in silent mode.
1097
- * @param options.packageManager - The package manager info to use (auto-detected).
1098
- * @param options.frozenLockFile - Whether to install dependencies with frozen lock file.
1099
- */
1100
1068
  async function installDependencies(options = {}) {
1101
1069
  const resolvedOptions = await resolveOperationOptions(options);
1102
1070
  const commandArgs = options.frozenLockFile ? {
@@ -1117,18 +1085,6 @@ async function installDependencies(options = {}) {
1117
1085
  args: commandArgs
1118
1086
  } };
1119
1087
  }
1120
- /**
1121
- * Adds dependency to the project.
1122
- *
1123
- * @param name - Name of the dependency to add.
1124
- * @param options - Options to pass to the API call.
1125
- * @param options.cwd - The directory to run the command in.
1126
- * @param options.silent - Whether to run the command in silent mode.
1127
- * @param options.packageManager - The package manager info to use (auto-detected).
1128
- * @param options.dev - Whether to add the dependency as dev dependency.
1129
- * @param options.workspace - The name of the workspace to use.
1130
- * @param options.global - Whether to run the command in global mode.
1131
- */
1132
1088
  async function addDependency(name, options = {}) {
1133
1089
  const resolvedOptions = await resolveOperationOptions(options);
1134
1090
  const names = Array.isArray(name) ? name : [name];
@@ -1158,10 +1114,11 @@ async function addDependency(name, options = {}) {
1158
1114
  const existingPkg = await readPackageJSON(resolvedOptions.cwd);
1159
1115
  const peerDeps = [];
1160
1116
  const peerDevDeps = [];
1117
+ const _require = createRequire(join$1(resolvedOptions.cwd, "/_.js"));
1161
1118
  for (const _name of names) {
1162
1119
  const pkgName = _name.match(/^(.[^@]+)/)?.[0];
1163
- const pkg = createRequire(join$1(resolvedOptions.cwd, "/_.js"))(`${pkgName}/package.json`);
1164
- if (!pkg.peerDependencies || pkg.name !== pkgName) continue;
1120
+ const pkg = await readPackageJSON(_require.resolve(pkgName));
1121
+ if (!pkg?.peerDependencies || pkg?.name !== pkgName) continue;
1165
1122
  for (const [peerDependency, version] of Object.entries(pkg.peerDependencies)) {
1166
1123
  if (pkg.peerDependenciesMeta?.[peerDependency]?.optional) continue;
1167
1124
  if (existingPkg?.dependencies?.[peerDependency] || existingPkg?.devDependencies?.[peerDependency]) continue;
@@ -1176,36 +1133,12 @@ async function addDependency(name, options = {}) {
1176
1133
  args
1177
1134
  } };
1178
1135
  }
1179
- /**
1180
- * Adds dev dependency to the project.
1181
- *
1182
- * @param name - Name of the dev dependency to add.
1183
- * @param options - Options to pass to the API call.
1184
- * @param options.cwd - The directory to run the command in.
1185
- * @param options.silent - Whether to run the command in silent mode.
1186
- * @param options.packageManager - The package manager info to use (auto-detected).
1187
- * @param options.workspace - The name of the workspace to use.
1188
- * @param options.global - Whether to run the command in global mode.
1189
- *
1190
- */
1191
1136
  async function addDevDependency(name, options = {}) {
1192
1137
  return await addDependency(name, {
1193
1138
  ...options,
1194
1139
  dev: true
1195
1140
  });
1196
1141
  }
1197
- /**
1198
- * Removes dependency from the project.
1199
- *
1200
- * @param name - Name of the dependency to remove.
1201
- * @param options - Options to pass to the API call.
1202
- * @param options.cwd - The directory to run the command in.
1203
- * @param options.silent - Whether to run the command in silent mode.
1204
- * @param options.packageManager - The package manager info to use (auto-detected).
1205
- * @param options.dev - Whether to remove dev dependency.
1206
- * @param options.workspace - The name of the workspace to use.
1207
- * @param options.global - Whether to run the command in global mode.
1208
- */
1209
1142
  async function removeDependency(name, options = {}) {
1210
1143
  const resolvedOptions = await resolveOperationOptions(options);
1211
1144
  const names = Array.isArray(name) ? name : [name];
@@ -1234,29 +1167,11 @@ async function removeDependency(name, options = {}) {
1234
1167
  args
1235
1168
  } };
1236
1169
  }
1237
- /**
1238
- * Ensures dependency is installed.
1239
- *
1240
- * @param name - Name of the dependency.
1241
- * @param options - Options to pass to the API call.
1242
- * @param options.cwd - The directory to run the command in.
1243
- * @param options.dev - Whether to install as dev dependency (if not already installed).
1244
- * @param options.workspace - The name of the workspace to install dependency in (if not already installed).
1245
- */
1246
1170
  async function ensureDependencyInstalled(name, options = {}) {
1247
1171
  const resolvedOptions = await resolveOperationOptions(options);
1248
1172
  if (doesDependencyExist(name, resolvedOptions)) return true;
1249
1173
  await addDependency(name, resolvedOptions);
1250
1174
  }
1251
- /**
1252
- * Dedupe dependencies in the project.
1253
- *
1254
- * @param options - Options to pass to the API call.
1255
- * @param options.cwd - The directory to run the command in.
1256
- * @param options.packageManager - The package manager info to use (auto-detected).
1257
- * @param options.silent - Whether to run the command in silent mode.
1258
- * @param options.recreateLockfile - Whether to recreate the lockfile instead of deduping.
1259
- */
1260
1175
  async function dedupeDependencies(options = {}) {
1261
1176
  const resolvedOptions = await resolveOperationOptions(options);
1262
1177
  const isSupported = !["bun", "deno"].includes(resolvedOptions.packageManager.name);
@@ -1279,17 +1194,6 @@ async function dedupeDependencies(options = {}) {
1279
1194
  }
1280
1195
  throw new Error(`Deduplication is not supported for ${resolvedOptions.packageManager.name}`);
1281
1196
  }
1282
- /**
1283
- * Runs a script defined in the package.json file.
1284
- *
1285
- * @param name - Name of the script to run.
1286
- * @param options - Options to pass to the API call.
1287
- * @param options.cwd - The directory to run the command in.
1288
- * @param options.env - Additional environment variables to set for the script execution.
1289
- * @param options.silent - Whether to run the command in silent mode.
1290
- * @param options.packageManager - The package manager info to use (auto-detected).
1291
- * @param options.args - Additional arguments to pass to the script.
1292
- */
1293
1197
  async function runScript(name, options = {}) {
1294
1198
  const resolvedOptions = await resolveOperationOptions(options);
1295
1199
  const args = [
@@ -1308,19 +1212,6 @@ async function runScript(name, options = {}) {
1308
1212
  args
1309
1213
  } };
1310
1214
  }
1311
- /**
1312
- * Download and execute a package with the package manager.
1313
- *
1314
- * @param name - Name of the package to download and execute.
1315
- * @param options - Options to pass to the API call.
1316
- * @param options.cwd - The directory to run the command in.
1317
- * @param options.env - Additional environment variables to set for the command execution.
1318
- * @param options.silent - Whether to run the command in silent mode.
1319
- * @param options.packageManager - The package manager info to use (auto-detected).
1320
- * @param options.args - The arguments to pass to the command.
1321
- * @param options.short - Whether to use the short version of the command (e.g. pnpx instead of pnpm dlx).
1322
- * @param options.packages - The packages to pass to the command (e.g. npx --package=<package1> --package=<package2> <command>).
1323
- */
1324
1215
  async function dlx(name, options = {}) {
1325
1216
  const resolvedOptions = await resolveOperationOptions(options);
1326
1217
  const [command, ...args] = dlxCommand(resolvedOptions.packageManager.name, name, {
@@ -1340,7 +1231,6 @@ async function dlx(name, options = {}) {
1340
1231
  } };
1341
1232
  }
1342
1233
 
1343
- //#endregion
1344
1234
 
1345
1235
  // EXTERNAL MODULE: external "node:os"
1346
1236
  var external_node_os_ = __webpack_require__(8161);
@@ -1847,4 +1737,4 @@ async function downloadTemplate(input, options = {}) {
1847
1737
 
1848
1738
  };
1849
1739
 
1850
- //# sourceMappingURL=346.js.map
1740
+ //# sourceMappingURL=433.js.map