@google/gemini-cli 0.61.0-preview.0 → 0.61.0-preview.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/bundle/{chunk-YJFCJUWN.js → chunk-34PFYALD.js} +1 -1
  2. package/bundle/{chunk-3KWHN3A7.js → chunk-4D7PRDBS.js} +1 -1
  3. package/bundle/{chunk-ZJHBR7W3.js → chunk-4YQFFXRN.js} +1 -1
  4. package/bundle/{chunk-OZG5CLDY.js → chunk-7HAUMOMS.js} +7 -7
  5. package/bundle/{chunk-FIYKTSCR.js → chunk-BFB2YEJY.js} +1 -1
  6. package/bundle/{chunk-AIMNGITH.js → chunk-BHKACUMI.js} +3 -3
  7. package/bundle/{chunk-WFZMFTEE.js → chunk-EM2O5AOZ.js} +3 -3
  8. package/bundle/{chunk-HGJ3LRCZ.js → chunk-EUZJSBKR.js} +1 -1
  9. package/bundle/{chunk-DO6WSZ5A.js → chunk-FSZD7V6N.js} +2 -2
  10. package/bundle/{chunk-DOJZLPDE.js → chunk-GOOJJ7ZQ.js} +1 -1
  11. package/bundle/{chunk-LDL5PSV7.js → chunk-H6SLDOAI.js} +2 -2
  12. package/bundle/{chunk-ACTC6X24.js → chunk-HDPU5WOJ.js} +291 -134
  13. package/bundle/{chunk-4WJNJ3DK.js → chunk-JKUZ4FYJ.js} +1 -1
  14. package/bundle/{chunk-ZOKIJ2CA.js → chunk-KXVODVLE.js} +67 -54
  15. package/bundle/{chunk-HQQJ2XNS.js → chunk-LZGP7KFI.js} +17 -2
  16. package/bundle/{chunk-UUSSUQWL.js → chunk-MNBKYFEY.js} +9 -8
  17. package/bundle/{chunk-XL4BRDNV.js → chunk-MXQQJJNZ.js} +7 -7
  18. package/bundle/{chunk-OANXWSAG.js → chunk-NQXTLK5U.js} +8027 -14705
  19. package/bundle/chunk-NXDIRTLT.js +512 -0
  20. package/bundle/{chunk-GLGFO33Y.js → chunk-O4KOWLVM.js} +17 -2
  21. package/bundle/chunk-OO7JC2QX.js +399635 -0
  22. package/bundle/{chunk-UCLFGIUA.js → chunk-OTWH6H2T.js} +2 -2
  23. package/bundle/{chunk-BCGPZKAR.js → chunk-PBNOO4UX.js} +1 -1
  24. package/bundle/{chunk-6HVPDYWM.js → chunk-SABJGE2G.js} +3 -3
  25. package/bundle/chunk-TFQNPQHU.js +154 -0
  26. package/bundle/{chunk-KUWKDEHW.js → chunk-UEKG6P2N.js} +24 -6
  27. package/bundle/chunk-UST2ZL7P.js +1571 -0
  28. package/bundle/chunk-VSZD56FP.js +102678 -0
  29. package/bundle/{chunk-FH2AJT7C.js → chunk-X63OLHR4.js} +325 -136
  30. package/bundle/chunk-YD7YFB3H.js +398 -0
  31. package/bundle/chunk-ZAUQFML4.js +118 -0
  32. package/bundle/chunk-ZXK7SZMG.js +17368 -0
  33. package/bundle/{cleanup-AM5TUWBB.js → cleanup-DGDWVDXX.js} +2 -2
  34. package/bundle/{cleanup-FLPPBDLV.js → cleanup-ILJI4AEW.js} +2 -2
  35. package/bundle/{cleanup-KI735Y45.js → cleanup-QW4EQ3QR.js} +2 -2
  36. package/bundle/cleanup-R6YFTONK.js +32 -0
  37. package/bundle/{core-R7CF7CQD.js → core-HFCJBVEU.js} +17 -1
  38. package/bundle/{devtoolsService-MA34M6Q7.js → devtoolsService-KXJDH42U.js} +2 -2
  39. package/bundle/{devtoolsService-UUGXHVTK.js → devtoolsService-LWSF6JIT.js} +2 -2
  40. package/bundle/{devtoolsService-WOA7VJLA.js → devtoolsService-N3A5BSJN.js} +4 -3
  41. package/bundle/devtoolsService-N4LL6WGD.js +4359 -0
  42. package/bundle/{dist-VH7RJCTA.js → dist-2BSGBE32.js} +17 -1
  43. package/bundle/{core-F6IWXMFD.js → dist-6YQ35ICZ.js} +17 -1
  44. package/bundle/dist-C4IKSTQN.js +2232 -0
  45. package/bundle/docs/reference/configuration.md +88 -25
  46. package/bundle/{gemini-SRSLV7D2.js → gemini-5UNXMZT3.js} +219 -201
  47. package/bundle/gemini-ATQ3WGVL.js +17764 -0
  48. package/bundle/{gemini-NLU2EPRF.js → gemini-G7D5KPQ2.js} +18 -16
  49. package/bundle/{gemini-N24ID3HC.js → gemini-RWMUQAJ6.js} +18 -16
  50. package/bundle/gemini.js +7 -7
  51. package/bundle/{interactiveCli-SOMGNC7U.js → interactiveCli-EAB7PSHJ.js} +19 -14
  52. package/bundle/{interactiveCli-DDJZ4B26.js → interactiveCli-JYJNFC5D.js} +326 -302
  53. package/bundle/interactiveCli-KQPTYHND.js +35029 -0
  54. package/bundle/{interactiveCli-PNXXOFIE.js → interactiveCli-WC6IXMOE.js} +19 -14
  55. package/bundle/{liteRtServerManager-HDIBGLHN.js → liteRtServerManager-27LLIZ3H.js} +4 -4
  56. package/bundle/{liteRtServerManager-XEOODEAA.js → liteRtServerManager-HB6JSWYM.js} +4 -4
  57. package/bundle/{liteRtServerManager-GW22Q7F4.js → liteRtServerManager-NSPOA7KV.js} +4 -4
  58. package/bundle/liteRtServerManager-WXCFUD52.js +65 -0
  59. package/bundle/{oauth2-provider-ZC45IIOS.js → oauth2-provider-5CXK7KFQ.js} +1 -1
  60. package/bundle/{oauth2-provider-SADAKLZ2.js → oauth2-provider-FYIOQREN.js} +1 -1
  61. package/bundle/{oauth2-provider-347DWYC5.js → oauth2-provider-N7JBWITO.js} +38 -72
  62. package/bundle/oauth2-provider-Z7WSYKBF.js +235 -0
  63. package/bundle/{start-IVH46CBG.js → start-4CI64D6Q.js} +6 -6
  64. package/bundle/{start-PRP35I6V.js → start-MHS6EQUA.js} +6 -6
  65. package/bundle/{start-H7F3LFFN.js → start-OO24SR5D.js} +6 -6
  66. package/bundle/start-WRVCTB7Z.js +18 -0
  67. package/package.json +1 -1
@@ -158,10 +158,10 @@ import {
158
158
  widestLineFromStyledChars,
159
159
  wordBreakStyledChars,
160
160
  wrapStyledChars
161
- } from "./chunk-XL4BRDNV.js";
161
+ } from "./chunk-KXVODVLE.js";
162
162
  import {
163
163
  require_source
164
- } from "./chunk-HGJ3LRCZ.js";
164
+ } from "./chunk-BFB2YEJY.js";
165
165
  import {
166
166
  appEvents
167
167
  } from "./chunk-5PS3AYFU.js";
@@ -215,33 +215,37 @@ import {
215
215
  stripAnsi,
216
216
  stripUnsafeCharacters,
217
217
  toCodePoints
218
- } from "./chunk-GLGFO33Y.js";
218
+ } from "./chunk-UEKG6P2N.js";
219
219
  import {
220
220
  handleAutoUpdate,
221
221
  isDevelopment,
222
222
  relaunchApp,
223
223
  setUpdateHandler
224
- } from "./chunk-UCLFGIUA.js";
224
+ } from "./chunk-FSZD7V6N.js";
225
225
  import {
226
226
  isTodoList,
227
227
  mapCoreStatusToDisplayStatus,
228
228
  require_react
229
- } from "./chunk-ZJHBR7W3.js";
229
+ } from "./chunk-34PFYALD.js";
230
230
  import {
231
231
  registerCleanup,
232
232
  removeCleanup,
233
233
  runExitCleanup,
234
234
  setupTtyCheck
235
- } from "./chunk-DOJZLPDE.js";
235
+ } from "./chunk-GOOJJ7ZQ.js";
236
236
  import {
237
237
  ACTIVATE_SKILL_TOOL_NAME,
238
238
  AGENT_TOOL_NAME,
239
239
  ApiKeyUpdatedEvent,
240
+ ApprovalMode,
240
241
  AsyncFzf,
241
242
  AudioRecorder,
242
243
  AuthType,
243
244
  ChangeAuthRequestedError,
245
+ CompressionStatus,
244
246
  ConversationFinishedEvent,
247
+ CoreEvent,
248
+ CoreToolCallStatus,
245
249
  CreditPurchaseClickEvent,
246
250
  DEFAULT_GEMINI_FLASH_LITE_MODEL,
247
251
  DEFAULT_GEMINI_FLASH_MODEL,
@@ -263,13 +267,20 @@ import {
263
267
  GEMMA_4_31B_IT_MODEL,
264
268
  GLOB_DISPLAY_NAME,
265
269
  GREP_DISPLAY_NAME,
270
+ GeminiCliOperation,
271
+ GeminiEventType,
266
272
  GitService,
267
273
  IdeClient,
274
+ Kind,
268
275
  LS_DISPLAY_NAME,
269
276
  LegacyAgentProtocol,
270
277
  LlmRole,
271
278
  Logger,
272
279
  MAX_TOKENS_EXCEEDED_SUGGESTION,
280
+ MCPDiscoveryState,
281
+ MCPServerStatus,
282
+ MessageBusType,
283
+ MessageSenderType,
273
284
  ModelNotFoundError,
274
285
  ModelSlashCommandEvent,
275
286
  OTHER_BLOCKED_MESSAGE,
@@ -282,6 +293,7 @@ import {
282
293
  PREVIEW_GEMINI_MODEL,
283
294
  PolicyIntegrityManager,
284
295
  ProjectIdRequiredError,
296
+ QuestionType,
285
297
  READ_FILE_DISPLAY_NAME,
286
298
  READ_MANY_FILES_DISPLAY_NAME,
287
299
  RECITATION_BLOCKED_MESSAGE,
@@ -290,16 +302,22 @@ import {
290
302
  SAFETY_BLOCKED_MESSAGE,
291
303
  SHELL_TOOL_NAME,
292
304
  Scheduler,
305
+ SessionEndReason,
306
+ SessionStartSource,
293
307
  ShellExecutionService,
294
308
  SlashCommandStatus,
295
309
  Storage,
310
+ SubagentState,
296
311
  THINKING_ONLY_COMPRESS_SUGGESTION,
297
312
  TOPIC_PARAM_STRATEGIC_INTENT,
298
313
  TOPIC_PARAM_SUMMARY,
299
314
  TOPIC_PARAM_TITLE,
300
315
  TRUE_EMPTY_RESPONSE_MESSAGE,
301
316
  TerminalQuotaError,
317
+ ToolConfirmationOutcome,
318
+ ToolErrorType,
302
319
  TranscriptionFactory,
320
+ TrustLevel,
303
321
  UPDATE_TOPIC_DISPLAY_NAME,
304
322
  UPDATE_TOPIC_TOOL_NAME,
305
323
  UnauthorizedError,
@@ -311,6 +329,7 @@ import {
311
329
  WEB_FETCH_DISPLAY_NAME,
312
330
  WEB_SEARCH_DISPLAY_NAME,
313
331
  WRITE_FILE_DISPLAY_NAME,
332
+ WarningPriority,
314
333
  WhisperModelManager,
315
334
  addMCPStatusChangeListener,
316
335
  allowEditorTypeInSandbox,
@@ -419,7 +438,7 @@ import {
419
438
  validatePlanContent,
420
439
  validatePlanPath,
421
440
  writeToStdout
422
- } from "./chunk-FH2AJT7C.js";
441
+ } from "./chunk-NQXTLK5U.js";
423
442
  import "./chunk-664ZODQF.js";
424
443
  import "./chunk-IUUIT4SU.js";
425
444
  import "./chunk-TUDYL3X4.js";
@@ -5045,7 +5064,7 @@ function calculateShellMaxLines(options) {
5045
5064
  if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
5046
5065
  return maxLinesBasedOnHeight;
5047
5066
  }
5048
- const isExecuting = status === "executing" /* Executing */;
5067
+ const isExecuting = status === CoreToolCallStatus.Executing;
5049
5068
  const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
5050
5069
  return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
5051
5070
  }
@@ -5079,10 +5098,10 @@ function isShellTool(name) {
5079
5098
  return name === SHELL_COMMAND_NAME || name === SHELL_NAME || name === SHELL_TOOL_NAME || normalized === "shell";
5080
5099
  }
5081
5100
  function isThisShellFocusable(name, status, config) {
5082
- return !!(isShellTool(name) && status === "executing" /* Executing */ && config?.getEnableInteractiveShell());
5101
+ return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && config?.getEnableInteractiveShell());
5083
5102
  }
5084
5103
  function isThisShellFocused(name, status, ptyId, activeShellPtyId, embeddedShellFocused) {
5085
- return !!(isShellTool(name) && status === "executing" /* Executing */ && ptyId === activeShellPtyId && embeddedShellFocused);
5104
+ return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && ptyId === activeShellPtyId && embeddedShellFocused);
5086
5105
  }
5087
5106
  function useFocusHint(isThisShellFocusable2, isThisShellFocused2, resultDisplay) {
5088
5107
  const [userHasFocused, setUserHasFocused] = (0, import_react9.useState)(false);
@@ -5242,13 +5261,13 @@ var formatToolArgs = (args) => {
5242
5261
  var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) => {
5243
5262
  let headerText;
5244
5263
  let headerColor = theme.text.secondary;
5245
- if (progress.state === "cancelled" /* CANCELLED */) {
5264
+ if (progress.state === SubagentState.CANCELLED) {
5246
5265
  headerText = `Subagent ${progress.agentName} was cancelled.`;
5247
5266
  headerColor = theme.status.warning;
5248
- } else if (progress.state === "error" /* ERROR */) {
5267
+ } else if (progress.state === SubagentState.ERROR) {
5249
5268
  headerText = `Subagent ${progress.agentName} failed.`;
5250
5269
  headerColor = theme.status.error;
5251
- } else if (progress.state === "completed" /* COMPLETED */) {
5270
+ } else if (progress.state === SubagentState.COMPLETED) {
5252
5271
  headerText = `Subagent ${progress.agentName} completed.`;
5253
5272
  headerColor = theme.status.success;
5254
5273
  } else {
@@ -5268,7 +5287,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5268
5287
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color, children: item.content }) })
5269
5288
  ] }, item.id);
5270
5289
  } else if (item.type === "tool_call") {
5271
- const statusSymbol = item.status === "running" /* RUNNING */ ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(build_default, { type: "dots" }) : item.status === "completed" /* COMPLETED */ ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.success, children: TOOL_STATUS.SUCCESS }) : item.status === "cancelled" /* CANCELLED */ ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.warning, bold: true, children: TOOL_STATUS.CANCELED }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.error, children: TOOL_STATUS.ERROR });
5290
+ const statusSymbol = item.status === SubagentState.RUNNING ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(build_default, { type: "dots" }) : item.status === SubagentState.COMPLETED ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.success, children: TOOL_STATUS.SUCCESS }) : item.status === SubagentState.CANCELLED ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.warning, bold: true, children: TOOL_STATUS.CANCELED }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.error, children: TOOL_STATUS.ERROR });
5272
5291
  const formattedArgs = item.description || formatToolArgs(item.args);
5273
5292
  const displayArgs = formattedArgs.length > 60 ? formattedArgs.slice(0, 60) + "..." : formattedArgs;
5274
5293
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box_default, { flexDirection: "row", children: [
@@ -5279,7 +5298,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5279
5298
  {
5280
5299
  bold: true,
5281
5300
  color: theme.text.primary,
5282
- strikethrough: item.status === "cancelled" /* CANCELLED */,
5301
+ strikethrough: item.status === SubagentState.CANCELLED,
5283
5302
  children: item.displayName || item.content
5284
5303
  }
5285
5304
  ),
@@ -5288,7 +5307,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5288
5307
  {
5289
5308
  color: theme.text.secondary,
5290
5309
  wrap: "truncate",
5291
- strikethrough: item.status === "cancelled" /* CANCELLED */,
5310
+ strikethrough: item.status === SubagentState.CANCELLED,
5292
5311
  children: displayArgs
5293
5312
  }
5294
5313
  ) })
@@ -5308,7 +5327,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5308
5327
  MarkdownDisplay,
5309
5328
  {
5310
5329
  text: safeJsonToMarkdown(progress.result),
5311
- isPending: progress.state !== "completed" /* COMPLETED */,
5330
+ isPending: progress.state !== SubagentState.COMPLETED,
5312
5331
  terminalWidth
5313
5332
  }
5314
5333
  )
@@ -5663,14 +5682,14 @@ var ToolActionsProvider = (props) => {
5663
5682
  }
5664
5683
  const details = tool.confirmationDetails;
5665
5684
  if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
5666
- const cliOutcome = outcome === "cancel" /* Cancel */ ? "rejected" : "accepted";
5685
+ const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? "rejected" : "accepted";
5667
5686
  await ideClient?.resolveDiffFromCli(details.filePath, cliOutcome);
5668
5687
  }
5669
5688
  if (tool.correlationId) {
5670
5689
  await config.getMessageBus().publish({
5671
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
5690
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
5672
5691
  correlationId: tool.correlationId,
5673
- confirmed: outcome !== "cancel" /* Cancel */,
5692
+ confirmed: outcome !== ToolConfirmationOutcome.Cancel,
5674
5693
  requiresUserConfirmation: false,
5675
5694
  outcome,
5676
5695
  payload
@@ -5689,7 +5708,7 @@ var ToolActionsProvider = (props) => {
5689
5708
  );
5690
5709
  const cancel = (0, import_react12.useCallback)(
5691
5710
  async (callId) => {
5692
- await confirm(callId, "cancel" /* Cancel */);
5711
+ await confirm(callId, ToolConfirmationOutcome.Cancel);
5693
5712
  },
5694
5713
  [confirm]
5695
5714
  );
@@ -5808,7 +5827,7 @@ var ToolMessage = ({
5808
5827
  paddingX: 1,
5809
5828
  flexDirection: "column",
5810
5829
  children: [
5811
- status === "executing" /* Executing */ && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5830
+ status === CoreToolCallStatus.Executing && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5812
5831
  McpProgressIndicator,
5813
5832
  {
5814
5833
  progress,
@@ -5825,8 +5844,8 @@ var ToolMessage = ({
5825
5844
  terminalWidth,
5826
5845
  renderOutputAsMarkdown,
5827
5846
  hasFocus: isThisShellFocused2,
5828
- maxLines: kind === "agent" /* Agent */ && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
5829
- overflowDirection: kind === "agent" /* Agent */ ? "bottom" : "top"
5847
+ maxLines: kind === Kind.Agent && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
5848
+ overflowDirection: kind === Kind.Agent ? "bottom" : "top"
5830
5849
  }
5831
5850
  ),
5832
5851
  isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
@@ -6142,7 +6161,7 @@ function getInitialTrustState(settings, cwd5, isCurrentWorkspace) {
6142
6161
  settings.merged,
6143
6162
  process3.cwd()
6144
6163
  );
6145
- const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === "DO_NOT_TRUST" /* DO_NOT_TRUST */);
6164
+ const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === TrustLevel.DO_NOT_TRUST);
6146
6165
  return {
6147
6166
  currentTrustLevel: explicitTrustLevel,
6148
6167
  isInheritedTrustFromParent: !!(source === "file" && isInheritedTrust),
@@ -6187,7 +6206,7 @@ var usePermissionsModifyTrust = (onExit, addItem, targetDirectory) => {
6187
6206
  process3.cwd(),
6188
6207
  newConfig
6189
6208
  );
6190
- if (trustLevel === "DO_NOT_TRUST" /* DO_NOT_TRUST */ && isTrusted) {
6209
+ if (trustLevel === TrustLevel.DO_NOT_TRUST && isTrusted) {
6191
6210
  let message = "Note: This folder is still trusted because the connected IDE workspace is trusted.";
6192
6211
  if (source === "file") {
6193
6212
  message = "Note: This folder is still trusted because a parent folder is trusted.";
@@ -6261,18 +6280,18 @@ function PermissionsModifyTrustDialog({
6261
6280
  const TRUST_LEVEL_ITEMS = [
6262
6281
  {
6263
6282
  label: `Trust this folder (${dirName})`,
6264
- value: "TRUST_FOLDER" /* TRUST_FOLDER */,
6265
- key: "TRUST_FOLDER" /* TRUST_FOLDER */
6283
+ value: TrustLevel.TRUST_FOLDER,
6284
+ key: TrustLevel.TRUST_FOLDER
6266
6285
  },
6267
6286
  {
6268
6287
  label: `Trust parent folder (${parentFolder})`,
6269
- value: "TRUST_PARENT" /* TRUST_PARENT */,
6270
- key: "TRUST_PARENT" /* TRUST_PARENT */
6288
+ value: TrustLevel.TRUST_PARENT,
6289
+ key: TrustLevel.TRUST_PARENT
6271
6290
  },
6272
6291
  {
6273
6292
  label: "Don't trust",
6274
- value: "DO_NOT_TRUST" /* DO_NOT_TRUST */,
6275
- key: "DO_NOT_TRUST" /* DO_NOT_TRUST */
6293
+ value: TrustLevel.DO_NOT_TRUST,
6294
+ key: TrustLevel.DO_NOT_TRUST
6276
6295
  }
6277
6296
  ];
6278
6297
  const {
@@ -6512,7 +6531,7 @@ var ShellToolMessage = ({
6512
6531
  maxLinesLimit: maxLines
6513
6532
  });
6514
6533
  import_react17.default.useEffect(() => {
6515
- const isExecuting = status === "executing" /* Executing */;
6534
+ const isExecuting = status === CoreToolCallStatus.Executing;
6516
6535
  if (isExecuting && ptyId) {
6517
6536
  try {
6518
6537
  const childWidth = terminalWidth - 4;
@@ -6725,13 +6744,13 @@ var SubagentGroupDisplay = ({
6725
6744
  const singleAgent = toolCalls[0].resultDisplay;
6726
6745
  if (isSubagentProgress(singleAgent)) {
6727
6746
  switch (singleAgent.state) {
6728
- case "completed" /* COMPLETED */:
6747
+ case SubagentState.COMPLETED:
6729
6748
  headerText = "Agent Completed";
6730
6749
  break;
6731
- case "cancelled" /* CANCELLED */:
6750
+ case SubagentState.CANCELLED:
6732
6751
  headerText = "Agent Cancelled";
6733
6752
  break;
6734
- case "error" /* ERROR */:
6753
+ case SubagentState.ERROR:
6735
6754
  headerText = "Agent Error";
6736
6755
  break;
6737
6756
  default:
@@ -6747,8 +6766,8 @@ var SubagentGroupDisplay = ({
6747
6766
  for (const tc of toolCalls) {
6748
6767
  const progress = tc.resultDisplay;
6749
6768
  if (isSubagentProgress(progress)) {
6750
- if (progress.state === "completed" /* COMPLETED */) completedCount++;
6751
- else if (progress.state === "running" /* RUNNING */) runningCount++;
6769
+ if (progress.state === SubagentState.COMPLETED) completedCount++;
6770
+ else if (progress.state === SubagentState.RUNNING) runningCount++;
6752
6771
  } else {
6753
6772
  runningCount++;
6754
6773
  }
@@ -6827,7 +6846,7 @@ var SubagentGroupDisplay = ({
6827
6846
  if (!isExpanded) {
6828
6847
  let content = "Starting...";
6829
6848
  let formattedArgs;
6830
- if (progress.state === "completed" /* COMPLETED */) {
6849
+ if (progress.state === SubagentState.COMPLETED) {
6831
6850
  if (progress.terminateReason && progress.terminateReason !== "GOAL") {
6832
6851
  content = `Finished Early (${progress.terminateReason})`;
6833
6852
  } else {
@@ -6841,17 +6860,17 @@ var SubagentGroupDisplay = ({
6841
6860
  formattedArgs = formatToolArgs(lastActivity.args);
6842
6861
  }
6843
6862
  }
6844
- const displayArgs = progress.state === "completed" /* COMPLETED */ ? "" : formattedArgs;
6863
+ const displayArgs = progress.state === SubagentState.COMPLETED ? "" : formattedArgs;
6845
6864
  const renderStatusIcon = () => {
6846
- const state = progress.state ?? "running" /* RUNNING */;
6865
+ const state = progress.state ?? SubagentState.RUNNING;
6847
6866
  switch (state) {
6848
- case "running" /* RUNNING */:
6867
+ case SubagentState.RUNNING:
6849
6868
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.text.primary, children: "!" });
6850
- case "completed" /* COMPLETED */:
6869
+ case SubagentState.COMPLETED:
6851
6870
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.success, children: "\u2713" });
6852
- case "cancelled" /* CANCELLED */:
6871
+ case SubagentState.CANCELLED:
6853
6872
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.warning, children: "\u2139" });
6854
- case "error" /* ERROR */:
6873
+ case SubagentState.ERROR:
6855
6874
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.error, children: "\u2717" });
6856
6875
  default:
6857
6876
  return checkExhaustive(state);
@@ -6904,22 +6923,22 @@ var hasPayload = (res) => {
6904
6923
  function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerminalHeight, isClickable) {
6905
6924
  const added = (diff.diffStat?.model_added_lines ?? 0) + (diff.diffStat?.user_added_lines ?? 0);
6906
6925
  const removed = (diff.diffStat?.model_removed_lines ?? 0) + (diff.diffStat?.user_removed_lines ?? 0);
6907
- const isAcceptedOrConfirming = status === "success" /* Success */ || status === "executing" /* Executing */ || status === "awaiting_approval" /* AwaitingApproval */;
6926
+ const isAcceptedOrConfirming = status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing || status === CoreToolCallStatus.AwaitingApproval;
6908
6927
  const addColor = isAcceptedOrConfirming ? theme.status.success : theme.text.secondary;
6909
6928
  const removeColor = isAcceptedOrConfirming ? theme.status.error : theme.text.secondary;
6910
6929
  const showDiffStat = !!diff.diffStat;
6911
6930
  const description = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box_default, { flexDirection: "row", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: theme.text.secondary, wrap: "truncate-end", children: diff.fileName }) });
6912
6931
  let resultSummary = "";
6913
6932
  let resultColor = theme.text.secondary;
6914
- if (status === "awaiting_approval" /* AwaitingApproval */) {
6933
+ if (status === CoreToolCallStatus.AwaitingApproval) {
6915
6934
  resultSummary = "Confirming";
6916
- } else if (status === "success" /* Success */ || status === "executing" /* Executing */) {
6935
+ } else if (status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing) {
6917
6936
  resultSummary = "Accepted";
6918
6937
  resultColor = theme.text.accent;
6919
- } else if (status === "cancelled" /* Cancelled */) {
6938
+ } else if (status === CoreToolCallStatus.Cancelled) {
6920
6939
  resultSummary = "Rejected";
6921
6940
  resultColor = theme.status.error;
6922
- } else if (status === "error" /* Error */) {
6941
+ } else if (status === CoreToolCallStatus.Error) {
6923
6942
  resultSummary = typeof resultDisplay === "string" ? resultDisplay : "Failed";
6924
6943
  resultColor = theme.status.error;
6925
6944
  }
@@ -6950,7 +6969,7 @@ function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerm
6950
6969
  filename: diff.fileName,
6951
6970
  terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
6952
6971
  availableTerminalHeight,
6953
- disableColor: status === "cancelled" /* Cancelled */
6972
+ disableColor: status === CoreToolCallStatus.Cancelled
6954
6973
  }
6955
6974
  );
6956
6975
  return { description, summary, payload };
@@ -7078,10 +7097,10 @@ var DenseToolMessage = (props) => {
7078
7097
  if (isGrepResult(resultDisplay)) {
7079
7098
  return getGenericSuccessData(resultDisplay, originalDescription);
7080
7099
  }
7081
- if (status === "success" /* Success */ && resultDisplay) {
7100
+ if (status === CoreToolCallStatus.Success && resultDisplay) {
7082
7101
  return getGenericSuccessData(resultDisplay, originalDescription);
7083
7102
  }
7084
- if (status === "error" /* Error */) {
7103
+ if (status === CoreToolCallStatus.Error) {
7085
7104
  const text = typeof resultDisplay === "string" ? resultDisplay.replace(/\n/g, " ") : "Failed";
7086
7105
  const errorSummary = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: theme.status.error, wrap: "truncate-end", children: [
7087
7106
  "\u2192 ",
@@ -7122,7 +7141,7 @@ var DenseToolMessage = (props) => {
7122
7141
  language: fileExtension,
7123
7142
  maxWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
7124
7143
  settings,
7125
- disableColor: status === "cancelled" /* Cancelled */,
7144
+ disableColor: status === CoreToolCallStatus.Cancelled,
7126
7145
  returnLines: true
7127
7146
  });
7128
7147
  } else {
@@ -7130,7 +7149,7 @@ var DenseToolMessage = (props) => {
7130
7149
  parsedLines,
7131
7150
  filename: diff.fileName,
7132
7151
  terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
7133
- disableColor: status === "cancelled" /* Cancelled */
7152
+ disableColor: status === CoreToolCallStatus.Cancelled
7134
7153
  });
7135
7154
  }
7136
7155
  }, [diff, isExpanded, isAlternateBuffer, terminalWidth, settings, status]);
@@ -7260,7 +7279,7 @@ function isToolExecuting(pendingHistoryItems) {
7260
7279
  return pendingHistoryItems.some((item) => {
7261
7280
  if (item && item.type === "tool_group") {
7262
7281
  return item.tools.some(
7263
- (tool) => "executing" /* Executing */ === tool.status
7282
+ (tool) => CoreToolCallStatus.Executing === tool.status
7264
7283
  );
7265
7284
  }
7266
7285
  return false;
@@ -7269,7 +7288,7 @@ function isToolExecuting(pendingHistoryItems) {
7269
7288
  function isToolAwaitingConfirmation(pendingHistoryItems) {
7270
7289
  return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
7271
7290
  (item) => item.tools.some(
7272
- (tool) => "awaiting_approval" /* AwaitingApproval */ === tool.status
7291
+ (tool) => CoreToolCallStatus.AwaitingApproval === tool.status
7273
7292
  )
7274
7293
  );
7275
7294
  }
@@ -7292,14 +7311,14 @@ function getToolGroupBorderAppearance(item, activeShellPtyId, embeddedShellFocus
7292
7311
  if (isTrackedToolCall(t)) {
7293
7312
  return t.status !== "success" && t.status !== "error" && t.status !== "cancelled";
7294
7313
  } else {
7295
- return t.status !== "success" /* Success */ && t.status !== "error" /* Error */ && t.status !== "cancelled" /* Cancelled */;
7314
+ return t.status !== CoreToolCallStatus.Success && t.status !== CoreToolCallStatus.Error && t.status !== CoreToolCallStatus.Cancelled;
7296
7315
  }
7297
7316
  });
7298
7317
  const isEmbeddedShellFocused = toolsToInspect.some((t) => {
7299
7318
  if (isTrackedToolCall(t)) {
7300
7319
  return isShellTool(t.request.name) && t.status === "executing" && t.pid === activeShellPtyId && !!embeddedShellFocused;
7301
7320
  } else {
7302
- return isShellTool(t.name) && t.status === "executing" /* Executing */ && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
7321
+ return isShellTool(t.name) && t.status === CoreToolCallStatus.Executing && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
7303
7322
  }
7304
7323
  });
7305
7324
  const isShellCommand = toolsToInspect.some((t) => {
@@ -7398,7 +7417,7 @@ var ToolGroupMessage = ({
7398
7417
  const groupedTools = (0, import_react21.useMemo)(() => {
7399
7418
  const groups = [];
7400
7419
  for (const tool of visibleToolCalls) {
7401
- if (tool.kind === "agent" /* Agent */) {
7420
+ if (tool.kind === Kind.Agent) {
7402
7421
  const lastGroup = groups[groups.length - 1];
7403
7422
  if (Array.isArray(lastGroup)) {
7404
7423
  lastGroup.push(tool);
@@ -7453,7 +7472,7 @@ var ToolGroupMessage = ({
7453
7472
  }, [groupedTools, isCompactModeEnabled, borderTopOverride]);
7454
7473
  let countToolCallsWithResults = 0;
7455
7474
  for (const tool of visibleToolCalls) {
7456
- if (tool.kind !== "agent" /* Agent */) {
7475
+ if (tool.kind !== Kind.Agent) {
7457
7476
  if (isCompactTool(tool, isCompactModeEnabled)) {
7458
7477
  if (hasDensePayload(tool)) {
7459
7478
  countToolCallsWithResults++;
@@ -7627,7 +7646,7 @@ var ToolGroupDisplay = ({
7627
7646
  }
7628
7647
  const { tools, borderColor, borderDimColor, borderTop, borderBottom } = item;
7629
7648
  const visibleTools = tools.filter(
7630
- (t) => t.status !== "awaiting_approval" /* AwaitingApproval */
7649
+ (t) => t.status !== CoreToolCallStatus.AwaitingApproval
7631
7650
  );
7632
7651
  const noticeTools = visibleTools.filter((t) => t.format === "notice");
7633
7652
  const otherTools = visibleTools.filter(
@@ -7829,18 +7848,18 @@ function CompressionMessage({
7829
7848
  return "Compressing chat history";
7830
7849
  }
7831
7850
  switch (compressionStatus) {
7832
- case 1 /* COMPRESSED */:
7851
+ case CompressionStatus.COMPRESSED:
7833
7852
  return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
7834
- case 2 /* COMPRESSION_FAILED_INFLATED_TOKEN_COUNT */:
7853
+ case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
7835
7854
  if (originalTokens < 5e4) {
7836
7855
  return "Compression was not beneficial for this history size.";
7837
7856
  }
7838
7857
  return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
7839
- case 3 /* COMPRESSION_FAILED_TOKEN_COUNT_ERROR */:
7858
+ case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
7840
7859
  return "Could not compress chat history due to a token counting error.";
7841
- case 4 /* COMPRESSION_FAILED_EMPTY_SUMMARY */:
7860
+ case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
7842
7861
  return "Chat history compression failed: the model returned an empty summary.";
7843
- case 5 /* NOOP */:
7862
+ case CompressionStatus.NOOP:
7844
7863
  return "Nothing to compress.";
7845
7864
  default:
7846
7865
  return "";
@@ -8278,8 +8297,8 @@ var ModelUsageTable = ({ models }) => {
8278
8297
  );
8279
8298
  roleEntries.sort(([a], [b]) => {
8280
8299
  if (a === b) return 0;
8281
- if (a === "main" /* MAIN */) return -1;
8282
- if (b === "main" /* MAIN */) return 1;
8300
+ if (a === LlmRole.MAIN) return -1;
8301
+ if (b === LlmRole.MAIN) return 1;
8283
8302
  return a.localeCompare(b);
8284
8303
  });
8285
8304
  roleEntries.forEach(([role, roleMetrics]) => {
@@ -8610,8 +8629,8 @@ var ModelStatsDisplay = ({
8610
8629
  return validRoles.includes(role);
8611
8630
  }).sort((a, b) => {
8612
8631
  if (a === b) return 0;
8613
- if (a === "main" /* MAIN */) return -1;
8614
- if (b === "main" /* MAIN */) return 1;
8632
+ if (a === LlmRole.MAIN) return -1;
8633
+ if (b === LlmRole.MAIN) return 1;
8615
8634
  return a.localeCompare(b);
8616
8635
  });
8617
8636
  const createRow = (metric, getValue, options = {}) => {
@@ -9402,7 +9421,7 @@ var McpStatus = ({
9402
9421
  );
9403
9422
  const originalStatus = serverStatus(serverName);
9404
9423
  const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
9405
- const status = originalStatus === "disconnected" /* DISCONNECTED */ && hasCachedItems ? "connected" /* CONNECTED */ : originalStatus;
9424
+ const status = originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems ? MCPServerStatus.CONNECTED : originalStatus;
9406
9425
  let statusIndicator = "";
9407
9426
  let statusText = "";
9408
9427
  let statusColor = theme.text.primary;
@@ -9414,17 +9433,17 @@ var McpStatus = ({
9414
9433
  statusColor = theme.text.secondary;
9415
9434
  } else {
9416
9435
  switch (status) {
9417
- case "connected" /* CONNECTED */:
9436
+ case MCPServerStatus.CONNECTED:
9418
9437
  statusIndicator = "\u{1F7E2}";
9419
9438
  statusText = "Ready";
9420
9439
  statusColor = theme.status.success;
9421
9440
  break;
9422
- case "connecting" /* CONNECTING */:
9441
+ case MCPServerStatus.CONNECTING:
9423
9442
  statusIndicator = "\u{1F504}";
9424
9443
  statusText = "Starting... (first startup may take longer)";
9425
9444
  statusColor = theme.status.warning;
9426
9445
  break;
9427
- case "disconnected" /* DISCONNECTED */:
9446
+ case MCPServerStatus.DISCONNECTED:
9428
9447
  default:
9429
9448
  statusIndicator = "\u{1F534}";
9430
9449
  statusText = "Disconnected";
@@ -9472,12 +9491,12 @@ var McpStatus = ({
9472
9491
  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
9473
9492
  " - ",
9474
9493
  statusText,
9475
- status === "connected" /* CONNECTED */ && parts.length > 0 && ` (${parts.join(", ")})`
9494
+ status === MCPServerStatus.CONNECTED && parts.length > 0 && ` (${parts.join(", ")})`
9476
9495
  ] }),
9477
9496
  authStatusNode
9478
9497
  ] }),
9479
- status === "connecting" /* CONNECTING */ && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
9480
- status === "disconnected" /* DISCONNECTED */ && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
9498
+ status === MCPServerStatus.CONNECTING && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
9499
+ status === MCPServerStatus.DISCONNECTED && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
9481
9500
  " (",
9482
9501
  toolCount,
9483
9502
  " tools cached)"
@@ -10038,7 +10057,7 @@ var Notifications = () => {
10038
10057
  if (dismissed) return [];
10039
10058
  const counts = persistentState.get("startupWarningCounts") || {};
10040
10059
  return startupWarnings.filter((w) => {
10041
- if (w.priority === "low" /* Low */) {
10060
+ if (w.priority === WarningPriority.Low) {
10042
10061
  const count = counts[w.id] || 0;
10043
10062
  return count < MAX_STARTUP_WARNING_SHOW_COUNT;
10044
10063
  }
@@ -10051,7 +10070,7 @@ var Notifications = () => {
10051
10070
  const counts = { ...persistentState.get("startupWarningCounts") || {} };
10052
10071
  let changed = false;
10053
10072
  visibleWarnings.forEach((w) => {
10054
- if (w.priority === "low" /* Low */) {
10073
+ if (w.priority === WarningPriority.Low) {
10055
10074
  counts[w.id] = (counts[w.id] || 0) + 1;
10056
10075
  changed = true;
10057
10076
  }
@@ -10158,7 +10177,7 @@ var UserIdentity = ({ config }) => {
10158
10177
  }
10159
10178
  return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { flexDirection: "column", children: [
10160
10179
  /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { children: [
10161
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { children: [
10180
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType === AuthType.LOGIN_WITH_GOOGLE ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { children: [
10162
10181
  /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { bold: true, children: [
10163
10182
  "Signed in with Google",
10164
10183
  email ? ":" : ""
@@ -10401,7 +10420,7 @@ var import_react32 = __toESM(require_react(), 1);
10401
10420
  function getConfirmingToolState(pendingHistoryItems) {
10402
10421
  const allPendingTools = getAllToolCalls(pendingHistoryItems);
10403
10422
  const confirmingTools = allPendingTools.filter(
10404
- (tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
10423
+ (tool) => tool.status === CoreToolCallStatus.AwaitingApproval
10405
10424
  );
10406
10425
  if (confirmingTools.length === 0) {
10407
10426
  return null;
@@ -11710,7 +11729,7 @@ var ExitPlanModeDialog = ({
11710
11729
  {
11711
11730
  questions: [
11712
11731
  {
11713
- type: "choice" /* CHOICE */,
11732
+ type: QuestionType.CHOICE,
11714
11733
  header: "Approval",
11715
11734
  question: planContent,
11716
11735
  options: [
@@ -11731,9 +11750,9 @@ var ExitPlanModeDialog = ({
11731
11750
  onSubmit: (answers) => {
11732
11751
  const answer = answers["0"];
11733
11752
  if (answer === "Yes, automatically accept edits" /* Auto */) {
11734
- onApprove("autoEdit" /* AUTO_EDIT */);
11753
+ onApprove(ApprovalMode.AUTO_EDIT);
11735
11754
  } else if (answer === "Yes, manually accept edits" /* Manual */) {
11736
- onApprove("default" /* DEFAULT */);
11755
+ onApprove(ApprovalMode.DEFAULT);
11737
11756
  } else if (answer) {
11738
11757
  onFeedback(answer);
11739
11758
  }
@@ -11944,7 +11963,7 @@ ${deceptiveUrlWarnings.map(
11944
11963
  );
11945
11964
  (0, import_react37.useEffect)(() => {
11946
11965
  if (isCancelling) {
11947
- handleConfirm("cancel" /* Cancel */);
11966
+ handleConfirm(ToolConfirmationOutcome.Cancel);
11948
11967
  }
11949
11968
  }, [isCancelling, handleConfirm]);
11950
11969
  const handleSelect = (0, import_react37.useCallback)(
@@ -11957,19 +11976,19 @@ ${deceptiveUrlWarnings.map(
11957
11976
  if (!confirmationDetails.isModifying) {
11958
11977
  options2.push({
11959
11978
  label: "Allow once",
11960
- value: "proceed_once" /* ProceedOnce */,
11979
+ value: ToolConfirmationOutcome.ProceedOnce,
11961
11980
  key: "Allow once"
11962
11981
  });
11963
11982
  if (isTrustedFolder && !confirmationDetails.isBuildFile) {
11964
11983
  options2.push({
11965
11984
  label: "Allow for this session",
11966
- value: "proceed_always" /* ProceedAlways */,
11985
+ value: ToolConfirmationOutcome.ProceedAlways,
11967
11986
  key: "Allow for this session"
11968
11987
  });
11969
11988
  if (allowPermanentApproval) {
11970
11989
  options2.push({
11971
11990
  label: "Allow for this file in all future sessions",
11972
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
11991
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
11973
11992
  key: "Allow for this file in all future sessions"
11974
11993
  });
11975
11994
  }
@@ -11977,45 +11996,45 @@ ${deceptiveUrlWarnings.map(
11977
11996
  if (!config.getIdeMode() || !isDiffingEnabled) {
11978
11997
  options2.push({
11979
11998
  label: "Modify with external editor",
11980
- value: "modify_with_editor" /* ModifyWithEditor */,
11999
+ value: ToolConfirmationOutcome.ModifyWithEditor,
11981
12000
  key: "Modify with external editor"
11982
12001
  });
11983
12002
  }
11984
12003
  options2.push({
11985
12004
  label: "No, suggest changes (esc)",
11986
- value: "cancel" /* Cancel */,
12005
+ value: ToolConfirmationOutcome.Cancel,
11987
12006
  key: "No, suggest changes (esc)"
11988
12007
  });
11989
12008
  }
11990
12009
  } else if (confirmationDetails.type === "sandbox_expansion") {
11991
12010
  options2.push({
11992
12011
  label: "Allow once",
11993
- value: "proceed_once" /* ProceedOnce */,
12012
+ value: ToolConfirmationOutcome.ProceedOnce,
11994
12013
  key: "Allow once"
11995
12014
  });
11996
12015
  if (isTrustedFolder) {
11997
12016
  options2.push({
11998
12017
  label: "Allow for this session",
11999
- value: "proceed_always" /* ProceedAlways */,
12018
+ value: ToolConfirmationOutcome.ProceedAlways,
12000
12019
  key: "Allow for this session"
12001
12020
  });
12002
12021
  if (allowPermanentApproval) {
12003
12022
  options2.push({
12004
12023
  label: "Allow for all future sessions",
12005
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12024
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12006
12025
  key: "Allow for all future sessions"
12007
12026
  });
12008
12027
  }
12009
12028
  }
12010
12029
  options2.push({
12011
12030
  label: "No, suggest changes (esc)",
12012
- value: "cancel" /* Cancel */,
12031
+ value: ToolConfirmationOutcome.Cancel,
12013
12032
  key: "No, suggest changes (esc)"
12014
12033
  });
12015
12034
  } else if (confirmationDetails.type === "exec") {
12016
12035
  options2.push({
12017
12036
  label: "Allow once",
12018
- value: "proceed_once" /* ProceedOnce */,
12037
+ value: ToolConfirmationOutcome.ProceedOnce,
12019
12038
  key: "Allow once"
12020
12039
  });
12021
12040
  const hasUntrustedFlags = confirmationDetails.untrustedFlags && confirmationDetails.untrustedFlags.length > 0;
@@ -12023,75 +12042,75 @@ ${deceptiveUrlWarnings.map(
12023
12042
  if (isTrustedFolder && !hasUntrustedFlags && !hasModifiedBuildFiles) {
12024
12043
  options2.push({
12025
12044
  label: `Allow for this session`,
12026
- value: "proceed_always" /* ProceedAlways */,
12045
+ value: ToolConfirmationOutcome.ProceedAlways,
12027
12046
  key: `Allow for this session`
12028
12047
  });
12029
12048
  if (allowPermanentApproval) {
12030
12049
  options2.push({
12031
12050
  label: `Allow this command for all future sessions`,
12032
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12051
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12033
12052
  key: `Allow for all future sessions`
12034
12053
  });
12035
12054
  }
12036
12055
  }
12037
12056
  options2.push({
12038
12057
  label: "No, suggest changes (esc)",
12039
- value: "cancel" /* Cancel */,
12058
+ value: ToolConfirmationOutcome.Cancel,
12040
12059
  key: "No, suggest changes (esc)"
12041
12060
  });
12042
12061
  } else if (confirmationDetails.type === "info") {
12043
12062
  options2.push({
12044
12063
  label: "Allow once",
12045
- value: "proceed_once" /* ProceedOnce */,
12064
+ value: ToolConfirmationOutcome.ProceedOnce,
12046
12065
  key: "Allow once"
12047
12066
  });
12048
12067
  if (isTrustedFolder) {
12049
12068
  options2.push({
12050
12069
  label: "Allow for this session",
12051
- value: "proceed_always" /* ProceedAlways */,
12070
+ value: ToolConfirmationOutcome.ProceedAlways,
12052
12071
  key: "Allow for this session"
12053
12072
  });
12054
12073
  if (allowPermanentApproval) {
12055
12074
  options2.push({
12056
12075
  label: "Allow for all future sessions",
12057
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12076
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12058
12077
  key: "Allow for all future sessions"
12059
12078
  });
12060
12079
  }
12061
12080
  }
12062
12081
  options2.push({
12063
12082
  label: "No, suggest changes (esc)",
12064
- value: "cancel" /* Cancel */,
12083
+ value: ToolConfirmationOutcome.Cancel,
12065
12084
  key: "No, suggest changes (esc)"
12066
12085
  });
12067
12086
  } else if (confirmationDetails.type === "mcp") {
12068
12087
  options2.push({
12069
12088
  label: "Allow once",
12070
- value: "proceed_once" /* ProceedOnce */,
12089
+ value: ToolConfirmationOutcome.ProceedOnce,
12071
12090
  key: "Allow once"
12072
12091
  });
12073
12092
  if (isTrustedFolder) {
12074
12093
  options2.push({
12075
12094
  label: "Allow tool for this session",
12076
- value: "proceed_always_tool" /* ProceedAlwaysTool */,
12095
+ value: ToolConfirmationOutcome.ProceedAlwaysTool,
12077
12096
  key: "Allow tool for this session"
12078
12097
  });
12079
12098
  options2.push({
12080
12099
  label: "Allow all server tools for this session",
12081
- value: "proceed_always_server" /* ProceedAlwaysServer */,
12100
+ value: ToolConfirmationOutcome.ProceedAlwaysServer,
12082
12101
  key: "Allow all server tools for this session"
12083
12102
  });
12084
12103
  if (allowPermanentApproval) {
12085
12104
  options2.push({
12086
12105
  label: "Allow tool for all future sessions",
12087
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12106
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12088
12107
  key: "Allow tool for all future sessions"
12089
12108
  });
12090
12109
  }
12091
12110
  }
12092
12111
  options2.push({
12093
12112
  label: "No, suggest changes (esc)",
12094
- value: "cancel" /* Cancel */,
12113
+ value: ToolConfirmationOutcome.Cancel,
12095
12114
  key: "No, suggest changes (esc)"
12096
12115
  });
12097
12116
  }
@@ -12132,7 +12151,7 @@ ${deceptiveUrlWarnings.map(
12132
12151
  const containsRedirection = commandsToDisplay.some(
12133
12152
  (cmd) => hasRedirection(cmd)
12134
12153
  );
12135
- const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
12154
+ const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
12136
12155
  if (containsRedirection && !isAutoEdit) {
12137
12156
  extraInfoLines = 1;
12138
12157
  }
@@ -12159,7 +12178,7 @@ ${deceptiveUrlWarnings.map(
12159
12178
  const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
12160
12179
  if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
12161
12180
  const alwaysAndSaveIndex = options2.findIndex(
12162
- (o) => o.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */
12181
+ (o) => o.value === ToolConfirmationOutcome.ProceedAlwaysAndSave
12163
12182
  );
12164
12183
  if (alwaysAndSaveIndex !== -1) {
12165
12184
  initialIndex2 = alwaysAndSaveIndex;
@@ -12208,10 +12227,10 @@ Ensure you trust all modifications made to build files before approving executio
12208
12227
  {
12209
12228
  questions: confirmationDetails.questions,
12210
12229
  onSubmit: (answers) => {
12211
- handleConfirm("proceed_once" /* ProceedOnce */, { answers });
12230
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, { answers });
12212
12231
  },
12213
12232
  onCancel: () => {
12214
- handleConfirm("cancel" /* Cancel */);
12233
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12215
12234
  },
12216
12235
  width: terminalWidth,
12217
12236
  availableHeight: bodyHeight
@@ -12232,19 +12251,19 @@ Ensure you trust all modifications made to build files before approving executio
12232
12251
  planPath: confirmationDetails.planPath,
12233
12252
  getPreferredEditor,
12234
12253
  onApprove: (approvalMode) => {
12235
- handleConfirm("proceed_once" /* ProceedOnce */, {
12254
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
12236
12255
  approved: true,
12237
12256
  approvalMode
12238
12257
  });
12239
12258
  },
12240
12259
  onFeedback: (feedback) => {
12241
- handleConfirm("proceed_once" /* ProceedOnce */, {
12260
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
12242
12261
  approved: false,
12243
12262
  feedback
12244
12263
  });
12245
12264
  },
12246
12265
  onCancel: () => {
12247
- handleConfirm("cancel" /* Cancel */);
12266
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12248
12267
  },
12249
12268
  width: terminalWidth,
12250
12269
  availableHeight: bodyHeight
@@ -12354,7 +12373,7 @@ Ensure you trust all modifications made to build files before approving executio
12354
12373
  const containsRedirection = commandsToDisplay.some(
12355
12374
  (cmd) => hasRedirection(cmd)
12356
12375
  );
12357
- const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
12376
+ const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
12358
12377
  let warnings = null;
12359
12378
  if (containsRedirection && !isAutoEdit) {
12360
12379
  const tipText = `To auto-accept, press ${formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */)}`;
@@ -12513,7 +12532,7 @@ Ensure you trust all modifications made to build files before approving executio
12513
12532
  const bodyOverflowDirection = confirmationDetails.type === "mcp" && isMcpToolDetailsExpanded ? "bottom" : "top";
12514
12533
  const renderRadioItem = (0, import_react37.useCallback)(
12515
12534
  (item, { titleColor }) => {
12516
- if (item.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */) {
12535
+ if (item.value === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
12517
12536
  return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(Text, { color: titleColor, wrap: "truncate", children: [
12518
12537
  item.label,
12519
12538
  " ",
@@ -14543,7 +14562,7 @@ async function validateAuthMethodWithSettings(authType, settings) {
14543
14562
  if (settings.merged.security.auth.useExternal) {
14544
14563
  return null;
14545
14564
  }
14546
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14565
+ if (authType === AuthType.USE_GEMINI) {
14547
14566
  return null;
14548
14567
  }
14549
14568
  return validateAuthMethod(authType);
@@ -14595,7 +14614,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
14595
14614
  }
14596
14615
  return;
14597
14616
  }
14598
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14617
+ if (authType === AuthType.USE_GEMINI) {
14599
14618
  const key = await reloadApiKey();
14600
14619
  if (!key) {
14601
14620
  setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
@@ -14673,31 +14692,31 @@ function AuthDialog({
14673
14692
  let items = [
14674
14693
  {
14675
14694
  label: "Sign in with Google",
14676
- value: "oauth-personal" /* LOGIN_WITH_GOOGLE */,
14677
- key: "oauth-personal" /* LOGIN_WITH_GOOGLE */
14695
+ value: AuthType.LOGIN_WITH_GOOGLE,
14696
+ key: AuthType.LOGIN_WITH_GOOGLE
14678
14697
  },
14679
14698
  ...process.env["CLOUD_SHELL"] === "true" ? [
14680
14699
  {
14681
14700
  label: "Use Cloud Shell user credentials",
14682
- value: "compute-default-credentials" /* COMPUTE_ADC */,
14683
- key: "compute-default-credentials" /* COMPUTE_ADC */
14701
+ value: AuthType.COMPUTE_ADC,
14702
+ key: AuthType.COMPUTE_ADC
14684
14703
  }
14685
14704
  ] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
14686
14705
  {
14687
14706
  label: "Use metadata server application default credentials",
14688
- value: "compute-default-credentials" /* COMPUTE_ADC */,
14689
- key: "compute-default-credentials" /* COMPUTE_ADC */
14707
+ value: AuthType.COMPUTE_ADC,
14708
+ key: AuthType.COMPUTE_ADC
14690
14709
  }
14691
14710
  ] : [],
14692
14711
  {
14693
14712
  label: "Use Gemini API Key",
14694
- value: "gemini-api-key" /* USE_GEMINI */,
14695
- key: "gemini-api-key" /* USE_GEMINI */
14713
+ value: AuthType.USE_GEMINI,
14714
+ key: AuthType.USE_GEMINI
14696
14715
  },
14697
14716
  {
14698
14717
  label: "Vertex AI",
14699
- value: "vertex-ai" /* USE_VERTEX_AI */,
14700
- key: "vertex-ai" /* USE_VERTEX_AI */
14718
+ value: AuthType.USE_VERTEX_AI,
14719
+ key: AuthType.USE_VERTEX_AI
14701
14720
  }
14702
14721
  ];
14703
14722
  if (settings.merged.security.auth.enforcedType) {
@@ -14719,9 +14738,9 @@ function AuthDialog({
14719
14738
  return item.value === defaultAuthType;
14720
14739
  }
14721
14740
  if (process.env["GEMINI_API_KEY"]) {
14722
- return item.value === "gemini-api-key" /* USE_GEMINI */;
14741
+ return item.value === AuthType.USE_GEMINI;
14723
14742
  }
14724
- return item.value === "oauth-personal" /* LOGIN_WITH_GOOGLE */;
14743
+ return item.value === AuthType.LOGIN_WITH_GOOGLE;
14725
14744
  });
14726
14745
  if (settings.merged.security.auth.enforcedType) {
14727
14746
  initialAuthIndex = 0;
@@ -14732,7 +14751,7 @@ function AuthDialog({
14732
14751
  return;
14733
14752
  }
14734
14753
  if (authType) {
14735
- const needsRestart = authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ || authType === "vertex-ai" /* USE_VERTEX_AI */ && process.env["CLOUD_SHELL"] === "true";
14754
+ const needsRestart = authType === AuthType.LOGIN_WITH_GOOGLE || authType === AuthType.USE_VERTEX_AI && process.env["CLOUD_SHELL"] === "true";
14736
14755
  if (needsRestart) {
14737
14756
  setAuthContext({ requiresRestart: true });
14738
14757
  } else {
@@ -14740,12 +14759,12 @@ function AuthDialog({
14740
14759
  }
14741
14760
  await clearCachedCredentialFile();
14742
14761
  settings.setValue(scope, "security.auth.selectedType", authType);
14743
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
14762
+ if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
14744
14763
  setExiting(true);
14745
14764
  setTimeout(relaunchApp, 100);
14746
14765
  return;
14747
14766
  }
14748
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14767
+ if (authType === AuthType.USE_GEMINI) {
14749
14768
  setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
14750
14769
  return;
14751
14770
  }
@@ -15552,11 +15571,11 @@ var PrivacyNoticeText = ({
15552
15571
  }) => {
15553
15572
  const authType = config.getContentGeneratorConfig()?.authType;
15554
15573
  switch (authType) {
15555
- case "gemini-api-key" /* USE_GEMINI */:
15574
+ case AuthType.USE_GEMINI:
15556
15575
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GeminiPrivacyNotice, { onExit });
15557
- case "vertex-ai" /* USE_VERTEX_AI */:
15576
+ case AuthType.USE_VERTEX_AI:
15558
15577
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudPaidPrivacyNotice, { onExit });
15559
- case "oauth-personal" /* LOGIN_WITH_GOOGLE */:
15578
+ case AuthType.LOGIN_WITH_GOOGLE:
15560
15579
  default:
15561
15580
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudFreePrivacyNotice, { config, onExit });
15562
15581
  }
@@ -15616,7 +15635,7 @@ function ProQuotaDialog({
15616
15635
  value: "retry_always",
15617
15636
  key: "retry_always"
15618
15637
  },
15619
- ...authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && !isUltra ? [
15638
+ ...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
15620
15639
  {
15621
15640
  label: "Upgrade for higher limits",
15622
15641
  value: "upgrade",
@@ -16773,9 +16792,10 @@ function ModelDialog({ onClose }) {
16773
16792
  const preferredModel = config?.getModel() || GEMINI_MODEL_ALIAS_AUTO;
16774
16793
  const shouldShowPreviewModels = config?.getHasAccessToPreviewModel() ?? false;
16775
16794
  const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
16776
- const useGemini3_5Flash = config?.hasGemini35FlashGAAccess?.() ?? false;
16795
+ const useLatestFlash = config?.hasLatestFlashGAAccess?.() ?? false;
16796
+ const useLatestFlashLite = config?.hasLatestFlashLiteGAAccess?.() ?? false;
16777
16797
  const selectedAuthType = settings.merged.security.auth.selectedType;
16778
- const useCustomToolModel = useGemini31 && selectedAuthType === "gemini-api-key" /* USE_GEMINI */;
16798
+ const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
16779
16799
  const manualModelSelected = (0, import_react55.useMemo)(() => {
16780
16800
  if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
16781
16801
  const def = config.getModelConfigService().getModelDefinition(preferredModel);
@@ -16818,7 +16838,8 @@ function ModelDialog({ onClose }) {
16818
16838
  if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
16819
16839
  const allOptions = config.getModelConfigService().getAvailableModelOptions({
16820
16840
  useGemini3_1: useGemini31,
16821
- useGemini3_5Flash,
16841
+ useLatestFlash,
16842
+ useLatestFlashLite,
16822
16843
  useCustomTools: useCustomToolModel,
16823
16844
  hasAccessToPreview: shouldShowPreviewModels,
16824
16845
  hasAccessToProModel
@@ -16844,7 +16865,7 @@ function ModelDialog({ onClose }) {
16844
16865
  description: getAutoModelDescription(
16845
16866
  shouldShowPreviewModels,
16846
16867
  useGemini31,
16847
- useGemini3_5Flash
16868
+ useLatestFlash
16848
16869
  ),
16849
16870
  key: GEMINI_MODEL_ALIAS_AUTO
16850
16871
  },
@@ -16861,7 +16882,8 @@ function ModelDialog({ onClose }) {
16861
16882
  shouldShowPreviewModels,
16862
16883
  manualModelSelected,
16863
16884
  useGemini31,
16864
- useGemini3_5Flash,
16885
+ useLatestFlash,
16886
+ useLatestFlashLite,
16865
16887
  useCustomToolModel,
16866
16888
  hasAccessToProModel
16867
16889
  ]);
@@ -16869,7 +16891,8 @@ function ModelDialog({ onClose }) {
16869
16891
  if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
16870
16892
  const allOptions = config.getModelConfigService().getAvailableModelOptions({
16871
16893
  useGemini3_1: useGemini31,
16872
- useGemini3_5Flash,
16894
+ useLatestFlash,
16895
+ useLatestFlashLite,
16873
16896
  useCustomTools: useCustomToolModel,
16874
16897
  hasAccessToPreview: shouldShowPreviewModels,
16875
16898
  hasAccessToProModel
@@ -16943,7 +16966,8 @@ function ModelDialog({ onClose }) {
16943
16966
  }, [
16944
16967
  shouldShowPreviewModels,
16945
16968
  useGemini31,
16946
- useGemini3_5Flash,
16969
+ useLatestFlash,
16970
+ useLatestFlashLite,
16947
16971
  useCustomToolModel,
16948
16972
  hasAccessToProModel,
16949
16973
  config
@@ -18099,10 +18123,10 @@ function initializeConsoleStore() {
18099
18123
  globalConsoleMessages = [];
18100
18124
  globalErrorCount = 0;
18101
18125
  notifyListeners();
18102
- coreEvents.off("console-log" /* ConsoleLog */, handleConsoleLog);
18103
- coreEvents.off("output" /* Output */, handleOutput);
18104
- coreEvents.on("console-log" /* ConsoleLog */, handleConsoleLog);
18105
- coreEvents.on("output" /* Output */, handleOutput);
18126
+ coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
18127
+ coreEvents.off(CoreEvent.Output, handleOutput);
18128
+ coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
18129
+ coreEvents.on(CoreEvent.Output, handleOutput);
18106
18130
  }
18107
18131
  function notifyListeners() {
18108
18132
  for (const listener of listeners) {
@@ -20239,7 +20263,7 @@ function usePromptCompletion({
20239
20263
  { model: "prompt-completion" },
20240
20264
  contents,
20241
20265
  signal,
20242
- "utility_autocomplete" /* UTILITY_AUTOCOMPLETE */
20266
+ LlmRole.UTILITY_AUTOCOMPLETE
20243
20267
  );
20244
20268
  if (signal.aborted) {
20245
20269
  return;
@@ -22311,9 +22335,9 @@ var InputPrompt = ({
22311
22335
  onSuggestionsVisibilityChange(shouldShowSuggestions);
22312
22336
  }
22313
22337
  }, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
22314
- const showAutoAcceptStyling = !shellModeActive && approvalMode === "autoEdit" /* AUTO_EDIT */;
22315
- const showYoloStyling = !shellModeActive && approvalMode === "yolo" /* YOLO */;
22316
- const showPlanStyling = !shellModeActive && approvalMode === "plan" /* PLAN */;
22338
+ const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
22339
+ const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
22340
+ const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
22317
22341
  let statusColor;
22318
22342
  let statusText = "";
22319
22343
  if (shellModeActive) {
@@ -23146,22 +23170,22 @@ var ApprovalModeIndicator = ({
23146
23170
  const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
23147
23171
  const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
23148
23172
  switch (approvalMode) {
23149
- case "autoEdit" /* AUTO_EDIT */:
23173
+ case ApprovalMode.AUTO_EDIT:
23150
23174
  textColor = theme.status.warning;
23151
23175
  textContent = "auto-accept edits";
23152
23176
  subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
23153
23177
  break;
23154
- case "plan" /* PLAN */:
23178
+ case ApprovalMode.PLAN:
23155
23179
  textColor = theme.status.success;
23156
23180
  textContent = "plan";
23157
23181
  subText = `${cycleHint} to manual`;
23158
23182
  break;
23159
- case "yolo" /* YOLO */:
23183
+ case ApprovalMode.YOLO:
23160
23184
  textColor = theme.status.error;
23161
23185
  textContent = "YOLO";
23162
23186
  subText = yoloHint;
23163
23187
  break;
23164
- case "default" /* DEFAULT */:
23188
+ case ApprovalMode.DEFAULT:
23165
23189
  default:
23166
23190
  textColor = theme.text.accent;
23167
23191
  textContent = "";
@@ -23209,7 +23233,7 @@ var useComposerStatus = () => {
23209
23233
  (item) => item.type === "tool_group"
23210
23234
  ).some(
23211
23235
  (item) => item.tools.some(
23212
- (tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
23236
+ (tool) => tool.status === CoreToolCallStatus.AwaitingApproval
23213
23237
  )
23214
23238
  ),
23215
23239
  [uiState.pendingHistoryItems]
@@ -23224,13 +23248,13 @@ var useComposerStatus = () => {
23224
23248
  const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
23225
23249
  if (hideMinimalModeHintWhileBusy) return null;
23226
23250
  switch (showApprovalModeIndicator) {
23227
- case "yolo" /* YOLO */:
23251
+ case ApprovalMode.YOLO:
23228
23252
  return { text: "YOLO", color: theme.status.error };
23229
- case "plan" /* PLAN */:
23253
+ case ApprovalMode.PLAN:
23230
23254
  return { text: "plan", color: theme.status.success };
23231
- case "autoEdit" /* AUTO_EDIT */:
23255
+ case ApprovalMode.AUTO_EDIT:
23232
23256
  return { text: "auto edit", color: theme.status.warning };
23233
- case "default" /* DEFAULT */:
23257
+ case ApprovalMode.DEFAULT:
23234
23258
  default:
23235
23259
  return null;
23236
23260
  }
@@ -23584,7 +23608,7 @@ var ConfigInitDisplay = ({
23584
23608
  let connected = 0;
23585
23609
  const connecting = [];
23586
23610
  for (const [name, client] of clients.entries()) {
23587
- if (client.getStatus() === "connected" /* CONNECTED */) {
23611
+ if (client.getStatus() === MCPServerStatus.CONNECTED) {
23588
23612
  connected++;
23589
23613
  } else {
23590
23614
  connecting.push(name);
@@ -23606,9 +23630,9 @@ var ConfigInitDisplay = ({
23606
23630
  );
23607
23631
  }
23608
23632
  };
23609
- coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
23633
+ coreEvents.on(CoreEvent.McpClientUpdate, onChange);
23610
23634
  return () => {
23611
- coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
23635
+ coreEvents.off(CoreEvent.McpClientUpdate, onChange);
23612
23636
  };
23613
23637
  }, [initialMessage]);
23614
23638
  return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Text, { children: [
@@ -24325,7 +24349,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
24325
24349
  callId,
24326
24350
  name: SHELL_COMMAND_NAME,
24327
24351
  description: rawQuery,
24328
- status: "executing" /* Executing */,
24352
+ status: CoreToolCallStatus.Executing,
24329
24353
  isClientInitiated: true,
24330
24354
  resultDisplay: "",
24331
24355
  confirmationDetails: void 0
@@ -24466,7 +24490,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
24466
24490
  mainContent = result.output.trim() || "(Command produced no output)";
24467
24491
  }
24468
24492
  let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
24469
- let finalStatus = "success" /* Success */;
24493
+ let finalStatus = CoreToolCallStatus.Success;
24470
24494
  const prependToAnsiOutput = (output, text) => {
24471
24495
  const newLines = text.split("\n").map((line) => [
24472
24496
  {
@@ -24485,20 +24509,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
24485
24509
  };
24486
24510
  let prefix = "";
24487
24511
  if (result.error) {
24488
- finalStatus = "error" /* Error */;
24512
+ finalStatus = CoreToolCallStatus.Error;
24489
24513
  prefix = result.error.message;
24490
24514
  } else if (result.aborted) {
24491
- finalStatus = "cancelled" /* Cancelled */;
24515
+ finalStatus = CoreToolCallStatus.Cancelled;
24492
24516
  prefix = "Command was cancelled.";
24493
24517
  } else if (result.backgrounded) {
24494
- finalStatus = "success" /* Success */;
24518
+ finalStatus = CoreToolCallStatus.Success;
24495
24519
  finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
24496
24520
  mainContent = finalOutput;
24497
24521
  } else if (result.signal) {
24498
- finalStatus = "error" /* Error */;
24522
+ finalStatus = CoreToolCallStatus.Error;
24499
24523
  prefix = `Command terminated by signal: ${result.signal}.`;
24500
24524
  } else if (result.exitCode !== 0) {
24501
- finalStatus = "error" /* Error */;
24525
+ finalStatus = CoreToolCallStatus.Error;
24502
24526
  prefix = `Command exited with code ${result.exitCode}.`;
24503
24527
  }
24504
24528
  if (prefix) {
@@ -24524,7 +24548,7 @@ ${mainContent}`;
24524
24548
  status: finalStatus,
24525
24549
  resultDisplay: finalOutput
24526
24550
  };
24527
- if (finalStatus !== "cancelled" /* Cancelled */) {
24551
+ if (finalStatus !== CoreToolCallStatus.Cancelled) {
24528
24552
  addItemToHistory(
24529
24553
  {
24530
24554
  type: "tool_group",
@@ -25534,13 +25558,13 @@ function useQuotaAndFallback({
25534
25558
  error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
25535
25559
  `/stats model for usage details`,
25536
25560
  `/model to switch models.`,
25537
- contentGeneratorConfig?.authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? `/auth to switch to API key.` : null
25561
+ contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
25538
25562
  ].filter(Boolean);
25539
25563
  message = messageLines.join("\n");
25540
25564
  }
25541
25565
  } else if (error instanceof ModelNotFoundError) {
25542
25566
  isModelNotFoundError = true;
25543
- if (contentGeneratorConfig?.authType === "vertex-ai" /* USE_VERTEX_AI */ && VALID_GEMINI_MODELS.has(failedModel)) {
25567
+ if (contentGeneratorConfig?.authType === AuthType.USE_VERTEX_AI && VALID_GEMINI_MODELS.has(failedModel)) {
25544
25568
  const location = process.env["GOOGLE_CLOUD_LOCATION"] || "your configured region";
25545
25569
  const messageLines = [
25546
25570
  `Model "${failedModel}" is not available in region "${location}".`,
@@ -25734,7 +25758,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
25734
25758
  );
25735
25759
  setEditorError(null);
25736
25760
  setIsEditorDialogOpen(false);
25737
- coreEvents.emit("editor-selected" /* EditorSelected */, { editor: editorType });
25761
+ coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
25738
25762
  } catch (error) {
25739
25763
  setEditorError(`Failed to set editor preference: ${error}`);
25740
25764
  }
@@ -25743,7 +25767,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
25743
25767
  );
25744
25768
  const exitEditorDialog = (0, import_react91.useCallback)(() => {
25745
25769
  setIsEditorDialogOpen(false);
25746
- coreEvents.emit("editor-selected" /* EditorSelected */, { editor: void 0 });
25770
+ coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
25747
25771
  }, []);
25748
25772
  return {
25749
25773
  isEditorDialogOpen,
@@ -26120,7 +26144,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26120
26144
  canonicalPath: resolvedCommandPath
26121
26145
  } = parseSlashCommand(trimmed, commands);
26122
26146
  if (!commandToExecute) {
26123
- const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === "in_progress" /* IN_PROGRESS */;
26147
+ const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
26124
26148
  if (isMcpLoading) {
26125
26149
  setIsProcessing(true);
26126
26150
  if (addToHistory) {
@@ -26300,7 +26324,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26300
26324
  onConfirm: async (resolvedOutcome) => {
26301
26325
  resolve3({
26302
26326
  outcome: resolvedOutcome,
26303
- approvedCommands: resolvedOutcome === "cancel" /* Cancel */ ? [] : result.commandsToConfirm
26327
+ approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
26304
26328
  });
26305
26329
  }
26306
26330
  };
@@ -26308,7 +26332,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26308
26332
  callId,
26309
26333
  name: "Expansion",
26310
26334
  description: "Command expansion needs shell access",
26311
- status: "awaiting_approval" /* AwaitingApproval */,
26335
+ status: CoreToolCallStatus.AwaitingApproval,
26312
26336
  isClientInitiated: true,
26313
26337
  resultDisplay: void 0,
26314
26338
  confirmationDetails
@@ -26319,7 +26343,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26319
26343
  });
26320
26344
  });
26321
26345
  setPendingItem(null);
26322
- if (outcome === "cancel" /* Cancel */ || !approvedCommands || approvedCommands.length === 0) {
26346
+ if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
26323
26347
  addItem(
26324
26348
  {
26325
26349
  type: "info" /* INFO */,
@@ -26329,7 +26353,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26329
26353
  );
26330
26354
  return { type: "handled" };
26331
26355
  }
26332
- if (outcome === "proceed_always" /* ProceedAlways */) {
26356
+ if (outcome === ToolConfirmationOutcome.ProceedAlways) {
26333
26357
  setSessionShellAllowlist(
26334
26358
  (prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
26335
26359
  );
@@ -26805,7 +26829,7 @@ function mapToDisplay(toolOrTools, options = {}) {
26805
26829
  let description;
26806
26830
  let renderOutputAsMarkdown = false;
26807
26831
  const displayName = call.tool?.displayName ?? call.request.name;
26808
- if (call.status === "error" /* Error */) {
26832
+ if (call.status === CoreToolCallStatus.Error) {
26809
26833
  description = JSON.stringify(call.request.args);
26810
26834
  } else {
26811
26835
  description = call.invocation.getDescription();
@@ -26828,27 +26852,27 @@ function mapToDisplay(toolOrTools, options = {}) {
26828
26852
  let progress = void 0;
26829
26853
  let progressTotal = void 0;
26830
26854
  switch (call.status) {
26831
- case "success" /* Success */:
26855
+ case CoreToolCallStatus.Success:
26832
26856
  resultDisplay = call.response.resultDisplay;
26833
26857
  outputFile = call.response.outputFile;
26834
26858
  break;
26835
- case "error" /* Error */:
26836
- case "cancelled" /* Cancelled */:
26859
+ case CoreToolCallStatus.Error:
26860
+ case CoreToolCallStatus.Cancelled:
26837
26861
  resultDisplay = call.response.resultDisplay;
26838
26862
  break;
26839
- case "awaiting_approval" /* AwaitingApproval */:
26863
+ case CoreToolCallStatus.AwaitingApproval:
26840
26864
  correlationId = call.correlationId;
26841
26865
  confirmationDetails = call.confirmationDetails;
26842
26866
  break;
26843
- case "executing" /* Executing */:
26867
+ case CoreToolCallStatus.Executing:
26844
26868
  resultDisplay = call.liveOutput;
26845
26869
  ptyId = call.pid;
26846
26870
  progressMessage = call.progressMessage;
26847
26871
  progress = call.progress;
26848
26872
  progressTotal = call.progressTotal;
26849
26873
  break;
26850
- case "scheduled" /* Scheduled */:
26851
- case "validating" /* Validating */:
26874
+ case CoreToolCallStatus.Scheduled:
26875
+ case CoreToolCallStatus.Validating:
26852
26876
  break;
26853
26877
  default: {
26854
26878
  const exhaustiveCheck = call;
@@ -26919,7 +26943,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26919
26943
  const handler = (event) => {
26920
26944
  const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
26921
26945
  const hasExecuting = event.toolCalls.some(
26922
- (tc) => tc.status === "executing" /* Executing */ || (tc.status === "success" /* Success */ || tc.status === "error" /* Error */) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
26946
+ (tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
26923
26947
  );
26924
26948
  if (hasExecuting) {
26925
26949
  setLastToolOutputTime(Date.now());
@@ -26928,7 +26952,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26928
26952
  const prevCalls = prev[event.schedulerId] ?? [];
26929
26953
  const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
26930
26954
  const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
26931
- (tc) => tc.status === "awaiting_approval" /* AwaitingApproval */ || prevCallIds.has(tc.request.callId)
26955
+ (tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
26932
26956
  );
26933
26957
  if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
26934
26958
  return prev;
@@ -26940,9 +26964,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26940
26964
  };
26941
26965
  });
26942
26966
  };
26943
- messageBus.subscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
26967
+ messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
26944
26968
  return () => {
26945
- messageBus.unsubscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
26969
+ messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
26946
26970
  };
26947
26971
  }, [messageBus, internalAdaptToolCalls]);
26948
26972
  (0, import_react98.useEffect)(() => {
@@ -26964,9 +26988,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26964
26988
  };
26965
26989
  });
26966
26990
  };
26967
- messageBus.subscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
26991
+ messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
26968
26992
  return () => {
26969
- messageBus.unsubscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
26993
+ messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
26970
26994
  };
26971
26995
  }, [messageBus]);
26972
26996
  const schedule = (0, import_react98.useCallback)(
@@ -27065,8 +27089,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
27065
27089
  const prev = prevMap.get(coreCall.request.callId);
27066
27090
  const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
27067
27091
  let status = coreCall.status;
27068
- if ((status === "success" /* Success */ || status === "error" /* Error */) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
27069
- status = "executing" /* Executing */;
27092
+ if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
27093
+ status = CoreToolCallStatus.Executing;
27070
27094
  }
27071
27095
  return {
27072
27096
  ...coreCall,
@@ -27098,7 +27122,7 @@ function getBackgroundedToolInfo(toolCall) {
27098
27122
  };
27099
27123
  }
27100
27124
  function isBackgroundableExecutingToolCall(toolCall) {
27101
- return toolCall.status === "executing" /* Executing */ && typeof toolCall.pid === "number";
27125
+ return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
27102
27126
  }
27103
27127
  function showCitations(settings) {
27104
27128
  const enabled = settings.merged.ui.showCitations;
@@ -27108,14 +27132,14 @@ function showCitations(settings) {
27108
27132
  return true;
27109
27133
  }
27110
27134
  function calculateStreamingState(isResponding, toolCalls) {
27111
- if (toolCalls.some((tc) => tc.status === "awaiting_approval" /* AwaitingApproval */)) {
27135
+ if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
27112
27136
  return "waiting_for_confirmation" /* WaitingForConfirmation */;
27113
27137
  }
27114
27138
  const isAnyToolActive = toolCalls.some((tc) => {
27115
- if (tc.status === "executing" /* Executing */ || tc.status === "scheduled" /* Scheduled */ || tc.status === "validating" /* Validating */) {
27139
+ if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
27116
27140
  return true;
27117
27141
  }
27118
- if (tc.status === "success" /* Success */ || tc.status === "error" /* Error */ || tc.status === "cancelled" /* Cancelled */) {
27142
+ if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
27119
27143
  return !tc.responseSubmittedToGemini;
27120
27144
  }
27121
27145
  return false;
@@ -27162,9 +27186,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27162
27186
  }
27163
27187
  setRetryStatus(payload);
27164
27188
  };
27165
- coreEvents.on("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
27189
+ coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
27166
27190
  return () => {
27167
- coreEvents.off("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
27191
+ coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
27168
27192
  };
27169
27193
  }, [isRespondingRef]);
27170
27194
  const [
@@ -27297,12 +27321,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27297
27321
  const tc = toolCalls[i];
27298
27322
  if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
27299
27323
  if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
27300
- const isAgent = tc.tool?.kind === "agent" /* Agent */;
27324
+ const isAgent = tc.tool?.kind === Kind.Agent;
27301
27325
  if (isAgent) {
27302
27326
  let contigAgentsComplete = true;
27303
27327
  for (let j = i + 1; j < toolCalls.length; j++) {
27304
27328
  const nextTc = toolCalls[j];
27305
- if (nextTc.tool?.kind === "agent" /* Agent */) {
27329
+ if (nextTc.tool?.kind === Kind.Agent) {
27306
27330
  if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
27307
27331
  contigAgentsComplete = false;
27308
27332
  break;
@@ -27328,7 +27352,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27328
27352
  let currentGroup = [];
27329
27353
  for (const tc of toolsToPush) {
27330
27354
  newPushed.add(tc.request.callId);
27331
- if (tc.tool?.kind === "agent" /* Agent */) {
27355
+ if (tc.tool?.kind === Kind.Agent) {
27332
27356
  currentGroup.push(tc);
27333
27357
  } else {
27334
27358
  if (currentGroup.length > 0) {
@@ -27481,7 +27505,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27481
27505
  prevActiveShellPtyIdRef.current = activeShellPtyId;
27482
27506
  }, [activeShellPtyId, addItem, setIsResponding]);
27483
27507
  (0, import_react99.useEffect)(() => {
27484
- if (config.getApprovalMode() === "yolo" /* YOLO */ && streamingState === "idle" /* Idle */) {
27508
+ if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
27485
27509
  const lastUserMessageIndex = history.findLastIndex(
27486
27510
  (item) => item.type === "user" /* USER */
27487
27511
  );
@@ -27549,7 +27573,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27549
27573
  return;
27550
27574
  }
27551
27575
  const hasActiveTools = toolCalls.some(
27552
- (tc) => tc.status === "executing" /* Executing */ || tc.status === "scheduled" /* Scheduled */ || tc.status === "validating" /* Validating */
27576
+ (tc) => tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating
27553
27577
  );
27554
27578
  if (streamingState === "idle" /* Idle */ && !isRespondingRef.current && !hasActiveTools) {
27555
27579
  if (clearBuffer) {
@@ -27576,7 +27600,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27576
27600
  if (tool.name === SHELL_COMMAND_NAME) {
27577
27601
  return {
27578
27602
  ...tool,
27579
- status: "cancelled" /* Cancelled */,
27603
+ status: CoreToolCallStatus.Cancelled,
27580
27604
  resultDisplay: tool.resultDisplay
27581
27605
  };
27582
27606
  }
@@ -27641,7 +27665,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27641
27665
  let localQueryToSendToGemini = null;
27642
27666
  if (typeof query === "string") {
27643
27667
  const trimmedQuery = query.trim();
27644
- await logger?.logMessage("user" /* USER */, trimmedQuery);
27668
+ await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
27645
27669
  if (!shellModeActive) {
27646
27670
  const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
27647
27671
  if (slashCommandResult) {
@@ -27797,7 +27821,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27797
27821
  if (pendingHistoryItemRef.current) {
27798
27822
  if (pendingHistoryItemRef.current.type === "tool_group") {
27799
27823
  const updatedTools = pendingHistoryItemRef.current.tools.map(
27800
- (tool) => tool.status === "validating" /* Validating */ || tool.status === "scheduled" /* Scheduled */ || tool.status === "awaiting_approval" /* AwaitingApproval */ || tool.status === "executing" /* Executing */ ? { ...tool, status: "cancelled" /* Cancelled */ } : tool
27824
+ (tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
27801
27825
  );
27802
27826
  const pendingItem = {
27803
27827
  ...pendingHistoryItemRef.current,
@@ -28089,15 +28113,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28089
28113
  let geminiMessageBuffer = "";
28090
28114
  const toolCallRequests = [];
28091
28115
  for await (const event of stream) {
28092
- if (event.type !== "thought" /* Thought */ && thoughtRef.current !== null) {
28116
+ if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
28093
28117
  setThought(null);
28094
28118
  }
28095
28119
  switch (event.type) {
28096
- case "thought" /* Thought */:
28120
+ case GeminiEventType.Thought:
28097
28121
  setLastGeminiActivityTime(Date.now());
28098
28122
  handleThoughtEvent(event.value, userMessageTimestamp);
28099
28123
  break;
28100
- case "content" /* Content */:
28124
+ case GeminiEventType.Content:
28101
28125
  setLastGeminiActivityTime(Date.now());
28102
28126
  geminiMessageBuffer = handleContentEvent(
28103
28127
  event.value,
@@ -28105,16 +28129,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28105
28129
  userMessageTimestamp
28106
28130
  );
28107
28131
  break;
28108
- case "tool_call_request" /* ToolCallRequest */:
28132
+ case GeminiEventType.ToolCallRequest:
28109
28133
  toolCallRequests.push(event.value);
28110
28134
  break;
28111
- case "user_cancelled" /* UserCancelled */:
28135
+ case GeminiEventType.UserCancelled:
28112
28136
  handleUserCancelledEvent(userMessageTimestamp);
28113
28137
  break;
28114
- case "error" /* Error */:
28138
+ case GeminiEventType.Error:
28115
28139
  handleErrorEvent(event.value, userMessageTimestamp);
28116
28140
  break;
28117
- case "agent_execution_stopped" /* AgentExecutionStopped */:
28141
+ case GeminiEventType.AgentExecutionStopped:
28118
28142
  handleAgentExecutionStoppedEvent(
28119
28143
  event.value.reason,
28120
28144
  userMessageTimestamp,
@@ -28122,7 +28146,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28122
28146
  event.value.contextCleared
28123
28147
  );
28124
28148
  break;
28125
- case "agent_execution_blocked" /* AgentExecutionBlocked */:
28149
+ case GeminiEventType.AgentExecutionBlocked:
28126
28150
  handleAgentExecutionBlockedEvent(
28127
28151
  event.value.reason,
28128
28152
  userMessageTimestamp,
@@ -28130,36 +28154,36 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28130
28154
  event.value.contextCleared
28131
28155
  );
28132
28156
  break;
28133
- case "chat_compressed" /* ChatCompressed */:
28157
+ case GeminiEventType.ChatCompressed:
28134
28158
  handleChatCompressionEvent(event.value, userMessageTimestamp);
28135
28159
  break;
28136
- case "tool_call_confirmation" /* ToolCallConfirmation */:
28137
- case "tool_call_response" /* ToolCallResponse */:
28160
+ case GeminiEventType.ToolCallConfirmation:
28161
+ case GeminiEventType.ToolCallResponse:
28138
28162
  break;
28139
- case "max_session_turns" /* MaxSessionTurns */:
28163
+ case GeminiEventType.MaxSessionTurns:
28140
28164
  handleMaxSessionTurnsEvent();
28141
28165
  break;
28142
- case "context_window_will_overflow" /* ContextWindowWillOverflow */:
28166
+ case GeminiEventType.ContextWindowWillOverflow:
28143
28167
  handleContextWindowWillOverflowEvent(
28144
28168
  event.value.estimatedRequestTokenCount,
28145
28169
  event.value.remainingTokenCount
28146
28170
  );
28147
28171
  break;
28148
- case "finished" /* Finished */:
28172
+ case GeminiEventType.Finished:
28149
28173
  handleFinishedEvent(event, userMessageTimestamp);
28150
28174
  break;
28151
- case "citation" /* Citation */:
28175
+ case GeminiEventType.Citation:
28152
28176
  handleCitationEvent(event.value, userMessageTimestamp);
28153
28177
  break;
28154
- case "model_info" /* ModelInfo */:
28178
+ case GeminiEventType.ModelInfo:
28155
28179
  handleChatModelEvent(event.value, userMessageTimestamp);
28156
28180
  break;
28157
- case "loop_detected" /* LoopDetected */:
28181
+ case GeminiEventType.LoopDetected:
28158
28182
  loopDetectedRef.current = true;
28159
28183
  break;
28160
- case "retry" /* Retry */:
28184
+ case GeminiEventType.Retry:
28161
28185
  break;
28162
- case "invalid_stream" /* InvalidStream */:
28186
+ case GeminiEventType.InvalidStream:
28163
28187
  handleInvalidStreamEvent(event.value, userMessageTimestamp);
28164
28188
  break;
28165
28189
  default: {
@@ -28213,7 +28237,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28213
28237
  const submitQuery = (0, import_react99.useCallback)(
28214
28238
  async (query, options, prompt_id) => runInDevTraceSpan(
28215
28239
  {
28216
- operation: options?.isContinuation ? "system_prompt" /* SystemPrompt */ : "user_prompt" /* UserPrompt */,
28240
+ operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
28217
28241
  sessionId: config.getSessionId()
28218
28242
  },
28219
28243
  async ({ metadata: spanMetadata }) => {
@@ -28380,7 +28404,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28380
28404
  submitQueryRef.current = submitQuery;
28381
28405
  const handleApprovalModeChange = (0, import_react99.useCallback)(
28382
28406
  async (newApprovalMode) => {
28383
- if (previousApprovalModeRef.current === "plan" /* PLAN */ && newApprovalMode !== "plan" /* PLAN */ && streamingState === "idle" /* Idle */) {
28407
+ if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
28384
28408
  if (geminiClient) {
28385
28409
  try {
28386
28410
  await geminiClient.addHistory({
@@ -28403,11 +28427,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28403
28427
  }
28404
28428
  }
28405
28429
  previousApprovalModeRef.current = newApprovalMode;
28406
- if (newApprovalMode === "yolo" /* YOLO */ || newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
28430
+ if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
28407
28431
  let awaitingApprovalCalls = toolCalls.filter(
28408
28432
  (call) => call.status === "awaiting_approval" && !call.request.forcedAsk
28409
28433
  );
28410
- if (newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
28434
+ if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
28411
28435
  awaitingApprovalCalls = awaitingApprovalCalls.filter((call) => {
28412
28436
  if (EDIT_TOOL_NAMES.has(call.request.name)) {
28413
28437
  return true;
@@ -28423,11 +28447,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28423
28447
  if (call.correlationId) {
28424
28448
  try {
28425
28449
  await config.getMessageBus().publish({
28426
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
28450
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
28427
28451
  correlationId: call.correlationId,
28428
28452
  confirmed: true,
28429
28453
  requiresUserConfirmation: false,
28430
- outcome: "proceed_once" /* ProceedOnce */
28454
+ outcome: ToolConfirmationOutcome.ProceedOnce
28431
28455
  });
28432
28456
  } catch (error) {
28433
28457
  debugLogger.warn(
@@ -28518,14 +28542,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28518
28542
  );
28519
28543
  if (isLowErrorVerbosity) {
28520
28544
  suppressedToolErrorCountRef.current += geminiTools.filter(
28521
- (tc) => tc.status === "error" /* Error */
28545
+ (tc) => tc.status === CoreToolCallStatus.Error
28522
28546
  ).length;
28523
28547
  }
28524
28548
  if (geminiTools.length === 0) {
28525
28549
  return;
28526
28550
  }
28527
28551
  const stopExecutionTool = geminiTools.find(
28528
- (tc) => tc.response.errorType === "stop_execution" /* STOP_EXECUTION */
28552
+ (tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
28529
28553
  );
28530
28554
  if (stopExecutionTool && stopExecutionTool.response.error) {
28531
28555
  maybeAddSuppressedToolErrorNote();
@@ -28545,9 +28569,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28545
28569
  (tc) => !isTopicTool2(tc.request.name)
28546
28570
  );
28547
28571
  const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
28548
- (tc) => tc.status === "cancelled" /* Cancelled */
28572
+ (tc) => tc.status === CoreToolCallStatus.Cancelled
28549
28573
  );
28550
- const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === "cancelled" /* Cancelled */);
28574
+ const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
28551
28575
  if (allDeclinableToolsCancelled || allToolsCancelled) {
28552
28576
  if (!turnCancelledRef.current) {
28553
28577
  addItem({
@@ -28633,7 +28657,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28633
28657
  return;
28634
28658
  }
28635
28659
  const restorableToolCalls = toolCalls.filter(
28636
- (toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === "awaiting_approval" /* AwaitingApproval */
28660
+ (toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
28637
28661
  );
28638
28662
  if (restorableToolCalls.length > 0) {
28639
28663
  if (!gitService) {
@@ -28856,14 +28880,14 @@ var useAgentStream = ({
28856
28880
  const displayName = legacyState?.displayName ?? event.name;
28857
28881
  const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
28858
28882
  const desc = legacyState?.description ?? "";
28859
- const fallbackKind = "other" /* Other */;
28883
+ const fallbackKind = Kind.Other;
28860
28884
  const newCall = {
28861
28885
  callId: event.requestId,
28862
28886
  name: displayName,
28863
28887
  originalRequestName: event.name,
28864
28888
  description: desc,
28865
28889
  display: event.display,
28866
- status: "scheduled" /* Scheduled */,
28890
+ status: CoreToolCallStatus.Scheduled,
28867
28891
  isClientInitiated: false,
28868
28892
  renderOutputAsMarkdown: isOutputMarkdown,
28869
28893
  kind: legacyState?.kind ?? fallbackKind,
@@ -28881,10 +28905,10 @@ var useAgentStream = ({
28881
28905
  const evtStatus = legacyState?.status;
28882
28906
  let status = tc.status;
28883
28907
  if (evtStatus === "executing")
28884
- status = "executing" /* Executing */;
28885
- else if (evtStatus === "error") status = "error" /* Error */;
28908
+ status = CoreToolCallStatus.Executing;
28909
+ else if (evtStatus === "error") status = CoreToolCallStatus.Error;
28886
28910
  else if (evtStatus === "success")
28887
- status = "success" /* Success */;
28911
+ status = CoreToolCallStatus.Success;
28888
28912
  const display = event.display?.result;
28889
28913
  const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
28890
28914
  const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
@@ -28917,7 +28941,7 @@ var useAgentStream = ({
28917
28941
  const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
28918
28942
  return {
28919
28943
  ...tc,
28920
- status: event.isError ? "error" /* Error */ : "success" /* Success */,
28944
+ status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
28921
28945
  display: event.display ? { ...tc.display, ...event.display } : tc.display,
28922
28946
  resultDisplay,
28923
28947
  outputFile
@@ -28983,7 +29007,7 @@ var useAgentStream = ({
28983
29007
  if (!options?.isContinuation) {
28984
29008
  if (typeof query === "string") {
28985
29009
  addItem({ type: "user" /* USER */, text: query }, timestamp);
28986
- void logger?.logMessage("user" /* USER */, query);
29010
+ void logger?.logMessage(MessageSenderType.USER, query);
28987
29011
  }
28988
29012
  startNewPrompt();
28989
29013
  }
@@ -30510,9 +30534,9 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30510
30534
  const handleFolderTrustSelect = (0, import_react105.useCallback)(
30511
30535
  async (choice) => {
30512
30536
  const trustLevelMap = {
30513
- ["trust_folder" /* TRUST_FOLDER */]: "TRUST_FOLDER" /* TRUST_FOLDER */,
30514
- ["trust_parent" /* TRUST_PARENT */]: "TRUST_PARENT" /* TRUST_PARENT */,
30515
- ["do_not_trust" /* DO_NOT_TRUST */]: "DO_NOT_TRUST" /* DO_NOT_TRUST */
30537
+ ["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
30538
+ ["trust_parent" /* TRUST_PARENT */]: TrustLevel.TRUST_PARENT,
30539
+ ["do_not_trust" /* DO_NOT_TRUST */]: TrustLevel.DO_NOT_TRUST
30516
30540
  };
30517
30541
  const trustLevel = trustLevelMap[choice];
30518
30542
  if (!trustLevel) return;
@@ -30531,7 +30555,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30531
30555
  }, 100);
30532
30556
  return;
30533
30557
  }
30534
- const currentIsTrusted = trustLevel === "TRUST_FOLDER" /* TRUST_FOLDER */ || trustLevel === "TRUST_PARENT" /* TRUST_PARENT */;
30558
+ const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
30535
30559
  onTrustChange(currentIsTrusted);
30536
30560
  setIsTrusted(currentIsTrusted);
30537
30561
  const wasTrusted = isTrusted ?? false;
@@ -31539,7 +31563,7 @@ function useMessageQueue({
31539
31563
  var import_react107 = __toESM(require_react(), 1);
31540
31564
  function useMcpStatus(config) {
31541
31565
  const [discoveryState, setDiscoveryState] = (0, import_react107.useState)(
31542
- () => config.getMcpClientManager()?.getDiscoveryState() ?? "not_started" /* NOT_STARTED */
31566
+ () => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
31543
31567
  );
31544
31568
  const [mcpServerCount, setMcpServerCount] = (0, import_react107.useState)(
31545
31569
  () => config.getMcpClientManager()?.getMcpServerCount() ?? 0
@@ -31552,12 +31576,12 @@ function useMcpStatus(config) {
31552
31576
  setMcpServerCount(manager.getMcpServerCount());
31553
31577
  }
31554
31578
  };
31555
- coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
31579
+ coreEvents.on(CoreEvent.McpClientUpdate, onChange);
31556
31580
  return () => {
31557
- coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
31581
+ coreEvents.off(CoreEvent.McpClientUpdate, onChange);
31558
31582
  };
31559
31583
  }, [config]);
31560
- const isMcpReady = discoveryState === "completed" /* COMPLETED */ || discoveryState === "not_started" /* NOT_STARTED */ && mcpServerCount === 0;
31584
+ const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
31561
31585
  return {
31562
31586
  discoveryState,
31563
31587
  mcpServerCount,
@@ -31584,7 +31608,7 @@ function useApprovalModeIndicator({
31584
31608
  (key) => {
31585
31609
  let nextApprovalMode;
31586
31610
  if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
31587
- if (config.isYoloModeDisabled() && config.getApprovalMode() !== "yolo" /* YOLO */) {
31611
+ if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
31588
31612
  if (addItem) {
31589
31613
  let text = "You cannot enter YOLO mode since it is disabled in your settings.";
31590
31614
  const adminSettings = config.getRemoteAdminSettings();
@@ -31602,21 +31626,21 @@ function useApprovalModeIndicator({
31602
31626
  }
31603
31627
  return;
31604
31628
  }
31605
- nextApprovalMode = config.getApprovalMode() === "yolo" /* YOLO */ ? "default" /* DEFAULT */ : "yolo" /* YOLO */;
31629
+ nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
31606
31630
  } else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
31607
31631
  const currentMode = config.getApprovalMode();
31608
31632
  switch (currentMode) {
31609
- case "default" /* DEFAULT */:
31610
- nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
31633
+ case ApprovalMode.DEFAULT:
31634
+ nextApprovalMode = ApprovalMode.AUTO_EDIT;
31611
31635
  break;
31612
- case "autoEdit" /* AUTO_EDIT */:
31613
- nextApprovalMode = allowPlanMode ? "plan" /* PLAN */ : "default" /* DEFAULT */;
31636
+ case ApprovalMode.AUTO_EDIT:
31637
+ nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
31614
31638
  break;
31615
- case "plan" /* PLAN */:
31616
- nextApprovalMode = "default" /* DEFAULT */;
31639
+ case ApprovalMode.PLAN:
31640
+ nextApprovalMode = ApprovalMode.DEFAULT;
31617
31641
  break;
31618
- case "yolo" /* YOLO */:
31619
- nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
31642
+ case ApprovalMode.YOLO:
31643
+ nextApprovalMode = ApprovalMode.AUTO_EDIT;
31620
31644
  break;
31621
31645
  default:
31622
31646
  }
@@ -32026,11 +32050,11 @@ var useHookDisplayState = () => {
32026
32050
  removeHook();
32027
32051
  }
32028
32052
  };
32029
- coreEvents.on("hook-start" /* HookStart */, handleHookStart);
32030
- coreEvents.on("hook-end" /* HookEnd */, handleHookEnd);
32053
+ coreEvents.on(CoreEvent.HookStart, handleHookStart);
32054
+ coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
32031
32055
  return () => {
32032
- coreEvents.off("hook-start" /* HookStart */, handleHookStart);
32033
- coreEvents.off("hook-end" /* HookEnd */, handleHookEnd);
32056
+ coreEvents.off(CoreEvent.HookStart, handleHookStart);
32057
+ coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
32034
32058
  activeTimeouts.forEach(clearTimeout);
32035
32059
  activeTimeouts.clear();
32036
32060
  };
@@ -32869,7 +32893,7 @@ var AppContainer = (props) => {
32869
32893
  setConfigInitialized(true);
32870
32894
  startupProfiler.flush(config);
32871
32895
  startAutoMemoryIfEnabled(config);
32872
- const sessionStartSource = resumedSessionData ? "resume" /* Resume */ : "startup" /* Startup */;
32896
+ const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
32873
32897
  const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
32874
32898
  if (result) {
32875
32899
  const additionalContext = result.getAdditionalContext();
@@ -32896,7 +32920,7 @@ var AppContainer = (props) => {
32896
32920
  );
32897
32921
  const ideClient = await IdeClient.getInstance();
32898
32922
  await ideClient.disconnect();
32899
- await config?.getHookSystem()?.fireSessionEndEvent("exit" /* Exit */);
32923
+ await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
32900
32924
  };
32901
32925
  registerCleanup(cleanupFn);
32902
32926
  return () => {
@@ -32921,11 +32945,11 @@ var AppContainer = (props) => {
32921
32945
  resetTime: payload.resetTime
32922
32946
  });
32923
32947
  };
32924
- coreEvents.on("model-changed" /* ModelChanged */, handleModelChanged);
32925
- coreEvents.on("quota-changed" /* QuotaChanged */, handleQuotaChanged);
32948
+ coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
32949
+ coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
32926
32950
  return () => {
32927
- coreEvents.off("model-changed" /* ModelChanged */, handleModelChanged);
32928
- coreEvents.off("quota-changed" /* QuotaChanged */, handleQuotaChanged);
32951
+ coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
32952
+ coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
32929
32953
  };
32930
32954
  }, [config]);
32931
32955
  (0, import_react121.useEffect)(() => {
@@ -32938,16 +32962,16 @@ var AppContainer = (props) => {
32938
32962
  const handleAgentsDiscovered = (payload) => {
32939
32963
  setNewAgents(payload.agents);
32940
32964
  };
32941
- coreEvents.on("settings-changed" /* SettingsChanged */, handleSettingsChanged);
32942
- coreEvents.on("admin-settings-changed" /* AdminSettingsChanged */, handleAdminSettingsChanged);
32943
- coreEvents.on("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
32965
+ coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
32966
+ coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
32967
+ coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
32944
32968
  return () => {
32945
- coreEvents.off("settings-changed" /* SettingsChanged */, handleSettingsChanged);
32969
+ coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
32946
32970
  coreEvents.off(
32947
- "admin-settings-changed" /* AdminSettingsChanged */,
32971
+ CoreEvent.AdminSettingsChanged,
32948
32972
  handleAdminSettingsChanged
32949
32973
  );
32950
- coreEvents.off("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
32974
+ coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
32951
32975
  };
32952
32976
  }, [settings]);
32953
32977
  const { errorCount, clearErrorCount } = useErrorCount();
@@ -33014,11 +33038,11 @@ var AppContainer = (props) => {
33014
33038
  exitEditorDialog
33015
33039
  } = useEditorSettings(settings, setEditorError, historyManager.addItem);
33016
33040
  (0, import_react121.useEffect)(() => {
33017
- coreEvents.on("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
33018
- coreEvents.on("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
33041
+ coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
33042
+ coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
33019
33043
  return () => {
33020
- coreEvents.off("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
33021
- coreEvents.off("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
33044
+ coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
33045
+ coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
33022
33046
  };
33023
33047
  }, [handleEditorClose, openEditorDialog]);
33024
33048
  (0, import_react121.useEffect)(() => {
@@ -33086,7 +33110,7 @@ var AppContainer = (props) => {
33086
33110
  errorVerbosity: settings.merged.ui.errorVerbosity
33087
33111
  });
33088
33112
  const isAuthDialogOpen = authState === "updating" /* Updating */;
33089
- const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== "gemini-api-key" /* USE_GEMINI */;
33113
+ const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
33090
33114
  const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
33091
33115
  const { loadHistoryForResume, isResuming } = useSessionResume({
33092
33116
  config,
@@ -33114,7 +33138,7 @@ var AppContainer = (props) => {
33114
33138
  async (authType, scope) => {
33115
33139
  if (authType) {
33116
33140
  const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
33117
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */) {
33141
+ if (authType === AuthType.LOGIN_WITH_GOOGLE) {
33118
33142
  setAuthContext({ requiresRestart: true });
33119
33143
  } else {
33120
33144
  setAuthContext({});
@@ -33142,7 +33166,7 @@ var AppContainer = (props) => {
33142
33166
  );
33143
33167
  return;
33144
33168
  }
33145
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
33169
+ if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
33146
33170
  writeToStdout(`
33147
33171
  ----------------------------------------------------------------
33148
33172
  Logging in with Google... Restarting Gemini CLI to continue.
@@ -33165,7 +33189,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
33165
33189
  }
33166
33190
  await saveApiKey(apiKey);
33167
33191
  await reloadApiKey();
33168
- await config.refreshAuth("gemini-api-key" /* USE_GEMINI */);
33192
+ await config.refreshAuth(AuthType.USE_GEMINI);
33169
33193
  setAuthState("authenticated" /* Authenticated */);
33170
33194
  } catch (e) {
33171
33195
  onAuthError(
@@ -33190,7 +33214,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
33190
33214
  `Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
33191
33215
  );
33192
33216
  } else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
33193
- if (settings.merged.security.auth.selectedType === "gemini-api-key" /* USE_GEMINI */) {
33217
+ if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
33194
33218
  return;
33195
33219
  }
33196
33220
  const authMethod = settings.merged.security.auth.selectedType;
@@ -33326,9 +33350,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
33326
33350
  }
33327
33351
  });
33328
33352
  };
33329
- coreEvents.on("consent-request" /* ConsentRequest */, handleConsentRequest);
33353
+ coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
33330
33354
  return () => {
33331
- coreEvents.off("consent-request" /* ConsentRequest */, handleConsentRequest);
33355
+ coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
33332
33356
  };
33333
33357
  }, []);
33334
33358
  const performMemoryRefresh = (0, import_react121.useCallback)(async () => {
@@ -33986,7 +34010,7 @@ ${queuedText}` : queuedText;
33986
34010
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
33987
34011
  if (settings.merged.general.devtools) {
33988
34012
  void (async () => {
33989
- const { toggleDevToolsPanel } = await import("./devtoolsService-MA34M6Q7.js");
34013
+ const { toggleDevToolsPanel } = await import("./devtoolsService-LWSF6JIT.js");
33990
34014
  await toggleDevToolsPanel(
33991
34015
  config,
33992
34016
  showErrorDetails,
@@ -34204,17 +34228,17 @@ ${queuedText}` : queuedText;
34204
34228
  Date.now()
34205
34229
  );
34206
34230
  };
34207
- coreEvents.on("user-feedback" /* UserFeedback */, handleUserFeedback);
34208
- coreEvents.on("hook-system-message" /* HookSystemMessage */, handleHookSystemMessage);
34231
+ coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
34232
+ coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
34209
34233
  coreEvents.drainBacklogs();
34210
34234
  return () => {
34211
- coreEvents.off("user-feedback" /* UserFeedback */, handleUserFeedback);
34212
- coreEvents.off("hook-system-message" /* HookSystemMessage */, handleHookSystemMessage);
34235
+ coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
34236
+ coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
34213
34237
  };
34214
34238
  }, [historyManager]);
34215
34239
  const nightly = props.version.includes("nightly");
34216
34240
  const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
34217
- const loginRestartMessage = settings.merged.security.auth.selectedType === "vertex-ai" /* USE_VERTEX_AI */ ? "Authenticating to Vertex AI in Cloud Shell requires a restart to apply project settings." : void 0;
34241
+ const loginRestartMessage = settings.merged.security.auth.selectedType === AuthType.USE_VERTEX_AI ? "Authenticating to Vertex AI in Cloud Shell requires a restart to apply project settings." : void 0;
34218
34242
  const dialogsVisible = shouldShowIdePrompt || isFolderTrustDialogOpen || isPolicyUpdateDialogOpen || adminSettingsChanged || !!commandConfirmationRequest || !!authConsentRequest || !!permissionConfirmationRequest || !!customDialog || confirmUpdateExtensionRequests.length > 0 || !!loopDetectionConfirmationRequest || isThemeDialogOpen || isSettingsDialogOpen || isModelDialogOpen || isVoiceModelDialogOpen || isAgentConfigDialogOpen || isPermissionsDialogOpen || isAuthenticating || isAuthDialogOpen || isEditorDialogOpen || showPrivacyNotice || showIdeRestartPrompt || !!proQuotaRequest || !!validationRequest || !!overageMenuRequest || !!emptyWalletRequest || isSessionBrowserOpen || authState === "awaiting_api_key_input" /* AwaitingApiKeyInput */ || isAwaitingLoginRestart || !!newAgents;
34219
34243
  const hasPendingToolConfirmation = (0, import_react121.useMemo)(
34220
34244
  () => isToolAwaitingConfirmation(pendingHistoryItems),
@@ -34314,9 +34338,9 @@ ${queuedText}` : queuedText;
34314
34338
  const handleMemoryChanged = (result) => {
34315
34339
  setGeminiMdFileCount(result.fileCount);
34316
34340
  };
34317
- coreEvents.on("memory-changed" /* MemoryChanged */, handleMemoryChanged);
34341
+ coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
34318
34342
  return () => {
34319
- coreEvents.off("memory-changed" /* MemoryChanged */, handleMemoryChanged);
34343
+ coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
34320
34344
  };
34321
34345
  }, []);
34322
34346
  (0, import_react121.useEffect)(() => {