import { ChatStatus } from 'ai'; import { PptxAiBridge, PptxAiChatSession, PptxAiConfig, PptxAiUIMessage, ProposalView, ToolCanvasTarget } from 'pptx-viewer-shared/ai'; /** Lifecycle of the AI session bootstrap. */ export type AiChatInitState = 'checking' | 'unavailable' | 'ready' | 'error'; /** Inputs + injectable seams (tests replace the async builders). */ export interface SvelteAiChatDeps { bridge: PptxAiBridge; config: PptxAiConfig; /** Availability probe; defaults to {@link isAiAvailable}. */ checkAvailable?: () => Promise; /** Session builder; defaults to {@link createAiChatSession}. */ createSession?: (bridge: PptxAiBridge, config: PptxAiConfig) => Promise; /** * Called as each tool call starts, with the slide / element(s) it references * (or `null` for deck-wide tools). Lets the panel navigate + highlight the * canvas so the viewer mirrors what the assistant is doing in real time. */ onToolTarget?: (target: ToolCanvasTarget | null) => void; } export declare class SvelteAiChat { #private; initState: AiChatInitState; initError: Error | undefined; /** Mirror of the session's staged proposals (refreshed imperatively). */ proposals: ProposalView[]; constructor(deps: SvelteAiChatDeps); get messages(): PptxAiUIMessage[]; get status(): ChatStatus; get error(): Error | undefined; get isStreaming(): boolean; /** The live session, exposed for tests that stage a proposal directly. */ get session(): PptxAiChatSession | undefined; /** Bootstrap the session + chat. Safe to call once (from the panel `$effect`). */ init(): Promise; send(text: string): void; stop(): void; /** Replace the whole transcript (chat-history resume / new chat). */ setMessages(messages: PptxAiUIMessage[]): void; clearError(): void; refreshProposals(): void; applyProposal(id: string): void; rejectProposal(id: string): void; acceptAllProposals(): void; } //# sourceMappingURL=chat.svelte.d.ts.map