export type VideoJobStatus = 'queued' | 'in_progress' | 'completed' | 'failed'; export interface VideoJobError { code: string; message: string; } /** * OpenAI-shaped video resource. Returned verbatim by `POST /v1/videos`, * `GET /v1/videos`, and `GET /v1/videos/{id}`; matches the `videoResource` * Zod schema. The store keeps records in this shape so no field-renaming * happens between persistence and the wire. */ export interface VideoResource { id: string; object: 'video'; model: string; status: VideoJobStatus; progress: number; created_at: number; completed_at: number | null; expires_at: number; prompt: string | null; size: string; seconds: string; remixed_from_video_id: null; error: VideoJobError | null; } /** * Internal job record: the OpenAI resource fields plus server-side state. * Extra fields are stripped from any HTTP response by `videoJobResource()`. */ export interface VideoJob extends VideoResource { /** SDK requestId for `cancel(...)`. Set by `runVideoJob` once `video()` returns; null in the (tiny) window between job creation and that call. */ requestId: string | null; /** Ephemeral file id holding the AVI bytes (set when `status === 'completed'`). */ aviFileId: string | null; /** Ephemeral file id holding the lazily-transcoded MP4 (set on first MP4 fetch). */ mp4FileId: string | null; /** Aborts the in-flight generation when DELETE is called during `in_progress`. */ controller: AbortController; } /** Strip server-only fields and return the OpenAI-shaped resource view. */ export declare function videoJobResource(job: VideoJob): VideoResource; export type VideoEvictReason = 'max_entries'; export interface VideoJobsStoreOptions { /** Hard cap on stored entries. Oldest evicted first. */ maxEntries?: number; now?: () => number; /** Fired when `create()` evicts an older job to stay within `maxEntries`. The route layer hooks this to abort the SDK call and drop the rendered bytes. */ onEvict?: (job: VideoJob, reason: VideoEvictReason) => void; } export interface ListVideoJobsOptions { limit?: number; order?: 'asc' | 'desc'; after?: string | undefined; } export interface VideoJobsStore { create: (input: { model: string; prompt: string | null; size: string; seconds: string; }) => VideoJob; update: (id: string, patch: Partial>) => VideoJob | undefined; get: (id: string) => VideoJob | undefined; delete: (id: string) => boolean; list: (opts?: ListVideoJobsOptions) => { data: VideoJob[]; first_id: string | null; last_id: string | null; has_more: boolean; }; size: () => number; bannerLine: () => string; } export declare function createVideoJobsStore(options?: VideoJobsStoreOptions): VideoJobsStore; //# sourceMappingURL=video-jobs-store.d.ts.map