@builder.io/buildercode 0.4.5 → 0.4.6

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 (2) hide show
  1. package/dist/cli.mjs +135 -172
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -245255,7 +245255,7 @@ const LIB_CACHE = /* @__PURE__ */ new Map();
245255
245255
  const PENDING_LIB_CACHE = /* @__PURE__ */ new Map();
245256
245256
  const NODE_MODULE_CACHE = /* @__PURE__ */ new Map();
245257
245257
  const TSCONFIG_CACHE = /* @__PURE__ */ new Map();
245258
- const pkgVersion = process.env.OVERRIDE_VERSION ?? "0.4.5";
245258
+ const pkgVersion = process.env.OVERRIDE_VERSION ?? "0.4.6";
245259
245259
  //#endregion
245260
245260
  //#region ../dev-tools/core/detect-frameworks.ts
245261
245261
  async function detectFrameworks$1(sys) {
@@ -537795,6 +537795,7 @@ function getAtQuery(value) {
537795
537795
  }
537796
537796
  const InputPrompt = (0, import_react.memo)(({ onSubmit, onChange, onSlashCommand, onToggleSessionMode, onSlashMenuActiveChange, isTabActive = true, currentReasoning, initialValue, pendingAttachments = [], onAddAttachment, onRemoveAttachment }) => {
537797
537797
  const { isFocused } = useFocus({
537798
+ id: "input-prompt",
537798
537799
  autoFocus: true,
537799
537800
  isActive: isTabActive
537800
537801
  });
@@ -537937,6 +537938,7 @@ const InputPrompt = (0, import_react.memo)(({ onSubmit, onChange, onSlashCommand
537937
537938
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
537938
537939
  flexDirection: "column",
537939
537940
  marginY: 1,
537941
+ flexShrink: 0,
537940
537942
  children: [
537941
537943
  state.queue && state.queue.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
537942
537944
  flexDirection: "column",
@@ -540355,7 +540357,7 @@ const RecentSessions = (0, import_react.memo)(({ cwd, sessions: sessionsProp, li
540355
540357
  });
540356
540358
  //#endregion
540357
540359
  //#region src/components/WelcomeScreen.tsx
540358
- const VERSION$1 = "0.4.5";
540360
+ const VERSION$1 = "0.4.6";
540359
540361
  const FOCUS_SESSIONS = "welcome-sessions";
540360
540362
  const LOGO = `
540361
540363
  ██████╗ ██╗ ██╗ ██╗ ██╗ ██████╗ ███████╗ ██████╗
@@ -540371,7 +540373,7 @@ const LOGO_SMALL = `
540371
540373
  ╚═╝ ╚═╝ ╩ ╩═╝╚╩╝ ╚═╝ ╩╚═`.trim();
540372
540374
  const MAX_SESSIONS = 5;
540373
540375
  const WelcomeScreen = (0, import_react.memo)((t0) => {
540374
- const $ = (0, import_compiler_runtime.c)(43);
540376
+ const $ = (0, import_compiler_runtime.c)(36);
540375
540377
  const { onSubmit, onChange, onSlashCommand, onSlashMenuActiveChange, onToggleSessionMode, isTabActive: t1, localSessions: t2 } = t0;
540376
540378
  const isTabActive = t1 === void 0 ? true : t1;
540377
540379
  let t3;
@@ -540382,67 +540384,42 @@ const WelcomeScreen = (0, import_react.memo)((t0) => {
540382
540384
  } else t3 = $[1];
540383
540385
  const localSessions = t3;
540384
540386
  const [state] = useCodeGenState();
540385
- const { stdout } = useStdout();
540386
540387
  const theme = useTheme();
540387
540388
  const { activeId } = useFocusManager();
540388
- const [cols, setCols] = (0, import_react.useState)(stdout?.columns ?? 80);
540389
- const [rows, setRows] = (0, import_react.useState)(stdout?.rows ?? 24);
540389
+ const { rows, columns } = useWindowSize();
540390
540390
  let t4;
540391
- let t5;
540392
- if ($[2] !== stdout) {
540393
- t4 = () => {
540394
- if (!stdout) return;
540395
- const onResize = () => {
540396
- setCols(stdout.columns ?? 80);
540397
- setRows(stdout.rows ?? 24);
540398
- };
540399
- stdout.on("resize", onResize);
540400
- return () => {
540401
- stdout.off("resize", onResize);
540402
- };
540403
- };
540404
- t5 = [stdout];
540405
- $[2] = stdout;
540391
+ if ($[2] !== state.cwd) {
540392
+ t4 = state.cwd ? state.cwd.replace(process.env.HOME ?? "", "~") : process.cwd().replace(process.env.HOME ?? "", "~");
540393
+ $[2] = state.cwd;
540406
540394
  $[3] = t4;
540407
- $[4] = t5;
540408
- } else {
540409
- t4 = $[3];
540410
- t5 = $[4];
540411
- }
540412
- (0, import_react.useEffect)(t4, t5);
540413
- let t6;
540414
- if ($[5] !== state.cwd) {
540415
- t6 = state.cwd ? state.cwd.replace(process.env.HOME ?? "", "~") : process.cwd().replace(process.env.HOME ?? "", "~");
540416
- $[5] = state.cwd;
540417
- $[6] = t6;
540418
- } else t6 = $[6];
540419
- const displayCwd = t6;
540420
- const inputWidth = Math.min(Math.max(cols, 20), 90);
540421
- let t7;
540422
- if ($[7] !== localSessions) {
540423
- t7 = localSessions.slice(0, MAX_SESSIONS);
540424
- $[7] = localSessions;
540425
- $[8] = t7;
540426
- } else t7 = $[8];
540427
- const sessions = t7;
540395
+ } else t4 = $[3];
540396
+ const displayCwd = t4;
540397
+ const inputWidth = Math.min(Math.max(columns, 20), 90);
540398
+ let t5;
540399
+ if ($[4] !== localSessions) {
540400
+ t5 = localSessions.slice(0, MAX_SESSIONS);
540401
+ $[4] = localSessions;
540402
+ $[5] = t5;
540403
+ } else t5 = $[5];
540404
+ const sessions = t5;
540428
540405
  const showHistory = rows >= 16 && sessions.length > 0;
540429
540406
  const sessionsFocused = activeId === FOCUS_SESSIONS;
540430
- let t8;
540431
- if ($[9] !== onSlashCommand) {
540432
- t8 = (sessionId) => {
540407
+ let t6;
540408
+ if ($[6] !== onSlashCommand) {
540409
+ t6 = (sessionId) => {
540433
540410
  onSlashCommand?.({
540434
540411
  commandId: "sessions",
540435
540412
  value: sessionId
540436
540413
  });
540437
540414
  };
540438
- $[9] = onSlashCommand;
540439
- $[10] = t8;
540440
- } else t8 = $[10];
540441
- const handleSessionSelect = t8;
540442
- const t9 = cols >= 70 && rows >= 20 ? LOGO : cols >= 28 && rows >= 14 ? LOGO_SMALL : "BUILDER";
540443
- let t10;
540444
- if ($[11] !== t9 || $[12] !== theme.background) {
540445
- t10 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
540415
+ $[6] = onSlashCommand;
540416
+ $[7] = t6;
540417
+ } else t6 = $[7];
540418
+ const handleSessionSelect = t6;
540419
+ const t7 = columns >= 70 && rows >= 20 ? LOGO : columns >= 28 && rows >= 14 ? LOGO_SMALL : "BUILDER";
540420
+ let t8;
540421
+ if ($[8] !== t7 || $[9] !== theme.background) {
540422
+ t8 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
540446
540423
  flexDirection: "column",
540447
540424
  alignItems: "center",
540448
540425
  marginBottom: 1,
@@ -540450,17 +540427,17 @@ const WelcomeScreen = (0, import_react.memo)((t0) => {
540450
540427
  name: "vice",
540451
540428
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
540452
540429
  backgroundColor: theme.background,
540453
- children: t9
540430
+ children: t7
540454
540431
  })
540455
540432
  })
540456
540433
  });
540457
- $[11] = t9;
540458
- $[12] = theme.background;
540459
- $[13] = t10;
540460
- } else t10 = $[13];
540461
- let t11;
540462
- if ($[14] !== isTabActive || $[15] !== onChange || $[16] !== onSlashCommand || $[17] !== onSlashMenuActiveChange || $[18] !== onSubmit || $[19] !== onToggleSessionMode) {
540463
- t11 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InputPrompt, {
540434
+ $[8] = t7;
540435
+ $[9] = theme.background;
540436
+ $[10] = t8;
540437
+ } else t8 = $[10];
540438
+ let t9;
540439
+ if ($[11] !== isTabActive || $[12] !== onChange || $[13] !== onSlashCommand || $[14] !== onSlashMenuActiveChange || $[15] !== onSubmit || $[16] !== onToggleSessionMode) {
540440
+ t9 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InputPrompt, {
540464
540441
  onSubmit,
540465
540442
  onChange,
540466
540443
  onSlashCommand,
@@ -540468,28 +540445,28 @@ const WelcomeScreen = (0, import_react.memo)((t0) => {
540468
540445
  onToggleSessionMode,
540469
540446
  isTabActive
540470
540447
  });
540471
- $[14] = isTabActive;
540472
- $[15] = onChange;
540473
- $[16] = onSlashCommand;
540474
- $[17] = onSlashMenuActiveChange;
540475
- $[18] = onSubmit;
540476
- $[19] = onToggleSessionMode;
540477
- $[20] = t11;
540478
- } else t11 = $[20];
540479
- let t12;
540480
- if ($[21] !== inputWidth || $[22] !== t11) {
540481
- t12 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
540448
+ $[11] = isTabActive;
540449
+ $[12] = onChange;
540450
+ $[13] = onSlashCommand;
540451
+ $[14] = onSlashMenuActiveChange;
540452
+ $[15] = onSubmit;
540453
+ $[16] = onToggleSessionMode;
540454
+ $[17] = t9;
540455
+ } else t9 = $[17];
540456
+ let t10;
540457
+ if ($[18] !== inputWidth || $[19] !== t9) {
540458
+ t10 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
540482
540459
  width: inputWidth,
540483
540460
  flexDirection: "column",
540484
- children: t11
540461
+ children: t9
540485
540462
  });
540486
- $[21] = inputWidth;
540487
- $[22] = t11;
540488
- $[23] = t12;
540489
- } else t12 = $[23];
540490
- let t13;
540491
- if ($[24] !== handleSessionSelect || $[25] !== inputWidth || $[26] !== isTabActive || $[27] !== sessions || $[28] !== showHistory) {
540492
- t13 = showHistory && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
540463
+ $[18] = inputWidth;
540464
+ $[19] = t9;
540465
+ $[20] = t10;
540466
+ } else t10 = $[20];
540467
+ let t11;
540468
+ if ($[21] !== handleSessionSelect || $[22] !== inputWidth || $[23] !== isTabActive || $[24] !== sessions || $[25] !== showHistory) {
540469
+ t11 = showHistory && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
540493
540470
  width: inputWidth,
540494
540471
  marginTop: 1,
540495
540472
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RecentSessions, {
@@ -540500,103 +540477,87 @@ const WelcomeScreen = (0, import_react.memo)((t0) => {
540500
540477
  onSelect: handleSessionSelect
540501
540478
  })
540502
540479
  });
540503
- $[24] = handleSessionSelect;
540504
- $[25] = inputWidth;
540505
- $[26] = isTabActive;
540506
- $[27] = sessions;
540507
- $[28] = showHistory;
540508
- $[29] = t13;
540509
- } else t13 = $[29];
540510
- let t14;
540511
- if ($[30] !== sessionsFocused) {
540512
- t14 = sessionsFocused ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
540513
- gap: 3,
540514
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
540515
- dimColor: true,
540516
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
540517
- bold: true,
540518
- children: "↑↓"
540519
- }), " navigate"]
540520
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
540521
- dimColor: true,
540522
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
540523
- bold: true,
540524
- children: "enter"
540525
- }), " resume"]
540526
- })]
540527
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
540528
- gap: 3,
540529
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
540530
- dimColor: true,
540531
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
540532
- bold: true,
540533
- children: "↑↓"
540534
- }), " navigate"]
540480
+ $[21] = handleSessionSelect;
540481
+ $[22] = inputWidth;
540482
+ $[23] = isTabActive;
540483
+ $[24] = sessions;
540484
+ $[25] = showHistory;
540485
+ $[26] = t11;
540486
+ } else t11 = $[26];
540487
+ let t12;
540488
+ if ($[27] !== displayCwd || $[28] !== rows || $[29] !== sessionsFocused) {
540489
+ t12 = rows > 14 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
540490
+ marginTop: 1,
540491
+ flexDirection: "column",
540492
+ alignItems: "center",
540493
+ children: [sessionsFocused ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
540494
+ gap: 3,
540495
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
540496
+ dimColor: true,
540497
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
540498
+ bold: true,
540499
+ children: "↑↓"
540500
+ }), " navigate"]
540501
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
540502
+ dimColor: true,
540503
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
540504
+ bold: true,
540505
+ children: "enter"
540506
+ }), " resume"]
540507
+ })]
540508
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
540509
+ gap: 3,
540510
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
540511
+ dimColor: true,
540512
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
540513
+ bold: true,
540514
+ children: "↑↓"
540515
+ }), " navigate"]
540516
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
540517
+ dimColor: true,
540518
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
540519
+ bold: true,
540520
+ children: "tab"
540521
+ }), " switch modes"]
540522
+ })]
540535
540523
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
540536
540524
  dimColor: true,
540537
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
540538
- bold: true,
540539
- children: "tab"
540540
- }), " switch modes"]
540525
+ children: [
540526
+ displayCwd,
540527
+ " ",
540528
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
540529
+ dimColor: true,
540530
+ children: ["v", VERSION$1]
540531
+ })
540532
+ ]
540541
540533
  })]
540542
540534
  });
540543
- $[30] = sessionsFocused;
540544
- $[31] = t14;
540545
- } else t14 = $[31];
540546
- let t15;
540547
- if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
540548
- t15 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
540549
- dimColor: true,
540550
- children: ["v", VERSION$1]
540551
- });
540552
- $[32] = t15;
540553
- } else t15 = $[32];
540554
- let t16;
540555
- if ($[33] !== displayCwd) {
540556
- t16 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
540557
- dimColor: true,
540558
- children: [
540559
- displayCwd,
540560
- " ",
540561
- t15
540562
- ]
540563
- });
540564
- $[33] = displayCwd;
540565
- $[34] = t16;
540566
- } else t16 = $[34];
540567
- let t17;
540568
- if ($[35] !== t14 || $[36] !== t16) {
540569
- t17 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
540570
- marginTop: 1,
540571
- flexDirection: "column",
540572
- alignItems: "center",
540573
- children: [t14, t16]
540574
- });
540575
- $[35] = t14;
540576
- $[36] = t16;
540577
- $[37] = t17;
540578
- } else t17 = $[37];
540579
- let t18;
540580
- if ($[38] !== t10 || $[39] !== t12 || $[40] !== t13 || $[41] !== t17) {
540581
- t18 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
540535
+ $[27] = displayCwd;
540536
+ $[28] = rows;
540537
+ $[29] = sessionsFocused;
540538
+ $[30] = t12;
540539
+ } else t12 = $[30];
540540
+ let t13;
540541
+ if ($[31] !== t10 || $[32] !== t11 || $[33] !== t12 || $[34] !== t8) {
540542
+ t13 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
540582
540543
  flexDirection: "column",
540583
540544
  alignItems: "center",
540584
540545
  justifyContent: "center",
540585
540546
  flexGrow: 1,
540586
540547
  children: [
540548
+ t8,
540587
540549
  t10,
540588
- t12,
540589
- t13,
540590
- t17
540550
+ t11,
540551
+ t12
540591
540552
  ]
540592
540553
  });
540593
- $[38] = t10;
540594
- $[39] = t12;
540595
- $[40] = t13;
540596
- $[41] = t17;
540597
- $[42] = t18;
540598
- } else t18 = $[42];
540599
- return t18;
540554
+ $[31] = t10;
540555
+ $[32] = t11;
540556
+ $[33] = t12;
540557
+ $[34] = t8;
540558
+ $[35] = t13;
540559
+ } else t13 = $[35];
540560
+ return t13;
540600
540561
  });
540601
540562
  //#endregion
540602
540563
  //#region src/hooks/useToast.ts
@@ -542321,7 +542282,7 @@ const FooterSection = (0, import_react.memo)(() => {
542321
542282
  children: [
542322
542283
  "•",
542323
542284
  " Fusion ",
542324
- "0.4.5"
542285
+ "0.4.6"
542325
542286
  ]
542326
542287
  });
542327
542288
  $[10] = t7;
@@ -606396,6 +606357,7 @@ function CodeCommand({ onExit, sys, options, updateCheck }) {
606396
606357
  const sessionRef = (0, import_react.useRef)(null);
606397
606358
  const credentialsRef = (0, import_react.useRef)(null);
606398
606359
  const { rows } = useWindowSize();
606360
+ const { focus } = useFocusManager();
606399
606361
  const [credentials, setCredentials] = (0, import_react.useState)(null);
606400
606362
  const [sessionVersion, setSessionVersion] = (0, import_react.useState)(0);
606401
606363
  const [displayMode, setDisplayMode] = (0, import_react.useState)("code");
@@ -606424,6 +606386,9 @@ function CodeCommand({ onExit, sys, options, updateCheck }) {
606424
606386
  setDisplayMode((prev) => prev === "code" ? "claw" : prev === "claw" ? "kanban" : "code");
606425
606387
  }
606426
606388
  }, { isActive: initPhase === "ready" });
606389
+ (0, import_react.useEffect)(() => {
606390
+ if (displayMode === "code") focus("input-prompt");
606391
+ }, [displayMode]);
606427
606392
  const handleClawNewMessages = (0, import_react.useCallback)(() => {
606428
606393
  if (displayMode !== "claw") setClawHasUnread(true);
606429
606394
  }, [displayMode]);
@@ -606532,12 +606497,10 @@ function CodeCommand({ onExit, sys, options, updateCheck }) {
606532
606497
  })
606533
606498
  });
606534
606499
  if (initPhase === "needs-login") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NeedsLoginScreen, {
606535
- rows,
606536
606500
  onConfirm: continueInit,
606537
606501
  onExit: cleanup
606538
606502
  });
606539
606503
  if (initPhase === "authenticating") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AuthenticatingScreen, {
606540
- rows,
606541
606504
  authStatus,
606542
606505
  authUrl,
606543
606506
  onExit: cleanup
@@ -606554,7 +606517,7 @@ function CodeCommand({ onExit, sys, options, updateCheck }) {
606554
606517
  flexDirection: "column",
606555
606518
  flexGrow: 1,
606556
606519
  children: [
606557
- clawEnabled === true && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabBar, {
606520
+ clawEnabled === true && rows > 20 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabBar, {
606558
606521
  displayMode,
606559
606522
  clawHasUnread
606560
606523
  }),
@@ -606614,7 +606577,7 @@ function isStandaloneBinary() {
606614
606577
  return !path$6.basename(process.execPath, ".exe").startsWith("node");
606615
606578
  }
606616
606579
  function getCurrentVersion() {
606617
- return "0.4.5";
606580
+ return "0.4.6";
606618
606581
  }
606619
606582
  async function fetchLatestVersion() {
606620
606583
  return new Promise((resolve, reject) => {
@@ -607055,7 +607018,7 @@ function initSentry() {
607055
607018
  init({
607056
607019
  dsn: "https://1c5033d697e0271ebe53773bff826de0@o117565.ingest.us.sentry.io/4511107776905216",
607057
607020
  tracesSampleRate: 0,
607058
- release: "0.4.5",
607021
+ release: "0.4.6",
607059
607022
  environment: process.env.NODE_ENV ?? "development",
607060
607023
  enabled: false,
607061
607024
  registerEsmLoaderHooks: false,
@@ -607067,7 +607030,7 @@ function initSentry() {
607067
607030
  }
607068
607031
  //#endregion
607069
607032
  //#region src/cli.tsx
607070
- const VERSION = "0.4.5";
607033
+ const VERSION = "0.4.6";
607071
607034
  async function startInk(command, options) {
607072
607035
  const sys = await createDevToolsNodeSys({
607073
607036
  cwd: process.cwd(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/buildercode",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "Builder.io CLI - AI-powered code generation",
5
5
  "license": "MIT",
6
6
  "bin": {