import { IncomingMessage, ServerResponse } from "node:http"; //#region src/ai-editor/chat.d.ts interface ChatMessage { id: string; role: "user" | "assistant"; text: string; } interface ChatContext { snapshotId: string; timeMs: number; selectedIds: string[]; } interface ChatInput { message: string; context: ChatContext; intent?: string; } interface ChatState { version: number; messages: ChatMessage[]; busy: boolean; available: boolean; intent: string; progress?: string; error?: string; } interface ChatProvider { available: boolean; error?: string; run(input: ChatInput & { messages: ChatMessage[]; signal: AbortSignal; onProgress(text: string): void; }): Promise; cancel?(): Promise; dispose?(): void | Promise; } declare function createChatRuntime(options: { root: string; composition: { read(): Promise<{ snapshotId: string; }>; }; publish(event: ChatState & { type: "chat"; }): void; provider?: ChatProvider; }): Promise<{ state: () => ChatState; send: (input: ChatInput) => Promise; setIntent: (value: string) => Promise; cancel: () => Promise; dispose(): Promise; }>; type ChatRuntime = Awaited>; declare function createChatMiddleware(runtime: ChatRuntime): (req: IncomingMessage, res: ServerResponse, next: (error?: unknown) => void) => Promise; //#endregion export { ChatProvider, ChatRuntime, createChatMiddleware, createChatRuntime }; //# sourceMappingURL=chat.d.ts.map