/**
 * Content-addressed distributed plan transport.
 *
 * V2 deliberately separates transport from execution. The transport root is
 * a small immutable `plan.json` manifest plus sha256-addressed blobs. Workers
 * select and materialize only the dependencies for their role, then invoke
 * the shared execution functions on the verified local layout.
 *
 * Video-frame dependencies are derived by evaluating the engine's own
 * FrameLookupTable at every captured global frame. If legacy video metadata
 * is absent, v2 explicitly falls back to the full-source pack.
 */
import { type DistributedRenderConfig } from "./plan.js";
import { type PlanProtocolV2Descriptor } from "./planProtocol.js";
import { type PlanV2ArtifactPublisher } from "./planV2Publisher.js";
import { PLAN_V2_INTEGRITY_UNRECOVERABLE, PlanV2IntegrityError } from "./planV2Errors.js";
import { type DistributedFormat } from "./shared.js";
export declare const PLAN_V2_MATERIALIZATION_MARKER = ".hyperframes-plan-v2.json";
export { PLAN_V2_INTEGRITY_UNRECOVERABLE, PlanV2IntegrityError };
export type PlanV2MaterializationTarget = Readonly<{
    role: "chunk";
    chunkIndex: number;
}> | Readonly<{
    role: "assembler";
}>;
export interface PlanV2Artifact {
    /** POSIX path in the materialized local execution directory. */
    readonly path: string;
    readonly sha256: string;
    readonly sizeBytes: number;
    /** Chunk indexes that need this artifact, or `"all"` for shared dependencies. */
    readonly chunks: "all" | readonly number[];
    readonly assembler: boolean;
}
export interface PlanV2Manifest {
    readonly protocol: Readonly<PlanProtocolV2Descriptor>;
    /** V2 manifest digest; intentionally distinct from the local execution-plan hash. */
    readonly planHash: string;
    /**
     * Local execution-plan hash retained for output/replay correlation.
     *
     * @deprecated This is the compatibility wire name. Use
     * {@link getPlanV2ExecutionPlanHash} in new code.
     */
    readonly sourcePlanV1Hash: string;
    readonly chunkCount: number;
    readonly totalFrames: number;
    readonly fps: 24 | 30 | 60;
    readonly width: number;
    readonly height: number;
    readonly format: DistributedFormat;
    readonly ffmpegVersion: string;
    readonly producerVersion: string;
    readonly limitations: Readonly<PlanV2Limitations>;
    readonly artifacts: readonly Readonly<PlanV2Artifact>[];
}
export interface PlanV2Limitations {
    readonly videoDependencyMode: "exact-rendered-frames" | "full-source-pack";
}
export interface PlanV2Result {
    readonly planDir: string;
    readonly manifestPath: string;
    readonly planProtocol: Readonly<PlanProtocolV2Descriptor>;
    readonly planHash: string;
    /**
     * Hash of the shared local execution representation.
     *
     * @deprecated This is the compatibility wire name. Use
     * {@link getPlanV2ExecutionPlanHash} in new code.
     */
    readonly sourcePlanV1Hash: string;
    readonly chunkCount: number;
    readonly totalFrames: number;
    readonly fps: 24 | 30 | 60;
    readonly width: number;
    readonly height: number;
    readonly format: DistributedFormat;
    readonly ffmpegVersion: string;
    readonly producerVersion: string;
    readonly limitations: Readonly<PlanV2Limitations>;
}
export interface PlanV2WithPublisherOptions {
    /**
     * Parent for the planner-private local execution directory. Remote adapters
     * normally leave this unset and use the OS temp directory. The local
     * compatibility wrapper keeps staging beside its destination so hard links
     * can avoid a second set of data blocks.
     */
    readonly stagingParentDir?: string;
}
export interface PlanV2MaterializationResult {
    readonly planDir: string;
    readonly target: PlanV2MaterializationTarget;
    readonly planHash: string;
    /**
     * Hash of the shared local execution representation.
     *
     * @deprecated This is the compatibility wire name. Use
     * {@link getPlanV2ExecutionPlanHash} in new code.
     */
    readonly sourcePlanV1Hash: string;
    readonly artifactCount: number;
    readonly sizeBytes: number;
    readonly audioPath: string | null;
}
/** Publish a frozen local execution directory into an immutable local v2 transport. */
export declare function createPlanV2FromExecutionPlan(executionPlanDir: string, planV2Dir: string): PlanV2Result;
/**
 * Compatibility alias for {@link createPlanV2FromExecutionPlan}.
 *
 * @deprecated Use `createPlanV2FromExecutionPlan`.
 */
export declare function createPlanV2FromV1(executionPlanDir: string, planV2Dir: string): PlanV2Result;
/** Publish a frozen local execution directory through a storage-neutral v2 publisher. */
export declare function publishPlanV2FromExecutionPlan(executionPlanDir: string, publisher: PlanV2ArtifactPublisher): Promise<PlanV2Manifest>;
/**
 * Compatibility alias for {@link publishPlanV2FromExecutionPlan}.
 *
 * @deprecated Use `publishPlanV2FromExecutionPlan`.
 */
export declare function publishPlanV2FromV1(executionPlanDir: string, publisher: PlanV2ArtifactPublisher): Promise<PlanV2Manifest>;
/**
 * Plan into a storage-neutral publisher. Implementations may write to a local
 * directory, S3, GCS, or another durable CAS. Only the planner's private
 * staging directory is local; distributed workers receive adapter-owned
 * manifest and artifact locators.
 */
export declare function planV2WithPublisher(projectDir: string, config: DistributedRenderConfig, publisher: PlanV2ArtifactPublisher, options?: Readonly<PlanV2WithPublisherOptions>): Promise<PlanV2Manifest>;
/**
 * Plan directly into v2. The shared local execution representation exists
 * only as planner-private staging; the legacy 2 GiB transport cap is disabled
 * because no monolithic archive is emitted.
 */
export declare function planV2(projectDir: string, config: DistributedRenderConfig, planV2Dir: string): Promise<PlanV2Result>;
/**
 * Return the shared local execution-plan hash from a v2 manifest while
 * preserving the established `sourcePlanV1Hash` wire key.
 */
export declare function getPlanV2ExecutionPlanHash(plan: Readonly<Pick<PlanV2Manifest, "sourcePlanV1Hash">>): string;
/** Strictly parse and integrity-check a v2 manifest before any blob access. */
export declare function readPlanV2Manifest(planV2Dir: string): Readonly<PlanV2Manifest>;
export declare function listPlanV2ArtifactsForTarget(manifest: Readonly<PlanV2Manifest>, target: PlanV2MaterializationTarget): readonly Readonly<PlanV2Artifact>[];
/**
 * Verify every selected blob first, then atomically publish the shared local
 * execution directory. The marker lets execution functions revalidate the
 * selected subset without requiring assembler-only audio in chunk workers.
 */
export declare function materializePlanV2Target(planV2Dir: string, target: PlanV2MaterializationTarget, destinationDir: string): PlanV2MaterializationResult;
/** Revalidate a materialized subset immediately before execution. */
export declare function validatePlanV2MaterializedTarget(planDir: string, expectedTarget: PlanV2MaterializationTarget): Readonly<PlanV2Manifest> | null;
//# sourceMappingURL=planV2.d.ts.map