import * as _elementor_external_angie_sdk from '@elementor-external/angie-sdk'; export { MessageEventType as AngieMessageEvenetType, getAngieIframe } from '@elementor-external/angie-sdk'; import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; export { McpServer, RegisteredResource, ResourceTemplate, ToolCallback } from '@modelcontextprotocol/sdk/server/mcp.js'; import { ServerRequest, ServerNotification } from '@modelcontextprotocol/sdk/types.js'; export { SamplingMessageSchema } from '@modelcontextprotocol/sdk/types.js'; import { z } from '@elementor/schema'; import { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js'; declare const isAngieAvailable: () => boolean; declare const isAngieSidebarOpen: () => boolean; type UriTemplate = { toString: () => string; match: (uri: string) => Record | null; }; type McpToolDescriptor = { name: string; description: string; inputSchema: object; execute: (params: Record) => Promise; }; type McpResourceUriOrTemplate = string | { uriTemplate: UriTemplate; }; type McpResourceHandler = (uri: URL, variables: Record) => Promise<{ contents: Array<{ text?: string; }>; }>; interface IMcpRegistrationAdapter { /** * Called once at startup to activate the adapter's server registrations. */ activate: () => Promise; /** * Called once per tool when addTool() is invoked. */ onToolRegistered: (tool: McpToolDescriptor, extraData?: { resources: string[]; requiredResources: string[]; }) => void; /** * Called once per resource when resource() is invoked. */ onResourceRegistered: (name: string, uriOrTemplate: McpResourceUriOrTemplate, handler: McpResourceHandler) => void; /** * Called when a resource update notification should be sent. */ sendResourceUpdated: (params: { uri: string; }) => void | Promise; } declare const ANGIE_MODEL_PREFERENCES: "angie/modelPreferences"; declare const ANGIE_REQUIRED_RESOURCES: "angie/requiredResources"; interface AngieModelPreferences { hints?: Array<{ name: string; }>; costPriority?: number; speedPriority?: number; intelligencePriority?: number; } type ResourceList = { uri: string; description: string; }[]; declare const registerMcpAdapter: (adapter: IMcpRegistrationAdapter) => void; declare const signalMcpReady: () => void; declare const createAndRegisterAdapters: () => Promise; declare const registerMcp: (mcp: McpServer, name: string) => void; declare const getRegisteredMcpServers: () => Array<[string, McpServer, string]>; /** * @param namespace The namespace of the MCP server. It should contain only lowercase alphabetic characters. * @param options * @param options.instructions Short hint about the MCP and its toolset (MCP SDK `instructions`; keeps payload small). * @param options.docs Full documentation registered as a lazy-loaded resource. * When provided, it is registered at elementor://{namespace}/server-docs * and auto-injected into every tool's requiredResources. */ declare const getMCPByDomain: (namespace: string, options?: { docs?: string; instructions?: string; }) => MCPRegistryEntry; interface MCPRegistryEntry { addTool: (opts: ToolRegistrationOptions) => void; setMCPDescription: (description: string) => void; sendResourceUpdated: McpServer['server']['sendResourceUpdated']; resource: McpServer['registerResource']; waitForReady: () => Promise; } type ToolRegistrationOptions : string> = { name: string; description: string; schema?: InputArgs; /** * Auto added fields: * @param errors z.string().optional().describe('Error message if the tool failed') */ outputSchema?: OutputSchema; handler: InputArgs extends z.ZodRawShape ? (args: z.objectOutputType, extra: RequestHandlerExtra) => ExpectedOutput | Promise : (args: unknown, extra: RequestHandlerExtra) => ExpectedOutput | Promise; isDestructive?: boolean; requiredResources?: ResourceList; modelPreferences?: AngieModelPreferences; }; type Server = RequestHandlerExtra; type Opts = { maxTokens?: number; modelPreferences?: string; model?: string; }; type SamplingOpts = { systemPrompt?: string; structuredOutput?: z.ZodTypeAny; messages: { role: 'user' | 'assistant'; content: { type: 'text'; text: string; }; }[]; requestParams?: { [key: string]: string; }; }; declare const createSampler: (server: Server, opts?: Opts) => (payload: SamplingOpts) => Promise<{ type: "text"; text: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; } | { type: "image"; data: string; mimeType: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; } | { type: "audio"; data: string; mimeType: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; } | { type: "tool_use"; name: string; id: string; input: Record; _meta?: Record | undefined; } | { type: "tool_result"; toolUseId: string; content: ({ type: "text"; text: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; } | { type: "image"; data: string; mimeType: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; } | { type: "audio"; data: string; mimeType: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; } | { uri: string; name: string; type: "resource_link"; description?: string | undefined; mimeType?: string | undefined; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: { [x: string]: unknown; } | undefined; icons?: { src: string; mimeType?: string | undefined; sizes?: string[] | undefined; theme?: "light" | "dark" | undefined; }[] | undefined; title?: string | undefined; } | { type: "resource"; resource: { uri: string; text: string; mimeType?: string | undefined; _meta?: Record | undefined; } | { uri: string; blob: string; mimeType?: string | undefined; _meta?: Record | undefined; }; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; })[]; structuredContent?: { [x: string]: unknown; } | undefined; isError?: boolean | undefined; _meta?: Record | undefined; } | ({ type: "text"; text: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; } | { type: "image"; data: string; mimeType: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; } | { type: "audio"; data: string; mimeType: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; } | { type: "tool_use"; name: string; id: string; input: Record; _meta?: Record | undefined; } | { type: "tool_result"; toolUseId: string; content: ({ type: "text"; text: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; } | { type: "image"; data: string; mimeType: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; } | { type: "audio"; data: string; mimeType: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; } | { uri: string; name: string; type: "resource_link"; description?: string | undefined; mimeType?: string | undefined; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: { [x: string]: unknown; } | undefined; icons?: { src: string; mimeType?: string | undefined; sizes?: string[] | undefined; theme?: "light" | "dark" | undefined; }[] | undefined; title?: string | undefined; } | { type: "resource"; resource: { uri: string; text: string; mimeType?: string | undefined; _meta?: Record | undefined; } | { uri: string; blob: string; mimeType?: string | undefined; _meta?: Record | undefined; }; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; })[]; structuredContent?: { [x: string]: unknown; } | undefined; isError?: boolean | undefined; _meta?: Record | undefined; })[]>; declare class ToolPrompts { name: string; _description: string; _parameters: Record; _examples: string[]; _furtherInstructions: string[]; constructor(name: string); description(): string; description(desc: string): this; parameter(key: string): string; parameter(key: string, description: string): this; instruction(instruction: string): this; example(example: string): this; get examples(): string; prompt(): string; } declare const toolPrompts: (name: string) => ToolPrompts; type ActiveChatInfo = { sessionId: string; expiresAt: number; }; declare const getActiveChatInfo: () => ActiveChatInfo; declare const sendPromptToAngie: (prompt?: string) => void; declare const redirectToInstallation: (prompt?: string) => void; declare const redirectToAppAdmin: (prompt?: string) => void; type InstallAngieResult = { success: true; } | { success: false; error: string; code?: string; }; declare const installAngiePlugin: () => Promise; declare const saveAngieConsent: () => Promise; declare function startMCPServer(): Promise; declare const MCP_STYLES_APPLIED_EVENT = "elementor/mcp/styles-applied"; type McpStylesAppliedPayload = { styleValue: Record; }; declare function dispatchMcpStylesAppliedEvent(payload: McpStylesAppliedPayload): void; declare const getAngieSdk: () => _elementor_external_angie_sdk.AngieMcpSdk; export { ANGIE_MODEL_PREFERENCES, ANGIE_REQUIRED_RESOURCES, type ActiveChatInfo, type AngieModelPreferences, type InstallAngieResult, type MCPRegistryEntry, MCP_STYLES_APPLIED_EVENT, type McpStylesAppliedPayload, createAndRegisterAdapters, createSampler, dispatchMcpStylesAppliedEvent, getActiveChatInfo, getAngieSdk, getMCPByDomain, getRegisteredMcpServers, installAngiePlugin, isAngieAvailable, isAngieSidebarOpen, redirectToAppAdmin, redirectToInstallation, registerMcp, registerMcpAdapter, saveAngieConsent, sendPromptToAngie, signalMcpReady, startMCPServer, toolPrompts };