/** * Document memory — curated markdown files with identity-keyed scoping. * * Layout under ~/.blockrun/memory/: * MEMORY.md global, cross-project facts * -/MEMORY.md workspace-scoped (curated) * -/sessions/YYYY-MM-DD-*.md per-session logs (decaying) * trading--/JOURNAL.md trade journal (curated) * trading--/theses/.md one thesis file per asset * * Identity keying: a workspace is keyed by its git origin (org/repo form) * so clones and worktrees of the same repo share memory; non-repos fall * back to the directory path. Trading memory is keyed by WALLET ADDRESS — * the journal follows the money, not the directory. * * This subsystem is additive to the Brain entity graph (src/brain/): the * graph answers "what do I know about entity X", documents answer "what * was my SOL thesis" / "what did we do last week". MemoryRecall facades * both. Kill switch: FRANKLIN_MEMORY=0. */ export declare function memoryEnabled(): boolean; export declare function memoryRoot(): string; export declare function globalMemoryPath(): string; /** org/repo from the git origin remote, or null outside a repo. */ export declare function repoIdentity(workDir: string): string | null; export declare function workspaceKey(workDir: string): { slug: string; hash8: string; }; export declare function workspaceDir(workDir: string): string; export declare function workspaceMemoryPath(workDir: string): string; export declare function sessionLogsDir(workDir: string): string; export declare function tradingDir(chain: string, address: string): string; export declare function tradingJournalPath(chain: string, address: string): string; export declare function thesisPath(chain: string, address: string, asset: string): string; /** * Append a note under a markdown heading, creating file/heading as needed. * Used by /remember and the trading capture. */ export declare function appendUnderHeading(filePath: string, heading: string, note: string): void; /** Dated session log path for today. */ export declare function sessionLogPath(workDir: string, sessionId: string): string; export declare function writeSessionLog(workDir: string, sessionId: string, content: string): void; export interface MemoryFileRef { path: string; /** Curated files never decay; session logs do. */ scope: 'global' | 'workspace' | 'trading' | 'session'; mtimeMs: number; } export declare function listMemoryFiles(workDir: string): MemoryFileRef[];