/**
 * QE Gating Config (ADR-PIPELINE-086)
 *
 * Resolves the AGENTICS_QE_GATING mode from either the env var or a persisted
 * config file in ~/.agentics/qe-gating.json. Emits structured bypass records
 * when the mode is not `on`.
 *
 * Source precedence (highest → lowest):
 *   1. AGENTICS_QE_GATING env var
 *   2. Persisted config at <configDir>/qe-gating.json
 *   3. Default: `on`
 *
 * The persisted file is the mechanism on-call uses outside of env-var
 * environments (e.g., managed deployments where env vars require a redeploy).
 * Both paths require a non-empty reason when setting anything other than `on`
 * — callers that persist without a reason will throw.
 */
export type QeGatingMode = 'on' | 'advisory' | 'off';
export declare const DEFAULT_MODE: QeGatingMode;
export declare const ENV_VAR_NAME = "AGENTICS_QE_GATING";
export declare const CONFIG_FILE = "qe-gating.json";
export declare const DEFAULT_CONFIG_DIR: string;
export interface PersistedQeGating {
    mode: QeGatingMode;
    reason: string;
    applied_at: string;
    applied_by?: string;
    correlation_id?: string;
}
export interface ResolvedQeGating {
    mode: QeGatingMode;
    source: 'env' | 'persisted' | 'default';
    /** The reason string, if available (empty for env-default paths). */
    reason?: string;
    /** The raw env var value, if that was the source. */
    rawEnv?: string;
}
export interface ResolveOptions {
    /**
     * Override the environment. Defaults to `process.env`. Tests pass a fixture.
     */
    env?: NodeJS.ProcessEnv;
    /** Override the config dir. Defaults to `~/.agentics`. */
    configDir?: string;
}
export interface PersistOptions {
    configDir?: string;
    correlationId?: string;
    appliedBy?: string;
    /** Clock override for tests. */
    now?: Date;
}
export declare class InvalidGatingValueError extends Error {
    readonly code: "INVALID_QE_GATING_VALUE";
    readonly value: string;
    constructor(value: string);
}
export declare class EmptyReasonError extends Error {
    readonly code: "EMPTY_QE_GATING_REASON";
    constructor();
}
/**
 * Parse a raw env-var value. Accepts exactly one of: on, advisory, off
 * (case-insensitive; whitespace-trimmed). Empty / undefined returns null so
 * callers can fall through to persisted / default resolution.
 */
export declare function parseGatingValue(raw: string | undefined): QeGatingMode | null;
export declare function loadPersistedQeGating(opts?: ResolveOptions): PersistedQeGating | null;
/**
 * Persist a gating decision. Throws `EmptyReasonError` if mode is not `on`
 * and reason is empty. Creates the config dir if missing.
 */
export declare function persistQeGating(mode: QeGatingMode, reason: string, opts?: PersistOptions): PersistedQeGating;
/**
 * Resolve the effective gating mode from env > persisted > default.
 */
export declare function resolveQeGatingMode(opts?: ResolveOptions): ResolvedQeGating;
export declare function isGatingOn(opts?: ResolveOptions): boolean;
export declare function isGatingAdvisory(opts?: ResolveOptions): boolean;
export declare function isGatingOff(opts?: ResolveOptions): boolean;
//# sourceMappingURL=qe-gating.d.ts.map