/** * The generated `MEMORY.md`: one line per active memory someone chose to * keep, the thing a host loads into every prompt so the model knows what * exists without reading it. * * It is an index and never a source. Nothing reads it back; every line is * rebuilt from the memory files, so an edit to it is overwritten at the next * write and an edit to a memory file reaches it then. */ import type { MemoryIndexEntry, MemoryRecord } from '../../types/memory/index.js'; /** Lines of index a prompt carries before the rest is left to search. */ export declare const MEMORY_INDEX_MAX_LINES = 200; /** One index line, link and description together. */ export declare const MEMORY_INDEX_LINE_MAX_CHARS = 150; export declare const MEMORY_INDEX_FILE_HEADER = ""; /** * `- [name](name.md) — description`, never longer than * {@link MEMORY_INDEX_LINE_MAX_CHARS}: the description is clipped to the room * the link leaves. A name at the 64-character limit leaves ten characters; * the link alone always fits. */ export declare function memoryIndexLine(entry: Pick): string; export interface RenderedMemoryIndex { /** The index lines, followed by a note when some were left out. Empty when nothing is listed. */ readonly text: string; /** * Memories the index covers: active, named, and not derived by the * runtime (see `memoryOrigin`). Derived records are in the store and found * by search, never counted here — unless the index was rendered with * `derived: true`, when it covers only them. */ readonly total: number; /** How many of those `text` does not list. */ readonly omitted: number; } /** * Render the index of the active, named records a person or the model chose * to keep. A record the runtime derived — a session memory promoter's or * consolidation's account of a turn — is left out: it is written after almost * every turn, and an index that changed with it would change the system prompt * nearly every turn. * * Ordered by {@link tier}, then by name, so an unchanged set of memories * renders byte-identical text — a prompt that carries it keeps its cache * until a memory someone chose to keep changes — and the cap drops `project` * and `reference` memories before any operator `feedback` or `user` one. * * `derived: true` renders the other half instead: the active, named records * the runtime derived, newest first, for an operator inspecting what turns * recorded. That listing is not for a prompt; it changes with every turn. */ export declare function renderMemoryIndex(records: readonly MemoryRecord[], options?: { readonly maxLines?: number; readonly derived?: boolean; }): RenderedMemoryIndex; //# sourceMappingURL=index-file.d.ts.map