import type { Spec } from './spec/core.js';
import type { SpecStatus } from './common/primitives.js';
export interface CascadeContext {
    specId: string;
    spec: Spec;
    newStatus: SpecStatus;
    currentStatus: SpecStatus;
    projectId: string;
    projectPath?: string;
    validateScore: number | null;
    allSpecs: Spec[];
}
export type CascadeHookHandler = (ctx: CascadeContext) => Promise<void>;
export interface CascadeHook {
    /** Unique identifier — lowercase-kebab. Used in disable lists and logs. */
    id: string;
    /** Status transitions this hook reacts to. Empty array = any status. */
    triggers: SpecStatus[];
    /** True if hook needs projectPath; skipped silently when missing. */
    requiresProjectPath: boolean;
    /** Human label for logs. */
    label: string;
    /** The actual work. Wrapped in try/catch by the runner. */
    handler: CascadeHookHandler;
    /**
     * SPEC-772: When true, hook is awaited synchronously (up to 2s budget).
     * Result is returned in RunCascadeResult.fastHookResults for inclusion in humanSummary.
     * Defaults to false (fire-and-forget).
     */
    fast?: boolean;
}
export type CoreActionResult = {
    ok: true;
} | {
    ok: false;
    error: string;
};
/** SPEC-772: Result of a single fast hook execution. */
export interface FastHookResult {
    hookId: string;
    result: 'pass' | 'fail' | 'timeout';
    error?: string;
    durationMs: number;
}
export interface RunCascadeOptions {
    disabledByConfig: Set<string>;
    disabledByEnv: Set<string>;
}
export interface RunCascadeResult {
    coreResults: Record<string, CoreActionResult>;
    hooksDispatched: string[];
    hooksSkipped: string[];
    /** SPEC-772: Results of fast hooks (fast: true) awaited synchronously. */
    fastHookResults: FastHookResult[];
}
/** SPEC-776: Single drift alert returned by verifyStateFiles(). */
export interface StateDriftAlert {
    kind: 'state_drift';
    message: string;
    severity: 'warning';
    fix?: string;
}
/** SPEC-776: Result of verifyStateFiles() — describes whether planu/ state files are in sync. */
export interface DriftReport {
    drifted: boolean;
    alerts: StateDriftAlert[];
}
//# sourceMappingURL=cascade-hooks.d.ts.map