@base44-preview/cli 0.1.1-pr.555.9853704 → 0.1.1-pr.555.a141166

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
@@ -20114,7 +20114,7 @@ var require_lodash8 = __commonJS((exports, module) => {
20114
20114
  }
20115
20115
  return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
20116
20116
  });
20117
- function join15(array2, separator) {
20117
+ function join14(array2, separator) {
20118
20118
  return array2 == null ? "" : nativeJoin.call(array2, separator);
20119
20119
  }
20120
20120
  function last(array2) {
@@ -22046,7 +22046,7 @@ __p += '`;
22046
22046
  lodash.isUndefined = isUndefined;
22047
22047
  lodash.isWeakMap = isWeakMap;
22048
22048
  lodash.isWeakSet = isWeakSet;
22049
- lodash.join = join15;
22049
+ lodash.join = join14;
22050
22050
  lodash.kebabCase = kebabCase;
22051
22051
  lodash.last = last;
22052
22052
  lodash.lastIndexOf = lastIndexOf;
@@ -31158,7 +31158,7 @@ function cleanDoc(doc2) {
31158
31158
  return mapDoc(doc2, (currentDoc) => cleanDocFn(currentDoc));
31159
31159
  }
31160
31160
  function replaceEndOfLine(doc2, replacement = literalline) {
31161
- return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ? join24(replacement, currentDoc.split(`
31161
+ return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ? join23(replacement, currentDoc.split(`
31162
31162
  `)) : currentDoc);
31163
31163
  }
31164
31164
  function canBreakFn(doc2) {
@@ -31238,7 +31238,7 @@ function indentIfBreak(contents, options) {
31238
31238
  negate: options.negate
31239
31239
  };
31240
31240
  }
31241
- function join24(separator, docs) {
31241
+ function join23(separator, docs) {
31242
31242
  assertDoc(separator);
31243
31243
  assertDocArray(docs);
31244
31244
  const parts = [];
@@ -31949,7 +31949,7 @@ var init_doc = __esm(() => {
31949
31949
  MODE_FLAT = Symbol("MODE_FLAT");
31950
31950
  DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
31951
31951
  builders = {
31952
- join: join24,
31952
+ join: join23,
31953
31953
  line,
31954
31954
  softline,
31955
31955
  hardline,
@@ -136863,7 +136863,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
136863
136863
  return mapDoc2(doc2, (currentDoc) => cleanDocFn2(currentDoc));
136864
136864
  }
136865
136865
  function replaceEndOfLine2(doc2, replacement = literalline2) {
136866
- return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ? join26(replacement, currentDoc.split(`
136866
+ return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ? join25(replacement, currentDoc.split(`
136867
136867
  `)) : currentDoc);
136868
136868
  }
136869
136869
  function canBreakFn2(doc2) {
@@ -136949,7 +136949,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
136949
136949
  negate: options8.negate
136950
136950
  };
136951
136951
  }
136952
- function join26(separator, docs) {
136952
+ function join25(separator, docs) {
136953
136953
  assertDoc2(separator);
136954
136954
  assertDocArray2(docs);
136955
136955
  const parts = [];
@@ -137614,7 +137614,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
137614
137614
  }
137615
137615
  }
137616
137616
  var builders2 = {
137617
- join: join26,
137617
+ join: join25,
137618
137618
  line: line3,
137619
137619
  softline: softline2,
137620
137620
  hardline: hardline4,
@@ -163947,7 +163947,7 @@ var require_view = __commonJS((exports, module) => {
163947
163947
  var dirname22 = path18.dirname;
163948
163948
  var basename7 = path18.basename;
163949
163949
  var extname2 = path18.extname;
163950
- var join28 = path18.join;
163950
+ var join26 = path18.join;
163951
163951
  var resolve12 = path18.resolve;
163952
163952
  module.exports = View;
163953
163953
  function View(name2, options8) {
@@ -164009,12 +164009,12 @@ var require_view = __commonJS((exports, module) => {
164009
164009
  };
164010
164010
  View.prototype.resolve = function resolve13(dir, file2) {
164011
164011
  var ext = this.ext;
164012
- var path19 = join28(dir, file2);
164012
+ var path19 = join26(dir, file2);
164013
164013
  var stat2 = tryStat(path19);
164014
164014
  if (stat2 && stat2.isFile()) {
164015
164015
  return path19;
164016
164016
  }
164017
- path19 = join28(dir, basename7(file2, ext), "index" + ext);
164017
+ path19 = join26(dir, basename7(file2, ext), "index" + ext);
164018
164018
  stat2 = tryStat(path19);
164019
164019
  if (stat2 && stat2.isFile()) {
164020
164020
  return path19;
@@ -167709,7 +167709,7 @@ var require_send = __commonJS((exports, module) => {
167709
167709
  var Stream2 = __require("stream");
167710
167710
  var util2 = __require("util");
167711
167711
  var extname2 = path18.extname;
167712
- var join28 = path18.join;
167712
+ var join26 = path18.join;
167713
167713
  var normalize2 = path18.normalize;
167714
167714
  var resolve12 = path18.resolve;
167715
167715
  var sep = path18.sep;
@@ -167881,7 +167881,7 @@ var require_send = __commonJS((exports, module) => {
167881
167881
  return res;
167882
167882
  }
167883
167883
  parts = path19.split(sep);
167884
- path19 = normalize2(join28(root2, path19));
167884
+ path19 = normalize2(join26(root2, path19));
167885
167885
  } else {
167886
167886
  if (UP_PATH_REGEXP.test(path19)) {
167887
167887
  debug('malicious path "%s"', path19);
@@ -168021,7 +168021,7 @@ var require_send = __commonJS((exports, module) => {
168021
168021
  return self2.onStatError(err);
168022
168022
  return self2.error(404);
168023
168023
  }
168024
- var p4 = join28(path19, self2._index[i5]);
168024
+ var p4 = join26(path19, self2._index[i5]);
168025
168025
  debug('stat "%s"', p4);
168026
168026
  fs28.stat(p4, function(err2, stat2) {
168027
168027
  if (err2)
@@ -214616,7 +214616,7 @@ var require_buffer_list = __commonJS((exports, module) => {
214616
214616
  }
214617
214617
  }, {
214618
214618
  key: "join",
214619
- value: function join28(s5) {
214619
+ value: function join26(s5) {
214620
214620
  if (this.length === 0)
214621
214621
  return "";
214622
214622
  var p4 = this.head;
@@ -234018,7 +234018,7 @@ function normalizeBase44Env() {
234018
234018
  loadProjectEnvFiles();
234019
234019
 
234020
234020
  // src/cli/index.ts
234021
- import { dirname as dirname26, join as join31 } from "node:path";
234021
+ import { dirname as dirname26, join as join29 } from "node:path";
234022
234022
  import { fileURLToPath as fileURLToPath6 } from "node:url";
234023
234023
 
234024
234024
  // ../../node_modules/@clack/core/dist/index.mjs
@@ -235226,7 +235226,7 @@ var {
235226
235226
  } = import__.default;
235227
235227
 
235228
235228
  // src/cli/commands/agents/pull.ts
235229
- import { dirname as dirname12, join as join15 } from "node:path";
235229
+ import { dirname as dirname12, join as join14 } from "node:path";
235230
235230
  // ../../node_modules/chalk/source/vendor/ansi-styles/index.js
235231
235231
  var ANSI_BACKGROUND_OFFSET = 10;
235232
235232
  var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
@@ -241895,7 +241895,7 @@ async function getSiteUrl() {
241895
241895
  return result.data.url;
241896
241896
  }
241897
241897
  // src/core/project/config.ts
241898
- import { dirname as dirname10, join as join11 } from "node:path";
241898
+ import { dirname as dirname10, join as join10 } from "node:path";
241899
241899
 
241900
241900
  // src/core/project/plugins.ts
241901
241901
  import { createRequire as createRequire2 } from "node:module";
@@ -243757,10 +243757,6 @@ var RealtimeHandlerConfigSchema = exports_external.object({
243757
243757
  name: exports_external.string().min(1),
243758
243758
  entry: exports_external.string().min(1)
243759
243759
  });
243760
- var RealtimeHandlerSchemaFileSchema = exports_external.object({
243761
- inbound: exports_external.unknown().optional(),
243762
- outbound: exports_external.unknown().optional()
243763
- });
243764
243760
  var DeployRealtimeHandlerResponseSchema = exports_external.object({
243765
243761
  status: exports_external.enum(["deployed", "unchanged"]),
243766
243762
  handler_name: exports_external.string().optional()
@@ -243768,8 +243764,7 @@ var DeployRealtimeHandlerResponseSchema = exports_external.object({
243768
243764
  var RealtimeHandlerSchema = RealtimeHandlerConfigSchema.extend({
243769
243765
  entryPath: exports_external.string().min(1),
243770
243766
  filePaths: exports_external.array(exports_external.string()).min(1),
243771
- source: ResourceSourceSchema,
243772
- messageSchema: exports_external.unknown().optional()
243767
+ source: ResourceSourceSchema
243773
243768
  });
243774
243769
 
243775
243770
  // src/core/resources/realtime-handler/api.ts
@@ -243788,7 +243783,7 @@ async function deploySingleRealtimeHandler(name2, payload) {
243788
243783
  return result.data;
243789
243784
  }
243790
243785
  // src/core/resources/realtime-handler/config.ts
243791
- import { basename as basename4, dirname as dirname8, join as join10, relative as relative3 } from "node:path";
243786
+ import { basename as basename4, dirname as dirname8, relative as relative3 } from "node:path";
243792
243787
  async function readRealtimeHandler(entryFile, realtimeDir) {
243793
243788
  const handlerDir = dirname8(entryFile);
243794
243789
  const filePaths = await globby("**/*.ts", {
@@ -243806,25 +243801,12 @@ async function readRealtimeHandler(entryFile, realtimeDir) {
243806
243801
  });
243807
243802
  }
243808
243803
  const entry = basename4(entryFile);
243809
- const schemaPath = join10(handlerDir, "schema.jsonc");
243810
- let messageSchema = undefined;
243811
- if (await pathExists(schemaPath)) {
243812
- const parsed = await readJsonFile(schemaPath);
243813
- const result = RealtimeHandlerSchemaFileSchema.safeParse(parsed);
243814
- if (result.success) {
243815
- messageSchema = {
243816
- inbound: result.data.inbound,
243817
- outbound: result.data.outbound
243818
- };
243819
- }
243820
- }
243821
243804
  return {
243822
243805
  name: name2,
243823
243806
  entry,
243824
243807
  entryPath: entryFile,
243825
243808
  filePaths,
243826
- source: { type: "project" },
243827
- messageSchema
243809
+ source: { type: "project" }
243828
243810
  };
243829
243811
  }
243830
243812
  async function readAllRealtimeHandlers(realtimeDir) {
@@ -243951,12 +243933,12 @@ class ProjectConfigReader {
243951
243933
  connectors,
243952
243934
  authConfig
243953
243935
  ] = await Promise.all([
243954
- entityResource.readAll(join11(configDir, project.entitiesDir)),
243955
- functionResource.readAll(join11(configDir, project.functionsDir)),
243956
- realtimeHandlerResource.readAll(join11(configDir, project.realtimeDir)),
243957
- agentResource.readAll(join11(configDir, project.agentsDir)),
243958
- connectorResource.readAll(join11(configDir, project.connectorsDir)),
243959
- authConfigResource.readAll(join11(configDir, project.authDir))
243936
+ entityResource.readAll(join10(configDir, project.entitiesDir)),
243937
+ functionResource.readAll(join10(configDir, project.functionsDir)),
243938
+ realtimeHandlerResource.readAll(join10(configDir, project.realtimeDir)),
243939
+ agentResource.readAll(join10(configDir, project.agentsDir)),
243940
+ connectorResource.readAll(join10(configDir, project.connectorsDir)),
243941
+ authConfigResource.readAll(join10(configDir, project.authDir))
243960
243942
  ]);
243961
243943
  return {
243962
243944
  entities,
@@ -244066,12 +244048,12 @@ async function readProjectConfig(projectRoot) {
244066
244048
  // src/core/project/template.ts
244067
244049
  var import_ejs = __toESM(require_ejs(), 1);
244068
244050
  var import_front_matter = __toESM(require_front_matter(), 1);
244069
- import { dirname as dirname11, join as join13 } from "node:path";
244051
+ import { dirname as dirname11, join as join12 } from "node:path";
244070
244052
 
244071
244053
  // src/core/assets.ts
244072
244054
  import { cpSync, existsSync } from "node:fs";
244073
244055
  import { homedir as homedir2 } from "node:os";
244074
- import { join as join12 } from "node:path";
244056
+ import { join as join11 } from "node:path";
244075
244057
  // package.json
244076
244058
  var package_default = {
244077
244059
  name: "base44",
@@ -244172,18 +244154,18 @@ var package_default = {
244172
244154
  };
244173
244155
 
244174
244156
  // src/core/assets.ts
244175
- var ASSETS_DIR = join12(homedir2(), ".base44", "assets", package_default.version);
244157
+ var ASSETS_DIR = join11(homedir2(), ".base44", "assets", package_default.version);
244176
244158
  function getTemplatesDir() {
244177
- return join12(ASSETS_DIR, "templates");
244159
+ return join11(ASSETS_DIR, "templates");
244178
244160
  }
244179
244161
  function getTemplatesIndexPath() {
244180
- return join12(ASSETS_DIR, "templates", "templates.json");
244162
+ return join11(ASSETS_DIR, "templates", "templates.json");
244181
244163
  }
244182
244164
  function getDenoWrapperPath() {
244183
- return join12(ASSETS_DIR, "deno-runtime", "main.ts");
244165
+ return join11(ASSETS_DIR, "deno-runtime", "main.ts");
244184
244166
  }
244185
244167
  function getExecWrapperPath() {
244186
- return join12(ASSETS_DIR, "deno-runtime", "exec.ts");
244168
+ return join11(ASSETS_DIR, "deno-runtime", "exec.ts");
244187
244169
  }
244188
244170
  function ensureNpmAssets(sourceDir) {
244189
244171
  if (existsSync(ASSETS_DIR))
@@ -244205,7 +244187,7 @@ async function listTemplates() {
244205
244187
  }
244206
244188
  async function renderTemplate(template, destPath, data, options = {}) {
244207
244189
  const { skipExisting = false } = options;
244208
- const templateDir = join13(getTemplatesDir(), template.path);
244190
+ const templateDir = join12(getTemplatesDir(), template.path);
244209
244191
  const files = await globby("**/*", {
244210
244192
  cwd: templateDir,
244211
244193
  dot: true,
@@ -244213,20 +244195,20 @@ async function renderTemplate(template, destPath, data, options = {}) {
244213
244195
  });
244214
244196
  const skipped = [];
244215
244197
  for (const file2 of files) {
244216
- const srcPath = join13(templateDir, file2);
244198
+ const srcPath = join12(templateDir, file2);
244217
244199
  try {
244218
244200
  if (file2.endsWith(".ejs")) {
244219
244201
  const rendered = await import_ejs.default.renderFile(srcPath, data);
244220
244202
  const { attributes, body } = import_front_matter.default(rendered);
244221
- const destFile = attributes.outputFileName ? join13(dirname11(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
244222
- const destFilePath = join13(destPath, destFile);
244203
+ const destFile = attributes.outputFileName ? join12(dirname11(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
244204
+ const destFilePath = join12(destPath, destFile);
244223
244205
  if (skipExisting && await pathExists(destFilePath)) {
244224
244206
  skipped.push(destFile);
244225
244207
  continue;
244226
244208
  }
244227
244209
  await writeFile(destFilePath, body);
244228
244210
  } else {
244229
- const destFilePath = join13(destPath, file2);
244211
+ const destFilePath = join12(destPath, file2);
244230
244212
  if (skipExisting && await pathExists(destFilePath)) {
244231
244213
  skipped.push(file2);
244232
244214
  continue;
@@ -244320,7 +244302,7 @@ async function getSiteFilePaths(outputDir) {
244320
244302
  // src/core/site/deploy.ts
244321
244303
  import { randomUUID } from "node:crypto";
244322
244304
  import { tmpdir } from "node:os";
244323
- import { join as join14 } from "node:path";
244305
+ import { join as join13 } from "node:path";
244324
244306
  async function deploySite(siteOutputDir) {
244325
244307
  if (!await pathExists(siteOutputDir)) {
244326
244308
  throw new InvalidInputError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
@@ -244337,7 +244319,7 @@ async function deploySite(siteOutputDir) {
244337
244319
  ]
244338
244320
  });
244339
244321
  }
244340
- const archivePath = join14(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
244322
+ const archivePath = join13(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
244341
244323
  try {
244342
244324
  await createArchive(siteOutputDir, archivePath);
244343
244325
  return await uploadSite(archivePath);
@@ -251585,7 +251567,7 @@ async function pullAgentsAction({
251585
251567
  }) {
251586
251568
  const { project: project2 } = await readProjectConfig();
251587
251569
  const configDir = dirname12(project2.configPath);
251588
- const agentsDir = join15(configDir, project2.agentsDir);
251570
+ const agentsDir = join14(configDir, project2.agentsDir);
251589
251571
  const remoteAgents = await runTask2("Fetching agents from Base44", async () => {
251590
251572
  return await fetchAgents();
251591
251573
  }, {
@@ -251649,12 +251631,12 @@ function getAgentsCommand() {
251649
251631
  }
251650
251632
 
251651
251633
  // src/cli/commands/auth/password-login.ts
251652
- import { dirname as dirname13, join as join16 } from "node:path";
251634
+ import { dirname as dirname13, join as join15 } from "node:path";
251653
251635
  async function passwordLoginAction({ log, runTask: runTask2 }, action) {
251654
251636
  const shouldEnable = action === "enable";
251655
251637
  const { project: project2 } = await readProjectConfig();
251656
251638
  const configDir = dirname13(project2.configPath);
251657
- const authDir = join16(configDir, project2.authDir);
251639
+ const authDir = join15(configDir, project2.authDir);
251658
251640
  const updated = await runTask2("Updating local auth config", async () => {
251659
251641
  const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
251660
251642
  const merged = { ...current, enableUsernamePassword: shouldEnable };
@@ -251674,14 +251656,14 @@ function getPasswordLoginCommand() {
251674
251656
  }
251675
251657
 
251676
251658
  // src/cli/commands/auth/pull.ts
251677
- import { dirname as dirname14, join as join17 } from "node:path";
251659
+ import { dirname as dirname14, join as join16 } from "node:path";
251678
251660
  async function pullAuthAction({
251679
251661
  log,
251680
251662
  runTask: runTask2
251681
251663
  }) {
251682
251664
  const { project: project2 } = await readProjectConfig();
251683
251665
  const configDir = dirname14(project2.configPath);
251684
- const authDir = join17(configDir, project2.authDir);
251666
+ const authDir = join16(configDir, project2.authDir);
251685
251667
  const remoteConfig = await runTask2("Fetching auth config from Base44", async () => {
251686
251668
  return await pullAuthConfig();
251687
251669
  }, {
@@ -251745,7 +251727,7 @@ function getAuthPushCommand() {
251745
251727
  }
251746
251728
 
251747
251729
  // src/cli/commands/auth/social-login.ts
251748
- import { dirname as dirname15, join as join18, resolve as resolve3 } from "node:path";
251730
+ import { dirname as dirname15, join as join17, resolve as resolve3 } from "node:path";
251749
251731
  var PROVIDER_LABELS = {
251750
251732
  google: "Google",
251751
251733
  microsoft: "Microsoft",
@@ -251816,7 +251798,7 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
251816
251798
  }
251817
251799
  const { project: project2 } = await readProjectConfig();
251818
251800
  const configDir = dirname15(project2.configPath);
251819
- const authDir = join18(configDir, project2.authDir);
251801
+ const authDir = join17(configDir, project2.authDir);
251820
251802
  const { config: updated } = await runTask2("Updating local auth config", async () => updateSocialLoginConfig(authDir, provider, shouldEnable, useCustomOAuth && options.clientId ? { clientId: options.clientId } : undefined));
251821
251803
  if (clientSecret) {
251822
251804
  await runTask2("Saving client secret", async () => pushCustomOAuthSecret(provider, clientSecret));
@@ -251841,7 +251823,7 @@ function getSocialLoginCommand() {
251841
251823
  }
251842
251824
 
251843
251825
  // src/cli/commands/auth/sso.ts
251844
- import { dirname as dirname16, join as join19, resolve as resolve4 } from "node:path";
251826
+ import { dirname as dirname16, join as join18, resolve as resolve4 } from "node:path";
251845
251827
  var SSOConfigFileSchema = exports_external.object({
251846
251828
  provider: exports_external.enum(Object.values(KNOWN_SSO_PROVIDERS)),
251847
251829
  clientId: exports_external.string(),
@@ -252005,7 +251987,7 @@ async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options)
252005
251987
  }
252006
251988
  const { project: project2 } = await readProjectConfig();
252007
251989
  const configDir = dirname16(project2.configPath);
252008
- const authDir = join19(configDir, project2.authDir);
251990
+ const authDir = join18(configDir, project2.authDir);
252009
251991
  await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, provider, true));
252010
251992
  await runTask2("Saving SSO credentials", async () => pushSSOSecrets(secrets));
252011
251993
  return {
@@ -252021,7 +252003,7 @@ async function ssoDisableAction({ log, runTask: runTask2 }, options) {
252021
252003
  }
252022
252004
  const { project: project2 } = await readProjectConfig();
252023
252005
  const configDir = dirname16(project2.configPath);
252024
- const authDir = join19(configDir, project2.authDir);
252006
+ const authDir = join18(configDir, project2.authDir);
252025
252007
  const updated = await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, null, false));
252026
252008
  await runTask2("Removing SSO credentials", async () => deleteSSOSecrets());
252027
252009
  if (!hasAnyLoginMethod(updated)) {
@@ -252872,13 +252854,13 @@ function getConnectorsListAvailableCommand() {
252872
252854
  }
252873
252855
 
252874
252856
  // src/cli/commands/connectors/pull.ts
252875
- import { dirname as dirname17, join as join20, resolve as resolve5 } from "node:path";
252857
+ import { dirname as dirname17, join as join19, resolve as resolve5 } from "node:path";
252876
252858
  async function resolveConnectorsDir(options) {
252877
252859
  if (!getAppContext().projectRoot) {
252878
252860
  return resolve5(options.dir ?? "connectors");
252879
252861
  }
252880
252862
  const { project: project2 } = await readProjectConfig();
252881
- return join20(dirname17(project2.configPath), project2.connectorsDir);
252863
+ return join19(dirname17(project2.configPath), project2.connectorsDir);
252882
252864
  }
252883
252865
  async function pullConnectorsAction({ log, runTask: runTask2, jsonMode }, options) {
252884
252866
  const connectorsDir = await resolveConnectorsDir(options);
@@ -253271,11 +253253,11 @@ function getListCommand() {
253271
253253
  }
253272
253254
 
253273
253255
  // src/cli/commands/functions/pull.ts
253274
- import { dirname as dirname18, join as join21 } from "node:path";
253256
+ import { dirname as dirname18, join as join20 } from "node:path";
253275
253257
  async function pullFunctionsAction({ log, runTask: runTask2 }, name2) {
253276
253258
  const { project: project2, functions } = await readProjectConfig();
253277
253259
  const configDir = dirname18(project2.configPath);
253278
- const functionsDir = join21(configDir, project2.functionsDir);
253260
+ const functionsDir = join20(configDir, project2.functionsDir);
253279
253261
  const pluginFunctionNames = new Set(functions.filter((fn) => fn.source.type === "plugin").map((fn) => fn.name));
253280
253262
  const remoteFunctions = await runTask2("Fetching functions from Base44", async () => {
253281
253263
  const { functions: functions2 } = await listDeployedFunctions();
@@ -253338,7 +253320,7 @@ import { basename as basename5, resolve as resolve7 } from "node:path";
253338
253320
  var import_kebabCase = __toESM(require_kebabCase(), 1);
253339
253321
 
253340
253322
  // src/cli/commands/project/scaffold-shared.ts
253341
- import { join as join22 } from "node:path";
253323
+ import { join as join21 } from "node:path";
253342
253324
  var DEFAULT_TEMPLATE_ID = "backend-only";
253343
253325
  async function getTemplateById(templateId) {
253344
253326
  const templates = await listTemplates();
@@ -253397,7 +253379,7 @@ async function completeProjectSetup({
253397
253379
  updateMessage("Building project...");
253398
253380
  await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
253399
253381
  updateMessage("Deploying site...");
253400
- return await deploySite(join22(resolvedPath, outputDirectory));
253382
+ return await deploySite(join21(resolvedPath, outputDirectory));
253401
253383
  }, {
253402
253384
  successMessage: theme.colors.base44Orange("Site deployed successfully"),
253403
253385
  errorMessage: "Failed to deploy site"
@@ -254156,23 +254138,15 @@ function getDeployCommand3() {
254156
254138
  }
254157
254139
 
254158
254140
  // src/cli/commands/realtime/new.ts
254159
- import { dirname as dirname19, join as join23 } from "node:path";
254141
+ import { dirname as dirname19, join as join22 } from "node:path";
254160
254142
  function buildHandlerScaffold(handlerName) {
254161
- return `import { RealtimeHandler, type Conn } from "@base44/sdk";
254143
+ return `import { RealtimeHandler, type Conn } from "base44";
254162
254144
 
254163
- interface State {
254164
- // shared state broadcast to all clients
254165
- }
254166
-
254167
- interface Message {
254168
- // messages sent from clients
254169
- }
254170
-
254171
- export class ${handlerName} extends RealtimeHandler<State, Message> {
254145
+ export class ${handlerName} extends RealtimeHandler {
254172
254146
  handleConnect(conn: Conn) {
254173
254147
  console.log("Connected:", conn.userId);
254174
254148
  }
254175
- handleMessage(conn: Conn, msg: Message) {
254149
+ handleMessage(conn: Conn, msg: unknown) {
254176
254150
  console.log("Message:", msg);
254177
254151
  }
254178
254152
  handleTick() {}
@@ -254182,12 +254156,12 @@ export class ${handlerName} extends RealtimeHandler<State, Message> {
254182
254156
  }
254183
254157
  async function newRealtimeHandlerAction(_ctx, handlerName) {
254184
254158
  const { project: project2 } = await readProjectConfig();
254185
- const realtimeDir = join23(dirname19(project2.configPath), project2.realtimeDir);
254186
- const handlerDir = join23(realtimeDir, handlerName);
254159
+ const realtimeDir = join22(dirname19(project2.configPath), project2.realtimeDir);
254160
+ const handlerDir = join22(realtimeDir, handlerName);
254187
254161
  if (await pathExists(handlerDir)) {
254188
254162
  throw new InvalidInputError(`Realtime handler "${handlerName}" already exists at ${handlerDir}`);
254189
254163
  }
254190
- const entryPath = join23(handlerDir, "entry.ts");
254164
+ const entryPath = join22(handlerDir, "entry.ts");
254191
254165
  await writeFile(entryPath, buildHandlerScaffold(handlerName));
254192
254166
  return {
254193
254167
  outroMessage: `Created realtime handler "${handlerName}" at ${entryPath}`
@@ -254675,7 +254649,6 @@ function getSiteCommand() {
254675
254649
  // src/core/types/generator.ts
254676
254650
  var import_common_tags = __toESM(require_lib2(), 1);
254677
254651
  var import_json_schema_to_typescript = __toESM(require_src3(), 1);
254678
- import { join as join26 } from "node:path";
254679
254652
  var HEADER2 = import_common_tags.stripIndent`
254680
254653
  // Auto-generated by Base44 CLI - DO NOT EDIT
254681
254654
  // Regenerate with: base44 types generate
@@ -254684,40 +254657,24 @@ var EMPTY_TEMPLATE = import_common_tags.stripIndent`
254684
254657
  // Auto-generated by Base44 CLI - DO NOT EDIT
254685
254658
  // Regenerate with: base44 types
254686
254659
  //
254687
- // No entities, functions, agents, connectors, or realtime handlers found in project.
254688
- // Add resources to base44/entities/, base44/functions/, base44/agents/, base44/connectors/, or base44/realtime/
254660
+ // No entities, functions, agents, or connectors found in project.
254661
+ // Add resources to base44/entities/, base44/functions/, base44/agents/, or base44/connectors/
254689
254662
  // and run \`base44 types generate\` again.
254690
254663
 
254691
254664
  declare module '@base44/sdk' {
254692
254665
  // No types to augment - add resources and regenerate
254693
254666
  }
254694
254667
  `;
254695
- var SDK_PACKAGE_NAMES = ["@base44/sdk", "@base44-preview/sdk"];
254696
- async function detectSdkPackageName(projectRoot) {
254697
- try {
254698
- const pkg = await readJsonFile(join26(projectRoot, "package.json"));
254699
- const deps = { ...pkg.dependencies, ...pkg.devDependencies };
254700
- for (const name2 of SDK_PACKAGE_NAMES) {
254701
- if (name2 in deps)
254702
- return name2;
254703
- }
254704
- } catch {}
254705
- return "@base44/sdk";
254706
- }
254707
254668
  async function generateTypesFile(input) {
254708
254669
  const content = await generateContent(input);
254709
254670
  await writeFile(getTypesOutputPath(input.projectRoot), content);
254710
254671
  }
254711
254672
  async function generateContent(input) {
254712
- const { entities, functions, agents, connectors, realtimeHandlers } = input;
254713
- const sdkPackage = await detectSdkPackageName(input.projectRoot);
254714
- if (!entities.length && !functions.length && !agents.length && !connectors.length && !realtimeHandlers.length) {
254673
+ const { entities, functions, agents, connectors } = input;
254674
+ if (!entities.length && !functions.length && !agents.length && !connectors.length) {
254715
254675
  return EMPTY_TEMPLATE;
254716
254676
  }
254717
- const [entityInterfaces, realtimeRegistryEntries] = await Promise.all([
254718
- Promise.all(entities.map((e8) => compileEntity(e8))),
254719
- Promise.all(realtimeHandlers.map((h5) => compileRealtimeHandler(h5)))
254720
- ]);
254677
+ const entityInterfaces = await Promise.all(entities.map((e8) => compileEntity(e8)));
254721
254678
  const registryEntries = [
254722
254679
  [
254723
254680
  "EntityTypeRegistry",
@@ -254725,28 +254682,16 @@ async function generateContent(input) {
254725
254682
  ],
254726
254683
  ["FunctionNameRegistry", functions.map((f7) => `"${f7.name}": true;`)],
254727
254684
  ["AgentNameRegistry", agents.map((a5) => `"${a5.name}": true;`)],
254728
- ["ConnectorTypeRegistry", connectors.map((c8) => `"${c8.type}": true;`)],
254729
- [
254730
- "RealtimeHandlerNameRegistry",
254731
- realtimeHandlers.map((h5) => `"${h5.name}": true;`)
254732
- ],
254733
- [
254734
- "RealtimeHandlerRegistry",
254735
- realtimeHandlers.filter((h5) => h5.messageSchema).map((h5, _10, arr) => {
254736
- const idx = realtimeHandlers.indexOf(h5);
254737
- return `"${h5.name}": ${realtimeRegistryEntries[idx]};`;
254738
- })
254739
- ]
254685
+ ["ConnectorTypeRegistry", connectors.map((c8) => `"${c8.type}": true;`)]
254740
254686
  ];
254741
254687
  const registries2 = registryEntries.filter(([, entries]) => entries.length > 0).map(([name2, entries]) => registry2(name2, entries));
254742
254688
  return [
254743
254689
  HEADER2,
254744
- "export {};",
254745
254690
  entityInterfaces.join(`
254746
254691
 
254747
254692
  `),
254748
254693
  import_common_tags.source`
254749
- declare module '${sdkPackage}' {
254694
+ declare module '@base44/sdk' {
254750
254695
  ${registries2.join(`
254751
254696
 
254752
254697
  `)}
@@ -254774,32 +254719,6 @@ async function compileEntity(entity2) {
254774
254719
  throw new TypeGenerationError(`Failed to generate types for entity "${name2}"`, name2, error48);
254775
254720
  }
254776
254721
  }
254777
- async function compileRealtimeHandler(handler) {
254778
- const { messageSchema } = handler;
254779
- if (!messageSchema)
254780
- return "{ inbound: unknown; outbound: unknown }";
254781
- const compileSchema = async (schema11, typeName) => {
254782
- if (!schema11)
254783
- return "unknown";
254784
- try {
254785
- const ts8 = await import_json_schema_to_typescript.compile(schema11, typeName, {
254786
- bannerComment: "",
254787
- additionalProperties: false,
254788
- strictIndexSignatures: true
254789
- });
254790
- const match = ts8.match(/\{([^]*)\}/);
254791
- return match ? `{
254792
- ${match[1]}}` : "unknown";
254793
- } catch {
254794
- return "unknown";
254795
- }
254796
- };
254797
- const [inbound, outbound] = await Promise.all([
254798
- compileSchema(messageSchema.inbound, `${handler.name}Inbound`),
254799
- compileSchema(messageSchema.outbound, `${handler.name}Outbound`)
254800
- ]);
254801
- return `{ inbound: ${inbound}; outbound: ${outbound} }`;
254802
- }
254803
254722
  function registry2(name2, entries) {
254804
254723
  return import_common_tags.source`
254805
254724
  interface ${name2} {
@@ -254812,10 +254731,10 @@ function toPascalCase(name2) {
254812
254731
  return name2.split(/[-_\s]+/).map((w8) => w8.charAt(0).toUpperCase() + w8.slice(1)).join("");
254813
254732
  }
254814
254733
  // src/core/types/update-project.ts
254815
- import { join as join27 } from "node:path";
254734
+ import { join as join25 } from "node:path";
254816
254735
  var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
254817
254736
  async function updateProjectConfig(projectRoot) {
254818
- const tsconfigPath = join27(projectRoot, "tsconfig.json");
254737
+ const tsconfigPath = join25(projectRoot, "tsconfig.json");
254819
254738
  if (!await pathExists(tsconfigPath)) {
254820
254739
  return false;
254821
254740
  }
@@ -254839,15 +254758,14 @@ var TYPES_FILE_PATH = "base44/.types/types.d.ts";
254839
254758
  async function generateTypesAction({
254840
254759
  runTask: runTask2
254841
254760
  }) {
254842
- const { entities, functions, agents, connectors, realtimeHandlers, project: project2 } = await readProjectConfig();
254761
+ const { entities, functions, agents, connectors, project: project2 } = await readProjectConfig();
254843
254762
  await runTask2("Generating types", async () => {
254844
254763
  await generateTypesFile({
254845
254764
  projectRoot: project2.root,
254846
254765
  entities,
254847
254766
  functions,
254848
254767
  agents,
254849
- connectors,
254850
- realtimeHandlers
254768
+ connectors
254851
254769
  });
254852
254770
  });
254853
254771
  const tsconfigUpdated = await updateProjectConfig(project2.root);
@@ -254867,7 +254785,7 @@ function getTypesCommand() {
254867
254785
  // src/cli/dev/dev-server/main.ts
254868
254786
  var import_cors = __toESM(require_lib4(), 1);
254869
254787
  var import_express6 = __toESM(require_express(), 1);
254870
- import { dirname as dirname24, join as join30 } from "node:path";
254788
+ import { dirname as dirname24, join as join28 } from "node:path";
254871
254789
 
254872
254790
  // ../../node_modules/get-port/index.js
254873
254791
  import net from "node:net";
@@ -258287,8 +258205,8 @@ async function createDevServer(options8) {
258287
258205
  broadcastEntityEvent(io6, appId, entityName, event);
258288
258206
  };
258289
258207
  const base44ConfigWatcher = new WatchBase44({
258290
- functions: join30(dirname24(project2.configPath), project2.functionsDir),
258291
- entities: join30(dirname24(project2.configPath), project2.entitiesDir)
258208
+ functions: join28(dirname24(project2.configPath), project2.functionsDir),
258209
+ entities: join28(dirname24(project2.configPath), project2.entitiesDir)
258292
258210
  }, devLogger);
258293
258211
  base44ConfigWatcher.on("change", async (name2) => {
258294
258212
  try {
@@ -262854,7 +262772,7 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
262854
262772
  // src/cli/index.ts
262855
262773
  var __dirname4 = dirname26(fileURLToPath6(import.meta.url));
262856
262774
  async function runCLI(options8) {
262857
- ensureNpmAssets(join31(__dirname4, "../assets"));
262775
+ ensureNpmAssets(join29(__dirname4, "../assets"));
262858
262776
  const errorReporter = new ErrorReporter;
262859
262777
  errorReporter.registerProcessErrorHandlers();
262860
262778
  const jsonMode = process.argv.includes("--json");
@@ -262893,4 +262811,4 @@ export {
262893
262811
  CLIExitError
262894
262812
  };
262895
262813
 
262896
- //# debugId=33E3FAB72031407264756E2164756E21
262814
+ //# debugId=D4F8A745D6FBC89164756E2164756E21