@base44-preview/cli 0.0.11-pr.82.893c777 → 0.0.11-pr.83.2bc8234

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/cli/index.js +189 -104
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -4,7 +4,7 @@ import { EventEmitter, addAbortListener, on, once, setMaxListeners } from "node:
4
4
  import childProcess, { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
5
5
  import path, { basename, dirname, join, posix, resolve, win32 } from "node:path";
6
6
  import fs, { appendFileSync, createReadStream, createWriteStream, readFileSync, statSync, writeFileSync } from "node:fs";
7
- import process$1, { execArgv, execPath, hrtime, platform, stdin, stdout } from "node:process";
7
+ import y, { execArgv, execPath, hrtime, platform, stdin, stdout } from "node:process";
8
8
  import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
9
9
  import * as g from "node:readline";
10
10
  import O from "node:readline";
@@ -894,7 +894,7 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
894
894
  const childProcess$1 = __require("node:child_process");
895
895
  const path$16 = __require("node:path");
896
896
  const fs$11 = __require("node:fs");
897
- const process$4 = __require("node:process");
897
+ const process$3 = __require("node:process");
898
898
  const { Argument, humanReadableArgName } = require_argument();
899
899
  const { CommanderError } = require_error$1();
900
900
  const { Help } = require_help();
@@ -945,10 +945,10 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
945
945
  this._showHelpAfterError = false;
946
946
  this._showSuggestionAfterError = true;
947
947
  this._outputConfiguration = {
948
- writeOut: (str) => process$4.stdout.write(str),
949
- writeErr: (str) => process$4.stderr.write(str),
950
- getOutHelpWidth: () => process$4.stdout.isTTY ? process$4.stdout.columns : void 0,
951
- getErrHelpWidth: () => process$4.stderr.isTTY ? process$4.stderr.columns : void 0,
948
+ writeOut: (str) => process$3.stdout.write(str),
949
+ writeErr: (str) => process$3.stderr.write(str),
950
+ getOutHelpWidth: () => process$3.stdout.isTTY ? process$3.stdout.columns : void 0,
951
+ getErrHelpWidth: () => process$3.stderr.isTTY ? process$3.stderr.columns : void 0,
952
952
  outputError: (str, write) => write(str)
953
953
  };
954
954
  this._hidden = false;
@@ -1302,7 +1302,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1302
1302
  */
1303
1303
  _exit(exitCode, code$1, message) {
1304
1304
  if (this._exitCallback) this._exitCallback(new CommanderError(exitCode, code$1, message));
1305
- process$4.exit(exitCode);
1305
+ process$3.exit(exitCode);
1306
1306
  }
1307
1307
  /**
1308
1308
  * Register callback `fn` for the command.
@@ -1641,11 +1641,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
1641
1641
  if (argv !== void 0 && !Array.isArray(argv)) throw new Error("first parameter to parse must be array or undefined");
1642
1642
  parseOptions = parseOptions || {};
1643
1643
  if (argv === void 0 && parseOptions.from === void 0) {
1644
- if (process$4.versions?.electron) parseOptions.from = "electron";
1645
- const execArgv$1 = process$4.execArgv ?? [];
1644
+ if (process$3.versions?.electron) parseOptions.from = "electron";
1645
+ const execArgv$1 = process$3.execArgv ?? [];
1646
1646
  if (execArgv$1.includes("-e") || execArgv$1.includes("--eval") || execArgv$1.includes("-p") || execArgv$1.includes("--print")) parseOptions.from = "eval";
1647
1647
  }
1648
- if (argv === void 0) argv = process$4.argv;
1648
+ if (argv === void 0) argv = process$3.argv;
1649
1649
  this.rawArgs = argv.slice();
1650
1650
  let userArgs;
1651
1651
  switch (parseOptions.from) {
@@ -1655,7 +1655,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1655
1655
  userArgs = argv.slice(2);
1656
1656
  break;
1657
1657
  case "electron":
1658
- if (process$4.defaultApp) {
1658
+ if (process$3.defaultApp) {
1659
1659
  this._scriptPath = argv[1];
1660
1660
  userArgs = argv.slice(2);
1661
1661
  } else userArgs = argv.slice(1);
@@ -1769,15 +1769,15 @@ Expecting one of '${allowedValues.join("', '")}'`);
1769
1769
  }
1770
1770
  launchWithNode = sourceExt.includes(path$16.extname(executableFile));
1771
1771
  let proc$1;
1772
- if (process$4.platform !== "win32") if (launchWithNode) {
1772
+ if (process$3.platform !== "win32") if (launchWithNode) {
1773
1773
  args.unshift(executableFile);
1774
- args = incrementNodeInspectorPort(process$4.execArgv).concat(args);
1775
- proc$1 = childProcess$1.spawn(process$4.argv[0], args, { stdio: "inherit" });
1774
+ args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
1775
+ proc$1 = childProcess$1.spawn(process$3.argv[0], args, { stdio: "inherit" });
1776
1776
  } else proc$1 = childProcess$1.spawn(executableFile, args, { stdio: "inherit" });
1777
1777
  else {
1778
1778
  args.unshift(executableFile);
1779
- args = incrementNodeInspectorPort(process$4.execArgv).concat(args);
1780
- proc$1 = childProcess$1.spawn(process$4.execPath, args, { stdio: "inherit" });
1779
+ args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
1780
+ proc$1 = childProcess$1.spawn(process$3.execPath, args, { stdio: "inherit" });
1781
1781
  }
1782
1782
  if (!proc$1.killed) [
1783
1783
  "SIGUSR1",
@@ -1786,14 +1786,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
1786
1786
  "SIGINT",
1787
1787
  "SIGHUP"
1788
1788
  ].forEach((signal) => {
1789
- process$4.on(signal, () => {
1789
+ process$3.on(signal, () => {
1790
1790
  if (proc$1.killed === false && proc$1.exitCode === null) proc$1.kill(signal);
1791
1791
  });
1792
1792
  });
1793
1793
  const exitCallback = this._exitCallback;
1794
1794
  proc$1.on("close", (code$1) => {
1795
1795
  code$1 = code$1 ?? 1;
1796
- if (!exitCallback) process$4.exit(code$1);
1796
+ if (!exitCallback) process$3.exit(code$1);
1797
1797
  else exitCallback(new CommanderError(code$1, "commander.executeSubCommandAsync", "(close)"));
1798
1798
  });
1799
1799
  proc$1.on("error", (err) => {
@@ -1805,7 +1805,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1805
1805
  - ${executableDirMessage}`;
1806
1806
  throw new Error(executableMissing);
1807
1807
  } else if (err.code === "EACCES") throw new Error(`'${executableFile}' not executable`);
1808
- if (!exitCallback) process$4.exit(1);
1808
+ if (!exitCallback) process$3.exit(1);
1809
1809
  else {
1810
1810
  const wrappedError = new CommanderError(1, "commander.executeSubCommandAsync", "(error)");
1811
1811
  wrappedError.nestedError = err;
@@ -2211,13 +2211,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
2211
2211
  */
2212
2212
  _parseOptionsEnv() {
2213
2213
  this.options.forEach((option) => {
2214
- if (option.envVar && option.envVar in process$4.env) {
2214
+ if (option.envVar && option.envVar in process$3.env) {
2215
2215
  const optionKey = option.attributeName();
2216
2216
  if (this.getOptionValue(optionKey) === void 0 || [
2217
2217
  "default",
2218
2218
  "config",
2219
2219
  "env"
2220
- ].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$4.env[option.envVar]);
2220
+ ].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$3.env[option.envVar]);
2221
2221
  else this.emit(`optionEnv:${option.name()}`);
2222
2222
  }
2223
2223
  });
@@ -2596,7 +2596,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2596
2596
  */
2597
2597
  help(contextOptions) {
2598
2598
  this.outputHelp(contextOptions);
2599
- let exitCode = process$4.exitCode || 0;
2599
+ let exitCode = process$3.exitCode || 0;
2600
2600
  if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) exitCode = 1;
2601
2601
  this._exit(exitCode, "commander.help", "(outputHelp)");
2602
2602
  }
@@ -2712,16 +2712,16 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2712
2712
  const CSI = `${ESC}[`;
2713
2713
  const beep = "\x07";
2714
2714
  const cursor = {
2715
- to(x$2, y$1) {
2716
- if (!y$1) return `${CSI}${x$2 + 1}G`;
2717
- return `${CSI}${y$1 + 1};${x$2 + 1}H`;
2715
+ to(x$2, y$2) {
2716
+ if (!y$2) return `${CSI}${x$2 + 1}G`;
2717
+ return `${CSI}${y$2 + 1};${x$2 + 1}H`;
2718
2718
  },
2719
- move(x$2, y$1) {
2719
+ move(x$2, y$2) {
2720
2720
  let ret = "";
2721
2721
  if (x$2 < 0) ret += `${CSI}${-x$2}D`;
2722
2722
  else if (x$2 > 0) ret += `${CSI}${x$2}C`;
2723
- if (y$1 < 0) ret += `${CSI}${-y$1}A`;
2724
- else if (y$1 > 0) ret += `${CSI}${y$1}B`;
2723
+ if (y$2 < 0) ret += `${CSI}${-y$2}A`;
2724
+ else if (y$2 > 0) ret += `${CSI}${y$2}B`;
2725
2725
  return ret;
2726
2726
  },
2727
2727
  up: (count$1 = 1) => `${CSI}${count$1}A`,
@@ -3031,13 +3031,13 @@ function rD() {
3031
3031
  }
3032
3032
  }), r;
3033
3033
  }
3034
- const ED = rD(), d$1 = new Set(["\x1B", "›"]), oD = 39, y = "\x07", V$1 = "[", nD = "]", G$1 = "m", _$1 = `${nD}8;;`, z = (e$1) => `${d$1.values().next().value}${V$1}${e$1}${G$1}`, K$1 = (e$1) => `${d$1.values().next().value}${_$1}${e$1}${y}`, aD = (e$1) => e$1.split(" ").map((u$2) => p(u$2)), k$1 = (e$1, u$2, t) => {
3034
+ const ED = rD(), d$1 = new Set(["\x1B", "›"]), oD = 39, y$1 = "\x07", V$1 = "[", nD = "]", G$1 = "m", _$1 = `${nD}8;;`, z = (e$1) => `${d$1.values().next().value}${V$1}${e$1}${G$1}`, K$1 = (e$1) => `${d$1.values().next().value}${_$1}${e$1}${y$1}`, aD = (e$1) => e$1.split(" ").map((u$2) => p(u$2)), k$1 = (e$1, u$2, t) => {
3035
3035
  const F$1 = [...u$2];
3036
3036
  let s = !1, i$1 = !1, D$1 = p(P$1(e$1[e$1.length - 1]));
3037
3037
  for (const [C$1, n$1] of F$1.entries()) {
3038
3038
  const E = p(n$1);
3039
3039
  if (D$1 + E <= t ? e$1[e$1.length - 1] += n$1 : (e$1.push(n$1), D$1 = 0), d$1.has(n$1) && (s = !0, i$1 = F$1.slice(C$1 + 1).join("").startsWith(_$1)), s) {
3040
- i$1 ? n$1 === y && (s = !1, i$1 = !1) : n$1 === G$1 && (s = !1);
3040
+ i$1 ? n$1 === y$1 && (s = !1, i$1 = !1) : n$1 === G$1 && (s = !1);
3041
3041
  continue;
3042
3042
  }
3043
3043
  D$1 += E, D$1 === t && C$1 < F$1.length - 1 && (e$1.push(""), D$1 = 0);
@@ -3079,7 +3079,7 @@ const ED = rD(), d$1 = new Set(["\x1B", "›"]), oD = 39, y = "\x07", V$1 = "[",
3079
3079
  `)];
3080
3080
  for (const [E, a$1] of n$1.entries()) {
3081
3081
  if (F$1 += a$1, d$1.has(a$1)) {
3082
- const { groups: c$1 } = (/* @__PURE__ */ new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y})`)).exec(n$1.slice(E).join("")) || { groups: {} };
3082
+ const { groups: c$1 } = (/* @__PURE__ */ new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y$1})`)).exec(n$1.slice(E).join("")) || { groups: {} };
3083
3083
  if (c$1.code !== void 0) {
3084
3084
  const f = Number.parseFloat(c$1.code);
3085
3085
  s = f === oD ? void 0 : f;
@@ -3480,7 +3480,7 @@ var RD = class extends x$1 {
3480
3480
  //#endregion
3481
3481
  //#region node_modules/@clack/prompts/dist/index.mjs
3482
3482
  function ce() {
3483
- return process$1.platform !== "win32" ? process$1.env.TERM !== "linux" : !!process$1.env.CI || !!process$1.env.WT_SESSION || !!process$1.env.TERMINUS_SUBLIME || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
3483
+ return y.platform !== "win32" ? y.env.TERM !== "linux" : !!y.env.CI || !!y.env.WT_SESSION || !!y.env.TERMINUS_SUBLIME || y.env.ConEmuTask === "{cmd::Cmder}" || y.env.TERM_PROGRAM === "Terminus-Sublime" || y.env.TERM_PROGRAM === "vscode" || y.env.TERM === "xterm-256color" || y.env.TERM === "alacritty" || y.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
3484
3484
  }
3485
3485
  const V = ce(), u$1 = (t, n$1) => V ? t : n$1, le = u$1("◆", "*"), L = u$1("■", "x"), W = u$1("▲", "x"), C = u$1("◇", "o"), ue = u$1("┌", "T"), o$1 = u$1("│", "|"), d = u$1("└", "—"), k = u$1("●", ">"), P = u$1("○", " "), A = u$1("◻", "[•]"), T = u$1("◼", "[+]"), F = u$1("◻", "[ ]"), $e = u$1("▪", "•"), _ = u$1("─", "-"), me = u$1("╮", "+"), de = u$1("├", "+"), pe = u$1("╯", "+"), q = u$1("●", "•"), D = u$1("◆", "*"), U = u$1("▲", "!"), K = u$1("■", "x"), b = (t) => {
3486
3486
  switch (t) {
@@ -6628,7 +6628,7 @@ function initializeContext(params) {
6628
6628
  external: params?.external ?? void 0
6629
6629
  };
6630
6630
  }
6631
- function process$3(schema, ctx, _params = {
6631
+ function process$2(schema, ctx, _params = {
6632
6632
  path: [],
6633
6633
  schemaPath: []
6634
6634
  }) {
@@ -6665,7 +6665,7 @@ function process$3(schema, ctx, _params = {
6665
6665
  const parent = schema._zod.parent;
6666
6666
  if (parent) {
6667
6667
  if (!result.ref) result.ref = parent;
6668
- process$3(parent, ctx, params);
6668
+ process$2(parent, ctx, params);
6669
6669
  ctx.seen.get(parent).isParent = true;
6670
6670
  }
6671
6671
  }
@@ -6877,7 +6877,7 @@ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
6877
6877
  ...params,
6878
6878
  processors
6879
6879
  });
6880
- process$3(schema, ctx);
6880
+ process$2(schema, ctx);
6881
6881
  extractDefs(ctx, schema);
6882
6882
  return finalize(ctx, schema);
6883
6883
  };
@@ -6889,7 +6889,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
6889
6889
  io,
6890
6890
  processors
6891
6891
  });
6892
- process$3(schema, ctx);
6892
+ process$2(schema, ctx);
6893
6893
  extractDefs(ctx, schema);
6894
6894
  return finalize(ctx, schema);
6895
6895
  };
@@ -6973,7 +6973,7 @@ const arrayProcessor = (schema, ctx, _json, params) => {
6973
6973
  if (typeof minimum === "number") json.minItems = minimum;
6974
6974
  if (typeof maximum === "number") json.maxItems = maximum;
6975
6975
  json.type = "array";
6976
- json.items = process$3(def.element, ctx, {
6976
+ json.items = process$2(def.element, ctx, {
6977
6977
  ...params,
6978
6978
  path: [...params.path, "items"]
6979
6979
  });
@@ -6984,7 +6984,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
6984
6984
  json.type = "object";
6985
6985
  json.properties = {};
6986
6986
  const shape = def.shape;
6987
- for (const key in shape) json.properties[key] = process$3(shape[key], ctx, {
6987
+ for (const key in shape) json.properties[key] = process$2(shape[key], ctx, {
6988
6988
  ...params,
6989
6989
  path: [
6990
6990
  ...params.path,
@@ -7002,7 +7002,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
7002
7002
  if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
7003
7003
  else if (!def.catchall) {
7004
7004
  if (ctx.io === "output") json.additionalProperties = false;
7005
- } else if (def.catchall) json.additionalProperties = process$3(def.catchall, ctx, {
7005
+ } else if (def.catchall) json.additionalProperties = process$2(def.catchall, ctx, {
7006
7006
  ...params,
7007
7007
  path: [...params.path, "additionalProperties"]
7008
7008
  });
@@ -7010,7 +7010,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
7010
7010
  const unionProcessor = (schema, ctx, json, params) => {
7011
7011
  const def = schema._zod.def;
7012
7012
  const isExclusive = def.inclusive === false;
7013
- const options = def.options.map((x$2, i$1) => process$3(x$2, ctx, {
7013
+ const options = def.options.map((x$2, i$1) => process$2(x$2, ctx, {
7014
7014
  ...params,
7015
7015
  path: [
7016
7016
  ...params.path,
@@ -7023,7 +7023,7 @@ const unionProcessor = (schema, ctx, json, params) => {
7023
7023
  };
7024
7024
  const intersectionProcessor = (schema, ctx, json, params) => {
7025
7025
  const def = schema._zod.def;
7026
- const a$1 = process$3(def.left, ctx, {
7026
+ const a$1 = process$2(def.left, ctx, {
7027
7027
  ...params,
7028
7028
  path: [
7029
7029
  ...params.path,
@@ -7031,7 +7031,7 @@ const intersectionProcessor = (schema, ctx, json, params) => {
7031
7031
  0
7032
7032
  ]
7033
7033
  });
7034
- const b$2 = process$3(def.right, ctx, {
7034
+ const b$2 = process$2(def.right, ctx, {
7035
7035
  ...params,
7036
7036
  path: [
7037
7037
  ...params.path,
@@ -7048,7 +7048,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7048
7048
  json.type = "array";
7049
7049
  const prefixPath$1 = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
7050
7050
  const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
7051
- const prefixItems = def.items.map((x$2, i$1) => process$3(x$2, ctx, {
7051
+ const prefixItems = def.items.map((x$2, i$1) => process$2(x$2, ctx, {
7052
7052
  ...params,
7053
7053
  path: [
7054
7054
  ...params.path,
@@ -7056,7 +7056,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7056
7056
  i$1
7057
7057
  ]
7058
7058
  }));
7059
- const rest = def.rest ? process$3(def.rest, ctx, {
7059
+ const rest = def.rest ? process$2(def.rest, ctx, {
7060
7060
  ...params,
7061
7061
  path: [
7062
7062
  ...params.path,
@@ -7082,7 +7082,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7082
7082
  };
7083
7083
  const nullableProcessor = (schema, ctx, json, params) => {
7084
7084
  const def = schema._zod.def;
7085
- const inner = process$3(def.innerType, ctx, params);
7085
+ const inner = process$2(def.innerType, ctx, params);
7086
7086
  const seen = ctx.seen.get(schema);
7087
7087
  if (ctx.target === "openapi-3.0") {
7088
7088
  seen.ref = def.innerType;
@@ -7091,27 +7091,27 @@ const nullableProcessor = (schema, ctx, json, params) => {
7091
7091
  };
7092
7092
  const nonoptionalProcessor = (schema, ctx, _json, params) => {
7093
7093
  const def = schema._zod.def;
7094
- process$3(def.innerType, ctx, params);
7094
+ process$2(def.innerType, ctx, params);
7095
7095
  const seen = ctx.seen.get(schema);
7096
7096
  seen.ref = def.innerType;
7097
7097
  };
7098
7098
  const defaultProcessor = (schema, ctx, json, params) => {
7099
7099
  const def = schema._zod.def;
7100
- process$3(def.innerType, ctx, params);
7100
+ process$2(def.innerType, ctx, params);
7101
7101
  const seen = ctx.seen.get(schema);
7102
7102
  seen.ref = def.innerType;
7103
7103
  json.default = JSON.parse(JSON.stringify(def.defaultValue));
7104
7104
  };
7105
7105
  const prefaultProcessor = (schema, ctx, json, params) => {
7106
7106
  const def = schema._zod.def;
7107
- process$3(def.innerType, ctx, params);
7107
+ process$2(def.innerType, ctx, params);
7108
7108
  const seen = ctx.seen.get(schema);
7109
7109
  seen.ref = def.innerType;
7110
7110
  if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
7111
7111
  };
7112
7112
  const catchProcessor = (schema, ctx, json, params) => {
7113
7113
  const def = schema._zod.def;
7114
- process$3(def.innerType, ctx, params);
7114
+ process$2(def.innerType, ctx, params);
7115
7115
  const seen = ctx.seen.get(schema);
7116
7116
  seen.ref = def.innerType;
7117
7117
  let catchValue;
@@ -7125,20 +7125,20 @@ const catchProcessor = (schema, ctx, json, params) => {
7125
7125
  const pipeProcessor = (schema, ctx, _json, params) => {
7126
7126
  const def = schema._zod.def;
7127
7127
  const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
7128
- process$3(innerType, ctx, params);
7128
+ process$2(innerType, ctx, params);
7129
7129
  const seen = ctx.seen.get(schema);
7130
7130
  seen.ref = innerType;
7131
7131
  };
7132
7132
  const readonlyProcessor = (schema, ctx, json, params) => {
7133
7133
  const def = schema._zod.def;
7134
- process$3(def.innerType, ctx, params);
7134
+ process$2(def.innerType, ctx, params);
7135
7135
  const seen = ctx.seen.get(schema);
7136
7136
  seen.ref = def.innerType;
7137
7137
  json.readOnly = true;
7138
7138
  };
7139
7139
  const optionalProcessor = (schema, ctx, _json, params) => {
7140
7140
  const def = schema._zod.def;
7141
- process$3(def.innerType, ctx, params);
7141
+ process$2(def.innerType, ctx, params);
7142
7142
  const seen = ctx.seen.get(schema);
7143
7143
  seen.ref = def.innerType;
7144
7144
  };
@@ -15371,7 +15371,7 @@ const createIgnorePredicate = (patterns, cwd, baseDir) => {
15371
15371
  };
15372
15372
  const normalizeOptions$2 = (options = {}) => {
15373
15373
  const ignoreOption = options.ignore ? Array.isArray(options.ignore) ? options.ignore : [options.ignore] : [];
15374
- const cwd = toPath$1(options.cwd) ?? process$1.cwd();
15374
+ const cwd = toPath$1(options.cwd) ?? y.cwd();
15375
15375
  const deep = typeof options.deep === "number" ? Math.max(0, options.deep) + 1 : Number.POSITIVE_INFINITY;
15376
15376
  return {
15377
15377
  cwd,
@@ -15468,7 +15468,7 @@ const getDirectoryGlob = ({ directoryPath, files, extensions }) => {
15468
15468
  const extensionGlob = extensions?.length > 0 ? `.${extensions.length > 1 ? `{${extensions.join(",")}}` : extensions[0]}` : "";
15469
15469
  return files ? files.map((file) => path.posix.join(directoryPath, `**/${path.extname(file) ? file : `${file}${extensionGlob}`}`)) : [path.posix.join(directoryPath, `**${extensionGlob ? `/*${extensionGlob}` : ""}`)];
15470
15470
  };
15471
- const directoryToGlob = async (directoryPaths, { cwd = process$1.cwd(), files, extensions, fs: fsImplementation } = {}) => {
15471
+ const directoryToGlob = async (directoryPaths, { cwd = y.cwd(), files, extensions, fs: fsImplementation } = {}) => {
15472
15472
  return (await Promise.all(directoryPaths.map(async (directoryPath) => {
15473
15473
  if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
15474
15474
  directoryPath,
@@ -15482,7 +15482,7 @@ const directoryToGlob = async (directoryPaths, { cwd = process$1.cwd(), files, e
15482
15482
  }) : directoryPath;
15483
15483
  }))).flat();
15484
15484
  };
15485
- const directoryToGlobSync = (directoryPaths, { cwd = process$1.cwd(), files, extensions, fs: fsImplementation } = {}) => directoryPaths.flatMap((directoryPath) => {
15485
+ const directoryToGlobSync = (directoryPaths, { cwd = y.cwd(), files, extensions, fs: fsImplementation } = {}) => directoryPaths.flatMap((directoryPath) => {
15486
15486
  if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
15487
15487
  directoryPath,
15488
15488
  files,
@@ -15578,7 +15578,7 @@ const applyIgnoreFilesAndGetFilterSync = (options) => {
15578
15578
  };
15579
15579
  const createFilterFunction = (isIgnored, cwd) => {
15580
15580
  const seen = /* @__PURE__ */ new Set();
15581
- const basePath = cwd || process$1.cwd();
15581
+ const basePath = cwd || y.cwd();
15582
15582
  const pathCache = /* @__PURE__ */ new Map();
15583
15583
  return (fastGlobResult) => {
15584
15584
  const pathKey$1 = path.normalize(fastGlobResult.path ?? fastGlobResult);
@@ -16832,7 +16832,7 @@ async function deployFunctions(functions) {
16832
16832
  const payload = { functions: functions.map(toDeployPayloadItem) };
16833
16833
  const response = await appClient.put("backend-functions", {
16834
16834
  json: payload,
16835
- timeout: 3e4
16835
+ timeout: 12e4
16836
16836
  });
16837
16837
  return DeployFunctionsResponseSchema.parse(await response.json());
16838
16838
  }
@@ -25532,6 +25532,27 @@ async function createProjectFiles(options) {
25532
25532
  };
25533
25533
  }
25534
25534
 
25535
+ //#endregion
25536
+ //#region src/core/project/env.ts
25537
+ const ENV_LOCAL_TEMPLATE = `# Base44 Project Environment Variables
25538
+ # This file contains environment-specific configuration for your Base44 project.
25539
+ # Do not commit this file to version control if it contains sensitive data.
25540
+
25541
+ # Your Base44 Application ID
25542
+ BASE44_CLIENT_ID={{projectId}}
25543
+ `;
25544
+ function generateEnvLocalContent(projectId) {
25545
+ return ENV_LOCAL_TEMPLATE.replace("{{projectId}}", projectId);
25546
+ }
25547
+ async function writeEnvLocal(projectRoot, projectId) {
25548
+ const envPath = getProjectEnvPath(projectRoot);
25549
+ await writeFile$1(envPath, generateEnvLocalContent(projectId));
25550
+ return envPath;
25551
+ }
25552
+ async function envLocalExists(projectRoot) {
25553
+ return pathExists(getProjectEnvPath(projectRoot));
25554
+ }
25555
+
25535
25556
  //#endregion
25536
25557
  //#region src/core/config.ts
25537
25558
  const __dirname$1 = dirname(fileURLToPath(import.meta.url));
@@ -25547,6 +25568,9 @@ function getTemplatesDir() {
25547
25568
  function getTemplatesIndexPath() {
25548
25569
  return join(getTemplatesDir(), "templates.json");
25549
25570
  }
25571
+ function getProjectEnvPath(projectRoot) {
25572
+ return join(projectRoot, PROJECT_SUBDIR, ".env.local");
25573
+ }
25550
25574
  /**
25551
25575
  * Load .env.local from the project root if it exists.
25552
25576
  * Values won't override existing process.env variables.
@@ -25555,7 +25579,7 @@ async function loadProjectEnv(projectRoot) {
25555
25579
  const found = projectRoot ? { root: projectRoot } : await findProjectRoot();
25556
25580
  if (!found) return;
25557
25581
  (0, import_main.config)({
25558
- path: join(found.root, PROJECT_SUBDIR, ".env.local"),
25582
+ path: getProjectEnvPath(found.root),
25559
25583
  override: false,
25560
25584
  quiet: true
25561
25585
  });
@@ -25958,13 +25982,13 @@ var ansi_styles_default = ansiStyles;
25958
25982
 
25959
25983
  //#endregion
25960
25984
  //#region node_modules/chalk/source/vendor/supports-color/index.js
25961
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process$1.argv) {
25985
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : y.argv) {
25962
25986
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
25963
25987
  const position = argv.indexOf(prefix + flag);
25964
25988
  const terminatorPosition = argv.indexOf("--");
25965
25989
  return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
25966
25990
  }
25967
- const { env } = process$1;
25991
+ const { env } = y;
25968
25992
  let flagForceColor;
25969
25993
  if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
25970
25994
  else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
@@ -25997,7 +26021,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
25997
26021
  if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
25998
26022
  const min = forceColor || 0;
25999
26023
  if (env.TERM === "dumb") return min;
26000
- if (process$1.platform === "win32") {
26024
+ if (y.platform === "win32") {
26001
26025
  const osRelease = os.release().split(".");
26002
26026
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
26003
26027
  return 1;
@@ -31120,8 +31144,8 @@ var Unpack = class extends Parser {
31120
31144
  case "GNUDumpDir": return this[DIRECTORY](entry, done);
31121
31145
  }
31122
31146
  }
31123
- [LINK](entry, linkpath, link, done) {
31124
- fs[link](linkpath, String(entry.absolute), (er) => {
31147
+ [LINK](entry, linkpath, link$1, done) {
31148
+ fs[link$1](linkpath, String(entry.absolute), (er) => {
31125
31149
  if (er) this[ONERROR](er, entry);
31126
31150
  else {
31127
31151
  this[UNPEND]();
@@ -31268,8 +31292,8 @@ var UnpackSync = class extends Unpack {
31268
31292
  return er;
31269
31293
  }
31270
31294
  }
31271
- [LINK](entry, linkpath, link, done) {
31272
- const ls = `${link}Sync`;
31295
+ [LINK](entry, linkpath, link$1, done) {
31296
+ const ls = `${link$1}Sync`;
31273
31297
  try {
31274
31298
  fs[ls](linkpath, String(entry.absolute));
31275
31299
  done();
@@ -31709,9 +31733,9 @@ const getSubprocessResult = ({ stdout: stdout$1 }) => {
31709
31733
  //#region node_modules/execa/lib/utils/standard-stream.js
31710
31734
  const isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
31711
31735
  const STANDARD_STREAMS = [
31712
- process$1.stdin,
31713
- process$1.stdout,
31714
- process$1.stderr
31736
+ y.stdin,
31737
+ y.stdout,
31738
+ y.stderr
31715
31739
  ];
31716
31740
  const STANDARD_STREAMS_ALIASES = [
31717
31741
  "stdin",
@@ -31836,9 +31860,9 @@ const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
31836
31860
  //#endregion
31837
31861
  //#region node_modules/is-unicode-supported/index.js
31838
31862
  function isUnicodeSupported() {
31839
- const { env: env$1 } = process$1;
31863
+ const { env: env$1 } = y;
31840
31864
  const { TERM, TERM_PROGRAM } = env$1;
31841
- if (process$1.platform !== "win32") return TERM !== "linux";
31865
+ if (y.platform !== "win32") return TERM !== "linux";
31842
31866
  return Boolean(env$1.WT_SESSION) || Boolean(env$1.TERMINUS_SUBLIME) || env$1.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env$1.TERMINAL_EMULATOR === "JetBrains-JediTerm";
31843
31867
  }
31844
31868
 
@@ -32765,7 +32789,7 @@ const TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
32765
32789
 
32766
32790
  //#endregion
32767
32791
  //#region node_modules/npm-run-path/index.js
32768
- const npmRunPath = ({ cwd = process$1.cwd(), path: pathOption = process$1.env[pathKey()], preferLocal = true, execPath: execPath$1 = process$1.execPath, addExecPath = true } = {}) => {
32792
+ const npmRunPath = ({ cwd = y.cwd(), path: pathOption = y.env[pathKey()], preferLocal = true, execPath: execPath$1 = y.execPath, addExecPath = true } = {}) => {
32769
32793
  const cwdPath = path.resolve(toPath(cwd));
32770
32794
  const result = [];
32771
32795
  const pathParts = pathOption.split(path.delimiter);
@@ -32783,7 +32807,7 @@ const applyExecPath = (result, pathParts, execPath$1, cwdPath) => {
32783
32807
  const pathPart = path.resolve(cwdPath, toPath(execPath$1), "..");
32784
32808
  if (!pathParts.includes(pathPart)) result.push(pathPart);
32785
32809
  };
32786
- const npmRunPathEnv = ({ env: env$1 = process$1.env, ...options } = {}) => {
32810
+ const npmRunPathEnv = ({ env: env$1 = y.env, ...options } = {}) => {
32787
32811
  env$1 = { ...env$1 };
32788
32812
  const pathName = pathKey({ env: env$1 });
32789
32813
  options.path = env$1[pathName];
@@ -33918,7 +33942,7 @@ const normalizeCwd = (cwd = getDefaultCwd()) => {
33918
33942
  };
33919
33943
  const getDefaultCwd = () => {
33920
33944
  try {
33921
- return process$1.cwd();
33945
+ return y.cwd();
33922
33946
  } catch (error) {
33923
33947
  error.message = `The current directory does not exist.\n${error.message}`;
33924
33948
  throw error;
@@ -33953,7 +33977,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
33953
33977
  options.killSignal = normalizeKillSignal(options.killSignal);
33954
33978
  options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
33955
33979
  options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
33956
- if (process$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
33980
+ if (y.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
33957
33981
  return {
33958
33982
  file,
33959
33983
  commandArguments,
@@ -33980,7 +34004,7 @@ const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDi
33980
34004
  });
33981
34005
  const getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
33982
34006
  const env$1 = extendEnv ? {
33983
- ...process$1.env,
34007
+ ...y.env,
33984
34008
  ...envOption
33985
34009
  } : envOption;
33986
34010
  if (preferLocal || node) return npmRunPathEnv({
@@ -34980,12 +35004,12 @@ const guessStreamDirection = {
34980
35004
  }
34981
35005
  };
34982
35006
  const getStandardStreamDirection = (value) => {
34983
- if ([0, process$1.stdin].includes(value)) return "input";
35007
+ if ([0, y.stdin].includes(value)) return "input";
34984
35008
  if ([
34985
35009
  1,
34986
35010
  2,
34987
- process$1.stdout,
34988
- process$1.stderr
35011
+ y.stdout,
35012
+ y.stderr
34989
35013
  ].includes(value)) return "output";
34990
35014
  };
34991
35015
  const DEFAULT_DIRECTION = "output";
@@ -36049,9 +36073,9 @@ const addIpcMethods = (subprocess, { ipc }) => {
36049
36073
  Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
36050
36074
  };
36051
36075
  const getIpcExport = () => {
36052
- const anyProcess = process$1;
36076
+ const anyProcess = y;
36053
36077
  const isSubprocess = true;
36054
- const ipc = process$1.channel !== void 0;
36078
+ const ipc = y.channel !== void 0;
36055
36079
  return {
36056
36080
  ...getIpcMethods(anyProcess, isSubprocess, ipc),
36057
36081
  getCancelSignal: getCancelSignal$1.bind(void 0, {
@@ -36293,7 +36317,7 @@ if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SI
36293
36317
 
36294
36318
  //#endregion
36295
36319
  //#region node_modules/signal-exit/dist/mjs/index.js
36296
- const processOk = (process$5) => !!process$5 && typeof process$5 === "object" && typeof process$5.removeListener === "function" && typeof process$5.emit === "function" && typeof process$5.reallyExit === "function" && typeof process$5.listeners === "function" && typeof process$5.kill === "function" && typeof process$5.pid === "number" && typeof process$5.on === "function";
36320
+ const processOk = (process$4) => !!process$4 && typeof process$4 === "object" && typeof process$4.removeListener === "function" && typeof process$4.emit === "function" && typeof process$4.reallyExit === "function" && typeof process$4.listeners === "function" && typeof process$4.kill === "function" && typeof process$4.pid === "number" && typeof process$4.on === "function";
36297
36321
  const kExitEmitter = Symbol.for("signal-exit emitter");
36298
36322
  const global$1 = globalThis;
36299
36323
  const ObjectDefineProperty = Object.defineProperty.bind(Object);
@@ -36361,7 +36385,7 @@ var SignalExitFallback = class extends SignalExitBase {
36361
36385
  };
36362
36386
  var SignalExit = class extends SignalExitBase {
36363
36387
  /* c8 ignore start */
36364
- #hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
36388
+ #hupSig = process$1.platform === "win32" ? "SIGINT" : "SIGHUP";
36365
36389
  /* c8 ignore stop */
36366
36390
  #emitter = new Emitter();
36367
36391
  #process;
@@ -36369,15 +36393,15 @@ var SignalExit = class extends SignalExitBase {
36369
36393
  #originalProcessReallyExit;
36370
36394
  #sigListeners = {};
36371
36395
  #loaded = false;
36372
- constructor(process$5) {
36396
+ constructor(process$4) {
36373
36397
  super();
36374
- this.#process = process$5;
36398
+ this.#process = process$4;
36375
36399
  this.#sigListeners = {};
36376
36400
  for (const sig of signals) this.#sigListeners[sig] = () => {
36377
36401
  const listeners = this.#process.listeners(sig);
36378
36402
  let { count: count$1 } = this.#emitter;
36379
36403
  /* c8 ignore start */
36380
- const p$1 = process$5;
36404
+ const p$1 = process$4;
36381
36405
  if (typeof p$1.__signal_exit_emitter__ === "object" && typeof p$1.__signal_exit_emitter__.count === "number") count$1 += p$1.__signal_exit_emitter__.count;
36382
36406
  /* c8 ignore stop */
36383
36407
  if (listeners.length === count$1) {
@@ -36385,11 +36409,11 @@ var SignalExit = class extends SignalExitBase {
36385
36409
  const ret = this.#emitter.emit("exit", null, sig);
36386
36410
  /* c8 ignore start */
36387
36411
  const s = sig === "SIGHUP" ? this.#hupSig : sig;
36388
- if (!ret) process$5.kill(process$5.pid, s);
36412
+ if (!ret) process$4.kill(process$4.pid, s);
36389
36413
  }
36390
36414
  };
36391
- this.#originalProcessReallyExit = process$5.reallyExit;
36392
- this.#originalProcessEmit = process$5.emit;
36415
+ this.#originalProcessReallyExit = process$4.reallyExit;
36416
+ this.#originalProcessEmit = process$4.emit;
36393
36417
  }
36394
36418
  onExit(cb, opts) {
36395
36419
  /* c8 ignore start */
@@ -36456,8 +36480,8 @@ var SignalExit = class extends SignalExitBase {
36456
36480
  } else return og.call(this.#process, ev, ...args);
36457
36481
  }
36458
36482
  };
36459
- const process$2 = globalThis.process;
36460
- const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
36483
+ const process$1 = globalThis.process;
36484
+ const { onExit, load, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
36461
36485
 
36462
36486
  //#endregion
36463
36487
  //#region node_modules/execa/lib/terminate/cleanup.js
@@ -38213,7 +38237,7 @@ async function getDefaultTemplate() {
38213
38237
  if (!template) throw new Error(`Default template "${DEFAULT_TEMPLATE_ID}" not found`);
38214
38238
  return template;
38215
38239
  }
38216
- function validateNonInteractiveFlags(command) {
38240
+ function validateNonInteractiveFlags$1(command) {
38217
38241
  const { name: name$1, path: path$17 } = command.opts();
38218
38242
  const providedCount = [name$1, path$17].filter(Boolean).length;
38219
38243
  if (providedCount > 0 && providedCount < 2) command.error("Non-interactive mode requires all flags: --name, --path");
@@ -38338,7 +38362,7 @@ async function executeCreate({ template, name: rawName, description, projectPath
38338
38362
  if (finalAppUrl) M.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
38339
38363
  return { outroMessage: "Your project is set up and ready to use" };
38340
38364
  }
38341
- 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("--deploy", "Build and deploy the site").hook("preAction", validateNonInteractiveFlags).action(async (options) => {
38365
+ 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("--deploy", "Build and deploy the site").hook("preAction", validateNonInteractiveFlags$1).action(async (options) => {
38342
38366
  await chooseCreate(options);
38343
38367
  });
38344
38368
 
@@ -38384,7 +38408,7 @@ function isInsideContainer() {
38384
38408
  //#endregion
38385
38409
  //#region node_modules/is-wsl/index.js
38386
38410
  const isWsl = () => {
38387
- if (process$1.platform !== "linux") return false;
38411
+ if (y.platform !== "linux") return false;
38388
38412
  if (os.release().toLowerCase().includes("microsoft")) {
38389
38413
  if (isInsideContainer()) return false;
38390
38414
  return true;
@@ -38395,12 +38419,12 @@ const isWsl = () => {
38395
38419
  return false;
38396
38420
  }
38397
38421
  };
38398
- var is_wsl_default = process$1.env.__IS_WSL_TEST__ ? isWsl : isWsl();
38422
+ var is_wsl_default = y.env.__IS_WSL_TEST__ ? isWsl : isWsl();
38399
38423
 
38400
38424
  //#endregion
38401
38425
  //#region node_modules/powershell-utils/index.js
38402
38426
  const execFile$2 = promisify(childProcess.execFile);
38403
- const powerShellPath$1 = () => `${process$1.env.SYSTEMROOT || process$1.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
38427
+ const powerShellPath$1 = () => `${y.env.SYSTEMROOT || y.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
38404
38428
  const executePowerShell = async (command, options = {}) => {
38405
38429
  const { powerShellPath: psPath, ...execFileOptions } = options;
38406
38430
  const encodedCommand = executePowerShell.encodeCommand(command);
@@ -38511,7 +38535,7 @@ function defineLazyProperty(object$1, propertyName, valueGetter) {
38511
38535
  //#region node_modules/default-browser-id/index.js
38512
38536
  const execFileAsync$3 = promisify(execFile);
38513
38537
  async function defaultBrowserId() {
38514
- if (process$1.platform !== "darwin") throw new Error("macOS only");
38538
+ if (y.platform !== "darwin") throw new Error("macOS only");
38515
38539
  const { stdout: stdout$1 } = await execFileAsync$3("defaults", [
38516
38540
  "read",
38517
38541
  "com.apple.LaunchServices/com.apple.launchservices.secure",
@@ -38526,7 +38550,7 @@ async function defaultBrowserId() {
38526
38550
  //#region node_modules/run-applescript/index.js
38527
38551
  const execFileAsync$2 = promisify(execFile);
38528
38552
  async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
38529
- if (process$1.platform !== "darwin") throw new Error("macOS only");
38553
+ if (y.platform !== "darwin") throw new Error("macOS only");
38530
38554
  const outputArguments = humanReadableOutput ? [] : ["-ss"];
38531
38555
  const execOptions = {};
38532
38556
  if (signal) execOptions.signal = signal;
@@ -38635,14 +38659,14 @@ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
38635
38659
  const execFileAsync = promisify(execFile);
38636
38660
  const titleize = (string$2) => string$2.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x$2) => x$2.toUpperCase());
38637
38661
  async function defaultBrowser() {
38638
- if (process$1.platform === "darwin") {
38662
+ if (y.platform === "darwin") {
38639
38663
  const id = await defaultBrowserId();
38640
38664
  return {
38641
38665
  name: await bundleName(id),
38642
38666
  id
38643
38667
  };
38644
38668
  }
38645
- if (process$1.platform === "linux") {
38669
+ if (y.platform === "linux") {
38646
38670
  const { stdout: stdout$1 } = await execFileAsync("xdg-mime", [
38647
38671
  "query",
38648
38672
  "default",
@@ -38654,13 +38678,13 @@ async function defaultBrowser() {
38654
38678
  id
38655
38679
  };
38656
38680
  }
38657
- if (process$1.platform === "win32") return defaultBrowser$1();
38681
+ if (y.platform === "win32") return defaultBrowser$1();
38658
38682
  throw new Error("Only macOS, Linux, and Windows are supported");
38659
38683
  }
38660
38684
 
38661
38685
  //#endregion
38662
38686
  //#region node_modules/is-in-ssh/index.js
38663
- const isInSsh = Boolean(process$1.env.SSH_CONNECTION || process$1.env.SSH_CLIENT || process$1.env.SSH_TTY);
38687
+ const isInSsh = Boolean(y.env.SSH_CONNECTION || y.env.SSH_CLIENT || y.env.SSH_TTY);
38664
38688
  var is_in_ssh_default = isInSsh;
38665
38689
 
38666
38690
  //#endregion
@@ -38668,7 +38692,7 @@ var is_in_ssh_default = isInSsh;
38668
38692
  const fallbackAttemptSymbol = Symbol("fallbackAttempt");
38669
38693
  const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
38670
38694
  const localXdgOpenPath = path.join(__dirname, "xdg-open");
38671
- const { platform: platform$1, arch } = process$1;
38695
+ const { platform: platform$1, arch } = y;
38672
38696
  const tryEachApp = async (apps$1, opener) => {
38673
38697
  if (apps$1.length === 0) return;
38674
38698
  const errors = [];
@@ -38781,7 +38805,7 @@ const baseOpen = async (options) => {
38781
38805
  await fs$2.access(localXdgOpenPath, constants$1.X_OK);
38782
38806
  exeLocalXdgOpen = true;
38783
38807
  } catch {}
38784
- command = process$1.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
38808
+ command = y.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
38785
38809
  }
38786
38810
  if (appArguments.length > 0) cliArguments.push(...appArguments);
38787
38811
  if (!options.wait) {
@@ -38892,7 +38916,66 @@ async function openDashboard() {
38892
38916
  return { outroMessage: `Dashboard opened at ${dashboardUrl}` };
38893
38917
  }
38894
38918
  const dashboardCommand = new Command("dashboard").description("Open the app dashboard in your browser").action(async () => {
38895
- await runCommand(openDashboard);
38919
+ await runCommand(openDashboard, { requireAuth: true });
38920
+ });
38921
+
38922
+ //#endregion
38923
+ //#region src/cli/commands/project/link.ts
38924
+ function validateNonInteractiveFlags(command) {
38925
+ const { create: create$1, name: name$1 } = command.opts();
38926
+ if (create$1 && !name$1) command.error("--name is required when using --create");
38927
+ }
38928
+ async function promptForProjectDetails() {
38929
+ const actionOptions = [{
38930
+ value: "create",
38931
+ label: "Create a new project",
38932
+ hint: "Create a new Base44 project and link it"
38933
+ }];
38934
+ const result = await Ce({
38935
+ action: () => ve({
38936
+ message: "How would you like to link this project?",
38937
+ options: actionOptions
38938
+ }),
38939
+ name: () => {
38940
+ return he({
38941
+ message: "What is the name of your project?",
38942
+ placeholder: "my-app",
38943
+ validate: (value) => {
38944
+ if (!value || value.trim().length === 0) return "Project name is required";
38945
+ }
38946
+ });
38947
+ },
38948
+ description: () => he({
38949
+ message: "Description (optional)",
38950
+ placeholder: "A brief description of your project"
38951
+ })
38952
+ }, { onCancel: onPromptCancel });
38953
+ return {
38954
+ name: result.name.trim(),
38955
+ description: result.description ? result.description.trim() : void 0
38956
+ };
38957
+ }
38958
+ async function link(options) {
38959
+ const projectRoot = await findProjectRoot();
38960
+ if (!projectRoot) throw new Error("No Base44 project found. Run this command from a project directory with a config.jsonc file.");
38961
+ if (await envLocalExists(projectRoot.root)) throw new Error("Project is already linked. A .env.local file with BASE44_CLIENT_ID already exists.");
38962
+ const { name: name$1, description } = options.create ? {
38963
+ name: options.name.trim(),
38964
+ description: options.description?.trim()
38965
+ } : await promptForProjectDetails();
38966
+ const { projectId } = await runTask("Creating project on Base44...", async () => {
38967
+ return await createProject(name$1, description);
38968
+ }, {
38969
+ successMessage: "Project created successfully",
38970
+ errorMessage: "Failed to create project"
38971
+ });
38972
+ await writeEnvLocal(projectRoot.root, projectId);
38973
+ const dashboardUrl = `${getBase44ApiUrl()}/apps/${projectId}/editor/workspace/overview`;
38974
+ M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(dashboardUrl)}`);
38975
+ return { outroMessage: "Project linked" };
38976
+ }
38977
+ const linkCommand = new Command("link").description("Link a local project to a Base44 project").option("-c, --create", "Create a new project (skip selection prompt)").option("-n, --name <name>", "Project name (required when --create is used)").option("-d, --description <description>", "Project description").hook("preAction", validateNonInteractiveFlags).action(async (options) => {
38978
+ await runCommand(() => link(options), { requireAuth: true });
38896
38979
  });
38897
38980
 
38898
38981
  //#endregion
@@ -38924,11 +39007,13 @@ var version = "0.0.11";
38924
39007
  //#region src/cli/index.ts
38925
39008
  const program = new Command();
38926
39009
  program.name("base44").description("Base44 CLI - Unified interface for managing Base44 applications").version(version);
39010
+ program.configureHelp({ sortSubcommands: true });
38927
39011
  program.addCommand(loginCommand);
38928
39012
  program.addCommand(whoamiCommand);
38929
39013
  program.addCommand(logoutCommand);
38930
39014
  program.addCommand(createCommand);
38931
39015
  program.addCommand(dashboardCommand);
39016
+ program.addCommand(linkCommand);
38932
39017
  program.addCommand(entitiesPushCommand);
38933
39018
  program.addCommand(functionsDeployCommand);
38934
39019
  program.addCommand(siteDeployCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/cli",
3
- "version": "0.0.11-pr.82.893c777",
3
+ "version": "0.0.11-pr.83.2bc8234",
4
4
  "description": "Base44 CLI - Unified interface for managing Base44 applications",
5
5
  "type": "module",
6
6
  "main": "./dist/cli/index.js",