@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.
- package/README.md +333 -0
- package/dist/adaptor-interface-BYbH9PpT.d.ts +370 -0
- package/dist/apps-sdk/index.d.ts +1 -0
- package/dist/apps-sdk/index.js +4 -0
- package/dist/apps-sdk/index.js.map +1 -0
- package/dist/chunk-5NYJ2IVD.js +406 -0
- package/dist/chunk-5NYJ2IVD.js.map +1 -0
- package/dist/chunk-7HJ5PKKT.js +146 -0
- package/dist/chunk-7HJ5PKKT.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +9 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/chunk-TLBYYZHP.js +715 -0
- package/dist/chunk-TLBYYZHP.js.map +1 -0
- package/dist/chunk-YGGRUIUG.js +977 -0
- package/dist/chunk-YGGRUIUG.js.map +1 -0
- package/dist/chunk-ZYBPDIEG.js +674 -0
- package/dist/chunk-ZYBPDIEG.js.map +1 -0
- package/dist/core/index.d.ts +169 -0
- package/dist/core/index.js +195 -0
- package/dist/core/index.js.map +1 -0
- package/dist/index-BBfZZJWn.d.ts +671 -0
- package/dist/index-CpXDfXKD.d.ts +395 -0
- package/dist/index-DtukOUjY.d.ts +738 -0
- package/dist/index.d.ts +741 -0
- package/dist/index.js +685 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-apps/index.d.ts +2 -0
- package/dist/mcp-apps/index.js +4 -0
- package/dist/mcp-apps/index.js.map +1 -0
- package/dist/notify-size-changed-Ck2BGfUk.d.ts +270 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.js +7 -0
- package/dist/react/index.js.map +1 -0
- package/dist/types-B_O3kZYh.d.ts +253 -0
- package/package.json +90 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/unified/index.ts","../src/unified/hooks/simple/use-tool-input.ts","../src/unified/hooks/simple/use-tool-input-partial.ts","../src/unified/hooks/simple/use-tool-output.ts","../src/unified/hooks/simple/use-tool-response-metadata.ts","../src/unified/hooks/semantic/use-view-data.ts","../src/unified/hooks/semantic/use-action.ts","../src/unified/hooks/semantic/use-data.ts","../src/unified/hooks/simple/use-theme.ts","../src/unified/hooks/simple/use-locale.ts","../src/unified/hooks/simple/use-device-type.ts","../src/unified/hooks/simple/use-platform.ts","../src/unified/hooks/simple/use-safe-area.ts","../src/unified/hooks/simple/use-max-height.ts","../src/unified/hooks/simple/use-display-mode.ts","../src/unified/hooks/simple/use-container-size.ts","../src/unified/hooks/simple/use-input-capabilities.ts","../src/unified/hooks/rich/use-call-tool.ts","../src/unified/hooks/rich/use-view-params.ts","../src/unified/hooks/rich/use-view-state.ts","../src/unified/hooks/convenience/use-host-environment.ts","../src/unified/hooks/convenience/use-display-mode-control.ts","../src/unified/hooks/convenience/use-is-mobile.ts","../src/unified/hooks/convenience/use-is-fullscreen.ts","../src/unified/hooks/convenience/use-is-dark-mode.ts","../src/unified/provider.tsx","../src/unified/debug.ts","../src/index.ts"],"names":["useSyncExternalStore","useState","useCallback","data","callTool","useRef","useMemo","requestDisplayMode","useEffect"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAA,eAAA,GAAA,EAAA;AAAA,QAAA,CAAA,eAAA,EAAA;AAAA,EAAA,KAAA,EAAA,MAAA,KAAA;AAAA,EAAA,YAAA,EAAA,MAAA,YAAA;AAAA,EAAA,OAAA,EAAA,MAAA,OAAA;AAAA,EAAA,eAAA,EAAA,MAAA,eAAA;AAAA,EAAA,IAAA,EAAA,MAAA,IAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,kBAAA,EAAA,MAAA,kBAAA;AAAA,EAAA,gBAAA,EAAA,MAAA,gBAAA;AAAA,EAAA,cAAA,EAAA,MAAA,cAAA;AAAA,EAAA,uBAAA,EAAA,MAAA,uBAAA;AAAA,EAAA,mBAAA,EAAA,MAAA,mBAAA;AAAA,EAAA,QAAA,E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AAI,OAAO,WAAW,WAAA,EAAa;AAEjC,EAAA,UAAA,CAAW,MAAM;AACf,IAAA,IAAI,CAAC,OAAO,OAAA,EAAS;AACnB,MAAA,WAAA,EAAY;AAAA,IACd;AAAA,EACF,GAAG,CAAC,CAAA;AACN","file":"index.js","sourcesContent":["// Types\nexport type {\n Theme,\n DisplayMode,\n DeviceType,\n Platform,\n SafeAreaInsets,\n ContainerSize,\n InputCapabilities,\n ContentBlock,\n CallToolResult,\n ToolResponseMetadata,\n Feature,\n ExternalStore,\n AdaptorStoreState,\n AdaptorStoreKey,\n // Hook status types (used by both types and hooks)\n ViewParamsStatus,\n CallToolStatus,\n // Semantic API types (Tier 0)\n ViewDataStatus,\n UseViewDataResult,\n // Action/Data semantic types (Tier 0)\n ActionStatus,\n DataStatus,\n ActionTool,\n DataTool,\n UseActionCallbacks,\n UseActionResult,\n UseDataOptions,\n UseDataResult,\n // MCP-specific types\n LogLevel,\n ResourceContent,\n ResourceReadResult,\n UpdateModelContextParams,\n ResourceTeardownParams,\n TeardownHandler,\n} from './types';\n\n// Detection utilities\nexport { isAppsSdkAvailable, isMcpAppsAvailable, getPlatform } from './detection';\n\n// Adaptor\nexport { getAdaptor, resetAdaptor } from './adaptor';\nexport type { UnifiedAdaptor } from './adaptor-interface';\n\n// Hooks - Semantic API (Tier 0)\nexport { useViewData, useAction, useData } from './hooks';\n\n// Hooks - Simple\nexport {\n useTheme,\n useLocale,\n useDeviceType,\n usePlatform,\n useSafeArea,\n useMaxHeight,\n useDisplayMode,\n useContainerSize,\n useInputCapabilities,\n useToolInput,\n useToolOutput,\n useToolResponseMetadata,\n} from './hooks';\n\n// Hooks - Rich\nexport { useCallTool, useViewParams, useViewState } from './hooks';\nexport type { UseCallToolOptions, UseCallToolResult, UseCallToolCallbacks, UseViewParamsResult, UseViewStateReturn } from './hooks';\n\n// Hooks - Convenience\nexport {\n useHostEnvironment,\n useDisplayModeControl,\n useIsMobile,\n useIsFullscreen,\n useIsDarkMode,\n} from './hooks';\nexport type { HostEnvironment, DisplayModeControl } from './hooks';\n\n// Actions - Semantic API (Tier 0)\nexport { say, navigateToView, action, data } from './actions';\n\n// Actions - Core\nexport {\n callTool,\n sendFollowUpMessage,\n openExternal,\n requestDisplayMode,\n isSupported,\n} from './actions';\n\n// Actions - MCP-compatible\nexport {\n readResource,\n updateModelContext,\n log,\n logDebug,\n logInfo,\n logWarning,\n logError,\n ping,\n onTeardown,\n notifySizeChanged,\n setupAutoSizeReporting,\n} from './actions';\n\n// Provider\nexport { PancakeProvider, usePancakeContext } from './provider';\nexport type { PancakeProviderProps } from './provider';\n\n// Debug utilities\nexport {\n DEBUG,\n IS_TEST,\n IS_STORYBOOK,\n debugLog,\n debugWarn,\n debugAssert,\n debugTime,\n debugTimeAsync,\n} from './debug';\n\n// ============================================\n// View API (Unified)\n// ============================================\n\n// View class\nexport { View, createView } from './view';\nexport type { ViewOptions, ViewAppInfo, ToolResultParams } from './view';\n\n// Style utilities (standalone, work anywhere)\nexport {\n getDocumentTheme,\n observeDocumentTheme,\n applyDocumentTheme,\n applyHostStyleVariables,\n applyHostFonts,\n clearHostStyles,\n applyHostContext,\n getComputedStyleVariables,\n applySafeAreaInsets,\n getSafeAreaInsets,\n} from './style-utils';\n\n// React hooks for View\nexport {\n useView,\n useHostStyles,\n useHostTheme,\n useHostVariables,\n useHostFontsHook,\n useDocumentTheme,\n useDocumentThemeState,\n useSystemColorScheme,\n} from './react';\nexport type { UseViewOptions, UseViewResult, UseHostStylesOptions } from './react';\n\n// Note: Window.pancake global is declared and initialized in the root src/index.ts\n// Import from '@pancake-apps/web' to get automatic global setup\n","import { useSyncExternalStore } from 'react';\nimport { getAdaptor } from '../../adaptor';\n\n/**\n * Get the tool input parameters\n *\n * @returns Tool input object or undefined\n */\nexport function useToolInput<T = unknown>(): T | undefined {\n const adaptor = getAdaptor();\n const store = adaptor.getExternalStore('toolInput');\n\n return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot) as\n | T\n | undefined;\n}\n","import { useSyncExternalStore } from 'react';\nimport { getAdaptor } from '../../adaptor';\n\n/**\n * Get the partial tool input during streaming (MCP-specific)\n *\n * @returns Partial tool input object or undefined\n */\nexport function useToolInputPartial<T = unknown>(): Partial<T> | undefined {\n const adaptor = getAdaptor();\n const store = adaptor.getExternalStore('toolInputPartial');\n\n return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot) as\n | Partial<T>\n | undefined;\n}\n","import { useSyncExternalStore } from 'react';\nimport { getAdaptor } from '../../adaptor';\n\n/**\n * Get the tool output\n *\n * @returns Tool output object or undefined\n */\nexport function useToolOutput<T = unknown>(): T | undefined {\n const adaptor = getAdaptor();\n const store = adaptor.getExternalStore('toolOutput');\n\n return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot) as\n | T\n | undefined;\n}\n","import { useSyncExternalStore } from 'react';\nimport { getAdaptor } from '../../adaptor';\n\n/**\n * Get metadata about the tool response\n *\n * @returns Tool response metadata or undefined\n */\nexport function useToolResponseMetadata<T = Record<string, unknown>>(): T | undefined {\n const adaptor = getAdaptor();\n const store = adaptor.getExternalStore('toolResponseMetadata');\n\n return useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getServerSnapshot\n ) as T | undefined;\n}\n","import { useToolInput } from '../simple/use-tool-input';\nimport { useToolInputPartial } from '../simple/use-tool-input-partial';\nimport { useToolOutput } from '../simple/use-tool-output';\nimport { useToolResponseMetadata } from '../simple/use-tool-response-metadata';\nimport type { ViewDataStatus, UseViewDataResult } from '../../types';\n\n/**\n * Primary semantic hook for accessing view data (Tier 0)\n *\n * Combines tool input, output, and metadata into a single unified interface\n * with status tracking for easy conditional rendering.\n *\n * @example\n * ```tsx\n * function MyView() {\n * const { status, input, output, isReady, isError, error } = useViewData<InputType, OutputType>();\n *\n * if (status === 'idle') return <Loading />;\n * if (status === 'streaming') return <StreamingPreview partial={inputPartial} />;\n * if (status === 'pending') return <Processing />;\n * if (isError) return <Error message={error?.message} />;\n * if (isReady) return <Result data={output} />;\n * }\n * ```\n */\nexport function useViewData<\n TInput = Record<string, unknown>,\n TOutput = unknown,\n TMeta = Record<string, unknown>\n>(): UseViewDataResult<TInput, TOutput, TMeta> {\n const input = useToolInput<TInput>();\n const output = useToolOutput<TOutput>();\n const metadata = useToolResponseMetadata<TMeta>();\n\n // Get partial input for streaming (reactive via useSyncExternalStore)\n const inputPartial = useToolInputPartial<TInput>();\n\n // Derive status\n let status: ViewDataStatus;\n let error: Error | undefined;\n\n if (!input && !inputPartial) {\n status = 'idle';\n } else if (inputPartial && !input) {\n status = 'streaming';\n } else if (input && !output) {\n status = 'pending';\n } else if (output) {\n status = 'ready';\n } else {\n status = 'idle';\n }\n\n // Check for error in metadata\n if (metadata && (metadata as Record<string, unknown>).isError) {\n status = 'error';\n error = new Error(\n ((metadata as Record<string, unknown>).errorMessage as string) ?? 'Unknown error'\n );\n }\n\n return {\n status,\n isIdle: status === 'idle',\n isPending: status === 'pending',\n isStreaming: status === 'streaming',\n isReady: status === 'ready',\n isError: status === 'error',\n input,\n inputPartial,\n output,\n metadata,\n error,\n };\n}\n","import { useState, useCallback } from 'react';\nimport { action } from '../../actions/action';\nimport type { ActionStatus, UseActionCallbacks, UseActionResult } from '../../types';\n\n/**\n * Hook for executing action tools (Tier 0 Semantic API)\n *\n * Actions are side-effect tools that mutate state. This hook provides\n * status tracking and convenient execution methods.\n *\n * Use for: save, delete, update, navigate, send, submit\n *\n * @param toolName - Name of the action tool\n * @returns Object with status, execute functions, and reset\n *\n * @example\n * ```tsx\n * function DeleteButton({ id }: { id: string }) {\n * const { isPending, isError, error, execute } = useAction<{ id: string }>('delete-item');\n *\n * return (\n * <>\n * <button\n * onClick={() => execute(\n * { id },\n * { onSuccess: () => console.log('Deleted!') }\n * )}\n * disabled={isPending}\n * >\n * {isPending ? 'Deleting...' : 'Delete'}\n * </button>\n * {isError && <p>Error: {error?.message}</p>}\n * </>\n * );\n * }\n * ```\n */\nexport function useAction<TInput = void>(toolName: string): UseActionResult<TInput> {\n const [status, setStatus] = useState<ActionStatus>('idle');\n const [error, setError] = useState<Error | undefined>(undefined);\n\n const executeAsync = useCallback(\n async (input?: TInput): Promise<void> => {\n setStatus('pending');\n setError(undefined);\n\n try {\n await action(toolName, input);\n setStatus('success');\n } catch (err) {\n const errorObj = err instanceof Error ? err : new Error(String(err));\n setError(errorObj);\n setStatus('error');\n throw errorObj;\n }\n },\n [toolName]\n );\n\n const execute = useCallback(\n (input?: TInput, callbacks?: UseActionCallbacks) => {\n executeAsync(input)\n .then(() => {\n callbacks?.onSuccess?.();\n callbacks?.onSettled?.();\n })\n .catch((err) => {\n callbacks?.onError?.(err);\n callbacks?.onSettled?.();\n });\n },\n [executeAsync]\n );\n\n const reset = useCallback(() => {\n setStatus('idle');\n setError(undefined);\n }, []);\n\n return {\n status,\n isIdle: status === 'idle',\n isPending: status === 'pending',\n isSuccess: status === 'success',\n isError: status === 'error',\n error,\n execute,\n executeAsync,\n reset,\n };\n}\n","import { useState, useCallback, useEffect, useRef } from 'react';\nimport { data } from '../../actions/data';\nimport type { DataStatus, UseDataOptions, UseDataResult } from '../../types';\n\n// Simple in-memory cache\ninterface CacheEntry<TOutput> {\n data: TOutput;\n timestamp: number;\n input: unknown;\n}\n\nconst cache = new Map<string, CacheEntry<unknown>>();\n\n/**\n * Generate a cache key from tool name and input\n */\nfunction getCacheKey(toolName: string, input: unknown): string {\n return `${toolName}:${JSON.stringify(input ?? null)}`;\n}\n\n/**\n * Default options\n */\nconst DEFAULT_OPTIONS = {\n staleTime: 0,\n cacheTime: 5 * 60 * 1000, // 5 minutes\n refetchOnWindowFocus: false,\n};\n\n/**\n * Hook for fetching data from tools (Tier 0 Semantic API)\n *\n * Data tools are read-only queries that return structured data. This hook\n * provides status tracking, caching, and convenient fetch methods.\n *\n * Use for: search, get, list, fetch\n *\n * @param toolName - Name of the data tool\n * @param defaultInput - Default input to use for fetches\n * @param options - Configuration options\n * @returns Object with status, data, fetch functions, and cache controls\n *\n * @example\n * ```tsx\n * function SearchResults({ query }: { query: string }) {\n * const { data, isPending, isStale, refetch } = useData<{ q: string }, Result[]>(\n * 'search',\n * { q: query },\n * { staleTime: 30000, refetchOnWindowFocus: true }\n * );\n *\n * return (\n * <div>\n * {isPending && <Loading />}\n * {isStale && <span>Refreshing...</span>}\n * {data?.map(item => <Item key={item.id} {...item} />)}\n * <button onClick={refetch}>Refresh</button>\n * </div>\n * );\n * }\n * ```\n */\nexport function useData<TInput = void, TOutput = unknown>(\n toolName: string,\n defaultInput?: TInput,\n options?: UseDataOptions<TOutput>\n): UseDataResult<TInput, TOutput> {\n const opts = { ...DEFAULT_OPTIONS, ...options };\n\n const [status, setStatus] = useState<DataStatus>('idle');\n const [fetchedData, setFetchedData] = useState<TOutput | undefined>(opts.initialData);\n const [error, setError] = useState<Error | undefined>(undefined);\n const [isFetching, setIsFetching] = useState(false);\n const [isStale, setIsStale] = useState(false);\n\n const lastInputRef = useRef<TInput | undefined>(defaultInput);\n const refetchIntervalRef = useRef<ReturnType<typeof setInterval> | null>(null);\n\n // Check if cached data is stale\n const checkStale = useCallback(\n (cacheKey: string) => {\n const entry = cache.get(cacheKey);\n if (!entry) return true;\n const age = Date.now() - entry.timestamp;\n return age > opts.staleTime;\n },\n [opts.staleTime]\n );\n\n // Clean up expired cache entries\n const cleanupCache = useCallback(() => {\n const now = Date.now();\n for (const [key, entry] of cache.entries()) {\n if (now - entry.timestamp > opts.cacheTime) {\n cache.delete(key);\n }\n }\n }, [opts.cacheTime]);\n\n const fetchAsync = useCallback(\n async (input?: TInput): Promise<TOutput> => {\n const actualInput = input ?? lastInputRef.current;\n lastInputRef.current = actualInput;\n\n const cacheKey = getCacheKey(toolName, actualInput);\n\n // Check cache first\n const cachedEntry = cache.get(cacheKey) as CacheEntry<TOutput> | undefined;\n const isCacheStale = checkStale(cacheKey);\n\n // If we have fresh cached data, return it\n if (cachedEntry && !isCacheStale) {\n setFetchedData(cachedEntry.data);\n setStatus('success');\n setIsStale(false);\n return cachedEntry.data;\n }\n\n // If we have stale cached data, show it but refetch\n if (cachedEntry && isCacheStale) {\n setFetchedData(cachedEntry.data);\n setStatus('stale');\n setIsStale(true);\n } else {\n setStatus('pending');\n }\n\n setIsFetching(true);\n setError(undefined);\n\n try {\n const result = await data<TInput, TOutput>(toolName, actualInput);\n\n // Update cache\n cache.set(cacheKey, {\n data: result,\n timestamp: Date.now(),\n input: actualInput,\n });\n\n setFetchedData(result);\n setStatus('success');\n setIsStale(false);\n opts.onSuccess?.(result);\n\n // Clean up old cache entries\n cleanupCache();\n\n return result;\n } catch (err) {\n const errorObj = err instanceof Error ? err : new Error(String(err));\n setError(errorObj);\n setStatus('error');\n opts.onError?.(errorObj);\n throw errorObj;\n } finally {\n setIsFetching(false);\n }\n },\n [toolName, checkStale, cleanupCache, opts]\n );\n\n const fetch = useCallback(\n (input?: TInput) => {\n fetchAsync(input).catch(() => {\n // Error is already handled in fetchAsync\n });\n },\n [fetchAsync]\n );\n\n const refetch = useCallback(() => {\n fetch(lastInputRef.current);\n }, [fetch]);\n\n const invalidate = useCallback(() => {\n const cacheKey = getCacheKey(toolName, lastInputRef.current);\n cache.delete(cacheKey);\n setIsStale(true);\n setStatus((prev) => (prev === 'success' ? 'stale' : prev));\n }, [toolName]);\n\n // Set up refetch on window focus\n useEffect(() => {\n if (!opts.refetchOnWindowFocus) return;\n\n const handleFocus = () => {\n if (fetchedData !== undefined) {\n refetch();\n }\n };\n\n window.addEventListener('focus', handleFocus);\n return () => window.removeEventListener('focus', handleFocus);\n }, [opts.refetchOnWindowFocus, fetchedData, refetch]);\n\n // Set up refetch interval\n useEffect(() => {\n if (!opts.refetchInterval) return;\n\n refetchIntervalRef.current = setInterval(() => {\n if (fetchedData !== undefined) {\n refetch();\n }\n }, opts.refetchInterval);\n\n return () => {\n if (refetchIntervalRef.current) {\n clearInterval(refetchIntervalRef.current);\n }\n };\n }, [opts.refetchInterval, fetchedData, refetch]);\n\n return {\n status,\n isIdle: status === 'idle',\n isPending: status === 'pending',\n isSuccess: status === 'success',\n isError: status === 'error',\n isStale: status === 'stale' || isStale,\n isFetching,\n data: fetchedData,\n error,\n fetch,\n fetchAsync,\n refetch,\n invalidate,\n };\n}\n","import { useSyncExternalStore } from 'react';\nimport { getAdaptor } from '../../adaptor';\nimport { SSR_DEFAULTS } from '../../defaults';\nimport type { Theme } from '../../types';\n\n/**\n * Get the current theme (light or dark)\n *\n * @returns Current theme\n *\n * @example\n * ```tsx\n * function MyView() {\n * const theme = useTheme();\n * return <div className={theme === 'dark' ? 'dark' : 'light'}>...</div>;\n * }\n * ```\n */\nexport function useTheme(): Theme {\n const adaptor = getAdaptor();\n const store = adaptor.getExternalStore('theme');\n\n return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot) ?? SSR_DEFAULTS.theme;\n}\n","import { useSyncExternalStore } from 'react';\nimport { getAdaptor } from '../../adaptor';\n\n/**\n * Get the user's locale setting\n *\n * @returns BCP 47 language tag (e.g., 'en-US')\n */\nexport function useLocale(): string {\n const adaptor = getAdaptor();\n const store = adaptor.getExternalStore('locale');\n\n return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot) ?? 'en-US';\n}\n","import { useSyncExternalStore } from 'react';\nimport { getAdaptor } from '../../adaptor';\nimport { SSR_DEFAULTS } from '../../defaults';\nimport type { DeviceType } from '../../types';\n\n/**\n * Get the device type (mobile, tablet, desktop)\n *\n * @returns Device type\n */\nexport function useDeviceType(): DeviceType {\n const adaptor = getAdaptor();\n const store = adaptor.getExternalStore('deviceType');\n\n return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot) ?? SSR_DEFAULTS.deviceType;\n}\n","import { useSyncExternalStore } from 'react';\nimport { getAdaptor } from '../../adaptor';\nimport { SSR_DEFAULTS } from '../../defaults';\nimport type { Platform } from '../../types';\n\n/**\n * Get the current platform\n *\n * @returns Platform identifier\n */\nexport function usePlatform(): Platform {\n const adaptor = getAdaptor();\n const store = adaptor.getExternalStore('platform');\n\n return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot) ?? SSR_DEFAULTS.platform;\n}\n","import { useSyncExternalStore } from 'react';\nimport { getAdaptor } from '../../adaptor';\nimport { SSR_DEFAULTS } from '../../defaults';\nimport type { SafeAreaInsets } from '../../types';\n\n/**\n * Get safe area insets for devices with notches/rounded corners\n *\n * @returns Safe area insets object\n */\nexport function useSafeArea(): SafeAreaInsets {\n const adaptor = getAdaptor();\n const store = adaptor.getExternalStore('safeArea');\n\n return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot) ?? SSR_DEFAULTS.safeArea;\n}\n","import { useSyncExternalStore } from 'react';\nimport { getAdaptor } from '../../adaptor';\nimport { SSR_DEFAULTS } from '../../defaults';\n\n/**\n * Get the maximum height constraint\n *\n * @returns Maximum height in pixels\n */\nexport function useMaxHeight(): number {\n const adaptor = getAdaptor();\n const store = adaptor.getExternalStore('maxHeight');\n\n return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot) ?? SSR_DEFAULTS.maxHeight;\n}\n","import { useSyncExternalStore } from 'react';\nimport { getAdaptor } from '../../adaptor';\nimport { SSR_DEFAULTS } from '../../defaults';\nimport type { DisplayMode } from '../../types';\n\n/**\n * Get the current display mode\n *\n * @returns Current display mode\n */\nexport function useDisplayMode(): DisplayMode {\n const adaptor = getAdaptor();\n const store = adaptor.getExternalStore('displayMode');\n\n return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot) ?? SSR_DEFAULTS.displayMode;\n}\n","import { useSyncExternalStore } from 'react';\nimport { getAdaptor } from '../../adaptor';\nimport { SSR_DEFAULTS } from '../../defaults';\nimport type { ContainerSize } from '../../types';\n\n/**\n * Get the container size dimensions\n *\n * @returns Container size object with width and height\n */\nexport function useContainerSize(): ContainerSize {\n const adaptor = getAdaptor();\n const store = adaptor.getExternalStore('containerSize');\n\n return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot) ?? SSR_DEFAULTS.containerSize;\n}\n","import { useSyncExternalStore } from 'react';\nimport { getAdaptor } from '../../adaptor';\nimport { SSR_DEFAULTS } from '../../defaults';\nimport type { InputCapabilities } from '../../types';\n\n/**\n * Get input capabilities (keyboard, touch, etc.)\n *\n * @returns Input capabilities object\n */\nexport function useInputCapabilities(): InputCapabilities {\n const adaptor = getAdaptor();\n const store = adaptor.getExternalStore('inputCapabilities');\n\n return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot) ?? SSR_DEFAULTS.inputCapabilities;\n}\n","import { useState, useCallback } from 'react';\nimport { getAdaptor } from '../../adaptor';\nimport type {\n CallToolResult,\n CallToolStatus,\n UseCallToolCallbacks,\n UseCallToolResult,\n} from '../../types';\n\nexport type { UseCallToolCallbacks, UseCallToolResult };\n\n/**\n * Options for the useCallTool hook (alias for UseCallToolCallbacks)\n */\nexport type UseCallToolOptions<TOutput> = UseCallToolCallbacks<TOutput>;\n\n/**\n * Rich hook for calling tools with full state machine\n *\n * @param toolName - Name of the tool to call\n * @returns Object with status, data, error, and call functions\n *\n * @example\n * ```tsx\n * function SearchButton() {\n * const { isPending, isError, error, callTool } = useCallTool<\n * { query: string },\n * SearchResult\n * >('search');\n *\n * return (\n * <>\n * <button\n * onClick={() => callTool(\n * { query: 'pancakes' },\n * { onSuccess: (data) => console.log('Found:', data) }\n * )}\n * disabled={isPending}\n * >\n * {isPending ? 'Searching...' : 'Search'}\n * </button>\n * {isError && <p>Error: {error?.message}</p>}\n * </>\n * );\n * }\n * ```\n */\nexport function useCallTool<\n TInput = Record<string, unknown>,\n TOutput = unknown\n>(toolName: string): UseCallToolResult<TInput, TOutput> {\n const [status, setStatus] = useState<CallToolStatus>('idle');\n const [data, setData] = useState<CallToolResult<TOutput> | undefined>(undefined);\n const [error, setError] = useState<Error | undefined>(undefined);\n\n const callToolAsync = useCallback(\n async (args?: TInput): Promise<CallToolResult<TOutput>> => {\n const adaptor = getAdaptor();\n setStatus('pending');\n setError(undefined);\n\n try {\n const result = await adaptor.callTool<TInput, TOutput>(toolName, args);\n setData(result);\n setStatus('success');\n return result;\n } catch (err) {\n const errorObj = err instanceof Error ? err : new Error(String(err));\n setError(errorObj);\n setStatus('error');\n throw errorObj;\n }\n },\n [toolName]\n );\n\n const callTool = useCallback(\n (args?: TInput, callbacks?: UseCallToolCallbacks<TOutput>) => {\n callToolAsync(args)\n .then((result) => {\n callbacks?.onSuccess?.(result);\n callbacks?.onSettled?.();\n })\n .catch((err) => {\n callbacks?.onError?.(err);\n callbacks?.onSettled?.();\n });\n },\n [callToolAsync]\n );\n\n const reset = useCallback(() => {\n setStatus('idle');\n setData(undefined);\n setError(undefined);\n }, []);\n\n return {\n status,\n isIdle: status === 'idle',\n isPending: status === 'pending',\n isSuccess: status === 'success',\n isError: status === 'error',\n data,\n error,\n callTool,\n callToolAsync,\n reset,\n };\n}\n","import { useToolInput } from '../simple/use-tool-input';\nimport { useToolOutput } from '../simple/use-tool-output';\nimport { useToolResponseMetadata } from '../simple/use-tool-response-metadata';\nimport type { ViewParamsStatus, UseViewParamsResult } from '../../types';\n\nexport type { UseViewParamsResult };\n\n/**\n * Combined access to tool input/output with status derivation\n *\n * Status is derived as follows:\n * - 'idle': No tool input received yet\n * - 'pending': Tool input received, waiting for output\n * - 'success': Both input and output available\n *\n * @returns Object with status flags and data\n *\n * @example\n * ```tsx\n * function SearchResults() {\n * const { status, isSuccess, input, output } = useViewParams<\n * { query: string },\n * SearchOutput,\n * { timing: number }\n * >();\n *\n * if (!isSuccess) {\n * return <Loading query={input?.query} />;\n * }\n *\n * return <ResultList results={output.items} />;\n * }\n * ```\n */\nexport function useViewParams<\n TInput = Record<string, unknown>,\n TOutput = unknown,\n TMeta = Record<string, unknown>\n>(): UseViewParamsResult<TInput, TOutput, TMeta> {\n const input = useToolInput<TInput>();\n const output = useToolOutput<TOutput>();\n const metadata = useToolResponseMetadata<TMeta>();\n\n // Derive status from input/output availability\n let status: ViewParamsStatus;\n if (!input) {\n status = 'idle';\n } else if (!output) {\n status = 'pending';\n } else {\n status = 'success';\n }\n\n return {\n status,\n isIdle: status === 'idle',\n isPending: status === 'pending',\n isSuccess: status === 'success',\n input,\n output,\n metadata,\n };\n}\n","import { useSyncExternalStore, useCallback, useMemo, useRef } from 'react';\nimport { getAdaptor } from '../../adaptor';\n\nexport interface UseViewStateReturn<T> extends Array<T | ((newState: T | ((prev: T) => T)) => void)> {\n /** Current state value */\n 0: T;\n /** Function to update state */\n 1: (newState: T | ((prev: T) => T)) => void;\n /** Current state value (named access) */\n state: T;\n /** Function to update state (named access) */\n setState: (newState: T | ((prev: T) => T)) => void;\n /** Reset state to initial value */\n resetState: () => void;\n /** Whether state differs from initial */\n isDirty: boolean;\n}\n\n/**\n * Manage view state with reset capability and dirty tracking.\n * State is synced with the platform (persisted across conversation turns).\n *\n * Supports both tuple and object destructuring:\n * @example\n * ```tsx\n * // Tuple style (like useState)\n * const [count, setCount] = useViewState(0);\n *\n * // Object style (with extra features)\n * const { state, setState, resetState, isDirty } = useViewState(0);\n * ```\n *\n * @param initialState - Initial state value (used when no persisted state exists)\n * @returns Tuple/object with state, setState, resetState, and isDirty flag\n */\nexport function useViewState<T>(initialState: T): UseViewStateReturn<T> {\n const adaptor = getAdaptor();\n const store = adaptor.getExternalStore('viewState');\n\n // Track initial state for dirty comparison\n const initialRef = useRef(initialState);\n\n // Sync with platform state via external store\n const persistedState = useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getServerSnapshot\n ) as T | undefined;\n\n // Resolve to persisted or initial\n const state = persistedState ?? initialState;\n\n // setState syncs to platform\n const setState = useCallback((newState: T | ((prev: T) => T)) => {\n const current = (adaptor.getViewState<T>() ?? initialRef.current);\n const nextState = typeof newState === 'function'\n ? (newState as (prev: T) => T)(current)\n : newState;\n adaptor.setViewState(nextState);\n }, [adaptor]);\n\n // resetState clears to initial\n const resetState = useCallback(() => {\n adaptor.setViewState(initialRef.current);\n }, [adaptor]);\n\n // Dirty if platform state exists and differs from initial\n const isDirty = persistedState !== undefined &&\n JSON.stringify(persistedState) !== JSON.stringify(initialRef.current);\n\n // Return array-like object that supports both [state, setState] and {state, setState}\n return useMemo(() => {\n const result = [state, setState] as UseViewStateReturn<T>;\n result.state = state;\n result.setState = setState;\n result.resetState = resetState;\n result.isDirty = isDirty;\n return result;\n }, [state, setState, resetState, isDirty]);\n}\n","import { useMemo } from 'react';\nimport { useTheme } from '../simple/use-theme';\nimport { useLocale } from '../simple/use-locale';\nimport { useDeviceType } from '../simple/use-device-type';\nimport { usePlatform } from '../simple/use-platform';\nimport { useSafeArea } from '../simple/use-safe-area';\nimport { useDisplayMode } from '../simple/use-display-mode';\nimport { useContainerSize } from '../simple/use-container-size';\nimport { useInputCapabilities } from '../simple/use-input-capabilities';\nimport type {\n Theme,\n DeviceType,\n Platform,\n SafeAreaInsets,\n DisplayMode,\n ContainerSize,\n InputCapabilities,\n} from '../../types';\n\nexport interface HostEnvironment {\n theme: Theme;\n locale: string;\n deviceType: DeviceType;\n platform: Platform;\n safeArea: SafeAreaInsets;\n displayMode: DisplayMode;\n containerSize: ContainerSize;\n inputCapabilities: InputCapabilities;\n}\n\n/**\n * Get all host environment information in a single hook\n *\n * @returns Complete host environment object\n */\nexport function useHostEnvironment(): HostEnvironment {\n const theme = useTheme();\n const locale = useLocale();\n const deviceType = useDeviceType();\n const platform = usePlatform();\n const safeArea = useSafeArea();\n const displayMode = useDisplayMode();\n const containerSize = useContainerSize();\n const inputCapabilities = useInputCapabilities();\n\n return useMemo(\n () => ({\n theme,\n locale,\n deviceType,\n platform,\n safeArea,\n displayMode,\n containerSize,\n inputCapabilities,\n }),\n [theme, locale, deviceType, platform, safeArea, displayMode, containerSize, inputCapabilities]\n );\n}\n","import { useCallback, useMemo } from 'react';\nimport { useDisplayMode } from '../simple/use-display-mode';\nimport { getAdaptor } from '../../adaptor';\nimport type { DisplayMode } from '../../types';\n\nexport interface DisplayModeControl {\n displayMode: DisplayMode;\n requestFullscreen: () => Promise<void>;\n requestInline: () => Promise<void>;\n requestPip: () => Promise<void>;\n requestDisplayMode: (mode: DisplayMode) => Promise<void>;\n isFullscreen: boolean;\n isInline: boolean;\n isPip: boolean;\n}\n\n/**\n * Control display mode with convenient methods\n *\n * @returns Display mode state and control methods\n */\nexport function useDisplayModeControl(): DisplayModeControl {\n const displayMode = useDisplayMode();\n const adaptor = getAdaptor();\n\n const requestDisplayMode = useCallback(\n async (mode: DisplayMode): Promise<void> => {\n await adaptor.requestDisplayMode(mode);\n },\n [adaptor]\n );\n\n const requestFullscreen = useCallback(async (): Promise<void> => {\n await requestDisplayMode('fullscreen');\n }, [requestDisplayMode]);\n\n const requestInline = useCallback(async (): Promise<void> => {\n await requestDisplayMode('inline');\n }, [requestDisplayMode]);\n\n const requestPip = useCallback(async (): Promise<void> => {\n await requestDisplayMode('pip');\n }, [requestDisplayMode]);\n\n return useMemo(\n () => ({\n displayMode,\n requestFullscreen,\n requestInline,\n requestPip,\n requestDisplayMode,\n isFullscreen: displayMode === 'fullscreen',\n isInline: displayMode === 'inline',\n isPip: displayMode === 'pip',\n }),\n [displayMode, requestFullscreen, requestInline, requestPip, requestDisplayMode]\n );\n}\n","import { useDeviceType } from '../simple/use-device-type';\n\n/**\n * Check if the current device is mobile or tablet\n *\n * @returns true if deviceType is 'mobile' or 'tablet'\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const isMobile = useIsMobile();\n * return isMobile ? <MobileView /> : <DesktopView />;\n * }\n * ```\n */\nexport function useIsMobile(): boolean {\n const deviceType = useDeviceType();\n return deviceType === 'mobile' || deviceType === 'tablet';\n}\n","import { useDisplayMode } from '../simple/use-display-mode';\n\n/**\n * Check if the current display mode is fullscreen\n *\n * @returns true if displayMode is 'fullscreen'\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const isFullscreen = useIsFullscreen();\n * return isFullscreen ? <FullscreenLayout /> : <InlineLayout />;\n * }\n * ```\n */\nexport function useIsFullscreen(): boolean {\n const displayMode = useDisplayMode();\n return displayMode === 'fullscreen';\n}\n","import { useTheme } from '../simple/use-theme';\n\n/**\n * Check if the current theme is dark mode\n *\n * @returns true if theme is 'dark'\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const isDarkMode = useIsDarkMode();\n * return (\n * <div style={{ background: isDarkMode ? '#1a1a1a' : '#ffffff' }}>\n * Content\n * </div>\n * );\n * }\n * ```\n */\nexport function useIsDarkMode(): boolean {\n const theme = useTheme();\n return theme === 'dark';\n}\n","import React, { useState, useEffect, createContext, useContext, type ReactNode } from 'react';\nimport { getAdaptor } from './adaptor';\nimport { isMcpAppsAvailable } from './detection';\n\ninterface PancakeContextValue {\n isReady: boolean;\n error: Error | undefined;\n platform: 'apps-sdk' | 'mcp-apps';\n}\n\nconst PancakeContext = createContext<PancakeContextValue | null>(null);\n\nexport interface PancakeProviderProps {\n /**\n * Children to render once the provider is ready\n */\n children: ReactNode;\n\n /**\n * Callback when initialization fails\n */\n onError?: (error: Error) => void;\n\n /**\n * Enable debug logging\n */\n debug?: boolean;\n\n /**\n * Custom loading component to show while initializing (MCP only)\n * If not provided, children are rendered immediately on Apps SDK,\n * and nothing is rendered until ready on MCP\n */\n fallback?: ReactNode;\n\n /**\n * If true, renders children even before initialization completes\n * Use this for progressive enhancement patterns\n */\n immediate?: boolean;\n}\n\n/**\n * Provider component that handles platform initialization\n *\n * On MCP Apps: Waits for handshake to complete before rendering children\n * On Apps SDK: Renders immediately (no async initialization needed)\n *\n * @example\n * ```tsx\n * function App() {\n * return (\n * <PancakeProvider\n * onError={(e) => console.error('Init failed:', e)}\n * fallback={<LoadingSpinner />}\n * >\n * <MyPancakeApp />\n * </PancakeProvider>\n * );\n * }\n * ```\n */\nexport function PancakeProvider({\n children,\n onError,\n debug = false,\n fallback = null,\n immediate = false,\n}: PancakeProviderProps): React.ReactElement | null {\n const [isReady, setIsReady] = useState(false);\n const [error, setError] = useState<Error | undefined>(undefined);\n\n // Detect platform once\n const isMcp = isMcpAppsAvailable();\n const platform = isMcp ? 'mcp-apps' : 'apps-sdk';\n\n useEffect(() => {\n const adaptor = getAdaptor();\n\n if (debug) {\n console.log('[Pancake] Initializing on platform:', platform);\n }\n\n adaptor\n .ensureReady()\n .then(() => {\n if (debug) {\n console.log('[Pancake] Initialization complete');\n }\n setIsReady(true);\n })\n .catch((err: Error) => {\n if (debug) {\n console.error('[Pancake] Initialization failed:', err);\n }\n setError(err);\n onError?.(err);\n });\n }, [debug, onError, platform]);\n\n const contextValue: PancakeContextValue = {\n isReady,\n error,\n platform,\n };\n\n // On Apps SDK, we can render immediately since there's no async init\n // On MCP, we need to wait for the handshake unless immediate is true\n const shouldRender = isReady || immediate || (!isMcp && !error);\n\n return (\n <PancakeContext.Provider value={contextValue}>\n {shouldRender ? children : fallback}\n </PancakeContext.Provider>\n );\n}\n\n/**\n * Hook to access Pancake provider context\n *\n * @returns Context value with isReady, error, and platform\n * @throws If used outside of PancakeProvider\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { isReady, platform, error } = usePancakeContext();\n * if (error) return <Error error={error} />;\n * if (!isReady) return <Loading />;\n * return <Content />;\n * }\n * ```\n */\nexport function usePancakeContext(): PancakeContextValue {\n const context = useContext(PancakeContext);\n if (!context) {\n throw new Error('usePancakeContext must be used within a PancakeProvider');\n }\n return context;\n}\n","/**\n * Development Mode Helpers\n *\n * Utilities for debugging and development environments.\n */\n\n/**\n * Check if running in development mode\n */\nexport const DEBUG =\n typeof process !== 'undefined' &&\n process.env?.NODE_ENV === 'development';\n\n/**\n * Check if running in a test environment\n */\nexport const IS_TEST =\n typeof process !== 'undefined' &&\n process.env?.NODE_ENV === 'test';\n\n/**\n * Check if running in Storybook\n */\nexport const IS_STORYBOOK =\n typeof window !== 'undefined' &&\n Boolean((window as unknown as { __STORYBOOK_CLIENT_API__?: unknown }).__STORYBOOK_CLIENT_API__);\n\n/**\n * Log a debug message (only in development mode)\n *\n * @param message - Message to log\n * @param data - Optional data to log\n */\nexport function debugLog(message: string, data?: unknown): void {\n if (DEBUG) {\n if (data !== undefined) {\n console.log(`[Pancake Debug] ${message}`, data);\n } else {\n console.log(`[Pancake Debug] ${message}`);\n }\n }\n}\n\n/**\n * Log a debug warning (only in development mode)\n *\n * @param message - Warning message\n * @param data - Optional data to log\n */\nexport function debugWarn(message: string, data?: unknown): void {\n if (DEBUG) {\n if (data !== undefined) {\n console.warn(`[Pancake Debug] ${message}`, data);\n } else {\n console.warn(`[Pancake Debug] ${message}`);\n }\n }\n}\n\n/**\n * Assert a condition and log an error if it fails (development only)\n *\n * @param condition - Condition to check\n * @param message - Error message if condition is false\n */\nexport function debugAssert(condition: boolean, message: string): void {\n if (DEBUG && !condition) {\n console.error(`[Pancake Assert] ${message}`);\n }\n}\n\n/**\n * Measure execution time of a function (development only)\n *\n * @param label - Label for the measurement\n * @param fn - Function to measure\n * @returns Result of the function\n */\nexport function debugTime<T>(label: string, fn: () => T): T {\n if (DEBUG) {\n console.time(`[Pancake] ${label}`);\n const result = fn();\n console.timeEnd(`[Pancake] ${label}`);\n return result;\n }\n return fn();\n}\n\n/**\n * Async version of debugTime\n *\n * @param label - Label for the measurement\n * @param fn - Async function to measure\n * @returns Promise with result of the function\n */\nexport async function debugTimeAsync<T>(label: string, fn: () => Promise<T>): Promise<T> {\n if (DEBUG) {\n console.time(`[Pancake] ${label}`);\n const result = await fn();\n console.timeEnd(`[Pancake] ${label}`);\n return result;\n }\n return fn();\n}\n","/**\n * @pancake-apps/web - Unified SDK for building Pancake apps\n *\n * This is the main entry point that auto-detects the platform\n * and provides a unified API.\n *\n * Subpath exports:\n * - @pancake-apps/web - Unified SDK (this file)\n * - @pancake-apps/web/apps-sdk - ChatGPT Apps SDK\n * - @pancake-apps/web/mcp-apps - MCP Apps SDK\n */\n\n// Re-export everything from unified\nexport * from './unified';\n\n// Also export the sub-packages for advanced use cases\nexport * as appsSdk from './apps-sdk';\nexport * as mcpApps from './mcp-apps';\n\n// Global pancake object setup\nimport { getAdaptor, getPlatform } from './unified';\nimport * as appsSdk from './apps-sdk';\nimport * as mcpApps from './mcp-apps';\nimport * as unified from './unified';\n\ndeclare global {\n interface Window {\n pancake?: PancakeGlobal;\n }\n}\n\nexport interface PancakeGlobal {\n platform: ReturnType<typeof getPlatform>;\n adaptor: ReturnType<typeof getAdaptor>;\n appsSdk: typeof appsSdk;\n mcpApps: typeof mcpApps;\n unified: typeof unified;\n}\n\n/**\n * Initialize and attach the pancake global object to window\n * This allows imperative access to the SDK from non-React code\n */\nexport function initPancake(): PancakeGlobal {\n const pancake: PancakeGlobal = {\n platform: getPlatform(),\n adaptor: getAdaptor(),\n appsSdk,\n mcpApps,\n unified,\n };\n\n if (typeof window !== 'undefined') {\n window.pancake = pancake;\n }\n\n return pancake;\n}\n\n// Auto-initialize in browser environment\nif (typeof window !== 'undefined') {\n // Use setTimeout to allow tree-shaking if not used\n setTimeout(() => {\n if (!window.pancake) {\n initPancake();\n }\n }, 0);\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { C as CallToolResult, o as ClientInfo, j as ContainerDimensions, p as ContentBlock, q as DEFAULT_CLIENT_INFO, l as DeviceCapabilities, D as DisplayMode, g as HostCapabilities, H as HostContext, h as HostInfo, I as InitializeOptions, r as InitializeParams, d as JsonRpcErrorResponse, J as JsonRpcId, e as JsonRpcMessage, b as JsonRpcNotification, a as JsonRpcRequest, s as JsonRpcResponse, c as JsonRpcSuccessResponse, L as LogLevel, t as LogMessageParams, u as MCP_METHODS, i as McpStoreState, M as McpUiInitializeResult, v as McpUiResourceCsp, O as OpenLinkParams, w as PROTOCOL_VERSION, x as PermissionFields, P as Platform, y as RequestDisplayModeParams, z as RequestDisplayModeResult, A as ResourceContent, B as ResourceReadParams, f as ResourceReadResult, R as ResourceTeardownParams, k as SafeAreaInsets, E as SandboxCapabilities, F as SizeChangedParams, G as StyleCss, S as StyleVariables, m as Styles, T as Theme, K as ToolCancelledParams, n as ToolInfo, N as ToolInputParams, Q as ToolInputPartialParams, V as ToolsCallParams, W as UiMessageParams, U as UpdateModelContextParams } from '../types-B_O3kZYh.js';
|
|
2
|
+
export { $ as AutoResizeOptions, _ as CreateMcpViewOptions, E as ERROR_CODES, J as JsonRpcError, M as McpAppsBridge, l as McpAppsStore, Z as McpView, I as callTool, d as createErrorResponse, o as createMcpStoreHook, Y as createMcpView, a as createNotification, c as createRequest, b as createSuccessResponse, g as generateId, k as getBridge, n as getStore, H as initialize, j as isErrorResponse, i as isJsonRpcMessage, f as isNotification, e as isRequest, h as isResponse, S as log, T as logDebug, W as logError, U as logInfo, V as logWarning, Q as notifySizeChanged, X as onTeardown, N as openLink, K as readResource, O as requestDisplayMode, L as sendMessage, R as setupAutoSizeReporting, P as updateModelContext, t as useAvailableDisplayModes, v as useContainerDimensions, y as useDeviceCapabilities, s as useDisplayMode, F as useHostCapabilities, D as useHostContext, G as useIsInitialized, q as useLocale, u as useMcpStore, x as usePlatform, w as useSafeArea, z as useStyles, p as useTheme, r as useTimezone, A as useToolInfo, B as useToolInput, C as useToolResult } from '../index-DtukOUjY.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { DEFAULT_CLIENT_INFO, ERROR_CODES, JsonRpcError, MCP_METHODS, McpAppsBridge, McpAppsStore, PROTOCOL_VERSION, callTool, createErrorResponse, createMcpStoreHook, createMcpView, createNotification, createRequest, createSuccessResponse, generateId, getBridge, getStore, initialize, isErrorResponse, isJsonRpcMessage, isNotification, isRequest, isResponse, log, logDebug, logError, logInfo, logWarning, notifySizeChanged, onTeardown, openLink, readResource, requestDisplayMode, sendMessage, setupAutoSizeReporting, updateModelContext, useAvailableDisplayModes, useContainerDimensions, useDeviceCapabilities, useDisplayMode, useHostCapabilities, useHostContext, useIsInitialized, useLocale, useMcpStore, usePlatform, useSafeArea, useStyles, useTheme, useTimezone, useToolInfo, useToolInput, useToolResult } from '../chunk-YGGRUIUG.js';
|
|
2
|
+
import '../chunk-PZ5AY32C.js';
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { l as UnifiedAdaptor, c as CallToolResult, D as DisplayMode, F as Feature, f as ResourceReadResult, U as UpdateModelContextParams, L as LogLevel, j as TeardownHandler } from './adaptor-interface-BYbH9PpT.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Adaptor Factory
|
|
5
|
+
*
|
|
6
|
+
* Creates and caches the appropriate adaptor based on detected platform.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Get the adaptor for the current platform
|
|
11
|
+
*
|
|
12
|
+
* Automatically detects the platform and returns the appropriate adaptor.
|
|
13
|
+
* The adaptor is cached for the lifetime of the application.
|
|
14
|
+
*/
|
|
15
|
+
declare function getAdaptor(): UnifiedAdaptor;
|
|
16
|
+
/**
|
|
17
|
+
* Reset the adaptor cache (for testing)
|
|
18
|
+
*/
|
|
19
|
+
declare function resetAdaptor(): void;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Send a follow-up message to the conversation (Tier 0 Semantic API)
|
|
23
|
+
*
|
|
24
|
+
* This is a semantic wrapper around `sendFollowUpMessage` that provides
|
|
25
|
+
* a more intuitive API for common use cases.
|
|
26
|
+
*
|
|
27
|
+
* When running outside a chat host (e.g., standalone browser testing),
|
|
28
|
+
* the message is logged to the console instead.
|
|
29
|
+
*
|
|
30
|
+
* @param message - The message to send to the conversation
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* import { say } from '@pancake-apps/web';
|
|
35
|
+
*
|
|
36
|
+
* // Send a simple message
|
|
37
|
+
* say('Task completed successfully!');
|
|
38
|
+
*
|
|
39
|
+
* // Send a formatted message
|
|
40
|
+
* say(`Found ${count} results for "${query}"`);
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
declare function say(message: string): void;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Navigate to another view/tool (Tier 0 Semantic API)
|
|
47
|
+
*
|
|
48
|
+
* This is a semantic wrapper around `callTool` that discards the result,
|
|
49
|
+
* intended for navigation scenarios where you just want to switch views.
|
|
50
|
+
*
|
|
51
|
+
* @param viewName - The name of the view/tool to navigate to
|
|
52
|
+
* @param params - Optional parameters to pass to the view
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* import { navigateToView } from '@pancake-apps/web';
|
|
57
|
+
*
|
|
58
|
+
* // Navigate to a view with no parameters
|
|
59
|
+
* await navigateToView('settings');
|
|
60
|
+
*
|
|
61
|
+
* // Navigate with parameters
|
|
62
|
+
* await navigateToView('user-profile', { userId: '123' });
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
declare function navigateToView<TInput = Record<string, unknown>>(viewName: string, params?: TInput): Promise<void>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Execute an action tool (fire-and-forget) (Tier 0 Semantic API)
|
|
69
|
+
*
|
|
70
|
+
* Actions are side-effect tools that mutate state. The result is discarded
|
|
71
|
+
* since actions are meant for fire-and-forget operations.
|
|
72
|
+
*
|
|
73
|
+
* Use for: save, delete, update, navigate, send, submit
|
|
74
|
+
*
|
|
75
|
+
* @param toolName - Name of the action tool to execute
|
|
76
|
+
* @param input - Optional input parameters for the action
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```tsx
|
|
80
|
+
* import { action } from '@pancake-apps/web';
|
|
81
|
+
*
|
|
82
|
+
* // Delete an item
|
|
83
|
+
* await action('delete-item', { id: '123' });
|
|
84
|
+
*
|
|
85
|
+
* // Submit a form
|
|
86
|
+
* await action('submit-form', { name: 'John', email: 'john@example.com' });
|
|
87
|
+
*
|
|
88
|
+
* // Navigate (alternative to navigateToView)
|
|
89
|
+
* await action('open-settings');
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
declare function action<TInput = void>(toolName: string, input?: TInput): Promise<void>;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Fetch data from a tool (query) (Tier 0 Semantic API)
|
|
96
|
+
*
|
|
97
|
+
* Data tools are read-only queries that return structured data.
|
|
98
|
+
* The result is extracted from structuredContent or parsed from text content.
|
|
99
|
+
*
|
|
100
|
+
* Use for: search, get, list, fetch
|
|
101
|
+
*
|
|
102
|
+
* @param toolName - Name of the data tool to call
|
|
103
|
+
* @param input - Optional input parameters for the query
|
|
104
|
+
* @returns The extracted data from the tool result
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```tsx
|
|
108
|
+
* import { data } from '@pancake-apps/web';
|
|
109
|
+
*
|
|
110
|
+
* // Search for items
|
|
111
|
+
* const results = await data<{ q: string }, SearchResult[]>('search', { q: 'pancakes' });
|
|
112
|
+
*
|
|
113
|
+
* // Get a single item
|
|
114
|
+
* const user = await data<{ id: string }, User>('get-user', { id: '123' });
|
|
115
|
+
*
|
|
116
|
+
* // List all items
|
|
117
|
+
* const items = await data<void, Item[]>('list-items');
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
declare function data<TInput = void, TOutput = unknown>(toolName: string, input?: TInput): Promise<TOutput>;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Call a tool by name with input parameters
|
|
124
|
+
*
|
|
125
|
+
* @param toolName - Name of the tool to call
|
|
126
|
+
* @param input - Input parameters for the tool
|
|
127
|
+
* @returns Promise resolving to the tool result
|
|
128
|
+
*/
|
|
129
|
+
declare function callTool<TInput = unknown, TOutput = unknown>(toolName: string, input: TInput): Promise<CallToolResult<TOutput>>;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Send a follow-up message to the conversation
|
|
133
|
+
*
|
|
134
|
+
* @param message - Message text to send
|
|
135
|
+
*/
|
|
136
|
+
declare function sendFollowUpMessage(message: string): Promise<void>;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Open an external URL
|
|
140
|
+
*
|
|
141
|
+
* @param url - URL to open
|
|
142
|
+
*/
|
|
143
|
+
declare function openExternal(url: string): Promise<void>;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Request a specific display mode
|
|
147
|
+
*
|
|
148
|
+
* @param mode - Display mode to request
|
|
149
|
+
*/
|
|
150
|
+
declare function requestDisplayMode(mode: DisplayMode): Promise<void>;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Check if a feature is supported on the current platform
|
|
154
|
+
*
|
|
155
|
+
* @param feature - Feature to check
|
|
156
|
+
* @returns True if the feature is supported
|
|
157
|
+
*/
|
|
158
|
+
declare function isSupported(feature: Feature): boolean;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Read a resource from the MCP server
|
|
162
|
+
*
|
|
163
|
+
* @param uri - Resource URI to read
|
|
164
|
+
* @returns Promise resolving to resource contents
|
|
165
|
+
* @throws Error if not supported on current platform
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```tsx
|
|
169
|
+
* const result = await readResource('file:///path/to/resource');
|
|
170
|
+
* console.log(result.contents);
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
173
|
+
declare function readResource(uri: string): Promise<ResourceReadResult>;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Update the model context with new content
|
|
177
|
+
*
|
|
178
|
+
* @param params - Context update parameters
|
|
179
|
+
* @throws Error if not supported on current platform
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```tsx
|
|
183
|
+
* await updateModelContext({
|
|
184
|
+
* structuredContent: { selectedItems: [1, 2, 3] }
|
|
185
|
+
* });
|
|
186
|
+
* ```
|
|
187
|
+
*/
|
|
188
|
+
declare function updateModelContext(params: UpdateModelContextParams): Promise<void>;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Log a message to the host environment
|
|
192
|
+
*
|
|
193
|
+
* On MCP Apps: Sends log message to host via JSON-RPC notification
|
|
194
|
+
* On Apps SDK: Falls back to console.log/warn/error/debug
|
|
195
|
+
*
|
|
196
|
+
* @param level - Log level
|
|
197
|
+
* @param data - Data to log
|
|
198
|
+
* @param logger - Optional logger name
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```tsx
|
|
202
|
+
* log('info', { action: 'button_clicked', buttonId: 'submit' });
|
|
203
|
+
* logError({ code: 'VALIDATION_FAILED', field: 'email' });
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
declare function log(level: LogLevel, data: unknown, logger?: string): void;
|
|
207
|
+
declare const logDebug: (data: unknown, logger?: string) => void;
|
|
208
|
+
declare const logInfo: (data: unknown, logger?: string) => void;
|
|
209
|
+
declare const logWarning: (data: unknown, logger?: string) => void;
|
|
210
|
+
declare const logError: (data: unknown, logger?: string) => void;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Ping the host to verify connection
|
|
214
|
+
*
|
|
215
|
+
* @returns Promise that resolves when host responds
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* ```tsx
|
|
219
|
+
* await ping();
|
|
220
|
+
* console.log('Host is responsive');
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
223
|
+
declare function ping(): Promise<void>;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Register a handler for when the resource is being torn down
|
|
227
|
+
*
|
|
228
|
+
* @param handler - Function to call on teardown
|
|
229
|
+
* @returns Cleanup function to unregister the handler
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* ```tsx
|
|
233
|
+
* useEffect(() => {
|
|
234
|
+
* return onTeardown(async ({ reason }) => {
|
|
235
|
+
* await saveState();
|
|
236
|
+
* console.log('Tearing down:', reason);
|
|
237
|
+
* });
|
|
238
|
+
* }, []);
|
|
239
|
+
* ```
|
|
240
|
+
*/
|
|
241
|
+
declare function onTeardown(handler: TeardownHandler): () => void;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Notify the host that the content size has changed
|
|
245
|
+
*
|
|
246
|
+
* @param width - New width in pixels
|
|
247
|
+
* @param height - New height in pixels
|
|
248
|
+
*
|
|
249
|
+
* @example
|
|
250
|
+
* ```tsx
|
|
251
|
+
* notifySizeChanged(400, 300);
|
|
252
|
+
* ```
|
|
253
|
+
*/
|
|
254
|
+
declare function notifySizeChanged(width: number, height: number): void;
|
|
255
|
+
/**
|
|
256
|
+
* Set up automatic size reporting using ResizeObserver
|
|
257
|
+
*
|
|
258
|
+
* @param element - Element to observe (defaults to document.documentElement)
|
|
259
|
+
* @returns Cleanup function to stop observing
|
|
260
|
+
*
|
|
261
|
+
* @example
|
|
262
|
+
* ```tsx
|
|
263
|
+
* useEffect(() => {
|
|
264
|
+
* return setupAutoSizeReporting(containerRef.current);
|
|
265
|
+
* }, []);
|
|
266
|
+
* ```
|
|
267
|
+
*/
|
|
268
|
+
declare function setupAutoSizeReporting(element?: HTMLElement): () => void;
|
|
269
|
+
|
|
270
|
+
export { say as a, action as b, callTool as c, data as d, readResource as e, logDebug as f, logInfo as g, logWarning as h, isSupported as i, logError as j, onTeardown as k, log as l, notifySizeChanged as m, navigateToView as n, openExternal as o, ping as p, setupAutoSizeReporting as q, requestDisplayMode as r, sendFollowUpMessage as s, getAdaptor as t, updateModelContext as u, resetAdaptor as v };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { U as UseHostStylesOptions, a as UseViewOptions, b as UseViewResult, u as useDocumentTheme, f as useDocumentThemeState, g as useHostFontsHook, h as useHostStyles, i as useHostTheme, j as useHostVariables, k as useSystemColorScheme, l as useView } from '../index-CpXDfXKD.js';
|
|
2
|
+
import '../adaptor-interface-BYbH9PpT.js';
|
|
3
|
+
import '../types-B_O3kZYh.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { useDocumentTheme, useDocumentThemeState, useHostFontsHook, useHostStyles, useHostTheme, useHostVariables, useSystemColorScheme, useView } from '../chunk-TLBYYZHP.js';
|
|
2
|
+
import '../chunk-ZYBPDIEG.js';
|
|
3
|
+
import '../chunk-5NYJ2IVD.js';
|
|
4
|
+
import '../chunk-YGGRUIUG.js';
|
|
5
|
+
import '../chunk-PZ5AY32C.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|