@builder.io/buildercode 0.3.2 → 0.3.4

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 +295 -189
  2. package/package.json +2 -2
package/dist/cli.mjs CHANGED
@@ -244266,7 +244266,7 @@ const LIB_CACHE = /* @__PURE__ */ new Map();
244266
244266
  const PENDING_LIB_CACHE = /* @__PURE__ */ new Map();
244267
244267
  const NODE_MODULE_CACHE = /* @__PURE__ */ new Map();
244268
244268
  const TSCONFIG_CACHE = /* @__PURE__ */ new Map();
244269
- const pkgVersion = process.env.OVERRIDE_VERSION ?? "0.3.2";
244269
+ const pkgVersion = process.env.OVERRIDE_VERSION ?? "0.3.4";
244270
244270
  //#endregion
244271
244271
  //#region ../dev-tools/core/detect-frameworks.ts
244272
244272
  async function detectFrameworks$1(sys) {
@@ -521534,7 +521534,7 @@ Make the necessary changes and try again.`
521534
521534
  position: agent?.position ?? `${basePosition}-agent`,
521535
521535
  mode,
521536
521536
  includeMemories,
521537
- modelOverride: resolveModelShortcut(resolvedModel) ?? this.#lastModelOverride ?? this.#modelOverride,
521537
+ modelOverride: agent?.inheritSessionModel && (this.#lastModelOverride ?? this.#modelOverride) ? this.#lastModelOverride ?? this.#modelOverride : resolveModelShortcut(resolvedModel) ?? this.#lastModelOverride ?? this.#modelOverride,
521538
521538
  sessionOrCompletionId: sessionId,
521539
521539
  workingDirectory: this.#workingDirectory,
521540
521540
  mcpServers,
@@ -523174,16 +523174,7 @@ Make the necessary changes and try again.`
523174
523174
  this.#currentMessage = void 0;
523175
523175
  if (filesChanged) this.#devServerOrchestrator?.addCheckpoint();
523176
523176
  if (signal?.aborted) throw newAbortError(signal.reason);
523177
- const scheduledMessage = this.#consumeScheduledMessages();
523178
- if (scheduledMessage?.syncChanges) await this.syncChangesFromRemote(scheduledMessage.syncChanges);
523179
523177
  const { hasHealthIssue } = await this.#checkAndUpdateHealthIssueCount();
523180
- if (scheduledMessage) {
523181
- this.#logger.debug(`(agentCompletion-${loopCount}): consumed queued messages`);
523182
- includeUserMessage = true;
523183
- userMessage = scheduledMessage;
523184
- totalCompletions = 0;
523185
- continue;
523186
- }
523187
523178
  if (!shouldContinue) {
523188
523179
  if (signal?.aborted) throw newAbortError(signal.reason);
523189
523180
  const sessionMode = this.getSessionMode();
@@ -523199,6 +523190,15 @@ Make the necessary changes and try again.`
523199
523190
  healthIssueCount++;
523200
523191
  continue;
523201
523192
  }
523193
+ const scheduledMessage = this.#consumeScheduledMessages();
523194
+ if (scheduledMessage?.syncChanges) await this.syncChangesFromRemote(scheduledMessage.syncChanges);
523195
+ if (scheduledMessage) {
523196
+ this.#logger.debug(`(agentCompletion-${loopCount}): consumed queued messages`);
523197
+ includeUserMessage = true;
523198
+ userMessage = scheduledMessage;
523199
+ totalCompletions = 0;
523200
+ continue;
523201
+ }
523202
523202
  const devServer = this.#devServerOrchestrator;
523203
523203
  const shouldRunValidateCommand = userMessage.runValidateCommand ?? true;
523204
523204
  if (devServer?.validateCommand && shouldRunValidateCommand && validationCount < 2 && this.#pendingValidation) {
@@ -523341,7 +523341,7 @@ failed with code ${result.code}`,
523341
523341
  skipFileDiff: this.#skipFileDiff,
523342
523342
  maxTokens: this.#maxTokens,
523343
523343
  aclPolicy: this.#fusionConfig?.accessControl,
523344
- repoIndexingConfig: this.#fusionConfig?.repoIndexingConfig,
523344
+ repoIndexingConfig: this.#fusionConfig?.repoIndexingConfig ?? { designSystems: [] },
523345
523345
  recommendedRoot: this.#recommendedRootDir,
523346
523346
  attachments: userInput.attachments,
523347
523347
  customInstructions: sessionContext.customInstructions,
@@ -526439,7 +526439,8 @@ async function exit$1(toolContext, input) {
526439
526439
  };
526440
526440
  }
526441
526441
  if (state === "verified") {
526442
- const setupVerified = configuration.setupCommand.verified;
526442
+ const setupNoInstallNeeded = !configuration.setupCommand.value;
526443
+ const setupVerified = configuration.setupCommand.verified || setupNoInstallNeeded;
526443
526444
  const devVerified = configuration.devCommand.verified;
526444
526445
  const serverVerified = configuration.devServer.verified;
526445
526446
  const validateCommand = configuration.validateCommand.verified;
@@ -533565,7 +533566,6 @@ function useCodeGenStateHandler() {
533565
533566
  };
533566
533567
  state.messages.push(existingTool_1);
533567
533568
  }
533568
- if (isTool(existingTool_1, "TodoWrite")) state.todoItems = existingTool_1.input?.todos;
533569
533569
  break;
533570
533570
  }
533571
533571
  case "tool_result": {
@@ -533579,6 +533579,10 @@ function useCodeGenStateHandler() {
533579
533579
  existingTool_0.input = processToolInput(existingTool_0.content);
533580
533580
  }
533581
533581
  toolResult.content = toolResult.content;
533582
+ if (isTool(existingTool_0, "TodoWrite")) {
533583
+ const todos = existingTool_0.structuredResult?.todos;
533584
+ if (Array.isArray(todos)) state.todoItems = todos;
533585
+ }
533582
533586
  }
533583
533587
  break;
533584
533588
  }
@@ -534257,7 +534261,8 @@ const InputPrompt = (0, import_react.memo)(({ onSubmit, onChange, onSlashCommand
534257
534261
  const [inputKey, setInputKey] = (0, import_react.useState)(0);
534258
534262
  const hasPlan = state.hasPlanToApply && !!onImplementPlan;
534259
534263
  const planIsActive = hasPlan && !value;
534260
- const hint = hasPlan ? "Type to refine the plan..." : "Describe what you want to build...";
534264
+ const isPlanning = state.sessionMode === "planning" || state.sessionMode === "auto-planning";
534265
+ const hint = hasPlan ? "Type to refine the plan..." : isPlanning ? "Describe what you want to plan..." : "Describe what you want to build...";
534261
534266
  const slashMenuActive = (0, import_react.useMemo)(() => !!onSlashCommand && isSlashCommandInput(value) && value.trim().length > 0 && value !== dismissedSlashValue, [
534262
534267
  dismissedSlashValue,
534263
534268
  onSlashCommand,
@@ -534327,7 +534332,7 @@ const InputPrompt = (0, import_react.memo)(({ onSubmit, onChange, onSlashCommand
534327
534332
  setDismissedAtValue(value);
534328
534333
  }, [value]);
534329
534334
  const theme = useTheme();
534330
- const accentColor = state.sessionMode === "planning" || state.sessionMode === "auto-planning" ? "cyan" : "magenta";
534335
+ const accentColor = isPlanning ? "cyan" : "magenta";
534331
534336
  const ide = state.ideContext;
534332
534337
  const ideBasename = ide?.file ? ide.file.split("/").pop() ?? ide.file : null;
534333
534338
  const ideFilename = ideBasename && ideBasename.length > 20 ? "…" + ideBasename.slice(-19) : ideBasename;
@@ -536909,7 +536914,7 @@ const ContextSection = (0, import_react.memo)(() => {
536909
536914
  const $ = (0, import_compiler_runtime.c)(72);
536910
536915
  const [state] = useCodeGenState();
536911
536916
  const ctx = state.contextWindow;
536912
- const barWidth = SIDEBAR_WIDTH$1 - 20;
536917
+ const barWidth = SIDEBAR_WIDTH$1 - 24;
536913
536918
  if (!ctx) {
536914
536919
  let t0;
536915
536920
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
@@ -537882,7 +537887,7 @@ const TodoSection = (0, import_react.memo)(() => {
537882
537887
  return t4;
537883
537888
  });
537884
537889
  const FooterSection = (0, import_react.memo)(() => {
537885
- const $ = (0, import_compiler_runtime.c)(7);
537890
+ const $ = (0, import_compiler_runtime.c)(10);
537886
537891
  const [state] = useCodeGenState();
537887
537892
  let t0;
537888
537893
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
@@ -537890,49 +537895,63 @@ const FooterSection = (0, import_react.memo)(() => {
537890
537895
  $[0] = t0;
537891
537896
  } else t0 = $[0];
537892
537897
  let t1;
537893
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
537894
- t1 = process.cwd().replace(process.env.HOME ?? "", "~");
537895
- $[1] = t1;
537896
- } else t1 = $[1];
537897
- const t2 = state.gitState?.currentBranch;
537898
- let t3;
537899
- if ($[2] !== t2) {
537900
- t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
537898
+ if ($[1] !== state.sessionId) {
537899
+ t1 = state.sessionId && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
537901
537900
  marginTop: 1,
537902
537901
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
537903
537902
  dimColor: true,
537904
- children: [t1, t2]
537903
+ children: ["--resume ", state.sessionId]
537905
537904
  })
537906
537905
  });
537907
- $[2] = t2;
537908
- $[3] = t3;
537909
- } else t3 = $[3];
537906
+ $[1] = state.sessionId;
537907
+ $[2] = t1;
537908
+ } else t1 = $[2];
537909
+ let t2;
537910
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
537911
+ t2 = process.cwd().replace(process.env.HOME ?? "", "~");
537912
+ $[3] = t2;
537913
+ } else t2 = $[3];
537914
+ const t3 = state.gitState?.currentBranch;
537910
537915
  let t4;
537911
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
537912
- t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
537916
+ if ($[4] !== t3) {
537917
+ t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
537918
+ marginTop: 1,
537919
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
537920
+ dimColor: true,
537921
+ children: [t2, t3]
537922
+ })
537923
+ });
537924
+ $[4] = t3;
537925
+ $[5] = t4;
537926
+ } else t4 = $[5];
537927
+ let t5;
537928
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
537929
+ t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
537913
537930
  dimColor: true,
537914
537931
  children: [
537915
537932
  "•",
537916
537933
  " Fusion ",
537917
- "0.3.2"
537934
+ "0.3.4"
537918
537935
  ]
537919
537936
  });
537920
- $[4] = t4;
537921
- } else t4 = $[4];
537922
- let t5;
537923
- if ($[5] !== t3) {
537924
- t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
537937
+ $[6] = t5;
537938
+ } else t5 = $[6];
537939
+ let t6;
537940
+ if ($[7] !== t1 || $[8] !== t4) {
537941
+ t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
537925
537942
  flexDirection: "column",
537926
537943
  children: [
537927
537944
  t0,
537928
- t3,
537929
- t4
537945
+ t1,
537946
+ t4,
537947
+ t5
537930
537948
  ]
537931
537949
  });
537932
- $[5] = t3;
537933
- $[6] = t5;
537934
- } else t5 = $[6];
537935
- return t5;
537950
+ $[7] = t1;
537951
+ $[8] = t4;
537952
+ $[9] = t6;
537953
+ } else t6 = $[9];
537954
+ return t6;
537936
537955
  });
537937
537956
  const Sidebar = (0, import_react.memo)(() => {
537938
537957
  const $ = (0, import_compiler_runtime.c)(10);
@@ -597465,7 +597484,7 @@ function _temp2$1(line, i) {
597465
597484
  }, i);
597466
597485
  }
597467
597486
  function ToolCallRead(t0) {
597468
- const $ = (0, import_compiler_runtime.c)(15);
597487
+ const $ = (0, import_compiler_runtime.c)(14);
597469
597488
  const { tool } = t0;
597470
597489
  let t1;
597471
597490
  if ($[0] !== tool.input) {
@@ -597475,43 +597494,41 @@ function ToolCallRead(t0) {
597475
597494
  } else t1 = $[1];
597476
597495
  const { file_path, offset, limit, view_range } = t1;
597477
597496
  let rangeInfo;
597478
- if (view_range) rangeInfo = `lines ${view_range[0]}–${view_range[1]}`;
597497
+ if (view_range) rangeInfo = `:${view_range[0]} ${view_range[1] - view_range[0]}L`;
597479
597498
  else if (offset != null || limit != null) {
597480
- let parts;
597481
- if ($[2] !== limit || $[3] !== offset) {
597482
- parts = [];
597483
- if (offset != null) parts.push(`offset ${offset}`);
597484
- if (limit != null) parts.push(`${limit} lines`);
597485
- $[2] = limit;
597486
- $[3] = offset;
597487
- $[4] = parts;
597488
- } else parts = $[4];
597489
- rangeInfo = parts.join(", ");
597499
+ const t2 = `${offset != null ? `:${offset}` : ""}${limit != null ? ` ${limit}L` : ""}`;
597500
+ let t3;
597501
+ if ($[2] !== t2) {
597502
+ t3 = t2.trim();
597503
+ $[2] = t2;
597504
+ $[3] = t3;
597505
+ } else t3 = $[3];
597506
+ rangeInfo = t3;
597490
597507
  }
597491
597508
  let t2;
597492
- if ($[5] !== file_path) {
597509
+ if ($[4] !== file_path) {
597493
597510
  t2 = file_path && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FilePath, { path: file_path });
597494
- $[5] = file_path;
597495
- $[6] = t2;
597496
- } else t2 = $[6];
597511
+ $[4] = file_path;
597512
+ $[5] = t2;
597513
+ } else t2 = $[5];
597497
597514
  let t3;
597498
- if ($[7] !== rangeInfo) {
597515
+ if ($[6] !== rangeInfo) {
597499
597516
  t3 = rangeInfo && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
597500
597517
  dimColor: true,
597501
597518
  children: rangeInfo
597502
597519
  });
597503
- $[7] = rangeInfo;
597504
- $[8] = t3;
597505
- } else t3 = $[8];
597520
+ $[6] = rangeInfo;
597521
+ $[7] = t3;
597522
+ } else t3 = $[7];
597506
597523
  let t4;
597507
- if ($[9] !== t2 || $[10] !== t3) {
597524
+ if ($[8] !== t2 || $[9] !== t3) {
597508
597525
  t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [t2, t3] });
597509
- $[9] = t2;
597510
- $[10] = t3;
597511
- $[11] = t4;
597512
- } else t4 = $[11];
597526
+ $[8] = t2;
597527
+ $[9] = t3;
597528
+ $[10] = t4;
597529
+ } else t4 = $[10];
597513
597530
  let t5;
597514
- if ($[12] !== t4 || $[13] !== tool) {
597531
+ if ($[11] !== t4 || $[12] !== tool) {
597515
597532
  t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
597516
597533
  flexDirection: "column",
597517
597534
  paddingX: 1,
@@ -597521,10 +597538,10 @@ function ToolCallRead(t0) {
597521
597538
  extra: t4
597522
597539
  })
597523
597540
  });
597524
- $[12] = t4;
597525
- $[13] = tool;
597526
- $[14] = t5;
597527
- } else t5 = $[14];
597541
+ $[11] = t4;
597542
+ $[12] = tool;
597543
+ $[13] = t5;
597544
+ } else t5 = $[13];
597528
597545
  return t5;
597529
597546
  }
597530
597547
  function ToolCallEdit(t0) {
@@ -597661,7 +597678,7 @@ function ToolCallMultiEdit(t0) {
597661
597678
  return t7;
597662
597679
  }
597663
597680
  function ToolCallBash(t0) {
597664
- const $ = (0, import_compiler_runtime.c)(19);
597681
+ const $ = (0, import_compiler_runtime.c)(21);
597665
597682
  const { tool } = t0;
597666
597683
  let t1;
597667
597684
  if ($[0] !== tool.input) {
@@ -597670,61 +597687,78 @@ function ToolCallBash(t0) {
597670
597687
  $[1] = t1;
597671
597688
  } else t1 = $[1];
597672
597689
  const { command, description, restart } = t1;
597690
+ const displayTitle = restart ? "[restart]" : description;
597673
597691
  let t2;
597674
- if ($[2] !== command || $[3] !== description || $[4] !== restart) {
597675
- t2 = restart ? "[restart]" : description || (command ? command.includes("\n") ? command.split("\n")[0] + " ..." : command.slice(0, 80) : void 0);
597692
+ if ($[2] !== command || $[3] !== restart) {
597693
+ t2 = !restart && command ? command.includes("\n") ? command.split("\n")[0] + " ..." : command.slice(0, 80) : void 0;
597676
597694
  $[2] = command;
597677
- $[3] = description;
597678
- $[4] = restart;
597679
- $[5] = t2;
597680
- } else t2 = $[5];
597695
+ $[3] = restart;
597696
+ $[4] = t2;
597697
+ } else t2 = $[4];
597681
597698
  const displayCmd = t2;
597682
597699
  let t3;
597683
- if ($[6] !== tool.state || $[7] !== tool.toolResult) {
597700
+ if ($[5] !== tool.state || $[6] !== tool.toolResult) {
597684
597701
  t3 = tool.state === "success" || tool.state === "error" ? getResultText(tool.toolResult) : void 0;
597685
- $[6] = tool.state;
597686
- $[7] = tool.toolResult;
597687
- $[8] = t3;
597688
- } else t3 = $[8];
597702
+ $[5] = tool.state;
597703
+ $[6] = tool.toolResult;
597704
+ $[7] = t3;
597705
+ } else t3 = $[7];
597689
597706
  const resultText = t3;
597690
597707
  let t4;
597691
- if ($[9] !== displayCmd) {
597692
- t4 = displayCmd ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CmdText, { cmd: displayCmd }) : void 0;
597693
- $[9] = displayCmd;
597694
- $[10] = t4;
597695
- } else t4 = $[10];
597708
+ if ($[8] !== displayTitle) {
597709
+ t4 = displayTitle ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CmdText, { cmd: displayTitle }) : void 0;
597710
+ $[8] = displayTitle;
597711
+ $[9] = t4;
597712
+ } else t4 = $[9];
597696
597713
  let t5;
597697
- if ($[11] !== t4 || $[12] !== tool) {
597714
+ if ($[10] !== t4 || $[11] !== tool) {
597698
597715
  t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolHeader, {
597699
597716
  tool,
597700
597717
  label: TOOL_LABELS.Bash,
597701
597718
  extra: t4
597702
597719
  });
597703
- $[11] = t4;
597704
- $[12] = tool;
597705
- $[13] = t5;
597706
- } else t5 = $[13];
597720
+ $[10] = t4;
597721
+ $[11] = tool;
597722
+ $[12] = t5;
597723
+ } else t5 = $[12];
597707
597724
  let t6;
597708
- if ($[14] !== resultText) {
597709
- t6 = resultText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(OutputPreview, {
597725
+ if ($[13] !== displayCmd) {
597726
+ t6 = displayCmd && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
597727
+ paddingLeft: 3,
597728
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
597729
+ dimColor: true,
597730
+ children: ["$ ", displayCmd]
597731
+ })
597732
+ });
597733
+ $[13] = displayCmd;
597734
+ $[14] = t6;
597735
+ } else t6 = $[14];
597736
+ let t7;
597737
+ if ($[15] !== resultText) {
597738
+ t7 = resultText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(OutputPreview, {
597710
597739
  text: resultText,
597711
597740
  maxLines: 8
597712
597741
  });
597713
- $[14] = resultText;
597714
- $[15] = t6;
597715
- } else t6 = $[15];
597716
- let t7;
597717
- if ($[16] !== t5 || $[17] !== t6) {
597718
- t7 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
597742
+ $[15] = resultText;
597743
+ $[16] = t7;
597744
+ } else t7 = $[16];
597745
+ let t8;
597746
+ if ($[17] !== t5 || $[18] !== t6 || $[19] !== t7) {
597747
+ t8 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
597719
597748
  flexDirection: "column",
597720
597749
  paddingX: 1,
597721
- children: [t5, t6]
597750
+ children: [
597751
+ t5,
597752
+ t6,
597753
+ t7
597754
+ ]
597722
597755
  });
597723
- $[16] = t5;
597724
- $[17] = t6;
597725
- $[18] = t7;
597726
- } else t7 = $[18];
597727
- return t7;
597756
+ $[17] = t5;
597757
+ $[18] = t6;
597758
+ $[19] = t7;
597759
+ $[20] = t8;
597760
+ } else t8 = $[20];
597761
+ return t8;
597728
597762
  }
597729
597763
  function ToolCallGrep(t0) {
597730
597764
  const $ = (0, import_compiler_runtime.c)(23);
@@ -598610,8 +598644,30 @@ function buildDots(added, removed) {
598610
598644
  red: dots - green
598611
598645
  };
598612
598646
  }
598647
+ const IDLE_VERBS = [
598648
+ "Worked",
598649
+ "Cooked",
598650
+ "Crunched",
598651
+ "Built",
598652
+ "Boiled",
598653
+ "Crafted",
598654
+ "Brewed",
598655
+ "Hammered",
598656
+ "Churned",
598657
+ "Wrangled",
598658
+ "Baked",
598659
+ "Forged",
598660
+ "Hacked",
598661
+ "Computed",
598662
+ "Chiseled"
598663
+ ];
598664
+ function pickVerb(seed) {
598665
+ let hash = 0;
598666
+ for (let i = 0; i < seed.length; i++) hash = hash * 31 + seed.charCodeAt(i) >>> 0;
598667
+ return IDLE_VERBS[hash % IDLE_VERBS.length];
598668
+ }
598613
598669
  function IdleBlock(t0) {
598614
- const $ = (0, import_compiler_runtime.c)(17);
598670
+ const $ = (0, import_compiler_runtime.c)(20);
598615
598671
  const { message } = t0;
598616
598672
  let t1;
598617
598673
  if ($[0] !== message.durationMs) {
@@ -598620,73 +598676,86 @@ function IdleBlock(t0) {
598620
598676
  $[1] = t1;
598621
598677
  } else t1 = $[1];
598622
598678
  const duration = t1;
598623
- let t2;
598624
- if ($[2] !== message.creditsUsed) {
598625
- t2 = message.creditsUsed > 0 ? `${message.creditsUsed.toFixed(2)} credits` : null;
598626
- $[2] = message.creditsUsed;
598627
- $[3] = t2;
598628
- } else t2 = $[3];
598629
- const credits = t2;
598679
+ const t2 = message.id ?? duration;
598630
598680
  let t3;
598631
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
598632
- t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
598681
+ if ($[2] !== t2) {
598682
+ t3 = pickVerb(t2);
598683
+ $[2] = t2;
598684
+ $[3] = t3;
598685
+ } else t3 = $[3];
598686
+ const verb = t3;
598687
+ let t4;
598688
+ if ($[4] !== message.creditsUsed) {
598689
+ t4 = message.creditsUsed > 0 ? `${message.creditsUsed.toFixed(2)} credits` : null;
598690
+ $[4] = message.creditsUsed;
598691
+ $[5] = t4;
598692
+ } else t4 = $[5];
598693
+ const credits = t4;
598694
+ let t5;
598695
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
598696
+ t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
598633
598697
  color: "magenta",
598634
598698
  bold: true,
598635
598699
  children: "✦"
598636
598700
  });
598637
- $[4] = t3;
598638
- } else t3 = $[4];
598639
- let t4;
598640
- if ($[5] !== duration) {
598641
- t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
598701
+ $[6] = t5;
598702
+ } else t5 = $[6];
598703
+ let t6;
598704
+ if ($[7] !== duration || $[8] !== verb) {
598705
+ t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
598642
598706
  bold: true,
598643
- children: ["Worked for ", duration]
598707
+ children: [
598708
+ verb,
598709
+ " for ",
598710
+ duration
598711
+ ]
598644
598712
  });
598645
- $[5] = duration;
598646
- $[6] = t4;
598647
- } else t4 = $[6];
598648
- let t5;
598649
- if ($[7] !== credits) {
598650
- t5 = credits && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
598713
+ $[7] = duration;
598714
+ $[8] = verb;
598715
+ $[9] = t6;
598716
+ } else t6 = $[9];
598717
+ let t7;
598718
+ if ($[10] !== credits) {
598719
+ t7 = credits && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
598651
598720
  dimColor: true,
598652
598721
  children: ["· ", credits]
598653
598722
  });
598654
- $[7] = credits;
598655
- $[8] = t5;
598656
- } else t5 = $[8];
598657
- let t6;
598658
- if ($[9] !== t4 || $[10] !== t5) {
598659
- t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
598723
+ $[10] = credits;
598724
+ $[11] = t7;
598725
+ } else t7 = $[11];
598726
+ let t8;
598727
+ if ($[12] !== t6 || $[13] !== t7) {
598728
+ t8 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
598660
598729
  gap: 1,
598661
598730
  children: [
598662
- t3,
598663
- t4,
598664
- t5
598731
+ t5,
598732
+ t6,
598733
+ t7
598665
598734
  ]
598666
598735
  });
598667
- $[9] = t4;
598668
- $[10] = t5;
598669
- $[11] = t6;
598670
- } else t6 = $[11];
598671
- let t7;
598672
- if ($[12] !== message.applyResults) {
598673
- t7 = message.applyResults.map(_temp$1);
598674
- $[12] = message.applyResults;
598736
+ $[12] = t6;
598675
598737
  $[13] = t7;
598676
- } else t7 = $[13];
598677
- let t8;
598678
- if ($[14] !== t6 || $[15] !== t7) {
598679
- t8 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
598738
+ $[14] = t8;
598739
+ } else t8 = $[14];
598740
+ let t9;
598741
+ if ($[15] !== message.applyResults) {
598742
+ t9 = message.applyResults.map(_temp$1);
598743
+ $[15] = message.applyResults;
598744
+ $[16] = t9;
598745
+ } else t9 = $[16];
598746
+ let t10;
598747
+ if ($[17] !== t8 || $[18] !== t9) {
598748
+ t10 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
598680
598749
  flexDirection: "column",
598681
598750
  paddingX: 0,
598682
598751
  marginY: 1,
598683
- children: [t6, t7]
598752
+ children: [t8, t9]
598684
598753
  });
598685
- $[14] = t6;
598686
- $[15] = t7;
598687
- $[16] = t8;
598688
- } else t8 = $[16];
598689
- return t8;
598754
+ $[17] = t8;
598755
+ $[18] = t9;
598756
+ $[19] = t10;
598757
+ } else t10 = $[19];
598758
+ return t10;
598690
598759
  }
598691
598760
  function _temp$1(result) {
598692
598761
  const { green, red } = buildDots(result.addedLines, result.removedLines);
@@ -598698,13 +598767,15 @@ function _temp$1(result) {
598698
598767
  dimColor: true,
598699
598768
  children: result.filePath
598700
598769
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, { children: [
598701
- result.addedLines > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
598702
- color: "green",
598703
- children: ["+", result.addedLines]
598704
- }),
598705
- result.removedLines > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
598706
- color: "red",
598707
- children: ["-", result.removedLines]
598770
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
598771
+ marginRight: 1,
598772
+ children: [result.addedLines > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
598773
+ color: "green",
598774
+ children: ["+", result.addedLines]
598775
+ }), result.removedLines > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
598776
+ color: "red",
598777
+ children: ["-", result.removedLines]
598778
+ })]
598708
598779
  }),
598709
598780
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
598710
598781
  color: "green",
@@ -598791,6 +598862,7 @@ const CodeSessionWrapper = (0, import_react.memo)((t0) => {
598791
598862
  const CodeSession = (0, import_react.memo)(({ onExit, isTabActive = true }) => {
598792
598863
  const { stdout } = useStdout();
598793
598864
  const [cols, setCols] = (0, import_react.useState)(stdout?.columns ?? 80);
598865
+ const [rows, setRows] = (0, import_react.useState)(stdout?.rows ?? 24);
598794
598866
  const [slashMenuActive, setSlashMenuActive] = (0, import_react.useState)(false);
598795
598867
  const [ctrlCPending, setCtrlCPending] = (0, import_react.useState)(false);
598796
598868
  const ctrlCTimer = (0, import_react.useRef)(null);
@@ -598805,9 +598877,7 @@ const CodeSession = (0, import_react.memo)(({ onExit, isTabActive = true }) => {
598805
598877
  userScrolledUp.current = nextOffset < bottomOffset;
598806
598878
  scrollView.scrollTo(nextOffset);
598807
598879
  }, []);
598808
- const enableMouseTracking = process.env.TERM_PROGRAM !== "vscode";
598809
598880
  (0, import_react.useEffect)(() => {
598810
- if (!enableMouseTracking) return;
598811
598881
  process.stdout.write("\x1B[?1000h\x1B[?1006h");
598812
598882
  return () => {
598813
598883
  process.stdout.write("\x1B[?1006l\x1B[?1000l");
@@ -598826,7 +598896,7 @@ const CodeSession = (0, import_react.memo)(({ onExit, isTabActive = true }) => {
598826
598896
  }, [scrollByClamped]);
598827
598897
  const [state, api, proxy] = useCodeGenState();
598828
598898
  const showWelcome = state.state === "loading" || state.state === "initial-with-url" || state.state === "initial-without-url";
598829
- const showSidebar = cols >= 90 && !showWelcome;
598899
+ const showSidebar = cols >= 90 && rows >= 24 && !showWelcome;
598830
598900
  const answerUserQuestions = (0, import_react.useCallback)((answers) => {
598831
598901
  const id = state.activeUserQuestions?.id;
598832
598902
  if (!id) return;
@@ -598836,6 +598906,7 @@ const CodeSession = (0, import_react.memo)(({ onExit, isTabActive = true }) => {
598836
598906
  const handleResize = () => {
598837
598907
  scrollRef.current?.remeasure();
598838
598908
  setCols(stdout?.columns ?? 80);
598909
+ setRows(stdout?.rows ?? 24);
598839
598910
  };
598840
598911
  stdout?.on("resize", handleResize);
598841
598912
  return () => {
@@ -598948,12 +599019,11 @@ const CodeSession = (0, import_react.memo)(({ onExit, isTabActive = true }) => {
598948
599019
  scrollRef.current?.scrollToBottom();
598949
599020
  }, [handleSlashCommand]);
598950
599021
  const handleImplementPlan = (0, import_react.useCallback)(async () => {
598951
- await api.switchSessionMode("normal");
598952
- await api.clearSession();
598953
599022
  await api.sendMessage({
598954
- userPrompt: "Implement the plan.",
598955
- displayPrompt: "Implement the plan",
599023
+ userPrompt: "Let's implement the plan. Pay attention to the details, makes sure to use TodoWrite to update the steps to todo.",
599024
+ displayPrompt: `Let's implement the plan`,
598956
599025
  queue: true,
599026
+ sessionMode: "normal",
598957
599027
  user: {
598958
599028
  role: "user",
598959
599029
  source: "builder.io"
@@ -598962,6 +599032,9 @@ const CodeSession = (0, import_react.memo)(({ onExit, isTabActive = true }) => {
598962
599032
  userScrolledUp.current = false;
598963
599033
  scrollRef.current?.scrollToBottom();
598964
599034
  }, [api]);
599035
+ const startIndex = Math.max(0, state.messages.length - 200);
599036
+ const visibleMessages = state.messages.slice(startIndex);
599037
+ const hiddenCount = startIndex;
598965
599038
  const showInput = !!!state.activeUserQuestions;
598966
599039
  if (!isTabActive) return null;
598967
599040
  if (showWelcome) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
@@ -599002,11 +599075,24 @@ const CodeSession = (0, import_react.memo)(({ onExit, isTabActive = true }) => {
599002
599075
  children: "You can still type below. Use /clear to reset the session."
599003
599076
  })]
599004
599077
  }),
599005
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollView, {
599078
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ScrollView, {
599006
599079
  ref: scrollRef,
599007
599080
  flexGrow: 1,
599008
599081
  flexDirection: "column",
599009
- children: state.messages.map((msg, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ErrorBoundary, {
599082
+ children: [hiddenCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
599083
+ paddingX: 2,
599084
+ paddingY: 1,
599085
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
599086
+ dimColor: true,
599087
+ children: [
599088
+ "─── ",
599089
+ hiddenCount,
599090
+ " older message",
599091
+ hiddenCount === 1 ? "" : "s",
599092
+ " not shown ───"
599093
+ ]
599094
+ })
599095
+ }), visibleMessages.map((msg, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ErrorBoundary, {
599010
599096
  fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
599011
599097
  paddingX: 2,
599012
599098
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
@@ -599015,8 +599101,8 @@ const CodeSession = (0, import_react.memo)(({ onExit, isTabActive = true }) => {
599015
599101
  children: "[failed to render message]"
599016
599102
  })
599017
599103
  }),
599018
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MessageBlockView, { message: proxy.messages[i] }, `msg-${msg.id}-${i}`)
599019
- }, `err-${msg.id}-${i}`))
599104
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MessageBlockView, { message: proxy.messages[startIndex + i] }, `msg-${msg.id}-${startIndex + i}`)
599105
+ }, `err-${msg.id}-${startIndex + i}`))]
599020
599106
  })
599021
599107
  })
599022
599108
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
@@ -599357,6 +599443,7 @@ const ClawSidebar = (0, import_react.memo)(() => {
599357
599443
  const ClawSession = (0, import_react.memo)(({ credentials, isActive, onNewMessages, onExit }) => {
599358
599444
  const { stdout } = useStdout();
599359
599445
  const [cols, setCols] = (0, import_react.useState)(stdout?.columns ?? 80);
599446
+ const [rows, setRows] = (0, import_react.useState)(stdout?.rows ?? 24);
599360
599447
  const theme = useTheme();
599361
599448
  const [inputValue, setInputValue] = (0, import_react.useState)("");
599362
599449
  const [ctrlCPending, setCtrlCPending] = (0, import_react.useState)(false);
@@ -599399,13 +599486,14 @@ const ClawSession = (0, import_react.memo)(({ credentials, isActive, onNewMessag
599399
599486
  const handleResize = () => {
599400
599487
  scrollRef.current?.remeasure();
599401
599488
  setCols(stdout?.columns ?? 80);
599489
+ setRows(stdout?.rows ?? 24);
599402
599490
  };
599403
599491
  stdout?.on("resize", handleResize);
599404
599492
  return () => {
599405
599493
  stdout?.off("resize", handleResize);
599406
599494
  };
599407
599495
  }, [stdout]);
599408
- const showSidebar = cols >= 100;
599496
+ const showSidebar = cols >= 100 && rows >= 24;
599409
599497
  const handleSubmit = (0, import_react.useCallback)(async (val) => {
599410
599498
  if (!val.trim() || isSending) return;
599411
599499
  setInputValue("");
@@ -599468,17 +599556,35 @@ const ClawSession = (0, import_react.memo)(({ credentials, isActive, onNewMessag
599468
599556
  dimColor: true,
599469
599557
  children: "No messages yet. Send a message to start a conversation with Claw."
599470
599558
  })
599471
- }) : messages.map((msg) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ErrorBoundary, {
599472
- fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
599559
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: (() => {
599560
+ const startIndex = Math.max(0, messages.length - 100);
599561
+ const visibleMessages = messages.slice(startIndex);
599562
+ const hiddenCount = startIndex;
599563
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [hiddenCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
599473
599564
  paddingX: 2,
599474
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
599475
- color: "red",
599565
+ paddingY: 1,
599566
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
599476
599567
  dimColor: true,
599477
- children: "[failed to render message]"
599568
+ children: [
599569
+ "─── ",
599570
+ hiddenCount,
599571
+ " older message",
599572
+ hiddenCount === 1 ? "" : "s",
599573
+ " not shown ───"
599574
+ ]
599478
599575
  })
599479
- }),
599480
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ClawMessageView, { message: msg })
599481
- }, msg.id))
599576
+ }), visibleMessages.map((msg) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ErrorBoundary, {
599577
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
599578
+ paddingX: 2,
599579
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
599580
+ color: "red",
599581
+ dimColor: true,
599582
+ children: "[failed to render message]"
599583
+ })
599584
+ }),
599585
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ClawMessageView, { message: msg })
599586
+ }, msg.id))] });
599587
+ })() })
599482
599588
  })
599483
599589
  }),
599484
599590
  isWaitingForReply && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
@@ -599975,7 +600081,7 @@ function initSentry() {
599975
600081
  init({
599976
600082
  dsn: "https://1c5033d697e0271ebe53773bff826de0@o117565.ingest.us.sentry.io/4511107776905216",
599977
600083
  tracesSampleRate: 0,
599978
- release: "0.3.2",
600084
+ release: "0.3.4",
599979
600085
  environment: process.env.NODE_ENV ?? "development",
599980
600086
  enabled: false,
599981
600087
  registerEsmLoaderHooks: false,
@@ -599999,7 +600105,7 @@ function isStandaloneBinary() {
599999
600105
  return !path$6.basename(process.execPath, ".exe").startsWith("node");
600000
600106
  }
600001
600107
  function getCurrentVersion() {
600002
- return "0.3.2";
600108
+ return "0.3.4";
600003
600109
  }
600004
600110
  async function fetchLatestVersion() {
600005
600111
  return new Promise((resolve, reject) => {
@@ -600175,7 +600281,7 @@ async function downloadFile(url, dest) {
600175
600281
  }
600176
600282
  //#endregion
600177
600283
  //#region src/cli.tsx
600178
- const VERSION = "0.3.2";
600284
+ const VERSION = "0.3.4";
600179
600285
  async function startInk(command, options) {
600180
600286
  await render(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, {
600181
600287
  command,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/buildercode",
3
- "version": "0.3.2",
4
- "description": "Builder.io Fusion CLI - AI-powered code generation",
3
+ "version": "0.3.4",
4
+ "description": "Builder.io CLI - AI-powered code generation",
5
5
  "license": "MIT",
6
6
  "bin": {
7
7
  "builder": "dist/cli.mjs"