import type { ChatRequest, ChatResponse, LLMProvider, ProviderModelSource, ProviderRuntimeMetadata, ProviderRuntimeMetadataDeps } from './interface.js'; import { type LiveModelDiscoveryResult } from './live-model-discovery.js'; /** * Dated fallback model list, used when no GitHub token is configured (so a * live /models call isn't possible) and as the offline baseline when a live * call fails with no prior cache. Re-dated 2026-07-13 when live discovery * (below) was wired up; the entries themselves are still only cross-checked * against the direct Anthropic API's /v1/models response and OpenAI's * published model docs, not against a live Copilot subscription's actual * /models response (no Copilot subscription was available in this * environment to verify against). `refreshModels()` replaces this list with * the subscription's real available model ids the first time it runs * successfully against real credentials. */ export declare const COPILOT_DATED_STATIC_MODELS: readonly string[]; export declare const COPILOT_DATED_STATIC_MODELS_AS_OF = "2026-07-13"; export interface GitHubCopilotProviderOptions { readonly tokenCachePath: string; readonly env?: NodeJS.ProcessEnv | undefined; readonly fetchFn?: typeof fetch | undefined; /** * Absolute path to this provider's on-disk live-model-list cache file * (see `getProviderModelsCachePath`). Optional: when omitted, * `refreshModels()` still works but runs in-memory only for the lifetime * of this instance (no TTL skip across restarts). */ readonly modelsCachePath?: string | undefined; } export declare function getGitHubCopilotTokenCachePath(cacheDir: string): string; export declare class GitHubCopilotProvider implements LLMProvider { private readonly options; readonly name = "github-copilot"; readonly credentialAuthority: "subscription"; /** * Live-discovery: GET /models on the Copilot API host, verified working * for this provider's token-exchange auth mode (see `fetchCopilotModelIds` * for the evidence trail). `COPILOT_DATED_STATIC_MODELS` below is the * offline fallback used when no GitHub token is configured or a live call * fails with no prior cache. */ readonly modelSource: ProviderModelSource; /** * Populated synchronously with the dated-static baseline at construction * (never empty), then replaced by `refreshModels()` with the live /models * result. See `modelSource`. */ private _models; get models(): string[]; constructor(options: GitHubCopilotProviderOptions); isConfigured(): boolean; /** * Re-check Copilot's live model list. Called at boot (background, * respects the on-disk TTL cache) and on-demand for a picker-open * re-check or an explicit user refresh (`force: true`, bypasses the TTL * cache). Always resolves, falls back to the on-disk cache, then to the * dated-static list, and reports the honest reason when live discovery * fails rather than silently keeping stale data with no explanation. */ refreshModels(force?: boolean): Promise; chat(params: ChatRequest): Promise; describeRuntime(deps: ProviderRuntimeMetadataDeps): Promise; } //# sourceMappingURL=github-copilot.d.ts.map