/**
 * Canonical agent memory resource — accumulated facts/preferences/knowledge
 * distinct from `rules` (instructions / AGENTS.md persona).
 *
 * Layout (project > user > system layering):
 *   ~/.agents/memory/MEMORY.md          always-read index
 *   ~/.agents/memory/<slug>.md          individual facts
 *   ~/.agents/.system/memory/           system layer
 *   <project>/.agents/memory/           project layer
 *
 * Sync fans out into each capable agent's version home under an agent-specific
 * target dir (see memoryTargetDir).
 */
import type { AgentId } from './types.js';
export interface MemoryFact {
    /** Filename without .md (slug). */
    name: string;
    /** Absolute path to the fact file. */
    path: string;
    /** Layer that wins for this name. */
    layer: 'project' | 'user' | 'system';
    /** First non-empty line of the body (for list display). */
    summary: string;
}
export interface MemoryLayerDir {
    layer: 'project' | 'user' | 'system';
    dir: string;
}
/** User-layer memory root (~/.agents/memory/). */
export declare function getUserMemoryDir(): string;
/** System-layer memory root (~/.agents/.system/memory/). */
export declare function getSystemMemoryDir(): string;
/** Project-layer memory root when a project agents dir exists. */
export declare function getProjectMemoryDir(cwd?: string): string | null;
/** Ensure the user memory dir exists (creates MEMORY.md index if missing). */
export declare function ensureUserMemoryDir(): string;
/** Layer dirs highest-priority first. */
export declare function getMemoryLayerDirs(cwd?: string): MemoryLayerDir[];
/** List memory facts with project > user > system override on name. */
export declare function listMemoryFacts(cwd?: string): MemoryFact[];
/** Read one fact by name (winning layer). */
export declare function readMemoryFact(name: string, cwd?: string): MemoryFact | null;
/** Write a fact into the user layer. Returns the absolute path. */
export declare function addMemoryFact(name: string, body: string): string;
/** Remove a fact from the user layer. Returns true if a file was deleted. */
export declare function removeMemoryFact(name: string): boolean;
/** Rebuild MEMORY.md index from sibling fact files in a single layer dir. */
export declare function rebuildMemoryIndex(dir: string): void;
/**
 * Per-agent target directory (relative to version home) for synced memory.
 * Claude/Codex/OpenClaw/Grok get native-ish paths; others get a generic memory/.
 */
export declare function memoryTargetDir(agent: AgentId): string;
/** Copy canonical layered memory into one version home. Returns fact names written. */
export declare function syncMemoryToVersionHome(agent: AgentId, versionHome: string, cwd?: string): string[];
/**
 * Canonical shared dir for Claude Code's NATIVE per-project auto-memory —
 * `<versionHome>/.claude/projects/<project-key>/memory/*.md`, the freeform
 * notes Claude writes for itself during a session. Distinct from the layered
 * `memory` resource above (~/.agents/memory/ facts synced into
 * `.claude/memory/`): this dir is keyed by project (via
 * {@link claudeProjectDirName}), not by agent version, and Claude Code itself
 * decides what goes in it — agents-cli only makes the directory
 * version-independent, never writes into it.
 */
export declare function getClaudeProjectMemoryDir(cwd: string): string;
/**
 * Make Claude Code's native per-project memory dir version-independent by
 * symlinking `<versionHome>/.claude/projects/<project-key>/memory/` into the
 * one canonical dir every installed Claude version's home shares for this
 * project (PHNX-2817). Without this, `getVersionHomePath` gives every
 * installed version its own isolated HOME, so a note written under one
 * version is invisible under another — the directory is just empty there.
 *
 * Idempotent and safe to call on every sync: a dir already linked to the
 * canonical target is left alone; a PRE-EXISTING real directory with content
 * (the common case today, since this bug has always left one behind) has its
 * files migrated into the canonical dir first — never discarded — before
 * being replaced by the symlink.
 */
export declare function syncClaudeProjectMemoryDir(versionHome: string, cwd?: string): void;
