@simon_he/pi 0.0.73 → 0.0.74

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.
Files changed (3) hide show
  1. package/dist/index.cjs +642 -125
  2. package/dist/index.js +641 -124
  3. package/package.json +2 -4
package/dist/index.cjs CHANGED
@@ -64,8 +64,8 @@ var __privateWrapper = (obj, member, setter, getter) => ({
64
64
  // node_modules/.pnpm/picocolors@1.0.0/node_modules/picocolors/picocolors.js
65
65
  var require_picocolors = __commonJS({
66
66
  "node_modules/.pnpm/picocolors@1.0.0/node_modules/picocolors/picocolors.js"(exports, module2) {
67
- var tty2 = require("tty");
68
- var isColorSupported = !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && ("FORCE_COLOR" in process.env || process.argv.includes("--color") || process.platform === "win32" || tty2.isatty(1) && process.env.TERM !== "dumb" || "CI" in process.env);
67
+ var tty3 = require("tty");
68
+ var isColorSupported = !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && ("FORCE_COLOR" in process.env || process.argv.includes("--color") || process.platform === "win32" || tty3.isatty(1) && process.env.TERM !== "dumb" || "CI" in process.env);
69
69
  var formatter = (open, close, replace = open) => (input) => {
70
70
  let string = "" + input;
71
71
  let index = string.indexOf(close, open.length);
@@ -203,11 +203,11 @@ var require_signals = __commonJS({
203
203
  // node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js
204
204
  var require_signal_exit = __commonJS({
205
205
  "node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js"(exports, module2) {
206
- var process11 = global.process;
207
- var processOk = function(process12) {
208
- return process12 && typeof process12 === "object" && typeof process12.removeListener === "function" && typeof process12.emit === "function" && typeof process12.reallyExit === "function" && typeof process12.listeners === "function" && typeof process12.kill === "function" && typeof process12.pid === "number" && typeof process12.on === "function";
206
+ var process12 = global.process;
207
+ var processOk = function(process13) {
208
+ return process13 && typeof process13 === "object" && typeof process13.removeListener === "function" && typeof process13.emit === "function" && typeof process13.reallyExit === "function" && typeof process13.listeners === "function" && typeof process13.kill === "function" && typeof process13.pid === "number" && typeof process13.on === "function";
209
209
  };
210
- if (!processOk(process11)) {
210
+ if (!processOk(process12)) {
211
211
  module2.exports = function() {
212
212
  return function() {
213
213
  };
@@ -215,15 +215,15 @@ var require_signal_exit = __commonJS({
215
215
  } else {
216
216
  assert = require("assert");
217
217
  signals = require_signals();
218
- isWin2 = /^win/i.test(process11.platform);
218
+ isWin2 = /^win/i.test(process12.platform);
219
219
  EE = require("events");
220
220
  if (typeof EE !== "function") {
221
221
  EE = EE.EventEmitter;
222
222
  }
223
- if (process11.__signal_exit_emitter__) {
224
- emitter = process11.__signal_exit_emitter__;
223
+ if (process12.__signal_exit_emitter__) {
224
+ emitter = process12.__signal_exit_emitter__;
225
225
  } else {
226
- emitter = process11.__signal_exit_emitter__ = new EE();
226
+ emitter = process12.__signal_exit_emitter__ = new EE();
227
227
  emitter.count = 0;
228
228
  emitter.emitted = {};
229
229
  }
@@ -260,12 +260,12 @@ var require_signal_exit = __commonJS({
260
260
  loaded = false;
261
261
  signals.forEach(function(sig) {
262
262
  try {
263
- process11.removeListener(sig, sigListeners[sig]);
263
+ process12.removeListener(sig, sigListeners[sig]);
264
264
  } catch (er) {
265
265
  }
266
266
  });
267
- process11.emit = originalProcessEmit;
268
- process11.reallyExit = originalProcessReallyExit;
267
+ process12.emit = originalProcessEmit;
268
+ process12.reallyExit = originalProcessReallyExit;
269
269
  emitter.count -= 1;
270
270
  };
271
271
  module2.exports.unload = unload;
@@ -282,7 +282,7 @@ var require_signal_exit = __commonJS({
282
282
  if (!processOk(global.process)) {
283
283
  return;
284
284
  }
285
- var listeners = process11.listeners(sig);
285
+ var listeners = process12.listeners(sig);
286
286
  if (listeners.length === emitter.count) {
287
287
  unload();
288
288
  emit("exit", null, sig);
@@ -290,7 +290,7 @@ var require_signal_exit = __commonJS({
290
290
  if (isWin2 && sig === "SIGHUP") {
291
291
  sig = "SIGINT";
292
292
  }
293
- process11.kill(process11.pid, sig);
293
+ process12.kill(process12.pid, sig);
294
294
  }
295
295
  };
296
296
  });
@@ -306,36 +306,36 @@ var require_signal_exit = __commonJS({
306
306
  emitter.count += 1;
307
307
  signals = signals.filter(function(sig) {
308
308
  try {
309
- process11.on(sig, sigListeners[sig]);
309
+ process12.on(sig, sigListeners[sig]);
310
310
  return true;
311
311
  } catch (er) {
312
312
  return false;
313
313
  }
314
314
  });
315
- process11.emit = processEmit;
316
- process11.reallyExit = processReallyExit;
315
+ process12.emit = processEmit;
316
+ process12.reallyExit = processReallyExit;
317
317
  };
318
318
  module2.exports.load = load;
319
- originalProcessReallyExit = process11.reallyExit;
319
+ originalProcessReallyExit = process12.reallyExit;
320
320
  processReallyExit = function processReallyExit2(code) {
321
321
  if (!processOk(global.process)) {
322
322
  return;
323
323
  }
324
- process11.exitCode = code || /* istanbul ignore next */
324
+ process12.exitCode = code || /* istanbul ignore next */
325
325
  0;
326
- emit("exit", process11.exitCode, null);
327
- emit("afterexit", process11.exitCode, null);
328
- originalProcessReallyExit.call(process11, process11.exitCode);
326
+ emit("exit", process12.exitCode, null);
327
+ emit("afterexit", process12.exitCode, null);
328
+ originalProcessReallyExit.call(process12, process12.exitCode);
329
329
  };
330
- originalProcessEmit = process11.emit;
330
+ originalProcessEmit = process12.emit;
331
331
  processEmit = function processEmit2(ev, arg) {
332
332
  if (ev === "exit" && processOk(global.process)) {
333
333
  if (arg !== void 0) {
334
- process11.exitCode = arg;
334
+ process12.exitCode = arg;
335
335
  }
336
336
  var ret = originalProcessEmit.apply(this, arguments);
337
- emit("exit", process11.exitCode, null);
338
- emit("afterexit", process11.exitCode, null);
337
+ emit("exit", process12.exitCode, null);
338
+ emit("afterexit", process12.exitCode, null);
339
339
  return ret;
340
340
  } else {
341
341
  return originalProcessEmit.apply(this, arguments);
@@ -2030,7 +2030,7 @@ var require_clone = __commonJS({
2030
2030
  if (depth2 == 0)
2031
2031
  return parent2;
2032
2032
  var child;
2033
- var proto2;
2033
+ var proto3;
2034
2034
  if (typeof parent2 != "object") {
2035
2035
  return parent2;
2036
2036
  }
@@ -2052,11 +2052,11 @@ var require_clone = __commonJS({
2052
2052
  return child;
2053
2053
  } else {
2054
2054
  if (typeof prototype == "undefined") {
2055
- proto2 = Object.getPrototypeOf(parent2);
2056
- child = Object.create(proto2);
2055
+ proto3 = Object.getPrototypeOf(parent2);
2056
+ child = Object.create(proto3);
2057
2057
  } else {
2058
2058
  child = Object.create(prototype);
2059
- proto2 = prototype;
2059
+ proto3 = prototype;
2060
2060
  }
2061
2061
  }
2062
2062
  if (circular) {
@@ -2069,8 +2069,8 @@ var require_clone = __commonJS({
2069
2069
  }
2070
2070
  for (var i in parent2) {
2071
2071
  var attrs;
2072
- if (proto2) {
2073
- attrs = Object.getOwnPropertyDescriptor(proto2, i);
2072
+ if (proto3) {
2073
+ attrs = Object.getOwnPropertyDescriptor(proto3, i);
2074
2074
  }
2075
2075
  if (attrs && attrs.set == null) {
2076
2076
  continue;
@@ -5657,8 +5657,8 @@ __export(src_exports, {
5657
5657
  });
5658
5658
  module.exports = __toCommonJS(src_exports);
5659
5659
  var import_process3 = __toESM(require("process"), 1);
5660
- var import_lazy_js_utils12 = require("lazy-js-utils");
5661
- var import_picocolors6 = __toESM(require_picocolors(), 1);
5660
+ var import_lazy_js_utils13 = require("lazy-js-utils");
5661
+ var import_picocolors7 = __toESM(require_picocolors(), 1);
5662
5662
  var import_fast_glob = __toESM(require("fast-glob"), 1);
5663
5663
 
5664
5664
  // src/utils.ts
@@ -5666,9 +5666,9 @@ var import_path = __toESM(require("path"), 1);
5666
5666
  var import_lazy_js_utils = require("lazy-js-utils");
5667
5667
 
5668
5668
  // node_modules/.pnpm/ora@6.3.1/node_modules/ora/index.js
5669
- var import_node_process6 = __toESM(require("process"), 1);
5669
+ var import_node_process7 = __toESM(require("process"), 1);
5670
5670
 
5671
- // node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js
5671
+ // node_modules/.pnpm/ora@6.3.1/node_modules/ora/node_modules/chalk/source/vendor/ansi-styles/index.js
5672
5672
  var ANSI_BACKGROUND_OFFSET = 10;
5673
5673
  var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
5674
5674
  var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
@@ -5854,7 +5854,7 @@ function assembleStyles() {
5854
5854
  var ansiStyles = assembleStyles();
5855
5855
  var ansi_styles_default = ansiStyles;
5856
5856
 
5857
- // node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js
5857
+ // node_modules/.pnpm/ora@6.3.1/node_modules/ora/node_modules/chalk/source/vendor/supports-color/index.js
5858
5858
  var import_node_process = __toESM(require("process"), 1);
5859
5859
  var import_node_os = __toESM(require("os"), 1);
5860
5860
  var import_node_tty = __toESM(require("tty"), 1);
@@ -5980,7 +5980,7 @@ var supportsColor = {
5980
5980
  };
5981
5981
  var supports_color_default = supportsColor;
5982
5982
 
5983
- // node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/utilities.js
5983
+ // node_modules/.pnpm/ora@6.3.1/node_modules/ora/node_modules/chalk/source/utilities.js
5984
5984
  function stringReplaceAll(string, substring, replacer) {
5985
5985
  let index = string.indexOf(substring);
5986
5986
  if (index === -1) {
@@ -6010,7 +6010,7 @@ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
6010
6010
  return returnValue;
6011
6011
  }
6012
6012
 
6013
- // node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js
6013
+ // node_modules/.pnpm/ora@6.3.1/node_modules/ora/node_modules/chalk/source/index.js
6014
6014
  var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
6015
6015
  var GENERATOR = Symbol("GENERATOR");
6016
6016
  var STYLER = Symbol("STYLER");
@@ -6030,10 +6030,10 @@ var applyOptions = (object, options = {}) => {
6030
6030
  object.level = options.level === void 0 ? colorLevel : options.level;
6031
6031
  };
6032
6032
  var chalkFactory = (options) => {
6033
- const chalk2 = (...strings) => strings.join(" ");
6034
- applyOptions(chalk2, options);
6035
- Object.setPrototypeOf(chalk2, createChalk.prototype);
6036
- return chalk2;
6033
+ const chalk3 = (...strings) => strings.join(" ");
6034
+ applyOptions(chalk3, options);
6035
+ Object.setPrototypeOf(chalk3, createChalk.prototype);
6036
+ return chalk3;
6037
6037
  };
6038
6038
  function createChalk(options) {
6039
6039
  return chalkFactory(options);
@@ -6204,32 +6204,521 @@ var cli_cursor_default = cliCursor;
6204
6204
  // node_modules/.pnpm/ora@6.3.1/node_modules/ora/index.js
6205
6205
  var import_cli_spinners = __toESM(require_cli_spinners(), 1);
6206
6206
 
6207
- // node_modules/.pnpm/is-unicode-supported@1.3.0/node_modules/is-unicode-supported/index.js
6207
+ // node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js
6208
+ var ANSI_BACKGROUND_OFFSET2 = 10;
6209
+ var wrapAnsi162 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
6210
+ var wrapAnsi2562 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
6211
+ var wrapAnsi16m2 = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
6212
+ var styles3 = {
6213
+ modifier: {
6214
+ reset: [0, 0],
6215
+ // 21 isn't widely supported and 22 does the same thing
6216
+ bold: [1, 22],
6217
+ dim: [2, 22],
6218
+ italic: [3, 23],
6219
+ underline: [4, 24],
6220
+ overline: [53, 55],
6221
+ inverse: [7, 27],
6222
+ hidden: [8, 28],
6223
+ strikethrough: [9, 29]
6224
+ },
6225
+ color: {
6226
+ black: [30, 39],
6227
+ red: [31, 39],
6228
+ green: [32, 39],
6229
+ yellow: [33, 39],
6230
+ blue: [34, 39],
6231
+ magenta: [35, 39],
6232
+ cyan: [36, 39],
6233
+ white: [37, 39],
6234
+ // Bright color
6235
+ blackBright: [90, 39],
6236
+ gray: [90, 39],
6237
+ // Alias of `blackBright`
6238
+ grey: [90, 39],
6239
+ // Alias of `blackBright`
6240
+ redBright: [91, 39],
6241
+ greenBright: [92, 39],
6242
+ yellowBright: [93, 39],
6243
+ blueBright: [94, 39],
6244
+ magentaBright: [95, 39],
6245
+ cyanBright: [96, 39],
6246
+ whiteBright: [97, 39]
6247
+ },
6248
+ bgColor: {
6249
+ bgBlack: [40, 49],
6250
+ bgRed: [41, 49],
6251
+ bgGreen: [42, 49],
6252
+ bgYellow: [43, 49],
6253
+ bgBlue: [44, 49],
6254
+ bgMagenta: [45, 49],
6255
+ bgCyan: [46, 49],
6256
+ bgWhite: [47, 49],
6257
+ // Bright color
6258
+ bgBlackBright: [100, 49],
6259
+ bgGray: [100, 49],
6260
+ // Alias of `bgBlackBright`
6261
+ bgGrey: [100, 49],
6262
+ // Alias of `bgBlackBright`
6263
+ bgRedBright: [101, 49],
6264
+ bgGreenBright: [102, 49],
6265
+ bgYellowBright: [103, 49],
6266
+ bgBlueBright: [104, 49],
6267
+ bgMagentaBright: [105, 49],
6268
+ bgCyanBright: [106, 49],
6269
+ bgWhiteBright: [107, 49]
6270
+ }
6271
+ };
6272
+ var modifierNames2 = Object.keys(styles3.modifier);
6273
+ var foregroundColorNames2 = Object.keys(styles3.color);
6274
+ var backgroundColorNames2 = Object.keys(styles3.bgColor);
6275
+ var colorNames2 = [...foregroundColorNames2, ...backgroundColorNames2];
6276
+ function assembleStyles2() {
6277
+ const codes = /* @__PURE__ */ new Map();
6278
+ for (const [groupName, group] of Object.entries(styles3)) {
6279
+ for (const [styleName, style] of Object.entries(group)) {
6280
+ styles3[styleName] = {
6281
+ open: `\x1B[${style[0]}m`,
6282
+ close: `\x1B[${style[1]}m`
6283
+ };
6284
+ group[styleName] = styles3[styleName];
6285
+ codes.set(style[0], style[1]);
6286
+ }
6287
+ Object.defineProperty(styles3, groupName, {
6288
+ value: group,
6289
+ enumerable: false
6290
+ });
6291
+ }
6292
+ Object.defineProperty(styles3, "codes", {
6293
+ value: codes,
6294
+ enumerable: false
6295
+ });
6296
+ styles3.color.close = "\x1B[39m";
6297
+ styles3.bgColor.close = "\x1B[49m";
6298
+ styles3.color.ansi = wrapAnsi162();
6299
+ styles3.color.ansi256 = wrapAnsi2562();
6300
+ styles3.color.ansi16m = wrapAnsi16m2();
6301
+ styles3.bgColor.ansi = wrapAnsi162(ANSI_BACKGROUND_OFFSET2);
6302
+ styles3.bgColor.ansi256 = wrapAnsi2562(ANSI_BACKGROUND_OFFSET2);
6303
+ styles3.bgColor.ansi16m = wrapAnsi16m2(ANSI_BACKGROUND_OFFSET2);
6304
+ Object.defineProperties(styles3, {
6305
+ rgbToAnsi256: {
6306
+ value(red, green, blue) {
6307
+ if (red === green && green === blue) {
6308
+ if (red < 8) {
6309
+ return 16;
6310
+ }
6311
+ if (red > 248) {
6312
+ return 231;
6313
+ }
6314
+ return Math.round((red - 8) / 247 * 24) + 232;
6315
+ }
6316
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
6317
+ },
6318
+ enumerable: false
6319
+ },
6320
+ hexToRgb: {
6321
+ value(hex) {
6322
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
6323
+ if (!matches) {
6324
+ return [0, 0, 0];
6325
+ }
6326
+ let [colorString] = matches;
6327
+ if (colorString.length === 3) {
6328
+ colorString = [...colorString].map((character) => character + character).join("");
6329
+ }
6330
+ const integer = Number.parseInt(colorString, 16);
6331
+ return [
6332
+ /* eslint-disable no-bitwise */
6333
+ integer >> 16 & 255,
6334
+ integer >> 8 & 255,
6335
+ integer & 255
6336
+ /* eslint-enable no-bitwise */
6337
+ ];
6338
+ },
6339
+ enumerable: false
6340
+ },
6341
+ hexToAnsi256: {
6342
+ value: (hex) => styles3.rgbToAnsi256(...styles3.hexToRgb(hex)),
6343
+ enumerable: false
6344
+ },
6345
+ ansi256ToAnsi: {
6346
+ value(code) {
6347
+ if (code < 8) {
6348
+ return 30 + code;
6349
+ }
6350
+ if (code < 16) {
6351
+ return 90 + (code - 8);
6352
+ }
6353
+ let red;
6354
+ let green;
6355
+ let blue;
6356
+ if (code >= 232) {
6357
+ red = ((code - 232) * 10 + 8) / 255;
6358
+ green = red;
6359
+ blue = red;
6360
+ } else {
6361
+ code -= 16;
6362
+ const remainder = code % 36;
6363
+ red = Math.floor(code / 36) / 5;
6364
+ green = Math.floor(remainder / 6) / 5;
6365
+ blue = remainder % 6 / 5;
6366
+ }
6367
+ const value = Math.max(red, green, blue) * 2;
6368
+ if (value === 0) {
6369
+ return 30;
6370
+ }
6371
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
6372
+ if (value === 2) {
6373
+ result += 60;
6374
+ }
6375
+ return result;
6376
+ },
6377
+ enumerable: false
6378
+ },
6379
+ rgbToAnsi: {
6380
+ value: (red, green, blue) => styles3.ansi256ToAnsi(styles3.rgbToAnsi256(red, green, blue)),
6381
+ enumerable: false
6382
+ },
6383
+ hexToAnsi: {
6384
+ value: (hex) => styles3.ansi256ToAnsi(styles3.hexToAnsi256(hex)),
6385
+ enumerable: false
6386
+ }
6387
+ });
6388
+ return styles3;
6389
+ }
6390
+ var ansiStyles2 = assembleStyles2();
6391
+ var ansi_styles_default2 = ansiStyles2;
6392
+
6393
+ // node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js
6208
6394
  var import_node_process4 = __toESM(require("process"), 1);
6395
+ var import_node_os2 = __toESM(require("os"), 1);
6396
+ var import_node_tty2 = __toESM(require("tty"), 1);
6397
+ function hasFlag2(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process4.default.argv) {
6398
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
6399
+ const position = argv.indexOf(prefix + flag);
6400
+ const terminatorPosition = argv.indexOf("--");
6401
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
6402
+ }
6403
+ var { env: env2 } = import_node_process4.default;
6404
+ var flagForceColor2;
6405
+ if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) {
6406
+ flagForceColor2 = 0;
6407
+ } else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) {
6408
+ flagForceColor2 = 1;
6409
+ }
6410
+ function envForceColor2() {
6411
+ if ("FORCE_COLOR" in env2) {
6412
+ if (env2.FORCE_COLOR === "true") {
6413
+ return 1;
6414
+ }
6415
+ if (env2.FORCE_COLOR === "false") {
6416
+ return 0;
6417
+ }
6418
+ return env2.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env2.FORCE_COLOR, 10), 3);
6419
+ }
6420
+ }
6421
+ function translateLevel2(level) {
6422
+ if (level === 0) {
6423
+ return false;
6424
+ }
6425
+ return {
6426
+ level,
6427
+ hasBasic: true,
6428
+ has256: level >= 2,
6429
+ has16m: level >= 3
6430
+ };
6431
+ }
6432
+ function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
6433
+ const noFlagForceColor = envForceColor2();
6434
+ if (noFlagForceColor !== void 0) {
6435
+ flagForceColor2 = noFlagForceColor;
6436
+ }
6437
+ const forceColor = sniffFlags ? flagForceColor2 : noFlagForceColor;
6438
+ if (forceColor === 0) {
6439
+ return 0;
6440
+ }
6441
+ if (sniffFlags) {
6442
+ if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) {
6443
+ return 3;
6444
+ }
6445
+ if (hasFlag2("color=256")) {
6446
+ return 2;
6447
+ }
6448
+ }
6449
+ if ("TF_BUILD" in env2 && "AGENT_NAME" in env2) {
6450
+ return 1;
6451
+ }
6452
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
6453
+ return 0;
6454
+ }
6455
+ const min = forceColor || 0;
6456
+ if (env2.TERM === "dumb") {
6457
+ return min;
6458
+ }
6459
+ if (import_node_process4.default.platform === "win32") {
6460
+ const osRelease = import_node_os2.default.release().split(".");
6461
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
6462
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
6463
+ }
6464
+ return 1;
6465
+ }
6466
+ if ("CI" in env2) {
6467
+ if ("GITHUB_ACTIONS" in env2 || "GITEA_ACTIONS" in env2) {
6468
+ return 3;
6469
+ }
6470
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") {
6471
+ return 1;
6472
+ }
6473
+ return min;
6474
+ }
6475
+ if ("TEAMCITY_VERSION" in env2) {
6476
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
6477
+ }
6478
+ if (env2.COLORTERM === "truecolor") {
6479
+ return 3;
6480
+ }
6481
+ if (env2.TERM === "xterm-kitty") {
6482
+ return 3;
6483
+ }
6484
+ if ("TERM_PROGRAM" in env2) {
6485
+ const version2 = Number.parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
6486
+ switch (env2.TERM_PROGRAM) {
6487
+ case "iTerm.app": {
6488
+ return version2 >= 3 ? 3 : 2;
6489
+ }
6490
+ case "Apple_Terminal": {
6491
+ return 2;
6492
+ }
6493
+ }
6494
+ }
6495
+ if (/-256(color)?$/i.test(env2.TERM)) {
6496
+ return 2;
6497
+ }
6498
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) {
6499
+ return 1;
6500
+ }
6501
+ if ("COLORTERM" in env2) {
6502
+ return 1;
6503
+ }
6504
+ return min;
6505
+ }
6506
+ function createSupportsColor2(stream, options = {}) {
6507
+ const level = _supportsColor2(stream, {
6508
+ streamIsTTY: stream && stream.isTTY,
6509
+ ...options
6510
+ });
6511
+ return translateLevel2(level);
6512
+ }
6513
+ var supportsColor2 = {
6514
+ stdout: createSupportsColor2({ isTTY: import_node_tty2.default.isatty(1) }),
6515
+ stderr: createSupportsColor2({ isTTY: import_node_tty2.default.isatty(2) })
6516
+ };
6517
+ var supports_color_default2 = supportsColor2;
6518
+
6519
+ // node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/utilities.js
6520
+ function stringReplaceAll2(string, substring, replacer) {
6521
+ let index = string.indexOf(substring);
6522
+ if (index === -1) {
6523
+ return string;
6524
+ }
6525
+ const substringLength = substring.length;
6526
+ let endIndex = 0;
6527
+ let returnValue = "";
6528
+ do {
6529
+ returnValue += string.slice(endIndex, index) + substring + replacer;
6530
+ endIndex = index + substringLength;
6531
+ index = string.indexOf(substring, endIndex);
6532
+ } while (index !== -1);
6533
+ returnValue += string.slice(endIndex);
6534
+ return returnValue;
6535
+ }
6536
+ function stringEncaseCRLFWithFirstIndex2(string, prefix, postfix, index) {
6537
+ let endIndex = 0;
6538
+ let returnValue = "";
6539
+ do {
6540
+ const gotCR = string[index - 1] === "\r";
6541
+ returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
6542
+ endIndex = index + 1;
6543
+ index = string.indexOf("\n", endIndex);
6544
+ } while (index !== -1);
6545
+ returnValue += string.slice(endIndex);
6546
+ return returnValue;
6547
+ }
6548
+
6549
+ // node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js
6550
+ var { stdout: stdoutColor2, stderr: stderrColor2 } = supports_color_default2;
6551
+ var GENERATOR2 = Symbol("GENERATOR");
6552
+ var STYLER2 = Symbol("STYLER");
6553
+ var IS_EMPTY2 = Symbol("IS_EMPTY");
6554
+ var levelMapping2 = [
6555
+ "ansi",
6556
+ "ansi",
6557
+ "ansi256",
6558
+ "ansi16m"
6559
+ ];
6560
+ var styles4 = /* @__PURE__ */ Object.create(null);
6561
+ var applyOptions2 = (object, options = {}) => {
6562
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
6563
+ throw new Error("The `level` option should be an integer from 0 to 3");
6564
+ }
6565
+ const colorLevel = stdoutColor2 ? stdoutColor2.level : 0;
6566
+ object.level = options.level === void 0 ? colorLevel : options.level;
6567
+ };
6568
+ var chalkFactory2 = (options) => {
6569
+ const chalk3 = (...strings) => strings.join(" ");
6570
+ applyOptions2(chalk3, options);
6571
+ Object.setPrototypeOf(chalk3, createChalk2.prototype);
6572
+ return chalk3;
6573
+ };
6574
+ function createChalk2(options) {
6575
+ return chalkFactory2(options);
6576
+ }
6577
+ Object.setPrototypeOf(createChalk2.prototype, Function.prototype);
6578
+ for (const [styleName, style] of Object.entries(ansi_styles_default2)) {
6579
+ styles4[styleName] = {
6580
+ get() {
6581
+ const builder = createBuilder2(this, createStyler2(style.open, style.close, this[STYLER2]), this[IS_EMPTY2]);
6582
+ Object.defineProperty(this, styleName, { value: builder });
6583
+ return builder;
6584
+ }
6585
+ };
6586
+ }
6587
+ styles4.visible = {
6588
+ get() {
6589
+ const builder = createBuilder2(this, this[STYLER2], true);
6590
+ Object.defineProperty(this, "visible", { value: builder });
6591
+ return builder;
6592
+ }
6593
+ };
6594
+ var getModelAnsi2 = (model, level, type, ...arguments_) => {
6595
+ if (model === "rgb") {
6596
+ if (level === "ansi16m") {
6597
+ return ansi_styles_default2[type].ansi16m(...arguments_);
6598
+ }
6599
+ if (level === "ansi256") {
6600
+ return ansi_styles_default2[type].ansi256(ansi_styles_default2.rgbToAnsi256(...arguments_));
6601
+ }
6602
+ return ansi_styles_default2[type].ansi(ansi_styles_default2.rgbToAnsi(...arguments_));
6603
+ }
6604
+ if (model === "hex") {
6605
+ return getModelAnsi2("rgb", level, type, ...ansi_styles_default2.hexToRgb(...arguments_));
6606
+ }
6607
+ return ansi_styles_default2[type][model](...arguments_);
6608
+ };
6609
+ var usedModels2 = ["rgb", "hex", "ansi256"];
6610
+ for (const model of usedModels2) {
6611
+ styles4[model] = {
6612
+ get() {
6613
+ const { level } = this;
6614
+ return function(...arguments_) {
6615
+ const styler = createStyler2(getModelAnsi2(model, levelMapping2[level], "color", ...arguments_), ansi_styles_default2.color.close, this[STYLER2]);
6616
+ return createBuilder2(this, styler, this[IS_EMPTY2]);
6617
+ };
6618
+ }
6619
+ };
6620
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
6621
+ styles4[bgModel] = {
6622
+ get() {
6623
+ const { level } = this;
6624
+ return function(...arguments_) {
6625
+ const styler = createStyler2(getModelAnsi2(model, levelMapping2[level], "bgColor", ...arguments_), ansi_styles_default2.bgColor.close, this[STYLER2]);
6626
+ return createBuilder2(this, styler, this[IS_EMPTY2]);
6627
+ };
6628
+ }
6629
+ };
6630
+ }
6631
+ var proto2 = Object.defineProperties(() => {
6632
+ }, {
6633
+ ...styles4,
6634
+ level: {
6635
+ enumerable: true,
6636
+ get() {
6637
+ return this[GENERATOR2].level;
6638
+ },
6639
+ set(level) {
6640
+ this[GENERATOR2].level = level;
6641
+ }
6642
+ }
6643
+ });
6644
+ var createStyler2 = (open, close, parent) => {
6645
+ let openAll;
6646
+ let closeAll;
6647
+ if (parent === void 0) {
6648
+ openAll = open;
6649
+ closeAll = close;
6650
+ } else {
6651
+ openAll = parent.openAll + open;
6652
+ closeAll = close + parent.closeAll;
6653
+ }
6654
+ return {
6655
+ open,
6656
+ close,
6657
+ openAll,
6658
+ closeAll,
6659
+ parent
6660
+ };
6661
+ };
6662
+ var createBuilder2 = (self2, _styler, _isEmpty) => {
6663
+ const builder = (...arguments_) => applyStyle2(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
6664
+ Object.setPrototypeOf(builder, proto2);
6665
+ builder[GENERATOR2] = self2;
6666
+ builder[STYLER2] = _styler;
6667
+ builder[IS_EMPTY2] = _isEmpty;
6668
+ return builder;
6669
+ };
6670
+ var applyStyle2 = (self2, string) => {
6671
+ if (self2.level <= 0 || !string) {
6672
+ return self2[IS_EMPTY2] ? "" : string;
6673
+ }
6674
+ let styler = self2[STYLER2];
6675
+ if (styler === void 0) {
6676
+ return string;
6677
+ }
6678
+ const { openAll, closeAll } = styler;
6679
+ if (string.includes("\x1B")) {
6680
+ while (styler !== void 0) {
6681
+ string = stringReplaceAll2(string, styler.close, styler.open);
6682
+ styler = styler.parent;
6683
+ }
6684
+ }
6685
+ const lfIndex = string.indexOf("\n");
6686
+ if (lfIndex !== -1) {
6687
+ string = stringEncaseCRLFWithFirstIndex2(string, closeAll, openAll, lfIndex);
6688
+ }
6689
+ return openAll + string + closeAll;
6690
+ };
6691
+ Object.defineProperties(createChalk2.prototype, styles4);
6692
+ var chalk2 = createChalk2();
6693
+ var chalkStderr2 = createChalk2({ level: stderrColor2 ? stderrColor2.level : 0 });
6694
+ var source_default2 = chalk2;
6695
+
6696
+ // node_modules/.pnpm/is-unicode-supported@1.3.0/node_modules/is-unicode-supported/index.js
6697
+ var import_node_process5 = __toESM(require("process"), 1);
6209
6698
  function isUnicodeSupported() {
6210
- if (import_node_process4.default.platform !== "win32") {
6211
- return import_node_process4.default.env.TERM !== "linux";
6699
+ if (import_node_process5.default.platform !== "win32") {
6700
+ return import_node_process5.default.env.TERM !== "linux";
6212
6701
  }
6213
- return Boolean(import_node_process4.default.env.CI) || Boolean(import_node_process4.default.env.WT_SESSION) || Boolean(import_node_process4.default.env.TERMINUS_SUBLIME) || import_node_process4.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process4.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process4.default.env.TERM_PROGRAM === "vscode" || import_node_process4.default.env.TERM === "xterm-256color" || import_node_process4.default.env.TERM === "alacritty" || import_node_process4.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
6702
+ return Boolean(import_node_process5.default.env.CI) || Boolean(import_node_process5.default.env.WT_SESSION) || Boolean(import_node_process5.default.env.TERMINUS_SUBLIME) || import_node_process5.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process5.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process5.default.env.TERM_PROGRAM === "vscode" || import_node_process5.default.env.TERM === "xterm-256color" || import_node_process5.default.env.TERM === "alacritty" || import_node_process5.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
6214
6703
  }
6215
6704
 
6216
6705
  // node_modules/.pnpm/log-symbols@5.1.0/node_modules/log-symbols/index.js
6217
6706
  var main = {
6218
- info: source_default.blue("\u2139"),
6219
- success: source_default.green("\u2714"),
6220
- warning: source_default.yellow("\u26A0"),
6221
- error: source_default.red("\u2716")
6707
+ info: source_default2.blue("\u2139"),
6708
+ success: source_default2.green("\u2714"),
6709
+ warning: source_default2.yellow("\u26A0"),
6710
+ error: source_default2.red("\u2716")
6222
6711
  };
6223
6712
  var fallback = {
6224
- info: source_default.blue("i"),
6225
- success: source_default.green("\u221A"),
6226
- warning: source_default.yellow("\u203C"),
6227
- error: source_default.red("\xD7")
6713
+ info: source_default2.blue("i"),
6714
+ success: source_default2.green("\u221A"),
6715
+ warning: source_default2.yellow("\u203C"),
6716
+ error: source_default2.red("\xD7")
6228
6717
  };
6229
6718
  var logSymbols = isUnicodeSupported() ? main : fallback;
6230
6719
  var log_symbols_default = logSymbols;
6231
6720
 
6232
- // node_modules/.pnpm/ansi-regex@6.0.1/node_modules/ansi-regex/index.js
6721
+ // node_modules/.pnpm/ora@6.3.1/node_modules/ora/node_modules/strip-ansi/node_modules/ansi-regex/index.js
6233
6722
  function ansiRegex({ onlyFirst = false } = {}) {
6234
6723
  const pattern = [
6235
6724
  "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
@@ -6238,7 +6727,7 @@ function ansiRegex({ onlyFirst = false } = {}) {
6238
6727
  return new RegExp(pattern, onlyFirst ? void 0 : "g");
6239
6728
  }
6240
6729
 
6241
- // node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js
6730
+ // node_modules/.pnpm/ora@6.3.1/node_modules/ora/node_modules/strip-ansi/index.js
6242
6731
  var regex = ansiRegex();
6243
6732
  function stripAnsi(string) {
6244
6733
  if (typeof string !== "string") {
@@ -6258,7 +6747,7 @@ function isInteractive({ stream = process.stdout } = {}) {
6258
6747
  }
6259
6748
 
6260
6749
  // node_modules/.pnpm/stdin-discarder@0.1.0/node_modules/stdin-discarder/index.js
6261
- var import_node_process5 = __toESM(require("process"), 1);
6750
+ var import_node_process6 = __toESM(require("process"), 1);
6262
6751
  var import_node_readline = __toESM(require("readline"), 1);
6263
6752
  var import_bl = __toESM(require_bl(), 1);
6264
6753
  var ASCII_ETX_CODE = 3;
@@ -6269,20 +6758,20 @@ var StdinDiscarder = class {
6269
6758
  __privateAdd(this, _mutedStream, new import_bl.BufferListStream());
6270
6759
  __privateAdd(this, _ourEmit, void 0);
6271
6760
  __privateAdd(this, _rl, void 0);
6272
- __privateGet(this, _mutedStream).pipe(import_node_process5.default.stdout);
6761
+ __privateGet(this, _mutedStream).pipe(import_node_process6.default.stdout);
6273
6762
  const self2 = this;
6274
6763
  __privateSet(this, _ourEmit, function(event, data, ...arguments_) {
6275
- const { stdin } = import_node_process5.default;
6764
+ const { stdin } = import_node_process6.default;
6276
6765
  if (__privateGet(self2, _requests) > 0 || stdin.emit === __privateGet(self2, _ourEmit)) {
6277
6766
  if (event === "keypress") {
6278
6767
  return;
6279
6768
  }
6280
6769
  if (event === "data" && data.includes(ASCII_ETX_CODE)) {
6281
- import_node_process5.default.emit("SIGINT");
6770
+ import_node_process6.default.emit("SIGINT");
6282
6771
  }
6283
6772
  Reflect.apply(__privateGet(self2, _ourEmit), this, [event, data, ...arguments_]);
6284
6773
  } else {
6285
- Reflect.apply(import_node_process5.default.stdin.emit, this, [event, data, ...arguments_]);
6774
+ Reflect.apply(import_node_process6.default.stdin.emit, this, [event, data, ...arguments_]);
6286
6775
  }
6287
6776
  });
6288
6777
  }
@@ -6303,24 +6792,24 @@ var StdinDiscarder = class {
6303
6792
  }
6304
6793
  // TODO: Use private methods when targeting Node.js 14.
6305
6794
  _realStart() {
6306
- if (import_node_process5.default.platform === "win32") {
6795
+ if (import_node_process6.default.platform === "win32") {
6307
6796
  return;
6308
6797
  }
6309
6798
  __privateSet(this, _rl, import_node_readline.default.createInterface({
6310
- input: import_node_process5.default.stdin,
6799
+ input: import_node_process6.default.stdin,
6311
6800
  output: __privateGet(this, _mutedStream)
6312
6801
  }));
6313
6802
  __privateGet(this, _rl).on("SIGINT", () => {
6314
- if (import_node_process5.default.listenerCount("SIGINT") === 0) {
6315
- import_node_process5.default.emit("SIGINT");
6803
+ if (import_node_process6.default.listenerCount("SIGINT") === 0) {
6804
+ import_node_process6.default.emit("SIGINT");
6316
6805
  } else {
6317
6806
  __privateGet(this, _rl).close();
6318
- import_node_process5.default.kill(import_node_process5.default.pid, "SIGINT");
6807
+ import_node_process6.default.kill(import_node_process6.default.pid, "SIGINT");
6319
6808
  }
6320
6809
  });
6321
6810
  }
6322
6811
  _realStop() {
6323
- if (import_node_process5.default.platform === "win32") {
6812
+ if (import_node_process6.default.platform === "win32") {
6324
6813
  return;
6325
6814
  }
6326
6815
  __privateGet(this, _rl).close();
@@ -6362,7 +6851,7 @@ var Ora = class {
6362
6851
  }
6363
6852
  __privateSet(this, _options, {
6364
6853
  color: "cyan",
6365
- stream: import_node_process6.default.stderr,
6854
+ stream: import_node_process7.default.stderr,
6366
6855
  discardStdin: true,
6367
6856
  hideCursor: true,
6368
6857
  ...options
@@ -6377,7 +6866,7 @@ var Ora = class {
6377
6866
  this.prefixText = __privateGet(this, _options).prefixText;
6378
6867
  this.suffixText = __privateGet(this, _options).suffixText;
6379
6868
  this.indent = __privateGet(this, _options).indent;
6380
- if (import_node_process6.default.env.NODE_ENV === "test") {
6869
+ if (import_node_process7.default.env.NODE_ENV === "test") {
6381
6870
  this._stream = __privateGet(this, _stream);
6382
6871
  this._isEnabled = __privateGet(this, _isEnabled);
6383
6872
  Object.defineProperty(this, "_linesToClear", {
@@ -6564,7 +7053,7 @@ var Ora = class {
6564
7053
  if (__privateGet(this, _options).hideCursor) {
6565
7054
  cli_cursor_default.hide(__privateGet(this, _stream));
6566
7055
  }
6567
- if (__privateGet(this, _options).discardStdin && import_node_process6.default.stdin.isTTY) {
7056
+ if (__privateGet(this, _options).discardStdin && import_node_process7.default.stdin.isTTY) {
6568
7057
  __privateSet(this, _isDiscardingStdin, true);
6569
7058
  stdin_discarder_default.start();
6570
7059
  }
@@ -6583,7 +7072,7 @@ var Ora = class {
6583
7072
  if (__privateGet(this, _options).hideCursor) {
6584
7073
  cli_cursor_default.show(__privateGet(this, _stream));
6585
7074
  }
6586
- if (__privateGet(this, _options).discardStdin && import_node_process6.default.stdin.isTTY && __privateGet(this, _isDiscardingStdin)) {
7075
+ if (__privateGet(this, _options).discardStdin && import_node_process7.default.stdin.isTTY && __privateGet(this, _isDiscardingStdin)) {
6587
7076
  stdin_discarder_default.stop();
6588
7077
  __privateSet(this, _isDiscardingStdin, false);
6589
7078
  }
@@ -6741,7 +7230,7 @@ function getLatestVersion(pkg) {
6741
7230
  var import_lazy_js_utils2 = require("lazy-js-utils");
6742
7231
 
6743
7232
  // package.json
6744
- var version = "0.0.73";
7233
+ var version = "0.0.74";
6745
7234
 
6746
7235
  // src/help.ts
6747
7236
  var isZh2 = process.env.PI_Lang === "zh";
@@ -6880,7 +7369,35 @@ function pfind(params) {
6880
7369
  }
6881
7370
 
6882
7371
  // src/pil.ts
7372
+ var import_lazy_js_utils7 = require("lazy-js-utils");
7373
+ var import_picocolors4 = __toESM(require_picocolors(), 1);
6883
7374
  async function pil(params) {
7375
+ if (!params) {
7376
+ const { dependencies, devDependencies } = await (0, import_lazy_js_utils7.getPkg)();
7377
+ const deps = [
7378
+ ...Object.keys(dependencies).map((key) => `${key}: ${dependencies[key]}`),
7379
+ ...Object.keys(devDependencies).map(
7380
+ (key) => `${key}: ${devDependencies[key]}`
7381
+ )
7382
+ ];
7383
+ const { result: choose, status } = (0, import_lazy_js_utils7.jsShell)(
7384
+ `echo ${deps.join(
7385
+ ","
7386
+ )} | sed "s/,/\\n/g" | gum filter --placeholder=" \u{1F914}${process.env.PI_Lang === "zh" ? "\u8BF7\u9009\u62E9\u4E00\u4E2A\u4F9D\u8D56\u83B7\u53D6\u6700\u65B0\u7248\u672C" : "Please select a dependency to get the latest version."}"`,
7387
+ "pipe"
7388
+ );
7389
+ if (status === 130) {
7390
+ console.log(import_picocolors4.default.dim("\u5DF2\u53D6\u6D88"));
7391
+ process.exit(0);
7392
+ } else if (status !== 0) {
7393
+ throw new Error(choose);
7394
+ }
7395
+ const name = choose.split(": ")[0];
7396
+ if (name in devDependencies)
7397
+ params = `${name} -D`;
7398
+ else
7399
+ params = name;
7400
+ }
6884
7401
  let latestPkgname = addLatest(params);
6885
7402
  let suffix = "";
6886
7403
  const reg = /\s(-[dDwW]+)/g;
@@ -6900,32 +7417,32 @@ function addLatest(params) {
6900
7417
  }
6901
7418
 
6902
7419
  // src/pinit.ts
6903
- var import_lazy_js_utils7 = require("lazy-js-utils");
7420
+ var import_lazy_js_utils8 = require("lazy-js-utils");
6904
7421
  async function pinit() {
6905
7422
  console.log("Initializing project...");
6906
- switch (await (0, import_lazy_js_utils7.getPkgTool)()) {
7423
+ switch (await (0, import_lazy_js_utils8.getPkgTool)()) {
6907
7424
  case "npm":
6908
- (0, import_lazy_js_utils7.jsShell)("npm init -y");
7425
+ (0, import_lazy_js_utils8.jsShell)("npm init -y");
6909
7426
  return;
6910
7427
  case "yarn":
6911
- (0, import_lazy_js_utils7.jsShell)("yarn init -y");
7428
+ (0, import_lazy_js_utils8.jsShell)("yarn init -y");
6912
7429
  return;
6913
7430
  case "pnpm":
6914
- (0, import_lazy_js_utils7.jsShell)("pnpm init -y");
7431
+ (0, import_lazy_js_utils8.jsShell)("pnpm init -y");
6915
7432
  return;
6916
7433
  default:
6917
- (0, import_lazy_js_utils7.jsShell)("npm init -y");
7434
+ (0, import_lazy_js_utils8.jsShell)("npm init -y");
6918
7435
  }
6919
7436
  }
6920
7437
 
6921
7438
  // src/pix.ts
6922
- var import_lazy_js_utils8 = require("lazy-js-utils");
7439
+ var import_lazy_js_utils9 = require("lazy-js-utils");
6923
7440
  async function pix(params) {
6924
- switch (await (0, import_lazy_js_utils8.getPkgTool)()) {
7441
+ switch (await (0, import_lazy_js_utils9.getPkgTool)()) {
6925
7442
  case "bun":
6926
- return (0, import_lazy_js_utils8.jsShell)(`bunx ${params}`);
7443
+ return (0, import_lazy_js_utils9.jsShell)(`bunx ${params}`);
6927
7444
  default:
6928
- return (0, import_lazy_js_utils8.jsShell)(`npx ${params}`);
7445
+ return (0, import_lazy_js_utils9.jsShell)(`npx ${params}`);
6929
7446
  }
6930
7447
  }
6931
7448
 
@@ -6936,14 +7453,14 @@ function prun(params) {
6936
7453
  }
6937
7454
 
6938
7455
  // src/pu.ts
6939
- var import_lazy_js_utils9 = require("lazy-js-utils");
7456
+ var import_lazy_js_utils10 = require("lazy-js-utils");
6940
7457
  function pu() {
6941
- return (0, import_lazy_js_utils9.jsShell)("nu");
7458
+ return (0, import_lazy_js_utils10.jsShell)("nu");
6942
7459
  }
6943
7460
 
6944
7461
  // src/pui.ts
6945
- var import_lazy_js_utils10 = require("lazy-js-utils");
6946
- var import_picocolors4 = __toESM(require_picocolors(), 1);
7462
+ var import_lazy_js_utils11 = require("lazy-js-utils");
7463
+ var import_picocolors5 = __toESM(require_picocolors(), 1);
6947
7464
  var isZh4 = process.env.PI_Lang === "zh";
6948
7465
  async function pui(params, pkg) {
6949
7466
  const text = `${isZh4 ? "\u6B63\u5728\u4E3A\u60A8\u5378\u8F7D" : "Uninstalling"} ${pkg} ...`;
@@ -6952,43 +7469,43 @@ async function pui(params, pkg) {
6952
7469
  const failMsg = isZh4 ? `${pkg}\u5378\u8F7D\u5931\u8D25 \u{1F62D}` : `Failed to uninstall ${pkg} \u{1F62D}`;
6953
7470
  if (!pkg) {
6954
7471
  console.log(
6955
- import_picocolors4.default.yellow(
7472
+ import_picocolors5.default.yellow(
6956
7473
  isZh4 ? "\u9700\u8981\u6307\u5B9A\u8981\u5378\u8F7D\u7684\u5305\u540D\uFF01" : "Need to specify an uninstall package name!"
6957
7474
  )
6958
7475
  );
6959
7476
  process.exit(1);
6960
7477
  }
6961
7478
  const loading_status = await loading(text);
6962
- const { status, result } = await (0, import_lazy_js_utils10.useNodeWorker)(`nun ${params}`);
7479
+ const { status, result } = await (0, import_lazy_js_utils11.useNodeWorker)(`nun ${params}`);
6963
7480
  const end = Date.now();
6964
7481
  const costTime = (end - start) / 1e3;
6965
- successMsg += import_picocolors4.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
7482
+ successMsg += import_picocolors5.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
6966
7483
  if (status === 0)
6967
- loading_status.succeed(import_picocolors4.default.green(successMsg));
7484
+ loading_status.succeed(import_picocolors5.default.green(successMsg));
6968
7485
  else
6969
- loading_status.fail(import_picocolors4.default.red(result ? `${failMsg}
7486
+ loading_status.fail(import_picocolors5.default.red(result ? `${failMsg}
6970
7487
  ${result}` : failMsg));
6971
7488
  process.exit();
6972
7489
  }
6973
7490
 
6974
7491
  // src/pio.ts
6975
7492
  var import_process2 = __toESM(require("process"), 1);
6976
- var import_lazy_js_utils11 = require("lazy-js-utils");
6977
- var import_picocolors5 = __toESM(require_picocolors(), 1);
7493
+ var import_lazy_js_utils12 = require("lazy-js-utils");
7494
+ var import_picocolors6 = __toESM(require_picocolors(), 1);
6978
7495
  async function pio(params, pkg, executor = "ni") {
6979
7496
  const successMsg = pkg ? `Installed ${pkg} successfully! \u{1F60A}` : "Updated dependency successfully! \u{1F60A}";
6980
7497
  const failMsg = pkg ? `Failed to install ${pkg} \u{1F62D}` : "Failed to update dependency! \u{1F62D}";
6981
7498
  const offline = "--prefer-offline";
6982
7499
  const newParams = await getParams(params);
6983
- const { status, result } = await (0, import_lazy_js_utils11.useNodeWorker)({
7500
+ const { status, result } = await (0, import_lazy_js_utils12.useNodeWorker)({
6984
7501
  params: `${executor} ${newParams} ${offline}`,
6985
7502
  stdio: "inherit"
6986
7503
  });
6987
7504
  const loading_status = await loading("");
6988
7505
  if (status === 0)
6989
- loading_status.succeed(import_picocolors5.default.green(successMsg));
7506
+ loading_status.succeed(import_picocolors6.default.green(successMsg));
6990
7507
  else
6991
- loading_status.fail(import_picocolors5.default.red(result ? `${result}
7508
+ loading_status.fail(import_picocolors6.default.red(result ? `${result}
6992
7509
 
6993
7510
  ${failMsg}` : failMsg));
6994
7511
  import_process2.default.exit();
@@ -7013,7 +7530,7 @@ var isZh5 = import_process3.default.env.PI_Lang === "zh";
7013
7530
  async function setup() {
7014
7531
  const cmd = import_process3.default.argv[1];
7015
7532
  let exec = "";
7016
- if ((0, import_lazy_js_utils12.isWin)()) {
7533
+ if ((0, import_lazy_js_utils13.isWin)()) {
7017
7534
  const last = cmd.lastIndexOf("\\") + 1;
7018
7535
  exec = cmd.slice(last, cmd.length).split(".").slice(0, -1).join(".");
7019
7536
  } else {
@@ -7022,22 +7539,22 @@ async function setup() {
7022
7539
  }
7023
7540
  const argv = import_process3.default.argv.slice(2);
7024
7541
  help(argv);
7025
- const params = (0, import_lazy_js_utils12.spaceFormat)(argv.join(" ")).trim();
7026
- if (!(0, import_lazy_js_utils12.hasPkg)(rootPath)) {
7027
- if ((0, import_lazy_js_utils12.isGo)()) {
7542
+ const params = (0, import_lazy_js_utils13.spaceFormat)(argv.join(" ")).trim();
7543
+ if (!(0, import_lazy_js_utils13.hasPkg)(rootPath)) {
7544
+ if ((0, import_lazy_js_utils13.isGo)()) {
7028
7545
  if (exec === "pi") {
7029
7546
  const loading_status = await loading(
7030
7547
  `${isZh5 ? "\u6B63\u5728\u4E3A\u60A8\u5B89\u88C5" : "Installing"} ${params} ...
7031
7548
  `
7032
7549
  );
7033
- const { status } = await (0, import_lazy_js_utils12.useNodeWorker)(`go get ${params}`);
7550
+ const { status } = await (0, import_lazy_js_utils13.useNodeWorker)(`go get ${params}`);
7034
7551
  if (status === 0) {
7035
7552
  loading_status.succeed(
7036
- import_picocolors6.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
7553
+ import_picocolors7.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
7037
7554
  );
7038
7555
  } else {
7039
7556
  loading_status.fail(
7040
- import_picocolors6.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
7557
+ import_picocolors7.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
7041
7558
  );
7042
7559
  }
7043
7560
  } else if (exec === "pui") {
@@ -7045,51 +7562,51 @@ async function setup() {
7045
7562
  `${isZh5 ? "\u6B63\u5728\u4E3A\u60A8\u5378\u8F7D" : "Uninstalling"} ${params} ...
7046
7563
  `
7047
7564
  );
7048
- const { status } = await (0, import_lazy_js_utils12.useNodeWorker)(`go clean ${params}`);
7565
+ const { status } = await (0, import_lazy_js_utils13.useNodeWorker)(`go clean ${params}`);
7049
7566
  if (status === 0) {
7050
7567
  loading_status.succeed(
7051
- import_picocolors6.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
7568
+ import_picocolors7.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
7052
7569
  );
7053
7570
  } else {
7054
7571
  loading_status.fail(
7055
- import_picocolors6.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
7572
+ import_picocolors7.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
7056
7573
  );
7057
7574
  }
7058
7575
  } else if (exec === "prun") {
7059
7576
  const match = params ? params.endsWith(".go") ? [`**/${params}`] : [`**/${params}.go`, `**/${params}/main.go`] : "main.go";
7060
7577
  const target = (await (0, import_fast_glob.default)(match))[0];
7061
7578
  if (!target) {
7062
- console.log(import_picocolors6.default.red("No such file"));
7579
+ console.log(import_picocolors7.default.red("No such file"));
7063
7580
  import_process3.default.exit(1);
7064
7581
  }
7065
- (0, import_lazy_js_utils12.jsShell)(`go run ${target}`);
7582
+ (0, import_lazy_js_utils13.jsShell)(`go run ${target}`);
7066
7583
  } else if (exec === "pinit") {
7067
- (0, import_lazy_js_utils12.jsShell)(`go mod init ${params}`);
7584
+ (0, import_lazy_js_utils13.jsShell)(`go mod init ${params}`);
7068
7585
  } else if (exec === "pbuild") {
7069
- (0, import_lazy_js_utils12.jsShell)(`go build ${params}`);
7586
+ (0, import_lazy_js_utils13.jsShell)(`go build ${params}`);
7070
7587
  } else {
7071
7588
  console.log(
7072
- import_picocolors6.default.red(
7589
+ import_picocolors7.default.red(
7073
7590
  isZh5 ? "\u5F53\u524D\u6307\u4EE4\u8FD8\u4E0D\u652F\u6301" : "The commands is not supported"
7074
7591
  )
7075
7592
  );
7076
7593
  }
7077
7594
  import_process3.default.exit();
7078
7595
  }
7079
- if ((0, import_lazy_js_utils12.isRust)()) {
7596
+ if ((0, import_lazy_js_utils13.isRust)()) {
7080
7597
  if (exec === "pi") {
7081
7598
  const loading_status = await loading(
7082
7599
  `${isZh5 ? "\u6B63\u5728\u4E3A\u60A8\u5B89\u88C5" : "Installing"} ${params} ...
7083
7600
  `
7084
7601
  );
7085
- const { status } = await (0, import_lazy_js_utils12.useNodeWorker)(`cargo install ${params}`);
7602
+ const { status } = await (0, import_lazy_js_utils13.useNodeWorker)(`cargo install ${params}`);
7086
7603
  if (status === 0) {
7087
7604
  loading_status.succeed(
7088
- import_picocolors6.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
7605
+ import_picocolors7.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
7089
7606
  );
7090
7607
  } else {
7091
7608
  loading_status.fail(
7092
- import_picocolors6.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
7609
+ import_picocolors7.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
7093
7610
  );
7094
7611
  }
7095
7612
  } else if (exec === "pui") {
@@ -7097,25 +7614,25 @@ async function setup() {
7097
7614
  `${isZh5 ? "\u6B63\u5728\u4E3A\u60A8\u5378\u8F7D" : "Uninstalling"} ${params} ...
7098
7615
  `
7099
7616
  );
7100
- const { status } = await (0, import_lazy_js_utils12.useNodeWorker)(`cargo uninstall ${params}`);
7617
+ const { status } = await (0, import_lazy_js_utils13.useNodeWorker)(`cargo uninstall ${params}`);
7101
7618
  if (status === 0) {
7102
7619
  loading_status.succeed(
7103
- import_picocolors6.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
7620
+ import_picocolors7.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
7104
7621
  );
7105
7622
  } else {
7106
7623
  loading_status.fail(
7107
- import_picocolors6.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
7624
+ import_picocolors7.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
7108
7625
  );
7109
7626
  }
7110
7627
  } else if (exec === "prun") {
7111
- (0, import_lazy_js_utils12.jsShell)(`cargo run ${params}`);
7628
+ (0, import_lazy_js_utils13.jsShell)(`cargo run ${params}`);
7112
7629
  } else if (exec === "pinit") {
7113
- (0, import_lazy_js_utils12.jsShell)(`cargo init ${params}`);
7630
+ (0, import_lazy_js_utils13.jsShell)(`cargo init ${params}`);
7114
7631
  } else if (exec === "pbuild") {
7115
- (0, import_lazy_js_utils12.jsShell)(`cargo build ${params}`);
7632
+ (0, import_lazy_js_utils13.jsShell)(`cargo build ${params}`);
7116
7633
  } else {
7117
7634
  console.log(
7118
- import_picocolors6.default.red(
7635
+ import_picocolors7.default.red(
7119
7636
  isZh5 ? "\u5F53\u524D\u6307\u4EE4\u8FD8\u4E0D\u652F\u6301" : "The commands is not supported"
7120
7637
  )
7121
7638
  );
@@ -7124,7 +7641,7 @@ async function setup() {
7124
7641
  }
7125
7642
  if (!runMap[exec]) {
7126
7643
  console.log(
7127
- import_picocolors6.default.yellow(
7644
+ import_picocolors7.default.yellow(
7128
7645
  isZh5 ? "\u547D\u4EE4\u4E0D\u5B58\u5728\uFF0C\u8BF7\u6267\u884Cpi -h\u67E5\u770B\u5E2E\u52A9" : "The command does not exist, please execute pi -h to view the help"
7129
7646
  )
7130
7647
  );