import { type CryptoKey, type JWK } from 'jose'; export interface OAuthAuthorizationServerMetadata { issuer: string; authorization_endpoint: string; token_endpoint: string; jwks_uri: string; revocation_endpoint: string; pushed_authorization_request_endpoint: string; require_pushed_authorization_requests: true; response_types_supported: string[]; grant_types_supported: string[]; code_challenge_methods_supported: string[]; authorization_response_iss_parameter_supported: true; dpop_signing_alg_values_supported: string[]; token_endpoint_auth_methods_supported: string[]; revocation_endpoint_auth_methods_supported: string[]; } export interface OAuthAgentClientOptions { issuer: string; clientId: string; redirectUri: string; resource: string; privateKey?: CryptoKey; publicJwk?: JWK; allowInsecureLoopback?: boolean; } export interface OAuthAgentKeyPair { privateKey: CryptoKey; publicJwk: JWK; thumbprint: string; } export declare function generateOAuthAgentKey(): Promise; export interface BeginAgentAuthorizationOptions { scopes: string[]; principalHint?: string; authorizationDetails?: Array>; } export interface PendingAgentAuthorization { authorizationUrl: string; requestUri: string; state: string; expiresIn: number; } export interface OAuthAgentTokenResponse { access_token: string; token_type: 'DPoP'; expires_in: number; refresh_token?: string; scope: string; issued_token_type?: string; refresh_replay?: boolean; } export interface OAuthAgentRefreshOptions { /** * Stable 16-256 character key used to recover a committed refresh response. * Persist this with the old refresh token when recovery must survive a * caller restart. The client reuses an automatically generated key for five * minutes while this instance remains alive. */ idempotencyKey?: string; } export declare class OAuthAgentClient { #private; readonly metadata: OAuthAuthorizationServerMetadata; readonly clientId: string; readonly redirectUri: string; readonly resource: string; readonly publicJwk: JWK; readonly keyThumbprint: string; private constructor(); static create(options: OAuthAgentClientOptions): Promise; beginAuthorization(options: BeginAgentAuthorizationOptions): Promise; completeAuthorization(callbackUrl: string): Promise; refresh(refreshToken: string, options?: OAuthAgentRefreshOptions): Promise; attenuate(accessToken: string, scopes: string[]): Promise; revoke(token: string, tokenTypeHint?: 'access_token' | 'refresh_token'): Promise; fetch(input: string | URL, accessToken: string, init?: RequestInit): Promise; createDpopProof(method: string, targetUri: string, accessToken?: string): Promise; tokenRequest(params: URLSearchParams, options?: { idempotencyKey?: string; }): Promise; } //# sourceMappingURL=oauth-agent.d.ts.map