@ggui-ai/ui-gen 0.6.0 → 0.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.
@@ -4822,7 +4822,7 @@ var init_cost_tracker = __esm({
4822
4822
 
4823
4823
  // ../../node_modules/ms/index.js
4824
4824
  var require_ms = __commonJS({
4825
- "../../node_modules/ms/index.js"(exports$1, module) {
4825
+ "../../node_modules/ms/index.js"(exports, module) {
4826
4826
  var s = 1e3;
4827
4827
  var m = s * 60;
4828
4828
  var h = m * 60;
@@ -4938,7 +4938,7 @@ var require_ms = __commonJS({
4938
4938
 
4939
4939
  // ../../node_modules/debug/src/common.js
4940
4940
  var require_common = __commonJS({
4941
- "../../node_modules/debug/src/common.js"(exports$1, module) {
4941
+ "../../node_modules/debug/src/common.js"(exports, module) {
4942
4942
  function setup(env) {
4943
4943
  createDebug.debug = createDebug;
4944
4944
  createDebug.default = createDebug;
@@ -5115,13 +5115,13 @@ var require_common = __commonJS({
5115
5115
 
5116
5116
  // ../../node_modules/debug/src/browser.js
5117
5117
  var require_browser = __commonJS({
5118
- "../../node_modules/debug/src/browser.js"(exports$1, module) {
5119
- exports$1.formatArgs = formatArgs;
5120
- exports$1.save = save;
5121
- exports$1.load = load;
5122
- exports$1.useColors = useColors;
5123
- exports$1.storage = localstorage();
5124
- exports$1.destroy = /* @__PURE__ */ (() => {
5118
+ "../../node_modules/debug/src/browser.js"(exports, module) {
5119
+ exports.formatArgs = formatArgs;
5120
+ exports.save = save;
5121
+ exports.load = load;
5122
+ exports.useColors = useColors;
5123
+ exports.storage = localstorage();
5124
+ exports.destroy = /* @__PURE__ */ (() => {
5125
5125
  let warned = false;
5126
5126
  return () => {
5127
5127
  if (!warned) {
@@ -5130,7 +5130,7 @@ var require_browser = __commonJS({
5130
5130
  }
5131
5131
  };
5132
5132
  })();
5133
- exports$1.colors = [
5133
+ exports.colors = [
5134
5134
  "#0000CC",
5135
5135
  "#0000FF",
5136
5136
  "#0033CC",
@@ -5242,14 +5242,14 @@ var require_browser = __commonJS({
5242
5242
  });
5243
5243
  args.splice(lastC, 0, c);
5244
5244
  }
5245
- exports$1.log = console.debug || console.log || (() => {
5245
+ exports.log = console.debug || console.log || (() => {
5246
5246
  });
5247
5247
  function save(namespaces) {
5248
5248
  try {
5249
5249
  if (namespaces) {
5250
- exports$1.storage.setItem("debug", namespaces);
5250
+ exports.storage.setItem("debug", namespaces);
5251
5251
  } else {
5252
- exports$1.storage.removeItem("debug");
5252
+ exports.storage.removeItem("debug");
5253
5253
  }
5254
5254
  } catch (error) {
5255
5255
  }
@@ -5257,7 +5257,7 @@ var require_browser = __commonJS({
5257
5257
  function load() {
5258
5258
  let r;
5259
5259
  try {
5260
- r = exports$1.storage.getItem("debug") || exports$1.storage.getItem("DEBUG");
5260
+ r = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG");
5261
5261
  } catch (error) {
5262
5262
  }
5263
5263
  if (!r && typeof process !== "undefined" && "env" in process) {
@@ -5271,7 +5271,7 @@ var require_browser = __commonJS({
5271
5271
  } catch (error) {
5272
5272
  }
5273
5273
  }
5274
- module.exports = require_common()(exports$1);
5274
+ module.exports = require_common()(exports);
5275
5275
  var { formatters } = module.exports;
5276
5276
  formatters.j = function(v) {
5277
5277
  try {
@@ -5285,7 +5285,7 @@ var require_browser = __commonJS({
5285
5285
 
5286
5286
  // ../../node_modules/has-flag/index.js
5287
5287
  var require_has_flag = __commonJS({
5288
- "../../node_modules/has-flag/index.js"(exports$1, module) {
5288
+ "../../node_modules/has-flag/index.js"(exports, module) {
5289
5289
  module.exports = (flag, argv = process.argv) => {
5290
5290
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
5291
5291
  const position = argv.indexOf(prefix + flag);
@@ -5297,7 +5297,7 @@ var require_has_flag = __commonJS({
5297
5297
 
5298
5298
  // ../../node_modules/supports-color/index.js
5299
5299
  var require_supports_color = __commonJS({
5300
- "../../node_modules/supports-color/index.js"(exports$1, module) {
5300
+ "../../node_modules/supports-color/index.js"(exports, module) {
5301
5301
  var os = __require("os");
5302
5302
  var tty = __require("tty");
5303
5303
  var hasFlag = require_has_flag();
@@ -5398,25 +5398,25 @@ var require_supports_color = __commonJS({
5398
5398
 
5399
5399
  // ../../node_modules/debug/src/node.js
5400
5400
  var require_node = __commonJS({
5401
- "../../node_modules/debug/src/node.js"(exports$1, module) {
5401
+ "../../node_modules/debug/src/node.js"(exports, module) {
5402
5402
  var tty = __require("tty");
5403
5403
  var util = __require("util");
5404
- exports$1.init = init;
5405
- exports$1.log = log;
5406
- exports$1.formatArgs = formatArgs;
5407
- exports$1.save = save;
5408
- exports$1.load = load;
5409
- exports$1.useColors = useColors;
5410
- exports$1.destroy = util.deprecate(
5404
+ exports.init = init;
5405
+ exports.log = log;
5406
+ exports.formatArgs = formatArgs;
5407
+ exports.save = save;
5408
+ exports.load = load;
5409
+ exports.useColors = useColors;
5410
+ exports.destroy = util.deprecate(
5411
5411
  () => {
5412
5412
  },
5413
5413
  "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
5414
5414
  );
5415
- exports$1.colors = [6, 2, 3, 4, 5, 1];
5415
+ exports.colors = [6, 2, 3, 4, 5, 1];
5416
5416
  try {
5417
5417
  const supportsColor = require_supports_color();
5418
5418
  if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
5419
- exports$1.colors = [
5419
+ exports.colors = [
5420
5420
  20,
5421
5421
  21,
5422
5422
  26,
@@ -5497,7 +5497,7 @@ var require_node = __commonJS({
5497
5497
  }
5498
5498
  } catch (error) {
5499
5499
  }
5500
- exports$1.inspectOpts = Object.keys(process.env).filter((key) => {
5500
+ exports.inspectOpts = Object.keys(process.env).filter((key) => {
5501
5501
  return /^debug_/i.test(key);
5502
5502
  }).reduce((obj, key) => {
5503
5503
  const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
@@ -5517,7 +5517,7 @@ var require_node = __commonJS({
5517
5517
  return obj;
5518
5518
  }, {});
5519
5519
  function useColors() {
5520
- return "colors" in exports$1.inspectOpts ? Boolean(exports$1.inspectOpts.colors) : tty.isatty(process.stderr.fd);
5520
+ return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
5521
5521
  }
5522
5522
  function formatArgs(args) {
5523
5523
  const { namespace: name, useColors: useColors2 } = this;
@@ -5532,13 +5532,13 @@ var require_node = __commonJS({
5532
5532
  }
5533
5533
  }
5534
5534
  function getDate() {
5535
- if (exports$1.inspectOpts.hideDate) {
5535
+ if (exports.inspectOpts.hideDate) {
5536
5536
  return "";
5537
5537
  }
5538
5538
  return (/* @__PURE__ */ new Date()).toISOString() + " ";
5539
5539
  }
5540
5540
  function log(...args) {
5541
- return process.stderr.write(util.formatWithOptions(exports$1.inspectOpts, ...args) + "\n");
5541
+ return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + "\n");
5542
5542
  }
5543
5543
  function save(namespaces) {
5544
5544
  if (namespaces) {
@@ -5552,12 +5552,12 @@ var require_node = __commonJS({
5552
5552
  }
5553
5553
  function init(debug) {
5554
5554
  debug.inspectOpts = {};
5555
- const keys = Object.keys(exports$1.inspectOpts);
5555
+ const keys = Object.keys(exports.inspectOpts);
5556
5556
  for (let i = 0; i < keys.length; i++) {
5557
- debug.inspectOpts[keys[i]] = exports$1.inspectOpts[keys[i]];
5557
+ debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
5558
5558
  }
5559
5559
  }
5560
- module.exports = require_common()(exports$1);
5560
+ module.exports = require_common()(exports);
5561
5561
  var { formatters } = module.exports;
5562
5562
  formatters.o = function(v) {
5563
5563
  this.inspectOpts.colors = this.useColors;
@@ -5572,7 +5572,7 @@ var require_node = __commonJS({
5572
5572
 
5573
5573
  // ../../node_modules/debug/src/index.js
5574
5574
  var require_src = __commonJS({
5575
- "../../node_modules/debug/src/index.js"(exports$1, module) {
5575
+ "../../node_modules/debug/src/index.js"(exports, module) {
5576
5576
  if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
5577
5577
  module.exports = require_browser();
5578
5578
  } else {
@@ -5583,7 +5583,7 @@ var require_src = __commonJS({
5583
5583
 
5584
5584
  // ../../node_modules/follow-redirects/debug.js
5585
5585
  var require_debug = __commonJS({
5586
- "../../node_modules/follow-redirects/debug.js"(exports$1, module) {
5586
+ "../../node_modules/follow-redirects/debug.js"(exports, module) {
5587
5587
  var debug;
5588
5588
  module.exports = function() {
5589
5589
  if (!debug) {
@@ -5603,7 +5603,7 @@ var require_debug = __commonJS({
5603
5603
 
5604
5604
  // ../../node_modules/follow-redirects/index.js
5605
5605
  var require_follow_redirects = __commonJS({
5606
- "../../node_modules/follow-redirects/index.js"(exports$1, module) {
5606
+ "../../node_modules/follow-redirects/index.js"(exports, module) {
5607
5607
  var url = __require("url");
5608
5608
  var URL2 = url.URL;
5609
5609
  var http = __require("http");
@@ -6114,14 +6114,14 @@ var require_follow_redirects = __commonJS({
6114
6114
 
6115
6115
  // ../../node_modules/events-universal/default.js
6116
6116
  var require_default = __commonJS({
6117
- "../../node_modules/events-universal/default.js"(exports$1, module) {
6117
+ "../../node_modules/events-universal/default.js"(exports, module) {
6118
6118
  module.exports = __require("events");
6119
6119
  }
6120
6120
  });
6121
6121
 
6122
6122
  // ../../node_modules/fast-fifo/fixed-size.js
6123
6123
  var require_fixed_size = __commonJS({
6124
- "../../node_modules/fast-fifo/fixed-size.js"(exports$1, module) {
6124
+ "../../node_modules/fast-fifo/fixed-size.js"(exports, module) {
6125
6125
  module.exports = class FixedFIFO {
6126
6126
  constructor(hwm) {
6127
6127
  if (!(hwm > 0) || (hwm - 1 & hwm) !== 0) throw new Error("Max size for a FixedFIFO should be a power of two");
@@ -6161,7 +6161,7 @@ var require_fixed_size = __commonJS({
6161
6161
 
6162
6162
  // ../../node_modules/fast-fifo/index.js
6163
6163
  var require_fast_fifo = __commonJS({
6164
- "../../node_modules/fast-fifo/index.js"(exports$1, module) {
6164
+ "../../node_modules/fast-fifo/index.js"(exports, module) {
6165
6165
  var FixedFIFO = require_fixed_size();
6166
6166
  module.exports = class FastFIFO {
6167
6167
  constructor(hwm) {
@@ -6208,7 +6208,7 @@ var require_fast_fifo = __commonJS({
6208
6208
 
6209
6209
  // ../../node_modules/b4a/index.js
6210
6210
  var require_b4a = __commonJS({
6211
- "../../node_modules/b4a/index.js"(exports$1, module) {
6211
+ "../../node_modules/b4a/index.js"(exports, module) {
6212
6212
  function isBuffer(value) {
6213
6213
  return Buffer.isBuffer(value) || value instanceof Uint8Array;
6214
6214
  }
@@ -6365,7 +6365,7 @@ var require_b4a = __commonJS({
6365
6365
 
6366
6366
  // ../../node_modules/text-decoder/lib/pass-through-decoder.js
6367
6367
  var require_pass_through_decoder = __commonJS({
6368
- "../../node_modules/text-decoder/lib/pass-through-decoder.js"(exports$1, module) {
6368
+ "../../node_modules/text-decoder/lib/pass-through-decoder.js"(exports, module) {
6369
6369
  var b4a = require_b4a();
6370
6370
  module.exports = class PassThroughDecoder {
6371
6371
  constructor(encoding) {
@@ -6386,7 +6386,7 @@ var require_pass_through_decoder = __commonJS({
6386
6386
 
6387
6387
  // ../../node_modules/text-decoder/lib/utf8-decoder.js
6388
6388
  var require_utf8_decoder = __commonJS({
6389
- "../../node_modules/text-decoder/lib/utf8-decoder.js"(exports$1, module) {
6389
+ "../../node_modules/text-decoder/lib/utf8-decoder.js"(exports, module) {
6390
6390
  var b4a = require_b4a();
6391
6391
  module.exports = class UTF8Decoder {
6392
6392
  constructor() {
@@ -6533,7 +6533,7 @@ var require_utf8_decoder = __commonJS({
6533
6533
 
6534
6534
  // ../../node_modules/text-decoder/index.js
6535
6535
  var require_text_decoder = __commonJS({
6536
- "../../node_modules/text-decoder/index.js"(exports$1, module) {
6536
+ "../../node_modules/text-decoder/index.js"(exports, module) {
6537
6537
  var PassThroughDecoder = require_pass_through_decoder();
6538
6538
  var UTF8Decoder = require_utf8_decoder();
6539
6539
  module.exports = class TextDecoder {
@@ -6593,14 +6593,55 @@ var require_text_decoder = __commonJS({
6593
6593
  }
6594
6594
  });
6595
6595
 
6596
+ // ../../node_modules/streamx/lib/errors.js
6597
+ var require_errors = __commonJS({
6598
+ "../../node_modules/streamx/lib/errors.js"(exports, module) {
6599
+ module.exports = class StreamError extends Error {
6600
+ constructor(msg, code, fn = StreamError) {
6601
+ super(msg);
6602
+ this.code = code;
6603
+ if (Error.captureStackTrace) {
6604
+ Error.captureStackTrace(this, fn);
6605
+ }
6606
+ }
6607
+ static isStreamDestroyed(err) {
6608
+ return err && err.code === "STREAM_DESTROYED";
6609
+ }
6610
+ static isPrematureClose(err) {
6611
+ return err && err.code === "PREMATURE_CLOSE";
6612
+ }
6613
+ static isAborted(err) {
6614
+ return err && err.code === "ABORTED";
6615
+ }
6616
+ static isBadArgument(err) {
6617
+ return err && err.code === "BAD_ARGUMENT";
6618
+ }
6619
+ get name() {
6620
+ return "StreamError";
6621
+ }
6622
+ static STREAM_DESTROYED() {
6623
+ return new StreamError("Stream was destroyed", "STREAM_DESTROYED", StreamError.STREAM_DESTROYED);
6624
+ }
6625
+ static PREMATURE_CLOSE(msg = "Premature close") {
6626
+ return new StreamError(msg, "PREMATURE_CLOSE", StreamError.PREMATURE_CLOSE);
6627
+ }
6628
+ static ABORTED() {
6629
+ return new StreamError("Stream aborted", "ABORTED", StreamError.ABORTED);
6630
+ }
6631
+ static BAD_ARGUMENT(msg = "Bad argument") {
6632
+ return new StreamError(msg, "BAD_ARGUMENT", StreamError.BAD_ARGUMENT);
6633
+ }
6634
+ };
6635
+ }
6636
+ });
6637
+
6596
6638
  // ../../node_modules/streamx/index.js
6597
6639
  var require_streamx = __commonJS({
6598
- "../../node_modules/streamx/index.js"(exports$1, module) {
6640
+ "../../node_modules/streamx/index.js"(exports, module) {
6599
6641
  var { EventEmitter } = require_default();
6600
- var STREAM_DESTROYED = new Error("Stream was destroyed");
6601
- var PREMATURE_CLOSE = new Error("Premature close");
6602
6642
  var FIFO = require_fast_fifo();
6603
6643
  var TextDecoder2 = require_text_decoder();
6644
+ var StreamError = require_errors();
6604
6645
  var qmt = typeof queueMicrotask === "undefined" ? (fn) => global.process.nextTick(fn) : queueMicrotask;
6605
6646
  var MAX = (1 << 29) - 1;
6606
6647
  var OPENING = 1;
@@ -6728,8 +6769,11 @@ var require_streamx = __commonJS({
6728
6769
  return data;
6729
6770
  }
6730
6771
  end(data) {
6731
- if (typeof data === "function") this.stream.once("finish", data);
6732
- else if (data !== void 0 && data !== null) this.push(data);
6772
+ if (typeof data === "function") {
6773
+ this.stream.once("finish", data);
6774
+ } else if (data !== void 0 && data !== null) {
6775
+ this.push(data);
6776
+ }
6733
6777
  this.stream._duplexState = (this.stream._duplexState | WRITE_FINISHING) & WRITE_NON_PRIMARY;
6734
6778
  }
6735
6779
  autoBatch(data, cb) {
@@ -6780,8 +6824,11 @@ var require_streamx = __commonJS({
6780
6824
  return true;
6781
6825
  }
6782
6826
  updateCallback() {
6783
- if ((this.stream._duplexState & WRITE_UPDATE_SYNC_STATUS) === WRITE_PRIMARY) this.update();
6784
- else this.updateNextTick();
6827
+ if ((this.stream._duplexState & WRITE_UPDATE_SYNC_STATUS) === WRITE_PRIMARY) {
6828
+ this.update();
6829
+ } else {
6830
+ this.updateNextTick();
6831
+ }
6785
6832
  }
6786
6833
  updateNextTick() {
6787
6834
  if ((this.stream._duplexState & WRITE_NEXT_TICK) !== 0) return;
@@ -6811,7 +6858,7 @@ var require_streamx = __commonJS({
6811
6858
  return (this.stream._duplexState & READ_DONE) !== 0;
6812
6859
  }
6813
6860
  pipe(pipeTo, cb) {
6814
- if (this.pipeTo !== null) throw new Error("Can only pipe to one destination");
6861
+ if (this.pipeTo !== null) throw StreamError.BAD_ARGUMENT("Can only pipe to one destination");
6815
6862
  if (typeof cb !== "function") cb = null;
6816
6863
  this.stream._duplexState |= READ_PIPE_DRAINED;
6817
6864
  this.pipeTo = pipeTo;
@@ -6854,7 +6901,9 @@ var require_streamx = __commonJS({
6854
6901
  shift() {
6855
6902
  const data = this.queue.shift();
6856
6903
  this.buffered -= this.byteLength(data);
6857
- if (this.buffered === 0) this.stream._duplexState &= READ_NOT_QUEUED;
6904
+ if (this.buffered === 0) {
6905
+ this.stream._duplexState &= READ_NOT_QUEUED;
6906
+ }
6858
6907
  return data;
6859
6908
  }
6860
6909
  unshift(data) {
@@ -6871,9 +6920,12 @@ var require_streamx = __commonJS({
6871
6920
  const stream = this.stream;
6872
6921
  if ((stream._duplexState & READ_STATUS) === READ_QUEUED) {
6873
6922
  const data = this.shift();
6874
- if (this.pipeTo !== null && this.pipeTo.write(data) === false)
6923
+ if (this.pipeTo !== null && this.pipeTo.write(data) === false) {
6875
6924
  stream._duplexState &= READ_PIPE_NOT_DRAINED;
6876
- if ((stream._duplexState & READ_EMIT_DATA) !== 0) stream.emit("data", data);
6925
+ }
6926
+ if ((stream._duplexState & READ_EMIT_DATA) !== 0) {
6927
+ stream.emit("data", data);
6928
+ }
6877
6929
  return data;
6878
6930
  }
6879
6931
  if (this.readAhead === false) {
@@ -6886,9 +6938,12 @@ var require_streamx = __commonJS({
6886
6938
  const stream = this.stream;
6887
6939
  while ((stream._duplexState & READ_STATUS) === READ_QUEUED && (stream._duplexState & READ_FLOWING) !== 0) {
6888
6940
  const data = this.shift();
6889
- if (this.pipeTo !== null && this.pipeTo.write(data) === false)
6941
+ if (this.pipeTo !== null && this.pipeTo.write(data) === false) {
6890
6942
  stream._duplexState &= READ_PIPE_NOT_DRAINED;
6891
- if ((stream._duplexState & READ_EMIT_DATA) !== 0) stream.emit("data", data);
6943
+ }
6944
+ if ((stream._duplexState & READ_EMIT_DATA) !== 0) {
6945
+ stream.emit("data", data);
6946
+ }
6892
6947
  }
6893
6948
  }
6894
6949
  update() {
@@ -6905,7 +6960,9 @@ var require_streamx = __commonJS({
6905
6960
  stream._duplexState |= READ_EMITTED_READABLE;
6906
6961
  stream.emit("readable");
6907
6962
  }
6908
- if ((stream._duplexState & READ_PRIMARY_AND_ACTIVE) === 0) this.updateNonPrimary();
6963
+ if ((stream._duplexState & READ_PRIMARY_AND_ACTIVE) === 0) {
6964
+ this.updateNonPrimary();
6965
+ }
6909
6966
  } while (this.continueUpdate() === true);
6910
6967
  stream._duplexState &= READ_NOT_UPDATING;
6911
6968
  }
@@ -6914,8 +6971,12 @@ var require_streamx = __commonJS({
6914
6971
  if ((stream._duplexState & READ_ENDING_STATUS) === READ_ENDING) {
6915
6972
  stream._duplexState = (stream._duplexState | READ_DONE) & READ_NOT_ENDING;
6916
6973
  stream.emit("end");
6917
- if ((stream._duplexState & AUTO_DESTROY) === DONE) stream._duplexState |= DESTROYING;
6918
- if (this.pipeTo !== null) this.pipeTo.end();
6974
+ if ((stream._duplexState & AUTO_DESTROY) === DONE) {
6975
+ stream._duplexState |= DESTROYING;
6976
+ }
6977
+ if (this.pipeTo !== null) {
6978
+ this.pipeTo.end();
6979
+ }
6919
6980
  }
6920
6981
  if ((stream._duplexState & DESTROY_STATUS) === DESTROYING) {
6921
6982
  if ((stream._duplexState & ACTIVE_OR_TICKING) === 0) {
@@ -6935,8 +6996,11 @@ var require_streamx = __commonJS({
6935
6996
  return true;
6936
6997
  }
6937
6998
  updateCallback() {
6938
- if ((this.stream._duplexState & READ_UPDATE_SYNC_STATUS) === READ_PRIMARY) this.update();
6939
- else this.updateNextTick();
6999
+ if ((this.stream._duplexState & READ_UPDATE_SYNC_STATUS) === READ_PRIMARY) {
7000
+ this.update();
7001
+ } else {
7002
+ this.updateNextTick();
7003
+ }
6940
7004
  }
6941
7005
  updateNextTickIfOpen() {
6942
7006
  if ((this.stream._duplexState & READ_NEXT_TICK_OR_OPENING) !== 0) return;
@@ -6973,7 +7037,7 @@ var require_streamx = __commonJS({
6973
7037
  this.to = null;
6974
7038
  if (this.from !== null) {
6975
7039
  if ((this.from._duplexState & READ_DONE) === 0 || !this.pipeToFinished) {
6976
- this.from.destroy(this.error || new Error("Writable stream closed prematurely"));
7040
+ this.from.destroy(this.error || StreamError.PREMATURE_CLOSE("Writable stream closed"));
6977
7041
  }
6978
7042
  return;
6979
7043
  }
@@ -6982,7 +7046,7 @@ var require_streamx = __commonJS({
6982
7046
  this.from = null;
6983
7047
  if (this.to !== null) {
6984
7048
  if ((stream._duplexState & READ_DONE) === 0) {
6985
- this.to.destroy(this.error || new Error("Readable stream closed before ending"));
7049
+ this.to.destroy(this.error || StreamError.PREMATURE_CLOSE("Readable stream closed"));
6986
7050
  }
6987
7051
  return;
6988
7052
  }
@@ -7006,21 +7070,30 @@ var require_streamx = __commonJS({
7006
7070
  stream._duplexState |= DESTROYING;
7007
7071
  }
7008
7072
  stream._duplexState &= WRITE_NOT_FINISHING;
7009
- if ((stream._duplexState & WRITE_UPDATING) === 0) this.update();
7010
- else this.updateNextTick();
7073
+ if ((stream._duplexState & WRITE_UPDATING) === 0) {
7074
+ this.update();
7075
+ } else {
7076
+ this.updateNextTick();
7077
+ }
7011
7078
  }
7012
7079
  function afterDestroy(err) {
7013
7080
  const stream = this.stream;
7014
- if (!err && this.error !== STREAM_DESTROYED) err = this.error;
7081
+ if (!err && !StreamError.isStreamDestroyed(this.error)) err = this.error;
7015
7082
  if (err) stream.emit("error", err);
7016
7083
  stream._duplexState |= DESTROYED;
7017
7084
  stream.emit("close");
7018
7085
  const rs = stream._readableState;
7019
7086
  const ws = stream._writableState;
7020
- if (rs !== null && rs.pipeline !== null) rs.pipeline.done(stream, err);
7087
+ if (rs !== null && rs.pipeline !== null) {
7088
+ rs.pipeline.done(stream, err);
7089
+ }
7021
7090
  if (ws !== null) {
7022
- while (ws.drains !== null && ws.drains.length > 0) ws.drains.shift().resolve(false);
7023
- if (ws.pipeline !== null) ws.pipeline.done(stream, err);
7091
+ while (ws.drains !== null && ws.drains.length > 0) {
7092
+ ws.drains.shift().resolve(false);
7093
+ }
7094
+ if (ws.pipeline !== null) {
7095
+ ws.pipeline.done(stream, err);
7096
+ }
7024
7097
  }
7025
7098
  }
7026
7099
  function afterWrite(err) {
@@ -7039,8 +7112,9 @@ var require_streamx = __commonJS({
7039
7112
  function afterRead(err) {
7040
7113
  if (err) this.stream.destroy(err);
7041
7114
  this.stream._duplexState &= READ_NOT_ACTIVE;
7042
- if (this.readAhead === false && (this.stream._duplexState & READ_RESUMED) === 0)
7115
+ if (this.readAhead === false && (this.stream._duplexState & READ_RESUMED) === 0) {
7043
7116
  this.stream._duplexState &= READ_NO_READ_AHEAD;
7117
+ }
7044
7118
  this.updateCallback();
7045
7119
  }
7046
7120
  function updateReadNT() {
@@ -7067,8 +7141,12 @@ var require_streamx = __commonJS({
7067
7141
  const stream = this.stream;
7068
7142
  if (err) stream.destroy(err);
7069
7143
  if ((stream._duplexState & DESTROYING) === 0) {
7070
- if ((stream._duplexState & READ_PRIMARY_STATUS) === 0) stream._duplexState |= READ_PRIMARY;
7071
- if ((stream._duplexState & WRITE_PRIMARY_STATUS) === 0) stream._duplexState |= WRITE_PRIMARY;
7144
+ if ((stream._duplexState & READ_PRIMARY_STATUS) === 0) {
7145
+ stream._duplexState |= READ_PRIMARY;
7146
+ }
7147
+ if ((stream._duplexState & WRITE_PRIMARY_STATUS) === 0) {
7148
+ stream._duplexState |= WRITE_PRIMARY;
7149
+ }
7072
7150
  stream.emit("open");
7073
7151
  }
7074
7152
  stream._duplexState &= NOT_ACTIVE;
@@ -7111,9 +7189,7 @@ var require_streamx = __commonJS({
7111
7189
  if (opts.open) this._open = opts.open;
7112
7190
  if (opts.destroy) this._destroy = opts.destroy;
7113
7191
  if (opts.predestroy) this._predestroy = opts.predestroy;
7114
- if (opts.signal) {
7115
- opts.signal.addEventListener("abort", abort.bind(this));
7116
- }
7192
+ if (opts.signal) opts.signal.addEventListener("abort", abort.bind(this));
7117
7193
  }
7118
7194
  this.on("newListener", newListener);
7119
7195
  }
@@ -7139,7 +7215,7 @@ var require_streamx = __commonJS({
7139
7215
  }
7140
7216
  destroy(err) {
7141
7217
  if ((this._duplexState & DESTROY_STATUS) === 0) {
7142
- if (!err) err = STREAM_DESTROYED;
7218
+ if (!err) err = StreamError.STREAM_DESTROYED();
7143
7219
  this._duplexState = (this._duplexState | DESTROYING) & NON_PRIMARY;
7144
7220
  if (this._readableState !== null) {
7145
7221
  this._readableState.highWaterMark = 0;
@@ -7152,8 +7228,12 @@ var require_streamx = __commonJS({
7152
7228
  this._duplexState |= PREDESTROYING;
7153
7229
  this._predestroy();
7154
7230
  this._duplexState &= NOT_PREDESTROYING;
7155
- if (this._readableState !== null) this._readableState.updateNextTick();
7156
- if (this._writableState !== null) this._writableState.updateNextTick();
7231
+ if (this._readableState !== null) {
7232
+ this._readableState.updateNextTick();
7233
+ }
7234
+ if (this._writableState !== null) {
7235
+ this._writableState.updateNextTick();
7236
+ }
7157
7237
  }
7158
7238
  }
7159
7239
  };
@@ -7169,6 +7249,15 @@ var require_streamx = __commonJS({
7169
7249
  if (opts.encoding) this.setEncoding(opts.encoding);
7170
7250
  }
7171
7251
  }
7252
+ static deferred(fn, opts) {
7253
+ const out = new PassThrough(opts);
7254
+ fn().then((src) => {
7255
+ if (src === null) return out.end();
7256
+ if (out.destroying) return;
7257
+ pipeline(src, out, noop);
7258
+ }).catch((err) => out.destroy(err));
7259
+ return out;
7260
+ }
7172
7261
  setEncoding(encoding) {
7173
7262
  const dec = new TextDecoder2(encoding);
7174
7263
  const map = this._readableState.map || echo;
@@ -7286,10 +7375,13 @@ var require_streamx = __commonJS({
7286
7375
  }
7287
7376
  function ondata(data) {
7288
7377
  if (promiseReject === null) return;
7289
- if (error) promiseReject(error);
7290
- else if (data === null && (stream._duplexState & READ_DONE) === 0)
7291
- promiseReject(STREAM_DESTROYED);
7292
- else promiseResolve({ value: data, done: data === null });
7378
+ if (error) {
7379
+ promiseReject(error);
7380
+ } else if (data === null && (stream._duplexState & READ_DONE) === 0) {
7381
+ promiseReject(StreamError.STREAM_DESTROYED());
7382
+ } else {
7383
+ promiseResolve({ value: data, done: data === null });
7384
+ }
7293
7385
  promiseReject = promiseResolve = null;
7294
7386
  }
7295
7387
  function destroy(err) {
@@ -7458,7 +7550,7 @@ var require_streamx = __commonJS({
7458
7550
  function pipeline(stream, ...streams) {
7459
7551
  const all = Array.isArray(stream) ? [...stream, ...streams] : [stream, ...streams];
7460
7552
  const done = all.length && typeof all[all.length - 1] === "function" ? all.pop() : null;
7461
- if (all.length < 2) throw new Error("Pipeline requires at least 2 streams");
7553
+ if (all.length < 2) throw StreamError.BAD_ARGUMENT("Pipeline requires at least 2 streams");
7462
7554
  let src = all[0];
7463
7555
  let dest = null;
7464
7556
  let error = null;
@@ -7483,7 +7575,7 @@ var require_streamx = __commonJS({
7483
7575
  if (!autoDestroy) done(error);
7484
7576
  });
7485
7577
  if (autoDestroy) {
7486
- dest.on("close", () => done(error || (fin ? null : PREMATURE_CLOSE)));
7578
+ dest.on("close", () => done(error || (fin ? null : StreamError.PREMATURE_CLOSE())));
7487
7579
  }
7488
7580
  }
7489
7581
  return dest;
@@ -7491,8 +7583,12 @@ var require_streamx = __commonJS({
7491
7583
  s.on("error", onerror2);
7492
7584
  s.on("close", onclose);
7493
7585
  function onclose() {
7494
- if (s._readableState && !s._readableState.ended) return onerror2(PREMATURE_CLOSE);
7495
- if (wr && s._writableState && !s._writableState.ended) return onerror2(PREMATURE_CLOSE);
7586
+ if (s._readableState && !s._readableState.ended) {
7587
+ return onerror2(StreamError.PREMATURE_CLOSE());
7588
+ }
7589
+ if (wr && s._writableState && !s._writableState.ended) {
7590
+ return onerror2(StreamError.PREMATURE_CLOSE());
7591
+ }
7496
7592
  }
7497
7593
  }
7498
7594
  function onerror(err) {
@@ -7526,7 +7622,7 @@ var require_streamx = __commonJS({
7526
7622
  }
7527
7623
  function getStreamError(stream, opts = {}) {
7528
7624
  const err = stream._readableState && stream._readableState.error || stream._writableState && stream._writableState.error;
7529
- return !opts.all && err === STREAM_DESTROYED ? null : err;
7625
+ return !opts.all && StreamError.isStreamDestroyed(err) ? null : err;
7530
7626
  }
7531
7627
  function isReadStreamx(stream) {
7532
7628
  return isStreamx(stream) && stream.readable;
@@ -7543,7 +7639,7 @@ var require_streamx = __commonJS({
7543
7639
  function noop() {
7544
7640
  }
7545
7641
  function abort() {
7546
- this.destroy(new Error("Stream aborted."));
7642
+ this.destroy(StreamError.ABORTED());
7547
7643
  }
7548
7644
  function isWritev(s) {
7549
7645
  return s._writev !== Writable.prototype._writev && s._writev !== Duplex.prototype._writev;
@@ -7572,7 +7668,7 @@ var require_streamx = __commonJS({
7572
7668
 
7573
7669
  // ../../node_modules/tar-fs/node_modules/tar-stream/headers.js
7574
7670
  var require_headers = __commonJS({
7575
- "../../node_modules/tar-fs/node_modules/tar-stream/headers.js"(exports$1) {
7671
+ "../../node_modules/tar-fs/node_modules/tar-stream/headers.js"(exports) {
7576
7672
  var b4a = require_b4a();
7577
7673
  var ZEROS = "0000000000000000000";
7578
7674
  var SEVENS = "7777777777777777777";
@@ -7584,10 +7680,10 @@ var require_headers = __commonJS({
7584
7680
  var MASK = 4095;
7585
7681
  var MAGIC_OFFSET = 257;
7586
7682
  var VERSION_OFFSET = 263;
7587
- exports$1.decodeLongPath = function decodeLongPath(buf, encoding) {
7683
+ exports.decodeLongPath = function decodeLongPath(buf, encoding) {
7588
7684
  return decodeStr(buf, 0, buf.length, encoding);
7589
7685
  };
7590
- exports$1.encodePax = function encodePax(opts) {
7686
+ exports.encodePax = function encodePax(opts) {
7591
7687
  let result = "";
7592
7688
  if (opts.name) result += addLength(" path=" + opts.name + "\n");
7593
7689
  if (opts.linkname) result += addLength(" linkpath=" + opts.linkname + "\n");
@@ -7599,7 +7695,7 @@ var require_headers = __commonJS({
7599
7695
  }
7600
7696
  return b4a.from(result);
7601
7697
  };
7602
- exports$1.decodePax = function decodePax(buf) {
7698
+ exports.decodePax = function decodePax(buf) {
7603
7699
  const result = {};
7604
7700
  while (buf.length) {
7605
7701
  let i = 0;
@@ -7614,7 +7710,7 @@ var require_headers = __commonJS({
7614
7710
  }
7615
7711
  return result;
7616
7712
  };
7617
- exports$1.encode = function encode(opts) {
7713
+ exports.encode = function encode(opts) {
7618
7714
  const buf = b4a.alloc(512);
7619
7715
  let name = opts.name;
7620
7716
  let prefix = "";
@@ -7646,7 +7742,7 @@ var require_headers = __commonJS({
7646
7742
  b4a.write(buf, encodeOct(cksum(buf), 6), 148);
7647
7743
  return buf;
7648
7744
  };
7649
- exports$1.decode = function decode(buf, filenameEncoding, allowUnknownFormat) {
7745
+ exports.decode = function decode(buf, filenameEncoding, allowUnknownFormat) {
7650
7746
  let typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET;
7651
7747
  let name = decodeStr(buf, 0, 100, filenameEncoding);
7652
7748
  const mode = decodeOct(buf, 100, 8);
@@ -7832,7 +7928,7 @@ var require_headers = __commonJS({
7832
7928
 
7833
7929
  // ../../node_modules/tar-fs/node_modules/tar-stream/extract.js
7834
7930
  var require_extract = __commonJS({
7835
- "../../node_modules/tar-fs/node_modules/tar-stream/extract.js"(exports$1, module) {
7931
+ "../../node_modules/tar-fs/node_modules/tar-stream/extract.js"(exports, module) {
7836
7932
  var { Writable, Readable, getStreamError } = require_streamx();
7837
7933
  var FIFO = require_fast_fifo();
7838
7934
  var b4a = require_b4a();
@@ -8166,7 +8262,7 @@ var require_extract = __commonJS({
8166
8262
 
8167
8263
  // ../../node_modules/tar-fs/node_modules/tar-stream/constants.js
8168
8264
  var require_constants = __commonJS({
8169
- "../../node_modules/tar-fs/node_modules/tar-stream/constants.js"(exports$1, module) {
8265
+ "../../node_modules/tar-fs/node_modules/tar-stream/constants.js"(exports, module) {
8170
8266
  var constants = {
8171
8267
  // just for envs without fs
8172
8268
  S_IFMT: 61440,
@@ -8186,7 +8282,7 @@ var require_constants = __commonJS({
8186
8282
 
8187
8283
  // ../../node_modules/tar-fs/node_modules/tar-stream/pack.js
8188
8284
  var require_pack = __commonJS({
8189
- "../../node_modules/tar-fs/node_modules/tar-stream/pack.js"(exports$1, module) {
8285
+ "../../node_modules/tar-fs/node_modules/tar-stream/pack.js"(exports, module) {
8190
8286
  var { Readable, Writable, getStreamError } = require_streamx();
8191
8287
  var b4a = require_b4a();
8192
8288
  var constants = require_constants();
@@ -8420,15 +8516,15 @@ var require_pack = __commonJS({
8420
8516
 
8421
8517
  // ../../node_modules/tar-fs/node_modules/tar-stream/index.js
8422
8518
  var require_tar_stream = __commonJS({
8423
- "../../node_modules/tar-fs/node_modules/tar-stream/index.js"(exports$1) {
8424
- exports$1.extract = require_extract();
8425
- exports$1.pack = require_pack();
8519
+ "../../node_modules/tar-fs/node_modules/tar-stream/index.js"(exports) {
8520
+ exports.extract = require_extract();
8521
+ exports.pack = require_pack();
8426
8522
  }
8427
8523
  });
8428
8524
 
8429
8525
  // ../../node_modules/wrappy/wrappy.js
8430
8526
  var require_wrappy = __commonJS({
8431
- "../../node_modules/wrappy/wrappy.js"(exports$1, module) {
8527
+ "../../node_modules/wrappy/wrappy.js"(exports, module) {
8432
8528
  module.exports = wrappy;
8433
8529
  function wrappy(fn, cb) {
8434
8530
  if (fn && cb) return wrappy(fn)(cb);
@@ -8458,7 +8554,7 @@ var require_wrappy = __commonJS({
8458
8554
 
8459
8555
  // ../../node_modules/once/once.js
8460
8556
  var require_once = __commonJS({
8461
- "../../node_modules/once/once.js"(exports$1, module) {
8557
+ "../../node_modules/once/once.js"(exports, module) {
8462
8558
  var wrappy = require_wrappy();
8463
8559
  module.exports = wrappy(once);
8464
8560
  module.exports.strict = wrappy(onceStrict);
@@ -8502,7 +8598,7 @@ var require_once = __commonJS({
8502
8598
 
8503
8599
  // ../../node_modules/end-of-stream/index.js
8504
8600
  var require_end_of_stream = __commonJS({
8505
- "../../node_modules/end-of-stream/index.js"(exports$1, module) {
8601
+ "../../node_modules/end-of-stream/index.js"(exports, module) {
8506
8602
  var once = require_once();
8507
8603
  var noop = function() {
8508
8604
  };
@@ -8585,7 +8681,7 @@ var require_end_of_stream = __commonJS({
8585
8681
 
8586
8682
  // ../../node_modules/pump/index.js
8587
8683
  var require_pump = __commonJS({
8588
- "../../node_modules/pump/index.js"(exports$1, module) {
8684
+ "../../node_modules/pump/index.js"(exports, module) {
8589
8685
  var once = require_once();
8590
8686
  var eos = require_end_of_stream();
8591
8687
  var fs2;
@@ -8660,13 +8756,13 @@ var require_pump = __commonJS({
8660
8756
 
8661
8757
  // ../../node_modules/tar-fs/index.js
8662
8758
  var require_tar_fs = __commonJS({
8663
- "../../node_modules/tar-fs/index.js"(exports$1) {
8759
+ "../../node_modules/tar-fs/index.js"(exports) {
8664
8760
  var tar = require_tar_stream();
8665
8761
  var pump = require_pump();
8666
8762
  var fs2 = __require("fs");
8667
8763
  var path2 = __require("path");
8668
8764
  var win32 = (global.Bare ? global.Bare.platform : process.platform) === "win32";
8669
- exports$1.pack = function pack(cwd, opts) {
8765
+ exports.pack = function pack(cwd, opts) {
8670
8766
  if (!cwd) cwd = ".";
8671
8767
  if (!opts) opts = {};
8672
8768
  const xfs = opts.fs || fs2;
@@ -8753,7 +8849,7 @@ var require_tar_fs = __commonJS({
8753
8849
  function processUmask() {
8754
8850
  return !global.Bare && process.umask ? process.umask() : 0;
8755
8851
  }
8756
- exports$1.extract = function extract3(cwd, opts) {
8852
+ exports.extract = function extract3(cwd, opts) {
8757
8853
  if (!cwd) cwd = ".";
8758
8854
  if (!opts) opts = {};
8759
8855
  cwd = path2.resolve(cwd);
@@ -8826,6 +8922,7 @@ var require_tar_fs = __commonJS({
8826
8922
  });
8827
8923
  function stat(err) {
8828
8924
  if (err) return next(err);
8925
+ if (path2.join(name, ".") === path2.join(cwd, ".")) return next();
8829
8926
  utimes(name, header, function(err2) {
8830
8927
  if (err2) return next(err2);
8831
8928
  if (win32) return next();
@@ -8836,7 +8933,7 @@ var require_tar_fs = __commonJS({
8836
8933
  if (win32) return next();
8837
8934
  xfs.unlink(name, function() {
8838
8935
  const dst = path2.resolve(path2.dirname(name), header.linkname);
8839
- if (!inCwd(dst) && validateSymLinks) return next(new Error(name + " is not a valid symlink"));
8936
+ if (!inCwd(dst) && (validateSymLinks || opts.strip)) return next(new Error(name + " is not a valid symlink"));
8840
8937
  validateNotSymlink(xfs, dst, path2.join(cwd, "."), function(err, valid) {
8841
8938
  if (err) return next(err);
8842
8939
  if (!valid && validateSymLinks) return next(new Error(name + " is not a valid symlink"));
@@ -8864,15 +8961,22 @@ var require_tar_fs = __commonJS({
8864
8961
  return dst === cwd || dst.startsWith(cwd + path2.sep);
8865
8962
  }
8866
8963
  function onfile() {
8867
- const ws = xfs.createWriteStream(name);
8868
- const rs = mapStream(stream, header);
8869
- ws.on("error", function(err) {
8870
- rs.destroy(err);
8964
+ xfs.lstat(name, function(err, st) {
8965
+ if (!err && st.isSymbolicLink()) return xfs.unlink(name, onwrite);
8966
+ onwrite();
8871
8967
  });
8872
- pump(rs, ws, function(err) {
8968
+ function onwrite(err) {
8873
8969
  if (err) return next(err);
8874
- ws.on("close", stat);
8875
- });
8970
+ const ws = xfs.createWriteStream(name);
8971
+ const rs = mapStream(stream, header);
8972
+ ws.on("error", function(err2) {
8973
+ rs.destroy(err2);
8974
+ });
8975
+ pump(rs, ws, function(err2) {
8976
+ if (err2) return next(err2);
8977
+ ws.on("close", stat);
8978
+ });
8979
+ }
8876
8980
  }
8877
8981
  }
8878
8982
  function utimesParent(name, cb) {
@@ -8895,7 +8999,7 @@ var require_tar_fs = __commonJS({
8895
8999
  const chmod = link ? xfs.lchmod : xfs.chmod;
8896
9000
  const chown = link ? xfs.lchown : xfs.chown;
8897
9001
  if (!chmod) return cb();
8898
- const mode = (header.mode | (header.type === "directory" ? dmode : fmode)) & umask;
9002
+ const mode = (header.mode | (header.type === "directory" ? dmode : fmode)) & umask & 511;
8899
9003
  if (chown && own) chown.call(xfs, name, header.uid, header.gid, onchown);
8900
9004
  else onchown(null);
8901
9005
  function onchown(err) {
@@ -8932,6 +9036,9 @@ var require_tar_fs = __commonJS({
8932
9036
  cb(null, false);
8933
9037
  });
8934
9038
  }
9039
+ function inside(root, name) {
9040
+ return name === root || name.startsWith(root + path2.sep);
9041
+ }
8935
9042
  function noop() {
8936
9043
  }
8937
9044
  function echo(name) {
@@ -8943,10 +9050,12 @@ var require_tar_fs = __commonJS({
8943
9050
  function statAll(fs3, stat, cwd, ignore, entries, sort) {
8944
9051
  if (!entries) entries = ["."];
8945
9052
  const queue = entries.slice(0);
9053
+ const root = path2.resolve(cwd);
8946
9054
  return function loop(callback) {
8947
9055
  if (!queue.length) return callback(null);
8948
9056
  const next = queue.shift();
8949
9057
  const nextAbs = path2.join(cwd, next);
9058
+ if (!inside(root, path2.resolve(cwd, next))) return callback(new Error(next + " is not a valid path"));
8950
9059
  stat.call(fs3, nextAbs, function(err, stat2) {
8951
9060
  if (err) return callback(entries.indexOf(next) === -1 && err.code === "ENOENT" ? null : err);
8952
9061
  if (!stat2.isDirectory()) return callback(null, next, stat2);