import { type ReferenceProfile } from './character-reference-prompts.js'; import type { ReferenceSheet } from './types.js'; /** * Go Bananas style preset that renders the multi-view **Cinematic Character * Reference Sheet** (hero portrait + 6 reference views). Every auto-created * character gets one as its identity reference sheet — the consistency anchor * the rest of the pipeline (director identity gate, Seedance/Flow) depends on. */ export declare const CINEMATIC_CHARACTER_SHEET_PRESET_ID = 55; export interface CharacterAutoCreateInput { name: string; description: string; style?: string; referenceProfile?: ReferenceProfile; approvedFaceImageId?: number; approvedOutfitImageId?: number; outfit?: string; sheetAspectRatio?: string; } /** * Build the canonical identity reference sheet for an auto-created character. * Pure/deterministic. Carries two `identity`-role references — the rendered * sheet image (project-relative path) and the managed Go Bananas character — * so the sheet satisfies the director identity gate and locks identity * downstream. Bindings/createdAt are preserved from `existing` on re-create. */ export declare function buildCharacterIdentitySheet(args: { name: string; characterId: number; sheetRelPath: string; now: string; existing?: ReferenceSheet; }): ReferenceSheet; export interface CharacterAutoCreateResult { characterId: number; imageUrl: string; created: boolean; importedToProject: boolean; /** Identity reference-sheet id, when one was generated + registered. */ referenceSheetId?: string; /** Project-relative path to the rendered Cinematic Character Reference Sheet. */ referenceSheetPath?: string; /** True when the identity sheet was merged into the Go Bananas character record. */ gbRefsSynced?: boolean; sheetReviewStatus?: 'pending' | 'approved'; imageId?: number; status?: 'awaiting-face-approval' | 'awaiting-outfit-approval' | 'working-sheet-unreviewed'; } export declare function buildPortraitPrompt(input: CharacterAutoCreateInput): string; /** * Whitespace/case-insensitive description equality. * * `createCharacter` stores `description: input.description` verbatim, so an * idempotent re-run of the same input matches exactly here — which is the ONLY * case where silently rebinding to an existing character is safe. */ export declare function describesSameCharacter(requested: string, existing: string | undefined | null): boolean; /** * Prompt for the identity reference sheet. Leads with the character's `style` * (mirroring buildPortraitPrompt) so the sheet matches the portrait's look * rather than the sheet style preset's default — preset 55 ("Cinematic") * otherwise renders a 3D/photoreal sheet even for a flat-cartoon character, * leaving the identity anchor off-style from the portrait it should match. */ export declare function buildReferenceSheetPrompt(input: CharacterAutoCreateInput): string; /** * Pure builder for the POST /images body that generates the reference sheet. * Carries the style (via buildReferenceSheetPrompt) and, when the on-style * portrait image id is known, passes it as `reference_image_ids` so the sheet * inherits the portrait's exact look instead of the preset's default style. */ export declare function buildReferenceSheetRequestBody(args: { input: CharacterAutoCreateInput; characterId: number; presetId: number; portraitImageId?: number; }): Record; /** The `/images` response shape, shape-tolerant across Go Bananas revisions. */ export interface GeneratedImagePayload { url?: string; image_url?: string; id?: number; image_id?: number; d1_record_id?: number; data?: { url?: string; images?: Array<{ full_url?: string; url?: string; id?: number; image_id?: number; d1_record_id?: number; }>; }; images?: Array<{ full_url?: string; url?: string; id?: number; image_id?: number; d1_record_id?: number; }>; } export declare function extractImageUrl(payload: GeneratedImagePayload): string | undefined; /** * The id Go Bananas ALREADY assigned to the image it just generated. * * `/images` returns `data.images[0].d1_record_id` alongside the URL (verified * live 2026-08-06). Reading it is what removes the upload round-trip: the old * code kept only the URL, then asked Go Bananas to re-fetch its own public CDN * URL over the internet purely to be handed back the same id — and that fetch * fails with a 522, because the API cannot reach its own CDN from inside. Every * cast build in the repo was broken by it. */ export declare function extractImageId(payload: GeneratedImagePayload): number | undefined; export declare function autoCreateCharacters(inputs: CharacterAutoCreateInput[], options?: { projectSlug?: string; root?: string; apiKey?: string; apiUrl?: string; dryRun?: boolean; /** Generate + register each character's identity reference sheet (default true). */ referenceSheet?: boolean; /** * Bind to an existing same-named character even when its description differs. * Off by default: silent rebinding renders a different person than the one * described, and the local artifact hides it. */ reuseExisting?: boolean; /** Go Bananas style-preset id for the sheet (default the Cinematic Character Reference Sheet). */ sheetPresetId?: number; referenceProfile?: ReferenceProfile; }): Promise>; //# sourceMappingURL=character-auto-create.d.ts.map