/** * skills/store.ts * * Storage seam for the skill model. The store is an injectable interface so the * `SkillService` (service.ts) has no direct filesystem or transport dependency *, a consumer can back it with a directory of Markdown files (the bundled * `FileSystemSkillStore` below), an in-memory map for tests, or a remote store, * without the service or the gateway verbs changing. This is the same * injectable-I/O shape the push and subscription stores follow. * * The filesystem store is the canonical on-disk form: one `.md` document * per skill in a single directory, which is exactly the Markdown-plus- * frontmatter shape `model.ts` reads and writes. `delete` means delete, the * file is removed, not tombstoned. */ import { type Skill, type SkillIndexEntry } from './model.js'; /** The storage operations the `SkillService` needs. All async, all honest about absence. */ export interface SkillStore { /** Cheap index-line read for every skill, never materializes bodies. */ listIndex(): Promise; /** Full read of one skill (body included), or null when it does not exist. */ get(name: string): Promise; /** Whether a skill with this name currently exists. */ has(name: string): Promise; /** Write a skill (create or overwrite), returning the stored form. */ put(skill: Skill): Promise; /** Remove a skill. Returns false when no skill with that name existed. */ delete(name: string): Promise; } /** A directory-of-Markdown-files skill store. */ export declare class FileSystemSkillStore implements SkillStore { private readonly dir; constructor(directory: string); private filePath; private readEntry; listIndex(): Promise; get(name: string): Promise; has(name: string): Promise; put(skill: Skill): Promise; delete(name: string): Promise; } /** An in-memory skill store, the reference implementation for tests. */ export declare class InMemorySkillStore implements SkillStore { private readonly skills; listIndex(): Promise; get(name: string): Promise; has(name: string): Promise; put(skill: Skill): Promise; delete(name: string): Promise; } //# sourceMappingURL=store.d.ts.map