@ecmaos/kernel 0.6.2 → 0.6.4

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.
@@ -280,9 +280,9 @@ function arrayify$6(input) {
280
280
  }
281
281
  }
282
282
  __name(arrayify$6, "arrayify$6");
283
- const csi$5 = "\x1B[";
284
- const ansi$6 = {};
285
- ansi$6.style = {
283
+ const csi$6 = "\x1B[";
284
+ const ansi$7 = {};
285
+ ansi$7.style = {
286
286
  reset: "\x1B[0m",
287
287
  bold: "\x1B[1m",
288
288
  italic: "\x1B[3m",
@@ -330,29 +330,29 @@ ansi$6.style = {
330
330
  "bg-brightCyan": "\x1B[106m",
331
331
  "bg-brightWhite": "\x1B[107m"
332
332
  };
333
- ansi$6.rgb = function(r, g2, b) {
333
+ ansi$7.rgb = function(r, g2, b) {
334
334
  return `\x1B[38;2;${r};${g2};${b}m`;
335
335
  };
336
- ansi$6.bgRgb = function(r, g2, b) {
336
+ ansi$7.bgRgb = function(r, g2, b) {
337
337
  return `\x1B[48;2;${r};${g2};${b}m`;
338
338
  };
339
- ansi$6.styles = function(styles2) {
339
+ ansi$7.styles = function(styles2) {
340
340
  styles2 = arrayify$6(styles2);
341
341
  return styles2.map(function(effect) {
342
342
  const rgbMatches = effect.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
343
343
  const bgRgbMatches = effect.match(/bg-rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
344
344
  if (bgRgbMatches) {
345
345
  const [full, r, g2, b] = bgRgbMatches;
346
- return ansi$6.bgRgb(r, g2, b);
346
+ return ansi$7.bgRgb(r, g2, b);
347
347
  } else if (rgbMatches) {
348
348
  const [full, r, g2, b] = rgbMatches;
349
- return ansi$6.rgb(r, g2, b);
349
+ return ansi$7.rgb(r, g2, b);
350
350
  } else {
351
- return ansi$6.style[effect];
351
+ return ansi$7.style[effect];
352
352
  }
353
353
  }).join("");
354
354
  };
355
- ansi$6.format = function(str, styleArray) {
355
+ ansi$7.format = function(str, styleArray) {
356
356
  const re2 = /\[([\w\s-\(\),]+)\]{([^]*?)}/;
357
357
  let matches;
358
358
  str = String(str);
@@ -360,18 +360,18 @@ ansi$6.format = function(str, styleArray) {
360
360
  while (matches = str.match(re2)) {
361
361
  const inlineStyles = matches[1].split(/\s+/);
362
362
  const inlineString = matches[2];
363
- str = str.replace(matches[0], ansi$6.format(inlineString, inlineStyles));
363
+ str = str.replace(matches[0], ansi$7.format(inlineString, inlineStyles));
364
364
  }
365
- return styleArray && styleArray.length ? ansi$6.styles(styleArray) + str + ansi$6.style.reset : str;
365
+ return styleArray && styleArray.length ? ansi$7.styles(styleArray) + str + ansi$7.style.reset : str;
366
366
  };
367
- ansi$6.cursor = {
367
+ ansi$7.cursor = {
368
368
  /**
369
369
  * Moves the cursor `lines` cells up. If the cursor is already at the edge of the screen, this has no effect
370
370
  * @param [lines=1] {number}
371
371
  * @return {string}
372
372
  */
373
373
  up: /* @__PURE__ */ __name(function(lines) {
374
- return csi$5 + (lines || 1) + "A";
374
+ return csi$6 + (lines || 1) + "A";
375
375
  }, "up"),
376
376
  /**
377
377
  * Moves the cursor `lines` cells down. If the cursor is already at the edge of the screen, this has no effect
@@ -379,7 +379,7 @@ ansi$6.cursor = {
379
379
  * @return {string}
380
380
  */
381
381
  down: /* @__PURE__ */ __name(function(lines) {
382
- return csi$5 + (lines || 1) + "B";
382
+ return csi$6 + (lines || 1) + "B";
383
383
  }, "down"),
384
384
  /**
385
385
  * Moves the cursor `lines` cells forward. If the cursor is already at the edge of the screen, this has no effect
@@ -387,7 +387,7 @@ ansi$6.cursor = {
387
387
  * @return {string}
388
388
  */
389
389
  forward: /* @__PURE__ */ __name(function(lines) {
390
- return csi$5 + (lines || 1) + "C";
390
+ return csi$6 + (lines || 1) + "C";
391
391
  }, "forward"),
392
392
  /**
393
393
  * Moves the cursor `lines` cells back. If the cursor is already at the edge of the screen, this has no effect
@@ -395,7 +395,7 @@ ansi$6.cursor = {
395
395
  * @return {string}
396
396
  */
397
397
  back: /* @__PURE__ */ __name(function(lines) {
398
- return csi$5 + (lines || 1) + "D";
398
+ return csi$6 + (lines || 1) + "D";
399
399
  }, "back"),
400
400
  /**
401
401
  * Moves cursor to beginning of the line n lines down.
@@ -403,7 +403,7 @@ ansi$6.cursor = {
403
403
  * @return {string}
404
404
  */
405
405
  nextLine: /* @__PURE__ */ __name(function(lines) {
406
- return csi$5 + (lines || 1) + "E";
406
+ return csi$6 + (lines || 1) + "E";
407
407
  }, "nextLine"),
408
408
  /**
409
409
  * Moves cursor to beginning of the line n lines up.
@@ -411,7 +411,7 @@ ansi$6.cursor = {
411
411
  * @return {string}
412
412
  */
413
413
  previousLine: /* @__PURE__ */ __name(function(lines) {
414
- return csi$5 + (lines || 1) + "F";
414
+ return csi$6 + (lines || 1) + "F";
415
415
  }, "previousLine"),
416
416
  /**
417
417
  * Moves the cursor to column n.
@@ -419,7 +419,7 @@ ansi$6.cursor = {
419
419
  * @return {string}
420
420
  */
421
421
  horizontalAbsolute: /* @__PURE__ */ __name(function(n) {
422
- return csi$5 + n + "G";
422
+ return csi$6 + n + "G";
423
423
  }, "horizontalAbsolute"),
424
424
  /**
425
425
  * Moves the cursor to row n, column m. The values are 1-based, and default to 1 (top left corner) if omitted.
@@ -428,25 +428,25 @@ ansi$6.cursor = {
428
428
  * @return {string}
429
429
  */
430
430
  position: /* @__PURE__ */ __name(function(n, m) {
431
- return csi$5 + (n || 1) + ";" + (m || 1) + "H";
431
+ return csi$6 + (n || 1) + ";" + (m || 1) + "H";
432
432
  }, "position"),
433
433
  /**
434
434
  * Hides the cursor
435
435
  */
436
- hide: csi$5 + "?25l",
436
+ hide: csi$6 + "?25l",
437
437
  /**
438
438
  * Shows the cursor
439
439
  */
440
- show: csi$5 + "?25h"
440
+ show: csi$6 + "?25h"
441
441
  };
442
- ansi$6.erase = {
442
+ ansi$7.erase = {
443
443
  /**
444
444
  * Clears part of the screen. If n is 0 (or missing), clear from cursor to end of screen. If n is 1, clear from cursor to beginning of the screen. If n is 2, clear entire screen.
445
445
  * @param n {number}
446
446
  * @return {string}
447
447
  */
448
448
  display: /* @__PURE__ */ __name(function(n) {
449
- return csi$5 + (n || 0) + "J";
449
+ return csi$6 + (n || 0) + "J";
450
450
  }, "display"),
451
451
  /**
452
452
  * Erases part of the line. If n is zero (or missing), clear from cursor to the end of the line. If n is one, clear from cursor to beginning of the line. If n is two, clear entire line. Cursor position does not change.
@@ -454,7 +454,7 @@ ansi$6.erase = {
454
454
  * @return {string}
455
455
  */
456
456
  inLine: /* @__PURE__ */ __name(function(n) {
457
- return csi$5 + (n || 0) + "K";
457
+ return csi$6 + (n || 0) + "K";
458
458
  }, "inLine")
459
459
  };
460
460
  const ANSI_BACKGROUND_OFFSET$1 = 10;
@@ -691,9 +691,9 @@ function stringEncaseCRLFWithFirstIndex$1(string, prefix, postfix, index) {
691
691
  }
692
692
  __name(stringEncaseCRLFWithFirstIndex$1, "stringEncaseCRLFWithFirstIndex$1");
693
693
  const { stdout: stdoutColor$1, stderr: stderrColor$1 } = supportsColor$1;
694
- const GENERATOR$1 = Symbol("GENERATOR");
695
- const STYLER$1 = Symbol("STYLER");
696
- const IS_EMPTY$1 = Symbol("IS_EMPTY");
694
+ const GENERATOR$1 = /* @__PURE__ */ Symbol("GENERATOR");
695
+ const STYLER$1 = /* @__PURE__ */ Symbol("STYLER");
696
+ const IS_EMPTY$1 = /* @__PURE__ */ Symbol("IS_EMPTY");
697
697
  const levelMapping$1 = [
698
698
  "ansi",
699
699
  "ansi",
@@ -2300,18 +2300,18 @@ var hasRequiredRe;
2300
2300
  function requireRe() {
2301
2301
  if (hasRequiredRe) return re$2.exports;
2302
2302
  hasRequiredRe = 1;
2303
- (function(module, exports) {
2303
+ (function(module, exports$1) {
2304
2304
  const {
2305
2305
  MAX_SAFE_COMPONENT_LENGTH,
2306
2306
  MAX_SAFE_BUILD_LENGTH,
2307
2307
  MAX_LENGTH
2308
2308
  } = requireConstants();
2309
2309
  const debug2 = requireDebug();
2310
- exports = module.exports = {};
2311
- const re2 = exports.re = [];
2312
- const safeRe = exports.safeRe = [];
2313
- const src = exports.src = [];
2314
- const t2 = exports.t = {};
2310
+ exports$1 = module.exports = {};
2311
+ const re2 = exports$1.re = [];
2312
+ const safeRe = exports$1.safeRe = [];
2313
+ const src = exports$1.src = [];
2314
+ const t2 = exports$1.t = {};
2315
2315
  let R = 0;
2316
2316
  const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
2317
2317
  const safeRegexReplacements = [
@@ -2363,18 +2363,18 @@ function requireRe() {
2363
2363
  createToken("COERCERTLFULL", src[t2.COERCEFULL], true);
2364
2364
  createToken("LONETILDE", "(?:~>?)");
2365
2365
  createToken("TILDETRIM", `(\\s*)${src[t2.LONETILDE]}\\s+`, true);
2366
- exports.tildeTrimReplace = "$1~";
2366
+ exports$1.tildeTrimReplace = "$1~";
2367
2367
  createToken("TILDE", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAIN]}$`);
2368
2368
  createToken("TILDELOOSE", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAINLOOSE]}$`);
2369
2369
  createToken("LONECARET", "(?:\\^)");
2370
2370
  createToken("CARETTRIM", `(\\s*)${src[t2.LONECARET]}\\s+`, true);
2371
- exports.caretTrimReplace = "$1^";
2371
+ exports$1.caretTrimReplace = "$1^";
2372
2372
  createToken("CARET", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAIN]}$`);
2373
2373
  createToken("CARETLOOSE", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAINLOOSE]}$`);
2374
2374
  createToken("COMPARATORLOOSE", `^${src[t2.GTLT]}\\s*(${src[t2.LOOSEPLAIN]})$|^$`);
2375
2375
  createToken("COMPARATOR", `^${src[t2.GTLT]}\\s*(${src[t2.FULLPLAIN]})$|^$`);
2376
2376
  createToken("COMPARATORTRIM", `(\\s*)${src[t2.GTLT]}\\s*(${src[t2.LOOSEPLAIN]}|${src[t2.XRANGEPLAIN]})`, true);
2377
- exports.comparatorTrimReplace = "$1$2$3";
2377
+ exports$1.comparatorTrimReplace = "$1$2$3";
2378
2378
  createToken("HYPHENRANGE", `^\\s*(${src[t2.XRANGEPLAIN]})\\s+-\\s+(${src[t2.XRANGEPLAIN]})\\s*$`);
2379
2379
  createToken("HYPHENRANGELOOSE", `^\\s*(${src[t2.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t2.XRANGEPLAINLOOSE]})\\s*$`);
2380
2380
  createToken("STAR", "(<|>)?=?\\s*\\*");
@@ -3505,7 +3505,7 @@ var hasRequiredComparator;
3505
3505
  function requireComparator() {
3506
3506
  if (hasRequiredComparator) return comparator;
3507
3507
  hasRequiredComparator = 1;
3508
- const ANY = Symbol("SemVer ANY");
3508
+ const ANY = /* @__PURE__ */ Symbol("SemVer ANY");
3509
3509
  const _Comparator = class _Comparator {
3510
3510
  static get ANY() {
3511
3511
  return ANY;
@@ -4974,15 +4974,15 @@ const warn = _shortcut$1(Level.WARN);
4974
4974
  const notice = _shortcut$1(Level.NOTICE);
4975
4975
  const info = _shortcut$1(Level.INFO);
4976
4976
  const debug = _shortcut$1(Level.DEBUG);
4977
- function ansi$5(text, format2) {
4977
+ function ansi$6(text, format2) {
4978
4978
  return `\x1B[${format2}m${text}\x1B[0m`;
4979
4979
  }
4980
- __name(ansi$5, "ansi$5");
4980
+ __name(ansi$6, "ansi$6");
4981
4981
  function _prettyMs(entry, style) {
4982
4982
  const text = "[" + (entry.elapsedMs / 1e3).toFixed(3).padStart(10) + "] ";
4983
4983
  switch (style) {
4984
4984
  case "ansi":
4985
- return [ansi$5(text, "2;37")];
4985
+ return [ansi$6(text, "2;37")];
4986
4986
  case "css":
4987
4987
  return ["%c" + text, "opacity: 0.8; color: white;"];
4988
4988
  default:
@@ -5417,7 +5417,7 @@ function __fieldGet(instance2, field2) {
5417
5417
  }
5418
5418
  }
5419
5419
  __name(__fieldGet, "__fieldGet");
5420
- const __view__ = Symbol("DataView");
5420
+ const __view__ = /* @__PURE__ */ Symbol("DataView");
5421
5421
  function view(buffer2) {
5422
5422
  buffer2[__view__] ?? (buffer2[__view__] = new DataView(buffer2));
5423
5423
  return buffer2[__view__];
@@ -5527,7 +5527,7 @@ function normalize$1(type) {
5527
5527
  return type == "char" ? "uint8" : type.toLowerCase();
5528
5528
  }
5529
5529
  __name(normalize$1, "normalize$1");
5530
- Symbol.metadata ?? (Symbol.metadata = Symbol.for("Symbol.metadata"));
5530
+ Symbol.metadata ?? (Symbol.metadata = /* @__PURE__ */ Symbol.for("Symbol.metadata"));
5531
5531
  function initMetadata(context) {
5532
5532
  context.metadata ?? (context.metadata = {});
5533
5533
  const existing = context.metadata.structInit ?? {};
@@ -7624,8 +7624,8 @@ Promise.withResolvers ?? (Promise.withResolvers = (warn("Using a polyfill of Pro
7624
7624
  });
7625
7625
  return { promise, resolve: _resolve, reject: _reject };
7626
7626
  }));
7627
- Symbol["dispose"] ?? (Symbol["dispose"] = (warn("Using a polyfill of Symbol.dispose"), Symbol("Symbol.dispose")));
7628
- Symbol["asyncDispose"] ?? (Symbol["asyncDispose"] = (warn("Using a polyfill of Symbol.asyncDispose"), Symbol("Symbol.asyncDispose")));
7627
+ Symbol["dispose"] ?? (Symbol["dispose"] = (warn("Using a polyfill of Symbol.dispose"), /* @__PURE__ */ Symbol("Symbol.dispose")));
7628
+ Symbol["asyncDispose"] ?? (Symbol["asyncDispose"] = (warn("Using a polyfill of Symbol.asyncDispose"), /* @__PURE__ */ Symbol("Symbol.asyncDispose")));
7629
7629
  (_b = globalThis.crypto).randomUUID ?? (_b.randomUUID = (warn("Using a polyfill of crypto.randomUUID"), /* @__PURE__ */ __name(function randomUUID() {
7630
7630
  const bytes = crypto.getRandomValues(new Uint8Array(16));
7631
7631
  bytes[6] = bytes[6] & 15 | 64;
@@ -9261,7 +9261,6 @@ function fromByteArray(uint82) {
9261
9261
  }
9262
9262
  __name(fromByteArray, "fromByteArray");
9263
9263
  var ieee754 = {};
9264
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
9265
9264
  ieee754.read = function(buffer2, offset, isLE, mLen, nBytes) {
9266
9265
  var e2, m;
9267
9266
  var eLen = nBytes * 8 - mLen - 1;
@@ -9339,21 +9338,15 @@ ieee754.write = function(buffer2, value, offset, isLE, mLen, nBytes) {
9339
9338
  }
9340
9339
  buffer2[offset + i - d] |= s * 128;
9341
9340
  };
9342
- /*!
9343
- * The buffer module from node.js, for the browser.
9344
- *
9345
- * @author Feross Aboukhadijeh <https://feross.org>
9346
- * @license MIT
9347
- */
9348
- (function(exports) {
9341
+ (function(exports$1) {
9349
9342
  const base64 = base64Js;
9350
9343
  const ieee754$1 = ieee754;
9351
9344
  const customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null;
9352
- exports.Buffer = Buffer3;
9353
- exports.SlowBuffer = SlowBuffer;
9354
- exports.INSPECT_MAX_BYTES = 50;
9345
+ exports$1.Buffer = Buffer3;
9346
+ exports$1.SlowBuffer = SlowBuffer;
9347
+ exports$1.INSPECT_MAX_BYTES = 50;
9355
9348
  const K_MAX_LENGTH = 2147483647;
9356
- exports.kMaxLength = K_MAX_LENGTH;
9349
+ exports$1.kMaxLength = K_MAX_LENGTH;
9357
9350
  const { Uint8Array: GlobalUint8Array, ArrayBuffer: GlobalArrayBuffer, SharedArrayBuffer: GlobalSharedArrayBuffer } = globalThis;
9358
9351
  Buffer3.TYPED_ARRAY_SUPPORT = typedArraySupport();
9359
9352
  if (!Buffer3.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") {
@@ -9801,7 +9794,7 @@ ieee754.write = function(buffer2, value, offset, isLE, mLen, nBytes) {
9801
9794
  }, "equals");
9802
9795
  Buffer3.prototype.inspect = /* @__PURE__ */ __name(function inspect2() {
9803
9796
  let str = "";
9804
- const max = exports.INSPECT_MAX_BYTES;
9797
+ const max = exports$1.INSPECT_MAX_BYTES;
9805
9798
  str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim();
9806
9799
  if (this.length > max) str += " ... ";
9807
9800
  return "<Buffer " + str + ">";
@@ -13246,8 +13239,8 @@ var hasRequiredDist;
13246
13239
  function requireDist() {
13247
13240
  if (hasRequiredDist) return dist;
13248
13241
  hasRequiredDist = 1;
13249
- (function(exports) {
13250
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
13242
+ (function(exports$1) {
13243
+ Object.defineProperties(exports$1, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
13251
13244
  var buffer2 = {};
13252
13245
  var base64Js2 = {};
13253
13246
  base64Js2.byteLength = byteLength2;
@@ -13350,7 +13343,6 @@ function requireDist() {
13350
13343
  }
13351
13344
  __name(fromByteArray2, "fromByteArray");
13352
13345
  var ieee7542 = {};
13353
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
13354
13346
  ieee7542.read = function(buffer3, offset, isLE, mLen, nBytes) {
13355
13347
  var e2, m;
13356
13348
  var eLen = nBytes * 8 - mLen - 1;
@@ -13428,21 +13420,15 @@ function requireDist() {
13428
13420
  }
13429
13421
  buffer3[offset + i2 - d] |= s * 128;
13430
13422
  };
13431
- /*!
13432
- * The buffer module from node.js, for the browser.
13433
- *
13434
- * @author Feross Aboukhadijeh <https://feross.org>
13435
- * @license MIT
13436
- */
13437
- (function(exports2) {
13423
+ (function(exports$12) {
13438
13424
  const base64 = base64Js2;
13439
13425
  const ieee754$1 = ieee7542;
13440
13426
  const customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null;
13441
- exports2.Buffer = Buffer4;
13442
- exports2.SlowBuffer = SlowBuffer;
13443
- exports2.INSPECT_MAX_BYTES = 50;
13427
+ exports$12.Buffer = Buffer4;
13428
+ exports$12.SlowBuffer = SlowBuffer;
13429
+ exports$12.INSPECT_MAX_BYTES = 50;
13444
13430
  const K_MAX_LENGTH = 2147483647;
13445
- exports2.kMaxLength = K_MAX_LENGTH;
13431
+ exports$12.kMaxLength = K_MAX_LENGTH;
13446
13432
  const { Uint8Array: GlobalUint8Array, ArrayBuffer: GlobalArrayBuffer, SharedArrayBuffer: GlobalSharedArrayBuffer } = globalThis;
13447
13433
  Buffer4.TYPED_ARRAY_SUPPORT = typedArraySupport();
13448
13434
  if (!Buffer4.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") {
@@ -13890,7 +13876,7 @@ function requireDist() {
13890
13876
  }, "equals");
13891
13877
  Buffer4.prototype.inspect = /* @__PURE__ */ __name(function inspect2() {
13892
13878
  let str = "";
13893
- const max = exports2.INSPECT_MAX_BYTES;
13879
+ const max = exports$12.INSPECT_MAX_BYTES;
13894
13880
  str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim();
13895
13881
  if (this.length > max) str += " ... ";
13896
13882
  return "<Buffer " + str + ">";
@@ -15077,24 +15063,24 @@ function requireDist() {
15077
15063
  __name(BufferBigIntNotDefined, "BufferBigIntNotDefined");
15078
15064
  })(buffer2);
15079
15065
  const Buffer3 = buffer2.Buffer;
15080
- exports.Blob = buffer2.Blob;
15081
- exports.BlobOptions = buffer2.BlobOptions;
15082
- exports.Buffer = buffer2.Buffer;
15083
- exports.File = buffer2.File;
15084
- exports.FileOptions = buffer2.FileOptions;
15085
- exports.INSPECT_MAX_BYTES = buffer2.INSPECT_MAX_BYTES;
15086
- exports.SlowBuffer = buffer2.SlowBuffer;
15087
- exports.TranscodeEncoding = buffer2.TranscodeEncoding;
15088
- exports.atob = buffer2.atob;
15089
- exports.btoa = buffer2.btoa;
15090
- exports.constants = buffer2.constants;
15091
- exports.default = Buffer3;
15092
- exports.isAscii = buffer2.isAscii;
15093
- exports.isUtf8 = buffer2.isUtf8;
15094
- exports.kMaxLength = buffer2.kMaxLength;
15095
- exports.kStringMaxLength = buffer2.kStringMaxLength;
15096
- exports.resolveObjectURL = buffer2.resolveObjectURL;
15097
- exports.transcode = buffer2.transcode;
15066
+ exports$1.Blob = buffer2.Blob;
15067
+ exports$1.BlobOptions = buffer2.BlobOptions;
15068
+ exports$1.Buffer = buffer2.Buffer;
15069
+ exports$1.File = buffer2.File;
15070
+ exports$1.FileOptions = buffer2.FileOptions;
15071
+ exports$1.INSPECT_MAX_BYTES = buffer2.INSPECT_MAX_BYTES;
15072
+ exports$1.SlowBuffer = buffer2.SlowBuffer;
15073
+ exports$1.TranscodeEncoding = buffer2.TranscodeEncoding;
15074
+ exports$1.atob = buffer2.atob;
15075
+ exports$1.btoa = buffer2.btoa;
15076
+ exports$1.constants = buffer2.constants;
15077
+ exports$1.default = Buffer3;
15078
+ exports$1.isAscii = buffer2.isAscii;
15079
+ exports$1.isUtf8 = buffer2.isUtf8;
15080
+ exports$1.kMaxLength = buffer2.kMaxLength;
15081
+ exports$1.kStringMaxLength = buffer2.kStringMaxLength;
15082
+ exports$1.resolveObjectURL = buffer2.resolveObjectURL;
15083
+ exports$1.transcode = buffer2.transcode;
15098
15084
  })(dist);
15099
15085
  return dist;
15100
15086
  }
@@ -15194,8 +15180,8 @@ function requirePrimordials() {
15194
15180
  SymbolAsyncIterator: Symbol.asyncIterator,
15195
15181
  SymbolHasInstance: Symbol.hasInstance,
15196
15182
  SymbolIterator: Symbol.iterator,
15197
- SymbolDispose: Symbol.dispose || Symbol("Symbol.dispose"),
15198
- SymbolAsyncDispose: Symbol.asyncDispose || Symbol("Symbol.asyncDispose"),
15183
+ SymbolDispose: Symbol.dispose || /* @__PURE__ */ Symbol("Symbol.dispose"),
15184
+ SymbolAsyncDispose: Symbol.asyncDispose || /* @__PURE__ */ Symbol("Symbol.asyncDispose"),
15199
15185
  TypedArrayPrototypeSet(self2, buf, len) {
15200
15186
  return self2.set(buf, len);
15201
15187
  },
@@ -15794,7 +15780,7 @@ function requireUtil$1() {
15794
15780
  return ac.signal;
15795
15781
  }, "AbortSignalAny")
15796
15782
  };
15797
- module.exports.promisify.custom = Symbol.for("nodejs.util.promisify.custom");
15783
+ module.exports.promisify.custom = /* @__PURE__ */ Symbol.for("nodejs.util.promisify.custom");
15798
15784
  })(util$1);
15799
15785
  return util$1.exports;
15800
15786
  }
@@ -15807,7 +15793,7 @@ function requireErrors() {
15807
15793
  hasRequiredErrors = 1;
15808
15794
  const { format: format2, inspect: inspect2, AggregateError: CustomAggregateError } = requireUtil$1();
15809
15795
  const AggregateError = globalThis.AggregateError || CustomAggregateError;
15810
- const kIsNodeError = Symbol("kIsNodeError");
15796
+ const kIsNodeError = /* @__PURE__ */ Symbol("kIsNodeError");
15811
15797
  const kTypes = [
15812
15798
  "string",
15813
15799
  "function",
@@ -17641,7 +17627,7 @@ function requireBuffer_list() {
17641
17627
  return ret;
17642
17628
  }
17643
17629
  // Make sure the linked list only shows the minimal necessary information.
17644
- [Symbol.for("nodejs.util.inspect.custom")](_, options) {
17630
+ [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")](_, options) {
17645
17631
  return inspect2(this, {
17646
17632
  ...options,
17647
17633
  // Only inspect one level.
@@ -17703,12 +17689,11 @@ function requireState() {
17703
17689
  __name(requireState, "requireState");
17704
17690
  var string_decoder = {};
17705
17691
  var safeBuffer = { exports: {} };
17706
- /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
17707
17692
  var hasRequiredSafeBuffer;
17708
17693
  function requireSafeBuffer() {
17709
17694
  if (hasRequiredSafeBuffer) return safeBuffer.exports;
17710
17695
  hasRequiredSafeBuffer = 1;
17711
- (function(module, exports) {
17696
+ (function(module, exports$1) {
17712
17697
  var buffer2 = requireDist();
17713
17698
  var Buffer3 = buffer2.Buffer;
17714
17699
  function copyProps(src, dst) {
@@ -17720,8 +17705,8 @@ function requireSafeBuffer() {
17720
17705
  if (Buffer3.from && Buffer3.alloc && Buffer3.allocUnsafe && Buffer3.allocUnsafeSlow) {
17721
17706
  module.exports = buffer2;
17722
17707
  } else {
17723
- copyProps(buffer2, exports);
17724
- exports.Buffer = SafeBuffer;
17708
+ copyProps(buffer2, exports$1);
17709
+ exports$1.Buffer = SafeBuffer;
17725
17710
  }
17726
17711
  function SafeBuffer(arg, encodingOrOffset, length) {
17727
17712
  return Buffer3(arg, encodingOrOffset, length);
@@ -24983,26 +24968,7 @@ const version = "2.4.2";
24983
24968
  const $pkg = {
24984
24969
  version
24985
24970
  };
24986
- /*!
24987
- * @zenfs/core — https://npmjs.com/package/@zenfs/core
24988
- * Copyright © James Prevett and other ZenFS contributors.
24989
- * SPDX-License-Identifier: LGPL-3.0-or-later
24990
- */
24991
24971
  globalThis.__zenfs__ = Object.assign(Object.create(fs), { _version: $pkg.version });
24992
- /*! *****************************************************************************
24993
- Copyright (c) Microsoft Corporation.
24994
-
24995
- Permission to use, copy, modify, and/or distribute this software for any
24996
- purpose with or without fee is hereby granted.
24997
-
24998
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
24999
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
25000
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
25001
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
25002
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
25003
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25004
- PERFORMANCE OF THIS SOFTWARE.
25005
- ***************************************************************************** */
25006
24972
  var __assign = /* @__PURE__ */ __name(function() {
25007
24973
  __assign = Object.assign || /* @__PURE__ */ __name(function __assign2(t2) {
25008
24974
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -25701,9 +25667,9 @@ function arrayify$5(input) {
25701
25667
  }
25702
25668
  }
25703
25669
  __name(arrayify$5, "arrayify$5");
25704
- const csi$4 = "\x1B[";
25705
- const ansi$4 = {};
25706
- ansi$4.style = {
25670
+ const csi$5 = "\x1B[";
25671
+ const ansi$5 = {};
25672
+ ansi$5.style = {
25707
25673
  reset: "\x1B[0m",
25708
25674
  bold: "\x1B[1m",
25709
25675
  italic: "\x1B[3m",
@@ -25751,29 +25717,29 @@ ansi$4.style = {
25751
25717
  "bg-brightCyan": "\x1B[106m",
25752
25718
  "bg-brightWhite": "\x1B[107m"
25753
25719
  };
25754
- ansi$4.rgb = function(r, g2, b) {
25720
+ ansi$5.rgb = function(r, g2, b) {
25755
25721
  return `\x1B[38;2;${r};${g2};${b}m`;
25756
25722
  };
25757
- ansi$4.bgRgb = function(r, g2, b) {
25723
+ ansi$5.bgRgb = function(r, g2, b) {
25758
25724
  return `\x1B[48;2;${r};${g2};${b}m`;
25759
25725
  };
25760
- ansi$4.styles = function(styles2) {
25726
+ ansi$5.styles = function(styles2) {
25761
25727
  styles2 = arrayify$5(styles2);
25762
25728
  return styles2.map(function(effect) {
25763
25729
  const rgbMatches = effect.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
25764
25730
  const bgRgbMatches = effect.match(/bg-rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
25765
25731
  if (bgRgbMatches) {
25766
25732
  const [full, r, g2, b] = bgRgbMatches;
25767
- return ansi$4.bgRgb(r, g2, b);
25733
+ return ansi$5.bgRgb(r, g2, b);
25768
25734
  } else if (rgbMatches) {
25769
25735
  const [full, r, g2, b] = rgbMatches;
25770
- return ansi$4.rgb(r, g2, b);
25736
+ return ansi$5.rgb(r, g2, b);
25771
25737
  } else {
25772
- return ansi$4.style[effect];
25738
+ return ansi$5.style[effect];
25773
25739
  }
25774
25740
  }).join("");
25775
25741
  };
25776
- ansi$4.format = function(str, styleArray) {
25742
+ ansi$5.format = function(str, styleArray) {
25777
25743
  const re2 = /\[([\w\s-\(\),]+)\]{([^]*?)}/;
25778
25744
  let matches;
25779
25745
  str = String(str);
@@ -25781,18 +25747,18 @@ ansi$4.format = function(str, styleArray) {
25781
25747
  while (matches = str.match(re2)) {
25782
25748
  const inlineStyles = matches[1].split(/\s+/);
25783
25749
  const inlineString = matches[2];
25784
- str = str.replace(matches[0], ansi$4.format(inlineString, inlineStyles));
25750
+ str = str.replace(matches[0], ansi$5.format(inlineString, inlineStyles));
25785
25751
  }
25786
- return styleArray && styleArray.length ? ansi$4.styles(styleArray) + str + ansi$4.style.reset : str;
25752
+ return styleArray && styleArray.length ? ansi$5.styles(styleArray) + str + ansi$5.style.reset : str;
25787
25753
  };
25788
- ansi$4.cursor = {
25754
+ ansi$5.cursor = {
25789
25755
  /**
25790
25756
  * Moves the cursor `lines` cells up. If the cursor is already at the edge of the screen, this has no effect
25791
25757
  * @param [lines=1] {number}
25792
25758
  * @return {string}
25793
25759
  */
25794
25760
  up: /* @__PURE__ */ __name(function(lines) {
25795
- return csi$4 + (lines || 1) + "A";
25761
+ return csi$5 + (lines || 1) + "A";
25796
25762
  }, "up"),
25797
25763
  /**
25798
25764
  * Moves the cursor `lines` cells down. If the cursor is already at the edge of the screen, this has no effect
@@ -25800,7 +25766,7 @@ ansi$4.cursor = {
25800
25766
  * @return {string}
25801
25767
  */
25802
25768
  down: /* @__PURE__ */ __name(function(lines) {
25803
- return csi$4 + (lines || 1) + "B";
25769
+ return csi$5 + (lines || 1) + "B";
25804
25770
  }, "down"),
25805
25771
  /**
25806
25772
  * Moves the cursor `lines` cells forward. If the cursor is already at the edge of the screen, this has no effect
@@ -25808,7 +25774,7 @@ ansi$4.cursor = {
25808
25774
  * @return {string}
25809
25775
  */
25810
25776
  forward: /* @__PURE__ */ __name(function(lines) {
25811
- return csi$4 + (lines || 1) + "C";
25777
+ return csi$5 + (lines || 1) + "C";
25812
25778
  }, "forward"),
25813
25779
  /**
25814
25780
  * Moves the cursor `lines` cells back. If the cursor is already at the edge of the screen, this has no effect
@@ -25816,7 +25782,7 @@ ansi$4.cursor = {
25816
25782
  * @return {string}
25817
25783
  */
25818
25784
  back: /* @__PURE__ */ __name(function(lines) {
25819
- return csi$4 + (lines || 1) + "D";
25785
+ return csi$5 + (lines || 1) + "D";
25820
25786
  }, "back"),
25821
25787
  /**
25822
25788
  * Moves cursor to beginning of the line n lines down.
@@ -25824,7 +25790,7 @@ ansi$4.cursor = {
25824
25790
  * @return {string}
25825
25791
  */
25826
25792
  nextLine: /* @__PURE__ */ __name(function(lines) {
25827
- return csi$4 + (lines || 1) + "E";
25793
+ return csi$5 + (lines || 1) + "E";
25828
25794
  }, "nextLine"),
25829
25795
  /**
25830
25796
  * Moves cursor to beginning of the line n lines up.
@@ -25832,7 +25798,7 @@ ansi$4.cursor = {
25832
25798
  * @return {string}
25833
25799
  */
25834
25800
  previousLine: /* @__PURE__ */ __name(function(lines) {
25835
- return csi$4 + (lines || 1) + "F";
25801
+ return csi$5 + (lines || 1) + "F";
25836
25802
  }, "previousLine"),
25837
25803
  /**
25838
25804
  * Moves the cursor to column n.
@@ -25840,7 +25806,7 @@ ansi$4.cursor = {
25840
25806
  * @return {string}
25841
25807
  */
25842
25808
  horizontalAbsolute: /* @__PURE__ */ __name(function(n) {
25843
- return csi$4 + n + "G";
25809
+ return csi$5 + n + "G";
25844
25810
  }, "horizontalAbsolute"),
25845
25811
  /**
25846
25812
  * Moves the cursor to row n, column m. The values are 1-based, and default to 1 (top left corner) if omitted.
@@ -25849,25 +25815,25 @@ ansi$4.cursor = {
25849
25815
  * @return {string}
25850
25816
  */
25851
25817
  position: /* @__PURE__ */ __name(function(n, m) {
25852
- return csi$4 + (n || 1) + ";" + (m || 1) + "H";
25818
+ return csi$5 + (n || 1) + ";" + (m || 1) + "H";
25853
25819
  }, "position"),
25854
25820
  /**
25855
25821
  * Hides the cursor
25856
25822
  */
25857
- hide: csi$4 + "?25l",
25823
+ hide: csi$5 + "?25l",
25858
25824
  /**
25859
25825
  * Shows the cursor
25860
25826
  */
25861
- show: csi$4 + "?25h"
25827
+ show: csi$5 + "?25h"
25862
25828
  };
25863
- ansi$4.erase = {
25829
+ ansi$5.erase = {
25864
25830
  /**
25865
25831
  * Clears part of the screen. If n is 0 (or missing), clear from cursor to end of screen. If n is 1, clear from cursor to beginning of the screen. If n is 2, clear entire screen.
25866
25832
  * @param n {number}
25867
25833
  * @return {string}
25868
25834
  */
25869
25835
  display: /* @__PURE__ */ __name(function(n) {
25870
- return csi$4 + (n || 0) + "J";
25836
+ return csi$5 + (n || 0) + "J";
25871
25837
  }, "display"),
25872
25838
  /**
25873
25839
  * Erases part of the line. If n is zero (or missing), clear from cursor to the end of the line. If n is one, clear from cursor to beginning of the line. If n is two, clear entire line. Cursor position does not change.
@@ -25875,7 +25841,7 @@ ansi$4.erase = {
25875
25841
  * @return {string}
25876
25842
  */
25877
25843
  inLine: /* @__PURE__ */ __name(function(n) {
25878
- return csi$4 + (n || 0) + "K";
25844
+ return csi$5 + (n || 0) + "K";
25879
25845
  }, "inLine")
25880
25846
  };
25881
25847
  const pkg$b = {
@@ -25908,11 +25874,11 @@ Commands:
25908
25874
  try {
25909
25875
  switch (args[0]) {
25910
25876
  case "status":
25911
- terminal.writeln(`${ansi$4.style.bold}🔋 Battery Status:${ansi$4.style.reset}
25912
- 🔌 Charging: ${battery.charging ? ansi$4.style.green + "Yes" : ansi$4.style.red + "No"}${ansi$4.style.reset}
25913
- ⏱️ Charging Time: ${battery.chargingTime === Infinity ? ansi$4.style.gray + "N/A" : ansi$4.style.cyan + battery.chargingTime}${ansi$4.style.reset}
25914
- ⌛ Discharging Time: ${battery.dischargingTime === Infinity ? ansi$4.style.gray + "N/A" : ansi$4.style.cyan + battery.dischargingTime}${ansi$4.style.reset}
25915
- 📊 Level: ${ansi$4.style[battery.level > 0.5 ? "green" : battery.level > 0.2 ? "yellow" : "red"]}${(battery.level * 100).toFixed(1)}%${ansi$4.style.reset}`);
25877
+ terminal.writeln(`${ansi$5.style.bold}🔋 Battery Status:${ansi$5.style.reset}
25878
+ 🔌 Charging: ${battery.charging ? ansi$5.style.green + "Yes" : ansi$5.style.red + "No"}${ansi$5.style.reset}
25879
+ ⏱️ Charging Time: ${battery.chargingTime === Infinity ? ansi$5.style.gray + "N/A" : ansi$5.style.cyan + battery.chargingTime}${ansi$5.style.reset}
25880
+ ⌛ Discharging Time: ${battery.dischargingTime === Infinity ? ansi$5.style.gray + "N/A" : ansi$5.style.cyan + battery.dischargingTime}${ansi$5.style.reset}
25881
+ 📊 Level: ${ansi$5.style[battery.level > 0.5 ? "green" : battery.level > 0.2 ? "yellow" : "red"]}${(battery.level * 100).toFixed(1)}%${ansi$5.style.reset}`);
25916
25882
  break;
25917
25883
  case "charging":
25918
25884
  terminal.writeln(`${battery.charging}`);
@@ -26270,9 +26236,9 @@ function arrayify$4(input) {
26270
26236
  }
26271
26237
  }
26272
26238
  __name(arrayify$4, "arrayify$4");
26273
- const csi$3 = "\x1B[";
26274
- const ansi$3 = {};
26275
- ansi$3.style = {
26239
+ const csi$4 = "\x1B[";
26240
+ const ansi$4 = {};
26241
+ ansi$4.style = {
26276
26242
  reset: "\x1B[0m",
26277
26243
  bold: "\x1B[1m",
26278
26244
  italic: "\x1B[3m",
@@ -26320,29 +26286,29 @@ ansi$3.style = {
26320
26286
  "bg-brightCyan": "\x1B[106m",
26321
26287
  "bg-brightWhite": "\x1B[107m"
26322
26288
  };
26323
- ansi$3.rgb = function(r, g2, b) {
26289
+ ansi$4.rgb = function(r, g2, b) {
26324
26290
  return `\x1B[38;2;${r};${g2};${b}m`;
26325
26291
  };
26326
- ansi$3.bgRgb = function(r, g2, b) {
26292
+ ansi$4.bgRgb = function(r, g2, b) {
26327
26293
  return `\x1B[48;2;${r};${g2};${b}m`;
26328
26294
  };
26329
- ansi$3.styles = function(styles2) {
26295
+ ansi$4.styles = function(styles2) {
26330
26296
  styles2 = arrayify$4(styles2);
26331
26297
  return styles2.map(function(effect) {
26332
26298
  const rgbMatches = effect.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
26333
26299
  const bgRgbMatches = effect.match(/bg-rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
26334
26300
  if (bgRgbMatches) {
26335
26301
  const [full, r, g2, b] = bgRgbMatches;
26336
- return ansi$3.bgRgb(r, g2, b);
26302
+ return ansi$4.bgRgb(r, g2, b);
26337
26303
  } else if (rgbMatches) {
26338
26304
  const [full, r, g2, b] = rgbMatches;
26339
- return ansi$3.rgb(r, g2, b);
26305
+ return ansi$4.rgb(r, g2, b);
26340
26306
  } else {
26341
- return ansi$3.style[effect];
26307
+ return ansi$4.style[effect];
26342
26308
  }
26343
26309
  }).join("");
26344
26310
  };
26345
- ansi$3.format = function(str, styleArray) {
26311
+ ansi$4.format = function(str, styleArray) {
26346
26312
  const re2 = /\[([\w\s-\(\),]+)\]{([^]*?)}/;
26347
26313
  let matches;
26348
26314
  str = String(str);
@@ -26350,18 +26316,18 @@ ansi$3.format = function(str, styleArray) {
26350
26316
  while (matches = str.match(re2)) {
26351
26317
  const inlineStyles = matches[1].split(/\s+/);
26352
26318
  const inlineString = matches[2];
26353
- str = str.replace(matches[0], ansi$3.format(inlineString, inlineStyles));
26319
+ str = str.replace(matches[0], ansi$4.format(inlineString, inlineStyles));
26354
26320
  }
26355
- return styleArray && styleArray.length ? ansi$3.styles(styleArray) + str + ansi$3.style.reset : str;
26321
+ return styleArray && styleArray.length ? ansi$4.styles(styleArray) + str + ansi$4.style.reset : str;
26356
26322
  };
26357
- ansi$3.cursor = {
26323
+ ansi$4.cursor = {
26358
26324
  /**
26359
26325
  * Moves the cursor `lines` cells up. If the cursor is already at the edge of the screen, this has no effect
26360
26326
  * @param [lines=1] {number}
26361
26327
  * @return {string}
26362
26328
  */
26363
26329
  up: /* @__PURE__ */ __name(function(lines) {
26364
- return csi$3 + (lines || 1) + "A";
26330
+ return csi$4 + (lines || 1) + "A";
26365
26331
  }, "up"),
26366
26332
  /**
26367
26333
  * Moves the cursor `lines` cells down. If the cursor is already at the edge of the screen, this has no effect
@@ -26369,7 +26335,7 @@ ansi$3.cursor = {
26369
26335
  * @return {string}
26370
26336
  */
26371
26337
  down: /* @__PURE__ */ __name(function(lines) {
26372
- return csi$3 + (lines || 1) + "B";
26338
+ return csi$4 + (lines || 1) + "B";
26373
26339
  }, "down"),
26374
26340
  /**
26375
26341
  * Moves the cursor `lines` cells forward. If the cursor is already at the edge of the screen, this has no effect
@@ -26377,7 +26343,7 @@ ansi$3.cursor = {
26377
26343
  * @return {string}
26378
26344
  */
26379
26345
  forward: /* @__PURE__ */ __name(function(lines) {
26380
- return csi$3 + (lines || 1) + "C";
26346
+ return csi$4 + (lines || 1) + "C";
26381
26347
  }, "forward"),
26382
26348
  /**
26383
26349
  * Moves the cursor `lines` cells back. If the cursor is already at the edge of the screen, this has no effect
@@ -26385,7 +26351,7 @@ ansi$3.cursor = {
26385
26351
  * @return {string}
26386
26352
  */
26387
26353
  back: /* @__PURE__ */ __name(function(lines) {
26388
- return csi$3 + (lines || 1) + "D";
26354
+ return csi$4 + (lines || 1) + "D";
26389
26355
  }, "back"),
26390
26356
  /**
26391
26357
  * Moves cursor to beginning of the line n lines down.
@@ -26393,7 +26359,7 @@ ansi$3.cursor = {
26393
26359
  * @return {string}
26394
26360
  */
26395
26361
  nextLine: /* @__PURE__ */ __name(function(lines) {
26396
- return csi$3 + (lines || 1) + "E";
26362
+ return csi$4 + (lines || 1) + "E";
26397
26363
  }, "nextLine"),
26398
26364
  /**
26399
26365
  * Moves cursor to beginning of the line n lines up.
@@ -26401,7 +26367,7 @@ ansi$3.cursor = {
26401
26367
  * @return {string}
26402
26368
  */
26403
26369
  previousLine: /* @__PURE__ */ __name(function(lines) {
26404
- return csi$3 + (lines || 1) + "F";
26370
+ return csi$4 + (lines || 1) + "F";
26405
26371
  }, "previousLine"),
26406
26372
  /**
26407
26373
  * Moves the cursor to column n.
@@ -26409,7 +26375,7 @@ ansi$3.cursor = {
26409
26375
  * @return {string}
26410
26376
  */
26411
26377
  horizontalAbsolute: /* @__PURE__ */ __name(function(n) {
26412
- return csi$3 + n + "G";
26378
+ return csi$4 + n + "G";
26413
26379
  }, "horizontalAbsolute"),
26414
26380
  /**
26415
26381
  * Moves the cursor to row n, column m. The values are 1-based, and default to 1 (top left corner) if omitted.
@@ -26418,25 +26384,25 @@ ansi$3.cursor = {
26418
26384
  * @return {string}
26419
26385
  */
26420
26386
  position: /* @__PURE__ */ __name(function(n, m) {
26421
- return csi$3 + (n || 1) + ";" + (m || 1) + "H";
26387
+ return csi$4 + (n || 1) + ";" + (m || 1) + "H";
26422
26388
  }, "position"),
26423
26389
  /**
26424
26390
  * Hides the cursor
26425
26391
  */
26426
- hide: csi$3 + "?25l",
26392
+ hide: csi$4 + "?25l",
26427
26393
  /**
26428
26394
  * Shows the cursor
26429
26395
  */
26430
- show: csi$3 + "?25h"
26396
+ show: csi$4 + "?25h"
26431
26397
  };
26432
- ansi$3.erase = {
26398
+ ansi$4.erase = {
26433
26399
  /**
26434
26400
  * Clears part of the screen. If n is 0 (or missing), clear from cursor to end of screen. If n is 1, clear from cursor to beginning of the screen. If n is 2, clear entire screen.
26435
26401
  * @param n {number}
26436
26402
  * @return {string}
26437
26403
  */
26438
26404
  display: /* @__PURE__ */ __name(function(n) {
26439
- return csi$3 + (n || 0) + "J";
26405
+ return csi$4 + (n || 0) + "J";
26440
26406
  }, "display"),
26441
26407
  /**
26442
26408
  * Erases part of the line. If n is zero (or missing), clear from cursor to the end of the line. If n is one, clear from cursor to beginning of the line. If n is two, clear entire line. Cursor position does not change.
@@ -26444,7 +26410,7 @@ ansi$3.erase = {
26444
26410
  * @return {string}
26445
26411
  */
26446
26412
  inLine: /* @__PURE__ */ __name(function(n) {
26447
- return csi$3 + (n || 0) + "K";
26413
+ return csi$4 + (n || 0) + "K";
26448
26414
  }, "inLine")
26449
26415
  };
26450
26416
  const pkg$9 = {
@@ -26479,16 +26445,16 @@ Commands:
26479
26445
  terminal.writeln("No gamepads connected");
26480
26446
  break;
26481
26447
  }
26482
- terminal.writeln(`${ansi$3.style.bold}🎮 Connected Gamepads:${ansi$3.style.reset}`);
26448
+ terminal.writeln(`${ansi$4.style.bold}🎮 Connected Gamepads:${ansi$4.style.reset}`);
26483
26449
  connectedPads.forEach((gamepad2) => {
26484
26450
  if (!gamepad2)
26485
26451
  return;
26486
26452
  terminal.writeln(`
26487
- 🎮 Index: ${ansi$3.style.cyan}${gamepad2.index}${ansi$3.style.reset}
26488
- 📝 ID: ${ansi$3.style.cyan}${gamepad2.id}${ansi$3.style.reset}
26489
- 🔌 Connected: ${ansi$3.style.cyan}${gamepad2.connected}${ansi$3.style.reset}
26490
- 🎯 Buttons: ${ansi$3.style.cyan}${gamepad2.buttons.length}${ansi$3.style.reset}
26491
- 📊 Axes: ${ansi$3.style.cyan}${gamepad2.axes.length}${ansi$3.style.reset}`);
26453
+ 🎮 Index: ${ansi$4.style.cyan}${gamepad2.index}${ansi$4.style.reset}
26454
+ 📝 ID: ${ansi$4.style.cyan}${gamepad2.id}${ansi$4.style.reset}
26455
+ 🔌 Connected: ${ansi$4.style.cyan}${gamepad2.connected}${ansi$4.style.reset}
26456
+ 🎯 Buttons: ${ansi$4.style.cyan}${gamepad2.buttons.length}${ansi$4.style.reset}
26457
+ 📊 Axes: ${ansi$4.style.cyan}${gamepad2.axes.length}${ansi$4.style.reset}`);
26492
26458
  });
26493
26459
  break;
26494
26460
  case "info":
@@ -26503,7 +26469,7 @@ Commands:
26503
26469
  terminal.writeln(`No gamepad found at index ${index}`);
26504
26470
  return 1;
26505
26471
  }
26506
- terminal.writeln(`${ansi$3.style.bold}Gamepad Information:${ansi$3.style.reset}
26472
+ terminal.writeln(`${ansi$4.style.bold}Gamepad Information:${ansi$4.style.reset}
26507
26473
  Index: ${gamepad.index}
26508
26474
  ID: ${gamepad.id}
26509
26475
  Connected: ${gamepad.connected}
@@ -26563,9 +26529,9 @@ function arrayify$3(input) {
26563
26529
  }
26564
26530
  }
26565
26531
  __name(arrayify$3, "arrayify$3");
26566
- const csi$2 = "\x1B[";
26567
- const ansi$2 = {};
26568
- ansi$2.style = {
26532
+ const csi$3 = "\x1B[";
26533
+ const ansi$3 = {};
26534
+ ansi$3.style = {
26569
26535
  reset: "\x1B[0m",
26570
26536
  bold: "\x1B[1m",
26571
26537
  italic: "\x1B[3m",
@@ -26613,29 +26579,29 @@ ansi$2.style = {
26613
26579
  "bg-brightCyan": "\x1B[106m",
26614
26580
  "bg-brightWhite": "\x1B[107m"
26615
26581
  };
26616
- ansi$2.rgb = function(r, g2, b) {
26582
+ ansi$3.rgb = function(r, g2, b) {
26617
26583
  return `\x1B[38;2;${r};${g2};${b}m`;
26618
26584
  };
26619
- ansi$2.bgRgb = function(r, g2, b) {
26585
+ ansi$3.bgRgb = function(r, g2, b) {
26620
26586
  return `\x1B[48;2;${r};${g2};${b}m`;
26621
26587
  };
26622
- ansi$2.styles = function(styles2) {
26588
+ ansi$3.styles = function(styles2) {
26623
26589
  styles2 = arrayify$3(styles2);
26624
26590
  return styles2.map(function(effect) {
26625
26591
  const rgbMatches = effect.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
26626
26592
  const bgRgbMatches = effect.match(/bg-rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
26627
26593
  if (bgRgbMatches) {
26628
26594
  const [full, r, g2, b] = bgRgbMatches;
26629
- return ansi$2.bgRgb(r, g2, b);
26595
+ return ansi$3.bgRgb(r, g2, b);
26630
26596
  } else if (rgbMatches) {
26631
26597
  const [full, r, g2, b] = rgbMatches;
26632
- return ansi$2.rgb(r, g2, b);
26598
+ return ansi$3.rgb(r, g2, b);
26633
26599
  } else {
26634
- return ansi$2.style[effect];
26600
+ return ansi$3.style[effect];
26635
26601
  }
26636
26602
  }).join("");
26637
26603
  };
26638
- ansi$2.format = function(str, styleArray) {
26604
+ ansi$3.format = function(str, styleArray) {
26639
26605
  const re2 = /\[([\w\s-\(\),]+)\]{([^]*?)}/;
26640
26606
  let matches;
26641
26607
  str = String(str);
@@ -26643,18 +26609,18 @@ ansi$2.format = function(str, styleArray) {
26643
26609
  while (matches = str.match(re2)) {
26644
26610
  const inlineStyles = matches[1].split(/\s+/);
26645
26611
  const inlineString = matches[2];
26646
- str = str.replace(matches[0], ansi$2.format(inlineString, inlineStyles));
26612
+ str = str.replace(matches[0], ansi$3.format(inlineString, inlineStyles));
26647
26613
  }
26648
- return styleArray && styleArray.length ? ansi$2.styles(styleArray) + str + ansi$2.style.reset : str;
26614
+ return styleArray && styleArray.length ? ansi$3.styles(styleArray) + str + ansi$3.style.reset : str;
26649
26615
  };
26650
- ansi$2.cursor = {
26616
+ ansi$3.cursor = {
26651
26617
  /**
26652
26618
  * Moves the cursor `lines` cells up. If the cursor is already at the edge of the screen, this has no effect
26653
26619
  * @param [lines=1] {number}
26654
26620
  * @return {string}
26655
26621
  */
26656
26622
  up: /* @__PURE__ */ __name(function(lines) {
26657
- return csi$2 + (lines || 1) + "A";
26623
+ return csi$3 + (lines || 1) + "A";
26658
26624
  }, "up"),
26659
26625
  /**
26660
26626
  * Moves the cursor `lines` cells down. If the cursor is already at the edge of the screen, this has no effect
@@ -26662,7 +26628,7 @@ ansi$2.cursor = {
26662
26628
  * @return {string}
26663
26629
  */
26664
26630
  down: /* @__PURE__ */ __name(function(lines) {
26665
- return csi$2 + (lines || 1) + "B";
26631
+ return csi$3 + (lines || 1) + "B";
26666
26632
  }, "down"),
26667
26633
  /**
26668
26634
  * Moves the cursor `lines` cells forward. If the cursor is already at the edge of the screen, this has no effect
@@ -26670,7 +26636,7 @@ ansi$2.cursor = {
26670
26636
  * @return {string}
26671
26637
  */
26672
26638
  forward: /* @__PURE__ */ __name(function(lines) {
26673
- return csi$2 + (lines || 1) + "C";
26639
+ return csi$3 + (lines || 1) + "C";
26674
26640
  }, "forward"),
26675
26641
  /**
26676
26642
  * Moves the cursor `lines` cells back. If the cursor is already at the edge of the screen, this has no effect
@@ -26678,7 +26644,7 @@ ansi$2.cursor = {
26678
26644
  * @return {string}
26679
26645
  */
26680
26646
  back: /* @__PURE__ */ __name(function(lines) {
26681
- return csi$2 + (lines || 1) + "D";
26647
+ return csi$3 + (lines || 1) + "D";
26682
26648
  }, "back"),
26683
26649
  /**
26684
26650
  * Moves cursor to beginning of the line n lines down.
@@ -26686,7 +26652,7 @@ ansi$2.cursor = {
26686
26652
  * @return {string}
26687
26653
  */
26688
26654
  nextLine: /* @__PURE__ */ __name(function(lines) {
26689
- return csi$2 + (lines || 1) + "E";
26655
+ return csi$3 + (lines || 1) + "E";
26690
26656
  }, "nextLine"),
26691
26657
  /**
26692
26658
  * Moves cursor to beginning of the line n lines up.
@@ -26694,7 +26660,7 @@ ansi$2.cursor = {
26694
26660
  * @return {string}
26695
26661
  */
26696
26662
  previousLine: /* @__PURE__ */ __name(function(lines) {
26697
- return csi$2 + (lines || 1) + "F";
26663
+ return csi$3 + (lines || 1) + "F";
26698
26664
  }, "previousLine"),
26699
26665
  /**
26700
26666
  * Moves the cursor to column n.
@@ -26702,7 +26668,7 @@ ansi$2.cursor = {
26702
26668
  * @return {string}
26703
26669
  */
26704
26670
  horizontalAbsolute: /* @__PURE__ */ __name(function(n) {
26705
- return csi$2 + n + "G";
26671
+ return csi$3 + n + "G";
26706
26672
  }, "horizontalAbsolute"),
26707
26673
  /**
26708
26674
  * Moves the cursor to row n, column m. The values are 1-based, and default to 1 (top left corner) if omitted.
@@ -26711,25 +26677,25 @@ ansi$2.cursor = {
26711
26677
  * @return {string}
26712
26678
  */
26713
26679
  position: /* @__PURE__ */ __name(function(n, m) {
26714
- return csi$2 + (n || 1) + ";" + (m || 1) + "H";
26680
+ return csi$3 + (n || 1) + ";" + (m || 1) + "H";
26715
26681
  }, "position"),
26716
26682
  /**
26717
26683
  * Hides the cursor
26718
26684
  */
26719
- hide: csi$2 + "?25l",
26685
+ hide: csi$3 + "?25l",
26720
26686
  /**
26721
26687
  * Shows the cursor
26722
26688
  */
26723
- show: csi$2 + "?25h"
26689
+ show: csi$3 + "?25h"
26724
26690
  };
26725
- ansi$2.erase = {
26691
+ ansi$3.erase = {
26726
26692
  /**
26727
26693
  * Clears part of the screen. If n is 0 (or missing), clear from cursor to end of screen. If n is 1, clear from cursor to beginning of the screen. If n is 2, clear entire screen.
26728
26694
  * @param n {number}
26729
26695
  * @return {string}
26730
26696
  */
26731
26697
  display: /* @__PURE__ */ __name(function(n) {
26732
- return csi$2 + (n || 0) + "J";
26698
+ return csi$3 + (n || 0) + "J";
26733
26699
  }, "display"),
26734
26700
  /**
26735
26701
  * Erases part of the line. If n is zero (or missing), clear from cursor to the end of the line. If n is one, clear from cursor to beginning of the line. If n is two, clear entire line. Cursor position does not change.
@@ -26737,7 +26703,7 @@ ansi$2.erase = {
26737
26703
  * @return {string}
26738
26704
  */
26739
26705
  inLine: /* @__PURE__ */ __name(function(n) {
26740
- return csi$2 + (n || 0) + "K";
26706
+ return csi$3 + (n || 0) + "K";
26741
26707
  }, "inLine")
26742
26708
  };
26743
26709
  const pkg$8 = {
@@ -26770,14 +26736,14 @@ Commands:
26770
26736
  const position = await new Promise((resolve2, reject) => {
26771
26737
  navigator.geolocation.getCurrentPosition(resolve2, reject);
26772
26738
  });
26773
- terminal.writeln(`${ansi$2.style.bold}📍 Current Position:${ansi$2.style.reset}
26774
- 🌍 Latitude: ${ansi$2.style.cyan}${position.coords.latitude}${ansi$2.style.reset}
26775
- 🌍 Longitude: ${ansi$2.style.cyan}${position.coords.longitude}${ansi$2.style.reset}
26776
- 📏 Accuracy: ${ansi$2.style.cyan}${position.coords.accuracy}m${ansi$2.style.reset}
26777
- 🏔️ Altitude: ${position.coords.altitude ? ansi$2.style.cyan + position.coords.altitude + "m" : ansi$2.style.gray + "N/A"}${ansi$2.style.reset}
26778
- 🎯 Altitude Accuracy: ${position.coords.altitudeAccuracy ? ansi$2.style.cyan + position.coords.altitudeAccuracy + "m" : ansi$2.style.gray + "N/A"}${ansi$2.style.reset}
26779
- 🧭 Heading: ${position.coords.heading ? ansi$2.style.cyan + position.coords.heading + "°" : ansi$2.style.gray + "N/A"}${ansi$2.style.reset}
26780
- 🚀 Speed: ${position.coords.speed ? ansi$2.style.cyan + position.coords.speed + "m/s" : ansi$2.style.gray + "N/A"}${ansi$2.style.reset}`);
26739
+ terminal.writeln(`${ansi$3.style.bold}📍 Current Position:${ansi$3.style.reset}
26740
+ 🌍 Latitude: ${ansi$3.style.cyan}${position.coords.latitude}${ansi$3.style.reset}
26741
+ 🌍 Longitude: ${ansi$3.style.cyan}${position.coords.longitude}${ansi$3.style.reset}
26742
+ 📏 Accuracy: ${ansi$3.style.cyan}${position.coords.accuracy}m${ansi$3.style.reset}
26743
+ 🏔️ Altitude: ${position.coords.altitude ? ansi$3.style.cyan + position.coords.altitude + "m" : ansi$3.style.gray + "N/A"}${ansi$3.style.reset}
26744
+ 🎯 Altitude Accuracy: ${position.coords.altitudeAccuracy ? ansi$3.style.cyan + position.coords.altitudeAccuracy + "m" : ansi$3.style.gray + "N/A"}${ansi$3.style.reset}
26745
+ 🧭 Heading: ${position.coords.heading ? ansi$3.style.cyan + position.coords.heading + "°" : ansi$3.style.gray + "N/A"}${ansi$3.style.reset}
26746
+ 🚀 Speed: ${position.coords.speed ? ansi$3.style.cyan + position.coords.speed + "m/s" : ansi$3.style.gray + "N/A"}${ansi$3.style.reset}`);
26781
26747
  break;
26782
26748
  case "watch":
26783
26749
  const watchId = navigator.geolocation.watchPosition(
@@ -27043,9 +27009,9 @@ function arrayify$2(input) {
27043
27009
  }
27044
27010
  }
27045
27011
  __name(arrayify$2, "arrayify$2");
27046
- const csi$1 = "\x1B[";
27047
- const ansi$1 = {};
27048
- ansi$1.style = {
27012
+ const csi$2 = "\x1B[";
27013
+ const ansi$2 = {};
27014
+ ansi$2.style = {
27049
27015
  reset: "\x1B[0m",
27050
27016
  bold: "\x1B[1m",
27051
27017
  italic: "\x1B[3m",
@@ -27093,29 +27059,29 @@ ansi$1.style = {
27093
27059
  "bg-brightCyan": "\x1B[106m",
27094
27060
  "bg-brightWhite": "\x1B[107m"
27095
27061
  };
27096
- ansi$1.rgb = function(r, g2, b) {
27062
+ ansi$2.rgb = function(r, g2, b) {
27097
27063
  return `\x1B[38;2;${r};${g2};${b}m`;
27098
27064
  };
27099
- ansi$1.bgRgb = function(r, g2, b) {
27065
+ ansi$2.bgRgb = function(r, g2, b) {
27100
27066
  return `\x1B[48;2;${r};${g2};${b}m`;
27101
27067
  };
27102
- ansi$1.styles = function(styles2) {
27068
+ ansi$2.styles = function(styles2) {
27103
27069
  styles2 = arrayify$2(styles2);
27104
27070
  return styles2.map(function(effect) {
27105
27071
  const rgbMatches = effect.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
27106
27072
  const bgRgbMatches = effect.match(/bg-rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
27107
27073
  if (bgRgbMatches) {
27108
27074
  const [full, r, g2, b] = bgRgbMatches;
27109
- return ansi$1.bgRgb(r, g2, b);
27075
+ return ansi$2.bgRgb(r, g2, b);
27110
27076
  } else if (rgbMatches) {
27111
27077
  const [full, r, g2, b] = rgbMatches;
27112
- return ansi$1.rgb(r, g2, b);
27078
+ return ansi$2.rgb(r, g2, b);
27113
27079
  } else {
27114
- return ansi$1.style[effect];
27080
+ return ansi$2.style[effect];
27115
27081
  }
27116
27082
  }).join("");
27117
27083
  };
27118
- ansi$1.format = function(str, styleArray) {
27084
+ ansi$2.format = function(str, styleArray) {
27119
27085
  const re2 = /\[([\w\s-\(\),]+)\]{([^]*?)}/;
27120
27086
  let matches;
27121
27087
  str = String(str);
@@ -27123,18 +27089,18 @@ ansi$1.format = function(str, styleArray) {
27123
27089
  while (matches = str.match(re2)) {
27124
27090
  const inlineStyles = matches[1].split(/\s+/);
27125
27091
  const inlineString = matches[2];
27126
- str = str.replace(matches[0], ansi$1.format(inlineString, inlineStyles));
27092
+ str = str.replace(matches[0], ansi$2.format(inlineString, inlineStyles));
27127
27093
  }
27128
- return styleArray && styleArray.length ? ansi$1.styles(styleArray) + str + ansi$1.style.reset : str;
27094
+ return styleArray && styleArray.length ? ansi$2.styles(styleArray) + str + ansi$2.style.reset : str;
27129
27095
  };
27130
- ansi$1.cursor = {
27096
+ ansi$2.cursor = {
27131
27097
  /**
27132
27098
  * Moves the cursor `lines` cells up. If the cursor is already at the edge of the screen, this has no effect
27133
27099
  * @param [lines=1] {number}
27134
27100
  * @return {string}
27135
27101
  */
27136
27102
  up: /* @__PURE__ */ __name(function(lines) {
27137
- return csi$1 + (lines || 1) + "A";
27103
+ return csi$2 + (lines || 1) + "A";
27138
27104
  }, "up"),
27139
27105
  /**
27140
27106
  * Moves the cursor `lines` cells down. If the cursor is already at the edge of the screen, this has no effect
@@ -27142,7 +27108,7 @@ ansi$1.cursor = {
27142
27108
  * @return {string}
27143
27109
  */
27144
27110
  down: /* @__PURE__ */ __name(function(lines) {
27145
- return csi$1 + (lines || 1) + "B";
27111
+ return csi$2 + (lines || 1) + "B";
27146
27112
  }, "down"),
27147
27113
  /**
27148
27114
  * Moves the cursor `lines` cells forward. If the cursor is already at the edge of the screen, this has no effect
@@ -27150,7 +27116,7 @@ ansi$1.cursor = {
27150
27116
  * @return {string}
27151
27117
  */
27152
27118
  forward: /* @__PURE__ */ __name(function(lines) {
27153
- return csi$1 + (lines || 1) + "C";
27119
+ return csi$2 + (lines || 1) + "C";
27154
27120
  }, "forward"),
27155
27121
  /**
27156
27122
  * Moves the cursor `lines` cells back. If the cursor is already at the edge of the screen, this has no effect
@@ -27158,7 +27124,7 @@ ansi$1.cursor = {
27158
27124
  * @return {string}
27159
27125
  */
27160
27126
  back: /* @__PURE__ */ __name(function(lines) {
27161
- return csi$1 + (lines || 1) + "D";
27127
+ return csi$2 + (lines || 1) + "D";
27162
27128
  }, "back"),
27163
27129
  /**
27164
27130
  * Moves cursor to beginning of the line n lines down.
@@ -27166,7 +27132,7 @@ ansi$1.cursor = {
27166
27132
  * @return {string}
27167
27133
  */
27168
27134
  nextLine: /* @__PURE__ */ __name(function(lines) {
27169
- return csi$1 + (lines || 1) + "E";
27135
+ return csi$2 + (lines || 1) + "E";
27170
27136
  }, "nextLine"),
27171
27137
  /**
27172
27138
  * Moves cursor to beginning of the line n lines up.
@@ -27174,7 +27140,7 @@ ansi$1.cursor = {
27174
27140
  * @return {string}
27175
27141
  */
27176
27142
  previousLine: /* @__PURE__ */ __name(function(lines) {
27177
- return csi$1 + (lines || 1) + "F";
27143
+ return csi$2 + (lines || 1) + "F";
27178
27144
  }, "previousLine"),
27179
27145
  /**
27180
27146
  * Moves the cursor to column n.
@@ -27182,7 +27148,7 @@ ansi$1.cursor = {
27182
27148
  * @return {string}
27183
27149
  */
27184
27150
  horizontalAbsolute: /* @__PURE__ */ __name(function(n) {
27185
- return csi$1 + n + "G";
27151
+ return csi$2 + n + "G";
27186
27152
  }, "horizontalAbsolute"),
27187
27153
  /**
27188
27154
  * Moves the cursor to row n, column m. The values are 1-based, and default to 1 (top left corner) if omitted.
@@ -27191,25 +27157,25 @@ ansi$1.cursor = {
27191
27157
  * @return {string}
27192
27158
  */
27193
27159
  position: /* @__PURE__ */ __name(function(n, m) {
27194
- return csi$1 + (n || 1) + ";" + (m || 1) + "H";
27160
+ return csi$2 + (n || 1) + ";" + (m || 1) + "H";
27195
27161
  }, "position"),
27196
27162
  /**
27197
27163
  * Hides the cursor
27198
27164
  */
27199
- hide: csi$1 + "?25l",
27165
+ hide: csi$2 + "?25l",
27200
27166
  /**
27201
27167
  * Shows the cursor
27202
27168
  */
27203
- show: csi$1 + "?25h"
27169
+ show: csi$2 + "?25h"
27204
27170
  };
27205
- ansi$1.erase = {
27171
+ ansi$2.erase = {
27206
27172
  /**
27207
27173
  * Clears part of the screen. If n is 0 (or missing), clear from cursor to end of screen. If n is 1, clear from cursor to beginning of the screen. If n is 2, clear entire screen.
27208
27174
  * @param n {number}
27209
27175
  * @return {string}
27210
27176
  */
27211
27177
  display: /* @__PURE__ */ __name(function(n) {
27212
- return csi$1 + (n || 0) + "J";
27178
+ return csi$2 + (n || 0) + "J";
27213
27179
  }, "display"),
27214
27180
  /**
27215
27181
  * Erases part of the line. If n is zero (or missing), clear from cursor to the end of the line. If n is one, clear from cursor to beginning of the line. If n is two, clear entire line. Cursor position does not change.
@@ -27217,7 +27183,7 @@ ansi$1.erase = {
27217
27183
  * @return {string}
27218
27184
  */
27219
27185
  inLine: /* @__PURE__ */ __name(function(n) {
27220
- return csi$1 + (n || 0) + "K";
27186
+ return csi$2 + (n || 0) + "K";
27221
27187
  }, "inLine")
27222
27188
  };
27223
27189
  const pkg$6 = {
@@ -27257,13 +27223,13 @@ Commands:
27257
27223
  terminal.writeln("No HID devices connected");
27258
27224
  break;
27259
27225
  }
27260
- terminal.writeln(`${ansi$1.style.bold}🎮 Connected HID Devices:${ansi$1.style.reset}`);
27226
+ terminal.writeln(`${ansi$2.style.bold}🎮 Connected HID Devices:${ansi$2.style.reset}`);
27261
27227
  uniqueDevices.forEach((device2) => {
27262
27228
  terminal.writeln(`
27263
- 📱 Device ID: ${ansi$1.style.cyan}${device2.productId}${ansi$1.style.reset}
27264
- 📝 Name: ${ansi$1.style.cyan}${device2.productName}${ansi$1.style.reset}
27265
- 🏢 Manufacturer: ${ansi$1.style.cyan}${device2.vendorId}${ansi$1.style.reset}
27266
- 🔌 Connected: ${ansi$1.style.cyan}${device2.opened ? "Yes" : "No"}${ansi$1.style.reset}`);
27229
+ 📱 Device ID: ${ansi$2.style.cyan}${device2.productId}${ansi$2.style.reset}
27230
+ 📝 Name: ${ansi$2.style.cyan}${device2.productName}${ansi$2.style.reset}
27231
+ 🏢 Manufacturer: ${ansi$2.style.cyan}${device2.vendorId}${ansi$2.style.reset}
27232
+ 🔌 Connected: ${ansi$2.style.cyan}${device2.opened ? "Yes" : "No"}${ansi$2.style.reset}`);
27267
27233
  });
27268
27234
  break;
27269
27235
  case "request":
@@ -27320,7 +27286,7 @@ Commands:
27320
27286
  terminal.writeln(`Device with ID ${args[1]} not found`);
27321
27287
  return 1;
27322
27288
  }
27323
- terminal.writeln(`${ansi$1.style.bold}Device Information:${ansi$1.style.reset}
27289
+ terminal.writeln(`${ansi$2.style.bold}Device Information:${ansi$2.style.reset}
27324
27290
  Product ID: ${targetDevice.productId}
27325
27291
  Vendor ID: ${targetDevice.vendorId}
27326
27292
  Product Name: ${targetDevice.productName}
@@ -27661,9 +27627,9 @@ function arrayify$1(input) {
27661
27627
  }
27662
27628
  }
27663
27629
  __name(arrayify$1, "arrayify$1");
27664
- const csi = "\x1B[";
27665
- const ansi = {};
27666
- ansi.style = {
27630
+ const csi$1 = "\x1B[";
27631
+ const ansi$1 = {};
27632
+ ansi$1.style = {
27667
27633
  reset: "\x1B[0m",
27668
27634
  bold: "\x1B[1m",
27669
27635
  italic: "\x1B[3m",
@@ -27711,29 +27677,29 @@ ansi.style = {
27711
27677
  "bg-brightCyan": "\x1B[106m",
27712
27678
  "bg-brightWhite": "\x1B[107m"
27713
27679
  };
27714
- ansi.rgb = function(r, g2, b) {
27680
+ ansi$1.rgb = function(r, g2, b) {
27715
27681
  return `\x1B[38;2;${r};${g2};${b}m`;
27716
27682
  };
27717
- ansi.bgRgb = function(r, g2, b) {
27683
+ ansi$1.bgRgb = function(r, g2, b) {
27718
27684
  return `\x1B[48;2;${r};${g2};${b}m`;
27719
27685
  };
27720
- ansi.styles = function(styles2) {
27686
+ ansi$1.styles = function(styles2) {
27721
27687
  styles2 = arrayify$1(styles2);
27722
27688
  return styles2.map(function(effect) {
27723
27689
  const rgbMatches = effect.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
27724
27690
  const bgRgbMatches = effect.match(/bg-rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
27725
27691
  if (bgRgbMatches) {
27726
27692
  const [full, r, g2, b] = bgRgbMatches;
27727
- return ansi.bgRgb(r, g2, b);
27693
+ return ansi$1.bgRgb(r, g2, b);
27728
27694
  } else if (rgbMatches) {
27729
27695
  const [full, r, g2, b] = rgbMatches;
27730
- return ansi.rgb(r, g2, b);
27696
+ return ansi$1.rgb(r, g2, b);
27731
27697
  } else {
27732
- return ansi.style[effect];
27698
+ return ansi$1.style[effect];
27733
27699
  }
27734
27700
  }).join("");
27735
27701
  };
27736
- ansi.format = function(str, styleArray) {
27702
+ ansi$1.format = function(str, styleArray) {
27737
27703
  const re2 = /\[([\w\s-\(\),]+)\]{([^]*?)}/;
27738
27704
  let matches;
27739
27705
  str = String(str);
@@ -27741,18 +27707,18 @@ ansi.format = function(str, styleArray) {
27741
27707
  while (matches = str.match(re2)) {
27742
27708
  const inlineStyles = matches[1].split(/\s+/);
27743
27709
  const inlineString = matches[2];
27744
- str = str.replace(matches[0], ansi.format(inlineString, inlineStyles));
27710
+ str = str.replace(matches[0], ansi$1.format(inlineString, inlineStyles));
27745
27711
  }
27746
- return styleArray && styleArray.length ? ansi.styles(styleArray) + str + ansi.style.reset : str;
27712
+ return styleArray && styleArray.length ? ansi$1.styles(styleArray) + str + ansi$1.style.reset : str;
27747
27713
  };
27748
- ansi.cursor = {
27714
+ ansi$1.cursor = {
27749
27715
  /**
27750
27716
  * Moves the cursor `lines` cells up. If the cursor is already at the edge of the screen, this has no effect
27751
27717
  * @param [lines=1] {number}
27752
27718
  * @return {string}
27753
27719
  */
27754
27720
  up: /* @__PURE__ */ __name(function(lines) {
27755
- return csi + (lines || 1) + "A";
27721
+ return csi$1 + (lines || 1) + "A";
27756
27722
  }, "up"),
27757
27723
  /**
27758
27724
  * Moves the cursor `lines` cells down. If the cursor is already at the edge of the screen, this has no effect
@@ -27760,7 +27726,7 @@ ansi.cursor = {
27760
27726
  * @return {string}
27761
27727
  */
27762
27728
  down: /* @__PURE__ */ __name(function(lines) {
27763
- return csi + (lines || 1) + "B";
27729
+ return csi$1 + (lines || 1) + "B";
27764
27730
  }, "down"),
27765
27731
  /**
27766
27732
  * Moves the cursor `lines` cells forward. If the cursor is already at the edge of the screen, this has no effect
@@ -27768,7 +27734,7 @@ ansi.cursor = {
27768
27734
  * @return {string}
27769
27735
  */
27770
27736
  forward: /* @__PURE__ */ __name(function(lines) {
27771
- return csi + (lines || 1) + "C";
27737
+ return csi$1 + (lines || 1) + "C";
27772
27738
  }, "forward"),
27773
27739
  /**
27774
27740
  * Moves the cursor `lines` cells back. If the cursor is already at the edge of the screen, this has no effect
@@ -27776,7 +27742,7 @@ ansi.cursor = {
27776
27742
  * @return {string}
27777
27743
  */
27778
27744
  back: /* @__PURE__ */ __name(function(lines) {
27779
- return csi + (lines || 1) + "D";
27745
+ return csi$1 + (lines || 1) + "D";
27780
27746
  }, "back"),
27781
27747
  /**
27782
27748
  * Moves cursor to beginning of the line n lines down.
@@ -27784,7 +27750,7 @@ ansi.cursor = {
27784
27750
  * @return {string}
27785
27751
  */
27786
27752
  nextLine: /* @__PURE__ */ __name(function(lines) {
27787
- return csi + (lines || 1) + "E";
27753
+ return csi$1 + (lines || 1) + "E";
27788
27754
  }, "nextLine"),
27789
27755
  /**
27790
27756
  * Moves cursor to beginning of the line n lines up.
@@ -27792,7 +27758,7 @@ ansi.cursor = {
27792
27758
  * @return {string}
27793
27759
  */
27794
27760
  previousLine: /* @__PURE__ */ __name(function(lines) {
27795
- return csi + (lines || 1) + "F";
27761
+ return csi$1 + (lines || 1) + "F";
27796
27762
  }, "previousLine"),
27797
27763
  /**
27798
27764
  * Moves the cursor to column n.
@@ -27800,7 +27766,7 @@ ansi.cursor = {
27800
27766
  * @return {string}
27801
27767
  */
27802
27768
  horizontalAbsolute: /* @__PURE__ */ __name(function(n) {
27803
- return csi + n + "G";
27769
+ return csi$1 + n + "G";
27804
27770
  }, "horizontalAbsolute"),
27805
27771
  /**
27806
27772
  * Moves the cursor to row n, column m. The values are 1-based, and default to 1 (top left corner) if omitted.
@@ -27809,25 +27775,25 @@ ansi.cursor = {
27809
27775
  * @return {string}
27810
27776
  */
27811
27777
  position: /* @__PURE__ */ __name(function(n, m) {
27812
- return csi + (n || 1) + ";" + (m || 1) + "H";
27778
+ return csi$1 + (n || 1) + ";" + (m || 1) + "H";
27813
27779
  }, "position"),
27814
27780
  /**
27815
27781
  * Hides the cursor
27816
27782
  */
27817
- hide: csi + "?25l",
27783
+ hide: csi$1 + "?25l",
27818
27784
  /**
27819
27785
  * Shows the cursor
27820
27786
  */
27821
- show: csi + "?25h"
27787
+ show: csi$1 + "?25h"
27822
27788
  };
27823
- ansi.erase = {
27789
+ ansi$1.erase = {
27824
27790
  /**
27825
27791
  * Clears part of the screen. If n is 0 (or missing), clear from cursor to end of screen. If n is 1, clear from cursor to beginning of the screen. If n is 2, clear entire screen.
27826
27792
  * @param n {number}
27827
27793
  * @return {string}
27828
27794
  */
27829
27795
  display: /* @__PURE__ */ __name(function(n) {
27830
- return csi + (n || 0) + "J";
27796
+ return csi$1 + (n || 0) + "J";
27831
27797
  }, "display"),
27832
27798
  /**
27833
27799
  * Erases part of the line. If n is zero (or missing), clear from cursor to the end of the line. If n is one, clear from cursor to beginning of the line. If n is two, clear entire line. Cursor position does not change.
@@ -27835,7 +27801,7 @@ ansi.erase = {
27835
27801
  * @return {string}
27836
27802
  */
27837
27803
  inLine: /* @__PURE__ */ __name(function(n) {
27838
- return csi + (n || 0) + "K";
27804
+ return csi$1 + (n || 0) + "K";
27839
27805
  }, "inLine")
27840
27806
  };
27841
27807
  const pkg$3 = {
@@ -27867,7 +27833,7 @@ Commands:
27867
27833
  if ("Gyroscope" in globalThis) sensors.push("gyroscope");
27868
27834
  if ("LinearAccelerationSensor" in globalThis) sensors.push("linear");
27869
27835
  if ("AbsoluteOrientationSensor" in globalThis) sensors.push("orientation");
27870
- terminal.writeln(`${ansi.style.bold}📱 Available Sensors:${ansi.style.reset}`);
27836
+ terminal.writeln(`${ansi$1.style.bold}📱 Available Sensors:${ansi$1.style.reset}`);
27871
27837
  sensors.forEach((sensor2) => terminal.writeln(` - ${sensor2}`));
27872
27838
  break;
27873
27839
  case "read":
@@ -28094,27 +28060,27 @@ function displaySensorData(sensor, sensorType, terminal) {
28094
28060
  switch (sensorType) {
28095
28061
  case "accelerometer":
28096
28062
  case "linear":
28097
- terminal.writeln(`${ansi.style.bold}📊 ${sensorType.charAt(0).toUpperCase() + sensorType.slice(1)} Reading:${ansi.style.reset}
28098
- 🕒 Time: ${ansi.style.cyan}${timestamp}${ansi.style.reset}
28099
- X: ${ansi.style.cyan}${sensor.x.toFixed(2)}${ansi.style.reset} m/s²
28100
- Y: ${ansi.style.cyan}${sensor.y.toFixed(2)}${ansi.style.reset} m/s²
28101
- Z: ${ansi.style.cyan}${sensor.z.toFixed(2)}${ansi.style.reset} m/s²`);
28063
+ terminal.writeln(`${ansi$1.style.bold}📊 ${sensorType.charAt(0).toUpperCase() + sensorType.slice(1)} Reading:${ansi$1.style.reset}
28064
+ 🕒 Time: ${ansi$1.style.cyan}${timestamp}${ansi$1.style.reset}
28065
+ X: ${ansi$1.style.cyan}${sensor.x.toFixed(2)}${ansi$1.style.reset} m/s²
28066
+ Y: ${ansi$1.style.cyan}${sensor.y.toFixed(2)}${ansi$1.style.reset} m/s²
28067
+ Z: ${ansi$1.style.cyan}${sensor.z.toFixed(2)}${ansi$1.style.reset} m/s²`);
28102
28068
  break;
28103
28069
  case "gyroscope":
28104
- terminal.writeln(`${ansi.style.bold}📊 Gyroscope Reading:${ansi.style.reset}
28105
- 🕒 Time: ${ansi.style.cyan}${timestamp}${ansi.style.reset}
28106
- X: ${ansi.style.cyan}${sensor.x.toFixed(2)}${ansi.style.reset} rad/s
28107
- Y: ${ansi.style.cyan}${sensor.y.toFixed(2)}${ansi.style.reset} rad/s
28108
- Z: ${ansi.style.cyan}${sensor.z.toFixed(2)}${ansi.style.reset} rad/s`);
28070
+ terminal.writeln(`${ansi$1.style.bold}📊 Gyroscope Reading:${ansi$1.style.reset}
28071
+ 🕒 Time: ${ansi$1.style.cyan}${timestamp}${ansi$1.style.reset}
28072
+ X: ${ansi$1.style.cyan}${sensor.x.toFixed(2)}${ansi$1.style.reset} rad/s
28073
+ Y: ${ansi$1.style.cyan}${sensor.y.toFixed(2)}${ansi$1.style.reset} rad/s
28074
+ Z: ${ansi$1.style.cyan}${sensor.z.toFixed(2)}${ansi$1.style.reset} rad/s`);
28109
28075
  break;
28110
28076
  case "orientation":
28111
- terminal.writeln(`${ansi.style.bold}📊 Orientation Reading:${ansi.style.reset}
28112
- 🕒 Time: ${ansi.style.cyan}${timestamp}${ansi.style.reset}
28077
+ terminal.writeln(`${ansi$1.style.bold}📊 Orientation Reading:${ansi$1.style.reset}
28078
+ 🕒 Time: ${ansi$1.style.cyan}${timestamp}${ansi$1.style.reset}
28113
28079
  Quaternion:
28114
- X: ${ansi.style.cyan}${sensor.quaternion[0].toFixed(3)}${ansi.style.reset}
28115
- Y: ${ansi.style.cyan}${sensor.quaternion[1].toFixed(3)}${ansi.style.reset}
28116
- Z: ${ansi.style.cyan}${sensor.quaternion[2].toFixed(3)}${ansi.style.reset}
28117
- W: ${ansi.style.cyan}${sensor.quaternion[3].toFixed(3)}${ansi.style.reset}`);
28080
+ X: ${ansi$1.style.cyan}${sensor.quaternion[0].toFixed(3)}${ansi$1.style.reset}
28081
+ Y: ${ansi$1.style.cyan}${sensor.quaternion[1].toFixed(3)}${ansi$1.style.reset}
28082
+ Z: ${ansi$1.style.cyan}${sensor.quaternion[2].toFixed(3)}${ansi$1.style.reset}
28083
+ W: ${ansi$1.style.cyan}${sensor.quaternion[3].toFixed(3)}${ansi$1.style.reset}`);
28118
28084
  break;
28119
28085
  }
28120
28086
  }
@@ -28593,7 +28559,7 @@ const _Dom = class _Dom {
28593
28559
  }
28594
28560
  async topbar(show) {
28595
28561
  if (!this._topbar) return;
28596
- const { default: topbar } = await import("./topbar.min-fpX-LYox.js").then((n) => n.t);
28562
+ const { default: topbar } = await import("./topbar.min-BK1fdCNA.js").then((n) => n.t);
28597
28563
  this._topbarShow = show ?? !this._topbarShow;
28598
28564
  if (this._topbarShow) topbar.show();
28599
28565
  else topbar.hide();
@@ -28813,7 +28779,6 @@ const _IndexedDB = {
28813
28779
  }
28814
28780
  };
28815
28781
  const IndexedDB = _IndexedDB;
28816
- /*! @gera2ld/tarjs v0.3.1 | MIT License */
28817
28782
  const encoder = new TextEncoder();
28818
28783
  const utf8Encode = /* @__PURE__ */ __name((input) => encoder.encode(input), "utf8Encode");
28819
28784
  const decoder = new TextDecoder();
@@ -28904,7 +28869,6 @@ function readTextFile(buffer2, offset, size) {
28904
28869
  return utf8Decode(view2);
28905
28870
  }
28906
28871
  __name(readTextFile, "readTextFile");
28907
- /*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */
28908
28872
  const Z_FIXED$1 = 4;
28909
28873
  const Z_BINARY = 0;
28910
28874
  const Z_TEXT = 1;
@@ -33162,19 +33126,51 @@ const _Filesystem = class _Filesystem {
33162
33126
  ["/proc/userAgent", t2("User Agent")],
33163
33127
  ["/proc/userAgentData", t2("User Agent Data")],
33164
33128
  ["/proc/version", t2("Kernel Version")],
33129
+ [".bin", t2("Binary File")],
33165
33130
  [".bmp", t2("Bitmap Image")],
33131
+ [".c", t2("C Source File")],
33132
+ [".cpp", t2("C++ Source File")],
33133
+ [".css", t2("CSS Stylesheet")],
33134
+ [".csv", t2("CSV Data")],
33166
33135
  [".gif", t2("GIF Image")],
33136
+ [".h", t2("C Header File")],
33137
+ [".hpp", t2("C++ Header File")],
33138
+ [".html", t2("HTML Document")],
33139
+ [".java", t2("Java Source File")],
33167
33140
  [".jpg", t2("JPEG Image")],
33168
33141
  [".jpeg", t2("JPEG Image")],
33169
33142
  [".js", t2("JavaScript File")],
33170
33143
  [".json", t2("JSON Data")],
33144
+ [".jsonc", t2("JSONC Data")],
33145
+ [".jsonl", t2("JSONL Data")],
33146
+ [".jsx", t2("JSX Source File")],
33147
+ [".log", t2("Log File")],
33148
+ [".lua", t2("Lua Script")],
33171
33149
  [".md", t2("Markdown Document")],
33172
33150
  [".pdf", t2("PDF Document")],
33151
+ [".php", t2("PHP Script")],
33173
33152
  [".png", t2("PNG Image")],
33153
+ [".py", t2("Python Script")],
33154
+ [".rb", t2("Ruby Script")],
33155
+ [".rs", t2("Rust Source File")],
33156
+ [".scala", t2("Scala Source File")],
33157
+ [".sh", t2("Shell Script")],
33174
33158
  [".sixel", t2("Sixel Graphics")],
33159
+ [".swift", t2("Swift Source File")],
33160
+ [".tar", t2("TAR Archive")],
33161
+ [".tar.bz2", t2("TAR Archive (BZIP2)")],
33162
+ [".tar.gz", t2("TAR Archive (GZIP)")],
33163
+ [".tar.xz", t2("TAR Archive (XZ)")],
33164
+ [".ts", t2("TypeScript File")],
33165
+ [".tsx", t2("TypeScript React File")],
33175
33166
  [".txt", t2("Text File")],
33167
+ [".vue", t2("Vue.js Component")],
33176
33168
  [".wasm", t2("WebAssembly Module")],
33177
- [".wat", t2("WebAssembly Text Format")]
33169
+ [".wat", t2("WebAssembly Text Format")],
33170
+ [".xml", t2("XML Document")],
33171
+ [".yaml", t2("YAML Data")],
33172
+ [".yml", t2("YAML Data")],
33173
+ [".zip", t2("ZIP Archive")]
33178
33174
  ]);
33179
33175
  }, "descriptions"));
33180
33176
  this._kernel = kernel;
@@ -36468,7 +36464,7 @@ var hasRequiredXterm;
36468
36464
  function requireXterm() {
36469
36465
  if (hasRequiredXterm) return xterm.exports;
36470
36466
  hasRequiredXterm = 1;
36471
- (function(module, exports) {
36467
+ (function(module, exports$1) {
36472
36468
  !(function(e2, t2) {
36473
36469
  module.exports = t2();
36474
36470
  })(globalThis, (() => (() => {
@@ -42622,7 +42618,7 @@ var hasRequiredAddonAttach;
42622
42618
  function requireAddonAttach() {
42623
42619
  if (hasRequiredAddonAttach) return addonAttach.exports;
42624
42620
  hasRequiredAddonAttach = 1;
42625
- (function(module, exports) {
42621
+ (function(module, exports$1) {
42626
42622
  !(function(e2, t2) {
42627
42623
  module.exports = t2();
42628
42624
  })(self, (() => (() => {
@@ -42684,7 +42680,7 @@ var hasRequiredAddonFit;
42684
42680
  function requireAddonFit() {
42685
42681
  if (hasRequiredAddonFit) return addonFit.exports;
42686
42682
  hasRequiredAddonFit = 1;
42687
- (function(module, exports) {
42683
+ (function(module, exports$1) {
42688
42684
  !(function(e2, t2) {
42689
42685
  module.exports = t2();
42690
42686
  })(self, (() => (() => {
@@ -42724,7 +42720,7 @@ var hasRequiredAddonImage;
42724
42720
  function requireAddonImage() {
42725
42721
  if (hasRequiredAddonImage) return addonImage.exports;
42726
42722
  hasRequiredAddonImage = 1;
42727
- (function(module, exports) {
42723
+ (function(module, exports$1) {
42728
42724
  !(function(A2, e2) {
42729
42725
  module.exports = e2();
42730
42726
  })(self, (() => (() => {
@@ -43808,7 +43804,7 @@ var hasRequiredAddonSearch;
43808
43804
  function requireAddonSearch() {
43809
43805
  if (hasRequiredAddonSearch) return addonSearch.exports;
43810
43806
  hasRequiredAddonSearch = 1;
43811
- (function(module, exports) {
43807
+ (function(module, exports$1) {
43812
43808
  !(function(e2, t2) {
43813
43809
  module.exports = t2();
43814
43810
  })(self, (() => (() => {
@@ -44126,7 +44122,7 @@ var hasRequiredAddonSerialize;
44126
44122
  function requireAddonSerialize() {
44127
44123
  if (hasRequiredAddonSerialize) return addonSerialize$1.exports;
44128
44124
  hasRequiredAddonSerialize = 1;
44129
- (function(module, exports) {
44125
+ (function(module, exports$1) {
44130
44126
  !(function(e2, t2) {
44131
44127
  module.exports = t2();
44132
44128
  })(addonSerialize, (() => (() => {
@@ -44719,7 +44715,7 @@ var hasRequiredAddonWebLinks;
44719
44715
  function requireAddonWebLinks() {
44720
44716
  if (hasRequiredAddonWebLinks) return addonWebLinks.exports;
44721
44717
  hasRequiredAddonWebLinks = 1;
44722
- (function(module, exports) {
44718
+ (function(module, exports$1) {
44723
44719
  !(function(e2, t2) {
44724
44720
  module.exports = t2();
44725
44721
  })(self, (() => (() => {
@@ -44851,7 +44847,7 @@ var hasRequiredHumanFormat$1;
44851
44847
  function requireHumanFormat$1() {
44852
44848
  if (hasRequiredHumanFormat$1) return humanFormat$5.exports;
44853
44849
  hasRequiredHumanFormat$1 = 1;
44854
- (function(module, exports) {
44850
+ (function(module, exports$1) {
44855
44851
  (function(root, factory) {
44856
44852
  {
44857
44853
  module.exports = factory();
@@ -55926,9 +55922,9 @@ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
55926
55922
  }
55927
55923
  __name(stringEncaseCRLFWithFirstIndex, "stringEncaseCRLFWithFirstIndex");
55928
55924
  const { stdout: stdoutColor, stderr: stderrColor } = supportsColor;
55929
- const GENERATOR = Symbol("GENERATOR");
55930
- const STYLER = Symbol("STYLER");
55931
- const IS_EMPTY = Symbol("IS_EMPTY");
55925
+ const GENERATOR = /* @__PURE__ */ Symbol("GENERATOR");
55926
+ const STYLER = /* @__PURE__ */ Symbol("STYLER");
55927
+ const IS_EMPTY = /* @__PURE__ */ Symbol("IS_EMPTY");
55932
55928
  const levelMapping = [
55933
55929
  "ansi",
55934
55930
  "ansi",
@@ -59060,7 +59056,7 @@ const re = {
59060
59056
  chunk: /[^\s-]+?-\b|\S+|\s+|\r\n?|\n/g,
59061
59057
  ansiEscapeSequence: /\u001b.*?m/g
59062
59058
  };
59063
- const EMPTY_LINE = Symbol("emptyLine");
59059
+ const EMPTY_LINE = /* @__PURE__ */ Symbol("emptyLine");
59064
59060
  const _Wordwrap = class _Wordwrap {
59065
59061
  /**
59066
59062
  * @param {string} text - The input text to wrap.
@@ -59633,7 +59629,7 @@ const _TerminalCommand = class _TerminalCommand {
59633
59629
  };
59634
59630
  __name(_TerminalCommand, "TerminalCommand");
59635
59631
  let TerminalCommand = _TerminalCommand;
59636
- function createCommand$c(kernel, shell, terminal) {
59632
+ function createCommand$h(kernel, shell, terminal) {
59637
59633
  return new TerminalCommand({
59638
59634
  command: "cat",
59639
59635
  description: "Concatenate files and print on the standard output",
@@ -59717,8 +59713,8 @@ function createCommand$c(kernel, shell, terminal) {
59717
59713
  }, "run")
59718
59714
  });
59719
59715
  }
59720
- __name(createCommand$c, "createCommand$c");
59721
- function createCommand$b(kernel, shell, terminal) {
59716
+ __name(createCommand$h, "createCommand$h");
59717
+ function createCommand$g(kernel, shell, terminal) {
59722
59718
  return new TerminalCommand({
59723
59719
  command: "cd",
59724
59720
  description: "Change the shell working directory",
@@ -59730,13 +59726,7 @@ function createCommand$b(kernel, shell, terminal) {
59730
59726
  { name: "path", type: String, typeLabel: "{underline path}", defaultOption: true, description: "The path to the directory to change to" }
59731
59727
  ],
59732
59728
  run: /* @__PURE__ */ __name(async (argv) => {
59733
- let destination = argv.path || shell.cwd;
59734
- if (destination && destination.startsWith("~")) {
59735
- const home = shell.env.get("HOME");
59736
- if (home) {
59737
- destination = destination.replace(/^~(?=$|\/)/, home);
59738
- }
59739
- }
59729
+ const destination = argv.path || shell.cwd;
59740
59730
  const fullPath = destination ? path$1.resolve(shell.cwd, destination) : shell.cwd;
59741
59731
  await shell.context.fs.promises.access(fullPath);
59742
59732
  shell.cwd = fullPath;
@@ -59745,8 +59735,8 @@ function createCommand$b(kernel, shell, terminal) {
59745
59735
  }, "run")
59746
59736
  });
59747
59737
  }
59748
- __name(createCommand$b, "createCommand$b");
59749
- function createCommand$a(kernel, shell, terminal) {
59738
+ __name(createCommand$g, "createCommand$g");
59739
+ function createCommand$f(kernel, shell, terminal) {
59750
59740
  return new TerminalCommand({
59751
59741
  command: "chmod",
59752
59742
  description: "Change file mode bits",
@@ -59772,8 +59762,8 @@ function createCommand$a(kernel, shell, terminal) {
59772
59762
  }, "run")
59773
59763
  });
59774
59764
  }
59775
- __name(createCommand$a, "createCommand$a");
59776
- function createCommand$9(kernel, shell, terminal) {
59765
+ __name(createCommand$f, "createCommand$f");
59766
+ function createCommand$e(kernel, shell, terminal) {
59777
59767
  return new TerminalCommand({
59778
59768
  command: "cp",
59779
59769
  description: "Copy files",
@@ -59795,8 +59785,8 @@ function createCommand$9(kernel, shell, terminal) {
59795
59785
  }, "run")
59796
59786
  });
59797
59787
  }
59798
- __name(createCommand$9, "createCommand$9");
59799
- function createCommand$8(kernel, shell, terminal) {
59788
+ __name(createCommand$e, "createCommand$e");
59789
+ function createCommand$d(kernel, shell, terminal) {
59800
59790
  return new TerminalCommand({
59801
59791
  command: "echo",
59802
59792
  description: "Print arguments to the standard output",
@@ -59824,14 +59814,107 @@ function createCommand$8(kernel, shell, terminal) {
59824
59814
  }, "run")
59825
59815
  });
59826
59816
  }
59827
- __name(createCommand$8, "createCommand$8");
59817
+ __name(createCommand$d, "createCommand$d");
59818
+ function createCommand$c(kernel, shell, terminal) {
59819
+ return new TerminalCommand({
59820
+ command: "ln",
59821
+ description: "Create links between files",
59822
+ kernel,
59823
+ shell,
59824
+ terminal,
59825
+ options: [
59826
+ { name: "help", type: Boolean, description: kernel.i18n.t("Display help") },
59827
+ { name: "symbolic", type: Boolean, alias: "s", description: "Create symbolic links instead of hard links" },
59828
+ { name: "force", type: Boolean, alias: "f", description: "Remove existing destination files" },
59829
+ { name: "verbose", type: Boolean, alias: "v", description: "Print name of each linked file" },
59830
+ { name: "args", type: String, multiple: true, defaultOption: true, description: "The target and optional link name" }
59831
+ ],
59832
+ run: /* @__PURE__ */ __name(async (argv, process2) => {
59833
+ const args = argv.args || [];
59834
+ const symbolic = argv.symbolic || false;
59835
+ const force = argv.force || false;
59836
+ const verbose = argv.verbose || false;
59837
+ if (args.length === 0) {
59838
+ await writelnStderr(process2, terminal, chalk$1.red("ln: missing file operand"));
59839
+ await writelnStderr(process2, terminal, "Try 'ln --help' for more information.");
59840
+ return 1;
59841
+ }
59842
+ const target = args[0];
59843
+ if (!target) {
59844
+ await writelnStderr(process2, terminal, chalk$1.red("ln: missing file operand"));
59845
+ return 1;
59846
+ }
59847
+ const targetPath = path$1.resolve(shell.cwd, target);
59848
+ let targetStats;
59849
+ try {
59850
+ targetStats = await shell.context.fs.promises.stat(targetPath);
59851
+ if (!targetStats.isFile() && !targetStats.isDirectory()) {
59852
+ await writelnStderr(process2, terminal, chalk$1.red(`ln: ${target}: invalid target`));
59853
+ return 1;
59854
+ }
59855
+ if (!symbolic && targetStats.isDirectory()) {
59856
+ await writelnStderr(process2, terminal, chalk$1.red(`ln: ${target}: hard link not allowed for directory`));
59857
+ return 1;
59858
+ }
59859
+ } catch (error) {
59860
+ await writelnStderr(process2, terminal, chalk$1.red(`ln: ${target}: No such file or directory`));
59861
+ return 1;
59862
+ }
59863
+ let linkName;
59864
+ if (args.length === 1) {
59865
+ linkName = path$1.join(shell.cwd, path$1.basename(target));
59866
+ } else {
59867
+ const linkNameInput = args[1];
59868
+ if (!linkNameInput) {
59869
+ await writelnStderr(process2, terminal, chalk$1.red("ln: missing link name"));
59870
+ return 1;
59871
+ }
59872
+ const linkNamePath = path$1.resolve(shell.cwd, linkNameInput);
59873
+ const linkNameStats = await shell.context.fs.promises.stat(linkNamePath).catch(() => null);
59874
+ if (linkNameStats?.isDirectory()) {
59875
+ linkName = path$1.join(linkNamePath, path$1.basename(target));
59876
+ } else {
59877
+ linkName = linkNamePath;
59878
+ }
59879
+ }
59880
+ try {
59881
+ const linkExists = await shell.context.fs.promises.stat(linkName).catch(() => null);
59882
+ if (linkExists) {
59883
+ if (force) {
59884
+ if (linkExists.isDirectory()) {
59885
+ await shell.context.fs.promises.rmdir(linkName);
59886
+ } else {
59887
+ await shell.context.fs.promises.unlink(linkName);
59888
+ }
59889
+ } else {
59890
+ await writelnStderr(process2, terminal, chalk$1.red(`ln: ${linkName}: File exists`));
59891
+ return 1;
59892
+ }
59893
+ }
59894
+ if (symbolic) {
59895
+ await shell.context.fs.promises.symlink(targetPath, linkName);
59896
+ } else {
59897
+ await shell.context.fs.promises.link(targetPath, linkName);
59898
+ }
59899
+ if (verbose) {
59900
+ await writelnStdout(process2, terminal, linkName);
59901
+ }
59902
+ return 0;
59903
+ } catch (error) {
59904
+ await writelnStderr(process2, terminal, chalk$1.red(`ln: ${error.message}`));
59905
+ return 1;
59906
+ }
59907
+ }, "run")
59908
+ });
59909
+ }
59910
+ __name(createCommand$c, "createCommand$c");
59828
59911
  var humanFormat$2 = { exports: {} };
59829
59912
  var humanFormat$1 = humanFormat$2.exports;
59830
59913
  var hasRequiredHumanFormat;
59831
59914
  function requireHumanFormat() {
59832
59915
  if (hasRequiredHumanFormat) return humanFormat$2.exports;
59833
59916
  hasRequiredHumanFormat = 1;
59834
- (function(module, exports) {
59917
+ (function(module, exports$1) {
59835
59918
  (function(root, factory) {
59836
59919
  {
59837
59920
  module.exports = factory();
@@ -60105,7 +60188,7 @@ function requireHumanFormat() {
60105
60188
  __name(requireHumanFormat, "requireHumanFormat");
60106
60189
  var humanFormatExports = requireHumanFormat();
60107
60190
  const humanFormat = /* @__PURE__ */ getDefaultExportFromCjs(humanFormatExports);
60108
- function createCommand$7(kernel, shell, terminal) {
60191
+ function createCommand$b(kernel, shell, terminal) {
60109
60192
  return new TerminalCommand({
60110
60193
  command: "ls",
60111
60194
  description: "List directory contents",
@@ -60132,8 +60215,11 @@ function createCommand$7(kernel, shell, terminal) {
60132
60215
  else if (stats2.isSocket()) type = "s";
60133
60216
  return type;
60134
60217
  }, "getModeType");
60135
- const getModeString = /* @__PURE__ */ __name((stats2) => {
60136
- return getModeType(stats2) + (Number(stats2.mode) & parseInt("777", 8)).toString(8).padStart(3, "0").replace(/0/g, "---").replace(/1/g, "--" + chalk$1.red("x")).replace(/2/g, "-" + chalk$1.yellow("w") + "-").replace(/3/g, "-" + chalk$1.yellow("w") + chalk$1.red("x")).replace(/4/g, chalk$1.green("r") + "--").replace(/5/g, chalk$1.green("r") + "-" + chalk$1.red("x")).replace(/6/g, chalk$1.green("r") + chalk$1.yellow("w") + "-").replace(/7/g, chalk$1.green("r") + chalk$1.yellow("w") + chalk$1.red("x"));
60218
+ const getModeString = /* @__PURE__ */ __name((stats2, targetStats) => {
60219
+ const type = getModeType(stats2);
60220
+ const modeStats = targetStats || stats2;
60221
+ const permissions = (Number(modeStats.mode) & parseInt("777", 8)).toString(8).padStart(3, "0").replace(/0/g, "---").replace(/1/g, "--" + chalk$1.red("x")).replace(/2/g, "-" + chalk$1.yellow("w") + "-").replace(/3/g, "-" + chalk$1.yellow("w") + chalk$1.red("x")).replace(/4/g, chalk$1.green("r") + "--").replace(/5/g, chalk$1.green("r") + "-" + chalk$1.red("x")).replace(/6/g, chalk$1.green("r") + chalk$1.yellow("w") + "-").replace(/7/g, chalk$1.green("r") + chalk$1.yellow("w") + chalk$1.red("x"));
60222
+ return type + permissions;
60137
60223
  }, "getModeString");
60138
60224
  const getTimestampString = /* @__PURE__ */ __name((timestamp) => {
60139
60225
  const diff = ((/* @__PURE__ */ new Date()).getTime() - timestamp.getTime()) / 1e3;
@@ -60149,43 +60235,94 @@ function createCommand$7(kernel, shell, terminal) {
60149
60235
  else if (stats2.uid === 0) return chalk$1.red(`${owner?.username || stats2.uid}:${owner?.username || stats2.gid}`);
60150
60236
  else return chalk$1.gray(`${owner?.username || stats2.uid}:${owner?.username || stats2.gid}`);
60151
60237
  }, "getOwnerString");
60238
+ const getLinkInfo = /* @__PURE__ */ __name((linkTarget, linkStats, stats2) => {
60239
+ if (linkTarget || linkStats && linkStats.isSymbolicLink()) return kernel.i18n.t("Symbolic Link");
60240
+ if (stats2 && stats2.nlink > 1) return kernel.i18n.t("Hard Link");
60241
+ return "";
60242
+ }, "getLinkInfo");
60152
60243
  const filesMap = await Promise.all(entries2.map(async (entry) => {
60153
60244
  const target2 = path$1.resolve(fullPath, entry);
60154
60245
  try {
60155
- return { target: target2, name: entry, stats: await shell.context.fs.promises.stat(target2) };
60246
+ let linkTarget = null;
60247
+ let linkStats = null;
60248
+ let stats2 = null;
60249
+ try {
60250
+ linkStats = await shell.context.fs.promises.lstat(target2);
60251
+ if (linkStats.isSymbolicLink()) {
60252
+ try {
60253
+ linkTarget = await shell.context.fs.promises.readlink(target2);
60254
+ stats2 = await shell.context.fs.promises.stat(target2);
60255
+ } catch {
60256
+ stats2 = linkStats;
60257
+ }
60258
+ } else {
60259
+ stats2 = linkStats;
60260
+ }
60261
+ } catch {
60262
+ stats2 = await shell.context.fs.promises.stat(target2);
60263
+ }
60264
+ return { target: target2, name: entry, stats: stats2, linkStats, linkTarget };
60156
60265
  } catch {
60157
- return { target: target2, name: entry, stats: null };
60266
+ return { target: target2, name: entry, stats: null, linkStats: null, linkTarget: null };
60158
60267
  }
60159
60268
  }));
60160
60269
  const files = filesMap.filter((entry) => entry && entry.stats && !entry.stats.isDirectory()).filter((entry) => entry !== null && entry !== void 0);
60161
60270
  const directoryMap = await Promise.all(entries2.map(async (entry) => {
60162
60271
  const target2 = path$1.resolve(fullPath, entry);
60163
60272
  try {
60164
- return { target: target2, name: entry, stats: await shell.context.fs.promises.stat(target2) };
60273
+ let linkTarget = null;
60274
+ let linkStats = null;
60275
+ let stats2 = null;
60276
+ try {
60277
+ linkStats = await shell.context.fs.promises.lstat(target2);
60278
+ if (linkStats.isSymbolicLink()) {
60279
+ try {
60280
+ linkTarget = await shell.context.fs.promises.readlink(target2);
60281
+ stats2 = await shell.context.fs.promises.stat(target2);
60282
+ } catch {
60283
+ stats2 = linkStats;
60284
+ }
60285
+ } else {
60286
+ stats2 = linkStats;
60287
+ }
60288
+ } catch {
60289
+ stats2 = await shell.context.fs.promises.stat(target2);
60290
+ }
60291
+ return { target: target2, name: entry, stats: stats2, linkStats, linkTarget };
60165
60292
  } catch {
60166
- return { target: target2, name: entry, stats: null };
60293
+ return { target: target2, name: entry, stats: null, linkStats: null, linkTarget: null };
60167
60294
  }
60168
60295
  }));
60169
60296
  const directories = directoryMap.filter((entry) => entry && entry.stats && entry.stats.isDirectory()).filter((entry, index, self2) => self2.findIndex((e2) => e2?.name === entry?.name) === index).filter((entry) => entry !== null && entry !== void 0);
60170
60297
  const data = [
60171
60298
  ["Name", "Size", "Modified", "Mode", "Owner", "Info"],
60172
60299
  ...directories.sort((a, b) => a.name.localeCompare(b.name)).map((directory) => {
60300
+ const displayName = directory.linkTarget ? `${directory.name} ${chalk$1.cyan("⟶")} ${directory.linkTarget}` : directory.name;
60301
+ const modeStats = directory.linkStats && directory.linkStats.isSymbolicLink() ? directory.linkStats : directory.stats;
60302
+ const modeString = modeStats ? getModeString(modeStats, directory.linkStats?.isSymbolicLink() ? directory.stats : void 0) : "";
60303
+ const linkInfo = getLinkInfo(directory.linkTarget, directory.linkStats, directory.stats);
60173
60304
  return [
60174
- directory.name,
60305
+ displayName,
60175
60306
  "",
60176
60307
  directory.stats ? getTimestampString(directory.stats.mtime) : "",
60177
- directory.stats ? getModeString(directory.stats) : "",
60178
- directory.stats ? getOwnerString(directory.stats) : ""
60308
+ modeString,
60309
+ directory.stats ? getOwnerString(directory.stats) : "",
60310
+ linkInfo
60179
60311
  ];
60180
60312
  }),
60181
60313
  ...files.sort((a, b) => a.name.localeCompare(b.name)).map((file) => {
60314
+ const displayName = file.linkTarget ? `${file.name} ${chalk$1.cyan("⟶")} ${file.linkTarget}` : file.name;
60315
+ const modeStats = file.linkStats && file.linkStats.isSymbolicLink() ? file.linkStats : file.stats;
60316
+ const modeString = modeStats ? getModeString(modeStats, file.linkStats?.isSymbolicLink() ? file.stats : void 0) : "";
60182
60317
  return [
60183
- file.name,
60318
+ displayName,
60184
60319
  file.stats ? humanFormat(file.stats.size) : "",
60185
60320
  file.stats ? getTimestampString(file.stats.mtime) : "",
60186
- file.stats ? getModeString(file.stats) : "",
60321
+ modeString,
60187
60322
  file.stats ? getOwnerString(file.stats) : "",
60188
60323
  (() => {
60324
+ const linkInfo = getLinkInfo(file.linkTarget, file.linkStats, file.stats);
60325
+ if (linkInfo) return linkInfo;
60189
60326
  if (descriptions.has(path$1.resolve(fullPath, file.name))) return descriptions.get(path$1.resolve(fullPath, file.name));
60190
60327
  const ext = file.name.split(".").pop();
60191
60328
  if (ext && descriptions.has("." + ext)) return descriptions.get("." + ext);
@@ -60205,7 +60342,9 @@ function createCommand$7(kernel, shell, terminal) {
60205
60342
  const line3 = row.map((cell, index) => {
60206
60343
  const paddedCell = cell.padEnd(columnWidths?.[index] ?? 0);
60207
60344
  if (index === 0 && rowIndex > 0) {
60208
- return row[3]?.startsWith("d") ? chalk$1.blue(paddedCell) : chalk$1.green(paddedCell);
60345
+ if (row[3]?.startsWith("d")) return chalk$1.blue(paddedCell);
60346
+ else if (row[3]?.startsWith("l")) return chalk$1.cyan(paddedCell);
60347
+ else return chalk$1.green(paddedCell);
60209
60348
  } else return rowIndex === 0 ? chalk$1.bold(paddedCell) : chalk$1.gray(paddedCell);
60210
60349
  }).join(" ");
60211
60350
  if (data.length > 1) await writelnStdout(process2, terminal, line3);
@@ -60214,8 +60353,8 @@ function createCommand$7(kernel, shell, terminal) {
60214
60353
  }, "run")
60215
60354
  });
60216
60355
  }
60217
- __name(createCommand$7, "createCommand$7");
60218
- function createCommand$6(kernel, shell, terminal) {
60356
+ __name(createCommand$b, "createCommand$b");
60357
+ function createCommand$a(kernel, shell, terminal) {
60219
60358
  return new TerminalCommand({
60220
60359
  command: "mkdir",
60221
60360
  description: "Create a directory",
@@ -60234,8 +60373,8 @@ function createCommand$6(kernel, shell, terminal) {
60234
60373
  }, "run")
60235
60374
  });
60236
60375
  }
60237
- __name(createCommand$6, "createCommand$6");
60238
- function createCommand$5(kernel, shell, terminal) {
60376
+ __name(createCommand$a, "createCommand$a");
60377
+ function createCommand$9(kernel, shell, terminal) {
60239
60378
  return new TerminalCommand({
60240
60379
  command: "mv",
60241
60380
  description: "Move or rename files",
@@ -60274,8 +60413,8 @@ function createCommand$5(kernel, shell, terminal) {
60274
60413
  }, "run")
60275
60414
  });
60276
60415
  }
60277
- __name(createCommand$5, "createCommand$5");
60278
- function createCommand$4(kernel, shell, terminal) {
60416
+ __name(createCommand$9, "createCommand$9");
60417
+ function createCommand$8(kernel, shell, terminal) {
60279
60418
  return new TerminalCommand({
60280
60419
  command: "pwd",
60281
60420
  description: "Print the shell working directory",
@@ -60291,8 +60430,8 @@ function createCommand$4(kernel, shell, terminal) {
60291
60430
  }, "run")
60292
60431
  });
60293
60432
  }
60294
- __name(createCommand$4, "createCommand$4");
60295
- function createCommand$3(kernel, shell, terminal) {
60433
+ __name(createCommand$8, "createCommand$8");
60434
+ function createCommand$7(kernel, shell, terminal) {
60296
60435
  return new TerminalCommand({
60297
60436
  command: "rm",
60298
60437
  description: "Remove files or directories",
@@ -60312,8 +60451,8 @@ function createCommand$3(kernel, shell, terminal) {
60312
60451
  }, "run")
60313
60452
  });
60314
60453
  }
60315
- __name(createCommand$3, "createCommand$3");
60316
- function createCommand$2(kernel, shell, terminal) {
60454
+ __name(createCommand$7, "createCommand$7");
60455
+ function createCommand$6(kernel, shell, terminal) {
60317
60456
  return new TerminalCommand({
60318
60457
  command: "rmdir",
60319
60458
  description: "Remove a directory",
@@ -60332,7 +60471,7 @@ function createCommand$2(kernel, shell, terminal) {
60332
60471
  }, "run")
60333
60472
  });
60334
60473
  }
60335
- __name(createCommand$2, "createCommand$2");
60474
+ __name(createCommand$6, "createCommand$6");
60336
60475
  const MAX_32_BITS = 4294967295;
60337
60476
  const MAX_16_BITS = 65535;
60338
60477
  const MAX_8_BITS = 255;
@@ -65127,7 +65266,7 @@ const table = {
65127
65266
  return mimeTypes;
65128
65267
  })();
65129
65268
  t(configure);
65130
- function createCommand$1(kernel, shell, terminal) {
65269
+ function createCommand$5(kernel, shell, terminal) {
65131
65270
  return new TerminalCommand({
65132
65271
  command: "stat",
65133
65272
  description: "Display information about a file or directory",
@@ -65157,8 +65296,8 @@ function createCommand$1(kernel, shell, terminal) {
65157
65296
  }, "run")
65158
65297
  });
65159
65298
  }
65160
- __name(createCommand$1, "createCommand$1");
65161
- function createCommand(kernel, shell, terminal) {
65299
+ __name(createCommand$5, "createCommand$5");
65300
+ function createCommand$4(kernel, shell, terminal) {
65162
65301
  return new TerminalCommand({
65163
65302
  command: "touch",
65164
65303
  description: "Create an empty file",
@@ -65177,22 +65316,876 @@ function createCommand(kernel, shell, terminal) {
65177
65316
  }, "run")
65178
65317
  });
65179
65318
  }
65319
+ __name(createCommand$4, "createCommand$4");
65320
+ function createCommand$3(kernel, shell, terminal) {
65321
+ return new TerminalCommand({
65322
+ command: "hex",
65323
+ description: "Display file contents in hexadecimal format",
65324
+ kernel,
65325
+ shell,
65326
+ terminal,
65327
+ options: [
65328
+ { name: "help", type: Boolean, description: kernel.i18n.t("Display help") },
65329
+ { name: "path", type: String, typeLabel: "{underline path}", defaultOption: true, description: "The path to the file to display" }
65330
+ ],
65331
+ run: /* @__PURE__ */ __name(async (argv, process2) => {
65332
+ const filePath = argv.path;
65333
+ if (!filePath) {
65334
+ await writelnStderr(process2, terminal, "Usage: hex <file>");
65335
+ return 1;
65336
+ }
65337
+ const fullPath = path$1.resolve(shell.cwd, filePath);
65338
+ try {
65339
+ const exists2 = await shell.context.fs.promises.exists(fullPath);
65340
+ if (!exists2) {
65341
+ await writelnStderr(process2, terminal, `hex: ${filePath}: No such file or directory`);
65342
+ return 1;
65343
+ }
65344
+ const stats = await shell.context.fs.promises.stat(fullPath);
65345
+ if (stats.isDirectory()) {
65346
+ await writelnStderr(process2, terminal, `hex: ${filePath}: Is a directory`);
65347
+ return 1;
65348
+ }
65349
+ const data = await shell.context.fs.promises.readFile(fullPath);
65350
+ const bytesPerLine = 16;
65351
+ for (let offset = 0; offset < data.length; offset += bytesPerLine) {
65352
+ const lineBytes = data.slice(offset, offset + bytesPerLine);
65353
+ const offsetHex = offset.toString(16).padStart(8, "0");
65354
+ const hexGroups = [];
65355
+ const asciiChars = [];
65356
+ for (let i = 0; i < bytesPerLine; i++) {
65357
+ if (i < lineBytes.length) {
65358
+ const byte = lineBytes[i];
65359
+ if (byte === void 0) continue;
65360
+ const hex = byte.toString(16).padStart(2, "0");
65361
+ if (i % 2 === 0) {
65362
+ hexGroups.push(hex);
65363
+ } else {
65364
+ hexGroups[hexGroups.length - 1] += hex;
65365
+ }
65366
+ if (byte >= 32 && byte <= 126) {
65367
+ asciiChars.push(String.fromCharCode(byte));
65368
+ } else {
65369
+ asciiChars.push(".");
65370
+ }
65371
+ } else {
65372
+ if (i % 2 === 0) {
65373
+ hexGroups.push(" ");
65374
+ } else {
65375
+ hexGroups[hexGroups.length - 1] += " ";
65376
+ }
65377
+ asciiChars.push(" ");
65378
+ }
65379
+ }
65380
+ const hexString = hexGroups.join(" ").padEnd(47, " ");
65381
+ const asciiString = asciiChars.join("");
65382
+ await writelnStdout(process2, terminal, `${offsetHex}: ${hexString} ${asciiString}`);
65383
+ }
65384
+ return 0;
65385
+ } catch (error) {
65386
+ await writelnStderr(process2, terminal, `hex: ${filePath}: ${error instanceof Error ? error.message : "Unknown error"}`);
65387
+ return 1;
65388
+ }
65389
+ }, "run")
65390
+ });
65391
+ }
65392
+ __name(createCommand$3, "createCommand$3");
65393
+ const csi = "\x1B[";
65394
+ const ansi = {};
65395
+ ansi.style = {
65396
+ reset: "\x1B[0m",
65397
+ bold: "\x1B[1m",
65398
+ italic: "\x1B[3m",
65399
+ underline: "\x1B[4m",
65400
+ fontDefault: "\x1B[10m",
65401
+ font2: "\x1B[11m",
65402
+ font3: "\x1B[12m",
65403
+ font4: "\x1B[13m",
65404
+ font5: "\x1B[14m",
65405
+ font6: "\x1B[15m",
65406
+ imageNegative: "\x1B[7m",
65407
+ imagePositive: "\x1B[27m",
65408
+ black: "\x1B[30m",
65409
+ red: "\x1B[31m",
65410
+ green: "\x1B[32m",
65411
+ yellow: "\x1B[33m",
65412
+ blue: "\x1B[34m",
65413
+ magenta: "\x1B[35m",
65414
+ cyan: "\x1B[36m",
65415
+ white: "\x1B[37m",
65416
+ grey: "\x1B[90m",
65417
+ gray: "\x1B[90m",
65418
+ brightRed: "\x1B[91m",
65419
+ brightGreen: "\x1B[92m",
65420
+ brightYellow: "\x1B[93m",
65421
+ brightBlue: "\x1B[94m",
65422
+ brightMagenta: "\x1B[95m",
65423
+ brightCyan: "\x1B[96m",
65424
+ brightWhite: "\x1B[97m",
65425
+ "bg-black": "\x1B[40m",
65426
+ "bg-red": "\x1B[41m",
65427
+ "bg-green": "\x1B[42m",
65428
+ "bg-yellow": "\x1B[43m",
65429
+ "bg-blue": "\x1B[44m",
65430
+ "bg-magenta": "\x1B[45m",
65431
+ "bg-cyan": "\x1B[46m",
65432
+ "bg-white": "\x1B[47m",
65433
+ "bg-grey": "\x1B[100m",
65434
+ "bg-gray": "\x1B[100m",
65435
+ "bg-brightRed": "\x1B[101m",
65436
+ "bg-brightGreen": "\x1B[102m",
65437
+ "bg-brightYellow": "\x1B[103m",
65438
+ "bg-brightBlue": "\x1B[104m",
65439
+ "bg-brightMagenta": "\x1B[105m",
65440
+ "bg-brightCyan": "\x1B[106m",
65441
+ "bg-brightWhite": "\x1B[107m"
65442
+ };
65443
+ ansi.rgb = function(r, g2, b) {
65444
+ return `\x1B[38;2;${r};${g2};${b}m`;
65445
+ };
65446
+ ansi.bgRgb = function(r, g2, b) {
65447
+ return `\x1B[48;2;${r};${g2};${b}m`;
65448
+ };
65449
+ ansi.styles = function(styles2) {
65450
+ styles2 = arrayify(styles2);
65451
+ return styles2.map(function(effect) {
65452
+ const rgbMatches = effect.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
65453
+ const bgRgbMatches = effect.match(/bg-rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
65454
+ if (bgRgbMatches) {
65455
+ const [full, r, g2, b] = bgRgbMatches;
65456
+ return ansi.bgRgb(r, g2, b);
65457
+ } else if (rgbMatches) {
65458
+ const [full, r, g2, b] = rgbMatches;
65459
+ return ansi.rgb(r, g2, b);
65460
+ } else {
65461
+ return ansi.style[effect];
65462
+ }
65463
+ }).join("");
65464
+ };
65465
+ ansi.format = function(str, styleArray) {
65466
+ const re2 = /\[([\w\s-\(\),]+)\]{([^]*?)}/;
65467
+ let matches;
65468
+ str = String(str);
65469
+ if (!str) return "";
65470
+ while (matches = str.match(re2)) {
65471
+ const inlineStyles = matches[1].split(/\s+/);
65472
+ const inlineString = matches[2];
65473
+ str = str.replace(matches[0], ansi.format(inlineString, inlineStyles));
65474
+ }
65475
+ return styleArray && styleArray.length ? ansi.styles(styleArray) + str + ansi.style.reset : str;
65476
+ };
65477
+ ansi.cursor = {
65478
+ /**
65479
+ * Moves the cursor `lines` cells up. If the cursor is already at the edge of the screen, this has no effect
65480
+ * @param [lines=1] {number}
65481
+ * @return {string}
65482
+ */
65483
+ up: /* @__PURE__ */ __name(function(lines) {
65484
+ return csi + (lines || 1) + "A";
65485
+ }, "up"),
65486
+ /**
65487
+ * Moves the cursor `lines` cells down. If the cursor is already at the edge of the screen, this has no effect
65488
+ * @param [lines=1] {number}
65489
+ * @return {string}
65490
+ */
65491
+ down: /* @__PURE__ */ __name(function(lines) {
65492
+ return csi + (lines || 1) + "B";
65493
+ }, "down"),
65494
+ /**
65495
+ * Moves the cursor `lines` cells forward. If the cursor is already at the edge of the screen, this has no effect
65496
+ * @param [lines=1] {number}
65497
+ * @return {string}
65498
+ */
65499
+ forward: /* @__PURE__ */ __name(function(lines) {
65500
+ return csi + (lines || 1) + "C";
65501
+ }, "forward"),
65502
+ /**
65503
+ * Moves the cursor `lines` cells back. If the cursor is already at the edge of the screen, this has no effect
65504
+ * @param [lines=1] {number}
65505
+ * @return {string}
65506
+ */
65507
+ back: /* @__PURE__ */ __name(function(lines) {
65508
+ return csi + (lines || 1) + "D";
65509
+ }, "back"),
65510
+ /**
65511
+ * Moves cursor to beginning of the line n lines down.
65512
+ * @param [lines=1] {number}
65513
+ * @return {string}
65514
+ */
65515
+ nextLine: /* @__PURE__ */ __name(function(lines) {
65516
+ return csi + (lines || 1) + "E";
65517
+ }, "nextLine"),
65518
+ /**
65519
+ * Moves cursor to beginning of the line n lines up.
65520
+ * @param [lines=1] {number}
65521
+ * @return {string}
65522
+ */
65523
+ previousLine: /* @__PURE__ */ __name(function(lines) {
65524
+ return csi + (lines || 1) + "F";
65525
+ }, "previousLine"),
65526
+ /**
65527
+ * Moves the cursor to column n.
65528
+ * @param n {number} - column number
65529
+ * @return {string}
65530
+ */
65531
+ horizontalAbsolute: /* @__PURE__ */ __name(function(n) {
65532
+ return csi + n + "G";
65533
+ }, "horizontalAbsolute"),
65534
+ /**
65535
+ * Moves the cursor to row n, column m. The values are 1-based, and default to 1 (top left corner) if omitted.
65536
+ * @param n {number} - row number
65537
+ * @param m {number} - column number
65538
+ * @return {string}
65539
+ */
65540
+ position: /* @__PURE__ */ __name(function(n, m) {
65541
+ return csi + (n || 1) + ";" + (m || 1) + "H";
65542
+ }, "position"),
65543
+ /**
65544
+ * Hides the cursor
65545
+ */
65546
+ hide: csi + "?25l",
65547
+ /**
65548
+ * Shows the cursor
65549
+ */
65550
+ show: csi + "?25h"
65551
+ };
65552
+ ansi.erase = {
65553
+ /**
65554
+ * Clears part of the screen. If n is 0 (or missing), clear from cursor to end of screen. If n is 1, clear from cursor to beginning of the screen. If n is 2, clear entire screen.
65555
+ * @param n {number}
65556
+ * @return {string}
65557
+ */
65558
+ display: /* @__PURE__ */ __name(function(n) {
65559
+ return csi + (n || 0) + "J";
65560
+ }, "display"),
65561
+ /**
65562
+ * Erases part of the line. If n is zero (or missing), clear from cursor to the end of the line. If n is one, clear from cursor to beginning of the line. If n is two, clear entire line. Cursor position does not change.
65563
+ * @param n {number}
65564
+ * @return {string}
65565
+ */
65566
+ inLine: /* @__PURE__ */ __name(function(n) {
65567
+ return csi + (n || 0) + "K";
65568
+ }, "inLine")
65569
+ };
65570
+ function createCommand$2(kernel, shell, terminal) {
65571
+ return new TerminalCommand({
65572
+ command: "less",
65573
+ description: "View file contents interactively",
65574
+ kernel,
65575
+ shell,
65576
+ terminal,
65577
+ options: [
65578
+ { name: "help", type: Boolean, description: kernel.i18n.t("Display help") },
65579
+ { name: "path", type: String, typeLabel: "{underline path}", defaultOption: true, description: "The path to the file to view" }
65580
+ ],
65581
+ run: /* @__PURE__ */ __name(async (argv, process2) => {
65582
+ if (!process2) return 1;
65583
+ let lines = [];
65584
+ let currentLine = 0;
65585
+ let keyListener = null;
65586
+ let linesRendered = 0;
65587
+ try {
65588
+ if (argv.path) {
65589
+ const filePath = argv.path;
65590
+ const expandedPath = shell.expandTilde(filePath);
65591
+ const fullPath = path$1.resolve(shell.cwd, expandedPath);
65592
+ const exists2 = await shell.context.fs.promises.exists(fullPath);
65593
+ if (!exists2) {
65594
+ await writelnStderr(process2, terminal, `less: ${filePath}: No such file or directory`);
65595
+ return 1;
65596
+ }
65597
+ const stats = await shell.context.fs.promises.stat(fullPath);
65598
+ if (stats.isDirectory()) {
65599
+ await writelnStderr(process2, terminal, `less: ${filePath}: Is a directory`);
65600
+ return 1;
65601
+ }
65602
+ const content = await shell.context.fs.promises.readFile(fullPath, "utf-8");
65603
+ lines = content.split("\n");
65604
+ } else {
65605
+ if (!process2.stdin) {
65606
+ await writelnStderr(process2, terminal, "less: No input provided");
65607
+ return 1;
65608
+ }
65609
+ const reader = process2.stdin.getReader();
65610
+ const decoder2 = new TextDecoder();
65611
+ const chunks = [];
65612
+ try {
65613
+ while (true) {
65614
+ const { done, value } = await reader.read();
65615
+ if (done) break;
65616
+ chunks.push(decoder2.decode(value, { stream: true }));
65617
+ }
65618
+ chunks.push(decoder2.decode(new Uint8Array(), { stream: false }));
65619
+ } finally {
65620
+ reader.releaseLock();
65621
+ }
65622
+ const content = chunks.join("");
65623
+ lines = content.split("\n");
65624
+ }
65625
+ if (lines.length === 0) {
65626
+ return 0;
65627
+ }
65628
+ terminal.unlisten();
65629
+ terminal.write("\n");
65630
+ terminal.write(ansi.cursor.hide);
65631
+ const rows = terminal.rows;
65632
+ const displayRows = rows - 1;
65633
+ const render = /* @__PURE__ */ __name(() => {
65634
+ const maxLine = Math.max(0, lines.length - displayRows);
65635
+ if (currentLine > maxLine) {
65636
+ currentLine = maxLine;
65637
+ }
65638
+ if (currentLine < 0) {
65639
+ currentLine = 0;
65640
+ }
65641
+ if (linesRendered > 0) {
65642
+ terminal.write(ansi.cursor.up(linesRendered));
65643
+ }
65644
+ const endLine = Math.min(currentLine + displayRows, lines.length);
65645
+ linesRendered = 0;
65646
+ for (let i = currentLine; i < endLine; i++) {
65647
+ terminal.write(ansi.erase.inLine(2));
65648
+ const line3 = lines[i] || "";
65649
+ terminal.write(line3);
65650
+ linesRendered++;
65651
+ if (i < endLine - 1) {
65652
+ terminal.write("\n");
65653
+ }
65654
+ }
65655
+ for (let i = endLine - currentLine; i < displayRows; i++) {
65656
+ terminal.write("\n");
65657
+ terminal.write(ansi.erase.inLine(2));
65658
+ linesRendered++;
65659
+ }
65660
+ const percentage = lines.length > 0 ? Math.round(endLine / lines.length * 100) : 100;
65661
+ const statusLine = `-- ${currentLine + 1}-${endLine} / ${lines.length} (${percentage}%)`;
65662
+ terminal.write("\n");
65663
+ terminal.write(ansi.erase.inLine(2));
65664
+ terminal.write(statusLine);
65665
+ linesRendered++;
65666
+ }, "render");
65667
+ render();
65668
+ await new Promise((resolve2) => {
65669
+ keyListener = terminal.onKey(async ({ domEvent }) => {
65670
+ const keyName = domEvent.key;
65671
+ switch (keyName) {
65672
+ case "q":
65673
+ case "Q":
65674
+ case "Escape":
65675
+ if (keyListener) {
65676
+ keyListener.dispose();
65677
+ keyListener = null;
65678
+ }
65679
+ terminal.write(ansi.cursor.show);
65680
+ terminal.write("\n");
65681
+ terminal.listen();
65682
+ resolve2();
65683
+ return;
65684
+ case "ArrowUp":
65685
+ if (currentLine > 0) {
65686
+ currentLine--;
65687
+ render();
65688
+ }
65689
+ break;
65690
+ case "ArrowDown":
65691
+ case "Enter":
65692
+ currentLine++;
65693
+ render();
65694
+ break;
65695
+ case "PageDown":
65696
+ case " ":
65697
+ currentLine = Math.min(currentLine + displayRows, Math.max(0, lines.length - displayRows));
65698
+ render();
65699
+ break;
65700
+ case "PageUp":
65701
+ case "b":
65702
+ case "B":
65703
+ currentLine = Math.max(0, currentLine - displayRows);
65704
+ render();
65705
+ break;
65706
+ case "Home":
65707
+ case "g":
65708
+ currentLine = 0;
65709
+ render();
65710
+ break;
65711
+ case "End":
65712
+ case "G":
65713
+ currentLine = Math.max(0, lines.length - displayRows);
65714
+ render();
65715
+ break;
65716
+ }
65717
+ });
65718
+ });
65719
+ return 0;
65720
+ } catch (error) {
65721
+ if (keyListener) {
65722
+ keyListener.dispose();
65723
+ }
65724
+ terminal.write(ansi.cursor.show);
65725
+ terminal.write("\n");
65726
+ terminal.listen();
65727
+ await writelnStderr(process2, terminal, `less: ${error instanceof Error ? error.message : "Unknown error"}`);
65728
+ return 1;
65729
+ }
65730
+ }, "run")
65731
+ });
65732
+ }
65733
+ __name(createCommand$2, "createCommand$2");
65734
+ function parseSedExpression(expr) {
65735
+ expr = expr.trim();
65736
+ const substituteMatch = expr.match(/^(\d+)?(,(\d+|\$))?s\/(.+?)\/(.*?)\/([gip]*\d*)$/);
65737
+ if (substituteMatch) {
65738
+ const [, startLine, , endLine, pattern2, replacement, flags] = substituteMatch;
65739
+ const address = startLine ? {
65740
+ type: endLine ? "range" : "line",
65741
+ start: parseInt(startLine, 10),
65742
+ ...endLine && { end: endLine === "$" ? Infinity : parseInt(endLine, 10) }
65743
+ } : void 0;
65744
+ return {
65745
+ type: "substitute",
65746
+ pattern: pattern2,
65747
+ replacement: replacement || "",
65748
+ flags: flags || "",
65749
+ address
65750
+ };
65751
+ }
65752
+ const simpleSubstituteMatch = expr.match(/^s\/(.+?)\/(.*?)\/([gip]*\d*)$/);
65753
+ if (simpleSubstituteMatch) {
65754
+ const [, pattern2, replacement, flags] = simpleSubstituteMatch;
65755
+ return {
65756
+ type: "substitute",
65757
+ pattern: pattern2,
65758
+ replacement: replacement || "",
65759
+ flags: flags || ""
65760
+ };
65761
+ }
65762
+ const deleteMatch = expr.match(/^(\d+)?(,(\d+|\$))?d$/);
65763
+ if (deleteMatch) {
65764
+ const [, startLine, , endLine] = deleteMatch;
65765
+ const address = startLine ? {
65766
+ type: endLine ? "range" : "line",
65767
+ start: parseInt(startLine, 10),
65768
+ ...endLine && { end: endLine === "$" ? Infinity : parseInt(endLine, 10) }
65769
+ } : void 0;
65770
+ return {
65771
+ type: "delete",
65772
+ address
65773
+ };
65774
+ }
65775
+ const patternDeleteMatch = expr.match(/^\/(.+?)\/d$/);
65776
+ if (patternDeleteMatch) {
65777
+ return {
65778
+ type: "delete",
65779
+ address: {
65780
+ type: "pattern",
65781
+ start: patternDeleteMatch[1]
65782
+ }
65783
+ };
65784
+ }
65785
+ const printMatch = expr.match(/^\/(.+?)\/p$/);
65786
+ if (printMatch) {
65787
+ return {
65788
+ type: "print",
65789
+ address: {
65790
+ type: "pattern",
65791
+ start: printMatch[1]
65792
+ }
65793
+ };
65794
+ }
65795
+ return null;
65796
+ }
65797
+ __name(parseSedExpression, "parseSedExpression");
65798
+ function applySedCommand(line3, lineNum, totalLines, command) {
65799
+ if (command.type === "substitute") {
65800
+ if (!command.pattern || command.replacement === void 0) {
65801
+ return { result: line3, shouldPrint: false };
65802
+ }
65803
+ let shouldApply = true;
65804
+ if (command.address) {
65805
+ switch (command.address.type) {
65806
+ case "line":
65807
+ shouldApply = lineNum === command.address.start;
65808
+ break;
65809
+ case "range":
65810
+ const end = command.address.end === Infinity ? totalLines : command.address.end;
65811
+ shouldApply = lineNum >= command.address.start && lineNum <= end;
65812
+ break;
65813
+ case "pattern":
65814
+ try {
65815
+ const regex = new RegExp(command.address.start);
65816
+ shouldApply = regex.test(line3);
65817
+ } catch {
65818
+ return { result: line3, shouldPrint: false };
65819
+ }
65820
+ break;
65821
+ }
65822
+ }
65823
+ if (!shouldApply) {
65824
+ return { result: line3, shouldPrint: false };
65825
+ }
65826
+ const flags = command.flags || "";
65827
+ const global2 = flags.includes("g");
65828
+ const caseInsensitive = flags.includes("i");
65829
+ const nthMatch = flags.match(/^\d+$/) ? parseInt(flags, 10) : null;
65830
+ try {
65831
+ let regexFlags = global2 ? "g" : "";
65832
+ if (caseInsensitive) regexFlags += "i";
65833
+ if (nthMatch) {
65834
+ let count = 0;
65835
+ const regex2 = new RegExp(command.pattern, caseInsensitive ? "gi" : "g");
65836
+ const result2 = line3.replace(regex2, (match) => {
65837
+ count++;
65838
+ if (count === nthMatch) {
65839
+ return command.replacement || match;
65840
+ }
65841
+ return match;
65842
+ });
65843
+ return { result: result2, shouldPrint: false };
65844
+ }
65845
+ const regex = new RegExp(command.pattern, regexFlags || void 0);
65846
+ const result = line3.replace(regex, command.replacement);
65847
+ return { result, shouldPrint: false };
65848
+ } catch {
65849
+ return { result: line3, shouldPrint: false };
65850
+ }
65851
+ }
65852
+ if (command.type === "delete") {
65853
+ if (command.address) {
65854
+ switch (command.address.type) {
65855
+ case "line":
65856
+ if (lineNum === command.address.start) {
65857
+ return { result: null, shouldPrint: false };
65858
+ }
65859
+ break;
65860
+ case "range":
65861
+ const end = command.address.end === Infinity ? totalLines : command.address.end;
65862
+ if (lineNum >= command.address.start && lineNum <= end) {
65863
+ return { result: null, shouldPrint: false };
65864
+ }
65865
+ break;
65866
+ case "pattern":
65867
+ try {
65868
+ const regex = new RegExp(command.address.start);
65869
+ if (regex.test(line3)) {
65870
+ return { result: null, shouldPrint: false };
65871
+ }
65872
+ } catch {
65873
+ return { result: line3, shouldPrint: false };
65874
+ }
65875
+ break;
65876
+ }
65877
+ }
65878
+ return { result: line3, shouldPrint: false };
65879
+ }
65880
+ if (command.type === "print") {
65881
+ if (command.address && command.address.type === "pattern") {
65882
+ try {
65883
+ const regex = new RegExp(command.address.start);
65884
+ if (regex.test(line3)) {
65885
+ return { result: line3, shouldPrint: true };
65886
+ }
65887
+ } catch {
65888
+ return { result: line3, shouldPrint: false };
65889
+ }
65890
+ }
65891
+ return { result: line3, shouldPrint: false };
65892
+ }
65893
+ return { result: line3, shouldPrint: false };
65894
+ }
65895
+ __name(applySedCommand, "applySedCommand");
65896
+ function createCommand$1(kernel, shell, terminal) {
65897
+ return new TerminalCommand({
65898
+ command: "sed",
65899
+ description: "Stream editor for filtering and transforming text",
65900
+ kernel,
65901
+ shell,
65902
+ terminal,
65903
+ options: [
65904
+ { name: "help", type: Boolean, description: kernel.i18n.t("Display help") },
65905
+ { name: "expression", type: String, alias: "e", multiple: true, description: "Add the script to the commands to be executed" },
65906
+ { name: "file", type: String, alias: "f", description: "Add the contents of script-file to the commands to be executed" },
65907
+ { name: "inplace", type: String, alias: "i", description: "Edit files in place (makes backup if extension supplied)" },
65908
+ { name: "quiet", type: Boolean, alias: "q", description: "Suppress normal output" },
65909
+ { name: "path", type: String, typeLabel: "{underline path}", defaultOption: true, multiple: true, description: "Expression or input file(s)" }
65910
+ ],
65911
+ run: /* @__PURE__ */ __name(async (argv, process2) => {
65912
+ if (!process2) return 1;
65913
+ let expressions = argv.expression || [];
65914
+ let files = argv.path || [];
65915
+ const inplace = argv.inplace;
65916
+ const quiet = argv.quiet || false;
65917
+ const isSedExpression = /* @__PURE__ */ __name((arg) => {
65918
+ if (!arg) return false;
65919
+ const trimmed = arg.trim();
65920
+ return trimmed.startsWith("s/") || trimmed.startsWith("/") || /^\d+[sd]/.test(trimmed) || /^\d+,\d*[sd]/.test(trimmed) || /^\d+s\//.test(trimmed) || /^\d+,\d*s\//.test(trimmed);
65921
+ }, "isSedExpression");
65922
+ const potentialExpressions = [];
65923
+ const potentialFiles = [];
65924
+ for (const arg of files) {
65925
+ if (isSedExpression(arg)) {
65926
+ potentialExpressions.push(arg);
65927
+ } else {
65928
+ potentialFiles.push(arg);
65929
+ }
65930
+ }
65931
+ if (potentialExpressions.length > 0) {
65932
+ expressions = [...expressions, ...potentialExpressions];
65933
+ files = potentialFiles;
65934
+ }
65935
+ if (expressions.length === 0 && !argv.file) {
65936
+ await writelnStderr(process2, terminal, "sed: No expression provided");
65937
+ return 1;
65938
+ }
65939
+ const commands = [];
65940
+ if (argv.file) {
65941
+ const scriptPath = path$1.resolve(shell.cwd, argv.file);
65942
+ const exists2 = await shell.context.fs.promises.exists(scriptPath);
65943
+ if (!exists2) {
65944
+ await writelnStderr(process2, terminal, `sed: ${argv.file}: No such file or directory`);
65945
+ return 1;
65946
+ }
65947
+ const scriptContent = await shell.context.fs.promises.readFile(scriptPath, "utf-8");
65948
+ const scriptLines = scriptContent.split("\n").filter((line3) => line3.trim() && !line3.trim().startsWith("#"));
65949
+ for (const line3 of scriptLines) {
65950
+ const cmd = parseSedExpression(line3.trim());
65951
+ if (cmd) commands.push(cmd);
65952
+ }
65953
+ }
65954
+ for (const expr of expressions) {
65955
+ const cmd = parseSedExpression(expr);
65956
+ if (cmd) {
65957
+ commands.push(cmd);
65958
+ } else {
65959
+ await writelnStderr(process2, terminal, `sed: Invalid expression: ${expr}`);
65960
+ return 1;
65961
+ }
65962
+ }
65963
+ if (commands.length === 0) {
65964
+ await writelnStderr(process2, terminal, "sed: No valid commands found");
65965
+ return 1;
65966
+ }
65967
+ const writer = process2.stdout.getWriter();
65968
+ try {
65969
+ const processFile = /* @__PURE__ */ __name(async (filePath) => {
65970
+ const exists2 = await shell.context.fs.promises.exists(filePath);
65971
+ if (!exists2) {
65972
+ await writelnStderr(process2, terminal, `sed: ${filePath}: No such file or directory`);
65973
+ return [];
65974
+ }
65975
+ const stats = await shell.context.fs.promises.stat(filePath);
65976
+ if (stats.isDirectory()) {
65977
+ await writelnStderr(process2, terminal, `sed: ${filePath}: Is a directory`);
65978
+ return [];
65979
+ }
65980
+ const content = await shell.context.fs.promises.readFile(filePath, "utf-8");
65981
+ return content.split("\n");
65982
+ }, "processFile");
65983
+ let inputLines = [];
65984
+ if (files.length > 0) {
65985
+ for (const file of files) {
65986
+ const expandedPath = shell.expandTilde(file);
65987
+ const fullPath = path$1.resolve(shell.cwd, expandedPath);
65988
+ const lines = await processFile(fullPath);
65989
+ inputLines.push(...lines);
65990
+ if (lines.length > 0 && inputLines.length > lines.length) {
65991
+ inputLines.push("");
65992
+ }
65993
+ }
65994
+ } else {
65995
+ if (!process2.stdin) {
65996
+ await writelnStderr(process2, terminal, "sed: No input provided");
65997
+ return 1;
65998
+ }
65999
+ const reader = process2.stdin.getReader();
66000
+ const decoder2 = new TextDecoder();
66001
+ const chunks = [];
66002
+ try {
66003
+ while (true) {
66004
+ const { done, value } = await reader.read();
66005
+ if (done) break;
66006
+ chunks.push(decoder2.decode(value, { stream: true }));
66007
+ }
66008
+ chunks.push(decoder2.decode(new Uint8Array(), { stream: false }));
66009
+ } finally {
66010
+ reader.releaseLock();
66011
+ }
66012
+ const content = chunks.join("");
66013
+ inputLines = content.split("\n");
66014
+ }
66015
+ const outputLines = [];
66016
+ const totalLines = inputLines.length;
66017
+ for (let i = 0; i < inputLines.length; i++) {
66018
+ let line3 = inputLines[i] || "";
66019
+ let lineNum = i + 1;
66020
+ let shouldPrint = false;
66021
+ for (const command of commands) {
66022
+ const { result, shouldPrint: print } = applySedCommand(line3, lineNum, totalLines, command);
66023
+ if (result === null) {
66024
+ line3 = null;
66025
+ break;
66026
+ }
66027
+ line3 = result;
66028
+ if (print) {
66029
+ shouldPrint = true;
66030
+ }
66031
+ }
66032
+ if (line3 !== null) {
66033
+ outputLines.push(line3);
66034
+ if (shouldPrint && !quiet) {
66035
+ outputLines.push(line3);
66036
+ }
66037
+ }
66038
+ }
66039
+ const output2 = outputLines.join("\n");
66040
+ if (inplace !== void 0 && files.length > 0) {
66041
+ for (const file of files) {
66042
+ const expandedPath = shell.expandTilde(file);
66043
+ const fullPath = path$1.resolve(shell.cwd, expandedPath);
66044
+ const fileLines = await processFile(fullPath);
66045
+ if (fileLines.length === 0) continue;
66046
+ const fileOutputLines = [];
66047
+ const fileTotalLines = fileLines.length;
66048
+ for (let i = 0; i < fileLines.length; i++) {
66049
+ let line3 = fileLines[i] || "";
66050
+ let lineNum = i + 1;
66051
+ let shouldPrint = false;
66052
+ for (const command of commands) {
66053
+ const { result, shouldPrint: print } = applySedCommand(line3, lineNum, fileTotalLines, command);
66054
+ if (result === null) {
66055
+ line3 = null;
66056
+ break;
66057
+ }
66058
+ line3 = result;
66059
+ if (print) {
66060
+ shouldPrint = true;
66061
+ }
66062
+ }
66063
+ if (line3 !== null) {
66064
+ fileOutputLines.push(line3);
66065
+ if (shouldPrint && !quiet) {
66066
+ fileOutputLines.push(line3);
66067
+ }
66068
+ }
66069
+ }
66070
+ const fileOutput = fileOutputLines.join("\n");
66071
+ if (inplace) {
66072
+ const backupPath = `${fullPath}${inplace}`;
66073
+ const originalContent = await shell.context.fs.promises.readFile(fullPath, "utf-8");
66074
+ await shell.context.fs.promises.writeFile(backupPath, originalContent);
66075
+ }
66076
+ await shell.context.fs.promises.writeFile(fullPath, fileOutput);
66077
+ }
66078
+ } else {
66079
+ await writer.write(new TextEncoder().encode(output2));
66080
+ }
66081
+ return 0;
66082
+ } catch (error) {
66083
+ await writelnStderr(process2, terminal, `sed: ${error instanceof Error ? error.message : "Unknown error"}`);
66084
+ return 1;
66085
+ } finally {
66086
+ writer.releaseLock();
66087
+ }
66088
+ }, "run")
66089
+ });
66090
+ }
66091
+ __name(createCommand$1, "createCommand$1");
66092
+ function createCommand(kernel, shell, terminal) {
66093
+ return new TerminalCommand({
66094
+ command: "tee",
66095
+ description: "Read from standard input and write to standard output and files",
66096
+ kernel,
66097
+ shell,
66098
+ terminal,
66099
+ options: [
66100
+ { name: "help", type: Boolean, description: kernel.i18n.t("Display help") },
66101
+ { name: "append", type: Boolean, alias: "a", description: "Append to the given files, do not overwrite" },
66102
+ { name: "ignore-interrupts", type: Boolean, alias: "i", description: "Ignore interrupt signals" },
66103
+ { name: "path", type: String, typeLabel: "{underline path}", defaultOption: true, multiple: true, description: "File(s) to write to" }
66104
+ ],
66105
+ run: /* @__PURE__ */ __name(async (argv, process2) => {
66106
+ if (!process2) return 1;
66107
+ if (!process2.stdin) {
66108
+ await writelnStderr(process2, terminal, "tee: No input provided");
66109
+ return 1;
66110
+ }
66111
+ const files = argv.path || [];
66112
+ const append2 = argv.append || false;
66113
+ const ignoreInterrupts = argv["ignore-interrupts"] || false;
66114
+ const writer = process2.stdout.getWriter();
66115
+ try {
66116
+ const filePaths = [];
66117
+ for (const file of files) {
66118
+ const expandedPath = shell.expandTilde(file);
66119
+ const fullPath = path$1.resolve(shell.cwd, expandedPath);
66120
+ if (!append2) {
66121
+ try {
66122
+ await shell.context.fs.promises.writeFile(fullPath, "");
66123
+ } catch (error) {
66124
+ await writelnStderr(process2, terminal, `tee: ${file}: ${error instanceof Error ? error.message : "Unknown error"}`);
66125
+ return 1;
66126
+ }
66127
+ }
66128
+ filePaths.push({ path: file, fullPath });
66129
+ }
66130
+ const reader = process2.stdin.getReader();
66131
+ let interrupted = false;
66132
+ const interruptHandler = /* @__PURE__ */ __name(() => {
66133
+ interrupted = true;
66134
+ }, "interruptHandler");
66135
+ if (!ignoreInterrupts) {
66136
+ kernel.terminal.events.on(TerminalEvents.INTERRUPT, interruptHandler);
66137
+ }
66138
+ try {
66139
+ while (true) {
66140
+ if (interrupted) break;
66141
+ const { done, value } = await reader.read();
66142
+ if (done) break;
66143
+ await writer.write(value);
66144
+ for (const fileInfo of filePaths) {
66145
+ try {
66146
+ await shell.context.fs.promises.appendFile(fileInfo.fullPath, value);
66147
+ } catch (error) {
66148
+ await writelnStderr(process2, terminal, `tee: ${fileInfo.path}: ${error instanceof Error ? error.message : "Write error"}`);
66149
+ }
66150
+ }
66151
+ }
66152
+ } finally {
66153
+ reader.releaseLock();
66154
+ if (!ignoreInterrupts) {
66155
+ kernel.terminal.events.off(TerminalEvents.INTERRUPT, interruptHandler);
66156
+ }
66157
+ }
66158
+ return 0;
66159
+ } catch (error) {
66160
+ await writelnStderr(process2, terminal, `tee: ${error instanceof Error ? error.message : "Unknown error"}`);
66161
+ return 1;
66162
+ } finally {
66163
+ writer.releaseLock();
66164
+ }
66165
+ }, "run")
66166
+ });
66167
+ }
65180
66168
  __name(createCommand, "createCommand");
65181
66169
  function createAllCommands(kernel, shell, terminal) {
65182
66170
  return {
65183
- cat: createCommand$c(kernel, shell, terminal),
65184
- cd: createCommand$b(kernel, shell, terminal),
65185
- chmod: createCommand$a(kernel, shell, terminal),
65186
- cp: createCommand$9(kernel, shell, terminal),
65187
- echo: createCommand$8(kernel, shell, terminal),
65188
- ls: createCommand$7(kernel, shell, terminal),
65189
- mkdir: createCommand$6(kernel, shell, terminal),
65190
- mv: createCommand$5(kernel, shell, terminal),
65191
- pwd: createCommand$4(kernel, shell, terminal),
65192
- rm: createCommand$3(kernel, shell, terminal),
65193
- rmdir: createCommand$2(kernel, shell, terminal),
65194
- stat: createCommand$1(kernel, shell, terminal),
65195
- touch: createCommand(kernel, shell, terminal)
66171
+ cat: createCommand$h(kernel, shell, terminal),
66172
+ cd: createCommand$g(kernel, shell, terminal),
66173
+ chmod: createCommand$f(kernel, shell, terminal),
66174
+ cp: createCommand$e(kernel, shell, terminal),
66175
+ echo: createCommand$d(kernel, shell, terminal),
66176
+ ln: createCommand$c(kernel, shell, terminal),
66177
+ ls: createCommand$b(kernel, shell, terminal),
66178
+ mkdir: createCommand$a(kernel, shell, terminal),
66179
+ mv: createCommand$9(kernel, shell, terminal),
66180
+ pwd: createCommand$8(kernel, shell, terminal),
66181
+ rm: createCommand$7(kernel, shell, terminal),
66182
+ rmdir: createCommand$6(kernel, shell, terminal),
66183
+ stat: createCommand$5(kernel, shell, terminal),
66184
+ touch: createCommand$4(kernel, shell, terminal),
66185
+ hex: createCommand$3(kernel, shell, terminal),
66186
+ less: createCommand$2(kernel, shell, terminal),
66187
+ sed: createCommand$1(kernel, shell, terminal),
66188
+ tee: createCommand(kernel, shell, terminal)
65196
66189
  };
65197
66190
  }
65198
66191
  __name(createAllCommands, "createAllCommands");
@@ -65251,20 +66244,6 @@ const TerminalCommands = /* @__PURE__ */ __name((kernel, shell, terminal) => {
65251
66244
  return await download({ shell, terminal, process: process2, args: argv.path });
65252
66245
  }, "run")
65253
66246
  }),
65254
- edit: new TerminalCommand({
65255
- command: "edit",
65256
- description: "Edit a file",
65257
- kernel,
65258
- shell,
65259
- terminal,
65260
- options: [
65261
- HelpOption,
65262
- { name: "path", type: String, typeLabel: "{underline path}", defaultOption: true, description: "The path to the file to edit" }
65263
- ],
65264
- run: /* @__PURE__ */ __name(async (argv) => {
65265
- return await edit({ shell, terminal, args: [argv.path] });
65266
- }, "run")
65267
- }),
65268
66247
  env: new TerminalCommand({
65269
66248
  command: "env",
65270
66249
  description: "Print or set an environment variable",
@@ -65310,7 +66289,7 @@ const TerminalCommands = /* @__PURE__ */ __name((kernel, shell, terminal) => {
65310
66289
  { name: "reinstall", type: Boolean, description: "Reinstall the package if it is already installed" }
65311
66290
  ],
65312
66291
  run: /* @__PURE__ */ __name(async (argv) => {
65313
- const { default: install } = await import("./install-U3zlzitO.js");
66292
+ const { default: install } = await import("./install-DIY-HQ9n.js");
65314
66293
  return await install({ kernel, shell, terminal, args: [argv.package, argv.registry, argv.reinstall] });
65315
66294
  }, "run")
65316
66295
  }),
@@ -65325,7 +66304,7 @@ const TerminalCommands = /* @__PURE__ */ __name((kernel, shell, terminal) => {
65325
66304
  { name: "package", type: String, typeLabel: "{underline package}", defaultOption: true, description: "The package name and optional version (e.g. package@1.0.0). If no version is specified, all versions will be uninstalled." }
65326
66305
  ],
65327
66306
  run: /* @__PURE__ */ __name(async (argv) => {
65328
- const { default: uninstall } = await import("./uninstall-CCbsu8HM.js");
66307
+ const { default: uninstall } = await import("./uninstall-BOyXf2bF.js");
65329
66308
  return await uninstall({ kernel, shell, terminal, args: [argv.package] });
65330
66309
  }, "run")
65331
66310
  }),
@@ -65644,270 +66623,6 @@ const download = /* @__PURE__ */ __name(async ({ shell, terminal, process: proce
65644
66623
  await writelnStderr(process2, terminal, chalk$2.red(`${fullPath} not found`));
65645
66624
  }
65646
66625
  }, "download");
65647
- const edit = /* @__PURE__ */ __name(async ({ shell, terminal, args }) => {
65648
- const target = args[0];
65649
- if (!target) return 1;
65650
- const fullPath = path$1.resolve(shell.cwd, target);
65651
- const content = await shell.context.fs.promises.readFile(fullPath, "utf-8").catch(() => "");
65652
- const lines = content.split("\n");
65653
- let cursorX = 0;
65654
- let cursorY = 0;
65655
- let message;
65656
- let mode2 = "normal";
65657
- let startLine = 0;
65658
- const renderScreen = /* @__PURE__ */ __name(() => {
65659
- terminal.write(ansi$6.erase.display(2) + ansi$6.cursor.position(0, 0));
65660
- const visibleLines = lines.slice(startLine, startLine + terminal.rows - 1);
65661
- visibleLines.forEach((line3) => terminal.writeln(line3));
65662
- let modeColor = chalk$2.gray;
65663
- switch (mode2) {
65664
- case "insert":
65665
- modeColor = chalk$2.green;
65666
- break;
65667
- case "replace":
65668
- modeColor = chalk$2.red;
65669
- break;
65670
- }
65671
- if (!message) terminal.write(modeColor(`-- ${mode2.toUpperCase()} MODE (${cursorY + 1}, ${cursorX + 1}) = ${lines[cursorY]?.[cursorX] ?? ""} --`));
65672
- else terminal.write(`--- ${message} ---`);
65673
- if (message) message = void 0;
65674
- terminal.write(`\x1B[${cursorY - startLine + 1};${cursorX + 1}H`);
65675
- }, "renderScreen");
65676
- const handleNormalMode = /* @__PURE__ */ __name(async (event) => {
65677
- switch (event.key) {
65678
- case "Insert":
65679
- case "i":
65680
- mode2 = "insert";
65681
- break;
65682
- case "r":
65683
- mode2 = "replace";
65684
- break;
65685
- case "ArrowLeft":
65686
- case "h":
65687
- cursorX = Math.max(0, cursorX - 1);
65688
- break;
65689
- case "ArrowDown":
65690
- case "j":
65691
- if (cursorY < lines.length - 1) {
65692
- cursorY++;
65693
- if (cursorY >= startLine + terminal.rows - 1) startLine++;
65694
- }
65695
- break;
65696
- case "ArrowUp":
65697
- case "k":
65698
- if (cursorY > 0) {
65699
- cursorY--;
65700
- if (cursorY < startLine) {
65701
- startLine--;
65702
- }
65703
- }
65704
- break;
65705
- case "ArrowRight":
65706
- case "l":
65707
- cursorX = lines[cursorY]?.length === 0 ? 0 : Math.min((lines[cursorY]?.length ?? 1) - 1, cursorX + 1);
65708
- break;
65709
- case "Home":
65710
- cursorX = 0;
65711
- break;
65712
- case "End":
65713
- cursorX = (lines[cursorY]?.length ?? 0) - 1;
65714
- break;
65715
- case "PageUp":
65716
- if (cursorY > 0) {
65717
- const pageSize = terminal.rows - 2;
65718
- cursorY = Math.max(0, cursorY - pageSize);
65719
- startLine = Math.max(0, startLine - pageSize);
65720
- if (cursorY < startLine) {
65721
- startLine = cursorY;
65722
- }
65723
- }
65724
- break;
65725
- case "PageDown":
65726
- if (cursorY < lines.length - 1) {
65727
- const pageSize = terminal.rows - 2;
65728
- cursorY = Math.min(lines.length - 1, cursorY + pageSize);
65729
- startLine = Math.min(lines.length - pageSize, startLine + pageSize);
65730
- if (cursorY >= startLine + pageSize) {
65731
- startLine = cursorY - pageSize + 1;
65732
- }
65733
- }
65734
- break;
65735
- case "Delete":
65736
- case "d":
65737
- if (cursorX < (lines[cursorY]?.length ?? 0)) {
65738
- lines[cursorY] = (lines[cursorY]?.slice(0, cursorX) ?? "") + (lines[cursorY]?.slice(cursorX + 1) ?? "");
65739
- } else if (cursorY < lines.length - 1) {
65740
- lines[cursorY] += lines[cursorY + 1] ?? "";
65741
- lines.splice(cursorY + 1, 1);
65742
- }
65743
- break;
65744
- case ":":
65745
- terminal.write(ansi$6.cursor.position(terminal.rows, 0) + ansi$6.erase.inLine());
65746
- const cmdLine = await terminal.readline(":", false, true);
65747
- const lineNum = parseInt(cmdLine);
65748
- if (!isNaN(lineNum)) {
65749
- const targetLine = Math.max(0, Math.min(lines.length - 1, lineNum - 1));
65750
- if (targetLine < startLine || targetLine >= startLine + terminal.rows - 1)
65751
- startLine = Math.max(0, Math.min(lines.length - terminal.rows + 1, targetLine - Math.floor((terminal.rows - 1) / 2)));
65752
- cursorY = targetLine;
65753
- } else for (const command of cmdLine.split("")) {
65754
- switch (command) {
65755
- case "w":
65756
- message = chalk$2.green(`Saved to ${fullPath}`);
65757
- await shell.context.fs.promises.writeFile(fullPath, lines.join("\n"));
65758
- break;
65759
- case "q":
65760
- return true;
65761
- }
65762
- }
65763
- break;
65764
- case "v":
65765
- if (!event.ctrlKey) break;
65766
- try {
65767
- const clipboardText = await navigator.clipboard.readText();
65768
- const clipboardLines = clipboardText.split("\n");
65769
- lines.splice(cursorY, 0, ...clipboardLines);
65770
- message = chalk$2.green("Pasted text");
65771
- } catch (err2) {
65772
- message = chalk$2.red("Failed to paste: " + (err2 instanceof Error ? err2.message : "Unknown error"));
65773
- }
65774
- break;
65775
- }
65776
- return false;
65777
- }, "handleNormalMode");
65778
- const handleEditMode = /* @__PURE__ */ __name((event, replace = false) => {
65779
- switch (event.key) {
65780
- case "Insert":
65781
- mode2 = replace ? "insert" : "replace";
65782
- break;
65783
- case "Escape":
65784
- mode2 = "normal";
65785
- break;
65786
- case "Home":
65787
- cursorX = 0;
65788
- break;
65789
- case "End":
65790
- cursorX = lines[cursorY]?.length ?? 0;
65791
- break;
65792
- case "PageUp":
65793
- if (cursorY > 0) {
65794
- const pageSize = terminal.rows - 2;
65795
- cursorY = Math.max(0, cursorY - pageSize);
65796
- startLine = Math.max(0, startLine - pageSize);
65797
- if (cursorY < startLine) {
65798
- startLine = cursorY;
65799
- }
65800
- }
65801
- break;
65802
- case "PageDown":
65803
- if (cursorY < lines.length - 1) {
65804
- const pageSize = terminal.rows - 2;
65805
- cursorY = Math.min(lines.length - 1, cursorY + pageSize);
65806
- startLine = Math.min(lines.length - pageSize, startLine + pageSize);
65807
- if (cursorY >= startLine + pageSize) {
65808
- startLine = cursorY - pageSize + 1;
65809
- }
65810
- }
65811
- break;
65812
- case "Enter":
65813
- lines.splice(cursorY + 1, 0, lines[cursorY]?.slice(cursorX) ?? "");
65814
- lines[cursorY] = lines[cursorY]?.slice(0, cursorX) ?? "";
65815
- cursorY++;
65816
- cursorX = 0;
65817
- break;
65818
- case "Backspace":
65819
- if (cursorX > 0) {
65820
- lines[cursorY] = (lines[cursorY]?.slice(0, cursorX - 1) ?? "") + (lines[cursorY]?.slice(cursorX) ?? "");
65821
- cursorX--;
65822
- } else if (cursorY > 0) {
65823
- cursorX = (lines[cursorY - 1]?.length ?? 0) - 1;
65824
- lines[cursorY - 1] += lines[cursorY] ?? "";
65825
- lines.splice(cursorY, 1);
65826
- cursorY--;
65827
- }
65828
- break;
65829
- case "Delete":
65830
- if (cursorX < (lines[cursorY]?.length ?? 0)) {
65831
- lines[cursorY] = (lines[cursorY]?.slice(0, cursorX) ?? "") + (lines[cursorY]?.slice(cursorX + 1) ?? "");
65832
- } else if (cursorY < lines.length - 1) {
65833
- lines[cursorY] += lines[cursorY + 1] ?? "";
65834
- lines.splice(cursorY + 1, 1);
65835
- }
65836
- break;
65837
- case "ArrowLeft":
65838
- cursorX = Math.max(0, cursorX - 1);
65839
- break;
65840
- case "ArrowUp":
65841
- if (cursorY > 0) {
65842
- cursorY--;
65843
- cursorX = Math.min(lines[cursorY]?.length ?? 0, cursorX);
65844
- }
65845
- break;
65846
- case "ArrowDown":
65847
- if (cursorY < lines.length - 1) {
65848
- cursorY++;
65849
- cursorX = Math.min(lines[cursorY]?.length ?? 0, cursorX);
65850
- }
65851
- break;
65852
- case "ArrowRight":
65853
- cursorX = Math.min(lines[cursorY]?.length ?? 0, cursorX + 1);
65854
- break;
65855
- case "v":
65856
- if (event.ctrlKey || event.metaKey) {
65857
- navigator.clipboard.readText().then((clipboardText) => {
65858
- const clipboardLines = clipboardText.split("\n");
65859
- if (replace) {
65860
- lines.splice(cursorY, clipboardLines.length, ...clipboardLines);
65861
- } else {
65862
- const currentLine = lines[cursorY] ?? "";
65863
- const beforeCursor = currentLine.slice(0, cursorX);
65864
- const afterCursor = currentLine.slice(cursorX);
65865
- lines[cursorY] = beforeCursor + clipboardLines[0];
65866
- if (clipboardLines.length > 1) {
65867
- const remainingLines = clipboardLines.slice(1);
65868
- remainingLines[remainingLines.length - 1] += afterCursor;
65869
- lines.splice(cursorY + 1, 0, ...remainingLines);
65870
- } else {
65871
- lines[cursorY] += afterCursor;
65872
- }
65873
- cursorY += clipboardLines.length - 1;
65874
- cursorX = clipboardLines[clipboardLines.length - 1]?.length ?? 0;
65875
- }
65876
- }).catch((err2) => {
65877
- message = chalk$2.red("Failed to paste: " + err2.message);
65878
- });
65879
- } else {
65880
- if (replace) lines[cursorY] = (lines[cursorY]?.slice(0, cursorX) ?? "") + event.key + (lines[cursorY]?.slice(cursorX + 1) ?? "");
65881
- else lines[cursorY] = (lines[cursorY]?.slice(0, cursorX) ?? "") + event.key + (lines[cursorY]?.slice(cursorX) ?? "");
65882
- cursorX++;
65883
- }
65884
- break;
65885
- default:
65886
- if (replace) lines[cursorY] = (lines[cursorY]?.slice(0, cursorX) ?? "") + event.key + (lines[cursorY]?.slice(cursorX + 1) ?? "");
65887
- else lines[cursorY] = (lines[cursorY]?.slice(0, cursorX) ?? "") + event.key + (lines[cursorY]?.slice(cursorX) ?? "");
65888
- cursorX++;
65889
- }
65890
- }, "handleEditMode");
65891
- let active = true;
65892
- terminal.unlisten();
65893
- while (active) {
65894
- renderScreen();
65895
- const { domEvent } = await new Promise((resolve2) => terminal.onKey(resolve2));
65896
- switch (mode2) {
65897
- case "normal":
65898
- if (await handleNormalMode(domEvent)) active = false;
65899
- break;
65900
- case "insert":
65901
- handleEditMode(domEvent);
65902
- break;
65903
- case "replace":
65904
- handleEditMode(domEvent, true);
65905
- break;
65906
- }
65907
- }
65908
- terminal.write(ansi$6.erase.display(2) + ansi$6.cursor.position());
65909
- terminal.listen();
65910
- }, "edit");
65911
66626
  const env = /* @__PURE__ */ __name(async ({ shell, terminal, process: process2, args }) => {
65912
66627
  const [variables, value] = args;
65913
66628
  if (!variables) {
@@ -66141,7 +66856,7 @@ const snake = /* @__PURE__ */ __name(({ kernel, terminal }) => {
66141
66856
  const gameBoard = Array(height).fill(null).map(() => Array(width).fill(" "));
66142
66857
  snake2.forEach((segment) => gameBoard[segment.y][segment.x] = segment.y === snake2[0].y && segment.x === snake2[0].x ? chalk$2.yellow("█") : chalk$2.gray("█"));
66143
66858
  gameBoard[food.y][food.x] = chalk$2.green("●");
66144
- terminal.write(ansi$6.erase.display(2) + ansi$6.cursor.position(2, 1));
66859
+ terminal.write(ansi$7.erase.display(2) + ansi$7.cursor.position(2, 1));
66145
66860
  terminal.writeln(chalk$2.blue("┌" + "─".repeat(width) + "┐"));
66146
66861
  gameBoard.forEach((row) => terminal.writeln(chalk$2.blue("│" + row.join("") + "│")));
66147
66862
  terminal.writeln(chalk$2.blue(`└${"─".repeat(width)}┘`));
@@ -66161,7 +66876,7 @@ const snake = /* @__PURE__ */ __name(({ kernel, terminal }) => {
66161
66876
  } else snake2.pop();
66162
66877
  return;
66163
66878
  }, "moveSnake");
66164
- terminal.write(ansi$6.cursor.hide);
66879
+ terminal.write(ansi$7.cursor.hide);
66165
66880
  terminal.unlisten();
66166
66881
  renderGame();
66167
66882
  const keyListener = terminal.onKey(({ domEvent }) => {
@@ -66201,7 +66916,7 @@ const snake = /* @__PURE__ */ __name(({ kernel, terminal }) => {
66201
66916
  terminal.listen();
66202
66917
  clearInterval(gameLoop);
66203
66918
  terminal.writeln("Game Over!");
66204
- terminal.write(ansi$6.cursor.show + terminal.prompt());
66919
+ terminal.write(ansi$7.cursor.show + terminal.prompt());
66205
66920
  return;
66206
66921
  }
66207
66922
  if (!gameStarted) return;
@@ -66603,7 +67318,7 @@ const _Terminal = class _Terminal extends xtermExports.Terminal {
66603
67318
  if (!options.kernel) throw new Error("Terminal requires a kernel");
66604
67319
  super({ ...DefaultTerminalOptions, ...options });
66605
67320
  __publicField(this, "_addons", /* @__PURE__ */ new Map());
66606
- __publicField(this, "_ansi", ansi$6);
67321
+ __publicField(this, "_ansi", ansi$7);
66607
67322
  __publicField(this, "_cmd", "");
66608
67323
  __publicField(this, "_commands");
66609
67324
  __publicField(this, "_cursorPosition", 0);
@@ -66842,18 +67557,18 @@ const _Terminal = class _Terminal extends xtermExports.Terminal {
66842
67557
  resolve2(input);
66843
67558
  break;
66844
67559
  case "ArrowLeft":
66845
- this.write(ansi$6.cursor.back());
67560
+ this.write(ansi$7.cursor.back());
66846
67561
  cursor--;
66847
67562
  break;
66848
67563
  case "ArrowRight":
66849
- this.write(ansi$6.cursor.forward());
67564
+ this.write(ansi$7.cursor.forward());
66850
67565
  cursor++;
66851
67566
  break;
66852
67567
  case "Home":
66853
- this.write(ansi$6.cursor.horizontalAbsolute(0));
67568
+ this.write(ansi$7.cursor.horizontalAbsolute(0));
66854
67569
  break;
66855
67570
  case "End":
66856
- this.write(ansi$6.cursor.horizontalAbsolute(input.length));
67571
+ this.write(ansi$7.cursor.horizontalAbsolute(input.length));
66857
67572
  break;
66858
67573
  case "Escape":
66859
67574
  disposable.dispose();
@@ -66862,7 +67577,7 @@ const _Terminal = class _Terminal extends xtermExports.Terminal {
66862
67577
  case "Backspace":
66863
67578
  if (cursor > 0) {
66864
67579
  input = input.slice(0, cursor - 1) + input.slice(cursor);
66865
- this.write(ansi$6.cursor.horizontalAbsolute(0) + ansi$6.erase.inLine(2) + ":" + input);
67580
+ this.write(ansi$7.cursor.horizontalAbsolute(0) + ansi$7.erase.inLine(2) + ":" + input);
66866
67581
  cursor--;
66867
67582
  } else this.write("\x07");
66868
67583
  break;
@@ -66870,10 +67585,13 @@ const _Terminal = class _Terminal extends xtermExports.Terminal {
66870
67585
  if (cursor < input.length) input = input.slice(0, cursor) + input.slice(cursor + 1);
66871
67586
  break;
66872
67587
  default:
66873
- if (domEvent.key.length === 1 && domEvent.key.match(/^[a-zA-Z0-9]$/)) {
66874
- input = input.slice(0, cursor) + domEvent.key + input.slice(cursor);
66875
- if (!hide) this.write(ansi$6.cursor.horizontalAbsolute(0) + ansi$6.erase.inLine(2) + prompt + input);
66876
- cursor++;
67588
+ if (domEvent.key.length === 1 && !domEvent.ctrlKey && !domEvent.metaKey && !domEvent.altKey) {
67589
+ const charCode = domEvent.key.charCodeAt(0);
67590
+ if (charCode >= 32 && charCode <= 126) {
67591
+ input = input.slice(0, cursor) + domEvent.key + input.slice(cursor);
67592
+ if (!hide) this.write(ansi$7.cursor.horizontalAbsolute(0) + ansi$7.erase.inLine(2) + prompt + input);
67593
+ cursor++;
67594
+ }
66877
67595
  }
66878
67596
  }
66879
67597
  if (cursor < 0) cursor = 0;
@@ -67040,7 +67758,7 @@ const _Terminal = class _Terminal extends xtermExports.Terminal {
67040
67758
  case "v":
67041
67759
  return this.paste();
67042
67760
  case "Escape":
67043
- return this.write(ansi$6.erase.display(2) + ansi$6.cursor.position() + this.prompt());
67761
+ return this.write(ansi$7.erase.display(2) + ansi$7.cursor.position() + this.prompt());
67044
67762
  }
67045
67763
  }
67046
67764
  switch (keyName) {
@@ -67082,7 +67800,7 @@ const _Terminal = class _Terminal extends xtermExports.Terminal {
67082
67800
  }
67083
67801
  this._cmd = "";
67084
67802
  this._cursorPosition = 0;
67085
- this.write(ansi$6.erase.inLine(2) + this.prompt());
67803
+ this.write(ansi$7.erase.inLine(2) + this.prompt());
67086
67804
  break;
67087
67805
  case "Backspace":
67088
67806
  if (this._cursorPosition > 0) {
@@ -67096,7 +67814,7 @@ const _Terminal = class _Terminal extends xtermExports.Terminal {
67096
67814
  case "Delete":
67097
67815
  if (this._cursorPosition < this._cmd.length) {
67098
67816
  this._cmd = this._cmd.slice(0, this._cursorPosition) + this._cmd.slice(this._cursorPosition + 1);
67099
- this.write(ansi$6.erase.inLine(2) + ansi$6.cursor.horizontalAbsolute(0));
67817
+ this.write(ansi$7.erase.inLine(2) + ansi$7.cursor.horizontalAbsolute(0));
67100
67818
  if (this._multiLineMode) {
67101
67819
  const parts = this._cmd.split("#");
67102
67820
  if (parts.length > 1) {
@@ -67175,11 +67893,11 @@ const _Terminal = class _Terminal extends xtermExports.Terminal {
67175
67893
  break;
67176
67894
  case "Home":
67177
67895
  this._cursorPosition = 0;
67178
- this.write(ansi$6.cursor.horizontalAbsolute(this.prompt().replace(/\x1b\[[0-9;]*[a-zA-Z]/g, "").length + 1));
67896
+ this.write(ansi$7.cursor.horizontalAbsolute(this.prompt().replace(/\x1b\[[0-9;]*[a-zA-Z]/g, "").length + 1));
67179
67897
  break;
67180
67898
  case "End":
67181
67899
  this._cursorPosition = this._cmd.length + 1;
67182
- this.write(ansi$6.cursor.horizontalAbsolute(this.prompt().replace(/\x1b\[[0-9;]*[a-zA-Z]/g, "").length + this._cmd.length + 1));
67900
+ this.write(ansi$7.cursor.horizontalAbsolute(this.prompt().replace(/\x1b\[[0-9;]*[a-zA-Z]/g, "").length + this._cmd.length + 1));
67183
67901
  break;
67184
67902
  case "Tab": {
67185
67903
  domEvent.preventDefault();
@@ -67190,14 +67908,15 @@ const _Terminal = class _Terminal extends xtermExports.Terminal {
67190
67908
  }
67191
67909
  const matches = await this.getCompletionMatches(this._lastTabCommand);
67192
67910
  if (this._cmd.endsWith("/")) {
67193
- const path2 = this._cmd.split(" ").slice(-1)[0];
67194
- if (!path2) break;
67195
- if (!await this._kernel.filesystem.fs.exists(path2)) break;
67911
+ const pathArg = this._cmd.split(" ").slice(-1)[0];
67912
+ if (!pathArg) break;
67913
+ const expandedPath = this._shell.expandTilde(pathArg);
67914
+ if (!await this._kernel.filesystem.fs.exists(expandedPath)) break;
67196
67915
  await this.write("\n");
67197
- await this._shell.execute(`ls ${path2}`);
67916
+ await this._shell.execute(`ls ${expandedPath}`);
67198
67917
  this.write(this.prompt() + this._cmd);
67199
67918
  } else if (matches.length > 0) {
67200
- this.write("\r" + ansi$6.erase.inLine());
67919
+ this.write("\r" + ansi$7.erase.inLine());
67201
67920
  this._tabCompletionIndex = (this._tabCompletionIndex + 1) % matches.length;
67202
67921
  const newCmd = matches[this._tabCompletionIndex] || "";
67203
67922
  this._cmd = newCmd;
@@ -67216,7 +67935,7 @@ const _Terminal = class _Terminal extends xtermExports.Terminal {
67216
67935
  if (key.length === 1) {
67217
67936
  this._cmd = this._cmd.slice(0, this._cursorPosition) + key + this._cmd.slice(this._cursorPosition);
67218
67937
  this._cursorPosition++;
67219
- this.write(ansi$6.erase.inLine(2) + ansi$6.cursor.horizontalAbsolute(0));
67938
+ this.write(ansi$7.erase.inLine(2) + ansi$7.cursor.horizontalAbsolute(0));
67220
67939
  if (this._multiLineMode) {
67221
67940
  const parts = this._cmd.split("#");
67222
67941
  if (parts.length > 1) {
@@ -67291,7 +68010,7 @@ const _Terminal = class _Terminal extends xtermExports.Terminal {
67291
68010
  const currentLine = this._cmd;
67292
68011
  this._cmd = "";
67293
68012
  this._cursorPosition = 0;
67294
- this.write("\r" + ansi$6.erase.inLine(2));
68013
+ this.write("\r" + ansi$7.erase.inLine(2));
67295
68014
  return currentLine;
67296
68015
  }
67297
68016
  restoreCommand(cmd) {
@@ -67328,23 +68047,36 @@ const _Terminal = class _Terminal extends xtermExports.Terminal {
67328
68047
  }
67329
68048
  return [...new Set(matches)].map((match) => match);
67330
68049
  }
67331
- const lastSlashIndex = lastWord.lastIndexOf("/");
67332
- const searchDir = lastSlashIndex !== -1 ? path$1.resolve(this._shell.cwd, lastWord.substring(0, lastSlashIndex + 1)) : this._shell.cwd;
67333
- const searchTerm = lastSlashIndex !== -1 ? lastWord.substring(lastSlashIndex + 1) : lastWord;
68050
+ const expandedLastWord = this._shell.expandTilde(lastWord);
68051
+ const home = this._shell.env.get("HOME") || "";
68052
+ const lastSlashIndex = expandedLastWord.lastIndexOf("/");
68053
+ const searchDir = lastSlashIndex !== -1 ? path$1.resolve(this._shell.cwd, expandedLastWord.substring(0, lastSlashIndex + 1)) : this._shell.cwd;
68054
+ const searchTerm = lastSlashIndex !== -1 ? expandedLastWord.substring(lastSlashIndex + 1) : expandedLastWord;
67334
68055
  try {
67335
68056
  const entries2 = await this._kernel.filesystem.fs.readdir(searchDir);
67336
68057
  const matches = entries2.filter((entry) => {
67337
68058
  if (!searchTerm) return true;
67338
68059
  return entry.toLowerCase().startsWith(searchTerm.toLowerCase());
67339
68060
  });
67340
- const prefix = lastSlashIndex !== -1 ? (lastWord || "").substring(0, lastSlashIndex + 1) : "";
68061
+ const hadTilde = lastWord.startsWith("~");
68062
+ const expandedPrefix = lastSlashIndex !== -1 ? expandedLastWord.substring(0, lastSlashIndex + 1) : "";
67341
68063
  const matchesMap = await Promise.all(matches.map(async (match) => {
67342
68064
  const fullPath = path$1.join(searchDir, match);
67343
68065
  const isDirectory2 = (await this._kernel.filesystem.fs.stat(fullPath)).isDirectory();
67344
68066
  const escapedMatch = match.includes(" ") ? match.replace(/ /g, "\\ ") : match;
67345
68067
  const matchWithSlash = isDirectory2 ? escapedMatch + "/" : escapedMatch;
68068
+ let completionPath;
68069
+ if (hadTilde && home && fullPath.startsWith(home + "/")) {
68070
+ const relativePath = path$1.relative(home, fullPath);
68071
+ const tildePath = `~/${relativePath}`;
68072
+ completionPath = isDirectory2 && !tildePath.endsWith("/") ? tildePath + "/" : tildePath;
68073
+ } else if (hadTilde && home && fullPath === home) {
68074
+ completionPath = "~" + (isDirectory2 ? "/" : "");
68075
+ } else {
68076
+ completionPath = expandedPrefix + matchWithSlash;
68077
+ }
67346
68078
  const newParts = [...parts];
67347
- newParts[newParts.length - 1] = prefix + matchWithSlash;
68079
+ newParts[newParts.length - 1] = completionPath;
67348
68080
  return newParts.join(" ");
67349
68081
  }));
67350
68082
  return matchesMap;
@@ -67375,7 +68107,7 @@ const _Spinner = class _Spinner {
67375
68107
  }
67376
68108
  start() {
67377
68109
  let index = 0;
67378
- this.terminal.write(ansi$6.cursor.hide);
68110
+ this.terminal.write(ansi$7.cursor.hide);
67379
68111
  const interval = setInterval(() => {
67380
68112
  const currentFrame = this.frames[index];
67381
68113
  const fullText = `${this.prefix ? this.prefix + " " : ""}${currentFrame}${this.suffix ? " " + this.suffix : ""}`;
@@ -67393,7 +68125,7 @@ const _Spinner = class _Spinner {
67393
68125
  }
67394
68126
  stop() {
67395
68127
  clearInterval(this.loop);
67396
- this.terminal.write(ansi$6.cursor.show);
68128
+ this.terminal.write(ansi$7.cursor.show);
67397
68129
  }
67398
68130
  };
67399
68131
  __name(_Spinner, "Spinner");
@@ -70907,6 +71639,61 @@ const _Shell = class _Shell {
70907
71639
  return "";
70908
71640
  }
70909
71641
  }
71642
+ /**
71643
+ * Expands tilde (~) to the user's home directory
71644
+ * Handles ~, ~/, and ~/path patterns
71645
+ * Respects quotes: no expansion inside single quotes, expansion inside double quotes
71646
+ */
71647
+ expandTilde(input) {
71648
+ const home = this._env.get("HOME");
71649
+ if (!home) return input;
71650
+ let result = "";
71651
+ let inSingleQuote = false;
71652
+ let inDoubleQuote = false;
71653
+ let escaped = false;
71654
+ let i = 0;
71655
+ while (i < input.length) {
71656
+ const char = input[i];
71657
+ const nextChar = input[i + 1];
71658
+ if (escaped) {
71659
+ result += char;
71660
+ escaped = false;
71661
+ i++;
71662
+ continue;
71663
+ }
71664
+ if (char === "\\") {
71665
+ escaped = true;
71666
+ result += char;
71667
+ i++;
71668
+ continue;
71669
+ }
71670
+ if (char === "'" && !inDoubleQuote) {
71671
+ inSingleQuote = !inSingleQuote;
71672
+ result += char;
71673
+ i++;
71674
+ continue;
71675
+ }
71676
+ if (char === '"' && !inSingleQuote) {
71677
+ inDoubleQuote = !inDoubleQuote;
71678
+ result += char;
71679
+ i++;
71680
+ continue;
71681
+ }
71682
+ if (!inSingleQuote && char === "~") {
71683
+ const isWordStart = i === 0 || i > 0 && /\s|=/.test(input[i - 1] ?? " ");
71684
+ if (isWordStart) {
71685
+ if (nextChar === "/" || nextChar === void 0 || /\s/.test(nextChar)) {
71686
+ result += home;
71687
+ i++;
71688
+ continue;
71689
+ }
71690
+ }
71691
+ }
71692
+ result += char;
71693
+ i++;
71694
+ }
71695
+ return result;
71696
+ }
70910
71697
  parseRedirection(commandLine) {
70911
71698
  const redirections = [];
70912
71699
  let command = commandLine;
@@ -70946,6 +71733,7 @@ const _Shell = class _Shell {
70946
71733
  let commandLine = commands[i];
70947
71734
  if (!commandLine) continue;
70948
71735
  commandLine = await this.parseCommandSubstitution(commandLine);
71736
+ commandLine = this.expandTilde(commandLine);
70949
71737
  const { command, redirections } = this.parseRedirection(commandLine);
70950
71738
  const [commandName, ...args] = shellQuote.parse(command, this.envObject);
70951
71739
  if (!commandName) return Infinity;
@@ -72780,7 +73568,7 @@ const _Workers = class _Workers {
72780
73568
  };
72781
73569
  __name(_Workers, "Workers");
72782
73570
  let Workers = _Workers;
72783
- const __vite_import_meta_env__ = { "AUTHOR": { "name": "Jay Mathis", "email": "code@mathis.network", "url": "https://github.com/mathiscode" }, "BASE_URL": "/", "DESCRIPTION": "ecmaOS: Micro-kernel and framework for web technologies", "DEV": false, "HOMEPAGE": "https://ecmaos.sh", "KNOWN_ISSUES": ["It's best to stick to Chromium-based browsers for the most features", "Keyboard is broken on mobile; ecmaOS is not mobile-friendly at this time", "Don't expect any sort of POSIX compliance at this stage", "Most commands/devices are very basic implementations, not complete reproductions", "stdin/stdout/stderr streams and redirection can be wonky and don't work everywhere, but are coming along", "CTRL-C will return you to a prompt, but doesn't currently interrupt a process", "Lots of unfinished work; watch your step"], "MODE": "production", "NAME": "@ecmaos/kernel", "PROD": true, "REPOSITORY": "https://github.com/ecmaos/ecmaos", "SSR": false, "TIPS": ["If it ever fails to boot, check your logs or try clearing all data", "You can run some devices that offer a CLI - e.g. '/dev/battery --help'", "Use the 'install' command to install packages - e.g. 'install @ecmaos-apps/news'", "You can install any NPM package - e.g. 'install jquery'", "Use the 'news' command to see the latest news about ecmaOS", "Type 'ls /bin' to see all built-in commands", "Type 'ls /usr/bin' to see all installed commands", "You can set your environment variables in ~/.env (try setting PROMPT to a PS1-like format)", "Try 'fetch /xkcd-os.sixel'"], "VERSION": "0.6.2", "VITE_APP_SHOW_DEFAULT_LOGIN": "true", "VITE_BOOT_DISABLE_ISSUES": "true", "VITE_BOOT_DISABLE_LOGO_CONSOLE": "false", "VITE_BOOT_DISABLE_LOGO_FIGLET": "false", "VITE_BOOT_DISABLE_TIPS": "false", "VITE_INITFS": "/initfs.tar.gz", "VITE_KERNEL_INTERVALS_PROC": "1000", "VITE_KERNEL_MODULES": "@ecmaos-modules/boilerplate@0.1.0", "VITE_METAL_SOCKET": "ws://localhost:30445/socket", "VITE_PORT": "30443", "VITE_RECOMMENDED_APPS": "@ecmaos-apps/code,@ecmaos-apps/webamp,@ecmaos-apps/news", "XTERM_VERSION": "5.5.0", "ZENFS_VERSION": "2.4.2" };
73571
+ const __vite_import_meta_env__ = { "AUTHOR": { "name": "Jay Mathis", "email": "code@mathis.network", "url": "https://github.com/mathiscode" }, "BASE_URL": "/", "DESCRIPTION": "ecmaOS: Micro-kernel and framework for web technologies", "DEV": false, "HOMEPAGE": "https://ecmaos.sh", "KNOWN_ISSUES": ["It's best to stick to Chromium-based browsers for the most features", "Keyboard is broken on mobile; ecmaOS is not mobile-friendly at this time", "Don't expect any sort of POSIX compliance at this stage", "Most commands/devices are very basic implementations, not complete reproductions", "stdin/stdout/stderr streams and redirection can be wonky and don't work everywhere, but are coming along", "CTRL-C will return you to a prompt, but doesn't currently interrupt a process", "Lots of unfinished work; watch your step"], "MODE": "production", "NAME": "@ecmaos/kernel", "PROD": true, "REPOSITORY": "https://github.com/ecmaos/ecmaos", "SSR": false, "TIPS": ["If it ever fails to boot, check your logs or try clearing all data", "You can run some devices that offer a CLI - e.g. '/dev/battery --help'", "Use the 'install' command to install packages - e.g. 'install @ecmaos-apps/news'", "You can install any NPM package - e.g. 'install jquery'", "Use the 'news' command to see the latest news about ecmaOS", "Type 'ls /bin' to see all built-in commands", "Type 'ls /usr/bin' to see all installed commands", "You can set your environment variables in ~/.env (try setting PROMPT to a PS1-like format)", "Try 'fetch /xkcd-os.sixel'"], "VERSION": "0.6.4", "VITE_APP_SHOW_DEFAULT_LOGIN": "true", "VITE_AUTOLOGIN_PASSWORD": "root", "VITE_AUTOLOGIN_USERNAME": "root", "VITE_BOOT_DISABLE_ISSUES": "true", "VITE_BOOT_DISABLE_LOGO_CONSOLE": "false", "VITE_BOOT_DISABLE_LOGO_FIGLET": "false", "VITE_BOOT_DISABLE_TIPS": "false", "VITE_INITFS": "/initfs.tar.gz", "VITE_KERNEL_INTERVALS_PROC": "1000", "VITE_KERNEL_MODULES": "@ecmaos-modules/boilerplate@0.1.0", "VITE_METAL_SOCKET": "ws://localhost:30445/socket", "VITE_PORT": "30443", "VITE_RECOMMENDED_APPS": "@ecmaos-apps/code,@ecmaos-apps/edit,@ecmaos-apps/ai,@ecmaos-apps/webamp,@ecmaos-apps/news", "XTERM_VERSION": "5.5.0", "ZENFS_VERSION": "2.4.2" };
72784
73572
  var define_import_meta_env_AUTHOR_default = { name: "Jay Mathis", email: "code@mathis.network", url: "https://github.com/mathiscode" };
72785
73573
  var define_import_meta_env_KNOWN_ISSUES_default = ["It's best to stick to Chromium-based browsers for the most features", "Keyboard is broken on mobile; ecmaOS is not mobile-friendly at this time", "Don't expect any sort of POSIX compliance at this stage", "Most commands/devices are very basic implementations, not complete reproductions", "stdin/stdout/stderr streams and redirection can be wonky and don't work everywhere, but are coming along", "CTRL-C will return you to a prompt, but doesn't currently interrupt a process", "Lots of unfinished work; watch your step"];
72786
73574
  var define_import_meta_env_TIPS_default = ["If it ever fails to boot, check your logs or try clearing all data", "You can run some devices that offer a CLI - e.g. '/dev/battery --help'", "Use the 'install' command to install packages - e.g. 'install @ecmaos-apps/news'", "You can install any NPM package - e.g. 'install jquery'", "Use the 'news' command to see the latest news about ecmaOS", "Type 'ls /bin' to see all built-in commands", "Type 'ls /usr/bin' to see all installed commands", "You can set your environment variables in ~/.env (try setting PROMPT to a PS1-like format)", "Try 'fetch /xkcd-os.sixel'"];
@@ -72825,7 +73613,7 @@ const _Kernel = class _Kernel {
72825
73613
  /** Name of the kernel */
72826
73614
  __publicField(this, "name", "@ecmaos/kernel");
72827
73615
  /** Version string of the kernel */
72828
- __publicField(this, "version", "0.6.2");
73616
+ __publicField(this, "version", "0.6.4");
72829
73617
  /** Authentication and authorization service */
72830
73618
  __publicField(this, "auth");
72831
73619
  /** BIOS module providing low-level functionality */
@@ -72983,7 +73771,7 @@ const _Kernel = class _Kernel {
72983
73771
  ];
72984
73772
  this.terminal.writeln(chalk$2.red.bold(`🐉 ${t2("kernel.experimental", "EXPERIMENTAL")} 🐉`));
72985
73773
  this.terminal.writeln(
72986
- `${this.terminal.createSpecialLink("https://ecmaos.sh", "@ecmaos/kernel")}@${"0.6.2"}` + chalk$2.cyan(` [${dependencyLinks.map((link2) => link2.link).join(", ")}]`)
73774
+ `${this.terminal.createSpecialLink("https://ecmaos.sh", "@ecmaos/kernel")}@${"0.6.4"}` + chalk$2.cyan(` [${dependencyLinks.map((link2) => link2.link).join(", ")}]`)
72987
73775
  );
72988
73776
  this.terminal.writeln(`${t2("kernel.madeBy", "Made with ❤️ by Jay Mathis")} ${this.terminal.createSpecialLink(
72989
73777
  define_import_meta_env_AUTHOR_default?.url || "https://github.com/mathiscode",
@@ -73000,14 +73788,14 @@ const _Kernel = class _Kernel {
73000
73788
  if (logoFiglet && true) {
73001
73789
  console.log(`%c${logoFiglet}`, "color: green");
73002
73790
  console.log(`%c${"https://github.com/ecmaos/ecmaos"}`, "color: blue; text-decoration: underline; font-size: 16px");
73003
- this.log.info(`${"@ecmaos/kernel"} v${"0.6.2"}`);
73791
+ this.log.info(`${"@ecmaos/kernel"} v${"0.6.4"}`);
73004
73792
  }
73005
73793
  if (Notification?.permission === "default") Notification.requestPermission();
73006
73794
  if (Notification?.permission === "denied") this.log.warn(t2("kernel.permissionNotificationDenied", "Notification permission denied"));
73007
73795
  this.intervals.set("title-blink", () => {
73008
73796
  globalThis.document.title = globalThis.document.title.includes("_") ? "ecmaos# " : "ecmaos# _";
73009
73797
  }, 600);
73010
- this.toast.success(`${"@ecmaos/kernel"} v${"0.6.2"}`);
73798
+ this.toast.success(`${"@ecmaos/kernel"} v${"0.6.4"}`);
73011
73799
  }
73012
73800
  await this.configure({ devices: this.options.devices || DefaultDevices, filesystem: Filesystem.options() });
73013
73801
  const requiredPaths = [
@@ -73163,12 +73951,12 @@ const _Kernel = class _Kernel {
73163
73951
  const protocol = loc?.protocol || "ecmaos:";
73164
73952
  const hostname = loc?.hostname || "localhost";
73165
73953
  const port = loc && loc.port && loc.port !== "80" && loc.port !== "443" ? `:${loc.port}` : "";
73166
- const isHttp = protocol === "http:";
73167
- const protocolStr = isHttp ? chalk$2.red(protocol) : chalk$2.green(protocol);
73168
- const icon = isHttp ? "🔓" : "🔒";
73954
+ const isSecure = globalThis.window?.isSecureContext ?? false;
73955
+ const protocolStr = isSecure ? chalk$2.green(protocol) : chalk$2.red(protocol);
73956
+ const icon = isSecure ? "🔒" : "🔓";
73169
73957
  this.terminal.writeln(`${icon} ${protocolStr}//${hostname}${port}`);
73170
73958
  const username = await this.terminal.readline(`👤 ${this.i18n.t("Username")}: `);
73171
- const password = await this.terminal.readline(`🔒 ${this.i18n.t("Password")}: `, true);
73959
+ const password = await this.terminal.readline(`🔑 ${this.i18n.t("Password")}: `, true);
73172
73960
  const { user: user22, cred } = await this.users.login(username, password);
73173
73961
  this.shell.credentials = cred;
73174
73962
  this.shell.context = bindContext({ root: "/", pwd: "/", credentials: cred });
@@ -73239,7 +74027,7 @@ const _Kernel = class _Kernel {
73239
74027
  this._state = KernelState.RUNNING;
73240
74028
  this.setupDebugGlobals();
73241
74029
  if (!this.storage.local.getItem("ecmaos:first-boot")) {
73242
- const recommendedApps = "@ecmaos-apps/code,@ecmaos-apps/webamp,@ecmaos-apps/news";
74030
+ const recommendedApps = "@ecmaos-apps/code,@ecmaos-apps/edit,@ecmaos-apps/ai,@ecmaos-apps/webamp,@ecmaos-apps/news";
73243
74031
  if (recommendedApps) {
73244
74032
  const apps = recommendedApps.split(",");
73245
74033
  this.terminal.writeln("\n" + chalk$2.yellow.bold(this.i18n.t("kernel.recommendedApps", "Recommended apps:")));
@@ -73252,7 +74040,7 @@ const _Kernel = class _Kernel {
73252
74040
  }
73253
74041
  this.storage.local.setItem("ecmaos:first-boot", Date.now().toString());
73254
74042
  }
73255
- this.terminal.write(ansi$6.erase.inLine(2) + this.terminal.prompt());
74043
+ this.terminal.write(ansi$7.erase.inLine(2) + this.terminal.prompt());
73256
74044
  this.terminal.focus();
73257
74045
  this.terminal.listen();
73258
74046
  } catch (error) {
@@ -73711,7 +74499,7 @@ const _Kernel = class _Kernel {
73711
74499
  memory: "?",
73712
74500
  platform: navigator.userAgentData?.platform || navigator?.platform || navigator.userAgent,
73713
74501
  querystring: location.search,
73714
- version: `${"@ecmaos/kernel"} ${"0.6.2"}`,
74502
+ version: `${"@ecmaos/kernel"} ${"0.6.4"}`,
73715
74503
  language: navigator.language,
73716
74504
  host: location.host,
73717
74505
  userAgent: navigator.userAgent,
@@ -73888,4 +74676,4 @@ export {
73888
74676
  path$1 as p,
73889
74677
  semver as s
73890
74678
  };
73891
- //# sourceMappingURL=kernel-aP6SixLt.js.map
74679
+ //# sourceMappingURL=kernel-DtEbpoeV.js.map