import { type I18nSnapshot } from '@happyvertical/smrt-ui/i18n';
import { type RegisterWebMcpToolsOptions, type SmrtWebClient, type SmrtWebCollectionDefinition } from '@happyvertical/smrt-web';
import type { Snippet } from 'svelte';
import type { AIConfig, AILoadingState, AppMode, SocketConfig, User } from './state/app-state.js';
export interface WebMcpProviderConfig {
definitions?: SmrtWebCollectionDefinition[];
client?: SmrtWebClient;
basePath?: string;
fetchFn?: typeof fetch;
scope?: string;
filter?: RegisterWebMcpToolsOptions['filter'];
}
interface Props {
/**
* Initial mode: 'default' | 'smrt'
* If not provided, mode is auto-detected based on capabilities
*/
mode?: AppMode;
/**
* Whether to auto-enable smrt mode when capabilities are available
* @default true
*/
autoEnableSmrt?: boolean;
/**
* User object from smrt-users (from your load function)
* Pass null when not authenticated
*/
user?: User | null;
/**
* Resolved permissions (from PermissionResolver in your load function)
*/
permissions?: string[];
/**
* WebSocket configuration
* If provided, connects on mount and disconnects on unmount
*/
socket?: SocketConfig;
/**
* AI configuration for preloading and warm clients
*
* @example
* ```svelte
*
* ...
*
* ```
*/
ai?: AIConfig;
/**
* Callback when capabilities are detected
*/
onReady?: () => void;
/**
* Callback when mode changes
*/
onModeChange?: (mode: AppMode) => void;
/**
* Callback when AI loading state changes
*/
onAILoadingChange?: (state: AILoadingState) => void;
/**
* i18n snapshot from your load function (`buildI18nSnapshot` on
* `@happyvertical/smrt-svelte/i18n/server`). Provides the active locale +
* resolved message templates to `useI18n()` / ``. Omit for
* English-default-only rendering.
*/
i18n?: I18nSnapshot;
/**
* Opt in to the generated collection tools for this browser surface.
* WebMCP is feature-detected by smrt-web, so this is safe during SSR and on
* browsers that do not expose `document.modelContext`.
*/
webmcp?: boolean | WebMcpProviderConfig;
/**
* Children to render
*/
children: Snippet;
}
declare const Provider: import("svelte").Component;
type Provider = ReturnType;
export default Provider;
//# sourceMappingURL=Provider.svelte.d.ts.map