export declare const OPENAI_V1_THREADS_ENDPOINT: "/v1/threads";
export declare const DEFAULT_OPENAI_V1_THREADS_BASE_URL: "https://api.openai.com";
export type OpenAIV1ThreadsMethod = "GET" | "POST" | "PATCH" | "DELETE";
export type OpenAIV1ThreadsBoundary = "input" | "contract" | "governance" | "auth" | "scope" | "provider" | "response";
export type OpenAIV1ThreadsErrorCode = "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 OpenAIV1ThreadsGate = {
    accepted: boolean;
    reason?: string;
};
export type OpenAIV1ThreadsRuntimeContext = {
    runtimeId?: string;
    invocationId?: string;
    traceId?: string;
    callerId?: string;
};
export type OpenAIV1ThreadsAuthEnvelope = {
    kind: "bearer" | "api-key" | "none";
    present: boolean;
    redactedToken?: string;
};
export type OpenAIV1ThreadsRequestEnvelope = {
    provider: "openai";
    apiVersion: "v1";
    endpoint: typeof OPENAI_V1_THREADS_ENDPOINT;
    operation: string;
    method: OpenAIV1ThreadsMethod;
    url: string;
    pathSuffix: string;
    query: Readonly<Record<string, string>>;
    headers: Readonly<Record<string, string>>;
    body?: unknown;
    runtime: Required<OpenAIV1ThreadsRuntimeContext>;
    requestedScopes: readonly string[];
    grantedScopes: readonly string[];
    dryRun: boolean;
    providerCallPlanned: boolean;
    unsafeSideEffects: false;
    providerFieldsOpaque: true;
};
export type OpenAIV1ThreadsProviderCaller = (envelope: OpenAIV1ThreadsRequestEnvelope) => unknown | Promise<unknown>;
export type OpenAIV1ThreadsInvocationRequest = {
    operation?: string;
    method?: OpenAIV1ThreadsMethod;
    pathSuffix?: string;
    query?: Readonly<Record<string, string | number | boolean | undefined>>;
    headers?: Readonly<Record<string, string | undefined>>;
    body?: unknown;
    baseUrl?: string;
    auth?: OpenAIV1ThreadsAuthEnvelope;
    runtime?: OpenAIV1ThreadsRuntimeContext;
    requiredScopes?: readonly string[];
    allowedScopes?: readonly string[];
    contract?: OpenAIV1ThreadsGate;
    governance?: OpenAIV1ThreadsGate;
    dryRun?: boolean;
    mockResponse?: unknown;
    expectResponseObject?: boolean;
    caller?: OpenAIV1ThreadsProviderCaller;
};
export type OpenAIV1ThreadsResponseEnvelope = {
    provider: "openai";
    endpoint: typeof OPENAI_V1_THREADS_ENDPOINT;
    mode: "dry-run" | "mock" | "caller";
    raw: unknown;
    providerFieldsOpaque: true;
};
export type OpenAIV1ThreadsCapabilitySignal = {
    provider: "openai";
    endpoint: typeof OPENAI_V1_THREADS_ENDPOINT;
    operation: string;
    rawShape: "thread-object" | "thread-list" | "mock" | "dry-run";
};
export type OpenAIV1ThreadsError = {
    code: OpenAIV1ThreadsErrorCode;
    message: string;
    boundary: OpenAIV1ThreadsBoundary;
    retryable: boolean;
};
export type OpenAIV1ThreadsResult = {
    ok: true;
    request: OpenAIV1ThreadsRequestEnvelope;
    response: OpenAIV1ThreadsResponseEnvelope;
    capability: OpenAIV1ThreadsCapabilitySignal;
    events: readonly string[];
} | {
    ok: false;
    error: OpenAIV1ThreadsError;
    request?: OpenAIV1ThreadsRequestEnvelope;
    events: readonly string[];
};
export declare function classifyOpenAIV1ThreadsProviderError(error: unknown): OpenAIV1ThreadsErrorCode;
export declare function invokeOpenAIV1Threads(input?: OpenAIV1ThreadsInvocationRequest): Promise<OpenAIV1ThreadsResult>;
