@webmcpui/core 0.1.1 → 0.2.0

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/testing.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as WebMCPToolResult } from './webmcp-DEspBoqq.js';
1
+ import { W as WebMCPToolResult } from './webmcp-DbmbtX6x.js';
2
2
 
3
3
  /**
4
4
  * Fake WebMCP host for tests, demos, and the eventual inspector.
@@ -8,12 +8,14 @@ import { a as WebMCPToolResult } from './webmcp-DEspBoqq.js';
8
8
  * records registered tools and lets you invoke them as an agent would.
9
9
  */
10
10
 
11
+ /** A tool an element registered with the {@link FakeAgent}, as recorded for inspection. */
11
12
  interface RegisteredTool {
12
13
  name: string;
13
14
  description: string;
14
15
  inputSchema: Record<string, unknown>;
15
16
  execute: (args: Record<string, unknown>) => WebMCPToolResult | Promise<WebMCPToolResult>;
16
17
  }
18
+ /** Handle to the fake WebMCP host returned by {@link installFakeAgent}. */
17
19
  interface FakeAgent {
18
20
  /** All currently-registered tools, in registration order. */
19
21
  readonly tools: readonly RegisteredTool[];
@@ -15,14 +15,17 @@
15
15
  */
16
16
  /** A JSON-Schema-ish description of a tool's parameters. */
17
17
  type JSONSchema = Record<string, unknown>;
18
+ /** A single piece of a tool result. Today only `text` content is supported. */
18
19
  interface WebMCPToolResultContent {
19
20
  type: 'text';
20
21
  text: string;
21
22
  }
23
+ /** The value a tool's `execute` returns to the agent. */
22
24
  interface WebMCPToolResult {
23
25
  content: WebMCPToolResultContent[];
24
26
  isError?: boolean;
25
27
  }
28
+ /** Describes a WebMCP tool to register via {@link exposeTool}. */
26
29
  interface WebMCPToolDefinition {
27
30
  /** Stable, unique tool name (snake_case by convention). */
28
31
  name: string;
@@ -44,4 +47,4 @@ declare function isWebMCPAvailable(): boolean;
44
47
  */
45
48
  declare function exposeTool(definition: WebMCPToolDefinition): ToolDisposer;
46
49
 
47
- export { type JSONSchema as J, type ToolDisposer as T, type WebMCPToolDefinition as W, type WebMCPToolResult as a, type WebMCPToolResultContent as b, exposeTool as e, isWebMCPAvailable as i };
50
+ export { type JSONSchema as J, type ToolDisposer as T, type WebMCPToolResult as W, type WebMCPToolDefinition as a, type WebMCPToolResultContent as b, exposeTool as e, isWebMCPAvailable as i };