/** * route-prerequisites.ts — the ONE canonical declaration of what each provider * route needs before it can run, and which specialist lanes it belongs to. * * This is a LEAF module on purpose: it imports only `./types.js`, so anything * may depend on it without dragging in `provider-status.ts` → * `execution-runtime.ts` (and from there most of the domain). `provider-status.ts` * used to hold five parallel `Record` tables that a new route * had to be added to five times; they live here now and it reads them. * * The lane flags are DECLARED, not inferred. `batchQueue` and `voiceRefInjection` * are deliberate specialist subsets — a route being live does not make it a batch * route, and does not mean a voice clone should be injected into its payload — so * each one names its members here and the consumers derive their sets from these * flags. `capability-contract.test.ts` fails when a consumer drifts. */ import type { ProviderRouteId } from './types.js'; /** * Executables a route's native transport needs on PATH. Kept as a local literal * union rather than an import so this module stays a leaf; it is structurally * assignable to `provider-status.ts`'s `ExecutableName`. */ export type RouteDependencyName = 'python3' | 'bun' | 'ffmpeg'; /** Everything a route needs configured, plus the specialist lanes it belongs to. */ export interface RoutePrerequisites { /** Env vars the route's built-in transport needs, in report order. */ requiredEnvVars: string[]; /** * A route with more than one credential path declares the selector that * chooses between them and the env vars each choice then needs. The choice * is EXPLICIT (ADR 0001): two credentials are two bills, so the route never * infers a path from whichever key happens to be set. `requiredEnvVarsFor` * folds the chosen path's vars into `requiredEnvVars` for the consumers that * report readiness; an unset or unknown selector reports only the selector. */ credentialAlternatives?: { selectorEnvVar: string; choices: Record; }; /** Executables the route's native transport shells out to. */ requiredDependencies: RouteDependencyName[]; /** `scaffold` routes report as `degraded` and stay out of default routing. */ maturity: 'production' | 'scaffold'; /** Env var naming a full custom adapter binary for this route. */ adapterEnvVar: string; /** Env vars naming per-route command shims run through the built-in adapter. */ commandEnvVars: string[]; /** Declared membership of the specialist lanes that use a route subset. */ lanes: { /** * The overnight batch queue (`batch-queue.ts`) targets only the routes with * in-process native submit/poll transports that loop `payload.tasks`. */ batchQueue: boolean; /** * Routes that consume a blank-video-with-audio voice clone as a video * reference to lock a cloned voice (the black-frame video carries the voice; * a raw MP3 does NOT lock it as reliably — that is the whole point of the * trick): * • seedance-direct — the .mp4 rides into `reference_videos` * • runway-useapi — Seedance-2 via the UseAPI gateway → `videoAssetId` + audio:true * • dreamina-useapi — Seedance-2 via Dreamina Omni Reference → `omni_N_videoRef` * (the omni video ref is EXPECTED to drive the voice on its own; unverified * live — if a render is mute, VCLAW_DREAMINA_AUDIO=1 forces `audio:true`) * Other routes leave voice clones un-injected (byte-identical). */ voiceRefInjection: boolean; }; } /** * Prerequisites for every live provider route. The key set is asserted equal to * `PROVIDER_ROUTE_IDS` by `capability-contract.test.ts`, so a new route cannot * be added to the id tuple without landing here too. */ export declare const ROUTE_PREREQUISITES: Record; /** Every route id whose declared `lanes[lane]` flag is true, in declaration order. */ export declare function routesInLane(lane: keyof RoutePrerequisites['lanes']): ProviderRouteId[]; /** * The env vars a route needs in THIS environment: its declared * `requiredEnvVars`, plus — for a route with `credentialAlternatives` — the * vars of the path its selector names. An unset or unknown selector adds * nothing (the selector itself is already in `requiredEnvVars`, so the report * names it as the missing piece). Pure: reads only the `env` it is given. */ export declare function requiredEnvVarsFor(routeId: ProviderRouteId, env: NodeJS.ProcessEnv): string[]; /** Every env var a route could ever need, across all of its credential paths. */ export declare function allDeclaredEnvVarsFor(routeId: ProviderRouteId): string[]; //# sourceMappingURL=route-prerequisites.d.ts.map