import { type CreativeRevisionPlan } from "./creative-contract.ts"; import { type JevAggregatedSpend } from "./jev/budget.ts"; import type { JevTransport } from "./jev/types.ts"; import type { TrustedPilotContext } from "./jev/calibration.ts"; export type CreativePhase = "shared" | "planning" | "rendering" | "study_review" | "representative" | "selection" | "revision" | "expansion" | "final_review" | "complete" | "blocked"; export type CreativeRun = { schemaVersion: 1; id: string; phase: CreativePhase; createdAt: string; kernelHash: string; inputHash: string; parentSourceHash: string; finalSourceHash?: string; child?: string; candidateId?: string; candidateRevision?: string; identityHash?: string; expansionStarted?: boolean; studyOrder: string[]; tried: string[]; spentIterations: number; observedIterations?: Record; spentDurationMs?: number; observedDurationMs?: Record; candidateCeilings?: Record; candidateOutcomes?: Record; limits: { iterations: number; durationMs: number; tokens: number | null; }; orchestratorVersion?: 2; studyAssetsHash?: string; reviewRound?: number; finalReviewRound?: number; revisionCount?: number; challengeCount?: number; qualified?: Record; revision?: { round: number; beforeRevision: string; plan: CreativeRevisionPlan; returnTo?: "expansion"; }; spentTokens?: number; observedTokens?: Record; hasUnknownUsage?: boolean; renderDurationMs?: number; jevBaseline?: JevAggregatedSpend; jevSpend?: JevAggregatedSpend; jevFallback?: string; error?: string; blockedFromPhase?: CreativePhase; blockKind?: "tool" | "creative" | "budget"; }; export declare function createCreativeRun(root: string, kernel: string, argv: string[]): CreativeRun; export declare function creativeRunStatus(root: string, id?: string): CreativeRun | undefined; export declare function promoteCreativeRun(root: string, id: string): { backup: string; promotedSourceHash: string; }; /** A read-only view; receipt totals are recomputed without altering the run manifest. */ export declare function creativeRunStatusSnapshot(root: string, id?: string): Record | undefined; export declare function assertCreativeBudget(run: CreativeRun, reserveIterations?: number): void; export declare function runCreativeProfile(root: string, kernel: string, argv: string[], opts?: { jevFetch?: JevTransport; pilotContext?: TrustedPilotContext; }): Promise<{ run: CreativeRun; paused: boolean; exitCode: number; previewUrl?: string; summary: string; }>;