export declare const VALID_SOURCES: readonly ["Nano Banana", "Seedream 4.0", "Seedream 4.5", "OpenAI", "Flux 1.1 Pro", "Flux 2 Pro", "Google Imagen 4", "GPT Image 2", "Grok Imagine", "Wan 2.7"]; export type DesignStyle = 'photoreal' | 'vector' | 'abstract' | 'auto'; /** Normalize a caller-supplied `source` to its canonical VALID_SOURCES spelling, case-insensitively. * The platform's source-name match is case-insensitive too, but its slow-model async routing is * case-SENSITIVE — so a near-miss like "SeeDream 4.5" would run synchronously and a wrong name like * "Flux 1.1" would 500 there. Normalizing here forwards the exact canonical name, or throws a clear * bad_request (non-fallbackable) listing the valid sources, instead of a confusing downstream * failure (ApparelHub-AI/apparelhub-mcp#70). */ export declare function normalizeSource(source: string): string; export declare const EDIT_CAPABLE_SOURCES: Set; /** Pick a source. Nano Banana is the best all-rounder (photoreal + text + abstract). OpenAI is * deliberately NEVER preferred (operator directive: it's the least-preferred model — its account * is a shared billing surface and it only wins on nothing today). The user can always override * with an explicit source. */ export declare function pickSource(_opts?: { style?: DesignStyle; hasText?: boolean; }): string; /** Build the ordered, de-duplicated list of sources to try for one generation. When an explicit * `source` is given it goes FIRST, then the appropriate ladder is appended (deduped). When * `edit` is true the list is restricted to the edit-capable sources (img2img); a text-to-image-only * source (only Google Imagen 4) can never be a valid edit fallback. */ export declare function fallbackLadder(opts?: { style?: DesignStyle; source?: string; edit?: boolean; }): string[]; /** TRUE for per-model / transient failures that warrant trying a different model. Validation * (bad_request/unprocessable), auth (auth_required), forbidden/membership-quota (forbidden), * not_found, AND `platform_rate_limited` (ApparelHub's own per-key throttle — model-independent) * MUST return FALSE so they surface immediately. A `generation_failed` is fallbackable ONLY when * its message is rate-limit-shaped (legacy heuristic; structured async failures now arrive as * the precise `model_rate_limited` code instead). */ export declare function isFallbackableError(err: unknown): boolean; /** The terminal code for "every model refused this on content grounds". * * This is the ONLY signal that abandoning a design is legitimate. A single block never is — * that was the behaviour being corrected. Kept distinct from `content_blocked` so an agent can * tell "one model said no" from "all ten did". */ export declare const CONTENT_BLOCKED_ALL_MODELS = "content_blocked_all_models"; /** TRUE when a provider refused on content/copyright grounds (platform code `content_blocked`, * normalised across every provider by the platform side of this work). */ export declare function isContentBlockError(err: unknown): boolean; /** Every model worth trying after a content block, ordered provider-diverse, minus `exclude`. * * Round-robin across providers means the first few rungs each land on a DIFFERENT guard, which is * where nearly all the value is: if a different guard is going to render this prompt, it renders * on rung 2, not rung 7. Siblings on an already-refused host come later, once diversity is spent. * * `edit` restricts to the edit-capable set — a text-to-image-only model can never be a valid edit * fallback, and offering one would just spend a rung on a guaranteed 400. */ export declare function contentBlockSweep(opts?: { edit?: boolean; exclude?: Iterable; }): string[]; /** The provider a source rides, for honest reporting. */ export declare function providerOf(source: string): string | undefined; /** Lesson 9b: never ask a model for a "transparent background" — request a solid green one and * key it out afterward. Idempotent (skips if the prompt already asks for a green background). * * ⚠️ Only call this when the design will actually be keyed. Appending it for an * all-over print produced a green-framed image that nothing then keyed out (#765). */ export declare function augmentPromptForTransparency(prompt: string): string; /** TRUE when a provider rejected the request for prompt LENGTH. * * Distinct from a rate limit or a transient 5xx: retrying the same prompt on the * same model can never succeed, but the same prompt on a model with a longer limit * will. So it IS fallbackable — and it must never be reported to the agent as "the * model is rate limiting" or "the model is down", because neither is true and both * send the agent to the wrong remedy (#766). */ export declare function isPromptTooLongError(err: unknown): boolean; /** Build an img2img edit prompt from a change description + a list of aspects to preserve. */ export declare function buildIterationPrompt(change: string, preserve: string[]): string;