@ecmaos/kernel 0.6.2 → 0.6.3

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.
@@ -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;
@@ -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++) {
@@ -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-BbHcCmce.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$d(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$d, "createCommand$d");
59717
+ function createCommand$c(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$c, "createCommand$c");
59739
+ function createCommand$b(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$b, "createCommand$b");
59766
+ function createCommand$a(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$a, "createCommand$a");
59789
+ function createCommand$9(kernel, shell, terminal) {
59800
59790
  return new TerminalCommand({
59801
59791
  command: "echo",
59802
59792
  description: "Print arguments to the standard output",
@@ -59824,6 +59814,99 @@ function createCommand$8(kernel, shell, terminal) {
59824
59814
  }, "run")
59825
59815
  });
59826
59816
  }
59817
+ __name(createCommand$9, "createCommand$9");
59818
+ function createCommand$8(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
+ }
59827
59910
  __name(createCommand$8, "createCommand$8");
59828
59911
  var humanFormat$2 = { exports: {} };
59829
59912
  var humanFormat$1 = humanFormat$2.exports;
@@ -59831,7 +59914,7 @@ 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();
@@ -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);
@@ -65180,11 +65319,12 @@ function createCommand(kernel, shell, terminal) {
65180
65319
  __name(createCommand, "createCommand");
65181
65320
  function createAllCommands(kernel, shell, terminal) {
65182
65321
  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),
65322
+ cat: createCommand$d(kernel, shell, terminal),
65323
+ cd: createCommand$c(kernel, shell, terminal),
65324
+ chmod: createCommand$b(kernel, shell, terminal),
65325
+ cp: createCommand$a(kernel, shell, terminal),
65326
+ echo: createCommand$9(kernel, shell, terminal),
65327
+ ln: createCommand$8(kernel, shell, terminal),
65188
65328
  ls: createCommand$7(kernel, shell, terminal),
65189
65329
  mkdir: createCommand$6(kernel, shell, terminal),
65190
65330
  mv: createCommand$5(kernel, shell, terminal),
@@ -65251,20 +65391,6 @@ const TerminalCommands = /* @__PURE__ */ __name((kernel, shell, terminal) => {
65251
65391
  return await download({ shell, terminal, process: process2, args: argv.path });
65252
65392
  }, "run")
65253
65393
  }),
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
65394
  env: new TerminalCommand({
65269
65395
  command: "env",
65270
65396
  description: "Print or set an environment variable",
@@ -65310,7 +65436,7 @@ const TerminalCommands = /* @__PURE__ */ __name((kernel, shell, terminal) => {
65310
65436
  { name: "reinstall", type: Boolean, description: "Reinstall the package if it is already installed" }
65311
65437
  ],
65312
65438
  run: /* @__PURE__ */ __name(async (argv) => {
65313
- const { default: install } = await import("./install-U3zlzitO.js");
65439
+ const { default: install } = await import("./install-7ncBAQu_.js");
65314
65440
  return await install({ kernel, shell, terminal, args: [argv.package, argv.registry, argv.reinstall] });
65315
65441
  }, "run")
65316
65442
  }),
@@ -65325,7 +65451,7 @@ const TerminalCommands = /* @__PURE__ */ __name((kernel, shell, terminal) => {
65325
65451
  { 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
65452
  ],
65327
65453
  run: /* @__PURE__ */ __name(async (argv) => {
65328
- const { default: uninstall } = await import("./uninstall-CCbsu8HM.js");
65454
+ const { default: uninstall } = await import("./uninstall-RZVWBlfX.js");
65329
65455
  return await uninstall({ kernel, shell, terminal, args: [argv.package] });
65330
65456
  }, "run")
65331
65457
  }),
@@ -65644,270 +65770,6 @@ const download = /* @__PURE__ */ __name(async ({ shell, terminal, process: proce
65644
65770
  await writelnStderr(process2, terminal, chalk$2.red(`${fullPath} not found`));
65645
65771
  }
65646
65772
  }, "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
65773
  const env = /* @__PURE__ */ __name(async ({ shell, terminal, process: process2, args }) => {
65912
65774
  const [variables, value] = args;
65913
65775
  if (!variables) {
@@ -66870,10 +66732,13 @@ const _Terminal = class _Terminal extends xtermExports.Terminal {
66870
66732
  if (cursor < input.length) input = input.slice(0, cursor) + input.slice(cursor + 1);
66871
66733
  break;
66872
66734
  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++;
66735
+ if (domEvent.key.length === 1 && !domEvent.ctrlKey && !domEvent.metaKey && !domEvent.altKey) {
66736
+ const charCode = domEvent.key.charCodeAt(0);
66737
+ if (charCode >= 32 && charCode <= 126) {
66738
+ input = input.slice(0, cursor) + domEvent.key + input.slice(cursor);
66739
+ if (!hide) this.write(ansi$6.cursor.horizontalAbsolute(0) + ansi$6.erase.inLine(2) + prompt + input);
66740
+ cursor++;
66741
+ }
66877
66742
  }
66878
66743
  }
66879
66744
  if (cursor < 0) cursor = 0;
@@ -67190,11 +67055,12 @@ const _Terminal = class _Terminal extends xtermExports.Terminal {
67190
67055
  }
67191
67056
  const matches = await this.getCompletionMatches(this._lastTabCommand);
67192
67057
  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;
67058
+ const pathArg = this._cmd.split(" ").slice(-1)[0];
67059
+ if (!pathArg) break;
67060
+ const expandedPath = this._shell.expandTilde(pathArg);
67061
+ if (!await this._kernel.filesystem.fs.exists(expandedPath)) break;
67196
67062
  await this.write("\n");
67197
- await this._shell.execute(`ls ${path2}`);
67063
+ await this._shell.execute(`ls ${expandedPath}`);
67198
67064
  this.write(this.prompt() + this._cmd);
67199
67065
  } else if (matches.length > 0) {
67200
67066
  this.write("\r" + ansi$6.erase.inLine());
@@ -67328,23 +67194,36 @@ const _Terminal = class _Terminal extends xtermExports.Terminal {
67328
67194
  }
67329
67195
  return [...new Set(matches)].map((match) => match);
67330
67196
  }
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;
67197
+ const expandedLastWord = this._shell.expandTilde(lastWord);
67198
+ const home = this._shell.env.get("HOME") || "";
67199
+ const lastSlashIndex = expandedLastWord.lastIndexOf("/");
67200
+ const searchDir = lastSlashIndex !== -1 ? path$1.resolve(this._shell.cwd, expandedLastWord.substring(0, lastSlashIndex + 1)) : this._shell.cwd;
67201
+ const searchTerm = lastSlashIndex !== -1 ? expandedLastWord.substring(lastSlashIndex + 1) : expandedLastWord;
67334
67202
  try {
67335
67203
  const entries2 = await this._kernel.filesystem.fs.readdir(searchDir);
67336
67204
  const matches = entries2.filter((entry) => {
67337
67205
  if (!searchTerm) return true;
67338
67206
  return entry.toLowerCase().startsWith(searchTerm.toLowerCase());
67339
67207
  });
67340
- const prefix = lastSlashIndex !== -1 ? (lastWord || "").substring(0, lastSlashIndex + 1) : "";
67208
+ const hadTilde = lastWord.startsWith("~");
67209
+ const expandedPrefix = lastSlashIndex !== -1 ? expandedLastWord.substring(0, lastSlashIndex + 1) : "";
67341
67210
  const matchesMap = await Promise.all(matches.map(async (match) => {
67342
67211
  const fullPath = path$1.join(searchDir, match);
67343
67212
  const isDirectory2 = (await this._kernel.filesystem.fs.stat(fullPath)).isDirectory();
67344
67213
  const escapedMatch = match.includes(" ") ? match.replace(/ /g, "\\ ") : match;
67345
67214
  const matchWithSlash = isDirectory2 ? escapedMatch + "/" : escapedMatch;
67215
+ let completionPath;
67216
+ if (hadTilde && home && fullPath.startsWith(home + "/")) {
67217
+ const relativePath = path$1.relative(home, fullPath);
67218
+ const tildePath = `~/${relativePath}`;
67219
+ completionPath = isDirectory2 && !tildePath.endsWith("/") ? tildePath + "/" : tildePath;
67220
+ } else if (hadTilde && home && fullPath === home) {
67221
+ completionPath = "~" + (isDirectory2 ? "/" : "");
67222
+ } else {
67223
+ completionPath = expandedPrefix + matchWithSlash;
67224
+ }
67346
67225
  const newParts = [...parts];
67347
- newParts[newParts.length - 1] = prefix + matchWithSlash;
67226
+ newParts[newParts.length - 1] = completionPath;
67348
67227
  return newParts.join(" ");
67349
67228
  }));
67350
67229
  return matchesMap;
@@ -70907,6 +70786,61 @@ const _Shell = class _Shell {
70907
70786
  return "";
70908
70787
  }
70909
70788
  }
70789
+ /**
70790
+ * Expands tilde (~) to the user's home directory
70791
+ * Handles ~, ~/, and ~/path patterns
70792
+ * Respects quotes: no expansion inside single quotes, expansion inside double quotes
70793
+ */
70794
+ expandTilde(input) {
70795
+ const home = this._env.get("HOME");
70796
+ if (!home) return input;
70797
+ let result = "";
70798
+ let inSingleQuote = false;
70799
+ let inDoubleQuote = false;
70800
+ let escaped = false;
70801
+ let i = 0;
70802
+ while (i < input.length) {
70803
+ const char = input[i];
70804
+ const nextChar = input[i + 1];
70805
+ if (escaped) {
70806
+ result += char;
70807
+ escaped = false;
70808
+ i++;
70809
+ continue;
70810
+ }
70811
+ if (char === "\\") {
70812
+ escaped = true;
70813
+ result += char;
70814
+ i++;
70815
+ continue;
70816
+ }
70817
+ if (char === "'" && !inDoubleQuote) {
70818
+ inSingleQuote = !inSingleQuote;
70819
+ result += char;
70820
+ i++;
70821
+ continue;
70822
+ }
70823
+ if (char === '"' && !inSingleQuote) {
70824
+ inDoubleQuote = !inDoubleQuote;
70825
+ result += char;
70826
+ i++;
70827
+ continue;
70828
+ }
70829
+ if (!inSingleQuote && char === "~") {
70830
+ const isWordStart = i === 0 || i > 0 && /\s|=/.test(input[i - 1] ?? " ");
70831
+ if (isWordStart) {
70832
+ if (nextChar === "/" || nextChar === void 0 || /\s/.test(nextChar)) {
70833
+ result += home;
70834
+ i++;
70835
+ continue;
70836
+ }
70837
+ }
70838
+ }
70839
+ result += char;
70840
+ i++;
70841
+ }
70842
+ return result;
70843
+ }
70910
70844
  parseRedirection(commandLine) {
70911
70845
  const redirections = [];
70912
70846
  let command = commandLine;
@@ -70946,6 +70880,7 @@ const _Shell = class _Shell {
70946
70880
  let commandLine = commands[i];
70947
70881
  if (!commandLine) continue;
70948
70882
  commandLine = await this.parseCommandSubstitution(commandLine);
70883
+ commandLine = this.expandTilde(commandLine);
70949
70884
  const { command, redirections } = this.parseRedirection(commandLine);
70950
70885
  const [commandName, ...args] = shellQuote.parse(command, this.envObject);
70951
70886
  if (!commandName) return Infinity;
@@ -72780,7 +72715,7 @@ const _Workers = class _Workers {
72780
72715
  };
72781
72716
  __name(_Workers, "Workers");
72782
72717
  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" };
72718
+ 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.3", "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" };
72784
72719
  var define_import_meta_env_AUTHOR_default = { name: "Jay Mathis", email: "code@mathis.network", url: "https://github.com/mathiscode" };
72785
72720
  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
72721
  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 +72760,7 @@ const _Kernel = class _Kernel {
72825
72760
  /** Name of the kernel */
72826
72761
  __publicField(this, "name", "@ecmaos/kernel");
72827
72762
  /** Version string of the kernel */
72828
- __publicField(this, "version", "0.6.2");
72763
+ __publicField(this, "version", "0.6.3");
72829
72764
  /** Authentication and authorization service */
72830
72765
  __publicField(this, "auth");
72831
72766
  /** BIOS module providing low-level functionality */
@@ -72983,7 +72918,7 @@ const _Kernel = class _Kernel {
72983
72918
  ];
72984
72919
  this.terminal.writeln(chalk$2.red.bold(`🐉 ${t2("kernel.experimental", "EXPERIMENTAL")} 🐉`));
72985
72920
  this.terminal.writeln(
72986
- `${this.terminal.createSpecialLink("https://ecmaos.sh", "@ecmaos/kernel")}@${"0.6.2"}` + chalk$2.cyan(` [${dependencyLinks.map((link2) => link2.link).join(", ")}]`)
72921
+ `${this.terminal.createSpecialLink("https://ecmaos.sh", "@ecmaos/kernel")}@${"0.6.3"}` + chalk$2.cyan(` [${dependencyLinks.map((link2) => link2.link).join(", ")}]`)
72987
72922
  );
72988
72923
  this.terminal.writeln(`${t2("kernel.madeBy", "Made with ❤️ by Jay Mathis")} ${this.terminal.createSpecialLink(
72989
72924
  define_import_meta_env_AUTHOR_default?.url || "https://github.com/mathiscode",
@@ -73000,14 +72935,14 @@ const _Kernel = class _Kernel {
73000
72935
  if (logoFiglet && true) {
73001
72936
  console.log(`%c${logoFiglet}`, "color: green");
73002
72937
  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"}`);
72938
+ this.log.info(`${"@ecmaos/kernel"} v${"0.6.3"}`);
73004
72939
  }
73005
72940
  if (Notification?.permission === "default") Notification.requestPermission();
73006
72941
  if (Notification?.permission === "denied") this.log.warn(t2("kernel.permissionNotificationDenied", "Notification permission denied"));
73007
72942
  this.intervals.set("title-blink", () => {
73008
72943
  globalThis.document.title = globalThis.document.title.includes("_") ? "ecmaos# " : "ecmaos# _";
73009
72944
  }, 600);
73010
- this.toast.success(`${"@ecmaos/kernel"} v${"0.6.2"}`);
72945
+ this.toast.success(`${"@ecmaos/kernel"} v${"0.6.3"}`);
73011
72946
  }
73012
72947
  await this.configure({ devices: this.options.devices || DefaultDevices, filesystem: Filesystem.options() });
73013
72948
  const requiredPaths = [
@@ -73163,12 +73098,12 @@ const _Kernel = class _Kernel {
73163
73098
  const protocol = loc?.protocol || "ecmaos:";
73164
73099
  const hostname = loc?.hostname || "localhost";
73165
73100
  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 ? "🔓" : "🔒";
73101
+ const isSecure = globalThis.window?.isSecureContext ?? false;
73102
+ const protocolStr = isSecure ? chalk$2.green(protocol) : chalk$2.red(protocol);
73103
+ const icon = isSecure ? "🔒" : "🔓";
73169
73104
  this.terminal.writeln(`${icon} ${protocolStr}//${hostname}${port}`);
73170
73105
  const username = await this.terminal.readline(`👤 ${this.i18n.t("Username")}: `);
73171
- const password = await this.terminal.readline(`🔒 ${this.i18n.t("Password")}: `, true);
73106
+ const password = await this.terminal.readline(`🔑 ${this.i18n.t("Password")}: `, true);
73172
73107
  const { user: user22, cred } = await this.users.login(username, password);
73173
73108
  this.shell.credentials = cred;
73174
73109
  this.shell.context = bindContext({ root: "/", pwd: "/", credentials: cred });
@@ -73711,7 +73646,7 @@ const _Kernel = class _Kernel {
73711
73646
  memory: "?",
73712
73647
  platform: navigator.userAgentData?.platform || navigator?.platform || navigator.userAgent,
73713
73648
  querystring: location.search,
73714
- version: `${"@ecmaos/kernel"} ${"0.6.2"}`,
73649
+ version: `${"@ecmaos/kernel"} ${"0.6.3"}`,
73715
73650
  language: navigator.language,
73716
73651
  host: location.host,
73717
73652
  userAgent: navigator.userAgent,
@@ -73888,4 +73823,4 @@ export {
73888
73823
  path$1 as p,
73889
73824
  semver as s
73890
73825
  };
73891
- //# sourceMappingURL=kernel-aP6SixLt.js.map
73826
+ //# sourceMappingURL=kernel-DEdzF9cH.js.map