/**
 * BaseProviderAdapter -- abstract base class for all LLM provider adapters.
 *
 * Provides:
 *   - Common retry logic with exponential back-off and jitter
 *   - Common LlmProviderError hierarchy instantiation
 *   - Common streaming-chunk accumulation
 *   - Common token / cost accounting normalisation
 *   - Common governance hook dispatch (PreTool / PostTool)
 *   - Audit event emission via configurable emitter
 *
 * Concrete adapters extend this class and override provider-specific
 * methods only. No provider-specific logic lives in this base.
 *
 * Spec: P3-SUB-01 AC 3 (BaseProviderAdapter)
 *
 * @connexum/ai-governance
 */
import type { LlmProviderAdapter, LlmAdapterConfig, LlmAdapterCapabilities, LlmChatRequest, LlmChatResponse, LlmStreamChunk, LlmTokenAccounting, LlmToolUseRequest, LlmToolUseResponse, LlmModelDescriptor, ProviderComplianceRegistration } from './index';
import { LlmProviderError } from './index';
import type { LlmAuditEmitter, BackoffRetryOptions } from './shared';
/**
 * Register provider compliance metadata.
 *
 * If `baa: true` is declared without `attestationUrl` or `attestationDate`,
 * this function emits a CRITICAL audit event and stores the registration
 * with `baa` treated as false for pack evaluation (AC spec Section 3.2).
 *
 * The audit emitter parameter is optional here because register() is
 * typically called at module load time, before an emitter is wired.
 * Boot hooks must call `auditUnverifiedBaaClaims(emit)` after wiring.
 */
export declare function registerProviderCompliance(registration: ProviderComplianceRegistration, emit?: LlmAuditEmitter): void;
/**
 * Retrieve effective compliance registration for a provider.
 * Returns undefined if the provider has not registered.
 */
export declare function getProviderCompliance(providerId: string): ProviderComplianceRegistration | undefined;
/**
 * Emit CRITICAL audit events for all registered providers with
 * unverified BAA claims. Call this at server boot after wiring the emitter.
 */
export declare function auditUnverifiedBaaClaims(emit: LlmAuditEmitter): void;
export declare abstract class BaseProviderAdapter implements LlmProviderAdapter {
    abstract readonly adapterId: string;
    abstract readonly providerId: string;
    protected config: LlmAdapterConfig | null;
    protected initialized: boolean;
    protected auditEmit: LlmAuditEmitter | null;
    /**
     * Initialize the adapter. Subclasses call super.initialize(config) then
     * perform provider-specific setup.
     *
     * Throws LlmAuthError synchronously if credentials are structurally
     * missing (e.g. no apiKey when the provider requires one).
     *
     * F-NEW-CRIT-32: when config.activePacks is non-empty, consults
     * ProviderCompliance.check() and refuses to initialize if this provider
     * is blocked by any active pack (e.g., DeepSeek under DORA, HIPAA, etc.).
     * Closes the gap where pack.providerPolicy.blockedProviders was dead data.
     */
    initialize(config: LlmAdapterConfig): void;
    /**
     * Wire an audit emitter. Called by the governance runtime after
     * initialization. Adapters emit events through this channel.
     */
    setAuditEmitter(emit: LlmAuditEmitter): void;
    protected ensureInitialized(): void;
    abstract chat(request: LlmChatRequest): Promise<LlmChatResponse>;
    abstract chatStream(request: LlmChatRequest): AsyncIterable<LlmStreamChunk>;
    abstract invokeToolUse(request: LlmToolUseRequest): Promise<LlmToolUseResponse>;
    abstract enumerateModels(): Promise<LlmModelDescriptor[]>;
    abstract translateError(raw: unknown): LlmProviderError;
    abstract getCapabilities(): LlmAdapterCapabilities;
    /**
     * Normalise token accounting from a response.
     * Subclasses may override if the provider returns additional fields.
     */
    accountTokens(response: LlmChatResponse | LlmToolUseResponse): LlmTokenAccounting;
    /**
     * Returns true if the registered compliance metadata for this provider
     * declares a BAA with valid attestation. Falls back to false if
     * unregistered or attestation is missing.
     */
    claimsBaa(): boolean;
    /**
     * Execute `fn` with the common retry policy.
     * Auth failures and model-not-found errors are NOT retried.
     */
    protected withRetry<T>(fn: () => Promise<T>, opts?: BackoffRetryOptions): Promise<T>;
    /**
     * Accumulate a streaming response into a single LlmChatResponse.
     */
    protected collectStream(request: LlmChatRequest): Promise<LlmChatResponse>;
    protected emit(event: Parameters<LlmAuditEmitter>[0]): void;
}
//# sourceMappingURL=base.d.ts.map