export declare function readDirectives(cwd: string): string[]; /** Append a must-follow directive; returns the new directive count. Text is * sanitized on write (markers stripped, secrets redacted, newlines collapsed): * directives inject into every future session and into the managed * copilot-instructions block, so a marker-bearing or multi-line rule must * never reach storage (a literal `omp:memory:end` would wedge every later * sync into fail-closed). */ export declare function addDirective(cwd: string, directive: string): number; export interface NoteMeta { id: string; title: string; } /** Create a note (title + optional body); returns its id (slug, deduped). * The title is sanitized on write (one line, no markers, secrets redacted): * titles are auto-applied (ungated) yet surface in the instructions block, * the SessionStart breadcrumb, and the review prompt's ALREADY KNOWN * section — so a transcript-authored title must not carry instruction * structure into those surfaces. */ export declare function addNote(cwd: string, title: string, body?: string): string; /** Cheap index of (id, title) — the only thing surfaced; bodies stay on disk. */ export declare function noteIndex(cwd: string): NoteMeta[]; /** Notes ordered newest-first by mtime, optionally capped. Used to surface the * most recent titles in the injected block without unbounded growth. */ export declare function recentNotes(cwd: string, limit?: number): NoteMeta[]; /** Prune notes by count (keep N newest) and/or age (older than N days). * Returns the ids removed. No options → no-op (never deletes silently). */ export declare function pruneNotes(cwd: string, opts: { keep?: number; olderThanDays?: number; }): string[]; /** Full note body by id, or null when missing. */ export declare function readNote(cwd: string, id: string): string | null; export interface Topic { id: string; description: string; } export interface TopicMemory { id: string; topic: string; description?: string; lastUpdated: string; facts: string[]; } /** Read topic memory from disk; returns null when missing or invalid. */ export declare function readTopicMemory(cwd: string, topic: string): TopicMemory | null; /** Set a topic's one-line description; creates the topic if missing. */ export declare function setTopicDescription(cwd: string, topic: string, description?: string): string | null; /** Add a single fact to a topic; creates topic if missing. Returns true if fact was added. */ export declare function addTopicFact(cwd: string, topic: string, fact: string): boolean; /** List all topic memories; returns array of topic ids. */ export declare function listTopicMemories(cwd: string): string[]; /** List all topics (id + one-liner description) sorted by id. */ export declare function listTopics(cwd: string): Topic[]; /** Remove a fact by index from a topic; returns true if removed. */ export declare function removeTopicFact(cwd: string, topic: string, factIndex: number): boolean; export interface ConsolidationSummary { merged: number; removed: number; kept: number; } /** Consolidate topic facts by replacing current facts with a merged list. * Returns a summary of merged/removed/kept facts. */ export declare function consolidateTopicFacts(cwd: string, topic: string, consolidatedFacts: string[]): ConsolidationSummary | null; export interface PromotionSummary { promotedCount: number; targetTopic: string; } /** Promote facts from one topic to another (or new topic). * Removes promoted facts from source and adds to target. * Returns summary of promoted facts. */ export declare function promoteToDurableMemory(cwd: string, sourceId: string, targetTopic: string, facts: string[]): PromotionSummary | null;