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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/bundle/{chunk-EDVFNWRG.js → chunk-2XMCTNPW.js} +1 -1
  2. package/bundle/{chunk-HN74ORTP.js → chunk-46DG3MEK.js} +15 -3
  3. package/bundle/{chunk-UFQDAROY.js → chunk-4TPFLAND.js} +1 -1
  4. package/bundle/{chunk-A4TO2DY2.js → chunk-627EICDK.js} +8258 -14927
  5. package/bundle/{chunk-EDYPRCAA.js → chunk-6JF3XGX6.js} +2 -2
  6. package/bundle/{chunk-SDWOC67Z.js → chunk-7AV6KELE.js} +1 -1
  7. package/bundle/{chunk-EBP6K2WG.js → chunk-7FPYEHDV.js} +25 -9
  8. package/bundle/{chunk-U76XPSKR.js → chunk-7OAPTXNW.js} +89 -60
  9. package/bundle/{chunk-EFX5XL6M.js → chunk-BONG2QK5.js} +2 -2
  10. package/bundle/{chunk-VBVCLWLA.js → chunk-BRVQMVD5.js} +2 -2
  11. package/bundle/{chunk-2NQXIWQK.js → chunk-BSE7BCTQ.js} +15 -3
  12. package/bundle/chunk-BYVRH4VZ.js +103137 -0
  13. package/bundle/{chunk-HSZIYPL6.js → chunk-EE4FVMPM.js} +3 -3
  14. package/bundle/{chunk-QUCRASYB.js → chunk-GWH2CDNQ.js} +1 -1
  15. package/bundle/{chunk-NX7TO2DU.js → chunk-H2WBGLUF.js} +1 -1
  16. package/bundle/{chunk-Y2HXXBXI.js → chunk-J7KGQZGT.js} +1 -1
  17. package/bundle/{chunk-UBGF6JU5.js → chunk-JLBO43LX.js} +1 -1
  18. package/bundle/{chunk-ZPLFLZQA.js → chunk-L3JNREL2.js} +21 -7
  19. package/bundle/{chunk-ZQW7OGUO.js → chunk-MN5WGELB.js} +426 -91
  20. package/bundle/{chunk-6OFXOGEG.js → chunk-NTBZBCDY.js} +456 -94
  21. package/bundle/{chunk-ZOHM7BPT.js → chunk-ONZZ4MZP.js} +1 -1
  22. package/bundle/chunk-POXVKWMH.js +17519 -0
  23. package/bundle/{chunk-MLSLNORV.js → chunk-R7OEYEVK.js} +3 -3
  24. package/bundle/{chunk-KCCVXZ52.js → chunk-RIRMXE4G.js} +25 -9
  25. package/bundle/{chunk-2VN53SWW.js → chunk-RQB6UOWL.js} +9 -8
  26. package/bundle/{chunk-VJYKQD5D.js → chunk-SQZOWFWU.js} +3 -3
  27. package/bundle/chunk-T7UXARRX.js +401531 -0
  28. package/bundle/chunk-TDYDNMXH.js +425 -0
  29. package/bundle/chunk-TVJ4WAFU.js +512 -0
  30. package/bundle/chunk-XNLASMX4.js +154 -0
  31. package/bundle/chunk-Y3EQFIOM.js +118 -0
  32. package/bundle/chunk-YKGBOB2S.js +1571 -0
  33. package/bundle/{cleanup-GGCB2LVD.js → cleanup-5HA3CDPH.js} +2 -2
  34. package/bundle/{cleanup-JRDG3OTL.js → cleanup-LXXTR2OE.js} +2 -2
  35. package/bundle/{cleanup-SSW6IXTR.js → cleanup-RM72YALN.js} +2 -2
  36. package/bundle/cleanup-TBTZ6WZD.js +32 -0
  37. package/bundle/{core-IUIZE6JW.js → core-NBQGNNOM.js} +11 -1
  38. package/bundle/{devtoolsService-3SADPKKB.js → devtoolsService-BUAVC3ZD.js} +2 -2
  39. package/bundle/{devtoolsService-XZCKFZP5.js → devtoolsService-DCRIOTR4.js} +2 -2
  40. package/bundle/{devtoolsService-MF6JKRUV.js → devtoolsService-PXS65V3Y.js} +4 -3
  41. package/bundle/devtoolsService-ZHFOHPIS.js +4359 -0
  42. package/bundle/{dist-7L3BRW6V.js → dist-24APVFHT.js} +11 -1
  43. package/bundle/{core-6HRWFQZW.js → dist-EOOSNLUQ.js} +11 -1
  44. package/bundle/dist-YP3VMVL6.js +2262 -0
  45. package/bundle/docs/tools/mcp-server.md +41 -12
  46. package/bundle/{gemini-JPMMQ3KA.js → gemini-LHZDQRUM.js} +13 -13
  47. package/bundle/{gemini-ZMMDUAQJ.js → gemini-Q4LI2KHU.js} +214 -198
  48. package/bundle/gemini-QM6PZXIH.js +17934 -0
  49. package/bundle/{gemini-QOQNG5VY.js → gemini-UEMV4Y7B.js} +13 -13
  50. package/bundle/gemini.js +7 -7
  51. package/bundle/{interactiveCli-R3P4A3FC.js → interactiveCli-HMZ5ZWK4.js} +9 -20
  52. package/bundle/{interactiveCli-UDWGRVJL.js → interactiveCli-IQQYS4AV.js} +9 -20
  53. package/bundle/{interactiveCli-3I4TG5SK.js → interactiveCli-QCNSW3M7.js} +313 -305
  54. package/bundle/interactiveCli-QXZXFSNY.js +34968 -0
  55. package/bundle/{liteRtServerManager-OVPUSK2T.js → liteRtServerManager-2I4N5IEZ.js} +4 -4
  56. package/bundle/{liteRtServerManager-RAV63AGE.js → liteRtServerManager-3IZ2LKBD.js} +4 -4
  57. package/bundle/{liteRtServerManager-4MWCEVVM.js → liteRtServerManager-RABYR6TB.js} +4 -4
  58. package/bundle/liteRtServerManager-T3MOB7VG.js +65 -0
  59. package/bundle/{oauth2-provider-FVTRRJZR.js → oauth2-provider-I3CU23H3.js} +1 -1
  60. package/bundle/{oauth2-provider-EWOA64PR.js → oauth2-provider-INBLO6HF.js} +38 -72
  61. package/bundle/oauth2-provider-UZV2BJA3.js +235 -0
  62. package/bundle/{oauth2-provider-XFP63FGJ.js → oauth2-provider-XFPEOXNY.js} +1 -1
  63. package/bundle/{start-DJAIXPPY.js → start-4UWH3BI7.js} +6 -6
  64. package/bundle/{start-VQQ2Q5KT.js → start-CQTZWDLV.js} +6 -6
  65. package/bundle/{start-5O7TBK5L.js → start-D6DJS7SZ.js} +6 -6
  66. package/bundle/start-IXFELTCY.js +18 -0
  67. package/package.json +1 -1
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  startCommand,
4
4
  startServer
5
- } from "./chunk-HSZIYPL6.js";
5
+ } from "./chunk-SQZOWFWU.js";
6
6
  import {
7
7
  BuiltinCommandLoader,
8
8
  CommandService,
@@ -46,11 +46,11 @@ import {
46
46
  updateExtension,
47
47
  validateAuthMethod,
48
48
  validateContextFilePath
49
- } from "./chunk-U76XPSKR.js";
49
+ } from "./chunk-BYVRH4VZ.js";
50
50
  import {
51
51
  exitCli,
52
52
  require_source
53
- } from "./chunk-QUCRASYB.js";
53
+ } from "./chunk-GWH2CDNQ.js";
54
54
  import {
55
55
  appEvents
56
56
  } from "./chunk-5PS3AYFU.js";
@@ -88,11 +88,11 @@ import {
88
88
  resolveGemmaConfig,
89
89
  saveModelChange,
90
90
  stripAnsi
91
- } from "./chunk-ZPLFLZQA.js";
91
+ } from "./chunk-POXVKWMH.js";
92
92
  import {
93
93
  RELAUNCH_EXIT_CODE
94
- } from "./chunk-EFX5XL6M.js";
95
- import "./chunk-2VN53SWW.js";
94
+ } from "./chunk-BONG2QK5.js";
95
+ import "./chunk-TVJ4WAFU.js";
96
96
  import {
97
97
  cleanupCheckpoints,
98
98
  registerCleanup,
@@ -101,12 +101,15 @@ import {
101
101
  runExitCleanup,
102
102
  runSyncCleanup,
103
103
  setupSignalHandlers
104
- } from "./chunk-UFQDAROY.js";
104
+ } from "./chunk-JLBO43LX.js";
105
105
  import {
106
106
  ASK_USER_TOOL_NAME,
107
+ ApprovalMode,
107
108
  AuthType,
108
109
  Client,
109
110
  Config,
111
+ CoreEvent,
112
+ CoreToolCallStatus,
110
113
  DEFAULT_CONTEXT_FILENAME,
111
114
  DEFAULT_FILE_FILTERING_OPTIONS,
112
115
  DEFAULT_GEMINI_EMBEDDING_MODEL,
@@ -128,19 +131,27 @@ import {
128
131
  FolderTrustDiscoveryService,
129
132
  GEMINI_DIR,
130
133
  GEMINI_MODEL_ALIAS_AUTO,
134
+ GeminiEventType,
131
135
  IdeClient,
136
+ IntegrityStatus,
132
137
  InvalidStreamError,
133
138
  JsonFormatter,
139
+ JsonStreamEventType,
140
+ Kind,
134
141
  LegacyAgentSession,
135
142
  Logger,
136
143
  MAX_TOKENS_EXCEEDED_SUGGESTION,
137
144
  MCPServerConfig,
145
+ MCPServerStatus,
146
+ MessageBusType,
138
147
  OTHER_BLOCKED_MESSAGE,
148
+ OutputFormat,
139
149
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
140
150
  PREVIEW_GEMINI_3_1_MODEL,
141
151
  PREVIEW_GEMINI_FLASH_LITE_MODEL,
142
152
  PREVIEW_GEMINI_FLASH_MODEL,
143
153
  PREVIEW_GEMINI_MODEL,
154
+ PolicyDecision,
144
155
  PolicyIntegrityManager,
145
156
  RECITATION_BLOCKED_MESSAGE,
146
157
  REFERENCE_CONTENT_START,
@@ -148,6 +159,8 @@ import {
148
159
  ReadManyFilesTool,
149
160
  SAFETY_BLOCKED_MESSAGE,
150
161
  Scheduler,
162
+ SessionEndReason,
163
+ SessionStartSource,
151
164
  ShellExecutionService,
152
165
  SimpleExtensionLoader,
153
166
  Storage,
@@ -156,10 +169,13 @@ import {
156
169
  TRUE_EMPTY_RESPONSE_MESSAGE,
157
170
  ToolCallEvent,
158
171
  ToolConfirmationOutcome,
172
+ ToolErrorType,
173
+ TrustLevel,
159
174
  UserAccountManager,
160
175
  UserPromptEvent,
161
176
  ValidationCancelledError,
162
177
  ValidationRequiredError,
178
+ WarningPriority,
163
179
  applyAdminAllowlist,
164
180
  applyRequiredServers,
165
181
  clearCachedCredentialFile,
@@ -240,7 +256,7 @@ import {
240
256
  updatePolicy,
241
257
  writeToStderr,
242
258
  writeToStdout
243
- } from "./chunk-A4TO2DY2.js";
259
+ } from "./chunk-627EICDK.js";
244
260
  import "./chunk-664ZODQF.js";
245
261
  import "./chunk-IUUIT4SU.js";
246
262
  import "./chunk-L6PII3GR.js";
@@ -5370,7 +5386,7 @@ var MCP_LIST_DEFAULT_TIMEOUT_MSEC = 5e3;
5370
5386
  async function testMCPConnection(serverName, config, isTrusted, activeSettings) {
5371
5387
  const isStdio = !!config.command;
5372
5388
  if (isStdio && !isTrusted) {
5373
- return "disconnected" /* DISCONNECTED */;
5389
+ return MCPServerStatus.DISCONNECTED;
5374
5390
  }
5375
5391
  const client = new Client({
5376
5392
  name: "mcp-test-client",
@@ -5406,7 +5422,7 @@ async function testMCPConnection(serverName, config, isTrusted, activeSettings)
5406
5422
  transport = await createTransport(serverName, config, false, mcpContext);
5407
5423
  } catch {
5408
5424
  await client.close();
5409
- return "disconnected" /* DISCONNECTED */;
5425
+ return MCPServerStatus.DISCONNECTED;
5410
5426
  }
5411
5427
  try {
5412
5428
  const timeout = config.timeout ?? MCP_LIST_DEFAULT_TIMEOUT_MSEC;
@@ -5420,10 +5436,10 @@ async function testMCPConnection(serverName, config, isTrusted, activeSettings)
5420
5436
  );
5421
5437
  }
5422
5438
  await client.close();
5423
- return "connected" /* CONNECTED */;
5439
+ return MCPServerStatus.CONNECTED;
5424
5440
  } catch {
5425
5441
  await transport.close();
5426
- return "disconnected" /* DISCONNECTED */;
5442
+ return MCPServerStatus.DISCONNECTED;
5427
5443
  }
5428
5444
  }
5429
5445
  async function getServerStatus(serverName, server, isTrusted, activeSettings, consolidatedExcluded, consolidatedAllowed) {
@@ -5436,12 +5452,12 @@ async function getServerStatus(serverName, server, isTrusted, activeSettings, co
5436
5452
  });
5437
5453
  if (!loadResult.allowed) {
5438
5454
  if (loadResult.blockType === "admin" || loadResult.blockType === "allowlist" || loadResult.blockType === "excludelist") {
5439
- return "blocked" /* BLOCKED */;
5455
+ return MCPServerStatus.BLOCKED;
5440
5456
  }
5441
- return "disabled" /* DISABLED */;
5457
+ return MCPServerStatus.DISABLED;
5442
5458
  }
5443
5459
  if (!isTrusted) {
5444
- return "disabled" /* DISABLED */;
5460
+ return MCPServerStatus.DISABLED;
5445
5461
  }
5446
5462
  return testMCPConnection(serverName, server, isTrusted, activeSettings);
5447
5463
  }
@@ -5487,23 +5503,23 @@ async function listMcpServers(loadedSettingsArg) {
5487
5503
  let statusIndicator = "";
5488
5504
  let statusText = "";
5489
5505
  switch (status) {
5490
- case "connected" /* CONNECTED */:
5506
+ case MCPServerStatus.CONNECTED:
5491
5507
  statusIndicator = import_chalk.default.green("\u2713");
5492
5508
  statusText = "Connected";
5493
5509
  break;
5494
- case "connecting" /* CONNECTING */:
5510
+ case MCPServerStatus.CONNECTING:
5495
5511
  statusIndicator = import_chalk.default.yellow("\u2026");
5496
5512
  statusText = "Connecting";
5497
5513
  break;
5498
- case "blocked" /* BLOCKED */:
5514
+ case MCPServerStatus.BLOCKED:
5499
5515
  statusIndicator = import_chalk.default.red("\u26D4");
5500
5516
  statusText = "Blocked";
5501
5517
  break;
5502
- case "disabled" /* DISABLED */:
5518
+ case MCPServerStatus.DISABLED:
5503
5519
  statusIndicator = import_chalk.default.gray("\u25CB");
5504
5520
  statusText = "Disabled";
5505
5521
  break;
5506
- case "disconnected" /* DISCONNECTED */:
5522
+ case MCPServerStatus.DISCONNECTED:
5507
5523
  default:
5508
5524
  statusIndicator = import_chalk.default.red("\u2717");
5509
5525
  statusText = "Disconnected";
@@ -5789,7 +5805,7 @@ async function handleInstall(args) {
5789
5805
  );
5790
5806
  if (confirmed) {
5791
5807
  const trustedFolders = loadTrustedFolders();
5792
- await trustedFolders.setValue(realPath, "TRUST_FOLDER" /* TRUST_FOLDER */);
5808
+ await trustedFolders.setValue(realPath, TrustLevel.TRUST_FOLDER);
5793
5809
  } else {
5794
5810
  throw new Error(
5795
5811
  `Installation aborted: Folder "${absolutePath}" is not trusted.`
@@ -7840,7 +7856,7 @@ async function loadSandboxConfig(settings, argv) {
7840
7856
  }
7841
7857
  const command2 = getSandboxCommand(sandboxValue);
7842
7858
  const packageJson = await getPackageJson(__dirname3);
7843
- const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.64.0-nightly.20260929.gd75234cae" ?? customImage ?? packageJson?.config?.sandboxImageUri;
7859
+ const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.64.0-preview.1" ?? customImage ?? packageJson?.config?.sandboxImageUri;
7844
7860
  const isNative = command2 === "windows-native" || command2 === "sandbox-exec" || command2 === "lxc";
7845
7861
  return command2 && (image || isNative) ? { enabled: true, allowedPaths, networkAccess, command: command2, image } : void 0;
7846
7862
  }
@@ -7899,9 +7915,9 @@ async function resolveWorkspacePolicyState(options) {
7899
7915
  cwd,
7900
7916
  potentialWorkspacePoliciesDir
7901
7917
  );
7902
- if (integrityResult.status === "MATCH" /* MATCH */) {
7918
+ if (integrityResult.status === IntegrityStatus.MATCH) {
7903
7919
  workspacePoliciesDir = potentialWorkspacePoliciesDir;
7904
- } else if (integrityResult.status === "NEW" /* NEW */ && integrityResult.fileCount === 0) {
7920
+ } else if (integrityResult.status === IntegrityStatus.NEW && integrityResult.fileCount === 0) {
7905
7921
  workspacePoliciesDir = void 0;
7906
7922
  } else if (interactive && !autoAcceptWorkspacePolicies) {
7907
7923
  policyUpdateConfirmationRequest = {
@@ -8329,23 +8345,23 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
8329
8345
  if (rawApprovalMode) {
8330
8346
  switch (rawApprovalMode) {
8331
8347
  case "yolo":
8332
- approvalMode = "yolo" /* YOLO */;
8348
+ approvalMode = ApprovalMode.YOLO;
8333
8349
  break;
8334
8350
  case "auto_edit":
8335
- approvalMode = "autoEdit" /* AUTO_EDIT */;
8351
+ approvalMode = ApprovalMode.AUTO_EDIT;
8336
8352
  break;
8337
8353
  case "plan":
8338
8354
  if (!(settings.general?.plan?.enabled ?? true)) {
8339
8355
  debugLogger.warn(
8340
8356
  'Approval mode "plan" is disabled in your settings. Falling back to "default".'
8341
8357
  );
8342
- approvalMode = "default" /* DEFAULT */;
8358
+ approvalMode = ApprovalMode.DEFAULT;
8343
8359
  } else {
8344
- approvalMode = "plan" /* PLAN */;
8360
+ approvalMode = ApprovalMode.PLAN;
8345
8361
  }
8346
8362
  break;
8347
8363
  case "default":
8348
- approvalMode = "default" /* DEFAULT */;
8364
+ approvalMode = ApprovalMode.DEFAULT;
8349
8365
  break;
8350
8366
  default:
8351
8367
  throw new Error(
@@ -8353,10 +8369,10 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
8353
8369
  );
8354
8370
  }
8355
8371
  } else {
8356
- approvalMode = "default" /* DEFAULT */;
8372
+ approvalMode = ApprovalMode.DEFAULT;
8357
8373
  }
8358
8374
  if (settings.security?.disableYoloMode || settings.admin?.secureModeEnabled) {
8359
- if (approvalMode === "yolo" /* YOLO */) {
8375
+ if (approvalMode === ApprovalMode.YOLO) {
8360
8376
  if (settings.admin?.secureModeEnabled) {
8361
8377
  debugLogger.error(
8362
8378
  'YOLO mode is disabled by "secureModeEnabled" setting.'
@@ -8374,16 +8390,16 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
8374
8390
  )
8375
8391
  );
8376
8392
  }
8377
- } else if (approvalMode === "yolo" /* YOLO */) {
8393
+ } else if (approvalMode === ApprovalMode.YOLO) {
8378
8394
  debugLogger.warn(
8379
8395
  "YOLO mode is enabled. All tool calls will be automatically approved."
8380
8396
  );
8381
8397
  }
8382
- if (!trustedFolder && approvalMode !== "default" /* DEFAULT */) {
8398
+ if (!trustedFolder && approvalMode !== ApprovalMode.DEFAULT) {
8383
8399
  debugLogger.warn(
8384
8400
  `Approval mode overridden to "default" because the current folder is not trusted.`
8385
8401
  );
8386
- approvalMode = "default" /* DEFAULT */;
8402
+ approvalMode = ApprovalMode.DEFAULT;
8387
8403
  }
8388
8404
  let telemetrySettings;
8389
8405
  try {
@@ -11084,7 +11100,7 @@ import path10 from "node:path";
11084
11100
  import process4 from "node:process";
11085
11101
  var homeDirectoryCheck = {
11086
11102
  id: "home-directory",
11087
- priority: "low" /* Low */,
11103
+ priority: WarningPriority.Low,
11088
11104
  check: async (workspaceRoot, settings) => {
11089
11105
  if (settings.ui?.showHomeDirectoryWarning === false) {
11090
11106
  return null;
@@ -11108,7 +11124,7 @@ var homeDirectoryCheck = {
11108
11124
  };
11109
11125
  var rootDirectoryCheck = {
11110
11126
  id: "root-directory",
11111
- priority: "high" /* High */,
11127
+ priority: WarningPriority.High,
11112
11128
  check: async (workspaceRoot, _settings) => {
11113
11129
  try {
11114
11130
  const workspaceRealPath = await fs9.realpath(workspaceRoot);
@@ -11124,7 +11140,7 @@ var rootDirectoryCheck = {
11124
11140
  };
11125
11141
  var folderTrustCheck = {
11126
11142
  id: "folder-trust",
11127
- priority: "high" /* High */,
11143
+ priority: WarningPriority.High,
11128
11144
  check: async (workspaceRoot, settings) => {
11129
11145
  if (!isFolderTrustEnabled(settings)) {
11130
11146
  return null;
@@ -11314,12 +11330,12 @@ function handleError(error, config, customErrorCode) {
11314
11330
  error,
11315
11331
  config.getContentGeneratorConfig()?.authType
11316
11332
  );
11317
- if (config.getOutputFormat() === "stream-json" /* STREAM_JSON */) {
11333
+ if (config.getOutputFormat() === OutputFormat.STREAM_JSON) {
11318
11334
  const streamFormatter = new StreamJsonFormatter();
11319
11335
  const errorCode = customErrorCode ?? extractErrorCode(error);
11320
11336
  const metrics = uiTelemetryService.getMetrics();
11321
11337
  streamFormatter.emitEvent({
11322
- type: "result" /* RESULT */,
11338
+ type: JsonStreamEventType.RESULT,
11323
11339
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
11324
11340
  status: "error",
11325
11341
  error: {
@@ -11330,7 +11346,7 @@ function handleError(error, config, customErrorCode) {
11330
11346
  });
11331
11347
  runSyncCleanup();
11332
11348
  process.exit(getNumericExitCode(errorCode));
11333
- } else if (config.getOutputFormat() === "json" /* JSON */) {
11349
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
11334
11350
  const formatter = new JsonFormatter();
11335
11351
  const errorCode = customErrorCode ?? extractErrorCode(error);
11336
11352
  const formattedError = formatter.formatError(
@@ -11350,11 +11366,11 @@ function handleToolError(toolName, toolError, config, errorType, resultDisplay)
11350
11366
  const isFatal = isFatalToolError(errorType);
11351
11367
  if (isFatal) {
11352
11368
  const toolExecutionError = new FatalToolExecutionError(errorMessage);
11353
- if (config.getOutputFormat() === "stream-json" /* STREAM_JSON */) {
11369
+ if (config.getOutputFormat() === OutputFormat.STREAM_JSON) {
11354
11370
  const streamFormatter = new StreamJsonFormatter();
11355
11371
  const metrics = uiTelemetryService.getMetrics();
11356
11372
  streamFormatter.emitEvent({
11357
- type: "result" /* RESULT */,
11373
+ type: JsonStreamEventType.RESULT,
11358
11374
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
11359
11375
  status: "error",
11360
11376
  error: {
@@ -11363,7 +11379,7 @@ function handleToolError(toolName, toolError, config, errorType, resultDisplay)
11363
11379
  },
11364
11380
  stats: streamFormatter.convertToStreamStats(metrics, 0)
11365
11381
  });
11366
- } else if (config.getOutputFormat() === "json" /* JSON */) {
11382
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
11367
11383
  const formatter = new JsonFormatter();
11368
11384
  const formattedError = formatter.formatError(
11369
11385
  toolExecutionError,
@@ -11381,11 +11397,11 @@ function handleToolError(toolName, toolError, config, errorType, resultDisplay)
11381
11397
  }
11382
11398
  function handleCancellationError(config) {
11383
11399
  const cancellationError = new FatalCancellationError("Operation cancelled.");
11384
- if (config.getOutputFormat() === "stream-json" /* STREAM_JSON */) {
11400
+ if (config.getOutputFormat() === OutputFormat.STREAM_JSON) {
11385
11401
  const streamFormatter = new StreamJsonFormatter();
11386
11402
  const metrics = uiTelemetryService.getMetrics();
11387
11403
  streamFormatter.emitEvent({
11388
- type: "result" /* RESULT */,
11404
+ type: JsonStreamEventType.RESULT,
11389
11405
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
11390
11406
  status: "error",
11391
11407
  error: {
@@ -11396,7 +11412,7 @@ function handleCancellationError(config) {
11396
11412
  });
11397
11413
  runSyncCleanup();
11398
11414
  process.exit(cancellationError.exitCode);
11399
- } else if (config.getOutputFormat() === "json" /* JSON */) {
11415
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
11400
11416
  const formatter = new JsonFormatter();
11401
11417
  const formattedError = formatter.formatError(
11402
11418
  cancellationError,
@@ -11416,11 +11432,11 @@ function handleMaxTurnsExceededError(config) {
11416
11432
  const maxTurnsError = new FatalTurnLimitedError(
11417
11433
  "Reached max session turns for this session. Increase the number of turns by specifying maxSessionTurns in settings.json."
11418
11434
  );
11419
- if (config.getOutputFormat() === "stream-json" /* STREAM_JSON */) {
11435
+ if (config.getOutputFormat() === OutputFormat.STREAM_JSON) {
11420
11436
  const streamFormatter = new StreamJsonFormatter();
11421
11437
  const metrics = uiTelemetryService.getMetrics();
11422
11438
  streamFormatter.emitEvent({
11423
- type: "result" /* RESULT */,
11439
+ type: JsonStreamEventType.RESULT,
11424
11440
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
11425
11441
  status: "error",
11426
11442
  error: {
@@ -11431,7 +11447,7 @@ function handleMaxTurnsExceededError(config) {
11431
11447
  });
11432
11448
  runSyncCleanup();
11433
11449
  process.exit(maxTurnsError.exitCode);
11434
- } else if (config.getOutputFormat() === "json" /* JSON */) {
11450
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
11435
11451
  const formatter = new JsonFormatter();
11436
11452
  const formattedError = formatter.formatError(
11437
11453
  maxTurnsError,
@@ -11511,7 +11527,7 @@ async function runNonInteractive({
11511
11527
  }
11512
11528
  });
11513
11529
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
11514
- const { setupInitialActivityLogger } = await import("./devtoolsService-3SADPKKB.js");
11530
+ const { setupInitialActivityLogger } = await import("./devtoolsService-DCRIOTR4.js");
11515
11531
  setupInitialActivityLogger(config);
11516
11532
  }
11517
11533
  const { stdout: workingStdout } = createWorkingStdio();
@@ -11527,7 +11543,7 @@ async function runNonInteractive({
11527
11543
  }
11528
11544
  };
11529
11545
  const startTime = Date.now();
11530
- const streamFormatter = config.getOutputFormat() === "stream-json" /* STREAM_JSON */ ? new StreamJsonFormatter() : null;
11546
+ const streamFormatter = config.getOutputFormat() === OutputFormat.STREAM_JSON ? new StreamJsonFormatter() : null;
11531
11547
  const abortController = new AbortController();
11532
11548
  let isAborting = false;
11533
11549
  let cancelMessageTimer = null;
@@ -11580,13 +11596,13 @@ async function runNonInteractive({
11580
11596
  };
11581
11597
  try {
11582
11598
  consolePatcher.patch();
11583
- if (config.getRawOutput() && !config.getAcceptRawOutputRisk() && config.getOutputFormat() === "text" /* TEXT */) {
11599
+ if (config.getRawOutput() && !config.getAcceptRawOutputRisk() && config.getOutputFormat() === OutputFormat.TEXT) {
11584
11600
  process.stderr.write(
11585
11601
  "[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"
11586
11602
  );
11587
11603
  }
11588
11604
  setupStdinCancellation();
11589
- coreEvents.on("user-feedback" /* UserFeedback */, handleUserFeedback);
11605
+ coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
11590
11606
  coreEvents.drainBacklogs();
11591
11607
  process.stdout.on("error", (err) => {
11592
11608
  if (err.code === "EPIPE") {
@@ -11612,7 +11628,7 @@ async function runNonInteractive({
11612
11628
  }
11613
11629
  if (streamFormatter) {
11614
11630
  streamFormatter.emitEvent({
11615
- type: "init" /* INIT */,
11631
+ type: JsonStreamEventType.INIT,
11616
11632
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
11617
11633
  session_id: config.getSessionId(),
11618
11634
  model: config.getModel()
@@ -11650,7 +11666,7 @@ async function runNonInteractive({
11650
11666
  }
11651
11667
  if (streamFormatter) {
11652
11668
  streamFormatter.emitEvent({
11653
- type: "message" /* MESSAGE */,
11669
+ type: JsonStreamEventType.MESSAGE,
11654
11670
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
11655
11671
  role: "user",
11656
11672
  content: input
@@ -11689,12 +11705,12 @@ async function runNonInteractive({
11689
11705
  const metrics = uiTelemetryService.getMetrics();
11690
11706
  const durationMs = Date.now() - startTime;
11691
11707
  streamFormatter.emitEvent({
11692
- type: "result" /* RESULT */,
11708
+ type: JsonStreamEventType.RESULT,
11693
11709
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
11694
11710
  status: errorPayload ? "error" : "success",
11695
11711
  stats: streamFormatter.convertToStreamStats(metrics, durationMs)
11696
11712
  });
11697
- } else if (config.getOutputFormat() === "json" /* JSON */) {
11713
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
11698
11714
  const formatter = new JsonFormatter();
11699
11715
  const stats = uiTelemetryService.getMetrics();
11700
11716
  textOutput.write(
@@ -11787,13 +11803,13 @@ async function runNonInteractive({
11787
11803
  const output = isRaw ? part.text : stripAnsi(part.text);
11788
11804
  if (streamFormatter) {
11789
11805
  streamFormatter.emitEvent({
11790
- type: "message" /* MESSAGE */,
11806
+ type: JsonStreamEventType.MESSAGE,
11791
11807
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
11792
11808
  role: "assistant",
11793
11809
  content: output,
11794
11810
  delta: true
11795
11811
  });
11796
- } else if (config.getOutputFormat() === "json" /* JSON */) {
11812
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
11797
11813
  responseText += output;
11798
11814
  } else {
11799
11815
  if (part.text) {
@@ -11806,13 +11822,13 @@ async function runNonInteractive({
11806
11822
  break;
11807
11823
  }
11808
11824
  case "tool_request": {
11809
- if (config.getOutputFormat() === "json" /* JSON */) {
11825
+ if (config.getOutputFormat() === OutputFormat.JSON) {
11810
11826
  preToolResponseText = responseText || preToolResponseText;
11811
11827
  responseText = "";
11812
11828
  }
11813
11829
  if (streamFormatter) {
11814
11830
  streamFormatter.emitEvent({
11815
- type: "tool_use" /* TOOL_USE */,
11831
+ type: JsonStreamEventType.TOOL_USE,
11816
11832
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
11817
11833
  tool_name: event.name,
11818
11834
  tool_id: event.requestId,
@@ -11828,7 +11844,7 @@ async function runNonInteractive({
11828
11844
  const displayText = displayContentToString(display);
11829
11845
  const errorMsg = getTextContent(event.content) ?? "Tool error";
11830
11846
  streamFormatter.emitEvent({
11831
- type: "tool_result" /* TOOL_RESULT */,
11847
+ type: JsonStreamEventType.TOOL_RESULT,
11832
11848
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
11833
11849
  tool_id: event.requestId,
11834
11850
  status: event.isError ? "error" : "success",
@@ -11843,17 +11859,17 @@ async function runNonInteractive({
11843
11859
  const display = event.display?.result;
11844
11860
  const displayText = displayContentToString(display);
11845
11861
  const errorMsg = getTextContent(event.content) ?? "Tool error";
11846
- if (event.data?.["errorType"] === "stop_execution" /* STOP_EXECUTION */) {
11847
- if (config.getOutputFormat() === "json" /* JSON */ && !responseText && preToolResponseText) {
11862
+ if (event.data?.["errorType"] === ToolErrorType.STOP_EXECUTION) {
11863
+ if (config.getOutputFormat() === OutputFormat.JSON && !responseText && preToolResponseText) {
11848
11864
  responseText = preToolResponseText;
11849
11865
  }
11850
11866
  const stopMessage = `Agent execution stopped: ${errorMsg}`;
11851
- if (config.getOutputFormat() === "text" /* TEXT */) {
11867
+ if (config.getOutputFormat() === OutputFormat.TEXT) {
11852
11868
  process.stderr.write(`${stopMessage}
11853
11869
  `);
11854
11870
  }
11855
11871
  }
11856
- if (event.data?.["errorType"] === "no_space_left" /* NO_SPACE_LEFT */) {
11872
+ if (event.data?.["errorType"] === ToolErrorType.NO_SPACE_LEFT) {
11857
11873
  throw new FatalToolExecutionError(
11858
11874
  "Error executing tool " + event.name + ": " + (displayText || errorMsg)
11859
11875
  );
@@ -11888,12 +11904,12 @@ async function runNonInteractive({
11888
11904
  }
11889
11905
  if (streamFormatter) {
11890
11906
  streamFormatter.emitEvent({
11891
- type: "error" /* ERROR */,
11907
+ type: JsonStreamEventType.ERROR,
11892
11908
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
11893
11909
  severity: "error",
11894
11910
  message: errorMessage
11895
11911
  });
11896
- } else if (config.getOutputFormat() === "text" /* TEXT */) {
11912
+ } else if (config.getOutputFormat() === OutputFormat.TEXT) {
11897
11913
  process.stderr.write(`[ERROR] ${errorMessage}
11898
11914
  `);
11899
11915
  }
@@ -11914,12 +11930,12 @@ async function runNonInteractive({
11914
11930
  const errorCode = event._meta?.["code"];
11915
11931
  if (errorCode === "AGENT_EXECUTION_BLOCKED") {
11916
11932
  const blockMessage = `Agent execution blocked: ${event.message.trim()}`;
11917
- if (config.getOutputFormat() === "text" /* TEXT */) {
11933
+ if (config.getOutputFormat() === OutputFormat.TEXT) {
11918
11934
  process.stderr.write(`[WARNING] ${blockMessage}
11919
11935
  `);
11920
11936
  } else if (streamFormatter) {
11921
11937
  streamFormatter.emitEvent({
11922
- type: "error" /* ERROR */,
11938
+ type: JsonStreamEventType.ERROR,
11923
11939
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
11924
11940
  severity: "warning",
11925
11941
  message: stripAnsi(blockMessage)
@@ -11929,13 +11945,13 @@ async function runNonInteractive({
11929
11945
  break;
11930
11946
  }
11931
11947
  const severity = event.status === "RESOURCE_EXHAUSTED" ? "error" : "warning";
11932
- if (config.getOutputFormat() === "text" /* TEXT */) {
11948
+ if (config.getOutputFormat() === OutputFormat.TEXT) {
11933
11949
  process.stderr.write(`[WARNING] ${event.message}
11934
11950
  `);
11935
11951
  }
11936
11952
  if (streamFormatter) {
11937
11953
  streamFormatter.emitEvent({
11938
- type: "error" /* ERROR */,
11954
+ type: JsonStreamEventType.ERROR,
11939
11955
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
11940
11956
  severity,
11941
11957
  message: stripAnsi(event.message)
@@ -11955,7 +11971,7 @@ async function runNonInteractive({
11955
11971
  );
11956
11972
  } else if (streamFormatter) {
11957
11973
  streamFormatter.emitEvent({
11958
- type: "error" /* ERROR */,
11974
+ type: JsonStreamEventType.ERROR,
11959
11975
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
11960
11976
  severity: "error",
11961
11977
  message: "Maximum session turns exceeded"
@@ -11963,7 +11979,7 @@ async function runNonInteractive({
11963
11979
  }
11964
11980
  }
11965
11981
  const stopMessage = typeof event.data?.["message"] === "string" ? event.data["message"] : "";
11966
- if (stopMessage && config.getOutputFormat() === "text" /* TEXT */) {
11982
+ if (stopMessage && config.getOutputFormat() === OutputFormat.TEXT) {
11967
11983
  process.stderr.write(`Agent execution stopped: ${stopMessage}
11968
11984
  `);
11969
11985
  }
@@ -11993,7 +12009,7 @@ async function runNonInteractive({
11993
12009
  abortController.signal.removeEventListener("abort", abortSession);
11994
12010
  scheduler?.dispose();
11995
12011
  consolePatcher.cleanup();
11996
- coreEvents.off("user-feedback" /* UserFeedback */, handleUserFeedback);
12012
+ coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
11997
12013
  }
11998
12014
  if (errorToHandle) {
11999
12015
  handleError(errorToHandle, config);
@@ -12021,7 +12037,7 @@ async function runNonInteractive2(params) {
12021
12037
  }
12022
12038
  });
12023
12039
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
12024
- const { setupInitialActivityLogger } = await import("./devtoolsService-3SADPKKB.js");
12040
+ const { setupInitialActivityLogger } = await import("./devtoolsService-DCRIOTR4.js");
12025
12041
  setupInitialActivityLogger(config);
12026
12042
  }
12027
12043
  const { stdout: workingStdout } = createWorkingStdio();
@@ -12037,7 +12053,7 @@ async function runNonInteractive2(params) {
12037
12053
  }
12038
12054
  };
12039
12055
  const startTime = Date.now();
12040
- const streamFormatter = config.getOutputFormat() === "stream-json" /* STREAM_JSON */ ? new StreamJsonFormatter() : null;
12056
+ const streamFormatter = config.getOutputFormat() === OutputFormat.STREAM_JSON ? new StreamJsonFormatter() : null;
12041
12057
  const abortController = new AbortController();
12042
12058
  let isAborting = false;
12043
12059
  let cancelMessageTimer = null;
@@ -12088,13 +12104,13 @@ async function runNonInteractive2(params) {
12088
12104
  let scheduler;
12089
12105
  try {
12090
12106
  consolePatcher.patch();
12091
- if (config.getRawOutput() && !config.getAcceptRawOutputRisk() && config.getOutputFormat() === "text" /* TEXT */) {
12107
+ if (config.getRawOutput() && !config.getAcceptRawOutputRisk() && config.getOutputFormat() === OutputFormat.TEXT) {
12092
12108
  process.stderr.write(
12093
12109
  "[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"
12094
12110
  );
12095
12111
  }
12096
12112
  setupStdinCancellation();
12097
- coreEvents.on("user-feedback" /* UserFeedback */, handleUserFeedback);
12113
+ coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
12098
12114
  coreEvents.drainBacklogs();
12099
12115
  process.stdout.on("error", (err) => {
12100
12116
  if (err.code === "EPIPE") {
@@ -12118,7 +12134,7 @@ async function runNonInteractive2(params) {
12118
12134
  }
12119
12135
  if (streamFormatter) {
12120
12136
  streamFormatter.emitEvent({
12121
- type: "init" /* INIT */,
12137
+ type: JsonStreamEventType.INIT,
12122
12138
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
12123
12139
  session_id: config.getSessionId(),
12124
12140
  model: config.getModel()
@@ -12156,7 +12172,7 @@ async function runNonInteractive2(params) {
12156
12172
  }
12157
12173
  if (streamFormatter) {
12158
12174
  streamFormatter.emitEvent({
12159
- type: "message" /* MESSAGE */,
12175
+ type: JsonStreamEventType.MESSAGE,
12160
12176
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
12161
12177
  role: "user",
12162
12178
  content: input
@@ -12184,28 +12200,28 @@ async function runNonInteractive2(params) {
12184
12200
  if (abortController.signal.aborted) {
12185
12201
  handleCancellationError(config);
12186
12202
  }
12187
- if (event.type === "content" /* Content */) {
12203
+ if (event.type === GeminiEventType.Content) {
12188
12204
  const isRaw = config.getRawOutput() || config.getAcceptRawOutputRisk();
12189
12205
  const output = isRaw ? event.value : stripAnsi(event.value);
12190
12206
  if (streamFormatter) {
12191
12207
  streamFormatter.emitEvent({
12192
- type: "message" /* MESSAGE */,
12208
+ type: JsonStreamEventType.MESSAGE,
12193
12209
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
12194
12210
  role: "assistant",
12195
12211
  content: output,
12196
12212
  delta: true
12197
12213
  });
12198
- } else if (config.getOutputFormat() === "json" /* JSON */) {
12214
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
12199
12215
  responseText += output;
12200
12216
  } else {
12201
12217
  if (event.value) {
12202
12218
  textOutput.write(output);
12203
12219
  }
12204
12220
  }
12205
- } else if (event.type === "tool_call_request" /* ToolCallRequest */) {
12221
+ } else if (event.type === GeminiEventType.ToolCallRequest) {
12206
12222
  if (streamFormatter) {
12207
12223
  streamFormatter.emitEvent({
12208
- type: "tool_use" /* TOOL_USE */,
12224
+ type: JsonStreamEventType.TOOL_USE,
12209
12225
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
12210
12226
  tool_name: event.value.name,
12211
12227
  tool_id: event.value.callId,
@@ -12213,33 +12229,33 @@ async function runNonInteractive2(params) {
12213
12229
  });
12214
12230
  }
12215
12231
  toolCallRequests.push(event.value);
12216
- } else if (event.type === "loop_detected" /* LoopDetected */) {
12232
+ } else if (event.type === GeminiEventType.LoopDetected) {
12217
12233
  const message = "Loop detected, stopping execution";
12218
12234
  if (streamFormatter) {
12219
12235
  streamFormatter.emitEvent({
12220
- type: "error" /* ERROR */,
12236
+ type: JsonStreamEventType.ERROR,
12221
12237
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
12222
12238
  severity: "warning",
12223
12239
  message
12224
12240
  });
12225
12241
  }
12226
12242
  warnings.push(message);
12227
- } else if (event.type === "max_session_turns" /* MaxSessionTurns */) {
12243
+ } else if (event.type === GeminiEventType.MaxSessionTurns) {
12228
12244
  const message = "Maximum session turns exceeded";
12229
12245
  if (streamFormatter) {
12230
12246
  streamFormatter.emitEvent({
12231
- type: "error" /* ERROR */,
12247
+ type: JsonStreamEventType.ERROR,
12232
12248
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
12233
12249
  severity: "error",
12234
12250
  message
12235
12251
  });
12236
12252
  }
12237
12253
  warnings.push(message);
12238
- } else if (event.type === "error" /* Error */) {
12254
+ } else if (event.type === GeminiEventType.Error) {
12239
12255
  throw event.value.error;
12240
- } else if (event.type === "agent_execution_stopped" /* AgentExecutionStopped */) {
12256
+ } else if (event.type === GeminiEventType.AgentExecutionStopped) {
12241
12257
  const stopMessage = `Agent execution stopped: ${event.value.systemMessage?.trim() || event.value.reason}`;
12242
- if (config.getOutputFormat() === "text" /* TEXT */) {
12258
+ if (config.getOutputFormat() === OutputFormat.TEXT) {
12243
12259
  process.stderr.write(`${stopMessage}
12244
12260
  `);
12245
12261
  }
@@ -12247,7 +12263,7 @@ async function runNonInteractive2(params) {
12247
12263
  const metrics = uiTelemetryService.getMetrics();
12248
12264
  const durationMs = Date.now() - startTime;
12249
12265
  streamFormatter.emitEvent({
12250
- type: "result" /* RESULT */,
12266
+ type: JsonStreamEventType.RESULT,
12251
12267
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
12252
12268
  status: "success",
12253
12269
  stats: streamFormatter.convertToStreamStats(
@@ -12255,7 +12271,7 @@ async function runNonInteractive2(params) {
12255
12271
  durationMs
12256
12272
  )
12257
12273
  });
12258
- } else if (config.getOutputFormat() === "json" /* JSON */) {
12274
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
12259
12275
  const formatter = new JsonFormatter();
12260
12276
  const stats = uiTelemetryService.getMetrics();
12261
12277
  textOutput.write(
@@ -12271,21 +12287,21 @@ async function runNonInteractive2(params) {
12271
12287
  textOutput.ensureTrailingNewline();
12272
12288
  }
12273
12289
  return;
12274
- } else if (event.type === "agent_execution_blocked" /* AgentExecutionBlocked */) {
12290
+ } else if (event.type === GeminiEventType.AgentExecutionBlocked) {
12275
12291
  const blockMessage = `Agent execution blocked: ${event.value.systemMessage?.trim() || event.value.reason}`;
12276
- if (config.getOutputFormat() === "text" /* TEXT */) {
12292
+ if (config.getOutputFormat() === OutputFormat.TEXT) {
12277
12293
  process.stderr.write(`[WARNING] ${blockMessage}
12278
12294
  `);
12279
12295
  } else if (streamFormatter) {
12280
12296
  streamFormatter.emitEvent({
12281
- type: "error" /* ERROR */,
12297
+ type: JsonStreamEventType.ERROR,
12282
12298
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
12283
12299
  severity: "warning",
12284
12300
  message: stripAnsi(blockMessage)
12285
12301
  });
12286
12302
  }
12287
12303
  warnings.push(blockMessage);
12288
- } else if (event.type === "invalid_stream" /* InvalidStream */) {
12304
+ } else if (event.type === GeminiEventType.InvalidStream) {
12289
12305
  const eventValue = event.value;
12290
12306
  if (eventValue?.type === "NO_RESPONSE_TEXT") {
12291
12307
  invalidStreamError = TRUE_EMPTY_RESPONSE_MESSAGE;
@@ -12308,12 +12324,12 @@ async function runNonInteractive2(params) {
12308
12324
  );
12309
12325
  if (streamFormatter) {
12310
12326
  streamFormatter.emitEvent({
12311
- type: "error" /* ERROR */,
12327
+ type: JsonStreamEventType.ERROR,
12312
12328
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
12313
12329
  severity: "error",
12314
12330
  message: invalidStreamError
12315
12331
  });
12316
- } else if (config.getOutputFormat() === "text" /* TEXT */) {
12332
+ } else if (config.getOutputFormat() === OutputFormat.TEXT) {
12317
12333
  process.stderr.write(`[ERROR] ${invalidStreamError}
12318
12334
  `);
12319
12335
  }
@@ -12333,7 +12349,7 @@ async function runNonInteractive2(params) {
12333
12349
  const requestInfo = completedToolCall.request;
12334
12350
  if (streamFormatter) {
12335
12351
  streamFormatter.emitEvent({
12336
- type: "tool_result" /* TOOL_RESULT */,
12352
+ type: JsonStreamEventType.TOOL_RESULT,
12337
12353
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
12338
12354
  tool_id: requestInfo.callId,
12339
12355
  status: completedToolCall.status === "error" ? "error" : "success",
@@ -12367,11 +12383,11 @@ async function runNonInteractive2(params) {
12367
12383
  );
12368
12384
  }
12369
12385
  const stopExecutionTool = completedToolCalls.find(
12370
- (tc) => tc.response.errorType === "stop_execution" /* STOP_EXECUTION */
12386
+ (tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
12371
12387
  );
12372
12388
  if (stopExecutionTool && stopExecutionTool.response.error) {
12373
12389
  const stopMessage = `Agent execution stopped: ${stopExecutionTool.response.error.message}`;
12374
- if (config.getOutputFormat() === "text" /* TEXT */) {
12390
+ if (config.getOutputFormat() === OutputFormat.TEXT) {
12375
12391
  process.stderr.write(`${stopMessage}
12376
12392
  `);
12377
12393
  }
@@ -12379,7 +12395,7 @@ async function runNonInteractive2(params) {
12379
12395
  const metrics = uiTelemetryService.getMetrics();
12380
12396
  const durationMs = Date.now() - startTime;
12381
12397
  streamFormatter.emitEvent({
12382
- type: "result" /* RESULT */,
12398
+ type: JsonStreamEventType.RESULT,
12383
12399
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
12384
12400
  status: "success",
12385
12401
  stats: streamFormatter.convertToStreamStats(
@@ -12387,7 +12403,7 @@ async function runNonInteractive2(params) {
12387
12403
  durationMs
12388
12404
  )
12389
12405
  });
12390
- } else if (config.getOutputFormat() === "json" /* JSON */) {
12406
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
12391
12407
  const formatter = new JsonFormatter();
12392
12408
  const stats = uiTelemetryService.getMetrics();
12393
12409
  textOutput.write(
@@ -12410,12 +12426,12 @@ async function runNonInteractive2(params) {
12410
12426
  const metrics = uiTelemetryService.getMetrics();
12411
12427
  const durationMs = Date.now() - startTime;
12412
12428
  streamFormatter.emitEvent({
12413
- type: "result" /* RESULT */,
12429
+ type: JsonStreamEventType.RESULT,
12414
12430
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
12415
12431
  status: invalidStreamError ? "error" : "success",
12416
12432
  stats: streamFormatter.convertToStreamStats(metrics, durationMs)
12417
12433
  });
12418
- } else if (config.getOutputFormat() === "json" /* JSON */) {
12434
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
12419
12435
  const formatter = new JsonFormatter();
12420
12436
  const stats = uiTelemetryService.getMetrics();
12421
12437
  textOutput.write(
@@ -12439,7 +12455,7 @@ async function runNonInteractive2(params) {
12439
12455
  cleanupStdinCancellation();
12440
12456
  scheduler?.dispose();
12441
12457
  consolePatcher.cleanup();
12442
- coreEvents.off("user-feedback" /* UserFeedback */, handleUserFeedback);
12458
+ coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
12443
12459
  }
12444
12460
  if (errorToHandle) {
12445
12461
  handleError(errorToHandle, config);
@@ -14830,12 +14846,12 @@ function toToolCallContent(toolResult) {
14830
14846
  }
14831
14847
  var basicPermissionOptions = [
14832
14848
  {
14833
- optionId: "proceed_once" /* ProceedOnce */,
14849
+ optionId: ToolConfirmationOutcome.ProceedOnce,
14834
14850
  name: "Allow",
14835
14851
  kind: "allow_once"
14836
14852
  },
14837
14853
  {
14838
- optionId: "cancel" /* Cancel */,
14854
+ optionId: ToolConfirmationOutcome.Cancel,
14839
14855
  name: "Reject",
14840
14856
  kind: "reject_once"
14841
14857
  }
@@ -14847,13 +14863,13 @@ function toPermissionOptions(confirmation, config, enablePermanentToolApproval =
14847
14863
  switch (confirmation.type) {
14848
14864
  case "edit":
14849
14865
  options.push({
14850
- optionId: "proceed_always" /* ProceedAlways */,
14866
+ optionId: ToolConfirmationOutcome.ProceedAlways,
14851
14867
  name: "Allow for this session",
14852
14868
  kind: "allow_always"
14853
14869
  });
14854
14870
  if (enablePermanentToolApproval) {
14855
14871
  options.push({
14856
- optionId: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
14872
+ optionId: ToolConfirmationOutcome.ProceedAlwaysAndSave,
14857
14873
  name: "Allow for this file in all future sessions",
14858
14874
  kind: "allow_always"
14859
14875
  });
@@ -14861,13 +14877,13 @@ function toPermissionOptions(confirmation, config, enablePermanentToolApproval =
14861
14877
  break;
14862
14878
  case "exec":
14863
14879
  options.push({
14864
- optionId: "proceed_always" /* ProceedAlways */,
14880
+ optionId: ToolConfirmationOutcome.ProceedAlways,
14865
14881
  name: "Allow for this session",
14866
14882
  kind: "allow_always"
14867
14883
  });
14868
14884
  if (enablePermanentToolApproval) {
14869
14885
  options.push({
14870
- optionId: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
14886
+ optionId: ToolConfirmationOutcome.ProceedAlwaysAndSave,
14871
14887
  name: "Allow this command for all future sessions",
14872
14888
  kind: "allow_always"
14873
14889
  });
@@ -14876,19 +14892,19 @@ function toPermissionOptions(confirmation, config, enablePermanentToolApproval =
14876
14892
  case "mcp":
14877
14893
  options.push(
14878
14894
  {
14879
- optionId: "proceed_always_server" /* ProceedAlwaysServer */,
14895
+ optionId: ToolConfirmationOutcome.ProceedAlwaysServer,
14880
14896
  name: "Allow all server tools for this session",
14881
14897
  kind: "allow_always"
14882
14898
  },
14883
14899
  {
14884
- optionId: "proceed_always_tool" /* ProceedAlwaysTool */,
14900
+ optionId: ToolConfirmationOutcome.ProceedAlwaysTool,
14885
14901
  name: "Allow tool for this session",
14886
14902
  kind: "allow_always"
14887
14903
  }
14888
14904
  );
14889
14905
  if (enablePermanentToolApproval) {
14890
14906
  options.push({
14891
- optionId: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
14907
+ optionId: ToolConfirmationOutcome.ProceedAlwaysAndSave,
14892
14908
  name: "Allow tool for all future sessions",
14893
14909
  kind: "allow_always"
14894
14910
  });
@@ -14896,13 +14912,13 @@ function toPermissionOptions(confirmation, config, enablePermanentToolApproval =
14896
14912
  break;
14897
14913
  case "info":
14898
14914
  options.push({
14899
- optionId: "proceed_always" /* ProceedAlways */,
14915
+ optionId: ToolConfirmationOutcome.ProceedAlways,
14900
14916
  name: "Allow for this session",
14901
14917
  kind: "allow_always"
14902
14918
  });
14903
14919
  if (enablePermanentToolApproval) {
14904
14920
  options.push({
14905
- optionId: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
14921
+ optionId: ToolConfirmationOutcome.ProceedAlwaysAndSave,
14906
14922
  name: "Allow for all future sessions",
14907
14923
  kind: "allow_always"
14908
14924
  });
@@ -14934,21 +14950,21 @@ function toPermissionOptions(confirmation, config, enablePermanentToolApproval =
14934
14950
  }
14935
14951
  function toAcpToolKind(kind) {
14936
14952
  switch (kind) {
14937
- case "read" /* Read */:
14938
- case "edit" /* Edit */:
14939
- case "execute" /* Execute */:
14940
- case "search" /* Search */:
14941
- case "delete" /* Delete */:
14942
- case "move" /* Move */:
14943
- case "think" /* Think */:
14944
- case "fetch" /* Fetch */:
14945
- case "switch_mode" /* SwitchMode */:
14946
- case "other" /* Other */:
14953
+ case Kind.Read:
14954
+ case Kind.Edit:
14955
+ case Kind.Execute:
14956
+ case Kind.Search:
14957
+ case Kind.Delete:
14958
+ case Kind.Move:
14959
+ case Kind.Think:
14960
+ case Kind.Fetch:
14961
+ case Kind.SwitchMode:
14962
+ case Kind.Other:
14947
14963
  return kind;
14948
- case "agent" /* Agent */:
14964
+ case Kind.Agent:
14949
14965
  return "think";
14950
- case "plan" /* Plan */:
14951
- case "communicate" /* Communicate */:
14966
+ case Kind.Plan:
14967
+ case Kind.Communicate:
14952
14968
  default:
14953
14969
  return "other";
14954
14970
  }
@@ -14956,24 +14972,24 @@ function toAcpToolKind(kind) {
14956
14972
  function buildAvailableModes(isPlanEnabled) {
14957
14973
  const modes = [
14958
14974
  {
14959
- id: "default" /* DEFAULT */,
14975
+ id: ApprovalMode.DEFAULT,
14960
14976
  name: "Default",
14961
14977
  description: "Prompts for approval"
14962
14978
  },
14963
14979
  {
14964
- id: "autoEdit" /* AUTO_EDIT */,
14980
+ id: ApprovalMode.AUTO_EDIT,
14965
14981
  name: "Auto Edit",
14966
14982
  description: "Auto-approves edit tools"
14967
14983
  },
14968
14984
  {
14969
- id: "yolo" /* YOLO */,
14985
+ id: ApprovalMode.YOLO,
14970
14986
  name: "YOLO",
14971
14987
  description: "Auto-approves all tools"
14972
14988
  }
14973
14989
  ];
14974
14990
  if (isPlanEnabled) {
14975
14991
  modes.push({
14976
- id: "plan" /* PLAN */,
14992
+ id: ApprovalMode.PLAN,
14977
14993
  name: "Plan",
14978
14994
  description: "Read-only mode"
14979
14995
  });
@@ -14987,7 +15003,7 @@ function buildAvailableModels(config, settings) {
14987
15003
  const useLatestFlash = config.hasLatestFlashGAAccess?.() ?? false;
14988
15004
  const useLatestFlashLite = config.hasLatestFlashLiteGAAccess?.() ?? false;
14989
15005
  const selectedAuthType = settings.merged.security.auth.selectedType;
14990
- const useCustomToolModel = useGemini31 && selectedAuthType === "gemini-api-key" /* USE_GEMINI */;
15006
+ const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
14991
15007
  if (config.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
14992
15008
  const options = config.getModelConfigService().getAvailableModelOptions({
14993
15009
  useGemini3_1: useGemini31,
@@ -15074,11 +15090,11 @@ var Session = class {
15074
15090
  this.connection = connection;
15075
15091
  this.settings = settings;
15076
15092
  coreEvents.on(
15077
- "approval-mode-changed" /* ApprovalModeChanged */,
15093
+ CoreEvent.ApprovalModeChanged,
15078
15094
  this.handleApprovalModeChanged
15079
15095
  );
15080
15096
  this.context.config.getMessageBus()?.subscribe(
15081
- "tool-confirmation-request" /* TOOL_CONFIRMATION_REQUEST */,
15097
+ MessageBusType.TOOL_CONFIRMATION_REQUEST,
15082
15098
  this.handleToolConfirmationRequest,
15083
15099
  { signal: this.disposeController.signal }
15084
15100
  );
@@ -15102,7 +15118,7 @@ var Session = class {
15102
15118
  "Policy engine missing. Denying tool confirmation request."
15103
15119
  );
15104
15120
  await messageBus.publish({
15105
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
15121
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
15106
15122
  correlationId: request.correlationId,
15107
15123
  confirmed: false,
15108
15124
  requiresUserConfirmation: false
@@ -15115,7 +15131,7 @@ var Session = class {
15115
15131
  "Tool confirmation request missing tool name. Denying."
15116
15132
  );
15117
15133
  await messageBus.publish({
15118
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
15134
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
15119
15135
  correlationId: request.correlationId,
15120
15136
  confirmed: false,
15121
15137
  requiresUserConfirmation: false
@@ -15128,7 +15144,7 @@ var Session = class {
15128
15144
  `Tool confirmation request for unknown tool: ${toolName}. Denying.`
15129
15145
  );
15130
15146
  await messageBus.publish({
15131
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
15147
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
15132
15148
  correlationId: request.correlationId,
15133
15149
  confirmed: false,
15134
15150
  requiresUserConfirmation: false
@@ -15144,15 +15160,15 @@ var Session = class {
15144
15160
  request.subagent
15145
15161
  );
15146
15162
  await messageBus.publish({
15147
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
15163
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
15148
15164
  correlationId: request.correlationId,
15149
- confirmed: result.decision === "allow" /* ALLOW */,
15150
- requiresUserConfirmation: result.decision === "ask_user" /* ASK_USER */
15165
+ confirmed: result.decision === PolicyDecision.ALLOW,
15166
+ requiresUserConfirmation: result.decision === PolicyDecision.ASK_USER
15151
15167
  });
15152
15168
  } catch (error) {
15153
15169
  debugLogger.error("Error handling tool confirmation request:", error);
15154
15170
  await this.context.config.getMessageBus()?.publish({
15155
- type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
15171
+ type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
15156
15172
  correlationId: request.correlationId,
15157
15173
  confirmed: false,
15158
15174
  requiresUserConfirmation: false
@@ -15172,7 +15188,7 @@ var Session = class {
15172
15188
  };
15173
15189
  async dispose() {
15174
15190
  coreEvents.off(
15175
- "approval-mode-changed" /* ApprovalModeChanged */,
15191
+ CoreEvent.ApprovalModeChanged,
15176
15192
  this.handleApprovalModeChanged
15177
15193
  );
15178
15194
  this.disposeController.abort();
@@ -15268,7 +15284,7 @@ ${thought.description}`;
15268
15284
  await this.sendUpdate({
15269
15285
  sessionUpdate: "tool_call",
15270
15286
  toolCallId: toolCall.id,
15271
- status: toolCall.status === "success" /* Success */ ? "completed" : "failed",
15287
+ status: toolCall.status === CoreToolCallStatus.Success ? "completed" : "failed",
15272
15288
  title: toolCall.displayName || toolCall.name,
15273
15289
  content: toolCallContent,
15274
15290
  kind: tool ? toAcpToolKind(tool.kind) : "other"
@@ -15377,7 +15393,7 @@ ${thought.description}`;
15377
15393
  return { stopReason: "cancelled" };
15378
15394
  }
15379
15395
  switch (event.type) {
15380
- case "content" /* Content */: {
15396
+ case GeminiEventType.Content: {
15381
15397
  const content = {
15382
15398
  type: "text",
15383
15399
  text: event.value
@@ -15388,7 +15404,7 @@ ${thought.description}`;
15388
15404
  });
15389
15405
  break;
15390
15406
  }
15391
- case "thought" /* Thought */: {
15407
+ case GeminiEventType.Thought: {
15392
15408
  const thoughtText = `**${event.value.subject}**
15393
15409
  ${event.value.description}`;
15394
15410
  await this.sendUpdate({
@@ -15397,10 +15413,10 @@ ${event.value.description}`;
15397
15413
  });
15398
15414
  break;
15399
15415
  }
15400
- case "tool_call_request" /* ToolCallRequest */:
15416
+ case GeminiEventType.ToolCallRequest:
15401
15417
  toolCallRequests.push(event.value);
15402
15418
  break;
15403
- case "finished" /* Finished */: {
15419
+ case GeminiEventType.Finished: {
15404
15420
  const usage2 = event.value.usageMetadata;
15405
15421
  if (usage2) {
15406
15422
  turnInputTokens = usage2.promptTokenCount ?? turnInputTokens;
@@ -15417,19 +15433,19 @@ ${event.value.description}`;
15417
15433
  }
15418
15434
  break;
15419
15435
  }
15420
- case "model_info" /* ModelInfo */:
15436
+ case GeminiEventType.ModelInfo:
15421
15437
  turnModelId = event.value;
15422
15438
  break;
15423
- case "max_session_turns" /* MaxSessionTurns */:
15439
+ case GeminiEventType.MaxSessionTurns:
15424
15440
  stopReason = "max_turn_requests";
15425
15441
  break;
15426
- case "loop_detected" /* LoopDetected */:
15442
+ case GeminiEventType.LoopDetected:
15427
15443
  stopReason = "max_turn_requests";
15428
15444
  break;
15429
- case "context_window_will_overflow" /* ContextWindowWillOverflow */:
15445
+ case GeminiEventType.ContextWindowWillOverflow:
15430
15446
  stopReason = "max_tokens";
15431
15447
  break;
15432
- case "error" /* Error */: {
15448
+ case GeminiEventType.Error: {
15433
15449
  const parseResult = StructuredErrorSchema.safeParse(
15434
15450
  event.value.error
15435
15451
  );
@@ -15610,7 +15626,7 @@ ${event.value.description}`;
15610
15626
  const output = RequestPermissionResponseSchema.parse(
15611
15627
  await this.connection.requestPermission(params)
15612
15628
  );
15613
- const outcome = output.outcome.outcome === "cancelled" ? "cancel" /* Cancel */ : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
15629
+ const outcome = output.outcome.outcome === "cancelled" ? ToolConfirmationOutcome.Cancel : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
15614
15630
  await confirmationDetails.onConfirm(outcome);
15615
15631
  await updatePolicy(
15616
15632
  tool,
@@ -15621,7 +15637,7 @@ ${event.value.description}`;
15621
15637
  invocation
15622
15638
  );
15623
15639
  switch (outcome) {
15624
- case "cancel" /* Cancel */: {
15640
+ case ToolConfirmationOutcome.Cancel: {
15625
15641
  const cancelError = new Error(
15626
15642
  `Tool "${fc.name}" was canceled by the user.`
15627
15643
  );
@@ -15639,12 +15655,12 @@ ${event.value.description}`;
15639
15655
  });
15640
15656
  return errorResponse(cancelError);
15641
15657
  }
15642
- case "proceed_once" /* ProceedOnce */:
15643
- case "proceed_always" /* ProceedAlways */:
15644
- case "proceed_always_and_save" /* ProceedAlwaysAndSave */:
15645
- case "proceed_always_server" /* ProceedAlwaysServer */:
15646
- case "proceed_always_tool" /* ProceedAlwaysTool */:
15647
- case "modify_with_editor" /* ModifyWithEditor */:
15658
+ case ToolConfirmationOutcome.ProceedOnce:
15659
+ case ToolConfirmationOutcome.ProceedAlways:
15660
+ case ToolConfirmationOutcome.ProceedAlwaysAndSave:
15661
+ case ToolConfirmationOutcome.ProceedAlwaysServer:
15662
+ case ToolConfirmationOutcome.ProceedAlwaysTool:
15663
+ case ToolConfirmationOutcome.ModifyWithEditor:
15648
15664
  break;
15649
15665
  default: {
15650
15666
  const resultOutcome = outcome;
@@ -15698,7 +15714,7 @@ ${event.value.description}`;
15698
15714
  );
15699
15715
  this.chat.recordCompletedToolCalls(this.context.config.getActiveModel(), [
15700
15716
  {
15701
- status: "success" /* Success */,
15717
+ status: CoreToolCallStatus.Success,
15702
15718
  request: {
15703
15719
  callId,
15704
15720
  name: fc.name,
@@ -15743,7 +15759,7 @@ ${event.value.description}`;
15743
15759
  });
15744
15760
  this.chat.recordCompletedToolCalls(this.context.config.getActiveModel(), [
15745
15761
  {
15746
- status: "error" /* Error */,
15762
+ status: CoreToolCallStatus.Error,
15747
15763
  request: {
15748
15764
  callId,
15749
15765
  name: fc.name,
@@ -15871,12 +15887,12 @@ ${event.value.description}`;
15871
15887
  sessionId: this.id,
15872
15888
  options: [
15873
15889
  {
15874
- optionId: "proceed_once" /* ProceedOnce */,
15890
+ optionId: ToolConfirmationOutcome.ProceedOnce,
15875
15891
  name: "Allow once",
15876
15892
  kind: "allow_once"
15877
15893
  },
15878
15894
  {
15879
- optionId: "cancel" /* Cancel */,
15895
+ optionId: ToolConfirmationOutcome.Cancel,
15880
15896
  name: "Deny",
15881
15897
  kind: "reject_once"
15882
15898
  }
@@ -15901,8 +15917,8 @@ ${event.value.description}`;
15901
15917
  const output = RequestPermissionResponseSchema.parse(
15902
15918
  await this.connection.requestPermission(params)
15903
15919
  );
15904
- const outcome = output.outcome.outcome === "cancelled" ? "cancel" /* Cancel */ : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
15905
- if (outcome === "proceed_once" /* ProceedOnce */) {
15920
+ const outcome = output.outcome.outcome === "cancelled" ? ToolConfirmationOutcome.Cancel : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
15921
+ if (outcome === ToolConfirmationOutcome.ProceedOnce) {
15906
15922
  this.context.config.getWorkspaceContext().addReadOnlyPath(absolutePath);
15907
15923
  validationError = null;
15908
15924
  } else {
@@ -16347,7 +16363,7 @@ var AcpSessionManager = class {
16347
16363
  mcpServers,
16348
16364
  loadedSettings
16349
16365
  );
16350
- const authType = loadedSettings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ? "gateway" /* GATEWAY */ : "gemini-api-key" /* USE_GEMINI */);
16366
+ const authType = loadedSettings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ? AuthType.GATEWAY : AuthType.USE_GEMINI);
16351
16367
  let isAuthenticated = false;
16352
16368
  let authErrorMessage = "";
16353
16369
  try {
@@ -16359,7 +16375,7 @@ var AcpSessionManager = class {
16359
16375
  );
16360
16376
  isAuthenticated = true;
16361
16377
  const contentGeneratorConfig = config.getContentGeneratorConfig();
16362
- if (authType === "gemini-api-key" /* USE_GEMINI */ && (!contentGeneratorConfig || !contentGeneratorConfig.apiKey)) {
16378
+ if (authType === AuthType.USE_GEMINI && (!contentGeneratorConfig || !contentGeneratorConfig.apiKey)) {
16363
16379
  isAuthenticated = false;
16364
16380
  authErrorMessage = "Gemini API key is missing or not configured.";
16365
16381
  }
@@ -16543,7 +16559,7 @@ var AcpSessionManager = class {
16543
16559
  }
16544
16560
  }
16545
16561
  async prepareSessionConfig(sessionId, cwd, mcpServers, authDetails) {
16546
- const selectedAuthType = this.settings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ? "gateway" /* GATEWAY */ : void 0);
16562
+ const selectedAuthType = this.settings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ? AuthType.GATEWAY : void 0);
16547
16563
  if (!selectedAuthType) {
16548
16564
  throw RequestError.authRequired();
16549
16565
  }
@@ -16655,12 +16671,12 @@ var GeminiAgent = class {
16655
16671
  }
16656
16672
  const authMethods = [
16657
16673
  {
16658
- id: "oauth-personal" /* LOGIN_WITH_GOOGLE */,
16674
+ id: AuthType.LOGIN_WITH_GOOGLE,
16659
16675
  name: "Log in with Google",
16660
16676
  description: "Log in with your Google account"
16661
16677
  },
16662
16678
  {
16663
- id: "gemini-api-key" /* USE_GEMINI */,
16679
+ id: AuthType.USE_GEMINI,
16664
16680
  name: "Gemini API key",
16665
16681
  description: "Use an API key with Gemini Developer API",
16666
16682
  _meta: {
@@ -16670,12 +16686,12 @@ var GeminiAgent = class {
16670
16686
  }
16671
16687
  },
16672
16688
  {
16673
- id: "vertex-ai" /* USE_VERTEX_AI */,
16689
+ id: AuthType.USE_VERTEX_AI,
16674
16690
  name: "Vertex AI",
16675
16691
  description: "Use an API key with Vertex AI GenAI API"
16676
16692
  },
16677
16693
  {
16678
- id: "gateway" /* GATEWAY */,
16694
+ id: AuthType.GATEWAY,
16679
16695
  name: "AI API Gateway",
16680
16696
  description: "Use a custom AI API Gateway",
16681
16697
  _meta: {
@@ -16848,7 +16864,7 @@ async function validateNonInteractiveAuth(configuredAuthType, useExternalAuth, n
16848
16864
  }
16849
16865
  return authType;
16850
16866
  } catch (error) {
16851
- if (nonInteractiveConfig.getOutputFormat() === "json" /* JSON */) {
16867
+ if (nonInteractiveConfig.getOutputFormat() === OutputFormat.JSON) {
16852
16868
  handleError(
16853
16869
  error instanceof Error ? error : new Error(String(error)),
16854
16870
  nonInteractiveConfig,
@@ -17043,10 +17059,10 @@ var SlashCommandConflictHandler = class {
17043
17059
  this.handleConflicts = this.handleConflicts.bind(this);
17044
17060
  }
17045
17061
  start() {
17046
- coreEvents.on("slash-command-conflicts" /* SlashCommandConflicts */, this.handleConflicts);
17062
+ coreEvents.on(CoreEvent.SlashCommandConflicts, this.handleConflicts);
17047
17063
  }
17048
17064
  stop() {
17049
- coreEvents.off("slash-command-conflicts" /* SlashCommandConflicts */, this.handleConflicts);
17065
+ coreEvents.off(CoreEvent.SlashCommandConflicts, this.handleConflicts);
17050
17066
  if (this.flushTimeout) {
17051
17067
  clearTimeout(this.flushTimeout);
17052
17068
  this.flushTimeout = null;
@@ -17402,7 +17418,7 @@ async function resolveSessionId(resumeArg, sessionIdArg, sessionFileArg) {
17402
17418
  }
17403
17419
  }
17404
17420
  async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
17405
- const { startInteractiveUI: doStartUI } = await import("./interactiveCli-3I4TG5SK.js");
17421
+ const { startInteractiveUI: doStartUI } = await import("./interactiveCli-QXZXFSNY.js");
17406
17422
  await doStartUI(
17407
17423
  config,
17408
17424
  settings,
@@ -17505,12 +17521,12 @@ async function main() {
17505
17521
  dns.setDefaultResultOrder(
17506
17522
  validateDnsResolutionOrder(settings.merged.advanced.dnsResolutionOrder)
17507
17523
  );
17508
- if (!settings.merged.security.auth.selectedType || settings.merged.security.auth.selectedType === "cloud-shell" /* LEGACY_CLOUD_SHELL */) {
17524
+ if (!settings.merged.security.auth.selectedType || settings.merged.security.auth.selectedType === AuthType.LEGACY_CLOUD_SHELL) {
17509
17525
  if (process.env["CLOUD_SHELL"] === "true" || process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true") {
17510
17526
  settings.setValue(
17511
17527
  "User" /* User */,
17512
17528
  "security.auth.selectedType",
17513
- "compute-default-credentials" /* COMPUTE_ADC */
17529
+ AuthType.COMPUTE_ADC
17514
17530
  );
17515
17531
  }
17516
17532
  }
@@ -17611,7 +17627,7 @@ ${finalArgs[promptIndex + 1]}`;
17611
17627
  await config.storage.initialize();
17612
17628
  adminControlsListner.setConfig(config);
17613
17629
  if (config.isInteractive() && settings.merged.general.devtools) {
17614
- const { setupInitialActivityLogger } = await import("./devtoolsService-3SADPKKB.js");
17630
+ const { setupInitialActivityLogger } = await import("./devtoolsService-DCRIOTR4.js");
17615
17631
  setupInitialActivityLogger(config);
17616
17632
  }
17617
17633
  registerTelemetryConfig(config);
@@ -17619,7 +17635,7 @@ ${finalArgs[promptIndex + 1]}`;
17619
17635
  const messageBus = config.getMessageBus();
17620
17636
  createPolicyUpdater2(policyEngine, messageBus, config.storage);
17621
17637
  registerCleanup(async () => {
17622
- await config?.getHookSystem()?.fireSessionEndEvent("exit" /* Exit */);
17638
+ await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
17623
17639
  });
17624
17640
  if (!config.getAcpMode()) {
17625
17641
  registerCleanup(consolePatcher.cleanup);
@@ -17670,7 +17686,7 @@ ${finalArgs[promptIndex + 1]}`;
17670
17686
  const initAppHandle = startupProfiler.start("initialize_app");
17671
17687
  const initializationResult = await initializeApp(config, settings);
17672
17688
  initAppHandle?.end();
17673
- import("./liteRtServerManager-4MWCEVVM.js").then(({ LiteRtServerManager }) => {
17689
+ import("./liteRtServerManager-T3MOB7VG.js").then(({ LiteRtServerManager }) => {
17674
17690
  const mergedGemma = settings.merged.experimental?.gemmaModelRouter;
17675
17691
  if (!mergedGemma) return;
17676
17692
  const userGemma = settings.forScope("User" /* User */).settings.experimental?.gemmaModelRouter;
@@ -17680,7 +17696,7 @@ ${finalArgs[promptIndex + 1]}`;
17680
17696
  autoStartServer: userGemma?.autoStartServer
17681
17697
  });
17682
17698
  }).catch((e) => debugLogger.warn("LiteRT auto-start import failed:", e));
17683
- if (settings.merged.security.auth.selectedType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
17699
+ if (settings.merged.security.auth.selectedType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
17684
17700
  await getOauthClient(settings.merged.security.auth.selectedType, config);
17685
17701
  }
17686
17702
  if (config.getAcpMode()) {
@@ -17696,7 +17712,7 @@ ${finalArgs[promptIndex + 1]}`;
17696
17712
  ...rawStartupWarnings.map((message) => ({
17697
17713
  id: `startup-${createHash2("sha256").update(message).digest("hex").substring(0, 16)}`,
17698
17714
  message,
17699
- priority: "high" /* High */
17715
+ priority: WarningPriority.High
17700
17716
  })),
17701
17717
  ...await getUserStartupWarnings(settings.merged, void 0, {
17702
17718
  isAlternateBuffer: useAlternateBuffer
@@ -17733,7 +17749,7 @@ ${finalArgs[promptIndex + 1]}`;
17733
17749
  ${input}` : stdinData;
17734
17750
  }
17735
17751
  }
17736
- const sessionStartSource = resumedSessionData ? "resume" /* Resume */ : "startup" /* Startup */;
17752
+ const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
17737
17753
  const hookSystem = config?.getHookSystem();
17738
17754
  if (hookSystem) {
17739
17755
  const result = await hookSystem.fireSessionStartEvent(sessionStartSource);
@@ -17790,8 +17806,8 @@ ${input}` : wrappedContext;
17790
17806
  }
17791
17807
  }
17792
17808
  function initializeOutputListenersAndFlush(config) {
17793
- if (coreEvents.listenerCount("output" /* Output */) === 0) {
17794
- coreEvents.on("output" /* Output */, (payload) => {
17809
+ if (coreEvents.listenerCount(CoreEvent.Output) === 0) {
17810
+ coreEvents.on(CoreEvent.Output, (payload) => {
17795
17811
  if (payload.isStderr) {
17796
17812
  writeToStderr(payload.chunk, payload.encoding);
17797
17813
  } else {
@@ -17799,8 +17815,8 @@ function initializeOutputListenersAndFlush(config) {
17799
17815
  }
17800
17816
  });
17801
17817
  }
17802
- if (coreEvents.listenerCount("console-log" /* ConsoleLog */) === 0) {
17803
- coreEvents.on("console-log" /* ConsoleLog */, (payload) => {
17818
+ if (coreEvents.listenerCount(CoreEvent.ConsoleLog) === 0) {
17819
+ coreEvents.on(CoreEvent.ConsoleLog, (payload) => {
17804
17820
  if (payload.type === "error" || payload.type === "warn") {
17805
17821
  writeToStderr(payload.content + "\n");
17806
17822
  } else {
@@ -17808,8 +17824,8 @@ function initializeOutputListenersAndFlush(config) {
17808
17824
  }
17809
17825
  });
17810
17826
  }
17811
- if (coreEvents.listenerCount("user-feedback" /* UserFeedback */) === 0) {
17812
- coreEvents.on("user-feedback" /* UserFeedback */, (payload) => {
17827
+ if (coreEvents.listenerCount(CoreEvent.UserFeedback) === 0) {
17828
+ coreEvents.on(CoreEvent.UserFeedback, (payload) => {
17813
17829
  writeToStderr(payload.message + "\n");
17814
17830
  });
17815
17831
  }
@@ -17817,7 +17833,7 @@ function initializeOutputListenersAndFlush(config) {
17817
17833
  const forceToStderr = outputFormat === "json";
17818
17834
  coreEvents.drainBacklogs(
17819
17835
  (event, args) => {
17820
- if (forceToStderr && event === "output" /* Output */) {
17836
+ if (forceToStderr && event === CoreEvent.Output) {
17821
17837
  const payload = args[0];
17822
17838
  if (!payload.isStderr) {
17823
17839
  return {