import { CommandReceipt, CompositionSnapshot, DemoRun } from "./contracts.js"; import { CompositionStore } from "./compositionStore.js"; //#region src/ai-editor/demo.d.ts type TaskRequest = { snapshotId: string; intent: string; facts: unknown[]; reviewTimeMs: number; } & ({ scope?: "headline"; targetElementId: string; maxCharacters: number; } | { scope: "source-project"; targetElementId?: never; maxCharacters?: never; }); interface DemoTaskChange { taskId: string; runId: string; status: "committed" | "unchanged" | "rejected"; } declare function createDemoPolicy(store: CompositionStore, bootstrapToken: string, onInvalidate?: () => void, onTaskChange?: (change: DemoTaskChange) => void, onAuthorityChange?: () => void): { bootstrap(token: string): `${string}-${string}-${string}-${string}-${string}`; authorize(cookie: string | undefined): void; owner(id: string, takeover?: boolean, resume?: boolean): { ownerId: string; }; assertOwner(id: string | undefined): void; connect(id: string, onRetire?: () => void): () => void; getOwner(): string; revoke: () => void; state(): Promise<{ run: DemoRun | undefined; ownerId: string | undefined; connected: boolean; tasks: ({ status: string; snapshotId: string; intent: string; facts: unknown[]; reviewTimeMs: number; scope?: "headline"; targetElementId: string; maxCharacters: number; taskId: string; runId: string; expiresAt: string; resultSnapshotId?: string; revoked?: boolean; receipt?: CommandReceipt; lastError?: string; } | { status: string; snapshotId: string; intent: string; facts: unknown[]; reviewTimeMs: number; scope: "source-project"; targetElementId?: never; maxCharacters?: never; taskId: string; runId: string; expiresAt: string; resultSnapshotId?: string; revoked?: boolean; receipt?: CommandReceipt; lastError?: string; })[]; }>; reset(input: { html: string; snapshotId: string; operationId: string; recordId: string; recordVersion: string; templateVersion: string; }, authorize?: () => void): Promise; recover(input: { revisionId: string; snapshotId: string; operationId: string; }, authorize?: () => void): Promise; issue(input: TaskRequest, authorize?: () => void): Promise<{ snapshotId: string; intent: string; facts: unknown[]; reviewTimeMs: number; scope?: "headline"; targetElementId: string; maxCharacters: number; taskId: string; runId: string; expiresAt: string; credential: string; resultSnapshotId?: string; revoked?: boolean; receipt?: CommandReceipt; lastError?: string; } | { snapshotId: string; intent: string; facts: unknown[]; reviewTimeMs: number; scope: "source-project"; targetElementId?: never; maxCharacters?: never; taskId: string; runId: string; expiresAt: string; credential: string; resultSnapshotId?: string; revoked?: boolean; receipt?: CommandReceipt; lastError?: string; }>; context(credential: string): Promise<{ editing: { kind: string; readTool: string; writeTool: string; }; task: { snapshotId: string; intent: string; facts: unknown[]; reviewTimeMs: number; scope?: "headline"; targetElementId: string; maxCharacters: number; taskId: string; runId: string; expiresAt: string; resultSnapshotId?: string; revoked?: boolean; receipt?: CommandReceipt; lastError?: string; } | { snapshotId: string; intent: string; facts: unknown[]; reviewTimeMs: number; scope: "source-project"; targetElementId?: never; maxCharacters?: never; taskId: string; runId: string; expiresAt: string; resultSnapshotId?: string; revoked?: boolean; receipt?: CommandReceipt; lastError?: string; }; composition: CompositionSnapshot; } | { headline: string; task: { snapshotId: string; intent: string; facts: unknown[]; reviewTimeMs: number; scope?: "headline"; targetElementId: string; maxCharacters: number; taskId: string; runId: string; expiresAt: string; resultSnapshotId?: string; revoked?: boolean; receipt?: CommandReceipt; lastError?: string; } | { snapshotId: string; intent: string; facts: unknown[]; reviewTimeMs: number; scope: "source-project"; targetElementId?: never; maxCharacters?: never; taskId: string; runId: string; expiresAt: string; resultSnapshotId?: string; revoked?: boolean; receipt?: CommandReceipt; lastError?: string; }; composition: CompositionSnapshot; }>; assertTask(credential: string, snapshotId: string): Promise; authorizeTask(credential: string, snapshotId: string, scope: "source-project"): Promise<{ task: { snapshotId: string; intent: string; facts: unknown[]; reviewTimeMs: number; scope: "source-project"; targetElementId?: never; maxCharacters?: never; taskId: string; runId: string; expiresAt: string; credential: string; resultSnapshotId?: string; revoked?: boolean; receipt?: CommandReceipt; lastError?: string; }; authorize: () => void; complete(receipt: CommandReceipt): void; }>; headline(credential: string, operationId: string, text: string): Promise; }; type DemoPolicy = ReturnType; //#endregion export { DemoPolicy }; //# sourceMappingURL=demo.d.ts.map