import { OAuthClientProvider } from "@modelcontextprotocol/sdk/client/auth.js";
import {
  OAuthClientInformation,
  OAuthClientInformationFull,
  OAuthClientMetadata,
  OAuthTokens
} from "@modelcontextprotocol/sdk/shared/auth.js";

//#region src/mcp/do-oauth-client-provider.d.ts
interface AgentsOAuthProvider extends OAuthClientProvider {
  authUrl: string | undefined;
  clientId: string | undefined;
  serverId: string | undefined;
  checkState(state: string): Promise<{
    valid: boolean;
    serverId?: string;
    error?: string;
  }>;
  consumeState(state: string): Promise<void>;
  deleteCodeVerifier(): Promise<void>;
}
declare class DurableObjectOAuthClientProvider implements AgentsOAuthProvider {
  storage: DurableObjectStorage;
  clientName: string;
  baseRedirectUrl: string;
  private _authUrl_;
  private _serverId_;
  private _clientId_;
  constructor(
    storage: DurableObjectStorage,
    clientName: string,
    baseRedirectUrl: string
  );
  get clientMetadata(): OAuthClientMetadata;
  get clientUri(): string;
  get redirectUrl(): string;
  get clientId(): string;
  set clientId(clientId_: string);
  get serverId(): string;
  set serverId(serverId_: string);
  keyPrefix(clientId: string): string;
  clientInfoKey(clientId: string): string;
  clientInformation(): Promise<OAuthClientInformation | undefined>;
  saveClientInformation(
    clientInformation: OAuthClientInformationFull
  ): Promise<void>;
  tokenKey(clientId: string): string;
  tokens(): Promise<OAuthTokens | undefined>;
  saveTokens(tokens: OAuthTokens): Promise<void>;
  get authUrl(): string | undefined;
  stateKey(nonce: string): string;
  state(): Promise<string>;
  checkState(state: string): Promise<{
    valid: boolean;
    serverId?: string;
    error?: string;
  }>;
  consumeState(state: string): Promise<void>;
  redirectToAuthorization(authUrl: URL): Promise<void>;
  invalidateCredentials(
    scope: "all" | "client" | "tokens" | "verifier"
  ): Promise<void>;
  codeVerifierKey(clientId: string): string;
  saveCodeVerifier(verifier: string): Promise<void>;
  codeVerifier(): Promise<string>;
  deleteCodeVerifier(): Promise<void>;
}
//#endregion
export { DurableObjectOAuthClientProvider as n, AgentsOAuthProvider as t };
//# sourceMappingURL=do-oauth-client-provider-BqnOQzjy.d.ts.map
