@pixerate/editor-react 0.90.1 → 0.91.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.
@@ -1,4 +1,4 @@
1
- import { type ConnectToolBridgeOptions, type ToolBridgeStatus, type ToolRegistry } from "@pixerate/editor/tools";
1
+ import { type ConnectToolBridgeOptions, type ToolBridgeStatus, type ToolSource } from "@pixerate/editor/tools";
2
2
  export interface UseToolBridgeResult {
3
3
  status: ToolBridgeStatus | "off";
4
4
  /** Why the last connection ended (e.g. "Bad token"), when the bridge said. */
@@ -7,8 +7,8 @@ export interface UseToolBridgeResult {
7
7
  editorId: string | null;
8
8
  }
9
9
  /**
10
- * Connects a `ToolRegistry` to a local MCP bridge (`pixerate-mcp-bridge`) while mounted, so an
10
+ * Connects a `ToolRegistry` (or a view of one, see `useToolRegistryView`) to a local MCP bridge (`pixerate-mcp-bridge`) while mounted, so an
11
11
  * MCP client can call the page's tools. Pass `null` options to stay disconnected. Memoize the
12
12
  * options: changing `url`, `token` or `name` reconnects.
13
13
  */
14
- export declare function useToolBridge(registry: ToolRegistry | null | undefined, options: ConnectToolBridgeOptions | null): UseToolBridgeResult;
14
+ export declare function useToolBridge(registry: ToolSource | null | undefined, options: ConnectToolBridgeOptions | null): UseToolBridgeResult;
@@ -1,4 +1,4 @@
1
- import { type ConnectToolBridgeOptions, type ToolBridgeStatus, type ToolRegistry } from "@pixerate/editor/tools";
1
+ import { type ConnectToolBridgeOptions, type ToolBridgeStatus, type ToolSource } from "@pixerate/editor/tools";
2
2
  export interface UseToolBridgeResult {
3
3
  status: ToolBridgeStatus | "off";
4
4
  /** Why the last connection ended (e.g. "Bad token"), when the bridge said. */
@@ -7,8 +7,8 @@ export interface UseToolBridgeResult {
7
7
  editorId: string | null;
8
8
  }
9
9
  /**
10
- * Connects a `ToolRegistry` to a local MCP bridge (`pixerate-mcp-bridge`) while mounted, so an
10
+ * Connects a `ToolRegistry` (or a view of one, see `useToolRegistryView`) to a local MCP bridge (`pixerate-mcp-bridge`) while mounted, so an
11
11
  * MCP client can call the page's tools. Pass `null` options to stay disconnected. Memoize the
12
12
  * options: changing `url`, `token` or `name` reconnects.
13
13
  */
14
- export declare function useToolBridge(registry: ToolRegistry | null | undefined, options: ConnectToolBridgeOptions | null): UseToolBridgeResult;
14
+ export declare function useToolBridge(registry: ToolSource | null | undefined, options: ConnectToolBridgeOptions | null): UseToolBridgeResult;
@@ -0,0 +1,9 @@
1
+ import type { ToolRegistry, ToolRegistryView, ToolViewOptions } from "@pixerate/editor/tools";
2
+ /**
3
+ * A `registry.view(options)` for the component's lifetime: serve it with `useToolBridge` or
4
+ * `createMcpServer` instead of the registry to show an agent only some toolsets, only read
5
+ * tools, or a discovery surface (`discovery`). Changing `toolsets` (e.g. to the focused
6
+ * editor's) updates the same view and announces the new tool list; changing `readOnly` or
7
+ * `discovery` makes a new view. Memoize `discovery` options (they hold skill files).
8
+ */
9
+ export declare function useToolRegistryView(registry: ToolRegistry | null | undefined, options?: ToolViewOptions): ToolRegistryView | null;
@@ -0,0 +1,9 @@
1
+ import type { ToolRegistry, ToolRegistryView, ToolViewOptions } from "@pixerate/editor/tools";
2
+ /**
3
+ * A `registry.view(options)` for the component's lifetime: serve it with `useToolBridge` or
4
+ * `createMcpServer` instead of the registry to show an agent only some toolsets, only read
5
+ * tools, or a discovery surface (`discovery`). Changing `toolsets` (e.g. to the focused
6
+ * editor's) updates the same view and announces the new tool list; changing `readOnly` or
7
+ * `discovery` makes a new view. Memoize `discovery` options (they hold skill files).
8
+ */
9
+ export declare function useToolRegistryView(registry: ToolRegistry | null | undefined, options?: ToolViewOptions): ToolRegistryView | null;