import { type ReapiSeedancePath } from './execution-adapter.js'; import { type ReapiTransportTarget } from './providers/reapi-seedance.js'; import type { VideoExecutionCancelResult, VideoExecutionPayload, VideoExecutionPollResult } from './types.js'; interface FetchLikeResponse { ok: boolean; status: number; text(): Promise; json(): Promise; arrayBuffer(): Promise; headers?: { get(name: string): string | null; }; } export type ReapiNativeFetchLike = (input: string, init?: { method?: string; headers?: Record; body?: string | Uint8Array; }) => Promise; /** Hosts one local file and returns the public URL the provider will fetch. */ export type ReapiHostImpl = (input: { path: string; bytes: Buffer; contentType: string; }) => Promise<{ url: string; expiresAt: string | null; }>; export interface ReapiNativeOptions { env?: NodeJS.ProcessEnv; fetchImpl?: ReapiNativeFetchLike; /** Overrides the path's default host (treg /media or Go Bananas R2). */ hostImpl?: ReapiHostImpl; /** Overrides ffprobe for reference-length checks; returns milliseconds. */ probeDurationMs?: (path: string) => Promise; /** * Overrides ffmpeg for pulling the audio track out of a black-frame voice * video (`task.voiceReferencePaths`), so the voice rides `audio_urls` (free) * rather than `video_urls` (billed). Writes a wav to `outWavPath`. */ extractAudioImpl?: (videoPath: string, outWavPath: string) => Promise; now?: () => Date; } declare function loadWorkspaceEnv(workspaceRoot: string, env: NodeJS.ProcessEnv): Promise; /** The workspace `.env.local` layered UNDER the process env — shared with the quote adapter. */ export declare const loadReapiWorkspaceEnv: typeof loadWorkspaceEnv; export interface ResolvedReapiTarget { via: ReapiSeedancePath; target: ReapiTransportTarget; } /** * The credential path the environment names, and the auth it carries. Throws * when the selector names no path (the `blocked` transport) or the path's key * is missing — naming exactly what to set, never guessing from the other key. * * `submittedVia` is the path recorded in a job's saved state. A submit always * needs the selector; a poll of a job that already exists does not — refusing * it would strand a paid task (the same rule `resolveAdapterCommand` keeps for * poll/cancel/lookup). So with the selector unset the saved path is used, and * with it set to the OTHER path the poll is refused rather than answered 403. */ export declare function resolveReapiTarget(env: NodeJS.ProcessEnv, submittedVia?: ReapiSeedancePath): ResolvedReapiTarget; export declare function classifyReapiReferences(referencePaths: string[]): { images: string[]; videos: string[]; audios: string[]; }; export declare function submitReapiSeedanceNative(payload: VideoExecutionPayload, options?: ReapiNativeOptions): Promise<{ externalJobId: string; rawResult: unknown; }>; export declare function pollReapiSeedanceNative(input: { outputDir: string; externalJobId: string; workspaceRoot: string; }, options?: ReapiNativeOptions): Promise; /** * Stop WAITING for scenes the provider has left in flight. Not a cancel — reAPI * publishes none, so the task keeps running and settles on its own — and no * network call is made. Covers a scene whose create answer was lost as well: * that is the ONLY exit for one, since this route can never resolve it. */ export declare function abandonReapiSeedanceNativeJob(input: { outputDir: string; externalJobId: string; dryRun?: boolean; }): Promise<{ abandonedScenes: number[]; untouchedScenes: Array<{ sceneIndex: number; status: string; }>; }>; export declare function cancelReapiSeedanceNative(input: { outputDir: string; externalJobId: string; workspaceRoot: string; }): Promise; export {}; //# sourceMappingURL=native-reapi.d.ts.map