/** * Self-update awareness for the connector. * * On startup the connector queries the npm registry for the latest * `jdcodec` version and compares against the version baked into this * build. If a newer version exists, the proxy emits a one-line warning * on stderr; the `doctor` subcommand surfaces the same finding as a * "warn" probe. The check is fire-and-forget — registry-down, no PATH * to npm, and timeout all degrade silently. We never block startup. * * Cache: * - Successful lookups (any verdict — match or mismatch) cache the * result for 24h at `~/.jdcodec/version-check.json` so repeated * connector restarts don't hammer the registry. Cache is also * written on a *failed* lookup with a short TTL (10 min) so a * transient registry outage doesn't retry on every boot. * - Cache directory mirrors the existing config-file location so * the connector only ever touches one directory under the home dir. */ export declare const REGISTRY_URL = "https://registry.npmjs.org/jdcodec/latest"; export declare const PACKAGE_NAME = "jdcodec"; export type UpdateVerdict = { state: "current"; current: string; latest: string; } | { state: "outdated"; current: string; latest: string; } | { state: "unknown"; current: string; reason: string; }; export interface UpdateCheckIO { /** Defaults to globalThis.fetch. */ fetchImpl?: typeof fetch; /** Defaults to `~/.jdcodec/version-check.json`. */ cachePath?: string; /** Defaults to Date.now. */ now?: () => number; /** Defaults to the package's own VERSION constant. */ currentVersion?: string; } /** * Loose semver comparison sufficient for newer-than checks against * what npm publishes for this package. Avoids pulling in a semver * dependency for a single comparison point. Returns: * -1 if a < b, 0 if a == b, 1 if a > b * Pre-release suffixes (e.g. -beta.1) compare lexicographically after * the numeric triple; this is a minor deviation from strict semver but * is correct for our publish discipline (we ship clean x.y.z bumps). */ export declare function compareVersions(a: string, b: string): number; /** * Resolve the update verdict for the connector. Reads cache, queries the * registry if stale, writes cache, returns. Never throws — failures * become `state: "unknown"` verdicts with a human-readable reason. */ export declare function checkForUpdate(io?: UpdateCheckIO): Promise; /** One-line human-readable summary suitable for a log line. */ export declare function formatVerdict(verdict: UpdateVerdict): string;