export type Provider = 'anthropic' | 'openai' | 'google' | 'bedrock' | 'webllm' | 'openrouter' | 'groq' | 'mistral' | 'deepseek' | 'cohere' | 'perplexity' | 'xai' export interface Settings { provider: Provider model: string apiKey: string /** Shared inference config — applied via VercelModel call options */ maxTokens?: number temperature?: number topP?: number stopSequences?: string[] /** Custom HTTP headers sent with every request (applies to all providers) */ extraHeaders?: Record systemPrompt?: string userName?: string theme?: 'dark' | 'light' fontSize?: number debounceMs?: number /** 0 disables debounce entirely (truly concurrent manual sends) */ autoSend?: boolean onboarded?: boolean // Bedrock-specific bedrockRegion?: string bedrockAdditionalRequestFields?: Record // Tool credentials githubToken?: string telegramBotToken?: string telegramChatId?: string spotifyAccessToken?: string spotifyClientId?: string googleMapsApiKey?: string googleClientId?: string googleAccessToken?: string openaiApiKey?: string // Feature flags enableVision?: boolean enableMesh?: boolean enableMemory?: boolean enableTools?: boolean enableAmbient?: boolean /** Enable on-device WebLLM inference (downloads ~500MB model on first use). */ enableWebLLM?: boolean autonomousAmbient?: boolean ambientIdleMs?: number /** Auto-submit input after user stops typing for N ms (0 = disabled) */ autoSubmitIdleMs?: number /** Minimum characters required before auto-submit fires */ autoSubmitMinChars?: number // ── Telegram poller ──────────────────────────────────────────── /** Poll Telegram getUpdates and inject messages into the agent. */ telegramPollEnabled?: boolean /** Long-poll timeout in seconds (10-50, default 30). Telegram limit is 50. */ telegramPollLongPollSec?: number /** Gap between polls in seconds (default 1). */ telegramPollIntervalSec?: number /** Comma-separated whitelist of chat IDs / @usernames. Empty = all allowed. */ telegramAllowedChats?: string /** After the agent answers, send the reply back to the originating chat. */ telegramAutoRespond?: boolean /** Font family (sans/serif/mono) */ fontFamily?: 'sans' | 'serif' | 'mono' /** Background: gradient / map / solid / animated */ background?: 'gradient' | 'map' | 'solid' | 'animated' | 'grid' /** Auto-speak assistant replies (TTS) */ autoSpeak?: boolean /** Bubble variant */ bubbleVariant?: 'compact' | 'cozy' | 'spacious' /** Per-tool enable map. Missing keys = enabled. Used by buildTools. */ disabledTools?: string[] } export type AgentStatus = 'idle' | 'ready' | 'thinking' | 'streaming' | 'error' export interface ToolCallInfo { id: string toolUseId: string name: string input: any status: 'running' | 'success' | 'error' result?: string startedAt: number endedAt?: number } export interface RenderedUIPanel { id: string title: string html: string css?: string js?: string createdAt: number } export interface DisplayMessage { id: string role: 'user' | 'assistant' | 'system' text: string streaming?: boolean timestamp?: number /** Assistant: tool calls that occurred during this turn */ toolCalls?: ToolCallInfo[] /** Assistant: UI panels rendered inline during this turn */ uiPanels?: RenderedUIPanel[] /** User: attached files/images shown inline */ attachments?: Attachment[] } export interface Attachment { type: 'image' | 'file' | 'document' dataUrl?: string base64?: string /** For 'image': 'jpeg'|'png'|'gif'|'webp'. For 'document': 'pdf'|'csv'|'doc'|'docx'|'xls'|'xlsx'|'html'|'txt'|'md'|'json'|'xml' */ format?: string name?: string size?: number /** For text-ish files: the extracted text content */ text?: string /** MIME type */ mime?: string } export interface Metrics { input: number output: number }