@google/gemini-cli 0.71.0-nightly.20261124.gaafdfdfb5 → 0.71.0

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 (76) hide show
  1. package/bundle/{chunk-YFNHROPZ.js → chunk-226R5C3B.js} +7 -40
  2. package/bundle/{chunk-AGSD6TCG.js → chunk-7CKWIN5G.js} +7 -7
  3. package/bundle/{chunk-DRIECEHM.js → chunk-AXBBOMHQ.js} +1 -1
  4. package/bundle/{chunk-VCGPM2FI.js → chunk-AYSLHXA4.js} +5 -12
  5. package/bundle/{chunk-S77ELOW4.js → chunk-DYLFWJSS.js} +1 -1
  6. package/bundle/{chunk-OKOAEJ5I.js → chunk-EKWALRKF.js} +15418 -8096
  7. package/bundle/{chunk-AJWHZBWZ.js → chunk-HF6ORJX7.js} +5 -12
  8. package/bundle/{chunk-OR77J7SA.js → chunk-HMO6GZYF.js} +9 -18
  9. package/bundle/{chunk-HTEFFFDQ.js → chunk-I7BKOSH3.js} +1 -1
  10. package/bundle/{chunk-WHSJKDVL.js → chunk-IWQOZRAT.js} +1 -1
  11. package/bundle/{chunk-YA4BFII4.js → chunk-JLAW7BA6.js} +1 -1
  12. package/bundle/{chunk-3HVCGWLE.js → chunk-JT7GL77Z.js} +1 -1
  13. package/bundle/{chunk-BZ5FSDRR.js → chunk-K767QEGB.js} +3 -3
  14. package/bundle/{chunk-3DMQRTF3.js → chunk-KYHTL3DC.js} +2 -2
  15. package/bundle/{chunk-MZIBUEBF.js → chunk-NFKOBXZH.js} +3 -3
  16. package/bundle/{chunk-DIMNI6AC.js → chunk-NNVHJBJY.js} +2 -2
  17. package/bundle/{chunk-JTWV2RYT.js → chunk-NVQIJ42N.js} +1 -1
  18. package/bundle/{chunk-UYXW53A5.js → chunk-QCSQIXGM.js} +8 -9
  19. package/bundle/{chunk-OT5HDWN7.js → chunk-SENWXNTO.js} +2 -2
  20. package/bundle/{chunk-XER4IQTC.js → chunk-SJAGJ77Z.js} +1 -1
  21. package/bundle/{chunk-TLQ4STKV.js → chunk-SLGLHOV2.js} +7 -7
  22. package/bundle/{chunk-SJKJH5QA.js → chunk-SXKZW3JE.js} +1 -1
  23. package/bundle/{chunk-HUJ3STFG.js → chunk-TB7QMWM2.js} +3 -3
  24. package/bundle/{chunk-CXCKAA7X.js → chunk-TRYE6AUM.js} +7 -35
  25. package/bundle/{chunk-T3JZW5UQ.js → chunk-WHN36NNK.js} +58 -71
  26. package/bundle/{chunk-IRVNAGCT.js → chunk-ZVHUCZP3.js} +1 -1
  27. package/bundle/{chunk-3HYEMESH.js → chunk-ZZJKFKG7.js} +1 -1
  28. package/bundle/{cleanup-A7CTJL7Z.js → cleanup-35H7WFOM.js} +2 -2
  29. package/bundle/{cleanup-HZHRK5GO.js → cleanup-HF6T3GQ6.js} +2 -2
  30. package/bundle/{cleanup-QWGDJK3S.js → cleanup-XECNNSOD.js} +2 -2
  31. package/bundle/{core-UF6OK2YN.js → core-74O6JBFD.js} +1 -1
  32. package/bundle/{dist-3B3LPZX5.js → core-PNHLJ262.js} +1 -1
  33. package/bundle/{devtoolsService-Q4IBIWY4.js → devtoolsService-43KC32ZN.js} +2 -2
  34. package/bundle/{devtoolsService-Q5HYPUU7.js → devtoolsService-E2R3RE2K.js} +2 -2
  35. package/bundle/{devtoolsService-XNGB5DAQ.js → devtoolsService-Y7BMPXKB.js} +3 -4
  36. package/bundle/{dist-O2WNU5JL.js → dist-PS73JTWM.js} +1 -1
  37. package/bundle/docs/changelogs/index.md +0 -23
  38. package/bundle/docs/changelogs/latest.md +110 -78
  39. package/bundle/{formatError-EPXVZRF4.js → formatError-6GUCXQAC.js} +2 -2
  40. package/bundle/{formatError-RZ6FNHFK.js → formatError-NEW4YLDY.js} +2 -2
  41. package/bundle/{formatError-XWW6LQFY.js → formatError-ZZYUJD6F.js} +2 -2
  42. package/bundle/{gemini-DQYZ2M5M.js → gemini-2HTL6LHD.js} +17 -18
  43. package/bundle/{gemini-ADD3CNLQ.js → gemini-CUUSRGL5.js} +17 -18
  44. package/bundle/{gemini-F4BYOGFK.js → gemini-LRATVZEI.js} +210 -227
  45. package/bundle/gemini.js +8 -8
  46. package/bundle/{interactiveCli-DBUWQW3L.js → interactiveCli-BTNJSUQE.js} +8 -8
  47. package/bundle/{interactiveCli-WR3WORG7.js → interactiveCli-EI6DXDED.js} +8 -8
  48. package/bundle/{interactiveCli-NVUAURHX.js → interactiveCli-NJEZNU22.js} +300 -319
  49. package/bundle/{liteRtServerManager-7JMYMQOE.js → liteRtServerManager-3ASA64JU.js} +4 -4
  50. package/bundle/{liteRtServerManager-BEHQ2LRW.js → liteRtServerManager-YWW2KXDB.js} +4 -4
  51. package/bundle/{liteRtServerManager-D247SBY4.js → liteRtServerManager-ZVBNBHNG.js} +4 -4
  52. package/bundle/{oauth2-provider-2JRAM5FI.js → oauth2-provider-2E2SN4NL.js} +1 -1
  53. package/bundle/{oauth2-provider-RAQB4WZV.js → oauth2-provider-CNHAHID7.js} +1 -1
  54. package/bundle/{oauth2-provider-2RZGLMFW.js → oauth2-provider-Y4FLXHNF.js} +79 -41
  55. package/bundle/{start-2XM3XTTW.js → start-3UMKH57P.js} +6 -6
  56. package/bundle/{start-4BURN4I2.js → start-I5FBIWR2.js} +6 -6
  57. package/bundle/{start-HKOWOXAN.js → start-PEGW57CI.js} +6 -6
  58. package/package.json +1 -1
  59. package/bundle/chunk-6GP7SK3F.js +0 -1571
  60. package/bundle/chunk-ME7E2KHV.js +0 -65
  61. package/bundle/chunk-MWO4GVYF.js +0 -190
  62. package/bundle/chunk-SXB2352W.js +0 -1962
  63. package/bundle/chunk-SZHRRWXK.js +0 -40031
  64. package/bundle/chunk-TIBJCQPU.js +0 -420386
  65. package/bundle/chunk-WS2FFQOK.js +0 -512
  66. package/bundle/chunk-XY4WHKUF.js +0 -118
  67. package/bundle/chunk-Y52IZU6D.js +0 -60338
  68. package/bundle/cleanup-ZAAJYUK2.js +0 -34
  69. package/bundle/devtoolsService-XIWA55RM.js +0 -919
  70. package/bundle/dist-QEVE76NU.js +0 -2372
  71. package/bundle/formatError-YLQB5WCI.js +0 -14
  72. package/bundle/gemini-M5L5KDE3.js +0 -20021
  73. package/bundle/interactiveCli-UUF5EPF5.js +0 -36447
  74. package/bundle/liteRtServerManager-TW3MMGOA.js +0 -65
  75. package/bundle/oauth2-provider-4UDPSMA6.js +0 -273
  76. package/bundle/start-KCXHIBOT.js +0 -18
@@ -2,10 +2,10 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  startCommand,
4
4
  startServer
5
- } from "./chunk-HUJ3STFG.js";
5
+ } from "./chunk-K767QEGB.js";
6
6
  import {
7
7
  formatCliError
8
- } from "./chunk-S77ELOW4.js";
8
+ } from "./chunk-SJAGJ77Z.js";
9
9
  import {
10
10
  BuiltinCommandLoader,
11
11
  CommandService,
@@ -49,11 +49,11 @@ import {
49
49
  updateExtension,
50
50
  validateAuthMethod,
51
51
  validateContextFilePath
52
- } from "./chunk-Y52IZU6D.js";
52
+ } from "./chunk-SLGLHOV2.js";
53
53
  import {
54
54
  exitCli,
55
55
  require_source
56
- } from "./chunk-HTEFFFDQ.js";
56
+ } from "./chunk-ZZJKFKG7.js";
57
57
  import {
58
58
  appEvents
59
59
  } from "./chunk-5PS3AYFU.js";
@@ -93,13 +93,13 @@ import {
93
93
  saveModelChange,
94
94
  setAmbiguousCharactersWide,
95
95
  stripAnsi
96
- } from "./chunk-SZHRRWXK.js";
96
+ } from "./chunk-HF6ORJX7.js";
97
97
  import {
98
98
  RELAUNCH_EXIT_CODE,
99
99
  isIPCAvailable,
100
100
  require_semver
101
- } from "./chunk-3DMQRTF3.js";
102
- import "./chunk-UYXW53A5.js";
101
+ } from "./chunk-SENWXNTO.js";
102
+ import "./chunk-NVQIJ42N.js";
103
103
  import {
104
104
  cleanupCheckpoints,
105
105
  registerCleanup,
@@ -108,18 +108,15 @@ import {
108
108
  runExitCleanup,
109
109
  runSyncCleanup,
110
110
  setupSignalHandlers
111
- } from "./chunk-MWO4GVYF.js";
111
+ } from "./chunk-ZVHUCZP3.js";
112
112
  import {
113
113
  ASK_USER_TOOL_NAME,
114
114
  AjvJsonSchemaValidator,
115
- ApprovalMode,
116
115
  AuthType,
117
116
  CallToolRequestSchema,
118
117
  CallToolResultSchema,
119
118
  Client,
120
119
  Config,
121
- CoreEvent,
122
- CoreToolCallStatus,
123
120
  CreateMessageResultSchema,
124
121
  CreateMessageResultWithToolsSchema,
125
122
  CreateTaskResultSchema,
@@ -150,7 +147,6 @@ import {
150
147
  GEMINI_CLI_NESTED_SESSION_ENV_VAR,
151
148
  GEMINI_DIR,
152
149
  GEMINI_MODEL_ALIAS_AUTO,
153
- GeminiEventType,
154
150
  IdeClient,
155
151
  IdeContextNotificationSchema,
156
152
  IdeDiffAcceptedNotificationSchema,
@@ -158,11 +154,8 @@ import {
158
154
  IdeDiffRejectedNotificationSchema,
159
155
  InitializeRequestSchema,
160
156
  InitializedNotificationSchema,
161
- IntegrityStatus,
162
157
  InvalidStreamError,
163
158
  JsonFormatter,
164
- JsonStreamEventType,
165
- Kind,
166
159
  LATEST_PROTOCOL_VERSION,
167
160
  LegacyAgentSession,
168
161
  ListRootsResultSchema,
@@ -171,18 +164,14 @@ import {
171
164
  LoggingLevelSchema,
172
165
  MAX_TOKENS_EXCEEDED_SUGGESTION,
173
166
  MCPServerConfig,
174
- MCPServerStatus,
175
167
  McpError,
176
- MessageBusType,
177
168
  NESTED_INTERACTIVE_SESSION_ERROR,
178
169
  OTHER_BLOCKED_MESSAGE,
179
- OutputFormat,
180
170
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
181
171
  PREVIEW_GEMINI_3_1_MODEL,
182
172
  PREVIEW_GEMINI_FLASH_LITE_MODEL,
183
173
  PREVIEW_GEMINI_FLASH_MODEL,
184
174
  PREVIEW_GEMINI_MODEL,
185
- PolicyDecision,
186
175
  PolicyIntegrityManager,
187
176
  Protocol,
188
177
  RECITATION_BLOCKED_MESSAGE,
@@ -193,8 +182,6 @@ import {
193
182
  SAFETY_BLOCKED_MESSAGE,
194
183
  SUPPORTED_PROTOCOL_VERSIONS,
195
184
  Scheduler,
196
- SessionEndReason,
197
- SessionStartSource,
198
185
  SetLevelRequestSchema,
199
186
  ShellExecutionService,
200
187
  SimpleExtensionLoader,
@@ -205,13 +192,10 @@ import {
205
192
  TRUE_EMPTY_RESPONSE_MESSAGE,
206
193
  ToolCallEvent,
207
194
  ToolConfirmationOutcome,
208
- ToolErrorType,
209
- TrustLevel,
210
195
  UserAccountManager,
211
196
  UserPromptEvent,
212
197
  ValidationCancelledError,
213
198
  ValidationRequiredError,
214
- WarningPriority,
215
199
  applyAdminAllowlist,
216
200
  applyRequiredServers,
217
201
  assertClientRequestTaskCapability,
@@ -306,7 +290,7 @@ import {
306
290
  updatePolicy,
307
291
  writeToStderr,
308
292
  writeToStdout
309
- } from "./chunk-OKOAEJ5I.js";
293
+ } from "./chunk-226R5C3B.js";
310
294
  import "./chunk-W2AJR23G.js";
311
295
  import "./chunk-N7J54YNL.js";
312
296
  import "./chunk-L6PII3GR.js";
@@ -5455,7 +5439,7 @@ var MCP_LIST_DEFAULT_TIMEOUT_MSEC = 5e3;
5455
5439
  async function testMCPConnection(serverName, config, isTrusted, activeSettings) {
5456
5440
  const isStdio = !!config.command;
5457
5441
  if (isStdio && !isTrusted) {
5458
- return MCPServerStatus.DISCONNECTED;
5442
+ return "disconnected" /* DISCONNECTED */;
5459
5443
  }
5460
5444
  const client = new Client({
5461
5445
  name: "mcp-test-client",
@@ -5491,7 +5475,7 @@ async function testMCPConnection(serverName, config, isTrusted, activeSettings)
5491
5475
  transport = await createTransport(serverName, config, false, mcpContext);
5492
5476
  } catch {
5493
5477
  await client.close();
5494
- return MCPServerStatus.DISCONNECTED;
5478
+ return "disconnected" /* DISCONNECTED */;
5495
5479
  }
5496
5480
  try {
5497
5481
  const timeout = config.timeout ?? MCP_LIST_DEFAULT_TIMEOUT_MSEC;
@@ -5505,10 +5489,10 @@ async function testMCPConnection(serverName, config, isTrusted, activeSettings)
5505
5489
  );
5506
5490
  }
5507
5491
  await client.close();
5508
- return MCPServerStatus.CONNECTED;
5492
+ return "connected" /* CONNECTED */;
5509
5493
  } catch {
5510
5494
  await transport.close();
5511
- return MCPServerStatus.DISCONNECTED;
5495
+ return "disconnected" /* DISCONNECTED */;
5512
5496
  }
5513
5497
  }
5514
5498
  async function getServerStatus(serverName, server, isTrusted, activeSettings, consolidatedExcluded, consolidatedAllowed) {
@@ -5521,12 +5505,12 @@ async function getServerStatus(serverName, server, isTrusted, activeSettings, co
5521
5505
  });
5522
5506
  if (!loadResult.allowed) {
5523
5507
  if (loadResult.blockType === "admin" || loadResult.blockType === "allowlist" || loadResult.blockType === "excludelist") {
5524
- return MCPServerStatus.BLOCKED;
5508
+ return "blocked" /* BLOCKED */;
5525
5509
  }
5526
- return MCPServerStatus.DISABLED;
5510
+ return "disabled" /* DISABLED */;
5527
5511
  }
5528
5512
  if (!isTrusted) {
5529
- return MCPServerStatus.DISABLED;
5513
+ return "disabled" /* DISABLED */;
5530
5514
  }
5531
5515
  return testMCPConnection(serverName, server, isTrusted, activeSettings);
5532
5516
  }
@@ -5572,23 +5556,23 @@ async function listMcpServers(loadedSettingsArg) {
5572
5556
  let statusIndicator = "";
5573
5557
  let statusText = "";
5574
5558
  switch (status) {
5575
- case MCPServerStatus.CONNECTED:
5559
+ case "connected" /* CONNECTED */:
5576
5560
  statusIndicator = import_chalk.default.green("\u2713");
5577
5561
  statusText = "Connected";
5578
5562
  break;
5579
- case MCPServerStatus.CONNECTING:
5563
+ case "connecting" /* CONNECTING */:
5580
5564
  statusIndicator = import_chalk.default.yellow("\u2026");
5581
5565
  statusText = "Connecting";
5582
5566
  break;
5583
- case MCPServerStatus.BLOCKED:
5567
+ case "blocked" /* BLOCKED */:
5584
5568
  statusIndicator = import_chalk.default.red("\u26D4");
5585
5569
  statusText = "Blocked";
5586
5570
  break;
5587
- case MCPServerStatus.DISABLED:
5571
+ case "disabled" /* DISABLED */:
5588
5572
  statusIndicator = import_chalk.default.gray("\u25CB");
5589
5573
  statusText = "Disabled";
5590
5574
  break;
5591
- case MCPServerStatus.DISCONNECTED:
5575
+ case "disconnected" /* DISCONNECTED */:
5592
5576
  default:
5593
5577
  statusIndicator = import_chalk.default.red("\u2717");
5594
5578
  statusText = "Disconnected";
@@ -5874,7 +5858,7 @@ async function handleInstall(args) {
5874
5858
  );
5875
5859
  if (confirmed) {
5876
5860
  const trustedFolders = loadTrustedFolders();
5877
- await trustedFolders.setValue(realPath, TrustLevel.TRUST_FOLDER);
5861
+ await trustedFolders.setValue(realPath, "TRUST_FOLDER" /* TRUST_FOLDER */);
5878
5862
  } else {
5879
5863
  throw new Error(
5880
5864
  `Installation aborted: Folder "${absolutePath}" is not trusted.`
@@ -7973,12 +7957,12 @@ function toToolCallContent(toolResult) {
7973
7957
  }
7974
7958
  var basicPermissionOptions = [
7975
7959
  {
7976
- optionId: ToolConfirmationOutcome.ProceedOnce,
7960
+ optionId: "proceed_once" /* ProceedOnce */,
7977
7961
  name: "Allow",
7978
7962
  kind: "allow_once"
7979
7963
  },
7980
7964
  {
7981
- optionId: ToolConfirmationOutcome.Cancel,
7965
+ optionId: "cancel" /* Cancel */,
7982
7966
  name: "Reject",
7983
7967
  kind: "reject_once"
7984
7968
  }
@@ -7990,13 +7974,13 @@ function toPermissionOptions(confirmation, config, enablePermanentToolApproval =
7990
7974
  switch (confirmation.type) {
7991
7975
  case "edit":
7992
7976
  options.push({
7993
- optionId: ToolConfirmationOutcome.ProceedAlways,
7977
+ optionId: "proceed_always" /* ProceedAlways */,
7994
7978
  name: "Allow for this session",
7995
7979
  kind: "allow_always"
7996
7980
  });
7997
7981
  if (enablePermanentToolApproval) {
7998
7982
  options.push({
7999
- optionId: ToolConfirmationOutcome.ProceedAlwaysAndSave,
7983
+ optionId: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
8000
7984
  name: "Allow for this file in all future sessions",
8001
7985
  kind: "allow_always"
8002
7986
  });
@@ -8004,13 +7988,13 @@ function toPermissionOptions(confirmation, config, enablePermanentToolApproval =
8004
7988
  break;
8005
7989
  case "exec":
8006
7990
  options.push({
8007
- optionId: ToolConfirmationOutcome.ProceedAlways,
7991
+ optionId: "proceed_always" /* ProceedAlways */,
8008
7992
  name: "Allow for this session",
8009
7993
  kind: "allow_always"
8010
7994
  });
8011
7995
  if (enablePermanentToolApproval) {
8012
7996
  options.push({
8013
- optionId: ToolConfirmationOutcome.ProceedAlwaysAndSave,
7997
+ optionId: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
8014
7998
  name: "Allow this command for all future sessions",
8015
7999
  kind: "allow_always"
8016
8000
  });
@@ -8021,19 +8005,19 @@ function toPermissionOptions(confirmation, config, enablePermanentToolApproval =
8021
8005
  const toolName = confirmation.toolName?.trim() || "generic_tool";
8022
8006
  options.push(
8023
8007
  {
8024
- optionId: ToolConfirmationOutcome.ProceedAlwaysServer,
8008
+ optionId: "proceed_always_server" /* ProceedAlwaysServer */,
8025
8009
  name: `Allow all "${serverName}" server tools for this session`,
8026
8010
  kind: "allow_always"
8027
8011
  },
8028
8012
  {
8029
- optionId: ToolConfirmationOutcome.ProceedAlwaysTool,
8013
+ optionId: "proceed_always_tool" /* ProceedAlwaysTool */,
8030
8014
  name: `Allow tool "${toolName}" for this session`,
8031
8015
  kind: "allow_always"
8032
8016
  }
8033
8017
  );
8034
8018
  if (enablePermanentToolApproval) {
8035
8019
  options.push({
8036
- optionId: ToolConfirmationOutcome.ProceedAlwaysAndSave,
8020
+ optionId: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
8037
8021
  name: `Allow tool "${toolName}" for all future sessions`,
8038
8022
  kind: "allow_always"
8039
8023
  });
@@ -8042,13 +8026,13 @@ function toPermissionOptions(confirmation, config, enablePermanentToolApproval =
8042
8026
  }
8043
8027
  case "info":
8044
8028
  options.push({
8045
- optionId: ToolConfirmationOutcome.ProceedAlways,
8029
+ optionId: "proceed_always" /* ProceedAlways */,
8046
8030
  name: "Allow for this session",
8047
8031
  kind: "allow_always"
8048
8032
  });
8049
8033
  if (enablePermanentToolApproval) {
8050
8034
  options.push({
8051
- optionId: ToolConfirmationOutcome.ProceedAlwaysAndSave,
8035
+ optionId: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
8052
8036
  name: "Allow for all future sessions",
8053
8037
  kind: "allow_always"
8054
8038
  });
@@ -8080,21 +8064,21 @@ function toPermissionOptions(confirmation, config, enablePermanentToolApproval =
8080
8064
  }
8081
8065
  function toAcpToolKind(kind) {
8082
8066
  switch (kind) {
8083
- case Kind.Read:
8084
- case Kind.Edit:
8085
- case Kind.Execute:
8086
- case Kind.Search:
8087
- case Kind.Delete:
8088
- case Kind.Move:
8089
- case Kind.Think:
8090
- case Kind.Fetch:
8091
- case Kind.SwitchMode:
8092
- case Kind.Other:
8067
+ case "read" /* Read */:
8068
+ case "edit" /* Edit */:
8069
+ case "execute" /* Execute */:
8070
+ case "search" /* Search */:
8071
+ case "delete" /* Delete */:
8072
+ case "move" /* Move */:
8073
+ case "think" /* Think */:
8074
+ case "fetch" /* Fetch */:
8075
+ case "switch_mode" /* SwitchMode */:
8076
+ case "other" /* Other */:
8093
8077
  return kind;
8094
- case Kind.Agent:
8078
+ case "agent" /* Agent */:
8095
8079
  return "think";
8096
- case Kind.Plan:
8097
- case Kind.Communicate:
8080
+ case "plan" /* Plan */:
8081
+ case "communicate" /* Communicate */:
8098
8082
  default:
8099
8083
  return "other";
8100
8084
  }
@@ -8102,24 +8086,24 @@ function toAcpToolKind(kind) {
8102
8086
  function buildAvailableModes(isPlanEnabled) {
8103
8087
  const modes = [
8104
8088
  {
8105
- id: ApprovalMode.DEFAULT,
8089
+ id: "default" /* DEFAULT */,
8106
8090
  name: "Default",
8107
8091
  description: "Prompts for approval"
8108
8092
  },
8109
8093
  {
8110
- id: ApprovalMode.AUTO_EDIT,
8094
+ id: "autoEdit" /* AUTO_EDIT */,
8111
8095
  name: "Auto Edit",
8112
8096
  description: "Auto-approves edit tools"
8113
8097
  },
8114
8098
  {
8115
- id: ApprovalMode.YOLO,
8099
+ id: "yolo" /* YOLO */,
8116
8100
  name: "YOLO",
8117
8101
  description: "Auto-approves all tools"
8118
8102
  }
8119
8103
  ];
8120
8104
  if (isPlanEnabled) {
8121
8105
  modes.push({
8122
- id: ApprovalMode.PLAN,
8106
+ id: "plan" /* PLAN */,
8123
8107
  name: "Plan",
8124
8108
  description: "Read-only mode"
8125
8109
  });
@@ -8133,7 +8117,7 @@ function buildAvailableModels(config, settings) {
8133
8117
  const useLatestFlash = config.hasLatestFlashGAAccess?.() ?? false;
8134
8118
  const useLatestFlashLite = config.hasLatestFlashLiteGAAccess?.() ?? false;
8135
8119
  const selectedAuthType = settings.merged.security?.auth?.selectedType ?? config.getContentGeneratorConfig?.()?.authType;
8136
- const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
8120
+ const useCustomToolModel = useGemini31 && selectedAuthType === "gemini-api-key" /* USE_GEMINI */;
8137
8121
  if (config.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
8138
8122
  const options = config.getModelConfigService().getAvailableModelOptions({
8139
8123
  useGemini3_1: useGemini31,
@@ -8294,7 +8278,7 @@ async function handleList3(options) {
8294
8278
  }
8295
8279
  if (authType && !authConfig?.useExternal) {
8296
8280
  try {
8297
- if (authType !== AuthType.GATEWAY) {
8281
+ if (authType !== "gateway" /* GATEWAY */) {
8298
8282
  const authError = await validateAuthMethod(authType);
8299
8283
  if (authError) {
8300
8284
  throw new Error(authError);
@@ -8472,7 +8456,7 @@ async function loadSandboxConfig(settings, argv) {
8472
8456
  }
8473
8457
  const command2 = getSandboxCommand(sandboxValue);
8474
8458
  const packageJson = await getPackageJson(__dirname3);
8475
- const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.71.0-nightly.20261124.gaafdfdfb5" ?? customImage ?? packageJson?.config?.sandboxImageUri;
8459
+ const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.71.0" ?? customImage ?? packageJson?.config?.sandboxImageUri;
8476
8460
  const isNative = command2 === "windows-native" || command2 === "sandbox-exec" || command2 === "lxc";
8477
8461
  return command2 && (image || isNative) ? { enabled: true, allowedPaths, networkAccess, command: command2, image } : void 0;
8478
8462
  }
@@ -8486,11 +8470,10 @@ function resolvePath(p) {
8486
8470
  let expandedPath = p;
8487
8471
  if (p.toLowerCase().startsWith("%userprofile%")) {
8488
8472
  expandedPath = homedir() + p.substring("%userprofile%".length);
8489
- } else if (p === "~" || p.startsWith("~/") || process.platform === "win32" && p.startsWith("~\\")) {
8473
+ } else if (p === "~" || p.startsWith("~/")) {
8490
8474
  expandedPath = homedir() + p.substring(1);
8491
8475
  }
8492
- const pathModule = process.platform === "win32" ? path7.win32 : path7.posix;
8493
- return pathModule.normalize(expandedPath);
8476
+ return path7.normalize(expandedPath);
8494
8477
  }
8495
8478
 
8496
8479
  // packages/cli/src/config/policy.ts
@@ -8532,9 +8515,9 @@ async function resolveWorkspacePolicyState(options) {
8532
8515
  cwd,
8533
8516
  potentialWorkspacePoliciesDir
8534
8517
  );
8535
- if (integrityResult.status === IntegrityStatus.MATCH) {
8518
+ if (integrityResult.status === "MATCH" /* MATCH */) {
8536
8519
  workspacePoliciesDir = potentialWorkspacePoliciesDir;
8537
- } else if (integrityResult.status === IntegrityStatus.NEW && integrityResult.fileCount === 0) {
8520
+ } else if (integrityResult.status === "NEW" /* NEW */ && integrityResult.fileCount === 0) {
8538
8521
  workspacePoliciesDir = void 0;
8539
8522
  } else if (interactive && !autoAcceptWorkspacePolicies) {
8540
8523
  policyUpdateConfirmationRequest = {
@@ -9004,23 +8987,23 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
9004
8987
  if (rawApprovalMode) {
9005
8988
  switch (rawApprovalMode) {
9006
8989
  case "yolo":
9007
- approvalMode = ApprovalMode.YOLO;
8990
+ approvalMode = "yolo" /* YOLO */;
9008
8991
  break;
9009
8992
  case "auto_edit":
9010
- approvalMode = ApprovalMode.AUTO_EDIT;
8993
+ approvalMode = "autoEdit" /* AUTO_EDIT */;
9011
8994
  break;
9012
8995
  case "plan":
9013
8996
  if (!(settings.general?.plan?.enabled ?? true)) {
9014
8997
  debugLogger.warn(
9015
8998
  'Approval mode "plan" is disabled in your settings. Falling back to "default".'
9016
8999
  );
9017
- approvalMode = ApprovalMode.DEFAULT;
9000
+ approvalMode = "default" /* DEFAULT */;
9018
9001
  } else {
9019
- approvalMode = ApprovalMode.PLAN;
9002
+ approvalMode = "plan" /* PLAN */;
9020
9003
  }
9021
9004
  break;
9022
9005
  case "default":
9023
- approvalMode = ApprovalMode.DEFAULT;
9006
+ approvalMode = "default" /* DEFAULT */;
9024
9007
  break;
9025
9008
  default:
9026
9009
  throw new Error(
@@ -9028,10 +9011,10 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
9028
9011
  );
9029
9012
  }
9030
9013
  } else {
9031
- approvalMode = ApprovalMode.DEFAULT;
9014
+ approvalMode = "default" /* DEFAULT */;
9032
9015
  }
9033
9016
  if (settings.security?.disableYoloMode || settings.admin?.secureModeEnabled) {
9034
- if (approvalMode === ApprovalMode.YOLO) {
9017
+ if (approvalMode === "yolo" /* YOLO */) {
9035
9018
  if (settings.admin?.secureModeEnabled) {
9036
9019
  debugLogger.error(
9037
9020
  'YOLO mode is disabled by "secureModeEnabled" setting.'
@@ -9049,16 +9032,16 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
9049
9032
  )
9050
9033
  );
9051
9034
  }
9052
- } else if (approvalMode === ApprovalMode.YOLO) {
9035
+ } else if (approvalMode === "yolo" /* YOLO */) {
9053
9036
  debugLogger.warn(
9054
9037
  "YOLO mode is enabled. All tool calls will be automatically approved."
9055
9038
  );
9056
9039
  }
9057
- if (!trustedFolder && approvalMode !== ApprovalMode.DEFAULT) {
9040
+ if (!trustedFolder && approvalMode !== "default" /* DEFAULT */) {
9058
9041
  debugLogger.warn(
9059
9042
  `Approval mode overridden to "default" because the current folder is not trusted.`
9060
9043
  );
9061
- approvalMode = ApprovalMode.DEFAULT;
9044
+ approvalMode = "default" /* DEFAULT */;
9062
9045
  }
9063
9046
  let telemetrySettings;
9064
9047
  try {
@@ -13048,11 +13031,11 @@ var TRUST_WORKSPACE_ENV = "GEMINI_CLI_TRUST_WORKSPACE";
13048
13031
  function parseTrustChoice(answer) {
13049
13032
  switch (answer.trim()) {
13050
13033
  case "1":
13051
- return TrustLevel.TRUST_FOLDER;
13034
+ return "TRUST_FOLDER" /* TRUST_FOLDER */;
13052
13035
  case "2":
13053
- return TrustLevel.TRUST_PARENT;
13036
+ return "TRUST_PARENT" /* TRUST_PARENT */;
13054
13037
  case "3":
13055
- return TrustLevel.DO_NOT_TRUST;
13038
+ return "DO_NOT_TRUST" /* DO_NOT_TRUST */;
13056
13039
  default:
13057
13040
  return void 0;
13058
13041
  }
@@ -13090,7 +13073,7 @@ async function resolveFolderTrustForSandbox({
13090
13073
  } catch {
13091
13074
  throw new FatalConfigError("Failed to save trust settings.");
13092
13075
  }
13093
- isTrusted = trustLevel !== TrustLevel.DO_NOT_TRUST;
13076
+ isTrusted = trustLevel !== "DO_NOT_TRUST" /* DO_NOT_TRUST */;
13094
13077
  }
13095
13078
  process.env[TRUST_WORKSPACE_ENV] = isTrusted ? "true" : "false";
13096
13079
  }
@@ -13224,7 +13207,7 @@ import path13 from "node:path";
13224
13207
  import process5 from "node:process";
13225
13208
  var homeDirectoryCheck = {
13226
13209
  id: "home-directory",
13227
- priority: WarningPriority.Low,
13210
+ priority: "low" /* Low */,
13228
13211
  check: async (workspaceRoot, settings) => {
13229
13212
  if (settings.ui?.showHomeDirectoryWarning === false) {
13230
13213
  return null;
@@ -13248,7 +13231,7 @@ var homeDirectoryCheck = {
13248
13231
  };
13249
13232
  var rootDirectoryCheck = {
13250
13233
  id: "root-directory",
13251
- priority: WarningPriority.High,
13234
+ priority: "high" /* High */,
13252
13235
  check: async (workspaceRoot, _settings) => {
13253
13236
  try {
13254
13237
  const workspaceRealPath = await fs10.realpath(workspaceRoot);
@@ -13264,7 +13247,7 @@ var rootDirectoryCheck = {
13264
13247
  };
13265
13248
  var folderTrustCheck = {
13266
13249
  id: "folder-trust",
13267
- priority: WarningPriority.High,
13250
+ priority: "high" /* High */,
13268
13251
  check: async (workspaceRoot, settings) => {
13269
13252
  if (!isFolderTrustEnabled(settings)) {
13270
13253
  return null;
@@ -13454,12 +13437,12 @@ function handleError(error, config, customErrorCode) {
13454
13437
  error,
13455
13438
  config.getContentGeneratorConfig()?.authType
13456
13439
  );
13457
- if (config.getOutputFormat() === OutputFormat.STREAM_JSON) {
13440
+ if (config.getOutputFormat() === "stream-json" /* STREAM_JSON */) {
13458
13441
  const streamFormatter = new StreamJsonFormatter();
13459
13442
  const errorCode = customErrorCode ?? extractErrorCode(error);
13460
13443
  const metrics = uiTelemetryService.getMetrics();
13461
13444
  streamFormatter.emitEvent({
13462
- type: JsonStreamEventType.RESULT,
13445
+ type: "result" /* RESULT */,
13463
13446
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13464
13447
  status: "error",
13465
13448
  error: {
@@ -13470,7 +13453,7 @@ function handleError(error, config, customErrorCode) {
13470
13453
  });
13471
13454
  runSyncCleanup();
13472
13455
  process.exit(getNumericExitCode(errorCode));
13473
- } else if (config.getOutputFormat() === OutputFormat.JSON) {
13456
+ } else if (config.getOutputFormat() === "json" /* JSON */) {
13474
13457
  const formatter = new JsonFormatter();
13475
13458
  const errorCode = customErrorCode ?? extractErrorCode(error);
13476
13459
  const formattedError = formatter.formatError(
@@ -13490,11 +13473,11 @@ function handleToolError(toolName, toolError, config, errorType, resultDisplay)
13490
13473
  const isFatal = isFatalToolError(errorType);
13491
13474
  if (isFatal) {
13492
13475
  const toolExecutionError = new FatalToolExecutionError(errorMessage);
13493
- if (config.getOutputFormat() === OutputFormat.STREAM_JSON) {
13476
+ if (config.getOutputFormat() === "stream-json" /* STREAM_JSON */) {
13494
13477
  const streamFormatter = new StreamJsonFormatter();
13495
13478
  const metrics = uiTelemetryService.getMetrics();
13496
13479
  streamFormatter.emitEvent({
13497
- type: JsonStreamEventType.RESULT,
13480
+ type: "result" /* RESULT */,
13498
13481
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13499
13482
  status: "error",
13500
13483
  error: {
@@ -13503,7 +13486,7 @@ function handleToolError(toolName, toolError, config, errorType, resultDisplay)
13503
13486
  },
13504
13487
  stats: streamFormatter.convertToStreamStats(metrics, 0)
13505
13488
  });
13506
- } else if (config.getOutputFormat() === OutputFormat.JSON) {
13489
+ } else if (config.getOutputFormat() === "json" /* JSON */) {
13507
13490
  const formatter = new JsonFormatter();
13508
13491
  const formattedError = formatter.formatError(
13509
13492
  toolExecutionError,
@@ -13524,11 +13507,11 @@ function handleCancellationError(config, exitCode = 130) {
13524
13507
  "Operation cancelled.",
13525
13508
  exitCode
13526
13509
  );
13527
- if (config.getOutputFormat() === OutputFormat.STREAM_JSON) {
13510
+ if (config.getOutputFormat() === "stream-json" /* STREAM_JSON */) {
13528
13511
  const streamFormatter = new StreamJsonFormatter();
13529
13512
  const metrics = uiTelemetryService.getMetrics();
13530
13513
  streamFormatter.emitEvent({
13531
- type: JsonStreamEventType.RESULT,
13514
+ type: "result" /* RESULT */,
13532
13515
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13533
13516
  status: "error",
13534
13517
  error: {
@@ -13539,7 +13522,7 @@ function handleCancellationError(config, exitCode = 130) {
13539
13522
  });
13540
13523
  runSyncCleanup();
13541
13524
  process.exit(cancellationError.exitCode);
13542
- } else if (config.getOutputFormat() === OutputFormat.JSON) {
13525
+ } else if (config.getOutputFormat() === "json" /* JSON */) {
13543
13526
  const formatter = new JsonFormatter();
13544
13527
  const formattedError = formatter.formatError(
13545
13528
  cancellationError,
@@ -13559,11 +13542,11 @@ function handleMaxTurnsExceededError(config) {
13559
13542
  const maxTurnsError = new FatalTurnLimitedError(
13560
13543
  "Reached max session turns for this session. Increase the number of turns by specifying maxSessionTurns in settings.json."
13561
13544
  );
13562
- if (config.getOutputFormat() === OutputFormat.STREAM_JSON) {
13545
+ if (config.getOutputFormat() === "stream-json" /* STREAM_JSON */) {
13563
13546
  const streamFormatter = new StreamJsonFormatter();
13564
13547
  const metrics = uiTelemetryService.getMetrics();
13565
13548
  streamFormatter.emitEvent({
13566
- type: JsonStreamEventType.RESULT,
13549
+ type: "result" /* RESULT */,
13567
13550
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13568
13551
  status: "error",
13569
13552
  error: {
@@ -13574,7 +13557,7 @@ function handleMaxTurnsExceededError(config) {
13574
13557
  });
13575
13558
  runSyncCleanup();
13576
13559
  process.exit(maxTurnsError.exitCode);
13577
- } else if (config.getOutputFormat() === OutputFormat.JSON) {
13560
+ } else if (config.getOutputFormat() === "json" /* JSON */) {
13578
13561
  const formatter = new JsonFormatter();
13579
13562
  const formattedError = formatter.formatError(
13580
13563
  maxTurnsError,
@@ -13657,7 +13640,7 @@ async function runNonInteractive({
13657
13640
  }
13658
13641
  });
13659
13642
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
13660
- const { setupInitialActivityLogger } = await import("./devtoolsService-XNGB5DAQ.js");
13643
+ const { setupInitialActivityLogger } = await import("./devtoolsService-Y7BMPXKB.js");
13661
13644
  setupInitialActivityLogger(config);
13662
13645
  }
13663
13646
  const { stdout: workingStdout } = createWorkingStdio();
@@ -13673,7 +13656,7 @@ async function runNonInteractive({
13673
13656
  }
13674
13657
  };
13675
13658
  const startTime = Date.now();
13676
- const streamFormatter = config.getOutputFormat() === OutputFormat.STREAM_JSON ? new StreamJsonFormatter() : null;
13659
+ const streamFormatter = config.getOutputFormat() === "stream-json" /* STREAM_JSON */ ? new StreamJsonFormatter() : null;
13677
13660
  const abortController = new AbortController();
13678
13661
  let isAborting = false;
13679
13662
  let cancelMessageTimer = null;
@@ -13759,13 +13742,13 @@ async function runNonInteractive({
13759
13742
  };
13760
13743
  try {
13761
13744
  consolePatcher.patch();
13762
- if (config.getRawOutput() && !config.getAcceptRawOutputRisk() && config.getOutputFormat() === OutputFormat.TEXT) {
13745
+ if (config.getRawOutput() && !config.getAcceptRawOutputRisk() && config.getOutputFormat() === "text" /* TEXT */) {
13763
13746
  process.stderr.write(
13764
13747
  "[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"
13765
13748
  );
13766
13749
  }
13767
13750
  setupCancellation();
13768
- coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
13751
+ coreEvents.on("user-feedback" /* UserFeedback */, handleUserFeedback);
13769
13752
  coreEvents.drainBacklogs();
13770
13753
  process.stdout.on("error", handleStdoutError);
13771
13754
  const geminiClient = config.getGeminiClient();
@@ -13785,7 +13768,7 @@ async function runNonInteractive({
13785
13768
  }
13786
13769
  if (streamFormatter) {
13787
13770
  streamFormatter.emitEvent({
13788
- type: JsonStreamEventType.INIT,
13771
+ type: "init" /* INIT */,
13789
13772
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13790
13773
  session_id: config.getSessionId(),
13791
13774
  model: config.getModel()
@@ -13823,7 +13806,7 @@ async function runNonInteractive({
13823
13806
  }
13824
13807
  if (streamFormatter) {
13825
13808
  streamFormatter.emitEvent({
13826
- type: JsonStreamEventType.MESSAGE,
13809
+ type: "message" /* MESSAGE */,
13827
13810
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13828
13811
  role: "user",
13829
13812
  content: input
@@ -13862,12 +13845,12 @@ async function runNonInteractive({
13862
13845
  const metrics = uiTelemetryService.getMetrics();
13863
13846
  const durationMs = Date.now() - startTime;
13864
13847
  streamFormatter.emitEvent({
13865
- type: JsonStreamEventType.RESULT,
13848
+ type: "result" /* RESULT */,
13866
13849
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13867
13850
  status: errorPayload ? "error" : "success",
13868
13851
  stats: streamFormatter.convertToStreamStats(metrics, durationMs)
13869
13852
  });
13870
- } else if (config.getOutputFormat() === OutputFormat.JSON) {
13853
+ } else if (config.getOutputFormat() === "json" /* JSON */) {
13871
13854
  const formatter = new JsonFormatter();
13872
13855
  const stats = uiTelemetryService.getMetrics();
13873
13856
  textOutput.write(
@@ -13959,13 +13942,13 @@ async function runNonInteractive({
13959
13942
  const output = isRaw ? part.text : stripAnsi(part.text);
13960
13943
  if (streamFormatter) {
13961
13944
  streamFormatter.emitEvent({
13962
- type: JsonStreamEventType.MESSAGE,
13945
+ type: "message" /* MESSAGE */,
13963
13946
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13964
13947
  role: "assistant",
13965
13948
  content: output,
13966
13949
  delta: true
13967
13950
  });
13968
- } else if (config.getOutputFormat() === OutputFormat.JSON) {
13951
+ } else if (config.getOutputFormat() === "json" /* JSON */) {
13969
13952
  responseText += output;
13970
13953
  } else {
13971
13954
  if (part.text) {
@@ -13978,13 +13961,13 @@ async function runNonInteractive({
13978
13961
  break;
13979
13962
  }
13980
13963
  case "tool_request": {
13981
- if (config.getOutputFormat() === OutputFormat.JSON) {
13964
+ if (config.getOutputFormat() === "json" /* JSON */) {
13982
13965
  preToolResponseText = responseText || preToolResponseText;
13983
13966
  responseText = "";
13984
13967
  }
13985
13968
  if (streamFormatter) {
13986
13969
  streamFormatter.emitEvent({
13987
- type: JsonStreamEventType.TOOL_USE,
13970
+ type: "tool_use" /* TOOL_USE */,
13988
13971
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13989
13972
  tool_name: event.name,
13990
13973
  tool_id: event.requestId,
@@ -14000,7 +13983,7 @@ async function runNonInteractive({
14000
13983
  const displayText = displayContentToString(display);
14001
13984
  const errorMsg = getTextContent(event.content) ?? "Tool error";
14002
13985
  streamFormatter.emitEvent({
14003
- type: JsonStreamEventType.TOOL_RESULT,
13986
+ type: "tool_result" /* TOOL_RESULT */,
14004
13987
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14005
13988
  tool_id: event.requestId,
14006
13989
  status: event.isError ? "error" : "success",
@@ -14015,17 +13998,17 @@ async function runNonInteractive({
14015
13998
  const display = event.display?.result;
14016
13999
  const displayText = displayContentToString(display);
14017
14000
  const errorMsg = getTextContent(event.content) ?? "Tool error";
14018
- if (event.data?.["errorType"] === ToolErrorType.STOP_EXECUTION) {
14019
- if (config.getOutputFormat() === OutputFormat.JSON && !responseText && preToolResponseText) {
14001
+ if (event.data?.["errorType"] === "stop_execution" /* STOP_EXECUTION */) {
14002
+ if (config.getOutputFormat() === "json" /* JSON */ && !responseText && preToolResponseText) {
14020
14003
  responseText = preToolResponseText;
14021
14004
  }
14022
14005
  const stopMessage = `Agent execution stopped: ${errorMsg}`;
14023
- if (config.getOutputFormat() === OutputFormat.TEXT) {
14006
+ if (config.getOutputFormat() === "text" /* TEXT */) {
14024
14007
  process.stderr.write(`${stopMessage}
14025
14008
  `);
14026
14009
  }
14027
14010
  }
14028
- if (event.data?.["errorType"] === ToolErrorType.NO_SPACE_LEFT) {
14011
+ if (event.data?.["errorType"] === "no_space_left" /* NO_SPACE_LEFT */) {
14029
14012
  throw new FatalToolExecutionError(
14030
14013
  "Error executing tool " + event.name + ": " + (displayText || errorMsg)
14031
14014
  );
@@ -14060,12 +14043,12 @@ async function runNonInteractive({
14060
14043
  }
14061
14044
  if (streamFormatter) {
14062
14045
  streamFormatter.emitEvent({
14063
- type: JsonStreamEventType.ERROR,
14046
+ type: "error" /* ERROR */,
14064
14047
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14065
14048
  severity: "error",
14066
14049
  message: errorMessage
14067
14050
  });
14068
- } else if (config.getOutputFormat() === OutputFormat.TEXT) {
14051
+ } else if (config.getOutputFormat() === "text" /* TEXT */) {
14069
14052
  process.stderr.write(`[ERROR] ${errorMessage}
14070
14053
  `);
14071
14054
  }
@@ -14086,12 +14069,12 @@ async function runNonInteractive({
14086
14069
  const errorCode = event._meta?.["code"];
14087
14070
  if (errorCode === "AGENT_EXECUTION_BLOCKED") {
14088
14071
  const blockMessage = `Agent execution blocked: ${event.message.trim()}`;
14089
- if (config.getOutputFormat() === OutputFormat.TEXT) {
14072
+ if (config.getOutputFormat() === "text" /* TEXT */) {
14090
14073
  process.stderr.write(`[WARNING] ${blockMessage}
14091
14074
  `);
14092
14075
  } else if (streamFormatter) {
14093
14076
  streamFormatter.emitEvent({
14094
- type: JsonStreamEventType.ERROR,
14077
+ type: "error" /* ERROR */,
14095
14078
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14096
14079
  severity: "warning",
14097
14080
  message: stripAnsi(blockMessage)
@@ -14101,13 +14084,13 @@ async function runNonInteractive({
14101
14084
  break;
14102
14085
  }
14103
14086
  const severity = event.status === "RESOURCE_EXHAUSTED" ? "error" : "warning";
14104
- if (config.getOutputFormat() === OutputFormat.TEXT) {
14087
+ if (config.getOutputFormat() === "text" /* TEXT */) {
14105
14088
  process.stderr.write(`[WARNING] ${event.message}
14106
14089
  `);
14107
14090
  }
14108
14091
  if (streamFormatter) {
14109
14092
  streamFormatter.emitEvent({
14110
- type: JsonStreamEventType.ERROR,
14093
+ type: "error" /* ERROR */,
14111
14094
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14112
14095
  severity,
14113
14096
  message: stripAnsi(event.message)
@@ -14127,7 +14110,7 @@ async function runNonInteractive({
14127
14110
  );
14128
14111
  } else if (streamFormatter) {
14129
14112
  streamFormatter.emitEvent({
14130
- type: JsonStreamEventType.ERROR,
14113
+ type: "error" /* ERROR */,
14131
14114
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14132
14115
  severity: "error",
14133
14116
  message: "Maximum session turns exceeded"
@@ -14135,7 +14118,7 @@ async function runNonInteractive({
14135
14118
  }
14136
14119
  }
14137
14120
  const stopMessage = typeof event.data?.["message"] === "string" ? event.data["message"] : "";
14138
- if (stopMessage && config.getOutputFormat() === OutputFormat.TEXT) {
14121
+ if (stopMessage && config.getOutputFormat() === "text" /* TEXT */) {
14139
14122
  process.stderr.write(`Agent execution stopped: ${stopMessage}
14140
14123
  `);
14141
14124
  }
@@ -14165,7 +14148,7 @@ async function runNonInteractive({
14165
14148
  abortController.signal.removeEventListener("abort", abortSession);
14166
14149
  scheduler?.dispose();
14167
14150
  consolePatcher.cleanup();
14168
- coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
14151
+ coreEvents.off("user-feedback" /* UserFeedback */, handleUserFeedback);
14169
14152
  await runExitCleanup();
14170
14153
  }
14171
14154
  if (abortController.signal.aborted || isFatalCancellationError(errorToHandle)) {
@@ -14198,7 +14181,7 @@ async function runNonInteractive2(params) {
14198
14181
  }
14199
14182
  });
14200
14183
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
14201
- const { setupInitialActivityLogger } = await import("./devtoolsService-XNGB5DAQ.js");
14184
+ const { setupInitialActivityLogger } = await import("./devtoolsService-Y7BMPXKB.js");
14202
14185
  setupInitialActivityLogger(config);
14203
14186
  }
14204
14187
  const { stdout: workingStdout } = createWorkingStdio();
@@ -14214,7 +14197,7 @@ async function runNonInteractive2(params) {
14214
14197
  }
14215
14198
  };
14216
14199
  const startTime = Date.now();
14217
- const streamFormatter = config.getOutputFormat() === OutputFormat.STREAM_JSON ? new StreamJsonFormatter() : null;
14200
+ const streamFormatter = config.getOutputFormat() === "stream-json" /* STREAM_JSON */ ? new StreamJsonFormatter() : null;
14218
14201
  const abortController = new AbortController();
14219
14202
  let isAborting = false;
14220
14203
  let cancelMessageTimer = null;
@@ -14298,13 +14281,13 @@ async function runNonInteractive2(params) {
14298
14281
  let scheduler;
14299
14282
  try {
14300
14283
  consolePatcher.patch();
14301
- if (config.getRawOutput() && !config.getAcceptRawOutputRisk() && config.getOutputFormat() === OutputFormat.TEXT) {
14284
+ if (config.getRawOutput() && !config.getAcceptRawOutputRisk() && config.getOutputFormat() === "text" /* TEXT */) {
14302
14285
  process.stderr.write(
14303
14286
  "[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"
14304
14287
  );
14305
14288
  }
14306
14289
  setupCancellation();
14307
- coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
14290
+ coreEvents.on("user-feedback" /* UserFeedback */, handleUserFeedback);
14308
14291
  coreEvents.drainBacklogs();
14309
14292
  process.stdout.on("error", handleStdoutError);
14310
14293
  const geminiClient = config.getGeminiClient();
@@ -14324,7 +14307,7 @@ async function runNonInteractive2(params) {
14324
14307
  }
14325
14308
  if (streamFormatter) {
14326
14309
  streamFormatter.emitEvent({
14327
- type: JsonStreamEventType.INIT,
14310
+ type: "init" /* INIT */,
14328
14311
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14329
14312
  session_id: config.getSessionId(),
14330
14313
  model: config.getModel()
@@ -14362,7 +14345,7 @@ async function runNonInteractive2(params) {
14362
14345
  }
14363
14346
  if (streamFormatter) {
14364
14347
  streamFormatter.emitEvent({
14365
- type: JsonStreamEventType.MESSAGE,
14348
+ type: "message" /* MESSAGE */,
14366
14349
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14367
14350
  role: "user",
14368
14351
  content: input
@@ -14390,28 +14373,28 @@ async function runNonInteractive2(params) {
14390
14373
  if (abortController.signal.aborted) {
14391
14374
  handleCancellationError(config, abortExitCode);
14392
14375
  }
14393
- if (event.type === GeminiEventType.Content) {
14376
+ if (event.type === "content" /* Content */) {
14394
14377
  const isRaw = config.getRawOutput() || config.getAcceptRawOutputRisk();
14395
14378
  const output = isRaw ? event.value : stripAnsi(event.value);
14396
14379
  if (streamFormatter) {
14397
14380
  streamFormatter.emitEvent({
14398
- type: JsonStreamEventType.MESSAGE,
14381
+ type: "message" /* MESSAGE */,
14399
14382
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14400
14383
  role: "assistant",
14401
14384
  content: output,
14402
14385
  delta: true
14403
14386
  });
14404
- } else if (config.getOutputFormat() === OutputFormat.JSON) {
14387
+ } else if (config.getOutputFormat() === "json" /* JSON */) {
14405
14388
  responseText += output;
14406
14389
  } else {
14407
14390
  if (event.value) {
14408
14391
  textOutput.write(output);
14409
14392
  }
14410
14393
  }
14411
- } else if (event.type === GeminiEventType.ToolCallRequest) {
14394
+ } else if (event.type === "tool_call_request" /* ToolCallRequest */) {
14412
14395
  if (streamFormatter) {
14413
14396
  streamFormatter.emitEvent({
14414
- type: JsonStreamEventType.TOOL_USE,
14397
+ type: "tool_use" /* TOOL_USE */,
14415
14398
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14416
14399
  tool_name: event.value.name,
14417
14400
  tool_id: event.value.callId,
@@ -14419,29 +14402,29 @@ async function runNonInteractive2(params) {
14419
14402
  });
14420
14403
  }
14421
14404
  toolCallRequests.push(event.value);
14422
- } else if (event.type === GeminiEventType.LoopDetected) {
14405
+ } else if (event.type === "loop_detected" /* LoopDetected */) {
14423
14406
  const message = "Loop detected, stopping execution";
14424
14407
  if (streamFormatter) {
14425
14408
  streamFormatter.emitEvent({
14426
- type: JsonStreamEventType.ERROR,
14409
+ type: "error" /* ERROR */,
14427
14410
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14428
14411
  severity: "warning",
14429
14412
  message
14430
14413
  });
14431
14414
  }
14432
14415
  warnings.push(message);
14433
- } else if (event.type === GeminiEventType.MaxSessionTurns) {
14416
+ } else if (event.type === "max_session_turns" /* MaxSessionTurns */) {
14434
14417
  const message = "Maximum session turns exceeded";
14435
14418
  if (streamFormatter) {
14436
14419
  streamFormatter.emitEvent({
14437
- type: JsonStreamEventType.ERROR,
14420
+ type: "error" /* ERROR */,
14438
14421
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14439
14422
  severity: "error",
14440
14423
  message
14441
14424
  });
14442
14425
  }
14443
14426
  warnings.push(message);
14444
- } else if (event.type === GeminiEventType.Error) {
14427
+ } else if (event.type === "error" /* Error */) {
14445
14428
  const normalized = normalizeError(event.value?.error);
14446
14429
  const code = normalized.code ?? (typeof normalized.status === "string" ? normalized.status : void 0);
14447
14430
  const err = Object.assign(
@@ -14456,9 +14439,9 @@ async function runNonInteractive2(params) {
14456
14439
  }
14457
14440
  );
14458
14441
  throw err;
14459
- } else if (event.type === GeminiEventType.AgentExecutionStopped) {
14442
+ } else if (event.type === "agent_execution_stopped" /* AgentExecutionStopped */) {
14460
14443
  const stopMessage = `Agent execution stopped: ${event.value.systemMessage?.trim() || event.value.reason}`;
14461
- if (config.getOutputFormat() === OutputFormat.TEXT) {
14444
+ if (config.getOutputFormat() === "text" /* TEXT */) {
14462
14445
  process.stderr.write(`${stopMessage}
14463
14446
  `);
14464
14447
  }
@@ -14466,7 +14449,7 @@ async function runNonInteractive2(params) {
14466
14449
  const metrics = uiTelemetryService.getMetrics();
14467
14450
  const durationMs = Date.now() - startTime;
14468
14451
  streamFormatter.emitEvent({
14469
- type: JsonStreamEventType.RESULT,
14452
+ type: "result" /* RESULT */,
14470
14453
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14471
14454
  status: "success",
14472
14455
  stats: streamFormatter.convertToStreamStats(
@@ -14474,7 +14457,7 @@ async function runNonInteractive2(params) {
14474
14457
  durationMs
14475
14458
  )
14476
14459
  });
14477
- } else if (config.getOutputFormat() === OutputFormat.JSON) {
14460
+ } else if (config.getOutputFormat() === "json" /* JSON */) {
14478
14461
  const formatter = new JsonFormatter();
14479
14462
  const stats = uiTelemetryService.getMetrics();
14480
14463
  textOutput.write(
@@ -14490,23 +14473,23 @@ async function runNonInteractive2(params) {
14490
14473
  textOutput.ensureTrailingNewline();
14491
14474
  }
14492
14475
  return;
14493
- } else if (event.type === GeminiEventType.UserCancelled) {
14476
+ } else if (event.type === "user_cancelled" /* UserCancelled */) {
14494
14477
  throw new FatalCancellationError("Operation cancelled.");
14495
- } else if (event.type === GeminiEventType.AgentExecutionBlocked) {
14478
+ } else if (event.type === "agent_execution_blocked" /* AgentExecutionBlocked */) {
14496
14479
  const blockMessage = `Agent execution blocked: ${event.value.systemMessage?.trim() || event.value.reason}`;
14497
- if (config.getOutputFormat() === OutputFormat.TEXT) {
14480
+ if (config.getOutputFormat() === "text" /* TEXT */) {
14498
14481
  process.stderr.write(`[WARNING] ${blockMessage}
14499
14482
  `);
14500
14483
  } else if (streamFormatter) {
14501
14484
  streamFormatter.emitEvent({
14502
- type: JsonStreamEventType.ERROR,
14485
+ type: "error" /* ERROR */,
14503
14486
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14504
14487
  severity: "warning",
14505
14488
  message: stripAnsi(blockMessage)
14506
14489
  });
14507
14490
  }
14508
14491
  warnings.push(blockMessage);
14509
- } else if (event.type === GeminiEventType.InvalidStream) {
14492
+ } else if (event.type === "invalid_stream" /* InvalidStream */) {
14510
14493
  const eventValue = event.value;
14511
14494
  if (eventValue?.type === "NO_RESPONSE_TEXT") {
14512
14495
  invalidStreamError = TRUE_EMPTY_RESPONSE_MESSAGE;
@@ -14529,12 +14512,12 @@ async function runNonInteractive2(params) {
14529
14512
  );
14530
14513
  if (streamFormatter) {
14531
14514
  streamFormatter.emitEvent({
14532
- type: JsonStreamEventType.ERROR,
14515
+ type: "error" /* ERROR */,
14533
14516
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14534
14517
  severity: "error",
14535
14518
  message: invalidStreamError
14536
14519
  });
14537
- } else if (config.getOutputFormat() === OutputFormat.TEXT) {
14520
+ } else if (config.getOutputFormat() === "text" /* TEXT */) {
14538
14521
  process.stderr.write(`[ERROR] ${invalidStreamError}
14539
14522
  `);
14540
14523
  }
@@ -14571,7 +14554,7 @@ async function runNonInteractive2(params) {
14571
14554
  const requestInfo = completedToolCall.request;
14572
14555
  if (streamFormatter) {
14573
14556
  streamFormatter.emitEvent({
14574
- type: JsonStreamEventType.TOOL_RESULT,
14557
+ type: "tool_result" /* TOOL_RESULT */,
14575
14558
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14576
14559
  tool_id: requestInfo.callId,
14577
14560
  status: completedToolCall.status === "error" ? "error" : "success",
@@ -14605,11 +14588,11 @@ async function runNonInteractive2(params) {
14605
14588
  );
14606
14589
  }
14607
14590
  const stopExecutionTool = completedToolCalls.find(
14608
- (tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
14591
+ (tc) => tc.response.errorType === "stop_execution" /* STOP_EXECUTION */
14609
14592
  );
14610
14593
  if (stopExecutionTool && stopExecutionTool.response.error) {
14611
14594
  const stopMessage = `Agent execution stopped: ${stopExecutionTool.response.error.message}`;
14612
- if (config.getOutputFormat() === OutputFormat.TEXT) {
14595
+ if (config.getOutputFormat() === "text" /* TEXT */) {
14613
14596
  process.stderr.write(`${stopMessage}
14614
14597
  `);
14615
14598
  }
@@ -14617,7 +14600,7 @@ async function runNonInteractive2(params) {
14617
14600
  const metrics = uiTelemetryService.getMetrics();
14618
14601
  const durationMs = Date.now() - startTime;
14619
14602
  streamFormatter.emitEvent({
14620
- type: JsonStreamEventType.RESULT,
14603
+ type: "result" /* RESULT */,
14621
14604
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14622
14605
  status: "success",
14623
14606
  stats: streamFormatter.convertToStreamStats(
@@ -14625,7 +14608,7 @@ async function runNonInteractive2(params) {
14625
14608
  durationMs
14626
14609
  )
14627
14610
  });
14628
- } else if (config.getOutputFormat() === OutputFormat.JSON) {
14611
+ } else if (config.getOutputFormat() === "json" /* JSON */) {
14629
14612
  const formatter = new JsonFormatter();
14630
14613
  const stats = uiTelemetryService.getMetrics();
14631
14614
  textOutput.write(
@@ -14654,12 +14637,12 @@ async function runNonInteractive2(params) {
14654
14637
  const metrics = uiTelemetryService.getMetrics();
14655
14638
  const durationMs = Date.now() - startTime;
14656
14639
  streamFormatter.emitEvent({
14657
- type: JsonStreamEventType.RESULT,
14640
+ type: "result" /* RESULT */,
14658
14641
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14659
14642
  status: invalidStreamError ? "error" : "success",
14660
14643
  stats: streamFormatter.convertToStreamStats(metrics, durationMs)
14661
14644
  });
14662
- } else if (config.getOutputFormat() === OutputFormat.JSON) {
14645
+ } else if (config.getOutputFormat() === "json" /* JSON */) {
14663
14646
  const formatter = new JsonFormatter();
14664
14647
  const stats = uiTelemetryService.getMetrics();
14665
14648
  textOutput.write(
@@ -14683,7 +14666,7 @@ async function runNonInteractive2(params) {
14683
14666
  cleanupCancellation();
14684
14667
  scheduler?.dispose();
14685
14668
  consolePatcher.cleanup();
14686
- coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
14669
+ coreEvents.off("user-feedback" /* UserFeedback */, handleUserFeedback);
14687
14670
  await runExitCleanup();
14688
14671
  }
14689
14672
  if (abortController.signal.aborted || isFatalCancellationError(errorToHandle)) {
@@ -17081,12 +17064,12 @@ var Session = class {
17081
17064
  this.connection = connection;
17082
17065
  this.settings = settings;
17083
17066
  coreEvents.on(
17084
- CoreEvent.ApprovalModeChanged,
17067
+ "approval-mode-changed" /* ApprovalModeChanged */,
17085
17068
  this.handleApprovalModeChanged
17086
17069
  );
17087
- coreEvents.on(CoreEvent.RetryAttempt, this.handleRetryAttempt);
17070
+ coreEvents.on("retry-attempt" /* RetryAttempt */, this.handleRetryAttempt);
17088
17071
  this.context.config.getMessageBus()?.subscribe(
17089
- MessageBusType.TOOL_CONFIRMATION_REQUEST,
17072
+ "tool-confirmation-request" /* TOOL_CONFIRMATION_REQUEST */,
17090
17073
  this.handleToolConfirmationRequest,
17091
17074
  { signal: this.disposeController.signal }
17092
17075
  );
@@ -17110,7 +17093,7 @@ var Session = class {
17110
17093
  "Policy engine missing. Denying tool confirmation request."
17111
17094
  );
17112
17095
  await messageBus.publish({
17113
- type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
17096
+ type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
17114
17097
  correlationId: request.correlationId,
17115
17098
  confirmed: false,
17116
17099
  requiresUserConfirmation: false
@@ -17123,7 +17106,7 @@ var Session = class {
17123
17106
  "Tool confirmation request missing tool name. Denying."
17124
17107
  );
17125
17108
  await messageBus.publish({
17126
- type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
17109
+ type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
17127
17110
  correlationId: request.correlationId,
17128
17111
  confirmed: false,
17129
17112
  requiresUserConfirmation: false
@@ -17136,7 +17119,7 @@ var Session = class {
17136
17119
  `Tool confirmation request for unknown tool: ${toolName}. Denying.`
17137
17120
  );
17138
17121
  await messageBus.publish({
17139
- type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
17122
+ type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
17140
17123
  correlationId: request.correlationId,
17141
17124
  confirmed: false,
17142
17125
  requiresUserConfirmation: false
@@ -17152,15 +17135,15 @@ var Session = class {
17152
17135
  request.subagent
17153
17136
  );
17154
17137
  await messageBus.publish({
17155
- type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
17138
+ type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
17156
17139
  correlationId: request.correlationId,
17157
- confirmed: result.decision === PolicyDecision.ALLOW,
17158
- requiresUserConfirmation: result.decision === PolicyDecision.ASK_USER
17140
+ confirmed: result.decision === "allow" /* ALLOW */,
17141
+ requiresUserConfirmation: result.decision === "ask_user" /* ASK_USER */
17159
17142
  });
17160
17143
  } catch (error) {
17161
17144
  debugLogger.error("Error handling tool confirmation request:", error);
17162
17145
  await this.context.config.getMessageBus()?.publish({
17163
- type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
17146
+ type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
17164
17147
  correlationId: request.correlationId,
17165
17148
  confirmed: false,
17166
17149
  requiresUserConfirmation: false
@@ -17194,10 +17177,10 @@ var Session = class {
17194
17177
  };
17195
17178
  async dispose() {
17196
17179
  coreEvents.off(
17197
- CoreEvent.ApprovalModeChanged,
17180
+ "approval-mode-changed" /* ApprovalModeChanged */,
17198
17181
  this.handleApprovalModeChanged
17199
17182
  );
17200
- coreEvents.off(CoreEvent.RetryAttempt, this.handleRetryAttempt);
17183
+ coreEvents.off("retry-attempt" /* RetryAttempt */, this.handleRetryAttempt);
17201
17184
  this.disposeController.abort();
17202
17185
  if (this.context.config?.dispose) {
17203
17186
  try {
@@ -17291,7 +17274,7 @@ ${thought.description}`;
17291
17274
  await this.sendUpdate({
17292
17275
  sessionUpdate: "tool_call",
17293
17276
  toolCallId: toolCall.id,
17294
- status: toolCall.status === CoreToolCallStatus.Success ? "completed" : "failed",
17277
+ status: toolCall.status === "success" /* Success */ ? "completed" : "failed",
17295
17278
  title: toolCall.displayName || toolCall.name,
17296
17279
  content: toolCallContent,
17297
17280
  kind: tool ? toAcpToolKind(tool.kind) : "other"
@@ -17401,7 +17384,7 @@ ${thought.description}`;
17401
17384
  return { stopReason: "cancelled" };
17402
17385
  }
17403
17386
  switch (event.type) {
17404
- case GeminiEventType.Content: {
17387
+ case "content" /* Content */: {
17405
17388
  const content = {
17406
17389
  type: "text",
17407
17390
  text: event.value
@@ -17415,7 +17398,7 @@ ${thought.description}`;
17415
17398
  await this.sendUpdate(update);
17416
17399
  break;
17417
17400
  }
17418
- case GeminiEventType.Thought: {
17401
+ case "thought" /* Thought */: {
17419
17402
  const thoughtText = `**${event.value.subject}**
17420
17403
  ${event.value.description}`;
17421
17404
  await this.sendUpdate({
@@ -17424,7 +17407,7 @@ ${event.value.description}`;
17424
17407
  });
17425
17408
  break;
17426
17409
  }
17427
- case GeminiEventType.Retry: {
17410
+ case "retry" /* Retry */: {
17428
17411
  toolCallRequests.length = 0;
17429
17412
  debugLogger.warn(
17430
17413
  "Model stream interrupted mid-response; retrying prompt..."
@@ -17440,10 +17423,10 @@ ${event.value.description}`;
17440
17423
  isFirstChunkAfterRetry = true;
17441
17424
  break;
17442
17425
  }
17443
- case GeminiEventType.ToolCallRequest:
17426
+ case "tool_call_request" /* ToolCallRequest */:
17444
17427
  toolCallRequests.push(event.value);
17445
17428
  break;
17446
- case GeminiEventType.Finished: {
17429
+ case "finished" /* Finished */: {
17447
17430
  const usage2 = event.value.usageMetadata;
17448
17431
  if (usage2) {
17449
17432
  turnInputTokens = usage2.promptTokenCount ?? turnInputTokens;
@@ -17460,19 +17443,19 @@ ${event.value.description}`;
17460
17443
  }
17461
17444
  break;
17462
17445
  }
17463
- case GeminiEventType.ModelInfo:
17446
+ case "model_info" /* ModelInfo */:
17464
17447
  turnModelId = event.value;
17465
17448
  break;
17466
- case GeminiEventType.MaxSessionTurns:
17449
+ case "max_session_turns" /* MaxSessionTurns */:
17467
17450
  stopReason = "max_turn_requests";
17468
17451
  break;
17469
- case GeminiEventType.LoopDetected:
17452
+ case "loop_detected" /* LoopDetected */:
17470
17453
  stopReason = "max_turn_requests";
17471
17454
  break;
17472
- case GeminiEventType.ContextWindowWillOverflow:
17455
+ case "context_window_will_overflow" /* ContextWindowWillOverflow */:
17473
17456
  stopReason = "max_tokens";
17474
17457
  break;
17475
- case GeminiEventType.Error: {
17458
+ case "error" /* Error */: {
17476
17459
  const parseResult = StructuredErrorSchema.safeParse(
17477
17460
  event.value.error
17478
17461
  );
@@ -17663,7 +17646,7 @@ ${event.value.description}`;
17663
17646
  const output = RequestPermissionResponseSchema.parse(
17664
17647
  await this.connection.requestPermission(params)
17665
17648
  );
17666
- const outcome = output.outcome.outcome === "cancelled" ? ToolConfirmationOutcome.Cancel : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
17649
+ const outcome = output.outcome.outcome === "cancelled" ? "cancel" /* Cancel */ : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
17667
17650
  await confirmationDetails.onConfirm(outcome);
17668
17651
  await updatePolicy(
17669
17652
  tool,
@@ -17674,7 +17657,7 @@ ${event.value.description}`;
17674
17657
  invocation
17675
17658
  );
17676
17659
  switch (outcome) {
17677
- case ToolConfirmationOutcome.Cancel: {
17660
+ case "cancel" /* Cancel */: {
17678
17661
  const cancelError = new Error(
17679
17662
  `Tool "${fc.name}" was canceled by the user.`
17680
17663
  );
@@ -17692,12 +17675,12 @@ ${event.value.description}`;
17692
17675
  });
17693
17676
  return errorResponse(cancelError);
17694
17677
  }
17695
- case ToolConfirmationOutcome.ProceedOnce:
17696
- case ToolConfirmationOutcome.ProceedAlways:
17697
- case ToolConfirmationOutcome.ProceedAlwaysAndSave:
17698
- case ToolConfirmationOutcome.ProceedAlwaysServer:
17699
- case ToolConfirmationOutcome.ProceedAlwaysTool:
17700
- case ToolConfirmationOutcome.ModifyWithEditor:
17678
+ case "proceed_once" /* ProceedOnce */:
17679
+ case "proceed_always" /* ProceedAlways */:
17680
+ case "proceed_always_and_save" /* ProceedAlwaysAndSave */:
17681
+ case "proceed_always_server" /* ProceedAlwaysServer */:
17682
+ case "proceed_always_tool" /* ProceedAlwaysTool */:
17683
+ case "modify_with_editor" /* ModifyWithEditor */:
17701
17684
  break;
17702
17685
  default: {
17703
17686
  const resultOutcome = outcome;
@@ -17751,7 +17734,7 @@ ${event.value.description}`;
17751
17734
  );
17752
17735
  this.chat.recordCompletedToolCalls(this.context.config.getActiveModel(), [
17753
17736
  {
17754
- status: CoreToolCallStatus.Success,
17737
+ status: "success" /* Success */,
17755
17738
  request: {
17756
17739
  callId,
17757
17740
  name: fc.name,
@@ -17796,7 +17779,7 @@ ${event.value.description}`;
17796
17779
  });
17797
17780
  this.chat.recordCompletedToolCalls(this.context.config.getActiveModel(), [
17798
17781
  {
17799
- status: CoreToolCallStatus.Error,
17782
+ status: "error" /* Error */,
17800
17783
  request: {
17801
17784
  callId,
17802
17785
  name: fc.name,
@@ -17925,12 +17908,12 @@ ${event.value.description}`;
17925
17908
  sessionId: this.id,
17926
17909
  options: [
17927
17910
  {
17928
- optionId: ToolConfirmationOutcome.ProceedOnce,
17911
+ optionId: "proceed_once" /* ProceedOnce */,
17929
17912
  name: "Allow once",
17930
17913
  kind: "allow_once"
17931
17914
  },
17932
17915
  {
17933
- optionId: ToolConfirmationOutcome.Cancel,
17916
+ optionId: "cancel" /* Cancel */,
17934
17917
  name: "Deny",
17935
17918
  kind: "reject_once"
17936
17919
  }
@@ -17955,8 +17938,8 @@ ${event.value.description}`;
17955
17938
  const output = RequestPermissionResponseSchema.parse(
17956
17939
  await this.connection.requestPermission(params)
17957
17940
  );
17958
- const outcome = output.outcome.outcome === "cancelled" ? ToolConfirmationOutcome.Cancel : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
17959
- if (outcome === ToolConfirmationOutcome.ProceedOnce) {
17941
+ const outcome = output.outcome.outcome === "cancelled" ? "cancel" /* Cancel */ : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
17942
+ if (outcome === "proceed_once" /* ProceedOnce */) {
17960
17943
  this.context.config.getWorkspaceContext().addReadOnlyPath(absolutePath);
17961
17944
  validationError = null;
17962
17945
  } else {
@@ -18399,7 +18382,7 @@ var AcpSessionManager = class {
18399
18382
  mcpServers,
18400
18383
  loadedSettings
18401
18384
  );
18402
- const authType = loadedSettings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ? AuthType.GATEWAY : AuthType.USE_GEMINI);
18385
+ const authType = loadedSettings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ? "gateway" /* GATEWAY */ : "gemini-api-key" /* USE_GEMINI */);
18403
18386
  let isAuthenticated = false;
18404
18387
  let authErrorMessage = "";
18405
18388
  try {
@@ -18411,7 +18394,7 @@ var AcpSessionManager = class {
18411
18394
  );
18412
18395
  isAuthenticated = true;
18413
18396
  const contentGeneratorConfig = config.getContentGeneratorConfig();
18414
- if (authType === AuthType.USE_GEMINI && (!contentGeneratorConfig || !contentGeneratorConfig.apiKey)) {
18397
+ if (authType === "gemini-api-key" /* USE_GEMINI */ && (!contentGeneratorConfig || !contentGeneratorConfig.apiKey)) {
18415
18398
  isAuthenticated = false;
18416
18399
  authErrorMessage = "Gemini API key is missing or not configured.";
18417
18400
  }
@@ -18597,7 +18580,7 @@ var AcpSessionManager = class {
18597
18580
  }
18598
18581
  }
18599
18582
  async prepareSessionConfig(sessionId, cwd, mcpServers, authDetails) {
18600
- const selectedAuthType = this.settings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ? AuthType.GATEWAY : void 0);
18583
+ const selectedAuthType = this.settings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ? "gateway" /* GATEWAY */ : void 0);
18601
18584
  if (!selectedAuthType) {
18602
18585
  throw RequestError.authRequired();
18603
18586
  }
@@ -18709,12 +18692,12 @@ var GeminiAgent = class {
18709
18692
  }
18710
18693
  const authMethods = [
18711
18694
  {
18712
- id: AuthType.LOGIN_WITH_GOOGLE,
18695
+ id: "oauth-personal" /* LOGIN_WITH_GOOGLE */,
18713
18696
  name: "Log in with Google",
18714
18697
  description: "Log in with your Google account"
18715
18698
  },
18716
18699
  {
18717
- id: AuthType.USE_GEMINI,
18700
+ id: "gemini-api-key" /* USE_GEMINI */,
18718
18701
  name: "Gemini API key",
18719
18702
  description: "Use an API key with Gemini Developer API",
18720
18703
  _meta: {
@@ -18724,12 +18707,12 @@ var GeminiAgent = class {
18724
18707
  }
18725
18708
  },
18726
18709
  {
18727
- id: AuthType.USE_VERTEX_AI,
18710
+ id: "vertex-ai" /* USE_VERTEX_AI */,
18728
18711
  name: "Vertex AI",
18729
18712
  description: "Use an API key with Vertex AI GenAI API"
18730
18713
  },
18731
18714
  {
18732
- id: AuthType.GATEWAY,
18715
+ id: "gateway" /* GATEWAY */,
18733
18716
  name: "AI API Gateway",
18734
18717
  description: "Use a custom AI API Gateway",
18735
18718
  _meta: {
@@ -18902,7 +18885,7 @@ async function validateNonInteractiveAuth(configuredAuthType, useExternalAuth, n
18902
18885
  }
18903
18886
  return authType;
18904
18887
  } catch (error) {
18905
- if (nonInteractiveConfig.getOutputFormat() === OutputFormat.JSON) {
18888
+ if (nonInteractiveConfig.getOutputFormat() === "json" /* JSON */) {
18906
18889
  handleError(
18907
18890
  error instanceof Error ? error : new Error(String(error)),
18908
18891
  nonInteractiveConfig,
@@ -19101,10 +19084,10 @@ var SlashCommandConflictHandler = class {
19101
19084
  this.handleConflicts = this.handleConflicts.bind(this);
19102
19085
  }
19103
19086
  start() {
19104
- coreEvents.on(CoreEvent.SlashCommandConflicts, this.handleConflicts);
19087
+ coreEvents.on("slash-command-conflicts" /* SlashCommandConflicts */, this.handleConflicts);
19105
19088
  }
19106
19089
  stop() {
19107
- coreEvents.off(CoreEvent.SlashCommandConflicts, this.handleConflicts);
19090
+ coreEvents.off("slash-command-conflicts" /* SlashCommandConflicts */, this.handleConflicts);
19108
19091
  if (this.flushTimeout) {
19109
19092
  clearTimeout(this.flushTimeout);
19110
19093
  this.flushTimeout = null;
@@ -19479,7 +19462,7 @@ async function resolveSessionId(resumeArg, sessionIdArg, sessionFileArg) {
19479
19462
  }
19480
19463
  }
19481
19464
  async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
19482
- const { startInteractiveUI: doStartUI } = await import("./interactiveCli-UUF5EPF5.js");
19465
+ const { startInteractiveUI: doStartUI } = await import("./interactiveCli-NJEZNU22.js");
19483
19466
  await doStartUI(
19484
19467
  config,
19485
19468
  settings,
@@ -19582,12 +19565,12 @@ async function main() {
19582
19565
  dns.setDefaultResultOrder(
19583
19566
  validateDnsResolutionOrder(settings.merged.advanced.dnsResolutionOrder)
19584
19567
  );
19585
- if (!settings.merged.security.auth.selectedType || settings.merged.security.auth.selectedType === AuthType.LEGACY_CLOUD_SHELL) {
19568
+ if (!settings.merged.security.auth.selectedType || settings.merged.security.auth.selectedType === "cloud-shell" /* LEGACY_CLOUD_SHELL */) {
19586
19569
  if (process.env["CLOUD_SHELL"] === "true" || process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true") {
19587
19570
  settings.setValue(
19588
19571
  "User" /* User */,
19589
19572
  "security.auth.selectedType",
19590
- AuthType.COMPUTE_ADC
19573
+ "compute-default-credentials" /* COMPUTE_ADC */
19591
19574
  );
19592
19575
  }
19593
19576
  }
@@ -19714,7 +19697,7 @@ ${finalArgs[promptIndex + 1]}`;
19714
19697
  await config.storage.initialize();
19715
19698
  adminControlsListner.setConfig(config);
19716
19699
  if (config.isInteractive() && settings.merged.general.devtools) {
19717
- const { setupInitialActivityLogger } = await import("./devtoolsService-XNGB5DAQ.js");
19700
+ const { setupInitialActivityLogger } = await import("./devtoolsService-Y7BMPXKB.js");
19718
19701
  setupInitialActivityLogger(config);
19719
19702
  }
19720
19703
  registerTelemetryConfig(config);
@@ -19722,7 +19705,7 @@ ${finalArgs[promptIndex + 1]}`;
19722
19705
  const messageBus = config.getMessageBus();
19723
19706
  createPolicyUpdater2(policyEngine, messageBus, config.storage);
19724
19707
  registerCleanup(async () => {
19725
- await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
19708
+ await config?.getHookSystem()?.fireSessionEndEvent("exit" /* Exit */);
19726
19709
  });
19727
19710
  if (!config.getAcpMode()) {
19728
19711
  registerCleanup(consolePatcher.cleanup);
@@ -19773,7 +19756,7 @@ ${finalArgs[promptIndex + 1]}`;
19773
19756
  const initAppHandle = startupProfiler.start("initialize_app");
19774
19757
  const initializationResult = await initializeApp(config, settings);
19775
19758
  initAppHandle?.end();
19776
- import("./liteRtServerManager-BEHQ2LRW.js").then(({ LiteRtServerManager }) => {
19759
+ import("./liteRtServerManager-YWW2KXDB.js").then(({ LiteRtServerManager }) => {
19777
19760
  const mergedGemma = settings.merged.experimental?.gemmaModelRouter;
19778
19761
  if (!mergedGemma) return;
19779
19762
  const userGemma = settings.forScope("User" /* User */).settings.experimental?.gemmaModelRouter;
@@ -19783,7 +19766,7 @@ ${finalArgs[promptIndex + 1]}`;
19783
19766
  autoStartServer: userGemma?.autoStartServer
19784
19767
  });
19785
19768
  }).catch((e) => debugLogger.warn("LiteRT auto-start import failed:", e));
19786
- if (settings.merged.security.auth.selectedType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
19769
+ if (settings.merged.security.auth.selectedType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
19787
19770
  await getOauthClient(settings.merged.security.auth.selectedType, config);
19788
19771
  }
19789
19772
  if (config.getAcpMode()) {
@@ -19799,7 +19782,7 @@ ${finalArgs[promptIndex + 1]}`;
19799
19782
  ...rawStartupWarnings.map((message) => ({
19800
19783
  id: `startup-${createHash2("sha256").update(message).digest("hex").substring(0, 16)}`,
19801
19784
  message,
19802
- priority: WarningPriority.High
19785
+ priority: "high" /* High */
19803
19786
  })),
19804
19787
  ...await getUserStartupWarnings(settings.merged, void 0, {
19805
19788
  isAlternateBuffer: useAlternateBuffer
@@ -19836,7 +19819,7 @@ ${finalArgs[promptIndex + 1]}`;
19836
19819
  ${input}` : stdinData;
19837
19820
  }
19838
19821
  }
19839
- const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
19822
+ const sessionStartSource = resumedSessionData ? "resume" /* Resume */ : "startup" /* Startup */;
19840
19823
  const hookSystem = config?.getHookSystem();
19841
19824
  if (hookSystem) {
19842
19825
  const result = await hookSystem.fireSessionStartEvent(sessionStartSource);
@@ -19893,8 +19876,8 @@ ${input}` : wrappedContext;
19893
19876
  }
19894
19877
  }
19895
19878
  function initializeOutputListenersAndFlush(config) {
19896
- if (coreEvents.listenerCount(CoreEvent.Output) === 0) {
19897
- coreEvents.on(CoreEvent.Output, (payload) => {
19879
+ if (coreEvents.listenerCount("output" /* Output */) === 0) {
19880
+ coreEvents.on("output" /* Output */, (payload) => {
19898
19881
  if (payload.isStderr) {
19899
19882
  writeToStderr(payload.chunk, payload.encoding);
19900
19883
  } else {
@@ -19902,8 +19885,8 @@ function initializeOutputListenersAndFlush(config) {
19902
19885
  }
19903
19886
  });
19904
19887
  }
19905
- if (coreEvents.listenerCount(CoreEvent.ConsoleLog) === 0) {
19906
- coreEvents.on(CoreEvent.ConsoleLog, (payload) => {
19888
+ if (coreEvents.listenerCount("console-log" /* ConsoleLog */) === 0) {
19889
+ coreEvents.on("console-log" /* ConsoleLog */, (payload) => {
19907
19890
  if (payload.type === "error" || payload.type === "warn") {
19908
19891
  writeToStderr(payload.content + "\n");
19909
19892
  } else {
@@ -19911,8 +19894,8 @@ function initializeOutputListenersAndFlush(config) {
19911
19894
  }
19912
19895
  });
19913
19896
  }
19914
- if (coreEvents.listenerCount(CoreEvent.UserFeedback) === 0) {
19915
- coreEvents.on(CoreEvent.UserFeedback, (payload) => {
19897
+ if (coreEvents.listenerCount("user-feedback" /* UserFeedback */) === 0) {
19898
+ coreEvents.on("user-feedback" /* UserFeedback */, (payload) => {
19916
19899
  writeToStderr(payload.message + "\n");
19917
19900
  });
19918
19901
  }
@@ -19920,7 +19903,7 @@ function initializeOutputListenersAndFlush(config) {
19920
19903
  const forceToStderr = outputFormat === "json";
19921
19904
  coreEvents.drainBacklogs(
19922
19905
  (event, args) => {
19923
- if (forceToStderr && event === CoreEvent.Output) {
19906
+ if (forceToStderr && event === "output" /* Output */) {
19924
19907
  const payload = args[0];
19925
19908
  if (!payload.isStderr) {
19926
19909
  return {