/** * Host-side bridge between the Models-page companion UI and DSH's neutral * authorization, credential-record, and settings seams. */ import { Context } from '@deepseek-ai/cordis'; import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol'; import { type GitHubCopilotMigrationStatus } from './migration-status.ts'; export { GITHUB_COPILOT_CREDENTIAL_KEY, GITHUB_COPILOT_PROVIDER_ID } from './copilot-identity.ts'; export declare const LLM_PI_AI_SETTINGS_NAMESPACE = "llm-pi-ai"; export type GitHubCopilotModelCatalogState = 'current' | 'partially-outdated' | 'outdated'; export interface GitHubCopilotModelCatalogView { readonly state: GitHubCopilotModelCatalogState; readonly accountModelCount: number; readonly supportedModelCount: number; readonly unknownModelIds: readonly string[]; readonly temporarilyUnavailableModelIds?: readonly string[]; /** Exact models served by the plugin-owned route, not canonical Core metadata. */ readonly previewModelIds?: readonly string[]; } export interface GitHubCopilotProviderProfileResult { readonly changed: boolean; /** Legacy result field retained for consumers; canonical repair does not project a catalog. */ readonly catalog?: GitHubCopilotModelCatalogView; } export interface AuthorizationNoticeView { readonly message: string; readonly url?: string; readonly code?: string; } export type GitHubCopilotAuthorizationPhase = 'signed-out' | 'authorizing' | 'signed-in' | 'error'; export interface GitHubCopilotRouteView { /** Legacy canonical configuration only; intentional absence is not an OAuth or managed-route failure. */ readonly state: 'ready' | 'needs-repair' | 'not-configured' | 'conflict' | 'error'; readonly diagnosticCode?: 'ROUTE_READ_FAILED' | 'RECONCILIATION_FAILED' | 'ROUTE_CONFLICT'; } export interface GitHubCopilotAccountModelsView { readonly state: 'idle' | 'loading' | 'ready' | 'stale' | 'error' | 'disposed' | 'unconfigured' | 'unavailable'; readonly models: readonly { readonly id: string; readonly name: string; readonly api: string; }[]; readonly rejected: readonly { readonly id?: string; readonly code: string; }[]; readonly warnings?: readonly { readonly id: string; readonly code: string; }[]; readonly discoveredAt?: number; readonly error?: string; } export interface GitHubCopilotModelPreferencesView { readonly state: 'ready' | 'error'; readonly writable: boolean; readonly revision?: number; readonly excludedModelIds: readonly string[]; readonly lockedModelIds: readonly string[]; readonly unavailableExcludedModelIds: readonly string[]; readonly highCostModelIds?: readonly string[]; readonly error?: 'COPILOT_MODEL_PREFERENCES_UNAVAILABLE' | 'COPILOT_MODEL_EXCLUSION_SELECTED' | 'COPILOT_MODEL_EXCLUSION_CONFLICT' | 'COPILOT_MODEL_EXCLUSION_SAVE_FAILED' | 'COPILOT_MODEL_SETTINGS_UNAVAILABLE' | 'COPILOT_MODEL_SETTINGS_INVALID' | 'COPILOT_MODEL_SELECTION_UNAVAILABLE'; } export interface GitHubCopilotAuthorizationView { readonly phase: GitHubCopilotAuthorizationPhase; readonly configured: boolean; readonly writable: boolean; readonly inFlight: boolean; readonly notices: readonly AuthorizationNoticeView[]; readonly catalog?: GitHubCopilotModelCatalogView; readonly route?: GitHubCopilotRouteView; readonly accountModels?: GitHubCopilotAccountModelsView; readonly modelPreferences?: GitHubCopilotModelPreferencesView; readonly error?: string; /** Latest fixed interaction milestone observed during a failed or active attempt; never a failure cause. */ readonly authorizationMilestone?: GitHubCopilotAuthorizationMilestone; } export type GitHubCopilotAuthorizationMilestone = 'AUTHORIZATION_REQUESTED' | 'INTERACTION_PROMPT_OBSERVED' | 'INTERACTION_NOTICE_OBSERVED'; /** Read-only legacy configuration planning; not-configured permits managed-only use and never requests creation. */ export declare function describeGitHubCopilotProviderProfile(ctx: Context): Promise<{ state: 'ready' | 'needs-repair' | 'not-configured' | 'conflict'; catalog?: GitHubCopilotModelCatalogView; }>; export declare function inspectGitHubCopilotProviderProfile(ctx: Context): Promise; export declare function ensureGitHubCopilotProviderProfile(ctx: Context): Promise; /** * Remote owner for the browser companion. No credential payload crosses this * service: status uses record descriptions, sign-in delegates to the * registered llm-pi-ai flow, and sign-out asks the credential seam to delete * only llm-pi-ai's Copilot record. */ export declare class GitHubCopilotAuthorizationController extends TypertRemoteService { private notices; private failure; private reconciliationFailed; private attempt; private authorizationMilestone; private modelPreferenceFailure; constructor(ctx: Context); /** No-argument Ops evidence; deliberately independent of ordinary account status. */ migrationStatus(): GitHubCopilotMigrationStatus; status(): Promise; excludeModel(modelId: string): Promise; restoreModel(modelId: string): Promise; setModelExcluded(modelId: string, excluded: boolean): Promise; setModelHighCost(modelId: string, highCost: boolean): Promise; /** Explicit model discovery: may refresh OAuth and GET the account catalog, never changes selection. */ discoverModels(): Promise; /** Ensure metadata for a visible account view, honoring shared cache and failure cooldown. */ ensureModels(): Promise; private loadAccountModels; /** Explicit route repair over the stored account snapshot; never forces OAuth or a network probe. */ reconcile(): Promise; start(): Promise; cancel(): Promise; signOut(): Promise; private updateModelExclusion; private ensureProviderProfile; } export default GitHubCopilotAuthorizationController; //# sourceMappingURL=authorization-controller.d.ts.map