import { ICopilotTokenInfo, IDefaultAccount, IDefaultAccountAuthenticationProvider, IPolicyData } from "../../../base/common/defaultAccount.js"; import { Event } from "../../../base/common/event.js"; import { IManagedSettingsFreshness, MANAGED_SETTINGS_FRESHNESS_NOT_REQUIRED } from "../../policy/common/managedSettingsFreshness.js"; /** * Well-known GitHub URL paths used with {@link IDefaultAccountService.resolveGitHubUrl}. */ export declare const GitHubPaths: { readonly copilotSettings: "settings/copilot/features"; readonly billingBudgets: "settings/copilot/features?utm_source=vscode"; readonly copilotUpgrade: "github-copilot/upgrade?utm_source=vscode"; }; /** * Outcome of the last `/copilot_internal/managed_settings` fetch. * - A numeric HTTP status code indicates the server responded with that code. * - `'ok'`: response parsed and adapted successfully (including an empty `{}` body). * - `'no-url'`: no `managedSettingsUrl` configured in product.json. * - `'no-response'`: network error, all sessions rejected, or active rate-limit backoff. * - `'parse-error'`: response received but JSON parsing failed. * - `null`: never fetched. */ export type ManagedSettingsFetchStatus = number | "ok" | "no-url" | "no-response" | "parse-error" | null; export declare const MANAGED_SETTINGS_UPDATE_REQUIRED_ERROR_CODE = "client_update_required"; export interface IManagedSettingsCompatibilityError { readonly errorCode: typeof MANAGED_SETTINGS_UPDATE_REQUIRED_ERROR_CODE; readonly clientVersion?: string; readonly minimumClientVersion?: string; } export interface IDefaultAccountRefreshOptions { readonly forceRefresh?: boolean; /** Refreshes entitlement data even when its cache is fresh. */ readonly refreshEntitlements?: boolean; /** Allows an explicit user action to retry managed settings after a failed attempt. */ readonly retryManagedSettings?: boolean; } export interface IDefaultAccountProvider { readonly defaultAccount: IDefaultAccount | null; readonly onDidChangeDefaultAccount: Event; readonly policyData: IPolicyData | null; readonly onDidChangePolicyData: Event; readonly copilotTokenInfo: ICopilotTokenInfo | null; readonly onDidChangeCopilotTokenInfo: Event; readonly managedSettingsFetchStatus: ManagedSettingsFetchStatus; /** Timestamp (ms) of the last managed-settings fetch, or `null` if never fetched. */ readonly managedSettingsFetchedAt: number | null; /** The raw JSON response from the managed-settings endpoint, for diagnostics. */ readonly managedSettingsRawResponse: unknown; readonly managedSettingsCompatibilityError: IManagedSettingsCompatibilityError | null; readonly onDidChangeManagedSettingsCompatibilityError: Event; readonly managedSettingsFreshness: IManagedSettingsFreshness; readonly onDidChangeManagedSettingsFreshness: Event; getDefaultAccountAuthenticationProvider(): IDefaultAccountAuthenticationProvider; /** * Resolves a GitHub path against the selected session's enterprise server, or `https://github.com` for a non-enterprise provider. * Returns `undefined` when enterprise authentication is selected but the session's server is unavailable. */ resolveGitHubUrl(path: string): string | undefined; refresh(options?: IDefaultAccountRefreshOptions): Promise; signIn(options?: { additionalScopes?: readonly string[]; [key: string]: unknown; }): Promise; signOut(): Promise; } export { MANAGED_SETTINGS_FRESHNESS_NOT_REQUIRED };