@base44-preview/cli 0.0.15-pr.96.cd454a5 → 0.0.15-pr.97.767bf58

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 +218 -106
  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$15 = __require("node:path");
896
896
  const fs$10 = __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$15.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) {
@@ -4547,6 +4547,7 @@ const string$1 = (params) => {
4547
4547
  };
4548
4548
  const integer = /^-?\d+$/;
4549
4549
  const number$1 = /^-?\d+(?:\.\d+)?$/;
4550
+ const boolean$1 = /^(?:true|false)$/i;
4550
4551
  const lowercase = /^[^A-Z]*$/;
4551
4552
  const uppercase = /^[^a-z]*$/;
4552
4553
 
@@ -5325,6 +5326,24 @@ const $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumberFormat", (inst,
5325
5326
  $ZodCheckNumberFormat.init(inst, def);
5326
5327
  $ZodNumber.init(inst, def);
5327
5328
  });
5329
+ const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
5330
+ $ZodType.init(inst, def);
5331
+ inst._zod.pattern = boolean$1;
5332
+ inst._zod.parse = (payload, _ctx) => {
5333
+ if (def.coerce) try {
5334
+ payload.value = Boolean(payload.value);
5335
+ } catch (_$2) {}
5336
+ const input = payload.value;
5337
+ if (typeof input === "boolean") return payload;
5338
+ payload.issues.push({
5339
+ expected: "boolean",
5340
+ code: "invalid_type",
5341
+ input,
5342
+ inst
5343
+ });
5344
+ return payload;
5345
+ };
5346
+ });
5328
5347
  const $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
5329
5348
  $ZodType.init(inst, def);
5330
5349
  inst._zod.parse = (payload) => payload;
@@ -6379,6 +6398,13 @@ function _int(Class, params) {
6379
6398
  });
6380
6399
  }
6381
6400
  /* @__NO_SIDE_EFFECTS__ */
6401
+ function _boolean(Class, params) {
6402
+ return new Class({
6403
+ type: "boolean",
6404
+ ...normalizeParams(params)
6405
+ });
6406
+ }
6407
+ /* @__NO_SIDE_EFFECTS__ */
6382
6408
  function _unknown(Class) {
6383
6409
  return new Class({ type: "unknown" });
6384
6410
  }
@@ -6628,7 +6654,7 @@ function initializeContext(params) {
6628
6654
  external: params?.external ?? void 0
6629
6655
  };
6630
6656
  }
6631
- function process$3(schema, ctx, _params = {
6657
+ function process$2(schema, ctx, _params = {
6632
6658
  path: [],
6633
6659
  schemaPath: []
6634
6660
  }) {
@@ -6665,7 +6691,7 @@ function process$3(schema, ctx, _params = {
6665
6691
  const parent = schema._zod.parent;
6666
6692
  if (parent) {
6667
6693
  if (!result.ref) result.ref = parent;
6668
- process$3(parent, ctx, params);
6694
+ process$2(parent, ctx, params);
6669
6695
  ctx.seen.get(parent).isParent = true;
6670
6696
  }
6671
6697
  }
@@ -6877,7 +6903,7 @@ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
6877
6903
  ...params,
6878
6904
  processors
6879
6905
  });
6880
- process$3(schema, ctx);
6906
+ process$2(schema, ctx);
6881
6907
  extractDefs(ctx, schema);
6882
6908
  return finalize(ctx, schema);
6883
6909
  };
@@ -6889,7 +6915,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
6889
6915
  io,
6890
6916
  processors
6891
6917
  });
6892
- process$3(schema, ctx);
6918
+ process$2(schema, ctx);
6893
6919
  extractDefs(ctx, schema);
6894
6920
  return finalize(ctx, schema);
6895
6921
  };
@@ -6949,6 +6975,9 @@ const numberProcessor = (schema, ctx, _json, _params) => {
6949
6975
  }
6950
6976
  if (typeof multipleOf === "number") json.multipleOf = multipleOf;
6951
6977
  };
6978
+ const booleanProcessor = (_schema, _ctx, json, _params) => {
6979
+ json.type = "boolean";
6980
+ };
6952
6981
  const neverProcessor = (_schema, _ctx, json, _params) => {
6953
6982
  json.not = {};
6954
6983
  };
@@ -6973,7 +7002,7 @@ const arrayProcessor = (schema, ctx, _json, params) => {
6973
7002
  if (typeof minimum === "number") json.minItems = minimum;
6974
7003
  if (typeof maximum === "number") json.maxItems = maximum;
6975
7004
  json.type = "array";
6976
- json.items = process$3(def.element, ctx, {
7005
+ json.items = process$2(def.element, ctx, {
6977
7006
  ...params,
6978
7007
  path: [...params.path, "items"]
6979
7008
  });
@@ -6984,7 +7013,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
6984
7013
  json.type = "object";
6985
7014
  json.properties = {};
6986
7015
  const shape = def.shape;
6987
- for (const key in shape) json.properties[key] = process$3(shape[key], ctx, {
7016
+ for (const key in shape) json.properties[key] = process$2(shape[key], ctx, {
6988
7017
  ...params,
6989
7018
  path: [
6990
7019
  ...params.path,
@@ -7002,7 +7031,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
7002
7031
  if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
7003
7032
  else if (!def.catchall) {
7004
7033
  if (ctx.io === "output") json.additionalProperties = false;
7005
- } else if (def.catchall) json.additionalProperties = process$3(def.catchall, ctx, {
7034
+ } else if (def.catchall) json.additionalProperties = process$2(def.catchall, ctx, {
7006
7035
  ...params,
7007
7036
  path: [...params.path, "additionalProperties"]
7008
7037
  });
@@ -7010,7 +7039,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
7010
7039
  const unionProcessor = (schema, ctx, json, params) => {
7011
7040
  const def = schema._zod.def;
7012
7041
  const isExclusive = def.inclusive === false;
7013
- const options = def.options.map((x$2, i$1) => process$3(x$2, ctx, {
7042
+ const options = def.options.map((x$2, i$1) => process$2(x$2, ctx, {
7014
7043
  ...params,
7015
7044
  path: [
7016
7045
  ...params.path,
@@ -7023,7 +7052,7 @@ const unionProcessor = (schema, ctx, json, params) => {
7023
7052
  };
7024
7053
  const intersectionProcessor = (schema, ctx, json, params) => {
7025
7054
  const def = schema._zod.def;
7026
- const a$1 = process$3(def.left, ctx, {
7055
+ const a$1 = process$2(def.left, ctx, {
7027
7056
  ...params,
7028
7057
  path: [
7029
7058
  ...params.path,
@@ -7031,7 +7060,7 @@ const intersectionProcessor = (schema, ctx, json, params) => {
7031
7060
  0
7032
7061
  ]
7033
7062
  });
7034
- const b$2 = process$3(def.right, ctx, {
7063
+ const b$2 = process$2(def.right, ctx, {
7035
7064
  ...params,
7036
7065
  path: [
7037
7066
  ...params.path,
@@ -7048,7 +7077,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7048
7077
  json.type = "array";
7049
7078
  const prefixPath$1 = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
7050
7079
  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, {
7080
+ const prefixItems = def.items.map((x$2, i$1) => process$2(x$2, ctx, {
7052
7081
  ...params,
7053
7082
  path: [
7054
7083
  ...params.path,
@@ -7056,7 +7085,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7056
7085
  i$1
7057
7086
  ]
7058
7087
  }));
7059
- const rest = def.rest ? process$3(def.rest, ctx, {
7088
+ const rest = def.rest ? process$2(def.rest, ctx, {
7060
7089
  ...params,
7061
7090
  path: [
7062
7091
  ...params.path,
@@ -7082,7 +7111,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7082
7111
  };
7083
7112
  const nullableProcessor = (schema, ctx, json, params) => {
7084
7113
  const def = schema._zod.def;
7085
- const inner = process$3(def.innerType, ctx, params);
7114
+ const inner = process$2(def.innerType, ctx, params);
7086
7115
  const seen = ctx.seen.get(schema);
7087
7116
  if (ctx.target === "openapi-3.0") {
7088
7117
  seen.ref = def.innerType;
@@ -7091,27 +7120,27 @@ const nullableProcessor = (schema, ctx, json, params) => {
7091
7120
  };
7092
7121
  const nonoptionalProcessor = (schema, ctx, _json, params) => {
7093
7122
  const def = schema._zod.def;
7094
- process$3(def.innerType, ctx, params);
7123
+ process$2(def.innerType, ctx, params);
7095
7124
  const seen = ctx.seen.get(schema);
7096
7125
  seen.ref = def.innerType;
7097
7126
  };
7098
7127
  const defaultProcessor = (schema, ctx, json, params) => {
7099
7128
  const def = schema._zod.def;
7100
- process$3(def.innerType, ctx, params);
7129
+ process$2(def.innerType, ctx, params);
7101
7130
  const seen = ctx.seen.get(schema);
7102
7131
  seen.ref = def.innerType;
7103
7132
  json.default = JSON.parse(JSON.stringify(def.defaultValue));
7104
7133
  };
7105
7134
  const prefaultProcessor = (schema, ctx, json, params) => {
7106
7135
  const def = schema._zod.def;
7107
- process$3(def.innerType, ctx, params);
7136
+ process$2(def.innerType, ctx, params);
7108
7137
  const seen = ctx.seen.get(schema);
7109
7138
  seen.ref = def.innerType;
7110
7139
  if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
7111
7140
  };
7112
7141
  const catchProcessor = (schema, ctx, json, params) => {
7113
7142
  const def = schema._zod.def;
7114
- process$3(def.innerType, ctx, params);
7143
+ process$2(def.innerType, ctx, params);
7115
7144
  const seen = ctx.seen.get(schema);
7116
7145
  seen.ref = def.innerType;
7117
7146
  let catchValue;
@@ -7125,20 +7154,20 @@ const catchProcessor = (schema, ctx, json, params) => {
7125
7154
  const pipeProcessor = (schema, ctx, _json, params) => {
7126
7155
  const def = schema._zod.def;
7127
7156
  const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
7128
- process$3(innerType, ctx, params);
7157
+ process$2(innerType, ctx, params);
7129
7158
  const seen = ctx.seen.get(schema);
7130
7159
  seen.ref = innerType;
7131
7160
  };
7132
7161
  const readonlyProcessor = (schema, ctx, json, params) => {
7133
7162
  const def = schema._zod.def;
7134
- process$3(def.innerType, ctx, params);
7163
+ process$2(def.innerType, ctx, params);
7135
7164
  const seen = ctx.seen.get(schema);
7136
7165
  seen.ref = def.innerType;
7137
7166
  json.readOnly = true;
7138
7167
  };
7139
7168
  const optionalProcessor = (schema, ctx, _json, params) => {
7140
7169
  const def = schema._zod.def;
7141
- process$3(def.innerType, ctx, params);
7170
+ process$2(def.innerType, ctx, params);
7142
7171
  const seen = ctx.seen.get(schema);
7143
7172
  seen.ref = def.innerType;
7144
7173
  };
@@ -7472,6 +7501,14 @@ const ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, d
7472
7501
  function int(params) {
7473
7502
  return _int(ZodNumberFormat, params);
7474
7503
  }
7504
+ const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
7505
+ $ZodBoolean.init(inst, def);
7506
+ ZodType.init(inst, def);
7507
+ inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
7508
+ });
7509
+ function boolean(params) {
7510
+ return _boolean(ZodBoolean, params);
7511
+ }
7475
7512
  const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
7476
7513
  $ZodUnknown.init(inst, def);
7477
7514
  ZodType.init(inst, def);
@@ -16156,7 +16193,7 @@ const createIgnorePredicate = (patterns, cwd, baseDir) => {
16156
16193
  };
16157
16194
  const normalizeOptions$2 = (options = {}) => {
16158
16195
  const ignoreOption = options.ignore ? Array.isArray(options.ignore) ? options.ignore : [options.ignore] : [];
16159
- const cwd = toPath$1(options.cwd) ?? process$1.cwd();
16196
+ const cwd = toPath$1(options.cwd) ?? y.cwd();
16160
16197
  const deep = typeof options.deep === "number" ? Math.max(0, options.deep) + 1 : Number.POSITIVE_INFINITY;
16161
16198
  return {
16162
16199
  cwd,
@@ -16253,7 +16290,7 @@ const getDirectoryGlob = ({ directoryPath, files, extensions }) => {
16253
16290
  const extensionGlob = extensions?.length > 0 ? `.${extensions.length > 1 ? `{${extensions.join(",")}}` : extensions[0]}` : "";
16254
16291
  return files ? files.map((file) => path.posix.join(directoryPath, `**/${path.extname(file) ? file : `${file}${extensionGlob}`}`)) : [path.posix.join(directoryPath, `**${extensionGlob ? `/*${extensionGlob}` : ""}`)];
16255
16292
  };
16256
- const directoryToGlob = async (directoryPaths, { cwd = process$1.cwd(), files, extensions, fs: fsImplementation } = {}) => {
16293
+ const directoryToGlob = async (directoryPaths, { cwd = y.cwd(), files, extensions, fs: fsImplementation } = {}) => {
16257
16294
  return (await Promise.all(directoryPaths.map(async (directoryPath) => {
16258
16295
  if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
16259
16296
  directoryPath,
@@ -16267,7 +16304,7 @@ const directoryToGlob = async (directoryPaths, { cwd = process$1.cwd(), files, e
16267
16304
  }) : directoryPath;
16268
16305
  }))).flat();
16269
16306
  };
16270
- const directoryToGlobSync = (directoryPaths, { cwd = process$1.cwd(), files, extensions, fs: fsImplementation } = {}) => directoryPaths.flatMap((directoryPath) => {
16307
+ const directoryToGlobSync = (directoryPaths, { cwd = y.cwd(), files, extensions, fs: fsImplementation } = {}) => directoryPaths.flatMap((directoryPath) => {
16271
16308
  if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
16272
16309
  directoryPath,
16273
16310
  files,
@@ -16363,7 +16400,7 @@ const applyIgnoreFilesAndGetFilterSync = (options) => {
16363
16400
  };
16364
16401
  const createFilterFunction = (isIgnored, cwd) => {
16365
16402
  const seen = /* @__PURE__ */ new Set();
16366
- const basePath = cwd || process$1.cwd();
16403
+ const basePath = cwd || y.cwd();
16367
16404
  const pathCache = /* @__PURE__ */ new Map();
16368
16405
  return (fastGlobResult) => {
16369
16406
  const pathKey$1 = path.normalize(fastGlobResult.path ?? fastGlobResult);
@@ -16669,6 +16706,12 @@ const ProjectConfigSchema = object({
16669
16706
  });
16670
16707
  const AppConfigSchema = object({ id: string().min(1, "id cannot be empty") });
16671
16708
  const CreateProjectResponseSchema = looseObject({ id: string() });
16709
+ const AppSchema = looseObject({
16710
+ id: string(),
16711
+ name: string(),
16712
+ is_managed_source_code: boolean()
16713
+ });
16714
+ const AppsResponseSchema = array(AppSchema);
16672
16715
 
16673
16716
  //#endregion
16674
16717
  //#region src/core/project/config.ts
@@ -16753,6 +16796,13 @@ async function createProject(projectName, description) {
16753
16796
  } });
16754
16797
  return { projectId: CreateProjectResponseSchema.parse(await response.json()).id };
16755
16798
  }
16799
+ async function fetchApps() {
16800
+ const response = await base44Client.get("api/apps");
16801
+ return AppsResponseSchema.parse(await response.json());
16802
+ }
16803
+ async function fetchLinkableApps() {
16804
+ return (await fetchApps()).filter((app) => !app.is_managed_source_code);
16805
+ }
16756
16806
 
16757
16807
  //#endregion
16758
16808
  //#region node_modules/ejs/lib/utils.js
@@ -30703,13 +30753,13 @@ var ansi_styles_default = ansiStyles;
30703
30753
 
30704
30754
  //#endregion
30705
30755
  //#region node_modules/chalk/source/vendor/supports-color/index.js
30706
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process$1.argv) {
30756
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : y.argv) {
30707
30757
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
30708
30758
  const position = argv.indexOf(prefix + flag);
30709
30759
  const terminatorPosition = argv.indexOf("--");
30710
30760
  return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
30711
30761
  }
30712
- const { env } = process$1;
30762
+ const { env } = y;
30713
30763
  let flagForceColor;
30714
30764
  if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
30715
30765
  else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
@@ -30742,7 +30792,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
30742
30792
  if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
30743
30793
  const min = forceColor || 0;
30744
30794
  if (env.TERM === "dumb") return min;
30745
- if (process$1.platform === "win32") {
30795
+ if (y.platform === "win32") {
30746
30796
  const osRelease = os.release().split(".");
30747
30797
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
30748
30798
  return 1;
@@ -31481,9 +31531,9 @@ const getSubprocessResult = ({ stdout: stdout$1 }) => {
31481
31531
  //#region node_modules/execa/lib/utils/standard-stream.js
31482
31532
  const isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
31483
31533
  const STANDARD_STREAMS = [
31484
- process$1.stdin,
31485
- process$1.stdout,
31486
- process$1.stderr
31534
+ y.stdin,
31535
+ y.stdout,
31536
+ y.stderr
31487
31537
  ];
31488
31538
  const STANDARD_STREAMS_ALIASES = [
31489
31539
  "stdin",
@@ -31608,9 +31658,9 @@ const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
31608
31658
  //#endregion
31609
31659
  //#region node_modules/is-unicode-supported/index.js
31610
31660
  function isUnicodeSupported() {
31611
- const { env: env$1 } = process$1;
31661
+ const { env: env$1 } = y;
31612
31662
  const { TERM, TERM_PROGRAM } = env$1;
31613
- if (process$1.platform !== "win32") return TERM !== "linux";
31663
+ if (y.platform !== "win32") return TERM !== "linux";
31614
31664
  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";
31615
31665
  }
31616
31666
 
@@ -32537,7 +32587,7 @@ const TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
32537
32587
 
32538
32588
  //#endregion
32539
32589
  //#region node_modules/npm-run-path/index.js
32540
- const npmRunPath = ({ cwd = process$1.cwd(), path: pathOption = process$1.env[pathKey()], preferLocal = true, execPath: execPath$1 = process$1.execPath, addExecPath = true } = {}) => {
32590
+ const npmRunPath = ({ cwd = y.cwd(), path: pathOption = y.env[pathKey()], preferLocal = true, execPath: execPath$1 = y.execPath, addExecPath = true } = {}) => {
32541
32591
  const cwdPath = path.resolve(toPath(cwd));
32542
32592
  const result = [];
32543
32593
  const pathParts = pathOption.split(path.delimiter);
@@ -32555,7 +32605,7 @@ const applyExecPath = (result, pathParts, execPath$1, cwdPath) => {
32555
32605
  const pathPart = path.resolve(cwdPath, toPath(execPath$1), "..");
32556
32606
  if (!pathParts.includes(pathPart)) result.push(pathPart);
32557
32607
  };
32558
- const npmRunPathEnv = ({ env: env$1 = process$1.env, ...options } = {}) => {
32608
+ const npmRunPathEnv = ({ env: env$1 = y.env, ...options } = {}) => {
32559
32609
  env$1 = { ...env$1 };
32560
32610
  const pathName = pathKey({ env: env$1 });
32561
32611
  options.path = env$1[pathName];
@@ -33690,7 +33740,7 @@ const normalizeCwd = (cwd = getDefaultCwd()) => {
33690
33740
  };
33691
33741
  const getDefaultCwd = () => {
33692
33742
  try {
33693
- return process$1.cwd();
33743
+ return y.cwd();
33694
33744
  } catch (error) {
33695
33745
  error.message = `The current directory does not exist.\n${error.message}`;
33696
33746
  throw error;
@@ -33725,7 +33775,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
33725
33775
  options.killSignal = normalizeKillSignal(options.killSignal);
33726
33776
  options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
33727
33777
  options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
33728
- if (process$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
33778
+ if (y.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
33729
33779
  return {
33730
33780
  file,
33731
33781
  commandArguments,
@@ -33752,7 +33802,7 @@ const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDi
33752
33802
  });
33753
33803
  const getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
33754
33804
  const env$1 = extendEnv ? {
33755
- ...process$1.env,
33805
+ ...y.env,
33756
33806
  ...envOption
33757
33807
  } : envOption;
33758
33808
  if (preferLocal || node) return npmRunPathEnv({
@@ -34752,12 +34802,12 @@ const guessStreamDirection = {
34752
34802
  }
34753
34803
  };
34754
34804
  const getStandardStreamDirection = (value) => {
34755
- if ([0, process$1.stdin].includes(value)) return "input";
34805
+ if ([0, y.stdin].includes(value)) return "input";
34756
34806
  if ([
34757
34807
  1,
34758
34808
  2,
34759
- process$1.stdout,
34760
- process$1.stderr
34809
+ y.stdout,
34810
+ y.stderr
34761
34811
  ].includes(value)) return "output";
34762
34812
  };
34763
34813
  const DEFAULT_DIRECTION = "output";
@@ -35821,9 +35871,9 @@ const addIpcMethods = (subprocess, { ipc }) => {
35821
35871
  Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
35822
35872
  };
35823
35873
  const getIpcExport = () => {
35824
- const anyProcess = process$1;
35874
+ const anyProcess = y;
35825
35875
  const isSubprocess = true;
35826
- const ipc = process$1.channel !== void 0;
35876
+ const ipc = y.channel !== void 0;
35827
35877
  return {
35828
35878
  ...getIpcMethods(anyProcess, isSubprocess, ipc),
35829
35879
  getCancelSignal: getCancelSignal$1.bind(void 0, {
@@ -36065,7 +36115,7 @@ if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SI
36065
36115
 
36066
36116
  //#endregion
36067
36117
  //#region node_modules/signal-exit/dist/mjs/index.js
36068
- 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";
36118
+ 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";
36069
36119
  const kExitEmitter = Symbol.for("signal-exit emitter");
36070
36120
  const global$1 = globalThis;
36071
36121
  const ObjectDefineProperty = Object.defineProperty.bind(Object);
@@ -36133,7 +36183,7 @@ var SignalExitFallback = class extends SignalExitBase {
36133
36183
  };
36134
36184
  var SignalExit = class extends SignalExitBase {
36135
36185
  /* c8 ignore start */
36136
- #hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
36186
+ #hupSig = process$1.platform === "win32" ? "SIGINT" : "SIGHUP";
36137
36187
  /* c8 ignore stop */
36138
36188
  #emitter = new Emitter();
36139
36189
  #process;
@@ -36141,15 +36191,15 @@ var SignalExit = class extends SignalExitBase {
36141
36191
  #originalProcessReallyExit;
36142
36192
  #sigListeners = {};
36143
36193
  #loaded = false;
36144
- constructor(process$5) {
36194
+ constructor(process$4) {
36145
36195
  super();
36146
- this.#process = process$5;
36196
+ this.#process = process$4;
36147
36197
  this.#sigListeners = {};
36148
36198
  for (const sig of signals) this.#sigListeners[sig] = () => {
36149
36199
  const listeners = this.#process.listeners(sig);
36150
36200
  let { count: count$1 } = this.#emitter;
36151
36201
  /* c8 ignore start */
36152
- const p$1 = process$5;
36202
+ const p$1 = process$4;
36153
36203
  if (typeof p$1.__signal_exit_emitter__ === "object" && typeof p$1.__signal_exit_emitter__.count === "number") count$1 += p$1.__signal_exit_emitter__.count;
36154
36204
  /* c8 ignore stop */
36155
36205
  if (listeners.length === count$1) {
@@ -36157,11 +36207,11 @@ var SignalExit = class extends SignalExitBase {
36157
36207
  const ret = this.#emitter.emit("exit", null, sig);
36158
36208
  /* c8 ignore start */
36159
36209
  const s = sig === "SIGHUP" ? this.#hupSig : sig;
36160
- if (!ret) process$5.kill(process$5.pid, s);
36210
+ if (!ret) process$4.kill(process$4.pid, s);
36161
36211
  }
36162
36212
  };
36163
- this.#originalProcessReallyExit = process$5.reallyExit;
36164
- this.#originalProcessEmit = process$5.emit;
36213
+ this.#originalProcessReallyExit = process$4.reallyExit;
36214
+ this.#originalProcessEmit = process$4.emit;
36165
36215
  }
36166
36216
  onExit(cb, opts) {
36167
36217
  /* c8 ignore start */
@@ -36228,8 +36278,8 @@ var SignalExit = class extends SignalExitBase {
36228
36278
  } else return og.call(this.#process, ev, ...args);
36229
36279
  }
36230
36280
  };
36231
- const process$2 = globalThis.process;
36232
- const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
36281
+ const process$1 = globalThis.process;
36282
+ const { onExit, load, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
36233
36283
 
36234
36284
  //#endregion
36235
36285
  //#region node_modules/execa/lib/terminate/cleanup.js
@@ -38166,7 +38216,7 @@ function isInsideContainer() {
38166
38216
  //#endregion
38167
38217
  //#region node_modules/is-wsl/index.js
38168
38218
  const isWsl = () => {
38169
- if (process$1.platform !== "linux") return false;
38219
+ if (y.platform !== "linux") return false;
38170
38220
  if (os.release().toLowerCase().includes("microsoft")) {
38171
38221
  if (isInsideContainer()) return false;
38172
38222
  return true;
@@ -38177,12 +38227,12 @@ const isWsl = () => {
38177
38227
  return false;
38178
38228
  }
38179
38229
  };
38180
- var is_wsl_default = process$1.env.__IS_WSL_TEST__ ? isWsl : isWsl();
38230
+ var is_wsl_default = y.env.__IS_WSL_TEST__ ? isWsl : isWsl();
38181
38231
 
38182
38232
  //#endregion
38183
38233
  //#region node_modules/powershell-utils/index.js
38184
38234
  const execFile$2 = promisify(childProcess.execFile);
38185
- const powerShellPath$1 = () => `${process$1.env.SYSTEMROOT || process$1.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
38235
+ const powerShellPath$1 = () => `${y.env.SYSTEMROOT || y.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
38186
38236
  const executePowerShell = async (command, options = {}) => {
38187
38237
  const { powerShellPath: psPath, ...execFileOptions } = options;
38188
38238
  const encodedCommand = executePowerShell.encodeCommand(command);
@@ -38293,7 +38343,7 @@ function defineLazyProperty(object$1, propertyName, valueGetter) {
38293
38343
  //#region node_modules/default-browser-id/index.js
38294
38344
  const execFileAsync$3 = promisify(execFile);
38295
38345
  async function defaultBrowserId() {
38296
- if (process$1.platform !== "darwin") throw new Error("macOS only");
38346
+ if (y.platform !== "darwin") throw new Error("macOS only");
38297
38347
  const { stdout: stdout$1 } = await execFileAsync$3("defaults", [
38298
38348
  "read",
38299
38349
  "com.apple.LaunchServices/com.apple.launchservices.secure",
@@ -38308,7 +38358,7 @@ async function defaultBrowserId() {
38308
38358
  //#region node_modules/run-applescript/index.js
38309
38359
  const execFileAsync$2 = promisify(execFile);
38310
38360
  async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
38311
- if (process$1.platform !== "darwin") throw new Error("macOS only");
38361
+ if (y.platform !== "darwin") throw new Error("macOS only");
38312
38362
  const outputArguments = humanReadableOutput ? [] : ["-ss"];
38313
38363
  const execOptions = {};
38314
38364
  if (signal) execOptions.signal = signal;
@@ -38417,14 +38467,14 @@ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
38417
38467
  const execFileAsync = promisify(execFile);
38418
38468
  const titleize = (string$2) => string$2.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x$2) => x$2.toUpperCase());
38419
38469
  async function defaultBrowser() {
38420
- if (process$1.platform === "darwin") {
38470
+ if (y.platform === "darwin") {
38421
38471
  const id = await defaultBrowserId();
38422
38472
  return {
38423
38473
  name: await bundleName(id),
38424
38474
  id
38425
38475
  };
38426
38476
  }
38427
- if (process$1.platform === "linux") {
38477
+ if (y.platform === "linux") {
38428
38478
  const { stdout: stdout$1 } = await execFileAsync("xdg-mime", [
38429
38479
  "query",
38430
38480
  "default",
@@ -38436,13 +38486,13 @@ async function defaultBrowser() {
38436
38486
  id
38437
38487
  };
38438
38488
  }
38439
- if (process$1.platform === "win32") return defaultBrowser$1();
38489
+ if (y.platform === "win32") return defaultBrowser$1();
38440
38490
  throw new Error("Only macOS, Linux, and Windows are supported");
38441
38491
  }
38442
38492
 
38443
38493
  //#endregion
38444
38494
  //#region node_modules/is-in-ssh/index.js
38445
- const isInSsh = Boolean(process$1.env.SSH_CONNECTION || process$1.env.SSH_CLIENT || process$1.env.SSH_TTY);
38495
+ const isInSsh = Boolean(y.env.SSH_CONNECTION || y.env.SSH_CLIENT || y.env.SSH_TTY);
38446
38496
  var is_in_ssh_default = isInSsh;
38447
38497
 
38448
38498
  //#endregion
@@ -38450,7 +38500,7 @@ var is_in_ssh_default = isInSsh;
38450
38500
  const fallbackAttemptSymbol = Symbol("fallbackAttempt");
38451
38501
  const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
38452
38502
  const localXdgOpenPath = path.join(__dirname, "xdg-open");
38453
- const { platform: platform$1, arch } = process$1;
38503
+ const { platform: platform$1, arch } = y;
38454
38504
  const tryEachApp = async (apps$1, opener) => {
38455
38505
  if (apps$1.length === 0) return;
38456
38506
  const errors = [];
@@ -38563,7 +38613,7 @@ const baseOpen = async (options) => {
38563
38613
  await fs$1.access(localXdgOpenPath, constants$1.X_OK);
38564
38614
  exeLocalXdgOpen = true;
38565
38615
  } catch {}
38566
- command = process$1.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
38616
+ command = y.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
38567
38617
  }
38568
38618
  if (appArguments.length > 0) cliArguments.push(...appArguments);
38569
38619
  if (!options.wait) {
@@ -38706,20 +38756,33 @@ const deployCommand = new Command("deploy").description("Deploy all project reso
38706
38756
  //#endregion
38707
38757
  //#region src/cli/commands/project/link.ts
38708
38758
  function validateNonInteractiveFlags(command) {
38709
- const { create: create$1, name: name$1 } = command.opts();
38759
+ const { create: create$1, existing, name: name$1 } = command.opts();
38760
+ if (create$1 && existing) command.error("--create and --existing cannot be used together");
38710
38761
  if (create$1 && !name$1) command.error("--name is required when using --create");
38711
38762
  }
38712
- async function promptForProjectDetails() {
38763
+ async function promptForLinkAction(linkableApps) {
38713
38764
  const actionOptions = [{
38714
38765
  value: "create",
38715
38766
  label: "Create a new project",
38716
38767
  hint: "Create a new Base44 project and link it"
38717
38768
  }];
38769
+ if (linkableApps.length > 0) actionOptions.push({
38770
+ value: "choose",
38771
+ label: "Link an existing project",
38772
+ hint: `Choose from ${linkableApps.length} available project${linkableApps.length === 1 ? "" : "s"}`
38773
+ });
38774
+ const action = await ve({
38775
+ message: "How would you like to link this project?",
38776
+ options: actionOptions
38777
+ });
38778
+ if (pD(action)) {
38779
+ xe("Operation cancelled.");
38780
+ process.exit(0);
38781
+ }
38782
+ return action;
38783
+ }
38784
+ async function promptForNewProjectDetails() {
38718
38785
  const result = await Ce({
38719
- action: () => ve({
38720
- message: "How would you like to link this project?",
38721
- options: actionOptions
38722
- }),
38723
38786
  name: () => {
38724
38787
  return he({
38725
38788
  message: "What is the name of your project?",
@@ -38739,14 +38802,63 @@ async function promptForProjectDetails() {
38739
38802
  description: result.description ? result.description.trim() : void 0
38740
38803
  };
38741
38804
  }
38805
+ async function promptForExistingApp(linkableApps) {
38806
+ const selectedApp = await ve({
38807
+ message: "Choose a project to link",
38808
+ options: linkableApps.map((app) => ({
38809
+ value: app,
38810
+ label: app.name
38811
+ }))
38812
+ });
38813
+ if (pD(selectedApp)) {
38814
+ xe("Operation cancelled.");
38815
+ process.exit(0);
38816
+ }
38817
+ return selectedApp;
38818
+ }
38742
38819
  async function link(options) {
38743
38820
  const projectRoot = await findProjectRoot();
38744
38821
  if (!projectRoot) throw new Error("No Base44 project found. Run this command from a project directory with a config.jsonc file.");
38745
38822
  if (await appConfigExists(projectRoot.root)) throw new Error("Project is already linked. An .app.jsonc file with the appId already exists.");
38746
- const { name: name$1, description } = options.create ? {
38747
- name: options.name.trim(),
38748
- description: options.description?.trim()
38749
- } : await promptForProjectDetails();
38823
+ if (options.existing) {
38824
+ await writeAppConfig(projectRoot.root, options.existing);
38825
+ setAppConfig({
38826
+ id: options.existing,
38827
+ projectRoot: projectRoot.root
38828
+ });
38829
+ M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(options.existing))}`);
38830
+ return { outroMessage: "Project linked" };
38831
+ }
38832
+ if (options.create) {
38833
+ const { projectId: projectId$1 } = await runTask("Creating project on Base44...", async () => {
38834
+ return await createProject(options.name.trim(), options.description?.trim());
38835
+ }, {
38836
+ successMessage: "Project created successfully",
38837
+ errorMessage: "Failed to create project"
38838
+ });
38839
+ await writeAppConfig(projectRoot.root, projectId$1);
38840
+ setAppConfig({
38841
+ id: projectId$1,
38842
+ projectRoot: projectRoot.root
38843
+ });
38844
+ M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(projectId$1))}`);
38845
+ return { outroMessage: "Project linked" };
38846
+ }
38847
+ const linkableApps = await runTask("Fetching your projects...", async () => fetchLinkableApps(), {
38848
+ successMessage: `Found ${theme.colors.base44Orange("projects")} available for linking`,
38849
+ errorMessage: "Failed to fetch projects"
38850
+ });
38851
+ if (await promptForLinkAction(linkableApps) === "choose") {
38852
+ const selectedApp = await promptForExistingApp(linkableApps);
38853
+ await writeAppConfig(projectRoot.root, selectedApp.id);
38854
+ setAppConfig({
38855
+ id: selectedApp.id,
38856
+ projectRoot: projectRoot.root
38857
+ });
38858
+ M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(selectedApp.id))}`);
38859
+ return { outroMessage: "Project linked" };
38860
+ }
38861
+ const { name: name$1, description } = await promptForNewProjectDetails();
38750
38862
  const { projectId } = await runTask("Creating project on Base44...", async () => {
38751
38863
  return await createProject(name$1, description);
38752
38864
  }, {
@@ -38761,7 +38873,7 @@ async function link(options) {
38761
38873
  M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(projectId))}`);
38762
38874
  return { outroMessage: "Project linked" };
38763
38875
  }
38764
- 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) => {
38876
+ 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("-e, --existing <id>", "Link to an existing project by ID (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) => {
38765
38877
  await runCommand(() => link(options), {
38766
38878
  requireAuth: true,
38767
38879
  requireAppConfig: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/cli",
3
- "version": "0.0.15-pr.96.cd454a5",
3
+ "version": "0.0.15-pr.97.767bf58",
4
4
  "description": "Base44 CLI - Unified interface for managing Base44 applications",
5
5
  "type": "module",
6
6
  "main": "./dist/cli/index.js",