evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a utility to manually seed and tidy a cache index when content already exists on disk. The cache directory already contains content files addressed by integrity digests. Operations must avoid rewriting content and should rely on the package's index-level maintenance facilities rather than normal read/write helpers.
export interface SeedEntry {
key: string;
integrity: string;
size: number;
metadata?: Record<string, any>;
}
export async function seedIndex(cachePath: string, entries: SeedEntry[]): Promise<void>;
export type HistoryMatch = (existing: { key: string; metadata?: any; integrity: string; size?: number; time?: number }, incoming: { key: string; metadata?: any; integrity: string; size?: number; time?: number }) => boolean;
export type EntryValidator = (entry: { integrity: string; metadata?: any; size: number }) => boolean | Promise<boolean>;
export async function compactHistory(cachePath: string, key: string, match: HistoryMatch, validate?: EntryValidator): Promise<void>;
export async function summarize(cachePath: string, key: string): Promise<{ integrity: string | null; metadata?: any; historySize: number }>;Manual index maintenance support for the cache.