import type { Stats } from "node:fs"; import { type LoadedSkillContext, type LoadSelectedSkillsInput } from "./skills.js"; /** * Underlying loader used to populate the cache. Defaults to {@link loadSelectedSkills}; * injectable for tests to observe content reads. */ export type SkillsLoader = (input: LoadSelectedSkillsInput) => Promise; /** * Cheap stat used to validate cache freshness. Defaults to `node:fs/promises` stat; * injectable for tests. */ export type SkillsStat = (path: string) => Promise; export interface CreateSkillsCacheOptions { readonly loader?: SkillsLoader; readonly stat?: SkillsStat; } export interface SkillsCache { /** * Returns the previously-loaded context when the selection is unchanged and every * selected skill's source file is unchanged (validated via a cheap mtime stat). * Otherwise reloads from disk via the underlying loader. */ loadSelectedSkillsCached(input: LoadSelectedSkillsInput): Promise; /** Drops all memoized entries. */ clear(): void; } /** * Builds an mtime-invalidated cache around {@link loadSelectedSkills}. The result for a * given (skillsRoot, selected names, maxBytes) is memoized and returned without re-reading * skill file contents while every selected skill's source `SKILL.md` mtime is unchanged. */ export declare function createSkillsCache(options?: CreateSkillsCacheOptions): SkillsCache; //# sourceMappingURL=skills-cache.d.ts.map