import type { ModelId, ProviderId } from './providers.js'; export declare const tokenAuthSourceTypes: readonly ["direct-token", "user-token", "workspace-token", "environment-token"]; export type TokenAuthSourceType = (typeof tokenAuthSourceTypes)[number]; export declare const accountTransportProviderIds: readonly ["codex", "cloud-code", "claude-code", "antigravity"]; export type AccountTransportProviderId = (typeof accountTransportProviderIds)[number]; export type AuthSourceType = TokenAuthSourceType | 'codex-account' | 'claude-code-account' | 'account-transport' | 'none'; export interface AuthDescriptor { sourceType: AuthSourceType; label?: string; accountProviderId?: AccountTransportProviderId | (string & {}); accountId?: string | null; accountLabel?: string | null; expiresAt?: string | null; hasRefreshToken?: boolean; redactedFingerprint?: string; metadata?: Record; } interface AuthMaterialBase { descriptor?: Partial; } export interface DirectTokenAuthMaterial extends AuthMaterialBase { type: 'direct-token'; token: string; label?: string; } export interface UserTokenAuthMaterial extends AuthMaterialBase { type: 'user-token'; userId: string; token?: string; tokenRef?: string; label?: string; } export interface WorkspaceTokenAuthMaterial extends AuthMaterialBase { type: 'workspace-token'; workspaceId: string; token?: string; tokenRef?: string; label?: string; } export interface EnvironmentTokenAuthMaterial extends AuthMaterialBase { type: 'environment-token'; envVar: string; token?: string; label?: string; } export interface CodexAccountAuthMaterial extends AuthMaterialBase { type: 'codex-account'; provider: 'codex'; accessToken: string; refreshToken?: string; idToken?: string; accountId?: string | null; accountLabel?: string | null; expiresAt?: string | null; } export interface AccountTransportAuthMaterial extends AuthMaterialBase { type: 'account-transport'; provider: AccountTransportProviderId | (string & {}); accessToken: string; refreshToken?: string; accountId?: string | null; accountLabel?: string | null; expiresAt?: string | null; headers?: Record; metadata?: Record; } export interface ClaudeCodeAccountAuthMaterial extends AuthMaterialBase { type: 'claude-code-account'; provider: 'claude-code'; accessToken: string; accountId?: string | null; accountLabel?: string | null; expiresAt?: string | null; } export interface PlannedAccountTransportAuthMaterial extends AuthMaterialBase { type: 'account-transport'; provider: AccountTransportProviderId | (string & {}); status: 'planned'; accessToken?: string; refreshToken?: string; accountId?: string | null; accountLabel?: string | null; headers?: Record; metadata?: Record; } export interface NoAuthMaterial extends AuthMaterialBase { type: 'none'; } export type SecretAuthMaterial = DirectTokenAuthMaterial | UserTokenAuthMaterial | WorkspaceTokenAuthMaterial | EnvironmentTokenAuthMaterial | CodexAccountAuthMaterial | ClaudeCodeAccountAuthMaterial | AccountTransportAuthMaterial | PlannedAccountTransportAuthMaterial | NoAuthMaterial; export type AuthSource = SecretAuthMaterial; export interface AuthResolutionRequest { providerId: ProviderId; modelId?: ModelId; userId?: string | null; workspaceId?: string | null; preferredSources?: readonly AuthSourceType[]; requestToken?: string | null; metadata?: Record; } export interface AuthResolution { material: SecretAuthMaterial; descriptor: AuthDescriptor; } export type AuthResolver = (request: AuthResolutionRequest) => AuthResolution | Promise; export type AuthInput = SecretAuthMaterial | AuthResolution; export declare const executableAccountTransportProviderIds: readonly ["codex", "cloud-code", "claude-code", "antigravity"]; export declare const getSecretAuthMaterial: (input?: AuthInput) => SecretAuthMaterial | undefined; export declare const describeAuthMaterial: (material: SecretAuthMaterial) => AuthDescriptor; export declare const getAuthDescriptor: (input?: AuthInput) => AuthDescriptor | undefined; export interface CloudCodeRuntimeMetadata { cloudaicompanionProject: string; cloudCodeUserAgentVersion: string; authClientConfigVersion: string; } export declare const isCloudCodeRuntimeMetadata: (m: unknown) => m is CloudCodeRuntimeMetadata; export {}; //# sourceMappingURL=auth.d.ts.map