import { CompositionStore } from "./compositionStore.js"; import { AssetStore } from "./assetStore.js"; import { IncomingMessage, ServerResponse } from "node:http"; import { NextFunction } from "connect"; //#region src/ai-editor/http.d.ts interface EditorContext { snapshotId: string; timeMs: number; selectedIds: string[]; } type BrowserCommand = { type: "capture-frame"; timeMs: number; revisionId: string; } | { type: "export-video"; revisionId: string; }; interface AiEditorRuntime { composition: CompositionStore; assets: AssetStore; projectRoot: string; opencodeUrl: string | null; opencodeError?: string; publish(event: unknown): void; subscribe(listener: (event: unknown) => void): () => void; getContext(): EditorContext | null; setContext(context: EditorContext): Promise; requestBrowser(command: BrowserCommand, options?: { timeoutMs?: number; }): Promise; resolveBrowser(requestId: string, result?: unknown, error?: string): void; dispose(): void; } declare function createAiEditorRuntime(options: { root: string; projectRoot?: string; opencodeUrl?: string | null; opencodeError?: string; browserTimeoutMs?: number; }): AiEditorRuntime; declare function assertLocalRequest(req: IncomingMessage): void; /** * Vite's HTML fallback would otherwise 200 the app shell for * `/.ef-session/media/*`. Serve the real bytes from the composition root. */ declare function createSessionMediaMiddleware(root: string): (req: IncomingMessage, res: ServerResponse, next: NextFunction) => Promise; /** * Local AI editor HTTP surface on the Vite origin. * * GET /@ef/ai/composition * PUT /@ef/ai/composition { html } * PATCH /@ef/ai/composition { snapshot_id, old_string, new_string } * GET /@ef/ai/events text/event-stream * GET /@ef/ai/status * GET /@ef/ai/assets * POST /@ef/ai/assets raw body; ?filename=&kind= * POST /@ef/ai/assets/:id/append * POST /@ef/ai/assets/:id/attach * GET /@ef/ai/media/:id */ declare function createAiEditorMiddleware(runtime: AiEditorRuntime): (req: IncomingMessage, res: ServerResponse, next: NextFunction) => Promise; //#endregion export { AiEditorRuntime, BrowserCommand, EditorContext, assertLocalRequest, createAiEditorMiddleware, createAiEditorRuntime, createSessionMediaMiddleware }; //# sourceMappingURL=http.d.ts.map