@base44-preview/cli 0.0.19-pr.124.f10d1f3 → 0.0.21-pr.112.b9c226a

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 +269 -111
  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 process$1, { execArgv, execPath, hrtime, platform, stdin, stdout } from "node:process";
6
+ import y, { 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";
@@ -15,6 +15,8 @@ import { finished } from "node:stream/promises";
15
15
  import path$1, { dirname as dirname$1, parse } from "path";
16
16
  import EE, { EventEmitter as EventEmitter$1 } from "events";
17
17
  import fs$2 from "fs";
18
+ import { getAppClient } from "@core/clients/index.js";
19
+ import { formatApiError } from "@core/errors.js";
18
20
  import { Buffer as Buffer$1 } from "buffer";
19
21
  import { randomBytes, randomUUID } from "node:crypto";
20
22
  import { StringDecoder } from "node:string_decoder";
@@ -23,6 +25,8 @@ import * as realZlib$1 from "zlib";
23
25
  import realZlib from "zlib";
24
26
  import assert$1 from "node:assert";
25
27
  import tty from "node:tty";
28
+ import { fetchAgents, pushAgents, writeAgents } from "@core/resources/agent/index.js";
29
+ import { readProjectConfig } from "@core/index.js";
26
30
  import { scheduler, setImmediate as setImmediate$1, setTimeout as setTimeout$1 } from "node:timers/promises";
27
31
  import { serialize } from "node:v8";
28
32
  import { Buffer as Buffer$2 } from "node:buffer";
@@ -893,7 +897,7 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
893
897
  const childProcess$1 = __require("node:child_process");
894
898
  const path$15 = __require("node:path");
895
899
  const fs$10 = __require("node:fs");
896
- const process$4 = __require("node:process");
900
+ const process$3 = __require("node:process");
897
901
  const { Argument, humanReadableArgName } = require_argument();
898
902
  const { CommanderError } = require_error$1();
899
903
  const { Help } = require_help();
@@ -944,10 +948,10 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
944
948
  this._showHelpAfterError = false;
945
949
  this._showSuggestionAfterError = true;
946
950
  this._outputConfiguration = {
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
+ writeOut: (str) => process$3.stdout.write(str),
952
+ writeErr: (str) => process$3.stderr.write(str),
953
+ getOutHelpWidth: () => process$3.stdout.isTTY ? process$3.stdout.columns : void 0,
954
+ getErrHelpWidth: () => process$3.stderr.isTTY ? process$3.stderr.columns : void 0,
951
955
  outputError: (str, write) => write(str)
952
956
  };
953
957
  this._hidden = false;
@@ -1301,7 +1305,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1301
1305
  */
1302
1306
  _exit(exitCode, code$1, message) {
1303
1307
  if (this._exitCallback) this._exitCallback(new CommanderError(exitCode, code$1, message));
1304
- process$4.exit(exitCode);
1308
+ process$3.exit(exitCode);
1305
1309
  }
1306
1310
  /**
1307
1311
  * Register callback `fn` for the command.
@@ -1640,11 +1644,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
1640
1644
  if (argv !== void 0 && !Array.isArray(argv)) throw new Error("first parameter to parse must be array or undefined");
1641
1645
  parseOptions = parseOptions || {};
1642
1646
  if (argv === void 0 && parseOptions.from === void 0) {
1643
- if (process$4.versions?.electron) parseOptions.from = "electron";
1644
- const execArgv$1 = process$4.execArgv ?? [];
1647
+ if (process$3.versions?.electron) parseOptions.from = "electron";
1648
+ const execArgv$1 = process$3.execArgv ?? [];
1645
1649
  if (execArgv$1.includes("-e") || execArgv$1.includes("--eval") || execArgv$1.includes("-p") || execArgv$1.includes("--print")) parseOptions.from = "eval";
1646
1650
  }
1647
- if (argv === void 0) argv = process$4.argv;
1651
+ if (argv === void 0) argv = process$3.argv;
1648
1652
  this.rawArgs = argv.slice();
1649
1653
  let userArgs;
1650
1654
  switch (parseOptions.from) {
@@ -1654,7 +1658,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1654
1658
  userArgs = argv.slice(2);
1655
1659
  break;
1656
1660
  case "electron":
1657
- if (process$4.defaultApp) {
1661
+ if (process$3.defaultApp) {
1658
1662
  this._scriptPath = argv[1];
1659
1663
  userArgs = argv.slice(2);
1660
1664
  } else userArgs = argv.slice(1);
@@ -1768,15 +1772,15 @@ Expecting one of '${allowedValues.join("', '")}'`);
1768
1772
  }
1769
1773
  launchWithNode = sourceExt.includes(path$15.extname(executableFile));
1770
1774
  let proc$1;
1771
- if (process$4.platform !== "win32") if (launchWithNode) {
1775
+ if (process$3.platform !== "win32") if (launchWithNode) {
1772
1776
  args.unshift(executableFile);
1773
- args = incrementNodeInspectorPort(process$4.execArgv).concat(args);
1774
- proc$1 = childProcess$1.spawn(process$4.argv[0], args, { stdio: "inherit" });
1777
+ args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
1778
+ proc$1 = childProcess$1.spawn(process$3.argv[0], args, { stdio: "inherit" });
1775
1779
  } else proc$1 = childProcess$1.spawn(executableFile, args, { stdio: "inherit" });
1776
1780
  else {
1777
1781
  args.unshift(executableFile);
1778
- args = incrementNodeInspectorPort(process$4.execArgv).concat(args);
1779
- proc$1 = childProcess$1.spawn(process$4.execPath, args, { stdio: "inherit" });
1782
+ args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
1783
+ proc$1 = childProcess$1.spawn(process$3.execPath, args, { stdio: "inherit" });
1780
1784
  }
1781
1785
  if (!proc$1.killed) [
1782
1786
  "SIGUSR1",
@@ -1785,14 +1789,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
1785
1789
  "SIGINT",
1786
1790
  "SIGHUP"
1787
1791
  ].forEach((signal) => {
1788
- process$4.on(signal, () => {
1792
+ process$3.on(signal, () => {
1789
1793
  if (proc$1.killed === false && proc$1.exitCode === null) proc$1.kill(signal);
1790
1794
  });
1791
1795
  });
1792
1796
  const exitCallback = this._exitCallback;
1793
1797
  proc$1.on("close", (code$1) => {
1794
1798
  code$1 = code$1 ?? 1;
1795
- if (!exitCallback) process$4.exit(code$1);
1799
+ if (!exitCallback) process$3.exit(code$1);
1796
1800
  else exitCallback(new CommanderError(code$1, "commander.executeSubCommandAsync", "(close)"));
1797
1801
  });
1798
1802
  proc$1.on("error", (err) => {
@@ -1804,7 +1808,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1804
1808
  - ${executableDirMessage}`;
1805
1809
  throw new Error(executableMissing);
1806
1810
  } else if (err.code === "EACCES") throw new Error(`'${executableFile}' not executable`);
1807
- if (!exitCallback) process$4.exit(1);
1811
+ if (!exitCallback) process$3.exit(1);
1808
1812
  else {
1809
1813
  const wrappedError = new CommanderError(1, "commander.executeSubCommandAsync", "(error)");
1810
1814
  wrappedError.nestedError = err;
@@ -2210,13 +2214,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
2210
2214
  */
2211
2215
  _parseOptionsEnv() {
2212
2216
  this.options.forEach((option) => {
2213
- if (option.envVar && option.envVar in process$4.env) {
2217
+ if (option.envVar && option.envVar in process$3.env) {
2214
2218
  const optionKey = option.attributeName();
2215
2219
  if (this.getOptionValue(optionKey) === void 0 || [
2216
2220
  "default",
2217
2221
  "config",
2218
2222
  "env"
2219
- ].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$4.env[option.envVar]);
2223
+ ].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$3.env[option.envVar]);
2220
2224
  else this.emit(`optionEnv:${option.name()}`);
2221
2225
  }
2222
2226
  });
@@ -2595,7 +2599,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2595
2599
  */
2596
2600
  help(contextOptions) {
2597
2601
  this.outputHelp(contextOptions);
2598
- let exitCode = process$4.exitCode || 0;
2602
+ let exitCode = process$3.exitCode || 0;
2599
2603
  if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) exitCode = 1;
2600
2604
  this._exit(exitCode, "commander.help", "(outputHelp)");
2601
2605
  }
@@ -2711,16 +2715,16 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2711
2715
  const CSI = `${ESC}[`;
2712
2716
  const beep = "\x07";
2713
2717
  const cursor = {
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`;
2718
+ to(x$2, y$2) {
2719
+ if (!y$2) return `${CSI}${x$2 + 1}G`;
2720
+ return `${CSI}${y$2 + 1};${x$2 + 1}H`;
2717
2721
  },
2718
- move(x$2, y$1) {
2722
+ move(x$2, y$2) {
2719
2723
  let ret = "";
2720
2724
  if (x$2 < 0) ret += `${CSI}${-x$2}D`;
2721
2725
  else if (x$2 > 0) ret += `${CSI}${x$2}C`;
2722
- if (y$1 < 0) ret += `${CSI}${-y$1}A`;
2723
- else if (y$1 > 0) ret += `${CSI}${y$1}B`;
2726
+ if (y$2 < 0) ret += `${CSI}${-y$2}A`;
2727
+ else if (y$2 > 0) ret += `${CSI}${y$2}B`;
2724
2728
  return ret;
2725
2729
  },
2726
2730
  up: (count$1 = 1) => `${CSI}${count$1}A`,
@@ -3030,13 +3034,13 @@ function rD() {
3030
3034
  }
3031
3035
  }), r;
3032
3036
  }
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) => {
3037
+ 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) => {
3034
3038
  const F$1 = [...u$2];
3035
3039
  let s = !1, i$1 = !1, D$1 = p(P$1(e$1[e$1.length - 1]));
3036
3040
  for (const [C$1, n$1] of F$1.entries()) {
3037
3041
  const E = p(n$1);
3038
3042
  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 && (s = !1, i$1 = !1) : n$1 === G$1 && (s = !1);
3043
+ i$1 ? n$1 === y$1 && (s = !1, i$1 = !1) : n$1 === G$1 && (s = !1);
3040
3044
  continue;
3041
3045
  }
3042
3046
  D$1 += E, D$1 === t && C$1 < F$1.length - 1 && (e$1.push(""), D$1 = 0);
@@ -3078,7 +3082,7 @@ const ED = rD(), d$1 = new Set(["\x1B", "›"]), oD = 39, y = "\x07", V$1 = "[",
3078
3082
  `)];
3079
3083
  for (const [E, a$1] of n$1.entries()) {
3080
3084
  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})`)).exec(n$1.slice(E).join("")) || { groups: {} };
3085
+ const { groups: c$1 } = (/* @__PURE__ */ new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y$1})`)).exec(n$1.slice(E).join("")) || { groups: {} };
3082
3086
  if (c$1.code !== void 0) {
3083
3087
  const f = Number.parseFloat(c$1.code);
3084
3088
  s = f === oD ? void 0 : f;
@@ -3479,7 +3483,7 @@ var RD = class extends x$1 {
3479
3483
  //#endregion
3480
3484
  //#region node_modules/@clack/prompts/dist/index.mjs
3481
3485
  function ce() {
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";
3486
+ 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";
3483
3487
  }
3484
3488
  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
3489
  switch (t) {
@@ -6653,7 +6657,7 @@ function initializeContext(params) {
6653
6657
  external: params?.external ?? void 0
6654
6658
  };
6655
6659
  }
6656
- function process$3(schema, ctx, _params = {
6660
+ function process$2(schema, ctx, _params = {
6657
6661
  path: [],
6658
6662
  schemaPath: []
6659
6663
  }) {
@@ -6690,7 +6694,7 @@ function process$3(schema, ctx, _params = {
6690
6694
  const parent = schema._zod.parent;
6691
6695
  if (parent) {
6692
6696
  if (!result.ref) result.ref = parent;
6693
- process$3(parent, ctx, params);
6697
+ process$2(parent, ctx, params);
6694
6698
  ctx.seen.get(parent).isParent = true;
6695
6699
  }
6696
6700
  }
@@ -6902,7 +6906,7 @@ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
6902
6906
  ...params,
6903
6907
  processors
6904
6908
  });
6905
- process$3(schema, ctx);
6909
+ process$2(schema, ctx);
6906
6910
  extractDefs(ctx, schema);
6907
6911
  return finalize(ctx, schema);
6908
6912
  };
@@ -6914,7 +6918,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
6914
6918
  io,
6915
6919
  processors
6916
6920
  });
6917
- process$3(schema, ctx);
6921
+ process$2(schema, ctx);
6918
6922
  extractDefs(ctx, schema);
6919
6923
  return finalize(ctx, schema);
6920
6924
  };
@@ -7001,7 +7005,7 @@ const arrayProcessor = (schema, ctx, _json, params) => {
7001
7005
  if (typeof minimum === "number") json.minItems = minimum;
7002
7006
  if (typeof maximum === "number") json.maxItems = maximum;
7003
7007
  json.type = "array";
7004
- json.items = process$3(def.element, ctx, {
7008
+ json.items = process$2(def.element, ctx, {
7005
7009
  ...params,
7006
7010
  path: [...params.path, "items"]
7007
7011
  });
@@ -7012,7 +7016,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
7012
7016
  json.type = "object";
7013
7017
  json.properties = {};
7014
7018
  const shape = def.shape;
7015
- for (const key in shape) json.properties[key] = process$3(shape[key], ctx, {
7019
+ for (const key in shape) json.properties[key] = process$2(shape[key], ctx, {
7016
7020
  ...params,
7017
7021
  path: [
7018
7022
  ...params.path,
@@ -7030,7 +7034,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
7030
7034
  if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
7031
7035
  else if (!def.catchall) {
7032
7036
  if (ctx.io === "output") json.additionalProperties = false;
7033
- } else if (def.catchall) json.additionalProperties = process$3(def.catchall, ctx, {
7037
+ } else if (def.catchall) json.additionalProperties = process$2(def.catchall, ctx, {
7034
7038
  ...params,
7035
7039
  path: [...params.path, "additionalProperties"]
7036
7040
  });
@@ -7038,7 +7042,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
7038
7042
  const unionProcessor = (schema, ctx, json, params) => {
7039
7043
  const def = schema._zod.def;
7040
7044
  const isExclusive = def.inclusive === false;
7041
- const options = def.options.map((x$2, i$1) => process$3(x$2, ctx, {
7045
+ const options = def.options.map((x$2, i$1) => process$2(x$2, ctx, {
7042
7046
  ...params,
7043
7047
  path: [
7044
7048
  ...params.path,
@@ -7051,7 +7055,7 @@ const unionProcessor = (schema, ctx, json, params) => {
7051
7055
  };
7052
7056
  const intersectionProcessor = (schema, ctx, json, params) => {
7053
7057
  const def = schema._zod.def;
7054
- const a$1 = process$3(def.left, ctx, {
7058
+ const a$1 = process$2(def.left, ctx, {
7055
7059
  ...params,
7056
7060
  path: [
7057
7061
  ...params.path,
@@ -7059,7 +7063,7 @@ const intersectionProcessor = (schema, ctx, json, params) => {
7059
7063
  0
7060
7064
  ]
7061
7065
  });
7062
- const b$2 = process$3(def.right, ctx, {
7066
+ const b$2 = process$2(def.right, ctx, {
7063
7067
  ...params,
7064
7068
  path: [
7065
7069
  ...params.path,
@@ -7076,7 +7080,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7076
7080
  json.type = "array";
7077
7081
  const prefixPath$1 = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
7078
7082
  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$3(x$2, ctx, {
7083
+ const prefixItems = def.items.map((x$2, i$1) => process$2(x$2, ctx, {
7080
7084
  ...params,
7081
7085
  path: [
7082
7086
  ...params.path,
@@ -7084,7 +7088,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7084
7088
  i$1
7085
7089
  ]
7086
7090
  }));
7087
- const rest = def.rest ? process$3(def.rest, ctx, {
7091
+ const rest = def.rest ? process$2(def.rest, ctx, {
7088
7092
  ...params,
7089
7093
  path: [
7090
7094
  ...params.path,
@@ -7110,7 +7114,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7110
7114
  };
7111
7115
  const nullableProcessor = (schema, ctx, json, params) => {
7112
7116
  const def = schema._zod.def;
7113
- const inner = process$3(def.innerType, ctx, params);
7117
+ const inner = process$2(def.innerType, ctx, params);
7114
7118
  const seen = ctx.seen.get(schema);
7115
7119
  if (ctx.target === "openapi-3.0") {
7116
7120
  seen.ref = def.innerType;
@@ -7119,27 +7123,27 @@ const nullableProcessor = (schema, ctx, json, params) => {
7119
7123
  };
7120
7124
  const nonoptionalProcessor = (schema, ctx, _json, params) => {
7121
7125
  const def = schema._zod.def;
7122
- process$3(def.innerType, ctx, params);
7126
+ process$2(def.innerType, ctx, params);
7123
7127
  const seen = ctx.seen.get(schema);
7124
7128
  seen.ref = def.innerType;
7125
7129
  };
7126
7130
  const defaultProcessor = (schema, ctx, json, params) => {
7127
7131
  const def = schema._zod.def;
7128
- process$3(def.innerType, ctx, params);
7132
+ process$2(def.innerType, ctx, params);
7129
7133
  const seen = ctx.seen.get(schema);
7130
7134
  seen.ref = def.innerType;
7131
7135
  json.default = JSON.parse(JSON.stringify(def.defaultValue));
7132
7136
  };
7133
7137
  const prefaultProcessor = (schema, ctx, json, params) => {
7134
7138
  const def = schema._zod.def;
7135
- process$3(def.innerType, ctx, params);
7139
+ process$2(def.innerType, ctx, params);
7136
7140
  const seen = ctx.seen.get(schema);
7137
7141
  seen.ref = def.innerType;
7138
7142
  if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
7139
7143
  };
7140
7144
  const catchProcessor = (schema, ctx, json, params) => {
7141
7145
  const def = schema._zod.def;
7142
- process$3(def.innerType, ctx, params);
7146
+ process$2(def.innerType, ctx, params);
7143
7147
  const seen = ctx.seen.get(schema);
7144
7148
  seen.ref = def.innerType;
7145
7149
  let catchValue;
@@ -7153,20 +7157,20 @@ const catchProcessor = (schema, ctx, json, params) => {
7153
7157
  const pipeProcessor = (schema, ctx, _json, params) => {
7154
7158
  const def = schema._zod.def;
7155
7159
  const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
7156
- process$3(innerType, ctx, params);
7160
+ process$2(innerType, ctx, params);
7157
7161
  const seen = ctx.seen.get(schema);
7158
7162
  seen.ref = innerType;
7159
7163
  };
7160
7164
  const readonlyProcessor = (schema, ctx, json, params) => {
7161
7165
  const def = schema._zod.def;
7162
- process$3(def.innerType, ctx, params);
7166
+ process$2(def.innerType, ctx, params);
7163
7167
  const seen = ctx.seen.get(schema);
7164
7168
  seen.ref = def.innerType;
7165
7169
  json.readOnly = true;
7166
7170
  };
7167
7171
  const optionalProcessor = (schema, ctx, _json, params) => {
7168
7172
  const def = schema._zod.def;
7169
- process$3(def.innerType, ctx, params);
7173
+ process$2(def.innerType, ctx, params);
7170
7174
  const seen = ctx.seen.get(schema);
7171
7175
  seen.ref = def.innerType;
7172
7176
  };
@@ -7899,6 +7903,15 @@ var AuthValidationError = class extends Error {
7899
7903
  this.name = "AuthValidationError";
7900
7904
  }
7901
7905
  };
7906
+ /**
7907
+ * Formats an API error response into a human-readable string.
7908
+ * Prefers `message` (human-readable) over `detail`.
7909
+ */
7910
+ function formatApiError$1(errorJson) {
7911
+ const error = errorJson;
7912
+ const content = error?.message ?? error?.detail ?? errorJson;
7913
+ return typeof content === "string" ? content : JSON.stringify(content, null, 2);
7914
+ }
7902
7915
 
7903
7916
  //#endregion
7904
7917
  //#region src/core/consts.ts
@@ -16195,7 +16208,7 @@ const createIgnorePredicate = (patterns, cwd, baseDir) => {
16195
16208
  };
16196
16209
  const normalizeOptions$2 = (options = {}) => {
16197
16210
  const ignoreOption = options.ignore ? Array.isArray(options.ignore) ? options.ignore : [options.ignore] : [];
16198
- const cwd = toPath$1(options.cwd) ?? process$1.cwd();
16211
+ const cwd = toPath$1(options.cwd) ?? y.cwd();
16199
16212
  const deep = typeof options.deep === "number" ? Math.max(0, options.deep) + 1 : Number.POSITIVE_INFINITY;
16200
16213
  return {
16201
16214
  cwd,
@@ -16292,7 +16305,7 @@ const getDirectoryGlob = ({ directoryPath, files, extensions }) => {
16292
16305
  const extensionGlob = extensions?.length > 0 ? `.${extensions.length > 1 ? `{${extensions.join(",")}}` : extensions[0]}` : "";
16293
16306
  return files ? files.map((file) => path.posix.join(directoryPath, `**/${path.extname(file) ? file : `${file}${extensionGlob}`}`)) : [path.posix.join(directoryPath, `**${extensionGlob ? `/*${extensionGlob}` : ""}`)];
16294
16307
  };
16295
- const directoryToGlob = async (directoryPaths, { cwd = process$1.cwd(), files, extensions, fs: fsImplementation } = {}) => {
16308
+ const directoryToGlob = async (directoryPaths, { cwd = y.cwd(), files, extensions, fs: fsImplementation } = {}) => {
16296
16309
  return (await Promise.all(directoryPaths.map(async (directoryPath) => {
16297
16310
  if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
16298
16311
  directoryPath,
@@ -16306,7 +16319,7 @@ const directoryToGlob = async (directoryPaths, { cwd = process$1.cwd(), files, e
16306
16319
  }) : directoryPath;
16307
16320
  }))).flat();
16308
16321
  };
16309
- const directoryToGlobSync = (directoryPaths, { cwd = process$1.cwd(), files, extensions, fs: fsImplementation } = {}) => directoryPaths.flatMap((directoryPath) => {
16322
+ const directoryToGlobSync = (directoryPaths, { cwd = y.cwd(), files, extensions, fs: fsImplementation } = {}) => directoryPaths.flatMap((directoryPath) => {
16310
16323
  if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
16311
16324
  directoryPath,
16312
16325
  files,
@@ -16402,7 +16415,7 @@ const applyIgnoreFilesAndGetFilterSync = (options) => {
16402
16415
  };
16403
16416
  const createFilterFunction = (isIgnored, cwd) => {
16404
16417
  const seen = /* @__PURE__ */ new Set();
16405
- const basePath = cwd || process$1.cwd();
16418
+ const basePath = cwd || y.cwd();
16406
16419
  const pathCache = /* @__PURE__ */ new Map();
16407
16420
  return (fastGlobResult) => {
16408
16421
  const pathKey$1 = path.normalize(fastGlobResult.path ?? fastGlobResult);
@@ -16553,7 +16566,7 @@ async function readAllEntities(entitiesDir) {
16553
16566
  //#endregion
16554
16567
  //#region src/core/resources/entity/api.ts
16555
16568
  async function syncEntities(entities) {
16556
- const appClient = getAppClient();
16569
+ const appClient = getAppClient$1();
16557
16570
  const schemaSyncPayload = Object.fromEntries(entities.map((entity) => [entity.name, entity]));
16558
16571
  const response = await appClient.put("entity-schemas", {
16559
16572
  json: { entityNameToSchema: schemaSyncPayload },
@@ -16561,8 +16574,8 @@ async function syncEntities(entities) {
16561
16574
  });
16562
16575
  if (!response.ok) {
16563
16576
  const errorJson = await response.json();
16564
- if (response.status === 428) throw new Error(`Failed to delete entity: ${errorJson.message}`);
16565
- throw new Error(`Error occurred while syncing entities ${errorJson.message}`);
16577
+ if (response.status === 428) throw new Error(`Failed to delete entity: ${formatApiError$1(errorJson)}`);
16578
+ throw new Error(`Error occurred while syncing entities: ${formatApiError$1(errorJson)}`);
16566
16579
  }
16567
16580
  return SyncEntitiesResponseSchema.parse(await response.json());
16568
16581
  }
@@ -16650,7 +16663,7 @@ function toDeployPayloadItem(fn) {
16650
16663
  };
16651
16664
  }
16652
16665
  async function deployFunctions(functions) {
16653
- const appClient = getAppClient();
16666
+ const appClient = getAppClient$1();
16654
16667
  const payload = { functions: functions.map(toDeployPayloadItem) };
16655
16668
  const response = await appClient.put("backend-functions", {
16656
16669
  json: payload,
@@ -16684,6 +16697,98 @@ const functionResource = {
16684
16697
  push: pushFunctions
16685
16698
  };
16686
16699
 
16700
+ //#endregion
16701
+ //#region src/core/resources/agent/schema.ts
16702
+ const EntityToolConfigSchema = object({
16703
+ entity_name: string().min(1),
16704
+ allowed_operations: array(_enum([
16705
+ "read",
16706
+ "create",
16707
+ "update",
16708
+ "delete"
16709
+ ])).default([])
16710
+ });
16711
+ const BackendFunctionToolConfigSchema = object({
16712
+ function_name: string().min(1),
16713
+ description: string().default("agent backend function")
16714
+ });
16715
+ const ToolConfigSchema = union([EntityToolConfigSchema, BackendFunctionToolConfigSchema]);
16716
+ const AgentConfigSchema = object({
16717
+ name: string().regex(/^[a-z0-9_]+$/, "Agent name must be lowercase alphanumeric with underscores").min(1).max(100),
16718
+ description: string().min(1, "Agent description cannot be empty"),
16719
+ instructions: string().min(1, "Agent instructions cannot be empty"),
16720
+ tool_configs: array(ToolConfigSchema).default([]),
16721
+ whatsapp_greeting: string().nullable().optional()
16722
+ });
16723
+ const SyncAgentsResponseSchema = object({
16724
+ created: array(string()),
16725
+ updated: array(string()),
16726
+ deleted: array(string())
16727
+ });
16728
+ const AgentConfigApiResponseSchema = object({
16729
+ name: string(),
16730
+ description: string(),
16731
+ instructions: string(),
16732
+ tool_configs: array(ToolConfigSchema).default([]),
16733
+ whatsapp_greeting: string().nullable().optional()
16734
+ });
16735
+ const ListAgentsResponseSchema = object({
16736
+ items: array(AgentConfigApiResponseSchema),
16737
+ total: number()
16738
+ });
16739
+
16740
+ //#endregion
16741
+ //#region src/core/resources/agent/config.ts
16742
+ async function readAgentFile(agentPath) {
16743
+ const parsed = await readJsonFile(agentPath);
16744
+ const result = AgentConfigSchema.safeParse(parsed);
16745
+ if (!result.success) throw new Error(`Invalid agent configuration in ${agentPath}: ${result.error.issues.map((e$1) => e$1.message).join(", ")}`);
16746
+ return result.data;
16747
+ }
16748
+ async function readAllAgents(agentsDir) {
16749
+ if (!await pathExists(agentsDir)) return [];
16750
+ const files = await globby(`*.${CONFIG_FILE_EXTENSION_GLOB}`, {
16751
+ cwd: agentsDir,
16752
+ absolute: true
16753
+ });
16754
+ const agents = await Promise.all(files.map((filePath) => readAgentFile(filePath)));
16755
+ const names = /* @__PURE__ */ new Set();
16756
+ for (const agent of agents) {
16757
+ if (names.has(agent.name)) throw new Error(`Duplicate agent name "${agent.name}"`);
16758
+ names.add(agent.name);
16759
+ }
16760
+ return agents;
16761
+ }
16762
+
16763
+ //#endregion
16764
+ //#region src/core/resources/agent/api.ts
16765
+ async function pushAgents$1(agents) {
16766
+ const appClient = getAppClient();
16767
+ const payload = agents.map((agent) => ({
16768
+ name: agent.name,
16769
+ description: agent.description,
16770
+ instructions: agent.instructions,
16771
+ tool_configs: agent.tool_configs,
16772
+ whatsapp_greeting: agent.whatsapp_greeting ?? null
16773
+ }));
16774
+ const response = await appClient.put("agent-configs", {
16775
+ json: payload,
16776
+ throwHttpErrors: false
16777
+ });
16778
+ if (!response.ok) {
16779
+ const errorJson = await response.json();
16780
+ throw new Error(`Error occurred while syncing agents: ${formatApiError(errorJson)}`);
16781
+ }
16782
+ return SyncAgentsResponseSchema.parse(await response.json());
16783
+ }
16784
+
16785
+ //#endregion
16786
+ //#region src/core/resources/agent/resource.ts
16787
+ const agentResource = {
16788
+ readAll: readAllAgents,
16789
+ push: pushAgents$1
16790
+ };
16791
+
16687
16792
  //#endregion
16688
16793
  //#region src/core/project/schema.ts
16689
16794
  const TemplateSchema = object({
@@ -16704,7 +16809,8 @@ const ProjectConfigSchema = object({
16704
16809
  description: string().optional(),
16705
16810
  site: SiteConfigSchema.optional(),
16706
16811
  entitiesDir: string().optional().default("entities"),
16707
- functionsDir: string().optional().default("functions")
16812
+ functionsDir: string().optional().default("functions"),
16813
+ agentsDir: string().optional().default("agents")
16708
16814
  });
16709
16815
  const AppConfigSchema = object({ id: string().min(1, "id cannot be empty") });
16710
16816
  const CreateProjectResponseSchema = looseObject({ id: string() });
@@ -16760,7 +16866,7 @@ async function findProjectRoot(startPath) {
16760
16866
  * @example
16761
16867
  * const { project, entities, functions } = await readProjectConfig();
16762
16868
  */
16763
- async function readProjectConfig(projectRoot) {
16869
+ async function readProjectConfig$1(projectRoot) {
16764
16870
  let found;
16765
16871
  if (projectRoot) {
16766
16872
  const configPath$1 = await findConfigInDir(projectRoot);
@@ -16776,7 +16882,11 @@ async function readProjectConfig(projectRoot) {
16776
16882
  if (!result.success) throw new Error(`Invalid project configuration: ${result.error.message}`);
16777
16883
  const project = result.data;
16778
16884
  const configDir = dirname(configPath);
16779
- const [entities, functions] = await Promise.all([entityResource.readAll(join(configDir, project.entitiesDir)), functionResource.readAll(join(configDir, project.functionsDir))]);
16885
+ const [entities, functions, agents] = await Promise.all([
16886
+ entityResource.readAll(join(configDir, project.entitiesDir)),
16887
+ functionResource.readAll(join(configDir, project.functionsDir)),
16888
+ agentResource.readAll(join(configDir, project.agentsDir))
16889
+ ]);
16780
16890
  return {
16781
16891
  project: {
16782
16892
  ...project,
@@ -16784,7 +16894,8 @@ async function readProjectConfig(projectRoot) {
16784
16894
  configPath
16785
16895
  },
16786
16896
  entities,
16787
- functions
16897
+ functions,
16898
+ agents
16788
16899
  };
16789
16900
  }
16790
16901
 
@@ -25412,7 +25523,7 @@ async function uploadSite(archivePath) {
25412
25523
  const blob = new Blob([archiveBuffer], { type: "application/gzip" });
25413
25524
  const formData = new FormData();
25414
25525
  formData.append("file", blob, "dist.tar.gz");
25415
- const response = await getAppClient().post("deploy-dist", { body: formData });
25526
+ const response = await getAppClient$1().post("deploy-dist", { body: formData });
25416
25527
  return DeployResponseSchema.parse(await response.json());
25417
25528
  }
25418
25529
 
@@ -30517,7 +30628,7 @@ const base44Client = distribution_default.create({
30517
30628
  * const appClient = getAppClient();
30518
30629
  * const response = await appClient.get("entities");
30519
30630
  */
30520
- function getAppClient() {
30631
+ function getAppClient$1() {
30521
30632
  const { id } = getAppConfig();
30522
30633
  return base44Client.extend({ prefixUrl: new URL(`/api/apps/${id}/`, getBase44ApiUrl()).href });
30523
30634
  }
@@ -30771,13 +30882,13 @@ var ansi_styles_default = ansiStyles;
30771
30882
 
30772
30883
  //#endregion
30773
30884
  //#region node_modules/chalk/source/vendor/supports-color/index.js
30774
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process$1.argv) {
30885
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : y.argv) {
30775
30886
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
30776
30887
  const position = argv.indexOf(prefix + flag);
30777
30888
  const terminatorPosition = argv.indexOf("--");
30778
30889
  return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
30779
30890
  }
30780
- const { env } = process$1;
30891
+ const { env } = y;
30781
30892
  let flagForceColor;
30782
30893
  if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
30783
30894
  else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
@@ -30810,7 +30921,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
30810
30921
  if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
30811
30922
  const min = forceColor || 0;
30812
30923
  if (env.TERM === "dumb") return min;
30813
- if (process$1.platform === "win32") {
30924
+ if (y.platform === "win32") {
30814
30925
  const osRelease = os.release().split(".");
30815
30926
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
30816
30927
  return 1;
@@ -31337,7 +31448,7 @@ const logoutCommand = new Command("logout").description("Logout from current dev
31337
31448
  //#endregion
31338
31449
  //#region src/cli/commands/entities/push.ts
31339
31450
  async function pushEntitiesAction() {
31340
- const { entities } = await readProjectConfig();
31451
+ const { entities } = await readProjectConfig$1();
31341
31452
  if (entities.length === 0) return { outroMessage: "No entities found in project" };
31342
31453
  M.info(`Found ${entities.length} entities to push`);
31343
31454
  const result = await runTask("Pushing entities to Base44", async () => {
@@ -31355,10 +31466,56 @@ const entitiesPushCommand = new Command("entities").description("Manage project
31355
31466
  await runCommand(pushEntitiesAction, { requireAuth: true });
31356
31467
  }));
31357
31468
 
31469
+ //#endregion
31470
+ //#region src/cli/commands/agents/pull.ts
31471
+ async function pullAgentsAction() {
31472
+ const { project } = await readProjectConfig();
31473
+ const agentsDir = join(dirname(project.configPath), project.agentsDir);
31474
+ const response = await runTask("Fetching agents from Base44", async () => {
31475
+ return await fetchAgents();
31476
+ }, {
31477
+ successMessage: "Agents fetched successfully",
31478
+ errorMessage: "Failed to fetch agents"
31479
+ });
31480
+ if (response.items.length === 0) return { outroMessage: "No agents found on Base44" };
31481
+ const { written, deleted } = await runTask("Writing agent files", async () => {
31482
+ return await writeAgents(agentsDir, response.items);
31483
+ }, {
31484
+ successMessage: "Agent files written successfully",
31485
+ errorMessage: "Failed to write agent files"
31486
+ });
31487
+ if (written.length > 0) M.success(`Written: ${written.join(", ")}`);
31488
+ if (deleted.length > 0) M.warn(`Deleted: ${deleted.join(", ")}`);
31489
+ return { outroMessage: `Pulled ${response.total} agents to ${agentsDir}` };
31490
+ }
31491
+ const agentsPullCommand = new Command("pull").description("Pull agents from Base44 to local files (replaces all local agent configs)").action(async () => {
31492
+ await runCommand(pullAgentsAction, { requireAuth: true });
31493
+ });
31494
+
31495
+ //#endregion
31496
+ //#region src/cli/commands/agents/push.ts
31497
+ async function pushAgentsAction() {
31498
+ const { agents } = await readProjectConfig();
31499
+ M.info(agents.length === 0 ? "No local agents found - this will delete all remote agents" : `Found ${agents.length} agents to push`);
31500
+ const result = await runTask("Pushing agents to Base44", async () => {
31501
+ return await pushAgents(agents);
31502
+ }, {
31503
+ successMessage: "Agents pushed successfully",
31504
+ errorMessage: "Failed to push agents"
31505
+ });
31506
+ if (result.created.length > 0) M.success(`Created: ${result.created.join(", ")}`);
31507
+ if (result.updated.length > 0) M.success(`Updated: ${result.updated.join(", ")}`);
31508
+ if (result.deleted.length > 0) M.warn(`Deleted: ${result.deleted.join(", ")}`);
31509
+ return {};
31510
+ }
31511
+ 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 () => {
31512
+ await runCommand(pushAgentsAction, { requireAuth: true });
31513
+ })).addCommand(agentsPullCommand);
31514
+
31358
31515
  //#endregion
31359
31516
  //#region src/cli/commands/functions/deploy.ts
31360
31517
  async function deployFunctionsAction() {
31361
- const { functions } = await readProjectConfig();
31518
+ const { functions } = await readProjectConfig$1();
31362
31519
  if (functions.length === 0) return { outroMessage: "No functions found. Create functions in the 'functions' directory." };
31363
31520
  M.info(`Found ${functions.length} ${functions.length === 1 ? "function" : "functions"} to deploy`);
31364
31521
  const result = await runTask("Deploying functions to Base44", async () => {
@@ -31549,9 +31706,9 @@ const getSubprocessResult = ({ stdout: stdout$1 }) => {
31549
31706
  //#region node_modules/execa/lib/utils/standard-stream.js
31550
31707
  const isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
31551
31708
  const STANDARD_STREAMS = [
31552
- process$1.stdin,
31553
- process$1.stdout,
31554
- process$1.stderr
31709
+ y.stdin,
31710
+ y.stdout,
31711
+ y.stderr
31555
31712
  ];
31556
31713
  const STANDARD_STREAMS_ALIASES = [
31557
31714
  "stdin",
@@ -31676,9 +31833,9 @@ const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
31676
31833
  //#endregion
31677
31834
  //#region node_modules/is-unicode-supported/index.js
31678
31835
  function isUnicodeSupported() {
31679
- const { env: env$1 } = process$1;
31836
+ const { env: env$1 } = y;
31680
31837
  const { TERM, TERM_PROGRAM } = env$1;
31681
- if (process$1.platform !== "win32") return TERM !== "linux";
31838
+ if (y.platform !== "win32") return TERM !== "linux";
31682
31839
  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";
31683
31840
  }
31684
31841
 
@@ -32605,7 +32762,7 @@ const TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
32605
32762
 
32606
32763
  //#endregion
32607
32764
  //#region node_modules/npm-run-path/index.js
32608
- const npmRunPath = ({ cwd = process$1.cwd(), path: pathOption = process$1.env[pathKey()], preferLocal = true, execPath: execPath$1 = process$1.execPath, addExecPath = true } = {}) => {
32765
+ const npmRunPath = ({ cwd = y.cwd(), path: pathOption = y.env[pathKey()], preferLocal = true, execPath: execPath$1 = y.execPath, addExecPath = true } = {}) => {
32609
32766
  const cwdPath = path.resolve(toPath(cwd));
32610
32767
  const result = [];
32611
32768
  const pathParts = pathOption.split(path.delimiter);
@@ -32623,7 +32780,7 @@ const applyExecPath = (result, pathParts, execPath$1, cwdPath) => {
32623
32780
  const pathPart = path.resolve(cwdPath, toPath(execPath$1), "..");
32624
32781
  if (!pathParts.includes(pathPart)) result.push(pathPart);
32625
32782
  };
32626
- const npmRunPathEnv = ({ env: env$1 = process$1.env, ...options } = {}) => {
32783
+ const npmRunPathEnv = ({ env: env$1 = y.env, ...options } = {}) => {
32627
32784
  env$1 = { ...env$1 };
32628
32785
  const pathName = pathKey({ env: env$1 });
32629
32786
  options.path = env$1[pathName];
@@ -33758,7 +33915,7 @@ const normalizeCwd = (cwd = getDefaultCwd()) => {
33758
33915
  };
33759
33916
  const getDefaultCwd = () => {
33760
33917
  try {
33761
- return process$1.cwd();
33918
+ return y.cwd();
33762
33919
  } catch (error) {
33763
33920
  error.message = `The current directory does not exist.\n${error.message}`;
33764
33921
  throw error;
@@ -33793,7 +33950,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
33793
33950
  options.killSignal = normalizeKillSignal(options.killSignal);
33794
33951
  options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
33795
33952
  options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
33796
- if (process$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
33953
+ if (y.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
33797
33954
  return {
33798
33955
  file,
33799
33956
  commandArguments,
@@ -33820,7 +33977,7 @@ const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDi
33820
33977
  });
33821
33978
  const getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
33822
33979
  const env$1 = extendEnv ? {
33823
- ...process$1.env,
33980
+ ...y.env,
33824
33981
  ...envOption
33825
33982
  } : envOption;
33826
33983
  if (preferLocal || node) return npmRunPathEnv({
@@ -34820,12 +34977,12 @@ const guessStreamDirection = {
34820
34977
  }
34821
34978
  };
34822
34979
  const getStandardStreamDirection = (value) => {
34823
- if ([0, process$1.stdin].includes(value)) return "input";
34980
+ if ([0, y.stdin].includes(value)) return "input";
34824
34981
  if ([
34825
34982
  1,
34826
34983
  2,
34827
- process$1.stdout,
34828
- process$1.stderr
34984
+ y.stdout,
34985
+ y.stderr
34829
34986
  ].includes(value)) return "output";
34830
34987
  };
34831
34988
  const DEFAULT_DIRECTION = "output";
@@ -35889,9 +36046,9 @@ const addIpcMethods = (subprocess, { ipc }) => {
35889
36046
  Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
35890
36047
  };
35891
36048
  const getIpcExport = () => {
35892
- const anyProcess = process$1;
36049
+ const anyProcess = y;
35893
36050
  const isSubprocess = true;
35894
- const ipc = process$1.channel !== void 0;
36051
+ const ipc = y.channel !== void 0;
35895
36052
  return {
35896
36053
  ...getIpcMethods(anyProcess, isSubprocess, ipc),
35897
36054
  getCancelSignal: getCancelSignal$1.bind(void 0, {
@@ -36133,7 +36290,7 @@ if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SI
36133
36290
 
36134
36291
  //#endregion
36135
36292
  //#region node_modules/signal-exit/dist/mjs/index.js
36136
- 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";
36293
+ 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";
36137
36294
  const kExitEmitter = Symbol.for("signal-exit emitter");
36138
36295
  const global$1 = globalThis;
36139
36296
  const ObjectDefineProperty = Object.defineProperty.bind(Object);
@@ -36201,7 +36358,7 @@ var SignalExitFallback = class extends SignalExitBase {
36201
36358
  };
36202
36359
  var SignalExit = class extends SignalExitBase {
36203
36360
  /* c8 ignore start */
36204
- #hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
36361
+ #hupSig = process$1.platform === "win32" ? "SIGINT" : "SIGHUP";
36205
36362
  /* c8 ignore stop */
36206
36363
  #emitter = new Emitter();
36207
36364
  #process;
@@ -36209,15 +36366,15 @@ var SignalExit = class extends SignalExitBase {
36209
36366
  #originalProcessReallyExit;
36210
36367
  #sigListeners = {};
36211
36368
  #loaded = false;
36212
- constructor(process$5) {
36369
+ constructor(process$4) {
36213
36370
  super();
36214
- this.#process = process$5;
36371
+ this.#process = process$4;
36215
36372
  this.#sigListeners = {};
36216
36373
  for (const sig of signals) this.#sigListeners[sig] = () => {
36217
36374
  const listeners = this.#process.listeners(sig);
36218
36375
  let { count: count$1 } = this.#emitter;
36219
36376
  /* c8 ignore start */
36220
- const p$1 = process$5;
36377
+ const p$1 = process$4;
36221
36378
  if (typeof p$1.__signal_exit_emitter__ === "object" && typeof p$1.__signal_exit_emitter__.count === "number") count$1 += p$1.__signal_exit_emitter__.count;
36222
36379
  /* c8 ignore stop */
36223
36380
  if (listeners.length === count$1) {
@@ -36225,11 +36382,11 @@ var SignalExit = class extends SignalExitBase {
36225
36382
  const ret = this.#emitter.emit("exit", null, sig);
36226
36383
  /* c8 ignore start */
36227
36384
  const s = sig === "SIGHUP" ? this.#hupSig : sig;
36228
- if (!ret) process$5.kill(process$5.pid, s);
36385
+ if (!ret) process$4.kill(process$4.pid, s);
36229
36386
  }
36230
36387
  };
36231
- this.#originalProcessReallyExit = process$5.reallyExit;
36232
- this.#originalProcessEmit = process$5.emit;
36388
+ this.#originalProcessReallyExit = process$4.reallyExit;
36389
+ this.#originalProcessEmit = process$4.emit;
36233
36390
  }
36234
36391
  onExit(cb, opts) {
36235
36392
  /* c8 ignore start */
@@ -36296,8 +36453,8 @@ var SignalExit = class extends SignalExitBase {
36296
36453
  } else return og.call(this.#process, ev, ...args);
36297
36454
  }
36298
36455
  };
36299
- const process$2 = globalThis.process;
36300
- const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
36456
+ const process$1 = globalThis.process;
36457
+ const { onExit, load, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
36301
36458
 
36302
36459
  //#endregion
36303
36460
  //#region node_modules/execa/lib/terminate/cleanup.js
@@ -38139,7 +38296,7 @@ async function executeCreate({ template, name: rawName, description, projectPath
38139
38296
  id: projectId,
38140
38297
  projectRoot: resolvedPath
38141
38298
  });
38142
- const { project, entities } = await readProjectConfig(resolvedPath);
38299
+ const { project, entities } = await readProjectConfig$1(resolvedPath);
38143
38300
  let finalAppUrl;
38144
38301
  if (entities.length > 0) {
38145
38302
  let shouldPushEntities;
@@ -38251,7 +38408,7 @@ function isInsideContainer() {
38251
38408
  //#endregion
38252
38409
  //#region node_modules/is-wsl/index.js
38253
38410
  const isWsl = () => {
38254
- if (process$1.platform !== "linux") return false;
38411
+ if (y.platform !== "linux") return false;
38255
38412
  if (os.release().toLowerCase().includes("microsoft")) {
38256
38413
  if (isInsideContainer()) return false;
38257
38414
  return true;
@@ -38262,12 +38419,12 @@ const isWsl = () => {
38262
38419
  return false;
38263
38420
  }
38264
38421
  };
38265
- var is_wsl_default = process$1.env.__IS_WSL_TEST__ ? isWsl : isWsl();
38422
+ var is_wsl_default = y.env.__IS_WSL_TEST__ ? isWsl : isWsl();
38266
38423
 
38267
38424
  //#endregion
38268
38425
  //#region node_modules/powershell-utils/index.js
38269
38426
  const execFile$2 = promisify(childProcess.execFile);
38270
- const powerShellPath$1 = () => `${process$1.env.SYSTEMROOT || process$1.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
38427
+ const powerShellPath$1 = () => `${y.env.SYSTEMROOT || y.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
38271
38428
  const executePowerShell = async (command, options = {}) => {
38272
38429
  const { powerShellPath: psPath, ...execFileOptions } = options;
38273
38430
  const encodedCommand = executePowerShell.encodeCommand(command);
@@ -38378,7 +38535,7 @@ function defineLazyProperty(object$1, propertyName, valueGetter) {
38378
38535
  //#region node_modules/default-browser-id/index.js
38379
38536
  const execFileAsync$3 = promisify(execFile);
38380
38537
  async function defaultBrowserId() {
38381
- if (process$1.platform !== "darwin") throw new Error("macOS only");
38538
+ if (y.platform !== "darwin") throw new Error("macOS only");
38382
38539
  const { stdout: stdout$1 } = await execFileAsync$3("defaults", [
38383
38540
  "read",
38384
38541
  "com.apple.LaunchServices/com.apple.launchservices.secure",
@@ -38393,7 +38550,7 @@ async function defaultBrowserId() {
38393
38550
  //#region node_modules/run-applescript/index.js
38394
38551
  const execFileAsync$2 = promisify(execFile);
38395
38552
  async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
38396
- if (process$1.platform !== "darwin") throw new Error("macOS only");
38553
+ if (y.platform !== "darwin") throw new Error("macOS only");
38397
38554
  const outputArguments = humanReadableOutput ? [] : ["-ss"];
38398
38555
  const execOptions = {};
38399
38556
  if (signal) execOptions.signal = signal;
@@ -38502,14 +38659,14 @@ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
38502
38659
  const execFileAsync = promisify(execFile);
38503
38660
  const titleize = (string$2) => string$2.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x$2) => x$2.toUpperCase());
38504
38661
  async function defaultBrowser() {
38505
- if (process$1.platform === "darwin") {
38662
+ if (y.platform === "darwin") {
38506
38663
  const id = await defaultBrowserId();
38507
38664
  return {
38508
38665
  name: await bundleName(id),
38509
38666
  id
38510
38667
  };
38511
38668
  }
38512
- if (process$1.platform === "linux") {
38669
+ if (y.platform === "linux") {
38513
38670
  const { stdout: stdout$1 } = await execFileAsync("xdg-mime", [
38514
38671
  "query",
38515
38672
  "default",
@@ -38521,13 +38678,13 @@ async function defaultBrowser() {
38521
38678
  id
38522
38679
  };
38523
38680
  }
38524
- if (process$1.platform === "win32") return defaultBrowser$1();
38681
+ if (y.platform === "win32") return defaultBrowser$1();
38525
38682
  throw new Error("Only macOS, Linux, and Windows are supported");
38526
38683
  }
38527
38684
 
38528
38685
  //#endregion
38529
38686
  //#region node_modules/is-in-ssh/index.js
38530
- const isInSsh = Boolean(process$1.env.SSH_CONNECTION || process$1.env.SSH_CLIENT || process$1.env.SSH_TTY);
38687
+ const isInSsh = Boolean(y.env.SSH_CONNECTION || y.env.SSH_CLIENT || y.env.SSH_TTY);
38531
38688
  var is_in_ssh_default = isInSsh;
38532
38689
 
38533
38690
  //#endregion
@@ -38535,7 +38692,7 @@ var is_in_ssh_default = isInSsh;
38535
38692
  const fallbackAttemptSymbol = Symbol("fallbackAttempt");
38536
38693
  const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
38537
38694
  const localXdgOpenPath = path.join(__dirname, "xdg-open");
38538
- const { platform: platform$1, arch } = process$1;
38695
+ const { platform: platform$1, arch } = y;
38539
38696
  const tryEachApp = async (apps$1, opener) => {
38540
38697
  if (apps$1.length === 0) return;
38541
38698
  const errors = [];
@@ -38648,7 +38805,7 @@ const baseOpen = async (options) => {
38648
38805
  await fs$1.access(localXdgOpenPath, constants$1.X_OK);
38649
38806
  exeLocalXdgOpen = true;
38650
38807
  } catch {}
38651
- command = process$1.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
38808
+ command = y.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
38652
38809
  }
38653
38810
  if (appArguments.length > 0) cliArguments.push(...appArguments);
38654
38811
  if (!options.wait) {
@@ -38762,7 +38919,7 @@ const dashboardCommand = new Command("dashboard").description("Open the app dash
38762
38919
  //#endregion
38763
38920
  //#region src/cli/commands/project/deploy.ts
38764
38921
  async function deployAction$1(options) {
38765
- const projectData = await readProjectConfig();
38922
+ const projectData = await readProjectConfig$1();
38766
38923
  if (!hasResourcesToDeploy(projectData)) return { outroMessage: "No resources found to deploy" };
38767
38924
  const { project, entities, functions } = projectData;
38768
38925
  const summaryLines = [];
@@ -38911,7 +39068,7 @@ const linkCommand = new Command("link").description("Link a local project to a B
38911
39068
  //#endregion
38912
39069
  //#region src/cli/commands/site/deploy.ts
38913
39070
  async function deployAction(options) {
38914
- const { project } = await readProjectConfig();
39071
+ const { project } = await readProjectConfig$1();
38915
39072
  if (!project.site?.outputDirectory) throw new Error("No site configuration found. Please add 'site.outputDirectory' to your config.jsonc");
38916
39073
  const outputDir = resolve(project.root, project.site.outputDirectory);
38917
39074
  if (!options.yes) {
@@ -38931,7 +39088,7 @@ const siteDeployCommand = new Command("site").description("Manage site deploymen
38931
39088
 
38932
39089
  //#endregion
38933
39090
  //#region package.json
38934
- var version = "0.0.19";
39091
+ var version = "0.0.21";
38935
39092
 
38936
39093
  //#endregion
38937
39094
  //#region src/cli/program.ts
@@ -38946,6 +39103,7 @@ program.addCommand(dashboardCommand);
38946
39103
  program.addCommand(deployCommand);
38947
39104
  program.addCommand(linkCommand);
38948
39105
  program.addCommand(entitiesPushCommand);
39106
+ program.addCommand(agentsCommand);
38949
39107
  program.addCommand(functionsDeployCommand);
38950
39108
  program.addCommand(siteDeployCommand);
38951
39109
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/cli",
3
- "version": "0.0.19-pr.124.f10d1f3",
3
+ "version": "0.0.21-pr.112.b9c226a",
4
4
  "description": "Base44 CLI - Unified interface for managing Base44 applications",
5
5
  "type": "module",
6
6
  "bin": {