/** * native-flow-r2v.ts — first-class Google Flow Reference-to-Video (R2V) scene * render via saved **Flow Characters**, the proven character-ad workflow. * * Unlike the produce/execute path (which routes through the bun `vclaw-cli` * flow.ts and a full readiness/storyboard ceremony), this is a lightweight, * pure-Node fetch transport — the same shape as {@link ./native-runway} / * {@link ./native-dreamina} — for rendering ONE scene directly from character * references: * * POST {BASE}/google-flow/videos { email, prompt, model, aspectRatio, * duration, async, character_1..7 } → { jobid } * GET {BASE}/google-flow/jobs/{jobid} (jobid VERBATIM — encoding → 400) * → { status: started|completed|failed, ... videoUrl } * * R2V constraints (vclaw-cli/src/backends/types.ts, live-proven 2026-06-11): * - model MUST be `veo-3.1-fast` (veo-3.1-quality rejects character_*). * - character refs only (character_1..7) — NO startImage (can't mix R2V + I2V). * - Veo generates the character's voice + lip-sync NATIVELY from the prompt. * - Flow burst-throttles with a 403 reCAPTCHA (PUBLIC_ERROR_UNUSUAL_ACTIVITY); * this transport cools down and retries the SUBMIT for that case only. * * Transports (fetch + sleep) are injectable so the whole module is unit-testable * offline with no network and no real waiting. */ export declare const FLOW_BASE = "https://api.useapi.net/v1"; export declare const FLOW_R2V_MODEL = "veo-3.1-fast"; export declare const FLOW_R2V_DURATIONS: Set; export interface FlowFetchResponse { ok: boolean; status: number; text(): Promise; arrayBuffer(): Promise; /** Optional so test fakes can omit it; real fetch always provides it. */ headers?: { get(name: string): string | null; }; } /** * Server-stated throttle cooldown in ms, or null. Prefers the `Retry-After` * header (seconds or an HTTP/ISO date), then the response body's `retryAfter` * field (legacy seconds, or — current useapi shape since 2026-06-15 — an ISO * timestamp string). Honoring this waits the REAL window the load balancer * reports instead of a fixed guess. */ export declare function flowRetryAfterMs(res: { headers?: { get(name: string): string | null; }; }, parsedBody: Record): number | null; export type FlowFetchLike = (input: string, init?: { method?: string; headers?: Record; body?: string; }) => Promise; export interface FlowR2vOptions { /** Scene prompt (dialogue goes inline; prompt hygiene is applied by the caller). */ prompt: string; /** Resolved character refs → character_1..7 (1–7; the person + optional product). */ characterRefs: string[]; outputPath: string; /** 4 | 6 | 8 | 10 seconds (default 8). */ durationSeconds?: number; /** 'landscape' | 'portrait' (default 'landscape'). */ aspectRatio?: 'landscape' | 'portrait'; env?: NodeJS.ProcessEnv; fetchImpl?: FlowFetchLike; sleepImpl?: (ms: number) => Promise; /** * Captcha-retry count sent on the submit (`captchaRetry`, auto-solve). Omit to * resolve from VCLAW_FLOW_CAPTCHA_RETRY (default 3); 0 opts out. This rides * through the intermittent 403 reCAPTCHA inline rather than relying solely on * the cooldown-resubmit fallback below. */ captchaRetry?: number; /** Cooldown-retries for a 403 reCAPTCHA / 429 throttle on SUBMIT (default 2). */ maxRecaptchaRetries?: number; /** Cooldown between throttle retries, ms, when the server states no window (default 5 min). */ recaptchaCooldownMs?: number; /** * Max in-process wait for a server-stated Retry-After window (default 10 min). * A longer quarantine (e.g. the ~30-min USER_QUOTA window) fails fast with the * real wait instead of blocking the process for it. */ maxThrottleWaitMs?: number; pollIntervalMs?: number; maxPolls?: number; } export interface FlowR2vResult { jobId: string; outputPath: string; videoUrl: string; characterCount: number; model: string; durationSeconds: number; aspectRatio: string; } /** * Render one R2V scene from saved Flow character refs and download it to * `outputPath`. Throws a clear error on a non-throttle failure; cools down and * retries the submit on a 403 reCAPTCHA throttle. */ export declare function submitFlowR2vNative(options: FlowR2vOptions & { workspaceRoot?: string; }): Promise; export interface R2vPromptHygieneOptions { /** Keep Veo's generated music in the clip (default false → suppress it). */ keepMusic?: boolean; /** Allow room reverb on the voice (default false → dry close-mic). */ allowReverb?: boolean; } /** * Append the standing character-ad audio directives to a scene prompt, unless * opted out. Suppressing Veo-generated music keeps the clip audio voice-only so * a post bed can sit under it without clashing; the dry close-mic directive * fixes Veo's default echoey delivery. Idempotent-ish (only appends when not * already present). Pure. */ export declare function applyR2vPromptHygiene(prompt: string, options?: R2vPromptHygieneOptions): string; //# sourceMappingURL=native-flow-r2v.d.ts.map