@pancake-apps/web 0.0.0-snapshot-20260125200133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,738 @@
1
+ import { J as JsonRpcId, a as JsonRpcRequest, b as JsonRpcNotification, c as JsonRpcSuccessResponse, d as JsonRpcErrorResponse, e as JsonRpcMessage, M as McpUiInitializeResult, R as ResourceTeardownParams, I as InitializeOptions, C as CallToolResult, f as ResourceReadResult, D as DisplayMode, U as UpdateModelContextParams, L as LogLevel, H as HostContext, g as HostCapabilities, h as HostInfo, i as McpStoreState, T as Theme, j as ContainerDimensions, k as SafeAreaInsets, P as Platform, l as DeviceCapabilities, m as Styles, n as ToolInfo, o as ClientInfo, p as ContentBlock, q as DEFAULT_CLIENT_INFO, r as InitializeParams, s as JsonRpcResponse, t as LogMessageParams, u as MCP_METHODS, v as McpUiResourceCsp, O as OpenLinkParams, w as PROTOCOL_VERSION, x as PermissionFields, y as RequestDisplayModeParams, z as RequestDisplayModeResult, A as ResourceContent, B as ResourceReadParams, E as SandboxCapabilities, F as SizeChangedParams, G as StyleCss, S as StyleVariables, K as ToolCancelledParams, N as ToolInputParams, Q as ToolInputPartialParams, V as ToolsCallParams, W as UiMessageParams } from './types-B_O3kZYh.js';
2
+
3
+ /**
4
+ * JSON-RPC 2.0 Protocol Helpers
5
+ *
6
+ * Utilities for creating and parsing JSON-RPC messages.
7
+ */
8
+
9
+ /**
10
+ * Generate a unique request ID
11
+ */
12
+ declare function generateId(): string;
13
+ /**
14
+ * Create a JSON-RPC request
15
+ */
16
+ declare function createRequest(method: string, params?: unknown, id?: JsonRpcId): JsonRpcRequest;
17
+ /**
18
+ * Create a JSON-RPC notification (no id, no response expected)
19
+ */
20
+ declare function createNotification(method: string, params?: unknown): JsonRpcNotification;
21
+ /**
22
+ * Create a JSON-RPC success response
23
+ */
24
+ declare function createSuccessResponse(id: JsonRpcId, result: unknown): JsonRpcSuccessResponse;
25
+ /**
26
+ * Create a JSON-RPC error response
27
+ */
28
+ declare function createErrorResponse(id: JsonRpcId, code: number, message: string, data?: unknown): JsonRpcErrorResponse;
29
+ /**
30
+ * Check if a message is a valid JSON-RPC message
31
+ */
32
+ declare function isJsonRpcMessage(data: unknown): data is JsonRpcMessage;
33
+ /**
34
+ * Check if a message is a JSON-RPC request
35
+ */
36
+ declare function isRequest(message: JsonRpcMessage): message is JsonRpcRequest;
37
+ /**
38
+ * Check if a message is a JSON-RPC notification
39
+ */
40
+ declare function isNotification(message: JsonRpcMessage): message is JsonRpcNotification;
41
+ /**
42
+ * Check if a message is a JSON-RPC response
43
+ */
44
+ declare function isResponse(message: JsonRpcMessage): message is JsonRpcSuccessResponse | JsonRpcErrorResponse;
45
+ /**
46
+ * Check if a response is an error
47
+ */
48
+ declare function isErrorResponse(response: JsonRpcSuccessResponse | JsonRpcErrorResponse): response is JsonRpcErrorResponse;
49
+ /**
50
+ * Standard JSON-RPC error codes
51
+ */
52
+ declare const ERROR_CODES: {
53
+ readonly PARSE_ERROR: -32700;
54
+ readonly INVALID_REQUEST: -32600;
55
+ readonly METHOD_NOT_FOUND: -32601;
56
+ readonly INVALID_PARAMS: -32602;
57
+ readonly INTERNAL_ERROR: -32603;
58
+ };
59
+ /**
60
+ * Create an error from a JSON-RPC error response
61
+ */
62
+ declare class JsonRpcError extends Error {
63
+ code: number;
64
+ data?: unknown;
65
+ constructor(code: number, message: string, data?: unknown);
66
+ static fromResponse(response: JsonRpcErrorResponse): JsonRpcError;
67
+ }
68
+
69
+ /**
70
+ * McpAppsBridge
71
+ *
72
+ * Singleton bridge that handles JSON-RPC communication with the MCP host
73
+ * via postMessage. Manages initialization, request/response tracking,
74
+ * and notification handling.
75
+ */
76
+
77
+ type NotificationHandler = (params: unknown) => void;
78
+ type TeardownHandler$1 = (params: ResourceTeardownParams) => Promise<void> | void;
79
+ declare class McpAppsBridge {
80
+ private static instance;
81
+ private pendingRequests;
82
+ private notificationHandlers;
83
+ private teardownHandlers;
84
+ private _isInitialized;
85
+ private initializeResult;
86
+ private resizeObserver;
87
+ /**
88
+ * Get the singleton bridge instance
89
+ */
90
+ static getInstance(): McpAppsBridge;
91
+ /**
92
+ * Reset the singleton (for testing)
93
+ */
94
+ static reset(): void;
95
+ private constructor();
96
+ /**
97
+ * Check if the bridge has been initialized
98
+ */
99
+ get isInitialized(): boolean;
100
+ /**
101
+ * Get the initialization result (host context, capabilities, etc.)
102
+ */
103
+ get initResult(): McpUiInitializeResult | null;
104
+ private setupMessageListener;
105
+ private cleanup;
106
+ private handleMessage;
107
+ private handleHostRequest;
108
+ private handleTeardown;
109
+ private handleNotification;
110
+ private send;
111
+ private sendResponse;
112
+ private sendErrorResponse;
113
+ /**
114
+ * Send a request and wait for response
115
+ */
116
+ sendRequest<T>(method: string, params?: unknown, timeout?: number): Promise<T>;
117
+ /**
118
+ * Send a notification (no response expected)
119
+ */
120
+ sendNotification(method: string, params?: unknown): void;
121
+ /**
122
+ * Subscribe to notifications from the host
123
+ */
124
+ onNotification(method: string, handler: NotificationHandler): () => void;
125
+ /**
126
+ * Register a teardown handler
127
+ */
128
+ onTeardown(handler: TeardownHandler$1): () => void;
129
+ /**
130
+ * Initialize the connection with the host
131
+ */
132
+ initialize(options?: InitializeOptions): Promise<McpUiInitializeResult>;
133
+ /**
134
+ * Ensure the bridge is initialized before performing operations
135
+ */
136
+ ensureInitialized(): Promise<void>;
137
+ /**
138
+ * Call a server tool
139
+ */
140
+ callTool<TInput = Record<string, unknown>, TOutput = unknown>(name: string, args?: TInput): Promise<CallToolResult<TOutput>>;
141
+ /**
142
+ * Read a resource by URI
143
+ */
144
+ readResource(uri: string): Promise<ResourceReadResult>;
145
+ /**
146
+ * Send a message to the host's chat interface
147
+ */
148
+ sendMessage(text: string): Promise<void>;
149
+ /**
150
+ * Request the host to open a URL
151
+ */
152
+ openLink(url: string): Promise<void>;
153
+ /**
154
+ * Request a change in display mode
155
+ */
156
+ requestDisplayMode(mode: DisplayMode): Promise<DisplayMode>;
157
+ /**
158
+ * Update the host's model context
159
+ */
160
+ updateModelContext(params: UpdateModelContextParams): Promise<void>;
161
+ /**
162
+ * Notify the host of size changes
163
+ */
164
+ notifySizeChanged(width: number, height: number): void;
165
+ /**
166
+ * Setup automatic size reporting via ResizeObserver
167
+ */
168
+ setupAutoSizeReporting(element?: HTMLElement): () => void;
169
+ /**
170
+ * Send a log message to the host
171
+ */
172
+ log(level: LogLevel, data: unknown, logger?: string): void;
173
+ /**
174
+ * Ping the host to check connection
175
+ */
176
+ ping(): Promise<void>;
177
+ }
178
+ /**
179
+ * Get the bridge instance (convenience function)
180
+ */
181
+ declare function getBridge(): McpAppsBridge;
182
+
183
+ /**
184
+ * McpAppsStore
185
+ *
186
+ * External store implementation for React 18's useSyncExternalStore.
187
+ * Listens to MCP notifications for reactive updates.
188
+ */
189
+
190
+ type Subscriber = () => void;
191
+ type Unsubscribe = () => void;
192
+ declare class McpAppsStore {
193
+ private static instance;
194
+ private state;
195
+ private subscribers;
196
+ private unsubscribers;
197
+ static getInstance(): McpAppsStore;
198
+ static reset(): void;
199
+ private constructor();
200
+ private cleanup;
201
+ private setupNotificationHandlers;
202
+ /**
203
+ * Update store state and notify subscribers
204
+ */
205
+ private updateState;
206
+ /**
207
+ * Set initialization result from bridge
208
+ */
209
+ setInitialized(hostContext: HostContext, hostCapabilities: HostCapabilities, hostInfo: HostInfo): void;
210
+ /**
211
+ * Subscribe to changes for specific keys or all changes
212
+ */
213
+ subscribe(keys: keyof McpStoreState | (keyof McpStoreState)[] | '*', callback: Subscriber): Unsubscribe;
214
+ /**
215
+ * Get current value of a state property
216
+ */
217
+ getSnapshot<K extends keyof McpStoreState>(key: K): McpStoreState[K];
218
+ /**
219
+ * Get the full state snapshot
220
+ */
221
+ getFullSnapshot(): McpStoreState;
222
+ /**
223
+ * Get server snapshot (for SSR)
224
+ */
225
+ getServerSnapshot<K extends keyof McpStoreState>(key: K): McpStoreState[K] | undefined;
226
+ }
227
+
228
+ /**
229
+ * Get the store instance (convenience function)
230
+ */
231
+ declare function getStore(): McpAppsStore;
232
+
233
+ /**
234
+ * Base hook factory for creating reactive hooks for MCP store properties
235
+ */
236
+
237
+ /**
238
+ * Create a hook that subscribes to a specific store property
239
+ */
240
+ declare function createMcpStoreHook<K extends keyof McpStoreState>(key: K): () => McpStoreState[K];
241
+ /**
242
+ * Generic hook to access any MCP store property
243
+ */
244
+ declare function useMcpStore<K extends keyof McpStoreState>(key: K): McpStoreState[K];
245
+
246
+ /**
247
+ * Get the current theme (light or dark)
248
+ *
249
+ * @returns Current theme, defaults to 'light' if not set
250
+ */
251
+ declare function useTheme(): Theme;
252
+
253
+ /**
254
+ * Get the user's locale setting
255
+ *
256
+ * @returns BCP 47 language tag (e.g., 'en-US')
257
+ */
258
+ declare function useLocale(): string;
259
+
260
+ /**
261
+ * Get the user's timezone
262
+ *
263
+ * @returns IANA timezone string (e.g., 'America/New_York')
264
+ */
265
+ declare function useTimezone(): string | undefined;
266
+
267
+ /**
268
+ * Get the current display mode
269
+ *
270
+ * @returns Current display mode: 'inline', 'fullscreen', or 'pip'
271
+ */
272
+ declare function useDisplayMode(): DisplayMode;
273
+
274
+ /**
275
+ * Get the list of available display modes
276
+ *
277
+ * @returns Array of available display modes
278
+ */
279
+ declare function useAvailableDisplayModes(): DisplayMode[];
280
+
281
+ /**
282
+ * Get the container dimension constraints
283
+ *
284
+ * @returns Container dimensions or undefined
285
+ */
286
+ declare function useContainerDimensions(): ContainerDimensions | undefined;
287
+
288
+ /**
289
+ * Get safe area insets for devices with notches/rounded corners
290
+ *
291
+ * @returns Safe area insets object
292
+ */
293
+ declare function useSafeArea(): SafeAreaInsets;
294
+
295
+ /**
296
+ * Get the host platform
297
+ *
298
+ * @returns Platform: 'web', 'desktop', or 'mobile'
299
+ */
300
+ declare function usePlatform(): Platform | undefined;
301
+
302
+ /**
303
+ * Get device capabilities (touch, hover support)
304
+ *
305
+ * @returns Device capabilities object
306
+ */
307
+ declare function useDeviceCapabilities(): DeviceCapabilities;
308
+
309
+ /**
310
+ * Get CSS styling information from the host
311
+ *
312
+ * Includes CSS variables and font CSS to inject.
313
+ *
314
+ * @returns Styles object or undefined
315
+ */
316
+ declare function useStyles(): Styles | undefined;
317
+
318
+ /**
319
+ * Get information about the tool that triggered this UI
320
+ *
321
+ * @returns Tool info or undefined
322
+ */
323
+ declare function useToolInfo(): ToolInfo | undefined;
324
+
325
+ /**
326
+ * Get the complete tool input arguments
327
+ *
328
+ * Sent via ui/notifications/tool-input after initialization.
329
+ *
330
+ * @returns Tool input arguments or undefined
331
+ */
332
+ declare function useToolInput<T = Record<string, unknown>>(): T | undefined;
333
+
334
+ /**
335
+ * Get the tool execution result
336
+ *
337
+ * Sent via ui/notifications/tool-result.
338
+ *
339
+ * @returns Tool result or undefined
340
+ */
341
+ declare function useToolResult<T = unknown>(): CallToolResult<T> | undefined;
342
+
343
+ /**
344
+ * Get the full host context object
345
+ *
346
+ * Use this for accessing multiple context properties at once.
347
+ *
348
+ * @returns Host context object
349
+ */
350
+ declare function useHostContext(): HostContext;
351
+
352
+ /**
353
+ * Get the host's capabilities
354
+ *
355
+ * @returns Host capabilities or undefined if not initialized
356
+ */
357
+ declare function useHostCapabilities(): HostCapabilities | undefined;
358
+
359
+ /**
360
+ * Check if the MCP connection has been initialized
361
+ *
362
+ * @returns true if initialized, false otherwise
363
+ */
364
+ declare function useIsInitialized(): boolean;
365
+
366
+ /**
367
+ * Initialize the MCP connection with the host
368
+ *
369
+ * This must be called before using other actions. If called multiple times,
370
+ * subsequent calls return the cached result.
371
+ *
372
+ * @param options - Optional initialization options
373
+ * @returns Promise resolving to initialization result
374
+ *
375
+ * @example
376
+ * ```tsx
377
+ * useEffect(() => {
378
+ * initialize({
379
+ * clientInfo: { name: 'my-app', version: '1.0.0' }
380
+ * }).then((result) => {
381
+ * console.log('Initialized with:', result.hostContext);
382
+ * });
383
+ * }, []);
384
+ * ```
385
+ */
386
+ declare function initialize(options?: InitializeOptions): Promise<McpUiInitializeResult>;
387
+
388
+ /**
389
+ * Call an MCP server tool
390
+ *
391
+ * @param name - Tool name to call
392
+ * @param args - Optional arguments for the tool
393
+ * @returns Promise resolving to tool result
394
+ *
395
+ * @example
396
+ * ```tsx
397
+ * const result = await callTool('search', { query: 'pancakes' });
398
+ * console.log(result.structuredContent);
399
+ * ```
400
+ */
401
+ declare function callTool<TInput = Record<string, unknown>, TOutput = unknown>(name: string, args?: TInput): Promise<CallToolResult<TOutput>>;
402
+
403
+ /**
404
+ * Read content from an MCP resource
405
+ *
406
+ * @param uri - Resource URI to read
407
+ * @returns Promise resolving to resource contents
408
+ *
409
+ * @example
410
+ * ```tsx
411
+ * const result = await readResource('ui://my-resource');
412
+ * console.log(result.contents[0]?.text);
413
+ * ```
414
+ */
415
+ declare function readResource(uri: string): Promise<ResourceReadResult>;
416
+
417
+ /**
418
+ * Send a message to the host's chat interface
419
+ *
420
+ * @param text - Message text to send
421
+ *
422
+ * @example
423
+ * ```tsx
424
+ * await sendMessage('Show me more options');
425
+ * ```
426
+ */
427
+ declare function sendMessage(text: string): Promise<void>;
428
+
429
+ /**
430
+ * Request the host to open a URL in the user's browser
431
+ *
432
+ * @param url - URL to open
433
+ *
434
+ * @example
435
+ * ```tsx
436
+ * await openLink('https://example.com');
437
+ * ```
438
+ */
439
+ declare function openLink(url: string): Promise<void>;
440
+
441
+ /**
442
+ * Request a change in display mode
443
+ *
444
+ * Note: The host may return a different mode than requested.
445
+ *
446
+ * @param mode - Desired display mode
447
+ * @returns Promise resolving to the actual mode set
448
+ *
449
+ * @example
450
+ * ```tsx
451
+ * const actualMode = await requestDisplayMode('fullscreen');
452
+ * if (actualMode !== 'fullscreen') {
453
+ * console.log('Fullscreen not available');
454
+ * }
455
+ * ```
456
+ */
457
+ declare function requestDisplayMode(mode: DisplayMode): Promise<DisplayMode>;
458
+
459
+ /**
460
+ * Update the host's model context for future conversation turns
461
+ *
462
+ * Each update overwrites previous updates from the same UI instance.
463
+ *
464
+ * @param params - Context update parameters
465
+ *
466
+ * @example
467
+ * ```tsx
468
+ * await updateModelContext({
469
+ * structuredContent: { selectedItems: ['a', 'b', 'c'] }
470
+ * });
471
+ * ```
472
+ */
473
+ declare function updateModelContext(params: UpdateModelContextParams): Promise<void>;
474
+
475
+ /**
476
+ * Notify the host of size changes
477
+ *
478
+ * Use this when in flexible sizing mode (maxHeight set, not height).
479
+ *
480
+ * @param width - Current width in pixels
481
+ * @param height - Current height in pixels
482
+ *
483
+ * @example
484
+ * ```tsx
485
+ * // In a ResizeObserver callback
486
+ * notifySizeChanged(entry.contentRect.width, entry.contentRect.height);
487
+ * ```
488
+ */
489
+ declare function notifySizeChanged(width: number, height: number): void;
490
+ /**
491
+ * Setup automatic size reporting via ResizeObserver
492
+ *
493
+ * @param element - Element to observe (defaults to document.documentElement)
494
+ * @returns Cleanup function to stop observing
495
+ *
496
+ * @example
497
+ * ```tsx
498
+ * useEffect(() => {
499
+ * return setupAutoSizeReporting();
500
+ * }, []);
501
+ * ```
502
+ */
503
+ declare function setupAutoSizeReporting(element?: HTMLElement): () => void;
504
+
505
+ /**
506
+ * Send a log message to the host
507
+ *
508
+ * @param level - Log level: 'debug', 'info', 'warning', or 'error'
509
+ * @param data - Data to log
510
+ * @param logger - Optional logger name
511
+ *
512
+ * @example
513
+ * ```tsx
514
+ * log('info', { action: 'button_click', target: 'submit' });
515
+ * log('error', error.message, 'ErrorHandler');
516
+ * ```
517
+ */
518
+ declare function log(level: LogLevel, data: unknown, logger?: string): void;
519
+ declare const logDebug: (data: unknown, logger?: string) => void;
520
+ declare const logInfo: (data: unknown, logger?: string) => void;
521
+ declare const logWarning: (data: unknown, logger?: string) => void;
522
+ declare const logError: (data: unknown, logger?: string) => void;
523
+
524
+ type TeardownHandler = (params: ResourceTeardownParams) => Promise<void> | void;
525
+ /**
526
+ * Register a handler for resource teardown
527
+ *
528
+ * Called when the host is about to unmount the UI. Use this to
529
+ * save state or perform cleanup before the iframe is destroyed.
530
+ *
531
+ * @param handler - Async or sync function called on teardown
532
+ * @returns Unsubscribe function
533
+ *
534
+ * @example
535
+ * ```tsx
536
+ * useEffect(() => {
537
+ * return onTeardown(async ({ reason }) => {
538
+ * await saveProgress();
539
+ * console.log('Teardown reason:', reason);
540
+ * });
541
+ * }, []);
542
+ * ```
543
+ */
544
+ declare function onTeardown(handler: TeardownHandler): () => void;
545
+
546
+ /**
547
+ * createMcpView
548
+ *
549
+ * High-level API for creating MCP views with minimal boilerplate.
550
+ * Handles initialization, style injection, size reporting, and teardown.
551
+ */
552
+
553
+ interface AutoResizeOptions {
554
+ /** Debounce interval in milliseconds (default: 100) */
555
+ debounceMs?: number;
556
+ /** Pixel threshold to avoid noise (default: 2) */
557
+ threshold?: number;
558
+ /** Watch DOM changes with MutationObserver (default: true) */
559
+ useMutationObserver?: boolean;
560
+ /** Element to observe (default: document.body) */
561
+ element?: HTMLElement;
562
+ }
563
+ interface CreateMcpViewOptions {
564
+ /** Client identification */
565
+ clientInfo?: ClientInfo;
566
+ /** Enable automatic size reporting (default: true) */
567
+ autoResize?: boolean | AutoResizeOptions;
568
+ /** Inject host CSS variables and fonts into DOM (default: false) */
569
+ autoInjectStyles?: boolean;
570
+ /** Called after initialization, context is ready */
571
+ onReady?: (context: HostContext) => void;
572
+ /** Called when host context changes (after styles are re-applied if autoInjectStyles) */
573
+ onContextChange?: (context: HostContext, changes: Partial<HostContext>) => void;
574
+ /** Called when host requests teardown */
575
+ onTeardown?: (reason: string) => void;
576
+ }
577
+ interface McpView {
578
+ /** Get current host context */
579
+ getContext(): HostContext;
580
+ /** Manually notify size change */
581
+ notifySize(width: number, height: number): void;
582
+ /** Cleanup all subscriptions and observers */
583
+ destroy(): void;
584
+ }
585
+ /**
586
+ * Create an MCP view with automatic lifecycle management
587
+ *
588
+ * Handles:
589
+ * - Initialization handshake with host
590
+ * - Style injection (CSS variables + fonts)
591
+ * - Automatic size reporting with debouncing
592
+ * - Host context change subscriptions
593
+ * - Teardown handling
594
+ *
595
+ * @example
596
+ * ```ts
597
+ * const view = await createMcpView({
598
+ * clientInfo: { name: 'my-view', version: '1.0.0' },
599
+ * autoResize: true,
600
+ * autoInjectStyles: true,
601
+ *
602
+ * onReady: (context) => {
603
+ * console.log('View ready with theme:', context.theme);
604
+ * renderContent();
605
+ * },
606
+ *
607
+ * onContextChange: (context) => {
608
+ * updateTheme(context.theme);
609
+ * },
610
+ *
611
+ * onTeardown: (reason) => {
612
+ * saveState();
613
+ * },
614
+ * });
615
+ *
616
+ * // Later: manual cleanup
617
+ * view.destroy();
618
+ * ```
619
+ */
620
+ declare function createMcpView(options?: CreateMcpViewOptions): Promise<McpView>;
621
+
622
+ /**
623
+ * @pancake-apps/web/mcp-apps
624
+ *
625
+ * Complete SDK for building Guest UIs that communicate with MCP hosts.
626
+ * Implements JSON-RPC 2.0 over postMessage as per MCP Apps specification.
627
+ */
628
+
629
+ type mcpApps_AutoResizeOptions = AutoResizeOptions;
630
+ declare const mcpApps_CallToolResult: typeof CallToolResult;
631
+ declare const mcpApps_ClientInfo: typeof ClientInfo;
632
+ declare const mcpApps_ContainerDimensions: typeof ContainerDimensions;
633
+ declare const mcpApps_ContentBlock: typeof ContentBlock;
634
+ type mcpApps_CreateMcpViewOptions = CreateMcpViewOptions;
635
+ declare const mcpApps_DEFAULT_CLIENT_INFO: typeof DEFAULT_CLIENT_INFO;
636
+ declare const mcpApps_DeviceCapabilities: typeof DeviceCapabilities;
637
+ declare const mcpApps_DisplayMode: typeof DisplayMode;
638
+ declare const mcpApps_ERROR_CODES: typeof ERROR_CODES;
639
+ declare const mcpApps_HostCapabilities: typeof HostCapabilities;
640
+ declare const mcpApps_HostContext: typeof HostContext;
641
+ declare const mcpApps_HostInfo: typeof HostInfo;
642
+ declare const mcpApps_InitializeOptions: typeof InitializeOptions;
643
+ declare const mcpApps_InitializeParams: typeof InitializeParams;
644
+ type mcpApps_JsonRpcError = JsonRpcError;
645
+ declare const mcpApps_JsonRpcError: typeof JsonRpcError;
646
+ declare const mcpApps_JsonRpcErrorResponse: typeof JsonRpcErrorResponse;
647
+ declare const mcpApps_JsonRpcId: typeof JsonRpcId;
648
+ declare const mcpApps_JsonRpcMessage: typeof JsonRpcMessage;
649
+ declare const mcpApps_JsonRpcNotification: typeof JsonRpcNotification;
650
+ declare const mcpApps_JsonRpcRequest: typeof JsonRpcRequest;
651
+ declare const mcpApps_JsonRpcResponse: typeof JsonRpcResponse;
652
+ declare const mcpApps_JsonRpcSuccessResponse: typeof JsonRpcSuccessResponse;
653
+ declare const mcpApps_LogLevel: typeof LogLevel;
654
+ declare const mcpApps_LogMessageParams: typeof LogMessageParams;
655
+ declare const mcpApps_MCP_METHODS: typeof MCP_METHODS;
656
+ type mcpApps_McpAppsBridge = McpAppsBridge;
657
+ declare const mcpApps_McpAppsBridge: typeof McpAppsBridge;
658
+ type mcpApps_McpAppsStore = McpAppsStore;
659
+ declare const mcpApps_McpAppsStore: typeof McpAppsStore;
660
+ declare const mcpApps_McpStoreState: typeof McpStoreState;
661
+ declare const mcpApps_McpUiInitializeResult: typeof McpUiInitializeResult;
662
+ declare const mcpApps_McpUiResourceCsp: typeof McpUiResourceCsp;
663
+ type mcpApps_McpView = McpView;
664
+ declare const mcpApps_OpenLinkParams: typeof OpenLinkParams;
665
+ declare const mcpApps_PROTOCOL_VERSION: typeof PROTOCOL_VERSION;
666
+ declare const mcpApps_PermissionFields: typeof PermissionFields;
667
+ declare const mcpApps_Platform: typeof Platform;
668
+ declare const mcpApps_RequestDisplayModeParams: typeof RequestDisplayModeParams;
669
+ declare const mcpApps_RequestDisplayModeResult: typeof RequestDisplayModeResult;
670
+ declare const mcpApps_ResourceContent: typeof ResourceContent;
671
+ declare const mcpApps_ResourceReadParams: typeof ResourceReadParams;
672
+ declare const mcpApps_ResourceReadResult: typeof ResourceReadResult;
673
+ declare const mcpApps_ResourceTeardownParams: typeof ResourceTeardownParams;
674
+ declare const mcpApps_SafeAreaInsets: typeof SafeAreaInsets;
675
+ declare const mcpApps_SandboxCapabilities: typeof SandboxCapabilities;
676
+ declare const mcpApps_SizeChangedParams: typeof SizeChangedParams;
677
+ declare const mcpApps_StyleCss: typeof StyleCss;
678
+ declare const mcpApps_StyleVariables: typeof StyleVariables;
679
+ declare const mcpApps_Styles: typeof Styles;
680
+ declare const mcpApps_Theme: typeof Theme;
681
+ declare const mcpApps_ToolCancelledParams: typeof ToolCancelledParams;
682
+ declare const mcpApps_ToolInfo: typeof ToolInfo;
683
+ declare const mcpApps_ToolInputParams: typeof ToolInputParams;
684
+ declare const mcpApps_ToolInputPartialParams: typeof ToolInputPartialParams;
685
+ declare const mcpApps_ToolsCallParams: typeof ToolsCallParams;
686
+ declare const mcpApps_UiMessageParams: typeof UiMessageParams;
687
+ declare const mcpApps_UpdateModelContextParams: typeof UpdateModelContextParams;
688
+ declare const mcpApps_callTool: typeof callTool;
689
+ declare const mcpApps_createErrorResponse: typeof createErrorResponse;
690
+ declare const mcpApps_createMcpStoreHook: typeof createMcpStoreHook;
691
+ declare const mcpApps_createMcpView: typeof createMcpView;
692
+ declare const mcpApps_createNotification: typeof createNotification;
693
+ declare const mcpApps_createRequest: typeof createRequest;
694
+ declare const mcpApps_createSuccessResponse: typeof createSuccessResponse;
695
+ declare const mcpApps_generateId: typeof generateId;
696
+ declare const mcpApps_getBridge: typeof getBridge;
697
+ declare const mcpApps_getStore: typeof getStore;
698
+ declare const mcpApps_initialize: typeof initialize;
699
+ declare const mcpApps_isErrorResponse: typeof isErrorResponse;
700
+ declare const mcpApps_isJsonRpcMessage: typeof isJsonRpcMessage;
701
+ declare const mcpApps_isNotification: typeof isNotification;
702
+ declare const mcpApps_isRequest: typeof isRequest;
703
+ declare const mcpApps_isResponse: typeof isResponse;
704
+ declare const mcpApps_log: typeof log;
705
+ declare const mcpApps_logDebug: typeof logDebug;
706
+ declare const mcpApps_logError: typeof logError;
707
+ declare const mcpApps_logInfo: typeof logInfo;
708
+ declare const mcpApps_logWarning: typeof logWarning;
709
+ declare const mcpApps_notifySizeChanged: typeof notifySizeChanged;
710
+ declare const mcpApps_onTeardown: typeof onTeardown;
711
+ declare const mcpApps_openLink: typeof openLink;
712
+ declare const mcpApps_readResource: typeof readResource;
713
+ declare const mcpApps_requestDisplayMode: typeof requestDisplayMode;
714
+ declare const mcpApps_sendMessage: typeof sendMessage;
715
+ declare const mcpApps_setupAutoSizeReporting: typeof setupAutoSizeReporting;
716
+ declare const mcpApps_updateModelContext: typeof updateModelContext;
717
+ declare const mcpApps_useAvailableDisplayModes: typeof useAvailableDisplayModes;
718
+ declare const mcpApps_useContainerDimensions: typeof useContainerDimensions;
719
+ declare const mcpApps_useDeviceCapabilities: typeof useDeviceCapabilities;
720
+ declare const mcpApps_useDisplayMode: typeof useDisplayMode;
721
+ declare const mcpApps_useHostCapabilities: typeof useHostCapabilities;
722
+ declare const mcpApps_useHostContext: typeof useHostContext;
723
+ declare const mcpApps_useIsInitialized: typeof useIsInitialized;
724
+ declare const mcpApps_useLocale: typeof useLocale;
725
+ declare const mcpApps_useMcpStore: typeof useMcpStore;
726
+ declare const mcpApps_usePlatform: typeof usePlatform;
727
+ declare const mcpApps_useSafeArea: typeof useSafeArea;
728
+ declare const mcpApps_useStyles: typeof useStyles;
729
+ declare const mcpApps_useTheme: typeof useTheme;
730
+ declare const mcpApps_useTimezone: typeof useTimezone;
731
+ declare const mcpApps_useToolInfo: typeof useToolInfo;
732
+ declare const mcpApps_useToolInput: typeof useToolInput;
733
+ declare const mcpApps_useToolResult: typeof useToolResult;
734
+ declare namespace mcpApps {
735
+ export { type mcpApps_AutoResizeOptions as AutoResizeOptions, mcpApps_CallToolResult as CallToolResult, mcpApps_ClientInfo as ClientInfo, mcpApps_ContainerDimensions as ContainerDimensions, mcpApps_ContentBlock as ContentBlock, type mcpApps_CreateMcpViewOptions as CreateMcpViewOptions, mcpApps_DEFAULT_CLIENT_INFO as DEFAULT_CLIENT_INFO, mcpApps_DeviceCapabilities as DeviceCapabilities, mcpApps_DisplayMode as DisplayMode, mcpApps_ERROR_CODES as ERROR_CODES, mcpApps_HostCapabilities as HostCapabilities, mcpApps_HostContext as HostContext, mcpApps_HostInfo as HostInfo, mcpApps_InitializeOptions as InitializeOptions, mcpApps_InitializeParams as InitializeParams, mcpApps_JsonRpcError as JsonRpcError, mcpApps_JsonRpcErrorResponse as JsonRpcErrorResponse, mcpApps_JsonRpcId as JsonRpcId, mcpApps_JsonRpcMessage as JsonRpcMessage, mcpApps_JsonRpcNotification as JsonRpcNotification, mcpApps_JsonRpcRequest as JsonRpcRequest, mcpApps_JsonRpcResponse as JsonRpcResponse, mcpApps_JsonRpcSuccessResponse as JsonRpcSuccessResponse, mcpApps_LogLevel as LogLevel, mcpApps_LogMessageParams as LogMessageParams, mcpApps_MCP_METHODS as MCP_METHODS, mcpApps_McpAppsBridge as McpAppsBridge, mcpApps_McpAppsStore as McpAppsStore, mcpApps_McpStoreState as McpStoreState, mcpApps_McpUiInitializeResult as McpUiInitializeResult, mcpApps_McpUiResourceCsp as McpUiResourceCsp, type mcpApps_McpView as McpView, mcpApps_OpenLinkParams as OpenLinkParams, mcpApps_PROTOCOL_VERSION as PROTOCOL_VERSION, mcpApps_PermissionFields as PermissionFields, mcpApps_Platform as Platform, mcpApps_RequestDisplayModeParams as RequestDisplayModeParams, mcpApps_RequestDisplayModeResult as RequestDisplayModeResult, mcpApps_ResourceContent as ResourceContent, mcpApps_ResourceReadParams as ResourceReadParams, mcpApps_ResourceReadResult as ResourceReadResult, mcpApps_ResourceTeardownParams as ResourceTeardownParams, mcpApps_SafeAreaInsets as SafeAreaInsets, mcpApps_SandboxCapabilities as SandboxCapabilities, mcpApps_SizeChangedParams as SizeChangedParams, mcpApps_StyleCss as StyleCss, mcpApps_StyleVariables as StyleVariables, mcpApps_Styles as Styles, mcpApps_Theme as Theme, mcpApps_ToolCancelledParams as ToolCancelledParams, mcpApps_ToolInfo as ToolInfo, mcpApps_ToolInputParams as ToolInputParams, mcpApps_ToolInputPartialParams as ToolInputPartialParams, mcpApps_ToolsCallParams as ToolsCallParams, mcpApps_UiMessageParams as UiMessageParams, mcpApps_UpdateModelContextParams as UpdateModelContextParams, mcpApps_callTool as callTool, mcpApps_createErrorResponse as createErrorResponse, mcpApps_createMcpStoreHook as createMcpStoreHook, mcpApps_createMcpView as createMcpView, mcpApps_createNotification as createNotification, mcpApps_createRequest as createRequest, mcpApps_createSuccessResponse as createSuccessResponse, mcpApps_generateId as generateId, mcpApps_getBridge as getBridge, mcpApps_getStore as getStore, mcpApps_initialize as initialize, mcpApps_isErrorResponse as isErrorResponse, mcpApps_isJsonRpcMessage as isJsonRpcMessage, mcpApps_isNotification as isNotification, mcpApps_isRequest as isRequest, mcpApps_isResponse as isResponse, mcpApps_log as log, mcpApps_logDebug as logDebug, mcpApps_logError as logError, mcpApps_logInfo as logInfo, mcpApps_logWarning as logWarning, mcpApps_notifySizeChanged as notifySizeChanged, mcpApps_onTeardown as onTeardown, mcpApps_openLink as openLink, mcpApps_readResource as readResource, mcpApps_requestDisplayMode as requestDisplayMode, mcpApps_sendMessage as sendMessage, mcpApps_setupAutoSizeReporting as setupAutoSizeReporting, mcpApps_updateModelContext as updateModelContext, mcpApps_useAvailableDisplayModes as useAvailableDisplayModes, mcpApps_useContainerDimensions as useContainerDimensions, mcpApps_useDeviceCapabilities as useDeviceCapabilities, mcpApps_useDisplayMode as useDisplayMode, mcpApps_useHostCapabilities as useHostCapabilities, mcpApps_useHostContext as useHostContext, mcpApps_useIsInitialized as useIsInitialized, mcpApps_useLocale as useLocale, mcpApps_useMcpStore as useMcpStore, mcpApps_usePlatform as usePlatform, mcpApps_useSafeArea as useSafeArea, mcpApps_useStyles as useStyles, mcpApps_useTheme as useTheme, mcpApps_useTimezone as useTimezone, mcpApps_useToolInfo as useToolInfo, mcpApps_useToolInput as useToolInput, mcpApps_useToolResult as useToolResult };
736
+ }
737
+
738
+ export { type AutoResizeOptions as $, useToolInfo as A, useToolInput as B, useToolResult as C, useHostContext as D, ERROR_CODES as E, useHostCapabilities as F, useIsInitialized as G, initialize as H, callTool as I, JsonRpcError as J, readResource as K, sendMessage as L, McpAppsBridge as M, openLink as N, requestDisplayMode as O, updateModelContext as P, notifySizeChanged as Q, setupAutoSizeReporting as R, log as S, logDebug as T, logInfo as U, logWarning as V, logError as W, onTeardown as X, createMcpView as Y, type McpView as Z, type CreateMcpViewOptions as _, createNotification as a, createSuccessResponse as b, createRequest as c, createErrorResponse as d, isRequest as e, isNotification as f, generateId as g, isResponse as h, isJsonRpcMessage as i, isErrorResponse as j, getBridge as k, McpAppsStore as l, mcpApps as m, getStore as n, createMcpStoreHook as o, useTheme as p, useLocale as q, useTimezone as r, useDisplayMode as s, useAvailableDisplayModes as t, useMcpStore as u, useContainerDimensions as v, useSafeArea as w, usePlatform as x, useDeviceCapabilities as y, useStyles as z };