@base44-preview/cli 0.0.38-pr.330.d128357 → 0.0.38-pr.362.03eb5e3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/bin/binary-entry.ts +40 -0
  2. package/dist/{deno-runtime → assets/deno-runtime}/main.js.map +1 -1
  3. package/dist/cli/index.js +185 -472
  4. package/dist/cli/index.js.map +22 -29
  5. package/package.json +4 -3
  6. /package/dist/{deno-runtime → assets/deno-runtime}/main.js +0 -0
  7. /package/dist/{templates → assets/templates}/backend-and-client/.nvmrc +0 -0
  8. /package/dist/{templates → assets/templates}/backend-and-client/README.md +0 -0
  9. /package/dist/{templates → assets/templates}/backend-and-client/base44/agents/task_manager.jsonc +0 -0
  10. /package/dist/{templates → assets/templates}/backend-and-client/base44/app.jsonc.ejs +0 -0
  11. /package/dist/{templates → assets/templates}/backend-and-client/base44/config.jsonc.ejs +0 -0
  12. /package/dist/{templates → assets/templates}/backend-and-client/base44/entities/task.jsonc +0 -0
  13. /package/dist/{templates → assets/templates}/backend-and-client/components.json +0 -0
  14. /package/dist/{templates → assets/templates}/backend-and-client/gitignore.ejs +0 -0
  15. /package/dist/{templates → assets/templates}/backend-and-client/index.html +0 -0
  16. /package/dist/{templates → assets/templates}/backend-and-client/jsconfig.json +0 -0
  17. /package/dist/{templates → assets/templates}/backend-and-client/package.json +0 -0
  18. /package/dist/{templates → assets/templates}/backend-and-client/postcss.config.js +0 -0
  19. /package/dist/{templates → assets/templates}/backend-and-client/src/App.jsx +0 -0
  20. /package/dist/{templates → assets/templates}/backend-and-client/src/api/base44Client.js.ejs +0 -0
  21. /package/dist/{templates → assets/templates}/backend-and-client/src/components/Base44Logo.jsx +0 -0
  22. /package/dist/{templates → assets/templates}/backend-and-client/src/components/ui/button.jsx +0 -0
  23. /package/dist/{templates → assets/templates}/backend-and-client/src/components/ui/checkbox.jsx +0 -0
  24. /package/dist/{templates → assets/templates}/backend-and-client/src/components/ui/input.jsx +0 -0
  25. /package/dist/{templates → assets/templates}/backend-and-client/src/index.css +0 -0
  26. /package/dist/{templates → assets/templates}/backend-and-client/src/main.jsx +0 -0
  27. /package/dist/{templates → assets/templates}/backend-and-client/tailwind.config.js +0 -0
  28. /package/dist/{templates → assets/templates}/backend-and-client/vite.config.js +0 -0
  29. /package/dist/{templates → assets/templates}/backend-only/base44/app.jsonc.ejs +0 -0
  30. /package/dist/{templates → assets/templates}/backend-only/base44/config.jsonc.ejs +0 -0
  31. /package/dist/{templates → assets/templates}/backend-only/base44/gitignore.ejs +0 -0
  32. /package/dist/{templates → assets/templates}/templates.json +0 -0
package/dist/cli/index.js CHANGED
@@ -18040,7 +18040,7 @@ var require_lodash = __commonJS((exports, module) => {
18040
18040
  }
18041
18041
  return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
18042
18042
  });
18043
- function join14(array2, separator) {
18043
+ function join12(array2, separator) {
18044
18044
  return array2 == null ? "" : nativeJoin.call(array2, separator);
18045
18045
  }
18046
18046
  function last(array2) {
@@ -18062,7 +18062,7 @@ var require_lodash = __commonJS((exports, module) => {
18062
18062
  function nth(array2, n2) {
18063
18063
  return array2 && array2.length ? baseNth(array2, toInteger(n2)) : undefined2;
18064
18064
  }
18065
- var pull2 = baseRest(pullAll);
18065
+ var pull = baseRest(pullAll);
18066
18066
  function pullAll(array2, values2) {
18067
18067
  return array2 && array2.length && values2 && values2.length ? basePullAll(array2, values2) : array2;
18068
18068
  }
@@ -19827,7 +19827,7 @@ __p += '`;
19827
19827
  lodash.pickBy = pickBy;
19828
19828
  lodash.property = property;
19829
19829
  lodash.propertyOf = propertyOf;
19830
- lodash.pull = pull2;
19830
+ lodash.pull = pull;
19831
19831
  lodash.pullAll = pullAll;
19832
19832
  lodash.pullAllBy = pullAllBy;
19833
19833
  lodash.pullAllWith = pullAllWith;
@@ -19972,7 +19972,7 @@ __p += '`;
19972
19972
  lodash.isUndefined = isUndefined;
19973
19973
  lodash.isWeakMap = isWeakMap;
19974
19974
  lodash.isWeakSet = isWeakSet;
19975
- lodash.join = join14;
19975
+ lodash.join = join12;
19976
19976
  lodash.kebabCase = kebabCase2;
19977
19977
  lodash.last = last;
19978
19978
  lodash.lastIndexOf = lastIndexOf;
@@ -20601,7 +20601,7 @@ function cleanDoc(doc2) {
20601
20601
  return mapDoc(doc2, (currentDoc) => cleanDocFn(currentDoc));
20602
20602
  }
20603
20603
  function replaceEndOfLine(doc2, replacement = literalline) {
20604
- return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ? join14(replacement, currentDoc.split(`
20604
+ return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ? join12(replacement, currentDoc.split(`
20605
20605
  `)) : currentDoc);
20606
20606
  }
20607
20607
  function canBreakFn(doc2) {
@@ -20681,7 +20681,7 @@ function indentIfBreak(contents, options) {
20681
20681
  negate: options.negate
20682
20682
  };
20683
20683
  }
20684
- function join14(separator, docs) {
20684
+ function join12(separator, docs) {
20685
20685
  assertDoc(separator);
20686
20686
  assertDocArray(docs);
20687
20687
  const parts = [];
@@ -21392,7 +21392,7 @@ var init_doc = __esm(() => {
21392
21392
  MODE_FLAT = Symbol("MODE_FLAT");
21393
21393
  DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
21394
21394
  builders = {
21395
- join: join14,
21395
+ join: join12,
21396
21396
  line,
21397
21397
  softline,
21398
21398
  hardline,
@@ -126306,7 +126306,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
126306
126306
  return mapDoc2(doc2, (currentDoc) => cleanDocFn2(currentDoc));
126307
126307
  }
126308
126308
  function replaceEndOfLine2(doc2, replacement = literalline2) {
126309
- return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ? join16(replacement, currentDoc.split(`
126309
+ return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ? join14(replacement, currentDoc.split(`
126310
126310
  `)) : currentDoc);
126311
126311
  }
126312
126312
  function canBreakFn2(doc2) {
@@ -126392,7 +126392,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
126392
126392
  negate: options8.negate
126393
126393
  };
126394
126394
  }
126395
- function join16(separator, docs) {
126395
+ function join14(separator, docs) {
126396
126396
  assertDoc2(separator);
126397
126397
  assertDocArray2(docs);
126398
126398
  const parts = [];
@@ -127057,7 +127057,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
127057
127057
  }
127058
127058
  }
127059
127059
  var builders2 = {
127060
- join: join16,
127060
+ join: join14,
127061
127061
  line: line3,
127062
127062
  softline: softline2,
127063
127063
  hardline: hardline4,
@@ -156272,10 +156272,10 @@ var require_view = __commonJS((exports, module) => {
156272
156272
  var debug = require_src4()("express:view");
156273
156273
  var path18 = __require("node:path");
156274
156274
  var fs28 = __require("node:fs");
156275
- var dirname13 = path18.dirname;
156275
+ var dirname12 = path18.dirname;
156276
156276
  var basename4 = path18.basename;
156277
156277
  var extname2 = path18.extname;
156278
- var join17 = path18.join;
156278
+ var join15 = path18.join;
156279
156279
  var resolve6 = path18.resolve;
156280
156280
  module.exports = View;
156281
156281
  function View(name2, options8) {
@@ -156311,7 +156311,7 @@ var require_view = __commonJS((exports, module) => {
156311
156311
  for (var i5 = 0;i5 < roots.length && !path19; i5++) {
156312
156312
  var root2 = roots[i5];
156313
156313
  var loc = resolve6(root2, name2);
156314
- var dir = dirname13(loc);
156314
+ var dir = dirname12(loc);
156315
156315
  var file2 = basename4(loc);
156316
156316
  path19 = this.resolve(dir, file2);
156317
156317
  }
@@ -156337,12 +156337,12 @@ var require_view = __commonJS((exports, module) => {
156337
156337
  };
156338
156338
  View.prototype.resolve = function resolve7(dir, file2) {
156339
156339
  var ext = this.ext;
156340
- var path19 = join17(dir, file2);
156340
+ var path19 = join15(dir, file2);
156341
156341
  var stat2 = tryStat(path19);
156342
156342
  if (stat2 && stat2.isFile()) {
156343
156343
  return path19;
156344
156344
  }
156345
- path19 = join17(dir, basename4(file2, ext), "index" + ext);
156345
+ path19 = join15(dir, basename4(file2, ext), "index" + ext);
156346
156346
  stat2 = tryStat(path19);
156347
156347
  if (stat2 && stat2.isFile()) {
156348
156348
  return path19;
@@ -160037,7 +160037,7 @@ var require_send = __commonJS((exports, module) => {
160037
160037
  var Stream2 = __require("stream");
160038
160038
  var util2 = __require("util");
160039
160039
  var extname2 = path18.extname;
160040
- var join17 = path18.join;
160040
+ var join15 = path18.join;
160041
160041
  var normalize = path18.normalize;
160042
160042
  var resolve6 = path18.resolve;
160043
160043
  var sep = path18.sep;
@@ -160209,7 +160209,7 @@ var require_send = __commonJS((exports, module) => {
160209
160209
  return res;
160210
160210
  }
160211
160211
  parts = path19.split(sep);
160212
- path19 = normalize(join17(root2, path19));
160212
+ path19 = normalize(join15(root2, path19));
160213
160213
  } else {
160214
160214
  if (UP_PATH_REGEXP.test(path19)) {
160215
160215
  debug('malicious path "%s"', path19);
@@ -160349,7 +160349,7 @@ var require_send = __commonJS((exports, module) => {
160349
160349
  return self2.onStatError(err);
160350
160350
  return self2.error(404);
160351
160351
  }
160352
- var p4 = join17(path19, self2._index[i5]);
160352
+ var p4 = join15(path19, self2._index[i5]);
160353
160353
  debug('stat "%s"', p4);
160354
160354
  fs28.stat(p4, function(err2, stat2) {
160355
160355
  if (err2)
@@ -206944,7 +206944,7 @@ var require_buffer_list = __commonJS((exports, module) => {
206944
206944
  }
206945
206945
  }, {
206946
206946
  key: "join",
206947
- value: function join18(s5) {
206947
+ value: function join15(s5) {
206948
206948
  if (this.length === 0)
206949
206949
  return "";
206950
206950
  var p4 = this.head;
@@ -210671,7 +210671,7 @@ var {
210671
210671
  } = import__.default;
210672
210672
 
210673
210673
  // src/cli/commands/agents/pull.ts
210674
- import { dirname as dirname8, join as join10 } from "node:path";
210674
+ import { dirname as dirname8, join as join9 } from "node:path";
210675
210675
 
210676
210676
  // node_modules/@clack/core/dist/index.mjs
210677
210677
  var import_picocolors = __toESM(require_picocolors(), 1);
@@ -225313,6 +225313,9 @@ var UserInfoSchema = exports_external.object({
225313
225313
  name: exports_external.string()
225314
225314
  });
225315
225315
 
225316
+ // src/core/clients/base44-client.ts
225317
+ import { randomUUID as randomUUID2 } from "node:crypto";
225318
+
225316
225319
  // node_modules/ky/distribution/errors/HTTPError.js
225317
225320
  class HTTPError extends Error {
225318
225321
  response;
@@ -226214,11 +226217,18 @@ function getBase44GlobalDir() {
226214
226217
  function getAuthFilePath() {
226215
226218
  return join(getBase44GlobalDir(), "auth", "auth.json");
226216
226219
  }
226217
- function getTemplatesDir() {
226218
- return join(__dirname2, "../templates");
226220
+ function getTemplatesDir(assetsDir) {
226221
+ if (assetsDir)
226222
+ return join(assetsDir, "templates");
226223
+ return join(__dirname2, "../assets/templates");
226219
226224
  }
226220
- function getTemplatesIndexPath() {
226221
- return join(getTemplatesDir(), "templates.json");
226225
+ function getTemplatesIndexPath(assetsDir) {
226226
+ return join(getTemplatesDir(assetsDir), "templates.json");
226227
+ }
226228
+ function getDenoWrapperPath(assetsDir) {
226229
+ if (assetsDir)
226230
+ return join(assetsDir, "deno-runtime", "main.js");
226231
+ return join(__dirname2, "../assets/deno-runtime/main.js");
226222
226232
  }
226223
226233
  function getAppConfigPath(projectRoot) {
226224
226234
  return join(projectRoot, PROJECT_SUBDIR, ".app.jsonc");
@@ -233172,7 +233182,7 @@ var generateGlobTasks = normalizeArguments(generateTasks);
233172
233182
  var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
233173
233183
 
233174
233184
  // src/core/project/config.ts
233175
- import { dirname as dirname6, join as join7 } from "node:path";
233185
+ import { dirname as dirname6, join as join6 } from "node:path";
233176
233186
 
233177
233187
  // src/core/resources/agent/schema.ts
233178
233188
  var EntityOperationSchema = exports_external.enum(["create", "update", "delete", "read"]);
@@ -233902,23 +233912,11 @@ var BackendFunctionSchema = FunctionConfigSchema.extend({
233902
233912
  entryPath: exports_external.string().min(1, "Entry path cannot be empty"),
233903
233913
  filePaths: exports_external.array(exports_external.string()).min(1, "Function must have at least one file")
233904
233914
  });
233905
- var DeploySingleFunctionResponseSchema = exports_external.object({
233906
- status: exports_external.enum(["deployed", "unchanged"])
233907
- });
233908
- var FunctionAutomationInfoSchema = exports_external.object({
233909
- name: exports_external.string(),
233910
- type: exports_external.string(),
233911
- is_active: exports_external.boolean()
233912
- });
233913
- var FunctionInfoSchema = exports_external.object({
233914
- name: exports_external.string(),
233915
- deployment_id: exports_external.string(),
233916
- entry: exports_external.string(),
233917
- files: exports_external.array(FunctionFileSchema),
233918
- automations: exports_external.array(FunctionAutomationInfoSchema)
233919
- });
233920
- var ListFunctionsResponseSchema = exports_external.object({
233921
- functions: exports_external.array(FunctionInfoSchema)
233915
+ var DeployFunctionsResponseSchema = exports_external.object({
233916
+ deployed: exports_external.array(exports_external.string()),
233917
+ deleted: exports_external.array(exports_external.string()),
233918
+ skipped: exports_external.array(exports_external.string()).optional().nullable(),
233919
+ errors: exports_external.array(exports_external.object({ name: exports_external.string(), message: exports_external.string() })).nullable()
233922
233920
  });
233923
233921
  var LogLevelSchema = exports_external.enum(["info", "warning", "error", "debug"]);
233924
233922
  var FunctionLogEntrySchema = exports_external.object({
@@ -233929,37 +233927,29 @@ var FunctionLogEntrySchema = exports_external.object({
233929
233927
  var FunctionLogsResponseSchema = exports_external.array(FunctionLogEntrySchema);
233930
233928
 
233931
233929
  // src/core/resources/function/api.ts
233932
- async function deploySingleFunction(name2, payload) {
233933
- const appClient = getAppClient();
233934
- let response;
233935
- try {
233936
- response = await appClient.put(`backend-functions/${encodeURIComponent(name2)}`, { json: payload, timeout: false });
233937
- } catch (error48) {
233938
- throw await ApiError.fromHttpError(error48, `deploying function "${name2}"`);
233939
- }
233940
- const result = DeploySingleFunctionResponseSchema.safeParse(await response.json());
233941
- if (!result.success) {
233942
- throw new SchemaValidationError("Invalid response from server", result.error);
233943
- }
233944
- return result.data;
233945
- }
233946
- async function deleteSingleFunction(name2) {
233947
- const appClient = getAppClient();
233948
- try {
233949
- await appClient.delete(`backend-functions/${encodeURIComponent(name2)}`, { timeout: 60000 });
233950
- } catch (error48) {
233951
- throw await ApiError.fromHttpError(error48, `deleting function "${name2}"`);
233952
- }
233930
+ function toDeployPayloadItem(fn) {
233931
+ return {
233932
+ name: fn.name,
233933
+ entry: fn.entry,
233934
+ files: fn.files,
233935
+ automations: fn.automations
233936
+ };
233953
233937
  }
233954
- async function listDeployedFunctions() {
233938
+ async function deployFunctions(functions) {
233955
233939
  const appClient = getAppClient();
233940
+ const payload = {
233941
+ functions: functions.map(toDeployPayloadItem)
233942
+ };
233956
233943
  let response;
233957
233944
  try {
233958
- response = await appClient.get("backend-functions", { timeout: 30000 });
233945
+ response = await appClient.put("backend-functions", {
233946
+ json: payload,
233947
+ timeout: false
233948
+ });
233959
233949
  } catch (error48) {
233960
- throw await ApiError.fromHttpError(error48, "listing deployed functions");
233950
+ throw await ApiError.fromHttpError(error48, "deploying functions");
233961
233951
  }
233962
- const result = ListFunctionsResponseSchema.safeParse(await response.json());
233952
+ const result = DeployFunctionsResponseSchema.safeParse(await response.json());
233963
233953
  if (!result.success) {
233964
233954
  throw new SchemaValidationError("Invalid response from server", result.error);
233965
233955
  }
@@ -234082,131 +234072,24 @@ async function readAllFunctions(functionsDir) {
234082
234072
  import { dirname as dirname5, relative as relative2 } from "node:path";
234083
234073
  async function loadFunctionCode(fn) {
234084
234074
  const functionDir = dirname5(fn.entryPath);
234085
- const resolvedFiles = await Promise.all(fn.filePaths.map(async (filePath) => {
234075
+ const loadedFiles = await Promise.all(fn.filePaths.map(async (filePath) => {
234086
234076
  const content = await readTextFile(filePath);
234087
234077
  const path11 = relative2(functionDir, filePath).split(/[/\\]/).join("/");
234088
234078
  return { path: path11, content };
234089
234079
  }));
234090
- return { ...fn, files: resolvedFiles };
234080
+ return { ...fn, files: loadedFiles };
234091
234081
  }
234092
- async function deployOne(fn) {
234093
- const start = Date.now();
234094
- try {
234095
- const functionWithCode = await loadFunctionCode(fn);
234096
- const response = await deploySingleFunction(functionWithCode.name, {
234097
- entry: functionWithCode.entry,
234098
- files: functionWithCode.files,
234099
- automations: functionWithCode.automations
234100
- });
234101
- return {
234102
- name: functionWithCode.name,
234103
- status: response.status,
234104
- durationMs: Date.now() - start
234105
- };
234106
- } catch (error48) {
234107
- return {
234108
- name: fn.name,
234109
- status: "error",
234110
- error: error48 instanceof Error ? error48.message : String(error48)
234111
- };
234112
- }
234113
- }
234114
- async function deployFunctionsSequentially(functions, options) {
234115
- if (functions.length === 0)
234116
- return [];
234117
- const results = [];
234118
- for (const fn of functions) {
234119
- options?.onStart?.([fn.name]);
234120
- const result = await deployOne(fn);
234121
- results.push(result);
234122
- options?.onResult?.(result);
234123
- }
234124
- return results;
234125
- }
234126
- async function pruneRemovedFunctions(localFunctionNames) {
234127
- const remote = await listDeployedFunctions();
234128
- const localSet = new Set(localFunctionNames);
234129
- const toDelete = remote.functions.filter((f) => !localSet.has(f.name));
234130
- const results = [];
234131
- for (const fn of toDelete) {
234132
- try {
234133
- await deleteSingleFunction(fn.name);
234134
- results.push({ name: fn.name, deleted: true });
234135
- } catch (error48) {
234136
- results.push({
234137
- name: fn.name,
234138
- deleted: false,
234139
- error: error48 instanceof Error ? error48.message : String(error48)
234140
- });
234141
- }
234142
- }
234143
- return results;
234144
- }
234145
- // src/core/resources/function/pull.ts
234146
- import { join as join6 } from "node:path";
234147
- async function writeFunctions(functionsDir, functions) {
234148
- const written = [];
234149
- const skipped = [];
234150
- for (const fn of functions) {
234151
- const functionDir = join6(functionsDir, fn.name);
234152
- const configPath = join6(functionDir, "function.jsonc");
234153
- if (await isFunctionUnchanged(functionDir, fn)) {
234154
- skipped.push(fn.name);
234155
- continue;
234156
- }
234157
- const config5 = {
234158
- name: fn.name,
234159
- entry: fn.entry
234160
- };
234161
- if (fn.automations.length > 0) {
234162
- config5.automations = fn.automations;
234163
- }
234164
- await writeJsonFile(configPath, config5);
234165
- for (const file2 of fn.files) {
234166
- await writeFile(join6(functionDir, file2.path), file2.content);
234167
- }
234168
- written.push(fn.name);
234169
- }
234170
- return { written, skipped };
234171
- }
234172
- async function isFunctionUnchanged(functionDir, fn) {
234173
- if (!await pathExists(functionDir)) {
234174
- return false;
234175
- }
234176
- const configPath = join6(functionDir, "function.jsonc");
234177
- try {
234178
- const localConfig = await readJsonFile(configPath);
234179
- if (localConfig.entry !== fn.entry) {
234180
- return false;
234181
- }
234182
- const localAuto = JSON.stringify(localConfig.automations ?? []);
234183
- const remoteAuto = JSON.stringify(fn.automations);
234184
- if (localAuto !== remoteAuto) {
234185
- return false;
234186
- }
234187
- } catch {
234188
- return false;
234189
- }
234190
- for (const file2 of fn.files) {
234191
- const filePath = join6(functionDir, file2.path);
234192
- if (!await pathExists(filePath)) {
234193
- return false;
234194
- }
234195
- try {
234196
- const localContent = await readTextFile(filePath);
234197
- if (localContent !== file2.content) {
234198
- return false;
234199
- }
234200
- } catch {
234201
- return false;
234202
- }
234082
+ async function pushFunctions(functions) {
234083
+ if (functions.length === 0) {
234084
+ return { deployed: [], deleted: [], skipped: [], errors: null };
234203
234085
  }
234204
- return true;
234086
+ const functionsWithCode = await Promise.all(functions.map(loadFunctionCode));
234087
+ return deployFunctions(functionsWithCode);
234205
234088
  }
234206
234089
  // src/core/resources/function/resource.ts
234207
234090
  var functionResource = {
234208
234091
  readAll: readAllFunctions,
234209
- push: (functions) => deployFunctionsSequentially(functions)
234092
+ push: pushFunctions
234210
234093
  };
234211
234094
  // src/core/project/config.ts
234212
234095
  async function findConfigInDir(dir) {
@@ -234247,10 +234130,10 @@ async function readProjectConfig(projectRoot) {
234247
234130
  const project = result.data;
234248
234131
  const configDir = dirname6(configPath);
234249
234132
  const [entities, functions, agents, connectors] = await Promise.all([
234250
- entityResource.readAll(join7(configDir, project.entitiesDir)),
234251
- functionResource.readAll(join7(configDir, project.functionsDir)),
234252
- agentResource.readAll(join7(configDir, project.agentsDir)),
234253
- connectorResource.readAll(join7(configDir, project.connectorsDir))
234133
+ entityResource.readAll(join6(configDir, project.entitiesDir)),
234134
+ functionResource.readAll(join6(configDir, project.functionsDir)),
234135
+ agentResource.readAll(join6(configDir, project.agentsDir)),
234136
+ connectorResource.readAll(join6(configDir, project.connectorsDir))
234254
234137
  ]);
234255
234138
  return {
234256
234139
  project: { ...project, root, configPath },
@@ -234347,33 +234230,34 @@ async function readAppConfig(projectRoot) {
234347
234230
  // src/core/project/template.ts
234348
234231
  var import_ejs = __toESM(require_ejs(), 1);
234349
234232
  var import_front_matter = __toESM(require_front_matter(), 1);
234350
- import { dirname as dirname7, join as join8 } from "node:path";
234351
- async function listTemplates() {
234352
- const parsed = await readJsonFile(getTemplatesIndexPath());
234233
+ import { dirname as dirname7, join as join7 } from "node:path";
234234
+ async function listTemplates(assetsDir) {
234235
+ const indexPath = getTemplatesIndexPath(assetsDir);
234236
+ const parsed = await readJsonFile(indexPath);
234353
234237
  const result = TemplatesConfigSchema.safeParse(parsed);
234354
234238
  if (!result.success) {
234355
- throw new SchemaValidationError("Invalid templates configuration", result.error, getTemplatesIndexPath());
234239
+ throw new SchemaValidationError("Invalid templates configuration", result.error, indexPath);
234356
234240
  }
234357
234241
  return result.data.templates;
234358
234242
  }
234359
- async function renderTemplate(template, destPath, data) {
234360
- const templateDir = join8(getTemplatesDir(), template.path);
234243
+ async function renderTemplate(template, destPath, data, assetsDir) {
234244
+ const templateDir = join7(getTemplatesDir(assetsDir), template.path);
234361
234245
  const files = await globby("**/*", {
234362
234246
  cwd: templateDir,
234363
234247
  dot: true,
234364
234248
  onlyFiles: true
234365
234249
  });
234366
234250
  for (const file2 of files) {
234367
- const srcPath = join8(templateDir, file2);
234251
+ const srcPath = join7(templateDir, file2);
234368
234252
  try {
234369
234253
  if (file2.endsWith(".ejs")) {
234370
234254
  const rendered = await import_ejs.default.renderFile(srcPath, data);
234371
234255
  const { attributes, body } = import_front_matter.default(rendered);
234372
- const destFile = attributes.outputFileName ? join8(dirname7(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
234373
- const destFilePath = join8(destPath, destFile);
234256
+ const destFile = attributes.outputFileName ? join7(dirname7(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
234257
+ const destFilePath = join7(destPath, destFile);
234374
234258
  await writeFile(destFilePath, body);
234375
234259
  } else {
234376
- const destFilePath = join8(destPath, file2);
234260
+ const destFilePath = join7(destPath, file2);
234377
234261
  await copyFile(srcPath, destFilePath);
234378
234262
  }
234379
234263
  } catch (error48) {
@@ -234394,14 +234278,10 @@ async function assertProjectNotExists(dirPath) {
234394
234278
  }
234395
234279
  }
234396
234280
  async function createProjectFiles(options) {
234397
- const { name: name2, description, path: basePath, template } = options;
234281
+ const { name: name2, description, path: basePath, template, assetsDir } = options;
234398
234282
  await assertProjectNotExists(basePath);
234399
234283
  const { projectId } = await createProject(name2, description);
234400
- await renderTemplate(template, basePath, {
234401
- name: name2,
234402
- description,
234403
- projectId
234404
- });
234284
+ await renderTemplate(template, basePath, { name: name2, description, projectId }, assetsDir);
234405
234285
  return {
234406
234286
  projectId,
234407
234287
  projectDir: basePath
@@ -234476,7 +234356,7 @@ async function getSiteFilePaths(outputDir) {
234476
234356
  // src/core/site/deploy.ts
234477
234357
  import { randomUUID } from "node:crypto";
234478
234358
  import { tmpdir } from "node:os";
234479
- import { join as join9 } from "node:path";
234359
+ import { join as join8 } from "node:path";
234480
234360
  async function deploySite(siteOutputDir) {
234481
234361
  if (!await pathExists(siteOutputDir)) {
234482
234362
  throw new InvalidInputError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
@@ -234493,7 +234373,7 @@ async function deploySite(siteOutputDir) {
234493
234373
  ]
234494
234374
  });
234495
234375
  }
234496
- const archivePath = join9(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
234376
+ const archivePath = join8(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
234497
234377
  try {
234498
234378
  await createArchive(siteOutputDir, archivePath);
234499
234379
  return await uploadSite(archivePath);
@@ -234518,13 +234398,10 @@ function hasResourcesToDeploy(projectData) {
234518
234398
  const hasConnectors = connectors.length > 0;
234519
234399
  return hasEntities || hasFunctions || hasAgents || hasConnectors || hasSite;
234520
234400
  }
234521
- async function deployAll(projectData, options) {
234401
+ async function deployAll(projectData) {
234522
234402
  const { project, entities, functions, agents, connectors } = projectData;
234523
234403
  await entityResource.push(entities);
234524
- await deployFunctionsSequentially(functions, {
234525
- onStart: options?.onFunctionStart,
234526
- onResult: options?.onFunctionResult
234527
- });
234404
+ await functionResource.push(functions);
234528
234405
  await agentResource.push(agents);
234529
234406
  const { results: connectorResults } = await pushConnectors(connectors);
234530
234407
  if (project.site?.outputDirectory) {
@@ -234558,8 +234435,12 @@ async function handleUnauthorized(request, _options, response) {
234558
234435
  return;
234559
234436
  }
234560
234437
  retriedRequests.add(request);
234438
+ const requestId = request.headers.get("X-Request-ID");
234561
234439
  return distribution_default(request.clone(), {
234562
- headers: { Authorization: `Bearer ${newAccessToken}` }
234440
+ headers: {
234441
+ ...requestId && { "X-Request-ID": requestId },
234442
+ Authorization: `Bearer ${newAccessToken}`
234443
+ }
234563
234444
  });
234564
234445
  }
234565
234446
  var base44Client = distribution_default.create({
@@ -234569,6 +234450,9 @@ var base44Client = distribution_default.create({
234569
234450
  },
234570
234451
  hooks: {
234571
234452
  beforeRequest: [
234453
+ (request) => {
234454
+ request.headers.set("X-Request-ID", randomUUID2());
234455
+ },
234572
234456
  captureRequestBody,
234573
234457
  async (request) => {
234574
234458
  try {
@@ -234594,10 +234478,18 @@ function getAppClient() {
234594
234478
  });
234595
234479
  }
234596
234480
  // src/core/clients/oauth-client.ts
234481
+ import { randomUUID as randomUUID3 } from "node:crypto";
234597
234482
  var oauthClient = distribution_default.create({
234598
234483
  prefixUrl: getBase44ApiUrl(),
234599
234484
  headers: {
234600
234485
  "User-Agent": "Base44 CLI"
234486
+ },
234487
+ hooks: {
234488
+ beforeRequest: [
234489
+ (request) => {
234490
+ request.headers.set("X-Request-ID", randomUUID3());
234491
+ }
234492
+ ]
234601
234493
  }
234602
234494
  });
234603
234495
  // src/core/auth/api.ts
@@ -234742,7 +234634,8 @@ async function deleteSecret(name2) {
234742
234634
  let response;
234743
234635
  try {
234744
234636
  response = await appClient.delete("secrets", {
234745
- searchParams: { secret_name: name2 }
234637
+ searchParams: { secret_name: name2 },
234638
+ timeout: false
234746
234639
  });
234747
234640
  } catch (error48) {
234748
234641
  throw await ApiError.fromHttpError(error48, "deleting secret");
@@ -242059,8 +241952,8 @@ var package_default = {
242059
241952
  "bin"
242060
241953
  ],
242061
241954
  scripts: {
242062
- build: "bun run clean && cp -r templates dist/ && bun run infra/build.ts",
242063
- "build:watch": "bun run clean && cp -r templates dist/ && bun run infra/build.ts --watch",
241955
+ build: "bun run clean && mkdir -p dist/assets && cp -r templates dist/assets/ && bun run infra/build.ts",
241956
+ "build:watch": "bun run clean && mkdir -p dist/assets && cp -r templates dist/assets/ && bun run infra/build.ts --watch",
242064
241957
  typecheck: "tsc --noEmit",
242065
241958
  dev: "./bin/dev.ts",
242066
241959
  start: "./bin/run.js",
@@ -242069,6 +241962,7 @@ var package_default = {
242069
241962
  "lint:fix": "biome check --write src tests",
242070
241963
  test: "vitest run",
242071
241964
  "test:watch": "vitest",
241965
+ "build:binaries": "bun run infra/build-binaries.ts",
242072
241966
  knip: "knip",
242073
241967
  "knip:fix": "knip --fix"
242074
241968
  },
@@ -242258,7 +242152,7 @@ function getDashboardUrl(projectId) {
242258
242152
  async function pullAgentsAction() {
242259
242153
  const { project: project2 } = await readProjectConfig();
242260
242154
  const configDir = dirname8(project2.configPath);
242261
- const agentsDir = join10(configDir, project2.agentsDir);
242155
+ const agentsDir = join9(configDir, project2.agentsDir);
242262
242156
  const remoteAgents = await runTask("Fetching agents from Base44", async () => {
242263
242157
  return await fetchAgents();
242264
242158
  }, {
@@ -242352,11 +242246,11 @@ function getWhoamiCommand(context) {
242352
242246
  }
242353
242247
 
242354
242248
  // src/cli/commands/connectors/pull.ts
242355
- import { dirname as dirname9, join as join11 } from "node:path";
242249
+ import { dirname as dirname9, join as join10 } from "node:path";
242356
242250
  async function pullConnectorsAction() {
242357
242251
  const { project: project2 } = await readProjectConfig();
242358
242252
  const configDir = dirname9(project2.configPath);
242359
- const connectorsDir = join11(configDir, project2.connectorsDir);
242253
+ const connectorsDir = join10(configDir, project2.connectorsDir);
242360
242254
  const remoteConnectors = await runTask("Fetching connectors from Base44", async () => {
242361
242255
  return await listConnectors();
242362
242256
  }, {
@@ -243204,229 +243098,50 @@ function getEntitiesPushCommand(context) {
243204
243098
  }));
243205
243099
  }
243206
243100
 
243207
- // src/cli/utils/parseNames.ts
243208
- function parseNames(args) {
243209
- return args.flatMap((arg) => arg.split(",")).map((n2) => n2.trim()).filter(Boolean);
243210
- }
243211
-
243212
- // src/cli/commands/functions/delete.ts
243213
- async function deleteFunctionsAction(names) {
243214
- let deleted = 0;
243215
- let notFound = 0;
243216
- let errors4 = 0;
243217
- let completed = 0;
243218
- const total = names.length;
243219
- for (const name2 of names) {
243220
- R2.step(theme.styles.dim(`[${completed + 1}/${total}] Deleting ${name2}...`));
243221
- try {
243222
- await deleteSingleFunction(name2);
243223
- R2.success(`${name2.padEnd(25)} deleted`);
243224
- deleted++;
243225
- } catch (error48) {
243226
- if (error48 instanceof ApiError && error48.statusCode === 404) {
243227
- R2.warn(`${name2.padEnd(25)} not found`);
243228
- notFound++;
243229
- } else {
243230
- R2.error(`${name2.padEnd(25)} error: ${error48 instanceof Error ? error48.message : String(error48)}`);
243231
- errors4++;
243232
- }
243233
- }
243234
- completed++;
243235
- }
243236
- if (names.length === 1) {
243237
- if (deleted)
243238
- return { outroMessage: `Function "${names[0]}" deleted` };
243239
- if (notFound)
243240
- return { outroMessage: `Function "${names[0]}" not found` };
243241
- return { outroMessage: `Failed to delete "${names[0]}"` };
243242
- }
243243
- const parts = [];
243244
- if (deleted > 0)
243245
- parts.push(`${deleted}/${total} deleted`);
243246
- if (notFound > 0)
243247
- parts.push(`${notFound} not found`);
243248
- if (errors4 > 0)
243249
- parts.push(`${errors4} error${errors4 !== 1 ? "s" : ""}`);
243250
- return { outroMessage: parts.join(", ") };
243251
- }
243252
- function getDeleteCommand(context) {
243253
- return new Command("delete").description("Delete deployed functions").argument("<names...>", "Function names to delete").action(async (rawNames) => {
243254
- await runCommand(() => {
243255
- const names = parseNames(rawNames);
243256
- if (names.length === 0) {
243257
- throw new InvalidInputError("At least one function name is required");
243258
- }
243259
- return deleteFunctionsAction(names);
243260
- }, { requireAuth: true }, context);
243261
- });
243262
- }
243263
-
243264
- // src/cli/utils/formatDeployResult.ts
243265
- function formatDuration(ms) {
243266
- return `${(ms / 1000).toFixed(1)}s`;
243267
- }
243268
- function formatDeployResult(result) {
243269
- const label = result.name.padEnd(25);
243270
- if (result.status === "deployed") {
243271
- const timing = result.durationMs ? theme.styles.dim(` (${formatDuration(result.durationMs)})`) : "";
243272
- R2.success(`${label} deployed${timing}`);
243273
- } else if (result.status === "unchanged") {
243274
- R2.success(`${label} unchanged`);
243275
- } else {
243276
- R2.error(`${label} error: ${result.error}`);
243277
- }
243278
- }
243279
-
243280
243101
  // src/cli/commands/functions/deploy.ts
243281
- function resolveFunctionsToDeploy(names, allFunctions) {
243282
- if (names.length === 0)
243283
- return allFunctions;
243284
- const notFound = names.filter((n2) => !allFunctions.some((f) => f.name === n2));
243285
- if (notFound.length > 0) {
243286
- throw new InvalidInputError(`Function${notFound.length > 1 ? "s" : ""} not found in project: ${notFound.join(", ")}`);
243287
- }
243288
- return allFunctions.filter((f) => names.includes(f.name));
243289
- }
243290
- function formatPruneResults(pruneResults) {
243291
- for (const pruneResult of pruneResults) {
243292
- if (pruneResult.deleted) {
243293
- R2.success(`${pruneResult.name.padEnd(25)} deleted`);
243294
- } else {
243295
- R2.error(`${pruneResult.name.padEnd(25)} error: ${pruneResult.error}`);
243296
- }
243297
- }
243298
- if (pruneResults.length > 0) {
243299
- const pruned = pruneResults.filter((r) => r.deleted).length;
243300
- R2.info(`${pruned} function${pruned !== 1 ? "s" : ""} removed`);
243301
- }
243302
- }
243303
- function buildDeploySummary(results) {
243304
- const deployed = results.filter((r) => r.status !== "error").length;
243305
- const failed = results.filter((r) => r.status === "error").length;
243306
- const parts = [];
243307
- if (deployed > 0)
243308
- parts.push(`${deployed}/${results.length} deployed`);
243309
- if (failed > 0)
243310
- parts.push(`${failed} error${failed !== 1 ? "s" : ""}`);
243311
- return parts.join(", ") || "No functions deployed";
243312
- }
243313
- async function deployFunctionsAction(names, options) {
243314
- if (options.force && names.length > 0) {
243315
- throw new InvalidInputError("--force cannot be used when specifying function names");
243316
- }
243102
+ async function deployFunctionsAction() {
243317
243103
  const { functions } = await readProjectConfig();
243318
- const toDeploy = resolveFunctionsToDeploy(names, functions);
243319
- if (toDeploy.length === 0) {
243104
+ if (functions.length === 0) {
243320
243105
  return {
243321
243106
  outroMessage: "No functions found. Create functions in the 'functions' directory."
243322
243107
  };
243323
243108
  }
243324
- R2.info(`Found ${toDeploy.length} ${toDeploy.length === 1 ? "function" : "functions"} to deploy`);
243325
- let completed = 0;
243326
- const total = toDeploy.length;
243327
- const results = await deployFunctionsSequentially(toDeploy, {
243328
- onStart: (startNames) => {
243329
- const label = startNames.length === 1 ? startNames[0] : `${startNames.length} functions`;
243330
- R2.step(theme.styles.dim(`[${completed + 1}/${total}] Deploying ${label}...`));
243331
- },
243332
- onResult: (result) => {
243333
- completed++;
243334
- formatDeployResult(result);
243335
- }
243336
- });
243337
- if (options.force) {
243338
- R2.info("Removing remote functions not found locally...");
243339
- const allLocalNames = functions.map((f) => f.name);
243340
- const pruneResults = await pruneRemovedFunctions(allLocalNames);
243341
- formatPruneResults(pruneResults);
243342
- }
243343
- return { outroMessage: buildDeploySummary(results) };
243344
- }
243345
- function getDeployCommand(context) {
243346
- return new Command("deploy").description("Deploy functions to Base44").argument("[names...]", "Function names to deploy (deploys all if omitted)").option("--force", "Delete remote functions not found locally").action(async (rawNames, options) => {
243347
- await runCommand(() => {
243348
- const names = parseNames(rawNames);
243349
- return deployFunctionsAction(names, options);
243350
- }, { requireAuth: true }, context);
243351
- });
243352
- }
243353
-
243354
- // src/cli/commands/functions/list.ts
243355
- async function listFunctionsAction() {
243356
- const { functions } = await listDeployedFunctions();
243357
- if (functions.length === 0) {
243358
- return { outroMessage: "No functions on remote" };
243359
- }
243360
- for (const fn of functions) {
243361
- const autoCount = fn.automations.length;
243362
- const autoLabel = autoCount > 0 ? theme.styles.dim(` (${autoCount} automation${autoCount > 1 ? "s" : ""})`) : "";
243363
- R2.message(` ${fn.name}${autoLabel}`);
243364
- }
243365
- return {
243366
- outroMessage: `${functions.length} function${functions.length !== 1 ? "s" : ""} on remote`
243367
- };
243368
- }
243369
- function getListCommand(context) {
243370
- return new Command("list").description("List all deployed functions").action(async () => {
243371
- await runCommand(listFunctionsAction, { requireAuth: true }, context);
243372
- });
243373
- }
243374
-
243375
- // src/cli/commands/functions/pull.ts
243376
- import { dirname as dirname10, join as join12 } from "node:path";
243377
- async function pullFunctionsAction(name2) {
243378
- const { project: project2 } = await readProjectConfig();
243379
- const configDir = dirname10(project2.configPath);
243380
- const functionsDir = join12(configDir, project2.functionsDir);
243381
- const remoteFunctions = await runTask("Fetching functions from Base44", async () => {
243382
- const { functions } = await listDeployedFunctions();
243383
- return functions;
243109
+ R2.info(`Found ${functions.length} ${functions.length === 1 ? "function" : "functions"} to deploy`);
243110
+ const result = await runTask("Deploying functions to Base44", async () => {
243111
+ return await pushFunctions(functions);
243384
243112
  }, {
243385
- successMessage: "Functions fetched successfully",
243386
- errorMessage: "Failed to fetch functions"
243113
+ successMessage: "Functions deployed successfully",
243114
+ errorMessage: "Failed to deploy functions"
243387
243115
  });
243388
- const toPull = name2 ? remoteFunctions.filter((f) => f.name === name2) : remoteFunctions;
243389
- if (name2 && toPull.length === 0) {
243390
- return {
243391
- outroMessage: `Function "${name2}" not found on remote`
243392
- };
243116
+ if (result.deployed.length > 0) {
243117
+ R2.success(`Deployed: ${result.deployed.join(", ")}`);
243393
243118
  }
243394
- if (toPull.length === 0) {
243395
- return { outroMessage: "No functions found on remote" };
243396
- }
243397
- const { written, skipped } = await runTask("Writing function files", async () => {
243398
- return await writeFunctions(functionsDir, toPull);
243399
- }, {
243400
- successMessage: "Function files written successfully",
243401
- errorMessage: "Failed to write function files"
243402
- });
243403
- for (const name3 of written) {
243404
- R2.success(`${name3.padEnd(25)} written`);
243119
+ if (result.deleted.length > 0) {
243120
+ R2.warn(`Deleted: ${result.deleted.join(", ")}`);
243405
243121
  }
243406
- for (const name3 of skipped) {
243407
- R2.info(`${name3.padEnd(25)} unchanged`);
243122
+ if (result.errors && result.errors.length > 0) {
243123
+ throw new ApiError("Function deployment errors", {
243124
+ details: result.errors.map((e2) => `'${e2.name}': ${e2.message}`),
243125
+ hints: [
243126
+ { message: "Check the function code for syntax errors" },
243127
+ { message: "Ensure all imports are valid" }
243128
+ ]
243129
+ });
243408
243130
  }
243409
- return {
243410
- outroMessage: `Pulled ${toPull.length} function${toPull.length !== 1 ? "s" : ""} to ${functionsDir}`
243411
- };
243131
+ return { outroMessage: "Functions deployed to Base44" };
243412
243132
  }
243413
- function getPullCommand(context) {
243414
- return new Command("pull").description("Pull deployed functions from Base44").argument("[name]", "Pull a single function by name").action(async (name2) => {
243415
- await runCommand(() => pullFunctionsAction(name2), { requireAuth: true }, context);
243416
- });
243417
- }
243418
-
243419
- // src/cli/commands/functions/index.ts
243420
- function getFunctionsCommand(context) {
243421
- return new Command("functions").description("Manage backend functions").addCommand(getDeployCommand(context)).addCommand(getPullCommand(context)).addCommand(getListCommand(context)).addCommand(getDeleteCommand(context));
243133
+ function getFunctionsDeployCommand(context) {
243134
+ return new Command("functions").description("Manage project functions").addCommand(new Command("deploy").description("Deploy local functions to Base44").action(async () => {
243135
+ await runCommand(deployFunctionsAction, { requireAuth: true }, context);
243136
+ }));
243422
243137
  }
243423
243138
 
243424
243139
  // src/cli/commands/project/create.ts
243425
- import { basename as basename3, join as join13, resolve as resolve2 } from "node:path";
243140
+ import { basename as basename3, join as join11, resolve as resolve2 } from "node:path";
243426
243141
  var import_kebabCase = __toESM(require_kebabCase(), 1);
243427
243142
  var DEFAULT_TEMPLATE_ID = "backend-only";
243428
- async function getTemplateById(templateId) {
243429
- const templates = await listTemplates();
243143
+ async function getTemplateById(templateId, assetsDir) {
243144
+ const templates = await listTemplates(assetsDir);
243430
243145
  const template2 = templates.find((t) => t.id === templateId);
243431
243146
  if (!template2) {
243432
243147
  const validIds = templates.map((t) => t.id).join(", ");
@@ -243442,8 +243157,8 @@ function validateNonInteractiveFlags(command) {
243442
243157
  command.error("Non-interactive mode requires all flags: --name, --path");
243443
243158
  }
243444
243159
  }
243445
- async function createInteractive(options) {
243446
- const templates = await listTemplates();
243160
+ async function createInteractive(options, assetsDir) {
243161
+ const templates = await listTemplates(assetsDir);
243447
243162
  const templateOptions = templates.map((t) => ({
243448
243163
  value: t,
243449
243164
  label: t.name,
@@ -243484,10 +243199,10 @@ async function createInteractive(options) {
243484
243199
  deploy: options.deploy,
243485
243200
  skills: options.skills,
243486
243201
  isInteractive: true
243487
- });
243202
+ }, assetsDir);
243488
243203
  }
243489
- async function createNonInteractive(options) {
243490
- const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
243204
+ async function createNonInteractive(options, assetsDir) {
243205
+ const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID, assetsDir);
243491
243206
  return await executeCreate({
243492
243207
  template: template2,
243493
243208
  name: options.name,
@@ -243495,7 +243210,7 @@ async function createNonInteractive(options) {
243495
243210
  deploy: options.deploy,
243496
243211
  skills: options.skills,
243497
243212
  isInteractive: false
243498
- });
243213
+ }, assetsDir);
243499
243214
  }
243500
243215
  async function executeCreate({
243501
243216
  template: template2,
@@ -243505,7 +243220,7 @@ async function executeCreate({
243505
243220
  deploy: deploy5,
243506
243221
  skills,
243507
243222
  isInteractive
243508
- }) {
243223
+ }, assetsDir) {
243509
243224
  const name2 = rawName.trim();
243510
243225
  const resolvedPath = resolve2(projectPath);
243511
243226
  const { projectId } = await runTask("Setting up your project...", async () => {
@@ -243513,7 +243228,8 @@ async function executeCreate({
243513
243228
  name: name2,
243514
243229
  description: description?.trim(),
243515
243230
  path: resolvedPath,
243516
- template: template2
243231
+ template: template2,
243232
+ assetsDir
243517
243233
  });
243518
243234
  }, {
243519
243235
  successMessage: theme.colors.base44Orange("Project created successfully"),
@@ -243558,7 +243274,7 @@ async function executeCreate({
243558
243274
  updateMessage("Building project...");
243559
243275
  await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
243560
243276
  updateMessage("Deploying site...");
243561
- return await deploySite(join13(resolvedPath, outputDirectory));
243277
+ return await deploySite(join11(resolvedPath, outputDirectory));
243562
243278
  }, {
243563
243279
  successMessage: theme.colors.base44Orange("Site deployed successfully"),
243564
243280
  errorMessage: "Failed to deploy site"
@@ -243591,9 +243307,9 @@ function getCreateCommand(context) {
243591
243307
  return new Command("create").description("Create a new Base44 project").addArgument(new Argument("name", "Project name").argOptional()).option("-p, --path <path>", "Path where to create the project").option("-t, --template <id>", "Template ID (e.g., backend-only, backend-and-client)").option("--deploy", "Build and deploy the site").option("--no-skills", "Skip AI agent skills installation").hook("preAction", validateNonInteractiveFlags).action(async (name2, options) => {
243592
243308
  const isNonInteractive = !!(options.name ?? name2) && !!options.path;
243593
243309
  if (isNonInteractive) {
243594
- await runCommand(() => createNonInteractive({ name: options.name ?? name2, ...options }), { requireAuth: true, requireAppConfig: false }, context);
243310
+ await runCommand(() => createNonInteractive({ name: options.name ?? name2, ...options }, context.assetsDir), { requireAuth: true, requireAppConfig: false }, context);
243595
243311
  } else {
243596
- await runCommand(() => createInteractive({ name: name2, ...options }), { fullBanner: true, requireAuth: true, requireAppConfig: false }, context);
243312
+ await runCommand(() => createInteractive({ name: name2, ...options }, context.assetsDir), { fullBanner: true, requireAuth: true, requireAppConfig: false }, context);
243597
243313
  }
243598
243314
  });
243599
243315
  }
@@ -243638,17 +243354,11 @@ ${summaryLines.join(`
243638
243354
  ${summaryLines.join(`
243639
243355
  `)}`);
243640
243356
  }
243641
- let functionCompleted = 0;
243642
- const functionTotal = functions.length;
243643
- const result = await deployAll(projectData, {
243644
- onFunctionStart: (names) => {
243645
- const label = names.length === 1 ? names[0] : `${names.length} functions`;
243646
- R2.step(theme.styles.dim(`[${functionCompleted + 1}/${functionTotal}] Deploying ${label}...`));
243647
- },
243648
- onFunctionResult: (r) => {
243649
- functionCompleted++;
243650
- formatDeployResult(r);
243651
- }
243357
+ const result = await runTask("Deploying your app...", async () => {
243358
+ return await deployAll(projectData);
243359
+ }, {
243360
+ successMessage: theme.colors.base44Orange("Deployment completed"),
243361
+ errorMessage: "Deployment failed"
243652
243362
  });
243653
243363
  const needsOAuth = filterPendingOAuth(result.connectorResults ?? []);
243654
243364
  if (needsOAuth.length > 0) {
@@ -243666,7 +243376,7 @@ ${summaryLines.join(`
243666
243376
  }
243667
243377
  return { outroMessage: "App deployed successfully" };
243668
243378
  }
243669
- function getDeployCommand2(context) {
243379
+ function getDeployCommand(context) {
243670
243380
  return new Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
243671
243381
  await runCommand(() => deployAction({
243672
243382
  ...options,
@@ -244190,10 +243900,10 @@ function toPascalCase(name2) {
244190
243900
  return name2.split(/[-_\s]+/).map((w8) => w8.charAt(0).toUpperCase() + w8.slice(1)).join("");
244191
243901
  }
244192
243902
  // src/core/types/update-project.ts
244193
- import { join as join16 } from "node:path";
243903
+ import { join as join14 } from "node:path";
244194
243904
  var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
244195
243905
  async function updateProjectConfig(projectRoot) {
244196
- const tsconfigPath = join16(projectRoot, "tsconfig.json");
243906
+ const tsconfigPath = join14(projectRoot, "tsconfig.json");
244197
243907
  if (!await pathExists(tsconfigPath)) {
244198
243908
  return false;
244199
243909
  }
@@ -244236,7 +243946,7 @@ function getTypesCommand(context) {
244236
243946
  }
244237
243947
 
244238
243948
  // src/cli/dev/dev-server/main.ts
244239
- import { dirname as dirname16, join as join20 } from "node:path";
243949
+ import { dirname as dirname14, join as join17 } from "node:path";
244240
243950
  var import_cors = __toESM(require_lib4(), 1);
244241
243951
  var import_express4 = __toESM(require_express(), 1);
244242
243952
 
@@ -244395,10 +244105,6 @@ function createDevLogger() {
244395
244105
 
244396
244106
  // src/cli/dev/dev-server/function-manager.ts
244397
244107
  import { spawn as spawn2, spawnSync as spawnSync2 } from "node:child_process";
244398
- import { dirname as dirname13, join as join17 } from "node:path";
244399
- import { fileURLToPath as fileURLToPath7 } from "node:url";
244400
- var __dirname5 = dirname13(fileURLToPath7(import.meta.url));
244401
- var WRAPPER_PATH = join17(__dirname5, "../deno-runtime/main.js");
244402
244108
  var READY_TIMEOUT = 30000;
244403
244109
 
244404
244110
  class FunctionManager {
@@ -244406,9 +244112,11 @@ class FunctionManager {
244406
244112
  running = new Map;
244407
244113
  starting = new Map;
244408
244114
  logger;
244409
- constructor(functions, logger) {
244115
+ wrapperPath;
244116
+ constructor(functions, logger, wrapperPath) {
244410
244117
  this.functions = new Map(functions.map((f7) => [f7.name, f7]));
244411
244118
  this.logger = logger;
244119
+ this.wrapperPath = wrapperPath;
244412
244120
  if (functions.length > 0) {
244413
244121
  this.verifyDenoIsInstalled();
244414
244122
  }
@@ -244481,7 +244189,7 @@ class FunctionManager {
244481
244189
  }
244482
244190
  spawnFunction(func, port) {
244483
244191
  this.logger.log(`Spawning function "${func.name}" on port ${port}`);
244484
- const process21 = spawn2("deno", ["run", "--allow-all", WRAPPER_PATH], {
244192
+ const process21 = spawn2("deno", ["run", "--allow-all", this.wrapperPath], {
244485
244193
  env: {
244486
244194
  ...globalThis.process.env,
244487
244195
  FUNCTION_PATH: func.entryPath,
@@ -244899,7 +244607,7 @@ function createEntityRoutes(db2, logger, remoteProxy, broadcast) {
244899
244607
  // src/cli/dev/dev-server/routes/integrations.ts
244900
244608
  var import_express3 = __toESM(require_express(), 1);
244901
244609
  var import_multer = __toESM(require_multer(), 1);
244902
- import { randomUUID as randomUUID2 } from "node:crypto";
244610
+ import { randomUUID as randomUUID4 } from "node:crypto";
244903
244611
  import fs28 from "node:fs";
244904
244612
  import path18 from "node:path";
244905
244613
  function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
@@ -244910,7 +244618,7 @@ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
244910
244618
  destination: mediaFilesDir,
244911
244619
  filename: (_req, file2, cb2) => {
244912
244620
  const ext = path18.extname(file2.originalname);
244913
- cb2(null, `${randomUUID2()}${ext}`);
244621
+ cb2(null, `${randomUUID4()}${ext}`);
244914
244622
  }
244915
244623
  });
244916
244624
  const MAX_FILE_SIZE = 50 * 1024 * 1024;
@@ -244937,7 +244645,7 @@ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
244937
244645
  res.status(400).json({ error: "file_uri is required" });
244938
244646
  return;
244939
244647
  }
244940
- const signature = randomUUID2();
244648
+ const signature = randomUUID4();
244941
244649
  const signed_url = `${baseUrl}/media/${file_uri}?signature=${signature}`;
244942
244650
  res.json({ signed_url });
244943
244651
  });
@@ -245702,9 +245410,9 @@ class NodeFsHandler {
245702
245410
  if (this.fsw.closed) {
245703
245411
  return;
245704
245412
  }
245705
- const dirname15 = sp2.dirname(file2);
245413
+ const dirname13 = sp2.dirname(file2);
245706
245414
  const basename5 = sp2.basename(file2);
245707
- const parent = this.fsw._getWatchedDir(dirname15);
245415
+ const parent = this.fsw._getWatchedDir(dirname13);
245708
245416
  let prevStats = stats;
245709
245417
  if (parent.has(basename5))
245710
245418
  return;
@@ -245731,7 +245439,7 @@ class NodeFsHandler {
245731
245439
  prevStats = newStats2;
245732
245440
  }
245733
245441
  } catch (error48) {
245734
- this.fsw._remove(dirname15, basename5);
245442
+ this.fsw._remove(dirname13, basename5);
245735
245443
  }
245736
245444
  } else if (parent.has(basename5)) {
245737
245445
  const at13 = newStats.atimeMs;
@@ -246692,7 +246400,7 @@ async function createDevServer(options8) {
246692
246400
  next();
246693
246401
  });
246694
246402
  const devLogger = createDevLogger();
246695
- const functionManager = new FunctionManager(functions, devLogger);
246403
+ const functionManager = new FunctionManager(functions, devLogger, options8.denoWrapperPath);
246696
246404
  const functionRoutes = createFunctionRouter(functionManager, devLogger);
246697
246405
  app.use("/api/apps/:appId/functions", functionRoutes);
246698
246406
  if (functionManager.getFunctionNames().length > 0) {
@@ -246734,8 +246442,8 @@ async function createDevServer(options8) {
246734
246442
  broadcastEntityEvent(io6, appId, entityName, event);
246735
246443
  };
246736
246444
  const base44ConfigWatcher = new WatchBase44({
246737
- functions: join20(dirname16(project2.configPath), project2.functionsDir),
246738
- entities: join20(dirname16(project2.configPath), project2.entitiesDir)
246445
+ functions: join17(dirname14(project2.configPath), project2.functionsDir),
246446
+ entities: join17(dirname14(project2.configPath), project2.entitiesDir)
246739
246447
  }, devLogger);
246740
246448
  base44ConfigWatcher.on("change", async (name2) => {
246741
246449
  try {
@@ -246779,10 +246487,11 @@ async function createDevServer(options8) {
246779
246487
  }
246780
246488
 
246781
246489
  // src/cli/commands/dev.ts
246782
- async function devAction(options8) {
246490
+ async function devAction(options8, context) {
246783
246491
  const port = options8.port ? Number(options8.port) : undefined;
246784
246492
  const { port: resolvedPort } = await createDevServer({
246785
246493
  port,
246494
+ denoWrapperPath: getDenoWrapperPath(context.assetsDir),
246786
246495
  loadResources: async () => {
246787
246496
  const { functions, entities, project: project2 } = await readProjectConfig();
246788
246497
  return { functions, entities, project: project2 };
@@ -246794,7 +246503,7 @@ async function devAction(options8) {
246794
246503
  }
246795
246504
  function getDevCommand(context) {
246796
246505
  return new Command("dev").description("Start the development server").option("-p, --port <number>", "Port for the development server").action(async (options8) => {
246797
- await runCommand(() => devAction(options8), { requireAuth: true }, context);
246506
+ await runCommand(() => devAction(options8, context), { requireAuth: true }, context);
246798
246507
  });
246799
246508
  }
246800
246509
 
@@ -246904,13 +246613,13 @@ function createProgram(context) {
246904
246613
  program2.addCommand(getLogoutCommand(context));
246905
246614
  program2.addCommand(getCreateCommand(context));
246906
246615
  program2.addCommand(getDashboardCommand(context));
246907
- program2.addCommand(getDeployCommand2(context));
246616
+ program2.addCommand(getDeployCommand(context));
246908
246617
  program2.addCommand(getLinkCommand(context));
246909
246618
  program2.addCommand(getEjectCommand(context));
246910
246619
  program2.addCommand(getEntitiesPushCommand(context));
246911
246620
  program2.addCommand(getAgentsCommand(context));
246912
246621
  program2.addCommand(getConnectorsCommand(context));
246913
- program2.addCommand(getFunctionsCommand(context));
246622
+ program2.addCommand(getFunctionsDeployCommand(context));
246914
246623
  program2.addCommand(getSecretsCommand(context));
246915
246624
  program2.addCommand(getSiteCommand(context));
246916
246625
  program2.addCommand(getTypesCommand(context));
@@ -246924,7 +246633,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
246924
246633
  import { release, type } from "node:os";
246925
246634
 
246926
246635
  // node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
246927
- import { dirname as dirname17, posix, sep } from "path";
246636
+ import { dirname as dirname15, posix, sep } from "path";
246928
246637
  function createModulerModifier() {
246929
246638
  const getModuleFromFileName = createGetModuleFromFilename();
246930
246639
  return async (frames) => {
@@ -246933,7 +246642,7 @@ function createModulerModifier() {
246933
246642
  return frames;
246934
246643
  };
246935
246644
  }
246936
- function createGetModuleFromFilename(basePath = process.argv[1] ? dirname17(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
246645
+ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname15(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
246937
246646
  const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
246938
246647
  return (filename) => {
246939
246648
  if (!filename)
@@ -251122,11 +250831,15 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
251122
250831
  });
251123
250832
  }
251124
250833
  // src/cli/index.ts
251125
- async function runCLI() {
250834
+ async function runCLI(options8) {
251126
250835
  const errorReporter = new ErrorReporter;
251127
250836
  errorReporter.registerProcessErrorHandlers();
251128
250837
  const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
251129
- const context = { errorReporter, isNonInteractive };
250838
+ const context = {
250839
+ errorReporter,
250840
+ isNonInteractive,
250841
+ assetsDir: options8?.assetsDir
250842
+ };
251130
250843
  const program2 = createProgram(context);
251131
250844
  try {
251132
250845
  const userInfo = await readAuth();
@@ -251151,4 +250864,4 @@ export {
251151
250864
  CLIExitError
251152
250865
  };
251153
250866
 
251154
- //# debugId=0324A58C26AC18BA64756E2164756E21
250867
+ //# debugId=D0A2D98BCA9348F864756E2164756E21