/**
 * Server-side OAuth handler for the gateway.
 * Generates PKCE server-side, returns auth URL to the client,
 * then exchanges the authorization code for tokens.
 * Stores credentials in ~/.bobbit/agent/auth.json for the coding agent.
 */
export type OAuthProviderId = "anthropic" | "openai-codex";
/** Stop the periodic cleanup timer (test-only). */
export declare function stopFlowCleanup(): void;
/**
 * Start an OAuth flow. Returns the authorization URL and a flow ID.
 */
export declare function oauthStart(providerInput?: string): Promise<{
    flowId: string;
    url: string;
    provider: OAuthProviderId;
    callbackServer?: boolean;
    instructions?: string;
}>;
/**
 * Complete an OAuth flow. Exchanges the authorization code for tokens
 * and stores them in ~/.bobbit/agent/auth.json.
 */
export declare function oauthComplete(flowId: string, authCode: string): Promise<{
    success: boolean;
    error?: string;
}>;
/**
 * Check if OAuth credentials exist and are valid (not expired).
 */
export declare function oauthStatus(providerInput?: string): {
    authenticated: boolean;
    expires?: number;
    provider: OAuthProviderId;
};
export declare function oauthFlowStatus(flowId: string, providerInput?: string): {
    complete: boolean;
    error?: string;
};
/**
 * Refresh the OAuth access token using the stored refresh token.
 * Updates ~/.bobbit/agent/auth.json with the new credentials.
 * Returns the new access token, or null if refresh fails.
 */
export declare function refreshOAuthToken(): Promise<string | null>;
//# sourceMappingURL=oauth.d.ts.map