import { type ProviderName } from "../../providers"; import { type ProviderCapabilities, type VerifiedAgainst } from "./capabilities"; /** * Provider version detection and compatibility reporting (C2). * See docs/architecture/2026-07-24-provider-compatibility.md. * * Our parsing and TUI detection are calibrated against specific provider * versions — the fixtures under __tests__/fixtures/providers// * record which. This module compares what is actually installed against that, * so drift is reported instead of surfacing as a mysteriously stuck session. * * A warning is never a refusal. A provider working slightly outside our verified * range is vastly better than us blocking it. */ /** Versions each adapter's fixtures were captured against. */ export declare const VERIFIED_AGAINST: Record; export type ProviderWarningCode = /** The CLI is not installed, or not on PATH. */ "provider_not_found" /** Installed, but we could not read a version from it. */ | "version_undetectable" /** Installed and readable, but outside the range our fixtures cover. */ | "version_unverified"; export interface ProviderWarning { code: ProviderWarningCode; message: string; } export interface ProviderHealth { name: ProviderName; available: boolean; version: string | null; verifiedAgainst: VerifiedAgainst; capabilities: ProviderCapabilities; warnings: ProviderWarning[]; } /** * Run ` --version` and return the first version-looking token. * * Deliberately tolerant: providers format this line differently and change it * between releases, so we scrape a semver-shaped substring rather than assume a * layout. Any failure yields null, which the caller treats as "unverified" * rather than "incompatible" — an unreadable version is not evidence of a * problem with the provider. */ export declare function parseVersionOutput(output: string): string | null; /** * Compare a detected version against the range an adapter claims to cover. * * Only `min` is enforced as a floor. There is deliberately no upper bound check * beyond `max` when set: providers release constantly, and refusing to run * against a version merely newer than our newest fixture would break users on * every provider update for no evidence of an actual incompatibility. */ export declare function compareToVerified(version: string | null, verified: VerifiedAgainst): ProviderWarning | null; /** * Compare two semver-ish strings. Prerelease suffixes sort BELOW the same * release (0.140.0-alpha.19 < 0.140.0), matching semver, so a prerelease we * captured does not read as newer than the release it precedes. */ export declare function compareSemver(a: string, b: string): number; /** * Resolve health for one provider. `locateExe` is injected so tests can drive * detection without depending on what happens to be installed on the machine; * it defaults to the same `locateProviderExe` the session-start pre-flight * uses. Sharing that one entry point is load-bearing rather than tidy: it * clears the memoized resolution on a miss, so a health check and a start * attempt cannot reach opposite conclusions about the same machine — which is * what happened when this called `locateExecutable(resolveExe())` directly and * left a stale absolute path (the normal case under launchd) in place. */ export declare function providerHealth(name: ProviderName, locateExe?: () => string | null, detect?: (exe: string) => Promise): Promise; //# sourceMappingURL=providerHealth.d.ts.map