/** * A tool a plugin registered with `document.modelContext` inside the * WordPress document, as seen from outside that document. * * `execute` does not survive the frame boundary, so only the descriptive * fields are carried over. Calls travel back through `callWebMCPTool()`. */ export interface WebMCPToolDescriptor { name: string; description: string; inputSchema?: Record; annotations?: { readOnlyHint?: boolean; destructiveHint?: boolean; consequentialHint?: boolean; untrustedContentHint?: boolean; debugging?: boolean; }; } export interface WebMCPFrameBridge { subscribe(listener: (tools: WebMCPToolDescriptor[]) => void): () => void; dispose(): void; /** Use a fresh call ID for each invocation; pending duplicates are rejected. */ callTool(name: string, args: Record, callId?: string): Promise; cancelTool(callId: string): void; } /** * Mirrors the WordPress document's WebMCP tools into this frame and forwards * tool calls back into it. * * The WordPress document owns the registry because the remote frame cannot * read its DOM under Document-Isolation-Policy. Each announcement carries the * full tool list and replaces the previous one, so a navigation that registers * no tools clears the list. */ export declare function createWebMCPFrameBridge(wpFrame: HTMLIFrameElement, options?: { origin?: string; relayMessages?: boolean; }): WebMCPFrameBridge;