/** * Metric cards: one checked definition per football metric, with each * published variant under its own ID, its source and a checked quote, and * where possible reference code with test values on public open data. * * Cards are written in metrics/cards/*.toml. scripts/gen_metric_cards.py turns * them into metrics/cards.json, which ingest stores in the index's meta table * (key metric_cards), and into docs/metric-cards/.md pages for search_docs. * get_metric and list_metrics read the meta copy, so a card update reaches * installed servers with the next data release. */ import { z } from "zod"; import type { Database } from "./sqlite.js"; declare const variantSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; definition: z.ZodString; formula: z.ZodString; zone: z.ZodString; counts: z.ZodOptional; notes: z.ZodOptional>; source: z.ZodObject<{ kind: z.ZodEnum<{ web: "web"; paper: "paper"; }>; id: z.ZodString; title: z.ZodString; author: z.ZodString; date: z.ZodOptional; quote: z.ZodString; check: z.ZodEnum<{ exact: "exact"; normalised: "normalised"; browser: "browser"; }>; checked: z.ZodString; check_note: z.ZodOptional; }, z.core.$strip>; reference: z.ZodOptional>; }, z.core.$strip>>; fixtures: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>; export declare const metricCardSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; aliases: z.ZodOptional>; data: z.ZodEnum<{ event: "event"; tracking: "tracking"; }>; unit: z.ZodString; measures: z.ZodString; direction: z.ZodString; version: z.ZodNumber; updated: z.ZodString; summary: z.ZodString; caveats: z.ZodArray; related: z.ZodOptional>; origin: z.ZodObject<{ text: z.ZodString; source: z.ZodString; }, z.core.$strip>; variants: z.ZodArray; notes: z.ZodOptional>; source: z.ZodObject<{ kind: z.ZodEnum<{ web: "web"; paper: "paper"; }>; id: z.ZodString; title: z.ZodString; author: z.ZodString; date: z.ZodOptional; quote: z.ZodString; check: z.ZodEnum<{ exact: "exact"; normalised: "normalised"; browser: "browser"; }>; checked: z.ZodString; check_note: z.ZodOptional; }, z.core.$strip>; reference: z.ZodOptional>; }, z.core.$strip>>; fixtures: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>>; }, z.core.$strip>; export declare const metricCardsFileSchema: z.ZodObject<{ format: z.ZodLiteral<"football-docs/metric-cards/v1">; cards: z.ZodArray>; data: z.ZodEnum<{ event: "event"; tracking: "tracking"; }>; unit: z.ZodString; measures: z.ZodString; direction: z.ZodString; version: z.ZodNumber; updated: z.ZodString; summary: z.ZodString; caveats: z.ZodArray; related: z.ZodOptional>; origin: z.ZodObject<{ text: z.ZodString; source: z.ZodString; }, z.core.$strip>; variants: z.ZodArray; notes: z.ZodOptional>; source: z.ZodObject<{ kind: z.ZodEnum<{ web: "web"; paper: "paper"; }>; id: z.ZodString; title: z.ZodString; author: z.ZodString; date: z.ZodOptional; quote: z.ZodString; check: z.ZodEnum<{ exact: "exact"; normalised: "normalised"; browser: "browser"; }>; checked: z.ZodString; check_note: z.ZodOptional; }, z.core.$strip>; reference: z.ZodOptional>; }, z.core.$strip>>; fixtures: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>>; }, z.core.$strip>>; }, z.core.$strip>; export type MetricCard = z.infer; export type MetricVariant = z.infer; type ToolResponse = { isError?: boolean; content: Array<{ type: "text"; text: string; }>; }; /** The cards stored in the index, or [] for an index built before cards existed. */ export declare function readMetricCards(db: Database): MetricCard[]; export declare function findMetric(cards: MetricCard[], rawId: string): { card: MetricCard; variant?: MetricVariant; } | null; export declare function getMetric(db: Database, args: { id: string; }): ToolResponse; export declare function listMetrics(db: Database): ToolResponse; export {};