@google/gemini-cli 0.71.0-preview.0 → 0.71.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/bundle/{chunk-3XHFESDF.js → chunk-2B7JJXKC.js} +1 -1
  2. package/bundle/{chunk-7UJSGYFD.js → chunk-2Z6OMQKM.js} +1 -1
  3. package/bundle/{chunk-VIXTMKUM.js → chunk-3SHFRERV.js} +1 -1
  4. package/bundle/{chunk-YQO7IBVQ.js → chunk-4UW3VJTT.js} +4 -4
  5. package/bundle/{chunk-DPAMHBTE.js → chunk-5E7G6JKU.js} +3 -3
  6. package/bundle/{chunk-IBD2PLWE.js → chunk-5XMSOGIG.js} +7 -7
  7. package/bundle/{chunk-Y6WF3A3Q.js → chunk-5Z6VX6CL.js} +2 -2
  8. package/bundle/{chunk-FUOK6VUJ.js → chunk-66MTKCNI.js} +3 -3
  9. package/bundle/{chunk-6E6XAAYL.js → chunk-7KLSV23C.js} +71 -58
  10. package/bundle/{chunk-JJNQ5PWH.js → chunk-EFTWPKUN.js} +8066 -15416
  11. package/bundle/{chunk-QQNZHLIF.js → chunk-ERWHYM4U.js} +2 -2
  12. package/bundle/{chunk-UTK4LRWO.js → chunk-EYFD4IXY.js} +1 -1
  13. package/bundle/{chunk-KSDBDSBI.js → chunk-GNADRXVJ.js} +9 -8
  14. package/bundle/chunk-H2UUYR57.js +60338 -0
  15. package/bundle/{chunk-AJZTZFAS.js → chunk-H3XZAPPM.js} +2 -2
  16. package/bundle/{chunk-NATMLC5X.js → chunk-JJQXJ4YW.js} +1 -1
  17. package/bundle/{chunk-532N7TZB.js → chunk-KPQSXIIX.js} +8 -6
  18. package/bundle/{chunk-NQGCTXGR.js → chunk-LMFXSDD5.js} +1 -1
  19. package/bundle/{chunk-W7J7YSH2.js → chunk-LUNZGYWH.js} +1 -1
  20. package/bundle/chunk-ME55Z6II.js +512 -0
  21. package/bundle/{chunk-LGRO4U3O.js → chunk-MTVMJTRD.js} +7 -7
  22. package/bundle/{chunk-5SC43MXU.js → chunk-NJ3UA7N7.js} +3 -3
  23. package/bundle/chunk-OGIQ2DJJ.js +420358 -0
  24. package/bundle/{chunk-AQXZKJST.js → chunk-PGIUSQYX.js} +1 -1
  25. package/bundle/{chunk-DCBU7GEJ.js → chunk-QE3A6WRI.js} +1 -1
  26. package/bundle/chunk-RQ4T6AK5.js +190 -0
  27. package/bundle/{chunk-EERY2AEY.js → chunk-RWAKAA62.js} +1 -1
  28. package/bundle/{chunk-BTH7KEMH.js → chunk-SVDAJM4G.js} +4 -4
  29. package/bundle/{chunk-NMOD2T37.js → chunk-TC4PBO7S.js} +2 -2
  30. package/bundle/{chunk-QGOT25K4.js → chunk-TGPYI6FY.js} +1 -1
  31. package/bundle/{chunk-7YXHVH7Y.js → chunk-TZEZ2BF4.js} +2 -2
  32. package/bundle/chunk-V3MODYYD.js +40024 -0
  33. package/bundle/chunk-V5OR34VL.js +1962 -0
  34. package/bundle/chunk-XERNHADV.js +118 -0
  35. package/bundle/chunk-XOCSGCT5.js +65 -0
  36. package/bundle/chunk-YTLUKDLU.js +1571 -0
  37. package/bundle/{cleanup-4WL7SSTL.js → cleanup-HZB3VIXG.js} +2 -2
  38. package/bundle/{cleanup-62ECCOLP.js → cleanup-QGMSGSQI.js} +2 -2
  39. package/bundle/{cleanup-JWSUGSQB.js → cleanup-SNOIOSXE.js} +2 -2
  40. package/bundle/cleanup-XOWU5YHP.js +34 -0
  41. package/bundle/{core-NP64K3HR.js → core-5NA633TR.js} +1 -1
  42. package/bundle/{devtoolsService-DWVXCWJ7.js → devtoolsService-AT3VY34P.js} +2 -2
  43. package/bundle/{devtoolsService-3G6P4EBB.js → devtoolsService-JK3QG6X7.js} +4 -3
  44. package/bundle/{devtoolsService-XMEVE7R4.js → devtoolsService-RIZXSVKI.js} +2 -2
  45. package/bundle/devtoolsService-ZAMC5JAO.js +919 -0
  46. package/bundle/{dist-AAGC2327.js → dist-JL5IFBA3.js} +1 -1
  47. package/bundle/{core-6V72TKM3.js → dist-RXWQJLEG.js} +1 -1
  48. package/bundle/dist-ZAHQGAAY.js +2372 -0
  49. package/bundle/{formatError-P6NGVTF2.js → formatError-2ZV7IU6M.js} +2 -2
  50. package/bundle/{formatError-QS36O76I.js → formatError-EGZMA6Z2.js} +2 -2
  51. package/bundle/{formatError-7YP6B7ZW.js → formatError-FYNWLWNA.js} +2 -2
  52. package/bundle/formatError-VALS3RAN.js +14 -0
  53. package/bundle/{gemini-TY6A5Q5C.js → gemini-7FHLRHNN.js} +15 -15
  54. package/bundle/{gemini-3VVVLE4J.js → gemini-FRYTBWBD.js} +224 -208
  55. package/bundle/{gemini-AC4RONBV.js → gemini-LBFFF5NZ.js} +15 -15
  56. package/bundle/gemini-SYSVTILL.js +20020 -0
  57. package/bundle/gemini.js +8 -8
  58. package/bundle/{interactiveCli-XULKUHW4.js → interactiveCli-FOKYJG6H.js} +8 -8
  59. package/bundle/{interactiveCli-BHEEEW2H.js → interactiveCli-LDT5NDQR.js} +319 -300
  60. package/bundle/{interactiveCli-AO75ICTD.js → interactiveCli-SJYVQK53.js} +8 -8
  61. package/bundle/interactiveCli-VXSDDOFP.js +36447 -0
  62. package/bundle/{liteRtServerManager-DRZ6V4ZL.js → liteRtServerManager-7EZCW25J.js} +4 -4
  63. package/bundle/{liteRtServerManager-7VEEHSC6.js → liteRtServerManager-QCOZHG7Q.js} +4 -4
  64. package/bundle/{liteRtServerManager-GFU4D3JF.js → liteRtServerManager-RWREZPJE.js} +4 -4
  65. package/bundle/liteRtServerManager-WTEPPKAQ.js +65 -0
  66. package/bundle/{oauth2-provider-S7DQJKA5.js → oauth2-provider-775ZBHR6.js} +1 -1
  67. package/bundle/{oauth2-provider-YZI5V6PH.js → oauth2-provider-FTL5RWC6.js} +1 -1
  68. package/bundle/{oauth2-provider-XYK3N74K.js → oauth2-provider-H5S5NJUW.js} +41 -79
  69. package/bundle/oauth2-provider-QC5SFA6N.js +273 -0
  70. package/bundle/{start-JGS6ZUFX.js → start-HCWYCRFJ.js} +6 -6
  71. package/bundle/{start-QQTZCWPJ.js → start-HYRJ4ARV.js} +6 -6
  72. package/bundle/{start-EMZSUYV6.js → start-S4SAAQ7Z.js} +6 -6
  73. package/bundle/start-SRLXJJA4.js +18 -0
  74. package/package.json +1 -1
@@ -149,10 +149,10 @@ import {
149
149
  useUIState,
150
150
  useVimMode,
151
151
  validateAuthMethod
152
- } from "./chunk-6E6XAAYL.js";
152
+ } from "./chunk-H2UUYR57.js";
153
153
  import {
154
154
  require_source
155
- } from "./chunk-NATMLC5X.js";
155
+ } from "./chunk-3SHFRERV.js";
156
156
  import {
157
157
  appEvents
158
158
  } from "./chunk-5PS3AYFU.js";
@@ -226,34 +226,38 @@ import {
226
226
  widestLineFromStyledChars,
227
227
  wordBreakStyledChars,
228
228
  wrapStyledChars
229
- } from "./chunk-7YXHVH7Y.js";
229
+ } from "./chunk-V3MODYYD.js";
230
230
  import {
231
231
  handleAutoUpdate,
232
232
  isDevelopment,
233
233
  relaunchApp,
234
234
  require_semver,
235
235
  setUpdateHandler
236
- } from "./chunk-QQNZHLIF.js";
236
+ } from "./chunk-H3XZAPPM.js";
237
237
  import {
238
238
  isTodoList,
239
239
  mapCoreStatusToDisplayStatus,
240
240
  require_react
241
- } from "./chunk-KSDBDSBI.js";
241
+ } from "./chunk-EYFD4IXY.js";
242
242
  import {
243
243
  registerCleanup,
244
244
  removeCleanup,
245
245
  runExitCleanup,
246
246
  setupTtyCheck
247
- } from "./chunk-W7J7YSH2.js";
247
+ } from "./chunk-LMFXSDD5.js";
248
248
  import {
249
249
  ACTIVATE_SKILL_TOOL_NAME,
250
250
  AGENT_TOOL_NAME,
251
251
  ApiKeyUpdatedEvent,
252
+ ApprovalMode,
252
253
  AsyncFzf,
253
254
  AudioRecorder,
254
255
  AuthType,
255
256
  ChangeAuthRequestedError,
257
+ CompressionStatus,
256
258
  ConversationFinishedEvent,
259
+ CoreEvent,
260
+ CoreToolCallStatus,
257
261
  CreditPurchaseClickEvent,
258
262
  DEFAULT_GEMINI_FLASH_LITE_MODEL,
259
263
  DEFAULT_GEMINI_FLASH_MODEL,
@@ -276,14 +280,21 @@ import {
276
280
  GEMMA_4_31B_IT_MODEL,
277
281
  GLOB_DISPLAY_NAME,
278
282
  GREP_DISPLAY_NAME,
283
+ GeminiCliOperation,
284
+ GeminiEventType,
279
285
  GitService,
280
286
  INTERACTIVE_GEMINI_SHELL_ERROR,
281
287
  IdeClient,
288
+ Kind,
282
289
  LS_DISPLAY_NAME,
283
290
  LegacyAgentProtocol,
284
291
  LlmRole,
285
292
  Logger,
286
293
  MAX_TOKENS_EXCEEDED_SUGGESTION,
294
+ MCPDiscoveryState,
295
+ MCPServerStatus,
296
+ MessageBusType,
297
+ MessageSenderType,
287
298
  ModelNotFoundError,
288
299
  ModelSlashCommandEvent,
289
300
  OTHER_BLOCKED_MESSAGE,
@@ -296,6 +307,7 @@ import {
296
307
  PREVIEW_GEMINI_MODEL,
297
308
  PolicyIntegrityManager,
298
309
  ProjectIdRequiredError,
310
+ QuestionType,
299
311
  READ_FILE_DISPLAY_NAME,
300
312
  READ_MANY_FILES_DISPLAY_NAME,
301
313
  RECITATION_BLOCKED_MESSAGE,
@@ -304,16 +316,22 @@ import {
304
316
  SAFETY_BLOCKED_MESSAGE,
305
317
  SHELL_TOOL_NAME,
306
318
  Scheduler,
319
+ SessionEndReason,
320
+ SessionStartSource,
307
321
  ShellExecutionService,
308
322
  SlashCommandStatus,
309
323
  Storage,
324
+ SubagentState,
310
325
  THINKING_ONLY_COMPRESS_SUGGESTION,
311
326
  TOPIC_PARAM_STRATEGIC_INTENT,
312
327
  TOPIC_PARAM_SUMMARY,
313
328
  TOPIC_PARAM_TITLE,
314
329
  TRUE_EMPTY_RESPONSE_MESSAGE,
315
330
  TerminalQuotaError,
331
+ ToolConfirmationOutcome,
332
+ ToolErrorType,
316
333
  TranscriptionFactory,
334
+ TrustLevel,
317
335
  UPDATE_TOPIC_DISPLAY_NAME,
318
336
  UPDATE_TOPIC_TOOL_NAME,
319
337
  UnauthorizedError,
@@ -326,6 +344,7 @@ import {
326
344
  WEB_FETCH_DISPLAY_NAME,
327
345
  WEB_SEARCH_DISPLAY_NAME,
328
346
  WRITE_FILE_DISPLAY_NAME,
347
+ WarningPriority,
329
348
  WhisperModelManager,
330
349
  addCalendarDays,
331
350
  addMCPStatusChangeListener,
@@ -447,7 +466,7 @@ import {
447
466
  validatePlanContent,
448
467
  validatePlanPath,
449
468
  writeToStdout
450
- } from "./chunk-BTH7KEMH.js";
469
+ } from "./chunk-4UW3VJTT.js";
451
470
  import "./chunk-W2AJR23G.js";
452
471
  import "./chunk-N7J54YNL.js";
453
472
  import "./chunk-L6PII3GR.js";
@@ -5074,7 +5093,7 @@ function calculateShellMaxLines(options) {
5074
5093
  if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
5075
5094
  return maxLinesBasedOnHeight;
5076
5095
  }
5077
- const isExecuting = status === "executing" /* Executing */;
5096
+ const isExecuting = status === CoreToolCallStatus.Executing;
5078
5097
  const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
5079
5098
  return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
5080
5099
  }
@@ -5110,13 +5129,13 @@ var formatToolArgs = (args) => {
5110
5129
  var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) => {
5111
5130
  let headerText;
5112
5131
  let headerColor = theme.text.secondary;
5113
- if (progress.state === "cancelled" /* CANCELLED */) {
5132
+ if (progress.state === SubagentState.CANCELLED) {
5114
5133
  headerText = `Subagent ${progress.agentName} was cancelled.`;
5115
5134
  headerColor = theme.status.warning;
5116
- } else if (progress.state === "error" /* ERROR */) {
5135
+ } else if (progress.state === SubagentState.ERROR) {
5117
5136
  headerText = `Subagent ${progress.agentName} failed.`;
5118
5137
  headerColor = theme.status.error;
5119
- } else if (progress.state === "completed" /* COMPLETED */) {
5138
+ } else if (progress.state === SubagentState.COMPLETED) {
5120
5139
  headerText = `Subagent ${progress.agentName} completed.`;
5121
5140
  headerColor = theme.status.success;
5122
5141
  } else {
@@ -5136,7 +5155,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5136
5155
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color, children: item.content }) })
5137
5156
  ] }, item.id);
5138
5157
  } else if (item.type === "tool_call") {
5139
- const statusSymbol = item.status === "running" /* RUNNING */ ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(build_default, { type: "dots" }) : item.status === "completed" /* COMPLETED */ ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: theme.status.success, children: TOOL_STATUS.SUCCESS }) : item.status === "cancelled" /* CANCELLED */ ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: theme.status.warning, bold: true, children: TOOL_STATUS.CANCELED }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: theme.status.error, children: TOOL_STATUS.ERROR });
5158
+ const statusSymbol = item.status === SubagentState.RUNNING ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(build_default, { type: "dots" }) : item.status === SubagentState.COMPLETED ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: theme.status.success, children: TOOL_STATUS.SUCCESS }) : item.status === SubagentState.CANCELLED ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: theme.status.warning, bold: true, children: TOOL_STATUS.CANCELED }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: theme.status.error, children: TOOL_STATUS.ERROR });
5140
5159
  const formattedArgs = item.description || formatToolArgs(item.args);
5141
5160
  const displayArgs = formattedArgs.length > 60 ? formattedArgs.slice(0, 60) + "..." : formattedArgs;
5142
5161
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Box_default, { flexDirection: "row", children: [
@@ -5147,7 +5166,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5147
5166
  {
5148
5167
  bold: true,
5149
5168
  color: theme.text.primary,
5150
- strikethrough: item.status === "cancelled" /* CANCELLED */,
5169
+ strikethrough: item.status === SubagentState.CANCELLED,
5151
5170
  children: item.displayName || item.content
5152
5171
  }
5153
5172
  ),
@@ -5156,7 +5175,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5156
5175
  {
5157
5176
  color: theme.text.secondary,
5158
5177
  wrap: "truncate",
5159
- strikethrough: item.status === "cancelled" /* CANCELLED */,
5178
+ strikethrough: item.status === SubagentState.CANCELLED,
5160
5179
  children: displayArgs
5161
5180
  }
5162
5181
  ) })
@@ -5176,7 +5195,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
5176
5195
  MarkdownDisplay,
5177
5196
  {
5178
5197
  text: safeJsonToMarkdown(progress.result),
5179
- isPending: progress.state !== "completed" /* COMPLETED */,
5198
+ isPending: progress.state !== SubagentState.COMPLETED,
5180
5199
  terminalWidth
5181
5200
  }
5182
5201
  )
@@ -5537,7 +5556,7 @@ var ToolActionsProvider = (props) => {
5537
5556
  }
5538
5557
  const details = tool.confirmationDetails;
5539
5558
  if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
5540
- const cliOutcome = outcome === "cancel" /* Cancel */ ? "rejected" : "accepted";
5559
+ const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? "rejected" : "accepted";
5541
5560
  if (ideClient) {
5542
5561
  void ideClient.resolveDiffFromCli(details.filePath, cliOutcome)?.catch((error) => {
5543
5562
  debugLogger.error(
@@ -5549,9 +5568,9 @@ var ToolActionsProvider = (props) => {
5549
5568
  }
5550
5569
  if (tool.correlationId) {
5551
5570
  await config.getMessageBus().publish({
5552
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
5571
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
5553
5572
  correlationId: tool.correlationId,
5554
- confirmed: outcome !== "cancel" /* Cancel */,
5573
+ confirmed: outcome !== ToolConfirmationOutcome.Cancel,
5555
5574
  requiresUserConfirmation: false,
5556
5575
  outcome,
5557
5576
  payload
@@ -5570,7 +5589,7 @@ var ToolActionsProvider = (props) => {
5570
5589
  );
5571
5590
  const cancel = (0, import_react10.useCallback)(
5572
5591
  async (callId) => {
5573
- await confirm(callId, "cancel" /* Cancel */);
5592
+ await confirm(callId, ToolConfirmationOutcome.Cancel);
5574
5593
  },
5575
5594
  [confirm]
5576
5595
  );
@@ -5691,7 +5710,7 @@ var ToolMessage = ({
5691
5710
  paddingX: 1,
5692
5711
  flexDirection: "column",
5693
5712
  children: [
5694
- status === "executing" /* Executing */ && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
5713
+ status === CoreToolCallStatus.Executing && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
5695
5714
  McpProgressIndicator,
5696
5715
  {
5697
5716
  progress,
@@ -5708,8 +5727,8 @@ var ToolMessage = ({
5708
5727
  terminalWidth: safeTerminalWidth,
5709
5728
  renderOutputAsMarkdown,
5710
5729
  hasFocus: isThisShellFocused2,
5711
- maxLines: kind === "agent" /* Agent */ && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
5712
- overflowDirection: kind === "agent" /* Agent */ ? "bottom" : "top"
5730
+ maxLines: kind === Kind.Agent && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
5731
+ overflowDirection: kind === Kind.Agent ? "bottom" : "top"
5713
5732
  }
5714
5733
  ),
5715
5734
  isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
@@ -6025,7 +6044,7 @@ function getInitialTrustState(settings, cwd5, isCurrentWorkspace) {
6025
6044
  settings.merged,
6026
6045
  process3.cwd()
6027
6046
  );
6028
- const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === "DO_NOT_TRUST" /* DO_NOT_TRUST */);
6047
+ const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === TrustLevel.DO_NOT_TRUST);
6029
6048
  return {
6030
6049
  currentTrustLevel: explicitTrustLevel,
6031
6050
  isInheritedTrustFromParent: !!(source === "file" && isInheritedTrust),
@@ -6070,7 +6089,7 @@ var usePermissionsModifyTrust = (onExit, addItem, targetDirectory) => {
6070
6089
  process3.cwd(),
6071
6090
  newConfig
6072
6091
  );
6073
- if (trustLevel === "DO_NOT_TRUST" /* DO_NOT_TRUST */ && isTrusted) {
6092
+ if (trustLevel === TrustLevel.DO_NOT_TRUST && isTrusted) {
6074
6093
  let message = "Note: This folder is still trusted because the connected IDE workspace is trusted.";
6075
6094
  if (source === "file") {
6076
6095
  message = "Note: This folder is still trusted because a parent folder is trusted.";
@@ -6144,18 +6163,18 @@ function PermissionsModifyTrustDialog({
6144
6163
  const TRUST_LEVEL_ITEMS = [
6145
6164
  {
6146
6165
  label: `Trust this folder (${dirName})`,
6147
- value: "TRUST_FOLDER" /* TRUST_FOLDER */,
6148
- key: "TRUST_FOLDER" /* TRUST_FOLDER */
6166
+ value: TrustLevel.TRUST_FOLDER,
6167
+ key: TrustLevel.TRUST_FOLDER
6149
6168
  },
6150
6169
  {
6151
6170
  label: `Trust parent folder (${parentFolder})`,
6152
- value: "TRUST_PARENT" /* TRUST_PARENT */,
6153
- key: "TRUST_PARENT" /* TRUST_PARENT */
6171
+ value: TrustLevel.TRUST_PARENT,
6172
+ key: TrustLevel.TRUST_PARENT
6154
6173
  },
6155
6174
  {
6156
6175
  label: "Don't trust",
6157
- value: "DO_NOT_TRUST" /* DO_NOT_TRUST */,
6158
- key: "DO_NOT_TRUST" /* DO_NOT_TRUST */
6176
+ value: TrustLevel.DO_NOT_TRUST,
6177
+ key: TrustLevel.DO_NOT_TRUST
6159
6178
  }
6160
6179
  ];
6161
6180
  const {
@@ -6396,7 +6415,7 @@ var ShellToolMessage = ({
6396
6415
  maxLinesLimit: maxLines
6397
6416
  });
6398
6417
  import_react15.default.useEffect(() => {
6399
- const isExecuting = status === "executing" /* Executing */;
6418
+ const isExecuting = status === CoreToolCallStatus.Executing;
6400
6419
  if (isExecuting && ptyId) {
6401
6420
  try {
6402
6421
  const childWidth = safeTerminalWidth - 4;
@@ -6610,13 +6629,13 @@ var SubagentGroupDisplay = ({
6610
6629
  const singleAgent = toolCalls[0].resultDisplay;
6611
6630
  if (isSubagentProgress(singleAgent)) {
6612
6631
  switch (singleAgent.state) {
6613
- case "completed" /* COMPLETED */:
6632
+ case SubagentState.COMPLETED:
6614
6633
  headerText = "Agent Completed";
6615
6634
  break;
6616
- case "cancelled" /* CANCELLED */:
6635
+ case SubagentState.CANCELLED:
6617
6636
  headerText = "Agent Cancelled";
6618
6637
  break;
6619
- case "error" /* ERROR */:
6638
+ case SubagentState.ERROR:
6620
6639
  headerText = "Agent Error";
6621
6640
  break;
6622
6641
  default:
@@ -6632,8 +6651,8 @@ var SubagentGroupDisplay = ({
6632
6651
  for (const tc of toolCalls) {
6633
6652
  const progress = tc.resultDisplay;
6634
6653
  if (isSubagentProgress(progress)) {
6635
- if (progress.state === "completed" /* COMPLETED */) completedCount++;
6636
- else if (progress.state === "running" /* RUNNING */) runningCount++;
6654
+ if (progress.state === SubagentState.COMPLETED) completedCount++;
6655
+ else if (progress.state === SubagentState.RUNNING) runningCount++;
6637
6656
  } else {
6638
6657
  runningCount++;
6639
6658
  }
@@ -6712,7 +6731,7 @@ var SubagentGroupDisplay = ({
6712
6731
  if (!isExpanded) {
6713
6732
  let content = "Starting...";
6714
6733
  let formattedArgs;
6715
- if (progress.state === "completed" /* COMPLETED */) {
6734
+ if (progress.state === SubagentState.COMPLETED) {
6716
6735
  if (progress.terminateReason && progress.terminateReason !== "GOAL") {
6717
6736
  content = `Finished Early (${progress.terminateReason})`;
6718
6737
  } else {
@@ -6726,17 +6745,17 @@ var SubagentGroupDisplay = ({
6726
6745
  formattedArgs = formatToolArgs(lastActivity.args);
6727
6746
  }
6728
6747
  }
6729
- const displayArgs = progress.state === "completed" /* COMPLETED */ ? "" : formattedArgs;
6748
+ const displayArgs = progress.state === SubagentState.COMPLETED ? "" : formattedArgs;
6730
6749
  const renderStatusIcon = () => {
6731
- const state = progress.state ?? "running" /* RUNNING */;
6750
+ const state = progress.state ?? SubagentState.RUNNING;
6732
6751
  switch (state) {
6733
- case "running" /* RUNNING */:
6752
+ case SubagentState.RUNNING:
6734
6753
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: "!" });
6735
- case "completed" /* COMPLETED */:
6754
+ case SubagentState.COMPLETED:
6736
6755
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.status.success, children: "\u2713" });
6737
- case "cancelled" /* CANCELLED */:
6756
+ case SubagentState.CANCELLED:
6738
6757
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.status.warning, children: "\u2139" });
6739
- case "error" /* ERROR */:
6758
+ case SubagentState.ERROR:
6740
6759
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.status.error, children: "\u2717" });
6741
6760
  default:
6742
6761
  return checkExhaustive(state);
@@ -6815,7 +6834,7 @@ function mapToDisplay(toolOrTools, options = {}) {
6815
6834
  let description;
6816
6835
  let renderOutputAsMarkdown = false;
6817
6836
  const displayName = call.tool?.displayName ?? call.request.name;
6818
- if (call.status === "error" /* Error */) {
6837
+ if (call.status === CoreToolCallStatus.Error) {
6819
6838
  description = JSON.stringify(call.request.args);
6820
6839
  } else {
6821
6840
  description = call.invocation.getDescription();
@@ -6838,27 +6857,27 @@ function mapToDisplay(toolOrTools, options = {}) {
6838
6857
  let progress = void 0;
6839
6858
  let progressTotal = void 0;
6840
6859
  switch (call.status) {
6841
- case "success" /* Success */:
6860
+ case CoreToolCallStatus.Success:
6842
6861
  resultDisplay = call.response.resultDisplay;
6843
6862
  outputFile = call.response.outputFile;
6844
6863
  break;
6845
- case "error" /* Error */:
6846
- case "cancelled" /* Cancelled */:
6864
+ case CoreToolCallStatus.Error:
6865
+ case CoreToolCallStatus.Cancelled:
6847
6866
  resultDisplay = call.response.resultDisplay;
6848
6867
  break;
6849
- case "awaiting_approval" /* AwaitingApproval */:
6868
+ case CoreToolCallStatus.AwaitingApproval:
6850
6869
  correlationId = call.correlationId;
6851
6870
  confirmationDetails = call.confirmationDetails;
6852
6871
  break;
6853
- case "executing" /* Executing */:
6872
+ case CoreToolCallStatus.Executing:
6854
6873
  resultDisplay = call.liveOutput;
6855
6874
  ptyId = call.pid;
6856
6875
  progressMessage = call.progressMessage;
6857
6876
  progress = call.progress;
6858
6877
  progressTotal = call.progressTotal;
6859
6878
  break;
6860
- case "scheduled" /* Scheduled */:
6861
- case "validating" /* Validating */:
6879
+ case CoreToolCallStatus.Scheduled:
6880
+ case CoreToolCallStatus.Validating:
6862
6881
  break;
6863
6882
  default: {
6864
6883
  const exhaustiveCheck = call;
@@ -6910,22 +6929,22 @@ var PAYLOAD_MAX_WIDTH = 120 + PAYLOAD_BORDER_CHROME_WIDTH;
6910
6929
  function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerminalHeight, isClickable) {
6911
6930
  const added = (diff.diffStat?.model_added_lines ?? 0) + (diff.diffStat?.user_added_lines ?? 0);
6912
6931
  const removed = (diff.diffStat?.model_removed_lines ?? 0) + (diff.diffStat?.user_removed_lines ?? 0);
6913
- const isAcceptedOrConfirming = status === "success" /* Success */ || status === "executing" /* Executing */ || status === "awaiting_approval" /* AwaitingApproval */;
6932
+ const isAcceptedOrConfirming = status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing || status === CoreToolCallStatus.AwaitingApproval;
6914
6933
  const addColor = isAcceptedOrConfirming ? theme.status.success : theme.text.secondary;
6915
6934
  const removeColor = isAcceptedOrConfirming ? theme.status.error : theme.text.secondary;
6916
6935
  const showDiffStat = !!diff.diffStat;
6917
6936
  const description = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { flexDirection: "row", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.text.secondary, wrap: "truncate-end", children: diff.fileName }) });
6918
6937
  let resultSummary = "";
6919
6938
  let resultColor = theme.text.secondary;
6920
- if (status === "awaiting_approval" /* AwaitingApproval */) {
6939
+ if (status === CoreToolCallStatus.AwaitingApproval) {
6921
6940
  resultSummary = "Confirming";
6922
- } else if (status === "success" /* Success */ || status === "executing" /* Executing */) {
6941
+ } else if (status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing) {
6923
6942
  resultSummary = "Accepted";
6924
6943
  resultColor = theme.text.accent;
6925
- } else if (status === "cancelled" /* Cancelled */) {
6944
+ } else if (status === CoreToolCallStatus.Cancelled) {
6926
6945
  resultSummary = "Rejected";
6927
6946
  resultColor = theme.status.error;
6928
- } else if (status === "error" /* Error */) {
6947
+ } else if (status === CoreToolCallStatus.Error) {
6929
6948
  resultSummary = typeof resultDisplay === "string" ? resultDisplay : "Failed";
6930
6949
  resultColor = theme.status.error;
6931
6950
  }
@@ -6956,7 +6975,7 @@ function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerm
6956
6975
  filename: diff.fileName,
6957
6976
  terminalWidth: Math.max(0, (terminalWidth || 0) - PAYLOAD_MARGIN_LEFT),
6958
6977
  availableTerminalHeight,
6959
- disableColor: status === "cancelled" /* Cancelled */
6978
+ disableColor: status === CoreToolCallStatus.Cancelled
6960
6979
  }
6961
6980
  );
6962
6981
  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_runtime25.jsxs)(Text, { color: theme.status.error, wrap: "truncate-end", children: [
7085
7104
  "\u2192 ",
@@ -7131,7 +7150,7 @@ var DenseToolMessage = (props) => {
7131
7150
  language: fileExtension,
7132
7151
  maxWidth: safeContentWidth,
7133
7152
  settings,
7134
- disableColor: status === "cancelled" /* Cancelled */,
7153
+ disableColor: status === CoreToolCallStatus.Cancelled,
7135
7154
  returnLines: true
7136
7155
  });
7137
7156
  } else {
@@ -7139,7 +7158,7 @@ var DenseToolMessage = (props) => {
7139
7158
  parsedLines,
7140
7159
  filename: diff.fileName,
7141
7160
  terminalWidth: safeContentWidth,
7142
- disableColor: status === "cancelled" /* Cancelled */
7161
+ disableColor: status === CoreToolCallStatus.Cancelled
7143
7162
  });
7144
7163
  }
7145
7164
  }, [diff, isExpanded, isAlternateBuffer, safeContentWidth, settings, status]);
@@ -7271,7 +7290,7 @@ function isToolExecuting(pendingHistoryItems) {
7271
7290
  return pendingHistoryItems.some((item) => {
7272
7291
  if (item && item.type === "tool_group") {
7273
7292
  return item.tools.some(
7274
- (tool) => "executing" /* Executing */ === tool.status
7293
+ (tool) => CoreToolCallStatus.Executing === tool.status
7275
7294
  );
7276
7295
  }
7277
7296
  return false;
@@ -7280,7 +7299,7 @@ function isToolExecuting(pendingHistoryItems) {
7280
7299
  function isToolAwaitingConfirmation(pendingHistoryItems) {
7281
7300
  return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
7282
7301
  (item) => item.tools.some(
7283
- (tool) => "awaiting_approval" /* AwaitingApproval */ === tool.status
7302
+ (tool) => CoreToolCallStatus.AwaitingApproval === tool.status
7284
7303
  )
7285
7304
  );
7286
7305
  }
@@ -7357,7 +7376,7 @@ var ToolGroupMessage = ({
7357
7376
  const groupedTools = (0, import_react19.useMemo)(() => {
7358
7377
  const groups = [];
7359
7378
  for (const tool of visibleToolCalls) {
7360
- if (tool.kind === "agent" /* Agent */) {
7379
+ if (tool.kind === Kind.Agent) {
7361
7380
  const lastGroup = groups[groups.length - 1];
7362
7381
  if (Array.isArray(lastGroup)) {
7363
7382
  lastGroup.push(tool);
@@ -7412,7 +7431,7 @@ var ToolGroupMessage = ({
7412
7431
  }, [groupedTools, isCompactModeEnabled, borderTopOverride]);
7413
7432
  let countToolCallsWithResults = 0;
7414
7433
  for (const tool of visibleToolCalls) {
7415
- if (tool.kind !== "agent" /* Agent */) {
7434
+ if (tool.kind !== Kind.Agent) {
7416
7435
  if (isCompactTool(tool, isCompactModeEnabled)) {
7417
7436
  if (tool.hasDensePayload ?? hasDensePayload(tool)) {
7418
7437
  countToolCallsWithResults++;
@@ -7603,7 +7622,7 @@ var ToolGroupDisplay = ({
7603
7622
  }
7604
7623
  const { tools, borderColor, borderDimColor, borderTop, borderBottom } = item;
7605
7624
  const visibleTools = tools.filter(
7606
- (t) => t.status !== "awaiting_approval" /* AwaitingApproval */
7625
+ (t) => t.status !== CoreToolCallStatus.AwaitingApproval
7607
7626
  );
7608
7627
  const noticeTools = visibleTools.filter((t) => t.format === "notice");
7609
7628
  const otherTools = visibleTools.filter(
@@ -7805,18 +7824,18 @@ function CompressionMessage({
7805
7824
  return "Compressing chat history";
7806
7825
  }
7807
7826
  switch (compressionStatus) {
7808
- case 1 /* COMPRESSED */:
7827
+ case CompressionStatus.COMPRESSED:
7809
7828
  return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
7810
- case 2 /* COMPRESSION_FAILED_INFLATED_TOKEN_COUNT */:
7829
+ case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
7811
7830
  if (originalTokens < 5e4) {
7812
7831
  return "Compression was not beneficial for this history size.";
7813
7832
  }
7814
7833
  return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
7815
- case 3 /* COMPRESSION_FAILED_TOKEN_COUNT_ERROR */:
7834
+ case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
7816
7835
  return "Could not compress chat history due to a token counting error.";
7817
- case 4 /* COMPRESSION_FAILED_EMPTY_SUMMARY */:
7836
+ case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
7818
7837
  return "Chat history compression failed: the model returned an empty summary.";
7819
- case 5 /* NOOP */:
7838
+ case CompressionStatus.NOOP:
7820
7839
  return "Nothing to compress.";
7821
7840
  default:
7822
7841
  return "";
@@ -8254,8 +8273,8 @@ var ModelUsageTable = ({ models }) => {
8254
8273
  );
8255
8274
  roleEntries.sort(([a], [b]) => {
8256
8275
  if (a === b) return 0;
8257
- if (a === "main" /* MAIN */) return -1;
8258
- if (b === "main" /* MAIN */) return 1;
8276
+ if (a === LlmRole.MAIN) return -1;
8277
+ if (b === LlmRole.MAIN) return 1;
8259
8278
  return a.localeCompare(b);
8260
8279
  });
8261
8280
  roleEntries.forEach(([role, roleMetrics]) => {
@@ -8586,8 +8605,8 @@ var ModelStatsDisplay = ({
8586
8605
  return validRoles.includes(role);
8587
8606
  }).sort((a, b) => {
8588
8607
  if (a === b) return 0;
8589
- if (a === "main" /* MAIN */) return -1;
8590
- if (b === "main" /* MAIN */) return 1;
8608
+ if (a === LlmRole.MAIN) return -1;
8609
+ if (b === LlmRole.MAIN) return 1;
8591
8610
  return a.localeCompare(b);
8592
8611
  });
8593
8612
  const createRow = (metric, getValue, options = {}) => {
@@ -9732,7 +9751,7 @@ var McpStatus = ({
9732
9751
  );
9733
9752
  const originalStatus = serverStatus(serverName);
9734
9753
  const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
9735
- const status = originalStatus === "disconnected" /* DISCONNECTED */ && hasCachedItems ? "connected" /* CONNECTED */ : originalStatus;
9754
+ const status = originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems ? MCPServerStatus.CONNECTED : originalStatus;
9736
9755
  let statusIndicator = "";
9737
9756
  let statusText = "";
9738
9757
  let statusColor = theme.text.primary;
@@ -9744,17 +9763,17 @@ var McpStatus = ({
9744
9763
  statusColor = theme.text.secondary;
9745
9764
  } else {
9746
9765
  switch (status) {
9747
- case "connected" /* CONNECTED */:
9766
+ case MCPServerStatus.CONNECTED:
9748
9767
  statusIndicator = "\u{1F7E2}";
9749
9768
  statusText = "Ready";
9750
9769
  statusColor = theme.status.success;
9751
9770
  break;
9752
- case "connecting" /* CONNECTING */:
9771
+ case MCPServerStatus.CONNECTING:
9753
9772
  statusIndicator = "\u{1F504}";
9754
9773
  statusText = "Starting... (first startup may take longer)";
9755
9774
  statusColor = theme.status.warning;
9756
9775
  break;
9757
- case "disconnected" /* DISCONNECTED */:
9776
+ case MCPServerStatus.DISCONNECTED:
9758
9777
  default:
9759
9778
  statusIndicator = "\u{1F534}";
9760
9779
  statusText = "Disconnected";
@@ -9802,12 +9821,12 @@ var McpStatus = ({
9802
9821
  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
9803
9822
  " - ",
9804
9823
  statusText,
9805
- status === "connected" /* CONNECTED */ && parts.length > 0 && ` (${parts.join(", ")})`
9824
+ status === MCPServerStatus.CONNECTED && parts.length > 0 && ` (${parts.join(", ")})`
9806
9825
  ] }),
9807
9826
  authStatusNode
9808
9827
  ] }),
9809
- status === "connecting" /* CONNECTING */ && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
9810
- status === "disconnected" /* DISCONNECTED */ && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
9828
+ status === MCPServerStatus.CONNECTING && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
9829
+ status === MCPServerStatus.DISCONNECTED && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
9811
9830
  " (",
9812
9831
  toolCount,
9813
9832
  " tools cached)"
@@ -10385,7 +10404,7 @@ var Notifications = () => {
10385
10404
  if (dismissed) return [];
10386
10405
  const counts = persistentState.get("startupWarningCounts") || {};
10387
10406
  return startupWarnings.filter((w) => {
10388
- if (w.priority === "low" /* Low */) {
10407
+ if (w.priority === WarningPriority.Low) {
10389
10408
  const count = counts[w.id] || 0;
10390
10409
  return count < MAX_STARTUP_WARNING_SHOW_COUNT;
10391
10410
  }
@@ -10398,7 +10417,7 @@ var Notifications = () => {
10398
10417
  const counts = { ...persistentState.get("startupWarningCounts") || {} };
10399
10418
  let changed = false;
10400
10419
  visibleWarnings.forEach((w) => {
10401
- if (w.priority === "low" /* Low */) {
10420
+ if (w.priority === WarningPriority.Low) {
10402
10421
  counts[w.id] = (counts[w.id] || 0) + 1;
10403
10422
  changed = true;
10404
10423
  }
@@ -10505,7 +10524,7 @@ var UserIdentity = ({ config }) => {
10505
10524
  }
10506
10525
  return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { flexDirection: "column", children: [
10507
10526
  /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { children: [
10508
- /* @__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: [
10527
+ /* @__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: [
10509
10528
  /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { bold: true, children: [
10510
10529
  "Signed in with Google",
10511
10530
  email ? ":" : ""
@@ -10897,7 +10916,7 @@ var import_react31 = __toESM(require_react(), 1);
10897
10916
  function getConfirmingToolState(pendingHistoryItems) {
10898
10917
  const allPendingTools = getAllToolCalls(pendingHistoryItems);
10899
10918
  const confirmingTools = allPendingTools.filter(
10900
- (tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
10919
+ (tool) => tool.status === CoreToolCallStatus.AwaitingApproval
10901
10920
  );
10902
10921
  if (confirmingTools.length === 0) {
10903
10922
  return null;
@@ -12207,7 +12226,7 @@ var ExitPlanModeDialog = ({
12207
12226
  {
12208
12227
  questions: [
12209
12228
  {
12210
- type: "choice" /* CHOICE */,
12229
+ type: QuestionType.CHOICE,
12211
12230
  header: "Approval",
12212
12231
  question: planContent,
12213
12232
  options: [
@@ -12228,9 +12247,9 @@ var ExitPlanModeDialog = ({
12228
12247
  onSubmit: (answers) => {
12229
12248
  const answer = answers["0"];
12230
12249
  if (answer === "Yes, automatically accept edits" /* Auto */) {
12231
- onApprove("autoEdit" /* AUTO_EDIT */);
12250
+ onApprove(ApprovalMode.AUTO_EDIT);
12232
12251
  } else if (answer === "Yes, manually accept edits" /* Manual */) {
12233
- onApprove("default" /* DEFAULT */);
12252
+ onApprove(ApprovalMode.DEFAULT);
12234
12253
  } else if (answer) {
12235
12254
  onFeedback(answer);
12236
12255
  }
@@ -12443,7 +12462,7 @@ ${deceptiveUrlWarnings.map(
12443
12462
  (0, import_react36.useEffect)(() => {
12444
12463
  if (isCancelling) {
12445
12464
  setIsCancelling(false);
12446
- handleConfirm("cancel" /* Cancel */);
12465
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12447
12466
  }
12448
12467
  }, [isCancelling, handleConfirm]);
12449
12468
  const handleSelect = (0, import_react36.useCallback)(
@@ -12456,19 +12475,19 @@ ${deceptiveUrlWarnings.map(
12456
12475
  if (!confirmationDetails.isModifying) {
12457
12476
  options2.push({
12458
12477
  label: "Allow once",
12459
- value: "proceed_once" /* ProceedOnce */,
12478
+ value: ToolConfirmationOutcome.ProceedOnce,
12460
12479
  key: "Allow once"
12461
12480
  });
12462
12481
  if (isTrustedFolder && !confirmationDetails.isBuildFile) {
12463
12482
  options2.push({
12464
12483
  label: "Allow for this session",
12465
- value: "proceed_always" /* ProceedAlways */,
12484
+ value: ToolConfirmationOutcome.ProceedAlways,
12466
12485
  key: "Allow for this session"
12467
12486
  });
12468
12487
  if (allowPermanentApproval) {
12469
12488
  options2.push({
12470
12489
  label: "Allow for this file in all future sessions",
12471
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12490
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12472
12491
  key: "Allow for this file in all future sessions"
12473
12492
  });
12474
12493
  }
@@ -12476,45 +12495,45 @@ ${deceptiveUrlWarnings.map(
12476
12495
  if (!config.getIdeMode() || !isDiffingEnabled) {
12477
12496
  options2.push({
12478
12497
  label: "Modify with external editor",
12479
- value: "modify_with_editor" /* ModifyWithEditor */,
12498
+ value: ToolConfirmationOutcome.ModifyWithEditor,
12480
12499
  key: "Modify with external editor"
12481
12500
  });
12482
12501
  }
12483
12502
  options2.push({
12484
12503
  label: "No, suggest changes (esc)",
12485
- value: "cancel" /* Cancel */,
12504
+ value: ToolConfirmationOutcome.Cancel,
12486
12505
  key: "No, suggest changes (esc)"
12487
12506
  });
12488
12507
  }
12489
12508
  } else if (confirmationDetails.type === "sandbox_expansion") {
12490
12509
  options2.push({
12491
12510
  label: "Allow once",
12492
- value: "proceed_once" /* ProceedOnce */,
12511
+ value: ToolConfirmationOutcome.ProceedOnce,
12493
12512
  key: "Allow once"
12494
12513
  });
12495
12514
  if (isTrustedFolder) {
12496
12515
  options2.push({
12497
12516
  label: "Allow for this session",
12498
- value: "proceed_always" /* ProceedAlways */,
12517
+ value: ToolConfirmationOutcome.ProceedAlways,
12499
12518
  key: "Allow for this session"
12500
12519
  });
12501
12520
  if (allowPermanentApproval) {
12502
12521
  options2.push({
12503
12522
  label: "Allow for all future sessions",
12504
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12523
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12505
12524
  key: "Allow for all future sessions"
12506
12525
  });
12507
12526
  }
12508
12527
  }
12509
12528
  options2.push({
12510
12529
  label: "No, suggest changes (esc)",
12511
- value: "cancel" /* Cancel */,
12530
+ value: ToolConfirmationOutcome.Cancel,
12512
12531
  key: "No, suggest changes (esc)"
12513
12532
  });
12514
12533
  } else if (confirmationDetails.type === "exec") {
12515
12534
  options2.push({
12516
12535
  label: "Allow once",
12517
- value: "proceed_once" /* ProceedOnce */,
12536
+ value: ToolConfirmationOutcome.ProceedOnce,
12518
12537
  key: "Allow once"
12519
12538
  });
12520
12539
  const hasUntrustedFlags = confirmationDetails.untrustedFlags && confirmationDetails.untrustedFlags.length > 0;
@@ -12522,75 +12541,75 @@ ${deceptiveUrlWarnings.map(
12522
12541
  if (isTrustedFolder && !hasUntrustedFlags && !hasModifiedBuildFiles) {
12523
12542
  options2.push({
12524
12543
  label: `Allow for this session`,
12525
- value: "proceed_always" /* ProceedAlways */,
12544
+ value: ToolConfirmationOutcome.ProceedAlways,
12526
12545
  key: `Allow for this session`
12527
12546
  });
12528
12547
  if (allowPermanentApproval) {
12529
12548
  options2.push({
12530
12549
  label: `Allow this command for all future sessions`,
12531
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12550
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12532
12551
  key: `Allow for all future sessions`
12533
12552
  });
12534
12553
  }
12535
12554
  }
12536
12555
  options2.push({
12537
12556
  label: "No, suggest changes (esc)",
12538
- value: "cancel" /* Cancel */,
12557
+ value: ToolConfirmationOutcome.Cancel,
12539
12558
  key: "No, suggest changes (esc)"
12540
12559
  });
12541
12560
  } else if (confirmationDetails.type === "info") {
12542
12561
  options2.push({
12543
12562
  label: "Allow once",
12544
- value: "proceed_once" /* ProceedOnce */,
12563
+ value: ToolConfirmationOutcome.ProceedOnce,
12545
12564
  key: "Allow once"
12546
12565
  });
12547
12566
  if (isTrustedFolder) {
12548
12567
  options2.push({
12549
12568
  label: "Allow for this session",
12550
- value: "proceed_always" /* ProceedAlways */,
12569
+ value: ToolConfirmationOutcome.ProceedAlways,
12551
12570
  key: "Allow for this session"
12552
12571
  });
12553
12572
  if (allowPermanentApproval) {
12554
12573
  options2.push({
12555
12574
  label: "Allow for all future sessions",
12556
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12575
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12557
12576
  key: "Allow for all future sessions"
12558
12577
  });
12559
12578
  }
12560
12579
  }
12561
12580
  options2.push({
12562
12581
  label: "No, suggest changes (esc)",
12563
- value: "cancel" /* Cancel */,
12582
+ value: ToolConfirmationOutcome.Cancel,
12564
12583
  key: "No, suggest changes (esc)"
12565
12584
  });
12566
12585
  } else if (confirmationDetails.type === "mcp") {
12567
12586
  options2.push({
12568
12587
  label: "Allow once",
12569
- value: "proceed_once" /* ProceedOnce */,
12588
+ value: ToolConfirmationOutcome.ProceedOnce,
12570
12589
  key: "Allow once"
12571
12590
  });
12572
12591
  if (isTrustedFolder) {
12573
12592
  options2.push({
12574
12593
  label: "Allow tool for this session",
12575
- value: "proceed_always_tool" /* ProceedAlwaysTool */,
12594
+ value: ToolConfirmationOutcome.ProceedAlwaysTool,
12576
12595
  key: "Allow tool for this session"
12577
12596
  });
12578
12597
  options2.push({
12579
12598
  label: "Allow all server tools for this session",
12580
- value: "proceed_always_server" /* ProceedAlwaysServer */,
12599
+ value: ToolConfirmationOutcome.ProceedAlwaysServer,
12581
12600
  key: "Allow all server tools for this session"
12582
12601
  });
12583
12602
  if (allowPermanentApproval) {
12584
12603
  options2.push({
12585
12604
  label: "Allow tool for all future sessions",
12586
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
12605
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
12587
12606
  key: "Allow tool for all future sessions"
12588
12607
  });
12589
12608
  }
12590
12609
  }
12591
12610
  options2.push({
12592
12611
  label: "No, suggest changes (esc)",
12593
- value: "cancel" /* Cancel */,
12612
+ value: ToolConfirmationOutcome.Cancel,
12594
12613
  key: "No, suggest changes (esc)"
12595
12614
  });
12596
12615
  }
@@ -12629,7 +12648,7 @@ ${deceptiveUrlWarnings.map(
12629
12648
  const executionProps = confirmationDetails;
12630
12649
  const commandsToDisplay = executionProps.commands && executionProps.commands.length > 0 ? executionProps.commands : [executionProps.command];
12631
12650
  const containsRedirection = typeof executionProps.hasRedirection === "boolean" ? executionProps.hasRedirection : commandsToDisplay.some((cmd) => hasRedirection(cmd));
12632
- const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
12651
+ const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
12633
12652
  if (containsRedirection && !isAutoEdit) {
12634
12653
  extraInfoLines = 1;
12635
12654
  }
@@ -12656,7 +12675,7 @@ ${deceptiveUrlWarnings.map(
12656
12675
  const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
12657
12676
  if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
12658
12677
  const alwaysAndSaveIndex = options2.findIndex(
12659
- (o) => o.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */
12678
+ (o) => o.value === ToolConfirmationOutcome.ProceedAlwaysAndSave
12660
12679
  );
12661
12680
  if (alwaysAndSaveIndex !== -1) {
12662
12681
  initialIndex2 = alwaysAndSaveIndex;
@@ -12712,10 +12731,10 @@ Ensure you trust all modifications made to build files before approving executio
12712
12731
  {
12713
12732
  questions: confirmationDetails.questions,
12714
12733
  onSubmit: (answers) => {
12715
- handleConfirm("proceed_once" /* ProceedOnce */, { answers });
12734
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, { answers });
12716
12735
  },
12717
12736
  onCancel: () => {
12718
- handleConfirm("cancel" /* Cancel */);
12737
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12719
12738
  },
12720
12739
  width: safeTerminalWidth,
12721
12740
  availableHeight: bodyHeight
@@ -12736,19 +12755,19 @@ Ensure you trust all modifications made to build files before approving executio
12736
12755
  planPath: confirmationDetails.planPath,
12737
12756
  getPreferredEditor,
12738
12757
  onApprove: (approvalMode) => {
12739
- handleConfirm("proceed_once" /* ProceedOnce */, {
12758
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
12740
12759
  approved: true,
12741
12760
  approvalMode
12742
12761
  });
12743
12762
  },
12744
12763
  onFeedback: (feedback) => {
12745
- handleConfirm("proceed_once" /* ProceedOnce */, {
12764
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
12746
12765
  approved: false,
12747
12766
  feedback
12748
12767
  });
12749
12768
  },
12750
12769
  onCancel: () => {
12751
- handleConfirm("cancel" /* Cancel */);
12770
+ handleConfirm(ToolConfirmationOutcome.Cancel);
12752
12771
  },
12753
12772
  width: safeTerminalWidth,
12754
12773
  availableHeight: bodyHeight
@@ -12856,7 +12875,7 @@ Ensure you trust all modifications made to build files before approving executio
12856
12875
  const isShell = isShellTool(toolName);
12857
12876
  const commandsToDisplay = executionProps.commands && executionProps.commands.length > 1 ? executionProps.commands : [executionProps.command];
12858
12877
  const containsRedirection = typeof executionProps.hasRedirection === "boolean" ? executionProps.hasRedirection : commandsToDisplay.some((cmd) => hasRedirection(cmd));
12859
- const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
12878
+ const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
12860
12879
  let warnings = null;
12861
12880
  if (containsRedirection && !isAutoEdit) {
12862
12881
  const tipText = `To auto-accept, press ${formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */)}`;
@@ -13015,7 +13034,7 @@ Ensure you trust all modifications made to build files before approving executio
13015
13034
  const bodyOverflowDirection = confirmationDetails.type === "mcp" && isMcpToolDetailsExpanded ? "bottom" : "top";
13016
13035
  const renderRadioItem = (0, import_react36.useCallback)(
13017
13036
  (item, { titleColor }) => {
13018
- if (item.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */) {
13037
+ if (item.value === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
13019
13038
  return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(Text, { color: titleColor, wrap: "truncate", children: [
13020
13039
  item.label,
13021
13040
  " ",
@@ -13430,7 +13449,7 @@ var MainContent = () => {
13430
13449
  const hasConfirmationQueue = Boolean(
13431
13450
  showConfirmationQueue && confirmingTool
13432
13451
  );
13433
- const isVisiblePendingItem = (item) => item.type !== "tool_group" || item.tools.some((t) => t.status !== "awaiting_approval" /* AwaitingApproval */);
13452
+ const isVisiblePendingItem = (item) => item.type !== "tool_group" || item.tools.some((t) => t.status !== CoreToolCallStatus.AwaitingApproval);
13434
13453
  const visiblePendingCount = pendingHistoryItems.filter(isVisiblePendingItem).length;
13435
13454
  const shouldPartitionHeight = !isAlternateBufferOrTerminalBuffer && hasConfirmationQueue && visiblePendingCount > 0;
13436
13455
  const pendingCount = Math.max(1, visiblePendingCount);
@@ -15155,7 +15174,7 @@ async function validateAuthMethodWithSettings(authType, settings) {
15155
15174
  if (settings.merged.security.auth.useExternal) {
15156
15175
  return null;
15157
15176
  }
15158
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
15177
+ if (authType === AuthType.USE_GEMINI) {
15159
15178
  return null;
15160
15179
  }
15161
15180
  return validateAuthMethod(authType);
@@ -15207,7 +15226,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
15207
15226
  }
15208
15227
  return;
15209
15228
  }
15210
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
15229
+ if (authType === AuthType.USE_GEMINI) {
15211
15230
  const key = await reloadApiKey();
15212
15231
  if (!key) {
15213
15232
  setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
@@ -15290,31 +15309,31 @@ function AuthDialog({
15290
15309
  let items = [
15291
15310
  {
15292
15311
  label: "Sign in with Google",
15293
- value: "oauth-personal" /* LOGIN_WITH_GOOGLE */,
15294
- key: "oauth-personal" /* LOGIN_WITH_GOOGLE */
15312
+ value: AuthType.LOGIN_WITH_GOOGLE,
15313
+ key: AuthType.LOGIN_WITH_GOOGLE
15295
15314
  },
15296
15315
  ...process.env["CLOUD_SHELL"] === "true" ? [
15297
15316
  {
15298
15317
  label: "Use Cloud Shell user credentials",
15299
- value: "compute-default-credentials" /* COMPUTE_ADC */,
15300
- key: "compute-default-credentials" /* COMPUTE_ADC */
15318
+ value: AuthType.COMPUTE_ADC,
15319
+ key: AuthType.COMPUTE_ADC
15301
15320
  }
15302
15321
  ] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
15303
15322
  {
15304
15323
  label: "Use metadata server application default credentials",
15305
- value: "compute-default-credentials" /* COMPUTE_ADC */,
15306
- key: "compute-default-credentials" /* COMPUTE_ADC */
15324
+ value: AuthType.COMPUTE_ADC,
15325
+ key: AuthType.COMPUTE_ADC
15307
15326
  }
15308
15327
  ] : [],
15309
15328
  {
15310
15329
  label: "Use Gemini API Key",
15311
- value: "gemini-api-key" /* USE_GEMINI */,
15312
- key: "gemini-api-key" /* USE_GEMINI */
15330
+ value: AuthType.USE_GEMINI,
15331
+ key: AuthType.USE_GEMINI
15313
15332
  },
15314
15333
  {
15315
15334
  label: "Vertex AI",
15316
- value: "vertex-ai" /* USE_VERTEX_AI */,
15317
- key: "vertex-ai" /* USE_VERTEX_AI */
15335
+ value: AuthType.USE_VERTEX_AI,
15336
+ key: AuthType.USE_VERTEX_AI
15318
15337
  }
15319
15338
  ];
15320
15339
  if (settings.merged.security.auth.enforcedType) {
@@ -15336,9 +15355,9 @@ function AuthDialog({
15336
15355
  return item.value === defaultAuthType;
15337
15356
  }
15338
15357
  if (process.env["GEMINI_API_KEY"]) {
15339
- return item.value === "gemini-api-key" /* USE_GEMINI */;
15358
+ return item.value === AuthType.USE_GEMINI;
15340
15359
  }
15341
- return item.value === "oauth-personal" /* LOGIN_WITH_GOOGLE */;
15360
+ return item.value === AuthType.LOGIN_WITH_GOOGLE;
15342
15361
  });
15343
15362
  if (settings.merged.security.auth.enforcedType) {
15344
15363
  initialAuthIndex = 0;
@@ -15349,14 +15368,14 @@ function AuthDialog({
15349
15368
  return;
15350
15369
  }
15351
15370
  if (authType) {
15352
- const needsRestart = authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ || authType === "vertex-ai" /* USE_VERTEX_AI */ && process.env["CLOUD_SHELL"] === "true";
15371
+ const needsRestart = authType === AuthType.LOGIN_WITH_GOOGLE || authType === AuthType.USE_VERTEX_AI && process.env["CLOUD_SHELL"] === "true";
15353
15372
  if (needsRestart) {
15354
15373
  setAuthContext({ requiresRestart: true });
15355
15374
  } else {
15356
15375
  setAuthContext({});
15357
15376
  }
15358
15377
  const currentAuthType = settings.merged.security?.auth?.selectedType;
15359
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ || currentAuthType === "oauth-personal" /* LOGIN_WITH_GOOGLE */) {
15378
+ if (authType === AuthType.LOGIN_WITH_GOOGLE || currentAuthType === AuthType.LOGIN_WITH_GOOGLE) {
15360
15379
  try {
15361
15380
  await clearCachedCredentialFile();
15362
15381
  } catch (error) {
@@ -15364,13 +15383,13 @@ function AuthDialog({
15364
15383
  onAuthError(
15365
15384
  "Failed to clear cached credentials: " + (error instanceof Error ? error.message : String(error))
15366
15385
  );
15367
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */) {
15386
+ if (authType === AuthType.LOGIN_WITH_GOOGLE) {
15368
15387
  return;
15369
15388
  }
15370
15389
  }
15371
15390
  }
15372
15391
  settings.setValue(scope, "security.auth.selectedType", authType);
15373
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
15392
+ if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
15374
15393
  setExiting(true);
15375
15394
  setTimeout(() => {
15376
15395
  void relaunchApp({ overrideAuthType: authType }).catch((err) => {
@@ -15380,7 +15399,7 @@ function AuthDialog({
15380
15399
  }, 100);
15381
15400
  return;
15382
15401
  }
15383
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
15402
+ if (authType === AuthType.USE_GEMINI) {
15384
15403
  setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
15385
15404
  return;
15386
15405
  }
@@ -16194,11 +16213,11 @@ var PrivacyNoticeText = ({
16194
16213
  }) => {
16195
16214
  const authType = config.getContentGeneratorConfig()?.authType;
16196
16215
  switch (authType) {
16197
- case "gemini-api-key" /* USE_GEMINI */:
16216
+ case AuthType.USE_GEMINI:
16198
16217
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GeminiPrivacyNotice, { onExit });
16199
- case "vertex-ai" /* USE_VERTEX_AI */:
16218
+ case AuthType.USE_VERTEX_AI:
16200
16219
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudPaidPrivacyNotice, { onExit });
16201
- case "oauth-personal" /* LOGIN_WITH_GOOGLE */:
16220
+ case AuthType.LOGIN_WITH_GOOGLE:
16202
16221
  default:
16203
16222
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudFreePrivacyNotice, { config, onExit });
16204
16223
  }
@@ -16258,7 +16277,7 @@ function ProQuotaDialog({
16258
16277
  value: "retry_always",
16259
16278
  key: "retry_always"
16260
16279
  },
16261
- ...authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && !isUltra ? [
16280
+ ...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
16262
16281
  {
16263
16282
  label: "Upgrade for higher limits",
16264
16283
  value: "upgrade",
@@ -17431,7 +17450,7 @@ function ModelDialog({ onClose }) {
17431
17450
  const useLatestFlash = config?.hasLatestFlashGAAccess?.() ?? false;
17432
17451
  const useLatestFlashLite = config?.hasLatestFlashLiteGAAccess?.() ?? false;
17433
17452
  const selectedAuthType = settings.merged.security.auth.selectedType;
17434
- const useCustomToolModel = useGemini31 && selectedAuthType === "gemini-api-key" /* USE_GEMINI */;
17453
+ const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
17435
17454
  const manualModelSelected = (0, import_react54.useMemo)(() => {
17436
17455
  if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
17437
17456
  const def = config.getModelConfigService().getModelDefinition(preferredModel);
@@ -18759,10 +18778,10 @@ function initializeConsoleStore() {
18759
18778
  globalConsoleMessages = [];
18760
18779
  globalErrorCount = 0;
18761
18780
  notifyListeners();
18762
- coreEvents.off("console-log" /* ConsoleLog */, handleConsoleLog);
18763
- coreEvents.off("output" /* Output */, handleOutput);
18764
- coreEvents.on("console-log" /* ConsoleLog */, handleConsoleLog);
18765
- coreEvents.on("output" /* Output */, handleOutput);
18781
+ coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
18782
+ coreEvents.off(CoreEvent.Output, handleOutput);
18783
+ coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
18784
+ coreEvents.on(CoreEvent.Output, handleOutput);
18766
18785
  }
18767
18786
  function notifyListeners() {
18768
18787
  for (const listener of listeners) {
@@ -20905,7 +20924,7 @@ function usePromptCompletion({
20905
20924
  { model: "prompt-completion" },
20906
20925
  contents,
20907
20926
  signal,
20908
- "utility_autocomplete" /* UTILITY_AUTOCOMPLETE */
20927
+ LlmRole.UTILITY_AUTOCOMPLETE
20909
20928
  );
20910
20929
  if (signal.aborted) {
20911
20930
  return;
@@ -22987,9 +23006,9 @@ var InputPrompt = ({
22987
23006
  onSuggestionsVisibilityChange(shouldShowSuggestions);
22988
23007
  }
22989
23008
  }, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
22990
- const showAutoAcceptStyling = !shellModeActive && approvalMode === "autoEdit" /* AUTO_EDIT */;
22991
- const showYoloStyling = !shellModeActive && approvalMode === "yolo" /* YOLO */;
22992
- const showPlanStyling = !shellModeActive && approvalMode === "plan" /* PLAN */;
23009
+ const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
23010
+ const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
23011
+ const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
22993
23012
  let statusColor;
22994
23013
  let statusText = "";
22995
23014
  if (shellModeActive) {
@@ -23837,22 +23856,22 @@ var ApprovalModeIndicator = ({
23837
23856
  const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
23838
23857
  const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
23839
23858
  switch (approvalMode) {
23840
- case "autoEdit" /* AUTO_EDIT */:
23859
+ case ApprovalMode.AUTO_EDIT:
23841
23860
  textColor = theme.status.warning;
23842
23861
  textContent = "auto-accept edits";
23843
23862
  subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
23844
23863
  break;
23845
- case "plan" /* PLAN */:
23864
+ case ApprovalMode.PLAN:
23846
23865
  textColor = theme.status.success;
23847
23866
  textContent = "plan";
23848
23867
  subText = `${cycleHint} to manual`;
23849
23868
  break;
23850
- case "yolo" /* YOLO */:
23869
+ case ApprovalMode.YOLO:
23851
23870
  textColor = theme.status.error;
23852
23871
  textContent = "YOLO";
23853
23872
  subText = yoloHint;
23854
23873
  break;
23855
- case "default" /* DEFAULT */:
23874
+ case ApprovalMode.DEFAULT:
23856
23875
  default:
23857
23876
  textColor = theme.text.accent;
23858
23877
  textContent = "";
@@ -23900,7 +23919,7 @@ var useComposerStatus = () => {
23900
23919
  (item) => item.type === "tool_group"
23901
23920
  ).some(
23902
23921
  (item) => item.tools.some(
23903
- (tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
23922
+ (tool) => tool.status === CoreToolCallStatus.AwaitingApproval
23904
23923
  )
23905
23924
  ),
23906
23925
  [uiState.pendingHistoryItems]
@@ -23915,13 +23934,13 @@ var useComposerStatus = () => {
23915
23934
  const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
23916
23935
  if (hideMinimalModeHintWhileBusy) return null;
23917
23936
  switch (showApprovalModeIndicator) {
23918
- case "yolo" /* YOLO */:
23937
+ case ApprovalMode.YOLO:
23919
23938
  return { text: "YOLO", color: theme.status.error };
23920
- case "plan" /* PLAN */:
23939
+ case ApprovalMode.PLAN:
23921
23940
  return { text: "plan", color: theme.status.success };
23922
- case "autoEdit" /* AUTO_EDIT */:
23941
+ case ApprovalMode.AUTO_EDIT:
23923
23942
  return { text: "auto edit", color: theme.status.warning };
23924
- case "default" /* DEFAULT */:
23943
+ case ApprovalMode.DEFAULT:
23925
23944
  default:
23926
23945
  return null;
23927
23946
  }
@@ -24291,7 +24310,7 @@ var ConfigInitDisplay = ({
24291
24310
  let connected = 0;
24292
24311
  const connecting = [];
24293
24312
  for (const [name, client] of clients.entries()) {
24294
- if (client.getStatus() === "connected" /* CONNECTED */) {
24313
+ if (client.getStatus() === MCPServerStatus.CONNECTED) {
24295
24314
  connected++;
24296
24315
  } else {
24297
24316
  connecting.push(name);
@@ -24313,9 +24332,9 @@ var ConfigInitDisplay = ({
24313
24332
  );
24314
24333
  }
24315
24334
  };
24316
- coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
24335
+ coreEvents.on(CoreEvent.McpClientUpdate, onChange);
24317
24336
  return () => {
24318
- coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
24337
+ coreEvents.off(CoreEvent.McpClientUpdate, onChange);
24319
24338
  };
24320
24339
  }, [initialMessage]);
24321
24340
  return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Text, { children: [
@@ -25061,7 +25080,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
25061
25080
  callId,
25062
25081
  name: SHELL_COMMAND_NAME,
25063
25082
  description: rawQuery,
25064
- status: "executing" /* Executing */,
25083
+ status: CoreToolCallStatus.Executing,
25065
25084
  isClientInitiated: true,
25066
25085
  resultDisplay: "",
25067
25086
  confirmationDetails: void 0
@@ -25202,7 +25221,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
25202
25221
  mainContent = result.output.trim() || "(Command produced no output)";
25203
25222
  }
25204
25223
  let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
25205
- let finalStatus = "success" /* Success */;
25224
+ let finalStatus = CoreToolCallStatus.Success;
25206
25225
  const prependToAnsiOutput = (output, text) => {
25207
25226
  const newLines = text.split("\n").map((line) => [
25208
25227
  {
@@ -25221,20 +25240,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
25221
25240
  };
25222
25241
  let prefix = "";
25223
25242
  if (result.error) {
25224
- finalStatus = "error" /* Error */;
25243
+ finalStatus = CoreToolCallStatus.Error;
25225
25244
  prefix = result.error.message;
25226
25245
  } else if (result.aborted) {
25227
- finalStatus = "cancelled" /* Cancelled */;
25246
+ finalStatus = CoreToolCallStatus.Cancelled;
25228
25247
  prefix = "Command was cancelled.";
25229
25248
  } else if (result.backgrounded) {
25230
- finalStatus = "success" /* Success */;
25249
+ finalStatus = CoreToolCallStatus.Success;
25231
25250
  finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
25232
25251
  mainContent = finalOutput;
25233
25252
  } else if (result.signal) {
25234
- finalStatus = "error" /* Error */;
25253
+ finalStatus = CoreToolCallStatus.Error;
25235
25254
  prefix = `Command terminated by signal: ${result.signal}.`;
25236
25255
  } else if (result.exitCode !== 0) {
25237
- finalStatus = "error" /* Error */;
25256
+ finalStatus = CoreToolCallStatus.Error;
25238
25257
  prefix = `Command exited with code ${result.exitCode}.`;
25239
25258
  }
25240
25259
  if (prefix) {
@@ -25260,7 +25279,7 @@ ${mainContent}`;
25260
25279
  status: finalStatus,
25261
25280
  resultDisplay: finalOutput
25262
25281
  };
25263
- if (finalStatus !== "cancelled" /* Cancelled */) {
25282
+ if (finalStatus !== CoreToolCallStatus.Cancelled) {
25264
25283
  addItemToHistory(
25265
25284
  {
25266
25285
  type: "tool_group",
@@ -26286,13 +26305,13 @@ function useQuotaAndFallback({
26286
26305
  error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
26287
26306
  `/stats model for usage details`,
26288
26307
  `/model to switch models.`,
26289
- contentGeneratorConfig?.authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? `/auth to switch to API key.` : null
26308
+ contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
26290
26309
  ].filter(Boolean);
26291
26310
  message = messageLines.join("\n");
26292
26311
  }
26293
26312
  } else if (error instanceof ModelNotFoundError) {
26294
26313
  isModelNotFoundError = true;
26295
- if (contentGeneratorConfig?.authType === "vertex-ai" /* USE_VERTEX_AI */ && VALID_GEMINI_MODELS.has(failedModel)) {
26314
+ if (contentGeneratorConfig?.authType === AuthType.USE_VERTEX_AI && VALID_GEMINI_MODELS.has(failedModel)) {
26296
26315
  const location = process.env["GOOGLE_CLOUD_LOCATION"] || "your configured region";
26297
26316
  const messageLines = [
26298
26317
  `Model "${failedModel}" is not available in region "${location}".`,
@@ -26486,7 +26505,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
26486
26505
  );
26487
26506
  setEditorError(null);
26488
26507
  setIsEditorDialogOpen(false);
26489
- coreEvents.emit("editor-selected" /* EditorSelected */, { editor: editorType });
26508
+ coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
26490
26509
  } catch (error) {
26491
26510
  setEditorError(`Failed to set editor preference: ${error}`);
26492
26511
  }
@@ -26495,7 +26514,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
26495
26514
  );
26496
26515
  const exitEditorDialog = (0, import_react92.useCallback)(() => {
26497
26516
  setIsEditorDialogOpen(false);
26498
- coreEvents.emit("editor-selected" /* EditorSelected */, { editor: void 0 });
26517
+ coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
26499
26518
  }, []);
26500
26519
  return {
26501
26520
  isEditorDialogOpen,
@@ -26883,7 +26902,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
26883
26902
  canonicalPath: resolvedCommandPath
26884
26903
  } = parseSlashCommand(trimmed, commands);
26885
26904
  if (!commandToExecute) {
26886
- const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === "in_progress" /* IN_PROGRESS */;
26905
+ const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
26887
26906
  if (isMcpLoading) {
26888
26907
  setIsProcessing(true);
26889
26908
  if (addToHistory) {
@@ -27064,7 +27083,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
27064
27083
  onConfirm: async (resolvedOutcome) => {
27065
27084
  resolve3({
27066
27085
  outcome: resolvedOutcome,
27067
- approvedCommands: resolvedOutcome === "cancel" /* Cancel */ ? [] : result.commandsToConfirm
27086
+ approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
27068
27087
  });
27069
27088
  }
27070
27089
  };
@@ -27072,7 +27091,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
27072
27091
  callId,
27073
27092
  name: "Expansion",
27074
27093
  description: "Command expansion needs shell access",
27075
- status: "awaiting_approval" /* AwaitingApproval */,
27094
+ status: CoreToolCallStatus.AwaitingApproval,
27076
27095
  isClientInitiated: true,
27077
27096
  resultDisplay: void 0,
27078
27097
  confirmationDetails
@@ -27083,7 +27102,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
27083
27102
  });
27084
27103
  });
27085
27104
  setPendingItem(null);
27086
- if (outcome === "cancel" /* Cancel */ || !approvedCommands || approvedCommands.length === 0) {
27105
+ if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
27087
27106
  addItem(
27088
27107
  {
27089
27108
  type: "info" /* INFO */,
@@ -27093,7 +27112,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
27093
27112
  );
27094
27113
  return { type: "handled" };
27095
27114
  }
27096
- if (outcome === "proceed_always" /* ProceedAlways */) {
27115
+ if (outcome === ToolConfirmationOutcome.ProceedAlways) {
27097
27116
  setSessionShellAllowlist(
27098
27117
  (prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
27099
27118
  );
@@ -27595,7 +27614,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
27595
27614
  const handler = (event) => {
27596
27615
  const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
27597
27616
  const hasExecuting = event.toolCalls.some(
27598
- (tc) => tc.status === "executing" /* Executing */ || (tc.status === "success" /* Success */ || tc.status === "error" /* Error */) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
27617
+ (tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
27599
27618
  );
27600
27619
  if (hasExecuting) {
27601
27620
  setLastToolOutputTime(Date.now());
@@ -27604,7 +27623,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
27604
27623
  const prevCalls = prev[event.schedulerId] ?? [];
27605
27624
  const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
27606
27625
  const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
27607
- (tc) => tc.status === "awaiting_approval" /* AwaitingApproval */ || prevCallIds.has(tc.request.callId)
27626
+ (tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
27608
27627
  );
27609
27628
  if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
27610
27629
  return prev;
@@ -27616,9 +27635,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
27616
27635
  };
27617
27636
  });
27618
27637
  };
27619
- messageBus.subscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
27638
+ messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
27620
27639
  return () => {
27621
- messageBus.unsubscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
27640
+ messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
27622
27641
  };
27623
27642
  }, [messageBus, internalAdaptToolCalls]);
27624
27643
  (0, import_react99.useEffect)(() => {
@@ -27640,9 +27659,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
27640
27659
  };
27641
27660
  });
27642
27661
  };
27643
- messageBus.subscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
27662
+ messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
27644
27663
  return () => {
27645
- messageBus.unsubscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
27664
+ messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
27646
27665
  };
27647
27666
  }, [messageBus]);
27648
27667
  const schedule = (0, import_react99.useCallback)(
@@ -27741,8 +27760,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
27741
27760
  const prev = prevMap.get(coreCall.request.callId);
27742
27761
  const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
27743
27762
  let status = coreCall.status;
27744
- if ((status === "success" /* Success */ || status === "error" /* Error */) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
27745
- status = "executing" /* Executing */;
27763
+ if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
27764
+ status = CoreToolCallStatus.Executing;
27746
27765
  }
27747
27766
  return {
27748
27767
  ...coreCall,
@@ -27891,7 +27910,7 @@ var CANCELLED_TOOL_ERROR_MESSAGE = "[Operation Cancelled] Reason: User cancelled
27891
27910
  function createCancelledToolCall(request, tool, invocation) {
27892
27911
  const fallbackToolName = request.name.trim() || "generic_tool";
27893
27912
  return {
27894
- status: "cancelled" /* Cancelled */,
27913
+ status: CoreToolCallStatus.Cancelled,
27895
27914
  request,
27896
27915
  // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
27897
27916
  tool: tool ?? {
@@ -27917,7 +27936,7 @@ function createCancelledToolCall(request, tool, invocation) {
27917
27936
  ],
27918
27937
  resultDisplay: void 0,
27919
27938
  error: new Error(CANCELLED_TOOL_ERROR_MESSAGE),
27920
- errorType: "unhandled_exception" /* UNHANDLED_EXCEPTION */
27939
+ errorType: ToolErrorType.UNHANDLED_EXCEPTION
27921
27940
  }
27922
27941
  };
27923
27942
  }
@@ -28022,10 +28041,10 @@ var useAgentStream = ({
28022
28041
  if (unpushedTools.length > 0) {
28023
28042
  setTrackedTools(
28024
28043
  (prev) => prev.map((tc) => {
28025
- if (!pushedToolCallIdsRef.current.has(tc.callId) && tc.status !== "success" /* Success */ && tc.status !== "error" /* Error */ && tc.status !== "cancelled" /* Cancelled */) {
28044
+ if (!pushedToolCallIdsRef.current.has(tc.callId) && tc.status !== CoreToolCallStatus.Success && tc.status !== CoreToolCallStatus.Error && tc.status !== CoreToolCallStatus.Cancelled) {
28026
28045
  return {
28027
28046
  ...tc,
28028
- status: "cancelled" /* Cancelled */
28047
+ status: CoreToolCallStatus.Cancelled
28029
28048
  };
28030
28049
  }
28031
28050
  return tc;
@@ -28170,14 +28189,14 @@ var useAgentStream = ({
28170
28189
  const displayName = legacyState?.displayName ?? event.name;
28171
28190
  const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
28172
28191
  const desc = legacyState?.description ?? "";
28173
- const fallbackKind = "other" /* Other */;
28192
+ const fallbackKind = Kind.Other;
28174
28193
  const newCall = {
28175
28194
  callId: event.requestId,
28176
28195
  name: displayName,
28177
28196
  originalRequestName: event.name,
28178
28197
  description: desc,
28179
28198
  display: event.display,
28180
- status: "scheduled" /* Scheduled */,
28199
+ status: CoreToolCallStatus.Scheduled,
28181
28200
  isClientInitiated: false,
28182
28201
  renderOutputAsMarkdown: isOutputMarkdown,
28183
28202
  kind: legacyState?.kind ?? fallbackKind,
@@ -28195,10 +28214,10 @@ var useAgentStream = ({
28195
28214
  const evtStatus = legacyState?.status;
28196
28215
  let status = tc.status;
28197
28216
  if (evtStatus === "executing")
28198
- status = "executing" /* Executing */;
28199
- else if (evtStatus === "error") status = "error" /* Error */;
28217
+ status = CoreToolCallStatus.Executing;
28218
+ else if (evtStatus === "error") status = CoreToolCallStatus.Error;
28200
28219
  else if (evtStatus === "success")
28201
- status = "success" /* Success */;
28220
+ status = CoreToolCallStatus.Success;
28202
28221
  const display = event.display?.result;
28203
28222
  const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
28204
28223
  const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
@@ -28231,7 +28250,7 @@ var useAgentStream = ({
28231
28250
  const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
28232
28251
  return {
28233
28252
  ...tc,
28234
- status: event.isError ? "error" /* Error */ : "success" /* Success */,
28253
+ status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
28235
28254
  display: event.display ? { ...tc.display, ...event.display } : tc.display,
28236
28255
  resultDisplay,
28237
28256
  outputFile
@@ -28298,7 +28317,7 @@ var useAgentStream = ({
28298
28317
  toolRequestArgsRef.current.clear();
28299
28318
  if (typeof query === "string") {
28300
28319
  addItem({ type: "user" /* USER */, text: query }, timestamp);
28301
- void logger?.logMessage("user" /* USER */, query);
28320
+ void logger?.logMessage(MessageSenderType.USER, query);
28302
28321
  }
28303
28322
  startNewPrompt();
28304
28323
  }
@@ -28500,7 +28519,7 @@ function getBackgroundedToolInfo(toolCall) {
28500
28519
  };
28501
28520
  }
28502
28521
  function isBackgroundableExecutingToolCall(toolCall) {
28503
- return toolCall.status === "executing" /* Executing */ && typeof toolCall.pid === "number";
28522
+ return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
28504
28523
  }
28505
28524
  function showCitations(settings) {
28506
28525
  const enabled = settings.merged.ui.showCitations;
@@ -28510,14 +28529,14 @@ function showCitations(settings) {
28510
28529
  return true;
28511
28530
  }
28512
28531
  function calculateStreamingState(isResponding, toolCalls) {
28513
- if (toolCalls.some((tc) => tc.status === "awaiting_approval" /* AwaitingApproval */)) {
28532
+ if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
28514
28533
  return "waiting_for_confirmation" /* WaitingForConfirmation */;
28515
28534
  }
28516
28535
  const isAnyToolActive = toolCalls.some((tc) => {
28517
- if (tc.status === "executing" /* Executing */ || tc.status === "scheduled" /* Scheduled */ || tc.status === "validating" /* Validating */) {
28536
+ if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
28518
28537
  return true;
28519
28538
  }
28520
- if (tc.status === "success" /* Success */ || tc.status === "error" /* Error */ || tc.status === "cancelled" /* Cancelled */) {
28539
+ if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
28521
28540
  return !tc.responseSubmittedToGemini;
28522
28541
  }
28523
28542
  return false;
@@ -28566,14 +28585,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28566
28585
  }, [config]);
28567
28586
  (0, import_react102.useEffect)(() => {
28568
28587
  const handleRetryAttempt = (payload) => {
28569
- if (turnCancelledRef.current || !isRespondingRef.current || payload.role !== "main" /* MAIN */ || !lastPromptIdRef.current || payload.promptId !== lastPromptIdRef.current) {
28588
+ if (turnCancelledRef.current || !isRespondingRef.current || payload.role !== LlmRole.MAIN || !lastPromptIdRef.current || payload.promptId !== lastPromptIdRef.current) {
28570
28589
  return;
28571
28590
  }
28572
28591
  setRetryStatus(payload);
28573
28592
  };
28574
- coreEvents.on("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
28593
+ coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
28575
28594
  return () => {
28576
- coreEvents.off("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
28595
+ coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
28577
28596
  };
28578
28597
  }, [isRespondingRef]);
28579
28598
  const [
@@ -28624,7 +28643,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28624
28643
  const currentModel = client?.getCurrentSequenceModel?.() ?? config.getModel();
28625
28644
  const normalizedCompletedCalls = completedToolCallsFromScheduler.map(
28626
28645
  (tc) => {
28627
- if (tc.status === "cancelled" /* Cancelled */ && (!tc.response?.responseParts || tc.response.responseParts.length === 0)) {
28646
+ if (tc.status === CoreToolCallStatus.Cancelled && (!tc.response?.responseParts || tc.response.responseParts.length === 0)) {
28628
28647
  return {
28629
28648
  ...tc,
28630
28649
  response: createCancelledToolCall(
@@ -28882,7 +28901,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28882
28901
  prevActiveShellPtyIdRef.current = activeShellPtyId;
28883
28902
  }, [activeShellPtyId, addItem, setIsResponding]);
28884
28903
  (0, import_react102.useEffect)(() => {
28885
- if (config.getApprovalMode() === "yolo" /* YOLO */ && streamingState === "idle" /* Idle */) {
28904
+ if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
28886
28905
  const lastUserMessageIndex = history.findLastIndex(
28887
28906
  (item) => item.type === "user" /* USER */
28888
28907
  );
@@ -28959,7 +28978,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28959
28978
  return;
28960
28979
  }
28961
28980
  const hasActiveTools = pendingToolCallRequestsRef.current.length > 0 || toolCalls.some(
28962
- (tc) => tc.status === "executing" /* Executing */ || tc.status === "scheduled" /* Scheduled */ || tc.status === "validating" /* Validating */ || tc.status === "awaiting_approval" /* AwaitingApproval */
28981
+ (tc) => tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating || tc.status === CoreToolCallStatus.AwaitingApproval
28963
28982
  );
28964
28983
  if (streamingState === "idle" /* Idle */ && !isRespondingRef.current && !hasActiveTools) {
28965
28984
  if (clearBuffer) {
@@ -28987,13 +29006,13 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28987
29006
  if (tc.request.isClientInitiated) {
28988
29007
  continue;
28989
29008
  }
28990
- const isAlreadySubmitted = (tc.status === "success" /* Success */ || tc.status === "error" /* Error */ || tc.status === "cancelled" /* Cancelled */) && tc.responseSubmittedToGemini;
29009
+ const isAlreadySubmitted = (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) && tc.responseSubmittedToGemini;
28991
29010
  if (isAlreadySubmitted) {
28992
29011
  seenCallIds.add(tc.request.callId);
28993
29012
  continue;
28994
29013
  }
28995
29014
  seenCallIds.add(tc.request.callId);
28996
- if ((tc.status === "success" /* Success */ || tc.status === "error" /* Error */ || tc.status === "cancelled" /* Cancelled */) && (tc.response?.responseParts?.length ?? 0) > 0) {
29015
+ if ((tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) && (tc.response?.responseParts?.length ?? 0) > 0) {
28997
29016
  synthesizedCalls.push(tc);
28998
29017
  } else {
28999
29018
  synthesizedCalls.push(
@@ -29055,7 +29074,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
29055
29074
  if (tool.name === SHELL_COMMAND_NAME) {
29056
29075
  return {
29057
29076
  ...tool,
29058
- status: "cancelled" /* Cancelled */,
29077
+ status: CoreToolCallStatus.Cancelled,
29059
29078
  resultDisplay: tool.resultDisplay
29060
29079
  };
29061
29080
  }
@@ -29151,7 +29170,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
29151
29170
  let localQueryToSendToGemini = null;
29152
29171
  if (typeof query === "string") {
29153
29172
  const trimmedQuery = query.trim();
29154
- await logger?.logMessage("user" /* USER */, trimmedQuery);
29173
+ await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
29155
29174
  if (!shellModeActive) {
29156
29175
  const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
29157
29176
  if (slashCommandResult) {
@@ -29309,7 +29328,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
29309
29328
  if (pendingHistoryItemRef.current) {
29310
29329
  if (pendingHistoryItemRef.current.type === "tool_group") {
29311
29330
  const updatedTools = pendingHistoryItemRef.current.tools.map(
29312
- (tool) => tool.status === "validating" /* Validating */ || tool.status === "scheduled" /* Scheduled */ || tool.status === "awaiting_approval" /* AwaitingApproval */ || tool.status === "executing" /* Executing */ ? { ...tool, status: "cancelled" /* Cancelled */ } : tool
29331
+ (tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
29313
29332
  );
29314
29333
  const pendingItem = {
29315
29334
  ...pendingHistoryItemRef.current,
@@ -29602,15 +29621,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
29602
29621
  const toolCallRequests = [];
29603
29622
  let hasTerminalEvent = false;
29604
29623
  for await (const event of stream) {
29605
- if (event.type !== "thought" /* Thought */ && thoughtRef.current !== null) {
29624
+ if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
29606
29625
  setThought(null);
29607
29626
  }
29608
29627
  switch (event.type) {
29609
- case "thought" /* Thought */:
29628
+ case GeminiEventType.Thought:
29610
29629
  setLastGeminiActivityTime(Date.now());
29611
29630
  handleThoughtEvent(event.value, userMessageTimestamp);
29612
29631
  break;
29613
- case "content" /* Content */:
29632
+ case GeminiEventType.Content:
29614
29633
  setLastGeminiActivityTime(Date.now());
29615
29634
  geminiMessageBuffer = handleContentEvent(
29616
29635
  event.value,
@@ -29618,20 +29637,20 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
29618
29637
  userMessageTimestamp
29619
29638
  );
29620
29639
  break;
29621
- case "tool_call_request" /* ToolCallRequest */:
29640
+ case GeminiEventType.ToolCallRequest:
29622
29641
  setRetryStatus(null);
29623
29642
  toolCallRequests.push(event.value);
29624
29643
  pendingToolCallRequestsRef.current.push(event.value);
29625
29644
  break;
29626
- case "user_cancelled" /* UserCancelled */:
29645
+ case GeminiEventType.UserCancelled:
29627
29646
  handleUserCancelledEvent(userMessageTimestamp);
29628
29647
  pendingToolCallRequestsRef.current = [];
29629
29648
  return 1 /* UserCancelled */;
29630
- case "error" /* Error */:
29649
+ case GeminiEventType.Error:
29631
29650
  hasTerminalEvent = true;
29632
29651
  handleErrorEvent(event.value, userMessageTimestamp);
29633
29652
  break;
29634
- case "agent_execution_stopped" /* AgentExecutionStopped */:
29653
+ case GeminiEventType.AgentExecutionStopped:
29635
29654
  hasTerminalEvent = true;
29636
29655
  handleAgentExecutionStoppedEvent(
29637
29656
  event.value.reason,
@@ -29640,7 +29659,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
29640
29659
  event.value.contextCleared
29641
29660
  );
29642
29661
  break;
29643
- case "agent_execution_blocked" /* AgentExecutionBlocked */:
29662
+ case GeminiEventType.AgentExecutionBlocked:
29644
29663
  hasTerminalEvent = true;
29645
29664
  handleAgentExecutionBlockedEvent(
29646
29665
  event.value.reason,
@@ -29649,38 +29668,38 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
29649
29668
  event.value.contextCleared
29650
29669
  );
29651
29670
  break;
29652
- case "chat_compressed" /* ChatCompressed */:
29671
+ case GeminiEventType.ChatCompressed:
29653
29672
  handleChatCompressionEvent(event.value, userMessageTimestamp);
29654
29673
  break;
29655
- case "tool_call_confirmation" /* ToolCallConfirmation */:
29656
- case "tool_call_response" /* ToolCallResponse */:
29674
+ case GeminiEventType.ToolCallConfirmation:
29675
+ case GeminiEventType.ToolCallResponse:
29657
29676
  break;
29658
- case "max_session_turns" /* MaxSessionTurns */:
29677
+ case GeminiEventType.MaxSessionTurns:
29659
29678
  hasTerminalEvent = true;
29660
29679
  handleMaxSessionTurnsEvent();
29661
29680
  break;
29662
- case "context_window_will_overflow" /* ContextWindowWillOverflow */:
29681
+ case GeminiEventType.ContextWindowWillOverflow:
29663
29682
  hasTerminalEvent = true;
29664
29683
  handleContextWindowWillOverflowEvent(
29665
29684
  event.value.estimatedRequestTokenCount,
29666
29685
  event.value.remainingTokenCount
29667
29686
  );
29668
29687
  break;
29669
- case "finished" /* Finished */:
29688
+ case GeminiEventType.Finished:
29670
29689
  handleFinishedEvent(event, userMessageTimestamp);
29671
29690
  break;
29672
- case "citation" /* Citation */:
29691
+ case GeminiEventType.Citation:
29673
29692
  handleCitationEvent(event.value, userMessageTimestamp);
29674
29693
  break;
29675
- case "model_info" /* ModelInfo */:
29694
+ case GeminiEventType.ModelInfo:
29676
29695
  handleChatModelEvent(event.value, userMessageTimestamp);
29677
29696
  break;
29678
- case "loop_detected" /* LoopDetected */:
29697
+ case GeminiEventType.LoopDetected:
29679
29698
  loopDetectedRef.current = true;
29680
29699
  break;
29681
- case "retry" /* Retry */:
29700
+ case GeminiEventType.Retry:
29682
29701
  break;
29683
- case "invalid_stream" /* InvalidStream */:
29702
+ case GeminiEventType.InvalidStream:
29684
29703
  hasTerminalEvent = true;
29685
29704
  handleInvalidStreamEvent(event.value, userMessageTimestamp);
29686
29705
  break;
@@ -29750,7 +29769,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
29750
29769
  const submitQuery = (0, import_react102.useCallback)(
29751
29770
  async (query, options, prompt_id) => runInDevTraceSpan(
29752
29771
  {
29753
- operation: options?.isContinuation ? "system_prompt" /* SystemPrompt */ : "user_prompt" /* UserPrompt */,
29772
+ operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
29754
29773
  sessionId: config.getSessionId()
29755
29774
  },
29756
29775
  async ({ metadata: spanMetadata }) => {
@@ -29920,7 +29939,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
29920
29939
  submitQueryRef.current = submitQuery;
29921
29940
  const handleApprovalModeChange = (0, import_react102.useCallback)(
29922
29941
  async (newApprovalMode) => {
29923
- if (previousApprovalModeRef.current === "plan" /* PLAN */ && newApprovalMode !== "plan" /* PLAN */ && streamingState === "idle" /* Idle */) {
29942
+ if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
29924
29943
  if (geminiClient) {
29925
29944
  try {
29926
29945
  await geminiClient.addHistory({
@@ -29943,11 +29962,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
29943
29962
  }
29944
29963
  }
29945
29964
  previousApprovalModeRef.current = newApprovalMode;
29946
- if (newApprovalMode === "yolo" /* YOLO */ || newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
29965
+ if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
29947
29966
  let awaitingApprovalCalls = toolCalls.filter(
29948
29967
  (call) => call.status === "awaiting_approval" && !call.request.forcedAsk
29949
29968
  );
29950
- if (newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
29969
+ if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
29951
29970
  const filteredCalls = [];
29952
29971
  for (const call of awaitingApprovalCalls) {
29953
29972
  if (EDIT_TOOL_NAMES.has(call.request.name)) {
@@ -29975,11 +29994,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
29975
29994
  if (call.correlationId) {
29976
29995
  try {
29977
29996
  await config.getMessageBus().publish({
29978
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
29997
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
29979
29998
  correlationId: call.correlationId,
29980
29999
  confirmed: true,
29981
30000
  requiresUserConfirmation: false,
29982
- outcome: "proceed_once" /* ProceedOnce */
30001
+ outcome: ToolConfirmationOutcome.ProceedOnce
29983
30002
  });
29984
30003
  } catch (error) {
29985
30004
  debugLogger.warn(
@@ -30071,14 +30090,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
30071
30090
  );
30072
30091
  if (isLowErrorVerbosity) {
30073
30092
  suppressedToolErrorCountRef.current += geminiTools.filter(
30074
- (tc) => tc.status === "error" /* Error */
30093
+ (tc) => tc.status === CoreToolCallStatus.Error
30075
30094
  ).length;
30076
30095
  }
30077
30096
  if (geminiTools.length === 0) {
30078
30097
  return;
30079
30098
  }
30080
30099
  const stopExecutionTool = geminiTools.find(
30081
- (tc) => tc.response.errorType === "stop_execution" /* STOP_EXECUTION */
30100
+ (tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
30082
30101
  );
30083
30102
  if (stopExecutionTool && stopExecutionTool.response.error) {
30084
30103
  maybeAddSuppressedToolErrorNote();
@@ -30098,9 +30117,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
30098
30117
  (tc) => !isTopicTool2(tc.request.name)
30099
30118
  );
30100
30119
  const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
30101
- (tc) => tc.status === "cancelled" /* Cancelled */
30120
+ (tc) => tc.status === CoreToolCallStatus.Cancelled
30102
30121
  );
30103
- const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === "cancelled" /* Cancelled */);
30122
+ const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
30104
30123
  if (allDeclinableToolsCancelled || allToolsCancelled) {
30105
30124
  if (!turnCancelledRef.current) {
30106
30125
  addItem({
@@ -30190,7 +30209,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
30190
30209
  return;
30191
30210
  }
30192
30211
  const restorableToolCalls = toolCalls.filter(
30193
- (toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === "awaiting_approval" /* AwaitingApproval */
30212
+ (toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
30194
30213
  );
30195
30214
  if (restorableToolCalls.length > 0) {
30196
30215
  if (!gitService) {
@@ -31659,9 +31678,9 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
31659
31678
  const handleFolderTrustSelect = (0, import_react106.useCallback)(
31660
31679
  async (choice) => {
31661
31680
  const trustLevelMap = {
31662
- ["trust_folder" /* TRUST_FOLDER */]: "TRUST_FOLDER" /* TRUST_FOLDER */,
31663
- ["trust_parent" /* TRUST_PARENT */]: "TRUST_PARENT" /* TRUST_PARENT */,
31664
- ["do_not_trust" /* DO_NOT_TRUST */]: "DO_NOT_TRUST" /* DO_NOT_TRUST */
31681
+ ["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
31682
+ ["trust_parent" /* TRUST_PARENT */]: TrustLevel.TRUST_PARENT,
31683
+ ["do_not_trust" /* DO_NOT_TRUST */]: TrustLevel.DO_NOT_TRUST
31665
31684
  };
31666
31685
  const trustLevel = trustLevelMap[choice];
31667
31686
  if (!trustLevel) return;
@@ -31680,7 +31699,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
31680
31699
  }, 100);
31681
31700
  return;
31682
31701
  }
31683
- const currentIsTrusted = trustLevel === "TRUST_FOLDER" /* TRUST_FOLDER */ || trustLevel === "TRUST_PARENT" /* TRUST_PARENT */;
31702
+ const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
31684
31703
  onTrustChangeRef.current(currentIsTrusted);
31685
31704
  setIsTrusted(currentIsTrusted);
31686
31705
  const wasTrusted = isTrusted ?? false;
@@ -32690,7 +32709,7 @@ function useMessageQueue({
32690
32709
  var import_react108 = __toESM(require_react(), 1);
32691
32710
  function useMcpStatus(config) {
32692
32711
  const [discoveryState, setDiscoveryState] = (0, import_react108.useState)(
32693
- () => config.getMcpClientManager()?.getDiscoveryState() ?? "not_started" /* NOT_STARTED */
32712
+ () => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
32694
32713
  );
32695
32714
  const [mcpServerCount, setMcpServerCount] = (0, import_react108.useState)(
32696
32715
  () => config.getMcpClientManager()?.getMcpServerCount() ?? 0
@@ -32703,12 +32722,12 @@ function useMcpStatus(config) {
32703
32722
  setMcpServerCount(manager.getMcpServerCount());
32704
32723
  }
32705
32724
  };
32706
- coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
32725
+ coreEvents.on(CoreEvent.McpClientUpdate, onChange);
32707
32726
  return () => {
32708
- coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
32727
+ coreEvents.off(CoreEvent.McpClientUpdate, onChange);
32709
32728
  };
32710
32729
  }, [config]);
32711
- const isMcpReady = discoveryState === "completed" /* COMPLETED */ || discoveryState === "not_started" /* NOT_STARTED */ && mcpServerCount === 0;
32730
+ const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
32712
32731
  return {
32713
32732
  discoveryState,
32714
32733
  mcpServerCount,
@@ -32735,7 +32754,7 @@ function useApprovalModeIndicator({
32735
32754
  (key) => {
32736
32755
  let nextApprovalMode;
32737
32756
  if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
32738
- if (config.isYoloModeDisabled() && config.getApprovalMode() !== "yolo" /* YOLO */) {
32757
+ if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
32739
32758
  if (addItem) {
32740
32759
  let text = "You cannot enter YOLO mode since it is disabled in your settings.";
32741
32760
  const adminSettings = config.getRemoteAdminSettings();
@@ -32753,21 +32772,21 @@ function useApprovalModeIndicator({
32753
32772
  }
32754
32773
  return;
32755
32774
  }
32756
- nextApprovalMode = config.getApprovalMode() === "yolo" /* YOLO */ ? "default" /* DEFAULT */ : "yolo" /* YOLO */;
32775
+ nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
32757
32776
  } else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
32758
32777
  const currentMode = config.getApprovalMode();
32759
32778
  switch (currentMode) {
32760
- case "default" /* DEFAULT */:
32761
- nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
32779
+ case ApprovalMode.DEFAULT:
32780
+ nextApprovalMode = ApprovalMode.AUTO_EDIT;
32762
32781
  break;
32763
- case "autoEdit" /* AUTO_EDIT */:
32764
- nextApprovalMode = allowPlanMode ? "plan" /* PLAN */ : "default" /* DEFAULT */;
32782
+ case ApprovalMode.AUTO_EDIT:
32783
+ nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
32765
32784
  break;
32766
- case "plan" /* PLAN */:
32767
- nextApprovalMode = "default" /* DEFAULT */;
32785
+ case ApprovalMode.PLAN:
32786
+ nextApprovalMode = ApprovalMode.DEFAULT;
32768
32787
  break;
32769
- case "yolo" /* YOLO */:
32770
- nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
32788
+ case ApprovalMode.YOLO:
32789
+ nextApprovalMode = ApprovalMode.AUTO_EDIT;
32771
32790
  break;
32772
32791
  default:
32773
32792
  }
@@ -33191,11 +33210,11 @@ var useHookDisplayState = () => {
33191
33210
  removeHook();
33192
33211
  }
33193
33212
  };
33194
- coreEvents.on("hook-start" /* HookStart */, handleHookStart);
33195
- coreEvents.on("hook-end" /* HookEnd */, handleHookEnd);
33213
+ coreEvents.on(CoreEvent.HookStart, handleHookStart);
33214
+ coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
33196
33215
  return () => {
33197
- coreEvents.off("hook-start" /* HookStart */, handleHookStart);
33198
- coreEvents.off("hook-end" /* HookEnd */, handleHookEnd);
33216
+ coreEvents.off(CoreEvent.HookStart, handleHookStart);
33217
+ coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
33199
33218
  activeTimeouts.forEach(clearTimeout);
33200
33219
  activeTimeouts.clear();
33201
33220
  };
@@ -34088,7 +34107,7 @@ var AppContainer = (props) => {
34088
34107
  setConfigInitialized(true);
34089
34108
  startupProfiler.flush(config);
34090
34109
  startAutoMemoryIfEnabled(config);
34091
- const sessionStartSource = resumedSessionData ? "resume" /* Resume */ : "startup" /* Startup */;
34110
+ const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
34092
34111
  const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
34093
34112
  if (result) {
34094
34113
  const additionalContext = result.getAdditionalContext();
@@ -34115,7 +34134,7 @@ var AppContainer = (props) => {
34115
34134
  );
34116
34135
  const ideClient = await IdeClient.getInstance();
34117
34136
  await ideClient.disconnect();
34118
- await config?.getHookSystem()?.fireSessionEndEvent("exit" /* Exit */);
34137
+ await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
34119
34138
  };
34120
34139
  registerCleanup(cleanupFn);
34121
34140
  return () => {
@@ -34140,11 +34159,11 @@ var AppContainer = (props) => {
34140
34159
  resetTime: payload.resetTime
34141
34160
  });
34142
34161
  };
34143
- coreEvents.on("model-changed" /* ModelChanged */, handleModelChanged);
34144
- coreEvents.on("quota-changed" /* QuotaChanged */, handleQuotaChanged);
34162
+ coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
34163
+ coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
34145
34164
  return () => {
34146
- coreEvents.off("model-changed" /* ModelChanged */, handleModelChanged);
34147
- coreEvents.off("quota-changed" /* QuotaChanged */, handleQuotaChanged);
34165
+ coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
34166
+ coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
34148
34167
  };
34149
34168
  }, [config]);
34150
34169
  (0, import_react122.useEffect)(() => {
@@ -34157,16 +34176,16 @@ var AppContainer = (props) => {
34157
34176
  const handleAgentsDiscovered = (payload) => {
34158
34177
  setNewAgents(payload.agents);
34159
34178
  };
34160
- coreEvents.on("settings-changed" /* SettingsChanged */, handleSettingsChanged);
34161
- coreEvents.on("admin-settings-changed" /* AdminSettingsChanged */, handleAdminSettingsChanged);
34162
- coreEvents.on("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
34179
+ coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
34180
+ coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
34181
+ coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
34163
34182
  return () => {
34164
- coreEvents.off("settings-changed" /* SettingsChanged */, handleSettingsChanged);
34183
+ coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
34165
34184
  coreEvents.off(
34166
- "admin-settings-changed" /* AdminSettingsChanged */,
34185
+ CoreEvent.AdminSettingsChanged,
34167
34186
  handleAdminSettingsChanged
34168
34187
  );
34169
- coreEvents.off("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
34188
+ coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
34170
34189
  };
34171
34190
  }, [settings]);
34172
34191
  const { errorCount, clearErrorCount } = useErrorCount();
@@ -34317,11 +34336,11 @@ var AppContainer = (props) => {
34317
34336
  exitEditorDialog
34318
34337
  } = useEditorSettings(settings, setEditorError, historyManager.addItem);
34319
34338
  (0, import_react122.useEffect)(() => {
34320
- coreEvents.on("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
34321
- coreEvents.on("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
34339
+ coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
34340
+ coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
34322
34341
  return () => {
34323
- coreEvents.off("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
34324
- coreEvents.off("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
34342
+ coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
34343
+ coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
34325
34344
  };
34326
34345
  }, [handleEditorClose, openEditorDialog]);
34327
34346
  (0, import_react122.useEffect)(() => {
@@ -34392,7 +34411,7 @@ var AppContainer = (props) => {
34392
34411
  errorVerbosity: settings.merged.ui.errorVerbosity
34393
34412
  });
34394
34413
  const isAuthDialogOpen = authState === "updating" /* Updating */;
34395
- const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== "gemini-api-key" /* USE_GEMINI */;
34414
+ const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
34396
34415
  const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
34397
34416
  const { loadHistoryForResume, isResuming } = useSessionResume({
34398
34417
  config,
@@ -34420,7 +34439,7 @@ var AppContainer = (props) => {
34420
34439
  async (authType, scope) => {
34421
34440
  if (authType) {
34422
34441
  const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
34423
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */) {
34442
+ if (authType === AuthType.LOGIN_WITH_GOOGLE) {
34424
34443
  setAuthContext({ requiresRestart: true });
34425
34444
  } else {
34426
34445
  setAuthContext({});
@@ -34448,7 +34467,7 @@ var AppContainer = (props) => {
34448
34467
  );
34449
34468
  return;
34450
34469
  }
34451
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
34470
+ if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
34452
34471
  writeToStdout(`
34453
34472
  ----------------------------------------------------------------
34454
34473
  Logging in with Google... Restarting Gemini CLI to continue.
@@ -34471,7 +34490,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
34471
34490
  }
34472
34491
  await saveApiKey(apiKey);
34473
34492
  await reloadApiKey();
34474
- await config.refreshAuth("gemini-api-key" /* USE_GEMINI */);
34493
+ await config.refreshAuth(AuthType.USE_GEMINI);
34475
34494
  setAuthState("authenticated" /* Authenticated */);
34476
34495
  } catch (e) {
34477
34496
  onAuthError(
@@ -34496,7 +34515,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
34496
34515
  `Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
34497
34516
  );
34498
34517
  } else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
34499
- if (settings.merged.security.auth.selectedType === "gemini-api-key" /* USE_GEMINI */) {
34518
+ if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
34500
34519
  return;
34501
34520
  }
34502
34521
  const authMethod = settings.merged.security.auth.selectedType;
@@ -34656,9 +34675,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
34656
34675
  }
34657
34676
  });
34658
34677
  };
34659
- coreEvents.on("consent-request" /* ConsentRequest */, handleConsentRequest);
34678
+ coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
34660
34679
  return () => {
34661
- coreEvents.off("consent-request" /* ConsentRequest */, handleConsentRequest);
34680
+ coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
34662
34681
  };
34663
34682
  }, []);
34664
34683
  const performMemoryRefresh = (0, import_react122.useCallback)(async () => {
@@ -35298,7 +35317,7 @@ ${queuedText}` : queuedText;
35298
35317
  [handleSlashCommand, settings]
35299
35318
  );
35300
35319
  const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
35301
- 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;
35320
+ 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;
35302
35321
  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;
35303
35322
  const handleGlobalKeypress = (0, import_react122.useCallback)(
35304
35323
  (key) => {
@@ -35391,7 +35410,7 @@ ${queuedText}` : queuedText;
35391
35410
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
35392
35411
  if (settings.merged.general.devtools) {
35393
35412
  void (async () => {
35394
- const { toggleDevToolsPanel } = await import("./devtoolsService-3G6P4EBB.js");
35413
+ const { toggleDevToolsPanel } = await import("./devtoolsService-ZAMC5JAO.js");
35395
35414
  await toggleDevToolsPanel(
35396
35415
  config,
35397
35416
  showErrorDetails,
@@ -35612,12 +35631,12 @@ ${queuedText}` : queuedText;
35612
35631
  Date.now()
35613
35632
  );
35614
35633
  };
35615
- coreEvents.on("user-feedback" /* UserFeedback */, handleUserFeedback);
35616
- coreEvents.on("hook-system-message" /* HookSystemMessage */, handleHookSystemMessage);
35634
+ coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
35635
+ coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
35617
35636
  coreEvents.drainBacklogs();
35618
35637
  return () => {
35619
- coreEvents.off("user-feedback" /* UserFeedback */, handleUserFeedback);
35620
- coreEvents.off("hook-system-message" /* HookSystemMessage */, handleHookSystemMessage);
35638
+ coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
35639
+ coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
35621
35640
  };
35622
35641
  }, [historyManager]);
35623
35642
  const nightly = props.version.includes("nightly");
@@ -35726,9 +35745,9 @@ ${queuedText}` : queuedText;
35726
35745
  const handleMemoryChanged = (result) => {
35727
35746
  setGeminiMdFileCount(result.fileCount);
35728
35747
  };
35729
- coreEvents.on("memory-changed" /* MemoryChanged */, handleMemoryChanged);
35748
+ coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
35730
35749
  return () => {
35731
- coreEvents.off("memory-changed" /* MemoryChanged */, handleMemoryChanged);
35750
+ coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
35732
35751
  };
35733
35752
  }, []);
35734
35753
  (0, import_react122.useEffect)(() => {