@base44-preview/cli 0.0.51-pr.484.9abd5e2 → 0.0.51-pr.503.1ae2818

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
@@ -988,7 +988,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
988
988
  this._exitCallback = (err) => {
989
989
  if (err.code !== "commander.executeSubCommandAsync") {
990
990
  throw err;
991
- } else {}
991
+ }
992
992
  };
993
993
  }
994
994
  return this;
@@ -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
- var resolve = path11.resolve;
8939
- var includePath = resolve(isDir ? filename : dirname6(filename), name2);
8938
+ var resolve2 = path11.resolve;
8939
+ var includePath = resolve2(isDir ? filename : dirname7(filename), name2);
8940
8940
  var ext = extname(name2);
8941
8941
  if (!ext) {
8942
8942
  includePath += ".ejs";
@@ -9011,10 +9011,10 @@ var require_ejs = __commonJS((exports) => {
9011
9011
  var result;
9012
9012
  if (!cb) {
9013
9013
  if (typeof exports.promiseImpl == "function") {
9014
- return new exports.promiseImpl(function(resolve, reject) {
9014
+ return new exports.promiseImpl(function(resolve2, reject) {
9015
9015
  try {
9016
9016
  result = handleCache(options)(data);
9017
- resolve(result);
9017
+ resolve2(result);
9018
9018
  } catch (err) {
9019
9019
  reject(err);
9020
9020
  }
@@ -12452,12 +12452,12 @@ var require_isexe = __commonJS((exports, module) => {
12452
12452
  if (typeof Promise !== "function") {
12453
12453
  throw new TypeError("callback not provided");
12454
12454
  }
12455
- return new Promise(function(resolve2, reject) {
12455
+ return new Promise(function(resolve3, reject) {
12456
12456
  isexe(path11, options || {}, function(er, is) {
12457
12457
  if (er) {
12458
12458
  reject(er);
12459
12459
  } else {
12460
- resolve2(is);
12460
+ resolve3(is);
12461
12461
  }
12462
12462
  });
12463
12463
  });
@@ -12519,27 +12519,27 @@ var require_which = __commonJS((exports, module) => {
12519
12519
  opt = {};
12520
12520
  const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
12521
12521
  const found = [];
12522
- const step = (i) => new Promise((resolve2, reject) => {
12522
+ const step = (i) => new Promise((resolve3, reject) => {
12523
12523
  if (i === pathEnv.length)
12524
- return opt.all && found.length ? resolve2(found) : reject(getNotFoundError(cmd));
12524
+ return opt.all && found.length ? resolve3(found) : reject(getNotFoundError(cmd));
12525
12525
  const ppRaw = pathEnv[i];
12526
12526
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
12527
12527
  const pCmd = path11.join(pathPart, cmd);
12528
12528
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
12529
- resolve2(subStep(p, i, 0));
12529
+ resolve3(subStep(p, i, 0));
12530
12530
  });
12531
- const subStep = (p, i, ii) => new Promise((resolve2, reject) => {
12531
+ const subStep = (p, i, ii) => new Promise((resolve3, reject) => {
12532
12532
  if (ii === pathExt.length)
12533
- return resolve2(step(i + 1));
12533
+ return resolve3(step(i + 1));
12534
12534
  const ext = pathExt[ii];
12535
12535
  isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
12536
12536
  if (!er && is) {
12537
12537
  if (opt.all)
12538
12538
  found.push(p + ext);
12539
12539
  else
12540
- return resolve2(p + ext);
12540
+ return resolve3(p + ext);
12541
12541
  }
12542
- return resolve2(subStep(p, i, ii + 1));
12542
+ return resolve3(subStep(p, i, ii + 1));
12543
12543
  });
12544
12544
  });
12545
12545
  return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
@@ -16067,7 +16067,7 @@ var require_lodash = __commonJS((exports, module) => {
16067
16067
  }
16068
16068
  return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
16069
16069
  });
16070
- function join12(array2, separator) {
16070
+ function join13(array2, separator) {
16071
16071
  return array2 == null ? "" : nativeJoin.call(array2, separator);
16072
16072
  }
16073
16073
  function last(array2) {
@@ -17999,7 +17999,7 @@ __p += '`;
17999
17999
  lodash.isUndefined = isUndefined;
18000
18000
  lodash.isWeakMap = isWeakMap;
18001
18001
  lodash.isWeakSet = isWeakSet;
18002
- lodash.join = join12;
18002
+ lodash.join = join13;
18003
18003
  lodash.kebabCase = kebabCase;
18004
18004
  lodash.last = last;
18005
18005
  lodash.lastIndexOf = lastIndexOf;
@@ -27503,7 +27503,7 @@ function cleanDoc(doc2) {
27503
27503
  return mapDoc(doc2, (currentDoc) => cleanDocFn(currentDoc));
27504
27504
  }
27505
27505
  function replaceEndOfLine(doc2, replacement = literalline) {
27506
- return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ? join20(replacement, currentDoc.split(`
27506
+ return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ? join21(replacement, currentDoc.split(`
27507
27507
  `)) : currentDoc);
27508
27508
  }
27509
27509
  function canBreakFn(doc2) {
@@ -27583,7 +27583,7 @@ function indentIfBreak(contents, options) {
27583
27583
  negate: options.negate
27584
27584
  };
27585
27585
  }
27586
- function join20(separator, docs) {
27586
+ function join21(separator, docs) {
27587
27587
  assertDoc(separator);
27588
27588
  assertDocArray(docs);
27589
27589
  const parts = [];
@@ -28294,7 +28294,7 @@ var init_doc = __esm(() => {
28294
28294
  MODE_FLAT = Symbol("MODE_FLAT");
28295
28295
  DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
28296
28296
  builders = {
28297
- join: join20,
28297
+ join: join21,
28298
28298
  line,
28299
28299
  softline,
28300
28300
  hardline,
@@ -115559,7 +115559,7 @@ import { fileURLToPath as fileURLToPath22 } from "url";
115559
115559
  import v8 from "v8";
115560
115560
  import assert22 from "assert";
115561
115561
  import { format as format2, inspect as inspect3 } from "util";
115562
- import { createRequire as createRequire2 } from "module";
115562
+ import { createRequire as createRequire3 } from "module";
115563
115563
  import { equal, ok, strictEqual } from "assert";
115564
115564
  import path112 from "path";
115565
115565
  import { fileURLToPath as fileURLToPath52 } from "url";
@@ -118133,7 +118133,7 @@ function importFromFile(specifier, parent) {
118133
118133
  return import(url3);
118134
118134
  }
118135
118135
  function requireFromFile(id2, parent) {
118136
- const require22 = createRequire2(parent);
118136
+ const require22 = createRequire3(parent);
118137
118137
  return require22(id2);
118138
118138
  }
118139
118139
  async function loadExternalConfig(externalConfig, configFile) {
@@ -133208,7 +133208,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
133208
133208
  return mapDoc2(doc2, (currentDoc) => cleanDocFn2(currentDoc));
133209
133209
  }
133210
133210
  function replaceEndOfLine2(doc2, replacement = literalline2) {
133211
- return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ? join22(replacement, currentDoc.split(`
133211
+ return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ? join23(replacement, currentDoc.split(`
133212
133212
  `)) : currentDoc);
133213
133213
  }
133214
133214
  function canBreakFn2(doc2) {
@@ -133294,7 +133294,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
133294
133294
  negate: options8.negate
133295
133295
  };
133296
133296
  }
133297
- function join22(separator, docs) {
133297
+ function join23(separator, docs) {
133298
133298
  assertDoc2(separator);
133299
133299
  assertDocArray2(docs);
133300
133300
  const parts = [];
@@ -133959,7 +133959,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
133959
133959
  }
133960
133960
  }
133961
133961
  var builders2 = {
133962
- join: join22,
133962
+ join: join23,
133963
133963
  line: line3,
133964
133964
  softline: softline2,
133965
133965
  hardline: hardline4,
@@ -134606,7 +134606,7 @@ var require_prettier = __commonJS((exports, module) => {
134606
134606
  prettier.util = (init_public(), __toCommonJS(public_exports3));
134607
134607
  prettier.doc = require_doc();
134608
134608
  prettier.version = (init_version_evaluate(), __toCommonJS(version_evaluate_exports)).default;
134609
- } else {}
134609
+ }
134610
134610
  module.exports = prettier;
134611
134611
  });
134612
134612
 
@@ -134614,11 +134614,11 @@ var require_prettier = __commonJS((exports, module) => {
134614
134614
  var require_formatter = __commonJS((exports) => {
134615
134615
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
134616
134616
  function adopt(value) {
134617
- return value instanceof P9 ? value : new P9(function(resolve8) {
134618
- resolve8(value);
134617
+ return value instanceof P9 ? value : new P9(function(resolve9) {
134618
+ resolve9(value);
134619
134619
  });
134620
134620
  }
134621
- return new (P9 || (P9 = Promise))(function(resolve8, reject) {
134621
+ return new (P9 || (P9 = Promise))(function(resolve9, reject) {
134622
134622
  function fulfilled(value) {
134623
134623
  try {
134624
134624
  step(generator.next(value));
@@ -134634,7 +134634,7 @@ var require_formatter = __commonJS((exports) => {
134634
134634
  }
134635
134635
  }
134636
134636
  function step(result) {
134637
- result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected);
134637
+ result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected);
134638
134638
  }
134639
134639
  step((generator = generator.apply(thisArg, _arguments || [])).next());
134640
134640
  });
@@ -139287,7 +139287,7 @@ var require_url = __commonJS((exports) => {
139287
139287
  };
139288
139288
  Object.defineProperty(exports, "__esModule", { value: true });
139289
139289
  exports.parse = undefined;
139290
- exports.resolve = resolve8;
139290
+ exports.resolve = resolve9;
139291
139291
  exports.cwd = cwd;
139292
139292
  exports.getProtocol = getProtocol;
139293
139293
  exports.getExtension = getExtension;
@@ -139315,7 +139315,7 @@ var require_url = __commonJS((exports) => {
139315
139315
  var urlDecodePatterns = [/%23/g, "#", /%24/g, "$", /%26/g, "&", /%2C/g, ",", /%40/g, "@"];
139316
139316
  var parse11 = (u4) => new URL(u4);
139317
139317
  exports.parse = parse11;
139318
- function resolve8(from, to5) {
139318
+ function resolve9(from, to5) {
139319
139319
  const fromUrl = new URL((0, convert_path_to_posix_1.default)(from), "https://aaa.nonexistanturl.com");
139320
139320
  const resolvedUrl = new URL((0, convert_path_to_posix_1.default)(to5), fromUrl);
139321
139321
  const endSpaces = to5.match(/(\s*)$/)?.[1] || "";
@@ -139451,7 +139451,7 @@ var require_url = __commonJS((exports) => {
139451
139451
  }
139452
139452
  function relative4(from, to5) {
139453
139453
  if (!isFileSystemPath(from) || !isFileSystemPath(to5)) {
139454
- return resolve8(from, to5);
139454
+ return resolve9(from, to5);
139455
139455
  }
139456
139456
  const fromDir = path_1.default.dirname(stripHash(from));
139457
139457
  const toPath4 = stripHash(to5);
@@ -140127,7 +140127,7 @@ var require_plugins = __commonJS((exports) => {
140127
140127
  let plugin;
140128
140128
  let lastError;
140129
140129
  let index = 0;
140130
- return new Promise((resolve8, reject) => {
140130
+ return new Promise((resolve9, reject) => {
140131
140131
  runNextPlugin();
140132
140132
  function runNextPlugin() {
140133
140133
  plugin = plugins[index++];
@@ -140155,7 +140155,7 @@ var require_plugins = __commonJS((exports) => {
140155
140155
  }
140156
140156
  }
140157
140157
  function onSuccess(result) {
140158
- resolve8({
140158
+ resolve9({
140159
140159
  plugin,
140160
140160
  result
140161
140161
  });
@@ -141488,11 +141488,11 @@ var require_lib3 = __commonJS((exports) => {
141488
141488
  var require_resolver = __commonJS((exports) => {
141489
141489
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
141490
141490
  function adopt(value) {
141491
- return value instanceof P9 ? value : new P9(function(resolve8) {
141492
- resolve8(value);
141491
+ return value instanceof P9 ? value : new P9(function(resolve9) {
141492
+ resolve9(value);
141493
141493
  });
141494
141494
  }
141495
- return new (P9 || (P9 = Promise))(function(resolve8, reject) {
141495
+ return new (P9 || (P9 = Promise))(function(resolve9, reject) {
141496
141496
  function fulfilled(value) {
141497
141497
  try {
141498
141498
  step(generator.next(value));
@@ -141508,7 +141508,7 @@ var require_resolver = __commonJS((exports) => {
141508
141508
  }
141509
141509
  }
141510
141510
  function step(result) {
141511
- result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected);
141511
+ result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected);
141512
141512
  }
141513
141513
  step((generator = generator.apply(thisArg, _arguments || [])).next());
141514
141514
  });
@@ -141629,11 +141629,11 @@ var require_optionValidator = __commonJS((exports) => {
141629
141629
  var require_src3 = __commonJS((exports) => {
141630
141630
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
141631
141631
  function adopt(value) {
141632
- return value instanceof P9 ? value : new P9(function(resolve8) {
141633
- resolve8(value);
141632
+ return value instanceof P9 ? value : new P9(function(resolve9) {
141633
+ resolve9(value);
141634
141634
  });
141635
141635
  }
141636
- return new (P9 || (P9 = Promise))(function(resolve8, reject) {
141636
+ return new (P9 || (P9 = Promise))(function(resolve9, reject) {
141637
141637
  function fulfilled(value) {
141638
141638
  try {
141639
141639
  step(generator.next(value));
@@ -141649,7 +141649,7 @@ var require_src3 = __commonJS((exports) => {
141649
141649
  }
141650
141650
  }
141651
141651
  function step(result) {
141652
- result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected);
141652
+ result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected);
141653
141653
  }
141654
141654
  step((generator = generator.apply(thisArg, _arguments || [])).next());
141655
141655
  });
@@ -145360,7 +145360,7 @@ var require_dbcs_codec = __commonJS((exports) => {
145360
145360
  if (resCode !== undefined) {
145361
145361
  dbcsCode = resCode;
145362
145362
  nextChar = uCode;
145363
- } else {}
145363
+ }
145364
145364
  }
145365
145365
  seqObj = undefined;
145366
145366
  } else if (uCode >= 0) {
@@ -145425,7 +145425,7 @@ var require_dbcs_codec = __commonJS((exports) => {
145425
145425
  newBuf[j10++] = dbcsCode >> 8;
145426
145426
  newBuf[j10++] = dbcsCode & 255;
145427
145427
  }
145428
- } else {}
145428
+ }
145429
145429
  this.seqObj = undefined;
145430
145430
  }
145431
145431
  if (this.leadSurrogate !== -1) {
@@ -147274,11 +147274,11 @@ var require_raw_body = __commonJS((exports, module) => {
147274
147274
  if (done) {
147275
147275
  return readStream(stream, encoding, length, limit, wrap(done));
147276
147276
  }
147277
- return new Promise(function executor(resolve8, reject) {
147277
+ return new Promise(function executor(resolve9, reject) {
147278
147278
  readStream(stream, encoding, length, limit, function onRead2(err, buf) {
147279
147279
  if (err)
147280
147280
  return reject(err);
147281
- resolve8(buf);
147281
+ resolve9(buf);
147282
147282
  });
147283
147283
  });
147284
147284
  }
@@ -160399,11 +160399,11 @@ var require_view = __commonJS((exports, module) => {
160399
160399
  var debug = require_src4()("express:view");
160400
160400
  var path18 = __require("node:path");
160401
160401
  var fs28 = __require("node:fs");
160402
- var dirname16 = path18.dirname;
160402
+ var dirname17 = path18.dirname;
160403
160403
  var basename4 = path18.basename;
160404
160404
  var extname2 = path18.extname;
160405
- var join23 = path18.join;
160406
- var resolve8 = path18.resolve;
160405
+ var join24 = path18.join;
160406
+ var resolve9 = path18.resolve;
160407
160407
  module.exports = View;
160408
160408
  function View(name2, options8) {
160409
160409
  var opts = options8 || {};
@@ -160437,8 +160437,8 @@ var require_view = __commonJS((exports, module) => {
160437
160437
  debug('lookup "%s"', name2);
160438
160438
  for (var i5 = 0;i5 < roots.length && !path19; i5++) {
160439
160439
  var root2 = roots[i5];
160440
- var loc = resolve8(root2, name2);
160441
- var dir = dirname16(loc);
160440
+ var loc = resolve9(root2, name2);
160441
+ var dir = dirname17(loc);
160442
160442
  var file2 = basename4(loc);
160443
160443
  path19 = this.resolve(dir, file2);
160444
160444
  }
@@ -160462,14 +160462,14 @@ var require_view = __commonJS((exports, module) => {
160462
160462
  });
160463
160463
  sync = false;
160464
160464
  };
160465
- View.prototype.resolve = function resolve9(dir, file2) {
160465
+ View.prototype.resolve = function resolve10(dir, file2) {
160466
160466
  var ext = this.ext;
160467
- var path19 = join23(dir, file2);
160467
+ var path19 = join24(dir, file2);
160468
160468
  var stat2 = tryStat(path19);
160469
160469
  if (stat2 && stat2.isFile()) {
160470
160470
  return path19;
160471
160471
  }
160472
- path19 = join23(dir, basename4(file2, ext), "index" + ext);
160472
+ path19 = join24(dir, basename4(file2, ext), "index" + ext);
160473
160473
  stat2 = tryStat(path19);
160474
160474
  if (stat2 && stat2.isFile()) {
160475
160475
  return path19;
@@ -162621,7 +162621,7 @@ var require_application = __commonJS((exports, module) => {
162621
162621
  var compileETag = require_utils10().compileETag;
162622
162622
  var compileQueryParser = require_utils10().compileQueryParser;
162623
162623
  var compileTrust = require_utils10().compileTrust;
162624
- var resolve8 = __require("node:path").resolve;
162624
+ var resolve9 = __require("node:path").resolve;
162625
162625
  var once9 = require_once();
162626
162626
  var Router = require_router();
162627
162627
  var slice = Array.prototype.slice;
@@ -162675,7 +162675,7 @@ var require_application = __commonJS((exports, module) => {
162675
162675
  this.mountpath = "/";
162676
162676
  this.locals.settings = this.settings;
162677
162677
  this.set("view", View);
162678
- this.set("views", resolve8("views"));
162678
+ this.set("views", resolve9("views"));
162679
162679
  this.set("jsonp callback name", "callback");
162680
162680
  if (env3 === "production") {
162681
162681
  this.enable("view cache");
@@ -164164,9 +164164,9 @@ var require_send = __commonJS((exports, module) => {
164164
164164
  var Stream2 = __require("stream");
164165
164165
  var util2 = __require("util");
164166
164166
  var extname2 = path18.extname;
164167
- var join23 = path18.join;
164167
+ var join24 = path18.join;
164168
164168
  var normalize2 = path18.normalize;
164169
- var resolve8 = path18.resolve;
164169
+ var resolve9 = path18.resolve;
164170
164170
  var sep = path18.sep;
164171
164171
  var BYTES_RANGE_REGEXP = /^ *bytes=/;
164172
164172
  var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000;
@@ -164195,7 +164195,7 @@ var require_send = __commonJS((exports, module) => {
164195
164195
  this._maxage = opts.maxAge || opts.maxage;
164196
164196
  this._maxage = typeof this._maxage === "string" ? ms8(this._maxage) : Number(this._maxage);
164197
164197
  this._maxage = !isNaN(this._maxage) ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) : 0;
164198
- this._root = opts.root ? resolve8(opts.root) : null;
164198
+ this._root = opts.root ? resolve9(opts.root) : null;
164199
164199
  }
164200
164200
  util2.inherits(SendStream, Stream2);
164201
164201
  SendStream.prototype.error = function error48(status, err) {
@@ -164336,7 +164336,7 @@ var require_send = __commonJS((exports, module) => {
164336
164336
  return res;
164337
164337
  }
164338
164338
  parts = path19.split(sep);
164339
- path19 = normalize2(join23(root2, path19));
164339
+ path19 = normalize2(join24(root2, path19));
164340
164340
  } else {
164341
164341
  if (UP_PATH_REGEXP.test(path19)) {
164342
164342
  debug('malicious path "%s"', path19);
@@ -164344,7 +164344,7 @@ var require_send = __commonJS((exports, module) => {
164344
164344
  return res;
164345
164345
  }
164346
164346
  parts = normalize2(path19).split(sep);
164347
- path19 = resolve8(path19);
164347
+ path19 = resolve9(path19);
164348
164348
  }
164349
164349
  if (containsDotFile(parts)) {
164350
164350
  debug('%s dotfile "%s"', this._dotfiles, path19);
@@ -164476,7 +164476,7 @@ var require_send = __commonJS((exports, module) => {
164476
164476
  return self2.onStatError(err);
164477
164477
  return self2.error(404);
164478
164478
  }
164479
- var p4 = join23(path19, self2._index[i5]);
164479
+ var p4 = join24(path19, self2._index[i5]);
164480
164480
  debug('stat "%s"', p4);
164481
164481
  fs28.stat(p4, function(err2, stat2) {
164482
164482
  if (err2)
@@ -164672,7 +164672,7 @@ var require_response = __commonJS((exports, module) => {
164672
164672
  var cookie = require_cookie();
164673
164673
  var send = require_send();
164674
164674
  var extname2 = path18.extname;
164675
- var resolve8 = path18.resolve;
164675
+ var resolve9 = path18.resolve;
164676
164676
  var vary = require_vary();
164677
164677
  var { Buffer: Buffer7 } = __require("node:buffer");
164678
164678
  var res = Object.create(http.ServerResponse.prototype);
@@ -164881,7 +164881,7 @@ var require_response = __commonJS((exports, module) => {
164881
164881
  }
164882
164882
  opts = Object.create(opts);
164883
164883
  opts.headers = headers;
164884
- var fullPath = !opts.root ? resolve8(path19) : path19;
164884
+ var fullPath = !opts.root ? resolve9(path19) : path19;
164885
164885
  return this.sendFile(fullPath, opts, done);
164886
164886
  };
164887
164887
  res.contentType = res.type = function contentType(type) {
@@ -165142,7 +165142,7 @@ var require_serve_static = __commonJS((exports, module) => {
165142
165142
  var encodeUrl = require_encodeurl();
165143
165143
  var escapeHtml = require_escape_html();
165144
165144
  var parseUrl = require_parseurl();
165145
- var resolve8 = __require("path").resolve;
165145
+ var resolve9 = __require("path").resolve;
165146
165146
  var send = require_send();
165147
165147
  var url3 = __require("url");
165148
165148
  module.exports = serveStatic;
@@ -165161,7 +165161,7 @@ var require_serve_static = __commonJS((exports, module) => {
165161
165161
  throw new TypeError("option setHeaders must be function");
165162
165162
  }
165163
165163
  opts.maxage = opts.maxage || opts.maxAge || 0;
165164
- opts.root = resolve8(root2);
165164
+ opts.root = resolve9(root2);
165165
165165
  var onDirectory = redirect ? createRedirectDirectoryListener() : createNotFoundDirectoryListener();
165166
165166
  return function serveStatic2(req, res, next) {
165167
165167
  if (req.method !== "GET" && req.method !== "HEAD") {
@@ -168535,8 +168535,8 @@ var require_executor = __commonJS((exports, module) => {
168535
168535
  }
168536
168536
  resetBuffer() {
168537
168537
  this.buffer = new Waterfall;
168538
- this.buffer.chain(new Promise((resolve8) => {
168539
- this._triggerBuffer = resolve8;
168538
+ this.buffer.chain(new Promise((resolve9) => {
168539
+ this._triggerBuffer = resolve9;
168540
168540
  }));
168541
168541
  if (this.ready)
168542
168542
  this._triggerBuffer();
@@ -169556,7 +169556,7 @@ var require_storage = __commonJS((exports, module) => {
169556
169556
  throw e8;
169557
169557
  }
169558
169558
  };
169559
- var writeFileLinesAsync = (filename, lines, mode = DEFAULT_FILE_MODE) => new Promise((resolve8, reject) => {
169559
+ var writeFileLinesAsync = (filename, lines, mode = DEFAULT_FILE_MODE) => new Promise((resolve9, reject) => {
169560
169560
  try {
169561
169561
  const stream = writeFileStream(filename, { mode });
169562
169562
  const readable2 = Readable6.from(lines);
@@ -169573,7 +169573,7 @@ var require_storage = __commonJS((exports, module) => {
169573
169573
  if (err)
169574
169574
  reject(err);
169575
169575
  else
169576
- resolve8();
169576
+ resolve9();
169577
169577
  });
169578
169578
  });
169579
169579
  readable2.on("error", (err) => {
@@ -169744,7 +169744,7 @@ var require_persistence = __commonJS((exports, module) => {
169744
169744
  return { data: tdata, indexes };
169745
169745
  }
169746
169746
  treatRawStreamAsync(rawStream) {
169747
- return new Promise((resolve8, reject) => {
169747
+ return new Promise((resolve9, reject) => {
169748
169748
  const dataById = {};
169749
169749
  const indexes = {};
169750
169750
  let corruptItems = 0;
@@ -169787,7 +169787,7 @@ var require_persistence = __commonJS((exports, module) => {
169787
169787
  }
169788
169788
  }
169789
169789
  const data = Object.values(dataById);
169790
- resolve8({ data, indexes });
169790
+ resolve9({ data, indexes });
169791
169791
  });
169792
169792
  lineStream.on("error", function(err) {
169793
169793
  reject(err, null);
@@ -190013,7 +190013,7 @@ var require_socket = __commonJS((exports) => {
190013
190013
  } else {
190014
190014
  this.remoteAddress = req.connection.remoteAddress;
190015
190015
  }
190016
- } else {}
190016
+ }
190017
190017
  this.pingTimeoutTimer = null;
190018
190018
  this.pingIntervalTimer = null;
190019
190019
  this.setTransport(transport);
@@ -195398,13 +195398,13 @@ var require_broadcast_operator = __commonJS((exports) => {
195398
195398
  return true;
195399
195399
  }
195400
195400
  emitWithAck(ev2, ...args) {
195401
- return new Promise((resolve8, reject) => {
195401
+ return new Promise((resolve9, reject) => {
195402
195402
  args.push((err, responses) => {
195403
195403
  if (err) {
195404
195404
  err.responses = responses;
195405
195405
  return reject(err);
195406
195406
  } else {
195407
- return resolve8(responses);
195407
+ return resolve9(responses);
195408
195408
  }
195409
195409
  });
195410
195410
  this.emit(ev2, ...args);
@@ -195592,12 +195592,12 @@ var require_socket2 = __commonJS((exports) => {
195592
195592
  }
195593
195593
  emitWithAck(ev2, ...args) {
195594
195594
  const withErr = this.flags.timeout !== undefined;
195595
- return new Promise((resolve8, reject) => {
195595
+ return new Promise((resolve9, reject) => {
195596
195596
  args.push((arg1, arg2) => {
195597
195597
  if (withErr) {
195598
- return arg1 ? reject(arg1) : resolve8(arg2);
195598
+ return arg1 ? reject(arg1) : resolve9(arg2);
195599
195599
  } else {
195600
- return resolve8(arg1);
195600
+ return resolve9(arg1);
195601
195601
  }
195602
195602
  });
195603
195603
  this.emit(ev2, ...args);
@@ -196052,13 +196052,13 @@ var require_namespace = __commonJS((exports) => {
196052
196052
  return true;
196053
196053
  }
196054
196054
  serverSideEmitWithAck(ev2, ...args) {
196055
- return new Promise((resolve8, reject) => {
196055
+ return new Promise((resolve9, reject) => {
196056
196056
  args.push((err, responses) => {
196057
196057
  if (err) {
196058
196058
  err.responses = responses;
196059
196059
  return reject(err);
196060
196060
  } else {
196061
- return resolve8(responses);
196061
+ return resolve9(responses);
196062
196062
  }
196063
196063
  });
196064
196064
  this.serverSideEmit(ev2, ...args);
@@ -196742,7 +196742,7 @@ var require_cluster_adapter = __commonJS((exports) => {
196742
196742
  return localSockets;
196743
196743
  }
196744
196744
  const requestId = randomId();
196745
- return new Promise((resolve8, reject) => {
196745
+ return new Promise((resolve9, reject) => {
196746
196746
  const timeout3 = setTimeout(() => {
196747
196747
  const storedRequest2 = this.requests.get(requestId);
196748
196748
  if (storedRequest2) {
@@ -196752,7 +196752,7 @@ var require_cluster_adapter = __commonJS((exports) => {
196752
196752
  }, opts.flags.timeout || DEFAULT_TIMEOUT);
196753
196753
  const storedRequest = {
196754
196754
  type: MessageType.FETCH_SOCKETS,
196755
- resolve: resolve8,
196755
+ resolve: resolve9,
196756
196756
  timeout: timeout3,
196757
196757
  current: 0,
196758
196758
  expected: expectedResponseCount,
@@ -196962,7 +196962,7 @@ var require_cluster_adapter = __commonJS((exports) => {
196962
196962
  return localSockets;
196963
196963
  }
196964
196964
  const requestId = randomId();
196965
- return new Promise((resolve8, reject) => {
196965
+ return new Promise((resolve9, reject) => {
196966
196966
  const timeout3 = setTimeout(() => {
196967
196967
  const storedRequest2 = this.customRequests.get(requestId);
196968
196968
  if (storedRequest2) {
@@ -196972,7 +196972,7 @@ var require_cluster_adapter = __commonJS((exports) => {
196972
196972
  }, opts.flags.timeout || DEFAULT_TIMEOUT);
196973
196973
  const storedRequest = {
196974
196974
  type: MessageType.FETCH_SOCKETS,
196975
- resolve: resolve8,
196975
+ resolve: resolve9,
196976
196976
  timeout: timeout3,
196977
196977
  missingUids: new Set([...this.nodesMap.keys()]),
196978
196978
  responses: localSockets
@@ -197701,13 +197701,13 @@ var require_dist4 = __commonJS((exports, module) => {
197701
197701
  this.engine.close();
197702
197702
  (0, uws_1.restoreAdapter)();
197703
197703
  if (this.httpServer) {
197704
- return new Promise((resolve8) => {
197704
+ return new Promise((resolve9) => {
197705
197705
  this.httpServer.close((err) => {
197706
197706
  fn9 && fn9(err);
197707
197707
  if (err) {
197708
197708
  debug("server was not running");
197709
197709
  }
197710
- resolve8();
197710
+ resolve9();
197711
197711
  });
197712
197712
  });
197713
197713
  } else {
@@ -214616,7 +214616,7 @@ var require_buffer_list = __commonJS((exports, module) => {
214616
214616
  }
214617
214617
  }, {
214618
214618
  key: "join",
214619
- value: function join23(s5) {
214619
+ value: function join24(s5) {
214620
214620
  if (this.length === 0)
214621
214621
  return "";
214622
214622
  var p4 = this.head;
@@ -215914,14 +215914,14 @@ var require_async_iterator = __commonJS((exports, module) => {
215914
215914
  };
215915
215915
  }
215916
215916
  function readAndResolve(iter) {
215917
- var resolve8 = iter[kLastResolve];
215918
- if (resolve8 !== null) {
215917
+ var resolve9 = iter[kLastResolve];
215918
+ if (resolve9 !== 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
- resolve8(createIterResult(data, false));
215924
+ resolve9(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(resolve8, reject) {
215932
+ return function(resolve9, reject) {
215933
215933
  lastPromise.then(function() {
215934
215934
  if (iter[kEnded]) {
215935
- resolve8(createIterResult(undefined, true));
215935
+ resolve9(createIterResult(undefined, true));
215936
215936
  return;
215937
215937
  }
215938
- iter[kHandlePromise](resolve8, reject);
215938
+ iter[kHandlePromise](resolve9, 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(resolve8, reject) {
215957
+ return new Promise(function(resolve9, reject) {
215958
215958
  process.nextTick(function() {
215959
215959
  if (_this[kError]) {
215960
215960
  reject(_this[kError]);
215961
215961
  } else {
215962
- resolve8(createIterResult(undefined, true));
215962
+ resolve9(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(resolve8, reject) {
215985
+ return new Promise(function(resolve9, reject) {
215986
215986
  _this2[kStream].destroy(null, function(err) {
215987
215987
  if (err) {
215988
215988
  reject(err);
215989
215989
  return;
215990
215990
  }
215991
- resolve8(createIterResult(undefined, true));
215991
+ resolve9(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(resolve8, reject) {
216013
+ value: function value(resolve9, 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
- resolve8(createIterResult(data, false));
216019
+ resolve9(createIterResult(data, false));
216020
216020
  } else {
216021
- iterator[kLastResolve] = resolve8;
216021
+ iterator[kLastResolve] = resolve9;
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 resolve8 = iterator[kLastResolve];
216041
- if (resolve8 !== null) {
216040
+ var resolve9 = iterator[kLastResolve];
216041
+ if (resolve9 !== null) {
216042
216042
  iterator[kLastPromise] = null;
216043
216043
  iterator[kLastResolve] = null;
216044
216044
  iterator[kLastReject] = null;
216045
- resolve8(createIterResult(undefined, true));
216045
+ resolve9(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, resolve8, reject, _next, _throw, key2, arg) {
216057
+ function asyncGeneratorStep(gen, resolve9, 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
- resolve8(value);
216066
+ resolve9(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(resolve8, reject) {
216074
+ return new Promise(function(resolve9, reject) {
216075
216075
  var gen = fn9.apply(self2, args);
216076
216076
  function _next(value) {
216077
- asyncGeneratorStep(gen, resolve8, reject, _next, _throw, "next", value);
216077
+ asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "next", value);
216078
216078
  }
216079
216079
  function _throw(err) {
216080
- asyncGeneratorStep(gen, resolve8, reject, _next, _throw, "throw", err);
216080
+ asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "throw", err);
216081
216081
  }
216082
216082
  _next(undefined);
216083
216083
  });
@@ -218270,7 +218270,7 @@ var require_dist5 = __commonJS((exports, module) => {
218270
218270
  });
218271
218271
 
218272
218272
  // src/cli/index.ts
218273
- import { dirname as dirname20, join as join26 } from "node:path";
218273
+ import { dirname as dirname21, join as join27 } from "node:path";
218274
218274
  import { fileURLToPath as fileURLToPath6 } from "node:url";
218275
218275
 
218276
218276
  // ../../node_modules/@clack/core/dist/index.mjs
@@ -219478,7 +219478,7 @@ var {
219478
219478
  } = import__.default;
219479
219479
 
219480
219480
  // src/cli/commands/agents/pull.ts
219481
- import { dirname as dirname7, join as join12 } from "node:path";
219481
+ import { dirname as dirname8, join as join13 } from "node:path";
219482
219482
  // ../../node_modules/chalk/source/vendor/ansi-styles/index.js
219483
219483
  var ANSI_BACKGROUND_OFFSET = 10;
219484
219484
  var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
@@ -231128,7 +231128,7 @@ function finalize(ctx, schema) {
231128
231128
  result.$schema = "http://json-schema.org/draft-07/schema#";
231129
231129
  } else if (ctx.target === "draft-04") {
231130
231130
  result.$schema = "http://json-schema.org/draft-04/schema#";
231131
- } else if (ctx.target === "openapi-3.0") {} else {}
231131
+ } else if (ctx.target === "openapi-3.0") {}
231132
231132
  if (ctx.external?.uri) {
231133
231133
  const id = ctx.external.registry.get(schema)?.id;
231134
231134
  if (!id)
@@ -231376,7 +231376,7 @@ var literalProcessor = (schema, ctx, json, _params) => {
231376
231376
  if (val === undefined) {
231377
231377
  if (ctx.unrepresentable === "throw") {
231378
231378
  throw new Error("Literal `undefined` cannot be represented in JSON Schema");
231379
- } else {}
231379
+ }
231380
231380
  } else if (typeof val === "bigint") {
231381
231381
  if (ctx.unrepresentable === "throw") {
231382
231382
  throw new Error("BigInt literals cannot be represented in JSON Schema");
@@ -234622,6 +234622,12 @@ var SiteConfigSchema = exports_external.object({
234622
234622
  outputDirectory: exports_external.string().optional(),
234623
234623
  installCommand: exports_external.string().optional()
234624
234624
  });
234625
+ var PluginMetadataSchema = exports_external.object({
234626
+ id: exports_external.string().min(1, "Plugin id cannot be empty").regex(/^[a-zA-Z0-9_-]+$/, "Plugin id can only contain letters, numbers, underscores, and dashes")
234627
+ });
234628
+ var PluginReferenceSchema = exports_external.object({
234629
+ source: exports_external.string().min(1, "Plugin source cannot be empty")
234630
+ });
234625
234631
  var ProjectConfigSchema = exports_external.object({
234626
234632
  name: exports_external.string({
234627
234633
  error: "App name cannot be empty"
@@ -234632,7 +234638,9 @@ var ProjectConfigSchema = exports_external.object({
234632
234638
  functionsDir: exports_external.string().optional().default("functions"),
234633
234639
  agentsDir: exports_external.string().optional().default("agents"),
234634
234640
  connectorsDir: exports_external.string().optional().default("connectors"),
234635
- authDir: exports_external.string().optional().default("auth")
234641
+ authDir: exports_external.string().optional().default("auth"),
234642
+ plugin: PluginMetadataSchema.optional(),
234643
+ plugins: exports_external.array(PluginReferenceSchema).optional().default([])
234636
234644
  });
234637
234645
  var AppConfigSchema = exports_external.object({
234638
234646
  id: exports_external.string().min(1, "id cannot be empty")
@@ -241579,7 +241587,43 @@ var generateGlobTasks = normalizeArguments(generateTasks);
241579
241587
  var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
241580
241588
 
241581
241589
  // src/core/project/config.ts
241582
- import { dirname as dirname5, join as join8 } from "node:path";
241590
+ import { dirname as dirname6, join as join9 } from "node:path";
241591
+
241592
+ // src/core/project/plugins.ts
241593
+ import { createRequire as createRequire2 } from "node:module";
241594
+ import { dirname as dirname3, join as join3, resolve } from "node:path";
241595
+ function resolvePluginRoot(pluginSource, fromRoot) {
241596
+ if (pluginSource.startsWith(".")) {
241597
+ return resolve(fromRoot, pluginSource);
241598
+ }
241599
+ const req = createRequire2(join3(fromRoot, "package.json"));
241600
+ return dirname3(req.resolve(`${pluginSource}/package.json`));
241601
+ }
241602
+ function requirePluginId(project, pluginSource, configPath) {
241603
+ if (!project.plugin?.id) {
241604
+ throw new ConfigInvalidError(`Plugin loaded from "${pluginSource}" must define plugin.id`, configPath);
241605
+ }
241606
+ return project.plugin.id;
241607
+ }
241608
+ function namespacePluginFunctions(functions, pluginId) {
241609
+ return functions.map((fn) => ({
241610
+ ...fn,
241611
+ name: `${pluginId}__${fn.name}`,
241612
+ source: {
241613
+ type: "plugin",
241614
+ id: pluginId
241615
+ }
241616
+ }));
241617
+ }
241618
+ function markPluginEntities(entities, pluginId) {
241619
+ return entities.map((entity) => ({
241620
+ ...entity,
241621
+ source: {
241622
+ type: "plugin",
241623
+ id: pluginId
241624
+ }
241625
+ }));
241626
+ }
241583
241627
 
241584
241628
  // src/core/resources/agent/schema.ts
241585
241629
  var EntityOperationSchema = exports_external.enum(["create", "update", "delete", "read"]);
@@ -241651,7 +241695,7 @@ async function fetchAgents() {
241651
241695
  return result.data;
241652
241696
  }
241653
241697
  // src/core/resources/agent/config.ts
241654
- import { join as join3, normalize } from "node:path";
241698
+ import { join as join4, normalize } from "node:path";
241655
241699
  import { isDeepStrictEqual } from "node:util";
241656
241700
  async function readAgentFile(agentPath) {
241657
241701
  const raw2 = await readJsonFile(agentPath);
@@ -241696,12 +241740,12 @@ async function readAllAgents(agentsDir) {
241696
241740
  return [...nameToEntry.values()].map((e2) => e2.data);
241697
241741
  }
241698
241742
  function findAvailablePath(agentsDir, name2, claimedPaths) {
241699
- const base = join3(agentsDir, `${name2}.${CONFIG_FILE_EXTENSION}`);
241743
+ const base = join4(agentsDir, `${name2}.${CONFIG_FILE_EXTENSION}`);
241700
241744
  if (!claimedPaths.has(base)) {
241701
241745
  return base;
241702
241746
  }
241703
241747
  for (let i = 1;; i++) {
241704
- const candidate = join3(agentsDir, `${name2}_${i}.${CONFIG_FILE_EXTENSION}`);
241748
+ const candidate = join4(agentsDir, `${name2}_${i}.${CONFIG_FILE_EXTENSION}`);
241705
241749
  if (!claimedPaths.has(candidate)) {
241706
241750
  return candidate;
241707
241751
  }
@@ -241847,7 +241891,7 @@ async function pushAuthConfigToApi(config3) {
241847
241891
  return result.data.authConfig;
241848
241892
  }
241849
241893
  // src/core/resources/auth-config/config.ts
241850
- import { join as join4 } from "node:path";
241894
+ import { join as join5 } from "node:path";
241851
241895
  import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
241852
241896
  var AUTH_CONFIG_FILENAME = `config.${CONFIG_FILE_EXTENSION}`;
241853
241897
  var DEFAULT_AUTH_CONFIG = {
@@ -241863,7 +241907,7 @@ var DEFAULT_AUTH_CONFIG = {
241863
241907
  useWorkspaceSSO: false
241864
241908
  };
241865
241909
  function getAuthConfigPath(authDir) {
241866
- return join4(authDir, AUTH_CONFIG_FILENAME);
241910
+ return join5(authDir, AUTH_CONFIG_FILENAME);
241867
241911
  }
241868
241912
  async function readAuthConfig(authDir) {
241869
241913
  const filePath = getAuthConfigPath(authDir);
@@ -242515,7 +242559,7 @@ async function removeStripe() {
242515
242559
  return result.data;
242516
242560
  }
242517
242561
  // src/core/resources/connector/config.ts
242518
- import { join as join5 } from "node:path";
242562
+ import { join as join6 } from "node:path";
242519
242563
  import { isDeepStrictEqual as isDeepStrictEqual3 } from "node:util";
242520
242564
  async function readConnectorFile(connectorPath) {
242521
242565
  const parsed = await readJsonFile(connectorPath);
@@ -242576,7 +242620,7 @@ async function writeConnectors(connectorsDir, remoteConnectors) {
242576
242620
  if (existing && isDeepStrictEqual3(existing.data, connector)) {
242577
242621
  continue;
242578
242622
  }
242579
- const filePath = existing?.filePath ?? join5(connectorsDir, `${connector.type}.${CONFIG_FILE_EXTENSION}`);
242623
+ const filePath = existing?.filePath ?? join6(connectorsDir, `${connector.type}.${CONFIG_FILE_EXTENSION}`);
242580
242624
  await writeJsonFile(filePath, connector);
242581
242625
  written.push(connector.type);
242582
242626
  }
@@ -242731,6 +242775,17 @@ var connectorResource = {
242731
242775
  readAll: readAllConnectors,
242732
242776
  push: pushConnectors
242733
242777
  };
242778
+ // src/core/resources/types.ts
242779
+ var ResourceSourceSchema = exports_external.discriminatedUnion("type", [
242780
+ exports_external.object({
242781
+ type: exports_external.literal("project")
242782
+ }),
242783
+ exports_external.object({
242784
+ type: exports_external.literal("plugin"),
242785
+ id: exports_external.string().min(1, "Plugin id cannot be empty")
242786
+ })
242787
+ ]);
242788
+
242734
242789
  // src/core/resources/entity/schema.ts
242735
242790
  var FieldConditionSchema = exports_external.union([
242736
242791
  exports_external.string(),
@@ -242837,7 +242892,8 @@ var EntitySchema = exports_external.looseObject({
242837
242892
  description: exports_external.string().optional(),
242838
242893
  properties: exports_external.record(exports_external.string(), PropertyDefinitionSchema).default({}),
242839
242894
  required: exports_external.array(exports_external.string()).optional(),
242840
- rls: EntityRLSSchema.optional()
242895
+ rls: EntityRLSSchema.optional(),
242896
+ source: ResourceSourceSchema.default({ type: "project" })
242841
242897
  });
242842
242898
  var SyncEntitiesResponseSchema = exports_external.object({
242843
242899
  created: exports_external.array(exports_external.string()),
@@ -242848,7 +242904,7 @@ var SyncEntitiesResponseSchema = exports_external.object({
242848
242904
  // src/core/resources/entity/api.ts
242849
242905
  async function syncEntities(entities) {
242850
242906
  const appClient = getAppClient();
242851
- const schemaSyncPayload = Object.fromEntries(entities.map((entity) => [entity.name, entity]));
242907
+ const schemaSyncPayload = Object.fromEntries(entities.map(({ source: _source, ...entity }) => [entity.name, entity]));
242852
242908
  let response;
242853
242909
  try {
242854
242910
  response = await appClient.put("entity-schemas", {
@@ -242884,6 +242940,19 @@ async function readAllEntities(entitiesDir) {
242884
242940
  absolute: true
242885
242941
  });
242886
242942
  const entities = await Promise.all(files.map((filePath) => readEntityFile(filePath)));
242943
+ const names = new Set;
242944
+ for (const entity of entities) {
242945
+ if (names.has(entity.name)) {
242946
+ throw new InvalidInputError(`Duplicate entity name "${entity.name}"`, {
242947
+ hints: [
242948
+ {
242949
+ message: `Remove duplicate entities with name "${entity.name}" - only one entity per name is allowed`
242950
+ }
242951
+ ]
242952
+ });
242953
+ }
242954
+ names.add(entity.name);
242955
+ }
242887
242956
  return entities;
242888
242957
  }
242889
242958
  // src/core/resources/entity/deploy.ts
@@ -242898,6 +242967,57 @@ var entityResource = {
242898
242967
  readAll: readAllEntities,
242899
242968
  push: pushEntities
242900
242969
  };
242970
+ // src/core/resources/entity/merge.ts
242971
+ function mergePluginEntity(pluginEntity, projectEntity, configPath) {
242972
+ const unsupportedFields = [
242973
+ projectEntity.title ? "title" : null,
242974
+ projectEntity.description ? "description" : null,
242975
+ projectEntity.rls ? "rls" : null
242976
+ ].filter(Boolean);
242977
+ if (unsupportedFields.length > 0) {
242978
+ throw new ConfigInvalidError(`Project entity "${projectEntity.name}" extends a plugin entity and cannot override fields: ${unsupportedFields.join(", ")}.`, configPath);
242979
+ }
242980
+ const projectProperties = projectEntity.properties ?? {};
242981
+ const addedPropertyNames = new Set(Object.keys(projectProperties));
242982
+ for (const propertyName of addedPropertyNames) {
242983
+ if (propertyName in pluginEntity.properties) {
242984
+ throw new ConfigInvalidError(`Cannot override plugin-defined property "${propertyName}"`, configPath);
242985
+ }
242986
+ }
242987
+ for (const requiredProperty of projectEntity.required ?? []) {
242988
+ if (!addedPropertyNames.has(requiredProperty)) {
242989
+ throw new ConfigInvalidError(`Required property "${requiredProperty}" must be declared in project entity "${projectEntity.name}" properties`, configPath);
242990
+ }
242991
+ }
242992
+ const required2 = pluginEntity.required || projectEntity.required ? [
242993
+ ...new Set([
242994
+ ...pluginEntity.required ?? [],
242995
+ ...projectEntity.required ?? []
242996
+ ])
242997
+ ] : undefined;
242998
+ return {
242999
+ ...pluginEntity,
243000
+ properties: {
243001
+ ...pluginEntity.properties,
243002
+ ...projectProperties
243003
+ },
243004
+ ...required2 ? { required: required2 } : {}
243005
+ };
243006
+ }
243007
+ function mergeProjectAndPluginEntities(projectEntities, pluginEntities, configPath) {
243008
+ const projectEntitiesByName = new Map(projectEntities.map((entity) => [entity.name, entity]));
243009
+ const pluginEntityNames = new Set(pluginEntities.map((entity) => entity.name));
243010
+ const resolvedPluginEntities = pluginEntities.map((pluginEntity) => {
243011
+ const projectEntity = projectEntitiesByName.get(pluginEntity.name);
243012
+ if (!projectEntity) {
243013
+ return pluginEntity;
243014
+ }
243015
+ return mergePluginEntity(pluginEntity, projectEntity, configPath);
243016
+ });
243017
+ const projectOnlyEntities = projectEntities.filter((entity) => !pluginEntityNames.has(entity.name));
243018
+ return [...resolvedPluginEntities, ...projectOnlyEntities];
243019
+ }
243020
+
242901
243021
  // src/core/resources/function/schema.ts
242902
243022
  var FunctionNameSchema = exports_external.string().trim().min(1, "Function name cannot be empty").regex(/^[^.]+$/, "Function name cannot contain dots");
242903
243023
  var FunctionFileSchema = exports_external.object({
@@ -242995,7 +243115,8 @@ var FunctionConfigSchema = exports_external.object({
242995
243115
  });
242996
243116
  var BackendFunctionSchema = FunctionConfigSchema.extend({
242997
243117
  entryPath: exports_external.string().min(1, "Entry path cannot be empty"),
242998
- filePaths: exports_external.array(exports_external.string()).min(1, "Function must have at least one file")
243118
+ filePaths: exports_external.array(exports_external.string()).min(1, "Function must have at least one file"),
243119
+ source: ResourceSourceSchema
242999
243120
  });
243000
243121
  var DeploySingleFunctionResponseSchema = exports_external.object({
243001
243122
  status: exports_external.enum(["deployed", "unchanged"])
@@ -243100,7 +243221,7 @@ async function fetchFunctionLogs(functionName, filters = {}) {
243100
243221
  return result.data;
243101
243222
  }
243102
243223
  // src/core/resources/function/config.ts
243103
- import { basename as basename2, dirname as dirname3, join as join6, relative } from "node:path";
243224
+ import { basename as basename2, dirname as dirname4, join as join7, relative } from "node:path";
243104
243225
  async function readFunctionConfig(configPath) {
243105
243226
  const parsed = await readJsonFile(configPath);
243106
243227
  const result = FunctionConfigSchema.safeParse(parsed);
@@ -243111,8 +243232,8 @@ async function readFunctionConfig(configPath) {
243111
243232
  }
243112
243233
  async function readFunction(configPath) {
243113
243234
  const config6 = await readFunctionConfig(configPath);
243114
- const functionDir = dirname3(configPath);
243115
- const entryPath = join6(functionDir, config6.entry);
243235
+ const functionDir = dirname4(configPath);
243236
+ const entryPath = join7(functionDir, config6.entry);
243116
243237
  if (!await pathExists(entryPath)) {
243117
243238
  throw new InvalidInputError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`, {
243118
243239
  hints: [{ message: "Check the 'entry' field in your function config" }]
@@ -243122,7 +243243,12 @@ async function readFunction(configPath) {
243122
243243
  cwd: functionDir,
243123
243244
  absolute: true
243124
243245
  });
243125
- const functionData = { ...config6, entryPath, filePaths };
243246
+ const functionData = {
243247
+ ...config6,
243248
+ entryPath,
243249
+ filePaths,
243250
+ source: { type: "project" }
243251
+ };
243126
243252
  return functionData;
243127
243253
  }
243128
243254
  async function readAllFunctions(functionsDir) {
@@ -243138,11 +243264,11 @@ async function readAllFunctions(functionsDir) {
243138
243264
  absolute: true,
243139
243265
  ignore: ENTRY_IGNORE_DOT_PATHS
243140
243266
  });
243141
- const configFilesDirs = new Set(configFiles.map((f) => dirname3(f)));
243142
- const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(dirname3(entryFile)));
243267
+ const configFilesDirs = new Set(configFiles.map((f) => dirname4(f)));
243268
+ const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(dirname4(entryFile)));
243143
243269
  const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
243144
243270
  const functionsWithoutConfig = await Promise.all(entryFilesWithoutConfig.map(async (entryFile) => {
243145
- const functionDir = dirname3(entryFile);
243271
+ const functionDir = dirname4(entryFile);
243146
243272
  const filePaths = await globby("**/*.{js,ts,json}", {
243147
243273
  cwd: functionDir,
243148
243274
  absolute: true
@@ -243158,7 +243284,14 @@ async function readAllFunctions(functionsDir) {
243158
243284
  });
243159
243285
  }
243160
243286
  const entry = basename2(entryFile);
243161
- return { name: name2, entry, entryPath: entryFile, filePaths };
243287
+ const functionData = {
243288
+ name: name2,
243289
+ entry,
243290
+ entryPath: entryFile,
243291
+ filePaths,
243292
+ source: { type: "project" }
243293
+ };
243294
+ return functionData;
243162
243295
  }));
243163
243296
  const functions = [...functionsFromConfig, ...functionsWithoutConfig];
243164
243297
  const names = new Set;
@@ -243177,9 +243310,9 @@ async function readAllFunctions(functionsDir) {
243177
243310
  return functions;
243178
243311
  }
243179
243312
  // src/core/resources/function/deploy.ts
243180
- import { dirname as dirname4, relative as relative2 } from "node:path";
243313
+ import { dirname as dirname5, relative as relative2 } from "node:path";
243181
243314
  async function loadFunctionCode(fn) {
243182
- const functionDir = dirname4(fn.entryPath);
243315
+ const functionDir = dirname5(fn.entryPath);
243183
243316
  const resolvedFiles = await Promise.all(fn.filePaths.map(async (filePath) => {
243184
243317
  const content = await readTextFile(filePath);
243185
243318
  const path11 = relative2(functionDir, filePath).split(/[/\\]/).join("/");
@@ -243246,14 +243379,14 @@ async function pruneRemovedFunctions(localFunctionNames, options) {
243246
243379
  return results;
243247
243380
  }
243248
243381
  // src/core/resources/function/pull.ts
243249
- import { join as join7 } from "node:path";
243382
+ import { join as join8 } from "node:path";
243250
243383
  import { isDeepStrictEqual as isDeepStrictEqual4 } from "node:util";
243251
243384
  async function writeFunctions(functionsDir, functions) {
243252
243385
  const written = [];
243253
243386
  const skipped = [];
243254
243387
  for (const fn of functions) {
243255
- const functionDir = join7(functionsDir, fn.name);
243256
- const configPath = join7(functionDir, "function.jsonc");
243388
+ const functionDir = join8(functionsDir, fn.name);
243389
+ const configPath = join8(functionDir, "function.jsonc");
243257
243390
  if (await isFunctionUnchanged(functionDir, fn)) {
243258
243391
  skipped.push(fn.name);
243259
243392
  continue;
@@ -243267,7 +243400,7 @@ async function writeFunctions(functionsDir, functions) {
243267
243400
  }
243268
243401
  await writeJsonFile(configPath, config6);
243269
243402
  for (const file2 of fn.files) {
243270
- await writeFile(join7(functionDir, file2.path), file2.content);
243403
+ await writeFile(join8(functionDir, file2.path), file2.content);
243271
243404
  }
243272
243405
  written.push(fn.name);
243273
243406
  }
@@ -243277,7 +243410,7 @@ async function isFunctionUnchanged(functionDir, fn) {
243277
243410
  if (!await pathExists(functionDir)) {
243278
243411
  return false;
243279
243412
  }
243280
- const configPath = join7(functionDir, "function.jsonc");
243413
+ const configPath = join8(functionDir, "function.jsonc");
243281
243414
  try {
243282
243415
  const localConfig = await readJsonFile(configPath);
243283
243416
  if (localConfig.entry !== fn.entry) {
@@ -243290,7 +243423,7 @@ async function isFunctionUnchanged(functionDir, fn) {
243290
243423
  return false;
243291
243424
  }
243292
243425
  for (const file2 of fn.files) {
243293
- const filePath = join7(functionDir, file2.path);
243426
+ const filePath = join8(functionDir, file2.path);
243294
243427
  if (!await pathExists(filePath)) {
243295
243428
  return false;
243296
243429
  }
@@ -243320,49 +243453,141 @@ async function findConfigInDir(dir) {
243320
243453
  }
243321
243454
  async function findProjectRoot(startPath) {
243322
243455
  let current = startPath || process.cwd();
243323
- while (current !== dirname5(current)) {
243456
+ while (current !== dirname6(current)) {
243324
243457
  const configPath = await findConfigInDir(current);
243325
243458
  if (configPath) {
243326
243459
  return { root: current, configPath };
243327
243460
  }
243328
- current = dirname5(current);
243461
+ current = dirname6(current);
243329
243462
  }
243330
243463
  return null;
243331
243464
  }
243332
- async function readProjectConfig(projectRoot) {
243333
- let found;
243334
- if (projectRoot) {
243335
- const configPath2 = await findConfigInDir(projectRoot);
243336
- found = configPath2 ? { root: projectRoot, configPath: configPath2 } : null;
243337
- } else {
243338
- found = await findProjectRoot();
243465
+
243466
+ class ProjectConfigReader {
243467
+ pluginIds = new Set;
243468
+ async readProjectConfig(projectRoot) {
243469
+ const { root, configPath } = await this.findConfigOrThrow(projectRoot);
243470
+ const project = await this.readConfigFile(configPath);
243471
+ this.assertPluginProjectDoesNotLoadPlugins(project, configPath);
243472
+ const localResources = await this.readProjectResources(configPath, project);
243473
+ const pluginResources = await this.readPlugins(project.plugins, root);
243474
+ const entities = mergeProjectAndPluginEntities(localResources.entities, pluginResources.entities, configPath);
243475
+ const functions = [
243476
+ ...localResources.functions,
243477
+ ...pluginResources.functions
243478
+ ];
243479
+ return {
243480
+ project: { ...project, root, configPath },
243481
+ entities,
243482
+ functions,
243483
+ agents: localResources.agents,
243484
+ connectors: localResources.connectors,
243485
+ authConfig: localResources.authConfig
243486
+ };
243487
+ }
243488
+ async findConfigOrThrow(projectRoot) {
243489
+ let found;
243490
+ if (projectRoot) {
243491
+ const configPath = await findConfigInDir(projectRoot);
243492
+ found = configPath ? { root: projectRoot, configPath } : null;
243493
+ } else {
243494
+ found = await findProjectRoot();
243495
+ }
243496
+ if (!found) {
243497
+ throw new ConfigNotFoundError(`Project root not found. Please ensure config.jsonc or config.json exists in the project directory or ${PROJECT_SUBDIR}/ subdirectory.`);
243498
+ }
243499
+ return found;
243339
243500
  }
243340
- if (!found) {
243341
- throw new ConfigNotFoundError(`Project root not found. Please ensure config.jsonc or config.json exists in the project directory or ${PROJECT_SUBDIR}/ subdirectory.`);
243501
+ async readConfigFile(configPath) {
243502
+ const parsed = await readJsonFile(configPath);
243503
+ const result = ProjectConfigSchema.safeParse(parsed);
243504
+ if (!result.success) {
243505
+ throw new SchemaValidationError("Invalid project configuration", result.error, configPath);
243506
+ }
243507
+ return result.data;
243508
+ }
243509
+ async readProjectResources(configPath, project) {
243510
+ const configDir = dirname6(configPath);
243511
+ const [entities, functions, agents, connectors, authConfig] = await Promise.all([
243512
+ entityResource.readAll(join9(configDir, project.entitiesDir)),
243513
+ functionResource.readAll(join9(configDir, project.functionsDir)),
243514
+ agentResource.readAll(join9(configDir, project.agentsDir)),
243515
+ connectorResource.readAll(join9(configDir, project.connectorsDir)),
243516
+ authConfigResource.readAll(join9(configDir, project.authDir))
243517
+ ]);
243518
+ return { entities, functions, agents, connectors, authConfig };
243519
+ }
243520
+ assertPluginProjectDoesNotLoadPlugins(project, configPath) {
243521
+ if (project.plugin && project.plugins.length > 0) {
243522
+ throw new ConfigInvalidError("Plugin projects cannot define plugins in this version.", configPath);
243523
+ }
243524
+ }
243525
+ registerPluginId(pluginId, configPath) {
243526
+ if (this.pluginIds.has(pluginId)) {
243527
+ throw new ConfigInvalidError(`Duplicate plugin id "${pluginId}" in project configuration`, configPath, {
243528
+ hints: [
243529
+ {
243530
+ message: "Remove the plugin or change plugin id"
243531
+ }
243532
+ ]
243533
+ });
243534
+ }
243535
+ this.pluginIds.add(pluginId);
243536
+ }
243537
+ async readPluginConfig(plugin, hostRoot) {
243538
+ const pluginRoot = resolvePluginRoot(plugin.source, hostRoot);
243539
+ const { configPath } = await this.findConfigOrThrow(pluginRoot);
243540
+ const project = await this.readConfigFile(configPath);
243541
+ const pluginId = requirePluginId(project, plugin.source, configPath);
243542
+ this.assertPluginProjectDoesNotLoadPlugins(project, configPath);
243543
+ return { configPath, pluginId, project };
243544
+ }
243545
+ async readPluginResources(project, configPath, pluginId) {
243546
+ const resources = await this.readProjectResources(configPath, project);
243547
+ return {
243548
+ entities: markPluginEntities(resources.entities, pluginId),
243549
+ functions: namespacePluginFunctions(resources.functions, pluginId),
243550
+ agents: [],
243551
+ connectors: [],
243552
+ authConfig: []
243553
+ };
243554
+ }
243555
+ async readPlugins(plugins, projectRoot) {
243556
+ const entities = [];
243557
+ const functions = [];
243558
+ const entityNameByPluginId = new Map;
243559
+ for (const plugin of plugins) {
243560
+ const { configPath, pluginId, project } = await this.readPluginConfig(plugin, projectRoot);
243561
+ this.registerPluginId(pluginId, configPath);
243562
+ const pluginData = await this.readPluginResources(project, configPath, pluginId);
243563
+ for (const entity of pluginData.entities) {
243564
+ const existingPluginId = entityNameByPluginId.get(entity.name);
243565
+ if (existingPluginId) {
243566
+ throw new ConfigInvalidError(`Entity "${entity.name}" is defined by more than one plugin: "${existingPluginId}" and "${pluginId}".`, configPath, {
243567
+ hints: [
243568
+ {
243569
+ message: "Plugin entity names are not namespaced. Remove one plugin or rename one of the entities."
243570
+ }
243571
+ ]
243572
+ });
243573
+ }
243574
+ entityNameByPluginId.set(entity.name, pluginId);
243575
+ }
243576
+ entities.push(...pluginData.entities);
243577
+ functions.push(...pluginData.functions);
243578
+ }
243579
+ return {
243580
+ entities,
243581
+ functions,
243582
+ agents: [],
243583
+ connectors: [],
243584
+ authConfig: []
243585
+ };
243342
243586
  }
243343
- const { root, configPath } = found;
243344
- const parsed = await readJsonFile(configPath);
243345
- const result = ProjectConfigSchema.safeParse(parsed);
243346
- if (!result.success) {
243347
- throw new SchemaValidationError("Invalid project configuration", result.error, configPath);
243348
- }
243349
- const project = result.data;
243350
- const configDir = dirname5(configPath);
243351
- const [entities, functions, agents, connectors, authConfig] = await Promise.all([
243352
- entityResource.readAll(join8(configDir, project.entitiesDir)),
243353
- functionResource.readAll(join8(configDir, project.functionsDir)),
243354
- agentResource.readAll(join8(configDir, project.agentsDir)),
243355
- connectorResource.readAll(join8(configDir, project.connectorsDir)),
243356
- authConfigResource.readAll(join8(configDir, project.authDir))
243357
- ]);
243358
- return {
243359
- project: { ...project, root, configPath },
243360
- entities,
243361
- functions,
243362
- agents,
243363
- connectors,
243364
- authConfig
243365
- };
243587
+ }
243588
+ async function readProjectConfig(projectRoot) {
243589
+ const reader = new ProjectConfigReader;
243590
+ return await reader.readProjectConfig(projectRoot);
243366
243591
  }
243367
243592
 
243368
243593
  // src/core/project/app-config.ts
@@ -243539,12 +243764,12 @@ async function getSiteUrl(projectId) {
243539
243764
  // src/core/project/template.ts
243540
243765
  var import_ejs = __toESM(require_ejs(), 1);
243541
243766
  var import_front_matter = __toESM(require_front_matter(), 1);
243542
- import { dirname as dirname6, join as join10 } from "node:path";
243767
+ import { dirname as dirname7, join as join11 } from "node:path";
243543
243768
 
243544
243769
  // src/core/assets.ts
243545
243770
  import { cpSync, existsSync } from "node:fs";
243546
243771
  import { homedir as homedir2 } from "node:os";
243547
- import { join as join9 } from "node:path";
243772
+ import { join as join10 } from "node:path";
243548
243773
  // package.json
243549
243774
  var package_default = {
243550
243775
  name: "base44",
@@ -243643,18 +243868,18 @@ var package_default = {
243643
243868
  };
243644
243869
 
243645
243870
  // src/core/assets.ts
243646
- var ASSETS_DIR = join9(homedir2(), ".base44", "assets", package_default.version);
243871
+ var ASSETS_DIR = join10(homedir2(), ".base44", "assets", package_default.version);
243647
243872
  function getTemplatesDir() {
243648
- return join9(ASSETS_DIR, "templates");
243873
+ return join10(ASSETS_DIR, "templates");
243649
243874
  }
243650
243875
  function getTemplatesIndexPath() {
243651
- return join9(ASSETS_DIR, "templates", "templates.json");
243876
+ return join10(ASSETS_DIR, "templates", "templates.json");
243652
243877
  }
243653
243878
  function getDenoWrapperPath() {
243654
- return join9(ASSETS_DIR, "deno-runtime", "main.ts");
243879
+ return join10(ASSETS_DIR, "deno-runtime", "main.ts");
243655
243880
  }
243656
243881
  function getExecWrapperPath() {
243657
- return join9(ASSETS_DIR, "deno-runtime", "exec.ts");
243882
+ return join10(ASSETS_DIR, "deno-runtime", "exec.ts");
243658
243883
  }
243659
243884
  function ensureNpmAssets(sourceDir) {
243660
243885
  if (existsSync(ASSETS_DIR))
@@ -243675,23 +243900,23 @@ async function listTemplates() {
243675
243900
  return result.data.templates;
243676
243901
  }
243677
243902
  async function renderTemplate(template, destPath, data) {
243678
- const templateDir = join10(getTemplatesDir(), template.path);
243903
+ const templateDir = join11(getTemplatesDir(), template.path);
243679
243904
  const files = await globby("**/*", {
243680
243905
  cwd: templateDir,
243681
243906
  dot: true,
243682
243907
  onlyFiles: true
243683
243908
  });
243684
243909
  for (const file2 of files) {
243685
- const srcPath = join10(templateDir, file2);
243910
+ const srcPath = join11(templateDir, file2);
243686
243911
  try {
243687
243912
  if (file2.endsWith(".ejs")) {
243688
243913
  const rendered = await import_ejs.default.renderFile(srcPath, data);
243689
243914
  const { attributes, body } = import_front_matter.default(rendered);
243690
- const destFile = attributes.outputFileName ? join10(dirname6(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
243691
- const destFilePath = join10(destPath, destFile);
243915
+ const destFile = attributes.outputFileName ? join11(dirname7(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
243916
+ const destFilePath = join11(destPath, destFile);
243692
243917
  await writeFile(destFilePath, body);
243693
243918
  } else {
243694
- const destFilePath = join10(destPath, file2);
243919
+ const destFilePath = join11(destPath, file2);
243695
243920
  await copyFile(srcPath, destFilePath);
243696
243921
  }
243697
243922
  } catch (error48) {
@@ -243731,7 +243956,7 @@ async function createProjectFilesForExistingProject(options) {
243731
243956
  };
243732
243957
  }
243733
243958
  // src/core/project/deploy.ts
243734
- import { resolve } from "node:path";
243959
+ import { resolve as resolve2 } from "node:path";
243735
243960
 
243736
243961
  // src/core/site/api.ts
243737
243962
  async function uploadSite(archivePath) {
@@ -243766,7 +243991,7 @@ async function getSiteFilePaths(outputDir) {
243766
243991
  // src/core/site/deploy.ts
243767
243992
  import { randomUUID } from "node:crypto";
243768
243993
  import { tmpdir } from "node:os";
243769
- import { join as join11 } from "node:path";
243994
+ import { join as join12 } from "node:path";
243770
243995
  async function deploySite(siteOutputDir) {
243771
243996
  if (!await pathExists(siteOutputDir)) {
243772
243997
  throw new InvalidInputError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
@@ -243783,7 +244008,7 @@ async function deploySite(siteOutputDir) {
243783
244008
  ]
243784
244009
  });
243785
244010
  }
243786
- const archivePath = join11(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
244011
+ const archivePath = join12(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
243787
244012
  try {
243788
244013
  await createArchive(siteOutputDir, archivePath);
243789
244014
  return await uploadSite(archivePath);
@@ -243820,7 +244045,7 @@ async function deployAll(projectData, options) {
243820
244045
  await authConfigResource.push(authConfig);
243821
244046
  const { results: connectorResults } = await pushConnectors(connectors);
243822
244047
  if (project.site?.outputDirectory) {
243823
- const outputDir = resolve(project.root, project.site.outputDirectory);
244048
+ const outputDir = resolve2(project.root, project.site.outputDirectory);
243824
244049
  const { appUrl } = await deploySite(outputDir);
243825
244050
  return { appUrl, connectorResults };
243826
244051
  }
@@ -245635,8 +245860,8 @@ var disconnect = (anyProcess) => {
245635
245860
  // ../../node_modules/execa/lib/utils/deferred.js
245636
245861
  var createDeferred = () => {
245637
245862
  const methods = {};
245638
- const promise2 = new Promise((resolve2, reject) => {
245639
- Object.assign(methods, { resolve: resolve2, reject });
245863
+ const promise2 = new Promise((resolve3, reject) => {
245864
+ Object.assign(methods, { resolve: resolve3, reject });
245640
245865
  });
245641
245866
  return Object.assign(promise2, methods);
245642
245867
  };
@@ -250000,11 +250225,11 @@ var addConcurrentStream = (concurrentStreams, stream, waitName) => {
250000
250225
  const promises = weakMap.get(stream);
250001
250226
  const promise2 = createDeferred();
250002
250227
  promises.push(promise2);
250003
- const resolve2 = promise2.resolve.bind(promise2);
250004
- return { resolve: resolve2, promises };
250228
+ const resolve3 = promise2.resolve.bind(promise2);
250229
+ return { resolve: resolve3, promises };
250005
250230
  };
250006
- var waitForConcurrentStreams = async ({ resolve: resolve2, promises }, subprocess) => {
250007
- resolve2();
250231
+ var waitForConcurrentStreams = async ({ resolve: resolve3, promises }, subprocess) => {
250232
+ resolve3();
250008
250233
  const [isSubprocessExit] = await Promise.race([
250009
250234
  Promise.allSettled([true, subprocess]),
250010
250235
  Promise.all([false, ...promises])
@@ -250970,8 +251195,8 @@ async function pullAgentsAction({
250970
251195
  runTask: runTask2
250971
251196
  }) {
250972
251197
  const { project: project2 } = await readProjectConfig();
250973
- const configDir = dirname7(project2.configPath);
250974
- const agentsDir = join12(configDir, project2.agentsDir);
251198
+ const configDir = dirname8(project2.configPath);
251199
+ const agentsDir = join13(configDir, project2.agentsDir);
250975
251200
  const remoteAgents = await runTask2("Fetching agents from Base44", async () => {
250976
251201
  return await fetchAgents();
250977
251202
  }, {
@@ -251035,12 +251260,12 @@ function getAgentsCommand() {
251035
251260
  }
251036
251261
 
251037
251262
  // src/cli/commands/auth/password-login.ts
251038
- import { dirname as dirname8, join as join13 } from "node:path";
251263
+ import { dirname as dirname9, join as join14 } from "node:path";
251039
251264
  async function passwordLoginAction({ log, runTask: runTask2 }, action) {
251040
251265
  const shouldEnable = action === "enable";
251041
251266
  const { project: project2 } = await readProjectConfig();
251042
- const configDir = dirname8(project2.configPath);
251043
- const authDir = join13(configDir, project2.authDir);
251267
+ const configDir = dirname9(project2.configPath);
251268
+ const authDir = join14(configDir, project2.authDir);
251044
251269
  const updated = await runTask2("Updating local auth config", async () => {
251045
251270
  const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
251046
251271
  const merged = { ...current, enableUsernamePassword: shouldEnable };
@@ -251060,14 +251285,14 @@ function getPasswordLoginCommand() {
251060
251285
  }
251061
251286
 
251062
251287
  // src/cli/commands/auth/pull.ts
251063
- import { dirname as dirname9, join as join14 } from "node:path";
251288
+ import { dirname as dirname10, join as join15 } from "node:path";
251064
251289
  async function pullAuthAction({
251065
251290
  log,
251066
251291
  runTask: runTask2
251067
251292
  }) {
251068
251293
  const { project: project2 } = await readProjectConfig();
251069
- const configDir = dirname9(project2.configPath);
251070
- const authDir = join14(configDir, project2.authDir);
251294
+ const configDir = dirname10(project2.configPath);
251295
+ const authDir = join15(configDir, project2.authDir);
251071
251296
  const remoteConfig = await runTask2("Fetching auth config from Base44", async () => {
251072
251297
  return await pullAuthConfig();
251073
251298
  }, {
@@ -251131,7 +251356,7 @@ function getAuthPushCommand() {
251131
251356
  }
251132
251357
 
251133
251358
  // src/cli/commands/auth/social-login.ts
251134
- import { dirname as dirname10, join as join15, resolve as resolve2 } from "node:path";
251359
+ import { dirname as dirname11, join as join16, resolve as resolve3 } from "node:path";
251135
251360
  var PROVIDER_LABELS = {
251136
251361
  google: "Google",
251137
251362
  microsoft: "Microsoft",
@@ -251171,7 +251396,7 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
251171
251396
  let clientSecret;
251172
251397
  if (useCustomOAuth && oauth && oauthCli && hasSecretOptions(options)) {
251173
251398
  if (options.envFile) {
251174
- const secrets = await parseEnvFile(resolve2(options.envFile));
251399
+ const secrets = await parseEnvFile(resolve3(options.envFile));
251175
251400
  const value = secrets[oauthCli.envVar];
251176
251401
  if (!value) {
251177
251402
  throw new InvalidInputError(`Key "${oauthCli.envVar}" not found in ${options.envFile}.`);
@@ -251201,8 +251426,8 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
251201
251426
  }
251202
251427
  }
251203
251428
  const { project: project2 } = await readProjectConfig();
251204
- const configDir = dirname10(project2.configPath);
251205
- const authDir = join15(configDir, project2.authDir);
251429
+ const configDir = dirname11(project2.configPath);
251430
+ const authDir = join16(configDir, project2.authDir);
251206
251431
  const { config: updated } = await runTask2("Updating local auth config", async () => updateSocialLoginConfig(authDir, provider, shouldEnable, useCustomOAuth && options.clientId ? { clientId: options.clientId } : undefined));
251207
251432
  if (clientSecret) {
251208
251433
  await runTask2("Saving client secret", async () => pushCustomOAuthSecret(provider, clientSecret));
@@ -251227,7 +251452,7 @@ function getSocialLoginCommand() {
251227
251452
  }
251228
251453
 
251229
251454
  // src/cli/commands/auth/sso.ts
251230
- import { dirname as dirname11, join as join16, resolve as resolve3 } from "node:path";
251455
+ import { dirname as dirname12, join as join17, resolve as resolve4 } from "node:path";
251231
251456
  var SSOConfigFileSchema = exports_external.object({
251232
251457
  provider: exports_external.enum(Object.values(KNOWN_SSO_PROVIDERS)),
251233
251458
  clientId: exports_external.string(),
@@ -251243,7 +251468,7 @@ var SSOConfigFileSchema = exports_external.object({
251243
251468
  ssoName: exports_external.string().optional()
251244
251469
  });
251245
251470
  async function loadSSOConfigFile(filePath) {
251246
- const resolved = resolve3(filePath);
251471
+ const resolved = resolve4(filePath);
251247
251472
  const raw2 = await readJsonFile(resolved);
251248
251473
  const result = SSOConfigFileSchema.safeParse(raw2);
251249
251474
  if (!result.success) {
@@ -251331,7 +251556,7 @@ async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options)
251331
251556
  }
251332
251557
  let clientSecret;
251333
251558
  if (merged.envFile && !merged.clientSecret) {
251334
- const secrets2 = await parseEnvFile(resolve3(merged.envFile));
251559
+ const secrets2 = await parseEnvFile(resolve4(merged.envFile));
251335
251560
  const value = secrets2.sso_client_secret;
251336
251561
  if (!value) {
251337
251562
  throw new InvalidInputError(`Key "sso_client_secret" not found in ${merged.envFile}.`);
@@ -251390,8 +251615,8 @@ async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options)
251390
251615
  throw error48;
251391
251616
  }
251392
251617
  const { project: project2 } = await readProjectConfig();
251393
- const configDir = dirname11(project2.configPath);
251394
- const authDir = join16(configDir, project2.authDir);
251618
+ const configDir = dirname12(project2.configPath);
251619
+ const authDir = join17(configDir, project2.authDir);
251395
251620
  await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, provider, true));
251396
251621
  await runTask2("Saving SSO credentials", async () => pushSSOSecrets(secrets));
251397
251622
  return {
@@ -251406,8 +251631,8 @@ async function ssoDisableAction({ log, runTask: runTask2 }, options) {
251406
251631
  throw new InvalidInputError("Configuration options cannot be used with disable. To disable SSO: base44 auth sso disable");
251407
251632
  }
251408
251633
  const { project: project2 } = await readProjectConfig();
251409
- const configDir = dirname11(project2.configPath);
251410
- const authDir = join16(configDir, project2.authDir);
251634
+ const configDir = dirname12(project2.configPath);
251635
+ const authDir = join17(configDir, project2.authDir);
251411
251636
  const updated = await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, null, false));
251412
251637
  await runTask2("Removing SSO credentials", async () => deleteSSOSecrets());
251413
251638
  if (!hasAnyLoginMethod(updated)) {
@@ -251494,14 +251719,14 @@ function getConnectorsListAvailableCommand() {
251494
251719
  }
251495
251720
 
251496
251721
  // src/cli/commands/connectors/pull.ts
251497
- import { dirname as dirname12, join as join17 } from "node:path";
251722
+ import { dirname as dirname13, join as join18 } from "node:path";
251498
251723
  async function pullConnectorsAction({
251499
251724
  log,
251500
251725
  runTask: runTask2
251501
251726
  }) {
251502
251727
  const { project: project2 } = await readProjectConfig();
251503
- const configDir = dirname12(project2.configPath);
251504
- const connectorsDir = join17(configDir, project2.connectorsDir);
251728
+ const configDir = dirname13(project2.configPath);
251729
+ const connectorsDir = join18(configDir, project2.connectorsDir);
251505
251730
  const remoteConnectors = await runTask2("Fetching connectors from Base44", async () => {
251506
251731
  return await pullAllConnectors();
251507
251732
  }, {
@@ -252030,19 +252255,19 @@ var baseOpen = async (options) => {
252030
252255
  }
252031
252256
  const subprocess = childProcess3.spawn(command2, cliArguments, childProcessOptions);
252032
252257
  if (options.wait) {
252033
- return new Promise((resolve4, reject) => {
252258
+ return new Promise((resolve5, reject) => {
252034
252259
  subprocess.once("error", reject);
252035
252260
  subprocess.once("close", (exitCode) => {
252036
252261
  if (!options.allowNonzeroExitCode && exitCode !== 0) {
252037
252262
  reject(new Error(`Exited with code ${exitCode}`));
252038
252263
  return;
252039
252264
  }
252040
- resolve4(subprocess);
252265
+ resolve5(subprocess);
252041
252266
  });
252042
252267
  });
252043
252268
  }
252044
252269
  if (isFallbackAttempt) {
252045
- return new Promise((resolve4, reject) => {
252270
+ return new Promise((resolve5, reject) => {
252046
252271
  subprocess.once("error", reject);
252047
252272
  subprocess.once("spawn", () => {
252048
252273
  subprocess.once("close", (exitCode) => {
@@ -252052,17 +252277,17 @@ var baseOpen = async (options) => {
252052
252277
  return;
252053
252278
  }
252054
252279
  subprocess.unref();
252055
- resolve4(subprocess);
252280
+ resolve5(subprocess);
252056
252281
  });
252057
252282
  });
252058
252283
  });
252059
252284
  }
252060
252285
  subprocess.unref();
252061
- return new Promise((resolve4, reject) => {
252286
+ return new Promise((resolve5, reject) => {
252062
252287
  subprocess.once("error", reject);
252063
252288
  subprocess.once("spawn", () => {
252064
252289
  subprocess.off("error", reject);
252065
- resolve4(subprocess);
252290
+ resolve5(subprocess);
252066
252291
  });
252067
252292
  });
252068
252293
  };
@@ -252505,6 +252730,11 @@ async function deployFunctionsAction({ log }, names, options) {
252505
252730
  formatDeployResult(result, log);
252506
252731
  }
252507
252732
  });
252733
+ const hasFailures = results.some((r) => r.status === "error");
252734
+ if (hasFailures) {
252735
+ log.message(buildDeploySummary(results));
252736
+ throw new CLIExitError(1);
252737
+ }
252508
252738
  if (options.force) {
252509
252739
  const allLocalNames = functions.map((f) => f.name);
252510
252740
  let pruneCompleted = 0;
@@ -252556,25 +252786,38 @@ function getListCommand() {
252556
252786
  }
252557
252787
 
252558
252788
  // src/cli/commands/functions/pull.ts
252559
- import { dirname as dirname13, join as join18 } from "node:path";
252789
+ import { dirname as dirname14, join as join19 } from "node:path";
252560
252790
  async function pullFunctionsAction({ log, runTask: runTask2 }, name2) {
252561
- const { project: project2 } = await readProjectConfig();
252562
- const configDir = dirname13(project2.configPath);
252563
- const functionsDir = join18(configDir, project2.functionsDir);
252791
+ const { project: project2, functions } = await readProjectConfig();
252792
+ const configDir = dirname14(project2.configPath);
252793
+ const functionsDir = join19(configDir, project2.functionsDir);
252794
+ const pluginFunctionNames = new Set(functions.filter((fn) => fn.source.type === "plugin").map((fn) => fn.name));
252564
252795
  const remoteFunctions = await runTask2("Fetching functions from Base44", async () => {
252565
- const { functions } = await listDeployedFunctions();
252566
- return functions;
252796
+ const { functions: functions2 } = await listDeployedFunctions();
252797
+ return functions2;
252567
252798
  }, {
252568
252799
  successMessage: "Functions fetched successfully",
252569
252800
  errorMessage: "Failed to fetch functions"
252570
252801
  });
252571
- const toPull = name2 ? remoteFunctions.filter((f) => f.name === name2) : remoteFunctions;
252572
- if (name2 && toPull.length === 0) {
252802
+ const matchingRemote = name2 ? remoteFunctions.filter((f) => f.name === name2) : remoteFunctions;
252803
+ if (name2 && pluginFunctionNames.has(name2)) {
252804
+ return {
252805
+ outroMessage: `Function "${name2}" is managed by a plugin and was not pulled into ${functionsDir}`
252806
+ };
252807
+ }
252808
+ if (name2 && matchingRemote.length === 0) {
252573
252809
  return {
252574
252810
  outroMessage: `Function "${name2}" not found on remote`
252575
252811
  };
252576
252812
  }
252813
+ const skippedPluginOwned = matchingRemote.filter((fn) => pluginFunctionNames.has(fn.name));
252814
+ const toPull = matchingRemote.filter((fn) => !pluginFunctionNames.has(fn.name));
252577
252815
  if (toPull.length === 0) {
252816
+ if (skippedPluginOwned.length > 0) {
252817
+ return {
252818
+ outroMessage: `Skipped ${skippedPluginOwned.length} plugin-owned function${skippedPluginOwned.length !== 1 ? "s" : ""}; no project-owned functions to pull`
252819
+ };
252820
+ }
252578
252821
  return { outroMessage: "No functions found on remote" };
252579
252822
  }
252580
252823
  const { written, skipped } = await runTask2("Writing function files", async () => {
@@ -252589,8 +252832,11 @@ async function pullFunctionsAction({ log, runTask: runTask2 }, name2) {
252589
252832
  for (const name3 of skipped) {
252590
252833
  log.info(`${name3.padEnd(25)} unchanged`);
252591
252834
  }
252835
+ for (const fn of skippedPluginOwned) {
252836
+ log.info(`${fn.name.padEnd(25)} plugin-owned, skipped`);
252837
+ }
252592
252838
  return {
252593
- outroMessage: `Pulled ${toPull.length} function${toPull.length !== 1 ? "s" : ""} to ${functionsDir}`
252839
+ outroMessage: `Pulled ${toPull.length} function${toPull.length !== 1 ? "s" : ""} to ${functionsDir}${skippedPluginOwned.length > 0 ? `; skipped ${skippedPluginOwned.length} plugin-owned` : ""}`
252594
252840
  };
252595
252841
  }
252596
252842
  function getPullCommand() {
@@ -252603,7 +252849,7 @@ function getFunctionsCommand() {
252603
252849
  }
252604
252850
 
252605
252851
  // src/cli/commands/project/create.ts
252606
- import { basename as basename3, join as join19, resolve as resolve4 } from "node:path";
252852
+ import { basename as basename3, join as join20, resolve as resolve5 } from "node:path";
252607
252853
  var import_kebabCase = __toESM(require_kebabCase(), 1);
252608
252854
  var DEFAULT_TEMPLATE_ID = "backend-only";
252609
252855
  async function getTemplateById(templateId) {
@@ -252668,7 +252914,7 @@ async function createInteractive(options, ctx) {
252668
252914
  }, ctx);
252669
252915
  }
252670
252916
  async function createNonInteractive(options, ctx) {
252671
- ctx.log.info(`Creating a new project at ${resolve4(options.path)}`);
252917
+ ctx.log.info(`Creating a new project at ${resolve5(options.path)}`);
252672
252918
  const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
252673
252919
  return await executeCreate({
252674
252920
  template: template2,
@@ -252689,7 +252935,7 @@ async function executeCreate({
252689
252935
  isInteractive
252690
252936
  }, { log, runTask: runTask2 }) {
252691
252937
  const name2 = rawName.trim();
252692
- const resolvedPath = resolve4(projectPath);
252938
+ const resolvedPath = resolve5(projectPath);
252693
252939
  const { projectId } = await runTask2("Setting up your project...", async () => {
252694
252940
  return await createProjectFiles({
252695
252941
  name: name2,
@@ -252740,7 +252986,7 @@ async function executeCreate({
252740
252986
  updateMessage("Building project...");
252741
252987
  await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
252742
252988
  updateMessage("Deploying site...");
252743
- return await deploySite(join19(resolvedPath, outputDirectory));
252989
+ return await deploySite(join20(resolvedPath, outputDirectory));
252744
252990
  }, {
252745
252991
  successMessage: theme.colors.base44Orange("Site deployed successfully"),
252746
252992
  errorMessage: "Failed to deploy site"
@@ -253205,7 +253451,7 @@ function getSecretsListCommand() {
253205
253451
  }
253206
253452
 
253207
253453
  // src/cli/commands/secrets/set.ts
253208
- import { resolve as resolve5 } from "node:path";
253454
+ import { resolve as resolve6 } from "node:path";
253209
253455
  function parseEntries(entries) {
253210
253456
  const secrets = {};
253211
253457
  for (const entry of entries) {
@@ -253236,7 +253482,7 @@ async function setSecretsAction({ log, runTask: runTask2 }, entries, options) {
253236
253482
  validateInput(entries, options);
253237
253483
  let secrets;
253238
253484
  if (options.envFile) {
253239
- secrets = await parseEnvFile(resolve5(options.envFile));
253485
+ secrets = await parseEnvFile(resolve6(options.envFile));
253240
253486
  if (Object.keys(secrets).length === 0) {
253241
253487
  throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
253242
253488
  }
@@ -253265,7 +253511,7 @@ function getSecretsCommand() {
253265
253511
  }
253266
253512
 
253267
253513
  // src/cli/commands/site/deploy.ts
253268
- import { resolve as resolve6 } from "node:path";
253514
+ import { resolve as resolve7 } from "node:path";
253269
253515
  async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
253270
253516
  if (isNonInteractive && !options.yes) {
253271
253517
  throw new InvalidInputError("--yes is required in non-interactive mode");
@@ -253280,7 +253526,7 @@ async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
253280
253526
  ]
253281
253527
  });
253282
253528
  }
253283
- const outputDir = resolve6(project2.root, project2.site.outputDirectory);
253529
+ const outputDir = resolve7(project2.root, project2.site.outputDirectory);
253284
253530
  if (!options.yes) {
253285
253531
  const shouldDeploy = await Re({
253286
253532
  message: `Deploy site from ${project2.site.outputDirectory}?`
@@ -253406,10 +253652,10 @@ function toPascalCase(name2) {
253406
253652
  return name2.split(/[-_\s]+/).map((w8) => w8.charAt(0).toUpperCase() + w8.slice(1)).join("");
253407
253653
  }
253408
253654
  // src/core/types/update-project.ts
253409
- import { join as join22 } from "node:path";
253655
+ import { join as join23 } from "node:path";
253410
253656
  var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
253411
253657
  async function updateProjectConfig(projectRoot) {
253412
- const tsconfigPath = join22(projectRoot, "tsconfig.json");
253658
+ const tsconfigPath = join23(projectRoot, "tsconfig.json");
253413
253659
  if (!await pathExists(tsconfigPath)) {
253414
253660
  return false;
253415
253661
  }
@@ -253457,7 +253703,7 @@ import process21 from "node:process";
253457
253703
  // src/cli/dev/dev-server/main.ts
253458
253704
  var import_cors = __toESM(require_lib4(), 1);
253459
253705
  var import_express6 = __toESM(require_express(), 1);
253460
- import { dirname as dirname18, join as join25 } from "node:path";
253706
+ import { dirname as dirname19, join as join26 } from "node:path";
253461
253707
 
253462
253708
  // ../../node_modules/get-port/index.js
253463
253709
  import net from "node:net";
@@ -253484,14 +253730,14 @@ var getLocalHosts = () => {
253484
253730
  }
253485
253731
  return results;
253486
253732
  };
253487
- var checkAvailablePort = (options8) => new Promise((resolve8, reject) => {
253733
+ var checkAvailablePort = (options8) => new Promise((resolve9, reject) => {
253488
253734
  const server = net.createServer();
253489
253735
  server.unref();
253490
253736
  server.on("error", reject);
253491
253737
  server.listen(options8, () => {
253492
253738
  const { port } = server.address();
253493
253739
  server.close(() => {
253494
- resolve8(port);
253740
+ resolve9(port);
253495
253741
  });
253496
253742
  });
253497
253743
  });
@@ -253751,7 +253997,7 @@ class FunctionManager {
253751
253997
  });
253752
253998
  }
253753
253999
  waitForReady(name2, runningFunc) {
253754
- return new Promise((resolve8, reject) => {
254000
+ return new Promise((resolve9, reject) => {
253755
254001
  runningFunc.process.on("exit", (code2) => {
253756
254002
  if (!runningFunc.ready) {
253757
254003
  clearTimeout(timeout3);
@@ -253774,7 +254020,7 @@ class FunctionManager {
253774
254020
  runningFunc.ready = true;
253775
254021
  clearTimeout(timeout3);
253776
254022
  runningFunc.process.stdout?.off("data", onData);
253777
- resolve8(runningFunc.port);
254023
+ resolve9(runningFunc.port);
253778
254024
  }
253779
254025
  };
253780
254026
  runningFunc.process.stdout?.on("data", onData);
@@ -254075,7 +254321,8 @@ class Database {
254075
254321
  return {
254076
254322
  name: "User",
254077
254323
  type: "object",
254078
- properties: { ...builtInFields, role: { type: "string" } }
254324
+ properties: { ...builtInFields, role: { type: "string" } },
254325
+ source: { type: "project" }
254079
254326
  };
254080
254327
  }
254081
254328
  for (const field of Object.keys(builtInFields)) {
@@ -255695,9 +255942,9 @@ class NodeFsHandler {
255695
255942
  if (this.fsw.closed) {
255696
255943
  return;
255697
255944
  }
255698
- const dirname17 = sp2.dirname(file2);
255945
+ const dirname18 = sp2.dirname(file2);
255699
255946
  const basename5 = sp2.basename(file2);
255700
- const parent = this.fsw._getWatchedDir(dirname17);
255947
+ const parent = this.fsw._getWatchedDir(dirname18);
255701
255948
  let prevStats = stats;
255702
255949
  if (parent.has(basename5))
255703
255950
  return;
@@ -255724,7 +255971,7 @@ class NodeFsHandler {
255724
255971
  prevStats = newStats2;
255725
255972
  }
255726
255973
  } catch (error48) {
255727
- this.fsw._remove(dirname17, basename5);
255974
+ this.fsw._remove(dirname18, basename5);
255728
255975
  }
255729
255976
  } else if (parent.has(basename5)) {
255730
255977
  const at13 = newStats.atimeMs;
@@ -255813,7 +256060,7 @@ class NodeFsHandler {
255813
256060
  this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
255814
256061
  }
255815
256062
  }).on(EV.ERROR, this._boundHandleError);
255816
- return new Promise((resolve9, reject) => {
256063
+ return new Promise((resolve10, reject) => {
255817
256064
  if (!stream)
255818
256065
  return reject();
255819
256066
  stream.once(STR_END, () => {
@@ -255822,7 +256069,7 @@ class NodeFsHandler {
255822
256069
  return;
255823
256070
  }
255824
256071
  const wasThrottled = throttler ? throttler.clear() : false;
255825
- resolve9(undefined);
256072
+ resolve10(undefined);
255826
256073
  previous.getChildren().filter((item) => {
255827
256074
  return item !== directory && !current.has(item);
255828
256075
  }).forEach((item) => {
@@ -256733,7 +256980,7 @@ async function createDevServer(options8) {
256733
256980
  }
256734
256981
  remoteProxy(req, res, next);
256735
256982
  });
256736
- const server = await new Promise((resolve10, reject) => {
256983
+ const server = await new Promise((resolve11, reject) => {
256737
256984
  const s5 = app.listen(port, "127.0.0.1", (err) => {
256738
256985
  if (err) {
256739
256986
  if ("code" in err && err.code === "EADDRINUSE") {
@@ -256742,7 +256989,7 @@ async function createDevServer(options8) {
256742
256989
  reject(err);
256743
256990
  }
256744
256991
  } else {
256745
- resolve10(s5);
256992
+ resolve11(s5);
256746
256993
  }
256747
256994
  });
256748
256995
  });
@@ -256751,8 +256998,8 @@ async function createDevServer(options8) {
256751
256998
  broadcastEntityEvent(io6, appId, entityName, event);
256752
256999
  };
256753
257000
  const base44ConfigWatcher = new WatchBase44({
256754
- functions: join25(dirname18(project2.configPath), project2.functionsDir),
256755
- entities: join25(dirname18(project2.configPath), project2.entitiesDir)
257001
+ functions: join26(dirname19(project2.configPath), project2.functionsDir),
257002
+ entities: join26(dirname19(project2.configPath), project2.entitiesDir)
256756
257003
  }, devLogger);
256757
257004
  base44ConfigWatcher.on("change", async (name2) => {
256758
257005
  try {
@@ -256859,13 +257106,13 @@ async function runScript(options8) {
256859
257106
  }
256860
257107
  // src/cli/commands/exec.ts
256861
257108
  function readStdin2() {
256862
- return new Promise((resolve10, reject) => {
257109
+ return new Promise((resolve11, reject) => {
256863
257110
  let data = "";
256864
257111
  process.stdin.setEncoding("utf-8");
256865
257112
  process.stdin.on("data", (chunk) => {
256866
257113
  data += chunk;
256867
257114
  });
256868
- process.stdin.on("end", () => resolve10(data));
257115
+ process.stdin.on("end", () => resolve11(data));
256869
257116
  process.stdin.on("error", reject);
256870
257117
  });
256871
257118
  }
@@ -256904,7 +257151,7 @@ Examples:
256904
257151
  }
256905
257152
 
256906
257153
  // src/cli/commands/project/eject.ts
256907
- import { resolve as resolve10 } from "node:path";
257154
+ import { resolve as resolve11 } from "node:path";
256908
257155
  var import_kebabCase2 = __toESM(require_kebabCase(), 1);
256909
257156
  async function eject(ctx, options8) {
256910
257157
  const { log, runTask: runTask2, isNonInteractive } = ctx;
@@ -256960,7 +257207,7 @@ async function eject(ctx, options8) {
256960
257207
  Ne("Operation cancelled.");
256961
257208
  throw new CLIExitError(0);
256962
257209
  }
256963
- const resolvedPath = resolve10(selectedPath);
257210
+ const resolvedPath = resolve11(selectedPath);
256964
257211
  await runTask2("Downloading your project's code...", async (updateMessage) => {
256965
257212
  await createProjectFilesForExistingProject({
256966
257213
  projectId,
@@ -257041,7 +257288,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
257041
257288
  import { release, type } from "node:os";
257042
257289
 
257043
257290
  // ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
257044
- import { dirname as dirname19, posix, sep } from "path";
257291
+ import { dirname as dirname20, posix, sep } from "path";
257045
257292
  function createModulerModifier() {
257046
257293
  const getModuleFromFileName = createGetModuleFromFilename();
257047
257294
  return async (frames) => {
@@ -257050,7 +257297,7 @@ function createModulerModifier() {
257050
257297
  return frames;
257051
257298
  };
257052
257299
  }
257053
- function createGetModuleFromFilename(basePath = process.argv[1] ? dirname19(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
257300
+ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname20(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
257054
257301
  const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
257055
257302
  return (filename) => {
257056
257303
  if (!filename)
@@ -259328,14 +259575,14 @@ async function addSourceContext(frames) {
259328
259575
  return frames;
259329
259576
  }
259330
259577
  function getContextLinesFromFile(path19, ranges, output) {
259331
- return new Promise((resolve11) => {
259578
+ return new Promise((resolve12) => {
259332
259579
  const stream = createReadStream2(path19);
259333
259580
  const lineReaded = createInterface2({
259334
259581
  input: stream
259335
259582
  });
259336
259583
  function destroyStreamAndResolve() {
259337
259584
  stream.destroy();
259338
- resolve11();
259585
+ resolve12();
259339
259586
  }
259340
259587
  let lineNumber = 0;
259341
259588
  let currentRangeIndex = 0;
@@ -260447,15 +260694,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
260447
260694
  return true;
260448
260695
  if (this.featureFlagsPoller === undefined)
260449
260696
  return false;
260450
- return new Promise((resolve11) => {
260697
+ return new Promise((resolve12) => {
260451
260698
  const timeout3 = setTimeout(() => {
260452
260699
  cleanup();
260453
- resolve11(false);
260700
+ resolve12(false);
260454
260701
  }, timeoutMs);
260455
260702
  const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
260456
260703
  clearTimeout(timeout3);
260457
260704
  cleanup();
260458
- resolve11(count2 > 0);
260705
+ resolve12(count2 > 0);
260459
260706
  });
260460
260707
  });
260461
260708
  }
@@ -261239,9 +261486,9 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
261239
261486
  });
261240
261487
  }
261241
261488
  // src/cli/index.ts
261242
- var __dirname4 = dirname20(fileURLToPath6(import.meta.url));
261489
+ var __dirname4 = dirname21(fileURLToPath6(import.meta.url));
261243
261490
  async function runCLI(options8) {
261244
- ensureNpmAssets(join26(__dirname4, "../assets"));
261491
+ ensureNpmAssets(join27(__dirname4, "../assets"));
261245
261492
  const errorReporter = new ErrorReporter;
261246
261493
  errorReporter.registerProcessErrorHandlers();
261247
261494
  const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
@@ -261278,4 +261525,4 @@ export {
261278
261525
  CLIExitError
261279
261526
  };
261280
261527
 
261281
- //# debugId=30D916E80922F28864756E2164756E21
261528
+ //# debugId=6F53421EFB4CBB2764756E2164756E21