/** * Platform Compatibility Layer * * Provides universal compatibility for custom UIs across: * - MCP Apps Extension (SEP-1865) - Standard ui/initialize protocol * - ChatGPT Apps SDK - window.openai API * - Claude Artifacts - postMessage with theme class * * BEAM injects all these APIs so apps built for any platform work without modification. * * @see https://github.com/modelcontextprotocol/modelcontextprotocol/pull/1865 * @see https://developers.openai.com/apps-sdk/reference/ * @see https://www.reidbarber.com/blog/reverse-engineering-claude-artifacts */ import type { PlatformContext } from '@portel/photon-core'; export { type McpAppsInitialize, type McpAppsToolInput, type McpAppsToolResult, type McpAppsHostContextChanged, type McpAppsResourceTeardown, type McpAppsModelContextUpdate, type PlatformContext, createMcpAppsInitialize, createThemeChangeMessages, } from '@portel/photon-core'; export interface OpenAiContext { theme: 'light' | 'dark'; displayMode: 'inline' | 'fullscreen' | 'pip'; locale: string; maxHeight: number; safeArea: { top: number; bottom: number; left: number; right: number; }; view: 'widget' | 'modal'; userAgent: string; toolInput: Record; toolOutput: unknown; widgetState: unknown; } export interface OpenAiApi { theme: 'light' | 'dark'; displayMode: 'inline' | 'fullscreen' | 'pip'; locale: string; maxHeight: number; toolInput: Record; toolOutput: unknown; widgetState: unknown; setWidgetState(state: unknown): void; callTool(name: string, args: Record): Promise; sendFollowUpMessage(options: { prompt: string; }): Promise; uploadFile(file: File): Promise<{ fileId: string; }>; getFileDownloadUrl(options: { fileId: string; }): Promise; requestDisplayMode(mode: 'inline' | 'fullscreen' | 'pip'): Promise; requestModal(options: { params: unknown; template: string; }): Promise; notifyIntrinsicHeight(height: number): void; openExternal(options: { href: string; }): void; setOpenInAppUrl(options: { href: string; }): void; } /** * Generate the script that injects all platform APIs into an iframe. * This enables apps built for ChatGPT, Claude, or MCP Apps to work in BEAM. */ export declare function generatePlatformBridgeScript(context: PlatformContext): string; //# sourceMappingURL=platform-compat.d.ts.map