@base44-preview/cli 0.0.17-pr.110.9a4891a → 0.0.17-pr.111.518a0e3

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 (2) hide show
  1. package/dist/index.js +743 -766
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8,16 +8,14 @@ import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlChara
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";
11
12
  import { fileURLToPath } from "node:url";
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";
13
+ import fs$1, { access, constants as constants$1, copyFile, mkdir, readFile, unlink, writeFile } from "node:fs/promises";
16
14
  import { finished } from "node:stream/promises";
17
15
  import path$1, { dirname as dirname$1, parse } from "path";
18
16
  import EE, { EventEmitter as EventEmitter$1 } from "events";
19
17
  import fs$2 from "fs";
20
- import { Buffer as Buffer$2 } from "buffer";
18
+ import { Buffer as Buffer$1 } from "buffer";
21
19
  import { randomBytes, randomUUID } from "node:crypto";
22
20
  import { StringDecoder } from "node:string_decoder";
23
21
  import assert from "assert";
@@ -27,6 +25,7 @@ import assert$1 from "node:assert";
27
25
  import tty from "node:tty";
28
26
  import { scheduler, setImmediate as setImmediate$1, setTimeout as setTimeout$1 } from "node:timers/promises";
29
27
  import { serialize } from "node:v8";
28
+ import { Buffer as Buffer$2 } from "node:buffer";
30
29
 
31
30
  //#region rolldown:runtime
32
31
  var __create = Object.create;
@@ -3957,736 +3956,197 @@ var TimeoutError$1 = class extends Error {
3957
3956
  };
3958
3957
 
3959
3958
  //#endregion
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;
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
+ }
3968
3981
  }
3969
- }
3970
- function hasDockerCGroup() {
3971
- try {
3972
- return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
3973
- } catch {
3974
- return false;
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;
3975
3992
  }
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;
3976
4000
  }
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;
4001
+ var $ZodAsyncError = class extends Error {
4002
+ constructor() {
4003
+ super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
3991
4004
  }
3992
4005
  };
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;
4006
+ var $ZodEncodeError = class extends Error {
4007
+ constructor(name$1) {
4008
+ super(`Encountered unidirectional transform during encode: ${name$1}`);
4009
+ this.name = "ZodEncodeError";
4010
4010
  }
4011
4011
  };
4012
- var is_wsl_default = process$1.env.__IS_WSL_TEST__ ? isWsl : isWsl();
4013
-
4014
- //#endregion
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
- }
4012
+ const globalConfig = {};
4013
+ function config(newConfig) {
4014
+ if (newConfig) Object.assign(globalConfig, newConfig);
4015
+ return globalConfig;
4045
4016
  }
4046
4017
 
4047
4018
  //#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;
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;
4027
+ }
4028
+ function cached(getter) {
4029
+ return { get value() {
4030
+ {
4031
+ const value = getter();
4032
+ Object.defineProperty(this, "value", { value });
4033
+ return value;
4082
4034
  }
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;
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]);
4098
4053
  }
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, {
4105
- value,
4106
- enumerable: true,
4107
- writable: true
4108
- });
4109
- Object.defineProperty(object$1, propertyName, {
4110
- configurable: true,
4111
- enumerable: true,
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, {
4112
4061
  get() {
4113
- const result = valueGetter();
4114
- define$1(result);
4115
- return result;
4062
+ if (value === EVALUATING) return;
4063
+ if (value === void 0) {
4064
+ value = EVALUATING;
4065
+ value = getter();
4066
+ }
4067
+ return value;
4116
4068
  },
4117
- set(value) {
4118
- define$1(value);
4119
- }
4069
+ set(v$1) {
4070
+ Object.defineProperty(object$1, key, { value: v$1 });
4071
+ },
4072
+ configurable: true
4120
4073
  });
4121
- return object$1;
4122
4074
  }
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;
4075
+ function assignProp(target, prop, value) {
4076
+ Object.defineProperty(target, prop, {
4077
+ value,
4078
+ writable: true,
4079
+ enumerable: true,
4080
+ configurable: true
4081
+ });
4137
4082
  }
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();
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);
4153
4090
  }
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")`);
4091
+ function esc(str) {
4092
+ return JSON.stringify(str);
4159
4093
  }
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"
4228
- }
4229
- };
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;
4094
+ function slugify(input) {
4095
+ return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
4245
4096
  }
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
- };
4258
- }
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
4269
- };
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;
4270
4108
  }
4271
- if (process$1.platform === "win32") return defaultBrowser$1();
4272
- throw new Error("Only macOS, Linux, and Windows are supported");
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;
4273
4119
  }
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);
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;
4124
+ }
4125
+ const propertyKeyTypes = new Set([
4126
+ "string",
4127
+ "number",
4128
+ "symbol"
4129
+ ]);
4130
+ function escapeRegex(str) {
4131
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
4132
+ }
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;
4137
+ }
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;
4293
4145
  }
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
4146
+ delete params.message;
4147
+ if (typeof params.error === "string") return {
4148
+ ...params,
4149
+ error: () => params.error
4690
4150
  };
4691
4151
  return params;
4692
4152
  }
@@ -9277,7 +8737,7 @@ var distribution_default = ky;
9277
8737
 
9278
8738
  //#endregion
9279
8739
  //#region src/core/config.ts
9280
- const __dirname = dirname(fileURLToPath(import.meta.url));
8740
+ const __dirname$1 = dirname(fileURLToPath(import.meta.url));
9281
8741
  function getBase44GlobalDir() {
9282
8742
  return join(homedir(), ".base44");
9283
8743
  }
@@ -9285,7 +8745,7 @@ function getAuthFilePath() {
9285
8745
  return join(getBase44GlobalDir(), "auth", "auth.json");
9286
8746
  }
9287
8747
  function getTemplatesDir() {
9288
- return join(__dirname, "templates");
8748
+ return join(__dirname$1, "templates");
9289
8749
  }
9290
8750
  function getTemplatesIndexPath() {
9291
8751
  return join(getTemplatesDir(), "templates.json");
@@ -27303,11 +26763,11 @@ const constants$2 = Object.freeze(Object.assign(Object.create(null), {
27303
26763
 
27304
26764
  //#endregion
27305
26765
  //#region node_modules/minizlib/dist/esm/index.js
27306
- const OriginalBufferConcat = Buffer$2.concat;
27307
- const desc = Object.getOwnPropertyDescriptor(Buffer$2, "concat");
26766
+ const OriginalBufferConcat = Buffer$1.concat;
26767
+ const desc = Object.getOwnPropertyDescriptor(Buffer$1, "concat");
27308
26768
  const noop$2 = (args) => args;
27309
26769
  const passthroughBufferConcat = desc?.writable === true || desc?.set !== void 0 ? (makeNoOp) => {
27310
- Buffer$2.concat = makeNoOp ? noop$2 : OriginalBufferConcat;
26770
+ Buffer$1.concat = makeNoOp ? noop$2 : OriginalBufferConcat;
27311
26771
  } : (_$2) => {};
27312
26772
  const _superWrite = Symbol("_superWrite");
27313
26773
  var ZlibError = class extends Error {
@@ -27385,7 +26845,7 @@ var ZlibBase = class extends Minipass {
27385
26845
  flush(flushFlag) {
27386
26846
  if (this.ended) return;
27387
26847
  if (typeof flushFlag !== "number") flushFlag = this.#fullFlushFlag;
27388
- this.write(Object.assign(Buffer$2.alloc(0), { [_flushFlag]: flushFlag }));
26848
+ this.write(Object.assign(Buffer$1.alloc(0), { [_flushFlag]: flushFlag }));
27389
26849
  }
27390
26850
  end(chunk, encoding, cb) {
27391
26851
  /* c8 ignore start */
@@ -27413,7 +26873,7 @@ var ZlibBase = class extends Minipass {
27413
26873
  }
27414
26874
  write(chunk, encoding, cb) {
27415
26875
  if (typeof encoding === "function") cb = encoding, encoding = "utf8";
27416
- if (typeof chunk === "string") chunk = Buffer$2.from(chunk, encoding);
26876
+ if (typeof chunk === "string") chunk = Buffer$1.from(chunk, encoding);
27417
26877
  if (this.#sawError) return;
27418
26878
  assert(this.#handle, "zlib binding closed");
27419
26879
  const nativeHandle = this.#handle._handle;
@@ -27442,9 +26902,9 @@ var ZlibBase = class extends Minipass {
27442
26902
  let writeReturn;
27443
26903
  if (result) if (Array.isArray(result) && result.length > 0) {
27444
26904
  const r$1 = result[0];
27445
- writeReturn = this[_superWrite](Buffer$2.from(r$1));
26905
+ writeReturn = this[_superWrite](Buffer$1.from(r$1));
27446
26906
  for (let i$1 = 1; i$1 < result.length; i$1++) writeReturn = this[_superWrite](result[i$1]);
27447
- } else writeReturn = this[_superWrite](Buffer$2.from(result));
26907
+ } else writeReturn = this[_superWrite](Buffer$1.from(result));
27448
26908
  if (cb) cb();
27449
26909
  return writeReturn;
27450
26910
  }
@@ -27922,8 +27382,8 @@ const parseKVLine = (set, line) => {
27922
27382
 
27923
27383
  //#endregion
27924
27384
  //#region node_modules/tar/dist/esm/normalize-windows-path.js
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, "/");
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, "/");
27927
27387
 
27928
27388
  //#endregion
27929
27389
  //#region node_modules/tar/dist/esm/read-entry.js
@@ -31798,18 +31258,7 @@ async function generateAndDisplayDeviceCode() {
31798
31258
  successMessage: "Device code generated",
31799
31259
  errorMessage: "Failed to generate device code"
31800
31260
  });
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);
31261
+ M.info(`Verification code: ${theme.styles.bold(deviceCodeResponse.userCode)}\nPlease confirm this code at: ${deviceCodeResponse.verificationUri}`);
31813
31262
  return deviceCodeResponse;
31814
31263
  }
31815
31264
  async function waitForAuthentication(deviceCode, expiresIn, interval) {
@@ -33504,7 +32953,7 @@ const getSignals = () => {
33504
32953
  return [...SIGNALS, ...realtimeSignals].map(normalizeSignal$1);
33505
32954
  };
33506
32955
  const normalizeSignal$1 = ({ name: name$1, number: defaultNumber, description, action, forced = false, standard }) => {
33507
- const { signals: { [name$1]: constantSignal } } = constants$1;
32956
+ const { signals: { [name$1]: constantSignal } } = constants;
33508
32957
  const supported = constantSignal !== void 0;
33509
32958
  return {
33510
32959
  name: name$1,
@@ -33554,7 +33003,7 @@ const getSignalByNumber = (number$2, signals$1) => {
33554
33003
  } };
33555
33004
  };
33556
33005
  const findSignalByNumber = (number$2, signals$1) => {
33557
- const signal = signals$1.find(({ name: name$1 }) => constants$1.signals[name$1] === number$2);
33006
+ const signal = signals$1.find(({ name: name$1 }) => constants.signals[name$1] === number$2);
33558
33007
  if (signal !== void 0) return signal;
33559
33008
  return signals$1.find((signalA) => signalA.number === number$2);
33560
33009
  };
@@ -33577,17 +33026,17 @@ const normalizeSignalInteger = (signalInteger, optionName) => {
33577
33026
  if (signalsIntegerToName.has(signalInteger)) return signalsIntegerToName.get(signalInteger);
33578
33027
  throw new TypeError(`Invalid ${optionName} ${signalInteger}: this signal integer does not exist.\n${getAvailableSignals()}`);
33579
33028
  };
33580
- const getSignalsIntegerToName = () => new Map(Object.entries(constants$1.signals).reverse().map(([signalName, signalInteger]) => [signalInteger, signalName]));
33029
+ const getSignalsIntegerToName = () => new Map(Object.entries(constants.signals).reverse().map(([signalName, signalInteger]) => [signalInteger, signalName]));
33581
33030
  const signalsIntegerToName = getSignalsIntegerToName();
33582
33031
  const normalizeSignalName = (signalName, optionName) => {
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()}'.`);
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()}'.`);
33585
33034
  throw new TypeError(`Invalid ${optionName} '${signalName}': this signal name does not exist.\n${getAvailableSignals()}`);
33586
33035
  };
33587
33036
  const getAvailableSignals = () => `Available signal names: ${getAvailableSignalNames()}.
33588
33037
  Available signal numbers: ${getAvailableSignalIntegers()}.`;
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(", ");
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(", ");
33591
33040
  const getSignalDescription = (signal) => signalsByName[signal].description;
33592
33041
 
33593
33042
  //#endregion
@@ -35827,7 +35276,7 @@ const linesUint8ArrayInfo = {
35827
35276
  //#region node_modules/execa/lib/transform/validate.js
35828
35277
  const getValidateTransformInput = (writableObjectMode, optionName) => writableObjectMode ? void 0 : validateStringTransformInput.bind(void 0, optionName);
35829
35278
  const validateStringTransformInput = function* (optionName, 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}.`);
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}.`);
35831
35280
  yield chunk;
35832
35281
  };
35833
35282
  const getValidateTransformReturn = (readableObjectMode, optionName) => readableObjectMode ? validateObjectTransformReturn.bind(void 0, optionName) : validateStringTransformReturn.bind(void 0, optionName);
@@ -35858,7 +35307,7 @@ const getEncodingTransformGenerator = (binary, encoding, skipped) => {
35858
35307
  };
35859
35308
  };
35860
35309
  const encodingUint8ArrayGenerator = function* (textEncoder$2, chunk) {
35861
- if (Buffer$1.isBuffer(chunk)) yield bufferToUint8Array(chunk);
35310
+ if (Buffer$2.isBuffer(chunk)) yield bufferToUint8Array(chunk);
35862
35311
  else if (typeof chunk === "string") yield textEncoder$2.encode(chunk);
35863
35312
  else yield chunk;
35864
35313
  };
@@ -36555,7 +36004,7 @@ const addPropertiesAsync = {
36555
36004
  iterable: ({ value }) => ({ stream: Readable.from(value) }),
36556
36005
  asyncIterable: ({ value }) => ({ stream: Readable.from(value) }),
36557
36006
  string: ({ value }) => ({ stream: Readable.from(value) }),
36558
- uint8Array: ({ value }) => ({ stream: Readable.from(Buffer$1.from(value)) })
36007
+ uint8Array: ({ value }) => ({ stream: Readable.from(Buffer$2.from(value)) })
36559
36008
  },
36560
36009
  output: {
36561
36010
  ...addProperties,
@@ -38596,13 +38045,7 @@ var require_lodash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
38596
38045
  //#region src/cli/commands/project/create.ts
38597
38046
  var import_lodash = /* @__PURE__ */ __toESM(require_lodash(), 1);
38598
38047
  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
+ const SUPPORTED_AGENTS = ["cursor", "claude-code"];
38606
38049
  async function getTemplateById(templateId) {
38607
38050
  const templates = await listTemplates();
38608
38051
  const template = templates.find((t) => t.id === templateId);
@@ -38740,20 +38183,15 @@ async function executeCreate({ template, name: rawName, description, projectPath
38740
38183
  finalAppUrl = appUrl;
38741
38184
  }
38742
38185
  }
38743
- let selectedAgents = [];
38186
+ let shouldAddSkills = false;
38744
38187
  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 () => {
38188
+ const result = await ye({ message: "Add AI agent skills?" });
38189
+ shouldAddSkills = !pD(result) && result;
38190
+ } else shouldAddSkills = !!skills;
38191
+ if (shouldAddSkills) {
38192
+ const agentArgs = SUPPORTED_AGENTS.flatMap((agent) => ["-a", agent]);
38193
+ M.step(`Installing skills for: ${SUPPORTED_AGENTS.join(", ")}`);
38194
+ await runTask(`Installing skills for: ${SUPPORTED_AGENTS.join(", ")}`, async () => {
38757
38195
  await execa("npx", [
38758
38196
  "-y",
38759
38197
  "add-skill",
@@ -38778,10 +38216,549 @@ async function executeCreate({ template, name: rawName, description, projectPath
38778
38216
  if (finalAppUrl) M.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
38779
38217
  return { outroMessage: "Your project is set up and ready to use" };
38780
38218
  }
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) => {
38219
+ 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").hook("preAction", validateNonInteractiveFlags$1).action(async (options) => {
38782
38220
  await chooseCreate(options);
38783
38221
  });
38784
38222
 
38223
+ //#endregion
38224
+ //#region node_modules/is-docker/index.js
38225
+ let isDockerCached;
38226
+ function hasDockerEnv() {
38227
+ try {
38228
+ fs.statSync("/.dockerenv");
38229
+ return true;
38230
+ } catch {
38231
+ return false;
38232
+ }
38233
+ }
38234
+ function hasDockerCGroup() {
38235
+ try {
38236
+ return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
38237
+ } catch {
38238
+ return false;
38239
+ }
38240
+ }
38241
+ function isDocker() {
38242
+ if (isDockerCached === void 0) isDockerCached = hasDockerEnv() || hasDockerCGroup();
38243
+ return isDockerCached;
38244
+ }
38245
+
38246
+ //#endregion
38247
+ //#region node_modules/is-inside-container/index.js
38248
+ let cachedResult;
38249
+ const hasContainerEnv = () => {
38250
+ try {
38251
+ fs.statSync("/run/.containerenv");
38252
+ return true;
38253
+ } catch {
38254
+ return false;
38255
+ }
38256
+ };
38257
+ function isInsideContainer() {
38258
+ if (cachedResult === void 0) cachedResult = hasContainerEnv() || isDocker();
38259
+ return cachedResult;
38260
+ }
38261
+
38262
+ //#endregion
38263
+ //#region node_modules/is-wsl/index.js
38264
+ const isWsl = () => {
38265
+ if (process$1.platform !== "linux") return false;
38266
+ if (os.release().toLowerCase().includes("microsoft")) {
38267
+ if (isInsideContainer()) return false;
38268
+ return true;
38269
+ }
38270
+ try {
38271
+ return fs.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
38272
+ } catch {
38273
+ return false;
38274
+ }
38275
+ };
38276
+ var is_wsl_default = process$1.env.__IS_WSL_TEST__ ? isWsl : isWsl();
38277
+
38278
+ //#endregion
38279
+ //#region node_modules/powershell-utils/index.js
38280
+ const execFile$2 = promisify(childProcess.execFile);
38281
+ const powerShellPath$1 = () => `${process$1.env.SYSTEMROOT || process$1.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
38282
+ const executePowerShell = async (command, options = {}) => {
38283
+ const { powerShellPath: psPath, ...execFileOptions } = options;
38284
+ const encodedCommand = executePowerShell.encodeCommand(command);
38285
+ return execFile$2(psPath ?? powerShellPath$1(), [...executePowerShell.argumentsPrefix, encodedCommand], {
38286
+ encoding: "utf8",
38287
+ ...execFileOptions
38288
+ });
38289
+ };
38290
+ executePowerShell.argumentsPrefix = [
38291
+ "-NoProfile",
38292
+ "-NonInteractive",
38293
+ "-ExecutionPolicy",
38294
+ "Bypass",
38295
+ "-EncodedCommand"
38296
+ ];
38297
+ executePowerShell.encodeCommand = (command) => Buffer$2.from(command, "utf16le").toString("base64");
38298
+ executePowerShell.escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
38299
+
38300
+ //#endregion
38301
+ //#region node_modules/wsl-utils/utilities.js
38302
+ function parseMountPointFromConfig(content) {
38303
+ for (const line of content.split("\n")) {
38304
+ if (/^\s*#/.test(line)) continue;
38305
+ const match = /^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(line);
38306
+ if (!match) continue;
38307
+ return match.groups.mountPoint.trim().replaceAll(/^["']|["']$/g, "");
38308
+ }
38309
+ }
38310
+
38311
+ //#endregion
38312
+ //#region node_modules/wsl-utils/index.js
38313
+ const execFile$1 = promisify(childProcess.execFile);
38314
+ const wslDrivesMountPoint = (() => {
38315
+ const defaultMountPoint = "/mnt/";
38316
+ let mountPoint;
38317
+ return async function() {
38318
+ if (mountPoint) return mountPoint;
38319
+ const configFilePath = "/etc/wsl.conf";
38320
+ let isConfigFileExists = false;
38321
+ try {
38322
+ await fs$1.access(configFilePath, constants$1.F_OK);
38323
+ isConfigFileExists = true;
38324
+ } catch {}
38325
+ if (!isConfigFileExists) return defaultMountPoint;
38326
+ const parsedMountPoint = parseMountPointFromConfig(await fs$1.readFile(configFilePath, { encoding: "utf8" }));
38327
+ if (parsedMountPoint === void 0) return defaultMountPoint;
38328
+ mountPoint = parsedMountPoint;
38329
+ mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
38330
+ return mountPoint;
38331
+ };
38332
+ })();
38333
+ const powerShellPathFromWsl = async () => {
38334
+ return `${await wslDrivesMountPoint()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
38335
+ };
38336
+ const powerShellPath = is_wsl_default ? powerShellPathFromWsl : powerShellPath$1;
38337
+ let canAccessPowerShellPromise;
38338
+ const canAccessPowerShell = async () => {
38339
+ canAccessPowerShellPromise ??= (async () => {
38340
+ try {
38341
+ const psPath = await powerShellPath();
38342
+ await fs$1.access(psPath, constants$1.X_OK);
38343
+ return true;
38344
+ } catch {
38345
+ return false;
38346
+ }
38347
+ })();
38348
+ return canAccessPowerShellPromise;
38349
+ };
38350
+ const wslDefaultBrowser = async () => {
38351
+ const psPath = await powerShellPath();
38352
+ const { stdout: stdout$1 } = await executePowerShell(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, { powerShellPath: psPath });
38353
+ return stdout$1.trim();
38354
+ };
38355
+ const convertWslPathToWindows = async (path$16) => {
38356
+ if (/^[a-z]+:\/\//i.test(path$16)) return path$16;
38357
+ try {
38358
+ const { stdout: stdout$1 } = await execFile$1("wslpath", ["-aw", path$16], { encoding: "utf8" });
38359
+ return stdout$1.trim();
38360
+ } catch {
38361
+ return path$16;
38362
+ }
38363
+ };
38364
+
38365
+ //#endregion
38366
+ //#region node_modules/define-lazy-prop/index.js
38367
+ function defineLazyProperty(object$1, propertyName, valueGetter) {
38368
+ const define$1 = (value) => Object.defineProperty(object$1, propertyName, {
38369
+ value,
38370
+ enumerable: true,
38371
+ writable: true
38372
+ });
38373
+ Object.defineProperty(object$1, propertyName, {
38374
+ configurable: true,
38375
+ enumerable: true,
38376
+ get() {
38377
+ const result = valueGetter();
38378
+ define$1(result);
38379
+ return result;
38380
+ },
38381
+ set(value) {
38382
+ define$1(value);
38383
+ }
38384
+ });
38385
+ return object$1;
38386
+ }
38387
+
38388
+ //#endregion
38389
+ //#region node_modules/default-browser-id/index.js
38390
+ const execFileAsync$3 = promisify(execFile);
38391
+ async function defaultBrowserId() {
38392
+ if (process$1.platform !== "darwin") throw new Error("macOS only");
38393
+ const { stdout: stdout$1 } = await execFileAsync$3("defaults", [
38394
+ "read",
38395
+ "com.apple.LaunchServices/com.apple.launchservices.secure",
38396
+ "LSHandlers"
38397
+ ]);
38398
+ const browserId = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout$1)?.groups.id ?? "com.apple.Safari";
38399
+ if (browserId === "com.apple.safari") return "com.apple.Safari";
38400
+ return browserId;
38401
+ }
38402
+
38403
+ //#endregion
38404
+ //#region node_modules/run-applescript/index.js
38405
+ const execFileAsync$2 = promisify(execFile);
38406
+ async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
38407
+ if (process$1.platform !== "darwin") throw new Error("macOS only");
38408
+ const outputArguments = humanReadableOutput ? [] : ["-ss"];
38409
+ const execOptions = {};
38410
+ if (signal) execOptions.signal = signal;
38411
+ const { stdout: stdout$1 } = await execFileAsync$2("osascript", [
38412
+ "-e",
38413
+ script,
38414
+ outputArguments
38415
+ ], execOptions);
38416
+ return stdout$1.trim();
38417
+ }
38418
+
38419
+ //#endregion
38420
+ //#region node_modules/bundle-name/index.js
38421
+ async function bundleName(bundleId) {
38422
+ 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")`);
38423
+ }
38424
+
38425
+ //#endregion
38426
+ //#region node_modules/default-browser/windows.js
38427
+ const execFileAsync$1 = promisify(execFile);
38428
+ const windowsBrowserProgIds = {
38429
+ MSEdgeHTM: {
38430
+ name: "Edge",
38431
+ id: "com.microsoft.edge"
38432
+ },
38433
+ MSEdgeBHTML: {
38434
+ name: "Edge Beta",
38435
+ id: "com.microsoft.edge.beta"
38436
+ },
38437
+ MSEdgeDHTML: {
38438
+ name: "Edge Dev",
38439
+ id: "com.microsoft.edge.dev"
38440
+ },
38441
+ AppXq0fevzme2pys62n3e0fbqa7peapykr8v: {
38442
+ name: "Edge",
38443
+ id: "com.microsoft.edge.old"
38444
+ },
38445
+ ChromeHTML: {
38446
+ name: "Chrome",
38447
+ id: "com.google.chrome"
38448
+ },
38449
+ ChromeBHTML: {
38450
+ name: "Chrome Beta",
38451
+ id: "com.google.chrome.beta"
38452
+ },
38453
+ ChromeDHTML: {
38454
+ name: "Chrome Dev",
38455
+ id: "com.google.chrome.dev"
38456
+ },
38457
+ ChromiumHTM: {
38458
+ name: "Chromium",
38459
+ id: "org.chromium.Chromium"
38460
+ },
38461
+ BraveHTML: {
38462
+ name: "Brave",
38463
+ id: "com.brave.Browser"
38464
+ },
38465
+ BraveBHTML: {
38466
+ name: "Brave Beta",
38467
+ id: "com.brave.Browser.beta"
38468
+ },
38469
+ BraveDHTML: {
38470
+ name: "Brave Dev",
38471
+ id: "com.brave.Browser.dev"
38472
+ },
38473
+ BraveSSHTM: {
38474
+ name: "Brave Nightly",
38475
+ id: "com.brave.Browser.nightly"
38476
+ },
38477
+ FirefoxURL: {
38478
+ name: "Firefox",
38479
+ id: "org.mozilla.firefox"
38480
+ },
38481
+ OperaStable: {
38482
+ name: "Opera",
38483
+ id: "com.operasoftware.Opera"
38484
+ },
38485
+ VivaldiHTM: {
38486
+ name: "Vivaldi",
38487
+ id: "com.vivaldi.Vivaldi"
38488
+ },
38489
+ "IE.HTTP": {
38490
+ name: "Internet Explorer",
38491
+ id: "com.microsoft.ie"
38492
+ }
38493
+ };
38494
+ const _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));
38495
+ var UnknownBrowserError = class extends Error {};
38496
+ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
38497
+ const { stdout: stdout$1 } = await _execFileAsync("reg", [
38498
+ "QUERY",
38499
+ " HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
38500
+ "/v",
38501
+ "ProgId"
38502
+ ]);
38503
+ const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout$1);
38504
+ if (!match) throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout$1)}`);
38505
+ const { id } = match.groups;
38506
+ const browser = windowsBrowserProgIds[id];
38507
+ if (!browser) throw new UnknownBrowserError(`Unknown browser ID: ${id}`);
38508
+ return browser;
38509
+ }
38510
+
38511
+ //#endregion
38512
+ //#region node_modules/default-browser/index.js
38513
+ const execFileAsync = promisify(execFile);
38514
+ const titleize = (string$2) => string$2.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x$2) => x$2.toUpperCase());
38515
+ async function defaultBrowser() {
38516
+ if (process$1.platform === "darwin") {
38517
+ const id = await defaultBrowserId();
38518
+ return {
38519
+ name: await bundleName(id),
38520
+ id
38521
+ };
38522
+ }
38523
+ if (process$1.platform === "linux") {
38524
+ const { stdout: stdout$1 } = await execFileAsync("xdg-mime", [
38525
+ "query",
38526
+ "default",
38527
+ "x-scheme-handler/http"
38528
+ ]);
38529
+ const id = stdout$1.trim();
38530
+ return {
38531
+ name: titleize(id.replace(/.desktop$/, "").replace("-", " ")),
38532
+ id
38533
+ };
38534
+ }
38535
+ if (process$1.platform === "win32") return defaultBrowser$1();
38536
+ throw new Error("Only macOS, Linux, and Windows are supported");
38537
+ }
38538
+
38539
+ //#endregion
38540
+ //#region node_modules/is-in-ssh/index.js
38541
+ const isInSsh = Boolean(process$1.env.SSH_CONNECTION || process$1.env.SSH_CLIENT || process$1.env.SSH_TTY);
38542
+ var is_in_ssh_default = isInSsh;
38543
+
38544
+ //#endregion
38545
+ //#region node_modules/open/index.js
38546
+ const fallbackAttemptSymbol = Symbol("fallbackAttempt");
38547
+ const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
38548
+ const localXdgOpenPath = path.join(__dirname, "xdg-open");
38549
+ const { platform: platform$1, arch } = process$1;
38550
+ const tryEachApp = async (apps$1, opener) => {
38551
+ if (apps$1.length === 0) return;
38552
+ const errors = [];
38553
+ for (const app of apps$1) try {
38554
+ return await opener(app);
38555
+ } catch (error) {
38556
+ errors.push(error);
38557
+ }
38558
+ throw new AggregateError(errors, "Failed to open in all supported apps");
38559
+ };
38560
+ const baseOpen = async (options) => {
38561
+ options = {
38562
+ wait: false,
38563
+ background: false,
38564
+ newInstance: false,
38565
+ allowNonzeroExitCode: false,
38566
+ ...options
38567
+ };
38568
+ const isFallbackAttempt = options[fallbackAttemptSymbol] === true;
38569
+ delete options[fallbackAttemptSymbol];
38570
+ if (Array.isArray(options.app)) return tryEachApp(options.app, (singleApp) => baseOpen({
38571
+ ...options,
38572
+ app: singleApp,
38573
+ [fallbackAttemptSymbol]: true
38574
+ }));
38575
+ let { name: app, arguments: appArguments = [] } = options.app ?? {};
38576
+ appArguments = [...appArguments];
38577
+ if (Array.isArray(app)) return tryEachApp(app, (appName) => baseOpen({
38578
+ ...options,
38579
+ app: {
38580
+ name: appName,
38581
+ arguments: appArguments
38582
+ },
38583
+ [fallbackAttemptSymbol]: true
38584
+ }));
38585
+ if (app === "browser" || app === "browserPrivate") {
38586
+ const ids = {
38587
+ "com.google.chrome": "chrome",
38588
+ "google-chrome.desktop": "chrome",
38589
+ "com.brave.browser": "brave",
38590
+ "org.mozilla.firefox": "firefox",
38591
+ "firefox.desktop": "firefox",
38592
+ "com.microsoft.msedge": "edge",
38593
+ "com.microsoft.edge": "edge",
38594
+ "com.microsoft.edgemac": "edge",
38595
+ "microsoft-edge.desktop": "edge",
38596
+ "com.apple.safari": "safari"
38597
+ };
38598
+ const flags = {
38599
+ chrome: "--incognito",
38600
+ brave: "--incognito",
38601
+ firefox: "--private-window",
38602
+ edge: "--inPrivate"
38603
+ };
38604
+ let browser;
38605
+ if (is_wsl_default) {
38606
+ const progId = await wslDefaultBrowser();
38607
+ browser = _windowsBrowserProgIdMap.get(progId) ?? {};
38608
+ } else browser = await defaultBrowser();
38609
+ if (browser.id in ids) {
38610
+ const browserName = ids[browser.id.toLowerCase()];
38611
+ if (app === "browserPrivate") {
38612
+ if (browserName === "safari") throw new Error("Safari doesn't support opening in private mode via command line");
38613
+ appArguments.push(flags[browserName]);
38614
+ }
38615
+ return baseOpen({
38616
+ ...options,
38617
+ app: {
38618
+ name: apps[browserName],
38619
+ arguments: appArguments
38620
+ }
38621
+ });
38622
+ }
38623
+ throw new Error(`${browser.name} is not supported as a default browser`);
38624
+ }
38625
+ let command;
38626
+ const cliArguments = [];
38627
+ const childProcessOptions = {};
38628
+ let shouldUseWindowsInWsl = false;
38629
+ if (is_wsl_default && !isInsideContainer() && !is_in_ssh_default && !app) shouldUseWindowsInWsl = await canAccessPowerShell();
38630
+ if (platform$1 === "darwin") {
38631
+ command = "open";
38632
+ if (options.wait) cliArguments.push("--wait-apps");
38633
+ if (options.background) cliArguments.push("--background");
38634
+ if (options.newInstance) cliArguments.push("--new");
38635
+ if (app) cliArguments.push("-a", app);
38636
+ } else if (platform$1 === "win32" || shouldUseWindowsInWsl) {
38637
+ command = await powerShellPath();
38638
+ cliArguments.push(...executePowerShell.argumentsPrefix);
38639
+ if (!is_wsl_default) childProcessOptions.windowsVerbatimArguments = true;
38640
+ if (is_wsl_default && options.target) options.target = await convertWslPathToWindows(options.target);
38641
+ const encodedArguments = ["$ProgressPreference = 'SilentlyContinue';", "Start"];
38642
+ if (options.wait) encodedArguments.push("-Wait");
38643
+ if (app) {
38644
+ encodedArguments.push(executePowerShell.escapeArgument(app));
38645
+ if (options.target) appArguments.push(options.target);
38646
+ } else if (options.target) encodedArguments.push(executePowerShell.escapeArgument(options.target));
38647
+ if (appArguments.length > 0) {
38648
+ appArguments = appArguments.map((argument) => executePowerShell.escapeArgument(argument));
38649
+ encodedArguments.push("-ArgumentList", appArguments.join(","));
38650
+ }
38651
+ options.target = executePowerShell.encodeCommand(encodedArguments.join(" "));
38652
+ if (!options.wait) childProcessOptions.stdio = "ignore";
38653
+ } else {
38654
+ if (app) command = app;
38655
+ else {
38656
+ const isBundled = !__dirname || __dirname === "/";
38657
+ let exeLocalXdgOpen = false;
38658
+ try {
38659
+ await fs$1.access(localXdgOpenPath, constants$1.X_OK);
38660
+ exeLocalXdgOpen = true;
38661
+ } catch {}
38662
+ command = process$1.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
38663
+ }
38664
+ if (appArguments.length > 0) cliArguments.push(...appArguments);
38665
+ if (!options.wait) {
38666
+ childProcessOptions.stdio = "ignore";
38667
+ childProcessOptions.detached = true;
38668
+ }
38669
+ }
38670
+ if (platform$1 === "darwin" && appArguments.length > 0) cliArguments.push("--args", ...appArguments);
38671
+ if (options.target) cliArguments.push(options.target);
38672
+ const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
38673
+ if (options.wait) return new Promise((resolve$1, reject) => {
38674
+ subprocess.once("error", reject);
38675
+ subprocess.once("close", (exitCode) => {
38676
+ if (!options.allowNonzeroExitCode && exitCode !== 0) {
38677
+ reject(/* @__PURE__ */ new Error(`Exited with code ${exitCode}`));
38678
+ return;
38679
+ }
38680
+ resolve$1(subprocess);
38681
+ });
38682
+ });
38683
+ if (isFallbackAttempt) return new Promise((resolve$1, reject) => {
38684
+ subprocess.once("error", reject);
38685
+ subprocess.once("spawn", () => {
38686
+ subprocess.once("close", (exitCode) => {
38687
+ subprocess.off("error", reject);
38688
+ if (exitCode !== 0) {
38689
+ reject(/* @__PURE__ */ new Error(`Exited with code ${exitCode}`));
38690
+ return;
38691
+ }
38692
+ subprocess.unref();
38693
+ resolve$1(subprocess);
38694
+ });
38695
+ });
38696
+ });
38697
+ subprocess.unref();
38698
+ return new Promise((resolve$1, reject) => {
38699
+ subprocess.once("error", reject);
38700
+ subprocess.once("spawn", () => {
38701
+ subprocess.off("error", reject);
38702
+ resolve$1(subprocess);
38703
+ });
38704
+ });
38705
+ };
38706
+ const open = (target, options) => {
38707
+ if (typeof target !== "string") throw new TypeError("Expected a `target`");
38708
+ return baseOpen({
38709
+ ...options,
38710
+ target
38711
+ });
38712
+ };
38713
+ function detectArchBinary(binary) {
38714
+ if (typeof binary === "string" || Array.isArray(binary)) return binary;
38715
+ const { [arch]: archBinary } = binary;
38716
+ if (!archBinary) throw new Error(`${arch} is not supported`);
38717
+ return archBinary;
38718
+ }
38719
+ function detectPlatformBinary({ [platform$1]: platformBinary }, { wsl } = {}) {
38720
+ if (wsl && is_wsl_default) return detectArchBinary(wsl);
38721
+ if (!platformBinary) throw new Error(`${platform$1} is not supported`);
38722
+ return detectArchBinary(platformBinary);
38723
+ }
38724
+ const apps = {
38725
+ browser: "browser",
38726
+ browserPrivate: "browserPrivate"
38727
+ };
38728
+ defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
38729
+ darwin: "google chrome",
38730
+ win32: "chrome",
38731
+ linux: [
38732
+ "google-chrome",
38733
+ "google-chrome-stable",
38734
+ "chromium",
38735
+ "chromium-browser"
38736
+ ]
38737
+ }, { wsl: {
38738
+ ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
38739
+ x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
38740
+ } }));
38741
+ defineLazyProperty(apps, "brave", () => detectPlatformBinary({
38742
+ darwin: "brave browser",
38743
+ win32: "brave",
38744
+ linux: ["brave-browser", "brave"]
38745
+ }, { wsl: {
38746
+ ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
38747
+ x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
38748
+ } }));
38749
+ defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
38750
+ darwin: "firefox",
38751
+ win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
38752
+ linux: "firefox"
38753
+ }, { wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe" }));
38754
+ defineLazyProperty(apps, "edge", () => detectPlatformBinary({
38755
+ darwin: "microsoft edge",
38756
+ win32: "msedge",
38757
+ linux: ["microsoft-edge", "microsoft-edge-dev"]
38758
+ }, { wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe" }));
38759
+ defineLazyProperty(apps, "safari", () => detectPlatformBinary({ darwin: "Safari" }));
38760
+ var open_default = open;
38761
+
38785
38762
  //#endregion
38786
38763
  //#region src/cli/commands/project/dashboard.ts
38787
38764
  async function openDashboard() {