import type { JsonObject } from '../types/json.js';
import type { StageRecorder } from '../format-adapters/index.js';
export type HubPolicyMode = 'off' | 'observe' | 'enforce';
export interface HubPolicyConfig {
    mode?: HubPolicyMode;
    /**
     * Optional: sampling rate in [0, 1]. When provided, observation is best-effort
     * and may skip recording for some requests.
     */
    sampleRate?: number;
}
export interface PolicyObservation {
    phase: 'client_inbound' | 'provider_outbound' | 'provider_inbound' | 'client_outbound';
    providerProtocol: string;
    violations: Array<{
        code: 'unexpected_wrapper' | 'unexpected_field';
        path: string;
        detail?: string;
    }>;
    summary: {
        totalViolations: number;
        unexpectedFieldCount: number;
    };
}
export interface ProviderOutboundPolicyApplyResult {
    payload: JsonObject;
    changed: boolean;
    removedTopLevelKeys: string[];
    flattenedWrappers: string[];
}
export declare function setHubPolicyRuntimePolicy(policy?: HubPolicyConfig): void;
export declare function recordHubPolicyObservation(options: {
    policy?: HubPolicyConfig;
    phase?: PolicyObservation['phase'];
    providerProtocol: string;
    compatibilityProfile?: string;
    payload: JsonObject;
    stageRecorder?: StageRecorder;
    requestId?: string;
}): void;
export declare function applyHubProviderOutboundPolicy(options: {
    policy?: HubPolicyConfig;
    providerProtocol: string;
    compatibilityProfile?: string;
    payload: JsonObject;
    stageRecorder?: StageRecorder;
    requestId?: string;
}): JsonObject;
