@google/gemini-cli 0.51.0-preview.0 → 0.52.0-nightly.20260713.gf354eebaf

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 (69) hide show
  1. package/bundle/{chunk-YCMQYVOL.js → chunk-2T7DHFUF.js} +7 -7
  2. package/bundle/{chunk-ZLW5C5RW.js → chunk-2YX7REYH.js} +1 -1
  3. package/bundle/{chunk-KKZMWOPL.js → chunk-36XJOV7D.js} +1 -1
  4. package/bundle/{chunk-FIVDQWYP.js → chunk-3E5UN72A.js} +1 -1
  5. package/bundle/{chunk-YITANI4H.js → chunk-3QARMH4K.js} +8 -5
  6. package/bundle/{chunk-DY72VNA7.js → chunk-APFEBPRN.js} +2 -2
  7. package/bundle/{chunk-PUQ6F6LT.js → chunk-AXDCPZK4.js} +1 -1
  8. package/bundle/{chunk-FPNPAIJS.js → chunk-AZMX5CAR.js} +3 -3
  9. package/bundle/{chunk-MTJEEJK4.js → chunk-BWWM7236.js} +23 -11
  10. package/bundle/{chunk-KKH6C2EN.js → chunk-DB7X2Y2C.js} +7616 -14196
  11. package/bundle/{chunk-CCS4FZN3.js → chunk-DL66YX6H.js} +1 -1
  12. package/bundle/{chunk-JYUWXRQN.js → chunk-DZIOGU7O.js} +1 -1
  13. package/bundle/{chunk-NZPKN6HX.js → chunk-EBDB2GKX.js} +1 -1
  14. package/bundle/{chunk-4ZTDUVGF.js → chunk-ELOFTD3I.js} +3 -3
  15. package/bundle/{chunk-ZCZJ3EHG.js → chunk-EQJS4COG.js} +67 -54
  16. package/bundle/chunk-HWYSVU2Y.js +154 -0
  17. package/bundle/{chunk-Y6OKNB2O.js → chunk-JK366WXF.js} +1 -1
  18. package/bundle/{chunk-SN3AWJMJ.js → chunk-LZWVXAKV.js} +1 -1
  19. package/bundle/{chunk-G6N5TBIV.js → chunk-M2W3BJNE.js} +2 -2
  20. package/bundle/chunk-MNVSGXFA.js +17332 -0
  21. package/bundle/{chunk-IT3MCILF.js → chunk-NPBRF4SI.js} +1 -1
  22. package/bundle/{chunk-CR7DJZQQ.js → chunk-PUNBJ76K.js} +9 -8
  23. package/bundle/{chunk-4NX72DYK.js → chunk-QKLXGOQQ.js} +34 -16
  24. package/bundle/{chunk-TTSEXUPD.js → chunk-RXBKF467.js} +3 -3
  25. package/bundle/chunk-SJG3YDOW.js +102505 -0
  26. package/bundle/chunk-SWWOMF5U.js +388063 -0
  27. package/bundle/{chunk-Z6DCMYAX.js → chunk-TIH7TS2I.js} +2 -2
  28. package/bundle/chunk-XQM42LAM.js +118 -0
  29. package/bundle/chunk-Y2HXPFYB.js +1571 -0
  30. package/bundle/{chunk-DO2TG64U.js → chunk-YY7XHIP5.js} +7 -7
  31. package/bundle/chunk-Z3HRZRKL.js +398 -0
  32. package/bundle/chunk-Z6YPLHBH.js +512 -0
  33. package/bundle/{cleanup-FQDKYMP7.js → cleanup-5AQQMD23.js} +2 -2
  34. package/bundle/{cleanup-KYHKAOAV.js → cleanup-BJXMNJTU.js} +2 -2
  35. package/bundle/{cleanup-RKALUUIS.js → cleanup-BZE7CX3F.js} +2 -2
  36. package/bundle/cleanup-DPHUXC5P.js +32 -0
  37. package/bundle/{core-ZPLCY7CF.js → core-2VB5TAAN.js} +1 -1
  38. package/bundle/{devtoolsService-JKRU3MYU.js → devtoolsService-JRDPPU42.js} +2 -2
  39. package/bundle/{devtoolsService-XZY2NAWE.js → devtoolsService-LJGLJGJV.js} +4 -3
  40. package/bundle/devtoolsService-MG4V53EK.js +4359 -0
  41. package/bundle/{devtoolsService-MDNGNUVW.js → devtoolsService-SADMX7SY.js} +2 -2
  42. package/bundle/{dist-KYS2OS5Q.js → dist-CGC3DE3I.js} +1 -1
  43. package/bundle/{core-YY6I7TM7.js → dist-O7KA2L4U.js} +1 -1
  44. package/bundle/dist-V7MGOCX5.js +2152 -0
  45. package/bundle/docs/changelogs/index.md +13 -0
  46. package/bundle/docs/changelogs/latest.md +18 -49
  47. package/bundle/docs/changelogs/preview.md +44 -57
  48. package/bundle/{gemini-ZFN5ZWKT.js → gemini-24LLUGUQ.js} +14 -14
  49. package/bundle/{gemini-DFLM6FZF.js → gemini-EV7YQC7F.js} +14 -14
  50. package/bundle/{gemini-6JOWJJRI.js → gemini-UEPAA26P.js} +212 -196
  51. package/bundle/gemini-VWRUY5RU.js +29270 -0
  52. package/bundle/gemini.js +7 -7
  53. package/bundle/{interactiveCli-U33KFJYX.js → interactiveCli-CZLGBQJS.js} +52 -12
  54. package/bundle/{interactiveCli-642BSKOD.js → interactiveCli-GSUQ3DVQ.js} +359 -300
  55. package/bundle/interactiveCli-LAC2GT5E.js +34816 -0
  56. package/bundle/{interactiveCli-OIN4AGBD.js → interactiveCli-ZT2EUQKA.js} +52 -12
  57. package/bundle/{liteRtServerManager-6B6QVC3X.js → liteRtServerManager-2GSYVKDP.js} +4 -4
  58. package/bundle/{liteRtServerManager-6DL4RPYQ.js → liteRtServerManager-BWZ2W62M.js} +4 -4
  59. package/bundle/{liteRtServerManager-2KULLNCR.js → liteRtServerManager-NIEOMPFD.js} +4 -4
  60. package/bundle/liteRtServerManager-ZUHIUYXB.js +65 -0
  61. package/bundle/{oauth2-provider-7MN7TDIH.js → oauth2-provider-5VAK2NYV.js} +1 -1
  62. package/bundle/{oauth2-provider-YYHCEEAO.js → oauth2-provider-L7BJUHV4.js} +38 -72
  63. package/bundle/{oauth2-provider-XRJ2KE2Y.js → oauth2-provider-MT25IEBC.js} +1 -1
  64. package/bundle/oauth2-provider-R2QBZWOH.js +235 -0
  65. package/bundle/{start-HPGDHGIK.js → start-33JI6F6O.js} +6 -6
  66. package/bundle/{start-N7GSPBDS.js → start-HJTAEHPM.js} +6 -6
  67. package/bundle/{start-EKMJOLSQ.js → start-RCFRASLC.js} +6 -6
  68. package/bundle/start-XNCBFLHI.js +18 -0
  69. package/package.json +1 -1
@@ -157,13 +157,13 @@ import {
157
157
  widestLineFromStyledChars,
158
158
  wordBreakStyledChars,
159
159
  wrapStyledChars
160
- } from "./chunk-ZCZJ3EHG.js";
160
+ } from "./chunk-2T7DHFUF.js";
161
161
  import {
162
162
  appEvents
163
163
  } from "./chunk-5PS3AYFU.js";
164
164
  import {
165
165
  require_source
166
- } from "./chunk-FIVDQWYP.js";
166
+ } from "./chunk-Y2HXPFYB.js";
167
167
  import {
168
168
  ACTIVE_SHELL_MAX_LINES,
169
169
  COMPACT_TOOL_SUBVIEW_MAX_LINES,
@@ -214,33 +214,37 @@ import {
214
214
  stripAnsi,
215
215
  stripUnsafeCharacters,
216
216
  toCodePoints
217
- } from "./chunk-YITANI4H.js";
217
+ } from "./chunk-MNVSGXFA.js";
218
218
  import {
219
219
  handleAutoUpdate,
220
220
  isDevelopment,
221
221
  relaunchApp,
222
222
  setUpdateHandler
223
- } from "./chunk-Z6DCMYAX.js";
223
+ } from "./chunk-Z3HRZRKL.js";
224
224
  import {
225
225
  isTodoList,
226
226
  mapCoreStatusToDisplayStatus,
227
227
  require_react
228
- } from "./chunk-IT3MCILF.js";
228
+ } from "./chunk-PUNBJ76K.js";
229
229
  import {
230
230
  registerCleanup,
231
231
  removeCleanup,
232
232
  runExitCleanup,
233
233
  setupTtyCheck
234
- } from "./chunk-JYUWXRQN.js";
234
+ } from "./chunk-HWYSVU2Y.js";
235
235
  import {
236
236
  ACTIVATE_SKILL_TOOL_NAME,
237
237
  AGENT_TOOL_NAME,
238
238
  ApiKeyUpdatedEvent,
239
+ ApprovalMode,
239
240
  AsyncFzf,
240
241
  AudioRecorder,
241
242
  AuthType,
242
243
  ChangeAuthRequestedError,
244
+ CompressionStatus,
243
245
  ConversationFinishedEvent,
246
+ CoreEvent,
247
+ CoreToolCallStatus,
244
248
  CreditPurchaseClickEvent,
245
249
  DEFAULT_GEMINI_FLASH_LITE_MODEL,
246
250
  DEFAULT_GEMINI_FLASH_MODEL,
@@ -262,12 +266,19 @@ import {
262
266
  GEMMA_4_31B_IT_MODEL,
263
267
  GLOB_DISPLAY_NAME,
264
268
  GREP_DISPLAY_NAME,
269
+ GeminiCliOperation,
270
+ GeminiEventType,
265
271
  GitService,
266
272
  IdeClient,
273
+ Kind,
267
274
  LS_DISPLAY_NAME,
268
275
  LegacyAgentProtocol,
269
276
  LlmRole,
270
277
  Logger,
278
+ MCPDiscoveryState,
279
+ MCPServerStatus,
280
+ MessageBusType,
281
+ MessageSenderType,
271
282
  ModelNotFoundError,
272
283
  ModelSlashCommandEvent,
273
284
  OverageMenuShownEvent,
@@ -279,20 +290,27 @@ import {
279
290
  PREVIEW_GEMINI_MODEL,
280
291
  PolicyIntegrityManager,
281
292
  ProjectIdRequiredError,
293
+ QuestionType,
282
294
  READ_FILE_DISPLAY_NAME,
283
295
  READ_MANY_FILES_DISPLAY_NAME,
284
296
  RELEASE_CHANNEL_STABILITY,
285
297
  ROOT_SCHEDULER_ID,
286
298
  SHELL_TOOL_NAME,
287
299
  Scheduler,
300
+ SessionEndReason,
301
+ SessionStartSource,
288
302
  ShellExecutionService,
289
303
  SlashCommandStatus,
290
304
  Storage,
305
+ SubagentState,
291
306
  TOPIC_PARAM_STRATEGIC_INTENT,
292
307
  TOPIC_PARAM_SUMMARY,
293
308
  TOPIC_PARAM_TITLE,
294
309
  TerminalQuotaError,
310
+ ToolConfirmationOutcome,
311
+ ToolErrorType,
295
312
  TranscriptionFactory,
313
+ TrustLevel,
296
314
  UPDATE_TOPIC_DISPLAY_NAME,
297
315
  UPDATE_TOPIC_TOOL_NAME,
298
316
  UnauthorizedError,
@@ -304,6 +322,7 @@ import {
304
322
  WEB_FETCH_DISPLAY_NAME,
305
323
  WEB_SEARCH_DISPLAY_NAME,
306
324
  WRITE_FILE_DISPLAY_NAME,
325
+ WarningPriority,
307
326
  WhisperModelManager,
308
327
  addMCPStatusChangeListener,
309
328
  allowEditorTypeInSandbox,
@@ -412,7 +431,7 @@ import {
412
431
  validatePlanContent,
413
432
  validatePlanPath,
414
433
  writeToStdout
415
- } from "./chunk-4NX72DYK.js";
434
+ } from "./chunk-DB7X2Y2C.js";
416
435
  import "./chunk-664ZODQF.js";
417
436
  import "./chunk-TUDYL3X4.js";
418
437
  import "./chunk-IUUIT4SU.js";
@@ -5038,7 +5057,7 @@ function calculateShellMaxLines(options) {
5038
5057
  if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
5039
5058
  return maxLinesBasedOnHeight;
5040
5059
  }
5041
- const isExecuting = status === "executing" /* Executing */;
5060
+ const isExecuting = status === CoreToolCallStatus.Executing;
5042
5061
  const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
5043
5062
  return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
5044
5063
  }
@@ -5072,10 +5091,10 @@ function isShellTool(name) {
5072
5091
  return name === SHELL_COMMAND_NAME || name === SHELL_NAME || name === SHELL_TOOL_NAME || normalized === "shell";
5073
5092
  }
5074
5093
  function isThisShellFocusable(name, status, config) {
5075
- return !!(isShellTool(name) && status === "executing" /* Executing */ && config?.getEnableInteractiveShell());
5094
+ return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && config?.getEnableInteractiveShell());
5076
5095
  }
5077
5096
  function isThisShellFocused(name, status, ptyId, activeShellPtyId, embeddedShellFocused) {
5078
- return !!(isShellTool(name) && status === "executing" /* Executing */ && ptyId === activeShellPtyId && embeddedShellFocused);
5097
+ return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && ptyId === activeShellPtyId && embeddedShellFocused);
5079
5098
  }
5080
5099
  function useFocusHint(isThisShellFocusable2, isThisShellFocused2, resultDisplay) {
5081
5100
  const [userHasFocused, setUserHasFocused] = (0, import_react9.useState)(false);
@@ -5235,13 +5254,13 @@ var formatToolArgs = (args) => {
5235
5254
  var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) => {
5236
5255
  let headerText;
5237
5256
  let headerColor = theme.text.secondary;
5238
- if (progress.state === "cancelled" /* CANCELLED */) {
5257
+ if (progress.state === SubagentState.CANCELLED) {
5239
5258
  headerText = `Subagent ${progress.agentName} was cancelled.`;
5240
5259
  headerColor = theme.status.warning;
5241
- } else if (progress.state === "error" /* ERROR */) {
5260
+ } else if (progress.state === SubagentState.ERROR) {
5242
5261
  headerText = `Subagent ${progress.agentName} failed.`;
5243
5262
  headerColor = theme.status.error;
5244
- } else if (progress.state === "completed" /* COMPLETED */) {
5263
+ } else if (progress.state === SubagentState.COMPLETED) {
5245
5264
  headerText = `Subagent ${progress.agentName} completed.`;
5246
5265
  headerColor = theme.status.success;
5247
5266
  } else {
@@ -5261,7 +5280,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5261
5280
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color, children: item.content }) })
5262
5281
  ] }, item.id);
5263
5282
  } else if (item.type === "tool_call") {
5264
- const statusSymbol = item.status === "running" /* RUNNING */ ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(build_default, { type: "dots" }) : item.status === "completed" /* COMPLETED */ ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.success, children: TOOL_STATUS.SUCCESS }) : item.status === "cancelled" /* CANCELLED */ ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.warning, bold: true, children: TOOL_STATUS.CANCELED }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.error, children: TOOL_STATUS.ERROR });
5283
+ const statusSymbol = item.status === SubagentState.RUNNING ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(build_default, { type: "dots" }) : item.status === SubagentState.COMPLETED ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.success, children: TOOL_STATUS.SUCCESS }) : item.status === SubagentState.CANCELLED ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.warning, bold: true, children: TOOL_STATUS.CANCELED }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.error, children: TOOL_STATUS.ERROR });
5265
5284
  const formattedArgs = item.description || formatToolArgs(item.args);
5266
5285
  const displayArgs = formattedArgs.length > 60 ? formattedArgs.slice(0, 60) + "..." : formattedArgs;
5267
5286
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box_default, { flexDirection: "row", children: [
@@ -5272,7 +5291,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5272
5291
  {
5273
5292
  bold: true,
5274
5293
  color: theme.text.primary,
5275
- strikethrough: item.status === "cancelled" /* CANCELLED */,
5294
+ strikethrough: item.status === SubagentState.CANCELLED,
5276
5295
  children: item.displayName || item.content
5277
5296
  }
5278
5297
  ),
@@ -5281,7 +5300,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5281
5300
  {
5282
5301
  color: theme.text.secondary,
5283
5302
  wrap: "truncate",
5284
- strikethrough: item.status === "cancelled" /* CANCELLED */,
5303
+ strikethrough: item.status === SubagentState.CANCELLED,
5285
5304
  children: displayArgs
5286
5305
  }
5287
5306
  ) })
@@ -5301,7 +5320,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5301
5320
  MarkdownDisplay,
5302
5321
  {
5303
5322
  text: safeJsonToMarkdown(progress.result),
5304
- isPending: progress.state !== "completed" /* COMPLETED */,
5323
+ isPending: progress.state !== SubagentState.COMPLETED,
5305
5324
  terminalWidth
5306
5325
  }
5307
5326
  )
@@ -5655,14 +5674,14 @@ var ToolActionsProvider = (props) => {
5655
5674
  }
5656
5675
  const details = tool.confirmationDetails;
5657
5676
  if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
5658
- const cliOutcome = outcome === "cancel" /* Cancel */ ? "rejected" : "accepted";
5677
+ const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? "rejected" : "accepted";
5659
5678
  await ideClient?.resolveDiffFromCli(details.filePath, cliOutcome);
5660
5679
  }
5661
5680
  if (tool.correlationId) {
5662
5681
  await config.getMessageBus().publish({
5663
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
5682
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
5664
5683
  correlationId: tool.correlationId,
5665
- confirmed: outcome !== "cancel" /* Cancel */,
5684
+ confirmed: outcome !== ToolConfirmationOutcome.Cancel,
5666
5685
  requiresUserConfirmation: false,
5667
5686
  outcome,
5668
5687
  payload
@@ -5681,7 +5700,7 @@ var ToolActionsProvider = (props) => {
5681
5700
  );
5682
5701
  const cancel = (0, import_react12.useCallback)(
5683
5702
  async (callId) => {
5684
- await confirm(callId, "cancel" /* Cancel */);
5703
+ await confirm(callId, ToolConfirmationOutcome.Cancel);
5685
5704
  },
5686
5705
  [confirm]
5687
5706
  );
@@ -5800,7 +5819,7 @@ var ToolMessage = ({
5800
5819
  paddingX: 1,
5801
5820
  flexDirection: "column",
5802
5821
  children: [
5803
- status === "executing" /* Executing */ && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5822
+ status === CoreToolCallStatus.Executing && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5804
5823
  McpProgressIndicator,
5805
5824
  {
5806
5825
  progress,
@@ -5817,8 +5836,8 @@ var ToolMessage = ({
5817
5836
  terminalWidth,
5818
5837
  renderOutputAsMarkdown,
5819
5838
  hasFocus: isThisShellFocused2,
5820
- maxLines: kind === "agent" /* Agent */ && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
5821
- overflowDirection: kind === "agent" /* Agent */ ? "bottom" : "top"
5839
+ maxLines: kind === Kind.Agent && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
5840
+ overflowDirection: kind === Kind.Agent ? "bottom" : "top"
5822
5841
  }
5823
5842
  ),
5824
5843
  isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
@@ -6134,7 +6153,7 @@ function getInitialTrustState(settings, cwd5, isCurrentWorkspace) {
6134
6153
  settings.merged,
6135
6154
  process3.cwd()
6136
6155
  );
6137
- const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === "DO_NOT_TRUST" /* DO_NOT_TRUST */);
6156
+ const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === TrustLevel.DO_NOT_TRUST);
6138
6157
  return {
6139
6158
  currentTrustLevel: explicitTrustLevel,
6140
6159
  isInheritedTrustFromParent: !!(source === "file" && isInheritedTrust),
@@ -6179,7 +6198,7 @@ var usePermissionsModifyTrust = (onExit, addItem, targetDirectory) => {
6179
6198
  process3.cwd(),
6180
6199
  newConfig
6181
6200
  );
6182
- if (trustLevel === "DO_NOT_TRUST" /* DO_NOT_TRUST */ && isTrusted) {
6201
+ if (trustLevel === TrustLevel.DO_NOT_TRUST && isTrusted) {
6183
6202
  let message = "Note: This folder is still trusted because the connected IDE workspace is trusted.";
6184
6203
  if (source === "file") {
6185
6204
  message = "Note: This folder is still trusted because a parent folder is trusted.";
@@ -6253,18 +6272,18 @@ function PermissionsModifyTrustDialog({
6253
6272
  const TRUST_LEVEL_ITEMS = [
6254
6273
  {
6255
6274
  label: `Trust this folder (${dirName})`,
6256
- value: "TRUST_FOLDER" /* TRUST_FOLDER */,
6257
- key: "TRUST_FOLDER" /* TRUST_FOLDER */
6275
+ value: TrustLevel.TRUST_FOLDER,
6276
+ key: TrustLevel.TRUST_FOLDER
6258
6277
  },
6259
6278
  {
6260
6279
  label: `Trust parent folder (${parentFolder})`,
6261
- value: "TRUST_PARENT" /* TRUST_PARENT */,
6262
- key: "TRUST_PARENT" /* TRUST_PARENT */
6280
+ value: TrustLevel.TRUST_PARENT,
6281
+ key: TrustLevel.TRUST_PARENT
6263
6282
  },
6264
6283
  {
6265
6284
  label: "Don't trust",
6266
- value: "DO_NOT_TRUST" /* DO_NOT_TRUST */,
6267
- key: "DO_NOT_TRUST" /* DO_NOT_TRUST */
6285
+ value: TrustLevel.DO_NOT_TRUST,
6286
+ key: TrustLevel.DO_NOT_TRUST
6268
6287
  }
6269
6288
  ];
6270
6289
  const {
@@ -6504,7 +6523,7 @@ var ShellToolMessage = ({
6504
6523
  maxLinesLimit: maxLines
6505
6524
  });
6506
6525
  import_react17.default.useEffect(() => {
6507
- const isExecuting = status === "executing" /* Executing */;
6526
+ const isExecuting = status === CoreToolCallStatus.Executing;
6508
6527
  if (isExecuting && ptyId) {
6509
6528
  try {
6510
6529
  const childWidth = terminalWidth - 4;
@@ -6717,13 +6736,13 @@ var SubagentGroupDisplay = ({
6717
6736
  const singleAgent = toolCalls[0].resultDisplay;
6718
6737
  if (isSubagentProgress(singleAgent)) {
6719
6738
  switch (singleAgent.state) {
6720
- case "completed" /* COMPLETED */:
6739
+ case SubagentState.COMPLETED:
6721
6740
  headerText = "Agent Completed";
6722
6741
  break;
6723
- case "cancelled" /* CANCELLED */:
6742
+ case SubagentState.CANCELLED:
6724
6743
  headerText = "Agent Cancelled";
6725
6744
  break;
6726
- case "error" /* ERROR */:
6745
+ case SubagentState.ERROR:
6727
6746
  headerText = "Agent Error";
6728
6747
  break;
6729
6748
  default:
@@ -6739,8 +6758,8 @@ var SubagentGroupDisplay = ({
6739
6758
  for (const tc of toolCalls) {
6740
6759
  const progress = tc.resultDisplay;
6741
6760
  if (isSubagentProgress(progress)) {
6742
- if (progress.state === "completed" /* COMPLETED */) completedCount++;
6743
- else if (progress.state === "running" /* RUNNING */) runningCount++;
6761
+ if (progress.state === SubagentState.COMPLETED) completedCount++;
6762
+ else if (progress.state === SubagentState.RUNNING) runningCount++;
6744
6763
  } else {
6745
6764
  runningCount++;
6746
6765
  }
@@ -6819,7 +6838,7 @@ var SubagentGroupDisplay = ({
6819
6838
  if (!isExpanded) {
6820
6839
  let content = "Starting...";
6821
6840
  let formattedArgs;
6822
- if (progress.state === "completed" /* COMPLETED */) {
6841
+ if (progress.state === SubagentState.COMPLETED) {
6823
6842
  if (progress.terminateReason && progress.terminateReason !== "GOAL") {
6824
6843
  content = `Finished Early (${progress.terminateReason})`;
6825
6844
  } else {
@@ -6833,17 +6852,17 @@ var SubagentGroupDisplay = ({
6833
6852
  formattedArgs = formatToolArgs(lastActivity.args);
6834
6853
  }
6835
6854
  }
6836
- const displayArgs = progress.state === "completed" /* COMPLETED */ ? "" : formattedArgs;
6855
+ const displayArgs = progress.state === SubagentState.COMPLETED ? "" : formattedArgs;
6837
6856
  const renderStatusIcon = () => {
6838
- const state = progress.state ?? "running" /* RUNNING */;
6857
+ const state = progress.state ?? SubagentState.RUNNING;
6839
6858
  switch (state) {
6840
- case "running" /* RUNNING */:
6859
+ case SubagentState.RUNNING:
6841
6860
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.text.primary, children: "!" });
6842
- case "completed" /* COMPLETED */:
6861
+ case SubagentState.COMPLETED:
6843
6862
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.success, children: "\u2713" });
6844
- case "cancelled" /* CANCELLED */:
6863
+ case SubagentState.CANCELLED:
6845
6864
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.warning, children: "\u2139" });
6846
- case "error" /* ERROR */:
6865
+ case SubagentState.ERROR:
6847
6866
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.error, children: "\u2717" });
6848
6867
  default:
6849
6868
  return checkExhaustive(state);
@@ -6896,22 +6915,22 @@ var hasPayload = (res) => {
6896
6915
  function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerminalHeight, isClickable) {
6897
6916
  const added = (diff.diffStat?.model_added_lines ?? 0) + (diff.diffStat?.user_added_lines ?? 0);
6898
6917
  const removed = (diff.diffStat?.model_removed_lines ?? 0) + (diff.diffStat?.user_removed_lines ?? 0);
6899
- const isAcceptedOrConfirming = status === "success" /* Success */ || status === "executing" /* Executing */ || status === "awaiting_approval" /* AwaitingApproval */;
6918
+ const isAcceptedOrConfirming = status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing || status === CoreToolCallStatus.AwaitingApproval;
6900
6919
  const addColor = isAcceptedOrConfirming ? theme.status.success : theme.text.secondary;
6901
6920
  const removeColor = isAcceptedOrConfirming ? theme.status.error : theme.text.secondary;
6902
6921
  const showDiffStat = !!diff.diffStat;
6903
6922
  const description = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box_default, { flexDirection: "row", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: theme.text.secondary, wrap: "truncate-end", children: diff.fileName }) });
6904
6923
  let resultSummary = "";
6905
6924
  let resultColor = theme.text.secondary;
6906
- if (status === "awaiting_approval" /* AwaitingApproval */) {
6925
+ if (status === CoreToolCallStatus.AwaitingApproval) {
6907
6926
  resultSummary = "Confirming";
6908
- } else if (status === "success" /* Success */ || status === "executing" /* Executing */) {
6927
+ } else if (status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing) {
6909
6928
  resultSummary = "Accepted";
6910
6929
  resultColor = theme.text.accent;
6911
- } else if (status === "cancelled" /* Cancelled */) {
6930
+ } else if (status === CoreToolCallStatus.Cancelled) {
6912
6931
  resultSummary = "Rejected";
6913
6932
  resultColor = theme.status.error;
6914
- } else if (status === "error" /* Error */) {
6933
+ } else if (status === CoreToolCallStatus.Error) {
6915
6934
  resultSummary = typeof resultDisplay === "string" ? resultDisplay : "Failed";
6916
6935
  resultColor = theme.status.error;
6917
6936
  }
@@ -6942,7 +6961,7 @@ function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerm
6942
6961
  filename: diff.fileName,
6943
6962
  terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
6944
6963
  availableTerminalHeight,
6945
- disableColor: status === "cancelled" /* Cancelled */
6964
+ disableColor: status === CoreToolCallStatus.Cancelled
6946
6965
  }
6947
6966
  );
6948
6967
  return { description, summary, payload };
@@ -7070,10 +7089,10 @@ var DenseToolMessage = (props) => {
7070
7089
  if (isGrepResult(resultDisplay)) {
7071
7090
  return getGenericSuccessData(resultDisplay, originalDescription);
7072
7091
  }
7073
- if (status === "success" /* Success */ && resultDisplay) {
7092
+ if (status === CoreToolCallStatus.Success && resultDisplay) {
7074
7093
  return getGenericSuccessData(resultDisplay, originalDescription);
7075
7094
  }
7076
- if (status === "error" /* Error */) {
7095
+ if (status === CoreToolCallStatus.Error) {
7077
7096
  const text = typeof resultDisplay === "string" ? resultDisplay.replace(/\n/g, " ") : "Failed";
7078
7097
  const errorSummary = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: theme.status.error, wrap: "truncate-end", children: [
7079
7098
  "\u2192 ",
@@ -7114,7 +7133,7 @@ var DenseToolMessage = (props) => {
7114
7133
  language: fileExtension,
7115
7134
  maxWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
7116
7135
  settings,
7117
- disableColor: status === "cancelled" /* Cancelled */,
7136
+ disableColor: status === CoreToolCallStatus.Cancelled,
7118
7137
  returnLines: true
7119
7138
  });
7120
7139
  } else {
@@ -7122,7 +7141,7 @@ var DenseToolMessage = (props) => {
7122
7141
  parsedLines,
7123
7142
  filename: diff.fileName,
7124
7143
  terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
7125
- disableColor: status === "cancelled" /* Cancelled */
7144
+ disableColor: status === CoreToolCallStatus.Cancelled
7126
7145
  });
7127
7146
  }
7128
7147
  }, [diff, isExpanded, isAlternateBuffer, terminalWidth, settings, status]);
@@ -7252,7 +7271,7 @@ function isToolExecuting(pendingHistoryItems) {
7252
7271
  return pendingHistoryItems.some((item) => {
7253
7272
  if (item && item.type === "tool_group") {
7254
7273
  return item.tools.some(
7255
- (tool) => "executing" /* Executing */ === tool.status
7274
+ (tool) => CoreToolCallStatus.Executing === tool.status
7256
7275
  );
7257
7276
  }
7258
7277
  return false;
@@ -7261,7 +7280,7 @@ function isToolExecuting(pendingHistoryItems) {
7261
7280
  function isToolAwaitingConfirmation(pendingHistoryItems) {
7262
7281
  return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
7263
7282
  (item) => item.tools.some(
7264
- (tool) => "awaiting_approval" /* AwaitingApproval */ === tool.status
7283
+ (tool) => CoreToolCallStatus.AwaitingApproval === tool.status
7265
7284
  )
7266
7285
  );
7267
7286
  }
@@ -7284,14 +7303,14 @@ function getToolGroupBorderAppearance(item, activeShellPtyId, embeddedShellFocus
7284
7303
  if (isTrackedToolCall(t)) {
7285
7304
  return t.status !== "success" && t.status !== "error" && t.status !== "cancelled";
7286
7305
  } else {
7287
- return t.status !== "success" /* Success */ && t.status !== "error" /* Error */ && t.status !== "cancelled" /* Cancelled */;
7306
+ return t.status !== CoreToolCallStatus.Success && t.status !== CoreToolCallStatus.Error && t.status !== CoreToolCallStatus.Cancelled;
7288
7307
  }
7289
7308
  });
7290
7309
  const isEmbeddedShellFocused = toolsToInspect.some((t) => {
7291
7310
  if (isTrackedToolCall(t)) {
7292
7311
  return isShellTool(t.request.name) && t.status === "executing" && t.pid === activeShellPtyId && !!embeddedShellFocused;
7293
7312
  } else {
7294
- return isShellTool(t.name) && t.status === "executing" /* Executing */ && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
7313
+ return isShellTool(t.name) && t.status === CoreToolCallStatus.Executing && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
7295
7314
  }
7296
7315
  });
7297
7316
  const isShellCommand = toolsToInspect.some((t) => {
@@ -7390,7 +7409,7 @@ var ToolGroupMessage = ({
7390
7409
  const groupedTools = (0, import_react21.useMemo)(() => {
7391
7410
  const groups = [];
7392
7411
  for (const tool of visibleToolCalls) {
7393
- if (tool.kind === "agent" /* Agent */) {
7412
+ if (tool.kind === Kind.Agent) {
7394
7413
  const lastGroup = groups[groups.length - 1];
7395
7414
  if (Array.isArray(lastGroup)) {
7396
7415
  lastGroup.push(tool);
@@ -7445,7 +7464,7 @@ var ToolGroupMessage = ({
7445
7464
  }, [groupedTools, isCompactModeEnabled, borderTopOverride]);
7446
7465
  let countToolCallsWithResults = 0;
7447
7466
  for (const tool of visibleToolCalls) {
7448
- if (tool.kind !== "agent" /* Agent */) {
7467
+ if (tool.kind !== Kind.Agent) {
7449
7468
  if (isCompactTool(tool, isCompactModeEnabled)) {
7450
7469
  if (hasDensePayload(tool)) {
7451
7470
  countToolCallsWithResults++;
@@ -7619,7 +7638,7 @@ var ToolGroupDisplay = ({
7619
7638
  }
7620
7639
  const { tools, borderColor, borderDimColor, borderTop, borderBottom } = item;
7621
7640
  const visibleTools = tools.filter(
7622
- (t) => t.status !== "awaiting_approval" /* AwaitingApproval */
7641
+ (t) => t.status !== CoreToolCallStatus.AwaitingApproval
7623
7642
  );
7624
7643
  const noticeTools = visibleTools.filter((t) => t.format === "notice");
7625
7644
  const otherTools = visibleTools.filter(
@@ -7821,18 +7840,18 @@ function CompressionMessage({
7821
7840
  return "Compressing chat history";
7822
7841
  }
7823
7842
  switch (compressionStatus) {
7824
- case 1 /* COMPRESSED */:
7843
+ case CompressionStatus.COMPRESSED:
7825
7844
  return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
7826
- case 2 /* COMPRESSION_FAILED_INFLATED_TOKEN_COUNT */:
7845
+ case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
7827
7846
  if (originalTokens < 5e4) {
7828
7847
  return "Compression was not beneficial for this history size.";
7829
7848
  }
7830
7849
  return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
7831
- case 3 /* COMPRESSION_FAILED_TOKEN_COUNT_ERROR */:
7850
+ case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
7832
7851
  return "Could not compress chat history due to a token counting error.";
7833
- case 4 /* COMPRESSION_FAILED_EMPTY_SUMMARY */:
7852
+ case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
7834
7853
  return "Chat history compression failed: the model returned an empty summary.";
7835
- case 5 /* NOOP */:
7854
+ case CompressionStatus.NOOP:
7836
7855
  return "Nothing to compress.";
7837
7856
  default:
7838
7857
  return "";
@@ -8258,8 +8277,8 @@ var ModelUsageTable = ({ models }) => {
8258
8277
  );
8259
8278
  roleEntries.sort(([a], [b]) => {
8260
8279
  if (a === b) return 0;
8261
- if (a === "main" /* MAIN */) return -1;
8262
- if (b === "main" /* MAIN */) return 1;
8280
+ if (a === LlmRole.MAIN) return -1;
8281
+ if (b === LlmRole.MAIN) return 1;
8263
8282
  return a.localeCompare(b);
8264
8283
  });
8265
8284
  roleEntries.forEach(([role, roleMetrics]) => {
@@ -8590,8 +8609,8 @@ var ModelStatsDisplay = ({
8590
8609
  return validRoles.includes(role);
8591
8610
  }).sort((a, b) => {
8592
8611
  if (a === b) return 0;
8593
- if (a === "main" /* MAIN */) return -1;
8594
- if (b === "main" /* MAIN */) return 1;
8612
+ if (a === LlmRole.MAIN) return -1;
8613
+ if (b === LlmRole.MAIN) return 1;
8595
8614
  return a.localeCompare(b);
8596
8615
  });
8597
8616
  const createRow = (metric, getValue, options = {}) => {
@@ -9382,7 +9401,7 @@ var McpStatus = ({
9382
9401
  );
9383
9402
  const originalStatus = serverStatus(serverName);
9384
9403
  const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
9385
- const status = originalStatus === "disconnected" /* DISCONNECTED */ && hasCachedItems ? "connected" /* CONNECTED */ : originalStatus;
9404
+ const status = originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems ? MCPServerStatus.CONNECTED : originalStatus;
9386
9405
  let statusIndicator = "";
9387
9406
  let statusText = "";
9388
9407
  let statusColor = theme.text.primary;
@@ -9394,17 +9413,17 @@ var McpStatus = ({
9394
9413
  statusColor = theme.text.secondary;
9395
9414
  } else {
9396
9415
  switch (status) {
9397
- case "connected" /* CONNECTED */:
9416
+ case MCPServerStatus.CONNECTED:
9398
9417
  statusIndicator = "\u{1F7E2}";
9399
9418
  statusText = "Ready";
9400
9419
  statusColor = theme.status.success;
9401
9420
  break;
9402
- case "connecting" /* CONNECTING */:
9421
+ case MCPServerStatus.CONNECTING:
9403
9422
  statusIndicator = "\u{1F504}";
9404
9423
  statusText = "Starting... (first startup may take longer)";
9405
9424
  statusColor = theme.status.warning;
9406
9425
  break;
9407
- case "disconnected" /* DISCONNECTED */:
9426
+ case MCPServerStatus.DISCONNECTED:
9408
9427
  default:
9409
9428
  statusIndicator = "\u{1F534}";
9410
9429
  statusText = "Disconnected";
@@ -9452,12 +9471,12 @@ var McpStatus = ({
9452
9471
  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
9453
9472
  " - ",
9454
9473
  statusText,
9455
- status === "connected" /* CONNECTED */ && parts.length > 0 && ` (${parts.join(", ")})`
9474
+ status === MCPServerStatus.CONNECTED && parts.length > 0 && ` (${parts.join(", ")})`
9456
9475
  ] }),
9457
9476
  authStatusNode
9458
9477
  ] }),
9459
- status === "connecting" /* CONNECTING */ && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
9460
- status === "disconnected" /* DISCONNECTED */ && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
9478
+ status === MCPServerStatus.CONNECTING && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
9479
+ status === MCPServerStatus.DISCONNECTED && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
9461
9480
  " (",
9462
9481
  toolCount,
9463
9482
  " tools cached)"
@@ -10018,7 +10037,7 @@ var Notifications = () => {
10018
10037
  if (dismissed) return [];
10019
10038
  const counts = persistentState.get("startupWarningCounts") || {};
10020
10039
  return startupWarnings.filter((w) => {
10021
- if (w.priority === "low" /* Low */) {
10040
+ if (w.priority === WarningPriority.Low) {
10022
10041
  const count = counts[w.id] || 0;
10023
10042
  return count < MAX_STARTUP_WARNING_SHOW_COUNT;
10024
10043
  }
@@ -10031,7 +10050,7 @@ var Notifications = () => {
10031
10050
  const counts = { ...persistentState.get("startupWarningCounts") || {} };
10032
10051
  let changed = false;
10033
10052
  visibleWarnings.forEach((w) => {
10034
- if (w.priority === "low" /* Low */) {
10053
+ if (w.priority === WarningPriority.Low) {
10035
10054
  counts[w.id] = (counts[w.id] || 0) + 1;
10036
10055
  changed = true;
10037
10056
  }
@@ -10138,7 +10157,7 @@ var UserIdentity = ({ config }) => {
10138
10157
  }
10139
10158
  return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { flexDirection: "column", children: [
10140
10159
  /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { children: [
10141
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { children: [
10160
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType === AuthType.LOGIN_WITH_GOOGLE ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { children: [
10142
10161
  /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { bold: true, children: [
10143
10162
  "Signed in with Google",
10144
10163
  email ? ":" : ""
@@ -10381,7 +10400,7 @@ var import_react32 = __toESM(require_react(), 1);
10381
10400
  function getConfirmingToolState(pendingHistoryItems) {
10382
10401
  const allPendingTools = getAllToolCalls(pendingHistoryItems);
10383
10402
  const confirmingTools = allPendingTools.filter(
10384
- (tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
10403
+ (tool) => tool.status === CoreToolCallStatus.AwaitingApproval
10385
10404
  );
10386
10405
  if (confirmingTools.length === 0) {
10387
10406
  return null;
@@ -11689,7 +11708,7 @@ var ExitPlanModeDialog = ({
11689
11708
  {
11690
11709
  questions: [
11691
11710
  {
11692
- type: "choice" /* CHOICE */,
11711
+ type: QuestionType.CHOICE,
11693
11712
  header: "Approval",
11694
11713
  question: planContent,
11695
11714
  options: [
@@ -11710,9 +11729,9 @@ var ExitPlanModeDialog = ({
11710
11729
  onSubmit: (answers) => {
11711
11730
  const answer = answers["0"];
11712
11731
  if (answer === "Yes, automatically accept edits" /* Auto */) {
11713
- onApprove("autoEdit" /* AUTO_EDIT */);
11732
+ onApprove(ApprovalMode.AUTO_EDIT);
11714
11733
  } else if (answer === "Yes, manually accept edits" /* Manual */) {
11715
- onApprove("default" /* DEFAULT */);
11734
+ onApprove(ApprovalMode.DEFAULT);
11716
11735
  } else if (answer) {
11717
11736
  onFeedback(answer);
11718
11737
  }
@@ -11923,7 +11942,7 @@ ${deceptiveUrlWarnings.map(
11923
11942
  );
11924
11943
  (0, import_react37.useEffect)(() => {
11925
11944
  if (isCancelling) {
11926
- handleConfirm("cancel" /* Cancel */);
11945
+ handleConfirm(ToolConfirmationOutcome.Cancel);
11927
11946
  }
11928
11947
  }, [isCancelling, handleConfirm]);
11929
11948
  const handleSelect = (0, import_react37.useCallback)(
@@ -11936,19 +11955,19 @@ ${deceptiveUrlWarnings.map(
11936
11955
  if (!confirmationDetails.isModifying) {
11937
11956
  options2.push({
11938
11957
  label: "Allow once",
11939
- value: "proceed_once" /* ProceedOnce */,
11958
+ value: ToolConfirmationOutcome.ProceedOnce,
11940
11959
  key: "Allow once"
11941
11960
  });
11942
11961
  if (isTrustedFolder) {
11943
11962
  options2.push({
11944
11963
  label: "Allow for this session",
11945
- value: "proceed_always" /* ProceedAlways */,
11964
+ value: ToolConfirmationOutcome.ProceedAlways,
11946
11965
  key: "Allow for this session"
11947
11966
  });
11948
11967
  if (allowPermanentApproval) {
11949
11968
  options2.push({
11950
11969
  label: "Allow for this file in all future sessions",
11951
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
11970
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
11952
11971
  key: "Allow for this file in all future sessions"
11953
11972
  });
11954
11973
  }
@@ -11956,119 +11975,119 @@ ${deceptiveUrlWarnings.map(
11956
11975
  if (!config.getIdeMode() || !isDiffingEnabled) {
11957
11976
  options2.push({
11958
11977
  label: "Modify with external editor",
11959
- value: "modify_with_editor" /* ModifyWithEditor */,
11978
+ value: ToolConfirmationOutcome.ModifyWithEditor,
11960
11979
  key: "Modify with external editor"
11961
11980
  });
11962
11981
  }
11963
11982
  options2.push({
11964
11983
  label: "No, suggest changes (esc)",
11965
- value: "cancel" /* Cancel */,
11984
+ value: ToolConfirmationOutcome.Cancel,
11966
11985
  key: "No, suggest changes (esc)"
11967
11986
  });
11968
11987
  }
11969
11988
  } else if (confirmationDetails.type === "sandbox_expansion") {
11970
11989
  options2.push({
11971
11990
  label: "Allow once",
11972
- value: "proceed_once" /* ProceedOnce */,
11991
+ value: ToolConfirmationOutcome.ProceedOnce,
11973
11992
  key: "Allow once"
11974
11993
  });
11975
11994
  if (isTrustedFolder) {
11976
11995
  options2.push({
11977
11996
  label: "Allow for this session",
11978
- value: "proceed_always" /* ProceedAlways */,
11997
+ value: ToolConfirmationOutcome.ProceedAlways,
11979
11998
  key: "Allow for this session"
11980
11999
  });
11981
12000
  if (allowPermanentApproval) {
11982
12001
  options2.push({
11983
12002
  label: "Allow for all future sessions",
11984
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12003
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
11985
12004
  key: "Allow for all future sessions"
11986
12005
  });
11987
12006
  }
11988
12007
  }
11989
12008
  options2.push({
11990
12009
  label: "No, suggest changes (esc)",
11991
- value: "cancel" /* Cancel */,
12010
+ value: ToolConfirmationOutcome.Cancel,
11992
12011
  key: "No, suggest changes (esc)"
11993
12012
  });
11994
12013
  } else if (confirmationDetails.type === "exec") {
11995
12014
  options2.push({
11996
12015
  label: "Allow once",
11997
- value: "proceed_once" /* ProceedOnce */,
12016
+ value: ToolConfirmationOutcome.ProceedOnce,
11998
12017
  key: "Allow once"
11999
12018
  });
12000
12019
  if (isTrustedFolder) {
12001
12020
  options2.push({
12002
12021
  label: `Allow for this session`,
12003
- value: "proceed_always" /* ProceedAlways */,
12022
+ value: ToolConfirmationOutcome.ProceedAlways,
12004
12023
  key: `Allow for this session`
12005
12024
  });
12006
12025
  if (allowPermanentApproval) {
12007
12026
  options2.push({
12008
12027
  label: `Allow this command for all future sessions`,
12009
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12028
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12010
12029
  key: `Allow for all future sessions`
12011
12030
  });
12012
12031
  }
12013
12032
  }
12014
12033
  options2.push({
12015
12034
  label: "No, suggest changes (esc)",
12016
- value: "cancel" /* Cancel */,
12035
+ value: ToolConfirmationOutcome.Cancel,
12017
12036
  key: "No, suggest changes (esc)"
12018
12037
  });
12019
12038
  } else if (confirmationDetails.type === "info") {
12020
12039
  options2.push({
12021
12040
  label: "Allow once",
12022
- value: "proceed_once" /* ProceedOnce */,
12041
+ value: ToolConfirmationOutcome.ProceedOnce,
12023
12042
  key: "Allow once"
12024
12043
  });
12025
12044
  if (isTrustedFolder) {
12026
12045
  options2.push({
12027
12046
  label: "Allow for this session",
12028
- value: "proceed_always" /* ProceedAlways */,
12047
+ value: ToolConfirmationOutcome.ProceedAlways,
12029
12048
  key: "Allow for this session"
12030
12049
  });
12031
12050
  if (allowPermanentApproval) {
12032
12051
  options2.push({
12033
12052
  label: "Allow for all future sessions",
12034
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12053
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12035
12054
  key: "Allow for all future sessions"
12036
12055
  });
12037
12056
  }
12038
12057
  }
12039
12058
  options2.push({
12040
12059
  label: "No, suggest changes (esc)",
12041
- value: "cancel" /* Cancel */,
12060
+ value: ToolConfirmationOutcome.Cancel,
12042
12061
  key: "No, suggest changes (esc)"
12043
12062
  });
12044
12063
  } else if (confirmationDetails.type === "mcp") {
12045
12064
  options2.push({
12046
12065
  label: "Allow once",
12047
- value: "proceed_once" /* ProceedOnce */,
12066
+ value: ToolConfirmationOutcome.ProceedOnce,
12048
12067
  key: "Allow once"
12049
12068
  });
12050
12069
  if (isTrustedFolder) {
12051
12070
  options2.push({
12052
12071
  label: "Allow tool for this session",
12053
- value: "proceed_always_tool" /* ProceedAlwaysTool */,
12072
+ value: ToolConfirmationOutcome.ProceedAlwaysTool,
12054
12073
  key: "Allow tool for this session"
12055
12074
  });
12056
12075
  options2.push({
12057
12076
  label: "Allow all server tools for this session",
12058
- value: "proceed_always_server" /* ProceedAlwaysServer */,
12077
+ value: ToolConfirmationOutcome.ProceedAlwaysServer,
12059
12078
  key: "Allow all server tools for this session"
12060
12079
  });
12061
12080
  if (allowPermanentApproval) {
12062
12081
  options2.push({
12063
12082
  label: "Allow tool for all future sessions",
12064
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12083
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12065
12084
  key: "Allow tool for all future sessions"
12066
12085
  });
12067
12086
  }
12068
12087
  }
12069
12088
  options2.push({
12070
12089
  label: "No, suggest changes (esc)",
12071
- value: "cancel" /* Cancel */,
12090
+ value: ToolConfirmationOutcome.Cancel,
12072
12091
  key: "No, suggest changes (esc)"
12073
12092
  });
12074
12093
  }
@@ -12107,7 +12126,7 @@ ${deceptiveUrlWarnings.map(
12107
12126
  const containsRedirection = commandsToDisplay.some(
12108
12127
  (cmd) => hasRedirection(cmd)
12109
12128
  );
12110
- const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
12129
+ const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
12111
12130
  if (containsRedirection && !isAutoEdit) {
12112
12131
  extraInfoLines = 1;
12113
12132
  }
@@ -12133,7 +12152,7 @@ ${deceptiveUrlWarnings.map(
12133
12152
  const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
12134
12153
  if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
12135
12154
  const alwaysAndSaveIndex = options2.findIndex(
12136
- (o) => o.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */
12155
+ (o) => o.value === ToolConfirmationOutcome.ProceedAlwaysAndSave
12137
12156
  );
12138
12157
  if (alwaysAndSaveIndex !== -1) {
12139
12158
  initialIndex2 = alwaysAndSaveIndex;
@@ -12150,10 +12169,10 @@ ${deceptiveUrlWarnings.map(
12150
12169
  {
12151
12170
  questions: confirmationDetails.questions,
12152
12171
  onSubmit: (answers) => {
12153
- handleConfirm("proceed_once" /* ProceedOnce */, { answers });
12172
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, { answers });
12154
12173
  },
12155
12174
  onCancel: () => {
12156
- handleConfirm("cancel" /* Cancel */);
12175
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12157
12176
  },
12158
12177
  width: terminalWidth,
12159
12178
  availableHeight: bodyHeight
@@ -12174,19 +12193,19 @@ ${deceptiveUrlWarnings.map(
12174
12193
  planPath: confirmationDetails.planPath,
12175
12194
  getPreferredEditor,
12176
12195
  onApprove: (approvalMode) => {
12177
- handleConfirm("proceed_once" /* ProceedOnce */, {
12196
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
12178
12197
  approved: true,
12179
12198
  approvalMode
12180
12199
  });
12181
12200
  },
12182
12201
  onFeedback: (feedback) => {
12183
- handleConfirm("proceed_once" /* ProceedOnce */, {
12202
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
12184
12203
  approved: false,
12185
12204
  feedback
12186
12205
  });
12187
12206
  },
12188
12207
  onCancel: () => {
12189
- handleConfirm("cancel" /* Cancel */);
12208
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12190
12209
  },
12191
12210
  width: terminalWidth,
12192
12211
  availableHeight: bodyHeight
@@ -12295,7 +12314,7 @@ ${deceptiveUrlWarnings.map(
12295
12314
  const containsRedirection = commandsToDisplay.some(
12296
12315
  (cmd) => hasRedirection(cmd)
12297
12316
  );
12298
- const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
12317
+ const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
12299
12318
  let warnings = null;
12300
12319
  if (containsRedirection && !isAutoEdit) {
12301
12320
  const tipText = `To auto-accept, press ${formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */)}`;
@@ -12454,7 +12473,7 @@ ${deceptiveUrlWarnings.map(
12454
12473
  const bodyOverflowDirection = confirmationDetails.type === "mcp" && isMcpToolDetailsExpanded ? "bottom" : "top";
12455
12474
  const renderRadioItem = (0, import_react37.useCallback)(
12456
12475
  (item, { titleColor }) => {
12457
- if (item.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */) {
12476
+ if (item.value === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
12458
12477
  return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(Text, { color: titleColor, wrap: "truncate", children: [
12459
12478
  item.label,
12460
12479
  " ",
@@ -14484,7 +14503,7 @@ async function validateAuthMethodWithSettings(authType, settings) {
14484
14503
  if (settings.merged.security.auth.useExternal) {
14485
14504
  return null;
14486
14505
  }
14487
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14506
+ if (authType === AuthType.USE_GEMINI) {
14488
14507
  return null;
14489
14508
  }
14490
14509
  return validateAuthMethod(authType);
@@ -14536,7 +14555,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
14536
14555
  }
14537
14556
  return;
14538
14557
  }
14539
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14558
+ if (authType === AuthType.USE_GEMINI) {
14540
14559
  const key = await reloadApiKey();
14541
14560
  if (!key) {
14542
14561
  setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
@@ -14614,31 +14633,31 @@ function AuthDialog({
14614
14633
  let items = [
14615
14634
  {
14616
14635
  label: "Sign in with Google",
14617
- value: "oauth-personal" /* LOGIN_WITH_GOOGLE */,
14618
- key: "oauth-personal" /* LOGIN_WITH_GOOGLE */
14636
+ value: AuthType.LOGIN_WITH_GOOGLE,
14637
+ key: AuthType.LOGIN_WITH_GOOGLE
14619
14638
  },
14620
14639
  ...process.env["CLOUD_SHELL"] === "true" ? [
14621
14640
  {
14622
14641
  label: "Use Cloud Shell user credentials",
14623
- value: "compute-default-credentials" /* COMPUTE_ADC */,
14624
- key: "compute-default-credentials" /* COMPUTE_ADC */
14642
+ value: AuthType.COMPUTE_ADC,
14643
+ key: AuthType.COMPUTE_ADC
14625
14644
  }
14626
14645
  ] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
14627
14646
  {
14628
14647
  label: "Use metadata server application default credentials",
14629
- value: "compute-default-credentials" /* COMPUTE_ADC */,
14630
- key: "compute-default-credentials" /* COMPUTE_ADC */
14648
+ value: AuthType.COMPUTE_ADC,
14649
+ key: AuthType.COMPUTE_ADC
14631
14650
  }
14632
14651
  ] : [],
14633
14652
  {
14634
14653
  label: "Use Gemini API Key",
14635
- value: "gemini-api-key" /* USE_GEMINI */,
14636
- key: "gemini-api-key" /* USE_GEMINI */
14654
+ value: AuthType.USE_GEMINI,
14655
+ key: AuthType.USE_GEMINI
14637
14656
  },
14638
14657
  {
14639
14658
  label: "Vertex AI",
14640
- value: "vertex-ai" /* USE_VERTEX_AI */,
14641
- key: "vertex-ai" /* USE_VERTEX_AI */
14659
+ value: AuthType.USE_VERTEX_AI,
14660
+ key: AuthType.USE_VERTEX_AI
14642
14661
  }
14643
14662
  ];
14644
14663
  if (settings.merged.security.auth.enforcedType) {
@@ -14660,9 +14679,9 @@ function AuthDialog({
14660
14679
  return item.value === defaultAuthType;
14661
14680
  }
14662
14681
  if (process.env["GEMINI_API_KEY"]) {
14663
- return item.value === "gemini-api-key" /* USE_GEMINI */;
14682
+ return item.value === AuthType.USE_GEMINI;
14664
14683
  }
14665
- return item.value === "oauth-personal" /* LOGIN_WITH_GOOGLE */;
14684
+ return item.value === AuthType.LOGIN_WITH_GOOGLE;
14666
14685
  });
14667
14686
  if (settings.merged.security.auth.enforcedType) {
14668
14687
  initialAuthIndex = 0;
@@ -14673,7 +14692,7 @@ function AuthDialog({
14673
14692
  return;
14674
14693
  }
14675
14694
  if (authType) {
14676
- const needsRestart = authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ || authType === "vertex-ai" /* USE_VERTEX_AI */ && process.env["CLOUD_SHELL"] === "true";
14695
+ const needsRestart = authType === AuthType.LOGIN_WITH_GOOGLE || authType === AuthType.USE_VERTEX_AI && process.env["CLOUD_SHELL"] === "true";
14677
14696
  if (needsRestart) {
14678
14697
  setAuthContext({ requiresRestart: true });
14679
14698
  } else {
@@ -14681,12 +14700,12 @@ function AuthDialog({
14681
14700
  }
14682
14701
  await clearCachedCredentialFile();
14683
14702
  settings.setValue(scope, "security.auth.selectedType", authType);
14684
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
14703
+ if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
14685
14704
  setExiting(true);
14686
14705
  setTimeout(relaunchApp, 100);
14687
14706
  return;
14688
14707
  }
14689
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14708
+ if (authType === AuthType.USE_GEMINI) {
14690
14709
  setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
14691
14710
  return;
14692
14711
  }
@@ -15250,6 +15269,8 @@ var CloudPaidPrivacyNotice = ({
15250
15269
 
15251
15270
  // packages/cli/src/ui/hooks/usePrivacySettings.ts
15252
15271
  var import_react51 = __toESM(require_react(), 1);
15272
+ var TierUnavailableError = class extends Error {
15273
+ };
15253
15274
  var usePrivacySettings = (config) => {
15254
15275
  const [privacyState, setPrivacyState] = (0, import_react51.useState)({
15255
15276
  isLoading: true
@@ -15263,7 +15284,11 @@ var usePrivacySettings = (config) => {
15263
15284
  const server = getCodeAssistServerOrFail(config);
15264
15285
  const tier = server.userTier;
15265
15286
  if (tier === void 0) {
15266
- throw new Error("Could not determine user tier.");
15287
+ setPrivacyState({
15288
+ isLoading: false,
15289
+ isTierUnavailable: true
15290
+ });
15291
+ return;
15267
15292
  }
15268
15293
  if (tier !== UserTierId.FREE) {
15269
15294
  setPrivacyState({
@@ -15279,6 +15304,13 @@ var usePrivacySettings = (config) => {
15279
15304
  dataCollectionOptIn: optIn
15280
15305
  });
15281
15306
  } catch (e) {
15307
+ if (isTierUnavailableError(e)) {
15308
+ setPrivacyState({
15309
+ isLoading: false,
15310
+ isTierUnavailable: true
15311
+ });
15312
+ return;
15313
+ }
15282
15314
  setPrivacyState({
15283
15315
  isLoading: false,
15284
15316
  error: e instanceof Error ? e.message : String(e)
@@ -15298,6 +15330,13 @@ var usePrivacySettings = (config) => {
15298
15330
  dataCollectionOptIn: updatedOptIn
15299
15331
  });
15300
15332
  } catch (e) {
15333
+ if (isTierUnavailableError(e)) {
15334
+ setPrivacyState({
15335
+ isLoading: false,
15336
+ isTierUnavailable: true
15337
+ });
15338
+ return;
15339
+ }
15301
15340
  setPrivacyState({
15302
15341
  isLoading: false,
15303
15342
  error: e instanceof Error ? e.message : String(e)
@@ -15314,12 +15353,19 @@ var usePrivacySettings = (config) => {
15314
15353
  function getCodeAssistServerOrFail(config) {
15315
15354
  const server = getCodeAssistServer(config);
15316
15355
  if (server === void 0) {
15317
- throw new Error("Oauth not being used");
15356
+ throw new TierUnavailableError("Oauth not being used");
15318
15357
  } else if (server.projectId === void 0) {
15319
- throw new Error("CodeAssist server is missing a project ID");
15358
+ throw new TierUnavailableError("CodeAssist server is missing a project ID");
15320
15359
  }
15321
15360
  return server;
15322
15361
  }
15362
+ function isTierUnavailableError(error) {
15363
+ if (error instanceof TierUnavailableError) {
15364
+ return true;
15365
+ }
15366
+ const message = error instanceof Error ? error.message : String(error);
15367
+ return /does not have a current tier/i.test(message);
15368
+ }
15323
15369
  async function getRemoteDataCollectionOptIn(server) {
15324
15370
  try {
15325
15371
  const resp = await server.getCodeAssistGlobalUserSetting();
@@ -15361,7 +15407,7 @@ var CloudFreePrivacyNotice = ({
15361
15407
  const { privacyState, updateDataCollectionOptIn } = usePrivacySettings(config);
15362
15408
  useKeypress(
15363
15409
  (key) => {
15364
- if ((privacyState.error || privacyState.isFreeTier === false) && key.name === "escape") {
15410
+ if ((privacyState.error || privacyState.isFreeTier === false || privacyState.isTierUnavailable) && key.name === "escape") {
15365
15411
  onExit();
15366
15412
  return true;
15367
15413
  }
@@ -15381,6 +15427,19 @@ var CloudFreePrivacyNotice = ({
15381
15427
  /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Text, { color: theme.text.secondary, children: "Press Esc to exit." })
15382
15428
  ] });
15383
15429
  }
15430
+ if (privacyState.isTierUnavailable) {
15431
+ return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(Box_default, { flexDirection: "column", marginY: 1, children: [
15432
+ /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Text, { bold: true, color: theme.text.accent, children: "Gemini Code Assist Privacy Notice" }),
15433
+ /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Newline, {}),
15434
+ /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Text, { color: theme.text.primary, children: "The data collection opt-in isn't available for this account because it doesn't have a Gemini Code Assist for Individuals (free) tier." }),
15435
+ /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Newline, {}),
15436
+ /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Text, { color: theme.text.primary, children: "If you're on a Google Workspace or enterprise account, use the Vertex AI / Google Cloud path instead by setting the GOOGLE_CLOUD_PROJECT environment variable to your Google Cloud project." }),
15437
+ /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Newline, {}),
15438
+ /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Text, { color: theme.text.primary, children: "Learn more: https://geminicli.com/docs/get-started/authentication/" }),
15439
+ /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Newline, {}),
15440
+ /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Text, { color: theme.text.secondary, children: "Press Esc to exit." })
15441
+ ] });
15442
+ }
15384
15443
  if (privacyState.isFreeTier === false) {
15385
15444
  return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(Box_default, { flexDirection: "column", marginY: 1, children: [
15386
15445
  /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Text, { bold: true, color: theme.text.accent, children: "Gemini Code Assist Privacy Notice" }),
@@ -15442,11 +15501,11 @@ var PrivacyNoticeText = ({
15442
15501
  }) => {
15443
15502
  const authType = config.getContentGeneratorConfig()?.authType;
15444
15503
  switch (authType) {
15445
- case "gemini-api-key" /* USE_GEMINI */:
15504
+ case AuthType.USE_GEMINI:
15446
15505
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GeminiPrivacyNotice, { onExit });
15447
- case "vertex-ai" /* USE_VERTEX_AI */:
15506
+ case AuthType.USE_VERTEX_AI:
15448
15507
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudPaidPrivacyNotice, { onExit });
15449
- case "oauth-personal" /* LOGIN_WITH_GOOGLE */:
15508
+ case AuthType.LOGIN_WITH_GOOGLE:
15450
15509
  default:
15451
15510
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudFreePrivacyNotice, { config, onExit });
15452
15511
  }
@@ -15487,7 +15546,7 @@ function ProQuotaDialog({
15487
15546
  value: "retry_always",
15488
15547
  key: "retry_always"
15489
15548
  },
15490
- ...authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && !isUltra ? [
15549
+ ...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
15491
15550
  {
15492
15551
  label: "Upgrade for higher limits",
15493
15552
  value: "upgrade",
@@ -16646,7 +16705,7 @@ function ModelDialog({ onClose }) {
16646
16705
  const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
16647
16706
  const useGemini3_5Flash = config?.hasGemini35FlashGAAccess?.() ?? false;
16648
16707
  const selectedAuthType = settings.merged.security.auth.selectedType;
16649
- const useCustomToolModel = useGemini31 && selectedAuthType === "gemini-api-key" /* USE_GEMINI */;
16708
+ const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
16650
16709
  const manualModelSelected = (0, import_react55.useMemo)(() => {
16651
16710
  if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
16652
16711
  const def = config.getModelConfigService().getModelDefinition(preferredModel);
@@ -17969,10 +18028,10 @@ function initializeConsoleStore() {
17969
18028
  globalConsoleMessages = [];
17970
18029
  globalErrorCount = 0;
17971
18030
  notifyListeners();
17972
- coreEvents.off("console-log" /* ConsoleLog */, handleConsoleLog);
17973
- coreEvents.off("output" /* Output */, handleOutput);
17974
- coreEvents.on("console-log" /* ConsoleLog */, handleConsoleLog);
17975
- coreEvents.on("output" /* Output */, handleOutput);
18031
+ coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
18032
+ coreEvents.off(CoreEvent.Output, handleOutput);
18033
+ coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
18034
+ coreEvents.on(CoreEvent.Output, handleOutput);
17976
18035
  }
17977
18036
  function notifyListeners() {
17978
18037
  for (const listener of listeners) {
@@ -20109,7 +20168,7 @@ function usePromptCompletion({
20109
20168
  { model: "prompt-completion" },
20110
20169
  contents,
20111
20170
  signal,
20112
- "utility_autocomplete" /* UTILITY_AUTOCOMPLETE */
20171
+ LlmRole.UTILITY_AUTOCOMPLETE
20113
20172
  );
20114
20173
  if (signal.aborted) {
20115
20174
  return;
@@ -22187,9 +22246,9 @@ var InputPrompt = ({
22187
22246
  onSuggestionsVisibilityChange(shouldShowSuggestions);
22188
22247
  }
22189
22248
  }, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
22190
- const showAutoAcceptStyling = !shellModeActive && approvalMode === "autoEdit" /* AUTO_EDIT */;
22191
- const showYoloStyling = !shellModeActive && approvalMode === "yolo" /* YOLO */;
22192
- const showPlanStyling = !shellModeActive && approvalMode === "plan" /* PLAN */;
22249
+ const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
22250
+ const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
22251
+ const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
22193
22252
  let statusColor;
22194
22253
  let statusText = "";
22195
22254
  if (shellModeActive) {
@@ -23022,22 +23081,22 @@ var ApprovalModeIndicator = ({
23022
23081
  const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
23023
23082
  const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
23024
23083
  switch (approvalMode) {
23025
- case "autoEdit" /* AUTO_EDIT */:
23084
+ case ApprovalMode.AUTO_EDIT:
23026
23085
  textColor = theme.status.warning;
23027
23086
  textContent = "auto-accept edits";
23028
23087
  subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
23029
23088
  break;
23030
- case "plan" /* PLAN */:
23089
+ case ApprovalMode.PLAN:
23031
23090
  textColor = theme.status.success;
23032
23091
  textContent = "plan";
23033
23092
  subText = `${cycleHint} to manual`;
23034
23093
  break;
23035
- case "yolo" /* YOLO */:
23094
+ case ApprovalMode.YOLO:
23036
23095
  textColor = theme.status.error;
23037
23096
  textContent = "YOLO";
23038
23097
  subText = yoloHint;
23039
23098
  break;
23040
- case "default" /* DEFAULT */:
23099
+ case ApprovalMode.DEFAULT:
23041
23100
  default:
23042
23101
  textColor = theme.text.accent;
23043
23102
  textContent = "";
@@ -23085,7 +23144,7 @@ var useComposerStatus = () => {
23085
23144
  (item) => item.type === "tool_group"
23086
23145
  ).some(
23087
23146
  (item) => item.tools.some(
23088
- (tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
23147
+ (tool) => tool.status === CoreToolCallStatus.AwaitingApproval
23089
23148
  )
23090
23149
  ),
23091
23150
  [uiState.pendingHistoryItems]
@@ -23100,13 +23159,13 @@ var useComposerStatus = () => {
23100
23159
  const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
23101
23160
  if (hideMinimalModeHintWhileBusy) return null;
23102
23161
  switch (showApprovalModeIndicator) {
23103
- case "yolo" /* YOLO */:
23162
+ case ApprovalMode.YOLO:
23104
23163
  return { text: "YOLO", color: theme.status.error };
23105
- case "plan" /* PLAN */:
23164
+ case ApprovalMode.PLAN:
23106
23165
  return { text: "plan", color: theme.status.success };
23107
- case "autoEdit" /* AUTO_EDIT */:
23166
+ case ApprovalMode.AUTO_EDIT:
23108
23167
  return { text: "auto edit", color: theme.status.warning };
23109
- case "default" /* DEFAULT */:
23168
+ case ApprovalMode.DEFAULT:
23110
23169
  default:
23111
23170
  return null;
23112
23171
  }
@@ -23460,7 +23519,7 @@ var ConfigInitDisplay = ({
23460
23519
  let connected = 0;
23461
23520
  const connecting = [];
23462
23521
  for (const [name, client] of clients.entries()) {
23463
- if (client.getStatus() === "connected" /* CONNECTED */) {
23522
+ if (client.getStatus() === MCPServerStatus.CONNECTED) {
23464
23523
  connected++;
23465
23524
  } else {
23466
23525
  connecting.push(name);
@@ -23482,9 +23541,9 @@ var ConfigInitDisplay = ({
23482
23541
  );
23483
23542
  }
23484
23543
  };
23485
- coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
23544
+ coreEvents.on(CoreEvent.McpClientUpdate, onChange);
23486
23545
  return () => {
23487
- coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
23546
+ coreEvents.off(CoreEvent.McpClientUpdate, onChange);
23488
23547
  };
23489
23548
  }, [initialMessage]);
23490
23549
  return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Text, { children: [
@@ -24201,7 +24260,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
24201
24260
  callId,
24202
24261
  name: SHELL_COMMAND_NAME,
24203
24262
  description: rawQuery,
24204
- status: "executing" /* Executing */,
24263
+ status: CoreToolCallStatus.Executing,
24205
24264
  isClientInitiated: true,
24206
24265
  resultDisplay: "",
24207
24266
  confirmationDetails: void 0
@@ -24342,7 +24401,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
24342
24401
  mainContent = result.output.trim() || "(Command produced no output)";
24343
24402
  }
24344
24403
  let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
24345
- let finalStatus = "success" /* Success */;
24404
+ let finalStatus = CoreToolCallStatus.Success;
24346
24405
  const prependToAnsiOutput = (output, text) => {
24347
24406
  const newLines = text.split("\n").map((line) => [
24348
24407
  {
@@ -24361,20 +24420,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
24361
24420
  };
24362
24421
  let prefix = "";
24363
24422
  if (result.error) {
24364
- finalStatus = "error" /* Error */;
24423
+ finalStatus = CoreToolCallStatus.Error;
24365
24424
  prefix = result.error.message;
24366
24425
  } else if (result.aborted) {
24367
- finalStatus = "cancelled" /* Cancelled */;
24426
+ finalStatus = CoreToolCallStatus.Cancelled;
24368
24427
  prefix = "Command was cancelled.";
24369
24428
  } else if (result.backgrounded) {
24370
- finalStatus = "success" /* Success */;
24429
+ finalStatus = CoreToolCallStatus.Success;
24371
24430
  finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
24372
24431
  mainContent = finalOutput;
24373
24432
  } else if (result.signal) {
24374
- finalStatus = "error" /* Error */;
24433
+ finalStatus = CoreToolCallStatus.Error;
24375
24434
  prefix = `Command terminated by signal: ${result.signal}.`;
24376
24435
  } else if (result.exitCode !== 0) {
24377
- finalStatus = "error" /* Error */;
24436
+ finalStatus = CoreToolCallStatus.Error;
24378
24437
  prefix = `Command exited with code ${result.exitCode}.`;
24379
24438
  }
24380
24439
  if (prefix) {
@@ -24400,7 +24459,7 @@ ${mainContent}`;
24400
24459
  status: finalStatus,
24401
24460
  resultDisplay: finalOutput
24402
24461
  };
24403
- if (finalStatus !== "cancelled" /* Cancelled */) {
24462
+ if (finalStatus !== CoreToolCallStatus.Cancelled) {
24404
24463
  addItemToHistory(
24405
24464
  {
24406
24465
  type: "tool_group",
@@ -25390,12 +25449,12 @@ function useQuotaAndFallback({
25390
25449
  error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
25391
25450
  `/stats model for usage details`,
25392
25451
  `/model to switch models.`,
25393
- contentGeneratorConfig?.authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? `/auth to switch to API key.` : null
25452
+ contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
25394
25453
  ].filter(Boolean);
25395
25454
  message = messageLines.join("\n");
25396
25455
  } else if (error instanceof ModelNotFoundError) {
25397
25456
  isModelNotFoundError = true;
25398
- if (contentGeneratorConfig?.authType === "vertex-ai" /* USE_VERTEX_AI */ && VALID_GEMINI_MODELS.has(failedModel)) {
25457
+ if (contentGeneratorConfig?.authType === AuthType.USE_VERTEX_AI && VALID_GEMINI_MODELS.has(failedModel)) {
25399
25458
  const location = process.env["GOOGLE_CLOUD_LOCATION"] || "your configured region";
25400
25459
  const messageLines = [
25401
25460
  `Model "${failedModel}" is not available in region "${location}".`,
@@ -25587,7 +25646,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
25587
25646
  );
25588
25647
  setEditorError(null);
25589
25648
  setIsEditorDialogOpen(false);
25590
- coreEvents.emit("editor-selected" /* EditorSelected */, { editor: editorType });
25649
+ coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
25591
25650
  } catch (error) {
25592
25651
  setEditorError(`Failed to set editor preference: ${error}`);
25593
25652
  }
@@ -25596,7 +25655,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
25596
25655
  );
25597
25656
  const exitEditorDialog = (0, import_react91.useCallback)(() => {
25598
25657
  setIsEditorDialogOpen(false);
25599
- coreEvents.emit("editor-selected" /* EditorSelected */, { editor: void 0 });
25658
+ coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
25600
25659
  }, []);
25601
25660
  return {
25602
25661
  isEditorDialogOpen,
@@ -25973,7 +26032,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
25973
26032
  canonicalPath: resolvedCommandPath
25974
26033
  } = parseSlashCommand(trimmed, commands);
25975
26034
  if (!commandToExecute) {
25976
- const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === "in_progress" /* IN_PROGRESS */;
26035
+ const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
25977
26036
  if (isMcpLoading) {
25978
26037
  setIsProcessing(true);
25979
26038
  if (addToHistory) {
@@ -26153,7 +26212,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26153
26212
  onConfirm: async (resolvedOutcome) => {
26154
26213
  resolve3({
26155
26214
  outcome: resolvedOutcome,
26156
- approvedCommands: resolvedOutcome === "cancel" /* Cancel */ ? [] : result.commandsToConfirm
26215
+ approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
26157
26216
  });
26158
26217
  }
26159
26218
  };
@@ -26161,7 +26220,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26161
26220
  callId,
26162
26221
  name: "Expansion",
26163
26222
  description: "Command expansion needs shell access",
26164
- status: "awaiting_approval" /* AwaitingApproval */,
26223
+ status: CoreToolCallStatus.AwaitingApproval,
26165
26224
  isClientInitiated: true,
26166
26225
  resultDisplay: void 0,
26167
26226
  confirmationDetails
@@ -26172,7 +26231,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26172
26231
  });
26173
26232
  });
26174
26233
  setPendingItem(null);
26175
- if (outcome === "cancel" /* Cancel */ || !approvedCommands || approvedCommands.length === 0) {
26234
+ if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
26176
26235
  addItem(
26177
26236
  {
26178
26237
  type: "info" /* INFO */,
@@ -26182,7 +26241,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26182
26241
  );
26183
26242
  return { type: "handled" };
26184
26243
  }
26185
- if (outcome === "proceed_always" /* ProceedAlways */) {
26244
+ if (outcome === ToolConfirmationOutcome.ProceedAlways) {
26186
26245
  setSessionShellAllowlist(
26187
26246
  (prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
26188
26247
  );
@@ -26658,7 +26717,7 @@ function mapToDisplay(toolOrTools, options = {}) {
26658
26717
  let description;
26659
26718
  let renderOutputAsMarkdown = false;
26660
26719
  const displayName = call.tool?.displayName ?? call.request.name;
26661
- if (call.status === "error" /* Error */) {
26720
+ if (call.status === CoreToolCallStatus.Error) {
26662
26721
  description = JSON.stringify(call.request.args);
26663
26722
  } else {
26664
26723
  description = call.invocation.getDescription();
@@ -26681,27 +26740,27 @@ function mapToDisplay(toolOrTools, options = {}) {
26681
26740
  let progress = void 0;
26682
26741
  let progressTotal = void 0;
26683
26742
  switch (call.status) {
26684
- case "success" /* Success */:
26743
+ case CoreToolCallStatus.Success:
26685
26744
  resultDisplay = call.response.resultDisplay;
26686
26745
  outputFile = call.response.outputFile;
26687
26746
  break;
26688
- case "error" /* Error */:
26689
- case "cancelled" /* Cancelled */:
26747
+ case CoreToolCallStatus.Error:
26748
+ case CoreToolCallStatus.Cancelled:
26690
26749
  resultDisplay = call.response.resultDisplay;
26691
26750
  break;
26692
- case "awaiting_approval" /* AwaitingApproval */:
26751
+ case CoreToolCallStatus.AwaitingApproval:
26693
26752
  correlationId = call.correlationId;
26694
26753
  confirmationDetails = call.confirmationDetails;
26695
26754
  break;
26696
- case "executing" /* Executing */:
26755
+ case CoreToolCallStatus.Executing:
26697
26756
  resultDisplay = call.liveOutput;
26698
26757
  ptyId = call.pid;
26699
26758
  progressMessage = call.progressMessage;
26700
26759
  progress = call.progress;
26701
26760
  progressTotal = call.progressTotal;
26702
26761
  break;
26703
- case "scheduled" /* Scheduled */:
26704
- case "validating" /* Validating */:
26762
+ case CoreToolCallStatus.Scheduled:
26763
+ case CoreToolCallStatus.Validating:
26705
26764
  break;
26706
26765
  default: {
26707
26766
  const exhaustiveCheck = call;
@@ -26772,7 +26831,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26772
26831
  const handler = (event) => {
26773
26832
  const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
26774
26833
  const hasExecuting = event.toolCalls.some(
26775
- (tc) => tc.status === "executing" /* Executing */ || (tc.status === "success" /* Success */ || tc.status === "error" /* Error */) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
26834
+ (tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
26776
26835
  );
26777
26836
  if (hasExecuting) {
26778
26837
  setLastToolOutputTime(Date.now());
@@ -26781,7 +26840,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26781
26840
  const prevCalls = prev[event.schedulerId] ?? [];
26782
26841
  const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
26783
26842
  const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
26784
- (tc) => tc.status === "awaiting_approval" /* AwaitingApproval */ || prevCallIds.has(tc.request.callId)
26843
+ (tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
26785
26844
  );
26786
26845
  if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
26787
26846
  return prev;
@@ -26793,9 +26852,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26793
26852
  };
26794
26853
  });
26795
26854
  };
26796
- messageBus.subscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
26855
+ messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
26797
26856
  return () => {
26798
- messageBus.unsubscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
26857
+ messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
26799
26858
  };
26800
26859
  }, [messageBus, internalAdaptToolCalls]);
26801
26860
  (0, import_react98.useEffect)(() => {
@@ -26817,9 +26876,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26817
26876
  };
26818
26877
  });
26819
26878
  };
26820
- messageBus.subscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
26879
+ messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
26821
26880
  return () => {
26822
- messageBus.unsubscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
26881
+ messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
26823
26882
  };
26824
26883
  }, [messageBus]);
26825
26884
  const schedule = (0, import_react98.useCallback)(
@@ -26918,8 +26977,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
26918
26977
  const prev = prevMap.get(coreCall.request.callId);
26919
26978
  const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
26920
26979
  let status = coreCall.status;
26921
- if ((status === "success" /* Success */ || status === "error" /* Error */) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
26922
- status = "executing" /* Executing */;
26980
+ if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
26981
+ status = CoreToolCallStatus.Executing;
26923
26982
  }
26924
26983
  return {
26925
26984
  ...coreCall,
@@ -26951,7 +27010,7 @@ function getBackgroundedToolInfo(toolCall) {
26951
27010
  };
26952
27011
  }
26953
27012
  function isBackgroundableExecutingToolCall(toolCall) {
26954
- return toolCall.status === "executing" /* Executing */ && typeof toolCall.pid === "number";
27013
+ return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
26955
27014
  }
26956
27015
  function showCitations(settings) {
26957
27016
  const enabled = settings.merged.ui.showCitations;
@@ -26961,14 +27020,14 @@ function showCitations(settings) {
26961
27020
  return true;
26962
27021
  }
26963
27022
  function calculateStreamingState(isResponding, toolCalls) {
26964
- if (toolCalls.some((tc) => tc.status === "awaiting_approval" /* AwaitingApproval */)) {
27023
+ if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
26965
27024
  return "waiting_for_confirmation" /* WaitingForConfirmation */;
26966
27025
  }
26967
27026
  const isAnyToolActive = toolCalls.some((tc) => {
26968
- if (tc.status === "executing" /* Executing */ || tc.status === "scheduled" /* Scheduled */ || tc.status === "validating" /* Validating */) {
27027
+ if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
26969
27028
  return true;
26970
27029
  }
26971
- if (tc.status === "success" /* Success */ || tc.status === "error" /* Error */ || tc.status === "cancelled" /* Cancelled */) {
27030
+ if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
26972
27031
  return !tc.responseSubmittedToGemini;
26973
27032
  }
26974
27033
  return false;
@@ -27014,9 +27073,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27014
27073
  }
27015
27074
  setRetryStatus(payload);
27016
27075
  };
27017
- coreEvents.on("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
27076
+ coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
27018
27077
  return () => {
27019
- coreEvents.off("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
27078
+ coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
27020
27079
  };
27021
27080
  }, [isRespondingRef]);
27022
27081
  const [
@@ -27149,12 +27208,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27149
27208
  const tc = toolCalls[i];
27150
27209
  if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
27151
27210
  if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
27152
- const isAgent = tc.tool?.kind === "agent" /* Agent */;
27211
+ const isAgent = tc.tool?.kind === Kind.Agent;
27153
27212
  if (isAgent) {
27154
27213
  let contigAgentsComplete = true;
27155
27214
  for (let j = i + 1; j < toolCalls.length; j++) {
27156
27215
  const nextTc = toolCalls[j];
27157
- if (nextTc.tool?.kind === "agent" /* Agent */) {
27216
+ if (nextTc.tool?.kind === Kind.Agent) {
27158
27217
  if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
27159
27218
  contigAgentsComplete = false;
27160
27219
  break;
@@ -27180,7 +27239,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27180
27239
  let currentGroup = [];
27181
27240
  for (const tc of toolsToPush) {
27182
27241
  newPushed.add(tc.request.callId);
27183
- if (tc.tool?.kind === "agent" /* Agent */) {
27242
+ if (tc.tool?.kind === Kind.Agent) {
27184
27243
  currentGroup.push(tc);
27185
27244
  } else {
27186
27245
  if (currentGroup.length > 0) {
@@ -27330,7 +27389,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27330
27389
  prevActiveShellPtyIdRef.current = activeShellPtyId;
27331
27390
  }, [activeShellPtyId, addItem, setIsResponding]);
27332
27391
  (0, import_react99.useEffect)(() => {
27333
- if (config.getApprovalMode() === "yolo" /* YOLO */ && streamingState === "idle" /* Idle */) {
27392
+ if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
27334
27393
  const lastUserMessageIndex = history.findLastIndex(
27335
27394
  (item) => item.type === "user" /* USER */
27336
27395
  );
@@ -27398,7 +27457,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27398
27457
  return;
27399
27458
  }
27400
27459
  const hasActiveTools = toolCalls.some(
27401
- (tc) => tc.status === "executing" /* Executing */ || tc.status === "scheduled" /* Scheduled */ || tc.status === "validating" /* Validating */
27460
+ (tc) => tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating
27402
27461
  );
27403
27462
  if (streamingState === "idle" /* Idle */ && !isRespondingRef.current && !hasActiveTools) {
27404
27463
  if (clearBuffer) {
@@ -27425,7 +27484,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27425
27484
  if (tool.name === SHELL_COMMAND_NAME) {
27426
27485
  return {
27427
27486
  ...tool,
27428
- status: "cancelled" /* Cancelled */,
27487
+ status: CoreToolCallStatus.Cancelled,
27429
27488
  resultDisplay: tool.resultDisplay
27430
27489
  };
27431
27490
  }
@@ -27490,7 +27549,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27490
27549
  let localQueryToSendToGemini = null;
27491
27550
  if (typeof query === "string") {
27492
27551
  const trimmedQuery = query.trim();
27493
- await logger?.logMessage("user" /* USER */, trimmedQuery);
27552
+ await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
27494
27553
  if (!shellModeActive) {
27495
27554
  const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
27496
27555
  if (slashCommandResult) {
@@ -27646,7 +27705,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27646
27705
  if (pendingHistoryItemRef.current) {
27647
27706
  if (pendingHistoryItemRef.current.type === "tool_group") {
27648
27707
  const updatedTools = pendingHistoryItemRef.current.tools.map(
27649
- (tool) => tool.status === "validating" /* Validating */ || tool.status === "scheduled" /* Scheduled */ || tool.status === "awaiting_approval" /* AwaitingApproval */ || tool.status === "executing" /* Executing */ ? { ...tool, status: "cancelled" /* Cancelled */ } : tool
27708
+ (tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
27650
27709
  );
27651
27710
  const pendingItem = {
27652
27711
  ...pendingHistoryItemRef.current,
@@ -27892,15 +27951,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27892
27951
  let geminiMessageBuffer = "";
27893
27952
  const toolCallRequests = [];
27894
27953
  for await (const event of stream) {
27895
- if (event.type !== "thought" /* Thought */ && thoughtRef.current !== null) {
27954
+ if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
27896
27955
  setThought(null);
27897
27956
  }
27898
27957
  switch (event.type) {
27899
- case "thought" /* Thought */:
27958
+ case GeminiEventType.Thought:
27900
27959
  setLastGeminiActivityTime(Date.now());
27901
27960
  handleThoughtEvent(event.value, userMessageTimestamp);
27902
27961
  break;
27903
- case "content" /* Content */:
27962
+ case GeminiEventType.Content:
27904
27963
  setLastGeminiActivityTime(Date.now());
27905
27964
  geminiMessageBuffer = handleContentEvent(
27906
27965
  event.value,
@@ -27908,16 +27967,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27908
27967
  userMessageTimestamp
27909
27968
  );
27910
27969
  break;
27911
- case "tool_call_request" /* ToolCallRequest */:
27970
+ case GeminiEventType.ToolCallRequest:
27912
27971
  toolCallRequests.push(event.value);
27913
27972
  break;
27914
- case "user_cancelled" /* UserCancelled */:
27973
+ case GeminiEventType.UserCancelled:
27915
27974
  handleUserCancelledEvent(userMessageTimestamp);
27916
27975
  break;
27917
- case "error" /* Error */:
27976
+ case GeminiEventType.Error:
27918
27977
  handleErrorEvent(event.value, userMessageTimestamp);
27919
27978
  break;
27920
- case "agent_execution_stopped" /* AgentExecutionStopped */:
27979
+ case GeminiEventType.AgentExecutionStopped:
27921
27980
  handleAgentExecutionStoppedEvent(
27922
27981
  event.value.reason,
27923
27982
  userMessageTimestamp,
@@ -27925,7 +27984,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27925
27984
  event.value.contextCleared
27926
27985
  );
27927
27986
  break;
27928
- case "agent_execution_blocked" /* AgentExecutionBlocked */:
27987
+ case GeminiEventType.AgentExecutionBlocked:
27929
27988
  handleAgentExecutionBlockedEvent(
27930
27989
  event.value.reason,
27931
27990
  userMessageTimestamp,
@@ -27933,35 +27992,35 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27933
27992
  event.value.contextCleared
27934
27993
  );
27935
27994
  break;
27936
- case "chat_compressed" /* ChatCompressed */:
27995
+ case GeminiEventType.ChatCompressed:
27937
27996
  handleChatCompressionEvent(event.value, userMessageTimestamp);
27938
27997
  break;
27939
- case "tool_call_confirmation" /* ToolCallConfirmation */:
27940
- case "tool_call_response" /* ToolCallResponse */:
27998
+ case GeminiEventType.ToolCallConfirmation:
27999
+ case GeminiEventType.ToolCallResponse:
27941
28000
  break;
27942
- case "max_session_turns" /* MaxSessionTurns */:
28001
+ case GeminiEventType.MaxSessionTurns:
27943
28002
  handleMaxSessionTurnsEvent();
27944
28003
  break;
27945
- case "context_window_will_overflow" /* ContextWindowWillOverflow */:
28004
+ case GeminiEventType.ContextWindowWillOverflow:
27946
28005
  handleContextWindowWillOverflowEvent(
27947
28006
  event.value.estimatedRequestTokenCount,
27948
28007
  event.value.remainingTokenCount
27949
28008
  );
27950
28009
  break;
27951
- case "finished" /* Finished */:
28010
+ case GeminiEventType.Finished:
27952
28011
  handleFinishedEvent(event, userMessageTimestamp);
27953
28012
  break;
27954
- case "citation" /* Citation */:
28013
+ case GeminiEventType.Citation:
27955
28014
  handleCitationEvent(event.value, userMessageTimestamp);
27956
28015
  break;
27957
- case "model_info" /* ModelInfo */:
28016
+ case GeminiEventType.ModelInfo:
27958
28017
  handleChatModelEvent(event.value, userMessageTimestamp);
27959
28018
  break;
27960
- case "loop_detected" /* LoopDetected */:
28019
+ case GeminiEventType.LoopDetected:
27961
28020
  loopDetectedRef.current = true;
27962
28021
  break;
27963
- case "retry" /* Retry */:
27964
- case "invalid_stream" /* InvalidStream */:
28022
+ case GeminiEventType.Retry:
28023
+ case GeminiEventType.InvalidStream:
27965
28024
  break;
27966
28025
  default: {
27967
28026
  const unreachable = event;
@@ -28002,7 +28061,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28002
28061
  const submitQuery = (0, import_react99.useCallback)(
28003
28062
  async (query, options, prompt_id) => runInDevTraceSpan(
28004
28063
  {
28005
- operation: options?.isContinuation ? "system_prompt" /* SystemPrompt */ : "user_prompt" /* UserPrompt */,
28064
+ operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
28006
28065
  sessionId: config.getSessionId()
28007
28066
  },
28008
28067
  async ({ metadata: spanMetadata }) => {
@@ -28162,7 +28221,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28162
28221
  );
28163
28222
  const handleApprovalModeChange = (0, import_react99.useCallback)(
28164
28223
  async (newApprovalMode) => {
28165
- if (previousApprovalModeRef.current === "plan" /* PLAN */ && newApprovalMode !== "plan" /* PLAN */ && streamingState === "idle" /* Idle */) {
28224
+ if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
28166
28225
  if (geminiClient) {
28167
28226
  try {
28168
28227
  await geminiClient.addHistory({
@@ -28185,11 +28244,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28185
28244
  }
28186
28245
  }
28187
28246
  previousApprovalModeRef.current = newApprovalMode;
28188
- if (newApprovalMode === "yolo" /* YOLO */ || newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
28247
+ if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
28189
28248
  let awaitingApprovalCalls = toolCalls.filter(
28190
28249
  (call) => call.status === "awaiting_approval" && !call.request.forcedAsk
28191
28250
  );
28192
- if (newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
28251
+ if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
28193
28252
  awaitingApprovalCalls = awaitingApprovalCalls.filter((call) => {
28194
28253
  if (EDIT_TOOL_NAMES.has(call.request.name)) {
28195
28254
  return true;
@@ -28205,11 +28264,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28205
28264
  if (call.correlationId) {
28206
28265
  try {
28207
28266
  await config.getMessageBus().publish({
28208
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
28267
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
28209
28268
  correlationId: call.correlationId,
28210
28269
  confirmed: true,
28211
28270
  requiresUserConfirmation: false,
28212
- outcome: "proceed_once" /* ProceedOnce */
28271
+ outcome: ToolConfirmationOutcome.ProceedOnce
28213
28272
  });
28214
28273
  } catch (error) {
28215
28274
  debugLogger.warn(
@@ -28278,14 +28337,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28278
28337
  );
28279
28338
  if (isLowErrorVerbosity) {
28280
28339
  suppressedToolErrorCountRef.current += geminiTools.filter(
28281
- (tc) => tc.status === "error" /* Error */
28340
+ (tc) => tc.status === CoreToolCallStatus.Error
28282
28341
  ).length;
28283
28342
  }
28284
28343
  if (geminiTools.length === 0) {
28285
28344
  return;
28286
28345
  }
28287
28346
  const stopExecutionTool = geminiTools.find(
28288
- (tc) => tc.response.errorType === "stop_execution" /* STOP_EXECUTION */
28347
+ (tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
28289
28348
  );
28290
28349
  if (stopExecutionTool && stopExecutionTool.response.error) {
28291
28350
  maybeAddSuppressedToolErrorNote();
@@ -28305,9 +28364,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28305
28364
  (tc) => !isTopicTool2(tc.request.name)
28306
28365
  );
28307
28366
  const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
28308
- (tc) => tc.status === "cancelled" /* Cancelled */
28367
+ (tc) => tc.status === CoreToolCallStatus.Cancelled
28309
28368
  );
28310
- const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === "cancelled" /* Cancelled */);
28369
+ const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
28311
28370
  if (allDeclinableToolsCancelled || allToolsCancelled) {
28312
28371
  if (!turnCancelledRef.current) {
28313
28372
  addItem({
@@ -28387,7 +28446,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28387
28446
  return;
28388
28447
  }
28389
28448
  const restorableToolCalls = toolCalls.filter(
28390
- (toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === "awaiting_approval" /* AwaitingApproval */
28449
+ (toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
28391
28450
  );
28392
28451
  if (restorableToolCalls.length > 0) {
28393
28452
  if (!gitService) {
@@ -28610,14 +28669,14 @@ var useAgentStream = ({
28610
28669
  const displayName = legacyState?.displayName ?? event.name;
28611
28670
  const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
28612
28671
  const desc = legacyState?.description ?? "";
28613
- const fallbackKind = "other" /* Other */;
28672
+ const fallbackKind = Kind.Other;
28614
28673
  const newCall = {
28615
28674
  callId: event.requestId,
28616
28675
  name: displayName,
28617
28676
  originalRequestName: event.name,
28618
28677
  description: desc,
28619
28678
  display: event.display,
28620
- status: "scheduled" /* Scheduled */,
28679
+ status: CoreToolCallStatus.Scheduled,
28621
28680
  isClientInitiated: false,
28622
28681
  renderOutputAsMarkdown: isOutputMarkdown,
28623
28682
  kind: legacyState?.kind ?? fallbackKind,
@@ -28635,10 +28694,10 @@ var useAgentStream = ({
28635
28694
  const evtStatus = legacyState?.status;
28636
28695
  let status = tc.status;
28637
28696
  if (evtStatus === "executing")
28638
- status = "executing" /* Executing */;
28639
- else if (evtStatus === "error") status = "error" /* Error */;
28697
+ status = CoreToolCallStatus.Executing;
28698
+ else if (evtStatus === "error") status = CoreToolCallStatus.Error;
28640
28699
  else if (evtStatus === "success")
28641
- status = "success" /* Success */;
28700
+ status = CoreToolCallStatus.Success;
28642
28701
  const display = event.display?.result;
28643
28702
  const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
28644
28703
  const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
@@ -28671,7 +28730,7 @@ var useAgentStream = ({
28671
28730
  const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
28672
28731
  return {
28673
28732
  ...tc,
28674
- status: event.isError ? "error" /* Error */ : "success" /* Success */,
28733
+ status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
28675
28734
  display: event.display ? { ...tc.display, ...event.display } : tc.display,
28676
28735
  resultDisplay,
28677
28736
  outputFile
@@ -28737,7 +28796,7 @@ var useAgentStream = ({
28737
28796
  if (!options?.isContinuation) {
28738
28797
  if (typeof query === "string") {
28739
28798
  addItem({ type: "user" /* USER */, text: query }, timestamp);
28740
- void logger?.logMessage("user" /* USER */, query);
28799
+ void logger?.logMessage(MessageSenderType.USER, query);
28741
28800
  }
28742
28801
  startNewPrompt();
28743
28802
  }
@@ -30264,9 +30323,9 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30264
30323
  const handleFolderTrustSelect = (0, import_react105.useCallback)(
30265
30324
  async (choice) => {
30266
30325
  const trustLevelMap = {
30267
- ["trust_folder" /* TRUST_FOLDER */]: "TRUST_FOLDER" /* TRUST_FOLDER */,
30268
- ["trust_parent" /* TRUST_PARENT */]: "TRUST_PARENT" /* TRUST_PARENT */,
30269
- ["do_not_trust" /* DO_NOT_TRUST */]: "DO_NOT_TRUST" /* DO_NOT_TRUST */
30326
+ ["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
30327
+ ["trust_parent" /* TRUST_PARENT */]: TrustLevel.TRUST_PARENT,
30328
+ ["do_not_trust" /* DO_NOT_TRUST */]: TrustLevel.DO_NOT_TRUST
30270
30329
  };
30271
30330
  const trustLevel = trustLevelMap[choice];
30272
30331
  if (!trustLevel) return;
@@ -30285,7 +30344,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30285
30344
  }, 100);
30286
30345
  return;
30287
30346
  }
30288
- const currentIsTrusted = trustLevel === "TRUST_FOLDER" /* TRUST_FOLDER */ || trustLevel === "TRUST_PARENT" /* TRUST_PARENT */;
30347
+ const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
30289
30348
  onTrustChange(currentIsTrusted);
30290
30349
  setIsTrusted(currentIsTrusted);
30291
30350
  const wasTrusted = isTrusted ?? false;
@@ -31293,7 +31352,7 @@ function useMessageQueue({
31293
31352
  var import_react107 = __toESM(require_react(), 1);
31294
31353
  function useMcpStatus(config) {
31295
31354
  const [discoveryState, setDiscoveryState] = (0, import_react107.useState)(
31296
- () => config.getMcpClientManager()?.getDiscoveryState() ?? "not_started" /* NOT_STARTED */
31355
+ () => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
31297
31356
  );
31298
31357
  const [mcpServerCount, setMcpServerCount] = (0, import_react107.useState)(
31299
31358
  () => config.getMcpClientManager()?.getMcpServerCount() ?? 0
@@ -31306,12 +31365,12 @@ function useMcpStatus(config) {
31306
31365
  setMcpServerCount(manager.getMcpServerCount());
31307
31366
  }
31308
31367
  };
31309
- coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
31368
+ coreEvents.on(CoreEvent.McpClientUpdate, onChange);
31310
31369
  return () => {
31311
- coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
31370
+ coreEvents.off(CoreEvent.McpClientUpdate, onChange);
31312
31371
  };
31313
31372
  }, [config]);
31314
- const isMcpReady = discoveryState === "completed" /* COMPLETED */ || discoveryState === "not_started" /* NOT_STARTED */ && mcpServerCount === 0;
31373
+ const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
31315
31374
  return {
31316
31375
  discoveryState,
31317
31376
  mcpServerCount,
@@ -31338,7 +31397,7 @@ function useApprovalModeIndicator({
31338
31397
  (key) => {
31339
31398
  let nextApprovalMode;
31340
31399
  if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
31341
- if (config.isYoloModeDisabled() && config.getApprovalMode() !== "yolo" /* YOLO */) {
31400
+ if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
31342
31401
  if (addItem) {
31343
31402
  let text = "You cannot enter YOLO mode since it is disabled in your settings.";
31344
31403
  const adminSettings = config.getRemoteAdminSettings();
@@ -31356,21 +31415,21 @@ function useApprovalModeIndicator({
31356
31415
  }
31357
31416
  return;
31358
31417
  }
31359
- nextApprovalMode = config.getApprovalMode() === "yolo" /* YOLO */ ? "default" /* DEFAULT */ : "yolo" /* YOLO */;
31418
+ nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
31360
31419
  } else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
31361
31420
  const currentMode = config.getApprovalMode();
31362
31421
  switch (currentMode) {
31363
- case "default" /* DEFAULT */:
31364
- nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
31422
+ case ApprovalMode.DEFAULT:
31423
+ nextApprovalMode = ApprovalMode.AUTO_EDIT;
31365
31424
  break;
31366
- case "autoEdit" /* AUTO_EDIT */:
31367
- nextApprovalMode = allowPlanMode ? "plan" /* PLAN */ : "default" /* DEFAULT */;
31425
+ case ApprovalMode.AUTO_EDIT:
31426
+ nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
31368
31427
  break;
31369
- case "plan" /* PLAN */:
31370
- nextApprovalMode = "default" /* DEFAULT */;
31428
+ case ApprovalMode.PLAN:
31429
+ nextApprovalMode = ApprovalMode.DEFAULT;
31371
31430
  break;
31372
- case "yolo" /* YOLO */:
31373
- nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
31431
+ case ApprovalMode.YOLO:
31432
+ nextApprovalMode = ApprovalMode.AUTO_EDIT;
31374
31433
  break;
31375
31434
  default:
31376
31435
  }
@@ -31780,11 +31839,11 @@ var useHookDisplayState = () => {
31780
31839
  removeHook();
31781
31840
  }
31782
31841
  };
31783
- coreEvents.on("hook-start" /* HookStart */, handleHookStart);
31784
- coreEvents.on("hook-end" /* HookEnd */, handleHookEnd);
31842
+ coreEvents.on(CoreEvent.HookStart, handleHookStart);
31843
+ coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
31785
31844
  return () => {
31786
- coreEvents.off("hook-start" /* HookStart */, handleHookStart);
31787
- coreEvents.off("hook-end" /* HookEnd */, handleHookEnd);
31845
+ coreEvents.off(CoreEvent.HookStart, handleHookStart);
31846
+ coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
31788
31847
  activeTimeouts.forEach(clearTimeout);
31789
31848
  activeTimeouts.clear();
31790
31849
  };
@@ -32623,7 +32682,7 @@ var AppContainer = (props) => {
32623
32682
  setConfigInitialized(true);
32624
32683
  startupProfiler.flush(config);
32625
32684
  startAutoMemoryIfEnabled(config);
32626
- const sessionStartSource = resumedSessionData ? "resume" /* Resume */ : "startup" /* Startup */;
32685
+ const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
32627
32686
  const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
32628
32687
  if (result) {
32629
32688
  const additionalContext = result.getAdditionalContext();
@@ -32650,7 +32709,7 @@ var AppContainer = (props) => {
32650
32709
  );
32651
32710
  const ideClient = await IdeClient.getInstance();
32652
32711
  await ideClient.disconnect();
32653
- await config?.getHookSystem()?.fireSessionEndEvent("exit" /* Exit */);
32712
+ await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
32654
32713
  };
32655
32714
  registerCleanup(cleanupFn);
32656
32715
  return () => {
@@ -32675,11 +32734,11 @@ var AppContainer = (props) => {
32675
32734
  resetTime: payload.resetTime
32676
32735
  });
32677
32736
  };
32678
- coreEvents.on("model-changed" /* ModelChanged */, handleModelChanged);
32679
- coreEvents.on("quota-changed" /* QuotaChanged */, handleQuotaChanged);
32737
+ coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
32738
+ coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
32680
32739
  return () => {
32681
- coreEvents.off("model-changed" /* ModelChanged */, handleModelChanged);
32682
- coreEvents.off("quota-changed" /* QuotaChanged */, handleQuotaChanged);
32740
+ coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
32741
+ coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
32683
32742
  };
32684
32743
  }, [config]);
32685
32744
  (0, import_react121.useEffect)(() => {
@@ -32692,16 +32751,16 @@ var AppContainer = (props) => {
32692
32751
  const handleAgentsDiscovered = (payload) => {
32693
32752
  setNewAgents(payload.agents);
32694
32753
  };
32695
- coreEvents.on("settings-changed" /* SettingsChanged */, handleSettingsChanged);
32696
- coreEvents.on("admin-settings-changed" /* AdminSettingsChanged */, handleAdminSettingsChanged);
32697
- coreEvents.on("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
32754
+ coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
32755
+ coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
32756
+ coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
32698
32757
  return () => {
32699
- coreEvents.off("settings-changed" /* SettingsChanged */, handleSettingsChanged);
32758
+ coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
32700
32759
  coreEvents.off(
32701
- "admin-settings-changed" /* AdminSettingsChanged */,
32760
+ CoreEvent.AdminSettingsChanged,
32702
32761
  handleAdminSettingsChanged
32703
32762
  );
32704
- coreEvents.off("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
32763
+ coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
32705
32764
  };
32706
32765
  }, [settings]);
32707
32766
  const { errorCount, clearErrorCount } = useErrorCount();
@@ -32766,11 +32825,11 @@ var AppContainer = (props) => {
32766
32825
  exitEditorDialog
32767
32826
  } = useEditorSettings(settings, setEditorError, historyManager.addItem);
32768
32827
  (0, import_react121.useEffect)(() => {
32769
- coreEvents.on("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
32770
- coreEvents.on("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
32828
+ coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
32829
+ coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
32771
32830
  return () => {
32772
- coreEvents.off("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
32773
- coreEvents.off("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
32831
+ coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
32832
+ coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
32774
32833
  };
32775
32834
  }, [handleEditorClose, openEditorDialog]);
32776
32835
  (0, import_react121.useEffect)(() => {
@@ -32838,7 +32897,7 @@ var AppContainer = (props) => {
32838
32897
  errorVerbosity: settings.merged.ui.errorVerbosity
32839
32898
  });
32840
32899
  const isAuthDialogOpen = authState === "updating" /* Updating */;
32841
- const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== "gemini-api-key" /* USE_GEMINI */;
32900
+ const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
32842
32901
  const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
32843
32902
  const { loadHistoryForResume, isResuming } = useSessionResume({
32844
32903
  config,
@@ -32866,7 +32925,7 @@ var AppContainer = (props) => {
32866
32925
  async (authType, scope) => {
32867
32926
  if (authType) {
32868
32927
  const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
32869
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */) {
32928
+ if (authType === AuthType.LOGIN_WITH_GOOGLE) {
32870
32929
  setAuthContext({ requiresRestart: true });
32871
32930
  } else {
32872
32931
  setAuthContext({});
@@ -32894,7 +32953,7 @@ var AppContainer = (props) => {
32894
32953
  );
32895
32954
  return;
32896
32955
  }
32897
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
32956
+ if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
32898
32957
  writeToStdout(`
32899
32958
  ----------------------------------------------------------------
32900
32959
  Logging in with Google... Restarting Gemini CLI to continue.
@@ -32917,7 +32976,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
32917
32976
  }
32918
32977
  await saveApiKey(apiKey);
32919
32978
  await reloadApiKey();
32920
- await config.refreshAuth("gemini-api-key" /* USE_GEMINI */);
32979
+ await config.refreshAuth(AuthType.USE_GEMINI);
32921
32980
  setAuthState("authenticated" /* Authenticated */);
32922
32981
  } catch (e) {
32923
32982
  onAuthError(
@@ -32942,7 +33001,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
32942
33001
  `Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
32943
33002
  );
32944
33003
  } else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
32945
- if (settings.merged.security.auth.selectedType === "gemini-api-key" /* USE_GEMINI */) {
33004
+ if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
32946
33005
  return;
32947
33006
  }
32948
33007
  const authMethod = settings.merged.security.auth.selectedType;
@@ -33078,9 +33137,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
33078
33137
  }
33079
33138
  });
33080
33139
  };
33081
- coreEvents.on("consent-request" /* ConsentRequest */, handleConsentRequest);
33140
+ coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
33082
33141
  return () => {
33083
- coreEvents.off("consent-request" /* ConsentRequest */, handleConsentRequest);
33142
+ coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
33084
33143
  };
33085
33144
  }, []);
33086
33145
  const performMemoryRefresh = (0, import_react121.useCallback)(async () => {
@@ -33738,7 +33797,7 @@ ${queuedText}` : queuedText;
33738
33797
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
33739
33798
  if (settings.merged.general.devtools) {
33740
33799
  void (async () => {
33741
- const { toggleDevToolsPanel } = await import("./devtoolsService-XZY2NAWE.js");
33800
+ const { toggleDevToolsPanel } = await import("./devtoolsService-MG4V53EK.js");
33742
33801
  await toggleDevToolsPanel(
33743
33802
  config,
33744
33803
  showErrorDetails,
@@ -33956,17 +34015,17 @@ ${queuedText}` : queuedText;
33956
34015
  Date.now()
33957
34016
  );
33958
34017
  };
33959
- coreEvents.on("user-feedback" /* UserFeedback */, handleUserFeedback);
33960
- coreEvents.on("hook-system-message" /* HookSystemMessage */, handleHookSystemMessage);
34018
+ coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
34019
+ coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
33961
34020
  coreEvents.drainBacklogs();
33962
34021
  return () => {
33963
- coreEvents.off("user-feedback" /* UserFeedback */, handleUserFeedback);
33964
- coreEvents.off("hook-system-message" /* HookSystemMessage */, handleHookSystemMessage);
34022
+ coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
34023
+ coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
33965
34024
  };
33966
34025
  }, [historyManager]);
33967
34026
  const nightly = props.version.includes("nightly");
33968
34027
  const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
33969
- 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;
34028
+ 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;
33970
34029
  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;
33971
34030
  const hasPendingToolConfirmation = (0, import_react121.useMemo)(
33972
34031
  () => isToolAwaitingConfirmation(pendingHistoryItems),
@@ -34066,9 +34125,9 @@ ${queuedText}` : queuedText;
34066
34125
  const handleMemoryChanged = (result) => {
34067
34126
  setGeminiMdFileCount(result.fileCount);
34068
34127
  };
34069
- coreEvents.on("memory-changed" /* MemoryChanged */, handleMemoryChanged);
34128
+ coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
34070
34129
  return () => {
34071
- coreEvents.off("memory-changed" /* MemoryChanged */, handleMemoryChanged);
34130
+ coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
34072
34131
  };
34073
34132
  }, []);
34074
34133
  (0, import_react121.useEffect)(() => {