@webmcp-auto-ui/agent 2.5.23 → 2.5.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webmcp-auto-ui/agent",
3
- "version": "2.5.23",
3
+ "version": "2.5.24",
4
4
  "description": "LLM agent loop + remote/WASM/local providers + MCP wrapper",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "type": "module",
@@ -6,6 +6,9 @@
6
6
 
7
7
  import type { ProviderTool } from './types.js';
8
8
 
9
+ /** Tool names that are resolved locally from cache — hidden from user-facing browsers. */
10
+ export const DISCOVERY_TOOL_NAMES = new Set(['list_recipes', 'search_recipes', 'get_recipe', 'list_tools', 'search_tools']);
11
+
9
12
  export interface CachedRecipe {
10
13
  name: string;
11
14
  description?: string;
@@ -79,6 +82,12 @@ export class DiscoveryCache {
79
82
  return this.servers.get(serverPrefix)?.tools.length ?? 0;
80
83
  }
81
84
 
85
+ /** Tool count excluding discovery tools (hidden from user-facing browsers) */
86
+ browsableToolCount(serverPrefix: string): number {
87
+ const tools = this.servers.get(serverPrefix)?.tools ?? [];
88
+ return tools.filter(t => !DISCOVERY_TOOL_NAMES.has(t.name)).length;
89
+ }
90
+
82
91
  /**
83
92
  * Try to resolve a discovery tool call from cache.
84
93
  * Returns the result string if handled, or null if not a discovery tool.
package/src/index.ts CHANGED
@@ -29,7 +29,7 @@ export { buildToolsFromLayers, buildDiscoveryTools, buildDiscoveryToolsWithAlias
29
29
  export type { ToolLayer, McpLayer, WebMcpLayer, SystemPromptResult, DiscoveryToolsResult, SchemaTransformOptions, BuildToolsResult } from './tool-layers.js';
30
30
 
31
31
  // Discovery cache
32
- export { DiscoveryCache } from './discovery-cache.js';
32
+ export { DiscoveryCache, DISCOVERY_TOOL_NAMES } from './discovery-cache.js';
33
33
  export type { CachedRecipe, ServerCache } from './discovery-cache.js';
34
34
 
35
35
  // Re-export core WebMCP types
@@ -465,6 +465,8 @@ Unless a recipe specifies otherwise, use these tools to display your responses o
465
465
 
466
466
  ${actionTools.join('\n')}
467
467
 
468
+ widget_display may ONLY be called with data returned by a non-autoui DATA tool actually invoked in the current session. Fabricating IDs, URLs, names, dates, or any content not returned by a tool is a critical violation. If no DATA tool has been called yet, go back to STEP 1.
469
+
468
470
  STEP 5 — Fallback
469
471
 
470
472
  If previous steps failed, fall back to a classic chat without tool calling.`;