export type MemoryType = 'task_list' | 'recently_memory' | 'memory';
export interface MemoryRecord {
    id: string;
    uri: string;
    domain: string;
    path: string;
    content: string;
    memory_type: MemoryType;
    createdAt: string;
    updatedAt: string;
    version: number;
}
export interface CreateMemoryInput {
    memory_type: MemoryType;
    uri: string;
    content: string;
}
export interface UpdateMemoryInput {
    memory_type?: MemoryType;
    uri: string;
    old_string?: string;
    new_string?: string;
    append?: string;
}
export interface ReadMemoryInput {
    memory_type?: MemoryType;
    uri: string;
}
export interface DeleteMemoryInput {
    memory_type?: MemoryType;
    uri: string;
}
export interface SearchMemoryInput {
    query: string;
    limit?: number;
    memory_type?: MemoryType;
}
export interface MemoryCapacityErrorDetails {
    code: 'MEMORY_TYPE_LIMIT_REACHED' | 'MEMORY_LISTABLE_TOTAL_LIMIT_REACHED';
    memory_type: MemoryType;
    limit: number;
    current: number;
    recommended_actions: string[];
}
export declare class MemoryCapacityError extends Error {
    readonly details: MemoryCapacityErrorDetails;
    constructor(message: string, details: MemoryCapacityErrorDetails);
}
export interface MemoryTypeStats {
    count: number;
    limit: number | null;
    hardLimit: number | null;
    exceeded: boolean;
    hardExceeded: boolean;
    listable: boolean;
}
export interface MemoryStats {
    total: number;
    listable: {
        count: number;
        limit: number;
        hardLimit: number;
        exceeded: boolean;
        hardExceeded: boolean;
    };
    by_type: Record<MemoryType, MemoryTypeStats>;
}
export declare class MemoryStore {
    private readonly filePath;
    constructor(filePath: string);
    private nowIso;
    private normalizeUri;
    private normalizeMemoryType;
    private ensureTypeMatch;
    private ensureParentDir;
    private loadData;
    private saveData;
    private createEmptyStats;
    /**
     * 统计本地记忆容量。
     * 主流程：遍历所有记录 -> 按类型计数 -> 单独汇总可 list 类型容量。
     */
    private calculateStats;
    private generateId;
    /**
     * 校验可列出记忆容量。
     * 主流程：仅限制 task_list/recently_memory 新建 -> 先校验该类型数量 -> 再校验可 list 总量。
     */
    private ensureListableMemoryCapacity;
    getStats(): Promise<MemoryStats>;
    createMemory(input: CreateMemoryInput): Promise<MemoryRecord>;
    readMemory(input: ReadMemoryInput): Promise<MemoryRecord | null>;
    updateMemory(input: UpdateMemoryInput): Promise<MemoryRecord>;
    deleteMemory(input: DeleteMemoryInput): Promise<boolean>;
    searchMemory(input: SearchMemoryInput): Promise<{
        query: string;
        results: MemoryRecord[];
    }>;
    listByType(memory_type: string): Promise<MemoryRecord[]>;
    removeTaskListMemory(uri: string): Promise<boolean>;
    archiveRecentlyMemory(uri: string): Promise<MemoryRecord>;
}
//# sourceMappingURL=memory-store.d.ts.map