import { McpTokenExchangeResult } from "@inkeep/agents-core";

//#region src/utils/oauthService.d.ts

/**
 * Retrieve and remove PKCE verifier
 */
declare function retrievePKCEVerifier(state: string): {
  codeVerifier: string;
  toolId: string;
  tenantId: string;
  projectId: string;
  userId?: string;
  clientInformation: any;
  metadata: any;
  resourceUrl?: string;
} | null;
/**
 * OAuth client configuration
 */
interface OAuthClientConfig {
  defaultClientId?: string;
  clientName?: string;
  clientUri?: string;
  logoUri?: string;
  redirectBaseUrl?: string;
}
/**
 * OAuth flow initiation result
 */
interface OAuthInitiationResult {
  redirectUrl: string;
  state: string;
}
/**
 * Token exchange result
 */
interface TokenExchangeResult {
  tokens: McpTokenExchangeResult;
}
/**
 * OAuth service class that handles the complete OAuth flow
 */
declare class OAuthService {
  private defaultConfig;
  constructor(config?: OAuthClientConfig);
  /**
   * Initiate OAuth flow for an MCP tool using MCP SDK
   */
  initiateOAuthFlow(params: {
    tenantId: string;
    projectId: string;
    toolId: string;
    userId?: string;
    mcpServerUrl: string;
    baseUrl?: string;
  }): Promise<OAuthInitiationResult>;
  /**
   * Exchange authorization code for access tokens using MCP SDK with stored metadata
   */
  exchangeCodeForTokens(params: {
    code: string;
    codeVerifier: string;
    clientInformation: any;
    metadata: any;
    resourceUrl?: string;
    mcpServerUrl: string;
    baseUrl?: string;
  }): Promise<TokenExchangeResult>;
}
declare const oauthService: OAuthService;
//#endregion
export { oauthService, retrievePKCEVerifier };