@google/gemini-cli-a2a-server 0.16.0-nightly.20251112.c961f274 → 0.16.0-nightly.20251113.ad1f0d99
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 +136 -18
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/a2a-server.mjs
CHANGED
|
@@ -295938,8 +295938,8 @@ var Float64Vector = import_vector.default.Float64Vector;
|
|
|
295938
295938
|
var PointerVector = import_vector.default.PointerVector;
|
|
295939
295939
|
|
|
295940
295940
|
// packages/core/dist/src/generated/git-commit.js
|
|
295941
|
-
var GIT_COMMIT_INFO = "
|
|
295942
|
-
var CLI_VERSION = "0.16.0-nightly.
|
|
295941
|
+
var GIT_COMMIT_INFO = "ad1f0d99";
|
|
295942
|
+
var CLI_VERSION = "0.16.0-nightly.20251113.ad1f0d99";
|
|
295943
295943
|
|
|
295944
295944
|
// packages/core/dist/src/ide/detect-ide.js
|
|
295945
295945
|
var IDE_DEFINITIONS = {
|
|
@@ -298784,7 +298784,7 @@ async function createContentGenerator(config2, gcConfig, sessionId2) {
|
|
|
298784
298784
|
if (gcConfig.fakeResponses) {
|
|
298785
298785
|
return FakeContentGenerator.fromFile(gcConfig.fakeResponses);
|
|
298786
298786
|
}
|
|
298787
|
-
const version3 = "0.16.0-nightly.
|
|
298787
|
+
const version3 = "0.16.0-nightly.20251113.ad1f0d99";
|
|
298788
298788
|
const userAgent = `GeminiCLI/${version3} (${process.platform}; ${process.arch})`;
|
|
298789
298789
|
const baseHeaders = {
|
|
298790
298790
|
"User-Agent": userAgent
|
|
@@ -321227,6 +321227,10 @@ var ApprovalMode;
|
|
|
321227
321227
|
ApprovalMode2["AUTO_EDIT"] = "autoEdit";
|
|
321228
321228
|
ApprovalMode2["YOLO"] = "yolo";
|
|
321229
321229
|
})(ApprovalMode || (ApprovalMode = {}));
|
|
321230
|
+
var InProcessCheckerType;
|
|
321231
|
+
(function(InProcessCheckerType2) {
|
|
321232
|
+
InProcessCheckerType2["ALLOWED_PATH"] = "allowed-path";
|
|
321233
|
+
})(InProcessCheckerType || (InProcessCheckerType = {}));
|
|
321230
321234
|
|
|
321231
321235
|
// packages/core/dist/src/utils/LruCache.js
|
|
321232
321236
|
var LruCache = class {
|
|
@@ -345393,13 +345397,46 @@ var WriteTodosTool = class _WriteTodosTool extends BaseDeclarativeTool {
|
|
|
345393
345397
|
enum: TODO_STATUSES
|
|
345394
345398
|
}
|
|
345395
345399
|
},
|
|
345396
|
-
required: ["description", "status"]
|
|
345400
|
+
required: ["description", "status"],
|
|
345401
|
+
additionalProperties: false
|
|
345397
345402
|
}
|
|
345398
345403
|
}
|
|
345399
345404
|
},
|
|
345400
|
-
required: ["todos"]
|
|
345405
|
+
required: ["todos"],
|
|
345406
|
+
additionalProperties: false
|
|
345401
345407
|
});
|
|
345402
345408
|
}
|
|
345409
|
+
get schema() {
|
|
345410
|
+
return {
|
|
345411
|
+
name: this.name,
|
|
345412
|
+
description: this.description,
|
|
345413
|
+
parametersJsonSchema: this.parameterSchema,
|
|
345414
|
+
responseJsonSchema: {
|
|
345415
|
+
type: "object",
|
|
345416
|
+
properties: {
|
|
345417
|
+
todos: {
|
|
345418
|
+
type: "array",
|
|
345419
|
+
items: {
|
|
345420
|
+
type: "object",
|
|
345421
|
+
properties: {
|
|
345422
|
+
description: {
|
|
345423
|
+
type: "string"
|
|
345424
|
+
},
|
|
345425
|
+
status: {
|
|
345426
|
+
type: "string",
|
|
345427
|
+
enum: TODO_STATUSES
|
|
345428
|
+
}
|
|
345429
|
+
},
|
|
345430
|
+
required: ["description", "status"],
|
|
345431
|
+
additionalProperties: false
|
|
345432
|
+
}
|
|
345433
|
+
}
|
|
345434
|
+
},
|
|
345435
|
+
required: ["todos"],
|
|
345436
|
+
additionalProperties: false
|
|
345437
|
+
}
|
|
345438
|
+
};
|
|
345439
|
+
}
|
|
345403
345440
|
validateToolParamValues(params) {
|
|
345404
345441
|
const todos = params?.todos;
|
|
345405
345442
|
if (!params || !Array.isArray(todos)) {
|
|
@@ -352405,7 +352442,7 @@ var MessageBus = class extends EventEmitter10 {
|
|
|
352405
352442
|
emitMessage(message) {
|
|
352406
352443
|
this.emit(message.type, message);
|
|
352407
352444
|
}
|
|
352408
|
-
publish(message) {
|
|
352445
|
+
async publish(message) {
|
|
352409
352446
|
if (this.debug) {
|
|
352410
352447
|
console.debug(`[MESSAGE_BUS] publish: ${safeJsonStringify(message)}`);
|
|
352411
352448
|
}
|
|
@@ -352414,7 +352451,7 @@ var MessageBus = class extends EventEmitter10 {
|
|
|
352414
352451
|
throw new Error(`Invalid message structure: ${safeJsonStringify(message)}`);
|
|
352415
352452
|
}
|
|
352416
352453
|
if (message.type === MessageBusType.TOOL_CONFIRMATION_REQUEST) {
|
|
352417
|
-
const decision = this.policyEngine.check(message.toolCall, message.serverName);
|
|
352454
|
+
const { decision } = await this.policyEngine.check(message.toolCall, message.serverName);
|
|
352418
352455
|
switch (decision) {
|
|
352419
352456
|
case PolicyDecision.ALLOW:
|
|
352420
352457
|
this.emitMessage({
|
|
@@ -352511,6 +352548,14 @@ function stableStringify(obj) {
|
|
|
352511
352548
|
return stringify5(obj, /* @__PURE__ */ new Set());
|
|
352512
352549
|
}
|
|
352513
352550
|
|
|
352551
|
+
// packages/core/dist/src/safety/protocol.js
|
|
352552
|
+
var SafetyCheckDecision;
|
|
352553
|
+
(function(SafetyCheckDecision2) {
|
|
352554
|
+
SafetyCheckDecision2["ALLOW"] = "allow";
|
|
352555
|
+
SafetyCheckDecision2["DENY"] = "deny";
|
|
352556
|
+
SafetyCheckDecision2["ASK_USER"] = "ask_user";
|
|
352557
|
+
})(SafetyCheckDecision || (SafetyCheckDecision = {}));
|
|
352558
|
+
|
|
352514
352559
|
// packages/core/dist/src/policy/policy-engine.js
|
|
352515
352560
|
function ruleMatches(rule, toolCall, stringifiedArgs, serverName) {
|
|
352516
352561
|
if (rule.toolName) {
|
|
@@ -352540,30 +352585,71 @@ function ruleMatches(rule, toolCall, stringifiedArgs, serverName) {
|
|
|
352540
352585
|
}
|
|
352541
352586
|
var PolicyEngine = class {
|
|
352542
352587
|
rules;
|
|
352588
|
+
checkers;
|
|
352543
352589
|
defaultDecision;
|
|
352544
352590
|
nonInteractive;
|
|
352545
|
-
|
|
352591
|
+
checkerRunner;
|
|
352592
|
+
constructor(config2 = {}, checkerRunner) {
|
|
352546
352593
|
this.rules = (config2.rules ?? []).sort((a2, b) => (b.priority ?? 0) - (a2.priority ?? 0));
|
|
352594
|
+
this.checkers = (config2.checkers ?? []).sort((a2, b) => (b.priority ?? 0) - (a2.priority ?? 0));
|
|
352547
352595
|
this.defaultDecision = config2.defaultDecision ?? PolicyDecision.ASK_USER;
|
|
352548
352596
|
this.nonInteractive = config2.nonInteractive ?? false;
|
|
352597
|
+
this.checkerRunner = checkerRunner;
|
|
352549
352598
|
}
|
|
352550
352599
|
/**
|
|
352551
352600
|
* Check if a tool call is allowed based on the configured policies.
|
|
352601
|
+
* Returns the decision and the matching rule (if any).
|
|
352552
352602
|
*/
|
|
352553
|
-
check(toolCall, serverName) {
|
|
352603
|
+
async check(toolCall, serverName) {
|
|
352554
352604
|
let stringifiedArgs;
|
|
352555
|
-
if (toolCall.args && this.rules.some((rule) => rule.argsPattern)) {
|
|
352605
|
+
if (toolCall.args && (this.rules.some((rule) => rule.argsPattern) || this.checkers.some((checker) => checker.argsPattern))) {
|
|
352556
352606
|
stringifiedArgs = stableStringify(toolCall.args);
|
|
352557
352607
|
}
|
|
352558
352608
|
debugLogger.debug(`[PolicyEngine.check] toolCall.name: ${toolCall.name}, stringifiedArgs: ${stringifiedArgs}`);
|
|
352609
|
+
let matchedRule;
|
|
352610
|
+
let decision;
|
|
352559
352611
|
for (const rule of this.rules) {
|
|
352560
352612
|
if (ruleMatches(rule, toolCall, stringifiedArgs, serverName)) {
|
|
352561
352613
|
debugLogger.debug(`[PolicyEngine.check] MATCHED rule: toolName=${rule.toolName}, decision=${rule.decision}, priority=${rule.priority}, argsPattern=${rule.argsPattern?.source || "none"}`);
|
|
352562
|
-
|
|
352614
|
+
matchedRule = rule;
|
|
352615
|
+
decision = this.applyNonInteractiveMode(rule.decision);
|
|
352616
|
+
break;
|
|
352617
|
+
}
|
|
352618
|
+
}
|
|
352619
|
+
if (!decision) {
|
|
352620
|
+
debugLogger.debug(`[PolicyEngine.check] NO MATCH - using default decision: ${this.defaultDecision}`);
|
|
352621
|
+
decision = this.applyNonInteractiveMode(this.defaultDecision);
|
|
352622
|
+
}
|
|
352623
|
+
if (decision !== PolicyDecision.DENY && this.checkerRunner) {
|
|
352624
|
+
for (const checkerRule of this.checkers) {
|
|
352625
|
+
if (ruleMatches(checkerRule, toolCall, stringifiedArgs, serverName)) {
|
|
352626
|
+
debugLogger.debug(`[PolicyEngine.check] Running safety checker: ${checkerRule.checker.name}`);
|
|
352627
|
+
try {
|
|
352628
|
+
const result = await this.checkerRunner.runChecker(toolCall, checkerRule.checker);
|
|
352629
|
+
if (result.decision === SafetyCheckDecision.DENY) {
|
|
352630
|
+
debugLogger.debug(`[PolicyEngine.check] Safety checker denied: ${result.reason}`);
|
|
352631
|
+
return {
|
|
352632
|
+
decision: PolicyDecision.DENY,
|
|
352633
|
+
rule: matchedRule
|
|
352634
|
+
};
|
|
352635
|
+
} else if (result.decision === SafetyCheckDecision.ASK_USER) {
|
|
352636
|
+
debugLogger.debug(`[PolicyEngine.check] Safety checker requested ASK_USER: ${result.reason}`);
|
|
352637
|
+
decision = PolicyDecision.ASK_USER;
|
|
352638
|
+
}
|
|
352639
|
+
} catch (error) {
|
|
352640
|
+
debugLogger.debug(`[PolicyEngine.check] Safety checker failed: ${error}`);
|
|
352641
|
+
return {
|
|
352642
|
+
decision: PolicyDecision.DENY,
|
|
352643
|
+
rule: matchedRule
|
|
352644
|
+
};
|
|
352645
|
+
}
|
|
352646
|
+
}
|
|
352563
352647
|
}
|
|
352564
352648
|
}
|
|
352565
|
-
|
|
352566
|
-
|
|
352649
|
+
return {
|
|
352650
|
+
decision: this.applyNonInteractiveMode(decision),
|
|
352651
|
+
rule: matchedRule
|
|
352652
|
+
};
|
|
352567
352653
|
}
|
|
352568
352654
|
/**
|
|
352569
352655
|
* Add a new rule to the policy engine.
|
|
@@ -352572,6 +352658,10 @@ var PolicyEngine = class {
|
|
|
352572
352658
|
this.rules.push(rule);
|
|
352573
352659
|
this.rules.sort((a2, b) => (b.priority ?? 0) - (a2.priority ?? 0));
|
|
352574
352660
|
}
|
|
352661
|
+
addChecker(checker) {
|
|
352662
|
+
this.checkers.push(checker);
|
|
352663
|
+
this.checkers.sort((a2, b) => (b.priority ?? 0) - (a2.priority ?? 0));
|
|
352664
|
+
}
|
|
352575
352665
|
/**
|
|
352576
352666
|
* Remove rules for a specific tool.
|
|
352577
352667
|
*/
|
|
@@ -352584,6 +352674,9 @@ var PolicyEngine = class {
|
|
|
352584
352674
|
getRules() {
|
|
352585
352675
|
return this.rules;
|
|
352586
352676
|
}
|
|
352677
|
+
getCheckers() {
|
|
352678
|
+
return this.checkers;
|
|
352679
|
+
}
|
|
352587
352680
|
applyNonInteractiveMode(decision) {
|
|
352588
352681
|
if (this.nonInteractive && decision === PolicyDecision.ASK_USER) {
|
|
352589
352682
|
return PolicyDecision.DENY;
|
|
@@ -355076,8 +355169,9 @@ function getPlatform() {
|
|
|
355076
355169
|
async function getClientMetadata() {
|
|
355077
355170
|
if (!clientMetadataPromise) {
|
|
355078
355171
|
clientMetadataPromise = (async () => ({
|
|
355079
|
-
ideName: "
|
|
355080
|
-
|
|
355172
|
+
ideName: "IDE_UNSPECIFIED",
|
|
355173
|
+
pluginType: "GEMINI",
|
|
355174
|
+
ideVersion: "0.16.0-nightly.20251113.ad1f0d99",
|
|
355081
355175
|
platform: getPlatform(),
|
|
355082
355176
|
updateChannel: await getReleaseChannel(__dirname5)
|
|
355083
355177
|
}))();
|
|
@@ -360686,7 +360780,7 @@ var Config = class {
|
|
|
360686
360780
|
this.truncateToolOutputLines = params.truncateToolOutputLines ?? DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES;
|
|
360687
360781
|
this.enableToolOutputTruncation = params.enableToolOutputTruncation ?? true;
|
|
360688
360782
|
this.useSmartEdit = params.useSmartEdit ?? true;
|
|
360689
|
-
this.useWriteTodos = params.useWriteTodos ??
|
|
360783
|
+
this.useWriteTodos = params.useWriteTodos ?? true;
|
|
360690
360784
|
this.initialUseModelRouter = params.useModelRouter ?? false;
|
|
360691
360785
|
this.useModelRouter = this.initialUseModelRouter;
|
|
360692
360786
|
this.disableModelRouterForAuth = params.disableModelRouterForAuth ?? [];
|
|
@@ -360781,7 +360875,7 @@ var Config = class {
|
|
|
360781
360875
|
return;
|
|
360782
360876
|
for (const tool of deprecatedTools) {
|
|
360783
360877
|
if (list3.includes(tool.name) || list3.includes(tool.alternateName)) {
|
|
360784
|
-
coreEvents.emitFeedback("warning", `The tool '${tool.name}' (or '${tool.alternateName}') specified in '${listName}' is deprecated and will be removed in v0.
|
|
360878
|
+
coreEvents.emitFeedback("warning", `The tool '${tool.name}' (or '${tool.alternateName}') specified in '${listName}' is deprecated and will be removed in v0.16.0.`);
|
|
360785
360879
|
}
|
|
360786
360880
|
}
|
|
360787
360881
|
};
|
|
@@ -361416,8 +361510,32 @@ var PolicyRuleSchema = external_exports.object({
|
|
|
361416
361510
|
}),
|
|
361417
361511
|
modes: external_exports.array(external_exports.string()).optional()
|
|
361418
361512
|
});
|
|
361513
|
+
var SafetyCheckerRuleSchema = external_exports.object({
|
|
361514
|
+
toolName: external_exports.union([external_exports.string(), external_exports.array(external_exports.string())]).optional(),
|
|
361515
|
+
mcpName: external_exports.string().optional(),
|
|
361516
|
+
argsPattern: external_exports.string().optional(),
|
|
361517
|
+
commandPrefix: external_exports.union([external_exports.string(), external_exports.array(external_exports.string())]).optional(),
|
|
361518
|
+
commandRegex: external_exports.string().optional(),
|
|
361519
|
+
priority: external_exports.number().int().default(0),
|
|
361520
|
+
modes: external_exports.array(external_exports.string()).optional(),
|
|
361521
|
+
checker: external_exports.discriminatedUnion("type", [
|
|
361522
|
+
external_exports.object({
|
|
361523
|
+
type: external_exports.literal("in-process"),
|
|
361524
|
+
name: external_exports.nativeEnum(InProcessCheckerType),
|
|
361525
|
+
required_context: external_exports.array(external_exports.string()).optional(),
|
|
361526
|
+
config: external_exports.record(external_exports.unknown()).optional()
|
|
361527
|
+
}),
|
|
361528
|
+
external_exports.object({
|
|
361529
|
+
type: external_exports.literal("external"),
|
|
361530
|
+
name: external_exports.string(),
|
|
361531
|
+
required_context: external_exports.array(external_exports.string()).optional(),
|
|
361532
|
+
config: external_exports.record(external_exports.unknown()).optional()
|
|
361533
|
+
})
|
|
361534
|
+
])
|
|
361535
|
+
});
|
|
361419
361536
|
var PolicyFileSchema = external_exports.object({
|
|
361420
|
-
rule: external_exports.array(PolicyRuleSchema)
|
|
361537
|
+
rule: external_exports.array(PolicyRuleSchema).optional(),
|
|
361538
|
+
safety_checker: external_exports.array(SafetyCheckerRuleSchema).optional()
|
|
361421
361539
|
});
|
|
361422
361540
|
|
|
361423
361541
|
// packages/core/dist/src/policy/config.js
|