import type { Message } from '../types.js'; import type { HistoryPersistence } from '../agent/types.js'; export interface JsonlHistoryPersistenceOptions { /** 存储目录(相对于 data 目录),默认 'history' */ dir?: string; /** 使用项目级目录({cwd}/data)而非全局目录(~/.agent/data) */ projectLocal?: boolean; /** 直接使用绝对路径(忽略 projectLocal 和 dir) */ absoluteDir?: string; } /** * Append-only JSONL 会话历史持久化 * * 文件路径:{dataDir}/{dir}/{sessionId}.jsonl * * 特点: * - Append-only:只追加不修改,保证审计完整性 * - JSONL 格式:每行一条 JSON,人类可读,可用 jq/grep 查询 * - 异步写入:不阻塞 Agent Loop * - 容错:损坏行跳过,不中断加载 */ export declare class JsonlHistoryPersistence implements HistoryPersistence { private dir; private projectLocal; private absoluteDir?; constructor(options?: JsonlHistoryPersistenceOptions); /** 获取会话历史文件路径 */ private getFilePath; /** 确保目录存在 */ private ensureDir; save(sessionId: string, message: Message): Promise; load(sessionId: string): Promise; delete(sessionId: string): Promise; exists(sessionId: string): Promise; } //# sourceMappingURL=history-persistence.d.ts.map