@google/gemini-cli 0.45.0 → 0.46.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 (71) hide show
  1. package/bundle/{chunk-SG46YSQ3.js → chunk-24H54ISH.js} +7 -7
  2. package/bundle/{chunk-YI3KORH5.js → chunk-3EC3ZLRQ.js} +2 -2
  3. package/bundle/{chunk-EORX7LYI.js → chunk-3WW2LTMX.js} +1 -1
  4. package/bundle/{chunk-2ARYG3KE.js → chunk-4B7MDBUK.js} +1 -1
  5. package/bundle/{chunk-EUYIPFPA.js → chunk-5CWORGE3.js} +1 -1
  6. package/bundle/{chunk-K6WTIGVC.js → chunk-5IBYZHR7.js} +2 -2
  7. package/bundle/{chunk-TWSSMLUS.js → chunk-7Y6NU65D.js} +1 -1
  8. package/bundle/{chunk-4KOU3QNT.js → chunk-EG7USKV5.js} +8 -5
  9. package/bundle/{chunk-PNU4GACG.js → chunk-EZDKSTIF.js} +2 -2
  10. package/bundle/{chunk-THZMPVCN.js → chunk-GRD2P7HY.js} +1 -1
  11. package/bundle/chunk-HQNVDCXK.js +154 -0
  12. package/bundle/chunk-ILHDA6XU.js +17320 -0
  13. package/bundle/{chunk-6T7N6JF2.js → chunk-ITC7TFJU.js} +156 -50
  14. package/bundle/{chunk-53SRWMUU.js → chunk-JF6RJW53.js} +1 -1
  15. package/bundle/chunk-JPYTHGMI.js +398 -0
  16. package/bundle/{chunk-XV2YFH7B.js → chunk-KOJR46UO.js} +7654 -14056
  17. package/bundle/{chunk-4EBMYFID.js → chunk-KQ4V7ZN4.js} +67 -54
  18. package/bundle/chunk-O3UKVEBS.js +81685 -0
  19. package/bundle/{chunk-VL3FKVC7.js → chunk-ONUDATHO.js} +3 -3
  20. package/bundle/{chunk-N6QPQL7E.js → chunk-QEVRJ7HY.js} +183 -50
  21. package/bundle/{chunk-3TWZMAJU.js → chunk-QFWAILKU.js} +3 -3
  22. package/bundle/{chunk-GVEZJIV3.js → chunk-QMCEWHRR.js} +1 -1
  23. package/bundle/{chunk-IL7J46PP.js → chunk-R4LEIQZM.js} +3 -3
  24. package/bundle/{chunk-JLFE3KRS.js → chunk-RXYIE5L5.js} +1 -1
  25. package/bundle/{chunk-Z5F25543.js → chunk-UM53YDCH.js} +1 -1
  26. package/bundle/{chunk-PXEK5ENZ.js → chunk-VEHSYWQT.js} +9 -8
  27. package/bundle/chunk-VETILJQA.js +1571 -0
  28. package/bundle/chunk-VOFVOS4I.js +118 -0
  29. package/bundle/chunk-WRWCUHAM.js +512 -0
  30. package/bundle/chunk-XVDCGVTF.js +394545 -0
  31. package/bundle/{chunk-HFVEWB6N.js → chunk-YINW7YTJ.js} +1 -1
  32. package/bundle/{chunk-KSNTXH4E.js → chunk-YIOYXRDP.js} +7 -7
  33. package/bundle/{cleanup-3SMSXJJA.js → cleanup-4ZTB4WMN.js} +2 -2
  34. package/bundle/{cleanup-FNQ3LEWG.js → cleanup-7LLX4OFN.js} +2 -2
  35. package/bundle/{cleanup-I56KHTTC.js → cleanup-GI5426XS.js} +2 -2
  36. package/bundle/cleanup-ZBLVGXIK.js +32 -0
  37. package/bundle/{core-KGXBOJTX.js → core-3UQQYNJF.js} +7 -1
  38. package/bundle/{devtoolsService-EW3B2Y63.js → devtoolsService-GJWWZ2KK.js} +2 -2
  39. package/bundle/{devtoolsService-F7PHNBEQ.js → devtoolsService-UNQILSWI.js} +4 -3
  40. package/bundle/devtoolsService-Z2YXVMYF.js +856 -0
  41. package/bundle/{devtoolsService-VFEFRDYG.js → devtoolsService-ZYGDAPOV.js} +2 -2
  42. package/bundle/{dist-2G5KTD32.js → dist-4NVM6I2N.js} +7 -1
  43. package/bundle/{core-AQUUQTX2.js → dist-LIQULVXZ.js} +7 -1
  44. package/bundle/dist-XPP357J7.js +2140 -0
  45. package/bundle/docs/changelogs/index.md +14 -0
  46. package/bundle/docs/changelogs/latest.md +202 -199
  47. package/bundle/docs/changelogs/preview.md +44 -200
  48. package/bundle/docs/issue-and-pr-automation.md +29 -1
  49. package/bundle/docs/reference/configuration.md +71 -0
  50. package/bundle/{gemini-ORQHD633.js → gemini-5WY2YO7R.js} +18 -15
  51. package/bundle/{gemini-JMMBFICD.js → gemini-7GZVH4VW.js} +216 -197
  52. package/bundle/{gemini-4KS2EZX6.js → gemini-QDOVPRKF.js} +18 -15
  53. package/bundle/gemini-RBKWBGCC.js +16409 -0
  54. package/bundle/gemini.js +7 -7
  55. package/bundle/{interactiveCli-XUZZOZXX.js → interactiveCli-BMKHWEH4.js} +29 -13
  56. package/bundle/{interactiveCli-ESB66RW7.js → interactiveCli-OEFOYFJU.js} +335 -300
  57. package/bundle/interactiveCli-OGE5OTZB.js +34742 -0
  58. package/bundle/{interactiveCli-ZJXV4DW7.js → interactiveCli-W3CMLQIM.js} +29 -13
  59. package/bundle/{liteRtServerManager-HELKQKOZ.js → liteRtServerManager-3QOJEGNL.js} +4 -4
  60. package/bundle/{liteRtServerManager-RNNHEQJI.js → liteRtServerManager-HPVNUYFX.js} +4 -4
  61. package/bundle/{liteRtServerManager-DORIWEMR.js → liteRtServerManager-Q6LTEYH4.js} +4 -4
  62. package/bundle/liteRtServerManager-YL4YRHOA.js +65 -0
  63. package/bundle/{oauth2-provider-2IJNOFOO.js → oauth2-provider-3WXIASQA.js} +1 -1
  64. package/bundle/{oauth2-provider-7N4OFPTL.js → oauth2-provider-CTPS7JLT.js} +1 -1
  65. package/bundle/{oauth2-provider-YYLBPESU.js → oauth2-provider-K52EY6RG.js} +38 -72
  66. package/bundle/oauth2-provider-PJJE326A.js +235 -0
  67. package/bundle/{start-IGG6LDST.js → start-25W6VZG6.js} +6 -6
  68. package/bundle/{start-R7DTCFCN.js → start-JBJSIKIB.js} +6 -6
  69. package/bundle/{start-66KF6MVV.js → start-PK22QMBT.js} +6 -6
  70. package/bundle/start-XAEHV6FV.js +18 -0
  71. package/package.json +1 -1
@@ -41,18 +41,18 @@ import {
41
41
  updateAllUpdatableExtensions,
42
42
  updateExtension,
43
43
  validateAuthMethod
44
- } from "./chunk-KSNTXH4E.js";
44
+ } from "./chunk-KQ4V7ZN4.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-VL3FKVC7.js";
51
+ } from "./chunk-VOFVOS4I.js";
52
52
  import {
53
53
  exitCli,
54
54
  require_source
55
- } from "./chunk-GVEZJIV3.js";
55
+ } from "./chunk-JF6RJW53.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-2ARYG3KE.js";
89
+ } from "./chunk-ILHDA6XU.js";
90
90
  import {
91
91
  RELAUNCH_EXIT_CODE
92
- } from "./chunk-YI3KORH5.js";
93
- import "./chunk-HFVEWB6N.js";
92
+ } from "./chunk-5IBYZHR7.js";
93
+ import "./chunk-VEHSYWQT.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-TWSSMLUS.js";
102
+ } from "./chunk-GRD2P7HY.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-N6QPQL7E.js";
250
+ } from "./chunk-XVDCGVTF.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" ?? customImage ?? packageJson?.config?.sandboxImageUri;
7844
+ const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.46.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-F7PHNBEQ.js");
10252
+ const { setupInitialActivityLogger } = await import("./devtoolsService-GJWWZ2KK.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-F7PHNBEQ.js");
10723
+ const { setupInitialActivityLogger } = await import("./devtoolsService-GJWWZ2KK.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
  });
@@ -13648,11 +13664,13 @@ function buildAvailableModels(config, settings) {
13648
13664
  const preferredModel = config.getModel() || GEMINI_MODEL_ALIAS_AUTO;
13649
13665
  const shouldShowPreviewModels = config.getHasAccessToPreviewModel();
13650
13666
  const useGemini31 = config.getGemini31LaunchedSync?.() ?? false;
13667
+ const useGemini3_5Flash = config.hasGemini35FlashGAAccess?.() ?? false;
13651
13668
  const selectedAuthType = settings.merged.security.auth.selectedType;
13652
- const useCustomToolModel = useGemini31 && selectedAuthType === "gemini-api-key" /* USE_GEMINI */;
13669
+ const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
13653
13670
  if (config.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
13654
13671
  const options = config.getModelConfigService().getAvailableModelOptions({
13655
13672
  useGemini3_1: useGemini31,
13673
+ useGemini3_5Flash,
13656
13674
  useCustomTools: useCustomToolModel,
13657
13675
  hasAccessToPreview: shouldShowPreviewModels
13658
13676
  });
@@ -13667,7 +13685,8 @@ function buildAvailableModels(config, settings) {
13667
13685
  title: getDisplayString(GEMINI_MODEL_ALIAS_AUTO),
13668
13686
  description: getAutoModelDescription(
13669
13687
  shouldShowPreviewModels,
13670
- useGemini31
13688
+ useGemini31,
13689
+ useGemini3_5Flash
13671
13690
  )
13672
13691
  }
13673
13692
  ];
@@ -13733,11 +13752,11 @@ var Session = class {
13733
13752
  this.connection = connection;
13734
13753
  this.settings = settings;
13735
13754
  coreEvents.on(
13736
- "approval-mode-changed" /* ApprovalModeChanged */,
13755
+ CoreEvent.ApprovalModeChanged,
13737
13756
  this.handleApprovalModeChanged
13738
13757
  );
13739
13758
  this.context.config.getMessageBus()?.subscribe(
13740
- "tool-confirmation-request" /* TOOL_CONFIRMATION_REQUEST */,
13759
+ MessageBusType.TOOL_CONFIRMATION_REQUEST,
13741
13760
  this.handleToolConfirmationRequest,
13742
13761
  { signal: this.disposeController.signal }
13743
13762
  );
@@ -13761,7 +13780,7 @@ var Session = class {
13761
13780
  "Policy engine missing. Denying tool confirmation request."
13762
13781
  );
13763
13782
  await messageBus.publish({
13764
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
13783
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
13765
13784
  correlationId: request.correlationId,
13766
13785
  confirmed: false,
13767
13786
  requiresUserConfirmation: false
@@ -13774,7 +13793,7 @@ var Session = class {
13774
13793
  "Tool confirmation request missing tool name. Denying."
13775
13794
  );
13776
13795
  await messageBus.publish({
13777
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
13796
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
13778
13797
  correlationId: request.correlationId,
13779
13798
  confirmed: false,
13780
13799
  requiresUserConfirmation: false
@@ -13787,7 +13806,7 @@ var Session = class {
13787
13806
  `Tool confirmation request for unknown tool: ${toolName}. Denying.`
13788
13807
  );
13789
13808
  await messageBus.publish({
13790
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
13809
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
13791
13810
  correlationId: request.correlationId,
13792
13811
  confirmed: false,
13793
13812
  requiresUserConfirmation: false
@@ -13803,15 +13822,15 @@ var Session = class {
13803
13822
  request.subagent
13804
13823
  );
13805
13824
  await messageBus.publish({
13806
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
13825
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
13807
13826
  correlationId: request.correlationId,
13808
- confirmed: result.decision === "allow" /* ALLOW */,
13809
- requiresUserConfirmation: result.decision === "ask_user" /* ASK_USER */
13827
+ confirmed: result.decision === PolicyDecision.ALLOW,
13828
+ requiresUserConfirmation: result.decision === PolicyDecision.ASK_USER
13810
13829
  });
13811
13830
  } catch (error) {
13812
13831
  debugLogger.error("Error handling tool confirmation request:", error);
13813
13832
  await this.context.config.getMessageBus()?.publish({
13814
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
13833
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
13815
13834
  correlationId: request.correlationId,
13816
13835
  confirmed: false,
13817
13836
  requiresUserConfirmation: false
@@ -13831,7 +13850,7 @@ var Session = class {
13831
13850
  };
13832
13851
  dispose() {
13833
13852
  coreEvents.off(
13834
- "approval-mode-changed" /* ApprovalModeChanged */,
13853
+ CoreEvent.ApprovalModeChanged,
13835
13854
  this.handleApprovalModeChanged
13836
13855
  );
13837
13856
  this.disposeController.abort();
@@ -13920,7 +13939,7 @@ ${thought.description}`;
13920
13939
  await this.sendUpdate({
13921
13940
  sessionUpdate: "tool_call",
13922
13941
  toolCallId: toolCall.id,
13923
- status: toolCall.status === "success" /* Success */ ? "completed" : "failed",
13942
+ status: toolCall.status === CoreToolCallStatus.Success ? "completed" : "failed",
13924
13943
  title: toolCall.displayName || toolCall.name,
13925
13944
  content: toolCallContent,
13926
13945
  kind: tool ? toAcpToolKind(tool.kind) : "other"
@@ -14012,7 +14031,7 @@ ${thought.description}`;
14012
14031
  return { stopReason: "cancelled" };
14013
14032
  }
14014
14033
  switch (event.type) {
14015
- case "content" /* Content */: {
14034
+ case GeminiEventType.Content: {
14016
14035
  const content = {
14017
14036
  type: "text",
14018
14037
  text: event.value
@@ -14023,7 +14042,7 @@ ${thought.description}`;
14023
14042
  });
14024
14043
  break;
14025
14044
  }
14026
- case "thought" /* Thought */: {
14045
+ case GeminiEventType.Thought: {
14027
14046
  const thoughtText = `**${event.value.subject}**
14028
14047
  ${event.value.description}`;
14029
14048
  await this.sendUpdate({
@@ -14032,10 +14051,10 @@ ${event.value.description}`;
14032
14051
  });
14033
14052
  break;
14034
14053
  }
14035
- case "tool_call_request" /* ToolCallRequest */:
14054
+ case GeminiEventType.ToolCallRequest:
14036
14055
  toolCallRequests.push(event.value);
14037
14056
  break;
14038
- case "finished" /* Finished */: {
14057
+ case GeminiEventType.Finished: {
14039
14058
  const usage2 = event.value.usageMetadata;
14040
14059
  if (usage2) {
14041
14060
  turnInputTokens = usage2.promptTokenCount ?? turnInputTokens;
@@ -14043,19 +14062,19 @@ ${event.value.description}`;
14043
14062
  }
14044
14063
  break;
14045
14064
  }
14046
- case "model_info" /* ModelInfo */:
14065
+ case GeminiEventType.ModelInfo:
14047
14066
  turnModelId = event.value;
14048
14067
  break;
14049
- case "max_session_turns" /* MaxSessionTurns */:
14068
+ case GeminiEventType.MaxSessionTurns:
14050
14069
  stopReason = "max_turn_requests";
14051
14070
  break;
14052
- case "loop_detected" /* LoopDetected */:
14071
+ case GeminiEventType.LoopDetected:
14053
14072
  stopReason = "max_turn_requests";
14054
14073
  break;
14055
- case "context_window_will_overflow" /* ContextWindowWillOverflow */:
14074
+ case GeminiEventType.ContextWindowWillOverflow:
14056
14075
  stopReason = "max_tokens";
14057
14076
  break;
14058
- case "error" /* Error */: {
14077
+ case GeminiEventType.Error: {
14059
14078
  const parseResult = StructuredErrorSchema.safeParse(
14060
14079
  event.value.error
14061
14080
  );
@@ -14283,7 +14302,7 @@ ${event.value.description}`;
14283
14302
  const output = RequestPermissionResponseSchema.parse(
14284
14303
  await this.connection.requestPermission(params)
14285
14304
  );
14286
- const outcome = output.outcome.outcome === "cancelled" ? "cancel" /* Cancel */ : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
14305
+ const outcome = output.outcome.outcome === "cancelled" ? ToolConfirmationOutcome.Cancel : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
14287
14306
  await confirmationDetails.onConfirm(outcome);
14288
14307
  await updatePolicy(
14289
14308
  tool,
@@ -14294,16 +14313,16 @@ ${event.value.description}`;
14294
14313
  invocation
14295
14314
  );
14296
14315
  switch (outcome) {
14297
- case "cancel" /* Cancel */:
14316
+ case ToolConfirmationOutcome.Cancel:
14298
14317
  return errorResponse(
14299
14318
  new Error(`Tool "${fc.name}" was canceled by the user.`)
14300
14319
  );
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 */:
14320
+ case ToolConfirmationOutcome.ProceedOnce:
14321
+ case ToolConfirmationOutcome.ProceedAlways:
14322
+ case ToolConfirmationOutcome.ProceedAlwaysAndSave:
14323
+ case ToolConfirmationOutcome.ProceedAlwaysServer:
14324
+ case ToolConfirmationOutcome.ProceedAlwaysTool:
14325
+ case ToolConfirmationOutcome.ModifyWithEditor:
14307
14326
  break;
14308
14327
  default: {
14309
14328
  const resultOutcome = outcome;
@@ -14357,7 +14376,7 @@ ${event.value.description}`;
14357
14376
  );
14358
14377
  this.chat.recordCompletedToolCalls(this.context.config.getActiveModel(), [
14359
14378
  {
14360
- status: "success" /* Success */,
14379
+ status: CoreToolCallStatus.Success,
14361
14380
  request: {
14362
14381
  callId,
14363
14382
  name: fc.name,
@@ -14402,7 +14421,7 @@ ${event.value.description}`;
14402
14421
  });
14403
14422
  this.chat.recordCompletedToolCalls(this.context.config.getActiveModel(), [
14404
14423
  {
14405
- status: "error" /* Error */,
14424
+ status: CoreToolCallStatus.Error,
14406
14425
  request: {
14407
14426
  callId,
14408
14427
  name: fc.name,
@@ -14530,12 +14549,12 @@ ${event.value.description}`;
14530
14549
  sessionId: this.id,
14531
14550
  options: [
14532
14551
  {
14533
- optionId: "proceed_once" /* ProceedOnce */,
14552
+ optionId: ToolConfirmationOutcome.ProceedOnce,
14534
14553
  name: "Allow once",
14535
14554
  kind: "allow_once"
14536
14555
  },
14537
14556
  {
14538
- optionId: "cancel" /* Cancel */,
14557
+ optionId: ToolConfirmationOutcome.Cancel,
14539
14558
  name: "Deny",
14540
14559
  kind: "reject_once"
14541
14560
  }
@@ -14560,8 +14579,8 @@ ${event.value.description}`;
14560
14579
  const output = RequestPermissionResponseSchema.parse(
14561
14580
  await this.connection.requestPermission(params)
14562
14581
  );
14563
- const outcome = output.outcome.outcome === "cancelled" ? "cancel" /* Cancel */ : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
14564
- if (outcome === "proceed_once" /* ProceedOnce */) {
14582
+ const outcome = output.outcome.outcome === "cancelled" ? ToolConfirmationOutcome.Cancel : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
14583
+ if (outcome === ToolConfirmationOutcome.ProceedOnce) {
14565
14584
  this.context.config.getWorkspaceContext().addReadOnlyPath(absolutePath);
14566
14585
  validationError = null;
14567
14586
  } else {
@@ -14998,7 +15017,7 @@ var AcpSessionManager = class {
14998
15017
  mcpServers,
14999
15018
  loadedSettings
15000
15019
  );
15001
- const authType = loadedSettings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ? "gateway" /* GATEWAY */ : "gemini-api-key" /* USE_GEMINI */);
15020
+ const authType = loadedSettings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ? AuthType.GATEWAY : AuthType.USE_GEMINI);
15002
15021
  let isAuthenticated = false;
15003
15022
  let authErrorMessage = "";
15004
15023
  try {
@@ -15010,7 +15029,7 @@ var AcpSessionManager = class {
15010
15029
  );
15011
15030
  isAuthenticated = true;
15012
15031
  const contentGeneratorConfig = config.getContentGeneratorConfig();
15013
- if (authType === "gemini-api-key" /* USE_GEMINI */ && (!contentGeneratorConfig || !contentGeneratorConfig.apiKey)) {
15032
+ if (authType === AuthType.USE_GEMINI && (!contentGeneratorConfig || !contentGeneratorConfig.apiKey)) {
15014
15033
  isAuthenticated = false;
15015
15034
  authErrorMessage = "Gemini API key is missing or not configured.";
15016
15035
  }
@@ -15119,7 +15138,7 @@ var AcpSessionManager = class {
15119
15138
  return response;
15120
15139
  }
15121
15140
  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);
15141
+ const selectedAuthType = this.settings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ? AuthType.GATEWAY : void 0);
15123
15142
  if (!selectedAuthType) {
15124
15143
  throw RequestError.authRequired();
15125
15144
  }
@@ -15220,12 +15239,12 @@ var GeminiAgent = class {
15220
15239
  }
15221
15240
  const authMethods = [
15222
15241
  {
15223
- id: "oauth-personal" /* LOGIN_WITH_GOOGLE */,
15242
+ id: AuthType.LOGIN_WITH_GOOGLE,
15224
15243
  name: "Log in with Google",
15225
15244
  description: "Log in with your Google account"
15226
15245
  },
15227
15246
  {
15228
- id: "gemini-api-key" /* USE_GEMINI */,
15247
+ id: AuthType.USE_GEMINI,
15229
15248
  name: "Gemini API key",
15230
15249
  description: "Use an API key with Gemini Developer API",
15231
15250
  _meta: {
@@ -15235,12 +15254,12 @@ var GeminiAgent = class {
15235
15254
  }
15236
15255
  },
15237
15256
  {
15238
- id: "vertex-ai" /* USE_VERTEX_AI */,
15257
+ id: AuthType.USE_VERTEX_AI,
15239
15258
  name: "Vertex AI",
15240
15259
  description: "Use an API key with Vertex AI GenAI API"
15241
15260
  },
15242
15261
  {
15243
- id: "gateway" /* GATEWAY */,
15262
+ id: AuthType.GATEWAY,
15244
15263
  name: "AI API Gateway",
15245
15264
  description: "Use a custom AI API Gateway",
15246
15265
  _meta: {
@@ -15413,7 +15432,7 @@ async function validateNonInteractiveAuth(configuredAuthType, useExternalAuth, n
15413
15432
  }
15414
15433
  return authType;
15415
15434
  } catch (error) {
15416
- if (nonInteractiveConfig.getOutputFormat() === "json" /* JSON */) {
15435
+ if (nonInteractiveConfig.getOutputFormat() === OutputFormat.JSON) {
15417
15436
  handleError(
15418
15437
  error instanceof Error ? error : new Error(String(error)),
15419
15438
  nonInteractiveConfig,
@@ -15608,10 +15627,10 @@ var SlashCommandConflictHandler = class {
15608
15627
  this.handleConflicts = this.handleConflicts.bind(this);
15609
15628
  }
15610
15629
  start() {
15611
- coreEvents.on("slash-command-conflicts" /* SlashCommandConflicts */, this.handleConflicts);
15630
+ coreEvents.on(CoreEvent.SlashCommandConflicts, this.handleConflicts);
15612
15631
  }
15613
15632
  stop() {
15614
- coreEvents.off("slash-command-conflicts" /* SlashCommandConflicts */, this.handleConflicts);
15633
+ coreEvents.off(CoreEvent.SlashCommandConflicts, this.handleConflicts);
15615
15634
  if (this.flushTimeout) {
15616
15635
  clearTimeout(this.flushTimeout);
15617
15636
  this.flushTimeout = null;
@@ -15892,7 +15911,7 @@ async function resolveSessionId(resumeArg, sessionIdArg, sessionFileArg) {
15892
15911
  }
15893
15912
  }
15894
15913
  async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
15895
- const { startInteractiveUI: doStartUI } = await import("./interactiveCli-ZJXV4DW7.js");
15914
+ const { startInteractiveUI: doStartUI } = await import("./interactiveCli-OGE5OTZB.js");
15896
15915
  await doStartUI(
15897
15916
  config,
15898
15917
  settings,
@@ -15995,12 +16014,12 @@ async function main() {
15995
16014
  dns.setDefaultResultOrder(
15996
16015
  validateDnsResolutionOrder(settings.merged.advanced.dnsResolutionOrder)
15997
16016
  );
15998
- if (!settings.merged.security.auth.selectedType || settings.merged.security.auth.selectedType === "cloud-shell" /* LEGACY_CLOUD_SHELL */) {
16017
+ if (!settings.merged.security.auth.selectedType || settings.merged.security.auth.selectedType === AuthType.LEGACY_CLOUD_SHELL) {
15999
16018
  if (process.env["CLOUD_SHELL"] === "true" || process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true") {
16000
16019
  settings.setValue(
16001
16020
  "User" /* User */,
16002
16021
  "security.auth.selectedType",
16003
- "compute-default-credentials" /* COMPUTE_ADC */
16022
+ AuthType.COMPUTE_ADC
16004
16023
  );
16005
16024
  }
16006
16025
  }
@@ -16101,7 +16120,7 @@ ${finalArgs[promptIndex + 1]}`;
16101
16120
  await config.storage.initialize();
16102
16121
  adminControlsListner.setConfig(config);
16103
16122
  if (config.isInteractive() && settings.merged.general.devtools) {
16104
- const { setupInitialActivityLogger } = await import("./devtoolsService-F7PHNBEQ.js");
16123
+ const { setupInitialActivityLogger } = await import("./devtoolsService-GJWWZ2KK.js");
16105
16124
  setupInitialActivityLogger(config);
16106
16125
  }
16107
16126
  registerTelemetryConfig(config);
@@ -16109,7 +16128,7 @@ ${finalArgs[promptIndex + 1]}`;
16109
16128
  const messageBus = config.getMessageBus();
16110
16129
  createPolicyUpdater2(policyEngine, messageBus, config.storage);
16111
16130
  registerCleanup(async () => {
16112
- await config.getHookSystem()?.fireSessionEndEvent("exit" /* Exit */);
16131
+ await config.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
16113
16132
  });
16114
16133
  if (!config.getAcpMode()) {
16115
16134
  registerCleanup(consolePatcher.cleanup);
@@ -16160,7 +16179,7 @@ ${finalArgs[promptIndex + 1]}`;
16160
16179
  const initAppHandle = startupProfiler.start("initialize_app");
16161
16180
  const initializationResult = await initializeApp(config, settings);
16162
16181
  initAppHandle?.end();
16163
- import("./liteRtServerManager-RNNHEQJI.js").then(({ LiteRtServerManager }) => {
16182
+ import("./liteRtServerManager-Q6LTEYH4.js").then(({ LiteRtServerManager }) => {
16164
16183
  const mergedGemma = settings.merged.experimental?.gemmaModelRouter;
16165
16184
  if (!mergedGemma) return;
16166
16185
  const userGemma = settings.forScope("User" /* User */).settings.experimental?.gemmaModelRouter;
@@ -16170,7 +16189,7 @@ ${finalArgs[promptIndex + 1]}`;
16170
16189
  autoStartServer: userGemma?.autoStartServer
16171
16190
  });
16172
16191
  }).catch((e) => debugLogger.warn("LiteRT auto-start import failed:", e));
16173
- if (settings.merged.security.auth.selectedType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
16192
+ if (settings.merged.security.auth.selectedType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
16174
16193
  await getOauthClient(settings.merged.security.auth.selectedType, config);
16175
16194
  }
16176
16195
  if (config.getAcpMode()) {
@@ -16186,7 +16205,7 @@ ${finalArgs[promptIndex + 1]}`;
16186
16205
  ...rawStartupWarnings.map((message) => ({
16187
16206
  id: `startup-${createHash2("sha256").update(message).digest("hex").substring(0, 16)}`,
16188
16207
  message,
16189
- priority: "high" /* High */
16208
+ priority: WarningPriority.High
16190
16209
  })),
16191
16210
  ...await getUserStartupWarnings(settings.merged, void 0, {
16192
16211
  isAlternateBuffer: useAlternateBuffer
@@ -16223,7 +16242,7 @@ ${finalArgs[promptIndex + 1]}`;
16223
16242
  ${input}` : stdinData;
16224
16243
  }
16225
16244
  }
16226
- const sessionStartSource = resumedSessionData ? "resume" /* Resume */ : "startup" /* Startup */;
16245
+ const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
16227
16246
  const hookSystem = config?.getHookSystem();
16228
16247
  if (hookSystem) {
16229
16248
  const result = await hookSystem.fireSessionStartEvent(sessionStartSource);
@@ -16280,8 +16299,8 @@ ${input}` : wrappedContext;
16280
16299
  }
16281
16300
  }
16282
16301
  function initializeOutputListenersAndFlush(config) {
16283
- if (coreEvents.listenerCount("output" /* Output */) === 0) {
16284
- coreEvents.on("output" /* Output */, (payload) => {
16302
+ if (coreEvents.listenerCount(CoreEvent.Output) === 0) {
16303
+ coreEvents.on(CoreEvent.Output, (payload) => {
16285
16304
  if (payload.isStderr) {
16286
16305
  writeToStderr(payload.chunk, payload.encoding);
16287
16306
  } else {
@@ -16289,8 +16308,8 @@ function initializeOutputListenersAndFlush(config) {
16289
16308
  }
16290
16309
  });
16291
16310
  }
16292
- if (coreEvents.listenerCount("console-log" /* ConsoleLog */) === 0) {
16293
- coreEvents.on("console-log" /* ConsoleLog */, (payload) => {
16311
+ if (coreEvents.listenerCount(CoreEvent.ConsoleLog) === 0) {
16312
+ coreEvents.on(CoreEvent.ConsoleLog, (payload) => {
16294
16313
  if (payload.type === "error" || payload.type === "warn") {
16295
16314
  writeToStderr(payload.content + "\n");
16296
16315
  } else {
@@ -16298,8 +16317,8 @@ function initializeOutputListenersAndFlush(config) {
16298
16317
  }
16299
16318
  });
16300
16319
  }
16301
- if (coreEvents.listenerCount("user-feedback" /* UserFeedback */) === 0) {
16302
- coreEvents.on("user-feedback" /* UserFeedback */, (payload) => {
16320
+ if (coreEvents.listenerCount(CoreEvent.UserFeedback) === 0) {
16321
+ coreEvents.on(CoreEvent.UserFeedback, (payload) => {
16303
16322
  writeToStderr(payload.message + "\n");
16304
16323
  });
16305
16324
  }
@@ -16307,7 +16326,7 @@ function initializeOutputListenersAndFlush(config) {
16307
16326
  const forceToStderr = outputFormat === "json";
16308
16327
  coreEvents.drainBacklogs(
16309
16328
  (event, args) => {
16310
- if (forceToStderr && event === "output" /* Output */) {
16329
+ if (forceToStderr && event === CoreEvent.Output) {
16311
16330
  const payload = args[0];
16312
16331
  if (!payload.isStderr) {
16313
16332
  return {