export type { ProjectMemoryKind } from './project-memory-service.js'; import type { ProjectMemoryKind } from './project-memory-service.js'; /** * One entry in `.peaks/memory/index.json` after the on-disk `hot[]` + * `cold[]` arrays are flattened. Mirrors the field shape that the * existing `project-memory-service.ts` writer emits. */ export interface MemoryIndexEntry { name: string; kind: ProjectMemoryKind; description: string; sourcePath: string; sourceArtifact: string | null; updatedAt: string; } /** * The full snapshot of `.peaks/memory/index.json`. */ export interface MemoryIndexSnapshot { indexPath: string; version: number; updatedAt: string; entries: MemoryIndexEntry[]; } /** * Input to `searchMemory`. `projectRoot` defaults to the resolved * peaks project root (CLI resolves this before calling). `query` is * required and non-empty. */ export interface MemorySearchInput { query: string; projectRoot?: string; limit?: number; kind?: ProjectMemoryKind; } /** * One hit returned by `searchMemory`. Mirrors the entry shape with a * normalized score in [0, 1] (top of batch = 1.0) and the char indices * in the searchable text that contributed to the match. */ export interface MemorySearchResult { name: string; kind: ProjectMemoryKind; description: string; sourcePath: string; score: number; positions: number[]; } /** * Read `.peaks/memory/index.json` and flatten the on-disk `hot[][]` * + `cold[]` shape into a single `entries[]` array. Throws structured * errors with stable `code` markers that the CLI converts to the * peaks envelope. */ export declare function loadMemoryIndex(projectRoot: string): MemoryIndexSnapshot; /** * Run the generic fuzzy kernel against the on-disk memory index. The * searchable text is `name + " " + description` for each entry (per * spec §Component Details). */ export declare function searchMemory(input: MemorySearchInput): MemorySearchResult[];