@google/gemini-cli 0.71.0-nightly.20261123.geecccfcd5 → 0.72.0-preview.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 (74) hide show
  1. package/bundle/{chunk-74F5ZRXI.js → chunk-2LHOWVR4.js} +2 -2
  2. package/bundle/{chunk-NBZ3S2OI.js → chunk-357SHFSP.js} +1 -1
  3. package/bundle/{chunk-DNLZQS6M.js → chunk-5URPLR2H.js} +1 -1
  4. package/bundle/{chunk-6FOUJKOM.js → chunk-7554FKWM.js} +4 -4
  5. package/bundle/{chunk-YHOSX4HX.js → chunk-7ZTBMXIU.js} +2 -2
  6. package/bundle/{chunk-L2ISE4LK.js → chunk-AJWHZBWZ.js} +6 -8
  7. package/bundle/{chunk-66M6QVYR.js → chunk-BRYTKVAX.js} +4 -4
  8. package/bundle/{chunk-DWF6VLET.js → chunk-BZ5FSDRR.js} +3 -3
  9. package/bundle/{chunk-6MLLHGAR.js → chunk-CIX33OUZ.js} +2 -2
  10. package/bundle/{chunk-3IQPEEFT.js → chunk-DDPEWL4G.js} +1 -1
  11. package/bundle/{chunk-RJEQTG6S.js → chunk-DIMNI6AC.js} +2 -2
  12. package/bundle/{chunk-QADAHCRT.js → chunk-ENSJIXBN.js} +1 -1
  13. package/bundle/{chunk-L2B5JJZC.js → chunk-EUWUJXIY.js} +1 -1
  14. package/bundle/{chunk-BTUHEN4Y.js → chunk-IGFGTPGV.js} +1 -1
  15. package/bundle/{chunk-YYWNIP3F.js → chunk-JTWV2RYT.js} +1 -1
  16. package/bundle/{chunk-GNXMAFUR.js → chunk-MNOSCPOM.js} +7 -7
  17. package/bundle/{chunk-A3SNIZ4K.js → chunk-N4ZMA5CZ.js} +1 -1
  18. package/bundle/{chunk-BVNLNGFD.js → chunk-QESC7SGF.js} +7 -7
  19. package/bundle/{chunk-4DJQWGT3.js → chunk-SJKJH5QA.js} +1 -1
  20. package/bundle/{chunk-QWS2TBZG.js → chunk-SMYIRL3Y.js} +3 -3
  21. package/bundle/{chunk-3OVOJOQV.js → chunk-TLQ4STKV.js} +58 -71
  22. package/bundle/{chunk-YEEWGYBU.js → chunk-UUAR3JIA.js} +2 -2
  23. package/bundle/{chunk-EUUDSNXQ.js → chunk-WHSJKDVL.js} +1 -1
  24. package/bundle/{chunk-PL6IIPTX.js → chunk-XER4IQTC.js} +1 -1
  25. package/bundle/{chunk-NLZKOWER.js → chunk-Y2AE7RGI.js} +8 -9
  26. package/bundle/{chunk-6NXCSVSN.js → chunk-YFNHROPZ.js} +15422 -8067
  27. package/bundle/{chunk-SLTPPXVT.js → chunk-Z4LLSOJM.js} +3 -3
  28. package/bundle/{cleanup-JXHWEYF4.js → cleanup-A7CTJL7Z.js} +2 -2
  29. package/bundle/{cleanup-NXI65SJI.js → cleanup-ACKRM2TX.js} +2 -2
  30. package/bundle/{cleanup-PQFQN5PN.js → cleanup-DSTWENO3.js} +2 -2
  31. package/bundle/{dist-YWJAC3IM.js → core-3V44EMV6.js} +1 -1
  32. package/bundle/{core-DQSJHYG4.js → core-UF6OK2YN.js} +1 -1
  33. package/bundle/{devtoolsService-CVJOOHGM.js → devtoolsService-7MR7MUMD.js} +2 -2
  34. package/bundle/{devtoolsService-NOXMAH56.js → devtoolsService-NP7EGEMK.js} +2 -2
  35. package/bundle/{devtoolsService-UZFFGBEG.js → devtoolsService-Q5HYPUU7.js} +3 -4
  36. package/bundle/{dist-G5K3DGI7.js → dist-J3MSC3FF.js} +1 -1
  37. package/bundle/{formatError-CAMIQWHM.js → formatError-EFFRJTZP.js} +2 -2
  38. package/bundle/{formatError-PB6SEHWE.js → formatError-RG2BTO6O.js} +2 -2
  39. package/bundle/{formatError-Q33TSKEK.js → formatError-RZ6FNHFK.js} +2 -2
  40. package/bundle/{gemini-QKY2KKYF.js → gemini-5N7SJRYD.js} +208 -224
  41. package/bundle/{gemini-TQYJRVJP.js → gemini-DQYZ2M5M.js} +14 -14
  42. package/bundle/{gemini-OAKFBKMR.js → gemini-NGMQM6D3.js} +15 -15
  43. package/bundle/gemini.js +8 -8
  44. package/bundle/{interactiveCli-L5IOZTYF.js → interactiveCli-3QAMPJPK.js} +8 -8
  45. package/bundle/{interactiveCli-3FEZU7GJ.js → interactiveCli-DBUWQW3L.js} +300 -319
  46. package/bundle/{interactiveCli-W4IK4C6F.js → interactiveCli-M2IE6ZF4.js} +8 -8
  47. package/bundle/{liteRtServerManager-7GQLUYCC.js → liteRtServerManager-LX6B5CI3.js} +4 -4
  48. package/bundle/{liteRtServerManager-GSYRGOB6.js → liteRtServerManager-TI6LO5RU.js} +4 -4
  49. package/bundle/{liteRtServerManager-TVKXINGU.js → liteRtServerManager-TW3MMGOA.js} +4 -4
  50. package/bundle/{oauth2-provider-XADKJYM3.js → oauth2-provider-2JRAM5FI.js} +1 -1
  51. package/bundle/{oauth2-provider-JAYH53PG.js → oauth2-provider-3PBBHV75.js} +1 -1
  52. package/bundle/{oauth2-provider-LZKJKLFG.js → oauth2-provider-PG5AFZDD.js} +79 -41
  53. package/bundle/{start-4GERR54C.js → start-2XM3XTTW.js} +6 -6
  54. package/bundle/{start-5Q2AJMC5.js → start-HGHTVHPT.js} +6 -6
  55. package/bundle/{start-7ZXOELXX.js → start-TDNB5CJ6.js} +6 -6
  56. package/package.json +1 -1
  57. package/bundle/chunk-5VAAW2SW.js +0 -118
  58. package/bundle/chunk-CPZ55WK4.js +0 -40031
  59. package/bundle/chunk-GPIHTZ7M.js +0 -190
  60. package/bundle/chunk-IOX7QOR4.js +0 -1962
  61. package/bundle/chunk-M2J4XK5W.js +0 -60338
  62. package/bundle/chunk-OSBXDFYN.js +0 -512
  63. package/bundle/chunk-TE62WOO3.js +0 -65
  64. package/bundle/chunk-VTIY77BF.js +0 -1571
  65. package/bundle/chunk-Y3VJ5NLZ.js +0 -420386
  66. package/bundle/cleanup-UNQWTWUR.js +0 -34
  67. package/bundle/devtoolsService-OCTFSUNQ.js +0 -919
  68. package/bundle/dist-GPX2ZA4V.js +0 -2372
  69. package/bundle/formatError-QRSNJJ27.js +0 -14
  70. package/bundle/gemini-Z66TS6IL.js +0 -20021
  71. package/bundle/interactiveCli-DBDBYD65.js +0 -36447
  72. package/bundle/liteRtServerManager-YUBDDMLI.js +0 -65
  73. package/bundle/oauth2-provider-ZOXGSM7Y.js +0 -273
  74. package/bundle/start-O7HDURUW.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-DWF6VLET.js";
5
+ } from "./chunk-Z4LLSOJM.js";
6
6
  import {
7
7
  formatCliError
8
- } from "./chunk-DNLZQS6M.js";
8
+ } from "./chunk-5URPLR2H.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-GNXMAFUR.js";
52
+ } from "./chunk-QESC7SGF.js";
53
53
  import {
54
54
  exitCli,
55
55
  require_source
56
- } from "./chunk-L2B5JJZC.js";
56
+ } from "./chunk-EUWUJXIY.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-YHOSX4HX.js";
96
+ } from "./chunk-2LHOWVR4.js";
97
97
  import {
98
98
  RELAUNCH_EXIT_CODE,
99
99
  isIPCAvailable,
100
100
  require_semver
101
- } from "./chunk-6MLLHGAR.js";
102
- import "./chunk-NBZ3S2OI.js";
101
+ } from "./chunk-UUAR3JIA.js";
102
+ import "./chunk-Y2AE7RGI.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-BTUHEN4Y.js";
111
+ } from "./chunk-DDPEWL4G.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-6NXCSVSN.js";
293
+ } from "./chunk-7554FKWM.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.20261123.geecccfcd5" ?? customImage ?? packageJson?.config?.sandboxImageUri;
8459
+ const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.72.0-preview.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
  }
@@ -8532,9 +8516,9 @@ async function resolveWorkspacePolicyState(options) {
8532
8516
  cwd,
8533
8517
  potentialWorkspacePoliciesDir
8534
8518
  );
8535
- if (integrityResult.status === IntegrityStatus.MATCH) {
8519
+ if (integrityResult.status === "MATCH" /* MATCH */) {
8536
8520
  workspacePoliciesDir = potentialWorkspacePoliciesDir;
8537
- } else if (integrityResult.status === IntegrityStatus.NEW && integrityResult.fileCount === 0) {
8521
+ } else if (integrityResult.status === "NEW" /* NEW */ && integrityResult.fileCount === 0) {
8538
8522
  workspacePoliciesDir = void 0;
8539
8523
  } else if (interactive && !autoAcceptWorkspacePolicies) {
8540
8524
  policyUpdateConfirmationRequest = {
@@ -9004,23 +8988,23 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
9004
8988
  if (rawApprovalMode) {
9005
8989
  switch (rawApprovalMode) {
9006
8990
  case "yolo":
9007
- approvalMode = ApprovalMode.YOLO;
8991
+ approvalMode = "yolo" /* YOLO */;
9008
8992
  break;
9009
8993
  case "auto_edit":
9010
- approvalMode = ApprovalMode.AUTO_EDIT;
8994
+ approvalMode = "autoEdit" /* AUTO_EDIT */;
9011
8995
  break;
9012
8996
  case "plan":
9013
8997
  if (!(settings.general?.plan?.enabled ?? true)) {
9014
8998
  debugLogger.warn(
9015
8999
  'Approval mode "plan" is disabled in your settings. Falling back to "default".'
9016
9000
  );
9017
- approvalMode = ApprovalMode.DEFAULT;
9001
+ approvalMode = "default" /* DEFAULT */;
9018
9002
  } else {
9019
- approvalMode = ApprovalMode.PLAN;
9003
+ approvalMode = "plan" /* PLAN */;
9020
9004
  }
9021
9005
  break;
9022
9006
  case "default":
9023
- approvalMode = ApprovalMode.DEFAULT;
9007
+ approvalMode = "default" /* DEFAULT */;
9024
9008
  break;
9025
9009
  default:
9026
9010
  throw new Error(
@@ -9028,10 +9012,10 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
9028
9012
  );
9029
9013
  }
9030
9014
  } else {
9031
- approvalMode = ApprovalMode.DEFAULT;
9015
+ approvalMode = "default" /* DEFAULT */;
9032
9016
  }
9033
9017
  if (settings.security?.disableYoloMode || settings.admin?.secureModeEnabled) {
9034
- if (approvalMode === ApprovalMode.YOLO) {
9018
+ if (approvalMode === "yolo" /* YOLO */) {
9035
9019
  if (settings.admin?.secureModeEnabled) {
9036
9020
  debugLogger.error(
9037
9021
  'YOLO mode is disabled by "secureModeEnabled" setting.'
@@ -9049,16 +9033,16 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
9049
9033
  )
9050
9034
  );
9051
9035
  }
9052
- } else if (approvalMode === ApprovalMode.YOLO) {
9036
+ } else if (approvalMode === "yolo" /* YOLO */) {
9053
9037
  debugLogger.warn(
9054
9038
  "YOLO mode is enabled. All tool calls will be automatically approved."
9055
9039
  );
9056
9040
  }
9057
- if (!trustedFolder && approvalMode !== ApprovalMode.DEFAULT) {
9041
+ if (!trustedFolder && approvalMode !== "default" /* DEFAULT */) {
9058
9042
  debugLogger.warn(
9059
9043
  `Approval mode overridden to "default" because the current folder is not trusted.`
9060
9044
  );
9061
- approvalMode = ApprovalMode.DEFAULT;
9045
+ approvalMode = "default" /* DEFAULT */;
9062
9046
  }
9063
9047
  let telemetrySettings;
9064
9048
  try {
@@ -13048,11 +13032,11 @@ var TRUST_WORKSPACE_ENV = "GEMINI_CLI_TRUST_WORKSPACE";
13048
13032
  function parseTrustChoice(answer) {
13049
13033
  switch (answer.trim()) {
13050
13034
  case "1":
13051
- return TrustLevel.TRUST_FOLDER;
13035
+ return "TRUST_FOLDER" /* TRUST_FOLDER */;
13052
13036
  case "2":
13053
- return TrustLevel.TRUST_PARENT;
13037
+ return "TRUST_PARENT" /* TRUST_PARENT */;
13054
13038
  case "3":
13055
- return TrustLevel.DO_NOT_TRUST;
13039
+ return "DO_NOT_TRUST" /* DO_NOT_TRUST */;
13056
13040
  default:
13057
13041
  return void 0;
13058
13042
  }
@@ -13090,7 +13074,7 @@ async function resolveFolderTrustForSandbox({
13090
13074
  } catch {
13091
13075
  throw new FatalConfigError("Failed to save trust settings.");
13092
13076
  }
13093
- isTrusted = trustLevel !== TrustLevel.DO_NOT_TRUST;
13077
+ isTrusted = trustLevel !== "DO_NOT_TRUST" /* DO_NOT_TRUST */;
13094
13078
  }
13095
13079
  process.env[TRUST_WORKSPACE_ENV] = isTrusted ? "true" : "false";
13096
13080
  }
@@ -13224,7 +13208,7 @@ import path13 from "node:path";
13224
13208
  import process5 from "node:process";
13225
13209
  var homeDirectoryCheck = {
13226
13210
  id: "home-directory",
13227
- priority: WarningPriority.Low,
13211
+ priority: "low" /* Low */,
13228
13212
  check: async (workspaceRoot, settings) => {
13229
13213
  if (settings.ui?.showHomeDirectoryWarning === false) {
13230
13214
  return null;
@@ -13248,7 +13232,7 @@ var homeDirectoryCheck = {
13248
13232
  };
13249
13233
  var rootDirectoryCheck = {
13250
13234
  id: "root-directory",
13251
- priority: WarningPriority.High,
13235
+ priority: "high" /* High */,
13252
13236
  check: async (workspaceRoot, _settings) => {
13253
13237
  try {
13254
13238
  const workspaceRealPath = await fs10.realpath(workspaceRoot);
@@ -13264,7 +13248,7 @@ var rootDirectoryCheck = {
13264
13248
  };
13265
13249
  var folderTrustCheck = {
13266
13250
  id: "folder-trust",
13267
- priority: WarningPriority.High,
13251
+ priority: "high" /* High */,
13268
13252
  check: async (workspaceRoot, settings) => {
13269
13253
  if (!isFolderTrustEnabled(settings)) {
13270
13254
  return null;
@@ -13454,12 +13438,12 @@ function handleError(error, config, customErrorCode) {
13454
13438
  error,
13455
13439
  config.getContentGeneratorConfig()?.authType
13456
13440
  );
13457
- if (config.getOutputFormat() === OutputFormat.STREAM_JSON) {
13441
+ if (config.getOutputFormat() === "stream-json" /* STREAM_JSON */) {
13458
13442
  const streamFormatter = new StreamJsonFormatter();
13459
13443
  const errorCode = customErrorCode ?? extractErrorCode(error);
13460
13444
  const metrics = uiTelemetryService.getMetrics();
13461
13445
  streamFormatter.emitEvent({
13462
- type: JsonStreamEventType.RESULT,
13446
+ type: "result" /* RESULT */,
13463
13447
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13464
13448
  status: "error",
13465
13449
  error: {
@@ -13470,7 +13454,7 @@ function handleError(error, config, customErrorCode) {
13470
13454
  });
13471
13455
  runSyncCleanup();
13472
13456
  process.exit(getNumericExitCode(errorCode));
13473
- } else if (config.getOutputFormat() === OutputFormat.JSON) {
13457
+ } else if (config.getOutputFormat() === "json" /* JSON */) {
13474
13458
  const formatter = new JsonFormatter();
13475
13459
  const errorCode = customErrorCode ?? extractErrorCode(error);
13476
13460
  const formattedError = formatter.formatError(
@@ -13490,11 +13474,11 @@ function handleToolError(toolName, toolError, config, errorType, resultDisplay)
13490
13474
  const isFatal = isFatalToolError(errorType);
13491
13475
  if (isFatal) {
13492
13476
  const toolExecutionError = new FatalToolExecutionError(errorMessage);
13493
- if (config.getOutputFormat() === OutputFormat.STREAM_JSON) {
13477
+ if (config.getOutputFormat() === "stream-json" /* STREAM_JSON */) {
13494
13478
  const streamFormatter = new StreamJsonFormatter();
13495
13479
  const metrics = uiTelemetryService.getMetrics();
13496
13480
  streamFormatter.emitEvent({
13497
- type: JsonStreamEventType.RESULT,
13481
+ type: "result" /* RESULT */,
13498
13482
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13499
13483
  status: "error",
13500
13484
  error: {
@@ -13503,7 +13487,7 @@ function handleToolError(toolName, toolError, config, errorType, resultDisplay)
13503
13487
  },
13504
13488
  stats: streamFormatter.convertToStreamStats(metrics, 0)
13505
13489
  });
13506
- } else if (config.getOutputFormat() === OutputFormat.JSON) {
13490
+ } else if (config.getOutputFormat() === "json" /* JSON */) {
13507
13491
  const formatter = new JsonFormatter();
13508
13492
  const formattedError = formatter.formatError(
13509
13493
  toolExecutionError,
@@ -13524,11 +13508,11 @@ function handleCancellationError(config, exitCode = 130) {
13524
13508
  "Operation cancelled.",
13525
13509
  exitCode
13526
13510
  );
13527
- if (config.getOutputFormat() === OutputFormat.STREAM_JSON) {
13511
+ if (config.getOutputFormat() === "stream-json" /* STREAM_JSON */) {
13528
13512
  const streamFormatter = new StreamJsonFormatter();
13529
13513
  const metrics = uiTelemetryService.getMetrics();
13530
13514
  streamFormatter.emitEvent({
13531
- type: JsonStreamEventType.RESULT,
13515
+ type: "result" /* RESULT */,
13532
13516
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13533
13517
  status: "error",
13534
13518
  error: {
@@ -13539,7 +13523,7 @@ function handleCancellationError(config, exitCode = 130) {
13539
13523
  });
13540
13524
  runSyncCleanup();
13541
13525
  process.exit(cancellationError.exitCode);
13542
- } else if (config.getOutputFormat() === OutputFormat.JSON) {
13526
+ } else if (config.getOutputFormat() === "json" /* JSON */) {
13543
13527
  const formatter = new JsonFormatter();
13544
13528
  const formattedError = formatter.formatError(
13545
13529
  cancellationError,
@@ -13559,11 +13543,11 @@ function handleMaxTurnsExceededError(config) {
13559
13543
  const maxTurnsError = new FatalTurnLimitedError(
13560
13544
  "Reached max session turns for this session. Increase the number of turns by specifying maxSessionTurns in settings.json."
13561
13545
  );
13562
- if (config.getOutputFormat() === OutputFormat.STREAM_JSON) {
13546
+ if (config.getOutputFormat() === "stream-json" /* STREAM_JSON */) {
13563
13547
  const streamFormatter = new StreamJsonFormatter();
13564
13548
  const metrics = uiTelemetryService.getMetrics();
13565
13549
  streamFormatter.emitEvent({
13566
- type: JsonStreamEventType.RESULT,
13550
+ type: "result" /* RESULT */,
13567
13551
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13568
13552
  status: "error",
13569
13553
  error: {
@@ -13574,7 +13558,7 @@ function handleMaxTurnsExceededError(config) {
13574
13558
  });
13575
13559
  runSyncCleanup();
13576
13560
  process.exit(maxTurnsError.exitCode);
13577
- } else if (config.getOutputFormat() === OutputFormat.JSON) {
13561
+ } else if (config.getOutputFormat() === "json" /* JSON */) {
13578
13562
  const formatter = new JsonFormatter();
13579
13563
  const formattedError = formatter.formatError(
13580
13564
  maxTurnsError,
@@ -13657,7 +13641,7 @@ async function runNonInteractive({
13657
13641
  }
13658
13642
  });
13659
13643
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
13660
- const { setupInitialActivityLogger } = await import("./devtoolsService-OCTFSUNQ.js");
13644
+ const { setupInitialActivityLogger } = await import("./devtoolsService-NP7EGEMK.js");
13661
13645
  setupInitialActivityLogger(config);
13662
13646
  }
13663
13647
  const { stdout: workingStdout } = createWorkingStdio();
@@ -13673,7 +13657,7 @@ async function runNonInteractive({
13673
13657
  }
13674
13658
  };
13675
13659
  const startTime = Date.now();
13676
- const streamFormatter = config.getOutputFormat() === OutputFormat.STREAM_JSON ? new StreamJsonFormatter() : null;
13660
+ const streamFormatter = config.getOutputFormat() === "stream-json" /* STREAM_JSON */ ? new StreamJsonFormatter() : null;
13677
13661
  const abortController = new AbortController();
13678
13662
  let isAborting = false;
13679
13663
  let cancelMessageTimer = null;
@@ -13759,13 +13743,13 @@ async function runNonInteractive({
13759
13743
  };
13760
13744
  try {
13761
13745
  consolePatcher.patch();
13762
- if (config.getRawOutput() && !config.getAcceptRawOutputRisk() && config.getOutputFormat() === OutputFormat.TEXT) {
13746
+ if (config.getRawOutput() && !config.getAcceptRawOutputRisk() && config.getOutputFormat() === "text" /* TEXT */) {
13763
13747
  process.stderr.write(
13764
13748
  "[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
13749
  );
13766
13750
  }
13767
13751
  setupCancellation();
13768
- coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
13752
+ coreEvents.on("user-feedback" /* UserFeedback */, handleUserFeedback);
13769
13753
  coreEvents.drainBacklogs();
13770
13754
  process.stdout.on("error", handleStdoutError);
13771
13755
  const geminiClient = config.getGeminiClient();
@@ -13785,7 +13769,7 @@ async function runNonInteractive({
13785
13769
  }
13786
13770
  if (streamFormatter) {
13787
13771
  streamFormatter.emitEvent({
13788
- type: JsonStreamEventType.INIT,
13772
+ type: "init" /* INIT */,
13789
13773
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13790
13774
  session_id: config.getSessionId(),
13791
13775
  model: config.getModel()
@@ -13823,7 +13807,7 @@ async function runNonInteractive({
13823
13807
  }
13824
13808
  if (streamFormatter) {
13825
13809
  streamFormatter.emitEvent({
13826
- type: JsonStreamEventType.MESSAGE,
13810
+ type: "message" /* MESSAGE */,
13827
13811
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13828
13812
  role: "user",
13829
13813
  content: input
@@ -13862,12 +13846,12 @@ async function runNonInteractive({
13862
13846
  const metrics = uiTelemetryService.getMetrics();
13863
13847
  const durationMs = Date.now() - startTime;
13864
13848
  streamFormatter.emitEvent({
13865
- type: JsonStreamEventType.RESULT,
13849
+ type: "result" /* RESULT */,
13866
13850
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13867
13851
  status: errorPayload ? "error" : "success",
13868
13852
  stats: streamFormatter.convertToStreamStats(metrics, durationMs)
13869
13853
  });
13870
- } else if (config.getOutputFormat() === OutputFormat.JSON) {
13854
+ } else if (config.getOutputFormat() === "json" /* JSON */) {
13871
13855
  const formatter = new JsonFormatter();
13872
13856
  const stats = uiTelemetryService.getMetrics();
13873
13857
  textOutput.write(
@@ -13959,13 +13943,13 @@ async function runNonInteractive({
13959
13943
  const output = isRaw ? part.text : stripAnsi(part.text);
13960
13944
  if (streamFormatter) {
13961
13945
  streamFormatter.emitEvent({
13962
- type: JsonStreamEventType.MESSAGE,
13946
+ type: "message" /* MESSAGE */,
13963
13947
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13964
13948
  role: "assistant",
13965
13949
  content: output,
13966
13950
  delta: true
13967
13951
  });
13968
- } else if (config.getOutputFormat() === OutputFormat.JSON) {
13952
+ } else if (config.getOutputFormat() === "json" /* JSON */) {
13969
13953
  responseText += output;
13970
13954
  } else {
13971
13955
  if (part.text) {
@@ -13978,13 +13962,13 @@ async function runNonInteractive({
13978
13962
  break;
13979
13963
  }
13980
13964
  case "tool_request": {
13981
- if (config.getOutputFormat() === OutputFormat.JSON) {
13965
+ if (config.getOutputFormat() === "json" /* JSON */) {
13982
13966
  preToolResponseText = responseText || preToolResponseText;
13983
13967
  responseText = "";
13984
13968
  }
13985
13969
  if (streamFormatter) {
13986
13970
  streamFormatter.emitEvent({
13987
- type: JsonStreamEventType.TOOL_USE,
13971
+ type: "tool_use" /* TOOL_USE */,
13988
13972
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13989
13973
  tool_name: event.name,
13990
13974
  tool_id: event.requestId,
@@ -14000,7 +13984,7 @@ async function runNonInteractive({
14000
13984
  const displayText = displayContentToString(display);
14001
13985
  const errorMsg = getTextContent(event.content) ?? "Tool error";
14002
13986
  streamFormatter.emitEvent({
14003
- type: JsonStreamEventType.TOOL_RESULT,
13987
+ type: "tool_result" /* TOOL_RESULT */,
14004
13988
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14005
13989
  tool_id: event.requestId,
14006
13990
  status: event.isError ? "error" : "success",
@@ -14015,17 +13999,17 @@ async function runNonInteractive({
14015
13999
  const display = event.display?.result;
14016
14000
  const displayText = displayContentToString(display);
14017
14001
  const errorMsg = getTextContent(event.content) ?? "Tool error";
14018
- if (event.data?.["errorType"] === ToolErrorType.STOP_EXECUTION) {
14019
- if (config.getOutputFormat() === OutputFormat.JSON && !responseText && preToolResponseText) {
14002
+ if (event.data?.["errorType"] === "stop_execution" /* STOP_EXECUTION */) {
14003
+ if (config.getOutputFormat() === "json" /* JSON */ && !responseText && preToolResponseText) {
14020
14004
  responseText = preToolResponseText;
14021
14005
  }
14022
14006
  const stopMessage = `Agent execution stopped: ${errorMsg}`;
14023
- if (config.getOutputFormat() === OutputFormat.TEXT) {
14007
+ if (config.getOutputFormat() === "text" /* TEXT */) {
14024
14008
  process.stderr.write(`${stopMessage}
14025
14009
  `);
14026
14010
  }
14027
14011
  }
14028
- if (event.data?.["errorType"] === ToolErrorType.NO_SPACE_LEFT) {
14012
+ if (event.data?.["errorType"] === "no_space_left" /* NO_SPACE_LEFT */) {
14029
14013
  throw new FatalToolExecutionError(
14030
14014
  "Error executing tool " + event.name + ": " + (displayText || errorMsg)
14031
14015
  );
@@ -14060,12 +14044,12 @@ async function runNonInteractive({
14060
14044
  }
14061
14045
  if (streamFormatter) {
14062
14046
  streamFormatter.emitEvent({
14063
- type: JsonStreamEventType.ERROR,
14047
+ type: "error" /* ERROR */,
14064
14048
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14065
14049
  severity: "error",
14066
14050
  message: errorMessage
14067
14051
  });
14068
- } else if (config.getOutputFormat() === OutputFormat.TEXT) {
14052
+ } else if (config.getOutputFormat() === "text" /* TEXT */) {
14069
14053
  process.stderr.write(`[ERROR] ${errorMessage}
14070
14054
  `);
14071
14055
  }
@@ -14086,12 +14070,12 @@ async function runNonInteractive({
14086
14070
  const errorCode = event._meta?.["code"];
14087
14071
  if (errorCode === "AGENT_EXECUTION_BLOCKED") {
14088
14072
  const blockMessage = `Agent execution blocked: ${event.message.trim()}`;
14089
- if (config.getOutputFormat() === OutputFormat.TEXT) {
14073
+ if (config.getOutputFormat() === "text" /* TEXT */) {
14090
14074
  process.stderr.write(`[WARNING] ${blockMessage}
14091
14075
  `);
14092
14076
  } else if (streamFormatter) {
14093
14077
  streamFormatter.emitEvent({
14094
- type: JsonStreamEventType.ERROR,
14078
+ type: "error" /* ERROR */,
14095
14079
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14096
14080
  severity: "warning",
14097
14081
  message: stripAnsi(blockMessage)
@@ -14101,13 +14085,13 @@ async function runNonInteractive({
14101
14085
  break;
14102
14086
  }
14103
14087
  const severity = event.status === "RESOURCE_EXHAUSTED" ? "error" : "warning";
14104
- if (config.getOutputFormat() === OutputFormat.TEXT) {
14088
+ if (config.getOutputFormat() === "text" /* TEXT */) {
14105
14089
  process.stderr.write(`[WARNING] ${event.message}
14106
14090
  `);
14107
14091
  }
14108
14092
  if (streamFormatter) {
14109
14093
  streamFormatter.emitEvent({
14110
- type: JsonStreamEventType.ERROR,
14094
+ type: "error" /* ERROR */,
14111
14095
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14112
14096
  severity,
14113
14097
  message: stripAnsi(event.message)
@@ -14127,7 +14111,7 @@ async function runNonInteractive({
14127
14111
  );
14128
14112
  } else if (streamFormatter) {
14129
14113
  streamFormatter.emitEvent({
14130
- type: JsonStreamEventType.ERROR,
14114
+ type: "error" /* ERROR */,
14131
14115
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14132
14116
  severity: "error",
14133
14117
  message: "Maximum session turns exceeded"
@@ -14135,7 +14119,7 @@ async function runNonInteractive({
14135
14119
  }
14136
14120
  }
14137
14121
  const stopMessage = typeof event.data?.["message"] === "string" ? event.data["message"] : "";
14138
- if (stopMessage && config.getOutputFormat() === OutputFormat.TEXT) {
14122
+ if (stopMessage && config.getOutputFormat() === "text" /* TEXT */) {
14139
14123
  process.stderr.write(`Agent execution stopped: ${stopMessage}
14140
14124
  `);
14141
14125
  }
@@ -14165,7 +14149,7 @@ async function runNonInteractive({
14165
14149
  abortController.signal.removeEventListener("abort", abortSession);
14166
14150
  scheduler?.dispose();
14167
14151
  consolePatcher.cleanup();
14168
- coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
14152
+ coreEvents.off("user-feedback" /* UserFeedback */, handleUserFeedback);
14169
14153
  await runExitCleanup();
14170
14154
  }
14171
14155
  if (abortController.signal.aborted || isFatalCancellationError(errorToHandle)) {
@@ -14198,7 +14182,7 @@ async function runNonInteractive2(params) {
14198
14182
  }
14199
14183
  });
14200
14184
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
14201
- const { setupInitialActivityLogger } = await import("./devtoolsService-OCTFSUNQ.js");
14185
+ const { setupInitialActivityLogger } = await import("./devtoolsService-NP7EGEMK.js");
14202
14186
  setupInitialActivityLogger(config);
14203
14187
  }
14204
14188
  const { stdout: workingStdout } = createWorkingStdio();
@@ -14214,7 +14198,7 @@ async function runNonInteractive2(params) {
14214
14198
  }
14215
14199
  };
14216
14200
  const startTime = Date.now();
14217
- const streamFormatter = config.getOutputFormat() === OutputFormat.STREAM_JSON ? new StreamJsonFormatter() : null;
14201
+ const streamFormatter = config.getOutputFormat() === "stream-json" /* STREAM_JSON */ ? new StreamJsonFormatter() : null;
14218
14202
  const abortController = new AbortController();
14219
14203
  let isAborting = false;
14220
14204
  let cancelMessageTimer = null;
@@ -14298,13 +14282,13 @@ async function runNonInteractive2(params) {
14298
14282
  let scheduler;
14299
14283
  try {
14300
14284
  consolePatcher.patch();
14301
- if (config.getRawOutput() && !config.getAcceptRawOutputRisk() && config.getOutputFormat() === OutputFormat.TEXT) {
14285
+ if (config.getRawOutput() && !config.getAcceptRawOutputRisk() && config.getOutputFormat() === "text" /* TEXT */) {
14302
14286
  process.stderr.write(
14303
14287
  "[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
14288
  );
14305
14289
  }
14306
14290
  setupCancellation();
14307
- coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
14291
+ coreEvents.on("user-feedback" /* UserFeedback */, handleUserFeedback);
14308
14292
  coreEvents.drainBacklogs();
14309
14293
  process.stdout.on("error", handleStdoutError);
14310
14294
  const geminiClient = config.getGeminiClient();
@@ -14324,7 +14308,7 @@ async function runNonInteractive2(params) {
14324
14308
  }
14325
14309
  if (streamFormatter) {
14326
14310
  streamFormatter.emitEvent({
14327
- type: JsonStreamEventType.INIT,
14311
+ type: "init" /* INIT */,
14328
14312
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14329
14313
  session_id: config.getSessionId(),
14330
14314
  model: config.getModel()
@@ -14362,7 +14346,7 @@ async function runNonInteractive2(params) {
14362
14346
  }
14363
14347
  if (streamFormatter) {
14364
14348
  streamFormatter.emitEvent({
14365
- type: JsonStreamEventType.MESSAGE,
14349
+ type: "message" /* MESSAGE */,
14366
14350
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14367
14351
  role: "user",
14368
14352
  content: input
@@ -14390,28 +14374,28 @@ async function runNonInteractive2(params) {
14390
14374
  if (abortController.signal.aborted) {
14391
14375
  handleCancellationError(config, abortExitCode);
14392
14376
  }
14393
- if (event.type === GeminiEventType.Content) {
14377
+ if (event.type === "content" /* Content */) {
14394
14378
  const isRaw = config.getRawOutput() || config.getAcceptRawOutputRisk();
14395
14379
  const output = isRaw ? event.value : stripAnsi(event.value);
14396
14380
  if (streamFormatter) {
14397
14381
  streamFormatter.emitEvent({
14398
- type: JsonStreamEventType.MESSAGE,
14382
+ type: "message" /* MESSAGE */,
14399
14383
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14400
14384
  role: "assistant",
14401
14385
  content: output,
14402
14386
  delta: true
14403
14387
  });
14404
- } else if (config.getOutputFormat() === OutputFormat.JSON) {
14388
+ } else if (config.getOutputFormat() === "json" /* JSON */) {
14405
14389
  responseText += output;
14406
14390
  } else {
14407
14391
  if (event.value) {
14408
14392
  textOutput.write(output);
14409
14393
  }
14410
14394
  }
14411
- } else if (event.type === GeminiEventType.ToolCallRequest) {
14395
+ } else if (event.type === "tool_call_request" /* ToolCallRequest */) {
14412
14396
  if (streamFormatter) {
14413
14397
  streamFormatter.emitEvent({
14414
- type: JsonStreamEventType.TOOL_USE,
14398
+ type: "tool_use" /* TOOL_USE */,
14415
14399
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14416
14400
  tool_name: event.value.name,
14417
14401
  tool_id: event.value.callId,
@@ -14419,29 +14403,29 @@ async function runNonInteractive2(params) {
14419
14403
  });
14420
14404
  }
14421
14405
  toolCallRequests.push(event.value);
14422
- } else if (event.type === GeminiEventType.LoopDetected) {
14406
+ } else if (event.type === "loop_detected" /* LoopDetected */) {
14423
14407
  const message = "Loop detected, stopping execution";
14424
14408
  if (streamFormatter) {
14425
14409
  streamFormatter.emitEvent({
14426
- type: JsonStreamEventType.ERROR,
14410
+ type: "error" /* ERROR */,
14427
14411
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14428
14412
  severity: "warning",
14429
14413
  message
14430
14414
  });
14431
14415
  }
14432
14416
  warnings.push(message);
14433
- } else if (event.type === GeminiEventType.MaxSessionTurns) {
14417
+ } else if (event.type === "max_session_turns" /* MaxSessionTurns */) {
14434
14418
  const message = "Maximum session turns exceeded";
14435
14419
  if (streamFormatter) {
14436
14420
  streamFormatter.emitEvent({
14437
- type: JsonStreamEventType.ERROR,
14421
+ type: "error" /* ERROR */,
14438
14422
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14439
14423
  severity: "error",
14440
14424
  message
14441
14425
  });
14442
14426
  }
14443
14427
  warnings.push(message);
14444
- } else if (event.type === GeminiEventType.Error) {
14428
+ } else if (event.type === "error" /* Error */) {
14445
14429
  const normalized = normalizeError(event.value?.error);
14446
14430
  const code = normalized.code ?? (typeof normalized.status === "string" ? normalized.status : void 0);
14447
14431
  const err = Object.assign(
@@ -14456,9 +14440,9 @@ async function runNonInteractive2(params) {
14456
14440
  }
14457
14441
  );
14458
14442
  throw err;
14459
- } else if (event.type === GeminiEventType.AgentExecutionStopped) {
14443
+ } else if (event.type === "agent_execution_stopped" /* AgentExecutionStopped */) {
14460
14444
  const stopMessage = `Agent execution stopped: ${event.value.systemMessage?.trim() || event.value.reason}`;
14461
- if (config.getOutputFormat() === OutputFormat.TEXT) {
14445
+ if (config.getOutputFormat() === "text" /* TEXT */) {
14462
14446
  process.stderr.write(`${stopMessage}
14463
14447
  `);
14464
14448
  }
@@ -14466,7 +14450,7 @@ async function runNonInteractive2(params) {
14466
14450
  const metrics = uiTelemetryService.getMetrics();
14467
14451
  const durationMs = Date.now() - startTime;
14468
14452
  streamFormatter.emitEvent({
14469
- type: JsonStreamEventType.RESULT,
14453
+ type: "result" /* RESULT */,
14470
14454
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14471
14455
  status: "success",
14472
14456
  stats: streamFormatter.convertToStreamStats(
@@ -14474,7 +14458,7 @@ async function runNonInteractive2(params) {
14474
14458
  durationMs
14475
14459
  )
14476
14460
  });
14477
- } else if (config.getOutputFormat() === OutputFormat.JSON) {
14461
+ } else if (config.getOutputFormat() === "json" /* JSON */) {
14478
14462
  const formatter = new JsonFormatter();
14479
14463
  const stats = uiTelemetryService.getMetrics();
14480
14464
  textOutput.write(
@@ -14490,23 +14474,23 @@ async function runNonInteractive2(params) {
14490
14474
  textOutput.ensureTrailingNewline();
14491
14475
  }
14492
14476
  return;
14493
- } else if (event.type === GeminiEventType.UserCancelled) {
14477
+ } else if (event.type === "user_cancelled" /* UserCancelled */) {
14494
14478
  throw new FatalCancellationError("Operation cancelled.");
14495
- } else if (event.type === GeminiEventType.AgentExecutionBlocked) {
14479
+ } else if (event.type === "agent_execution_blocked" /* AgentExecutionBlocked */) {
14496
14480
  const blockMessage = `Agent execution blocked: ${event.value.systemMessage?.trim() || event.value.reason}`;
14497
- if (config.getOutputFormat() === OutputFormat.TEXT) {
14481
+ if (config.getOutputFormat() === "text" /* TEXT */) {
14498
14482
  process.stderr.write(`[WARNING] ${blockMessage}
14499
14483
  `);
14500
14484
  } else if (streamFormatter) {
14501
14485
  streamFormatter.emitEvent({
14502
- type: JsonStreamEventType.ERROR,
14486
+ type: "error" /* ERROR */,
14503
14487
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14504
14488
  severity: "warning",
14505
14489
  message: stripAnsi(blockMessage)
14506
14490
  });
14507
14491
  }
14508
14492
  warnings.push(blockMessage);
14509
- } else if (event.type === GeminiEventType.InvalidStream) {
14493
+ } else if (event.type === "invalid_stream" /* InvalidStream */) {
14510
14494
  const eventValue = event.value;
14511
14495
  if (eventValue?.type === "NO_RESPONSE_TEXT") {
14512
14496
  invalidStreamError = TRUE_EMPTY_RESPONSE_MESSAGE;
@@ -14529,12 +14513,12 @@ async function runNonInteractive2(params) {
14529
14513
  );
14530
14514
  if (streamFormatter) {
14531
14515
  streamFormatter.emitEvent({
14532
- type: JsonStreamEventType.ERROR,
14516
+ type: "error" /* ERROR */,
14533
14517
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14534
14518
  severity: "error",
14535
14519
  message: invalidStreamError
14536
14520
  });
14537
- } else if (config.getOutputFormat() === OutputFormat.TEXT) {
14521
+ } else if (config.getOutputFormat() === "text" /* TEXT */) {
14538
14522
  process.stderr.write(`[ERROR] ${invalidStreamError}
14539
14523
  `);
14540
14524
  }
@@ -14571,7 +14555,7 @@ async function runNonInteractive2(params) {
14571
14555
  const requestInfo = completedToolCall.request;
14572
14556
  if (streamFormatter) {
14573
14557
  streamFormatter.emitEvent({
14574
- type: JsonStreamEventType.TOOL_RESULT,
14558
+ type: "tool_result" /* TOOL_RESULT */,
14575
14559
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14576
14560
  tool_id: requestInfo.callId,
14577
14561
  status: completedToolCall.status === "error" ? "error" : "success",
@@ -14605,11 +14589,11 @@ async function runNonInteractive2(params) {
14605
14589
  );
14606
14590
  }
14607
14591
  const stopExecutionTool = completedToolCalls.find(
14608
- (tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
14592
+ (tc) => tc.response.errorType === "stop_execution" /* STOP_EXECUTION */
14609
14593
  );
14610
14594
  if (stopExecutionTool && stopExecutionTool.response.error) {
14611
14595
  const stopMessage = `Agent execution stopped: ${stopExecutionTool.response.error.message}`;
14612
- if (config.getOutputFormat() === OutputFormat.TEXT) {
14596
+ if (config.getOutputFormat() === "text" /* TEXT */) {
14613
14597
  process.stderr.write(`${stopMessage}
14614
14598
  `);
14615
14599
  }
@@ -14617,7 +14601,7 @@ async function runNonInteractive2(params) {
14617
14601
  const metrics = uiTelemetryService.getMetrics();
14618
14602
  const durationMs = Date.now() - startTime;
14619
14603
  streamFormatter.emitEvent({
14620
- type: JsonStreamEventType.RESULT,
14604
+ type: "result" /* RESULT */,
14621
14605
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14622
14606
  status: "success",
14623
14607
  stats: streamFormatter.convertToStreamStats(
@@ -14625,7 +14609,7 @@ async function runNonInteractive2(params) {
14625
14609
  durationMs
14626
14610
  )
14627
14611
  });
14628
- } else if (config.getOutputFormat() === OutputFormat.JSON) {
14612
+ } else if (config.getOutputFormat() === "json" /* JSON */) {
14629
14613
  const formatter = new JsonFormatter();
14630
14614
  const stats = uiTelemetryService.getMetrics();
14631
14615
  textOutput.write(
@@ -14654,12 +14638,12 @@ async function runNonInteractive2(params) {
14654
14638
  const metrics = uiTelemetryService.getMetrics();
14655
14639
  const durationMs = Date.now() - startTime;
14656
14640
  streamFormatter.emitEvent({
14657
- type: JsonStreamEventType.RESULT,
14641
+ type: "result" /* RESULT */,
14658
14642
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14659
14643
  status: invalidStreamError ? "error" : "success",
14660
14644
  stats: streamFormatter.convertToStreamStats(metrics, durationMs)
14661
14645
  });
14662
- } else if (config.getOutputFormat() === OutputFormat.JSON) {
14646
+ } else if (config.getOutputFormat() === "json" /* JSON */) {
14663
14647
  const formatter = new JsonFormatter();
14664
14648
  const stats = uiTelemetryService.getMetrics();
14665
14649
  textOutput.write(
@@ -14683,7 +14667,7 @@ async function runNonInteractive2(params) {
14683
14667
  cleanupCancellation();
14684
14668
  scheduler?.dispose();
14685
14669
  consolePatcher.cleanup();
14686
- coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
14670
+ coreEvents.off("user-feedback" /* UserFeedback */, handleUserFeedback);
14687
14671
  await runExitCleanup();
14688
14672
  }
14689
14673
  if (abortController.signal.aborted || isFatalCancellationError(errorToHandle)) {
@@ -17081,12 +17065,12 @@ var Session = class {
17081
17065
  this.connection = connection;
17082
17066
  this.settings = settings;
17083
17067
  coreEvents.on(
17084
- CoreEvent.ApprovalModeChanged,
17068
+ "approval-mode-changed" /* ApprovalModeChanged */,
17085
17069
  this.handleApprovalModeChanged
17086
17070
  );
17087
- coreEvents.on(CoreEvent.RetryAttempt, this.handleRetryAttempt);
17071
+ coreEvents.on("retry-attempt" /* RetryAttempt */, this.handleRetryAttempt);
17088
17072
  this.context.config.getMessageBus()?.subscribe(
17089
- MessageBusType.TOOL_CONFIRMATION_REQUEST,
17073
+ "tool-confirmation-request" /* TOOL_CONFIRMATION_REQUEST */,
17090
17074
  this.handleToolConfirmationRequest,
17091
17075
  { signal: this.disposeController.signal }
17092
17076
  );
@@ -17110,7 +17094,7 @@ var Session = class {
17110
17094
  "Policy engine missing. Denying tool confirmation request."
17111
17095
  );
17112
17096
  await messageBus.publish({
17113
- type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
17097
+ type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
17114
17098
  correlationId: request.correlationId,
17115
17099
  confirmed: false,
17116
17100
  requiresUserConfirmation: false
@@ -17123,7 +17107,7 @@ var Session = class {
17123
17107
  "Tool confirmation request missing tool name. Denying."
17124
17108
  );
17125
17109
  await messageBus.publish({
17126
- type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
17110
+ type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
17127
17111
  correlationId: request.correlationId,
17128
17112
  confirmed: false,
17129
17113
  requiresUserConfirmation: false
@@ -17136,7 +17120,7 @@ var Session = class {
17136
17120
  `Tool confirmation request for unknown tool: ${toolName}. Denying.`
17137
17121
  );
17138
17122
  await messageBus.publish({
17139
- type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
17123
+ type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
17140
17124
  correlationId: request.correlationId,
17141
17125
  confirmed: false,
17142
17126
  requiresUserConfirmation: false
@@ -17152,15 +17136,15 @@ var Session = class {
17152
17136
  request.subagent
17153
17137
  );
17154
17138
  await messageBus.publish({
17155
- type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
17139
+ type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
17156
17140
  correlationId: request.correlationId,
17157
- confirmed: result.decision === PolicyDecision.ALLOW,
17158
- requiresUserConfirmation: result.decision === PolicyDecision.ASK_USER
17141
+ confirmed: result.decision === "allow" /* ALLOW */,
17142
+ requiresUserConfirmation: result.decision === "ask_user" /* ASK_USER */
17159
17143
  });
17160
17144
  } catch (error) {
17161
17145
  debugLogger.error("Error handling tool confirmation request:", error);
17162
17146
  await this.context.config.getMessageBus()?.publish({
17163
- type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
17147
+ type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
17164
17148
  correlationId: request.correlationId,
17165
17149
  confirmed: false,
17166
17150
  requiresUserConfirmation: false
@@ -17194,10 +17178,10 @@ var Session = class {
17194
17178
  };
17195
17179
  async dispose() {
17196
17180
  coreEvents.off(
17197
- CoreEvent.ApprovalModeChanged,
17181
+ "approval-mode-changed" /* ApprovalModeChanged */,
17198
17182
  this.handleApprovalModeChanged
17199
17183
  );
17200
- coreEvents.off(CoreEvent.RetryAttempt, this.handleRetryAttempt);
17184
+ coreEvents.off("retry-attempt" /* RetryAttempt */, this.handleRetryAttempt);
17201
17185
  this.disposeController.abort();
17202
17186
  if (this.context.config?.dispose) {
17203
17187
  try {
@@ -17291,7 +17275,7 @@ ${thought.description}`;
17291
17275
  await this.sendUpdate({
17292
17276
  sessionUpdate: "tool_call",
17293
17277
  toolCallId: toolCall.id,
17294
- status: toolCall.status === CoreToolCallStatus.Success ? "completed" : "failed",
17278
+ status: toolCall.status === "success" /* Success */ ? "completed" : "failed",
17295
17279
  title: toolCall.displayName || toolCall.name,
17296
17280
  content: toolCallContent,
17297
17281
  kind: tool ? toAcpToolKind(tool.kind) : "other"
@@ -17401,7 +17385,7 @@ ${thought.description}`;
17401
17385
  return { stopReason: "cancelled" };
17402
17386
  }
17403
17387
  switch (event.type) {
17404
- case GeminiEventType.Content: {
17388
+ case "content" /* Content */: {
17405
17389
  const content = {
17406
17390
  type: "text",
17407
17391
  text: event.value
@@ -17415,7 +17399,7 @@ ${thought.description}`;
17415
17399
  await this.sendUpdate(update);
17416
17400
  break;
17417
17401
  }
17418
- case GeminiEventType.Thought: {
17402
+ case "thought" /* Thought */: {
17419
17403
  const thoughtText = `**${event.value.subject}**
17420
17404
  ${event.value.description}`;
17421
17405
  await this.sendUpdate({
@@ -17424,7 +17408,7 @@ ${event.value.description}`;
17424
17408
  });
17425
17409
  break;
17426
17410
  }
17427
- case GeminiEventType.Retry: {
17411
+ case "retry" /* Retry */: {
17428
17412
  toolCallRequests.length = 0;
17429
17413
  debugLogger.warn(
17430
17414
  "Model stream interrupted mid-response; retrying prompt..."
@@ -17440,10 +17424,10 @@ ${event.value.description}`;
17440
17424
  isFirstChunkAfterRetry = true;
17441
17425
  break;
17442
17426
  }
17443
- case GeminiEventType.ToolCallRequest:
17427
+ case "tool_call_request" /* ToolCallRequest */:
17444
17428
  toolCallRequests.push(event.value);
17445
17429
  break;
17446
- case GeminiEventType.Finished: {
17430
+ case "finished" /* Finished */: {
17447
17431
  const usage2 = event.value.usageMetadata;
17448
17432
  if (usage2) {
17449
17433
  turnInputTokens = usage2.promptTokenCount ?? turnInputTokens;
@@ -17460,19 +17444,19 @@ ${event.value.description}`;
17460
17444
  }
17461
17445
  break;
17462
17446
  }
17463
- case GeminiEventType.ModelInfo:
17447
+ case "model_info" /* ModelInfo */:
17464
17448
  turnModelId = event.value;
17465
17449
  break;
17466
- case GeminiEventType.MaxSessionTurns:
17450
+ case "max_session_turns" /* MaxSessionTurns */:
17467
17451
  stopReason = "max_turn_requests";
17468
17452
  break;
17469
- case GeminiEventType.LoopDetected:
17453
+ case "loop_detected" /* LoopDetected */:
17470
17454
  stopReason = "max_turn_requests";
17471
17455
  break;
17472
- case GeminiEventType.ContextWindowWillOverflow:
17456
+ case "context_window_will_overflow" /* ContextWindowWillOverflow */:
17473
17457
  stopReason = "max_tokens";
17474
17458
  break;
17475
- case GeminiEventType.Error: {
17459
+ case "error" /* Error */: {
17476
17460
  const parseResult = StructuredErrorSchema.safeParse(
17477
17461
  event.value.error
17478
17462
  );
@@ -17663,7 +17647,7 @@ ${event.value.description}`;
17663
17647
  const output = RequestPermissionResponseSchema.parse(
17664
17648
  await this.connection.requestPermission(params)
17665
17649
  );
17666
- const outcome = output.outcome.outcome === "cancelled" ? ToolConfirmationOutcome.Cancel : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
17650
+ const outcome = output.outcome.outcome === "cancelled" ? "cancel" /* Cancel */ : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
17667
17651
  await confirmationDetails.onConfirm(outcome);
17668
17652
  await updatePolicy(
17669
17653
  tool,
@@ -17674,7 +17658,7 @@ ${event.value.description}`;
17674
17658
  invocation
17675
17659
  );
17676
17660
  switch (outcome) {
17677
- case ToolConfirmationOutcome.Cancel: {
17661
+ case "cancel" /* Cancel */: {
17678
17662
  const cancelError = new Error(
17679
17663
  `Tool "${fc.name}" was canceled by the user.`
17680
17664
  );
@@ -17692,12 +17676,12 @@ ${event.value.description}`;
17692
17676
  });
17693
17677
  return errorResponse(cancelError);
17694
17678
  }
17695
- case ToolConfirmationOutcome.ProceedOnce:
17696
- case ToolConfirmationOutcome.ProceedAlways:
17697
- case ToolConfirmationOutcome.ProceedAlwaysAndSave:
17698
- case ToolConfirmationOutcome.ProceedAlwaysServer:
17699
- case ToolConfirmationOutcome.ProceedAlwaysTool:
17700
- case ToolConfirmationOutcome.ModifyWithEditor:
17679
+ case "proceed_once" /* ProceedOnce */:
17680
+ case "proceed_always" /* ProceedAlways */:
17681
+ case "proceed_always_and_save" /* ProceedAlwaysAndSave */:
17682
+ case "proceed_always_server" /* ProceedAlwaysServer */:
17683
+ case "proceed_always_tool" /* ProceedAlwaysTool */:
17684
+ case "modify_with_editor" /* ModifyWithEditor */:
17701
17685
  break;
17702
17686
  default: {
17703
17687
  const resultOutcome = outcome;
@@ -17751,7 +17735,7 @@ ${event.value.description}`;
17751
17735
  );
17752
17736
  this.chat.recordCompletedToolCalls(this.context.config.getActiveModel(), [
17753
17737
  {
17754
- status: CoreToolCallStatus.Success,
17738
+ status: "success" /* Success */,
17755
17739
  request: {
17756
17740
  callId,
17757
17741
  name: fc.name,
@@ -17796,7 +17780,7 @@ ${event.value.description}`;
17796
17780
  });
17797
17781
  this.chat.recordCompletedToolCalls(this.context.config.getActiveModel(), [
17798
17782
  {
17799
- status: CoreToolCallStatus.Error,
17783
+ status: "error" /* Error */,
17800
17784
  request: {
17801
17785
  callId,
17802
17786
  name: fc.name,
@@ -17925,12 +17909,12 @@ ${event.value.description}`;
17925
17909
  sessionId: this.id,
17926
17910
  options: [
17927
17911
  {
17928
- optionId: ToolConfirmationOutcome.ProceedOnce,
17912
+ optionId: "proceed_once" /* ProceedOnce */,
17929
17913
  name: "Allow once",
17930
17914
  kind: "allow_once"
17931
17915
  },
17932
17916
  {
17933
- optionId: ToolConfirmationOutcome.Cancel,
17917
+ optionId: "cancel" /* Cancel */,
17934
17918
  name: "Deny",
17935
17919
  kind: "reject_once"
17936
17920
  }
@@ -17955,8 +17939,8 @@ ${event.value.description}`;
17955
17939
  const output = RequestPermissionResponseSchema.parse(
17956
17940
  await this.connection.requestPermission(params)
17957
17941
  );
17958
- const outcome = output.outcome.outcome === "cancelled" ? ToolConfirmationOutcome.Cancel : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
17959
- if (outcome === ToolConfirmationOutcome.ProceedOnce) {
17942
+ const outcome = output.outcome.outcome === "cancelled" ? "cancel" /* Cancel */ : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
17943
+ if (outcome === "proceed_once" /* ProceedOnce */) {
17960
17944
  this.context.config.getWorkspaceContext().addReadOnlyPath(absolutePath);
17961
17945
  validationError = null;
17962
17946
  } else {
@@ -18399,7 +18383,7 @@ var AcpSessionManager = class {
18399
18383
  mcpServers,
18400
18384
  loadedSettings
18401
18385
  );
18402
- const authType = loadedSettings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ? AuthType.GATEWAY : AuthType.USE_GEMINI);
18386
+ const authType = loadedSettings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ? "gateway" /* GATEWAY */ : "gemini-api-key" /* USE_GEMINI */);
18403
18387
  let isAuthenticated = false;
18404
18388
  let authErrorMessage = "";
18405
18389
  try {
@@ -18411,7 +18395,7 @@ var AcpSessionManager = class {
18411
18395
  );
18412
18396
  isAuthenticated = true;
18413
18397
  const contentGeneratorConfig = config.getContentGeneratorConfig();
18414
- if (authType === AuthType.USE_GEMINI && (!contentGeneratorConfig || !contentGeneratorConfig.apiKey)) {
18398
+ if (authType === "gemini-api-key" /* USE_GEMINI */ && (!contentGeneratorConfig || !contentGeneratorConfig.apiKey)) {
18415
18399
  isAuthenticated = false;
18416
18400
  authErrorMessage = "Gemini API key is missing or not configured.";
18417
18401
  }
@@ -18597,7 +18581,7 @@ var AcpSessionManager = class {
18597
18581
  }
18598
18582
  }
18599
18583
  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);
18584
+ const selectedAuthType = this.settings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ? "gateway" /* GATEWAY */ : void 0);
18601
18585
  if (!selectedAuthType) {
18602
18586
  throw RequestError.authRequired();
18603
18587
  }
@@ -18709,12 +18693,12 @@ var GeminiAgent = class {
18709
18693
  }
18710
18694
  const authMethods = [
18711
18695
  {
18712
- id: AuthType.LOGIN_WITH_GOOGLE,
18696
+ id: "oauth-personal" /* LOGIN_WITH_GOOGLE */,
18713
18697
  name: "Log in with Google",
18714
18698
  description: "Log in with your Google account"
18715
18699
  },
18716
18700
  {
18717
- id: AuthType.USE_GEMINI,
18701
+ id: "gemini-api-key" /* USE_GEMINI */,
18718
18702
  name: "Gemini API key",
18719
18703
  description: "Use an API key with Gemini Developer API",
18720
18704
  _meta: {
@@ -18724,12 +18708,12 @@ var GeminiAgent = class {
18724
18708
  }
18725
18709
  },
18726
18710
  {
18727
- id: AuthType.USE_VERTEX_AI,
18711
+ id: "vertex-ai" /* USE_VERTEX_AI */,
18728
18712
  name: "Vertex AI",
18729
18713
  description: "Use an API key with Vertex AI GenAI API"
18730
18714
  },
18731
18715
  {
18732
- id: AuthType.GATEWAY,
18716
+ id: "gateway" /* GATEWAY */,
18733
18717
  name: "AI API Gateway",
18734
18718
  description: "Use a custom AI API Gateway",
18735
18719
  _meta: {
@@ -18902,7 +18886,7 @@ async function validateNonInteractiveAuth(configuredAuthType, useExternalAuth, n
18902
18886
  }
18903
18887
  return authType;
18904
18888
  } catch (error) {
18905
- if (nonInteractiveConfig.getOutputFormat() === OutputFormat.JSON) {
18889
+ if (nonInteractiveConfig.getOutputFormat() === "json" /* JSON */) {
18906
18890
  handleError(
18907
18891
  error instanceof Error ? error : new Error(String(error)),
18908
18892
  nonInteractiveConfig,
@@ -19101,10 +19085,10 @@ var SlashCommandConflictHandler = class {
19101
19085
  this.handleConflicts = this.handleConflicts.bind(this);
19102
19086
  }
19103
19087
  start() {
19104
- coreEvents.on(CoreEvent.SlashCommandConflicts, this.handleConflicts);
19088
+ coreEvents.on("slash-command-conflicts" /* SlashCommandConflicts */, this.handleConflicts);
19105
19089
  }
19106
19090
  stop() {
19107
- coreEvents.off(CoreEvent.SlashCommandConflicts, this.handleConflicts);
19091
+ coreEvents.off("slash-command-conflicts" /* SlashCommandConflicts */, this.handleConflicts);
19108
19092
  if (this.flushTimeout) {
19109
19093
  clearTimeout(this.flushTimeout);
19110
19094
  this.flushTimeout = null;
@@ -19479,7 +19463,7 @@ async function resolveSessionId(resumeArg, sessionIdArg, sessionFileArg) {
19479
19463
  }
19480
19464
  }
19481
19465
  async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
19482
- const { startInteractiveUI: doStartUI } = await import("./interactiveCli-3FEZU7GJ.js");
19466
+ const { startInteractiveUI: doStartUI } = await import("./interactiveCli-3QAMPJPK.js");
19483
19467
  await doStartUI(
19484
19468
  config,
19485
19469
  settings,
@@ -19582,12 +19566,12 @@ async function main() {
19582
19566
  dns.setDefaultResultOrder(
19583
19567
  validateDnsResolutionOrder(settings.merged.advanced.dnsResolutionOrder)
19584
19568
  );
19585
- if (!settings.merged.security.auth.selectedType || settings.merged.security.auth.selectedType === AuthType.LEGACY_CLOUD_SHELL) {
19569
+ if (!settings.merged.security.auth.selectedType || settings.merged.security.auth.selectedType === "cloud-shell" /* LEGACY_CLOUD_SHELL */) {
19586
19570
  if (process.env["CLOUD_SHELL"] === "true" || process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true") {
19587
19571
  settings.setValue(
19588
19572
  "User" /* User */,
19589
19573
  "security.auth.selectedType",
19590
- AuthType.COMPUTE_ADC
19574
+ "compute-default-credentials" /* COMPUTE_ADC */
19591
19575
  );
19592
19576
  }
19593
19577
  }
@@ -19714,7 +19698,7 @@ ${finalArgs[promptIndex + 1]}`;
19714
19698
  await config.storage.initialize();
19715
19699
  adminControlsListner.setConfig(config);
19716
19700
  if (config.isInteractive() && settings.merged.general.devtools) {
19717
- const { setupInitialActivityLogger } = await import("./devtoolsService-OCTFSUNQ.js");
19701
+ const { setupInitialActivityLogger } = await import("./devtoolsService-NP7EGEMK.js");
19718
19702
  setupInitialActivityLogger(config);
19719
19703
  }
19720
19704
  registerTelemetryConfig(config);
@@ -19722,7 +19706,7 @@ ${finalArgs[promptIndex + 1]}`;
19722
19706
  const messageBus = config.getMessageBus();
19723
19707
  createPolicyUpdater2(policyEngine, messageBus, config.storage);
19724
19708
  registerCleanup(async () => {
19725
- await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
19709
+ await config?.getHookSystem()?.fireSessionEndEvent("exit" /* Exit */);
19726
19710
  });
19727
19711
  if (!config.getAcpMode()) {
19728
19712
  registerCleanup(consolePatcher.cleanup);
@@ -19773,7 +19757,7 @@ ${finalArgs[promptIndex + 1]}`;
19773
19757
  const initAppHandle = startupProfiler.start("initialize_app");
19774
19758
  const initializationResult = await initializeApp(config, settings);
19775
19759
  initAppHandle?.end();
19776
- import("./liteRtServerManager-TVKXINGU.js").then(({ LiteRtServerManager }) => {
19760
+ import("./liteRtServerManager-TI6LO5RU.js").then(({ LiteRtServerManager }) => {
19777
19761
  const mergedGemma = settings.merged.experimental?.gemmaModelRouter;
19778
19762
  if (!mergedGemma) return;
19779
19763
  const userGemma = settings.forScope("User" /* User */).settings.experimental?.gemmaModelRouter;
@@ -19783,7 +19767,7 @@ ${finalArgs[promptIndex + 1]}`;
19783
19767
  autoStartServer: userGemma?.autoStartServer
19784
19768
  });
19785
19769
  }).catch((e) => debugLogger.warn("LiteRT auto-start import failed:", e));
19786
- if (settings.merged.security.auth.selectedType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
19770
+ if (settings.merged.security.auth.selectedType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
19787
19771
  await getOauthClient(settings.merged.security.auth.selectedType, config);
19788
19772
  }
19789
19773
  if (config.getAcpMode()) {
@@ -19799,7 +19783,7 @@ ${finalArgs[promptIndex + 1]}`;
19799
19783
  ...rawStartupWarnings.map((message) => ({
19800
19784
  id: `startup-${createHash2("sha256").update(message).digest("hex").substring(0, 16)}`,
19801
19785
  message,
19802
- priority: WarningPriority.High
19786
+ priority: "high" /* High */
19803
19787
  })),
19804
19788
  ...await getUserStartupWarnings(settings.merged, void 0, {
19805
19789
  isAlternateBuffer: useAlternateBuffer
@@ -19836,7 +19820,7 @@ ${finalArgs[promptIndex + 1]}`;
19836
19820
  ${input}` : stdinData;
19837
19821
  }
19838
19822
  }
19839
- const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
19823
+ const sessionStartSource = resumedSessionData ? "resume" /* Resume */ : "startup" /* Startup */;
19840
19824
  const hookSystem = config?.getHookSystem();
19841
19825
  if (hookSystem) {
19842
19826
  const result = await hookSystem.fireSessionStartEvent(sessionStartSource);
@@ -19893,8 +19877,8 @@ ${input}` : wrappedContext;
19893
19877
  }
19894
19878
  }
19895
19879
  function initializeOutputListenersAndFlush(config) {
19896
- if (coreEvents.listenerCount(CoreEvent.Output) === 0) {
19897
- coreEvents.on(CoreEvent.Output, (payload) => {
19880
+ if (coreEvents.listenerCount("output" /* Output */) === 0) {
19881
+ coreEvents.on("output" /* Output */, (payload) => {
19898
19882
  if (payload.isStderr) {
19899
19883
  writeToStderr(payload.chunk, payload.encoding);
19900
19884
  } else {
@@ -19902,8 +19886,8 @@ function initializeOutputListenersAndFlush(config) {
19902
19886
  }
19903
19887
  });
19904
19888
  }
19905
- if (coreEvents.listenerCount(CoreEvent.ConsoleLog) === 0) {
19906
- coreEvents.on(CoreEvent.ConsoleLog, (payload) => {
19889
+ if (coreEvents.listenerCount("console-log" /* ConsoleLog */) === 0) {
19890
+ coreEvents.on("console-log" /* ConsoleLog */, (payload) => {
19907
19891
  if (payload.type === "error" || payload.type === "warn") {
19908
19892
  writeToStderr(payload.content + "\n");
19909
19893
  } else {
@@ -19911,8 +19895,8 @@ function initializeOutputListenersAndFlush(config) {
19911
19895
  }
19912
19896
  });
19913
19897
  }
19914
- if (coreEvents.listenerCount(CoreEvent.UserFeedback) === 0) {
19915
- coreEvents.on(CoreEvent.UserFeedback, (payload) => {
19898
+ if (coreEvents.listenerCount("user-feedback" /* UserFeedback */) === 0) {
19899
+ coreEvents.on("user-feedback" /* UserFeedback */, (payload) => {
19916
19900
  writeToStderr(payload.message + "\n");
19917
19901
  });
19918
19902
  }
@@ -19920,7 +19904,7 @@ function initializeOutputListenersAndFlush(config) {
19920
19904
  const forceToStderr = outputFormat === "json";
19921
19905
  coreEvents.drainBacklogs(
19922
19906
  (event, args) => {
19923
- if (forceToStderr && event === CoreEvent.Output) {
19907
+ if (forceToStderr && event === "output" /* Output */) {
19924
19908
  const payload = args[0];
19925
19909
  if (!payload.isStderr) {
19926
19910
  return {