brsh 3.6.1 → 3.6.2
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.
- package/CHANGELOG.md +7 -0
- package/dist/shell.es.js +586 -574
- package/dist/shell.es.js.map +1 -1
- package/dist/shell.min.js +16 -16
- package/dist/shell.min.js.map +1 -1
- package/dist/wbt.es.js +211 -199
- package/dist/wbt.es.js.map +1 -1
- package/dist/wbt.min.js +7 -7
- package/dist/wbt.min.js.map +1 -1
- package/lib/BaseFileSystem.js +1 -0
- package/lib/FileSystem.js +3 -2
- package/lib/WasmCommand.js +38 -2
- package/package.json +1 -1
- package/test/terminal.test.js +32 -0
package/dist/wbt.es.js
CHANGED
|
@@ -234,17 +234,17 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
234
234
|
let r = !1;
|
|
235
235
|
if ((t === void 0 || t < 0) && (t = 0), t > this.length || ((n === void 0 || n > this.length) && (n = this.length), n <= 0) || (n >>>= 0, t >>>= 0, n <= t)) return "";
|
|
236
236
|
for (e ||= "utf8";;) switch (e) {
|
|
237
|
-
case "hex": return
|
|
237
|
+
case "hex": return z(this, t, n);
|
|
238
238
|
case "utf8":
|
|
239
239
|
case "utf-8": return F(this, t, n);
|
|
240
|
-
case "ascii": return
|
|
240
|
+
case "ascii": return ee(this, t, n);
|
|
241
241
|
case "latin1":
|
|
242
|
-
case "binary": return
|
|
242
|
+
case "binary": return R(this, t, n);
|
|
243
243
|
case "base64": return P(this, t, n);
|
|
244
244
|
case "ucs2":
|
|
245
245
|
case "ucs-2":
|
|
246
246
|
case "utf16le":
|
|
247
|
-
case "utf-16le": return
|
|
247
|
+
case "utf-16le": return B(this, t, n);
|
|
248
248
|
default:
|
|
249
249
|
if (r) throw TypeError("Unknown encoding: " + e);
|
|
250
250
|
e = (e + "").toLowerCase(), r = !0;
|
|
@@ -428,26 +428,26 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
428
428
|
for (; r < t;) n += String.fromCharCode.apply(String, e.slice(r, r += I));
|
|
429
429
|
return n;
|
|
430
430
|
}
|
|
431
|
-
function
|
|
431
|
+
function ee(e, t, n) {
|
|
432
432
|
let r = "";
|
|
433
433
|
n = Math.min(e.length, n);
|
|
434
434
|
for (let i = t; i < n; ++i) r += String.fromCharCode(e[i] & 127);
|
|
435
435
|
return r;
|
|
436
436
|
}
|
|
437
|
-
function
|
|
437
|
+
function R(e, t, n) {
|
|
438
438
|
let r = "";
|
|
439
439
|
n = Math.min(e.length, n);
|
|
440
440
|
for (let i = t; i < n; ++i) r += String.fromCharCode(e[i]);
|
|
441
441
|
return r;
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function z(e, t, n) {
|
|
444
444
|
let r = e.length;
|
|
445
445
|
(!t || t < 0) && (t = 0), (!n || n < 0 || n > r) && (n = r);
|
|
446
446
|
let i = "";
|
|
447
447
|
for (let r = t; r < n; ++r) i += fe[e[r]];
|
|
448
448
|
return i;
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function B(e, t, n) {
|
|
451
451
|
let r = e.slice(t, n), i = "";
|
|
452
452
|
for (let e = 0; e < r.length - 1; e += 2) i += String.fromCharCode(r[e] + r[e + 1] * 256);
|
|
453
453
|
return i;
|
|
@@ -458,30 +458,30 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
458
458
|
let r = this.subarray(e, t);
|
|
459
459
|
return Object.setPrototypeOf(r, u.prototype), r;
|
|
460
460
|
};
|
|
461
|
-
function
|
|
461
|
+
function V(e, t, n) {
|
|
462
462
|
if (e % 1 != 0 || e < 0) throw RangeError("offset is not uint");
|
|
463
463
|
if (e + t > n) throw RangeError("Trying to access beyond buffer length");
|
|
464
464
|
}
|
|
465
465
|
u.prototype.readUintLE = u.prototype.readUIntLE = function(e, t, n) {
|
|
466
|
-
e >>>= 0, t >>>= 0, n ||
|
|
466
|
+
e >>>= 0, t >>>= 0, n || V(e, t, this.length);
|
|
467
467
|
let r = this[e], i = 1, a = 0;
|
|
468
468
|
for (; ++a < t && (i *= 256);) r += this[e + a] * i;
|
|
469
469
|
return r;
|
|
470
470
|
}, u.prototype.readUintBE = u.prototype.readUIntBE = function(e, t, n) {
|
|
471
|
-
e >>>= 0, t >>>= 0, n ||
|
|
471
|
+
e >>>= 0, t >>>= 0, n || V(e, t, this.length);
|
|
472
472
|
let r = this[e + --t], i = 1;
|
|
473
473
|
for (; t > 0 && (i *= 256);) r += this[e + --t] * i;
|
|
474
474
|
return r;
|
|
475
475
|
}, u.prototype.readUint8 = u.prototype.readUInt8 = function(e, t) {
|
|
476
|
-
return e >>>= 0, t ||
|
|
476
|
+
return e >>>= 0, t || V(e, 1, this.length), this[e];
|
|
477
477
|
}, u.prototype.readUint16LE = u.prototype.readUInt16LE = function(e, t) {
|
|
478
|
-
return e >>>= 0, t ||
|
|
478
|
+
return e >>>= 0, t || V(e, 2, this.length), this[e] | this[e + 1] << 8;
|
|
479
479
|
}, u.prototype.readUint16BE = u.prototype.readUInt16BE = function(e, t) {
|
|
480
|
-
return e >>>= 0, t ||
|
|
480
|
+
return e >>>= 0, t || V(e, 2, this.length), this[e] << 8 | this[e + 1];
|
|
481
481
|
}, u.prototype.readUint32LE = u.prototype.readUInt32LE = function(e, t) {
|
|
482
|
-
return e >>>= 0, t ||
|
|
482
|
+
return e >>>= 0, t || V(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + this[e + 3] * 16777216;
|
|
483
483
|
}, u.prototype.readUint32BE = u.prototype.readUInt32BE = function(e, t) {
|
|
484
|
-
return e >>>= 0, t ||
|
|
484
|
+
return e >>>= 0, t || V(e, 4, this.length), this[e] * 16777216 + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
|
|
485
485
|
}, u.prototype.readBigUInt64LE = $(function(e) {
|
|
486
486
|
e >>>= 0, Z(e, "offset");
|
|
487
487
|
let t = this[e], n = this[e + 7];
|
|
@@ -495,29 +495,29 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
495
495
|
let r = t * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e], i = this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + n;
|
|
496
496
|
return (BigInt(r) << BigInt(32)) + BigInt(i);
|
|
497
497
|
}), u.prototype.readIntLE = function(e, t, n) {
|
|
498
|
-
e >>>= 0, t >>>= 0, n ||
|
|
498
|
+
e >>>= 0, t >>>= 0, n || V(e, t, this.length);
|
|
499
499
|
let r = this[e], i = 1, a = 0;
|
|
500
500
|
for (; ++a < t && (i *= 256);) r += this[e + a] * i;
|
|
501
501
|
return i *= 128, r >= i && (r -= 2 ** (8 * t)), r;
|
|
502
502
|
}, u.prototype.readIntBE = function(e, t, n) {
|
|
503
|
-
e >>>= 0, t >>>= 0, n ||
|
|
503
|
+
e >>>= 0, t >>>= 0, n || V(e, t, this.length);
|
|
504
504
|
let r = t, i = 1, a = this[e + --r];
|
|
505
505
|
for (; r > 0 && (i *= 256);) a += this[e + --r] * i;
|
|
506
506
|
return i *= 128, a >= i && (a -= 2 ** (8 * t)), a;
|
|
507
507
|
}, u.prototype.readInt8 = function(e, t) {
|
|
508
|
-
return e >>>= 0, t ||
|
|
508
|
+
return e >>>= 0, t || V(e, 1, this.length), this[e] & 128 ? (255 - this[e] + 1) * -1 : this[e];
|
|
509
509
|
}, u.prototype.readInt16LE = function(e, t) {
|
|
510
|
-
e >>>= 0, t ||
|
|
510
|
+
e >>>= 0, t || V(e, 2, this.length);
|
|
511
511
|
let n = this[e] | this[e + 1] << 8;
|
|
512
512
|
return n & 32768 ? n | 4294901760 : n;
|
|
513
513
|
}, u.prototype.readInt16BE = function(e, t) {
|
|
514
|
-
e >>>= 0, t ||
|
|
514
|
+
e >>>= 0, t || V(e, 2, this.length);
|
|
515
515
|
let n = this[e + 1] | this[e] << 8;
|
|
516
516
|
return n & 32768 ? n | 4294901760 : n;
|
|
517
517
|
}, u.prototype.readInt32LE = function(e, t) {
|
|
518
|
-
return e >>>= 0, t ||
|
|
518
|
+
return e >>>= 0, t || V(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
|
|
519
519
|
}, u.prototype.readInt32BE = function(e, t) {
|
|
520
|
-
return e >>>= 0, t ||
|
|
520
|
+
return e >>>= 0, t || V(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
|
|
521
521
|
}, u.prototype.readBigInt64LE = $(function(e) {
|
|
522
522
|
e >>>= 0, Z(e, "offset");
|
|
523
523
|
let t = this[e], n = this[e + 7];
|
|
@@ -531,15 +531,15 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
531
531
|
let r = (t << 24) + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e];
|
|
532
532
|
return (BigInt(r) << BigInt(32)) + BigInt(this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + n);
|
|
533
533
|
}), u.prototype.readFloatLE = function(e, t) {
|
|
534
|
-
return e >>>= 0, t ||
|
|
534
|
+
return e >>>= 0, t || V(e, 4, this.length), n.read(this, e, !0, 23, 4);
|
|
535
535
|
}, u.prototype.readFloatBE = function(e, t) {
|
|
536
|
-
return e >>>= 0, t ||
|
|
536
|
+
return e >>>= 0, t || V(e, 4, this.length), n.read(this, e, !1, 23, 4);
|
|
537
537
|
}, u.prototype.readDoubleLE = function(e, t) {
|
|
538
|
-
return e >>>= 0, t ||
|
|
538
|
+
return e >>>= 0, t || V(e, 8, this.length), n.read(this, e, !0, 52, 8);
|
|
539
539
|
}, u.prototype.readDoubleBE = function(e, t) {
|
|
540
|
-
return e >>>= 0, t ||
|
|
540
|
+
return e >>>= 0, t || V(e, 8, this.length), n.read(this, e, !1, 52, 8);
|
|
541
541
|
};
|
|
542
|
-
function
|
|
542
|
+
function H(e, t, n, r, i, a) {
|
|
543
543
|
if (!u.isBuffer(e)) throw TypeError("\"buffer\" argument must be a Buffer instance");
|
|
544
544
|
if (t > i || t < a) throw RangeError("\"value\" argument is out of bounds");
|
|
545
545
|
if (n + r > e.length) throw RangeError("Index out of range");
|
|
@@ -547,7 +547,7 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
547
547
|
u.prototype.writeUintLE = u.prototype.writeUIntLE = function(e, t, n, r) {
|
|
548
548
|
if (e = +e, t >>>= 0, n >>>= 0, !r) {
|
|
549
549
|
let r = 2 ** (8 * n) - 1;
|
|
550
|
-
|
|
550
|
+
H(this, e, t, n, r, 0);
|
|
551
551
|
}
|
|
552
552
|
let i = 1, a = 0;
|
|
553
553
|
for (this[t] = e & 255; ++a < n && (i *= 256);) this[t + a] = e / i & 255;
|
|
@@ -555,44 +555,44 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
555
555
|
}, u.prototype.writeUintBE = u.prototype.writeUIntBE = function(e, t, n, r) {
|
|
556
556
|
if (e = +e, t >>>= 0, n >>>= 0, !r) {
|
|
557
557
|
let r = 2 ** (8 * n) - 1;
|
|
558
|
-
|
|
558
|
+
H(this, e, t, n, r, 0);
|
|
559
559
|
}
|
|
560
560
|
let i = n - 1, a = 1;
|
|
561
561
|
for (this[t + i] = e & 255; --i >= 0 && (a *= 256);) this[t + i] = e / a & 255;
|
|
562
562
|
return t + n;
|
|
563
563
|
}, u.prototype.writeUint8 = u.prototype.writeUInt8 = function(e, t, n) {
|
|
564
|
-
return e = +e, t >>>= 0, n ||
|
|
564
|
+
return e = +e, t >>>= 0, n || H(this, e, t, 1, 255, 0), this[t] = e & 255, t + 1;
|
|
565
565
|
}, u.prototype.writeUint16LE = u.prototype.writeUInt16LE = function(e, t, n) {
|
|
566
|
-
return e = +e, t >>>= 0, n ||
|
|
566
|
+
return e = +e, t >>>= 0, n || H(this, e, t, 2, 65535, 0), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
|
|
567
567
|
}, u.prototype.writeUint16BE = u.prototype.writeUInt16BE = function(e, t, n) {
|
|
568
|
-
return e = +e, t >>>= 0, n ||
|
|
568
|
+
return e = +e, t >>>= 0, n || H(this, e, t, 2, 65535, 0), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
|
|
569
569
|
}, u.prototype.writeUint32LE = u.prototype.writeUInt32LE = function(e, t, n) {
|
|
570
|
-
return e = +e, t >>>= 0, n ||
|
|
570
|
+
return e = +e, t >>>= 0, n || H(this, e, t, 4, 4294967295, 0), this[t + 3] = e >>> 24, this[t + 2] = e >>> 16, this[t + 1] = e >>> 8, this[t] = e & 255, t + 4;
|
|
571
571
|
}, u.prototype.writeUint32BE = u.prototype.writeUInt32BE = function(e, t, n) {
|
|
572
|
-
return e = +e, t >>>= 0, n ||
|
|
572
|
+
return e = +e, t >>>= 0, n || H(this, e, t, 4, 4294967295, 0), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
|
|
573
573
|
};
|
|
574
|
-
function
|
|
575
|
-
|
|
574
|
+
function U(e, t, n, r, i) {
|
|
575
|
+
X(t, r, i, e, n, 7);
|
|
576
576
|
let a = Number(t & BigInt(4294967295));
|
|
577
577
|
e[n++] = a, a >>= 8, e[n++] = a, a >>= 8, e[n++] = a, a >>= 8, e[n++] = a;
|
|
578
578
|
let o = Number(t >> BigInt(32) & BigInt(4294967295));
|
|
579
579
|
return e[n++] = o, o >>= 8, e[n++] = o, o >>= 8, e[n++] = o, o >>= 8, e[n++] = o, n;
|
|
580
580
|
}
|
|
581
|
-
function
|
|
582
|
-
|
|
581
|
+
function W(e, t, n, r, i) {
|
|
582
|
+
X(t, r, i, e, n, 7);
|
|
583
583
|
let a = Number(t & BigInt(4294967295));
|
|
584
584
|
e[n + 7] = a, a >>= 8, e[n + 6] = a, a >>= 8, e[n + 5] = a, a >>= 8, e[n + 4] = a;
|
|
585
585
|
let o = Number(t >> BigInt(32) & BigInt(4294967295));
|
|
586
586
|
return e[n + 3] = o, o >>= 8, e[n + 2] = o, o >>= 8, e[n + 1] = o, o >>= 8, e[n] = o, n + 8;
|
|
587
587
|
}
|
|
588
588
|
u.prototype.writeBigUInt64LE = $(function(e, t = 0) {
|
|
589
|
-
return
|
|
589
|
+
return U(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
590
590
|
}), u.prototype.writeBigUInt64BE = $(function(e, t = 0) {
|
|
591
|
-
return
|
|
591
|
+
return W(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
592
592
|
}), u.prototype.writeIntLE = function(e, t, n, r) {
|
|
593
593
|
if (e = +e, t >>>= 0, !r) {
|
|
594
594
|
let r = 2 ** (8 * n - 1);
|
|
595
|
-
|
|
595
|
+
H(this, e, t, n, r - 1, -r);
|
|
596
596
|
}
|
|
597
597
|
let i = 0, a = 1, o = 0;
|
|
598
598
|
for (this[t] = e & 255; ++i < n && (a *= 256);) e < 0 && o === 0 && this[t + i - 1] !== 0 && (o = 1), this[t + i] = (e / a >> 0) - o & 255;
|
|
@@ -600,44 +600,44 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
600
600
|
}, u.prototype.writeIntBE = function(e, t, n, r) {
|
|
601
601
|
if (e = +e, t >>>= 0, !r) {
|
|
602
602
|
let r = 2 ** (8 * n - 1);
|
|
603
|
-
|
|
603
|
+
H(this, e, t, n, r - 1, -r);
|
|
604
604
|
}
|
|
605
605
|
let i = n - 1, a = 1, o = 0;
|
|
606
606
|
for (this[t + i] = e & 255; --i >= 0 && (a *= 256);) e < 0 && o === 0 && this[t + i + 1] !== 0 && (o = 1), this[t + i] = (e / a >> 0) - o & 255;
|
|
607
607
|
return t + n;
|
|
608
608
|
}, u.prototype.writeInt8 = function(e, t, n) {
|
|
609
|
-
return e = +e, t >>>= 0, n ||
|
|
609
|
+
return e = +e, t >>>= 0, n || H(this, e, t, 1, 127, -128), e < 0 && (e = 255 + e + 1), this[t] = e & 255, t + 1;
|
|
610
610
|
}, u.prototype.writeInt16LE = function(e, t, n) {
|
|
611
|
-
return e = +e, t >>>= 0, n ||
|
|
611
|
+
return e = +e, t >>>= 0, n || H(this, e, t, 2, 32767, -32768), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
|
|
612
612
|
}, u.prototype.writeInt16BE = function(e, t, n) {
|
|
613
|
-
return e = +e, t >>>= 0, n ||
|
|
613
|
+
return e = +e, t >>>= 0, n || H(this, e, t, 2, 32767, -32768), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
|
|
614
614
|
}, u.prototype.writeInt32LE = function(e, t, n) {
|
|
615
|
-
return e = +e, t >>>= 0, n ||
|
|
615
|
+
return e = +e, t >>>= 0, n || H(this, e, t, 4, 2147483647, -2147483648), this[t] = e & 255, this[t + 1] = e >>> 8, this[t + 2] = e >>> 16, this[t + 3] = e >>> 24, t + 4;
|
|
616
616
|
}, u.prototype.writeInt32BE = function(e, t, n) {
|
|
617
|
-
return e = +e, t >>>= 0, n ||
|
|
617
|
+
return e = +e, t >>>= 0, n || H(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
|
|
618
618
|
}, u.prototype.writeBigInt64LE = $(function(e, t = 0) {
|
|
619
|
-
return
|
|
619
|
+
return U(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
620
620
|
}), u.prototype.writeBigInt64BE = $(function(e, t = 0) {
|
|
621
|
-
return
|
|
621
|
+
return W(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
622
622
|
});
|
|
623
|
-
function
|
|
623
|
+
function G(e, t, n, r, i, a) {
|
|
624
624
|
if (n + r > e.length || n < 0) throw RangeError("Index out of range");
|
|
625
625
|
}
|
|
626
|
-
function
|
|
627
|
-
return t = +t, r >>>= 0, a ||
|
|
626
|
+
function K(e, t, r, i, a) {
|
|
627
|
+
return t = +t, r >>>= 0, a || G(e, t, r, 4), n.write(e, t, r, i, 23, 4), r + 4;
|
|
628
628
|
}
|
|
629
629
|
u.prototype.writeFloatLE = function(e, t, n) {
|
|
630
|
-
return
|
|
630
|
+
return K(this, e, t, !0, n);
|
|
631
631
|
}, u.prototype.writeFloatBE = function(e, t, n) {
|
|
632
|
-
return
|
|
632
|
+
return K(this, e, t, !1, n);
|
|
633
633
|
};
|
|
634
|
-
function
|
|
635
|
-
return t = +t, r >>>= 0, a ||
|
|
634
|
+
function te(e, t, r, i, a) {
|
|
635
|
+
return t = +t, r >>>= 0, a || G(e, t, r, 8), n.write(e, t, r, i, 52, 8), r + 8;
|
|
636
636
|
}
|
|
637
637
|
u.prototype.writeDoubleLE = function(e, t, n) {
|
|
638
|
-
return
|
|
638
|
+
return te(this, e, t, !0, n);
|
|
639
639
|
}, u.prototype.writeDoubleBE = function(e, t, n) {
|
|
640
|
-
return
|
|
640
|
+
return te(this, e, t, !1, n);
|
|
641
641
|
}, u.prototype.copy = function(e, t, n, r) {
|
|
642
642
|
if (!u.isBuffer(e)) throw TypeError("argument should be a Buffer");
|
|
643
643
|
if (n ||= 0, !r && r !== 0 && (r = this.length), t >= e.length && (t = e.length), t ||= 0, r > 0 && r < n && (r = n), r === n || e.length === 0 || this.length === 0) return 0;
|
|
@@ -668,9 +668,9 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
668
668
|
}
|
|
669
669
|
return this;
|
|
670
670
|
};
|
|
671
|
-
let
|
|
672
|
-
function
|
|
673
|
-
|
|
671
|
+
let q = {};
|
|
672
|
+
function J(e, t, n) {
|
|
673
|
+
q[e] = class extends n {
|
|
674
674
|
constructor() {
|
|
675
675
|
super(), Object.defineProperty(this, "message", {
|
|
676
676
|
value: t.apply(this, arguments),
|
|
@@ -694,34 +694,34 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
694
694
|
}
|
|
695
695
|
};
|
|
696
696
|
}
|
|
697
|
-
|
|
697
|
+
J("ERR_BUFFER_OUT_OF_BOUNDS", function(e) {
|
|
698
698
|
return e ? `${e} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
|
|
699
|
-
}, RangeError),
|
|
699
|
+
}, RangeError), J("ERR_INVALID_ARG_TYPE", function(e, t) {
|
|
700
700
|
return `The "${e}" argument must be of type number. Received type ${typeof t}`;
|
|
701
|
-
}, TypeError),
|
|
701
|
+
}, TypeError), J("ERR_OUT_OF_RANGE", function(e, t, n) {
|
|
702
702
|
let r = `The value of "${e}" is out of range.`, i = n;
|
|
703
|
-
return Number.isInteger(n) && Math.abs(n) > 2 ** 32 ? i =
|
|
703
|
+
return Number.isInteger(n) && Math.abs(n) > 2 ** 32 ? i = ne(String(n)) : typeof n == "bigint" && (i = String(n), (n > BigInt(2) ** BigInt(32) || n < -(BigInt(2) ** BigInt(32))) && (i = ne(i)), i += "n"), r += ` It must be ${t}. Received ${i}`, r;
|
|
704
704
|
}, RangeError);
|
|
705
|
-
function
|
|
705
|
+
function ne(e) {
|
|
706
706
|
let t = "", n = e.length, r = +(e[0] === "-");
|
|
707
707
|
for (; n >= r + 4; n -= 3) t = `_${e.slice(n - 3, n)}${t}`;
|
|
708
708
|
return `${e.slice(0, n)}${t}`;
|
|
709
709
|
}
|
|
710
|
-
function
|
|
710
|
+
function Y(e, t, n) {
|
|
711
711
|
Z(t, "offset"), (e[t] === void 0 || e[t + n] === void 0) && re(t, e.length - (n + 1));
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function X(e, t, n, r, i, a) {
|
|
714
714
|
if (e > n || e < t) {
|
|
715
715
|
let r = typeof t == "bigint" ? "n" : "", i;
|
|
716
|
-
throw i = a > 3 ? t === 0 || t === BigInt(0) ? `>= 0${r} and < 2${r} ** ${(a + 1) * 8}${r}` : `>= -(2${r} ** ${(a + 1) * 8 - 1}${r}) and < 2 ** ${(a + 1) * 8 - 1}${r}` : `>= ${t}${r} and <= ${n}${r}`, new
|
|
716
|
+
throw i = a > 3 ? t === 0 || t === BigInt(0) ? `>= 0${r} and < 2${r} ** ${(a + 1) * 8}${r}` : `>= -(2${r} ** ${(a + 1) * 8 - 1}${r}) and < 2 ** ${(a + 1) * 8 - 1}${r}` : `>= ${t}${r} and <= ${n}${r}`, new q.ERR_OUT_OF_RANGE("value", i, e);
|
|
717
717
|
}
|
|
718
|
-
|
|
718
|
+
Y(r, i, a);
|
|
719
719
|
}
|
|
720
720
|
function Z(e, t) {
|
|
721
|
-
if (typeof e != "number") throw new
|
|
721
|
+
if (typeof e != "number") throw new q.ERR_INVALID_ARG_TYPE(t, "number", e);
|
|
722
722
|
}
|
|
723
723
|
function re(e, t, n) {
|
|
724
|
-
throw Math.floor(e) === e ? t < 0 ? new
|
|
724
|
+
throw Math.floor(e) === e ? t < 0 ? new q.ERR_BUFFER_OUT_OF_BOUNDS() : new q.ERR_OUT_OF_RANGE(n || "offset", `>= ${+!!n} and <= ${t}`, e) : (Z(e, n), new q.ERR_OUT_OF_RANGE(n || "offset", "an integer", e));
|
|
725
725
|
}
|
|
726
726
|
let ie = /[^+/0-9A-Za-z-_]/g;
|
|
727
727
|
function ae(e) {
|
|
@@ -1578,6 +1578,7 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
1578
1578
|
})), O = /* @__PURE__ */ t(((e, t) => {
|
|
1579
1579
|
b();
|
|
1580
1580
|
var n = new Set([
|
|
1581
|
+
"cwd",
|
|
1581
1582
|
"getFileByPath",
|
|
1582
1583
|
"setFileByPath",
|
|
1583
1584
|
"deleteFileByPath",
|
|
@@ -1663,79 +1664,79 @@ function j() {
|
|
|
1663
1664
|
throw Error("clearTimeout has not been defined");
|
|
1664
1665
|
}
|
|
1665
1666
|
function M(e) {
|
|
1666
|
-
if (
|
|
1667
|
-
if ((
|
|
1667
|
+
if (z === setTimeout) return setTimeout(e, 0);
|
|
1668
|
+
if ((z === A || !z) && setTimeout) return z = setTimeout, setTimeout(e, 0);
|
|
1668
1669
|
try {
|
|
1669
|
-
return
|
|
1670
|
+
return z(e, 0);
|
|
1670
1671
|
} catch {
|
|
1671
1672
|
try {
|
|
1672
|
-
return
|
|
1673
|
+
return z.call(null, e, 0);
|
|
1673
1674
|
} catch {
|
|
1674
|
-
return
|
|
1675
|
+
return z.call(this, e, 0);
|
|
1675
1676
|
}
|
|
1676
1677
|
}
|
|
1677
1678
|
}
|
|
1678
1679
|
function N(e) {
|
|
1679
|
-
if (
|
|
1680
|
-
if ((
|
|
1680
|
+
if (B === clearTimeout) return clearTimeout(e);
|
|
1681
|
+
if ((B === j || !B) && clearTimeout) return B = clearTimeout, clearTimeout(e);
|
|
1681
1682
|
try {
|
|
1682
|
-
return
|
|
1683
|
+
return B(e);
|
|
1683
1684
|
} catch {
|
|
1684
1685
|
try {
|
|
1685
|
-
return
|
|
1686
|
+
return B.call(null, e);
|
|
1686
1687
|
} catch {
|
|
1687
|
-
return
|
|
1688
|
+
return B.call(this, e);
|
|
1688
1689
|
}
|
|
1689
1690
|
}
|
|
1690
1691
|
}
|
|
1691
1692
|
function P() {
|
|
1692
|
-
!
|
|
1693
|
+
!H || !U || (H = !1, U.length ? V = U.concat(V) : W = -1, V.length && F());
|
|
1693
1694
|
}
|
|
1694
1695
|
function F() {
|
|
1695
|
-
if (!
|
|
1696
|
+
if (!H) {
|
|
1696
1697
|
var e = M(P);
|
|
1697
|
-
|
|
1698
|
-
for (var t =
|
|
1699
|
-
for (
|
|
1700
|
-
|
|
1698
|
+
H = !0;
|
|
1699
|
+
for (var t = V.length; t;) {
|
|
1700
|
+
for (U = V, V = []; ++W < t;) U && U[W].run();
|
|
1701
|
+
W = -1, t = V.length;
|
|
1701
1702
|
}
|
|
1702
|
-
|
|
1703
|
+
U = null, H = !1, N(e);
|
|
1703
1704
|
}
|
|
1704
1705
|
}
|
|
1705
1706
|
function I(e, t) {
|
|
1706
1707
|
this.fun = e, this.array = t;
|
|
1707
1708
|
}
|
|
1708
1709
|
function L() {}
|
|
1709
|
-
var R, z, B, V, H, U, W, G, K,
|
|
1710
|
-
|
|
1710
|
+
var ee, R, z, B, V, H, U, W, G, K, te = e((() => {
|
|
1711
|
+
ee = { exports: {} }, R = ee.exports = {}, (function() {
|
|
1711
1712
|
try {
|
|
1712
|
-
|
|
1713
|
+
z = typeof setTimeout == "function" ? setTimeout : A;
|
|
1713
1714
|
} catch {
|
|
1714
|
-
|
|
1715
|
+
z = A;
|
|
1715
1716
|
}
|
|
1716
1717
|
try {
|
|
1717
|
-
|
|
1718
|
+
B = typeof clearTimeout == "function" ? clearTimeout : j;
|
|
1718
1719
|
} catch {
|
|
1719
|
-
|
|
1720
|
+
B = j;
|
|
1720
1721
|
}
|
|
1721
|
-
})(),
|
|
1722
|
+
})(), V = [], H = !1, W = -1, R.nextTick = function(e) {
|
|
1722
1723
|
var t = Array(arguments.length - 1);
|
|
1723
1724
|
if (arguments.length > 1) for (var n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
|
|
1724
|
-
|
|
1725
|
+
V.push(new I(e, t)), V.length === 1 && !H && M(F);
|
|
1725
1726
|
}, I.prototype.run = function() {
|
|
1726
1727
|
this.fun.apply(null, this.array);
|
|
1727
|
-
},
|
|
1728
|
+
}, R.title = "browser", R.browser = !0, R.env = {}, R.argv = [], R.version = "", R.versions = {}, R.on = L, R.addListener = L, R.once = L, R.off = L, R.removeListener = L, R.removeAllListeners = L, R.emit = L, R.prependListener = L, R.prependOnceListener = L, R.listeners = function(e) {
|
|
1728
1729
|
return [];
|
|
1729
|
-
},
|
|
1730
|
+
}, R.binding = function(e) {
|
|
1730
1731
|
throw Error("process.binding is not supported");
|
|
1731
|
-
},
|
|
1732
|
+
}, R.cwd = function() {
|
|
1732
1733
|
return "/";
|
|
1733
|
-
},
|
|
1734
|
+
}, R.chdir = function(e) {
|
|
1734
1735
|
throw Error("process.chdir is not supported");
|
|
1735
|
-
},
|
|
1736
|
+
}, R.umask = function() {
|
|
1736
1737
|
return 0;
|
|
1737
|
-
},
|
|
1738
|
-
})),
|
|
1738
|
+
}, G = ee.exports, K = /* @__PURE__ */ k(G);
|
|
1739
|
+
})), q = /* @__PURE__ */ t(((e, t) => {
|
|
1739
1740
|
var n = T();
|
|
1740
1741
|
t.exports = class extends n {
|
|
1741
1742
|
get captureInput() {
|
|
@@ -1765,8 +1766,8 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
1765
1766
|
});
|
|
1766
1767
|
}
|
|
1767
1768
|
};
|
|
1768
|
-
})),
|
|
1769
|
-
b(),
|
|
1769
|
+
})), J = /* @__PURE__ */ t(((e, t) => {
|
|
1770
|
+
b(), te();
|
|
1770
1771
|
var { BinaryFile: n, SymlinkRef: r } = O(), i = new Uint8Array([
|
|
1771
1772
|
66,
|
|
1772
1773
|
82,
|
|
@@ -1871,7 +1872,7 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
1871
1872
|
let t = e.$c;
|
|
1872
1873
|
if (m[t]) return m[t];
|
|
1873
1874
|
if (f.inlineCommands && f.inlineCommands[t]) try {
|
|
1874
|
-
let e = T(), n =
|
|
1875
|
+
let e = T(), n = q();
|
|
1875
1876
|
return Function("Command", "InteractiveCommand", `return (${f.inlineCommands[t]});`)(e, n);
|
|
1876
1877
|
} catch {
|
|
1877
1878
|
return null;
|
|
@@ -1903,8 +1904,8 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
1903
1904
|
let t = new DecompressionStream("gzip"), n = new Blob([e]).stream().pipeThrough(t), r = await new Response(n).arrayBuffer();
|
|
1904
1905
|
return new Uint8Array(r);
|
|
1905
1906
|
}
|
|
1906
|
-
if (
|
|
1907
|
-
let t =
|
|
1907
|
+
if (K !== void 0 && typeof K.getBuiltinModule == "function") {
|
|
1908
|
+
let t = K.getBuiltinModule("zlib");
|
|
1908
1909
|
if (t) return new Uint8Array(t.gunzipSync(y.from(e.buffer, e.byteOffset, e.byteLength)));
|
|
1909
1910
|
}
|
|
1910
1911
|
throw Error("Gzip decompression is not supported in this environment");
|
|
@@ -1923,8 +1924,8 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
1923
1924
|
return f(new Uint8Array(n), t);
|
|
1924
1925
|
}
|
|
1925
1926
|
if (typeof e == "string") {
|
|
1926
|
-
if (!/^https?:\/\//i.test(e) &&
|
|
1927
|
-
let n =
|
|
1927
|
+
if (!/^https?:\/\//i.test(e) && K !== void 0 && typeof K.getBuiltinModule == "function" && typeof window > "u") try {
|
|
1928
|
+
let n = K.getBuiltinModule("fs");
|
|
1928
1929
|
if (n && n.existsSync(e)) {
|
|
1929
1930
|
let r = await n.promises.readFile(e);
|
|
1930
1931
|
return f(new Uint8Array(r.buffer, r.byteOffset, r.byteLength), t);
|
|
@@ -2036,7 +2037,7 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2036
2037
|
}
|
|
2037
2038
|
}
|
|
2038
2039
|
};
|
|
2039
|
-
})),
|
|
2040
|
+
})), ne = /* @__PURE__ */ t(((e, t) => {
|
|
2040
2041
|
b();
|
|
2041
2042
|
var n = O(), { BinaryFile: r, SymlinkRef: i } = n;
|
|
2042
2043
|
function a(e) {
|
|
@@ -2061,20 +2062,20 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2061
2062
|
t.exports = class extends n {
|
|
2062
2063
|
constructor(e = "/", t = {}, n = {}, r = null) {
|
|
2063
2064
|
if (super(), t instanceof Uint8Array || t instanceof ArrayBuffer) {
|
|
2064
|
-
let { deserializeBinaryFilesystem: e } =
|
|
2065
|
+
let { deserializeBinaryFilesystem: e } = J(), r = e(t);
|
|
2065
2066
|
t = r.filesystem, n = Object.assign({}, r.permissions, n);
|
|
2066
2067
|
} else if (t && typeof t == "object" && t.filesystem && (t.filesystem instanceof Uint8Array || typeof t.filesystem == "object") && (n = Object.assign({}, t.permissions || {}, n), t = t.filesystem, t instanceof Uint8Array || t instanceof ArrayBuffer)) {
|
|
2067
|
-
let { deserializeBinaryFilesystem: e } =
|
|
2068
|
+
let { deserializeBinaryFilesystem: e } = J(), r = e(t);
|
|
2068
2069
|
t = r.filesystem, n = Object.assign({}, r.permissions, n);
|
|
2069
2070
|
}
|
|
2070
|
-
a(t), this.fileSystem = t, this.permissions = Object.assign({}, n), this.cwd = e, this._onChange = r, this._changeScheduled = !1;
|
|
2071
|
+
a(t), this.fileSystem = t, this.permissions = Object.assign({}, n), this.cwd = e.endsWith("/") ? e : e + "/", this._onChange = r, this._changeScheduled = !1;
|
|
2071
2072
|
}
|
|
2072
2073
|
toBinaryContainer(e = {}) {
|
|
2073
|
-
let { serializeBinaryFilesystem: t } =
|
|
2074
|
+
let { serializeBinaryFilesystem: t } = J();
|
|
2074
2075
|
return t(this.fileSystem, this.permissions, e);
|
|
2075
2076
|
}
|
|
2076
2077
|
static fromBinaryContainer(e, t = {}) {
|
|
2077
|
-
let { deserializeBinaryFilesystem: n } =
|
|
2078
|
+
let { deserializeBinaryFilesystem: n } = J();
|
|
2078
2079
|
return n(e, t);
|
|
2079
2080
|
}
|
|
2080
2081
|
getFileByPath(e) {
|
|
@@ -2114,7 +2115,7 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2114
2115
|
};
|
|
2115
2116
|
}
|
|
2116
2117
|
_pathToAbsolute(e) {
|
|
2117
|
-
return e.startsWith("./") && (e = e.substring(2)), e.startsWith("/") || (e = this.cwd + e), this._traverseComplexAbsolutePath(e);
|
|
2118
|
+
return e.startsWith("./") && (e = e.substring(2)), e.startsWith("/") || (e = (this.cwd && this.cwd.endsWith("/") ? this.cwd : this.cwd ? this.cwd + "/" : "/") + e), this._traverseComplexAbsolutePath(e);
|
|
2118
2119
|
}
|
|
2119
2120
|
_traverseComplexAbsolutePath(e) {
|
|
2120
2121
|
let t = e.split("/");
|
|
@@ -2252,10 +2253,10 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2252
2253
|
return null;
|
|
2253
2254
|
}
|
|
2254
2255
|
}, t.exports.BinaryFile = r, t.exports.SymlinkRef = i;
|
|
2255
|
-
})),
|
|
2256
|
+
})), Y = /* @__PURE__ */ t(((e, t) => {
|
|
2256
2257
|
t.exports = null;
|
|
2257
|
-
})),
|
|
2258
|
-
|
|
2258
|
+
})), X = /* @__PURE__ */ t(((e, t) => {
|
|
2259
|
+
te();
|
|
2259
2260
|
function n(e) {
|
|
2260
2261
|
if (typeof e != "string") throw TypeError("Path must be a string. Received " + JSON.stringify(e));
|
|
2261
2262
|
}
|
|
@@ -2293,7 +2294,7 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2293
2294
|
resolve: function() {
|
|
2294
2295
|
for (var e = "", t = !1, i, a = arguments.length - 1; a >= -1 && !t; a--) {
|
|
2295
2296
|
var o;
|
|
2296
|
-
a >= 0 ? o = arguments[a] : (i === void 0 && (i =
|
|
2297
|
+
a >= 0 ? o = arguments[a] : (i === void 0 && (i = K.cwd()), o = i), n(o), o.length !== 0 && (e = o + "/" + e, t = o.charCodeAt(0) === 47);
|
|
2297
2298
|
}
|
|
2298
2299
|
return e = r(e, !t), t ? e.length > 0 ? "/" + e : "/" : e.length > 0 ? e : ".";
|
|
2299
2300
|
},
|
|
@@ -2424,7 +2425,7 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2424
2425
|
a.posix = a, t.exports = a;
|
|
2425
2426
|
})), Z = /* @__PURE__ */ t(((e, t) => {
|
|
2426
2427
|
b();
|
|
2427
|
-
var n = D(), { BinaryFile: r } =
|
|
2428
|
+
var n = D(), { BinaryFile: r } = ne(), i = 0, a = 8, o = 20, s = 28, c = 31, l = 44, u = 54, d = 70, f = 0, p = 2, m = 3, h = 4, g = 1, _ = 2, v = 4, x = 8, S = 1, C = class extends n {
|
|
2428
2429
|
get name() {
|
|
2429
2430
|
return "wasm";
|
|
2430
2431
|
}
|
|
@@ -2491,7 +2492,7 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2491
2492
|
run() {
|
|
2492
2493
|
let e = this.script, t = (() => {
|
|
2493
2494
|
try {
|
|
2494
|
-
return
|
|
2495
|
+
return Y();
|
|
2495
2496
|
} catch {
|
|
2496
2497
|
return null;
|
|
2497
2498
|
}
|
|
@@ -2597,23 +2598,34 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2597
2598
|
let t = this._keyToBytes(e);
|
|
2598
2599
|
t && L(t);
|
|
2599
2600
|
}, N && this.stdinStream && typeof this.stdinStream.on == "function" && this.stdinStream.on("data", A), N && this.stdin && this.stdin !== this.stdinStream && typeof this.stdin.on == "function" && this.stdin.on("data", A);
|
|
2600
|
-
let
|
|
2601
|
+
let ee = !N && typeof this.stdin == "string" ? b.encode(this.stdin) : !N && this.stdin instanceof Uint8Array ? this.stdin : !N && y !== void 0 && y.isBuffer(this.stdin) ? new Uint8Array(this.stdin) : new Uint8Array(), R = 0, z = this.context && this.context.fs ? this.context.fs : this.fs, B = this.context && this.context.fs && this.context.fs.cwd || this.fs && this.fs.cwd || this.context && typeof this.context.getVar == "function" && this.context.getVar("PWD") || z && z.cwd || "/", V = B.length > 1 && B.endsWith("/") ? B.slice(0, -1) : B, H = 5, U = new Map([[3, {
|
|
2601
2602
|
type: "preopen",
|
|
2602
2603
|
path: "/",
|
|
2603
2604
|
guestName: "/"
|
|
2604
2605
|
}], [4, {
|
|
2605
2606
|
type: "preopen",
|
|
2606
|
-
path:
|
|
2607
|
+
path: V,
|
|
2607
2608
|
guestName: "."
|
|
2608
|
-
}]]),
|
|
2609
|
-
let
|
|
2609
|
+
}]]), W = (e) => {
|
|
2610
|
+
let t = e.split("/").filter(Boolean);
|
|
2611
|
+
return t.pop(), "/" + t.join("/");
|
|
2612
|
+
}, G = (e, t) => {
|
|
2613
|
+
let n = U.get(e);
|
|
2610
2614
|
if (!n || n.type !== "preopen" && n.type !== "dir") return null;
|
|
2611
|
-
if (t.startsWith("/")) return
|
|
2612
|
-
if (!t || t === ".") return
|
|
2613
|
-
let r = n.path.endsWith("/") ? n.path : n.path + "/";
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2615
|
+
if (t.startsWith("/")) return z.absolutePath(t);
|
|
2616
|
+
if (!t || t === ".") return z.absolutePath(n.path);
|
|
2617
|
+
let r = n.path.endsWith("/") ? n.path : n.path + "/", i = z.absolutePath(r + t), a = z.absolutePath("/" + t);
|
|
2618
|
+
if (n.path !== "/") {
|
|
2619
|
+
if (z.exists(i)) return i;
|
|
2620
|
+
if (z.exists(a)) return a;
|
|
2621
|
+
let e = z.exists(W(i));
|
|
2622
|
+
return z.exists(W(a)) && !e ? a : i;
|
|
2623
|
+
}
|
|
2624
|
+
if (z.exists(i)) return i;
|
|
2625
|
+
let o = z.absolutePath(t);
|
|
2626
|
+
return z.exists(o) ? o : i;
|
|
2627
|
+
}, K = (e) => {
|
|
2628
|
+
if (!(!e || e.type !== "file" || !e.dirty || !z)) try {
|
|
2617
2629
|
let t = !0;
|
|
2618
2630
|
for (let n = 0; n < e.bytes.length; n++) if (e.bytes[n] === 0) {
|
|
2619
2631
|
t = !1;
|
|
@@ -2621,20 +2633,20 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2621
2633
|
}
|
|
2622
2634
|
if (t) {
|
|
2623
2635
|
let t = n.decode(e.bytes);
|
|
2624
|
-
|
|
2636
|
+
z.setFileByPath(e.path, t, !0);
|
|
2625
2637
|
} else {
|
|
2626
2638
|
let t = new Uint8Array(e.bytes.length);
|
|
2627
|
-
t.set(e.bytes),
|
|
2639
|
+
t.set(e.bytes), z.setFileByPath(e.path, new r(t.buffer, "application/octet-stream"), !0);
|
|
2628
2640
|
}
|
|
2629
2641
|
e.dirty = !1;
|
|
2630
2642
|
} catch {}
|
|
2631
|
-
},
|
|
2643
|
+
}, te = {
|
|
2632
2644
|
TERM: "xterm-256color",
|
|
2633
2645
|
COLORTERM: "truecolor",
|
|
2634
2646
|
COLUMNS: String(this.stdout && this.stdout.columns || this.context && typeof this.context.getVar == "function" && this.context.getVar("COLUMNS") || 80),
|
|
2635
2647
|
LINES: String(this.stdout && this.stdout.rows || this.context && typeof this.context.getVar == "function" && this.context.getVar("LINES") || 24),
|
|
2636
2648
|
...this.context && this.context.vars || {}
|
|
2637
|
-
},
|
|
2649
|
+
}, q = Object.entries(te).map(([e, t]) => `${e}=${t}`), J = new Proxy({
|
|
2638
2650
|
fd_write: (e, t, r, o) => {
|
|
2639
2651
|
if (!C) return a;
|
|
2640
2652
|
let s = new DataView(C.buffer);
|
|
@@ -2646,7 +2658,7 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2646
2658
|
}
|
|
2647
2659
|
return s.setUint32(o, a, !0), i;
|
|
2648
2660
|
}
|
|
2649
|
-
let c =
|
|
2661
|
+
let c = U.get(e);
|
|
2650
2662
|
if (!c || c.type !== "file") return a;
|
|
2651
2663
|
let l = 0;
|
|
2652
2664
|
for (let e = 0; e < r; e++) {
|
|
@@ -2689,13 +2701,13 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2689
2701
|
}), o.setUint32(r, 0, !0), i;
|
|
2690
2702
|
}
|
|
2691
2703
|
let e = 0;
|
|
2692
|
-
for (let r = 0; r < n &&
|
|
2693
|
-
let n = o.getUint32(t + r * 8, !0), i = o.getUint32(t + r * 8 + 4, !0), a = Math.min(i,
|
|
2694
|
-
new Uint8Array(C.buffer).set(
|
|
2704
|
+
for (let r = 0; r < n && R < ee.length; r++) {
|
|
2705
|
+
let n = o.getUint32(t + r * 8, !0), i = o.getUint32(t + r * 8 + 4, !0), a = Math.min(i, ee.length - R);
|
|
2706
|
+
new Uint8Array(C.buffer).set(ee.slice(R, R + a), n), R += a, e += a;
|
|
2695
2707
|
}
|
|
2696
2708
|
return o.setUint32(r, e, !0), i;
|
|
2697
2709
|
}
|
|
2698
|
-
let s =
|
|
2710
|
+
let s = U.get(e);
|
|
2699
2711
|
if (!s || s.type !== "file") return a;
|
|
2700
2712
|
let c = 0;
|
|
2701
2713
|
for (let e = 0; e < n && s.pos < s.bytes.length; e++) {
|
|
@@ -2707,7 +2719,7 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2707
2719
|
fd_seek: (e, t, n, r, o) => {
|
|
2708
2720
|
if (!C) return a;
|
|
2709
2721
|
if (e <= 2) return d;
|
|
2710
|
-
let c =
|
|
2722
|
+
let c = U.get(e);
|
|
2711
2723
|
if (!c || c.type !== "file") return a;
|
|
2712
2724
|
let l, u, f;
|
|
2713
2725
|
typeof t == "bigint" ? (l = Number(t), u = n, f = r) : (l = t, u = r, f = o);
|
|
@@ -2720,32 +2732,32 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2720
2732
|
},
|
|
2721
2733
|
fd_tell: (e, t) => {
|
|
2722
2734
|
if (!C) return a;
|
|
2723
|
-
let n =
|
|
2735
|
+
let n = U.get(e);
|
|
2724
2736
|
return !n || n.type !== "file" ? a : (new DataView(C.buffer).setBigUint64(t, BigInt(n.pos), !0), i);
|
|
2725
2737
|
},
|
|
2726
2738
|
fd_close: (e) => {
|
|
2727
2739
|
if (e <= 2) return i;
|
|
2728
|
-
let t =
|
|
2729
|
-
return t ? (
|
|
2740
|
+
let t = U.get(e);
|
|
2741
|
+
return t ? (K(t), U.delete(e), i) : a;
|
|
2730
2742
|
},
|
|
2731
2743
|
fd_sync: (e) => {
|
|
2732
|
-
let t =
|
|
2733
|
-
return t &&
|
|
2744
|
+
let t = U.get(e);
|
|
2745
|
+
return t && K(t), i;
|
|
2734
2746
|
},
|
|
2735
2747
|
fd_datasync: (e) => {
|
|
2736
|
-
let t =
|
|
2737
|
-
return t &&
|
|
2748
|
+
let t = U.get(e);
|
|
2749
|
+
return t && K(t), i;
|
|
2738
2750
|
},
|
|
2739
2751
|
fd_prestat_get: (e, t) => {
|
|
2740
2752
|
if (!C) return a;
|
|
2741
|
-
let n =
|
|
2753
|
+
let n = U.get(e);
|
|
2742
2754
|
if (!n || n.type !== "preopen") return a;
|
|
2743
2755
|
let r = new DataView(C.buffer), o = b.encode(n.guestName);
|
|
2744
2756
|
return r.setUint8(t, 0), r.setUint32(t + 4, o.length, !0), i;
|
|
2745
2757
|
},
|
|
2746
2758
|
fd_prestat_dir_name: (e, t, n) => {
|
|
2747
2759
|
if (!C) return a;
|
|
2748
|
-
let r =
|
|
2760
|
+
let r = U.get(e);
|
|
2749
2761
|
if (!r || r.type !== "preopen") return a;
|
|
2750
2762
|
let o = b.encode(r.guestName);
|
|
2751
2763
|
return new Uint8Array(C.buffer, t, Math.min(n, o.length)).set(o.subarray(0, n)), i;
|
|
@@ -2755,7 +2767,7 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2755
2767
|
let n = new DataView(C.buffer), r = f;
|
|
2756
2768
|
if (e <= 2) r = p;
|
|
2757
2769
|
else {
|
|
2758
|
-
let t =
|
|
2770
|
+
let t = U.get(e);
|
|
2759
2771
|
if (!t) return a;
|
|
2760
2772
|
r = t.type === "preopen" || t.type === "dir" ? m : h;
|
|
2761
2773
|
}
|
|
@@ -2768,22 +2780,22 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2768
2780
|
let n = new DataView(C.buffer);
|
|
2769
2781
|
for (let e = 0; e < 64; e++) n.setUint8(t + e, 0);
|
|
2770
2782
|
if (e <= 2) return n.setUint8(t + 16, p), i;
|
|
2771
|
-
let r =
|
|
2783
|
+
let r = U.get(e);
|
|
2772
2784
|
if (!r) return a;
|
|
2773
2785
|
let o = r.type === "preopen" || r.type === "dir";
|
|
2774
2786
|
return n.setUint8(t + 16, o ? m : h), n.setBigUint64(t + 24, 1n, !0), n.setBigUint64(t + 32, BigInt(r.bytes ? r.bytes.length : 0), !0), i;
|
|
2775
2787
|
},
|
|
2776
2788
|
path_open: (e, t, r, s, d, f, p, m, h) => {
|
|
2777
|
-
if (!C || !
|
|
2778
|
-
let y =
|
|
2789
|
+
if (!C || !z) return a;
|
|
2790
|
+
let y = G(e, n.decode(new Uint8Array(C.buffer, r, s)));
|
|
2779
2791
|
if (!y) return a;
|
|
2780
|
-
let w =
|
|
2792
|
+
let w = z.stat(y), T = w !== null;
|
|
2781
2793
|
if (d & v && d & g && T) return o;
|
|
2782
2794
|
if (d & _) {
|
|
2783
2795
|
if (!T) return l;
|
|
2784
2796
|
if (!w.isDirectory) return u;
|
|
2785
|
-
let e =
|
|
2786
|
-
return
|
|
2797
|
+
let e = H++;
|
|
2798
|
+
return U.set(e, {
|
|
2787
2799
|
type: "dir",
|
|
2788
2800
|
path: y
|
|
2789
2801
|
}), new DataView(C.buffer).setUint32(h, e, !0), i;
|
|
@@ -2792,11 +2804,11 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2792
2804
|
if (!T && !(d & g)) return l;
|
|
2793
2805
|
let E = new Uint8Array(), D = !1;
|
|
2794
2806
|
if (T && !(d & x)) {
|
|
2795
|
-
let e =
|
|
2807
|
+
let e = z.getFileByPath(y);
|
|
2796
2808
|
e != null && (E = typeof e == "string" ? b.encode(e) : new Uint8Array(this._contentToBytes(e)));
|
|
2797
2809
|
} else D = !0;
|
|
2798
|
-
let O =
|
|
2799
|
-
return
|
|
2810
|
+
let O = H++;
|
|
2811
|
+
return U.set(O, {
|
|
2800
2812
|
type: "file",
|
|
2801
2813
|
path: y,
|
|
2802
2814
|
bytes: E,
|
|
@@ -2806,54 +2818,54 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2806
2818
|
}), new DataView(C.buffer).setUint32(h, O, !0), i;
|
|
2807
2819
|
},
|
|
2808
2820
|
path_filestat_get: (e, t, r, o, s) => {
|
|
2809
|
-
if (!C || !
|
|
2810
|
-
let c =
|
|
2821
|
+
if (!C || !z) return a;
|
|
2822
|
+
let c = G(e, n.decode(new Uint8Array(C.buffer, r, o)));
|
|
2811
2823
|
if (!c) return a;
|
|
2812
|
-
let u =
|
|
2824
|
+
let u = z.stat(c);
|
|
2813
2825
|
if (!u) return l;
|
|
2814
2826
|
let d = new DataView(C.buffer);
|
|
2815
2827
|
for (let e = 0; e < 64; e++) d.setUint8(s + e, 0);
|
|
2816
|
-
return d.setUint8(s + 16, u.isDirectory ? m : h), d.setBigUint64(s + 24, 1n, !0), d.setBigUint64(s + 32, BigInt(
|
|
2828
|
+
return d.setUint8(s + 16, u.isDirectory ? m : h), d.setBigUint64(s + 24, 1n, !0), d.setBigUint64(s + 32, BigInt(z.getSize(c) || 0), !0), i;
|
|
2817
2829
|
},
|
|
2818
2830
|
path_create_directory: (e, t, r) => {
|
|
2819
|
-
if (!C || !
|
|
2820
|
-
let o =
|
|
2831
|
+
if (!C || !z) return a;
|
|
2832
|
+
let o = G(e, n.decode(new Uint8Array(C.buffer, t, r)));
|
|
2821
2833
|
if (!o) return a;
|
|
2822
2834
|
try {
|
|
2823
|
-
return
|
|
2835
|
+
return z.setFileByPath(o, {}, !0), i;
|
|
2824
2836
|
} catch {
|
|
2825
2837
|
return s;
|
|
2826
2838
|
}
|
|
2827
2839
|
},
|
|
2828
2840
|
path_unlink_file: (e, t, r) => {
|
|
2829
|
-
if (!C || !
|
|
2830
|
-
let o =
|
|
2831
|
-
if (!o || !
|
|
2841
|
+
if (!C || !z) return a;
|
|
2842
|
+
let o = G(e, n.decode(new Uint8Array(C.buffer, t, r)));
|
|
2843
|
+
if (!o || !z.exists(o)) return l;
|
|
2832
2844
|
try {
|
|
2833
|
-
return
|
|
2845
|
+
return z.deleteFileByPath(o), i;
|
|
2834
2846
|
} catch {
|
|
2835
2847
|
return s;
|
|
2836
2848
|
}
|
|
2837
2849
|
},
|
|
2838
2850
|
path_remove_directory: (e, t, r) => {
|
|
2839
|
-
if (!C || !
|
|
2840
|
-
let o =
|
|
2841
|
-
if (!o || !
|
|
2851
|
+
if (!C || !z) return a;
|
|
2852
|
+
let o = G(e, n.decode(new Uint8Array(C.buffer, t, r)));
|
|
2853
|
+
if (!o || !z.exists(o)) return l;
|
|
2842
2854
|
try {
|
|
2843
|
-
return
|
|
2855
|
+
return z.deleteFileByPath(o), i;
|
|
2844
2856
|
} catch {
|
|
2845
2857
|
return s;
|
|
2846
2858
|
}
|
|
2847
2859
|
},
|
|
2848
2860
|
path_rename: (e, t, r, o, c, u) => {
|
|
2849
|
-
if (!C || !
|
|
2850
|
-
let d = n.decode(new Uint8Array(C.buffer, t, r)), f = n.decode(new Uint8Array(C.buffer, c, u)), p =
|
|
2861
|
+
if (!C || !z) return a;
|
|
2862
|
+
let d = n.decode(new Uint8Array(C.buffer, t, r)), f = n.decode(new Uint8Array(C.buffer, c, u)), p = G(e, d), m = G(o, f);
|
|
2851
2863
|
if (!p || !m) return a;
|
|
2852
|
-
if (!
|
|
2853
|
-
for (let e of
|
|
2864
|
+
if (!z.exists(p)) return l;
|
|
2865
|
+
for (let e of U.values()) e.path === p && (K(e), e.path = m);
|
|
2854
2866
|
try {
|
|
2855
|
-
let e =
|
|
2856
|
-
return
|
|
2867
|
+
let e = z.getFileByPath(p);
|
|
2868
|
+
return z.setFileByPath(m, e, !0), z.deleteFileByPath(p), i;
|
|
2857
2869
|
} catch {
|
|
2858
2870
|
return s;
|
|
2859
2871
|
}
|
|
@@ -2882,16 +2894,16 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2882
2894
|
environ_sizes_get: (e, t) => {
|
|
2883
2895
|
if (!C) return s;
|
|
2884
2896
|
let n = new DataView(C.buffer);
|
|
2885
|
-
n.setUint32(e,
|
|
2886
|
-
let r =
|
|
2897
|
+
n.setUint32(e, q.length, !0);
|
|
2898
|
+
let r = q.reduce((e, t) => e + b.encode(t).length + 1, 0);
|
|
2887
2899
|
return n.setUint32(t, r, !0), i;
|
|
2888
2900
|
},
|
|
2889
2901
|
environ_get: (e, t) => {
|
|
2890
2902
|
if (!C) return s;
|
|
2891
2903
|
let n = new DataView(C.buffer), r = t;
|
|
2892
|
-
for (let t = 0; t <
|
|
2904
|
+
for (let t = 0; t < q.length; t++) {
|
|
2893
2905
|
n.setUint32(e + t * 4, r, !0);
|
|
2894
|
-
let i = b.encode(
|
|
2906
|
+
let i = b.encode(q[t] + "\0");
|
|
2895
2907
|
new Uint8Array(C.buffer).set(i, r), r += i.length;
|
|
2896
2908
|
}
|
|
2897
2909
|
return i;
|
|
@@ -2912,7 +2924,7 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2912
2924
|
}
|
|
2913
2925
|
}, { get(e, t) {
|
|
2914
2926
|
return t in e ? e[t] : () => 0;
|
|
2915
|
-
} }),
|
|
2927
|
+
} }), ne = (e) => {
|
|
2916
2928
|
if (!C || !e) return "";
|
|
2917
2929
|
try {
|
|
2918
2930
|
let t = new DataView(C.buffer).getUint32(e - 4, !0), n = new Uint16Array(C.buffer, e, t >>> 1);
|
|
@@ -2921,8 +2933,8 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2921
2933
|
return "";
|
|
2922
2934
|
}
|
|
2923
2935
|
}, Y = {
|
|
2924
|
-
wasi_snapshot_preview1:
|
|
2925
|
-
wasi_unstable:
|
|
2936
|
+
wasi_snapshot_preview1: J,
|
|
2937
|
+
wasi_unstable: J,
|
|
2926
2938
|
env: new Proxy({
|
|
2927
2939
|
print: (e, t) => {
|
|
2928
2940
|
C && P(1, n.decode(new Uint8Array(C.buffer, e, t)));
|
|
@@ -2931,7 +2943,7 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2931
2943
|
C && P(2, n.decode(new Uint8Array(C.buffer, e, t)));
|
|
2932
2944
|
},
|
|
2933
2945
|
log: (e) => {
|
|
2934
|
-
P(1,
|
|
2946
|
+
P(1, ne(e) + "\n");
|
|
2935
2947
|
},
|
|
2936
2948
|
logi: (e) => {
|
|
2937
2949
|
P(1, String(e) + "\n");
|
|
@@ -2941,11 +2953,11 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
2941
2953
|
},
|
|
2942
2954
|
trace: (e, t, ...n) => {
|
|
2943
2955
|
let r = t > 0 ? " " + n.slice(0, t).join(", ") : "";
|
|
2944
|
-
P(1, `trace: ${
|
|
2956
|
+
P(1, `trace: ${ne(e)}${r}\n`);
|
|
2945
2957
|
},
|
|
2946
2958
|
seed: () => Date.now() * Math.random(),
|
|
2947
2959
|
abort: (e, t, n, r) => {
|
|
2948
|
-
let i =
|
|
2960
|
+
let i = ne(e), a = ne(t);
|
|
2949
2961
|
throw (i || a) && P(2, `abort: ${i || "aborted"} at ${a || this.script}:${n || 0}:${r || 0}\n`), this.exitCode = 134, {
|
|
2950
2962
|
_wasmExit: !0,
|
|
2951
2963
|
code: 134
|
|
@@ -3001,7 +3013,7 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
3001
3013
|
(!e || !e._wasmExit) && (this.stdErr = `${this.script}: ${e?.message || String(e)}`, this.exitCode = 1);
|
|
3002
3014
|
} finally {
|
|
3003
3015
|
N && this._exitAltScreen(), N && A && (this.stdinStream && typeof this.stdinStream.off == "function" && this.stdinStream.off("data", A), this.stdin && typeof this.stdin.off == "function" && this.stdin.off("data", A)), k && (this.stdout && typeof this.stdout.off == "function" && this.stdout.off("resize", k), this.stdinStream && typeof this.stdinStream.off == "function" && this.stdinStream.off("resize", k)), this._externalKeyHandler = null;
|
|
3004
|
-
for (let e of
|
|
3016
|
+
for (let e of U.values()) K(e);
|
|
3005
3017
|
}
|
|
3006
3018
|
F();
|
|
3007
3019
|
let X = this.arguments || [];
|
|
@@ -3021,7 +3033,7 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
3021
3033
|
function T(e, t) {
|
|
3022
3034
|
if (!e || !e.exists(t)) return null;
|
|
3023
3035
|
if (e.isRealFilesystem) try {
|
|
3024
|
-
let n =
|
|
3036
|
+
let n = Y();
|
|
3025
3037
|
return new Uint8Array(n.readFileSync(e.absolutePath(t)));
|
|
3026
3038
|
} catch {}
|
|
3027
3039
|
let n = e.getFileByPath(t);
|
|
@@ -3050,7 +3062,7 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
3050
3062
|
o.set(a);
|
|
3051
3063
|
let s = new r(o.buffer, i);
|
|
3052
3064
|
if (e.isRealFilesystem) try {
|
|
3053
|
-
let n =
|
|
3065
|
+
let n = Y(), r = X(), i = e.absolutePath(t);
|
|
3054
3066
|
n.mkdirSync(r.dirname(i), { recursive: !0 }), n.writeFileSync(i, y.from(a.buffer, a.byteOffset, a.byteLength));
|
|
3055
3067
|
return;
|
|
3056
3068
|
} catch {
|
|
@@ -3424,7 +3436,7 @@ var R, z, B, V, H, U, W, G, K, q, J = e((() => {
|
|
|
3424
3436
|
}
|
|
3425
3437
|
C.readBytesFromFs = T, C.writeBytesToFs = O, C.loadModule = k, C.extractHelpFromText = A, C.inspectWasmBytes = j, C.formatWasmHelp = M, C.createGenericWasmCommand = N, C.createCommand = N, t.exports = C;
|
|
3426
3438
|
})), re = /* @__PURE__ */ t(((e, t) => {
|
|
3427
|
-
var n =
|
|
3439
|
+
var n = q(), { createGenericWasmCommand: r } = Z(), i = "\x1B[2J\x1B[H", a = "\x1B[0m", o = "\x1B[7m", s = "\x1B[1m", c = "\x1B[2m", l = "\x1B[36m", u = "\x1B[31m", d = "\x1B[32m", f = class extends n {
|
|
3428
3440
|
get requiresFilesystem() {
|
|
3429
3441
|
return !0;
|
|
3430
3442
|
}
|