import { PptxAiBridge } from 'pptx-viewer-shared/ai'; import { AiPanelController, AiCanvasHighlight } from '../ai/ai-panel-controller.svelte'; import { CollaborationController } from '../collab'; import { EditorState } from '../editor/editor-state.svelte'; import { CreateViewerStateOptions } from './create-viewer-state-types'; import { PresentationLoader } from './presentation-loader.svelte'; import { ViewerState } from './viewer-state.svelte'; export interface AiClusterDeps { loader: PresentationLoader; viewer: ViewerState; editor: EditorState; collab: CollaborationController; options: CreateViewerStateOptions; /** Flip the viewer's `editable` flag: an AI write implies editing. */ setEditable(editable: boolean): void; } export interface AiCluster { /** The SDK-free bridge handed to the (lazily imported) chat panel. */ readonly bridge: PptxAiBridge; /** On-canvas scope: focus targets, pick mode, live tool-focus highlights. */ readonly panel: AiPanelController; /** Whether the right-side chat panel is open (ribbon Sparkles toggle). */ panelOpen: boolean; /** Element rings to draw on the active slide; empty when AI is disabled. */ readonly canvasHighlights: readonly AiCanvasHighlight[]; } /** * AI assistant wiring: the editor/deck bridge, the on-canvas focus controller, * and the panel's open flag. Split out of `createViewerState` to keep that file * under the repo's file-size budget. * * The bridge is built eagerly (it has no `ai`-SDK dependency, by design), but * the panel component and the `@ai-sdk/svelte` + `ai` peers it pulls are only * imported when the panel first opens. Every AI write funnels through * `editor.commitSlides` so one proposal is ONE undoable history entry, exactly * like a manual edit. * * Named `use*`, not `build*`: it registers a teardown `$effect` for the panel * controller, so it must be called during component initialization. */ export declare function useAiCluster(deps: AiClusterDeps): AiCluster; //# sourceMappingURL=create-viewer-state-ai.svelte.d.ts.map