export interface MemoryIndexOptions {
    maxEntries?: number;
    maxBytes?: number;
}
export interface RelevantMemoryOptions {
    maxFiles?: number;
    maxTotalBytes?: number;
    perFileBytes?: number;
}
/**
 * Normalize a memory key into the on-disk file basename. Strips any trailing
 * `.md` or `_md` suffixes the LLM may have included, then sanitizes
 * characters. Without the strip, `key="foo.md"` produced `foo_md.md`, and on
 * the next call `key="foo_md.md"` produced `foo_md_md.md` etc.
 */
export declare function keyToSafe(key: string): string;
export declare class MemoryManager {
    private memoryDir;
    private indexFile;
    constructor(workspace: string);
    /** Load the MEMORY.md index content */
    loadIndex(): string;
    /** Load a recent, byte-bounded MEMORY.md index for prompt injection. */
    loadIndexCapped(opts?: MemoryIndexOptions): string;
    /** Load memories relevant to a given context (task name, URL, etc.) */
    loadRelevantMemories(keywords: string[], opts?: RelevantMemoryOptions): string;
    /**
     * Save a memory file and update the index. Scheduled tasks should NOT call
     * this directly — task-runner rejects memory.save at the dispatch layer and
     * funnels structured cross-run state to the store tool instead.
     */
    save(key: string, title: string, content: string): string;
    /** Read a specific memory file */
    read(key: string): string;
    /**
     * One-time cleanup: prior to the keyToSafe fix, an LLM passing key="foo.md"
     * produced `foo_md.md`, then `foo_md_md.md` on next call, etc. Detect these
     * `(_md)+\.md$` filenames, merge them with the canonical `foo.md` file
     * (keeping the newest mtime), and prune dead lines from MEMORY.md.
     *
     * Idempotent: a clean directory makes this a no-op.
     */
    private migrateMdSuffixDuplicates;
    private nextArchivePath;
    /** Read the `title:` line from a memory file's YAML frontmatter, if present. */
    private readFrontmatterTitle;
    /** Drop lines from MEMORY.md that point to files that no longer exist. */
    private pruneIndexOfMissingFiles;
    /** List all memory files */
    list(): string;
    private listMemoryFiles;
    private parseIndex;
    private renderIndex;
    private updateIndex;
}
