@base44-preview/cli 0.0.17-pr.109.dd04c99 → 0.0.17-pr.110.9a4891a

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.
Files changed (3) hide show
  1. package/README.md +29 -0
  2. package/dist/index.js +939 -885
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3,19 +3,21 @@ import { EventEmitter, addAbortListener, on, once, setMaxListeners } from "node:
3
3
  import childProcess, { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
4
4
  import path, { basename, dirname, join, posix, resolve, win32 } from "node:path";
5
5
  import fs, { appendFileSync, createReadStream, createWriteStream, readFileSync, statSync, writeFileSync } from "node:fs";
6
- import y, { execArgv, execPath, hrtime, platform, stdin, stdout } from "node:process";
6
+ import process$1, { execArgv, execPath, hrtime, platform, stdin, stdout } from "node:process";
7
7
  import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
8
8
  import * as g from "node:readline";
9
9
  import O from "node:readline";
10
10
  import Stream, { Duplex, PassThrough, Readable, Transform, Writable, getDefaultHighWaterMark } from "node:stream";
11
- import os, { constants, homedir, tmpdir } from "node:os";
12
11
  import { fileURLToPath } from "node:url";
13
- import fs$1, { access, constants as constants$1, copyFile, mkdir, readFile, unlink, writeFile } from "node:fs/promises";
12
+ import fs$1, { access, constants, copyFile, mkdir, readFile, unlink, writeFile } from "node:fs/promises";
13
+ import os, { constants as constants$1, homedir, tmpdir } from "node:os";
14
+ import { Buffer as Buffer$1 } from "node:buffer";
15
+ import * as readline from "readline";
14
16
  import { finished } from "node:stream/promises";
15
17
  import path$1, { dirname as dirname$1, parse } from "path";
16
18
  import EE, { EventEmitter as EventEmitter$1 } from "events";
17
19
  import fs$2 from "fs";
18
- import { Buffer as Buffer$1 } from "buffer";
20
+ import { Buffer as Buffer$2 } from "buffer";
19
21
  import { randomBytes, randomUUID } from "node:crypto";
20
22
  import { StringDecoder } from "node:string_decoder";
21
23
  import assert from "assert";
@@ -25,7 +27,6 @@ import assert$1 from "node:assert";
25
27
  import tty from "node:tty";
26
28
  import { scheduler, setImmediate as setImmediate$1, setTimeout as setTimeout$1 } from "node:timers/promises";
27
29
  import { serialize } from "node:v8";
28
- import { Buffer as Buffer$2 } from "node:buffer";
29
30
 
30
31
  //#region rolldown:runtime
31
32
  var __create = Object.create;
@@ -893,7 +894,7 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
893
894
  const childProcess$1 = __require("node:child_process");
894
895
  const path$15 = __require("node:path");
895
896
  const fs$10 = __require("node:fs");
896
- const process$3 = __require("node:process");
897
+ const process$4 = __require("node:process");
897
898
  const { Argument, humanReadableArgName } = require_argument();
898
899
  const { CommanderError } = require_error$1();
899
900
  const { Help } = require_help();
@@ -944,10 +945,10 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
944
945
  this._showHelpAfterError = false;
945
946
  this._showSuggestionAfterError = true;
946
947
  this._outputConfiguration = {
947
- writeOut: (str) => process$3.stdout.write(str),
948
- writeErr: (str) => process$3.stderr.write(str),
949
- getOutHelpWidth: () => process$3.stdout.isTTY ? process$3.stdout.columns : void 0,
950
- getErrHelpWidth: () => process$3.stderr.isTTY ? process$3.stderr.columns : void 0,
948
+ writeOut: (str) => process$4.stdout.write(str),
949
+ writeErr: (str) => process$4.stderr.write(str),
950
+ getOutHelpWidth: () => process$4.stdout.isTTY ? process$4.stdout.columns : void 0,
951
+ getErrHelpWidth: () => process$4.stderr.isTTY ? process$4.stderr.columns : void 0,
951
952
  outputError: (str, write) => write(str)
952
953
  };
953
954
  this._hidden = false;
@@ -1301,7 +1302,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1301
1302
  */
1302
1303
  _exit(exitCode, code$1, message) {
1303
1304
  if (this._exitCallback) this._exitCallback(new CommanderError(exitCode, code$1, message));
1304
- process$3.exit(exitCode);
1305
+ process$4.exit(exitCode);
1305
1306
  }
1306
1307
  /**
1307
1308
  * Register callback `fn` for the command.
@@ -1640,11 +1641,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
1640
1641
  if (argv !== void 0 && !Array.isArray(argv)) throw new Error("first parameter to parse must be array or undefined");
1641
1642
  parseOptions = parseOptions || {};
1642
1643
  if (argv === void 0 && parseOptions.from === void 0) {
1643
- if (process$3.versions?.electron) parseOptions.from = "electron";
1644
- const execArgv$1 = process$3.execArgv ?? [];
1644
+ if (process$4.versions?.electron) parseOptions.from = "electron";
1645
+ const execArgv$1 = process$4.execArgv ?? [];
1645
1646
  if (execArgv$1.includes("-e") || execArgv$1.includes("--eval") || execArgv$1.includes("-p") || execArgv$1.includes("--print")) parseOptions.from = "eval";
1646
1647
  }
1647
- if (argv === void 0) argv = process$3.argv;
1648
+ if (argv === void 0) argv = process$4.argv;
1648
1649
  this.rawArgs = argv.slice();
1649
1650
  let userArgs;
1650
1651
  switch (parseOptions.from) {
@@ -1654,7 +1655,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1654
1655
  userArgs = argv.slice(2);
1655
1656
  break;
1656
1657
  case "electron":
1657
- if (process$3.defaultApp) {
1658
+ if (process$4.defaultApp) {
1658
1659
  this._scriptPath = argv[1];
1659
1660
  userArgs = argv.slice(2);
1660
1661
  } else userArgs = argv.slice(1);
@@ -1768,15 +1769,15 @@ Expecting one of '${allowedValues.join("', '")}'`);
1768
1769
  }
1769
1770
  launchWithNode = sourceExt.includes(path$15.extname(executableFile));
1770
1771
  let proc$1;
1771
- if (process$3.platform !== "win32") if (launchWithNode) {
1772
+ if (process$4.platform !== "win32") if (launchWithNode) {
1772
1773
  args.unshift(executableFile);
1773
- args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
1774
- proc$1 = childProcess$1.spawn(process$3.argv[0], args, { stdio: "inherit" });
1774
+ args = incrementNodeInspectorPort(process$4.execArgv).concat(args);
1775
+ proc$1 = childProcess$1.spawn(process$4.argv[0], args, { stdio: "inherit" });
1775
1776
  } else proc$1 = childProcess$1.spawn(executableFile, args, { stdio: "inherit" });
1776
1777
  else {
1777
1778
  args.unshift(executableFile);
1778
- args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
1779
- proc$1 = childProcess$1.spawn(process$3.execPath, args, { stdio: "inherit" });
1779
+ args = incrementNodeInspectorPort(process$4.execArgv).concat(args);
1780
+ proc$1 = childProcess$1.spawn(process$4.execPath, args, { stdio: "inherit" });
1780
1781
  }
1781
1782
  if (!proc$1.killed) [
1782
1783
  "SIGUSR1",
@@ -1785,14 +1786,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
1785
1786
  "SIGINT",
1786
1787
  "SIGHUP"
1787
1788
  ].forEach((signal) => {
1788
- process$3.on(signal, () => {
1789
+ process$4.on(signal, () => {
1789
1790
  if (proc$1.killed === false && proc$1.exitCode === null) proc$1.kill(signal);
1790
1791
  });
1791
1792
  });
1792
1793
  const exitCallback = this._exitCallback;
1793
1794
  proc$1.on("close", (code$1) => {
1794
1795
  code$1 = code$1 ?? 1;
1795
- if (!exitCallback) process$3.exit(code$1);
1796
+ if (!exitCallback) process$4.exit(code$1);
1796
1797
  else exitCallback(new CommanderError(code$1, "commander.executeSubCommandAsync", "(close)"));
1797
1798
  });
1798
1799
  proc$1.on("error", (err) => {
@@ -1804,7 +1805,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1804
1805
  - ${executableDirMessage}`;
1805
1806
  throw new Error(executableMissing);
1806
1807
  } else if (err.code === "EACCES") throw new Error(`'${executableFile}' not executable`);
1807
- if (!exitCallback) process$3.exit(1);
1808
+ if (!exitCallback) process$4.exit(1);
1808
1809
  else {
1809
1810
  const wrappedError = new CommanderError(1, "commander.executeSubCommandAsync", "(error)");
1810
1811
  wrappedError.nestedError = err;
@@ -2210,13 +2211,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
2210
2211
  */
2211
2212
  _parseOptionsEnv() {
2212
2213
  this.options.forEach((option) => {
2213
- if (option.envVar && option.envVar in process$3.env) {
2214
+ if (option.envVar && option.envVar in process$4.env) {
2214
2215
  const optionKey = option.attributeName();
2215
2216
  if (this.getOptionValue(optionKey) === void 0 || [
2216
2217
  "default",
2217
2218
  "config",
2218
2219
  "env"
2219
- ].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$3.env[option.envVar]);
2220
+ ].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$4.env[option.envVar]);
2220
2221
  else this.emit(`optionEnv:${option.name()}`);
2221
2222
  }
2222
2223
  });
@@ -2595,7 +2596,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2595
2596
  */
2596
2597
  help(contextOptions) {
2597
2598
  this.outputHelp(contextOptions);
2598
- let exitCode = process$3.exitCode || 0;
2599
+ let exitCode = process$4.exitCode || 0;
2599
2600
  if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) exitCode = 1;
2600
2601
  this._exit(exitCode, "commander.help", "(outputHelp)");
2601
2602
  }
@@ -2711,16 +2712,16 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2711
2712
  const CSI = `${ESC}[`;
2712
2713
  const beep = "\x07";
2713
2714
  const cursor = {
2714
- to(x$2, y$2) {
2715
- if (!y$2) return `${CSI}${x$2 + 1}G`;
2716
- return `${CSI}${y$2 + 1};${x$2 + 1}H`;
2715
+ to(x$2, y$1) {
2716
+ if (!y$1) return `${CSI}${x$2 + 1}G`;
2717
+ return `${CSI}${y$1 + 1};${x$2 + 1}H`;
2717
2718
  },
2718
- move(x$2, y$2) {
2719
+ move(x$2, y$1) {
2719
2720
  let ret = "";
2720
2721
  if (x$2 < 0) ret += `${CSI}${-x$2}D`;
2721
2722
  else if (x$2 > 0) ret += `${CSI}${x$2}C`;
2722
- if (y$2 < 0) ret += `${CSI}${-y$2}A`;
2723
- else if (y$2 > 0) ret += `${CSI}${y$2}B`;
2723
+ if (y$1 < 0) ret += `${CSI}${-y$1}A`;
2724
+ else if (y$1 > 0) ret += `${CSI}${y$1}B`;
2724
2725
  return ret;
2725
2726
  },
2726
2727
  up: (count$1 = 1) => `${CSI}${count$1}A`,
@@ -3030,13 +3031,13 @@ function rD() {
3030
3031
  }
3031
3032
  }), r;
3032
3033
  }
3033
- const ED = rD(), d$1 = new Set(["\x1B", "›"]), oD = 39, y$1 = "\x07", V$1 = "[", nD = "]", G$1 = "m", _$1 = `${nD}8;;`, z = (e$1) => `${d$1.values().next().value}${V$1}${e$1}${G$1}`, K$1 = (e$1) => `${d$1.values().next().value}${_$1}${e$1}${y$1}`, aD = (e$1) => e$1.split(" ").map((u$2) => p(u$2)), k$1 = (e$1, u$2, t) => {
3034
+ const ED = rD(), d$1 = new Set(["\x1B", "›"]), oD = 39, y = "\x07", V$1 = "[", nD = "]", G$1 = "m", _$1 = `${nD}8;;`, z = (e$1) => `${d$1.values().next().value}${V$1}${e$1}${G$1}`, K$1 = (e$1) => `${d$1.values().next().value}${_$1}${e$1}${y}`, aD = (e$1) => e$1.split(" ").map((u$2) => p(u$2)), k$1 = (e$1, u$2, t) => {
3034
3035
  const F$1 = [...u$2];
3035
3036
  let s = !1, i$1 = !1, D$1 = p(P$1(e$1[e$1.length - 1]));
3036
3037
  for (const [C$1, n$1] of F$1.entries()) {
3037
3038
  const E = p(n$1);
3038
3039
  if (D$1 + E <= t ? e$1[e$1.length - 1] += n$1 : (e$1.push(n$1), D$1 = 0), d$1.has(n$1) && (s = !0, i$1 = F$1.slice(C$1 + 1).join("").startsWith(_$1)), s) {
3039
- i$1 ? n$1 === y$1 && (s = !1, i$1 = !1) : n$1 === G$1 && (s = !1);
3040
+ i$1 ? n$1 === y && (s = !1, i$1 = !1) : n$1 === G$1 && (s = !1);
3040
3041
  continue;
3041
3042
  }
3042
3043
  D$1 += E, D$1 === t && C$1 < F$1.length - 1 && (e$1.push(""), D$1 = 0);
@@ -3078,7 +3079,7 @@ const ED = rD(), d$1 = new Set(["\x1B", "›"]), oD = 39, y$1 = "\x07", V$1 = "["
3078
3079
  `)];
3079
3080
  for (const [E, a$1] of n$1.entries()) {
3080
3081
  if (F$1 += a$1, d$1.has(a$1)) {
3081
- const { groups: c$1 } = (/* @__PURE__ */ new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y$1})`)).exec(n$1.slice(E).join("")) || { groups: {} };
3082
+ const { groups: c$1 } = (/* @__PURE__ */ new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y})`)).exec(n$1.slice(E).join("")) || { groups: {} };
3082
3083
  if (c$1.code !== void 0) {
3083
3084
  const f = Number.parseFloat(c$1.code);
3084
3085
  s = f === oD ? void 0 : f;
@@ -3479,7 +3480,7 @@ var RD = class extends x$1 {
3479
3480
  //#endregion
3480
3481
  //#region node_modules/@clack/prompts/dist/index.mjs
3481
3482
  function ce() {
3482
- return y.platform !== "win32" ? y.env.TERM !== "linux" : !!y.env.CI || !!y.env.WT_SESSION || !!y.env.TERMINUS_SUBLIME || y.env.ConEmuTask === "{cmd::Cmder}" || y.env.TERM_PROGRAM === "Terminus-Sublime" || y.env.TERM_PROGRAM === "vscode" || y.env.TERM === "xterm-256color" || y.env.TERM === "alacritty" || y.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
3483
+ return process$1.platform !== "win32" ? process$1.env.TERM !== "linux" : !!process$1.env.CI || !!process$1.env.WT_SESSION || !!process$1.env.TERMINUS_SUBLIME || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
3483
3484
  }
3484
3485
  const V = ce(), u$1 = (t, n$1) => V ? t : n$1, le = u$1("◆", "*"), L = u$1("■", "x"), W = u$1("▲", "x"), C = u$1("◇", "o"), ue = u$1("┌", "T"), o$1 = u$1("│", "|"), d = u$1("└", "—"), k = u$1("●", ">"), P = u$1("○", " "), A = u$1("◻", "[•]"), T = u$1("◼", "[+]"), F = u$1("◻", "[ ]"), $e = u$1("▪", "•"), _ = u$1("─", "-"), me = u$1("╮", "+"), de = u$1("├", "+"), pe = u$1("╯", "+"), q = u$1("●", "•"), D = u$1("◆", "*"), U = u$1("▲", "!"), K = u$1("■", "x"), b = (t) => {
3485
3486
  switch (t) {
@@ -3956,265 +3957,804 @@ var TimeoutError$1 = class extends Error {
3956
3957
  };
3957
3958
 
3958
3959
  //#endregion
3959
- //#region node_modules/zod/v4/core/core.js
3960
- /** A special constant with type `never` */
3961
- const NEVER = Object.freeze({ status: "aborted" });
3962
- function $constructor(name$1, initializer$2, params) {
3963
- function init(inst, def) {
3964
- if (!inst._zod) Object.defineProperty(inst, "_zod", {
3965
- value: {
3966
- def,
3967
- constr: _$2,
3968
- traits: /* @__PURE__ */ new Set()
3969
- },
3970
- enumerable: false
3971
- });
3972
- if (inst._zod.traits.has(name$1)) return;
3973
- inst._zod.traits.add(name$1);
3974
- initializer$2(inst, def);
3975
- const proto$1 = _$2.prototype;
3976
- const keys = Object.keys(proto$1);
3977
- for (let i$1 = 0; i$1 < keys.length; i$1++) {
3978
- const k$2 = keys[i$1];
3979
- if (!(k$2 in inst)) inst[k$2] = proto$1[k$2].bind(inst);
3980
- }
3960
+ //#region node_modules/is-docker/index.js
3961
+ let isDockerCached;
3962
+ function hasDockerEnv() {
3963
+ try {
3964
+ fs.statSync("/.dockerenv");
3965
+ return true;
3966
+ } catch {
3967
+ return false;
3981
3968
  }
3982
- const Parent = params?.Parent ?? Object;
3983
- class Definition extends Parent {}
3984
- Object.defineProperty(Definition, "name", { value: name$1 });
3985
- function _$2(def) {
3986
- var _a$1;
3987
- const inst = params?.Parent ? new Definition() : this;
3988
- init(inst, def);
3989
- (_a$1 = inst._zod).deferred ?? (_a$1.deferred = []);
3990
- for (const fn of inst._zod.deferred) fn();
3991
- return inst;
3969
+ }
3970
+ function hasDockerCGroup() {
3971
+ try {
3972
+ return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
3973
+ } catch {
3974
+ return false;
3992
3975
  }
3993
- Object.defineProperty(_$2, "init", { value: init });
3994
- Object.defineProperty(_$2, Symbol.hasInstance, { value: (inst) => {
3995
- if (params?.Parent && inst instanceof params.Parent) return true;
3996
- return inst?._zod?.traits?.has(name$1);
3997
- } });
3998
- Object.defineProperty(_$2, "name", { value: name$1 });
3999
- return _$2;
4000
3976
  }
4001
- var $ZodAsyncError = class extends Error {
4002
- constructor() {
4003
- super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
3977
+ function isDocker() {
3978
+ if (isDockerCached === void 0) isDockerCached = hasDockerEnv() || hasDockerCGroup();
3979
+ return isDockerCached;
3980
+ }
3981
+
3982
+ //#endregion
3983
+ //#region node_modules/is-inside-container/index.js
3984
+ let cachedResult;
3985
+ const hasContainerEnv = () => {
3986
+ try {
3987
+ fs.statSync("/run/.containerenv");
3988
+ return true;
3989
+ } catch {
3990
+ return false;
4004
3991
  }
4005
3992
  };
4006
- var $ZodEncodeError = class extends Error {
4007
- constructor(name$1) {
4008
- super(`Encountered unidirectional transform during encode: ${name$1}`);
4009
- this.name = "ZodEncodeError";
3993
+ function isInsideContainer() {
3994
+ if (cachedResult === void 0) cachedResult = hasContainerEnv() || isDocker();
3995
+ return cachedResult;
3996
+ }
3997
+
3998
+ //#endregion
3999
+ //#region node_modules/is-wsl/index.js
4000
+ const isWsl = () => {
4001
+ if (process$1.platform !== "linux") return false;
4002
+ if (os.release().toLowerCase().includes("microsoft")) {
4003
+ if (isInsideContainer()) return false;
4004
+ return true;
4005
+ }
4006
+ try {
4007
+ return fs.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
4008
+ } catch {
4009
+ return false;
4010
4010
  }
4011
4011
  };
4012
- const globalConfig = {};
4013
- function config(newConfig) {
4014
- if (newConfig) Object.assign(globalConfig, newConfig);
4015
- return globalConfig;
4016
- }
4012
+ var is_wsl_default = process$1.env.__IS_WSL_TEST__ ? isWsl : isWsl();
4017
4013
 
4018
4014
  //#endregion
4019
- //#region node_modules/zod/v4/core/util.js
4020
- function getEnumValues(entries) {
4021
- const numericValues = Object.values(entries).filter((v$1) => typeof v$1 === "number");
4022
- return Object.entries(entries).filter(([k$2, _$2]) => numericValues.indexOf(+k$2) === -1).map(([_$2, v$1]) => v$1);
4023
- }
4024
- function jsonStringifyReplacer(_$2, value) {
4025
- if (typeof value === "bigint") return value.toString();
4026
- return value;
4015
+ //#region node_modules/powershell-utils/index.js
4016
+ const execFile$2 = promisify(childProcess.execFile);
4017
+ const powerShellPath$1 = () => `${process$1.env.SYSTEMROOT || process$1.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
4018
+ const executePowerShell = async (command, options = {}) => {
4019
+ const { powerShellPath: psPath, ...execFileOptions } = options;
4020
+ const encodedCommand = executePowerShell.encodeCommand(command);
4021
+ return execFile$2(psPath ?? powerShellPath$1(), [...executePowerShell.argumentsPrefix, encodedCommand], {
4022
+ encoding: "utf8",
4023
+ ...execFileOptions
4024
+ });
4025
+ };
4026
+ executePowerShell.argumentsPrefix = [
4027
+ "-NoProfile",
4028
+ "-NonInteractive",
4029
+ "-ExecutionPolicy",
4030
+ "Bypass",
4031
+ "-EncodedCommand"
4032
+ ];
4033
+ executePowerShell.encodeCommand = (command) => Buffer$1.from(command, "utf16le").toString("base64");
4034
+ executePowerShell.escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
4035
+
4036
+ //#endregion
4037
+ //#region node_modules/wsl-utils/utilities.js
4038
+ function parseMountPointFromConfig(content) {
4039
+ for (const line of content.split("\n")) {
4040
+ if (/^\s*#/.test(line)) continue;
4041
+ const match = /^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(line);
4042
+ if (!match) continue;
4043
+ return match.groups.mountPoint.trim().replaceAll(/^["']|["']$/g, "");
4044
+ }
4027
4045
  }
4028
- function cached(getter) {
4029
- return { get value() {
4030
- {
4031
- const value = getter();
4032
- Object.defineProperty(this, "value", { value });
4033
- return value;
4046
+
4047
+ //#endregion
4048
+ //#region node_modules/wsl-utils/index.js
4049
+ const execFile$1 = promisify(childProcess.execFile);
4050
+ const wslDrivesMountPoint = (() => {
4051
+ const defaultMountPoint = "/mnt/";
4052
+ let mountPoint;
4053
+ return async function() {
4054
+ if (mountPoint) return mountPoint;
4055
+ const configFilePath = "/etc/wsl.conf";
4056
+ let isConfigFileExists = false;
4057
+ try {
4058
+ await fs$1.access(configFilePath, constants.F_OK);
4059
+ isConfigFileExists = true;
4060
+ } catch {}
4061
+ if (!isConfigFileExists) return defaultMountPoint;
4062
+ const parsedMountPoint = parseMountPointFromConfig(await fs$1.readFile(configFilePath, { encoding: "utf8" }));
4063
+ if (parsedMountPoint === void 0) return defaultMountPoint;
4064
+ mountPoint = parsedMountPoint;
4065
+ mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
4066
+ return mountPoint;
4067
+ };
4068
+ })();
4069
+ const powerShellPathFromWsl = async () => {
4070
+ return `${await wslDrivesMountPoint()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
4071
+ };
4072
+ const powerShellPath = is_wsl_default ? powerShellPathFromWsl : powerShellPath$1;
4073
+ let canAccessPowerShellPromise;
4074
+ const canAccessPowerShell = async () => {
4075
+ canAccessPowerShellPromise ??= (async () => {
4076
+ try {
4077
+ const psPath = await powerShellPath();
4078
+ await fs$1.access(psPath, constants.X_OK);
4079
+ return true;
4080
+ } catch {
4081
+ return false;
4034
4082
  }
4035
- throw new Error("cached value already set");
4036
- } };
4037
- }
4038
- function nullish(input) {
4039
- return input === null || input === void 0;
4040
- }
4041
- function cleanRegex(source) {
4042
- const start = source.startsWith("^") ? 1 : 0;
4043
- const end = source.endsWith("$") ? source.length - 1 : source.length;
4044
- return source.slice(start, end);
4045
- }
4046
- function floatSafeRemainder(val, step) {
4047
- const valDecCount = (val.toString().split(".")[1] || "").length;
4048
- const stepString = step.toString();
4049
- let stepDecCount = (stepString.split(".")[1] || "").length;
4050
- if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) {
4051
- const match = stepString.match(/\d?e-(\d?)/);
4052
- if (match?.[1]) stepDecCount = Number.parseInt(match[1]);
4083
+ })();
4084
+ return canAccessPowerShellPromise;
4085
+ };
4086
+ const wslDefaultBrowser = async () => {
4087
+ const psPath = await powerShellPath();
4088
+ const { stdout: stdout$1 } = await executePowerShell(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, { powerShellPath: psPath });
4089
+ return stdout$1.trim();
4090
+ };
4091
+ const convertWslPathToWindows = async (path$16) => {
4092
+ if (/^[a-z]+:\/\//i.test(path$16)) return path$16;
4093
+ try {
4094
+ const { stdout: stdout$1 } = await execFile$1("wslpath", ["-aw", path$16], { encoding: "utf8" });
4095
+ return stdout$1.trim();
4096
+ } catch {
4097
+ return path$16;
4053
4098
  }
4054
- const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
4055
- return Number.parseInt(val.toFixed(decCount).replace(".", "")) % Number.parseInt(step.toFixed(decCount).replace(".", "")) / 10 ** decCount;
4056
- }
4057
- const EVALUATING = Symbol("evaluating");
4058
- function defineLazy(object$1, key, getter) {
4059
- let value = void 0;
4060
- Object.defineProperty(object$1, key, {
4061
- get() {
4062
- if (value === EVALUATING) return;
4063
- if (value === void 0) {
4064
- value = EVALUATING;
4065
- value = getter();
4066
- }
4067
- return value;
4068
- },
4069
- set(v$1) {
4070
- Object.defineProperty(object$1, key, { value: v$1 });
4071
- },
4072
- configurable: true
4073
- });
4074
- }
4075
- function assignProp(target, prop, value) {
4076
- Object.defineProperty(target, prop, {
4099
+ };
4100
+
4101
+ //#endregion
4102
+ //#region node_modules/define-lazy-prop/index.js
4103
+ function defineLazyProperty(object$1, propertyName, valueGetter) {
4104
+ const define$1 = (value) => Object.defineProperty(object$1, propertyName, {
4077
4105
  value,
4078
- writable: true,
4079
4106
  enumerable: true,
4080
- configurable: true
4107
+ writable: true
4081
4108
  });
4109
+ Object.defineProperty(object$1, propertyName, {
4110
+ configurable: true,
4111
+ enumerable: true,
4112
+ get() {
4113
+ const result = valueGetter();
4114
+ define$1(result);
4115
+ return result;
4116
+ },
4117
+ set(value) {
4118
+ define$1(value);
4119
+ }
4120
+ });
4121
+ return object$1;
4082
4122
  }
4083
- function mergeDefs(...defs) {
4084
- const mergedDescriptors = {};
4085
- for (const def of defs) {
4086
- const descriptors$1 = Object.getOwnPropertyDescriptors(def);
4087
- Object.assign(mergedDescriptors, descriptors$1);
4088
- }
4089
- return Object.defineProperties({}, mergedDescriptors);
4090
- }
4091
- function esc(str) {
4092
- return JSON.stringify(str);
4093
- }
4094
- function slugify(input) {
4095
- return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
4096
- }
4097
- const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
4098
- function isObject$2(data) {
4099
- return typeof data === "object" && data !== null && !Array.isArray(data);
4100
- }
4101
- const allowsEval = cached(() => {
4102
- if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false;
4103
- try {
4104
- new Function("");
4105
- return true;
4106
- } catch (_$2) {
4107
- return false;
4108
- }
4109
- });
4110
- function isPlainObject$1(o$2) {
4111
- if (isObject$2(o$2) === false) return false;
4112
- const ctor = o$2.constructor;
4113
- if (ctor === void 0) return true;
4114
- if (typeof ctor !== "function") return true;
4115
- const prot = ctor.prototype;
4116
- if (isObject$2(prot) === false) return false;
4117
- if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false;
4118
- return true;
4119
- }
4120
- function shallowClone(o$2) {
4121
- if (isPlainObject$1(o$2)) return { ...o$2 };
4122
- if (Array.isArray(o$2)) return [...o$2];
4123
- return o$2;
4123
+
4124
+ //#endregion
4125
+ //#region node_modules/default-browser-id/index.js
4126
+ const execFileAsync$3 = promisify(execFile);
4127
+ async function defaultBrowserId() {
4128
+ if (process$1.platform !== "darwin") throw new Error("macOS only");
4129
+ const { stdout: stdout$1 } = await execFileAsync$3("defaults", [
4130
+ "read",
4131
+ "com.apple.LaunchServices/com.apple.launchservices.secure",
4132
+ "LSHandlers"
4133
+ ]);
4134
+ const browserId = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout$1)?.groups.id ?? "com.apple.Safari";
4135
+ if (browserId === "com.apple.safari") return "com.apple.Safari";
4136
+ return browserId;
4124
4137
  }
4125
- const propertyKeyTypes = new Set([
4126
- "string",
4127
- "number",
4128
- "symbol"
4129
- ]);
4130
- function escapeRegex(str) {
4131
- return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
4138
+
4139
+ //#endregion
4140
+ //#region node_modules/run-applescript/index.js
4141
+ const execFileAsync$2 = promisify(execFile);
4142
+ async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
4143
+ if (process$1.platform !== "darwin") throw new Error("macOS only");
4144
+ const outputArguments = humanReadableOutput ? [] : ["-ss"];
4145
+ const execOptions = {};
4146
+ if (signal) execOptions.signal = signal;
4147
+ const { stdout: stdout$1 } = await execFileAsync$2("osascript", [
4148
+ "-e",
4149
+ script,
4150
+ outputArguments
4151
+ ], execOptions);
4152
+ return stdout$1.trim();
4132
4153
  }
4133
- function clone(inst, def, params) {
4134
- const cl = new inst._zod.constr(def ?? inst._zod.def);
4135
- if (!def || params?.parent) cl._zod.parent = inst;
4136
- return cl;
4154
+
4155
+ //#endregion
4156
+ //#region node_modules/bundle-name/index.js
4157
+ async function bundleName(bundleId) {
4158
+ return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
4137
4159
  }
4138
- function normalizeParams(_params) {
4139
- const params = _params;
4140
- if (!params) return {};
4141
- if (typeof params === "string") return { error: () => params };
4142
- if (params?.message !== void 0) {
4143
- if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params");
4144
- params.error = params.message;
4160
+
4161
+ //#endregion
4162
+ //#region node_modules/default-browser/windows.js
4163
+ const execFileAsync$1 = promisify(execFile);
4164
+ const windowsBrowserProgIds = {
4165
+ MSEdgeHTM: {
4166
+ name: "Edge",
4167
+ id: "com.microsoft.edge"
4168
+ },
4169
+ MSEdgeBHTML: {
4170
+ name: "Edge Beta",
4171
+ id: "com.microsoft.edge.beta"
4172
+ },
4173
+ MSEdgeDHTML: {
4174
+ name: "Edge Dev",
4175
+ id: "com.microsoft.edge.dev"
4176
+ },
4177
+ AppXq0fevzme2pys62n3e0fbqa7peapykr8v: {
4178
+ name: "Edge",
4179
+ id: "com.microsoft.edge.old"
4180
+ },
4181
+ ChromeHTML: {
4182
+ name: "Chrome",
4183
+ id: "com.google.chrome"
4184
+ },
4185
+ ChromeBHTML: {
4186
+ name: "Chrome Beta",
4187
+ id: "com.google.chrome.beta"
4188
+ },
4189
+ ChromeDHTML: {
4190
+ name: "Chrome Dev",
4191
+ id: "com.google.chrome.dev"
4192
+ },
4193
+ ChromiumHTM: {
4194
+ name: "Chromium",
4195
+ id: "org.chromium.Chromium"
4196
+ },
4197
+ BraveHTML: {
4198
+ name: "Brave",
4199
+ id: "com.brave.Browser"
4200
+ },
4201
+ BraveBHTML: {
4202
+ name: "Brave Beta",
4203
+ id: "com.brave.Browser.beta"
4204
+ },
4205
+ BraveDHTML: {
4206
+ name: "Brave Dev",
4207
+ id: "com.brave.Browser.dev"
4208
+ },
4209
+ BraveSSHTM: {
4210
+ name: "Brave Nightly",
4211
+ id: "com.brave.Browser.nightly"
4212
+ },
4213
+ FirefoxURL: {
4214
+ name: "Firefox",
4215
+ id: "org.mozilla.firefox"
4216
+ },
4217
+ OperaStable: {
4218
+ name: "Opera",
4219
+ id: "com.operasoftware.Opera"
4220
+ },
4221
+ VivaldiHTM: {
4222
+ name: "Vivaldi",
4223
+ id: "com.vivaldi.Vivaldi"
4224
+ },
4225
+ "IE.HTTP": {
4226
+ name: "Internet Explorer",
4227
+ id: "com.microsoft.ie"
4145
4228
  }
4146
- delete params.message;
4147
- if (typeof params.error === "string") return {
4148
- ...params,
4149
- error: () => params.error
4150
- };
4151
- return params;
4152
- }
4153
- function optionalKeys(shape) {
4154
- return Object.keys(shape).filter((k$2) => {
4155
- return shape[k$2]._zod.optin === "optional" && shape[k$2]._zod.optout === "optional";
4156
- });
4157
- }
4158
- const NUMBER_FORMAT_RANGES = {
4159
- safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
4160
- int32: [-2147483648, 2147483647],
4161
- uint32: [0, 4294967295],
4162
- float32: [-34028234663852886e22, 34028234663852886e22],
4163
- float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
4164
4229
  };
4165
- function pick(schema, mask) {
4166
- const currDef = schema._zod.def;
4167
- const checks = currDef.checks;
4168
- if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements");
4169
- return clone(schema, mergeDefs(schema._zod.def, {
4170
- get shape() {
4171
- const newShape = {};
4172
- for (const key in mask) {
4173
- if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
4174
- if (!mask[key]) continue;
4175
- newShape[key] = currDef.shape[key];
4176
- }
4177
- assignProp(this, "shape", newShape);
4178
- return newShape;
4179
- },
4180
- checks: []
4181
- }));
4182
- }
4183
- function omit(schema, mask) {
4184
- const currDef = schema._zod.def;
4185
- const checks = currDef.checks;
4186
- if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
4187
- return clone(schema, mergeDefs(schema._zod.def, {
4188
- get shape() {
4189
- const newShape = { ...schema._zod.def.shape };
4190
- for (const key in mask) {
4191
- if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
4192
- if (!mask[key]) continue;
4193
- delete newShape[key];
4194
- }
4195
- assignProp(this, "shape", newShape);
4196
- return newShape;
4197
- },
4198
- checks: []
4199
- }));
4230
+ const _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));
4231
+ var UnknownBrowserError = class extends Error {};
4232
+ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
4233
+ const { stdout: stdout$1 } = await _execFileAsync("reg", [
4234
+ "QUERY",
4235
+ " HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
4236
+ "/v",
4237
+ "ProgId"
4238
+ ]);
4239
+ const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout$1);
4240
+ if (!match) throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout$1)}`);
4241
+ const { id } = match.groups;
4242
+ const browser = windowsBrowserProgIds[id];
4243
+ if (!browser) throw new UnknownBrowserError(`Unknown browser ID: ${id}`);
4244
+ return browser;
4200
4245
  }
4201
- function extend(schema, shape) {
4202
- if (!isPlainObject$1(shape)) throw new Error("Invalid input to extend: expected a plain object");
4203
- const checks = schema._zod.def.checks;
4204
- if (checks && checks.length > 0) {
4205
- const existingShape = schema._zod.def.shape;
4206
- for (const key in shape) if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
4246
+
4247
+ //#endregion
4248
+ //#region node_modules/default-browser/index.js
4249
+ const execFileAsync = promisify(execFile);
4250
+ const titleize = (string$2) => string$2.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x$2) => x$2.toUpperCase());
4251
+ async function defaultBrowser() {
4252
+ if (process$1.platform === "darwin") {
4253
+ const id = await defaultBrowserId();
4254
+ return {
4255
+ name: await bundleName(id),
4256
+ id
4257
+ };
4207
4258
  }
4208
- return clone(schema, mergeDefs(schema._zod.def, { get shape() {
4209
- const _shape = {
4210
- ...schema._zod.def.shape,
4211
- ...shape
4259
+ if (process$1.platform === "linux") {
4260
+ const { stdout: stdout$1 } = await execFileAsync("xdg-mime", [
4261
+ "query",
4262
+ "default",
4263
+ "x-scheme-handler/http"
4264
+ ]);
4265
+ const id = stdout$1.trim();
4266
+ return {
4267
+ name: titleize(id.replace(/.desktop$/, "").replace("-", " ")),
4268
+ id
4212
4269
  };
4213
- assignProp(this, "shape", _shape);
4214
- return _shape;
4215
- } }));
4270
+ }
4271
+ if (process$1.platform === "win32") return defaultBrowser$1();
4272
+ throw new Error("Only macOS, Linux, and Windows are supported");
4216
4273
  }
4217
- function safeExtend(schema, shape) {
4274
+
4275
+ //#endregion
4276
+ //#region node_modules/is-in-ssh/index.js
4277
+ const isInSsh = Boolean(process$1.env.SSH_CONNECTION || process$1.env.SSH_CLIENT || process$1.env.SSH_TTY);
4278
+ var is_in_ssh_default = isInSsh;
4279
+
4280
+ //#endregion
4281
+ //#region node_modules/open/index.js
4282
+ const fallbackAttemptSymbol = Symbol("fallbackAttempt");
4283
+ const __dirname$1 = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
4284
+ const localXdgOpenPath = path.join(__dirname$1, "xdg-open");
4285
+ const { platform: platform$2, arch } = process$1;
4286
+ const tryEachApp = async (apps$1, opener) => {
4287
+ if (apps$1.length === 0) return;
4288
+ const errors = [];
4289
+ for (const app of apps$1) try {
4290
+ return await opener(app);
4291
+ } catch (error) {
4292
+ errors.push(error);
4293
+ }
4294
+ throw new AggregateError(errors, "Failed to open in all supported apps");
4295
+ };
4296
+ const baseOpen = async (options) => {
4297
+ options = {
4298
+ wait: false,
4299
+ background: false,
4300
+ newInstance: false,
4301
+ allowNonzeroExitCode: false,
4302
+ ...options
4303
+ };
4304
+ const isFallbackAttempt = options[fallbackAttemptSymbol] === true;
4305
+ delete options[fallbackAttemptSymbol];
4306
+ if (Array.isArray(options.app)) return tryEachApp(options.app, (singleApp) => baseOpen({
4307
+ ...options,
4308
+ app: singleApp,
4309
+ [fallbackAttemptSymbol]: true
4310
+ }));
4311
+ let { name: app, arguments: appArguments = [] } = options.app ?? {};
4312
+ appArguments = [...appArguments];
4313
+ if (Array.isArray(app)) return tryEachApp(app, (appName) => baseOpen({
4314
+ ...options,
4315
+ app: {
4316
+ name: appName,
4317
+ arguments: appArguments
4318
+ },
4319
+ [fallbackAttemptSymbol]: true
4320
+ }));
4321
+ if (app === "browser" || app === "browserPrivate") {
4322
+ const ids = {
4323
+ "com.google.chrome": "chrome",
4324
+ "google-chrome.desktop": "chrome",
4325
+ "com.brave.browser": "brave",
4326
+ "org.mozilla.firefox": "firefox",
4327
+ "firefox.desktop": "firefox",
4328
+ "com.microsoft.msedge": "edge",
4329
+ "com.microsoft.edge": "edge",
4330
+ "com.microsoft.edgemac": "edge",
4331
+ "microsoft-edge.desktop": "edge",
4332
+ "com.apple.safari": "safari"
4333
+ };
4334
+ const flags = {
4335
+ chrome: "--incognito",
4336
+ brave: "--incognito",
4337
+ firefox: "--private-window",
4338
+ edge: "--inPrivate"
4339
+ };
4340
+ let browser;
4341
+ if (is_wsl_default) {
4342
+ const progId = await wslDefaultBrowser();
4343
+ browser = _windowsBrowserProgIdMap.get(progId) ?? {};
4344
+ } else browser = await defaultBrowser();
4345
+ if (browser.id in ids) {
4346
+ const browserName = ids[browser.id.toLowerCase()];
4347
+ if (app === "browserPrivate") {
4348
+ if (browserName === "safari") throw new Error("Safari doesn't support opening in private mode via command line");
4349
+ appArguments.push(flags[browserName]);
4350
+ }
4351
+ return baseOpen({
4352
+ ...options,
4353
+ app: {
4354
+ name: apps[browserName],
4355
+ arguments: appArguments
4356
+ }
4357
+ });
4358
+ }
4359
+ throw new Error(`${browser.name} is not supported as a default browser`);
4360
+ }
4361
+ let command;
4362
+ const cliArguments = [];
4363
+ const childProcessOptions = {};
4364
+ let shouldUseWindowsInWsl = false;
4365
+ if (is_wsl_default && !isInsideContainer() && !is_in_ssh_default && !app) shouldUseWindowsInWsl = await canAccessPowerShell();
4366
+ if (platform$2 === "darwin") {
4367
+ command = "open";
4368
+ if (options.wait) cliArguments.push("--wait-apps");
4369
+ if (options.background) cliArguments.push("--background");
4370
+ if (options.newInstance) cliArguments.push("--new");
4371
+ if (app) cliArguments.push("-a", app);
4372
+ } else if (platform$2 === "win32" || shouldUseWindowsInWsl) {
4373
+ command = await powerShellPath();
4374
+ cliArguments.push(...executePowerShell.argumentsPrefix);
4375
+ if (!is_wsl_default) childProcessOptions.windowsVerbatimArguments = true;
4376
+ if (is_wsl_default && options.target) options.target = await convertWslPathToWindows(options.target);
4377
+ const encodedArguments = ["$ProgressPreference = 'SilentlyContinue';", "Start"];
4378
+ if (options.wait) encodedArguments.push("-Wait");
4379
+ if (app) {
4380
+ encodedArguments.push(executePowerShell.escapeArgument(app));
4381
+ if (options.target) appArguments.push(options.target);
4382
+ } else if (options.target) encodedArguments.push(executePowerShell.escapeArgument(options.target));
4383
+ if (appArguments.length > 0) {
4384
+ appArguments = appArguments.map((argument) => executePowerShell.escapeArgument(argument));
4385
+ encodedArguments.push("-ArgumentList", appArguments.join(","));
4386
+ }
4387
+ options.target = executePowerShell.encodeCommand(encodedArguments.join(" "));
4388
+ if (!options.wait) childProcessOptions.stdio = "ignore";
4389
+ } else {
4390
+ if (app) command = app;
4391
+ else {
4392
+ const isBundled = !__dirname$1 || __dirname$1 === "/";
4393
+ let exeLocalXdgOpen = false;
4394
+ try {
4395
+ await fs$1.access(localXdgOpenPath, constants.X_OK);
4396
+ exeLocalXdgOpen = true;
4397
+ } catch {}
4398
+ command = process$1.versions.electron ?? (platform$2 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
4399
+ }
4400
+ if (appArguments.length > 0) cliArguments.push(...appArguments);
4401
+ if (!options.wait) {
4402
+ childProcessOptions.stdio = "ignore";
4403
+ childProcessOptions.detached = true;
4404
+ }
4405
+ }
4406
+ if (platform$2 === "darwin" && appArguments.length > 0) cliArguments.push("--args", ...appArguments);
4407
+ if (options.target) cliArguments.push(options.target);
4408
+ const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
4409
+ if (options.wait) return new Promise((resolve$1, reject) => {
4410
+ subprocess.once("error", reject);
4411
+ subprocess.once("close", (exitCode) => {
4412
+ if (!options.allowNonzeroExitCode && exitCode !== 0) {
4413
+ reject(/* @__PURE__ */ new Error(`Exited with code ${exitCode}`));
4414
+ return;
4415
+ }
4416
+ resolve$1(subprocess);
4417
+ });
4418
+ });
4419
+ if (isFallbackAttempt) return new Promise((resolve$1, reject) => {
4420
+ subprocess.once("error", reject);
4421
+ subprocess.once("spawn", () => {
4422
+ subprocess.once("close", (exitCode) => {
4423
+ subprocess.off("error", reject);
4424
+ if (exitCode !== 0) {
4425
+ reject(/* @__PURE__ */ new Error(`Exited with code ${exitCode}`));
4426
+ return;
4427
+ }
4428
+ subprocess.unref();
4429
+ resolve$1(subprocess);
4430
+ });
4431
+ });
4432
+ });
4433
+ subprocess.unref();
4434
+ return new Promise((resolve$1, reject) => {
4435
+ subprocess.once("error", reject);
4436
+ subprocess.once("spawn", () => {
4437
+ subprocess.off("error", reject);
4438
+ resolve$1(subprocess);
4439
+ });
4440
+ });
4441
+ };
4442
+ const open = (target, options) => {
4443
+ if (typeof target !== "string") throw new TypeError("Expected a `target`");
4444
+ return baseOpen({
4445
+ ...options,
4446
+ target
4447
+ });
4448
+ };
4449
+ function detectArchBinary(binary) {
4450
+ if (typeof binary === "string" || Array.isArray(binary)) return binary;
4451
+ const { [arch]: archBinary } = binary;
4452
+ if (!archBinary) throw new Error(`${arch} is not supported`);
4453
+ return archBinary;
4454
+ }
4455
+ function detectPlatformBinary({ [platform$2]: platformBinary }, { wsl } = {}) {
4456
+ if (wsl && is_wsl_default) return detectArchBinary(wsl);
4457
+ if (!platformBinary) throw new Error(`${platform$2} is not supported`);
4458
+ return detectArchBinary(platformBinary);
4459
+ }
4460
+ const apps = {
4461
+ browser: "browser",
4462
+ browserPrivate: "browserPrivate"
4463
+ };
4464
+ defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
4465
+ darwin: "google chrome",
4466
+ win32: "chrome",
4467
+ linux: [
4468
+ "google-chrome",
4469
+ "google-chrome-stable",
4470
+ "chromium",
4471
+ "chromium-browser"
4472
+ ]
4473
+ }, { wsl: {
4474
+ ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
4475
+ x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
4476
+ } }));
4477
+ defineLazyProperty(apps, "brave", () => detectPlatformBinary({
4478
+ darwin: "brave browser",
4479
+ win32: "brave",
4480
+ linux: ["brave-browser", "brave"]
4481
+ }, { wsl: {
4482
+ ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
4483
+ x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
4484
+ } }));
4485
+ defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
4486
+ darwin: "firefox",
4487
+ win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
4488
+ linux: "firefox"
4489
+ }, { wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe" }));
4490
+ defineLazyProperty(apps, "edge", () => detectPlatformBinary({
4491
+ darwin: "microsoft edge",
4492
+ win32: "msedge",
4493
+ linux: ["microsoft-edge", "microsoft-edge-dev"]
4494
+ }, { wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe" }));
4495
+ defineLazyProperty(apps, "safari", () => detectPlatformBinary({ darwin: "Safari" }));
4496
+ var open_default = open;
4497
+
4498
+ //#endregion
4499
+ //#region node_modules/zod/v4/core/core.js
4500
+ /** A special constant with type `never` */
4501
+ const NEVER = Object.freeze({ status: "aborted" });
4502
+ function $constructor(name$1, initializer$2, params) {
4503
+ function init(inst, def) {
4504
+ if (!inst._zod) Object.defineProperty(inst, "_zod", {
4505
+ value: {
4506
+ def,
4507
+ constr: _$2,
4508
+ traits: /* @__PURE__ */ new Set()
4509
+ },
4510
+ enumerable: false
4511
+ });
4512
+ if (inst._zod.traits.has(name$1)) return;
4513
+ inst._zod.traits.add(name$1);
4514
+ initializer$2(inst, def);
4515
+ const proto$1 = _$2.prototype;
4516
+ const keys = Object.keys(proto$1);
4517
+ for (let i$1 = 0; i$1 < keys.length; i$1++) {
4518
+ const k$2 = keys[i$1];
4519
+ if (!(k$2 in inst)) inst[k$2] = proto$1[k$2].bind(inst);
4520
+ }
4521
+ }
4522
+ const Parent = params?.Parent ?? Object;
4523
+ class Definition extends Parent {}
4524
+ Object.defineProperty(Definition, "name", { value: name$1 });
4525
+ function _$2(def) {
4526
+ var _a$1;
4527
+ const inst = params?.Parent ? new Definition() : this;
4528
+ init(inst, def);
4529
+ (_a$1 = inst._zod).deferred ?? (_a$1.deferred = []);
4530
+ for (const fn of inst._zod.deferred) fn();
4531
+ return inst;
4532
+ }
4533
+ Object.defineProperty(_$2, "init", { value: init });
4534
+ Object.defineProperty(_$2, Symbol.hasInstance, { value: (inst) => {
4535
+ if (params?.Parent && inst instanceof params.Parent) return true;
4536
+ return inst?._zod?.traits?.has(name$1);
4537
+ } });
4538
+ Object.defineProperty(_$2, "name", { value: name$1 });
4539
+ return _$2;
4540
+ }
4541
+ var $ZodAsyncError = class extends Error {
4542
+ constructor() {
4543
+ super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
4544
+ }
4545
+ };
4546
+ var $ZodEncodeError = class extends Error {
4547
+ constructor(name$1) {
4548
+ super(`Encountered unidirectional transform during encode: ${name$1}`);
4549
+ this.name = "ZodEncodeError";
4550
+ }
4551
+ };
4552
+ const globalConfig = {};
4553
+ function config(newConfig) {
4554
+ if (newConfig) Object.assign(globalConfig, newConfig);
4555
+ return globalConfig;
4556
+ }
4557
+
4558
+ //#endregion
4559
+ //#region node_modules/zod/v4/core/util.js
4560
+ function getEnumValues(entries) {
4561
+ const numericValues = Object.values(entries).filter((v$1) => typeof v$1 === "number");
4562
+ return Object.entries(entries).filter(([k$2, _$2]) => numericValues.indexOf(+k$2) === -1).map(([_$2, v$1]) => v$1);
4563
+ }
4564
+ function jsonStringifyReplacer(_$2, value) {
4565
+ if (typeof value === "bigint") return value.toString();
4566
+ return value;
4567
+ }
4568
+ function cached(getter) {
4569
+ return { get value() {
4570
+ {
4571
+ const value = getter();
4572
+ Object.defineProperty(this, "value", { value });
4573
+ return value;
4574
+ }
4575
+ throw new Error("cached value already set");
4576
+ } };
4577
+ }
4578
+ function nullish(input) {
4579
+ return input === null || input === void 0;
4580
+ }
4581
+ function cleanRegex(source) {
4582
+ const start = source.startsWith("^") ? 1 : 0;
4583
+ const end = source.endsWith("$") ? source.length - 1 : source.length;
4584
+ return source.slice(start, end);
4585
+ }
4586
+ function floatSafeRemainder(val, step) {
4587
+ const valDecCount = (val.toString().split(".")[1] || "").length;
4588
+ const stepString = step.toString();
4589
+ let stepDecCount = (stepString.split(".")[1] || "").length;
4590
+ if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) {
4591
+ const match = stepString.match(/\d?e-(\d?)/);
4592
+ if (match?.[1]) stepDecCount = Number.parseInt(match[1]);
4593
+ }
4594
+ const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
4595
+ return Number.parseInt(val.toFixed(decCount).replace(".", "")) % Number.parseInt(step.toFixed(decCount).replace(".", "")) / 10 ** decCount;
4596
+ }
4597
+ const EVALUATING = Symbol("evaluating");
4598
+ function defineLazy(object$1, key, getter) {
4599
+ let value = void 0;
4600
+ Object.defineProperty(object$1, key, {
4601
+ get() {
4602
+ if (value === EVALUATING) return;
4603
+ if (value === void 0) {
4604
+ value = EVALUATING;
4605
+ value = getter();
4606
+ }
4607
+ return value;
4608
+ },
4609
+ set(v$1) {
4610
+ Object.defineProperty(object$1, key, { value: v$1 });
4611
+ },
4612
+ configurable: true
4613
+ });
4614
+ }
4615
+ function assignProp(target, prop, value) {
4616
+ Object.defineProperty(target, prop, {
4617
+ value,
4618
+ writable: true,
4619
+ enumerable: true,
4620
+ configurable: true
4621
+ });
4622
+ }
4623
+ function mergeDefs(...defs) {
4624
+ const mergedDescriptors = {};
4625
+ for (const def of defs) {
4626
+ const descriptors$1 = Object.getOwnPropertyDescriptors(def);
4627
+ Object.assign(mergedDescriptors, descriptors$1);
4628
+ }
4629
+ return Object.defineProperties({}, mergedDescriptors);
4630
+ }
4631
+ function esc(str) {
4632
+ return JSON.stringify(str);
4633
+ }
4634
+ function slugify(input) {
4635
+ return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
4636
+ }
4637
+ const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
4638
+ function isObject$2(data) {
4639
+ return typeof data === "object" && data !== null && !Array.isArray(data);
4640
+ }
4641
+ const allowsEval = cached(() => {
4642
+ if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false;
4643
+ try {
4644
+ new Function("");
4645
+ return true;
4646
+ } catch (_$2) {
4647
+ return false;
4648
+ }
4649
+ });
4650
+ function isPlainObject$1(o$2) {
4651
+ if (isObject$2(o$2) === false) return false;
4652
+ const ctor = o$2.constructor;
4653
+ if (ctor === void 0) return true;
4654
+ if (typeof ctor !== "function") return true;
4655
+ const prot = ctor.prototype;
4656
+ if (isObject$2(prot) === false) return false;
4657
+ if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false;
4658
+ return true;
4659
+ }
4660
+ function shallowClone(o$2) {
4661
+ if (isPlainObject$1(o$2)) return { ...o$2 };
4662
+ if (Array.isArray(o$2)) return [...o$2];
4663
+ return o$2;
4664
+ }
4665
+ const propertyKeyTypes = new Set([
4666
+ "string",
4667
+ "number",
4668
+ "symbol"
4669
+ ]);
4670
+ function escapeRegex(str) {
4671
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
4672
+ }
4673
+ function clone(inst, def, params) {
4674
+ const cl = new inst._zod.constr(def ?? inst._zod.def);
4675
+ if (!def || params?.parent) cl._zod.parent = inst;
4676
+ return cl;
4677
+ }
4678
+ function normalizeParams(_params) {
4679
+ const params = _params;
4680
+ if (!params) return {};
4681
+ if (typeof params === "string") return { error: () => params };
4682
+ if (params?.message !== void 0) {
4683
+ if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params");
4684
+ params.error = params.message;
4685
+ }
4686
+ delete params.message;
4687
+ if (typeof params.error === "string") return {
4688
+ ...params,
4689
+ error: () => params.error
4690
+ };
4691
+ return params;
4692
+ }
4693
+ function optionalKeys(shape) {
4694
+ return Object.keys(shape).filter((k$2) => {
4695
+ return shape[k$2]._zod.optin === "optional" && shape[k$2]._zod.optout === "optional";
4696
+ });
4697
+ }
4698
+ const NUMBER_FORMAT_RANGES = {
4699
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
4700
+ int32: [-2147483648, 2147483647],
4701
+ uint32: [0, 4294967295],
4702
+ float32: [-34028234663852886e22, 34028234663852886e22],
4703
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
4704
+ };
4705
+ function pick(schema, mask) {
4706
+ const currDef = schema._zod.def;
4707
+ const checks = currDef.checks;
4708
+ if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements");
4709
+ return clone(schema, mergeDefs(schema._zod.def, {
4710
+ get shape() {
4711
+ const newShape = {};
4712
+ for (const key in mask) {
4713
+ if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
4714
+ if (!mask[key]) continue;
4715
+ newShape[key] = currDef.shape[key];
4716
+ }
4717
+ assignProp(this, "shape", newShape);
4718
+ return newShape;
4719
+ },
4720
+ checks: []
4721
+ }));
4722
+ }
4723
+ function omit(schema, mask) {
4724
+ const currDef = schema._zod.def;
4725
+ const checks = currDef.checks;
4726
+ if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
4727
+ return clone(schema, mergeDefs(schema._zod.def, {
4728
+ get shape() {
4729
+ const newShape = { ...schema._zod.def.shape };
4730
+ for (const key in mask) {
4731
+ if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
4732
+ if (!mask[key]) continue;
4733
+ delete newShape[key];
4734
+ }
4735
+ assignProp(this, "shape", newShape);
4736
+ return newShape;
4737
+ },
4738
+ checks: []
4739
+ }));
4740
+ }
4741
+ function extend(schema, shape) {
4742
+ if (!isPlainObject$1(shape)) throw new Error("Invalid input to extend: expected a plain object");
4743
+ const checks = schema._zod.def.checks;
4744
+ if (checks && checks.length > 0) {
4745
+ const existingShape = schema._zod.def.shape;
4746
+ for (const key in shape) if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
4747
+ }
4748
+ return clone(schema, mergeDefs(schema._zod.def, { get shape() {
4749
+ const _shape = {
4750
+ ...schema._zod.def.shape,
4751
+ ...shape
4752
+ };
4753
+ assignProp(this, "shape", _shape);
4754
+ return _shape;
4755
+ } }));
4756
+ }
4757
+ function safeExtend(schema, shape) {
4218
4758
  if (!isPlainObject$1(shape)) throw new Error("Invalid input to safeExtend: expected a plain object");
4219
4759
  return clone(schema, mergeDefs(schema._zod.def, { get shape() {
4220
4760
  const _shape = {
@@ -6653,7 +7193,7 @@ function initializeContext(params) {
6653
7193
  external: params?.external ?? void 0
6654
7194
  };
6655
7195
  }
6656
- function process$2(schema, ctx, _params = {
7196
+ function process$3(schema, ctx, _params = {
6657
7197
  path: [],
6658
7198
  schemaPath: []
6659
7199
  }) {
@@ -6690,7 +7230,7 @@ function process$2(schema, ctx, _params = {
6690
7230
  const parent = schema._zod.parent;
6691
7231
  if (parent) {
6692
7232
  if (!result.ref) result.ref = parent;
6693
- process$2(parent, ctx, params);
7233
+ process$3(parent, ctx, params);
6694
7234
  ctx.seen.get(parent).isParent = true;
6695
7235
  }
6696
7236
  }
@@ -6902,7 +7442,7 @@ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
6902
7442
  ...params,
6903
7443
  processors
6904
7444
  });
6905
- process$2(schema, ctx);
7445
+ process$3(schema, ctx);
6906
7446
  extractDefs(ctx, schema);
6907
7447
  return finalize(ctx, schema);
6908
7448
  };
@@ -6914,7 +7454,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
6914
7454
  io,
6915
7455
  processors
6916
7456
  });
6917
- process$2(schema, ctx);
7457
+ process$3(schema, ctx);
6918
7458
  extractDefs(ctx, schema);
6919
7459
  return finalize(ctx, schema);
6920
7460
  };
@@ -7001,7 +7541,7 @@ const arrayProcessor = (schema, ctx, _json, params) => {
7001
7541
  if (typeof minimum === "number") json.minItems = minimum;
7002
7542
  if (typeof maximum === "number") json.maxItems = maximum;
7003
7543
  json.type = "array";
7004
- json.items = process$2(def.element, ctx, {
7544
+ json.items = process$3(def.element, ctx, {
7005
7545
  ...params,
7006
7546
  path: [...params.path, "items"]
7007
7547
  });
@@ -7012,7 +7552,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
7012
7552
  json.type = "object";
7013
7553
  json.properties = {};
7014
7554
  const shape = def.shape;
7015
- for (const key in shape) json.properties[key] = process$2(shape[key], ctx, {
7555
+ for (const key in shape) json.properties[key] = process$3(shape[key], ctx, {
7016
7556
  ...params,
7017
7557
  path: [
7018
7558
  ...params.path,
@@ -7030,7 +7570,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
7030
7570
  if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
7031
7571
  else if (!def.catchall) {
7032
7572
  if (ctx.io === "output") json.additionalProperties = false;
7033
- } else if (def.catchall) json.additionalProperties = process$2(def.catchall, ctx, {
7573
+ } else if (def.catchall) json.additionalProperties = process$3(def.catchall, ctx, {
7034
7574
  ...params,
7035
7575
  path: [...params.path, "additionalProperties"]
7036
7576
  });
@@ -7038,7 +7578,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
7038
7578
  const unionProcessor = (schema, ctx, json, params) => {
7039
7579
  const def = schema._zod.def;
7040
7580
  const isExclusive = def.inclusive === false;
7041
- const options = def.options.map((x$2, i$1) => process$2(x$2, ctx, {
7581
+ const options = def.options.map((x$2, i$1) => process$3(x$2, ctx, {
7042
7582
  ...params,
7043
7583
  path: [
7044
7584
  ...params.path,
@@ -7051,7 +7591,7 @@ const unionProcessor = (schema, ctx, json, params) => {
7051
7591
  };
7052
7592
  const intersectionProcessor = (schema, ctx, json, params) => {
7053
7593
  const def = schema._zod.def;
7054
- const a$1 = process$2(def.left, ctx, {
7594
+ const a$1 = process$3(def.left, ctx, {
7055
7595
  ...params,
7056
7596
  path: [
7057
7597
  ...params.path,
@@ -7059,7 +7599,7 @@ const intersectionProcessor = (schema, ctx, json, params) => {
7059
7599
  0
7060
7600
  ]
7061
7601
  });
7062
- const b$2 = process$2(def.right, ctx, {
7602
+ const b$2 = process$3(def.right, ctx, {
7063
7603
  ...params,
7064
7604
  path: [
7065
7605
  ...params.path,
@@ -7076,7 +7616,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7076
7616
  json.type = "array";
7077
7617
  const prefixPath$1 = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
7078
7618
  const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
7079
- const prefixItems = def.items.map((x$2, i$1) => process$2(x$2, ctx, {
7619
+ const prefixItems = def.items.map((x$2, i$1) => process$3(x$2, ctx, {
7080
7620
  ...params,
7081
7621
  path: [
7082
7622
  ...params.path,
@@ -7084,7 +7624,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7084
7624
  i$1
7085
7625
  ]
7086
7626
  }));
7087
- const rest = def.rest ? process$2(def.rest, ctx, {
7627
+ const rest = def.rest ? process$3(def.rest, ctx, {
7088
7628
  ...params,
7089
7629
  path: [
7090
7630
  ...params.path,
@@ -7110,7 +7650,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7110
7650
  };
7111
7651
  const nullableProcessor = (schema, ctx, json, params) => {
7112
7652
  const def = schema._zod.def;
7113
- const inner = process$2(def.innerType, ctx, params);
7653
+ const inner = process$3(def.innerType, ctx, params);
7114
7654
  const seen = ctx.seen.get(schema);
7115
7655
  if (ctx.target === "openapi-3.0") {
7116
7656
  seen.ref = def.innerType;
@@ -7119,27 +7659,27 @@ const nullableProcessor = (schema, ctx, json, params) => {
7119
7659
  };
7120
7660
  const nonoptionalProcessor = (schema, ctx, _json, params) => {
7121
7661
  const def = schema._zod.def;
7122
- process$2(def.innerType, ctx, params);
7662
+ process$3(def.innerType, ctx, params);
7123
7663
  const seen = ctx.seen.get(schema);
7124
7664
  seen.ref = def.innerType;
7125
7665
  };
7126
7666
  const defaultProcessor = (schema, ctx, json, params) => {
7127
7667
  const def = schema._zod.def;
7128
- process$2(def.innerType, ctx, params);
7668
+ process$3(def.innerType, ctx, params);
7129
7669
  const seen = ctx.seen.get(schema);
7130
7670
  seen.ref = def.innerType;
7131
7671
  json.default = JSON.parse(JSON.stringify(def.defaultValue));
7132
7672
  };
7133
7673
  const prefaultProcessor = (schema, ctx, json, params) => {
7134
7674
  const def = schema._zod.def;
7135
- process$2(def.innerType, ctx, params);
7675
+ process$3(def.innerType, ctx, params);
7136
7676
  const seen = ctx.seen.get(schema);
7137
7677
  seen.ref = def.innerType;
7138
7678
  if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
7139
7679
  };
7140
7680
  const catchProcessor = (schema, ctx, json, params) => {
7141
7681
  const def = schema._zod.def;
7142
- process$2(def.innerType, ctx, params);
7682
+ process$3(def.innerType, ctx, params);
7143
7683
  const seen = ctx.seen.get(schema);
7144
7684
  seen.ref = def.innerType;
7145
7685
  let catchValue;
@@ -7153,20 +7693,20 @@ const catchProcessor = (schema, ctx, json, params) => {
7153
7693
  const pipeProcessor = (schema, ctx, _json, params) => {
7154
7694
  const def = schema._zod.def;
7155
7695
  const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
7156
- process$2(innerType, ctx, params);
7696
+ process$3(innerType, ctx, params);
7157
7697
  const seen = ctx.seen.get(schema);
7158
7698
  seen.ref = innerType;
7159
7699
  };
7160
7700
  const readonlyProcessor = (schema, ctx, json, params) => {
7161
7701
  const def = schema._zod.def;
7162
- process$2(def.innerType, ctx, params);
7702
+ process$3(def.innerType, ctx, params);
7163
7703
  const seen = ctx.seen.get(schema);
7164
7704
  seen.ref = def.innerType;
7165
7705
  json.readOnly = true;
7166
7706
  };
7167
7707
  const optionalProcessor = (schema, ctx, _json, params) => {
7168
7708
  const def = schema._zod.def;
7169
- process$2(def.innerType, ctx, params);
7709
+ process$3(def.innerType, ctx, params);
7170
7710
  const seen = ctx.seen.get(schema);
7171
7711
  seen.ref = def.innerType;
7172
7712
  };
@@ -8737,7 +9277,7 @@ var distribution_default = ky;
8737
9277
 
8738
9278
  //#endregion
8739
9279
  //#region src/core/config.ts
8740
- const __dirname$1 = dirname(fileURLToPath(import.meta.url));
9280
+ const __dirname = dirname(fileURLToPath(import.meta.url));
8741
9281
  function getBase44GlobalDir() {
8742
9282
  return join(homedir(), ".base44");
8743
9283
  }
@@ -8745,7 +9285,7 @@ function getAuthFilePath() {
8745
9285
  return join(getBase44GlobalDir(), "auth", "auth.json");
8746
9286
  }
8747
9287
  function getTemplatesDir() {
8748
- return join(__dirname$1, "templates");
9288
+ return join(__dirname, "templates");
8749
9289
  }
8750
9290
  function getTemplatesIndexPath() {
8751
9291
  return join(getTemplatesDir(), "templates.json");
@@ -16192,7 +16732,7 @@ const createIgnorePredicate = (patterns, cwd, baseDir) => {
16192
16732
  };
16193
16733
  const normalizeOptions$2 = (options = {}) => {
16194
16734
  const ignoreOption = options.ignore ? Array.isArray(options.ignore) ? options.ignore : [options.ignore] : [];
16195
- const cwd = toPath$1(options.cwd) ?? y.cwd();
16735
+ const cwd = toPath$1(options.cwd) ?? process$1.cwd();
16196
16736
  const deep = typeof options.deep === "number" ? Math.max(0, options.deep) + 1 : Number.POSITIVE_INFINITY;
16197
16737
  return {
16198
16738
  cwd,
@@ -16289,7 +16829,7 @@ const getDirectoryGlob = ({ directoryPath, files, extensions }) => {
16289
16829
  const extensionGlob = extensions?.length > 0 ? `.${extensions.length > 1 ? `{${extensions.join(",")}}` : extensions[0]}` : "";
16290
16830
  return files ? files.map((file) => path.posix.join(directoryPath, `**/${path.extname(file) ? file : `${file}${extensionGlob}`}`)) : [path.posix.join(directoryPath, `**${extensionGlob ? `/*${extensionGlob}` : ""}`)];
16291
16831
  };
16292
- const directoryToGlob = async (directoryPaths, { cwd = y.cwd(), files, extensions, fs: fsImplementation } = {}) => {
16832
+ const directoryToGlob = async (directoryPaths, { cwd = process$1.cwd(), files, extensions, fs: fsImplementation } = {}) => {
16293
16833
  return (await Promise.all(directoryPaths.map(async (directoryPath) => {
16294
16834
  if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
16295
16835
  directoryPath,
@@ -16303,7 +16843,7 @@ const directoryToGlob = async (directoryPaths, { cwd = y.cwd(), files, extension
16303
16843
  }) : directoryPath;
16304
16844
  }))).flat();
16305
16845
  };
16306
- const directoryToGlobSync = (directoryPaths, { cwd = y.cwd(), files, extensions, fs: fsImplementation } = {}) => directoryPaths.flatMap((directoryPath) => {
16846
+ const directoryToGlobSync = (directoryPaths, { cwd = process$1.cwd(), files, extensions, fs: fsImplementation } = {}) => directoryPaths.flatMap((directoryPath) => {
16307
16847
  if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
16308
16848
  directoryPath,
16309
16849
  files,
@@ -16399,7 +16939,7 @@ const applyIgnoreFilesAndGetFilterSync = (options) => {
16399
16939
  };
16400
16940
  const createFilterFunction = (isIgnored, cwd) => {
16401
16941
  const seen = /* @__PURE__ */ new Set();
16402
- const basePath = cwd || y.cwd();
16942
+ const basePath = cwd || process$1.cwd();
16403
16943
  const pathCache = /* @__PURE__ */ new Map();
16404
16944
  return (fastGlobResult) => {
16405
16945
  const pathKey$1 = path.normalize(fastGlobResult.path ?? fastGlobResult);
@@ -26763,11 +27303,11 @@ const constants$2 = Object.freeze(Object.assign(Object.create(null), {
26763
27303
 
26764
27304
  //#endregion
26765
27305
  //#region node_modules/minizlib/dist/esm/index.js
26766
- const OriginalBufferConcat = Buffer$1.concat;
26767
- const desc = Object.getOwnPropertyDescriptor(Buffer$1, "concat");
27306
+ const OriginalBufferConcat = Buffer$2.concat;
27307
+ const desc = Object.getOwnPropertyDescriptor(Buffer$2, "concat");
26768
27308
  const noop$2 = (args) => args;
26769
27309
  const passthroughBufferConcat = desc?.writable === true || desc?.set !== void 0 ? (makeNoOp) => {
26770
- Buffer$1.concat = makeNoOp ? noop$2 : OriginalBufferConcat;
27310
+ Buffer$2.concat = makeNoOp ? noop$2 : OriginalBufferConcat;
26771
27311
  } : (_$2) => {};
26772
27312
  const _superWrite = Symbol("_superWrite");
26773
27313
  var ZlibError = class extends Error {
@@ -26845,7 +27385,7 @@ var ZlibBase = class extends Minipass {
26845
27385
  flush(flushFlag) {
26846
27386
  if (this.ended) return;
26847
27387
  if (typeof flushFlag !== "number") flushFlag = this.#fullFlushFlag;
26848
- this.write(Object.assign(Buffer$1.alloc(0), { [_flushFlag]: flushFlag }));
27388
+ this.write(Object.assign(Buffer$2.alloc(0), { [_flushFlag]: flushFlag }));
26849
27389
  }
26850
27390
  end(chunk, encoding, cb) {
26851
27391
  /* c8 ignore start */
@@ -26873,7 +27413,7 @@ var ZlibBase = class extends Minipass {
26873
27413
  }
26874
27414
  write(chunk, encoding, cb) {
26875
27415
  if (typeof encoding === "function") cb = encoding, encoding = "utf8";
26876
- if (typeof chunk === "string") chunk = Buffer$1.from(chunk, encoding);
27416
+ if (typeof chunk === "string") chunk = Buffer$2.from(chunk, encoding);
26877
27417
  if (this.#sawError) return;
26878
27418
  assert(this.#handle, "zlib binding closed");
26879
27419
  const nativeHandle = this.#handle._handle;
@@ -26902,9 +27442,9 @@ var ZlibBase = class extends Minipass {
26902
27442
  let writeReturn;
26903
27443
  if (result) if (Array.isArray(result) && result.length > 0) {
26904
27444
  const r$1 = result[0];
26905
- writeReturn = this[_superWrite](Buffer$1.from(r$1));
27445
+ writeReturn = this[_superWrite](Buffer$2.from(r$1));
26906
27446
  for (let i$1 = 1; i$1 < result.length; i$1++) writeReturn = this[_superWrite](result[i$1]);
26907
- } else writeReturn = this[_superWrite](Buffer$1.from(result));
27447
+ } else writeReturn = this[_superWrite](Buffer$2.from(result));
26908
27448
  if (cb) cb();
26909
27449
  return writeReturn;
26910
27450
  }
@@ -27382,8 +27922,8 @@ const parseKVLine = (set, line) => {
27382
27922
 
27383
27923
  //#endregion
27384
27924
  //#region node_modules/tar/dist/esm/normalize-windows-path.js
27385
- const platform$2 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
27386
- const normalizeWindowsPath = platform$2 !== "win32" ? (p$1) => p$1 : (p$1) => p$1 && p$1.replace(/\\/g, "/");
27925
+ const platform$1 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
27926
+ const normalizeWindowsPath = platform$1 !== "win32" ? (p$1) => p$1 : (p$1) => p$1 && p$1.replace(/\\/g, "/");
27387
27927
 
27388
27928
  //#endregion
27389
27929
  //#region node_modules/tar/dist/esm/read-entry.js
@@ -30768,13 +31308,13 @@ var ansi_styles_default = ansiStyles;
30768
31308
 
30769
31309
  //#endregion
30770
31310
  //#region node_modules/chalk/source/vendor/supports-color/index.js
30771
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : y.argv) {
31311
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process$1.argv) {
30772
31312
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
30773
31313
  const position = argv.indexOf(prefix + flag);
30774
31314
  const terminatorPosition = argv.indexOf("--");
30775
31315
  return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
30776
31316
  }
30777
- const { env } = y;
31317
+ const { env } = process$1;
30778
31318
  let flagForceColor;
30779
31319
  if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
30780
31320
  else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
@@ -30807,7 +31347,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
30807
31347
  if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
30808
31348
  const min = forceColor || 0;
30809
31349
  if (env.TERM === "dumb") return min;
30810
- if (y.platform === "win32") {
31350
+ if (process$1.platform === "win32") {
30811
31351
  const osRelease = os.release().split(".");
30812
31352
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
30813
31353
  return 1;
@@ -31258,7 +31798,18 @@ async function generateAndDisplayDeviceCode() {
31258
31798
  successMessage: "Device code generated",
31259
31799
  errorMessage: "Failed to generate device code"
31260
31800
  });
31261
- M.info(`Verification code: ${theme.styles.bold(deviceCodeResponse.userCode)}\nPlease confirm this code at: ${deviceCodeResponse.verificationUri}`);
31801
+ M.info(`Verification code: ${theme.styles.bold(deviceCodeResponse.userCode)}\nPlease confirm this code at: ${theme.colors.links(deviceCodeResponse.verificationUri)}`);
31802
+ const rl = readline.createInterface({
31803
+ input: process.stdin,
31804
+ output: process.stdout
31805
+ });
31806
+ await new Promise((resolve$1) => {
31807
+ rl.question("Press Enter to open in browser...", () => {
31808
+ rl.close();
31809
+ resolve$1();
31810
+ });
31811
+ });
31812
+ await open_default(deviceCodeResponse.verificationUri);
31262
31813
  return deviceCodeResponse;
31263
31814
  }
31264
31815
  async function waitForAuthentication(deviceCode, expiresIn, interval) {
@@ -31546,9 +32097,9 @@ const getSubprocessResult = ({ stdout: stdout$1 }) => {
31546
32097
  //#region node_modules/execa/lib/utils/standard-stream.js
31547
32098
  const isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
31548
32099
  const STANDARD_STREAMS = [
31549
- y.stdin,
31550
- y.stdout,
31551
- y.stderr
32100
+ process$1.stdin,
32101
+ process$1.stdout,
32102
+ process$1.stderr
31552
32103
  ];
31553
32104
  const STANDARD_STREAMS_ALIASES = [
31554
32105
  "stdin",
@@ -31673,9 +32224,9 @@ const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
31673
32224
  //#endregion
31674
32225
  //#region node_modules/is-unicode-supported/index.js
31675
32226
  function isUnicodeSupported() {
31676
- const { env: env$1 } = y;
32227
+ const { env: env$1 } = process$1;
31677
32228
  const { TERM, TERM_PROGRAM } = env$1;
31678
- if (y.platform !== "win32") return TERM !== "linux";
32229
+ if (process$1.platform !== "win32") return TERM !== "linux";
31679
32230
  return Boolean(env$1.WT_SESSION) || Boolean(env$1.TERMINUS_SUBLIME) || env$1.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env$1.TERMINAL_EMULATOR === "JetBrains-JediTerm";
31680
32231
  }
31681
32232
 
@@ -32602,7 +33153,7 @@ const TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
32602
33153
 
32603
33154
  //#endregion
32604
33155
  //#region node_modules/npm-run-path/index.js
32605
- const npmRunPath = ({ cwd = y.cwd(), path: pathOption = y.env[pathKey()], preferLocal = true, execPath: execPath$1 = y.execPath, addExecPath = true } = {}) => {
33156
+ const npmRunPath = ({ cwd = process$1.cwd(), path: pathOption = process$1.env[pathKey()], preferLocal = true, execPath: execPath$1 = process$1.execPath, addExecPath = true } = {}) => {
32606
33157
  const cwdPath = path.resolve(toPath(cwd));
32607
33158
  const result = [];
32608
33159
  const pathParts = pathOption.split(path.delimiter);
@@ -32620,7 +33171,7 @@ const applyExecPath = (result, pathParts, execPath$1, cwdPath) => {
32620
33171
  const pathPart = path.resolve(cwdPath, toPath(execPath$1), "..");
32621
33172
  if (!pathParts.includes(pathPart)) result.push(pathPart);
32622
33173
  };
32623
- const npmRunPathEnv = ({ env: env$1 = y.env, ...options } = {}) => {
33174
+ const npmRunPathEnv = ({ env: env$1 = process$1.env, ...options } = {}) => {
32624
33175
  env$1 = { ...env$1 };
32625
33176
  const pathName = pathKey({ env: env$1 });
32626
33177
  options.path = env$1[pathName];
@@ -32953,7 +33504,7 @@ const getSignals = () => {
32953
33504
  return [...SIGNALS, ...realtimeSignals].map(normalizeSignal$1);
32954
33505
  };
32955
33506
  const normalizeSignal$1 = ({ name: name$1, number: defaultNumber, description, action, forced = false, standard }) => {
32956
- const { signals: { [name$1]: constantSignal } } = constants;
33507
+ const { signals: { [name$1]: constantSignal } } = constants$1;
32957
33508
  const supported = constantSignal !== void 0;
32958
33509
  return {
32959
33510
  name: name$1,
@@ -33003,7 +33554,7 @@ const getSignalByNumber = (number$2, signals$1) => {
33003
33554
  } };
33004
33555
  };
33005
33556
  const findSignalByNumber = (number$2, signals$1) => {
33006
- const signal = signals$1.find(({ name: name$1 }) => constants.signals[name$1] === number$2);
33557
+ const signal = signals$1.find(({ name: name$1 }) => constants$1.signals[name$1] === number$2);
33007
33558
  if (signal !== void 0) return signal;
33008
33559
  return signals$1.find((signalA) => signalA.number === number$2);
33009
33560
  };
@@ -33026,17 +33577,17 @@ const normalizeSignalInteger = (signalInteger, optionName) => {
33026
33577
  if (signalsIntegerToName.has(signalInteger)) return signalsIntegerToName.get(signalInteger);
33027
33578
  throw new TypeError(`Invalid ${optionName} ${signalInteger}: this signal integer does not exist.\n${getAvailableSignals()}`);
33028
33579
  };
33029
- const getSignalsIntegerToName = () => new Map(Object.entries(constants.signals).reverse().map(([signalName, signalInteger]) => [signalInteger, signalName]));
33580
+ const getSignalsIntegerToName = () => new Map(Object.entries(constants$1.signals).reverse().map(([signalName, signalInteger]) => [signalInteger, signalName]));
33030
33581
  const signalsIntegerToName = getSignalsIntegerToName();
33031
33582
  const normalizeSignalName = (signalName, optionName) => {
33032
- if (signalName in constants.signals) return signalName;
33033
- if (signalName.toUpperCase() in constants.signals) throw new TypeError(`Invalid ${optionName} '${signalName}': please rename it to '${signalName.toUpperCase()}'.`);
33583
+ if (signalName in constants$1.signals) return signalName;
33584
+ if (signalName.toUpperCase() in constants$1.signals) throw new TypeError(`Invalid ${optionName} '${signalName}': please rename it to '${signalName.toUpperCase()}'.`);
33034
33585
  throw new TypeError(`Invalid ${optionName} '${signalName}': this signal name does not exist.\n${getAvailableSignals()}`);
33035
33586
  };
33036
33587
  const getAvailableSignals = () => `Available signal names: ${getAvailableSignalNames()}.
33037
33588
  Available signal numbers: ${getAvailableSignalIntegers()}.`;
33038
- const getAvailableSignalNames = () => Object.keys(constants.signals).sort().map((signalName) => `'${signalName}'`).join(", ");
33039
- const getAvailableSignalIntegers = () => [...new Set(Object.values(constants.signals).sort((signalInteger, signalIntegerTwo) => signalInteger - signalIntegerTwo))].join(", ");
33589
+ const getAvailableSignalNames = () => Object.keys(constants$1.signals).sort().map((signalName) => `'${signalName}'`).join(", ");
33590
+ const getAvailableSignalIntegers = () => [...new Set(Object.values(constants$1.signals).sort((signalInteger, signalIntegerTwo) => signalInteger - signalIntegerTwo))].join(", ");
33040
33591
  const getSignalDescription = (signal) => signalsByName[signal].description;
33041
33592
 
33042
33593
  //#endregion
@@ -33755,7 +34306,7 @@ const normalizeCwd = (cwd = getDefaultCwd()) => {
33755
34306
  };
33756
34307
  const getDefaultCwd = () => {
33757
34308
  try {
33758
- return y.cwd();
34309
+ return process$1.cwd();
33759
34310
  } catch (error) {
33760
34311
  error.message = `The current directory does not exist.\n${error.message}`;
33761
34312
  throw error;
@@ -33790,7 +34341,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
33790
34341
  options.killSignal = normalizeKillSignal(options.killSignal);
33791
34342
  options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
33792
34343
  options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
33793
- if (y.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
34344
+ if (process$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
33794
34345
  return {
33795
34346
  file,
33796
34347
  commandArguments,
@@ -33817,7 +34368,7 @@ const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDi
33817
34368
  });
33818
34369
  const getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
33819
34370
  const env$1 = extendEnv ? {
33820
- ...y.env,
34371
+ ...process$1.env,
33821
34372
  ...envOption
33822
34373
  } : envOption;
33823
34374
  if (preferLocal || node) return npmRunPathEnv({
@@ -34817,12 +35368,12 @@ const guessStreamDirection = {
34817
35368
  }
34818
35369
  };
34819
35370
  const getStandardStreamDirection = (value) => {
34820
- if ([0, y.stdin].includes(value)) return "input";
35371
+ if ([0, process$1.stdin].includes(value)) return "input";
34821
35372
  if ([
34822
35373
  1,
34823
35374
  2,
34824
- y.stdout,
34825
- y.stderr
35375
+ process$1.stdout,
35376
+ process$1.stderr
34826
35377
  ].includes(value)) return "output";
34827
35378
  };
34828
35379
  const DEFAULT_DIRECTION = "output";
@@ -35276,7 +35827,7 @@ const linesUint8ArrayInfo = {
35276
35827
  //#region node_modules/execa/lib/transform/validate.js
35277
35828
  const getValidateTransformInput = (writableObjectMode, optionName) => writableObjectMode ? void 0 : validateStringTransformInput.bind(void 0, optionName);
35278
35829
  const validateStringTransformInput = function* (optionName, chunk) {
35279
- if (typeof chunk !== "string" && !isUint8Array(chunk) && !Buffer$2.isBuffer(chunk)) throw new TypeError(`The \`${optionName}\` option's transform must use "objectMode: true" to receive as input: ${typeof chunk}.`);
35830
+ if (typeof chunk !== "string" && !isUint8Array(chunk) && !Buffer$1.isBuffer(chunk)) throw new TypeError(`The \`${optionName}\` option's transform must use "objectMode: true" to receive as input: ${typeof chunk}.`);
35280
35831
  yield chunk;
35281
35832
  };
35282
35833
  const getValidateTransformReturn = (readableObjectMode, optionName) => readableObjectMode ? validateObjectTransformReturn.bind(void 0, optionName) : validateStringTransformReturn.bind(void 0, optionName);
@@ -35307,7 +35858,7 @@ const getEncodingTransformGenerator = (binary, encoding, skipped) => {
35307
35858
  };
35308
35859
  };
35309
35860
  const encodingUint8ArrayGenerator = function* (textEncoder$2, chunk) {
35310
- if (Buffer$2.isBuffer(chunk)) yield bufferToUint8Array(chunk);
35861
+ if (Buffer$1.isBuffer(chunk)) yield bufferToUint8Array(chunk);
35311
35862
  else if (typeof chunk === "string") yield textEncoder$2.encode(chunk);
35312
35863
  else yield chunk;
35313
35864
  };
@@ -35886,9 +36437,9 @@ const addIpcMethods = (subprocess, { ipc }) => {
35886
36437
  Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
35887
36438
  };
35888
36439
  const getIpcExport = () => {
35889
- const anyProcess = y;
36440
+ const anyProcess = process$1;
35890
36441
  const isSubprocess = true;
35891
- const ipc = y.channel !== void 0;
36442
+ const ipc = process$1.channel !== void 0;
35892
36443
  return {
35893
36444
  ...getIpcMethods(anyProcess, isSubprocess, ipc),
35894
36445
  getCancelSignal: getCancelSignal$1.bind(void 0, {
@@ -36004,7 +36555,7 @@ const addPropertiesAsync = {
36004
36555
  iterable: ({ value }) => ({ stream: Readable.from(value) }),
36005
36556
  asyncIterable: ({ value }) => ({ stream: Readable.from(value) }),
36006
36557
  string: ({ value }) => ({ stream: Readable.from(value) }),
36007
- uint8Array: ({ value }) => ({ stream: Readable.from(Buffer$2.from(value)) })
36558
+ uint8Array: ({ value }) => ({ stream: Readable.from(Buffer$1.from(value)) })
36008
36559
  },
36009
36560
  output: {
36010
36561
  ...addProperties,
@@ -36130,7 +36681,7 @@ if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SI
36130
36681
 
36131
36682
  //#endregion
36132
36683
  //#region node_modules/signal-exit/dist/mjs/index.js
36133
- const processOk = (process$4) => !!process$4 && typeof process$4 === "object" && typeof process$4.removeListener === "function" && typeof process$4.emit === "function" && typeof process$4.reallyExit === "function" && typeof process$4.listeners === "function" && typeof process$4.kill === "function" && typeof process$4.pid === "number" && typeof process$4.on === "function";
36684
+ const processOk = (process$5) => !!process$5 && typeof process$5 === "object" && typeof process$5.removeListener === "function" && typeof process$5.emit === "function" && typeof process$5.reallyExit === "function" && typeof process$5.listeners === "function" && typeof process$5.kill === "function" && typeof process$5.pid === "number" && typeof process$5.on === "function";
36134
36685
  const kExitEmitter = Symbol.for("signal-exit emitter");
36135
36686
  const global$1 = globalThis;
36136
36687
  const ObjectDefineProperty = Object.defineProperty.bind(Object);
@@ -36198,7 +36749,7 @@ var SignalExitFallback = class extends SignalExitBase {
36198
36749
  };
36199
36750
  var SignalExit = class extends SignalExitBase {
36200
36751
  /* c8 ignore start */
36201
- #hupSig = process$1.platform === "win32" ? "SIGINT" : "SIGHUP";
36752
+ #hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
36202
36753
  /* c8 ignore stop */
36203
36754
  #emitter = new Emitter();
36204
36755
  #process;
@@ -36206,15 +36757,15 @@ var SignalExit = class extends SignalExitBase {
36206
36757
  #originalProcessReallyExit;
36207
36758
  #sigListeners = {};
36208
36759
  #loaded = false;
36209
- constructor(process$4) {
36760
+ constructor(process$5) {
36210
36761
  super();
36211
- this.#process = process$4;
36762
+ this.#process = process$5;
36212
36763
  this.#sigListeners = {};
36213
36764
  for (const sig of signals) this.#sigListeners[sig] = () => {
36214
36765
  const listeners = this.#process.listeners(sig);
36215
36766
  let { count: count$1 } = this.#emitter;
36216
36767
  /* c8 ignore start */
36217
- const p$1 = process$4;
36768
+ const p$1 = process$5;
36218
36769
  if (typeof p$1.__signal_exit_emitter__ === "object" && typeof p$1.__signal_exit_emitter__.count === "number") count$1 += p$1.__signal_exit_emitter__.count;
36219
36770
  /* c8 ignore stop */
36220
36771
  if (listeners.length === count$1) {
@@ -36222,11 +36773,11 @@ var SignalExit = class extends SignalExitBase {
36222
36773
  const ret = this.#emitter.emit("exit", null, sig);
36223
36774
  /* c8 ignore start */
36224
36775
  const s = sig === "SIGHUP" ? this.#hupSig : sig;
36225
- if (!ret) process$4.kill(process$4.pid, s);
36776
+ if (!ret) process$5.kill(process$5.pid, s);
36226
36777
  }
36227
36778
  };
36228
- this.#originalProcessReallyExit = process$4.reallyExit;
36229
- this.#originalProcessEmit = process$4.emit;
36779
+ this.#originalProcessReallyExit = process$5.reallyExit;
36780
+ this.#originalProcessEmit = process$5.emit;
36230
36781
  }
36231
36782
  onExit(cb, opts) {
36232
36783
  /* c8 ignore start */
@@ -36293,8 +36844,8 @@ var SignalExit = class extends SignalExitBase {
36293
36844
  } else return og.call(this.#process, ev, ...args);
36294
36845
  }
36295
36846
  };
36296
- const process$1 = globalThis.process;
36297
- const { onExit, load, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
36847
+ const process$2 = globalThis.process;
36848
+ const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
36298
36849
 
36299
36850
  //#endregion
36300
36851
  //#region node_modules/execa/lib/terminate/cleanup.js
@@ -38045,6 +38596,13 @@ var require_lodash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
38045
38596
  //#region src/cli/commands/project/create.ts
38046
38597
  var import_lodash = /* @__PURE__ */ __toESM(require_lodash(), 1);
38047
38598
  const DEFAULT_TEMPLATE_ID = "backend-only";
38599
+ const SUPPORTED_AGENTS = [{
38600
+ value: "cursor",
38601
+ label: "Cursor"
38602
+ }, {
38603
+ value: "claude-code",
38604
+ label: "Claude Code"
38605
+ }];
38048
38606
  async function getTemplateById(templateId) {
38049
38607
  const templates = await listTemplates();
38050
38608
  const template = templates.find((t) => t.id === templateId);
@@ -38107,6 +38665,7 @@ async function createInteractive(options) {
38107
38665
  description: result.description || void 0,
38108
38666
  projectPath: result.projectPath,
38109
38667
  deploy: options.deploy,
38668
+ skills: options.skills,
38110
38669
  isInteractive: true
38111
38670
  });
38112
38671
  }
@@ -38117,10 +38676,11 @@ async function createNonInteractive(options) {
38117
38676
  description: options.description,
38118
38677
  projectPath: options.path,
38119
38678
  deploy: options.deploy,
38679
+ skills: options.skills,
38120
38680
  isInteractive: false
38121
38681
  });
38122
38682
  }
38123
- async function executeCreate({ template, name: rawName, description, projectPath, deploy, isInteractive }) {
38683
+ async function executeCreate({ template, name: rawName, description, projectPath, deploy, skills, isInteractive }) {
38124
38684
  const name$1 = rawName.trim();
38125
38685
  const resolvedPath = resolve(projectPath);
38126
38686
  const { projectId } = await runTask("Setting up your project...", async () => {
@@ -38180,554 +38740,48 @@ async function executeCreate({ template, name: rawName, description, projectPath
38180
38740
  finalAppUrl = appUrl;
38181
38741
  }
38182
38742
  }
38743
+ let selectedAgents = [];
38744
+ if (isInteractive) {
38745
+ const result = await fe({
38746
+ message: "Add AI agent skills? (Select agents to configure)",
38747
+ options: SUPPORTED_AGENTS,
38748
+ initialValues: SUPPORTED_AGENTS.map((agent) => agent.value),
38749
+ required: false
38750
+ });
38751
+ if (!pD(result)) selectedAgents = result;
38752
+ } else if (skills) selectedAgents = SUPPORTED_AGENTS.map((agent) => agent.value);
38753
+ if (selectedAgents.length > 0) {
38754
+ const agentArgs = selectedAgents.flatMap((agent) => ["-a", agent]);
38755
+ M.step(`Installing skills for: ${selectedAgents.join(", ")}`);
38756
+ await runTask(`Installing skills for: ${selectedAgents.join(", ")}`, async () => {
38757
+ await execa("npx", [
38758
+ "-y",
38759
+ "add-skill",
38760
+ "base44/skills",
38761
+ "-y",
38762
+ "-s",
38763
+ "base44-cli",
38764
+ "-s",
38765
+ "base44-sdk",
38766
+ ...agentArgs
38767
+ ], {
38768
+ cwd: resolvedPath,
38769
+ stdio: "inherit"
38770
+ });
38771
+ }, {
38772
+ successMessage: theme.colors.base44Orange("AI agent skills added successfully"),
38773
+ errorMessage: "Failed to add AI agent skills - you can add them later with: npx add-skill base44/skills"
38774
+ });
38775
+ }
38183
38776
  M.message(`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name$1)}`);
38184
38777
  M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(projectId))}`);
38185
38778
  if (finalAppUrl) M.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
38186
38779
  return { outroMessage: "Your project is set up and ready to use" };
38187
38780
  }
38188
- const createCommand = new Command("create").description("Create a new Base44 project").option("-n, --name <name>", "Project name").option("-d, --description <description>", "Project description").option("-p, --path <path>", "Path where to create the project").option("-t, --template <id>", "Template ID (e.g., backend-only, backend-and-client)").option("--deploy", "Build and deploy the site").hook("preAction", validateNonInteractiveFlags$1).action(async (options) => {
38781
+ const createCommand = new Command("create").description("Create a new Base44 project").option("-n, --name <name>", "Project name").option("-d, --description <description>", "Project description").option("-p, --path <path>", "Path where to create the project").option("-t, --template <id>", "Template ID (e.g., backend-only, backend-and-client)").option("--deploy", "Build and deploy the site").option("--skills", "Add AI agent skills (Cursor, Claude Code)").hook("preAction", validateNonInteractiveFlags$1).action(async (options) => {
38189
38782
  await chooseCreate(options);
38190
38783
  });
38191
38784
 
38192
- //#endregion
38193
- //#region node_modules/is-docker/index.js
38194
- let isDockerCached;
38195
- function hasDockerEnv() {
38196
- try {
38197
- fs.statSync("/.dockerenv");
38198
- return true;
38199
- } catch {
38200
- return false;
38201
- }
38202
- }
38203
- function hasDockerCGroup() {
38204
- try {
38205
- return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
38206
- } catch {
38207
- return false;
38208
- }
38209
- }
38210
- function isDocker() {
38211
- if (isDockerCached === void 0) isDockerCached = hasDockerEnv() || hasDockerCGroup();
38212
- return isDockerCached;
38213
- }
38214
-
38215
- //#endregion
38216
- //#region node_modules/is-inside-container/index.js
38217
- let cachedResult;
38218
- const hasContainerEnv = () => {
38219
- try {
38220
- fs.statSync("/run/.containerenv");
38221
- return true;
38222
- } catch {
38223
- return false;
38224
- }
38225
- };
38226
- function isInsideContainer() {
38227
- if (cachedResult === void 0) cachedResult = hasContainerEnv() || isDocker();
38228
- return cachedResult;
38229
- }
38230
-
38231
- //#endregion
38232
- //#region node_modules/is-wsl/index.js
38233
- const isWsl = () => {
38234
- if (y.platform !== "linux") return false;
38235
- if (os.release().toLowerCase().includes("microsoft")) {
38236
- if (isInsideContainer()) return false;
38237
- return true;
38238
- }
38239
- try {
38240
- return fs.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
38241
- } catch {
38242
- return false;
38243
- }
38244
- };
38245
- var is_wsl_default = y.env.__IS_WSL_TEST__ ? isWsl : isWsl();
38246
-
38247
- //#endregion
38248
- //#region node_modules/powershell-utils/index.js
38249
- const execFile$2 = promisify(childProcess.execFile);
38250
- const powerShellPath$1 = () => `${y.env.SYSTEMROOT || y.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
38251
- const executePowerShell = async (command, options = {}) => {
38252
- const { powerShellPath: psPath, ...execFileOptions } = options;
38253
- const encodedCommand = executePowerShell.encodeCommand(command);
38254
- return execFile$2(psPath ?? powerShellPath$1(), [...executePowerShell.argumentsPrefix, encodedCommand], {
38255
- encoding: "utf8",
38256
- ...execFileOptions
38257
- });
38258
- };
38259
- executePowerShell.argumentsPrefix = [
38260
- "-NoProfile",
38261
- "-NonInteractive",
38262
- "-ExecutionPolicy",
38263
- "Bypass",
38264
- "-EncodedCommand"
38265
- ];
38266
- executePowerShell.encodeCommand = (command) => Buffer$2.from(command, "utf16le").toString("base64");
38267
- executePowerShell.escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
38268
-
38269
- //#endregion
38270
- //#region node_modules/wsl-utils/utilities.js
38271
- function parseMountPointFromConfig(content) {
38272
- for (const line of content.split("\n")) {
38273
- if (/^\s*#/.test(line)) continue;
38274
- const match = /^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(line);
38275
- if (!match) continue;
38276
- return match.groups.mountPoint.trim().replaceAll(/^["']|["']$/g, "");
38277
- }
38278
- }
38279
-
38280
- //#endregion
38281
- //#region node_modules/wsl-utils/index.js
38282
- const execFile$1 = promisify(childProcess.execFile);
38283
- const wslDrivesMountPoint = (() => {
38284
- const defaultMountPoint = "/mnt/";
38285
- let mountPoint;
38286
- return async function() {
38287
- if (mountPoint) return mountPoint;
38288
- const configFilePath = "/etc/wsl.conf";
38289
- let isConfigFileExists = false;
38290
- try {
38291
- await fs$1.access(configFilePath, constants$1.F_OK);
38292
- isConfigFileExists = true;
38293
- } catch {}
38294
- if (!isConfigFileExists) return defaultMountPoint;
38295
- const parsedMountPoint = parseMountPointFromConfig(await fs$1.readFile(configFilePath, { encoding: "utf8" }));
38296
- if (parsedMountPoint === void 0) return defaultMountPoint;
38297
- mountPoint = parsedMountPoint;
38298
- mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
38299
- return mountPoint;
38300
- };
38301
- })();
38302
- const powerShellPathFromWsl = async () => {
38303
- return `${await wslDrivesMountPoint()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
38304
- };
38305
- const powerShellPath = is_wsl_default ? powerShellPathFromWsl : powerShellPath$1;
38306
- let canAccessPowerShellPromise;
38307
- const canAccessPowerShell = async () => {
38308
- canAccessPowerShellPromise ??= (async () => {
38309
- try {
38310
- const psPath = await powerShellPath();
38311
- await fs$1.access(psPath, constants$1.X_OK);
38312
- return true;
38313
- } catch {
38314
- return false;
38315
- }
38316
- })();
38317
- return canAccessPowerShellPromise;
38318
- };
38319
- const wslDefaultBrowser = async () => {
38320
- const psPath = await powerShellPath();
38321
- const { stdout: stdout$1 } = await executePowerShell(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, { powerShellPath: psPath });
38322
- return stdout$1.trim();
38323
- };
38324
- const convertWslPathToWindows = async (path$16) => {
38325
- if (/^[a-z]+:\/\//i.test(path$16)) return path$16;
38326
- try {
38327
- const { stdout: stdout$1 } = await execFile$1("wslpath", ["-aw", path$16], { encoding: "utf8" });
38328
- return stdout$1.trim();
38329
- } catch {
38330
- return path$16;
38331
- }
38332
- };
38333
-
38334
- //#endregion
38335
- //#region node_modules/define-lazy-prop/index.js
38336
- function defineLazyProperty(object$1, propertyName, valueGetter) {
38337
- const define$1 = (value) => Object.defineProperty(object$1, propertyName, {
38338
- value,
38339
- enumerable: true,
38340
- writable: true
38341
- });
38342
- Object.defineProperty(object$1, propertyName, {
38343
- configurable: true,
38344
- enumerable: true,
38345
- get() {
38346
- const result = valueGetter();
38347
- define$1(result);
38348
- return result;
38349
- },
38350
- set(value) {
38351
- define$1(value);
38352
- }
38353
- });
38354
- return object$1;
38355
- }
38356
-
38357
- //#endregion
38358
- //#region node_modules/default-browser-id/index.js
38359
- const execFileAsync$3 = promisify(execFile);
38360
- async function defaultBrowserId() {
38361
- if (y.platform !== "darwin") throw new Error("macOS only");
38362
- const { stdout: stdout$1 } = await execFileAsync$3("defaults", [
38363
- "read",
38364
- "com.apple.LaunchServices/com.apple.launchservices.secure",
38365
- "LSHandlers"
38366
- ]);
38367
- const browserId = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout$1)?.groups.id ?? "com.apple.Safari";
38368
- if (browserId === "com.apple.safari") return "com.apple.Safari";
38369
- return browserId;
38370
- }
38371
-
38372
- //#endregion
38373
- //#region node_modules/run-applescript/index.js
38374
- const execFileAsync$2 = promisify(execFile);
38375
- async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
38376
- if (y.platform !== "darwin") throw new Error("macOS only");
38377
- const outputArguments = humanReadableOutput ? [] : ["-ss"];
38378
- const execOptions = {};
38379
- if (signal) execOptions.signal = signal;
38380
- const { stdout: stdout$1 } = await execFileAsync$2("osascript", [
38381
- "-e",
38382
- script,
38383
- outputArguments
38384
- ], execOptions);
38385
- return stdout$1.trim();
38386
- }
38387
-
38388
- //#endregion
38389
- //#region node_modules/bundle-name/index.js
38390
- async function bundleName(bundleId) {
38391
- return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
38392
- }
38393
-
38394
- //#endregion
38395
- //#region node_modules/default-browser/windows.js
38396
- const execFileAsync$1 = promisify(execFile);
38397
- const windowsBrowserProgIds = {
38398
- MSEdgeHTM: {
38399
- name: "Edge",
38400
- id: "com.microsoft.edge"
38401
- },
38402
- MSEdgeBHTML: {
38403
- name: "Edge Beta",
38404
- id: "com.microsoft.edge.beta"
38405
- },
38406
- MSEdgeDHTML: {
38407
- name: "Edge Dev",
38408
- id: "com.microsoft.edge.dev"
38409
- },
38410
- AppXq0fevzme2pys62n3e0fbqa7peapykr8v: {
38411
- name: "Edge",
38412
- id: "com.microsoft.edge.old"
38413
- },
38414
- ChromeHTML: {
38415
- name: "Chrome",
38416
- id: "com.google.chrome"
38417
- },
38418
- ChromeBHTML: {
38419
- name: "Chrome Beta",
38420
- id: "com.google.chrome.beta"
38421
- },
38422
- ChromeDHTML: {
38423
- name: "Chrome Dev",
38424
- id: "com.google.chrome.dev"
38425
- },
38426
- ChromiumHTM: {
38427
- name: "Chromium",
38428
- id: "org.chromium.Chromium"
38429
- },
38430
- BraveHTML: {
38431
- name: "Brave",
38432
- id: "com.brave.Browser"
38433
- },
38434
- BraveBHTML: {
38435
- name: "Brave Beta",
38436
- id: "com.brave.Browser.beta"
38437
- },
38438
- BraveDHTML: {
38439
- name: "Brave Dev",
38440
- id: "com.brave.Browser.dev"
38441
- },
38442
- BraveSSHTM: {
38443
- name: "Brave Nightly",
38444
- id: "com.brave.Browser.nightly"
38445
- },
38446
- FirefoxURL: {
38447
- name: "Firefox",
38448
- id: "org.mozilla.firefox"
38449
- },
38450
- OperaStable: {
38451
- name: "Opera",
38452
- id: "com.operasoftware.Opera"
38453
- },
38454
- VivaldiHTM: {
38455
- name: "Vivaldi",
38456
- id: "com.vivaldi.Vivaldi"
38457
- },
38458
- "IE.HTTP": {
38459
- name: "Internet Explorer",
38460
- id: "com.microsoft.ie"
38461
- }
38462
- };
38463
- const _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));
38464
- var UnknownBrowserError = class extends Error {};
38465
- async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
38466
- const { stdout: stdout$1 } = await _execFileAsync("reg", [
38467
- "QUERY",
38468
- " HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
38469
- "/v",
38470
- "ProgId"
38471
- ]);
38472
- const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout$1);
38473
- if (!match) throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout$1)}`);
38474
- const { id } = match.groups;
38475
- const browser = windowsBrowserProgIds[id];
38476
- if (!browser) throw new UnknownBrowserError(`Unknown browser ID: ${id}`);
38477
- return browser;
38478
- }
38479
-
38480
- //#endregion
38481
- //#region node_modules/default-browser/index.js
38482
- const execFileAsync = promisify(execFile);
38483
- const titleize = (string$2) => string$2.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x$2) => x$2.toUpperCase());
38484
- async function defaultBrowser() {
38485
- if (y.platform === "darwin") {
38486
- const id = await defaultBrowserId();
38487
- return {
38488
- name: await bundleName(id),
38489
- id
38490
- };
38491
- }
38492
- if (y.platform === "linux") {
38493
- const { stdout: stdout$1 } = await execFileAsync("xdg-mime", [
38494
- "query",
38495
- "default",
38496
- "x-scheme-handler/http"
38497
- ]);
38498
- const id = stdout$1.trim();
38499
- return {
38500
- name: titleize(id.replace(/.desktop$/, "").replace("-", " ")),
38501
- id
38502
- };
38503
- }
38504
- if (y.platform === "win32") return defaultBrowser$1();
38505
- throw new Error("Only macOS, Linux, and Windows are supported");
38506
- }
38507
-
38508
- //#endregion
38509
- //#region node_modules/is-in-ssh/index.js
38510
- const isInSsh = Boolean(y.env.SSH_CONNECTION || y.env.SSH_CLIENT || y.env.SSH_TTY);
38511
- var is_in_ssh_default = isInSsh;
38512
-
38513
- //#endregion
38514
- //#region node_modules/open/index.js
38515
- const fallbackAttemptSymbol = Symbol("fallbackAttempt");
38516
- const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
38517
- const localXdgOpenPath = path.join(__dirname, "xdg-open");
38518
- const { platform: platform$1, arch } = y;
38519
- const tryEachApp = async (apps$1, opener) => {
38520
- if (apps$1.length === 0) return;
38521
- const errors = [];
38522
- for (const app of apps$1) try {
38523
- return await opener(app);
38524
- } catch (error) {
38525
- errors.push(error);
38526
- }
38527
- throw new AggregateError(errors, "Failed to open in all supported apps");
38528
- };
38529
- const baseOpen = async (options) => {
38530
- options = {
38531
- wait: false,
38532
- background: false,
38533
- newInstance: false,
38534
- allowNonzeroExitCode: false,
38535
- ...options
38536
- };
38537
- const isFallbackAttempt = options[fallbackAttemptSymbol] === true;
38538
- delete options[fallbackAttemptSymbol];
38539
- if (Array.isArray(options.app)) return tryEachApp(options.app, (singleApp) => baseOpen({
38540
- ...options,
38541
- app: singleApp,
38542
- [fallbackAttemptSymbol]: true
38543
- }));
38544
- let { name: app, arguments: appArguments = [] } = options.app ?? {};
38545
- appArguments = [...appArguments];
38546
- if (Array.isArray(app)) return tryEachApp(app, (appName) => baseOpen({
38547
- ...options,
38548
- app: {
38549
- name: appName,
38550
- arguments: appArguments
38551
- },
38552
- [fallbackAttemptSymbol]: true
38553
- }));
38554
- if (app === "browser" || app === "browserPrivate") {
38555
- const ids = {
38556
- "com.google.chrome": "chrome",
38557
- "google-chrome.desktop": "chrome",
38558
- "com.brave.browser": "brave",
38559
- "org.mozilla.firefox": "firefox",
38560
- "firefox.desktop": "firefox",
38561
- "com.microsoft.msedge": "edge",
38562
- "com.microsoft.edge": "edge",
38563
- "com.microsoft.edgemac": "edge",
38564
- "microsoft-edge.desktop": "edge",
38565
- "com.apple.safari": "safari"
38566
- };
38567
- const flags = {
38568
- chrome: "--incognito",
38569
- brave: "--incognito",
38570
- firefox: "--private-window",
38571
- edge: "--inPrivate"
38572
- };
38573
- let browser;
38574
- if (is_wsl_default) {
38575
- const progId = await wslDefaultBrowser();
38576
- browser = _windowsBrowserProgIdMap.get(progId) ?? {};
38577
- } else browser = await defaultBrowser();
38578
- if (browser.id in ids) {
38579
- const browserName = ids[browser.id.toLowerCase()];
38580
- if (app === "browserPrivate") {
38581
- if (browserName === "safari") throw new Error("Safari doesn't support opening in private mode via command line");
38582
- appArguments.push(flags[browserName]);
38583
- }
38584
- return baseOpen({
38585
- ...options,
38586
- app: {
38587
- name: apps[browserName],
38588
- arguments: appArguments
38589
- }
38590
- });
38591
- }
38592
- throw new Error(`${browser.name} is not supported as a default browser`);
38593
- }
38594
- let command;
38595
- const cliArguments = [];
38596
- const childProcessOptions = {};
38597
- let shouldUseWindowsInWsl = false;
38598
- if (is_wsl_default && !isInsideContainer() && !is_in_ssh_default && !app) shouldUseWindowsInWsl = await canAccessPowerShell();
38599
- if (platform$1 === "darwin") {
38600
- command = "open";
38601
- if (options.wait) cliArguments.push("--wait-apps");
38602
- if (options.background) cliArguments.push("--background");
38603
- if (options.newInstance) cliArguments.push("--new");
38604
- if (app) cliArguments.push("-a", app);
38605
- } else if (platform$1 === "win32" || shouldUseWindowsInWsl) {
38606
- command = await powerShellPath();
38607
- cliArguments.push(...executePowerShell.argumentsPrefix);
38608
- if (!is_wsl_default) childProcessOptions.windowsVerbatimArguments = true;
38609
- if (is_wsl_default && options.target) options.target = await convertWslPathToWindows(options.target);
38610
- const encodedArguments = ["$ProgressPreference = 'SilentlyContinue';", "Start"];
38611
- if (options.wait) encodedArguments.push("-Wait");
38612
- if (app) {
38613
- encodedArguments.push(executePowerShell.escapeArgument(app));
38614
- if (options.target) appArguments.push(options.target);
38615
- } else if (options.target) encodedArguments.push(executePowerShell.escapeArgument(options.target));
38616
- if (appArguments.length > 0) {
38617
- appArguments = appArguments.map((argument) => executePowerShell.escapeArgument(argument));
38618
- encodedArguments.push("-ArgumentList", appArguments.join(","));
38619
- }
38620
- options.target = executePowerShell.encodeCommand(encodedArguments.join(" "));
38621
- if (!options.wait) childProcessOptions.stdio = "ignore";
38622
- } else {
38623
- if (app) command = app;
38624
- else {
38625
- const isBundled = !__dirname || __dirname === "/";
38626
- let exeLocalXdgOpen = false;
38627
- try {
38628
- await fs$1.access(localXdgOpenPath, constants$1.X_OK);
38629
- exeLocalXdgOpen = true;
38630
- } catch {}
38631
- command = y.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
38632
- }
38633
- if (appArguments.length > 0) cliArguments.push(...appArguments);
38634
- if (!options.wait) {
38635
- childProcessOptions.stdio = "ignore";
38636
- childProcessOptions.detached = true;
38637
- }
38638
- }
38639
- if (platform$1 === "darwin" && appArguments.length > 0) cliArguments.push("--args", ...appArguments);
38640
- if (options.target) cliArguments.push(options.target);
38641
- const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
38642
- if (options.wait) return new Promise((resolve$1, reject) => {
38643
- subprocess.once("error", reject);
38644
- subprocess.once("close", (exitCode) => {
38645
- if (!options.allowNonzeroExitCode && exitCode !== 0) {
38646
- reject(/* @__PURE__ */ new Error(`Exited with code ${exitCode}`));
38647
- return;
38648
- }
38649
- resolve$1(subprocess);
38650
- });
38651
- });
38652
- if (isFallbackAttempt) return new Promise((resolve$1, reject) => {
38653
- subprocess.once("error", reject);
38654
- subprocess.once("spawn", () => {
38655
- subprocess.once("close", (exitCode) => {
38656
- subprocess.off("error", reject);
38657
- if (exitCode !== 0) {
38658
- reject(/* @__PURE__ */ new Error(`Exited with code ${exitCode}`));
38659
- return;
38660
- }
38661
- subprocess.unref();
38662
- resolve$1(subprocess);
38663
- });
38664
- });
38665
- });
38666
- subprocess.unref();
38667
- return new Promise((resolve$1, reject) => {
38668
- subprocess.once("error", reject);
38669
- subprocess.once("spawn", () => {
38670
- subprocess.off("error", reject);
38671
- resolve$1(subprocess);
38672
- });
38673
- });
38674
- };
38675
- const open = (target, options) => {
38676
- if (typeof target !== "string") throw new TypeError("Expected a `target`");
38677
- return baseOpen({
38678
- ...options,
38679
- target
38680
- });
38681
- };
38682
- function detectArchBinary(binary) {
38683
- if (typeof binary === "string" || Array.isArray(binary)) return binary;
38684
- const { [arch]: archBinary } = binary;
38685
- if (!archBinary) throw new Error(`${arch} is not supported`);
38686
- return archBinary;
38687
- }
38688
- function detectPlatformBinary({ [platform$1]: platformBinary }, { wsl } = {}) {
38689
- if (wsl && is_wsl_default) return detectArchBinary(wsl);
38690
- if (!platformBinary) throw new Error(`${platform$1} is not supported`);
38691
- return detectArchBinary(platformBinary);
38692
- }
38693
- const apps = {
38694
- browser: "browser",
38695
- browserPrivate: "browserPrivate"
38696
- };
38697
- defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
38698
- darwin: "google chrome",
38699
- win32: "chrome",
38700
- linux: [
38701
- "google-chrome",
38702
- "google-chrome-stable",
38703
- "chromium",
38704
- "chromium-browser"
38705
- ]
38706
- }, { wsl: {
38707
- ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
38708
- x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
38709
- } }));
38710
- defineLazyProperty(apps, "brave", () => detectPlatformBinary({
38711
- darwin: "brave browser",
38712
- win32: "brave",
38713
- linux: ["brave-browser", "brave"]
38714
- }, { wsl: {
38715
- ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
38716
- x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
38717
- } }));
38718
- defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
38719
- darwin: "firefox",
38720
- win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
38721
- linux: "firefox"
38722
- }, { wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe" }));
38723
- defineLazyProperty(apps, "edge", () => detectPlatformBinary({
38724
- darwin: "microsoft edge",
38725
- win32: "msedge",
38726
- linux: ["microsoft-edge", "microsoft-edge-dev"]
38727
- }, { wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe" }));
38728
- defineLazyProperty(apps, "safari", () => detectPlatformBinary({ darwin: "Safari" }));
38729
- var open_default = open;
38730
-
38731
38785
  //#endregion
38732
38786
  //#region src/cli/commands/project/dashboard.ts
38733
38787
  async function openDashboard() {