@builder.io/buildercode 0.4.2 → 0.4.3

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 +320 -206
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -92069,7 +92069,27 @@ const defaultDarkTheme = {
92069
92069
  statusBarBackground: "#181818",
92070
92070
  headerBackground: "#181818",
92071
92071
  panelBackground: "#2A2A2A",
92072
- highlightBackground: "#3A3A3A"
92072
+ highlightBackground: "#000000",
92073
+ highlight: "#ffffff"
92074
+ };
92075
+ const defaultTransparentTheme = {
92076
+ background: "",
92077
+ foreground: "",
92078
+ dimForeground: "gray",
92079
+ accent: "cyan",
92080
+ accentForeground: "black",
92081
+ success: "green",
92082
+ error: "red",
92083
+ warning: "yellow",
92084
+ info: "cyan",
92085
+ border: "gray",
92086
+ inputBackground: "",
92087
+ inputBorder: "gray",
92088
+ statusBarBackground: "",
92089
+ headerBackground: "",
92090
+ panelBackground: "",
92091
+ highlightBackground: "#000000",
92092
+ highlight: "#ffffff"
92073
92093
  };
92074
92094
  const defaultLightTheme = {
92075
92095
  background: "#FFFFFF",
@@ -92087,7 +92107,8 @@ const defaultLightTheme = {
92087
92107
  statusBarBackground: "#F6F8FA",
92088
92108
  headerBackground: "#F6F8FA",
92089
92109
  panelBackground: "#F0F2F5",
92090
- highlightBackground: "#D6EBFF"
92110
+ highlightBackground: "#D6EBFF",
92111
+ highlight: "white"
92091
92112
  };
92092
92113
  /**
92093
92114
  * Parse a terminal OSC 11 response into an [R, G, B] tuple (0–255 each).
@@ -92145,8 +92166,57 @@ function queryOsc11() {
92145
92166
  });
92146
92167
  }
92147
92168
  /**
92169
+ * Compute HSL saturation (0–1) from an RGB tuple (0–255 each).
92170
+ * A value near 0 means achromatic (gray/black/white); near 1 means vivid.
92171
+ */
92172
+ function rgbSaturation(r, g, b) {
92173
+ const rn = r / 255, gn = g / 255, bn = b / 255;
92174
+ const max = Math.max(rn, gn, bn);
92175
+ const min = Math.min(rn, gn, bn);
92176
+ const delta = max - min;
92177
+ if (delta === 0) return 0;
92178
+ const lightness = (max + min) / 2;
92179
+ return delta / (1 - Math.abs(2 * lightness - 1));
92180
+ }
92181
+ /**
92182
+ * ANSI color indices (0–15) that represent chromatic colors — i.e. hues that
92183
+ * are neither near-black nor near-white. If COLORFGBG reports one of these
92184
+ * as the background, hard-coded dark/light hex palettes will look wrong and
92185
+ * transparent mode is the safest choice.
92186
+ *
92187
+ * Index mapping (standard xterm-256 ANSI palette):
92188
+ * 0 black 7 light-gray 8 dark-gray 15 white
92189
+ * 1 red 2 green 3 yellow 4 blue
92190
+ * 5 magenta 6 cyan 9 bright-red 10 bright-green
92191
+ * 11 bright-yellow 12 bright-blue 13 bright-magenta 14 bright-cyan
92192
+ */
92193
+ const CHROMATIC_ANSI_INDICES = new Set([
92194
+ 1,
92195
+ 2,
92196
+ 3,
92197
+ 4,
92198
+ 5,
92199
+ 6,
92200
+ 9,
92201
+ 10,
92202
+ 11,
92203
+ 12,
92204
+ 13,
92205
+ 14
92206
+ ]);
92207
+ /**
92148
92208
  * Detect which theme to use.
92149
92209
  *
92210
+ * Priority:
92211
+ * 1. `FUSION_THEME` / `COLOR_THEME` env-var explicit override
92212
+ * 2. OSC 11 actual background color (most accurate)
92213
+ * – high saturation → transparent (vivid/chromatic bg, e.g. blue, green)
92214
+ * – low saturation + dark luminance → dark
92215
+ * – low saturation + light luminance → light
92216
+ * 3. COLORFGBG heuristic (chromatic ANSI index → transparent)
92217
+ * 4. macOS system appearance
92218
+ * 5. Default dark
92219
+ *
92150
92220
  * @param terminalBg RGB tuple from a prior `queryOsc11()` call, or null/undefined.
92151
92221
  * Pass this to get the most accurate result; without it the
92152
92222
  * function falls back to env-var heuristics.
@@ -92155,8 +92225,10 @@ function detectTheme(terminalBg) {
92155
92225
  const explicitTheme = process.env.FUSION_THEME ?? process.env.COLOR_THEME;
92156
92226
  if (explicitTheme === "light") return defaultLightTheme;
92157
92227
  if (explicitTheme === "dark") return defaultDarkTheme;
92228
+ if (explicitTheme === "transparent") return defaultTransparentTheme;
92158
92229
  if (terminalBg != null) {
92159
92230
  const [r, g, b] = terminalBg;
92231
+ if (rgbSaturation(r, g, b) > .35) return defaultTransparentTheme;
92160
92232
  return (.299 * r + .587 * g + .114 * b) / 255 < .5 ? defaultDarkTheme : defaultLightTheme;
92161
92233
  }
92162
92234
  const colorfgbg = process.env.COLORFGBG ?? "";
@@ -92164,7 +92236,10 @@ function detectTheme(terminalBg) {
92164
92236
  const parts = colorfgbg.split(";");
92165
92237
  if (parts.length >= 2) {
92166
92238
  const bg = parseInt(parts[parts.length - 1], 10);
92167
- if (!isNaN(bg) && bg >= 0) return bg > 8 ? defaultLightTheme : defaultDarkTheme;
92239
+ if (!isNaN(bg) && bg >= 0) {
92240
+ if (CHROMATIC_ANSI_INDICES.has(bg)) return defaultTransparentTheme;
92241
+ return bg > 8 ? defaultLightTheme : defaultDarkTheme;
92242
+ }
92168
92243
  }
92169
92244
  }
92170
92245
  if (process.platform === "darwin" && process.env.TERM_PROGRAM !== "vscode") try {
@@ -245108,7 +245183,7 @@ const LIB_CACHE = /* @__PURE__ */ new Map();
245108
245183
  const PENDING_LIB_CACHE = /* @__PURE__ */ new Map();
245109
245184
  const NODE_MODULE_CACHE = /* @__PURE__ */ new Map();
245110
245185
  const TSCONFIG_CACHE = /* @__PURE__ */ new Map();
245111
- const pkgVersion = process.env.OVERRIDE_VERSION ?? "0.4.2";
245186
+ const pkgVersion = process.env.OVERRIDE_VERSION ?? "0.4.3";
245112
245187
  //#endregion
245113
245188
  //#region ../dev-tools/core/detect-frameworks.ts
245114
245189
  async function detectFrameworks$1(sys) {
@@ -499251,8 +499326,47 @@ async function backupGitRepo({ sys, credentials, projectId, branchName, repoPath
499251
499326
  }
499252
499327
  const originalRepoUrl = (folderName ? workspace.folders.find((f) => (f.name ?? f.path) === folderName) : workspace.folders.find((f) => f.enableGit))?.originalRepoUrl ?? repoUrl;
499253
499328
  if (!originalRepoUrl) throw new Error("Original repo URL is required for backup upload");
499329
+ const forced = forcedFullBackup ? "offline-full" : !isConnectedToProvider ? "offline" : void 0;
499254
499330
  const lastCommitHash = await getCurrentCommitHash();
499255
- if (!lastCommitHash) throw new Error("Failed to get current commit hash");
499331
+ if (!lastCommitHash) {
499332
+ let totalCommits = null;
499333
+ try {
499334
+ const out = await git([
499335
+ "rev-list",
499336
+ "--all",
499337
+ "--count"
499338
+ ]);
499339
+ totalCommits = parseInt(out.trim(), 10);
499340
+ } catch {}
499341
+ if (totalCommits === 0) {
499342
+ backupLogger.info("Repository has no commits (empty repo) — nothing to back up");
499343
+ return {
499344
+ success: true,
499345
+ empty: true,
499346
+ lastCommitHash: "",
499347
+ partial: true,
499348
+ repoUrl: originalRepoUrl,
499349
+ backupRef: void 0,
499350
+ backupEntry: {
499351
+ projectId,
499352
+ branchName,
499353
+ size: 0,
499354
+ partial: true,
499355
+ initialBranch: featureBranch,
499356
+ initialCommitHash: void 0,
499357
+ lastCommitHash: "",
499358
+ gitBranchName: aiBranch,
499359
+ empty: true,
499360
+ status: "completed",
499361
+ version: "v2",
499362
+ repoUrl: originalRepoUrl,
499363
+ forced,
499364
+ ...folderName && { folderName }
499365
+ }
499366
+ };
499367
+ }
499368
+ throw new Error(totalCommits === null ? "Failed to get current commit hash (git rev-list failed)" : `Failed to get current commit hash (rev-list --all --count returned ${totalCommits})`);
499369
+ }
499256
499370
  const currentBranch = await getCurrentBranch();
499257
499371
  if (!silenceErrors && currentBranch !== aiBranch) throw new Error(`Current branch "${currentBranch}" is not the ai branch "${aiBranch}"`);
499258
499372
  const initCommitHashResult = await getInitialCommitHash({
@@ -499267,7 +499381,6 @@ async function backupGitRepo({ sys, credentials, projectId, branchName, repoPath
499267
499381
  projectId,
499268
499382
  folderName
499269
499383
  });
499270
- const forced = forcedFullBackup ? "offline-full" : !isConnectedToProvider ? "offline" : void 0;
499271
499384
  const recentRemoteSHAs = await getRecentCommitSHAs(initCommitHashResult.initialBranch, 10);
499272
499385
  const recentLocalSHAs = await getRecentCommitSHAs(aiBranch, 10);
499273
499386
  try {
@@ -534889,7 +535002,7 @@ function useTextInput(options = {}) {
534889
535002
  }
534890
535003
  const code = input.charCodeAt(0);
534891
535004
  if (input.length === 1 && code < 32 && code !== 10) return;
534892
- if (input) {
535005
+ if (input && !key.ctrl && !key.meta) {
534893
535006
  if (inputHistory.historyIndex !== -1) {
534894
535007
  inputHistory.historyIndex = -1;
534895
535008
  inputHistory.historyDraft = "";
@@ -536799,18 +536912,28 @@ const SUBVIEW_CONFIG = {
536799
536912
  description: "Choose reasoning effort level"
536800
536913
  }
536801
536914
  };
536802
- function renderCommandRow({ cmd, isSelected, maxLabelLen }) {
536915
+ function renderCommandRow({ cmd, isSelected, maxLabelLen, theme }) {
536803
536916
  const padded = cmd.label.padEnd(maxLabelLen + 2);
536804
536917
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
536805
536918
  width: "100%",
536806
536919
  paddingX: 1,
536807
536920
  children: isSelected ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
536808
- backgroundColor: "blue",
536809
- color: "white",
536921
+ backgroundColor: theme.highlightBackground,
536922
+ color: theme.highlight,
536810
536923
  children: [
536811
536924
  " ",
536812
- padded,
536813
- cmd.description,
536925
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
536926
+ backgroundColor: theme.highlightBackground,
536927
+ color: theme.highlight,
536928
+ bold: true,
536929
+ children: padded
536930
+ }),
536931
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
536932
+ backgroundColor: theme.highlightBackground,
536933
+ color: theme.highlight,
536934
+ dimColor: true,
536935
+ children: cmd.description
536936
+ }),
536814
536937
  " "
536815
536938
  ]
536816
536939
  }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { children: [
@@ -537024,7 +537147,7 @@ function SlashCommandMenu(t0) {
537024
537147
  const visibleStart = scrollOffset;
537025
537148
  const visibleEnd = Math.min(scrollOffset + MAX_VISIBLE_ITEMS, commands.length);
537026
537149
  let t10;
537027
- if ($[24] !== commands || $[25] !== contextPct || $[26] !== contextTotal || $[27] !== contextUsed || $[28] !== currentReasoning || $[29] !== maxLabelLen || $[30] !== prefs || $[31] !== proxy || $[32] !== selectedIndex || $[33] !== state.model || $[34] !== state.modelOverride || $[35] !== state.sessionMode || $[36] !== theme.background || $[37] !== view || $[38] !== visibleEnd || $[39] !== visibleStart) {
537150
+ if ($[24] !== commands || $[25] !== contextPct || $[26] !== contextTotal || $[27] !== contextUsed || $[28] !== currentReasoning || $[29] !== maxLabelLen || $[30] !== prefs || $[31] !== proxy || $[32] !== selectedIndex || $[33] !== state.model || $[34] !== state.modelOverride || $[35] !== state.sessionMode || $[36] !== theme || $[37] !== view || $[38] !== visibleEnd || $[39] !== visibleStart) {
537028
537151
  const visibleCommands = commands.slice(visibleStart, visibleEnd);
537029
537152
  const itemsAbove = visibleStart;
537030
537153
  const itemsBelow = commands.length - visibleEnd;
@@ -537051,7 +537174,8 @@ function SlashCommandMenu(t0) {
537051
537174
  visibleCommands.map((cmd_0, i_3) => renderCommandRow({
537052
537175
  cmd: cmd_0,
537053
537176
  isSelected: visibleStart + i_3 === selectedIndex,
537054
- maxLabelLen
537177
+ maxLabelLen,
537178
+ theme
537055
537179
  })),
537056
537180
  itemsBelow > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
537057
537181
  paddingX: 2,
@@ -537246,12 +537370,22 @@ function SlashCommandMenu(t0) {
537246
537370
  width: "100%",
537247
537371
  paddingLeft: 2,
537248
537372
  children: absoluteIndex === selectedIndex ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
537249
- backgroundColor: "blue",
537250
- color: "white",
537373
+ backgroundColor: theme.highlightBackground,
537374
+ color: theme.highlight,
537251
537375
  children: [
537252
537376
  " ",
537253
- padded,
537254
- cmd_2.description,
537377
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
537378
+ backgroundColor: theme.highlightBackground,
537379
+ color: theme.highlight,
537380
+ bold: true,
537381
+ children: padded
537382
+ }),
537383
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
537384
+ backgroundColor: theme.highlightBackground,
537385
+ color: theme.highlight,
537386
+ dimColor: true,
537387
+ children: cmd_2.description
537388
+ }),
537255
537389
  " "
537256
537390
  ]
537257
537391
  }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { children: [
@@ -537285,7 +537419,7 @@ function SlashCommandMenu(t0) {
537285
537419
  $[33] = state.model;
537286
537420
  $[34] = state.modelOverride;
537287
537421
  $[35] = state.sessionMode;
537288
- $[36] = theme.background;
537422
+ $[36] = theme;
537289
537423
  $[37] = view;
537290
537424
  $[38] = visibleEnd;
537291
537425
  $[39] = visibleStart;
@@ -537812,16 +537946,16 @@ const InputPrompt = (0, import_react.memo)(({ onSubmit, onChange, onSlashCommand
537812
537946
  onCancel: handleAtCancel
537813
537947
  }),
537814
537948
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
537815
- borderStyle: "bold",
537949
+ borderStyle: theme.panelBackground ? "bold" : "round",
537816
537950
  borderColor: accentColor,
537817
537951
  borderLeft: true,
537818
- borderRight: false,
537819
- borderTop: false,
537820
- borderBottom: false,
537952
+ borderRight: !theme.panelBackground,
537953
+ borderTop: !theme.panelBackground,
537954
+ borderBottom: !theme.panelBackground,
537821
537955
  flexDirection: "column",
537822
537956
  paddingLeft: 2,
537823
537957
  paddingRight: 2,
537824
- paddingY: 1,
537958
+ paddingY: theme.panelBackground ? 1 : 0,
537825
537959
  backgroundColor: theme.panelBackground,
537826
537960
  children: [
537827
537961
  pendingAttachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
@@ -540672,7 +540806,6 @@ const GeneratingProgress = (0, import_react.memo)(() => {
540672
540806
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
540673
540807
  flexDirection: "column",
540674
540808
  marginTop: 2,
540675
- marginBottom: 1,
540676
540809
  children: [
540677
540810
  t1,
540678
540811
  inProgress && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
@@ -541992,7 +542125,7 @@ const FooterSection = (0, import_react.memo)(() => {
541992
542125
  children: [
541993
542126
  "•",
541994
542127
  " Fusion ",
541995
- "0.4.2"
542128
+ "0.4.3"
541996
542129
  ]
541997
542130
  });
541998
542131
  $[10] = t7;
@@ -602933,57 +603066,35 @@ function getToolAriaProps(toolName, input) {
602933
603066
  };
602934
603067
  }
602935
603068
  const MessageBlockView = (0, import_react.memo)((props) => {
602936
- const $ = (0, import_compiler_runtime.c)(58);
603069
+ const $ = (0, import_compiler_runtime.c)(55);
602937
603070
  const message = useSnapshot(props.message);
602938
603071
  const theme = useTheme();
602939
- const [flash, setFlash] = (0, import_react.useState)(false);
602940
- let t0;
602941
- let t1;
602942
- if ($[0] !== props.highlighted) {
602943
- t0 = () => {
602944
- if (props.highlighted) {
602945
- setFlash(true);
602946
- const timer = setTimeout(() => setFlash(false), 1e3);
602947
- return () => clearTimeout(timer);
602948
- }
602949
- setFlash(false);
602950
- };
602951
- t1 = [props.highlighted];
602952
- $[0] = props.highlighted;
602953
- $[1] = t0;
602954
- $[2] = t1;
602955
- } else {
602956
- t0 = $[1];
602957
- t1 = $[2];
602958
- }
602959
- (0, import_react.useEffect)(t0, t1);
602960
- const flashBg = flash ? theme.highlightBackground : void 0;
602961
603072
  let inner;
602962
603073
  bb0: switch (message.type) {
602963
603074
  case "user": {
602964
603075
  if (message.compacting) {
602965
- const t2 = flash ? flashBg : theme.panelBackground;
602966
- let t3;
602967
- let t4;
602968
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
602969
- t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
603076
+ const t0 = props.highlighted ? theme.highlightBackground : theme.panelBackground;
603077
+ let t1;
603078
+ let t2;
603079
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
603080
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
602970
603081
  color: "yellow",
602971
603082
  bold: true,
602972
603083
  children: "Compacting conversation"
602973
603084
  });
602974
- t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
603085
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
602975
603086
  dimColor: true,
602976
603087
  children: "The conversation is too long to keep in the AI memory, auto-summarizing might take up to 1 minute. Conversation can continue shortly."
602977
603088
  });
602978
- $[3] = t3;
602979
- $[4] = t4;
603089
+ $[0] = t1;
603090
+ $[1] = t2;
602980
603091
  } else {
602981
- t3 = $[3];
602982
- t4 = $[4];
603092
+ t1 = $[0];
603093
+ t2 = $[1];
602983
603094
  }
602984
- let t5;
602985
- if ($[5] !== message.id || $[6] !== t2) {
602986
- t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
603095
+ let t3;
603096
+ if ($[2] !== message.id || $[3] !== t0) {
603097
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
602987
603098
  marginBottom: 1,
602988
603099
  paddingLeft: 2,
602989
603100
  paddingRight: 2,
@@ -602994,34 +603105,34 @@ const MessageBlockView = (0, import_react.memo)((props) => {
602994
603105
  borderTop: false,
602995
603106
  borderBottom: false,
602996
603107
  borderColor: "yellow",
602997
- backgroundColor: t2,
603108
+ backgroundColor: t0,
602998
603109
  flexDirection: "column",
602999
603110
  "aria-role": "listitem",
603000
603111
  "aria-label": "Compacting conversation",
603001
- children: [t3, t4]
603112
+ children: [t1, t2]
603002
603113
  }, message.id);
603003
- $[5] = message.id;
603004
- $[6] = t2;
603005
- $[7] = t5;
603006
- } else t5 = $[7];
603007
- inner = t5;
603114
+ $[2] = message.id;
603115
+ $[3] = t0;
603116
+ $[4] = t3;
603117
+ } else t3 = $[4];
603118
+ inner = t3;
603008
603119
  break bb0;
603009
603120
  }
603010
- const t2 = flash ? flashBg : theme.panelBackground;
603011
- const t3 = `User: ${message.displayPrompt ?? ""}`;
603012
- const t4 = message.displayPrompt ?? "";
603013
- let t5;
603014
- if ($[8] !== t4) {
603015
- t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
603121
+ const t0 = props.highlighted ? theme.highlightBackground : theme.panelBackground;
603122
+ const t1 = `User: ${message.displayPrompt ?? ""}`;
603123
+ const t2 = message.displayPrompt ?? "";
603124
+ let t3;
603125
+ if ($[5] !== t2) {
603126
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
603016
603127
  wrap: "wrap",
603017
- children: t4
603128
+ children: t2
603018
603129
  });
603019
- $[8] = t4;
603020
- $[9] = t5;
603021
- } else t5 = $[9];
603022
- let t6;
603023
- if ($[10] !== message.id || $[11] !== t2 || $[12] !== t3 || $[13] !== t5) {
603024
- t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
603130
+ $[5] = t2;
603131
+ $[6] = t3;
603132
+ } else t3 = $[6];
603133
+ let t4;
603134
+ if ($[7] !== message.id || $[8] !== t0 || $[9] !== t1 || $[10] !== t3) {
603135
+ t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
603025
603136
  marginBottom: 1,
603026
603137
  paddingLeft: 2,
603027
603138
  paddingRight: 2,
@@ -603032,160 +603143,164 @@ const MessageBlockView = (0, import_react.memo)((props) => {
603032
603143
  borderTop: false,
603033
603144
  borderBottom: false,
603034
603145
  borderColor: "green",
603035
- backgroundColor: t2,
603146
+ backgroundColor: t0,
603036
603147
  flexDirection: "column",
603037
603148
  "aria-role": "listitem",
603038
- "aria-label": t3,
603039
- children: t5
603149
+ "aria-label": t1,
603150
+ children: t3
603040
603151
  }, message.id);
603041
- $[10] = message.id;
603042
- $[11] = t2;
603043
- $[12] = t3;
603044
- $[13] = t5;
603045
- $[14] = t6;
603046
- } else t6 = $[14];
603047
- inner = t6;
603152
+ $[7] = message.id;
603153
+ $[8] = t0;
603154
+ $[9] = t1;
603155
+ $[10] = t3;
603156
+ $[11] = t4;
603157
+ } else t4 = $[11];
603158
+ inner = t4;
603048
603159
  break bb0;
603049
603160
  }
603050
603161
  case "text": {
603051
- let t2;
603052
- if ($[15] !== message.content || $[16] !== message.id || $[17] !== props.onRender) {
603053
- t2 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompletedTextBlock, {
603162
+ const t0 = props.highlighted ? theme.highlightBackground : void 0;
603163
+ let t1;
603164
+ if ($[12] !== message.content || $[13] !== message.id || $[14] !== props.onRender) {
603165
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompletedTextBlock, {
603054
603166
  text: message.content,
603055
603167
  streaming: false,
603056
603168
  onRender: props.onRender
603057
603169
  }, message.id);
603058
- $[15] = message.content;
603059
- $[16] = message.id;
603060
- $[17] = props.onRender;
603061
- $[18] = t2;
603062
- } else t2 = $[18];
603063
- let t3;
603064
- if ($[19] !== flashBg || $[20] !== t2) {
603065
- t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
603170
+ $[12] = message.content;
603171
+ $[13] = message.id;
603172
+ $[14] = props.onRender;
603173
+ $[15] = t1;
603174
+ } else t1 = $[15];
603175
+ let t2;
603176
+ if ($[16] !== t0 || $[17] !== t1) {
603177
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
603066
603178
  flexDirection: "column",
603067
- backgroundColor: flashBg,
603179
+ backgroundColor: t0,
603068
603180
  "aria-role": "listitem",
603069
- children: t2
603181
+ children: t1
603070
603182
  });
603071
- $[19] = flashBg;
603072
- $[20] = t2;
603073
- $[21] = t3;
603074
- } else t3 = $[21];
603075
- inner = t3;
603183
+ $[16] = t0;
603184
+ $[17] = t1;
603185
+ $[18] = t2;
603186
+ } else t2 = $[18];
603187
+ inner = t2;
603076
603188
  break bb0;
603077
603189
  }
603078
603190
  case "tool": {
603079
603191
  const toolMsg = message;
603080
- const t2 = toolMsg.input;
603081
- let t3;
603082
- if ($[22] !== t2 || $[23] !== toolMsg.toolName) {
603083
- t3 = getToolAriaProps(toolMsg.toolName, t2);
603084
- $[22] = t2;
603085
- $[23] = toolMsg.toolName;
603086
- $[24] = t3;
603087
- } else t3 = $[24];
603088
- const { ariaHidden, ariaLabel } = t3;
603089
- const t4 = ariaHidden || void 0;
603090
- let t5;
603091
- if ($[25] !== message.id || $[26] !== props.onRender || $[27] !== toolMsg) {
603092
- t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolCallCompleted, {
603192
+ const t0 = toolMsg.input;
603193
+ let t1;
603194
+ if ($[19] !== t0 || $[20] !== toolMsg.toolName) {
603195
+ t1 = getToolAriaProps(toolMsg.toolName, t0);
603196
+ $[19] = t0;
603197
+ $[20] = toolMsg.toolName;
603198
+ $[21] = t1;
603199
+ } else t1 = $[21];
603200
+ const { ariaHidden, ariaLabel } = t1;
603201
+ const t2 = props.highlighted ? theme.highlightBackground : void 0;
603202
+ const t3 = ariaHidden || void 0;
603203
+ let t4;
603204
+ if ($[22] !== message.id || $[23] !== props.onRender || $[24] !== toolMsg) {
603205
+ t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolCallCompleted, {
603093
603206
  tool: toolMsg,
603094
603207
  onRender: props.onRender
603095
603208
  }, message.id);
603096
- $[25] = message.id;
603097
- $[26] = props.onRender;
603098
- $[27] = toolMsg;
603099
- $[28] = t5;
603100
- } else t5 = $[28];
603101
- let t6;
603102
- if ($[29] !== ariaLabel || $[30] !== flashBg || $[31] !== t4 || $[32] !== t5) {
603103
- t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
603209
+ $[22] = message.id;
603210
+ $[23] = props.onRender;
603211
+ $[24] = toolMsg;
603212
+ $[25] = t4;
603213
+ } else t4 = $[25];
603214
+ let t5;
603215
+ if ($[26] !== ariaLabel || $[27] !== t2 || $[28] !== t3 || $[29] !== t4) {
603216
+ t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
603104
603217
  flexDirection: "column",
603105
- backgroundColor: flashBg,
603106
- "aria-hidden": t4,
603218
+ backgroundColor: t2,
603219
+ "aria-hidden": t3,
603107
603220
  "aria-label": ariaLabel,
603108
- children: t5
603221
+ children: t4
603109
603222
  });
603110
- $[29] = ariaLabel;
603111
- $[30] = flashBg;
603112
- $[31] = t4;
603113
- $[32] = t5;
603114
- $[33] = t6;
603115
- } else t6 = $[33];
603116
- inner = t6;
603223
+ $[26] = ariaLabel;
603224
+ $[27] = t2;
603225
+ $[28] = t3;
603226
+ $[29] = t4;
603227
+ $[30] = t5;
603228
+ } else t5 = $[30];
603229
+ inner = t5;
603117
603230
  break bb0;
603118
603231
  }
603119
603232
  case "thinking": {
603120
- let t2;
603121
- if ($[34] !== message.content || $[35] !== message.id || $[36] !== message.startedAt || $[37] !== message.streaming || $[38] !== props.onRender) {
603122
- t2 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThinkingBlock, {
603233
+ const t0 = props.highlighted ? theme.highlightBackground : void 0;
603234
+ let t1;
603235
+ if ($[31] !== message.content || $[32] !== message.id || $[33] !== message.startedAt || $[34] !== message.streaming || $[35] !== props.onRender) {
603236
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThinkingBlock, {
603123
603237
  text: message.content,
603124
603238
  streaming: message.streaming,
603125
603239
  startedAt: message.startedAt,
603126
603240
  onRender: props.onRender
603127
603241
  }, message.id);
603128
- $[34] = message.content;
603129
- $[35] = message.id;
603130
- $[36] = message.startedAt;
603131
- $[37] = message.streaming;
603132
- $[38] = props.onRender;
603133
- $[39] = t2;
603134
- } else t2 = $[39];
603135
- let t3;
603136
- if ($[40] !== flashBg || $[41] !== t2) {
603137
- t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
603242
+ $[31] = message.content;
603243
+ $[32] = message.id;
603244
+ $[33] = message.startedAt;
603245
+ $[34] = message.streaming;
603246
+ $[35] = props.onRender;
603247
+ $[36] = t1;
603248
+ } else t1 = $[36];
603249
+ let t2;
603250
+ if ($[37] !== t0 || $[38] !== t1) {
603251
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
603138
603252
  flexDirection: "column",
603139
- backgroundColor: flashBg,
603253
+ backgroundColor: t0,
603140
603254
  "aria-hidden": true,
603141
- children: t2
603255
+ children: t1
603142
603256
  });
603143
- $[40] = flashBg;
603144
- $[41] = t2;
603145
- $[42] = t3;
603146
- } else t3 = $[42];
603147
- inner = t3;
603257
+ $[37] = t0;
603258
+ $[38] = t1;
603259
+ $[39] = t2;
603260
+ } else t2 = $[39];
603261
+ inner = t2;
603148
603262
  break bb0;
603149
603263
  }
603150
603264
  case "idle": {
603151
603265
  const idleMsg = message;
603266
+ let t0;
603267
+ if ($[40] !== idleMsg.durationMs) {
603268
+ t0 = formatDuration(idleMsg.durationMs);
603269
+ $[40] = idleMsg.durationMs;
603270
+ $[41] = t0;
603271
+ } else t0 = $[41];
603272
+ const idleDuration = t0;
603273
+ const idleAriaLabel = idleMsg.state === "error" ? `Failed after ${idleDuration}` : idleMsg.state === "abort" ? `Interrupted after ${idleDuration}` : `Worked for ${idleDuration}`;
603274
+ const t1 = props.highlighted ? theme.highlightBackground : void 0;
603152
603275
  let t2;
603153
- if ($[43] !== idleMsg.durationMs) {
603154
- t2 = formatDuration(idleMsg.durationMs);
603155
- $[43] = idleMsg.durationMs;
603276
+ if ($[42] !== idleMsg || $[43] !== message.id) {
603277
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IdleBlock, { message: idleMsg }, message.id);
603278
+ $[42] = idleMsg;
603279
+ $[43] = message.id;
603156
603280
  $[44] = t2;
603157
603281
  } else t2 = $[44];
603158
- const idleDuration = t2;
603159
- const idleAriaLabel = idleMsg.state === "error" ? `Failed after ${idleDuration}` : idleMsg.state === "abort" ? `Interrupted after ${idleDuration}` : `Worked for ${idleDuration}`;
603160
603282
  let t3;
603161
- if ($[45] !== idleMsg || $[46] !== message.id) {
603162
- t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IdleBlock, { message: idleMsg }, message.id);
603163
- $[45] = idleMsg;
603164
- $[46] = message.id;
603165
- $[47] = t3;
603166
- } else t3 = $[47];
603167
- let t4;
603168
- if ($[48] !== flashBg || $[49] !== idleAriaLabel || $[50] !== t3) {
603169
- t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
603283
+ if ($[45] !== idleAriaLabel || $[46] !== t1 || $[47] !== t2) {
603284
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
603170
603285
  flexDirection: "column",
603171
- backgroundColor: flashBg,
603286
+ backgroundColor: t1,
603172
603287
  "aria-role": "listitem",
603173
603288
  "aria-label": idleAriaLabel,
603174
- children: t3
603289
+ children: t2
603175
603290
  });
603176
- $[48] = flashBg;
603177
- $[49] = idleAriaLabel;
603178
- $[50] = t3;
603179
- $[51] = t4;
603180
- } else t4 = $[51];
603181
- inner = t4;
603291
+ $[45] = idleAriaLabel;
603292
+ $[46] = t1;
603293
+ $[47] = t2;
603294
+ $[48] = t3;
603295
+ } else t3 = $[48];
603296
+ inner = t3;
603182
603297
  break bb0;
603183
603298
  }
603184
603299
  default: throw new Error(`Unknown message type: ${message}`);
603185
603300
  }
603186
- let t2;
603187
- if ($[52] !== flash || $[53] !== theme) {
603188
- t2 = flash && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
603301
+ let t0;
603302
+ if ($[49] !== props.highlighted || $[50] !== theme) {
603303
+ t0 = props.highlighted && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
603189
603304
  position: "absolute",
603190
603305
  top: 0,
603191
603306
  right: 0,
@@ -603201,21 +603316,21 @@ const MessageBlockView = (0, import_react.memo)((props) => {
603201
603316
  children: "✓ Copied"
603202
603317
  })
603203
603318
  });
603204
- $[52] = flash;
603205
- $[53] = theme;
603206
- $[54] = t2;
603207
- } else t2 = $[54];
603208
- let t3;
603209
- if ($[55] !== inner || $[56] !== t2) {
603210
- t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
603319
+ $[49] = props.highlighted;
603320
+ $[50] = theme;
603321
+ $[51] = t0;
603322
+ } else t0 = $[51];
603323
+ let t1;
603324
+ if ($[52] !== inner || $[53] !== t0) {
603325
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
603211
603326
  position: "relative",
603212
- children: [inner, t2]
603327
+ children: [inner, t0]
603213
603328
  });
603214
- $[55] = inner;
603215
- $[56] = t2;
603216
- $[57] = t3;
603217
- } else t3 = $[57];
603218
- return t3;
603329
+ $[52] = inner;
603330
+ $[53] = t0;
603331
+ $[54] = t1;
603332
+ } else t1 = $[54];
603333
+ return t1;
603219
603334
  });
603220
603335
  function CompletedTextBlock(t0) {
603221
603336
  const $ = (0, import_compiler_runtime.c)(8);
@@ -603993,7 +604108,6 @@ const CodeSession = (0, import_react.memo)(({ onExit, isTabActive = true, update
603993
604108
  flexDirection: "column",
603994
604109
  flexGrow: 1,
603995
604110
  paddingRight: 2,
603996
- paddingY: 1,
603997
604111
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
603998
604112
  flexDirection: "column",
603999
604113
  flexGrow: 1,
@@ -605965,7 +606079,7 @@ const TabBar = (0, import_react.memo)((t0) => {
605965
606079
  if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
605966
606080
  t8 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
605967
606081
  dimColor: true,
605968
- children: " · Ctrl+] to cycle"
606082
+ children: " · Ctrl+T to cycle"
605969
606083
  });
605970
606084
  $[11] = t8;
605971
606085
  } else t8 = $[11];
@@ -606084,8 +606198,8 @@ function CodeCommand({ onExit, sys, options, updateCheck }) {
606084
606198
  process.exit(0);
606085
606199
  }, 100);
606086
606200
  }, [exit, onExit]);
606087
- useInput((input, _key) => {
606088
- if (input === "" && clawEnabled === true) {
606201
+ useInput((input, key) => {
606202
+ if (key.ctrl && input === "t" && clawEnabled === true) {
606089
606203
  setClawHasUnread(false);
606090
606204
  setDisplayMode((prev) => prev === "code" ? "claw" : prev === "claw" ? "kanban" : "code");
606091
606205
  }
@@ -606252,7 +606366,7 @@ function isStandaloneBinary() {
606252
606366
  return !path$6.basename(process.execPath, ".exe").startsWith("node");
606253
606367
  }
606254
606368
  function getCurrentVersion() {
606255
- return "0.4.2";
606369
+ return "0.4.3";
606256
606370
  }
606257
606371
  async function fetchLatestVersion() {
606258
606372
  return new Promise((resolve, reject) => {
@@ -606676,7 +606790,7 @@ function initSentry() {
606676
606790
  init({
606677
606791
  dsn: "https://1c5033d697e0271ebe53773bff826de0@o117565.ingest.us.sentry.io/4511107776905216",
606678
606792
  tracesSampleRate: 0,
606679
- release: "0.4.2",
606793
+ release: "0.4.3",
606680
606794
  environment: process.env.NODE_ENV ?? "development",
606681
606795
  enabled: false,
606682
606796
  registerEsmLoaderHooks: false,
@@ -606688,7 +606802,7 @@ function initSentry() {
606688
606802
  }
606689
606803
  //#endregion
606690
606804
  //#region src/cli.tsx
606691
- const VERSION = "0.4.2";
606805
+ const VERSION = "0.4.3";
606692
606806
  async function startInk(command, options) {
606693
606807
  const sys = await createDevToolsNodeSys({
606694
606808
  cwd: process.cwd(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/buildercode",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Builder.io CLI - AI-powered code generation",
5
5
  "license": "MIT",
6
6
  "bin": {