@google/gemini-cli 0.53.0-preview.0 → 0.53.1

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 (66) hide show
  1. package/bundle/{chunk-5RDOS7UZ.js → chunk-2NH5AG3B.js} +175 -39
  2. package/bundle/{chunk-PVCJCQWY.js → chunk-2W4AGAXV.js} +1 -1
  3. package/bundle/{chunk-HF533LET.js → chunk-3A32ZSG7.js} +7774 -14246
  4. package/bundle/{chunk-BX6DTJOD.js → chunk-3QXIQPRB.js} +1 -1
  5. package/bundle/{chunk-SLQKIE73.js → chunk-4SJPXUBO.js} +1 -1
  6. package/bundle/{chunk-XH7QC2TB.js → chunk-4TO4ZFXG.js} +2 -2
  7. package/bundle/{chunk-PKFZO3SN.js → chunk-5544MKWC.js} +1 -1
  8. package/bundle/{chunk-27C6XFMY.js → chunk-5Y7N3RFB.js} +198 -42
  9. package/bundle/{chunk-4OVORMGE.js → chunk-AGHZJVUR.js} +1 -1
  10. package/bundle/{chunk-UJVAPQ7V.js → chunk-AT7LBPDZ.js} +1 -1
  11. package/bundle/{chunk-7VUO7T2C.js → chunk-EVNGSSTE.js} +3 -3
  12. package/bundle/{chunk-SXKIOLLX.js → chunk-I2LQOUTQ.js} +7 -7
  13. package/bundle/chunk-IU6WDAMY.js +1571 -0
  14. package/bundle/chunk-JEAU27VO.js +154 -0
  15. package/bundle/chunk-JR6IZCRZ.js +397034 -0
  16. package/bundle/{chunk-WVDR5L2V.js → chunk-KELPZKO5.js} +67 -54
  17. package/bundle/{chunk-PLMRBJEA.js → chunk-KNB5JW7H.js} +2 -2
  18. package/bundle/{chunk-IODN6H35.js → chunk-KUOIDGSH.js} +1 -1
  19. package/bundle/{chunk-UEI42N7R.js → chunk-KW3DD4IB.js} +3 -3
  20. package/bundle/{chunk-BDSSP5BZ.js → chunk-LPTVZ4FJ.js} +1 -1
  21. package/bundle/{chunk-BRZT2CQU.js → chunk-N2KH22XD.js} +1 -1
  22. package/bundle/{chunk-LUM47MYE.js → chunk-N4JX5RHY.js} +1 -1
  23. package/bundle/{chunk-6AD4A2WF.js → chunk-OFMYNLJO.js} +8 -5
  24. package/bundle/chunk-QUZIMBPB.js +102505 -0
  25. package/bundle/{chunk-HVYOZEAP.js → chunk-RDVVXMLN.js} +3 -3
  26. package/bundle/chunk-TAOISOL2.js +118 -0
  27. package/bundle/{chunk-CTNBR234.js → chunk-TIUOC6Z4.js} +2 -2
  28. package/bundle/chunk-UQGV7WFA.js +398 -0
  29. package/bundle/{chunk-GHVD6PXK.js → chunk-VQ5JKD47.js} +9 -8
  30. package/bundle/chunk-XV2XVUWW.js +512 -0
  31. package/bundle/{chunk-QSTUV3QH.js → chunk-YF4RJFUM.js} +7 -7
  32. package/bundle/chunk-ZJENN63T.js +17332 -0
  33. package/bundle/{cleanup-4FVUYQ7H.js → cleanup-CLX27ZSM.js} +2 -2
  34. package/bundle/{cleanup-XETKRH7X.js → cleanup-HE6L3KVJ.js} +2 -2
  35. package/bundle/{cleanup-ZR34H2GU.js → cleanup-QTYIWJJQ.js} +2 -2
  36. package/bundle/cleanup-WQLF5LTO.js +32 -0
  37. package/bundle/{core-PVG4D2MR.js → core-FG5GQN5T.js} +15 -1
  38. package/bundle/{devtoolsService-OUX7PWP3.js → devtoolsService-6MCOO7GD.js} +2 -2
  39. package/bundle/{devtoolsService-IVPTF5ZJ.js → devtoolsService-ALVEJOWU.js} +2 -2
  40. package/bundle/{devtoolsService-QYDPHHFN.js → devtoolsService-LWOTA4XY.js} +4 -3
  41. package/bundle/devtoolsService-NLJPFQBD.js +4359 -0
  42. package/bundle/{dist-PRJQFPSQ.js → dist-FACZYJNK.js} +15 -1
  43. package/bundle/{core-I73XKBPY.js → dist-KYMVPMD2.js} +15 -1
  44. package/bundle/dist-YR3L73K3.js +2168 -0
  45. package/bundle/{gemini-LA6TNI44.js → gemini-2TTBMK7L.js} +84 -20
  46. package/bundle/{gemini-QKB55UV6.js → gemini-EEGDTU6Z.js} +282 -202
  47. package/bundle/{gemini-E2E3U6PR.js → gemini-HMY2YBVR.js} +84 -20
  48. package/bundle/gemini-RNN5D7OL.js +16491 -0
  49. package/bundle/gemini.js +7 -7
  50. package/bundle/{interactiveCli-OD2LO24X.js → interactiveCli-47BG5E33.js} +99 -9
  51. package/bundle/{interactiveCli-ADLAWPXN.js → interactiveCli-HJK54NFF.js} +406 -297
  52. package/bundle/{interactiveCli-FS3OVPXQ.js → interactiveCli-PIOEDBQZ.js} +99 -9
  53. package/bundle/interactiveCli-UQQGETBL.js +34906 -0
  54. package/bundle/{liteRtServerManager-O7PFOUFD.js → liteRtServerManager-BZXTWG2T.js} +4 -4
  55. package/bundle/{liteRtServerManager-T2Z3RLS3.js → liteRtServerManager-ULQCSZ6V.js} +4 -4
  56. package/bundle/{liteRtServerManager-3SKK7MNE.js → liteRtServerManager-YXO26SKL.js} +4 -4
  57. package/bundle/liteRtServerManager-ZN3L6BPO.js +65 -0
  58. package/bundle/{oauth2-provider-Q433RA6I.js → oauth2-provider-G4XOGQD7.js} +1 -1
  59. package/bundle/{oauth2-provider-E3S5DGLL.js → oauth2-provider-H33CP2XJ.js} +1 -1
  60. package/bundle/{oauth2-provider-DFVE3NYF.js → oauth2-provider-KEB5OWVK.js} +38 -72
  61. package/bundle/oauth2-provider-MZRAKSIZ.js +235 -0
  62. package/bundle/{start-5G2UDZZ6.js → start-AOVRZOK6.js} +6 -6
  63. package/bundle/{start-XMJ23QZN.js → start-JQESP66T.js} +6 -6
  64. package/bundle/{start-3FPYJBRX.js → start-KJPOXM4W.js} +6 -6
  65. package/bundle/start-UN2U7AFE.js +18 -0
  66. package/package.json +1 -1
@@ -157,10 +157,10 @@ import {
157
157
  widestLineFromStyledChars,
158
158
  wordBreakStyledChars,
159
159
  wrapStyledChars
160
- } from "./chunk-WVDR5L2V.js";
160
+ } from "./chunk-KELPZKO5.js";
161
161
  import {
162
162
  require_source
163
- } from "./chunk-SLQKIE73.js";
163
+ } from "./chunk-AGHZJVUR.js";
164
164
  import {
165
165
  appEvents
166
166
  } from "./chunk-5PS3AYFU.js";
@@ -214,33 +214,37 @@ import {
214
214
  stripAnsi,
215
215
  stripUnsafeCharacters,
216
216
  toCodePoints
217
- } from "./chunk-6AD4A2WF.js";
217
+ } from "./chunk-ZJENN63T.js";
218
218
  import {
219
219
  handleAutoUpdate,
220
220
  isDevelopment,
221
221
  relaunchApp,
222
222
  setUpdateHandler
223
- } from "./chunk-CTNBR234.js";
223
+ } from "./chunk-UQGV7WFA.js";
224
224
  import {
225
225
  isTodoList,
226
226
  mapCoreStatusToDisplayStatus,
227
227
  require_react
228
- } from "./chunk-GHVD6PXK.js";
228
+ } from "./chunk-XV2XVUWW.js";
229
229
  import {
230
230
  registerCleanup,
231
231
  removeCleanup,
232
232
  runExitCleanup,
233
233
  setupTtyCheck
234
- } from "./chunk-PVCJCQWY.js";
234
+ } from "./chunk-5544MKWC.js";
235
235
  import {
236
236
  ACTIVATE_SKILL_TOOL_NAME,
237
237
  AGENT_TOOL_NAME,
238
238
  ApiKeyUpdatedEvent,
239
+ ApprovalMode,
239
240
  AsyncFzf,
240
241
  AudioRecorder,
241
242
  AuthType,
242
243
  ChangeAuthRequestedError,
244
+ CompressionStatus,
243
245
  ConversationFinishedEvent,
246
+ CoreEvent,
247
+ CoreToolCallStatus,
244
248
  CreditPurchaseClickEvent,
245
249
  DEFAULT_GEMINI_FLASH_LITE_MODEL,
246
250
  DEFAULT_GEMINI_FLASH_MODEL,
@@ -262,14 +266,23 @@ import {
262
266
  GEMMA_4_31B_IT_MODEL,
263
267
  GLOB_DISPLAY_NAME,
264
268
  GREP_DISPLAY_NAME,
269
+ GeminiCliOperation,
270
+ GeminiEventType,
265
271
  GitService,
266
272
  IdeClient,
273
+ Kind,
267
274
  LS_DISPLAY_NAME,
268
275
  LegacyAgentProtocol,
269
276
  LlmRole,
270
277
  Logger,
278
+ MAX_TOKENS_EXCEEDED_SUGGESTION,
279
+ MCPDiscoveryState,
280
+ MCPServerStatus,
281
+ MessageBusType,
282
+ MessageSenderType,
271
283
  ModelNotFoundError,
272
284
  ModelSlashCommandEvent,
285
+ OTHER_BLOCKED_MESSAGE,
273
286
  OverageMenuShownEvent,
274
287
  OverageOptionSelectedEvent,
275
288
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
@@ -279,20 +292,31 @@ import {
279
292
  PREVIEW_GEMINI_MODEL,
280
293
  PolicyIntegrityManager,
281
294
  ProjectIdRequiredError,
295
+ QuestionType,
282
296
  READ_FILE_DISPLAY_NAME,
283
297
  READ_MANY_FILES_DISPLAY_NAME,
298
+ RECITATION_BLOCKED_MESSAGE,
284
299
  RELEASE_CHANNEL_STABILITY,
285
300
  ROOT_SCHEDULER_ID,
301
+ SAFETY_BLOCKED_MESSAGE,
286
302
  SHELL_TOOL_NAME,
287
303
  Scheduler,
304
+ SessionEndReason,
305
+ SessionStartSource,
288
306
  ShellExecutionService,
289
307
  SlashCommandStatus,
290
308
  Storage,
309
+ SubagentState,
310
+ THINKING_ONLY_COMPRESS_SUGGESTION,
291
311
  TOPIC_PARAM_STRATEGIC_INTENT,
292
312
  TOPIC_PARAM_SUMMARY,
293
313
  TOPIC_PARAM_TITLE,
314
+ TRUE_EMPTY_RESPONSE_MESSAGE,
294
315
  TerminalQuotaError,
316
+ ToolConfirmationOutcome,
317
+ ToolErrorType,
295
318
  TranscriptionFactory,
319
+ TrustLevel,
296
320
  UPDATE_TOPIC_DISPLAY_NAME,
297
321
  UPDATE_TOPIC_TOOL_NAME,
298
322
  UnauthorizedError,
@@ -304,6 +328,7 @@ import {
304
328
  WEB_FETCH_DISPLAY_NAME,
305
329
  WEB_SEARCH_DISPLAY_NAME,
306
330
  WRITE_FILE_DISPLAY_NAME,
331
+ WarningPriority,
307
332
  WhisperModelManager,
308
333
  addMCPStatusChangeListener,
309
334
  allowEditorTypeInSandbox,
@@ -412,7 +437,7 @@ import {
412
437
  validatePlanContent,
413
438
  validatePlanPath,
414
439
  writeToStdout
415
- } from "./chunk-HF533LET.js";
440
+ } from "./chunk-2NH5AG3B.js";
416
441
  import "./chunk-664ZODQF.js";
417
442
  import "./chunk-IUUIT4SU.js";
418
443
  import "./chunk-TUDYL3X4.js";
@@ -5038,7 +5063,7 @@ function calculateShellMaxLines(options) {
5038
5063
  if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
5039
5064
  return maxLinesBasedOnHeight;
5040
5065
  }
5041
- const isExecuting = status === "executing" /* Executing */;
5066
+ const isExecuting = status === CoreToolCallStatus.Executing;
5042
5067
  const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
5043
5068
  return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
5044
5069
  }
@@ -5072,10 +5097,10 @@ function isShellTool(name) {
5072
5097
  return name === SHELL_COMMAND_NAME || name === SHELL_NAME || name === SHELL_TOOL_NAME || normalized === "shell";
5073
5098
  }
5074
5099
  function isThisShellFocusable(name, status, config) {
5075
- return !!(isShellTool(name) && status === "executing" /* Executing */ && config?.getEnableInteractiveShell());
5100
+ return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && config?.getEnableInteractiveShell());
5076
5101
  }
5077
5102
  function isThisShellFocused(name, status, ptyId, activeShellPtyId, embeddedShellFocused) {
5078
- return !!(isShellTool(name) && status === "executing" /* Executing */ && ptyId === activeShellPtyId && embeddedShellFocused);
5103
+ return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && ptyId === activeShellPtyId && embeddedShellFocused);
5079
5104
  }
5080
5105
  function useFocusHint(isThisShellFocusable2, isThisShellFocused2, resultDisplay) {
5081
5106
  const [userHasFocused, setUserHasFocused] = (0, import_react9.useState)(false);
@@ -5235,13 +5260,13 @@ var formatToolArgs = (args) => {
5235
5260
  var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) => {
5236
5261
  let headerText;
5237
5262
  let headerColor = theme.text.secondary;
5238
- if (progress.state === "cancelled" /* CANCELLED */) {
5263
+ if (progress.state === SubagentState.CANCELLED) {
5239
5264
  headerText = `Subagent ${progress.agentName} was cancelled.`;
5240
5265
  headerColor = theme.status.warning;
5241
- } else if (progress.state === "error" /* ERROR */) {
5266
+ } else if (progress.state === SubagentState.ERROR) {
5242
5267
  headerText = `Subagent ${progress.agentName} failed.`;
5243
5268
  headerColor = theme.status.error;
5244
- } else if (progress.state === "completed" /* COMPLETED */) {
5269
+ } else if (progress.state === SubagentState.COMPLETED) {
5245
5270
  headerText = `Subagent ${progress.agentName} completed.`;
5246
5271
  headerColor = theme.status.success;
5247
5272
  } else {
@@ -5261,7 +5286,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5261
5286
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color, children: item.content }) })
5262
5287
  ] }, item.id);
5263
5288
  } else if (item.type === "tool_call") {
5264
- const statusSymbol = item.status === "running" /* RUNNING */ ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(build_default, { type: "dots" }) : item.status === "completed" /* COMPLETED */ ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.success, children: TOOL_STATUS.SUCCESS }) : item.status === "cancelled" /* CANCELLED */ ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.warning, bold: true, children: TOOL_STATUS.CANCELED }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.error, children: TOOL_STATUS.ERROR });
5289
+ const statusSymbol = item.status === SubagentState.RUNNING ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(build_default, { type: "dots" }) : item.status === SubagentState.COMPLETED ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.success, children: TOOL_STATUS.SUCCESS }) : item.status === SubagentState.CANCELLED ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.warning, bold: true, children: TOOL_STATUS.CANCELED }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.error, children: TOOL_STATUS.ERROR });
5265
5290
  const formattedArgs = item.description || formatToolArgs(item.args);
5266
5291
  const displayArgs = formattedArgs.length > 60 ? formattedArgs.slice(0, 60) + "..." : formattedArgs;
5267
5292
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box_default, { flexDirection: "row", children: [
@@ -5272,7 +5297,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5272
5297
  {
5273
5298
  bold: true,
5274
5299
  color: theme.text.primary,
5275
- strikethrough: item.status === "cancelled" /* CANCELLED */,
5300
+ strikethrough: item.status === SubagentState.CANCELLED,
5276
5301
  children: item.displayName || item.content
5277
5302
  }
5278
5303
  ),
@@ -5281,7 +5306,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5281
5306
  {
5282
5307
  color: theme.text.secondary,
5283
5308
  wrap: "truncate",
5284
- strikethrough: item.status === "cancelled" /* CANCELLED */,
5309
+ strikethrough: item.status === SubagentState.CANCELLED,
5285
5310
  children: displayArgs
5286
5311
  }
5287
5312
  ) })
@@ -5301,7 +5326,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5301
5326
  MarkdownDisplay,
5302
5327
  {
5303
5328
  text: safeJsonToMarkdown(progress.result),
5304
- isPending: progress.state !== "completed" /* COMPLETED */,
5329
+ isPending: progress.state !== SubagentState.COMPLETED,
5305
5330
  terminalWidth
5306
5331
  }
5307
5332
  )
@@ -5655,14 +5680,14 @@ var ToolActionsProvider = (props) => {
5655
5680
  }
5656
5681
  const details = tool.confirmationDetails;
5657
5682
  if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
5658
- const cliOutcome = outcome === "cancel" /* Cancel */ ? "rejected" : "accepted";
5683
+ const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? "rejected" : "accepted";
5659
5684
  await ideClient?.resolveDiffFromCli(details.filePath, cliOutcome);
5660
5685
  }
5661
5686
  if (tool.correlationId) {
5662
5687
  await config.getMessageBus().publish({
5663
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
5688
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
5664
5689
  correlationId: tool.correlationId,
5665
- confirmed: outcome !== "cancel" /* Cancel */,
5690
+ confirmed: outcome !== ToolConfirmationOutcome.Cancel,
5666
5691
  requiresUserConfirmation: false,
5667
5692
  outcome,
5668
5693
  payload
@@ -5681,7 +5706,7 @@ var ToolActionsProvider = (props) => {
5681
5706
  );
5682
5707
  const cancel = (0, import_react12.useCallback)(
5683
5708
  async (callId) => {
5684
- await confirm(callId, "cancel" /* Cancel */);
5709
+ await confirm(callId, ToolConfirmationOutcome.Cancel);
5685
5710
  },
5686
5711
  [confirm]
5687
5712
  );
@@ -5800,7 +5825,7 @@ var ToolMessage = ({
5800
5825
  paddingX: 1,
5801
5826
  flexDirection: "column",
5802
5827
  children: [
5803
- status === "executing" /* Executing */ && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5828
+ status === CoreToolCallStatus.Executing && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5804
5829
  McpProgressIndicator,
5805
5830
  {
5806
5831
  progress,
@@ -5817,8 +5842,8 @@ var ToolMessage = ({
5817
5842
  terminalWidth,
5818
5843
  renderOutputAsMarkdown,
5819
5844
  hasFocus: isThisShellFocused2,
5820
- maxLines: kind === "agent" /* Agent */ && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
5821
- overflowDirection: kind === "agent" /* Agent */ ? "bottom" : "top"
5845
+ maxLines: kind === Kind.Agent && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
5846
+ overflowDirection: kind === Kind.Agent ? "bottom" : "top"
5822
5847
  }
5823
5848
  ),
5824
5849
  isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
@@ -6134,7 +6159,7 @@ function getInitialTrustState(settings, cwd5, isCurrentWorkspace) {
6134
6159
  settings.merged,
6135
6160
  process3.cwd()
6136
6161
  );
6137
- const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === "DO_NOT_TRUST" /* DO_NOT_TRUST */);
6162
+ const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === TrustLevel.DO_NOT_TRUST);
6138
6163
  return {
6139
6164
  currentTrustLevel: explicitTrustLevel,
6140
6165
  isInheritedTrustFromParent: !!(source === "file" && isInheritedTrust),
@@ -6179,7 +6204,7 @@ var usePermissionsModifyTrust = (onExit, addItem, targetDirectory) => {
6179
6204
  process3.cwd(),
6180
6205
  newConfig
6181
6206
  );
6182
- if (trustLevel === "DO_NOT_TRUST" /* DO_NOT_TRUST */ && isTrusted) {
6207
+ if (trustLevel === TrustLevel.DO_NOT_TRUST && isTrusted) {
6183
6208
  let message = "Note: This folder is still trusted because the connected IDE workspace is trusted.";
6184
6209
  if (source === "file") {
6185
6210
  message = "Note: This folder is still trusted because a parent folder is trusted.";
@@ -6253,18 +6278,18 @@ function PermissionsModifyTrustDialog({
6253
6278
  const TRUST_LEVEL_ITEMS = [
6254
6279
  {
6255
6280
  label: `Trust this folder (${dirName})`,
6256
- value: "TRUST_FOLDER" /* TRUST_FOLDER */,
6257
- key: "TRUST_FOLDER" /* TRUST_FOLDER */
6281
+ value: TrustLevel.TRUST_FOLDER,
6282
+ key: TrustLevel.TRUST_FOLDER
6258
6283
  },
6259
6284
  {
6260
6285
  label: `Trust parent folder (${parentFolder})`,
6261
- value: "TRUST_PARENT" /* TRUST_PARENT */,
6262
- key: "TRUST_PARENT" /* TRUST_PARENT */
6286
+ value: TrustLevel.TRUST_PARENT,
6287
+ key: TrustLevel.TRUST_PARENT
6263
6288
  },
6264
6289
  {
6265
6290
  label: "Don't trust",
6266
- value: "DO_NOT_TRUST" /* DO_NOT_TRUST */,
6267
- key: "DO_NOT_TRUST" /* DO_NOT_TRUST */
6291
+ value: TrustLevel.DO_NOT_TRUST,
6292
+ key: TrustLevel.DO_NOT_TRUST
6268
6293
  }
6269
6294
  ];
6270
6295
  const {
@@ -6504,7 +6529,7 @@ var ShellToolMessage = ({
6504
6529
  maxLinesLimit: maxLines
6505
6530
  });
6506
6531
  import_react17.default.useEffect(() => {
6507
- const isExecuting = status === "executing" /* Executing */;
6532
+ const isExecuting = status === CoreToolCallStatus.Executing;
6508
6533
  if (isExecuting && ptyId) {
6509
6534
  try {
6510
6535
  const childWidth = terminalWidth - 4;
@@ -6717,13 +6742,13 @@ var SubagentGroupDisplay = ({
6717
6742
  const singleAgent = toolCalls[0].resultDisplay;
6718
6743
  if (isSubagentProgress(singleAgent)) {
6719
6744
  switch (singleAgent.state) {
6720
- case "completed" /* COMPLETED */:
6745
+ case SubagentState.COMPLETED:
6721
6746
  headerText = "Agent Completed";
6722
6747
  break;
6723
- case "cancelled" /* CANCELLED */:
6748
+ case SubagentState.CANCELLED:
6724
6749
  headerText = "Agent Cancelled";
6725
6750
  break;
6726
- case "error" /* ERROR */:
6751
+ case SubagentState.ERROR:
6727
6752
  headerText = "Agent Error";
6728
6753
  break;
6729
6754
  default:
@@ -6739,8 +6764,8 @@ var SubagentGroupDisplay = ({
6739
6764
  for (const tc of toolCalls) {
6740
6765
  const progress = tc.resultDisplay;
6741
6766
  if (isSubagentProgress(progress)) {
6742
- if (progress.state === "completed" /* COMPLETED */) completedCount++;
6743
- else if (progress.state === "running" /* RUNNING */) runningCount++;
6767
+ if (progress.state === SubagentState.COMPLETED) completedCount++;
6768
+ else if (progress.state === SubagentState.RUNNING) runningCount++;
6744
6769
  } else {
6745
6770
  runningCount++;
6746
6771
  }
@@ -6819,7 +6844,7 @@ var SubagentGroupDisplay = ({
6819
6844
  if (!isExpanded) {
6820
6845
  let content = "Starting...";
6821
6846
  let formattedArgs;
6822
- if (progress.state === "completed" /* COMPLETED */) {
6847
+ if (progress.state === SubagentState.COMPLETED) {
6823
6848
  if (progress.terminateReason && progress.terminateReason !== "GOAL") {
6824
6849
  content = `Finished Early (${progress.terminateReason})`;
6825
6850
  } else {
@@ -6833,17 +6858,17 @@ var SubagentGroupDisplay = ({
6833
6858
  formattedArgs = formatToolArgs(lastActivity.args);
6834
6859
  }
6835
6860
  }
6836
- const displayArgs = progress.state === "completed" /* COMPLETED */ ? "" : formattedArgs;
6861
+ const displayArgs = progress.state === SubagentState.COMPLETED ? "" : formattedArgs;
6837
6862
  const renderStatusIcon = () => {
6838
- const state = progress.state ?? "running" /* RUNNING */;
6863
+ const state = progress.state ?? SubagentState.RUNNING;
6839
6864
  switch (state) {
6840
- case "running" /* RUNNING */:
6865
+ case SubagentState.RUNNING:
6841
6866
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.text.primary, children: "!" });
6842
- case "completed" /* COMPLETED */:
6867
+ case SubagentState.COMPLETED:
6843
6868
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.success, children: "\u2713" });
6844
- case "cancelled" /* CANCELLED */:
6869
+ case SubagentState.CANCELLED:
6845
6870
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.warning, children: "\u2139" });
6846
- case "error" /* ERROR */:
6871
+ case SubagentState.ERROR:
6847
6872
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.error, children: "\u2717" });
6848
6873
  default:
6849
6874
  return checkExhaustive(state);
@@ -6896,22 +6921,22 @@ var hasPayload = (res) => {
6896
6921
  function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerminalHeight, isClickable) {
6897
6922
  const added = (diff.diffStat?.model_added_lines ?? 0) + (diff.diffStat?.user_added_lines ?? 0);
6898
6923
  const removed = (diff.diffStat?.model_removed_lines ?? 0) + (diff.diffStat?.user_removed_lines ?? 0);
6899
- const isAcceptedOrConfirming = status === "success" /* Success */ || status === "executing" /* Executing */ || status === "awaiting_approval" /* AwaitingApproval */;
6924
+ const isAcceptedOrConfirming = status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing || status === CoreToolCallStatus.AwaitingApproval;
6900
6925
  const addColor = isAcceptedOrConfirming ? theme.status.success : theme.text.secondary;
6901
6926
  const removeColor = isAcceptedOrConfirming ? theme.status.error : theme.text.secondary;
6902
6927
  const showDiffStat = !!diff.diffStat;
6903
6928
  const description = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box_default, { flexDirection: "row", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: theme.text.secondary, wrap: "truncate-end", children: diff.fileName }) });
6904
6929
  let resultSummary = "";
6905
6930
  let resultColor = theme.text.secondary;
6906
- if (status === "awaiting_approval" /* AwaitingApproval */) {
6931
+ if (status === CoreToolCallStatus.AwaitingApproval) {
6907
6932
  resultSummary = "Confirming";
6908
- } else if (status === "success" /* Success */ || status === "executing" /* Executing */) {
6933
+ } else if (status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing) {
6909
6934
  resultSummary = "Accepted";
6910
6935
  resultColor = theme.text.accent;
6911
- } else if (status === "cancelled" /* Cancelled */) {
6936
+ } else if (status === CoreToolCallStatus.Cancelled) {
6912
6937
  resultSummary = "Rejected";
6913
6938
  resultColor = theme.status.error;
6914
- } else if (status === "error" /* Error */) {
6939
+ } else if (status === CoreToolCallStatus.Error) {
6915
6940
  resultSummary = typeof resultDisplay === "string" ? resultDisplay : "Failed";
6916
6941
  resultColor = theme.status.error;
6917
6942
  }
@@ -6942,7 +6967,7 @@ function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerm
6942
6967
  filename: diff.fileName,
6943
6968
  terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
6944
6969
  availableTerminalHeight,
6945
- disableColor: status === "cancelled" /* Cancelled */
6970
+ disableColor: status === CoreToolCallStatus.Cancelled
6946
6971
  }
6947
6972
  );
6948
6973
  return { description, summary, payload };
@@ -7070,10 +7095,10 @@ var DenseToolMessage = (props) => {
7070
7095
  if (isGrepResult(resultDisplay)) {
7071
7096
  return getGenericSuccessData(resultDisplay, originalDescription);
7072
7097
  }
7073
- if (status === "success" /* Success */ && resultDisplay) {
7098
+ if (status === CoreToolCallStatus.Success && resultDisplay) {
7074
7099
  return getGenericSuccessData(resultDisplay, originalDescription);
7075
7100
  }
7076
- if (status === "error" /* Error */) {
7101
+ if (status === CoreToolCallStatus.Error) {
7077
7102
  const text = typeof resultDisplay === "string" ? resultDisplay.replace(/\n/g, " ") : "Failed";
7078
7103
  const errorSummary = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: theme.status.error, wrap: "truncate-end", children: [
7079
7104
  "\u2192 ",
@@ -7114,7 +7139,7 @@ var DenseToolMessage = (props) => {
7114
7139
  language: fileExtension,
7115
7140
  maxWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
7116
7141
  settings,
7117
- disableColor: status === "cancelled" /* Cancelled */,
7142
+ disableColor: status === CoreToolCallStatus.Cancelled,
7118
7143
  returnLines: true
7119
7144
  });
7120
7145
  } else {
@@ -7122,7 +7147,7 @@ var DenseToolMessage = (props) => {
7122
7147
  parsedLines,
7123
7148
  filename: diff.fileName,
7124
7149
  terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
7125
- disableColor: status === "cancelled" /* Cancelled */
7150
+ disableColor: status === CoreToolCallStatus.Cancelled
7126
7151
  });
7127
7152
  }
7128
7153
  }, [diff, isExpanded, isAlternateBuffer, terminalWidth, settings, status]);
@@ -7252,7 +7277,7 @@ function isToolExecuting(pendingHistoryItems) {
7252
7277
  return pendingHistoryItems.some((item) => {
7253
7278
  if (item && item.type === "tool_group") {
7254
7279
  return item.tools.some(
7255
- (tool) => "executing" /* Executing */ === tool.status
7280
+ (tool) => CoreToolCallStatus.Executing === tool.status
7256
7281
  );
7257
7282
  }
7258
7283
  return false;
@@ -7261,7 +7286,7 @@ function isToolExecuting(pendingHistoryItems) {
7261
7286
  function isToolAwaitingConfirmation(pendingHistoryItems) {
7262
7287
  return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
7263
7288
  (item) => item.tools.some(
7264
- (tool) => "awaiting_approval" /* AwaitingApproval */ === tool.status
7289
+ (tool) => CoreToolCallStatus.AwaitingApproval === tool.status
7265
7290
  )
7266
7291
  );
7267
7292
  }
@@ -7284,14 +7309,14 @@ function getToolGroupBorderAppearance(item, activeShellPtyId, embeddedShellFocus
7284
7309
  if (isTrackedToolCall(t)) {
7285
7310
  return t.status !== "success" && t.status !== "error" && t.status !== "cancelled";
7286
7311
  } else {
7287
- return t.status !== "success" /* Success */ && t.status !== "error" /* Error */ && t.status !== "cancelled" /* Cancelled */;
7312
+ return t.status !== CoreToolCallStatus.Success && t.status !== CoreToolCallStatus.Error && t.status !== CoreToolCallStatus.Cancelled;
7288
7313
  }
7289
7314
  });
7290
7315
  const isEmbeddedShellFocused = toolsToInspect.some((t) => {
7291
7316
  if (isTrackedToolCall(t)) {
7292
7317
  return isShellTool(t.request.name) && t.status === "executing" && t.pid === activeShellPtyId && !!embeddedShellFocused;
7293
7318
  } else {
7294
- return isShellTool(t.name) && t.status === "executing" /* Executing */ && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
7319
+ return isShellTool(t.name) && t.status === CoreToolCallStatus.Executing && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
7295
7320
  }
7296
7321
  });
7297
7322
  const isShellCommand = toolsToInspect.some((t) => {
@@ -7390,7 +7415,7 @@ var ToolGroupMessage = ({
7390
7415
  const groupedTools = (0, import_react21.useMemo)(() => {
7391
7416
  const groups = [];
7392
7417
  for (const tool of visibleToolCalls) {
7393
- if (tool.kind === "agent" /* Agent */) {
7418
+ if (tool.kind === Kind.Agent) {
7394
7419
  const lastGroup = groups[groups.length - 1];
7395
7420
  if (Array.isArray(lastGroup)) {
7396
7421
  lastGroup.push(tool);
@@ -7445,7 +7470,7 @@ var ToolGroupMessage = ({
7445
7470
  }, [groupedTools, isCompactModeEnabled, borderTopOverride]);
7446
7471
  let countToolCallsWithResults = 0;
7447
7472
  for (const tool of visibleToolCalls) {
7448
- if (tool.kind !== "agent" /* Agent */) {
7473
+ if (tool.kind !== Kind.Agent) {
7449
7474
  if (isCompactTool(tool, isCompactModeEnabled)) {
7450
7475
  if (hasDensePayload(tool)) {
7451
7476
  countToolCallsWithResults++;
@@ -7619,7 +7644,7 @@ var ToolGroupDisplay = ({
7619
7644
  }
7620
7645
  const { tools, borderColor, borderDimColor, borderTop, borderBottom } = item;
7621
7646
  const visibleTools = tools.filter(
7622
- (t) => t.status !== "awaiting_approval" /* AwaitingApproval */
7647
+ (t) => t.status !== CoreToolCallStatus.AwaitingApproval
7623
7648
  );
7624
7649
  const noticeTools = visibleTools.filter((t) => t.format === "notice");
7625
7650
  const otherTools = visibleTools.filter(
@@ -7821,18 +7846,18 @@ function CompressionMessage({
7821
7846
  return "Compressing chat history";
7822
7847
  }
7823
7848
  switch (compressionStatus) {
7824
- case 1 /* COMPRESSED */:
7849
+ case CompressionStatus.COMPRESSED:
7825
7850
  return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
7826
- case 2 /* COMPRESSION_FAILED_INFLATED_TOKEN_COUNT */:
7851
+ case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
7827
7852
  if (originalTokens < 5e4) {
7828
7853
  return "Compression was not beneficial for this history size.";
7829
7854
  }
7830
7855
  return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
7831
- case 3 /* COMPRESSION_FAILED_TOKEN_COUNT_ERROR */:
7856
+ case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
7832
7857
  return "Could not compress chat history due to a token counting error.";
7833
- case 4 /* COMPRESSION_FAILED_EMPTY_SUMMARY */:
7858
+ case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
7834
7859
  return "Chat history compression failed: the model returned an empty summary.";
7835
- case 5 /* NOOP */:
7860
+ case CompressionStatus.NOOP:
7836
7861
  return "Nothing to compress.";
7837
7862
  default:
7838
7863
  return "";
@@ -8031,6 +8056,18 @@ function areModelMetricsEqual(a, b) {
8031
8056
  if (a.api.totalRequests !== b.api.totalRequests || a.api.totalErrors !== b.api.totalErrors || a.api.totalLatencyMs !== b.api.totalLatencyMs) {
8032
8057
  return false;
8033
8058
  }
8059
+ const errorsA = a.api.errorsByType || {};
8060
+ const errorsB = b.api.errorsByType || {};
8061
+ const keysA = Object.keys(errorsA);
8062
+ const keysB = Object.keys(errorsB);
8063
+ if (keysA.length !== keysB.length) {
8064
+ return false;
8065
+ }
8066
+ for (const key of keysA) {
8067
+ if (errorsA[key] !== errorsB[key]) {
8068
+ return false;
8069
+ }
8070
+ }
8034
8071
  if (a.tokens.input !== b.tokens.input || a.tokens.prompt !== b.tokens.prompt || a.tokens.candidates !== b.tokens.candidates || a.tokens.total !== b.tokens.total || a.tokens.cached !== b.tokens.cached || a.tokens.thoughts !== b.tokens.thoughts || a.tokens.tool !== b.tokens.tool) {
8035
8072
  return false;
8036
8073
  }
@@ -8258,8 +8295,8 @@ var ModelUsageTable = ({ models }) => {
8258
8295
  );
8259
8296
  roleEntries.sort(([a], [b]) => {
8260
8297
  if (a === b) return 0;
8261
- if (a === "main" /* MAIN */) return -1;
8262
- if (b === "main" /* MAIN */) return 1;
8298
+ if (a === LlmRole.MAIN) return -1;
8299
+ if (b === LlmRole.MAIN) return 1;
8263
8300
  return a.localeCompare(b);
8264
8301
  });
8265
8302
  roleEntries.forEach(([role, roleMetrics]) => {
@@ -8590,8 +8627,8 @@ var ModelStatsDisplay = ({
8590
8627
  return validRoles.includes(role);
8591
8628
  }).sort((a, b) => {
8592
8629
  if (a === b) return 0;
8593
- if (a === "main" /* MAIN */) return -1;
8594
- if (b === "main" /* MAIN */) return 1;
8630
+ if (a === LlmRole.MAIN) return -1;
8631
+ if (b === LlmRole.MAIN) return 1;
8595
8632
  return a.localeCompare(b);
8596
8633
  });
8597
8634
  const createRow = (metric, getValue, options = {}) => {
@@ -9382,7 +9419,7 @@ var McpStatus = ({
9382
9419
  );
9383
9420
  const originalStatus = serverStatus(serverName);
9384
9421
  const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
9385
- const status = originalStatus === "disconnected" /* DISCONNECTED */ && hasCachedItems ? "connected" /* CONNECTED */ : originalStatus;
9422
+ const status = originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems ? MCPServerStatus.CONNECTED : originalStatus;
9386
9423
  let statusIndicator = "";
9387
9424
  let statusText = "";
9388
9425
  let statusColor = theme.text.primary;
@@ -9394,17 +9431,17 @@ var McpStatus = ({
9394
9431
  statusColor = theme.text.secondary;
9395
9432
  } else {
9396
9433
  switch (status) {
9397
- case "connected" /* CONNECTED */:
9434
+ case MCPServerStatus.CONNECTED:
9398
9435
  statusIndicator = "\u{1F7E2}";
9399
9436
  statusText = "Ready";
9400
9437
  statusColor = theme.status.success;
9401
9438
  break;
9402
- case "connecting" /* CONNECTING */:
9439
+ case MCPServerStatus.CONNECTING:
9403
9440
  statusIndicator = "\u{1F504}";
9404
9441
  statusText = "Starting... (first startup may take longer)";
9405
9442
  statusColor = theme.status.warning;
9406
9443
  break;
9407
- case "disconnected" /* DISCONNECTED */:
9444
+ case MCPServerStatus.DISCONNECTED:
9408
9445
  default:
9409
9446
  statusIndicator = "\u{1F534}";
9410
9447
  statusText = "Disconnected";
@@ -9452,12 +9489,12 @@ var McpStatus = ({
9452
9489
  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
9453
9490
  " - ",
9454
9491
  statusText,
9455
- status === "connected" /* CONNECTED */ && parts.length > 0 && ` (${parts.join(", ")})`
9492
+ status === MCPServerStatus.CONNECTED && parts.length > 0 && ` (${parts.join(", ")})`
9456
9493
  ] }),
9457
9494
  authStatusNode
9458
9495
  ] }),
9459
- status === "connecting" /* CONNECTING */ && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
9460
- status === "disconnected" /* DISCONNECTED */ && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
9496
+ status === MCPServerStatus.CONNECTING && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
9497
+ status === MCPServerStatus.DISCONNECTED && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
9461
9498
  " (",
9462
9499
  toolCount,
9463
9500
  " tools cached)"
@@ -10018,7 +10055,7 @@ var Notifications = () => {
10018
10055
  if (dismissed) return [];
10019
10056
  const counts = persistentState.get("startupWarningCounts") || {};
10020
10057
  return startupWarnings.filter((w) => {
10021
- if (w.priority === "low" /* Low */) {
10058
+ if (w.priority === WarningPriority.Low) {
10022
10059
  const count = counts[w.id] || 0;
10023
10060
  return count < MAX_STARTUP_WARNING_SHOW_COUNT;
10024
10061
  }
@@ -10031,7 +10068,7 @@ var Notifications = () => {
10031
10068
  const counts = { ...persistentState.get("startupWarningCounts") || {} };
10032
10069
  let changed = false;
10033
10070
  visibleWarnings.forEach((w) => {
10034
- if (w.priority === "low" /* Low */) {
10071
+ if (w.priority === WarningPriority.Low) {
10035
10072
  counts[w.id] = (counts[w.id] || 0) + 1;
10036
10073
  changed = true;
10037
10074
  }
@@ -10138,7 +10175,7 @@ var UserIdentity = ({ config }) => {
10138
10175
  }
10139
10176
  return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { flexDirection: "column", children: [
10140
10177
  /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { children: [
10141
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { children: [
10178
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType === AuthType.LOGIN_WITH_GOOGLE ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { children: [
10142
10179
  /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { bold: true, children: [
10143
10180
  "Signed in with Google",
10144
10181
  email ? ":" : ""
@@ -10381,7 +10418,7 @@ var import_react32 = __toESM(require_react(), 1);
10381
10418
  function getConfirmingToolState(pendingHistoryItems) {
10382
10419
  const allPendingTools = getAllToolCalls(pendingHistoryItems);
10383
10420
  const confirmingTools = allPendingTools.filter(
10384
- (tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
10421
+ (tool) => tool.status === CoreToolCallStatus.AwaitingApproval
10385
10422
  );
10386
10423
  if (confirmingTools.length === 0) {
10387
10424
  return null;
@@ -11689,7 +11726,7 @@ var ExitPlanModeDialog = ({
11689
11726
  {
11690
11727
  questions: [
11691
11728
  {
11692
- type: "choice" /* CHOICE */,
11729
+ type: QuestionType.CHOICE,
11693
11730
  header: "Approval",
11694
11731
  question: planContent,
11695
11732
  options: [
@@ -11710,9 +11747,9 @@ var ExitPlanModeDialog = ({
11710
11747
  onSubmit: (answers) => {
11711
11748
  const answer = answers["0"];
11712
11749
  if (answer === "Yes, automatically accept edits" /* Auto */) {
11713
- onApprove("autoEdit" /* AUTO_EDIT */);
11750
+ onApprove(ApprovalMode.AUTO_EDIT);
11714
11751
  } else if (answer === "Yes, manually accept edits" /* Manual */) {
11715
- onApprove("default" /* DEFAULT */);
11752
+ onApprove(ApprovalMode.DEFAULT);
11716
11753
  } else if (answer) {
11717
11754
  onFeedback(answer);
11718
11755
  }
@@ -11923,7 +11960,7 @@ ${deceptiveUrlWarnings.map(
11923
11960
  );
11924
11961
  (0, import_react37.useEffect)(() => {
11925
11962
  if (isCancelling) {
11926
- handleConfirm("cancel" /* Cancel */);
11963
+ handleConfirm(ToolConfirmationOutcome.Cancel);
11927
11964
  }
11928
11965
  }, [isCancelling, handleConfirm]);
11929
11966
  const handleSelect = (0, import_react37.useCallback)(
@@ -11936,19 +11973,19 @@ ${deceptiveUrlWarnings.map(
11936
11973
  if (!confirmationDetails.isModifying) {
11937
11974
  options2.push({
11938
11975
  label: "Allow once",
11939
- value: "proceed_once" /* ProceedOnce */,
11976
+ value: ToolConfirmationOutcome.ProceedOnce,
11940
11977
  key: "Allow once"
11941
11978
  });
11942
11979
  if (isTrustedFolder) {
11943
11980
  options2.push({
11944
11981
  label: "Allow for this session",
11945
- value: "proceed_always" /* ProceedAlways */,
11982
+ value: ToolConfirmationOutcome.ProceedAlways,
11946
11983
  key: "Allow for this session"
11947
11984
  });
11948
11985
  if (allowPermanentApproval) {
11949
11986
  options2.push({
11950
11987
  label: "Allow for this file in all future sessions",
11951
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
11988
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
11952
11989
  key: "Allow for this file in all future sessions"
11953
11990
  });
11954
11991
  }
@@ -11956,119 +11993,119 @@ ${deceptiveUrlWarnings.map(
11956
11993
  if (!config.getIdeMode() || !isDiffingEnabled) {
11957
11994
  options2.push({
11958
11995
  label: "Modify with external editor",
11959
- value: "modify_with_editor" /* ModifyWithEditor */,
11996
+ value: ToolConfirmationOutcome.ModifyWithEditor,
11960
11997
  key: "Modify with external editor"
11961
11998
  });
11962
11999
  }
11963
12000
  options2.push({
11964
12001
  label: "No, suggest changes (esc)",
11965
- value: "cancel" /* Cancel */,
12002
+ value: ToolConfirmationOutcome.Cancel,
11966
12003
  key: "No, suggest changes (esc)"
11967
12004
  });
11968
12005
  }
11969
12006
  } else if (confirmationDetails.type === "sandbox_expansion") {
11970
12007
  options2.push({
11971
12008
  label: "Allow once",
11972
- value: "proceed_once" /* ProceedOnce */,
12009
+ value: ToolConfirmationOutcome.ProceedOnce,
11973
12010
  key: "Allow once"
11974
12011
  });
11975
12012
  if (isTrustedFolder) {
11976
12013
  options2.push({
11977
12014
  label: "Allow for this session",
11978
- value: "proceed_always" /* ProceedAlways */,
12015
+ value: ToolConfirmationOutcome.ProceedAlways,
11979
12016
  key: "Allow for this session"
11980
12017
  });
11981
12018
  if (allowPermanentApproval) {
11982
12019
  options2.push({
11983
12020
  label: "Allow for all future sessions",
11984
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12021
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
11985
12022
  key: "Allow for all future sessions"
11986
12023
  });
11987
12024
  }
11988
12025
  }
11989
12026
  options2.push({
11990
12027
  label: "No, suggest changes (esc)",
11991
- value: "cancel" /* Cancel */,
12028
+ value: ToolConfirmationOutcome.Cancel,
11992
12029
  key: "No, suggest changes (esc)"
11993
12030
  });
11994
12031
  } else if (confirmationDetails.type === "exec") {
11995
12032
  options2.push({
11996
12033
  label: "Allow once",
11997
- value: "proceed_once" /* ProceedOnce */,
12034
+ value: ToolConfirmationOutcome.ProceedOnce,
11998
12035
  key: "Allow once"
11999
12036
  });
12000
12037
  if (isTrustedFolder) {
12001
12038
  options2.push({
12002
12039
  label: `Allow for this session`,
12003
- value: "proceed_always" /* ProceedAlways */,
12040
+ value: ToolConfirmationOutcome.ProceedAlways,
12004
12041
  key: `Allow for this session`
12005
12042
  });
12006
12043
  if (allowPermanentApproval) {
12007
12044
  options2.push({
12008
12045
  label: `Allow this command for all future sessions`,
12009
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12046
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12010
12047
  key: `Allow for all future sessions`
12011
12048
  });
12012
12049
  }
12013
12050
  }
12014
12051
  options2.push({
12015
12052
  label: "No, suggest changes (esc)",
12016
- value: "cancel" /* Cancel */,
12053
+ value: ToolConfirmationOutcome.Cancel,
12017
12054
  key: "No, suggest changes (esc)"
12018
12055
  });
12019
12056
  } else if (confirmationDetails.type === "info") {
12020
12057
  options2.push({
12021
12058
  label: "Allow once",
12022
- value: "proceed_once" /* ProceedOnce */,
12059
+ value: ToolConfirmationOutcome.ProceedOnce,
12023
12060
  key: "Allow once"
12024
12061
  });
12025
12062
  if (isTrustedFolder) {
12026
12063
  options2.push({
12027
12064
  label: "Allow for this session",
12028
- value: "proceed_always" /* ProceedAlways */,
12065
+ value: ToolConfirmationOutcome.ProceedAlways,
12029
12066
  key: "Allow for this session"
12030
12067
  });
12031
12068
  if (allowPermanentApproval) {
12032
12069
  options2.push({
12033
12070
  label: "Allow for all future sessions",
12034
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12071
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12035
12072
  key: "Allow for all future sessions"
12036
12073
  });
12037
12074
  }
12038
12075
  }
12039
12076
  options2.push({
12040
12077
  label: "No, suggest changes (esc)",
12041
- value: "cancel" /* Cancel */,
12078
+ value: ToolConfirmationOutcome.Cancel,
12042
12079
  key: "No, suggest changes (esc)"
12043
12080
  });
12044
12081
  } else if (confirmationDetails.type === "mcp") {
12045
12082
  options2.push({
12046
12083
  label: "Allow once",
12047
- value: "proceed_once" /* ProceedOnce */,
12084
+ value: ToolConfirmationOutcome.ProceedOnce,
12048
12085
  key: "Allow once"
12049
12086
  });
12050
12087
  if (isTrustedFolder) {
12051
12088
  options2.push({
12052
12089
  label: "Allow tool for this session",
12053
- value: "proceed_always_tool" /* ProceedAlwaysTool */,
12090
+ value: ToolConfirmationOutcome.ProceedAlwaysTool,
12054
12091
  key: "Allow tool for this session"
12055
12092
  });
12056
12093
  options2.push({
12057
12094
  label: "Allow all server tools for this session",
12058
- value: "proceed_always_server" /* ProceedAlwaysServer */,
12095
+ value: ToolConfirmationOutcome.ProceedAlwaysServer,
12059
12096
  key: "Allow all server tools for this session"
12060
12097
  });
12061
12098
  if (allowPermanentApproval) {
12062
12099
  options2.push({
12063
12100
  label: "Allow tool for all future sessions",
12064
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12101
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12065
12102
  key: "Allow tool for all future sessions"
12066
12103
  });
12067
12104
  }
12068
12105
  }
12069
12106
  options2.push({
12070
12107
  label: "No, suggest changes (esc)",
12071
- value: "cancel" /* Cancel */,
12108
+ value: ToolConfirmationOutcome.Cancel,
12072
12109
  key: "No, suggest changes (esc)"
12073
12110
  });
12074
12111
  }
@@ -12107,7 +12144,7 @@ ${deceptiveUrlWarnings.map(
12107
12144
  const containsRedirection = commandsToDisplay.some(
12108
12145
  (cmd) => hasRedirection(cmd)
12109
12146
  );
12110
- const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
12147
+ const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
12111
12148
  if (containsRedirection && !isAutoEdit) {
12112
12149
  extraInfoLines = 1;
12113
12150
  }
@@ -12133,7 +12170,7 @@ ${deceptiveUrlWarnings.map(
12133
12170
  const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
12134
12171
  if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
12135
12172
  const alwaysAndSaveIndex = options2.findIndex(
12136
- (o) => o.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */
12173
+ (o) => o.value === ToolConfirmationOutcome.ProceedAlwaysAndSave
12137
12174
  );
12138
12175
  if (alwaysAndSaveIndex !== -1) {
12139
12176
  initialIndex2 = alwaysAndSaveIndex;
@@ -12150,10 +12187,10 @@ ${deceptiveUrlWarnings.map(
12150
12187
  {
12151
12188
  questions: confirmationDetails.questions,
12152
12189
  onSubmit: (answers) => {
12153
- handleConfirm("proceed_once" /* ProceedOnce */, { answers });
12190
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, { answers });
12154
12191
  },
12155
12192
  onCancel: () => {
12156
- handleConfirm("cancel" /* Cancel */);
12193
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12157
12194
  },
12158
12195
  width: terminalWidth,
12159
12196
  availableHeight: bodyHeight
@@ -12174,19 +12211,19 @@ ${deceptiveUrlWarnings.map(
12174
12211
  planPath: confirmationDetails.planPath,
12175
12212
  getPreferredEditor,
12176
12213
  onApprove: (approvalMode) => {
12177
- handleConfirm("proceed_once" /* ProceedOnce */, {
12214
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
12178
12215
  approved: true,
12179
12216
  approvalMode
12180
12217
  });
12181
12218
  },
12182
12219
  onFeedback: (feedback) => {
12183
- handleConfirm("proceed_once" /* ProceedOnce */, {
12220
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
12184
12221
  approved: false,
12185
12222
  feedback
12186
12223
  });
12187
12224
  },
12188
12225
  onCancel: () => {
12189
- handleConfirm("cancel" /* Cancel */);
12226
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12190
12227
  },
12191
12228
  width: terminalWidth,
12192
12229
  availableHeight: bodyHeight
@@ -12295,7 +12332,7 @@ ${deceptiveUrlWarnings.map(
12295
12332
  const containsRedirection = commandsToDisplay.some(
12296
12333
  (cmd) => hasRedirection(cmd)
12297
12334
  );
12298
- const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
12335
+ const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
12299
12336
  let warnings = null;
12300
12337
  if (containsRedirection && !isAutoEdit) {
12301
12338
  const tipText = `To auto-accept, press ${formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */)}`;
@@ -12454,7 +12491,7 @@ ${deceptiveUrlWarnings.map(
12454
12491
  const bodyOverflowDirection = confirmationDetails.type === "mcp" && isMcpToolDetailsExpanded ? "bottom" : "top";
12455
12492
  const renderRadioItem = (0, import_react37.useCallback)(
12456
12493
  (item, { titleColor }) => {
12457
- if (item.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */) {
12494
+ if (item.value === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
12458
12495
  return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(Text, { color: titleColor, wrap: "truncate", children: [
12459
12496
  item.label,
12460
12497
  " ",
@@ -14484,7 +14521,7 @@ async function validateAuthMethodWithSettings(authType, settings) {
14484
14521
  if (settings.merged.security.auth.useExternal) {
14485
14522
  return null;
14486
14523
  }
14487
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14524
+ if (authType === AuthType.USE_GEMINI) {
14488
14525
  return null;
14489
14526
  }
14490
14527
  return validateAuthMethod(authType);
@@ -14536,7 +14573,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
14536
14573
  }
14537
14574
  return;
14538
14575
  }
14539
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14576
+ if (authType === AuthType.USE_GEMINI) {
14540
14577
  const key = await reloadApiKey();
14541
14578
  if (!key) {
14542
14579
  setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
@@ -14614,31 +14651,31 @@ function AuthDialog({
14614
14651
  let items = [
14615
14652
  {
14616
14653
  label: "Sign in with Google",
14617
- value: "oauth-personal" /* LOGIN_WITH_GOOGLE */,
14618
- key: "oauth-personal" /* LOGIN_WITH_GOOGLE */
14654
+ value: AuthType.LOGIN_WITH_GOOGLE,
14655
+ key: AuthType.LOGIN_WITH_GOOGLE
14619
14656
  },
14620
14657
  ...process.env["CLOUD_SHELL"] === "true" ? [
14621
14658
  {
14622
14659
  label: "Use Cloud Shell user credentials",
14623
- value: "compute-default-credentials" /* COMPUTE_ADC */,
14624
- key: "compute-default-credentials" /* COMPUTE_ADC */
14660
+ value: AuthType.COMPUTE_ADC,
14661
+ key: AuthType.COMPUTE_ADC
14625
14662
  }
14626
14663
  ] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
14627
14664
  {
14628
14665
  label: "Use metadata server application default credentials",
14629
- value: "compute-default-credentials" /* COMPUTE_ADC */,
14630
- key: "compute-default-credentials" /* COMPUTE_ADC */
14666
+ value: AuthType.COMPUTE_ADC,
14667
+ key: AuthType.COMPUTE_ADC
14631
14668
  }
14632
14669
  ] : [],
14633
14670
  {
14634
14671
  label: "Use Gemini API Key",
14635
- value: "gemini-api-key" /* USE_GEMINI */,
14636
- key: "gemini-api-key" /* USE_GEMINI */
14672
+ value: AuthType.USE_GEMINI,
14673
+ key: AuthType.USE_GEMINI
14637
14674
  },
14638
14675
  {
14639
14676
  label: "Vertex AI",
14640
- value: "vertex-ai" /* USE_VERTEX_AI */,
14641
- key: "vertex-ai" /* USE_VERTEX_AI */
14677
+ value: AuthType.USE_VERTEX_AI,
14678
+ key: AuthType.USE_VERTEX_AI
14642
14679
  }
14643
14680
  ];
14644
14681
  if (settings.merged.security.auth.enforcedType) {
@@ -14660,9 +14697,9 @@ function AuthDialog({
14660
14697
  return item.value === defaultAuthType;
14661
14698
  }
14662
14699
  if (process.env["GEMINI_API_KEY"]) {
14663
- return item.value === "gemini-api-key" /* USE_GEMINI */;
14700
+ return item.value === AuthType.USE_GEMINI;
14664
14701
  }
14665
- return item.value === "oauth-personal" /* LOGIN_WITH_GOOGLE */;
14702
+ return item.value === AuthType.LOGIN_WITH_GOOGLE;
14666
14703
  });
14667
14704
  if (settings.merged.security.auth.enforcedType) {
14668
14705
  initialAuthIndex = 0;
@@ -14673,7 +14710,7 @@ function AuthDialog({
14673
14710
  return;
14674
14711
  }
14675
14712
  if (authType) {
14676
- const needsRestart = authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ || authType === "vertex-ai" /* USE_VERTEX_AI */ && process.env["CLOUD_SHELL"] === "true";
14713
+ const needsRestart = authType === AuthType.LOGIN_WITH_GOOGLE || authType === AuthType.USE_VERTEX_AI && process.env["CLOUD_SHELL"] === "true";
14677
14714
  if (needsRestart) {
14678
14715
  setAuthContext({ requiresRestart: true });
14679
14716
  } else {
@@ -14681,12 +14718,12 @@ function AuthDialog({
14681
14718
  }
14682
14719
  await clearCachedCredentialFile();
14683
14720
  settings.setValue(scope, "security.auth.selectedType", authType);
14684
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
14721
+ if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
14685
14722
  setExiting(true);
14686
14723
  setTimeout(relaunchApp, 100);
14687
14724
  return;
14688
14725
  }
14689
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14726
+ if (authType === AuthType.USE_GEMINI) {
14690
14727
  setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
14691
14728
  return;
14692
14729
  }
@@ -15482,11 +15519,11 @@ var PrivacyNoticeText = ({
15482
15519
  }) => {
15483
15520
  const authType = config.getContentGeneratorConfig()?.authType;
15484
15521
  switch (authType) {
15485
- case "gemini-api-key" /* USE_GEMINI */:
15522
+ case AuthType.USE_GEMINI:
15486
15523
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GeminiPrivacyNotice, { onExit });
15487
- case "vertex-ai" /* USE_VERTEX_AI */:
15524
+ case AuthType.USE_VERTEX_AI:
15488
15525
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudPaidPrivacyNotice, { onExit });
15489
- case "oauth-personal" /* LOGIN_WITH_GOOGLE */:
15526
+ case AuthType.LOGIN_WITH_GOOGLE:
15490
15527
  default:
15491
15528
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudFreePrivacyNotice, { config, onExit });
15492
15529
  }
@@ -15527,7 +15564,7 @@ function ProQuotaDialog({
15527
15564
  value: "retry_always",
15528
15565
  key: "retry_always"
15529
15566
  },
15530
- ...authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && !isUltra ? [
15567
+ ...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
15531
15568
  {
15532
15569
  label: "Upgrade for higher limits",
15533
15570
  value: "upgrade",
@@ -16686,7 +16723,7 @@ function ModelDialog({ onClose }) {
16686
16723
  const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
16687
16724
  const useGemini3_5Flash = config?.hasGemini35FlashGAAccess?.() ?? false;
16688
16725
  const selectedAuthType = settings.merged.security.auth.selectedType;
16689
- const useCustomToolModel = useGemini31 && selectedAuthType === "gemini-api-key" /* USE_GEMINI */;
16726
+ const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
16690
16727
  const manualModelSelected = (0, import_react55.useMemo)(() => {
16691
16728
  if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
16692
16729
  const def = config.getModelConfigService().getModelDefinition(preferredModel);
@@ -18009,10 +18046,10 @@ function initializeConsoleStore() {
18009
18046
  globalConsoleMessages = [];
18010
18047
  globalErrorCount = 0;
18011
18048
  notifyListeners();
18012
- coreEvents.off("console-log" /* ConsoleLog */, handleConsoleLog);
18013
- coreEvents.off("output" /* Output */, handleOutput);
18014
- coreEvents.on("console-log" /* ConsoleLog */, handleConsoleLog);
18015
- coreEvents.on("output" /* Output */, handleOutput);
18049
+ coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
18050
+ coreEvents.off(CoreEvent.Output, handleOutput);
18051
+ coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
18052
+ coreEvents.on(CoreEvent.Output, handleOutput);
18016
18053
  }
18017
18054
  function notifyListeners() {
18018
18055
  for (const listener of listeners) {
@@ -20149,7 +20186,7 @@ function usePromptCompletion({
20149
20186
  { model: "prompt-completion" },
20150
20187
  contents,
20151
20188
  signal,
20152
- "utility_autocomplete" /* UTILITY_AUTOCOMPLETE */
20189
+ LlmRole.UTILITY_AUTOCOMPLETE
20153
20190
  );
20154
20191
  if (signal.aborted) {
20155
20192
  return;
@@ -22227,9 +22264,9 @@ var InputPrompt = ({
22227
22264
  onSuggestionsVisibilityChange(shouldShowSuggestions);
22228
22265
  }
22229
22266
  }, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
22230
- const showAutoAcceptStyling = !shellModeActive && approvalMode === "autoEdit" /* AUTO_EDIT */;
22231
- const showYoloStyling = !shellModeActive && approvalMode === "yolo" /* YOLO */;
22232
- const showPlanStyling = !shellModeActive && approvalMode === "plan" /* PLAN */;
22267
+ const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
22268
+ const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
22269
+ const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
22233
22270
  let statusColor;
22234
22271
  let statusText = "";
22235
22272
  if (shellModeActive) {
@@ -23062,22 +23099,22 @@ var ApprovalModeIndicator = ({
23062
23099
  const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
23063
23100
  const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
23064
23101
  switch (approvalMode) {
23065
- case "autoEdit" /* AUTO_EDIT */:
23102
+ case ApprovalMode.AUTO_EDIT:
23066
23103
  textColor = theme.status.warning;
23067
23104
  textContent = "auto-accept edits";
23068
23105
  subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
23069
23106
  break;
23070
- case "plan" /* PLAN */:
23107
+ case ApprovalMode.PLAN:
23071
23108
  textColor = theme.status.success;
23072
23109
  textContent = "plan";
23073
23110
  subText = `${cycleHint} to manual`;
23074
23111
  break;
23075
- case "yolo" /* YOLO */:
23112
+ case ApprovalMode.YOLO:
23076
23113
  textColor = theme.status.error;
23077
23114
  textContent = "YOLO";
23078
23115
  subText = yoloHint;
23079
23116
  break;
23080
- case "default" /* DEFAULT */:
23117
+ case ApprovalMode.DEFAULT:
23081
23118
  default:
23082
23119
  textColor = theme.text.accent;
23083
23120
  textContent = "";
@@ -23125,7 +23162,7 @@ var useComposerStatus = () => {
23125
23162
  (item) => item.type === "tool_group"
23126
23163
  ).some(
23127
23164
  (item) => item.tools.some(
23128
- (tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
23165
+ (tool) => tool.status === CoreToolCallStatus.AwaitingApproval
23129
23166
  )
23130
23167
  ),
23131
23168
  [uiState.pendingHistoryItems]
@@ -23140,13 +23177,13 @@ var useComposerStatus = () => {
23140
23177
  const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
23141
23178
  if (hideMinimalModeHintWhileBusy) return null;
23142
23179
  switch (showApprovalModeIndicator) {
23143
- case "yolo" /* YOLO */:
23180
+ case ApprovalMode.YOLO:
23144
23181
  return { text: "YOLO", color: theme.status.error };
23145
- case "plan" /* PLAN */:
23182
+ case ApprovalMode.PLAN:
23146
23183
  return { text: "plan", color: theme.status.success };
23147
- case "autoEdit" /* AUTO_EDIT */:
23184
+ case ApprovalMode.AUTO_EDIT:
23148
23185
  return { text: "auto edit", color: theme.status.warning };
23149
- case "default" /* DEFAULT */:
23186
+ case ApprovalMode.DEFAULT:
23150
23187
  default:
23151
23188
  return null;
23152
23189
  }
@@ -23500,7 +23537,7 @@ var ConfigInitDisplay = ({
23500
23537
  let connected = 0;
23501
23538
  const connecting = [];
23502
23539
  for (const [name, client] of clients.entries()) {
23503
- if (client.getStatus() === "connected" /* CONNECTED */) {
23540
+ if (client.getStatus() === MCPServerStatus.CONNECTED) {
23504
23541
  connected++;
23505
23542
  } else {
23506
23543
  connecting.push(name);
@@ -23522,9 +23559,9 @@ var ConfigInitDisplay = ({
23522
23559
  );
23523
23560
  }
23524
23561
  };
23525
- coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
23562
+ coreEvents.on(CoreEvent.McpClientUpdate, onChange);
23526
23563
  return () => {
23527
- coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
23564
+ coreEvents.off(CoreEvent.McpClientUpdate, onChange);
23528
23565
  };
23529
23566
  }, [initialMessage]);
23530
23567
  return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Text, { children: [
@@ -24241,7 +24278,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
24241
24278
  callId,
24242
24279
  name: SHELL_COMMAND_NAME,
24243
24280
  description: rawQuery,
24244
- status: "executing" /* Executing */,
24281
+ status: CoreToolCallStatus.Executing,
24245
24282
  isClientInitiated: true,
24246
24283
  resultDisplay: "",
24247
24284
  confirmationDetails: void 0
@@ -24382,7 +24419,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
24382
24419
  mainContent = result.output.trim() || "(Command produced no output)";
24383
24420
  }
24384
24421
  let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
24385
- let finalStatus = "success" /* Success */;
24422
+ let finalStatus = CoreToolCallStatus.Success;
24386
24423
  const prependToAnsiOutput = (output, text) => {
24387
24424
  const newLines = text.split("\n").map((line) => [
24388
24425
  {
@@ -24401,20 +24438,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
24401
24438
  };
24402
24439
  let prefix = "";
24403
24440
  if (result.error) {
24404
- finalStatus = "error" /* Error */;
24441
+ finalStatus = CoreToolCallStatus.Error;
24405
24442
  prefix = result.error.message;
24406
24443
  } else if (result.aborted) {
24407
- finalStatus = "cancelled" /* Cancelled */;
24444
+ finalStatus = CoreToolCallStatus.Cancelled;
24408
24445
  prefix = "Command was cancelled.";
24409
24446
  } else if (result.backgrounded) {
24410
- finalStatus = "success" /* Success */;
24447
+ finalStatus = CoreToolCallStatus.Success;
24411
24448
  finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
24412
24449
  mainContent = finalOutput;
24413
24450
  } else if (result.signal) {
24414
- finalStatus = "error" /* Error */;
24451
+ finalStatus = CoreToolCallStatus.Error;
24415
24452
  prefix = `Command terminated by signal: ${result.signal}.`;
24416
24453
  } else if (result.exitCode !== 0) {
24417
- finalStatus = "error" /* Error */;
24454
+ finalStatus = CoreToolCallStatus.Error;
24418
24455
  prefix = `Command exited with code ${result.exitCode}.`;
24419
24456
  }
24420
24457
  if (prefix) {
@@ -24440,7 +24477,7 @@ ${mainContent}`;
24440
24477
  status: finalStatus,
24441
24478
  resultDisplay: finalOutput
24442
24479
  };
24443
- if (finalStatus !== "cancelled" /* Cancelled */) {
24480
+ if (finalStatus !== CoreToolCallStatus.Cancelled) {
24444
24481
  addItemToHistory(
24445
24482
  {
24446
24483
  type: "tool_group",
@@ -25430,12 +25467,12 @@ function useQuotaAndFallback({
25430
25467
  error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
25431
25468
  `/stats model for usage details`,
25432
25469
  `/model to switch models.`,
25433
- contentGeneratorConfig?.authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? `/auth to switch to API key.` : null
25470
+ contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
25434
25471
  ].filter(Boolean);
25435
25472
  message = messageLines.join("\n");
25436
25473
  } else if (error instanceof ModelNotFoundError) {
25437
25474
  isModelNotFoundError = true;
25438
- if (contentGeneratorConfig?.authType === "vertex-ai" /* USE_VERTEX_AI */ && VALID_GEMINI_MODELS.has(failedModel)) {
25475
+ if (contentGeneratorConfig?.authType === AuthType.USE_VERTEX_AI && VALID_GEMINI_MODELS.has(failedModel)) {
25439
25476
  const location = process.env["GOOGLE_CLOUD_LOCATION"] || "your configured region";
25440
25477
  const messageLines = [
25441
25478
  `Model "${failedModel}" is not available in region "${location}".`,
@@ -25627,7 +25664,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
25627
25664
  );
25628
25665
  setEditorError(null);
25629
25666
  setIsEditorDialogOpen(false);
25630
- coreEvents.emit("editor-selected" /* EditorSelected */, { editor: editorType });
25667
+ coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
25631
25668
  } catch (error) {
25632
25669
  setEditorError(`Failed to set editor preference: ${error}`);
25633
25670
  }
@@ -25636,7 +25673,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
25636
25673
  );
25637
25674
  const exitEditorDialog = (0, import_react91.useCallback)(() => {
25638
25675
  setIsEditorDialogOpen(false);
25639
- coreEvents.emit("editor-selected" /* EditorSelected */, { editor: void 0 });
25676
+ coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
25640
25677
  }, []);
25641
25678
  return {
25642
25679
  isEditorDialogOpen,
@@ -26013,7 +26050,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26013
26050
  canonicalPath: resolvedCommandPath
26014
26051
  } = parseSlashCommand(trimmed, commands);
26015
26052
  if (!commandToExecute) {
26016
- const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === "in_progress" /* IN_PROGRESS */;
26053
+ const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
26017
26054
  if (isMcpLoading) {
26018
26055
  setIsProcessing(true);
26019
26056
  if (addToHistory) {
@@ -26193,7 +26230,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26193
26230
  onConfirm: async (resolvedOutcome) => {
26194
26231
  resolve3({
26195
26232
  outcome: resolvedOutcome,
26196
- approvedCommands: resolvedOutcome === "cancel" /* Cancel */ ? [] : result.commandsToConfirm
26233
+ approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
26197
26234
  });
26198
26235
  }
26199
26236
  };
@@ -26201,7 +26238,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26201
26238
  callId,
26202
26239
  name: "Expansion",
26203
26240
  description: "Command expansion needs shell access",
26204
- status: "awaiting_approval" /* AwaitingApproval */,
26241
+ status: CoreToolCallStatus.AwaitingApproval,
26205
26242
  isClientInitiated: true,
26206
26243
  resultDisplay: void 0,
26207
26244
  confirmationDetails
@@ -26212,7 +26249,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26212
26249
  });
26213
26250
  });
26214
26251
  setPendingItem(null);
26215
- if (outcome === "cancel" /* Cancel */ || !approvedCommands || approvedCommands.length === 0) {
26252
+ if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
26216
26253
  addItem(
26217
26254
  {
26218
26255
  type: "info" /* INFO */,
@@ -26222,7 +26259,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26222
26259
  );
26223
26260
  return { type: "handled" };
26224
26261
  }
26225
- if (outcome === "proceed_always" /* ProceedAlways */) {
26262
+ if (outcome === ToolConfirmationOutcome.ProceedAlways) {
26226
26263
  setSessionShellAllowlist(
26227
26264
  (prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
26228
26265
  );
@@ -26698,7 +26735,7 @@ function mapToDisplay(toolOrTools, options = {}) {
26698
26735
  let description;
26699
26736
  let renderOutputAsMarkdown = false;
26700
26737
  const displayName = call.tool?.displayName ?? call.request.name;
26701
- if (call.status === "error" /* Error */) {
26738
+ if (call.status === CoreToolCallStatus.Error) {
26702
26739
  description = JSON.stringify(call.request.args);
26703
26740
  } else {
26704
26741
  description = call.invocation.getDescription();
@@ -26721,27 +26758,27 @@ function mapToDisplay(toolOrTools, options = {}) {
26721
26758
  let progress = void 0;
26722
26759
  let progressTotal = void 0;
26723
26760
  switch (call.status) {
26724
- case "success" /* Success */:
26761
+ case CoreToolCallStatus.Success:
26725
26762
  resultDisplay = call.response.resultDisplay;
26726
26763
  outputFile = call.response.outputFile;
26727
26764
  break;
26728
- case "error" /* Error */:
26729
- case "cancelled" /* Cancelled */:
26765
+ case CoreToolCallStatus.Error:
26766
+ case CoreToolCallStatus.Cancelled:
26730
26767
  resultDisplay = call.response.resultDisplay;
26731
26768
  break;
26732
- case "awaiting_approval" /* AwaitingApproval */:
26769
+ case CoreToolCallStatus.AwaitingApproval:
26733
26770
  correlationId = call.correlationId;
26734
26771
  confirmationDetails = call.confirmationDetails;
26735
26772
  break;
26736
- case "executing" /* Executing */:
26773
+ case CoreToolCallStatus.Executing:
26737
26774
  resultDisplay = call.liveOutput;
26738
26775
  ptyId = call.pid;
26739
26776
  progressMessage = call.progressMessage;
26740
26777
  progress = call.progress;
26741
26778
  progressTotal = call.progressTotal;
26742
26779
  break;
26743
- case "scheduled" /* Scheduled */:
26744
- case "validating" /* Validating */:
26780
+ case CoreToolCallStatus.Scheduled:
26781
+ case CoreToolCallStatus.Validating:
26745
26782
  break;
26746
26783
  default: {
26747
26784
  const exhaustiveCheck = call;
@@ -26812,7 +26849,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26812
26849
  const handler = (event) => {
26813
26850
  const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
26814
26851
  const hasExecuting = event.toolCalls.some(
26815
- (tc) => tc.status === "executing" /* Executing */ || (tc.status === "success" /* Success */ || tc.status === "error" /* Error */) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
26852
+ (tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
26816
26853
  );
26817
26854
  if (hasExecuting) {
26818
26855
  setLastToolOutputTime(Date.now());
@@ -26821,7 +26858,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26821
26858
  const prevCalls = prev[event.schedulerId] ?? [];
26822
26859
  const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
26823
26860
  const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
26824
- (tc) => tc.status === "awaiting_approval" /* AwaitingApproval */ || prevCallIds.has(tc.request.callId)
26861
+ (tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
26825
26862
  );
26826
26863
  if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
26827
26864
  return prev;
@@ -26833,9 +26870,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26833
26870
  };
26834
26871
  });
26835
26872
  };
26836
- messageBus.subscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
26873
+ messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
26837
26874
  return () => {
26838
- messageBus.unsubscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
26875
+ messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
26839
26876
  };
26840
26877
  }, [messageBus, internalAdaptToolCalls]);
26841
26878
  (0, import_react98.useEffect)(() => {
@@ -26857,9 +26894,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26857
26894
  };
26858
26895
  });
26859
26896
  };
26860
- messageBus.subscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
26897
+ messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
26861
26898
  return () => {
26862
- messageBus.unsubscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
26899
+ messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
26863
26900
  };
26864
26901
  }, [messageBus]);
26865
26902
  const schedule = (0, import_react98.useCallback)(
@@ -26958,8 +26995,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
26958
26995
  const prev = prevMap.get(coreCall.request.callId);
26959
26996
  const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
26960
26997
  let status = coreCall.status;
26961
- if ((status === "success" /* Success */ || status === "error" /* Error */) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
26962
- status = "executing" /* Executing */;
26998
+ if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
26999
+ status = CoreToolCallStatus.Executing;
26963
27000
  }
26964
27001
  return {
26965
27002
  ...coreCall,
@@ -26991,7 +27028,7 @@ function getBackgroundedToolInfo(toolCall) {
26991
27028
  };
26992
27029
  }
26993
27030
  function isBackgroundableExecutingToolCall(toolCall) {
26994
- return toolCall.status === "executing" /* Executing */ && typeof toolCall.pid === "number";
27031
+ return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
26995
27032
  }
26996
27033
  function showCitations(settings) {
26997
27034
  const enabled = settings.merged.ui.showCitations;
@@ -27001,14 +27038,14 @@ function showCitations(settings) {
27001
27038
  return true;
27002
27039
  }
27003
27040
  function calculateStreamingState(isResponding, toolCalls) {
27004
- if (toolCalls.some((tc) => tc.status === "awaiting_approval" /* AwaitingApproval */)) {
27041
+ if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
27005
27042
  return "waiting_for_confirmation" /* WaitingForConfirmation */;
27006
27043
  }
27007
27044
  const isAnyToolActive = toolCalls.some((tc) => {
27008
- if (tc.status === "executing" /* Executing */ || tc.status === "scheduled" /* Scheduled */ || tc.status === "validating" /* Validating */) {
27045
+ if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
27009
27046
  return true;
27010
27047
  }
27011
- if (tc.status === "success" /* Success */ || tc.status === "error" /* Error */ || tc.status === "cancelled" /* Cancelled */) {
27048
+ if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
27012
27049
  return !tc.responseSubmittedToGemini;
27013
27050
  }
27014
27051
  return false;
@@ -27054,9 +27091,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27054
27091
  }
27055
27092
  setRetryStatus(payload);
27056
27093
  };
27057
- coreEvents.on("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
27094
+ coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
27058
27095
  return () => {
27059
- coreEvents.off("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
27096
+ coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
27060
27097
  };
27061
27098
  }, [isRespondingRef]);
27062
27099
  const [
@@ -27189,12 +27226,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27189
27226
  const tc = toolCalls[i];
27190
27227
  if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
27191
27228
  if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
27192
- const isAgent = tc.tool?.kind === "agent" /* Agent */;
27229
+ const isAgent = tc.tool?.kind === Kind.Agent;
27193
27230
  if (isAgent) {
27194
27231
  let contigAgentsComplete = true;
27195
27232
  for (let j = i + 1; j < toolCalls.length; j++) {
27196
27233
  const nextTc = toolCalls[j];
27197
- if (nextTc.tool?.kind === "agent" /* Agent */) {
27234
+ if (nextTc.tool?.kind === Kind.Agent) {
27198
27235
  if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
27199
27236
  contigAgentsComplete = false;
27200
27237
  break;
@@ -27220,7 +27257,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27220
27257
  let currentGroup = [];
27221
27258
  for (const tc of toolsToPush) {
27222
27259
  newPushed.add(tc.request.callId);
27223
- if (tc.tool?.kind === "agent" /* Agent */) {
27260
+ if (tc.tool?.kind === Kind.Agent) {
27224
27261
  currentGroup.push(tc);
27225
27262
  } else {
27226
27263
  if (currentGroup.length > 0) {
@@ -27370,7 +27407,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27370
27407
  prevActiveShellPtyIdRef.current = activeShellPtyId;
27371
27408
  }, [activeShellPtyId, addItem, setIsResponding]);
27372
27409
  (0, import_react99.useEffect)(() => {
27373
- if (config.getApprovalMode() === "yolo" /* YOLO */ && streamingState === "idle" /* Idle */) {
27410
+ if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
27374
27411
  const lastUserMessageIndex = history.findLastIndex(
27375
27412
  (item) => item.type === "user" /* USER */
27376
27413
  );
@@ -27438,7 +27475,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27438
27475
  return;
27439
27476
  }
27440
27477
  const hasActiveTools = toolCalls.some(
27441
- (tc) => tc.status === "executing" /* Executing */ || tc.status === "scheduled" /* Scheduled */ || tc.status === "validating" /* Validating */
27478
+ (tc) => tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating
27442
27479
  );
27443
27480
  if (streamingState === "idle" /* Idle */ && !isRespondingRef.current && !hasActiveTools) {
27444
27481
  if (clearBuffer) {
@@ -27465,7 +27502,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27465
27502
  if (tool.name === SHELL_COMMAND_NAME) {
27466
27503
  return {
27467
27504
  ...tool,
27468
- status: "cancelled" /* Cancelled */,
27505
+ status: CoreToolCallStatus.Cancelled,
27469
27506
  resultDisplay: tool.resultDisplay
27470
27507
  };
27471
27508
  }
@@ -27530,7 +27567,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27530
27567
  let localQueryToSendToGemini = null;
27531
27568
  if (typeof query === "string") {
27532
27569
  const trimmedQuery = query.trim();
27533
- await logger?.logMessage("user" /* USER */, trimmedQuery);
27570
+ await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
27534
27571
  if (!shellModeActive) {
27535
27572
  const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
27536
27573
  if (slashCommandResult) {
@@ -27686,7 +27723,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27686
27723
  if (pendingHistoryItemRef.current) {
27687
27724
  if (pendingHistoryItemRef.current.type === "tool_group") {
27688
27725
  const updatedTools = pendingHistoryItemRef.current.tools.map(
27689
- (tool) => tool.status === "validating" /* Validating */ || tool.status === "scheduled" /* Scheduled */ || tool.status === "awaiting_approval" /* AwaitingApproval */ || tool.status === "executing" /* Executing */ ? { ...tool, status: "cancelled" /* Cancelled */ } : tool
27726
+ (tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
27690
27727
  );
27691
27728
  const pendingItem = {
27692
27729
  ...pendingHistoryItemRef.current,
@@ -27746,6 +27783,52 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27746
27783
  maybeAddLowVerbosityFailureNote
27747
27784
  ]
27748
27785
  );
27786
+ const handleInvalidStreamEvent = (0, import_react99.useCallback)(
27787
+ (eventValue, userMessageTimestamp) => {
27788
+ if (pendingHistoryItemRef.current) {
27789
+ addItem(pendingHistoryItemRef.current, userMessageTimestamp);
27790
+ setPendingHistoryItem(null);
27791
+ }
27792
+ maybeAddSuppressedToolErrorNote(userMessageTimestamp);
27793
+ let text = eventValue?.message?.trim() || "Invalid stream received from model";
27794
+ if (eventValue?.type === "NO_RESPONSE_TEXT") {
27795
+ text = TRUE_EMPTY_RESPONSE_MESSAGE;
27796
+ } else if (eventValue?.type === "THINKING_ONLY_RESPONSE") {
27797
+ text = THINKING_ONLY_COMPRESS_SUGGESTION;
27798
+ } else if (eventValue?.type === "MAX_TOKENS_EXCEEDED") {
27799
+ text = MAX_TOKENS_EXCEEDED_SUGGESTION;
27800
+ } else if (eventValue?.type === "SAFETY_BLOCKED") {
27801
+ text = SAFETY_BLOCKED_MESSAGE;
27802
+ } else if (eventValue?.type === "RECITATION_BLOCKED") {
27803
+ text = RECITATION_BLOCKED_MESSAGE;
27804
+ } else if (eventValue?.type === "OTHER_BLOCKED") {
27805
+ text = OTHER_BLOCKED_MESSAGE;
27806
+ }
27807
+ uiTelemetryService.recordSemanticValidationError(
27808
+ geminiClient.getCurrentSequenceModel() ?? config.getModel(),
27809
+ eventValue?.type || "INVALID_STREAM"
27810
+ );
27811
+ addItem(
27812
+ {
27813
+ type: "error" /* ERROR */,
27814
+ text
27815
+ },
27816
+ userMessageTimestamp
27817
+ );
27818
+ maybeAddLowVerbosityFailureNote(userMessageTimestamp);
27819
+ setThought(null);
27820
+ },
27821
+ [
27822
+ addItem,
27823
+ pendingHistoryItemRef,
27824
+ setPendingHistoryItem,
27825
+ setThought,
27826
+ maybeAddSuppressedToolErrorNote,
27827
+ maybeAddLowVerbosityFailureNote,
27828
+ config,
27829
+ geminiClient
27830
+ ]
27831
+ );
27749
27832
  const handleCitationEvent = (0, import_react99.useCallback)(
27750
27833
  (text, userMessageTimestamp) => {
27751
27834
  if (!showCitations(settings)) {
@@ -27932,15 +28015,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27932
28015
  let geminiMessageBuffer = "";
27933
28016
  const toolCallRequests = [];
27934
28017
  for await (const event of stream) {
27935
- if (event.type !== "thought" /* Thought */ && thoughtRef.current !== null) {
28018
+ if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
27936
28019
  setThought(null);
27937
28020
  }
27938
28021
  switch (event.type) {
27939
- case "thought" /* Thought */:
28022
+ case GeminiEventType.Thought:
27940
28023
  setLastGeminiActivityTime(Date.now());
27941
28024
  handleThoughtEvent(event.value, userMessageTimestamp);
27942
28025
  break;
27943
- case "content" /* Content */:
28026
+ case GeminiEventType.Content:
27944
28027
  setLastGeminiActivityTime(Date.now());
27945
28028
  geminiMessageBuffer = handleContentEvent(
27946
28029
  event.value,
@@ -27948,16 +28031,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27948
28031
  userMessageTimestamp
27949
28032
  );
27950
28033
  break;
27951
- case "tool_call_request" /* ToolCallRequest */:
28034
+ case GeminiEventType.ToolCallRequest:
27952
28035
  toolCallRequests.push(event.value);
27953
28036
  break;
27954
- case "user_cancelled" /* UserCancelled */:
28037
+ case GeminiEventType.UserCancelled:
27955
28038
  handleUserCancelledEvent(userMessageTimestamp);
27956
28039
  break;
27957
- case "error" /* Error */:
28040
+ case GeminiEventType.Error:
27958
28041
  handleErrorEvent(event.value, userMessageTimestamp);
27959
28042
  break;
27960
- case "agent_execution_stopped" /* AgentExecutionStopped */:
28043
+ case GeminiEventType.AgentExecutionStopped:
27961
28044
  handleAgentExecutionStoppedEvent(
27962
28045
  event.value.reason,
27963
28046
  userMessageTimestamp,
@@ -27965,7 +28048,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27965
28048
  event.value.contextCleared
27966
28049
  );
27967
28050
  break;
27968
- case "agent_execution_blocked" /* AgentExecutionBlocked */:
28051
+ case GeminiEventType.AgentExecutionBlocked:
27969
28052
  handleAgentExecutionBlockedEvent(
27970
28053
  event.value.reason,
27971
28054
  userMessageTimestamp,
@@ -27973,35 +28056,37 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27973
28056
  event.value.contextCleared
27974
28057
  );
27975
28058
  break;
27976
- case "chat_compressed" /* ChatCompressed */:
28059
+ case GeminiEventType.ChatCompressed:
27977
28060
  handleChatCompressionEvent(event.value, userMessageTimestamp);
27978
28061
  break;
27979
- case "tool_call_confirmation" /* ToolCallConfirmation */:
27980
- case "tool_call_response" /* ToolCallResponse */:
28062
+ case GeminiEventType.ToolCallConfirmation:
28063
+ case GeminiEventType.ToolCallResponse:
27981
28064
  break;
27982
- case "max_session_turns" /* MaxSessionTurns */:
28065
+ case GeminiEventType.MaxSessionTurns:
27983
28066
  handleMaxSessionTurnsEvent();
27984
28067
  break;
27985
- case "context_window_will_overflow" /* ContextWindowWillOverflow */:
28068
+ case GeminiEventType.ContextWindowWillOverflow:
27986
28069
  handleContextWindowWillOverflowEvent(
27987
28070
  event.value.estimatedRequestTokenCount,
27988
28071
  event.value.remainingTokenCount
27989
28072
  );
27990
28073
  break;
27991
- case "finished" /* Finished */:
28074
+ case GeminiEventType.Finished:
27992
28075
  handleFinishedEvent(event, userMessageTimestamp);
27993
28076
  break;
27994
- case "citation" /* Citation */:
28077
+ case GeminiEventType.Citation:
27995
28078
  handleCitationEvent(event.value, userMessageTimestamp);
27996
28079
  break;
27997
- case "model_info" /* ModelInfo */:
28080
+ case GeminiEventType.ModelInfo:
27998
28081
  handleChatModelEvent(event.value, userMessageTimestamp);
27999
28082
  break;
28000
- case "loop_detected" /* LoopDetected */:
28083
+ case GeminiEventType.LoopDetected:
28001
28084
  loopDetectedRef.current = true;
28002
28085
  break;
28003
- case "retry" /* Retry */:
28004
- case "invalid_stream" /* InvalidStream */:
28086
+ case GeminiEventType.Retry:
28087
+ break;
28088
+ case GeminiEventType.InvalidStream:
28089
+ handleInvalidStreamEvent(event.value, userMessageTimestamp);
28005
28090
  break;
28006
28091
  default: {
28007
28092
  const unreachable = event;
@@ -28033,6 +28118,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28033
28118
  handleChatModelEvent,
28034
28119
  handleAgentExecutionStoppedEvent,
28035
28120
  handleAgentExecutionBlockedEvent,
28121
+ handleInvalidStreamEvent,
28036
28122
  addItem,
28037
28123
  pendingHistoryItemRef,
28038
28124
  setPendingHistoryItem,
@@ -28042,7 +28128,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28042
28128
  const submitQuery = (0, import_react99.useCallback)(
28043
28129
  async (query, options, prompt_id) => runInDevTraceSpan(
28044
28130
  {
28045
- operation: options?.isContinuation ? "system_prompt" /* SystemPrompt */ : "user_prompt" /* UserPrompt */,
28131
+ operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
28046
28132
  sessionId: config.getSessionId()
28047
28133
  },
28048
28134
  async ({ metadata: spanMetadata }) => {
@@ -28202,7 +28288,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28202
28288
  );
28203
28289
  const handleApprovalModeChange = (0, import_react99.useCallback)(
28204
28290
  async (newApprovalMode) => {
28205
- if (previousApprovalModeRef.current === "plan" /* PLAN */ && newApprovalMode !== "plan" /* PLAN */ && streamingState === "idle" /* Idle */) {
28291
+ if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
28206
28292
  if (geminiClient) {
28207
28293
  try {
28208
28294
  await geminiClient.addHistory({
@@ -28225,11 +28311,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28225
28311
  }
28226
28312
  }
28227
28313
  previousApprovalModeRef.current = newApprovalMode;
28228
- if (newApprovalMode === "yolo" /* YOLO */ || newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
28314
+ if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
28229
28315
  let awaitingApprovalCalls = toolCalls.filter(
28230
28316
  (call) => call.status === "awaiting_approval" && !call.request.forcedAsk
28231
28317
  );
28232
- if (newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
28318
+ if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
28233
28319
  awaitingApprovalCalls = awaitingApprovalCalls.filter((call) => {
28234
28320
  if (EDIT_TOOL_NAMES.has(call.request.name)) {
28235
28321
  return true;
@@ -28245,11 +28331,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28245
28331
  if (call.correlationId) {
28246
28332
  try {
28247
28333
  await config.getMessageBus().publish({
28248
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
28334
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
28249
28335
  correlationId: call.correlationId,
28250
28336
  confirmed: true,
28251
28337
  requiresUserConfirmation: false,
28252
- outcome: "proceed_once" /* ProceedOnce */
28338
+ outcome: ToolConfirmationOutcome.ProceedOnce
28253
28339
  });
28254
28340
  } catch (error) {
28255
28341
  debugLogger.warn(
@@ -28275,6 +28361,28 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28275
28361
  return false;
28276
28362
  }
28277
28363
  );
28364
+ if (turnCancelledRef.current) {
28365
+ setIsResponding(false);
28366
+ const geminiTools2 = completedAndReadyToSubmitTools.filter(
28367
+ (t) => !t.request.isClientInitiated
28368
+ );
28369
+ if (geminiClient && geminiTools2.length > 0) {
28370
+ const combinedParts = geminiTools2.flatMap(
28371
+ (toolCall) => toolCall.response.responseParts
28372
+ );
28373
+ if (combinedParts.length > 0) {
28374
+ geminiClient.addHistory({
28375
+ role: "user",
28376
+ parts: combinedParts
28377
+ });
28378
+ }
28379
+ }
28380
+ const callIdsToMarkAsSubmitted2 = toolCalls.map(
28381
+ (toolCall) => toolCall.request.callId
28382
+ );
28383
+ markToolsAsSubmitted(callIdsToMarkAsSubmitted2);
28384
+ return;
28385
+ }
28278
28386
  const clientTools = completedAndReadyToSubmitTools.filter(
28279
28387
  (t) => t.request.isClientInitiated
28280
28388
  );
@@ -28318,14 +28426,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28318
28426
  );
28319
28427
  if (isLowErrorVerbosity) {
28320
28428
  suppressedToolErrorCountRef.current += geminiTools.filter(
28321
- (tc) => tc.status === "error" /* Error */
28429
+ (tc) => tc.status === CoreToolCallStatus.Error
28322
28430
  ).length;
28323
28431
  }
28324
28432
  if (geminiTools.length === 0) {
28325
28433
  return;
28326
28434
  }
28327
28435
  const stopExecutionTool = geminiTools.find(
28328
- (tc) => tc.response.errorType === "stop_execution" /* STOP_EXECUTION */
28436
+ (tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
28329
28437
  );
28330
28438
  if (stopExecutionTool && stopExecutionTool.response.error) {
28331
28439
  maybeAddSuppressedToolErrorNote();
@@ -28345,9 +28453,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28345
28453
  (tc) => !isTopicTool2(tc.request.name)
28346
28454
  );
28347
28455
  const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
28348
- (tc) => tc.status === "cancelled" /* Cancelled */
28456
+ (tc) => tc.status === CoreToolCallStatus.Cancelled
28349
28457
  );
28350
- const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === "cancelled" /* Cancelled */);
28458
+ const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
28351
28459
  if (allDeclinableToolsCancelled || allToolsCancelled) {
28352
28460
  if (!turnCancelledRef.current) {
28353
28461
  addItem({
@@ -28412,7 +28520,8 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28412
28520
  isLowErrorVerbosity,
28413
28521
  maybeAddSuppressedToolErrorNote,
28414
28522
  maybeAddLowVerbosityFailureNote,
28415
- setIsResponding
28523
+ setIsResponding,
28524
+ toolCalls
28416
28525
  ]
28417
28526
  );
28418
28527
  const pendingHistoryItems = (0, import_react99.useMemo)(
@@ -28427,7 +28536,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28427
28536
  return;
28428
28537
  }
28429
28538
  const restorableToolCalls = toolCalls.filter(
28430
- (toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === "awaiting_approval" /* AwaitingApproval */
28539
+ (toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
28431
28540
  );
28432
28541
  if (restorableToolCalls.length > 0) {
28433
28542
  if (!gitService) {
@@ -28650,14 +28759,14 @@ var useAgentStream = ({
28650
28759
  const displayName = legacyState?.displayName ?? event.name;
28651
28760
  const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
28652
28761
  const desc = legacyState?.description ?? "";
28653
- const fallbackKind = "other" /* Other */;
28762
+ const fallbackKind = Kind.Other;
28654
28763
  const newCall = {
28655
28764
  callId: event.requestId,
28656
28765
  name: displayName,
28657
28766
  originalRequestName: event.name,
28658
28767
  description: desc,
28659
28768
  display: event.display,
28660
- status: "scheduled" /* Scheduled */,
28769
+ status: CoreToolCallStatus.Scheduled,
28661
28770
  isClientInitiated: false,
28662
28771
  renderOutputAsMarkdown: isOutputMarkdown,
28663
28772
  kind: legacyState?.kind ?? fallbackKind,
@@ -28675,10 +28784,10 @@ var useAgentStream = ({
28675
28784
  const evtStatus = legacyState?.status;
28676
28785
  let status = tc.status;
28677
28786
  if (evtStatus === "executing")
28678
- status = "executing" /* Executing */;
28679
- else if (evtStatus === "error") status = "error" /* Error */;
28787
+ status = CoreToolCallStatus.Executing;
28788
+ else if (evtStatus === "error") status = CoreToolCallStatus.Error;
28680
28789
  else if (evtStatus === "success")
28681
- status = "success" /* Success */;
28790
+ status = CoreToolCallStatus.Success;
28682
28791
  const display = event.display?.result;
28683
28792
  const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
28684
28793
  const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
@@ -28711,7 +28820,7 @@ var useAgentStream = ({
28711
28820
  const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
28712
28821
  return {
28713
28822
  ...tc,
28714
- status: event.isError ? "error" /* Error */ : "success" /* Success */,
28823
+ status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
28715
28824
  display: event.display ? { ...tc.display, ...event.display } : tc.display,
28716
28825
  resultDisplay,
28717
28826
  outputFile
@@ -28777,7 +28886,7 @@ var useAgentStream = ({
28777
28886
  if (!options?.isContinuation) {
28778
28887
  if (typeof query === "string") {
28779
28888
  addItem({ type: "user" /* USER */, text: query }, timestamp);
28780
- void logger?.logMessage("user" /* USER */, query);
28889
+ void logger?.logMessage(MessageSenderType.USER, query);
28781
28890
  }
28782
28891
  startNewPrompt();
28783
28892
  }
@@ -30304,9 +30413,9 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30304
30413
  const handleFolderTrustSelect = (0, import_react105.useCallback)(
30305
30414
  async (choice) => {
30306
30415
  const trustLevelMap = {
30307
- ["trust_folder" /* TRUST_FOLDER */]: "TRUST_FOLDER" /* TRUST_FOLDER */,
30308
- ["trust_parent" /* TRUST_PARENT */]: "TRUST_PARENT" /* TRUST_PARENT */,
30309
- ["do_not_trust" /* DO_NOT_TRUST */]: "DO_NOT_TRUST" /* DO_NOT_TRUST */
30416
+ ["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
30417
+ ["trust_parent" /* TRUST_PARENT */]: TrustLevel.TRUST_PARENT,
30418
+ ["do_not_trust" /* DO_NOT_TRUST */]: TrustLevel.DO_NOT_TRUST
30310
30419
  };
30311
30420
  const trustLevel = trustLevelMap[choice];
30312
30421
  if (!trustLevel) return;
@@ -30325,7 +30434,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30325
30434
  }, 100);
30326
30435
  return;
30327
30436
  }
30328
- const currentIsTrusted = trustLevel === "TRUST_FOLDER" /* TRUST_FOLDER */ || trustLevel === "TRUST_PARENT" /* TRUST_PARENT */;
30437
+ const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
30329
30438
  onTrustChange(currentIsTrusted);
30330
30439
  setIsTrusted(currentIsTrusted);
30331
30440
  const wasTrusted = isTrusted ?? false;
@@ -31333,7 +31442,7 @@ function useMessageQueue({
31333
31442
  var import_react107 = __toESM(require_react(), 1);
31334
31443
  function useMcpStatus(config) {
31335
31444
  const [discoveryState, setDiscoveryState] = (0, import_react107.useState)(
31336
- () => config.getMcpClientManager()?.getDiscoveryState() ?? "not_started" /* NOT_STARTED */
31445
+ () => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
31337
31446
  );
31338
31447
  const [mcpServerCount, setMcpServerCount] = (0, import_react107.useState)(
31339
31448
  () => config.getMcpClientManager()?.getMcpServerCount() ?? 0
@@ -31346,12 +31455,12 @@ function useMcpStatus(config) {
31346
31455
  setMcpServerCount(manager.getMcpServerCount());
31347
31456
  }
31348
31457
  };
31349
- coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
31458
+ coreEvents.on(CoreEvent.McpClientUpdate, onChange);
31350
31459
  return () => {
31351
- coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
31460
+ coreEvents.off(CoreEvent.McpClientUpdate, onChange);
31352
31461
  };
31353
31462
  }, [config]);
31354
- const isMcpReady = discoveryState === "completed" /* COMPLETED */ || discoveryState === "not_started" /* NOT_STARTED */ && mcpServerCount === 0;
31463
+ const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
31355
31464
  return {
31356
31465
  discoveryState,
31357
31466
  mcpServerCount,
@@ -31378,7 +31487,7 @@ function useApprovalModeIndicator({
31378
31487
  (key) => {
31379
31488
  let nextApprovalMode;
31380
31489
  if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
31381
- if (config.isYoloModeDisabled() && config.getApprovalMode() !== "yolo" /* YOLO */) {
31490
+ if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
31382
31491
  if (addItem) {
31383
31492
  let text = "You cannot enter YOLO mode since it is disabled in your settings.";
31384
31493
  const adminSettings = config.getRemoteAdminSettings();
@@ -31396,21 +31505,21 @@ function useApprovalModeIndicator({
31396
31505
  }
31397
31506
  return;
31398
31507
  }
31399
- nextApprovalMode = config.getApprovalMode() === "yolo" /* YOLO */ ? "default" /* DEFAULT */ : "yolo" /* YOLO */;
31508
+ nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
31400
31509
  } else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
31401
31510
  const currentMode = config.getApprovalMode();
31402
31511
  switch (currentMode) {
31403
- case "default" /* DEFAULT */:
31404
- nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
31512
+ case ApprovalMode.DEFAULT:
31513
+ nextApprovalMode = ApprovalMode.AUTO_EDIT;
31405
31514
  break;
31406
- case "autoEdit" /* AUTO_EDIT */:
31407
- nextApprovalMode = allowPlanMode ? "plan" /* PLAN */ : "default" /* DEFAULT */;
31515
+ case ApprovalMode.AUTO_EDIT:
31516
+ nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
31408
31517
  break;
31409
- case "plan" /* PLAN */:
31410
- nextApprovalMode = "default" /* DEFAULT */;
31518
+ case ApprovalMode.PLAN:
31519
+ nextApprovalMode = ApprovalMode.DEFAULT;
31411
31520
  break;
31412
- case "yolo" /* YOLO */:
31413
- nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
31521
+ case ApprovalMode.YOLO:
31522
+ nextApprovalMode = ApprovalMode.AUTO_EDIT;
31414
31523
  break;
31415
31524
  default:
31416
31525
  }
@@ -31820,11 +31929,11 @@ var useHookDisplayState = () => {
31820
31929
  removeHook();
31821
31930
  }
31822
31931
  };
31823
- coreEvents.on("hook-start" /* HookStart */, handleHookStart);
31824
- coreEvents.on("hook-end" /* HookEnd */, handleHookEnd);
31932
+ coreEvents.on(CoreEvent.HookStart, handleHookStart);
31933
+ coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
31825
31934
  return () => {
31826
- coreEvents.off("hook-start" /* HookStart */, handleHookStart);
31827
- coreEvents.off("hook-end" /* HookEnd */, handleHookEnd);
31935
+ coreEvents.off(CoreEvent.HookStart, handleHookStart);
31936
+ coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
31828
31937
  activeTimeouts.forEach(clearTimeout);
31829
31938
  activeTimeouts.clear();
31830
31939
  };
@@ -32663,7 +32772,7 @@ var AppContainer = (props) => {
32663
32772
  setConfigInitialized(true);
32664
32773
  startupProfiler.flush(config);
32665
32774
  startAutoMemoryIfEnabled(config);
32666
- const sessionStartSource = resumedSessionData ? "resume" /* Resume */ : "startup" /* Startup */;
32775
+ const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
32667
32776
  const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
32668
32777
  if (result) {
32669
32778
  const additionalContext = result.getAdditionalContext();
@@ -32690,7 +32799,7 @@ var AppContainer = (props) => {
32690
32799
  );
32691
32800
  const ideClient = await IdeClient.getInstance();
32692
32801
  await ideClient.disconnect();
32693
- await config?.getHookSystem()?.fireSessionEndEvent("exit" /* Exit */);
32802
+ await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
32694
32803
  };
32695
32804
  registerCleanup(cleanupFn);
32696
32805
  return () => {
@@ -32715,11 +32824,11 @@ var AppContainer = (props) => {
32715
32824
  resetTime: payload.resetTime
32716
32825
  });
32717
32826
  };
32718
- coreEvents.on("model-changed" /* ModelChanged */, handleModelChanged);
32719
- coreEvents.on("quota-changed" /* QuotaChanged */, handleQuotaChanged);
32827
+ coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
32828
+ coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
32720
32829
  return () => {
32721
- coreEvents.off("model-changed" /* ModelChanged */, handleModelChanged);
32722
- coreEvents.off("quota-changed" /* QuotaChanged */, handleQuotaChanged);
32830
+ coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
32831
+ coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
32723
32832
  };
32724
32833
  }, [config]);
32725
32834
  (0, import_react121.useEffect)(() => {
@@ -32732,16 +32841,16 @@ var AppContainer = (props) => {
32732
32841
  const handleAgentsDiscovered = (payload) => {
32733
32842
  setNewAgents(payload.agents);
32734
32843
  };
32735
- coreEvents.on("settings-changed" /* SettingsChanged */, handleSettingsChanged);
32736
- coreEvents.on("admin-settings-changed" /* AdminSettingsChanged */, handleAdminSettingsChanged);
32737
- coreEvents.on("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
32844
+ coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
32845
+ coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
32846
+ coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
32738
32847
  return () => {
32739
- coreEvents.off("settings-changed" /* SettingsChanged */, handleSettingsChanged);
32848
+ coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
32740
32849
  coreEvents.off(
32741
- "admin-settings-changed" /* AdminSettingsChanged */,
32850
+ CoreEvent.AdminSettingsChanged,
32742
32851
  handleAdminSettingsChanged
32743
32852
  );
32744
- coreEvents.off("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
32853
+ coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
32745
32854
  };
32746
32855
  }, [settings]);
32747
32856
  const { errorCount, clearErrorCount } = useErrorCount();
@@ -32806,11 +32915,11 @@ var AppContainer = (props) => {
32806
32915
  exitEditorDialog
32807
32916
  } = useEditorSettings(settings, setEditorError, historyManager.addItem);
32808
32917
  (0, import_react121.useEffect)(() => {
32809
- coreEvents.on("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
32810
- coreEvents.on("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
32918
+ coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
32919
+ coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
32811
32920
  return () => {
32812
- coreEvents.off("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
32813
- coreEvents.off("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
32921
+ coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
32922
+ coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
32814
32923
  };
32815
32924
  }, [handleEditorClose, openEditorDialog]);
32816
32925
  (0, import_react121.useEffect)(() => {
@@ -32878,7 +32987,7 @@ var AppContainer = (props) => {
32878
32987
  errorVerbosity: settings.merged.ui.errorVerbosity
32879
32988
  });
32880
32989
  const isAuthDialogOpen = authState === "updating" /* Updating */;
32881
- const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== "gemini-api-key" /* USE_GEMINI */;
32990
+ const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
32882
32991
  const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
32883
32992
  const { loadHistoryForResume, isResuming } = useSessionResume({
32884
32993
  config,
@@ -32906,7 +33015,7 @@ var AppContainer = (props) => {
32906
33015
  async (authType, scope) => {
32907
33016
  if (authType) {
32908
33017
  const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
32909
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */) {
33018
+ if (authType === AuthType.LOGIN_WITH_GOOGLE) {
32910
33019
  setAuthContext({ requiresRestart: true });
32911
33020
  } else {
32912
33021
  setAuthContext({});
@@ -32934,7 +33043,7 @@ var AppContainer = (props) => {
32934
33043
  );
32935
33044
  return;
32936
33045
  }
32937
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
33046
+ if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
32938
33047
  writeToStdout(`
32939
33048
  ----------------------------------------------------------------
32940
33049
  Logging in with Google... Restarting Gemini CLI to continue.
@@ -32957,7 +33066,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
32957
33066
  }
32958
33067
  await saveApiKey(apiKey);
32959
33068
  await reloadApiKey();
32960
- await config.refreshAuth("gemini-api-key" /* USE_GEMINI */);
33069
+ await config.refreshAuth(AuthType.USE_GEMINI);
32961
33070
  setAuthState("authenticated" /* Authenticated */);
32962
33071
  } catch (e) {
32963
33072
  onAuthError(
@@ -32982,7 +33091,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
32982
33091
  `Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
32983
33092
  );
32984
33093
  } else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
32985
- if (settings.merged.security.auth.selectedType === "gemini-api-key" /* USE_GEMINI */) {
33094
+ if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
32986
33095
  return;
32987
33096
  }
32988
33097
  const authMethod = settings.merged.security.auth.selectedType;
@@ -33118,9 +33227,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
33118
33227
  }
33119
33228
  });
33120
33229
  };
33121
- coreEvents.on("consent-request" /* ConsentRequest */, handleConsentRequest);
33230
+ coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
33122
33231
  return () => {
33123
- coreEvents.off("consent-request" /* ConsentRequest */, handleConsentRequest);
33232
+ coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
33124
33233
  };
33125
33234
  }, []);
33126
33235
  const performMemoryRefresh = (0, import_react121.useCallback)(async () => {
@@ -33778,7 +33887,7 @@ ${queuedText}` : queuedText;
33778
33887
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
33779
33888
  if (settings.merged.general.devtools) {
33780
33889
  void (async () => {
33781
- const { toggleDevToolsPanel } = await import("./devtoolsService-IVPTF5ZJ.js");
33890
+ const { toggleDevToolsPanel } = await import("./devtoolsService-NLJPFQBD.js");
33782
33891
  await toggleDevToolsPanel(
33783
33892
  config,
33784
33893
  showErrorDetails,
@@ -33996,17 +34105,17 @@ ${queuedText}` : queuedText;
33996
34105
  Date.now()
33997
34106
  );
33998
34107
  };
33999
- coreEvents.on("user-feedback" /* UserFeedback */, handleUserFeedback);
34000
- coreEvents.on("hook-system-message" /* HookSystemMessage */, handleHookSystemMessage);
34108
+ coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
34109
+ coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
34001
34110
  coreEvents.drainBacklogs();
34002
34111
  return () => {
34003
- coreEvents.off("user-feedback" /* UserFeedback */, handleUserFeedback);
34004
- coreEvents.off("hook-system-message" /* HookSystemMessage */, handleHookSystemMessage);
34112
+ coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
34113
+ coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
34005
34114
  };
34006
34115
  }, [historyManager]);
34007
34116
  const nightly = props.version.includes("nightly");
34008
34117
  const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
34009
- 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;
34118
+ 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;
34010
34119
  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;
34011
34120
  const hasPendingToolConfirmation = (0, import_react121.useMemo)(
34012
34121
  () => isToolAwaitingConfirmation(pendingHistoryItems),
@@ -34106,9 +34215,9 @@ ${queuedText}` : queuedText;
34106
34215
  const handleMemoryChanged = (result) => {
34107
34216
  setGeminiMdFileCount(result.fileCount);
34108
34217
  };
34109
- coreEvents.on("memory-changed" /* MemoryChanged */, handleMemoryChanged);
34218
+ coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
34110
34219
  return () => {
34111
- coreEvents.off("memory-changed" /* MemoryChanged */, handleMemoryChanged);
34220
+ coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
34112
34221
  };
34113
34222
  }, []);
34114
34223
  (0, import_react121.useEffect)(() => {