@google/gemini-cli-a2a-server 0.27.0-preview.3 → 0.28.0-nightly.20260130.d43d772e6
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.
- package/dist/a2a-server.mjs +119 -37
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/a2a-server.mjs
CHANGED
|
@@ -325925,14 +325925,16 @@ var ExtensionsSettingSchema = external_exports.object({
|
|
|
325925
325925
|
});
|
|
325926
325926
|
var CliFeatureSettingSchema = external_exports.object({
|
|
325927
325927
|
extensionsSetting: ExtensionsSettingSchema.optional(),
|
|
325928
|
-
|
|
325928
|
+
unmanagedCapabilitiesEnabled: external_exports.boolean().optional()
|
|
325929
325929
|
});
|
|
325930
325930
|
var McpSettingSchema = external_exports.object({
|
|
325931
325931
|
mcpEnabled: external_exports.boolean().optional(),
|
|
325932
325932
|
overrideMcpConfigJson: external_exports.string().optional()
|
|
325933
325933
|
});
|
|
325934
325934
|
var FetchAdminControlsResponseSchema = external_exports.object({
|
|
325935
|
+
// TODO: deprecate once backend stops sending this field
|
|
325935
325936
|
secureModeEnabled: external_exports.boolean().optional(),
|
|
325937
|
+
strictModeDisabled: external_exports.boolean().optional(),
|
|
325936
325938
|
mcpSetting: McpSettingSchema.optional(),
|
|
325937
325939
|
cliFeatureSetting: CliFeatureSettingSchema.optional()
|
|
325938
325940
|
});
|
|
@@ -326597,7 +326599,7 @@ var __filename = fileURLToPath5(import.meta.url);
|
|
|
326597
326599
|
var __dirname3 = path20.dirname(__filename);
|
|
326598
326600
|
async function getVersion() {
|
|
326599
326601
|
const pkgJson = await getPackageJson(__dirname3);
|
|
326600
|
-
return "0.
|
|
326602
|
+
return "0.28.0-nightly.20260130.d43d772e6";
|
|
326601
326603
|
}
|
|
326602
326604
|
|
|
326603
326605
|
// packages/core/dist/src/code_assist/experiments/client_metadata.js
|
|
@@ -330003,8 +330005,8 @@ var Float64Vector = import_vector.default.Float64Vector;
|
|
|
330003
330005
|
var PointerVector = import_vector.default.PointerVector;
|
|
330004
330006
|
|
|
330005
330007
|
// packages/core/dist/src/generated/git-commit.js
|
|
330006
|
-
var GIT_COMMIT_INFO = "
|
|
330007
|
-
var CLI_VERSION = "0.
|
|
330008
|
+
var GIT_COMMIT_INFO = "d43d772e6";
|
|
330009
|
+
var CLI_VERSION = "0.28.0-nightly.20260130.d43d772e6";
|
|
330008
330010
|
|
|
330009
330011
|
// packages/core/dist/src/ide/detect-ide.js
|
|
330010
330012
|
var IDE_DEFINITIONS = {
|
|
@@ -330017,6 +330019,7 @@ var IDE_DEFINITIONS = {
|
|
|
330017
330019
|
trae: { name: "trae", displayName: "Trae" },
|
|
330018
330020
|
vscode: { name: "vscode", displayName: "VS Code" },
|
|
330019
330021
|
vscodefork: { name: "vscodefork", displayName: "IDE" },
|
|
330022
|
+
positron: { name: "positron", displayName: "Positron" },
|
|
330020
330023
|
antigravity: { name: "antigravity", displayName: "Antigravity" },
|
|
330021
330024
|
sublimetext: { name: "sublimetext", displayName: "Sublime Text" },
|
|
330022
330025
|
jetbrains: { name: "jetbrains", displayName: "JetBrains IDE" },
|
|
@@ -330061,6 +330064,9 @@ function detectIdeFromEnv() {
|
|
|
330061
330064
|
if (process.env["MONOSPACE_ENV"]) {
|
|
330062
330065
|
return IDE_DEFINITIONS.firebasestudio;
|
|
330063
330066
|
}
|
|
330067
|
+
if (process.env["POSITRON"] === "1") {
|
|
330068
|
+
return IDE_DEFINITIONS.positron;
|
|
330069
|
+
}
|
|
330064
330070
|
if (process.env["TERM_PROGRAM"] === "sublime") {
|
|
330065
330071
|
return IDE_DEFINITIONS.sublimetext;
|
|
330066
330072
|
}
|
|
@@ -333386,6 +333392,7 @@ async function createContentGenerator(config3, gcConfig, sessionId2) {
|
|
|
333386
333392
|
const userAgent = `GeminiCLI/${version4}/${model} (${process.platform}; ${process.arch})`;
|
|
333387
333393
|
const customHeadersMap = parseCustomHeaders(customHeadersEnv);
|
|
333388
333394
|
const apiKeyAuthMechanism = process.env["GEMINI_API_KEY_AUTH_MECHANISM"] || "x-goog-api-key";
|
|
333395
|
+
const apiVersionEnv = process.env["GOOGLE_GENAI_API_VERSION"];
|
|
333389
333396
|
const baseHeaders = {
|
|
333390
333397
|
...customHeadersMap,
|
|
333391
333398
|
"User-Agent": userAgent
|
|
@@ -333411,7 +333418,8 @@ async function createContentGenerator(config3, gcConfig, sessionId2) {
|
|
|
333411
333418
|
const googleGenAI = new GoogleGenAI({
|
|
333412
333419
|
apiKey: config3.apiKey === "" ? void 0 : config3.apiKey,
|
|
333413
333420
|
vertexai: config3.vertexai,
|
|
333414
|
-
httpOptions
|
|
333421
|
+
httpOptions,
|
|
333422
|
+
...apiVersionEnv && { apiVersion: apiVersionEnv }
|
|
333415
333423
|
});
|
|
333416
333424
|
return new LoggingContentGenerator(googleGenAI.models, gcConfig);
|
|
333417
333425
|
}
|
|
@@ -334923,11 +334931,11 @@ async function detectFileType(filePath) {
|
|
|
334923
334931
|
if (lookedUpMimeType.startsWith("image/")) {
|
|
334924
334932
|
return "image";
|
|
334925
334933
|
}
|
|
334926
|
-
if (lookedUpMimeType.startsWith("audio/")) {
|
|
334927
|
-
|
|
334928
|
-
|
|
334929
|
-
|
|
334930
|
-
return "video";
|
|
334934
|
+
if (lookedUpMimeType.startsWith("audio/") || lookedUpMimeType.startsWith("video/")) {
|
|
334935
|
+
if (!await isBinaryFile(filePath)) {
|
|
334936
|
+
return "text";
|
|
334937
|
+
}
|
|
334938
|
+
return lookedUpMimeType.startsWith("audio/") ? "audio" : "video";
|
|
334931
334939
|
}
|
|
334932
334940
|
if (lookedUpMimeType === "application/pdf") {
|
|
334933
334941
|
return "pdf";
|
|
@@ -335098,11 +335106,14 @@ ${processedLines.join("\n")}`;
|
|
|
335098
335106
|
...${snippet2}`;
|
|
335099
335107
|
}
|
|
335100
335108
|
}
|
|
335109
|
+
var TOOL_OUTPUT_DIR = "tool_output";
|
|
335101
335110
|
async function saveTruncatedToolOutput(content, toolName, id, projectTempDir) {
|
|
335102
335111
|
const safeToolName = toolName.replace(/[^a-z0-9]/gi, "_").toLowerCase();
|
|
335103
335112
|
const safeId = id.toString().replace(/[^a-z0-9]/gi, "_").toLowerCase();
|
|
335104
335113
|
const fileName = `${safeToolName}_${safeId}.txt`;
|
|
335105
|
-
const
|
|
335114
|
+
const toolOutputDir = path26.join(projectTempDir, TOOL_OUTPUT_DIR);
|
|
335115
|
+
const outputFile = path26.join(toolOutputDir, fileName);
|
|
335116
|
+
await fsPromises3.mkdir(toolOutputDir, { recursive: true });
|
|
335106
335117
|
await fsPromises3.writeFile(outputFile, content);
|
|
335107
335118
|
const lines = content.split("\n");
|
|
335108
335119
|
return {
|
|
@@ -373791,7 +373802,10 @@ var NEVER_ALLOWED_ENVIRONMENT_VARIABLES = /* @__PURE__ */ new Set([
|
|
|
373791
373802
|
"DATABASE_URL",
|
|
373792
373803
|
"GOOGLE_CLOUD_PROJECT",
|
|
373793
373804
|
"GOOGLE_CLOUD_ACCOUNT",
|
|
373794
|
-
"FIREBASE_PROJECT_ID"
|
|
373805
|
+
"FIREBASE_PROJECT_ID",
|
|
373806
|
+
"GEMINI_API_KEY",
|
|
373807
|
+
"GOOGLE_API_KEY",
|
|
373808
|
+
"GOOGLE_APPLICATION_CREDENTIALS"
|
|
373795
373809
|
]);
|
|
373796
373810
|
var NEVER_ALLOWED_NAME_PATTERNS = [
|
|
373797
373811
|
/TOKEN/i,
|
|
@@ -381859,7 +381873,8 @@ var ToolExecutor = class {
|
|
|
381859
381873
|
} else if (toolResult.error === void 0) {
|
|
381860
381874
|
return await this.createSuccessResult(call, toolResult);
|
|
381861
381875
|
} else {
|
|
381862
|
-
|
|
381876
|
+
const displayText = typeof toolResult.returnDisplay === "string" ? toolResult.returnDisplay : void 0;
|
|
381877
|
+
return this.createErrorResult(call, new Error(toolResult.error.message), toolResult.error.type, displayText);
|
|
381863
381878
|
}
|
|
381864
381879
|
} catch (executionError) {
|
|
381865
381880
|
spanMetadata.error = executionError;
|
|
@@ -381948,8 +381963,8 @@ var ToolExecutor = class {
|
|
|
381948
381963
|
outcome: call.outcome
|
|
381949
381964
|
};
|
|
381950
381965
|
}
|
|
381951
|
-
createErrorResult(call, error2, errorType) {
|
|
381952
|
-
const response = this.createErrorResponse(call.request, error2, errorType);
|
|
381966
|
+
createErrorResult(call, error2, errorType, returnDisplay) {
|
|
381967
|
+
const response = this.createErrorResponse(call.request, error2, errorType, returnDisplay);
|
|
381953
381968
|
const startTime = "startTime" in call ? call.startTime : void 0;
|
|
381954
381969
|
return {
|
|
381955
381970
|
status: "error",
|
|
@@ -381960,7 +381975,8 @@ var ToolExecutor = class {
|
|
|
381960
381975
|
outcome: call.outcome
|
|
381961
381976
|
};
|
|
381962
381977
|
}
|
|
381963
|
-
createErrorResponse(request3, error2, errorType) {
|
|
381978
|
+
createErrorResponse(request3, error2, errorType, returnDisplay) {
|
|
381979
|
+
const displayText = returnDisplay ?? error2.message;
|
|
381964
381980
|
return {
|
|
381965
381981
|
callId: request3.callId,
|
|
381966
381982
|
error: error2,
|
|
@@ -381973,9 +381989,9 @@ var ToolExecutor = class {
|
|
|
381973
381989
|
}
|
|
381974
381990
|
}
|
|
381975
381991
|
],
|
|
381976
|
-
resultDisplay:
|
|
381992
|
+
resultDisplay: displayText,
|
|
381977
381993
|
errorType,
|
|
381978
|
-
contentLength:
|
|
381994
|
+
contentLength: displayText.length
|
|
381979
381995
|
};
|
|
381980
381996
|
}
|
|
381981
381997
|
};
|
|
@@ -382852,6 +382868,21 @@ var ChatRecordingService = class {
|
|
|
382852
382868
|
debugLogger.error("Error saving summary to chat history.", error2);
|
|
382853
382869
|
}
|
|
382854
382870
|
}
|
|
382871
|
+
/**
|
|
382872
|
+
* Records workspace directories to the session file.
|
|
382873
|
+
* Called when directories are added via /dir add.
|
|
382874
|
+
*/
|
|
382875
|
+
recordDirectories(directories) {
|
|
382876
|
+
if (!this.conversationFile)
|
|
382877
|
+
return;
|
|
382878
|
+
try {
|
|
382879
|
+
this.updateConversation((conversation) => {
|
|
382880
|
+
conversation.directories = [...directories];
|
|
382881
|
+
});
|
|
382882
|
+
} catch (error2) {
|
|
382883
|
+
debugLogger.error("Error saving directories to chat history.", error2);
|
|
382884
|
+
}
|
|
382885
|
+
}
|
|
382855
382886
|
/**
|
|
382856
382887
|
* Gets the current conversation data (for summary generation).
|
|
382857
382888
|
*/
|
|
@@ -390352,6 +390383,15 @@ var GitService = class _GitService {
|
|
|
390352
390383
|
return false;
|
|
390353
390384
|
}
|
|
390354
390385
|
}
|
|
390386
|
+
getShadowRepoEnv(repoDir) {
|
|
390387
|
+
const gitConfigPath = path59.join(repoDir, ".gitconfig");
|
|
390388
|
+
const systemConfigPath = path59.join(repoDir, ".gitconfig_system_empty");
|
|
390389
|
+
return {
|
|
390390
|
+
// Prevent git from using the user's global git config.
|
|
390391
|
+
GIT_CONFIG_GLOBAL: gitConfigPath,
|
|
390392
|
+
GIT_CONFIG_SYSTEM: systemConfigPath
|
|
390393
|
+
};
|
|
390394
|
+
}
|
|
390355
390395
|
/**
|
|
390356
390396
|
* Creates a hidden git repository in the project root.
|
|
390357
390397
|
* The Git repository is used to support checkpointing.
|
|
@@ -390362,7 +390402,9 @@ var GitService = class _GitService {
|
|
|
390362
390402
|
await fs51.mkdir(repoDir, { recursive: true });
|
|
390363
390403
|
const gitConfigContent = "[user]\n name = Gemini CLI\n email = gemini-cli@google.com\n[commit]\n gpgsign = false\n";
|
|
390364
390404
|
await fs51.writeFile(gitConfigPath, gitConfigContent);
|
|
390365
|
-
const
|
|
390405
|
+
const shadowRepoEnv = this.getShadowRepoEnv(repoDir);
|
|
390406
|
+
await fs51.writeFile(shadowRepoEnv.GIT_CONFIG_SYSTEM, "");
|
|
390407
|
+
const repo = simpleGit(repoDir).env(shadowRepoEnv);
|
|
390366
390408
|
let isRepoDefined = false;
|
|
390367
390409
|
try {
|
|
390368
390410
|
isRepoDefined = await repo.checkIsRepo(CheckRepoActions.IS_REPO_ROOT);
|
|
@@ -390392,9 +390434,7 @@ var GitService = class _GitService {
|
|
|
390392
390434
|
return simpleGit(this.projectRoot).env({
|
|
390393
390435
|
GIT_DIR: path59.join(repoDir, ".git"),
|
|
390394
390436
|
GIT_WORK_TREE: this.projectRoot,
|
|
390395
|
-
|
|
390396
|
-
HOME: repoDir,
|
|
390397
|
-
XDG_CONFIG_HOME: repoDir
|
|
390437
|
+
...this.getShadowRepoEnv(repoDir)
|
|
390398
390438
|
});
|
|
390399
390439
|
}
|
|
390400
390440
|
async getCurrentCommitHash() {
|
|
@@ -393200,6 +393240,12 @@ var HookEventHandler = class {
|
|
|
393200
393240
|
hookPlanner;
|
|
393201
393241
|
hookRunner;
|
|
393202
393242
|
hookAggregator;
|
|
393243
|
+
/**
|
|
393244
|
+
* Track reported failures to suppress duplicate warnings during streaming.
|
|
393245
|
+
* Uses a WeakMap with the original request object as a key to ensure
|
|
393246
|
+
* failures are only reported once per logical model interaction.
|
|
393247
|
+
*/
|
|
393248
|
+
reportedFailures = /* @__PURE__ */ new WeakMap();
|
|
393203
393249
|
constructor(config3, hookPlanner, hookRunner, hookAggregator) {
|
|
393204
393250
|
this.config = config3;
|
|
393205
393251
|
this.hookPlanner = hookPlanner;
|
|
@@ -393313,7 +393359,7 @@ var HookEventHandler = class {
|
|
|
393313
393359
|
...this.createBaseInput(HookEventName.BeforeModel),
|
|
393314
393360
|
llm_request: defaultHookTranslator.toHookLLMRequest(llmRequest)
|
|
393315
393361
|
};
|
|
393316
|
-
return this.executeHooks(HookEventName.BeforeModel, input);
|
|
393362
|
+
return this.executeHooks(HookEventName.BeforeModel, input, void 0, llmRequest);
|
|
393317
393363
|
}
|
|
393318
393364
|
/**
|
|
393319
393365
|
* Fire an AfterModel event
|
|
@@ -393325,7 +393371,7 @@ var HookEventHandler = class {
|
|
|
393325
393371
|
llm_request: defaultHookTranslator.toHookLLMRequest(llmRequest),
|
|
393326
393372
|
llm_response: defaultHookTranslator.toHookLLMResponse(llmResponse)
|
|
393327
393373
|
};
|
|
393328
|
-
return this.executeHooks(HookEventName.AfterModel, input);
|
|
393374
|
+
return this.executeHooks(HookEventName.AfterModel, input, void 0, llmRequest);
|
|
393329
393375
|
}
|
|
393330
393376
|
/**
|
|
393331
393377
|
* Fire a BeforeToolSelection event
|
|
@@ -393336,13 +393382,13 @@ var HookEventHandler = class {
|
|
|
393336
393382
|
...this.createBaseInput(HookEventName.BeforeToolSelection),
|
|
393337
393383
|
llm_request: defaultHookTranslator.toHookLLMRequest(llmRequest)
|
|
393338
393384
|
};
|
|
393339
|
-
return this.executeHooks(HookEventName.BeforeToolSelection, input);
|
|
393385
|
+
return this.executeHooks(HookEventName.BeforeToolSelection, input, void 0, llmRequest);
|
|
393340
393386
|
}
|
|
393341
393387
|
/**
|
|
393342
393388
|
* Execute hooks for a specific event (direct execution without MessageBus)
|
|
393343
393389
|
* Used as fallback when MessageBus is not available
|
|
393344
393390
|
*/
|
|
393345
|
-
async executeHooks(eventName, input, context2) {
|
|
393391
|
+
async executeHooks(eventName, input, context2, requestContext) {
|
|
393346
393392
|
try {
|
|
393347
393393
|
const plan = this.hookPlanner.createExecutionPlan(eventName, context2);
|
|
393348
393394
|
if (!plan || plan.hookConfigs.length === 0) {
|
|
@@ -393371,7 +393417,7 @@ var HookEventHandler = class {
|
|
|
393371
393417
|
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
393418
|
const aggregated = this.hookAggregator.aggregateResults(results, eventName);
|
|
393373
393419
|
this.processCommonHookOutputFields(aggregated);
|
|
393374
|
-
this.logHookExecution(eventName, input, results, aggregated);
|
|
393420
|
+
this.logHookExecution(eventName, input, results, aggregated, requestContext);
|
|
393375
393421
|
return aggregated;
|
|
393376
393422
|
} catch (error2) {
|
|
393377
393423
|
debugLogger.error(`Hook event bus error for ${eventName}: ${error2}`);
|
|
@@ -393399,15 +393445,31 @@ var HookEventHandler = class {
|
|
|
393399
393445
|
/**
|
|
393400
393446
|
* Log hook execution for observability
|
|
393401
393447
|
*/
|
|
393402
|
-
logHookExecution(eventName, input, results, aggregated) {
|
|
393448
|
+
logHookExecution(eventName, input, results, aggregated, requestContext) {
|
|
393403
393449
|
const failedHooks = results.filter((r3) => !r3.success);
|
|
393404
393450
|
const successCount = results.length - failedHooks.length;
|
|
393405
393451
|
const errorCount = failedHooks.length;
|
|
393406
393452
|
if (errorCount > 0) {
|
|
393407
393453
|
const failedNames = failedHooks.map((r3) => this.getHookNameFromResult(r3)).join(", ");
|
|
393454
|
+
let shouldEmit = true;
|
|
393455
|
+
if (requestContext) {
|
|
393456
|
+
let reportedSet = this.reportedFailures.get(requestContext);
|
|
393457
|
+
if (!reportedSet) {
|
|
393458
|
+
reportedSet = /* @__PURE__ */ new Set();
|
|
393459
|
+
this.reportedFailures.set(requestContext, reportedSet);
|
|
393460
|
+
}
|
|
393461
|
+
const failureKey = `${eventName}:${failedNames}`;
|
|
393462
|
+
if (reportedSet.has(failureKey)) {
|
|
393463
|
+
shouldEmit = false;
|
|
393464
|
+
} else {
|
|
393465
|
+
reportedSet.add(failureKey);
|
|
393466
|
+
}
|
|
393467
|
+
}
|
|
393408
393468
|
debugLogger.warn(`Hook execution for ${eventName}: ${successCount} succeeded, ${errorCount} failed (${failedNames}), total duration: ${aggregated.totalDuration}ms`);
|
|
393409
|
-
|
|
393469
|
+
if (shouldEmit) {
|
|
393470
|
+
coreEvents.emitFeedback("warning", `Hook(s) [${failedNames}] failed for event ${eventName}. Press F12 to see the debug drawer for more details.
|
|
393410
393471
|
`);
|
|
393472
|
+
}
|
|
393411
393473
|
} else {
|
|
393412
393474
|
debugLogger.debug(`Hook execution for ${eventName}: ${successCount} hooks executed successfully, total duration: ${aggregated.totalDuration}ms`);
|
|
393413
393475
|
}
|
|
@@ -399142,13 +399204,14 @@ init_tools();
|
|
|
399142
399204
|
init_tool_names();
|
|
399143
399205
|
async function checkPolicy(toolCall, config3) {
|
|
399144
399206
|
const serverName = toolCall.tool instanceof DiscoveredMCPTool ? toolCall.tool.serverName : void 0;
|
|
399145
|
-
const
|
|
399207
|
+
const result2 = await config3.getPolicyEngine().check({ name: toolCall.request.name, args: toolCall.request.args }, serverName);
|
|
399208
|
+
const { decision } = result2;
|
|
399146
399209
|
if (decision === PolicyDecision.ASK_USER) {
|
|
399147
399210
|
if (!config3.isInteractive()) {
|
|
399148
399211
|
throw new Error(`Tool execution for "${toolCall.tool.displayName || toolCall.tool.name}" requires user confirmation, which is not supported in non-interactive mode.`);
|
|
399149
399212
|
}
|
|
399150
399213
|
}
|
|
399151
|
-
return decision;
|
|
399214
|
+
return { decision, rule: result2.rule };
|
|
399152
399215
|
}
|
|
399153
399216
|
async function updatePolicy(tool, outcome, confirmationDetails, deps) {
|
|
399154
399217
|
if (isAutoEditTransition(tool, outcome)) {
|
|
@@ -399434,9 +399497,10 @@ var Scheduler2 = class _Scheduler {
|
|
|
399434
399497
|
// --- Phase 3: Single Call Orchestration ---
|
|
399435
399498
|
async _processToolCall(toolCall, signal) {
|
|
399436
399499
|
const callId = toolCall.request.callId;
|
|
399437
|
-
const decision = await checkPolicy(toolCall, this.config);
|
|
399500
|
+
const { decision, rule } = await checkPolicy(toolCall, this.config);
|
|
399438
399501
|
if (decision === PolicyDecision.DENY) {
|
|
399439
|
-
|
|
399502
|
+
const denyMessage = rule?.denyMessage ? ` ${rule.denyMessage}` : "";
|
|
399503
|
+
this.state.updateStatus(callId, "error", createErrorResponse2(toolCall.request, new Error(`Tool execution denied by policy.${denyMessage}`), ToolErrorType.POLICY_VIOLATION));
|
|
399440
399504
|
this.state.finalizeCall(callId);
|
|
399441
399505
|
return;
|
|
399442
399506
|
}
|
|
@@ -403540,10 +403604,18 @@ async function createTransport(mcpServerName, mcpServerConfig, debugMode, saniti
|
|
|
403540
403604
|
const transport = new StdioClientTransport({
|
|
403541
403605
|
command: mcpServerConfig.command,
|
|
403542
403606
|
args: mcpServerConfig.args || [],
|
|
403543
|
-
env: {
|
|
403544
|
-
...
|
|
403607
|
+
env: sanitizeEnvironment({
|
|
403608
|
+
...process.env,
|
|
403609
|
+
...getExtensionEnvironment(mcpServerConfig.extension),
|
|
403545
403610
|
...mcpServerConfig.env || {}
|
|
403546
|
-
},
|
|
403611
|
+
}, {
|
|
403612
|
+
...sanitizationConfig,
|
|
403613
|
+
allowedEnvironmentVariables: [
|
|
403614
|
+
...sanitizationConfig.allowedEnvironmentVariables ?? [],
|
|
403615
|
+
...mcpServerConfig.extension?.resolvedSettings?.map((s3) => s3.envVar) ?? []
|
|
403616
|
+
],
|
|
403617
|
+
enableEnvironmentVariableRedaction: true
|
|
403618
|
+
}),
|
|
403547
403619
|
cwd: mcpServerConfig.cwd,
|
|
403548
403620
|
stderr: "pipe"
|
|
403549
403621
|
});
|
|
@@ -403568,6 +403640,15 @@ function isEnabled(funcDecl, mcpServerName, mcpServerConfig) {
|
|
|
403568
403640
|
}
|
|
403569
403641
|
return !includeTools || includeTools.some((tool) => tool === funcDecl.name || tool.startsWith(`${funcDecl.name}(`));
|
|
403570
403642
|
}
|
|
403643
|
+
function getExtensionEnvironment(extension) {
|
|
403644
|
+
const env2 = {};
|
|
403645
|
+
if (extension?.resolvedSettings) {
|
|
403646
|
+
for (const setting of extension.resolvedSettings) {
|
|
403647
|
+
env2[setting.envVar] = setting.value;
|
|
403648
|
+
}
|
|
403649
|
+
}
|
|
403650
|
+
return env2;
|
|
403651
|
+
}
|
|
403571
403652
|
|
|
403572
403653
|
// packages/core/dist/src/tools/mcp-client-manager.js
|
|
403573
403654
|
init_events();
|
|
@@ -405271,7 +405352,8 @@ var PolicyRuleSchema = external_exports.object({
|
|
|
405271
405352
|
message: "priority must be <= 999 to prevent tier overflow. Priorities >= 1000 would jump to the next tier."
|
|
405272
405353
|
}),
|
|
405273
405354
|
modes: external_exports.array(external_exports.nativeEnum(ApprovalMode)).optional(),
|
|
405274
|
-
allow_redirection: external_exports.boolean().optional()
|
|
405355
|
+
allow_redirection: external_exports.boolean().optional(),
|
|
405356
|
+
deny_message: external_exports.string().optional()
|
|
405275
405357
|
});
|
|
405276
405358
|
var SafetyCheckerRuleSchema = external_exports.object({
|
|
405277
405359
|
toolName: external_exports.union([external_exports.string(), external_exports.array(external_exports.string())]).optional(),
|