@google/gemini-cli-a2a-server 0.34.0-preview.0 → 0.34.0-preview.2
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 +66 -47
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/a2a-server.mjs
CHANGED
|
@@ -108591,7 +108591,7 @@ var init_mcp_tool = __esm({
|
|
|
108591
108591
|
return safeJsonStringify(this.params);
|
|
108592
108592
|
}
|
|
108593
108593
|
};
|
|
108594
|
-
DiscoveredMCPTool = class
|
|
108594
|
+
DiscoveredMCPTool = class extends BaseDeclarativeTool {
|
|
108595
108595
|
mcpTool;
|
|
108596
108596
|
serverName;
|
|
108597
108597
|
serverToolName;
|
|
@@ -108643,9 +108643,6 @@ var init_mcp_tool = __esm({
|
|
|
108643
108643
|
getFullyQualifiedName() {
|
|
108644
108644
|
return generateValidName(`${this.serverName}${MCP_QUALIFIED_NAME_SEPARATOR}${this.serverToolName}`);
|
|
108645
108645
|
}
|
|
108646
|
-
asFullyQualifiedTool() {
|
|
108647
|
-
return new _DiscoveredMCPTool(this.mcpTool, this.serverName, this.serverToolName, this.description, this.parameterSchema, this.messageBus, this.trust, this.isReadOnly, this.getFullyQualifiedName(), this.cliConfig, this.extensionName, this.extensionId, this._toolAnnotations);
|
|
108648
|
-
}
|
|
108649
108646
|
createInvocation(params, messageBus, _toolName, _displayName) {
|
|
108650
108647
|
return new DiscoveredMCPToolInvocation(this.mcpTool, this.serverName, this.serverToolName, _displayName ?? this.displayName, messageBus, this.trust, params, this.cliConfig, this.description, this.parameterSchema, this._toolAnnotations);
|
|
108651
108648
|
}
|
|
@@ -198647,18 +198644,28 @@ function isValidToolName(name3, options = {}) {
|
|
|
198647
198644
|
if (options.allowWildcards && name3 === "*") {
|
|
198648
198645
|
return true;
|
|
198649
198646
|
}
|
|
198650
|
-
if (name3
|
|
198651
|
-
|
|
198652
|
-
|
|
198647
|
+
if (isMcpToolName(name3)) {
|
|
198648
|
+
if (name3 === `${MCP_TOOL_PREFIX}*` && options.allowWildcards) {
|
|
198649
|
+
return true;
|
|
198650
|
+
}
|
|
198651
|
+
if (name3.startsWith(`${MCP_TOOL_PREFIX}_`)) {
|
|
198653
198652
|
return false;
|
|
198654
198653
|
}
|
|
198655
|
-
const
|
|
198656
|
-
|
|
198657
|
-
|
|
198658
|
-
|
|
198654
|
+
const parsed = parseMcpToolName(name3);
|
|
198655
|
+
if (parsed.serverName && parsed.toolName) {
|
|
198656
|
+
const slugRegex = /^[a-z0-9_.:-]+$/i;
|
|
198657
|
+
if (!slugRegex.test(parsed.serverName)) {
|
|
198658
|
+
return false;
|
|
198659
|
+
}
|
|
198660
|
+
if (parsed.toolName === "*") {
|
|
198661
|
+
return options.allowWildcards === true;
|
|
198662
|
+
}
|
|
198663
|
+
if (/^_*$/.test(parsed.toolName)) {
|
|
198664
|
+
return false;
|
|
198665
|
+
}
|
|
198666
|
+
return slugRegex.test(parsed.toolName);
|
|
198659
198667
|
}
|
|
198660
|
-
|
|
198661
|
-
return slugRegex.test(server) && slugRegex.test(tool);
|
|
198668
|
+
return false;
|
|
198662
198669
|
}
|
|
198663
198670
|
return false;
|
|
198664
198671
|
}
|
|
@@ -198667,6 +198674,7 @@ var init_tool_names = __esm({
|
|
|
198667
198674
|
"packages/core/dist/src/tools/tool-names.js"() {
|
|
198668
198675
|
"use strict";
|
|
198669
198676
|
init_coreTools();
|
|
198677
|
+
init_mcp_tool();
|
|
198670
198678
|
EDIT_TOOL_NAMES = /* @__PURE__ */ new Set([EDIT_TOOL_NAME, WRITE_FILE_TOOL_NAME]);
|
|
198671
198679
|
TRACKER_CREATE_TASK_TOOL_NAME = "tracker_create_task";
|
|
198672
198680
|
TRACKER_UPDATE_TASK_TOOL_NAME = "tracker_update_task";
|
|
@@ -200231,8 +200239,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
|
|
|
200231
200239
|
var init_git_commit = __esm({
|
|
200232
200240
|
"packages/core/dist/src/generated/git-commit.js"() {
|
|
200233
200241
|
"use strict";
|
|
200234
|
-
GIT_COMMIT_INFO = "
|
|
200235
|
-
CLI_VERSION = "0.34.0-preview.
|
|
200242
|
+
GIT_COMMIT_INFO = "4085b4f8e";
|
|
200243
|
+
CLI_VERSION = "0.34.0-preview.2";
|
|
200236
200244
|
}
|
|
200237
200245
|
});
|
|
200238
200246
|
|
|
@@ -322624,7 +322632,7 @@ function getVersion() {
|
|
|
322624
322632
|
}
|
|
322625
322633
|
versionPromise = (async () => {
|
|
322626
322634
|
const pkgJson = await getPackageJson(__dirname3);
|
|
322627
|
-
return "0.34.0-preview.
|
|
322635
|
+
return "0.34.0-preview.2";
|
|
322628
322636
|
})();
|
|
322629
322637
|
return versionPromise;
|
|
322630
322638
|
}
|
|
@@ -324525,11 +324533,7 @@ Signal: Signal number or \`(none)\` if no signal was received.
|
|
|
324525
324533
|
*/
|
|
324526
324534
|
registerTool(tool) {
|
|
324527
324535
|
if (this.allKnownTools.has(tool.name)) {
|
|
324528
|
-
|
|
324529
|
-
tool = tool.asFullyQualifiedTool();
|
|
324530
|
-
} else {
|
|
324531
|
-
debugLogger.warn(`Tool with name "${tool.name}" is already registered. Overwriting.`);
|
|
324532
|
-
}
|
|
324536
|
+
debugLogger.warn(`Tool with name "${tool.name}" is already registered. Overwriting.`);
|
|
324533
324537
|
}
|
|
324534
324538
|
this.allKnownTools.set(tool.name, tool);
|
|
324535
324539
|
}
|
|
@@ -324803,7 +324807,14 @@ Signal: Signal number or \`(none)\` if no signal was received.
|
|
|
324803
324807
|
for (const name3 of toolNames) {
|
|
324804
324808
|
const tool = this.getTool(name3);
|
|
324805
324809
|
if (tool) {
|
|
324806
|
-
|
|
324810
|
+
let schema2 = tool.getSchema(modelId);
|
|
324811
|
+
if (tool instanceof DiscoveredMCPTool) {
|
|
324812
|
+
schema2 = {
|
|
324813
|
+
...schema2,
|
|
324814
|
+
name: tool.getFullyQualifiedName()
|
|
324815
|
+
};
|
|
324816
|
+
}
|
|
324817
|
+
declarations.push(schema2);
|
|
324807
324818
|
}
|
|
324808
324819
|
}
|
|
324809
324820
|
return declarations;
|
|
@@ -324863,16 +324874,6 @@ Signal: Signal number or \`(none)\` if no signal was received.
|
|
|
324863
324874
|
debugLogger.debug(`Resolved legacy tool name "${name3}" to current name "${currentName}"`);
|
|
324864
324875
|
}
|
|
324865
324876
|
}
|
|
324866
|
-
if (!tool && name3.includes("__")) {
|
|
324867
|
-
for (const t3 of this.allKnownTools.values()) {
|
|
324868
|
-
if (t3 instanceof DiscoveredMCPTool) {
|
|
324869
|
-
if (t3.getFullyQualifiedName() === name3) {
|
|
324870
|
-
tool = t3;
|
|
324871
|
-
break;
|
|
324872
|
-
}
|
|
324873
|
-
}
|
|
324874
|
-
}
|
|
324875
|
-
}
|
|
324876
324877
|
if (tool && this.isActiveTool(tool)) {
|
|
324877
324878
|
return tool;
|
|
324878
324879
|
}
|
|
@@ -394987,7 +394988,7 @@ var init_agentLoader = __esm({
|
|
|
394987
394988
|
name: nameSchema,
|
|
394988
394989
|
description: external_exports.string().min(1),
|
|
394989
394990
|
display_name: external_exports.string().optional(),
|
|
394990
|
-
tools: external_exports.array(external_exports.string().refine((val) => isValidToolName(val), {
|
|
394991
|
+
tools: external_exports.array(external_exports.string().refine((val) => isValidToolName(val, { allowWildcards: true }), {
|
|
394991
394992
|
message: "Invalid tool name"
|
|
394992
394993
|
})).optional(),
|
|
394993
394994
|
model: external_exports.string().optional(),
|
|
@@ -401740,6 +401741,7 @@ var init_local_executor = __esm({
|
|
|
401740
401741
|
init_geminiChat();
|
|
401741
401742
|
init_node();
|
|
401742
401743
|
init_tool_registry();
|
|
401744
|
+
init_tools();
|
|
401743
401745
|
init_mcp_tool();
|
|
401744
401746
|
init_turn();
|
|
401745
401747
|
init_types3();
|
|
@@ -401799,18 +401801,40 @@ var init_local_executor = __esm({
|
|
|
401799
401801
|
const agentToolRegistry = new ToolRegistry(runtimeContext, subagentMessageBus);
|
|
401800
401802
|
const parentToolRegistry = runtimeContext.getToolRegistry();
|
|
401801
401803
|
const allAgentNames = new Set(runtimeContext.getAgentRegistry().getAllAgentNames());
|
|
401804
|
+
const registerToolInstance = (tool) => {
|
|
401805
|
+
if (allAgentNames.has(tool.name)) {
|
|
401806
|
+
debugLogger.warn(`[LocalAgentExecutor] Skipping subagent tool '${tool.name}' for agent '${definition.name}' to prevent recursion.`);
|
|
401807
|
+
return;
|
|
401808
|
+
}
|
|
401809
|
+
agentToolRegistry.registerTool(tool);
|
|
401810
|
+
};
|
|
401802
401811
|
const registerToolByName = (toolName) => {
|
|
401803
|
-
if (
|
|
401804
|
-
|
|
401812
|
+
if (toolName === "*") {
|
|
401813
|
+
for (const tool2 of parentToolRegistry.getAllTools()) {
|
|
401814
|
+
registerToolInstance(tool2);
|
|
401815
|
+
}
|
|
401805
401816
|
return;
|
|
401806
401817
|
}
|
|
401818
|
+
if (isMcpToolName(toolName)) {
|
|
401819
|
+
if (toolName === `${MCP_TOOL_PREFIX}*`) {
|
|
401820
|
+
for (const tool2 of parentToolRegistry.getAllTools()) {
|
|
401821
|
+
if (tool2 instanceof DiscoveredMCPTool) {
|
|
401822
|
+
registerToolInstance(tool2);
|
|
401823
|
+
}
|
|
401824
|
+
}
|
|
401825
|
+
return;
|
|
401826
|
+
}
|
|
401827
|
+
const parsed = parseMcpToolName(toolName);
|
|
401828
|
+
if (parsed.serverName && parsed.toolName === "*") {
|
|
401829
|
+
for (const tool2 of parentToolRegistry.getToolsByServer(parsed.serverName)) {
|
|
401830
|
+
registerToolInstance(tool2);
|
|
401831
|
+
}
|
|
401832
|
+
return;
|
|
401833
|
+
}
|
|
401834
|
+
}
|
|
401807
401835
|
const tool = parentToolRegistry.getTool(toolName);
|
|
401808
401836
|
if (tool) {
|
|
401809
|
-
|
|
401810
|
-
agentToolRegistry.registerTool(tool.asFullyQualifiedTool());
|
|
401811
|
-
} else {
|
|
401812
|
-
agentToolRegistry.registerTool(tool);
|
|
401813
|
-
}
|
|
401837
|
+
registerToolInstance(tool);
|
|
401814
401838
|
}
|
|
401815
401839
|
};
|
|
401816
401840
|
if (definition.toolConfig) {
|
|
@@ -402473,17 +402497,12 @@ var init_local_executor = __esm({
|
|
|
402473
402497
|
const toolsList = [];
|
|
402474
402498
|
const { toolConfig, outputConfig } = this.definition;
|
|
402475
402499
|
if (toolConfig) {
|
|
402476
|
-
const toolNamesToLoad = [];
|
|
402477
402500
|
for (const toolRef of toolConfig.tools) {
|
|
402478
|
-
if (typeof toolRef === "
|
|
402479
|
-
toolNamesToLoad.push(toolRef);
|
|
402480
|
-
} else if (typeof toolRef === "object" && "schema" in toolRef) {
|
|
402481
|
-
toolsList.push(toolRef.schema);
|
|
402482
|
-
} else {
|
|
402501
|
+
if (typeof toolRef === "object" && !("schema" in toolRef)) {
|
|
402483
402502
|
toolsList.push(toolRef);
|
|
402484
402503
|
}
|
|
402485
402504
|
}
|
|
402486
|
-
toolsList.push(...this.toolRegistry.
|
|
402505
|
+
toolsList.push(...this.toolRegistry.getFunctionDeclarations());
|
|
402487
402506
|
}
|
|
402488
402507
|
const completeTool = {
|
|
402489
402508
|
name: TASK_COMPLETE_TOOL_NAME,
|