@google/gemini-cli-a2a-server 0.27.0-preview.1 → 0.28.0-nightly.20260129.9bb175a50

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.
@@ -325925,7 +325925,7 @@ var ExtensionsSettingSchema = external_exports.object({
325925
325925
  });
325926
325926
  var CliFeatureSettingSchema = external_exports.object({
325927
325927
  extensionsSetting: ExtensionsSettingSchema.optional(),
325928
- advancedFeaturesEnabled: external_exports.boolean().optional()
325928
+ unmanagedCapabilitiesEnabled: external_exports.boolean().optional()
325929
325929
  });
325930
325930
  var McpSettingSchema = external_exports.object({
325931
325931
  mcpEnabled: external_exports.boolean().optional(),
@@ -326597,7 +326597,7 @@ var __filename = fileURLToPath5(import.meta.url);
326597
326597
  var __dirname3 = path20.dirname(__filename);
326598
326598
  async function getVersion() {
326599
326599
  const pkgJson = await getPackageJson(__dirname3);
326600
- return "0.27.0-preview.1";
326600
+ return "0.28.0-nightly.20260129.9bb175a50";
326601
326601
  }
326602
326602
 
326603
326603
  // packages/core/dist/src/code_assist/experiments/client_metadata.js
@@ -330003,8 +330003,8 @@ var Float64Vector = import_vector.default.Float64Vector;
330003
330003
  var PointerVector = import_vector.default.PointerVector;
330004
330004
 
330005
330005
  // packages/core/dist/src/generated/git-commit.js
330006
- var GIT_COMMIT_INFO = "995461554";
330007
- var CLI_VERSION = "0.27.0-preview.1";
330006
+ var GIT_COMMIT_INFO = "9bb175a50";
330007
+ var CLI_VERSION = "0.28.0-nightly.20260129.9bb175a50";
330008
330008
 
330009
330009
  // packages/core/dist/src/ide/detect-ide.js
330010
330010
  var IDE_DEFINITIONS = {
@@ -330017,6 +330017,7 @@ var IDE_DEFINITIONS = {
330017
330017
  trae: { name: "trae", displayName: "Trae" },
330018
330018
  vscode: { name: "vscode", displayName: "VS Code" },
330019
330019
  vscodefork: { name: "vscodefork", displayName: "IDE" },
330020
+ positron: { name: "positron", displayName: "Positron" },
330020
330021
  antigravity: { name: "antigravity", displayName: "Antigravity" },
330021
330022
  sublimetext: { name: "sublimetext", displayName: "Sublime Text" },
330022
330023
  jetbrains: { name: "jetbrains", displayName: "JetBrains IDE" },
@@ -330061,6 +330062,9 @@ function detectIdeFromEnv() {
330061
330062
  if (process.env["MONOSPACE_ENV"]) {
330062
330063
  return IDE_DEFINITIONS.firebasestudio;
330063
330064
  }
330065
+ if (process.env["POSITRON"] === "1") {
330066
+ return IDE_DEFINITIONS.positron;
330067
+ }
330064
330068
  if (process.env["TERM_PROGRAM"] === "sublime") {
330065
330069
  return IDE_DEFINITIONS.sublimetext;
330066
330070
  }
@@ -334923,11 +334927,11 @@ async function detectFileType(filePath) {
334923
334927
  if (lookedUpMimeType.startsWith("image/")) {
334924
334928
  return "image";
334925
334929
  }
334926
- if (lookedUpMimeType.startsWith("audio/")) {
334927
- return "audio";
334928
- }
334929
- if (lookedUpMimeType.startsWith("video/")) {
334930
- return "video";
334930
+ if (lookedUpMimeType.startsWith("audio/") || lookedUpMimeType.startsWith("video/")) {
334931
+ if (!await isBinaryFile(filePath)) {
334932
+ return "text";
334933
+ }
334934
+ return lookedUpMimeType.startsWith("audio/") ? "audio" : "video";
334931
334935
  }
334932
334936
  if (lookedUpMimeType === "application/pdf") {
334933
334937
  return "pdf";
@@ -373791,7 +373795,10 @@ var NEVER_ALLOWED_ENVIRONMENT_VARIABLES = /* @__PURE__ */ new Set([
373791
373795
  "DATABASE_URL",
373792
373796
  "GOOGLE_CLOUD_PROJECT",
373793
373797
  "GOOGLE_CLOUD_ACCOUNT",
373794
- "FIREBASE_PROJECT_ID"
373798
+ "FIREBASE_PROJECT_ID",
373799
+ "GEMINI_API_KEY",
373800
+ "GOOGLE_API_KEY",
373801
+ "GOOGLE_APPLICATION_CREDENTIALS"
373795
373802
  ]);
373796
373803
  var NEVER_ALLOWED_NAME_PATTERNS = [
373797
373804
  /TOKEN/i,
@@ -382852,6 +382859,21 @@ var ChatRecordingService = class {
382852
382859
  debugLogger.error("Error saving summary to chat history.", error2);
382853
382860
  }
382854
382861
  }
382862
+ /**
382863
+ * Records workspace directories to the session file.
382864
+ * Called when directories are added via /dir add.
382865
+ */
382866
+ recordDirectories(directories) {
382867
+ if (!this.conversationFile)
382868
+ return;
382869
+ try {
382870
+ this.updateConversation((conversation) => {
382871
+ conversation.directories = [...directories];
382872
+ });
382873
+ } catch (error2) {
382874
+ debugLogger.error("Error saving directories to chat history.", error2);
382875
+ }
382876
+ }
382855
382877
  /**
382856
382878
  * Gets the current conversation data (for summary generation).
382857
382879
  */
@@ -393200,6 +393222,12 @@ var HookEventHandler = class {
393200
393222
  hookPlanner;
393201
393223
  hookRunner;
393202
393224
  hookAggregator;
393225
+ /**
393226
+ * Track reported failures to suppress duplicate warnings during streaming.
393227
+ * Uses a WeakMap with the original request object as a key to ensure
393228
+ * failures are only reported once per logical model interaction.
393229
+ */
393230
+ reportedFailures = /* @__PURE__ */ new WeakMap();
393203
393231
  constructor(config3, hookPlanner, hookRunner, hookAggregator) {
393204
393232
  this.config = config3;
393205
393233
  this.hookPlanner = hookPlanner;
@@ -393313,7 +393341,7 @@ var HookEventHandler = class {
393313
393341
  ...this.createBaseInput(HookEventName.BeforeModel),
393314
393342
  llm_request: defaultHookTranslator.toHookLLMRequest(llmRequest)
393315
393343
  };
393316
- return this.executeHooks(HookEventName.BeforeModel, input);
393344
+ return this.executeHooks(HookEventName.BeforeModel, input, void 0, llmRequest);
393317
393345
  }
393318
393346
  /**
393319
393347
  * Fire an AfterModel event
@@ -393325,7 +393353,7 @@ var HookEventHandler = class {
393325
393353
  llm_request: defaultHookTranslator.toHookLLMRequest(llmRequest),
393326
393354
  llm_response: defaultHookTranslator.toHookLLMResponse(llmResponse)
393327
393355
  };
393328
- return this.executeHooks(HookEventName.AfterModel, input);
393356
+ return this.executeHooks(HookEventName.AfterModel, input, void 0, llmRequest);
393329
393357
  }
393330
393358
  /**
393331
393359
  * Fire a BeforeToolSelection event
@@ -393336,13 +393364,13 @@ var HookEventHandler = class {
393336
393364
  ...this.createBaseInput(HookEventName.BeforeToolSelection),
393337
393365
  llm_request: defaultHookTranslator.toHookLLMRequest(llmRequest)
393338
393366
  };
393339
- return this.executeHooks(HookEventName.BeforeToolSelection, input);
393367
+ return this.executeHooks(HookEventName.BeforeToolSelection, input, void 0, llmRequest);
393340
393368
  }
393341
393369
  /**
393342
393370
  * Execute hooks for a specific event (direct execution without MessageBus)
393343
393371
  * Used as fallback when MessageBus is not available
393344
393372
  */
393345
- async executeHooks(eventName, input, context2) {
393373
+ async executeHooks(eventName, input, context2, requestContext) {
393346
393374
  try {
393347
393375
  const plan = this.hookPlanner.createExecutionPlan(eventName, context2);
393348
393376
  if (!plan || plan.hookConfigs.length === 0) {
@@ -393371,7 +393399,7 @@ var HookEventHandler = class {
393371
393399
  const results = plan.sequential ? await this.hookRunner.executeHooksSequential(plan.hookConfigs, eventName, input, onHookStart, onHookEnd) : await this.hookRunner.executeHooksParallel(plan.hookConfigs, eventName, input, onHookStart, onHookEnd);
393372
393400
  const aggregated = this.hookAggregator.aggregateResults(results, eventName);
393373
393401
  this.processCommonHookOutputFields(aggregated);
393374
- this.logHookExecution(eventName, input, results, aggregated);
393402
+ this.logHookExecution(eventName, input, results, aggregated, requestContext);
393375
393403
  return aggregated;
393376
393404
  } catch (error2) {
393377
393405
  debugLogger.error(`Hook event bus error for ${eventName}: ${error2}`);
@@ -393399,15 +393427,31 @@ var HookEventHandler = class {
393399
393427
  /**
393400
393428
  * Log hook execution for observability
393401
393429
  */
393402
- logHookExecution(eventName, input, results, aggregated) {
393430
+ logHookExecution(eventName, input, results, aggregated, requestContext) {
393403
393431
  const failedHooks = results.filter((r3) => !r3.success);
393404
393432
  const successCount = results.length - failedHooks.length;
393405
393433
  const errorCount = failedHooks.length;
393406
393434
  if (errorCount > 0) {
393407
393435
  const failedNames = failedHooks.map((r3) => this.getHookNameFromResult(r3)).join(", ");
393436
+ let shouldEmit = true;
393437
+ if (requestContext) {
393438
+ let reportedSet = this.reportedFailures.get(requestContext);
393439
+ if (!reportedSet) {
393440
+ reportedSet = /* @__PURE__ */ new Set();
393441
+ this.reportedFailures.set(requestContext, reportedSet);
393442
+ }
393443
+ const failureKey = `${eventName}:${failedNames}`;
393444
+ if (reportedSet.has(failureKey)) {
393445
+ shouldEmit = false;
393446
+ } else {
393447
+ reportedSet.add(failureKey);
393448
+ }
393449
+ }
393408
393450
  debugLogger.warn(`Hook execution for ${eventName}: ${successCount} succeeded, ${errorCount} failed (${failedNames}), total duration: ${aggregated.totalDuration}ms`);
393409
- coreEvents.emitFeedback("warning", `Hook(s) [${failedNames}] failed for event ${eventName}. Press F12 to see the debug drawer for more details.
393451
+ if (shouldEmit) {
393452
+ coreEvents.emitFeedback("warning", `Hook(s) [${failedNames}] failed for event ${eventName}. Press F12 to see the debug drawer for more details.
393410
393453
  `);
393454
+ }
393411
393455
  } else {
393412
393456
  debugLogger.debug(`Hook execution for ${eventName}: ${successCount} hooks executed successfully, total duration: ${aggregated.totalDuration}ms`);
393413
393457
  }
@@ -399142,13 +399186,14 @@ init_tools();
399142
399186
  init_tool_names();
399143
399187
  async function checkPolicy(toolCall, config3) {
399144
399188
  const serverName = toolCall.tool instanceof DiscoveredMCPTool ? toolCall.tool.serverName : void 0;
399145
- const { decision } = await config3.getPolicyEngine().check({ name: toolCall.request.name, args: toolCall.request.args }, serverName);
399189
+ const result2 = await config3.getPolicyEngine().check({ name: toolCall.request.name, args: toolCall.request.args }, serverName);
399190
+ const { decision } = result2;
399146
399191
  if (decision === PolicyDecision.ASK_USER) {
399147
399192
  if (!config3.isInteractive()) {
399148
399193
  throw new Error(`Tool execution for "${toolCall.tool.displayName || toolCall.tool.name}" requires user confirmation, which is not supported in non-interactive mode.`);
399149
399194
  }
399150
399195
  }
399151
- return decision;
399196
+ return { decision, rule: result2.rule };
399152
399197
  }
399153
399198
  async function updatePolicy(tool, outcome, confirmationDetails, deps) {
399154
399199
  if (isAutoEditTransition(tool, outcome)) {
@@ -399434,9 +399479,10 @@ var Scheduler2 = class _Scheduler {
399434
399479
  // --- Phase 3: Single Call Orchestration ---
399435
399480
  async _processToolCall(toolCall, signal) {
399436
399481
  const callId = toolCall.request.callId;
399437
- const decision = await checkPolicy(toolCall, this.config);
399482
+ const { decision, rule } = await checkPolicy(toolCall, this.config);
399438
399483
  if (decision === PolicyDecision.DENY) {
399439
- this.state.updateStatus(callId, "error", createErrorResponse2(toolCall.request, new Error("Tool execution denied by policy."), ToolErrorType.POLICY_VIOLATION));
399484
+ const denyMessage = rule?.denyMessage ? ` ${rule.denyMessage}` : "";
399485
+ this.state.updateStatus(callId, "error", createErrorResponse2(toolCall.request, new Error(`Tool execution denied by policy.${denyMessage}`), ToolErrorType.POLICY_VIOLATION));
399440
399486
  this.state.finalizeCall(callId);
399441
399487
  return;
399442
399488
  }
@@ -403540,10 +403586,18 @@ async function createTransport(mcpServerName, mcpServerConfig, debugMode, saniti
403540
403586
  const transport = new StdioClientTransport({
403541
403587
  command: mcpServerConfig.command,
403542
403588
  args: mcpServerConfig.args || [],
403543
- env: {
403544
- ...sanitizeEnvironment(process.env, sanitizationConfig),
403589
+ env: sanitizeEnvironment({
403590
+ ...process.env,
403591
+ ...getExtensionEnvironment(mcpServerConfig.extension),
403545
403592
  ...mcpServerConfig.env || {}
403546
- },
403593
+ }, {
403594
+ ...sanitizationConfig,
403595
+ allowedEnvironmentVariables: [
403596
+ ...sanitizationConfig.allowedEnvironmentVariables ?? [],
403597
+ ...mcpServerConfig.extension?.resolvedSettings?.map((s3) => s3.envVar) ?? []
403598
+ ],
403599
+ enableEnvironmentVariableRedaction: true
403600
+ }),
403547
403601
  cwd: mcpServerConfig.cwd,
403548
403602
  stderr: "pipe"
403549
403603
  });
@@ -403568,6 +403622,15 @@ function isEnabled(funcDecl, mcpServerName, mcpServerConfig) {
403568
403622
  }
403569
403623
  return !includeTools || includeTools.some((tool) => tool === funcDecl.name || tool.startsWith(`${funcDecl.name}(`));
403570
403624
  }
403625
+ function getExtensionEnvironment(extension) {
403626
+ const env2 = {};
403627
+ if (extension?.resolvedSettings) {
403628
+ for (const setting of extension.resolvedSettings) {
403629
+ env2[setting.envVar] = setting.value;
403630
+ }
403631
+ }
403632
+ return env2;
403633
+ }
403571
403634
 
403572
403635
  // packages/core/dist/src/tools/mcp-client-manager.js
403573
403636
  init_events();
@@ -405271,7 +405334,8 @@ var PolicyRuleSchema = external_exports.object({
405271
405334
  message: "priority must be <= 999 to prevent tier overflow. Priorities >= 1000 would jump to the next tier."
405272
405335
  }),
405273
405336
  modes: external_exports.array(external_exports.nativeEnum(ApprovalMode)).optional(),
405274
- allow_redirection: external_exports.boolean().optional()
405337
+ allow_redirection: external_exports.boolean().optional(),
405338
+ deny_message: external_exports.string().optional()
405275
405339
  });
405276
405340
  var SafetyCheckerRuleSchema = external_exports.object({
405277
405341
  toolName: external_exports.union([external_exports.string(), external_exports.array(external_exports.string())]).optional(),