@google/gemini-cli 0.36.0-preview.6 → 0.36.0-preview.8

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 (32) hide show
  1. package/bundle/{chunk-PDW366WH.js → chunk-5JDHTAA3.js} +85 -29
  2. package/bundle/{chunk-U2JBMR75.js → chunk-5Y6Y7SEB.js} +85 -29
  3. package/bundle/{chunk-4P6XQ35T.js → chunk-642LNT3F.js} +7382 -2769
  4. package/bundle/{chunk-5JYGJANN.js → chunk-FWCJAF6L.js} +7382 -2769
  5. package/bundle/{chunk-PXG3YTLU.js → chunk-MYI75E6G.js} +20 -6
  6. package/bundle/{chunk-OE54FCNN.js → chunk-N22U7LIR.js} +103 -18
  7. package/bundle/{chunk-QTNBTOHX.js → chunk-QBLIM2T2.js} +7382 -2769
  8. package/bundle/{chunk-HLML5SVJ.js → chunk-S2IQOR7T.js} +15 -6
  9. package/bundle/{chunk-NBSN2ZY6.js → chunk-UUJ4JLTB.js} +7382 -2769
  10. package/bundle/{chunk-I3Z6XPMI.js → chunk-X6CSYCBW.js} +85 -29
  11. package/bundle/{core-NSYWNIRO.js → core-N4UNRLQA.js} +2 -2
  12. package/bundle/{devtoolsService-3NAUMYXJ.js → devtoolsService-7D3WUF33.js} +3 -3
  13. package/bundle/{devtoolsService-MQCND52T.js → devtoolsService-NA7MR5UO.js} +3 -3
  14. package/bundle/{devtoolsService-2I6GE4QG.js → devtoolsService-VU7N6PSG.js} +3 -3
  15. package/bundle/{devtoolsService-FPXH5TOL.js → devtoolsService-Y53ZUB56.js} +3 -3
  16. package/bundle/{dist-2L2ZZ6UU.js → dist-HD2ZHBHJ.js} +2 -2
  17. package/bundle/{dist-ECE6U2CF.js → dist-JYY2GAAR.js} +2 -2
  18. package/bundle/{dist-JYBWVV27.js → dist-QEB25IFU.js} +2 -2
  19. package/bundle/docs/reference/configuration.md +26 -2
  20. package/bundle/gemini.js +7 -7
  21. package/bundle/{interactiveCli-T2GH3MML.js → interactiveCli-2JRQPNZP.js} +210 -223
  22. package/bundle/{interactiveCli-HNW3RGAN.js → interactiveCli-A6H7VTMC.js} +210 -223
  23. package/bundle/{interactiveCli-NZ7FBLY6.js → interactiveCli-LFO7EWZS.js} +210 -223
  24. package/bundle/{interactiveCli-MKWLBXZL.js → interactiveCli-R5N55BDV.js} +210 -223
  25. package/bundle/{memoryDiscovery-JXHCZBWK.js → memoryDiscovery-BQGYT4OD.js} +1 -1
  26. package/bundle/{memoryDiscovery-VQKOP6YW.js → memoryDiscovery-FCEPFZ3M.js} +1 -1
  27. package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
  28. package/bundle/{oauth2-provider-CD23TXNI.js → oauth2-provider-2WD22PTI.js} +2 -2
  29. package/bundle/{oauth2-provider-Q3ET7DXL.js → oauth2-provider-34BPLPQX.js} +2 -2
  30. package/bundle/{oauth2-provider-TMPMYL3F.js → oauth2-provider-MZAUZWUS.js} +2 -2
  31. package/bundle/{oauth2-provider-3IFRA7CZ.js → oauth2-provider-QOWLZC44.js} +2 -2
  32. package/package.json +1 -1
@@ -55,6 +55,7 @@ import {
55
55
  SettingScope,
56
56
  SettingsContext,
57
57
  Static,
58
+ StyledLine,
58
59
  TOGGLE_TYPES,
59
60
  TOOL_STATUS,
60
61
  TOOL_SUCCESS_RATE_HIGH,
@@ -181,7 +182,7 @@ import {
181
182
  widestLineFromStyledChars,
182
183
  wordBreakStyledChars,
183
184
  wrapStyledChars
184
- } from "./chunk-QTNBTOHX.js";
185
+ } from "./chunk-QBLIM2T2.js";
185
186
  import {
186
187
  ApiKeyUpdatedEvent,
187
188
  AsyncFzf,
@@ -290,10 +291,9 @@ import {
290
291
  validatePlanContent,
291
292
  validatePlanPath,
292
293
  writeToStdout
293
- } from "./chunk-OE54FCNN.js";
294
+ } from "./chunk-N22U7LIR.js";
294
295
  import {
295
296
  ACTIVATE_SKILL_TOOL_NAME,
296
- ASK_USER_TOOL_NAME,
297
297
  ChangeAuthRequestedError,
298
298
  DEFAULT_GEMINI_FLASH_LITE_MODEL,
299
299
  DEFAULT_GEMINI_FLASH_MODEL,
@@ -329,7 +329,7 @@ import {
329
329
  safeJsonToMarkdown,
330
330
  shortenPath,
331
331
  tildeifyPath
332
- } from "./chunk-PXG3YTLU.js";
332
+ } from "./chunk-MYI75E6G.js";
333
333
  import "./chunk-664ZODQF.js";
334
334
  import "./chunk-RJTRUG2J.js";
335
335
  import "./chunk-IUUIT4SU.js";
@@ -19842,13 +19842,13 @@ var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
19842
19842
  var MIN_COLUMN_WIDTH = 5;
19843
19843
  var COLUMN_PADDING = 2;
19844
19844
  var TABLE_MARGIN = 2;
19845
- var parseMarkdownToStyledChars = (text, defaultColor) => {
19845
+ var parseMarkdownToStyledLine = (text, defaultColor) => {
19846
19846
  const ansi = parseMarkdownToANSI(text, defaultColor);
19847
19847
  return toStyledCharacters(ansi);
19848
19848
  };
19849
- var calculateWidths = (styledChars) => {
19850
- const contentWidth = styledCharsWidth(styledChars);
19851
- const words = wordBreakStyledChars(styledChars);
19849
+ var calculateWidths = (styledLine) => {
19850
+ const contentWidth = styledCharsWidth(styledLine);
19851
+ const words = wordBreakStyledChars(styledLine);
19852
19852
  const maxWordWidth = widestLineFromStyledChars(words);
19853
19853
  return { contentWidth, maxWordWidth };
19854
19854
  };
@@ -19859,7 +19859,7 @@ var TableRenderer = ({
19859
19859
  }) => {
19860
19860
  const styledHeaders = (0, import_react7.useMemo)(
19861
19861
  () => headers.map(
19862
- (header) => parseMarkdownToStyledChars(
19862
+ (header) => parseMarkdownToStyledLine(
19863
19863
  stripUnsafeCharacters(header),
19864
19864
  theme.text.link
19865
19865
  )
@@ -19869,7 +19869,7 @@ var TableRenderer = ({
19869
19869
  const styledRows = (0, import_react7.useMemo)(
19870
19870
  () => rows.map(
19871
19871
  (row) => row.map(
19872
- (cell) => parseMarkdownToStyledChars(
19872
+ (cell) => parseMarkdownToStyledLine(
19873
19873
  stripUnsafeCharacters(cell),
19874
19874
  theme.text.primary
19875
19875
  )
@@ -19884,11 +19884,11 @@ var TableRenderer = ({
19884
19884
  );
19885
19885
  const constraints = Array.from({ length: numColumns }).map(
19886
19886
  (_, colIndex) => {
19887
- const headerStyledChars = styledHeaders[colIndex] || [];
19888
- let { contentWidth: maxContentWidth, maxWordWidth } = calculateWidths(headerStyledChars);
19887
+ const headerStyledLine = styledHeaders[colIndex] || StyledLine.empty(0);
19888
+ let { contentWidth: maxContentWidth, maxWordWidth } = calculateWidths(headerStyledLine);
19889
19889
  styledRows.forEach((row) => {
19890
- const cellStyledChars = row[colIndex] || [];
19891
- const { contentWidth: cellWidth, maxWordWidth: cellWordWidth } = calculateWidths(cellStyledChars);
19890
+ const cellStyledLine = row[colIndex] || StyledLine.empty(0);
19891
+ const { contentWidth: cellWidth, maxWordWidth: cellWordWidth } = calculateWidths(cellStyledLine);
19892
19892
  maxContentWidth = Math.max(maxContentWidth, cellWidth);
19893
19893
  maxWordWidth = Math.max(maxWordWidth, cellWordWidth);
19894
19894
  });
@@ -19941,11 +19941,11 @@ var TableRenderer = ({
19941
19941
  const wrapAndProcessRow = (row) => {
19942
19942
  const rowResult = [];
19943
19943
  for (let colIndex = 0; colIndex < numColumns; colIndex++) {
19944
- const cellStyledChars = row[colIndex] || [];
19944
+ const cellStyledLine = row[colIndex] || StyledLine.empty(0);
19945
19945
  const allocatedWidth = finalContentWidths[colIndex];
19946
19946
  const contentWidth = Math.max(1, allocatedWidth);
19947
19947
  const wrappedStyledLines = wrapStyledChars(
19948
- cellStyledChars,
19948
+ cellStyledLine,
19949
19949
  contentWidth
19950
19950
  );
19951
19951
  const maxLineWidth = widestLineFromStyledChars(wrappedStyledLines);
@@ -20948,14 +20948,14 @@ function useMouseContext() {
20948
20948
  return context;
20949
20949
  }
20950
20950
  function useMouse(handler, { isActive = true } = {}) {
20951
- const { subscribe, unsubscribe } = useMouseContext();
20951
+ const { subscribe: subscribe2, unsubscribe } = useMouseContext();
20952
20952
  (0, import_react12.useEffect)(() => {
20953
20953
  if (!isActive) {
20954
20954
  return;
20955
20955
  }
20956
- subscribe(handler);
20956
+ subscribe2(handler);
20957
20957
  return () => unsubscribe(handler);
20958
- }, [isActive, handler, subscribe, unsubscribe]);
20958
+ }, [isActive, handler, subscribe2, unsubscribe]);
20959
20959
  }
20960
20960
  function MouseProvider({
20961
20961
  children,
@@ -20966,7 +20966,7 @@ function MouseProvider({
20966
20966
  const { stdin } = use_stdin_default();
20967
20967
  const subscribers = (0, import_react12.useRef)(/* @__PURE__ */ new Set()).current;
20968
20968
  const lastClickRef = (0, import_react12.useRef)(null);
20969
- const subscribe = (0, import_react12.useCallback)(
20969
+ const subscribe2 = (0, import_react12.useCallback)(
20970
20970
  (handler) => {
20971
20971
  subscribers.add(handler);
20972
20972
  },
@@ -21046,24 +21046,24 @@ function MouseProvider({
21046
21046
  };
21047
21047
  }, [stdin, mouseEventsEnabled, subscribers, debugKeystrokeLogging]);
21048
21048
  const contextValue = (0, import_react12.useMemo)(
21049
- () => ({ subscribe, unsubscribe }),
21050
- [subscribe, unsubscribe]
21049
+ () => ({ subscribe: subscribe2, unsubscribe }),
21050
+ [subscribe2, unsubscribe]
21051
21051
  );
21052
21052
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(MouseContext.Provider, { value: contextValue, children });
21053
21053
  }
21054
21054
 
21055
21055
  // packages/cli/src/ui/hooks/useMouse.ts
21056
21056
  function useMouse2(onMouseEvent, { isActive }) {
21057
- const { subscribe, unsubscribe } = useMouseContext();
21057
+ const { subscribe: subscribe2, unsubscribe } = useMouseContext();
21058
21058
  (0, import_react13.useEffect)(() => {
21059
21059
  if (!isActive) {
21060
21060
  return;
21061
21061
  }
21062
- subscribe(onMouseEvent);
21062
+ subscribe2(onMouseEvent);
21063
21063
  return () => {
21064
21064
  unsubscribe(onMouseEvent);
21065
21065
  };
21066
- }, [isActive, onMouseEvent, subscribe, unsubscribe]);
21066
+ }, [isActive, onMouseEvent, subscribe2, unsubscribe]);
21067
21067
  }
21068
21068
 
21069
21069
  // packages/cli/src/ui/contexts/ScrollProvider.tsx
@@ -24032,7 +24032,7 @@ var ToolGroupMessage = ({
24032
24032
  ) : void 0;
24033
24033
  const contentWidth = terminalWidth - TOOL_MESSAGE_HORIZONTAL_MARGIN;
24034
24034
  const isExplicitClosingSlice = allToolCalls.length === 0;
24035
- if (visibleToolCalls.length === 0 && (!isExplicitClosingSlice || borderBottomOverride !== true)) {
24035
+ if (visibleToolCalls.length === 0 && !isExplicitClosingSlice) {
24036
24036
  return null;
24037
24037
  }
24038
24038
  const content = /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
@@ -24108,7 +24108,7 @@ var ToolGroupMessage = ({
24108
24108
  We have to keep the bottom border separate so it doesn't get
24109
24109
  drawn over by the sticky header directly inside it.
24110
24110
  */
24111
- (visibleToolCalls.length > 0 || borderBottomOverride !== void 0) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
24111
+ (visibleToolCalls.length > 0 || borderBottomOverride !== void 0) && borderBottomOverride !== false && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
24112
24112
  Box_default,
24113
24113
  {
24114
24114
  height: 0,
@@ -24574,7 +24574,7 @@ var Section = ({ title, children }) => /* @__PURE__ */ (0, import_jsx_runtime41.
24574
24574
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { bold: true, color: theme.text.primary, children: title }),
24575
24575
  children
24576
24576
  ] });
24577
- var buildModelRows = (models, config, quotas, useGemini3_1 = false, useCustomToolModel = false) => {
24577
+ var buildModelRows = (models, config, quotas, useGemini3_1 = false, useGemini3_1FlashLite = false, useCustomToolModel = false) => {
24578
24578
  const getBaseModelName = (name) => name.replace("-001", "");
24579
24579
  const usedModelNames = new Set(
24580
24580
  Object.keys(models).map(getBaseModelName).map((name) => getDisplayString(name, config))
@@ -24595,7 +24595,12 @@ var buildModelRows = (models, config, quotas, useGemini3_1 = false, useCustomToo
24595
24595
  };
24596
24596
  });
24597
24597
  const quotaRows = quotas?.buckets?.filter(
24598
- (b) => b.modelId && isActiveModel(b.modelId, useGemini3_1, useCustomToolModel) && !usedModelNames.has(getDisplayString(b.modelId, config))
24598
+ (b) => b.modelId && isActiveModel(
24599
+ b.modelId,
24600
+ useGemini3_1,
24601
+ useGemini3_1FlashLite,
24602
+ useCustomToolModel
24603
+ ) && !usedModelNames.has(getDisplayString(b.modelId, config))
24599
24604
  ).map((bucket) => ({
24600
24605
  key: bucket.modelId,
24601
24606
  modelName: getDisplayString(bucket.modelId, config),
@@ -24619,6 +24624,7 @@ var ModelUsageTable = ({
24619
24624
  pooledLimit,
24620
24625
  pooledResetTime,
24621
24626
  useGemini3_1,
24627
+ useGemini3_1FlashLite,
24622
24628
  useCustomToolModel
24623
24629
  }) => {
24624
24630
  const { stdout } = use_stdout_default();
@@ -24628,6 +24634,7 @@ var ModelUsageTable = ({
24628
24634
  config,
24629
24635
  quotas,
24630
24636
  useGemini3_1,
24637
+ useGemini3_1FlashLite,
24631
24638
  useCustomToolModel
24632
24639
  );
24633
24640
  if (rows.length === 0) {
@@ -24913,6 +24920,7 @@ var StatsDisplay = ({
24913
24920
  const settings = useSettings();
24914
24921
  const config = useConfig();
24915
24922
  const useGemini3_1 = config.getGemini31LaunchedSync?.() ?? false;
24923
+ const useGemini3_1FlashLite = config.getGemini31FlashLiteLaunchedSync?.() ?? false;
24916
24924
  const useCustomToolModel = useGemini3_1 && config.getContentGeneratorConfig().authType === "gemini-api-key" /* USE_GEMINI */;
24917
24925
  const pooledRemaining = quotaStats?.remaining;
24918
24926
  const pooledLimit = quotaStats?.limit;
@@ -25042,6 +25050,7 @@ var StatsDisplay = ({
25042
25050
  pooledLimit,
25043
25051
  pooledResetTime,
25044
25052
  useGemini3_1,
25053
+ useGemini3_1FlashLite,
25045
25054
  useCustomToolModel
25046
25055
  }
25047
25056
  ),
@@ -27738,13 +27747,7 @@ var ChoiceQuestionView = ({
27738
27747
  const overhead = HEADER_HEIGHT2 + TITLE_MARGIN + FOOTER_HEIGHT2;
27739
27748
  const listHeight = availableHeight ? Math.max(1, availableHeight - overhead) : void 0;
27740
27749
  const reservedListHeight = Math.min(selectionItems.length * 2, 6);
27741
- const questionHeightLimit = listHeight && !isAlternateBuffer ? question.unconstrainedHeight ? Math.max(1, listHeight - selectionItems.length * 2) : Math.min(
27742
- 15,
27743
- Math.max(
27744
- 1,
27745
- listHeight - Math.max(DIALOG_PADDING, reservedListHeight)
27746
- )
27747
- ) : void 0;
27750
+ const questionHeightLimit = listHeight && !isAlternateBuffer ? question.unconstrainedHeight ? Math.max(1, listHeight - selectionItems.length * 2) : Math.max(1, listHeight - Math.max(DIALOG_PADDING, reservedListHeight)) : void 0;
27748
27751
  const maxItemsToShow = listHeight && (!isAlternateBuffer || availableHeight !== void 0) ? Math.min(
27749
27752
  selectionItems.length,
27750
27753
  Math.max(
@@ -32947,6 +32950,7 @@ function ModelDialog({ onClose }) {
32947
32950
  const preferredModel = config?.getModel() || DEFAULT_GEMINI_MODEL_AUTO;
32948
32951
  const shouldShowPreviewModels = config?.getHasAccessToPreviewModel();
32949
32952
  const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
32953
+ const useGemini31FlashLite = config?.getGemini31FlashLiteLaunchedSync?.() ?? false;
32950
32954
  const selectedAuthType = settings.merged.security.auth.selectedType;
32951
32955
  const useCustomToolModel = useGemini31 && selectedAuthType === "gemini-api-key" /* USE_GEMINI */;
32952
32956
  const manualModelSelected = (0, import_react65.useMemo)(() => {
@@ -32961,6 +32965,7 @@ function ModelDialog({ onClose }) {
32961
32965
  PREVIEW_GEMINI_MODEL,
32962
32966
  PREVIEW_GEMINI_3_1_MODEL,
32963
32967
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
32968
+ PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
32964
32969
  PREVIEW_GEMINI_FLASH_MODEL
32965
32970
  ];
32966
32971
  if (manualModels.includes(preferredModel)) {
@@ -33037,7 +33042,6 @@ function ModelDialog({ onClose }) {
33037
33042
  return list;
33038
33043
  }, [config, shouldShowPreviewModels, manualModelSelected, useGemini31]);
33039
33044
  const manualOptions = (0, import_react65.useMemo)(() => {
33040
- const isFreeTier = config?.getUserTier() === UserTierId.FREE;
33041
33045
  if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.modelConfigService) {
33042
33046
  const list2 = Object.entries(
33043
33047
  config.modelConfigService.getModelDefinitions?.() ?? {}
@@ -33046,19 +33050,19 @@ function ModelDialog({ onClose }) {
33046
33050
  if (m.isPreview && !shouldShowPreviewModels) return false;
33047
33051
  if (m.tier === "auto") return false;
33048
33052
  if (!hasAccessToProModel && m.tier === "pro") return false;
33049
- if (m.tier === "flash-lite" && m.isPreview && !isFreeTier)
33050
- return false;
33051
33053
  if (id === PREVIEW_GEMINI_3_1_MODEL && !useGemini31) return false;
33052
- if (id === PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL && !useGemini31)
33054
+ if (id === PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL && !useGemini31FlashLite)
33053
33055
  return false;
33054
33056
  return true;
33055
33057
  }).map(([id, m]) => {
33056
33058
  const resolvedId = config.modelConfigService.resolveModelId(id, {
33057
33059
  useGemini3_1: useGemini31,
33060
+ useGemini3_1FlashLite: useGemini31FlashLite,
33058
33061
  useCustomTools: useCustomToolModel
33059
33062
  });
33060
33063
  const titleId = config.modelConfigService.resolveModelId(id, {
33061
- useGemini3_1: useGemini31
33064
+ useGemini3_1: useGemini31,
33065
+ useGemini3_1FlashLite: useGemini31FlashLite
33062
33066
  });
33063
33067
  return {
33064
33068
  value: resolvedId,
@@ -33105,7 +33109,7 @@ function ModelDialog({ onClose }) {
33105
33109
  key: PREVIEW_GEMINI_FLASH_MODEL
33106
33110
  }
33107
33111
  ];
33108
- if (isFreeTier) {
33112
+ if (useGemini31FlashLite) {
33109
33113
  previewOptions.push({
33110
33114
  value: PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
33111
33115
  title: getDisplayString(PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL),
@@ -33121,6 +33125,7 @@ function ModelDialog({ onClose }) {
33121
33125
  }, [
33122
33126
  shouldShowPreviewModels,
33123
33127
  useGemini31,
33128
+ useGemini31FlashLite,
33124
33129
  useCustomToolModel,
33125
33130
  hasAccessToProModel,
33126
33131
  config
@@ -34720,144 +34725,99 @@ var import_react71 = __toESM(require_react(), 1);
34720
34725
 
34721
34726
  // packages/cli/src/ui/hooks/useConsoleMessages.ts
34722
34727
  var import_react70 = __toESM(require_react(), 1);
34723
- function consoleMessagesReducer(state, action) {
34724
- const MAX_CONSOLE_MESSAGES = 1e3;
34725
- switch (action.type) {
34726
- case "ADD_MESSAGES": {
34727
- const newMessages = [...state];
34728
- for (const queuedMessage of action.payload) {
34729
- const lastMessage = newMessages[newMessages.length - 1];
34730
- if (lastMessage && lastMessage.type === queuedMessage.type && lastMessage.content === queuedMessage.content) {
34731
- newMessages[newMessages.length - 1] = {
34732
- ...lastMessage,
34733
- count: lastMessage.count + 1
34734
- };
34735
- } else {
34736
- newMessages.push({ ...queuedMessage, count: 1 });
34737
- }
34738
- }
34739
- if (newMessages.length > MAX_CONSOLE_MESSAGES) {
34740
- return newMessages.slice(newMessages.length - MAX_CONSOLE_MESSAGES);
34741
- }
34742
- return newMessages;
34728
+ var MAX_CONSOLE_MESSAGES = 1e3;
34729
+ var globalConsoleMessages = [];
34730
+ var globalErrorCount = 0;
34731
+ var listeners = /* @__PURE__ */ new Set();
34732
+ var messageQueue = [];
34733
+ var timeoutId = null;
34734
+ function initializeConsoleStore() {
34735
+ if (timeoutId) {
34736
+ clearTimeout(timeoutId);
34737
+ timeoutId = null;
34738
+ }
34739
+ messageQueue = [];
34740
+ globalConsoleMessages = [];
34741
+ globalErrorCount = 0;
34742
+ notifyListeners();
34743
+ coreEvents.off("console-log" /* ConsoleLog */, handleConsoleLog);
34744
+ coreEvents.off("output" /* Output */, handleOutput);
34745
+ coreEvents.on("console-log" /* ConsoleLog */, handleConsoleLog);
34746
+ coreEvents.on("output" /* Output */, handleOutput);
34747
+ }
34748
+ function notifyListeners() {
34749
+ for (const listener of listeners) {
34750
+ listener();
34751
+ }
34752
+ }
34753
+ function processQueue() {
34754
+ if (messageQueue.length === 0) return;
34755
+ const newMessages = [...globalConsoleMessages];
34756
+ for (const queuedMessage of messageQueue) {
34757
+ if (queuedMessage.type === "error") {
34758
+ globalErrorCount++;
34759
+ }
34760
+ const prev = newMessages[newMessages.length - 1];
34761
+ if (prev && prev.type === queuedMessage.type && prev.content === queuedMessage.content) {
34762
+ newMessages[newMessages.length - 1] = {
34763
+ ...prev,
34764
+ count: prev.count + 1
34765
+ };
34766
+ } else {
34767
+ newMessages.push({ ...queuedMessage, count: 1 });
34743
34768
  }
34744
- case "CLEAR":
34745
- return [];
34746
- default:
34747
- return state;
34748
34769
  }
34770
+ globalConsoleMessages = newMessages.length > MAX_CONSOLE_MESSAGES ? newMessages.slice(-MAX_CONSOLE_MESSAGES) : newMessages;
34771
+ messageQueue = [];
34772
+ timeoutId = null;
34773
+ notifyListeners();
34749
34774
  }
34775
+ function handleNewMessage(message) {
34776
+ messageQueue.push(message);
34777
+ if (!timeoutId) {
34778
+ timeoutId = setTimeout(processQueue, 50);
34779
+ }
34780
+ }
34781
+ function subscribe(listener) {
34782
+ listeners.add(listener);
34783
+ return () => {
34784
+ listeners.delete(listener);
34785
+ };
34786
+ }
34787
+ function getConsoleMessagesSnapshot() {
34788
+ return globalConsoleMessages;
34789
+ }
34790
+ function getErrorCountSnapshot() {
34791
+ return globalErrorCount;
34792
+ }
34793
+ var handleConsoleLog = (payload) => {
34794
+ let content = payload.content;
34795
+ const MAX_CONSOLE_MSG_LENGTH = 1e4;
34796
+ if (content.length > MAX_CONSOLE_MSG_LENGTH) {
34797
+ content = content.slice(0, MAX_CONSOLE_MSG_LENGTH) + `... [Truncated ${content.length - MAX_CONSOLE_MSG_LENGTH} characters]`;
34798
+ }
34799
+ handleNewMessage({
34800
+ type: payload.type,
34801
+ content,
34802
+ count: 1
34803
+ });
34804
+ };
34805
+ var handleOutput = (payload) => {
34806
+ let content = typeof payload.chunk === "string" ? payload.chunk : new TextDecoder().decode(payload.chunk);
34807
+ const MAX_OUTPUT_CHUNK_LENGTH = 1e4;
34808
+ if (content.length > MAX_OUTPUT_CHUNK_LENGTH) {
34809
+ content = content.slice(0, MAX_OUTPUT_CHUNK_LENGTH) + `... [Truncated ${content.length - MAX_OUTPUT_CHUNK_LENGTH} characters]`;
34810
+ }
34811
+ handleNewMessage({ type: "log", content, count: 1 });
34812
+ };
34750
34813
  function useConsoleMessages() {
34751
- const [consoleMessages, dispatch] = (0, import_react70.useReducer)(consoleMessagesReducer, []);
34752
- const messageQueueRef = (0, import_react70.useRef)([]);
34753
- const timeoutRef = (0, import_react70.useRef)(null);
34754
- const isProcessingRef = (0, import_react70.useRef)(false);
34755
- const processQueue = (0, import_react70.useCallback)(() => {
34756
- if (messageQueueRef.current.length > 0) {
34757
- isProcessingRef.current = true;
34758
- const messagesToProcess = messageQueueRef.current;
34759
- messageQueueRef.current = [];
34760
- (0, import_react70.startTransition)(() => {
34761
- dispatch({ type: "ADD_MESSAGES", payload: messagesToProcess });
34762
- });
34763
- }
34764
- timeoutRef.current = null;
34765
- }, []);
34766
- const handleNewMessage = (0, import_react70.useCallback)(
34767
- (message) => {
34768
- messageQueueRef.current.push(message);
34769
- if (!isProcessingRef.current && !timeoutRef.current) {
34770
- timeoutRef.current = setTimeout(processQueue, 50);
34771
- }
34772
- },
34773
- [processQueue]
34774
- );
34775
- (0, import_react70.useEffect)(() => {
34776
- isProcessingRef.current = false;
34777
- if (messageQueueRef.current.length > 0 && !timeoutRef.current) {
34778
- timeoutRef.current = setTimeout(processQueue, 50);
34779
- }
34780
- }, [consoleMessages, processQueue]);
34781
- (0, import_react70.useEffect)(() => {
34782
- const handleConsoleLog = (payload) => {
34783
- let content = payload.content;
34784
- const MAX_CONSOLE_MSG_LENGTH = 1e4;
34785
- if (content.length > MAX_CONSOLE_MSG_LENGTH) {
34786
- content = content.slice(0, MAX_CONSOLE_MSG_LENGTH) + `... [Truncated ${content.length - MAX_CONSOLE_MSG_LENGTH} characters]`;
34787
- }
34788
- handleNewMessage({
34789
- type: payload.type,
34790
- content,
34791
- count: 1
34792
- });
34793
- };
34794
- const handleOutput = (payload) => {
34795
- let content = typeof payload.chunk === "string" ? payload.chunk : new TextDecoder().decode(payload.chunk);
34796
- const MAX_OUTPUT_CHUNK_LENGTH = 1e4;
34797
- if (content.length > MAX_OUTPUT_CHUNK_LENGTH) {
34798
- content = content.slice(0, MAX_OUTPUT_CHUNK_LENGTH) + `... [Truncated ${content.length - MAX_OUTPUT_CHUNK_LENGTH} characters]`;
34799
- }
34800
- handleNewMessage({ type: "log", content, count: 1 });
34801
- };
34802
- coreEvents.on("console-log" /* ConsoleLog */, handleConsoleLog);
34803
- coreEvents.on("output" /* Output */, handleOutput);
34804
- return () => {
34805
- coreEvents.off("console-log" /* ConsoleLog */, handleConsoleLog);
34806
- coreEvents.off("output" /* Output */, handleOutput);
34807
- };
34808
- }, [handleNewMessage]);
34809
- const clearConsoleMessages = (0, import_react70.useCallback)(() => {
34810
- if (timeoutRef.current) {
34811
- clearTimeout(timeoutRef.current);
34812
- timeoutRef.current = null;
34813
- }
34814
- messageQueueRef.current = [];
34815
- isProcessingRef.current = true;
34816
- (0, import_react70.startTransition)(() => {
34817
- dispatch({ type: "CLEAR" });
34818
- });
34819
- }, []);
34820
- (0, import_react70.useEffect)(
34821
- () => () => {
34822
- if (timeoutRef.current) {
34823
- clearTimeout(timeoutRef.current);
34824
- }
34825
- },
34826
- []
34827
- );
34828
- return { consoleMessages, clearConsoleMessages };
34814
+ return (0, import_react70.useSyncExternalStore)(subscribe, getConsoleMessagesSnapshot);
34829
34815
  }
34830
34816
  function useErrorCount() {
34831
- const [errorCount, dispatch] = (0, import_react70.useReducer)(
34832
- (state, action) => {
34833
- switch (action) {
34834
- case "INCREMENT":
34835
- return state + 1;
34836
- case "CLEAR":
34837
- return 0;
34838
- default:
34839
- return state;
34840
- }
34841
- },
34842
- 0
34843
- );
34844
- (0, import_react70.useEffect)(() => {
34845
- const handleConsoleLog = (payload) => {
34846
- if (payload.type === "error") {
34847
- (0, import_react70.startTransition)(() => {
34848
- dispatch("INCREMENT");
34849
- });
34850
- }
34851
- };
34852
- coreEvents.on("console-log" /* ConsoleLog */, handleConsoleLog);
34853
- return () => {
34854
- coreEvents.off("console-log" /* ConsoleLog */, handleConsoleLog);
34855
- };
34856
- }, []);
34817
+ const errorCount = (0, import_react70.useSyncExternalStore)(subscribe, getErrorCountSnapshot);
34857
34818
  const clearErrorCount = (0, import_react70.useCallback)(() => {
34858
- (0, import_react70.startTransition)(() => {
34859
- dispatch("CLEAR");
34860
- });
34819
+ globalErrorCount = 0;
34820
+ notifyListeners();
34861
34821
  }, []);
34862
34822
  return { errorCount, clearErrorCount };
34863
34823
  }
@@ -34867,7 +34827,7 @@ var import_jsx_runtime113 = __toESM(require_jsx_runtime(), 1);
34867
34827
  var iconBoxWidth = 3;
34868
34828
  var DetailedMessagesDisplay = ({ maxHeight, width, hasFocus }) => {
34869
34829
  const scrollableListRef = (0, import_react71.useRef)(null);
34870
- const { consoleMessages } = useConsoleMessages();
34830
+ const consoleMessages = useConsoleMessages();
34871
34831
  const config = useConfig();
34872
34832
  const messages = (0, import_react71.useMemo)(() => {
34873
34833
  if (config.getDebugMode()) {
@@ -36960,11 +36920,11 @@ function usePromptCompletion({
36960
36920
  clearGhostText
36961
36921
  ]);
36962
36922
  (0, import_react79.useEffect)(() => {
36963
- const timeoutId = setTimeout(
36923
+ const timeoutId2 = setTimeout(
36964
36924
  handlePromptCompletion,
36965
36925
  PROMPT_COMPLETION_DEBOUNCE_MS
36966
36926
  );
36967
- return () => clearTimeout(timeoutId);
36927
+ return () => clearTimeout(timeoutId2);
36968
36928
  }, [buffer.text, buffer.cursor, handlePromptCompletion]);
36969
36929
  (0, import_react79.useEffect)(() => {
36970
36930
  const currentText = buffer.text.trim();
@@ -38681,20 +38641,20 @@ var InputPrompt = ({
38681
38641
  var import_jsx_runtime119 = __toESM(require_jsx_runtime(), 1);
38682
38642
  var MAX_DISPLAYED_QUEUED_MESSAGES = 3;
38683
38643
  var QueuedMessageDisplay = ({
38684
- messageQueue
38644
+ messageQueue: messageQueue2
38685
38645
  }) => {
38686
- if (messageQueue.length === 0) {
38646
+ if (messageQueue2.length === 0) {
38687
38647
  return null;
38688
38648
  }
38689
38649
  return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
38690
38650
  /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Text, { dimColor: true, children: "Queued (press \u2191 to edit):" }) }),
38691
- messageQueue.slice(0, MAX_DISPLAYED_QUEUED_MESSAGES).map((message, index) => {
38651
+ messageQueue2.slice(0, MAX_DISPLAYED_QUEUED_MESSAGES).map((message, index) => {
38692
38652
  const preview = message.replace(/\s+/g, " ");
38693
38653
  return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Box_default, { paddingLeft: 4, width: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Text, { dimColor: true, wrap: "truncate", children: preview }) }, index);
38694
38654
  }),
38695
- messageQueue.length > MAX_DISPLAYED_QUEUED_MESSAGES && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Box_default, { paddingLeft: 4, children: /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(Text, { dimColor: true, children: [
38655
+ messageQueue2.length > MAX_DISPLAYED_QUEUED_MESSAGES && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Box_default, { paddingLeft: 4, children: /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(Text, { dimColor: true, children: [
38696
38656
  "... (+",
38697
- messageQueue.length - MAX_DISPLAYED_QUEUED_MESSAGES,
38657
+ messageQueue2.length - MAX_DISPLAYED_QUEUED_MESSAGES,
38698
38658
  " more)"
38699
38659
  ] }) })
38700
38660
  ] });
@@ -40404,7 +40364,7 @@ function TerminalProvider({ children }) {
40404
40364
  const { stdout } = use_stdout_default();
40405
40365
  const subscribers = (0, import_react93.useRef)(/* @__PURE__ */ new Set()).current;
40406
40366
  const bufferRef = (0, import_react93.useRef)("");
40407
- const subscribe = (0, import_react93.useCallback)(
40367
+ const subscribe2 = (0, import_react93.useCallback)(
40408
40368
  (handler) => {
40409
40369
  subscribers.add(handler);
40410
40370
  },
@@ -40422,14 +40382,14 @@ function TerminalProvider({ children }) {
40422
40382
  unsubscribe(handler);
40423
40383
  resolve3();
40424
40384
  };
40425
- subscribe(handler);
40385
+ subscribe2(handler);
40426
40386
  TerminalCapabilityManager.queryBackgroundColor(stdout);
40427
40387
  setTimeout(() => {
40428
40388
  unsubscribe(handler);
40429
40389
  resolve3();
40430
40390
  }, 100);
40431
40391
  }),
40432
- [stdout, subscribe, unsubscribe]
40392
+ [stdout, subscribe2, unsubscribe]
40433
40393
  );
40434
40394
  (0, import_react93.useEffect)(() => {
40435
40395
  const handleData = (data) => {
@@ -40459,7 +40419,7 @@ function TerminalProvider({ children }) {
40459
40419
  return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
40460
40420
  TerminalContext.Provider,
40461
40421
  {
40462
- value: { subscribe, unsubscribe, queryTerminalBackground },
40422
+ value: { subscribe: subscribe2, unsubscribe, queryTerminalBackground },
40463
40423
  children
40464
40424
  }
40465
40425
  );
@@ -42514,8 +42474,24 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
42514
42474
  const allPushed = toolCalls.length > 0 && toolCalls.every((tc) => pushedToolCallIds.has(tc.request.callId));
42515
42475
  const anyVisibleInHistory = pushedToolCallIds.size > 0;
42516
42476
  const anyVisibleInPending = remainingTools.some((tc) => {
42517
- const isInProgress = tc.status !== "success" && tc.status !== "error" && tc.status !== "cancelled";
42518
- if (tc.request.name === ASK_USER_TOOL_NAME && isInProgress) {
42477
+ const displayName = tc.tool?.displayName ?? tc.request.name;
42478
+ let hasResultDisplay = false;
42479
+ if (tc.status === "success" /* Success */ || tc.status === "error" /* Error */ || tc.status === "cancelled" /* Cancelled */) {
42480
+ hasResultDisplay = !!tc.response?.resultDisplay;
42481
+ } else if (tc.status === "executing" /* Executing */) {
42482
+ hasResultDisplay = !!tc.liveOutput;
42483
+ }
42484
+ if (shouldHideToolCall({
42485
+ displayName,
42486
+ status: tc.status,
42487
+ approvalMode: tc.approvalMode,
42488
+ hasResultDisplay,
42489
+ parentCallId: tc.request.parentCallId
42490
+ })) {
42491
+ return false;
42492
+ }
42493
+ const displayStatus = mapCoreStatusToDisplayStatus(tc.status);
42494
+ if (displayStatus === "Confirming" /* Confirming */) {
42519
42495
  return false;
42520
42496
  }
42521
42497
  return true;
@@ -45476,14 +45452,14 @@ var TimeoutError = class extends Error {
45476
45452
  // node_modules/ky/distribution/utils/timeout.js
45477
45453
  async function timeout(request, init, abortController, options) {
45478
45454
  return new Promise((resolve3, reject) => {
45479
- const timeoutId = setTimeout(() => {
45455
+ const timeoutId2 = setTimeout(() => {
45480
45456
  if (abortController) {
45481
45457
  abortController.abort();
45482
45458
  }
45483
45459
  reject(new TimeoutError(request));
45484
45460
  }, options.timeout);
45485
45461
  void options.fetch(request, init).then(resolve3).catch(reject).then(() => {
45486
- clearTimeout(timeoutId);
45462
+ clearTimeout(timeoutId2);
45487
45463
  });
45488
45464
  });
45489
45465
  }
@@ -45496,10 +45472,10 @@ async function delay(ms, { signal }) {
45496
45472
  signal.addEventListener("abort", abortHandler, { once: true });
45497
45473
  }
45498
45474
  function abortHandler() {
45499
- clearTimeout(timeoutId);
45475
+ clearTimeout(timeoutId2);
45500
45476
  reject(signal.reason);
45501
45477
  }
45502
- const timeoutId = setTimeout(() => {
45478
+ const timeoutId2 = setTimeout(() => {
45503
45479
  signal?.removeEventListener("abort", abortHandler);
45504
45480
  resolve3();
45505
45481
  }, ms);
@@ -46009,7 +45985,7 @@ function useMessageQueue({
46009
45985
  submitQuery,
46010
45986
  isMcpReady
46011
45987
  }) {
46012
- const [messageQueue, setMessageQueue] = (0, import_react109.useState)([]);
45988
+ const [messageQueue2, setMessageQueue] = (0, import_react109.useState)([]);
46013
45989
  const addMessage = (0, import_react109.useCallback)((message) => {
46014
45990
  const trimmedMessage = message.trim();
46015
45991
  if (trimmedMessage.length > 0) {
@@ -46020,20 +45996,20 @@ function useMessageQueue({
46020
45996
  setMessageQueue([]);
46021
45997
  }, []);
46022
45998
  const getQueuedMessagesText = (0, import_react109.useCallback)(() => {
46023
- if (messageQueue.length === 0) return "";
46024
- return messageQueue.join("\n\n");
46025
- }, [messageQueue]);
45999
+ if (messageQueue2.length === 0) return "";
46000
+ return messageQueue2.join("\n\n");
46001
+ }, [messageQueue2]);
46026
46002
  const popAllMessages = (0, import_react109.useCallback)(() => {
46027
- if (messageQueue.length === 0) {
46003
+ if (messageQueue2.length === 0) {
46028
46004
  return void 0;
46029
46005
  }
46030
- const allMessages = messageQueue.join("\n\n");
46006
+ const allMessages = messageQueue2.join("\n\n");
46031
46007
  setMessageQueue([]);
46032
46008
  return allMessages;
46033
- }, [messageQueue]);
46009
+ }, [messageQueue2]);
46034
46010
  (0, import_react109.useEffect)(() => {
46035
- if (isConfigInitialized && streamingState === "idle" /* Idle */ && isMcpReady && messageQueue.length > 0) {
46036
- const combinedMessage = messageQueue.join("\n\n");
46011
+ if (isConfigInitialized && streamingState === "idle" /* Idle */ && isMcpReady && messageQueue2.length > 0) {
46012
+ const combinedMessage = messageQueue2.join("\n\n");
46037
46013
  setMessageQueue([]);
46038
46014
  submitQuery(combinedMessage);
46039
46015
  }
@@ -46041,11 +46017,11 @@ function useMessageQueue({
46041
46017
  isConfigInitialized,
46042
46018
  streamingState,
46043
46019
  isMcpReady,
46044
- messageQueue,
46020
+ messageQueue2,
46045
46021
  submitQuery
46046
46022
  ]);
46047
46023
  return {
46048
- messageQueue,
46024
+ messageQueue: messageQueue2,
46049
46025
  addMessage,
46050
46026
  clearQueue,
46051
46027
  getQueuedMessagesText,
@@ -46518,11 +46494,11 @@ var useHookDisplayState = () => {
46518
46494
  });
46519
46495
  };
46520
46496
  if (remaining > 0) {
46521
- const timeoutId = setTimeout(() => {
46497
+ const timeoutId2 = setTimeout(() => {
46522
46498
  removeHook();
46523
- activeTimeouts.delete(timeoutId);
46499
+ activeTimeouts.delete(timeoutId2);
46524
46500
  }, remaining);
46525
- activeTimeouts.add(timeoutId);
46501
+ activeTimeouts.add(timeoutId2);
46526
46502
  } else {
46527
46503
  removeHook();
46528
46504
  }
@@ -46639,7 +46615,7 @@ var LoginWithGoogleRestartDialog = ({
46639
46615
  var import_react118 = __toESM(require_react(), 1);
46640
46616
  function useTerminalTheme(handleThemeSelect, config, refreshStatic) {
46641
46617
  const settings = useSettings();
46642
- const { subscribe, unsubscribe, queryTerminalBackground } = useTerminalContext();
46618
+ const { subscribe: subscribe2, unsubscribe, queryTerminalBackground } = useTerminalContext();
46643
46619
  (0, import_react118.useEffect)(() => {
46644
46620
  if (settings.merged.ui.autoThemeSwitching === false) {
46645
46621
  return;
@@ -46684,7 +46660,7 @@ function useTerminalTheme(handleThemeSelect, config, refreshStatic) {
46684
46660
  refreshStatic();
46685
46661
  }
46686
46662
  };
46687
- subscribe(handleTerminalBackground);
46663
+ subscribe2(handleTerminalBackground);
46688
46664
  return () => {
46689
46665
  clearInterval(pollIntervalId);
46690
46666
  unsubscribe(handleTerminalBackground);
@@ -46695,7 +46671,7 @@ function useTerminalTheme(handleThemeSelect, config, refreshStatic) {
46695
46671
  settings.merged.ui.terminalBackgroundPollingInterval,
46696
46672
  config,
46697
46673
  handleThemeSelect,
46698
- subscribe,
46674
+ subscribe2,
46699
46675
  unsubscribe,
46700
46676
  queryTerminalBackground,
46701
46677
  refreshStatic
@@ -47318,7 +47294,6 @@ var AppContainer = (props) => {
47318
47294
  const app = use_app_default();
47319
47295
  const { stats: sessionStats } = useSessionStats();
47320
47296
  const branchName = useGitBranchName(config.getTargetDir());
47321
- const mainControlsRef = (0, import_react124.useRef)(null);
47322
47297
  const rootUiRef = (0, import_react124.useRef)(null);
47323
47298
  const lastTitleRef = (0, import_react124.useRef)(null);
47324
47299
  const staticExtraHeight = 3;
@@ -47968,7 +47943,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
47968
47943
  );
47969
47944
  const { isMcpReady } = useMcpStatus(config);
47970
47945
  const {
47971
- messageQueue,
47946
+ messageQueue: messageQueue2,
47972
47947
  addMessage,
47973
47948
  clearQueue,
47974
47949
  getQueuedMessagesText,
@@ -48078,7 +48053,7 @@ ${queuedText}` : queuedText;
48078
48053
  }
48079
48054
  void submitQuery(submittedValue);
48080
48055
  } else {
48081
- if (isIdle && !isMcpOrConfigReady && messageQueue.length === 0) {
48056
+ if (isIdle && !isMcpOrConfigReady && messageQueue2.length === 0) {
48082
48057
  coreEvents.emitFeedback(
48083
48058
  "info",
48084
48059
  !isConfigInitialized ? "Initializing... Prompts will be queued." : "Waiting for MCP servers to initialize... Slash commands are still available and prompts will be queued."
@@ -48096,7 +48071,7 @@ ${queuedText}` : queuedText;
48096
48071
  slashCommands,
48097
48072
  isMcpReady,
48098
48073
  streamingState,
48099
- messageQueue.length,
48074
+ messageQueue2.length,
48100
48075
  pendingHistoryItems,
48101
48076
  config,
48102
48077
  constrainHeight,
@@ -48124,16 +48099,27 @@ ${queuedText}` : queuedText;
48124
48099
  ]);
48125
48100
  const { handleInput: vimHandleInput } = useVim(buffer, handleFinalSubmit);
48126
48101
  const isInputActive = !initError && !isProcessing && !isResuming && (streamingState === "idle" /* Idle */ || streamingState === "responding" /* Responding */ || streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */) && !proQuotaRequest;
48102
+ const observerRef = (0, import_react124.useRef)(null);
48127
48103
  const [controlsHeight, setControlsHeight] = (0, import_react124.useState)(0);
48128
- (0, import_react124.useLayoutEffect)(() => {
48129
- if (mainControlsRef.current) {
48130
- const fullFooterMeasurement = measure_element_default(mainControlsRef.current);
48131
- const roundedHeight = Math.round(fullFooterMeasurement.height);
48132
- if (roundedHeight > 0 && roundedHeight !== controlsHeight) {
48133
- setControlsHeight(roundedHeight);
48134
- }
48104
+ const mainControlsRef = (0, import_react124.useCallback)((node) => {
48105
+ if (observerRef.current) {
48106
+ observerRef.current.disconnect();
48107
+ observerRef.current = null;
48108
+ }
48109
+ if (node) {
48110
+ const observer = new ResizeObserver((entries) => {
48111
+ const entry = entries[0];
48112
+ if (entry) {
48113
+ const roundedHeight = Math.round(entry.contentRect.height);
48114
+ setControlsHeight(
48115
+ (prev) => roundedHeight !== prev ? roundedHeight : prev
48116
+ );
48117
+ }
48118
+ });
48119
+ observer.observe(node);
48120
+ observerRef.current = observer;
48135
48121
  }
48136
- }, [buffer, terminalWidth, terminalHeight, controlsHeight, isInputActive]);
48122
+ }, []);
48137
48123
  const availableTerminalHeight = Math.max(
48138
48124
  0,
48139
48125
  terminalHeight - controlsHeight - backgroundShellHeight - 1
@@ -48366,7 +48352,7 @@ ${queuedText}` : queuedText;
48366
48352
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
48367
48353
  if (settings.merged.general.devtools) {
48368
48354
  void (async () => {
48369
- const { toggleDevToolsPanel } = await import("./devtoolsService-3NAUMYXJ.js");
48355
+ const { toggleDevToolsPanel } = await import("./devtoolsService-7D3WUF33.js");
48370
48356
  await toggleDevToolsPanel(
48371
48357
  config,
48372
48358
  showErrorDetails,
@@ -48762,7 +48748,7 @@ ${queuedText}` : queuedText;
48762
48748
  currentWittyPhrase,
48763
48749
  historyRemountKey,
48764
48750
  activeHooks,
48765
- messageQueue,
48751
+ messageQueue: messageQueue2,
48766
48752
  queueErrorMessage,
48767
48753
  showApprovalModeIndicator,
48768
48754
  allowPlanMode,
@@ -48885,7 +48871,7 @@ ${queuedText}` : queuedText;
48885
48871
  currentWittyPhrase,
48886
48872
  historyRemountKey,
48887
48873
  activeHooks,
48888
- messageQueue,
48874
+ messageQueue2,
48889
48875
  queueErrorMessage,
48890
48876
  showApprovalModeIndicator,
48891
48877
  allowPlanMode,
@@ -49126,6 +49112,7 @@ ${queuedText}` : queuedText;
49126
49112
  var import_jsx_runtime137 = __toESM(require_jsx_runtime(), 1);
49127
49113
  var SLOW_RENDER_MS = 200;
49128
49114
  async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
49115
+ initializeConsoleStore();
49129
49116
  const useAlternateBuffer2 = shouldEnterAlternateScreen(
49130
49117
  isAlternateBufferEnabled(config),
49131
49118
  config.getScreenReader()