@google/gemini-cli 0.40.0-preview.2 → 0.41.0-nightly.20260423.gd1c91f526

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 (59) hide show
  1. package/bundle/{chunk-NO7STVVM.js → chunk-4PEADYI5.js} +4 -4
  2. package/bundle/{chunk-QK7UWGBN.js → chunk-5RWN2VOG.js} +4 -4
  3. package/bundle/{chunk-3GU3LF3I.js → chunk-BE3FMR6C.js} +6 -6
  4. package/bundle/{chunk-IMEC72NS.js → chunk-BGTQF57Z.js} +1 -1
  5. package/bundle/{chunk-EFCQXWIF.js → chunk-BM7TRCHV.js} +2 -2
  6. package/bundle/{chunk-WL5MCPV2.js → chunk-BXO2CSHU.js} +1 -1
  7. package/bundle/{chunk-PLUWJHZZ.js → chunk-CMDSUNBE.js} +64 -52
  8. package/bundle/{chunk-33ANPP4S.js → chunk-DOZGGGM3.js} +2 -2
  9. package/bundle/{chunk-TDW6FM3A.js → chunk-FLEXF7OP.js} +1 -1
  10. package/bundle/{chunk-HV36F4CL.js → chunk-HGAC7IIS.js} +1 -1
  11. package/bundle/{chunk-UBXB5AEJ.js → chunk-ILGARB2Y.js} +3 -3
  12. package/bundle/{chunk-4IJPDKI6.js → chunk-ILSUW45Y.js} +14 -12
  13. package/bundle/{chunk-MUGUV6RZ.js → chunk-JI66QA3S.js} +2 -2
  14. package/bundle/{chunk-RM43GNQQ.js → chunk-KCEU7UY3.js} +6356 -11853
  15. package/bundle/{chunk-WHIWQCI5.js → chunk-LO2U5DX7.js} +1 -1
  16. package/bundle/chunk-MJ35NORG.js +1571 -0
  17. package/bundle/chunk-MRRUSUAI.js +79847 -0
  18. package/bundle/chunk-MURNAVEF.js +350850 -0
  19. package/bundle/chunk-NF5KE423.js +17725 -0
  20. package/bundle/{chunk-IUVLJUOL.js → chunk-OKARZDAC.js} +1 -1
  21. package/bundle/chunk-RFYY2EXK.js +156 -0
  22. package/bundle/chunk-ULLQZW4G.js +118 -0
  23. package/bundle/{chunk-GXRQOXQF.js → chunk-ZRHJDW4J.js} +6 -6
  24. package/bundle/{chunk-NIVCRM5L.js → chunk-ZRZIZSCI.js} +1 -1
  25. package/bundle/{cleanup-A7WXWAMI.js → cleanup-CM5YE3PO.js} +2 -2
  26. package/bundle/{cleanup-IPLJJT5S.js → cleanup-GCC3QSXL.js} +3 -3
  27. package/bundle/{cleanup-EWPIME2M.js → cleanup-JSTWYHMS.js} +2 -2
  28. package/bundle/cleanup-WQ3P3JRW.js +33 -0
  29. package/bundle/{core-VCDK23ZC.js → core-WAVEV7SE.js} +1 -1
  30. package/bundle/{devtoolsService-B5VVZ752.js → devtoolsService-65PTC72C.js} +2 -2
  31. package/bundle/{devtoolsService-6Y6YER6T.js → devtoolsService-KHTP2AVU.js} +2 -2
  32. package/bundle/{devtoolsService-2JXSALRU.js → devtoolsService-QZON66HV.js} +5 -4
  33. package/bundle/devtoolsService-YL2DS7JV.js +852 -0
  34. package/bundle/{dist-UIXQETMC.js → dist-IJE6ZESE.js} +1 -1
  35. package/bundle/{core-BQT6T3CH.js → dist-JJVAY7EX.js} +2 -2
  36. package/bundle/dist-S3PCMM76.js +2020 -0
  37. package/bundle/{gemini-54LH6RUH.js → gemini-5Z5FJY4B.js} +12 -12
  38. package/bundle/{gemini-ID44Z5SV.js → gemini-LFI3ENEH.js} +12 -12
  39. package/bundle/{gemini-44W2QEZI.js → gemini-MAC54OQS.js} +188 -173
  40. package/bundle/gemini-UPKTLJJZ.js +16043 -0
  41. package/bundle/gemini.js +3 -3
  42. package/bundle/{interactiveCli-JFBPGMNM.js → interactiveCli-3UQTFU2M.js} +6 -6
  43. package/bundle/{interactiveCli-5B3X6RNB.js → interactiveCli-7ZE7G6ZY.js} +277 -260
  44. package/bundle/{interactiveCli-5MTJDFYC.js → interactiveCli-FZUKC563.js} +6 -6
  45. package/bundle/interactiveCli-JE4PLDY5.js +34597 -0
  46. package/bundle/{liteRtServerManager-6GJWEP5W.js → liteRtServerManager-L6OWAEH4.js} +3 -3
  47. package/bundle/{liteRtServerManager-76V63PRJ.js → liteRtServerManager-OARJ4EUZ.js} +4 -4
  48. package/bundle/{liteRtServerManager-WQMDPACQ.js → liteRtServerManager-WJT6SPLU.js} +3 -3
  49. package/bundle/liteRtServerManager-ZDS6QYLO.js +65 -0
  50. package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
  51. package/bundle/{oauth2-provider-EX6SQEZP.js → oauth2-provider-JPWXPXQ6.js} +1 -1
  52. package/bundle/{oauth2-provider-ZF52AWQY.js → oauth2-provider-Q4A4U7PX.js} +39 -73
  53. package/bundle/oauth2-provider-WW42PZXK.js +237 -0
  54. package/bundle/{oauth2-provider-JCKLNKRV.js → oauth2-provider-ZW2I3O4T.js} +1 -1
  55. package/bundle/{start-SHOUHW3Y.js → start-BXEBAKTI.js} +5 -5
  56. package/bundle/{start-B6EMQCH5.js → start-JFRQSQYB.js} +6 -6
  57. package/bundle/start-PMSOWXLI.js +18 -0
  58. package/bundle/{start-CYDJTOAP.js → start-XEUSMK4W.js} +5 -5
  59. package/package.json +1 -1
@@ -144,13 +144,13 @@ import {
144
144
  widestLineFromStyledChars,
145
145
  wordBreakStyledChars,
146
146
  wrapStyledChars
147
- } from "./chunk-GXRQOXQF.js";
147
+ } from "./chunk-CMDSUNBE.js";
148
148
  import {
149
149
  appEvents
150
150
  } from "./chunk-5PS3AYFU.js";
151
151
  import {
152
152
  require_source
153
- } from "./chunk-WHIWQCI5.js";
153
+ } from "./chunk-FLEXF7OP.js";
154
154
  import {
155
155
  ACTIVE_SHELL_MAX_LINES,
156
156
  COMPACT_TOOL_SUBVIEW_MAX_LINES,
@@ -204,18 +204,20 @@ import {
204
204
  stringWidth,
205
205
  stripUnsafeCharacters,
206
206
  toCodePoints
207
- } from "./chunk-4IJPDKI6.js";
207
+ } from "./chunk-NF5KE423.js";
208
208
  import {
209
209
  registerCleanup,
210
210
  removeCleanup,
211
211
  runExitCleanup,
212
212
  setupTtyCheck
213
- } from "./chunk-MUGUV6RZ.js";
213
+ } from "./chunk-JI66QA3S.js";
214
214
  import {
215
215
  ApiKeyUpdatedEvent,
216
216
  AsyncFzf,
217
217
  AuthType,
218
+ CompressionStatus,
218
219
  ConversationFinishedEvent,
220
+ CoreToolCallStatus,
219
221
  CreditPurchaseClickEvent,
220
222
  EDITOR_DISPLAY_NAMES,
221
223
  EmptyWalletMenuShownEvent,
@@ -225,11 +227,16 @@ import {
225
227
  FileSearchFactory,
226
228
  FolderTrustDiscoveryService,
227
229
  G1_UTM_CAMPAIGNS,
230
+ GeminiCliOperation,
231
+ GeminiEventType,
228
232
  GitService,
229
233
  IdeClient,
230
234
  LegacyAgentProtocol,
231
235
  LlmRole,
232
236
  Logger,
237
+ MCPDiscoveryState,
238
+ MCPServerStatus,
239
+ MessageSenderType,
233
240
  ModelNotFoundError,
234
241
  ModelSlashCommandEvent,
235
242
  OverageMenuShownEvent,
@@ -238,6 +245,8 @@ import {
238
245
  ProjectIdRequiredError,
239
246
  ROOT_SCHEDULER_ID,
240
247
  Scheduler,
248
+ SessionEndReason,
249
+ SessionStartSource,
241
250
  ShellExecutionService,
242
251
  SlashCommandStatus,
243
252
  TerminalQuotaError,
@@ -245,6 +254,7 @@ import {
245
254
  UserPromptEvent,
246
255
  UserTierId,
247
256
  ValidationRequiredError,
257
+ WarningPriority,
248
258
  addMCPStatusChangeListener,
249
259
  allowEditorTypeInSandbox,
250
260
  belongsInConfirmationQueue,
@@ -327,11 +337,13 @@ import {
327
337
  validatePlanContent,
328
338
  validatePlanPath,
329
339
  writeToStdout
330
- } from "./chunk-RM43GNQQ.js";
340
+ } from "./chunk-MURNAVEF.js";
331
341
  import {
332
342
  ACTIVATE_SKILL_TOOL_NAME,
333
343
  AGENT_TOOL_NAME,
344
+ ApprovalMode,
334
345
  ChangeAuthRequestedError,
346
+ CoreEvent,
335
347
  DEFAULT_GEMINI_FLASH_LITE_MODEL,
336
348
  DEFAULT_GEMINI_FLASH_MODEL,
337
349
  DEFAULT_GEMINI_MODEL,
@@ -342,13 +354,16 @@ import {
342
354
  GEMINI_DIR,
343
355
  GLOB_DISPLAY_NAME,
344
356
  GREP_DISPLAY_NAME,
357
+ Kind,
345
358
  LS_DISPLAY_NAME,
359
+ MessageBusType,
346
360
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
347
361
  PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
348
362
  PREVIEW_GEMINI_3_1_MODEL,
349
363
  PREVIEW_GEMINI_FLASH_MODEL,
350
364
  PREVIEW_GEMINI_MODEL,
351
365
  PREVIEW_GEMINI_MODEL_AUTO,
366
+ QuestionType,
352
367
  READ_FILE_DISPLAY_NAME,
353
368
  READ_MANY_FILES_DISPLAY_NAME,
354
369
  SHELL_TOOL_NAME,
@@ -356,6 +371,8 @@ import {
356
371
  TOPIC_PARAM_STRATEGIC_INTENT,
357
372
  TOPIC_PARAM_SUMMARY,
358
373
  TOPIC_PARAM_TITLE,
374
+ ToolConfirmationOutcome,
375
+ ToolErrorType,
359
376
  UPDATE_TOPIC_DISPLAY_NAME,
360
377
  UPDATE_TOPIC_TOOL_NAME,
361
378
  UnauthorizedError,
@@ -385,7 +402,7 @@ import {
385
402
  safeJsonToMarkdown,
386
403
  shortenPath,
387
404
  tildeifyPath
388
- } from "./chunk-2RHFUIH4.js";
405
+ } from "./chunk-VCGILCZV.js";
389
406
  import "./chunk-664ZODQF.js";
390
407
  import "./chunk-RJTRUG2J.js";
391
408
  import "./chunk-IUUIT4SU.js";
@@ -5715,7 +5732,7 @@ function calculateShellMaxLines(options) {
5715
5732
  if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
5716
5733
  return maxLinesBasedOnHeight;
5717
5734
  }
5718
- const isExecuting = status === "executing" /* Executing */;
5735
+ const isExecuting = status === CoreToolCallStatus.Executing;
5719
5736
  const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
5720
5737
  return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
5721
5738
  }
@@ -5748,10 +5765,10 @@ function isShellTool(name) {
5748
5765
  return name === SHELL_COMMAND_NAME || name === SHELL_NAME || name === SHELL_TOOL_NAME;
5749
5766
  }
5750
5767
  function isThisShellFocusable(name, status, config) {
5751
- return !!(isShellTool(name) && status === "executing" /* Executing */ && config?.getEnableInteractiveShell());
5768
+ return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && config?.getEnableInteractiveShell());
5752
5769
  }
5753
5770
  function isThisShellFocused(name, status, ptyId, activeShellPtyId, embeddedShellFocused) {
5754
- return !!(isShellTool(name) && status === "executing" /* Executing */ && ptyId === activeShellPtyId && embeddedShellFocused);
5771
+ return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && ptyId === activeShellPtyId && embeddedShellFocused);
5755
5772
  }
5756
5773
  function useFocusHint(isThisShellFocusable2, isThisShellFocused2, resultDisplay) {
5757
5774
  const [userHasFocused, setUserHasFocused] = (0, import_react16.useState)(false);
@@ -6349,7 +6366,7 @@ var ToolMessage = ({
6349
6366
  paddingX: 1,
6350
6367
  flexDirection: "column",
6351
6368
  children: [
6352
- status === "executing" /* Executing */ && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
6369
+ status === CoreToolCallStatus.Executing && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
6353
6370
  McpProgressIndicator,
6354
6371
  {
6355
6372
  progress,
@@ -6366,8 +6383,8 @@ var ToolMessage = ({
6366
6383
  terminalWidth,
6367
6384
  renderOutputAsMarkdown,
6368
6385
  hasFocus: isThisShellFocused2,
6369
- maxLines: kind === "agent" /* Agent */ && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
6370
- overflowDirection: kind === "agent" /* Agent */ ? "bottom" : "top"
6386
+ maxLines: kind === Kind.Agent && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
6387
+ overflowDirection: kind === Kind.Agent ? "bottom" : "top"
6371
6388
  }
6372
6389
  ),
6373
6390
  isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
@@ -7067,7 +7084,7 @@ var ShellToolMessage = ({
7067
7084
  maxLinesLimit: maxLines
7068
7085
  });
7069
7086
  import_react23.default.useEffect(() => {
7070
- const isExecuting = status === "executing" /* Executing */;
7087
+ const isExecuting = status === CoreToolCallStatus.Executing;
7071
7088
  if (isExecuting && ptyId) {
7072
7089
  try {
7073
7090
  const childWidth = terminalWidth - 4;
@@ -7253,14 +7270,14 @@ var ToolActionsProvider = (props) => {
7253
7270
  }
7254
7271
  const details = tool.confirmationDetails;
7255
7272
  if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
7256
- const cliOutcome = outcome === "cancel" /* Cancel */ ? "rejected" : "accepted";
7273
+ const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? "rejected" : "accepted";
7257
7274
  await ideClient?.resolveDiffFromCli(details.filePath, cliOutcome);
7258
7275
  }
7259
7276
  if (tool.correlationId) {
7260
7277
  await config.getMessageBus().publish({
7261
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
7278
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
7262
7279
  correlationId: tool.correlationId,
7263
- confirmed: outcome !== "cancel" /* Cancel */,
7280
+ confirmed: outcome !== ToolConfirmationOutcome.Cancel,
7264
7281
  requiresUserConfirmation: false,
7265
7282
  outcome,
7266
7283
  payload
@@ -7279,7 +7296,7 @@ var ToolActionsProvider = (props) => {
7279
7296
  );
7280
7297
  const cancel = (0, import_react24.useCallback)(
7281
7298
  async (callId) => {
7282
- await confirm(callId, "cancel" /* Cancel */);
7299
+ await confirm(callId, ToolConfirmationOutcome.Cancel);
7283
7300
  },
7284
7301
  [confirm]
7285
7302
  );
@@ -7566,22 +7583,22 @@ var hasPayload = (res) => {
7566
7583
  function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerminalHeight, isClickable) {
7567
7584
  const added = (diff.diffStat?.model_added_lines ?? 0) + (diff.diffStat?.user_added_lines ?? 0);
7568
7585
  const removed = (diff.diffStat?.model_removed_lines ?? 0) + (diff.diffStat?.user_removed_lines ?? 0);
7569
- const isAcceptedOrConfirming = status === "success" /* Success */ || status === "executing" /* Executing */ || status === "awaiting_approval" /* AwaitingApproval */;
7586
+ const isAcceptedOrConfirming = status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing || status === CoreToolCallStatus.AwaitingApproval;
7570
7587
  const addColor = isAcceptedOrConfirming ? theme.status.success : theme.text.secondary;
7571
7588
  const removeColor = isAcceptedOrConfirming ? theme.status.error : theme.text.secondary;
7572
7589
  const showDiffStat = !!diff.diffStat;
7573
7590
  const description = /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { flexDirection: "row", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: theme.text.secondary, wrap: "truncate-end", children: diff.fileName }) });
7574
7591
  let resultSummary = "";
7575
7592
  let resultColor = theme.text.secondary;
7576
- if (status === "awaiting_approval" /* AwaitingApproval */) {
7593
+ if (status === CoreToolCallStatus.AwaitingApproval) {
7577
7594
  resultSummary = "Confirming";
7578
- } else if (status === "success" /* Success */ || status === "executing" /* Executing */) {
7595
+ } else if (status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing) {
7579
7596
  resultSummary = "Accepted";
7580
7597
  resultColor = theme.text.accent;
7581
- } else if (status === "cancelled" /* Cancelled */) {
7598
+ } else if (status === CoreToolCallStatus.Cancelled) {
7582
7599
  resultSummary = "Rejected";
7583
7600
  resultColor = theme.status.error;
7584
- } else if (status === "error" /* Error */) {
7601
+ } else if (status === CoreToolCallStatus.Error) {
7585
7602
  resultSummary = typeof resultDisplay === "string" ? resultDisplay : "Failed";
7586
7603
  resultColor = theme.status.error;
7587
7604
  }
@@ -7612,7 +7629,7 @@ function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerm
7612
7629
  filename: diff.fileName,
7613
7630
  terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
7614
7631
  availableTerminalHeight,
7615
- disableColor: status === "cancelled" /* Cancelled */
7632
+ disableColor: status === CoreToolCallStatus.Cancelled
7616
7633
  }
7617
7634
  );
7618
7635
  return { description, summary, payload };
@@ -7740,10 +7757,10 @@ var DenseToolMessage = (props) => {
7740
7757
  if (isGrepResult(resultDisplay)) {
7741
7758
  return getGenericSuccessData(resultDisplay, originalDescription);
7742
7759
  }
7743
- if (status === "success" /* Success */ && resultDisplay) {
7760
+ if (status === CoreToolCallStatus.Success && resultDisplay) {
7744
7761
  return getGenericSuccessData(resultDisplay, originalDescription);
7745
7762
  }
7746
- if (status === "error" /* Error */) {
7763
+ if (status === CoreToolCallStatus.Error) {
7747
7764
  const text = typeof resultDisplay === "string" ? resultDisplay.replace(/\n/g, " ") : "Failed";
7748
7765
  const errorSummary = /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { color: theme.status.error, wrap: "truncate-end", children: [
7749
7766
  "\u2192 ",
@@ -7784,7 +7801,7 @@ var DenseToolMessage = (props) => {
7784
7801
  language: fileExtension,
7785
7802
  maxWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
7786
7803
  settings,
7787
- disableColor: status === "cancelled" /* Cancelled */,
7804
+ disableColor: status === CoreToolCallStatus.Cancelled,
7788
7805
  returnLines: true
7789
7806
  });
7790
7807
  } else {
@@ -7792,7 +7809,7 @@ var DenseToolMessage = (props) => {
7792
7809
  parsedLines,
7793
7810
  filename: diff.fileName,
7794
7811
  terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
7795
- disableColor: status === "cancelled" /* Cancelled */
7812
+ disableColor: status === CoreToolCallStatus.Cancelled
7796
7813
  });
7797
7814
  }
7798
7815
  }, [diff, isExpanded, isAlternateBuffer, terminalWidth, settings, status]);
@@ -7922,7 +7939,7 @@ function isToolExecuting(pendingHistoryItems) {
7922
7939
  return pendingHistoryItems.some((item) => {
7923
7940
  if (item && item.type === "tool_group") {
7924
7941
  return item.tools.some(
7925
- (tool) => "executing" /* Executing */ === tool.status
7942
+ (tool) => CoreToolCallStatus.Executing === tool.status
7926
7943
  );
7927
7944
  }
7928
7945
  return false;
@@ -7931,7 +7948,7 @@ function isToolExecuting(pendingHistoryItems) {
7931
7948
  function isToolAwaitingConfirmation(pendingHistoryItems) {
7932
7949
  return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
7933
7950
  (item) => item.tools.some(
7934
- (tool) => "awaiting_approval" /* AwaitingApproval */ === tool.status
7951
+ (tool) => CoreToolCallStatus.AwaitingApproval === tool.status
7935
7952
  )
7936
7953
  );
7937
7954
  }
@@ -7954,14 +7971,14 @@ function getToolGroupBorderAppearance(item, activeShellPtyId, embeddedShellFocus
7954
7971
  if (isTrackedToolCall(t)) {
7955
7972
  return t.status !== "success" && t.status !== "error" && t.status !== "cancelled";
7956
7973
  } else {
7957
- return t.status !== "success" /* Success */ && t.status !== "error" /* Error */ && t.status !== "cancelled" /* Cancelled */;
7974
+ return t.status !== CoreToolCallStatus.Success && t.status !== CoreToolCallStatus.Error && t.status !== CoreToolCallStatus.Cancelled;
7958
7975
  }
7959
7976
  });
7960
7977
  const isEmbeddedShellFocused = toolsToInspect.some((t) => {
7961
7978
  if (isTrackedToolCall(t)) {
7962
7979
  return isShellTool(t.request.name) && t.status === "executing" && t.pid === activeShellPtyId && !!embeddedShellFocused;
7963
7980
  } else {
7964
- return isShellTool(t.name) && t.status === "executing" /* Executing */ && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
7981
+ return isShellTool(t.name) && t.status === CoreToolCallStatus.Executing && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
7965
7982
  }
7966
7983
  });
7967
7984
  const isShellCommand = toolsToInspect.some((t) => {
@@ -8060,7 +8077,7 @@ var ToolGroupMessage = ({
8060
8077
  const groupedTools = (0, import_react28.useMemo)(() => {
8061
8078
  const groups = [];
8062
8079
  for (const tool of visibleToolCalls) {
8063
- if (tool.kind === "agent" /* Agent */) {
8080
+ if (tool.kind === Kind.Agent) {
8064
8081
  const lastGroup = groups[groups.length - 1];
8065
8082
  if (Array.isArray(lastGroup)) {
8066
8083
  lastGroup.push(tool);
@@ -8114,7 +8131,7 @@ var ToolGroupMessage = ({
8114
8131
  }, [groupedTools, isCompactModeEnabled, borderTopOverride]);
8115
8132
  let countToolCallsWithResults = 0;
8116
8133
  for (const tool of visibleToolCalls) {
8117
- if (tool.kind !== "agent" /* Agent */) {
8134
+ if (tool.kind !== Kind.Agent) {
8118
8135
  if (isCompactTool(tool, isCompactModeEnabled)) {
8119
8136
  if (hasDensePayload(tool)) {
8120
8137
  countToolCallsWithResults++;
@@ -8310,18 +8327,18 @@ function CompressionMessage({
8310
8327
  return "Compressing chat history";
8311
8328
  }
8312
8329
  switch (compressionStatus) {
8313
- case 1 /* COMPRESSED */:
8330
+ case CompressionStatus.COMPRESSED:
8314
8331
  return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
8315
- case 2 /* COMPRESSION_FAILED_INFLATED_TOKEN_COUNT */:
8332
+ case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
8316
8333
  if (originalTokens < 5e4) {
8317
8334
  return "Compression was not beneficial for this history size.";
8318
8335
  }
8319
8336
  return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
8320
- case 3 /* COMPRESSION_FAILED_TOKEN_COUNT_ERROR */:
8337
+ case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
8321
8338
  return "Could not compress chat history due to a token counting error.";
8322
- case 4 /* COMPRESSION_FAILED_EMPTY_SUMMARY */:
8339
+ case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
8323
8340
  return "Chat history compression failed: the model returned an empty summary.";
8324
- case 5 /* NOOP */:
8341
+ case CompressionStatus.NOOP:
8325
8342
  return "Nothing to compress.";
8326
8343
  default:
8327
8344
  return "";
@@ -8735,8 +8752,8 @@ var ModelUsageTable = ({ models }) => {
8735
8752
  );
8736
8753
  roleEntries.sort(([a], [b]) => {
8737
8754
  if (a === b) return 0;
8738
- if (a === "main" /* MAIN */) return -1;
8739
- if (b === "main" /* MAIN */) return 1;
8755
+ if (a === LlmRole.MAIN) return -1;
8756
+ if (b === LlmRole.MAIN) return 1;
8740
8757
  return a.localeCompare(b);
8741
8758
  });
8742
8759
  roleEntries.forEach(([role, roleMetrics]) => {
@@ -9067,8 +9084,8 @@ var ModelStatsDisplay = ({
9067
9084
  return validRoles.includes(role);
9068
9085
  }).sort((a, b) => {
9069
9086
  if (a === b) return 0;
9070
- if (a === "main" /* MAIN */) return -1;
9071
- if (b === "main" /* MAIN */) return 1;
9087
+ if (a === LlmRole.MAIN) return -1;
9088
+ if (b === LlmRole.MAIN) return 1;
9072
9089
  return a.localeCompare(b);
9073
9090
  });
9074
9091
  const createRow = (metric, getValue, options = {}) => {
@@ -9858,7 +9875,7 @@ var McpStatus = ({
9858
9875
  );
9859
9876
  const originalStatus = serverStatus(serverName);
9860
9877
  const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
9861
- const status = originalStatus === "disconnected" /* DISCONNECTED */ && hasCachedItems ? "connected" /* CONNECTED */ : originalStatus;
9878
+ const status = originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems ? MCPServerStatus.CONNECTED : originalStatus;
9862
9879
  let statusIndicator = "";
9863
9880
  let statusText = "";
9864
9881
  let statusColor = theme.text.primary;
@@ -9870,17 +9887,17 @@ var McpStatus = ({
9870
9887
  statusColor = theme.text.secondary;
9871
9888
  } else {
9872
9889
  switch (status) {
9873
- case "connected" /* CONNECTED */:
9890
+ case MCPServerStatus.CONNECTED:
9874
9891
  statusIndicator = "\u{1F7E2}";
9875
9892
  statusText = "Ready";
9876
9893
  statusColor = theme.status.success;
9877
9894
  break;
9878
- case "connecting" /* CONNECTING */:
9895
+ case MCPServerStatus.CONNECTING:
9879
9896
  statusIndicator = "\u{1F504}";
9880
9897
  statusText = "Starting... (first startup may take longer)";
9881
9898
  statusColor = theme.status.warning;
9882
9899
  break;
9883
- case "disconnected" /* DISCONNECTED */:
9900
+ case MCPServerStatus.DISCONNECTED:
9884
9901
  default:
9885
9902
  statusIndicator = "\u{1F534}";
9886
9903
  statusText = "Disconnected";
@@ -9928,12 +9945,12 @@ var McpStatus = ({
9928
9945
  /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Text, { children: [
9929
9946
  " - ",
9930
9947
  statusText,
9931
- status === "connected" /* CONNECTED */ && parts.length > 0 && ` (${parts.join(", ")})`
9948
+ status === MCPServerStatus.CONNECTED && parts.length > 0 && ` (${parts.join(", ")})`
9932
9949
  ] }),
9933
9950
  authStatusNode
9934
9951
  ] }),
9935
- status === "connecting" /* CONNECTING */ && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
9936
- status === "disconnected" /* DISCONNECTED */ && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Text, { children: [
9952
+ status === MCPServerStatus.CONNECTING && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
9953
+ status === MCPServerStatus.DISCONNECTED && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Text, { children: [
9937
9954
  " (",
9938
9955
  toolCount,
9939
9956
  " tools cached)"
@@ -10485,7 +10502,7 @@ var Notifications = () => {
10485
10502
  if (dismissed) return [];
10486
10503
  const counts = persistentState.get("startupWarningCounts") || {};
10487
10504
  return startupWarnings.filter((w) => {
10488
- if (w.priority === "low" /* Low */) {
10505
+ if (w.priority === WarningPriority.Low) {
10489
10506
  const count = counts[w.id] || 0;
10490
10507
  return count < MAX_STARTUP_WARNING_SHOW_COUNT;
10491
10508
  }
@@ -10498,7 +10515,7 @@ var Notifications = () => {
10498
10515
  const counts = { ...persistentState.get("startupWarningCounts") || {} };
10499
10516
  let changed = false;
10500
10517
  visibleWarnings.forEach((w) => {
10501
- if (w.priority === "low" /* Low */) {
10518
+ if (w.priority === WarningPriority.Low) {
10502
10519
  counts[w.id] = (counts[w.id] || 0) + 1;
10503
10520
  changed = true;
10504
10521
  }
@@ -10605,7 +10622,7 @@ var UserIdentity = ({ config }) => {
10605
10622
  }
10606
10623
  return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Box_default, { flexDirection: "column", children: [
10607
10624
  /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Box_default, { children: [
10608
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Text, { children: [
10625
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType === AuthType.LOGIN_WITH_GOOGLE ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Text, { children: [
10609
10626
  /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Text, { bold: true, children: [
10610
10627
  "Signed in with Google",
10611
10628
  email ? ":" : ""
@@ -10839,7 +10856,7 @@ var import_react39 = __toESM(require_react(), 1);
10839
10856
  function getConfirmingToolState(pendingHistoryItems) {
10840
10857
  const allPendingTools = getAllToolCalls(pendingHistoryItems);
10841
10858
  const confirmingTools = allPendingTools.filter(
10842
- (tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
10859
+ (tool) => tool.status === CoreToolCallStatus.AwaitingApproval
10843
10860
  );
10844
10861
  if (confirmingTools.length === 0) {
10845
10862
  return null;
@@ -12149,7 +12166,7 @@ var ExitPlanModeDialog = ({
12149
12166
  {
12150
12167
  questions: [
12151
12168
  {
12152
- type: "choice" /* CHOICE */,
12169
+ type: QuestionType.CHOICE,
12153
12170
  header: "Approval",
12154
12171
  question: planContent,
12155
12172
  options: [
@@ -12170,9 +12187,9 @@ var ExitPlanModeDialog = ({
12170
12187
  onSubmit: (answers) => {
12171
12188
  const answer = answers["0"];
12172
12189
  if (answer === "Yes, automatically accept edits" /* Auto */) {
12173
- onApprove("autoEdit" /* AUTO_EDIT */);
12190
+ onApprove(ApprovalMode.AUTO_EDIT);
12174
12191
  } else if (answer === "Yes, manually accept edits" /* Manual */) {
12175
- onApprove("default" /* DEFAULT */);
12192
+ onApprove(ApprovalMode.DEFAULT);
12176
12193
  } else if (answer) {
12177
12194
  onFeedback(answer);
12178
12195
  }
@@ -12383,7 +12400,7 @@ ${deceptiveUrlWarnings.map(
12383
12400
  );
12384
12401
  (0, import_react44.useEffect)(() => {
12385
12402
  if (isCancelling) {
12386
- handleConfirm("cancel" /* Cancel */);
12403
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12387
12404
  }
12388
12405
  }, [isCancelling, handleConfirm]);
12389
12406
  const handleSelect = (0, import_react44.useCallback)(
@@ -12396,19 +12413,19 @@ ${deceptiveUrlWarnings.map(
12396
12413
  if (!confirmationDetails.isModifying) {
12397
12414
  options2.push({
12398
12415
  label: "Allow once",
12399
- value: "proceed_once" /* ProceedOnce */,
12416
+ value: ToolConfirmationOutcome.ProceedOnce,
12400
12417
  key: "Allow once"
12401
12418
  });
12402
12419
  if (isTrustedFolder) {
12403
12420
  options2.push({
12404
12421
  label: "Allow for this session",
12405
- value: "proceed_always" /* ProceedAlways */,
12422
+ value: ToolConfirmationOutcome.ProceedAlways,
12406
12423
  key: "Allow for this session"
12407
12424
  });
12408
12425
  if (allowPermanentApproval) {
12409
12426
  options2.push({
12410
12427
  label: "Allow for this file in all future sessions",
12411
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12428
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12412
12429
  key: "Allow for this file in all future sessions"
12413
12430
  });
12414
12431
  }
@@ -12416,119 +12433,119 @@ ${deceptiveUrlWarnings.map(
12416
12433
  if (!config.getIdeMode() || !isDiffingEnabled) {
12417
12434
  options2.push({
12418
12435
  label: "Modify with external editor",
12419
- value: "modify_with_editor" /* ModifyWithEditor */,
12436
+ value: ToolConfirmationOutcome.ModifyWithEditor,
12420
12437
  key: "Modify with external editor"
12421
12438
  });
12422
12439
  }
12423
12440
  options2.push({
12424
12441
  label: "No, suggest changes (esc)",
12425
- value: "cancel" /* Cancel */,
12442
+ value: ToolConfirmationOutcome.Cancel,
12426
12443
  key: "No, suggest changes (esc)"
12427
12444
  });
12428
12445
  }
12429
12446
  } else if (confirmationDetails.type === "sandbox_expansion") {
12430
12447
  options2.push({
12431
12448
  label: "Allow once",
12432
- value: "proceed_once" /* ProceedOnce */,
12449
+ value: ToolConfirmationOutcome.ProceedOnce,
12433
12450
  key: "Allow once"
12434
12451
  });
12435
12452
  if (isTrustedFolder) {
12436
12453
  options2.push({
12437
12454
  label: "Allow for this session",
12438
- value: "proceed_always" /* ProceedAlways */,
12455
+ value: ToolConfirmationOutcome.ProceedAlways,
12439
12456
  key: "Allow for this session"
12440
12457
  });
12441
12458
  if (allowPermanentApproval) {
12442
12459
  options2.push({
12443
12460
  label: "Allow for all future sessions",
12444
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12461
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12445
12462
  key: "Allow for all future sessions"
12446
12463
  });
12447
12464
  }
12448
12465
  }
12449
12466
  options2.push({
12450
12467
  label: "No, suggest changes (esc)",
12451
- value: "cancel" /* Cancel */,
12468
+ value: ToolConfirmationOutcome.Cancel,
12452
12469
  key: "No, suggest changes (esc)"
12453
12470
  });
12454
12471
  } else if (confirmationDetails.type === "exec") {
12455
12472
  options2.push({
12456
12473
  label: "Allow once",
12457
- value: "proceed_once" /* ProceedOnce */,
12474
+ value: ToolConfirmationOutcome.ProceedOnce,
12458
12475
  key: "Allow once"
12459
12476
  });
12460
12477
  if (isTrustedFolder) {
12461
12478
  options2.push({
12462
12479
  label: `Allow for this session`,
12463
- value: "proceed_always" /* ProceedAlways */,
12480
+ value: ToolConfirmationOutcome.ProceedAlways,
12464
12481
  key: `Allow for this session`
12465
12482
  });
12466
12483
  if (allowPermanentApproval) {
12467
12484
  options2.push({
12468
12485
  label: `Allow this command for all future sessions`,
12469
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12486
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12470
12487
  key: `Allow for all future sessions`
12471
12488
  });
12472
12489
  }
12473
12490
  }
12474
12491
  options2.push({
12475
12492
  label: "No, suggest changes (esc)",
12476
- value: "cancel" /* Cancel */,
12493
+ value: ToolConfirmationOutcome.Cancel,
12477
12494
  key: "No, suggest changes (esc)"
12478
12495
  });
12479
12496
  } else if (confirmationDetails.type === "info") {
12480
12497
  options2.push({
12481
12498
  label: "Allow once",
12482
- value: "proceed_once" /* ProceedOnce */,
12499
+ value: ToolConfirmationOutcome.ProceedOnce,
12483
12500
  key: "Allow once"
12484
12501
  });
12485
12502
  if (isTrustedFolder) {
12486
12503
  options2.push({
12487
12504
  label: "Allow for this session",
12488
- value: "proceed_always" /* ProceedAlways */,
12505
+ value: ToolConfirmationOutcome.ProceedAlways,
12489
12506
  key: "Allow for this session"
12490
12507
  });
12491
12508
  if (allowPermanentApproval) {
12492
12509
  options2.push({
12493
12510
  label: "Allow for all future sessions",
12494
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12511
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12495
12512
  key: "Allow for all future sessions"
12496
12513
  });
12497
12514
  }
12498
12515
  }
12499
12516
  options2.push({
12500
12517
  label: "No, suggest changes (esc)",
12501
- value: "cancel" /* Cancel */,
12518
+ value: ToolConfirmationOutcome.Cancel,
12502
12519
  key: "No, suggest changes (esc)"
12503
12520
  });
12504
12521
  } else if (confirmationDetails.type === "mcp") {
12505
12522
  options2.push({
12506
12523
  label: "Allow once",
12507
- value: "proceed_once" /* ProceedOnce */,
12524
+ value: ToolConfirmationOutcome.ProceedOnce,
12508
12525
  key: "Allow once"
12509
12526
  });
12510
12527
  if (isTrustedFolder) {
12511
12528
  options2.push({
12512
12529
  label: "Allow tool for this session",
12513
- value: "proceed_always_tool" /* ProceedAlwaysTool */,
12530
+ value: ToolConfirmationOutcome.ProceedAlwaysTool,
12514
12531
  key: "Allow tool for this session"
12515
12532
  });
12516
12533
  options2.push({
12517
12534
  label: "Allow all server tools for this session",
12518
- value: "proceed_always_server" /* ProceedAlwaysServer */,
12535
+ value: ToolConfirmationOutcome.ProceedAlwaysServer,
12519
12536
  key: "Allow all server tools for this session"
12520
12537
  });
12521
12538
  if (allowPermanentApproval) {
12522
12539
  options2.push({
12523
12540
  label: "Allow tool for all future sessions",
12524
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12541
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12525
12542
  key: "Allow tool for all future sessions"
12526
12543
  });
12527
12544
  }
12528
12545
  }
12529
12546
  options2.push({
12530
12547
  label: "No, suggest changes (esc)",
12531
- value: "cancel" /* Cancel */,
12548
+ value: ToolConfirmationOutcome.Cancel,
12532
12549
  key: "No, suggest changes (esc)"
12533
12550
  });
12534
12551
  }
@@ -12567,7 +12584,7 @@ ${deceptiveUrlWarnings.map(
12567
12584
  const containsRedirection = commandsToDisplay.some(
12568
12585
  (cmd) => hasRedirection(cmd)
12569
12586
  );
12570
- const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
12587
+ const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
12571
12588
  if (containsRedirection && !isAutoEdit) {
12572
12589
  extraInfoLines = 1;
12573
12590
  }
@@ -12593,7 +12610,7 @@ ${deceptiveUrlWarnings.map(
12593
12610
  const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
12594
12611
  if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
12595
12612
  const alwaysAndSaveIndex = options2.findIndex(
12596
- (o) => o.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */
12613
+ (o) => o.value === ToolConfirmationOutcome.ProceedAlwaysAndSave
12597
12614
  );
12598
12615
  if (alwaysAndSaveIndex !== -1) {
12599
12616
  initialIndex2 = alwaysAndSaveIndex;
@@ -12610,10 +12627,10 @@ ${deceptiveUrlWarnings.map(
12610
12627
  {
12611
12628
  questions: confirmationDetails.questions,
12612
12629
  onSubmit: (answers) => {
12613
- handleConfirm("proceed_once" /* ProceedOnce */, { answers });
12630
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, { answers });
12614
12631
  },
12615
12632
  onCancel: () => {
12616
- handleConfirm("cancel" /* Cancel */);
12633
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12617
12634
  },
12618
12635
  width: terminalWidth,
12619
12636
  availableHeight: bodyHeight
@@ -12634,19 +12651,19 @@ ${deceptiveUrlWarnings.map(
12634
12651
  planPath: confirmationDetails.planPath,
12635
12652
  getPreferredEditor,
12636
12653
  onApprove: (approvalMode) => {
12637
- handleConfirm("proceed_once" /* ProceedOnce */, {
12654
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
12638
12655
  approved: true,
12639
12656
  approvalMode
12640
12657
  });
12641
12658
  },
12642
12659
  onFeedback: (feedback) => {
12643
- handleConfirm("proceed_once" /* ProceedOnce */, {
12660
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
12644
12661
  approved: false,
12645
12662
  feedback
12646
12663
  });
12647
12664
  },
12648
12665
  onCancel: () => {
12649
- handleConfirm("cancel" /* Cancel */);
12666
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12650
12667
  },
12651
12668
  width: terminalWidth,
12652
12669
  availableHeight: bodyHeight
@@ -12756,7 +12773,7 @@ ${deceptiveUrlWarnings.map(
12756
12773
  const containsRedirection = commandsToDisplay.some(
12757
12774
  (cmd) => hasRedirection(cmd)
12758
12775
  );
12759
- const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
12776
+ const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
12760
12777
  let warnings = null;
12761
12778
  if (containsRedirection && !isAutoEdit) {
12762
12779
  const tipText = `To auto-accept, press ${formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */)}`;
@@ -12919,7 +12936,7 @@ ${deceptiveUrlWarnings.map(
12919
12936
  const bodyOverflowDirection = confirmationDetails.type === "mcp" && isMcpToolDetailsExpanded ? "bottom" : "top";
12920
12937
  const renderRadioItem = (0, import_react44.useCallback)(
12921
12938
  (item, { titleColor }) => {
12922
- if (item.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */) {
12939
+ if (item.value === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
12923
12940
  return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Text, { color: titleColor, wrap: "truncate", children: [
12924
12941
  item.label,
12925
12942
  " ",
@@ -15077,7 +15094,7 @@ function validateAuthMethodWithSettings(authType, settings) {
15077
15094
  if (settings.merged.security.auth.useExternal) {
15078
15095
  return null;
15079
15096
  }
15080
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
15097
+ if (authType === AuthType.USE_GEMINI) {
15081
15098
  return null;
15082
15099
  }
15083
15100
  return validateAuthMethod(authType);
@@ -15129,7 +15146,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
15129
15146
  }
15130
15147
  return;
15131
15148
  }
15132
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
15149
+ if (authType === AuthType.USE_GEMINI) {
15133
15150
  const key = await reloadApiKey();
15134
15151
  if (!key) {
15135
15152
  setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
@@ -15204,31 +15221,31 @@ function AuthDialog({
15204
15221
  let items = [
15205
15222
  {
15206
15223
  label: "Sign in with Google",
15207
- value: "oauth-personal" /* LOGIN_WITH_GOOGLE */,
15208
- key: "oauth-personal" /* LOGIN_WITH_GOOGLE */
15224
+ value: AuthType.LOGIN_WITH_GOOGLE,
15225
+ key: AuthType.LOGIN_WITH_GOOGLE
15209
15226
  },
15210
15227
  ...process.env["CLOUD_SHELL"] === "true" ? [
15211
15228
  {
15212
15229
  label: "Use Cloud Shell user credentials",
15213
- value: "compute-default-credentials" /* COMPUTE_ADC */,
15214
- key: "compute-default-credentials" /* COMPUTE_ADC */
15230
+ value: AuthType.COMPUTE_ADC,
15231
+ key: AuthType.COMPUTE_ADC
15215
15232
  }
15216
15233
  ] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
15217
15234
  {
15218
15235
  label: "Use metadata server application default credentials",
15219
- value: "compute-default-credentials" /* COMPUTE_ADC */,
15220
- key: "compute-default-credentials" /* COMPUTE_ADC */
15236
+ value: AuthType.COMPUTE_ADC,
15237
+ key: AuthType.COMPUTE_ADC
15221
15238
  }
15222
15239
  ] : [],
15223
15240
  {
15224
15241
  label: "Use Gemini API Key",
15225
- value: "gemini-api-key" /* USE_GEMINI */,
15226
- key: "gemini-api-key" /* USE_GEMINI */
15242
+ value: AuthType.USE_GEMINI,
15243
+ key: AuthType.USE_GEMINI
15227
15244
  },
15228
15245
  {
15229
15246
  label: "Vertex AI",
15230
- value: "vertex-ai" /* USE_VERTEX_AI */,
15231
- key: "vertex-ai" /* USE_VERTEX_AI */
15247
+ value: AuthType.USE_VERTEX_AI,
15248
+ key: AuthType.USE_VERTEX_AI
15232
15249
  }
15233
15250
  ];
15234
15251
  if (settings.merged.security.auth.enforcedType) {
@@ -15250,9 +15267,9 @@ function AuthDialog({
15250
15267
  return item.value === defaultAuthType;
15251
15268
  }
15252
15269
  if (process.env["GEMINI_API_KEY"]) {
15253
- return item.value === "gemini-api-key" /* USE_GEMINI */;
15270
+ return item.value === AuthType.USE_GEMINI;
15254
15271
  }
15255
- return item.value === "oauth-personal" /* LOGIN_WITH_GOOGLE */;
15272
+ return item.value === AuthType.LOGIN_WITH_GOOGLE;
15256
15273
  });
15257
15274
  if (settings.merged.security.auth.enforcedType) {
15258
15275
  initialAuthIndex = 0;
@@ -15263,19 +15280,19 @@ function AuthDialog({
15263
15280
  return;
15264
15281
  }
15265
15282
  if (authType) {
15266
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */) {
15283
+ if (authType === AuthType.LOGIN_WITH_GOOGLE) {
15267
15284
  setAuthContext({ requiresRestart: true });
15268
15285
  } else {
15269
15286
  setAuthContext({});
15270
15287
  }
15271
15288
  await clearCachedCredentialFile();
15272
15289
  settings.setValue(scope, "security.auth.selectedType", authType);
15273
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
15290
+ if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
15274
15291
  setExiting(true);
15275
15292
  setTimeout(relaunchApp, 100);
15276
15293
  return;
15277
15294
  }
15278
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
15295
+ if (authType === AuthType.USE_GEMINI) {
15279
15296
  setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
15280
15297
  return;
15281
15298
  }
@@ -16025,11 +16042,11 @@ var PrivacyNoticeText = ({
16025
16042
  }) => {
16026
16043
  const authType = config.getContentGeneratorConfig()?.authType;
16027
16044
  switch (authType) {
16028
- case "gemini-api-key" /* USE_GEMINI */:
16045
+ case AuthType.USE_GEMINI:
16029
16046
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(GeminiPrivacyNotice, { onExit });
16030
- case "vertex-ai" /* USE_VERTEX_AI */:
16047
+ case AuthType.USE_VERTEX_AI:
16031
16048
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(CloudPaidPrivacyNotice, { onExit });
16032
- case "oauth-personal" /* LOGIN_WITH_GOOGLE */:
16049
+ case AuthType.LOGIN_WITH_GOOGLE:
16033
16050
  default:
16034
16051
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(CloudFreePrivacyNotice, { config, onExit });
16035
16052
  }
@@ -16070,7 +16087,7 @@ function ProQuotaDialog({
16070
16087
  value: "retry_always",
16071
16088
  key: "retry_always"
16072
16089
  },
16073
- ...authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && !isUltra ? [
16090
+ ...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
16074
16091
  {
16075
16092
  label: "Upgrade for higher limits",
16076
16093
  value: "upgrade",
@@ -17223,7 +17240,7 @@ function ModelDialog({ onClose }) {
17223
17240
  const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
17224
17241
  const useGemini31FlashLite = config?.getGemini31FlashLiteLaunchedSync?.() ?? false;
17225
17242
  const selectedAuthType = settings.merged.security.auth.selectedType;
17226
- const useCustomToolModel = useGemini31 && selectedAuthType === "gemini-api-key" /* USE_GEMINI */;
17243
+ const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
17227
17244
  const manualModelSelected = (0, import_react62.useMemo)(() => {
17228
17245
  if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
17229
17246
  const def = config.getModelConfigService().getModelDefinition(preferredModel);
@@ -18275,10 +18292,10 @@ function initializeConsoleStore() {
18275
18292
  globalConsoleMessages = [];
18276
18293
  globalErrorCount = 0;
18277
18294
  notifyListeners();
18278
- coreEvents.off("console-log" /* ConsoleLog */, handleConsoleLog);
18279
- coreEvents.off("output" /* Output */, handleOutput);
18280
- coreEvents.on("console-log" /* ConsoleLog */, handleConsoleLog);
18281
- coreEvents.on("output" /* Output */, handleOutput);
18295
+ coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
18296
+ coreEvents.off(CoreEvent.Output, handleOutput);
18297
+ coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
18298
+ coreEvents.on(CoreEvent.Output, handleOutput);
18282
18299
  }
18283
18300
  function notifyListeners() {
18284
18301
  for (const listener of listeners) {
@@ -20376,7 +20393,7 @@ function usePromptCompletion({
20376
20393
  { model: "prompt-completion" },
20377
20394
  contents,
20378
20395
  signal,
20379
- "utility_autocomplete" /* UTILITY_AUTOCOMPLETE */
20396
+ LlmRole.UTILITY_AUTOCOMPLETE
20380
20397
  );
20381
20398
  if (signal.aborted) {
20382
20399
  return;
@@ -22103,9 +22120,9 @@ var InputPrompt = ({
22103
22120
  onSuggestionsVisibilityChange(shouldShowSuggestions);
22104
22121
  }
22105
22122
  }, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
22106
- const showAutoAcceptStyling = !shellModeActive && approvalMode === "autoEdit" /* AUTO_EDIT */;
22107
- const showYoloStyling = !shellModeActive && approvalMode === "yolo" /* YOLO */;
22108
- const showPlanStyling = !shellModeActive && approvalMode === "plan" /* PLAN */;
22123
+ const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
22124
+ const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
22125
+ const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
22109
22126
  let statusColor;
22110
22127
  let statusText = "";
22111
22128
  if (shellModeActive) {
@@ -22937,22 +22954,22 @@ var ApprovalModeIndicator = ({
22937
22954
  const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
22938
22955
  const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
22939
22956
  switch (approvalMode) {
22940
- case "autoEdit" /* AUTO_EDIT */:
22957
+ case ApprovalMode.AUTO_EDIT:
22941
22958
  textColor = theme.status.warning;
22942
22959
  textContent = "auto-accept edits";
22943
22960
  subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
22944
22961
  break;
22945
- case "plan" /* PLAN */:
22962
+ case ApprovalMode.PLAN:
22946
22963
  textColor = theme.status.success;
22947
22964
  textContent = "plan";
22948
22965
  subText = `${cycleHint} to manual`;
22949
22966
  break;
22950
- case "yolo" /* YOLO */:
22967
+ case ApprovalMode.YOLO:
22951
22968
  textColor = theme.status.error;
22952
22969
  textContent = "YOLO";
22953
22970
  subText = yoloHint;
22954
22971
  break;
22955
- case "default" /* DEFAULT */:
22972
+ case ApprovalMode.DEFAULT:
22956
22973
  default:
22957
22974
  textColor = theme.text.accent;
22958
22975
  textContent = "";
@@ -23000,7 +23017,7 @@ var useComposerStatus = () => {
23000
23017
  (item) => item.type === "tool_group"
23001
23018
  ).some(
23002
23019
  (item) => item.tools.some(
23003
- (tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
23020
+ (tool) => tool.status === CoreToolCallStatus.AwaitingApproval
23004
23021
  )
23005
23022
  ),
23006
23023
  [uiState.pendingHistoryItems]
@@ -23015,13 +23032,13 @@ var useComposerStatus = () => {
23015
23032
  const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
23016
23033
  if (hideMinimalModeHintWhileBusy) return null;
23017
23034
  switch (showApprovalModeIndicator) {
23018
- case "yolo" /* YOLO */:
23035
+ case ApprovalMode.YOLO:
23019
23036
  return { text: "YOLO", color: theme.status.error };
23020
- case "plan" /* PLAN */:
23037
+ case ApprovalMode.PLAN:
23021
23038
  return { text: "plan", color: theme.status.success };
23022
- case "autoEdit" /* AUTO_EDIT */:
23039
+ case ApprovalMode.AUTO_EDIT:
23023
23040
  return { text: "auto edit", color: theme.status.warning };
23024
- case "default" /* DEFAULT */:
23041
+ case ApprovalMode.DEFAULT:
23025
23042
  default:
23026
23043
  return null;
23027
23044
  }
@@ -23375,7 +23392,7 @@ var ConfigInitDisplay = ({
23375
23392
  let connected = 0;
23376
23393
  const connecting = [];
23377
23394
  for (const [name, client] of clients.entries()) {
23378
- if (client.getStatus() === "connected" /* CONNECTED */) {
23395
+ if (client.getStatus() === MCPServerStatus.CONNECTED) {
23379
23396
  connected++;
23380
23397
  } else {
23381
23398
  connecting.push(name);
@@ -23397,9 +23414,9 @@ var ConfigInitDisplay = ({
23397
23414
  );
23398
23415
  }
23399
23416
  };
23400
- coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
23417
+ coreEvents.on(CoreEvent.McpClientUpdate, onChange);
23401
23418
  return () => {
23402
- coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
23419
+ coreEvents.off(CoreEvent.McpClientUpdate, onChange);
23403
23420
  };
23404
23421
  }, [initialMessage]);
23405
23422
  return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Text, { children: [
@@ -24114,7 +24131,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
24114
24131
  callId,
24115
24132
  name: SHELL_COMMAND_NAME,
24116
24133
  description: rawQuery,
24117
- status: "executing" /* Executing */,
24134
+ status: CoreToolCallStatus.Executing,
24118
24135
  isClientInitiated: true,
24119
24136
  resultDisplay: "",
24120
24137
  confirmationDetails: void 0
@@ -24255,7 +24272,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
24255
24272
  mainContent = result.output.trim() || "(Command produced no output)";
24256
24273
  }
24257
24274
  let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
24258
- let finalStatus = "success" /* Success */;
24275
+ let finalStatus = CoreToolCallStatus.Success;
24259
24276
  const prependToAnsiOutput = (output, text) => {
24260
24277
  const newLines = text.split("\n").map((line) => [
24261
24278
  {
@@ -24274,20 +24291,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
24274
24291
  };
24275
24292
  let prefix = "";
24276
24293
  if (result.error) {
24277
- finalStatus = "error" /* Error */;
24294
+ finalStatus = CoreToolCallStatus.Error;
24278
24295
  prefix = result.error.message;
24279
24296
  } else if (result.aborted) {
24280
- finalStatus = "cancelled" /* Cancelled */;
24297
+ finalStatus = CoreToolCallStatus.Cancelled;
24281
24298
  prefix = "Command was cancelled.";
24282
24299
  } else if (result.backgrounded) {
24283
- finalStatus = "success" /* Success */;
24300
+ finalStatus = CoreToolCallStatus.Success;
24284
24301
  finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
24285
24302
  mainContent = finalOutput;
24286
24303
  } else if (result.signal) {
24287
- finalStatus = "error" /* Error */;
24304
+ finalStatus = CoreToolCallStatus.Error;
24288
24305
  prefix = `Command terminated by signal: ${result.signal}.`;
24289
24306
  } else if (result.exitCode !== 0) {
24290
- finalStatus = "error" /* Error */;
24307
+ finalStatus = CoreToolCallStatus.Error;
24291
24308
  prefix = `Command exited with code ${result.exitCode}.`;
24292
24309
  }
24293
24310
  if (prefix) {
@@ -24313,7 +24330,7 @@ ${mainContent}`;
24313
24330
  status: finalStatus,
24314
24331
  resultDisplay: finalOutput
24315
24332
  };
24316
- if (finalStatus !== "cancelled" /* Cancelled */) {
24333
+ if (finalStatus !== CoreToolCallStatus.Cancelled) {
24317
24334
  addItemToHistory(
24318
24335
  {
24319
24336
  type: "tool_group",
@@ -25303,7 +25320,7 @@ function useQuotaAndFallback({
25303
25320
  error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
25304
25321
  `/stats model for usage details`,
25305
25322
  `/model to switch models.`,
25306
- contentGeneratorConfig?.authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? `/auth to switch to API key.` : null
25323
+ contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
25307
25324
  ].filter(Boolean);
25308
25325
  message = messageLines.join("\n");
25309
25326
  } else if (error instanceof ModelNotFoundError) {
@@ -25491,7 +25508,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
25491
25508
  );
25492
25509
  setEditorError(null);
25493
25510
  setIsEditorDialogOpen(false);
25494
- coreEvents.emit("editor-selected" /* EditorSelected */, { editor: editorType });
25511
+ coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
25495
25512
  } catch (error) {
25496
25513
  setEditorError(`Failed to set editor preference: ${error}`);
25497
25514
  }
@@ -25500,7 +25517,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
25500
25517
  );
25501
25518
  const exitEditorDialog = (0, import_react95.useCallback)(() => {
25502
25519
  setIsEditorDialogOpen(false);
25503
- coreEvents.emit("editor-selected" /* EditorSelected */, { editor: void 0 });
25520
+ coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
25504
25521
  }, []);
25505
25522
  return {
25506
25523
  isEditorDialogOpen,
@@ -25859,7 +25876,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
25859
25876
  canonicalPath: resolvedCommandPath
25860
25877
  } = parseSlashCommand(trimmed, commands);
25861
25878
  if (!commandToExecute) {
25862
- const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === "in_progress" /* IN_PROGRESS */;
25879
+ const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
25863
25880
  if (isMcpLoading) {
25864
25881
  setIsProcessing(true);
25865
25882
  if (addToHistory) {
@@ -26027,7 +26044,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26027
26044
  onConfirm: async (resolvedOutcome) => {
26028
26045
  resolve3({
26029
26046
  outcome: resolvedOutcome,
26030
- approvedCommands: resolvedOutcome === "cancel" /* Cancel */ ? [] : result.commandsToConfirm
26047
+ approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
26031
26048
  });
26032
26049
  }
26033
26050
  };
@@ -26035,7 +26052,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26035
26052
  callId,
26036
26053
  name: "Expansion",
26037
26054
  description: "Command expansion needs shell access",
26038
- status: "awaiting_approval" /* AwaitingApproval */,
26055
+ status: CoreToolCallStatus.AwaitingApproval,
26039
26056
  isClientInitiated: true,
26040
26057
  resultDisplay: void 0,
26041
26058
  confirmationDetails
@@ -26046,7 +26063,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26046
26063
  });
26047
26064
  });
26048
26065
  setPendingItem(null);
26049
- if (outcome === "cancel" /* Cancel */ || !approvedCommands || approvedCommands.length === 0) {
26066
+ if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
26050
26067
  addItem(
26051
26068
  {
26052
26069
  type: "info" /* INFO */,
@@ -26056,7 +26073,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26056
26073
  );
26057
26074
  return { type: "handled" };
26058
26075
  }
26059
- if (outcome === "proceed_always" /* ProceedAlways */) {
26076
+ if (outcome === ToolConfirmationOutcome.ProceedAlways) {
26060
26077
  setSessionShellAllowlist(
26061
26078
  (prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
26062
26079
  );
@@ -26532,7 +26549,7 @@ function mapToDisplay(toolOrTools, options = {}) {
26532
26549
  let description;
26533
26550
  let renderOutputAsMarkdown = false;
26534
26551
  const displayName = call.tool?.displayName ?? call.request.name;
26535
- if (call.status === "error" /* Error */) {
26552
+ if (call.status === CoreToolCallStatus.Error) {
26536
26553
  description = JSON.stringify(call.request.args);
26537
26554
  } else {
26538
26555
  description = call.invocation.getDescription();
@@ -26555,27 +26572,27 @@ function mapToDisplay(toolOrTools, options = {}) {
26555
26572
  let progress = void 0;
26556
26573
  let progressTotal = void 0;
26557
26574
  switch (call.status) {
26558
- case "success" /* Success */:
26575
+ case CoreToolCallStatus.Success:
26559
26576
  resultDisplay = call.response.resultDisplay;
26560
26577
  outputFile = call.response.outputFile;
26561
26578
  break;
26562
- case "error" /* Error */:
26563
- case "cancelled" /* Cancelled */:
26579
+ case CoreToolCallStatus.Error:
26580
+ case CoreToolCallStatus.Cancelled:
26564
26581
  resultDisplay = call.response.resultDisplay;
26565
26582
  break;
26566
- case "awaiting_approval" /* AwaitingApproval */:
26583
+ case CoreToolCallStatus.AwaitingApproval:
26567
26584
  correlationId = call.correlationId;
26568
26585
  confirmationDetails = call.confirmationDetails;
26569
26586
  break;
26570
- case "executing" /* Executing */:
26587
+ case CoreToolCallStatus.Executing:
26571
26588
  resultDisplay = call.liveOutput;
26572
26589
  ptyId = call.pid;
26573
26590
  progressMessage = call.progressMessage;
26574
26591
  progress = call.progress;
26575
26592
  progressTotal = call.progressTotal;
26576
26593
  break;
26577
- case "scheduled" /* Scheduled */:
26578
- case "validating" /* Validating */:
26594
+ case CoreToolCallStatus.Scheduled:
26595
+ case CoreToolCallStatus.Validating:
26579
26596
  break;
26580
26597
  default: {
26581
26598
  const exhaustiveCheck = call;
@@ -26646,7 +26663,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26646
26663
  const handler = (event) => {
26647
26664
  const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
26648
26665
  const hasExecuting = event.toolCalls.some(
26649
- (tc) => tc.status === "executing" /* Executing */ || (tc.status === "success" /* Success */ || tc.status === "error" /* Error */) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
26666
+ (tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
26650
26667
  );
26651
26668
  if (hasExecuting) {
26652
26669
  setLastToolOutputTime(Date.now());
@@ -26655,7 +26672,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26655
26672
  const prevCalls = prev[event.schedulerId] ?? [];
26656
26673
  const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
26657
26674
  const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
26658
- (tc) => tc.status === "awaiting_approval" /* AwaitingApproval */ || prevCallIds.has(tc.request.callId)
26675
+ (tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
26659
26676
  );
26660
26677
  if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
26661
26678
  return prev;
@@ -26667,9 +26684,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26667
26684
  };
26668
26685
  });
26669
26686
  };
26670
- messageBus.subscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
26687
+ messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
26671
26688
  return () => {
26672
- messageBus.unsubscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
26689
+ messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
26673
26690
  };
26674
26691
  }, [messageBus, internalAdaptToolCalls]);
26675
26692
  (0, import_react101.useEffect)(() => {
@@ -26691,9 +26708,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26691
26708
  };
26692
26709
  });
26693
26710
  };
26694
- messageBus.subscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
26711
+ messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
26695
26712
  return () => {
26696
- messageBus.unsubscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
26713
+ messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
26697
26714
  };
26698
26715
  }, [messageBus]);
26699
26716
  const schedule = (0, import_react101.useCallback)(
@@ -26792,8 +26809,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
26792
26809
  const prev = prevMap.get(coreCall.request.callId);
26793
26810
  const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
26794
26811
  let status = coreCall.status;
26795
- if ((status === "success" /* Success */ || status === "error" /* Error */) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
26796
- status = "executing" /* Executing */;
26812
+ if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
26813
+ status = CoreToolCallStatus.Executing;
26797
26814
  }
26798
26815
  return {
26799
26816
  ...coreCall,
@@ -26825,7 +26842,7 @@ function getBackgroundedToolInfo(toolCall) {
26825
26842
  };
26826
26843
  }
26827
26844
  function isBackgroundableExecutingToolCall(toolCall) {
26828
- return toolCall.status === "executing" /* Executing */ && typeof toolCall.pid === "number";
26845
+ return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
26829
26846
  }
26830
26847
  function showCitations(settings) {
26831
26848
  const enabled = settings.merged.ui.showCitations;
@@ -26835,14 +26852,14 @@ function showCitations(settings) {
26835
26852
  return true;
26836
26853
  }
26837
26854
  function calculateStreamingState(isResponding, toolCalls) {
26838
- if (toolCalls.some((tc) => tc.status === "awaiting_approval" /* AwaitingApproval */)) {
26855
+ if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
26839
26856
  return "waiting_for_confirmation" /* WaitingForConfirmation */;
26840
26857
  }
26841
26858
  const isAnyToolActive = toolCalls.some((tc) => {
26842
- if (tc.status === "executing" /* Executing */ || tc.status === "scheduled" /* Scheduled */ || tc.status === "validating" /* Validating */) {
26859
+ if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
26843
26860
  return true;
26844
26861
  }
26845
- if (tc.status === "success" /* Success */ || tc.status === "error" /* Error */ || tc.status === "cancelled" /* Cancelled */) {
26862
+ if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
26846
26863
  return !tc.responseSubmittedToGemini;
26847
26864
  }
26848
26865
  return false;
@@ -26889,9 +26906,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
26889
26906
  }
26890
26907
  setRetryStatus(payload);
26891
26908
  };
26892
- coreEvents.on("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
26909
+ coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
26893
26910
  return () => {
26894
- coreEvents.off("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
26911
+ coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
26895
26912
  };
26896
26913
  }, [isRespondingRef]);
26897
26914
  const [
@@ -27024,12 +27041,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27024
27041
  const tc = toolCalls[i];
27025
27042
  if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
27026
27043
  if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
27027
- const isAgent = tc.tool?.kind === "agent" /* Agent */;
27044
+ const isAgent = tc.tool?.kind === Kind.Agent;
27028
27045
  if (isAgent) {
27029
27046
  let contigAgentsComplete = true;
27030
27047
  for (let j = i + 1; j < toolCalls.length; j++) {
27031
27048
  const nextTc = toolCalls[j];
27032
- if (nextTc.tool?.kind === "agent" /* Agent */) {
27049
+ if (nextTc.tool?.kind === Kind.Agent) {
27033
27050
  if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
27034
27051
  contigAgentsComplete = false;
27035
27052
  break;
@@ -27055,7 +27072,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27055
27072
  let currentGroup = [];
27056
27073
  for (const tc of toolsToPush) {
27057
27074
  newPushed.add(tc.request.callId);
27058
- if (tc.tool?.kind === "agent" /* Agent */) {
27075
+ if (tc.tool?.kind === Kind.Agent) {
27059
27076
  currentGroup.push(tc);
27060
27077
  } else {
27061
27078
  if (currentGroup.length > 0) {
@@ -27205,7 +27222,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27205
27222
  prevActiveShellPtyIdRef.current = activeShellPtyId;
27206
27223
  }, [activeShellPtyId, addItem, setIsResponding]);
27207
27224
  (0, import_react102.useEffect)(() => {
27208
- if (config.getApprovalMode() === "yolo" /* YOLO */ && streamingState === "idle" /* Idle */) {
27225
+ if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
27209
27226
  const lastUserMessageIndex = history.findLastIndex(
27210
27227
  (item) => item.type === "user" /* USER */
27211
27228
  );
@@ -27291,7 +27308,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27291
27308
  if (tool.name === SHELL_COMMAND_NAME) {
27292
27309
  return {
27293
27310
  ...tool,
27294
- status: "cancelled" /* Cancelled */,
27311
+ status: CoreToolCallStatus.Cancelled,
27295
27312
  resultDisplay: tool.resultDisplay
27296
27313
  };
27297
27314
  }
@@ -27347,7 +27364,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27347
27364
  let localQueryToSendToGemini = null;
27348
27365
  if (typeof query === "string") {
27349
27366
  const trimmedQuery = query.trim();
27350
- await logger?.logMessage("user" /* USER */, trimmedQuery);
27367
+ await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
27351
27368
  if (!shellModeActive) {
27352
27369
  const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
27353
27370
  if (slashCommandResult) {
@@ -27503,7 +27520,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27503
27520
  if (pendingHistoryItemRef.current) {
27504
27521
  if (pendingHistoryItemRef.current.type === "tool_group") {
27505
27522
  const updatedTools = pendingHistoryItemRef.current.tools.map(
27506
- (tool) => tool.status === "validating" /* Validating */ || tool.status === "scheduled" /* Scheduled */ || tool.status === "awaiting_approval" /* AwaitingApproval */ || tool.status === "executing" /* Executing */ ? { ...tool, status: "cancelled" /* Cancelled */ } : tool
27523
+ (tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
27507
27524
  );
27508
27525
  const pendingItem = {
27509
27526
  ...pendingHistoryItemRef.current,
@@ -27749,15 +27766,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27749
27766
  let geminiMessageBuffer = "";
27750
27767
  const toolCallRequests = [];
27751
27768
  for await (const event of stream) {
27752
- if (event.type !== "thought" /* Thought */ && thoughtRef.current !== null) {
27769
+ if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
27753
27770
  setThought(null);
27754
27771
  }
27755
27772
  switch (event.type) {
27756
- case "thought" /* Thought */:
27773
+ case GeminiEventType.Thought:
27757
27774
  setLastGeminiActivityTime(Date.now());
27758
27775
  handleThoughtEvent(event.value, userMessageTimestamp);
27759
27776
  break;
27760
- case "content" /* Content */:
27777
+ case GeminiEventType.Content:
27761
27778
  setLastGeminiActivityTime(Date.now());
27762
27779
  geminiMessageBuffer = handleContentEvent(
27763
27780
  event.value,
@@ -27765,16 +27782,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27765
27782
  userMessageTimestamp
27766
27783
  );
27767
27784
  break;
27768
- case "tool_call_request" /* ToolCallRequest */:
27785
+ case GeminiEventType.ToolCallRequest:
27769
27786
  toolCallRequests.push(event.value);
27770
27787
  break;
27771
- case "user_cancelled" /* UserCancelled */:
27788
+ case GeminiEventType.UserCancelled:
27772
27789
  handleUserCancelledEvent(userMessageTimestamp);
27773
27790
  break;
27774
- case "error" /* Error */:
27791
+ case GeminiEventType.Error:
27775
27792
  handleErrorEvent(event.value, userMessageTimestamp);
27776
27793
  break;
27777
- case "agent_execution_stopped" /* AgentExecutionStopped */:
27794
+ case GeminiEventType.AgentExecutionStopped:
27778
27795
  handleAgentExecutionStoppedEvent(
27779
27796
  event.value.reason,
27780
27797
  userMessageTimestamp,
@@ -27782,7 +27799,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27782
27799
  event.value.contextCleared
27783
27800
  );
27784
27801
  break;
27785
- case "agent_execution_blocked" /* AgentExecutionBlocked */:
27802
+ case GeminiEventType.AgentExecutionBlocked:
27786
27803
  handleAgentExecutionBlockedEvent(
27787
27804
  event.value.reason,
27788
27805
  userMessageTimestamp,
@@ -27790,35 +27807,35 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27790
27807
  event.value.contextCleared
27791
27808
  );
27792
27809
  break;
27793
- case "chat_compressed" /* ChatCompressed */:
27810
+ case GeminiEventType.ChatCompressed:
27794
27811
  handleChatCompressionEvent(event.value, userMessageTimestamp);
27795
27812
  break;
27796
- case "tool_call_confirmation" /* ToolCallConfirmation */:
27797
- case "tool_call_response" /* ToolCallResponse */:
27813
+ case GeminiEventType.ToolCallConfirmation:
27814
+ case GeminiEventType.ToolCallResponse:
27798
27815
  break;
27799
- case "max_session_turns" /* MaxSessionTurns */:
27816
+ case GeminiEventType.MaxSessionTurns:
27800
27817
  handleMaxSessionTurnsEvent();
27801
27818
  break;
27802
- case "context_window_will_overflow" /* ContextWindowWillOverflow */:
27819
+ case GeminiEventType.ContextWindowWillOverflow:
27803
27820
  handleContextWindowWillOverflowEvent(
27804
27821
  event.value.estimatedRequestTokenCount,
27805
27822
  event.value.remainingTokenCount
27806
27823
  );
27807
27824
  break;
27808
- case "finished" /* Finished */:
27825
+ case GeminiEventType.Finished:
27809
27826
  handleFinishedEvent(event, userMessageTimestamp);
27810
27827
  break;
27811
- case "citation" /* Citation */:
27828
+ case GeminiEventType.Citation:
27812
27829
  handleCitationEvent(event.value, userMessageTimestamp);
27813
27830
  break;
27814
- case "model_info" /* ModelInfo */:
27831
+ case GeminiEventType.ModelInfo:
27815
27832
  handleChatModelEvent(event.value, userMessageTimestamp);
27816
27833
  break;
27817
- case "loop_detected" /* LoopDetected */:
27834
+ case GeminiEventType.LoopDetected:
27818
27835
  loopDetectedRef.current = true;
27819
27836
  break;
27820
- case "retry" /* Retry */:
27821
- case "invalid_stream" /* InvalidStream */:
27837
+ case GeminiEventType.Retry:
27838
+ case GeminiEventType.InvalidStream:
27822
27839
  break;
27823
27840
  default: {
27824
27841
  const unreachable = event;
@@ -27859,7 +27876,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27859
27876
  const submitQuery = (0, import_react102.useCallback)(
27860
27877
  async (query, options, prompt_id) => runInDevTraceSpan(
27861
27878
  {
27862
- operation: options?.isContinuation ? "system_prompt" /* SystemPrompt */ : "user_prompt" /* UserPrompt */,
27879
+ operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
27863
27880
  sessionId: config.getSessionId()
27864
27881
  },
27865
27882
  async ({ metadata: spanMetadata }) => {
@@ -28020,7 +28037,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28020
28037
  );
28021
28038
  const handleApprovalModeChange = (0, import_react102.useCallback)(
28022
28039
  async (newApprovalMode) => {
28023
- if (previousApprovalModeRef.current === "plan" /* PLAN */ && newApprovalMode !== "plan" /* PLAN */ && streamingState === "idle" /* Idle */) {
28040
+ if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
28024
28041
  if (geminiClient) {
28025
28042
  try {
28026
28043
  await geminiClient.addHistory({
@@ -28043,11 +28060,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28043
28060
  }
28044
28061
  }
28045
28062
  previousApprovalModeRef.current = newApprovalMode;
28046
- if (newApprovalMode === "yolo" /* YOLO */ || newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
28063
+ if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
28047
28064
  let awaitingApprovalCalls = toolCalls.filter(
28048
28065
  (call) => call.status === "awaiting_approval" && !call.request.forcedAsk
28049
28066
  );
28050
- if (newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
28067
+ if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
28051
28068
  awaitingApprovalCalls = awaitingApprovalCalls.filter(
28052
28069
  (call) => EDIT_TOOL_NAMES.has(call.request.name)
28053
28070
  );
@@ -28056,11 +28073,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28056
28073
  if (call.correlationId) {
28057
28074
  try {
28058
28075
  await config.getMessageBus().publish({
28059
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
28076
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
28060
28077
  correlationId: call.correlationId,
28061
28078
  confirmed: true,
28062
28079
  requiresUserConfirmation: false,
28063
- outcome: "proceed_once" /* ProceedOnce */
28080
+ outcome: ToolConfirmationOutcome.ProceedOnce
28064
28081
  });
28065
28082
  } catch (error) {
28066
28083
  debugLogger.warn(
@@ -28138,14 +28155,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28138
28155
  );
28139
28156
  if (isLowErrorVerbosity) {
28140
28157
  suppressedToolErrorCountRef.current += geminiTools.filter(
28141
- (tc) => tc.status === "error" /* Error */
28158
+ (tc) => tc.status === CoreToolCallStatus.Error
28142
28159
  ).length;
28143
28160
  }
28144
28161
  if (geminiTools.length === 0) {
28145
28162
  return;
28146
28163
  }
28147
28164
  const stopExecutionTool = geminiTools.find(
28148
- (tc) => tc.response.errorType === "stop_execution" /* STOP_EXECUTION */
28165
+ (tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
28149
28166
  );
28150
28167
  if (stopExecutionTool && stopExecutionTool.response.error) {
28151
28168
  maybeAddSuppressedToolErrorNote();
@@ -28165,9 +28182,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28165
28182
  (tc) => !isTopicTool2(tc.request.name)
28166
28183
  );
28167
28184
  const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
28168
- (tc) => tc.status === "cancelled" /* Cancelled */
28185
+ (tc) => tc.status === CoreToolCallStatus.Cancelled
28169
28186
  );
28170
- const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === "cancelled" /* Cancelled */);
28187
+ const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
28171
28188
  if (allDeclinableToolsCancelled || allToolsCancelled) {
28172
28189
  if (!turnCancelledRef.current) {
28173
28190
  addItem({
@@ -28248,7 +28265,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28248
28265
  return;
28249
28266
  }
28250
28267
  const restorableToolCalls = toolCalls.filter(
28251
- (toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === "awaiting_approval" /* AwaitingApproval */
28268
+ (toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
28252
28269
  );
28253
28270
  if (restorableToolCalls.length > 0) {
28254
28271
  if (!gitService) {
@@ -28467,14 +28484,14 @@ var useAgentStream = ({
28467
28484
  const displayName = legacyState?.displayName ?? event.name;
28468
28485
  const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
28469
28486
  const desc = legacyState?.description ?? "";
28470
- const fallbackKind = "other" /* Other */;
28487
+ const fallbackKind = Kind.Other;
28471
28488
  const newCall = {
28472
28489
  callId: event.requestId,
28473
28490
  name: displayName,
28474
28491
  originalRequestName: event.name,
28475
28492
  description: desc,
28476
28493
  display: event.display,
28477
- status: "scheduled" /* Scheduled */,
28494
+ status: CoreToolCallStatus.Scheduled,
28478
28495
  isClientInitiated: false,
28479
28496
  renderOutputAsMarkdown: isOutputMarkdown,
28480
28497
  kind: legacyState?.kind ?? fallbackKind,
@@ -28492,10 +28509,10 @@ var useAgentStream = ({
28492
28509
  const evtStatus = legacyState?.status;
28493
28510
  let status = tc.status;
28494
28511
  if (evtStatus === "executing")
28495
- status = "executing" /* Executing */;
28496
- else if (evtStatus === "error") status = "error" /* Error */;
28512
+ status = CoreToolCallStatus.Executing;
28513
+ else if (evtStatus === "error") status = CoreToolCallStatus.Error;
28497
28514
  else if (evtStatus === "success")
28498
- status = "success" /* Success */;
28515
+ status = CoreToolCallStatus.Success;
28499
28516
  const display = event.display?.result;
28500
28517
  const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
28501
28518
  const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
@@ -28528,7 +28545,7 @@ var useAgentStream = ({
28528
28545
  const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
28529
28546
  return {
28530
28547
  ...tc,
28531
- status: event.isError ? "error" /* Error */ : "success" /* Success */,
28548
+ status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
28532
28549
  display: event.display ? { ...tc.display, ...event.display } : tc.display,
28533
28550
  resultDisplay,
28534
28551
  outputFile
@@ -28580,7 +28597,7 @@ var useAgentStream = ({
28580
28597
  if (!options?.isContinuation) {
28581
28598
  if (typeof query === "string") {
28582
28599
  addItem({ type: "user" /* USER */, text: query }, timestamp);
28583
- void logger?.logMessage("user" /* USER */, query);
28600
+ void logger?.logMessage(MessageSenderType.USER, query);
28584
28601
  }
28585
28602
  startNewPrompt();
28586
28603
  }
@@ -31100,7 +31117,7 @@ function useMessageQueue({
31100
31117
  var import_react110 = __toESM(require_react(), 1);
31101
31118
  function useMcpStatus(config) {
31102
31119
  const [discoveryState, setDiscoveryState] = (0, import_react110.useState)(
31103
- () => config.getMcpClientManager()?.getDiscoveryState() ?? "not_started" /* NOT_STARTED */
31120
+ () => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
31104
31121
  );
31105
31122
  const [mcpServerCount, setMcpServerCount] = (0, import_react110.useState)(
31106
31123
  () => config.getMcpClientManager()?.getMcpServerCount() ?? 0
@@ -31113,12 +31130,12 @@ function useMcpStatus(config) {
31113
31130
  setMcpServerCount(manager.getMcpServerCount());
31114
31131
  }
31115
31132
  };
31116
- coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
31133
+ coreEvents.on(CoreEvent.McpClientUpdate, onChange);
31117
31134
  return () => {
31118
- coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
31135
+ coreEvents.off(CoreEvent.McpClientUpdate, onChange);
31119
31136
  };
31120
31137
  }, [config]);
31121
- const isMcpReady = discoveryState === "completed" /* COMPLETED */ || discoveryState === "not_started" /* NOT_STARTED */ && mcpServerCount === 0;
31138
+ const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
31122
31139
  return {
31123
31140
  discoveryState,
31124
31141
  mcpServerCount,
@@ -31145,7 +31162,7 @@ function useApprovalModeIndicator({
31145
31162
  (key) => {
31146
31163
  let nextApprovalMode;
31147
31164
  if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
31148
- if (config.isYoloModeDisabled() && config.getApprovalMode() !== "yolo" /* YOLO */) {
31165
+ if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
31149
31166
  if (addItem) {
31150
31167
  let text = "You cannot enter YOLO mode since it is disabled in your settings.";
31151
31168
  const adminSettings = config.getRemoteAdminSettings();
@@ -31163,21 +31180,21 @@ function useApprovalModeIndicator({
31163
31180
  }
31164
31181
  return;
31165
31182
  }
31166
- nextApprovalMode = config.getApprovalMode() === "yolo" /* YOLO */ ? "default" /* DEFAULT */ : "yolo" /* YOLO */;
31183
+ nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
31167
31184
  } else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
31168
31185
  const currentMode = config.getApprovalMode();
31169
31186
  switch (currentMode) {
31170
- case "default" /* DEFAULT */:
31171
- nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
31187
+ case ApprovalMode.DEFAULT:
31188
+ nextApprovalMode = ApprovalMode.AUTO_EDIT;
31172
31189
  break;
31173
- case "autoEdit" /* AUTO_EDIT */:
31174
- nextApprovalMode = allowPlanMode ? "plan" /* PLAN */ : "default" /* DEFAULT */;
31190
+ case ApprovalMode.AUTO_EDIT:
31191
+ nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
31175
31192
  break;
31176
- case "plan" /* PLAN */:
31177
- nextApprovalMode = "default" /* DEFAULT */;
31193
+ case ApprovalMode.PLAN:
31194
+ nextApprovalMode = ApprovalMode.DEFAULT;
31178
31195
  break;
31179
- case "yolo" /* YOLO */:
31180
- nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
31196
+ case ApprovalMode.YOLO:
31197
+ nextApprovalMode = ApprovalMode.AUTO_EDIT;
31181
31198
  break;
31182
31199
  default:
31183
31200
  }
@@ -31570,11 +31587,11 @@ var useHookDisplayState = () => {
31570
31587
  removeHook();
31571
31588
  }
31572
31589
  };
31573
- coreEvents.on("hook-start" /* HookStart */, handleHookStart);
31574
- coreEvents.on("hook-end" /* HookEnd */, handleHookEnd);
31590
+ coreEvents.on(CoreEvent.HookStart, handleHookStart);
31591
+ coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
31575
31592
  return () => {
31576
- coreEvents.off("hook-start" /* HookStart */, handleHookStart);
31577
- coreEvents.off("hook-end" /* HookEnd */, handleHookEnd);
31593
+ coreEvents.off(CoreEvent.HookStart, handleHookStart);
31594
+ coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
31578
31595
  activeTimeouts.forEach(clearTimeout);
31579
31596
  activeTimeouts.clear();
31580
31597
  };
@@ -32463,7 +32480,7 @@ var AppContainer = (props) => {
32463
32480
  setConfigInitialized(true);
32464
32481
  startupProfiler.flush(config);
32465
32482
  startAutoMemoryIfEnabled(config);
32466
- const sessionStartSource = resumedSessionData ? "resume" /* Resume */ : "startup" /* Startup */;
32483
+ const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
32467
32484
  const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
32468
32485
  if (result) {
32469
32486
  if (result.systemMessage) {
@@ -32499,7 +32516,7 @@ var AppContainer = (props) => {
32499
32516
  );
32500
32517
  const ideClient = await IdeClient.getInstance();
32501
32518
  await ideClient.disconnect();
32502
- await config?.getHookSystem()?.fireSessionEndEvent("exit" /* Exit */);
32519
+ await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
32503
32520
  };
32504
32521
  registerCleanup(cleanupFn);
32505
32522
  return () => {
@@ -32524,11 +32541,11 @@ var AppContainer = (props) => {
32524
32541
  resetTime: payload.resetTime
32525
32542
  });
32526
32543
  };
32527
- coreEvents.on("model-changed" /* ModelChanged */, handleModelChanged);
32528
- coreEvents.on("quota-changed" /* QuotaChanged */, handleQuotaChanged);
32544
+ coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
32545
+ coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
32529
32546
  return () => {
32530
- coreEvents.off("model-changed" /* ModelChanged */, handleModelChanged);
32531
- coreEvents.off("quota-changed" /* QuotaChanged */, handleQuotaChanged);
32547
+ coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
32548
+ coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
32532
32549
  };
32533
32550
  }, [config]);
32534
32551
  (0, import_react124.useEffect)(() => {
@@ -32541,16 +32558,16 @@ var AppContainer = (props) => {
32541
32558
  const handleAgentsDiscovered = (payload) => {
32542
32559
  setNewAgents(payload.agents);
32543
32560
  };
32544
- coreEvents.on("settings-changed" /* SettingsChanged */, handleSettingsChanged);
32545
- coreEvents.on("admin-settings-changed" /* AdminSettingsChanged */, handleAdminSettingsChanged);
32546
- coreEvents.on("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
32561
+ coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
32562
+ coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
32563
+ coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
32547
32564
  return () => {
32548
- coreEvents.off("settings-changed" /* SettingsChanged */, handleSettingsChanged);
32565
+ coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
32549
32566
  coreEvents.off(
32550
- "admin-settings-changed" /* AdminSettingsChanged */,
32567
+ CoreEvent.AdminSettingsChanged,
32551
32568
  handleAdminSettingsChanged
32552
32569
  );
32553
- coreEvents.off("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
32570
+ coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
32554
32571
  };
32555
32572
  }, [settings]);
32556
32573
  const { errorCount, clearErrorCount } = useErrorCount();
@@ -32616,11 +32633,11 @@ var AppContainer = (props) => {
32616
32633
  exitEditorDialog
32617
32634
  } = useEditorSettings(settings, setEditorError, historyManager.addItem);
32618
32635
  (0, import_react124.useEffect)(() => {
32619
- coreEvents.on("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
32620
- coreEvents.on("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
32636
+ coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
32637
+ coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
32621
32638
  return () => {
32622
- coreEvents.off("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
32623
- coreEvents.off("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
32639
+ coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
32640
+ coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
32624
32641
  };
32625
32642
  }, [handleEditorClose, openEditorDialog]);
32626
32643
  (0, import_react124.useEffect)(() => {
@@ -32688,7 +32705,7 @@ var AppContainer = (props) => {
32688
32705
  errorVerbosity: settings.merged.ui.errorVerbosity
32689
32706
  });
32690
32707
  const isAuthDialogOpen = authState === "updating" /* Updating */;
32691
- const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== "gemini-api-key" /* USE_GEMINI */;
32708
+ const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
32692
32709
  const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
32693
32710
  const { loadHistoryForResume, isResuming } = useSessionResume({
32694
32711
  config,
@@ -32716,7 +32733,7 @@ var AppContainer = (props) => {
32716
32733
  async (authType, scope) => {
32717
32734
  if (authType) {
32718
32735
  const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
32719
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */) {
32736
+ if (authType === AuthType.LOGIN_WITH_GOOGLE) {
32720
32737
  setAuthContext({ requiresRestart: true });
32721
32738
  } else {
32722
32739
  setAuthContext({});
@@ -32744,7 +32761,7 @@ var AppContainer = (props) => {
32744
32761
  );
32745
32762
  return;
32746
32763
  }
32747
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
32764
+ if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
32748
32765
  writeToStdout(`
32749
32766
  ----------------------------------------------------------------
32750
32767
  Logging in with Google... Restarting Gemini CLI to continue.
@@ -32769,7 +32786,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
32769
32786
  }
32770
32787
  await saveApiKey(apiKey);
32771
32788
  await reloadApiKey();
32772
- await config.refreshAuth("gemini-api-key" /* USE_GEMINI */);
32789
+ await config.refreshAuth(AuthType.USE_GEMINI);
32773
32790
  setAuthState("authenticated" /* Authenticated */);
32774
32791
  } catch (e) {
32775
32792
  onAuthError(
@@ -32794,7 +32811,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
32794
32811
  `Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
32795
32812
  );
32796
32813
  } else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
32797
- if (settings.merged.security.auth.selectedType === "gemini-api-key" /* USE_GEMINI */) {
32814
+ if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
32798
32815
  return;
32799
32816
  }
32800
32817
  const error = validateAuthMethod(
@@ -32915,9 +32932,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
32915
32932
  }
32916
32933
  });
32917
32934
  };
32918
- coreEvents.on("consent-request" /* ConsentRequest */, handleConsentRequest);
32935
+ coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
32919
32936
  return () => {
32920
- coreEvents.off("consent-request" /* ConsentRequest */, handleConsentRequest);
32937
+ coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
32921
32938
  };
32922
32939
  }, []);
32923
32940
  const performMemoryRefresh = (0, import_react124.useCallback)(async () => {
@@ -33590,7 +33607,7 @@ ${queuedText}` : queuedText;
33590
33607
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
33591
33608
  if (settings.merged.general.devtools) {
33592
33609
  void (async () => {
33593
- const { toggleDevToolsPanel } = await import("./devtoolsService-6Y6YER6T.js");
33610
+ const { toggleDevToolsPanel } = await import("./devtoolsService-QZON66HV.js");
33594
33611
  await toggleDevToolsPanel(
33595
33612
  config,
33596
33613
  showErrorDetails,
@@ -33808,12 +33825,12 @@ ${queuedText}` : queuedText;
33808
33825
  Date.now()
33809
33826
  );
33810
33827
  };
33811
- coreEvents.on("user-feedback" /* UserFeedback */, handleUserFeedback);
33812
- coreEvents.on("hook-system-message" /* HookSystemMessage */, handleHookSystemMessage);
33828
+ coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
33829
+ coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
33813
33830
  coreEvents.drainBacklogs();
33814
33831
  return () => {
33815
- coreEvents.off("user-feedback" /* UserFeedback */, handleUserFeedback);
33816
- coreEvents.off("hook-system-message" /* HookSystemMessage */, handleHookSystemMessage);
33832
+ coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
33833
+ coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
33817
33834
  };
33818
33835
  }, [historyManager]);
33819
33836
  const nightly = props.version.includes("nightly");
@@ -33916,9 +33933,9 @@ ${queuedText}` : queuedText;
33916
33933
  const handleMemoryChanged = (result) => {
33917
33934
  setGeminiMdFileCount(result.fileCount);
33918
33935
  };
33919
- coreEvents.on("memory-changed" /* MemoryChanged */, handleMemoryChanged);
33936
+ coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
33920
33937
  return () => {
33921
- coreEvents.off("memory-changed" /* MemoryChanged */, handleMemoryChanged);
33938
+ coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
33922
33939
  };
33923
33940
  }, []);
33924
33941
  (0, import_react124.useEffect)(() => {