/** * Background check for a newer docs index. * * CI publishes each data build to the data-latest release of this repository * with a manifest (see .github/workflows/data.yml). At most once a day the * server reads the manifest for its schema version, and when it names a newer * build it downloads the file, checks its size, hash, schema and metadata, and * adds it to the data directory under its stamp. The next tool call uses it. * * Every failure leaves the current index in use. Nothing is written to stdout, * which is the MCP channel. */ import { z } from "zod"; import { type TrustedKey } from "./data-signing.js"; export declare const DEFAULT_DATA_BASE_URL = "https://github.com/withqwerty/football-docs/releases/download/data-latest/"; /** * The signed manifest servers read. Its payload is the manifest-v.json * that data.yml builds; the unsigned file is not published, and a server never * falls back to it, so deleting the signed file cannot downgrade the check. */ export declare const MANIFEST_NAME = "manifest-v1-signed.json"; export declare const MAX_DOWNLOAD_BYTES: number; declare const manifestSchema: z.ZodObject<{ schema_version: z.ZodNumber; min_server_version: z.ZodString; data_stamp: z.ZodString; commit: z.ZodOptional>; file: z.ZodString; sha256: z.ZodString; size: z.ZodNumber; }, z.core.$strip>; export type Manifest = z.infer; export type UpdateOutcome = "skipped-ci" | "skipped-recent" | "not-published" | "up-to-date" | "installed" | "rejected" | "failed"; export interface UpdateOptions { dataDir: string; serverVersion: string; /** Stamp of the index in use, in epoch milliseconds, or null if unknown. */ currentStampMs: number | null; baseUrl?: string; env?: NodeJS.ProcessEnv; fetch?: typeof fetch; now?: () => number; signal?: AbortSignal; maxBytes?: number; /** Keys that may sign manifests; defaults to the keys shipped in the package. */ trustedKeys?: readonly TrustedKey[]; log?: (message: string) => void; } export interface UpdateResult { outcome: UpdateOutcome; detail?: string; /** Path of the newly added index, for outcome "installed". */ path?: string; } export declare function checkForUpdate(options: UpdateOptions): Promise; export {};