@base44-preview/cli 0.0.37-pr.365.600b1d5 → 0.0.38-pr.357.643fc18

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
@@ -8933,10 +8933,10 @@ var require_ejs = __commonJS((exports) => {
8933
8933
  exports.localsName = _DEFAULT_LOCALS_NAME;
8934
8934
  exports.promiseImpl = new Function("return this;")().Promise;
8935
8935
  exports.resolveInclude = function(name2, filename, isDir) {
8936
- var dirname6 = path11.dirname;
8936
+ var dirname7 = path11.dirname;
8937
8937
  var extname = path11.extname;
8938
8938
  var resolve = path11.resolve;
8939
- var includePath = resolve(isDir ? filename : dirname6(filename), name2);
8939
+ var includePath = resolve(isDir ? filename : dirname7(filename), name2);
8940
8940
  var ext = extname(name2);
8941
8941
  if (!ext) {
8942
8942
  includePath += ".ejs";
@@ -12652,8 +12652,8 @@ var require_main = __commonJS((exports, module) => {
12652
12652
  const shortPaths = [];
12653
12653
  for (const filePath of optionPaths) {
12654
12654
  try {
12655
- const relative = path11.relative(process.cwd(), filePath);
12656
- shortPaths.push(relative);
12655
+ const relative3 = path11.relative(process.cwd(), filePath);
12656
+ shortPaths.push(relative3);
12657
12657
  } catch (e2) {
12658
12658
  if (debug) {
12659
12659
  _debug(`Failed to load ${filePath} ${e2.message}`);
@@ -110477,9 +110477,9 @@ function getMessage2(key2, parameters, self2) {
110477
110477
  assert22.ok(message.length <= parameters.length, `Code: ${key2}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`);
110478
110478
  return Reflect.apply(message, self2, parameters);
110479
110479
  }
110480
- const regex2 = /%[dfijoOs]/g;
110480
+ const regex = /%[dfijoOs]/g;
110481
110481
  let expectedLength = 0;
110482
- while (regex2.exec(message) !== null)
110482
+ while (regex.exec(message) !== null)
110483
110483
  expectedLength++;
110484
110484
  assert22.ok(expectedLength === parameters.length, `Code: ${key2}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`);
110485
110485
  if (parameters.length === 0)
@@ -111380,9 +111380,9 @@ function convertEndOfLineOptionToCharacter2(endOfLineOption) {
111380
111380
  return endOfLineOption === OPTION_CR2 ? CHARACTER_CR2 : endOfLineOption === OPTION_CRLF2 ? CHARACTER_CRLF2 : DEFAULT_EOL2;
111381
111381
  }
111382
111382
  function countEndOfLineCharacters(text, endOfLineCharacter) {
111383
- const regex2 = regexps.get(endOfLineCharacter);
111383
+ const regex = regexps.get(endOfLineCharacter);
111384
111384
  if (false) {}
111385
- return text.match(regex2)?.length ?? 0;
111385
+ return text.match(regex)?.length ?? 0;
111386
111386
  }
111387
111387
  function normalizeEndOfLine(text) {
111388
111388
  return method_replace_all_default2(0, text, END_OF_LINE_REGEXP, CHARACTER_LF2);
@@ -113584,8 +113584,8 @@ function legacyIsNextLineEmpty(text, node, locEnd) {
113584
113584
  }
113585
113585
  function makeString(rawText, enclosingQuote, unescapeUnnecessaryEscapes) {
113586
113586
  const otherQuote = enclosingQuote === '"' ? "'" : '"';
113587
- const regex2 = /\\(.)|(["'])/gsu;
113588
- const raw2 = method_replace_all_default2(0, rawText, regex2, (match, escaped, quote) => {
113587
+ const regex = /\\(.)|(["'])/gsu;
113588
+ const raw2 = method_replace_all_default2(0, rawText, regex, (match, escaped, quote) => {
113589
113589
  if (escaped === otherQuote) {
113590
113590
  return escaped;
113591
113591
  }
@@ -117006,17 +117006,17 @@ var init_prettier = __esm(() => {
117006
117006
  }
117007
117007
  const opts = options8 || {};
117008
117008
  const posix = utils3.isWindows(options8);
117009
- const regex2 = isState ? picomatch.compileRe(glob, options8) : picomatch.makeRe(glob, options8, false, true);
117010
- const state = regex2.state;
117011
- delete regex2.state;
117009
+ const regex = isState ? picomatch.compileRe(glob, options8) : picomatch.makeRe(glob, options8, false, true);
117010
+ const state = regex.state;
117011
+ delete regex.state;
117012
117012
  let isIgnored2 = () => false;
117013
117013
  if (opts.ignore) {
117014
117014
  const ignoreOpts = { ...options8, ignore: null, onMatch: null, onResult: null };
117015
117015
  isIgnored2 = picomatch(opts.ignore, ignoreOpts, returnState);
117016
117016
  }
117017
117017
  const matcher = (input, returnObject = false) => {
117018
- const { isMatch, match, output } = picomatch.test(input, regex2, options8, { glob, posix });
117019
- const result = { glob, state, regex: regex2, posix, input, output, match, isMatch };
117018
+ const { isMatch, match, output } = picomatch.test(input, regex, options8, { glob, posix });
117019
+ const result = { glob, state, regex, posix, input, output, match, isMatch };
117020
117020
  if (typeof opts.onResult === "function") {
117021
117021
  opts.onResult(result);
117022
117022
  }
@@ -117041,7 +117041,7 @@ var init_prettier = __esm(() => {
117041
117041
  }
117042
117042
  return matcher;
117043
117043
  };
117044
- picomatch.test = (input, regex2, options8, { glob, posix } = {}) => {
117044
+ picomatch.test = (input, regex, options8, { glob, posix } = {}) => {
117045
117045
  if (typeof input !== "string") {
117046
117046
  throw new TypeError("Expected input to be a string");
117047
117047
  }
@@ -117058,16 +117058,16 @@ var init_prettier = __esm(() => {
117058
117058
  }
117059
117059
  if (match === false || opts.capture === true) {
117060
117060
  if (opts.matchBase === true || opts.basename === true) {
117061
- match = picomatch.matchBase(input, regex2, options8, posix);
117061
+ match = picomatch.matchBase(input, regex, options8, posix);
117062
117062
  } else {
117063
- match = regex2.exec(output);
117063
+ match = regex.exec(output);
117064
117064
  }
117065
117065
  }
117066
117066
  return { isMatch: Boolean(match), match, output };
117067
117067
  };
117068
117068
  picomatch.matchBase = (input, glob, options8, posix = utils3.isWindows(options8)) => {
117069
- const regex2 = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options8);
117070
- return regex2.test(path152.basename(input));
117069
+ const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options8);
117070
+ return regex.test(path152.basename(input));
117071
117071
  };
117072
117072
  picomatch.isMatch = (str, patterns, options8) => picomatch(patterns, options8)(str);
117073
117073
  picomatch.parse = (pattern, options8) => {
@@ -117087,11 +117087,11 @@ var init_prettier = __esm(() => {
117087
117087
  if (state && state.negated === true) {
117088
117088
  source2 = `^(?!${source2}).*$`;
117089
117089
  }
117090
- const regex2 = picomatch.toRegex(source2, options8);
117090
+ const regex = picomatch.toRegex(source2, options8);
117091
117091
  if (returnState === true) {
117092
- regex2.state = state;
117092
+ regex.state = state;
117093
117093
  }
117094
- return regex2;
117094
+ return regex;
117095
117095
  };
117096
117096
  picomatch.makeRe = (input, options8 = {}, returnOutput = false, returnState = false) => {
117097
117097
  if (!input || typeof input !== "string") {
@@ -117255,8 +117255,8 @@ var init_prettier = __esm(() => {
117255
117255
  };
117256
117256
  micromatch2.capture = (glob, input, options8) => {
117257
117257
  let posix = utils3.isWindows(options8);
117258
- let regex2 = picomatch.makeRe(String(glob), { ...options8, capture: true });
117259
- let match = regex2.exec(posix ? utils3.toPosixSlashes(input) : input);
117258
+ let regex = picomatch.makeRe(String(glob), { ...options8, capture: true });
117259
+ let match = regex.exec(posix ? utils3.toPosixSlashes(input) : input);
117260
117260
  if (match) {
117261
117261
  return match.slice(1).map((v10) => v10 === undefined ? "" : v10);
117262
117262
  }
@@ -117434,15 +117434,15 @@ var init_prettier = __esm(() => {
117434
117434
  exports.removeDuplicateSlashes = removeDuplicateSlashes;
117435
117435
  function partitionAbsoluteAndRelative(patterns) {
117436
117436
  const absolute = [];
117437
- const relative2 = [];
117437
+ const relative22 = [];
117438
117438
  for (const pattern of patterns) {
117439
117439
  if (isAbsolute2(pattern)) {
117440
117440
  absolute.push(pattern);
117441
117441
  } else {
117442
- relative2.push(pattern);
117442
+ relative22.push(pattern);
117443
117443
  }
117444
117444
  }
117445
- return [absolute, relative2];
117445
+ return [absolute, relative22];
117446
117446
  }
117447
117447
  exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
117448
117448
  function isAbsolute2(pattern) {
@@ -121695,7 +121695,7 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
121695
121695
  };
121696
121696
  Object.defineProperty(exports, "__esModule", { value: true });
121697
121697
  var fs42 = __importStar(__require2("fs"));
121698
- var regex2 = {
121698
+ var regex = {
121699
121699
  section: /^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$/,
121700
121700
  param: /^\s*([\w\.\-\_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$/,
121701
121701
  comment: /^\s*[#;].*$/
@@ -121727,14 +121727,14 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
121727
121727
  var lines = data.split(/\r\n|\r|\n/);
121728
121728
  lines.forEach(function(line3) {
121729
121729
  var match;
121730
- if (regex2.comment.test(line3)) {
121730
+ if (regex.comment.test(line3)) {
121731
121731
  return;
121732
121732
  }
121733
- if (regex2.param.test(line3)) {
121734
- match = line3.match(regex2.param);
121733
+ if (regex.param.test(line3)) {
121734
+ match = line3.match(regex.param);
121735
121735
  sectionBody[match[1]] = match[2];
121736
- } else if (regex2.section.test(line3)) {
121737
- match = line3.match(regex2.section);
121736
+ } else if (regex.section.test(line3)) {
121737
+ match = line3.match(regex.section);
121738
121738
  sectionName = match[1];
121739
121739
  sectionBody = {};
121740
121740
  value.push([sectionName, sectionBody]);
@@ -122820,8 +122820,8 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
122820
122820
  }
122821
122821
  _make(mode, key2) {
122822
122822
  const str = this.regexPrefix.replace(REGEX_REPLACE_TRAILING_WILDCARD, TRAILING_WILD_CARD_REPLACERS[mode]);
122823
- const regex2 = this.ignoreCase ? new RegExp(str, "i") : new RegExp(str);
122824
- return define2(this, key2, regex2);
122823
+ const regex = this.ignoreCase ? new RegExp(str, "i") : new RegExp(str);
122824
+ return define2(this, key2, regex);
122825
122825
  }
122826
122826
  };
122827
122827
  var createRule = ({
@@ -127617,8 +127617,8 @@ var require_prettier = __commonJS((exports, module) => {
127617
127617
  }
127618
127618
  function makeString2(rawText, enclosingQuote, unescapeUnnecessaryEscapes) {
127619
127619
  const otherQuote = enclosingQuote === '"' ? "'" : '"';
127620
- const regex2 = /\\(.)|(["'])/gsu;
127621
- const raw2 = method_replace_all_default3(0, rawText, regex2, (match, escaped, quote) => {
127620
+ const regex = /\\(.)|(["'])/gsu;
127621
+ const raw2 = method_replace_all_default3(0, rawText, regex, (match, escaped, quote) => {
127622
127622
  if (escaped === otherQuote) {
127623
127623
  return escaped;
127624
127624
  }
@@ -132397,7 +132397,7 @@ var require_url = __commonJS((exports) => {
132397
132397
  exports.fromFileSystemPath = fromFileSystemPath;
132398
132398
  exports.toFileSystemPath = toFileSystemPath;
132399
132399
  exports.safePointerToPath = safePointerToPath;
132400
- exports.relative = relative2;
132400
+ exports.relative = relative4;
132401
132401
  var convert_path_to_posix_1 = __importDefault(require_convert_path_to_posix());
132402
132402
  var path_1 = __importStar(__require("path"));
132403
132403
  var forwardSlashPattern = /\//g;
@@ -132547,7 +132547,7 @@ var require_url = __commonJS((exports) => {
132547
132547
  return decodeURIComponent(value).replace(jsonPointerSlash, "/").replace(jsonPointerTilde, "~");
132548
132548
  });
132549
132549
  }
132550
- function relative2(from, to5) {
132550
+ function relative4(from, to5) {
132551
132551
  if (!isFileSystemPath(from) || !isFileSystemPath(to5)) {
132552
132552
  return resolve6(from, to5);
132553
132553
  }
@@ -138614,7 +138614,7 @@ var require_depd = __commonJS((exports, module) => {
138614
138614
  * Copyright(c) 2014-2018 Douglas Christopher Wilson
138615
138615
  * MIT Licensed
138616
138616
  */
138617
- var relative2 = __require("path").relative;
138617
+ var relative4 = __require("path").relative;
138618
138618
  module.exports = depd;
138619
138619
  var basePath = process.cwd();
138620
138620
  function containsNamespace(str, namespace) {
@@ -138810,7 +138810,7 @@ var require_depd = __commonJS((exports, module) => {
138810
138810
  return formatted;
138811
138811
  }
138812
138812
  function formatLocation(callSite) {
138813
- return relative2(basePath, callSite[0]) + ":" + callSite[1] + ":" + callSite[2];
138813
+ return relative4(basePath, callSite[0]) + ":" + callSite[1] + ":" + callSite[2];
138814
138814
  }
138815
138815
  function getStack() {
138816
138816
  var limit = Error.stackTraceLimit;
@@ -156272,7 +156272,7 @@ var require_view = __commonJS((exports, module) => {
156272
156272
  var debug = require_src4()("express:view");
156273
156273
  var path18 = __require("node:path");
156274
156274
  var fs28 = __require("node:fs");
156275
- var dirname11 = path18.dirname;
156275
+ var dirname12 = path18.dirname;
156276
156276
  var basename4 = path18.basename;
156277
156277
  var extname2 = path18.extname;
156278
156278
  var join15 = path18.join;
@@ -156311,7 +156311,7 @@ var require_view = __commonJS((exports, module) => {
156311
156311
  for (var i5 = 0;i5 < roots.length && !path19; i5++) {
156312
156312
  var root2 = roots[i5];
156313
156313
  var loc = resolve6(root2, name2);
156314
- var dir = dirname11(loc);
156314
+ var dir = dirname12(loc);
156315
156315
  var file2 = basename4(loc);
156316
156316
  path19 = this.resolve(dir, file2);
156317
156317
  }
@@ -156661,12 +156661,12 @@ var require_ipaddr = __commonJS((exports, module) => {
156661
156661
  return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/, "::");
156662
156662
  };
156663
156663
  IPv6.prototype.toRFC5952String = function() {
156664
- var bestMatchIndex, bestMatchLength, match, regex2, string4;
156665
- regex2 = /((^|:)(0(:|$)){2,})/g;
156664
+ var bestMatchIndex, bestMatchLength, match, regex, string4;
156665
+ regex = /((^|:)(0(:|$)){2,})/g;
156666
156666
  string4 = this.toNormalizedString();
156667
156667
  bestMatchIndex = 0;
156668
156668
  bestMatchLength = -1;
156669
- while (match = regex2.exec(string4)) {
156669
+ while (match = regex.exec(string4)) {
156670
156670
  if (match[0].length > bestMatchLength) {
156671
156671
  bestMatchIndex = match.index;
156672
156672
  bestMatchLength = match[0].length;
@@ -161958,8 +161958,8 @@ var require_follow_redirects = __commonJS((exports, module) => {
161958
161958
  }
161959
161959
  return parsed;
161960
161960
  }
161961
- function resolveUrl(relative2, base) {
161962
- return useNativeURL ? new URL2(relative2, base) : parseUrl(url3.resolve(base, relative2));
161961
+ function resolveUrl(relative4, base) {
161962
+ return useNativeURL ? new URL2(relative4, base) : parseUrl(url3.resolve(base, relative4));
161963
161963
  }
161964
161964
  function validateUrl(input) {
161965
161965
  if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
@@ -161984,10 +161984,10 @@ var require_follow_redirects = __commonJS((exports, module) => {
161984
161984
  spread.path = spread.search ? spread.pathname + spread.search : spread.pathname;
161985
161985
  return spread;
161986
161986
  }
161987
- function removeMatchingHeaders(regex2, headers) {
161987
+ function removeMatchingHeaders(regex, headers) {
161988
161988
  var lastValue;
161989
161989
  for (var header2 in headers) {
161990
- if (regex2.test(header2)) {
161990
+ if (regex.test(header2)) {
161991
161991
  lastValue = headers[header2];
161992
161992
  delete headers[header2];
161993
161993
  }
@@ -164408,8 +164408,8 @@ var require_executor = __commonJS((exports, module) => {
164408
164408
  }
164409
164409
  resetBuffer() {
164410
164410
  this.buffer = new Waterfall;
164411
- this.buffer.chain(new Promise((resolve6) => {
164412
- this._triggerBuffer = resolve6;
164411
+ this.buffer.chain(new Promise((resolve7) => {
164412
+ this._triggerBuffer = resolve7;
164413
164413
  }));
164414
164414
  if (this.ready)
164415
164415
  this._triggerBuffer();
@@ -165429,7 +165429,7 @@ var require_storage = __commonJS((exports, module) => {
165429
165429
  throw e8;
165430
165430
  }
165431
165431
  };
165432
- var writeFileLinesAsync = (filename, lines, mode = DEFAULT_FILE_MODE) => new Promise((resolve6, reject) => {
165432
+ var writeFileLinesAsync = (filename, lines, mode = DEFAULT_FILE_MODE) => new Promise((resolve7, reject) => {
165433
165433
  try {
165434
165434
  const stream = writeFileStream(filename, { mode });
165435
165435
  const readable2 = Readable6.from(lines);
@@ -165446,7 +165446,7 @@ var require_storage = __commonJS((exports, module) => {
165446
165446
  if (err)
165447
165447
  reject(err);
165448
165448
  else
165449
- resolve6();
165449
+ resolve7();
165450
165450
  });
165451
165451
  });
165452
165452
  readable2.on("error", (err) => {
@@ -165617,7 +165617,7 @@ var require_persistence = __commonJS((exports, module) => {
165617
165617
  return { data: tdata, indexes };
165618
165618
  }
165619
165619
  treatRawStreamAsync(rawStream) {
165620
- return new Promise((resolve6, reject) => {
165620
+ return new Promise((resolve7, reject) => {
165621
165621
  const dataById = {};
165622
165622
  const indexes = {};
165623
165623
  let corruptItems = 0;
@@ -165660,7 +165660,7 @@ var require_persistence = __commonJS((exports, module) => {
165660
165660
  }
165661
165661
  }
165662
165662
  const data = Object.values(dataById);
165663
- resolve6({ data, indexes });
165663
+ resolve7({ data, indexes });
165664
165664
  });
165665
165665
  lineStream.on("error", function(err) {
165666
165666
  reject(err, null);
@@ -191271,13 +191271,13 @@ var require_broadcast_operator = __commonJS((exports) => {
191271
191271
  return true;
191272
191272
  }
191273
191273
  emitWithAck(ev2, ...args) {
191274
- return new Promise((resolve6, reject) => {
191274
+ return new Promise((resolve7, reject) => {
191275
191275
  args.push((err, responses) => {
191276
191276
  if (err) {
191277
191277
  err.responses = responses;
191278
191278
  return reject(err);
191279
191279
  } else {
191280
- return resolve6(responses);
191280
+ return resolve7(responses);
191281
191281
  }
191282
191282
  });
191283
191283
  this.emit(ev2, ...args);
@@ -191465,12 +191465,12 @@ var require_socket2 = __commonJS((exports) => {
191465
191465
  }
191466
191466
  emitWithAck(ev2, ...args) {
191467
191467
  const withErr = this.flags.timeout !== undefined;
191468
- return new Promise((resolve6, reject) => {
191468
+ return new Promise((resolve7, reject) => {
191469
191469
  args.push((arg1, arg2) => {
191470
191470
  if (withErr) {
191471
- return arg1 ? reject(arg1) : resolve6(arg2);
191471
+ return arg1 ? reject(arg1) : resolve7(arg2);
191472
191472
  } else {
191473
- return resolve6(arg1);
191473
+ return resolve7(arg1);
191474
191474
  }
191475
191475
  });
191476
191476
  this.emit(ev2, ...args);
@@ -191925,13 +191925,13 @@ var require_namespace = __commonJS((exports) => {
191925
191925
  return true;
191926
191926
  }
191927
191927
  serverSideEmitWithAck(ev2, ...args) {
191928
- return new Promise((resolve6, reject) => {
191928
+ return new Promise((resolve7, reject) => {
191929
191929
  args.push((err, responses) => {
191930
191930
  if (err) {
191931
191931
  err.responses = responses;
191932
191932
  return reject(err);
191933
191933
  } else {
191934
- return resolve6(responses);
191934
+ return resolve7(responses);
191935
191935
  }
191936
191936
  });
191937
191937
  this.serverSideEmit(ev2, ...args);
@@ -192615,7 +192615,7 @@ var require_cluster_adapter = __commonJS((exports) => {
192615
192615
  return localSockets;
192616
192616
  }
192617
192617
  const requestId = randomId();
192618
- return new Promise((resolve6, reject) => {
192618
+ return new Promise((resolve7, reject) => {
192619
192619
  const timeout3 = setTimeout(() => {
192620
192620
  const storedRequest2 = this.requests.get(requestId);
192621
192621
  if (storedRequest2) {
@@ -192625,7 +192625,7 @@ var require_cluster_adapter = __commonJS((exports) => {
192625
192625
  }, opts.flags.timeout || DEFAULT_TIMEOUT);
192626
192626
  const storedRequest = {
192627
192627
  type: MessageType.FETCH_SOCKETS,
192628
- resolve: resolve6,
192628
+ resolve: resolve7,
192629
192629
  timeout: timeout3,
192630
192630
  current: 0,
192631
192631
  expected: expectedResponseCount,
@@ -192835,7 +192835,7 @@ var require_cluster_adapter = __commonJS((exports) => {
192835
192835
  return localSockets;
192836
192836
  }
192837
192837
  const requestId = randomId();
192838
- return new Promise((resolve6, reject) => {
192838
+ return new Promise((resolve7, reject) => {
192839
192839
  const timeout3 = setTimeout(() => {
192840
192840
  const storedRequest2 = this.customRequests.get(requestId);
192841
192841
  if (storedRequest2) {
@@ -192845,7 +192845,7 @@ var require_cluster_adapter = __commonJS((exports) => {
192845
192845
  }, opts.flags.timeout || DEFAULT_TIMEOUT);
192846
192846
  const storedRequest = {
192847
192847
  type: MessageType.FETCH_SOCKETS,
192848
- resolve: resolve6,
192848
+ resolve: resolve7,
192849
192849
  timeout: timeout3,
192850
192850
  missingUids: new Set([...this.nodesMap.keys()]),
192851
192851
  responses: localSockets
@@ -193547,9 +193547,9 @@ var require_dist4 = __commonJS((exports, module) => {
193547
193547
  name2 = "/" + name2;
193548
193548
  let nsp = this._nsps.get(name2);
193549
193549
  if (!nsp) {
193550
- for (const [regex2, parentNamespace] of this.parentNamespacesFromRegExp) {
193551
- if (regex2.test(name2)) {
193552
- debug("attaching namespace %s to parent namespace %s", name2, regex2);
193550
+ for (const [regex, parentNamespace] of this.parentNamespacesFromRegExp) {
193551
+ if (regex.test(name2)) {
193552
+ debug("attaching namespace %s to parent namespace %s", name2, regex);
193553
193553
  return parentNamespace.createChild(name2);
193554
193554
  }
193555
193555
  }
@@ -193574,13 +193574,13 @@ var require_dist4 = __commonJS((exports, module) => {
193574
193574
  this.engine.close();
193575
193575
  (0, uws_1.restoreAdapter)();
193576
193576
  if (this.httpServer) {
193577
- return new Promise((resolve6) => {
193577
+ return new Promise((resolve7) => {
193578
193578
  this.httpServer.close((err) => {
193579
193579
  fn9 && fn9(err);
193580
193580
  if (err) {
193581
193581
  debug("server was not running");
193582
193582
  }
193583
- resolve6();
193583
+ resolve7();
193584
193584
  });
193585
193585
  });
193586
193586
  } else {
@@ -208299,14 +208299,14 @@ var require_async_iterator = __commonJS((exports, module) => {
208299
208299
  };
208300
208300
  }
208301
208301
  function readAndResolve(iter) {
208302
- var resolve6 = iter[kLastResolve];
208303
- if (resolve6 !== null) {
208302
+ var resolve7 = iter[kLastResolve];
208303
+ if (resolve7 !== null) {
208304
208304
  var data = iter[kStream].read();
208305
208305
  if (data !== null) {
208306
208306
  iter[kLastPromise] = null;
208307
208307
  iter[kLastResolve] = null;
208308
208308
  iter[kLastReject] = null;
208309
- resolve6(createIterResult(data, false));
208309
+ resolve7(createIterResult(data, false));
208310
208310
  }
208311
208311
  }
208312
208312
  }
@@ -208314,13 +208314,13 @@ var require_async_iterator = __commonJS((exports, module) => {
208314
208314
  process.nextTick(readAndResolve, iter);
208315
208315
  }
208316
208316
  function wrapForNext(lastPromise, iter) {
208317
- return function(resolve6, reject) {
208317
+ return function(resolve7, reject) {
208318
208318
  lastPromise.then(function() {
208319
208319
  if (iter[kEnded]) {
208320
- resolve6(createIterResult(undefined, true));
208320
+ resolve7(createIterResult(undefined, true));
208321
208321
  return;
208322
208322
  }
208323
- iter[kHandlePromise](resolve6, reject);
208323
+ iter[kHandlePromise](resolve7, reject);
208324
208324
  }, reject);
208325
208325
  };
208326
208326
  }
@@ -208339,12 +208339,12 @@ var require_async_iterator = __commonJS((exports, module) => {
208339
208339
  return Promise.resolve(createIterResult(undefined, true));
208340
208340
  }
208341
208341
  if (this[kStream].destroyed) {
208342
- return new Promise(function(resolve6, reject) {
208342
+ return new Promise(function(resolve7, reject) {
208343
208343
  process.nextTick(function() {
208344
208344
  if (_this[kError]) {
208345
208345
  reject(_this[kError]);
208346
208346
  } else {
208347
- resolve6(createIterResult(undefined, true));
208347
+ resolve7(createIterResult(undefined, true));
208348
208348
  }
208349
208349
  });
208350
208350
  });
@@ -208367,13 +208367,13 @@ var require_async_iterator = __commonJS((exports, module) => {
208367
208367
  return this;
208368
208368
  }), _defineProperty(_Object$setPrototypeO, "return", function _return() {
208369
208369
  var _this2 = this;
208370
- return new Promise(function(resolve6, reject) {
208370
+ return new Promise(function(resolve7, reject) {
208371
208371
  _this2[kStream].destroy(null, function(err) {
208372
208372
  if (err) {
208373
208373
  reject(err);
208374
208374
  return;
208375
208375
  }
208376
- resolve6(createIterResult(undefined, true));
208376
+ resolve7(createIterResult(undefined, true));
208377
208377
  });
208378
208378
  });
208379
208379
  }), _Object$setPrototypeO), AsyncIteratorPrototype);
@@ -208395,15 +208395,15 @@ var require_async_iterator = __commonJS((exports, module) => {
208395
208395
  value: stream._readableState.endEmitted,
208396
208396
  writable: true
208397
208397
  }), _defineProperty(_Object$create, kHandlePromise, {
208398
- value: function value(resolve6, reject) {
208398
+ value: function value(resolve7, reject) {
208399
208399
  var data = iterator[kStream].read();
208400
208400
  if (data) {
208401
208401
  iterator[kLastPromise] = null;
208402
208402
  iterator[kLastResolve] = null;
208403
208403
  iterator[kLastReject] = null;
208404
- resolve6(createIterResult(data, false));
208404
+ resolve7(createIterResult(data, false));
208405
208405
  } else {
208406
- iterator[kLastResolve] = resolve6;
208406
+ iterator[kLastResolve] = resolve7;
208407
208407
  iterator[kLastReject] = reject;
208408
208408
  }
208409
208409
  },
@@ -208422,12 +208422,12 @@ var require_async_iterator = __commonJS((exports, module) => {
208422
208422
  iterator[kError] = err;
208423
208423
  return;
208424
208424
  }
208425
- var resolve6 = iterator[kLastResolve];
208426
- if (resolve6 !== null) {
208425
+ var resolve7 = iterator[kLastResolve];
208426
+ if (resolve7 !== null) {
208427
208427
  iterator[kLastPromise] = null;
208428
208428
  iterator[kLastResolve] = null;
208429
208429
  iterator[kLastReject] = null;
208430
- resolve6(createIterResult(undefined, true));
208430
+ resolve7(createIterResult(undefined, true));
208431
208431
  }
208432
208432
  iterator[kEnded] = true;
208433
208433
  });
@@ -208439,7 +208439,7 @@ var require_async_iterator = __commonJS((exports, module) => {
208439
208439
 
208440
208440
  // node_modules/readable-stream/lib/internal/streams/from.js
208441
208441
  var require_from = __commonJS((exports, module) => {
208442
- function asyncGeneratorStep(gen, resolve6, reject, _next, _throw, key2, arg) {
208442
+ function asyncGeneratorStep(gen, resolve7, reject, _next, _throw, key2, arg) {
208443
208443
  try {
208444
208444
  var info = gen[key2](arg);
208445
208445
  var value = info.value;
@@ -208448,7 +208448,7 @@ var require_from = __commonJS((exports, module) => {
208448
208448
  return;
208449
208449
  }
208450
208450
  if (info.done) {
208451
- resolve6(value);
208451
+ resolve7(value);
208452
208452
  } else {
208453
208453
  Promise.resolve(value).then(_next, _throw);
208454
208454
  }
@@ -208456,13 +208456,13 @@ var require_from = __commonJS((exports, module) => {
208456
208456
  function _asyncToGenerator(fn9) {
208457
208457
  return function() {
208458
208458
  var self2 = this, args = arguments;
208459
- return new Promise(function(resolve6, reject) {
208459
+ return new Promise(function(resolve7, reject) {
208460
208460
  var gen = fn9.apply(self2, args);
208461
208461
  function _next(value) {
208462
- asyncGeneratorStep(gen, resolve6, reject, _next, _throw, "next", value);
208462
+ asyncGeneratorStep(gen, resolve7, reject, _next, _throw, "next", value);
208463
208463
  }
208464
208464
  function _throw(err) {
208465
- asyncGeneratorStep(gen, resolve6, reject, _next, _throw, "throw", err);
208465
+ asyncGeneratorStep(gen, resolve7, reject, _next, _throw, "throw", err);
208466
208466
  }
208467
208467
  _next(undefined);
208468
208468
  });
@@ -210590,7 +210590,7 @@ var require_dist5 = __commonJS((exports, module) => {
210590
210590
  });
210591
210591
  module.exports = __toCommonJS(src_exports);
210592
210592
  var import_promises22 = __require("node:fs/promises");
210593
- var import_node_fs21 = __require("node:fs");
210593
+ var import_node_fs22 = __require("node:fs");
210594
210594
  var DEVIN_LOCAL_PATH = "/opt/.devin";
210595
210595
  var CURSOR2 = "cursor";
210596
210596
  var CURSOR_CLI = "cursor-cli";
@@ -210647,7 +210647,7 @@ var require_dist5 = __commonJS((exports, module) => {
210647
210647
  return { isAgent: true, agent: { name: REPLIT } };
210648
210648
  }
210649
210649
  try {
210650
- await (0, import_promises22.access)(DEVIN_LOCAL_PATH, import_node_fs21.constants.F_OK);
210650
+ await (0, import_promises22.access)(DEVIN_LOCAL_PATH, import_node_fs22.constants.F_OK);
210651
210651
  return { isAgent: true, agent: { name: DEVIN } };
210652
210652
  } catch (error48) {}
210653
210653
  return { isAgent: false, agent: undefined };
@@ -210671,7 +210671,7 @@ var {
210671
210671
  } = import__.default;
210672
210672
 
210673
210673
  // src/cli/commands/agents/pull.ts
210674
- import { dirname as dirname7, join as join9 } from "node:path";
210674
+ import { dirname as dirname8, join as join9 } from "node:path";
210675
210675
 
210676
210676
  // node_modules/@clack/core/dist/index.mjs
210677
210677
  var import_picocolors = __toESM(require_picocolors(), 1);
@@ -225313,6 +225313,9 @@ var UserInfoSchema = exports_external.object({
225313
225313
  name: exports_external.string()
225314
225314
  });
225315
225315
 
225316
+ // src/core/clients/base44-client.ts
225317
+ import { randomUUID as randomUUID2 } from "node:crypto";
225318
+
225316
225319
  // node_modules/ky/distribution/errors/HTTPError.js
225317
225320
  class HTTPError extends Error {
225318
225321
  response;
@@ -226141,7 +226144,9 @@ import { fileURLToPath } from "node:url";
226141
226144
  var PROJECT_SUBDIR = "base44";
226142
226145
  var CONFIG_FILE_EXTENSION = "jsonc";
226143
226146
  var CONFIG_FILE_EXTENSION_GLOB = "{json,jsonc}";
226144
- var FUNCTION_CONFIG_FILE = `function.${CONFIG_FILE_EXTENSION_GLOB}`;
226147
+ var FUNCTION_CONFIG_GLOB = `**/function.${CONFIG_FILE_EXTENSION_GLOB}`;
226148
+ var ENTRY_FILE_GLOB = "**/entry.{js,ts}";
226149
+ var ENTRY_IGNORE_DOT_PATHS = ["**/*.*/**"];
226145
226150
  var APP_CONFIG_PATTERN = `**/.app.${CONFIG_FILE_EXTENSION_GLOB}`;
226146
226151
  var PROJECT_CONFIG_PATTERNS = [
226147
226152
  `${PROJECT_SUBDIR}/config.${CONFIG_FILE_EXTENSION_GLOB}`,
@@ -233170,7 +233175,7 @@ var generateGlobTasks = normalizeArguments(generateTasks);
233170
233175
  var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
233171
233176
 
233172
233177
  // src/core/project/config.ts
233173
- import { dirname as dirname5, join as join6 } from "node:path";
233178
+ import { dirname as dirname6, join as join6 } from "node:path";
233174
233179
 
233175
233180
  // src/core/resources/agent/schema.ts
233176
233181
  var EntityOperationSchema = exports_external.enum(["create", "update", "delete", "read"]);
@@ -233980,7 +233985,7 @@ async function fetchFunctionLogs(functionName, filters = {}) {
233980
233985
  return result.data;
233981
233986
  }
233982
233987
  // src/core/resources/function/config.ts
233983
- import { dirname as dirname4, join as join5 } from "node:path";
233988
+ import { basename as basename2, dirname as dirname4, join as join5, relative } from "node:path";
233984
233989
  async function readFunctionConfig(configPath) {
233985
233990
  const parsed = await readJsonFile(configPath);
233986
233991
  const result = FunctionConfigSchema.safeParse(parsed);
@@ -233998,7 +234003,7 @@ async function readFunction(configPath) {
233998
234003
  hints: [{ message: "Check the 'entry' field in your function config" }]
233999
234004
  });
234000
234005
  }
234001
- const filePaths = await globby("*.{js,ts,json}", {
234006
+ const filePaths = await globby("**/*.{js,ts,json}", {
234002
234007
  cwd: functionDir,
234003
234008
  absolute: true
234004
234009
  });
@@ -234009,26 +234014,61 @@ async function readAllFunctions(functionsDir) {
234009
234014
  if (!await pathExists(functionsDir)) {
234010
234015
  return [];
234011
234016
  }
234012
- const configFiles = await globby(`*/${FUNCTION_CONFIG_FILE}`, {
234017
+ const configFiles = await globby(FUNCTION_CONFIG_GLOB, {
234013
234018
  cwd: functionsDir,
234014
234019
  absolute: true
234015
234020
  });
234016
- const functions = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
234021
+ const entryFiles = await globby(ENTRY_FILE_GLOB, {
234022
+ cwd: functionsDir,
234023
+ absolute: true,
234024
+ ignore: ENTRY_IGNORE_DOT_PATHS
234025
+ });
234026
+ const configFilesDirs = new Set(configFiles.map((f) => dirname4(f)));
234027
+ const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(dirname4(entryFile)));
234028
+ const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
234029
+ const functionsWithoutConfig = await Promise.all(entryFilesWithoutConfig.map(async (entryFile) => {
234030
+ const functionDir = dirname4(entryFile);
234031
+ const filePaths = await globby("**/*.{js,ts,json}", {
234032
+ cwd: functionDir,
234033
+ absolute: true
234034
+ });
234035
+ const name2 = relative(functionsDir, functionDir).split(/[/\\]/).join("/");
234036
+ if (!name2) {
234037
+ throw new InvalidInputError("entry.ts found directly in the functions directory — it must be inside a named subfolder", {
234038
+ hints: [
234039
+ {
234040
+ message: `Move ${entryFile} into a subfolder (e.g. functions/myFunc/entry.ts)`
234041
+ }
234042
+ ]
234043
+ });
234044
+ }
234045
+ const entry = basename2(entryFile);
234046
+ return { name: name2, entry, entryPath: entryFile, filePaths };
234047
+ }));
234048
+ const functions = [...functionsFromConfig, ...functionsWithoutConfig];
234017
234049
  const names = new Set;
234018
234050
  for (const fn of functions) {
234019
234051
  if (names.has(fn.name)) {
234020
- throw new Error(`Duplicate function name "${fn.name}"`);
234052
+ throw new InvalidInputError(`Duplicate function name "${fn.name}"`, {
234053
+ hints: [
234054
+ {
234055
+ message: "Ensure each function has a unique name (or path for zero-config functions)."
234056
+ }
234057
+ ]
234058
+ });
234021
234059
  }
234022
234060
  names.add(fn.name);
234023
234061
  }
234024
234062
  return functions;
234025
234063
  }
234026
234064
  // src/core/resources/function/deploy.ts
234027
- import { basename as basename2 } from "node:path";
234065
+ import { dirname as dirname5, relative as relative2 } from "node:path";
234028
234066
  async function loadFunctionCode(fn) {
234067
+ const functionDir = dirname5(fn.entryPath);
234029
234068
  const loadedFiles = await Promise.all(fn.filePaths.map(async (filePath) => {
234030
234069
  const content = await readTextFile(filePath);
234031
- return { path: basename2(filePath), content };
234070
+ const path11 = relative2(functionDir, filePath).split(/[/\\]/).join("/");
234071
+ return { path: path11, content };
234032
234072
  }));
234033
234073
  return { ...fn, files: loadedFiles };
234034
234074
  }
@@ -234054,12 +234094,12 @@ async function findConfigInDir(dir) {
234054
234094
  }
234055
234095
  async function findProjectRoot(startPath) {
234056
234096
  let current = startPath || process.cwd();
234057
- while (current !== dirname5(current)) {
234097
+ while (current !== dirname6(current)) {
234058
234098
  const configPath = await findConfigInDir(current);
234059
234099
  if (configPath) {
234060
234100
  return { root: current, configPath };
234061
234101
  }
234062
- current = dirname5(current);
234102
+ current = dirname6(current);
234063
234103
  }
234064
234104
  return null;
234065
234105
  }
@@ -234081,7 +234121,7 @@ async function readProjectConfig(projectRoot) {
234081
234121
  throw new SchemaValidationError("Invalid project configuration", result.error, configPath);
234082
234122
  }
234083
234123
  const project = result.data;
234084
- const configDir = dirname5(configPath);
234124
+ const configDir = dirname6(configPath);
234085
234125
  const [entities, functions, agents, connectors] = await Promise.all([
234086
234126
  entityResource.readAll(join6(configDir, project.entitiesDir)),
234087
234127
  functionResource.readAll(join6(configDir, project.functionsDir)),
@@ -234183,7 +234223,7 @@ async function readAppConfig(projectRoot) {
234183
234223
  // src/core/project/template.ts
234184
234224
  var import_ejs = __toESM(require_ejs(), 1);
234185
234225
  var import_front_matter = __toESM(require_front_matter(), 1);
234186
- import { dirname as dirname6, join as join7 } from "node:path";
234226
+ import { dirname as dirname7, join as join7 } from "node:path";
234187
234227
  async function listTemplates() {
234188
234228
  const parsed = await readJsonFile(getTemplatesIndexPath());
234189
234229
  const result = TemplatesConfigSchema.safeParse(parsed);
@@ -234205,7 +234245,7 @@ async function renderTemplate(template, destPath, data) {
234205
234245
  if (file2.endsWith(".ejs")) {
234206
234246
  const rendered = await import_ejs.default.renderFile(srcPath, data);
234207
234247
  const { attributes, body } = import_front_matter.default(rendered);
234208
- const destFile = attributes.outputFileName ? join7(dirname6(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
234248
+ const destFile = attributes.outputFileName ? join7(dirname7(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
234209
234249
  const destFilePath = join7(destPath, destFile);
234210
234250
  await writeFile(destFilePath, body);
234211
234251
  } else {
@@ -234391,8 +234431,12 @@ async function handleUnauthorized(request, _options, response) {
234391
234431
  return;
234392
234432
  }
234393
234433
  retriedRequests.add(request);
234434
+ const requestId = request.headers.get("X-Request-ID");
234394
234435
  return distribution_default(request.clone(), {
234395
- headers: { Authorization: `Bearer ${newAccessToken}` }
234436
+ headers: {
234437
+ ...requestId && { "X-Request-ID": requestId },
234438
+ Authorization: `Bearer ${newAccessToken}`
234439
+ }
234396
234440
  });
234397
234441
  }
234398
234442
  var base44Client = distribution_default.create({
@@ -234402,6 +234446,9 @@ var base44Client = distribution_default.create({
234402
234446
  },
234403
234447
  hooks: {
234404
234448
  beforeRequest: [
234449
+ (request) => {
234450
+ request.headers.set("X-Request-ID", randomUUID2());
234451
+ },
234405
234452
  captureRequestBody,
234406
234453
  async (request) => {
234407
234454
  try {
@@ -234427,10 +234474,18 @@ function getAppClient() {
234427
234474
  });
234428
234475
  }
234429
234476
  // src/core/clients/oauth-client.ts
234477
+ import { randomUUID as randomUUID3 } from "node:crypto";
234430
234478
  var oauthClient = distribution_default.create({
234431
234479
  prefixUrl: getBase44ApiUrl(),
234432
234480
  headers: {
234433
234481
  "User-Agent": "Base44 CLI"
234482
+ },
234483
+ hooks: {
234484
+ beforeRequest: [
234485
+ (request) => {
234486
+ request.headers.set("X-Request-ID", randomUUID3());
234487
+ }
234488
+ ]
234434
234489
  }
234435
234490
  });
234436
234491
  // src/core/auth/api.ts
@@ -234575,7 +234630,8 @@ async function deleteSecret(name2) {
234575
234630
  let response;
234576
234631
  try {
234577
234632
  response = await appClient.delete("secrets", {
234578
- searchParams: { secret_name: name2 }
234633
+ searchParams: { secret_name: name2 },
234634
+ timeout: false
234579
234635
  });
234580
234636
  } catch (error48) {
234581
234637
  throw await ApiError.fromHttpError(error48, "deleting secret");
@@ -235383,24 +235439,6 @@ async function login() {
235383
235439
  };
235384
235440
  }
235385
235441
 
235386
- // node_modules/ansi-regex/index.js
235387
- function ansiRegex({ onlyFirst = false } = {}) {
235388
- const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
235389
- const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
235390
- const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
235391
- const pattern = `${osc}|${csi}`;
235392
- return new RegExp(pattern, onlyFirst ? undefined : "g");
235393
- }
235394
-
235395
- // node_modules/strip-ansi/index.js
235396
- var regex = ansiRegex();
235397
- function stripAnsi(string4) {
235398
- if (typeof string4 !== "string") {
235399
- throw new TypeError(`Expected a \`string\`, got \`${typeof string4}\``);
235400
- }
235401
- return string4.replace(regex, "");
235402
- }
235403
-
235404
235442
  // node_modules/is-plain-obj/index.js
235405
235443
  function isPlainObject2(value) {
235406
235444
  if (typeof value !== "object" || value === null) {
@@ -241899,7 +241937,7 @@ var {
241899
241937
  // package.json
241900
241938
  var package_default = {
241901
241939
  name: "base44",
241902
- version: "0.0.37",
241940
+ version: "0.0.38",
241903
241941
  description: "Base44 CLI - Unified interface for managing Base44 applications",
241904
241942
  type: "module",
241905
241943
  bin: {
@@ -242017,35 +242055,16 @@ async function checkForUpgrade() {
242017
242055
  }
242018
242056
 
242019
242057
  // src/cli/utils/upgradeNotification.ts
242020
- var UPGRADE_COMMAND = "npm install -g base44@latest";
242021
- function formatUpgradeBox(info) {
242058
+ function formatUpgradeMessage(info) {
242022
242059
  const { shinyOrange } = theme.colors;
242023
242060
  const { bold: bold2 } = theme.styles;
242024
- const lines = [
242025
- shinyOrange(`Update available! ${info.currentVersion} → ${bold2(info.latestVersion)}`),
242026
- shinyOrange(`Run: ${bold2(UPGRADE_COMMAND)}`)
242027
- ];
242028
- const maxVisualWidth = Math.max(...lines.map((l) => stripAnsi(l).length));
242029
- const pad = (line) => {
242030
- const visual = stripAnsi(line).length;
242031
- return `${line}${" ".repeat(maxVisualWidth - visual)}`;
242032
- };
242033
- const top = `┌${"─".repeat(maxVisualWidth + 2)}┐`;
242034
- const bottom = `└${"─".repeat(maxVisualWidth + 2)}┘`;
242035
- const body = lines.map((l) => `│ ${pad(l)} │`).join(`
242036
- `);
242037
- return `${top}
242038
- ${body}
242039
- ${bottom}`;
242040
- }
242041
- function startUpgradeCheck() {
242042
- return checkForUpgrade().catch(() => null);
242061
+ return `${shinyOrange("Update available!")} ${shinyOrange(`${info.currentVersion} → ${info.latestVersion}`)} ${shinyOrange("Run:")} ${bold2(shinyOrange("npm install -g base44@latest"))}`;
242043
242062
  }
242044
- async function printUpgradeNotification(upgradeCheckPromise) {
242063
+ async function printUpgradeNotificationIfAvailable() {
242045
242064
  try {
242046
- const upgradeInfo = await upgradeCheckPromise;
242065
+ const upgradeInfo = await checkForUpgrade();
242047
242066
  if (upgradeInfo) {
242048
- R2.warn(formatUpgradeBox(upgradeInfo));
242067
+ R2.message(formatUpgradeMessage(upgradeInfo));
242049
242068
  }
242050
242069
  } catch {}
242051
242070
  }
@@ -242058,7 +242077,7 @@ async function runCommand(commandFn, options, context) {
242058
242077
  } else {
242059
242078
  We(theme.colors.base44OrangeBackground(" Base 44 "));
242060
242079
  }
242061
- const upgradeCheckPromise = startUpgradeCheck();
242080
+ await printUpgradeNotificationIfAvailable();
242062
242081
  try {
242063
242082
  if (options?.requireAuth) {
242064
242083
  const loggedIn = await isLoggedIn();
@@ -242078,14 +242097,12 @@ async function runCommand(commandFn, options, context) {
242078
242097
  context.errorReporter.setContext({ appId: appConfig.id });
242079
242098
  }
242080
242099
  const result = await commandFn();
242081
- await printUpgradeNotification(upgradeCheckPromise);
242082
242100
  Le(result.outroMessage || "");
242083
242101
  if (result.stdout) {
242084
242102
  process.stdout.write(result.stdout);
242085
242103
  }
242086
242104
  } catch (error48) {
242087
242105
  displayError(error48);
242088
- await printUpgradeNotification(upgradeCheckPromise);
242089
242106
  const errorContext = context.errorReporter.getErrorContext();
242090
242107
  Le(theme.format.errorContext(errorContext));
242091
242108
  throw error48;
@@ -242129,7 +242146,7 @@ function getDashboardUrl(projectId) {
242129
242146
  // src/cli/commands/agents/pull.ts
242130
242147
  async function pullAgentsAction() {
242131
242148
  const { project: project2 } = await readProjectConfig();
242132
- const configDir = dirname7(project2.configPath);
242149
+ const configDir = dirname8(project2.configPath);
242133
242150
  const agentsDir = join9(configDir, project2.agentsDir);
242134
242151
  const remoteAgents = await runTask("Fetching agents from Base44", async () => {
242135
242152
  return await fetchAgents();
@@ -242224,10 +242241,10 @@ function getWhoamiCommand(context) {
242224
242241
  }
242225
242242
 
242226
242243
  // src/cli/commands/connectors/pull.ts
242227
- import { dirname as dirname8, join as join10 } from "node:path";
242244
+ import { dirname as dirname9, join as join10 } from "node:path";
242228
242245
  async function pullConnectorsAction() {
242229
242246
  const { project: project2 } = await readProjectConfig();
242230
- const configDir = dirname8(project2.configPath);
242247
+ const configDir = dirname9(project2.configPath);
242231
242248
  const connectorsDir = join10(configDir, project2.connectorsDir);
242232
242249
  const remoteConnectors = await runTask("Fetching connectors from Base44", async () => {
242233
242250
  return await listConnectors();
@@ -243923,7 +243940,7 @@ function getTypesCommand(context) {
243923
243940
  }
243924
243941
 
243925
243942
  // src/cli/dev/dev-server/main.ts
243926
- import { dirname as dirname14, join as join18 } from "node:path";
243943
+ import { dirname as dirname15, join as join18 } from "node:path";
243927
243944
  var import_cors = __toESM(require_lib4(), 1);
243928
243945
  var import_express4 = __toESM(require_express(), 1);
243929
243946
 
@@ -244049,6 +244066,7 @@ var { promisify: promisify11 } = __require("util");
244049
244066
  var tmp = require_tmp();
244050
244067
  var $fileSync = tmp.fileSync;
244051
244068
  var fileWithOptions = promisify11((options8, cb2) => tmp.file(options8, (err, path18, fd, cleanup) => err ? cb2(err) : cb2(undefined, { path: path18, fd, cleanup: promisify11(cleanup) })));
244069
+ var $file = async (options8) => fileWithOptions(options8);
244052
244070
  var $dirSync = tmp.dirSync;
244053
244071
  var dirWithOptions = promisify11((options8, cb2) => tmp.dir(options8, (err, path18, cleanup) => err ? cb2(err) : cb2(undefined, { path: path18, cleanup: promisify11(cleanup) })));
244054
244072
  var $dir = async (options8) => dirWithOptions(options8);
@@ -244081,10 +244099,88 @@ function createDevLogger() {
244081
244099
  }
244082
244100
 
244083
244101
  // src/cli/dev/dev-server/function-manager.ts
244084
- import { spawn as spawn2, spawnSync as spawnSync2 } from "node:child_process";
244085
- import { dirname as dirname11, join as join15 } from "node:path";
244102
+ import { spawn as spawn3 } from "node:child_process";
244103
+ import { dirname as dirname12, join as join15 } from "node:path";
244086
244104
  import { fileURLToPath as fileURLToPath7 } from "node:url";
244087
- var __dirname5 = dirname11(fileURLToPath7(import.meta.url));
244105
+
244106
+ // src/core/exec/run-script.ts
244107
+ import { spawn as spawn2, spawnSync as spawnSync2 } from "node:child_process";
244108
+ import { copyFileSync, writeFileSync as writeFileSync2 } from "node:fs";
244109
+ import { resolve as resolve6 } from "node:path";
244110
+ function verifyDenoInstalled() {
244111
+ const result = spawnSync2("deno", ["--version"]);
244112
+ if (result.error) {
244113
+ throw new DependencyNotFoundError("Deno is required to run scripts with exec", {
244114
+ hints: [
244115
+ {
244116
+ message: "Install Deno: https://docs.deno.com/runtime/getting_started/installation/"
244117
+ }
244118
+ ]
244119
+ });
244120
+ }
244121
+ }
244122
+ async function getUserAppToken() {
244123
+ try {
244124
+ const response = await getAppClient().get("auth/token").json();
244125
+ return response.token;
244126
+ } catch (error48) {
244127
+ throw await ApiError.fromHttpError(error48, "exchanging platform token for app user token");
244128
+ }
244129
+ }
244130
+ async function runScript(options8) {
244131
+ const { filePath, code: code2, extraArgs = [], execWrapperPath } = options8;
244132
+ verifyDenoInstalled();
244133
+ const cleanupFns = [];
244134
+ let scriptPath;
244135
+ if (filePath) {
244136
+ scriptPath = `file://${resolve6(filePath)}`;
244137
+ } else if (code2 !== undefined) {
244138
+ const tempScript = await $file({ postfix: ".ts" });
244139
+ cleanupFns.push(tempScript.cleanup);
244140
+ writeFileSync2(tempScript.path, code2, "utf-8");
244141
+ scriptPath = `file://${tempScript.path}`;
244142
+ } else {
244143
+ throw new Error("Either filePath or code must be provided");
244144
+ }
244145
+ const appConfig = getAppConfig();
244146
+ const [appUserToken, appBaseUrl] = await Promise.all([
244147
+ getUserAppToken(),
244148
+ getSiteUrl()
244149
+ ]);
244150
+ const tempWrapper = await $file({ postfix: ".ts" });
244151
+ cleanupFns.push(tempWrapper.cleanup);
244152
+ copyFileSync(execWrapperPath, tempWrapper.path);
244153
+ try {
244154
+ const exitCode = await new Promise((resolvePromise) => {
244155
+ const child = spawn2("deno", [
244156
+ "run",
244157
+ "--allow-all",
244158
+ "--node-modules-dir=auto",
244159
+ tempWrapper.path,
244160
+ ...extraArgs
244161
+ ], {
244162
+ env: {
244163
+ ...process.env,
244164
+ SCRIPT_PATH: scriptPath,
244165
+ BASE44_APP_ID: appConfig.id,
244166
+ BASE44_ACCESS_TOKEN: appUserToken,
244167
+ BASE44_APP_BASE_URL: appBaseUrl
244168
+ },
244169
+ stdio: "inherit"
244170
+ });
244171
+ child.on("close", (code3) => {
244172
+ resolvePromise(code3 ?? 1);
244173
+ });
244174
+ });
244175
+ return { exitCode };
244176
+ } finally {
244177
+ for (const cleanup of cleanupFns) {
244178
+ cleanup();
244179
+ }
244180
+ }
244181
+ }
244182
+ // src/cli/dev/dev-server/function-manager.ts
244183
+ var __dirname5 = dirname12(fileURLToPath7(import.meta.url));
244088
244184
  var WRAPPER_PATH = join15(__dirname5, "../deno-runtime/main.js");
244089
244185
  var READY_TIMEOUT = 30000;
244090
244186
 
@@ -244097,15 +244193,7 @@ class FunctionManager {
244097
244193
  this.functions = new Map(functions.map((f7) => [f7.name, f7]));
244098
244194
  this.logger = logger;
244099
244195
  if (functions.length > 0) {
244100
- this.verifyDenoIsInstalled();
244101
- }
244102
- }
244103
- verifyDenoIsInstalled() {
244104
- const result = spawnSync2("deno", ["--version"]);
244105
- if (result.error) {
244106
- throw new DependencyNotFoundError("Deno is required to run functions", {
244107
- hints: [{ message: "Install Deno from https://deno.com/download" }]
244108
- });
244196
+ verifyDenoInstalled();
244109
244197
  }
244110
244198
  }
244111
244199
  getFunctionNames() {
@@ -244168,7 +244256,7 @@ class FunctionManager {
244168
244256
  }
244169
244257
  spawnFunction(func, port) {
244170
244258
  this.logger.log(`Spawning function "${func.name}" on port ${port}`);
244171
- const process21 = spawn2("deno", ["run", "--allow-all", WRAPPER_PATH], {
244259
+ const process21 = spawn3("deno", ["run", "--allow-all", WRAPPER_PATH], {
244172
244260
  env: {
244173
244261
  ...globalThis.process.env,
244174
244262
  FUNCTION_PATH: func.entryPath,
@@ -244206,7 +244294,7 @@ class FunctionManager {
244206
244294
  });
244207
244295
  }
244208
244296
  waitForReady(name2, runningFunc) {
244209
- return new Promise((resolve6, reject) => {
244297
+ return new Promise((resolve7, reject) => {
244210
244298
  runningFunc.process.on("exit", (code2) => {
244211
244299
  if (!runningFunc.ready) {
244212
244300
  clearTimeout(timeout3);
@@ -244229,7 +244317,7 @@ class FunctionManager {
244229
244317
  runningFunc.ready = true;
244230
244318
  clearTimeout(timeout3);
244231
244319
  runningFunc.process.stdout?.off("data", onData);
244232
- resolve6(runningFunc.port);
244320
+ resolve7(runningFunc.port);
244233
244321
  }
244234
244322
  };
244235
244323
  runningFunc.process.stdout?.on("data", onData);
@@ -244286,9 +244374,8 @@ function createFunctionRouter(manager, logger) {
244286
244374
  var import_nedb = __toESM(require_nedb(), 1);
244287
244375
 
244288
244376
  class Database {
244289
- collections;
244290
- constructor(entities) {
244291
- this.collections = new Map;
244377
+ collections = new Map;
244378
+ load(entities) {
244292
244379
  for (const entity2 of entities) {
244293
244380
  this.collections.set(entity2.name, new import_nedb.default);
244294
244381
  }
@@ -244299,6 +244386,12 @@ class Database {
244299
244386
  getCollectionNames() {
244300
244387
  return Array.from(this.collections.keys());
244301
244388
  }
244389
+ dropAll() {
244390
+ for (const collection of this.collections.values()) {
244391
+ collection.remove({}, { multi: true });
244392
+ }
244393
+ this.collections.clear();
244394
+ }
244302
244395
  }
244303
244396
 
244304
244397
  // node_modules/socket.io/wrapper.mjs
@@ -244581,7 +244674,7 @@ function createEntityRoutes(db2, logger, remoteProxy, broadcast) {
244581
244674
  // src/cli/dev/dev-server/routes/integrations.ts
244582
244675
  var import_express3 = __toESM(require_express(), 1);
244583
244676
  var import_multer = __toESM(require_multer(), 1);
244584
- import { randomUUID as randomUUID2 } from "node:crypto";
244677
+ import { randomUUID as randomUUID4 } from "node:crypto";
244585
244678
  import fs28 from "node:fs";
244586
244679
  import path18 from "node:path";
244587
244680
  function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
@@ -244592,7 +244685,7 @@ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
244592
244685
  destination: mediaFilesDir,
244593
244686
  filename: (_req, file2, cb2) => {
244594
244687
  const ext = path18.extname(file2.originalname);
244595
- cb2(null, `${randomUUID2()}${ext}`);
244688
+ cb2(null, `${randomUUID4()}${ext}`);
244596
244689
  }
244597
244690
  });
244598
244691
  const MAX_FILE_SIZE = 50 * 1024 * 1024;
@@ -244619,7 +244712,7 @@ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
244619
244712
  res.status(400).json({ error: "file_uri is required" });
244620
244713
  return;
244621
244714
  }
244622
- const signature = randomUUID2();
244715
+ const signature = randomUUID4();
244623
244716
  const signed_url = `${baseUrl}/media/${file_uri}?signature=${signature}`;
244624
244717
  res.json({ signed_url });
244625
244718
  });
@@ -244654,7 +244747,7 @@ function createCustomIntegrationRoutes(remoteProxy, logger) {
244654
244747
 
244655
244748
  // src/cli/dev/dev-server/watcher.ts
244656
244749
  import { EventEmitter as EventEmitter4 } from "node:events";
244657
- import { relative as relative4 } from "node:path";
244750
+ import { relative as relative6 } from "node:path";
244658
244751
 
244659
244752
  // node_modules/chokidar/index.js
244660
244753
  import { EventEmitter as EventEmitter3 } from "node:events";
@@ -245384,9 +245477,9 @@ class NodeFsHandler {
245384
245477
  if (this.fsw.closed) {
245385
245478
  return;
245386
245479
  }
245387
- const dirname13 = sp2.dirname(file2);
245480
+ const dirname14 = sp2.dirname(file2);
245388
245481
  const basename5 = sp2.basename(file2);
245389
- const parent = this.fsw._getWatchedDir(dirname13);
245482
+ const parent = this.fsw._getWatchedDir(dirname14);
245390
245483
  let prevStats = stats;
245391
245484
  if (parent.has(basename5))
245392
245485
  return;
@@ -245413,7 +245506,7 @@ class NodeFsHandler {
245413
245506
  prevStats = newStats2;
245414
245507
  }
245415
245508
  } catch (error48) {
245416
- this.fsw._remove(dirname13, basename5);
245509
+ this.fsw._remove(dirname14, basename5);
245417
245510
  }
245418
245511
  } else if (parent.has(basename5)) {
245419
245512
  const at13 = newStats.atimeMs;
@@ -245502,7 +245595,7 @@ class NodeFsHandler {
245502
245595
  this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
245503
245596
  }
245504
245597
  }).on(EV.ERROR, this._boundHandleError);
245505
- return new Promise((resolve7, reject) => {
245598
+ return new Promise((resolve8, reject) => {
245506
245599
  if (!stream)
245507
245600
  return reject();
245508
245601
  stream.once(STR_END, () => {
@@ -245511,7 +245604,7 @@ class NodeFsHandler {
245511
245604
  return;
245512
245605
  }
245513
245606
  const wasThrottled = throttler ? throttler.clear() : false;
245514
- resolve7(undefined);
245607
+ resolve8(undefined);
245515
245608
  previous.getChildren().filter((item) => {
245516
245609
  return item !== directory && !current.has(item);
245517
245610
  }).forEach((item) => {
@@ -245636,11 +245729,11 @@ function createPattern(matcher) {
245636
245729
  if (matcher.path === string4)
245637
245730
  return true;
245638
245731
  if (matcher.recursive) {
245639
- const relative4 = sp3.relative(matcher.path, string4);
245640
- if (!relative4) {
245732
+ const relative6 = sp3.relative(matcher.path, string4);
245733
+ if (!relative6) {
245641
245734
  return false;
245642
245735
  }
245643
- return !relative4.startsWith("..") && !sp3.isAbsolute(relative4);
245736
+ return !relative6.startsWith("..") && !sp3.isAbsolute(relative6);
245644
245737
  }
245645
245738
  return false;
245646
245739
  };
@@ -246275,79 +246368,74 @@ var WATCH_QUEUE_DELAY_MS = 500;
246275
246368
  class WatchBase44 extends EventEmitter4 {
246276
246369
  itemsToWatch;
246277
246370
  logger;
246278
- watchers = [];
246279
- queueWaitForCreation = [];
246371
+ entryNames;
246372
+ watchers = new Map;
246280
246373
  queueWaitForCreationTimeout = null;
246281
246374
  constructor(itemsToWatch, logger) {
246282
246375
  super();
246283
246376
  this.itemsToWatch = itemsToWatch;
246284
246377
  this.logger = logger;
246378
+ this.entryNames = Object.keys(itemsToWatch);
246285
246379
  }
246286
246380
  async start() {
246287
- if (this.watchers.length > 0 || this.queueWaitForCreation.length > 0) {
246381
+ if (this.watchers.size > 0) {
246288
246382
  return;
246289
246383
  }
246290
- for (const item of this.itemsToWatch) {
246291
- if (await pathExists(item.path)) {
246292
- this.watchers.push(this.watchTarget(item));
246293
- } else {
246294
- this.queueWaitForCreation.push(item);
246384
+ for (const name2 of this.entryNames) {
246385
+ const targetPath = this.itemsToWatch[name2];
246386
+ if (await pathExists(targetPath)) {
246387
+ this.watchers.set(name2, this.watchTarget(name2, targetPath));
246295
246388
  }
246296
246389
  }
246297
- this.watchCreationQueue();
246390
+ this.watchEntries();
246298
246391
  }
246299
246392
  async close() {
246300
246393
  if (this.queueWaitForCreationTimeout) {
246301
246394
  clearTimeout(this.queueWaitForCreationTimeout);
246302
246395
  this.queueWaitForCreationTimeout = null;
246303
246396
  }
246304
- for (const watcher of this.watchers) {
246397
+ for (const watcher of this.watchers.values()) {
246305
246398
  await watcher.close();
246306
246399
  }
246307
- this.watchers = [];
246308
- this.queueWaitForCreation = [];
246400
+ this.watchers.clear();
246309
246401
  }
246310
- watchCreationQueue() {
246402
+ watchEntries() {
246311
246403
  if (this.queueWaitForCreationTimeout) {
246312
246404
  clearTimeout(this.queueWaitForCreationTimeout);
246313
246405
  }
246314
246406
  this.queueWaitForCreationTimeout = setTimeout(async () => {
246315
- const toRemove = [];
246316
- for (const entry of this.queueWaitForCreation) {
246317
- if (await pathExists(entry.path)) {
246318
- this.watchers.push(this.watchTarget(entry));
246319
- toRemove.push(entry);
246407
+ for (const name2 of this.entryNames) {
246408
+ const path19 = this.itemsToWatch[name2];
246409
+ const watchItem = this.watchers.get(name2);
246410
+ const exists = await pathExists(path19);
246411
+ if (!watchItem && exists) {
246412
+ this.emit("change", name2, path19);
246413
+ this.watchers.set(name2, this.watchTarget(name2, path19));
246414
+ } else if (watchItem && !exists) {
246415
+ await watchItem.close();
246416
+ this.emit("change", name2, path19);
246417
+ setTimeout(() => {
246418
+ this.watchers.forEach((watcher, watcherName) => {
246419
+ if (watcher.closed) {
246420
+ this.watchers.delete(watcherName);
246421
+ }
246422
+ });
246423
+ });
246320
246424
  }
246321
246425
  }
246322
- this.queueWaitForCreation = this.queueWaitForCreation.filter((entry) => !toRemove.includes(entry));
246323
- if (this.queueWaitForCreation.length > 0) {
246324
- this.watchCreationQueue();
246325
- } else {
246326
- this.queueWaitForCreationTimeout = null;
246327
- }
246426
+ this.queueWaitForCreationTimeout = null;
246427
+ this.watchEntries();
246328
246428
  }, WATCH_QUEUE_DELAY_MS);
246329
246429
  }
246330
- watchTarget(item) {
246331
- const handler = import_debounce.default(async (_event, path19) => {
246332
- this.emit("change", item.name, relative4(item.path, path19));
246333
- }, WATCH_DEBOUNCE_MS);
246334
- const watcher = watch(item.path, {
246430
+ watchTarget(name2, targetPath) {
246431
+ const watcher = watch(targetPath, {
246335
246432
  ignoreInitial: true
246336
246433
  });
246337
- watcher.on("all", handler);
246338
- watcher.on("unlinkDir", async (deletedPath) => {
246339
- if (deletedPath !== item.path) {
246340
- return;
246341
- }
246342
- await watcher.close();
246343
- this.queueWaitForCreation.push(item);
246344
- this.watchCreationQueue();
246345
- setTimeout(() => {
246346
- this.watchers = this.watchers.filter((watcher2) => !watcher2.closed);
246347
- });
246348
- });
246434
+ watcher.on("all", import_debounce.default(async (_event, path19) => {
246435
+ this.emit("change", name2, relative6(targetPath, path19));
246436
+ }, WATCH_DEBOUNCE_MS));
246349
246437
  watcher.on("error", (err) => {
246350
- this.logger.error(`Watch handler failed for ${item.path}`, err instanceof Error ? err : undefined);
246438
+ this.logger.error(`Watch handler failed for ${targetPath}`, err instanceof Error ? err : undefined);
246351
246439
  });
246352
246440
  return watcher;
246353
246441
  }
@@ -246385,7 +246473,8 @@ async function createDevServer(options8) {
246385
246473
  if (functionManager.getFunctionNames().length > 0) {
246386
246474
  R2.info(`Loaded functions: ${functionManager.getFunctionNames().join(", ")}`);
246387
246475
  }
246388
- const db2 = new Database(entities);
246476
+ const db2 = new Database;
246477
+ db2.load(entities);
246389
246478
  if (db2.getCollectionNames().length > 0) {
246390
246479
  R2.info(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
246391
246480
  }
@@ -246402,7 +246491,7 @@ async function createDevServer(options8) {
246402
246491
  devLogger.warn(`"${req.originalUrl}" is not supported in local development, passing call to production`);
246403
246492
  remoteProxy(req, res, next);
246404
246493
  });
246405
- const server = await new Promise((resolve8, reject) => {
246494
+ const server = await new Promise((resolve9, reject) => {
246406
246495
  const s5 = app.listen(port, "127.0.0.1", (err) => {
246407
246496
  if (err) {
246408
246497
  if ("code" in err && err.code === "EADDRINUSE") {
@@ -246411,7 +246500,7 @@ async function createDevServer(options8) {
246411
246500
  reject(err);
246412
246501
  }
246413
246502
  } else {
246414
- resolve8(s5);
246503
+ resolve9(s5);
246415
246504
  }
246416
246505
  });
246417
246506
  });
@@ -246419,16 +246508,14 @@ async function createDevServer(options8) {
246419
246508
  emitEntityEvent = (appId, entityName, event) => {
246420
246509
  broadcastEntityEvent(io6, appId, entityName, event);
246421
246510
  };
246422
- const base44ConfigWatcher = new WatchBase44([
246423
- {
246424
- name: "functions",
246425
- path: join18(dirname14(project2.configPath), project2.functionsDir)
246426
- }
246427
- ], devLogger);
246511
+ const base44ConfigWatcher = new WatchBase44({
246512
+ functions: join18(dirname15(project2.configPath), project2.functionsDir),
246513
+ entities: join18(dirname15(project2.configPath), project2.entitiesDir)
246514
+ }, devLogger);
246428
246515
  base44ConfigWatcher.on("change", async (name2) => {
246429
246516
  try {
246517
+ const { functions: functions2, entities: entities2 } = await options8.loadResources();
246430
246518
  if (name2 === "functions") {
246431
- const { functions: functions2 } = await options8.loadResources();
246432
246519
  const previousFunctionCount = functionManager.getFunctionNames().length;
246433
246520
  functionManager.reload(functions2);
246434
246521
  const names = functionManager.getFunctionNames();
@@ -246438,6 +246525,17 @@ async function createDevServer(options8) {
246438
246525
  devLogger.log("All functions removed");
246439
246526
  }
246440
246527
  }
246528
+ if (name2 === "entities") {
246529
+ const previousEntityCount = db2.getCollectionNames().length;
246530
+ db2.dropAll();
246531
+ if (previousEntityCount > 0) {
246532
+ devLogger.log("Entities directory changed, clearing data...");
246533
+ }
246534
+ db2.load(entities2);
246535
+ if (db2.getCollectionNames().length > 0) {
246536
+ devLogger.log(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
246537
+ }
246538
+ }
246441
246539
  } catch (error48) {
246442
246540
  const errorMessage = error48 instanceof Error ? error48.message : String(error48);
246443
246541
  devLogger.error(errorMessage);
@@ -246475,8 +246573,73 @@ function getDevCommand(context) {
246475
246573
  });
246476
246574
  }
246477
246575
 
246576
+ // src/cli/commands/exec.ts
246577
+ import { dirname as dirname16, join as join19 } from "node:path";
246578
+ import { fileURLToPath as fileURLToPath8 } from "node:url";
246579
+ var __dirname6 = dirname16(fileURLToPath8(import.meta.url));
246580
+ var EXEC_WRAPPER_PATH = join19(__dirname6, "../deno-runtime/exec.ts");
246581
+ function readStdin() {
246582
+ return new Promise((resolve9, reject) => {
246583
+ let data = "";
246584
+ process.stdin.setEncoding("utf-8");
246585
+ process.stdin.on("data", (chunk) => {
246586
+ data += chunk;
246587
+ });
246588
+ process.stdin.on("end", () => resolve9(data));
246589
+ process.stdin.on("error", reject);
246590
+ });
246591
+ }
246592
+ function validateInput2(command) {
246593
+ const [scriptArg] = command.args;
246594
+ const { eval: evalCode } = command.opts();
246595
+ const hasStdin = scriptArg === "-";
246596
+ const hasFile = scriptArg !== undefined && !hasStdin;
246597
+ const hasEval = evalCode !== undefined;
246598
+ const inputCount = [hasFile, hasEval, hasStdin].filter(Boolean).length;
246599
+ if (inputCount > 1) {
246600
+ throw new InvalidInputError("Cannot use more than one input mode. Provide only one of: file path, -e, or -.");
246601
+ }
246602
+ if (inputCount === 0) {
246603
+ throw new InvalidInputError("No script provided. Pass a file path, use -e for inline code, or - for stdin.", {
246604
+ hints: [
246605
+ { message: "File: base44 exec ./script.ts" },
246606
+ { message: 'Eval: base44 exec -e "console.log(1)"' },
246607
+ { message: "Stdin: echo 'code' | base44 exec -" }
246608
+ ]
246609
+ });
246610
+ }
246611
+ }
246612
+ async function execAction(scriptArg, options8, extraArgs) {
246613
+ const hasStdin = scriptArg === "-";
246614
+ const hasFile = scriptArg !== undefined && !hasStdin;
246615
+ let code2;
246616
+ if (hasStdin) {
246617
+ code2 = await readStdin();
246618
+ } else if (options8.eval !== undefined) {
246619
+ code2 = options8.eval;
246620
+ }
246621
+ const { exitCode } = await runScript({
246622
+ filePath: hasFile ? scriptArg : undefined,
246623
+ code: code2,
246624
+ extraArgs,
246625
+ execWrapperPath: EXEC_WRAPPER_PATH
246626
+ });
246627
+ if (exitCode !== 0) {
246628
+ process.exitCode = exitCode;
246629
+ }
246630
+ return {};
246631
+ }
246632
+ function getExecCommand(context) {
246633
+ const cmd = new Command("exec").description("Run a script with the Base44 SDK pre-authenticated as the current user").argument("[script]", "Path to a .ts/.js file, or - for stdin").option("-e, --eval <code>", "Evaluate inline code").allowUnknownOption(true).hook("preAction", validateInput2).action(async (script, options8) => {
246634
+ const dashIndex = process.argv.indexOf("--");
246635
+ const extraArgs = dashIndex !== -1 ? process.argv.slice(dashIndex + 1) : [];
246636
+ await runCommand(() => execAction(script, options8, extraArgs), { requireAuth: true }, context);
246637
+ });
246638
+ return cmd;
246639
+ }
246640
+
246478
246641
  // src/cli/commands/project/eject.ts
246479
- import { resolve as resolve8 } from "node:path";
246642
+ import { resolve as resolve9 } from "node:path";
246480
246643
  var import_kebabCase2 = __toESM(require_kebabCase(), 1);
246481
246644
  async function eject(options8) {
246482
246645
  const projects = await listProjects();
@@ -246525,7 +246688,7 @@ async function eject(options8) {
246525
246688
  Ne("Operation cancelled.");
246526
246689
  throw new CLIExitError(0);
246527
246690
  }
246528
- const resolvedPath = resolve8(selectedPath);
246691
+ const resolvedPath = resolve9(selectedPath);
246529
246692
  await runTask("Downloading your project's code...", async (updateMessage) => {
246530
246693
  await createProjectFilesForExistingProject({
246531
246694
  projectId,
@@ -246591,6 +246754,7 @@ function createProgram(context) {
246591
246754
  program2.addCommand(getSecretsCommand(context));
246592
246755
  program2.addCommand(getSiteCommand(context));
246593
246756
  program2.addCommand(getTypesCommand(context));
246757
+ program2.addCommand(getExecCommand(context));
246594
246758
  program2.addCommand(getDevCommand(context), { hidden: true });
246595
246759
  program2.addCommand(getLogsCommand(context), { hidden: true });
246596
246760
  return program2;
@@ -246601,7 +246765,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
246601
246765
  import { release, type } from "node:os";
246602
246766
 
246603
246767
  // node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
246604
- import { dirname as dirname15, posix, sep } from "path";
246768
+ import { dirname as dirname17, posix, sep } from "path";
246605
246769
  function createModulerModifier() {
246606
246770
  const getModuleFromFileName = createGetModuleFromFilename();
246607
246771
  return async (frames) => {
@@ -246610,7 +246774,7 @@ function createModulerModifier() {
246610
246774
  return frames;
246611
246775
  };
246612
246776
  }
246613
- function createGetModuleFromFilename(basePath = process.argv[1] ? dirname15(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
246777
+ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname17(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
246614
246778
  const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
246615
246779
  return (filename) => {
246616
246780
  if (!filename)
@@ -248888,14 +249052,14 @@ async function addSourceContext(frames) {
248888
249052
  return frames;
248889
249053
  }
248890
249054
  function getContextLinesFromFile(path19, ranges, output) {
248891
- return new Promise((resolve9) => {
249055
+ return new Promise((resolve10) => {
248892
249056
  const stream = createReadStream2(path19);
248893
249057
  const lineReaded = createInterface2({
248894
249058
  input: stream
248895
249059
  });
248896
249060
  function destroyStreamAndResolve() {
248897
249061
  stream.destroy();
248898
- resolve9();
249062
+ resolve10();
248899
249063
  }
248900
249064
  let lineNumber = 0;
248901
249065
  let currentRangeIndex = 0;
@@ -249814,9 +249978,9 @@ function matchPropertyGroup(propertyGroup, propertyValues, cohortProperties, deb
249814
249978
  throw new InconclusiveMatchError("can't match cohort without a given cohort property value");
249815
249979
  return propertyGroupType === "AND";
249816
249980
  }
249817
- function isValidRegex(regex2) {
249981
+ function isValidRegex(regex) {
249818
249982
  try {
249819
- new RegExp(regex2);
249983
+ new RegExp(regex);
249820
249984
  return true;
249821
249985
  } catch (err) {
249822
249986
  return false;
@@ -249834,8 +249998,8 @@ function convertToDateTime(value) {
249834
249998
  throw new InconclusiveMatchError(`The date provided ${value} must be a string, number, or date object`);
249835
249999
  }
249836
250000
  function relativeDateParseForFeatureFlagMatching(value) {
249837
- const regex2 = /^-?(?<number>[0-9]+)(?<interval>[a-z])$/;
249838
- const match = value.match(regex2);
250001
+ const regex = /^-?(?<number>[0-9]+)(?<interval>[a-z])$/;
250002
+ const match = value.match(regex);
249839
250003
  const parsedDt = new Date(new Date().toISOString());
249840
250004
  if (!match)
249841
250005
  return null;
@@ -250007,15 +250171,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
250007
250171
  return true;
250008
250172
  if (this.featureFlagsPoller === undefined)
250009
250173
  return false;
250010
- return new Promise((resolve9) => {
250174
+ return new Promise((resolve10) => {
250011
250175
  const timeout3 = setTimeout(() => {
250012
250176
  cleanup();
250013
- resolve9(false);
250177
+ resolve10(false);
250014
250178
  }, timeoutMs);
250015
250179
  const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
250016
250180
  clearTimeout(timeout3);
250017
250181
  cleanup();
250018
- resolve9(count2 > 0);
250182
+ resolve10(count2 > 0);
250019
250183
  });
250020
250184
  });
250021
250185
  }
@@ -250828,4 +250992,4 @@ export {
250828
250992
  CLIExitError
250829
250993
  };
250830
250994
 
250831
- //# debugId=BFC56E0BF807E18264756E2164756E21
250995
+ //# debugId=36A3D3D037267E4264756E2164756E21