/** Terminal adapter over the Harness provider-authorization and credential-record seams. */ import type { Context } from '@deepseek-ai/cordis'; import type { AuthorizationEntry, AuthorizationInteraction, AuthorizationMethod, AuthorizationStatus } from '@deepseek-ai/dsh-authorization'; import { type CredentialKey, type CredentialRecordInfo } from '@deepseek-ai/dsh-credentials'; /** One provider login flow joined with its value-free stored-record facts. */ export interface ProviderAuthorizationRow { readonly key: CredentialKey; readonly provider: string; readonly label: string; readonly methods: readonly AuthorizationMethod[]; readonly inFlight: boolean; readonly record: CredentialRecordInfo; } /** The provider-login directory plus non-fatal record lookup failures. */ export interface ProviderAuthorizationDirectory { readonly rows: readonly ProviderAuthorizationRow[]; readonly failures: readonly string[]; } /** Load only model-provider flows; unrelated future authorization domains stay out of `/model`. */ export declare function loadProviderAuthorizations(ctx: Context): Promise; /** Subscribe to login settlement and credential-record changes. */ export declare function subscribeProviderAuthorizations(ctx: Context, listener: () => void): () => void; /** Begin one provider login through the interaction surface owned by the caller. */ export declare function beginProviderAuthorization(ctx: Context, row: Pick, method: string, interaction: AuthorizationInteraction, signal?: AbortSignal): Promise; /** Cancel the attempt currently serving this provider, if any. */ export declare function cancelProviderAuthorization(ctx: Context, key: CredentialKey): void; /** Remove an authorization record without changing the provider's settings profile. */ export declare function logoutProviderAuthorization(ctx: Context, row: ProviderAuthorizationRow): Promise; /** Open an authorization URL with the platform default browser, without invoking a shell. */ export declare function openAuthorizationUrl(raw: string): boolean; /** Compact value-free status for the provider list. */ export declare function providerAuthorizationStatus(row: ProviderAuthorizationRow | undefined): string; /** Find a provider's login flow from a previously loaded directory. */ export declare function authorizationForProvider(directory: ProviderAuthorizationDirectory | undefined, provider: string): ProviderAuthorizationRow | undefined; /** Preserve the upstream entry type in declarations without leaking service internals into the TUI. */ export type { AuthorizationEntry };