import type { ModelCapability, NormalizedResponse, GatewayRequest } from "@oscharko-dev/keiko-contracts";
import type { GroundingLimits } from "@oscharko-dev/keiko-contracts/bff-wire";
export type { ModelKind, CostClass, LatencyClass, ModelCapability, ChatMessage, ToolDefinition, ResponseFormat, GatewayRequest, NormalizedToolCall, UsageMetadata, NormalizedResponse, FinishReason, StreamDelta, StreamEvent, } from "@oscharko-dev/keiko-contracts";
export { CONVERSATION_CAPABILITY_CONTRACT_VERSION } from "@oscharko-dev/keiko-contracts";
export interface ModelProviderConfig {
    readonly modelId: string;
    readonly baseUrl: string;
    readonly apiKey: string;
    readonly apiKeyHeaderName?: string | undefined;
    readonly timeoutMs: number;
    readonly maxRetries: number;
    readonly retryBaseDelayMs: number;
    readonly egress?: OutboundHttpEgressConfig | undefined;
}
export interface OutboundHttpEgressConfig {
    readonly httpProxy?: string | undefined;
    readonly httpsProxy?: string | undefined;
    readonly noProxy?: readonly string[] | undefined;
    readonly caBundlePath?: string | undefined;
}
export interface CircuitBreakerConfig {
    readonly failureThreshold: number;
    readonly cooldownMs: number;
    readonly halfOpenProbes: number;
}
export interface GatewayConfig {
    readonly providers: readonly ModelProviderConfig[];
    readonly circuitBreaker: CircuitBreakerConfig;
    readonly capabilities?: readonly ModelCapability[] | undefined;
    readonly grounding?: Partial<GroundingLimits> | undefined;
    readonly egress?: OutboundHttpEgressConfig | undefined;
}
export type GatewayStreamChunk = {
    readonly type: "delta";
    readonly token: string;
} | {
    readonly type: "done";
    readonly response: NormalizedResponse;
};
export interface ProviderAdapter {
    readonly call: (request: GatewayRequest, config: ModelProviderConfig) => Promise<NormalizedResponse>;
    readonly callStream?: (request: GatewayRequest, config: ModelProviderConfig) => AsyncIterable<GatewayStreamChunk>;
}
export interface Clock {
    readonly now: () => number;
    readonly sleep: (ms: number, signal?: AbortSignal) => Promise<void>;
}
export type CircuitState = "closed" | "open" | "half-open";
export interface CircuitBreakerStatus {
    readonly modelId: string;
    readonly state: CircuitState;
    readonly consecutiveFailures: number;
    readonly openedAt: number | null;
}
//# sourceMappingURL=types.d.ts.map