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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/bundle/{chunk-GFPE65Z3.js → chunk-47QC6PWE.js} +7 -7
  2. package/bundle/{chunk-CBWESCDG.js → chunk-5AFGMGVT.js} +7 -7
  3. package/bundle/{chunk-NOEPPT4R.js → chunk-5MQ5VMQK.js} +1 -1
  4. package/bundle/{chunk-6KCFSK2J.js → chunk-66C7JVNE.js} +2 -2
  5. package/bundle/{chunk-EW6BCPVC.js → chunk-6K3EFSDX.js} +1 -1
  6. package/bundle/{chunk-J3JE6HQX.js → chunk-7H3CQGS6.js} +1 -1
  7. package/bundle/{chunk-F7B6HX6S.js → chunk-7LOMS5HP.js} +2 -2
  8. package/bundle/{chunk-KILMJEVY.js → chunk-A3GDBSEI.js} +9 -8
  9. package/bundle/{chunk-NQ7WZMXX.js → chunk-A564QXJJ.js} +4 -5
  10. package/bundle/{chunk-M4GY7DCE.js → chunk-ARLWCFGI.js} +6834 -12733
  11. package/bundle/{chunk-VUENLVGO.js → chunk-AS4E6DX7.js} +3 -3
  12. package/bundle/{chunk-4LCWAZQL.js → chunk-BI5ZICGL.js} +1 -1
  13. package/bundle/{chunk-6QYD32J3.js → chunk-BUJZOWQ7.js} +9 -6
  14. package/bundle/chunk-BZZHETT5.js +512 -0
  15. package/bundle/{chunk-Y2QKRHXR.js → chunk-GZ4FSF4B.js} +2 -2
  16. package/bundle/{chunk-J6LCLN2Y.js → chunk-I5JMJ2LU.js} +1 -1
  17. package/bundle/chunk-IBIKJW2L.js +17230 -0
  18. package/bundle/{chunk-HSZC7H6N.js → chunk-KSNNZBTV.js} +2 -2
  19. package/bundle/{chunk-6BMBSK77.js → chunk-L6GBKGQX.js} +3 -3
  20. package/bundle/chunk-L7GACEVA.js +118 -0
  21. package/bundle/chunk-LCB7VVYS.js +356008 -0
  22. package/bundle/{chunk-WSLK3AUT.js → chunk-LK7LIPO6.js} +1 -1
  23. package/bundle/{chunk-CLT3IJGB.js → chunk-NHDN46IK.js} +1 -1
  24. package/bundle/chunk-OGZGOFAJ.js +1571 -0
  25. package/bundle/{chunk-N3W3RYXN.js → chunk-PBD26LJQ.js} +68 -55
  26. package/bundle/{chunk-IGYW5IPQ.js → chunk-QZ2JZRLK.js} +3 -4
  27. package/bundle/chunk-UKCYYERR.js +391 -0
  28. package/bundle/{chunk-ETRUTVTR.js → chunk-UVBJHP26.js} +1 -1
  29. package/bundle/{chunk-UO7OO22U.js → chunk-UZZVXATH.js} +1 -1
  30. package/bundle/chunk-VERP26KN.js +81544 -0
  31. package/bundle/{chunk-QMK75Y7E.js → chunk-WX6CHISQ.js} +2 -2
  32. package/bundle/chunk-YDSDSLSO.js +156 -0
  33. package/bundle/{cleanup-T2HYKF7I.js → cleanup-6PVHIK4C.js} +2 -2
  34. package/bundle/{cleanup-LH7RU457.js → cleanup-FRS7FPOS.js} +2 -2
  35. package/bundle/{cleanup-ZBHF7PUC.js → cleanup-NDTUQVOW.js} +3 -3
  36. package/bundle/cleanup-O4IDJYU2.js +33 -0
  37. package/bundle/{core-QH4PNJQ3.js → core-RZFMBCSX.js} +1 -1
  38. package/bundle/{devtoolsService-NXXQULSB.js → devtoolsService-6D355RSX.js} +2 -2
  39. package/bundle/{devtoolsService-NIEGPNPT.js → devtoolsService-7SBW23VD.js} +5 -4
  40. package/bundle/devtoolsService-SPV43SGI.js +857 -0
  41. package/bundle/{devtoolsService-USWJ4OCC.js → devtoolsService-WER5PRLG.js} +2 -2
  42. package/bundle/{dist-P6VZ5KI4.js → dist-7BJPFNU7.js} +1 -1
  43. package/bundle/{core-IIB5TH4W.js → dist-DTPIOJ3P.js} +2 -2
  44. package/bundle/dist-ZZ5HEQGP.js +2096 -0
  45. package/bundle/{gemini-H26TLDOV.js → gemini-3NXWUDHV.js} +13 -13
  46. package/bundle/{gemini-NFPXCHZM.js → gemini-GLORNPU2.js} +200 -186
  47. package/bundle/gemini-HCJBP42A.js +16256 -0
  48. package/bundle/{gemini-U45ZMNQE.js → gemini-KMMF6AK3.js} +13 -13
  49. package/bundle/gemini.js +7 -7
  50. package/bundle/{interactiveCli-AT7D6KM5.js → interactiveCli-5UVCH7FM.js} +8 -8
  51. package/bundle/{interactiveCli-MMM7Z6CJ.js → interactiveCli-BNDKNCVJ.js} +294 -276
  52. package/bundle/{interactiveCli-O6EFASZD.js → interactiveCli-HBRMSAIT.js} +8 -8
  53. package/bundle/interactiveCli-TWDP2H52.js +34505 -0
  54. package/bundle/{liteRtServerManager-G5EHBOWM.js → liteRtServerManager-3YA2HL46.js} +4 -4
  55. package/bundle/{liteRtServerManager-QB74ZF32.js → liteRtServerManager-BYQVAM6Y.js} +4 -4
  56. package/bundle/{liteRtServerManager-JCITNPUM.js → liteRtServerManager-IQHHDTUM.js} +5 -5
  57. package/bundle/liteRtServerManager-RTBP2SLV.js +66 -0
  58. package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
  59. package/bundle/{oauth2-provider-V6ROFUMU.js → oauth2-provider-C66JRVDQ.js} +1 -1
  60. package/bundle/{oauth2-provider-K5IZHYDJ.js → oauth2-provider-OAXWX3Z3.js} +39 -73
  61. package/bundle/{oauth2-provider-ZKX2USIN.js → oauth2-provider-TUVQXNLY.js} +1 -1
  62. package/bundle/oauth2-provider-ZPJOR5SG.js +237 -0
  63. package/bundle/{start-WILIWWLN.js → start-ELTWFVNO.js} +6 -6
  64. package/bundle/{start-B4GKBYKT.js → start-HHZI73VV.js} +7 -7
  65. package/bundle/start-NCMR7HOQ.js +19 -0
  66. package/bundle/{start-SW3EMEQ2.js → start-S3TEO5BN.js} +6 -6
  67. package/package.json +1 -1
@@ -155,13 +155,13 @@ import {
155
155
  widestLineFromStyledChars,
156
156
  wordBreakStyledChars,
157
157
  wrapStyledChars
158
- } from "./chunk-GFPE65Z3.js";
158
+ } from "./chunk-PBD26LJQ.js";
159
159
  import {
160
160
  appEvents
161
161
  } from "./chunk-5PS3AYFU.js";
162
162
  import {
163
163
  require_source
164
- } from "./chunk-4LCWAZQL.js";
164
+ } from "./chunk-LK7LIPO6.js";
165
165
  import {
166
166
  ACTIVE_SHELL_MAX_LINES,
167
167
  COMPACT_TOOL_SUBVIEW_MAX_LINES,
@@ -211,30 +211,32 @@ import {
211
211
  stringWidth,
212
212
  stripUnsafeCharacters,
213
213
  toCodePoints
214
- } from "./chunk-CLT3IJGB.js";
214
+ } from "./chunk-BUJZOWQ7.js";
215
215
  import {
216
216
  handleAutoUpdate,
217
217
  isDevelopment,
218
218
  relaunchApp,
219
219
  setUpdateHandler
220
- } from "./chunk-VUENLVGO.js";
220
+ } from "./chunk-66C7JVNE.js";
221
221
  import {
222
222
  isTodoList,
223
223
  mapCoreStatusToDisplayStatus,
224
224
  require_react
225
- } from "./chunk-KILMJEVY.js";
225
+ } from "./chunk-BZZHETT5.js";
226
226
  import {
227
227
  registerCleanup,
228
228
  removeCleanup,
229
229
  runExitCleanup,
230
230
  setupTtyCheck
231
- } from "./chunk-EW6BCPVC.js";
231
+ } from "./chunk-UVBJHP26.js";
232
232
  import {
233
233
  ApiKeyUpdatedEvent,
234
234
  AsyncFzf,
235
235
  AudioRecorder,
236
236
  AuthType,
237
+ CompressionStatus,
237
238
  ConversationFinishedEvent,
239
+ CoreToolCallStatus,
238
240
  CreditPurchaseClickEvent,
239
241
  EDITOR_DISPLAY_NAMES,
240
242
  EmptyWalletMenuShownEvent,
@@ -244,11 +246,16 @@ import {
244
246
  FileSearchFactory,
245
247
  FolderTrustDiscoveryService,
246
248
  G1_UTM_CAMPAIGNS,
249
+ GeminiCliOperation,
250
+ GeminiEventType,
247
251
  GitService,
248
252
  IdeClient,
249
253
  LegacyAgentProtocol,
250
254
  LlmRole,
251
255
  Logger,
256
+ MCPDiscoveryState,
257
+ MCPServerStatus,
258
+ MessageSenderType,
252
259
  ModelNotFoundError,
253
260
  ModelSlashCommandEvent,
254
261
  OverageMenuShownEvent,
@@ -258,14 +265,18 @@ import {
258
265
  RELEASE_CHANNEL_STABILITY,
259
266
  ROOT_SCHEDULER_ID,
260
267
  Scheduler,
268
+ SessionEndReason,
269
+ SessionStartSource,
261
270
  ShellExecutionService,
262
271
  SlashCommandStatus,
263
272
  TerminalQuotaError,
264
273
  TranscriptionFactory,
274
+ TrustLevel,
265
275
  UserAccountManager,
266
276
  UserPromptEvent,
267
277
  UserTierId,
268
278
  ValidationRequiredError,
279
+ WarningPriority,
269
280
  WhisperModelManager,
270
281
  addMCPStatusChangeListener,
271
282
  allowEditorTypeInSandbox,
@@ -352,11 +363,13 @@ import {
352
363
  validatePlanContent,
353
364
  validatePlanPath,
354
365
  writeToStdout
355
- } from "./chunk-IGYW5IPQ.js";
366
+ } from "./chunk-ARLWCFGI.js";
356
367
  import {
357
368
  ACTIVATE_SKILL_TOOL_NAME,
358
369
  AGENT_TOOL_NAME,
370
+ ApprovalMode,
359
371
  ChangeAuthRequestedError,
372
+ CoreEvent,
360
373
  DEFAULT_GEMINI_FLASH_LITE_MODEL,
361
374
  DEFAULT_GEMINI_FLASH_MODEL,
362
375
  DEFAULT_GEMINI_MODEL,
@@ -369,13 +382,16 @@ import {
369
382
  GEMMA_4_31B_IT_MODEL,
370
383
  GLOB_DISPLAY_NAME,
371
384
  GREP_DISPLAY_NAME,
385
+ Kind,
372
386
  LS_DISPLAY_NAME,
387
+ MessageBusType,
373
388
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
374
389
  PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
375
390
  PREVIEW_GEMINI_3_1_MODEL,
376
391
  PREVIEW_GEMINI_FLASH_MODEL,
377
392
  PREVIEW_GEMINI_MODEL,
378
393
  PREVIEW_GEMINI_MODEL_AUTO,
394
+ QuestionType,
379
395
  READ_FILE_DISPLAY_NAME,
380
396
  READ_MANY_FILES_DISPLAY_NAME,
381
397
  SHELL_TOOL_NAME,
@@ -383,6 +399,8 @@ import {
383
399
  TOPIC_PARAM_STRATEGIC_INTENT,
384
400
  TOPIC_PARAM_SUMMARY,
385
401
  TOPIC_PARAM_TITLE,
402
+ ToolConfirmationOutcome,
403
+ ToolErrorType,
386
404
  UPDATE_TOPIC_DISPLAY_NAME,
387
405
  UPDATE_TOPIC_TOOL_NAME,
388
406
  UnauthorizedError,
@@ -412,7 +430,7 @@ import {
412
430
  safeJsonToMarkdown,
413
431
  shortenPath,
414
432
  tildeifyPath
415
- } from "./chunk-ECNYAST2.js";
433
+ } from "./chunk-JEW7ZIWE.js";
416
434
  import "./chunk-664ZODQF.js";
417
435
  import "./chunk-RJTRUG2J.js";
418
436
  import "./chunk-IUUIT4SU.js";
@@ -5038,7 +5056,7 @@ function calculateShellMaxLines(options) {
5038
5056
  if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
5039
5057
  return maxLinesBasedOnHeight;
5040
5058
  }
5041
- const isExecuting = status === "executing" /* Executing */;
5059
+ const isExecuting = status === CoreToolCallStatus.Executing;
5042
5060
  const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
5043
5061
  return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
5044
5062
  }
@@ -5071,10 +5089,10 @@ function isShellTool(name) {
5071
5089
  return name === SHELL_COMMAND_NAME || name === SHELL_NAME || name === SHELL_TOOL_NAME;
5072
5090
  }
5073
5091
  function isThisShellFocusable(name, status, config) {
5074
- return !!(isShellTool(name) && status === "executing" /* Executing */ && config?.getEnableInteractiveShell());
5092
+ return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && config?.getEnableInteractiveShell());
5075
5093
  }
5076
5094
  function isThisShellFocused(name, status, ptyId, activeShellPtyId, embeddedShellFocused) {
5077
- return !!(isShellTool(name) && status === "executing" /* Executing */ && ptyId === activeShellPtyId && embeddedShellFocused);
5095
+ return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && ptyId === activeShellPtyId && embeddedShellFocused);
5078
5096
  }
5079
5097
  function useFocusHint(isThisShellFocusable2, isThisShellFocused2, resultDisplay) {
5080
5098
  const [userHasFocused, setUserHasFocused] = (0, import_react9.useState)(false);
@@ -5654,14 +5672,14 @@ var ToolActionsProvider = (props) => {
5654
5672
  }
5655
5673
  const details = tool.confirmationDetails;
5656
5674
  if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
5657
- const cliOutcome = outcome === "cancel" /* Cancel */ ? "rejected" : "accepted";
5675
+ const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? "rejected" : "accepted";
5658
5676
  await ideClient?.resolveDiffFromCli(details.filePath, cliOutcome);
5659
5677
  }
5660
5678
  if (tool.correlationId) {
5661
5679
  await config.getMessageBus().publish({
5662
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
5680
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
5663
5681
  correlationId: tool.correlationId,
5664
- confirmed: outcome !== "cancel" /* Cancel */,
5682
+ confirmed: outcome !== ToolConfirmationOutcome.Cancel,
5665
5683
  requiresUserConfirmation: false,
5666
5684
  outcome,
5667
5685
  payload
@@ -5680,7 +5698,7 @@ var ToolActionsProvider = (props) => {
5680
5698
  );
5681
5699
  const cancel = (0, import_react12.useCallback)(
5682
5700
  async (callId) => {
5683
- await confirm(callId, "cancel" /* Cancel */);
5701
+ await confirm(callId, ToolConfirmationOutcome.Cancel);
5684
5702
  },
5685
5703
  [confirm]
5686
5704
  );
@@ -5799,7 +5817,7 @@ var ToolMessage = ({
5799
5817
  paddingX: 1,
5800
5818
  flexDirection: "column",
5801
5819
  children: [
5802
- status === "executing" /* Executing */ && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5820
+ status === CoreToolCallStatus.Executing && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5803
5821
  McpProgressIndicator,
5804
5822
  {
5805
5823
  progress,
@@ -5816,8 +5834,8 @@ var ToolMessage = ({
5816
5834
  terminalWidth,
5817
5835
  renderOutputAsMarkdown,
5818
5836
  hasFocus: isThisShellFocused2,
5819
- maxLines: kind === "agent" /* Agent */ && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
5820
- overflowDirection: kind === "agent" /* Agent */ ? "bottom" : "top"
5837
+ maxLines: kind === Kind.Agent && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
5838
+ overflowDirection: kind === Kind.Agent ? "bottom" : "top"
5821
5839
  }
5822
5840
  ),
5823
5841
  isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
@@ -6133,7 +6151,7 @@ function getInitialTrustState(settings, cwd5, isCurrentWorkspace) {
6133
6151
  settings.merged,
6134
6152
  process3.cwd()
6135
6153
  );
6136
- const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === "DO_NOT_TRUST" /* DO_NOT_TRUST */);
6154
+ const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === TrustLevel.DO_NOT_TRUST);
6137
6155
  return {
6138
6156
  currentTrustLevel: explicitTrustLevel,
6139
6157
  isInheritedTrustFromParent: !!(source === "file" && isInheritedTrust),
@@ -6178,7 +6196,7 @@ var usePermissionsModifyTrust = (onExit, addItem, targetDirectory) => {
6178
6196
  process3.cwd(),
6179
6197
  newConfig
6180
6198
  );
6181
- if (trustLevel === "DO_NOT_TRUST" /* DO_NOT_TRUST */ && isTrusted) {
6199
+ if (trustLevel === TrustLevel.DO_NOT_TRUST && isTrusted) {
6182
6200
  let message = "Note: This folder is still trusted because the connected IDE workspace is trusted.";
6183
6201
  if (source === "file") {
6184
6202
  message = "Note: This folder is still trusted because a parent folder is trusted.";
@@ -6252,18 +6270,18 @@ function PermissionsModifyTrustDialog({
6252
6270
  const TRUST_LEVEL_ITEMS = [
6253
6271
  {
6254
6272
  label: `Trust this folder (${dirName})`,
6255
- value: "TRUST_FOLDER" /* TRUST_FOLDER */,
6256
- key: "TRUST_FOLDER" /* TRUST_FOLDER */
6273
+ value: TrustLevel.TRUST_FOLDER,
6274
+ key: TrustLevel.TRUST_FOLDER
6257
6275
  },
6258
6276
  {
6259
6277
  label: `Trust parent folder (${parentFolder})`,
6260
- value: "TRUST_PARENT" /* TRUST_PARENT */,
6261
- key: "TRUST_PARENT" /* TRUST_PARENT */
6278
+ value: TrustLevel.TRUST_PARENT,
6279
+ key: TrustLevel.TRUST_PARENT
6262
6280
  },
6263
6281
  {
6264
6282
  label: "Don't trust",
6265
- value: "DO_NOT_TRUST" /* DO_NOT_TRUST */,
6266
- key: "DO_NOT_TRUST" /* DO_NOT_TRUST */
6283
+ value: TrustLevel.DO_NOT_TRUST,
6284
+ key: TrustLevel.DO_NOT_TRUST
6267
6285
  }
6268
6286
  ];
6269
6287
  const {
@@ -6503,7 +6521,7 @@ var ShellToolMessage = ({
6503
6521
  maxLinesLimit: maxLines
6504
6522
  });
6505
6523
  import_react17.default.useEffect(() => {
6506
- const isExecuting = status === "executing" /* Executing */;
6524
+ const isExecuting = status === CoreToolCallStatus.Executing;
6507
6525
  if (isExecuting && ptyId) {
6508
6526
  try {
6509
6527
  const childWidth = terminalWidth - 4;
@@ -6895,22 +6913,22 @@ var hasPayload = (res) => {
6895
6913
  function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerminalHeight, isClickable) {
6896
6914
  const added = (diff.diffStat?.model_added_lines ?? 0) + (diff.diffStat?.user_added_lines ?? 0);
6897
6915
  const removed = (diff.diffStat?.model_removed_lines ?? 0) + (diff.diffStat?.user_removed_lines ?? 0);
6898
- const isAcceptedOrConfirming = status === "success" /* Success */ || status === "executing" /* Executing */ || status === "awaiting_approval" /* AwaitingApproval */;
6916
+ const isAcceptedOrConfirming = status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing || status === CoreToolCallStatus.AwaitingApproval;
6899
6917
  const addColor = isAcceptedOrConfirming ? theme.status.success : theme.text.secondary;
6900
6918
  const removeColor = isAcceptedOrConfirming ? theme.status.error : theme.text.secondary;
6901
6919
  const showDiffStat = !!diff.diffStat;
6902
6920
  const description = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box_default, { flexDirection: "row", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: theme.text.secondary, wrap: "truncate-end", children: diff.fileName }) });
6903
6921
  let resultSummary = "";
6904
6922
  let resultColor = theme.text.secondary;
6905
- if (status === "awaiting_approval" /* AwaitingApproval */) {
6923
+ if (status === CoreToolCallStatus.AwaitingApproval) {
6906
6924
  resultSummary = "Confirming";
6907
- } else if (status === "success" /* Success */ || status === "executing" /* Executing */) {
6925
+ } else if (status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing) {
6908
6926
  resultSummary = "Accepted";
6909
6927
  resultColor = theme.text.accent;
6910
- } else if (status === "cancelled" /* Cancelled */) {
6928
+ } else if (status === CoreToolCallStatus.Cancelled) {
6911
6929
  resultSummary = "Rejected";
6912
6930
  resultColor = theme.status.error;
6913
- } else if (status === "error" /* Error */) {
6931
+ } else if (status === CoreToolCallStatus.Error) {
6914
6932
  resultSummary = typeof resultDisplay === "string" ? resultDisplay : "Failed";
6915
6933
  resultColor = theme.status.error;
6916
6934
  }
@@ -6941,7 +6959,7 @@ function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerm
6941
6959
  filename: diff.fileName,
6942
6960
  terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
6943
6961
  availableTerminalHeight,
6944
- disableColor: status === "cancelled" /* Cancelled */
6962
+ disableColor: status === CoreToolCallStatus.Cancelled
6945
6963
  }
6946
6964
  );
6947
6965
  return { description, summary, payload };
@@ -7069,10 +7087,10 @@ var DenseToolMessage = (props) => {
7069
7087
  if (isGrepResult(resultDisplay)) {
7070
7088
  return getGenericSuccessData(resultDisplay, originalDescription);
7071
7089
  }
7072
- if (status === "success" /* Success */ && resultDisplay) {
7090
+ if (status === CoreToolCallStatus.Success && resultDisplay) {
7073
7091
  return getGenericSuccessData(resultDisplay, originalDescription);
7074
7092
  }
7075
- if (status === "error" /* Error */) {
7093
+ if (status === CoreToolCallStatus.Error) {
7076
7094
  const text = typeof resultDisplay === "string" ? resultDisplay.replace(/\n/g, " ") : "Failed";
7077
7095
  const errorSummary = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: theme.status.error, wrap: "truncate-end", children: [
7078
7096
  "\u2192 ",
@@ -7113,7 +7131,7 @@ var DenseToolMessage = (props) => {
7113
7131
  language: fileExtension,
7114
7132
  maxWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
7115
7133
  settings,
7116
- disableColor: status === "cancelled" /* Cancelled */,
7134
+ disableColor: status === CoreToolCallStatus.Cancelled,
7117
7135
  returnLines: true
7118
7136
  });
7119
7137
  } else {
@@ -7121,7 +7139,7 @@ var DenseToolMessage = (props) => {
7121
7139
  parsedLines,
7122
7140
  filename: diff.fileName,
7123
7141
  terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
7124
- disableColor: status === "cancelled" /* Cancelled */
7142
+ disableColor: status === CoreToolCallStatus.Cancelled
7125
7143
  });
7126
7144
  }
7127
7145
  }, [diff, isExpanded, isAlternateBuffer, terminalWidth, settings, status]);
@@ -7251,7 +7269,7 @@ function isToolExecuting(pendingHistoryItems) {
7251
7269
  return pendingHistoryItems.some((item) => {
7252
7270
  if (item && item.type === "tool_group") {
7253
7271
  return item.tools.some(
7254
- (tool) => "executing" /* Executing */ === tool.status
7272
+ (tool) => CoreToolCallStatus.Executing === tool.status
7255
7273
  );
7256
7274
  }
7257
7275
  return false;
@@ -7260,7 +7278,7 @@ function isToolExecuting(pendingHistoryItems) {
7260
7278
  function isToolAwaitingConfirmation(pendingHistoryItems) {
7261
7279
  return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
7262
7280
  (item) => item.tools.some(
7263
- (tool) => "awaiting_approval" /* AwaitingApproval */ === tool.status
7281
+ (tool) => CoreToolCallStatus.AwaitingApproval === tool.status
7264
7282
  )
7265
7283
  );
7266
7284
  }
@@ -7283,14 +7301,14 @@ function getToolGroupBorderAppearance(item, activeShellPtyId, embeddedShellFocus
7283
7301
  if (isTrackedToolCall(t)) {
7284
7302
  return t.status !== "success" && t.status !== "error" && t.status !== "cancelled";
7285
7303
  } else {
7286
- return t.status !== "success" /* Success */ && t.status !== "error" /* Error */ && t.status !== "cancelled" /* Cancelled */;
7304
+ return t.status !== CoreToolCallStatus.Success && t.status !== CoreToolCallStatus.Error && t.status !== CoreToolCallStatus.Cancelled;
7287
7305
  }
7288
7306
  });
7289
7307
  const isEmbeddedShellFocused = toolsToInspect.some((t) => {
7290
7308
  if (isTrackedToolCall(t)) {
7291
7309
  return isShellTool(t.request.name) && t.status === "executing" && t.pid === activeShellPtyId && !!embeddedShellFocused;
7292
7310
  } else {
7293
- return isShellTool(t.name) && t.status === "executing" /* Executing */ && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
7311
+ return isShellTool(t.name) && t.status === CoreToolCallStatus.Executing && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
7294
7312
  }
7295
7313
  });
7296
7314
  const isShellCommand = toolsToInspect.some((t) => {
@@ -7389,7 +7407,7 @@ var ToolGroupMessage = ({
7389
7407
  const groupedTools = (0, import_react21.useMemo)(() => {
7390
7408
  const groups = [];
7391
7409
  for (const tool of visibleToolCalls) {
7392
- if (tool.kind === "agent" /* Agent */) {
7410
+ if (tool.kind === Kind.Agent) {
7393
7411
  const lastGroup = groups[groups.length - 1];
7394
7412
  if (Array.isArray(lastGroup)) {
7395
7413
  lastGroup.push(tool);
@@ -7444,7 +7462,7 @@ var ToolGroupMessage = ({
7444
7462
  }, [groupedTools, isCompactModeEnabled, borderTopOverride]);
7445
7463
  let countToolCallsWithResults = 0;
7446
7464
  for (const tool of visibleToolCalls) {
7447
- if (tool.kind !== "agent" /* Agent */) {
7465
+ if (tool.kind !== Kind.Agent) {
7448
7466
  if (isCompactTool(tool, isCompactModeEnabled)) {
7449
7467
  if (hasDensePayload(tool)) {
7450
7468
  countToolCallsWithResults++;
@@ -7641,18 +7659,18 @@ function CompressionMessage({
7641
7659
  return "Compressing chat history";
7642
7660
  }
7643
7661
  switch (compressionStatus) {
7644
- case 1 /* COMPRESSED */:
7662
+ case CompressionStatus.COMPRESSED:
7645
7663
  return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
7646
- case 2 /* COMPRESSION_FAILED_INFLATED_TOKEN_COUNT */:
7664
+ case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
7647
7665
  if (originalTokens < 5e4) {
7648
7666
  return "Compression was not beneficial for this history size.";
7649
7667
  }
7650
7668
  return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
7651
- case 3 /* COMPRESSION_FAILED_TOKEN_COUNT_ERROR */:
7669
+ case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
7652
7670
  return "Could not compress chat history due to a token counting error.";
7653
- case 4 /* COMPRESSION_FAILED_EMPTY_SUMMARY */:
7671
+ case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
7654
7672
  return "Chat history compression failed: the model returned an empty summary.";
7655
- case 5 /* NOOP */:
7673
+ case CompressionStatus.NOOP:
7656
7674
  return "Nothing to compress.";
7657
7675
  default:
7658
7676
  return "";
@@ -8066,8 +8084,8 @@ var ModelUsageTable = ({ models }) => {
8066
8084
  );
8067
8085
  roleEntries.sort(([a], [b]) => {
8068
8086
  if (a === b) return 0;
8069
- if (a === "main" /* MAIN */) return -1;
8070
- if (b === "main" /* MAIN */) return 1;
8087
+ if (a === LlmRole.MAIN) return -1;
8088
+ if (b === LlmRole.MAIN) return 1;
8071
8089
  return a.localeCompare(b);
8072
8090
  });
8073
8091
  roleEntries.forEach(([role, roleMetrics]) => {
@@ -8398,8 +8416,8 @@ var ModelStatsDisplay = ({
8398
8416
  return validRoles.includes(role);
8399
8417
  }).sort((a, b) => {
8400
8418
  if (a === b) return 0;
8401
- if (a === "main" /* MAIN */) return -1;
8402
- if (b === "main" /* MAIN */) return 1;
8419
+ if (a === LlmRole.MAIN) return -1;
8420
+ if (b === LlmRole.MAIN) return 1;
8403
8421
  return a.localeCompare(b);
8404
8422
  });
8405
8423
  const createRow = (metric, getValue, options = {}) => {
@@ -9189,7 +9207,7 @@ var McpStatus = ({
9189
9207
  );
9190
9208
  const originalStatus = serverStatus(serverName);
9191
9209
  const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
9192
- const status = originalStatus === "disconnected" /* DISCONNECTED */ && hasCachedItems ? "connected" /* CONNECTED */ : originalStatus;
9210
+ const status = originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems ? MCPServerStatus.CONNECTED : originalStatus;
9193
9211
  let statusIndicator = "";
9194
9212
  let statusText = "";
9195
9213
  let statusColor = theme.text.primary;
@@ -9201,17 +9219,17 @@ var McpStatus = ({
9201
9219
  statusColor = theme.text.secondary;
9202
9220
  } else {
9203
9221
  switch (status) {
9204
- case "connected" /* CONNECTED */:
9222
+ case MCPServerStatus.CONNECTED:
9205
9223
  statusIndicator = "\u{1F7E2}";
9206
9224
  statusText = "Ready";
9207
9225
  statusColor = theme.status.success;
9208
9226
  break;
9209
- case "connecting" /* CONNECTING */:
9227
+ case MCPServerStatus.CONNECTING:
9210
9228
  statusIndicator = "\u{1F504}";
9211
9229
  statusText = "Starting... (first startup may take longer)";
9212
9230
  statusColor = theme.status.warning;
9213
9231
  break;
9214
- case "disconnected" /* DISCONNECTED */:
9232
+ case MCPServerStatus.DISCONNECTED:
9215
9233
  default:
9216
9234
  statusIndicator = "\u{1F534}";
9217
9235
  statusText = "Disconnected";
@@ -9259,12 +9277,12 @@ var McpStatus = ({
9259
9277
  /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Text, { children: [
9260
9278
  " - ",
9261
9279
  statusText,
9262
- status === "connected" /* CONNECTED */ && parts.length > 0 && ` (${parts.join(", ")})`
9280
+ status === MCPServerStatus.CONNECTED && parts.length > 0 && ` (${parts.join(", ")})`
9263
9281
  ] }),
9264
9282
  authStatusNode
9265
9283
  ] }),
9266
- status === "connecting" /* CONNECTING */ && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
9267
- status === "disconnected" /* DISCONNECTED */ && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Text, { children: [
9284
+ status === MCPServerStatus.CONNECTING && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
9285
+ status === MCPServerStatus.DISCONNECTED && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Text, { children: [
9268
9286
  " (",
9269
9287
  toolCount,
9270
9288
  " tools cached)"
@@ -9817,7 +9835,7 @@ var Notifications = () => {
9817
9835
  if (dismissed) return [];
9818
9836
  const counts = persistentState.get("startupWarningCounts") || {};
9819
9837
  return startupWarnings.filter((w) => {
9820
- if (w.priority === "low" /* Low */) {
9838
+ if (w.priority === WarningPriority.Low) {
9821
9839
  const count = counts[w.id] || 0;
9822
9840
  return count < MAX_STARTUP_WARNING_SHOW_COUNT;
9823
9841
  }
@@ -9830,7 +9848,7 @@ var Notifications = () => {
9830
9848
  const counts = { ...persistentState.get("startupWarningCounts") || {} };
9831
9849
  let changed = false;
9832
9850
  visibleWarnings.forEach((w) => {
9833
- if (w.priority === "low" /* Low */) {
9851
+ if (w.priority === WarningPriority.Low) {
9834
9852
  counts[w.id] = (counts[w.id] || 0) + 1;
9835
9853
  changed = true;
9836
9854
  }
@@ -9937,7 +9955,7 @@ var UserIdentity = ({ config }) => {
9937
9955
  }
9938
9956
  return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Box_default, { flexDirection: "column", children: [
9939
9957
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Box_default, { children: [
9940
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Text, { children: [
9958
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType === AuthType.LOGIN_WITH_GOOGLE ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Text, { children: [
9941
9959
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Text, { bold: true, children: [
9942
9960
  "Signed in with Google",
9943
9961
  email ? ":" : ""
@@ -10171,7 +10189,7 @@ var import_react32 = __toESM(require_react(), 1);
10171
10189
  function getConfirmingToolState(pendingHistoryItems) {
10172
10190
  const allPendingTools = getAllToolCalls(pendingHistoryItems);
10173
10191
  const confirmingTools = allPendingTools.filter(
10174
- (tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
10192
+ (tool) => tool.status === CoreToolCallStatus.AwaitingApproval
10175
10193
  );
10176
10194
  if (confirmingTools.length === 0) {
10177
10195
  return null;
@@ -11481,7 +11499,7 @@ var ExitPlanModeDialog = ({
11481
11499
  {
11482
11500
  questions: [
11483
11501
  {
11484
- type: "choice" /* CHOICE */,
11502
+ type: QuestionType.CHOICE,
11485
11503
  header: "Approval",
11486
11504
  question: planContent,
11487
11505
  options: [
@@ -11502,9 +11520,9 @@ var ExitPlanModeDialog = ({
11502
11520
  onSubmit: (answers) => {
11503
11521
  const answer = answers["0"];
11504
11522
  if (answer === "Yes, automatically accept edits" /* Auto */) {
11505
- onApprove("autoEdit" /* AUTO_EDIT */);
11523
+ onApprove(ApprovalMode.AUTO_EDIT);
11506
11524
  } else if (answer === "Yes, manually accept edits" /* Manual */) {
11507
- onApprove("default" /* DEFAULT */);
11525
+ onApprove(ApprovalMode.DEFAULT);
11508
11526
  } else if (answer) {
11509
11527
  onFeedback(answer);
11510
11528
  }
@@ -11715,7 +11733,7 @@ ${deceptiveUrlWarnings.map(
11715
11733
  );
11716
11734
  (0, import_react37.useEffect)(() => {
11717
11735
  if (isCancelling) {
11718
- handleConfirm("cancel" /* Cancel */);
11736
+ handleConfirm(ToolConfirmationOutcome.Cancel);
11719
11737
  }
11720
11738
  }, [isCancelling, handleConfirm]);
11721
11739
  const handleSelect = (0, import_react37.useCallback)(
@@ -11728,19 +11746,19 @@ ${deceptiveUrlWarnings.map(
11728
11746
  if (!confirmationDetails.isModifying) {
11729
11747
  options2.push({
11730
11748
  label: "Allow once",
11731
- value: "proceed_once" /* ProceedOnce */,
11749
+ value: ToolConfirmationOutcome.ProceedOnce,
11732
11750
  key: "Allow once"
11733
11751
  });
11734
11752
  if (isTrustedFolder) {
11735
11753
  options2.push({
11736
11754
  label: "Allow for this session",
11737
- value: "proceed_always" /* ProceedAlways */,
11755
+ value: ToolConfirmationOutcome.ProceedAlways,
11738
11756
  key: "Allow for this session"
11739
11757
  });
11740
11758
  if (allowPermanentApproval) {
11741
11759
  options2.push({
11742
11760
  label: "Allow for this file in all future sessions",
11743
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
11761
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
11744
11762
  key: "Allow for this file in all future sessions"
11745
11763
  });
11746
11764
  }
@@ -11748,119 +11766,119 @@ ${deceptiveUrlWarnings.map(
11748
11766
  if (!config.getIdeMode() || !isDiffingEnabled) {
11749
11767
  options2.push({
11750
11768
  label: "Modify with external editor",
11751
- value: "modify_with_editor" /* ModifyWithEditor */,
11769
+ value: ToolConfirmationOutcome.ModifyWithEditor,
11752
11770
  key: "Modify with external editor"
11753
11771
  });
11754
11772
  }
11755
11773
  options2.push({
11756
11774
  label: "No, suggest changes (esc)",
11757
- value: "cancel" /* Cancel */,
11775
+ value: ToolConfirmationOutcome.Cancel,
11758
11776
  key: "No, suggest changes (esc)"
11759
11777
  });
11760
11778
  }
11761
11779
  } else if (confirmationDetails.type === "sandbox_expansion") {
11762
11780
  options2.push({
11763
11781
  label: "Allow once",
11764
- value: "proceed_once" /* ProceedOnce */,
11782
+ value: ToolConfirmationOutcome.ProceedOnce,
11765
11783
  key: "Allow once"
11766
11784
  });
11767
11785
  if (isTrustedFolder) {
11768
11786
  options2.push({
11769
11787
  label: "Allow for this session",
11770
- value: "proceed_always" /* ProceedAlways */,
11788
+ value: ToolConfirmationOutcome.ProceedAlways,
11771
11789
  key: "Allow for this session"
11772
11790
  });
11773
11791
  if (allowPermanentApproval) {
11774
11792
  options2.push({
11775
11793
  label: "Allow for all future sessions",
11776
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
11794
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
11777
11795
  key: "Allow for all future sessions"
11778
11796
  });
11779
11797
  }
11780
11798
  }
11781
11799
  options2.push({
11782
11800
  label: "No, suggest changes (esc)",
11783
- value: "cancel" /* Cancel */,
11801
+ value: ToolConfirmationOutcome.Cancel,
11784
11802
  key: "No, suggest changes (esc)"
11785
11803
  });
11786
11804
  } else if (confirmationDetails.type === "exec") {
11787
11805
  options2.push({
11788
11806
  label: "Allow once",
11789
- value: "proceed_once" /* ProceedOnce */,
11807
+ value: ToolConfirmationOutcome.ProceedOnce,
11790
11808
  key: "Allow once"
11791
11809
  });
11792
11810
  if (isTrustedFolder) {
11793
11811
  options2.push({
11794
11812
  label: `Allow for this session`,
11795
- value: "proceed_always" /* ProceedAlways */,
11813
+ value: ToolConfirmationOutcome.ProceedAlways,
11796
11814
  key: `Allow for this session`
11797
11815
  });
11798
11816
  if (allowPermanentApproval) {
11799
11817
  options2.push({
11800
11818
  label: `Allow this command for all future sessions`,
11801
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
11819
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
11802
11820
  key: `Allow for all future sessions`
11803
11821
  });
11804
11822
  }
11805
11823
  }
11806
11824
  options2.push({
11807
11825
  label: "No, suggest changes (esc)",
11808
- value: "cancel" /* Cancel */,
11826
+ value: ToolConfirmationOutcome.Cancel,
11809
11827
  key: "No, suggest changes (esc)"
11810
11828
  });
11811
11829
  } else if (confirmationDetails.type === "info") {
11812
11830
  options2.push({
11813
11831
  label: "Allow once",
11814
- value: "proceed_once" /* ProceedOnce */,
11832
+ value: ToolConfirmationOutcome.ProceedOnce,
11815
11833
  key: "Allow once"
11816
11834
  });
11817
11835
  if (isTrustedFolder) {
11818
11836
  options2.push({
11819
11837
  label: "Allow for this session",
11820
- value: "proceed_always" /* ProceedAlways */,
11838
+ value: ToolConfirmationOutcome.ProceedAlways,
11821
11839
  key: "Allow for this session"
11822
11840
  });
11823
11841
  if (allowPermanentApproval) {
11824
11842
  options2.push({
11825
11843
  label: "Allow for all future sessions",
11826
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
11844
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
11827
11845
  key: "Allow for all future sessions"
11828
11846
  });
11829
11847
  }
11830
11848
  }
11831
11849
  options2.push({
11832
11850
  label: "No, suggest changes (esc)",
11833
- value: "cancel" /* Cancel */,
11851
+ value: ToolConfirmationOutcome.Cancel,
11834
11852
  key: "No, suggest changes (esc)"
11835
11853
  });
11836
11854
  } else if (confirmationDetails.type === "mcp") {
11837
11855
  options2.push({
11838
11856
  label: "Allow once",
11839
- value: "proceed_once" /* ProceedOnce */,
11857
+ value: ToolConfirmationOutcome.ProceedOnce,
11840
11858
  key: "Allow once"
11841
11859
  });
11842
11860
  if (isTrustedFolder) {
11843
11861
  options2.push({
11844
11862
  label: "Allow tool for this session",
11845
- value: "proceed_always_tool" /* ProceedAlwaysTool */,
11863
+ value: ToolConfirmationOutcome.ProceedAlwaysTool,
11846
11864
  key: "Allow tool for this session"
11847
11865
  });
11848
11866
  options2.push({
11849
11867
  label: "Allow all server tools for this session",
11850
- value: "proceed_always_server" /* ProceedAlwaysServer */,
11868
+ value: ToolConfirmationOutcome.ProceedAlwaysServer,
11851
11869
  key: "Allow all server tools for this session"
11852
11870
  });
11853
11871
  if (allowPermanentApproval) {
11854
11872
  options2.push({
11855
11873
  label: "Allow tool for all future sessions",
11856
- value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
11874
+ value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
11857
11875
  key: "Allow tool for all future sessions"
11858
11876
  });
11859
11877
  }
11860
11878
  }
11861
11879
  options2.push({
11862
11880
  label: "No, suggest changes (esc)",
11863
- value: "cancel" /* Cancel */,
11881
+ value: ToolConfirmationOutcome.Cancel,
11864
11882
  key: "No, suggest changes (esc)"
11865
11883
  });
11866
11884
  }
@@ -11899,7 +11917,7 @@ ${deceptiveUrlWarnings.map(
11899
11917
  const containsRedirection = commandsToDisplay.some(
11900
11918
  (cmd) => hasRedirection(cmd)
11901
11919
  );
11902
- const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
11920
+ const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
11903
11921
  if (containsRedirection && !isAutoEdit) {
11904
11922
  extraInfoLines = 1;
11905
11923
  }
@@ -11925,7 +11943,7 @@ ${deceptiveUrlWarnings.map(
11925
11943
  const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
11926
11944
  if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
11927
11945
  const alwaysAndSaveIndex = options2.findIndex(
11928
- (o) => o.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */
11946
+ (o) => o.value === ToolConfirmationOutcome.ProceedAlwaysAndSave
11929
11947
  );
11930
11948
  if (alwaysAndSaveIndex !== -1) {
11931
11949
  initialIndex2 = alwaysAndSaveIndex;
@@ -11942,10 +11960,10 @@ ${deceptiveUrlWarnings.map(
11942
11960
  {
11943
11961
  questions: confirmationDetails.questions,
11944
11962
  onSubmit: (answers) => {
11945
- handleConfirm("proceed_once" /* ProceedOnce */, { answers });
11963
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, { answers });
11946
11964
  },
11947
11965
  onCancel: () => {
11948
- handleConfirm("cancel" /* Cancel */);
11966
+ handleConfirm(ToolConfirmationOutcome.Cancel);
11949
11967
  },
11950
11968
  width: terminalWidth,
11951
11969
  availableHeight: bodyHeight
@@ -11966,19 +11984,19 @@ ${deceptiveUrlWarnings.map(
11966
11984
  planPath: confirmationDetails.planPath,
11967
11985
  getPreferredEditor,
11968
11986
  onApprove: (approvalMode) => {
11969
- handleConfirm("proceed_once" /* ProceedOnce */, {
11987
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
11970
11988
  approved: true,
11971
11989
  approvalMode
11972
11990
  });
11973
11991
  },
11974
11992
  onFeedback: (feedback) => {
11975
- handleConfirm("proceed_once" /* ProceedOnce */, {
11993
+ handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
11976
11994
  approved: false,
11977
11995
  feedback
11978
11996
  });
11979
11997
  },
11980
11998
  onCancel: () => {
11981
- handleConfirm("cancel" /* Cancel */);
11999
+ handleConfirm(ToolConfirmationOutcome.Cancel);
11982
12000
  },
11983
12001
  width: terminalWidth,
11984
12002
  availableHeight: bodyHeight
@@ -12088,7 +12106,7 @@ ${deceptiveUrlWarnings.map(
12088
12106
  const containsRedirection = commandsToDisplay.some(
12089
12107
  (cmd) => hasRedirection(cmd)
12090
12108
  );
12091
- const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
12109
+ const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
12092
12110
  let warnings = null;
12093
12111
  if (containsRedirection && !isAutoEdit) {
12094
12112
  const tipText = `To auto-accept, press ${formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */)}`;
@@ -12251,7 +12269,7 @@ ${deceptiveUrlWarnings.map(
12251
12269
  const bodyOverflowDirection = confirmationDetails.type === "mcp" && isMcpToolDetailsExpanded ? "bottom" : "top";
12252
12270
  const renderRadioItem = (0, import_react37.useCallback)(
12253
12271
  (item, { titleColor }) => {
12254
- if (item.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */) {
12272
+ if (item.value === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
12255
12273
  return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(Text, { color: titleColor, wrap: "truncate", children: [
12256
12274
  item.label,
12257
12275
  " ",
@@ -14255,7 +14273,7 @@ function validateAuthMethodWithSettings(authType, settings) {
14255
14273
  if (settings.merged.security.auth.useExternal) {
14256
14274
  return null;
14257
14275
  }
14258
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14276
+ if (authType === AuthType.USE_GEMINI) {
14259
14277
  return null;
14260
14278
  }
14261
14279
  return validateAuthMethod(authType);
@@ -14307,7 +14325,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
14307
14325
  }
14308
14326
  return;
14309
14327
  }
14310
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14328
+ if (authType === AuthType.USE_GEMINI) {
14311
14329
  const key = await reloadApiKey();
14312
14330
  if (!key) {
14313
14331
  setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
@@ -14382,31 +14400,31 @@ function AuthDialog({
14382
14400
  let items = [
14383
14401
  {
14384
14402
  label: "Sign in with Google",
14385
- value: "oauth-personal" /* LOGIN_WITH_GOOGLE */,
14386
- key: "oauth-personal" /* LOGIN_WITH_GOOGLE */
14403
+ value: AuthType.LOGIN_WITH_GOOGLE,
14404
+ key: AuthType.LOGIN_WITH_GOOGLE
14387
14405
  },
14388
14406
  ...process.env["CLOUD_SHELL"] === "true" ? [
14389
14407
  {
14390
14408
  label: "Use Cloud Shell user credentials",
14391
- value: "compute-default-credentials" /* COMPUTE_ADC */,
14392
- key: "compute-default-credentials" /* COMPUTE_ADC */
14409
+ value: AuthType.COMPUTE_ADC,
14410
+ key: AuthType.COMPUTE_ADC
14393
14411
  }
14394
14412
  ] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
14395
14413
  {
14396
14414
  label: "Use metadata server application default credentials",
14397
- value: "compute-default-credentials" /* COMPUTE_ADC */,
14398
- key: "compute-default-credentials" /* COMPUTE_ADC */
14415
+ value: AuthType.COMPUTE_ADC,
14416
+ key: AuthType.COMPUTE_ADC
14399
14417
  }
14400
14418
  ] : [],
14401
14419
  {
14402
14420
  label: "Use Gemini API Key",
14403
- value: "gemini-api-key" /* USE_GEMINI */,
14404
- key: "gemini-api-key" /* USE_GEMINI */
14421
+ value: AuthType.USE_GEMINI,
14422
+ key: AuthType.USE_GEMINI
14405
14423
  },
14406
14424
  {
14407
14425
  label: "Vertex AI",
14408
- value: "vertex-ai" /* USE_VERTEX_AI */,
14409
- key: "vertex-ai" /* USE_VERTEX_AI */
14426
+ value: AuthType.USE_VERTEX_AI,
14427
+ key: AuthType.USE_VERTEX_AI
14410
14428
  }
14411
14429
  ];
14412
14430
  if (settings.merged.security.auth.enforcedType) {
@@ -14428,9 +14446,9 @@ function AuthDialog({
14428
14446
  return item.value === defaultAuthType;
14429
14447
  }
14430
14448
  if (process.env["GEMINI_API_KEY"]) {
14431
- return item.value === "gemini-api-key" /* USE_GEMINI */;
14449
+ return item.value === AuthType.USE_GEMINI;
14432
14450
  }
14433
- return item.value === "oauth-personal" /* LOGIN_WITH_GOOGLE */;
14451
+ return item.value === AuthType.LOGIN_WITH_GOOGLE;
14434
14452
  });
14435
14453
  if (settings.merged.security.auth.enforcedType) {
14436
14454
  initialAuthIndex = 0;
@@ -14441,7 +14459,7 @@ function AuthDialog({
14441
14459
  return;
14442
14460
  }
14443
14461
  if (authType) {
14444
- const needsRestart = authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ || authType === "vertex-ai" /* USE_VERTEX_AI */ && process.env["CLOUD_SHELL"] === "true";
14462
+ const needsRestart = authType === AuthType.LOGIN_WITH_GOOGLE || authType === AuthType.USE_VERTEX_AI && process.env["CLOUD_SHELL"] === "true";
14445
14463
  if (needsRestart) {
14446
14464
  setAuthContext({ requiresRestart: true });
14447
14465
  } else {
@@ -14449,12 +14467,12 @@ function AuthDialog({
14449
14467
  }
14450
14468
  await clearCachedCredentialFile();
14451
14469
  settings.setValue(scope, "security.auth.selectedType", authType);
14452
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
14470
+ if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
14453
14471
  setExiting(true);
14454
14472
  setTimeout(relaunchApp, 100);
14455
14473
  return;
14456
14474
  }
14457
- if (authType === "gemini-api-key" /* USE_GEMINI */) {
14475
+ if (authType === AuthType.USE_GEMINI) {
14458
14476
  setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
14459
14477
  return;
14460
14478
  }
@@ -15204,11 +15222,11 @@ var PrivacyNoticeText = ({
15204
15222
  }) => {
15205
15223
  const authType = config.getContentGeneratorConfig()?.authType;
15206
15224
  switch (authType) {
15207
- case "gemini-api-key" /* USE_GEMINI */:
15225
+ case AuthType.USE_GEMINI:
15208
15226
  return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(GeminiPrivacyNotice, { onExit });
15209
- case "vertex-ai" /* USE_VERTEX_AI */:
15227
+ case AuthType.USE_VERTEX_AI:
15210
15228
  return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(CloudPaidPrivacyNotice, { onExit });
15211
- case "oauth-personal" /* LOGIN_WITH_GOOGLE */:
15229
+ case AuthType.LOGIN_WITH_GOOGLE:
15212
15230
  default:
15213
15231
  return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(CloudFreePrivacyNotice, { config, onExit });
15214
15232
  }
@@ -15249,7 +15267,7 @@ function ProQuotaDialog({
15249
15267
  value: "retry_always",
15250
15268
  key: "retry_always"
15251
15269
  },
15252
- ...authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && !isUltra ? [
15270
+ ...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
15253
15271
  {
15254
15272
  label: "Upgrade for higher limits",
15255
15273
  value: "upgrade",
@@ -16402,7 +16420,7 @@ function ModelDialog({ onClose }) {
16402
16420
  const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
16403
16421
  const useGemini31FlashLite = config?.getGemini31FlashLiteLaunchedSync?.() ?? false;
16404
16422
  const selectedAuthType = settings.merged.security.auth.selectedType;
16405
- const useCustomToolModel = useGemini31 && selectedAuthType === "gemini-api-key" /* USE_GEMINI */;
16423
+ const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
16406
16424
  const manualModelSelected = (0, import_react55.useMemo)(() => {
16407
16425
  if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
16408
16426
  const def = config.getModelConfigService().getModelDefinition(preferredModel);
@@ -17719,10 +17737,10 @@ function initializeConsoleStore() {
17719
17737
  globalConsoleMessages = [];
17720
17738
  globalErrorCount = 0;
17721
17739
  notifyListeners();
17722
- coreEvents.off("console-log" /* ConsoleLog */, handleConsoleLog);
17723
- coreEvents.off("output" /* Output */, handleOutput);
17724
- coreEvents.on("console-log" /* ConsoleLog */, handleConsoleLog);
17725
- coreEvents.on("output" /* Output */, handleOutput);
17740
+ coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
17741
+ coreEvents.off(CoreEvent.Output, handleOutput);
17742
+ coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
17743
+ coreEvents.on(CoreEvent.Output, handleOutput);
17726
17744
  }
17727
17745
  function notifyListeners() {
17728
17746
  for (const listener of listeners) {
@@ -19855,7 +19873,7 @@ function usePromptCompletion({
19855
19873
  { model: "prompt-completion" },
19856
19874
  contents,
19857
19875
  signal,
19858
- "utility_autocomplete" /* UTILITY_AUTOCOMPLETE */
19876
+ LlmRole.UTILITY_AUTOCOMPLETE
19859
19877
  );
19860
19878
  if (signal.aborted) {
19861
19879
  return;
@@ -21925,9 +21943,9 @@ var InputPrompt = ({
21925
21943
  onSuggestionsVisibilityChange(shouldShowSuggestions);
21926
21944
  }
21927
21945
  }, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
21928
- const showAutoAcceptStyling = !shellModeActive && approvalMode === "autoEdit" /* AUTO_EDIT */;
21929
- const showYoloStyling = !shellModeActive && approvalMode === "yolo" /* YOLO */;
21930
- const showPlanStyling = !shellModeActive && approvalMode === "plan" /* PLAN */;
21946
+ const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
21947
+ const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
21948
+ const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
21931
21949
  let statusColor;
21932
21950
  let statusText = "";
21933
21951
  if (shellModeActive) {
@@ -22760,22 +22778,22 @@ var ApprovalModeIndicator = ({
22760
22778
  const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
22761
22779
  const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
22762
22780
  switch (approvalMode) {
22763
- case "autoEdit" /* AUTO_EDIT */:
22781
+ case ApprovalMode.AUTO_EDIT:
22764
22782
  textColor = theme.status.warning;
22765
22783
  textContent = "auto-accept edits";
22766
22784
  subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
22767
22785
  break;
22768
- case "plan" /* PLAN */:
22786
+ case ApprovalMode.PLAN:
22769
22787
  textColor = theme.status.success;
22770
22788
  textContent = "plan";
22771
22789
  subText = `${cycleHint} to manual`;
22772
22790
  break;
22773
- case "yolo" /* YOLO */:
22791
+ case ApprovalMode.YOLO:
22774
22792
  textColor = theme.status.error;
22775
22793
  textContent = "YOLO";
22776
22794
  subText = yoloHint;
22777
22795
  break;
22778
- case "default" /* DEFAULT */:
22796
+ case ApprovalMode.DEFAULT:
22779
22797
  default:
22780
22798
  textColor = theme.text.accent;
22781
22799
  textContent = "";
@@ -22823,7 +22841,7 @@ var useComposerStatus = () => {
22823
22841
  (item) => item.type === "tool_group"
22824
22842
  ).some(
22825
22843
  (item) => item.tools.some(
22826
- (tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
22844
+ (tool) => tool.status === CoreToolCallStatus.AwaitingApproval
22827
22845
  )
22828
22846
  ),
22829
22847
  [uiState.pendingHistoryItems]
@@ -22838,13 +22856,13 @@ var useComposerStatus = () => {
22838
22856
  const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
22839
22857
  if (hideMinimalModeHintWhileBusy) return null;
22840
22858
  switch (showApprovalModeIndicator) {
22841
- case "yolo" /* YOLO */:
22859
+ case ApprovalMode.YOLO:
22842
22860
  return { text: "YOLO", color: theme.status.error };
22843
- case "plan" /* PLAN */:
22861
+ case ApprovalMode.PLAN:
22844
22862
  return { text: "plan", color: theme.status.success };
22845
- case "autoEdit" /* AUTO_EDIT */:
22863
+ case ApprovalMode.AUTO_EDIT:
22846
22864
  return { text: "auto edit", color: theme.status.warning };
22847
- case "default" /* DEFAULT */:
22865
+ case ApprovalMode.DEFAULT:
22848
22866
  default:
22849
22867
  return null;
22850
22868
  }
@@ -23198,7 +23216,7 @@ var ConfigInitDisplay = ({
23198
23216
  let connected = 0;
23199
23217
  const connecting = [];
23200
23218
  for (const [name, client] of clients.entries()) {
23201
- if (client.getStatus() === "connected" /* CONNECTED */) {
23219
+ if (client.getStatus() === MCPServerStatus.CONNECTED) {
23202
23220
  connected++;
23203
23221
  } else {
23204
23222
  connecting.push(name);
@@ -23220,9 +23238,9 @@ var ConfigInitDisplay = ({
23220
23238
  );
23221
23239
  }
23222
23240
  };
23223
- coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
23241
+ coreEvents.on(CoreEvent.McpClientUpdate, onChange);
23224
23242
  return () => {
23225
- coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
23243
+ coreEvents.off(CoreEvent.McpClientUpdate, onChange);
23226
23244
  };
23227
23245
  }, [initialMessage]);
23228
23246
  return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(Text, { children: [
@@ -23937,7 +23955,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
23937
23955
  callId,
23938
23956
  name: SHELL_COMMAND_NAME,
23939
23957
  description: rawQuery,
23940
- status: "executing" /* Executing */,
23958
+ status: CoreToolCallStatus.Executing,
23941
23959
  isClientInitiated: true,
23942
23960
  resultDisplay: "",
23943
23961
  confirmationDetails: void 0
@@ -24078,7 +24096,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
24078
24096
  mainContent = result.output.trim() || "(Command produced no output)";
24079
24097
  }
24080
24098
  let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
24081
- let finalStatus = "success" /* Success */;
24099
+ let finalStatus = CoreToolCallStatus.Success;
24082
24100
  const prependToAnsiOutput = (output, text) => {
24083
24101
  const newLines = text.split("\n").map((line) => [
24084
24102
  {
@@ -24097,20 +24115,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
24097
24115
  };
24098
24116
  let prefix = "";
24099
24117
  if (result.error) {
24100
- finalStatus = "error" /* Error */;
24118
+ finalStatus = CoreToolCallStatus.Error;
24101
24119
  prefix = result.error.message;
24102
24120
  } else if (result.aborted) {
24103
- finalStatus = "cancelled" /* Cancelled */;
24121
+ finalStatus = CoreToolCallStatus.Cancelled;
24104
24122
  prefix = "Command was cancelled.";
24105
24123
  } else if (result.backgrounded) {
24106
- finalStatus = "success" /* Success */;
24124
+ finalStatus = CoreToolCallStatus.Success;
24107
24125
  finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
24108
24126
  mainContent = finalOutput;
24109
24127
  } else if (result.signal) {
24110
- finalStatus = "error" /* Error */;
24128
+ finalStatus = CoreToolCallStatus.Error;
24111
24129
  prefix = `Command terminated by signal: ${result.signal}.`;
24112
24130
  } else if (result.exitCode !== 0) {
24113
- finalStatus = "error" /* Error */;
24131
+ finalStatus = CoreToolCallStatus.Error;
24114
24132
  prefix = `Command exited with code ${result.exitCode}.`;
24115
24133
  }
24116
24134
  if (prefix) {
@@ -24136,7 +24154,7 @@ ${mainContent}`;
24136
24154
  status: finalStatus,
24137
24155
  resultDisplay: finalOutput
24138
24156
  };
24139
- if (finalStatus !== "cancelled" /* Cancelled */) {
24157
+ if (finalStatus !== CoreToolCallStatus.Cancelled) {
24140
24158
  addItemToHistory(
24141
24159
  {
24142
24160
  type: "tool_group",
@@ -25126,7 +25144,7 @@ function useQuotaAndFallback({
25126
25144
  error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
25127
25145
  `/stats model for usage details`,
25128
25146
  `/model to switch models.`,
25129
- contentGeneratorConfig?.authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? `/auth to switch to API key.` : null
25147
+ contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
25130
25148
  ].filter(Boolean);
25131
25149
  message = messageLines.join("\n");
25132
25150
  } else if (error instanceof ModelNotFoundError) {
@@ -25314,7 +25332,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
25314
25332
  );
25315
25333
  setEditorError(null);
25316
25334
  setIsEditorDialogOpen(false);
25317
- coreEvents.emit("editor-selected" /* EditorSelected */, { editor: editorType });
25335
+ coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
25318
25336
  } catch (error) {
25319
25337
  setEditorError(`Failed to set editor preference: ${error}`);
25320
25338
  }
@@ -25323,7 +25341,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
25323
25341
  );
25324
25342
  const exitEditorDialog = (0, import_react91.useCallback)(() => {
25325
25343
  setIsEditorDialogOpen(false);
25326
- coreEvents.emit("editor-selected" /* EditorSelected */, { editor: void 0 });
25344
+ coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
25327
25345
  }, []);
25328
25346
  return {
25329
25347
  isEditorDialogOpen,
@@ -25700,7 +25718,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
25700
25718
  canonicalPath: resolvedCommandPath
25701
25719
  } = parseSlashCommand(trimmed, commands);
25702
25720
  if (!commandToExecute) {
25703
- const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === "in_progress" /* IN_PROGRESS */;
25721
+ const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
25704
25722
  if (isMcpLoading) {
25705
25723
  setIsProcessing(true);
25706
25724
  if (addToHistory) {
@@ -25880,7 +25898,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
25880
25898
  onConfirm: async (resolvedOutcome) => {
25881
25899
  resolve3({
25882
25900
  outcome: resolvedOutcome,
25883
- approvedCommands: resolvedOutcome === "cancel" /* Cancel */ ? [] : result.commandsToConfirm
25901
+ approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
25884
25902
  });
25885
25903
  }
25886
25904
  };
@@ -25888,7 +25906,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
25888
25906
  callId,
25889
25907
  name: "Expansion",
25890
25908
  description: "Command expansion needs shell access",
25891
- status: "awaiting_approval" /* AwaitingApproval */,
25909
+ status: CoreToolCallStatus.AwaitingApproval,
25892
25910
  isClientInitiated: true,
25893
25911
  resultDisplay: void 0,
25894
25912
  confirmationDetails
@@ -25899,7 +25917,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
25899
25917
  });
25900
25918
  });
25901
25919
  setPendingItem(null);
25902
- if (outcome === "cancel" /* Cancel */ || !approvedCommands || approvedCommands.length === 0) {
25920
+ if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
25903
25921
  addItem(
25904
25922
  {
25905
25923
  type: "info" /* INFO */,
@@ -25909,7 +25927,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
25909
25927
  );
25910
25928
  return { type: "handled" };
25911
25929
  }
25912
- if (outcome === "proceed_always" /* ProceedAlways */) {
25930
+ if (outcome === ToolConfirmationOutcome.ProceedAlways) {
25913
25931
  setSessionShellAllowlist(
25914
25932
  (prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
25915
25933
  );
@@ -26385,7 +26403,7 @@ function mapToDisplay(toolOrTools, options = {}) {
26385
26403
  let description;
26386
26404
  let renderOutputAsMarkdown = false;
26387
26405
  const displayName = call.tool?.displayName ?? call.request.name;
26388
- if (call.status === "error" /* Error */) {
26406
+ if (call.status === CoreToolCallStatus.Error) {
26389
26407
  description = JSON.stringify(call.request.args);
26390
26408
  } else {
26391
26409
  description = call.invocation.getDescription();
@@ -26408,27 +26426,27 @@ function mapToDisplay(toolOrTools, options = {}) {
26408
26426
  let progress = void 0;
26409
26427
  let progressTotal = void 0;
26410
26428
  switch (call.status) {
26411
- case "success" /* Success */:
26429
+ case CoreToolCallStatus.Success:
26412
26430
  resultDisplay = call.response.resultDisplay;
26413
26431
  outputFile = call.response.outputFile;
26414
26432
  break;
26415
- case "error" /* Error */:
26416
- case "cancelled" /* Cancelled */:
26433
+ case CoreToolCallStatus.Error:
26434
+ case CoreToolCallStatus.Cancelled:
26417
26435
  resultDisplay = call.response.resultDisplay;
26418
26436
  break;
26419
- case "awaiting_approval" /* AwaitingApproval */:
26437
+ case CoreToolCallStatus.AwaitingApproval:
26420
26438
  correlationId = call.correlationId;
26421
26439
  confirmationDetails = call.confirmationDetails;
26422
26440
  break;
26423
- case "executing" /* Executing */:
26441
+ case CoreToolCallStatus.Executing:
26424
26442
  resultDisplay = call.liveOutput;
26425
26443
  ptyId = call.pid;
26426
26444
  progressMessage = call.progressMessage;
26427
26445
  progress = call.progress;
26428
26446
  progressTotal = call.progressTotal;
26429
26447
  break;
26430
- case "scheduled" /* Scheduled */:
26431
- case "validating" /* Validating */:
26448
+ case CoreToolCallStatus.Scheduled:
26449
+ case CoreToolCallStatus.Validating:
26432
26450
  break;
26433
26451
  default: {
26434
26452
  const exhaustiveCheck = call;
@@ -26499,7 +26517,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26499
26517
  const handler = (event) => {
26500
26518
  const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
26501
26519
  const hasExecuting = event.toolCalls.some(
26502
- (tc) => tc.status === "executing" /* Executing */ || (tc.status === "success" /* Success */ || tc.status === "error" /* Error */) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
26520
+ (tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
26503
26521
  );
26504
26522
  if (hasExecuting) {
26505
26523
  setLastToolOutputTime(Date.now());
@@ -26508,7 +26526,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26508
26526
  const prevCalls = prev[event.schedulerId] ?? [];
26509
26527
  const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
26510
26528
  const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
26511
- (tc) => tc.status === "awaiting_approval" /* AwaitingApproval */ || prevCallIds.has(tc.request.callId)
26529
+ (tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
26512
26530
  );
26513
26531
  if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
26514
26532
  return prev;
@@ -26520,9 +26538,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26520
26538
  };
26521
26539
  });
26522
26540
  };
26523
- messageBus.subscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
26541
+ messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
26524
26542
  return () => {
26525
- messageBus.unsubscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
26543
+ messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
26526
26544
  };
26527
26545
  }, [messageBus, internalAdaptToolCalls]);
26528
26546
  (0, import_react98.useEffect)(() => {
@@ -26544,9 +26562,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
26544
26562
  };
26545
26563
  });
26546
26564
  };
26547
- messageBus.subscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
26565
+ messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
26548
26566
  return () => {
26549
- messageBus.unsubscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
26567
+ messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
26550
26568
  };
26551
26569
  }, [messageBus]);
26552
26570
  const schedule = (0, import_react98.useCallback)(
@@ -26645,8 +26663,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
26645
26663
  const prev = prevMap.get(coreCall.request.callId);
26646
26664
  const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
26647
26665
  let status = coreCall.status;
26648
- if ((status === "success" /* Success */ || status === "error" /* Error */) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
26649
- status = "executing" /* Executing */;
26666
+ if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
26667
+ status = CoreToolCallStatus.Executing;
26650
26668
  }
26651
26669
  return {
26652
26670
  ...coreCall,
@@ -26678,7 +26696,7 @@ function getBackgroundedToolInfo(toolCall) {
26678
26696
  };
26679
26697
  }
26680
26698
  function isBackgroundableExecutingToolCall(toolCall) {
26681
- return toolCall.status === "executing" /* Executing */ && typeof toolCall.pid === "number";
26699
+ return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
26682
26700
  }
26683
26701
  function showCitations(settings) {
26684
26702
  const enabled = settings.merged.ui.showCitations;
@@ -26688,14 +26706,14 @@ function showCitations(settings) {
26688
26706
  return true;
26689
26707
  }
26690
26708
  function calculateStreamingState(isResponding, toolCalls) {
26691
- if (toolCalls.some((tc) => tc.status === "awaiting_approval" /* AwaitingApproval */)) {
26709
+ if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
26692
26710
  return "waiting_for_confirmation" /* WaitingForConfirmation */;
26693
26711
  }
26694
26712
  const isAnyToolActive = toolCalls.some((tc) => {
26695
- if (tc.status === "executing" /* Executing */ || tc.status === "scheduled" /* Scheduled */ || tc.status === "validating" /* Validating */) {
26713
+ if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
26696
26714
  return true;
26697
26715
  }
26698
- if (tc.status === "success" /* Success */ || tc.status === "error" /* Error */ || tc.status === "cancelled" /* Cancelled */) {
26716
+ if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
26699
26717
  return !tc.responseSubmittedToGemini;
26700
26718
  }
26701
26719
  return false;
@@ -26742,9 +26760,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
26742
26760
  }
26743
26761
  setRetryStatus(payload);
26744
26762
  };
26745
- coreEvents.on("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
26763
+ coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
26746
26764
  return () => {
26747
- coreEvents.off("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
26765
+ coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
26748
26766
  };
26749
26767
  }, [isRespondingRef]);
26750
26768
  const [
@@ -26877,12 +26895,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
26877
26895
  const tc = toolCalls[i];
26878
26896
  if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
26879
26897
  if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
26880
- const isAgent = tc.tool?.kind === "agent" /* Agent */;
26898
+ const isAgent = tc.tool?.kind === Kind.Agent;
26881
26899
  if (isAgent) {
26882
26900
  let contigAgentsComplete = true;
26883
26901
  for (let j = i + 1; j < toolCalls.length; j++) {
26884
26902
  const nextTc = toolCalls[j];
26885
- if (nextTc.tool?.kind === "agent" /* Agent */) {
26903
+ if (nextTc.tool?.kind === Kind.Agent) {
26886
26904
  if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
26887
26905
  contigAgentsComplete = false;
26888
26906
  break;
@@ -26908,7 +26926,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
26908
26926
  let currentGroup = [];
26909
26927
  for (const tc of toolsToPush) {
26910
26928
  newPushed.add(tc.request.callId);
26911
- if (tc.tool?.kind === "agent" /* Agent */) {
26929
+ if (tc.tool?.kind === Kind.Agent) {
26912
26930
  currentGroup.push(tc);
26913
26931
  } else {
26914
26932
  if (currentGroup.length > 0) {
@@ -27058,7 +27076,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27058
27076
  prevActiveShellPtyIdRef.current = activeShellPtyId;
27059
27077
  }, [activeShellPtyId, addItem, setIsResponding]);
27060
27078
  (0, import_react99.useEffect)(() => {
27061
- if (config.getApprovalMode() === "yolo" /* YOLO */ && streamingState === "idle" /* Idle */) {
27079
+ if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
27062
27080
  const lastUserMessageIndex = history.findLastIndex(
27063
27081
  (item) => item.type === "user" /* USER */
27064
27082
  );
@@ -27126,7 +27144,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27126
27144
  return;
27127
27145
  }
27128
27146
  const hasActiveTools = toolCalls.some(
27129
- (tc) => tc.status === "executing" /* Executing */ || tc.status === "scheduled" /* Scheduled */ || tc.status === "validating" /* Validating */
27147
+ (tc) => tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating
27130
27148
  );
27131
27149
  if (streamingState === "idle" /* Idle */ && !isRespondingRef.current && !hasActiveTools) {
27132
27150
  if (clearBuffer) {
@@ -27153,7 +27171,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27153
27171
  if (tool.name === SHELL_COMMAND_NAME) {
27154
27172
  return {
27155
27173
  ...tool,
27156
- status: "cancelled" /* Cancelled */,
27174
+ status: CoreToolCallStatus.Cancelled,
27157
27175
  resultDisplay: tool.resultDisplay
27158
27176
  };
27159
27177
  }
@@ -27218,7 +27236,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27218
27236
  let localQueryToSendToGemini = null;
27219
27237
  if (typeof query === "string") {
27220
27238
  const trimmedQuery = query.trim();
27221
- await logger?.logMessage("user" /* USER */, trimmedQuery);
27239
+ await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
27222
27240
  if (!shellModeActive) {
27223
27241
  const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
27224
27242
  if (slashCommandResult) {
@@ -27374,7 +27392,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27374
27392
  if (pendingHistoryItemRef.current) {
27375
27393
  if (pendingHistoryItemRef.current.type === "tool_group") {
27376
27394
  const updatedTools = pendingHistoryItemRef.current.tools.map(
27377
- (tool) => tool.status === "validating" /* Validating */ || tool.status === "scheduled" /* Scheduled */ || tool.status === "awaiting_approval" /* AwaitingApproval */ || tool.status === "executing" /* Executing */ ? { ...tool, status: "cancelled" /* Cancelled */ } : tool
27395
+ (tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
27378
27396
  );
27379
27397
  const pendingItem = {
27380
27398
  ...pendingHistoryItemRef.current,
@@ -27620,15 +27638,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27620
27638
  let geminiMessageBuffer = "";
27621
27639
  const toolCallRequests = [];
27622
27640
  for await (const event of stream) {
27623
- if (event.type !== "thought" /* Thought */ && thoughtRef.current !== null) {
27641
+ if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
27624
27642
  setThought(null);
27625
27643
  }
27626
27644
  switch (event.type) {
27627
- case "thought" /* Thought */:
27645
+ case GeminiEventType.Thought:
27628
27646
  setLastGeminiActivityTime(Date.now());
27629
27647
  handleThoughtEvent(event.value, userMessageTimestamp);
27630
27648
  break;
27631
- case "content" /* Content */:
27649
+ case GeminiEventType.Content:
27632
27650
  setLastGeminiActivityTime(Date.now());
27633
27651
  geminiMessageBuffer = handleContentEvent(
27634
27652
  event.value,
@@ -27636,16 +27654,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27636
27654
  userMessageTimestamp
27637
27655
  );
27638
27656
  break;
27639
- case "tool_call_request" /* ToolCallRequest */:
27657
+ case GeminiEventType.ToolCallRequest:
27640
27658
  toolCallRequests.push(event.value);
27641
27659
  break;
27642
- case "user_cancelled" /* UserCancelled */:
27660
+ case GeminiEventType.UserCancelled:
27643
27661
  handleUserCancelledEvent(userMessageTimestamp);
27644
27662
  break;
27645
- case "error" /* Error */:
27663
+ case GeminiEventType.Error:
27646
27664
  handleErrorEvent(event.value, userMessageTimestamp);
27647
27665
  break;
27648
- case "agent_execution_stopped" /* AgentExecutionStopped */:
27666
+ case GeminiEventType.AgentExecutionStopped:
27649
27667
  handleAgentExecutionStoppedEvent(
27650
27668
  event.value.reason,
27651
27669
  userMessageTimestamp,
@@ -27653,7 +27671,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27653
27671
  event.value.contextCleared
27654
27672
  );
27655
27673
  break;
27656
- case "agent_execution_blocked" /* AgentExecutionBlocked */:
27674
+ case GeminiEventType.AgentExecutionBlocked:
27657
27675
  handleAgentExecutionBlockedEvent(
27658
27676
  event.value.reason,
27659
27677
  userMessageTimestamp,
@@ -27661,35 +27679,35 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27661
27679
  event.value.contextCleared
27662
27680
  );
27663
27681
  break;
27664
- case "chat_compressed" /* ChatCompressed */:
27682
+ case GeminiEventType.ChatCompressed:
27665
27683
  handleChatCompressionEvent(event.value, userMessageTimestamp);
27666
27684
  break;
27667
- case "tool_call_confirmation" /* ToolCallConfirmation */:
27668
- case "tool_call_response" /* ToolCallResponse */:
27685
+ case GeminiEventType.ToolCallConfirmation:
27686
+ case GeminiEventType.ToolCallResponse:
27669
27687
  break;
27670
- case "max_session_turns" /* MaxSessionTurns */:
27688
+ case GeminiEventType.MaxSessionTurns:
27671
27689
  handleMaxSessionTurnsEvent();
27672
27690
  break;
27673
- case "context_window_will_overflow" /* ContextWindowWillOverflow */:
27691
+ case GeminiEventType.ContextWindowWillOverflow:
27674
27692
  handleContextWindowWillOverflowEvent(
27675
27693
  event.value.estimatedRequestTokenCount,
27676
27694
  event.value.remainingTokenCount
27677
27695
  );
27678
27696
  break;
27679
- case "finished" /* Finished */:
27697
+ case GeminiEventType.Finished:
27680
27698
  handleFinishedEvent(event, userMessageTimestamp);
27681
27699
  break;
27682
- case "citation" /* Citation */:
27700
+ case GeminiEventType.Citation:
27683
27701
  handleCitationEvent(event.value, userMessageTimestamp);
27684
27702
  break;
27685
- case "model_info" /* ModelInfo */:
27703
+ case GeminiEventType.ModelInfo:
27686
27704
  handleChatModelEvent(event.value, userMessageTimestamp);
27687
27705
  break;
27688
- case "loop_detected" /* LoopDetected */:
27706
+ case GeminiEventType.LoopDetected:
27689
27707
  loopDetectedRef.current = true;
27690
27708
  break;
27691
- case "retry" /* Retry */:
27692
- case "invalid_stream" /* InvalidStream */:
27709
+ case GeminiEventType.Retry:
27710
+ case GeminiEventType.InvalidStream:
27693
27711
  break;
27694
27712
  default: {
27695
27713
  const unreachable = event;
@@ -27730,7 +27748,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27730
27748
  const submitQuery = (0, import_react99.useCallback)(
27731
27749
  async (query, options, prompt_id) => runInDevTraceSpan(
27732
27750
  {
27733
- operation: options?.isContinuation ? "system_prompt" /* SystemPrompt */ : "user_prompt" /* UserPrompt */,
27751
+ operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
27734
27752
  sessionId: config.getSessionId()
27735
27753
  },
27736
27754
  async ({ metadata: spanMetadata }) => {
@@ -27890,7 +27908,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27890
27908
  );
27891
27909
  const handleApprovalModeChange = (0, import_react99.useCallback)(
27892
27910
  async (newApprovalMode) => {
27893
- if (previousApprovalModeRef.current === "plan" /* PLAN */ && newApprovalMode !== "plan" /* PLAN */ && streamingState === "idle" /* Idle */) {
27911
+ if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
27894
27912
  if (geminiClient) {
27895
27913
  try {
27896
27914
  await geminiClient.addHistory({
@@ -27913,11 +27931,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27913
27931
  }
27914
27932
  }
27915
27933
  previousApprovalModeRef.current = newApprovalMode;
27916
- if (newApprovalMode === "yolo" /* YOLO */ || newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
27934
+ if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
27917
27935
  let awaitingApprovalCalls = toolCalls.filter(
27918
27936
  (call) => call.status === "awaiting_approval" && !call.request.forcedAsk
27919
27937
  );
27920
- if (newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
27938
+ if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
27921
27939
  awaitingApprovalCalls = awaitingApprovalCalls.filter(
27922
27940
  (call) => EDIT_TOOL_NAMES.has(call.request.name)
27923
27941
  );
@@ -27926,11 +27944,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27926
27944
  if (call.correlationId) {
27927
27945
  try {
27928
27946
  await config.getMessageBus().publish({
27929
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
27947
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
27930
27948
  correlationId: call.correlationId,
27931
27949
  confirmed: true,
27932
27950
  requiresUserConfirmation: false,
27933
- outcome: "proceed_once" /* ProceedOnce */
27951
+ outcome: ToolConfirmationOutcome.ProceedOnce
27934
27952
  });
27935
27953
  } catch (error) {
27936
27954
  debugLogger.warn(
@@ -28008,14 +28026,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28008
28026
  );
28009
28027
  if (isLowErrorVerbosity) {
28010
28028
  suppressedToolErrorCountRef.current += geminiTools.filter(
28011
- (tc) => tc.status === "error" /* Error */
28029
+ (tc) => tc.status === CoreToolCallStatus.Error
28012
28030
  ).length;
28013
28031
  }
28014
28032
  if (geminiTools.length === 0) {
28015
28033
  return;
28016
28034
  }
28017
28035
  const stopExecutionTool = geminiTools.find(
28018
- (tc) => tc.response.errorType === "stop_execution" /* STOP_EXECUTION */
28036
+ (tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
28019
28037
  );
28020
28038
  if (stopExecutionTool && stopExecutionTool.response.error) {
28021
28039
  maybeAddSuppressedToolErrorNote();
@@ -28035,9 +28053,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28035
28053
  (tc) => !isTopicTool2(tc.request.name)
28036
28054
  );
28037
28055
  const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
28038
- (tc) => tc.status === "cancelled" /* Cancelled */
28056
+ (tc) => tc.status === CoreToolCallStatus.Cancelled
28039
28057
  );
28040
- const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === "cancelled" /* Cancelled */);
28058
+ const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
28041
28059
  if (allDeclinableToolsCancelled || allToolsCancelled) {
28042
28060
  if (!turnCancelledRef.current) {
28043
28061
  addItem({
@@ -28118,7 +28136,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28118
28136
  return;
28119
28137
  }
28120
28138
  const restorableToolCalls = toolCalls.filter(
28121
- (toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === "awaiting_approval" /* AwaitingApproval */
28139
+ (toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
28122
28140
  );
28123
28141
  if (restorableToolCalls.length > 0) {
28124
28142
  if (!gitService) {
@@ -28340,14 +28358,14 @@ var useAgentStream = ({
28340
28358
  const displayName = legacyState?.displayName ?? event.name;
28341
28359
  const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
28342
28360
  const desc = legacyState?.description ?? "";
28343
- const fallbackKind = "other" /* Other */;
28361
+ const fallbackKind = Kind.Other;
28344
28362
  const newCall = {
28345
28363
  callId: event.requestId,
28346
28364
  name: displayName,
28347
28365
  originalRequestName: event.name,
28348
28366
  description: desc,
28349
28367
  display: event.display,
28350
- status: "scheduled" /* Scheduled */,
28368
+ status: CoreToolCallStatus.Scheduled,
28351
28369
  isClientInitiated: false,
28352
28370
  renderOutputAsMarkdown: isOutputMarkdown,
28353
28371
  kind: legacyState?.kind ?? fallbackKind,
@@ -28365,10 +28383,10 @@ var useAgentStream = ({
28365
28383
  const evtStatus = legacyState?.status;
28366
28384
  let status = tc.status;
28367
28385
  if (evtStatus === "executing")
28368
- status = "executing" /* Executing */;
28369
- else if (evtStatus === "error") status = "error" /* Error */;
28386
+ status = CoreToolCallStatus.Executing;
28387
+ else if (evtStatus === "error") status = CoreToolCallStatus.Error;
28370
28388
  else if (evtStatus === "success")
28371
- status = "success" /* Success */;
28389
+ status = CoreToolCallStatus.Success;
28372
28390
  const display = event.display?.result;
28373
28391
  const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
28374
28392
  const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
@@ -28401,7 +28419,7 @@ var useAgentStream = ({
28401
28419
  const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
28402
28420
  return {
28403
28421
  ...tc,
28404
- status: event.isError ? "error" /* Error */ : "success" /* Success */,
28422
+ status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
28405
28423
  display: event.display ? { ...tc.display, ...event.display } : tc.display,
28406
28424
  resultDisplay,
28407
28425
  outputFile
@@ -28467,7 +28485,7 @@ var useAgentStream = ({
28467
28485
  if (!options?.isContinuation) {
28468
28486
  if (typeof query === "string") {
28469
28487
  addItem({ type: "user" /* USER */, text: query }, timestamp);
28470
- void logger?.logMessage("user" /* USER */, query);
28488
+ void logger?.logMessage(MessageSenderType.USER, query);
28471
28489
  }
28472
28490
  startNewPrompt();
28473
28491
  }
@@ -29968,9 +29986,9 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
29968
29986
  const handleFolderTrustSelect = (0, import_react105.useCallback)(
29969
29987
  async (choice) => {
29970
29988
  const trustLevelMap = {
29971
- ["trust_folder" /* TRUST_FOLDER */]: "TRUST_FOLDER" /* TRUST_FOLDER */,
29972
- ["trust_parent" /* TRUST_PARENT */]: "TRUST_PARENT" /* TRUST_PARENT */,
29973
- ["do_not_trust" /* DO_NOT_TRUST */]: "DO_NOT_TRUST" /* DO_NOT_TRUST */
29989
+ ["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
29990
+ ["trust_parent" /* TRUST_PARENT */]: TrustLevel.TRUST_PARENT,
29991
+ ["do_not_trust" /* DO_NOT_TRUST */]: TrustLevel.DO_NOT_TRUST
29974
29992
  };
29975
29993
  const trustLevel = trustLevelMap[choice];
29976
29994
  if (!trustLevel) return;
@@ -29989,7 +30007,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
29989
30007
  }, 100);
29990
30008
  return;
29991
30009
  }
29992
- const currentIsTrusted = trustLevel === "TRUST_FOLDER" /* TRUST_FOLDER */ || trustLevel === "TRUST_PARENT" /* TRUST_PARENT */;
30010
+ const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
29993
30011
  onTrustChange(currentIsTrusted);
29994
30012
  setIsTrusted(currentIsTrusted);
29995
30013
  const wasTrusted = isTrusted ?? false;
@@ -30997,7 +31015,7 @@ function useMessageQueue({
30997
31015
  var import_react107 = __toESM(require_react(), 1);
30998
31016
  function useMcpStatus(config) {
30999
31017
  const [discoveryState, setDiscoveryState] = (0, import_react107.useState)(
31000
- () => config.getMcpClientManager()?.getDiscoveryState() ?? "not_started" /* NOT_STARTED */
31018
+ () => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
31001
31019
  );
31002
31020
  const [mcpServerCount, setMcpServerCount] = (0, import_react107.useState)(
31003
31021
  () => config.getMcpClientManager()?.getMcpServerCount() ?? 0
@@ -31010,12 +31028,12 @@ function useMcpStatus(config) {
31010
31028
  setMcpServerCount(manager.getMcpServerCount());
31011
31029
  }
31012
31030
  };
31013
- coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
31031
+ coreEvents.on(CoreEvent.McpClientUpdate, onChange);
31014
31032
  return () => {
31015
- coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
31033
+ coreEvents.off(CoreEvent.McpClientUpdate, onChange);
31016
31034
  };
31017
31035
  }, [config]);
31018
- const isMcpReady = discoveryState === "completed" /* COMPLETED */ || discoveryState === "not_started" /* NOT_STARTED */ && mcpServerCount === 0;
31036
+ const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
31019
31037
  return {
31020
31038
  discoveryState,
31021
31039
  mcpServerCount,
@@ -31042,7 +31060,7 @@ function useApprovalModeIndicator({
31042
31060
  (key) => {
31043
31061
  let nextApprovalMode;
31044
31062
  if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
31045
- if (config.isYoloModeDisabled() && config.getApprovalMode() !== "yolo" /* YOLO */) {
31063
+ if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
31046
31064
  if (addItem) {
31047
31065
  let text = "You cannot enter YOLO mode since it is disabled in your settings.";
31048
31066
  const adminSettings = config.getRemoteAdminSettings();
@@ -31060,21 +31078,21 @@ function useApprovalModeIndicator({
31060
31078
  }
31061
31079
  return;
31062
31080
  }
31063
- nextApprovalMode = config.getApprovalMode() === "yolo" /* YOLO */ ? "default" /* DEFAULT */ : "yolo" /* YOLO */;
31081
+ nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
31064
31082
  } else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
31065
31083
  const currentMode = config.getApprovalMode();
31066
31084
  switch (currentMode) {
31067
- case "default" /* DEFAULT */:
31068
- nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
31085
+ case ApprovalMode.DEFAULT:
31086
+ nextApprovalMode = ApprovalMode.AUTO_EDIT;
31069
31087
  break;
31070
- case "autoEdit" /* AUTO_EDIT */:
31071
- nextApprovalMode = allowPlanMode ? "plan" /* PLAN */ : "default" /* DEFAULT */;
31088
+ case ApprovalMode.AUTO_EDIT:
31089
+ nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
31072
31090
  break;
31073
- case "plan" /* PLAN */:
31074
- nextApprovalMode = "default" /* DEFAULT */;
31091
+ case ApprovalMode.PLAN:
31092
+ nextApprovalMode = ApprovalMode.DEFAULT;
31075
31093
  break;
31076
- case "yolo" /* YOLO */:
31077
- nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
31094
+ case ApprovalMode.YOLO:
31095
+ nextApprovalMode = ApprovalMode.AUTO_EDIT;
31078
31096
  break;
31079
31097
  default:
31080
31098
  }
@@ -31484,11 +31502,11 @@ var useHookDisplayState = () => {
31484
31502
  removeHook();
31485
31503
  }
31486
31504
  };
31487
- coreEvents.on("hook-start" /* HookStart */, handleHookStart);
31488
- coreEvents.on("hook-end" /* HookEnd */, handleHookEnd);
31505
+ coreEvents.on(CoreEvent.HookStart, handleHookStart);
31506
+ coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
31489
31507
  return () => {
31490
- coreEvents.off("hook-start" /* HookStart */, handleHookStart);
31491
- coreEvents.off("hook-end" /* HookEnd */, handleHookEnd);
31508
+ coreEvents.off(CoreEvent.HookStart, handleHookStart);
31509
+ coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
31492
31510
  activeTimeouts.forEach(clearTimeout);
31493
31511
  activeTimeouts.clear();
31494
31512
  };
@@ -32341,7 +32359,7 @@ var AppContainer = (props) => {
32341
32359
  setConfigInitialized(true);
32342
32360
  startupProfiler.flush(config);
32343
32361
  startAutoMemoryIfEnabled(config);
32344
- const sessionStartSource = resumedSessionData ? "resume" /* Resume */ : "startup" /* Startup */;
32362
+ const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
32345
32363
  const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
32346
32364
  if (result) {
32347
32365
  if (result.systemMessage) {
@@ -32377,7 +32395,7 @@ var AppContainer = (props) => {
32377
32395
  );
32378
32396
  const ideClient = await IdeClient.getInstance();
32379
32397
  await ideClient.disconnect();
32380
- await config?.getHookSystem()?.fireSessionEndEvent("exit" /* Exit */);
32398
+ await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
32381
32399
  };
32382
32400
  registerCleanup(cleanupFn);
32383
32401
  return () => {
@@ -32402,11 +32420,11 @@ var AppContainer = (props) => {
32402
32420
  resetTime: payload.resetTime
32403
32421
  });
32404
32422
  };
32405
- coreEvents.on("model-changed" /* ModelChanged */, handleModelChanged);
32406
- coreEvents.on("quota-changed" /* QuotaChanged */, handleQuotaChanged);
32423
+ coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
32424
+ coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
32407
32425
  return () => {
32408
- coreEvents.off("model-changed" /* ModelChanged */, handleModelChanged);
32409
- coreEvents.off("quota-changed" /* QuotaChanged */, handleQuotaChanged);
32426
+ coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
32427
+ coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
32410
32428
  };
32411
32429
  }, [config]);
32412
32430
  (0, import_react121.useEffect)(() => {
@@ -32419,16 +32437,16 @@ var AppContainer = (props) => {
32419
32437
  const handleAgentsDiscovered = (payload) => {
32420
32438
  setNewAgents(payload.agents);
32421
32439
  };
32422
- coreEvents.on("settings-changed" /* SettingsChanged */, handleSettingsChanged);
32423
- coreEvents.on("admin-settings-changed" /* AdminSettingsChanged */, handleAdminSettingsChanged);
32424
- coreEvents.on("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
32440
+ coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
32441
+ coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
32442
+ coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
32425
32443
  return () => {
32426
- coreEvents.off("settings-changed" /* SettingsChanged */, handleSettingsChanged);
32444
+ coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
32427
32445
  coreEvents.off(
32428
- "admin-settings-changed" /* AdminSettingsChanged */,
32446
+ CoreEvent.AdminSettingsChanged,
32429
32447
  handleAdminSettingsChanged
32430
32448
  );
32431
- coreEvents.off("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
32449
+ coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
32432
32450
  };
32433
32451
  }, [settings]);
32434
32452
  const { errorCount, clearErrorCount } = useErrorCount();
@@ -32494,11 +32512,11 @@ var AppContainer = (props) => {
32494
32512
  exitEditorDialog
32495
32513
  } = useEditorSettings(settings, setEditorError, historyManager.addItem);
32496
32514
  (0, import_react121.useEffect)(() => {
32497
- coreEvents.on("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
32498
- coreEvents.on("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
32515
+ coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
32516
+ coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
32499
32517
  return () => {
32500
- coreEvents.off("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
32501
- coreEvents.off("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
32518
+ coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
32519
+ coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
32502
32520
  };
32503
32521
  }, [handleEditorClose, openEditorDialog]);
32504
32522
  (0, import_react121.useEffect)(() => {
@@ -32566,7 +32584,7 @@ var AppContainer = (props) => {
32566
32584
  errorVerbosity: settings.merged.ui.errorVerbosity
32567
32585
  });
32568
32586
  const isAuthDialogOpen = authState === "updating" /* Updating */;
32569
- const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== "gemini-api-key" /* USE_GEMINI */;
32587
+ const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
32570
32588
  const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
32571
32589
  const { loadHistoryForResume, isResuming } = useSessionResume({
32572
32590
  config,
@@ -32594,7 +32612,7 @@ var AppContainer = (props) => {
32594
32612
  async (authType, scope) => {
32595
32613
  if (authType) {
32596
32614
  const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
32597
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */) {
32615
+ if (authType === AuthType.LOGIN_WITH_GOOGLE) {
32598
32616
  setAuthContext({ requiresRestart: true });
32599
32617
  } else {
32600
32618
  setAuthContext({});
@@ -32622,7 +32640,7 @@ var AppContainer = (props) => {
32622
32640
  );
32623
32641
  return;
32624
32642
  }
32625
- if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
32643
+ if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
32626
32644
  writeToStdout(`
32627
32645
  ----------------------------------------------------------------
32628
32646
  Logging in with Google... Restarting Gemini CLI to continue.
@@ -32645,7 +32663,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
32645
32663
  }
32646
32664
  await saveApiKey(apiKey);
32647
32665
  await reloadApiKey();
32648
- await config.refreshAuth("gemini-api-key" /* USE_GEMINI */);
32666
+ await config.refreshAuth(AuthType.USE_GEMINI);
32649
32667
  setAuthState("authenticated" /* Authenticated */);
32650
32668
  } catch (e) {
32651
32669
  onAuthError(
@@ -32670,7 +32688,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
32670
32688
  `Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
32671
32689
  );
32672
32690
  } else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
32673
- if (settings.merged.security.auth.selectedType === "gemini-api-key" /* USE_GEMINI */) {
32691
+ if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
32674
32692
  return;
32675
32693
  }
32676
32694
  const error = validateAuthMethod(
@@ -32799,9 +32817,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
32799
32817
  }
32800
32818
  });
32801
32819
  };
32802
- coreEvents.on("consent-request" /* ConsentRequest */, handleConsentRequest);
32820
+ coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
32803
32821
  return () => {
32804
- coreEvents.off("consent-request" /* ConsentRequest */, handleConsentRequest);
32822
+ coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
32805
32823
  };
32806
32824
  }, []);
32807
32825
  const performMemoryRefresh = (0, import_react121.useCallback)(async () => {
@@ -33482,7 +33500,7 @@ ${queuedText}` : queuedText;
33482
33500
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
33483
33501
  if (settings.merged.general.devtools) {
33484
33502
  void (async () => {
33485
- const { toggleDevToolsPanel } = await import("./devtoolsService-USWJ4OCC.js");
33503
+ const { toggleDevToolsPanel } = await import("./devtoolsService-SPV43SGI.js");
33486
33504
  await toggleDevToolsPanel(
33487
33505
  config,
33488
33506
  showErrorDetails,
@@ -33700,17 +33718,17 @@ ${queuedText}` : queuedText;
33700
33718
  Date.now()
33701
33719
  );
33702
33720
  };
33703
- coreEvents.on("user-feedback" /* UserFeedback */, handleUserFeedback);
33704
- coreEvents.on("hook-system-message" /* HookSystemMessage */, handleHookSystemMessage);
33721
+ coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
33722
+ coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
33705
33723
  coreEvents.drainBacklogs();
33706
33724
  return () => {
33707
- coreEvents.off("user-feedback" /* UserFeedback */, handleUserFeedback);
33708
- coreEvents.off("hook-system-message" /* HookSystemMessage */, handleHookSystemMessage);
33725
+ coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
33726
+ coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
33709
33727
  };
33710
33728
  }, [historyManager]);
33711
33729
  const nightly = props.version.includes("nightly");
33712
33730
  const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
33713
- 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;
33731
+ 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;
33714
33732
  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;
33715
33733
  const hasPendingToolConfirmation = (0, import_react121.useMemo)(
33716
33734
  () => isToolAwaitingConfirmation(pendingHistoryItems),
@@ -33810,9 +33828,9 @@ ${queuedText}` : queuedText;
33810
33828
  const handleMemoryChanged = (result) => {
33811
33829
  setGeminiMdFileCount(result.fileCount);
33812
33830
  };
33813
- coreEvents.on("memory-changed" /* MemoryChanged */, handleMemoryChanged);
33831
+ coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
33814
33832
  return () => {
33815
- coreEvents.off("memory-changed" /* MemoryChanged */, handleMemoryChanged);
33833
+ coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
33816
33834
  };
33817
33835
  }, []);
33818
33836
  (0, import_react121.useEffect)(() => {