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

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