import { z } from "zod"; /** * Resolve the memory directory path for the given namespace. * * Mapping rule (centralized here — do NOT duplicate in callers): * namespace undefined | "" | "programming" → .bober/memory/ (current path, no subdir) * any other value → .bober/memory// * * The programming sentinel ("") comes from Sprint 1's built-in team (registry.ts:66). * Values are constrained to ^[a-z0-9_-]+$ by the Sprint 1 schema regex, so no * path-traversal sanitization is needed here (schema already guards config inputs). */ export declare function memoryDir(projectRoot: string, namespace?: string): string; export declare function lessonPath(projectRoot: string, lessonId: string, namespace?: string): string; export declare function indexPath(projectRoot: string, namespace?: string): string; export declare function quarantinePath(projectRoot: string, namespace?: string): string; /** * Move lessonId lines from INDEX.md to QUARANTINE.md (line-level rewrite). * * - Reads INDEX.md and partitions non-blank lines: those whose second token * (the lessonId) is in `quarantinedIds` are moved; the rest stay. * - Rewrites INDEX.md with the kept lines. * - Appends the moved lines to QUARANTINE.md (creating it if absent) with a * deterministic provenance block: ``. * - NEVER touches per-lesson .md files. * * @param projectRoot - Absolute project root containing .bober/ * @param quarantinedIds - Set of lessonIds to move out of INDEX.md * @param reason - Human-readable reason (e.g. "decay" | "conflict") * @param now - ISO 8601 wall-clock, injected by the CLI handler * @param namespace - Optional memory namespace */ export declare function rewriteIndexForQuarantine(projectRoot: string, quarantinedIds: Set, reason: string, now: string, namespace?: string): Promise; export declare const LessonEntrySchema: z.ZodObject<{ lessonId: z.ZodString; createdAt: z.ZodString; category: z.ZodString; tags: z.ZodDefault>; summary: z.ZodString; occurrences: z.ZodNumber; severity: z.ZodEnum<["info", "warn", "high"]>; sourceEntryRefs: z.ZodArray; }, "strip", z.ZodTypeAny, { lessonId: string; createdAt: string; category: string; tags: string[]; summary: string; occurrences: number; severity: "info" | "warn" | "high"; sourceEntryRefs: string[]; }, { lessonId: string; createdAt: string; category: string; summary: string; occurrences: number; severity: "info" | "warn" | "high"; sourceEntryRefs: string[]; tags?: string[] | undefined; }>; export type LessonEntry = z.infer; export interface LessonIndexRecord { lessonId: string; category: string; severity: string; occurrences: number; tags: string[]; summarySnippet: string; } /** * Append (or update) a lesson to the .bober/memory/ store. * Writes .md with hand-rolled front-matter plus a human body. * Upserts exactly one INDEX.md line for this lessonId (replace if exists, else append). * Throws if the lesson fails schema validation (sourceEntryRefs must be non-empty). */ export declare function appendLesson(projectRoot: string, lesson: LessonEntry, namespace?: string): Promise; /** * Load at most `limit` lesson index records from INDEX.md. * Never opens individual lesson files — parses only INDEX.md. * Returns an empty array if INDEX.md does not exist. */ export declare function loadLessonIndex(projectRoot: string, { limit }: { limit: number; }, namespace?: string): Promise; /** * Load a single lesson by ID from its .md file. * Parses front-matter and validates against LessonEntrySchema. * Throws a descriptive error if the file does not exist or fails validation. */ export declare function loadLesson(projectRoot: string, lessonId: string, namespace?: string): Promise; //# sourceMappingURL=memory.d.ts.map