export interface OAuthProviderConfig {
    readonly authUrl: string;
    readonly tokenUrl: string;
    readonly clientId: string;
    readonly redirectUri: string;
    readonly manualRedirectUri?: string | undefined;
    readonly scopes?: readonly string[] | undefined;
    readonly audience?: string | undefined;
    readonly usePkce?: boolean | undefined;
    readonly authParams?: Readonly<Record<string, string>> | undefined;
    readonly tokenRequestEncoding?: 'form' | 'json' | undefined;
    readonly includeStateInTokenRequest?: boolean | undefined;
    readonly tokenRequestExtras?: Readonly<Record<string, string | number | boolean>> | undefined;
    readonly refreshRequestEncoding?: 'form' | 'json' | undefined;
    readonly refreshRequestExtras?: Readonly<Record<string, string | number | boolean>> | undefined;
    readonly refreshScopes?: readonly string[] | undefined;
    readonly overrideAmbientApiKeys?: boolean | undefined;
    readonly localCallback?: {
        readonly host?: string | undefined;
        readonly port?: number | undefined;
        readonly path?: string | undefined;
        readonly autoComplete?: boolean | undefined;
    };
}
export interface PendingSubscriptionLogin {
    readonly provider: string;
    readonly state: string;
    readonly verifier: string;
    readonly redirectUri: string;
    readonly createdAt: number;
}
export interface ProviderSubscription {
    readonly provider: string;
    readonly accessToken: string;
    readonly refreshToken?: string | undefined;
    readonly tokenType: string;
    readonly expiresAt?: number | undefined;
    readonly scopes?: readonly string[] | undefined;
    readonly authMode: 'oauth';
    readonly overrideAmbientApiKeys: boolean;
    readonly createdAt: number;
    readonly updatedAt: number;
}
/**
 * SubscriptionManager — OAuth flows for **provider subscriptions**.
 *
 * Manages OAuth-based subscriptions to external AI providers (OpenAI,
 * Anthropic, Gemini, etc.) including authorization URL generation, code
 * exchange, token refresh, and persisting credentials to disk.
 *
 * This class handles provider-subscription OAuth on behalf of the daemon.
 * For OAuth flows that authenticate the SDK client with the goodvibes daemon
 * itself, see {@link OAuthClient} in `../runtime/auth/oauth-client.ts`.
 *
 * @see OAuthClient — OAuth flows for daemon authentication.
 */
export declare class SubscriptionManager {
    private readonly path;
    constructor(path: string);
    private read;
    private write;
    list(): ProviderSubscription[];
    listPending(): PendingSubscriptionLogin[];
    get(provider: string): ProviderSubscription | null;
    getAccessToken(provider: string): string | null;
    resolveAccessToken(provider: string, config: OAuthProviderConfig): Promise<string | null>;
    beginOAuthLogin(provider: string, config: OAuthProviderConfig): Promise<{
        authorizationUrl: string;
        pending: PendingSubscriptionLogin;
    }>;
    completeOAuthLogin(provider: string, config: OAuthProviderConfig, code: string): Promise<ProviderSubscription>;
    refreshOAuthToken(provider: string, config: OAuthProviderConfig): Promise<ProviderSubscription>;
    logout(provider: string): boolean;
    getPending(provider: string): PendingSubscriptionLogin | null;
    savePending(pending: PendingSubscriptionLogin): void;
    clearPending(provider: string): void;
    saveSubscription(subscription: ProviderSubscription): ProviderSubscription;
}
//# sourceMappingURL=subscriptions.d.ts.map