import type { AuthEnvelope } from "../../authProfileLayer/authEnvelope.js";
export declare const ANTHROPIC_V1_MESSAGES_ENDPOINT: "/v1/messages";
export type AnthropicV1MessagesMethod = "GET" | "POST" | "PATCH" | "DELETE";
export type AnthropicV1MessagesGate = {
    accepted: boolean;
    reason?: string;
};
export type AnthropicV1MessagesRuntimeContext = {
    runtimeId?: string;
    correlationId?: string;
    callerId?: string;
};
export type AnthropicV1MessagesAuthEnvelope = {
    kind: "api-key" | "bearer" | "none";
    present: boolean;
    redactedToken?: string;
};
export type AnthropicV1MessagesRequestEnvelope = {
    provider: "anthropic";
    apiVersion: "v1";
    endpoint: typeof ANTHROPIC_V1_MESSAGES_ENDPOINT;
    operation: string;
    method: AnthropicV1MessagesMethod;
    urlPath: string;
    query: Readonly<Record<string, string>>;
    headers: Readonly<Record<string, string>>;
    body?: unknown;
    runtime: Required<AnthropicV1MessagesRuntimeContext>;
    requestedScopes: readonly string[];
    grantedScopes: readonly string[];
    dryRun: boolean;
    unsafeSideEffects: false;
    providerFieldsOpaque: true;
};
export type AnthropicV1MessagesProviderCaller = (envelope: AnthropicV1MessagesRequestEnvelope) => unknown | Promise<unknown>;
export type AnthropicV1MessagesInvocationRequest = {
    operation?: string;
    method?: AnthropicV1MessagesMethod;
    pathSuffix?: string;
    query?: Readonly<Record<string, string | number | boolean | undefined>>;
    headers?: Readonly<Record<string, string | undefined>>;
    body?: unknown;
    auth?: AnthropicV1MessagesAuthEnvelope | AuthEnvelope;
    runtime?: AnthropicV1MessagesRuntimeContext;
    requiredScopes?: readonly string[];
    allowedScopes?: readonly string[];
    contract?: AnthropicV1MessagesGate;
    governance?: AnthropicV1MessagesGate;
    dryRun?: boolean;
    mockResponse?: unknown;
    expectResponseObject?: boolean;
    caller?: AnthropicV1MessagesProviderCaller;
};
export type AnthropicV1MessagesErrorCode = "MISSING_OPERATION" | "MISSING_RUNTIME_ID" | "CONTRACT_REJECTED" | "GOVERNANCE_REJECTED" | "SCOPE_DENIED" | "AUTH_REJECTED" | "CALLER_REQUIRED" | "PROVIDER_AUTH_FAILED" | "PROVIDER_RATE_LIMITED" | "PROVIDER_TIMEOUT" | "PROVIDER_UNAVAILABLE" | "RESPONSE_FORMAT_DRIFT" | "CALLER_FAILED";
export type AnthropicV1MessagesError = {
    code: AnthropicV1MessagesErrorCode;
    message: string;
    boundary: "input" | "contract" | "governance" | "auth" | "scope" | "provider";
    retryable: boolean;
};
export type AnthropicV1MessagesProviderResponseEnvelope = {
    provider: "anthropic";
    endpoint: typeof ANTHROPIC_V1_MESSAGES_ENDPOINT;
    mode: "dry-run" | "mock" | "caller";
    raw: unknown;
    usage?: AnthropicV1MessagesUsage;
    providerFieldsOpaque: true;
};
export type AnthropicV1MessagesUsage = {
    source: "anthropic.messages.usage";
    inputTokens?: number;
    outputTokens?: number;
    totalTokens?: number;
    cachedInputTokens?: number;
    estimated: false;
};
export type AnthropicV1MessagesInvocationResult = {
    ok: true;
    request: AnthropicV1MessagesRequestEnvelope;
    response: AnthropicV1MessagesProviderResponseEnvelope;
    events: readonly string[];
} | {
    ok: false;
    error: AnthropicV1MessagesError;
    request?: AnthropicV1MessagesRequestEnvelope;
    events: readonly string[];
};
export declare function extractAnthropicV1MessagesUsage(raw: unknown): AnthropicV1MessagesUsage | undefined;
export declare function classifyAnthropicV1MessagesProviderError(error: unknown): AnthropicV1MessagesErrorCode;
export declare function invokeAnthropicV1Messages(input?: AnthropicV1MessagesInvocationRequest): Promise<AnthropicV1MessagesInvocationResult>;
