/**
 * @module        memory
 * @description   项目级持久化知识记忆系统
 *
 * @author        eddy
 * @organization  wykj
 * @ownership     wykj/eddy
 *
 * @created       2026-04-03
 * @updated       2026-04-03
 *
 * @role          util
 * @layer         core
 * @boundedContext memory
 *
 * Types: convention (no decay), decision (slow decay), lesson (normal decay), reference (no decay)
 */
export declare const MEMORY_TYPES: readonly ["convention", "decision", "lesson", "reference"];
export type MemoryType = (typeof MEMORY_TYPES)[number];
export interface MemoryHeader {
    filename: string;
    filePath: string;
    mtimeMs: number;
    name: string | null;
    description: string | null;
    type: MemoryType | undefined;
}
export declare const MEMORY_INDEX = "MEMORY.md";
/** Get the user-level memory directory (cross-project preferences) */
export declare function getUserMemoryDir(): string;
/** Get the agent-level memory directory (per daemon instance) */
export declare function getAgentMemoryDir(agentId: string): string;
/** Get the memory directory for a project */
export declare function getProjectMemoryDir(project: string): string;
/** Ensure project memory directory exists */
export declare function ensureMemoryDir(project: string): string;
/** Ensure user memory directory exists */
export declare function ensureUserMemoryDir(): string;
/** Ensure agent memory directory exists */
export declare function ensureAgentMemoryDir(agentId: string): string;
/** Scan memory directory for .md files, return headers sorted newest-first */
export declare function scanMemoryFiles(memoryDir: string): MemoryHeader[];
/** Read MEMORY.md index content, truncated to max lines */
export declare function readMemoryIndex(memoryDir: string): string;
/** Read a memory file, truncated to max lines */
export declare function readMemoryFile(filePath: string): string;
/**
 * Build the memory context string for prompt injection.
 * Includes: MEMORY.md index + selected file contents.
 */
export declare function buildMemoryContext(project: string, cardSeq?: string): string;
/**
 * Build user-level memory context (cross-project preferences).
 * Injected into every agent/worker prompt.
 */
export declare function buildUserMemoryContext(): string;
/**
 * Build agent-level memory context (daemon instance experience).
 * Injected when attaching to a daemon session.
 */
export declare function buildAgentMemoryContext(agentId: string): string;
/**
 * Build combined memory context for all applicable layers.
 * Used by StageEngine (user + project) and agent commands (user + agent).
 */
export declare function buildFullMemoryContext(opts: {
    project?: string;
    cardSeq?: string;
    agentId?: string;
}): string;
/**
 * Build memory write instructions for prompt injection.
 * Tells the agent how and where to write memories across all three layers.
 */
export declare function buildMemoryWriteInstructions(project: string, agentId?: string): string;
/**
 * Add a memory entry via CLI. Creates the file and updates MEMORY.md.
 */
export declare function addMemory(project: string, opts: {
    name: string;
    description: string;
    type: MemoryType;
    body: string;
}): string;
//# sourceMappingURL=memory.d.ts.map