@google/gemini-cli-a2a-server 0.33.0 → 0.33.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.
@@ -108573,7 +108573,7 @@ var init_mcp_tool = __esm({
108573
108573
  return safeJsonStringify(this.params);
108574
108574
  }
108575
108575
  };
108576
- DiscoveredMCPTool = class _DiscoveredMCPTool extends BaseDeclarativeTool {
108576
+ DiscoveredMCPTool = class extends BaseDeclarativeTool {
108577
108577
  mcpTool;
108578
108578
  serverName;
108579
108579
  serverToolName;
@@ -108625,9 +108625,6 @@ var init_mcp_tool = __esm({
108625
108625
  getFullyQualifiedName() {
108626
108626
  return generateValidName(`${this.serverName}${MCP_QUALIFIED_NAME_SEPARATOR}${this.serverToolName}`);
108627
108627
  }
108628
- asFullyQualifiedTool() {
108629
- 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);
108630
- }
108631
108628
  createInvocation(params, messageBus, _toolName, _displayName) {
108632
108629
  return new DiscoveredMCPToolInvocation(this.mcpTool, this.serverName, this.serverToolName, _displayName ?? this.displayName, messageBus, this.trust, params, this.cliConfig, this.description, this.parameterSchema, this._toolAnnotations);
108633
108630
  }
@@ -120153,7 +120150,7 @@ function resolveClassifierModel(requestedModel, modelAlias, useGemini3_1 = false
120153
120150
  return resolveModel(requestedModel, useGemini3_1, useCustomToolModel);
120154
120151
  }
120155
120152
  function isPreviewModel(model) {
120156
- return model === PREVIEW_GEMINI_MODEL || model === PREVIEW_GEMINI_3_1_MODEL || model === PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL || model === PREVIEW_GEMINI_FLASH_MODEL || model === PREVIEW_GEMINI_MODEL_AUTO || model === GEMINI_MODEL_ALIAS_AUTO;
120153
+ return model === PREVIEW_GEMINI_MODEL || model === PREVIEW_GEMINI_3_1_MODEL || model === PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL || model === PREVIEW_GEMINI_FLASH_MODEL || model === PREVIEW_GEMINI_MODEL_AUTO || model === GEMINI_MODEL_ALIAS_AUTO || model === PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL;
120157
120154
  }
120158
120155
  function isGemini3Model(model) {
120159
120156
  const resolved = resolveModel(model);
@@ -120177,7 +120174,7 @@ function isAutoModel(model) {
120177
120174
  function supportsMultimodalFunctionResponse(model) {
120178
120175
  return model.startsWith("gemini-3-");
120179
120176
  }
120180
- var PREVIEW_GEMINI_MODEL, PREVIEW_GEMINI_3_1_MODEL, PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL, PREVIEW_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_MODEL, DEFAULT_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_FLASH_LITE_MODEL, PREVIEW_GEMINI_MODEL_AUTO, DEFAULT_GEMINI_MODEL_AUTO, GEMINI_MODEL_ALIAS_AUTO, GEMINI_MODEL_ALIAS_PRO, GEMINI_MODEL_ALIAS_FLASH, GEMINI_MODEL_ALIAS_FLASH_LITE, DEFAULT_GEMINI_EMBEDDING_MODEL, DEFAULT_THINKING_MODE;
120177
+ var PREVIEW_GEMINI_MODEL, PREVIEW_GEMINI_3_1_MODEL, PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL, PREVIEW_GEMINI_FLASH_MODEL, PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL, DEFAULT_GEMINI_MODEL, DEFAULT_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_FLASH_LITE_MODEL, PREVIEW_GEMINI_MODEL_AUTO, DEFAULT_GEMINI_MODEL_AUTO, GEMINI_MODEL_ALIAS_AUTO, GEMINI_MODEL_ALIAS_PRO, GEMINI_MODEL_ALIAS_FLASH, GEMINI_MODEL_ALIAS_FLASH_LITE, DEFAULT_GEMINI_EMBEDDING_MODEL, DEFAULT_THINKING_MODE;
120181
120178
  var init_models = __esm({
120182
120179
  "packages/core/dist/src/config/models.js"() {
120183
120180
  "use strict";
@@ -120185,6 +120182,7 @@ var init_models = __esm({
120185
120182
  PREVIEW_GEMINI_3_1_MODEL = "gemini-3.1-pro-preview";
120186
120183
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL = "gemini-3.1-pro-preview-customtools";
120187
120184
  PREVIEW_GEMINI_FLASH_MODEL = "gemini-3-flash-preview";
120185
+ PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL = "gemini-3.1-flash-lite-preview";
120188
120186
  DEFAULT_GEMINI_MODEL = "gemini-2.5-pro";
120189
120187
  DEFAULT_GEMINI_FLASH_MODEL = "gemini-2.5-flash";
120190
120188
  DEFAULT_GEMINI_FLASH_LITE_MODEL = "gemini-2.5-flash-lite";
@@ -198422,18 +198420,28 @@ function isValidToolName(name3, options = {}) {
198422
198420
  if (options.allowWildcards && name3 === "*") {
198423
198421
  return true;
198424
198422
  }
198425
- if (name3.includes("__")) {
198426
- const parts2 = name3.split("__");
198427
- if (parts2.length !== 2 || parts2[0].length === 0 || parts2[1].length === 0) {
198423
+ if (isMcpToolName(name3)) {
198424
+ if (name3 === `${MCP_TOOL_PREFIX}*` && options.allowWildcards) {
198425
+ return true;
198426
+ }
198427
+ if (name3.startsWith(`${MCP_TOOL_PREFIX}_`)) {
198428
198428
  return false;
198429
198429
  }
198430
- const server = parts2[0];
198431
- const tool = parts2[1];
198432
- if (tool === "*") {
198433
- return !!options.allowWildcards;
198430
+ const parsed = parseMcpToolName(name3);
198431
+ if (parsed.serverName && parsed.toolName) {
198432
+ const slugRegex = /^[a-z0-9_.:-]+$/i;
198433
+ if (!slugRegex.test(parsed.serverName)) {
198434
+ return false;
198435
+ }
198436
+ if (parsed.toolName === "*") {
198437
+ return options.allowWildcards === true;
198438
+ }
198439
+ if (/^_*$/.test(parsed.toolName)) {
198440
+ return false;
198441
+ }
198442
+ return slugRegex.test(parsed.toolName);
198434
198443
  }
198435
- const slugRegex = /^[a-z0-9_.:-]+$/i;
198436
- return slugRegex.test(server) && slugRegex.test(tool);
198444
+ return false;
198437
198445
  }
198438
198446
  return false;
198439
198447
  }
@@ -198442,6 +198450,7 @@ var init_tool_names = __esm({
198442
198450
  "packages/core/dist/src/tools/tool-names.js"() {
198443
198451
  "use strict";
198444
198452
  init_coreTools();
198453
+ init_mcp_tool();
198445
198454
  EDIT_TOOL_NAMES = /* @__PURE__ */ new Set([EDIT_TOOL_NAME, WRITE_FILE_TOOL_NAME]);
198446
198455
  WRITE_FILE_DISPLAY_NAME = "WriteFile";
198447
198456
  EDIT_DISPLAY_NAME = "Edit";
@@ -199994,8 +200003,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
199994
200003
  var init_git_commit = __esm({
199995
200004
  "packages/core/dist/src/generated/git-commit.js"() {
199996
200005
  "use strict";
199997
- GIT_COMMIT_INFO = "6ee19e1f6";
199998
- CLI_VERSION = "0.33.0";
200006
+ GIT_COMMIT_INFO = "cc5a0dc3c";
200007
+ CLI_VERSION = "0.33.2";
199999
200008
  }
200000
200009
  });
200001
200010
 
@@ -277232,7 +277241,7 @@ function getVersion() {
277232
277241
  }
277233
277242
  versionPromise = (async () => {
277234
277243
  const pkgJson = await getPackageJson(__dirname3);
277235
- return "0.33.0";
277244
+ return "0.33.2";
277236
277245
  })();
277237
277246
  return versionPromise;
277238
277247
  }
@@ -279243,11 +279252,7 @@ Signal: Signal number or \`(none)\` if no signal was received.
279243
279252
  */
279244
279253
  registerTool(tool) {
279245
279254
  if (this.allKnownTools.has(tool.name)) {
279246
- if (tool instanceof DiscoveredMCPTool) {
279247
- tool = tool.asFullyQualifiedTool();
279248
- } else {
279249
- debugLogger.warn(`Tool with name "${tool.name}" is already registered. Overwriting.`);
279250
- }
279255
+ debugLogger.warn(`Tool with name "${tool.name}" is already registered. Overwriting.`);
279251
279256
  }
279252
279257
  this.allKnownTools.set(tool.name, tool);
279253
279258
  }
@@ -279521,7 +279526,14 @@ Signal: Signal number or \`(none)\` if no signal was received.
279521
279526
  for (const name3 of toolNames) {
279522
279527
  const tool = this.getTool(name3);
279523
279528
  if (tool) {
279524
- declarations.push(tool.getSchema(modelId));
279529
+ let schema2 = tool.getSchema(modelId);
279530
+ if (tool instanceof DiscoveredMCPTool) {
279531
+ schema2 = {
279532
+ ...schema2,
279533
+ name: tool.getFullyQualifiedName()
279534
+ };
279535
+ }
279536
+ declarations.push(schema2);
279525
279537
  }
279526
279538
  }
279527
279539
  return declarations;
@@ -279581,16 +279593,6 @@ Signal: Signal number or \`(none)\` if no signal was received.
279581
279593
  debugLogger.debug(`Resolved legacy tool name "${name3}" to current name "${currentName}"`);
279582
279594
  }
279583
279595
  }
279584
- if (!tool && name3.includes("__")) {
279585
- for (const t3 of this.allKnownTools.values()) {
279586
- if (t3 instanceof DiscoveredMCPTool) {
279587
- if (t3.getFullyQualifiedName() === name3) {
279588
- tool = t3;
279589
- break;
279590
- }
279591
- }
279592
- }
279593
- }
279594
279596
  if (tool && this.isActiveTool(tool)) {
279595
279597
  return tool;
279596
279598
  }
@@ -393067,7 +393069,7 @@ var init_agentLoader = __esm({
393067
393069
  name: nameSchema,
393068
393070
  description: external_exports.string().min(1),
393069
393071
  display_name: external_exports.string().optional(),
393070
- tools: external_exports.array(external_exports.string().refine((val) => isValidToolName(val), {
393072
+ tools: external_exports.array(external_exports.string().refine((val) => isValidToolName(val, { allowWildcards: true }), {
393071
393073
  message: "Invalid tool name"
393072
393074
  })).optional(),
393073
393075
  model: external_exports.string().optional(),
@@ -398961,6 +398963,7 @@ var init_local_executor = __esm({
398961
398963
  init_geminiChat();
398962
398964
  init_node();
398963
398965
  init_tool_registry();
398966
+ init_tools();
398964
398967
  init_mcp_tool();
398965
398968
  init_turn();
398966
398969
  init_types3();
@@ -399008,18 +399011,40 @@ var init_local_executor = __esm({
399008
399011
  const agentToolRegistry = new ToolRegistry(runtimeContext, runtimeContext.getMessageBus());
399009
399012
  const parentToolRegistry = runtimeContext.getToolRegistry();
399010
399013
  const allAgentNames = new Set(runtimeContext.getAgentRegistry().getAllAgentNames());
399014
+ const registerToolInstance = (tool) => {
399015
+ if (allAgentNames.has(tool.name)) {
399016
+ debugLogger.warn(`[LocalAgentExecutor] Skipping subagent tool '${tool.name}' for agent '${definition.name}' to prevent recursion.`);
399017
+ return;
399018
+ }
399019
+ agentToolRegistry.registerTool(tool);
399020
+ };
399011
399021
  const registerToolByName = (toolName) => {
399012
- if (allAgentNames.has(toolName)) {
399013
- debugLogger.warn(`[LocalAgentExecutor] Skipping subagent tool '${toolName}' for agent '${definition.name}' to prevent recursion.`);
399022
+ if (toolName === "*") {
399023
+ for (const tool2 of parentToolRegistry.getAllTools()) {
399024
+ registerToolInstance(tool2);
399025
+ }
399014
399026
  return;
399015
399027
  }
399028
+ if (isMcpToolName(toolName)) {
399029
+ if (toolName === `${MCP_TOOL_PREFIX}*`) {
399030
+ for (const tool2 of parentToolRegistry.getAllTools()) {
399031
+ if (tool2 instanceof DiscoveredMCPTool) {
399032
+ registerToolInstance(tool2);
399033
+ }
399034
+ }
399035
+ return;
399036
+ }
399037
+ const parsed = parseMcpToolName(toolName);
399038
+ if (parsed.serverName && parsed.toolName === "*") {
399039
+ for (const tool2 of parentToolRegistry.getToolsByServer(parsed.serverName)) {
399040
+ registerToolInstance(tool2);
399041
+ }
399042
+ return;
399043
+ }
399044
+ }
399016
399045
  const tool = parentToolRegistry.getTool(toolName);
399017
399046
  if (tool) {
399018
- if (tool instanceof DiscoveredMCPTool) {
399019
- agentToolRegistry.registerTool(tool.asFullyQualifiedTool());
399020
- } else {
399021
- agentToolRegistry.registerTool(tool);
399022
- }
399047
+ registerToolInstance(tool);
399023
399048
  }
399024
399049
  };
399025
399050
  if (definition.toolConfig) {
@@ -399674,17 +399699,12 @@ var init_local_executor = __esm({
399674
399699
  const toolsList = [];
399675
399700
  const { toolConfig, outputConfig } = this.definition;
399676
399701
  if (toolConfig) {
399677
- const toolNamesToLoad = [];
399678
399702
  for (const toolRef of toolConfig.tools) {
399679
- if (typeof toolRef === "string") {
399680
- toolNamesToLoad.push(toolRef);
399681
- } else if (typeof toolRef === "object" && "schema" in toolRef) {
399682
- toolsList.push(toolRef.schema);
399683
- } else {
399703
+ if (typeof toolRef === "object" && !("schema" in toolRef)) {
399684
399704
  toolsList.push(toolRef);
399685
399705
  }
399686
399706
  }
399687
- toolsList.push(...this.toolRegistry.getFunctionDeclarationsFiltered(toolNamesToLoad));
399707
+ toolsList.push(...this.toolRegistry.getFunctionDeclarations());
399688
399708
  }
399689
399709
  const completeTool = {
399690
399710
  name: TASK_COMPLETE_TOOL_NAME,
@@ -401485,7 +401505,8 @@ var init_flagNames = __esm({
401485
401505
  MASKING_PROTECTION_THRESHOLD: 45758817,
401486
401506
  MASKING_PRUNABLE_THRESHOLD: 45758818,
401487
401507
  MASKING_PROTECT_LATEST_TURN: 45758819,
401488
- GEMINI_3_1_PRO_LAUNCHED: 45760185
401508
+ GEMINI_3_1_PRO_LAUNCHED: 45760185,
401509
+ PRO_MODEL_NO_ACCESS: 45768879
401489
401510
  };
401490
401511
  }
401491
401512
  });
@@ -409335,6 +409356,9 @@ var init_config4 = __esm({
409335
409356
  coreEvents.emitAdminSettingsChanged();
409336
409357
  });
409337
409358
  this.setRemoteAdminSettings(adminControls);
409359
+ if (await this.getProModelNoAccess() && isAutoModel(this.model)) {
409360
+ this.setModel(PREVIEW_GEMINI_FLASH_MODEL);
409361
+ }
409338
409362
  }
409339
409363
  async getExperimentsAsync() {
409340
409364
  if (this.experiments) {
@@ -410177,6 +410201,25 @@ var init_config4 = __esm({
410177
410201
  await this.ensureExperimentsLoaded();
410178
410202
  return this.experiments?.flags[ExperimentFlags.BANNER_TEXT_CAPACITY_ISSUES]?.stringValue ?? "";
410179
410203
  }
410204
+ /**
410205
+ * Returns whether the user has access to Pro models.
410206
+ * This is determined by the PRO_MODEL_NO_ACCESS experiment flag.
410207
+ */
410208
+ async getProModelNoAccess() {
410209
+ await this.ensureExperimentsLoaded();
410210
+ return this.getProModelNoAccessSync();
410211
+ }
410212
+ /**
410213
+ * Returns whether the user has access to Pro models synchronously.
410214
+ *
410215
+ * Note: This method should only be called after startup, once experiments have been loaded.
410216
+ */
410217
+ getProModelNoAccessSync() {
410218
+ if (this.contentGeneratorConfig?.authType !== AuthType2.LOGIN_WITH_GOOGLE) {
410219
+ return false;
410220
+ }
410221
+ return this.experiments?.flags[ExperimentFlags.PRO_MODEL_NO_ACCESS]?.boolValue ?? false;
410222
+ }
410180
410223
  /**
410181
410224
  * Returns whether Gemini 3.1 has been launched.
410182
410225
  * This method is async and ensures that experiments are loaded before returning the result.