@google/gemini-cli 0.44.0 → 0.45.0-nightly.20260527.g41c9260ca

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/bundle/{chunk-FOOWNGAB.js → chunk-2RAPXSOV.js} +1 -1
  2. package/bundle/{chunk-TN4WXWFM.js → chunk-5SQYZFP6.js} +3 -3
  3. package/bundle/{chunk-BOYNQXWU.js → chunk-6SMPX7UU.js} +2 -2
  4. package/bundle/{chunk-QUZ62PY7.js → chunk-6VVFXG4V.js} +2 -2
  5. package/bundle/{chunk-DALZZYPQ.js → chunk-7EPRHON5.js} +1 -1
  6. package/bundle/{chunk-XTG4JBIR.js → chunk-AAGSPORB.js} +1 -1
  7. package/bundle/{chunk-BE42OOYM.js → chunk-EVYFBIGQ.js} +377 -297
  8. package/bundle/{chunk-5CABHQOE.js → chunk-FHQHQ6DS.js} +1 -1
  9. package/bundle/{chunk-ONQVFEHS.js → chunk-GIZR3U4X.js} +1 -1
  10. package/bundle/{chunk-CBT4PN4R.js → chunk-H4PA4O33.js} +8 -8
  11. package/bundle/{chunk-M3EDSAPV.js → chunk-I6UPFWEQ.js} +1 -1
  12. package/bundle/{chunk-TW47A6FW.js → chunk-IGGUR3YU.js} +7827 -14242
  13. package/bundle/{chunk-VUERI7WB.js → chunk-K4FVPC4T.js} +8 -8
  14. package/bundle/{chunk-EKUU3KNX.js → chunk-KSJ6OVGZ.js} +1 -1
  15. package/bundle/{chunk-OLBOCZ5F.js → chunk-P4IX67II.js} +68 -55
  16. package/bundle/{chunk-6W2Z7FTE.js → chunk-P4YCK66H.js} +3 -3
  17. package/bundle/{chunk-SIXPHUVZ.js → chunk-PN5LGMOT.js} +423 -330
  18. package/bundle/{chunk-N4SGO3W6.js → chunk-RJZUBUMQ.js} +2 -2
  19. package/bundle/{chunk-3K52543M.js → chunk-SJJUCWYW.js} +56 -2
  20. package/bundle/{chunk-G2L4VCSN.js → chunk-SS6WZNE5.js} +9 -8
  21. package/bundle/{chunk-LM6XTSWQ.js → chunk-T5BJFXUT.js} +56 -2
  22. package/bundle/chunk-TKOMYARC.js +81685 -0
  23. package/bundle/{chunk-OTLI6LZ3.js → chunk-TREYQA4O.js} +1 -1
  24. package/bundle/chunk-U3JK5HRW.js +394429 -0
  25. package/bundle/chunk-UHMKT6SK.js +154 -0
  26. package/bundle/chunk-UJJ75A5I.js +398 -0
  27. package/bundle/{chunk-7KIX5G5D.js → chunk-UMBPNYQU.js} +3 -3
  28. package/bundle/{chunk-7ZH745HC.js → chunk-VC3YLUFW.js} +63 -6
  29. package/bundle/chunk-VCSWELYF.js +512 -0
  30. package/bundle/chunk-VG6I25WK.js +1571 -0
  31. package/bundle/chunk-WU3YM7M5.js +118 -0
  32. package/bundle/chunk-YHUFSS4V.js +17320 -0
  33. package/bundle/{cleanup-PDT5ATZB.js → cleanup-DAEFNP5D.js} +2 -2
  34. package/bundle/{cleanup-SF7XW2P3.js → cleanup-QLHTBBSJ.js} +2 -2
  35. package/bundle/{cleanup-UW3DZLXP.js → cleanup-SWVNBESF.js} +2 -2
  36. package/bundle/cleanup-V5HN45VV.js +32 -0
  37. package/bundle/{core-LN2S4IOX.js → core-RLNQPUYW.js} +3 -7
  38. package/bundle/{devtoolsService-64QE2V7E.js → devtoolsService-F5XNH3LW.js} +2 -2
  39. package/bundle/{devtoolsService-ZC7E4R2A.js → devtoolsService-KSXJ7ZBM.js} +4 -3
  40. package/bundle/devtoolsService-N5XYKGOS.js +856 -0
  41. package/bundle/{devtoolsService-DUEWJW52.js → devtoolsService-Y4US3JKZ.js} +2 -2
  42. package/bundle/{dist-J4RONYVV.js → dist-CMC3RCEI.js} +3 -7
  43. package/bundle/{core-GW6VAL53.js → dist-XPJBSOYP.js} +3 -7
  44. package/bundle/dist-YCN22NGW.js +2134 -0
  45. package/bundle/docs/changelogs/index.md +15 -0
  46. package/bundle/docs/changelogs/latest.md +198 -262
  47. package/bundle/docs/changelogs/preview.md +202 -181
  48. package/bundle/docs/reference/configuration.md +24 -29
  49. package/bundle/{gemini-SSQIKHR2.js → gemini-3FB3K6RR.js} +41 -30
  50. package/bundle/{gemini-CMBH5YG6.js → gemini-AAR7OIGT.js} +239 -212
  51. package/bundle/{gemini-CSPRLMWN.js → gemini-BKWLRTMK.js} +41 -30
  52. package/bundle/gemini-JVLQYJ2G.js +16406 -0
  53. package/bundle/gemini.js +15 -10
  54. package/bundle/{interactiveCli-RDMZS6KL.js → interactiveCli-7AF74ES4.js} +33 -57
  55. package/bundle/{interactiveCli-TOEU7LIO.js → interactiveCli-LEZF6KPA.js} +33 -57
  56. package/bundle/{interactiveCli-Q2A2JFLA.js → interactiveCli-PCGUDXG4.js} +339 -344
  57. package/bundle/interactiveCli-QC3CJANH.js +34726 -0
  58. package/bundle/{liteRtServerManager-ASKAVAO7.js → liteRtServerManager-2ZSZW3IA.js} +4 -4
  59. package/bundle/{liteRtServerManager-6BWTXMUI.js → liteRtServerManager-A3Z4AS3V.js} +4 -4
  60. package/bundle/{liteRtServerManager-ZS3BCW53.js → liteRtServerManager-EDFTLOS6.js} +4 -4
  61. package/bundle/liteRtServerManager-YPEZDSGQ.js +65 -0
  62. package/bundle/{oauth2-provider-SYRZDGL5.js → oauth2-provider-5ZA5OIVB.js} +1 -1
  63. package/bundle/{oauth2-provider-FGI6QDEM.js → oauth2-provider-O4BUOOYR.js} +1 -1
  64. package/bundle/{oauth2-provider-7JOVY727.js → oauth2-provider-O635QVSF.js} +38 -72
  65. package/bundle/oauth2-provider-WIBCYDQG.js +235 -0
  66. package/bundle/{start-KJCIH3GX.js → start-7TRTTGGV.js} +6 -6
  67. package/bundle/{start-TU5WNP77.js → start-A4YSRLHR.js} +6 -6
  68. package/bundle/{start-47OYCVVA.js → start-HFZVWJGC.js} +6 -6
  69. package/bundle/start-KH23TWSE.js +18 -0
  70. package/package.json +1 -1
@@ -155,13 +155,13 @@ import {
155
155
  widestLineFromStyledChars,
156
156
  wordBreakStyledChars,
157
157
  wrapStyledChars
158
- } from "./chunk-OLBOCZ5F.js";
158
+ } from "./chunk-TKOMYARC.js";
159
159
  import {
160
160
  appEvents
161
161
  } from "./chunk-5PS3AYFU.js";
162
162
  import {
163
163
  require_source
164
- } from "./chunk-M3EDSAPV.js";
164
+ } from "./chunk-TREYQA4O.js";
165
165
  import {
166
166
  ACTIVE_SHELL_MAX_LINES,
167
167
  COMPACT_TOOL_SUBVIEW_MAX_LINES,
@@ -211,33 +211,37 @@ import {
211
211
  stringWidth,
212
212
  stripUnsafeCharacters,
213
213
  toCodePoints
214
- } from "./chunk-7ZH745HC.js";
214
+ } from "./chunk-VC3YLUFW.js";
215
215
  import {
216
216
  handleAutoUpdate,
217
217
  isDevelopment,
218
218
  relaunchApp,
219
219
  setUpdateHandler
220
- } from "./chunk-BOYNQXWU.js";
220
+ } from "./chunk-6SMPX7UU.js";
221
221
  import {
222
222
  isTodoList,
223
223
  mapCoreStatusToDisplayStatus,
224
224
  require_react
225
- } from "./chunk-G2L4VCSN.js";
225
+ } from "./chunk-KSJ6OVGZ.js";
226
226
  import {
227
227
  registerCleanup,
228
228
  removeCleanup,
229
229
  runExitCleanup,
230
230
  setupTtyCheck
231
- } from "./chunk-5CABHQOE.js";
231
+ } from "./chunk-GIZR3U4X.js";
232
232
  import {
233
233
  ACTIVATE_SKILL_TOOL_NAME,
234
234
  AGENT_TOOL_NAME,
235
235
  ApiKeyUpdatedEvent,
236
+ ApprovalMode,
236
237
  AsyncFzf,
237
238
  AudioRecorder,
238
239
  AuthType,
239
240
  ChangeAuthRequestedError,
241
+ CompressionStatus,
240
242
  ConversationFinishedEvent,
243
+ CoreEvent,
244
+ CoreToolCallStatus,
241
245
  CreditPurchaseClickEvent,
242
246
  DEFAULT_GEMINI_FLASH_LITE_MODEL,
243
247
  DEFAULT_GEMINI_FLASH_MODEL,
@@ -259,37 +263,51 @@ import {
259
263
  GEMMA_4_31B_IT_MODEL,
260
264
  GLOB_DISPLAY_NAME,
261
265
  GREP_DISPLAY_NAME,
266
+ GeminiCliOperation,
267
+ GeminiEventType,
262
268
  GitService,
263
269
  IdeClient,
270
+ Kind,
264
271
  LS_DISPLAY_NAME,
265
272
  LegacyAgentProtocol,
266
273
  LlmRole,
267
274
  Logger,
275
+ MCPDiscoveryState,
276
+ MCPServerStatus,
277
+ MessageBusType,
278
+ MessageSenderType,
268
279
  ModelNotFoundError,
269
280
  ModelSlashCommandEvent,
270
281
  OverageMenuShownEvent,
271
282
  OverageOptionSelectedEvent,
272
283
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
273
- PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
274
284
  PREVIEW_GEMINI_3_1_MODEL,
285
+ PREVIEW_GEMINI_FLASH_LITE_MODEL,
275
286
  PREVIEW_GEMINI_FLASH_MODEL,
276
287
  PREVIEW_GEMINI_MODEL,
277
288
  PolicyIntegrityManager,
278
289
  ProjectIdRequiredError,
290
+ QuestionType,
279
291
  READ_FILE_DISPLAY_NAME,
280
292
  READ_MANY_FILES_DISPLAY_NAME,
281
293
  RELEASE_CHANNEL_STABILITY,
282
294
  ROOT_SCHEDULER_ID,
283
295
  SHELL_TOOL_NAME,
284
296
  Scheduler,
297
+ SessionEndReason,
298
+ SessionStartSource,
285
299
  ShellExecutionService,
286
300
  SlashCommandStatus,
287
301
  Storage,
302
+ SubagentState,
288
303
  TOPIC_PARAM_STRATEGIC_INTENT,
289
304
  TOPIC_PARAM_SUMMARY,
290
305
  TOPIC_PARAM_TITLE,
291
306
  TerminalQuotaError,
307
+ ToolConfirmationOutcome,
308
+ ToolErrorType,
292
309
  TranscriptionFactory,
310
+ TrustLevel,
293
311
  UPDATE_TOPIC_DISPLAY_NAME,
294
312
  UPDATE_TOPIC_TOOL_NAME,
295
313
  UnauthorizedError,
@@ -301,6 +319,7 @@ import {
301
319
  WEB_FETCH_DISPLAY_NAME,
302
320
  WEB_SEARCH_DISPLAY_NAME,
303
321
  WRITE_FILE_DISPLAY_NAME,
322
+ WarningPriority,
304
323
  WhisperModelManager,
305
324
  addMCPStatusChangeListener,
306
325
  allowEditorTypeInSandbox,
@@ -410,7 +429,7 @@ import {
410
429
  validatePlanContent,
411
430
  validatePlanPath,
412
431
  writeToStdout
413
- } from "./chunk-TW47A6FW.js";
432
+ } from "./chunk-EVYFBIGQ.js";
414
433
  import "./chunk-6HI7VNOG.js";
415
434
  import "./chunk-TUDYL3X4.js";
416
435
  import "./chunk-IUUIT4SU.js";
@@ -5036,7 +5055,7 @@ function calculateShellMaxLines(options) {
5036
5055
  if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
5037
5056
  return maxLinesBasedOnHeight;
5038
5057
  }
5039
- const isExecuting = status === "executing" /* Executing */;
5058
+ const isExecuting = status === CoreToolCallStatus.Executing;
5040
5059
  const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
5041
5060
  return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
5042
5061
  }
@@ -5070,10 +5089,10 @@ function isShellTool(name) {
5070
5089
  return name === SHELL_COMMAND_NAME || name === SHELL_NAME || name === SHELL_TOOL_NAME || normalized === "shell";
5071
5090
  }
5072
5091
  function isThisShellFocusable(name, status, config) {
5073
- return !!(isShellTool(name) && status === "executing" /* Executing */ && config?.getEnableInteractiveShell());
5092
+ return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && config?.getEnableInteractiveShell());
5074
5093
  }
5075
5094
  function isThisShellFocused(name, status, ptyId, activeShellPtyId, embeddedShellFocused) {
5076
- return !!(isShellTool(name) && status === "executing" /* Executing */ && ptyId === activeShellPtyId && embeddedShellFocused);
5095
+ return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && ptyId === activeShellPtyId && embeddedShellFocused);
5077
5096
  }
5078
5097
  function useFocusHint(isThisShellFocusable2, isThisShellFocused2, resultDisplay) {
5079
5098
  const [userHasFocused, setUserHasFocused] = (0, import_react9.useState)(false);
@@ -5233,13 +5252,13 @@ var formatToolArgs = (args) => {
5233
5252
  var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) => {
5234
5253
  let headerText;
5235
5254
  let headerColor = theme.text.secondary;
5236
- if (progress.state === "cancelled" /* CANCELLED */) {
5255
+ if (progress.state === SubagentState.CANCELLED) {
5237
5256
  headerText = `Subagent ${progress.agentName} was cancelled.`;
5238
5257
  headerColor = theme.status.warning;
5239
- } else if (progress.state === "error" /* ERROR */) {
5258
+ } else if (progress.state === SubagentState.ERROR) {
5240
5259
  headerText = `Subagent ${progress.agentName} failed.`;
5241
5260
  headerColor = theme.status.error;
5242
- } else if (progress.state === "completed" /* COMPLETED */) {
5261
+ } else if (progress.state === SubagentState.COMPLETED) {
5243
5262
  headerText = `Subagent ${progress.agentName} completed.`;
5244
5263
  headerColor = theme.status.success;
5245
5264
  } else {
@@ -5259,7 +5278,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5259
5278
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color, children: item.content }) })
5260
5279
  ] }, item.id);
5261
5280
  } else if (item.type === "tool_call") {
5262
- 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 });
5281
+ 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 });
5263
5282
  const formattedArgs = item.description || formatToolArgs(item.args);
5264
5283
  const displayArgs = formattedArgs.length > 60 ? formattedArgs.slice(0, 60) + "..." : formattedArgs;
5265
5284
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box_default, { flexDirection: "row", children: [
@@ -5270,7 +5289,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5270
5289
  {
5271
5290
  bold: true,
5272
5291
  color: theme.text.primary,
5273
- strikethrough: item.status === "cancelled" /* CANCELLED */,
5292
+ strikethrough: item.status === SubagentState.CANCELLED,
5274
5293
  children: item.displayName || item.content
5275
5294
  }
5276
5295
  ),
@@ -5279,7 +5298,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5279
5298
  {
5280
5299
  color: theme.text.secondary,
5281
5300
  wrap: "truncate",
5282
- strikethrough: item.status === "cancelled" /* CANCELLED */,
5301
+ strikethrough: item.status === SubagentState.CANCELLED,
5283
5302
  children: displayArgs
5284
5303
  }
5285
5304
  ) })
@@ -5299,7 +5318,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5299
5318
  MarkdownDisplay,
5300
5319
  {
5301
5320
  text: safeJsonToMarkdown(progress.result),
5302
- isPending: progress.state !== "completed" /* COMPLETED */,
5321
+ isPending: progress.state !== SubagentState.COMPLETED,
5303
5322
  terminalWidth
5304
5323
  }
5305
5324
  )
@@ -5653,14 +5672,14 @@ var ToolActionsProvider = (props) => {
5653
5672
  }
5654
5673
  const details = tool.confirmationDetails;
5655
5674
  if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
5656
- const cliOutcome = outcome === "cancel" /* Cancel */ ? "rejected" : "accepted";
5675
+ const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? "rejected" : "accepted";
5657
5676
  await ideClient?.resolveDiffFromCli(details.filePath, cliOutcome);
5658
5677
  }
5659
5678
  if (tool.correlationId) {
5660
5679
  await config.getMessageBus().publish({
5661
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
5680
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
5662
5681
  correlationId: tool.correlationId,
5663
- confirmed: outcome !== "cancel" /* Cancel */,
5682
+ confirmed: outcome !== ToolConfirmationOutcome.Cancel,
5664
5683
  requiresUserConfirmation: false,
5665
5684
  outcome,
5666
5685
  payload
@@ -5679,7 +5698,7 @@ var ToolActionsProvider = (props) => {
5679
5698
  );
5680
5699
  const cancel = (0, import_react12.useCallback)(
5681
5700
  async (callId) => {
5682
- await confirm(callId, "cancel" /* Cancel */);
5701
+ await confirm(callId, ToolConfirmationOutcome.Cancel);
5683
5702
  },
5684
5703
  [confirm]
5685
5704
  );
@@ -5798,7 +5817,7 @@ var ToolMessage = ({
5798
5817
  paddingX: 1,
5799
5818
  flexDirection: "column",
5800
5819
  children: [
5801
- status === "executing" /* Executing */ && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5820
+ status === CoreToolCallStatus.Executing && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5802
5821
  McpProgressIndicator,
5803
5822
  {
5804
5823
  progress,
@@ -5815,8 +5834,8 @@ var ToolMessage = ({
5815
5834
  terminalWidth,
5816
5835
  renderOutputAsMarkdown,
5817
5836
  hasFocus: isThisShellFocused2,
5818
- maxLines: kind === "agent" /* Agent */ && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
5819
- overflowDirection: kind === "agent" /* Agent */ ? "bottom" : "top"
5837
+ maxLines: kind === Kind.Agent && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
5838
+ overflowDirection: kind === Kind.Agent ? "bottom" : "top"
5820
5839
  }
5821
5840
  ),
5822
5841
  isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
@@ -6132,7 +6151,7 @@ function getInitialTrustState(settings, cwd5, isCurrentWorkspace) {
6132
6151
  settings.merged,
6133
6152
  process3.cwd()
6134
6153
  );
6135
- const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === "DO_NOT_TRUST" /* DO_NOT_TRUST */);
6154
+ const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === TrustLevel.DO_NOT_TRUST);
6136
6155
  return {
6137
6156
  currentTrustLevel: explicitTrustLevel,
6138
6157
  isInheritedTrustFromParent: !!(source === "file" && isInheritedTrust),
@@ -6177,7 +6196,7 @@ var usePermissionsModifyTrust = (onExit, addItem, targetDirectory) => {
6177
6196
  process3.cwd(),
6178
6197
  newConfig
6179
6198
  );
6180
- if (trustLevel === "DO_NOT_TRUST" /* DO_NOT_TRUST */ && isTrusted) {
6199
+ if (trustLevel === TrustLevel.DO_NOT_TRUST && isTrusted) {
6181
6200
  let message = "Note: This folder is still trusted because the connected IDE workspace is trusted.";
6182
6201
  if (source === "file") {
6183
6202
  message = "Note: This folder is still trusted because a parent folder is trusted.";
@@ -6251,18 +6270,18 @@ function PermissionsModifyTrustDialog({
6251
6270
  const TRUST_LEVEL_ITEMS = [
6252
6271
  {
6253
6272
  label: `Trust this folder (${dirName})`,
6254
- value: "TRUST_FOLDER" /* TRUST_FOLDER */,
6255
- key: "TRUST_FOLDER" /* TRUST_FOLDER */
6273
+ value: TrustLevel.TRUST_FOLDER,
6274
+ key: TrustLevel.TRUST_FOLDER
6256
6275
  },
6257
6276
  {
6258
6277
  label: `Trust parent folder (${parentFolder})`,
6259
- value: "TRUST_PARENT" /* TRUST_PARENT */,
6260
- key: "TRUST_PARENT" /* TRUST_PARENT */
6278
+ value: TrustLevel.TRUST_PARENT,
6279
+ key: TrustLevel.TRUST_PARENT
6261
6280
  },
6262
6281
  {
6263
6282
  label: "Don't trust",
6264
- value: "DO_NOT_TRUST" /* DO_NOT_TRUST */,
6265
- key: "DO_NOT_TRUST" /* DO_NOT_TRUST */
6283
+ value: TrustLevel.DO_NOT_TRUST,
6284
+ key: TrustLevel.DO_NOT_TRUST
6266
6285
  }
6267
6286
  ];
6268
6287
  const {
@@ -6502,7 +6521,7 @@ var ShellToolMessage = ({
6502
6521
  maxLinesLimit: maxLines
6503
6522
  });
6504
6523
  import_react17.default.useEffect(() => {
6505
- const isExecuting = status === "executing" /* Executing */;
6524
+ const isExecuting = status === CoreToolCallStatus.Executing;
6506
6525
  if (isExecuting && ptyId) {
6507
6526
  try {
6508
6527
  const childWidth = terminalWidth - 4;
@@ -6715,13 +6734,13 @@ var SubagentGroupDisplay = ({
6715
6734
  const singleAgent = toolCalls[0].resultDisplay;
6716
6735
  if (isSubagentProgress(singleAgent)) {
6717
6736
  switch (singleAgent.state) {
6718
- case "completed" /* COMPLETED */:
6737
+ case SubagentState.COMPLETED:
6719
6738
  headerText = "Agent Completed";
6720
6739
  break;
6721
- case "cancelled" /* CANCELLED */:
6740
+ case SubagentState.CANCELLED:
6722
6741
  headerText = "Agent Cancelled";
6723
6742
  break;
6724
- case "error" /* ERROR */:
6743
+ case SubagentState.ERROR:
6725
6744
  headerText = "Agent Error";
6726
6745
  break;
6727
6746
  default:
@@ -6737,8 +6756,8 @@ var SubagentGroupDisplay = ({
6737
6756
  for (const tc of toolCalls) {
6738
6757
  const progress = tc.resultDisplay;
6739
6758
  if (isSubagentProgress(progress)) {
6740
- if (progress.state === "completed" /* COMPLETED */) completedCount++;
6741
- else if (progress.state === "running" /* RUNNING */) runningCount++;
6759
+ if (progress.state === SubagentState.COMPLETED) completedCount++;
6760
+ else if (progress.state === SubagentState.RUNNING) runningCount++;
6742
6761
  } else {
6743
6762
  runningCount++;
6744
6763
  }
@@ -6817,7 +6836,7 @@ var SubagentGroupDisplay = ({
6817
6836
  if (!isExpanded) {
6818
6837
  let content = "Starting...";
6819
6838
  let formattedArgs;
6820
- if (progress.state === "completed" /* COMPLETED */) {
6839
+ if (progress.state === SubagentState.COMPLETED) {
6821
6840
  if (progress.terminateReason && progress.terminateReason !== "GOAL") {
6822
6841
  content = `Finished Early (${progress.terminateReason})`;
6823
6842
  } else {
@@ -6831,17 +6850,17 @@ var SubagentGroupDisplay = ({
6831
6850
  formattedArgs = formatToolArgs(lastActivity.args);
6832
6851
  }
6833
6852
  }
6834
- const displayArgs = progress.state === "completed" /* COMPLETED */ ? "" : formattedArgs;
6853
+ const displayArgs = progress.state === SubagentState.COMPLETED ? "" : formattedArgs;
6835
6854
  const renderStatusIcon = () => {
6836
- const state = progress.state ?? "running" /* RUNNING */;
6855
+ const state = progress.state ?? SubagentState.RUNNING;
6837
6856
  switch (state) {
6838
- case "running" /* RUNNING */:
6857
+ case SubagentState.RUNNING:
6839
6858
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.text.primary, children: "!" });
6840
- case "completed" /* COMPLETED */:
6859
+ case SubagentState.COMPLETED:
6841
6860
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.success, children: "\u2713" });
6842
- case "cancelled" /* CANCELLED */:
6861
+ case SubagentState.CANCELLED:
6843
6862
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.warning, children: "\u2139" });
6844
- case "error" /* ERROR */:
6863
+ case SubagentState.ERROR:
6845
6864
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.error, children: "\u2717" });
6846
6865
  default:
6847
6866
  return checkExhaustive(state);
@@ -6894,22 +6913,22 @@ var hasPayload = (res) => {
6894
6913
  function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerminalHeight, isClickable) {
6895
6914
  const added = (diff.diffStat?.model_added_lines ?? 0) + (diff.diffStat?.user_added_lines ?? 0);
6896
6915
  const removed = (diff.diffStat?.model_removed_lines ?? 0) + (diff.diffStat?.user_removed_lines ?? 0);
6897
- const isAcceptedOrConfirming = status === "success" /* Success */ || status === "executing" /* Executing */ || status === "awaiting_approval" /* AwaitingApproval */;
6916
+ const isAcceptedOrConfirming = status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing || status === CoreToolCallStatus.AwaitingApproval;
6898
6917
  const addColor = isAcceptedOrConfirming ? theme.status.success : theme.text.secondary;
6899
6918
  const removeColor = isAcceptedOrConfirming ? theme.status.error : theme.text.secondary;
6900
6919
  const showDiffStat = !!diff.diffStat;
6901
6920
  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 }) });
6902
6921
  let resultSummary = "";
6903
6922
  let resultColor = theme.text.secondary;
6904
- if (status === "awaiting_approval" /* AwaitingApproval */) {
6923
+ if (status === CoreToolCallStatus.AwaitingApproval) {
6905
6924
  resultSummary = "Confirming";
6906
- } else if (status === "success" /* Success */ || status === "executing" /* Executing */) {
6925
+ } else if (status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing) {
6907
6926
  resultSummary = "Accepted";
6908
6927
  resultColor = theme.text.accent;
6909
- } else if (status === "cancelled" /* Cancelled */) {
6928
+ } else if (status === CoreToolCallStatus.Cancelled) {
6910
6929
  resultSummary = "Rejected";
6911
6930
  resultColor = theme.status.error;
6912
- } else if (status === "error" /* Error */) {
6931
+ } else if (status === CoreToolCallStatus.Error) {
6913
6932
  resultSummary = typeof resultDisplay === "string" ? resultDisplay : "Failed";
6914
6933
  resultColor = theme.status.error;
6915
6934
  }
@@ -6940,7 +6959,7 @@ function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerm
6940
6959
  filename: diff.fileName,
6941
6960
  terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
6942
6961
  availableTerminalHeight,
6943
- disableColor: status === "cancelled" /* Cancelled */
6962
+ disableColor: status === CoreToolCallStatus.Cancelled
6944
6963
  }
6945
6964
  );
6946
6965
  return { description, summary, payload };
@@ -7068,10 +7087,10 @@ var DenseToolMessage = (props) => {
7068
7087
  if (isGrepResult(resultDisplay)) {
7069
7088
  return getGenericSuccessData(resultDisplay, originalDescription);
7070
7089
  }
7071
- if (status === "success" /* Success */ && resultDisplay) {
7090
+ if (status === CoreToolCallStatus.Success && resultDisplay) {
7072
7091
  return getGenericSuccessData(resultDisplay, originalDescription);
7073
7092
  }
7074
- if (status === "error" /* Error */) {
7093
+ if (status === CoreToolCallStatus.Error) {
7075
7094
  const text = typeof resultDisplay === "string" ? resultDisplay.replace(/\n/g, " ") : "Failed";
7076
7095
  const errorSummary = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: theme.status.error, wrap: "truncate-end", children: [
7077
7096
  "\u2192 ",
@@ -7112,7 +7131,7 @@ var DenseToolMessage = (props) => {
7112
7131
  language: fileExtension,
7113
7132
  maxWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
7114
7133
  settings,
7115
- disableColor: status === "cancelled" /* Cancelled */,
7134
+ disableColor: status === CoreToolCallStatus.Cancelled,
7116
7135
  returnLines: true
7117
7136
  });
7118
7137
  } else {
@@ -7120,7 +7139,7 @@ var DenseToolMessage = (props) => {
7120
7139
  parsedLines,
7121
7140
  filename: diff.fileName,
7122
7141
  terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
7123
- disableColor: status === "cancelled" /* Cancelled */
7142
+ disableColor: status === CoreToolCallStatus.Cancelled
7124
7143
  });
7125
7144
  }
7126
7145
  }, [diff, isExpanded, isAlternateBuffer, terminalWidth, settings, status]);
@@ -7250,7 +7269,7 @@ function isToolExecuting(pendingHistoryItems) {
7250
7269
  return pendingHistoryItems.some((item) => {
7251
7270
  if (item && item.type === "tool_group") {
7252
7271
  return item.tools.some(
7253
- (tool) => "executing" /* Executing */ === tool.status
7272
+ (tool) => CoreToolCallStatus.Executing === tool.status
7254
7273
  );
7255
7274
  }
7256
7275
  return false;
@@ -7259,7 +7278,7 @@ function isToolExecuting(pendingHistoryItems) {
7259
7278
  function isToolAwaitingConfirmation(pendingHistoryItems) {
7260
7279
  return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
7261
7280
  (item) => item.tools.some(
7262
- (tool) => "awaiting_approval" /* AwaitingApproval */ === tool.status
7281
+ (tool) => CoreToolCallStatus.AwaitingApproval === tool.status
7263
7282
  )
7264
7283
  );
7265
7284
  }
@@ -7282,14 +7301,14 @@ function getToolGroupBorderAppearance(item, activeShellPtyId, embeddedShellFocus
7282
7301
  if (isTrackedToolCall(t)) {
7283
7302
  return t.status !== "success" && t.status !== "error" && t.status !== "cancelled";
7284
7303
  } else {
7285
- return t.status !== "success" /* Success */ && t.status !== "error" /* Error */ && t.status !== "cancelled" /* Cancelled */;
7304
+ return t.status !== CoreToolCallStatus.Success && t.status !== CoreToolCallStatus.Error && t.status !== CoreToolCallStatus.Cancelled;
7286
7305
  }
7287
7306
  });
7288
7307
  const isEmbeddedShellFocused = toolsToInspect.some((t) => {
7289
7308
  if (isTrackedToolCall(t)) {
7290
7309
  return isShellTool(t.request.name) && t.status === "executing" && t.pid === activeShellPtyId && !!embeddedShellFocused;
7291
7310
  } else {
7292
- return isShellTool(t.name) && t.status === "executing" /* Executing */ && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
7311
+ return isShellTool(t.name) && t.status === CoreToolCallStatus.Executing && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
7293
7312
  }
7294
7313
  });
7295
7314
  const isShellCommand = toolsToInspect.some((t) => {
@@ -7388,7 +7407,7 @@ var ToolGroupMessage = ({
7388
7407
  const groupedTools = (0, import_react21.useMemo)(() => {
7389
7408
  const groups = [];
7390
7409
  for (const tool of visibleToolCalls) {
7391
- if (tool.kind === "agent" /* Agent */) {
7410
+ if (tool.kind === Kind.Agent) {
7392
7411
  const lastGroup = groups[groups.length - 1];
7393
7412
  if (Array.isArray(lastGroup)) {
7394
7413
  lastGroup.push(tool);
@@ -7443,7 +7462,7 @@ var ToolGroupMessage = ({
7443
7462
  }, [groupedTools, isCompactModeEnabled, borderTopOverride]);
7444
7463
  let countToolCallsWithResults = 0;
7445
7464
  for (const tool of visibleToolCalls) {
7446
- if (tool.kind !== "agent" /* Agent */) {
7465
+ if (tool.kind !== Kind.Agent) {
7447
7466
  if (isCompactTool(tool, isCompactModeEnabled)) {
7448
7467
  if (hasDensePayload(tool)) {
7449
7468
  countToolCallsWithResults++;
@@ -7617,7 +7636,7 @@ var ToolGroupDisplay = ({
7617
7636
  }
7618
7637
  const { tools, borderColor, borderDimColor, borderTop, borderBottom } = item;
7619
7638
  const visibleTools = tools.filter(
7620
- (t) => t.status !== "awaiting_approval" /* AwaitingApproval */
7639
+ (t) => t.status !== CoreToolCallStatus.AwaitingApproval
7621
7640
  );
7622
7641
  const noticeTools = visibleTools.filter((t) => t.format === "notice");
7623
7642
  const otherTools = visibleTools.filter(
@@ -7819,18 +7838,18 @@ function CompressionMessage({
7819
7838
  return "Compressing chat history";
7820
7839
  }
7821
7840
  switch (compressionStatus) {
7822
- case 1 /* COMPRESSED */:
7841
+ case CompressionStatus.COMPRESSED:
7823
7842
  return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
7824
- case 2 /* COMPRESSION_FAILED_INFLATED_TOKEN_COUNT */:
7843
+ case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
7825
7844
  if (originalTokens < 5e4) {
7826
7845
  return "Compression was not beneficial for this history size.";
7827
7846
  }
7828
7847
  return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
7829
- case 3 /* COMPRESSION_FAILED_TOKEN_COUNT_ERROR */:
7848
+ case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
7830
7849
  return "Could not compress chat history due to a token counting error.";
7831
- case 4 /* COMPRESSION_FAILED_EMPTY_SUMMARY */:
7850
+ case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
7832
7851
  return "Chat history compression failed: the model returned an empty summary.";
7833
- case 5 /* NOOP */:
7852
+ case CompressionStatus.NOOP:
7834
7853
  return "Nothing to compress.";
7835
7854
  default:
7836
7855
  return "";
@@ -8256,8 +8275,8 @@ var ModelUsageTable = ({ models }) => {
8256
8275
  );
8257
8276
  roleEntries.sort(([a], [b]) => {
8258
8277
  if (a === b) return 0;
8259
- if (a === "main" /* MAIN */) return -1;
8260
- if (b === "main" /* MAIN */) return 1;
8278
+ if (a === LlmRole.MAIN) return -1;
8279
+ if (b === LlmRole.MAIN) return 1;
8261
8280
  return a.localeCompare(b);
8262
8281
  });
8263
8282
  roleEntries.forEach(([role, roleMetrics]) => {
@@ -8588,8 +8607,8 @@ var ModelStatsDisplay = ({
8588
8607
  return validRoles.includes(role);
8589
8608
  }).sort((a, b) => {
8590
8609
  if (a === b) return 0;
8591
- if (a === "main" /* MAIN */) return -1;
8592
- if (b === "main" /* MAIN */) return 1;
8610
+ if (a === LlmRole.MAIN) return -1;
8611
+ if (b === LlmRole.MAIN) return 1;
8593
8612
  return a.localeCompare(b);
8594
8613
  });
8595
8614
  const createRow = (metric, getValue, options = {}) => {
@@ -9380,7 +9399,7 @@ var McpStatus = ({
9380
9399
  );
9381
9400
  const originalStatus = serverStatus(serverName);
9382
9401
  const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
9383
- const status = originalStatus === "disconnected" /* DISCONNECTED */ && hasCachedItems ? "connected" /* CONNECTED */ : originalStatus;
9402
+ const status = originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems ? MCPServerStatus.CONNECTED : originalStatus;
9384
9403
  let statusIndicator = "";
9385
9404
  let statusText = "";
9386
9405
  let statusColor = theme.text.primary;
@@ -9392,17 +9411,17 @@ var McpStatus = ({
9392
9411
  statusColor = theme.text.secondary;
9393
9412
  } else {
9394
9413
  switch (status) {
9395
- case "connected" /* CONNECTED */:
9414
+ case MCPServerStatus.CONNECTED:
9396
9415
  statusIndicator = "\u{1F7E2}";
9397
9416
  statusText = "Ready";
9398
9417
  statusColor = theme.status.success;
9399
9418
  break;
9400
- case "connecting" /* CONNECTING */:
9419
+ case MCPServerStatus.CONNECTING:
9401
9420
  statusIndicator = "\u{1F504}";
9402
9421
  statusText = "Starting... (first startup may take longer)";
9403
9422
  statusColor = theme.status.warning;
9404
9423
  break;
9405
- case "disconnected" /* DISCONNECTED */:
9424
+ case MCPServerStatus.DISCONNECTED:
9406
9425
  default:
9407
9426
  statusIndicator = "\u{1F534}";
9408
9427
  statusText = "Disconnected";
@@ -9450,12 +9469,12 @@ var McpStatus = ({
9450
9469
  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
9451
9470
  " - ",
9452
9471
  statusText,
9453
- status === "connected" /* CONNECTED */ && parts.length > 0 && ` (${parts.join(", ")})`
9472
+ status === MCPServerStatus.CONNECTED && parts.length > 0 && ` (${parts.join(", ")})`
9454
9473
  ] }),
9455
9474
  authStatusNode
9456
9475
  ] }),
9457
- status === "connecting" /* CONNECTING */ && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
9458
- status === "disconnected" /* DISCONNECTED */ && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
9476
+ status === MCPServerStatus.CONNECTING && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
9477
+ status === MCPServerStatus.DISCONNECTED && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
9459
9478
  " (",
9460
9479
  toolCount,
9461
9480
  " tools cached)"
@@ -10016,7 +10035,7 @@ var Notifications = () => {
10016
10035
  if (dismissed) return [];
10017
10036
  const counts = persistentState.get("startupWarningCounts") || {};
10018
10037
  return startupWarnings.filter((w) => {
10019
- if (w.priority === "low" /* Low */) {
10038
+ if (w.priority === WarningPriority.Low) {
10020
10039
  const count = counts[w.id] || 0;
10021
10040
  return count < MAX_STARTUP_WARNING_SHOW_COUNT;
10022
10041
  }
@@ -10029,7 +10048,7 @@ var Notifications = () => {
10029
10048
  const counts = { ...persistentState.get("startupWarningCounts") || {} };
10030
10049
  let changed = false;
10031
10050
  visibleWarnings.forEach((w) => {
10032
- if (w.priority === "low" /* Low */) {
10051
+ if (w.priority === WarningPriority.Low) {
10033
10052
  counts[w.id] = (counts[w.id] || 0) + 1;
10034
10053
  changed = true;
10035
10054
  }
@@ -10136,7 +10155,7 @@ var UserIdentity = ({ config }) => {
10136
10155
  }
10137
10156
  return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { flexDirection: "column", children: [
10138
10157
  /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { children: [
10139
- /* @__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: [
10158
+ /* @__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: [
10140
10159
  /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { bold: true, children: [
10141
10160
  "Signed in with Google",
10142
10161
  email ? ":" : ""
@@ -10370,7 +10389,7 @@ var import_react32 = __toESM(require_react(), 1);
10370
10389
  function getConfirmingToolState(pendingHistoryItems) {
10371
10390
  const allPendingTools = getAllToolCalls(pendingHistoryItems);
10372
10391
  const confirmingTools = allPendingTools.filter(
10373
- (tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
10392
+ (tool) => tool.status === CoreToolCallStatus.AwaitingApproval
10374
10393
  );
10375
10394
  if (confirmingTools.length === 0) {
10376
10395
  return null;
@@ -11678,7 +11697,7 @@ var ExitPlanModeDialog = ({
11678
11697
  {
11679
11698
  questions: [
11680
11699
  {
11681
- type: "choice" /* CHOICE */,
11700
+ type: QuestionType.CHOICE,
11682
11701
  header: "Approval",
11683
11702
  question: planContent,
11684
11703
  options: [
@@ -11699,9 +11718,9 @@ var ExitPlanModeDialog = ({
11699
11718
  onSubmit: (answers) => {
11700
11719
  const answer = answers["0"];
11701
11720
  if (answer === "Yes, automatically accept edits" /* Auto */) {
11702
- onApprove("autoEdit" /* AUTO_EDIT */);
11721
+ onApprove(ApprovalMode.AUTO_EDIT);
11703
11722
  } else if (answer === "Yes, manually accept edits" /* Manual */) {
11704
- onApprove("default" /* DEFAULT */);
11723
+ onApprove(ApprovalMode.DEFAULT);
11705
11724
  } else if (answer) {
11706
11725
  onFeedback(answer);
11707
11726
  }
@@ -11912,7 +11931,7 @@ ${deceptiveUrlWarnings.map(
11912
11931
  );
11913
11932
  (0, import_react37.useEffect)(() => {
11914
11933
  if (isCancelling) {
11915
- handleConfirm("cancel" /* Cancel */);
11934
+ handleConfirm(ToolConfirmationOutcome.Cancel);
11916
11935
  }
11917
11936
  }, [isCancelling, handleConfirm]);
11918
11937
  const handleSelect = (0, import_react37.useCallback)(
@@ -11925,19 +11944,19 @@ ${deceptiveUrlWarnings.map(
11925
11944
  if (!confirmationDetails.isModifying) {
11926
11945
  options2.push({
11927
11946
  label: "Allow once",
11928
- value: "proceed_once" /* ProceedOnce */,
11947
+ value: ToolConfirmationOutcome.ProceedOnce,
11929
11948
  key: "Allow once"
11930
11949
  });
11931
11950
  if (isTrustedFolder) {
11932
11951
  options2.push({
11933
11952
  label: "Allow for this session",
11934
- value: "proceed_always" /* ProceedAlways */,
11953
+ value: ToolConfirmationOutcome.ProceedAlways,
11935
11954
  key: "Allow for this session"
11936
11955
  });
11937
11956
  if (allowPermanentApproval) {
11938
11957
  options2.push({
11939
11958
  label: "Allow for this file in all future sessions",
11940
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
11959
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
11941
11960
  key: "Allow for this file in all future sessions"
11942
11961
  });
11943
11962
  }
@@ -11945,119 +11964,119 @@ ${deceptiveUrlWarnings.map(
11945
11964
  if (!config.getIdeMode() || !isDiffingEnabled) {
11946
11965
  options2.push({
11947
11966
  label: "Modify with external editor",
11948
- value: "modify_with_editor" /* ModifyWithEditor */,
11967
+ value: ToolConfirmationOutcome.ModifyWithEditor,
11949
11968
  key: "Modify with external editor"
11950
11969
  });
11951
11970
  }
11952
11971
  options2.push({
11953
11972
  label: "No, suggest changes (esc)",
11954
- value: "cancel" /* Cancel */,
11973
+ value: ToolConfirmationOutcome.Cancel,
11955
11974
  key: "No, suggest changes (esc)"
11956
11975
  });
11957
11976
  }
11958
11977
  } else if (confirmationDetails.type === "sandbox_expansion") {
11959
11978
  options2.push({
11960
11979
  label: "Allow once",
11961
- value: "proceed_once" /* ProceedOnce */,
11980
+ value: ToolConfirmationOutcome.ProceedOnce,
11962
11981
  key: "Allow once"
11963
11982
  });
11964
11983
  if (isTrustedFolder) {
11965
11984
  options2.push({
11966
11985
  label: "Allow for this session",
11967
- value: "proceed_always" /* ProceedAlways */,
11986
+ value: ToolConfirmationOutcome.ProceedAlways,
11968
11987
  key: "Allow for this session"
11969
11988
  });
11970
11989
  if (allowPermanentApproval) {
11971
11990
  options2.push({
11972
11991
  label: "Allow for all future sessions",
11973
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
11992
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
11974
11993
  key: "Allow for all future sessions"
11975
11994
  });
11976
11995
  }
11977
11996
  }
11978
11997
  options2.push({
11979
11998
  label: "No, suggest changes (esc)",
11980
- value: "cancel" /* Cancel */,
11999
+ value: ToolConfirmationOutcome.Cancel,
11981
12000
  key: "No, suggest changes (esc)"
11982
12001
  });
11983
12002
  } else if (confirmationDetails.type === "exec") {
11984
12003
  options2.push({
11985
12004
  label: "Allow once",
11986
- value: "proceed_once" /* ProceedOnce */,
12005
+ value: ToolConfirmationOutcome.ProceedOnce,
11987
12006
  key: "Allow once"
11988
12007
  });
11989
12008
  if (isTrustedFolder) {
11990
12009
  options2.push({
11991
12010
  label: `Allow for this session`,
11992
- value: "proceed_always" /* ProceedAlways */,
12011
+ value: ToolConfirmationOutcome.ProceedAlways,
11993
12012
  key: `Allow for this session`
11994
12013
  });
11995
12014
  if (allowPermanentApproval) {
11996
12015
  options2.push({
11997
12016
  label: `Allow this command for all future sessions`,
11998
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12017
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
11999
12018
  key: `Allow for all future sessions`
12000
12019
  });
12001
12020
  }
12002
12021
  }
12003
12022
  options2.push({
12004
12023
  label: "No, suggest changes (esc)",
12005
- value: "cancel" /* Cancel */,
12024
+ value: ToolConfirmationOutcome.Cancel,
12006
12025
  key: "No, suggest changes (esc)"
12007
12026
  });
12008
12027
  } else if (confirmationDetails.type === "info") {
12009
12028
  options2.push({
12010
12029
  label: "Allow once",
12011
- value: "proceed_once" /* ProceedOnce */,
12030
+ value: ToolConfirmationOutcome.ProceedOnce,
12012
12031
  key: "Allow once"
12013
12032
  });
12014
12033
  if (isTrustedFolder) {
12015
12034
  options2.push({
12016
12035
  label: "Allow for this session",
12017
- value: "proceed_always" /* ProceedAlways */,
12036
+ value: ToolConfirmationOutcome.ProceedAlways,
12018
12037
  key: "Allow for this session"
12019
12038
  });
12020
12039
  if (allowPermanentApproval) {
12021
12040
  options2.push({
12022
12041
  label: "Allow for all future sessions",
12023
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12042
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12024
12043
  key: "Allow for all future sessions"
12025
12044
  });
12026
12045
  }
12027
12046
  }
12028
12047
  options2.push({
12029
12048
  label: "No, suggest changes (esc)",
12030
- value: "cancel" /* Cancel */,
12049
+ value: ToolConfirmationOutcome.Cancel,
12031
12050
  key: "No, suggest changes (esc)"
12032
12051
  });
12033
12052
  } else if (confirmationDetails.type === "mcp") {
12034
12053
  options2.push({
12035
12054
  label: "Allow once",
12036
- value: "proceed_once" /* ProceedOnce */,
12055
+ value: ToolConfirmationOutcome.ProceedOnce,
12037
12056
  key: "Allow once"
12038
12057
  });
12039
12058
  if (isTrustedFolder) {
12040
12059
  options2.push({
12041
12060
  label: "Allow tool for this session",
12042
- value: "proceed_always_tool" /* ProceedAlwaysTool */,
12061
+ value: ToolConfirmationOutcome.ProceedAlwaysTool,
12043
12062
  key: "Allow tool for this session"
12044
12063
  });
12045
12064
  options2.push({
12046
12065
  label: "Allow all server tools for this session",
12047
- value: "proceed_always_server" /* ProceedAlwaysServer */,
12066
+ value: ToolConfirmationOutcome.ProceedAlwaysServer,
12048
12067
  key: "Allow all server tools for this session"
12049
12068
  });
12050
12069
  if (allowPermanentApproval) {
12051
12070
  options2.push({
12052
12071
  label: "Allow tool for all future sessions",
12053
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12072
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12054
12073
  key: "Allow tool for all future sessions"
12055
12074
  });
12056
12075
  }
12057
12076
  }
12058
12077
  options2.push({
12059
12078
  label: "No, suggest changes (esc)",
12060
- value: "cancel" /* Cancel */,
12079
+ value: ToolConfirmationOutcome.Cancel,
12061
12080
  key: "No, suggest changes (esc)"
12062
12081
  });
12063
12082
  }
@@ -12096,7 +12115,7 @@ ${deceptiveUrlWarnings.map(
12096
12115
  const containsRedirection = commandsToDisplay.some(
12097
12116
  (cmd) => hasRedirection(cmd)
12098
12117
  );
12099
- const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
12118
+ const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
12100
12119
  if (containsRedirection && !isAutoEdit) {
12101
12120
  extraInfoLines = 1;
12102
12121
  }
@@ -12122,7 +12141,7 @@ ${deceptiveUrlWarnings.map(
12122
12141
  const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
12123
12142
  if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
12124
12143
  const alwaysAndSaveIndex = options2.findIndex(
12125
- (o) => o.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */
12144
+ (o) => o.value === ToolConfirmationOutcome.ProceedAlwaysAndSave
12126
12145
  );
12127
12146
  if (alwaysAndSaveIndex !== -1) {
12128
12147
  initialIndex2 = alwaysAndSaveIndex;
@@ -12139,10 +12158,10 @@ ${deceptiveUrlWarnings.map(
12139
12158
  {
12140
12159
  questions: confirmationDetails.questions,
12141
12160
  onSubmit: (answers) => {
12142
- handleConfirm("proceed_once" /* ProceedOnce */, { answers });
12161
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, { answers });
12143
12162
  },
12144
12163
  onCancel: () => {
12145
- handleConfirm("cancel" /* Cancel */);
12164
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12146
12165
  },
12147
12166
  width: terminalWidth,
12148
12167
  availableHeight: bodyHeight
@@ -12163,19 +12182,19 @@ ${deceptiveUrlWarnings.map(
12163
12182
  planPath: confirmationDetails.planPath,
12164
12183
  getPreferredEditor,
12165
12184
  onApprove: (approvalMode) => {
12166
- handleConfirm("proceed_once" /* ProceedOnce */, {
12185
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
12167
12186
  approved: true,
12168
12187
  approvalMode
12169
12188
  });
12170
12189
  },
12171
12190
  onFeedback: (feedback) => {
12172
- handleConfirm("proceed_once" /* ProceedOnce */, {
12191
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
12173
12192
  approved: false,
12174
12193
  feedback
12175
12194
  });
12176
12195
  },
12177
12196
  onCancel: () => {
12178
- handleConfirm("cancel" /* Cancel */);
12197
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12179
12198
  },
12180
12199
  width: terminalWidth,
12181
12200
  availableHeight: bodyHeight
@@ -12284,7 +12303,7 @@ ${deceptiveUrlWarnings.map(
12284
12303
  const containsRedirection = commandsToDisplay.some(
12285
12304
  (cmd) => hasRedirection(cmd)
12286
12305
  );
12287
- const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
12306
+ const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
12288
12307
  let warnings = null;
12289
12308
  if (containsRedirection && !isAutoEdit) {
12290
12309
  const tipText = `To auto-accept, press ${formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */)}`;
@@ -12443,7 +12462,7 @@ ${deceptiveUrlWarnings.map(
12443
12462
  const bodyOverflowDirection = confirmationDetails.type === "mcp" && isMcpToolDetailsExpanded ? "bottom" : "top";
12444
12463
  const renderRadioItem = (0, import_react37.useCallback)(
12445
12464
  (item, { titleColor }) => {
12446
- if (item.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */) {
12465
+ if (item.value === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
12447
12466
  return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(Text, { color: titleColor, wrap: "truncate", children: [
12448
12467
  item.label,
12449
12468
  " ",
@@ -14473,7 +14492,7 @@ async function validateAuthMethodWithSettings(authType, settings) {
14473
14492
  if (settings.merged.security.auth.useExternal) {
14474
14493
  return null;
14475
14494
  }
14476
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14495
+ if (authType === AuthType.USE_GEMINI) {
14477
14496
  return null;
14478
14497
  }
14479
14498
  return validateAuthMethod(authType);
@@ -14525,7 +14544,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
14525
14544
  }
14526
14545
  return;
14527
14546
  }
14528
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14547
+ if (authType === AuthType.USE_GEMINI) {
14529
14548
  const key = await reloadApiKey();
14530
14549
  if (!key) {
14531
14550
  setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
@@ -14603,31 +14622,31 @@ function AuthDialog({
14603
14622
  let items = [
14604
14623
  {
14605
14624
  label: "Sign in with Google",
14606
- value: "oauth-personal" /* LOGIN_WITH_GOOGLE */,
14607
- key: "oauth-personal" /* LOGIN_WITH_GOOGLE */
14625
+ value: AuthType.LOGIN_WITH_GOOGLE,
14626
+ key: AuthType.LOGIN_WITH_GOOGLE
14608
14627
  },
14609
14628
  ...process.env["CLOUD_SHELL"] === "true" ? [
14610
14629
  {
14611
14630
  label: "Use Cloud Shell user credentials",
14612
- value: "compute-default-credentials" /* COMPUTE_ADC */,
14613
- key: "compute-default-credentials" /* COMPUTE_ADC */
14631
+ value: AuthType.COMPUTE_ADC,
14632
+ key: AuthType.COMPUTE_ADC
14614
14633
  }
14615
14634
  ] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
14616
14635
  {
14617
14636
  label: "Use metadata server application default credentials",
14618
- value: "compute-default-credentials" /* COMPUTE_ADC */,
14619
- key: "compute-default-credentials" /* COMPUTE_ADC */
14637
+ value: AuthType.COMPUTE_ADC,
14638
+ key: AuthType.COMPUTE_ADC
14620
14639
  }
14621
14640
  ] : [],
14622
14641
  {
14623
14642
  label: "Use Gemini API Key",
14624
- value: "gemini-api-key" /* USE_GEMINI */,
14625
- key: "gemini-api-key" /* USE_GEMINI */
14643
+ value: AuthType.USE_GEMINI,
14644
+ key: AuthType.USE_GEMINI
14626
14645
  },
14627
14646
  {
14628
14647
  label: "Vertex AI",
14629
- value: "vertex-ai" /* USE_VERTEX_AI */,
14630
- key: "vertex-ai" /* USE_VERTEX_AI */
14648
+ value: AuthType.USE_VERTEX_AI,
14649
+ key: AuthType.USE_VERTEX_AI
14631
14650
  }
14632
14651
  ];
14633
14652
  if (settings.merged.security.auth.enforcedType) {
@@ -14649,9 +14668,9 @@ function AuthDialog({
14649
14668
  return item.value === defaultAuthType;
14650
14669
  }
14651
14670
  if (process.env["GEMINI_API_KEY"]) {
14652
- return item.value === "gemini-api-key" /* USE_GEMINI */;
14671
+ return item.value === AuthType.USE_GEMINI;
14653
14672
  }
14654
- return item.value === "oauth-personal" /* LOGIN_WITH_GOOGLE */;
14673
+ return item.value === AuthType.LOGIN_WITH_GOOGLE;
14655
14674
  });
14656
14675
  if (settings.merged.security.auth.enforcedType) {
14657
14676
  initialAuthIndex = 0;
@@ -14662,7 +14681,7 @@ function AuthDialog({
14662
14681
  return;
14663
14682
  }
14664
14683
  if (authType) {
14665
- const needsRestart = authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ || authType === "vertex-ai" /* USE_VERTEX_AI */ && process.env["CLOUD_SHELL"] === "true";
14684
+ const needsRestart = authType === AuthType.LOGIN_WITH_GOOGLE || authType === AuthType.USE_VERTEX_AI && process.env["CLOUD_SHELL"] === "true";
14666
14685
  if (needsRestart) {
14667
14686
  setAuthContext({ requiresRestart: true });
14668
14687
  } else {
@@ -14670,12 +14689,12 @@ function AuthDialog({
14670
14689
  }
14671
14690
  await clearCachedCredentialFile();
14672
14691
  settings.setValue(scope, "security.auth.selectedType", authType);
14673
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
14692
+ if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
14674
14693
  setExiting(true);
14675
14694
  setTimeout(relaunchApp, 100);
14676
14695
  return;
14677
14696
  }
14678
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14697
+ if (authType === AuthType.USE_GEMINI) {
14679
14698
  setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
14680
14699
  return;
14681
14700
  }
@@ -15422,11 +15441,11 @@ var PrivacyNoticeText = ({
15422
15441
  }) => {
15423
15442
  const authType = config.getContentGeneratorConfig()?.authType;
15424
15443
  switch (authType) {
15425
- case "gemini-api-key" /* USE_GEMINI */:
15444
+ case AuthType.USE_GEMINI:
15426
15445
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GeminiPrivacyNotice, { onExit });
15427
- case "vertex-ai" /* USE_VERTEX_AI */:
15446
+ case AuthType.USE_VERTEX_AI:
15428
15447
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudPaidPrivacyNotice, { onExit });
15429
- case "oauth-personal" /* LOGIN_WITH_GOOGLE */:
15448
+ case AuthType.LOGIN_WITH_GOOGLE:
15430
15449
  default:
15431
15450
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudFreePrivacyNotice, { config, onExit });
15432
15451
  }
@@ -15467,7 +15486,7 @@ function ProQuotaDialog({
15467
15486
  value: "retry_always",
15468
15487
  key: "retry_always"
15469
15488
  },
15470
- ...authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && !isUltra ? [
15489
+ ...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
15471
15490
  {
15472
15491
  label: "Upgrade for higher limits",
15473
15492
  value: "upgrade",
@@ -16624,9 +16643,8 @@ function ModelDialog({ onClose }) {
16624
16643
  const preferredModel = config?.getModel() || GEMINI_MODEL_ALIAS_AUTO;
16625
16644
  const shouldShowPreviewModels = config?.getHasAccessToPreviewModel() ?? false;
16626
16645
  const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
16627
- const useGemini31FlashLite = config?.getGemini31FlashLiteLaunchedSync?.() ?? false;
16628
16646
  const selectedAuthType = settings.merged.security.auth.selectedType;
16629
- const useCustomToolModel = useGemini31 && selectedAuthType === "gemini-api-key" /* USE_GEMINI */;
16647
+ const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
16630
16648
  const manualModelSelected = (0, import_react55.useMemo)(() => {
16631
16649
  if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
16632
16650
  const def = config.getModelConfigService().getModelDefinition(preferredModel);
@@ -16639,9 +16657,9 @@ function ModelDialog({ onClose }) {
16639
16657
  PREVIEW_GEMINI_MODEL,
16640
16658
  PREVIEW_GEMINI_3_1_MODEL,
16641
16659
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
16642
- PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
16660
+ PREVIEW_GEMINI_FLASH_LITE_MODEL,
16643
16661
  PREVIEW_GEMINI_FLASH_MODEL
16644
- ];
16662
+ ].filter((m) => m !== "none");
16645
16663
  if (manualModels.includes(preferredModel)) {
16646
16664
  return preferredModel;
16647
16665
  }
@@ -16669,7 +16687,6 @@ function ModelDialog({ onClose }) {
16669
16687
  if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
16670
16688
  const allOptions = config.getModelConfigService().getAvailableModelOptions({
16671
16689
  useGemini3_1: useGemini31,
16672
- useGemini3_1FlashLite: useGemini31FlashLite,
16673
16690
  useCustomTools: useCustomToolModel,
16674
16691
  hasAccessToPreview: shouldShowPreviewModels,
16675
16692
  hasAccessToProModel
@@ -16711,7 +16728,6 @@ function ModelDialog({ onClose }) {
16711
16728
  shouldShowPreviewModels,
16712
16729
  manualModelSelected,
16713
16730
  useGemini31,
16714
- useGemini31FlashLite,
16715
16731
  useCustomToolModel,
16716
16732
  hasAccessToProModel
16717
16733
  ]);
@@ -16719,7 +16735,6 @@ function ModelDialog({ onClose }) {
16719
16735
  if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
16720
16736
  const allOptions = config.getModelConfigService().getAvailableModelOptions({
16721
16737
  useGemini3_1: useGemini31,
16722
- useGemini3_1FlashLite: useGemini31FlashLite,
16723
16738
  useCustomTools: useCustomToolModel,
16724
16739
  hasAccessToPreview: shouldShowPreviewModels,
16725
16740
  hasAccessToProModel
@@ -16737,15 +16752,15 @@ function ModelDialog({ onClose }) {
16737
16752
  title: getDisplayString(DEFAULT_GEMINI_MODEL),
16738
16753
  key: DEFAULT_GEMINI_MODEL
16739
16754
  },
16740
- {
16741
- value: DEFAULT_GEMINI_FLASH_MODEL,
16742
- title: getDisplayString(DEFAULT_GEMINI_FLASH_MODEL),
16743
- key: DEFAULT_GEMINI_FLASH_MODEL
16744
- },
16745
16755
  {
16746
16756
  value: DEFAULT_GEMINI_FLASH_LITE_MODEL,
16747
16757
  title: getDisplayString(DEFAULT_GEMINI_FLASH_LITE_MODEL),
16748
16758
  key: DEFAULT_GEMINI_FLASH_LITE_MODEL
16759
+ },
16760
+ {
16761
+ value: DEFAULT_GEMINI_FLASH_MODEL,
16762
+ title: getDisplayString(DEFAULT_GEMINI_FLASH_MODEL),
16763
+ key: DEFAULT_GEMINI_FLASH_MODEL
16749
16764
  }
16750
16765
  ];
16751
16766
  if (showGemmaModels) {
@@ -16777,11 +16792,11 @@ function ModelDialog({ onClose }) {
16777
16792
  key: PREVIEW_GEMINI_FLASH_MODEL
16778
16793
  }
16779
16794
  ];
16780
- if (useGemini31FlashLite) {
16795
+ if (PREVIEW_GEMINI_FLASH_LITE_MODEL !== "none") {
16781
16796
  previewOptions.push({
16782
- value: PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
16783
- title: getDisplayString(PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL),
16784
- key: PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL
16797
+ value: PREVIEW_GEMINI_FLASH_LITE_MODEL,
16798
+ title: getDisplayString(PREVIEW_GEMINI_FLASH_LITE_MODEL),
16799
+ key: PREVIEW_GEMINI_FLASH_LITE_MODEL
16785
16800
  });
16786
16801
  }
16787
16802
  options2.unshift(...previewOptions);
@@ -16793,12 +16808,21 @@ function ModelDialog({ onClose }) {
16793
16808
  }, [
16794
16809
  shouldShowPreviewModels,
16795
16810
  useGemini31,
16796
- useGemini31FlashLite,
16797
16811
  useCustomToolModel,
16798
16812
  hasAccessToProModel,
16799
16813
  config
16800
16814
  ]);
16801
- const options = view === "main" ? mainOptions : manualOptions;
16815
+ const options = (0, import_react55.useMemo)(() => {
16816
+ const rawOptions = view === "main" ? mainOptions : manualOptions;
16817
+ const seen = /* @__PURE__ */ new Set();
16818
+ return rawOptions.filter((option) => {
16819
+ if (seen.has(option.value)) {
16820
+ return false;
16821
+ }
16822
+ seen.add(option.value);
16823
+ return true;
16824
+ });
16825
+ }, [view, mainOptions, manualOptions]);
16802
16826
  const initialIndex = (0, import_react55.useMemo)(() => {
16803
16827
  const idx = options.findIndex((option) => option.value === preferredModel);
16804
16828
  if (idx !== -1) {
@@ -17938,10 +17962,10 @@ function initializeConsoleStore() {
17938
17962
  globalConsoleMessages = [];
17939
17963
  globalErrorCount = 0;
17940
17964
  notifyListeners();
17941
- coreEvents.off("console-log" /* ConsoleLog */, handleConsoleLog);
17942
- coreEvents.off("output" /* Output */, handleOutput);
17943
- coreEvents.on("console-log" /* ConsoleLog */, handleConsoleLog);
17944
- coreEvents.on("output" /* Output */, handleOutput);
17965
+ coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
17966
+ coreEvents.off(CoreEvent.Output, handleOutput);
17967
+ coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
17968
+ coreEvents.on(CoreEvent.Output, handleOutput);
17945
17969
  }
17946
17970
  function notifyListeners() {
17947
17971
  for (const listener of listeners) {
@@ -20078,7 +20102,7 @@ function usePromptCompletion({
20078
20102
  { model: "prompt-completion" },
20079
20103
  contents,
20080
20104
  signal,
20081
- "utility_autocomplete" /* UTILITY_AUTOCOMPLETE */
20105
+ LlmRole.UTILITY_AUTOCOMPLETE
20082
20106
  );
20083
20107
  if (signal.aborted) {
20084
20108
  return;
@@ -22156,9 +22180,9 @@ var InputPrompt = ({
22156
22180
  onSuggestionsVisibilityChange(shouldShowSuggestions);
22157
22181
  }
22158
22182
  }, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
22159
- const showAutoAcceptStyling = !shellModeActive && approvalMode === "autoEdit" /* AUTO_EDIT */;
22160
- const showYoloStyling = !shellModeActive && approvalMode === "yolo" /* YOLO */;
22161
- const showPlanStyling = !shellModeActive && approvalMode === "plan" /* PLAN */;
22183
+ const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
22184
+ const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
22185
+ const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
22162
22186
  let statusColor;
22163
22187
  let statusText = "";
22164
22188
  if (shellModeActive) {
@@ -22990,22 +23014,22 @@ var ApprovalModeIndicator = ({
22990
23014
  const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
22991
23015
  const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
22992
23016
  switch (approvalMode) {
22993
- case "autoEdit" /* AUTO_EDIT */:
23017
+ case ApprovalMode.AUTO_EDIT:
22994
23018
  textColor = theme.status.warning;
22995
23019
  textContent = "auto-accept edits";
22996
23020
  subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
22997
23021
  break;
22998
- case "plan" /* PLAN */:
23022
+ case ApprovalMode.PLAN:
22999
23023
  textColor = theme.status.success;
23000
23024
  textContent = "plan";
23001
23025
  subText = `${cycleHint} to manual`;
23002
23026
  break;
23003
- case "yolo" /* YOLO */:
23027
+ case ApprovalMode.YOLO:
23004
23028
  textColor = theme.status.error;
23005
23029
  textContent = "YOLO";
23006
23030
  subText = yoloHint;
23007
23031
  break;
23008
- case "default" /* DEFAULT */:
23032
+ case ApprovalMode.DEFAULT:
23009
23033
  default:
23010
23034
  textColor = theme.text.accent;
23011
23035
  textContent = "";
@@ -23053,7 +23077,7 @@ var useComposerStatus = () => {
23053
23077
  (item) => item.type === "tool_group"
23054
23078
  ).some(
23055
23079
  (item) => item.tools.some(
23056
- (tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
23080
+ (tool) => tool.status === CoreToolCallStatus.AwaitingApproval
23057
23081
  )
23058
23082
  ),
23059
23083
  [uiState.pendingHistoryItems]
@@ -23068,13 +23092,13 @@ var useComposerStatus = () => {
23068
23092
  const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
23069
23093
  if (hideMinimalModeHintWhileBusy) return null;
23070
23094
  switch (showApprovalModeIndicator) {
23071
- case "yolo" /* YOLO */:
23095
+ case ApprovalMode.YOLO:
23072
23096
  return { text: "YOLO", color: theme.status.error };
23073
- case "plan" /* PLAN */:
23097
+ case ApprovalMode.PLAN:
23074
23098
  return { text: "plan", color: theme.status.success };
23075
- case "autoEdit" /* AUTO_EDIT */:
23099
+ case ApprovalMode.AUTO_EDIT:
23076
23100
  return { text: "auto edit", color: theme.status.warning };
23077
- case "default" /* DEFAULT */:
23101
+ case ApprovalMode.DEFAULT:
23078
23102
  default:
23079
23103
  return null;
23080
23104
  }
@@ -23428,7 +23452,7 @@ var ConfigInitDisplay = ({
23428
23452
  let connected = 0;
23429
23453
  const connecting = [];
23430
23454
  for (const [name, client] of clients.entries()) {
23431
- if (client.getStatus() === "connected" /* CONNECTED */) {
23455
+ if (client.getStatus() === MCPServerStatus.CONNECTED) {
23432
23456
  connected++;
23433
23457
  } else {
23434
23458
  connecting.push(name);
@@ -23450,9 +23474,9 @@ var ConfigInitDisplay = ({
23450
23474
  );
23451
23475
  }
23452
23476
  };
23453
- coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
23477
+ coreEvents.on(CoreEvent.McpClientUpdate, onChange);
23454
23478
  return () => {
23455
- coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
23479
+ coreEvents.off(CoreEvent.McpClientUpdate, onChange);
23456
23480
  };
23457
23481
  }, [initialMessage]);
23458
23482
  return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Text, { children: [
@@ -24169,7 +24193,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
24169
24193
  callId,
24170
24194
  name: SHELL_COMMAND_NAME,
24171
24195
  description: rawQuery,
24172
- status: "executing" /* Executing */,
24196
+ status: CoreToolCallStatus.Executing,
24173
24197
  isClientInitiated: true,
24174
24198
  resultDisplay: "",
24175
24199
  confirmationDetails: void 0
@@ -24310,7 +24334,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
24310
24334
  mainContent = result.output.trim() || "(Command produced no output)";
24311
24335
  }
24312
24336
  let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
24313
- let finalStatus = "success" /* Success */;
24337
+ let finalStatus = CoreToolCallStatus.Success;
24314
24338
  const prependToAnsiOutput = (output, text) => {
24315
24339
  const newLines = text.split("\n").map((line) => [
24316
24340
  {
@@ -24329,20 +24353,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
24329
24353
  };
24330
24354
  let prefix = "";
24331
24355
  if (result.error) {
24332
- finalStatus = "error" /* Error */;
24356
+ finalStatus = CoreToolCallStatus.Error;
24333
24357
  prefix = result.error.message;
24334
24358
  } else if (result.aborted) {
24335
- finalStatus = "cancelled" /* Cancelled */;
24359
+ finalStatus = CoreToolCallStatus.Cancelled;
24336
24360
  prefix = "Command was cancelled.";
24337
24361
  } else if (result.backgrounded) {
24338
- finalStatus = "success" /* Success */;
24362
+ finalStatus = CoreToolCallStatus.Success;
24339
24363
  finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
24340
24364
  mainContent = finalOutput;
24341
24365
  } else if (result.signal) {
24342
- finalStatus = "error" /* Error */;
24366
+ finalStatus = CoreToolCallStatus.Error;
24343
24367
  prefix = `Command terminated by signal: ${result.signal}.`;
24344
24368
  } else if (result.exitCode !== 0) {
24345
- finalStatus = "error" /* Error */;
24369
+ finalStatus = CoreToolCallStatus.Error;
24346
24370
  prefix = `Command exited with code ${result.exitCode}.`;
24347
24371
  }
24348
24372
  if (prefix) {
@@ -24368,7 +24392,7 @@ ${mainContent}`;
24368
24392
  status: finalStatus,
24369
24393
  resultDisplay: finalOutput
24370
24394
  };
24371
- if (finalStatus !== "cancelled" /* Cancelled */) {
24395
+ if (finalStatus !== CoreToolCallStatus.Cancelled) {
24372
24396
  addItemToHistory(
24373
24397
  {
24374
24398
  type: "tool_group",
@@ -25358,7 +25382,7 @@ function useQuotaAndFallback({
25358
25382
  error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
25359
25383
  `/stats model for usage details`,
25360
25384
  `/model to switch models.`,
25361
- contentGeneratorConfig?.authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? `/auth to switch to API key.` : null
25385
+ contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
25362
25386
  ].filter(Boolean);
25363
25387
  message = messageLines.join("\n");
25364
25388
  } else if (error instanceof ModelNotFoundError) {
@@ -25546,7 +25570,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
25546
25570
  );
25547
25571
  setEditorError(null);
25548
25572
  setIsEditorDialogOpen(false);
25549
- coreEvents.emit("editor-selected" /* EditorSelected */, { editor: editorType });
25573
+ coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
25550
25574
  } catch (error) {
25551
25575
  setEditorError(`Failed to set editor preference: ${error}`);
25552
25576
  }
@@ -25555,7 +25579,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
25555
25579
  );
25556
25580
  const exitEditorDialog = (0, import_react91.useCallback)(() => {
25557
25581
  setIsEditorDialogOpen(false);
25558
- coreEvents.emit("editor-selected" /* EditorSelected */, { editor: void 0 });
25582
+ coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
25559
25583
  }, []);
25560
25584
  return {
25561
25585
  isEditorDialogOpen,
@@ -25932,7 +25956,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
25932
25956
  canonicalPath: resolvedCommandPath
25933
25957
  } = parseSlashCommand(trimmed, commands);
25934
25958
  if (!commandToExecute) {
25935
- const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === "in_progress" /* IN_PROGRESS */;
25959
+ const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
25936
25960
  if (isMcpLoading) {
25937
25961
  setIsProcessing(true);
25938
25962
  if (addToHistory) {
@@ -26112,7 +26136,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26112
26136
  onConfirm: async (resolvedOutcome) => {
26113
26137
  resolve3({
26114
26138
  outcome: resolvedOutcome,
26115
- approvedCommands: resolvedOutcome === "cancel" /* Cancel */ ? [] : result.commandsToConfirm
26139
+ approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
26116
26140
  });
26117
26141
  }
26118
26142
  };
@@ -26120,7 +26144,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26120
26144
  callId,
26121
26145
  name: "Expansion",
26122
26146
  description: "Command expansion needs shell access",
26123
- status: "awaiting_approval" /* AwaitingApproval */,
26147
+ status: CoreToolCallStatus.AwaitingApproval,
26124
26148
  isClientInitiated: true,
26125
26149
  resultDisplay: void 0,
26126
26150
  confirmationDetails
@@ -26131,7 +26155,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26131
26155
  });
26132
26156
  });
26133
26157
  setPendingItem(null);
26134
- if (outcome === "cancel" /* Cancel */ || !approvedCommands || approvedCommands.length === 0) {
26158
+ if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
26135
26159
  addItem(
26136
26160
  {
26137
26161
  type: "info" /* INFO */,
@@ -26141,7 +26165,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26141
26165
  );
26142
26166
  return { type: "handled" };
26143
26167
  }
26144
- if (outcome === "proceed_always" /* ProceedAlways */) {
26168
+ if (outcome === ToolConfirmationOutcome.ProceedAlways) {
26145
26169
  setSessionShellAllowlist(
26146
26170
  (prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
26147
26171
  );
@@ -26617,7 +26641,7 @@ function mapToDisplay(toolOrTools, options = {}) {
26617
26641
  let description;
26618
26642
  let renderOutputAsMarkdown = false;
26619
26643
  const displayName = call.tool?.displayName ?? call.request.name;
26620
- if (call.status === "error" /* Error */) {
26644
+ if (call.status === CoreToolCallStatus.Error) {
26621
26645
  description = JSON.stringify(call.request.args);
26622
26646
  } else {
26623
26647
  description = call.invocation.getDescription();
@@ -26640,27 +26664,27 @@ function mapToDisplay(toolOrTools, options = {}) {
26640
26664
  let progress = void 0;
26641
26665
  let progressTotal = void 0;
26642
26666
  switch (call.status) {
26643
- case "success" /* Success */:
26667
+ case CoreToolCallStatus.Success:
26644
26668
  resultDisplay = call.response.resultDisplay;
26645
26669
  outputFile = call.response.outputFile;
26646
26670
  break;
26647
- case "error" /* Error */:
26648
- case "cancelled" /* Cancelled */:
26671
+ case CoreToolCallStatus.Error:
26672
+ case CoreToolCallStatus.Cancelled:
26649
26673
  resultDisplay = call.response.resultDisplay;
26650
26674
  break;
26651
- case "awaiting_approval" /* AwaitingApproval */:
26675
+ case CoreToolCallStatus.AwaitingApproval:
26652
26676
  correlationId = call.correlationId;
26653
26677
  confirmationDetails = call.confirmationDetails;
26654
26678
  break;
26655
- case "executing" /* Executing */:
26679
+ case CoreToolCallStatus.Executing:
26656
26680
  resultDisplay = call.liveOutput;
26657
26681
  ptyId = call.pid;
26658
26682
  progressMessage = call.progressMessage;
26659
26683
  progress = call.progress;
26660
26684
  progressTotal = call.progressTotal;
26661
26685
  break;
26662
- case "scheduled" /* Scheduled */:
26663
- case "validating" /* Validating */:
26686
+ case CoreToolCallStatus.Scheduled:
26687
+ case CoreToolCallStatus.Validating:
26664
26688
  break;
26665
26689
  default: {
26666
26690
  const exhaustiveCheck = call;
@@ -26731,7 +26755,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26731
26755
  const handler = (event) => {
26732
26756
  const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
26733
26757
  const hasExecuting = event.toolCalls.some(
26734
- (tc) => tc.status === "executing" /* Executing */ || (tc.status === "success" /* Success */ || tc.status === "error" /* Error */) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
26758
+ (tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
26735
26759
  );
26736
26760
  if (hasExecuting) {
26737
26761
  setLastToolOutputTime(Date.now());
@@ -26740,7 +26764,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26740
26764
  const prevCalls = prev[event.schedulerId] ?? [];
26741
26765
  const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
26742
26766
  const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
26743
- (tc) => tc.status === "awaiting_approval" /* AwaitingApproval */ || prevCallIds.has(tc.request.callId)
26767
+ (tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
26744
26768
  );
26745
26769
  if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
26746
26770
  return prev;
@@ -26752,9 +26776,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26752
26776
  };
26753
26777
  });
26754
26778
  };
26755
- messageBus.subscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
26779
+ messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
26756
26780
  return () => {
26757
- messageBus.unsubscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
26781
+ messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
26758
26782
  };
26759
26783
  }, [messageBus, internalAdaptToolCalls]);
26760
26784
  (0, import_react98.useEffect)(() => {
@@ -26776,9 +26800,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26776
26800
  };
26777
26801
  });
26778
26802
  };
26779
- messageBus.subscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
26803
+ messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
26780
26804
  return () => {
26781
- messageBus.unsubscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
26805
+ messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
26782
26806
  };
26783
26807
  }, [messageBus]);
26784
26808
  const schedule = (0, import_react98.useCallback)(
@@ -26877,8 +26901,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
26877
26901
  const prev = prevMap.get(coreCall.request.callId);
26878
26902
  const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
26879
26903
  let status = coreCall.status;
26880
- if ((status === "success" /* Success */ || status === "error" /* Error */) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
26881
- status = "executing" /* Executing */;
26904
+ if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
26905
+ status = CoreToolCallStatus.Executing;
26882
26906
  }
26883
26907
  return {
26884
26908
  ...coreCall,
@@ -26910,7 +26934,7 @@ function getBackgroundedToolInfo(toolCall) {
26910
26934
  };
26911
26935
  }
26912
26936
  function isBackgroundableExecutingToolCall(toolCall) {
26913
- return toolCall.status === "executing" /* Executing */ && typeof toolCall.pid === "number";
26937
+ return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
26914
26938
  }
26915
26939
  function showCitations(settings) {
26916
26940
  const enabled = settings.merged.ui.showCitations;
@@ -26920,14 +26944,14 @@ function showCitations(settings) {
26920
26944
  return true;
26921
26945
  }
26922
26946
  function calculateStreamingState(isResponding, toolCalls) {
26923
- if (toolCalls.some((tc) => tc.status === "awaiting_approval" /* AwaitingApproval */)) {
26947
+ if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
26924
26948
  return "waiting_for_confirmation" /* WaitingForConfirmation */;
26925
26949
  }
26926
26950
  const isAnyToolActive = toolCalls.some((tc) => {
26927
- if (tc.status === "executing" /* Executing */ || tc.status === "scheduled" /* Scheduled */ || tc.status === "validating" /* Validating */) {
26951
+ if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
26928
26952
  return true;
26929
26953
  }
26930
- if (tc.status === "success" /* Success */ || tc.status === "error" /* Error */ || tc.status === "cancelled" /* Cancelled */) {
26954
+ if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
26931
26955
  return !tc.responseSubmittedToGemini;
26932
26956
  }
26933
26957
  return false;
@@ -26973,9 +26997,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
26973
26997
  }
26974
26998
  setRetryStatus(payload);
26975
26999
  };
26976
- coreEvents.on("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
27000
+ coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
26977
27001
  return () => {
26978
- coreEvents.off("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
27002
+ coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
26979
27003
  };
26980
27004
  }, [isRespondingRef]);
26981
27005
  const [
@@ -27108,12 +27132,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27108
27132
  const tc = toolCalls[i];
27109
27133
  if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
27110
27134
  if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
27111
- const isAgent = tc.tool?.kind === "agent" /* Agent */;
27135
+ const isAgent = tc.tool?.kind === Kind.Agent;
27112
27136
  if (isAgent) {
27113
27137
  let contigAgentsComplete = true;
27114
27138
  for (let j = i + 1; j < toolCalls.length; j++) {
27115
27139
  const nextTc = toolCalls[j];
27116
- if (nextTc.tool?.kind === "agent" /* Agent */) {
27140
+ if (nextTc.tool?.kind === Kind.Agent) {
27117
27141
  if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
27118
27142
  contigAgentsComplete = false;
27119
27143
  break;
@@ -27139,7 +27163,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27139
27163
  let currentGroup = [];
27140
27164
  for (const tc of toolsToPush) {
27141
27165
  newPushed.add(tc.request.callId);
27142
- if (tc.tool?.kind === "agent" /* Agent */) {
27166
+ if (tc.tool?.kind === Kind.Agent) {
27143
27167
  currentGroup.push(tc);
27144
27168
  } else {
27145
27169
  if (currentGroup.length > 0) {
@@ -27289,7 +27313,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27289
27313
  prevActiveShellPtyIdRef.current = activeShellPtyId;
27290
27314
  }, [activeShellPtyId, addItem, setIsResponding]);
27291
27315
  (0, import_react99.useEffect)(() => {
27292
- if (config.getApprovalMode() === "yolo" /* YOLO */ && streamingState === "idle" /* Idle */) {
27316
+ if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
27293
27317
  const lastUserMessageIndex = history.findLastIndex(
27294
27318
  (item) => item.type === "user" /* USER */
27295
27319
  );
@@ -27357,7 +27381,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27357
27381
  return;
27358
27382
  }
27359
27383
  const hasActiveTools = toolCalls.some(
27360
- (tc) => tc.status === "executing" /* Executing */ || tc.status === "scheduled" /* Scheduled */ || tc.status === "validating" /* Validating */
27384
+ (tc) => tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating
27361
27385
  );
27362
27386
  if (streamingState === "idle" /* Idle */ && !isRespondingRef.current && !hasActiveTools) {
27363
27387
  if (clearBuffer) {
@@ -27384,7 +27408,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27384
27408
  if (tool.name === SHELL_COMMAND_NAME) {
27385
27409
  return {
27386
27410
  ...tool,
27387
- status: "cancelled" /* Cancelled */,
27411
+ status: CoreToolCallStatus.Cancelled,
27388
27412
  resultDisplay: tool.resultDisplay
27389
27413
  };
27390
27414
  }
@@ -27449,7 +27473,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27449
27473
  let localQueryToSendToGemini = null;
27450
27474
  if (typeof query === "string") {
27451
27475
  const trimmedQuery = query.trim();
27452
- await logger?.logMessage("user" /* USER */, trimmedQuery);
27476
+ await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
27453
27477
  if (!shellModeActive) {
27454
27478
  const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
27455
27479
  if (slashCommandResult) {
@@ -27605,7 +27629,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27605
27629
  if (pendingHistoryItemRef.current) {
27606
27630
  if (pendingHistoryItemRef.current.type === "tool_group") {
27607
27631
  const updatedTools = pendingHistoryItemRef.current.tools.map(
27608
- (tool) => tool.status === "validating" /* Validating */ || tool.status === "scheduled" /* Scheduled */ || tool.status === "awaiting_approval" /* AwaitingApproval */ || tool.status === "executing" /* Executing */ ? { ...tool, status: "cancelled" /* Cancelled */ } : tool
27632
+ (tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
27609
27633
  );
27610
27634
  const pendingItem = {
27611
27635
  ...pendingHistoryItemRef.current,
@@ -27851,15 +27875,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27851
27875
  let geminiMessageBuffer = "";
27852
27876
  const toolCallRequests = [];
27853
27877
  for await (const event of stream) {
27854
- if (event.type !== "thought" /* Thought */ && thoughtRef.current !== null) {
27878
+ if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
27855
27879
  setThought(null);
27856
27880
  }
27857
27881
  switch (event.type) {
27858
- case "thought" /* Thought */:
27882
+ case GeminiEventType.Thought:
27859
27883
  setLastGeminiActivityTime(Date.now());
27860
27884
  handleThoughtEvent(event.value, userMessageTimestamp);
27861
27885
  break;
27862
- case "content" /* Content */:
27886
+ case GeminiEventType.Content:
27863
27887
  setLastGeminiActivityTime(Date.now());
27864
27888
  geminiMessageBuffer = handleContentEvent(
27865
27889
  event.value,
@@ -27867,16 +27891,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27867
27891
  userMessageTimestamp
27868
27892
  );
27869
27893
  break;
27870
- case "tool_call_request" /* ToolCallRequest */:
27894
+ case GeminiEventType.ToolCallRequest:
27871
27895
  toolCallRequests.push(event.value);
27872
27896
  break;
27873
- case "user_cancelled" /* UserCancelled */:
27897
+ case GeminiEventType.UserCancelled:
27874
27898
  handleUserCancelledEvent(userMessageTimestamp);
27875
27899
  break;
27876
- case "error" /* Error */:
27900
+ case GeminiEventType.Error:
27877
27901
  handleErrorEvent(event.value, userMessageTimestamp);
27878
27902
  break;
27879
- case "agent_execution_stopped" /* AgentExecutionStopped */:
27903
+ case GeminiEventType.AgentExecutionStopped:
27880
27904
  handleAgentExecutionStoppedEvent(
27881
27905
  event.value.reason,
27882
27906
  userMessageTimestamp,
@@ -27884,7 +27908,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27884
27908
  event.value.contextCleared
27885
27909
  );
27886
27910
  break;
27887
- case "agent_execution_blocked" /* AgentExecutionBlocked */:
27911
+ case GeminiEventType.AgentExecutionBlocked:
27888
27912
  handleAgentExecutionBlockedEvent(
27889
27913
  event.value.reason,
27890
27914
  userMessageTimestamp,
@@ -27892,35 +27916,35 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27892
27916
  event.value.contextCleared
27893
27917
  );
27894
27918
  break;
27895
- case "chat_compressed" /* ChatCompressed */:
27919
+ case GeminiEventType.ChatCompressed:
27896
27920
  handleChatCompressionEvent(event.value, userMessageTimestamp);
27897
27921
  break;
27898
- case "tool_call_confirmation" /* ToolCallConfirmation */:
27899
- case "tool_call_response" /* ToolCallResponse */:
27922
+ case GeminiEventType.ToolCallConfirmation:
27923
+ case GeminiEventType.ToolCallResponse:
27900
27924
  break;
27901
- case "max_session_turns" /* MaxSessionTurns */:
27925
+ case GeminiEventType.MaxSessionTurns:
27902
27926
  handleMaxSessionTurnsEvent();
27903
27927
  break;
27904
- case "context_window_will_overflow" /* ContextWindowWillOverflow */:
27928
+ case GeminiEventType.ContextWindowWillOverflow:
27905
27929
  handleContextWindowWillOverflowEvent(
27906
27930
  event.value.estimatedRequestTokenCount,
27907
27931
  event.value.remainingTokenCount
27908
27932
  );
27909
27933
  break;
27910
- case "finished" /* Finished */:
27934
+ case GeminiEventType.Finished:
27911
27935
  handleFinishedEvent(event, userMessageTimestamp);
27912
27936
  break;
27913
- case "citation" /* Citation */:
27937
+ case GeminiEventType.Citation:
27914
27938
  handleCitationEvent(event.value, userMessageTimestamp);
27915
27939
  break;
27916
- case "model_info" /* ModelInfo */:
27940
+ case GeminiEventType.ModelInfo:
27917
27941
  handleChatModelEvent(event.value, userMessageTimestamp);
27918
27942
  break;
27919
- case "loop_detected" /* LoopDetected */:
27943
+ case GeminiEventType.LoopDetected:
27920
27944
  loopDetectedRef.current = true;
27921
27945
  break;
27922
- case "retry" /* Retry */:
27923
- case "invalid_stream" /* InvalidStream */:
27946
+ case GeminiEventType.Retry:
27947
+ case GeminiEventType.InvalidStream:
27924
27948
  break;
27925
27949
  default: {
27926
27950
  const unreachable = event;
@@ -27961,7 +27985,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27961
27985
  const submitQuery = (0, import_react99.useCallback)(
27962
27986
  async (query, options, prompt_id) => runInDevTraceSpan(
27963
27987
  {
27964
- operation: options?.isContinuation ? "system_prompt" /* SystemPrompt */ : "user_prompt" /* UserPrompt */,
27988
+ operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
27965
27989
  sessionId: config.getSessionId()
27966
27990
  },
27967
27991
  async ({ metadata: spanMetadata }) => {
@@ -28121,7 +28145,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28121
28145
  );
28122
28146
  const handleApprovalModeChange = (0, import_react99.useCallback)(
28123
28147
  async (newApprovalMode) => {
28124
- if (previousApprovalModeRef.current === "plan" /* PLAN */ && newApprovalMode !== "plan" /* PLAN */ && streamingState === "idle" /* Idle */) {
28148
+ if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
28125
28149
  if (geminiClient) {
28126
28150
  try {
28127
28151
  await geminiClient.addHistory({
@@ -28144,11 +28168,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28144
28168
  }
28145
28169
  }
28146
28170
  previousApprovalModeRef.current = newApprovalMode;
28147
- if (newApprovalMode === "yolo" /* YOLO */ || newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
28171
+ if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
28148
28172
  let awaitingApprovalCalls = toolCalls.filter(
28149
28173
  (call) => call.status === "awaiting_approval" && !call.request.forcedAsk
28150
28174
  );
28151
- if (newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
28175
+ if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
28152
28176
  awaitingApprovalCalls = awaitingApprovalCalls.filter((call) => {
28153
28177
  if (EDIT_TOOL_NAMES.has(call.request.name)) {
28154
28178
  return true;
@@ -28164,11 +28188,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28164
28188
  if (call.correlationId) {
28165
28189
  try {
28166
28190
  await config.getMessageBus().publish({
28167
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
28191
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
28168
28192
  correlationId: call.correlationId,
28169
28193
  confirmed: true,
28170
28194
  requiresUserConfirmation: false,
28171
- outcome: "proceed_once" /* ProceedOnce */
28195
+ outcome: ToolConfirmationOutcome.ProceedOnce
28172
28196
  });
28173
28197
  } catch (error) {
28174
28198
  debugLogger.warn(
@@ -28237,14 +28261,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28237
28261
  );
28238
28262
  if (isLowErrorVerbosity) {
28239
28263
  suppressedToolErrorCountRef.current += geminiTools.filter(
28240
- (tc) => tc.status === "error" /* Error */
28264
+ (tc) => tc.status === CoreToolCallStatus.Error
28241
28265
  ).length;
28242
28266
  }
28243
28267
  if (geminiTools.length === 0) {
28244
28268
  return;
28245
28269
  }
28246
28270
  const stopExecutionTool = geminiTools.find(
28247
- (tc) => tc.response.errorType === "stop_execution" /* STOP_EXECUTION */
28271
+ (tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
28248
28272
  );
28249
28273
  if (stopExecutionTool && stopExecutionTool.response.error) {
28250
28274
  maybeAddSuppressedToolErrorNote();
@@ -28264,9 +28288,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28264
28288
  (tc) => !isTopicTool2(tc.request.name)
28265
28289
  );
28266
28290
  const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
28267
- (tc) => tc.status === "cancelled" /* Cancelled */
28291
+ (tc) => tc.status === CoreToolCallStatus.Cancelled
28268
28292
  );
28269
- const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === "cancelled" /* Cancelled */);
28293
+ const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
28270
28294
  if (allDeclinableToolsCancelled || allToolsCancelled) {
28271
28295
  if (!turnCancelledRef.current) {
28272
28296
  addItem({
@@ -28346,7 +28370,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28346
28370
  return;
28347
28371
  }
28348
28372
  const restorableToolCalls = toolCalls.filter(
28349
- (toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === "awaiting_approval" /* AwaitingApproval */
28373
+ (toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
28350
28374
  );
28351
28375
  if (restorableToolCalls.length > 0) {
28352
28376
  if (!gitService) {
@@ -28569,14 +28593,14 @@ var useAgentStream = ({
28569
28593
  const displayName = legacyState?.displayName ?? event.name;
28570
28594
  const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
28571
28595
  const desc = legacyState?.description ?? "";
28572
- const fallbackKind = "other" /* Other */;
28596
+ const fallbackKind = Kind.Other;
28573
28597
  const newCall = {
28574
28598
  callId: event.requestId,
28575
28599
  name: displayName,
28576
28600
  originalRequestName: event.name,
28577
28601
  description: desc,
28578
28602
  display: event.display,
28579
- status: "scheduled" /* Scheduled */,
28603
+ status: CoreToolCallStatus.Scheduled,
28580
28604
  isClientInitiated: false,
28581
28605
  renderOutputAsMarkdown: isOutputMarkdown,
28582
28606
  kind: legacyState?.kind ?? fallbackKind,
@@ -28594,10 +28618,10 @@ var useAgentStream = ({
28594
28618
  const evtStatus = legacyState?.status;
28595
28619
  let status = tc.status;
28596
28620
  if (evtStatus === "executing")
28597
- status = "executing" /* Executing */;
28598
- else if (evtStatus === "error") status = "error" /* Error */;
28621
+ status = CoreToolCallStatus.Executing;
28622
+ else if (evtStatus === "error") status = CoreToolCallStatus.Error;
28599
28623
  else if (evtStatus === "success")
28600
- status = "success" /* Success */;
28624
+ status = CoreToolCallStatus.Success;
28601
28625
  const display = event.display?.result;
28602
28626
  const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
28603
28627
  const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
@@ -28630,7 +28654,7 @@ var useAgentStream = ({
28630
28654
  const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
28631
28655
  return {
28632
28656
  ...tc,
28633
- status: event.isError ? "error" /* Error */ : "success" /* Success */,
28657
+ status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
28634
28658
  display: event.display ? { ...tc.display, ...event.display } : tc.display,
28635
28659
  resultDisplay,
28636
28660
  outputFile
@@ -28696,7 +28720,7 @@ var useAgentStream = ({
28696
28720
  if (!options?.isContinuation) {
28697
28721
  if (typeof query === "string") {
28698
28722
  addItem({ type: "user" /* USER */, text: query }, timestamp);
28699
- void logger?.logMessage("user" /* USER */, query);
28723
+ void logger?.logMessage(MessageSenderType.USER, query);
28700
28724
  }
28701
28725
  startNewPrompt();
28702
28726
  }
@@ -30223,9 +30247,9 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30223
30247
  const handleFolderTrustSelect = (0, import_react105.useCallback)(
30224
30248
  async (choice) => {
30225
30249
  const trustLevelMap = {
30226
- ["trust_folder" /* TRUST_FOLDER */]: "TRUST_FOLDER" /* TRUST_FOLDER */,
30227
- ["trust_parent" /* TRUST_PARENT */]: "TRUST_PARENT" /* TRUST_PARENT */,
30228
- ["do_not_trust" /* DO_NOT_TRUST */]: "DO_NOT_TRUST" /* DO_NOT_TRUST */
30250
+ ["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
30251
+ ["trust_parent" /* TRUST_PARENT */]: TrustLevel.TRUST_PARENT,
30252
+ ["do_not_trust" /* DO_NOT_TRUST */]: TrustLevel.DO_NOT_TRUST
30229
30253
  };
30230
30254
  const trustLevel = trustLevelMap[choice];
30231
30255
  if (!trustLevel) return;
@@ -30244,7 +30268,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30244
30268
  }, 100);
30245
30269
  return;
30246
30270
  }
30247
- const currentIsTrusted = trustLevel === "TRUST_FOLDER" /* TRUST_FOLDER */ || trustLevel === "TRUST_PARENT" /* TRUST_PARENT */;
30271
+ const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
30248
30272
  onTrustChange(currentIsTrusted);
30249
30273
  setIsTrusted(currentIsTrusted);
30250
30274
  const wasTrusted = isTrusted ?? false;
@@ -31252,7 +31276,7 @@ function useMessageQueue({
31252
31276
  var import_react107 = __toESM(require_react(), 1);
31253
31277
  function useMcpStatus(config) {
31254
31278
  const [discoveryState, setDiscoveryState] = (0, import_react107.useState)(
31255
- () => config.getMcpClientManager()?.getDiscoveryState() ?? "not_started" /* NOT_STARTED */
31279
+ () => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
31256
31280
  );
31257
31281
  const [mcpServerCount, setMcpServerCount] = (0, import_react107.useState)(
31258
31282
  () => config.getMcpClientManager()?.getMcpServerCount() ?? 0
@@ -31265,12 +31289,12 @@ function useMcpStatus(config) {
31265
31289
  setMcpServerCount(manager.getMcpServerCount());
31266
31290
  }
31267
31291
  };
31268
- coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
31292
+ coreEvents.on(CoreEvent.McpClientUpdate, onChange);
31269
31293
  return () => {
31270
- coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
31294
+ coreEvents.off(CoreEvent.McpClientUpdate, onChange);
31271
31295
  };
31272
31296
  }, [config]);
31273
- const isMcpReady = discoveryState === "completed" /* COMPLETED */ || discoveryState === "not_started" /* NOT_STARTED */ && mcpServerCount === 0;
31297
+ const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
31274
31298
  return {
31275
31299
  discoveryState,
31276
31300
  mcpServerCount,
@@ -31297,7 +31321,7 @@ function useApprovalModeIndicator({
31297
31321
  (key) => {
31298
31322
  let nextApprovalMode;
31299
31323
  if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
31300
- if (config.isYoloModeDisabled() && config.getApprovalMode() !== "yolo" /* YOLO */) {
31324
+ if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
31301
31325
  if (addItem) {
31302
31326
  let text = "You cannot enter YOLO mode since it is disabled in your settings.";
31303
31327
  const adminSettings = config.getRemoteAdminSettings();
@@ -31315,21 +31339,21 @@ function useApprovalModeIndicator({
31315
31339
  }
31316
31340
  return;
31317
31341
  }
31318
- nextApprovalMode = config.getApprovalMode() === "yolo" /* YOLO */ ? "default" /* DEFAULT */ : "yolo" /* YOLO */;
31342
+ nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
31319
31343
  } else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
31320
31344
  const currentMode = config.getApprovalMode();
31321
31345
  switch (currentMode) {
31322
- case "default" /* DEFAULT */:
31323
- nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
31346
+ case ApprovalMode.DEFAULT:
31347
+ nextApprovalMode = ApprovalMode.AUTO_EDIT;
31324
31348
  break;
31325
- case "autoEdit" /* AUTO_EDIT */:
31326
- nextApprovalMode = allowPlanMode ? "plan" /* PLAN */ : "default" /* DEFAULT */;
31349
+ case ApprovalMode.AUTO_EDIT:
31350
+ nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
31327
31351
  break;
31328
- case "plan" /* PLAN */:
31329
- nextApprovalMode = "default" /* DEFAULT */;
31352
+ case ApprovalMode.PLAN:
31353
+ nextApprovalMode = ApprovalMode.DEFAULT;
31330
31354
  break;
31331
- case "yolo" /* YOLO */:
31332
- nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
31355
+ case ApprovalMode.YOLO:
31356
+ nextApprovalMode = ApprovalMode.AUTO_EDIT;
31333
31357
  break;
31334
31358
  default:
31335
31359
  }
@@ -31739,11 +31763,11 @@ var useHookDisplayState = () => {
31739
31763
  removeHook();
31740
31764
  }
31741
31765
  };
31742
- coreEvents.on("hook-start" /* HookStart */, handleHookStart);
31743
- coreEvents.on("hook-end" /* HookEnd */, handleHookEnd);
31766
+ coreEvents.on(CoreEvent.HookStart, handleHookStart);
31767
+ coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
31744
31768
  return () => {
31745
- coreEvents.off("hook-start" /* HookStart */, handleHookStart);
31746
- coreEvents.off("hook-end" /* HookEnd */, handleHookEnd);
31769
+ coreEvents.off(CoreEvent.HookStart, handleHookStart);
31770
+ coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
31747
31771
  activeTimeouts.forEach(clearTimeout);
31748
31772
  activeTimeouts.clear();
31749
31773
  };
@@ -31913,8 +31937,6 @@ import process11 from "node:process";
31913
31937
  function useSuspend({
31914
31938
  handleWarning,
31915
31939
  setRawMode,
31916
- refreshStatic,
31917
- setForceRerenderKey,
31918
31940
  shouldUseAlternateScreen
31919
31941
  }) {
31920
31942
  const [ctrlZPressCount, setCtrlZPressCount] = (0, import_react117.useState)(0);
@@ -31976,10 +31998,6 @@ function useSuspend({
31976
31998
  enableMouseEvents();
31977
31999
  }
31978
32000
  process11.stdout.emit("resize");
31979
- setImmediate(() => {
31980
- refreshStatic();
31981
- setForceRerenderKey((prev) => prev + 1);
31982
- });
31983
32001
  } finally {
31984
32002
  if (onResumeHandlerRef.current === onResume) {
31985
32003
  onResumeHandlerRef.current = null;
@@ -32002,14 +32020,7 @@ function useSuspend({
32002
32020
  ctrlZTimerRef.current = null;
32003
32021
  }, WARNING_PROMPT_DURATION_MS);
32004
32022
  }
32005
- }, [
32006
- ctrlZPressCount,
32007
- handleWarning,
32008
- setRawMode,
32009
- refreshStatic,
32010
- setForceRerenderKey,
32011
- shouldUseAlternateScreen
32012
- ]);
32023
+ }, [ctrlZPressCount, handleWarning, setRawMode, shouldUseAlternateScreen]);
32013
32024
  const handleSuspend = (0, import_react117.useCallback)(() => {
32014
32025
  setCtrlZPressCount((prev) => prev + 1);
32015
32026
  }, []);
@@ -32428,7 +32439,6 @@ var AppContainer = (props) => {
32428
32439
  }
32429
32440
  }, [mouseMode, setOptions]);
32430
32441
  const [corgiMode, setCorgiMode] = (0, import_react121.useState)(false);
32431
- const [forceRerenderKey, setForceRerenderKey] = (0, import_react121.useState)(0);
32432
32442
  const [debugMessage, setDebugMessage] = (0, import_react121.useState)("");
32433
32443
  const [quittingMessages, setQuittingMessages] = (0, import_react121.useState)(null);
32434
32444
  const [showPrivacyNotice, setShowPrivacyNotice] = (0, import_react121.useState)(false);
@@ -32596,7 +32606,7 @@ var AppContainer = (props) => {
32596
32606
  setConfigInitialized(true);
32597
32607
  startupProfiler.flush(config);
32598
32608
  startAutoMemoryIfEnabled(config);
32599
- const sessionStartSource = resumedSessionData ? "resume" /* Resume */ : "startup" /* Startup */;
32609
+ const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
32600
32610
  const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
32601
32611
  if (result) {
32602
32612
  const additionalContext = result.getAdditionalContext();
@@ -32623,7 +32633,7 @@ var AppContainer = (props) => {
32623
32633
  );
32624
32634
  const ideClient = await IdeClient.getInstance();
32625
32635
  await ideClient.disconnect();
32626
- await config?.getHookSystem()?.fireSessionEndEvent("exit" /* Exit */);
32636
+ await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
32627
32637
  };
32628
32638
  registerCleanup(cleanupFn);
32629
32639
  return () => {
@@ -32648,11 +32658,11 @@ var AppContainer = (props) => {
32648
32658
  resetTime: payload.resetTime
32649
32659
  });
32650
32660
  };
32651
- coreEvents.on("model-changed" /* ModelChanged */, handleModelChanged);
32652
- coreEvents.on("quota-changed" /* QuotaChanged */, handleQuotaChanged);
32661
+ coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
32662
+ coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
32653
32663
  return () => {
32654
- coreEvents.off("model-changed" /* ModelChanged */, handleModelChanged);
32655
- coreEvents.off("quota-changed" /* QuotaChanged */, handleQuotaChanged);
32664
+ coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
32665
+ coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
32656
32666
  };
32657
32667
  }, [config]);
32658
32668
  (0, import_react121.useEffect)(() => {
@@ -32665,16 +32675,16 @@ var AppContainer = (props) => {
32665
32675
  const handleAgentsDiscovered = (payload) => {
32666
32676
  setNewAgents(payload.agents);
32667
32677
  };
32668
- coreEvents.on("settings-changed" /* SettingsChanged */, handleSettingsChanged);
32669
- coreEvents.on("admin-settings-changed" /* AdminSettingsChanged */, handleAdminSettingsChanged);
32670
- coreEvents.on("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
32678
+ coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
32679
+ coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
32680
+ coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
32671
32681
  return () => {
32672
- coreEvents.off("settings-changed" /* SettingsChanged */, handleSettingsChanged);
32682
+ coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
32673
32683
  coreEvents.off(
32674
- "admin-settings-changed" /* AdminSettingsChanged */,
32684
+ CoreEvent.AdminSettingsChanged,
32675
32685
  handleAdminSettingsChanged
32676
32686
  );
32677
- coreEvents.off("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
32687
+ coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
32678
32688
  };
32679
32689
  }, [settings]);
32680
32690
  const { errorCount, clearErrorCount } = useErrorCount();
@@ -32739,11 +32749,11 @@ var AppContainer = (props) => {
32739
32749
  exitEditorDialog
32740
32750
  } = useEditorSettings(settings, setEditorError, historyManager.addItem);
32741
32751
  (0, import_react121.useEffect)(() => {
32742
- coreEvents.on("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
32743
- coreEvents.on("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
32752
+ coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
32753
+ coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
32744
32754
  return () => {
32745
- coreEvents.off("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
32746
- coreEvents.off("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
32755
+ coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
32756
+ coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
32747
32757
  };
32748
32758
  }, [handleEditorClose, openEditorDialog]);
32749
32759
  (0, import_react121.useEffect)(() => {
@@ -32811,7 +32821,7 @@ var AppContainer = (props) => {
32811
32821
  errorVerbosity: settings.merged.ui.errorVerbosity
32812
32822
  });
32813
32823
  const isAuthDialogOpen = authState === "updating" /* Updating */;
32814
- const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== "gemini-api-key" /* USE_GEMINI */;
32824
+ const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
32815
32825
  const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
32816
32826
  const { loadHistoryForResume, isResuming } = useSessionResume({
32817
32827
  config,
@@ -32839,7 +32849,7 @@ var AppContainer = (props) => {
32839
32849
  async (authType, scope) => {
32840
32850
  if (authType) {
32841
32851
  const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
32842
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */) {
32852
+ if (authType === AuthType.LOGIN_WITH_GOOGLE) {
32843
32853
  setAuthContext({ requiresRestart: true });
32844
32854
  } else {
32845
32855
  setAuthContext({});
@@ -32867,7 +32877,7 @@ var AppContainer = (props) => {
32867
32877
  );
32868
32878
  return;
32869
32879
  }
32870
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
32880
+ if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
32871
32881
  writeToStdout(`
32872
32882
  ----------------------------------------------------------------
32873
32883
  Logging in with Google... Restarting Gemini CLI to continue.
@@ -32890,7 +32900,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
32890
32900
  }
32891
32901
  await saveApiKey(apiKey);
32892
32902
  await reloadApiKey();
32893
- await config.refreshAuth("gemini-api-key" /* USE_GEMINI */);
32903
+ await config.refreshAuth(AuthType.USE_GEMINI);
32894
32904
  setAuthState("authenticated" /* Authenticated */);
32895
32905
  } catch (e) {
32896
32906
  onAuthError(
@@ -32915,7 +32925,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
32915
32925
  `Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
32916
32926
  );
32917
32927
  } else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
32918
- if (settings.merged.security.auth.selectedType === "gemini-api-key" /* USE_GEMINI */) {
32928
+ if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
32919
32929
  return;
32920
32930
  }
32921
32931
  const authMethod = settings.merged.security.auth.selectedType;
@@ -33051,9 +33061,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
33051
33061
  }
33052
33062
  });
33053
33063
  };
33054
- coreEvents.on("consent-request" /* ConsentRequest */, handleConsentRequest);
33064
+ coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
33055
33065
  return () => {
33056
- coreEvents.off("consent-request" /* ConsentRequest */, handleConsentRequest);
33066
+ coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
33057
33067
  };
33058
33068
  }, []);
33059
33069
  const performMemoryRefresh = (0, import_react121.useCallback)(async () => {
@@ -33543,7 +33553,6 @@ ${queuedText}` : queuedText;
33543
33553
  needsRestart: ideNeedsRestart,
33544
33554
  restartReason: ideTrustRestartReason
33545
33555
  } = useIdeTrustListener();
33546
- const isInitialMount = (0, import_react121.useRef)(true);
33547
33556
  useIncludeDirsTrust(config, isTrustedFolder, historyManager, setCustomDialog);
33548
33557
  const tabFocusTimeoutRef = (0, import_react121.useRef)(null);
33549
33558
  (0, import_react121.useEffect)(() => {
@@ -33586,8 +33595,6 @@ ${queuedText}` : queuedText;
33586
33595
  const { handleSuspend } = useSuspend({
33587
33596
  handleWarning,
33588
33597
  setRawMode,
33589
- refreshStatic,
33590
- setForceRerenderKey,
33591
33598
  shouldUseAlternateScreen
33592
33599
  });
33593
33600
  (0, import_react121.useEffect)(() => {
@@ -33595,18 +33602,6 @@ ${queuedText}` : queuedText;
33595
33602
  setShowIdeRestartPrompt(true);
33596
33603
  }
33597
33604
  }, [ideNeedsRestart]);
33598
- (0, import_react121.useEffect)(() => {
33599
- if (isInitialMount.current) {
33600
- isInitialMount.current = false;
33601
- return;
33602
- }
33603
- const handler = setTimeout(() => {
33604
- refreshStatic();
33605
- }, 300);
33606
- return () => {
33607
- clearTimeout(handler);
33608
- };
33609
- }, [terminalWidth, refreshStatic]);
33610
33605
  (0, import_react121.useEffect)(() => {
33611
33606
  const unsubscribe = ideContextStore.subscribe(setIdeContextState);
33612
33607
  setIdeContextState(ideContextStore.get());
@@ -33726,7 +33721,7 @@ ${queuedText}` : queuedText;
33726
33721
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
33727
33722
  if (settings.merged.general.devtools) {
33728
33723
  void (async () => {
33729
- const { toggleDevToolsPanel } = await import("./devtoolsService-ZC7E4R2A.js");
33724
+ const { toggleDevToolsPanel } = await import("./devtoolsService-N5XYKGOS.js");
33730
33725
  await toggleDevToolsPanel(
33731
33726
  config,
33732
33727
  showErrorDetails,
@@ -33944,17 +33939,17 @@ ${queuedText}` : queuedText;
33944
33939
  Date.now()
33945
33940
  );
33946
33941
  };
33947
- coreEvents.on("user-feedback" /* UserFeedback */, handleUserFeedback);
33948
- coreEvents.on("hook-system-message" /* HookSystemMessage */, handleHookSystemMessage);
33942
+ coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
33943
+ coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
33949
33944
  coreEvents.drainBacklogs();
33950
33945
  return () => {
33951
- coreEvents.off("user-feedback" /* UserFeedback */, handleUserFeedback);
33952
- coreEvents.off("hook-system-message" /* HookSystemMessage */, handleHookSystemMessage);
33946
+ coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
33947
+ coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
33953
33948
  };
33954
33949
  }, [historyManager]);
33955
33950
  const nightly = props.version.includes("nightly");
33956
33951
  const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
33957
- 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;
33952
+ 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;
33958
33953
  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;
33959
33954
  const hasPendingToolConfirmation = (0, import_react121.useMemo)(
33960
33955
  () => isToolAwaitingConfirmation(pendingHistoryItems),
@@ -34054,9 +34049,9 @@ ${queuedText}` : queuedText;
34054
34049
  const handleMemoryChanged = (result) => {
34055
34050
  setGeminiMdFileCount(result.fileCount);
34056
34051
  };
34057
- coreEvents.on("memory-changed" /* MemoryChanged */, handleMemoryChanged);
34052
+ coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
34058
34053
  return () => {
34059
- coreEvents.off("memory-changed" /* MemoryChanged */, handleMemoryChanged);
34054
+ coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
34060
34055
  };
34061
34056
  }, []);
34062
34057
  (0, import_react121.useEffect)(() => {
@@ -34535,7 +34530,7 @@ ${queuedText}` : queuedText;
34535
34530
  isExpanded,
34536
34531
  toggleExpansion,
34537
34532
  toggleAllExpansion,
34538
- children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(ShellFocusContext.Provider, { value: isFocused, children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(MouseProvider, { mouseEventsEnabled: mouseMode, children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(ScrollProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(App, {}, `app-${forceRerenderKey}`) }) }) })
34533
+ children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(ShellFocusContext.Provider, { value: isFocused, children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(MouseProvider, { mouseEventsEnabled: mouseMode, children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(ScrollProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(App, {}) }) }) })
34539
34534
  }
34540
34535
  )
34541
34536
  }