@base44-preview/cli 0.0.21-pr.112.9c80207 → 0.0.21-pr.112.c15189d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +296 -179
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { EventEmitter, addAbortListener, on, once, setMaxListeners } from "node:
3
3
  import childProcess, { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
4
4
  import path, { basename, dirname, join, posix, resolve, win32 } from "node:path";
5
5
  import fs, { appendFileSync, createReadStream, createWriteStream, readFileSync, statSync, writeFileSync } from "node:fs";
6
- import y, { execArgv, execPath, hrtime, platform, stdin, stdout } from "node:process";
6
+ import process$1, { execArgv, execPath, hrtime, platform, stdin, stdout } from "node:process";
7
7
  import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
8
8
  import * as g from "node:readline";
9
9
  import O from "node:readline";
@@ -893,7 +893,7 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
893
893
  const childProcess$1 = __require("node:child_process");
894
894
  const path$15 = __require("node:path");
895
895
  const fs$10 = __require("node:fs");
896
- const process$3 = __require("node:process");
896
+ const process$4 = __require("node:process");
897
897
  const { Argument, humanReadableArgName } = require_argument();
898
898
  const { CommanderError } = require_error$1();
899
899
  const { Help } = require_help();
@@ -944,10 +944,10 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
944
944
  this._showHelpAfterError = false;
945
945
  this._showSuggestionAfterError = true;
946
946
  this._outputConfiguration = {
947
- writeOut: (str) => process$3.stdout.write(str),
948
- writeErr: (str) => process$3.stderr.write(str),
949
- getOutHelpWidth: () => process$3.stdout.isTTY ? process$3.stdout.columns : void 0,
950
- getErrHelpWidth: () => process$3.stderr.isTTY ? process$3.stderr.columns : void 0,
947
+ writeOut: (str) => process$4.stdout.write(str),
948
+ writeErr: (str) => process$4.stderr.write(str),
949
+ getOutHelpWidth: () => process$4.stdout.isTTY ? process$4.stdout.columns : void 0,
950
+ getErrHelpWidth: () => process$4.stderr.isTTY ? process$4.stderr.columns : void 0,
951
951
  outputError: (str, write) => write(str)
952
952
  };
953
953
  this._hidden = false;
@@ -1301,7 +1301,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1301
1301
  */
1302
1302
  _exit(exitCode, code$1, message) {
1303
1303
  if (this._exitCallback) this._exitCallback(new CommanderError(exitCode, code$1, message));
1304
- process$3.exit(exitCode);
1304
+ process$4.exit(exitCode);
1305
1305
  }
1306
1306
  /**
1307
1307
  * Register callback `fn` for the command.
@@ -1640,11 +1640,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
1640
1640
  if (argv !== void 0 && !Array.isArray(argv)) throw new Error("first parameter to parse must be array or undefined");
1641
1641
  parseOptions = parseOptions || {};
1642
1642
  if (argv === void 0 && parseOptions.from === void 0) {
1643
- if (process$3.versions?.electron) parseOptions.from = "electron";
1644
- const execArgv$1 = process$3.execArgv ?? [];
1643
+ if (process$4.versions?.electron) parseOptions.from = "electron";
1644
+ const execArgv$1 = process$4.execArgv ?? [];
1645
1645
  if (execArgv$1.includes("-e") || execArgv$1.includes("--eval") || execArgv$1.includes("-p") || execArgv$1.includes("--print")) parseOptions.from = "eval";
1646
1646
  }
1647
- if (argv === void 0) argv = process$3.argv;
1647
+ if (argv === void 0) argv = process$4.argv;
1648
1648
  this.rawArgs = argv.slice();
1649
1649
  let userArgs;
1650
1650
  switch (parseOptions.from) {
@@ -1654,7 +1654,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1654
1654
  userArgs = argv.slice(2);
1655
1655
  break;
1656
1656
  case "electron":
1657
- if (process$3.defaultApp) {
1657
+ if (process$4.defaultApp) {
1658
1658
  this._scriptPath = argv[1];
1659
1659
  userArgs = argv.slice(2);
1660
1660
  } else userArgs = argv.slice(1);
@@ -1768,15 +1768,15 @@ Expecting one of '${allowedValues.join("', '")}'`);
1768
1768
  }
1769
1769
  launchWithNode = sourceExt.includes(path$15.extname(executableFile));
1770
1770
  let proc$1;
1771
- if (process$3.platform !== "win32") if (launchWithNode) {
1771
+ if (process$4.platform !== "win32") if (launchWithNode) {
1772
1772
  args.unshift(executableFile);
1773
- args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
1774
- proc$1 = childProcess$1.spawn(process$3.argv[0], args, { stdio: "inherit" });
1773
+ args = incrementNodeInspectorPort(process$4.execArgv).concat(args);
1774
+ proc$1 = childProcess$1.spawn(process$4.argv[0], args, { stdio: "inherit" });
1775
1775
  } else proc$1 = childProcess$1.spawn(executableFile, args, { stdio: "inherit" });
1776
1776
  else {
1777
1777
  args.unshift(executableFile);
1778
- args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
1779
- proc$1 = childProcess$1.spawn(process$3.execPath, args, { stdio: "inherit" });
1778
+ args = incrementNodeInspectorPort(process$4.execArgv).concat(args);
1779
+ proc$1 = childProcess$1.spawn(process$4.execPath, args, { stdio: "inherit" });
1780
1780
  }
1781
1781
  if (!proc$1.killed) [
1782
1782
  "SIGUSR1",
@@ -1785,14 +1785,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
1785
1785
  "SIGINT",
1786
1786
  "SIGHUP"
1787
1787
  ].forEach((signal) => {
1788
- process$3.on(signal, () => {
1788
+ process$4.on(signal, () => {
1789
1789
  if (proc$1.killed === false && proc$1.exitCode === null) proc$1.kill(signal);
1790
1790
  });
1791
1791
  });
1792
1792
  const exitCallback = this._exitCallback;
1793
1793
  proc$1.on("close", (code$1) => {
1794
1794
  code$1 = code$1 ?? 1;
1795
- if (!exitCallback) process$3.exit(code$1);
1795
+ if (!exitCallback) process$4.exit(code$1);
1796
1796
  else exitCallback(new CommanderError(code$1, "commander.executeSubCommandAsync", "(close)"));
1797
1797
  });
1798
1798
  proc$1.on("error", (err) => {
@@ -1804,7 +1804,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1804
1804
  - ${executableDirMessage}`;
1805
1805
  throw new Error(executableMissing);
1806
1806
  } else if (err.code === "EACCES") throw new Error(`'${executableFile}' not executable`);
1807
- if (!exitCallback) process$3.exit(1);
1807
+ if (!exitCallback) process$4.exit(1);
1808
1808
  else {
1809
1809
  const wrappedError = new CommanderError(1, "commander.executeSubCommandAsync", "(error)");
1810
1810
  wrappedError.nestedError = err;
@@ -2210,13 +2210,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
2210
2210
  */
2211
2211
  _parseOptionsEnv() {
2212
2212
  this.options.forEach((option) => {
2213
- if (option.envVar && option.envVar in process$3.env) {
2213
+ if (option.envVar && option.envVar in process$4.env) {
2214
2214
  const optionKey = option.attributeName();
2215
2215
  if (this.getOptionValue(optionKey) === void 0 || [
2216
2216
  "default",
2217
2217
  "config",
2218
2218
  "env"
2219
- ].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$3.env[option.envVar]);
2219
+ ].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$4.env[option.envVar]);
2220
2220
  else this.emit(`optionEnv:${option.name()}`);
2221
2221
  }
2222
2222
  });
@@ -2595,7 +2595,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2595
2595
  */
2596
2596
  help(contextOptions) {
2597
2597
  this.outputHelp(contextOptions);
2598
- let exitCode = process$3.exitCode || 0;
2598
+ let exitCode = process$4.exitCode || 0;
2599
2599
  if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) exitCode = 1;
2600
2600
  this._exit(exitCode, "commander.help", "(outputHelp)");
2601
2601
  }
@@ -2711,16 +2711,16 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2711
2711
  const CSI = `${ESC}[`;
2712
2712
  const beep = "\x07";
2713
2713
  const cursor = {
2714
- to(x$2, y$2) {
2715
- if (!y$2) return `${CSI}${x$2 + 1}G`;
2716
- return `${CSI}${y$2 + 1};${x$2 + 1}H`;
2714
+ to(x$2, y$1) {
2715
+ if (!y$1) return `${CSI}${x$2 + 1}G`;
2716
+ return `${CSI}${y$1 + 1};${x$2 + 1}H`;
2717
2717
  },
2718
- move(x$2, y$2) {
2718
+ move(x$2, y$1) {
2719
2719
  let ret = "";
2720
2720
  if (x$2 < 0) ret += `${CSI}${-x$2}D`;
2721
2721
  else if (x$2 > 0) ret += `${CSI}${x$2}C`;
2722
- if (y$2 < 0) ret += `${CSI}${-y$2}A`;
2723
- else if (y$2 > 0) ret += `${CSI}${y$2}B`;
2722
+ if (y$1 < 0) ret += `${CSI}${-y$1}A`;
2723
+ else if (y$1 > 0) ret += `${CSI}${y$1}B`;
2724
2724
  return ret;
2725
2725
  },
2726
2726
  up: (count$1 = 1) => `${CSI}${count$1}A`,
@@ -3030,13 +3030,13 @@ function rD() {
3030
3030
  }
3031
3031
  }), r;
3032
3032
  }
3033
- 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) => {
3033
+ 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
3034
  const F$1 = [...u$2];
3035
3035
  let s = !1, i$1 = !1, D$1 = p(P$1(e$1[e$1.length - 1]));
3036
3036
  for (const [C$1, n$1] of F$1.entries()) {
3037
3037
  const E = p(n$1);
3038
3038
  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) {
3039
- i$1 ? n$1 === y$1 && (s = !1, i$1 = !1) : n$1 === G$1 && (s = !1);
3039
+ i$1 ? n$1 === y && (s = !1, i$1 = !1) : n$1 === G$1 && (s = !1);
3040
3040
  continue;
3041
3041
  }
3042
3042
  D$1 += E, D$1 === t && C$1 < F$1.length - 1 && (e$1.push(""), D$1 = 0);
@@ -3078,7 +3078,7 @@ const ED = rD(), d$1 = new Set(["\x1B", "›"]), oD = 39, y$1 = "\x07", V$1 = "["
3078
3078
  `)];
3079
3079
  for (const [E, a$1] of n$1.entries()) {
3080
3080
  if (F$1 += a$1, d$1.has(a$1)) {
3081
- const { groups: c$1 } = (/* @__PURE__ */ new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y$1})`)).exec(n$1.slice(E).join("")) || { groups: {} };
3081
+ const { groups: c$1 } = (/* @__PURE__ */ new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y})`)).exec(n$1.slice(E).join("")) || { groups: {} };
3082
3082
  if (c$1.code !== void 0) {
3083
3083
  const f = Number.parseFloat(c$1.code);
3084
3084
  s = f === oD ? void 0 : f;
@@ -3479,7 +3479,7 @@ var RD = class extends x$1 {
3479
3479
  //#endregion
3480
3480
  //#region node_modules/@clack/prompts/dist/index.mjs
3481
3481
  function ce() {
3482
- 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";
3482
+ 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
3483
  }
3484
3484
  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) => {
3485
3485
  switch (t) {
@@ -5818,6 +5818,97 @@ function handleTupleResult(result, final, index) {
5818
5818
  if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
5819
5819
  final.value[index] = result.value;
5820
5820
  }
5821
+ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
5822
+ $ZodType.init(inst, def);
5823
+ inst._zod.parse = (payload, ctx) => {
5824
+ const input = payload.value;
5825
+ if (!isPlainObject$1(input)) {
5826
+ payload.issues.push({
5827
+ expected: "record",
5828
+ code: "invalid_type",
5829
+ input,
5830
+ inst
5831
+ });
5832
+ return payload;
5833
+ }
5834
+ const proms = [];
5835
+ const values = def.keyType._zod.values;
5836
+ if (values) {
5837
+ payload.value = {};
5838
+ const recordKeys = /* @__PURE__ */ new Set();
5839
+ for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
5840
+ recordKeys.add(typeof key === "number" ? key.toString() : key);
5841
+ const result = def.valueType._zod.run({
5842
+ value: input[key],
5843
+ issues: []
5844
+ }, ctx);
5845
+ if (result instanceof Promise) proms.push(result.then((result$1) => {
5846
+ if (result$1.issues.length) payload.issues.push(...prefixIssues(key, result$1.issues));
5847
+ payload.value[key] = result$1.value;
5848
+ }));
5849
+ else {
5850
+ if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
5851
+ payload.value[key] = result.value;
5852
+ }
5853
+ }
5854
+ let unrecognized;
5855
+ for (const key in input) if (!recordKeys.has(key)) {
5856
+ unrecognized = unrecognized ?? [];
5857
+ unrecognized.push(key);
5858
+ }
5859
+ if (unrecognized && unrecognized.length > 0) payload.issues.push({
5860
+ code: "unrecognized_keys",
5861
+ input,
5862
+ inst,
5863
+ keys: unrecognized
5864
+ });
5865
+ } else {
5866
+ payload.value = {};
5867
+ for (const key of Reflect.ownKeys(input)) {
5868
+ if (key === "__proto__") continue;
5869
+ let keyResult = def.keyType._zod.run({
5870
+ value: key,
5871
+ issues: []
5872
+ }, ctx);
5873
+ if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
5874
+ if (typeof key === "string" && number$1.test(key) && keyResult.issues.length && keyResult.issues.some((iss) => iss.code === "invalid_type" && iss.expected === "number")) {
5875
+ const retryResult = def.keyType._zod.run({
5876
+ value: Number(key),
5877
+ issues: []
5878
+ }, ctx);
5879
+ if (retryResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
5880
+ if (retryResult.issues.length === 0) keyResult = retryResult;
5881
+ }
5882
+ if (keyResult.issues.length) {
5883
+ if (def.mode === "loose") payload.value[key] = input[key];
5884
+ else payload.issues.push({
5885
+ code: "invalid_key",
5886
+ origin: "record",
5887
+ issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
5888
+ input: key,
5889
+ path: [key],
5890
+ inst
5891
+ });
5892
+ continue;
5893
+ }
5894
+ const result = def.valueType._zod.run({
5895
+ value: input[key],
5896
+ issues: []
5897
+ }, ctx);
5898
+ if (result instanceof Promise) proms.push(result.then((result$1) => {
5899
+ if (result$1.issues.length) payload.issues.push(...prefixIssues(key, result$1.issues));
5900
+ payload.value[keyResult.value] = result$1.value;
5901
+ }));
5902
+ else {
5903
+ if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
5904
+ payload.value[keyResult.value] = result.value;
5905
+ }
5906
+ }
5907
+ }
5908
+ if (proms.length) return Promise.all(proms).then(() => payload);
5909
+ return payload;
5910
+ };
5911
+ });
5821
5912
  const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
5822
5913
  $ZodType.init(inst, def);
5823
5914
  const values = getEnumValues(def.entries);
@@ -6653,7 +6744,7 @@ function initializeContext(params) {
6653
6744
  external: params?.external ?? void 0
6654
6745
  };
6655
6746
  }
6656
- function process$2(schema, ctx, _params = {
6747
+ function process$3(schema, ctx, _params = {
6657
6748
  path: [],
6658
6749
  schemaPath: []
6659
6750
  }) {
@@ -6690,7 +6781,7 @@ function process$2(schema, ctx, _params = {
6690
6781
  const parent = schema._zod.parent;
6691
6782
  if (parent) {
6692
6783
  if (!result.ref) result.ref = parent;
6693
- process$2(parent, ctx, params);
6784
+ process$3(parent, ctx, params);
6694
6785
  ctx.seen.get(parent).isParent = true;
6695
6786
  }
6696
6787
  }
@@ -6902,7 +6993,7 @@ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
6902
6993
  ...params,
6903
6994
  processors
6904
6995
  });
6905
- process$2(schema, ctx);
6996
+ process$3(schema, ctx);
6906
6997
  extractDefs(ctx, schema);
6907
6998
  return finalize(ctx, schema);
6908
6999
  };
@@ -6914,7 +7005,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
6914
7005
  io,
6915
7006
  processors
6916
7007
  });
6917
- process$2(schema, ctx);
7008
+ process$3(schema, ctx);
6918
7009
  extractDefs(ctx, schema);
6919
7010
  return finalize(ctx, schema);
6920
7011
  };
@@ -7001,7 +7092,7 @@ const arrayProcessor = (schema, ctx, _json, params) => {
7001
7092
  if (typeof minimum === "number") json.minItems = minimum;
7002
7093
  if (typeof maximum === "number") json.maxItems = maximum;
7003
7094
  json.type = "array";
7004
- json.items = process$2(def.element, ctx, {
7095
+ json.items = process$3(def.element, ctx, {
7005
7096
  ...params,
7006
7097
  path: [...params.path, "items"]
7007
7098
  });
@@ -7012,7 +7103,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
7012
7103
  json.type = "object";
7013
7104
  json.properties = {};
7014
7105
  const shape = def.shape;
7015
- for (const key in shape) json.properties[key] = process$2(shape[key], ctx, {
7106
+ for (const key in shape) json.properties[key] = process$3(shape[key], ctx, {
7016
7107
  ...params,
7017
7108
  path: [
7018
7109
  ...params.path,
@@ -7030,7 +7121,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
7030
7121
  if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
7031
7122
  else if (!def.catchall) {
7032
7123
  if (ctx.io === "output") json.additionalProperties = false;
7033
- } else if (def.catchall) json.additionalProperties = process$2(def.catchall, ctx, {
7124
+ } else if (def.catchall) json.additionalProperties = process$3(def.catchall, ctx, {
7034
7125
  ...params,
7035
7126
  path: [...params.path, "additionalProperties"]
7036
7127
  });
@@ -7038,7 +7129,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
7038
7129
  const unionProcessor = (schema, ctx, json, params) => {
7039
7130
  const def = schema._zod.def;
7040
7131
  const isExclusive = def.inclusive === false;
7041
- const options = def.options.map((x$2, i$1) => process$2(x$2, ctx, {
7132
+ const options = def.options.map((x$2, i$1) => process$3(x$2, ctx, {
7042
7133
  ...params,
7043
7134
  path: [
7044
7135
  ...params.path,
@@ -7051,7 +7142,7 @@ const unionProcessor = (schema, ctx, json, params) => {
7051
7142
  };
7052
7143
  const intersectionProcessor = (schema, ctx, json, params) => {
7053
7144
  const def = schema._zod.def;
7054
- const a$1 = process$2(def.left, ctx, {
7145
+ const a$1 = process$3(def.left, ctx, {
7055
7146
  ...params,
7056
7147
  path: [
7057
7148
  ...params.path,
@@ -7059,7 +7150,7 @@ const intersectionProcessor = (schema, ctx, json, params) => {
7059
7150
  0
7060
7151
  ]
7061
7152
  });
7062
- const b$2 = process$2(def.right, ctx, {
7153
+ const b$2 = process$3(def.right, ctx, {
7063
7154
  ...params,
7064
7155
  path: [
7065
7156
  ...params.path,
@@ -7076,7 +7167,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7076
7167
  json.type = "array";
7077
7168
  const prefixPath$1 = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
7078
7169
  const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
7079
- const prefixItems = def.items.map((x$2, i$1) => process$2(x$2, ctx, {
7170
+ const prefixItems = def.items.map((x$2, i$1) => process$3(x$2, ctx, {
7080
7171
  ...params,
7081
7172
  path: [
7082
7173
  ...params.path,
@@ -7084,7 +7175,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7084
7175
  i$1
7085
7176
  ]
7086
7177
  }));
7087
- const rest = def.rest ? process$2(def.rest, ctx, {
7178
+ const rest = def.rest ? process$3(def.rest, ctx, {
7088
7179
  ...params,
7089
7180
  path: [
7090
7181
  ...params.path,
@@ -7108,9 +7199,42 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7108
7199
  if (typeof minimum === "number") json.minItems = minimum;
7109
7200
  if (typeof maximum === "number") json.maxItems = maximum;
7110
7201
  };
7202
+ const recordProcessor = (schema, ctx, _json, params) => {
7203
+ const json = _json;
7204
+ const def = schema._zod.def;
7205
+ json.type = "object";
7206
+ const keyType = def.keyType;
7207
+ const patterns = keyType._zod.bag?.patterns;
7208
+ if (def.mode === "loose" && patterns && patterns.size > 0) {
7209
+ const valueSchema = process$3(def.valueType, ctx, {
7210
+ ...params,
7211
+ path: [
7212
+ ...params.path,
7213
+ "patternProperties",
7214
+ "*"
7215
+ ]
7216
+ });
7217
+ json.patternProperties = {};
7218
+ for (const pattern of patterns) json.patternProperties[pattern.source] = valueSchema;
7219
+ } else {
7220
+ if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$3(def.keyType, ctx, {
7221
+ ...params,
7222
+ path: [...params.path, "propertyNames"]
7223
+ });
7224
+ json.additionalProperties = process$3(def.valueType, ctx, {
7225
+ ...params,
7226
+ path: [...params.path, "additionalProperties"]
7227
+ });
7228
+ }
7229
+ const keyValues = keyType._zod.values;
7230
+ if (keyValues) {
7231
+ const validKeyValues = [...keyValues].filter((v$1) => typeof v$1 === "string" || typeof v$1 === "number");
7232
+ if (validKeyValues.length > 0) json.required = validKeyValues;
7233
+ }
7234
+ };
7111
7235
  const nullableProcessor = (schema, ctx, json, params) => {
7112
7236
  const def = schema._zod.def;
7113
- const inner = process$2(def.innerType, ctx, params);
7237
+ const inner = process$3(def.innerType, ctx, params);
7114
7238
  const seen = ctx.seen.get(schema);
7115
7239
  if (ctx.target === "openapi-3.0") {
7116
7240
  seen.ref = def.innerType;
@@ -7119,27 +7243,27 @@ const nullableProcessor = (schema, ctx, json, params) => {
7119
7243
  };
7120
7244
  const nonoptionalProcessor = (schema, ctx, _json, params) => {
7121
7245
  const def = schema._zod.def;
7122
- process$2(def.innerType, ctx, params);
7246
+ process$3(def.innerType, ctx, params);
7123
7247
  const seen = ctx.seen.get(schema);
7124
7248
  seen.ref = def.innerType;
7125
7249
  };
7126
7250
  const defaultProcessor = (schema, ctx, json, params) => {
7127
7251
  const def = schema._zod.def;
7128
- process$2(def.innerType, ctx, params);
7252
+ process$3(def.innerType, ctx, params);
7129
7253
  const seen = ctx.seen.get(schema);
7130
7254
  seen.ref = def.innerType;
7131
7255
  json.default = JSON.parse(JSON.stringify(def.defaultValue));
7132
7256
  };
7133
7257
  const prefaultProcessor = (schema, ctx, json, params) => {
7134
7258
  const def = schema._zod.def;
7135
- process$2(def.innerType, ctx, params);
7259
+ process$3(def.innerType, ctx, params);
7136
7260
  const seen = ctx.seen.get(schema);
7137
7261
  seen.ref = def.innerType;
7138
7262
  if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
7139
7263
  };
7140
7264
  const catchProcessor = (schema, ctx, json, params) => {
7141
7265
  const def = schema._zod.def;
7142
- process$2(def.innerType, ctx, params);
7266
+ process$3(def.innerType, ctx, params);
7143
7267
  const seen = ctx.seen.get(schema);
7144
7268
  seen.ref = def.innerType;
7145
7269
  let catchValue;
@@ -7153,20 +7277,20 @@ const catchProcessor = (schema, ctx, json, params) => {
7153
7277
  const pipeProcessor = (schema, ctx, _json, params) => {
7154
7278
  const def = schema._zod.def;
7155
7279
  const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
7156
- process$2(innerType, ctx, params);
7280
+ process$3(innerType, ctx, params);
7157
7281
  const seen = ctx.seen.get(schema);
7158
7282
  seen.ref = innerType;
7159
7283
  };
7160
7284
  const readonlyProcessor = (schema, ctx, json, params) => {
7161
7285
  const def = schema._zod.def;
7162
- process$2(def.innerType, ctx, params);
7286
+ process$3(def.innerType, ctx, params);
7163
7287
  const seen = ctx.seen.get(schema);
7164
7288
  seen.ref = def.innerType;
7165
7289
  json.readOnly = true;
7166
7290
  };
7167
7291
  const optionalProcessor = (schema, ctx, _json, params) => {
7168
7292
  const def = schema._zod.def;
7169
- process$2(def.innerType, ctx, params);
7293
+ process$3(def.innerType, ctx, params);
7170
7294
  const seen = ctx.seen.get(schema);
7171
7295
  seen.ref = def.innerType;
7172
7296
  };
@@ -7637,6 +7761,21 @@ function tuple(items, _paramsOrRest, _params) {
7637
7761
  ...normalizeParams(params)
7638
7762
  });
7639
7763
  }
7764
+ const ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
7765
+ $ZodRecord.init(inst, def);
7766
+ ZodType.init(inst, def);
7767
+ inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
7768
+ inst.keyType = def.keyType;
7769
+ inst.valueType = def.valueType;
7770
+ });
7771
+ function record(keyType, valueType, params) {
7772
+ return new ZodRecord({
7773
+ type: "record",
7774
+ keyType,
7775
+ valueType,
7776
+ ...normalizeParams(params)
7777
+ });
7778
+ }
7640
7779
  const ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
7641
7780
  $ZodEnum.init(inst, def);
7642
7781
  ZodType.init(inst, def);
@@ -16196,7 +16335,7 @@ const createIgnorePredicate = (patterns, cwd, baseDir) => {
16196
16335
  };
16197
16336
  const normalizeOptions$2 = (options = {}) => {
16198
16337
  const ignoreOption = options.ignore ? Array.isArray(options.ignore) ? options.ignore : [options.ignore] : [];
16199
- const cwd = toPath$1(options.cwd) ?? y.cwd();
16338
+ const cwd = toPath$1(options.cwd) ?? process$1.cwd();
16200
16339
  const deep = typeof options.deep === "number" ? Math.max(0, options.deep) + 1 : Number.POSITIVE_INFINITY;
16201
16340
  return {
16202
16341
  cwd,
@@ -16293,7 +16432,7 @@ const getDirectoryGlob = ({ directoryPath, files, extensions }) => {
16293
16432
  const extensionGlob = extensions?.length > 0 ? `.${extensions.length > 1 ? `{${extensions.join(",")}}` : extensions[0]}` : "";
16294
16433
  return files ? files.map((file) => path.posix.join(directoryPath, `**/${path.extname(file) ? file : `${file}${extensionGlob}`}`)) : [path.posix.join(directoryPath, `**${extensionGlob ? `/*${extensionGlob}` : ""}`)];
16295
16434
  };
16296
- const directoryToGlob = async (directoryPaths, { cwd = y.cwd(), files, extensions, fs: fsImplementation } = {}) => {
16435
+ const directoryToGlob = async (directoryPaths, { cwd = process$1.cwd(), files, extensions, fs: fsImplementation } = {}) => {
16297
16436
  return (await Promise.all(directoryPaths.map(async (directoryPath) => {
16298
16437
  if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
16299
16438
  directoryPath,
@@ -16307,7 +16446,7 @@ const directoryToGlob = async (directoryPaths, { cwd = y.cwd(), files, extension
16307
16446
  }) : directoryPath;
16308
16447
  }))).flat();
16309
16448
  };
16310
- const directoryToGlobSync = (directoryPaths, { cwd = y.cwd(), files, extensions, fs: fsImplementation } = {}) => directoryPaths.flatMap((directoryPath) => {
16449
+ const directoryToGlobSync = (directoryPaths, { cwd = process$1.cwd(), files, extensions, fs: fsImplementation } = {}) => directoryPaths.flatMap((directoryPath) => {
16311
16450
  if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
16312
16451
  directoryPath,
16313
16452
  files,
@@ -16403,7 +16542,7 @@ const applyIgnoreFilesAndGetFilterSync = (options) => {
16403
16542
  };
16404
16543
  const createFilterFunction = (isIgnored, cwd) => {
16405
16544
  const seen = /* @__PURE__ */ new Set();
16406
- const basePath = cwd || y.cwd();
16545
+ const basePath = cwd || process$1.cwd();
16407
16546
  const pathCache = /* @__PURE__ */ new Map();
16408
16547
  return (fastGlobResult) => {
16409
16548
  const pathKey$1 = path.normalize(fastGlobResult.path ?? fastGlobResult);
@@ -16538,9 +16677,7 @@ const SyncEntitiesResponseSchema = object({
16538
16677
  //#region src/core/resources/entity/config.ts
16539
16678
  async function readEntityFile(entityPath) {
16540
16679
  const parsed = await readJsonFile(entityPath);
16541
- const result = EntitySchema.safeParse(parsed);
16542
- if (!result.success) throw new Error(`Invalid entity configuration in ${entityPath}: ${result.error.issues.map((e$1) => e$1.message).join(", ")}`);
16543
- return result.data;
16680
+ return EntitySchema.parse(parsed);
16544
16681
  }
16545
16682
  async function readAllEntities(entitiesDir) {
16546
16683
  if (!await pathExists(entitiesDir)) return [];
@@ -16687,51 +16824,26 @@ const functionResource = {
16687
16824
 
16688
16825
  //#endregion
16689
16826
  //#region src/core/resources/agent/schema.ts
16690
- const EntityToolConfigSchema = object({
16691
- entity_name: string().min(1),
16692
- allowed_operations: array(_enum([
16693
- "read",
16694
- "create",
16695
- "update",
16696
- "delete"
16697
- ])).default([])
16698
- });
16699
- const BackendFunctionToolConfigSchema = object({
16700
- function_name: string().min(1),
16701
- description: string().default("agent backend function")
16702
- });
16703
- const ToolConfigSchema = union([EntityToolConfigSchema, BackendFunctionToolConfigSchema]);
16704
- const AgentConfigSchema = object({
16705
- name: string().regex(/^[a-z0-9_]+$/, "Agent name must be lowercase alphanumeric with underscores").min(1).max(100),
16706
- description: string().min(1, "Agent description cannot be empty"),
16707
- instructions: string().min(1, "Agent instructions cannot be empty"),
16708
- tool_configs: array(ToolConfigSchema).default([]),
16709
- whatsapp_greeting: string().nullable().optional()
16710
- });
16827
+ const AgentConfigSchema = looseObject({ name: string().regex(/^[a-z0-9_]+$/, "Agent name must be lowercase alphanumeric with underscores").min(1).max(100) });
16711
16828
  const SyncAgentsResponseSchema = object({
16712
16829
  created: array(string()),
16713
16830
  updated: array(string()),
16714
16831
  deleted: array(string())
16715
16832
  });
16716
- const AgentConfigApiResponseSchema = object({
16717
- name: string(),
16718
- description: string(),
16719
- instructions: string(),
16720
- tool_configs: array(ToolConfigSchema).default([]),
16721
- whatsapp_greeting: string().nullable().optional()
16722
- });
16833
+ const AgentConfigApiResponseSchema = looseObject({ name: string() });
16723
16834
  const ListAgentsResponseSchema = object({
16724
16835
  items: array(AgentConfigApiResponseSchema),
16725
16836
  total: number()
16726
- });
16837
+ }).transform((data) => ({
16838
+ items: data.items,
16839
+ total: data.total
16840
+ }));
16727
16841
 
16728
16842
  //#endregion
16729
16843
  //#region src/core/resources/agent/config.ts
16730
16844
  async function readAgentFile(agentPath) {
16731
16845
  const parsed = await readJsonFile(agentPath);
16732
- const result = AgentConfigSchema.safeParse(parsed);
16733
- if (!result.success) throw new Error(`Invalid agent configuration in ${agentPath}: ${result.error.issues.map((e$1) => e$1.message).join(", ")}`);
16734
- return result.data;
16846
+ return AgentConfigSchema.parse(parsed);
16735
16847
  }
16736
16848
  async function readAllAgents(agentsDir) {
16737
16849
  if (!await pathExists(agentsDir)) return [];
@@ -16747,20 +16859,20 @@ async function readAllAgents(agentsDir) {
16747
16859
  }
16748
16860
  return agents;
16749
16861
  }
16750
- async function writeAgents(agentsDir, agents) {
16862
+ async function writeAgents(agentsDir, remoteAgents) {
16751
16863
  const existingAgents = await readAllAgents(agentsDir);
16752
- const newNames = new Set(agents.map((a$1) => a$1.name));
16864
+ const newNames = new Set(remoteAgents.map((a$1) => a$1.name));
16753
16865
  const toDelete = existingAgents.filter((a$1) => !newNames.has(a$1.name));
16754
- for (const agent of toDelete) await deleteFile(join(agentsDir, `${agent.name}.${CONFIG_FILE_EXTENSION}`));
16755
- for (const agent of agents) await writeJsonFile(join(agentsDir, `${agent.name}.${CONFIG_FILE_EXTENSION}`), {
16756
- name: agent.name,
16757
- description: agent.description,
16758
- instructions: agent.instructions,
16759
- tool_configs: agent.tool_configs,
16760
- whatsapp_greeting: agent.whatsapp_greeting ?? null
16761
- });
16866
+ for (const agent of toDelete) {
16867
+ const files = await globby(`${agent.name}.${CONFIG_FILE_EXTENSION_GLOB}`, {
16868
+ cwd: agentsDir,
16869
+ absolute: true
16870
+ });
16871
+ for (const filePath of files) await deleteFile(filePath);
16872
+ }
16873
+ for (const agent of remoteAgents) await writeJsonFile(join(agentsDir, `${agent.name}.${CONFIG_FILE_EXTENSION}`), agent);
16762
16874
  return {
16763
- written: agents.map((a$1) => a$1.name),
16875
+ written: remoteAgents.map((a$1) => a$1.name),
16764
16876
  deleted: toDelete.map((a$1) => a$1.name)
16765
16877
  };
16766
16878
  }
@@ -16768,16 +16880,8 @@ async function writeAgents(agentsDir, agents) {
16768
16880
  //#endregion
16769
16881
  //#region src/core/resources/agent/api.ts
16770
16882
  async function pushAgents(agents) {
16771
- const appClient = getAppClient();
16772
- const payload = agents.map((agent) => ({
16773
- name: agent.name,
16774
- description: agent.description,
16775
- instructions: agent.instructions,
16776
- tool_configs: agent.tool_configs,
16777
- whatsapp_greeting: agent.whatsapp_greeting ?? null
16778
- }));
16779
- const response = await appClient.put("agent-configs", {
16780
- json: payload,
16883
+ const response = await getAppClient().put("agent-configs", {
16884
+ json: agents,
16781
16885
  throwHttpErrors: false
16782
16886
  });
16783
16887
  if (!response.ok) {
@@ -30593,10 +30697,6 @@ async function readAppConfig(projectRoot) {
30593
30697
  * Authenticated HTTP client for Base44 API.
30594
30698
  * Automatically handles token refresh and retry on 401 responses.
30595
30699
  */
30596
- /**
30597
- * Formats an API error response into a human-readable string.
30598
- * Prefers `message` (human-readable) over `detail`.
30599
- */
30600
30700
  function formatApiError(errorJson) {
30601
30701
  const error = errorJson;
30602
30702
  const content = error?.message ?? error?.detail ?? errorJson;
@@ -30655,6 +30755,19 @@ function getAppClient() {
30655
30755
  return base44Client.extend({ prefixUrl: new URL(`/api/apps/${id}/`, getBase44ApiUrl()).href });
30656
30756
  }
30657
30757
 
30758
+ //#endregion
30759
+ //#region src/core/clients/schemas.ts
30760
+ const ApiErrorSchema = object({
30761
+ error_type: string().optional(),
30762
+ message: union([string(), record(string(), unknown())]).optional(),
30763
+ detail: union([
30764
+ string(),
30765
+ record(string(), unknown()),
30766
+ array(unknown())
30767
+ ]).optional(),
30768
+ traceback: string().optional()
30769
+ });
30770
+
30658
30771
  //#endregion
30659
30772
  //#region src/core/auth/api.ts
30660
30773
  async function generateDeviceCode() {
@@ -30904,13 +31017,13 @@ var ansi_styles_default = ansiStyles;
30904
31017
 
30905
31018
  //#endregion
30906
31019
  //#region node_modules/chalk/source/vendor/supports-color/index.js
30907
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : y.argv) {
31020
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process$1.argv) {
30908
31021
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
30909
31022
  const position = argv.indexOf(prefix + flag);
30910
31023
  const terminatorPosition = argv.indexOf("--");
30911
31024
  return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
30912
31025
  }
30913
- const { env } = y;
31026
+ const { env } = process$1;
30914
31027
  let flagForceColor;
30915
31028
  if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
30916
31029
  else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
@@ -30943,7 +31056,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
30943
31056
  if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
30944
31057
  const min = forceColor || 0;
30945
31058
  if (env.TERM === "dumb") return min;
30946
- if (y.platform === "win32") {
31059
+ if (process$1.platform === "win32") {
30947
31060
  const osRelease = os.release().split(".");
30948
31061
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
30949
31062
  return 1;
@@ -31482,57 +31595,61 @@ async function pushEntitiesAction() {
31482
31595
  if (result.created.length > 0) M.success(`Created: ${result.created.join(", ")}`);
31483
31596
  if (result.updated.length > 0) M.success(`Updated: ${result.updated.join(", ")}`);
31484
31597
  if (result.deleted.length > 0) M.warn(`Deleted: ${result.deleted.join(", ")}`);
31485
- return {};
31598
+ return { outroMessage: "Entities pushed to Base44" };
31486
31599
  }
31487
31600
  const entitiesPushCommand = new Command("entities").description("Manage project entities").addCommand(new Command("push").description("Push local entities to Base44").action(async () => {
31488
31601
  await runCommand(pushEntitiesAction, { requireAuth: true });
31489
31602
  }));
31490
31603
 
31604
+ //#endregion
31605
+ //#region src/cli/commands/agents/push.ts
31606
+ async function pushAgentsAction() {
31607
+ const { agents } = await readProjectConfig();
31608
+ M.info(agents.length === 0 ? "No local agents found - this will delete all remote agents" : `Found ${agents.length} agents to push`);
31609
+ const result = await runTask("Pushing agents to Base44", async () => {
31610
+ return await pushAgents(agents);
31611
+ }, {
31612
+ successMessage: "Agents pushed successfully",
31613
+ errorMessage: "Failed to push agents"
31614
+ });
31615
+ if (result.created.length > 0) M.success(`Created: ${result.created.join(", ")}`);
31616
+ if (result.updated.length > 0) M.success(`Updated: ${result.updated.join(", ")}`);
31617
+ if (result.deleted.length > 0) M.warn(`Deleted: ${result.deleted.join(", ")}`);
31618
+ return { outroMessage: "Agents pushed to Base44" };
31619
+ }
31620
+ const agentsPushCommand = new Command("push").description("Push local agents to Base44 (replaces all remote agent configs)").action(async () => {
31621
+ await runCommand(pushAgentsAction, { requireAuth: true });
31622
+ });
31623
+
31491
31624
  //#endregion
31492
31625
  //#region src/cli/commands/agents/pull.ts
31493
31626
  async function pullAgentsAction() {
31494
31627
  const { project } = await readProjectConfig();
31495
31628
  const agentsDir = join(dirname(project.configPath), project.agentsDir);
31496
- const response = await runTask("Fetching agents from Base44", async () => {
31629
+ const remoteAgents = await runTask("Fetching agents from Base44", async () => {
31497
31630
  return await fetchAgents();
31498
31631
  }, {
31499
31632
  successMessage: "Agents fetched successfully",
31500
31633
  errorMessage: "Failed to fetch agents"
31501
31634
  });
31502
- if (response.items.length === 0) return { outroMessage: "No agents found on Base44" };
31635
+ if (remoteAgents.items.length === 0) return { outroMessage: "No agents found on Base44" };
31503
31636
  const { written, deleted } = await runTask("Writing agent files", async () => {
31504
- return await writeAgents(agentsDir, response.items);
31637
+ return await writeAgents(agentsDir, remoteAgents.items);
31505
31638
  }, {
31506
31639
  successMessage: "Agent files written successfully",
31507
31640
  errorMessage: "Failed to write agent files"
31508
31641
  });
31509
31642
  if (written.length > 0) M.success(`Written: ${written.join(", ")}`);
31510
31643
  if (deleted.length > 0) M.warn(`Deleted: ${deleted.join(", ")}`);
31511
- return { outroMessage: `Pulled ${response.total} agents to ${agentsDir}` };
31644
+ return { outroMessage: `Pulled ${remoteAgents.total} agents to ${agentsDir}` };
31512
31645
  }
31513
31646
  const agentsPullCommand = new Command("pull").description("Pull agents from Base44 to local files (replaces all local agent configs)").action(async () => {
31514
31647
  await runCommand(pullAgentsAction, { requireAuth: true });
31515
31648
  });
31516
31649
 
31517
31650
  //#endregion
31518
- //#region src/cli/commands/agents/push.ts
31519
- async function pushAgentsAction() {
31520
- const { agents } = await readProjectConfig();
31521
- M.info(agents.length === 0 ? "No local agents found - this will delete all remote agents" : `Found ${agents.length} agents to push`);
31522
- const result = await runTask("Pushing agents to Base44", async () => {
31523
- return await pushAgents(agents);
31524
- }, {
31525
- successMessage: "Agents pushed successfully",
31526
- errorMessage: "Failed to push agents"
31527
- });
31528
- if (result.created.length > 0) M.success(`Created: ${result.created.join(", ")}`);
31529
- if (result.updated.length > 0) M.success(`Updated: ${result.updated.join(", ")}`);
31530
- if (result.deleted.length > 0) M.warn(`Deleted: ${result.deleted.join(", ")}`);
31531
- return {};
31532
- }
31533
- const agentsCommand = new Command("agents").description("Manage project agents").addCommand(new Command("push").description("Push local agents to Base44 (replaces all remote agent configs)").action(async () => {
31534
- await runCommand(pushAgentsAction, { requireAuth: true });
31535
- })).addCommand(agentsPullCommand);
31651
+ //#region src/cli/commands/agents/index.ts
31652
+ const agentsCommand = new Command("agents").description("Manage project agents").addCommand(agentsPushCommand).addCommand(agentsPullCommand);
31536
31653
 
31537
31654
  //#endregion
31538
31655
  //#region src/cli/commands/functions/deploy.ts
@@ -31552,7 +31669,7 @@ async function deployFunctionsAction() {
31552
31669
  const errorMessages = result.errors.map((e$1) => `'${e$1.name}' function: ${e$1.message}`).join("\n");
31553
31670
  throw new Error(`Function deployment errors:\n${errorMessages}`);
31554
31671
  }
31555
- return {};
31672
+ return { outroMessage: "Functions deployed to Base44" };
31556
31673
  }
31557
31674
  const functionsDeployCommand = new Command("functions").description("Manage project functions").addCommand(new Command("deploy").description("Deploy local functions to Base44").action(async () => {
31558
31675
  await runCommand(deployFunctionsAction, { requireAuth: true });
@@ -31728,9 +31845,9 @@ const getSubprocessResult = ({ stdout: stdout$1 }) => {
31728
31845
  //#region node_modules/execa/lib/utils/standard-stream.js
31729
31846
  const isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
31730
31847
  const STANDARD_STREAMS = [
31731
- y.stdin,
31732
- y.stdout,
31733
- y.stderr
31848
+ process$1.stdin,
31849
+ process$1.stdout,
31850
+ process$1.stderr
31734
31851
  ];
31735
31852
  const STANDARD_STREAMS_ALIASES = [
31736
31853
  "stdin",
@@ -31855,9 +31972,9 @@ const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
31855
31972
  //#endregion
31856
31973
  //#region node_modules/is-unicode-supported/index.js
31857
31974
  function isUnicodeSupported() {
31858
- const { env: env$1 } = y;
31975
+ const { env: env$1 } = process$1;
31859
31976
  const { TERM, TERM_PROGRAM } = env$1;
31860
- if (y.platform !== "win32") return TERM !== "linux";
31977
+ if (process$1.platform !== "win32") return TERM !== "linux";
31861
31978
  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";
31862
31979
  }
31863
31980
 
@@ -32784,7 +32901,7 @@ const TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
32784
32901
 
32785
32902
  //#endregion
32786
32903
  //#region node_modules/npm-run-path/index.js
32787
- const npmRunPath = ({ cwd = y.cwd(), path: pathOption = y.env[pathKey()], preferLocal = true, execPath: execPath$1 = y.execPath, addExecPath = true } = {}) => {
32904
+ const npmRunPath = ({ cwd = process$1.cwd(), path: pathOption = process$1.env[pathKey()], preferLocal = true, execPath: execPath$1 = process$1.execPath, addExecPath = true } = {}) => {
32788
32905
  const cwdPath = path.resolve(toPath(cwd));
32789
32906
  const result = [];
32790
32907
  const pathParts = pathOption.split(path.delimiter);
@@ -32802,7 +32919,7 @@ const applyExecPath = (result, pathParts, execPath$1, cwdPath) => {
32802
32919
  const pathPart = path.resolve(cwdPath, toPath(execPath$1), "..");
32803
32920
  if (!pathParts.includes(pathPart)) result.push(pathPart);
32804
32921
  };
32805
- const npmRunPathEnv = ({ env: env$1 = y.env, ...options } = {}) => {
32922
+ const npmRunPathEnv = ({ env: env$1 = process$1.env, ...options } = {}) => {
32806
32923
  env$1 = { ...env$1 };
32807
32924
  const pathName = pathKey({ env: env$1 });
32808
32925
  options.path = env$1[pathName];
@@ -33937,7 +34054,7 @@ const normalizeCwd = (cwd = getDefaultCwd()) => {
33937
34054
  };
33938
34055
  const getDefaultCwd = () => {
33939
34056
  try {
33940
- return y.cwd();
34057
+ return process$1.cwd();
33941
34058
  } catch (error) {
33942
34059
  error.message = `The current directory does not exist.\n${error.message}`;
33943
34060
  throw error;
@@ -33972,7 +34089,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
33972
34089
  options.killSignal = normalizeKillSignal(options.killSignal);
33973
34090
  options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
33974
34091
  options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
33975
- if (y.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
34092
+ if (process$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
33976
34093
  return {
33977
34094
  file,
33978
34095
  commandArguments,
@@ -33999,7 +34116,7 @@ const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDi
33999
34116
  });
34000
34117
  const getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
34001
34118
  const env$1 = extendEnv ? {
34002
- ...y.env,
34119
+ ...process$1.env,
34003
34120
  ...envOption
34004
34121
  } : envOption;
34005
34122
  if (preferLocal || node) return npmRunPathEnv({
@@ -34999,12 +35116,12 @@ const guessStreamDirection = {
34999
35116
  }
35000
35117
  };
35001
35118
  const getStandardStreamDirection = (value) => {
35002
- if ([0, y.stdin].includes(value)) return "input";
35119
+ if ([0, process$1.stdin].includes(value)) return "input";
35003
35120
  if ([
35004
35121
  1,
35005
35122
  2,
35006
- y.stdout,
35007
- y.stderr
35123
+ process$1.stdout,
35124
+ process$1.stderr
35008
35125
  ].includes(value)) return "output";
35009
35126
  };
35010
35127
  const DEFAULT_DIRECTION = "output";
@@ -36068,9 +36185,9 @@ const addIpcMethods = (subprocess, { ipc }) => {
36068
36185
  Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
36069
36186
  };
36070
36187
  const getIpcExport = () => {
36071
- const anyProcess = y;
36188
+ const anyProcess = process$1;
36072
36189
  const isSubprocess = true;
36073
- const ipc = y.channel !== void 0;
36190
+ const ipc = process$1.channel !== void 0;
36074
36191
  return {
36075
36192
  ...getIpcMethods(anyProcess, isSubprocess, ipc),
36076
36193
  getCancelSignal: getCancelSignal$1.bind(void 0, {
@@ -36312,7 +36429,7 @@ if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SI
36312
36429
 
36313
36430
  //#endregion
36314
36431
  //#region node_modules/signal-exit/dist/mjs/index.js
36315
- 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";
36432
+ 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";
36316
36433
  const kExitEmitter = Symbol.for("signal-exit emitter");
36317
36434
  const global$1 = globalThis;
36318
36435
  const ObjectDefineProperty = Object.defineProperty.bind(Object);
@@ -36380,7 +36497,7 @@ var SignalExitFallback = class extends SignalExitBase {
36380
36497
  };
36381
36498
  var SignalExit = class extends SignalExitBase {
36382
36499
  /* c8 ignore start */
36383
- #hupSig = process$1.platform === "win32" ? "SIGINT" : "SIGHUP";
36500
+ #hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
36384
36501
  /* c8 ignore stop */
36385
36502
  #emitter = new Emitter();
36386
36503
  #process;
@@ -36388,15 +36505,15 @@ var SignalExit = class extends SignalExitBase {
36388
36505
  #originalProcessReallyExit;
36389
36506
  #sigListeners = {};
36390
36507
  #loaded = false;
36391
- constructor(process$4) {
36508
+ constructor(process$5) {
36392
36509
  super();
36393
- this.#process = process$4;
36510
+ this.#process = process$5;
36394
36511
  this.#sigListeners = {};
36395
36512
  for (const sig of signals) this.#sigListeners[sig] = () => {
36396
36513
  const listeners = this.#process.listeners(sig);
36397
36514
  let { count: count$1 } = this.#emitter;
36398
36515
  /* c8 ignore start */
36399
- const p$1 = process$4;
36516
+ const p$1 = process$5;
36400
36517
  if (typeof p$1.__signal_exit_emitter__ === "object" && typeof p$1.__signal_exit_emitter__.count === "number") count$1 += p$1.__signal_exit_emitter__.count;
36401
36518
  /* c8 ignore stop */
36402
36519
  if (listeners.length === count$1) {
@@ -36404,11 +36521,11 @@ var SignalExit = class extends SignalExitBase {
36404
36521
  const ret = this.#emitter.emit("exit", null, sig);
36405
36522
  /* c8 ignore start */
36406
36523
  const s = sig === "SIGHUP" ? this.#hupSig : sig;
36407
- if (!ret) process$4.kill(process$4.pid, s);
36524
+ if (!ret) process$5.kill(process$5.pid, s);
36408
36525
  }
36409
36526
  };
36410
- this.#originalProcessReallyExit = process$4.reallyExit;
36411
- this.#originalProcessEmit = process$4.emit;
36527
+ this.#originalProcessReallyExit = process$5.reallyExit;
36528
+ this.#originalProcessEmit = process$5.emit;
36412
36529
  }
36413
36530
  onExit(cb, opts) {
36414
36531
  /* c8 ignore start */
@@ -36475,8 +36592,8 @@ var SignalExit = class extends SignalExitBase {
36475
36592
  } else return og.call(this.#process, ev, ...args);
36476
36593
  }
36477
36594
  };
36478
- const process$1 = globalThis.process;
36479
- const { onExit, load, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
36595
+ const process$2 = globalThis.process;
36596
+ const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
36480
36597
 
36481
36598
  //#endregion
36482
36599
  //#region node_modules/execa/lib/terminate/cleanup.js
@@ -38430,7 +38547,7 @@ function isInsideContainer() {
38430
38547
  //#endregion
38431
38548
  //#region node_modules/is-wsl/index.js
38432
38549
  const isWsl = () => {
38433
- if (y.platform !== "linux") return false;
38550
+ if (process$1.platform !== "linux") return false;
38434
38551
  if (os.release().toLowerCase().includes("microsoft")) {
38435
38552
  if (isInsideContainer()) return false;
38436
38553
  return true;
@@ -38441,12 +38558,12 @@ const isWsl = () => {
38441
38558
  return false;
38442
38559
  }
38443
38560
  };
38444
- var is_wsl_default = y.env.__IS_WSL_TEST__ ? isWsl : isWsl();
38561
+ var is_wsl_default = process$1.env.__IS_WSL_TEST__ ? isWsl : isWsl();
38445
38562
 
38446
38563
  //#endregion
38447
38564
  //#region node_modules/powershell-utils/index.js
38448
38565
  const execFile$2 = promisify(childProcess.execFile);
38449
- const powerShellPath$1 = () => `${y.env.SYSTEMROOT || y.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
38566
+ const powerShellPath$1 = () => `${process$1.env.SYSTEMROOT || process$1.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
38450
38567
  const executePowerShell = async (command, options = {}) => {
38451
38568
  const { powerShellPath: psPath, ...execFileOptions } = options;
38452
38569
  const encodedCommand = executePowerShell.encodeCommand(command);
@@ -38557,7 +38674,7 @@ function defineLazyProperty(object$1, propertyName, valueGetter) {
38557
38674
  //#region node_modules/default-browser-id/index.js
38558
38675
  const execFileAsync$3 = promisify(execFile);
38559
38676
  async function defaultBrowserId() {
38560
- if (y.platform !== "darwin") throw new Error("macOS only");
38677
+ if (process$1.platform !== "darwin") throw new Error("macOS only");
38561
38678
  const { stdout: stdout$1 } = await execFileAsync$3("defaults", [
38562
38679
  "read",
38563
38680
  "com.apple.LaunchServices/com.apple.launchservices.secure",
@@ -38572,7 +38689,7 @@ async function defaultBrowserId() {
38572
38689
  //#region node_modules/run-applescript/index.js
38573
38690
  const execFileAsync$2 = promisify(execFile);
38574
38691
  async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
38575
- if (y.platform !== "darwin") throw new Error("macOS only");
38692
+ if (process$1.platform !== "darwin") throw new Error("macOS only");
38576
38693
  const outputArguments = humanReadableOutput ? [] : ["-ss"];
38577
38694
  const execOptions = {};
38578
38695
  if (signal) execOptions.signal = signal;
@@ -38681,14 +38798,14 @@ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
38681
38798
  const execFileAsync = promisify(execFile);
38682
38799
  const titleize = (string$2) => string$2.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x$2) => x$2.toUpperCase());
38683
38800
  async function defaultBrowser() {
38684
- if (y.platform === "darwin") {
38801
+ if (process$1.platform === "darwin") {
38685
38802
  const id = await defaultBrowserId();
38686
38803
  return {
38687
38804
  name: await bundleName(id),
38688
38805
  id
38689
38806
  };
38690
38807
  }
38691
- if (y.platform === "linux") {
38808
+ if (process$1.platform === "linux") {
38692
38809
  const { stdout: stdout$1 } = await execFileAsync("xdg-mime", [
38693
38810
  "query",
38694
38811
  "default",
@@ -38700,13 +38817,13 @@ async function defaultBrowser() {
38700
38817
  id
38701
38818
  };
38702
38819
  }
38703
- if (y.platform === "win32") return defaultBrowser$1();
38820
+ if (process$1.platform === "win32") return defaultBrowser$1();
38704
38821
  throw new Error("Only macOS, Linux, and Windows are supported");
38705
38822
  }
38706
38823
 
38707
38824
  //#endregion
38708
38825
  //#region node_modules/is-in-ssh/index.js
38709
- const isInSsh = Boolean(y.env.SSH_CONNECTION || y.env.SSH_CLIENT || y.env.SSH_TTY);
38826
+ const isInSsh = Boolean(process$1.env.SSH_CONNECTION || process$1.env.SSH_CLIENT || process$1.env.SSH_TTY);
38710
38827
  var is_in_ssh_default = isInSsh;
38711
38828
 
38712
38829
  //#endregion
@@ -38714,7 +38831,7 @@ var is_in_ssh_default = isInSsh;
38714
38831
  const fallbackAttemptSymbol = Symbol("fallbackAttempt");
38715
38832
  const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
38716
38833
  const localXdgOpenPath = path.join(__dirname, "xdg-open");
38717
- const { platform: platform$1, arch } = y;
38834
+ const { platform: platform$1, arch } = process$1;
38718
38835
  const tryEachApp = async (apps$1, opener) => {
38719
38836
  if (apps$1.length === 0) return;
38720
38837
  const errors = [];
@@ -38827,7 +38944,7 @@ const baseOpen = async (options) => {
38827
38944
  await fs$1.access(localXdgOpenPath, constants$1.X_OK);
38828
38945
  exeLocalXdgOpen = true;
38829
38946
  } catch {}
38830
- command = y.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
38947
+ command = process$1.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
38831
38948
  }
38832
38949
  if (appArguments.length > 0) cliArguments.push(...appArguments);
38833
38950
  if (!options.wait) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/cli",
3
- "version": "0.0.21-pr.112.9c80207",
3
+ "version": "0.0.21-pr.112.c15189d",
4
4
  "description": "Base44 CLI - Unified interface for managing Base44 applications",
5
5
  "type": "module",
6
6
  "bin": {