import type { MemoryIndex, ProjectMemoryKind } from '../types.js'; /** Marker line that owns `MEMORY.md`. Anything above it is machine output. */ export declare const MEMORY_MD_BANNER = ""; /** `MEMORY.md` is the generated index itself — never a memory source. */ export declare const MEMORY_MD_FILENAME = "MEMORY.md"; /** * Deterministic section order for the generated `MEMORY.md`: hot kinds * first (mirrors `HOT_KINDS` in `ranking.ts`), warm kinds last. Derived * from the insertion order of `MEMORY_KIND_TIER` so the vocabulary has * exactly one definition. */ export declare const KIND_ORDER: readonly ProjectMemoryKind[]; export interface ReindexUnclassified { name: string; filePath: string; /** The first raw type/kind value found in the frontmatter (null when absent). */ rawKind: string | null; reason: string; } export interface ReindexOrphanEntry { name: string; kind: string; sourcePath: string; } /** * Two or more different files resolve to the same memory name (after the * `name:` → `title:` → filename-stem fallback chain). Reported, never * resolved by overwriting: both files keep their own index entry, and the * collision is surfaced so a human/LLM can rename one of them. */ export interface ReindexNameConflict { name: string; /** Every file that resolves to this name, sorted. Always length >= 2. */ filePaths: string[]; } export interface MemoryReindexReport { apply: boolean; projectRoot: string; memoryDir: string; indexPath: string; memoryMdPath: string; /** Markdown files scanned (excludes the generated `MEMORY.md`). */ scannedFiles: number; /** Files represented in the rebuilt index. */ indexed: number; indexedByKind: Record; /** Files on disk with no resolvable kind — reported, never invented. */ unclassified: ReindexUnclassified[]; /** Distinct files that resolve to the same index name — reported, never overwritten. */ nameConflicts: ReindexNameConflict[]; orphanIndex: ReindexOrphanEntry[]; /** Files on disk that the rebuilt index does not contain (warn-class drift). */ orphanDisk: string[]; memoryMd: { path: string; regenerated: boolean; }; writtenFiles: string[]; } export interface MemoryReindexOptions { projectRoot: string; apply?: boolean; } /** * Render the human/LLM-facing `MEMORY.md` from a built index. Deterministic: * kinds in `KIND_ORDER`, entries sorted by name, no timestamps. */ export declare function renderMemoryMarkdown(index: MemoryIndex, memoryDir: string): string; /** * Rebuild `.peaks/memory/index.json` from disk and (on `--apply`) regenerate * `MEMORY.md`. Always returns the drift report, even on a dry run. */ export declare function executeMemoryReindex(options: MemoryReindexOptions): MemoryReindexReport;