import type { AssetSpec, AssetType, InlineSvgPlan, ExternalPromptPlan, BrandBundle } from "../types.js"; import type { ModeT } from "../schemas.js"; import { type Mode } from "../modes.js"; /** * Pick the execution mode for a generator call. * Throws with an actionable message if the requested mode is impossible. */ export declare function resolveMode(requested: ModeT | undefined, assetType: AssetType, primaryModel: string, fallbackModels: string[]): { mode: Mode; reason: string; }; /** * Build the inline_svg plan for a specific asset type using the asset spec * and optional brand bundle / text content from the caller. */ export declare function buildInlineSvgPlan(assetType: AssetType, brief: string, spec: AssetSpec, brandBundle?: BrandBundle, textContent?: string): InlineSvgPlan; /** * Build the external_prompt_only plan. Returns the rewritten prompt (from * enhancePrompt) plus the human-facing UIs the user can paste into, plus * an ingest_hint that tells the caller how to feed the result back in. */ export declare function buildExternalPromptPlan(assetType: AssetType, brief: string, spec: AssetSpec, opts?: { expected_text?: string; }): ExternalPromptPlan; /** * Soft-fallback helper for api-mode generators. * * The router may route to a paste-only provider as primary (Midjourney, * Firefly, Krea). Without this helper, each tool would blindly call * `generate(spec.target_model, …)`, hit a `ProviderError`, and fail the * whole request — even when the user has an OpenAI / Ideogram / BFL key * and a fallback model in the chain is perfectly usable. * * Behaviour: * - If `spec.target_model` has a real API and the key is set, return * `{ kind: "api", model, warnings: [] }`. * - If it's paste-only or the key is missing, walk `spec.fallback_models` * for the first model whose provider is API-reachable. Return that * with a warning explaining the swap. * - If nothing in the chain is usable, return * `{ kind: "external", plan }` so the tool can emit an * `ExternalPromptPlan` instead of throwing — the caller gets the * dialect-correct prompt + paste targets and the user keeps moving. */ export declare function chooseApiTargetOrFallback(assetType: AssetType, brief: string, spec: AssetSpec, opts?: { expected_text?: string; images?: number; }): { kind: "api"; model: string; warnings: string[]; } | { kind: "external"; plan: ExternalPromptPlan; }; //# sourceMappingURL=mode-runtime.d.ts.map