import { SourceProject, SourceProjectEdit, SourceProjectRef, SourceProjectStore } from "./sourceProjects.js"; import { CommandReceipt, CompositionSnapshot, DemoRun } from "./contracts.js"; import { Workspace, WorkspaceActivity, WorkspaceSession, WorkspaceTurn } from "./workspace.js"; import { MediaCatalog } from "./mediaCatalog.js"; import { CompositionStore } from "./compositionStore.js"; //#region src/ai-editor/demoChat.d.ts interface DemoEditPlan { message: string; edits: Array<{ old_string: string; new_string: string; }>; reviewTimeMs: number; assetIds?: string[]; sourceEdits?: SourceProjectEdit[]; } interface DemoChatMessage { role: "user" | "assistant"; text: string; } interface DemoChatProvider { name: string; available: boolean; error?: string; run(input: { message: string; messages: DemoChatMessage[]; recordId: string; html: string; sourceProject?: SourceProject; signal: AbortSignal; recordActivity?(activity: WorkspaceActivity): Promise; }): Promise; } interface DemoChatInput { snapshotId: string; operationId: string; message: string; messages: DemoChatMessage[]; recordId: string; } /** Host-built sequences get a bounded document replacement; model JSON cannot grant itself this allowance. */ declare function createCompositionReplacementPlan(input: { message: string; beforeHtml: string; afterHtml: string; reviewTimeMs: number; assetIds?: string[]; }): DemoEditPlan; declare function validateEditPlan(value: unknown): DemoEditPlan; declare function createDemoChatRuntime(options: { composition: CompositionStore; provider?: DemoChatProvider; catalog?: MediaCatalog; }): { status: () => { error?: string | undefined; name: string; available: boolean; }; send(input: DemoChatInput, authorize: () => void, signal?: AbortSignal): Promise<{ snapshot: CompositionSnapshot; message: string; reviewTimeMs: number; changed: boolean; }>; stop(): Promise; }; type DemoChatRuntime = ReturnType; interface WorkspaceChatInput { sessionId: string; operationId: string; snapshotId: string; message: string; } /** Hosts supply execution; durable turns and verified edits remain workspace data. */ declare function createWorkspaceChatRuntime(options: { workspace: Workspace; sourceProjects?: { store: SourceProjectStore; validate(id: string): Promise; }; provider?: DemoChatProvider; catalog?: MediaCatalog; onActivity?(sessionId: string, turnId: string, activity: WorkspaceActivity): void; onSnapshot?(sessionId: string, snapshot: CompositionSnapshot): void; }): { status: () => { error?: string | undefined; name: string; available: boolean; }; send(input: WorkspaceChatInput, authorize: () => void, signal?: AbortSignal): Promise<{ session: WorkspaceSession; turns: WorkspaceTurn[]; snapshot: { compositionId: string; sequence: number; html: string; sourceProject?: SourceProjectRef; snapshotId: string; path: string; label: string; createdAt: string; undoTargetId?: string; run?: DemoRun; command?: CommandReceipt; }; message: string; reviewTimeMs: number; changed: boolean; operationId: string; resultSnapshotId: string; }>; stop(): Promise; }; type WorkspaceChatRuntime = ReturnType; //#endregion export { DemoChatInput, DemoChatProvider, DemoChatRuntime, DemoEditPlan, WorkspaceChatRuntime, createCompositionReplacementPlan, validateEditPlan }; //# sourceMappingURL=demoChat.d.ts.map