@base44-preview/cli 0.0.17-pr.109.dd04c99 → 0.0.17-pr.110.70e2c01

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 +795 -773
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8,14 +8,15 @@ 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";
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";
14
15
  import { finished } from "node:stream/promises";
15
16
  import path$1, { dirname as dirname$1, parse } from "path";
16
17
  import EE, { EventEmitter as EventEmitter$1 } from "events";
17
18
  import fs$2 from "fs";
18
- import { Buffer as Buffer$1 } from "buffer";
19
+ import { Buffer as Buffer$2 } from "buffer";
19
20
  import { randomBytes, randomUUID } from "node:crypto";
20
21
  import { StringDecoder } from "node:string_decoder";
21
22
  import assert from "assert";
@@ -25,7 +26,6 @@ import assert$1 from "node:assert";
25
26
  import tty from "node:tty";
26
27
  import { scheduler, setImmediate as setImmediate$1, setTimeout as setTimeout$1 } from "node:timers/promises";
27
28
  import { serialize } from "node:v8";
28
- import { Buffer as Buffer$2 } from "node:buffer";
29
29
 
30
30
  //#region rolldown:runtime
31
31
  var __create = Object.create;
@@ -3956,236 +3956,775 @@ var TimeoutError$1 = class extends Error {
3956
3956
  };
3957
3957
 
3958
3958
  //#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
- }
3959
+ //#region node_modules/is-docker/index.js
3960
+ let isDockerCached;
3961
+ function hasDockerEnv() {
3962
+ try {
3963
+ fs.statSync("/.dockerenv");
3964
+ return true;
3965
+ } catch {
3966
+ return false;
3981
3967
  }
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;
3968
+ }
3969
+ function hasDockerCGroup() {
3970
+ try {
3971
+ return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
3972
+ } catch {
3973
+ return false;
3992
3974
  }
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
3975
  }
4001
- var $ZodAsyncError = class extends Error {
4002
- constructor() {
4003
- super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
3976
+ function isDocker() {
3977
+ if (isDockerCached === void 0) isDockerCached = hasDockerEnv() || hasDockerCGroup();
3978
+ return isDockerCached;
3979
+ }
3980
+
3981
+ //#endregion
3982
+ //#region node_modules/is-inside-container/index.js
3983
+ let cachedResult;
3984
+ const hasContainerEnv = () => {
3985
+ try {
3986
+ fs.statSync("/run/.containerenv");
3987
+ return true;
3988
+ } catch {
3989
+ return false;
4004
3990
  }
4005
3991
  };
4006
- var $ZodEncodeError = class extends Error {
4007
- constructor(name$1) {
4008
- super(`Encountered unidirectional transform during encode: ${name$1}`);
4009
- this.name = "ZodEncodeError";
3992
+ function isInsideContainer() {
3993
+ if (cachedResult === void 0) cachedResult = hasContainerEnv() || isDocker();
3994
+ return cachedResult;
3995
+ }
3996
+
3997
+ //#endregion
3998
+ //#region node_modules/is-wsl/index.js
3999
+ const isWsl = () => {
4000
+ if (y.platform !== "linux") return false;
4001
+ if (os.release().toLowerCase().includes("microsoft")) {
4002
+ if (isInsideContainer()) return false;
4003
+ return true;
4004
+ }
4005
+ try {
4006
+ return fs.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
4007
+ } catch {
4008
+ return false;
4010
4009
  }
4011
4010
  };
4012
- const globalConfig = {};
4013
- function config(newConfig) {
4014
- if (newConfig) Object.assign(globalConfig, newConfig);
4015
- return globalConfig;
4016
- }
4011
+ var is_wsl_default = y.env.__IS_WSL_TEST__ ? isWsl : isWsl();
4017
4012
 
4018
4013
  //#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;
4014
+ //#region node_modules/powershell-utils/index.js
4015
+ const execFile$2 = promisify(childProcess.execFile);
4016
+ const powerShellPath$1 = () => `${y.env.SYSTEMROOT || y.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
4017
+ const executePowerShell = async (command, options = {}) => {
4018
+ const { powerShellPath: psPath, ...execFileOptions } = options;
4019
+ const encodedCommand = executePowerShell.encodeCommand(command);
4020
+ return execFile$2(psPath ?? powerShellPath$1(), [...executePowerShell.argumentsPrefix, encodedCommand], {
4021
+ encoding: "utf8",
4022
+ ...execFileOptions
4023
+ });
4024
+ };
4025
+ executePowerShell.argumentsPrefix = [
4026
+ "-NoProfile",
4027
+ "-NonInteractive",
4028
+ "-ExecutionPolicy",
4029
+ "Bypass",
4030
+ "-EncodedCommand"
4031
+ ];
4032
+ executePowerShell.encodeCommand = (command) => Buffer$1.from(command, "utf16le").toString("base64");
4033
+ executePowerShell.escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
4034
+
4035
+ //#endregion
4036
+ //#region node_modules/wsl-utils/utilities.js
4037
+ function parseMountPointFromConfig(content) {
4038
+ for (const line of content.split("\n")) {
4039
+ if (/^\s*#/.test(line)) continue;
4040
+ const match = /^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(line);
4041
+ if (!match) continue;
4042
+ return match.groups.mountPoint.trim().replaceAll(/^["']|["']$/g, "");
4043
+ }
4027
4044
  }
4028
- function cached(getter) {
4029
- return { get value() {
4030
- {
4031
- const value = getter();
4032
- Object.defineProperty(this, "value", { value });
4033
- return value;
4045
+
4046
+ //#endregion
4047
+ //#region node_modules/wsl-utils/index.js
4048
+ const execFile$1 = promisify(childProcess.execFile);
4049
+ const wslDrivesMountPoint = (() => {
4050
+ const defaultMountPoint = "/mnt/";
4051
+ let mountPoint;
4052
+ return async function() {
4053
+ if (mountPoint) return mountPoint;
4054
+ const configFilePath = "/etc/wsl.conf";
4055
+ let isConfigFileExists = false;
4056
+ try {
4057
+ await fs$1.access(configFilePath, constants.F_OK);
4058
+ isConfigFileExists = true;
4059
+ } catch {}
4060
+ if (!isConfigFileExists) return defaultMountPoint;
4061
+ const parsedMountPoint = parseMountPointFromConfig(await fs$1.readFile(configFilePath, { encoding: "utf8" }));
4062
+ if (parsedMountPoint === void 0) return defaultMountPoint;
4063
+ mountPoint = parsedMountPoint;
4064
+ mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
4065
+ return mountPoint;
4066
+ };
4067
+ })();
4068
+ const powerShellPathFromWsl = async () => {
4069
+ return `${await wslDrivesMountPoint()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
4070
+ };
4071
+ const powerShellPath = is_wsl_default ? powerShellPathFromWsl : powerShellPath$1;
4072
+ let canAccessPowerShellPromise;
4073
+ const canAccessPowerShell = async () => {
4074
+ canAccessPowerShellPromise ??= (async () => {
4075
+ try {
4076
+ const psPath = await powerShellPath();
4077
+ await fs$1.access(psPath, constants.X_OK);
4078
+ return true;
4079
+ } catch {
4080
+ return false;
4034
4081
  }
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]);
4082
+ })();
4083
+ return canAccessPowerShellPromise;
4084
+ };
4085
+ const wslDefaultBrowser = async () => {
4086
+ const psPath = await powerShellPath();
4087
+ const { stdout: stdout$1 } = await executePowerShell(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, { powerShellPath: psPath });
4088
+ return stdout$1.trim();
4089
+ };
4090
+ const convertWslPathToWindows = async (path$16) => {
4091
+ if (/^[a-z]+:\/\//i.test(path$16)) return path$16;
4092
+ try {
4093
+ const { stdout: stdout$1 } = await execFile$1("wslpath", ["-aw", path$16], { encoding: "utf8" });
4094
+ return stdout$1.trim();
4095
+ } catch {
4096
+ return path$16;
4053
4097
  }
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, {
4098
+ };
4099
+
4100
+ //#endregion
4101
+ //#region node_modules/define-lazy-prop/index.js
4102
+ function defineLazyProperty(object$1, propertyName, valueGetter) {
4103
+ const define$1 = (value) => Object.defineProperty(object$1, propertyName, {
4077
4104
  value,
4078
- writable: true,
4079
4105
  enumerable: true,
4080
- configurable: true
4106
+ writable: true
4081
4107
  });
4108
+ Object.defineProperty(object$1, propertyName, {
4109
+ configurable: true,
4110
+ enumerable: true,
4111
+ get() {
4112
+ const result = valueGetter();
4113
+ define$1(result);
4114
+ return result;
4115
+ },
4116
+ set(value) {
4117
+ define$1(value);
4118
+ }
4119
+ });
4120
+ return object$1;
4082
4121
  }
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);
4122
+
4123
+ //#endregion
4124
+ //#region node_modules/default-browser-id/index.js
4125
+ const execFileAsync$3 = promisify(execFile);
4126
+ async function defaultBrowserId() {
4127
+ if (y.platform !== "darwin") throw new Error("macOS only");
4128
+ const { stdout: stdout$1 } = await execFileAsync$3("defaults", [
4129
+ "read",
4130
+ "com.apple.LaunchServices/com.apple.launchservices.secure",
4131
+ "LSHandlers"
4132
+ ]);
4133
+ const browserId = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout$1)?.groups.id ?? "com.apple.Safari";
4134
+ if (browserId === "com.apple.safari") return "com.apple.Safari";
4135
+ return browserId;
4093
4136
  }
4094
- function slugify(input) {
4095
- return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
4137
+
4138
+ //#endregion
4139
+ //#region node_modules/run-applescript/index.js
4140
+ const execFileAsync$2 = promisify(execFile);
4141
+ async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
4142
+ if (y.platform !== "darwin") throw new Error("macOS only");
4143
+ const outputArguments = humanReadableOutput ? [] : ["-ss"];
4144
+ const execOptions = {};
4145
+ if (signal) execOptions.signal = signal;
4146
+ const { stdout: stdout$1 } = await execFileAsync$2("osascript", [
4147
+ "-e",
4148
+ script,
4149
+ outputArguments
4150
+ ], execOptions);
4151
+ return stdout$1.trim();
4096
4152
  }
4097
- const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
4098
- function isObject$2(data) {
4099
- return typeof data === "object" && data !== null && !Array.isArray(data);
4153
+
4154
+ //#endregion
4155
+ //#region node_modules/bundle-name/index.js
4156
+ async function bundleName(bundleId) {
4157
+ 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")`);
4100
4158
  }
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;
4159
+
4160
+ //#endregion
4161
+ //#region node_modules/default-browser/windows.js
4162
+ const execFileAsync$1 = promisify(execFile);
4163
+ const windowsBrowserProgIds = {
4164
+ MSEdgeHTM: {
4165
+ name: "Edge",
4166
+ id: "com.microsoft.edge"
4167
+ },
4168
+ MSEdgeBHTML: {
4169
+ name: "Edge Beta",
4170
+ id: "com.microsoft.edge.beta"
4171
+ },
4172
+ MSEdgeDHTML: {
4173
+ name: "Edge Dev",
4174
+ id: "com.microsoft.edge.dev"
4175
+ },
4176
+ AppXq0fevzme2pys62n3e0fbqa7peapykr8v: {
4177
+ name: "Edge",
4178
+ id: "com.microsoft.edge.old"
4179
+ },
4180
+ ChromeHTML: {
4181
+ name: "Chrome",
4182
+ id: "com.google.chrome"
4183
+ },
4184
+ ChromeBHTML: {
4185
+ name: "Chrome Beta",
4186
+ id: "com.google.chrome.beta"
4187
+ },
4188
+ ChromeDHTML: {
4189
+ name: "Chrome Dev",
4190
+ id: "com.google.chrome.dev"
4191
+ },
4192
+ ChromiumHTM: {
4193
+ name: "Chromium",
4194
+ id: "org.chromium.Chromium"
4195
+ },
4196
+ BraveHTML: {
4197
+ name: "Brave",
4198
+ id: "com.brave.Browser"
4199
+ },
4200
+ BraveBHTML: {
4201
+ name: "Brave Beta",
4202
+ id: "com.brave.Browser.beta"
4203
+ },
4204
+ BraveDHTML: {
4205
+ name: "Brave Dev",
4206
+ id: "com.brave.Browser.dev"
4207
+ },
4208
+ BraveSSHTM: {
4209
+ name: "Brave Nightly",
4210
+ id: "com.brave.Browser.nightly"
4211
+ },
4212
+ FirefoxURL: {
4213
+ name: "Firefox",
4214
+ id: "org.mozilla.firefox"
4215
+ },
4216
+ OperaStable: {
4217
+ name: "Opera",
4218
+ id: "com.operasoftware.Opera"
4219
+ },
4220
+ VivaldiHTM: {
4221
+ name: "Vivaldi",
4222
+ id: "com.vivaldi.Vivaldi"
4223
+ },
4224
+ "IE.HTTP": {
4225
+ name: "Internet Explorer",
4226
+ id: "com.microsoft.ie"
4108
4227
  }
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;
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;
4228
+ };
4229
+ const _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));
4230
+ var UnknownBrowserError = class extends Error {};
4231
+ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
4232
+ const { stdout: stdout$1 } = await _execFileAsync("reg", [
4233
+ "QUERY",
4234
+ " HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
4235
+ "/v",
4236
+ "ProgId"
4237
+ ]);
4238
+ const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout$1);
4239
+ if (!match) throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout$1)}`);
4240
+ const { id } = match.groups;
4241
+ const browser = windowsBrowserProgIds[id];
4242
+ if (!browser) throw new UnknownBrowserError(`Unknown browser ID: ${id}`);
4243
+ return browser;
4137
4244
  }
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;
4245
+
4246
+ //#endregion
4247
+ //#region node_modules/default-browser/index.js
4248
+ const execFileAsync = promisify(execFile);
4249
+ const titleize = (string$2) => string$2.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x$2) => x$2.toUpperCase());
4250
+ async function defaultBrowser() {
4251
+ if (y.platform === "darwin") {
4252
+ const id = await defaultBrowserId();
4253
+ return {
4254
+ name: await bundleName(id),
4255
+ id
4256
+ };
4145
4257
  }
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
- });
4258
+ if (y.platform === "linux") {
4259
+ const { stdout: stdout$1 } = await execFileAsync("xdg-mime", [
4260
+ "query",
4261
+ "default",
4262
+ "x-scheme-handler/http"
4263
+ ]);
4264
+ const id = stdout$1.trim();
4265
+ return {
4266
+ name: titleize(id.replace(/.desktop$/, "").replace("-", " ")),
4267
+ id
4268
+ };
4269
+ }
4270
+ if (y.platform === "win32") return defaultBrowser$1();
4271
+ throw new Error("Only macOS, Linux, and Windows are supported");
4157
4272
  }
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]
4273
+
4274
+ //#endregion
4275
+ //#region node_modules/is-in-ssh/index.js
4276
+ const isInSsh = Boolean(y.env.SSH_CONNECTION || y.env.SSH_CLIENT || y.env.SSH_TTY);
4277
+ var is_in_ssh_default = isInSsh;
4278
+
4279
+ //#endregion
4280
+ //#region node_modules/open/index.js
4281
+ const fallbackAttemptSymbol = Symbol("fallbackAttempt");
4282
+ const __dirname$1 = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
4283
+ const localXdgOpenPath = path.join(__dirname$1, "xdg-open");
4284
+ const { platform: platform$2, arch } = y;
4285
+ const tryEachApp = async (apps$1, opener) => {
4286
+ if (apps$1.length === 0) return;
4287
+ const errors = [];
4288
+ for (const app of apps$1) try {
4289
+ return await opener(app);
4290
+ } catch (error) {
4291
+ errors.push(error);
4292
+ }
4293
+ throw new AggregateError(errors, "Failed to open in all supported apps");
4164
4294
  };
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() {
4295
+ const baseOpen = async (options) => {
4296
+ options = {
4297
+ wait: false,
4298
+ background: false,
4299
+ newInstance: false,
4300
+ allowNonzeroExitCode: false,
4301
+ ...options
4302
+ };
4303
+ const isFallbackAttempt = options[fallbackAttemptSymbol] === true;
4304
+ delete options[fallbackAttemptSymbol];
4305
+ if (Array.isArray(options.app)) return tryEachApp(options.app, (singleApp) => baseOpen({
4306
+ ...options,
4307
+ app: singleApp,
4308
+ [fallbackAttemptSymbol]: true
4309
+ }));
4310
+ let { name: app, arguments: appArguments = [] } = options.app ?? {};
4311
+ appArguments = [...appArguments];
4312
+ if (Array.isArray(app)) return tryEachApp(app, (appName) => baseOpen({
4313
+ ...options,
4314
+ app: {
4315
+ name: appName,
4316
+ arguments: appArguments
4317
+ },
4318
+ [fallbackAttemptSymbol]: true
4319
+ }));
4320
+ if (app === "browser" || app === "browserPrivate") {
4321
+ const ids = {
4322
+ "com.google.chrome": "chrome",
4323
+ "google-chrome.desktop": "chrome",
4324
+ "com.brave.browser": "brave",
4325
+ "org.mozilla.firefox": "firefox",
4326
+ "firefox.desktop": "firefox",
4327
+ "com.microsoft.msedge": "edge",
4328
+ "com.microsoft.edge": "edge",
4329
+ "com.microsoft.edgemac": "edge",
4330
+ "microsoft-edge.desktop": "edge",
4331
+ "com.apple.safari": "safari"
4332
+ };
4333
+ const flags = {
4334
+ chrome: "--incognito",
4335
+ brave: "--incognito",
4336
+ firefox: "--private-window",
4337
+ edge: "--inPrivate"
4338
+ };
4339
+ let browser;
4340
+ if (is_wsl_default) {
4341
+ const progId = await wslDefaultBrowser();
4342
+ browser = _windowsBrowserProgIdMap.get(progId) ?? {};
4343
+ } else browser = await defaultBrowser();
4344
+ if (browser.id in ids) {
4345
+ const browserName = ids[browser.id.toLowerCase()];
4346
+ if (app === "browserPrivate") {
4347
+ if (browserName === "safari") throw new Error("Safari doesn't support opening in private mode via command line");
4348
+ appArguments.push(flags[browserName]);
4349
+ }
4350
+ return baseOpen({
4351
+ ...options,
4352
+ app: {
4353
+ name: apps[browserName],
4354
+ arguments: appArguments
4355
+ }
4356
+ });
4357
+ }
4358
+ throw new Error(`${browser.name} is not supported as a default browser`);
4359
+ }
4360
+ let command;
4361
+ const cliArguments = [];
4362
+ const childProcessOptions = {};
4363
+ let shouldUseWindowsInWsl = false;
4364
+ if (is_wsl_default && !isInsideContainer() && !is_in_ssh_default && !app) shouldUseWindowsInWsl = await canAccessPowerShell();
4365
+ if (platform$2 === "darwin") {
4366
+ command = "open";
4367
+ if (options.wait) cliArguments.push("--wait-apps");
4368
+ if (options.background) cliArguments.push("--background");
4369
+ if (options.newInstance) cliArguments.push("--new");
4370
+ if (app) cliArguments.push("-a", app);
4371
+ } else if (platform$2 === "win32" || shouldUseWindowsInWsl) {
4372
+ command = await powerShellPath();
4373
+ cliArguments.push(...executePowerShell.argumentsPrefix);
4374
+ if (!is_wsl_default) childProcessOptions.windowsVerbatimArguments = true;
4375
+ if (is_wsl_default && options.target) options.target = await convertWslPathToWindows(options.target);
4376
+ const encodedArguments = ["$ProgressPreference = 'SilentlyContinue';", "Start"];
4377
+ if (options.wait) encodedArguments.push("-Wait");
4378
+ if (app) {
4379
+ encodedArguments.push(executePowerShell.escapeArgument(app));
4380
+ if (options.target) appArguments.push(options.target);
4381
+ } else if (options.target) encodedArguments.push(executePowerShell.escapeArgument(options.target));
4382
+ if (appArguments.length > 0) {
4383
+ appArguments = appArguments.map((argument) => executePowerShell.escapeArgument(argument));
4384
+ encodedArguments.push("-ArgumentList", appArguments.join(","));
4385
+ }
4386
+ options.target = executePowerShell.encodeCommand(encodedArguments.join(" "));
4387
+ if (!options.wait) childProcessOptions.stdio = "ignore";
4388
+ } else {
4389
+ if (app) command = app;
4390
+ else {
4391
+ const isBundled = !__dirname$1 || __dirname$1 === "/";
4392
+ let exeLocalXdgOpen = false;
4393
+ try {
4394
+ await fs$1.access(localXdgOpenPath, constants.X_OK);
4395
+ exeLocalXdgOpen = true;
4396
+ } catch {}
4397
+ command = y.versions.electron ?? (platform$2 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
4398
+ }
4399
+ if (appArguments.length > 0) cliArguments.push(...appArguments);
4400
+ if (!options.wait) {
4401
+ childProcessOptions.stdio = "ignore";
4402
+ childProcessOptions.detached = true;
4403
+ }
4404
+ }
4405
+ if (platform$2 === "darwin" && appArguments.length > 0) cliArguments.push("--args", ...appArguments);
4406
+ if (options.target) cliArguments.push(options.target);
4407
+ const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
4408
+ if (options.wait) return new Promise((resolve$1, reject) => {
4409
+ subprocess.once("error", reject);
4410
+ subprocess.once("close", (exitCode) => {
4411
+ if (!options.allowNonzeroExitCode && exitCode !== 0) {
4412
+ reject(/* @__PURE__ */ new Error(`Exited with code ${exitCode}`));
4413
+ return;
4414
+ }
4415
+ resolve$1(subprocess);
4416
+ });
4417
+ });
4418
+ if (isFallbackAttempt) return new Promise((resolve$1, reject) => {
4419
+ subprocess.once("error", reject);
4420
+ subprocess.once("spawn", () => {
4421
+ subprocess.once("close", (exitCode) => {
4422
+ subprocess.off("error", reject);
4423
+ if (exitCode !== 0) {
4424
+ reject(/* @__PURE__ */ new Error(`Exited with code ${exitCode}`));
4425
+ return;
4426
+ }
4427
+ subprocess.unref();
4428
+ resolve$1(subprocess);
4429
+ });
4430
+ });
4431
+ });
4432
+ subprocess.unref();
4433
+ return new Promise((resolve$1, reject) => {
4434
+ subprocess.once("error", reject);
4435
+ subprocess.once("spawn", () => {
4436
+ subprocess.off("error", reject);
4437
+ resolve$1(subprocess);
4438
+ });
4439
+ });
4440
+ };
4441
+ const open = (target, options) => {
4442
+ if (typeof target !== "string") throw new TypeError("Expected a `target`");
4443
+ return baseOpen({
4444
+ ...options,
4445
+ target
4446
+ });
4447
+ };
4448
+ function detectArchBinary(binary) {
4449
+ if (typeof binary === "string" || Array.isArray(binary)) return binary;
4450
+ const { [arch]: archBinary } = binary;
4451
+ if (!archBinary) throw new Error(`${arch} is not supported`);
4452
+ return archBinary;
4453
+ }
4454
+ function detectPlatformBinary({ [platform$2]: platformBinary }, { wsl } = {}) {
4455
+ if (wsl && is_wsl_default) return detectArchBinary(wsl);
4456
+ if (!platformBinary) throw new Error(`${platform$2} is not supported`);
4457
+ return detectArchBinary(platformBinary);
4458
+ }
4459
+ const apps = {
4460
+ browser: "browser",
4461
+ browserPrivate: "browserPrivate"
4462
+ };
4463
+ defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
4464
+ darwin: "google chrome",
4465
+ win32: "chrome",
4466
+ linux: [
4467
+ "google-chrome",
4468
+ "google-chrome-stable",
4469
+ "chromium",
4470
+ "chromium-browser"
4471
+ ]
4472
+ }, { wsl: {
4473
+ ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
4474
+ x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
4475
+ } }));
4476
+ defineLazyProperty(apps, "brave", () => detectPlatformBinary({
4477
+ darwin: "brave browser",
4478
+ win32: "brave",
4479
+ linux: ["brave-browser", "brave"]
4480
+ }, { wsl: {
4481
+ ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
4482
+ x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
4483
+ } }));
4484
+ defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
4485
+ darwin: "firefox",
4486
+ win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
4487
+ linux: "firefox"
4488
+ }, { wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe" }));
4489
+ defineLazyProperty(apps, "edge", () => detectPlatformBinary({
4490
+ darwin: "microsoft edge",
4491
+ win32: "msedge",
4492
+ linux: ["microsoft-edge", "microsoft-edge-dev"]
4493
+ }, { wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe" }));
4494
+ defineLazyProperty(apps, "safari", () => detectPlatformBinary({ darwin: "Safari" }));
4495
+ var open_default = open;
4496
+
4497
+ //#endregion
4498
+ //#region node_modules/zod/v4/core/core.js
4499
+ /** A special constant with type `never` */
4500
+ const NEVER = Object.freeze({ status: "aborted" });
4501
+ function $constructor(name$1, initializer$2, params) {
4502
+ function init(inst, def) {
4503
+ if (!inst._zod) Object.defineProperty(inst, "_zod", {
4504
+ value: {
4505
+ def,
4506
+ constr: _$2,
4507
+ traits: /* @__PURE__ */ new Set()
4508
+ },
4509
+ enumerable: false
4510
+ });
4511
+ if (inst._zod.traits.has(name$1)) return;
4512
+ inst._zod.traits.add(name$1);
4513
+ initializer$2(inst, def);
4514
+ const proto$1 = _$2.prototype;
4515
+ const keys = Object.keys(proto$1);
4516
+ for (let i$1 = 0; i$1 < keys.length; i$1++) {
4517
+ const k$2 = keys[i$1];
4518
+ if (!(k$2 in inst)) inst[k$2] = proto$1[k$2].bind(inst);
4519
+ }
4520
+ }
4521
+ const Parent = params?.Parent ?? Object;
4522
+ class Definition extends Parent {}
4523
+ Object.defineProperty(Definition, "name", { value: name$1 });
4524
+ function _$2(def) {
4525
+ var _a$1;
4526
+ const inst = params?.Parent ? new Definition() : this;
4527
+ init(inst, def);
4528
+ (_a$1 = inst._zod).deferred ?? (_a$1.deferred = []);
4529
+ for (const fn of inst._zod.deferred) fn();
4530
+ return inst;
4531
+ }
4532
+ Object.defineProperty(_$2, "init", { value: init });
4533
+ Object.defineProperty(_$2, Symbol.hasInstance, { value: (inst) => {
4534
+ if (params?.Parent && inst instanceof params.Parent) return true;
4535
+ return inst?._zod?.traits?.has(name$1);
4536
+ } });
4537
+ Object.defineProperty(_$2, "name", { value: name$1 });
4538
+ return _$2;
4539
+ }
4540
+ var $ZodAsyncError = class extends Error {
4541
+ constructor() {
4542
+ super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
4543
+ }
4544
+ };
4545
+ var $ZodEncodeError = class extends Error {
4546
+ constructor(name$1) {
4547
+ super(`Encountered unidirectional transform during encode: ${name$1}`);
4548
+ this.name = "ZodEncodeError";
4549
+ }
4550
+ };
4551
+ const globalConfig = {};
4552
+ function config(newConfig) {
4553
+ if (newConfig) Object.assign(globalConfig, newConfig);
4554
+ return globalConfig;
4555
+ }
4556
+
4557
+ //#endregion
4558
+ //#region node_modules/zod/v4/core/util.js
4559
+ function getEnumValues(entries) {
4560
+ const numericValues = Object.values(entries).filter((v$1) => typeof v$1 === "number");
4561
+ return Object.entries(entries).filter(([k$2, _$2]) => numericValues.indexOf(+k$2) === -1).map(([_$2, v$1]) => v$1);
4562
+ }
4563
+ function jsonStringifyReplacer(_$2, value) {
4564
+ if (typeof value === "bigint") return value.toString();
4565
+ return value;
4566
+ }
4567
+ function cached(getter) {
4568
+ return { get value() {
4569
+ {
4570
+ const value = getter();
4571
+ Object.defineProperty(this, "value", { value });
4572
+ return value;
4573
+ }
4574
+ throw new Error("cached value already set");
4575
+ } };
4576
+ }
4577
+ function nullish(input) {
4578
+ return input === null || input === void 0;
4579
+ }
4580
+ function cleanRegex(source) {
4581
+ const start = source.startsWith("^") ? 1 : 0;
4582
+ const end = source.endsWith("$") ? source.length - 1 : source.length;
4583
+ return source.slice(start, end);
4584
+ }
4585
+ function floatSafeRemainder(val, step) {
4586
+ const valDecCount = (val.toString().split(".")[1] || "").length;
4587
+ const stepString = step.toString();
4588
+ let stepDecCount = (stepString.split(".")[1] || "").length;
4589
+ if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) {
4590
+ const match = stepString.match(/\d?e-(\d?)/);
4591
+ if (match?.[1]) stepDecCount = Number.parseInt(match[1]);
4592
+ }
4593
+ const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
4594
+ return Number.parseInt(val.toFixed(decCount).replace(".", "")) % Number.parseInt(step.toFixed(decCount).replace(".", "")) / 10 ** decCount;
4595
+ }
4596
+ const EVALUATING = Symbol("evaluating");
4597
+ function defineLazy(object$1, key, getter) {
4598
+ let value = void 0;
4599
+ Object.defineProperty(object$1, key, {
4600
+ get() {
4601
+ if (value === EVALUATING) return;
4602
+ if (value === void 0) {
4603
+ value = EVALUATING;
4604
+ value = getter();
4605
+ }
4606
+ return value;
4607
+ },
4608
+ set(v$1) {
4609
+ Object.defineProperty(object$1, key, { value: v$1 });
4610
+ },
4611
+ configurable: true
4612
+ });
4613
+ }
4614
+ function assignProp(target, prop, value) {
4615
+ Object.defineProperty(target, prop, {
4616
+ value,
4617
+ writable: true,
4618
+ enumerable: true,
4619
+ configurable: true
4620
+ });
4621
+ }
4622
+ function mergeDefs(...defs) {
4623
+ const mergedDescriptors = {};
4624
+ for (const def of defs) {
4625
+ const descriptors$1 = Object.getOwnPropertyDescriptors(def);
4626
+ Object.assign(mergedDescriptors, descriptors$1);
4627
+ }
4628
+ return Object.defineProperties({}, mergedDescriptors);
4629
+ }
4630
+ function esc(str) {
4631
+ return JSON.stringify(str);
4632
+ }
4633
+ function slugify(input) {
4634
+ return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
4635
+ }
4636
+ const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
4637
+ function isObject$2(data) {
4638
+ return typeof data === "object" && data !== null && !Array.isArray(data);
4639
+ }
4640
+ const allowsEval = cached(() => {
4641
+ if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false;
4642
+ try {
4643
+ new Function("");
4644
+ return true;
4645
+ } catch (_$2) {
4646
+ return false;
4647
+ }
4648
+ });
4649
+ function isPlainObject$1(o$2) {
4650
+ if (isObject$2(o$2) === false) return false;
4651
+ const ctor = o$2.constructor;
4652
+ if (ctor === void 0) return true;
4653
+ if (typeof ctor !== "function") return true;
4654
+ const prot = ctor.prototype;
4655
+ if (isObject$2(prot) === false) return false;
4656
+ if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false;
4657
+ return true;
4658
+ }
4659
+ function shallowClone(o$2) {
4660
+ if (isPlainObject$1(o$2)) return { ...o$2 };
4661
+ if (Array.isArray(o$2)) return [...o$2];
4662
+ return o$2;
4663
+ }
4664
+ const propertyKeyTypes = new Set([
4665
+ "string",
4666
+ "number",
4667
+ "symbol"
4668
+ ]);
4669
+ function escapeRegex(str) {
4670
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
4671
+ }
4672
+ function clone(inst, def, params) {
4673
+ const cl = new inst._zod.constr(def ?? inst._zod.def);
4674
+ if (!def || params?.parent) cl._zod.parent = inst;
4675
+ return cl;
4676
+ }
4677
+ function normalizeParams(_params) {
4678
+ const params = _params;
4679
+ if (!params) return {};
4680
+ if (typeof params === "string") return { error: () => params };
4681
+ if (params?.message !== void 0) {
4682
+ if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params");
4683
+ params.error = params.message;
4684
+ }
4685
+ delete params.message;
4686
+ if (typeof params.error === "string") return {
4687
+ ...params,
4688
+ error: () => params.error
4689
+ };
4690
+ return params;
4691
+ }
4692
+ function optionalKeys(shape) {
4693
+ return Object.keys(shape).filter((k$2) => {
4694
+ return shape[k$2]._zod.optin === "optional" && shape[k$2]._zod.optout === "optional";
4695
+ });
4696
+ }
4697
+ const NUMBER_FORMAT_RANGES = {
4698
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
4699
+ int32: [-2147483648, 2147483647],
4700
+ uint32: [0, 4294967295],
4701
+ float32: [-34028234663852886e22, 34028234663852886e22],
4702
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
4703
+ };
4704
+ function pick(schema, mask) {
4705
+ const currDef = schema._zod.def;
4706
+ const checks = currDef.checks;
4707
+ if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements");
4708
+ return clone(schema, mergeDefs(schema._zod.def, {
4709
+ get shape() {
4710
+ const newShape = {};
4711
+ for (const key in mask) {
4712
+ if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
4713
+ if (!mask[key]) continue;
4714
+ newShape[key] = currDef.shape[key];
4715
+ }
4716
+ assignProp(this, "shape", newShape);
4717
+ return newShape;
4718
+ },
4719
+ checks: []
4720
+ }));
4721
+ }
4722
+ function omit(schema, mask) {
4723
+ const currDef = schema._zod.def;
4724
+ const checks = currDef.checks;
4725
+ if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
4726
+ return clone(schema, mergeDefs(schema._zod.def, {
4727
+ get shape() {
4189
4728
  const newShape = { ...schema._zod.def.shape };
4190
4729
  for (const key in mask) {
4191
4730
  if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
@@ -8737,7 +9276,7 @@ var distribution_default = ky;
8737
9276
 
8738
9277
  //#endregion
8739
9278
  //#region src/core/config.ts
8740
- const __dirname$1 = dirname(fileURLToPath(import.meta.url));
9279
+ const __dirname = dirname(fileURLToPath(import.meta.url));
8741
9280
  function getBase44GlobalDir() {
8742
9281
  return join(homedir(), ".base44");
8743
9282
  }
@@ -8745,7 +9284,7 @@ function getAuthFilePath() {
8745
9284
  return join(getBase44GlobalDir(), "auth", "auth.json");
8746
9285
  }
8747
9286
  function getTemplatesDir() {
8748
- return join(__dirname$1, "templates");
9287
+ return join(__dirname, "templates");
8749
9288
  }
8750
9289
  function getTemplatesIndexPath() {
8751
9290
  return join(getTemplatesDir(), "templates.json");
@@ -26763,11 +27302,11 @@ const constants$2 = Object.freeze(Object.assign(Object.create(null), {
26763
27302
 
26764
27303
  //#endregion
26765
27304
  //#region node_modules/minizlib/dist/esm/index.js
26766
- const OriginalBufferConcat = Buffer$1.concat;
26767
- const desc = Object.getOwnPropertyDescriptor(Buffer$1, "concat");
27305
+ const OriginalBufferConcat = Buffer$2.concat;
27306
+ const desc = Object.getOwnPropertyDescriptor(Buffer$2, "concat");
26768
27307
  const noop$2 = (args) => args;
26769
27308
  const passthroughBufferConcat = desc?.writable === true || desc?.set !== void 0 ? (makeNoOp) => {
26770
- Buffer$1.concat = makeNoOp ? noop$2 : OriginalBufferConcat;
27309
+ Buffer$2.concat = makeNoOp ? noop$2 : OriginalBufferConcat;
26771
27310
  } : (_$2) => {};
26772
27311
  const _superWrite = Symbol("_superWrite");
26773
27312
  var ZlibError = class extends Error {
@@ -26845,7 +27384,7 @@ var ZlibBase = class extends Minipass {
26845
27384
  flush(flushFlag) {
26846
27385
  if (this.ended) return;
26847
27386
  if (typeof flushFlag !== "number") flushFlag = this.#fullFlushFlag;
26848
- this.write(Object.assign(Buffer$1.alloc(0), { [_flushFlag]: flushFlag }));
27387
+ this.write(Object.assign(Buffer$2.alloc(0), { [_flushFlag]: flushFlag }));
26849
27388
  }
26850
27389
  end(chunk, encoding, cb) {
26851
27390
  /* c8 ignore start */
@@ -26873,7 +27412,7 @@ var ZlibBase = class extends Minipass {
26873
27412
  }
26874
27413
  write(chunk, encoding, cb) {
26875
27414
  if (typeof encoding === "function") cb = encoding, encoding = "utf8";
26876
- if (typeof chunk === "string") chunk = Buffer$1.from(chunk, encoding);
27415
+ if (typeof chunk === "string") chunk = Buffer$2.from(chunk, encoding);
26877
27416
  if (this.#sawError) return;
26878
27417
  assert(this.#handle, "zlib binding closed");
26879
27418
  const nativeHandle = this.#handle._handle;
@@ -26902,9 +27441,9 @@ var ZlibBase = class extends Minipass {
26902
27441
  let writeReturn;
26903
27442
  if (result) if (Array.isArray(result) && result.length > 0) {
26904
27443
  const r$1 = result[0];
26905
- writeReturn = this[_superWrite](Buffer$1.from(r$1));
27444
+ writeReturn = this[_superWrite](Buffer$2.from(r$1));
26906
27445
  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));
27446
+ } else writeReturn = this[_superWrite](Buffer$2.from(result));
26908
27447
  if (cb) cb();
26909
27448
  return writeReturn;
26910
27449
  }
@@ -27382,8 +27921,8 @@ const parseKVLine = (set, line) => {
27382
27921
 
27383
27922
  //#endregion
27384
27923
  //#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, "/");
27924
+ const platform$1 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
27925
+ const normalizeWindowsPath = platform$1 !== "win32" ? (p$1) => p$1 : (p$1) => p$1 && p$1.replace(/\\/g, "/");
27387
27926
 
27388
27927
  //#endregion
27389
27928
  //#region node_modules/tar/dist/esm/read-entry.js
@@ -31258,7 +31797,8 @@ async function generateAndDisplayDeviceCode() {
31258
31797
  successMessage: "Device code generated",
31259
31798
  errorMessage: "Failed to generate device code"
31260
31799
  });
31261
- M.info(`Verification code: ${theme.styles.bold(deviceCodeResponse.userCode)}\nPlease confirm this code at: ${deviceCodeResponse.verificationUri}`);
31800
+ M.info(`Verification code: ${theme.styles.bold(deviceCodeResponse.userCode)}\nPlease confirm this code at: ${theme.colors.links(deviceCodeResponse.verificationUri)}`);
31801
+ if (process.stdout.isTTY) await open_default(deviceCodeResponse.verificationUri);
31262
31802
  return deviceCodeResponse;
31263
31803
  }
31264
31804
  async function waitForAuthentication(deviceCode, expiresIn, interval) {
@@ -32953,7 +33493,7 @@ const getSignals = () => {
32953
33493
  return [...SIGNALS, ...realtimeSignals].map(normalizeSignal$1);
32954
33494
  };
32955
33495
  const normalizeSignal$1 = ({ name: name$1, number: defaultNumber, description, action, forced = false, standard }) => {
32956
- const { signals: { [name$1]: constantSignal } } = constants;
33496
+ const { signals: { [name$1]: constantSignal } } = constants$1;
32957
33497
  const supported = constantSignal !== void 0;
32958
33498
  return {
32959
33499
  name: name$1,
@@ -33003,7 +33543,7 @@ const getSignalByNumber = (number$2, signals$1) => {
33003
33543
  } };
33004
33544
  };
33005
33545
  const findSignalByNumber = (number$2, signals$1) => {
33006
- const signal = signals$1.find(({ name: name$1 }) => constants.signals[name$1] === number$2);
33546
+ const signal = signals$1.find(({ name: name$1 }) => constants$1.signals[name$1] === number$2);
33007
33547
  if (signal !== void 0) return signal;
33008
33548
  return signals$1.find((signalA) => signalA.number === number$2);
33009
33549
  };
@@ -33026,17 +33566,17 @@ const normalizeSignalInteger = (signalInteger, optionName) => {
33026
33566
  if (signalsIntegerToName.has(signalInteger)) return signalsIntegerToName.get(signalInteger);
33027
33567
  throw new TypeError(`Invalid ${optionName} ${signalInteger}: this signal integer does not exist.\n${getAvailableSignals()}`);
33028
33568
  };
33029
- const getSignalsIntegerToName = () => new Map(Object.entries(constants.signals).reverse().map(([signalName, signalInteger]) => [signalInteger, signalName]));
33569
+ const getSignalsIntegerToName = () => new Map(Object.entries(constants$1.signals).reverse().map(([signalName, signalInteger]) => [signalInteger, signalName]));
33030
33570
  const signalsIntegerToName = getSignalsIntegerToName();
33031
33571
  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()}'.`);
33572
+ if (signalName in constants$1.signals) return signalName;
33573
+ if (signalName.toUpperCase() in constants$1.signals) throw new TypeError(`Invalid ${optionName} '${signalName}': please rename it to '${signalName.toUpperCase()}'.`);
33034
33574
  throw new TypeError(`Invalid ${optionName} '${signalName}': this signal name does not exist.\n${getAvailableSignals()}`);
33035
33575
  };
33036
33576
  const getAvailableSignals = () => `Available signal names: ${getAvailableSignalNames()}.
33037
33577
  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(", ");
33578
+ const getAvailableSignalNames = () => Object.keys(constants$1.signals).sort().map((signalName) => `'${signalName}'`).join(", ");
33579
+ const getAvailableSignalIntegers = () => [...new Set(Object.values(constants$1.signals).sort((signalInteger, signalIntegerTwo) => signalInteger - signalIntegerTwo))].join(", ");
33040
33580
  const getSignalDescription = (signal) => signalsByName[signal].description;
33041
33581
 
33042
33582
  //#endregion
@@ -35276,7 +35816,7 @@ const linesUint8ArrayInfo = {
35276
35816
  //#region node_modules/execa/lib/transform/validate.js
35277
35817
  const getValidateTransformInput = (writableObjectMode, optionName) => writableObjectMode ? void 0 : validateStringTransformInput.bind(void 0, optionName);
35278
35818
  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}.`);
35819
+ 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
35820
  yield chunk;
35281
35821
  };
35282
35822
  const getValidateTransformReturn = (readableObjectMode, optionName) => readableObjectMode ? validateObjectTransformReturn.bind(void 0, optionName) : validateStringTransformReturn.bind(void 0, optionName);
@@ -35307,7 +35847,7 @@ const getEncodingTransformGenerator = (binary, encoding, skipped) => {
35307
35847
  };
35308
35848
  };
35309
35849
  const encodingUint8ArrayGenerator = function* (textEncoder$2, chunk) {
35310
- if (Buffer$2.isBuffer(chunk)) yield bufferToUint8Array(chunk);
35850
+ if (Buffer$1.isBuffer(chunk)) yield bufferToUint8Array(chunk);
35311
35851
  else if (typeof chunk === "string") yield textEncoder$2.encode(chunk);
35312
35852
  else yield chunk;
35313
35853
  };
@@ -36004,7 +36544,7 @@ const addPropertiesAsync = {
36004
36544
  iterable: ({ value }) => ({ stream: Readable.from(value) }),
36005
36545
  asyncIterable: ({ value }) => ({ stream: Readable.from(value) }),
36006
36546
  string: ({ value }) => ({ stream: Readable.from(value) }),
36007
- uint8Array: ({ value }) => ({ stream: Readable.from(Buffer$2.from(value)) })
36547
+ uint8Array: ({ value }) => ({ stream: Readable.from(Buffer$1.from(value)) })
36008
36548
  },
36009
36549
  output: {
36010
36550
  ...addProperties,
@@ -38107,6 +38647,7 @@ async function createInteractive(options) {
38107
38647
  description: result.description || void 0,
38108
38648
  projectPath: result.projectPath,
38109
38649
  deploy: options.deploy,
38650
+ skills: options.skills,
38110
38651
  isInteractive: true
38111
38652
  });
38112
38653
  }
@@ -38117,10 +38658,11 @@ async function createNonInteractive(options) {
38117
38658
  description: options.description,
38118
38659
  projectPath: options.path,
38119
38660
  deploy: options.deploy,
38661
+ skills: options.skills,
38120
38662
  isInteractive: false
38121
38663
  });
38122
38664
  }
38123
- async function executeCreate({ template, name: rawName, description, projectPath, deploy, isInteractive }) {
38665
+ async function executeCreate({ template, name: rawName, description, projectPath, deploy, skills, isInteractive }) {
38124
38666
  const name$1 = rawName.trim();
38125
38667
  const resolvedPath = resolve(projectPath);
38126
38668
  const { projectId } = await runTask("Setting up your project...", async () => {
@@ -38180,554 +38722,34 @@ async function executeCreate({ template, name: rawName, description, projectPath
38180
38722
  finalAppUrl = appUrl;
38181
38723
  }
38182
38724
  }
38725
+ let shouldAddSkills = false;
38726
+ if (isInteractive) {
38727
+ const result = await ye({ message: "Add AI agent skills?" });
38728
+ shouldAddSkills = !pD(result) && result;
38729
+ } else shouldAddSkills = !!skills;
38730
+ if (shouldAddSkills) await runTask("Installing AI agent skills...", async () => {
38731
+ await execa("npx", [
38732
+ "-y",
38733
+ "add-skill",
38734
+ "base44/skills",
38735
+ "-y"
38736
+ ], {
38737
+ cwd: resolvedPath,
38738
+ stdio: "inherit"
38739
+ });
38740
+ }, {
38741
+ successMessage: theme.colors.base44Orange("AI agent skills added successfully"),
38742
+ errorMessage: "Failed to add AI agent skills - you can add them later with: npx add-skill base44/skills"
38743
+ });
38183
38744
  M.message(`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name$1)}`);
38184
38745
  M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(projectId))}`);
38185
38746
  if (finalAppUrl) M.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
38186
38747
  return { outroMessage: "Your project is set up and ready to use" };
38187
38748
  }
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) => {
38749
+ 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) => {
38189
38750
  await chooseCreate(options);
38190
38751
  });
38191
38752
 
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
38753
  //#endregion
38732
38754
  //#region src/cli/commands/project/dashboard.ts
38733
38755
  async function openDashboard() {