@google/gemini-cli 0.64.0-preview.0 → 0.65.0-nightly.20261007.gef59c532f

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 (70) hide show
  1. package/bundle/{chunk-EDVFNWRG.js → chunk-2QX7AFU2.js} +1 -1
  2. package/bundle/{chunk-EDYPRCAA.js → chunk-354KMHUX.js} +2 -2
  3. package/bundle/{chunk-UFQDAROY.js → chunk-3F7OA7UU.js} +1 -1
  4. package/bundle/{chunk-HN74ORTP.js → chunk-46A63GIT.js} +27 -4
  5. package/bundle/{chunk-ZQW7OGUO.js → chunk-6FH32SR7.js} +184 -45
  6. package/bundle/{chunk-SDWOC67Z.js → chunk-7NUXN3UV.js} +1 -1
  7. package/bundle/{chunk-Y2HXXBXI.js → chunk-ASQYH7O3.js} +1 -1
  8. package/bundle/{chunk-EBP6K2WG.js → chunk-BT4BJCGX.js} +32 -16
  9. package/bundle/{chunk-UBGF6JU5.js → chunk-CIKQQ32X.js} +1 -1
  10. package/bundle/chunk-DIMRHS5O.js +154 -0
  11. package/bundle/{chunk-NX7TO2DU.js → chunk-EIHDEZQ3.js} +1 -1
  12. package/bundle/{chunk-QUCRASYB.js → chunk-FE5UXCSL.js} +1 -1
  13. package/bundle/{chunk-EFX5XL6M.js → chunk-FTB4FVEK.js} +2 -2
  14. package/bundle/{chunk-A4TO2DY2.js → chunk-HYF74TEA.js} +8018 -14883
  15. package/bundle/{chunk-6OFXOGEG.js → chunk-JYWQ73Z5.js} +193 -47
  16. package/bundle/{chunk-HSZIYPL6.js → chunk-KHG7NKQK.js} +3 -3
  17. package/bundle/chunk-KTOZF7BG.js +401335 -0
  18. package/bundle/{chunk-2NQXIWQK.js → chunk-KV6RPWUP.js} +27 -4
  19. package/bundle/{chunk-KCCVXZ52.js → chunk-LNFN3PQL.js} +32 -16
  20. package/bundle/{chunk-MLSLNORV.js → chunk-LS355CSQ.js} +3 -3
  21. package/bundle/{chunk-2VN53SWW.js → chunk-NDVLWD4V.js} +9 -8
  22. package/bundle/{chunk-ZOHM7BPT.js → chunk-NUWDVBI7.js} +1 -1
  23. package/bundle/{chunk-VJYKQD5D.js → chunk-PYD373NJ.js} +3 -3
  24. package/bundle/{chunk-VBVCLWLA.js → chunk-QTGBWTWR.js} +2 -2
  25. package/bundle/chunk-U6ZQ2RUE.js +1571 -0
  26. package/bundle/chunk-UV4NDIKL.js +118 -0
  27. package/bundle/{chunk-U76XPSKR.js → chunk-VAONEIPY.js} +96 -67
  28. package/bundle/chunk-WGJZZTZY.js +425 -0
  29. package/bundle/{chunk-ZPLFLZQA.js → chunk-WXXOP3OP.js} +33 -8
  30. package/bundle/chunk-XOG2HJ3Y.js +17530 -0
  31. package/bundle/chunk-YSKY65XX.js +512 -0
  32. package/bundle/chunk-ZTPICUAP.js +103137 -0
  33. package/bundle/{cleanup-GGCB2LVD.js → cleanup-3V27AYOD.js} +2 -2
  34. package/bundle/{cleanup-JRDG3OTL.js → cleanup-4G3NPQT4.js} +2 -2
  35. package/bundle/{cleanup-SSW6IXTR.js → cleanup-5XQCOW5U.js} +2 -2
  36. package/bundle/cleanup-BBUUFPW4.js +32 -0
  37. package/bundle/{core-IUIZE6JW.js → core-AAGHH24E.js} +1 -1
  38. package/bundle/{devtoolsService-XZCKFZP5.js → devtoolsService-EVGTOLCK.js} +2 -2
  39. package/bundle/{devtoolsService-3SADPKKB.js → devtoolsService-J7VIMPHG.js} +2 -2
  40. package/bundle/{devtoolsService-MF6JKRUV.js → devtoolsService-PZBHHYCE.js} +4 -3
  41. package/bundle/devtoolsService-Z4ND55GM.js +4359 -0
  42. package/bundle/{dist-7L3BRW6V.js → dist-6PBUOORE.js} +1 -1
  43. package/bundle/{core-6HRWFQZW.js → dist-Q7B3BSZW.js} +1 -1
  44. package/bundle/dist-Z23CJKTC.js +2252 -0
  45. package/bundle/docs/changelogs/index.md +14 -0
  46. package/bundle/docs/changelogs/latest.md +55 -34
  47. package/bundle/docs/changelogs/preview.md +59 -54
  48. package/bundle/docs/tools/mcp-server.md +41 -12
  49. package/bundle/{gemini-JPMMQ3KA.js → gemini-2ZS4H5D5.js} +41 -21
  50. package/bundle/{gemini-QOQNG5VY.js → gemini-NHT6XRJ6.js} +241 -205
  51. package/bundle/gemini-ORQLMSXW.js +17954 -0
  52. package/bundle/{gemini-ZMMDUAQJ.js → gemini-YDK3BHCP.js} +41 -21
  53. package/bundle/gemini.js +7 -7
  54. package/bundle/{interactiveCli-R3P4A3FC.js → interactiveCli-22MUJI66.js} +23 -14
  55. package/bundle/{interactiveCli-UDWGRVJL.js → interactiveCli-2JNS4RJW.js} +23 -14
  56. package/bundle/{interactiveCli-3I4TG5SK.js → interactiveCli-EHUGFQPB.js} +327 -299
  57. package/bundle/interactiveCli-YANG53MI.js +34988 -0
  58. package/bundle/{liteRtServerManager-OVPUSK2T.js → liteRtServerManager-PGT3WQWS.js} +4 -4
  59. package/bundle/{liteRtServerManager-RAV63AGE.js → liteRtServerManager-TW45VSAX.js} +4 -4
  60. package/bundle/{liteRtServerManager-4MWCEVVM.js → liteRtServerManager-VCTOOEN4.js} +4 -4
  61. package/bundle/liteRtServerManager-Y2QFKZ5W.js +65 -0
  62. package/bundle/{oauth2-provider-XFP63FGJ.js → oauth2-provider-4AK74O2H.js} +1 -1
  63. package/bundle/{oauth2-provider-FVTRRJZR.js → oauth2-provider-IUYZ2A7H.js} +1 -1
  64. package/bundle/{oauth2-provider-EWOA64PR.js → oauth2-provider-JCJGEWMM.js} +38 -72
  65. package/bundle/oauth2-provider-QTTPZS6I.js +235 -0
  66. package/bundle/{start-DJAIXPPY.js → start-4O4IKUM4.js} +6 -6
  67. package/bundle/{start-VQQ2Q5KT.js → start-74BH6SEW.js} +6 -6
  68. package/bundle/{start-5O7TBK5L.js → start-EDAVUSEX.js} +6 -6
  69. package/bundle/start-Q6WRPG2O.js +18 -0
  70. package/package.json +1 -1
@@ -171,10 +171,10 @@ import {
171
171
  widestLineFromStyledChars,
172
172
  wordBreakStyledChars,
173
173
  wrapStyledChars
174
- } from "./chunk-U76XPSKR.js";
174
+ } from "./chunk-ZTPICUAP.js";
175
175
  import {
176
176
  require_source
177
- } from "./chunk-QUCRASYB.js";
177
+ } from "./chunk-U6ZQ2RUE.js";
178
178
  import {
179
179
  appEvents
180
180
  } from "./chunk-5PS3AYFU.js";
@@ -227,33 +227,37 @@ import {
227
227
  stripAnsi,
228
228
  stripUnsafeCharacters,
229
229
  toCodePoints
230
- } from "./chunk-ZPLFLZQA.js";
230
+ } from "./chunk-WXXOP3OP.js";
231
231
  import {
232
232
  handleAutoUpdate,
233
233
  isDevelopment,
234
234
  relaunchApp,
235
235
  setUpdateHandler
236
- } from "./chunk-EFX5XL6M.js";
236
+ } from "./chunk-FTB4FVEK.js";
237
237
  import {
238
238
  isTodoList,
239
239
  mapCoreStatusToDisplayStatus,
240
240
  require_react
241
- } from "./chunk-2VN53SWW.js";
241
+ } from "./chunk-EIHDEZQ3.js";
242
242
  import {
243
243
  registerCleanup,
244
244
  removeCleanup,
245
245
  runExitCleanup,
246
246
  setupTtyCheck
247
- } from "./chunk-UFQDAROY.js";
247
+ } from "./chunk-CIKQQ32X.js";
248
248
  import {
249
249
  ACTIVATE_SKILL_TOOL_NAME,
250
250
  AGENT_TOOL_NAME,
251
251
  ApiKeyUpdatedEvent,
252
+ ApprovalMode,
252
253
  AsyncFzf,
253
254
  AudioRecorder,
254
255
  AuthType,
255
256
  ChangeAuthRequestedError,
257
+ CompressionStatus,
256
258
  ConversationFinishedEvent,
259
+ CoreEvent,
260
+ CoreToolCallStatus,
257
261
  CreditPurchaseClickEvent,
258
262
  DEFAULT_GEMINI_FLASH_LITE_MODEL,
259
263
  DEFAULT_GEMINI_FLASH_MODEL,
@@ -275,13 +279,20 @@ import {
275
279
  GEMMA_4_31B_IT_MODEL,
276
280
  GLOB_DISPLAY_NAME,
277
281
  GREP_DISPLAY_NAME,
282
+ GeminiCliOperation,
283
+ GeminiEventType,
278
284
  GitService,
279
285
  IdeClient,
286
+ Kind,
280
287
  LS_DISPLAY_NAME,
281
288
  LegacyAgentProtocol,
282
289
  LlmRole,
283
290
  Logger,
284
291
  MAX_TOKENS_EXCEEDED_SUGGESTION,
292
+ MCPDiscoveryState,
293
+ MCPServerStatus,
294
+ MessageBusType,
295
+ MessageSenderType,
285
296
  ModelNotFoundError,
286
297
  ModelSlashCommandEvent,
287
298
  OTHER_BLOCKED_MESSAGE,
@@ -294,6 +305,7 @@ import {
294
305
  PREVIEW_GEMINI_MODEL,
295
306
  PolicyIntegrityManager,
296
307
  ProjectIdRequiredError,
308
+ QuestionType,
297
309
  READ_FILE_DISPLAY_NAME,
298
310
  READ_MANY_FILES_DISPLAY_NAME,
299
311
  RECITATION_BLOCKED_MESSAGE,
@@ -302,16 +314,22 @@ import {
302
314
  SAFETY_BLOCKED_MESSAGE,
303
315
  SHELL_TOOL_NAME,
304
316
  Scheduler,
317
+ SessionEndReason,
318
+ SessionStartSource,
305
319
  ShellExecutionService,
306
320
  SlashCommandStatus,
307
321
  Storage,
322
+ SubagentState,
308
323
  THINKING_ONLY_COMPRESS_SUGGESTION,
309
324
  TOPIC_PARAM_STRATEGIC_INTENT,
310
325
  TOPIC_PARAM_SUMMARY,
311
326
  TOPIC_PARAM_TITLE,
312
327
  TRUE_EMPTY_RESPONSE_MESSAGE,
313
328
  TerminalQuotaError,
329
+ ToolConfirmationOutcome,
330
+ ToolErrorType,
314
331
  TranscriptionFactory,
332
+ TrustLevel,
315
333
  UPDATE_TOPIC_DISPLAY_NAME,
316
334
  UPDATE_TOPIC_TOOL_NAME,
317
335
  UnauthorizedError,
@@ -323,6 +341,7 @@ import {
323
341
  WEB_FETCH_DISPLAY_NAME,
324
342
  WEB_SEARCH_DISPLAY_NAME,
325
343
  WRITE_FILE_DISPLAY_NAME,
344
+ WarningPriority,
326
345
  WhisperModelManager,
327
346
  addMCPStatusChangeListener,
328
347
  allowEditorTypeInSandbox,
@@ -430,7 +449,7 @@ import {
430
449
  validatePlanContent,
431
450
  validatePlanPath,
432
451
  writeToStdout
433
- } from "./chunk-A4TO2DY2.js";
452
+ } from "./chunk-KTOZF7BG.js";
434
453
  import "./chunk-664ZODQF.js";
435
454
  import "./chunk-IUUIT4SU.js";
436
455
  import "./chunk-L6PII3GR.js";
@@ -5057,7 +5076,7 @@ function calculateShellMaxLines(options) {
5057
5076
  if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
5058
5077
  return maxLinesBasedOnHeight;
5059
5078
  }
5060
- const isExecuting = status === "executing" /* Executing */;
5079
+ const isExecuting = status === CoreToolCallStatus.Executing;
5061
5080
  const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
5062
5081
  return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
5063
5082
  }
@@ -5093,13 +5112,13 @@ var formatToolArgs = (args) => {
5093
5112
  var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) => {
5094
5113
  let headerText;
5095
5114
  let headerColor = theme.text.secondary;
5096
- if (progress.state === "cancelled" /* CANCELLED */) {
5115
+ if (progress.state === SubagentState.CANCELLED) {
5097
5116
  headerText = `Subagent ${progress.agentName} was cancelled.`;
5098
5117
  headerColor = theme.status.warning;
5099
- } else if (progress.state === "error" /* ERROR */) {
5118
+ } else if (progress.state === SubagentState.ERROR) {
5100
5119
  headerText = `Subagent ${progress.agentName} failed.`;
5101
5120
  headerColor = theme.status.error;
5102
- } else if (progress.state === "completed" /* COMPLETED */) {
5121
+ } else if (progress.state === SubagentState.COMPLETED) {
5103
5122
  headerText = `Subagent ${progress.agentName} completed.`;
5104
5123
  headerColor = theme.status.success;
5105
5124
  } else {
@@ -5119,7 +5138,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5119
5138
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color, children: item.content }) })
5120
5139
  ] }, item.id);
5121
5140
  } else if (item.type === "tool_call") {
5122
- const statusSymbol = item.status === "running" /* RUNNING */ ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(build_default, { type: "dots" }) : item.status === "completed" /* COMPLETED */ ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: theme.status.success, children: TOOL_STATUS.SUCCESS }) : item.status === "cancelled" /* CANCELLED */ ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: theme.status.warning, bold: true, children: TOOL_STATUS.CANCELED }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: theme.status.error, children: TOOL_STATUS.ERROR });
5141
+ const statusSymbol = item.status === SubagentState.RUNNING ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(build_default, { type: "dots" }) : item.status === SubagentState.COMPLETED ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: theme.status.success, children: TOOL_STATUS.SUCCESS }) : item.status === SubagentState.CANCELLED ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: theme.status.warning, bold: true, children: TOOL_STATUS.CANCELED }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: theme.status.error, children: TOOL_STATUS.ERROR });
5123
5142
  const formattedArgs = item.description || formatToolArgs(item.args);
5124
5143
  const displayArgs = formattedArgs.length > 60 ? formattedArgs.slice(0, 60) + "..." : formattedArgs;
5125
5144
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Box_default, { flexDirection: "row", children: [
@@ -5130,7 +5149,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5130
5149
  {
5131
5150
  bold: true,
5132
5151
  color: theme.text.primary,
5133
- strikethrough: item.status === "cancelled" /* CANCELLED */,
5152
+ strikethrough: item.status === SubagentState.CANCELLED,
5134
5153
  children: item.displayName || item.content
5135
5154
  }
5136
5155
  ),
@@ -5139,7 +5158,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5139
5158
  {
5140
5159
  color: theme.text.secondary,
5141
5160
  wrap: "truncate",
5142
- strikethrough: item.status === "cancelled" /* CANCELLED */,
5161
+ strikethrough: item.status === SubagentState.CANCELLED,
5143
5162
  children: displayArgs
5144
5163
  }
5145
5164
  ) })
@@ -5159,7 +5178,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5159
5178
  MarkdownDisplay,
5160
5179
  {
5161
5180
  text: safeJsonToMarkdown(progress.result),
5162
- isPending: progress.state !== "completed" /* COMPLETED */,
5181
+ isPending: progress.state !== SubagentState.COMPLETED,
5163
5182
  terminalWidth
5164
5183
  }
5165
5184
  )
@@ -5514,14 +5533,14 @@ var ToolActionsProvider = (props) => {
5514
5533
  }
5515
5534
  const details = tool.confirmationDetails;
5516
5535
  if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
5517
- const cliOutcome = outcome === "cancel" /* Cancel */ ? "rejected" : "accepted";
5536
+ const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? "rejected" : "accepted";
5518
5537
  await ideClient?.resolveDiffFromCli(details.filePath, cliOutcome);
5519
5538
  }
5520
5539
  if (tool.correlationId) {
5521
5540
  await config.getMessageBus().publish({
5522
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
5541
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
5523
5542
  correlationId: tool.correlationId,
5524
- confirmed: outcome !== "cancel" /* Cancel */,
5543
+ confirmed: outcome !== ToolConfirmationOutcome.Cancel,
5525
5544
  requiresUserConfirmation: false,
5526
5545
  outcome,
5527
5546
  payload
@@ -5540,7 +5559,7 @@ var ToolActionsProvider = (props) => {
5540
5559
  );
5541
5560
  const cancel = (0, import_react10.useCallback)(
5542
5561
  async (callId) => {
5543
- await confirm(callId, "cancel" /* Cancel */);
5562
+ await confirm(callId, ToolConfirmationOutcome.Cancel);
5544
5563
  },
5545
5564
  [confirm]
5546
5565
  );
@@ -5661,7 +5680,7 @@ var ToolMessage = ({
5661
5680
  paddingX: 1,
5662
5681
  flexDirection: "column",
5663
5682
  children: [
5664
- status === "executing" /* Executing */ && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
5683
+ status === CoreToolCallStatus.Executing && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
5665
5684
  McpProgressIndicator,
5666
5685
  {
5667
5686
  progress,
@@ -5678,8 +5697,8 @@ var ToolMessage = ({
5678
5697
  terminalWidth: safeTerminalWidth,
5679
5698
  renderOutputAsMarkdown,
5680
5699
  hasFocus: isThisShellFocused2,
5681
- maxLines: kind === "agent" /* Agent */ && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
5682
- overflowDirection: kind === "agent" /* Agent */ ? "bottom" : "top"
5700
+ maxLines: kind === Kind.Agent && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
5701
+ overflowDirection: kind === Kind.Agent ? "bottom" : "top"
5683
5702
  }
5684
5703
  ),
5685
5704
  isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
@@ -5995,7 +6014,7 @@ function getInitialTrustState(settings, cwd5, isCurrentWorkspace) {
5995
6014
  settings.merged,
5996
6015
  process3.cwd()
5997
6016
  );
5998
- const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === "DO_NOT_TRUST" /* DO_NOT_TRUST */);
6017
+ const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === TrustLevel.DO_NOT_TRUST);
5999
6018
  return {
6000
6019
  currentTrustLevel: explicitTrustLevel,
6001
6020
  isInheritedTrustFromParent: !!(source === "file" && isInheritedTrust),
@@ -6040,7 +6059,7 @@ var usePermissionsModifyTrust = (onExit, addItem, targetDirectory) => {
6040
6059
  process3.cwd(),
6041
6060
  newConfig
6042
6061
  );
6043
- if (trustLevel === "DO_NOT_TRUST" /* DO_NOT_TRUST */ && isTrusted) {
6062
+ if (trustLevel === TrustLevel.DO_NOT_TRUST && isTrusted) {
6044
6063
  let message = "Note: This folder is still trusted because the connected IDE workspace is trusted.";
6045
6064
  if (source === "file") {
6046
6065
  message = "Note: This folder is still trusted because a parent folder is trusted.";
@@ -6114,18 +6133,18 @@ function PermissionsModifyTrustDialog({
6114
6133
  const TRUST_LEVEL_ITEMS = [
6115
6134
  {
6116
6135
  label: `Trust this folder (${dirName})`,
6117
- value: "TRUST_FOLDER" /* TRUST_FOLDER */,
6118
- key: "TRUST_FOLDER" /* TRUST_FOLDER */
6136
+ value: TrustLevel.TRUST_FOLDER,
6137
+ key: TrustLevel.TRUST_FOLDER
6119
6138
  },
6120
6139
  {
6121
6140
  label: `Trust parent folder (${parentFolder})`,
6122
- value: "TRUST_PARENT" /* TRUST_PARENT */,
6123
- key: "TRUST_PARENT" /* TRUST_PARENT */
6141
+ value: TrustLevel.TRUST_PARENT,
6142
+ key: TrustLevel.TRUST_PARENT
6124
6143
  },
6125
6144
  {
6126
6145
  label: "Don't trust",
6127
- value: "DO_NOT_TRUST" /* DO_NOT_TRUST */,
6128
- key: "DO_NOT_TRUST" /* DO_NOT_TRUST */
6146
+ value: TrustLevel.DO_NOT_TRUST,
6147
+ key: TrustLevel.DO_NOT_TRUST
6129
6148
  }
6130
6149
  ];
6131
6150
  const {
@@ -6366,7 +6385,7 @@ var ShellToolMessage = ({
6366
6385
  maxLinesLimit: maxLines
6367
6386
  });
6368
6387
  import_react15.default.useEffect(() => {
6369
- const isExecuting = status === "executing" /* Executing */;
6388
+ const isExecuting = status === CoreToolCallStatus.Executing;
6370
6389
  if (isExecuting && ptyId) {
6371
6390
  try {
6372
6391
  const childWidth = safeTerminalWidth - 4;
@@ -6580,13 +6599,13 @@ var SubagentGroupDisplay = ({
6580
6599
  const singleAgent = toolCalls[0].resultDisplay;
6581
6600
  if (isSubagentProgress(singleAgent)) {
6582
6601
  switch (singleAgent.state) {
6583
- case "completed" /* COMPLETED */:
6602
+ case SubagentState.COMPLETED:
6584
6603
  headerText = "Agent Completed";
6585
6604
  break;
6586
- case "cancelled" /* CANCELLED */:
6605
+ case SubagentState.CANCELLED:
6587
6606
  headerText = "Agent Cancelled";
6588
6607
  break;
6589
- case "error" /* ERROR */:
6608
+ case SubagentState.ERROR:
6590
6609
  headerText = "Agent Error";
6591
6610
  break;
6592
6611
  default:
@@ -6602,8 +6621,8 @@ var SubagentGroupDisplay = ({
6602
6621
  for (const tc of toolCalls) {
6603
6622
  const progress = tc.resultDisplay;
6604
6623
  if (isSubagentProgress(progress)) {
6605
- if (progress.state === "completed" /* COMPLETED */) completedCount++;
6606
- else if (progress.state === "running" /* RUNNING */) runningCount++;
6624
+ if (progress.state === SubagentState.COMPLETED) completedCount++;
6625
+ else if (progress.state === SubagentState.RUNNING) runningCount++;
6607
6626
  } else {
6608
6627
  runningCount++;
6609
6628
  }
@@ -6682,7 +6701,7 @@ var SubagentGroupDisplay = ({
6682
6701
  if (!isExpanded) {
6683
6702
  let content = "Starting...";
6684
6703
  let formattedArgs;
6685
- if (progress.state === "completed" /* COMPLETED */) {
6704
+ if (progress.state === SubagentState.COMPLETED) {
6686
6705
  if (progress.terminateReason && progress.terminateReason !== "GOAL") {
6687
6706
  content = `Finished Early (${progress.terminateReason})`;
6688
6707
  } else {
@@ -6696,17 +6715,17 @@ var SubagentGroupDisplay = ({
6696
6715
  formattedArgs = formatToolArgs(lastActivity.args);
6697
6716
  }
6698
6717
  }
6699
- const displayArgs = progress.state === "completed" /* COMPLETED */ ? "" : formattedArgs;
6718
+ const displayArgs = progress.state === SubagentState.COMPLETED ? "" : formattedArgs;
6700
6719
  const renderStatusIcon = () => {
6701
- const state = progress.state ?? "running" /* RUNNING */;
6720
+ const state = progress.state ?? SubagentState.RUNNING;
6702
6721
  switch (state) {
6703
- case "running" /* RUNNING */:
6722
+ case SubagentState.RUNNING:
6704
6723
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: "!" });
6705
- case "completed" /* COMPLETED */:
6724
+ case SubagentState.COMPLETED:
6706
6725
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.status.success, children: "\u2713" });
6707
- case "cancelled" /* CANCELLED */:
6726
+ case SubagentState.CANCELLED:
6708
6727
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.status.warning, children: "\u2139" });
6709
- case "error" /* ERROR */:
6728
+ case SubagentState.ERROR:
6710
6729
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.status.error, children: "\u2717" });
6711
6730
  default:
6712
6731
  return checkExhaustive(state);
@@ -6759,22 +6778,22 @@ var hasPayload = (res) => {
6759
6778
  function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerminalHeight, isClickable) {
6760
6779
  const added = (diff.diffStat?.model_added_lines ?? 0) + (diff.diffStat?.user_added_lines ?? 0);
6761
6780
  const removed = (diff.diffStat?.model_removed_lines ?? 0) + (diff.diffStat?.user_removed_lines ?? 0);
6762
- const isAcceptedOrConfirming = status === "success" /* Success */ || status === "executing" /* Executing */ || status === "awaiting_approval" /* AwaitingApproval */;
6781
+ const isAcceptedOrConfirming = status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing || status === CoreToolCallStatus.AwaitingApproval;
6763
6782
  const addColor = isAcceptedOrConfirming ? theme.status.success : theme.text.secondary;
6764
6783
  const removeColor = isAcceptedOrConfirming ? theme.status.error : theme.text.secondary;
6765
6784
  const showDiffStat = !!diff.diffStat;
6766
6785
  const description = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { flexDirection: "row", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.text.secondary, wrap: "truncate-end", children: diff.fileName }) });
6767
6786
  let resultSummary = "";
6768
6787
  let resultColor = theme.text.secondary;
6769
- if (status === "awaiting_approval" /* AwaitingApproval */) {
6788
+ if (status === CoreToolCallStatus.AwaitingApproval) {
6770
6789
  resultSummary = "Confirming";
6771
- } else if (status === "success" /* Success */ || status === "executing" /* Executing */) {
6790
+ } else if (status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing) {
6772
6791
  resultSummary = "Accepted";
6773
6792
  resultColor = theme.text.accent;
6774
- } else if (status === "cancelled" /* Cancelled */) {
6793
+ } else if (status === CoreToolCallStatus.Cancelled) {
6775
6794
  resultSummary = "Rejected";
6776
6795
  resultColor = theme.status.error;
6777
- } else if (status === "error" /* Error */) {
6796
+ } else if (status === CoreToolCallStatus.Error) {
6778
6797
  resultSummary = typeof resultDisplay === "string" ? resultDisplay : "Failed";
6779
6798
  resultColor = theme.status.error;
6780
6799
  }
@@ -6805,7 +6824,7 @@ function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerm
6805
6824
  filename: diff.fileName,
6806
6825
  terminalWidth: Math.max(0, (terminalWidth || 0) - PAYLOAD_MARGIN_LEFT),
6807
6826
  availableTerminalHeight,
6808
- disableColor: status === "cancelled" /* Cancelled */
6827
+ disableColor: status === CoreToolCallStatus.Cancelled
6809
6828
  }
6810
6829
  );
6811
6830
  return { description, summary, payload };
@@ -6933,10 +6952,10 @@ var DenseToolMessage = (props) => {
6933
6952
  if (isGrepResult(resultDisplay)) {
6934
6953
  return getGenericSuccessData(resultDisplay, originalDescription);
6935
6954
  }
6936
- if (status === "success" /* Success */ && resultDisplay) {
6955
+ if (status === CoreToolCallStatus.Success && resultDisplay) {
6937
6956
  return getGenericSuccessData(resultDisplay, originalDescription);
6938
6957
  }
6939
- if (status === "error" /* Error */) {
6958
+ if (status === CoreToolCallStatus.Error) {
6940
6959
  const text = typeof resultDisplay === "string" ? resultDisplay.replace(/\n/g, " ") : "Failed";
6941
6960
  const errorSummary = /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Text, { color: theme.status.error, wrap: "truncate-end", children: [
6942
6961
  "\u2192 ",
@@ -6977,7 +6996,7 @@ var DenseToolMessage = (props) => {
6977
6996
  language: fileExtension,
6978
6997
  maxWidth: Math.max(0, (terminalWidth || 0) - PAYLOAD_MARGIN_LEFT),
6979
6998
  settings,
6980
- disableColor: status === "cancelled" /* Cancelled */,
6999
+ disableColor: status === CoreToolCallStatus.Cancelled,
6981
7000
  returnLines: true
6982
7001
  });
6983
7002
  } else {
@@ -6985,7 +7004,7 @@ var DenseToolMessage = (props) => {
6985
7004
  parsedLines,
6986
7005
  filename: diff.fileName,
6987
7006
  terminalWidth: Math.max(0, (terminalWidth || 0) - PAYLOAD_MARGIN_LEFT),
6988
- disableColor: status === "cancelled" /* Cancelled */
7007
+ disableColor: status === CoreToolCallStatus.Cancelled
6989
7008
  });
6990
7009
  }
6991
7010
  }, [diff, isExpanded, isAlternateBuffer, terminalWidth, settings, status]);
@@ -7122,7 +7141,7 @@ function isToolExecuting(pendingHistoryItems) {
7122
7141
  return pendingHistoryItems.some((item) => {
7123
7142
  if (item && item.type === "tool_group") {
7124
7143
  return item.tools.some(
7125
- (tool) => "executing" /* Executing */ === tool.status
7144
+ (tool) => CoreToolCallStatus.Executing === tool.status
7126
7145
  );
7127
7146
  }
7128
7147
  return false;
@@ -7131,7 +7150,7 @@ function isToolExecuting(pendingHistoryItems) {
7131
7150
  function isToolAwaitingConfirmation(pendingHistoryItems) {
7132
7151
  return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
7133
7152
  (item) => item.tools.some(
7134
- (tool) => "awaiting_approval" /* AwaitingApproval */ === tool.status
7153
+ (tool) => CoreToolCallStatus.AwaitingApproval === tool.status
7135
7154
  )
7136
7155
  );
7137
7156
  }
@@ -7219,7 +7238,7 @@ var ToolGroupMessage = ({
7219
7238
  const groupedTools = (0, import_react19.useMemo)(() => {
7220
7239
  const groups = [];
7221
7240
  for (const tool of visibleToolCalls) {
7222
- if (tool.kind === "agent" /* Agent */) {
7241
+ if (tool.kind === Kind.Agent) {
7223
7242
  const lastGroup = groups[groups.length - 1];
7224
7243
  if (Array.isArray(lastGroup)) {
7225
7244
  lastGroup.push(tool);
@@ -7274,7 +7293,7 @@ var ToolGroupMessage = ({
7274
7293
  }, [groupedTools, isCompactModeEnabled, borderTopOverride]);
7275
7294
  let countToolCallsWithResults = 0;
7276
7295
  for (const tool of visibleToolCalls) {
7277
- if (tool.kind !== "agent" /* Agent */) {
7296
+ if (tool.kind !== Kind.Agent) {
7278
7297
  if (isCompactTool(tool, isCompactModeEnabled)) {
7279
7298
  if (hasDensePayload(tool)) {
7280
7299
  countToolCallsWithResults++;
@@ -7465,7 +7484,7 @@ var ToolGroupDisplay = ({
7465
7484
  }
7466
7485
  const { tools, borderColor, borderDimColor, borderTop, borderBottom } = item;
7467
7486
  const visibleTools = tools.filter(
7468
- (t) => t.status !== "awaiting_approval" /* AwaitingApproval */
7487
+ (t) => t.status !== CoreToolCallStatus.AwaitingApproval
7469
7488
  );
7470
7489
  const noticeTools = visibleTools.filter((t) => t.format === "notice");
7471
7490
  const otherTools = visibleTools.filter(
@@ -7667,18 +7686,18 @@ function CompressionMessage({
7667
7686
  return "Compressing chat history";
7668
7687
  }
7669
7688
  switch (compressionStatus) {
7670
- case 1 /* COMPRESSED */:
7689
+ case CompressionStatus.COMPRESSED:
7671
7690
  return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
7672
- case 2 /* COMPRESSION_FAILED_INFLATED_TOKEN_COUNT */:
7691
+ case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
7673
7692
  if (originalTokens < 5e4) {
7674
7693
  return "Compression was not beneficial for this history size.";
7675
7694
  }
7676
7695
  return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
7677
- case 3 /* COMPRESSION_FAILED_TOKEN_COUNT_ERROR */:
7696
+ case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
7678
7697
  return "Could not compress chat history due to a token counting error.";
7679
- case 4 /* COMPRESSION_FAILED_EMPTY_SUMMARY */:
7698
+ case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
7680
7699
  return "Chat history compression failed: the model returned an empty summary.";
7681
- case 5 /* NOOP */:
7700
+ case CompressionStatus.NOOP:
7682
7701
  return "Nothing to compress.";
7683
7702
  default:
7684
7703
  return "";
@@ -8116,8 +8135,8 @@ var ModelUsageTable = ({ models }) => {
8116
8135
  );
8117
8136
  roleEntries.sort(([a], [b]) => {
8118
8137
  if (a === b) return 0;
8119
- if (a === "main" /* MAIN */) return -1;
8120
- if (b === "main" /* MAIN */) return 1;
8138
+ if (a === LlmRole.MAIN) return -1;
8139
+ if (b === LlmRole.MAIN) return 1;
8121
8140
  return a.localeCompare(b);
8122
8141
  });
8123
8142
  roleEntries.forEach(([role, roleMetrics]) => {
@@ -8448,8 +8467,8 @@ var ModelStatsDisplay = ({
8448
8467
  return validRoles.includes(role);
8449
8468
  }).sort((a, b) => {
8450
8469
  if (a === b) return 0;
8451
- if (a === "main" /* MAIN */) return -1;
8452
- if (b === "main" /* MAIN */) return 1;
8470
+ if (a === LlmRole.MAIN) return -1;
8471
+ if (b === LlmRole.MAIN) return 1;
8453
8472
  return a.localeCompare(b);
8454
8473
  });
8455
8474
  const createRow = (metric, getValue, options = {}) => {
@@ -9240,7 +9259,7 @@ var McpStatus = ({
9240
9259
  );
9241
9260
  const originalStatus = serverStatus(serverName);
9242
9261
  const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
9243
- const status = originalStatus === "disconnected" /* DISCONNECTED */ && hasCachedItems ? "connected" /* CONNECTED */ : originalStatus;
9262
+ const status = originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems ? MCPServerStatus.CONNECTED : originalStatus;
9244
9263
  let statusIndicator = "";
9245
9264
  let statusText = "";
9246
9265
  let statusColor = theme.text.primary;
@@ -9252,17 +9271,17 @@ var McpStatus = ({
9252
9271
  statusColor = theme.text.secondary;
9253
9272
  } else {
9254
9273
  switch (status) {
9255
- case "connected" /* CONNECTED */:
9274
+ case MCPServerStatus.CONNECTED:
9256
9275
  statusIndicator = "\u{1F7E2}";
9257
9276
  statusText = "Ready";
9258
9277
  statusColor = theme.status.success;
9259
9278
  break;
9260
- case "connecting" /* CONNECTING */:
9279
+ case MCPServerStatus.CONNECTING:
9261
9280
  statusIndicator = "\u{1F504}";
9262
9281
  statusText = "Starting... (first startup may take longer)";
9263
9282
  statusColor = theme.status.warning;
9264
9283
  break;
9265
- case "disconnected" /* DISCONNECTED */:
9284
+ case MCPServerStatus.DISCONNECTED:
9266
9285
  default:
9267
9286
  statusIndicator = "\u{1F534}";
9268
9287
  statusText = "Disconnected";
@@ -9310,12 +9329,12 @@ var McpStatus = ({
9310
9329
  /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Text, { children: [
9311
9330
  " - ",
9312
9331
  statusText,
9313
- status === "connected" /* CONNECTED */ && parts.length > 0 && ` (${parts.join(", ")})`
9332
+ status === MCPServerStatus.CONNECTED && parts.length > 0 && ` (${parts.join(", ")})`
9314
9333
  ] }),
9315
9334
  authStatusNode
9316
9335
  ] }),
9317
- status === "connecting" /* CONNECTING */ && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
9318
- status === "disconnected" /* DISCONNECTED */ && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Text, { children: [
9336
+ status === MCPServerStatus.CONNECTING && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
9337
+ status === MCPServerStatus.DISCONNECTED && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Text, { children: [
9319
9338
  " (",
9320
9339
  toolCount,
9321
9340
  " tools cached)"
@@ -9876,7 +9895,7 @@ var Notifications = () => {
9876
9895
  if (dismissed) return [];
9877
9896
  const counts = persistentState.get("startupWarningCounts") || {};
9878
9897
  return startupWarnings.filter((w) => {
9879
- if (w.priority === "low" /* Low */) {
9898
+ if (w.priority === WarningPriority.Low) {
9880
9899
  const count = counts[w.id] || 0;
9881
9900
  return count < MAX_STARTUP_WARNING_SHOW_COUNT;
9882
9901
  }
@@ -9889,7 +9908,7 @@ var Notifications = () => {
9889
9908
  const counts = { ...persistentState.get("startupWarningCounts") || {} };
9890
9909
  let changed = false;
9891
9910
  visibleWarnings.forEach((w) => {
9892
- if (w.priority === "low" /* Low */) {
9911
+ if (w.priority === WarningPriority.Low) {
9893
9912
  counts[w.id] = (counts[w.id] || 0) + 1;
9894
9913
  changed = true;
9895
9914
  }
@@ -9996,7 +10015,7 @@ var UserIdentity = ({ config }) => {
9996
10015
  }
9997
10016
  return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Box_default, { flexDirection: "column", children: [
9998
10017
  /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Box_default, { children: [
9999
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Text, { children: [
10018
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType === AuthType.LOGIN_WITH_GOOGLE ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Text, { children: [
10000
10019
  /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Text, { bold: true, children: [
10001
10020
  "Signed in with Google",
10002
10021
  email ? ":" : ""
@@ -10239,7 +10258,7 @@ var import_react30 = __toESM(require_react(), 1);
10239
10258
  function getConfirmingToolState(pendingHistoryItems) {
10240
10259
  const allPendingTools = getAllToolCalls(pendingHistoryItems);
10241
10260
  const confirmingTools = allPendingTools.filter(
10242
- (tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
10261
+ (tool) => tool.status === CoreToolCallStatus.AwaitingApproval
10243
10262
  );
10244
10263
  if (confirmingTools.length === 0) {
10245
10264
  return null;
@@ -11549,7 +11568,7 @@ var ExitPlanModeDialog = ({
11549
11568
  {
11550
11569
  questions: [
11551
11570
  {
11552
- type: "choice" /* CHOICE */,
11571
+ type: QuestionType.CHOICE,
11553
11572
  header: "Approval",
11554
11573
  question: planContent,
11555
11574
  options: [
@@ -11570,9 +11589,9 @@ var ExitPlanModeDialog = ({
11570
11589
  onSubmit: (answers) => {
11571
11590
  const answer = answers["0"];
11572
11591
  if (answer === "Yes, automatically accept edits" /* Auto */) {
11573
- onApprove("autoEdit" /* AUTO_EDIT */);
11592
+ onApprove(ApprovalMode.AUTO_EDIT);
11574
11593
  } else if (answer === "Yes, manually accept edits" /* Manual */) {
11575
- onApprove("default" /* DEFAULT */);
11594
+ onApprove(ApprovalMode.DEFAULT);
11576
11595
  } else if (answer) {
11577
11596
  onFeedback(answer);
11578
11597
  }
@@ -11784,7 +11803,7 @@ ${deceptiveUrlWarnings.map(
11784
11803
  );
11785
11804
  (0, import_react35.useEffect)(() => {
11786
11805
  if (isCancelling) {
11787
- handleConfirm("cancel" /* Cancel */);
11806
+ handleConfirm(ToolConfirmationOutcome.Cancel);
11788
11807
  }
11789
11808
  }, [isCancelling, handleConfirm]);
11790
11809
  const handleSelect = (0, import_react35.useCallback)(
@@ -11797,19 +11816,19 @@ ${deceptiveUrlWarnings.map(
11797
11816
  if (!confirmationDetails.isModifying) {
11798
11817
  options2.push({
11799
11818
  label: "Allow once",
11800
- value: "proceed_once" /* ProceedOnce */,
11819
+ value: ToolConfirmationOutcome.ProceedOnce,
11801
11820
  key: "Allow once"
11802
11821
  });
11803
11822
  if (isTrustedFolder && !confirmationDetails.isBuildFile) {
11804
11823
  options2.push({
11805
11824
  label: "Allow for this session",
11806
- value: "proceed_always" /* ProceedAlways */,
11825
+ value: ToolConfirmationOutcome.ProceedAlways,
11807
11826
  key: "Allow for this session"
11808
11827
  });
11809
11828
  if (allowPermanentApproval) {
11810
11829
  options2.push({
11811
11830
  label: "Allow for this file in all future sessions",
11812
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
11831
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
11813
11832
  key: "Allow for this file in all future sessions"
11814
11833
  });
11815
11834
  }
@@ -11817,45 +11836,45 @@ ${deceptiveUrlWarnings.map(
11817
11836
  if (!config.getIdeMode() || !isDiffingEnabled) {
11818
11837
  options2.push({
11819
11838
  label: "Modify with external editor",
11820
- value: "modify_with_editor" /* ModifyWithEditor */,
11839
+ value: ToolConfirmationOutcome.ModifyWithEditor,
11821
11840
  key: "Modify with external editor"
11822
11841
  });
11823
11842
  }
11824
11843
  options2.push({
11825
11844
  label: "No, suggest changes (esc)",
11826
- value: "cancel" /* Cancel */,
11845
+ value: ToolConfirmationOutcome.Cancel,
11827
11846
  key: "No, suggest changes (esc)"
11828
11847
  });
11829
11848
  }
11830
11849
  } else if (confirmationDetails.type === "sandbox_expansion") {
11831
11850
  options2.push({
11832
11851
  label: "Allow once",
11833
- value: "proceed_once" /* ProceedOnce */,
11852
+ value: ToolConfirmationOutcome.ProceedOnce,
11834
11853
  key: "Allow once"
11835
11854
  });
11836
11855
  if (isTrustedFolder) {
11837
11856
  options2.push({
11838
11857
  label: "Allow for this session",
11839
- value: "proceed_always" /* ProceedAlways */,
11858
+ value: ToolConfirmationOutcome.ProceedAlways,
11840
11859
  key: "Allow for this session"
11841
11860
  });
11842
11861
  if (allowPermanentApproval) {
11843
11862
  options2.push({
11844
11863
  label: "Allow for all future sessions",
11845
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
11864
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
11846
11865
  key: "Allow for all future sessions"
11847
11866
  });
11848
11867
  }
11849
11868
  }
11850
11869
  options2.push({
11851
11870
  label: "No, suggest changes (esc)",
11852
- value: "cancel" /* Cancel */,
11871
+ value: ToolConfirmationOutcome.Cancel,
11853
11872
  key: "No, suggest changes (esc)"
11854
11873
  });
11855
11874
  } else if (confirmationDetails.type === "exec") {
11856
11875
  options2.push({
11857
11876
  label: "Allow once",
11858
- value: "proceed_once" /* ProceedOnce */,
11877
+ value: ToolConfirmationOutcome.ProceedOnce,
11859
11878
  key: "Allow once"
11860
11879
  });
11861
11880
  const hasUntrustedFlags = confirmationDetails.untrustedFlags && confirmationDetails.untrustedFlags.length > 0;
@@ -11863,75 +11882,75 @@ ${deceptiveUrlWarnings.map(
11863
11882
  if (isTrustedFolder && !hasUntrustedFlags && !hasModifiedBuildFiles) {
11864
11883
  options2.push({
11865
11884
  label: `Allow for this session`,
11866
- value: "proceed_always" /* ProceedAlways */,
11885
+ value: ToolConfirmationOutcome.ProceedAlways,
11867
11886
  key: `Allow for this session`
11868
11887
  });
11869
11888
  if (allowPermanentApproval) {
11870
11889
  options2.push({
11871
11890
  label: `Allow this command for all future sessions`,
11872
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
11891
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
11873
11892
  key: `Allow for all future sessions`
11874
11893
  });
11875
11894
  }
11876
11895
  }
11877
11896
  options2.push({
11878
11897
  label: "No, suggest changes (esc)",
11879
- value: "cancel" /* Cancel */,
11898
+ value: ToolConfirmationOutcome.Cancel,
11880
11899
  key: "No, suggest changes (esc)"
11881
11900
  });
11882
11901
  } else if (confirmationDetails.type === "info") {
11883
11902
  options2.push({
11884
11903
  label: "Allow once",
11885
- value: "proceed_once" /* ProceedOnce */,
11904
+ value: ToolConfirmationOutcome.ProceedOnce,
11886
11905
  key: "Allow once"
11887
11906
  });
11888
11907
  if (isTrustedFolder) {
11889
11908
  options2.push({
11890
11909
  label: "Allow for this session",
11891
- value: "proceed_always" /* ProceedAlways */,
11910
+ value: ToolConfirmationOutcome.ProceedAlways,
11892
11911
  key: "Allow for this session"
11893
11912
  });
11894
11913
  if (allowPermanentApproval) {
11895
11914
  options2.push({
11896
11915
  label: "Allow for all future sessions",
11897
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
11916
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
11898
11917
  key: "Allow for all future sessions"
11899
11918
  });
11900
11919
  }
11901
11920
  }
11902
11921
  options2.push({
11903
11922
  label: "No, suggest changes (esc)",
11904
- value: "cancel" /* Cancel */,
11923
+ value: ToolConfirmationOutcome.Cancel,
11905
11924
  key: "No, suggest changes (esc)"
11906
11925
  });
11907
11926
  } else if (confirmationDetails.type === "mcp") {
11908
11927
  options2.push({
11909
11928
  label: "Allow once",
11910
- value: "proceed_once" /* ProceedOnce */,
11929
+ value: ToolConfirmationOutcome.ProceedOnce,
11911
11930
  key: "Allow once"
11912
11931
  });
11913
11932
  if (isTrustedFolder) {
11914
11933
  options2.push({
11915
11934
  label: "Allow tool for this session",
11916
- value: "proceed_always_tool" /* ProceedAlwaysTool */,
11935
+ value: ToolConfirmationOutcome.ProceedAlwaysTool,
11917
11936
  key: "Allow tool for this session"
11918
11937
  });
11919
11938
  options2.push({
11920
11939
  label: "Allow all server tools for this session",
11921
- value: "proceed_always_server" /* ProceedAlwaysServer */,
11940
+ value: ToolConfirmationOutcome.ProceedAlwaysServer,
11922
11941
  key: "Allow all server tools for this session"
11923
11942
  });
11924
11943
  if (allowPermanentApproval) {
11925
11944
  options2.push({
11926
11945
  label: "Allow tool for all future sessions",
11927
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
11946
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
11928
11947
  key: "Allow tool for all future sessions"
11929
11948
  });
11930
11949
  }
11931
11950
  }
11932
11951
  options2.push({
11933
11952
  label: "No, suggest changes (esc)",
11934
- value: "cancel" /* Cancel */,
11953
+ value: ToolConfirmationOutcome.Cancel,
11935
11954
  key: "No, suggest changes (esc)"
11936
11955
  });
11937
11956
  }
@@ -11972,7 +11991,7 @@ ${deceptiveUrlWarnings.map(
11972
11991
  const containsRedirection = commandsToDisplay.some(
11973
11992
  (cmd) => hasRedirection(cmd)
11974
11993
  );
11975
- const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
11994
+ const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
11976
11995
  if (containsRedirection && !isAutoEdit) {
11977
11996
  extraInfoLines = 1;
11978
11997
  }
@@ -11999,7 +12018,7 @@ ${deceptiveUrlWarnings.map(
11999
12018
  const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
12000
12019
  if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
12001
12020
  const alwaysAndSaveIndex = options2.findIndex(
12002
- (o) => o.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */
12021
+ (o) => o.value === ToolConfirmationOutcome.ProceedAlwaysAndSave
12003
12022
  );
12004
12023
  if (alwaysAndSaveIndex !== -1) {
12005
12024
  initialIndex2 = alwaysAndSaveIndex;
@@ -12048,10 +12067,10 @@ Ensure you trust all modifications made to build files before approving executio
12048
12067
  {
12049
12068
  questions: confirmationDetails.questions,
12050
12069
  onSubmit: (answers) => {
12051
- handleConfirm("proceed_once" /* ProceedOnce */, { answers });
12070
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, { answers });
12052
12071
  },
12053
12072
  onCancel: () => {
12054
- handleConfirm("cancel" /* Cancel */);
12073
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12055
12074
  },
12056
12075
  width: safeTerminalWidth,
12057
12076
  availableHeight: bodyHeight
@@ -12072,19 +12091,19 @@ Ensure you trust all modifications made to build files before approving executio
12072
12091
  planPath: confirmationDetails.planPath,
12073
12092
  getPreferredEditor,
12074
12093
  onApprove: (approvalMode) => {
12075
- handleConfirm("proceed_once" /* ProceedOnce */, {
12094
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
12076
12095
  approved: true,
12077
12096
  approvalMode
12078
12097
  });
12079
12098
  },
12080
12099
  onFeedback: (feedback) => {
12081
- handleConfirm("proceed_once" /* ProceedOnce */, {
12100
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
12082
12101
  approved: false,
12083
12102
  feedback
12084
12103
  });
12085
12104
  },
12086
12105
  onCancel: () => {
12087
- handleConfirm("cancel" /* Cancel */);
12106
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12088
12107
  },
12089
12108
  width: safeTerminalWidth,
12090
12109
  availableHeight: bodyHeight
@@ -12194,7 +12213,7 @@ Ensure you trust all modifications made to build files before approving executio
12194
12213
  const containsRedirection = commandsToDisplay.some(
12195
12214
  (cmd) => hasRedirection(cmd)
12196
12215
  );
12197
- const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
12216
+ const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
12198
12217
  let warnings = null;
12199
12218
  if (containsRedirection && !isAutoEdit) {
12200
12219
  const tipText = `To auto-accept, press ${formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */)}`;
@@ -12353,7 +12372,7 @@ Ensure you trust all modifications made to build files before approving executio
12353
12372
  const bodyOverflowDirection = confirmationDetails.type === "mcp" && isMcpToolDetailsExpanded ? "bottom" : "top";
12354
12373
  const renderRadioItem = (0, import_react35.useCallback)(
12355
12374
  (item, { titleColor }) => {
12356
- if (item.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */) {
12375
+ if (item.value === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
12357
12376
  return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Text, { color: titleColor, wrap: "truncate", children: [
12358
12377
  item.label,
12359
12378
  " ",
@@ -12742,7 +12761,7 @@ var MainContent = () => {
12742
12761
  const hasConfirmationQueue = Boolean(
12743
12762
  showConfirmationQueue && confirmingTool
12744
12763
  );
12745
- const isVisiblePendingItem = (item) => item.type !== "tool_group" || item.tools.some((t) => t.status !== "awaiting_approval" /* AwaitingApproval */);
12764
+ const isVisiblePendingItem = (item) => item.type !== "tool_group" || item.tools.some((t) => t.status !== CoreToolCallStatus.AwaitingApproval);
12746
12765
  const visiblePendingCount = pendingHistoryItems.filter(isVisiblePendingItem).length;
12747
12766
  const shouldPartitionHeight = !isAlternateBufferOrTerminalBuffer && hasConfirmationQueue && visiblePendingCount > 0;
12748
12767
  const pendingCount = Math.max(1, visiblePendingCount);
@@ -14446,7 +14465,7 @@ async function validateAuthMethodWithSettings(authType, settings) {
14446
14465
  if (settings.merged.security.auth.useExternal) {
14447
14466
  return null;
14448
14467
  }
14449
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14468
+ if (authType === AuthType.USE_GEMINI) {
14450
14469
  return null;
14451
14470
  }
14452
14471
  return validateAuthMethod(authType);
@@ -14498,7 +14517,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
14498
14517
  }
14499
14518
  return;
14500
14519
  }
14501
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14520
+ if (authType === AuthType.USE_GEMINI) {
14502
14521
  const key = await reloadApiKey();
14503
14522
  if (!key) {
14504
14523
  setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
@@ -14576,31 +14595,31 @@ function AuthDialog({
14576
14595
  let items = [
14577
14596
  {
14578
14597
  label: "Sign in with Google",
14579
- value: "oauth-personal" /* LOGIN_WITH_GOOGLE */,
14580
- key: "oauth-personal" /* LOGIN_WITH_GOOGLE */
14598
+ value: AuthType.LOGIN_WITH_GOOGLE,
14599
+ key: AuthType.LOGIN_WITH_GOOGLE
14581
14600
  },
14582
14601
  ...process.env["CLOUD_SHELL"] === "true" ? [
14583
14602
  {
14584
14603
  label: "Use Cloud Shell user credentials",
14585
- value: "compute-default-credentials" /* COMPUTE_ADC */,
14586
- key: "compute-default-credentials" /* COMPUTE_ADC */
14604
+ value: AuthType.COMPUTE_ADC,
14605
+ key: AuthType.COMPUTE_ADC
14587
14606
  }
14588
14607
  ] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
14589
14608
  {
14590
14609
  label: "Use metadata server application default credentials",
14591
- value: "compute-default-credentials" /* COMPUTE_ADC */,
14592
- key: "compute-default-credentials" /* COMPUTE_ADC */
14610
+ value: AuthType.COMPUTE_ADC,
14611
+ key: AuthType.COMPUTE_ADC
14593
14612
  }
14594
14613
  ] : [],
14595
14614
  {
14596
14615
  label: "Use Gemini API Key",
14597
- value: "gemini-api-key" /* USE_GEMINI */,
14598
- key: "gemini-api-key" /* USE_GEMINI */
14616
+ value: AuthType.USE_GEMINI,
14617
+ key: AuthType.USE_GEMINI
14599
14618
  },
14600
14619
  {
14601
14620
  label: "Vertex AI",
14602
- value: "vertex-ai" /* USE_VERTEX_AI */,
14603
- key: "vertex-ai" /* USE_VERTEX_AI */
14621
+ value: AuthType.USE_VERTEX_AI,
14622
+ key: AuthType.USE_VERTEX_AI
14604
14623
  }
14605
14624
  ];
14606
14625
  if (settings.merged.security.auth.enforcedType) {
@@ -14622,9 +14641,9 @@ function AuthDialog({
14622
14641
  return item.value === defaultAuthType;
14623
14642
  }
14624
14643
  if (process.env["GEMINI_API_KEY"]) {
14625
- return item.value === "gemini-api-key" /* USE_GEMINI */;
14644
+ return item.value === AuthType.USE_GEMINI;
14626
14645
  }
14627
- return item.value === "oauth-personal" /* LOGIN_WITH_GOOGLE */;
14646
+ return item.value === AuthType.LOGIN_WITH_GOOGLE;
14628
14647
  });
14629
14648
  if (settings.merged.security.auth.enforcedType) {
14630
14649
  initialAuthIndex = 0;
@@ -14635,7 +14654,7 @@ function AuthDialog({
14635
14654
  return;
14636
14655
  }
14637
14656
  if (authType) {
14638
- const needsRestart = authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ || authType === "vertex-ai" /* USE_VERTEX_AI */ && process.env["CLOUD_SHELL"] === "true";
14657
+ const needsRestart = authType === AuthType.LOGIN_WITH_GOOGLE || authType === AuthType.USE_VERTEX_AI && process.env["CLOUD_SHELL"] === "true";
14639
14658
  if (needsRestart) {
14640
14659
  setAuthContext({ requiresRestart: true });
14641
14660
  } else {
@@ -14646,7 +14665,7 @@ function AuthDialog({
14646
14665
  await clearCachedCredentialFile();
14647
14666
  }
14648
14667
  settings.setValue(scope, "security.auth.selectedType", authType);
14649
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
14668
+ if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
14650
14669
  setExiting(true);
14651
14670
  setTimeout(() => {
14652
14671
  void relaunchApp({ overrideAuthType: authType }).catch((err) => {
@@ -14656,7 +14675,7 @@ function AuthDialog({
14656
14675
  }, 100);
14657
14676
  return;
14658
14677
  }
14659
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14678
+ if (authType === AuthType.USE_GEMINI) {
14660
14679
  setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
14661
14680
  return;
14662
14681
  }
@@ -15463,11 +15482,11 @@ var PrivacyNoticeText = ({
15463
15482
  }) => {
15464
15483
  const authType = config.getContentGeneratorConfig()?.authType;
15465
15484
  switch (authType) {
15466
- case "gemini-api-key" /* USE_GEMINI */:
15485
+ case AuthType.USE_GEMINI:
15467
15486
  return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(GeminiPrivacyNotice, { onExit });
15468
- case "vertex-ai" /* USE_VERTEX_AI */:
15487
+ case AuthType.USE_VERTEX_AI:
15469
15488
  return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(CloudPaidPrivacyNotice, { onExit });
15470
- case "oauth-personal" /* LOGIN_WITH_GOOGLE */:
15489
+ case AuthType.LOGIN_WITH_GOOGLE:
15471
15490
  default:
15472
15491
  return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(CloudFreePrivacyNotice, { config, onExit });
15473
15492
  }
@@ -15527,7 +15546,7 @@ function ProQuotaDialog({
15527
15546
  value: "retry_always",
15528
15547
  key: "retry_always"
15529
15548
  },
15530
- ...authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && !isUltra ? [
15549
+ ...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
15531
15550
  {
15532
15551
  label: "Upgrade for higher limits",
15533
15552
  value: "upgrade",
@@ -16694,7 +16713,7 @@ function ModelDialog({ onClose }) {
16694
16713
  const useLatestFlash = config?.hasLatestFlashGAAccess?.() ?? false;
16695
16714
  const useLatestFlashLite = config?.hasLatestFlashLiteGAAccess?.() ?? false;
16696
16715
  const selectedAuthType = settings.merged.security.auth.selectedType;
16697
- const useCustomToolModel = useGemini31 && selectedAuthType === "gemini-api-key" /* USE_GEMINI */;
16716
+ const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
16698
16717
  const manualModelSelected = (0, import_react53.useMemo)(() => {
16699
16718
  if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
16700
16719
  const def = config.getModelConfigService().getModelDefinition(preferredModel);
@@ -18022,10 +18041,10 @@ function initializeConsoleStore() {
18022
18041
  globalConsoleMessages = [];
18023
18042
  globalErrorCount = 0;
18024
18043
  notifyListeners();
18025
- coreEvents.off("console-log" /* ConsoleLog */, handleConsoleLog);
18026
- coreEvents.off("output" /* Output */, handleOutput);
18027
- coreEvents.on("console-log" /* ConsoleLog */, handleConsoleLog);
18028
- coreEvents.on("output" /* Output */, handleOutput);
18044
+ coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
18045
+ coreEvents.off(CoreEvent.Output, handleOutput);
18046
+ coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
18047
+ coreEvents.on(CoreEvent.Output, handleOutput);
18029
18048
  }
18030
18049
  function notifyListeners() {
18031
18050
  for (const listener of listeners) {
@@ -20162,7 +20181,7 @@ function usePromptCompletion({
20162
20181
  { model: "prompt-completion" },
20163
20182
  contents,
20164
20183
  signal,
20165
- "utility_autocomplete" /* UTILITY_AUTOCOMPLETE */
20184
+ LlmRole.UTILITY_AUTOCOMPLETE
20166
20185
  );
20167
20186
  if (signal.aborted) {
20168
20187
  return;
@@ -22241,9 +22260,9 @@ var InputPrompt = ({
22241
22260
  onSuggestionsVisibilityChange(shouldShowSuggestions);
22242
22261
  }
22243
22262
  }, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
22244
- const showAutoAcceptStyling = !shellModeActive && approvalMode === "autoEdit" /* AUTO_EDIT */;
22245
- const showYoloStyling = !shellModeActive && approvalMode === "yolo" /* YOLO */;
22246
- const showPlanStyling = !shellModeActive && approvalMode === "plan" /* PLAN */;
22263
+ const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
22264
+ const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
22265
+ const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
22247
22266
  let statusColor;
22248
22267
  let statusText = "";
22249
22268
  if (shellModeActive) {
@@ -23077,22 +23096,22 @@ var ApprovalModeIndicator = ({
23077
23096
  const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
23078
23097
  const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
23079
23098
  switch (approvalMode) {
23080
- case "autoEdit" /* AUTO_EDIT */:
23099
+ case ApprovalMode.AUTO_EDIT:
23081
23100
  textColor = theme.status.warning;
23082
23101
  textContent = "auto-accept edits";
23083
23102
  subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
23084
23103
  break;
23085
- case "plan" /* PLAN */:
23104
+ case ApprovalMode.PLAN:
23086
23105
  textColor = theme.status.success;
23087
23106
  textContent = "plan";
23088
23107
  subText = `${cycleHint} to manual`;
23089
23108
  break;
23090
- case "yolo" /* YOLO */:
23109
+ case ApprovalMode.YOLO:
23091
23110
  textColor = theme.status.error;
23092
23111
  textContent = "YOLO";
23093
23112
  subText = yoloHint;
23094
23113
  break;
23095
- case "default" /* DEFAULT */:
23114
+ case ApprovalMode.DEFAULT:
23096
23115
  default:
23097
23116
  textColor = theme.text.accent;
23098
23117
  textContent = "";
@@ -23140,7 +23159,7 @@ var useComposerStatus = () => {
23140
23159
  (item) => item.type === "tool_group"
23141
23160
  ).some(
23142
23161
  (item) => item.tools.some(
23143
- (tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
23162
+ (tool) => tool.status === CoreToolCallStatus.AwaitingApproval
23144
23163
  )
23145
23164
  ),
23146
23165
  [uiState.pendingHistoryItems]
@@ -23155,13 +23174,13 @@ var useComposerStatus = () => {
23155
23174
  const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
23156
23175
  if (hideMinimalModeHintWhileBusy) return null;
23157
23176
  switch (showApprovalModeIndicator) {
23158
- case "yolo" /* YOLO */:
23177
+ case ApprovalMode.YOLO:
23159
23178
  return { text: "YOLO", color: theme.status.error };
23160
- case "plan" /* PLAN */:
23179
+ case ApprovalMode.PLAN:
23161
23180
  return { text: "plan", color: theme.status.success };
23162
- case "autoEdit" /* AUTO_EDIT */:
23181
+ case ApprovalMode.AUTO_EDIT:
23163
23182
  return { text: "auto edit", color: theme.status.warning };
23164
- case "default" /* DEFAULT */:
23183
+ case ApprovalMode.DEFAULT:
23165
23184
  default:
23166
23185
  return null;
23167
23186
  }
@@ -23523,7 +23542,7 @@ var ConfigInitDisplay = ({
23523
23542
  let connected = 0;
23524
23543
  const connecting = [];
23525
23544
  for (const [name, client] of clients.entries()) {
23526
- if (client.getStatus() === "connected" /* CONNECTED */) {
23545
+ if (client.getStatus() === MCPServerStatus.CONNECTED) {
23527
23546
  connected++;
23528
23547
  } else {
23529
23548
  connecting.push(name);
@@ -23545,9 +23564,9 @@ var ConfigInitDisplay = ({
23545
23564
  );
23546
23565
  }
23547
23566
  };
23548
- coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
23567
+ coreEvents.on(CoreEvent.McpClientUpdate, onChange);
23549
23568
  return () => {
23550
- coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
23569
+ coreEvents.off(CoreEvent.McpClientUpdate, onChange);
23551
23570
  };
23552
23571
  }, [initialMessage]);
23553
23572
  return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Text, { children: [
@@ -24268,7 +24287,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
24268
24287
  callId,
24269
24288
  name: SHELL_COMMAND_NAME,
24270
24289
  description: rawQuery,
24271
- status: "executing" /* Executing */,
24290
+ status: CoreToolCallStatus.Executing,
24272
24291
  isClientInitiated: true,
24273
24292
  resultDisplay: "",
24274
24293
  confirmationDetails: void 0
@@ -24409,7 +24428,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
24409
24428
  mainContent = result.output.trim() || "(Command produced no output)";
24410
24429
  }
24411
24430
  let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
24412
- let finalStatus = "success" /* Success */;
24431
+ let finalStatus = CoreToolCallStatus.Success;
24413
24432
  const prependToAnsiOutput = (output, text) => {
24414
24433
  const newLines = text.split("\n").map((line) => [
24415
24434
  {
@@ -24428,20 +24447,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
24428
24447
  };
24429
24448
  let prefix = "";
24430
24449
  if (result.error) {
24431
- finalStatus = "error" /* Error */;
24450
+ finalStatus = CoreToolCallStatus.Error;
24432
24451
  prefix = result.error.message;
24433
24452
  } else if (result.aborted) {
24434
- finalStatus = "cancelled" /* Cancelled */;
24453
+ finalStatus = CoreToolCallStatus.Cancelled;
24435
24454
  prefix = "Command was cancelled.";
24436
24455
  } else if (result.backgrounded) {
24437
- finalStatus = "success" /* Success */;
24456
+ finalStatus = CoreToolCallStatus.Success;
24438
24457
  finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
24439
24458
  mainContent = finalOutput;
24440
24459
  } else if (result.signal) {
24441
- finalStatus = "error" /* Error */;
24460
+ finalStatus = CoreToolCallStatus.Error;
24442
24461
  prefix = `Command terminated by signal: ${result.signal}.`;
24443
24462
  } else if (result.exitCode !== 0) {
24444
- finalStatus = "error" /* Error */;
24463
+ finalStatus = CoreToolCallStatus.Error;
24445
24464
  prefix = `Command exited with code ${result.exitCode}.`;
24446
24465
  }
24447
24466
  if (prefix) {
@@ -24467,7 +24486,7 @@ ${mainContent}`;
24467
24486
  status: finalStatus,
24468
24487
  resultDisplay: finalOutput
24469
24488
  };
24470
- if (finalStatus !== "cancelled" /* Cancelled */) {
24489
+ if (finalStatus !== CoreToolCallStatus.Cancelled) {
24471
24490
  addItemToHistory(
24472
24491
  {
24473
24492
  type: "tool_group",
@@ -25477,13 +25496,13 @@ function useQuotaAndFallback({
25477
25496
  error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
25478
25497
  `/stats model for usage details`,
25479
25498
  `/model to switch models.`,
25480
- contentGeneratorConfig?.authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? `/auth to switch to API key.` : null
25499
+ contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
25481
25500
  ].filter(Boolean);
25482
25501
  message = messageLines.join("\n");
25483
25502
  }
25484
25503
  } else if (error instanceof ModelNotFoundError) {
25485
25504
  isModelNotFoundError = true;
25486
- if (contentGeneratorConfig?.authType === "vertex-ai" /* USE_VERTEX_AI */ && VALID_GEMINI_MODELS.has(failedModel)) {
25505
+ if (contentGeneratorConfig?.authType === AuthType.USE_VERTEX_AI && VALID_GEMINI_MODELS.has(failedModel)) {
25487
25506
  const location = process.env["GOOGLE_CLOUD_LOCATION"] || "your configured region";
25488
25507
  const messageLines = [
25489
25508
  `Model "${failedModel}" is not available in region "${location}".`,
@@ -25677,7 +25696,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
25677
25696
  );
25678
25697
  setEditorError(null);
25679
25698
  setIsEditorDialogOpen(false);
25680
- coreEvents.emit("editor-selected" /* EditorSelected */, { editor: editorType });
25699
+ coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
25681
25700
  } catch (error) {
25682
25701
  setEditorError(`Failed to set editor preference: ${error}`);
25683
25702
  }
@@ -25686,7 +25705,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
25686
25705
  );
25687
25706
  const exitEditorDialog = (0, import_react89.useCallback)(() => {
25688
25707
  setIsEditorDialogOpen(false);
25689
- coreEvents.emit("editor-selected" /* EditorSelected */, { editor: void 0 });
25708
+ coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
25690
25709
  }, []);
25691
25710
  return {
25692
25711
  isEditorDialogOpen,
@@ -26063,7 +26082,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26063
26082
  canonicalPath: resolvedCommandPath
26064
26083
  } = parseSlashCommand(trimmed, commands);
26065
26084
  if (!commandToExecute) {
26066
- const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === "in_progress" /* IN_PROGRESS */;
26085
+ const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
26067
26086
  if (isMcpLoading) {
26068
26087
  setIsProcessing(true);
26069
26088
  if (addToHistory) {
@@ -26243,7 +26262,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26243
26262
  onConfirm: async (resolvedOutcome) => {
26244
26263
  resolve3({
26245
26264
  outcome: resolvedOutcome,
26246
- approvedCommands: resolvedOutcome === "cancel" /* Cancel */ ? [] : result.commandsToConfirm
26265
+ approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
26247
26266
  });
26248
26267
  }
26249
26268
  };
@@ -26251,7 +26270,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26251
26270
  callId,
26252
26271
  name: "Expansion",
26253
26272
  description: "Command expansion needs shell access",
26254
- status: "awaiting_approval" /* AwaitingApproval */,
26273
+ status: CoreToolCallStatus.AwaitingApproval,
26255
26274
  isClientInitiated: true,
26256
26275
  resultDisplay: void 0,
26257
26276
  confirmationDetails
@@ -26262,7 +26281,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26262
26281
  });
26263
26282
  });
26264
26283
  setPendingItem(null);
26265
- if (outcome === "cancel" /* Cancel */ || !approvedCommands || approvedCommands.length === 0) {
26284
+ if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
26266
26285
  addItem(
26267
26286
  {
26268
26287
  type: "info" /* INFO */,
@@ -26272,7 +26291,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26272
26291
  );
26273
26292
  return { type: "handled" };
26274
26293
  }
26275
- if (outcome === "proceed_always" /* ProceedAlways */) {
26294
+ if (outcome === ToolConfirmationOutcome.ProceedAlways) {
26276
26295
  setSessionShellAllowlist(
26277
26296
  (prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
26278
26297
  );
@@ -26748,7 +26767,7 @@ function mapToDisplay(toolOrTools, options = {}) {
26748
26767
  let description;
26749
26768
  let renderOutputAsMarkdown = false;
26750
26769
  const displayName = call.tool?.displayName ?? call.request.name;
26751
- if (call.status === "error" /* Error */) {
26770
+ if (call.status === CoreToolCallStatus.Error) {
26752
26771
  description = JSON.stringify(call.request.args);
26753
26772
  } else {
26754
26773
  description = call.invocation.getDescription();
@@ -26771,27 +26790,27 @@ function mapToDisplay(toolOrTools, options = {}) {
26771
26790
  let progress = void 0;
26772
26791
  let progressTotal = void 0;
26773
26792
  switch (call.status) {
26774
- case "success" /* Success */:
26793
+ case CoreToolCallStatus.Success:
26775
26794
  resultDisplay = call.response.resultDisplay;
26776
26795
  outputFile = call.response.outputFile;
26777
26796
  break;
26778
- case "error" /* Error */:
26779
- case "cancelled" /* Cancelled */:
26797
+ case CoreToolCallStatus.Error:
26798
+ case CoreToolCallStatus.Cancelled:
26780
26799
  resultDisplay = call.response.resultDisplay;
26781
26800
  break;
26782
- case "awaiting_approval" /* AwaitingApproval */:
26801
+ case CoreToolCallStatus.AwaitingApproval:
26783
26802
  correlationId = call.correlationId;
26784
26803
  confirmationDetails = call.confirmationDetails;
26785
26804
  break;
26786
- case "executing" /* Executing */:
26805
+ case CoreToolCallStatus.Executing:
26787
26806
  resultDisplay = call.liveOutput;
26788
26807
  ptyId = call.pid;
26789
26808
  progressMessage = call.progressMessage;
26790
26809
  progress = call.progress;
26791
26810
  progressTotal = call.progressTotal;
26792
26811
  break;
26793
- case "scheduled" /* Scheduled */:
26794
- case "validating" /* Validating */:
26812
+ case CoreToolCallStatus.Scheduled:
26813
+ case CoreToolCallStatus.Validating:
26795
26814
  break;
26796
26815
  default: {
26797
26816
  const exhaustiveCheck = call;
@@ -26862,7 +26881,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26862
26881
  const handler = (event) => {
26863
26882
  const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
26864
26883
  const hasExecuting = event.toolCalls.some(
26865
- (tc) => tc.status === "executing" /* Executing */ || (tc.status === "success" /* Success */ || tc.status === "error" /* Error */) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
26884
+ (tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
26866
26885
  );
26867
26886
  if (hasExecuting) {
26868
26887
  setLastToolOutputTime(Date.now());
@@ -26871,7 +26890,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26871
26890
  const prevCalls = prev[event.schedulerId] ?? [];
26872
26891
  const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
26873
26892
  const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
26874
- (tc) => tc.status === "awaiting_approval" /* AwaitingApproval */ || prevCallIds.has(tc.request.callId)
26893
+ (tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
26875
26894
  );
26876
26895
  if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
26877
26896
  return prev;
@@ -26883,9 +26902,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26883
26902
  };
26884
26903
  });
26885
26904
  };
26886
- messageBus.subscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
26905
+ messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
26887
26906
  return () => {
26888
- messageBus.unsubscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
26907
+ messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
26889
26908
  };
26890
26909
  }, [messageBus, internalAdaptToolCalls]);
26891
26910
  (0, import_react96.useEffect)(() => {
@@ -26907,9 +26926,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26907
26926
  };
26908
26927
  });
26909
26928
  };
26910
- messageBus.subscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
26929
+ messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
26911
26930
  return () => {
26912
- messageBus.unsubscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
26931
+ messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
26913
26932
  };
26914
26933
  }, [messageBus]);
26915
26934
  const schedule = (0, import_react96.useCallback)(
@@ -27008,8 +27027,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
27008
27027
  const prev = prevMap.get(coreCall.request.callId);
27009
27028
  const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
27010
27029
  let status = coreCall.status;
27011
- if ((status === "success" /* Success */ || status === "error" /* Error */) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
27012
- status = "executing" /* Executing */;
27030
+ if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
27031
+ status = CoreToolCallStatus.Executing;
27013
27032
  }
27014
27033
  return {
27015
27034
  ...coreCall,
@@ -27041,7 +27060,7 @@ function getBackgroundedToolInfo(toolCall) {
27041
27060
  };
27042
27061
  }
27043
27062
  function isBackgroundableExecutingToolCall(toolCall) {
27044
- return toolCall.status === "executing" /* Executing */ && typeof toolCall.pid === "number";
27063
+ return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
27045
27064
  }
27046
27065
  function showCitations(settings) {
27047
27066
  const enabled = settings.merged.ui.showCitations;
@@ -27051,14 +27070,14 @@ function showCitations(settings) {
27051
27070
  return true;
27052
27071
  }
27053
27072
  function calculateStreamingState(isResponding, toolCalls) {
27054
- if (toolCalls.some((tc) => tc.status === "awaiting_approval" /* AwaitingApproval */)) {
27073
+ if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
27055
27074
  return "waiting_for_confirmation" /* WaitingForConfirmation */;
27056
27075
  }
27057
27076
  const isAnyToolActive = toolCalls.some((tc) => {
27058
- if (tc.status === "executing" /* Executing */ || tc.status === "scheduled" /* Scheduled */ || tc.status === "validating" /* Validating */) {
27077
+ if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
27059
27078
  return true;
27060
27079
  }
27061
- if (tc.status === "success" /* Success */ || tc.status === "error" /* Error */ || tc.status === "cancelled" /* Cancelled */) {
27080
+ if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
27062
27081
  return !tc.responseSubmittedToGemini;
27063
27082
  }
27064
27083
  return false;
@@ -27105,9 +27124,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27105
27124
  }
27106
27125
  setRetryStatus(payload);
27107
27126
  };
27108
- coreEvents.on("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
27127
+ coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
27109
27128
  return () => {
27110
- coreEvents.off("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
27129
+ coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
27111
27130
  };
27112
27131
  }, [isRespondingRef]);
27113
27132
  const [
@@ -27240,12 +27259,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27240
27259
  const tc = toolCalls[i];
27241
27260
  if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
27242
27261
  if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
27243
- const isAgent = tc.tool?.kind === "agent" /* Agent */;
27262
+ const isAgent = tc.tool?.kind === Kind.Agent;
27244
27263
  if (isAgent) {
27245
27264
  let contigAgentsComplete = true;
27246
27265
  for (let j = i + 1; j < toolCalls.length; j++) {
27247
27266
  const nextTc = toolCalls[j];
27248
- if (nextTc.tool?.kind === "agent" /* Agent */) {
27267
+ if (nextTc.tool?.kind === Kind.Agent) {
27249
27268
  if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
27250
27269
  contigAgentsComplete = false;
27251
27270
  break;
@@ -27271,7 +27290,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27271
27290
  let currentGroup = [];
27272
27291
  for (const tc of toolsToPush) {
27273
27292
  newPushed.add(tc.request.callId);
27274
- if (tc.tool?.kind === "agent" /* Agent */) {
27293
+ if (tc.tool?.kind === Kind.Agent) {
27275
27294
  currentGroup.push(tc);
27276
27295
  } else {
27277
27296
  if (currentGroup.length > 0) {
@@ -27424,7 +27443,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27424
27443
  prevActiveShellPtyIdRef.current = activeShellPtyId;
27425
27444
  }, [activeShellPtyId, addItem, setIsResponding]);
27426
27445
  (0, import_react97.useEffect)(() => {
27427
- if (config.getApprovalMode() === "yolo" /* YOLO */ && streamingState === "idle" /* Idle */) {
27446
+ if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
27428
27447
  const lastUserMessageIndex = history.findLastIndex(
27429
27448
  (item) => item.type === "user" /* USER */
27430
27449
  );
@@ -27492,7 +27511,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27492
27511
  return;
27493
27512
  }
27494
27513
  const hasActiveTools = toolCalls.some(
27495
- (tc) => tc.status === "executing" /* Executing */ || tc.status === "scheduled" /* Scheduled */ || tc.status === "validating" /* Validating */
27514
+ (tc) => tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating
27496
27515
  );
27497
27516
  if (streamingState === "idle" /* Idle */ && !isRespondingRef.current && !hasActiveTools) {
27498
27517
  if (clearBuffer) {
@@ -27519,7 +27538,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27519
27538
  if (tool.name === SHELL_COMMAND_NAME) {
27520
27539
  return {
27521
27540
  ...tool,
27522
- status: "cancelled" /* Cancelled */,
27541
+ status: CoreToolCallStatus.Cancelled,
27523
27542
  resultDisplay: tool.resultDisplay
27524
27543
  };
27525
27544
  }
@@ -27584,7 +27603,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27584
27603
  let localQueryToSendToGemini = null;
27585
27604
  if (typeof query === "string") {
27586
27605
  const trimmedQuery = query.trim();
27587
- await logger?.logMessage("user" /* USER */, trimmedQuery);
27606
+ await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
27588
27607
  if (!shellModeActive) {
27589
27608
  const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
27590
27609
  if (slashCommandResult) {
@@ -27740,7 +27759,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27740
27759
  if (pendingHistoryItemRef.current) {
27741
27760
  if (pendingHistoryItemRef.current.type === "tool_group") {
27742
27761
  const updatedTools = pendingHistoryItemRef.current.tools.map(
27743
- (tool) => tool.status === "validating" /* Validating */ || tool.status === "scheduled" /* Scheduled */ || tool.status === "awaiting_approval" /* AwaitingApproval */ || tool.status === "executing" /* Executing */ ? { ...tool, status: "cancelled" /* Cancelled */ } : tool
27762
+ (tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
27744
27763
  );
27745
27764
  const pendingItem = {
27746
27765
  ...pendingHistoryItemRef.current,
@@ -28032,15 +28051,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28032
28051
  let geminiMessageBuffer = "";
28033
28052
  const toolCallRequests = [];
28034
28053
  for await (const event of stream) {
28035
- if (event.type !== "thought" /* Thought */ && thoughtRef.current !== null) {
28054
+ if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
28036
28055
  setThought(null);
28037
28056
  }
28038
28057
  switch (event.type) {
28039
- case "thought" /* Thought */:
28058
+ case GeminiEventType.Thought:
28040
28059
  setLastGeminiActivityTime(Date.now());
28041
28060
  handleThoughtEvent(event.value, userMessageTimestamp);
28042
28061
  break;
28043
- case "content" /* Content */:
28062
+ case GeminiEventType.Content:
28044
28063
  setLastGeminiActivityTime(Date.now());
28045
28064
  geminiMessageBuffer = handleContentEvent(
28046
28065
  event.value,
@@ -28048,16 +28067,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28048
28067
  userMessageTimestamp
28049
28068
  );
28050
28069
  break;
28051
- case "tool_call_request" /* ToolCallRequest */:
28070
+ case GeminiEventType.ToolCallRequest:
28052
28071
  toolCallRequests.push(event.value);
28053
28072
  break;
28054
- case "user_cancelled" /* UserCancelled */:
28073
+ case GeminiEventType.UserCancelled:
28055
28074
  handleUserCancelledEvent(userMessageTimestamp);
28056
28075
  break;
28057
- case "error" /* Error */:
28076
+ case GeminiEventType.Error:
28058
28077
  handleErrorEvent(event.value, userMessageTimestamp);
28059
28078
  break;
28060
- case "agent_execution_stopped" /* AgentExecutionStopped */:
28079
+ case GeminiEventType.AgentExecutionStopped:
28061
28080
  handleAgentExecutionStoppedEvent(
28062
28081
  event.value.reason,
28063
28082
  userMessageTimestamp,
@@ -28065,7 +28084,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28065
28084
  event.value.contextCleared
28066
28085
  );
28067
28086
  break;
28068
- case "agent_execution_blocked" /* AgentExecutionBlocked */:
28087
+ case GeminiEventType.AgentExecutionBlocked:
28069
28088
  handleAgentExecutionBlockedEvent(
28070
28089
  event.value.reason,
28071
28090
  userMessageTimestamp,
@@ -28073,36 +28092,36 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28073
28092
  event.value.contextCleared
28074
28093
  );
28075
28094
  break;
28076
- case "chat_compressed" /* ChatCompressed */:
28095
+ case GeminiEventType.ChatCompressed:
28077
28096
  handleChatCompressionEvent(event.value, userMessageTimestamp);
28078
28097
  break;
28079
- case "tool_call_confirmation" /* ToolCallConfirmation */:
28080
- case "tool_call_response" /* ToolCallResponse */:
28098
+ case GeminiEventType.ToolCallConfirmation:
28099
+ case GeminiEventType.ToolCallResponse:
28081
28100
  break;
28082
- case "max_session_turns" /* MaxSessionTurns */:
28101
+ case GeminiEventType.MaxSessionTurns:
28083
28102
  handleMaxSessionTurnsEvent();
28084
28103
  break;
28085
- case "context_window_will_overflow" /* ContextWindowWillOverflow */:
28104
+ case GeminiEventType.ContextWindowWillOverflow:
28086
28105
  handleContextWindowWillOverflowEvent(
28087
28106
  event.value.estimatedRequestTokenCount,
28088
28107
  event.value.remainingTokenCount
28089
28108
  );
28090
28109
  break;
28091
- case "finished" /* Finished */:
28110
+ case GeminiEventType.Finished:
28092
28111
  handleFinishedEvent(event, userMessageTimestamp);
28093
28112
  break;
28094
- case "citation" /* Citation */:
28113
+ case GeminiEventType.Citation:
28095
28114
  handleCitationEvent(event.value, userMessageTimestamp);
28096
28115
  break;
28097
- case "model_info" /* ModelInfo */:
28116
+ case GeminiEventType.ModelInfo:
28098
28117
  handleChatModelEvent(event.value, userMessageTimestamp);
28099
28118
  break;
28100
- case "loop_detected" /* LoopDetected */:
28119
+ case GeminiEventType.LoopDetected:
28101
28120
  loopDetectedRef.current = true;
28102
28121
  break;
28103
- case "retry" /* Retry */:
28122
+ case GeminiEventType.Retry:
28104
28123
  break;
28105
- case "invalid_stream" /* InvalidStream */:
28124
+ case GeminiEventType.InvalidStream:
28106
28125
  handleInvalidStreamEvent(event.value, userMessageTimestamp);
28107
28126
  break;
28108
28127
  default: {
@@ -28156,7 +28175,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28156
28175
  const submitQuery = (0, import_react97.useCallback)(
28157
28176
  async (query, options, prompt_id) => runInDevTraceSpan(
28158
28177
  {
28159
- operation: options?.isContinuation ? "system_prompt" /* SystemPrompt */ : "user_prompt" /* UserPrompt */,
28178
+ operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
28160
28179
  sessionId: config.getSessionId()
28161
28180
  },
28162
28181
  async ({ metadata: spanMetadata }) => {
@@ -28323,7 +28342,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28323
28342
  submitQueryRef.current = submitQuery;
28324
28343
  const handleApprovalModeChange = (0, import_react97.useCallback)(
28325
28344
  async (newApprovalMode) => {
28326
- if (previousApprovalModeRef.current === "plan" /* PLAN */ && newApprovalMode !== "plan" /* PLAN */ && streamingState === "idle" /* Idle */) {
28345
+ if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
28327
28346
  if (geminiClient) {
28328
28347
  try {
28329
28348
  await geminiClient.addHistory({
@@ -28346,11 +28365,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28346
28365
  }
28347
28366
  }
28348
28367
  previousApprovalModeRef.current = newApprovalMode;
28349
- if (newApprovalMode === "yolo" /* YOLO */ || newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
28368
+ if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
28350
28369
  let awaitingApprovalCalls = toolCalls.filter(
28351
28370
  (call) => call.status === "awaiting_approval" && !call.request.forcedAsk
28352
28371
  );
28353
- if (newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
28372
+ if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
28354
28373
  awaitingApprovalCalls = awaitingApprovalCalls.filter((call) => {
28355
28374
  if (EDIT_TOOL_NAMES.has(call.request.name)) {
28356
28375
  return true;
@@ -28366,11 +28385,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28366
28385
  if (call.correlationId) {
28367
28386
  try {
28368
28387
  await config.getMessageBus().publish({
28369
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
28388
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
28370
28389
  correlationId: call.correlationId,
28371
28390
  confirmed: true,
28372
28391
  requiresUserConfirmation: false,
28373
- outcome: "proceed_once" /* ProceedOnce */
28392
+ outcome: ToolConfirmationOutcome.ProceedOnce
28374
28393
  });
28375
28394
  } catch (error) {
28376
28395
  debugLogger.warn(
@@ -28461,14 +28480,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28461
28480
  );
28462
28481
  if (isLowErrorVerbosity) {
28463
28482
  suppressedToolErrorCountRef.current += geminiTools.filter(
28464
- (tc) => tc.status === "error" /* Error */
28483
+ (tc) => tc.status === CoreToolCallStatus.Error
28465
28484
  ).length;
28466
28485
  }
28467
28486
  if (geminiTools.length === 0) {
28468
28487
  return;
28469
28488
  }
28470
28489
  const stopExecutionTool = geminiTools.find(
28471
- (tc) => tc.response.errorType === "stop_execution" /* STOP_EXECUTION */
28490
+ (tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
28472
28491
  );
28473
28492
  if (stopExecutionTool && stopExecutionTool.response.error) {
28474
28493
  maybeAddSuppressedToolErrorNote();
@@ -28488,9 +28507,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28488
28507
  (tc) => !isTopicTool2(tc.request.name)
28489
28508
  );
28490
28509
  const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
28491
- (tc) => tc.status === "cancelled" /* Cancelled */
28510
+ (tc) => tc.status === CoreToolCallStatus.Cancelled
28492
28511
  );
28493
- const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === "cancelled" /* Cancelled */);
28512
+ const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
28494
28513
  if (allDeclinableToolsCancelled || allToolsCancelled) {
28495
28514
  if (!turnCancelledRef.current) {
28496
28515
  addItem({
@@ -28576,7 +28595,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28576
28595
  return;
28577
28596
  }
28578
28597
  const restorableToolCalls = toolCalls.filter(
28579
- (toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === "awaiting_approval" /* AwaitingApproval */
28598
+ (toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
28580
28599
  );
28581
28600
  if (restorableToolCalls.length > 0) {
28582
28601
  if (!gitService) {
@@ -28799,14 +28818,14 @@ var useAgentStream = ({
28799
28818
  const displayName = legacyState?.displayName ?? event.name;
28800
28819
  const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
28801
28820
  const desc = legacyState?.description ?? "";
28802
- const fallbackKind = "other" /* Other */;
28821
+ const fallbackKind = Kind.Other;
28803
28822
  const newCall = {
28804
28823
  callId: event.requestId,
28805
28824
  name: displayName,
28806
28825
  originalRequestName: event.name,
28807
28826
  description: desc,
28808
28827
  display: event.display,
28809
- status: "scheduled" /* Scheduled */,
28828
+ status: CoreToolCallStatus.Scheduled,
28810
28829
  isClientInitiated: false,
28811
28830
  renderOutputAsMarkdown: isOutputMarkdown,
28812
28831
  kind: legacyState?.kind ?? fallbackKind,
@@ -28824,10 +28843,10 @@ var useAgentStream = ({
28824
28843
  const evtStatus = legacyState?.status;
28825
28844
  let status = tc.status;
28826
28845
  if (evtStatus === "executing")
28827
- status = "executing" /* Executing */;
28828
- else if (evtStatus === "error") status = "error" /* Error */;
28846
+ status = CoreToolCallStatus.Executing;
28847
+ else if (evtStatus === "error") status = CoreToolCallStatus.Error;
28829
28848
  else if (evtStatus === "success")
28830
- status = "success" /* Success */;
28849
+ status = CoreToolCallStatus.Success;
28831
28850
  const display = event.display?.result;
28832
28851
  const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
28833
28852
  const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
@@ -28860,7 +28879,7 @@ var useAgentStream = ({
28860
28879
  const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
28861
28880
  return {
28862
28881
  ...tc,
28863
- status: event.isError ? "error" /* Error */ : "success" /* Success */,
28882
+ status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
28864
28883
  display: event.display ? { ...tc.display, ...event.display } : tc.display,
28865
28884
  resultDisplay,
28866
28885
  outputFile
@@ -28926,7 +28945,7 @@ var useAgentStream = ({
28926
28945
  if (!options?.isContinuation) {
28927
28946
  if (typeof query === "string") {
28928
28947
  addItem({ type: "user" /* USER */, text: query }, timestamp);
28929
- void logger?.logMessage("user" /* USER */, query);
28948
+ void logger?.logMessage(MessageSenderType.USER, query);
28930
28949
  }
28931
28950
  startNewPrompt();
28932
28951
  }
@@ -30318,12 +30337,13 @@ var useLoadingIndicator = ({
30318
30337
  showWit = false,
30319
30338
  customWittyPhrases,
30320
30339
  errorVerbosity = "full",
30321
- maxLength
30340
+ maxLength,
30341
+ pauseUpdates = false
30322
30342
  }) => {
30323
30343
  const [timerResetKey, setTimerResetKey] = (0, import_react102.useState)(0);
30324
- const isTimerActive = streamingState === "responding" /* Responding */;
30344
+ const isTimerActive = streamingState === "responding" /* Responding */ && !pauseUpdates;
30325
30345
  const elapsedTimeFromTimer = useTimer(isTimerActive, timerResetKey);
30326
- const isPhraseCyclingActive = streamingState === "responding" /* Responding */;
30346
+ const isPhraseCyclingActive = streamingState === "responding" /* Responding */ && !pauseUpdates;
30327
30347
  const isWaiting = streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */;
30328
30348
  const { currentTip, currentWittyPhrase } = usePhraseCycler(
30329
30349
  isPhraseCyclingActive,
@@ -30457,9 +30477,9 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30457
30477
  const handleFolderTrustSelect = (0, import_react103.useCallback)(
30458
30478
  async (choice) => {
30459
30479
  const trustLevelMap = {
30460
- ["trust_folder" /* TRUST_FOLDER */]: "TRUST_FOLDER" /* TRUST_FOLDER */,
30461
- ["trust_parent" /* TRUST_PARENT */]: "TRUST_PARENT" /* TRUST_PARENT */,
30462
- ["do_not_trust" /* DO_NOT_TRUST */]: "DO_NOT_TRUST" /* DO_NOT_TRUST */
30480
+ ["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
30481
+ ["trust_parent" /* TRUST_PARENT */]: TrustLevel.TRUST_PARENT,
30482
+ ["do_not_trust" /* DO_NOT_TRUST */]: TrustLevel.DO_NOT_TRUST
30463
30483
  };
30464
30484
  const trustLevel = trustLevelMap[choice];
30465
30485
  if (!trustLevel) return;
@@ -30478,7 +30498,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30478
30498
  }, 100);
30479
30499
  return;
30480
30500
  }
30481
- const currentIsTrusted = trustLevel === "TRUST_FOLDER" /* TRUST_FOLDER */ || trustLevel === "TRUST_PARENT" /* TRUST_PARENT */;
30501
+ const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
30482
30502
  onTrustChangeRef.current(currentIsTrusted);
30483
30503
  setIsTrusted(currentIsTrusted);
30484
30504
  const wasTrusted = isTrusted ?? false;
@@ -31486,7 +31506,7 @@ function useMessageQueue({
31486
31506
  var import_react105 = __toESM(require_react(), 1);
31487
31507
  function useMcpStatus(config) {
31488
31508
  const [discoveryState, setDiscoveryState] = (0, import_react105.useState)(
31489
- () => config.getMcpClientManager()?.getDiscoveryState() ?? "not_started" /* NOT_STARTED */
31509
+ () => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
31490
31510
  );
31491
31511
  const [mcpServerCount, setMcpServerCount] = (0, import_react105.useState)(
31492
31512
  () => config.getMcpClientManager()?.getMcpServerCount() ?? 0
@@ -31499,12 +31519,12 @@ function useMcpStatus(config) {
31499
31519
  setMcpServerCount(manager.getMcpServerCount());
31500
31520
  }
31501
31521
  };
31502
- coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
31522
+ coreEvents.on(CoreEvent.McpClientUpdate, onChange);
31503
31523
  return () => {
31504
- coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
31524
+ coreEvents.off(CoreEvent.McpClientUpdate, onChange);
31505
31525
  };
31506
31526
  }, [config]);
31507
- const isMcpReady = discoveryState === "completed" /* COMPLETED */ || discoveryState === "not_started" /* NOT_STARTED */ && mcpServerCount === 0;
31527
+ const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
31508
31528
  return {
31509
31529
  discoveryState,
31510
31530
  mcpServerCount,
@@ -31531,7 +31551,7 @@ function useApprovalModeIndicator({
31531
31551
  (key) => {
31532
31552
  let nextApprovalMode;
31533
31553
  if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
31534
- if (config.isYoloModeDisabled() && config.getApprovalMode() !== "yolo" /* YOLO */) {
31554
+ if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
31535
31555
  if (addItem) {
31536
31556
  let text = "You cannot enter YOLO mode since it is disabled in your settings.";
31537
31557
  const adminSettings = config.getRemoteAdminSettings();
@@ -31549,21 +31569,21 @@ function useApprovalModeIndicator({
31549
31569
  }
31550
31570
  return;
31551
31571
  }
31552
- nextApprovalMode = config.getApprovalMode() === "yolo" /* YOLO */ ? "default" /* DEFAULT */ : "yolo" /* YOLO */;
31572
+ nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
31553
31573
  } else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
31554
31574
  const currentMode = config.getApprovalMode();
31555
31575
  switch (currentMode) {
31556
- case "default" /* DEFAULT */:
31557
- nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
31576
+ case ApprovalMode.DEFAULT:
31577
+ nextApprovalMode = ApprovalMode.AUTO_EDIT;
31558
31578
  break;
31559
- case "autoEdit" /* AUTO_EDIT */:
31560
- nextApprovalMode = allowPlanMode ? "plan" /* PLAN */ : "default" /* DEFAULT */;
31579
+ case ApprovalMode.AUTO_EDIT:
31580
+ nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
31561
31581
  break;
31562
- case "plan" /* PLAN */:
31563
- nextApprovalMode = "default" /* DEFAULT */;
31582
+ case ApprovalMode.PLAN:
31583
+ nextApprovalMode = ApprovalMode.DEFAULT;
31564
31584
  break;
31565
- case "yolo" /* YOLO */:
31566
- nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
31585
+ case ApprovalMode.YOLO:
31586
+ nextApprovalMode = ApprovalMode.AUTO_EDIT;
31567
31587
  break;
31568
31588
  default:
31569
31589
  }
@@ -31973,11 +31993,11 @@ var useHookDisplayState = () => {
31973
31993
  removeHook();
31974
31994
  }
31975
31995
  };
31976
- coreEvents.on("hook-start" /* HookStart */, handleHookStart);
31977
- coreEvents.on("hook-end" /* HookEnd */, handleHookEnd);
31996
+ coreEvents.on(CoreEvent.HookStart, handleHookStart);
31997
+ coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
31978
31998
  return () => {
31979
- coreEvents.off("hook-start" /* HookStart */, handleHookStart);
31980
- coreEvents.off("hook-end" /* HookEnd */, handleHookEnd);
31999
+ coreEvents.off(CoreEvent.HookStart, handleHookStart);
32000
+ coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
31981
32001
  activeTimeouts.forEach(clearTimeout);
31982
32002
  activeTimeouts.clear();
31983
32003
  };
@@ -32718,10 +32738,12 @@ var AppContainer = (props) => {
32718
32738
  const overflowState = useOverflowState();
32719
32739
  const overflowingIdsSize = overflowState?.overflowingIds.size ?? 0;
32720
32740
  const hasOverflowState = overflowingIdsSize > 0 || !constrainHeight;
32741
+ const prevOverflowingIdsSizeRef = (0, import_react119.useRef)(0);
32721
32742
  (0, import_react119.useEffect)(() => {
32722
- if (hasOverflowState) {
32743
+ if (overflowingIdsSize > prevOverflowingIdsSizeRef.current && hasOverflowState) {
32723
32744
  triggerExpandHint(true);
32724
32745
  }
32746
+ prevOverflowingIdsSizeRef.current = overflowingIdsSize;
32725
32747
  }, [hasOverflowState, overflowingIdsSize, triggerExpandHint]);
32726
32748
  const [defaultBannerText, setDefaultBannerText] = (0, import_react119.useState)("");
32727
32749
  const [warningBannerText, setWarningBannerText] = (0, import_react119.useState)("");
@@ -32816,7 +32838,7 @@ var AppContainer = (props) => {
32816
32838
  setConfigInitialized(true);
32817
32839
  startupProfiler.flush(config);
32818
32840
  startAutoMemoryIfEnabled(config);
32819
- const sessionStartSource = resumedSessionData ? "resume" /* Resume */ : "startup" /* Startup */;
32841
+ const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
32820
32842
  const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
32821
32843
  if (result) {
32822
32844
  const additionalContext = result.getAdditionalContext();
@@ -32843,7 +32865,7 @@ var AppContainer = (props) => {
32843
32865
  );
32844
32866
  const ideClient = await IdeClient.getInstance();
32845
32867
  await ideClient.disconnect();
32846
- await config?.getHookSystem()?.fireSessionEndEvent("exit" /* Exit */);
32868
+ await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
32847
32869
  };
32848
32870
  registerCleanup(cleanupFn);
32849
32871
  return () => {
@@ -32868,11 +32890,11 @@ var AppContainer = (props) => {
32868
32890
  resetTime: payload.resetTime
32869
32891
  });
32870
32892
  };
32871
- coreEvents.on("model-changed" /* ModelChanged */, handleModelChanged);
32872
- coreEvents.on("quota-changed" /* QuotaChanged */, handleQuotaChanged);
32893
+ coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
32894
+ coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
32873
32895
  return () => {
32874
- coreEvents.off("model-changed" /* ModelChanged */, handleModelChanged);
32875
- coreEvents.off("quota-changed" /* QuotaChanged */, handleQuotaChanged);
32896
+ coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
32897
+ coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
32876
32898
  };
32877
32899
  }, [config]);
32878
32900
  (0, import_react119.useEffect)(() => {
@@ -32885,16 +32907,16 @@ var AppContainer = (props) => {
32885
32907
  const handleAgentsDiscovered = (payload) => {
32886
32908
  setNewAgents(payload.agents);
32887
32909
  };
32888
- coreEvents.on("settings-changed" /* SettingsChanged */, handleSettingsChanged);
32889
- coreEvents.on("admin-settings-changed" /* AdminSettingsChanged */, handleAdminSettingsChanged);
32890
- coreEvents.on("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
32910
+ coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
32911
+ coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
32912
+ coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
32891
32913
  return () => {
32892
- coreEvents.off("settings-changed" /* SettingsChanged */, handleSettingsChanged);
32914
+ coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
32893
32915
  coreEvents.off(
32894
- "admin-settings-changed" /* AdminSettingsChanged */,
32916
+ CoreEvent.AdminSettingsChanged,
32895
32917
  handleAdminSettingsChanged
32896
32918
  );
32897
- coreEvents.off("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
32919
+ coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
32898
32920
  };
32899
32921
  }, [settings]);
32900
32922
  const { errorCount, clearErrorCount } = useErrorCount();
@@ -32961,11 +32983,11 @@ var AppContainer = (props) => {
32961
32983
  exitEditorDialog
32962
32984
  } = useEditorSettings(settings, setEditorError, historyManager.addItem);
32963
32985
  (0, import_react119.useEffect)(() => {
32964
- coreEvents.on("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
32965
- coreEvents.on("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
32986
+ coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
32987
+ coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
32966
32988
  return () => {
32967
- coreEvents.off("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
32968
- coreEvents.off("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
32989
+ coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
32990
+ coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
32969
32991
  };
32970
32992
  }, [handleEditorClose, openEditorDialog]);
32971
32993
  (0, import_react119.useEffect)(() => {
@@ -33033,7 +33055,7 @@ var AppContainer = (props) => {
33033
33055
  errorVerbosity: settings.merged.ui.errorVerbosity
33034
33056
  });
33035
33057
  const isAuthDialogOpen = authState === "updating" /* Updating */;
33036
- const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== "gemini-api-key" /* USE_GEMINI */;
33058
+ const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
33037
33059
  const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
33038
33060
  const { loadHistoryForResume, isResuming } = useSessionResume({
33039
33061
  config,
@@ -33061,7 +33083,7 @@ var AppContainer = (props) => {
33061
33083
  async (authType, scope) => {
33062
33084
  if (authType) {
33063
33085
  const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
33064
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */) {
33086
+ if (authType === AuthType.LOGIN_WITH_GOOGLE) {
33065
33087
  setAuthContext({ requiresRestart: true });
33066
33088
  } else {
33067
33089
  setAuthContext({});
@@ -33089,7 +33111,7 @@ var AppContainer = (props) => {
33089
33111
  );
33090
33112
  return;
33091
33113
  }
33092
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
33114
+ if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
33093
33115
  writeToStdout(`
33094
33116
  ----------------------------------------------------------------
33095
33117
  Logging in with Google... Restarting Gemini CLI to continue.
@@ -33112,7 +33134,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
33112
33134
  }
33113
33135
  await saveApiKey(apiKey);
33114
33136
  await reloadApiKey();
33115
- await config.refreshAuth("gemini-api-key" /* USE_GEMINI */);
33137
+ await config.refreshAuth(AuthType.USE_GEMINI);
33116
33138
  setAuthState("authenticated" /* Authenticated */);
33117
33139
  } catch (e) {
33118
33140
  onAuthError(
@@ -33137,7 +33159,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
33137
33159
  `Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
33138
33160
  );
33139
33161
  } else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
33140
- if (settings.merged.security.auth.selectedType === "gemini-api-key" /* USE_GEMINI */) {
33162
+ if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
33141
33163
  return;
33142
33164
  }
33143
33165
  const authMethod = settings.merged.security.auth.selectedType;
@@ -33273,9 +33295,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
33273
33295
  }
33274
33296
  });
33275
33297
  };
33276
- coreEvents.on("consent-request" /* ConsentRequest */, handleConsentRequest);
33298
+ coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
33277
33299
  return () => {
33278
- coreEvents.off("consent-request" /* ConsentRequest */, handleConsentRequest);
33300
+ coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
33279
33301
  };
33280
33302
  }, []);
33281
33303
  const performMemoryRefresh = (0, import_react119.useCallback)(async () => {
@@ -33845,7 +33867,7 @@ ${queuedText}` : queuedText;
33845
33867
  [handleSlashCommand, settings]
33846
33868
  );
33847
33869
  const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
33848
- const loginRestartMessage = settings.merged.security.auth.selectedType === "vertex-ai" /* USE_VERTEX_AI */ ? "Authenticating to Vertex AI in Cloud Shell requires a restart to apply project settings." : void 0;
33870
+ const loginRestartMessage = settings.merged.security.auth.selectedType === AuthType.USE_VERTEX_AI ? "Authenticating to Vertex AI in Cloud Shell requires a restart to apply project settings." : void 0;
33849
33871
  const dialogsVisible = shouldShowIdePrompt || isFolderTrustDialogOpen || isPolicyUpdateDialogOpen || adminSettingsChanged || !!commandConfirmationRequest || !!authConsentRequest || !!permissionConfirmationRequest || !!customDialog || confirmUpdateExtensionRequests.length > 0 || !!loopDetectionConfirmationRequest || isThemeDialogOpen || isSettingsDialogOpen || isModelDialogOpen || isVoiceModelDialogOpen || isAgentConfigDialogOpen || isPermissionsDialogOpen || isAuthenticating || isAuthDialogOpen || isEditorDialogOpen || showPrivacyNotice || showIdeRestartPrompt || !!proQuotaRequest || !!validationRequest || !!overageMenuRequest || !!emptyWalletRequest || isSessionBrowserOpen || authState === "awaiting_api_key_input" /* AwaitingApiKeyInput */ || isAwaitingLoginRestart || !!newAgents;
33850
33872
  const handleGlobalKeypress = (0, import_react119.useCallback)(
33851
33873
  (key) => {
@@ -33935,7 +33957,7 @@ ${queuedText}` : queuedText;
33935
33957
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
33936
33958
  if (settings.merged.general.devtools) {
33937
33959
  void (async () => {
33938
- const { toggleDevToolsPanel } = await import("./devtoolsService-3SADPKKB.js");
33960
+ const { toggleDevToolsPanel } = await import("./devtoolsService-EVGTOLCK.js");
33939
33961
  await toggleDevToolsPanel(
33940
33962
  config,
33941
33963
  showErrorDetails,
@@ -33963,7 +33985,9 @@ ${queuedText}` : queuedText;
33963
33985
  } else if (keyMatchers["app.showMoreLines" /* SHOW_MORE_LINES */](key)) {
33964
33986
  setConstrainHeight(false);
33965
33987
  toggleLastTurnTools();
33966
- refreshStatic();
33988
+ if (!isAlternateBuffer && !config.getUseTerminalBuffer() && getLastTurnToolCallIds(historyManager.history, []).length > 0) {
33989
+ refreshStatic();
33990
+ }
33967
33991
  return true;
33968
33992
  } else if ((keyMatchers["app.focusShellInput" /* FOCUS_SHELL_INPUT */](key) || keyMatchers["background.unfocusList" /* UNFOCUS_BACKGROUND_SHELL_LIST */](key)) && (activePtyId || isBackgroundTaskVisible && backgroundTasks.size > 0)) {
33969
33993
  if (embeddedShellFocused) {
@@ -34154,12 +34178,12 @@ ${queuedText}` : queuedText;
34154
34178
  Date.now()
34155
34179
  );
34156
34180
  };
34157
- coreEvents.on("user-feedback" /* UserFeedback */, handleUserFeedback);
34158
- coreEvents.on("hook-system-message" /* HookSystemMessage */, handleHookSystemMessage);
34181
+ coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
34182
+ coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
34159
34183
  coreEvents.drainBacklogs();
34160
34184
  return () => {
34161
- coreEvents.off("user-feedback" /* UserFeedback */, handleUserFeedback);
34162
- coreEvents.off("hook-system-message" /* HookSystemMessage */, handleHookSystemMessage);
34185
+ coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
34186
+ coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
34163
34187
  };
34164
34188
  }, [historyManager]);
34165
34189
  const nightly = props.version.includes("nightly");
@@ -34202,7 +34226,8 @@ ${queuedText}` : queuedText;
34202
34226
  showWit: showStatusWit,
34203
34227
  customWittyPhrases: settings.merged.ui.customWittyPhrases,
34204
34228
  errorVerbosity: settings.merged.ui.errorVerbosity,
34205
- maxLength
34229
+ maxLength,
34230
+ pauseUpdates: !constrainHeight && !isAlternateBuffer && !config.getUseTerminalBuffer()
34206
34231
  });
34207
34232
  const allowPlanMode = config.isPlanEnabled() && streamingState === "idle" /* Idle */ && !hasPendingActionRequired;
34208
34233
  const showApprovalModeIndicator = useApprovalModeIndicator({
@@ -34267,9 +34292,9 @@ ${queuedText}` : queuedText;
34267
34292
  const handleMemoryChanged = (result) => {
34268
34293
  setGeminiMdFileCount(result.fileCount);
34269
34294
  };
34270
- coreEvents.on("memory-changed" /* MemoryChanged */, handleMemoryChanged);
34295
+ coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
34271
34296
  return () => {
34272
- coreEvents.off("memory-changed" /* MemoryChanged */, handleMemoryChanged);
34297
+ coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
34273
34298
  };
34274
34299
  }, []);
34275
34300
  (0, import_react119.useEffect)(() => {
@@ -34847,6 +34872,9 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
34847
34872
  });
34848
34873
  const cleanupUnmount = () => instance.unmount();
34849
34874
  const cleanupNonResumableCurrentSession = async () => {
34875
+ if (resumedSessionData) {
34876
+ return;
34877
+ }
34850
34878
  try {
34851
34879
  await config.getGeminiClient()?.getChatRecordingService()?.deleteCurrentSessionIfNotResumableAsync();
34852
34880
  } catch (e) {