@base44-preview/cli 0.1.15-pr.630.a207c26 → 0.1.15-pr.630.ca4815b

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
@@ -269452,27 +269452,18 @@ function getAgentsCommand() {
269452
269452
 
269453
269453
  // src/core/model.ts
269454
269454
  var MODELS = [
269455
- {
269456
- name: "Automatic",
269457
- id: null,
269458
- note: "matched with the best model",
269459
- aliases: ["default", "auto"]
269460
- },
269455
+ { name: "default", id: null, note: "let Base44 choose" },
269461
269456
  { name: "Opus 5", id: "claude_opus_5" },
269462
269457
  { name: "Sonnet 5", id: "claude-sonnet-5" },
269463
269458
  { name: "Fable 5", id: "claude_fable_5", note: "uses more credits" },
269464
269459
  { name: "GPT-5.6 Sol", id: "gpt_5_6_sol" },
269465
- {
269466
- name: "Gemini 3.8 Flash",
269467
- id: "gemini_3_8_flash",
269468
- note: "fast responses for everyday tasks"
269469
- },
269460
+ { name: "Gemini 3.8 Flash", id: "gemini_3_8_flash", note: "fast" },
269470
269461
  { name: "Base 1", id: "base1" }
269471
269462
  ];
269472
269463
  var fold = (s) => s.toLowerCase().replace(/[^a-z0-9]/g, "");
269473
269464
  function resolvePick(input) {
269474
269465
  const key = fold(input);
269475
- const byExact = MODELS.find((m) => fold(m.name) === key || m.id && fold(m.id) === key || m.aliases?.some((a) => fold(a) === key));
269466
+ const byExact = MODELS.find((m) => fold(m.name) === key || m.id && fold(m.id) === key);
269476
269467
  if (byExact)
269477
269468
  return byExact;
269478
269469
  const byContains = MODELS.filter((m) => fold(m.name).includes(key) || m.id && fold(m.id).includes(key));
@@ -269500,7 +269491,7 @@ async function saveBuilderModel(userId, modelId) {
269500
269491
  throw await ApiError.fromHttpError(error, "saving your model choice");
269501
269492
  }
269502
269493
  }
269503
- var displayName = (id) => MODELS.find((m) => m.id === id)?.name ?? id ?? "Automatic";
269494
+ var displayName = (id) => MODELS.find((m) => m.id === id)?.name ?? id ?? "default";
269504
269495
 
269505
269496
  // src/cli/commands/app/model.ts
269506
269497
  async function modelAction({ log, jsonMode }, input) {
@@ -269546,7 +269537,7 @@ function getModelCommand() {
269546
269537
 
269547
269538
  // src/cli/commands/app/shared.ts
269548
269539
  import { mkdir as mkdir3, writeFile as writeFile2 } from "node:fs/promises";
269549
- import { basename as basename6, join as join21, relative as relative6, resolve as resolve6 } from "node:path";
269540
+ import { join as join21 } from "node:path";
269550
269541
 
269551
269542
  // src/cli/commands/code/render.ts
269552
269543
  var TOOL_ALIASES = {
@@ -269983,17 +269974,11 @@ async function createAndLinkApp(options) {
269983
269974
  if (options.name && !APP_NAME_RE.test(options.name)) {
269984
269975
  throw new InvalidInputError("The name becomes a directory — letters, digits, dots, dashes and underscores only.");
269985
269976
  }
269986
- const cwd = process.cwd();
269987
- const fallbackName = () => options.importRepo ? repoBasename(options.importRepo) : inventAppName(options.prompt);
269988
- const chosenDir = options.path ? resolve6(cwd, options.path) : await isDirEmpty(cwd) ? cwd : undefined;
269989
- const dirBase = chosenDir ? basename6(chosenDir) : undefined;
269990
- const name = options.name ?? (dirBase && APP_NAME_RE.test(dirBase) ? dirBase : fallbackName());
269991
- const targetDir = chosenDir ?? join21(cwd, name);
269992
- const here = targetDir === cwd;
269993
- const dirName = here ? "." : relative6(cwd, targetDir) || name;
269977
+ const name = options.name ?? (options.importRepo ? repoBasename(options.importRepo) : inventAppName(options.prompt));
269978
+ const targetDir = join21(process.cwd(), name);
269994
269979
  await mkdir3(targetDir, { recursive: true });
269995
269980
  if (await appConfigExists(targetDir)) {
269996
- throw new InvalidInputError(here ? "This directory is already linked to a Base44 app. Run `base44 code` here to keep building it, or pass --path for a new one." : `./${dirName} is already linked to a Base44 app. Pick another name or --path.`);
269981
+ throw new InvalidInputError(`./${name} is already linked to a Base44 app. Pick another name.`);
269997
269982
  }
269998
269983
  const created = options.importRepo ? await createImportedApp({
269999
269984
  appName: name,
@@ -270017,19 +270002,16 @@ async function createAndLinkApp(options) {
270017
270002
  id: created.id,
270018
270003
  editorUrl: `${getBase44ApiUrl()}/apps/${created.id}/editor/preview`,
270019
270004
  repoUrl: created.imported_repo_url ?? undefined,
270020
- dirName,
270021
- targetDir,
270022
- here
270005
+ dirName: name,
270006
+ targetDir
270023
270007
  };
270024
270008
  }
270025
270009
  function nextStepsLines(app) {
270026
- const cd = app.here ? "" : `cd ${app.dirName} && `;
270027
270010
  return [
270028
270011
  "",
270029
- `${source_default.bold("Your app lives in")} ${app.here ? "./ (this directory)" : `./${app.dirName}`}`,
270030
- source_default.dim(` ${cd}base44 code # keep building with the agent`),
270031
- source_default.dim(` ${cd}base44 app send "…" # one non-interactive turn`),
270032
- source_default.dim(` files live remotely — ${cd}base44 sandbox ls to look, base44 eject for a copy`)
270012
+ `${source_default.bold("Your app lives in")} ./${app.dirName}`,
270013
+ source_default.dim(` cd ${app.dirName} && base44 code # keep building with the agent`),
270014
+ source_default.dim(` cd ${app.dirName} && base44 app send "…" # one non-interactive turn`)
270033
270015
  ];
270034
270016
  }
270035
270017
  async function githubReauthLines(error) {
@@ -270262,8 +270244,7 @@ async function newAction({ log, runTask, jsonMode }, prompt, options) {
270262
270244
  importRepo: options.import,
270263
270245
  mode: options.mode,
270264
270246
  repoName: options.repoName,
270265
- fromBranch: options.fromBranch,
270266
- path: options.path
270247
+ fromBranch: options.fromBranch
270267
270248
  }));
270268
270249
  } catch (error) {
270269
270250
  for (const line of await githubReauthLines(error) ?? [])
@@ -270274,7 +270255,7 @@ async function newAction({ log, runTask, jsonMode }, prompt, options) {
270274
270255
  if (app.repoUrl)
270275
270256
  log.message(source_default.dim(`repo ${app.repoUrl}`));
270276
270257
  log.message(source_default.dim(`editor ${app.editorUrl}`));
270277
- log.message(source_default.dim(`linked ${app.here ? "./ (this directory)" : `./${app.dirName}`}`));
270258
+ log.message(source_default.dim(`linked ./${app.dirName}`));
270278
270259
  }
270279
270260
  let finalState;
270280
270261
  let previewUrl;
@@ -270333,7 +270314,7 @@ async function newAction({ log, runTask, jsonMode }, prompt, options) {
270333
270314
  }
270334
270315
  function getNewCommand() {
270335
270316
  const command = new Base44Command("new", { requireAppContext: false });
270336
- command.description("Create an app and start building: from a prompt (the Base44 template), or over an existing GitHub repo with --import").argument("[prompt]", "What to build; the first agent turn starts immediately").option("--import <repo>", "Build over an existing GitHub repository instead of the template").option("--mode <mode>", "How to import: direct, fork, or copy (default: direct)").option("--name <name>", "Directory and app name (invented when omitted)").option("--path <dir>", "Directory to link (default: the current directory when empty, else ./<name>)").option("--repo-name <name>", "Name for the new GitHub repo when forking/copying").option("--from-branch <name>", "Import a specific branch of the repo").action(newAction);
270317
+ command.description("Create an app and start building: from a prompt (the Base44 template), or over an existing GitHub repo with --import").argument("[prompt]", "What to build; the first agent turn starts immediately").option("--import <repo>", "Build over an existing GitHub repository instead of the template").option("--mode <mode>", "How to import: direct, fork, or copy (default: direct)").option("--name <name>", "Directory and app name (invented when omitted)").option("--repo-name <name>", "Name for the new GitHub repo when forking/copying").option("--from-branch <name>", "Import a specific branch of the repo").action(newAction);
270337
270318
  return command;
270338
270319
  }
270339
270320
 
@@ -270543,7 +270524,7 @@ function getAuthPushCommand() {
270543
270524
  }
270544
270525
 
270545
270526
  // src/cli/commands/auth/social-login.ts
270546
- import { dirname as dirname17, join as join24, resolve as resolve7 } from "node:path";
270527
+ import { dirname as dirname17, join as join24, resolve as resolve6 } from "node:path";
270547
270528
  var PROVIDER_LABELS = {
270548
270529
  google: "Google",
270549
270530
  microsoft: "Microsoft",
@@ -270583,7 +270564,7 @@ async function socialLoginAction({ log, isNonInteractive, runTask }, provider, a
270583
270564
  let clientSecret;
270584
270565
  if (useCustomOAuth && oauth && oauthCli && hasSecretOptions(options)) {
270585
270566
  if (options.envFile) {
270586
- const secrets = await parseEnvFile(resolve7(options.envFile));
270567
+ const secrets = await parseEnvFile(resolve6(options.envFile));
270587
270568
  const value = secrets[oauthCli.envVar];
270588
270569
  if (!value) {
270589
270570
  throw new InvalidInputError(`Key "${oauthCli.envVar}" not found in ${options.envFile}.`);
@@ -270639,7 +270620,7 @@ function getSocialLoginCommand() {
270639
270620
  }
270640
270621
 
270641
270622
  // src/cli/commands/auth/sso.ts
270642
- import { dirname as dirname18, join as join25, resolve as resolve8 } from "node:path";
270623
+ import { dirname as dirname18, join as join25, resolve as resolve7 } from "node:path";
270643
270624
  var SSOConfigFileSchema = object({
270644
270625
  provider: _enum(Object.values(KNOWN_SSO_PROVIDERS)),
270645
270626
  clientId: string2(),
@@ -270655,7 +270636,7 @@ var SSOConfigFileSchema = object({
270655
270636
  ssoName: string2().optional()
270656
270637
  });
270657
270638
  async function loadSSOConfigFile(filePath) {
270658
- const resolved = resolve8(filePath);
270639
+ const resolved = resolve7(filePath);
270659
270640
  const raw = await readJsonFile(resolved);
270660
270641
  const result = SSOConfigFileSchema.safeParse(raw);
270661
270642
  if (!result.success) {
@@ -270743,7 +270724,7 @@ async function ssoEnableAction({ isNonInteractive, runTask }, options) {
270743
270724
  }
270744
270725
  let clientSecret;
270745
270726
  if (merged.envFile && !merged.clientSecret) {
270746
- const secrets = await parseEnvFile(resolve8(merged.envFile));
270727
+ const secrets = await parseEnvFile(resolve7(merged.envFile));
270747
270728
  const value = secrets.sso_client_secret;
270748
270729
  if (!value) {
270749
270730
  throw new InvalidInputError(`Key "sso_client_secret" not found in ${merged.envFile}.`);
@@ -276608,21 +276589,21 @@ async function runGenesisSession(options) {
276608
276589
 
276609
276590
  // src/cli/commands/code/index.ts
276610
276591
  var BRAND_ORANGE2 = "#E86B3C";
276611
- async function bootstrapApp(prompt, footer, emit, onCreated, importRepo, path) {
276592
+ async function bootstrapApp(prompt, footer, emit, onCreated, importRepo) {
276612
276593
  let app;
276613
276594
  try {
276614
- app = await createAndLinkApp({ prompt, importRepo, path });
276595
+ app = await createAndLinkApp({ prompt, importRepo });
276615
276596
  } catch (error) {
276616
276597
  for (const line of await githubReauthLines(error) ?? [])
276617
276598
  emit(line);
276618
276599
  throw error;
276619
276600
  }
276620
276601
  onCreated(app);
276621
- footer.push(source_default.dim(`dir ${app.here ? "./" : `./${app.dirName}`}`));
276602
+ footer.push(source_default.dim(`dir ./${app.dirName}`));
276622
276603
  if (app.repoUrl)
276623
276604
  footer.push(terminalLink("repo", app.repoUrl));
276624
276605
  footer.push(terminalLink("editor", app.editorUrl));
276625
- emit(source_default.dim(app.here ? "linked ./ (this directory)" : `linked ./${app.dirName} (cd ${app.dirName} after the session)`));
276606
+ emit(source_default.dim(`linked ./${app.dirName} (cd ${app.dirName} after the session)`));
276626
276607
  const branchId = await resolveActiveBranchId().catch(() => {
276627
276608
  return;
276628
276609
  });
@@ -276656,8 +276637,8 @@ async function codeAction({ log }, options) {
276656
276637
  linked = true;
276657
276638
  } catch {}
276658
276639
  if (linked) {
276659
- if (options.import || options.path) {
276660
- throw new InvalidInputError("--import and --path create a new app; run them outside a linked project.");
276640
+ if (options.import) {
276641
+ throw new InvalidInputError("--import creates a new app; run it outside a linked project.");
276661
276642
  }
276662
276643
  const branchId = await resolveActiveBranchId().catch(() => {
276663
276644
  return;
@@ -276685,7 +276666,7 @@ async function codeAction({ log }, options) {
276685
276666
  footer,
276686
276667
  createApp: (prompt, emit) => bootstrapApp(prompt, footer, emit, (app) => {
276687
276668
  created = app;
276688
- }, options.import, options.path)
276669
+ }, options.import)
276689
276670
  });
276690
276671
  if (!created) {
276691
276672
  return { outroMessage: "Session closed. No app was created." };
@@ -276697,7 +276678,7 @@ async function codeAction({ log }, options) {
276697
276678
  }
276698
276679
  function getCodeCommand() {
276699
276680
  const command = new Base44Command("code", { requireAppContext: false });
276700
- command.description("Open Base44 Code: an interactive agent session — in an empty directory your first prompt creates the app (add --import <repo> to build over an existing repository)").option("--import <repo>", "Build over an existing GitHub repository instead of the Base44 template").option("--path <dir>", "Directory to link the new app to (default: the current directory when empty, else ./<name>)").action(codeAction);
276681
+ command.description("Open Base44 Code: an interactive agent session — in an empty directory your first prompt creates the app (add --import <repo> to build over an existing repository)").option("--import <repo>", "Build over an existing GitHub repository instead of the Base44 template").action(codeAction);
276701
276682
  return command;
276702
276683
  }
276703
276684
 
@@ -277495,10 +277476,10 @@ function getConnectorsListAvailableCommand() {
277495
277476
  }
277496
277477
 
277497
277478
  // src/cli/commands/connectors/pull.ts
277498
- import { dirname as dirname19, join as join27, resolve as resolve9 } from "node:path";
277479
+ import { dirname as dirname19, join as join27, resolve as resolve8 } from "node:path";
277499
277480
  async function resolveConnectorsDir(options) {
277500
277481
  if (!getAppContext().projectRoot) {
277501
- return resolve9(options.dir ?? "connectors");
277482
+ return resolve8(options.dir ?? "connectors");
277502
277483
  }
277503
277484
  const { project } = await readProjectConfig();
277504
277485
  return join27(dirname19(project.configPath), project.connectorsDir);
@@ -277542,10 +277523,10 @@ function getConnectorsPullCommand() {
277542
277523
  }
277543
277524
 
277544
277525
  // src/cli/commands/connectors/push.ts
277545
- import { resolve as resolve10 } from "node:path";
277526
+ import { resolve as resolve9 } from "node:path";
277546
277527
  async function readConnectorsToPush(options) {
277547
277528
  if (!getAppContext().projectRoot) {
277548
- return readAllConnectors(resolve10(options.dir ?? "connectors"));
277529
+ return readAllConnectors(resolve9(options.dir ?? "connectors"));
277549
277530
  }
277550
277531
  const { connectors } = await readProjectConfig();
277551
277532
  return connectors;
@@ -278014,7 +277995,7 @@ function getBuildCommand() {
278014
277995
  }
278015
277996
 
278016
277997
  // src/cli/commands/project/create.ts
278017
- import { basename as basename7, resolve as resolve11 } from "node:path";
277998
+ import { basename as basename6, resolve as resolve10 } from "node:path";
278018
277999
  var import_kebabCase2 = __toESM(require_kebabCase(), 1);
278019
278000
 
278020
278001
  // src/cli/commands/project/scaffold-shared.ts
@@ -278179,8 +278160,8 @@ async function createInteractive(options, ctx) {
278179
278160
  name: () => {
278180
278161
  return options.name ? Promise.resolve(options.name) : Ze({
278181
278162
  message: "What is the name of your project?",
278182
- placeholder: basename7(process.cwd()),
278183
- initialValue: basename7(process.cwd()),
278163
+ placeholder: basename6(process.cwd()),
278164
+ initialValue: basename6(process.cwd()),
278184
278165
  validate: (value) => {
278185
278166
  if (!value || value.trim().length === 0) {
278186
278167
  return "Every project deserves a name";
@@ -278210,7 +278191,7 @@ async function createInteractive(options, ctx) {
278210
278191
  }, ctx);
278211
278192
  }
278212
278193
  async function createNonInteractive(options, ctx) {
278213
- ctx.log.info(`Creating a new project at ${resolve11(options.path)}`);
278194
+ ctx.log.info(`Creating a new project at ${resolve10(options.path)}`);
278214
278195
  const template = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
278215
278196
  return await executeCreate({
278216
278197
  template,
@@ -278234,7 +278215,7 @@ async function executeCreate({
278234
278215
  }, ctx) {
278235
278216
  const { log, runTask } = ctx;
278236
278217
  const name = rawName.trim();
278237
- const resolvedPath = resolve11(projectPath);
278218
+ const resolvedPath = resolve10(projectPath);
278238
278219
  const organizationId = await resolveWorkspaceId(ctx, flagWorkspaceId, isInteractive);
278239
278220
  const { projectId } = await runTask("Setting up your project...", async () => {
278240
278221
  return await createProjectFiles({
@@ -278875,7 +278856,7 @@ function getLogsCommand() {
278875
278856
  }
278876
278857
 
278877
278858
  // src/cli/commands/project/scaffold.ts
278878
- import { basename as basename8, resolve as resolve12 } from "node:path";
278859
+ import { basename as basename7, resolve as resolve11 } from "node:path";
278879
278860
  function resolveAppId(options) {
278880
278861
  const appId = options.appId;
278881
278862
  if (!appId) {
@@ -278891,8 +278872,8 @@ function resolveAppId(options) {
278891
278872
  async function scaffoldAction(ctx, name, options, command) {
278892
278873
  const { log, runTask } = ctx;
278893
278874
  const appId = resolveAppId(command.optsWithGlobals());
278894
- const resolvedPath = resolve12("./");
278895
- const projectName = (name ?? basename8(resolvedPath)).trim();
278875
+ const resolvedPath = resolve11("./");
278876
+ const projectName = (name ?? basename7(resolvedPath)).trim();
278896
278877
  const template = await getTemplateById("backend-only");
278897
278878
  log.info(`Scaffolding project at ${resolvedPath}`);
278898
278879
  const { projectId } = await runTask("Setting up your project...", async () => {
@@ -279308,7 +279289,7 @@ function getSecretsListCommand() {
279308
279289
  }
279309
279290
 
279310
279291
  // src/cli/commands/secrets/set.ts
279311
- import { resolve as resolve13 } from "node:path";
279292
+ import { resolve as resolve12 } from "node:path";
279312
279293
  function parseEntries(entries) {
279313
279294
  const secrets = {};
279314
279295
  for (const entry of entries) {
@@ -279339,7 +279320,7 @@ async function setSecretsAction({ log, runTask }, entries, options) {
279339
279320
  validateInput(entries, options);
279340
279321
  let secrets;
279341
279322
  if (options.envFile) {
279342
- secrets = await parseEnvFile(resolve13(options.envFile));
279323
+ secrets = await parseEnvFile(resolve12(options.envFile));
279343
279324
  if (Object.keys(secrets).length === 0) {
279344
279325
  throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
279345
279326
  }
@@ -279368,7 +279349,7 @@ function getSecretsCommand() {
279368
279349
  }
279369
279350
 
279370
279351
  // src/cli/commands/site/deploy.ts
279371
- import { resolve as resolve14 } from "node:path";
279352
+ import { resolve as resolve13 } from "node:path";
279372
279353
  async function deployAction2(ctx, options) {
279373
279354
  const { isNonInteractive } = ctx;
279374
279355
  if (isNonInteractive && !options.yes) {
@@ -279446,7 +279427,7 @@ async function deployTarball({ runTask }, project) {
279446
279427
  }
279447
279428
  function siteOutputDir(project) {
279448
279429
  const outputDirectory = project.site?.outputDirectory;
279449
- return outputDirectory ? resolve14(project.root, outputDirectory) : null;
279430
+ return outputDirectory ? resolve13(project.root, outputDirectory) : null;
279450
279431
  }
279451
279432
  function getSiteDeployCommand() {
279452
279433
  const command = new Base44Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").option("--build", "Build the site before deploying (skips the prompt)").option("--no-build", "Deploy without building (skips the prompt)");
@@ -281948,7 +281929,7 @@ function createCustomIntegrationRoutes(remoteProxy, logger) {
281948
281929
 
281949
281930
  // src/cli/dev/dev-server/watcher.ts
281950
281931
  import { EventEmitter as EventEmitter6 } from "node:events";
281951
- import { relative as relative10 } from "node:path";
281932
+ import { relative as relative9 } from "node:path";
281952
281933
 
281953
281934
  // ../../node_modules/chokidar/index.js
281954
281935
  import { EventEmitter as EventEmitter5 } from "node:events";
@@ -283633,7 +283614,7 @@ class WatchBase44 extends EventEmitter6 {
283633
283614
  ignoreInitial: true
283634
283615
  });
283635
283616
  watcher.on("all", import_debounce4.default(async (_event, path) => {
283636
- this.emit("change", name, relative10(targetPath, path));
283617
+ this.emit("change", name, relative9(targetPath, path));
283637
283618
  }, WATCH_DEBOUNCE_MS));
283638
283619
  watcher.on("error", (err) => {
283639
283620
  this.logger.error(`Watch handler failed for ${targetPath}`, err);
@@ -284143,7 +284124,7 @@ Examples:
284143
284124
  }
284144
284125
 
284145
284126
  // src/cli/commands/project/eject.ts
284146
- import { resolve as resolve18 } from "node:path";
284127
+ import { resolve as resolve17 } from "node:path";
284147
284128
  var import_kebabCase3 = __toESM(require_kebabCase(), 1);
284148
284129
  async function eject(ctx, options, command) {
284149
284130
  const { log, runTask, isNonInteractive } = ctx;
@@ -284207,7 +284188,7 @@ async function eject(ctx, options, command) {
284207
284188
  Ne("Operation cancelled.");
284208
284189
  throw new CLIExitError(0);
284209
284190
  }
284210
- const resolvedPath = resolve18(selectedPath);
284191
+ const resolvedPath = resolve17(selectedPath);
284211
284192
  await runTask("Downloading your project's code...", async (updateMessage) => {
284212
284193
  await createProjectFilesForExistingProject({
284213
284194
  projectId,
@@ -288344,4 +288325,4 @@ export {
288344
288325
  runCLI
288345
288326
  };
288346
288327
 
288347
- //# debugId=B1E2B3DFB2501EB964756E2164756E21
288328
+ //# debugId=3E91D87E1D11D84464756E2164756E21