@google/gemini-cli 0.55.0-preview.1 → 0.55.0-preview.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/bundle/{chunk-DMPPAMW5.js → chunk-2K3N3YWJ.js} +1 -1
  2. package/bundle/{chunk-F3GEJ37M.js → chunk-2YAEBNH4.js} +1 -1
  3. package/bundle/{chunk-G3NJ32VD.js → chunk-3JEIIDY3.js} +1 -1
  4. package/bundle/{chunk-YU5UI6S7.js → chunk-3KVUW3GS.js} +1 -1
  5. package/bundle/{chunk-3Q3RSCXS.js → chunk-4MK4F3LQ.js} +2 -2
  6. package/bundle/{chunk-SEQ766WD.js → chunk-4PVLKN7E.js} +1 -1
  7. package/bundle/{chunk-7LAM3MXG.js → chunk-5C4IPSFG.js} +1 -1
  8. package/bundle/{chunk-I535IUEN.js → chunk-6VBVRJ2T.js} +1 -1
  9. package/bundle/{chunk-LXWZUVJW.js → chunk-7U5FKJMS.js} +3 -3
  10. package/bundle/{chunk-GL46CQLD.js → chunk-BXJWVB6T.js} +7 -7
  11. package/bundle/chunk-CF6HJK4T.js +1571 -0
  12. package/bundle/{chunk-APDWRUAP.js → chunk-D7NKQXI3.js} +27 -14
  13. package/bundle/{chunk-AKJETY2D.js → chunk-DIJFIQU5.js} +9 -8
  14. package/bundle/{chunk-RXENTUH3.js → chunk-DW2J2NTU.js} +8 -5
  15. package/bundle/{chunk-UM7AN6ZZ.js → chunk-EBUEQDL4.js} +3 -3
  16. package/bundle/chunk-ENEDM4X3.js +512 -0
  17. package/bundle/{chunk-VHRT3UPF.js → chunk-ETEDB3N6.js} +2 -2
  18. package/bundle/{chunk-MWEFWYTU.js → chunk-FQNLDGXL.js} +1 -1
  19. package/bundle/{chunk-IBEJG5F5.js → chunk-GJBRSFPM.js} +7 -7
  20. package/bundle/{chunk-QQVXLF7U.js → chunk-IKOQM4YN.js} +3 -3
  21. package/bundle/chunk-MOTK2J3L.js +154 -0
  22. package/bundle/{chunk-A7NLEV6J.js → chunk-NQ7ACVH7.js} +2 -2
  23. package/bundle/{chunk-O6HG25DV.js → chunk-OKM3M2PX.js} +1 -1
  24. package/bundle/{chunk-TQPJD4W5.js → chunk-QJZS4YYR.js} +67 -54
  25. package/bundle/{chunk-KNRWWK34.js → chunk-QY6VB26P.js} +7659 -14286
  26. package/bundle/chunk-S35HA76T.js +398 -0
  27. package/bundle/chunk-V6HSKTFR.js +118 -0
  28. package/bundle/{chunk-G4NBAJCP.js → chunk-VPMDE76T.js} +46 -25
  29. package/bundle/chunk-WWUS7UCO.js +397244 -0
  30. package/bundle/{chunk-GPP3RO7B.js → chunk-XLLOEYE5.js} +1 -1
  31. package/bundle/chunk-XNQ2USVV.js +17332 -0
  32. package/bundle/chunk-YOSR3LGH.js +102505 -0
  33. package/bundle/{cleanup-2EQCXKR2.js → cleanup-6PJC7KVH.js} +2 -2
  34. package/bundle/{cleanup-CVITZEST.js → cleanup-AA32XASX.js} +2 -2
  35. package/bundle/{cleanup-JPURY2FN.js → cleanup-KJNT5CKE.js} +2 -2
  36. package/bundle/cleanup-W4XFBOYU.js +32 -0
  37. package/bundle/{core-M7EWVE7C.js → core-PJ4GTWLE.js} +1 -1
  38. package/bundle/{devtoolsService-LTCUHAKD.js → devtoolsService-BPCHKSK6.js} +2 -2
  39. package/bundle/{devtoolsService-2PJHOM3Z.js → devtoolsService-DDIV43LO.js} +2 -2
  40. package/bundle/{devtoolsService-G4J2W6MV.js → devtoolsService-SFT4J3TP.js} +4 -3
  41. package/bundle/devtoolsService-X4SBEWHU.js +4359 -0
  42. package/bundle/{dist-TXQI77ZL.js → dist-6SIQ6JNU.js} +1 -1
  43. package/bundle/{core-2KFPOGVU.js → dist-UVDHLJPD.js} +1 -1
  44. package/bundle/dist-VQ3F4FS5.js +2172 -0
  45. package/bundle/{gemini-QFKS36ZW.js → gemini-BMC63EGW.js} +14 -14
  46. package/bundle/{gemini-TOJXXBJZ.js → gemini-EYTXXZKY.js} +214 -198
  47. package/bundle/{gemini-4GL7B4FQ.js → gemini-MSC5T5EU.js} +14 -14
  48. package/bundle/gemini-PA23YMHK.js +17088 -0
  49. package/bundle/gemini.js +7 -7
  50. package/bundle/{interactiveCli-NWP4ENQW.js → interactiveCli-5Y6AY63C.js} +67 -25
  51. package/bundle/{interactiveCli-UPSM5SHZ.js → interactiveCli-G6PWBLT5.js} +373 -312
  52. package/bundle/{interactiveCli-QFVYPM2G.js → interactiveCli-OUPTNZ47.js} +67 -25
  53. package/bundle/interactiveCli-T32DVN2I.js +34954 -0
  54. package/bundle/{liteRtServerManager-MU2XFPN4.js → liteRtServerManager-3MCOW5QD.js} +4 -4
  55. package/bundle/{liteRtServerManager-T2WZMOZK.js → liteRtServerManager-7IWRFNTW.js} +4 -4
  56. package/bundle/{liteRtServerManager-DILFQEEZ.js → liteRtServerManager-IRFTOINI.js} +4 -4
  57. package/bundle/liteRtServerManager-LVW27XGD.js +65 -0
  58. package/bundle/{oauth2-provider-VWRIMKTD.js → oauth2-provider-BPEC44QP.js} +1 -1
  59. package/bundle/{oauth2-provider-2QGZS53A.js → oauth2-provider-FSAA6HVA.js} +38 -72
  60. package/bundle/{oauth2-provider-QNQQSC5U.js → oauth2-provider-IVUO6NTZ.js} +1 -1
  61. package/bundle/oauth2-provider-PH6ZPS7W.js +235 -0
  62. package/bundle/{start-YV56XGWM.js → start-3M54SR5N.js} +6 -6
  63. package/bundle/{start-YWLQDUFC.js → start-EEVFRHCK.js} +6 -6
  64. package/bundle/{start-M7PLRASE.js → start-FC7N6JMG.js} +6 -6
  65. package/bundle/start-N5PPVI4S.js +18 -0
  66. package/package.json +1 -1
@@ -157,10 +157,10 @@ import {
157
157
  widestLineFromStyledChars,
158
158
  wordBreakStyledChars,
159
159
  wrapStyledChars
160
- } from "./chunk-GL46CQLD.js";
160
+ } from "./chunk-QJZS4YYR.js";
161
161
  import {
162
162
  require_source
163
- } from "./chunk-F3GEJ37M.js";
163
+ } from "./chunk-2YAEBNH4.js";
164
164
  import {
165
165
  appEvents
166
166
  } from "./chunk-5PS3AYFU.js";
@@ -214,33 +214,37 @@ import {
214
214
  stripAnsi,
215
215
  stripUnsafeCharacters,
216
216
  toCodePoints
217
- } from "./chunk-GPP3RO7B.js";
217
+ } from "./chunk-XNQ2USVV.js";
218
218
  import {
219
219
  handleAutoUpdate,
220
220
  isDevelopment,
221
221
  relaunchApp,
222
222
  setUpdateHandler
223
- } from "./chunk-A7NLEV6J.js";
223
+ } from "./chunk-4MK4F3LQ.js";
224
224
  import {
225
225
  isTodoList,
226
226
  mapCoreStatusToDisplayStatus,
227
227
  require_react
228
- } from "./chunk-AKJETY2D.js";
228
+ } from "./chunk-ENEDM4X3.js";
229
229
  import {
230
230
  registerCleanup,
231
231
  removeCleanup,
232
232
  runExitCleanup,
233
233
  setupTtyCheck
234
- } from "./chunk-MWEFWYTU.js";
234
+ } from "./chunk-MOTK2J3L.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,13 +266,20 @@ 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,
271
278
  MAX_TOKENS_EXCEEDED_SUGGESTION,
279
+ MCPDiscoveryState,
280
+ MCPServerStatus,
281
+ MessageBusType,
282
+ MessageSenderType,
272
283
  ModelNotFoundError,
273
284
  ModelSlashCommandEvent,
274
285
  OTHER_BLOCKED_MESSAGE,
@@ -281,6 +292,7 @@ import {
281
292
  PREVIEW_GEMINI_MODEL,
282
293
  PolicyIntegrityManager,
283
294
  ProjectIdRequiredError,
295
+ QuestionType,
284
296
  READ_FILE_DISPLAY_NAME,
285
297
  READ_MANY_FILES_DISPLAY_NAME,
286
298
  RECITATION_BLOCKED_MESSAGE,
@@ -289,16 +301,22 @@ import {
289
301
  SAFETY_BLOCKED_MESSAGE,
290
302
  SHELL_TOOL_NAME,
291
303
  Scheduler,
304
+ SessionEndReason,
305
+ SessionStartSource,
292
306
  ShellExecutionService,
293
307
  SlashCommandStatus,
294
308
  Storage,
309
+ SubagentState,
295
310
  THINKING_ONLY_COMPRESS_SUGGESTION,
296
311
  TOPIC_PARAM_STRATEGIC_INTENT,
297
312
  TOPIC_PARAM_SUMMARY,
298
313
  TOPIC_PARAM_TITLE,
299
314
  TRUE_EMPTY_RESPONSE_MESSAGE,
300
315
  TerminalQuotaError,
316
+ ToolConfirmationOutcome,
317
+ ToolErrorType,
301
318
  TranscriptionFactory,
319
+ TrustLevel,
302
320
  UPDATE_TOPIC_DISPLAY_NAME,
303
321
  UPDATE_TOPIC_TOOL_NAME,
304
322
  UnauthorizedError,
@@ -310,6 +328,7 @@ import {
310
328
  WEB_FETCH_DISPLAY_NAME,
311
329
  WEB_SEARCH_DISPLAY_NAME,
312
330
  WRITE_FILE_DISPLAY_NAME,
331
+ WarningPriority,
313
332
  WhisperModelManager,
314
333
  addMCPStatusChangeListener,
315
334
  allowEditorTypeInSandbox,
@@ -418,7 +437,7 @@ import {
418
437
  validatePlanContent,
419
438
  validatePlanPath,
420
439
  writeToStdout
421
- } from "./chunk-G4NBAJCP.js";
440
+ } from "./chunk-D7NKQXI3.js";
422
441
  import "./chunk-664ZODQF.js";
423
442
  import "./chunk-IUUIT4SU.js";
424
443
  import "./chunk-TUDYL3X4.js";
@@ -5044,7 +5063,7 @@ function calculateShellMaxLines(options) {
5044
5063
  if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
5045
5064
  return maxLinesBasedOnHeight;
5046
5065
  }
5047
- const isExecuting = status === "executing" /* Executing */;
5066
+ const isExecuting = status === CoreToolCallStatus.Executing;
5048
5067
  const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
5049
5068
  return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
5050
5069
  }
@@ -5078,10 +5097,10 @@ function isShellTool(name) {
5078
5097
  return name === SHELL_COMMAND_NAME || name === SHELL_NAME || name === SHELL_TOOL_NAME || normalized === "shell";
5079
5098
  }
5080
5099
  function isThisShellFocusable(name, status, config) {
5081
- return !!(isShellTool(name) && status === "executing" /* Executing */ && config?.getEnableInteractiveShell());
5100
+ return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && config?.getEnableInteractiveShell());
5082
5101
  }
5083
5102
  function isThisShellFocused(name, status, ptyId, activeShellPtyId, embeddedShellFocused) {
5084
- return !!(isShellTool(name) && status === "executing" /* Executing */ && ptyId === activeShellPtyId && embeddedShellFocused);
5103
+ return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && ptyId === activeShellPtyId && embeddedShellFocused);
5085
5104
  }
5086
5105
  function useFocusHint(isThisShellFocusable2, isThisShellFocused2, resultDisplay) {
5087
5106
  const [userHasFocused, setUserHasFocused] = (0, import_react9.useState)(false);
@@ -5241,13 +5260,13 @@ var formatToolArgs = (args) => {
5241
5260
  var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) => {
5242
5261
  let headerText;
5243
5262
  let headerColor = theme.text.secondary;
5244
- if (progress.state === "cancelled" /* CANCELLED */) {
5263
+ if (progress.state === SubagentState.CANCELLED) {
5245
5264
  headerText = `Subagent ${progress.agentName} was cancelled.`;
5246
5265
  headerColor = theme.status.warning;
5247
- } else if (progress.state === "error" /* ERROR */) {
5266
+ } else if (progress.state === SubagentState.ERROR) {
5248
5267
  headerText = `Subagent ${progress.agentName} failed.`;
5249
5268
  headerColor = theme.status.error;
5250
- } else if (progress.state === "completed" /* COMPLETED */) {
5269
+ } else if (progress.state === SubagentState.COMPLETED) {
5251
5270
  headerText = `Subagent ${progress.agentName} completed.`;
5252
5271
  headerColor = theme.status.success;
5253
5272
  } else {
@@ -5267,7 +5286,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5267
5286
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color, children: item.content }) })
5268
5287
  ] }, item.id);
5269
5288
  } else if (item.type === "tool_call") {
5270
- 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 });
5289
+ 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 });
5271
5290
  const formattedArgs = item.description || formatToolArgs(item.args);
5272
5291
  const displayArgs = formattedArgs.length > 60 ? formattedArgs.slice(0, 60) + "..." : formattedArgs;
5273
5292
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box_default, { flexDirection: "row", children: [
@@ -5278,7 +5297,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5278
5297
  {
5279
5298
  bold: true,
5280
5299
  color: theme.text.primary,
5281
- strikethrough: item.status === "cancelled" /* CANCELLED */,
5300
+ strikethrough: item.status === SubagentState.CANCELLED,
5282
5301
  children: item.displayName || item.content
5283
5302
  }
5284
5303
  ),
@@ -5287,7 +5306,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5287
5306
  {
5288
5307
  color: theme.text.secondary,
5289
5308
  wrap: "truncate",
5290
- strikethrough: item.status === "cancelled" /* CANCELLED */,
5309
+ strikethrough: item.status === SubagentState.CANCELLED,
5291
5310
  children: displayArgs
5292
5311
  }
5293
5312
  ) })
@@ -5307,7 +5326,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5307
5326
  MarkdownDisplay,
5308
5327
  {
5309
5328
  text: safeJsonToMarkdown(progress.result),
5310
- isPending: progress.state !== "completed" /* COMPLETED */,
5329
+ isPending: progress.state !== SubagentState.COMPLETED,
5311
5330
  terminalWidth
5312
5331
  }
5313
5332
  )
@@ -5661,14 +5680,14 @@ var ToolActionsProvider = (props) => {
5661
5680
  }
5662
5681
  const details = tool.confirmationDetails;
5663
5682
  if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
5664
- const cliOutcome = outcome === "cancel" /* Cancel */ ? "rejected" : "accepted";
5683
+ const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? "rejected" : "accepted";
5665
5684
  await ideClient?.resolveDiffFromCli(details.filePath, cliOutcome);
5666
5685
  }
5667
5686
  if (tool.correlationId) {
5668
5687
  await config.getMessageBus().publish({
5669
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
5688
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
5670
5689
  correlationId: tool.correlationId,
5671
- confirmed: outcome !== "cancel" /* Cancel */,
5690
+ confirmed: outcome !== ToolConfirmationOutcome.Cancel,
5672
5691
  requiresUserConfirmation: false,
5673
5692
  outcome,
5674
5693
  payload
@@ -5687,7 +5706,7 @@ var ToolActionsProvider = (props) => {
5687
5706
  );
5688
5707
  const cancel = (0, import_react12.useCallback)(
5689
5708
  async (callId) => {
5690
- await confirm(callId, "cancel" /* Cancel */);
5709
+ await confirm(callId, ToolConfirmationOutcome.Cancel);
5691
5710
  },
5692
5711
  [confirm]
5693
5712
  );
@@ -5806,7 +5825,7 @@ var ToolMessage = ({
5806
5825
  paddingX: 1,
5807
5826
  flexDirection: "column",
5808
5827
  children: [
5809
- status === "executing" /* Executing */ && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5828
+ status === CoreToolCallStatus.Executing && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5810
5829
  McpProgressIndicator,
5811
5830
  {
5812
5831
  progress,
@@ -5823,8 +5842,8 @@ var ToolMessage = ({
5823
5842
  terminalWidth,
5824
5843
  renderOutputAsMarkdown,
5825
5844
  hasFocus: isThisShellFocused2,
5826
- maxLines: kind === "agent" /* Agent */ && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
5827
- overflowDirection: kind === "agent" /* Agent */ ? "bottom" : "top"
5845
+ maxLines: kind === Kind.Agent && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
5846
+ overflowDirection: kind === Kind.Agent ? "bottom" : "top"
5828
5847
  }
5829
5848
  ),
5830
5849
  isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
@@ -6140,7 +6159,7 @@ function getInitialTrustState(settings, cwd5, isCurrentWorkspace) {
6140
6159
  settings.merged,
6141
6160
  process3.cwd()
6142
6161
  );
6143
- const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === "DO_NOT_TRUST" /* DO_NOT_TRUST */);
6162
+ const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === TrustLevel.DO_NOT_TRUST);
6144
6163
  return {
6145
6164
  currentTrustLevel: explicitTrustLevel,
6146
6165
  isInheritedTrustFromParent: !!(source === "file" && isInheritedTrust),
@@ -6185,7 +6204,7 @@ var usePermissionsModifyTrust = (onExit, addItem, targetDirectory) => {
6185
6204
  process3.cwd(),
6186
6205
  newConfig
6187
6206
  );
6188
- if (trustLevel === "DO_NOT_TRUST" /* DO_NOT_TRUST */ && isTrusted) {
6207
+ if (trustLevel === TrustLevel.DO_NOT_TRUST && isTrusted) {
6189
6208
  let message = "Note: This folder is still trusted because the connected IDE workspace is trusted.";
6190
6209
  if (source === "file") {
6191
6210
  message = "Note: This folder is still trusted because a parent folder is trusted.";
@@ -6259,18 +6278,18 @@ function PermissionsModifyTrustDialog({
6259
6278
  const TRUST_LEVEL_ITEMS = [
6260
6279
  {
6261
6280
  label: `Trust this folder (${dirName})`,
6262
- value: "TRUST_FOLDER" /* TRUST_FOLDER */,
6263
- key: "TRUST_FOLDER" /* TRUST_FOLDER */
6281
+ value: TrustLevel.TRUST_FOLDER,
6282
+ key: TrustLevel.TRUST_FOLDER
6264
6283
  },
6265
6284
  {
6266
6285
  label: `Trust parent folder (${parentFolder})`,
6267
- value: "TRUST_PARENT" /* TRUST_PARENT */,
6268
- key: "TRUST_PARENT" /* TRUST_PARENT */
6286
+ value: TrustLevel.TRUST_PARENT,
6287
+ key: TrustLevel.TRUST_PARENT
6269
6288
  },
6270
6289
  {
6271
6290
  label: "Don't trust",
6272
- value: "DO_NOT_TRUST" /* DO_NOT_TRUST */,
6273
- key: "DO_NOT_TRUST" /* DO_NOT_TRUST */
6291
+ value: TrustLevel.DO_NOT_TRUST,
6292
+ key: TrustLevel.DO_NOT_TRUST
6274
6293
  }
6275
6294
  ];
6276
6295
  const {
@@ -6510,7 +6529,7 @@ var ShellToolMessage = ({
6510
6529
  maxLinesLimit: maxLines
6511
6530
  });
6512
6531
  import_react17.default.useEffect(() => {
6513
- const isExecuting = status === "executing" /* Executing */;
6532
+ const isExecuting = status === CoreToolCallStatus.Executing;
6514
6533
  if (isExecuting && ptyId) {
6515
6534
  try {
6516
6535
  const childWidth = terminalWidth - 4;
@@ -6723,13 +6742,13 @@ var SubagentGroupDisplay = ({
6723
6742
  const singleAgent = toolCalls[0].resultDisplay;
6724
6743
  if (isSubagentProgress(singleAgent)) {
6725
6744
  switch (singleAgent.state) {
6726
- case "completed" /* COMPLETED */:
6745
+ case SubagentState.COMPLETED:
6727
6746
  headerText = "Agent Completed";
6728
6747
  break;
6729
- case "cancelled" /* CANCELLED */:
6748
+ case SubagentState.CANCELLED:
6730
6749
  headerText = "Agent Cancelled";
6731
6750
  break;
6732
- case "error" /* ERROR */:
6751
+ case SubagentState.ERROR:
6733
6752
  headerText = "Agent Error";
6734
6753
  break;
6735
6754
  default:
@@ -6745,8 +6764,8 @@ var SubagentGroupDisplay = ({
6745
6764
  for (const tc of toolCalls) {
6746
6765
  const progress = tc.resultDisplay;
6747
6766
  if (isSubagentProgress(progress)) {
6748
- if (progress.state === "completed" /* COMPLETED */) completedCount++;
6749
- else if (progress.state === "running" /* RUNNING */) runningCount++;
6767
+ if (progress.state === SubagentState.COMPLETED) completedCount++;
6768
+ else if (progress.state === SubagentState.RUNNING) runningCount++;
6750
6769
  } else {
6751
6770
  runningCount++;
6752
6771
  }
@@ -6825,7 +6844,7 @@ var SubagentGroupDisplay = ({
6825
6844
  if (!isExpanded) {
6826
6845
  let content = "Starting...";
6827
6846
  let formattedArgs;
6828
- if (progress.state === "completed" /* COMPLETED */) {
6847
+ if (progress.state === SubagentState.COMPLETED) {
6829
6848
  if (progress.terminateReason && progress.terminateReason !== "GOAL") {
6830
6849
  content = `Finished Early (${progress.terminateReason})`;
6831
6850
  } else {
@@ -6839,17 +6858,17 @@ var SubagentGroupDisplay = ({
6839
6858
  formattedArgs = formatToolArgs(lastActivity.args);
6840
6859
  }
6841
6860
  }
6842
- const displayArgs = progress.state === "completed" /* COMPLETED */ ? "" : formattedArgs;
6861
+ const displayArgs = progress.state === SubagentState.COMPLETED ? "" : formattedArgs;
6843
6862
  const renderStatusIcon = () => {
6844
- const state = progress.state ?? "running" /* RUNNING */;
6863
+ const state = progress.state ?? SubagentState.RUNNING;
6845
6864
  switch (state) {
6846
- case "running" /* RUNNING */:
6865
+ case SubagentState.RUNNING:
6847
6866
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.text.primary, children: "!" });
6848
- case "completed" /* COMPLETED */:
6867
+ case SubagentState.COMPLETED:
6849
6868
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.success, children: "\u2713" });
6850
- case "cancelled" /* CANCELLED */:
6869
+ case SubagentState.CANCELLED:
6851
6870
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.warning, children: "\u2139" });
6852
- case "error" /* ERROR */:
6871
+ case SubagentState.ERROR:
6853
6872
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.error, children: "\u2717" });
6854
6873
  default:
6855
6874
  return checkExhaustive(state);
@@ -6902,22 +6921,22 @@ var hasPayload = (res) => {
6902
6921
  function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerminalHeight, isClickable) {
6903
6922
  const added = (diff.diffStat?.model_added_lines ?? 0) + (diff.diffStat?.user_added_lines ?? 0);
6904
6923
  const removed = (diff.diffStat?.model_removed_lines ?? 0) + (diff.diffStat?.user_removed_lines ?? 0);
6905
- const isAcceptedOrConfirming = status === "success" /* Success */ || status === "executing" /* Executing */ || status === "awaiting_approval" /* AwaitingApproval */;
6924
+ const isAcceptedOrConfirming = status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing || status === CoreToolCallStatus.AwaitingApproval;
6906
6925
  const addColor = isAcceptedOrConfirming ? theme.status.success : theme.text.secondary;
6907
6926
  const removeColor = isAcceptedOrConfirming ? theme.status.error : theme.text.secondary;
6908
6927
  const showDiffStat = !!diff.diffStat;
6909
6928
  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 }) });
6910
6929
  let resultSummary = "";
6911
6930
  let resultColor = theme.text.secondary;
6912
- if (status === "awaiting_approval" /* AwaitingApproval */) {
6931
+ if (status === CoreToolCallStatus.AwaitingApproval) {
6913
6932
  resultSummary = "Confirming";
6914
- } else if (status === "success" /* Success */ || status === "executing" /* Executing */) {
6933
+ } else if (status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing) {
6915
6934
  resultSummary = "Accepted";
6916
6935
  resultColor = theme.text.accent;
6917
- } else if (status === "cancelled" /* Cancelled */) {
6936
+ } else if (status === CoreToolCallStatus.Cancelled) {
6918
6937
  resultSummary = "Rejected";
6919
6938
  resultColor = theme.status.error;
6920
- } else if (status === "error" /* Error */) {
6939
+ } else if (status === CoreToolCallStatus.Error) {
6921
6940
  resultSummary = typeof resultDisplay === "string" ? resultDisplay : "Failed";
6922
6941
  resultColor = theme.status.error;
6923
6942
  }
@@ -6948,7 +6967,7 @@ function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerm
6948
6967
  filename: diff.fileName,
6949
6968
  terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
6950
6969
  availableTerminalHeight,
6951
- disableColor: status === "cancelled" /* Cancelled */
6970
+ disableColor: status === CoreToolCallStatus.Cancelled
6952
6971
  }
6953
6972
  );
6954
6973
  return { description, summary, payload };
@@ -7076,10 +7095,10 @@ var DenseToolMessage = (props) => {
7076
7095
  if (isGrepResult(resultDisplay)) {
7077
7096
  return getGenericSuccessData(resultDisplay, originalDescription);
7078
7097
  }
7079
- if (status === "success" /* Success */ && resultDisplay) {
7098
+ if (status === CoreToolCallStatus.Success && resultDisplay) {
7080
7099
  return getGenericSuccessData(resultDisplay, originalDescription);
7081
7100
  }
7082
- if (status === "error" /* Error */) {
7101
+ if (status === CoreToolCallStatus.Error) {
7083
7102
  const text = typeof resultDisplay === "string" ? resultDisplay.replace(/\n/g, " ") : "Failed";
7084
7103
  const errorSummary = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: theme.status.error, wrap: "truncate-end", children: [
7085
7104
  "\u2192 ",
@@ -7120,7 +7139,7 @@ var DenseToolMessage = (props) => {
7120
7139
  language: fileExtension,
7121
7140
  maxWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
7122
7141
  settings,
7123
- disableColor: status === "cancelled" /* Cancelled */,
7142
+ disableColor: status === CoreToolCallStatus.Cancelled,
7124
7143
  returnLines: true
7125
7144
  });
7126
7145
  } else {
@@ -7128,7 +7147,7 @@ var DenseToolMessage = (props) => {
7128
7147
  parsedLines,
7129
7148
  filename: diff.fileName,
7130
7149
  terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
7131
- disableColor: status === "cancelled" /* Cancelled */
7150
+ disableColor: status === CoreToolCallStatus.Cancelled
7132
7151
  });
7133
7152
  }
7134
7153
  }, [diff, isExpanded, isAlternateBuffer, terminalWidth, settings, status]);
@@ -7258,7 +7277,7 @@ function isToolExecuting(pendingHistoryItems) {
7258
7277
  return pendingHistoryItems.some((item) => {
7259
7278
  if (item && item.type === "tool_group") {
7260
7279
  return item.tools.some(
7261
- (tool) => "executing" /* Executing */ === tool.status
7280
+ (tool) => CoreToolCallStatus.Executing === tool.status
7262
7281
  );
7263
7282
  }
7264
7283
  return false;
@@ -7267,7 +7286,7 @@ function isToolExecuting(pendingHistoryItems) {
7267
7286
  function isToolAwaitingConfirmation(pendingHistoryItems) {
7268
7287
  return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
7269
7288
  (item) => item.tools.some(
7270
- (tool) => "awaiting_approval" /* AwaitingApproval */ === tool.status
7289
+ (tool) => CoreToolCallStatus.AwaitingApproval === tool.status
7271
7290
  )
7272
7291
  );
7273
7292
  }
@@ -7290,14 +7309,14 @@ function getToolGroupBorderAppearance(item, activeShellPtyId, embeddedShellFocus
7290
7309
  if (isTrackedToolCall(t)) {
7291
7310
  return t.status !== "success" && t.status !== "error" && t.status !== "cancelled";
7292
7311
  } else {
7293
- return t.status !== "success" /* Success */ && t.status !== "error" /* Error */ && t.status !== "cancelled" /* Cancelled */;
7312
+ return t.status !== CoreToolCallStatus.Success && t.status !== CoreToolCallStatus.Error && t.status !== CoreToolCallStatus.Cancelled;
7294
7313
  }
7295
7314
  });
7296
7315
  const isEmbeddedShellFocused = toolsToInspect.some((t) => {
7297
7316
  if (isTrackedToolCall(t)) {
7298
7317
  return isShellTool(t.request.name) && t.status === "executing" && t.pid === activeShellPtyId && !!embeddedShellFocused;
7299
7318
  } else {
7300
- return isShellTool(t.name) && t.status === "executing" /* Executing */ && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
7319
+ return isShellTool(t.name) && t.status === CoreToolCallStatus.Executing && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
7301
7320
  }
7302
7321
  });
7303
7322
  const isShellCommand = toolsToInspect.some((t) => {
@@ -7396,7 +7415,7 @@ var ToolGroupMessage = ({
7396
7415
  const groupedTools = (0, import_react21.useMemo)(() => {
7397
7416
  const groups = [];
7398
7417
  for (const tool of visibleToolCalls) {
7399
- if (tool.kind === "agent" /* Agent */) {
7418
+ if (tool.kind === Kind.Agent) {
7400
7419
  const lastGroup = groups[groups.length - 1];
7401
7420
  if (Array.isArray(lastGroup)) {
7402
7421
  lastGroup.push(tool);
@@ -7451,7 +7470,7 @@ var ToolGroupMessage = ({
7451
7470
  }, [groupedTools, isCompactModeEnabled, borderTopOverride]);
7452
7471
  let countToolCallsWithResults = 0;
7453
7472
  for (const tool of visibleToolCalls) {
7454
- if (tool.kind !== "agent" /* Agent */) {
7473
+ if (tool.kind !== Kind.Agent) {
7455
7474
  if (isCompactTool(tool, isCompactModeEnabled)) {
7456
7475
  if (hasDensePayload(tool)) {
7457
7476
  countToolCallsWithResults++;
@@ -7625,7 +7644,7 @@ var ToolGroupDisplay = ({
7625
7644
  }
7626
7645
  const { tools, borderColor, borderDimColor, borderTop, borderBottom } = item;
7627
7646
  const visibleTools = tools.filter(
7628
- (t) => t.status !== "awaiting_approval" /* AwaitingApproval */
7647
+ (t) => t.status !== CoreToolCallStatus.AwaitingApproval
7629
7648
  );
7630
7649
  const noticeTools = visibleTools.filter((t) => t.format === "notice");
7631
7650
  const otherTools = visibleTools.filter(
@@ -7827,18 +7846,18 @@ function CompressionMessage({
7827
7846
  return "Compressing chat history";
7828
7847
  }
7829
7848
  switch (compressionStatus) {
7830
- case 1 /* COMPRESSED */:
7849
+ case CompressionStatus.COMPRESSED:
7831
7850
  return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
7832
- case 2 /* COMPRESSION_FAILED_INFLATED_TOKEN_COUNT */:
7851
+ case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
7833
7852
  if (originalTokens < 5e4) {
7834
7853
  return "Compression was not beneficial for this history size.";
7835
7854
  }
7836
7855
  return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
7837
- case 3 /* COMPRESSION_FAILED_TOKEN_COUNT_ERROR */:
7856
+ case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
7838
7857
  return "Could not compress chat history due to a token counting error.";
7839
- case 4 /* COMPRESSION_FAILED_EMPTY_SUMMARY */:
7858
+ case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
7840
7859
  return "Chat history compression failed: the model returned an empty summary.";
7841
- case 5 /* NOOP */:
7860
+ case CompressionStatus.NOOP:
7842
7861
  return "Nothing to compress.";
7843
7862
  default:
7844
7863
  return "";
@@ -8276,8 +8295,8 @@ var ModelUsageTable = ({ models }) => {
8276
8295
  );
8277
8296
  roleEntries.sort(([a], [b]) => {
8278
8297
  if (a === b) return 0;
8279
- if (a === "main" /* MAIN */) return -1;
8280
- if (b === "main" /* MAIN */) return 1;
8298
+ if (a === LlmRole.MAIN) return -1;
8299
+ if (b === LlmRole.MAIN) return 1;
8281
8300
  return a.localeCompare(b);
8282
8301
  });
8283
8302
  roleEntries.forEach(([role, roleMetrics]) => {
@@ -8608,8 +8627,8 @@ var ModelStatsDisplay = ({
8608
8627
  return validRoles.includes(role);
8609
8628
  }).sort((a, b) => {
8610
8629
  if (a === b) return 0;
8611
- if (a === "main" /* MAIN */) return -1;
8612
- if (b === "main" /* MAIN */) return 1;
8630
+ if (a === LlmRole.MAIN) return -1;
8631
+ if (b === LlmRole.MAIN) return 1;
8613
8632
  return a.localeCompare(b);
8614
8633
  });
8615
8634
  const createRow = (metric, getValue, options = {}) => {
@@ -9400,7 +9419,7 @@ var McpStatus = ({
9400
9419
  );
9401
9420
  const originalStatus = serverStatus(serverName);
9402
9421
  const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
9403
- const status = originalStatus === "disconnected" /* DISCONNECTED */ && hasCachedItems ? "connected" /* CONNECTED */ : originalStatus;
9422
+ const status = originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems ? MCPServerStatus.CONNECTED : originalStatus;
9404
9423
  let statusIndicator = "";
9405
9424
  let statusText = "";
9406
9425
  let statusColor = theme.text.primary;
@@ -9412,17 +9431,17 @@ var McpStatus = ({
9412
9431
  statusColor = theme.text.secondary;
9413
9432
  } else {
9414
9433
  switch (status) {
9415
- case "connected" /* CONNECTED */:
9434
+ case MCPServerStatus.CONNECTED:
9416
9435
  statusIndicator = "\u{1F7E2}";
9417
9436
  statusText = "Ready";
9418
9437
  statusColor = theme.status.success;
9419
9438
  break;
9420
- case "connecting" /* CONNECTING */:
9439
+ case MCPServerStatus.CONNECTING:
9421
9440
  statusIndicator = "\u{1F504}";
9422
9441
  statusText = "Starting... (first startup may take longer)";
9423
9442
  statusColor = theme.status.warning;
9424
9443
  break;
9425
- case "disconnected" /* DISCONNECTED */:
9444
+ case MCPServerStatus.DISCONNECTED:
9426
9445
  default:
9427
9446
  statusIndicator = "\u{1F534}";
9428
9447
  statusText = "Disconnected";
@@ -9470,12 +9489,12 @@ var McpStatus = ({
9470
9489
  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
9471
9490
  " - ",
9472
9491
  statusText,
9473
- status === "connected" /* CONNECTED */ && parts.length > 0 && ` (${parts.join(", ")})`
9492
+ status === MCPServerStatus.CONNECTED && parts.length > 0 && ` (${parts.join(", ")})`
9474
9493
  ] }),
9475
9494
  authStatusNode
9476
9495
  ] }),
9477
- status === "connecting" /* CONNECTING */ && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
9478
- status === "disconnected" /* DISCONNECTED */ && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
9496
+ status === MCPServerStatus.CONNECTING && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
9497
+ status === MCPServerStatus.DISCONNECTED && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
9479
9498
  " (",
9480
9499
  toolCount,
9481
9500
  " tools cached)"
@@ -10036,7 +10055,7 @@ var Notifications = () => {
10036
10055
  if (dismissed) return [];
10037
10056
  const counts = persistentState.get("startupWarningCounts") || {};
10038
10057
  return startupWarnings.filter((w) => {
10039
- if (w.priority === "low" /* Low */) {
10058
+ if (w.priority === WarningPriority.Low) {
10040
10059
  const count = counts[w.id] || 0;
10041
10060
  return count < MAX_STARTUP_WARNING_SHOW_COUNT;
10042
10061
  }
@@ -10049,7 +10068,7 @@ var Notifications = () => {
10049
10068
  const counts = { ...persistentState.get("startupWarningCounts") || {} };
10050
10069
  let changed = false;
10051
10070
  visibleWarnings.forEach((w) => {
10052
- if (w.priority === "low" /* Low */) {
10071
+ if (w.priority === WarningPriority.Low) {
10053
10072
  counts[w.id] = (counts[w.id] || 0) + 1;
10054
10073
  changed = true;
10055
10074
  }
@@ -10156,7 +10175,7 @@ var UserIdentity = ({ config }) => {
10156
10175
  }
10157
10176
  return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { flexDirection: "column", children: [
10158
10177
  /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { children: [
10159
- /* @__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: [
10178
+ /* @__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: [
10160
10179
  /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { bold: true, children: [
10161
10180
  "Signed in with Google",
10162
10181
  email ? ":" : ""
@@ -10399,7 +10418,7 @@ var import_react32 = __toESM(require_react(), 1);
10399
10418
  function getConfirmingToolState(pendingHistoryItems) {
10400
10419
  const allPendingTools = getAllToolCalls(pendingHistoryItems);
10401
10420
  const confirmingTools = allPendingTools.filter(
10402
- (tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
10421
+ (tool) => tool.status === CoreToolCallStatus.AwaitingApproval
10403
10422
  );
10404
10423
  if (confirmingTools.length === 0) {
10405
10424
  return null;
@@ -11707,7 +11726,7 @@ var ExitPlanModeDialog = ({
11707
11726
  {
11708
11727
  questions: [
11709
11728
  {
11710
- type: "choice" /* CHOICE */,
11729
+ type: QuestionType.CHOICE,
11711
11730
  header: "Approval",
11712
11731
  question: planContent,
11713
11732
  options: [
@@ -11728,9 +11747,9 @@ var ExitPlanModeDialog = ({
11728
11747
  onSubmit: (answers) => {
11729
11748
  const answer = answers["0"];
11730
11749
  if (answer === "Yes, automatically accept edits" /* Auto */) {
11731
- onApprove("autoEdit" /* AUTO_EDIT */);
11750
+ onApprove(ApprovalMode.AUTO_EDIT);
11732
11751
  } else if (answer === "Yes, manually accept edits" /* Manual */) {
11733
- onApprove("default" /* DEFAULT */);
11752
+ onApprove(ApprovalMode.DEFAULT);
11734
11753
  } else if (answer) {
11735
11754
  onFeedback(answer);
11736
11755
  }
@@ -11941,7 +11960,7 @@ ${deceptiveUrlWarnings.map(
11941
11960
  );
11942
11961
  (0, import_react37.useEffect)(() => {
11943
11962
  if (isCancelling) {
11944
- handleConfirm("cancel" /* Cancel */);
11963
+ handleConfirm(ToolConfirmationOutcome.Cancel);
11945
11964
  }
11946
11965
  }, [isCancelling, handleConfirm]);
11947
11966
  const handleSelect = (0, import_react37.useCallback)(
@@ -11954,19 +11973,19 @@ ${deceptiveUrlWarnings.map(
11954
11973
  if (!confirmationDetails.isModifying) {
11955
11974
  options2.push({
11956
11975
  label: "Allow once",
11957
- value: "proceed_once" /* ProceedOnce */,
11976
+ value: ToolConfirmationOutcome.ProceedOnce,
11958
11977
  key: "Allow once"
11959
11978
  });
11960
11979
  if (isTrustedFolder) {
11961
11980
  options2.push({
11962
11981
  label: "Allow for this session",
11963
- value: "proceed_always" /* ProceedAlways */,
11982
+ value: ToolConfirmationOutcome.ProceedAlways,
11964
11983
  key: "Allow for this session"
11965
11984
  });
11966
11985
  if (allowPermanentApproval) {
11967
11986
  options2.push({
11968
11987
  label: "Allow for this file in all future sessions",
11969
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
11988
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
11970
11989
  key: "Allow for this file in all future sessions"
11971
11990
  });
11972
11991
  }
@@ -11974,119 +11993,119 @@ ${deceptiveUrlWarnings.map(
11974
11993
  if (!config.getIdeMode() || !isDiffingEnabled) {
11975
11994
  options2.push({
11976
11995
  label: "Modify with external editor",
11977
- value: "modify_with_editor" /* ModifyWithEditor */,
11996
+ value: ToolConfirmationOutcome.ModifyWithEditor,
11978
11997
  key: "Modify with external editor"
11979
11998
  });
11980
11999
  }
11981
12000
  options2.push({
11982
12001
  label: "No, suggest changes (esc)",
11983
- value: "cancel" /* Cancel */,
12002
+ value: ToolConfirmationOutcome.Cancel,
11984
12003
  key: "No, suggest changes (esc)"
11985
12004
  });
11986
12005
  }
11987
12006
  } else if (confirmationDetails.type === "sandbox_expansion") {
11988
12007
  options2.push({
11989
12008
  label: "Allow once",
11990
- value: "proceed_once" /* ProceedOnce */,
12009
+ value: ToolConfirmationOutcome.ProceedOnce,
11991
12010
  key: "Allow once"
11992
12011
  });
11993
12012
  if (isTrustedFolder) {
11994
12013
  options2.push({
11995
12014
  label: "Allow for this session",
11996
- value: "proceed_always" /* ProceedAlways */,
12015
+ value: ToolConfirmationOutcome.ProceedAlways,
11997
12016
  key: "Allow for this session"
11998
12017
  });
11999
12018
  if (allowPermanentApproval) {
12000
12019
  options2.push({
12001
12020
  label: "Allow for all future sessions",
12002
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12021
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12003
12022
  key: "Allow for all future sessions"
12004
12023
  });
12005
12024
  }
12006
12025
  }
12007
12026
  options2.push({
12008
12027
  label: "No, suggest changes (esc)",
12009
- value: "cancel" /* Cancel */,
12028
+ value: ToolConfirmationOutcome.Cancel,
12010
12029
  key: "No, suggest changes (esc)"
12011
12030
  });
12012
12031
  } else if (confirmationDetails.type === "exec") {
12013
12032
  options2.push({
12014
12033
  label: "Allow once",
12015
- value: "proceed_once" /* ProceedOnce */,
12034
+ value: ToolConfirmationOutcome.ProceedOnce,
12016
12035
  key: "Allow once"
12017
12036
  });
12018
12037
  if (isTrustedFolder) {
12019
12038
  options2.push({
12020
12039
  label: `Allow for this session`,
12021
- value: "proceed_always" /* ProceedAlways */,
12040
+ value: ToolConfirmationOutcome.ProceedAlways,
12022
12041
  key: `Allow for this session`
12023
12042
  });
12024
12043
  if (allowPermanentApproval) {
12025
12044
  options2.push({
12026
12045
  label: `Allow this command for all future sessions`,
12027
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12046
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12028
12047
  key: `Allow for all future sessions`
12029
12048
  });
12030
12049
  }
12031
12050
  }
12032
12051
  options2.push({
12033
12052
  label: "No, suggest changes (esc)",
12034
- value: "cancel" /* Cancel */,
12053
+ value: ToolConfirmationOutcome.Cancel,
12035
12054
  key: "No, suggest changes (esc)"
12036
12055
  });
12037
12056
  } else if (confirmationDetails.type === "info") {
12038
12057
  options2.push({
12039
12058
  label: "Allow once",
12040
- value: "proceed_once" /* ProceedOnce */,
12059
+ value: ToolConfirmationOutcome.ProceedOnce,
12041
12060
  key: "Allow once"
12042
12061
  });
12043
12062
  if (isTrustedFolder) {
12044
12063
  options2.push({
12045
12064
  label: "Allow for this session",
12046
- value: "proceed_always" /* ProceedAlways */,
12065
+ value: ToolConfirmationOutcome.ProceedAlways,
12047
12066
  key: "Allow for this session"
12048
12067
  });
12049
12068
  if (allowPermanentApproval) {
12050
12069
  options2.push({
12051
12070
  label: "Allow for all future sessions",
12052
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12071
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12053
12072
  key: "Allow for all future sessions"
12054
12073
  });
12055
12074
  }
12056
12075
  }
12057
12076
  options2.push({
12058
12077
  label: "No, suggest changes (esc)",
12059
- value: "cancel" /* Cancel */,
12078
+ value: ToolConfirmationOutcome.Cancel,
12060
12079
  key: "No, suggest changes (esc)"
12061
12080
  });
12062
12081
  } else if (confirmationDetails.type === "mcp") {
12063
12082
  options2.push({
12064
12083
  label: "Allow once",
12065
- value: "proceed_once" /* ProceedOnce */,
12084
+ value: ToolConfirmationOutcome.ProceedOnce,
12066
12085
  key: "Allow once"
12067
12086
  });
12068
12087
  if (isTrustedFolder) {
12069
12088
  options2.push({
12070
12089
  label: "Allow tool for this session",
12071
- value: "proceed_always_tool" /* ProceedAlwaysTool */,
12090
+ value: ToolConfirmationOutcome.ProceedAlwaysTool,
12072
12091
  key: "Allow tool for this session"
12073
12092
  });
12074
12093
  options2.push({
12075
12094
  label: "Allow all server tools for this session",
12076
- value: "proceed_always_server" /* ProceedAlwaysServer */,
12095
+ value: ToolConfirmationOutcome.ProceedAlwaysServer,
12077
12096
  key: "Allow all server tools for this session"
12078
12097
  });
12079
12098
  if (allowPermanentApproval) {
12080
12099
  options2.push({
12081
12100
  label: "Allow tool for all future sessions",
12082
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12101
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12083
12102
  key: "Allow tool for all future sessions"
12084
12103
  });
12085
12104
  }
12086
12105
  }
12087
12106
  options2.push({
12088
12107
  label: "No, suggest changes (esc)",
12089
- value: "cancel" /* Cancel */,
12108
+ value: ToolConfirmationOutcome.Cancel,
12090
12109
  key: "No, suggest changes (esc)"
12091
12110
  });
12092
12111
  }
@@ -12125,7 +12144,7 @@ ${deceptiveUrlWarnings.map(
12125
12144
  const containsRedirection = commandsToDisplay.some(
12126
12145
  (cmd) => hasRedirection(cmd)
12127
12146
  );
12128
- const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
12147
+ const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
12129
12148
  if (containsRedirection && !isAutoEdit) {
12130
12149
  extraInfoLines = 1;
12131
12150
  }
@@ -12151,7 +12170,7 @@ ${deceptiveUrlWarnings.map(
12151
12170
  const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
12152
12171
  if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
12153
12172
  const alwaysAndSaveIndex = options2.findIndex(
12154
- (o) => o.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */
12173
+ (o) => o.value === ToolConfirmationOutcome.ProceedAlwaysAndSave
12155
12174
  );
12156
12175
  if (alwaysAndSaveIndex !== -1) {
12157
12176
  initialIndex2 = alwaysAndSaveIndex;
@@ -12168,10 +12187,10 @@ ${deceptiveUrlWarnings.map(
12168
12187
  {
12169
12188
  questions: confirmationDetails.questions,
12170
12189
  onSubmit: (answers) => {
12171
- handleConfirm("proceed_once" /* ProceedOnce */, { answers });
12190
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, { answers });
12172
12191
  },
12173
12192
  onCancel: () => {
12174
- handleConfirm("cancel" /* Cancel */);
12193
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12175
12194
  },
12176
12195
  width: terminalWidth,
12177
12196
  availableHeight: bodyHeight
@@ -12192,19 +12211,19 @@ ${deceptiveUrlWarnings.map(
12192
12211
  planPath: confirmationDetails.planPath,
12193
12212
  getPreferredEditor,
12194
12213
  onApprove: (approvalMode) => {
12195
- handleConfirm("proceed_once" /* ProceedOnce */, {
12214
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
12196
12215
  approved: true,
12197
12216
  approvalMode
12198
12217
  });
12199
12218
  },
12200
12219
  onFeedback: (feedback) => {
12201
- handleConfirm("proceed_once" /* ProceedOnce */, {
12220
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
12202
12221
  approved: false,
12203
12222
  feedback
12204
12223
  });
12205
12224
  },
12206
12225
  onCancel: () => {
12207
- handleConfirm("cancel" /* Cancel */);
12226
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12208
12227
  },
12209
12228
  width: terminalWidth,
12210
12229
  availableHeight: bodyHeight
@@ -12313,7 +12332,7 @@ ${deceptiveUrlWarnings.map(
12313
12332
  const containsRedirection = commandsToDisplay.some(
12314
12333
  (cmd) => hasRedirection(cmd)
12315
12334
  );
12316
- const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
12335
+ const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
12317
12336
  let warnings = null;
12318
12337
  if (containsRedirection && !isAutoEdit) {
12319
12338
  const tipText = `To auto-accept, press ${formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */)}`;
@@ -12472,7 +12491,7 @@ ${deceptiveUrlWarnings.map(
12472
12491
  const bodyOverflowDirection = confirmationDetails.type === "mcp" && isMcpToolDetailsExpanded ? "bottom" : "top";
12473
12492
  const renderRadioItem = (0, import_react37.useCallback)(
12474
12493
  (item, { titleColor }) => {
12475
- if (item.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */) {
12494
+ if (item.value === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
12476
12495
  return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(Text, { color: titleColor, wrap: "truncate", children: [
12477
12496
  item.label,
12478
12497
  " ",
@@ -14502,7 +14521,7 @@ async function validateAuthMethodWithSettings(authType, settings) {
14502
14521
  if (settings.merged.security.auth.useExternal) {
14503
14522
  return null;
14504
14523
  }
14505
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14524
+ if (authType === AuthType.USE_GEMINI) {
14506
14525
  return null;
14507
14526
  }
14508
14527
  return validateAuthMethod(authType);
@@ -14554,7 +14573,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
14554
14573
  }
14555
14574
  return;
14556
14575
  }
14557
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14576
+ if (authType === AuthType.USE_GEMINI) {
14558
14577
  const key = await reloadApiKey();
14559
14578
  if (!key) {
14560
14579
  setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
@@ -14632,31 +14651,31 @@ function AuthDialog({
14632
14651
  let items = [
14633
14652
  {
14634
14653
  label: "Sign in with Google",
14635
- value: "oauth-personal" /* LOGIN_WITH_GOOGLE */,
14636
- key: "oauth-personal" /* LOGIN_WITH_GOOGLE */
14654
+ value: AuthType.LOGIN_WITH_GOOGLE,
14655
+ key: AuthType.LOGIN_WITH_GOOGLE
14637
14656
  },
14638
14657
  ...process.env["CLOUD_SHELL"] === "true" ? [
14639
14658
  {
14640
14659
  label: "Use Cloud Shell user credentials",
14641
- value: "compute-default-credentials" /* COMPUTE_ADC */,
14642
- key: "compute-default-credentials" /* COMPUTE_ADC */
14660
+ value: AuthType.COMPUTE_ADC,
14661
+ key: AuthType.COMPUTE_ADC
14643
14662
  }
14644
14663
  ] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
14645
14664
  {
14646
14665
  label: "Use metadata server application default credentials",
14647
- value: "compute-default-credentials" /* COMPUTE_ADC */,
14648
- key: "compute-default-credentials" /* COMPUTE_ADC */
14666
+ value: AuthType.COMPUTE_ADC,
14667
+ key: AuthType.COMPUTE_ADC
14649
14668
  }
14650
14669
  ] : [],
14651
14670
  {
14652
14671
  label: "Use Gemini API Key",
14653
- value: "gemini-api-key" /* USE_GEMINI */,
14654
- key: "gemini-api-key" /* USE_GEMINI */
14672
+ value: AuthType.USE_GEMINI,
14673
+ key: AuthType.USE_GEMINI
14655
14674
  },
14656
14675
  {
14657
14676
  label: "Vertex AI",
14658
- value: "vertex-ai" /* USE_VERTEX_AI */,
14659
- key: "vertex-ai" /* USE_VERTEX_AI */
14677
+ value: AuthType.USE_VERTEX_AI,
14678
+ key: AuthType.USE_VERTEX_AI
14660
14679
  }
14661
14680
  ];
14662
14681
  if (settings.merged.security.auth.enforcedType) {
@@ -14678,9 +14697,9 @@ function AuthDialog({
14678
14697
  return item.value === defaultAuthType;
14679
14698
  }
14680
14699
  if (process.env["GEMINI_API_KEY"]) {
14681
- return item.value === "gemini-api-key" /* USE_GEMINI */;
14700
+ return item.value === AuthType.USE_GEMINI;
14682
14701
  }
14683
- return item.value === "oauth-personal" /* LOGIN_WITH_GOOGLE */;
14702
+ return item.value === AuthType.LOGIN_WITH_GOOGLE;
14684
14703
  });
14685
14704
  if (settings.merged.security.auth.enforcedType) {
14686
14705
  initialAuthIndex = 0;
@@ -14691,7 +14710,7 @@ function AuthDialog({
14691
14710
  return;
14692
14711
  }
14693
14712
  if (authType) {
14694
- const needsRestart = authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ || authType === "vertex-ai" /* USE_VERTEX_AI */ && process.env["CLOUD_SHELL"] === "true";
14713
+ const needsRestart = authType === AuthType.LOGIN_WITH_GOOGLE || authType === AuthType.USE_VERTEX_AI && process.env["CLOUD_SHELL"] === "true";
14695
14714
  if (needsRestart) {
14696
14715
  setAuthContext({ requiresRestart: true });
14697
14716
  } else {
@@ -14699,12 +14718,12 @@ function AuthDialog({
14699
14718
  }
14700
14719
  await clearCachedCredentialFile();
14701
14720
  settings.setValue(scope, "security.auth.selectedType", authType);
14702
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
14721
+ if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
14703
14722
  setExiting(true);
14704
14723
  setTimeout(relaunchApp, 100);
14705
14724
  return;
14706
14725
  }
14707
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14726
+ if (authType === AuthType.USE_GEMINI) {
14708
14727
  setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
14709
14728
  return;
14710
14729
  }
@@ -15500,11 +15519,11 @@ var PrivacyNoticeText = ({
15500
15519
  }) => {
15501
15520
  const authType = config.getContentGeneratorConfig()?.authType;
15502
15521
  switch (authType) {
15503
- case "gemini-api-key" /* USE_GEMINI */:
15522
+ case AuthType.USE_GEMINI:
15504
15523
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GeminiPrivacyNotice, { onExit });
15505
- case "vertex-ai" /* USE_VERTEX_AI */:
15524
+ case AuthType.USE_VERTEX_AI:
15506
15525
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudPaidPrivacyNotice, { onExit });
15507
- case "oauth-personal" /* LOGIN_WITH_GOOGLE */:
15526
+ case AuthType.LOGIN_WITH_GOOGLE:
15508
15527
  default:
15509
15528
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudFreePrivacyNotice, { config, onExit });
15510
15529
  }
@@ -15519,6 +15538,7 @@ function ProQuotaDialog({
15519
15538
  message,
15520
15539
  isTerminalQuotaError,
15521
15540
  isModelNotFoundError,
15541
+ isCapacityExceeded,
15522
15542
  authType,
15523
15543
  tierName,
15524
15544
  onChoice
@@ -15537,6 +15557,24 @@ function ProQuotaDialog({
15537
15557
  key: "retry_later"
15538
15558
  }
15539
15559
  ];
15560
+ } else if (isCapacityExceeded) {
15561
+ items = [
15562
+ {
15563
+ label: "Keep trying",
15564
+ value: "retry_once",
15565
+ key: "retry_once"
15566
+ },
15567
+ {
15568
+ label: `Switch to ${fallbackModel}`,
15569
+ value: "retry_always",
15570
+ key: "retry_always"
15571
+ },
15572
+ {
15573
+ label: "Stop",
15574
+ value: "retry_later",
15575
+ key: "retry_later"
15576
+ }
15577
+ ];
15540
15578
  } else if (isModelNotFoundError || isTerminalQuotaError) {
15541
15579
  const isUltra = isUltraTier(tierName);
15542
15580
  items = [
@@ -15545,7 +15583,7 @@ function ProQuotaDialog({
15545
15583
  value: "retry_always",
15546
15584
  key: "retry_always"
15547
15585
  },
15548
- ...authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && !isUltra ? [
15586
+ ...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
15549
15587
  {
15550
15588
  label: "Upgrade for higher limits",
15551
15589
  value: "upgrade",
@@ -16704,7 +16742,7 @@ function ModelDialog({ onClose }) {
16704
16742
  const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
16705
16743
  const useGemini3_5Flash = config?.hasGemini35FlashGAAccess?.() ?? false;
16706
16744
  const selectedAuthType = settings.merged.security.auth.selectedType;
16707
- const useCustomToolModel = useGemini31 && selectedAuthType === "gemini-api-key" /* USE_GEMINI */;
16745
+ const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
16708
16746
  const manualModelSelected = (0, import_react55.useMemo)(() => {
16709
16747
  if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
16710
16748
  const def = config.getModelConfigService().getModelDefinition(preferredModel);
@@ -17675,6 +17713,7 @@ var DialogManager = ({
17675
17713
  message: quotaState.proQuotaRequest.message,
17676
17714
  isTerminalQuotaError: quotaState.proQuotaRequest.isTerminalQuotaError,
17677
17715
  isModelNotFoundError: !!quotaState.proQuotaRequest.isModelNotFoundError,
17716
+ isCapacityExceeded: !!quotaState.proQuotaRequest.isCapacityExceeded,
17678
17717
  authType: quotaState.proQuotaRequest.authType,
17679
17718
  tierName: config?.getUserTierName(),
17680
17719
  onChoice: uiActions.handleProQuotaChoice
@@ -18027,10 +18066,10 @@ function initializeConsoleStore() {
18027
18066
  globalConsoleMessages = [];
18028
18067
  globalErrorCount = 0;
18029
18068
  notifyListeners();
18030
- coreEvents.off("console-log" /* ConsoleLog */, handleConsoleLog);
18031
- coreEvents.off("output" /* Output */, handleOutput);
18032
- coreEvents.on("console-log" /* ConsoleLog */, handleConsoleLog);
18033
- coreEvents.on("output" /* Output */, handleOutput);
18069
+ coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
18070
+ coreEvents.off(CoreEvent.Output, handleOutput);
18071
+ coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
18072
+ coreEvents.on(CoreEvent.Output, handleOutput);
18034
18073
  }
18035
18074
  function notifyListeners() {
18036
18075
  for (const listener of listeners) {
@@ -20167,7 +20206,7 @@ function usePromptCompletion({
20167
20206
  { model: "prompt-completion" },
20168
20207
  contents,
20169
20208
  signal,
20170
- "utility_autocomplete" /* UTILITY_AUTOCOMPLETE */
20209
+ LlmRole.UTILITY_AUTOCOMPLETE
20171
20210
  );
20172
20211
  if (signal.aborted) {
20173
20212
  return;
@@ -22245,9 +22284,9 @@ var InputPrompt = ({
22245
22284
  onSuggestionsVisibilityChange(shouldShowSuggestions);
22246
22285
  }
22247
22286
  }, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
22248
- const showAutoAcceptStyling = !shellModeActive && approvalMode === "autoEdit" /* AUTO_EDIT */;
22249
- const showYoloStyling = !shellModeActive && approvalMode === "yolo" /* YOLO */;
22250
- const showPlanStyling = !shellModeActive && approvalMode === "plan" /* PLAN */;
22287
+ const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
22288
+ const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
22289
+ const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
22251
22290
  let statusColor;
22252
22291
  let statusText = "";
22253
22292
  if (shellModeActive) {
@@ -23080,22 +23119,22 @@ var ApprovalModeIndicator = ({
23080
23119
  const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
23081
23120
  const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
23082
23121
  switch (approvalMode) {
23083
- case "autoEdit" /* AUTO_EDIT */:
23122
+ case ApprovalMode.AUTO_EDIT:
23084
23123
  textColor = theme.status.warning;
23085
23124
  textContent = "auto-accept edits";
23086
23125
  subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
23087
23126
  break;
23088
- case "plan" /* PLAN */:
23127
+ case ApprovalMode.PLAN:
23089
23128
  textColor = theme.status.success;
23090
23129
  textContent = "plan";
23091
23130
  subText = `${cycleHint} to manual`;
23092
23131
  break;
23093
- case "yolo" /* YOLO */:
23132
+ case ApprovalMode.YOLO:
23094
23133
  textColor = theme.status.error;
23095
23134
  textContent = "YOLO";
23096
23135
  subText = yoloHint;
23097
23136
  break;
23098
- case "default" /* DEFAULT */:
23137
+ case ApprovalMode.DEFAULT:
23099
23138
  default:
23100
23139
  textColor = theme.text.accent;
23101
23140
  textContent = "";
@@ -23143,7 +23182,7 @@ var useComposerStatus = () => {
23143
23182
  (item) => item.type === "tool_group"
23144
23183
  ).some(
23145
23184
  (item) => item.tools.some(
23146
- (tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
23185
+ (tool) => tool.status === CoreToolCallStatus.AwaitingApproval
23147
23186
  )
23148
23187
  ),
23149
23188
  [uiState.pendingHistoryItems]
@@ -23158,13 +23197,13 @@ var useComposerStatus = () => {
23158
23197
  const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
23159
23198
  if (hideMinimalModeHintWhileBusy) return null;
23160
23199
  switch (showApprovalModeIndicator) {
23161
- case "yolo" /* YOLO */:
23200
+ case ApprovalMode.YOLO:
23162
23201
  return { text: "YOLO", color: theme.status.error };
23163
- case "plan" /* PLAN */:
23202
+ case ApprovalMode.PLAN:
23164
23203
  return { text: "plan", color: theme.status.success };
23165
- case "autoEdit" /* AUTO_EDIT */:
23204
+ case ApprovalMode.AUTO_EDIT:
23166
23205
  return { text: "auto edit", color: theme.status.warning };
23167
- case "default" /* DEFAULT */:
23206
+ case ApprovalMode.DEFAULT:
23168
23207
  default:
23169
23208
  return null;
23170
23209
  }
@@ -23518,7 +23557,7 @@ var ConfigInitDisplay = ({
23518
23557
  let connected = 0;
23519
23558
  const connecting = [];
23520
23559
  for (const [name, client] of clients.entries()) {
23521
- if (client.getStatus() === "connected" /* CONNECTED */) {
23560
+ if (client.getStatus() === MCPServerStatus.CONNECTED) {
23522
23561
  connected++;
23523
23562
  } else {
23524
23563
  connecting.push(name);
@@ -23540,9 +23579,9 @@ var ConfigInitDisplay = ({
23540
23579
  );
23541
23580
  }
23542
23581
  };
23543
- coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
23582
+ coreEvents.on(CoreEvent.McpClientUpdate, onChange);
23544
23583
  return () => {
23545
- coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
23584
+ coreEvents.off(CoreEvent.McpClientUpdate, onChange);
23546
23585
  };
23547
23586
  }, [initialMessage]);
23548
23587
  return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Text, { children: [
@@ -24259,7 +24298,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
24259
24298
  callId,
24260
24299
  name: SHELL_COMMAND_NAME,
24261
24300
  description: rawQuery,
24262
- status: "executing" /* Executing */,
24301
+ status: CoreToolCallStatus.Executing,
24263
24302
  isClientInitiated: true,
24264
24303
  resultDisplay: "",
24265
24304
  confirmationDetails: void 0
@@ -24400,7 +24439,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
24400
24439
  mainContent = result.output.trim() || "(Command produced no output)";
24401
24440
  }
24402
24441
  let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
24403
- let finalStatus = "success" /* Success */;
24442
+ let finalStatus = CoreToolCallStatus.Success;
24404
24443
  const prependToAnsiOutput = (output, text) => {
24405
24444
  const newLines = text.split("\n").map((line) => [
24406
24445
  {
@@ -24419,20 +24458,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
24419
24458
  };
24420
24459
  let prefix = "";
24421
24460
  if (result.error) {
24422
- finalStatus = "error" /* Error */;
24461
+ finalStatus = CoreToolCallStatus.Error;
24423
24462
  prefix = result.error.message;
24424
24463
  } else if (result.aborted) {
24425
- finalStatus = "cancelled" /* Cancelled */;
24464
+ finalStatus = CoreToolCallStatus.Cancelled;
24426
24465
  prefix = "Command was cancelled.";
24427
24466
  } else if (result.backgrounded) {
24428
- finalStatus = "success" /* Success */;
24467
+ finalStatus = CoreToolCallStatus.Success;
24429
24468
  finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
24430
24469
  mainContent = finalOutput;
24431
24470
  } else if (result.signal) {
24432
- finalStatus = "error" /* Error */;
24471
+ finalStatus = CoreToolCallStatus.Error;
24433
24472
  prefix = `Command terminated by signal: ${result.signal}.`;
24434
24473
  } else if (result.exitCode !== 0) {
24435
- finalStatus = "error" /* Error */;
24474
+ finalStatus = CoreToolCallStatus.Error;
24436
24475
  prefix = `Command exited with code ${result.exitCode}.`;
24437
24476
  }
24438
24477
  if (prefix) {
@@ -24458,7 +24497,7 @@ ${mainContent}`;
24458
24497
  status: finalStatus,
24459
24498
  resultDisplay: finalOutput
24460
24499
  };
24461
- if (finalStatus !== "cancelled" /* Cancelled */) {
24500
+ if (finalStatus !== CoreToolCallStatus.Cancelled) {
24462
24501
  addItemToHistory(
24463
24502
  {
24464
24503
  type: "tool_group",
@@ -25398,6 +25437,7 @@ async function openG1Url(path14, campaign) {
25398
25437
  }
25399
25438
 
25400
25439
  // packages/cli/src/ui/hooks/useQuotaAndFallback.ts
25440
+ var isObject = (val) => typeof val === "object" && val !== null;
25401
25441
  function useQuotaAndFallback({
25402
25442
  config,
25403
25443
  historyManager,
@@ -25420,6 +25460,16 @@ function useQuotaAndFallback({
25420
25460
  let message;
25421
25461
  let isTerminalQuotaError = false;
25422
25462
  let isModelNotFoundError = false;
25463
+ const errorObj = isObject(error) ? error : null;
25464
+ const errorReasonValue = errorObj?.["reason"];
25465
+ const errorReason = typeof errorReasonValue === "string" ? errorReasonValue : void 0;
25466
+ const errorMessageValue = errorObj?.["message"];
25467
+ const errorMessage = typeof errorMessageValue === "string" ? errorMessageValue : void 0;
25468
+ const isCapacityExceeded = errorReason === "MODEL_CAPACITY_EXHAUSTED" || errorReason === "MODEL_CAPACITY_EXCEEDED" || typeof errorMessage === "string" && /exhausted your capacity|capacity exceeded|MODEL_CAPACITY_EXHAUSTED/i.test(
25469
+ errorMessage
25470
+ ) || typeof error === "string" && /exhausted your capacity|capacity exceeded|MODEL_CAPACITY_EXHAUSTED/i.test(
25471
+ error
25472
+ );
25423
25473
  const usageLimitReachedModel = isProModel(failedModel) ? "all Pro models" : failedModel;
25424
25474
  if (error instanceof TerminalQuotaError) {
25425
25475
  isTerminalQuotaError = true;
@@ -25443,17 +25493,27 @@ function useQuotaAndFallback({
25443
25493
  });
25444
25494
  if (creditsResult) return creditsResult;
25445
25495
  }
25446
- const messageLines = [
25447
- `Usage limit reached for ${usageLimitReachedModel}.`,
25448
- error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
25449
- `/stats model for usage details`,
25450
- `/model to switch models.`,
25451
- contentGeneratorConfig?.authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? `/auth to switch to API key.` : null
25452
- ].filter(Boolean);
25453
- message = messageLines.join("\n");
25496
+ if (isCapacityExceeded) {
25497
+ const messageLines = [
25498
+ `We are currently experiencing high demand for ${usageLimitReachedModel}.`,
25499
+ "We apologize and appreciate your patience.",
25500
+ error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
25501
+ `/model to switch models.`
25502
+ ].filter(Boolean);
25503
+ message = messageLines.join("\n");
25504
+ } else {
25505
+ const messageLines = [
25506
+ `Usage limit reached for ${usageLimitReachedModel}.`,
25507
+ error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
25508
+ `/stats model for usage details`,
25509
+ `/model to switch models.`,
25510
+ contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
25511
+ ].filter(Boolean);
25512
+ message = messageLines.join("\n");
25513
+ }
25454
25514
  } else if (error instanceof ModelNotFoundError) {
25455
25515
  isModelNotFoundError = true;
25456
- if (contentGeneratorConfig?.authType === "vertex-ai" /* USE_VERTEX_AI */ && VALID_GEMINI_MODELS.has(failedModel)) {
25516
+ if (contentGeneratorConfig?.authType === AuthType.USE_VERTEX_AI && VALID_GEMINI_MODELS.has(failedModel)) {
25457
25517
  const location = process.env["GOOGLE_CLOUD_LOCATION"] || "your configured region";
25458
25518
  const messageLines = [
25459
25519
  `Model "${failedModel}" is not available in region "${location}".`,
@@ -25483,7 +25543,7 @@ function useQuotaAndFallback({
25483
25543
  ];
25484
25544
  message = messageLines.join("\n");
25485
25545
  }
25486
- if (errorVerbosity === "low" && !isTerminalQuotaError && !isModelNotFoundError) {
25546
+ if (errorVerbosity === "low" && (!isTerminalQuotaError || isCapacityExceeded) && !isModelNotFoundError) {
25487
25547
  return "retry_once";
25488
25548
  }
25489
25549
  setModelSwitchedFromQuotaError(true);
@@ -25501,6 +25561,7 @@ function useQuotaAndFallback({
25501
25561
  message,
25502
25562
  isTerminalQuotaError,
25503
25563
  isModelNotFoundError,
25564
+ isCapacityExceeded,
25504
25565
  authType: contentGeneratorConfig?.authType
25505
25566
  });
25506
25567
  }
@@ -25645,7 +25706,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
25645
25706
  );
25646
25707
  setEditorError(null);
25647
25708
  setIsEditorDialogOpen(false);
25648
- coreEvents.emit("editor-selected" /* EditorSelected */, { editor: editorType });
25709
+ coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
25649
25710
  } catch (error) {
25650
25711
  setEditorError(`Failed to set editor preference: ${error}`);
25651
25712
  }
@@ -25654,7 +25715,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
25654
25715
  );
25655
25716
  const exitEditorDialog = (0, import_react91.useCallback)(() => {
25656
25717
  setIsEditorDialogOpen(false);
25657
- coreEvents.emit("editor-selected" /* EditorSelected */, { editor: void 0 });
25718
+ coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
25658
25719
  }, []);
25659
25720
  return {
25660
25721
  isEditorDialogOpen,
@@ -26031,7 +26092,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26031
26092
  canonicalPath: resolvedCommandPath
26032
26093
  } = parseSlashCommand(trimmed, commands);
26033
26094
  if (!commandToExecute) {
26034
- const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === "in_progress" /* IN_PROGRESS */;
26095
+ const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
26035
26096
  if (isMcpLoading) {
26036
26097
  setIsProcessing(true);
26037
26098
  if (addToHistory) {
@@ -26211,7 +26272,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26211
26272
  onConfirm: async (resolvedOutcome) => {
26212
26273
  resolve3({
26213
26274
  outcome: resolvedOutcome,
26214
- approvedCommands: resolvedOutcome === "cancel" /* Cancel */ ? [] : result.commandsToConfirm
26275
+ approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
26215
26276
  });
26216
26277
  }
26217
26278
  };
@@ -26219,7 +26280,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26219
26280
  callId,
26220
26281
  name: "Expansion",
26221
26282
  description: "Command expansion needs shell access",
26222
- status: "awaiting_approval" /* AwaitingApproval */,
26283
+ status: CoreToolCallStatus.AwaitingApproval,
26223
26284
  isClientInitiated: true,
26224
26285
  resultDisplay: void 0,
26225
26286
  confirmationDetails
@@ -26230,7 +26291,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26230
26291
  });
26231
26292
  });
26232
26293
  setPendingItem(null);
26233
- if (outcome === "cancel" /* Cancel */ || !approvedCommands || approvedCommands.length === 0) {
26294
+ if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
26234
26295
  addItem(
26235
26296
  {
26236
26297
  type: "info" /* INFO */,
@@ -26240,7 +26301,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26240
26301
  );
26241
26302
  return { type: "handled" };
26242
26303
  }
26243
- if (outcome === "proceed_always" /* ProceedAlways */) {
26304
+ if (outcome === ToolConfirmationOutcome.ProceedAlways) {
26244
26305
  setSessionShellAllowlist(
26245
26306
  (prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
26246
26307
  );
@@ -26716,7 +26777,7 @@ function mapToDisplay(toolOrTools, options = {}) {
26716
26777
  let description;
26717
26778
  let renderOutputAsMarkdown = false;
26718
26779
  const displayName = call.tool?.displayName ?? call.request.name;
26719
- if (call.status === "error" /* Error */) {
26780
+ if (call.status === CoreToolCallStatus.Error) {
26720
26781
  description = JSON.stringify(call.request.args);
26721
26782
  } else {
26722
26783
  description = call.invocation.getDescription();
@@ -26739,27 +26800,27 @@ function mapToDisplay(toolOrTools, options = {}) {
26739
26800
  let progress = void 0;
26740
26801
  let progressTotal = void 0;
26741
26802
  switch (call.status) {
26742
- case "success" /* Success */:
26803
+ case CoreToolCallStatus.Success:
26743
26804
  resultDisplay = call.response.resultDisplay;
26744
26805
  outputFile = call.response.outputFile;
26745
26806
  break;
26746
- case "error" /* Error */:
26747
- case "cancelled" /* Cancelled */:
26807
+ case CoreToolCallStatus.Error:
26808
+ case CoreToolCallStatus.Cancelled:
26748
26809
  resultDisplay = call.response.resultDisplay;
26749
26810
  break;
26750
- case "awaiting_approval" /* AwaitingApproval */:
26811
+ case CoreToolCallStatus.AwaitingApproval:
26751
26812
  correlationId = call.correlationId;
26752
26813
  confirmationDetails = call.confirmationDetails;
26753
26814
  break;
26754
- case "executing" /* Executing */:
26815
+ case CoreToolCallStatus.Executing:
26755
26816
  resultDisplay = call.liveOutput;
26756
26817
  ptyId = call.pid;
26757
26818
  progressMessage = call.progressMessage;
26758
26819
  progress = call.progress;
26759
26820
  progressTotal = call.progressTotal;
26760
26821
  break;
26761
- case "scheduled" /* Scheduled */:
26762
- case "validating" /* Validating */:
26822
+ case CoreToolCallStatus.Scheduled:
26823
+ case CoreToolCallStatus.Validating:
26763
26824
  break;
26764
26825
  default: {
26765
26826
  const exhaustiveCheck = call;
@@ -26830,7 +26891,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26830
26891
  const handler = (event) => {
26831
26892
  const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
26832
26893
  const hasExecuting = event.toolCalls.some(
26833
- (tc) => tc.status === "executing" /* Executing */ || (tc.status === "success" /* Success */ || tc.status === "error" /* Error */) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
26894
+ (tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
26834
26895
  );
26835
26896
  if (hasExecuting) {
26836
26897
  setLastToolOutputTime(Date.now());
@@ -26839,7 +26900,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26839
26900
  const prevCalls = prev[event.schedulerId] ?? [];
26840
26901
  const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
26841
26902
  const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
26842
- (tc) => tc.status === "awaiting_approval" /* AwaitingApproval */ || prevCallIds.has(tc.request.callId)
26903
+ (tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
26843
26904
  );
26844
26905
  if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
26845
26906
  return prev;
@@ -26851,9 +26912,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26851
26912
  };
26852
26913
  });
26853
26914
  };
26854
- messageBus.subscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
26915
+ messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
26855
26916
  return () => {
26856
- messageBus.unsubscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
26917
+ messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
26857
26918
  };
26858
26919
  }, [messageBus, internalAdaptToolCalls]);
26859
26920
  (0, import_react98.useEffect)(() => {
@@ -26875,9 +26936,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26875
26936
  };
26876
26937
  });
26877
26938
  };
26878
- messageBus.subscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
26939
+ messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
26879
26940
  return () => {
26880
- messageBus.unsubscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
26941
+ messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
26881
26942
  };
26882
26943
  }, [messageBus]);
26883
26944
  const schedule = (0, import_react98.useCallback)(
@@ -26976,8 +27037,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
26976
27037
  const prev = prevMap.get(coreCall.request.callId);
26977
27038
  const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
26978
27039
  let status = coreCall.status;
26979
- if ((status === "success" /* Success */ || status === "error" /* Error */) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
26980
- status = "executing" /* Executing */;
27040
+ if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
27041
+ status = CoreToolCallStatus.Executing;
26981
27042
  }
26982
27043
  return {
26983
27044
  ...coreCall,
@@ -27009,7 +27070,7 @@ function getBackgroundedToolInfo(toolCall) {
27009
27070
  };
27010
27071
  }
27011
27072
  function isBackgroundableExecutingToolCall(toolCall) {
27012
- return toolCall.status === "executing" /* Executing */ && typeof toolCall.pid === "number";
27073
+ return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
27013
27074
  }
27014
27075
  function showCitations(settings) {
27015
27076
  const enabled = settings.merged.ui.showCitations;
@@ -27019,14 +27080,14 @@ function showCitations(settings) {
27019
27080
  return true;
27020
27081
  }
27021
27082
  function calculateStreamingState(isResponding, toolCalls) {
27022
- if (toolCalls.some((tc) => tc.status === "awaiting_approval" /* AwaitingApproval */)) {
27083
+ if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
27023
27084
  return "waiting_for_confirmation" /* WaitingForConfirmation */;
27024
27085
  }
27025
27086
  const isAnyToolActive = toolCalls.some((tc) => {
27026
- if (tc.status === "executing" /* Executing */ || tc.status === "scheduled" /* Scheduled */ || tc.status === "validating" /* Validating */) {
27087
+ if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
27027
27088
  return true;
27028
27089
  }
27029
- if (tc.status === "success" /* Success */ || tc.status === "error" /* Error */ || tc.status === "cancelled" /* Cancelled */) {
27090
+ if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
27030
27091
  return !tc.responseSubmittedToGemini;
27031
27092
  }
27032
27093
  return false;
@@ -27072,9 +27133,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27072
27133
  }
27073
27134
  setRetryStatus(payload);
27074
27135
  };
27075
- coreEvents.on("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
27136
+ coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
27076
27137
  return () => {
27077
- coreEvents.off("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
27138
+ coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
27078
27139
  };
27079
27140
  }, [isRespondingRef]);
27080
27141
  const [
@@ -27207,12 +27268,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27207
27268
  const tc = toolCalls[i];
27208
27269
  if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
27209
27270
  if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
27210
- const isAgent = tc.tool?.kind === "agent" /* Agent */;
27271
+ const isAgent = tc.tool?.kind === Kind.Agent;
27211
27272
  if (isAgent) {
27212
27273
  let contigAgentsComplete = true;
27213
27274
  for (let j = i + 1; j < toolCalls.length; j++) {
27214
27275
  const nextTc = toolCalls[j];
27215
- if (nextTc.tool?.kind === "agent" /* Agent */) {
27276
+ if (nextTc.tool?.kind === Kind.Agent) {
27216
27277
  if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
27217
27278
  contigAgentsComplete = false;
27218
27279
  break;
@@ -27238,7 +27299,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27238
27299
  let currentGroup = [];
27239
27300
  for (const tc of toolsToPush) {
27240
27301
  newPushed.add(tc.request.callId);
27241
- if (tc.tool?.kind === "agent" /* Agent */) {
27302
+ if (tc.tool?.kind === Kind.Agent) {
27242
27303
  currentGroup.push(tc);
27243
27304
  } else {
27244
27305
  if (currentGroup.length > 0) {
@@ -27388,7 +27449,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27388
27449
  prevActiveShellPtyIdRef.current = activeShellPtyId;
27389
27450
  }, [activeShellPtyId, addItem, setIsResponding]);
27390
27451
  (0, import_react99.useEffect)(() => {
27391
- if (config.getApprovalMode() === "yolo" /* YOLO */ && streamingState === "idle" /* Idle */) {
27452
+ if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
27392
27453
  const lastUserMessageIndex = history.findLastIndex(
27393
27454
  (item) => item.type === "user" /* USER */
27394
27455
  );
@@ -27456,7 +27517,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27456
27517
  return;
27457
27518
  }
27458
27519
  const hasActiveTools = toolCalls.some(
27459
- (tc) => tc.status === "executing" /* Executing */ || tc.status === "scheduled" /* Scheduled */ || tc.status === "validating" /* Validating */
27520
+ (tc) => tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating
27460
27521
  );
27461
27522
  if (streamingState === "idle" /* Idle */ && !isRespondingRef.current && !hasActiveTools) {
27462
27523
  if (clearBuffer) {
@@ -27483,7 +27544,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27483
27544
  if (tool.name === SHELL_COMMAND_NAME) {
27484
27545
  return {
27485
27546
  ...tool,
27486
- status: "cancelled" /* Cancelled */,
27547
+ status: CoreToolCallStatus.Cancelled,
27487
27548
  resultDisplay: tool.resultDisplay
27488
27549
  };
27489
27550
  }
@@ -27548,7 +27609,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27548
27609
  let localQueryToSendToGemini = null;
27549
27610
  if (typeof query === "string") {
27550
27611
  const trimmedQuery = query.trim();
27551
- await logger?.logMessage("user" /* USER */, trimmedQuery);
27612
+ await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
27552
27613
  if (!shellModeActive) {
27553
27614
  const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
27554
27615
  if (slashCommandResult) {
@@ -27704,7 +27765,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27704
27765
  if (pendingHistoryItemRef.current) {
27705
27766
  if (pendingHistoryItemRef.current.type === "tool_group") {
27706
27767
  const updatedTools = pendingHistoryItemRef.current.tools.map(
27707
- (tool) => tool.status === "validating" /* Validating */ || tool.status === "scheduled" /* Scheduled */ || tool.status === "awaiting_approval" /* AwaitingApproval */ || tool.status === "executing" /* Executing */ ? { ...tool, status: "cancelled" /* Cancelled */ } : tool
27768
+ (tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
27708
27769
  );
27709
27770
  const pendingItem = {
27710
27771
  ...pendingHistoryItemRef.current,
@@ -27996,15 +28057,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27996
28057
  let geminiMessageBuffer = "";
27997
28058
  const toolCallRequests = [];
27998
28059
  for await (const event of stream) {
27999
- if (event.type !== "thought" /* Thought */ && thoughtRef.current !== null) {
28060
+ if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
28000
28061
  setThought(null);
28001
28062
  }
28002
28063
  switch (event.type) {
28003
- case "thought" /* Thought */:
28064
+ case GeminiEventType.Thought:
28004
28065
  setLastGeminiActivityTime(Date.now());
28005
28066
  handleThoughtEvent(event.value, userMessageTimestamp);
28006
28067
  break;
28007
- case "content" /* Content */:
28068
+ case GeminiEventType.Content:
28008
28069
  setLastGeminiActivityTime(Date.now());
28009
28070
  geminiMessageBuffer = handleContentEvent(
28010
28071
  event.value,
@@ -28012,16 +28073,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28012
28073
  userMessageTimestamp
28013
28074
  );
28014
28075
  break;
28015
- case "tool_call_request" /* ToolCallRequest */:
28076
+ case GeminiEventType.ToolCallRequest:
28016
28077
  toolCallRequests.push(event.value);
28017
28078
  break;
28018
- case "user_cancelled" /* UserCancelled */:
28079
+ case GeminiEventType.UserCancelled:
28019
28080
  handleUserCancelledEvent(userMessageTimestamp);
28020
28081
  break;
28021
- case "error" /* Error */:
28082
+ case GeminiEventType.Error:
28022
28083
  handleErrorEvent(event.value, userMessageTimestamp);
28023
28084
  break;
28024
- case "agent_execution_stopped" /* AgentExecutionStopped */:
28085
+ case GeminiEventType.AgentExecutionStopped:
28025
28086
  handleAgentExecutionStoppedEvent(
28026
28087
  event.value.reason,
28027
28088
  userMessageTimestamp,
@@ -28029,7 +28090,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28029
28090
  event.value.contextCleared
28030
28091
  );
28031
28092
  break;
28032
- case "agent_execution_blocked" /* AgentExecutionBlocked */:
28093
+ case GeminiEventType.AgentExecutionBlocked:
28033
28094
  handleAgentExecutionBlockedEvent(
28034
28095
  event.value.reason,
28035
28096
  userMessageTimestamp,
@@ -28037,36 +28098,36 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28037
28098
  event.value.contextCleared
28038
28099
  );
28039
28100
  break;
28040
- case "chat_compressed" /* ChatCompressed */:
28101
+ case GeminiEventType.ChatCompressed:
28041
28102
  handleChatCompressionEvent(event.value, userMessageTimestamp);
28042
28103
  break;
28043
- case "tool_call_confirmation" /* ToolCallConfirmation */:
28044
- case "tool_call_response" /* ToolCallResponse */:
28104
+ case GeminiEventType.ToolCallConfirmation:
28105
+ case GeminiEventType.ToolCallResponse:
28045
28106
  break;
28046
- case "max_session_turns" /* MaxSessionTurns */:
28107
+ case GeminiEventType.MaxSessionTurns:
28047
28108
  handleMaxSessionTurnsEvent();
28048
28109
  break;
28049
- case "context_window_will_overflow" /* ContextWindowWillOverflow */:
28110
+ case GeminiEventType.ContextWindowWillOverflow:
28050
28111
  handleContextWindowWillOverflowEvent(
28051
28112
  event.value.estimatedRequestTokenCount,
28052
28113
  event.value.remainingTokenCount
28053
28114
  );
28054
28115
  break;
28055
- case "finished" /* Finished */:
28116
+ case GeminiEventType.Finished:
28056
28117
  handleFinishedEvent(event, userMessageTimestamp);
28057
28118
  break;
28058
- case "citation" /* Citation */:
28119
+ case GeminiEventType.Citation:
28059
28120
  handleCitationEvent(event.value, userMessageTimestamp);
28060
28121
  break;
28061
- case "model_info" /* ModelInfo */:
28122
+ case GeminiEventType.ModelInfo:
28062
28123
  handleChatModelEvent(event.value, userMessageTimestamp);
28063
28124
  break;
28064
- case "loop_detected" /* LoopDetected */:
28125
+ case GeminiEventType.LoopDetected:
28065
28126
  loopDetectedRef.current = true;
28066
28127
  break;
28067
- case "retry" /* Retry */:
28128
+ case GeminiEventType.Retry:
28068
28129
  break;
28069
- case "invalid_stream" /* InvalidStream */:
28130
+ case GeminiEventType.InvalidStream:
28070
28131
  handleInvalidStreamEvent(event.value, userMessageTimestamp);
28071
28132
  break;
28072
28133
  default: {
@@ -28109,7 +28170,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28109
28170
  const submitQuery = (0, import_react99.useCallback)(
28110
28171
  async (query, options, prompt_id) => runInDevTraceSpan(
28111
28172
  {
28112
- operation: options?.isContinuation ? "system_prompt" /* SystemPrompt */ : "user_prompt" /* UserPrompt */,
28173
+ operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
28113
28174
  sessionId: config.getSessionId()
28114
28175
  },
28115
28176
  async ({ metadata: spanMetadata }) => {
@@ -28269,7 +28330,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28269
28330
  );
28270
28331
  const handleApprovalModeChange = (0, import_react99.useCallback)(
28271
28332
  async (newApprovalMode) => {
28272
- if (previousApprovalModeRef.current === "plan" /* PLAN */ && newApprovalMode !== "plan" /* PLAN */ && streamingState === "idle" /* Idle */) {
28333
+ if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
28273
28334
  if (geminiClient) {
28274
28335
  try {
28275
28336
  await geminiClient.addHistory({
@@ -28292,11 +28353,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28292
28353
  }
28293
28354
  }
28294
28355
  previousApprovalModeRef.current = newApprovalMode;
28295
- if (newApprovalMode === "yolo" /* YOLO */ || newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
28356
+ if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
28296
28357
  let awaitingApprovalCalls = toolCalls.filter(
28297
28358
  (call) => call.status === "awaiting_approval" && !call.request.forcedAsk
28298
28359
  );
28299
- if (newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
28360
+ if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
28300
28361
  awaitingApprovalCalls = awaitingApprovalCalls.filter((call) => {
28301
28362
  if (EDIT_TOOL_NAMES.has(call.request.name)) {
28302
28363
  return true;
@@ -28312,11 +28373,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28312
28373
  if (call.correlationId) {
28313
28374
  try {
28314
28375
  await config.getMessageBus().publish({
28315
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
28376
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
28316
28377
  correlationId: call.correlationId,
28317
28378
  confirmed: true,
28318
28379
  requiresUserConfirmation: false,
28319
- outcome: "proceed_once" /* ProceedOnce */
28380
+ outcome: ToolConfirmationOutcome.ProceedOnce
28320
28381
  });
28321
28382
  } catch (error) {
28322
28383
  debugLogger.warn(
@@ -28407,14 +28468,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28407
28468
  );
28408
28469
  if (isLowErrorVerbosity) {
28409
28470
  suppressedToolErrorCountRef.current += geminiTools.filter(
28410
- (tc) => tc.status === "error" /* Error */
28471
+ (tc) => tc.status === CoreToolCallStatus.Error
28411
28472
  ).length;
28412
28473
  }
28413
28474
  if (geminiTools.length === 0) {
28414
28475
  return;
28415
28476
  }
28416
28477
  const stopExecutionTool = geminiTools.find(
28417
- (tc) => tc.response.errorType === "stop_execution" /* STOP_EXECUTION */
28478
+ (tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
28418
28479
  );
28419
28480
  if (stopExecutionTool && stopExecutionTool.response.error) {
28420
28481
  maybeAddSuppressedToolErrorNote();
@@ -28434,9 +28495,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28434
28495
  (tc) => !isTopicTool2(tc.request.name)
28435
28496
  );
28436
28497
  const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
28437
- (tc) => tc.status === "cancelled" /* Cancelled */
28498
+ (tc) => tc.status === CoreToolCallStatus.Cancelled
28438
28499
  );
28439
- const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === "cancelled" /* Cancelled */);
28500
+ const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
28440
28501
  if (allDeclinableToolsCancelled || allToolsCancelled) {
28441
28502
  if (!turnCancelledRef.current) {
28442
28503
  addItem({
@@ -28523,7 +28584,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28523
28584
  return;
28524
28585
  }
28525
28586
  const restorableToolCalls = toolCalls.filter(
28526
- (toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === "awaiting_approval" /* AwaitingApproval */
28587
+ (toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
28527
28588
  );
28528
28589
  if (restorableToolCalls.length > 0) {
28529
28590
  if (!gitService) {
@@ -28746,14 +28807,14 @@ var useAgentStream = ({
28746
28807
  const displayName = legacyState?.displayName ?? event.name;
28747
28808
  const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
28748
28809
  const desc = legacyState?.description ?? "";
28749
- const fallbackKind = "other" /* Other */;
28810
+ const fallbackKind = Kind.Other;
28750
28811
  const newCall = {
28751
28812
  callId: event.requestId,
28752
28813
  name: displayName,
28753
28814
  originalRequestName: event.name,
28754
28815
  description: desc,
28755
28816
  display: event.display,
28756
- status: "scheduled" /* Scheduled */,
28817
+ status: CoreToolCallStatus.Scheduled,
28757
28818
  isClientInitiated: false,
28758
28819
  renderOutputAsMarkdown: isOutputMarkdown,
28759
28820
  kind: legacyState?.kind ?? fallbackKind,
@@ -28771,10 +28832,10 @@ var useAgentStream = ({
28771
28832
  const evtStatus = legacyState?.status;
28772
28833
  let status = tc.status;
28773
28834
  if (evtStatus === "executing")
28774
- status = "executing" /* Executing */;
28775
- else if (evtStatus === "error") status = "error" /* Error */;
28835
+ status = CoreToolCallStatus.Executing;
28836
+ else if (evtStatus === "error") status = CoreToolCallStatus.Error;
28776
28837
  else if (evtStatus === "success")
28777
- status = "success" /* Success */;
28838
+ status = CoreToolCallStatus.Success;
28778
28839
  const display = event.display?.result;
28779
28840
  const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
28780
28841
  const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
@@ -28807,7 +28868,7 @@ var useAgentStream = ({
28807
28868
  const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
28808
28869
  return {
28809
28870
  ...tc,
28810
- status: event.isError ? "error" /* Error */ : "success" /* Success */,
28871
+ status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
28811
28872
  display: event.display ? { ...tc.display, ...event.display } : tc.display,
28812
28873
  resultDisplay,
28813
28874
  outputFile
@@ -28873,7 +28934,7 @@ var useAgentStream = ({
28873
28934
  if (!options?.isContinuation) {
28874
28935
  if (typeof query === "string") {
28875
28936
  addItem({ type: "user" /* USER */, text: query }, timestamp);
28876
- void logger?.logMessage("user" /* USER */, query);
28937
+ void logger?.logMessage(MessageSenderType.USER, query);
28877
28938
  }
28878
28939
  startNewPrompt();
28879
28940
  }
@@ -30400,9 +30461,9 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30400
30461
  const handleFolderTrustSelect = (0, import_react105.useCallback)(
30401
30462
  async (choice) => {
30402
30463
  const trustLevelMap = {
30403
- ["trust_folder" /* TRUST_FOLDER */]: "TRUST_FOLDER" /* TRUST_FOLDER */,
30404
- ["trust_parent" /* TRUST_PARENT */]: "TRUST_PARENT" /* TRUST_PARENT */,
30405
- ["do_not_trust" /* DO_NOT_TRUST */]: "DO_NOT_TRUST" /* DO_NOT_TRUST */
30464
+ ["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
30465
+ ["trust_parent" /* TRUST_PARENT */]: TrustLevel.TRUST_PARENT,
30466
+ ["do_not_trust" /* DO_NOT_TRUST */]: TrustLevel.DO_NOT_TRUST
30406
30467
  };
30407
30468
  const trustLevel = trustLevelMap[choice];
30408
30469
  if (!trustLevel) return;
@@ -30421,7 +30482,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30421
30482
  }, 100);
30422
30483
  return;
30423
30484
  }
30424
- const currentIsTrusted = trustLevel === "TRUST_FOLDER" /* TRUST_FOLDER */ || trustLevel === "TRUST_PARENT" /* TRUST_PARENT */;
30485
+ const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
30425
30486
  onTrustChange(currentIsTrusted);
30426
30487
  setIsTrusted(currentIsTrusted);
30427
30488
  const wasTrusted = isTrusted ?? false;
@@ -30656,12 +30717,12 @@ var streamRequest = (request, onUploadProgress, originalBody) => {
30656
30717
  };
30657
30718
 
30658
30719
  // node_modules/ky/distribution/utils/is.js
30659
- var isObject = (value) => value !== null && typeof value === "object";
30720
+ var isObject2 = (value) => value !== null && typeof value === "object";
30660
30721
 
30661
30722
  // node_modules/ky/distribution/utils/merge.js
30662
30723
  var validateAndMerge = (...sources) => {
30663
30724
  for (const source of sources) {
30664
- if ((!isObject(source) || Array.isArray(source)) && source !== void 0) {
30725
+ if ((!isObject2(source) || Array.isArray(source)) && source !== void 0) {
30665
30726
  throw new TypeError("The `options` argument must be an object");
30666
30727
  }
30667
30728
  }
@@ -30706,7 +30767,7 @@ var appendSearchParameters = (target, source) => {
30706
30767
  }
30707
30768
  result.append(String(pair[0]), String(pair[1]));
30708
30769
  }
30709
- } else if (isObject(input)) {
30770
+ } else if (isObject2(input)) {
30710
30771
  for (const [key, value] of Object.entries(input)) {
30711
30772
  if (value !== void 0) {
30712
30773
  result.append(key, String(value));
@@ -30733,14 +30794,14 @@ var deepMerge = (...sources) => {
30733
30794
  returnValue = [];
30734
30795
  }
30735
30796
  returnValue = [...returnValue, ...source];
30736
- } else if (isObject(source)) {
30797
+ } else if (isObject2(source)) {
30737
30798
  for (let [key, value] of Object.entries(source)) {
30738
30799
  if (key === "signal" && value instanceof globalThis.AbortSignal) {
30739
30800
  signals.push(value);
30740
30801
  continue;
30741
30802
  }
30742
30803
  if (key === "context") {
30743
- if (value !== void 0 && value !== null && (!isObject(value) || Array.isArray(value))) {
30804
+ if (value !== void 0 && value !== null && (!isObject2(value) || Array.isArray(value))) {
30744
30805
  throw new TypeError("The `context` option must be an object");
30745
30806
  }
30746
30807
  returnValue = {
@@ -30757,16 +30818,16 @@ var deepMerge = (...sources) => {
30757
30818
  }
30758
30819
  continue;
30759
30820
  }
30760
- if (isObject(value) && key in returnValue) {
30821
+ if (isObject2(value) && key in returnValue) {
30761
30822
  value = deepMerge(returnValue[key], value);
30762
30823
  }
30763
30824
  returnValue = { ...returnValue, [key]: value };
30764
30825
  }
30765
- if (isObject(source.hooks)) {
30826
+ if (isObject2(source.hooks)) {
30766
30827
  hooks = mergeHooks(hooks, source.hooks);
30767
30828
  returnValue.hooks = hooks;
30768
30829
  }
30769
- if (isObject(source.headers)) {
30830
+ if (isObject2(source.headers)) {
30770
30831
  headers = mergeHeaders(headers, source.headers);
30771
30832
  returnValue.headers = headers;
30772
30833
  }
@@ -31429,7 +31490,7 @@ function useMessageQueue({
31429
31490
  var import_react107 = __toESM(require_react(), 1);
31430
31491
  function useMcpStatus(config) {
31431
31492
  const [discoveryState, setDiscoveryState] = (0, import_react107.useState)(
31432
- () => config.getMcpClientManager()?.getDiscoveryState() ?? "not_started" /* NOT_STARTED */
31493
+ () => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
31433
31494
  );
31434
31495
  const [mcpServerCount, setMcpServerCount] = (0, import_react107.useState)(
31435
31496
  () => config.getMcpClientManager()?.getMcpServerCount() ?? 0
@@ -31442,12 +31503,12 @@ function useMcpStatus(config) {
31442
31503
  setMcpServerCount(manager.getMcpServerCount());
31443
31504
  }
31444
31505
  };
31445
- coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
31506
+ coreEvents.on(CoreEvent.McpClientUpdate, onChange);
31446
31507
  return () => {
31447
- coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
31508
+ coreEvents.off(CoreEvent.McpClientUpdate, onChange);
31448
31509
  };
31449
31510
  }, [config]);
31450
- const isMcpReady = discoveryState === "completed" /* COMPLETED */ || discoveryState === "not_started" /* NOT_STARTED */ && mcpServerCount === 0;
31511
+ const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
31451
31512
  return {
31452
31513
  discoveryState,
31453
31514
  mcpServerCount,
@@ -31474,7 +31535,7 @@ function useApprovalModeIndicator({
31474
31535
  (key) => {
31475
31536
  let nextApprovalMode;
31476
31537
  if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
31477
- if (config.isYoloModeDisabled() && config.getApprovalMode() !== "yolo" /* YOLO */) {
31538
+ if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
31478
31539
  if (addItem) {
31479
31540
  let text = "You cannot enter YOLO mode since it is disabled in your settings.";
31480
31541
  const adminSettings = config.getRemoteAdminSettings();
@@ -31492,21 +31553,21 @@ function useApprovalModeIndicator({
31492
31553
  }
31493
31554
  return;
31494
31555
  }
31495
- nextApprovalMode = config.getApprovalMode() === "yolo" /* YOLO */ ? "default" /* DEFAULT */ : "yolo" /* YOLO */;
31556
+ nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
31496
31557
  } else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
31497
31558
  const currentMode = config.getApprovalMode();
31498
31559
  switch (currentMode) {
31499
- case "default" /* DEFAULT */:
31500
- nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
31560
+ case ApprovalMode.DEFAULT:
31561
+ nextApprovalMode = ApprovalMode.AUTO_EDIT;
31501
31562
  break;
31502
- case "autoEdit" /* AUTO_EDIT */:
31503
- nextApprovalMode = allowPlanMode ? "plan" /* PLAN */ : "default" /* DEFAULT */;
31563
+ case ApprovalMode.AUTO_EDIT:
31564
+ nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
31504
31565
  break;
31505
- case "plan" /* PLAN */:
31506
- nextApprovalMode = "default" /* DEFAULT */;
31566
+ case ApprovalMode.PLAN:
31567
+ nextApprovalMode = ApprovalMode.DEFAULT;
31507
31568
  break;
31508
- case "yolo" /* YOLO */:
31509
- nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
31569
+ case ApprovalMode.YOLO:
31570
+ nextApprovalMode = ApprovalMode.AUTO_EDIT;
31510
31571
  break;
31511
31572
  default:
31512
31573
  }
@@ -31916,11 +31977,11 @@ var useHookDisplayState = () => {
31916
31977
  removeHook();
31917
31978
  }
31918
31979
  };
31919
- coreEvents.on("hook-start" /* HookStart */, handleHookStart);
31920
- coreEvents.on("hook-end" /* HookEnd */, handleHookEnd);
31980
+ coreEvents.on(CoreEvent.HookStart, handleHookStart);
31981
+ coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
31921
31982
  return () => {
31922
- coreEvents.off("hook-start" /* HookStart */, handleHookStart);
31923
- coreEvents.off("hook-end" /* HookEnd */, handleHookEnd);
31983
+ coreEvents.off(CoreEvent.HookStart, handleHookStart);
31984
+ coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
31924
31985
  activeTimeouts.forEach(clearTimeout);
31925
31986
  activeTimeouts.clear();
31926
31987
  };
@@ -32759,7 +32820,7 @@ var AppContainer = (props) => {
32759
32820
  setConfigInitialized(true);
32760
32821
  startupProfiler.flush(config);
32761
32822
  startAutoMemoryIfEnabled(config);
32762
- const sessionStartSource = resumedSessionData ? "resume" /* Resume */ : "startup" /* Startup */;
32823
+ const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
32763
32824
  const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
32764
32825
  if (result) {
32765
32826
  const additionalContext = result.getAdditionalContext();
@@ -32786,7 +32847,7 @@ var AppContainer = (props) => {
32786
32847
  );
32787
32848
  const ideClient = await IdeClient.getInstance();
32788
32849
  await ideClient.disconnect();
32789
- await config?.getHookSystem()?.fireSessionEndEvent("exit" /* Exit */);
32850
+ await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
32790
32851
  };
32791
32852
  registerCleanup(cleanupFn);
32792
32853
  return () => {
@@ -32811,11 +32872,11 @@ var AppContainer = (props) => {
32811
32872
  resetTime: payload.resetTime
32812
32873
  });
32813
32874
  };
32814
- coreEvents.on("model-changed" /* ModelChanged */, handleModelChanged);
32815
- coreEvents.on("quota-changed" /* QuotaChanged */, handleQuotaChanged);
32875
+ coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
32876
+ coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
32816
32877
  return () => {
32817
- coreEvents.off("model-changed" /* ModelChanged */, handleModelChanged);
32818
- coreEvents.off("quota-changed" /* QuotaChanged */, handleQuotaChanged);
32878
+ coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
32879
+ coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
32819
32880
  };
32820
32881
  }, [config]);
32821
32882
  (0, import_react121.useEffect)(() => {
@@ -32828,16 +32889,16 @@ var AppContainer = (props) => {
32828
32889
  const handleAgentsDiscovered = (payload) => {
32829
32890
  setNewAgents(payload.agents);
32830
32891
  };
32831
- coreEvents.on("settings-changed" /* SettingsChanged */, handleSettingsChanged);
32832
- coreEvents.on("admin-settings-changed" /* AdminSettingsChanged */, handleAdminSettingsChanged);
32833
- coreEvents.on("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
32892
+ coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
32893
+ coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
32894
+ coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
32834
32895
  return () => {
32835
- coreEvents.off("settings-changed" /* SettingsChanged */, handleSettingsChanged);
32896
+ coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
32836
32897
  coreEvents.off(
32837
- "admin-settings-changed" /* AdminSettingsChanged */,
32898
+ CoreEvent.AdminSettingsChanged,
32838
32899
  handleAdminSettingsChanged
32839
32900
  );
32840
- coreEvents.off("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
32901
+ coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
32841
32902
  };
32842
32903
  }, [settings]);
32843
32904
  const { errorCount, clearErrorCount } = useErrorCount();
@@ -32902,11 +32963,11 @@ var AppContainer = (props) => {
32902
32963
  exitEditorDialog
32903
32964
  } = useEditorSettings(settings, setEditorError, historyManager.addItem);
32904
32965
  (0, import_react121.useEffect)(() => {
32905
- coreEvents.on("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
32906
- coreEvents.on("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
32966
+ coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
32967
+ coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
32907
32968
  return () => {
32908
- coreEvents.off("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
32909
- coreEvents.off("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
32969
+ coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
32970
+ coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
32910
32971
  };
32911
32972
  }, [handleEditorClose, openEditorDialog]);
32912
32973
  (0, import_react121.useEffect)(() => {
@@ -32974,7 +33035,7 @@ var AppContainer = (props) => {
32974
33035
  errorVerbosity: settings.merged.ui.errorVerbosity
32975
33036
  });
32976
33037
  const isAuthDialogOpen = authState === "updating" /* Updating */;
32977
- const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== "gemini-api-key" /* USE_GEMINI */;
33038
+ const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
32978
33039
  const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
32979
33040
  const { loadHistoryForResume, isResuming } = useSessionResume({
32980
33041
  config,
@@ -33002,7 +33063,7 @@ var AppContainer = (props) => {
33002
33063
  async (authType, scope) => {
33003
33064
  if (authType) {
33004
33065
  const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
33005
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */) {
33066
+ if (authType === AuthType.LOGIN_WITH_GOOGLE) {
33006
33067
  setAuthContext({ requiresRestart: true });
33007
33068
  } else {
33008
33069
  setAuthContext({});
@@ -33030,7 +33091,7 @@ var AppContainer = (props) => {
33030
33091
  );
33031
33092
  return;
33032
33093
  }
33033
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
33094
+ if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
33034
33095
  writeToStdout(`
33035
33096
  ----------------------------------------------------------------
33036
33097
  Logging in with Google... Restarting Gemini CLI to continue.
@@ -33053,7 +33114,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
33053
33114
  }
33054
33115
  await saveApiKey(apiKey);
33055
33116
  await reloadApiKey();
33056
- await config.refreshAuth("gemini-api-key" /* USE_GEMINI */);
33117
+ await config.refreshAuth(AuthType.USE_GEMINI);
33057
33118
  setAuthState("authenticated" /* Authenticated */);
33058
33119
  } catch (e) {
33059
33120
  onAuthError(
@@ -33078,7 +33139,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
33078
33139
  `Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
33079
33140
  );
33080
33141
  } else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
33081
- if (settings.merged.security.auth.selectedType === "gemini-api-key" /* USE_GEMINI */) {
33142
+ if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
33082
33143
  return;
33083
33144
  }
33084
33145
  const authMethod = settings.merged.security.auth.selectedType;
@@ -33214,9 +33275,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
33214
33275
  }
33215
33276
  });
33216
33277
  };
33217
- coreEvents.on("consent-request" /* ConsentRequest */, handleConsentRequest);
33278
+ coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
33218
33279
  return () => {
33219
- coreEvents.off("consent-request" /* ConsentRequest */, handleConsentRequest);
33280
+ coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
33220
33281
  };
33221
33282
  }, []);
33222
33283
  const performMemoryRefresh = (0, import_react121.useCallback)(async () => {
@@ -33874,7 +33935,7 @@ ${queuedText}` : queuedText;
33874
33935
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
33875
33936
  if (settings.merged.general.devtools) {
33876
33937
  void (async () => {
33877
- const { toggleDevToolsPanel } = await import("./devtoolsService-2PJHOM3Z.js");
33938
+ const { toggleDevToolsPanel } = await import("./devtoolsService-X4SBEWHU.js");
33878
33939
  await toggleDevToolsPanel(
33879
33940
  config,
33880
33941
  showErrorDetails,
@@ -34092,17 +34153,17 @@ ${queuedText}` : queuedText;
34092
34153
  Date.now()
34093
34154
  );
34094
34155
  };
34095
- coreEvents.on("user-feedback" /* UserFeedback */, handleUserFeedback);
34096
- coreEvents.on("hook-system-message" /* HookSystemMessage */, handleHookSystemMessage);
34156
+ coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
34157
+ coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
34097
34158
  coreEvents.drainBacklogs();
34098
34159
  return () => {
34099
- coreEvents.off("user-feedback" /* UserFeedback */, handleUserFeedback);
34100
- coreEvents.off("hook-system-message" /* HookSystemMessage */, handleHookSystemMessage);
34160
+ coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
34161
+ coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
34101
34162
  };
34102
34163
  }, [historyManager]);
34103
34164
  const nightly = props.version.includes("nightly");
34104
34165
  const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
34105
- 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;
34166
+ 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;
34106
34167
  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;
34107
34168
  const hasPendingToolConfirmation = (0, import_react121.useMemo)(
34108
34169
  () => isToolAwaitingConfirmation(pendingHistoryItems),
@@ -34202,9 +34263,9 @@ ${queuedText}` : queuedText;
34202
34263
  const handleMemoryChanged = (result) => {
34203
34264
  setGeminiMdFileCount(result.fileCount);
34204
34265
  };
34205
- coreEvents.on("memory-changed" /* MemoryChanged */, handleMemoryChanged);
34266
+ coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
34206
34267
  return () => {
34207
- coreEvents.off("memory-changed" /* MemoryChanged */, handleMemoryChanged);
34268
+ coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
34208
34269
  };
34209
34270
  }, []);
34210
34271
  (0, import_react121.useEffect)(() => {