export type ConfidentialInferenceHandler = (...args: never[]) => unknown; export interface ConfidentialInferenceRoute { readonly id: string; readonly endpoint: string; readonly model: string; readonly modelTypes: readonly string[]; } export interface ConfidentialInferenceProfile { readonly revision: string; readonly expiresAt: number; readonly routes: readonly ConfidentialInferenceRoute[]; } export interface ConfidentialInferenceAuditRecord { /** Shared across phases; sinks key records by (attemptId, phase), not attemptId alone. */ readonly attemptId: string; readonly agentId: string; readonly modelType: string; readonly policyRevision: string | null; readonly routeId: string | null; readonly timestamp: number; readonly phase: "dispatch_intent" | "response_headers" | "transport_error" | "denied"; readonly denialCode?: string; readonly status?: number; readonly evidenceDigest?: string; readonly connectionBindingDigest?: string; } export interface ConfidentialInferenceTransportEvidence { readonly evidenceDigest: string; readonly connectionBindingDigest: string; } /** Only a measured host transport may produce this verified pre-send callback. */ export type ConfidentialInferenceTransport = (input: string, init: RequestInit, context: { readonly route: ConfidentialInferenceRoute; readonly policyRevision: string; beforeDispatch(evidence: ConfidentialInferenceTransportEvidence): Promise; }) => Promise; /** One runtime call owns this state across SDK retries and provider failover. */ export declare class ConfidentialInferenceOperation { #private; authorizeOnce(): boolean; } /** Host implementation must resolve only after its same-agent durable commit. */ export interface ConfidentialInferenceAuditSink { append(record: ConfidentialInferenceAuditRecord): Promise; } export interface ConfidentialInferenceAuthorityOptions { /** Exact trusted handler identities; a provider name cannot impersonate one. */ readonly handlers: readonly ConfidentialInferenceHandler[]; /** Read current server-owned policy on every handler and HTTP attempt. */ readonly currentProfile: () => ConfidentialInferenceProfile; readonly audit: ConfidentialInferenceAuditSink; readonly transport?: ConfidentialInferenceTransport; readonly redispatchPolicy?: "deny-after-authorization"; } /** Construct only from measured host configuration, never request/settings data. */ export declare class ConfidentialInferenceAuthority { #private; readonly transport: ConfidentialInferenceTransport | undefined; readonly deniesRedispatch: boolean; constructor(options: ConfidentialInferenceAuthorityOptions); profile(): ConfidentialInferenceProfile; acceptsHandler(handler: ConfidentialInferenceHandler): boolean; record(record: ConfidentialInferenceAuditRecord, dispatched: boolean): Promise; } export declare function runWithConfidentialInference(authority: ConfidentialInferenceAuthority | undefined, context: { agentId: string; modelType: string; handler: ConfidentialInferenceHandler; operation?: ConfidentialInferenceOperation; }, run: () => T): Promise>; /** * Provider transport calls this immediately before the real HTTP operation. * Normal mode preserves the existing fetch arguments. Confidential mode admits * the actual endpoint and wire model, rejects redirects, and commits metadata * before dispatch. Response headers are not proof of completed streaming. */ export declare function fetchWithConfidentialInference(input: Parameters[0], init: Parameters[1], transport: typeof fetch): Promise;