/** * Credential storage and token refresh for subscription providers. * * Stores OAuth credentials in ~/.milady/auth/ as JSON files. */ import { type OAuthCredentials, type StoredCredentials, type SubscriptionProvider } from "./types"; /** * Save credentials for a provider. */ export declare function saveCredentials(provider: SubscriptionProvider, credentials: OAuthCredentials): void; /** * Load stored credentials for a provider. */ export declare function loadCredentials(provider: SubscriptionProvider): StoredCredentials | null; /** * Delete stored credentials for a provider. */ export declare function deleteCredentials(provider: SubscriptionProvider): void; /** * Check if credentials exist and are not expired. */ export declare function hasValidCredentials(provider: SubscriptionProvider): boolean; /** * Get a valid access token, refreshing if needed. * Returns null if no credentials stored or refresh fails. */ export declare function getAccessToken(provider: SubscriptionProvider): Promise; /** * Get all configured subscription providers and their status. */ export declare function getSubscriptionStatus(): Array<{ provider: SubscriptionProvider; configured: boolean; valid: boolean; expiresAt: number | null; }>; /** * Apply subscription credentials to the environment. * Called at startup to make credentials available to elizaOS plugins. * * When a `config` is provided and the active subscription provider has * credentials, `model.primary` is auto-set so the user doesn't need to * configure it manually. */ export declare function applySubscriptionCredentials(config?: { agents?: { defaults?: { subscriptionProvider?: string; model?: { primary?: string; }; }; }; }): Promise; //# sourceMappingURL=credentials.d.ts.map