@google/gemini-cli 0.40.0-preview.2 → 0.40.0-preview.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/bundle/{chunk-WL5MCPV2.js → chunk-35STMVQ6.js} +2 -2
  2. package/bundle/{chunk-EFCQXWIF.js → chunk-47HVBRLD.js} +3 -3
  3. package/bundle/{chunk-HV36F4CL.js → chunk-5UA5NDVP.js} +134 -354
  4. package/bundle/{chunk-IUVLJUOL.js → chunk-B4NHGUNE.js} +2 -2
  5. package/bundle/{chunk-NO7STVVM.js → chunk-EEQGWBJU.js} +1413 -1089
  6. package/bundle/{chunk-IMEC72NS.js → chunk-EJ5U5A3P.js} +1 -1
  7. package/bundle/{chunk-33ANPP4S.js → chunk-ELANWZTZ.js} +3 -3
  8. package/bundle/{chunk-3GU3LF3I.js → chunk-F2KGMQCY.js} +180 -9
  9. package/bundle/{chunk-VCGILCZV.js → chunk-F73F75XM.js} +16 -0
  10. package/bundle/{chunk-PLUWJHZZ.js → chunk-FRCZJECU.js} +237 -54
  11. package/bundle/{chunk-UBXB5AEJ.js → chunk-GDNYA45E.js} +3 -3
  12. package/bundle/{chunk-TDW6FM3A.js → chunk-KITSDDOZ.js} +1 -1
  13. package/bundle/{chunk-WHIWQCI5.js → chunk-KKO2XSBY.js} +1 -1
  14. package/bundle/{chunk-GXRQOXQF.js → chunk-KUAEOA2Q.js} +177 -7
  15. package/bundle/{chunk-4IJPDKI6.js → chunk-KVGAAOEJ.js} +146 -364
  16. package/bundle/{chunk-QK7UWGBN.js → chunk-MRSOTTBM.js} +1380 -1081
  17. package/bundle/{chunk-MUGUV6RZ.js → chunk-MUEKKRWF.js} +2 -2
  18. package/bundle/chunk-R4ZCSDPK.js +80018 -0
  19. package/bundle/chunk-RMQT572G.js +156 -0
  20. package/bundle/chunk-RVU5Q4NB.js +118 -0
  21. package/bundle/{chunk-2RHFUIH4.js → chunk-UHHRGNIO.js} +16 -0
  22. package/bundle/chunk-UX5CFZ75.js +17505 -0
  23. package/bundle/{chunk-RM43GNQQ.js → chunk-UZ5SUJO4.js} +7709 -12907
  24. package/bundle/chunk-VQVLJLWD.js +1571 -0
  25. package/bundle/{chunk-NIVCRM5L.js → chunk-VUHGADMU.js} +134 -354
  26. package/bundle/chunk-YCTQOSY2.js +351149 -0
  27. package/bundle/{cleanup-A7WXWAMI.js → cleanup-BWZ7GONS.js} +3 -3
  28. package/bundle/{cleanup-EWPIME2M.js → cleanup-F6XR3KDW.js} +3 -3
  29. package/bundle/{cleanup-IPLJJT5S.js → cleanup-PS3UGKWX.js} +3 -3
  30. package/bundle/cleanup-VV6AV4T2.js +33 -0
  31. package/bundle/{core-VCDK23ZC.js → core-NDKZ44LE.js} +28 -2
  32. package/bundle/{devtoolsService-B5VVZ752.js → devtoolsService-DNFLMYOX.js} +3 -3
  33. package/bundle/{devtoolsService-2JXSALRU.js → devtoolsService-F6QBRWPB.js} +5 -4
  34. package/bundle/{devtoolsService-6Y6YER6T.js → devtoolsService-XGIYIDBD.js} +3 -3
  35. package/bundle/devtoolsService-YD6JSR34.js +852 -0
  36. package/bundle/{dist-UIXQETMC.js → dist-54TUMSKA.js} +28 -2
  37. package/bundle/{core-BQT6T3CH.js → dist-6KUUELBS.js} +28 -2
  38. package/bundle/dist-QHCXV4N4.js +2046 -0
  39. package/bundle/docs/cli/cli-reference.md +1 -0
  40. package/bundle/docs/cli/trusted-folders.md +28 -0
  41. package/bundle/docs/reference/configuration.md +14 -0
  42. package/bundle/{gemini-ID44Z5SV.js → gemini-HLGERR6W.js} +65 -21
  43. package/bundle/{gemini-54LH6RUH.js → gemini-IRPF2U4N.js} +241 -182
  44. package/bundle/gemini-QZM4UKD6.js +16087 -0
  45. package/bundle/{gemini-44W2QEZI.js → gemini-TU6PHHWE.js} +63 -20
  46. package/bundle/gemini.js +3 -3
  47. package/bundle/{interactiveCli-5MTJDFYC.js → interactiveCli-374EDFUA.js} +17 -167
  48. package/bundle/{interactiveCli-JFBPGMNM.js → interactiveCli-EKTBCA5F.js} +30 -179
  49. package/bundle/{interactiveCli-5B3X6RNB.js → interactiveCli-GRSDCSR3.js} +300 -432
  50. package/bundle/interactiveCli-HN4DKCW5.js +34448 -0
  51. package/bundle/{liteRtServerManager-76V63PRJ.js → liteRtServerManager-46V57ROR.js} +4 -4
  52. package/bundle/{liteRtServerManager-WQMDPACQ.js → liteRtServerManager-E34UIEBJ.js} +4 -4
  53. package/bundle/{liteRtServerManager-6GJWEP5W.js → liteRtServerManager-EAWDC35K.js} +4 -4
  54. package/bundle/liteRtServerManager-HTDKEOQC.js +65 -0
  55. package/bundle/{memoryDiscovery-RYHYLAPJ.js → memoryDiscovery-CZURD35O.js} +1 -1
  56. package/bundle/{memoryDiscovery-HWEYBJE7.js → memoryDiscovery-GZLXKRGB.js} +1 -1
  57. package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
  58. package/bundle/{oauth2-provider-JCKLNKRV.js → oauth2-provider-N7Q7FNNA.js} +2 -2
  59. package/bundle/{oauth2-provider-EX6SQEZP.js → oauth2-provider-TW3RXTUS.js} +2 -2
  60. package/bundle/{oauth2-provider-ZF52AWQY.js → oauth2-provider-UQIDMKYA.js} +39 -73
  61. package/bundle/oauth2-provider-WTRWHBI2.js +237 -0
  62. package/bundle/{start-CYDJTOAP.js → start-4D5PYHGK.js} +6 -6
  63. package/bundle/{start-SHOUHW3Y.js → start-7DJXXKMH.js} +6 -6
  64. package/bundle/{start-B6EMQCH5.js → start-ERRBQVDH.js} +6 -6
  65. package/bundle/start-TKRKH572.js +18 -0
  66. package/package.json +1 -1
@@ -70,8 +70,15 @@ import {
70
70
  formatDuration,
71
71
  formatResetTime,
72
72
  getBoundingBox,
73
+ getDialogRestartRequiredSettings,
74
+ getDialogSettingKeys,
75
+ getDisplayValue,
76
+ getEditValue,
77
+ getEffectiveValue,
73
78
  getFileExtension,
74
79
  getFormattedSettingValue,
80
+ getNestedValue,
81
+ getSettingDefinition,
75
82
  getStatusColor,
76
83
  getTransformUnderCursor,
77
84
  getUsedStatusColor,
@@ -83,8 +90,10 @@ import {
83
90
  isBrowser,
84
91
  isContextUsageHigh,
85
92
  isDevelopment,
93
+ isInSettingsScope,
86
94
  isNarrowWidth,
87
95
  isNewFile,
96
+ isRecord,
88
97
  isSlashCommand,
89
98
  isUltraTier,
90
99
  loadKeyMatchers,
@@ -93,6 +102,7 @@ import {
93
102
  openFileInEditor,
94
103
  parseColor,
95
104
  parseDiffWithLineNumbers,
105
+ parseEditedValue,
96
106
  parseSlashCommand,
97
107
  persistentState,
98
108
  profiler,
@@ -144,13 +154,13 @@ import {
144
154
  widestLineFromStyledChars,
145
155
  wordBreakStyledChars,
146
156
  wrapStyledChars
147
- } from "./chunk-GXRQOXQF.js";
157
+ } from "./chunk-F2KGMQCY.js";
148
158
  import {
149
159
  appEvents
150
160
  } from "./chunk-5PS3AYFU.js";
151
161
  import {
152
162
  require_source
153
- } from "./chunk-WHIWQCI5.js";
163
+ } from "./chunk-KITSDDOZ.js";
154
164
  import {
155
165
  ACTIVE_SHELL_MAX_LINES,
156
166
  COMPACT_TOOL_SUBVIEW_MAX_LINES,
@@ -188,7 +198,6 @@ import {
188
198
  getCachedStringWidth,
189
199
  getLuminance,
190
200
  getSessionFiles,
191
- getSettingsSchema,
192
201
  interpolateColor,
193
202
  isLoadableSettingScope,
194
203
  isTodoList,
@@ -204,18 +213,20 @@ import {
204
213
  stringWidth,
205
214
  stripUnsafeCharacters,
206
215
  toCodePoints
207
- } from "./chunk-4IJPDKI6.js";
216
+ } from "./chunk-UX5CFZ75.js";
208
217
  import {
209
218
  registerCleanup,
210
219
  removeCleanup,
211
220
  runExitCleanup,
212
221
  setupTtyCheck
213
- } from "./chunk-MUGUV6RZ.js";
222
+ } from "./chunk-35STMVQ6.js";
214
223
  import {
215
224
  ApiKeyUpdatedEvent,
216
225
  AsyncFzf,
217
226
  AuthType,
227
+ CompressionStatus,
218
228
  ConversationFinishedEvent,
229
+ CoreToolCallStatus,
219
230
  CreditPurchaseClickEvent,
220
231
  EDITOR_DISPLAY_NAMES,
221
232
  EmptyWalletMenuShownEvent,
@@ -225,11 +236,16 @@ import {
225
236
  FileSearchFactory,
226
237
  FolderTrustDiscoveryService,
227
238
  G1_UTM_CAMPAIGNS,
239
+ GeminiCliOperation,
240
+ GeminiEventType,
228
241
  GitService,
229
242
  IdeClient,
230
243
  LegacyAgentProtocol,
231
244
  LlmRole,
232
245
  Logger,
246
+ MCPDiscoveryState,
247
+ MCPServerStatus,
248
+ MessageSenderType,
233
249
  ModelNotFoundError,
234
250
  ModelSlashCommandEvent,
235
251
  OverageMenuShownEvent,
@@ -238,13 +254,17 @@ import {
238
254
  ProjectIdRequiredError,
239
255
  ROOT_SCHEDULER_ID,
240
256
  Scheduler,
257
+ SessionEndReason,
258
+ SessionStartSource,
241
259
  ShellExecutionService,
242
260
  SlashCommandStatus,
243
261
  TerminalQuotaError,
262
+ TrustLevel,
244
263
  UserAccountManager,
245
264
  UserPromptEvent,
246
265
  UserTierId,
247
266
  ValidationRequiredError,
267
+ WarningPriority,
248
268
  addMCPStatusChangeListener,
249
269
  allowEditorTypeInSandbox,
250
270
  belongsInConfirmationQueue,
@@ -327,11 +347,13 @@ import {
327
347
  validatePlanContent,
328
348
  validatePlanPath,
329
349
  writeToStdout
330
- } from "./chunk-RM43GNQQ.js";
350
+ } from "./chunk-UZ5SUJO4.js";
331
351
  import {
332
352
  ACTIVATE_SKILL_TOOL_NAME,
333
353
  AGENT_TOOL_NAME,
354
+ ApprovalMode,
334
355
  ChangeAuthRequestedError,
356
+ CoreEvent,
335
357
  DEFAULT_GEMINI_FLASH_LITE_MODEL,
336
358
  DEFAULT_GEMINI_FLASH_MODEL,
337
359
  DEFAULT_GEMINI_MODEL,
@@ -342,13 +364,16 @@ import {
342
364
  GEMINI_DIR,
343
365
  GLOB_DISPLAY_NAME,
344
366
  GREP_DISPLAY_NAME,
367
+ Kind,
345
368
  LS_DISPLAY_NAME,
369
+ MessageBusType,
346
370
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
347
371
  PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
348
372
  PREVIEW_GEMINI_3_1_MODEL,
349
373
  PREVIEW_GEMINI_FLASH_MODEL,
350
374
  PREVIEW_GEMINI_MODEL,
351
375
  PREVIEW_GEMINI_MODEL_AUTO,
376
+ QuestionType,
352
377
  READ_FILE_DISPLAY_NAME,
353
378
  READ_MANY_FILES_DISPLAY_NAME,
354
379
  SHELL_TOOL_NAME,
@@ -356,6 +381,8 @@ import {
356
381
  TOPIC_PARAM_STRATEGIC_INTENT,
357
382
  TOPIC_PARAM_SUMMARY,
358
383
  TOPIC_PARAM_TITLE,
384
+ ToolConfirmationOutcome,
385
+ ToolErrorType,
359
386
  UPDATE_TOPIC_DISPLAY_NAME,
360
387
  UPDATE_TOPIC_TOOL_NAME,
361
388
  UnauthorizedError,
@@ -385,7 +412,7 @@ import {
385
412
  safeJsonToMarkdown,
386
413
  shortenPath,
387
414
  tildeifyPath
388
- } from "./chunk-2RHFUIH4.js";
415
+ } from "./chunk-F73F75XM.js";
389
416
  import "./chunk-664ZODQF.js";
390
417
  import "./chunk-RJTRUG2J.js";
391
418
  import "./chunk-IUUIT4SU.js";
@@ -5715,7 +5742,7 @@ function calculateShellMaxLines(options) {
5715
5742
  if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
5716
5743
  return maxLinesBasedOnHeight;
5717
5744
  }
5718
- const isExecuting = status === "executing" /* Executing */;
5745
+ const isExecuting = status === CoreToolCallStatus.Executing;
5719
5746
  const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
5720
5747
  return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
5721
5748
  }
@@ -5748,10 +5775,10 @@ function isShellTool(name) {
5748
5775
  return name === SHELL_COMMAND_NAME || name === SHELL_NAME || name === SHELL_TOOL_NAME;
5749
5776
  }
5750
5777
  function isThisShellFocusable(name, status, config) {
5751
- return !!(isShellTool(name) && status === "executing" /* Executing */ && config?.getEnableInteractiveShell());
5778
+ return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && config?.getEnableInteractiveShell());
5752
5779
  }
5753
5780
  function isThisShellFocused(name, status, ptyId, activeShellPtyId, embeddedShellFocused) {
5754
- return !!(isShellTool(name) && status === "executing" /* Executing */ && ptyId === activeShellPtyId && embeddedShellFocused);
5781
+ return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && ptyId === activeShellPtyId && embeddedShellFocused);
5755
5782
  }
5756
5783
  function useFocusHint(isThisShellFocusable2, isThisShellFocused2, resultDisplay) {
5757
5784
  const [userHasFocused, setUserHasFocused] = (0, import_react16.useState)(false);
@@ -6349,7 +6376,7 @@ var ToolMessage = ({
6349
6376
  paddingX: 1,
6350
6377
  flexDirection: "column",
6351
6378
  children: [
6352
- status === "executing" /* Executing */ && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
6379
+ status === CoreToolCallStatus.Executing && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
6353
6380
  McpProgressIndicator,
6354
6381
  {
6355
6382
  progress,
@@ -6366,8 +6393,8 @@ var ToolMessage = ({
6366
6393
  terminalWidth,
6367
6394
  renderOutputAsMarkdown,
6368
6395
  hasFocus: isThisShellFocused2,
6369
- maxLines: kind === "agent" /* Agent */ && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
6370
- overflowDirection: kind === "agent" /* Agent */ ? "bottom" : "top"
6396
+ maxLines: kind === Kind.Agent && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
6397
+ overflowDirection: kind === Kind.Agent ? "bottom" : "top"
6371
6398
  }
6372
6399
  ),
6373
6400
  isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
@@ -6700,7 +6727,7 @@ function getInitialTrustState(settings, cwd5, isCurrentWorkspace) {
6700
6727
  settings.merged,
6701
6728
  process3.cwd()
6702
6729
  );
6703
- const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === "DO_NOT_TRUST" /* DO_NOT_TRUST */);
6730
+ const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === TrustLevel.DO_NOT_TRUST);
6704
6731
  return {
6705
6732
  currentTrustLevel: explicitTrustLevel,
6706
6733
  isInheritedTrustFromParent: !!(source === "file" && isInheritedTrust),
@@ -6745,7 +6772,7 @@ var usePermissionsModifyTrust = (onExit, addItem, targetDirectory) => {
6745
6772
  process3.cwd(),
6746
6773
  newConfig
6747
6774
  );
6748
- if (trustLevel === "DO_NOT_TRUST" /* DO_NOT_TRUST */ && isTrusted) {
6775
+ if (trustLevel === TrustLevel.DO_NOT_TRUST && isTrusted) {
6749
6776
  let message = "Note: This folder is still trusted because the connected IDE workspace is trusted.";
6750
6777
  if (source === "file") {
6751
6778
  message = "Note: This folder is still trusted because a parent folder is trusted.";
@@ -6819,18 +6846,18 @@ function PermissionsModifyTrustDialog({
6819
6846
  const TRUST_LEVEL_ITEMS = [
6820
6847
  {
6821
6848
  label: `Trust this folder (${dirName})`,
6822
- value: "TRUST_FOLDER" /* TRUST_FOLDER */,
6823
- key: "TRUST_FOLDER" /* TRUST_FOLDER */
6849
+ value: TrustLevel.TRUST_FOLDER,
6850
+ key: TrustLevel.TRUST_FOLDER
6824
6851
  },
6825
6852
  {
6826
6853
  label: `Trust parent folder (${parentFolder})`,
6827
- value: "TRUST_PARENT" /* TRUST_PARENT */,
6828
- key: "TRUST_PARENT" /* TRUST_PARENT */
6854
+ value: TrustLevel.TRUST_PARENT,
6855
+ key: TrustLevel.TRUST_PARENT
6829
6856
  },
6830
6857
  {
6831
6858
  label: "Don't trust",
6832
- value: "DO_NOT_TRUST" /* DO_NOT_TRUST */,
6833
- key: "DO_NOT_TRUST" /* DO_NOT_TRUST */
6859
+ value: TrustLevel.DO_NOT_TRUST,
6860
+ key: TrustLevel.DO_NOT_TRUST
6834
6861
  }
6835
6862
  ];
6836
6863
  const {
@@ -7067,7 +7094,7 @@ var ShellToolMessage = ({
7067
7094
  maxLinesLimit: maxLines
7068
7095
  });
7069
7096
  import_react23.default.useEffect(() => {
7070
- const isExecuting = status === "executing" /* Executing */;
7097
+ const isExecuting = status === CoreToolCallStatus.Executing;
7071
7098
  if (isExecuting && ptyId) {
7072
7099
  try {
7073
7100
  const childWidth = terminalWidth - 4;
@@ -7253,14 +7280,14 @@ var ToolActionsProvider = (props) => {
7253
7280
  }
7254
7281
  const details = tool.confirmationDetails;
7255
7282
  if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
7256
- const cliOutcome = outcome === "cancel" /* Cancel */ ? "rejected" : "accepted";
7283
+ const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? "rejected" : "accepted";
7257
7284
  await ideClient?.resolveDiffFromCli(details.filePath, cliOutcome);
7258
7285
  }
7259
7286
  if (tool.correlationId) {
7260
7287
  await config.getMessageBus().publish({
7261
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
7288
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
7262
7289
  correlationId: tool.correlationId,
7263
- confirmed: outcome !== "cancel" /* Cancel */,
7290
+ confirmed: outcome !== ToolConfirmationOutcome.Cancel,
7264
7291
  requiresUserConfirmation: false,
7265
7292
  outcome,
7266
7293
  payload
@@ -7279,7 +7306,7 @@ var ToolActionsProvider = (props) => {
7279
7306
  );
7280
7307
  const cancel = (0, import_react24.useCallback)(
7281
7308
  async (callId) => {
7282
- await confirm(callId, "cancel" /* Cancel */);
7309
+ await confirm(callId, ToolConfirmationOutcome.Cancel);
7283
7310
  },
7284
7311
  [confirm]
7285
7312
  );
@@ -7566,22 +7593,22 @@ var hasPayload = (res) => {
7566
7593
  function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerminalHeight, isClickable) {
7567
7594
  const added = (diff.diffStat?.model_added_lines ?? 0) + (diff.diffStat?.user_added_lines ?? 0);
7568
7595
  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 */;
7596
+ const isAcceptedOrConfirming = status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing || status === CoreToolCallStatus.AwaitingApproval;
7570
7597
  const addColor = isAcceptedOrConfirming ? theme.status.success : theme.text.secondary;
7571
7598
  const removeColor = isAcceptedOrConfirming ? theme.status.error : theme.text.secondary;
7572
7599
  const showDiffStat = !!diff.diffStat;
7573
7600
  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
7601
  let resultSummary = "";
7575
7602
  let resultColor = theme.text.secondary;
7576
- if (status === "awaiting_approval" /* AwaitingApproval */) {
7603
+ if (status === CoreToolCallStatus.AwaitingApproval) {
7577
7604
  resultSummary = "Confirming";
7578
- } else if (status === "success" /* Success */ || status === "executing" /* Executing */) {
7605
+ } else if (status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing) {
7579
7606
  resultSummary = "Accepted";
7580
7607
  resultColor = theme.text.accent;
7581
- } else if (status === "cancelled" /* Cancelled */) {
7608
+ } else if (status === CoreToolCallStatus.Cancelled) {
7582
7609
  resultSummary = "Rejected";
7583
7610
  resultColor = theme.status.error;
7584
- } else if (status === "error" /* Error */) {
7611
+ } else if (status === CoreToolCallStatus.Error) {
7585
7612
  resultSummary = typeof resultDisplay === "string" ? resultDisplay : "Failed";
7586
7613
  resultColor = theme.status.error;
7587
7614
  }
@@ -7612,7 +7639,7 @@ function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerm
7612
7639
  filename: diff.fileName,
7613
7640
  terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
7614
7641
  availableTerminalHeight,
7615
- disableColor: status === "cancelled" /* Cancelled */
7642
+ disableColor: status === CoreToolCallStatus.Cancelled
7616
7643
  }
7617
7644
  );
7618
7645
  return { description, summary, payload };
@@ -7740,10 +7767,10 @@ var DenseToolMessage = (props) => {
7740
7767
  if (isGrepResult(resultDisplay)) {
7741
7768
  return getGenericSuccessData(resultDisplay, originalDescription);
7742
7769
  }
7743
- if (status === "success" /* Success */ && resultDisplay) {
7770
+ if (status === CoreToolCallStatus.Success && resultDisplay) {
7744
7771
  return getGenericSuccessData(resultDisplay, originalDescription);
7745
7772
  }
7746
- if (status === "error" /* Error */) {
7773
+ if (status === CoreToolCallStatus.Error) {
7747
7774
  const text = typeof resultDisplay === "string" ? resultDisplay.replace(/\n/g, " ") : "Failed";
7748
7775
  const errorSummary = /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { color: theme.status.error, wrap: "truncate-end", children: [
7749
7776
  "\u2192 ",
@@ -7784,7 +7811,7 @@ var DenseToolMessage = (props) => {
7784
7811
  language: fileExtension,
7785
7812
  maxWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
7786
7813
  settings,
7787
- disableColor: status === "cancelled" /* Cancelled */,
7814
+ disableColor: status === CoreToolCallStatus.Cancelled,
7788
7815
  returnLines: true
7789
7816
  });
7790
7817
  } else {
@@ -7792,7 +7819,7 @@ var DenseToolMessage = (props) => {
7792
7819
  parsedLines,
7793
7820
  filename: diff.fileName,
7794
7821
  terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
7795
- disableColor: status === "cancelled" /* Cancelled */
7822
+ disableColor: status === CoreToolCallStatus.Cancelled
7796
7823
  });
7797
7824
  }
7798
7825
  }, [diff, isExpanded, isAlternateBuffer, terminalWidth, settings, status]);
@@ -7922,7 +7949,7 @@ function isToolExecuting(pendingHistoryItems) {
7922
7949
  return pendingHistoryItems.some((item) => {
7923
7950
  if (item && item.type === "tool_group") {
7924
7951
  return item.tools.some(
7925
- (tool) => "executing" /* Executing */ === tool.status
7952
+ (tool) => CoreToolCallStatus.Executing === tool.status
7926
7953
  );
7927
7954
  }
7928
7955
  return false;
@@ -7931,7 +7958,7 @@ function isToolExecuting(pendingHistoryItems) {
7931
7958
  function isToolAwaitingConfirmation(pendingHistoryItems) {
7932
7959
  return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
7933
7960
  (item) => item.tools.some(
7934
- (tool) => "awaiting_approval" /* AwaitingApproval */ === tool.status
7961
+ (tool) => CoreToolCallStatus.AwaitingApproval === tool.status
7935
7962
  )
7936
7963
  );
7937
7964
  }
@@ -7954,14 +7981,14 @@ function getToolGroupBorderAppearance(item, activeShellPtyId, embeddedShellFocus
7954
7981
  if (isTrackedToolCall(t)) {
7955
7982
  return t.status !== "success" && t.status !== "error" && t.status !== "cancelled";
7956
7983
  } else {
7957
- return t.status !== "success" /* Success */ && t.status !== "error" /* Error */ && t.status !== "cancelled" /* Cancelled */;
7984
+ return t.status !== CoreToolCallStatus.Success && t.status !== CoreToolCallStatus.Error && t.status !== CoreToolCallStatus.Cancelled;
7958
7985
  }
7959
7986
  });
7960
7987
  const isEmbeddedShellFocused = toolsToInspect.some((t) => {
7961
7988
  if (isTrackedToolCall(t)) {
7962
7989
  return isShellTool(t.request.name) && t.status === "executing" && t.pid === activeShellPtyId && !!embeddedShellFocused;
7963
7990
  } else {
7964
- return isShellTool(t.name) && t.status === "executing" /* Executing */ && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
7991
+ return isShellTool(t.name) && t.status === CoreToolCallStatus.Executing && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
7965
7992
  }
7966
7993
  });
7967
7994
  const isShellCommand = toolsToInspect.some((t) => {
@@ -8060,7 +8087,7 @@ var ToolGroupMessage = ({
8060
8087
  const groupedTools = (0, import_react28.useMemo)(() => {
8061
8088
  const groups = [];
8062
8089
  for (const tool of visibleToolCalls) {
8063
- if (tool.kind === "agent" /* Agent */) {
8090
+ if (tool.kind === Kind.Agent) {
8064
8091
  const lastGroup = groups[groups.length - 1];
8065
8092
  if (Array.isArray(lastGroup)) {
8066
8093
  lastGroup.push(tool);
@@ -8114,7 +8141,7 @@ var ToolGroupMessage = ({
8114
8141
  }, [groupedTools, isCompactModeEnabled, borderTopOverride]);
8115
8142
  let countToolCallsWithResults = 0;
8116
8143
  for (const tool of visibleToolCalls) {
8117
- if (tool.kind !== "agent" /* Agent */) {
8144
+ if (tool.kind !== Kind.Agent) {
8118
8145
  if (isCompactTool(tool, isCompactModeEnabled)) {
8119
8146
  if (hasDensePayload(tool)) {
8120
8147
  countToolCallsWithResults++;
@@ -8310,18 +8337,18 @@ function CompressionMessage({
8310
8337
  return "Compressing chat history";
8311
8338
  }
8312
8339
  switch (compressionStatus) {
8313
- case 1 /* COMPRESSED */:
8340
+ case CompressionStatus.COMPRESSED:
8314
8341
  return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
8315
- case 2 /* COMPRESSION_FAILED_INFLATED_TOKEN_COUNT */:
8342
+ case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
8316
8343
  if (originalTokens < 5e4) {
8317
8344
  return "Compression was not beneficial for this history size.";
8318
8345
  }
8319
8346
  return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
8320
- case 3 /* COMPRESSION_FAILED_TOKEN_COUNT_ERROR */:
8347
+ case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
8321
8348
  return "Could not compress chat history due to a token counting error.";
8322
- case 4 /* COMPRESSION_FAILED_EMPTY_SUMMARY */:
8349
+ case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
8323
8350
  return "Chat history compression failed: the model returned an empty summary.";
8324
- case 5 /* NOOP */:
8351
+ case CompressionStatus.NOOP:
8325
8352
  return "Nothing to compress.";
8326
8353
  default:
8327
8354
  return "";
@@ -8735,8 +8762,8 @@ var ModelUsageTable = ({ models }) => {
8735
8762
  );
8736
8763
  roleEntries.sort(([a], [b]) => {
8737
8764
  if (a === b) return 0;
8738
- if (a === "main" /* MAIN */) return -1;
8739
- if (b === "main" /* MAIN */) return 1;
8765
+ if (a === LlmRole.MAIN) return -1;
8766
+ if (b === LlmRole.MAIN) return 1;
8740
8767
  return a.localeCompare(b);
8741
8768
  });
8742
8769
  roleEntries.forEach(([role, roleMetrics]) => {
@@ -9067,8 +9094,8 @@ var ModelStatsDisplay = ({
9067
9094
  return validRoles.includes(role);
9068
9095
  }).sort((a, b) => {
9069
9096
  if (a === b) return 0;
9070
- if (a === "main" /* MAIN */) return -1;
9071
- if (b === "main" /* MAIN */) return 1;
9097
+ if (a === LlmRole.MAIN) return -1;
9098
+ if (b === LlmRole.MAIN) return 1;
9072
9099
  return a.localeCompare(b);
9073
9100
  });
9074
9101
  const createRow = (metric, getValue, options = {}) => {
@@ -9858,7 +9885,7 @@ var McpStatus = ({
9858
9885
  );
9859
9886
  const originalStatus = serverStatus(serverName);
9860
9887
  const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
9861
- const status = originalStatus === "disconnected" /* DISCONNECTED */ && hasCachedItems ? "connected" /* CONNECTED */ : originalStatus;
9888
+ const status = originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems ? MCPServerStatus.CONNECTED : originalStatus;
9862
9889
  let statusIndicator = "";
9863
9890
  let statusText = "";
9864
9891
  let statusColor = theme.text.primary;
@@ -9870,17 +9897,17 @@ var McpStatus = ({
9870
9897
  statusColor = theme.text.secondary;
9871
9898
  } else {
9872
9899
  switch (status) {
9873
- case "connected" /* CONNECTED */:
9900
+ case MCPServerStatus.CONNECTED:
9874
9901
  statusIndicator = "\u{1F7E2}";
9875
9902
  statusText = "Ready";
9876
9903
  statusColor = theme.status.success;
9877
9904
  break;
9878
- case "connecting" /* CONNECTING */:
9905
+ case MCPServerStatus.CONNECTING:
9879
9906
  statusIndicator = "\u{1F504}";
9880
9907
  statusText = "Starting... (first startup may take longer)";
9881
9908
  statusColor = theme.status.warning;
9882
9909
  break;
9883
- case "disconnected" /* DISCONNECTED */:
9910
+ case MCPServerStatus.DISCONNECTED:
9884
9911
  default:
9885
9912
  statusIndicator = "\u{1F534}";
9886
9913
  statusText = "Disconnected";
@@ -9928,12 +9955,12 @@ var McpStatus = ({
9928
9955
  /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Text, { children: [
9929
9956
  " - ",
9930
9957
  statusText,
9931
- status === "connected" /* CONNECTED */ && parts.length > 0 && ` (${parts.join(", ")})`
9958
+ status === MCPServerStatus.CONNECTED && parts.length > 0 && ` (${parts.join(", ")})`
9932
9959
  ] }),
9933
9960
  authStatusNode
9934
9961
  ] }),
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: [
9962
+ status === MCPServerStatus.CONNECTING && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
9963
+ status === MCPServerStatus.DISCONNECTED && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Text, { children: [
9937
9964
  " (",
9938
9965
  toolCount,
9939
9966
  " tools cached)"
@@ -10485,7 +10512,7 @@ var Notifications = () => {
10485
10512
  if (dismissed) return [];
10486
10513
  const counts = persistentState.get("startupWarningCounts") || {};
10487
10514
  return startupWarnings.filter((w) => {
10488
- if (w.priority === "low" /* Low */) {
10515
+ if (w.priority === WarningPriority.Low) {
10489
10516
  const count = counts[w.id] || 0;
10490
10517
  return count < MAX_STARTUP_WARNING_SHOW_COUNT;
10491
10518
  }
@@ -10498,7 +10525,7 @@ var Notifications = () => {
10498
10525
  const counts = { ...persistentState.get("startupWarningCounts") || {} };
10499
10526
  let changed = false;
10500
10527
  visibleWarnings.forEach((w) => {
10501
- if (w.priority === "low" /* Low */) {
10528
+ if (w.priority === WarningPriority.Low) {
10502
10529
  counts[w.id] = (counts[w.id] || 0) + 1;
10503
10530
  changed = true;
10504
10531
  }
@@ -10605,7 +10632,7 @@ var UserIdentity = ({ config }) => {
10605
10632
  }
10606
10633
  return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Box_default, { flexDirection: "column", children: [
10607
10634
  /* @__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: [
10635
+ /* @__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
10636
  /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Text, { bold: true, children: [
10610
10637
  "Signed in with Google",
10611
10638
  email ? ":" : ""
@@ -10839,7 +10866,7 @@ var import_react39 = __toESM(require_react(), 1);
10839
10866
  function getConfirmingToolState(pendingHistoryItems) {
10840
10867
  const allPendingTools = getAllToolCalls(pendingHistoryItems);
10841
10868
  const confirmingTools = allPendingTools.filter(
10842
- (tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
10869
+ (tool) => tool.status === CoreToolCallStatus.AwaitingApproval
10843
10870
  );
10844
10871
  if (confirmingTools.length === 0) {
10845
10872
  return null;
@@ -12149,7 +12176,7 @@ var ExitPlanModeDialog = ({
12149
12176
  {
12150
12177
  questions: [
12151
12178
  {
12152
- type: "choice" /* CHOICE */,
12179
+ type: QuestionType.CHOICE,
12153
12180
  header: "Approval",
12154
12181
  question: planContent,
12155
12182
  options: [
@@ -12170,9 +12197,9 @@ var ExitPlanModeDialog = ({
12170
12197
  onSubmit: (answers) => {
12171
12198
  const answer = answers["0"];
12172
12199
  if (answer === "Yes, automatically accept edits" /* Auto */) {
12173
- onApprove("autoEdit" /* AUTO_EDIT */);
12200
+ onApprove(ApprovalMode.AUTO_EDIT);
12174
12201
  } else if (answer === "Yes, manually accept edits" /* Manual */) {
12175
- onApprove("default" /* DEFAULT */);
12202
+ onApprove(ApprovalMode.DEFAULT);
12176
12203
  } else if (answer) {
12177
12204
  onFeedback(answer);
12178
12205
  }
@@ -12383,7 +12410,7 @@ ${deceptiveUrlWarnings.map(
12383
12410
  );
12384
12411
  (0, import_react44.useEffect)(() => {
12385
12412
  if (isCancelling) {
12386
- handleConfirm("cancel" /* Cancel */);
12413
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12387
12414
  }
12388
12415
  }, [isCancelling, handleConfirm]);
12389
12416
  const handleSelect = (0, import_react44.useCallback)(
@@ -12396,19 +12423,19 @@ ${deceptiveUrlWarnings.map(
12396
12423
  if (!confirmationDetails.isModifying) {
12397
12424
  options2.push({
12398
12425
  label: "Allow once",
12399
- value: "proceed_once" /* ProceedOnce */,
12426
+ value: ToolConfirmationOutcome.ProceedOnce,
12400
12427
  key: "Allow once"
12401
12428
  });
12402
12429
  if (isTrustedFolder) {
12403
12430
  options2.push({
12404
12431
  label: "Allow for this session",
12405
- value: "proceed_always" /* ProceedAlways */,
12432
+ value: ToolConfirmationOutcome.ProceedAlways,
12406
12433
  key: "Allow for this session"
12407
12434
  });
12408
12435
  if (allowPermanentApproval) {
12409
12436
  options2.push({
12410
12437
  label: "Allow for this file in all future sessions",
12411
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12438
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12412
12439
  key: "Allow for this file in all future sessions"
12413
12440
  });
12414
12441
  }
@@ -12416,119 +12443,119 @@ ${deceptiveUrlWarnings.map(
12416
12443
  if (!config.getIdeMode() || !isDiffingEnabled) {
12417
12444
  options2.push({
12418
12445
  label: "Modify with external editor",
12419
- value: "modify_with_editor" /* ModifyWithEditor */,
12446
+ value: ToolConfirmationOutcome.ModifyWithEditor,
12420
12447
  key: "Modify with external editor"
12421
12448
  });
12422
12449
  }
12423
12450
  options2.push({
12424
12451
  label: "No, suggest changes (esc)",
12425
- value: "cancel" /* Cancel */,
12452
+ value: ToolConfirmationOutcome.Cancel,
12426
12453
  key: "No, suggest changes (esc)"
12427
12454
  });
12428
12455
  }
12429
12456
  } else if (confirmationDetails.type === "sandbox_expansion") {
12430
12457
  options2.push({
12431
12458
  label: "Allow once",
12432
- value: "proceed_once" /* ProceedOnce */,
12459
+ value: ToolConfirmationOutcome.ProceedOnce,
12433
12460
  key: "Allow once"
12434
12461
  });
12435
12462
  if (isTrustedFolder) {
12436
12463
  options2.push({
12437
12464
  label: "Allow for this session",
12438
- value: "proceed_always" /* ProceedAlways */,
12465
+ value: ToolConfirmationOutcome.ProceedAlways,
12439
12466
  key: "Allow for this session"
12440
12467
  });
12441
12468
  if (allowPermanentApproval) {
12442
12469
  options2.push({
12443
12470
  label: "Allow for all future sessions",
12444
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12471
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12445
12472
  key: "Allow for all future sessions"
12446
12473
  });
12447
12474
  }
12448
12475
  }
12449
12476
  options2.push({
12450
12477
  label: "No, suggest changes (esc)",
12451
- value: "cancel" /* Cancel */,
12478
+ value: ToolConfirmationOutcome.Cancel,
12452
12479
  key: "No, suggest changes (esc)"
12453
12480
  });
12454
12481
  } else if (confirmationDetails.type === "exec") {
12455
12482
  options2.push({
12456
12483
  label: "Allow once",
12457
- value: "proceed_once" /* ProceedOnce */,
12484
+ value: ToolConfirmationOutcome.ProceedOnce,
12458
12485
  key: "Allow once"
12459
12486
  });
12460
12487
  if (isTrustedFolder) {
12461
12488
  options2.push({
12462
12489
  label: `Allow for this session`,
12463
- value: "proceed_always" /* ProceedAlways */,
12490
+ value: ToolConfirmationOutcome.ProceedAlways,
12464
12491
  key: `Allow for this session`
12465
12492
  });
12466
12493
  if (allowPermanentApproval) {
12467
12494
  options2.push({
12468
12495
  label: `Allow this command for all future sessions`,
12469
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12496
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12470
12497
  key: `Allow for all future sessions`
12471
12498
  });
12472
12499
  }
12473
12500
  }
12474
12501
  options2.push({
12475
12502
  label: "No, suggest changes (esc)",
12476
- value: "cancel" /* Cancel */,
12503
+ value: ToolConfirmationOutcome.Cancel,
12477
12504
  key: "No, suggest changes (esc)"
12478
12505
  });
12479
12506
  } else if (confirmationDetails.type === "info") {
12480
12507
  options2.push({
12481
12508
  label: "Allow once",
12482
- value: "proceed_once" /* ProceedOnce */,
12509
+ value: ToolConfirmationOutcome.ProceedOnce,
12483
12510
  key: "Allow once"
12484
12511
  });
12485
12512
  if (isTrustedFolder) {
12486
12513
  options2.push({
12487
12514
  label: "Allow for this session",
12488
- value: "proceed_always" /* ProceedAlways */,
12515
+ value: ToolConfirmationOutcome.ProceedAlways,
12489
12516
  key: "Allow for this session"
12490
12517
  });
12491
12518
  if (allowPermanentApproval) {
12492
12519
  options2.push({
12493
12520
  label: "Allow for all future sessions",
12494
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12521
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12495
12522
  key: "Allow for all future sessions"
12496
12523
  });
12497
12524
  }
12498
12525
  }
12499
12526
  options2.push({
12500
12527
  label: "No, suggest changes (esc)",
12501
- value: "cancel" /* Cancel */,
12528
+ value: ToolConfirmationOutcome.Cancel,
12502
12529
  key: "No, suggest changes (esc)"
12503
12530
  });
12504
12531
  } else if (confirmationDetails.type === "mcp") {
12505
12532
  options2.push({
12506
12533
  label: "Allow once",
12507
- value: "proceed_once" /* ProceedOnce */,
12534
+ value: ToolConfirmationOutcome.ProceedOnce,
12508
12535
  key: "Allow once"
12509
12536
  });
12510
12537
  if (isTrustedFolder) {
12511
12538
  options2.push({
12512
12539
  label: "Allow tool for this session",
12513
- value: "proceed_always_tool" /* ProceedAlwaysTool */,
12540
+ value: ToolConfirmationOutcome.ProceedAlwaysTool,
12514
12541
  key: "Allow tool for this session"
12515
12542
  });
12516
12543
  options2.push({
12517
12544
  label: "Allow all server tools for this session",
12518
- value: "proceed_always_server" /* ProceedAlwaysServer */,
12545
+ value: ToolConfirmationOutcome.ProceedAlwaysServer,
12519
12546
  key: "Allow all server tools for this session"
12520
12547
  });
12521
12548
  if (allowPermanentApproval) {
12522
12549
  options2.push({
12523
12550
  label: "Allow tool for all future sessions",
12524
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12551
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12525
12552
  key: "Allow tool for all future sessions"
12526
12553
  });
12527
12554
  }
12528
12555
  }
12529
12556
  options2.push({
12530
12557
  label: "No, suggest changes (esc)",
12531
- value: "cancel" /* Cancel */,
12558
+ value: ToolConfirmationOutcome.Cancel,
12532
12559
  key: "No, suggest changes (esc)"
12533
12560
  });
12534
12561
  }
@@ -12567,7 +12594,7 @@ ${deceptiveUrlWarnings.map(
12567
12594
  const containsRedirection = commandsToDisplay.some(
12568
12595
  (cmd) => hasRedirection(cmd)
12569
12596
  );
12570
- const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
12597
+ const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
12571
12598
  if (containsRedirection && !isAutoEdit) {
12572
12599
  extraInfoLines = 1;
12573
12600
  }
@@ -12593,7 +12620,7 @@ ${deceptiveUrlWarnings.map(
12593
12620
  const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
12594
12621
  if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
12595
12622
  const alwaysAndSaveIndex = options2.findIndex(
12596
- (o) => o.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */
12623
+ (o) => o.value === ToolConfirmationOutcome.ProceedAlwaysAndSave
12597
12624
  );
12598
12625
  if (alwaysAndSaveIndex !== -1) {
12599
12626
  initialIndex2 = alwaysAndSaveIndex;
@@ -12610,10 +12637,10 @@ ${deceptiveUrlWarnings.map(
12610
12637
  {
12611
12638
  questions: confirmationDetails.questions,
12612
12639
  onSubmit: (answers) => {
12613
- handleConfirm("proceed_once" /* ProceedOnce */, { answers });
12640
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, { answers });
12614
12641
  },
12615
12642
  onCancel: () => {
12616
- handleConfirm("cancel" /* Cancel */);
12643
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12617
12644
  },
12618
12645
  width: terminalWidth,
12619
12646
  availableHeight: bodyHeight
@@ -12634,19 +12661,19 @@ ${deceptiveUrlWarnings.map(
12634
12661
  planPath: confirmationDetails.planPath,
12635
12662
  getPreferredEditor,
12636
12663
  onApprove: (approvalMode) => {
12637
- handleConfirm("proceed_once" /* ProceedOnce */, {
12664
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
12638
12665
  approved: true,
12639
12666
  approvalMode
12640
12667
  });
12641
12668
  },
12642
12669
  onFeedback: (feedback) => {
12643
- handleConfirm("proceed_once" /* ProceedOnce */, {
12670
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
12644
12671
  approved: false,
12645
12672
  feedback
12646
12673
  });
12647
12674
  },
12648
12675
  onCancel: () => {
12649
- handleConfirm("cancel" /* Cancel */);
12676
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12650
12677
  },
12651
12678
  width: terminalWidth,
12652
12679
  availableHeight: bodyHeight
@@ -12756,7 +12783,7 @@ ${deceptiveUrlWarnings.map(
12756
12783
  const containsRedirection = commandsToDisplay.some(
12757
12784
  (cmd) => hasRedirection(cmd)
12758
12785
  );
12759
- const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
12786
+ const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
12760
12787
  let warnings = null;
12761
12788
  if (containsRedirection && !isAutoEdit) {
12762
12789
  const tipText = `To auto-accept, press ${formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */)}`;
@@ -12919,7 +12946,7 @@ ${deceptiveUrlWarnings.map(
12919
12946
  const bodyOverflowDirection = confirmationDetails.type === "mcp" && isMcpToolDetailsExpanded ? "bottom" : "top";
12920
12947
  const renderRadioItem = (0, import_react44.useCallback)(
12921
12948
  (item, { titleColor }) => {
12922
- if (item.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */) {
12949
+ if (item.value === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
12923
12950
  return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Text, { color: titleColor, wrap: "truncate", children: [
12924
12951
  item.label,
12925
12952
  " ",
@@ -13514,165 +13541,6 @@ var ConsentPrompt = (props) => {
13514
13541
  // packages/cli/src/ui/components/ThemeDialog.tsx
13515
13542
  var import_react47 = __toESM(require_react(), 1);
13516
13543
 
13517
- // packages/cli/src/utils/settingsUtils.ts
13518
- function flattenSchema(schema, prefix = "") {
13519
- let result = {};
13520
- for (const key in schema) {
13521
- const newKey = prefix ? `${prefix}.${key}` : key;
13522
- const definition = schema[key];
13523
- result[newKey] = { ...definition, key: newKey };
13524
- if (definition.properties) {
13525
- result = { ...result, ...flattenSchema(definition.properties, newKey) };
13526
- }
13527
- }
13528
- return result;
13529
- }
13530
- var _FLATTENED_SCHEMA;
13531
- function getFlattenedSchema() {
13532
- return _FLATTENED_SCHEMA ?? (_FLATTENED_SCHEMA = flattenSchema(getSettingsSchema()));
13533
- }
13534
- function getSettingDefinition(key) {
13535
- return getFlattenedSchema()[key];
13536
- }
13537
- function getDefaultValue(key) {
13538
- return getFlattenedSchema()[key]?.default;
13539
- }
13540
- function getDialogRestartRequiredSettings() {
13541
- return Object.values(getFlattenedSchema()).filter(
13542
- (definition) => definition.requiresRestart && definition.showInDialog !== false
13543
- ).map((definition) => definition.key);
13544
- }
13545
- function isRecord(value) {
13546
- return typeof value === "object" && value !== null;
13547
- }
13548
- function isSettingsValue(value) {
13549
- if (value === void 0) return true;
13550
- if (value === null) return false;
13551
- const type = typeof value;
13552
- return type === "string" || type === "number" || type === "boolean" || type === "object";
13553
- }
13554
- function getNestedValue(obj, path15) {
13555
- let current = obj;
13556
- for (const key of path15) {
13557
- if (!isRecord(current) || !(key in current)) {
13558
- return void 0;
13559
- }
13560
- current = current[key];
13561
- }
13562
- return current;
13563
- }
13564
- function getEffectiveValue(key, settings) {
13565
- const definition = getSettingDefinition(key);
13566
- if (!definition) {
13567
- return void 0;
13568
- }
13569
- const path15 = key.split(".");
13570
- const value = getNestedValue(settings, path15);
13571
- if (value !== void 0 && isSettingsValue(value)) {
13572
- return value;
13573
- }
13574
- return definition.default;
13575
- }
13576
- function getDialogSettingKeys() {
13577
- return Object.values(getFlattenedSchema()).filter((definition) => definition.showInDialog !== false).map((definition) => definition.key);
13578
- }
13579
- function isInSettingsScope(key, scopeSettings) {
13580
- const path15 = key.split(".");
13581
- const value = getNestedValue(scopeSettings, path15);
13582
- return value !== void 0;
13583
- }
13584
- function getDisplayValue(key, scopeSettings, _mergedSettings) {
13585
- const definition = getSettingDefinition(key);
13586
- const existsInScope = isInSettingsScope(key, scopeSettings);
13587
- let value;
13588
- if (existsInScope) {
13589
- value = getEffectiveValue(key, scopeSettings);
13590
- } else {
13591
- value = getDefaultValue(key);
13592
- }
13593
- let valueString = String(value);
13594
- if (definition?.type === "object" && value !== null && typeof value === "object") {
13595
- valueString = JSON.stringify(value);
13596
- } else if (definition?.type === "enum" && definition.options) {
13597
- const option = definition.options?.find((option2) => option2.value === value);
13598
- valueString = option?.label ?? `${value}`;
13599
- }
13600
- if (definition?.unit === "%" && typeof value === "number") {
13601
- valueString = `${value} (${Math.round(value * 100)}%)`;
13602
- } else if (definition?.unit) {
13603
- valueString = `${valueString}${definition.unit}`;
13604
- }
13605
- if (existsInScope) {
13606
- return `${valueString}*`;
13607
- }
13608
- return valueString;
13609
- }
13610
- function tryParseJsonStringArray(input) {
13611
- try {
13612
- const parsed = JSON.parse(input);
13613
- if (Array.isArray(parsed) && parsed.every((item) => typeof item === "string")) {
13614
- return parsed;
13615
- }
13616
- return null;
13617
- } catch {
13618
- return null;
13619
- }
13620
- }
13621
- function tryParseJsonObject(input) {
13622
- try {
13623
- const parsed = JSON.parse(input);
13624
- if (isRecord(parsed) && !Array.isArray(parsed)) {
13625
- return parsed;
13626
- }
13627
- return null;
13628
- } catch {
13629
- return null;
13630
- }
13631
- }
13632
- function parseStringArrayValue(input) {
13633
- const trimmed = input.trim();
13634
- if (trimmed === "") return [];
13635
- return tryParseJsonStringArray(trimmed) ?? input.split(",").map((p) => p.trim()).filter((p) => p.length > 0);
13636
- }
13637
- function parseObjectValue(input) {
13638
- const trimmed = input.trim();
13639
- if (trimmed === "") {
13640
- return null;
13641
- }
13642
- return tryParseJsonObject(trimmed);
13643
- }
13644
- function parseEditedValue(type, newValue) {
13645
- if (type === "number") {
13646
- if (newValue.trim() === "") {
13647
- return null;
13648
- }
13649
- const numParsed = Number(newValue.trim());
13650
- if (Number.isNaN(numParsed)) {
13651
- return null;
13652
- }
13653
- return numParsed;
13654
- }
13655
- if (type === "array") {
13656
- return parseStringArrayValue(newValue);
13657
- }
13658
- if (type === "object") {
13659
- return parseObjectValue(newValue);
13660
- }
13661
- return newValue;
13662
- }
13663
- function getEditValue(type, rawValue) {
13664
- if (rawValue === void 0) {
13665
- return void 0;
13666
- }
13667
- if (type === "array" && Array.isArray(rawValue)) {
13668
- return rawValue.join(", ");
13669
- }
13670
- if (type === "object" && rawValue !== null && typeof rawValue === "object") {
13671
- return JSON.stringify(rawValue);
13672
- }
13673
- return void 0;
13674
- }
13675
-
13676
13544
  // packages/cli/src/utils/dialogScopeUtils.ts
13677
13545
  var SCOPE_LABELS = {
13678
13546
  ["User" /* User */]: "User Settings",
@@ -15077,7 +14945,7 @@ function validateAuthMethodWithSettings(authType, settings) {
15077
14945
  if (settings.merged.security.auth.useExternal) {
15078
14946
  return null;
15079
14947
  }
15080
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14948
+ if (authType === AuthType.USE_GEMINI) {
15081
14949
  return null;
15082
14950
  }
15083
14951
  return validateAuthMethod(authType);
@@ -15129,7 +14997,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
15129
14997
  }
15130
14998
  return;
15131
14999
  }
15132
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
15000
+ if (authType === AuthType.USE_GEMINI) {
15133
15001
  const key = await reloadApiKey();
15134
15002
  if (!key) {
15135
15003
  setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
@@ -15204,31 +15072,31 @@ function AuthDialog({
15204
15072
  let items = [
15205
15073
  {
15206
15074
  label: "Sign in with Google",
15207
- value: "oauth-personal" /* LOGIN_WITH_GOOGLE */,
15208
- key: "oauth-personal" /* LOGIN_WITH_GOOGLE */
15075
+ value: AuthType.LOGIN_WITH_GOOGLE,
15076
+ key: AuthType.LOGIN_WITH_GOOGLE
15209
15077
  },
15210
15078
  ...process.env["CLOUD_SHELL"] === "true" ? [
15211
15079
  {
15212
15080
  label: "Use Cloud Shell user credentials",
15213
- value: "compute-default-credentials" /* COMPUTE_ADC */,
15214
- key: "compute-default-credentials" /* COMPUTE_ADC */
15081
+ value: AuthType.COMPUTE_ADC,
15082
+ key: AuthType.COMPUTE_ADC
15215
15083
  }
15216
15084
  ] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
15217
15085
  {
15218
15086
  label: "Use metadata server application default credentials",
15219
- value: "compute-default-credentials" /* COMPUTE_ADC */,
15220
- key: "compute-default-credentials" /* COMPUTE_ADC */
15087
+ value: AuthType.COMPUTE_ADC,
15088
+ key: AuthType.COMPUTE_ADC
15221
15089
  }
15222
15090
  ] : [],
15223
15091
  {
15224
15092
  label: "Use Gemini API Key",
15225
- value: "gemini-api-key" /* USE_GEMINI */,
15226
- key: "gemini-api-key" /* USE_GEMINI */
15093
+ value: AuthType.USE_GEMINI,
15094
+ key: AuthType.USE_GEMINI
15227
15095
  },
15228
15096
  {
15229
15097
  label: "Vertex AI",
15230
- value: "vertex-ai" /* USE_VERTEX_AI */,
15231
- key: "vertex-ai" /* USE_VERTEX_AI */
15098
+ value: AuthType.USE_VERTEX_AI,
15099
+ key: AuthType.USE_VERTEX_AI
15232
15100
  }
15233
15101
  ];
15234
15102
  if (settings.merged.security.auth.enforcedType) {
@@ -15250,9 +15118,9 @@ function AuthDialog({
15250
15118
  return item.value === defaultAuthType;
15251
15119
  }
15252
15120
  if (process.env["GEMINI_API_KEY"]) {
15253
- return item.value === "gemini-api-key" /* USE_GEMINI */;
15121
+ return item.value === AuthType.USE_GEMINI;
15254
15122
  }
15255
- return item.value === "oauth-personal" /* LOGIN_WITH_GOOGLE */;
15123
+ return item.value === AuthType.LOGIN_WITH_GOOGLE;
15256
15124
  });
15257
15125
  if (settings.merged.security.auth.enforcedType) {
15258
15126
  initialAuthIndex = 0;
@@ -15263,19 +15131,19 @@ function AuthDialog({
15263
15131
  return;
15264
15132
  }
15265
15133
  if (authType) {
15266
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */) {
15134
+ if (authType === AuthType.LOGIN_WITH_GOOGLE) {
15267
15135
  setAuthContext({ requiresRestart: true });
15268
15136
  } else {
15269
15137
  setAuthContext({});
15270
15138
  }
15271
15139
  await clearCachedCredentialFile();
15272
15140
  settings.setValue(scope, "security.auth.selectedType", authType);
15273
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
15141
+ if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
15274
15142
  setExiting(true);
15275
15143
  setTimeout(relaunchApp, 100);
15276
15144
  return;
15277
15145
  }
15278
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
15146
+ if (authType === AuthType.USE_GEMINI) {
15279
15147
  setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
15280
15148
  return;
15281
15149
  }
@@ -16025,11 +15893,11 @@ var PrivacyNoticeText = ({
16025
15893
  }) => {
16026
15894
  const authType = config.getContentGeneratorConfig()?.authType;
16027
15895
  switch (authType) {
16028
- case "gemini-api-key" /* USE_GEMINI */:
15896
+ case AuthType.USE_GEMINI:
16029
15897
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(GeminiPrivacyNotice, { onExit });
16030
- case "vertex-ai" /* USE_VERTEX_AI */:
15898
+ case AuthType.USE_VERTEX_AI:
16031
15899
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(CloudPaidPrivacyNotice, { onExit });
16032
- case "oauth-personal" /* LOGIN_WITH_GOOGLE */:
15900
+ case AuthType.LOGIN_WITH_GOOGLE:
16033
15901
  default:
16034
15902
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(CloudFreePrivacyNotice, { config, onExit });
16035
15903
  }
@@ -16070,7 +15938,7 @@ function ProQuotaDialog({
16070
15938
  value: "retry_always",
16071
15939
  key: "retry_always"
16072
15940
  },
16073
- ...authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && !isUltra ? [
15941
+ ...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
16074
15942
  {
16075
15943
  label: "Upgrade for higher limits",
16076
15944
  value: "upgrade",
@@ -17223,7 +17091,7 @@ function ModelDialog({ onClose }) {
17223
17091
  const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
17224
17092
  const useGemini31FlashLite = config?.getGemini31FlashLiteLaunchedSync?.() ?? false;
17225
17093
  const selectedAuthType = settings.merged.security.auth.selectedType;
17226
- const useCustomToolModel = useGemini31 && selectedAuthType === "gemini-api-key" /* USE_GEMINI */;
17094
+ const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
17227
17095
  const manualModelSelected = (0, import_react62.useMemo)(() => {
17228
17096
  if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
17229
17097
  const def = config.getModelConfigService().getModelDefinition(preferredModel);
@@ -18275,10 +18143,10 @@ function initializeConsoleStore() {
18275
18143
  globalConsoleMessages = [];
18276
18144
  globalErrorCount = 0;
18277
18145
  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);
18146
+ coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
18147
+ coreEvents.off(CoreEvent.Output, handleOutput);
18148
+ coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
18149
+ coreEvents.on(CoreEvent.Output, handleOutput);
18282
18150
  }
18283
18151
  function notifyListeners() {
18284
18152
  for (const listener of listeners) {
@@ -20376,7 +20244,7 @@ function usePromptCompletion({
20376
20244
  { model: "prompt-completion" },
20377
20245
  contents,
20378
20246
  signal,
20379
- "utility_autocomplete" /* UTILITY_AUTOCOMPLETE */
20247
+ LlmRole.UTILITY_AUTOCOMPLETE
20380
20248
  );
20381
20249
  if (signal.aborted) {
20382
20250
  return;
@@ -22103,9 +21971,9 @@ var InputPrompt = ({
22103
21971
  onSuggestionsVisibilityChange(shouldShowSuggestions);
22104
21972
  }
22105
21973
  }, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
22106
- const showAutoAcceptStyling = !shellModeActive && approvalMode === "autoEdit" /* AUTO_EDIT */;
22107
- const showYoloStyling = !shellModeActive && approvalMode === "yolo" /* YOLO */;
22108
- const showPlanStyling = !shellModeActive && approvalMode === "plan" /* PLAN */;
21974
+ const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
21975
+ const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
21976
+ const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
22109
21977
  let statusColor;
22110
21978
  let statusText = "";
22111
21979
  if (shellModeActive) {
@@ -22937,22 +22805,22 @@ var ApprovalModeIndicator = ({
22937
22805
  const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
22938
22806
  const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
22939
22807
  switch (approvalMode) {
22940
- case "autoEdit" /* AUTO_EDIT */:
22808
+ case ApprovalMode.AUTO_EDIT:
22941
22809
  textColor = theme.status.warning;
22942
22810
  textContent = "auto-accept edits";
22943
22811
  subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
22944
22812
  break;
22945
- case "plan" /* PLAN */:
22813
+ case ApprovalMode.PLAN:
22946
22814
  textColor = theme.status.success;
22947
22815
  textContent = "plan";
22948
22816
  subText = `${cycleHint} to manual`;
22949
22817
  break;
22950
- case "yolo" /* YOLO */:
22818
+ case ApprovalMode.YOLO:
22951
22819
  textColor = theme.status.error;
22952
22820
  textContent = "YOLO";
22953
22821
  subText = yoloHint;
22954
22822
  break;
22955
- case "default" /* DEFAULT */:
22823
+ case ApprovalMode.DEFAULT:
22956
22824
  default:
22957
22825
  textColor = theme.text.accent;
22958
22826
  textContent = "";
@@ -23000,7 +22868,7 @@ var useComposerStatus = () => {
23000
22868
  (item) => item.type === "tool_group"
23001
22869
  ).some(
23002
22870
  (item) => item.tools.some(
23003
- (tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
22871
+ (tool) => tool.status === CoreToolCallStatus.AwaitingApproval
23004
22872
  )
23005
22873
  ),
23006
22874
  [uiState.pendingHistoryItems]
@@ -23015,13 +22883,13 @@ var useComposerStatus = () => {
23015
22883
  const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
23016
22884
  if (hideMinimalModeHintWhileBusy) return null;
23017
22885
  switch (showApprovalModeIndicator) {
23018
- case "yolo" /* YOLO */:
22886
+ case ApprovalMode.YOLO:
23019
22887
  return { text: "YOLO", color: theme.status.error };
23020
- case "plan" /* PLAN */:
22888
+ case ApprovalMode.PLAN:
23021
22889
  return { text: "plan", color: theme.status.success };
23022
- case "autoEdit" /* AUTO_EDIT */:
22890
+ case ApprovalMode.AUTO_EDIT:
23023
22891
  return { text: "auto edit", color: theme.status.warning };
23024
- case "default" /* DEFAULT */:
22892
+ case ApprovalMode.DEFAULT:
23025
22893
  default:
23026
22894
  return null;
23027
22895
  }
@@ -23375,7 +23243,7 @@ var ConfigInitDisplay = ({
23375
23243
  let connected = 0;
23376
23244
  const connecting = [];
23377
23245
  for (const [name, client] of clients.entries()) {
23378
- if (client.getStatus() === "connected" /* CONNECTED */) {
23246
+ if (client.getStatus() === MCPServerStatus.CONNECTED) {
23379
23247
  connected++;
23380
23248
  } else {
23381
23249
  connecting.push(name);
@@ -23397,9 +23265,9 @@ var ConfigInitDisplay = ({
23397
23265
  );
23398
23266
  }
23399
23267
  };
23400
- coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
23268
+ coreEvents.on(CoreEvent.McpClientUpdate, onChange);
23401
23269
  return () => {
23402
- coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
23270
+ coreEvents.off(CoreEvent.McpClientUpdate, onChange);
23403
23271
  };
23404
23272
  }, [initialMessage]);
23405
23273
  return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Text, { children: [
@@ -24114,7 +23982,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
24114
23982
  callId,
24115
23983
  name: SHELL_COMMAND_NAME,
24116
23984
  description: rawQuery,
24117
- status: "executing" /* Executing */,
23985
+ status: CoreToolCallStatus.Executing,
24118
23986
  isClientInitiated: true,
24119
23987
  resultDisplay: "",
24120
23988
  confirmationDetails: void 0
@@ -24255,7 +24123,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
24255
24123
  mainContent = result.output.trim() || "(Command produced no output)";
24256
24124
  }
24257
24125
  let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
24258
- let finalStatus = "success" /* Success */;
24126
+ let finalStatus = CoreToolCallStatus.Success;
24259
24127
  const prependToAnsiOutput = (output, text) => {
24260
24128
  const newLines = text.split("\n").map((line) => [
24261
24129
  {
@@ -24274,20 +24142,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
24274
24142
  };
24275
24143
  let prefix = "";
24276
24144
  if (result.error) {
24277
- finalStatus = "error" /* Error */;
24145
+ finalStatus = CoreToolCallStatus.Error;
24278
24146
  prefix = result.error.message;
24279
24147
  } else if (result.aborted) {
24280
- finalStatus = "cancelled" /* Cancelled */;
24148
+ finalStatus = CoreToolCallStatus.Cancelled;
24281
24149
  prefix = "Command was cancelled.";
24282
24150
  } else if (result.backgrounded) {
24283
- finalStatus = "success" /* Success */;
24151
+ finalStatus = CoreToolCallStatus.Success;
24284
24152
  finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
24285
24153
  mainContent = finalOutput;
24286
24154
  } else if (result.signal) {
24287
- finalStatus = "error" /* Error */;
24155
+ finalStatus = CoreToolCallStatus.Error;
24288
24156
  prefix = `Command terminated by signal: ${result.signal}.`;
24289
24157
  } else if (result.exitCode !== 0) {
24290
- finalStatus = "error" /* Error */;
24158
+ finalStatus = CoreToolCallStatus.Error;
24291
24159
  prefix = `Command exited with code ${result.exitCode}.`;
24292
24160
  }
24293
24161
  if (prefix) {
@@ -24313,7 +24181,7 @@ ${mainContent}`;
24313
24181
  status: finalStatus,
24314
24182
  resultDisplay: finalOutput
24315
24183
  };
24316
- if (finalStatus !== "cancelled" /* Cancelled */) {
24184
+ if (finalStatus !== CoreToolCallStatus.Cancelled) {
24317
24185
  addItemToHistory(
24318
24186
  {
24319
24187
  type: "tool_group",
@@ -25303,7 +25171,7 @@ function useQuotaAndFallback({
25303
25171
  error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
25304
25172
  `/stats model for usage details`,
25305
25173
  `/model to switch models.`,
25306
- contentGeneratorConfig?.authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? `/auth to switch to API key.` : null
25174
+ contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
25307
25175
  ].filter(Boolean);
25308
25176
  message = messageLines.join("\n");
25309
25177
  } else if (error instanceof ModelNotFoundError) {
@@ -25491,7 +25359,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
25491
25359
  );
25492
25360
  setEditorError(null);
25493
25361
  setIsEditorDialogOpen(false);
25494
- coreEvents.emit("editor-selected" /* EditorSelected */, { editor: editorType });
25362
+ coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
25495
25363
  } catch (error) {
25496
25364
  setEditorError(`Failed to set editor preference: ${error}`);
25497
25365
  }
@@ -25500,7 +25368,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
25500
25368
  );
25501
25369
  const exitEditorDialog = (0, import_react95.useCallback)(() => {
25502
25370
  setIsEditorDialogOpen(false);
25503
- coreEvents.emit("editor-selected" /* EditorSelected */, { editor: void 0 });
25371
+ coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
25504
25372
  }, []);
25505
25373
  return {
25506
25374
  isEditorDialogOpen,
@@ -25859,7 +25727,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
25859
25727
  canonicalPath: resolvedCommandPath
25860
25728
  } = parseSlashCommand(trimmed, commands);
25861
25729
  if (!commandToExecute) {
25862
- const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === "in_progress" /* IN_PROGRESS */;
25730
+ const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
25863
25731
  if (isMcpLoading) {
25864
25732
  setIsProcessing(true);
25865
25733
  if (addToHistory) {
@@ -26027,7 +25895,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26027
25895
  onConfirm: async (resolvedOutcome) => {
26028
25896
  resolve3({
26029
25897
  outcome: resolvedOutcome,
26030
- approvedCommands: resolvedOutcome === "cancel" /* Cancel */ ? [] : result.commandsToConfirm
25898
+ approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
26031
25899
  });
26032
25900
  }
26033
25901
  };
@@ -26035,7 +25903,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26035
25903
  callId,
26036
25904
  name: "Expansion",
26037
25905
  description: "Command expansion needs shell access",
26038
- status: "awaiting_approval" /* AwaitingApproval */,
25906
+ status: CoreToolCallStatus.AwaitingApproval,
26039
25907
  isClientInitiated: true,
26040
25908
  resultDisplay: void 0,
26041
25909
  confirmationDetails
@@ -26046,7 +25914,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26046
25914
  });
26047
25915
  });
26048
25916
  setPendingItem(null);
26049
- if (outcome === "cancel" /* Cancel */ || !approvedCommands || approvedCommands.length === 0) {
25917
+ if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
26050
25918
  addItem(
26051
25919
  {
26052
25920
  type: "info" /* INFO */,
@@ -26056,7 +25924,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26056
25924
  );
26057
25925
  return { type: "handled" };
26058
25926
  }
26059
- if (outcome === "proceed_always" /* ProceedAlways */) {
25927
+ if (outcome === ToolConfirmationOutcome.ProceedAlways) {
26060
25928
  setSessionShellAllowlist(
26061
25929
  (prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
26062
25930
  );
@@ -26532,7 +26400,7 @@ function mapToDisplay(toolOrTools, options = {}) {
26532
26400
  let description;
26533
26401
  let renderOutputAsMarkdown = false;
26534
26402
  const displayName = call.tool?.displayName ?? call.request.name;
26535
- if (call.status === "error" /* Error */) {
26403
+ if (call.status === CoreToolCallStatus.Error) {
26536
26404
  description = JSON.stringify(call.request.args);
26537
26405
  } else {
26538
26406
  description = call.invocation.getDescription();
@@ -26555,27 +26423,27 @@ function mapToDisplay(toolOrTools, options = {}) {
26555
26423
  let progress = void 0;
26556
26424
  let progressTotal = void 0;
26557
26425
  switch (call.status) {
26558
- case "success" /* Success */:
26426
+ case CoreToolCallStatus.Success:
26559
26427
  resultDisplay = call.response.resultDisplay;
26560
26428
  outputFile = call.response.outputFile;
26561
26429
  break;
26562
- case "error" /* Error */:
26563
- case "cancelled" /* Cancelled */:
26430
+ case CoreToolCallStatus.Error:
26431
+ case CoreToolCallStatus.Cancelled:
26564
26432
  resultDisplay = call.response.resultDisplay;
26565
26433
  break;
26566
- case "awaiting_approval" /* AwaitingApproval */:
26434
+ case CoreToolCallStatus.AwaitingApproval:
26567
26435
  correlationId = call.correlationId;
26568
26436
  confirmationDetails = call.confirmationDetails;
26569
26437
  break;
26570
- case "executing" /* Executing */:
26438
+ case CoreToolCallStatus.Executing:
26571
26439
  resultDisplay = call.liveOutput;
26572
26440
  ptyId = call.pid;
26573
26441
  progressMessage = call.progressMessage;
26574
26442
  progress = call.progress;
26575
26443
  progressTotal = call.progressTotal;
26576
26444
  break;
26577
- case "scheduled" /* Scheduled */:
26578
- case "validating" /* Validating */:
26445
+ case CoreToolCallStatus.Scheduled:
26446
+ case CoreToolCallStatus.Validating:
26579
26447
  break;
26580
26448
  default: {
26581
26449
  const exhaustiveCheck = call;
@@ -26646,7 +26514,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26646
26514
  const handler = (event) => {
26647
26515
  const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
26648
26516
  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
26517
+ (tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
26650
26518
  );
26651
26519
  if (hasExecuting) {
26652
26520
  setLastToolOutputTime(Date.now());
@@ -26655,7 +26523,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26655
26523
  const prevCalls = prev[event.schedulerId] ?? [];
26656
26524
  const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
26657
26525
  const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
26658
- (tc) => tc.status === "awaiting_approval" /* AwaitingApproval */ || prevCallIds.has(tc.request.callId)
26526
+ (tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
26659
26527
  );
26660
26528
  if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
26661
26529
  return prev;
@@ -26667,9 +26535,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26667
26535
  };
26668
26536
  });
26669
26537
  };
26670
- messageBus.subscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
26538
+ messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
26671
26539
  return () => {
26672
- messageBus.unsubscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
26540
+ messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
26673
26541
  };
26674
26542
  }, [messageBus, internalAdaptToolCalls]);
26675
26543
  (0, import_react101.useEffect)(() => {
@@ -26691,9 +26559,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26691
26559
  };
26692
26560
  });
26693
26561
  };
26694
- messageBus.subscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
26562
+ messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
26695
26563
  return () => {
26696
- messageBus.unsubscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
26564
+ messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
26697
26565
  };
26698
26566
  }, [messageBus]);
26699
26567
  const schedule = (0, import_react101.useCallback)(
@@ -26792,8 +26660,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
26792
26660
  const prev = prevMap.get(coreCall.request.callId);
26793
26661
  const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
26794
26662
  let status = coreCall.status;
26795
- if ((status === "success" /* Success */ || status === "error" /* Error */) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
26796
- status = "executing" /* Executing */;
26663
+ if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
26664
+ status = CoreToolCallStatus.Executing;
26797
26665
  }
26798
26666
  return {
26799
26667
  ...coreCall,
@@ -26825,7 +26693,7 @@ function getBackgroundedToolInfo(toolCall) {
26825
26693
  };
26826
26694
  }
26827
26695
  function isBackgroundableExecutingToolCall(toolCall) {
26828
- return toolCall.status === "executing" /* Executing */ && typeof toolCall.pid === "number";
26696
+ return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
26829
26697
  }
26830
26698
  function showCitations(settings) {
26831
26699
  const enabled = settings.merged.ui.showCitations;
@@ -26835,14 +26703,14 @@ function showCitations(settings) {
26835
26703
  return true;
26836
26704
  }
26837
26705
  function calculateStreamingState(isResponding, toolCalls) {
26838
- if (toolCalls.some((tc) => tc.status === "awaiting_approval" /* AwaitingApproval */)) {
26706
+ if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
26839
26707
  return "waiting_for_confirmation" /* WaitingForConfirmation */;
26840
26708
  }
26841
26709
  const isAnyToolActive = toolCalls.some((tc) => {
26842
- if (tc.status === "executing" /* Executing */ || tc.status === "scheduled" /* Scheduled */ || tc.status === "validating" /* Validating */) {
26710
+ if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
26843
26711
  return true;
26844
26712
  }
26845
- if (tc.status === "success" /* Success */ || tc.status === "error" /* Error */ || tc.status === "cancelled" /* Cancelled */) {
26713
+ if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
26846
26714
  return !tc.responseSubmittedToGemini;
26847
26715
  }
26848
26716
  return false;
@@ -26889,9 +26757,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
26889
26757
  }
26890
26758
  setRetryStatus(payload);
26891
26759
  };
26892
- coreEvents.on("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
26760
+ coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
26893
26761
  return () => {
26894
- coreEvents.off("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
26762
+ coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
26895
26763
  };
26896
26764
  }, [isRespondingRef]);
26897
26765
  const [
@@ -27024,12 +26892,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27024
26892
  const tc = toolCalls[i];
27025
26893
  if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
27026
26894
  if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
27027
- const isAgent = tc.tool?.kind === "agent" /* Agent */;
26895
+ const isAgent = tc.tool?.kind === Kind.Agent;
27028
26896
  if (isAgent) {
27029
26897
  let contigAgentsComplete = true;
27030
26898
  for (let j = i + 1; j < toolCalls.length; j++) {
27031
26899
  const nextTc = toolCalls[j];
27032
- if (nextTc.tool?.kind === "agent" /* Agent */) {
26900
+ if (nextTc.tool?.kind === Kind.Agent) {
27033
26901
  if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
27034
26902
  contigAgentsComplete = false;
27035
26903
  break;
@@ -27055,7 +26923,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27055
26923
  let currentGroup = [];
27056
26924
  for (const tc of toolsToPush) {
27057
26925
  newPushed.add(tc.request.callId);
27058
- if (tc.tool?.kind === "agent" /* Agent */) {
26926
+ if (tc.tool?.kind === Kind.Agent) {
27059
26927
  currentGroup.push(tc);
27060
26928
  } else {
27061
26929
  if (currentGroup.length > 0) {
@@ -27205,7 +27073,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27205
27073
  prevActiveShellPtyIdRef.current = activeShellPtyId;
27206
27074
  }, [activeShellPtyId, addItem, setIsResponding]);
27207
27075
  (0, import_react102.useEffect)(() => {
27208
- if (config.getApprovalMode() === "yolo" /* YOLO */ && streamingState === "idle" /* Idle */) {
27076
+ if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
27209
27077
  const lastUserMessageIndex = history.findLastIndex(
27210
27078
  (item) => item.type === "user" /* USER */
27211
27079
  );
@@ -27291,7 +27159,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27291
27159
  if (tool.name === SHELL_COMMAND_NAME) {
27292
27160
  return {
27293
27161
  ...tool,
27294
- status: "cancelled" /* Cancelled */,
27162
+ status: CoreToolCallStatus.Cancelled,
27295
27163
  resultDisplay: tool.resultDisplay
27296
27164
  };
27297
27165
  }
@@ -27347,7 +27215,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27347
27215
  let localQueryToSendToGemini = null;
27348
27216
  if (typeof query === "string") {
27349
27217
  const trimmedQuery = query.trim();
27350
- await logger?.logMessage("user" /* USER */, trimmedQuery);
27218
+ await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
27351
27219
  if (!shellModeActive) {
27352
27220
  const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
27353
27221
  if (slashCommandResult) {
@@ -27503,7 +27371,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27503
27371
  if (pendingHistoryItemRef.current) {
27504
27372
  if (pendingHistoryItemRef.current.type === "tool_group") {
27505
27373
  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
27374
+ (tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
27507
27375
  );
27508
27376
  const pendingItem = {
27509
27377
  ...pendingHistoryItemRef.current,
@@ -27749,15 +27617,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27749
27617
  let geminiMessageBuffer = "";
27750
27618
  const toolCallRequests = [];
27751
27619
  for await (const event of stream) {
27752
- if (event.type !== "thought" /* Thought */ && thoughtRef.current !== null) {
27620
+ if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
27753
27621
  setThought(null);
27754
27622
  }
27755
27623
  switch (event.type) {
27756
- case "thought" /* Thought */:
27624
+ case GeminiEventType.Thought:
27757
27625
  setLastGeminiActivityTime(Date.now());
27758
27626
  handleThoughtEvent(event.value, userMessageTimestamp);
27759
27627
  break;
27760
- case "content" /* Content */:
27628
+ case GeminiEventType.Content:
27761
27629
  setLastGeminiActivityTime(Date.now());
27762
27630
  geminiMessageBuffer = handleContentEvent(
27763
27631
  event.value,
@@ -27765,16 +27633,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27765
27633
  userMessageTimestamp
27766
27634
  );
27767
27635
  break;
27768
- case "tool_call_request" /* ToolCallRequest */:
27636
+ case GeminiEventType.ToolCallRequest:
27769
27637
  toolCallRequests.push(event.value);
27770
27638
  break;
27771
- case "user_cancelled" /* UserCancelled */:
27639
+ case GeminiEventType.UserCancelled:
27772
27640
  handleUserCancelledEvent(userMessageTimestamp);
27773
27641
  break;
27774
- case "error" /* Error */:
27642
+ case GeminiEventType.Error:
27775
27643
  handleErrorEvent(event.value, userMessageTimestamp);
27776
27644
  break;
27777
- case "agent_execution_stopped" /* AgentExecutionStopped */:
27645
+ case GeminiEventType.AgentExecutionStopped:
27778
27646
  handleAgentExecutionStoppedEvent(
27779
27647
  event.value.reason,
27780
27648
  userMessageTimestamp,
@@ -27782,7 +27650,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27782
27650
  event.value.contextCleared
27783
27651
  );
27784
27652
  break;
27785
- case "agent_execution_blocked" /* AgentExecutionBlocked */:
27653
+ case GeminiEventType.AgentExecutionBlocked:
27786
27654
  handleAgentExecutionBlockedEvent(
27787
27655
  event.value.reason,
27788
27656
  userMessageTimestamp,
@@ -27790,35 +27658,35 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27790
27658
  event.value.contextCleared
27791
27659
  );
27792
27660
  break;
27793
- case "chat_compressed" /* ChatCompressed */:
27661
+ case GeminiEventType.ChatCompressed:
27794
27662
  handleChatCompressionEvent(event.value, userMessageTimestamp);
27795
27663
  break;
27796
- case "tool_call_confirmation" /* ToolCallConfirmation */:
27797
- case "tool_call_response" /* ToolCallResponse */:
27664
+ case GeminiEventType.ToolCallConfirmation:
27665
+ case GeminiEventType.ToolCallResponse:
27798
27666
  break;
27799
- case "max_session_turns" /* MaxSessionTurns */:
27667
+ case GeminiEventType.MaxSessionTurns:
27800
27668
  handleMaxSessionTurnsEvent();
27801
27669
  break;
27802
- case "context_window_will_overflow" /* ContextWindowWillOverflow */:
27670
+ case GeminiEventType.ContextWindowWillOverflow:
27803
27671
  handleContextWindowWillOverflowEvent(
27804
27672
  event.value.estimatedRequestTokenCount,
27805
27673
  event.value.remainingTokenCount
27806
27674
  );
27807
27675
  break;
27808
- case "finished" /* Finished */:
27676
+ case GeminiEventType.Finished:
27809
27677
  handleFinishedEvent(event, userMessageTimestamp);
27810
27678
  break;
27811
- case "citation" /* Citation */:
27679
+ case GeminiEventType.Citation:
27812
27680
  handleCitationEvent(event.value, userMessageTimestamp);
27813
27681
  break;
27814
- case "model_info" /* ModelInfo */:
27682
+ case GeminiEventType.ModelInfo:
27815
27683
  handleChatModelEvent(event.value, userMessageTimestamp);
27816
27684
  break;
27817
- case "loop_detected" /* LoopDetected */:
27685
+ case GeminiEventType.LoopDetected:
27818
27686
  loopDetectedRef.current = true;
27819
27687
  break;
27820
- case "retry" /* Retry */:
27821
- case "invalid_stream" /* InvalidStream */:
27688
+ case GeminiEventType.Retry:
27689
+ case GeminiEventType.InvalidStream:
27822
27690
  break;
27823
27691
  default: {
27824
27692
  const unreachable = event;
@@ -27859,7 +27727,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27859
27727
  const submitQuery = (0, import_react102.useCallback)(
27860
27728
  async (query, options, prompt_id) => runInDevTraceSpan(
27861
27729
  {
27862
- operation: options?.isContinuation ? "system_prompt" /* SystemPrompt */ : "user_prompt" /* UserPrompt */,
27730
+ operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
27863
27731
  sessionId: config.getSessionId()
27864
27732
  },
27865
27733
  async ({ metadata: spanMetadata }) => {
@@ -28020,7 +27888,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28020
27888
  );
28021
27889
  const handleApprovalModeChange = (0, import_react102.useCallback)(
28022
27890
  async (newApprovalMode) => {
28023
- if (previousApprovalModeRef.current === "plan" /* PLAN */ && newApprovalMode !== "plan" /* PLAN */ && streamingState === "idle" /* Idle */) {
27891
+ if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
28024
27892
  if (geminiClient) {
28025
27893
  try {
28026
27894
  await geminiClient.addHistory({
@@ -28043,11 +27911,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28043
27911
  }
28044
27912
  }
28045
27913
  previousApprovalModeRef.current = newApprovalMode;
28046
- if (newApprovalMode === "yolo" /* YOLO */ || newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
27914
+ if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
28047
27915
  let awaitingApprovalCalls = toolCalls.filter(
28048
27916
  (call) => call.status === "awaiting_approval" && !call.request.forcedAsk
28049
27917
  );
28050
- if (newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
27918
+ if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
28051
27919
  awaitingApprovalCalls = awaitingApprovalCalls.filter(
28052
27920
  (call) => EDIT_TOOL_NAMES.has(call.request.name)
28053
27921
  );
@@ -28056,11 +27924,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28056
27924
  if (call.correlationId) {
28057
27925
  try {
28058
27926
  await config.getMessageBus().publish({
28059
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
27927
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
28060
27928
  correlationId: call.correlationId,
28061
27929
  confirmed: true,
28062
27930
  requiresUserConfirmation: false,
28063
- outcome: "proceed_once" /* ProceedOnce */
27931
+ outcome: ToolConfirmationOutcome.ProceedOnce
28064
27932
  });
28065
27933
  } catch (error) {
28066
27934
  debugLogger.warn(
@@ -28138,14 +28006,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28138
28006
  );
28139
28007
  if (isLowErrorVerbosity) {
28140
28008
  suppressedToolErrorCountRef.current += geminiTools.filter(
28141
- (tc) => tc.status === "error" /* Error */
28009
+ (tc) => tc.status === CoreToolCallStatus.Error
28142
28010
  ).length;
28143
28011
  }
28144
28012
  if (geminiTools.length === 0) {
28145
28013
  return;
28146
28014
  }
28147
28015
  const stopExecutionTool = geminiTools.find(
28148
- (tc) => tc.response.errorType === "stop_execution" /* STOP_EXECUTION */
28016
+ (tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
28149
28017
  );
28150
28018
  if (stopExecutionTool && stopExecutionTool.response.error) {
28151
28019
  maybeAddSuppressedToolErrorNote();
@@ -28165,9 +28033,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28165
28033
  (tc) => !isTopicTool2(tc.request.name)
28166
28034
  );
28167
28035
  const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
28168
- (tc) => tc.status === "cancelled" /* Cancelled */
28036
+ (tc) => tc.status === CoreToolCallStatus.Cancelled
28169
28037
  );
28170
- const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === "cancelled" /* Cancelled */);
28038
+ const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
28171
28039
  if (allDeclinableToolsCancelled || allToolsCancelled) {
28172
28040
  if (!turnCancelledRef.current) {
28173
28041
  addItem({
@@ -28248,7 +28116,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28248
28116
  return;
28249
28117
  }
28250
28118
  const restorableToolCalls = toolCalls.filter(
28251
- (toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === "awaiting_approval" /* AwaitingApproval */
28119
+ (toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
28252
28120
  );
28253
28121
  if (restorableToolCalls.length > 0) {
28254
28122
  if (!gitService) {
@@ -28467,14 +28335,14 @@ var useAgentStream = ({
28467
28335
  const displayName = legacyState?.displayName ?? event.name;
28468
28336
  const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
28469
28337
  const desc = legacyState?.description ?? "";
28470
- const fallbackKind = "other" /* Other */;
28338
+ const fallbackKind = Kind.Other;
28471
28339
  const newCall = {
28472
28340
  callId: event.requestId,
28473
28341
  name: displayName,
28474
28342
  originalRequestName: event.name,
28475
28343
  description: desc,
28476
28344
  display: event.display,
28477
- status: "scheduled" /* Scheduled */,
28345
+ status: CoreToolCallStatus.Scheduled,
28478
28346
  isClientInitiated: false,
28479
28347
  renderOutputAsMarkdown: isOutputMarkdown,
28480
28348
  kind: legacyState?.kind ?? fallbackKind,
@@ -28492,10 +28360,10 @@ var useAgentStream = ({
28492
28360
  const evtStatus = legacyState?.status;
28493
28361
  let status = tc.status;
28494
28362
  if (evtStatus === "executing")
28495
- status = "executing" /* Executing */;
28496
- else if (evtStatus === "error") status = "error" /* Error */;
28363
+ status = CoreToolCallStatus.Executing;
28364
+ else if (evtStatus === "error") status = CoreToolCallStatus.Error;
28497
28365
  else if (evtStatus === "success")
28498
- status = "success" /* Success */;
28366
+ status = CoreToolCallStatus.Success;
28499
28367
  const display = event.display?.result;
28500
28368
  const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
28501
28369
  const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
@@ -28528,7 +28396,7 @@ var useAgentStream = ({
28528
28396
  const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
28529
28397
  return {
28530
28398
  ...tc,
28531
- status: event.isError ? "error" /* Error */ : "success" /* Success */,
28399
+ status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
28532
28400
  display: event.display ? { ...tc.display, ...event.display } : tc.display,
28533
28401
  resultDisplay,
28534
28402
  outputFile
@@ -28580,7 +28448,7 @@ var useAgentStream = ({
28580
28448
  if (!options?.isContinuation) {
28581
28449
  if (typeof query === "string") {
28582
28450
  addItem({ type: "user" /* USER */, text: query }, timestamp);
28583
- void logger?.logMessage("user" /* USER */, query);
28451
+ void logger?.logMessage(MessageSenderType.USER, query);
28584
28452
  }
28585
28453
  startNewPrompt();
28586
28454
  }
@@ -30081,9 +29949,9 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30081
29949
  const handleFolderTrustSelect = (0, import_react108.useCallback)(
30082
29950
  async (choice) => {
30083
29951
  const trustLevelMap = {
30084
- ["trust_folder" /* TRUST_FOLDER */]: "TRUST_FOLDER" /* TRUST_FOLDER */,
30085
- ["trust_parent" /* TRUST_PARENT */]: "TRUST_PARENT" /* TRUST_PARENT */,
30086
- ["do_not_trust" /* DO_NOT_TRUST */]: "DO_NOT_TRUST" /* DO_NOT_TRUST */
29952
+ ["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
29953
+ ["trust_parent" /* TRUST_PARENT */]: TrustLevel.TRUST_PARENT,
29954
+ ["do_not_trust" /* DO_NOT_TRUST */]: TrustLevel.DO_NOT_TRUST
30087
29955
  };
30088
29956
  const trustLevel = trustLevelMap[choice];
30089
29957
  if (!trustLevel) return;
@@ -30102,7 +29970,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30102
29970
  }, 100);
30103
29971
  return;
30104
29972
  }
30105
- const currentIsTrusted = trustLevel === "TRUST_FOLDER" /* TRUST_FOLDER */ || trustLevel === "TRUST_PARENT" /* TRUST_PARENT */;
29973
+ const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
30106
29974
  onTrustChange(currentIsTrusted);
30107
29975
  setIsTrusted(currentIsTrusted);
30108
29976
  const wasTrusted = isTrusted ?? false;
@@ -31100,7 +30968,7 @@ function useMessageQueue({
31100
30968
  var import_react110 = __toESM(require_react(), 1);
31101
30969
  function useMcpStatus(config) {
31102
30970
  const [discoveryState, setDiscoveryState] = (0, import_react110.useState)(
31103
- () => config.getMcpClientManager()?.getDiscoveryState() ?? "not_started" /* NOT_STARTED */
30971
+ () => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
31104
30972
  );
31105
30973
  const [mcpServerCount, setMcpServerCount] = (0, import_react110.useState)(
31106
30974
  () => config.getMcpClientManager()?.getMcpServerCount() ?? 0
@@ -31113,12 +30981,12 @@ function useMcpStatus(config) {
31113
30981
  setMcpServerCount(manager.getMcpServerCount());
31114
30982
  }
31115
30983
  };
31116
- coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
30984
+ coreEvents.on(CoreEvent.McpClientUpdate, onChange);
31117
30985
  return () => {
31118
- coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
30986
+ coreEvents.off(CoreEvent.McpClientUpdate, onChange);
31119
30987
  };
31120
30988
  }, [config]);
31121
- const isMcpReady = discoveryState === "completed" /* COMPLETED */ || discoveryState === "not_started" /* NOT_STARTED */ && mcpServerCount === 0;
30989
+ const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
31122
30990
  return {
31123
30991
  discoveryState,
31124
30992
  mcpServerCount,
@@ -31145,7 +31013,7 @@ function useApprovalModeIndicator({
31145
31013
  (key) => {
31146
31014
  let nextApprovalMode;
31147
31015
  if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
31148
- if (config.isYoloModeDisabled() && config.getApprovalMode() !== "yolo" /* YOLO */) {
31016
+ if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
31149
31017
  if (addItem) {
31150
31018
  let text = "You cannot enter YOLO mode since it is disabled in your settings.";
31151
31019
  const adminSettings = config.getRemoteAdminSettings();
@@ -31163,21 +31031,21 @@ function useApprovalModeIndicator({
31163
31031
  }
31164
31032
  return;
31165
31033
  }
31166
- nextApprovalMode = config.getApprovalMode() === "yolo" /* YOLO */ ? "default" /* DEFAULT */ : "yolo" /* YOLO */;
31034
+ nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
31167
31035
  } else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
31168
31036
  const currentMode = config.getApprovalMode();
31169
31037
  switch (currentMode) {
31170
- case "default" /* DEFAULT */:
31171
- nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
31038
+ case ApprovalMode.DEFAULT:
31039
+ nextApprovalMode = ApprovalMode.AUTO_EDIT;
31172
31040
  break;
31173
- case "autoEdit" /* AUTO_EDIT */:
31174
- nextApprovalMode = allowPlanMode ? "plan" /* PLAN */ : "default" /* DEFAULT */;
31041
+ case ApprovalMode.AUTO_EDIT:
31042
+ nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
31175
31043
  break;
31176
- case "plan" /* PLAN */:
31177
- nextApprovalMode = "default" /* DEFAULT */;
31044
+ case ApprovalMode.PLAN:
31045
+ nextApprovalMode = ApprovalMode.DEFAULT;
31178
31046
  break;
31179
- case "yolo" /* YOLO */:
31180
- nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
31047
+ case ApprovalMode.YOLO:
31048
+ nextApprovalMode = ApprovalMode.AUTO_EDIT;
31181
31049
  break;
31182
31050
  default:
31183
31051
  }
@@ -31570,11 +31438,11 @@ var useHookDisplayState = () => {
31570
31438
  removeHook();
31571
31439
  }
31572
31440
  };
31573
- coreEvents.on("hook-start" /* HookStart */, handleHookStart);
31574
- coreEvents.on("hook-end" /* HookEnd */, handleHookEnd);
31441
+ coreEvents.on(CoreEvent.HookStart, handleHookStart);
31442
+ coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
31575
31443
  return () => {
31576
- coreEvents.off("hook-start" /* HookStart */, handleHookStart);
31577
- coreEvents.off("hook-end" /* HookEnd */, handleHookEnd);
31444
+ coreEvents.off(CoreEvent.HookStart, handleHookStart);
31445
+ coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
31578
31446
  activeTimeouts.forEach(clearTimeout);
31579
31447
  activeTimeouts.clear();
31580
31448
  };
@@ -32463,7 +32331,7 @@ var AppContainer = (props) => {
32463
32331
  setConfigInitialized(true);
32464
32332
  startupProfiler.flush(config);
32465
32333
  startAutoMemoryIfEnabled(config);
32466
- const sessionStartSource = resumedSessionData ? "resume" /* Resume */ : "startup" /* Startup */;
32334
+ const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
32467
32335
  const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
32468
32336
  if (result) {
32469
32337
  if (result.systemMessage) {
@@ -32499,7 +32367,7 @@ var AppContainer = (props) => {
32499
32367
  );
32500
32368
  const ideClient = await IdeClient.getInstance();
32501
32369
  await ideClient.disconnect();
32502
- await config?.getHookSystem()?.fireSessionEndEvent("exit" /* Exit */);
32370
+ await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
32503
32371
  };
32504
32372
  registerCleanup(cleanupFn);
32505
32373
  return () => {
@@ -32524,11 +32392,11 @@ var AppContainer = (props) => {
32524
32392
  resetTime: payload.resetTime
32525
32393
  });
32526
32394
  };
32527
- coreEvents.on("model-changed" /* ModelChanged */, handleModelChanged);
32528
- coreEvents.on("quota-changed" /* QuotaChanged */, handleQuotaChanged);
32395
+ coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
32396
+ coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
32529
32397
  return () => {
32530
- coreEvents.off("model-changed" /* ModelChanged */, handleModelChanged);
32531
- coreEvents.off("quota-changed" /* QuotaChanged */, handleQuotaChanged);
32398
+ coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
32399
+ coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
32532
32400
  };
32533
32401
  }, [config]);
32534
32402
  (0, import_react124.useEffect)(() => {
@@ -32541,16 +32409,16 @@ var AppContainer = (props) => {
32541
32409
  const handleAgentsDiscovered = (payload) => {
32542
32410
  setNewAgents(payload.agents);
32543
32411
  };
32544
- coreEvents.on("settings-changed" /* SettingsChanged */, handleSettingsChanged);
32545
- coreEvents.on("admin-settings-changed" /* AdminSettingsChanged */, handleAdminSettingsChanged);
32546
- coreEvents.on("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
32412
+ coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
32413
+ coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
32414
+ coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
32547
32415
  return () => {
32548
- coreEvents.off("settings-changed" /* SettingsChanged */, handleSettingsChanged);
32416
+ coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
32549
32417
  coreEvents.off(
32550
- "admin-settings-changed" /* AdminSettingsChanged */,
32418
+ CoreEvent.AdminSettingsChanged,
32551
32419
  handleAdminSettingsChanged
32552
32420
  );
32553
- coreEvents.off("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
32421
+ coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
32554
32422
  };
32555
32423
  }, [settings]);
32556
32424
  const { errorCount, clearErrorCount } = useErrorCount();
@@ -32616,11 +32484,11 @@ var AppContainer = (props) => {
32616
32484
  exitEditorDialog
32617
32485
  } = useEditorSettings(settings, setEditorError, historyManager.addItem);
32618
32486
  (0, import_react124.useEffect)(() => {
32619
- coreEvents.on("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
32620
- coreEvents.on("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
32487
+ coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
32488
+ coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
32621
32489
  return () => {
32622
- coreEvents.off("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
32623
- coreEvents.off("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
32490
+ coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
32491
+ coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
32624
32492
  };
32625
32493
  }, [handleEditorClose, openEditorDialog]);
32626
32494
  (0, import_react124.useEffect)(() => {
@@ -32688,7 +32556,7 @@ var AppContainer = (props) => {
32688
32556
  errorVerbosity: settings.merged.ui.errorVerbosity
32689
32557
  });
32690
32558
  const isAuthDialogOpen = authState === "updating" /* Updating */;
32691
- const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== "gemini-api-key" /* USE_GEMINI */;
32559
+ const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
32692
32560
  const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
32693
32561
  const { loadHistoryForResume, isResuming } = useSessionResume({
32694
32562
  config,
@@ -32716,7 +32584,7 @@ var AppContainer = (props) => {
32716
32584
  async (authType, scope) => {
32717
32585
  if (authType) {
32718
32586
  const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
32719
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */) {
32587
+ if (authType === AuthType.LOGIN_WITH_GOOGLE) {
32720
32588
  setAuthContext({ requiresRestart: true });
32721
32589
  } else {
32722
32590
  setAuthContext({});
@@ -32744,7 +32612,7 @@ var AppContainer = (props) => {
32744
32612
  );
32745
32613
  return;
32746
32614
  }
32747
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
32615
+ if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
32748
32616
  writeToStdout(`
32749
32617
  ----------------------------------------------------------------
32750
32618
  Logging in with Google... Restarting Gemini CLI to continue.
@@ -32769,7 +32637,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
32769
32637
  }
32770
32638
  await saveApiKey(apiKey);
32771
32639
  await reloadApiKey();
32772
- await config.refreshAuth("gemini-api-key" /* USE_GEMINI */);
32640
+ await config.refreshAuth(AuthType.USE_GEMINI);
32773
32641
  setAuthState("authenticated" /* Authenticated */);
32774
32642
  } catch (e) {
32775
32643
  onAuthError(
@@ -32794,7 +32662,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
32794
32662
  `Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
32795
32663
  );
32796
32664
  } else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
32797
- if (settings.merged.security.auth.selectedType === "gemini-api-key" /* USE_GEMINI */) {
32665
+ if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
32798
32666
  return;
32799
32667
  }
32800
32668
  const error = validateAuthMethod(
@@ -32915,9 +32783,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
32915
32783
  }
32916
32784
  });
32917
32785
  };
32918
- coreEvents.on("consent-request" /* ConsentRequest */, handleConsentRequest);
32786
+ coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
32919
32787
  return () => {
32920
- coreEvents.off("consent-request" /* ConsentRequest */, handleConsentRequest);
32788
+ coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
32921
32789
  };
32922
32790
  }, []);
32923
32791
  const performMemoryRefresh = (0, import_react124.useCallback)(async () => {
@@ -33590,7 +33458,7 @@ ${queuedText}` : queuedText;
33590
33458
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
33591
33459
  if (settings.merged.general.devtools) {
33592
33460
  void (async () => {
33593
- const { toggleDevToolsPanel } = await import("./devtoolsService-6Y6YER6T.js");
33461
+ const { toggleDevToolsPanel } = await import("./devtoolsService-DNFLMYOX.js");
33594
33462
  await toggleDevToolsPanel(
33595
33463
  config,
33596
33464
  showErrorDetails,
@@ -33808,12 +33676,12 @@ ${queuedText}` : queuedText;
33808
33676
  Date.now()
33809
33677
  );
33810
33678
  };
33811
- coreEvents.on("user-feedback" /* UserFeedback */, handleUserFeedback);
33812
- coreEvents.on("hook-system-message" /* HookSystemMessage */, handleHookSystemMessage);
33679
+ coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
33680
+ coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
33813
33681
  coreEvents.drainBacklogs();
33814
33682
  return () => {
33815
- coreEvents.off("user-feedback" /* UserFeedback */, handleUserFeedback);
33816
- coreEvents.off("hook-system-message" /* HookSystemMessage */, handleHookSystemMessage);
33683
+ coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
33684
+ coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
33817
33685
  };
33818
33686
  }, [historyManager]);
33819
33687
  const nightly = props.version.includes("nightly");
@@ -33916,9 +33784,9 @@ ${queuedText}` : queuedText;
33916
33784
  const handleMemoryChanged = (result) => {
33917
33785
  setGeminiMdFileCount(result.fileCount);
33918
33786
  };
33919
- coreEvents.on("memory-changed" /* MemoryChanged */, handleMemoryChanged);
33787
+ coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
33920
33788
  return () => {
33921
- coreEvents.off("memory-changed" /* MemoryChanged */, handleMemoryChanged);
33789
+ coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
33922
33790
  };
33923
33791
  }, []);
33924
33792
  (0, import_react124.useEffect)(() => {