import type { HappyMcpToolResult, HappyPluginAppContribution } from "happy-plugins"; import type { PluginRuntimeSnapshot } from "./types.js"; import { PluginMcpRegistry } from "./PluginMcpRegistry.js"; export type PluginAppErrorCode = "invalid_input" | "plugin_not_running" | "stale_generation" | "storage_full" | "timeout" | "tool_not_found"; export declare class PluginAppError extends Error { readonly code: PluginAppErrorCode; constructor(code: PluginAppErrorCode, message: string); } export interface PluginAppResource { blob?: string; mimeType: string; text?: string; uri: string; } /** * Immutable manifest-declared MCP Apps and their host-mediated backend. * * The bytes are snapshotted before the plugin process starts. Runtime identity is still tied to * the process generation, so a renderer can never call replacement tools or storage by accident. */ export declare class PluginAppRegistry { #private; readonly mcp: PluginMcpRegistry; constructor(mcp: PluginMcpRegistry); register(plugin: PluginRuntimeSnapshot, generation: string, dataDirectory: string): () => void; list(folder?: string): readonly HappyPluginAppContribution[]; readResource(id: string, generation: string, uri: string): PluginAppResource; callTool(id: string, generation: string, server: string, tool: string, input: unknown, signal?: AbortSignal): Promise; storageGet(id: string, generation: string, key: string): Promise; storageList(id: string, generation: string): Promise; storageSet(id: string, generation: string, key: string, value: unknown): Promise; storageDelete(id: string, generation: string, key: string): Promise; }