import { z } from 'zod/v4'; import * as _angular_core from '@angular/core'; import { InjectionToken, EnvironmentProviders } from '@angular/core'; import { AbstractAgent } from '@ag-ui/client'; import { ActivityRenderer, RenderActivityMessageConfig } from '@copilotkit/angular'; /** * Content schema for `activityType: "mcp-apps"` activity messages: a snapshot * of an MCP Apps tool call, carrying the middleware server hash, optional * stable server id, the ui:// resource to render, and its tool exchange. * * Kept local and declared with the `zod/v4` API so the Angular browser bundle * validates protocol data without taking a direct MCP client SDK dependency. */ declare const mcpAppsSnapshotContentSchema: z.ZodObject<{ serverHash: z.ZodString; serverId: z.ZodOptional; resourceUri: z.ZodString; result: z.ZodObject<{ content: z.ZodDefault; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$loose>>; }, z.core.$loose>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$loose>>; }, z.core.$loose>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$loose>>; }, z.core.$loose>, z.ZodObject<{ type: z.ZodLiteral<"resource">; resource: z.ZodUnion; text: z.ZodString; }, z.core.$loose>, z.ZodObject<{ uri: z.ZodString; mimeType: z.ZodOptional; blob: z.ZodString; }, z.core.$loose>]>; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$loose>>; }, z.core.$loose>, z.ZodObject<{ type: z.ZodLiteral<"resource_link">; uri: z.ZodString; name: z.ZodString; description: z.ZodOptional; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$loose>>; }, z.core.$loose>]>>>; structuredContent: z.ZodOptional>; isError: z.ZodOptional; _meta: z.ZodOptional>; }, z.core.$loose>; toolInput: z.ZodOptional>; }, z.core.$loose>; /** Parsed content of an `mcp-apps` activity message. */ type MCPAppsSnapshotContent = z.infer; /** * Renders one MCP App snapshot through the same agent-mediated protocol used * by the other CopilotKit frontends. Each instance owns its queued work and * sandbox listener, while requests remain serialized per agent thread. */ declare class CopilotMCPAppsWidget { private readonly config; private readonly copilotKit; private readonly platformId; private readonly ownerId; private readonly queue; private renderVersion; readonly data: _angular_core.InputSignal<{ [x: string]: unknown; serverHash: string; resourceUri: string; result: { [x: string]: unknown; content: ({ [x: string]: unknown; type: "text"; text: string; annotations?: { [x: string]: unknown; audience?: ("user" | "assistant")[]; priority?: number; lastModified?: string; }; } | { [x: string]: unknown; type: "image"; data: string; mimeType: string; annotations?: { [x: string]: unknown; audience?: ("user" | "assistant")[]; priority?: number; lastModified?: string; }; } | { [x: string]: unknown; type: "audio"; data: string; mimeType: string; annotations?: { [x: string]: unknown; audience?: ("user" | "assistant")[]; priority?: number; lastModified?: string; }; } | { [x: string]: unknown; type: "resource"; resource?: { [x: string]: unknown; uri: string; text: string; mimeType?: string; } | { [x: string]: unknown; uri: string; blob: string; mimeType?: string; }; annotations?: { [x: string]: unknown; audience?: ("user" | "assistant")[]; priority?: number; lastModified?: string; }; } | { [x: string]: unknown; type: "resource_link"; uri: string; name: string; description?: string; mimeType?: string; annotations?: { [x: string]: unknown; audience?: ("user" | "assistant")[]; priority?: number; lastModified?: string; }; })[]; structuredContent?: Record; isError?: boolean; _meta?: Record; }; serverId?: string; toolInput?: Record; }>; readonly agent: _angular_core.InputSignal; private readonly renderSession; private readonly appFrame; protected readonly loading: _angular_core.WritableSignal; protected readonly error: _angular_core.WritableSignal; constructor(); private renderApp; private connectSandbox; private handleMessage; private handleUIMessage; private handleOpenLink; private handleToolCall; private sendResponse; private sendError; private sendNotification; private fail; private resetFrame; private throwIfStale; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } /** * Activity renderer for `mcp-apps` snapshots. Renders the referenced MCP App * inline via {@link CopilotMCPAppsWidget}. Resource and tool requests are * proxied through the activity's selected AG-UI agent. */ declare class CopilotMCPAppsActivityRenderer implements ActivityRenderer { readonly activityType: _angular_core.InputSignal; readonly content: _angular_core.InputSignal<{ [x: string]: unknown; serverHash: string; resourceUri: string; result: { [x: string]: unknown; content: ({ [x: string]: unknown; type: "text"; text: string; annotations?: { [x: string]: unknown; audience?: ("user" | "assistant")[]; priority?: number; lastModified?: string; }; } | { [x: string]: unknown; type: "image"; data: string; mimeType: string; annotations?: { [x: string]: unknown; audience?: ("user" | "assistant")[]; priority?: number; lastModified?: string; }; } | { [x: string]: unknown; type: "audio"; data: string; mimeType: string; annotations?: { [x: string]: unknown; audience?: ("user" | "assistant")[]; priority?: number; lastModified?: string; }; } | { [x: string]: unknown; type: "resource"; resource?: { [x: string]: unknown; uri: string; text: string; mimeType?: string; } | { [x: string]: unknown; uri: string; blob: string; mimeType?: string; }; annotations?: { [x: string]: unknown; audience?: ("user" | "assistant")[]; priority?: number; lastModified?: string; }; } | { [x: string]: unknown; type: "resource_link"; uri: string; name: string; description?: string; mimeType?: string; annotations?: { [x: string]: unknown; audience?: ("user" | "assistant")[]; priority?: number; lastModified?: string; }; })[]; structuredContent?: Record; isError?: boolean; _meta?: Record; }; serverId?: string; toolInput?: Record; }>; readonly message: _angular_core.InputSignal<{ role: "activity"; content: Record; id: string; activityType: string; }>; readonly agent: _angular_core.InputSignal; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } /** * Ready-to-register render config for `mcp-apps` activity messages. Pass it * to `provideCopilotKit({ renderActivityMessages: [...] })`. */ declare const mcpAppsActivityRendererConfig: RenderActivityMessageConfig; interface MCPAppsHostInfo { name: string; version: string; } interface MCPAppsConfig { /** Maximum time to wait for a busy agent before a queued request fails. */ idleTimeoutMs?: number; /** Maximum time to wait for the sandbox proxy initialization handshake. */ initializationTimeoutMs?: number; /** Host identity announced during the MCP Apps initialization handshake. */ hostInfo?: MCPAppsHostInfo; /** Additional protocol capabilities announced to embedded MCP Apps. */ hostCapabilities?: Record; /** Additional non-secret UI context announced to embedded MCP Apps. */ hostContext?: Record; } declare const DEFAULT_MCP_APPS_CONFIG: Readonly>; /** Holds renderer behavior configuration registered via `provideMCPApps`. */ declare const MCP_APPS_CONFIG: InjectionToken>; /** * Configures and registers the built-in MCP Apps renderer. * * MCP resource and tool requests always travel through the selected AG-UI * agent. Server URLs deliberately are not accepted by this browser provider. * Application renderers retain precedence over this built-in registration. */ declare function provideMCPApps(config?: MCPAppsConfig): EnvironmentProviders; export { CopilotMCPAppsActivityRenderer, CopilotMCPAppsWidget, DEFAULT_MCP_APPS_CONFIG, MCP_APPS_CONFIG, mcpAppsActivityRendererConfig, mcpAppsSnapshotContentSchema, provideMCPApps }; export type { MCPAppsConfig, MCPAppsHostInfo, MCPAppsSnapshotContent };