/** * ollama_corpus_health — dedicated health summary for indexed corpora. * * No Ollama call. Superset of ollama_corpus_list: returns everything list * returns PLUS staleness age (days since indexed_at), the drift fields * from the manifest (resolved tag + within-refresh drift), a * write-complete flag, and a warnings[] per corpus. In `detailed: true` * mode adds per-file mtime + stale-days so callers can pinpoint which * source file triggered a stale flag without re-running corpus_refresh. * * Use this when you want "is my corpus set healthy?" as a single call. */ import { z } from "zod"; import type { Envelope } from "../envelope.js"; import type { RunContext } from "../runContext.js"; export declare const corpusHealthSchema: z.ZodObject<{ name: z.ZodOptional; detailed: z.ZodOptional; }, z.core.$strip>; export type CorpusHealthInput = z.infer; export interface CorpusHealthFileDetail { path: string; /** File's current mtime on disk (ISO string). null if the file can't be stat'd. */ mtime: string | null; /** Number of chunks the corpus currently stores for this path. */ chunk_count: number; /** Whole-day-rounded age since mtime; null when mtime is null. */ stale_days: number | null; } export interface CorpusHealthEntry { name: string; chunks: number; docs: number; bytes: number; indexed_at: string; /** Days since indexed_at — a coarse freshness hint; does NOT mean drift. */ staleness_days: number; embed_model: string; /** Resolved tag captured at last index (e.g. "nomic-embed-text:latest"). null when unknown. */ embed_model_resolved: string | null; /** True when the manifest records within-refresh :latest drift (an index saw >1 distinct resolved tag). */ drift_detected: boolean; /** Populated only when drift_detected is true. */ drift_within_refresh?: string[]; failed_paths_count: number; /** * True when the manifest was written cleanly (completed_at present). False * when the previous mutation landed the corpus but was interrupted before * the manifest's tail marker. Undefined for legacy pre-Stage-B+C manifests. */ write_complete: boolean | undefined; /** Plain-English health notes — callers should read these. */ warnings: string[]; /** Only populated when `detailed: true`. */ paths?: CorpusHealthFileDetail[]; /** True when corpus_amend has mutated this corpus since the last index/refresh. */ has_amended_content: boolean; } export interface CorpusHealthResult { corpora: CorpusHealthEntry[]; corpus_dir: string; } export declare function handleCorpusHealth(input: CorpusHealthInput, ctx: RunContext): Promise>; //# sourceMappingURL=corpusHealth.d.ts.map