import { SecureStoreUnavailableError, type TokenRefreshOptions } from '@doist/cli-core/auth'; import type { CommsAccount } from './auth-provider.js'; import { type AuthMode } from './config.js'; import { CliError } from './errors.js'; export { SecureStoreUnavailableError }; export declare const TOKEN_ENV_VAR = "COMMS_API_TOKEN"; export declare const SECURE_STORE_DESCRIPTION = "system credential manager"; export type TokenStorageLocation = 'secure-store' | 'config-file'; export type TokenStorageResult = { storage: TokenStorageLocation; warning?: string; }; export type AuthMetadata = { authMode: AuthMode; authResource?: string; authScope?: string; authUserId?: number; authUserName?: string; source: 'env' | 'config'; }; export type AuthProbeMetadata = { authMode: AuthMode; authResource?: string; authScope?: string; authUserId?: number; authUserName?: string; source: 'env' | 'config-file' | 'secure-store'; }; export type AuthProbeResult = { token: string; metadata: AuthProbeMetadata; }; export type AuthProbeOptions = { refresh?: boolean; }; export type ActiveAuthSnapshot = { token: string; account: CommsAccount; }; /** * Refresh wiring for cli-core's `auth status` / `auth token view` attachers, * so both hand back a token that is usable right now rather than whatever * was last stored. The handshake is resolved per account because cli-core * doesn't persist the OAuth client metadata the refresh grant needs. */ export declare function getTokenRefreshOptions(): TokenRefreshOptions; export declare class NoTokenError extends CliError { constructor(); } /** Read the active token. The store wraps env-var precedence internally. */ export declare function getApiToken(): Promise; export declare function getApiTokenSnapshot(ref?: string): Promise; /** Token + metadata in one round-trip for `tdc config view` / `tdc doctor`. */ export declare function probeApiToken(options?: AuthProbeOptions): Promise; /** Auth metadata for `tdc auth status` and `ensureWriteAllowed`. */ export declare function getAuthMetadata(): Promise; //# sourceMappingURL=auth.d.ts.map