import { type Result } from '../../core/src/index';
import { type SiteCommand, type SiteCommandBatch, type SiteCommandOf, type SiteCommandType } from './commands';
import { type CommandRisk, type LifecycleIntent, type SiteCommandCapabilityGap, type SiteCommandIdempotencyKey, type SiteCommandMetadata, type SiteCommandValidationError } from './domain';
import { type ResourceRef } from './refs';
type PlannedSiteCommandCommon = Readonly<{
    metadata: SiteCommandMetadata;
    lifecycleIntent: LifecycleIntent;
    provides: readonly ResourceRef[];
    requires: readonly ResourceRef[];
    idempotencyKey: SiteCommandIdempotencyKey;
}>;
export type PlannedSiteCommandFor<TType extends SiteCommandType> = PlannedSiteCommandCommon & Readonly<{
    command: SiteCommandOf<TType>;
}>;
export type PlannedSiteCommand = PlannedSiteCommandFor<SiteCommandType>;
export type SiteCommandPlan = Readonly<{
    batch: SiteCommandBatch;
    commands: readonly PlannedSiteCommand[];
    capabilityGaps: readonly SiteCommandCapabilityGap[];
}>;
export type PlannedSiteCommandOf<TType extends SiteCommandType> = {
    [TCommandType in TType]: PlannedSiteCommandFor<TCommandType>;
}[TType];
export type SiteCommandPlanFor<TType extends SiteCommandType> = Omit<SiteCommandPlan, 'commands'> & Readonly<{
    commands: readonly PlannedSiteCommandOf<TType>[];
}>;
export type PlannedSiteCommandDispatcher<TResult> = <TType extends SiteCommandType>(plannedCommand: PlannedSiteCommandFor<TType>) => TResult;
export type SiteCommandMatcher<TResult> = <TType extends SiteCommandType>(command: SiteCommandOf<TType>) => TResult;
export declare function parseCommandBatch(input: unknown): Result<SiteCommandBatch, readonly SiteCommandValidationError[]>;
export declare function planCommandBatch(batch: SiteCommandBatch): Result<SiteCommandPlan, readonly SiteCommandValidationError[]>;
export declare function matchSiteCommand<TResult>(command: SiteCommand, match: SiteCommandMatcher<TResult>): TResult;
export declare function dispatchPlannedSiteCommand<TResult>(plannedCommand: PlannedSiteCommand, dispatch: PlannedSiteCommandDispatcher<TResult>): TResult;
export declare function matchPlannedSiteCommand<TResult>(plannedCommand: PlannedSiteCommand, match: PlannedSiteCommandDispatcher<TResult>): TResult;
export declare function parseAndPlanCommandBatch(input: unknown): Result<SiteCommandPlan, readonly SiteCommandValidationError[]>;
export declare function parseAndPlanCommandBatchForTypes<TType extends SiteCommandType>(input: unknown, allowedTypes: readonly TType[]): Result<SiteCommandPlanFor<TType>, readonly SiteCommandValidationError[]>;
export declare function narrowSiteCommandPlan<TType extends SiteCommandType>(plan: SiteCommandPlan, allowedTypes: readonly TType[]): Result<SiteCommandPlanFor<TType>, readonly SiteCommandValidationError[]>;
export declare function deriveIdempotencyKey(input: Readonly<{
    batch: Pick<SiteCommandBatch, 'batchRef' | 'target'>;
    command: Pick<SiteCommand, 'type' | 'ref'>;
    metadata: Pick<SiteCommandMetadata, 'idempotencyStrategy'>;
}>): SiteCommandIdempotencyKey;
export type DryRunReport = Readonly<{
    status: 'dry_run_passed' | 'dry_run_passed_with_gaps';
    commandCount: number;
    mutationCount: number;
    publishCount: number;
    unpublishCount: number;
    seedCount: number;
    riskSummary: Readonly<Record<CommandRisk, number>>;
    executionOrder: readonly Readonly<{
        ref: string;
        type: SiteCommandType;
    }>[];
    resolvedRefs: readonly ResourceRef[];
    capabilityGaps: readonly SiteCommandCapabilityGap[];
}>;
export declare function createDryRunReport<TType extends SiteCommandType>(plan: SiteCommandPlan | SiteCommandPlanFor<TType>): DryRunReport;
export {};
