@base44-preview/cli 0.0.57-pr.551.ad8dd1c → 0.1.0-pr.551.cd949a6

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.
package/dist/cli/index.js CHANGED
@@ -16349,7 +16349,7 @@ var require_front_matter = __commonJS((exports, module) => {
16349
16349
  var optionalByteOrderMark = "\\ufeff?";
16350
16350
  var platform5 = typeof process !== "undefined" ? process.platform : "";
16351
16351
  var pattern = "^(" + optionalByteOrderMark + "(= yaml =|---)" + "$([\\s\\S]*?)" + "^(?:\\2|\\.\\.\\.)\\s*" + "$" + (platform5 === "win32" ? "\\r?" : "") + "(?:\\n)?)";
16352
- var regex = new RegExp(pattern, "m");
16352
+ var regex2 = new RegExp(pattern, "m");
16353
16353
  module.exports = extractor;
16354
16354
  module.exports.test = test;
16355
16355
  function extractor(string4, options) {
@@ -16384,7 +16384,7 @@ var require_front_matter = __commonJS((exports, module) => {
16384
16384
  return line;
16385
16385
  }
16386
16386
  function parse10(string4, allowUnsafe) {
16387
- var match = regex.exec(string4);
16387
+ var match = regex2.exec(string4);
16388
16388
  if (!match) {
16389
16389
  return {
16390
16390
  attributes: {},
@@ -16406,7 +16406,7 @@ var require_front_matter = __commonJS((exports, module) => {
16406
16406
  }
16407
16407
  function test(string4) {
16408
16408
  string4 = string4 || "";
16409
- return regex.test(string4);
16409
+ return regex2.test(string4);
16410
16410
  }
16411
16411
  });
16412
16412
 
@@ -120878,7 +120878,7 @@ function parse42(toml, { maxDepth = 1000, integersAsBigInt } = {}) {
120878
120878
  }
120879
120879
  return res;
120880
120880
  }
120881
- async function readFile2(file2) {
120881
+ async function readFile3(file2) {
120882
120882
  if (isUrlString(file2)) {
120883
120883
  file2 = new URL(file2);
120884
120884
  }
@@ -121034,9 +121034,9 @@ function getMessage2(key2, parameters, self2) {
121034
121034
  assert22.ok(message.length <= parameters.length, `Code: ${key2}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`);
121035
121035
  return Reflect.apply(message, self2, parameters);
121036
121036
  }
121037
- const regex = /%[dfijoOs]/g;
121037
+ const regex2 = /%[dfijoOs]/g;
121038
121038
  let expectedLength = 0;
121039
- while (regex.exec(message) !== null)
121039
+ while (regex2.exec(message) !== null)
121040
121040
  expectedLength++;
121041
121041
  assert22.ok(expectedLength === parameters.length, `Code: ${key2}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`);
121042
121042
  if (parameters.length === 0)
@@ -121937,9 +121937,9 @@ function convertEndOfLineOptionToCharacter2(endOfLineOption) {
121937
121937
  return endOfLineOption === OPTION_CR2 ? CHARACTER_CR2 : endOfLineOption === OPTION_CRLF2 ? CHARACTER_CRLF2 : DEFAULT_EOL2;
121938
121938
  }
121939
121939
  function countEndOfLineCharacters(text, endOfLineCharacter) {
121940
- const regex = regexps.get(endOfLineCharacter);
121940
+ const regex2 = regexps.get(endOfLineCharacter);
121941
121941
  if (false) {}
121942
- return text.match(regex)?.length ?? 0;
121942
+ return text.match(regex2)?.length ?? 0;
121943
121943
  }
121944
121944
  function normalizeEndOfLine(text) {
121945
121945
  return method_replace_all_default2(0, text, END_OF_LINE_REGEXP, CHARACTER_LF2);
@@ -124141,8 +124141,8 @@ function legacyIsNextLineEmpty(text, node, locEnd) {
124141
124141
  }
124142
124142
  function makeString(rawText, enclosingQuote, unescapeUnnecessaryEscapes) {
124143
124143
  const otherQuote = enclosingQuote === '"' ? "'" : '"';
124144
- const regex = /\\(.)|(["'])/gsu;
124145
- const raw2 = method_replace_all_default2(0, rawText, regex, (match, escaped, quote) => {
124144
+ const regex2 = /\\(.)|(["'])/gsu;
124145
+ const raw2 = method_replace_all_default2(0, rawText, regex2, (match, escaped, quote) => {
124146
124146
  if (escaped === otherQuote) {
124147
124147
  return escaped;
124148
124148
  }
@@ -127563,17 +127563,17 @@ var init_prettier = __esm(() => {
127563
127563
  }
127564
127564
  const opts = options8 || {};
127565
127565
  const posix = utils3.isWindows(options8);
127566
- const regex = isState ? picomatch.compileRe(glob, options8) : picomatch.makeRe(glob, options8, false, true);
127567
- const state = regex.state;
127568
- delete regex.state;
127566
+ const regex2 = isState ? picomatch.compileRe(glob, options8) : picomatch.makeRe(glob, options8, false, true);
127567
+ const state = regex2.state;
127568
+ delete regex2.state;
127569
127569
  let isIgnored2 = () => false;
127570
127570
  if (opts.ignore) {
127571
127571
  const ignoreOpts = { ...options8, ignore: null, onMatch: null, onResult: null };
127572
127572
  isIgnored2 = picomatch(opts.ignore, ignoreOpts, returnState);
127573
127573
  }
127574
127574
  const matcher = (input, returnObject = false) => {
127575
- const { isMatch, match, output } = picomatch.test(input, regex, options8, { glob, posix });
127576
- const result = { glob, state, regex, posix, input, output, match, isMatch };
127575
+ const { isMatch, match, output } = picomatch.test(input, regex2, options8, { glob, posix });
127576
+ const result = { glob, state, regex: regex2, posix, input, output, match, isMatch };
127577
127577
  if (typeof opts.onResult === "function") {
127578
127578
  opts.onResult(result);
127579
127579
  }
@@ -127598,7 +127598,7 @@ var init_prettier = __esm(() => {
127598
127598
  }
127599
127599
  return matcher;
127600
127600
  };
127601
- picomatch.test = (input, regex, options8, { glob, posix } = {}) => {
127601
+ picomatch.test = (input, regex2, options8, { glob, posix } = {}) => {
127602
127602
  if (typeof input !== "string") {
127603
127603
  throw new TypeError("Expected input to be a string");
127604
127604
  }
@@ -127615,16 +127615,16 @@ var init_prettier = __esm(() => {
127615
127615
  }
127616
127616
  if (match === false || opts.capture === true) {
127617
127617
  if (opts.matchBase === true || opts.basename === true) {
127618
- match = picomatch.matchBase(input, regex, options8, posix);
127618
+ match = picomatch.matchBase(input, regex2, options8, posix);
127619
127619
  } else {
127620
- match = regex.exec(output);
127620
+ match = regex2.exec(output);
127621
127621
  }
127622
127622
  }
127623
127623
  return { isMatch: Boolean(match), match, output };
127624
127624
  };
127625
127625
  picomatch.matchBase = (input, glob, options8, posix = utils3.isWindows(options8)) => {
127626
- const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options8);
127627
- return regex.test(path152.basename(input));
127626
+ const regex2 = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options8);
127627
+ return regex2.test(path152.basename(input));
127628
127628
  };
127629
127629
  picomatch.isMatch = (str, patterns, options8) => picomatch(patterns, options8)(str);
127630
127630
  picomatch.parse = (pattern, options8) => {
@@ -127644,11 +127644,11 @@ var init_prettier = __esm(() => {
127644
127644
  if (state && state.negated === true) {
127645
127645
  source2 = `^(?!${source2}).*$`;
127646
127646
  }
127647
- const regex = picomatch.toRegex(source2, options8);
127647
+ const regex2 = picomatch.toRegex(source2, options8);
127648
127648
  if (returnState === true) {
127649
- regex.state = state;
127649
+ regex2.state = state;
127650
127650
  }
127651
- return regex;
127651
+ return regex2;
127652
127652
  };
127653
127653
  picomatch.makeRe = (input, options8 = {}, returnOutput = false, returnState = false) => {
127654
127654
  if (!input || typeof input !== "string") {
@@ -127812,8 +127812,8 @@ var init_prettier = __esm(() => {
127812
127812
  };
127813
127813
  micromatch2.capture = (glob, input, options8) => {
127814
127814
  let posix = utils3.isWindows(options8);
127815
- let regex = picomatch.makeRe(String(glob), { ...options8, capture: true });
127816
- let match = regex.exec(posix ? utils3.toPosixSlashes(input) : input);
127815
+ let regex2 = picomatch.makeRe(String(glob), { ...options8, capture: true });
127816
+ let match = regex2.exec(posix ? utils3.toPosixSlashes(input) : input);
127817
127817
  if (match) {
127818
127818
  return match.slice(1).map((v10) => v10 === undefined ? "" : v10);
127819
127819
  }
@@ -132252,7 +132252,7 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
132252
132252
  };
132253
132253
  Object.defineProperty(exports, "__esModule", { value: true });
132254
132254
  var fs42 = __importStar(__require2("fs"));
132255
- var regex = {
132255
+ var regex2 = {
132256
132256
  section: /^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$/,
132257
132257
  param: /^\s*([\w\.\-\_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$/,
132258
132258
  comment: /^\s*[#;].*$/
@@ -132284,14 +132284,14 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
132284
132284
  var lines = data.split(/\r\n|\r|\n/);
132285
132285
  lines.forEach(function(line3) {
132286
132286
  var match;
132287
- if (regex.comment.test(line3)) {
132287
+ if (regex2.comment.test(line3)) {
132288
132288
  return;
132289
132289
  }
132290
- if (regex.param.test(line3)) {
132291
- match = line3.match(regex.param);
132290
+ if (regex2.param.test(line3)) {
132291
+ match = line3.match(regex2.param);
132292
132292
  sectionBody[match[1]] = match[2];
132293
- } else if (regex.section.test(line3)) {
132294
- match = line3.match(regex.section);
132293
+ } else if (regex2.section.test(line3)) {
132294
+ match = line3.match(regex2.section);
132295
132295
  sectionName = match[1];
132296
132296
  sectionBody = {};
132297
132297
  value.push([sectionName, sectionBody]);
@@ -133377,8 +133377,8 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
133377
133377
  }
133378
133378
  _make(mode, key2) {
133379
133379
  const str = this.regexPrefix.replace(REGEX_REPLACE_TRAILING_WILDCARD, TRAILING_WILD_CARD_REPLACERS[mode]);
133380
- const regex = this.ignoreCase ? new RegExp(str, "i") : new RegExp(str);
133381
- return define2(this, key2, regex);
133380
+ const regex2 = this.ignoreCase ? new RegExp(str, "i") : new RegExp(str);
133381
+ return define2(this, key2, regex2);
133382
133382
  }
133383
133383
  };
133384
133384
  var createRule = ({
@@ -134672,7 +134672,7 @@ ${codeblock}`, options8);
134672
134672
  "\\": "\\"
134673
134673
  };
134674
134674
  KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
134675
- read_file_default = readFile2;
134675
+ read_file_default = readFile3;
134676
134676
  loadConfigFromPackageJson = process.versions.bun ? async function loadConfigFromBunPackageJson(file2) {
134677
134677
  const { prettier } = await readBunPackageJson(file2);
134678
134678
  return prettier;
@@ -138174,8 +138174,8 @@ var require_prettier = __commonJS((exports, module) => {
138174
138174
  }
138175
138175
  function makeString2(rawText, enclosingQuote, unescapeUnnecessaryEscapes) {
138176
138176
  const otherQuote = enclosingQuote === '"' ? "'" : '"';
138177
- const regex = /\\(.)|(["'])/gsu;
138178
- const raw2 = method_replace_all_default3(0, rawText, regex, (match, escaped, quote) => {
138177
+ const regex2 = /\\(.)|(["'])/gsu;
138178
+ const raw2 = method_replace_all_default3(0, rawText, regex2, (match, escaped, quote) => {
138179
138179
  if (escaped === otherQuote) {
138180
138180
  return escaped;
138181
138181
  }
@@ -138269,11 +138269,11 @@ var require_prettier = __commonJS((exports, module) => {
138269
138269
  var require_formatter = __commonJS((exports) => {
138270
138270
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
138271
138271
  function adopt(value) {
138272
- return value instanceof P9 ? value : new P9(function(resolve10) {
138273
- resolve10(value);
138272
+ return value instanceof P9 ? value : new P9(function(resolve12) {
138273
+ resolve12(value);
138274
138274
  });
138275
138275
  }
138276
- return new (P9 || (P9 = Promise))(function(resolve10, reject) {
138276
+ return new (P9 || (P9 = Promise))(function(resolve12, reject) {
138277
138277
  function fulfilled(value) {
138278
138278
  try {
138279
138279
  step(generator.next(value));
@@ -138289,7 +138289,7 @@ var require_formatter = __commonJS((exports) => {
138289
138289
  }
138290
138290
  }
138291
138291
  function step(result) {
138292
- result.done ? resolve10(result.value) : adopt(result.value).then(fulfilled, rejected);
138292
+ result.done ? resolve12(result.value) : adopt(result.value).then(fulfilled, rejected);
138293
138293
  }
138294
138294
  step((generator = generator.apply(thisArg, _arguments || [])).next());
138295
138295
  });
@@ -142942,7 +142942,7 @@ var require_url = __commonJS((exports) => {
142942
142942
  };
142943
142943
  Object.defineProperty(exports, "__esModule", { value: true });
142944
142944
  exports.parse = undefined;
142945
- exports.resolve = resolve10;
142945
+ exports.resolve = resolve12;
142946
142946
  exports.cwd = cwd;
142947
142947
  exports.getProtocol = getProtocol;
142948
142948
  exports.getExtension = getExtension;
@@ -142970,7 +142970,7 @@ var require_url = __commonJS((exports) => {
142970
142970
  var urlDecodePatterns = [/%23/g, "#", /%24/g, "$", /%26/g, "&", /%2C/g, ",", /%40/g, "@"];
142971
142971
  var parse11 = (u4) => new URL(u4);
142972
142972
  exports.parse = parse11;
142973
- function resolve10(from, to5) {
142973
+ function resolve12(from, to5) {
142974
142974
  const fromUrl = new URL((0, convert_path_to_posix_1.default)(from), "https://aaa.nonexistanturl.com");
142975
142975
  const resolvedUrl = new URL((0, convert_path_to_posix_1.default)(to5), fromUrl);
142976
142976
  const endSpaces = to5.match(/(\s*)$/)?.[1] || "";
@@ -143106,7 +143106,7 @@ var require_url = __commonJS((exports) => {
143106
143106
  }
143107
143107
  function relative4(from, to5) {
143108
143108
  if (!isFileSystemPath(from) || !isFileSystemPath(to5)) {
143109
- return resolve10(from, to5);
143109
+ return resolve12(from, to5);
143110
143110
  }
143111
143111
  const fromDir = path_1.default.dirname(stripHash(from));
143112
143112
  const toPath4 = stripHash(to5);
@@ -143782,7 +143782,7 @@ var require_plugins = __commonJS((exports) => {
143782
143782
  let plugin;
143783
143783
  let lastError;
143784
143784
  let index = 0;
143785
- return new Promise((resolve10, reject) => {
143785
+ return new Promise((resolve12, reject) => {
143786
143786
  runNextPlugin();
143787
143787
  function runNextPlugin() {
143788
143788
  plugin = plugins[index++];
@@ -143810,7 +143810,7 @@ var require_plugins = __commonJS((exports) => {
143810
143810
  }
143811
143811
  }
143812
143812
  function onSuccess(result) {
143813
- resolve10({
143813
+ resolve12({
143814
143814
  plugin,
143815
143815
  result
143816
143816
  });
@@ -143907,7 +143907,7 @@ var require_parse7 = __commonJS((exports) => {
143907
143907
  extension: url3.getExtension(path18)
143908
143908
  };
143909
143909
  try {
143910
- const resolver = await readFile3(file2, options8, $refs);
143910
+ const resolver = await readFile4(file2, options8, $refs);
143911
143911
  $ref.pathType = resolver.plugin.name;
143912
143912
  file2.data = resolver.result;
143913
143913
  const parser2 = await parseFile(file2, options8, $refs);
@@ -143920,7 +143920,7 @@ var require_parse7 = __commonJS((exports) => {
143920
143920
  throw err;
143921
143921
  }
143922
143922
  }
143923
- async function readFile3(file2, options8, $refs) {
143923
+ async function readFile4(file2, options8, $refs) {
143924
143924
  let resolvers = plugins.all(options8.resolve);
143925
143925
  resolvers = plugins.filter(resolvers, "canRead", file2);
143926
143926
  plugins.sort(resolvers);
@@ -145143,11 +145143,11 @@ var require_lib3 = __commonJS((exports) => {
145143
145143
  var require_resolver = __commonJS((exports) => {
145144
145144
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
145145
145145
  function adopt(value) {
145146
- return value instanceof P9 ? value : new P9(function(resolve10) {
145147
- resolve10(value);
145146
+ return value instanceof P9 ? value : new P9(function(resolve12) {
145147
+ resolve12(value);
145148
145148
  });
145149
145149
  }
145150
- return new (P9 || (P9 = Promise))(function(resolve10, reject) {
145150
+ return new (P9 || (P9 = Promise))(function(resolve12, reject) {
145151
145151
  function fulfilled(value) {
145152
145152
  try {
145153
145153
  step(generator.next(value));
@@ -145163,7 +145163,7 @@ var require_resolver = __commonJS((exports) => {
145163
145163
  }
145164
145164
  }
145165
145165
  function step(result) {
145166
- result.done ? resolve10(result.value) : adopt(result.value).then(fulfilled, rejected);
145166
+ result.done ? resolve12(result.value) : adopt(result.value).then(fulfilled, rejected);
145167
145167
  }
145168
145168
  step((generator = generator.apply(thisArg, _arguments || [])).next());
145169
145169
  });
@@ -145284,11 +145284,11 @@ var require_optionValidator = __commonJS((exports) => {
145284
145284
  var require_src3 = __commonJS((exports) => {
145285
145285
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
145286
145286
  function adopt(value) {
145287
- return value instanceof P9 ? value : new P9(function(resolve10) {
145288
- resolve10(value);
145287
+ return value instanceof P9 ? value : new P9(function(resolve12) {
145288
+ resolve12(value);
145289
145289
  });
145290
145290
  }
145291
- return new (P9 || (P9 = Promise))(function(resolve10, reject) {
145291
+ return new (P9 || (P9 = Promise))(function(resolve12, reject) {
145292
145292
  function fulfilled(value) {
145293
145293
  try {
145294
145294
  step(generator.next(value));
@@ -145304,7 +145304,7 @@ var require_src3 = __commonJS((exports) => {
145304
145304
  }
145305
145305
  }
145306
145306
  function step(result) {
145307
- result.done ? resolve10(result.value) : adopt(result.value).then(fulfilled, rejected);
145307
+ result.done ? resolve12(result.value) : adopt(result.value).then(fulfilled, rejected);
145308
145308
  }
145309
145309
  step((generator = generator.apply(thisArg, _arguments || [])).next());
145310
145310
  });
@@ -150819,11 +150819,11 @@ var require_raw_body = __commonJS((exports, module) => {
150819
150819
  if (done) {
150820
150820
  return readStream(stream, encoding, length, limit, wrap(done));
150821
150821
  }
150822
- return new Promise(function executor(resolve10, reject) {
150822
+ return new Promise(function executor(resolve12, reject) {
150823
150823
  readStream(stream, encoding, length, limit, function onRead2(err, buf) {
150824
150824
  if (err)
150825
150825
  return reject(err);
150826
- resolve10(buf);
150826
+ resolve12(buf);
150827
150827
  });
150828
150828
  });
150829
150829
  }
@@ -163948,7 +163948,7 @@ var require_view = __commonJS((exports, module) => {
163948
163948
  var basename6 = path18.basename;
163949
163949
  var extname2 = path18.extname;
163950
163950
  var join25 = path18.join;
163951
- var resolve10 = path18.resolve;
163951
+ var resolve12 = path18.resolve;
163952
163952
  module.exports = View;
163953
163953
  function View(name2, options8) {
163954
163954
  var opts = options8 || {};
@@ -163982,7 +163982,7 @@ var require_view = __commonJS((exports, module) => {
163982
163982
  debug('lookup "%s"', name2);
163983
163983
  for (var i5 = 0;i5 < roots.length && !path19; i5++) {
163984
163984
  var root2 = roots[i5];
163985
- var loc = resolve10(root2, name2);
163985
+ var loc = resolve12(root2, name2);
163986
163986
  var dir = dirname19(loc);
163987
163987
  var file2 = basename6(loc);
163988
163988
  path19 = this.resolve(dir, file2);
@@ -164007,7 +164007,7 @@ var require_view = __commonJS((exports, module) => {
164007
164007
  });
164008
164008
  sync = false;
164009
164009
  };
164010
- View.prototype.resolve = function resolve11(dir, file2) {
164010
+ View.prototype.resolve = function resolve13(dir, file2) {
164011
164011
  var ext = this.ext;
164012
164012
  var path19 = join25(dir, file2);
164013
164013
  var stat2 = tryStat(path19);
@@ -164333,12 +164333,12 @@ var require_ipaddr = __commonJS((exports, module) => {
164333
164333
  return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/, "::");
164334
164334
  };
164335
164335
  IPv6.prototype.toRFC5952String = function() {
164336
- var bestMatchIndex, bestMatchLength, match, regex, string4;
164337
- regex = /((^|:)(0(:|$)){2,})/g;
164336
+ var bestMatchIndex, bestMatchLength, match, regex2, string4;
164337
+ regex2 = /((^|:)(0(:|$)){2,})/g;
164338
164338
  string4 = this.toNormalizedString();
164339
164339
  bestMatchIndex = 0;
164340
164340
  bestMatchLength = -1;
164341
- while (match = regex.exec(string4)) {
164341
+ while (match = regex2.exec(string4)) {
164342
164342
  if (match[0].length > bestMatchLength) {
164343
164343
  bestMatchIndex = match.index;
164344
164344
  bestMatchLength = match[0].length;
@@ -166166,7 +166166,7 @@ var require_application = __commonJS((exports, module) => {
166166
166166
  var compileETag = require_utils10().compileETag;
166167
166167
  var compileQueryParser = require_utils10().compileQueryParser;
166168
166168
  var compileTrust = require_utils10().compileTrust;
166169
- var resolve10 = __require("node:path").resolve;
166169
+ var resolve12 = __require("node:path").resolve;
166170
166170
  var once9 = require_once();
166171
166171
  var Router = require_router();
166172
166172
  var slice = Array.prototype.slice;
@@ -166220,7 +166220,7 @@ var require_application = __commonJS((exports, module) => {
166220
166220
  this.mountpath = "/";
166221
166221
  this.locals.settings = this.settings;
166222
166222
  this.set("view", View);
166223
- this.set("views", resolve10("views"));
166223
+ this.set("views", resolve12("views"));
166224
166224
  this.set("jsonp callback name", "callback");
166225
166225
  if (env3 === "production") {
166226
166226
  this.enable("view cache");
@@ -167711,7 +167711,7 @@ var require_send = __commonJS((exports, module) => {
167711
167711
  var extname2 = path18.extname;
167712
167712
  var join25 = path18.join;
167713
167713
  var normalize2 = path18.normalize;
167714
- var resolve10 = path18.resolve;
167714
+ var resolve12 = path18.resolve;
167715
167715
  var sep = path18.sep;
167716
167716
  var BYTES_RANGE_REGEXP = /^ *bytes=/;
167717
167717
  var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000;
@@ -167740,7 +167740,7 @@ var require_send = __commonJS((exports, module) => {
167740
167740
  this._maxage = opts.maxAge || opts.maxage;
167741
167741
  this._maxage = typeof this._maxage === "string" ? ms9(this._maxage) : Number(this._maxage);
167742
167742
  this._maxage = !isNaN(this._maxage) ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) : 0;
167743
- this._root = opts.root ? resolve10(opts.root) : null;
167743
+ this._root = opts.root ? resolve12(opts.root) : null;
167744
167744
  }
167745
167745
  util2.inherits(SendStream, Stream2);
167746
167746
  SendStream.prototype.error = function error48(status, err) {
@@ -167889,7 +167889,7 @@ var require_send = __commonJS((exports, module) => {
167889
167889
  return res;
167890
167890
  }
167891
167891
  parts = normalize2(path19).split(sep);
167892
- path19 = resolve10(path19);
167892
+ path19 = resolve12(path19);
167893
167893
  }
167894
167894
  if (containsDotFile(parts)) {
167895
167895
  debug('%s dotfile "%s"', this._dotfiles, path19);
@@ -168217,7 +168217,7 @@ var require_response = __commonJS((exports, module) => {
168217
168217
  var cookie = require_cookie();
168218
168218
  var send = require_send();
168219
168219
  var extname2 = path18.extname;
168220
- var resolve10 = path18.resolve;
168220
+ var resolve12 = path18.resolve;
168221
168221
  var vary = require_vary();
168222
168222
  var { Buffer: Buffer7 } = __require("node:buffer");
168223
168223
  var res = Object.create(http.ServerResponse.prototype);
@@ -168426,7 +168426,7 @@ var require_response = __commonJS((exports, module) => {
168426
168426
  }
168427
168427
  opts = Object.create(opts);
168428
168428
  opts.headers = headers;
168429
- var fullPath = !opts.root ? resolve10(path19) : path19;
168429
+ var fullPath = !opts.root ? resolve12(path19) : path19;
168430
168430
  return this.sendFile(fullPath, opts, done);
168431
168431
  };
168432
168432
  res.contentType = res.type = function contentType(type) {
@@ -168687,7 +168687,7 @@ var require_serve_static = __commonJS((exports, module) => {
168687
168687
  var encodeUrl = require_encodeurl();
168688
168688
  var escapeHtml = require_escape_html();
168689
168689
  var parseUrl = require_parseurl();
168690
- var resolve10 = __require("path").resolve;
168690
+ var resolve12 = __require("path").resolve;
168691
168691
  var send = require_send();
168692
168692
  var url3 = __require("url");
168693
168693
  module.exports = serveStatic;
@@ -168706,7 +168706,7 @@ var require_serve_static = __commonJS((exports, module) => {
168706
168706
  throw new TypeError("option setHeaders must be function");
168707
168707
  }
168708
168708
  opts.maxage = opts.maxage || opts.maxAge || 0;
168709
- opts.root = resolve10(root2);
168709
+ opts.root = resolve12(root2);
168710
168710
  var onDirectory = redirect ? createRedirectDirectoryListener() : createNotFoundDirectoryListener();
168711
168711
  return function serveStatic2(req, res, next) {
168712
168712
  if (req.method !== "GET" && req.method !== "HEAD") {
@@ -169656,10 +169656,10 @@ var require_follow_redirects = __commonJS((exports, module) => {
169656
169656
  spread.path = spread.search ? spread.pathname + spread.search : spread.pathname;
169657
169657
  return spread;
169658
169658
  }
169659
- function removeMatchingHeaders(regex, headers) {
169659
+ function removeMatchingHeaders(regex2, headers) {
169660
169660
  var lastValue;
169661
169661
  for (var header2 in headers) {
169662
- if (regex.test(header2)) {
169662
+ if (regex2.test(header2)) {
169663
169663
  lastValue = headers[header2];
169664
169664
  delete headers[header2];
169665
169665
  }
@@ -172080,8 +172080,8 @@ var require_executor = __commonJS((exports, module) => {
172080
172080
  }
172081
172081
  resetBuffer() {
172082
172082
  this.buffer = new Waterfall;
172083
- this.buffer.chain(new Promise((resolve10) => {
172084
- this._triggerBuffer = resolve10;
172083
+ this.buffer.chain(new Promise((resolve12) => {
172084
+ this._triggerBuffer = resolve12;
172085
172085
  }));
172086
172086
  if (this.ready)
172087
172087
  this._triggerBuffer();
@@ -173101,7 +173101,7 @@ var require_storage = __commonJS((exports, module) => {
173101
173101
  throw e8;
173102
173102
  }
173103
173103
  };
173104
- var writeFileLinesAsync = (filename, lines, mode = DEFAULT_FILE_MODE) => new Promise((resolve10, reject) => {
173104
+ var writeFileLinesAsync = (filename, lines, mode = DEFAULT_FILE_MODE) => new Promise((resolve12, reject) => {
173105
173105
  try {
173106
173106
  const stream = writeFileStream(filename, { mode });
173107
173107
  const readable2 = Readable6.from(lines);
@@ -173118,7 +173118,7 @@ var require_storage = __commonJS((exports, module) => {
173118
173118
  if (err)
173119
173119
  reject(err);
173120
173120
  else
173121
- resolve10();
173121
+ resolve12();
173122
173122
  });
173123
173123
  });
173124
173124
  readable2.on("error", (err) => {
@@ -173289,7 +173289,7 @@ var require_persistence = __commonJS((exports, module) => {
173289
173289
  return { data: tdata, indexes };
173290
173290
  }
173291
173291
  treatRawStreamAsync(rawStream) {
173292
- return new Promise((resolve10, reject) => {
173292
+ return new Promise((resolve12, reject) => {
173293
173293
  const dataById = {};
173294
173294
  const indexes = {};
173295
173295
  let corruptItems = 0;
@@ -173332,7 +173332,7 @@ var require_persistence = __commonJS((exports, module) => {
173332
173332
  }
173333
173333
  }
173334
173334
  const data = Object.values(dataById);
173335
- resolve10({ data, indexes });
173335
+ resolve12({ data, indexes });
173336
173336
  });
173337
173337
  lineStream.on("error", function(err) {
173338
173338
  reject(err, null);
@@ -198943,13 +198943,13 @@ var require_broadcast_operator = __commonJS((exports) => {
198943
198943
  return true;
198944
198944
  }
198945
198945
  emitWithAck(ev2, ...args) {
198946
- return new Promise((resolve10, reject) => {
198946
+ return new Promise((resolve12, reject) => {
198947
198947
  args.push((err, responses) => {
198948
198948
  if (err) {
198949
198949
  err.responses = responses;
198950
198950
  return reject(err);
198951
198951
  } else {
198952
- return resolve10(responses);
198952
+ return resolve12(responses);
198953
198953
  }
198954
198954
  });
198955
198955
  this.emit(ev2, ...args);
@@ -199137,12 +199137,12 @@ var require_socket2 = __commonJS((exports) => {
199137
199137
  }
199138
199138
  emitWithAck(ev2, ...args) {
199139
199139
  const withErr = this.flags.timeout !== undefined;
199140
- return new Promise((resolve10, reject) => {
199140
+ return new Promise((resolve12, reject) => {
199141
199141
  args.push((arg1, arg2) => {
199142
199142
  if (withErr) {
199143
- return arg1 ? reject(arg1) : resolve10(arg2);
199143
+ return arg1 ? reject(arg1) : resolve12(arg2);
199144
199144
  } else {
199145
- return resolve10(arg1);
199145
+ return resolve12(arg1);
199146
199146
  }
199147
199147
  });
199148
199148
  this.emit(ev2, ...args);
@@ -199597,13 +199597,13 @@ var require_namespace = __commonJS((exports) => {
199597
199597
  return true;
199598
199598
  }
199599
199599
  serverSideEmitWithAck(ev2, ...args) {
199600
- return new Promise((resolve10, reject) => {
199600
+ return new Promise((resolve12, reject) => {
199601
199601
  args.push((err, responses) => {
199602
199602
  if (err) {
199603
199603
  err.responses = responses;
199604
199604
  return reject(err);
199605
199605
  } else {
199606
- return resolve10(responses);
199606
+ return resolve12(responses);
199607
199607
  }
199608
199608
  });
199609
199609
  this.serverSideEmit(ev2, ...args);
@@ -200287,7 +200287,7 @@ var require_cluster_adapter = __commonJS((exports) => {
200287
200287
  return localSockets;
200288
200288
  }
200289
200289
  const requestId = randomId();
200290
- return new Promise((resolve10, reject) => {
200290
+ return new Promise((resolve12, reject) => {
200291
200291
  const timeout3 = setTimeout(() => {
200292
200292
  const storedRequest2 = this.requests.get(requestId);
200293
200293
  if (storedRequest2) {
@@ -200297,7 +200297,7 @@ var require_cluster_adapter = __commonJS((exports) => {
200297
200297
  }, opts.flags.timeout || DEFAULT_TIMEOUT);
200298
200298
  const storedRequest = {
200299
200299
  type: MessageType.FETCH_SOCKETS,
200300
- resolve: resolve10,
200300
+ resolve: resolve12,
200301
200301
  timeout: timeout3,
200302
200302
  current: 0,
200303
200303
  expected: expectedResponseCount,
@@ -200507,7 +200507,7 @@ var require_cluster_adapter = __commonJS((exports) => {
200507
200507
  return localSockets;
200508
200508
  }
200509
200509
  const requestId = randomId();
200510
- return new Promise((resolve10, reject) => {
200510
+ return new Promise((resolve12, reject) => {
200511
200511
  const timeout3 = setTimeout(() => {
200512
200512
  const storedRequest2 = this.customRequests.get(requestId);
200513
200513
  if (storedRequest2) {
@@ -200517,7 +200517,7 @@ var require_cluster_adapter = __commonJS((exports) => {
200517
200517
  }, opts.flags.timeout || DEFAULT_TIMEOUT);
200518
200518
  const storedRequest = {
200519
200519
  type: MessageType.FETCH_SOCKETS,
200520
- resolve: resolve10,
200520
+ resolve: resolve12,
200521
200521
  timeout: timeout3,
200522
200522
  missingUids: new Set([...this.nodesMap.keys()]),
200523
200523
  responses: localSockets
@@ -201219,9 +201219,9 @@ var require_dist4 = __commonJS((exports, module) => {
201219
201219
  name2 = "/" + name2;
201220
201220
  let nsp = this._nsps.get(name2);
201221
201221
  if (!nsp) {
201222
- for (const [regex, parentNamespace] of this.parentNamespacesFromRegExp) {
201223
- if (regex.test(name2)) {
201224
- debug("attaching namespace %s to parent namespace %s", name2, regex);
201222
+ for (const [regex2, parentNamespace] of this.parentNamespacesFromRegExp) {
201223
+ if (regex2.test(name2)) {
201224
+ debug("attaching namespace %s to parent namespace %s", name2, regex2);
201225
201225
  return parentNamespace.createChild(name2);
201226
201226
  }
201227
201227
  }
@@ -201246,13 +201246,13 @@ var require_dist4 = __commonJS((exports, module) => {
201246
201246
  this.engine.close();
201247
201247
  (0, uws_1.restoreAdapter)();
201248
201248
  if (this.httpServer) {
201249
- return new Promise((resolve10) => {
201249
+ return new Promise((resolve12) => {
201250
201250
  this.httpServer.close((err) => {
201251
201251
  fn9 && fn9(err);
201252
201252
  if (err) {
201253
201253
  debug("server was not running");
201254
201254
  }
201255
- resolve10();
201255
+ resolve12();
201256
201256
  });
201257
201257
  });
201258
201258
  } else {
@@ -215914,14 +215914,14 @@ var require_async_iterator = __commonJS((exports, module) => {
215914
215914
  };
215915
215915
  }
215916
215916
  function readAndResolve(iter) {
215917
- var resolve10 = iter[kLastResolve];
215918
- if (resolve10 !== null) {
215917
+ var resolve12 = iter[kLastResolve];
215918
+ if (resolve12 !== null) {
215919
215919
  var data = iter[kStream].read();
215920
215920
  if (data !== null) {
215921
215921
  iter[kLastPromise] = null;
215922
215922
  iter[kLastResolve] = null;
215923
215923
  iter[kLastReject] = null;
215924
- resolve10(createIterResult(data, false));
215924
+ resolve12(createIterResult(data, false));
215925
215925
  }
215926
215926
  }
215927
215927
  }
@@ -215929,13 +215929,13 @@ var require_async_iterator = __commonJS((exports, module) => {
215929
215929
  process.nextTick(readAndResolve, iter);
215930
215930
  }
215931
215931
  function wrapForNext(lastPromise, iter) {
215932
- return function(resolve10, reject) {
215932
+ return function(resolve12, reject) {
215933
215933
  lastPromise.then(function() {
215934
215934
  if (iter[kEnded]) {
215935
- resolve10(createIterResult(undefined, true));
215935
+ resolve12(createIterResult(undefined, true));
215936
215936
  return;
215937
215937
  }
215938
- iter[kHandlePromise](resolve10, reject);
215938
+ iter[kHandlePromise](resolve12, reject);
215939
215939
  }, reject);
215940
215940
  };
215941
215941
  }
@@ -215954,12 +215954,12 @@ var require_async_iterator = __commonJS((exports, module) => {
215954
215954
  return Promise.resolve(createIterResult(undefined, true));
215955
215955
  }
215956
215956
  if (this[kStream].destroyed) {
215957
- return new Promise(function(resolve10, reject) {
215957
+ return new Promise(function(resolve12, reject) {
215958
215958
  process.nextTick(function() {
215959
215959
  if (_this[kError]) {
215960
215960
  reject(_this[kError]);
215961
215961
  } else {
215962
- resolve10(createIterResult(undefined, true));
215962
+ resolve12(createIterResult(undefined, true));
215963
215963
  }
215964
215964
  });
215965
215965
  });
@@ -215982,13 +215982,13 @@ var require_async_iterator = __commonJS((exports, module) => {
215982
215982
  return this;
215983
215983
  }), _defineProperty(_Object$setPrototypeO, "return", function _return() {
215984
215984
  var _this2 = this;
215985
- return new Promise(function(resolve10, reject) {
215985
+ return new Promise(function(resolve12, reject) {
215986
215986
  _this2[kStream].destroy(null, function(err) {
215987
215987
  if (err) {
215988
215988
  reject(err);
215989
215989
  return;
215990
215990
  }
215991
- resolve10(createIterResult(undefined, true));
215991
+ resolve12(createIterResult(undefined, true));
215992
215992
  });
215993
215993
  });
215994
215994
  }), _Object$setPrototypeO), AsyncIteratorPrototype);
@@ -216010,15 +216010,15 @@ var require_async_iterator = __commonJS((exports, module) => {
216010
216010
  value: stream._readableState.endEmitted,
216011
216011
  writable: true
216012
216012
  }), _defineProperty(_Object$create, kHandlePromise, {
216013
- value: function value(resolve10, reject) {
216013
+ value: function value(resolve12, reject) {
216014
216014
  var data = iterator[kStream].read();
216015
216015
  if (data) {
216016
216016
  iterator[kLastPromise] = null;
216017
216017
  iterator[kLastResolve] = null;
216018
216018
  iterator[kLastReject] = null;
216019
- resolve10(createIterResult(data, false));
216019
+ resolve12(createIterResult(data, false));
216020
216020
  } else {
216021
- iterator[kLastResolve] = resolve10;
216021
+ iterator[kLastResolve] = resolve12;
216022
216022
  iterator[kLastReject] = reject;
216023
216023
  }
216024
216024
  },
@@ -216037,12 +216037,12 @@ var require_async_iterator = __commonJS((exports, module) => {
216037
216037
  iterator[kError] = err;
216038
216038
  return;
216039
216039
  }
216040
- var resolve10 = iterator[kLastResolve];
216041
- if (resolve10 !== null) {
216040
+ var resolve12 = iterator[kLastResolve];
216041
+ if (resolve12 !== null) {
216042
216042
  iterator[kLastPromise] = null;
216043
216043
  iterator[kLastResolve] = null;
216044
216044
  iterator[kLastReject] = null;
216045
- resolve10(createIterResult(undefined, true));
216045
+ resolve12(createIterResult(undefined, true));
216046
216046
  }
216047
216047
  iterator[kEnded] = true;
216048
216048
  });
@@ -216054,7 +216054,7 @@ var require_async_iterator = __commonJS((exports, module) => {
216054
216054
 
216055
216055
  // ../../node_modules/readable-stream/lib/internal/streams/from.js
216056
216056
  var require_from = __commonJS((exports, module) => {
216057
- function asyncGeneratorStep(gen, resolve10, reject, _next, _throw, key2, arg) {
216057
+ function asyncGeneratorStep(gen, resolve12, reject, _next, _throw, key2, arg) {
216058
216058
  try {
216059
216059
  var info = gen[key2](arg);
216060
216060
  var value = info.value;
@@ -216063,7 +216063,7 @@ var require_from = __commonJS((exports, module) => {
216063
216063
  return;
216064
216064
  }
216065
216065
  if (info.done) {
216066
- resolve10(value);
216066
+ resolve12(value);
216067
216067
  } else {
216068
216068
  Promise.resolve(value).then(_next, _throw);
216069
216069
  }
@@ -216071,13 +216071,13 @@ var require_from = __commonJS((exports, module) => {
216071
216071
  function _asyncToGenerator(fn9) {
216072
216072
  return function() {
216073
216073
  var self2 = this, args = arguments;
216074
- return new Promise(function(resolve10, reject) {
216074
+ return new Promise(function(resolve12, reject) {
216075
216075
  var gen = fn9.apply(self2, args);
216076
216076
  function _next(value) {
216077
- asyncGeneratorStep(gen, resolve10, reject, _next, _throw, "next", value);
216077
+ asyncGeneratorStep(gen, resolve12, reject, _next, _throw, "next", value);
216078
216078
  }
216079
216079
  function _throw(err) {
216080
- asyncGeneratorStep(gen, resolve10, reject, _next, _throw, "throw", err);
216080
+ asyncGeneratorStep(gen, resolve12, reject, _next, _throw, "throw", err);
216081
216081
  }
216082
216082
  _next(undefined);
216083
216083
  });
@@ -235840,6 +235840,24 @@ var BANNER_LINES = [
235840
235840
  async function printBanner() {
235841
235841
  await printAnimatedLines(BANNER_LINES);
235842
235842
  }
235843
+ // ../../node_modules/ansi-regex/index.js
235844
+ function ansiRegex({ onlyFirst = false } = {}) {
235845
+ const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
235846
+ const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
235847
+ const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
235848
+ const pattern = `${osc}|${csi}`;
235849
+ return new RegExp(pattern, onlyFirst ? undefined : "g");
235850
+ }
235851
+
235852
+ // ../../node_modules/strip-ansi/index.js
235853
+ var regex = ansiRegex();
235854
+ function stripAnsi(string4) {
235855
+ if (typeof string4 !== "string") {
235856
+ throw new TypeError(`Expected a \`string\`, got \`${typeof string4}\``);
235857
+ }
235858
+ return string4.replace(regex, "");
235859
+ }
235860
+
235843
235861
  // ../../node_modules/p-wait-for/index.js
235844
235862
  var resolveValue = Symbol("resolveValue");
235845
235863
  var sleep2 = (ms, signal) => new Promise((resolve, reject) => {
@@ -243424,6 +243442,7 @@ var ListFunctionsResponseSchema = exports_external.object({
243424
243442
  functions: exports_external.array(FunctionInfoSchema)
243425
243443
  });
243426
243444
  var LogLevelSchema = exports_external.enum(["info", "warning", "error", "debug"]);
243445
+ var LogEnvSchema = exports_external.enum(["preview", "prod"]);
243427
243446
  var FunctionLogEntrySchema = exports_external.object({
243428
243447
  time: exports_external.string(),
243429
243448
  level: exports_external.preprocess((v) => v === "warn" ? "warning" : !v || v === "log" ? "info" : v, LogLevelSchema),
@@ -243894,7 +243913,7 @@ import { join as join11 } from "node:path";
243894
243913
  // package.json
243895
243914
  var package_default = {
243896
243915
  name: "base44",
243897
- version: "0.0.57",
243916
+ version: "0.1.0",
243898
243917
  description: "Base44 CLI - Unified interface for managing Base44 applications",
243899
243918
  type: "module",
243900
243919
  bin: {
@@ -244265,6 +244284,11 @@ function getAppClient() {
244265
244284
  prefixUrl: new URL(`/api/apps/${id}/`, getBase44ApiUrl()).href
244266
244285
  });
244267
244286
  }
244287
+ function getSandboxClient(appId) {
244288
+ return base44Client.extend({
244289
+ prefixUrl: new URL(`/api/apps/${appId}/sandbox-bridge/`, getBase44ApiUrl()).href
244290
+ });
244291
+ }
244268
244292
  // src/core/clients/oauth-client.ts
244269
244293
  import { randomUUID as randomUUID3 } from "node:crypto";
244270
244294
  var oauthClient = distribution_default.create({
@@ -244285,7 +244309,7 @@ async function generateDeviceCode() {
244285
244309
  const response = await oauthClient.post("oauth/device/code", {
244286
244310
  json: {
244287
244311
  client_id: AUTH_CLIENT_ID,
244288
- scope: "apps:read apps:write"
244312
+ scope: "apps:read apps:write sandbox:write"
244289
244313
  },
244290
244314
  throwHttpErrors: false
244291
244315
  });
@@ -251091,6 +251115,35 @@ function showPlainError(error48) {
251091
251115
  }
251092
251116
 
251093
251117
  // src/cli/utils/command/Base44Command.ts
251118
+ function writeJsonSuccess(result) {
251119
+ if (result.stdout) {
251120
+ if (result.outroMessage) {
251121
+ process.stderr.write(`${result.outroMessage}
251122
+ `);
251123
+ }
251124
+ process.stdout.write(result.stdout);
251125
+ return;
251126
+ }
251127
+ process.stdout.write(`${JSON.stringify({ output: stripAnsi(result.outroMessage ?? "") })}
251128
+ `);
251129
+ }
251130
+ function writeJsonError(error48) {
251131
+ const envelope = {
251132
+ error: error48 instanceof Error ? error48.message : String(error48)
251133
+ };
251134
+ if (isCLIError(error48)) {
251135
+ envelope.code = error48.code;
251136
+ if (error48.details.length > 0) {
251137
+ envelope.details = error48.details;
251138
+ }
251139
+ if (error48.hints.length > 0) {
251140
+ envelope.hints = error48.hints;
251141
+ }
251142
+ }
251143
+ process.stdout.write(`${JSON.stringify(envelope)}
251144
+ `);
251145
+ }
251146
+
251094
251147
  class Base44Command extends Command {
251095
251148
  _context;
251096
251149
  _commandOptions;
@@ -251111,12 +251164,10 @@ class Base44Command extends Command {
251111
251164
  }
251112
251165
  return this._context;
251113
251166
  }
251114
- isRawOutputMode() {
251115
- return this.opts().format === "json";
251116
- }
251117
251167
  action(fn) {
251118
251168
  return super.action(async (...args) => {
251119
- const quiet = this.context.isNonInteractive || this.isRawOutputMode();
251169
+ const jsonMode = this.context.jsonMode;
251170
+ const quiet = this.context.isNonInteractive || jsonMode;
251120
251171
  if (!quiet) {
251121
251172
  await showCommandStart(this._commandOptions.fullBanner);
251122
251173
  }
@@ -251132,6 +251183,13 @@ class Base44Command extends Command {
251132
251183
  const result = await fn(this.context, ...args) ?? {};
251133
251184
  if (!quiet) {
251134
251185
  await showCommandEnd(result, upgradeCheckPromise, this.context.distribution);
251186
+ } else if (jsonMode) {
251187
+ writeJsonSuccess(result);
251188
+ const upgradeInfo = await upgradeCheckPromise;
251189
+ if (upgradeInfo) {
251190
+ process.stderr.write(`${formatPlainUpgradeMessage(upgradeInfo, this.context.distribution)}
251191
+ `);
251192
+ }
251135
251193
  } else {
251136
251194
  if (result.outroMessage) {
251137
251195
  process.stdout.write(`${result.outroMessage}
@@ -251147,7 +251205,9 @@ class Base44Command extends Command {
251147
251205
  }
251148
251206
  }
251149
251207
  } catch (error48) {
251150
- if (quiet) {
251208
+ if (jsonMode) {
251209
+ writeJsonError(error48);
251210
+ } else if (quiet) {
251151
251211
  showPlainError(error48);
251152
251212
  } else {
251153
251213
  showThemedError(error48, this.context);
@@ -251203,7 +251263,7 @@ function createSimpleRunTask(log) {
251203
251263
  };
251204
251264
  }
251205
251265
  // src/cli/utils/stdin.ts
251206
- async function readStdin(flagName = "--stdin") {
251266
+ async function readStdin(flagName = "--stdin", options = {}) {
251207
251267
  if (process.stdin.isTTY) {
251208
251268
  throw new InvalidInputError(`${flagName} requires piped input (e.g., echo <value> | base44 ...)`);
251209
251269
  }
@@ -251211,7 +251271,8 @@ async function readStdin(flagName = "--stdin") {
251211
251271
  for await (const chunk of process.stdin) {
251212
251272
  chunks.push(chunk);
251213
251273
  }
251214
- return Buffer.concat(chunks).toString("utf-8").trim();
251274
+ const text = Buffer.concat(chunks).toString("utf-8");
251275
+ return options.trim === false ? text : text.trim();
251215
251276
  }
251216
251277
 
251217
251278
  // src/cli/utils/secret-input.ts
@@ -251837,73 +251898,6 @@ function getWhoamiCommand() {
251837
251898
  return new Base44Command("whoami", { requireAppContext: false }).description("Display current authenticated user").action(whoami);
251838
251899
  }
251839
251900
 
251840
- // src/cli/commands/connectors/list-available.ts
251841
- async function listAvailableAction({
251842
- log,
251843
- runTask: runTask2
251844
- }) {
251845
- const { integrations } = await runTask2("Fetching available integrations from Base44", async () => {
251846
- return await listAvailableIntegrations();
251847
- }, {
251848
- successMessage: "Available integrations fetched successfully",
251849
- errorMessage: "Failed to fetch available integrations"
251850
- });
251851
- if (integrations.length === 0) {
251852
- return { outroMessage: "No available integrations found." };
251853
- }
251854
- for (const { displayName, ...rest } of integrations) {
251855
- const yaml2 = formatYaml(rest);
251856
- const pad = " ".repeat(YAML_INDENT);
251857
- log.info(`${displayName}
251858
- ${pad}${yaml2.replace(/\n/g, `
251859
- ${pad}`)}`);
251860
- }
251861
- return {
251862
- outroMessage: `Found ${integrations.length} available integrations.`
251863
- };
251864
- }
251865
- function getConnectorsListAvailableCommand() {
251866
- return new Base44Command("list-available").description("List all available integration types").action(listAvailableAction);
251867
- }
251868
-
251869
- // src/cli/commands/connectors/pull.ts
251870
- import { dirname as dirname15, join as join19 } from "node:path";
251871
- async function pullConnectorsAction({
251872
- log,
251873
- runTask: runTask2
251874
- }) {
251875
- const { project: project2 } = await readProjectConfig();
251876
- const configDir = dirname15(project2.configPath);
251877
- const connectorsDir = join19(configDir, project2.connectorsDir);
251878
- const remoteConnectors = await runTask2("Fetching connectors from Base44", async () => {
251879
- return await pullAllConnectors();
251880
- }, {
251881
- successMessage: "Connectors fetched successfully",
251882
- errorMessage: "Failed to fetch connectors"
251883
- });
251884
- const { written, deleted } = await runTask2("Syncing connector files", async () => {
251885
- return await writeConnectors(connectorsDir, remoteConnectors);
251886
- }, {
251887
- successMessage: "Connector files synced successfully",
251888
- errorMessage: "Failed to sync connector files"
251889
- });
251890
- if (written.length > 0) {
251891
- log.success(`Written: ${written.join(", ")}`);
251892
- }
251893
- if (deleted.length > 0) {
251894
- log.warn(`Deleted: ${deleted.join(", ")}`);
251895
- }
251896
- if (written.length === 0 && deleted.length === 0) {
251897
- log.info("All connectors are already up to date");
251898
- }
251899
- return {
251900
- outroMessage: `Pulled ${remoteConnectors.length} connectors to ${connectorsDir}`
251901
- };
251902
- }
251903
- function getConnectorsPullCommand() {
251904
- return new Base44Command("pull").description("Pull connectors from Base44 to local files (replaces all local connector configs)").action(pullConnectorsAction);
251905
- }
251906
-
251907
251901
  // ../../node_modules/open/index.js
251908
251902
  import process20 from "node:process";
251909
251903
  import path16 from "node:path";
@@ -252594,7 +252588,165 @@ async function promptOAuthFlows(pending, log, options) {
252594
252588
  return outcomes;
252595
252589
  }
252596
252590
 
252591
+ // src/cli/commands/connectors/initiate.ts
252592
+ function parseIntegrationType(value) {
252593
+ const result = IntegrationTypeSchema.safeParse(value);
252594
+ if (!result.success) {
252595
+ throw new InvalidInputError("A valid --integration-type is required (e.g. googlecalendar, gmail, slack).");
252596
+ }
252597
+ return result.data;
252598
+ }
252599
+ function parseScopes(scopes) {
252600
+ return (scopes ?? []).flatMap((s) => s.split(",")).map((s) => s.trim()).filter(Boolean);
252601
+ }
252602
+ async function initiateAction(ctx, options) {
252603
+ const { log, runTask: runTask2, isNonInteractive, jsonMode } = ctx;
252604
+ const integrationType = parseIntegrationType(options.integrationType);
252605
+ const scopes = parseScopes(options.scopes);
252606
+ const response = await runTask2(`Initiating ${integrationType} connector`, () => setConnector(integrationType, scopes), {
252607
+ successMessage: `Connector ${integrationType} initialized`,
252608
+ errorMessage: `Failed to initialize ${integrationType}`
252609
+ });
252610
+ if (response.error) {
252611
+ const detail = response.error === "different_user" && response.otherUserEmail ? ` (already authorized by ${response.otherUserEmail})` : response.errorMessage ? ` (${response.errorMessage})` : "";
252612
+ throw new InvalidInputError(`Could not initiate ${integrationType}: ${response.error}${detail}`);
252613
+ }
252614
+ if (jsonMode) {
252615
+ return {
252616
+ outroMessage: response.alreadyAuthorized ? `${integrationType} already authorized` : `${integrationType} initialized`,
252617
+ stdout: `${JSON.stringify({
252618
+ integrationType,
252619
+ alreadyAuthorized: response.alreadyAuthorized,
252620
+ redirectUrl: response.redirectUrl,
252621
+ connectionId: response.connectionId
252622
+ }, null, 2)}
252623
+ `
252624
+ };
252625
+ }
252626
+ if (response.alreadyAuthorized || !response.redirectUrl) {
252627
+ return {
252628
+ outroMessage: `${integrationType} is already authorized. Run 'base44 connectors pull' to fetch its config.`
252629
+ };
252630
+ }
252631
+ log.info(`Authorize ${integrationType} here: ${theme.colors.links(response.redirectUrl)}`);
252632
+ const pending = {
252633
+ type: integrationType,
252634
+ action: "needs_oauth",
252635
+ redirectUrl: response.redirectUrl,
252636
+ connectionId: response.connectionId ?? undefined
252637
+ };
252638
+ const outcomes = await promptOAuthFlows([pending], log, {
252639
+ skipPrompt: isNonInteractive
252640
+ });
252641
+ if (outcomes.get(integrationType) === "ACTIVE") {
252642
+ return {
252643
+ outroMessage: `${integrationType} authorized. Run 'base44 connectors pull' to fetch its config.`
252644
+ };
252645
+ }
252646
+ return {
252647
+ outroMessage: `${integrationType} initialized. Open the link above to finish authorizing, then run 'base44 connectors pull'.`
252648
+ };
252649
+ }
252650
+ function getConnectorsInitiateCommand() {
252651
+ return new Base44Command("initiate").description("Initialize a connector on an app and start its OAuth flow (works with --app-id, no local project required)").requiredOption("--integration-type <type>", "Integration type to initiate (e.g. googlecalendar, gmail, slack)").option("--scopes <scopes...>", "OAuth scopes to request (space- or comma-separated)").addHelpText("after", `
252652
+ Examples:
252653
+ $ base44 connectors initiate --app-id app_123 --integration-type googlecalendar --scopes https://www.googleapis.com/auth/calendar
252654
+ $ base44 connectors initiate --integration-type gmail --scopes scope.a,scope.b`).action(initiateAction);
252655
+ }
252656
+
252657
+ // src/cli/commands/connectors/list-available.ts
252658
+ async function listAvailableAction({
252659
+ log,
252660
+ runTask: runTask2,
252661
+ jsonMode
252662
+ }) {
252663
+ const { integrations } = await runTask2("Fetching available integrations from Base44", async () => {
252664
+ return await listAvailableIntegrations();
252665
+ }, {
252666
+ successMessage: "Available integrations fetched successfully",
252667
+ errorMessage: "Failed to fetch available integrations"
252668
+ });
252669
+ if (jsonMode) {
252670
+ return {
252671
+ outroMessage: `Found ${integrations.length} available integrations.`,
252672
+ stdout: `${JSON.stringify({ integrations }, null, 2)}
252673
+ `
252674
+ };
252675
+ }
252676
+ if (integrations.length === 0) {
252677
+ return { outroMessage: "No available integrations found." };
252678
+ }
252679
+ for (const { displayName, ...rest } of integrations) {
252680
+ const yaml2 = formatYaml(rest);
252681
+ const pad = " ".repeat(YAML_INDENT);
252682
+ log.info(`${displayName}
252683
+ ${pad}${yaml2.replace(/\n/g, `
252684
+ ${pad}`)}`);
252685
+ }
252686
+ return {
252687
+ outroMessage: `Found ${integrations.length} available integrations.`
252688
+ };
252689
+ }
252690
+ function getConnectorsListAvailableCommand() {
252691
+ return new Base44Command("list-available").description("List all available integration types").action(listAvailableAction);
252692
+ }
252693
+
252694
+ // src/cli/commands/connectors/pull.ts
252695
+ import { dirname as dirname15, join as join19, resolve as resolve5 } from "node:path";
252696
+ async function resolveConnectorsDir(options) {
252697
+ if (!getAppContext().projectRoot) {
252698
+ return resolve5(options.dir ?? "connectors");
252699
+ }
252700
+ const { project: project2 } = await readProjectConfig();
252701
+ return join19(dirname15(project2.configPath), project2.connectorsDir);
252702
+ }
252703
+ async function pullConnectorsAction({ log, runTask: runTask2, jsonMode }, options) {
252704
+ const connectorsDir = await resolveConnectorsDir(options);
252705
+ const remoteConnectors = await runTask2("Fetching connectors from Base44", async () => {
252706
+ return await pullAllConnectors();
252707
+ }, {
252708
+ successMessage: "Connectors fetched successfully",
252709
+ errorMessage: "Failed to fetch connectors"
252710
+ });
252711
+ const { written, deleted } = await runTask2("Syncing connector files", async () => {
252712
+ return await writeConnectors(connectorsDir, remoteConnectors);
252713
+ }, {
252714
+ successMessage: "Connector files synced successfully",
252715
+ errorMessage: "Failed to sync connector files"
252716
+ });
252717
+ if (jsonMode) {
252718
+ return {
252719
+ outroMessage: `Pulled ${remoteConnectors.length} connectors to ${connectorsDir}`,
252720
+ stdout: `${JSON.stringify({ connectorsDir, pulled: remoteConnectors.length, written, deleted }, null, 2)}
252721
+ `
252722
+ };
252723
+ }
252724
+ if (written.length > 0) {
252725
+ log.success(`Written: ${written.join(", ")}`);
252726
+ }
252727
+ if (deleted.length > 0) {
252728
+ log.warn(`Deleted: ${deleted.join(", ")}`);
252729
+ }
252730
+ if (written.length === 0 && deleted.length === 0) {
252731
+ log.info("All connectors are already up to date");
252732
+ }
252733
+ return {
252734
+ outroMessage: `Pulled ${remoteConnectors.length} connectors to ${connectorsDir}`
252735
+ };
252736
+ }
252737
+ function getConnectorsPullCommand() {
252738
+ return new Base44Command("pull").description("Pull connectors from Base44 to local files (replaces all local connector configs)").option("--dir <path>", "Directory to write connector files to (default: ./connectors when using --app-id)").action(pullConnectorsAction);
252739
+ }
252740
+
252597
252741
  // src/cli/commands/connectors/push.ts
252742
+ import { resolve as resolve6 } from "node:path";
252743
+ async function readConnectorsToPush(options) {
252744
+ if (!getAppContext().projectRoot) {
252745
+ return readAllConnectors(resolve6(options.dir ?? "connectors"));
252746
+ }
252747
+ const { connectors } = await readProjectConfig();
252748
+ return connectors;
252749
+ }
252598
252750
  function printSummary(results, oauthOutcomes, log) {
252599
252751
  const synced = [];
252600
252752
  const added = [];
@@ -252657,17 +252809,15 @@ function printSummary(results, oauthOutcomes, log) {
252657
252809
  log.error(`Failed: ${r.type} - ${r.error}`);
252658
252810
  }
252659
252811
  }
252660
- async function pushConnectorsAction({
252661
- isNonInteractive,
252662
- log,
252663
- runTask: runTask2
252664
- }) {
252665
- const { connectors } = await readProjectConfig();
252666
- if (connectors.length === 0) {
252667
- log.info("No local connectors found - checking for remote connectors to remove");
252668
- } else {
252669
- const connectorNames = connectors.map((c3) => c3.type).join(", ");
252670
- log.info(`Found ${connectors.length} connectors to push: ${connectorNames}`);
252812
+ async function pushConnectorsAction({ isNonInteractive, log, runTask: runTask2, jsonMode }, options) {
252813
+ const connectors = await readConnectorsToPush(options);
252814
+ if (!jsonMode) {
252815
+ if (connectors.length === 0) {
252816
+ log.info("No local connectors found - checking for remote connectors to remove");
252817
+ } else {
252818
+ const connectorNames = connectors.map((c3) => c3.type).join(", ");
252819
+ log.info(`Found ${connectors.length} connectors to push: ${connectorNames}`);
252820
+ }
252671
252821
  }
252672
252822
  const { results } = await runTask2("Pushing connectors to Base44", async () => {
252673
252823
  return await pushConnectors(connectors);
@@ -252681,16 +252831,23 @@ async function pushConnectorsAction({
252681
252831
  if (needsOAuth.length > 0 && !allAuthorized) {
252682
252832
  outroMessage = isNonInteractive ? "Skipped OAuth in non-interactive mode. Run 'base44 connectors push' locally or open the links above to authorize." : "Some connectors still require authorization. Run 'base44 connectors push' or open the links above to authorize.";
252683
252833
  }
252834
+ if (jsonMode) {
252835
+ return {
252836
+ outroMessage,
252837
+ stdout: `${JSON.stringify({ results, oauth: Object.fromEntries(oauthOutcomes) }, null, 2)}
252838
+ `
252839
+ };
252840
+ }
252684
252841
  printSummary(results, oauthOutcomes, log);
252685
252842
  return { outroMessage };
252686
252843
  }
252687
252844
  function getConnectorsPushCommand() {
252688
- return new Base44Command("push").description("Push local connectors to Base44 (overwrites connectors on Base44)").action(pushConnectorsAction);
252845
+ return new Base44Command("push").description("Push local connectors to Base44 (overwrites connectors on Base44)").option("--dir <path>", "Directory to read connector files from (default: ./connectors when using --app-id)").action(pushConnectorsAction);
252689
252846
  }
252690
252847
 
252691
252848
  // src/cli/commands/connectors/index.ts
252692
252849
  function getConnectorsCommand() {
252693
- return new Command("connectors").description("Manage project connectors (OAuth integrations)").addCommand(getConnectorsListAvailableCommand()).addCommand(getConnectorsPullCommand()).addCommand(getConnectorsPushCommand());
252850
+ return new Command("connectors").description("Manage project connectors (OAuth integrations)").addCommand(getConnectorsListAvailableCommand()).addCommand(getConnectorsInitiateCommand()).addCommand(getConnectorsPullCommand()).addCommand(getConnectorsPushCommand());
252694
252851
  }
252695
252852
 
252696
252853
  // src/cli/commands/dashboard/open.ts
@@ -252997,7 +253154,7 @@ function getFunctionsCommand() {
252997
253154
  }
252998
253155
 
252999
253156
  // src/cli/commands/project/create.ts
253000
- import { basename as basename4, resolve as resolve5 } from "node:path";
253157
+ import { basename as basename4, resolve as resolve7 } from "node:path";
253001
253158
  var import_kebabCase = __toESM(require_kebabCase(), 1);
253002
253159
 
253003
253160
  // src/cli/commands/project/scaffold-shared.ts
@@ -253151,7 +253308,7 @@ async function createInteractive(options, ctx) {
253151
253308
  }, ctx);
253152
253309
  }
253153
253310
  async function createNonInteractive(options, ctx) {
253154
- ctx.log.info(`Creating a new project at ${resolve5(options.path)}`);
253311
+ ctx.log.info(`Creating a new project at ${resolve7(options.path)}`);
253155
253312
  const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
253156
253313
  return await executeCreate({
253157
253314
  template: template2,
@@ -253173,7 +253330,7 @@ async function executeCreate({
253173
253330
  }, ctx) {
253174
253331
  const { log, runTask: runTask2 } = ctx;
253175
253332
  const name2 = rawName.trim();
253176
- const resolvedPath = resolve5(projectPath);
253333
+ const resolvedPath = resolve7(projectPath);
253177
253334
  const { projectId } = await runTask2("Setting up your project...", async () => {
253178
253335
  return await createProjectFiles({
253179
253336
  name: name2,
@@ -253552,30 +253709,30 @@ function normalizeLogEntry(entry, functionName) {
253552
253709
  source: functionName
253553
253710
  };
253554
253711
  }
253555
- async function fetchLogsForFunction(functionName, filters, availableFunctionNames) {
253556
- try {
253557
- return await fetchFunctionLogs(functionName, filters);
253558
- } catch (error48) {
253559
- if (error48 instanceof ApiError && error48.statusCode === 404 && availableFunctionNames.length > 0) {
253560
- const available = availableFunctionNames.join(", ");
253561
- throw new InvalidInputError(`Function "${functionName}" was not found in this app`, {
253562
- hints: [
253563
- { message: `Available functions in this project: ${available}` },
253564
- {
253565
- message: "Make sure the function has been deployed before fetching logs",
253566
- command: "base44 functions deploy"
253567
- }
253568
- ]
253569
- });
253570
- }
253571
- throw error48;
253572
- }
253573
- }
253574
253712
  async function fetchLogsForFunctions(functionNames, options, availableFunctionNames) {
253575
253713
  const filters = parseFunctionFilters(options);
253576
253714
  const allEntries = [];
253577
253715
  for (const functionName of functionNames) {
253578
- const logs = await fetchLogsForFunction(functionName, filters, availableFunctionNames);
253716
+ let logs;
253717
+ try {
253718
+ logs = await fetchFunctionLogs(functionName, filters);
253719
+ } catch (error48) {
253720
+ if (error48 instanceof ApiError && error48.statusCode === 404 && availableFunctionNames.length > 0) {
253721
+ const available = availableFunctionNames.join(", ");
253722
+ throw new InvalidInputError(`Function "${functionName}" was not found in this app`, {
253723
+ hints: [
253724
+ {
253725
+ message: `Available functions in this project: ${available}`
253726
+ },
253727
+ {
253728
+ message: "Make sure the function has been deployed before fetching logs",
253729
+ command: "base44 functions deploy"
253730
+ }
253731
+ ]
253732
+ });
253733
+ }
253734
+ throw error48;
253735
+ }
253579
253736
  allEntries.push(...logs.map((entry) => normalizeLogEntry(entry, functionName)));
253580
253737
  }
253581
253738
  if (functionNames.length > 1) {
@@ -253617,20 +253774,20 @@ async function logsAction(ctx, options) {
253617
253774
  entries = entries.slice(0, limit);
253618
253775
  }
253619
253776
  const env3 = options.env ?? "preview";
253620
- const logsOutput = options.json ? `${JSON.stringify(entries, null, 2)}
253777
+ const logsOutput = ctx.jsonMode ? `${JSON.stringify(entries, null, 2)}
253621
253778
  ` : formatLogs(entries, env3);
253622
- const shouldOutputOutroMessage = !options.json;
253779
+ const shouldOutputOutroMessage = !ctx.jsonMode;
253623
253780
  return {
253624
253781
  outroMessage: shouldOutputOutroMessage ? "Fetched logs" : undefined,
253625
253782
  stdout: logsOutput
253626
253783
  };
253627
253784
  }
253628
253785
  function getLogsCommand() {
253629
- return new Base44Command("logs").description("Fetch function logs for this app").option("--function <names>", "Filter by function name(s), comma-separated. If omitted, fetches logs for all project functions").option("--since <datetime>", "Show logs from this time. ISO datetime or relative shorthand (e.g. 1h, 30m, 2d)", normalizeDatetime).option("--until <datetime>", "Show logs until this time. ISO datetime or relative shorthand (e.g. 1h, 30m, 2d)", normalizeDatetime).addOption(new Option("--level <level>", "Filter by log level").choices([...LogLevelSchema.options]).hideHelp()).option("-n, --limit <n>", "Results per page (1-1000, default: 50)").addOption(new Option("--order <order>", "Sort order").choices(["asc", "desc"])).addOption(new Option("--env <env>", "Environment to fetch logs from (default: preview)").choices(["preview", "prod"])).option("--json", "Output as JSON (clean stdout, safe to pipe to jq)").action(logsAction);
253786
+ return new Base44Command("logs").description("Fetch function logs for this app").option("--function <names>", "Filter by function name(s), comma-separated. If omitted, fetches logs for all project functions").option("--since <datetime>", "Show logs from this time. ISO datetime or relative shorthand (e.g. 1h, 30m, 2d)", normalizeDatetime).option("--until <datetime>", "Show logs until this time. ISO datetime or relative shorthand (e.g. 1h, 30m, 2d)", normalizeDatetime).addOption(new Option("--level <level>", "Filter by log level").choices([...LogLevelSchema.options]).hideHelp()).option("-n, --limit <n>", "Results per page (1-1000, default: 50)").addOption(new Option("--order <order>", "Sort order").choices(["asc", "desc"])).addOption(new Option("--env <env>", "Which deployment to read logs from: preview (current draft) or prod (published). Default: preview").choices([...LogEnvSchema.options])).action(logsAction);
253630
253787
  }
253631
253788
 
253632
253789
  // src/cli/commands/project/scaffold.ts
253633
- import { basename as basename5, resolve as resolve6 } from "node:path";
253790
+ import { basename as basename5, resolve as resolve8 } from "node:path";
253634
253791
  function resolveAppId(options) {
253635
253792
  const appId = options.appId;
253636
253793
  if (!appId) {
@@ -253646,7 +253803,7 @@ function resolveAppId(options) {
253646
253803
  async function scaffoldAction(ctx, name2, options, command2) {
253647
253804
  const { log, runTask: runTask2 } = ctx;
253648
253805
  const appId = resolveAppId(command2.optsWithGlobals());
253649
- const resolvedPath = resolve6("./");
253806
+ const resolvedPath = resolve8("./");
253650
253807
  const projectName = (name2 ?? basename5(resolvedPath)).trim();
253651
253808
  const template2 = await getTemplateById("backend-only");
253652
253809
  log.info(`Scaffolding project at ${resolvedPath}`);
@@ -253683,6 +253840,316 @@ Examples:
253683
253840
  $ base44 scaffold my-app --app-id app_123 Scaffolds the current dir, named "my-app"`).action(scaffoldAction);
253684
253841
  }
253685
253842
 
253843
+ // src/core/resources/sandbox/schema.ts
253844
+ var FileErrorSchema = exports_external.object({
253845
+ code: exports_external.string(),
253846
+ message: exports_external.string()
253847
+ });
253848
+ var ReadFileEntrySchema = exports_external.object({
253849
+ path: exports_external.string(),
253850
+ content: exports_external.string().optional(),
253851
+ start_line: exports_external.number().optional(),
253852
+ end_line: exports_external.number().optional(),
253853
+ total_lines: exports_external.number().optional(),
253854
+ truncated: exports_external.boolean().optional(),
253855
+ error: FileErrorSchema.optional()
253856
+ }).transform((data) => ({
253857
+ path: data.path,
253858
+ content: data.content,
253859
+ startLine: data.start_line,
253860
+ endLine: data.end_line,
253861
+ totalLines: data.total_lines,
253862
+ truncated: data.truncated,
253863
+ error: data.error
253864
+ }));
253865
+ var ReadFileResponseSchema = exports_external.object({
253866
+ files: exports_external.array(ReadFileEntrySchema)
253867
+ });
253868
+ var WriteFileResponseSchema = exports_external.object({
253869
+ path: exports_external.string(),
253870
+ bytes_written: exports_external.number(),
253871
+ created: exports_external.boolean(),
253872
+ overwritten: exports_external.boolean()
253873
+ }).transform((data) => ({
253874
+ path: data.path,
253875
+ bytesWritten: data.bytes_written,
253876
+ created: data.created,
253877
+ overwritten: data.overwritten
253878
+ }));
253879
+ var EditFileResponseSchema = exports_external.object({
253880
+ path: exports_external.string(),
253881
+ diff: exports_external.string(),
253882
+ applied: exports_external.boolean()
253883
+ });
253884
+ var GrepMatchSchema = exports_external.object({
253885
+ path: exports_external.string().nullable(),
253886
+ line: exports_external.number().nullable(),
253887
+ text: exports_external.string()
253888
+ });
253889
+ var GrepResponseSchema = exports_external.object({
253890
+ matches: exports_external.array(GrepMatchSchema),
253891
+ truncated: exports_external.boolean(),
253892
+ returned_matches: exports_external.number()
253893
+ }).transform((data) => ({
253894
+ matches: data.matches,
253895
+ truncated: data.truncated,
253896
+ returnedMatches: data.returned_matches
253897
+ }));
253898
+ var DirectoryEntrySchema = exports_external.object({
253899
+ name: exports_external.string(),
253900
+ path: exports_external.string(),
253901
+ type: exports_external.enum(["file", "directory"]),
253902
+ size: exports_external.number().optional()
253903
+ });
253904
+ var ListDirectoryResponseSchema = exports_external.object({
253905
+ entries: exports_external.array(DirectoryEntrySchema),
253906
+ truncated: exports_external.boolean()
253907
+ });
253908
+ var RunCommandResponseSchema = exports_external.object({
253909
+ stdout: exports_external.string(),
253910
+ stderr: exports_external.string(),
253911
+ exit_code: exports_external.number(),
253912
+ truncated: exports_external.boolean(),
253913
+ duration_ms: exports_external.number()
253914
+ }).transform((data) => ({
253915
+ stdout: data.stdout,
253916
+ stderr: data.stderr,
253917
+ exitCode: data.exit_code,
253918
+ truncated: data.truncated,
253919
+ durationMs: data.duration_ms
253920
+ }));
253921
+ var CreateCheckpointResponseSchema = exports_external.object({
253922
+ checkpoint_id: exports_external.string(),
253923
+ name: exports_external.string().nullable(),
253924
+ git_commit_hash: exports_external.string().nullable()
253925
+ }).transform((data) => ({
253926
+ checkpointId: data.checkpoint_id,
253927
+ name: data.name,
253928
+ gitCommitHash: data.git_commit_hash
253929
+ }));
253930
+
253931
+ // src/core/resources/sandbox/api.ts
253932
+ function isMissingSandboxScope(error48) {
253933
+ if (error48.statusCode !== 401 && error48.statusCode !== 403) {
253934
+ return false;
253935
+ }
253936
+ const text = `${error48.message} ${JSON.stringify(error48.responseBody ?? "")}`;
253937
+ return /sandbox:write/i.test(text) || /granting sandbox access/i.test(text);
253938
+ }
253939
+ function withSandboxAuthHint(error48) {
253940
+ if (!isMissingSandboxScope(error48)) {
253941
+ return error48;
253942
+ }
253943
+ return new ApiError(error48.message, {
253944
+ statusCode: error48.statusCode,
253945
+ requestUrl: error48.requestUrl,
253946
+ requestMethod: error48.requestMethod,
253947
+ requestBody: error48.requestBody,
253948
+ responseBody: error48.responseBody,
253949
+ requestId: error48.requestId,
253950
+ details: error48.details,
253951
+ hints: [
253952
+ ...error48.hints,
253953
+ {
253954
+ message: "Run 'base44 login' again to grant sandbox access (the sandbox:write scope is only granted at login).",
253955
+ command: "base44 login"
253956
+ }
253957
+ ],
253958
+ cause: error48
253959
+ });
253960
+ }
253961
+ async function callTool(appId, tool, payload, schema10, context, timeout2 = 60000) {
253962
+ const client = getSandboxClient(appId);
253963
+ let response;
253964
+ try {
253965
+ response = await client.post(tool, { json: payload, timeout: timeout2 });
253966
+ } catch (error48) {
253967
+ throw withSandboxAuthHint(await ApiError.fromHttpError(error48, context));
253968
+ }
253969
+ const result = schema10.safeParse(await response.json());
253970
+ if (!result.success) {
253971
+ throw new SchemaValidationError("Invalid response from server", result.error);
253972
+ }
253973
+ return result.data;
253974
+ }
253975
+ function listDirectory(appId, params) {
253976
+ return callTool(appId, "list_directory", { ...params }, ListDirectoryResponseSchema, "listing directory");
253977
+ }
253978
+ function readFile2(appId, params) {
253979
+ return callTool(appId, "read_file", { ...params }, ReadFileResponseSchema, "reading file");
253980
+ }
253981
+ function writeFile2(appId, params) {
253982
+ return callTool(appId, "write_file", { ...params }, WriteFileResponseSchema, `writing file "${params.path}"`);
253983
+ }
253984
+ function editFile(appId, params) {
253985
+ return callTool(appId, "edit_file", { ...params }, EditFileResponseSchema, `editing file "${params.path}"`);
253986
+ }
253987
+ function grep(appId, params) {
253988
+ return callTool(appId, "grep", { ...params }, GrepResponseSchema, "searching files");
253989
+ }
253990
+ function runCommand(appId, params) {
253991
+ return callTool(appId, "run_command", { ...params }, RunCommandResponseSchema, "running command", false);
253992
+ }
253993
+ function createCheckpoint(appId, params) {
253994
+ return callTool(appId, "create_checkpoint", { ...params }, CreateCheckpointResponseSchema, "creating checkpoint");
253995
+ }
253996
+
253997
+ // src/cli/commands/sandbox/shared.ts
253998
+ async function resolveFlagOrStdin(flagValue, flagName) {
253999
+ if (flagValue !== undefined) {
254000
+ return flagValue;
254001
+ }
254002
+ if (process.stdin.isTTY) {
254003
+ throw new InvalidInputError(`Provide ${flagName} or pipe the value via stdin (e.g. echo <value> | base44 sandbox ...).`);
254004
+ }
254005
+ return readStdin(flagName, { trim: false });
254006
+ }
254007
+ function toJsonStdout(result) {
254008
+ return `${JSON.stringify(result, null, 2)}
254009
+ `;
254010
+ }
254011
+ function parsePositiveInt(value, flagName) {
254012
+ if (value === undefined) {
254013
+ return;
254014
+ }
254015
+ const n2 = Number.parseInt(value, 10);
254016
+ if (!Number.isInteger(n2) || n2 < 1) {
254017
+ throw new InvalidInputError(`${flagName} must be a positive integer.`);
254018
+ }
254019
+ return n2;
254020
+ }
254021
+
254022
+ // src/cli/commands/sandbox/checkpoint.ts
254023
+ async function checkpointAction({ runTask: runTask2 }, options) {
254024
+ const { id: appId } = getAppContext();
254025
+ const result = await runTask2("Creating checkpoint", () => createCheckpoint(appId, { name: options.name }));
254026
+ return { outroMessage: "Created checkpoint", stdout: toJsonStdout(result) };
254027
+ }
254028
+ function getSandboxCheckpointCommand() {
254029
+ return new Base44Command("checkpoint").description("Create a restore-point checkpoint of an app's remote sandbox").option("--name <name>", "Optional message/title for the checkpoint (defaults to an auto-generated title)").addHelpText("after", `
254030
+ Examples:
254031
+ $ base44 sandbox checkpoint
254032
+ $ base44 sandbox checkpoint --name "before refactor"`).action(checkpointAction);
254033
+ }
254034
+
254035
+ // src/cli/commands/sandbox/edit-file.ts
254036
+ var EditsInputSchema = exports_external.array(exports_external.object({
254037
+ old_text: exports_external.string().min(1),
254038
+ new_text: exports_external.string(),
254039
+ replace_all: exports_external.boolean().optional()
254040
+ })).min(1);
254041
+ function parseEdits(raw2) {
254042
+ let parsed;
254043
+ try {
254044
+ parsed = JSON.parse(raw2);
254045
+ } catch {
254046
+ throw new InvalidInputError("--edits-json must be valid JSON (an array of { old_text, new_text, replace_all? }).");
254047
+ }
254048
+ const result = EditsInputSchema.safeParse(parsed);
254049
+ if (!result.success) {
254050
+ throw new InvalidInputError("Invalid edits: expected a non-empty array of { old_text (non-empty string), new_text (string), replace_all? (boolean) }.");
254051
+ }
254052
+ return result.data;
254053
+ }
254054
+ async function editFileAction({ runTask: runTask2 }, path17, options) {
254055
+ const { id: appId } = getAppContext();
254056
+ const raw2 = await resolveFlagOrStdin(options.editsJson, "--edits-json");
254057
+ const edits = parseEdits(raw2);
254058
+ const result = await runTask2(options.dryRun ? "Previewing edit" : "Editing file", () => editFile(appId, { path: path17, edits, dry_run: options.dryRun }));
254059
+ return {
254060
+ outroMessage: options.dryRun ? "Previewed edit" : "Edited file",
254061
+ stdout: toJsonStdout(result)
254062
+ };
254063
+ }
254064
+ function getSandboxEditFileCommand() {
254065
+ return new Base44Command("edit").description("Apply exact old→new string edits to a file in the sandbox").argument("<path>", "File path relative to the app root").option("--edits-json <json>", "JSON array of edits (if omitted, read from stdin)").option("--dry-run", "Return the unified diff without writing").addHelpText("after", `
254066
+ Each edit is { "old_text": "...", "new_text": "...", "replace_all"?: true }.
254067
+
254068
+ Examples:
254069
+ $ echo '[{"old_text":"foo","new_text":"bar"}]' | base44 sandbox edit src/x.ts
254070
+ $ base44 sandbox edit src/x.ts --dry-run --edits-json '[{"old_text":"a","new_text":"b","replace_all":true}]'`).action(editFileAction);
254071
+ }
254072
+
254073
+ // src/cli/commands/sandbox/grep.ts
254074
+ async function grepAction({ runTask: runTask2 }, pattern, options) {
254075
+ const { id: appId } = getAppContext();
254076
+ const maxResults = parsePositiveInt(options.maxResults, "--max-results");
254077
+ const result = await runTask2("Searching files", () => grep(appId, {
254078
+ pattern,
254079
+ path: options.path,
254080
+ is_regex: options.regex,
254081
+ case_sensitive: options.caseSensitive,
254082
+ glob: options.glob,
254083
+ max_results: maxResults
254084
+ }));
254085
+ return { outroMessage: "Searched files", stdout: toJsonStdout(result) };
254086
+ }
254087
+ function getSandboxGrepCommand() {
254088
+ return new Base44Command("grep").description("Search files for a pattern in an app's remote sandbox").argument("<pattern>", "Search pattern").option("--path <path>", "Subtree to search, relative to the app root").option("--no-regex", "Treat the pattern as a literal string, not a regex").option("--case-sensitive", "Case-sensitive match").option("--glob <glob>", 'File glob filter, e.g. "*.tsx"').option("--max-results <n>", "Maximum number of match lines to return").action(grepAction);
254089
+ }
254090
+
254091
+ // src/cli/commands/sandbox/list-directory.ts
254092
+ async function listDirectoryAction({ runTask: runTask2 }, path17, options) {
254093
+ const { id: appId } = getAppContext();
254094
+ const maxDepth = parsePositiveInt(options.maxDepth, "--max-depth");
254095
+ const result = await runTask2("Listing directory", () => listDirectory(appId, {
254096
+ path: path17,
254097
+ recursive: options.recursive,
254098
+ max_depth: maxDepth,
254099
+ include_hidden: options.includeHidden
254100
+ }));
254101
+ return { outroMessage: "Listed directory", stdout: toJsonStdout(result) };
254102
+ }
254103
+ function getSandboxListDirectoryCommand() {
254104
+ return new Base44Command("ls").description("List directory entries in an app's remote sandbox").argument("[path]", "Directory relative to the app root (default: app root)").option("--recursive", "List nested entries").option("--max-depth <n>", "Max depth when recursive (1-10, default 3)").option("--include-hidden", "Include dotfiles").action(listDirectoryAction);
254105
+ }
254106
+
254107
+ // src/cli/commands/sandbox/read-file.ts
254108
+ async function readFileAction({ runTask: runTask2 }, paths, options) {
254109
+ const { id: appId } = getAppContext();
254110
+ const offset = parsePositiveInt(options.offset, "--offset");
254111
+ const limit = parsePositiveInt(options.limit, "--limit");
254112
+ const result = await runTask2("Reading file", () => readFile2(appId, { paths, offset, limit }));
254113
+ return { outroMessage: "Read file", stdout: toJsonStdout(result) };
254114
+ }
254115
+ function getSandboxReadFileCommand() {
254116
+ return new Base44Command("read").description("Read file contents from an app's remote sandbox").argument("<paths...>", "One or more file paths relative to the app root").option("--offset <n>", "1-based start line").option("--limit <n>", "Max lines to return from offset").action(readFileAction);
254117
+ }
254118
+
254119
+ // src/cli/commands/sandbox/run-command.ts
254120
+ async function runCommandAction({ runTask: runTask2 }, commandParts, options) {
254121
+ const { id: appId } = getAppContext();
254122
+ const timeoutMs = parsePositiveInt(options.timeoutMs, "--timeout-ms");
254123
+ const command2 = commandParts.join(" ");
254124
+ const result = await runTask2("Running command", () => runCommand(appId, { command: command2, cwd: options.cwd, timeout_ms: timeoutMs }));
254125
+ return { outroMessage: "Ran command", stdout: toJsonStdout(result) };
254126
+ }
254127
+ function getSandboxRunCommandCommand() {
254128
+ return new Base44Command("run").description("Run a shell command in an app's remote sandbox").argument("<command...>", "Shell command to execute (quote to keep as one)").option("--cwd <path>", "Working directory relative to the app root").option("--timeout-ms <n>", "Timeout in milliseconds (default 120000, max 600000)").addHelpText("after", `
254129
+ Examples:
254130
+ $ base44 sandbox run "npm test"
254131
+ $ base44 sandbox run ls -la --cwd src`).action(runCommandAction);
254132
+ }
254133
+
254134
+ // src/cli/commands/sandbox/write-file.ts
254135
+ async function writeFileAction({ runTask: runTask2 }, path17, options) {
254136
+ const { id: appId } = getAppContext();
254137
+ const content = await resolveFlagOrStdin(options.content, "--content");
254138
+ const result = await runTask2("Writing file", () => writeFile2(appId, { path: path17, content, overwrite: options.overwrite }));
254139
+ return { outroMessage: "Wrote file", stdout: toJsonStdout(result) };
254140
+ }
254141
+ function getSandboxWriteFileCommand() {
254142
+ return new Base44Command("write").description("Create or overwrite a file in an app's remote sandbox").argument("<path>", "File path relative to the app root").option("--content <content>", "File content (if omitted, read from stdin)").option("--overwrite", "Overwrite the file if it already exists").addHelpText("after", `
254143
+ Examples:
254144
+ $ echo "hello" | base44 sandbox write notes.txt
254145
+ $ base44 sandbox write notes.txt --content "hello" --overwrite`).action(writeFileAction);
254146
+ }
254147
+
254148
+ // src/cli/commands/sandbox/index.ts
254149
+ function getSandboxCommand() {
254150
+ return new Command("sandbox").description("Develop an app remotely via its server-side sandbox").addCommand(getSandboxListDirectoryCommand()).addCommand(getSandboxReadFileCommand()).addCommand(getSandboxWriteFileCommand()).addCommand(getSandboxEditFileCommand()).addCommand(getSandboxGrepCommand()).addCommand(getSandboxRunCommandCommand()).addCommand(getSandboxCheckpointCommand());
254151
+ }
254152
+
253686
254153
  // src/cli/commands/secrets/delete.ts
253687
254154
  async function deleteSecretAction({ runTask: runTask2 }, key) {
253688
254155
  await runTask2(`Deleting secret "${key}"`, async () => {
@@ -253726,7 +254193,7 @@ function getSecretsListCommand() {
253726
254193
  }
253727
254194
 
253728
254195
  // src/cli/commands/secrets/set.ts
253729
- import { resolve as resolve7 } from "node:path";
254196
+ import { resolve as resolve9 } from "node:path";
253730
254197
  function parseEntries(entries) {
253731
254198
  const secrets = {};
253732
254199
  for (const entry of entries) {
@@ -253757,7 +254224,7 @@ async function setSecretsAction({ log, runTask: runTask2 }, entries, options) {
253757
254224
  validateInput(entries, options);
253758
254225
  let secrets;
253759
254226
  if (options.envFile) {
253760
- secrets = await parseEnvFile(resolve7(options.envFile));
254227
+ secrets = await parseEnvFile(resolve9(options.envFile));
253761
254228
  if (Object.keys(secrets).length === 0) {
253762
254229
  throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
253763
254230
  }
@@ -253786,7 +254253,7 @@ function getSecretsCommand() {
253786
254253
  }
253787
254254
 
253788
254255
  // src/cli/commands/site/deploy.ts
253789
- import { resolve as resolve8 } from "node:path";
254256
+ import { resolve as resolve10 } from "node:path";
253790
254257
  async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
253791
254258
  if (isNonInteractive && !options.yes) {
253792
254259
  throw new InvalidInputError("--yes is required in non-interactive mode");
@@ -253801,7 +254268,7 @@ async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
253801
254268
  ]
253802
254269
  });
253803
254270
  }
253804
- const outputDir = resolve8(project2.root, project2.site.outputDirectory);
254271
+ const outputDir = resolve10(project2.root, project2.site.outputDirectory);
253805
254272
  if (!options.yes) {
253806
254273
  const shouldDeploy = await Re({
253807
254274
  message: `Deploy site from ${project2.site.outputDirectory}?`
@@ -254007,14 +254474,14 @@ var getLocalHosts = () => {
254007
254474
  }
254008
254475
  return results;
254009
254476
  };
254010
- var checkAvailablePort = (options8) => new Promise((resolve10, reject) => {
254477
+ var checkAvailablePort = (options8) => new Promise((resolve12, reject) => {
254011
254478
  const server = net.createServer();
254012
254479
  server.unref();
254013
254480
  server.on("error", reject);
254014
254481
  server.listen(options8, () => {
254015
254482
  const { port } = server.address();
254016
254483
  server.close(() => {
254017
- resolve10(port);
254484
+ resolve12(port);
254018
254485
  });
254019
254486
  });
254020
254487
  });
@@ -254273,7 +254740,7 @@ class FunctionManager {
254273
254740
  });
254274
254741
  }
254275
254742
  waitForReady(name2, runningFunc) {
254276
- return new Promise((resolve10, reject) => {
254743
+ return new Promise((resolve12, reject) => {
254277
254744
  runningFunc.process.on("exit", (code2) => {
254278
254745
  if (!runningFunc.ready) {
254279
254746
  clearTimeout(timeout3);
@@ -254296,7 +254763,7 @@ class FunctionManager {
254296
254763
  runningFunc.ready = true;
254297
254764
  clearTimeout(timeout3);
254298
254765
  runningFunc.process.stdout?.off("data", onData);
254299
- resolve10(runningFunc.port);
254766
+ resolve12(runningFunc.port);
254300
254767
  }
254301
254768
  };
254302
254769
  runningFunc.process.stdout?.on("data", onData);
@@ -255554,15 +256021,15 @@ class ServeRunner {
255554
256021
  return;
255555
256022
  }
255556
256023
  this.stopping = true;
255557
- const exited = new Promise((resolve10) => child.once("exit", () => resolve10()));
256024
+ const exited = new Promise((resolve12) => child.once("exit", () => resolve12()));
255558
256025
  if (process21.platform === "win32" && child.pid) {
255559
256026
  const taskkill = spawn3("taskkill", ["/pid", String(child.pid), "/T", "/F"], {
255560
256027
  stdio: "ignore",
255561
256028
  windowsHide: true
255562
256029
  });
255563
- await new Promise((resolve10) => {
255564
- taskkill.once("exit", () => resolve10());
255565
- taskkill.once("error", () => resolve10());
256030
+ await new Promise((resolve12) => {
256031
+ taskkill.once("exit", () => resolve12());
256032
+ taskkill.once("error", () => resolve12());
255566
256033
  });
255567
256034
  } else if (child.pid) {
255568
256035
  try {
@@ -256456,7 +256923,7 @@ class NodeFsHandler {
256456
256923
  this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
256457
256924
  }
256458
256925
  }).on(EV.ERROR, this._boundHandleError);
256459
- return new Promise((resolve11, reject) => {
256926
+ return new Promise((resolve13, reject) => {
256460
256927
  if (!stream)
256461
256928
  return reject();
256462
256929
  stream.once(STR_END, () => {
@@ -256465,7 +256932,7 @@ class NodeFsHandler {
256465
256932
  return;
256466
256933
  }
256467
256934
  const wasThrottled = throttler ? throttler.clear() : false;
256468
- resolve11(undefined);
256935
+ resolve13(undefined);
256469
256936
  previous.getChildren().filter((item) => {
256470
256937
  return item !== directory && !current.has(item);
256471
256938
  }).forEach((item) => {
@@ -257382,7 +257849,7 @@ async function createDevServer(options8) {
257382
257849
  }
257383
257850
  remoteProxy(req, res, next);
257384
257851
  });
257385
- const server = await new Promise((resolve12, reject) => {
257852
+ const server = await new Promise((resolve14, reject) => {
257386
257853
  const s5 = app.listen(port, "127.0.0.1", (err) => {
257387
257854
  if (err) {
257388
257855
  if ("code" in err && err.code === "EADDRINUSE") {
@@ -257391,7 +257858,7 @@ async function createDevServer(options8) {
257391
257858
  reject(err);
257392
257859
  }
257393
257860
  } else {
257394
- resolve12(s5);
257861
+ resolve14(s5);
257395
257862
  }
257396
257863
  });
257397
257864
  });
@@ -257454,13 +257921,13 @@ async function createDevServer(options8) {
257454
257921
  if (!server.listening) {
257455
257922
  return;
257456
257923
  }
257457
- await new Promise((resolve12, reject) => {
257924
+ await new Promise((resolve14, reject) => {
257458
257925
  server.close((error48) => {
257459
257926
  if (error48) {
257460
257927
  reject(error48);
257461
257928
  return;
257462
257929
  }
257463
- resolve12();
257930
+ resolve14();
257464
257931
  });
257465
257932
  });
257466
257933
  };
@@ -257569,13 +258036,13 @@ async function runScript(options8) {
257569
258036
  }
257570
258037
  // src/cli/commands/exec.ts
257571
258038
  function readStdin2() {
257572
- return new Promise((resolve12, reject) => {
258039
+ return new Promise((resolve14, reject) => {
257573
258040
  let data = "";
257574
258041
  process.stdin.setEncoding("utf-8");
257575
258042
  process.stdin.on("data", (chunk) => {
257576
258043
  data += chunk;
257577
258044
  });
257578
- process.stdin.on("end", () => resolve12(data));
258045
+ process.stdin.on("end", () => resolve14(data));
257579
258046
  process.stdin.on("error", reject);
257580
258047
  });
257581
258048
  }
@@ -257617,7 +258084,7 @@ Examples:
257617
258084
  }
257618
258085
 
257619
258086
  // src/cli/commands/project/eject.ts
257620
- import { resolve as resolve12 } from "node:path";
258087
+ import { resolve as resolve14 } from "node:path";
257621
258088
  var import_kebabCase2 = __toESM(require_kebabCase(), 1);
257622
258089
  async function eject(ctx, options8, command2) {
257623
258090
  const { log, runTask: runTask2, isNonInteractive } = ctx;
@@ -257681,7 +258148,7 @@ async function eject(ctx, options8, command2) {
257681
258148
  Ne("Operation cancelled.");
257682
258149
  throw new CLIExitError(0);
257683
258150
  }
257684
- const resolvedPath = resolve12(selectedPath);
258151
+ const resolvedPath = resolve14(selectedPath);
257685
258152
  await runTask2("Downloading your project's code...", async (updateMessage) => {
257686
258153
  await createProjectFilesForExistingProject({
257687
258154
  projectId,
@@ -257728,7 +258195,7 @@ function getEjectCommand() {
257728
258195
  // src/cli/program.ts
257729
258196
  function createProgram(context) {
257730
258197
  const program2 = new Command;
257731
- program2.name("base44").description("Base44 CLI - Unified interface for managing Base44 applications").version(package_default.version).addOption(new Option("--app-id <id>", "Base44 app ID to use").env(BASE44_APP_ID_ENV_VAR));
258198
+ program2.name("base44").description("Base44 CLI - Unified interface for managing Base44 applications").version(package_default.version).addOption(new Option("--app-id <id>", "Base44 app ID to use").env(BASE44_APP_ID_ENV_VAR)).addOption(new Option("--json", "Output machine-readable JSON to stdout (status/logs go to stderr)"));
257732
258199
  program2.configureHelp({
257733
258200
  sortSubcommands: true
257734
258201
  });
@@ -257751,6 +258218,7 @@ function createProgram(context) {
257751
258218
  program2.addCommand(getConnectorsCommand());
257752
258219
  program2.addCommand(getFunctionsCommand());
257753
258220
  program2.addCommand(getSecretsCommand());
258221
+ program2.addCommand(getSandboxCommand());
257754
258222
  program2.addCommand(getAuthCommand());
257755
258223
  program2.addCommand(getSiteCommand());
257756
258224
  program2.addCommand(getTypesCommand());
@@ -260052,14 +260520,14 @@ async function addSourceContext(frames) {
260052
260520
  return frames;
260053
260521
  }
260054
260522
  function getContextLinesFromFile(path19, ranges, output) {
260055
- return new Promise((resolve13) => {
260523
+ return new Promise((resolve15) => {
260056
260524
  const stream = createReadStream2(path19);
260057
260525
  const lineReaded = createInterface2({
260058
260526
  input: stream
260059
260527
  });
260060
260528
  function destroyStreamAndResolve() {
260061
260529
  stream.destroy();
260062
- resolve13();
260530
+ resolve15();
260063
260531
  }
260064
260532
  let lineNumber = 0;
260065
260533
  let currentRangeIndex = 0;
@@ -260978,9 +261446,9 @@ function matchPropertyGroup(propertyGroup, propertyValues, cohortProperties, deb
260978
261446
  throw new InconclusiveMatchError("can't match cohort without a given cohort property value");
260979
261447
  return propertyGroupType === "AND";
260980
261448
  }
260981
- function isValidRegex(regex) {
261449
+ function isValidRegex(regex2) {
260982
261450
  try {
260983
- new RegExp(regex);
261451
+ new RegExp(regex2);
260984
261452
  return true;
260985
261453
  } catch (err) {
260986
261454
  return false;
@@ -260998,8 +261466,8 @@ function convertToDateTime(value) {
260998
261466
  throw new InconclusiveMatchError(`The date provided ${value} must be a string, number, or date object`);
260999
261467
  }
261000
261468
  function relativeDateParseForFeatureFlagMatching(value) {
261001
- const regex = /^-?(?<number>[0-9]+)(?<interval>[a-z])$/;
261002
- const match = value.match(regex);
261469
+ const regex2 = /^-?(?<number>[0-9]+)(?<interval>[a-z])$/;
261470
+ const match = value.match(regex2);
261003
261471
  const parsedDt = new Date(new Date().toISOString());
261004
261472
  if (!match)
261005
261473
  return null;
@@ -261171,15 +261639,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
261171
261639
  return true;
261172
261640
  if (this.featureFlagsPoller === undefined)
261173
261641
  return false;
261174
- return new Promise((resolve13) => {
261642
+ return new Promise((resolve15) => {
261175
261643
  const timeout3 = setTimeout(() => {
261176
261644
  cleanup();
261177
- resolve13(false);
261645
+ resolve15(false);
261178
261646
  }, timeoutMs);
261179
261647
  const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
261180
261648
  clearTimeout(timeout3);
261181
261649
  cleanup();
261182
- resolve13(count2 > 0);
261650
+ resolve15(count2 > 0);
261183
261651
  });
261184
261652
  });
261185
261653
  }
@@ -261968,12 +262436,14 @@ async function runCLI(options8) {
261968
262436
  ensureNpmAssets(join28(__dirname4, "../assets"));
261969
262437
  const errorReporter = new ErrorReporter;
261970
262438
  errorReporter.registerProcessErrorHandlers();
261971
- const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
262439
+ const jsonMode = process.argv.includes("--json");
262440
+ const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY || jsonMode;
261972
262441
  const log = isNonInteractive ? new SimpleLogger : new ClackLogger;
261973
262442
  const runTask2 = isNonInteractive ? createSimpleRunTask(log) : createInteractiveRunTask();
261974
262443
  const context = {
261975
262444
  errorReporter,
261976
262445
  isNonInteractive,
262446
+ jsonMode,
261977
262447
  distribution: options8?.distribution ?? "npm",
261978
262448
  log,
261979
262449
  runTask: runTask2
@@ -262002,4 +262472,4 @@ export {
262002
262472
  CLIExitError
262003
262473
  };
262004
262474
 
262005
- //# debugId=6564442B53593F8A64756E2164756E21
262475
+ //# debugId=D425B400F88D6F6D64756E2164756E21