import type { PetdexAnimation, PetdexAnimationId } from "@xiaozhiclaw/pet-core";
import type { PetSoul } from "./pet-types.js";
export interface PetPreferences {
    enabled: boolean;
    selectedPetAssetId: string;
}
export interface PetdexPetAssetSummary {
    id: string;
    assetKind: "petdex";
    sourceKind?: "builtin" | "upload" | "forge";
    name: string;
    description: string;
    createdAt: string;
    updatedAt: string;
    atlas: PetdexPetAssetSummaryAtlas;
    animations?: Record<PetdexAnimationId, PetdexPetAnimation>;
    thumbnail?: {
        frame: number;
    };
}
export interface PetdexPetAssetSummaryAtlas {
    format: "webp";
    columns: 8;
    rows: 9;
    frameCount: 72;
    cellWidth: 192;
    cellHeight: 208;
    width: 1536;
    height: 1872;
    sha256: string;
}
export interface PetdexPetAssetAtlas extends PetdexPetAssetSummaryAtlas {
    image: "spritesheet.webp";
}
/** Re-uses the pet-core contract animation shape (row + per-frame durations, Codex-aligned). */
export type PetdexPetAnimation = PetdexAnimation;
export interface PetdexPetAsset extends Omit<PetdexPetAssetSummary, "atlas"> {
    schema: "qlogic.petdex.asset.v1";
    atlas: PetdexPetAssetAtlas;
    source: {
        kind: "builtin" | "upload" | "forge";
        prompt: string | null;
    };
    animations: Record<PetdexAnimationId, PetdexPetAnimation>;
    thumbnail: {
        frame: number;
    };
}
export interface JourneySnapshot {
    date: string;
    day: number;
    petName: string;
    stateLabel: string;
    entries: Array<Record<string, unknown>>;
}
export interface PetProfile {
    version: 1;
    ownerUserId: string;
    soul: PetSoul | null;
    preferences: PetPreferences;
    customPets: PetdexPetAssetSummary[];
    journeyDates: string[];
    updatedAt: string;
}
export declare class PetProfileService {
    private readonly ownerUserId;
    private readonly petDir;
    private readonly profilePath;
    constructor(ownerUserId: string);
    loadProfile(): PetProfile;
    updateSoul(soul: PetSoul | null): PetProfile;
    updatePreferences(update: Partial<PetPreferences>): PetProfile;
    saveJourneySnapshot(snapshot: JourneySnapshot): PetProfile;
    listJourneyDates(): string[];
    getJourneySnapshot(date: string): JourneySnapshot | null;
    upsertCustomPet(pet: PetdexPetAsset): PetProfile;
    deleteCustomPet(id: string): PetProfile;
    listCustomPets(): PetdexPetAssetSummary[];
    getCustomPet(id: string): PetdexPetAsset | null;
    getCustomPetSpritesheet(id: string): Buffer | null;
    findReusableCustomPetId(params: {
        sourceKind: "upload" | "forge";
        name: string;
        description: string;
    }): string | null;
    compactDuplicateCustomPets(): PetProfile;
    writeCustomPetAssetFiles(pet: PetdexPetAsset, spritesheet: Buffer, validation: unknown, productionRun?: unknown): PetProfile;
    private defaultProfile;
    private normalizeProfile;
    private writeProfile;
}
