@wix/dev-machine-monitor 1.0.9 → 1.0.10

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/build/run.cjs CHANGED
@@ -1197,7 +1197,7 @@ var require_command = __commonJS({
1197
1197
  var childProcess = require("node:child_process");
1198
1198
  var path6 = require("node:path");
1199
1199
  var fs = require("node:fs");
1200
- var process13 = require("node:process");
1200
+ var process15 = require("node:process");
1201
1201
  var { Argument: Argument2, humanReadableArgName } = require_argument();
1202
1202
  var { CommanderError: CommanderError2 } = require_error();
1203
1203
  var { Help: Help2, stripColor } = require_help();
@@ -1244,13 +1244,13 @@ var require_command = __commonJS({
1244
1244
  this._showSuggestionAfterError = true;
1245
1245
  this._savedState = null;
1246
1246
  this._outputConfiguration = {
1247
- writeOut: (str) => process13.stdout.write(str),
1248
- writeErr: (str) => process13.stderr.write(str),
1247
+ writeOut: (str) => process15.stdout.write(str),
1248
+ writeErr: (str) => process15.stderr.write(str),
1249
1249
  outputError: (str, write) => write(str),
1250
- getOutHelpWidth: () => process13.stdout.isTTY ? process13.stdout.columns : void 0,
1251
- getErrHelpWidth: () => process13.stderr.isTTY ? process13.stderr.columns : void 0,
1252
- getOutHasColors: () => useColor() ?? (process13.stdout.isTTY && process13.stdout.hasColors?.()),
1253
- getErrHasColors: () => useColor() ?? (process13.stderr.isTTY && process13.stderr.hasColors?.()),
1250
+ getOutHelpWidth: () => process15.stdout.isTTY ? process15.stdout.columns : void 0,
1251
+ getErrHelpWidth: () => process15.stderr.isTTY ? process15.stderr.columns : void 0,
1252
+ getOutHasColors: () => useColor() ?? (process15.stdout.isTTY && process15.stdout.hasColors?.()),
1253
+ getErrHasColors: () => useColor() ?? (process15.stderr.isTTY && process15.stderr.hasColors?.()),
1254
1254
  stripColor: (str) => stripColor(str)
1255
1255
  };
1256
1256
  this._hidden = false;
@@ -1644,7 +1644,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1644
1644
  if (this._exitCallback) {
1645
1645
  this._exitCallback(new CommanderError2(exitCode, code, message));
1646
1646
  }
1647
- process13.exit(exitCode);
1647
+ process15.exit(exitCode);
1648
1648
  }
1649
1649
  /**
1650
1650
  * Register callback `fn` for the command.
@@ -2044,16 +2044,16 @@ Expecting one of '${allowedValues.join("', '")}'`);
2044
2044
  }
2045
2045
  parseOptions = parseOptions || {};
2046
2046
  if (argv === void 0 && parseOptions.from === void 0) {
2047
- if (process13.versions?.electron) {
2047
+ if (process15.versions?.electron) {
2048
2048
  parseOptions.from = "electron";
2049
2049
  }
2050
- const execArgv2 = process13.execArgv ?? [];
2050
+ const execArgv2 = process15.execArgv ?? [];
2051
2051
  if (execArgv2.includes("-e") || execArgv2.includes("--eval") || execArgv2.includes("-p") || execArgv2.includes("--print")) {
2052
2052
  parseOptions.from = "eval";
2053
2053
  }
2054
2054
  }
2055
2055
  if (argv === void 0) {
2056
- argv = process13.argv;
2056
+ argv = process15.argv;
2057
2057
  }
2058
2058
  this.rawArgs = argv.slice();
2059
2059
  let userArgs;
@@ -2064,7 +2064,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2064
2064
  userArgs = argv.slice(2);
2065
2065
  break;
2066
2066
  case "electron":
2067
- if (process13.defaultApp) {
2067
+ if (process15.defaultApp) {
2068
2068
  this._scriptPath = argv[1];
2069
2069
  userArgs = argv.slice(2);
2070
2070
  } else {
@@ -2251,11 +2251,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
2251
2251
  }
2252
2252
  launchWithNode = sourceExt.includes(path6.extname(executableFile));
2253
2253
  let proc;
2254
- if (process13.platform !== "win32") {
2254
+ if (process15.platform !== "win32") {
2255
2255
  if (launchWithNode) {
2256
2256
  args.unshift(executableFile);
2257
- args = incrementNodeInspectorPort(process13.execArgv).concat(args);
2258
- proc = childProcess.spawn(process13.argv[0], args, { stdio: "inherit" });
2257
+ args = incrementNodeInspectorPort(process15.execArgv).concat(args);
2258
+ proc = childProcess.spawn(process15.argv[0], args, { stdio: "inherit" });
2259
2259
  } else {
2260
2260
  proc = childProcess.spawn(executableFile, args, { stdio: "inherit" });
2261
2261
  }
@@ -2266,13 +2266,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
2266
2266
  subcommand._name
2267
2267
  );
2268
2268
  args.unshift(executableFile);
2269
- args = incrementNodeInspectorPort(process13.execArgv).concat(args);
2270
- proc = childProcess.spawn(process13.execPath, args, { stdio: "inherit" });
2269
+ args = incrementNodeInspectorPort(process15.execArgv).concat(args);
2270
+ proc = childProcess.spawn(process15.execPath, args, { stdio: "inherit" });
2271
2271
  }
2272
2272
  if (!proc.killed) {
2273
2273
  const signals2 = ["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"];
2274
2274
  signals2.forEach((signal) => {
2275
- process13.on(signal, () => {
2275
+ process15.on(signal, () => {
2276
2276
  if (proc.killed === false && proc.exitCode === null) {
2277
2277
  proc.kill(signal);
2278
2278
  }
@@ -2283,7 +2283,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2283
2283
  proc.on("close", (code) => {
2284
2284
  code = code ?? 1;
2285
2285
  if (!exitCallback) {
2286
- process13.exit(code);
2286
+ process15.exit(code);
2287
2287
  } else {
2288
2288
  exitCallback(
2289
2289
  new CommanderError2(
@@ -2305,7 +2305,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2305
2305
  throw new Error(`'${executableFile}' not executable`);
2306
2306
  }
2307
2307
  if (!exitCallback) {
2308
- process13.exit(1);
2308
+ process15.exit(1);
2309
2309
  } else {
2310
2310
  const wrappedError = new CommanderError2(
2311
2311
  1,
@@ -2805,13 +2805,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
2805
2805
  */
2806
2806
  _parseOptionsEnv() {
2807
2807
  this.options.forEach((option) => {
2808
- if (option.envVar && option.envVar in process13.env) {
2808
+ if (option.envVar && option.envVar in process15.env) {
2809
2809
  const optionKey = option.attributeName();
2810
2810
  if (this.getOptionValue(optionKey) === void 0 || ["default", "config", "env"].includes(
2811
2811
  this.getOptionValueSource(optionKey)
2812
2812
  )) {
2813
2813
  if (option.required || option.optional) {
2814
- this.emit(`optionEnv:${option.name()}`, process13.env[option.envVar]);
2814
+ this.emit(`optionEnv:${option.name()}`, process15.env[option.envVar]);
2815
2815
  } else {
2816
2816
  this.emit(`optionEnv:${option.name()}`);
2817
2817
  }
@@ -3335,7 +3335,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
3335
3335
  */
3336
3336
  help(contextOptions) {
3337
3337
  this.outputHelp(contextOptions);
3338
- let exitCode = Number(process13.exitCode ?? 0);
3338
+ let exitCode = Number(process15.exitCode ?? 0);
3339
3339
  if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) {
3340
3340
  exitCode = 1;
3341
3341
  }
@@ -3403,20 +3403,20 @@ Expecting one of '${allowedValues.join("', '")}'`);
3403
3403
  let debugOption;
3404
3404
  let debugHost = "127.0.0.1";
3405
3405
  let debugPort = "9229";
3406
- let match;
3407
- if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {
3408
- debugOption = match[1];
3409
- } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {
3410
- debugOption = match[1];
3411
- if (/^\d+$/.test(match[3])) {
3412
- debugPort = match[3];
3406
+ let match2;
3407
+ if ((match2 = arg.match(/^(--inspect(-brk)?)$/)) !== null) {
3408
+ debugOption = match2[1];
3409
+ } else if ((match2 = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {
3410
+ debugOption = match2[1];
3411
+ if (/^\d+$/.test(match2[3])) {
3412
+ debugPort = match2[3];
3413
3413
  } else {
3414
- debugHost = match[3];
3414
+ debugHost = match2[3];
3415
3415
  }
3416
- } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) {
3417
- debugOption = match[1];
3418
- debugHost = match[3];
3419
- debugPort = match[4];
3416
+ } else if ((match2 = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) {
3417
+ debugOption = match2[1];
3418
+ debugHost = match2[3];
3419
+ debugPort = match2[4];
3420
3420
  }
3421
3421
  if (debugOption && debugPort !== "0") {
3422
3422
  return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;
@@ -3425,9 +3425,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
3425
3425
  });
3426
3426
  }
3427
3427
  function useColor() {
3428
- if (process13.env.NO_COLOR || process13.env.FORCE_COLOR === "0" || process13.env.FORCE_COLOR === "false")
3428
+ if (process15.env.NO_COLOR || process15.env.FORCE_COLOR === "0" || process15.env.FORCE_COLOR === "false")
3429
3429
  return false;
3430
- if (process13.env.FORCE_COLOR || process13.env.CLICOLOR_FORCE !== void 0)
3430
+ if (process15.env.FORCE_COLOR || process15.env.CLICOLOR_FORCE !== void 0)
3431
3431
  return true;
3432
3432
  return void 0;
3433
3433
  }
@@ -3486,14 +3486,14 @@ var require_ms = __commonJS({
3486
3486
  if (str.length > 100) {
3487
3487
  return;
3488
3488
  }
3489
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
3489
+ var match2 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
3490
3490
  str
3491
3491
  );
3492
- if (!match) {
3492
+ if (!match2) {
3493
3493
  return;
3494
3494
  }
3495
- var n2 = parseFloat(match[1]);
3496
- var type = (match[2] || "ms").toLowerCase();
3495
+ var n2 = parseFloat(match2[1]);
3496
+ var type = (match2[2] || "ms").toLowerCase();
3497
3497
  switch (type) {
3498
3498
  case "years":
3499
3499
  case "year":
@@ -3625,19 +3625,19 @@ var require_common = __commonJS({
3625
3625
  args.unshift("%O");
3626
3626
  }
3627
3627
  let index = 0;
3628
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format2) => {
3629
- if (match === "%%") {
3628
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match2, format2) => {
3629
+ if (match2 === "%%") {
3630
3630
  return "%";
3631
3631
  }
3632
3632
  index++;
3633
3633
  const formatter = createDebug.formatters[format2];
3634
3634
  if (typeof formatter === "function") {
3635
3635
  const val = args[index];
3636
- match = formatter.call(self, val);
3636
+ match2 = formatter.call(self, val);
3637
3637
  args.splice(index, 1);
3638
3638
  index--;
3639
3639
  }
3640
- return match;
3640
+ return match2;
3641
3641
  });
3642
3642
  createDebug.formatArgs.call(self, args);
3643
3643
  const logFn = self.log || createDebug.log;
@@ -3873,12 +3873,12 @@ var require_browser = __commonJS({
3873
3873
  args.splice(1, 0, c3, "color: inherit");
3874
3874
  let index = 0;
3875
3875
  let lastC = 0;
3876
- args[0].replace(/%[a-zA-Z%]/g, (match) => {
3877
- if (match === "%%") {
3876
+ args[0].replace(/%[a-zA-Z%]/g, (match2) => {
3877
+ if (match2 === "%%") {
3878
3878
  return;
3879
3879
  }
3880
3880
  index++;
3881
- if (match === "%c") {
3881
+ if (match2 === "%c") {
3882
3882
  lastC = index;
3883
3883
  }
3884
3884
  });
@@ -4773,14 +4773,14 @@ var require_common2 = __commonJS({
4773
4773
  return rewriteCookieProperty(headerElement, config, property);
4774
4774
  });
4775
4775
  }
4776
- return header.replace(new RegExp("(;\\s*" + property + "=)([^;]+)", "i"), (match, prefix, previousValue) => {
4776
+ return header.replace(new RegExp("(;\\s*" + property + "=)([^;]+)", "i"), (match2, prefix, previousValue) => {
4777
4777
  let newValue;
4778
4778
  if (previousValue in config) {
4779
4779
  newValue = config[previousValue];
4780
4780
  } else if ("*" in config) {
4781
4781
  newValue = config["*"];
4782
4782
  } else {
4783
- return match;
4783
+ return match2;
4784
4784
  }
4785
4785
  if (newValue) {
4786
4786
  return prefix + newValue;
@@ -5741,6 +5741,854 @@ var require_lib = __commonJS({
5741
5741
  }
5742
5742
  });
5743
5743
 
5744
+ // ../../node_modules/variant/lib/isType.js
5745
+ var require_isType = __commonJS({
5746
+ "../../node_modules/variant/lib/isType.js"(exports2) {
5747
+ "use strict";
5748
+ Object.defineProperty(exports2, "__esModule", { value: true });
5749
+ exports2.isTypeImpl = void 0;
5750
+ function isTypeImpl(key) {
5751
+ function isType(instanceOrType, type) {
5752
+ if (instanceOrType != void 0) {
5753
+ if (typeof instanceOrType === "function" || typeof instanceOrType === "string") {
5754
+ const typeArg = instanceOrType;
5755
+ const typeStr = typeof typeArg === "string" ? typeArg : typeArg.output.type;
5756
+ return (o2) => isType(o2, typeStr);
5757
+ } else {
5758
+ const instance = instanceOrType;
5759
+ const typeStr = typeof type === "string" ? type : type.output.type;
5760
+ return instance != void 0 && instance[key !== null && key !== void 0 ? key : "type"] === typeStr;
5761
+ }
5762
+ } else {
5763
+ return false;
5764
+ }
5765
+ }
5766
+ return { isType };
5767
+ }
5768
+ exports2.isTypeImpl = isTypeImpl;
5769
+ }
5770
+ });
5771
+
5772
+ // ../../node_modules/variant/lib/util.js
5773
+ var require_util = __commonJS({
5774
+ "../../node_modules/variant/lib/util.js"(exports2) {
5775
+ "use strict";
5776
+ Object.defineProperty(exports2, "__esModule", { value: true });
5777
+ exports2.HOI = exports2.isPromise = exports2.identityFunc = void 0;
5778
+ var identityFunc = (x = {}) => x;
5779
+ exports2.identityFunc = identityFunc;
5780
+ function isPromise(x) {
5781
+ return x != void 0 && typeof x === "object" && "then" in x && typeof x.then === "function";
5782
+ }
5783
+ exports2.isPromise = isPromise;
5784
+ var HOI = () => (definition) => definition;
5785
+ exports2.HOI = HOI;
5786
+ }
5787
+ });
5788
+
5789
+ // ../../node_modules/variant/lib/variant.js
5790
+ var require_variant = __commonJS({
5791
+ "../../node_modules/variant/lib/variant.js"(exports2) {
5792
+ "use strict";
5793
+ Object.defineProperty(exports2, "__esModule", { value: true });
5794
+ exports2.variantImpl = exports2.isVariantCreator = exports2.scopeType = void 0;
5795
+ var util_1 = require_util();
5796
+ var scopeType = (scope, type) => `${scope}/${type}`;
5797
+ exports2.scopeType = scopeType;
5798
+ function descopeType(s) {
5799
+ var _a;
5800
+ return (_a = s.split("/")[1]) !== null && _a !== void 0 ? _a : s;
5801
+ }
5802
+ var VARIANT_CREATOR_BRAND = Symbol("Variant Creator");
5803
+ function isVariantCreator(func) {
5804
+ return VARIANT_CREATOR_BRAND in func;
5805
+ }
5806
+ exports2.isVariantCreator = isVariantCreator;
5807
+ function variantImpl(key) {
5808
+ function scope(scope2, v) {
5809
+ return Object.keys(v).reduce((acc, key2) => {
5810
+ return Object.assign(Object.assign({}, acc), { [key2]: variation((0, exports2.scopeType)(scope2, key2), typeof v[key2] === "function" ? v[key2] : util_1.identityFunc) });
5811
+ }, {});
5812
+ }
5813
+ function descope(obj) {
5814
+ return Object.assign(Object.assign({}, obj), { [key]: descopeType(obj[key]) });
5815
+ }
5816
+ function variation(type, creator) {
5817
+ let maker = (...args) => {
5818
+ const returned = (creator !== null && creator !== void 0 ? creator : util_1.identityFunc)(...args);
5819
+ if ((0, util_1.isPromise)(returned)) {
5820
+ return returned.then((result) => {
5821
+ if (key in (result !== null && result !== void 0 ? result : {})) {
5822
+ return result;
5823
+ } else {
5824
+ return Object.assign(result !== null && result !== void 0 ? result : {}, { [key]: type });
5825
+ }
5826
+ });
5827
+ } else {
5828
+ if (key in (returned !== null && returned !== void 0 ? returned : {})) {
5829
+ return returned;
5830
+ } else {
5831
+ return Object.assign(returned !== null && returned !== void 0 ? returned : {}, { [key]: type });
5832
+ }
5833
+ }
5834
+ };
5835
+ Object.defineProperty(maker, "name", { value: type, writable: false });
5836
+ const outputs = { output: { key, type } };
5837
+ return Object.assign(maker, outputs, {
5838
+ [VARIANT_CREATOR_BRAND]: VARIANT_CREATOR_BRAND,
5839
+ toString: function() {
5840
+ return this.output.type;
5841
+ }
5842
+ });
5843
+ }
5844
+ function variantModule(template) {
5845
+ return Object.entries(template).reduce((result, [vmKey, vmVal]) => {
5846
+ const creator = typeof vmVal === "function" ? isVariantCreator(vmVal) ? vmVal : variation(vmKey, vmVal) : variation(vmKey, util_1.identityFunc);
5847
+ return Object.assign(Object.assign({}, result), { [vmKey]: creator });
5848
+ }, {});
5849
+ }
5850
+ function variantList(template) {
5851
+ return template.map((t) => {
5852
+ if (typeof t === "string") {
5853
+ return variation(t);
5854
+ } else if (typeof t === "function") {
5855
+ return t;
5856
+ }
5857
+ return t;
5858
+ }).reduce((result, t) => {
5859
+ let creator = typeof t === "string" ? variation(t) : t;
5860
+ return Object.assign(Object.assign({}, result), { [creator.output.type]: creator });
5861
+ }, {});
5862
+ }
5863
+ function variant2(template) {
5864
+ if (Array.isArray(template)) {
5865
+ return variantList(template);
5866
+ } else {
5867
+ return variantModule(template);
5868
+ }
5869
+ }
5870
+ return { descope, scoped: scope, variant: variant2, variantList, variantModule, variation };
5871
+ }
5872
+ exports2.variantImpl = variantImpl;
5873
+ }
5874
+ });
5875
+
5876
+ // ../../node_modules/variant/lib/precepts.js
5877
+ var require_precepts = __commonJS({
5878
+ "../../node_modules/variant/lib/precepts.js"(exports2) {
5879
+ "use strict";
5880
+ Object.defineProperty(exports2, "__esModule", { value: true });
5881
+ exports2.DEFAULT_KEY = void 0;
5882
+ exports2.DEFAULT_KEY = "default";
5883
+ }
5884
+ });
5885
+
5886
+ // ../../node_modules/variant/lib/match.js
5887
+ var require_match = __commonJS({
5888
+ "../../node_modules/variant/lib/match.js"(exports2) {
5889
+ "use strict";
5890
+ Object.defineProperty(exports2, "__esModule", { value: true });
5891
+ exports2.matchImpl = void 0;
5892
+ var variant_1 = require_variant();
5893
+ var precepts_1 = require_precepts();
5894
+ function matchImpl(key) {
5895
+ const prematch = (_) => (handler) => (instance) => match2(instance, handler);
5896
+ function match2(...args) {
5897
+ var _a, _b;
5898
+ if (args.length === 1) {
5899
+ const [handler] = args;
5900
+ return (instance) => match2(instance, handler);
5901
+ } else if (args.length === 2) {
5902
+ const [instanceOrTypeOrCreator, handlerParam] = args;
5903
+ const instanceOrCreator = typeof instanceOrTypeOrCreator === "string" ? ofLiteral(instanceOrTypeOrCreator) : instanceOrTypeOrCreator;
5904
+ const handler = typeof handlerParam === "function" ? handlerParam(instanceOrCreator) : handlerParam;
5905
+ const tType = instanceOrCreator == void 0 ? void 0 : (0, variant_1.isVariantCreator)(instanceOrCreator) ? instanceOrCreator.output.type : instanceOrCreator[key];
5906
+ if (instanceOrCreator != void 0 && tType !== void 0 && tType in handler) {
5907
+ return (_a = handler[tType]) === null || _a === void 0 ? void 0 : _a.call(handler, instanceOrCreator);
5908
+ } else if (precepts_1.DEFAULT_KEY in handler) {
5909
+ return (_b = handler[precepts_1.DEFAULT_KEY]) === null || _b === void 0 ? void 0 : _b.call(handler, instanceOrCreator);
5910
+ }
5911
+ }
5912
+ }
5913
+ const partial = (h2) => () => h2;
5914
+ const onLiteral = ofLiteral;
5915
+ function ofLiteral(instance) {
5916
+ return {
5917
+ [key]: instance
5918
+ };
5919
+ }
5920
+ function lookup(handler) {
5921
+ const handlerWithFuncs = Object.keys(handler).reduce((acc, cur) => {
5922
+ return Object.assign(Object.assign({}, acc), { [cur]: () => handler[cur] });
5923
+ }, {});
5924
+ return (_) => handlerWithFuncs;
5925
+ }
5926
+ function otherwise(branches, elseFunc) {
5927
+ return (_) => Object.assign(Object.assign({}, branches), { default: elseFunc });
5928
+ }
5929
+ function withFallback(handler, fallback) {
5930
+ return (_) => Object.assign(Object.assign({}, handler), { default: fallback });
5931
+ }
5932
+ return { match: match2, ofLiteral, onLiteral, otherwise, partial, prematch, lookup, withFallback };
5933
+ }
5934
+ exports2.matchImpl = matchImpl;
5935
+ }
5936
+ });
5937
+
5938
+ // ../../node_modules/variant/lib/types.js
5939
+ var require_types = __commonJS({
5940
+ "../../node_modules/variant/lib/types.js"(exports2) {
5941
+ "use strict";
5942
+ Object.defineProperty(exports2, "__esModule", { value: true });
5943
+ exports2.typesImpl = void 0;
5944
+ var variant_1 = require_variant();
5945
+ function typesImpl(key) {
5946
+ function types(content) {
5947
+ if (Array.isArray(content)) {
5948
+ if (content.length && (0, variant_1.isVariantCreator)(content[0])) {
5949
+ return content.map((c3) => c3.output.type);
5950
+ } else {
5951
+ return content.map((c3) => c3[key]);
5952
+ }
5953
+ } else {
5954
+ return Object.values(content).map((c3) => c3.output.type);
5955
+ }
5956
+ }
5957
+ function inferTypes(_) {
5958
+ return new Proxy({}, {
5959
+ get: (_2, property) => {
5960
+ return property;
5961
+ }
5962
+ });
5963
+ }
5964
+ return { types, inferTypes };
5965
+ }
5966
+ exports2.typesImpl = typesImpl;
5967
+ }
5968
+ });
5969
+
5970
+ // ../../node_modules/variant/lib/flags.js
5971
+ var require_flags = __commonJS({
5972
+ "../../node_modules/variant/lib/flags.js"(exports2) {
5973
+ "use strict";
5974
+ Object.defineProperty(exports2, "__esModule", { value: true });
5975
+ exports2.flagsImpl = void 0;
5976
+ function flagsImpl(key) {
5977
+ function flags(flags2) {
5978
+ return flags2.reduce((o2, v) => Object.assign(Object.assign({}, o2), { [v[key]]: v }), /* @__PURE__ */ Object.create(null));
5979
+ }
5980
+ return { flags };
5981
+ }
5982
+ exports2.flagsImpl = flagsImpl;
5983
+ }
5984
+ });
5985
+
5986
+ // ../../node_modules/variant/lib/isOfVariant.js
5987
+ var require_isOfVariant = __commonJS({
5988
+ "../../node_modules/variant/lib/isOfVariant.js"(exports2) {
5989
+ "use strict";
5990
+ Object.defineProperty(exports2, "__esModule", { value: true });
5991
+ exports2.isOfVariantImpl = void 0;
5992
+ function isOfVariantImpl(key) {
5993
+ function isOfVariant(...args) {
5994
+ if (args.length === 1) {
5995
+ const [variant2] = args;
5996
+ return (instance) => instance != void 0 && Object.values(variant2).some((vc) => vc.output.type === instance[key]);
5997
+ } else if (args.length === 2) {
5998
+ const [instance, variant2] = args;
5999
+ return instance != void 0 && Object.values(variant2).some((vc) => vc.output.type === instance[key]);
6000
+ }
6001
+ return false;
6002
+ }
6003
+ return { isOfVariant };
6004
+ }
6005
+ exports2.isOfVariantImpl = isOfVariantImpl;
6006
+ }
6007
+ });
6008
+
6009
+ // ../../node_modules/variant/lib/remote.js
6010
+ var require_remote = __commonJS({
6011
+ "../../node_modules/variant/lib/remote.js"(exports2) {
6012
+ "use strict";
6013
+ Object.defineProperty(exports2, "__esModule", { value: true });
6014
+ exports2.remoteImpl = exports2.CompareResult = void 0;
6015
+ var isType_1 = require_isType();
6016
+ var match_1 = require_match();
6017
+ var variant_1 = require_variant();
6018
+ var CompareResult;
6019
+ (function(CompareResult2) {
6020
+ CompareResult2[CompareResult2["Lesser"] = -1] = "Lesser";
6021
+ CompareResult2[CompareResult2["Equal"] = 0] = "Equal";
6022
+ CompareResult2[CompareResult2["Greater"] = 1] = "Greater";
6023
+ })(CompareResult = exports2.CompareResult || (exports2.CompareResult = {}));
6024
+ function remoteImpl(key) {
6025
+ const { isType } = (0, isType_1.isTypeImpl)(key);
6026
+ const { match: match2 } = (0, match_1.matchImpl)(key);
6027
+ const { variantList } = (0, variant_1.variantImpl)(key);
6028
+ function isFunctions(vmod) {
6029
+ const keys = Object.keys(vmod);
6030
+ return keys.reduce((acc, key2) => {
6031
+ return Object.assign(Object.assign({}, acc), { [key2]: isType(key2) });
6032
+ }, {});
6033
+ }
6034
+ function remote(vmod) {
6035
+ return {
6036
+ key,
6037
+ is: isFunctions(vmod),
6038
+ new: vmod,
6039
+ match: match2
6040
+ };
6041
+ }
6042
+ ;
6043
+ function getType(input) {
6044
+ if (typeof input === "string") {
6045
+ return input;
6046
+ } else if (typeof input === "function") {
6047
+ return input.output.type;
6048
+ } else {
6049
+ return input[key];
6050
+ }
6051
+ }
6052
+ function _sequence(module3, order) {
6053
+ const miniModule = module3;
6054
+ const result = remote(miniModule);
6055
+ const keyOrder = order.map(getType);
6056
+ return Object.assign(Object.assign({}, result), { length: order.length, compare: (a2, b) => {
6057
+ const ai = keyOrder.findIndex((i2) => i2 === getType(a2));
6058
+ const bi = keyOrder.findIndex((i2) => i2 === getType(b));
6059
+ const diff = ai - bi;
6060
+ return diff === 0 ? diff : diff / Math.abs(diff);
6061
+ }, get(i2) {
6062
+ const type = this.types[i2];
6063
+ return this.new[type];
6064
+ }, index: (a2) => keyOrder.findIndex((i2) => i2 === getType(a2)), types: keyOrder });
6065
+ }
6066
+ function _sequenceOfList(order) {
6067
+ const module3 = variantList(order);
6068
+ return _sequence(module3, order);
6069
+ }
6070
+ function sequence(module3, order) {
6071
+ if (Array.isArray(module3)) {
6072
+ return _sequenceOfList(module3);
6073
+ } else {
6074
+ return _sequence(module3, order);
6075
+ }
6076
+ }
6077
+ return { remote, sequence };
6078
+ }
6079
+ exports2.remoteImpl = remoteImpl;
6080
+ }
6081
+ });
6082
+
6083
+ // ../../node_modules/variant/lib/typed.js
6084
+ var require_typed = __commonJS({
6085
+ "../../node_modules/variant/lib/typed.js"(exports2) {
6086
+ "use strict";
6087
+ Object.defineProperty(exports2, "__esModule", { value: true });
6088
+ exports2.typedImpl = exports2.pass = void 0;
6089
+ var pass = (x) => x;
6090
+ exports2.pass = pass;
6091
+ function typedImpl(_key) {
6092
+ function typed(defOrFactory) {
6093
+ if (typeof defOrFactory === "function") {
6094
+ return defOrFactory(exports2.pass);
6095
+ } else {
6096
+ return defOrFactory;
6097
+ }
6098
+ }
6099
+ return { typed };
6100
+ }
6101
+ exports2.typedImpl = typedImpl;
6102
+ }
6103
+ });
6104
+
6105
+ // ../../node_modules/variant/lib/match.tools.js
6106
+ var require_match_tools = __commonJS({
6107
+ "../../node_modules/variant/lib/match.tools.js"(exports2) {
6108
+ "use strict";
6109
+ Object.defineProperty(exports2, "__esModule", { value: true });
6110
+ exports2.unpack = exports2.just = exports2.constant = void 0;
6111
+ function constant(x) {
6112
+ return () => x;
6113
+ }
6114
+ exports2.constant = constant;
6115
+ exports2.just = constant;
6116
+ var unpack = (x) => x.payload;
6117
+ exports2.unpack = unpack;
6118
+ }
6119
+ });
6120
+
6121
+ // ../../node_modules/variant/lib/matcher.js
6122
+ var require_matcher = __commonJS({
6123
+ "../../node_modules/variant/lib/matcher.js"(exports2) {
6124
+ "use strict";
6125
+ Object.defineProperty(exports2, "__esModule", { value: true });
6126
+ exports2.matcherImpl = exports2.Matcher = exports2.tableToHandler = void 0;
6127
+ var match_tools_1 = require_match_tools();
6128
+ var variant_1 = require_variant();
6129
+ function tableToHandler(table) {
6130
+ return Object.keys(table).reduce((acc, cur) => {
6131
+ const key = cur;
6132
+ return Object.assign(Object.assign({}, acc), { [key]: (0, match_tools_1.just)(table[key]) });
6133
+ }, {});
6134
+ }
6135
+ exports2.tableToHandler = tableToHandler;
6136
+ var Matcher = class _Matcher {
6137
+ /**
6138
+ * Create a new matcher from the target
6139
+ * @param target the
6140
+ * @param handler the initial handler. Use `{}` for standard functionality.
6141
+ * @param key the discriminant. Use `'type'` for standard functionality.
6142
+ */
6143
+ constructor(target, key, handler) {
6144
+ this.target = target;
6145
+ this.key = key;
6146
+ this.handler = handler;
6147
+ this.complete = ((options) => {
6148
+ var _a, _b;
6149
+ if (this.target != void 0 && this.target[this.key] in this.handler) {
6150
+ return (_b = (_a = this.handler)[this.target[this.key]]) === null || _b === void 0 ? void 0 : _b.call(_a, this.target);
6151
+ } else {
6152
+ if ((options === null || options === void 0 ? void 0 : options.withFallback) != void 0) {
6153
+ return options.withFallback(this.target);
6154
+ }
6155
+ }
6156
+ });
6157
+ }
6158
+ /**
6159
+ * Immediately execute the matcher. Exhaustiveness is not guaranteed.
6160
+ *
6161
+ * This is a **terminal** and resolves the matcher.
6162
+ */
6163
+ execute() {
6164
+ const chosenHandler = this.handler[this.target[this.key]];
6165
+ return chosenHandler === null || chosenHandler === void 0 ? void 0 : chosenHandler(this.target);
6166
+ }
6167
+ /**
6168
+ * Handle all unhandled cases and immediately execute.
6169
+ *
6170
+ * > **Exhaust** — to consume entirely, _Merriam-Webster_
6171
+ *
6172
+ * This is a **terminal** and resolves the matcher.
6173
+ * @param remainingCases an object wiht a method to handle every remaining case.
6174
+ * @returns the result of executing the handler, given these final additions.
6175
+ */
6176
+ exhaust(remainingCases) {
6177
+ var _a;
6178
+ const combinedHandler = Object.assign(Object.assign({}, this.handler), remainingCases);
6179
+ return (_a = combinedHandler[this.target[this.key]]) === null || _a === void 0 ? void 0 : _a.call(combinedHandler, this.target);
6180
+ }
6181
+ /**
6182
+ * Resolve all remaining cases without executing the matcher.
6183
+ * @param remainingCases
6184
+ * @returns
6185
+ */
6186
+ remaining(remainingCases) {
6187
+ return new _Matcher(this.target, this.key, Object.assign(Object.assign({}, this.handler), remainingCases));
6188
+ }
6189
+ /**
6190
+ * Execute the match. If the target type has been explicitly handled, use that logic.
6191
+ * Otherwise use the function passed here.
6192
+ *
6193
+ * This is a **terminal** and resolves the matcher.
6194
+ * @param func
6195
+ * @returns
6196
+ */
6197
+ else(func) {
6198
+ var _a, _b;
6199
+ if (this.target[this.key] in this.handler) {
6200
+ return (_b = (_a = this.handler)[this.target[this.key]]) === null || _b === void 0 ? void 0 : _b.call(_a, this.target);
6201
+ } else {
6202
+ return func(this.target);
6203
+ }
6204
+ }
6205
+ /**
6206
+ * Register a series of options as a lookup table.
6207
+ *
6208
+ * ```ts
6209
+ * const getSound = (a: Animal) => matcher(a)
6210
+ * .register({
6211
+ * cat: 'purr',
6212
+ * dog: 'woof',
6213
+ * snake: 'hiss',
6214
+ * })
6215
+ * .complete()
6216
+ * ```
6217
+ * @param table
6218
+ * @returns
6219
+ */
6220
+ register(table) {
6221
+ const newHandler = Object.assign(Object.assign({}, this.handler), tableToHandler(table));
6222
+ return new _Matcher(this.target, this.key, newHandler);
6223
+ }
6224
+ /**
6225
+ * Provide an exhaustive table of the unhandled options and look up which value
6226
+ * to use based on the instance.
6227
+ *
6228
+ * This is a **terminal** and resolves the matcher.
6229
+ *
6230
+ * ```ts
6231
+ * const getSound = (a: Animal) => matcher(a)
6232
+ * .lookup({
6233
+ * cat: 'purr',
6234
+ * dog: 'woof',
6235
+ * snake: 'hiss',
6236
+ * })
6237
+ * ```
6238
+ * @param table
6239
+ * @returns
6240
+ */
6241
+ lookup(table) {
6242
+ var _a;
6243
+ const combinedHandler = Object.assign(Object.assign({}, this.handler), tableToHandler(table));
6244
+ return (_a = combinedHandler[this.target[this.key]]) === null || _a === void 0 ? void 0 : _a.call(combinedHandler, this.target);
6245
+ }
6246
+ /**
6247
+ * Handle one or more cases, object-style.
6248
+ * @param variations
6249
+ */
6250
+ with(variations) {
6251
+ return new _Matcher(this.target, this.key, Object.assign(Object.assign({}, this.handler), variations));
6252
+ }
6253
+ // actual implementation
6254
+ when(variations, handler) {
6255
+ if (handler != void 0) {
6256
+ const list = Array.isArray(variations) ? variations : [variations];
6257
+ const newCases = list.reduce((acc, cur) => {
6258
+ const type = typeof cur === "string" ? cur : (0, variant_1.isVariantCreator)(cur) ? cur.output.type : void 0;
6259
+ return type != void 0 ? Object.assign(Object.assign({}, acc), { [type]: handler }) : acc;
6260
+ }, {});
6261
+ return new _Matcher(this.target, this.key, Object.assign(Object.assign({}, this.handler), newCases));
6262
+ } else {
6263
+ return new _Matcher(this.target, this.key, Object.assign(Object.assign({}, this.handler), variations));
6264
+ }
6265
+ }
6266
+ };
6267
+ exports2.Matcher = Matcher;
6268
+ function matcherImpl(key) {
6269
+ function matcher(target) {
6270
+ const actualTarget = typeof target === "string" ? { [key]: target } : target;
6271
+ return new Matcher(actualTarget, key, {});
6272
+ }
6273
+ return { matcher };
6274
+ }
6275
+ exports2.matcherImpl = matcherImpl;
6276
+ }
6277
+ });
6278
+
6279
+ // ../../node_modules/variant/lib/cosmos.js
6280
+ var require_cosmos = __commonJS({
6281
+ "../../node_modules/variant/lib/cosmos.js"(exports2) {
6282
+ "use strict";
6283
+ Object.defineProperty(exports2, "__esModule", { value: true });
6284
+ exports2.variantCosmos = void 0;
6285
+ var isType_1 = require_isType();
6286
+ var match_1 = require_match();
6287
+ var variant_1 = require_variant();
6288
+ var types_1 = require_types();
6289
+ var flags_1 = require_flags();
6290
+ var isOfVariant_1 = require_isOfVariant();
6291
+ var remote_1 = require_remote();
6292
+ var typed_1 = require_typed();
6293
+ var matcher_1 = require_matcher();
6294
+ function variantCosmos({ key }) {
6295
+ const { isType } = (0, isType_1.isTypeImpl)(key);
6296
+ const { flags } = (0, flags_1.flagsImpl)(key);
6297
+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
6298
+ key,
6299
+ isType,
6300
+ flags
6301
+ }, (0, isOfVariant_1.isOfVariantImpl)(key)), (0, match_1.matchImpl)(key)), (0, matcher_1.matcherImpl)(key)), (0, remote_1.remoteImpl)(key)), (0, typed_1.typedImpl)(key)), (0, types_1.typesImpl)(key)), (0, variant_1.variantImpl)(key));
6302
+ }
6303
+ exports2.variantCosmos = variantCosmos;
6304
+ }
6305
+ });
6306
+
6307
+ // ../../node_modules/variant/lib/type/index.js
6308
+ var require_type = __commonJS({
6309
+ "../../node_modules/variant/lib/type/index.js"(exports2) {
6310
+ "use strict";
6311
+ var _a;
6312
+ Object.defineProperty(exports2, "__esModule", { value: true });
6313
+ exports2.withFallback = exports2.variation = exports2.variantModule = exports2.variantList = exports2.variant = exports2.types = exports2.typed = exports2.lookup = exports2.sequence = exports2.scoped = exports2.remote = exports2.prematch = exports2.partial = exports2.otherwise = exports2.onLiteral = exports2.ofLiteral = exports2.matcher = exports2.match = exports2.isType = exports2.isOfVariant = exports2.inferTypes = exports2.flags = exports2.descope = void 0;
6314
+ var cosmos_1 = require_cosmos();
6315
+ _a = (0, cosmos_1.variantCosmos)({ key: "type" }), exports2.descope = _a.descope, exports2.flags = _a.flags, exports2.inferTypes = _a.inferTypes, exports2.isOfVariant = _a.isOfVariant, exports2.isType = _a.isType, exports2.match = _a.match, exports2.matcher = _a.matcher, exports2.ofLiteral = _a.ofLiteral, exports2.onLiteral = _a.onLiteral, exports2.otherwise = _a.otherwise, exports2.partial = _a.partial, exports2.prematch = _a.prematch, exports2.remote = _a.remote, exports2.scoped = _a.scoped, exports2.sequence = _a.sequence, exports2.lookup = _a.lookup, exports2.typed = _a.typed, exports2.types = _a.types, exports2.variant = _a.variant, exports2.variantList = _a.variantList, exports2.variantModule = _a.variantModule, exports2.variation = _a.variation, exports2.withFallback = _a.withFallback;
6316
+ }
6317
+ });
6318
+
6319
+ // ../../node_modules/variant/lib/augment.js
6320
+ var require_augment = __commonJS({
6321
+ "../../node_modules/variant/lib/augment.js"(exports2) {
6322
+ "use strict";
6323
+ Object.defineProperty(exports2, "__esModule", { value: true });
6324
+ exports2.augment = void 0;
6325
+ var type_1 = require_type();
6326
+ var variant_1 = require_variant();
6327
+ function augment(variantDefinition, f) {
6328
+ return Object.keys(variantDefinition).reduce((acc, key) => {
6329
+ let inputFunc = variantDefinition[key];
6330
+ let returnFunc = (0, variant_1.isVariantCreator)(inputFunc) ? (0, type_1.variation)(inputFunc.output.type, (...args) => {
6331
+ let result = inputFunc(...args);
6332
+ return Object.assign(Object.assign({}, f(result)), result);
6333
+ }) : (...args) => {
6334
+ const branch = variantDefinition[key];
6335
+ let item = typeof branch === "function" ? branch(...args) : {};
6336
+ return Object.assign(Object.assign({}, f(item)), item);
6337
+ };
6338
+ return Object.assign(Object.assign({}, acc), { [key]: returnFunc });
6339
+ }, {});
6340
+ }
6341
+ exports2.augment = augment;
6342
+ }
6343
+ });
6344
+
6345
+ // ../../node_modules/variant/lib/constrained.js
6346
+ var require_constrained = __commonJS({
6347
+ "../../node_modules/variant/lib/constrained.js"(exports2) {
6348
+ "use strict";
6349
+ Object.defineProperty(exports2, "__esModule", { value: true });
6350
+ exports2.constrained = void 0;
6351
+ function constrained(_constraint_, v) {
6352
+ return v;
6353
+ }
6354
+ exports2.constrained = constrained;
6355
+ }
6356
+ });
6357
+
6358
+ // ../../node_modules/variant/lib/construct.js
6359
+ var require_construct = __commonJS({
6360
+ "../../node_modules/variant/lib/construct.js"(exports2) {
6361
+ "use strict";
6362
+ Object.defineProperty(exports2, "__esModule", { value: true });
6363
+ exports2.construct = void 0;
6364
+ function construct(cls) {
6365
+ return ((...args) => new cls(args));
6366
+ }
6367
+ exports2.construct = construct;
6368
+ }
6369
+ });
6370
+
6371
+ // ../../node_modules/variant/lib/generic.js
6372
+ var require_generic = __commonJS({
6373
+ "../../node_modules/variant/lib/generic.js"(exports2) {
6374
+ "use strict";
6375
+ Object.defineProperty(exports2, "__esModule", { value: true });
6376
+ exports2.Alpha = exports2.onTerms = void 0;
6377
+ var flags_1 = require_flags();
6378
+ var variant_1 = require_variant();
6379
+ var GENERIC_BRAND = Symbol("VARIANT GENERIC TEMPLATE");
6380
+ function onTerms(func) {
6381
+ return Object.assign(Object.assign({}, func(exports2.Alpha)), { [GENERIC_BRAND]: void 0 });
6382
+ }
6383
+ exports2.onTerms = onTerms;
6384
+ var GTERM = "__term";
6385
+ var genericTerms = (0, variant_1.variantImpl)(GTERM).variant;
6386
+ var flags = (0, flags_1.flagsImpl)(GTERM).flags;
6387
+ var GP = genericTerms([
6388
+ "A",
6389
+ "B",
6390
+ "C",
6391
+ "D",
6392
+ "E",
6393
+ "F",
6394
+ "G",
6395
+ "H",
6396
+ "I",
6397
+ "J",
6398
+ "K",
6399
+ "L",
6400
+ "M",
6401
+ "N",
6402
+ "O",
6403
+ "P",
6404
+ "Q",
6405
+ "R",
6406
+ "S",
6407
+ "T",
6408
+ "U",
6409
+ "V",
6410
+ "W",
6411
+ "X",
6412
+ "Y",
6413
+ "Z"
6414
+ ]);
6415
+ exports2.Alpha = flags(Object.values(GP).map((f) => f()));
6416
+ }
6417
+ });
6418
+
6419
+ // ../../node_modules/variant/lib/typeCatalog.js
6420
+ var require_typeCatalog = __commonJS({
6421
+ "../../node_modules/variant/lib/typeCatalog.js"(exports2) {
6422
+ "use strict";
6423
+ Object.defineProperty(exports2, "__esModule", { value: true });
6424
+ exports2.typeMap = exports2.typeCatalog = void 0;
6425
+ function typeCatalog(variant2) {
6426
+ return Object.values(variant2).reduce((result, vc) => {
6427
+ return Object.assign(Object.assign({}, result), { [vc.output.type]: vc.output.type });
6428
+ }, {});
6429
+ }
6430
+ exports2.typeCatalog = typeCatalog;
6431
+ function typeMap(variant2) {
6432
+ return Object.keys(variant2).reduce((result, key) => {
6433
+ return Object.assign(Object.assign({}, result), { [key]: variant2[key].output.type });
6434
+ }, {});
6435
+ }
6436
+ exports2.typeMap = typeMap;
6437
+ }
6438
+ });
6439
+
6440
+ // ../../node_modules/variant/lib/catalog.js
6441
+ var require_catalog = __commonJS({
6442
+ "../../node_modules/variant/lib/catalog.js"(exports2) {
6443
+ "use strict";
6444
+ Object.defineProperty(exports2, "__esModule", { value: true });
6445
+ exports2.literalist = exports2.catalog = void 0;
6446
+ function catalog(catalog2, factory) {
6447
+ if (Array.isArray(catalog2)) {
6448
+ return catalog2.reduce((result, current, index) => {
6449
+ return Object.assign(Object.assign({}, result), { [current]: factory != void 0 ? factory(current, index) : current });
6450
+ }, {});
6451
+ } else {
6452
+ return catalog2;
6453
+ }
6454
+ }
6455
+ exports2.catalog = catalog;
6456
+ exports2.literalist = catalog;
6457
+ }
6458
+ });
6459
+
6460
+ // ../../node_modules/variant/lib/patterned.js
6461
+ var require_patterned = __commonJS({
6462
+ "../../node_modules/variant/lib/patterned.js"(exports2) {
6463
+ "use strict";
6464
+ Object.defineProperty(exports2, "__esModule", { value: true });
6465
+ exports2.patterned = void 0;
6466
+ function patterned(_constraint_, v) {
6467
+ return v;
6468
+ }
6469
+ exports2.patterned = patterned;
6470
+ }
6471
+ });
6472
+
6473
+ // ../../node_modules/variant/lib/variant.tools.js
6474
+ var require_variant_tools = __commonJS({
6475
+ "../../node_modules/variant/lib/variant.tools.js"(exports2) {
6476
+ "use strict";
6477
+ Object.defineProperty(exports2, "__esModule", { value: true });
6478
+ exports2.nil = exports2.payload = exports2.fields = void 0;
6479
+ function fields(defaults = {}) {
6480
+ return (...args) => {
6481
+ const [arg] = args;
6482
+ return Object.assign(Object.assign({}, defaults), arg);
6483
+ };
6484
+ }
6485
+ exports2.fields = fields;
6486
+ function payload(_example) {
6487
+ return (payload2) => ({ payload: payload2 });
6488
+ }
6489
+ exports2.payload = payload;
6490
+ var nil = () => ({});
6491
+ exports2.nil = nil;
6492
+ }
6493
+ });
6494
+
6495
+ // ../../node_modules/variant/lib/slim.js
6496
+ var require_slim = __commonJS({
6497
+ "../../node_modules/variant/lib/slim.js"(exports2) {
6498
+ "use strict";
6499
+ Object.defineProperty(exports2, "__esModule", { value: true });
6500
+ exports2.payload = exports2.nil = exports2.fields = exports2.HOI = exports2.pass = exports2.patterned = exports2.unpack = exports2.just = exports2.constant = exports2.literalist = exports2.catalog = exports2.typeCatalog = exports2.typeMap = exports2.onTerms = exports2.variantCosmos = exports2.construct = exports2.constrained = exports2.augment = void 0;
6501
+ var augment_1 = require_augment();
6502
+ Object.defineProperty(exports2, "augment", { enumerable: true, get: function() {
6503
+ return augment_1.augment;
6504
+ } });
6505
+ var constrained_1 = require_constrained();
6506
+ Object.defineProperty(exports2, "constrained", { enumerable: true, get: function() {
6507
+ return constrained_1.constrained;
6508
+ } });
6509
+ var construct_1 = require_construct();
6510
+ Object.defineProperty(exports2, "construct", { enumerable: true, get: function() {
6511
+ return construct_1.construct;
6512
+ } });
6513
+ var cosmos_1 = require_cosmos();
6514
+ Object.defineProperty(exports2, "variantCosmos", { enumerable: true, get: function() {
6515
+ return cosmos_1.variantCosmos;
6516
+ } });
6517
+ var generic_1 = require_generic();
6518
+ Object.defineProperty(exports2, "onTerms", { enumerable: true, get: function() {
6519
+ return generic_1.onTerms;
6520
+ } });
6521
+ var typeCatalog_1 = require_typeCatalog();
6522
+ Object.defineProperty(exports2, "typeMap", { enumerable: true, get: function() {
6523
+ return typeCatalog_1.typeMap;
6524
+ } });
6525
+ Object.defineProperty(exports2, "typeCatalog", { enumerable: true, get: function() {
6526
+ return typeCatalog_1.typeCatalog;
6527
+ } });
6528
+ var catalog_1 = require_catalog();
6529
+ Object.defineProperty(exports2, "catalog", { enumerable: true, get: function() {
6530
+ return catalog_1.catalog;
6531
+ } });
6532
+ Object.defineProperty(exports2, "literalist", { enumerable: true, get: function() {
6533
+ return catalog_1.literalist;
6534
+ } });
6535
+ var match_tools_1 = require_match_tools();
6536
+ Object.defineProperty(exports2, "constant", { enumerable: true, get: function() {
6537
+ return match_tools_1.constant;
6538
+ } });
6539
+ Object.defineProperty(exports2, "just", { enumerable: true, get: function() {
6540
+ return match_tools_1.just;
6541
+ } });
6542
+ Object.defineProperty(exports2, "unpack", { enumerable: true, get: function() {
6543
+ return match_tools_1.unpack;
6544
+ } });
6545
+ var patterned_1 = require_patterned();
6546
+ Object.defineProperty(exports2, "patterned", { enumerable: true, get: function() {
6547
+ return patterned_1.patterned;
6548
+ } });
6549
+ var typed_1 = require_typed();
6550
+ Object.defineProperty(exports2, "pass", { enumerable: true, get: function() {
6551
+ return typed_1.pass;
6552
+ } });
6553
+ var util_1 = require_util();
6554
+ Object.defineProperty(exports2, "HOI", { enumerable: true, get: function() {
6555
+ return util_1.HOI;
6556
+ } });
6557
+ var variant_tools_1 = require_variant_tools();
6558
+ Object.defineProperty(exports2, "fields", { enumerable: true, get: function() {
6559
+ return variant_tools_1.fields;
6560
+ } });
6561
+ Object.defineProperty(exports2, "nil", { enumerable: true, get: function() {
6562
+ return variant_tools_1.nil;
6563
+ } });
6564
+ Object.defineProperty(exports2, "payload", { enumerable: true, get: function() {
6565
+ return variant_tools_1.payload;
6566
+ } });
6567
+ }
6568
+ });
6569
+
6570
+ // ../../node_modules/variant/lib/index.js
6571
+ var require_lib2 = __commonJS({
6572
+ "../../node_modules/variant/lib/index.js"(exports2) {
6573
+ "use strict";
6574
+ var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m, k, k2) {
6575
+ if (k2 === void 0) k2 = k;
6576
+ Object.defineProperty(o2, k2, { enumerable: true, get: function() {
6577
+ return m[k];
6578
+ } });
6579
+ }) : (function(o2, m, k, k2) {
6580
+ if (k2 === void 0) k2 = k;
6581
+ o2[k2] = m[k];
6582
+ }));
6583
+ var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
6584
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
6585
+ };
6586
+ Object.defineProperty(exports2, "__esModule", { value: true });
6587
+ __exportStar(require_slim(), exports2);
6588
+ __exportStar(require_type(), exports2);
6589
+ }
6590
+ });
6591
+
5744
6592
  // ../../node_modules/isexe/windows.js
5745
6593
  var require_windows = __commonJS({
5746
6594
  "../../node_modules/isexe/windows.js"(exports2, module2) {
@@ -6067,11 +6915,11 @@ var require_shebang_command = __commonJS({
6067
6915
  "use strict";
6068
6916
  var shebangRegex = require_shebang_regex();
6069
6917
  module2.exports = (string = "") => {
6070
- const match = string.match(shebangRegex);
6071
- if (!match) {
6918
+ const match2 = string.match(shebangRegex);
6919
+ if (!match2) {
6072
6920
  return null;
6073
6921
  }
6074
- const [path6, argument] = match[0].replace(/#! ?/, "").split(" ");
6922
+ const [path6, argument] = match2[0].replace(/#! ?/, "").split(" ");
6075
6923
  const binary = path6.split("/").pop();
6076
6924
  if (binary === "env") {
6077
6925
  return argument;
@@ -6243,7 +7091,7 @@ var require_cross_spawn = __commonJS({
6243
7091
  });
6244
7092
 
6245
7093
  // lib/run.ts
6246
- var import_node_process13 = __toESM(require("node:process"), 1);
7094
+ var import_node_process15 = __toESM(require("node:process"), 1);
6247
7095
  var import_strict5 = require("node:assert/strict");
6248
7096
 
6249
7097
  // ../../node_modules/commander/esm.mjs
@@ -6759,8 +7607,16 @@ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
6759
7607
  var source_default = chalk;
6760
7608
 
6761
7609
  // lib/run-proxy.ts
7610
+ var import_node_process3 = __toESM(require("node:process"), 1);
6762
7611
  var http = __toESM(require("node:http"), 1);
6763
7612
  var import_http_proxy_3 = __toESM(require_lib(), 1);
7613
+ var import_mustache = __toESM(require("mustache"), 1);
7614
+
7615
+ // lib/config.ts
7616
+ var import_node_process2 = __toESM(require("node:process"), 1);
7617
+ var import_node_path = require("node:path");
7618
+ var import_node_fs = require("node:fs");
7619
+ var import_variant = __toESM(require_lib2(), 1);
6764
7620
 
6765
7621
  // lib/templates/error-server.html
6766
7622
  var error_server_default = '<!DOCTYPE html>\n<html lang="en">\n <head>\n <meta charset="utf-8" />\n <meta name="viewport" content="width=device-width,initial-scale=1" />\n <title>Development Server Crashed</title>\n <style>\n :root {\n --bg: #0f1724;\n --card: #0b1220;\n --accent: #7dd3fc;\n --muted: #94a3b8;\n --glass: rgba(255, 255, 255, 0.04);\n --radius: 16px;\n color-scheme: light dark;\n }\n * {\n box-sizing: border-box;\n }\n html,\n body {\n height: 100%;\n }\n body {\n margin: 0;\n font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI",\n Roboto, "Helvetica Neue", Arial;\n background: radial-gradient(\n 1200px 600px at 10% 10%,\n rgba(125, 211, 252, 0.06),\n transparent\n ),\n linear-gradient(180deg, var(--bg), #071025 80%);\n color: #e6eef8;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 32px;\n }\n\n .card {\n width: min(980px, 100%);\n background: linear-gradient(\n 180deg,\n rgba(255, 255, 255, 0.02),\n rgba(255, 255, 255, 0.01)\n );\n border: 1px solid rgba(255, 255, 255, 0.04);\n border-radius: var(--radius);\n padding: 32px;\n display: grid;\n grid-template-columns: 300px 1fr;\n gap: 24px;\n align-items: center;\n box-shadow: 0 8px 40px rgba(2, 6, 23, 0.6);\n }\n\n .illustration {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .badge {\n background: var(--glass);\n padding: 14px;\n border-radius: 14px;\n text-align: center;\n }\n .code {\n font-weight: 700;\n font-size: 48px;\n letter-spacing: -2px;\n color: var(--accent);\n display: block;\n }\n h1 {\n margin: 0 0 6px 0;\n font-size: 20px;\n }\n p.lead {\n margin: 0;\n color: var(--muted);\n }\n\n .actions {\n margin-top: 18px;\n display: flex;\n gap: 12px;\n flex-wrap: wrap;\n }\n .btn {\n background: linear-gradient(\n 180deg,\n rgba(255, 255, 255, 0.03),\n rgba(255, 255, 255, 0.01)\n );\n border: 1px solid rgba(255, 255, 255, 0.05);\n padding: 10px 14px;\n border-radius: 12px;\n cursor: pointer;\n font-weight: 600;\n color: inherit;\n text-decoration: none;\n display: inline-flex;\n align-items: center;\n gap: 10px;\n }\n .btn.primary {\n background: linear-gradient(180deg, var(--accent), #4ecfe8);\n color: #032;\n box-shadow: 0 6px 18px rgba(125, 211, 252, 0.08);\n }\n .btn.ghost {\n background: transparent;\n border: 1px dashed rgba(255, 255, 255, 0.04);\n }\n\n .details {\n background: rgba(255, 255, 255, 0.02);\n border-radius: 12px;\n padding: 18px;\n margin-top: 8px;\n color: var(--muted);\n font-size: 14px;\n }\n\n .suggestions {\n display: flex;\n flex-direction: column;\n gap: 8px;\n margin-top: 12px;\n }\n .suggestion {\n display: flex;\n gap: 12px;\n align-items: flex-start;\n }\n .dot {\n width: 10px;\n height: 10px;\n border-radius: 10px;\n background: rgba(255, 255, 255, 0.06);\n margin-top: 6px;\n }\n\n @media (max-width: 720px) {\n .card {\n grid-template-columns: 1fr;\n padding: 20px;\n }\n .illustration {\n order: -1;\n }\n }\n\n .wobble {\n transform-origin: center;\n animation: wob 6s ease-in-out infinite;\n }\n @keyframes wob {\n 0% {\n transform: rotate(-3deg);\n }\n 50% {\n transform: rotate(3deg);\n }\n 100% {\n transform: rotate(-3deg);\n }\n }\n\n footer {\n font-size: 13px;\n color: var(--muted);\n text-align: left;\n margin-top: 18px;\n }\n </style>\n </head>\n <body>\n <main class="card">\n <div class="illustration">\n <div class="badge">\n <svg\n width="160"\n height="160"\n viewBox="0 0 64 64"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n class="wobble"\n >\n <rect\n x="6"\n y="10"\n width="52"\n height="36"\n rx="6"\n fill="rgba(125,211,252,0.06)"\n stroke="rgba(125,211,252,0.12)"\n />\n <circle cx="20" cy="28" r="4" fill="rgba(125,211,252,0.18)" />\n <rect\n x="32"\n y="24"\n width="16"\n height="6"\n rx="2"\n fill="rgba(125,211,252,0.22)"\n />\n <path\n d="M18 46c2-3 6-5 10-5s8 2 10 5"\n stroke="rgba(255,255,255,0.06)"\n stroke-width="1.5"\n stroke-linecap="round"\n />\n <path\n d="M42 20l6-6"\n stroke="rgba(255,255,255,0.06)"\n stroke-width="2"\n stroke-linecap="round"\n />\n </svg>\n </div>\n </div>\n\n <section>\n <span class="code" id="err-code">Development Server Down</span>\n <h1 id="err-title">\n For unknown reasons development server has crashed and is not\n reachable.\n </h1>\n <p class="lead">\n We hit an unexpected error while trying to load the page. This usually\n clears up quickly \u2014 here are a few options.\n </p>\n\n <div class="actions">\n <form action="/__restart__" method="POST">\n <button class="btn primary" id="retryBtn" type="submit">\n Restart\n </button>\n <a class="btn" id="homeBtn" onClick="fixWithAI()">Fix with AI</a>\n </form>\n <script type="text/javascript">\n function fixWithAI() {\n window.parent?.postMessage(\n {\n type: "clientError",\n clientErrorData: {\n errorType: "build",\n message: "Development server is not responding",\n stack: "No stack trace available",\n },\n },\n "*"\n );\n }\n </script>\n </div>\n\n <div class="suggestions">\n <div class="suggestion">\n <span class="dot"></span>\n <div>\n Try refreshing the page or press <kbd>Ctrl</kbd> + <kbd>R</kbd>.\n </div>\n </div>\n <div class="suggestion">\n <span class="dot"></span>\n <div>Check your connection or try again in a few minutes.</div>\n </div>\n <div class="suggestion">\n <span class="dot"></span>\n <div>\n If the problem persists, open an issue or contact support.\n </div>\n </div>\n </div>\n </section>\n </main>\n </body>\n</html>\n';
@@ -6768,6 +7624,34 @@ var error_server_default = '<!DOCTYPE html>\n<html lang="en">\n <head>\n <me
6768
7624
  // lib/templates/error-server-restarting.html
6769
7625
  var error_server_restarting_default = '<!DOCTYPE html>\n<html lang="en">\n <head>\n <meta charset="utf-8" />\n <meta name="viewport" content="width=device-width,initial-scale=1" />\n <title>Something went wrong \u2014 Error</title>\n <meta\n name="description"\n content="Friendly error page with suggestions and retry button."\n />\n <style>\n :root {\n --bg: #0f1724;\n --card: #0b1220;\n --accent: #7dd3fc;\n --muted: #94a3b8;\n --glass: rgba(255, 255, 255, 0.04);\n --radius: 16px;\n color-scheme: light dark;\n }\n * {\n box-sizing: border-box;\n }\n html,\n body {\n height: 100%;\n }\n body {\n margin: 0;\n font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI",\n Roboto, "Helvetica Neue", Arial;\n background: radial-gradient(\n 1200px 600px at 10% 10%,\n rgba(125, 211, 252, 0.06),\n transparent\n ),\n linear-gradient(180deg, var(--bg), #071025 80%);\n color: #e6eef8;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 32px;\n }\n\n .card {\n width: min(980px, 100%);\n background: linear-gradient(\n 180deg,\n rgba(255, 255, 255, 0.02),\n rgba(255, 255, 255, 0.01)\n );\n border: 1px solid rgba(255, 255, 255, 0.04);\n border-radius: var(--radius);\n padding: 32px;\n display: grid;\n grid-template-columns: 300px 1fr;\n gap: 24px;\n align-items: center;\n box-shadow: 0 8px 40px rgba(2, 6, 23, 0.6);\n }\n\n .illustration {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .badge {\n background: var(--glass);\n padding: 14px;\n border-radius: 14px;\n text-align: center;\n }\n .code {\n font-weight: 700;\n font-size: 48px;\n letter-spacing: -2px;\n color: var(--accent);\n display: block;\n }\n h1 {\n margin: 0 0 6px 0;\n font-size: 20px;\n }\n p.lead {\n margin: 0;\n color: var(--muted);\n }\n\n .actions {\n margin-top: 18px;\n display: flex;\n gap: 12px;\n flex-wrap: wrap;\n }\n .btn {\n background: linear-gradient(\n 180deg,\n rgba(255, 255, 255, 0.03),\n rgba(255, 255, 255, 0.01)\n );\n border: 1px solid rgba(255, 255, 255, 0.05);\n padding: 10px 14px;\n border-radius: 12px;\n cursor: pointer;\n font-weight: 600;\n color: inherit;\n text-decoration: none;\n display: inline-flex;\n align-items: center;\n gap: 10px;\n }\n .btn.primary {\n background: linear-gradient(180deg, var(--accent), #4ecfe8);\n color: #032;\n box-shadow: 0 6px 18px rgba(125, 211, 252, 0.08);\n }\n .btn.ghost {\n background: transparent;\n border: 1px dashed rgba(255, 255, 255, 0.04);\n }\n\n .details {\n background: rgba(255, 255, 255, 0.02);\n border-radius: 12px;\n padding: 18px;\n margin-top: 8px;\n color: var(--muted);\n font-size: 14px;\n }\n\n .suggestions {\n display: flex;\n flex-direction: column;\n gap: 8px;\n margin-top: 12px;\n }\n .suggestion {\n display: flex;\n gap: 12px;\n align-items: flex-start;\n }\n .dot {\n width: 10px;\n height: 10px;\n border-radius: 10px;\n background: rgba(255, 255, 255, 0.06);\n margin-top: 6px;\n }\n\n @media (max-width: 720px) {\n .card {\n grid-template-columns: 1fr;\n padding: 20px;\n }\n .illustration {\n order: -1;\n }\n }\n\n .wobble {\n transform-origin: center;\n animation: wob 6s ease-in-out infinite;\n }\n @keyframes wob {\n 0% {\n transform: rotate(-3deg);\n }\n 50% {\n transform: rotate(3deg);\n }\n 100% {\n transform: rotate(-3deg);\n }\n }\n\n footer {\n font-size: 13px;\n color: var(--muted);\n text-align: left;\n margin-top: 18px;\n }\n </style>\n </head>\n <body>\n <main class="card" role="main" aria-labelledby="err-title">\n <div class="illustration">\n <div class="badge" aria-hidden="true">\n <svg\n width="160"\n height="160"\n viewBox="0 0 64 64"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n class="wobble"\n role="img"\n aria-hidden="true"\n >\n <rect\n x="6"\n y="10"\n width="52"\n height="36"\n rx="6"\n fill="rgba(125,211,252,0.06)"\n stroke="rgba(125,211,252,0.12)"\n />\n <circle cx="20" cy="28" r="4" fill="rgba(125,211,252,0.18)" />\n <rect\n x="32"\n y="24"\n width="16"\n height="6"\n rx="2"\n fill="rgba(125,211,252,0.22)"\n />\n <path\n d="M18 46c2-3 6-5 10-5s8 2 10 5"\n stroke="rgba(255,255,255,0.06)"\n stroke-width="1.5"\n stroke-linecap="round"\n />\n <path\n d="M42 20l6-6"\n stroke="rgba(255,255,255,0.06)"\n stroke-width="2"\n stroke-linecap="round"\n />\n </svg>\n </div>\n </div>\n\n <section>\n <span class="code" id="err-code">Restarting the services...</span>\n <h1 id="err-title">Please wait...</h1>\n <script>\n function checkIfSiteIsAlive(counter = 0) {\n if (counter === 10) {\n window.location.href = "/";\n return;\n }\n\n fetch("/")\n .then((response) => {\n if (response.ok) {\n window.location.href = "/";\n return;\n }\n return Promise.reject();\n })\n .catch((error) => {\n console.error(\n "monitor:error",\n "server is not yet reachable",\n error\n );\n setTimeout(() => checkIfSiteIsAlive(counter + 1), 2_000);\n });\n }\n checkIfSiteIsAlive();\n </script>\n <p class="lead">Waiting for server to restart</p>\n </section>\n </main>\n </body>\n</html>\n';
6770
7626
 
7627
+ // lib/templates/error-client.html
7628
+ var error_client_default = '<style>\n :root {\n --bg: #0f1724;\n --card: #0b1220;\n --accent: #7dd3fc;\n --muted: #94a3b8;\n --glass: rgba(255, 255, 255, 0.04);\n --radius: 16px;\n color-scheme: light dark;\n }\n * {\n box-sizing: border-box;\n }\n html,\n body {\n height: 100%;\n }\n body {\n margin: 0;\n font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI",\n Roboto, "Helvetica Neue", Arial;\n background: radial-gradient(\n 1200px 600px at 10% 10%,\n rgba(125, 211, 252, 0.06),\n transparent\n ),\n linear-gradient(180deg, var(--bg), #071025 80%);\n color: #e6eef8;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 32px;\n }\n .card {\n width: min(980px, 100%);\n background: linear-gradient(\n 180deg,\n rgba(255, 255, 255, 0.02),\n rgba(255, 255, 255, 0.01)\n );\n border: 1px solid rgba(255, 255, 255, 0.04);\n border-radius: var(--radius);\n padding: 32px;\n display: grid;\n grid-template-columns: 300px 1fr;\n gap: 24px;\n align-items: center;\n box-shadow: 0 8px 40px rgba(2, 6, 23, 0.6);\n }\n .illustration {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .badge {\n background: var(--glass);\n padding: 14px;\n border-radius: 14px;\n text-align: center;\n }\n .code {\n font-weight: 700;\n font-size: 48px;\n letter-spacing: -2px;\n color: var(--accent);\n display: block;\n }\n h1 {\n margin: 0 0 6px 0;\n font-size: 20px;\n }\n p.lead {\n margin: 0;\n color: var(--muted);\n }\n .actions {\n margin-top: 18px;\n display: flex;\n gap: 12px;\n flex-wrap: wrap;\n }\n .btn {\n background: linear-gradient(\n 180deg,\n rgba(255, 255, 255, 0.03),\n rgba(255, 255, 255, 0.01)\n );\n border: 1px solid rgba(255, 255, 255, 0.05);\n padding: 10px 14px;\n border-radius: 12px;\n cursor: pointer;\n font-weight: 600;\n color: inherit;\n text-decoration: none;\n display: inline-flex;\n align-items: center;\n gap: 10px;\n }\n .btn.primary {\n background: linear-gradient(180deg, var(--accent), #4ecfe8);\n color: #032;\n box-shadow: 0 6px 18px rgba(125, 211, 252, 0.08);\n }\n @media (max-width: 720px) {\n .card {\n grid-template-columns: 1fr;\n padding: 20px;\n }\n .illustration {\n order: -1;\n }\n }\n .wobble {\n transform-origin: center;\n animation: wob 6s ease-in-out infinite;\n }\n @keyframes wob {\n 0% {\n transform: rotate(-3deg);\n }\n 50% {\n transform: rotate(3deg);\n }\n 100% {\n transform: rotate(-3deg);\n }\n }\n</style>\n<main class="card">\n <div class="illustration">\n <div class="badge">\n <svg\n width="160"\n height="160"\n viewBox="0 0 64 64"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n class="wobble"\n role="img"\n aria-hidden="true"\n >\n <rect\n x="6"\n y="10"\n width="52"\n height="36"\n rx="6"\n fill="rgba(125,211,252,0.06)"\n stroke="rgba(125,211,252,0.12)"\n />\n <circle cx="20" cy="28" r="4" fill="rgba(125,211,252,0.18)" />\n <rect\n x="32"\n y="24"\n width="16"\n height="6"\n rx="2"\n fill="rgba(125,211,252,0.22)"\n />\n <path\n d="M18 46c2-3 6-5 10-5s8 2 10 5"\n stroke="rgba(255,255,255,0.06)"\n stroke-width="1.5"\n stroke-linecap="round"\n />\n <path\n d="M42 20l6-6"\n stroke="rgba(255,255,255,0.06)"\n stroke-width="2"\n stroke-linecap="round"\n />\n </svg>\n </div>\n </div>\n\n <section>\n <span class="code" id="err-code">Build Error Occurred</span>\n <h1 id="err-title">We failed to build Your project</h1>\n <p class="lead">\n We hit an unexpected error while trying to build your project. Use an AI\n to get it fixed automatically.\n </p>\n <div class="actions">\n <a class="btn primary" id="homeBtn" onClick="fixWithAI()">Fix with AI</a>\n </div>\n </section>\n</main>\n';
7629
+
7630
+ // lib/config.ts
7631
+ var Template = (0, import_variant.variant)({
7632
+ SERVER: {},
7633
+ SERVER_RESTARTING: {},
7634
+ CLIENT: {}
7635
+ });
7636
+ var DEFAULT_TEMPLATE_LOCATION = ".dev-machine-monitor";
7637
+ function getTemplate(templateType) {
7638
+ return (0, import_variant.match)(templateType, {
7639
+ SERVER: () => readTemplateSafely(`${DEFAULT_TEMPLATE_LOCATION}/error-server.html`) || error_server_default,
7640
+ SERVER_RESTARTING: () => readTemplateSafely(`${DEFAULT_TEMPLATE_LOCATION}/error-server-restarting.html`) || error_server_restarting_default,
7641
+ CLIENT: () => readTemplateSafely(`${DEFAULT_TEMPLATE_LOCATION}/error-client.html`) || error_client_default
7642
+ });
7643
+ }
7644
+ function readTemplateSafely(fileName) {
7645
+ const fullPath = (0, import_node_path.join)(import_node_process2.default.cwd(), fileName);
7646
+ if ((0, import_node_fs.existsSync)(fullPath)) {
7647
+ try {
7648
+ return (0, import_node_fs.readFileSync)(fullPath, { encoding: "utf8" }).toString();
7649
+ } catch {
7650
+ }
7651
+ }
7652
+ return void 0;
7653
+ }
7654
+
6771
7655
  // lib/run-proxy.ts
6772
7656
  async function runProxy(proxyFrom, proxyTo, stdio) {
6773
7657
  const proxy = import_http_proxy_3.default.createProxy({
@@ -6780,9 +7664,10 @@ async function runProxy(proxyFrom, proxyTo, stdio) {
6780
7664
  const httpServer = http.createServer((req, res) => {
6781
7665
  if (req.url?.startsWith("/__restart__") && req.method === "POST") {
6782
7666
  onRestart();
7667
+ const templateData = { env: import_node_process3.default.env };
6783
7668
  res.writeHead(500, {
6784
7669
  "Content-Type": "text/html"
6785
- }).end(error_server_restarting_default);
7670
+ }).end(import_mustache.default.render(getTemplate(Template.SERVER_RESTARTING()), templateData));
6786
7671
  } else {
6787
7672
  proxy.web(req, res, { target: proxyTo });
6788
7673
  }
@@ -6795,12 +7680,13 @@ async function runProxy(proxyFrom, proxyTo, stdio) {
6795
7680
  });
6796
7681
  }
6797
7682
  );
6798
- proxy.on("error", (_err, _req, res) => {
7683
+ proxy.on("error", (error, _req, res) => {
6799
7684
  if ("req" in res) {
6800
7685
  if (!res.headersSent && !res.writableEnded) {
7686
+ const templateData = { error, env: import_node_process3.default.env };
6801
7687
  res.writeHead(500, {
6802
7688
  "Content-Type": "text/html"
6803
- }).end(error_server_default);
7689
+ }).end(import_mustache.default.render(getTemplate(Template.SERVER()), templateData));
6804
7690
  }
6805
7691
  } else {
6806
7692
  res.end();
@@ -6824,7 +7710,7 @@ async function runProxy(proxyFrom, proxyTo, stdio) {
6824
7710
 
6825
7711
  // lib/run-command.ts
6826
7712
  var import_strict4 = require("node:assert/strict");
6827
- var import_node_process12 = __toESM(require("node:process"), 1);
7713
+ var import_node_process14 = __toESM(require("node:process"), 1);
6828
7714
 
6829
7715
  // ../../node_modules/is-plain-obj/index.js
6830
7716
  function isPlainObject(value) {
@@ -7026,9 +7912,9 @@ var import_node_child_process3 = require("node:child_process");
7026
7912
  var import_node_util = require("node:util");
7027
7913
 
7028
7914
  // ../../node_modules/execa/lib/utils/standard-stream.js
7029
- var import_node_process2 = __toESM(require("node:process"), 1);
7915
+ var import_node_process4 = __toESM(require("node:process"), 1);
7030
7916
  var isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
7031
- var STANDARD_STREAMS = [import_node_process2.default.stdin, import_node_process2.default.stdout, import_node_process2.default.stderr];
7917
+ var STANDARD_STREAMS = [import_node_process4.default.stdin, import_node_process4.default.stdout, import_node_process4.default.stderr];
7032
7918
  var STANDARD_STREAMS_ALIASES = ["stdin", "stdout", "stderr"];
7033
7919
  var getStreamName = (fdNumber) => STANDARD_STREAMS_ALIASES[fdNumber] ?? `stdio[${fdNumber}]`;
7034
7920
 
@@ -7118,7 +8004,7 @@ var VERBOSE_VALUES = ["none", "short", "full"];
7118
8004
  var import_node_util3 = require("node:util");
7119
8005
 
7120
8006
  // ../../node_modules/execa/lib/arguments/escape.js
7121
- var import_node_process3 = require("node:process");
8007
+ var import_node_process5 = require("node:process");
7122
8008
  var import_node_util2 = require("node:util");
7123
8009
  var joinCommand = (filePath, rawArguments) => {
7124
8010
  const fileAndArguments = [filePath, ...rawArguments];
@@ -7158,16 +8044,16 @@ var quoteString = (escapedArgument) => {
7158
8044
  if (NO_ESCAPE_REGEXP.test(escapedArgument)) {
7159
8045
  return escapedArgument;
7160
8046
  }
7161
- return import_node_process3.platform === "win32" ? `"${escapedArgument.replaceAll('"', '""')}"` : `'${escapedArgument.replaceAll("'", "'\\''")}'`;
8047
+ return import_node_process5.platform === "win32" ? `"${escapedArgument.replaceAll('"', '""')}"` : `'${escapedArgument.replaceAll("'", "'\\''")}'`;
7162
8048
  };
7163
8049
  var NO_ESCAPE_REGEXP = /^[\w./-]+$/;
7164
8050
 
7165
8051
  // ../../node_modules/is-unicode-supported/index.js
7166
- var import_node_process4 = __toESM(require("node:process"), 1);
8052
+ var import_node_process6 = __toESM(require("node:process"), 1);
7167
8053
  function isUnicodeSupported() {
7168
- const { env: env2 } = import_node_process4.default;
8054
+ const { env: env2 } = import_node_process6.default;
7169
8055
  const { TERM, TERM_PROGRAM } = env2;
7170
- if (import_node_process4.default.platform !== "win32") {
8056
+ if (import_node_process6.default.platform !== "win32") {
7171
8057
  return TERM !== "linux";
7172
8058
  }
7173
8059
  return Boolean(env2.WT_SESSION) || Boolean(env2.TERMINUS_SUBLIME) || env2.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env2.TERMINAL_EMULATOR === "JetBrains-JediTerm";
@@ -7650,9 +8536,9 @@ var validateVerbose = (verbose) => {
7650
8536
  };
7651
8537
 
7652
8538
  // ../../node_modules/execa/lib/return/duration.js
7653
- var import_node_process5 = require("node:process");
7654
- var getStartTime = () => import_node_process5.hrtime.bigint();
7655
- var getDurationMs = (startTime) => Number(import_node_process5.hrtime.bigint() - startTime) / 1e6;
8539
+ var import_node_process7 = require("node:process");
8540
+ var getStartTime = () => import_node_process7.hrtime.bigint();
8541
+ var getDurationMs = (startTime) => Number(import_node_process7.hrtime.bigint() - startTime) / 1e6;
7656
8542
 
7657
8543
  // ../../node_modules/execa/lib/arguments/command.js
7658
8544
  var handleCommand = (filePath, rawArguments, rawOptions) => {
@@ -7670,13 +8556,13 @@ var handleCommand = (filePath, rawArguments, rawOptions) => {
7670
8556
  };
7671
8557
 
7672
8558
  // ../../node_modules/execa/lib/arguments/options.js
7673
- var import_node_path5 = __toESM(require("node:path"), 1);
7674
- var import_node_process9 = __toESM(require("node:process"), 1);
8559
+ var import_node_path6 = __toESM(require("node:path"), 1);
8560
+ var import_node_process11 = __toESM(require("node:process"), 1);
7675
8561
  var import_cross_spawn = __toESM(require_cross_spawn(), 1);
7676
8562
 
7677
8563
  // ../../node_modules/npm-run-path/index.js
7678
- var import_node_process6 = __toESM(require("node:process"), 1);
7679
- var import_node_path2 = __toESM(require("node:path"), 1);
8564
+ var import_node_process8 = __toESM(require("node:process"), 1);
8565
+ var import_node_path3 = __toESM(require("node:path"), 1);
7680
8566
 
7681
8567
  // ../../node_modules/npm-run-path/node_modules/path-key/index.js
7682
8568
  function pathKey(options = {}) {
@@ -7693,7 +8579,7 @@ function pathKey(options = {}) {
7693
8579
  // ../../node_modules/unicorn-magic/node.js
7694
8580
  var import_node_util4 = require("node:util");
7695
8581
  var import_node_child_process2 = require("node:child_process");
7696
- var import_node_path = __toESM(require("node:path"), 1);
8582
+ var import_node_path2 = __toESM(require("node:path"), 1);
7697
8583
  var import_node_url2 = require("node:url");
7698
8584
  var execFileOriginal = (0, import_node_util4.promisify)(import_node_child_process2.execFile);
7699
8585
  function toPath(urlOrPath) {
@@ -7702,12 +8588,12 @@ function toPath(urlOrPath) {
7702
8588
  function traversePathUp(startPath) {
7703
8589
  return {
7704
8590
  *[Symbol.iterator]() {
7705
- let currentPath = import_node_path.default.resolve(toPath(startPath));
8591
+ let currentPath = import_node_path2.default.resolve(toPath(startPath));
7706
8592
  let previousPath;
7707
8593
  while (previousPath !== currentPath) {
7708
8594
  yield currentPath;
7709
8595
  previousPath = currentPath;
7710
- currentPath = import_node_path.default.resolve(currentPath, "..");
8596
+ currentPath = import_node_path2.default.resolve(currentPath, "..");
7711
8597
  }
7712
8598
  }
7713
8599
  };
@@ -7716,38 +8602,38 @@ var TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
7716
8602
 
7717
8603
  // ../../node_modules/npm-run-path/index.js
7718
8604
  var npmRunPath = ({
7719
- cwd = import_node_process6.default.cwd(),
7720
- path: pathOption = import_node_process6.default.env[pathKey()],
8605
+ cwd = import_node_process8.default.cwd(),
8606
+ path: pathOption = import_node_process8.default.env[pathKey()],
7721
8607
  preferLocal = true,
7722
- execPath: execPath2 = import_node_process6.default.execPath,
8608
+ execPath: execPath2 = import_node_process8.default.execPath,
7723
8609
  addExecPath = true
7724
8610
  } = {}) => {
7725
- const cwdPath = import_node_path2.default.resolve(toPath(cwd));
8611
+ const cwdPath = import_node_path3.default.resolve(toPath(cwd));
7726
8612
  const result = [];
7727
- const pathParts = pathOption.split(import_node_path2.default.delimiter);
8613
+ const pathParts = pathOption.split(import_node_path3.default.delimiter);
7728
8614
  if (preferLocal) {
7729
8615
  applyPreferLocal(result, pathParts, cwdPath);
7730
8616
  }
7731
8617
  if (addExecPath) {
7732
8618
  applyExecPath(result, pathParts, execPath2, cwdPath);
7733
8619
  }
7734
- return pathOption === "" || pathOption === import_node_path2.default.delimiter ? `${result.join(import_node_path2.default.delimiter)}${pathOption}` : [...result, pathOption].join(import_node_path2.default.delimiter);
8620
+ return pathOption === "" || pathOption === import_node_path3.default.delimiter ? `${result.join(import_node_path3.default.delimiter)}${pathOption}` : [...result, pathOption].join(import_node_path3.default.delimiter);
7735
8621
  };
7736
8622
  var applyPreferLocal = (result, pathParts, cwdPath) => {
7737
8623
  for (const directory of traversePathUp(cwdPath)) {
7738
- const pathPart = import_node_path2.default.join(directory, "node_modules/.bin");
8624
+ const pathPart = import_node_path3.default.join(directory, "node_modules/.bin");
7739
8625
  if (!pathParts.includes(pathPart)) {
7740
8626
  result.push(pathPart);
7741
8627
  }
7742
8628
  }
7743
8629
  };
7744
8630
  var applyExecPath = (result, pathParts, execPath2, cwdPath) => {
7745
- const pathPart = import_node_path2.default.resolve(cwdPath, toPath(execPath2), "..");
8631
+ const pathPart = import_node_path3.default.resolve(cwdPath, toPath(execPath2), "..");
7746
8632
  if (!pathParts.includes(pathPart)) {
7747
8633
  result.push(pathPart);
7748
8634
  }
7749
8635
  };
7750
- var npmRunPathEnv = ({ env: env2 = import_node_process6.default.env, ...options } = {}) => {
8636
+ var npmRunPathEnv = ({ env: env2 = import_node_process8.default.env, ...options } = {}) => {
7751
8637
  env2 = { ...env2 };
7752
8638
  const pathName = pathKey({ env: env2 });
7753
8639
  options.path = env2[pathName];
@@ -8896,8 +9782,8 @@ var killAfterTimeout = async (subprocess, timeout, context, { signal }) => {
8896
9782
  };
8897
9783
 
8898
9784
  // ../../node_modules/execa/lib/methods/node.js
8899
- var import_node_process7 = require("node:process");
8900
- var import_node_path3 = __toESM(require("node:path"), 1);
9785
+ var import_node_process9 = require("node:process");
9786
+ var import_node_path4 = __toESM(require("node:path"), 1);
8901
9787
  var mapNode = ({ options }) => {
8902
9788
  if (options.node === false) {
8903
9789
  throw new TypeError('The "node" option cannot be false with `execaNode()`.');
@@ -8906,8 +9792,8 @@ var mapNode = ({ options }) => {
8906
9792
  };
8907
9793
  var handleNodeOption = (file, commandArguments, {
8908
9794
  node: shouldHandleNode = false,
8909
- nodePath = import_node_process7.execPath,
8910
- nodeOptions = import_node_process7.execArgv.filter((nodeOption) => !nodeOption.startsWith("--inspect")),
9795
+ nodePath = import_node_process9.execPath,
9796
+ nodeOptions = import_node_process9.execArgv.filter((nodeOption) => !nodeOption.startsWith("--inspect")),
8911
9797
  cwd,
8912
9798
  execPath: formerNodePath,
8913
9799
  ...options
@@ -8916,7 +9802,7 @@ var handleNodeOption = (file, commandArguments, {
8916
9802
  throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');
8917
9803
  }
8918
9804
  const normalizedNodePath = safeNormalizeFileUrl(nodePath, 'The "nodePath" option');
8919
- const resolvedNodePath = import_node_path3.default.resolve(cwd, normalizedNodePath);
9805
+ const resolvedNodePath = import_node_path4.default.resolve(cwd, normalizedNodePath);
8920
9806
  const newOptions = {
8921
9807
  ...options,
8922
9808
  nodePath: resolvedNodePath,
@@ -8926,7 +9812,7 @@ var handleNodeOption = (file, commandArguments, {
8926
9812
  if (!shouldHandleNode) {
8927
9813
  return [file, commandArguments, newOptions];
8928
9814
  }
8929
- if (import_node_path3.default.basename(file, ".exe") === "node") {
9815
+ if (import_node_path4.default.basename(file, ".exe") === "node") {
8930
9816
  throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');
8931
9817
  }
8932
9818
  return [
@@ -9015,16 +9901,16 @@ var ENCODING_ALIASES = {
9015
9901
  var serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encoding}"` : String(encoding);
9016
9902
 
9017
9903
  // ../../node_modules/execa/lib/arguments/cwd.js
9018
- var import_node_fs = require("node:fs");
9019
- var import_node_path4 = __toESM(require("node:path"), 1);
9020
- var import_node_process8 = __toESM(require("node:process"), 1);
9904
+ var import_node_fs2 = require("node:fs");
9905
+ var import_node_path5 = __toESM(require("node:path"), 1);
9906
+ var import_node_process10 = __toESM(require("node:process"), 1);
9021
9907
  var normalizeCwd = (cwd = getDefaultCwd()) => {
9022
9908
  const cwdString = safeNormalizeFileUrl(cwd, 'The "cwd" option');
9023
- return import_node_path4.default.resolve(cwdString);
9909
+ return import_node_path5.default.resolve(cwdString);
9024
9910
  };
9025
9911
  var getDefaultCwd = () => {
9026
9912
  try {
9027
- return import_node_process8.default.cwd();
9913
+ return import_node_process10.default.cwd();
9028
9914
  } catch (error) {
9029
9915
  error.message = `The current directory does not exist.
9030
9916
  ${error.message}`;
@@ -9037,7 +9923,7 @@ var fixCwdError = (originalMessage, cwd) => {
9037
9923
  }
9038
9924
  let cwdStat;
9039
9925
  try {
9040
- cwdStat = (0, import_node_fs.statSync)(cwd);
9926
+ cwdStat = (0, import_node_fs2.statSync)(cwd);
9041
9927
  } catch (error) {
9042
9928
  return `The "cwd" option is invalid: ${cwd}.
9043
9929
  ${error.message}
@@ -9067,7 +9953,7 @@ var normalizeOptions = (filePath, rawArguments, rawOptions) => {
9067
9953
  options.killSignal = normalizeKillSignal(options.killSignal);
9068
9954
  options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
9069
9955
  options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
9070
- if (import_node_process9.default.platform === "win32" && import_node_path5.default.basename(file, ".exe") === "cmd") {
9956
+ if (import_node_process11.default.platform === "win32" && import_node_path6.default.basename(file, ".exe") === "cmd") {
9071
9957
  commandArguments.unshift("/q");
9072
9958
  }
9073
9959
  return { file, commandArguments, options };
@@ -9108,7 +9994,7 @@ var addDefaultOptions = ({
9108
9994
  serialization
9109
9995
  });
9110
9996
  var getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
9111
- const env2 = extendEnv ? { ...import_node_process9.default.env, ...envOption } : envOption;
9997
+ const env2 = extendEnv ? { ...import_node_process11.default.env, ...envOption } : envOption;
9112
9998
  if (preferLocal || node) {
9113
9999
  return npmRunPathEnv({
9114
10000
  env: env2,
@@ -10042,7 +10928,7 @@ var handleResult = (result, verboseInfo, { reject }) => {
10042
10928
  };
10043
10929
 
10044
10930
  // ../../node_modules/execa/lib/stdio/handle-sync.js
10045
- var import_node_fs3 = require("node:fs");
10931
+ var import_node_fs4 = require("node:fs");
10046
10932
 
10047
10933
  // ../../node_modules/execa/lib/stdio/type.js
10048
10934
  var getStdioItemType = (value, optionName) => {
@@ -10285,7 +11171,7 @@ var normalizeGenerator = ({ stdioItem, stdioItem: { value }, index, newTransform
10285
11171
  var sortTransforms = (newTransforms, direction) => direction === "input" ? newTransforms.reverse() : newTransforms;
10286
11172
 
10287
11173
  // ../../node_modules/execa/lib/stdio/direction.js
10288
- var import_node_process10 = __toESM(require("node:process"), 1);
11174
+ var import_node_process12 = __toESM(require("node:process"), 1);
10289
11175
  var getStreamDirection = (stdioItems, fdNumber, optionName) => {
10290
11176
  const directions = stdioItems.map((stdioItem) => getStdioItemDirection(stdioItem, fdNumber));
10291
11177
  if (directions.includes("input") && directions.includes("output")) {
@@ -10325,10 +11211,10 @@ var guessStreamDirection = {
10325
11211
  }
10326
11212
  };
10327
11213
  var getStandardStreamDirection = (value) => {
10328
- if ([0, import_node_process10.default.stdin].includes(value)) {
11214
+ if ([0, import_node_process12.default.stdin].includes(value)) {
10329
11215
  return "input";
10330
11216
  }
10331
- if ([1, 2, import_node_process10.default.stdout, import_node_process10.default.stderr].includes(value)) {
11217
+ if ([1, 2, import_node_process12.default.stdout, import_node_process12.default.stderr].includes(value)) {
10332
11218
  return "output";
10333
11219
  }
10334
11220
  };
@@ -10372,7 +11258,7 @@ var normalizeStdioSync = (stdioArray, buffer, verboseInfo) => stdioArray.map((st
10372
11258
  var isOutputPipeOnly = (stdioOption) => stdioOption === "pipe" || Array.isArray(stdioOption) && stdioOption.every((item) => item === "pipe");
10373
11259
 
10374
11260
  // ../../node_modules/execa/lib/stdio/native.js
10375
- var import_node_fs2 = require("node:fs");
11261
+ var import_node_fs3 = require("node:fs");
10376
11262
  var import_node_tty3 = __toESM(require("node:tty"), 1);
10377
11263
  var handleNativeStream = ({ stdioItem, stdioItem: { type }, isStdioArray, fdNumber, direction, isSync }) => {
10378
11264
  if (!isStdioArray || type !== "native") {
@@ -10406,7 +11292,7 @@ var getTargetFd = ({ value, optionName, fdNumber, direction }) => {
10406
11292
  if (import_node_tty3.default.isatty(targetFdNumber)) {
10407
11293
  throw new TypeError(`The \`${optionName}: ${serializeOptionValue(value)}\` option is invalid: it cannot be a TTY with synchronous methods.`);
10408
11294
  }
10409
- return { type: "uint8Array", value: bufferToUint8Array((0, import_node_fs2.readFileSync)(targetFdNumber)), optionName };
11295
+ return { type: "uint8Array", value: bufferToUint8Array((0, import_node_fs3.readFileSync)(targetFdNumber)), optionName };
10410
11296
  };
10411
11297
  var getTargetFdNumber = (value, fdNumber) => {
10412
11298
  if (value === "inherit") {
@@ -10739,8 +11625,8 @@ var addProperties = {
10739
11625
  var addPropertiesSync = {
10740
11626
  input: {
10741
11627
  ...addProperties,
10742
- fileUrl: ({ value }) => ({ contents: [bufferToUint8Array((0, import_node_fs3.readFileSync)(value))] }),
10743
- filePath: ({ value: { file } }) => ({ contents: [bufferToUint8Array((0, import_node_fs3.readFileSync)(file))] }),
11628
+ fileUrl: ({ value }) => ({ contents: [bufferToUint8Array((0, import_node_fs4.readFileSync)(value))] }),
11629
+ filePath: ({ value: { file } }) => ({ contents: [bufferToUint8Array((0, import_node_fs4.readFileSync)(file))] }),
10744
11630
  fileNumber: forbiddenIfSync,
10745
11631
  iterable: ({ value }) => ({ contents: [...value] }),
10746
11632
  string: ({ value }) => ({ contents: [value] }),
@@ -11086,7 +11972,7 @@ var validateSerializable = (newContents) => {
11086
11972
  };
11087
11973
 
11088
11974
  // ../../node_modules/execa/lib/io/output-sync.js
11089
- var import_node_fs4 = require("node:fs");
11975
+ var import_node_fs5 = require("node:fs");
11090
11976
 
11091
11977
  // ../../node_modules/execa/lib/verbose/output.js
11092
11978
  var shouldLogOutput = ({ stdioItems, encoding, verboseInfo, fdNumber }) => fdNumber !== "all" && isFullVerbose(verboseInfo, fdNumber) && !BINARY_ENCODINGS.has(encoding) && fdUsesVerbose(fdNumber) && (stdioItems.some(({ type, value }) => type === "native" && PIPED_STDIO_VALUES.has(value)) || stdioItems.every(({ type }) => TRANSFORM_TYPES.has(type)));
@@ -11210,10 +12096,10 @@ var writeToFiles = (serializedResult, stdioItems, outputFiles) => {
11210
12096
  for (const { path: path6, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
11211
12097
  const pathString = typeof path6 === "string" ? path6 : path6.toString();
11212
12098
  if (append || outputFiles.has(pathString)) {
11213
- (0, import_node_fs4.appendFileSync)(path6, serializedResult);
12099
+ (0, import_node_fs5.appendFileSync)(path6, serializedResult);
11214
12100
  } else {
11215
12101
  outputFiles.add(pathString);
11216
- (0, import_node_fs4.writeFileSync)(path6, serializedResult);
12102
+ (0, import_node_fs5.writeFileSync)(path6, serializedResult);
11217
12103
  }
11218
12104
  }
11219
12105
  };
@@ -11432,7 +12318,7 @@ var import_node_events14 = require("node:events");
11432
12318
  var import_node_child_process5 = require("node:child_process");
11433
12319
 
11434
12320
  // ../../node_modules/execa/lib/ipc/methods.js
11435
- var import_node_process11 = __toESM(require("node:process"), 1);
12321
+ var import_node_process13 = __toESM(require("node:process"), 1);
11436
12322
 
11437
12323
  // ../../node_modules/execa/lib/ipc/get-one.js
11438
12324
  var import_node_events8 = require("node:events");
@@ -11573,9 +12459,9 @@ var addIpcMethods = (subprocess, { ipc }) => {
11573
12459
  Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
11574
12460
  };
11575
12461
  var getIpcExport = () => {
11576
- const anyProcess = import_node_process11.default;
12462
+ const anyProcess = import_node_process13.default;
11577
12463
  const isSubprocess = true;
11578
- const ipc = import_node_process11.default.channel !== void 0;
12464
+ const ipc = import_node_process13.default.channel !== void 0;
11579
12465
  return {
11580
12466
  ...getIpcMethods(anyProcess, isSubprocess, ipc),
11581
12467
  getCancelSignal: getCancelSignal.bind(void 0, {
@@ -11657,7 +12543,7 @@ var duplex = () => new import_node_stream2.Duplex({ read() {
11657
12543
  var handleDummyPromise = async (error, verboseInfo, options) => handleResult(error, verboseInfo, options);
11658
12544
 
11659
12545
  // ../../node_modules/execa/lib/stdio/handle-async.js
11660
- var import_node_fs5 = require("node:fs");
12546
+ var import_node_fs6 = require("node:fs");
11661
12547
  var import_node_buffer3 = require("node:buffer");
11662
12548
  var import_node_stream3 = require("node:stream");
11663
12549
  var handleStdioAsync = (options, verboseInfo) => handleStdio(addPropertiesAsync, options, verboseInfo, false);
@@ -11681,8 +12567,8 @@ var addProperties2 = {
11681
12567
  var addPropertiesAsync = {
11682
12568
  input: {
11683
12569
  ...addProperties2,
11684
- fileUrl: ({ value }) => ({ stream: (0, import_node_fs5.createReadStream)(value) }),
11685
- filePath: ({ value: { file } }) => ({ stream: (0, import_node_fs5.createReadStream)(file) }),
12570
+ fileUrl: ({ value }) => ({ stream: (0, import_node_fs6.createReadStream)(value) }),
12571
+ filePath: ({ value: { file } }) => ({ stream: (0, import_node_fs6.createReadStream)(file) }),
11686
12572
  webStream: ({ value }) => ({ stream: import_node_stream3.Readable.fromWeb(value) }),
11687
12573
  iterable: ({ value }) => ({ stream: import_node_stream3.Readable.from(value) }),
11688
12574
  asyncIterable: ({ value }) => ({ stream: import_node_stream3.Readable.from(value) }),
@@ -11691,8 +12577,8 @@ var addPropertiesAsync = {
11691
12577
  },
11692
12578
  output: {
11693
12579
  ...addProperties2,
11694
- fileUrl: ({ value }) => ({ stream: (0, import_node_fs5.createWriteStream)(value) }),
11695
- filePath: ({ value: { file, append } }) => ({ stream: (0, import_node_fs5.createWriteStream)(file, append ? { flags: "a" } : {}) }),
12580
+ fileUrl: ({ value }) => ({ stream: (0, import_node_fs6.createWriteStream)(value) }),
12581
+ filePath: ({ value: { file, append } }) => ({ stream: (0, import_node_fs6.createWriteStream)(file, append ? { flags: "a" } : {}) }),
11696
12582
  webStream: ({ value }) => ({ stream: import_node_stream3.Writable.fromWeb(value) }),
11697
12583
  iterable: forbiddenIfAsync,
11698
12584
  asyncIterable: forbiddenIfAsync,
@@ -12036,7 +12922,7 @@ if (process.platform === "linux") {
12036
12922
  }
12037
12923
 
12038
12924
  // ../../node_modules/signal-exit/dist/mjs/index.js
12039
- var processOk = (process13) => !!process13 && typeof process13 === "object" && typeof process13.removeListener === "function" && typeof process13.emit === "function" && typeof process13.reallyExit === "function" && typeof process13.listeners === "function" && typeof process13.kill === "function" && typeof process13.pid === "number" && typeof process13.on === "function";
12925
+ var processOk = (process15) => !!process15 && typeof process15 === "object" && typeof process15.removeListener === "function" && typeof process15.emit === "function" && typeof process15.reallyExit === "function" && typeof process15.listeners === "function" && typeof process15.kill === "function" && typeof process15.pid === "number" && typeof process15.on === "function";
12040
12926
  var kExitEmitter = Symbol.for("signal-exit emitter");
12041
12927
  var global2 = globalThis;
12042
12928
  var ObjectDefineProperty = Object.defineProperty.bind(Object);
@@ -12121,7 +13007,7 @@ var SignalExit = class extends SignalExitBase {
12121
13007
  // "SIGHUP" throws an `ENOSYS` error on Windows,
12122
13008
  // so use a supported signal instead
12123
13009
  /* c8 ignore start */
12124
- #hupSig = process10.platform === "win32" ? "SIGINT" : "SIGHUP";
13010
+ #hupSig = process12.platform === "win32" ? "SIGINT" : "SIGHUP";
12125
13011
  /* c8 ignore stop */
12126
13012
  #emitter = new Emitter();
12127
13013
  #process;
@@ -12129,15 +13015,15 @@ var SignalExit = class extends SignalExitBase {
12129
13015
  #originalProcessReallyExit;
12130
13016
  #sigListeners = {};
12131
13017
  #loaded = false;
12132
- constructor(process13) {
13018
+ constructor(process15) {
12133
13019
  super();
12134
- this.#process = process13;
13020
+ this.#process = process15;
12135
13021
  this.#sigListeners = {};
12136
13022
  for (const sig of signals) {
12137
13023
  this.#sigListeners[sig] = () => {
12138
13024
  const listeners = this.#process.listeners(sig);
12139
13025
  let { count: count2 } = this.#emitter;
12140
- const p = process13;
13026
+ const p = process15;
12141
13027
  if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
12142
13028
  count2 += p.__signal_exit_emitter__.count;
12143
13029
  }
@@ -12146,12 +13032,12 @@ var SignalExit = class extends SignalExitBase {
12146
13032
  const ret = this.#emitter.emit("exit", null, sig);
12147
13033
  const s = sig === "SIGHUP" ? this.#hupSig : sig;
12148
13034
  if (!ret)
12149
- process13.kill(process13.pid, s);
13035
+ process15.kill(process15.pid, s);
12150
13036
  }
12151
13037
  };
12152
13038
  }
12153
- this.#originalProcessReallyExit = process13.reallyExit;
12154
- this.#originalProcessEmit = process13.emit;
13039
+ this.#originalProcessReallyExit = process15.reallyExit;
13040
+ this.#originalProcessEmit = process15.emit;
12155
13041
  }
12156
13042
  onExit(cb, opts) {
12157
13043
  if (!processOk(this.#process)) {
@@ -12232,7 +13118,7 @@ var SignalExit = class extends SignalExitBase {
12232
13118
  }
12233
13119
  }
12234
13120
  };
12235
- var process10 = globalThis.process;
13121
+ var process12 = globalThis.process;
12236
13122
  var {
12237
13123
  /**
12238
13124
  * Called when the process is exiting, whether via signal, explicit
@@ -12260,7 +13146,7 @@ var {
12260
13146
  * @internal
12261
13147
  */
12262
13148
  unload
12263
- } = signalExitWrap(processOk(process10) ? new SignalExit(process10) : new SignalExitFallback());
13149
+ } = signalExitWrap(processOk(process12) ? new SignalExit(process12) : new SignalExitFallback());
12264
13150
 
12265
13151
  // ../../node_modules/execa/lib/terminate/cleanup.js
12266
13152
  var cleanupOnExit = (subprocess, { cleanup, detached }, { signal }) => {
@@ -13605,9 +14491,9 @@ var {
13605
14491
  function runCommand([file, ...args]) {
13606
14492
  (0, import_strict4.ok)(file != null, "Unknown command/file to execute");
13607
14493
  const result = execa(file, args, {
13608
- cwd: import_node_process12.default.cwd(),
14494
+ cwd: import_node_process14.default.cwd(),
13609
14495
  stdio: "pipe",
13610
- env: import_node_process12.default.env,
14496
+ env: import_node_process14.default.env,
13611
14497
  cleanup: true,
13612
14498
  windowsHide: false,
13613
14499
  preferLocal: true
@@ -13623,11 +14509,11 @@ function runCommand([file, ...args]) {
13623
14509
  result.on("error", (error) => {
13624
14510
  });
13625
14511
  result.stdout.on("data", (chunk) => {
13626
- import_node_process12.default.stdout.write(chunk);
14512
+ import_node_process14.default.stdout.write(chunk);
13627
14513
  onStdio(chunk);
13628
14514
  });
13629
14515
  result.stderr.on("data", (chunk) => {
13630
- import_node_process12.default.stderr.write(chunk);
14516
+ import_node_process14.default.stderr.write(chunk);
13631
14517
  onStdio(chunk);
13632
14518
  });
13633
14519
  result.on("exit", (code) => onExit2(code));
@@ -13668,15 +14554,11 @@ program.requiredOption("-f, --proxy-from <URL>", "Proxy host URL (e.g. http://lo
13668
14554
  });
13669
14555
  result.onExit((code) => {
13670
14556
  console.info(source_default.gray("Command has exited"), source_default.redBright(code));
13671
- if (code != 0) {
13672
- if (restartCounter < 1) {
13673
- console.info(source_default.greenBright("Auto rerunning the command..."));
13674
- console.info("");
13675
- restartCounter++;
13676
- runCommandWithAutoRestart();
13677
- }
13678
- } else {
13679
- proxy.close();
14557
+ if (restartCounter < 1) {
14558
+ console.info(source_default.greenBright("Auto rerunning the command..."));
14559
+ console.info("");
14560
+ restartCounter++;
14561
+ runCommandWithAutoRestart();
13680
14562
  }
13681
14563
  });
13682
14564
  }
@@ -13688,5 +14570,5 @@ program.requiredOption("-f, --proxy-from <URL>", "Proxy host URL (e.g. http://lo
13688
14570
  restartCounter = 0;
13689
14571
  runCommandWithAutoRestart();
13690
14572
  });
13691
- }).parse(import_node_process13.default.argv);
14573
+ }).parse(import_node_process15.default.argv);
13692
14574
  //# sourceMappingURL=run.cjs.map