@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-4P6XQ35T.js";
185
+ } from "./chunk-UUJ4JLTB.js";
185
186
  import {
186
187
  ApiKeyUpdatedEvent,
187
188
  AsyncFzf,
@@ -300,10 +301,9 @@ import {
300
301
  validatePlanContent,
301
302
  validatePlanPath,
302
303
  writeToStdout
303
- } from "./chunk-U2JBMR75.js";
304
+ } from "./chunk-5JDHTAA3.js";
304
305
  import {
305
306
  ACTIVATE_SKILL_TOOL_NAME,
306
- ASK_USER_TOOL_NAME,
307
307
  ApprovalMode,
308
308
  ChangeAuthRequestedError,
309
309
  CoreEvent,
@@ -346,7 +346,7 @@ import {
346
346
  safeJsonToMarkdown,
347
347
  shortenPath,
348
348
  tildeifyPath
349
- } from "./chunk-HLML5SVJ.js";
349
+ } from "./chunk-S2IQOR7T.js";
350
350
  import "./chunk-664ZODQF.js";
351
351
  import "./chunk-RJTRUG2J.js";
352
352
  import "./chunk-IUUIT4SU.js";
@@ -19859,13 +19859,13 @@ var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
19859
19859
  var MIN_COLUMN_WIDTH = 5;
19860
19860
  var COLUMN_PADDING = 2;
19861
19861
  var TABLE_MARGIN = 2;
19862
- var parseMarkdownToStyledChars = (text, defaultColor) => {
19862
+ var parseMarkdownToStyledLine = (text, defaultColor) => {
19863
19863
  const ansi = parseMarkdownToANSI(text, defaultColor);
19864
19864
  return toStyledCharacters(ansi);
19865
19865
  };
19866
- var calculateWidths = (styledChars) => {
19867
- const contentWidth = styledCharsWidth(styledChars);
19868
- const words = wordBreakStyledChars(styledChars);
19866
+ var calculateWidths = (styledLine) => {
19867
+ const contentWidth = styledCharsWidth(styledLine);
19868
+ const words = wordBreakStyledChars(styledLine);
19869
19869
  const maxWordWidth = widestLineFromStyledChars(words);
19870
19870
  return { contentWidth, maxWordWidth };
19871
19871
  };
@@ -19876,7 +19876,7 @@ var TableRenderer = ({
19876
19876
  }) => {
19877
19877
  const styledHeaders = (0, import_react7.useMemo)(
19878
19878
  () => headers.map(
19879
- (header) => parseMarkdownToStyledChars(
19879
+ (header) => parseMarkdownToStyledLine(
19880
19880
  stripUnsafeCharacters(header),
19881
19881
  theme.text.link
19882
19882
  )
@@ -19886,7 +19886,7 @@ var TableRenderer = ({
19886
19886
  const styledRows = (0, import_react7.useMemo)(
19887
19887
  () => rows.map(
19888
19888
  (row) => row.map(
19889
- (cell) => parseMarkdownToStyledChars(
19889
+ (cell) => parseMarkdownToStyledLine(
19890
19890
  stripUnsafeCharacters(cell),
19891
19891
  theme.text.primary
19892
19892
  )
@@ -19901,11 +19901,11 @@ var TableRenderer = ({
19901
19901
  );
19902
19902
  const constraints = Array.from({ length: numColumns }).map(
19903
19903
  (_, colIndex) => {
19904
- const headerStyledChars = styledHeaders[colIndex] || [];
19905
- let { contentWidth: maxContentWidth, maxWordWidth } = calculateWidths(headerStyledChars);
19904
+ const headerStyledLine = styledHeaders[colIndex] || StyledLine.empty(0);
19905
+ let { contentWidth: maxContentWidth, maxWordWidth } = calculateWidths(headerStyledLine);
19906
19906
  styledRows.forEach((row) => {
19907
- const cellStyledChars = row[colIndex] || [];
19908
- const { contentWidth: cellWidth, maxWordWidth: cellWordWidth } = calculateWidths(cellStyledChars);
19907
+ const cellStyledLine = row[colIndex] || StyledLine.empty(0);
19908
+ const { contentWidth: cellWidth, maxWordWidth: cellWordWidth } = calculateWidths(cellStyledLine);
19909
19909
  maxContentWidth = Math.max(maxContentWidth, cellWidth);
19910
19910
  maxWordWidth = Math.max(maxWordWidth, cellWordWidth);
19911
19911
  });
@@ -19958,11 +19958,11 @@ var TableRenderer = ({
19958
19958
  const wrapAndProcessRow = (row) => {
19959
19959
  const rowResult = [];
19960
19960
  for (let colIndex = 0; colIndex < numColumns; colIndex++) {
19961
- const cellStyledChars = row[colIndex] || [];
19961
+ const cellStyledLine = row[colIndex] || StyledLine.empty(0);
19962
19962
  const allocatedWidth = finalContentWidths[colIndex];
19963
19963
  const contentWidth = Math.max(1, allocatedWidth);
19964
19964
  const wrappedStyledLines = wrapStyledChars(
19965
- cellStyledChars,
19965
+ cellStyledLine,
19966
19966
  contentWidth
19967
19967
  );
19968
19968
  const maxLineWidth = widestLineFromStyledChars(wrappedStyledLines);
@@ -20965,14 +20965,14 @@ function useMouseContext() {
20965
20965
  return context;
20966
20966
  }
20967
20967
  function useMouse(handler, { isActive = true } = {}) {
20968
- const { subscribe, unsubscribe } = useMouseContext();
20968
+ const { subscribe: subscribe2, unsubscribe } = useMouseContext();
20969
20969
  (0, import_react12.useEffect)(() => {
20970
20970
  if (!isActive) {
20971
20971
  return;
20972
20972
  }
20973
- subscribe(handler);
20973
+ subscribe2(handler);
20974
20974
  return () => unsubscribe(handler);
20975
- }, [isActive, handler, subscribe, unsubscribe]);
20975
+ }, [isActive, handler, subscribe2, unsubscribe]);
20976
20976
  }
20977
20977
  function MouseProvider({
20978
20978
  children,
@@ -20983,7 +20983,7 @@ function MouseProvider({
20983
20983
  const { stdin } = use_stdin_default();
20984
20984
  const subscribers = (0, import_react12.useRef)(/* @__PURE__ */ new Set()).current;
20985
20985
  const lastClickRef = (0, import_react12.useRef)(null);
20986
- const subscribe = (0, import_react12.useCallback)(
20986
+ const subscribe2 = (0, import_react12.useCallback)(
20987
20987
  (handler) => {
20988
20988
  subscribers.add(handler);
20989
20989
  },
@@ -21063,24 +21063,24 @@ function MouseProvider({
21063
21063
  };
21064
21064
  }, [stdin, mouseEventsEnabled, subscribers, debugKeystrokeLogging]);
21065
21065
  const contextValue = (0, import_react12.useMemo)(
21066
- () => ({ subscribe, unsubscribe }),
21067
- [subscribe, unsubscribe]
21066
+ () => ({ subscribe: subscribe2, unsubscribe }),
21067
+ [subscribe2, unsubscribe]
21068
21068
  );
21069
21069
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(MouseContext.Provider, { value: contextValue, children });
21070
21070
  }
21071
21071
 
21072
21072
  // packages/cli/src/ui/hooks/useMouse.ts
21073
21073
  function useMouse2(onMouseEvent, { isActive }) {
21074
- const { subscribe, unsubscribe } = useMouseContext();
21074
+ const { subscribe: subscribe2, unsubscribe } = useMouseContext();
21075
21075
  (0, import_react13.useEffect)(() => {
21076
21076
  if (!isActive) {
21077
21077
  return;
21078
21078
  }
21079
- subscribe(onMouseEvent);
21079
+ subscribe2(onMouseEvent);
21080
21080
  return () => {
21081
21081
  unsubscribe(onMouseEvent);
21082
21082
  };
21083
- }, [isActive, onMouseEvent, subscribe, unsubscribe]);
21083
+ }, [isActive, onMouseEvent, subscribe2, unsubscribe]);
21084
21084
  }
21085
21085
 
21086
21086
  // packages/cli/src/ui/contexts/ScrollProvider.tsx
@@ -24049,7 +24049,7 @@ var ToolGroupMessage = ({
24049
24049
  ) : void 0;
24050
24050
  const contentWidth = terminalWidth - TOOL_MESSAGE_HORIZONTAL_MARGIN;
24051
24051
  const isExplicitClosingSlice = allToolCalls.length === 0;
24052
- if (visibleToolCalls.length === 0 && (!isExplicitClosingSlice || borderBottomOverride !== true)) {
24052
+ if (visibleToolCalls.length === 0 && !isExplicitClosingSlice) {
24053
24053
  return null;
24054
24054
  }
24055
24055
  const content = /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
@@ -24125,7 +24125,7 @@ var ToolGroupMessage = ({
24125
24125
  We have to keep the bottom border separate so it doesn't get
24126
24126
  drawn over by the sticky header directly inside it.
24127
24127
  */
24128
- (visibleToolCalls.length > 0 || borderBottomOverride !== void 0) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
24128
+ (visibleToolCalls.length > 0 || borderBottomOverride !== void 0) && borderBottomOverride !== false && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
24129
24129
  Box_default,
24130
24130
  {
24131
24131
  height: 0,
@@ -24591,7 +24591,7 @@ var Section = ({ title, children }) => /* @__PURE__ */ (0, import_jsx_runtime41.
24591
24591
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { bold: true, color: theme.text.primary, children: title }),
24592
24592
  children
24593
24593
  ] });
24594
- var buildModelRows = (models, config, quotas, useGemini3_1 = false, useCustomToolModel = false) => {
24594
+ var buildModelRows = (models, config, quotas, useGemini3_1 = false, useGemini3_1FlashLite = false, useCustomToolModel = false) => {
24595
24595
  const getBaseModelName = (name) => name.replace("-001", "");
24596
24596
  const usedModelNames = new Set(
24597
24597
  Object.keys(models).map(getBaseModelName).map((name) => getDisplayString(name, config))
@@ -24612,7 +24612,12 @@ var buildModelRows = (models, config, quotas, useGemini3_1 = false, useCustomToo
24612
24612
  };
24613
24613
  });
24614
24614
  const quotaRows = quotas?.buckets?.filter(
24615
- (b) => b.modelId && isActiveModel(b.modelId, useGemini3_1, useCustomToolModel) && !usedModelNames.has(getDisplayString(b.modelId, config))
24615
+ (b) => b.modelId && isActiveModel(
24616
+ b.modelId,
24617
+ useGemini3_1,
24618
+ useGemini3_1FlashLite,
24619
+ useCustomToolModel
24620
+ ) && !usedModelNames.has(getDisplayString(b.modelId, config))
24616
24621
  ).map((bucket) => ({
24617
24622
  key: bucket.modelId,
24618
24623
  modelName: getDisplayString(bucket.modelId, config),
@@ -24636,6 +24641,7 @@ var ModelUsageTable = ({
24636
24641
  pooledLimit,
24637
24642
  pooledResetTime,
24638
24643
  useGemini3_1,
24644
+ useGemini3_1FlashLite,
24639
24645
  useCustomToolModel
24640
24646
  }) => {
24641
24647
  const { stdout } = use_stdout_default();
@@ -24645,6 +24651,7 @@ var ModelUsageTable = ({
24645
24651
  config,
24646
24652
  quotas,
24647
24653
  useGemini3_1,
24654
+ useGemini3_1FlashLite,
24648
24655
  useCustomToolModel
24649
24656
  );
24650
24657
  if (rows.length === 0) {
@@ -24930,6 +24937,7 @@ var StatsDisplay = ({
24930
24937
  const settings = useSettings();
24931
24938
  const config = useConfig();
24932
24939
  const useGemini3_1 = config.getGemini31LaunchedSync?.() ?? false;
24940
+ const useGemini3_1FlashLite = config.getGemini31FlashLiteLaunchedSync?.() ?? false;
24933
24941
  const useCustomToolModel = useGemini3_1 && config.getContentGeneratorConfig().authType === AuthType.USE_GEMINI;
24934
24942
  const pooledRemaining = quotaStats?.remaining;
24935
24943
  const pooledLimit = quotaStats?.limit;
@@ -25059,6 +25067,7 @@ var StatsDisplay = ({
25059
25067
  pooledLimit,
25060
25068
  pooledResetTime,
25061
25069
  useGemini3_1,
25070
+ useGemini3_1FlashLite,
25062
25071
  useCustomToolModel
25063
25072
  }
25064
25073
  ),
@@ -27755,13 +27764,7 @@ var ChoiceQuestionView = ({
27755
27764
  const overhead = HEADER_HEIGHT2 + TITLE_MARGIN + FOOTER_HEIGHT2;
27756
27765
  const listHeight = availableHeight ? Math.max(1, availableHeight - overhead) : void 0;
27757
27766
  const reservedListHeight = Math.min(selectionItems.length * 2, 6);
27758
- const questionHeightLimit = listHeight && !isAlternateBuffer ? question.unconstrainedHeight ? Math.max(1, listHeight - selectionItems.length * 2) : Math.min(
27759
- 15,
27760
- Math.max(
27761
- 1,
27762
- listHeight - Math.max(DIALOG_PADDING, reservedListHeight)
27763
- )
27764
- ) : void 0;
27767
+ const questionHeightLimit = listHeight && !isAlternateBuffer ? question.unconstrainedHeight ? Math.max(1, listHeight - selectionItems.length * 2) : Math.max(1, listHeight - Math.max(DIALOG_PADDING, reservedListHeight)) : void 0;
27765
27768
  const maxItemsToShow = listHeight && (!isAlternateBuffer || availableHeight !== void 0) ? Math.min(
27766
27769
  selectionItems.length,
27767
27770
  Math.max(
@@ -32964,6 +32967,7 @@ function ModelDialog({ onClose }) {
32964
32967
  const preferredModel = config?.getModel() || DEFAULT_GEMINI_MODEL_AUTO;
32965
32968
  const shouldShowPreviewModels = config?.getHasAccessToPreviewModel();
32966
32969
  const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
32970
+ const useGemini31FlashLite = config?.getGemini31FlashLiteLaunchedSync?.() ?? false;
32967
32971
  const selectedAuthType = settings.merged.security.auth.selectedType;
32968
32972
  const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
32969
32973
  const manualModelSelected = (0, import_react65.useMemo)(() => {
@@ -32978,6 +32982,7 @@ function ModelDialog({ onClose }) {
32978
32982
  PREVIEW_GEMINI_MODEL,
32979
32983
  PREVIEW_GEMINI_3_1_MODEL,
32980
32984
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
32985
+ PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
32981
32986
  PREVIEW_GEMINI_FLASH_MODEL
32982
32987
  ];
32983
32988
  if (manualModels.includes(preferredModel)) {
@@ -33054,7 +33059,6 @@ function ModelDialog({ onClose }) {
33054
33059
  return list;
33055
33060
  }, [config, shouldShowPreviewModels, manualModelSelected, useGemini31]);
33056
33061
  const manualOptions = (0, import_react65.useMemo)(() => {
33057
- const isFreeTier = config?.getUserTier() === UserTierId.FREE;
33058
33062
  if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.modelConfigService) {
33059
33063
  const list2 = Object.entries(
33060
33064
  config.modelConfigService.getModelDefinitions?.() ?? {}
@@ -33063,19 +33067,19 @@ function ModelDialog({ onClose }) {
33063
33067
  if (m.isPreview && !shouldShowPreviewModels) return false;
33064
33068
  if (m.tier === "auto") return false;
33065
33069
  if (!hasAccessToProModel && m.tier === "pro") return false;
33066
- if (m.tier === "flash-lite" && m.isPreview && !isFreeTier)
33067
- return false;
33068
33070
  if (id === PREVIEW_GEMINI_3_1_MODEL && !useGemini31) return false;
33069
- if (id === PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL && !useGemini31)
33071
+ if (id === PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL && !useGemini31FlashLite)
33070
33072
  return false;
33071
33073
  return true;
33072
33074
  }).map(([id, m]) => {
33073
33075
  const resolvedId = config.modelConfigService.resolveModelId(id, {
33074
33076
  useGemini3_1: useGemini31,
33077
+ useGemini3_1FlashLite: useGemini31FlashLite,
33075
33078
  useCustomTools: useCustomToolModel
33076
33079
  });
33077
33080
  const titleId = config.modelConfigService.resolveModelId(id, {
33078
- useGemini3_1: useGemini31
33081
+ useGemini3_1: useGemini31,
33082
+ useGemini3_1FlashLite: useGemini31FlashLite
33079
33083
  });
33080
33084
  return {
33081
33085
  value: resolvedId,
@@ -33122,7 +33126,7 @@ function ModelDialog({ onClose }) {
33122
33126
  key: PREVIEW_GEMINI_FLASH_MODEL
33123
33127
  }
33124
33128
  ];
33125
- if (isFreeTier) {
33129
+ if (useGemini31FlashLite) {
33126
33130
  previewOptions.push({
33127
33131
  value: PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
33128
33132
  title: getDisplayString(PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL),
@@ -33138,6 +33142,7 @@ function ModelDialog({ onClose }) {
33138
33142
  }, [
33139
33143
  shouldShowPreviewModels,
33140
33144
  useGemini31,
33145
+ useGemini31FlashLite,
33141
33146
  useCustomToolModel,
33142
33147
  hasAccessToProModel,
33143
33148
  config
@@ -34737,144 +34742,99 @@ var import_react71 = __toESM(require_react(), 1);
34737
34742
 
34738
34743
  // packages/cli/src/ui/hooks/useConsoleMessages.ts
34739
34744
  var import_react70 = __toESM(require_react(), 1);
34740
- function consoleMessagesReducer(state, action) {
34741
- const MAX_CONSOLE_MESSAGES = 1e3;
34742
- switch (action.type) {
34743
- case "ADD_MESSAGES": {
34744
- const newMessages = [...state];
34745
- for (const queuedMessage of action.payload) {
34746
- const lastMessage = newMessages[newMessages.length - 1];
34747
- if (lastMessage && lastMessage.type === queuedMessage.type && lastMessage.content === queuedMessage.content) {
34748
- newMessages[newMessages.length - 1] = {
34749
- ...lastMessage,
34750
- count: lastMessage.count + 1
34751
- };
34752
- } else {
34753
- newMessages.push({ ...queuedMessage, count: 1 });
34754
- }
34755
- }
34756
- if (newMessages.length > MAX_CONSOLE_MESSAGES) {
34757
- return newMessages.slice(newMessages.length - MAX_CONSOLE_MESSAGES);
34758
- }
34759
- return newMessages;
34745
+ var MAX_CONSOLE_MESSAGES = 1e3;
34746
+ var globalConsoleMessages = [];
34747
+ var globalErrorCount = 0;
34748
+ var listeners = /* @__PURE__ */ new Set();
34749
+ var messageQueue = [];
34750
+ var timeoutId = null;
34751
+ function initializeConsoleStore() {
34752
+ if (timeoutId) {
34753
+ clearTimeout(timeoutId);
34754
+ timeoutId = null;
34755
+ }
34756
+ messageQueue = [];
34757
+ globalConsoleMessages = [];
34758
+ globalErrorCount = 0;
34759
+ notifyListeners();
34760
+ coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
34761
+ coreEvents.off(CoreEvent.Output, handleOutput);
34762
+ coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
34763
+ coreEvents.on(CoreEvent.Output, handleOutput);
34764
+ }
34765
+ function notifyListeners() {
34766
+ for (const listener of listeners) {
34767
+ listener();
34768
+ }
34769
+ }
34770
+ function processQueue() {
34771
+ if (messageQueue.length === 0) return;
34772
+ const newMessages = [...globalConsoleMessages];
34773
+ for (const queuedMessage of messageQueue) {
34774
+ if (queuedMessage.type === "error") {
34775
+ globalErrorCount++;
34776
+ }
34777
+ const prev = newMessages[newMessages.length - 1];
34778
+ if (prev && prev.type === queuedMessage.type && prev.content === queuedMessage.content) {
34779
+ newMessages[newMessages.length - 1] = {
34780
+ ...prev,
34781
+ count: prev.count + 1
34782
+ };
34783
+ } else {
34784
+ newMessages.push({ ...queuedMessage, count: 1 });
34760
34785
  }
34761
- case "CLEAR":
34762
- return [];
34763
- default:
34764
- return state;
34765
34786
  }
34787
+ globalConsoleMessages = newMessages.length > MAX_CONSOLE_MESSAGES ? newMessages.slice(-MAX_CONSOLE_MESSAGES) : newMessages;
34788
+ messageQueue = [];
34789
+ timeoutId = null;
34790
+ notifyListeners();
34766
34791
  }
34792
+ function handleNewMessage(message) {
34793
+ messageQueue.push(message);
34794
+ if (!timeoutId) {
34795
+ timeoutId = setTimeout(processQueue, 50);
34796
+ }
34797
+ }
34798
+ function subscribe(listener) {
34799
+ listeners.add(listener);
34800
+ return () => {
34801
+ listeners.delete(listener);
34802
+ };
34803
+ }
34804
+ function getConsoleMessagesSnapshot() {
34805
+ return globalConsoleMessages;
34806
+ }
34807
+ function getErrorCountSnapshot() {
34808
+ return globalErrorCount;
34809
+ }
34810
+ var handleConsoleLog = (payload) => {
34811
+ let content = payload.content;
34812
+ const MAX_CONSOLE_MSG_LENGTH = 1e4;
34813
+ if (content.length > MAX_CONSOLE_MSG_LENGTH) {
34814
+ content = content.slice(0, MAX_CONSOLE_MSG_LENGTH) + `... [Truncated ${content.length - MAX_CONSOLE_MSG_LENGTH} characters]`;
34815
+ }
34816
+ handleNewMessage({
34817
+ type: payload.type,
34818
+ content,
34819
+ count: 1
34820
+ });
34821
+ };
34822
+ var handleOutput = (payload) => {
34823
+ let content = typeof payload.chunk === "string" ? payload.chunk : new TextDecoder().decode(payload.chunk);
34824
+ const MAX_OUTPUT_CHUNK_LENGTH = 1e4;
34825
+ if (content.length > MAX_OUTPUT_CHUNK_LENGTH) {
34826
+ content = content.slice(0, MAX_OUTPUT_CHUNK_LENGTH) + `... [Truncated ${content.length - MAX_OUTPUT_CHUNK_LENGTH} characters]`;
34827
+ }
34828
+ handleNewMessage({ type: "log", content, count: 1 });
34829
+ };
34767
34830
  function useConsoleMessages() {
34768
- const [consoleMessages, dispatch] = (0, import_react70.useReducer)(consoleMessagesReducer, []);
34769
- const messageQueueRef = (0, import_react70.useRef)([]);
34770
- const timeoutRef = (0, import_react70.useRef)(null);
34771
- const isProcessingRef = (0, import_react70.useRef)(false);
34772
- const processQueue = (0, import_react70.useCallback)(() => {
34773
- if (messageQueueRef.current.length > 0) {
34774
- isProcessingRef.current = true;
34775
- const messagesToProcess = messageQueueRef.current;
34776
- messageQueueRef.current = [];
34777
- (0, import_react70.startTransition)(() => {
34778
- dispatch({ type: "ADD_MESSAGES", payload: messagesToProcess });
34779
- });
34780
- }
34781
- timeoutRef.current = null;
34782
- }, []);
34783
- const handleNewMessage = (0, import_react70.useCallback)(
34784
- (message) => {
34785
- messageQueueRef.current.push(message);
34786
- if (!isProcessingRef.current && !timeoutRef.current) {
34787
- timeoutRef.current = setTimeout(processQueue, 50);
34788
- }
34789
- },
34790
- [processQueue]
34791
- );
34792
- (0, import_react70.useEffect)(() => {
34793
- isProcessingRef.current = false;
34794
- if (messageQueueRef.current.length > 0 && !timeoutRef.current) {
34795
- timeoutRef.current = setTimeout(processQueue, 50);
34796
- }
34797
- }, [consoleMessages, processQueue]);
34798
- (0, import_react70.useEffect)(() => {
34799
- const handleConsoleLog = (payload) => {
34800
- let content = payload.content;
34801
- const MAX_CONSOLE_MSG_LENGTH = 1e4;
34802
- if (content.length > MAX_CONSOLE_MSG_LENGTH) {
34803
- content = content.slice(0, MAX_CONSOLE_MSG_LENGTH) + `... [Truncated ${content.length - MAX_CONSOLE_MSG_LENGTH} characters]`;
34804
- }
34805
- handleNewMessage({
34806
- type: payload.type,
34807
- content,
34808
- count: 1
34809
- });
34810
- };
34811
- const handleOutput = (payload) => {
34812
- let content = typeof payload.chunk === "string" ? payload.chunk : new TextDecoder().decode(payload.chunk);
34813
- const MAX_OUTPUT_CHUNK_LENGTH = 1e4;
34814
- if (content.length > MAX_OUTPUT_CHUNK_LENGTH) {
34815
- content = content.slice(0, MAX_OUTPUT_CHUNK_LENGTH) + `... [Truncated ${content.length - MAX_OUTPUT_CHUNK_LENGTH} characters]`;
34816
- }
34817
- handleNewMessage({ type: "log", content, count: 1 });
34818
- };
34819
- coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
34820
- coreEvents.on(CoreEvent.Output, handleOutput);
34821
- return () => {
34822
- coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
34823
- coreEvents.off(CoreEvent.Output, handleOutput);
34824
- };
34825
- }, [handleNewMessage]);
34826
- const clearConsoleMessages = (0, import_react70.useCallback)(() => {
34827
- if (timeoutRef.current) {
34828
- clearTimeout(timeoutRef.current);
34829
- timeoutRef.current = null;
34830
- }
34831
- messageQueueRef.current = [];
34832
- isProcessingRef.current = true;
34833
- (0, import_react70.startTransition)(() => {
34834
- dispatch({ type: "CLEAR" });
34835
- });
34836
- }, []);
34837
- (0, import_react70.useEffect)(
34838
- () => () => {
34839
- if (timeoutRef.current) {
34840
- clearTimeout(timeoutRef.current);
34841
- }
34842
- },
34843
- []
34844
- );
34845
- return { consoleMessages, clearConsoleMessages };
34831
+ return (0, import_react70.useSyncExternalStore)(subscribe, getConsoleMessagesSnapshot);
34846
34832
  }
34847
34833
  function useErrorCount() {
34848
- const [errorCount, dispatch] = (0, import_react70.useReducer)(
34849
- (state, action) => {
34850
- switch (action) {
34851
- case "INCREMENT":
34852
- return state + 1;
34853
- case "CLEAR":
34854
- return 0;
34855
- default:
34856
- return state;
34857
- }
34858
- },
34859
- 0
34860
- );
34861
- (0, import_react70.useEffect)(() => {
34862
- const handleConsoleLog = (payload) => {
34863
- if (payload.type === "error") {
34864
- (0, import_react70.startTransition)(() => {
34865
- dispatch("INCREMENT");
34866
- });
34867
- }
34868
- };
34869
- coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
34870
- return () => {
34871
- coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
34872
- };
34873
- }, []);
34834
+ const errorCount = (0, import_react70.useSyncExternalStore)(subscribe, getErrorCountSnapshot);
34874
34835
  const clearErrorCount = (0, import_react70.useCallback)(() => {
34875
- (0, import_react70.startTransition)(() => {
34876
- dispatch("CLEAR");
34877
- });
34836
+ globalErrorCount = 0;
34837
+ notifyListeners();
34878
34838
  }, []);
34879
34839
  return { errorCount, clearErrorCount };
34880
34840
  }
@@ -34884,7 +34844,7 @@ var import_jsx_runtime113 = __toESM(require_jsx_runtime(), 1);
34884
34844
  var iconBoxWidth = 3;
34885
34845
  var DetailedMessagesDisplay = ({ maxHeight, width, hasFocus }) => {
34886
34846
  const scrollableListRef = (0, import_react71.useRef)(null);
34887
- const { consoleMessages } = useConsoleMessages();
34847
+ const consoleMessages = useConsoleMessages();
34888
34848
  const config = useConfig();
34889
34849
  const messages = (0, import_react71.useMemo)(() => {
34890
34850
  if (config.getDebugMode()) {
@@ -36977,11 +36937,11 @@ function usePromptCompletion({
36977
36937
  clearGhostText
36978
36938
  ]);
36979
36939
  (0, import_react79.useEffect)(() => {
36980
- const timeoutId = setTimeout(
36940
+ const timeoutId2 = setTimeout(
36981
36941
  handlePromptCompletion,
36982
36942
  PROMPT_COMPLETION_DEBOUNCE_MS
36983
36943
  );
36984
- return () => clearTimeout(timeoutId);
36944
+ return () => clearTimeout(timeoutId2);
36985
36945
  }, [buffer.text, buffer.cursor, handlePromptCompletion]);
36986
36946
  (0, import_react79.useEffect)(() => {
36987
36947
  const currentText = buffer.text.trim();
@@ -38698,20 +38658,20 @@ var InputPrompt = ({
38698
38658
  var import_jsx_runtime119 = __toESM(require_jsx_runtime(), 1);
38699
38659
  var MAX_DISPLAYED_QUEUED_MESSAGES = 3;
38700
38660
  var QueuedMessageDisplay = ({
38701
- messageQueue
38661
+ messageQueue: messageQueue2
38702
38662
  }) => {
38703
- if (messageQueue.length === 0) {
38663
+ if (messageQueue2.length === 0) {
38704
38664
  return null;
38705
38665
  }
38706
38666
  return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
38707
38667
  /* @__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):" }) }),
38708
- messageQueue.slice(0, MAX_DISPLAYED_QUEUED_MESSAGES).map((message, index) => {
38668
+ messageQueue2.slice(0, MAX_DISPLAYED_QUEUED_MESSAGES).map((message, index) => {
38709
38669
  const preview = message.replace(/\s+/g, " ");
38710
38670
  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);
38711
38671
  }),
38712
- 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: [
38672
+ 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: [
38713
38673
  "... (+",
38714
- messageQueue.length - MAX_DISPLAYED_QUEUED_MESSAGES,
38674
+ messageQueue2.length - MAX_DISPLAYED_QUEUED_MESSAGES,
38715
38675
  " more)"
38716
38676
  ] }) })
38717
38677
  ] });
@@ -40421,7 +40381,7 @@ function TerminalProvider({ children }) {
40421
40381
  const { stdout } = use_stdout_default();
40422
40382
  const subscribers = (0, import_react93.useRef)(/* @__PURE__ */ new Set()).current;
40423
40383
  const bufferRef = (0, import_react93.useRef)("");
40424
- const subscribe = (0, import_react93.useCallback)(
40384
+ const subscribe2 = (0, import_react93.useCallback)(
40425
40385
  (handler) => {
40426
40386
  subscribers.add(handler);
40427
40387
  },
@@ -40439,14 +40399,14 @@ function TerminalProvider({ children }) {
40439
40399
  unsubscribe(handler);
40440
40400
  resolve3();
40441
40401
  };
40442
- subscribe(handler);
40402
+ subscribe2(handler);
40443
40403
  TerminalCapabilityManager.queryBackgroundColor(stdout);
40444
40404
  setTimeout(() => {
40445
40405
  unsubscribe(handler);
40446
40406
  resolve3();
40447
40407
  }, 100);
40448
40408
  }),
40449
- [stdout, subscribe, unsubscribe]
40409
+ [stdout, subscribe2, unsubscribe]
40450
40410
  );
40451
40411
  (0, import_react93.useEffect)(() => {
40452
40412
  const handleData = (data) => {
@@ -40476,7 +40436,7 @@ function TerminalProvider({ children }) {
40476
40436
  return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
40477
40437
  TerminalContext.Provider,
40478
40438
  {
40479
- value: { subscribe, unsubscribe, queryTerminalBackground },
40439
+ value: { subscribe: subscribe2, unsubscribe, queryTerminalBackground },
40480
40440
  children
40481
40441
  }
40482
40442
  );
@@ -42531,8 +42491,24 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
42531
42491
  const allPushed = toolCalls.length > 0 && toolCalls.every((tc) => pushedToolCallIds.has(tc.request.callId));
42532
42492
  const anyVisibleInHistory = pushedToolCallIds.size > 0;
42533
42493
  const anyVisibleInPending = remainingTools.some((tc) => {
42534
- const isInProgress = tc.status !== "success" && tc.status !== "error" && tc.status !== "cancelled";
42535
- if (tc.request.name === ASK_USER_TOOL_NAME && isInProgress) {
42494
+ const displayName = tc.tool?.displayName ?? tc.request.name;
42495
+ let hasResultDisplay = false;
42496
+ if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
42497
+ hasResultDisplay = !!tc.response?.resultDisplay;
42498
+ } else if (tc.status === CoreToolCallStatus.Executing) {
42499
+ hasResultDisplay = !!tc.liveOutput;
42500
+ }
42501
+ if (shouldHideToolCall({
42502
+ displayName,
42503
+ status: tc.status,
42504
+ approvalMode: tc.approvalMode,
42505
+ hasResultDisplay,
42506
+ parentCallId: tc.request.parentCallId
42507
+ })) {
42508
+ return false;
42509
+ }
42510
+ const displayStatus = mapCoreStatusToDisplayStatus(tc.status);
42511
+ if (displayStatus === "Confirming" /* Confirming */) {
42536
42512
  return false;
42537
42513
  }
42538
42514
  return true;
@@ -45493,14 +45469,14 @@ var TimeoutError = class extends Error {
45493
45469
  // node_modules/ky/distribution/utils/timeout.js
45494
45470
  async function timeout(request, init, abortController, options) {
45495
45471
  return new Promise((resolve3, reject) => {
45496
- const timeoutId = setTimeout(() => {
45472
+ const timeoutId2 = setTimeout(() => {
45497
45473
  if (abortController) {
45498
45474
  abortController.abort();
45499
45475
  }
45500
45476
  reject(new TimeoutError(request));
45501
45477
  }, options.timeout);
45502
45478
  void options.fetch(request, init).then(resolve3).catch(reject).then(() => {
45503
- clearTimeout(timeoutId);
45479
+ clearTimeout(timeoutId2);
45504
45480
  });
45505
45481
  });
45506
45482
  }
@@ -45513,10 +45489,10 @@ async function delay(ms, { signal }) {
45513
45489
  signal.addEventListener("abort", abortHandler, { once: true });
45514
45490
  }
45515
45491
  function abortHandler() {
45516
- clearTimeout(timeoutId);
45492
+ clearTimeout(timeoutId2);
45517
45493
  reject(signal.reason);
45518
45494
  }
45519
- const timeoutId = setTimeout(() => {
45495
+ const timeoutId2 = setTimeout(() => {
45520
45496
  signal?.removeEventListener("abort", abortHandler);
45521
45497
  resolve3();
45522
45498
  }, ms);
@@ -46026,7 +46002,7 @@ function useMessageQueue({
46026
46002
  submitQuery,
46027
46003
  isMcpReady
46028
46004
  }) {
46029
- const [messageQueue, setMessageQueue] = (0, import_react109.useState)([]);
46005
+ const [messageQueue2, setMessageQueue] = (0, import_react109.useState)([]);
46030
46006
  const addMessage = (0, import_react109.useCallback)((message) => {
46031
46007
  const trimmedMessage = message.trim();
46032
46008
  if (trimmedMessage.length > 0) {
@@ -46037,20 +46013,20 @@ function useMessageQueue({
46037
46013
  setMessageQueue([]);
46038
46014
  }, []);
46039
46015
  const getQueuedMessagesText = (0, import_react109.useCallback)(() => {
46040
- if (messageQueue.length === 0) return "";
46041
- return messageQueue.join("\n\n");
46042
- }, [messageQueue]);
46016
+ if (messageQueue2.length === 0) return "";
46017
+ return messageQueue2.join("\n\n");
46018
+ }, [messageQueue2]);
46043
46019
  const popAllMessages = (0, import_react109.useCallback)(() => {
46044
- if (messageQueue.length === 0) {
46020
+ if (messageQueue2.length === 0) {
46045
46021
  return void 0;
46046
46022
  }
46047
- const allMessages = messageQueue.join("\n\n");
46023
+ const allMessages = messageQueue2.join("\n\n");
46048
46024
  setMessageQueue([]);
46049
46025
  return allMessages;
46050
- }, [messageQueue]);
46026
+ }, [messageQueue2]);
46051
46027
  (0, import_react109.useEffect)(() => {
46052
- if (isConfigInitialized && streamingState === "idle" /* Idle */ && isMcpReady && messageQueue.length > 0) {
46053
- const combinedMessage = messageQueue.join("\n\n");
46028
+ if (isConfigInitialized && streamingState === "idle" /* Idle */ && isMcpReady && messageQueue2.length > 0) {
46029
+ const combinedMessage = messageQueue2.join("\n\n");
46054
46030
  setMessageQueue([]);
46055
46031
  submitQuery(combinedMessage);
46056
46032
  }
@@ -46058,11 +46034,11 @@ function useMessageQueue({
46058
46034
  isConfigInitialized,
46059
46035
  streamingState,
46060
46036
  isMcpReady,
46061
- messageQueue,
46037
+ messageQueue2,
46062
46038
  submitQuery
46063
46039
  ]);
46064
46040
  return {
46065
- messageQueue,
46041
+ messageQueue: messageQueue2,
46066
46042
  addMessage,
46067
46043
  clearQueue,
46068
46044
  getQueuedMessagesText,
@@ -46535,11 +46511,11 @@ var useHookDisplayState = () => {
46535
46511
  });
46536
46512
  };
46537
46513
  if (remaining > 0) {
46538
- const timeoutId = setTimeout(() => {
46514
+ const timeoutId2 = setTimeout(() => {
46539
46515
  removeHook();
46540
- activeTimeouts.delete(timeoutId);
46516
+ activeTimeouts.delete(timeoutId2);
46541
46517
  }, remaining);
46542
- activeTimeouts.add(timeoutId);
46518
+ activeTimeouts.add(timeoutId2);
46543
46519
  } else {
46544
46520
  removeHook();
46545
46521
  }
@@ -46656,7 +46632,7 @@ var LoginWithGoogleRestartDialog = ({
46656
46632
  var import_react118 = __toESM(require_react(), 1);
46657
46633
  function useTerminalTheme(handleThemeSelect, config, refreshStatic) {
46658
46634
  const settings = useSettings();
46659
- const { subscribe, unsubscribe, queryTerminalBackground } = useTerminalContext();
46635
+ const { subscribe: subscribe2, unsubscribe, queryTerminalBackground } = useTerminalContext();
46660
46636
  (0, import_react118.useEffect)(() => {
46661
46637
  if (settings.merged.ui.autoThemeSwitching === false) {
46662
46638
  return;
@@ -46701,7 +46677,7 @@ function useTerminalTheme(handleThemeSelect, config, refreshStatic) {
46701
46677
  refreshStatic();
46702
46678
  }
46703
46679
  };
46704
- subscribe(handleTerminalBackground);
46680
+ subscribe2(handleTerminalBackground);
46705
46681
  return () => {
46706
46682
  clearInterval(pollIntervalId);
46707
46683
  unsubscribe(handleTerminalBackground);
@@ -46712,7 +46688,7 @@ function useTerminalTheme(handleThemeSelect, config, refreshStatic) {
46712
46688
  settings.merged.ui.terminalBackgroundPollingInterval,
46713
46689
  config,
46714
46690
  handleThemeSelect,
46715
- subscribe,
46691
+ subscribe2,
46716
46692
  unsubscribe,
46717
46693
  queryTerminalBackground,
46718
46694
  refreshStatic
@@ -47335,7 +47311,6 @@ var AppContainer = (props) => {
47335
47311
  const app = use_app_default();
47336
47312
  const { stats: sessionStats } = useSessionStats();
47337
47313
  const branchName = useGitBranchName(config.getTargetDir());
47338
- const mainControlsRef = (0, import_react124.useRef)(null);
47339
47314
  const rootUiRef = (0, import_react124.useRef)(null);
47340
47315
  const lastTitleRef = (0, import_react124.useRef)(null);
47341
47316
  const staticExtraHeight = 3;
@@ -47985,7 +47960,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
47985
47960
  );
47986
47961
  const { isMcpReady } = useMcpStatus(config);
47987
47962
  const {
47988
- messageQueue,
47963
+ messageQueue: messageQueue2,
47989
47964
  addMessage,
47990
47965
  clearQueue,
47991
47966
  getQueuedMessagesText,
@@ -48095,7 +48070,7 @@ ${queuedText}` : queuedText;
48095
48070
  }
48096
48071
  void submitQuery(submittedValue);
48097
48072
  } else {
48098
- if (isIdle && !isMcpOrConfigReady && messageQueue.length === 0) {
48073
+ if (isIdle && !isMcpOrConfigReady && messageQueue2.length === 0) {
48099
48074
  coreEvents.emitFeedback(
48100
48075
  "info",
48101
48076
  !isConfigInitialized ? "Initializing... Prompts will be queued." : "Waiting for MCP servers to initialize... Slash commands are still available and prompts will be queued."
@@ -48113,7 +48088,7 @@ ${queuedText}` : queuedText;
48113
48088
  slashCommands,
48114
48089
  isMcpReady,
48115
48090
  streamingState,
48116
- messageQueue.length,
48091
+ messageQueue2.length,
48117
48092
  pendingHistoryItems,
48118
48093
  config,
48119
48094
  constrainHeight,
@@ -48141,16 +48116,27 @@ ${queuedText}` : queuedText;
48141
48116
  ]);
48142
48117
  const { handleInput: vimHandleInput } = useVim(buffer, handleFinalSubmit);
48143
48118
  const isInputActive = !initError && !isProcessing && !isResuming && (streamingState === "idle" /* Idle */ || streamingState === "responding" /* Responding */ || streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */) && !proQuotaRequest;
48119
+ const observerRef = (0, import_react124.useRef)(null);
48144
48120
  const [controlsHeight, setControlsHeight] = (0, import_react124.useState)(0);
48145
- (0, import_react124.useLayoutEffect)(() => {
48146
- if (mainControlsRef.current) {
48147
- const fullFooterMeasurement = measure_element_default(mainControlsRef.current);
48148
- const roundedHeight = Math.round(fullFooterMeasurement.height);
48149
- if (roundedHeight > 0 && roundedHeight !== controlsHeight) {
48150
- setControlsHeight(roundedHeight);
48151
- }
48121
+ const mainControlsRef = (0, import_react124.useCallback)((node) => {
48122
+ if (observerRef.current) {
48123
+ observerRef.current.disconnect();
48124
+ observerRef.current = null;
48125
+ }
48126
+ if (node) {
48127
+ const observer = new ResizeObserver((entries) => {
48128
+ const entry = entries[0];
48129
+ if (entry) {
48130
+ const roundedHeight = Math.round(entry.contentRect.height);
48131
+ setControlsHeight(
48132
+ (prev) => roundedHeight !== prev ? roundedHeight : prev
48133
+ );
48134
+ }
48135
+ });
48136
+ observer.observe(node);
48137
+ observerRef.current = observer;
48152
48138
  }
48153
- }, [buffer, terminalWidth, terminalHeight, controlsHeight, isInputActive]);
48139
+ }, []);
48154
48140
  const availableTerminalHeight = Math.max(
48155
48141
  0,
48156
48142
  terminalHeight - controlsHeight - backgroundShellHeight - 1
@@ -48383,7 +48369,7 @@ ${queuedText}` : queuedText;
48383
48369
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
48384
48370
  if (settings.merged.general.devtools) {
48385
48371
  void (async () => {
48386
- const { toggleDevToolsPanel } = await import("./devtoolsService-MQCND52T.js");
48372
+ const { toggleDevToolsPanel } = await import("./devtoolsService-Y53ZUB56.js");
48387
48373
  await toggleDevToolsPanel(
48388
48374
  config,
48389
48375
  showErrorDetails,
@@ -48779,7 +48765,7 @@ ${queuedText}` : queuedText;
48779
48765
  currentWittyPhrase,
48780
48766
  historyRemountKey,
48781
48767
  activeHooks,
48782
- messageQueue,
48768
+ messageQueue: messageQueue2,
48783
48769
  queueErrorMessage,
48784
48770
  showApprovalModeIndicator,
48785
48771
  allowPlanMode,
@@ -48902,7 +48888,7 @@ ${queuedText}` : queuedText;
48902
48888
  currentWittyPhrase,
48903
48889
  historyRemountKey,
48904
48890
  activeHooks,
48905
- messageQueue,
48891
+ messageQueue2,
48906
48892
  queueErrorMessage,
48907
48893
  showApprovalModeIndicator,
48908
48894
  allowPlanMode,
@@ -49143,6 +49129,7 @@ ${queuedText}` : queuedText;
49143
49129
  var import_jsx_runtime137 = __toESM(require_jsx_runtime(), 1);
49144
49130
  var SLOW_RENDER_MS = 200;
49145
49131
  async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
49132
+ initializeConsoleStore();
49146
49133
  const useAlternateBuffer2 = shouldEnterAlternateScreen(
49147
49134
  isAlternateBufferEnabled(config),
49148
49135
  config.getScreenReader()