@base44-preview/cli 0.0.15-pr.97.3ad42c9 → 0.0.15-pr.97.7d8a65b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +23 -1
  2. package/dist/cli/index.js +139 -168
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -43,9 +43,31 @@ base44 deploy
43
43
  | Command | Description |
44
44
  |---------|-------------|
45
45
  | `base44 create` | Create a new Base44 project from a template |
46
- | `base44 link` | Link an existing local project to Base44 |
46
+ | `base44 link` | Link a local project to Base44 (create new or link existing) |
47
47
  | `base44 dashboard` | Open the app dashboard in your browser |
48
48
 
49
+ #### Link Command Options
50
+
51
+ The `link` command supports both creating new projects and linking to existing ones:
52
+
53
+ ```bash
54
+ # Interactive mode - choose to create new or link existing
55
+ base44 link
56
+
57
+ # Create a new project (non-interactive)
58
+ base44 link --create --name "my-app" --description "My app description"
59
+
60
+ # Link to an existing project by ID (non-interactive)
61
+ base44 link --existing <app-id>
62
+ ```
63
+
64
+ | Option | Description |
65
+ |--------|-------------|
66
+ | `-c, --create` | Create a new project (skip selection prompt) |
67
+ | `-e, --existing <id>` | Link to an existing project by ID |
68
+ | `-n, --name <name>` | Project name (required with --create) |
69
+ | `-d, --description <desc>` | Project description (optional) |
70
+
49
71
  ### Deployment
50
72
 
51
73
  | Command | Description |
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) {
@@ -6654,7 +6654,7 @@ function initializeContext(params) {
6654
6654
  external: params?.external ?? void 0
6655
6655
  };
6656
6656
  }
6657
- function process$3(schema, ctx, _params = {
6657
+ function process$2(schema, ctx, _params = {
6658
6658
  path: [],
6659
6659
  schemaPath: []
6660
6660
  }) {
@@ -6691,7 +6691,7 @@ function process$3(schema, ctx, _params = {
6691
6691
  const parent = schema._zod.parent;
6692
6692
  if (parent) {
6693
6693
  if (!result.ref) result.ref = parent;
6694
- process$3(parent, ctx, params);
6694
+ process$2(parent, ctx, params);
6695
6695
  ctx.seen.get(parent).isParent = true;
6696
6696
  }
6697
6697
  }
@@ -6903,7 +6903,7 @@ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
6903
6903
  ...params,
6904
6904
  processors
6905
6905
  });
6906
- process$3(schema, ctx);
6906
+ process$2(schema, ctx);
6907
6907
  extractDefs(ctx, schema);
6908
6908
  return finalize(ctx, schema);
6909
6909
  };
@@ -6915,7 +6915,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
6915
6915
  io,
6916
6916
  processors
6917
6917
  });
6918
- process$3(schema, ctx);
6918
+ process$2(schema, ctx);
6919
6919
  extractDefs(ctx, schema);
6920
6920
  return finalize(ctx, schema);
6921
6921
  };
@@ -7002,7 +7002,7 @@ const arrayProcessor = (schema, ctx, _json, params) => {
7002
7002
  if (typeof minimum === "number") json.minItems = minimum;
7003
7003
  if (typeof maximum === "number") json.maxItems = maximum;
7004
7004
  json.type = "array";
7005
- json.items = process$3(def.element, ctx, {
7005
+ json.items = process$2(def.element, ctx, {
7006
7006
  ...params,
7007
7007
  path: [...params.path, "items"]
7008
7008
  });
@@ -7013,7 +7013,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
7013
7013
  json.type = "object";
7014
7014
  json.properties = {};
7015
7015
  const shape = def.shape;
7016
- 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, {
7017
7017
  ...params,
7018
7018
  path: [
7019
7019
  ...params.path,
@@ -7031,7 +7031,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
7031
7031
  if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
7032
7032
  else if (!def.catchall) {
7033
7033
  if (ctx.io === "output") json.additionalProperties = false;
7034
- } else if (def.catchall) json.additionalProperties = process$3(def.catchall, ctx, {
7034
+ } else if (def.catchall) json.additionalProperties = process$2(def.catchall, ctx, {
7035
7035
  ...params,
7036
7036
  path: [...params.path, "additionalProperties"]
7037
7037
  });
@@ -7039,7 +7039,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
7039
7039
  const unionProcessor = (schema, ctx, json, params) => {
7040
7040
  const def = schema._zod.def;
7041
7041
  const isExclusive = def.inclusive === false;
7042
- 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, {
7043
7043
  ...params,
7044
7044
  path: [
7045
7045
  ...params.path,
@@ -7052,7 +7052,7 @@ const unionProcessor = (schema, ctx, json, params) => {
7052
7052
  };
7053
7053
  const intersectionProcessor = (schema, ctx, json, params) => {
7054
7054
  const def = schema._zod.def;
7055
- const a$1 = process$3(def.left, ctx, {
7055
+ const a$1 = process$2(def.left, ctx, {
7056
7056
  ...params,
7057
7057
  path: [
7058
7058
  ...params.path,
@@ -7060,7 +7060,7 @@ const intersectionProcessor = (schema, ctx, json, params) => {
7060
7060
  0
7061
7061
  ]
7062
7062
  });
7063
- const b$2 = process$3(def.right, ctx, {
7063
+ const b$2 = process$2(def.right, ctx, {
7064
7064
  ...params,
7065
7065
  path: [
7066
7066
  ...params.path,
@@ -7077,7 +7077,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7077
7077
  json.type = "array";
7078
7078
  const prefixPath$1 = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
7079
7079
  const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
7080
- 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, {
7081
7081
  ...params,
7082
7082
  path: [
7083
7083
  ...params.path,
@@ -7085,7 +7085,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7085
7085
  i$1
7086
7086
  ]
7087
7087
  }));
7088
- const rest = def.rest ? process$3(def.rest, ctx, {
7088
+ const rest = def.rest ? process$2(def.rest, ctx, {
7089
7089
  ...params,
7090
7090
  path: [
7091
7091
  ...params.path,
@@ -7111,7 +7111,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7111
7111
  };
7112
7112
  const nullableProcessor = (schema, ctx, json, params) => {
7113
7113
  const def = schema._zod.def;
7114
- const inner = process$3(def.innerType, ctx, params);
7114
+ const inner = process$2(def.innerType, ctx, params);
7115
7115
  const seen = ctx.seen.get(schema);
7116
7116
  if (ctx.target === "openapi-3.0") {
7117
7117
  seen.ref = def.innerType;
@@ -7120,27 +7120,27 @@ const nullableProcessor = (schema, ctx, json, params) => {
7120
7120
  };
7121
7121
  const nonoptionalProcessor = (schema, ctx, _json, params) => {
7122
7122
  const def = schema._zod.def;
7123
- process$3(def.innerType, ctx, params);
7123
+ process$2(def.innerType, ctx, params);
7124
7124
  const seen = ctx.seen.get(schema);
7125
7125
  seen.ref = def.innerType;
7126
7126
  };
7127
7127
  const defaultProcessor = (schema, ctx, json, params) => {
7128
7128
  const def = schema._zod.def;
7129
- process$3(def.innerType, ctx, params);
7129
+ process$2(def.innerType, ctx, params);
7130
7130
  const seen = ctx.seen.get(schema);
7131
7131
  seen.ref = def.innerType;
7132
7132
  json.default = JSON.parse(JSON.stringify(def.defaultValue));
7133
7133
  };
7134
7134
  const prefaultProcessor = (schema, ctx, json, params) => {
7135
7135
  const def = schema._zod.def;
7136
- process$3(def.innerType, ctx, params);
7136
+ process$2(def.innerType, ctx, params);
7137
7137
  const seen = ctx.seen.get(schema);
7138
7138
  seen.ref = def.innerType;
7139
7139
  if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
7140
7140
  };
7141
7141
  const catchProcessor = (schema, ctx, json, params) => {
7142
7142
  const def = schema._zod.def;
7143
- process$3(def.innerType, ctx, params);
7143
+ process$2(def.innerType, ctx, params);
7144
7144
  const seen = ctx.seen.get(schema);
7145
7145
  seen.ref = def.innerType;
7146
7146
  let catchValue;
@@ -7154,20 +7154,20 @@ const catchProcessor = (schema, ctx, json, params) => {
7154
7154
  const pipeProcessor = (schema, ctx, _json, params) => {
7155
7155
  const def = schema._zod.def;
7156
7156
  const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
7157
- process$3(innerType, ctx, params);
7157
+ process$2(innerType, ctx, params);
7158
7158
  const seen = ctx.seen.get(schema);
7159
7159
  seen.ref = innerType;
7160
7160
  };
7161
7161
  const readonlyProcessor = (schema, ctx, json, params) => {
7162
7162
  const def = schema._zod.def;
7163
- process$3(def.innerType, ctx, params);
7163
+ process$2(def.innerType, ctx, params);
7164
7164
  const seen = ctx.seen.get(schema);
7165
7165
  seen.ref = def.innerType;
7166
7166
  json.readOnly = true;
7167
7167
  };
7168
7168
  const optionalProcessor = (schema, ctx, _json, params) => {
7169
7169
  const def = schema._zod.def;
7170
- process$3(def.innerType, ctx, params);
7170
+ process$2(def.innerType, ctx, params);
7171
7171
  const seen = ctx.seen.get(schema);
7172
7172
  seen.ref = def.innerType;
7173
7173
  };
@@ -16193,7 +16193,7 @@ const createIgnorePredicate = (patterns, cwd, baseDir) => {
16193
16193
  };
16194
16194
  const normalizeOptions$2 = (options = {}) => {
16195
16195
  const ignoreOption = options.ignore ? Array.isArray(options.ignore) ? options.ignore : [options.ignore] : [];
16196
- const cwd = toPath$1(options.cwd) ?? process$1.cwd();
16196
+ const cwd = toPath$1(options.cwd) ?? y.cwd();
16197
16197
  const deep = typeof options.deep === "number" ? Math.max(0, options.deep) + 1 : Number.POSITIVE_INFINITY;
16198
16198
  return {
16199
16199
  cwd,
@@ -16290,7 +16290,7 @@ const getDirectoryGlob = ({ directoryPath, files, extensions }) => {
16290
16290
  const extensionGlob = extensions?.length > 0 ? `.${extensions.length > 1 ? `{${extensions.join(",")}}` : extensions[0]}` : "";
16291
16291
  return files ? files.map((file) => path.posix.join(directoryPath, `**/${path.extname(file) ? file : `${file}${extensionGlob}`}`)) : [path.posix.join(directoryPath, `**${extensionGlob ? `/*${extensionGlob}` : ""}`)];
16292
16292
  };
16293
- const directoryToGlob = async (directoryPaths, { cwd = process$1.cwd(), files, extensions, fs: fsImplementation } = {}) => {
16293
+ const directoryToGlob = async (directoryPaths, { cwd = y.cwd(), files, extensions, fs: fsImplementation } = {}) => {
16294
16294
  return (await Promise.all(directoryPaths.map(async (directoryPath) => {
16295
16295
  if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
16296
16296
  directoryPath,
@@ -16304,7 +16304,7 @@ const directoryToGlob = async (directoryPaths, { cwd = process$1.cwd(), files, e
16304
16304
  }) : directoryPath;
16305
16305
  }))).flat();
16306
16306
  };
16307
- 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) => {
16308
16308
  if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
16309
16309
  directoryPath,
16310
16310
  files,
@@ -16400,7 +16400,7 @@ const applyIgnoreFilesAndGetFilterSync = (options) => {
16400
16400
  };
16401
16401
  const createFilterFunction = (isIgnored, cwd) => {
16402
16402
  const seen = /* @__PURE__ */ new Set();
16403
- const basePath = cwd || process$1.cwd();
16403
+ const basePath = cwd || y.cwd();
16404
16404
  const pathCache = /* @__PURE__ */ new Map();
16405
16405
  return (fastGlobResult) => {
16406
16406
  const pathKey$1 = path.normalize(fastGlobResult.path ?? fastGlobResult);
@@ -16706,12 +16706,13 @@ const ProjectConfigSchema = object({
16706
16706
  });
16707
16707
  const AppConfigSchema = object({ id: string().min(1, "id cannot be empty") });
16708
16708
  const CreateProjectResponseSchema = looseObject({ id: string() });
16709
- const AppSchema = looseObject({
16709
+ const ProjectSchema = object({
16710
16710
  id: string(),
16711
16711
  name: string(),
16712
- is_managed_source_code: boolean().optional()
16712
+ userDescription: string().optional(),
16713
+ isManagedSourceCode: boolean().optional()
16713
16714
  });
16714
- const AppsResponseSchema = array(AppSchema);
16715
+ const ProjectsResponseSchema = array(ProjectSchema);
16715
16716
 
16716
16717
  //#endregion
16717
16718
  //#region src/core/project/config.ts
@@ -16796,12 +16797,9 @@ async function createProject(projectName, description) {
16796
16797
  } });
16797
16798
  return { projectId: CreateProjectResponseSchema.parse(await response.json()).id };
16798
16799
  }
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 === false);
16800
+ async function listProjects() {
16801
+ const response = await base44Client.get(`api/apps?sort=-updated_date&fields=id,name,user_description,is_managed_source_code`);
16802
+ return ProjectsResponseSchema.parse(await response.json());
16805
16803
  }
16806
16804
 
16807
16805
  //#endregion
@@ -30753,13 +30751,13 @@ var ansi_styles_default = ansiStyles;
30753
30751
 
30754
30752
  //#endregion
30755
30753
  //#region node_modules/chalk/source/vendor/supports-color/index.js
30756
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process$1.argv) {
30754
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : y.argv) {
30757
30755
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
30758
30756
  const position = argv.indexOf(prefix + flag);
30759
30757
  const terminatorPosition = argv.indexOf("--");
30760
30758
  return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
30761
30759
  }
30762
- const { env } = process$1;
30760
+ const { env } = y;
30763
30761
  let flagForceColor;
30764
30762
  if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
30765
30763
  else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
@@ -30792,7 +30790,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
30792
30790
  if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
30793
30791
  const min = forceColor || 0;
30794
30792
  if (env.TERM === "dumb") return min;
30795
- if (process$1.platform === "win32") {
30793
+ if (y.platform === "win32") {
30796
30794
  const osRelease = os.release().split(".");
30797
30795
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
30798
30796
  return 1;
@@ -31531,9 +31529,9 @@ const getSubprocessResult = ({ stdout: stdout$1 }) => {
31531
31529
  //#region node_modules/execa/lib/utils/standard-stream.js
31532
31530
  const isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
31533
31531
  const STANDARD_STREAMS = [
31534
- process$1.stdin,
31535
- process$1.stdout,
31536
- process$1.stderr
31532
+ y.stdin,
31533
+ y.stdout,
31534
+ y.stderr
31537
31535
  ];
31538
31536
  const STANDARD_STREAMS_ALIASES = [
31539
31537
  "stdin",
@@ -31658,9 +31656,9 @@ const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
31658
31656
  //#endregion
31659
31657
  //#region node_modules/is-unicode-supported/index.js
31660
31658
  function isUnicodeSupported() {
31661
- const { env: env$1 } = process$1;
31659
+ const { env: env$1 } = y;
31662
31660
  const { TERM, TERM_PROGRAM } = env$1;
31663
- if (process$1.platform !== "win32") return TERM !== "linux";
31661
+ if (y.platform !== "win32") return TERM !== "linux";
31664
31662
  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";
31665
31663
  }
31666
31664
 
@@ -32587,7 +32585,7 @@ const TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
32587
32585
 
32588
32586
  //#endregion
32589
32587
  //#region node_modules/npm-run-path/index.js
32590
- const npmRunPath = ({ cwd = process$1.cwd(), path: pathOption = process$1.env[pathKey()], preferLocal = true, execPath: execPath$1 = process$1.execPath, addExecPath = true } = {}) => {
32588
+ const npmRunPath = ({ cwd = y.cwd(), path: pathOption = y.env[pathKey()], preferLocal = true, execPath: execPath$1 = y.execPath, addExecPath = true } = {}) => {
32591
32589
  const cwdPath = path.resolve(toPath(cwd));
32592
32590
  const result = [];
32593
32591
  const pathParts = pathOption.split(path.delimiter);
@@ -32605,7 +32603,7 @@ const applyExecPath = (result, pathParts, execPath$1, cwdPath) => {
32605
32603
  const pathPart = path.resolve(cwdPath, toPath(execPath$1), "..");
32606
32604
  if (!pathParts.includes(pathPart)) result.push(pathPart);
32607
32605
  };
32608
- const npmRunPathEnv = ({ env: env$1 = process$1.env, ...options } = {}) => {
32606
+ const npmRunPathEnv = ({ env: env$1 = y.env, ...options } = {}) => {
32609
32607
  env$1 = { ...env$1 };
32610
32608
  const pathName = pathKey({ env: env$1 });
32611
32609
  options.path = env$1[pathName];
@@ -33740,7 +33738,7 @@ const normalizeCwd = (cwd = getDefaultCwd()) => {
33740
33738
  };
33741
33739
  const getDefaultCwd = () => {
33742
33740
  try {
33743
- return process$1.cwd();
33741
+ return y.cwd();
33744
33742
  } catch (error) {
33745
33743
  error.message = `The current directory does not exist.\n${error.message}`;
33746
33744
  throw error;
@@ -33775,7 +33773,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
33775
33773
  options.killSignal = normalizeKillSignal(options.killSignal);
33776
33774
  options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
33777
33775
  options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
33778
- if (process$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
33776
+ if (y.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
33779
33777
  return {
33780
33778
  file,
33781
33779
  commandArguments,
@@ -33802,7 +33800,7 @@ const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDi
33802
33800
  });
33803
33801
  const getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
33804
33802
  const env$1 = extendEnv ? {
33805
- ...process$1.env,
33803
+ ...y.env,
33806
33804
  ...envOption
33807
33805
  } : envOption;
33808
33806
  if (preferLocal || node) return npmRunPathEnv({
@@ -34802,12 +34800,12 @@ const guessStreamDirection = {
34802
34800
  }
34803
34801
  };
34804
34802
  const getStandardStreamDirection = (value) => {
34805
- if ([0, process$1.stdin].includes(value)) return "input";
34803
+ if ([0, y.stdin].includes(value)) return "input";
34806
34804
  if ([
34807
34805
  1,
34808
34806
  2,
34809
- process$1.stdout,
34810
- process$1.stderr
34807
+ y.stdout,
34808
+ y.stderr
34811
34809
  ].includes(value)) return "output";
34812
34810
  };
34813
34811
  const DEFAULT_DIRECTION = "output";
@@ -35871,9 +35869,9 @@ const addIpcMethods = (subprocess, { ipc }) => {
35871
35869
  Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
35872
35870
  };
35873
35871
  const getIpcExport = () => {
35874
- const anyProcess = process$1;
35872
+ const anyProcess = y;
35875
35873
  const isSubprocess = true;
35876
- const ipc = process$1.channel !== void 0;
35874
+ const ipc = y.channel !== void 0;
35877
35875
  return {
35878
35876
  ...getIpcMethods(anyProcess, isSubprocess, ipc),
35879
35877
  getCancelSignal: getCancelSignal$1.bind(void 0, {
@@ -36115,7 +36113,7 @@ if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SI
36115
36113
 
36116
36114
  //#endregion
36117
36115
  //#region node_modules/signal-exit/dist/mjs/index.js
36118
- 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";
36116
+ 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";
36119
36117
  const kExitEmitter = Symbol.for("signal-exit emitter");
36120
36118
  const global$1 = globalThis;
36121
36119
  const ObjectDefineProperty = Object.defineProperty.bind(Object);
@@ -36183,7 +36181,7 @@ var SignalExitFallback = class extends SignalExitBase {
36183
36181
  };
36184
36182
  var SignalExit = class extends SignalExitBase {
36185
36183
  /* c8 ignore start */
36186
- #hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
36184
+ #hupSig = process$1.platform === "win32" ? "SIGINT" : "SIGHUP";
36187
36185
  /* c8 ignore stop */
36188
36186
  #emitter = new Emitter();
36189
36187
  #process;
@@ -36191,15 +36189,15 @@ var SignalExit = class extends SignalExitBase {
36191
36189
  #originalProcessReallyExit;
36192
36190
  #sigListeners = {};
36193
36191
  #loaded = false;
36194
- constructor(process$5) {
36192
+ constructor(process$4) {
36195
36193
  super();
36196
- this.#process = process$5;
36194
+ this.#process = process$4;
36197
36195
  this.#sigListeners = {};
36198
36196
  for (const sig of signals) this.#sigListeners[sig] = () => {
36199
36197
  const listeners = this.#process.listeners(sig);
36200
36198
  let { count: count$1 } = this.#emitter;
36201
36199
  /* c8 ignore start */
36202
- const p$1 = process$5;
36200
+ const p$1 = process$4;
36203
36201
  if (typeof p$1.__signal_exit_emitter__ === "object" && typeof p$1.__signal_exit_emitter__.count === "number") count$1 += p$1.__signal_exit_emitter__.count;
36204
36202
  /* c8 ignore stop */
36205
36203
  if (listeners.length === count$1) {
@@ -36207,11 +36205,11 @@ var SignalExit = class extends SignalExitBase {
36207
36205
  const ret = this.#emitter.emit("exit", null, sig);
36208
36206
  /* c8 ignore start */
36209
36207
  const s = sig === "SIGHUP" ? this.#hupSig : sig;
36210
- if (!ret) process$5.kill(process$5.pid, s);
36208
+ if (!ret) process$4.kill(process$4.pid, s);
36211
36209
  }
36212
36210
  };
36213
- this.#originalProcessReallyExit = process$5.reallyExit;
36214
- this.#originalProcessEmit = process$5.emit;
36211
+ this.#originalProcessReallyExit = process$4.reallyExit;
36212
+ this.#originalProcessEmit = process$4.emit;
36215
36213
  }
36216
36214
  onExit(cb, opts) {
36217
36215
  /* c8 ignore start */
@@ -36278,8 +36276,8 @@ var SignalExit = class extends SignalExitBase {
36278
36276
  } else return og.call(this.#process, ev, ...args);
36279
36277
  }
36280
36278
  };
36281
- const process$2 = globalThis.process;
36282
- const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
36279
+ const process$1 = globalThis.process;
36280
+ const { onExit, load, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
36283
36281
 
36284
36282
  //#endregion
36285
36283
  //#region node_modules/execa/lib/terminate/cleanup.js
@@ -38216,7 +38214,7 @@ function isInsideContainer() {
38216
38214
  //#endregion
38217
38215
  //#region node_modules/is-wsl/index.js
38218
38216
  const isWsl = () => {
38219
- if (process$1.platform !== "linux") return false;
38217
+ if (y.platform !== "linux") return false;
38220
38218
  if (os.release().toLowerCase().includes("microsoft")) {
38221
38219
  if (isInsideContainer()) return false;
38222
38220
  return true;
@@ -38227,12 +38225,12 @@ const isWsl = () => {
38227
38225
  return false;
38228
38226
  }
38229
38227
  };
38230
- var is_wsl_default = process$1.env.__IS_WSL_TEST__ ? isWsl : isWsl();
38228
+ var is_wsl_default = y.env.__IS_WSL_TEST__ ? isWsl : isWsl();
38231
38229
 
38232
38230
  //#endregion
38233
38231
  //#region node_modules/powershell-utils/index.js
38234
38232
  const execFile$2 = promisify(childProcess.execFile);
38235
- const powerShellPath$1 = () => `${process$1.env.SYSTEMROOT || process$1.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
38233
+ const powerShellPath$1 = () => `${y.env.SYSTEMROOT || y.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
38236
38234
  const executePowerShell = async (command, options = {}) => {
38237
38235
  const { powerShellPath: psPath, ...execFileOptions } = options;
38238
38236
  const encodedCommand = executePowerShell.encodeCommand(command);
@@ -38343,7 +38341,7 @@ function defineLazyProperty(object$1, propertyName, valueGetter) {
38343
38341
  //#region node_modules/default-browser-id/index.js
38344
38342
  const execFileAsync$3 = promisify(execFile);
38345
38343
  async function defaultBrowserId() {
38346
- if (process$1.platform !== "darwin") throw new Error("macOS only");
38344
+ if (y.platform !== "darwin") throw new Error("macOS only");
38347
38345
  const { stdout: stdout$1 } = await execFileAsync$3("defaults", [
38348
38346
  "read",
38349
38347
  "com.apple.LaunchServices/com.apple.launchservices.secure",
@@ -38358,7 +38356,7 @@ async function defaultBrowserId() {
38358
38356
  //#region node_modules/run-applescript/index.js
38359
38357
  const execFileAsync$2 = promisify(execFile);
38360
38358
  async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
38361
- if (process$1.platform !== "darwin") throw new Error("macOS only");
38359
+ if (y.platform !== "darwin") throw new Error("macOS only");
38362
38360
  const outputArguments = humanReadableOutput ? [] : ["-ss"];
38363
38361
  const execOptions = {};
38364
38362
  if (signal) execOptions.signal = signal;
@@ -38467,14 +38465,14 @@ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
38467
38465
  const execFileAsync = promisify(execFile);
38468
38466
  const titleize = (string$2) => string$2.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x$2) => x$2.toUpperCase());
38469
38467
  async function defaultBrowser() {
38470
- if (process$1.platform === "darwin") {
38468
+ if (y.platform === "darwin") {
38471
38469
  const id = await defaultBrowserId();
38472
38470
  return {
38473
38471
  name: await bundleName(id),
38474
38472
  id
38475
38473
  };
38476
38474
  }
38477
- if (process$1.platform === "linux") {
38475
+ if (y.platform === "linux") {
38478
38476
  const { stdout: stdout$1 } = await execFileAsync("xdg-mime", [
38479
38477
  "query",
38480
38478
  "default",
@@ -38486,13 +38484,13 @@ async function defaultBrowser() {
38486
38484
  id
38487
38485
  };
38488
38486
  }
38489
- if (process$1.platform === "win32") return defaultBrowser$1();
38487
+ if (y.platform === "win32") return defaultBrowser$1();
38490
38488
  throw new Error("Only macOS, Linux, and Windows are supported");
38491
38489
  }
38492
38490
 
38493
38491
  //#endregion
38494
38492
  //#region node_modules/is-in-ssh/index.js
38495
- const isInSsh = Boolean(process$1.env.SSH_CONNECTION || process$1.env.SSH_CLIENT || process$1.env.SSH_TTY);
38493
+ const isInSsh = Boolean(y.env.SSH_CONNECTION || y.env.SSH_CLIENT || y.env.SSH_TTY);
38496
38494
  var is_in_ssh_default = isInSsh;
38497
38495
 
38498
38496
  //#endregion
@@ -38500,7 +38498,7 @@ var is_in_ssh_default = isInSsh;
38500
38498
  const fallbackAttemptSymbol = Symbol("fallbackAttempt");
38501
38499
  const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
38502
38500
  const localXdgOpenPath = path.join(__dirname, "xdg-open");
38503
- const { platform: platform$1, arch } = process$1;
38501
+ const { platform: platform$1, arch } = y;
38504
38502
  const tryEachApp = async (apps$1, opener) => {
38505
38503
  if (apps$1.length === 0) return;
38506
38504
  const errors = [];
@@ -38613,7 +38611,7 @@ const baseOpen = async (options) => {
38613
38611
  await fs$1.access(localXdgOpenPath, constants$1.X_OK);
38614
38612
  exeLocalXdgOpen = true;
38615
38613
  } catch {}
38616
- command = process$1.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
38614
+ command = y.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
38617
38615
  }
38618
38616
  if (appArguments.length > 0) cliArguments.push(...appArguments);
38619
38617
  if (!options.wait) {
@@ -38756,20 +38754,21 @@ const deployCommand = new Command("deploy").description("Deploy all project reso
38756
38754
  //#endregion
38757
38755
  //#region src/cli/commands/project/link.ts
38758
38756
  function validateNonInteractiveFlags(command) {
38759
- const { create: create$1, existing, name: name$1 } = command.opts();
38757
+ const { create: create$1, name: name$1, existing, projectId } = command.opts();
38760
38758
  if (create$1 && existing) command.error("--create and --existing cannot be used together");
38759
+ if (existing && !projectId) command.error("--projectId is required when using --existing");
38761
38760
  if (create$1 && !name$1) command.error("--name is required when using --create");
38762
38761
  }
38763
- async function promptForLinkAction(linkableApps) {
38762
+ async function promptForLinkAction() {
38764
38763
  const actionOptions = [{
38765
38764
  value: "create",
38766
38765
  label: "Create a new project",
38767
38766
  hint: "Create a new Base44 project and link it"
38768
38767
  }];
38769
- if (linkableApps.length > 0) actionOptions.push({
38768
+ actionOptions.push({
38770
38769
  value: "choose",
38771
38770
  label: "Link an existing project",
38772
- hint: `Choose from ${linkableApps.length} available project${linkableApps.length === 1 ? "" : "s"}`
38771
+ hint: `Choose from one of your available projects previously created by the Base44 CLI`
38773
38772
  });
38774
38773
  const action = await ve({
38775
38774
  message: "How would you like to link this project?",
@@ -38802,95 +38801,67 @@ async function promptForNewProjectDetails() {
38802
38801
  description: result.description ? result.description.trim() : void 0
38803
38802
  };
38804
38803
  }
38805
- async function promptForExistingApp(linkableApps) {
38806
- const selectedApp = await ve({
38804
+ async function promptForExistingProject(linkableProjects) {
38805
+ const selectedProject = await ve({
38807
38806
  message: "Choose a project to link",
38808
- options: linkableApps.map((app) => ({
38809
- value: app,
38810
- label: app.name
38807
+ options: linkableProjects.map((project) => ({
38808
+ value: project,
38809
+ label: project.name
38811
38810
  }))
38812
38811
  });
38813
- if (pD(selectedApp)) {
38812
+ if (pD(selectedProject)) {
38814
38813
  xe("Operation cancelled.");
38815
38814
  process.exit(0);
38816
38815
  }
38817
- return selectedApp;
38816
+ return selectedProject;
38818
38817
  }
38819
38818
  async function link(options) {
38820
38819
  const projectRoot = await findProjectRoot();
38821
38820
  if (!projectRoot) throw new Error("No Base44 project found. Run this command from a project directory with a config.jsonc file.");
38822
38821
  if (await appConfigExists(projectRoot.root)) throw new Error("Project is already linked. An .app.jsonc file with the appId already exists.");
38823
- if (options.existing) {
38824
- const app = (await runTask("Validating project...", async () => fetchApps(), {
38825
- successMessage: "Project validated",
38826
- errorMessage: "Failed to validate project"
38827
- })).find((a$1) => a$1.id === options.existing);
38828
- if (!app) throw new Error(`Project with ID "${options.existing}" not found. Please check the ID and try again.`);
38829
- if (app.is_managed_source_code === true) throw new Error(`Project "${app.name}" is managed by Base44 AI and cannot be linked to external source code.`);
38822
+ let finalProjectId;
38823
+ const action = options.existing ? "choose" : options.create ? "create" : await promptForLinkAction();
38824
+ if (action === "choose") {
38825
+ const linkableProjects = (await runTask("Fetching projects...", async () => listProjects(), {
38826
+ successMessage: "Projects fetched",
38827
+ errorMessage: "Failed to fetch projects"
38828
+ })).filter((p$1) => p$1.isManagedSourceCode !== true);
38829
+ if (!linkableProjects.length) return { outroMessage: "No projects available for linking" };
38830
+ const { id: projectId } = options.existing ? { id: options.projectId } : await promptForExistingProject(linkableProjects);
38830
38831
  await runTask("Linking project...", async () => {
38831
- await writeAppConfig(projectRoot.root, options.existing);
38832
+ await writeAppConfig(projectRoot.root, projectId);
38832
38833
  setAppConfig({
38833
- id: options.existing,
38834
+ id: projectId,
38834
38835
  projectRoot: projectRoot.root
38835
38836
  });
38836
38837
  }, {
38837
38838
  successMessage: "Project linked successfully",
38838
38839
  errorMessage: "Failed to link project"
38839
38840
  });
38840
- M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(options.existing))}`);
38841
- return { outroMessage: "Project linked" };
38842
- }
38843
- if (options.create) {
38844
- const { projectId: projectId$1 } = await runTask("Creating project on Base44...", async () => {
38845
- return await createProject(options.name.trim(), options.description?.trim());
38841
+ finalProjectId = projectId;
38842
+ }
38843
+ if (action === "create") {
38844
+ const { name: name$1, description } = options.create ? {
38845
+ name: options.name.trim(),
38846
+ description: options.description?.trim()
38847
+ } : await promptForNewProjectDetails();
38848
+ const { projectId } = await runTask("Creating project on Base44...", async () => {
38849
+ return await createProject(name$1, description);
38846
38850
  }, {
38847
38851
  successMessage: "Project created successfully",
38848
38852
  errorMessage: "Failed to create project"
38849
38853
  });
38850
- await writeAppConfig(projectRoot.root, projectId$1);
38854
+ await writeAppConfig(projectRoot.root, projectId);
38851
38855
  setAppConfig({
38852
- id: projectId$1,
38856
+ id: projectId,
38853
38857
  projectRoot: projectRoot.root
38854
38858
  });
38855
- M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(projectId$1))}`);
38856
- return { outroMessage: "Project linked" };
38859
+ finalProjectId = projectId;
38857
38860
  }
38858
- const linkableApps = await runTask("Fetching your projects...", async () => fetchLinkableApps(), {
38859
- successMessage: "Fetched projects",
38860
- errorMessage: "Failed to fetch projects"
38861
- });
38862
- if (linkableApps.length > 0) M.info(`Found ${theme.colors.base44Orange(String(linkableApps.length))} project${linkableApps.length === 1 ? "" : "s"} available for linking`);
38863
- if (await promptForLinkAction(linkableApps) === "choose") {
38864
- const selectedApp = await promptForExistingApp(linkableApps);
38865
- await runTask("Linking project...", async () => {
38866
- await writeAppConfig(projectRoot.root, selectedApp.id);
38867
- setAppConfig({
38868
- id: selectedApp.id,
38869
- projectRoot: projectRoot.root
38870
- });
38871
- }, {
38872
- successMessage: "Project linked successfully",
38873
- errorMessage: "Failed to link project"
38874
- });
38875
- M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(selectedApp.id))}`);
38876
- return { outroMessage: "Project linked" };
38877
- }
38878
- const { name: name$1, description } = await promptForNewProjectDetails();
38879
- const { projectId } = await runTask("Creating project on Base44...", async () => {
38880
- return await createProject(name$1, description);
38881
- }, {
38882
- successMessage: "Project created successfully",
38883
- errorMessage: "Failed to create project"
38884
- });
38885
- await writeAppConfig(projectRoot.root, projectId);
38886
- setAppConfig({
38887
- id: projectId,
38888
- projectRoot: projectRoot.root
38889
- });
38890
- M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(projectId))}`);
38861
+ M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(finalProjectId))}`);
38891
38862
  return { outroMessage: "Project linked" };
38892
38863
  }
38893
- const linkCommand = new Command("link").description("Link a local project to a Base44 project (create new or link existing)").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) => {
38864
+ const linkCommand = new Command("link").description("Link a local project to a Base44 project (create new or link existing)").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").option("-e, --existing", "Link to an existing project (skip selection prompt)").option("-p, --projectId <id>", "Project ID (required when --existing is used)").hook("preAction", validateNonInteractiveFlags).action(async (options) => {
38894
38865
  await runCommand(() => link(options), {
38895
38866
  requireAuth: true,
38896
38867
  requireAppConfig: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/cli",
3
- "version": "0.0.15-pr.97.3ad42c9",
3
+ "version": "0.0.15-pr.97.7d8a65b",
4
4
  "description": "Base44 CLI - Unified interface for managing Base44 applications",
5
5
  "type": "module",
6
6
  "main": "./dist/cli/index.js",