@google/gemini-cli 0.45.0-preview.0 → 0.45.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 (66) hide show
  1. package/bundle/{chunk-I7UI7NB6.js → chunk-2ZH72RHY.js} +3 -3
  2. package/bundle/{chunk-EZCW6IDX.js → chunk-3NDAYKF4.js} +1 -1
  3. package/bundle/{chunk-IPQLMJS5.js → chunk-4KX3ETW3.js} +1 -1
  4. package/bundle/{chunk-4FNXKOEB.js → chunk-565MWDPP.js} +23 -13
  5. package/bundle/{chunk-J4QUIOHJ.js → chunk-5BX5PJIE.js} +7 -7
  6. package/bundle/{chunk-J7SEBVDD.js → chunk-5YTIYFJO.js} +7544 -14042
  7. package/bundle/{chunk-GIXFMPPJ.js → chunk-6WWGBNKT.js} +1 -1
  8. package/bundle/{chunk-4M3TG6ZU.js → chunk-BLUAEAZN.js} +1 -1
  9. package/bundle/{chunk-2RRZM3IR.js → chunk-BO72FGK2.js} +7 -7
  10. package/bundle/{chunk-NOJPXYUJ.js → chunk-CJHCK2YW.js} +1 -1
  11. package/bundle/{chunk-S4CJ6KAO.js → chunk-CJTRYZPP.js} +3 -3
  12. package/bundle/chunk-DDJWQSDN.js +394439 -0
  13. package/bundle/{chunk-APSDEHHA.js → chunk-E3KBY4EQ.js} +1 -1
  14. package/bundle/{chunk-WPCNMQ6J.js → chunk-FEY3T6LA.js} +9 -8
  15. package/bundle/{chunk-Q3UZDZZV.js → chunk-HA5VES5S.js} +3 -3
  16. package/bundle/{chunk-Y5REX36P.js → chunk-HVWNKZSB.js} +1 -1
  17. package/bundle/{chunk-2O7YSVPU.js → chunk-HZCAEM2F.js} +2 -2
  18. package/bundle/{chunk-DMCSPKNM.js → chunk-IGJG7DNZ.js} +1 -1
  19. package/bundle/{chunk-TH3OOWK4.js → chunk-JWWA32XO.js} +67 -54
  20. package/bundle/{chunk-LUQGJPIY.js → chunk-JXVK53RJ.js} +2 -2
  21. package/bundle/{chunk-VS2OY6HJ.js → chunk-K43EAKOP.js} +8 -5
  22. package/bundle/{chunk-N4X4WHSW.js → chunk-NB2NOE4L.js} +2 -2
  23. package/bundle/chunk-NVJOR76X.js +1571 -0
  24. package/bundle/chunk-NYWYNF2Z.js +81685 -0
  25. package/bundle/chunk-OQLEYMM2.js +512 -0
  26. package/bundle/{chunk-OY6QYVTR.js → chunk-OWSYSTWM.js} +1 -1
  27. package/bundle/{chunk-CWAXEILN.js → chunk-R52453KY.js} +26 -16
  28. package/bundle/{chunk-R5OZKB4U.js → chunk-S6AQSJNU.js} +1 -1
  29. package/bundle/chunk-SKDT4PWC.js +118 -0
  30. package/bundle/chunk-TCAVPMJX.js +17320 -0
  31. package/bundle/chunk-WTRP3GGZ.js +154 -0
  32. package/bundle/chunk-Y6SLZFPD.js +398 -0
  33. package/bundle/{cleanup-2WCUS5XU.js → cleanup-2FHZMQ3Z.js} +2 -2
  34. package/bundle/{cleanup-7FHLTEXT.js → cleanup-F7XRM3DT.js} +2 -2
  35. package/bundle/{cleanup-WGOZFAQJ.js → cleanup-OZH3SJVM.js} +2 -2
  36. package/bundle/cleanup-ZO5CVKGH.js +32 -0
  37. package/bundle/{core-SIRU2VWJ.js → core-B47ZXN3Y.js} +1 -1
  38. package/bundle/{devtoolsService-IANYOK3R.js → devtoolsService-L7PYKOHR.js} +2 -2
  39. package/bundle/{devtoolsService-4Y2RGEUE.js → devtoolsService-OYQJHPEW.js} +4 -3
  40. package/bundle/devtoolsService-SGV7MSUA.js +856 -0
  41. package/bundle/{devtoolsService-F5XFL4BF.js → devtoolsService-XYSZCMQM.js} +2 -2
  42. package/bundle/{dist-67ZORME5.js → dist-C6L3MGQS.js} +1 -1
  43. package/bundle/{core-LD6MHGD6.js → dist-MOEHPHUN.js} +1 -1
  44. package/bundle/dist-WLKMTHZQ.js +2134 -0
  45. package/bundle/{gemini-5ZI322FJ.js → gemini-2XSNIT2N.js} +212 -196
  46. package/bundle/{gemini-24ENZ343.js → gemini-CHS2YNJG.js} +13 -13
  47. package/bundle/gemini-CQDPCFEE.js +16406 -0
  48. package/bundle/{gemini-74UML3PJ.js → gemini-LT5MWLZQ.js} +13 -13
  49. package/bundle/gemini.js +10 -9
  50. package/bundle/{interactiveCli-7GM3U7SA.js → interactiveCli-2YFAMDR5.js} +8 -8
  51. package/bundle/{interactiveCli-XM5HDVD7.js → interactiveCli-6EFCVZP7.js} +314 -295
  52. package/bundle/interactiveCli-HA3BASZN.js +34726 -0
  53. package/bundle/{interactiveCli-BVZLMTVC.js → interactiveCli-UUI7OUZK.js} +8 -8
  54. package/bundle/{liteRtServerManager-6N5DYDEQ.js → liteRtServerManager-2VKZTPMY.js} +4 -4
  55. package/bundle/{liteRtServerManager-JVMDH3TN.js → liteRtServerManager-4PZ3X7SS.js} +4 -4
  56. package/bundle/{liteRtServerManager-3HS3VUPU.js → liteRtServerManager-GH6VHWTU.js} +4 -4
  57. package/bundle/liteRtServerManager-OMSM6SJU.js +65 -0
  58. package/bundle/{oauth2-provider-U72EWZHQ.js → oauth2-provider-4UIWNIX3.js} +1 -1
  59. package/bundle/{oauth2-provider-RUFABDNL.js → oauth2-provider-BDX6V2YX.js} +1 -1
  60. package/bundle/{oauth2-provider-WS7LUQ5V.js → oauth2-provider-N2ZY2DXQ.js} +38 -72
  61. package/bundle/oauth2-provider-TRRJCE2P.js +235 -0
  62. package/bundle/{start-KOAGXRA2.js → start-3LEQZELI.js} +6 -6
  63. package/bundle/{start-XLIGOOW3.js → start-FH2E2VQ2.js} +6 -6
  64. package/bundle/{start-DJ6EBFEA.js → start-FPEO7KCZ.js} +6 -6
  65. package/bundle/start-J7G6YXDJ.js +18 -0
  66. package/package.json +1 -1
@@ -41,18 +41,18 @@ import {
41
41
  updateAllUpdatableExtensions,
42
42
  updateExtension,
43
43
  validateAuthMethod
44
- } from "./chunk-2RRZM3IR.js";
44
+ } from "./chunk-5BX5PJIE.js";
45
45
  import {
46
46
  appEvents
47
47
  } from "./chunk-5PS3AYFU.js";
48
48
  import {
49
49
  startCommand,
50
50
  startServer
51
- } from "./chunk-Q3UZDZZV.js";
51
+ } from "./chunk-CJTRYZPP.js";
52
52
  import {
53
53
  exitCli,
54
54
  require_source
55
- } from "./chunk-4M3TG6ZU.js";
55
+ } from "./chunk-3NDAYKF4.js";
56
56
  import {
57
57
  DEFAULT_PORT,
58
58
  GEMMA_MODEL_NAME,
@@ -86,11 +86,11 @@ import {
86
86
  readServerProcessInfo,
87
87
  resolveGemmaConfig,
88
88
  saveModelChange
89
- } from "./chunk-GIXFMPPJ.js";
89
+ } from "./chunk-K43EAKOP.js";
90
90
  import {
91
91
  RELAUNCH_EXIT_CODE
92
- } from "./chunk-LUQGJPIY.js";
93
- import "./chunk-WPCNMQ6J.js";
92
+ } from "./chunk-HZCAEM2F.js";
93
+ import "./chunk-FEY3T6LA.js";
94
94
  import {
95
95
  cleanupCheckpoints,
96
96
  registerCleanup,
@@ -99,12 +99,15 @@ import {
99
99
  runExitCleanup,
100
100
  runSyncCleanup,
101
101
  setupSignalHandlers
102
- } from "./chunk-OY6QYVTR.js";
102
+ } from "./chunk-OWSYSTWM.js";
103
103
  import {
104
104
  ASK_USER_TOOL_NAME,
105
+ ApprovalMode,
105
106
  AuthType,
106
107
  Client,
107
108
  Config,
109
+ CoreEvent,
110
+ CoreToolCallStatus,
108
111
  DEFAULT_CONTEXT_FILENAME,
109
112
  DEFAULT_FILE_FILTERING_OPTIONS,
110
113
  DEFAULT_GEMINI_EMBEDDING_MODEL,
@@ -126,32 +129,45 @@ import {
126
129
  FolderTrustDiscoveryService,
127
130
  GEMINI_DIR,
128
131
  GEMINI_MODEL_ALIAS_AUTO,
132
+ GeminiEventType,
129
133
  IdeClient,
134
+ IntegrityStatus,
130
135
  InvalidStreamError,
131
136
  JsonFormatter,
137
+ JsonStreamEventType,
138
+ Kind,
132
139
  LegacyAgentSession,
133
140
  Logger,
134
141
  MCPServerConfig,
142
+ MCPServerStatus,
143
+ MessageBusType,
144
+ OutputFormat,
135
145
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
136
146
  PREVIEW_GEMINI_3_1_MODEL,
137
147
  PREVIEW_GEMINI_FLASH_LITE_MODEL,
138
148
  PREVIEW_GEMINI_FLASH_MODEL,
139
149
  PREVIEW_GEMINI_MODEL,
150
+ PolicyDecision,
140
151
  PolicyIntegrityManager,
141
152
  REFERENCE_CONTENT_START,
142
153
  ROOT_SCHEDULER_ID,
143
154
  ReadManyFilesTool,
144
155
  Scheduler,
156
+ SessionEndReason,
157
+ SessionStartSource,
145
158
  ShellExecutionService,
146
159
  SimpleExtensionLoader,
147
160
  Storage,
148
161
  StreamJsonFormatter,
149
162
  ToolCallEvent,
150
163
  ToolConfirmationOutcome,
164
+ ToolErrorType,
165
+ TrustLevel,
151
166
  UserAccountManager,
152
167
  UserPromptEvent,
153
168
  ValidationCancelledError,
154
169
  ValidationRequiredError,
170
+ WarningPriority,
155
171
  applyAdminAllowlist,
156
172
  applyRequiredServers,
157
173
  clearCachedCredentialFile,
@@ -231,7 +247,7 @@ import {
231
247
  updatePolicy,
232
248
  writeToStderr,
233
249
  writeToStdout
234
- } from "./chunk-CWAXEILN.js";
250
+ } from "./chunk-DDJWQSDN.js";
235
251
  import "./chunk-6HI7VNOG.js";
236
252
  import "./chunk-TUDYL3X4.js";
237
253
  import "./chunk-IUUIT4SU.js";
@@ -5361,7 +5377,7 @@ var MCP_LIST_DEFAULT_TIMEOUT_MSEC = 5e3;
5361
5377
  async function testMCPConnection(serverName, config, isTrusted, activeSettings) {
5362
5378
  const isStdio = !!config.command;
5363
5379
  if (isStdio && !isTrusted) {
5364
- return "disconnected" /* DISCONNECTED */;
5380
+ return MCPServerStatus.DISCONNECTED;
5365
5381
  }
5366
5382
  const client = new Client({
5367
5383
  name: "mcp-test-client",
@@ -5397,7 +5413,7 @@ async function testMCPConnection(serverName, config, isTrusted, activeSettings)
5397
5413
  transport = await createTransport(serverName, config, false, mcpContext);
5398
5414
  } catch {
5399
5415
  await client.close();
5400
- return "disconnected" /* DISCONNECTED */;
5416
+ return MCPServerStatus.DISCONNECTED;
5401
5417
  }
5402
5418
  try {
5403
5419
  const timeout = config.timeout ?? MCP_LIST_DEFAULT_TIMEOUT_MSEC;
@@ -5411,10 +5427,10 @@ async function testMCPConnection(serverName, config, isTrusted, activeSettings)
5411
5427
  );
5412
5428
  }
5413
5429
  await client.close();
5414
- return "connected" /* CONNECTED */;
5430
+ return MCPServerStatus.CONNECTED;
5415
5431
  } catch {
5416
5432
  await transport.close();
5417
- return "disconnected" /* DISCONNECTED */;
5433
+ return MCPServerStatus.DISCONNECTED;
5418
5434
  }
5419
5435
  }
5420
5436
  async function getServerStatus(serverName, server, isTrusted, activeSettings, consolidatedExcluded, consolidatedAllowed) {
@@ -5427,12 +5443,12 @@ async function getServerStatus(serverName, server, isTrusted, activeSettings, co
5427
5443
  });
5428
5444
  if (!loadResult.allowed) {
5429
5445
  if (loadResult.blockType === "admin" || loadResult.blockType === "allowlist" || loadResult.blockType === "excludelist") {
5430
- return "blocked" /* BLOCKED */;
5446
+ return MCPServerStatus.BLOCKED;
5431
5447
  }
5432
- return "disabled" /* DISABLED */;
5448
+ return MCPServerStatus.DISABLED;
5433
5449
  }
5434
5450
  if (!isTrusted) {
5435
- return "disabled" /* DISABLED */;
5451
+ return MCPServerStatus.DISABLED;
5436
5452
  }
5437
5453
  return testMCPConnection(serverName, server, isTrusted, activeSettings);
5438
5454
  }
@@ -5478,23 +5494,23 @@ async function listMcpServers(loadedSettingsArg) {
5478
5494
  let statusIndicator = "";
5479
5495
  let statusText = "";
5480
5496
  switch (status) {
5481
- case "connected" /* CONNECTED */:
5497
+ case MCPServerStatus.CONNECTED:
5482
5498
  statusIndicator = import_chalk.default.green("\u2713");
5483
5499
  statusText = "Connected";
5484
5500
  break;
5485
- case "connecting" /* CONNECTING */:
5501
+ case MCPServerStatus.CONNECTING:
5486
5502
  statusIndicator = import_chalk.default.yellow("\u2026");
5487
5503
  statusText = "Connecting";
5488
5504
  break;
5489
- case "blocked" /* BLOCKED */:
5505
+ case MCPServerStatus.BLOCKED:
5490
5506
  statusIndicator = import_chalk.default.red("\u26D4");
5491
5507
  statusText = "Blocked";
5492
5508
  break;
5493
- case "disabled" /* DISABLED */:
5509
+ case MCPServerStatus.DISABLED:
5494
5510
  statusIndicator = import_chalk.default.gray("\u25CB");
5495
5511
  statusText = "Disabled";
5496
5512
  break;
5497
- case "disconnected" /* DISCONNECTED */:
5513
+ case MCPServerStatus.DISCONNECTED:
5498
5514
  default:
5499
5515
  statusIndicator = import_chalk.default.red("\u2717");
5500
5516
  statusText = "Disconnected";
@@ -5780,7 +5796,7 @@ async function handleInstall(args) {
5780
5796
  );
5781
5797
  if (confirmed) {
5782
5798
  const trustedFolders = loadTrustedFolders();
5783
- await trustedFolders.setValue(realPath, "TRUST_FOLDER" /* TRUST_FOLDER */);
5799
+ await trustedFolders.setValue(realPath, TrustLevel.TRUST_FOLDER);
5784
5800
  } else {
5785
5801
  throw new Error(
5786
5802
  `Installation aborted: Folder "${absolutePath}" is not trusted.`
@@ -7825,7 +7841,7 @@ async function loadSandboxConfig(settings, argv) {
7825
7841
  }
7826
7842
  const command2 = getSandboxCommand(sandboxValue);
7827
7843
  const packageJson = await getPackageJson(__dirname3);
7828
- const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.45.0-nightly.20260521.g854f811be" ?? customImage ?? packageJson?.config?.sandboxImageUri;
7844
+ const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.45.0-preview.1" ?? customImage ?? packageJson?.config?.sandboxImageUri;
7829
7845
  const isNative = command2 === "windows-native" || command2 === "sandbox-exec" || command2 === "lxc";
7830
7846
  return command2 && (image || isNative) ? { enabled: true, allowedPaths, networkAccess, command: command2, image } : void 0;
7831
7847
  }
@@ -7884,9 +7900,9 @@ async function resolveWorkspacePolicyState(options) {
7884
7900
  cwd,
7885
7901
  potentialWorkspacePoliciesDir
7886
7902
  );
7887
- if (integrityResult.status === "MATCH" /* MATCH */) {
7903
+ if (integrityResult.status === IntegrityStatus.MATCH) {
7888
7904
  workspacePoliciesDir = potentialWorkspacePoliciesDir;
7889
- } else if (integrityResult.status === "NEW" /* NEW */ && integrityResult.fileCount === 0) {
7905
+ } else if (integrityResult.status === IntegrityStatus.NEW && integrityResult.fileCount === 0) {
7890
7906
  workspacePoliciesDir = void 0;
7891
7907
  } else if (interactive && !autoAcceptWorkspacePolicies) {
7892
7908
  policyUpdateConfirmationRequest = {
@@ -8314,23 +8330,23 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
8314
8330
  if (rawApprovalMode) {
8315
8331
  switch (rawApprovalMode) {
8316
8332
  case "yolo":
8317
- approvalMode = "yolo" /* YOLO */;
8333
+ approvalMode = ApprovalMode.YOLO;
8318
8334
  break;
8319
8335
  case "auto_edit":
8320
- approvalMode = "autoEdit" /* AUTO_EDIT */;
8336
+ approvalMode = ApprovalMode.AUTO_EDIT;
8321
8337
  break;
8322
8338
  case "plan":
8323
8339
  if (!(settings.general?.plan?.enabled ?? true)) {
8324
8340
  debugLogger.warn(
8325
8341
  'Approval mode "plan" is disabled in your settings. Falling back to "default".'
8326
8342
  );
8327
- approvalMode = "default" /* DEFAULT */;
8343
+ approvalMode = ApprovalMode.DEFAULT;
8328
8344
  } else {
8329
- approvalMode = "plan" /* PLAN */;
8345
+ approvalMode = ApprovalMode.PLAN;
8330
8346
  }
8331
8347
  break;
8332
8348
  case "default":
8333
- approvalMode = "default" /* DEFAULT */;
8349
+ approvalMode = ApprovalMode.DEFAULT;
8334
8350
  break;
8335
8351
  default:
8336
8352
  throw new Error(
@@ -8338,10 +8354,10 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
8338
8354
  );
8339
8355
  }
8340
8356
  } else {
8341
- approvalMode = "default" /* DEFAULT */;
8357
+ approvalMode = ApprovalMode.DEFAULT;
8342
8358
  }
8343
8359
  if (settings.security?.disableYoloMode || settings.admin?.secureModeEnabled) {
8344
- if (approvalMode === "yolo" /* YOLO */) {
8360
+ if (approvalMode === ApprovalMode.YOLO) {
8345
8361
  if (settings.admin?.secureModeEnabled) {
8346
8362
  debugLogger.error(
8347
8363
  'YOLO mode is disabled by "secureModeEnabled" setting.'
@@ -8359,16 +8375,16 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
8359
8375
  )
8360
8376
  );
8361
8377
  }
8362
- } else if (approvalMode === "yolo" /* YOLO */) {
8378
+ } else if (approvalMode === ApprovalMode.YOLO) {
8363
8379
  debugLogger.warn(
8364
8380
  "YOLO mode is enabled. All tool calls will be automatically approved."
8365
8381
  );
8366
8382
  }
8367
- if (!trustedFolder && approvalMode !== "default" /* DEFAULT */) {
8383
+ if (!trustedFolder && approvalMode !== ApprovalMode.DEFAULT) {
8368
8384
  debugLogger.warn(
8369
8385
  `Approval mode overridden to "default" because the current folder is not trusted.`
8370
8386
  );
8371
- approvalMode = "default" /* DEFAULT */;
8387
+ approvalMode = ApprovalMode.DEFAULT;
8372
8388
  }
8373
8389
  let telemetrySettings;
8374
8390
  try {
@@ -9806,7 +9822,7 @@ import path9 from "node:path";
9806
9822
  import process4 from "node:process";
9807
9823
  var homeDirectoryCheck = {
9808
9824
  id: "home-directory",
9809
- priority: "low" /* Low */,
9825
+ priority: WarningPriority.Low,
9810
9826
  check: async (workspaceRoot, settings) => {
9811
9827
  if (settings.ui?.showHomeDirectoryWarning === false) {
9812
9828
  return null;
@@ -9830,7 +9846,7 @@ var homeDirectoryCheck = {
9830
9846
  };
9831
9847
  var rootDirectoryCheck = {
9832
9848
  id: "root-directory",
9833
- priority: "high" /* High */,
9849
+ priority: WarningPriority.High,
9834
9850
  check: async (workspaceRoot, _settings) => {
9835
9851
  try {
9836
9852
  const workspaceRealPath = await fs9.realpath(workspaceRoot);
@@ -9846,7 +9862,7 @@ var rootDirectoryCheck = {
9846
9862
  };
9847
9863
  var folderTrustCheck = {
9848
9864
  id: "folder-trust",
9849
- priority: "high" /* High */,
9865
+ priority: WarningPriority.High,
9850
9866
  check: async (workspaceRoot, settings) => {
9851
9867
  if (!isFolderTrustEnabled(settings)) {
9852
9868
  return null;
@@ -10036,12 +10052,12 @@ function handleError(error, config, customErrorCode) {
10036
10052
  error,
10037
10053
  config.getContentGeneratorConfig()?.authType
10038
10054
  );
10039
- if (config.getOutputFormat() === "stream-json" /* STREAM_JSON */) {
10055
+ if (config.getOutputFormat() === OutputFormat.STREAM_JSON) {
10040
10056
  const streamFormatter = new StreamJsonFormatter();
10041
10057
  const errorCode = customErrorCode ?? extractErrorCode(error);
10042
10058
  const metrics = uiTelemetryService.getMetrics();
10043
10059
  streamFormatter.emitEvent({
10044
- type: "result" /* RESULT */,
10060
+ type: JsonStreamEventType.RESULT,
10045
10061
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10046
10062
  status: "error",
10047
10063
  error: {
@@ -10052,7 +10068,7 @@ function handleError(error, config, customErrorCode) {
10052
10068
  });
10053
10069
  runSyncCleanup();
10054
10070
  process.exit(getNumericExitCode(errorCode));
10055
- } else if (config.getOutputFormat() === "json" /* JSON */) {
10071
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
10056
10072
  const formatter = new JsonFormatter();
10057
10073
  const errorCode = customErrorCode ?? extractErrorCode(error);
10058
10074
  const formattedError = formatter.formatError(
@@ -10072,11 +10088,11 @@ function handleToolError(toolName, toolError, config, errorType, resultDisplay)
10072
10088
  const isFatal = isFatalToolError(errorType);
10073
10089
  if (isFatal) {
10074
10090
  const toolExecutionError = new FatalToolExecutionError(errorMessage);
10075
- if (config.getOutputFormat() === "stream-json" /* STREAM_JSON */) {
10091
+ if (config.getOutputFormat() === OutputFormat.STREAM_JSON) {
10076
10092
  const streamFormatter = new StreamJsonFormatter();
10077
10093
  const metrics = uiTelemetryService.getMetrics();
10078
10094
  streamFormatter.emitEvent({
10079
- type: "result" /* RESULT */,
10095
+ type: JsonStreamEventType.RESULT,
10080
10096
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10081
10097
  status: "error",
10082
10098
  error: {
@@ -10085,7 +10101,7 @@ function handleToolError(toolName, toolError, config, errorType, resultDisplay)
10085
10101
  },
10086
10102
  stats: streamFormatter.convertToStreamStats(metrics, 0)
10087
10103
  });
10088
- } else if (config.getOutputFormat() === "json" /* JSON */) {
10104
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
10089
10105
  const formatter = new JsonFormatter();
10090
10106
  const formattedError = formatter.formatError(
10091
10107
  toolExecutionError,
@@ -10103,11 +10119,11 @@ function handleToolError(toolName, toolError, config, errorType, resultDisplay)
10103
10119
  }
10104
10120
  function handleCancellationError(config) {
10105
10121
  const cancellationError = new FatalCancellationError("Operation cancelled.");
10106
- if (config.getOutputFormat() === "stream-json" /* STREAM_JSON */) {
10122
+ if (config.getOutputFormat() === OutputFormat.STREAM_JSON) {
10107
10123
  const streamFormatter = new StreamJsonFormatter();
10108
10124
  const metrics = uiTelemetryService.getMetrics();
10109
10125
  streamFormatter.emitEvent({
10110
- type: "result" /* RESULT */,
10126
+ type: JsonStreamEventType.RESULT,
10111
10127
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10112
10128
  status: "error",
10113
10129
  error: {
@@ -10118,7 +10134,7 @@ function handleCancellationError(config) {
10118
10134
  });
10119
10135
  runSyncCleanup();
10120
10136
  process.exit(cancellationError.exitCode);
10121
- } else if (config.getOutputFormat() === "json" /* JSON */) {
10137
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
10122
10138
  const formatter = new JsonFormatter();
10123
10139
  const formattedError = formatter.formatError(
10124
10140
  cancellationError,
@@ -10138,11 +10154,11 @@ function handleMaxTurnsExceededError(config) {
10138
10154
  const maxTurnsError = new FatalTurnLimitedError(
10139
10155
  "Reached max session turns for this session. Increase the number of turns by specifying maxSessionTurns in settings.json."
10140
10156
  );
10141
- if (config.getOutputFormat() === "stream-json" /* STREAM_JSON */) {
10157
+ if (config.getOutputFormat() === OutputFormat.STREAM_JSON) {
10142
10158
  const streamFormatter = new StreamJsonFormatter();
10143
10159
  const metrics = uiTelemetryService.getMetrics();
10144
10160
  streamFormatter.emitEvent({
10145
- type: "result" /* RESULT */,
10161
+ type: JsonStreamEventType.RESULT,
10146
10162
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10147
10163
  status: "error",
10148
10164
  error: {
@@ -10153,7 +10169,7 @@ function handleMaxTurnsExceededError(config) {
10153
10169
  });
10154
10170
  runSyncCleanup();
10155
10171
  process.exit(maxTurnsError.exitCode);
10156
- } else if (config.getOutputFormat() === "json" /* JSON */) {
10172
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
10157
10173
  const formatter = new JsonFormatter();
10158
10174
  const formattedError = formatter.formatError(
10159
10175
  maxTurnsError,
@@ -10233,7 +10249,7 @@ async function runNonInteractive({
10233
10249
  }
10234
10250
  });
10235
10251
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
10236
- const { setupInitialActivityLogger } = await import("./devtoolsService-4Y2RGEUE.js");
10252
+ const { setupInitialActivityLogger } = await import("./devtoolsService-L7PYKOHR.js");
10237
10253
  setupInitialActivityLogger(config);
10238
10254
  }
10239
10255
  const { stdout: workingStdout } = createWorkingStdio();
@@ -10249,7 +10265,7 @@ async function runNonInteractive({
10249
10265
  }
10250
10266
  };
10251
10267
  const startTime = Date.now();
10252
- const streamFormatter = config.getOutputFormat() === "stream-json" /* STREAM_JSON */ ? new StreamJsonFormatter() : null;
10268
+ const streamFormatter = config.getOutputFormat() === OutputFormat.STREAM_JSON ? new StreamJsonFormatter() : null;
10253
10269
  const abortController = new AbortController();
10254
10270
  let isAborting = false;
10255
10271
  let cancelMessageTimer = null;
@@ -10302,13 +10318,13 @@ async function runNonInteractive({
10302
10318
  };
10303
10319
  try {
10304
10320
  consolePatcher.patch();
10305
- if (config.getRawOutput() && !config.getAcceptRawOutputRisk() && config.getOutputFormat() === "text" /* TEXT */) {
10321
+ if (config.getRawOutput() && !config.getAcceptRawOutputRisk() && config.getOutputFormat() === OutputFormat.TEXT) {
10306
10322
  process.stderr.write(
10307
10323
  "[WARNING] --raw-output is enabled. Model output is not sanitized and may contain harmful ANSI sequences (e.g. for phishing or command injection). Use --accept-raw-output-risk to suppress this warning.\n"
10308
10324
  );
10309
10325
  }
10310
10326
  setupStdinCancellation();
10311
- coreEvents.on("user-feedback" /* UserFeedback */, handleUserFeedback);
10327
+ coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
10312
10328
  coreEvents.drainBacklogs();
10313
10329
  process.stdout.on("error", (err) => {
10314
10330
  if (err.code === "EPIPE") {
@@ -10334,7 +10350,7 @@ async function runNonInteractive({
10334
10350
  }
10335
10351
  if (streamFormatter) {
10336
10352
  streamFormatter.emitEvent({
10337
- type: "init" /* INIT */,
10353
+ type: JsonStreamEventType.INIT,
10338
10354
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10339
10355
  session_id: config.getSessionId(),
10340
10356
  model: config.getModel()
@@ -10372,7 +10388,7 @@ async function runNonInteractive({
10372
10388
  }
10373
10389
  if (streamFormatter) {
10374
10390
  streamFormatter.emitEvent({
10375
- type: "message" /* MESSAGE */,
10391
+ type: JsonStreamEventType.MESSAGE,
10376
10392
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10377
10393
  role: "user",
10378
10394
  content: input
@@ -10411,12 +10427,12 @@ async function runNonInteractive({
10411
10427
  const metrics = uiTelemetryService.getMetrics();
10412
10428
  const durationMs = Date.now() - startTime;
10413
10429
  streamFormatter.emitEvent({
10414
- type: "result" /* RESULT */,
10430
+ type: JsonStreamEventType.RESULT,
10415
10431
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10416
10432
  status: "success",
10417
10433
  stats: streamFormatter.convertToStreamStats(metrics, durationMs)
10418
10434
  });
10419
- } else if (config.getOutputFormat() === "json" /* JSON */) {
10435
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
10420
10436
  const formatter = new JsonFormatter();
10421
10437
  const stats = uiTelemetryService.getMetrics();
10422
10438
  textOutput.write(
@@ -10509,13 +10525,13 @@ async function runNonInteractive({
10509
10525
  const output = isRaw ? part.text : stripAnsi(part.text);
10510
10526
  if (streamFormatter) {
10511
10527
  streamFormatter.emitEvent({
10512
- type: "message" /* MESSAGE */,
10528
+ type: JsonStreamEventType.MESSAGE,
10513
10529
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10514
10530
  role: "assistant",
10515
10531
  content: output,
10516
10532
  delta: true
10517
10533
  });
10518
- } else if (config.getOutputFormat() === "json" /* JSON */) {
10534
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
10519
10535
  responseText += output;
10520
10536
  } else {
10521
10537
  if (part.text) {
@@ -10528,13 +10544,13 @@ async function runNonInteractive({
10528
10544
  break;
10529
10545
  }
10530
10546
  case "tool_request": {
10531
- if (config.getOutputFormat() === "json" /* JSON */) {
10547
+ if (config.getOutputFormat() === OutputFormat.JSON) {
10532
10548
  preToolResponseText = responseText || preToolResponseText;
10533
10549
  responseText = "";
10534
10550
  }
10535
10551
  if (streamFormatter) {
10536
10552
  streamFormatter.emitEvent({
10537
- type: "tool_use" /* TOOL_USE */,
10553
+ type: JsonStreamEventType.TOOL_USE,
10538
10554
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10539
10555
  tool_name: event.name,
10540
10556
  tool_id: event.requestId,
@@ -10550,7 +10566,7 @@ async function runNonInteractive({
10550
10566
  const displayText = displayContentToString(display);
10551
10567
  const errorMsg = getTextContent(event.content) ?? "Tool error";
10552
10568
  streamFormatter.emitEvent({
10553
- type: "tool_result" /* TOOL_RESULT */,
10569
+ type: JsonStreamEventType.TOOL_RESULT,
10554
10570
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10555
10571
  tool_id: event.requestId,
10556
10572
  status: event.isError ? "error" : "success",
@@ -10565,17 +10581,17 @@ async function runNonInteractive({
10565
10581
  const display = event.display?.result;
10566
10582
  const displayText = displayContentToString(display);
10567
10583
  const errorMsg = getTextContent(event.content) ?? "Tool error";
10568
- if (event.data?.["errorType"] === "stop_execution" /* STOP_EXECUTION */) {
10569
- if (config.getOutputFormat() === "json" /* JSON */ && !responseText && preToolResponseText) {
10584
+ if (event.data?.["errorType"] === ToolErrorType.STOP_EXECUTION) {
10585
+ if (config.getOutputFormat() === OutputFormat.JSON && !responseText && preToolResponseText) {
10570
10586
  responseText = preToolResponseText;
10571
10587
  }
10572
10588
  const stopMessage = `Agent execution stopped: ${errorMsg}`;
10573
- if (config.getOutputFormat() === "text" /* TEXT */) {
10589
+ if (config.getOutputFormat() === OutputFormat.TEXT) {
10574
10590
  process.stderr.write(`${stopMessage}
10575
10591
  `);
10576
10592
  }
10577
10593
  }
10578
- if (event.data?.["errorType"] === "no_space_left" /* NO_SPACE_LEFT */) {
10594
+ if (event.data?.["errorType"] === ToolErrorType.NO_SPACE_LEFT) {
10579
10595
  throw new FatalToolExecutionError(
10580
10596
  "Error executing tool " + event.name + ": " + (displayText || errorMsg)
10581
10597
  );
@@ -10597,12 +10613,12 @@ async function runNonInteractive({
10597
10613
  const errorCode = event._meta?.["code"];
10598
10614
  if (errorCode === "AGENT_EXECUTION_BLOCKED") {
10599
10615
  const blockMessage = `Agent execution blocked: ${event.message.trim()}`;
10600
- if (config.getOutputFormat() === "text" /* TEXT */) {
10616
+ if (config.getOutputFormat() === OutputFormat.TEXT) {
10601
10617
  process.stderr.write(`[WARNING] ${blockMessage}
10602
10618
  `);
10603
10619
  } else if (streamFormatter) {
10604
10620
  streamFormatter.emitEvent({
10605
- type: "error" /* ERROR */,
10621
+ type: JsonStreamEventType.ERROR,
10606
10622
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10607
10623
  severity: "warning",
10608
10624
  message: stripAnsi(blockMessage)
@@ -10612,13 +10628,13 @@ async function runNonInteractive({
10612
10628
  break;
10613
10629
  }
10614
10630
  const severity = event.status === "RESOURCE_EXHAUSTED" ? "error" : "warning";
10615
- if (config.getOutputFormat() === "text" /* TEXT */) {
10631
+ if (config.getOutputFormat() === OutputFormat.TEXT) {
10616
10632
  process.stderr.write(`[WARNING] ${event.message}
10617
10633
  `);
10618
10634
  }
10619
10635
  if (streamFormatter) {
10620
10636
  streamFormatter.emitEvent({
10621
- type: "error" /* ERROR */,
10637
+ type: JsonStreamEventType.ERROR,
10622
10638
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10623
10639
  severity,
10624
10640
  message: stripAnsi(event.message)
@@ -10638,7 +10654,7 @@ async function runNonInteractive({
10638
10654
  );
10639
10655
  } else if (streamFormatter) {
10640
10656
  streamFormatter.emitEvent({
10641
- type: "error" /* ERROR */,
10657
+ type: JsonStreamEventType.ERROR,
10642
10658
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10643
10659
  severity: "error",
10644
10660
  message: "Maximum session turns exceeded"
@@ -10646,7 +10662,7 @@ async function runNonInteractive({
10646
10662
  }
10647
10663
  }
10648
10664
  const stopMessage = typeof event.data?.["message"] === "string" ? event.data["message"] : "";
10649
- if (stopMessage && config.getOutputFormat() === "text" /* TEXT */) {
10665
+ if (stopMessage && config.getOutputFormat() === OutputFormat.TEXT) {
10650
10666
  process.stderr.write(`Agent execution stopped: ${stopMessage}
10651
10667
  `);
10652
10668
  }
@@ -10676,7 +10692,7 @@ async function runNonInteractive({
10676
10692
  abortController.signal.removeEventListener("abort", abortSession);
10677
10693
  scheduler?.dispose();
10678
10694
  consolePatcher.cleanup();
10679
- coreEvents.off("user-feedback" /* UserFeedback */, handleUserFeedback);
10695
+ coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
10680
10696
  }
10681
10697
  if (errorToHandle) {
10682
10698
  handleError(errorToHandle, config);
@@ -10704,7 +10720,7 @@ async function runNonInteractive2(params) {
10704
10720
  }
10705
10721
  });
10706
10722
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
10707
- const { setupInitialActivityLogger } = await import("./devtoolsService-4Y2RGEUE.js");
10723
+ const { setupInitialActivityLogger } = await import("./devtoolsService-L7PYKOHR.js");
10708
10724
  setupInitialActivityLogger(config);
10709
10725
  }
10710
10726
  const { stdout: workingStdout } = createWorkingStdio();
@@ -10720,7 +10736,7 @@ async function runNonInteractive2(params) {
10720
10736
  }
10721
10737
  };
10722
10738
  const startTime = Date.now();
10723
- const streamFormatter = config.getOutputFormat() === "stream-json" /* STREAM_JSON */ ? new StreamJsonFormatter() : null;
10739
+ const streamFormatter = config.getOutputFormat() === OutputFormat.STREAM_JSON ? new StreamJsonFormatter() : null;
10724
10740
  const abortController = new AbortController();
10725
10741
  let isAborting = false;
10726
10742
  let cancelMessageTimer = null;
@@ -10771,13 +10787,13 @@ async function runNonInteractive2(params) {
10771
10787
  let scheduler;
10772
10788
  try {
10773
10789
  consolePatcher.patch();
10774
- if (config.getRawOutput() && !config.getAcceptRawOutputRisk() && config.getOutputFormat() === "text" /* TEXT */) {
10790
+ if (config.getRawOutput() && !config.getAcceptRawOutputRisk() && config.getOutputFormat() === OutputFormat.TEXT) {
10775
10791
  process.stderr.write(
10776
10792
  "[WARNING] --raw-output is enabled. Model output is not sanitized and may contain harmful ANSI sequences (e.g. for phishing or command injection). Use --accept-raw-output-risk to suppress this warning.\n"
10777
10793
  );
10778
10794
  }
10779
10795
  setupStdinCancellation();
10780
- coreEvents.on("user-feedback" /* UserFeedback */, handleUserFeedback);
10796
+ coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
10781
10797
  coreEvents.drainBacklogs();
10782
10798
  process.stdout.on("error", (err) => {
10783
10799
  if (err.code === "EPIPE") {
@@ -10801,7 +10817,7 @@ async function runNonInteractive2(params) {
10801
10817
  }
10802
10818
  if (streamFormatter) {
10803
10819
  streamFormatter.emitEvent({
10804
- type: "init" /* INIT */,
10820
+ type: JsonStreamEventType.INIT,
10805
10821
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10806
10822
  session_id: config.getSessionId(),
10807
10823
  model: config.getModel()
@@ -10839,7 +10855,7 @@ async function runNonInteractive2(params) {
10839
10855
  }
10840
10856
  if (streamFormatter) {
10841
10857
  streamFormatter.emitEvent({
10842
- type: "message" /* MESSAGE */,
10858
+ type: JsonStreamEventType.MESSAGE,
10843
10859
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10844
10860
  role: "user",
10845
10861
  content: input
@@ -10867,28 +10883,28 @@ async function runNonInteractive2(params) {
10867
10883
  if (abortController.signal.aborted) {
10868
10884
  handleCancellationError(config);
10869
10885
  }
10870
- if (event.type === "content" /* Content */) {
10886
+ if (event.type === GeminiEventType.Content) {
10871
10887
  const isRaw = config.getRawOutput() || config.getAcceptRawOutputRisk();
10872
10888
  const output = isRaw ? event.value : stripAnsi(event.value);
10873
10889
  if (streamFormatter) {
10874
10890
  streamFormatter.emitEvent({
10875
- type: "message" /* MESSAGE */,
10891
+ type: JsonStreamEventType.MESSAGE,
10876
10892
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10877
10893
  role: "assistant",
10878
10894
  content: output,
10879
10895
  delta: true
10880
10896
  });
10881
- } else if (config.getOutputFormat() === "json" /* JSON */) {
10897
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
10882
10898
  responseText += output;
10883
10899
  } else {
10884
10900
  if (event.value) {
10885
10901
  textOutput.write(output);
10886
10902
  }
10887
10903
  }
10888
- } else if (event.type === "tool_call_request" /* ToolCallRequest */) {
10904
+ } else if (event.type === GeminiEventType.ToolCallRequest) {
10889
10905
  if (streamFormatter) {
10890
10906
  streamFormatter.emitEvent({
10891
- type: "tool_use" /* TOOL_USE */,
10907
+ type: JsonStreamEventType.TOOL_USE,
10892
10908
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10893
10909
  tool_name: event.value.name,
10894
10910
  tool_id: event.value.callId,
@@ -10896,33 +10912,33 @@ async function runNonInteractive2(params) {
10896
10912
  });
10897
10913
  }
10898
10914
  toolCallRequests.push(event.value);
10899
- } else if (event.type === "loop_detected" /* LoopDetected */) {
10915
+ } else if (event.type === GeminiEventType.LoopDetected) {
10900
10916
  const message = "Loop detected, stopping execution";
10901
10917
  if (streamFormatter) {
10902
10918
  streamFormatter.emitEvent({
10903
- type: "error" /* ERROR */,
10919
+ type: JsonStreamEventType.ERROR,
10904
10920
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10905
10921
  severity: "warning",
10906
10922
  message
10907
10923
  });
10908
10924
  }
10909
10925
  warnings.push(message);
10910
- } else if (event.type === "max_session_turns" /* MaxSessionTurns */) {
10926
+ } else if (event.type === GeminiEventType.MaxSessionTurns) {
10911
10927
  const message = "Maximum session turns exceeded";
10912
10928
  if (streamFormatter) {
10913
10929
  streamFormatter.emitEvent({
10914
- type: "error" /* ERROR */,
10930
+ type: JsonStreamEventType.ERROR,
10915
10931
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10916
10932
  severity: "error",
10917
10933
  message
10918
10934
  });
10919
10935
  }
10920
10936
  warnings.push(message);
10921
- } else if (event.type === "error" /* Error */) {
10937
+ } else if (event.type === GeminiEventType.Error) {
10922
10938
  throw event.value.error;
10923
- } else if (event.type === "agent_execution_stopped" /* AgentExecutionStopped */) {
10939
+ } else if (event.type === GeminiEventType.AgentExecutionStopped) {
10924
10940
  const stopMessage = `Agent execution stopped: ${event.value.systemMessage?.trim() || event.value.reason}`;
10925
- if (config.getOutputFormat() === "text" /* TEXT */) {
10941
+ if (config.getOutputFormat() === OutputFormat.TEXT) {
10926
10942
  process.stderr.write(`${stopMessage}
10927
10943
  `);
10928
10944
  }
@@ -10930,7 +10946,7 @@ async function runNonInteractive2(params) {
10930
10946
  const metrics = uiTelemetryService.getMetrics();
10931
10947
  const durationMs = Date.now() - startTime;
10932
10948
  streamFormatter.emitEvent({
10933
- type: "result" /* RESULT */,
10949
+ type: JsonStreamEventType.RESULT,
10934
10950
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10935
10951
  status: "success",
10936
10952
  stats: streamFormatter.convertToStreamStats(
@@ -10938,7 +10954,7 @@ async function runNonInteractive2(params) {
10938
10954
  durationMs
10939
10955
  )
10940
10956
  });
10941
- } else if (config.getOutputFormat() === "json" /* JSON */) {
10957
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
10942
10958
  const formatter = new JsonFormatter();
10943
10959
  const stats = uiTelemetryService.getMetrics();
10944
10960
  textOutput.write(
@@ -10954,30 +10970,30 @@ async function runNonInteractive2(params) {
10954
10970
  textOutput.ensureTrailingNewline();
10955
10971
  }
10956
10972
  return;
10957
- } else if (event.type === "agent_execution_blocked" /* AgentExecutionBlocked */) {
10973
+ } else if (event.type === GeminiEventType.AgentExecutionBlocked) {
10958
10974
  const blockMessage = `Agent execution blocked: ${event.value.systemMessage?.trim() || event.value.reason}`;
10959
- if (config.getOutputFormat() === "text" /* TEXT */) {
10975
+ if (config.getOutputFormat() === OutputFormat.TEXT) {
10960
10976
  process.stderr.write(`[WARNING] ${blockMessage}
10961
10977
  `);
10962
10978
  } else if (streamFormatter) {
10963
10979
  streamFormatter.emitEvent({
10964
- type: "error" /* ERROR */,
10980
+ type: JsonStreamEventType.ERROR,
10965
10981
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10966
10982
  severity: "warning",
10967
10983
  message: stripAnsi(blockMessage)
10968
10984
  });
10969
10985
  }
10970
10986
  warnings.push(blockMessage);
10971
- } else if (event.type === "invalid_stream" /* InvalidStream */) {
10987
+ } else if (event.type === GeminiEventType.InvalidStream) {
10972
10988
  invalidStreamError = "Invalid stream: The model returned an empty response or malformed tool call.";
10973
10989
  if (streamFormatter) {
10974
10990
  streamFormatter.emitEvent({
10975
- type: "error" /* ERROR */,
10991
+ type: JsonStreamEventType.ERROR,
10976
10992
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10977
10993
  severity: "error",
10978
10994
  message: invalidStreamError
10979
10995
  });
10980
- } else if (config.getOutputFormat() === "text" /* TEXT */) {
10996
+ } else if (config.getOutputFormat() === OutputFormat.TEXT) {
10981
10997
  process.stderr.write(`[ERROR] ${invalidStreamError}
10982
10998
  `);
10983
10999
  }
@@ -10997,7 +11013,7 @@ async function runNonInteractive2(params) {
10997
11013
  const requestInfo = completedToolCall.request;
10998
11014
  if (streamFormatter) {
10999
11015
  streamFormatter.emitEvent({
11000
- type: "tool_result" /* TOOL_RESULT */,
11016
+ type: JsonStreamEventType.TOOL_RESULT,
11001
11017
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
11002
11018
  tool_id: requestInfo.callId,
11003
11019
  status: completedToolCall.status === "error" ? "error" : "success",
@@ -11031,11 +11047,11 @@ async function runNonInteractive2(params) {
11031
11047
  );
11032
11048
  }
11033
11049
  const stopExecutionTool = completedToolCalls.find(
11034
- (tc) => tc.response.errorType === "stop_execution" /* STOP_EXECUTION */
11050
+ (tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
11035
11051
  );
11036
11052
  if (stopExecutionTool && stopExecutionTool.response.error) {
11037
11053
  const stopMessage = `Agent execution stopped: ${stopExecutionTool.response.error.message}`;
11038
- if (config.getOutputFormat() === "text" /* TEXT */) {
11054
+ if (config.getOutputFormat() === OutputFormat.TEXT) {
11039
11055
  process.stderr.write(`${stopMessage}
11040
11056
  `);
11041
11057
  }
@@ -11043,7 +11059,7 @@ async function runNonInteractive2(params) {
11043
11059
  const metrics = uiTelemetryService.getMetrics();
11044
11060
  const durationMs = Date.now() - startTime;
11045
11061
  streamFormatter.emitEvent({
11046
- type: "result" /* RESULT */,
11062
+ type: JsonStreamEventType.RESULT,
11047
11063
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
11048
11064
  status: "success",
11049
11065
  stats: streamFormatter.convertToStreamStats(
@@ -11051,7 +11067,7 @@ async function runNonInteractive2(params) {
11051
11067
  durationMs
11052
11068
  )
11053
11069
  });
11054
- } else if (config.getOutputFormat() === "json" /* JSON */) {
11070
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
11055
11071
  const formatter = new JsonFormatter();
11056
11072
  const stats = uiTelemetryService.getMetrics();
11057
11073
  textOutput.write(
@@ -11074,12 +11090,12 @@ async function runNonInteractive2(params) {
11074
11090
  const metrics = uiTelemetryService.getMetrics();
11075
11091
  const durationMs = Date.now() - startTime;
11076
11092
  streamFormatter.emitEvent({
11077
- type: "result" /* RESULT */,
11093
+ type: JsonStreamEventType.RESULT,
11078
11094
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
11079
11095
  status: invalidStreamError ? "error" : "success",
11080
11096
  stats: streamFormatter.convertToStreamStats(metrics, durationMs)
11081
11097
  });
11082
- } else if (config.getOutputFormat() === "json" /* JSON */) {
11098
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
11083
11099
  const formatter = new JsonFormatter();
11084
11100
  const stats = uiTelemetryService.getMetrics();
11085
11101
  textOutput.write(
@@ -11103,7 +11119,7 @@ async function runNonInteractive2(params) {
11103
11119
  cleanupStdinCancellation();
11104
11120
  scheduler?.dispose();
11105
11121
  consolePatcher.cleanup();
11106
- coreEvents.off("user-feedback" /* UserFeedback */, handleUserFeedback);
11122
+ coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
11107
11123
  }
11108
11124
  if (errorToHandle) {
11109
11125
  handleError(errorToHandle, config);
@@ -13494,12 +13510,12 @@ function toToolCallContent(toolResult) {
13494
13510
  }
13495
13511
  var basicPermissionOptions = [
13496
13512
  {
13497
- optionId: "proceed_once" /* ProceedOnce */,
13513
+ optionId: ToolConfirmationOutcome.ProceedOnce,
13498
13514
  name: "Allow",
13499
13515
  kind: "allow_once"
13500
13516
  },
13501
13517
  {
13502
- optionId: "cancel" /* Cancel */,
13518
+ optionId: ToolConfirmationOutcome.Cancel,
13503
13519
  name: "Reject",
13504
13520
  kind: "reject_once"
13505
13521
  }
@@ -13511,13 +13527,13 @@ function toPermissionOptions(confirmation, config, enablePermanentToolApproval =
13511
13527
  switch (confirmation.type) {
13512
13528
  case "edit":
13513
13529
  options.push({
13514
- optionId: "proceed_always" /* ProceedAlways */,
13530
+ optionId: ToolConfirmationOutcome.ProceedAlways,
13515
13531
  name: "Allow for this session",
13516
13532
  kind: "allow_always"
13517
13533
  });
13518
13534
  if (enablePermanentToolApproval) {
13519
13535
  options.push({
13520
- optionId: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
13536
+ optionId: ToolConfirmationOutcome.ProceedAlwaysAndSave,
13521
13537
  name: "Allow for this file in all future sessions",
13522
13538
  kind: "allow_always"
13523
13539
  });
@@ -13525,13 +13541,13 @@ function toPermissionOptions(confirmation, config, enablePermanentToolApproval =
13525
13541
  break;
13526
13542
  case "exec":
13527
13543
  options.push({
13528
- optionId: "proceed_always" /* ProceedAlways */,
13544
+ optionId: ToolConfirmationOutcome.ProceedAlways,
13529
13545
  name: "Allow for this session",
13530
13546
  kind: "allow_always"
13531
13547
  });
13532
13548
  if (enablePermanentToolApproval) {
13533
13549
  options.push({
13534
- optionId: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
13550
+ optionId: ToolConfirmationOutcome.ProceedAlwaysAndSave,
13535
13551
  name: "Allow this command for all future sessions",
13536
13552
  kind: "allow_always"
13537
13553
  });
@@ -13540,19 +13556,19 @@ function toPermissionOptions(confirmation, config, enablePermanentToolApproval =
13540
13556
  case "mcp":
13541
13557
  options.push(
13542
13558
  {
13543
- optionId: "proceed_always_server" /* ProceedAlwaysServer */,
13559
+ optionId: ToolConfirmationOutcome.ProceedAlwaysServer,
13544
13560
  name: "Allow all server tools for this session",
13545
13561
  kind: "allow_always"
13546
13562
  },
13547
13563
  {
13548
- optionId: "proceed_always_tool" /* ProceedAlwaysTool */,
13564
+ optionId: ToolConfirmationOutcome.ProceedAlwaysTool,
13549
13565
  name: "Allow tool for this session",
13550
13566
  kind: "allow_always"
13551
13567
  }
13552
13568
  );
13553
13569
  if (enablePermanentToolApproval) {
13554
13570
  options.push({
13555
- optionId: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
13571
+ optionId: ToolConfirmationOutcome.ProceedAlwaysAndSave,
13556
13572
  name: "Allow tool for all future sessions",
13557
13573
  kind: "allow_always"
13558
13574
  });
@@ -13560,13 +13576,13 @@ function toPermissionOptions(confirmation, config, enablePermanentToolApproval =
13560
13576
  break;
13561
13577
  case "info":
13562
13578
  options.push({
13563
- optionId: "proceed_always" /* ProceedAlways */,
13579
+ optionId: ToolConfirmationOutcome.ProceedAlways,
13564
13580
  name: "Allow for this session",
13565
13581
  kind: "allow_always"
13566
13582
  });
13567
13583
  if (enablePermanentToolApproval) {
13568
13584
  options.push({
13569
- optionId: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
13585
+ optionId: ToolConfirmationOutcome.ProceedAlwaysAndSave,
13570
13586
  name: "Allow for all future sessions",
13571
13587
  kind: "allow_always"
13572
13588
  });
@@ -13598,21 +13614,21 @@ function toPermissionOptions(confirmation, config, enablePermanentToolApproval =
13598
13614
  }
13599
13615
  function toAcpToolKind(kind) {
13600
13616
  switch (kind) {
13601
- case "read" /* Read */:
13602
- case "edit" /* Edit */:
13603
- case "execute" /* Execute */:
13604
- case "search" /* Search */:
13605
- case "delete" /* Delete */:
13606
- case "move" /* Move */:
13607
- case "think" /* Think */:
13608
- case "fetch" /* Fetch */:
13609
- case "switch_mode" /* SwitchMode */:
13610
- case "other" /* Other */:
13617
+ case Kind.Read:
13618
+ case Kind.Edit:
13619
+ case Kind.Execute:
13620
+ case Kind.Search:
13621
+ case Kind.Delete:
13622
+ case Kind.Move:
13623
+ case Kind.Think:
13624
+ case Kind.Fetch:
13625
+ case Kind.SwitchMode:
13626
+ case Kind.Other:
13611
13627
  return kind;
13612
- case "agent" /* Agent */:
13628
+ case Kind.Agent:
13613
13629
  return "think";
13614
- case "plan" /* Plan */:
13615
- case "communicate" /* Communicate */:
13630
+ case Kind.Plan:
13631
+ case Kind.Communicate:
13616
13632
  default:
13617
13633
  return "other";
13618
13634
  }
@@ -13620,24 +13636,24 @@ function toAcpToolKind(kind) {
13620
13636
  function buildAvailableModes(isPlanEnabled) {
13621
13637
  const modes = [
13622
13638
  {
13623
- id: "default" /* DEFAULT */,
13639
+ id: ApprovalMode.DEFAULT,
13624
13640
  name: "Default",
13625
13641
  description: "Prompts for approval"
13626
13642
  },
13627
13643
  {
13628
- id: "autoEdit" /* AUTO_EDIT */,
13644
+ id: ApprovalMode.AUTO_EDIT,
13629
13645
  name: "Auto Edit",
13630
13646
  description: "Auto-approves edit tools"
13631
13647
  },
13632
13648
  {
13633
- id: "yolo" /* YOLO */,
13649
+ id: ApprovalMode.YOLO,
13634
13650
  name: "YOLO",
13635
13651
  description: "Auto-approves all tools"
13636
13652
  }
13637
13653
  ];
13638
13654
  if (isPlanEnabled) {
13639
13655
  modes.push({
13640
- id: "plan" /* PLAN */,
13656
+ id: ApprovalMode.PLAN,
13641
13657
  name: "Plan",
13642
13658
  description: "Read-only mode"
13643
13659
  });
@@ -13649,7 +13665,7 @@ function buildAvailableModels(config, settings) {
13649
13665
  const shouldShowPreviewModels = config.getHasAccessToPreviewModel();
13650
13666
  const useGemini31 = config.getGemini31LaunchedSync?.() ?? false;
13651
13667
  const selectedAuthType = settings.merged.security.auth.selectedType;
13652
- const useCustomToolModel = useGemini31 && selectedAuthType === "gemini-api-key" /* USE_GEMINI */;
13668
+ const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
13653
13669
  if (config.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
13654
13670
  const options = config.getModelConfigService().getAvailableModelOptions({
13655
13671
  useGemini3_1: useGemini31,
@@ -13733,11 +13749,11 @@ var Session = class {
13733
13749
  this.connection = connection;
13734
13750
  this.settings = settings;
13735
13751
  coreEvents.on(
13736
- "approval-mode-changed" /* ApprovalModeChanged */,
13752
+ CoreEvent.ApprovalModeChanged,
13737
13753
  this.handleApprovalModeChanged
13738
13754
  );
13739
13755
  this.context.config.getMessageBus()?.subscribe(
13740
- "tool-confirmation-request" /* TOOL_CONFIRMATION_REQUEST */,
13756
+ MessageBusType.TOOL_CONFIRMATION_REQUEST,
13741
13757
  this.handleToolConfirmationRequest,
13742
13758
  { signal: this.disposeController.signal }
13743
13759
  );
@@ -13761,7 +13777,7 @@ var Session = class {
13761
13777
  "Policy engine missing. Denying tool confirmation request."
13762
13778
  );
13763
13779
  await messageBus.publish({
13764
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
13780
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
13765
13781
  correlationId: request.correlationId,
13766
13782
  confirmed: false,
13767
13783
  requiresUserConfirmation: false
@@ -13774,7 +13790,7 @@ var Session = class {
13774
13790
  "Tool confirmation request missing tool name. Denying."
13775
13791
  );
13776
13792
  await messageBus.publish({
13777
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
13793
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
13778
13794
  correlationId: request.correlationId,
13779
13795
  confirmed: false,
13780
13796
  requiresUserConfirmation: false
@@ -13787,7 +13803,7 @@ var Session = class {
13787
13803
  `Tool confirmation request for unknown tool: ${toolName}. Denying.`
13788
13804
  );
13789
13805
  await messageBus.publish({
13790
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
13806
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
13791
13807
  correlationId: request.correlationId,
13792
13808
  confirmed: false,
13793
13809
  requiresUserConfirmation: false
@@ -13803,15 +13819,15 @@ var Session = class {
13803
13819
  request.subagent
13804
13820
  );
13805
13821
  await messageBus.publish({
13806
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
13822
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
13807
13823
  correlationId: request.correlationId,
13808
- confirmed: result.decision === "allow" /* ALLOW */,
13809
- requiresUserConfirmation: result.decision === "ask_user" /* ASK_USER */
13824
+ confirmed: result.decision === PolicyDecision.ALLOW,
13825
+ requiresUserConfirmation: result.decision === PolicyDecision.ASK_USER
13810
13826
  });
13811
13827
  } catch (error) {
13812
13828
  debugLogger.error("Error handling tool confirmation request:", error);
13813
13829
  await this.context.config.getMessageBus()?.publish({
13814
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
13830
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
13815
13831
  correlationId: request.correlationId,
13816
13832
  confirmed: false,
13817
13833
  requiresUserConfirmation: false
@@ -13831,7 +13847,7 @@ var Session = class {
13831
13847
  };
13832
13848
  dispose() {
13833
13849
  coreEvents.off(
13834
- "approval-mode-changed" /* ApprovalModeChanged */,
13850
+ CoreEvent.ApprovalModeChanged,
13835
13851
  this.handleApprovalModeChanged
13836
13852
  );
13837
13853
  this.disposeController.abort();
@@ -13920,7 +13936,7 @@ ${thought.description}`;
13920
13936
  await this.sendUpdate({
13921
13937
  sessionUpdate: "tool_call",
13922
13938
  toolCallId: toolCall.id,
13923
- status: toolCall.status === "success" /* Success */ ? "completed" : "failed",
13939
+ status: toolCall.status === CoreToolCallStatus.Success ? "completed" : "failed",
13924
13940
  title: toolCall.displayName || toolCall.name,
13925
13941
  content: toolCallContent,
13926
13942
  kind: tool ? toAcpToolKind(tool.kind) : "other"
@@ -14012,7 +14028,7 @@ ${thought.description}`;
14012
14028
  return { stopReason: "cancelled" };
14013
14029
  }
14014
14030
  switch (event.type) {
14015
- case "content" /* Content */: {
14031
+ case GeminiEventType.Content: {
14016
14032
  const content = {
14017
14033
  type: "text",
14018
14034
  text: event.value
@@ -14023,7 +14039,7 @@ ${thought.description}`;
14023
14039
  });
14024
14040
  break;
14025
14041
  }
14026
- case "thought" /* Thought */: {
14042
+ case GeminiEventType.Thought: {
14027
14043
  const thoughtText = `**${event.value.subject}**
14028
14044
  ${event.value.description}`;
14029
14045
  await this.sendUpdate({
@@ -14032,10 +14048,10 @@ ${event.value.description}`;
14032
14048
  });
14033
14049
  break;
14034
14050
  }
14035
- case "tool_call_request" /* ToolCallRequest */:
14051
+ case GeminiEventType.ToolCallRequest:
14036
14052
  toolCallRequests.push(event.value);
14037
14053
  break;
14038
- case "finished" /* Finished */: {
14054
+ case GeminiEventType.Finished: {
14039
14055
  const usage2 = event.value.usageMetadata;
14040
14056
  if (usage2) {
14041
14057
  turnInputTokens = usage2.promptTokenCount ?? turnInputTokens;
@@ -14043,19 +14059,19 @@ ${event.value.description}`;
14043
14059
  }
14044
14060
  break;
14045
14061
  }
14046
- case "model_info" /* ModelInfo */:
14062
+ case GeminiEventType.ModelInfo:
14047
14063
  turnModelId = event.value;
14048
14064
  break;
14049
- case "max_session_turns" /* MaxSessionTurns */:
14065
+ case GeminiEventType.MaxSessionTurns:
14050
14066
  stopReason = "max_turn_requests";
14051
14067
  break;
14052
- case "loop_detected" /* LoopDetected */:
14068
+ case GeminiEventType.LoopDetected:
14053
14069
  stopReason = "max_turn_requests";
14054
14070
  break;
14055
- case "context_window_will_overflow" /* ContextWindowWillOverflow */:
14071
+ case GeminiEventType.ContextWindowWillOverflow:
14056
14072
  stopReason = "max_tokens";
14057
14073
  break;
14058
- case "error" /* Error */: {
14074
+ case GeminiEventType.Error: {
14059
14075
  const parseResult = StructuredErrorSchema.safeParse(
14060
14076
  event.value.error
14061
14077
  );
@@ -14283,7 +14299,7 @@ ${event.value.description}`;
14283
14299
  const output = RequestPermissionResponseSchema.parse(
14284
14300
  await this.connection.requestPermission(params)
14285
14301
  );
14286
- const outcome = output.outcome.outcome === "cancelled" ? "cancel" /* Cancel */ : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
14302
+ const outcome = output.outcome.outcome === "cancelled" ? ToolConfirmationOutcome.Cancel : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
14287
14303
  await confirmationDetails.onConfirm(outcome);
14288
14304
  await updatePolicy(
14289
14305
  tool,
@@ -14294,16 +14310,16 @@ ${event.value.description}`;
14294
14310
  invocation
14295
14311
  );
14296
14312
  switch (outcome) {
14297
- case "cancel" /* Cancel */:
14313
+ case ToolConfirmationOutcome.Cancel:
14298
14314
  return errorResponse(
14299
14315
  new Error(`Tool "${fc.name}" was canceled by the user.`)
14300
14316
  );
14301
- case "proceed_once" /* ProceedOnce */:
14302
- case "proceed_always" /* ProceedAlways */:
14303
- case "proceed_always_and_save" /* ProceedAlwaysAndSave */:
14304
- case "proceed_always_server" /* ProceedAlwaysServer */:
14305
- case "proceed_always_tool" /* ProceedAlwaysTool */:
14306
- case "modify_with_editor" /* ModifyWithEditor */:
14317
+ case ToolConfirmationOutcome.ProceedOnce:
14318
+ case ToolConfirmationOutcome.ProceedAlways:
14319
+ case ToolConfirmationOutcome.ProceedAlwaysAndSave:
14320
+ case ToolConfirmationOutcome.ProceedAlwaysServer:
14321
+ case ToolConfirmationOutcome.ProceedAlwaysTool:
14322
+ case ToolConfirmationOutcome.ModifyWithEditor:
14307
14323
  break;
14308
14324
  default: {
14309
14325
  const resultOutcome = outcome;
@@ -14357,7 +14373,7 @@ ${event.value.description}`;
14357
14373
  );
14358
14374
  this.chat.recordCompletedToolCalls(this.context.config.getActiveModel(), [
14359
14375
  {
14360
- status: "success" /* Success */,
14376
+ status: CoreToolCallStatus.Success,
14361
14377
  request: {
14362
14378
  callId,
14363
14379
  name: fc.name,
@@ -14402,7 +14418,7 @@ ${event.value.description}`;
14402
14418
  });
14403
14419
  this.chat.recordCompletedToolCalls(this.context.config.getActiveModel(), [
14404
14420
  {
14405
- status: "error" /* Error */,
14421
+ status: CoreToolCallStatus.Error,
14406
14422
  request: {
14407
14423
  callId,
14408
14424
  name: fc.name,
@@ -14530,12 +14546,12 @@ ${event.value.description}`;
14530
14546
  sessionId: this.id,
14531
14547
  options: [
14532
14548
  {
14533
- optionId: "proceed_once" /* ProceedOnce */,
14549
+ optionId: ToolConfirmationOutcome.ProceedOnce,
14534
14550
  name: "Allow once",
14535
14551
  kind: "allow_once"
14536
14552
  },
14537
14553
  {
14538
- optionId: "cancel" /* Cancel */,
14554
+ optionId: ToolConfirmationOutcome.Cancel,
14539
14555
  name: "Deny",
14540
14556
  kind: "reject_once"
14541
14557
  }
@@ -14560,8 +14576,8 @@ ${event.value.description}`;
14560
14576
  const output = RequestPermissionResponseSchema.parse(
14561
14577
  await this.connection.requestPermission(params)
14562
14578
  );
14563
- const outcome = output.outcome.outcome === "cancelled" ? "cancel" /* Cancel */ : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
14564
- if (outcome === "proceed_once" /* ProceedOnce */) {
14579
+ const outcome = output.outcome.outcome === "cancelled" ? ToolConfirmationOutcome.Cancel : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
14580
+ if (outcome === ToolConfirmationOutcome.ProceedOnce) {
14565
14581
  this.context.config.getWorkspaceContext().addReadOnlyPath(absolutePath);
14566
14582
  validationError = null;
14567
14583
  } else {
@@ -14998,7 +15014,7 @@ var AcpSessionManager = class {
14998
15014
  mcpServers,
14999
15015
  loadedSettings
15000
15016
  );
15001
- const authType = loadedSettings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ? "gateway" /* GATEWAY */ : "gemini-api-key" /* USE_GEMINI */);
15017
+ const authType = loadedSettings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ? AuthType.GATEWAY : AuthType.USE_GEMINI);
15002
15018
  let isAuthenticated = false;
15003
15019
  let authErrorMessage = "";
15004
15020
  try {
@@ -15010,7 +15026,7 @@ var AcpSessionManager = class {
15010
15026
  );
15011
15027
  isAuthenticated = true;
15012
15028
  const contentGeneratorConfig = config.getContentGeneratorConfig();
15013
- if (authType === "gemini-api-key" /* USE_GEMINI */ && (!contentGeneratorConfig || !contentGeneratorConfig.apiKey)) {
15029
+ if (authType === AuthType.USE_GEMINI && (!contentGeneratorConfig || !contentGeneratorConfig.apiKey)) {
15014
15030
  isAuthenticated = false;
15015
15031
  authErrorMessage = "Gemini API key is missing or not configured.";
15016
15032
  }
@@ -15119,7 +15135,7 @@ var AcpSessionManager = class {
15119
15135
  return response;
15120
15136
  }
15121
15137
  async initializeSessionConfig(sessionId, cwd, mcpServers, authDetails) {
15122
- const selectedAuthType = this.settings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ? "gateway" /* GATEWAY */ : void 0);
15138
+ const selectedAuthType = this.settings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ? AuthType.GATEWAY : void 0);
15123
15139
  if (!selectedAuthType) {
15124
15140
  throw RequestError.authRequired();
15125
15141
  }
@@ -15220,12 +15236,12 @@ var GeminiAgent = class {
15220
15236
  }
15221
15237
  const authMethods = [
15222
15238
  {
15223
- id: "oauth-personal" /* LOGIN_WITH_GOOGLE */,
15239
+ id: AuthType.LOGIN_WITH_GOOGLE,
15224
15240
  name: "Log in with Google",
15225
15241
  description: "Log in with your Google account"
15226
15242
  },
15227
15243
  {
15228
- id: "gemini-api-key" /* USE_GEMINI */,
15244
+ id: AuthType.USE_GEMINI,
15229
15245
  name: "Gemini API key",
15230
15246
  description: "Use an API key with Gemini Developer API",
15231
15247
  _meta: {
@@ -15235,12 +15251,12 @@ var GeminiAgent = class {
15235
15251
  }
15236
15252
  },
15237
15253
  {
15238
- id: "vertex-ai" /* USE_VERTEX_AI */,
15254
+ id: AuthType.USE_VERTEX_AI,
15239
15255
  name: "Vertex AI",
15240
15256
  description: "Use an API key with Vertex AI GenAI API"
15241
15257
  },
15242
15258
  {
15243
- id: "gateway" /* GATEWAY */,
15259
+ id: AuthType.GATEWAY,
15244
15260
  name: "AI API Gateway",
15245
15261
  description: "Use a custom AI API Gateway",
15246
15262
  _meta: {
@@ -15413,7 +15429,7 @@ async function validateNonInteractiveAuth(configuredAuthType, useExternalAuth, n
15413
15429
  }
15414
15430
  return authType;
15415
15431
  } catch (error) {
15416
- if (nonInteractiveConfig.getOutputFormat() === "json" /* JSON */) {
15432
+ if (nonInteractiveConfig.getOutputFormat() === OutputFormat.JSON) {
15417
15433
  handleError(
15418
15434
  error instanceof Error ? error : new Error(String(error)),
15419
15435
  nonInteractiveConfig,
@@ -15608,10 +15624,10 @@ var SlashCommandConflictHandler = class {
15608
15624
  this.handleConflicts = this.handleConflicts.bind(this);
15609
15625
  }
15610
15626
  start() {
15611
- coreEvents.on("slash-command-conflicts" /* SlashCommandConflicts */, this.handleConflicts);
15627
+ coreEvents.on(CoreEvent.SlashCommandConflicts, this.handleConflicts);
15612
15628
  }
15613
15629
  stop() {
15614
- coreEvents.off("slash-command-conflicts" /* SlashCommandConflicts */, this.handleConflicts);
15630
+ coreEvents.off(CoreEvent.SlashCommandConflicts, this.handleConflicts);
15615
15631
  if (this.flushTimeout) {
15616
15632
  clearTimeout(this.flushTimeout);
15617
15633
  this.flushTimeout = null;
@@ -15892,7 +15908,7 @@ async function resolveSessionId(resumeArg, sessionIdArg, sessionFileArg) {
15892
15908
  }
15893
15909
  }
15894
15910
  async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
15895
- const { startInteractiveUI: doStartUI } = await import("./interactiveCli-XM5HDVD7.js");
15911
+ const { startInteractiveUI: doStartUI } = await import("./interactiveCli-HA3BASZN.js");
15896
15912
  await doStartUI(
15897
15913
  config,
15898
15914
  settings,
@@ -15995,12 +16011,12 @@ async function main() {
15995
16011
  dns.setDefaultResultOrder(
15996
16012
  validateDnsResolutionOrder(settings.merged.advanced.dnsResolutionOrder)
15997
16013
  );
15998
- if (!settings.merged.security.auth.selectedType || settings.merged.security.auth.selectedType === "cloud-shell" /* LEGACY_CLOUD_SHELL */) {
16014
+ if (!settings.merged.security.auth.selectedType || settings.merged.security.auth.selectedType === AuthType.LEGACY_CLOUD_SHELL) {
15999
16015
  if (process.env["CLOUD_SHELL"] === "true" || process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true") {
16000
16016
  settings.setValue(
16001
16017
  "User" /* User */,
16002
16018
  "security.auth.selectedType",
16003
- "compute-default-credentials" /* COMPUTE_ADC */
16019
+ AuthType.COMPUTE_ADC
16004
16020
  );
16005
16021
  }
16006
16022
  }
@@ -16101,7 +16117,7 @@ ${finalArgs[promptIndex + 1]}`;
16101
16117
  await config.storage.initialize();
16102
16118
  adminControlsListner.setConfig(config);
16103
16119
  if (config.isInteractive() && settings.merged.general.devtools) {
16104
- const { setupInitialActivityLogger } = await import("./devtoolsService-4Y2RGEUE.js");
16120
+ const { setupInitialActivityLogger } = await import("./devtoolsService-L7PYKOHR.js");
16105
16121
  setupInitialActivityLogger(config);
16106
16122
  }
16107
16123
  registerTelemetryConfig(config);
@@ -16109,7 +16125,7 @@ ${finalArgs[promptIndex + 1]}`;
16109
16125
  const messageBus = config.getMessageBus();
16110
16126
  createPolicyUpdater2(policyEngine, messageBus, config.storage);
16111
16127
  registerCleanup(async () => {
16112
- await config.getHookSystem()?.fireSessionEndEvent("exit" /* Exit */);
16128
+ await config.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
16113
16129
  });
16114
16130
  if (!config.getAcpMode()) {
16115
16131
  registerCleanup(consolePatcher.cleanup);
@@ -16160,7 +16176,7 @@ ${finalArgs[promptIndex + 1]}`;
16160
16176
  const initAppHandle = startupProfiler.start("initialize_app");
16161
16177
  const initializationResult = await initializeApp(config, settings);
16162
16178
  initAppHandle?.end();
16163
- import("./liteRtServerManager-6N5DYDEQ.js").then(({ LiteRtServerManager }) => {
16179
+ import("./liteRtServerManager-OMSM6SJU.js").then(({ LiteRtServerManager }) => {
16164
16180
  const mergedGemma = settings.merged.experimental?.gemmaModelRouter;
16165
16181
  if (!mergedGemma) return;
16166
16182
  const userGemma = settings.forScope("User" /* User */).settings.experimental?.gemmaModelRouter;
@@ -16170,7 +16186,7 @@ ${finalArgs[promptIndex + 1]}`;
16170
16186
  autoStartServer: userGemma?.autoStartServer
16171
16187
  });
16172
16188
  }).catch((e) => debugLogger.warn("LiteRT auto-start import failed:", e));
16173
- if (settings.merged.security.auth.selectedType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
16189
+ if (settings.merged.security.auth.selectedType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
16174
16190
  await getOauthClient(settings.merged.security.auth.selectedType, config);
16175
16191
  }
16176
16192
  if (config.getAcpMode()) {
@@ -16186,7 +16202,7 @@ ${finalArgs[promptIndex + 1]}`;
16186
16202
  ...rawStartupWarnings.map((message) => ({
16187
16203
  id: `startup-${createHash2("sha256").update(message).digest("hex").substring(0, 16)}`,
16188
16204
  message,
16189
- priority: "high" /* High */
16205
+ priority: WarningPriority.High
16190
16206
  })),
16191
16207
  ...await getUserStartupWarnings(settings.merged, void 0, {
16192
16208
  isAlternateBuffer: useAlternateBuffer
@@ -16223,7 +16239,7 @@ ${finalArgs[promptIndex + 1]}`;
16223
16239
  ${input}` : stdinData;
16224
16240
  }
16225
16241
  }
16226
- const sessionStartSource = resumedSessionData ? "resume" /* Resume */ : "startup" /* Startup */;
16242
+ const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
16227
16243
  const hookSystem = config?.getHookSystem();
16228
16244
  if (hookSystem) {
16229
16245
  const result = await hookSystem.fireSessionStartEvent(sessionStartSource);
@@ -16280,8 +16296,8 @@ ${input}` : wrappedContext;
16280
16296
  }
16281
16297
  }
16282
16298
  function initializeOutputListenersAndFlush(config) {
16283
- if (coreEvents.listenerCount("output" /* Output */) === 0) {
16284
- coreEvents.on("output" /* Output */, (payload) => {
16299
+ if (coreEvents.listenerCount(CoreEvent.Output) === 0) {
16300
+ coreEvents.on(CoreEvent.Output, (payload) => {
16285
16301
  if (payload.isStderr) {
16286
16302
  writeToStderr(payload.chunk, payload.encoding);
16287
16303
  } else {
@@ -16289,8 +16305,8 @@ function initializeOutputListenersAndFlush(config) {
16289
16305
  }
16290
16306
  });
16291
16307
  }
16292
- if (coreEvents.listenerCount("console-log" /* ConsoleLog */) === 0) {
16293
- coreEvents.on("console-log" /* ConsoleLog */, (payload) => {
16308
+ if (coreEvents.listenerCount(CoreEvent.ConsoleLog) === 0) {
16309
+ coreEvents.on(CoreEvent.ConsoleLog, (payload) => {
16294
16310
  if (payload.type === "error" || payload.type === "warn") {
16295
16311
  writeToStderr(payload.content + "\n");
16296
16312
  } else {
@@ -16298,8 +16314,8 @@ function initializeOutputListenersAndFlush(config) {
16298
16314
  }
16299
16315
  });
16300
16316
  }
16301
- if (coreEvents.listenerCount("user-feedback" /* UserFeedback */) === 0) {
16302
- coreEvents.on("user-feedback" /* UserFeedback */, (payload) => {
16317
+ if (coreEvents.listenerCount(CoreEvent.UserFeedback) === 0) {
16318
+ coreEvents.on(CoreEvent.UserFeedback, (payload) => {
16303
16319
  writeToStderr(payload.message + "\n");
16304
16320
  });
16305
16321
  }
@@ -16307,7 +16323,7 @@ function initializeOutputListenersAndFlush(config) {
16307
16323
  const forceToStderr = outputFormat === "json";
16308
16324
  coreEvents.drainBacklogs(
16309
16325
  (event, args) => {
16310
- if (forceToStderr && event === "output" /* Output */) {
16326
+ if (forceToStderr && event === CoreEvent.Output) {
16311
16327
  const payload = args[0];
16312
16328
  if (!payload.isStderr) {
16313
16329
  return {