/** * 执行日志系统 * 记录所有执行操作的日志 */ export interface LogEntry { timestamp: string; level: 'info' | 'success' | 'warning' | 'error'; message: string; taskId?: string; workerId?: string; metadata?: Record; } export interface ExecutionLog { sessionId: string; startTime: string; endTime?: string; command: string; entries: LogEntry[]; stats: { tasksCompleted: number; tasksFailed: number; deliverablesCreated: number; }; } export interface RuntimeObservationEventSummary { timestamp: string; message: string; taskId: string | null; workerId: string | null; permissionProfile: string | null; stage: string | null; result: string | null; reason: string | null; } export interface RuntimeObservationSummary { sessionId: string; startTime: string; endTime?: string; completed: number; failed: number; blocked: number; deliverables: number; lastEvent: string | null; lastTaskId: string | null; permissionProfile: string | null; signals: { readyTasks: number; blockedTasks: number; pendingReview: number; unreadMessages: number; } | null; events: RuntimeObservationEventSummary[]; recentEvents: RuntimeObservationEventSummary[]; } /** * 日志管理器 */ export declare class LogManager { private sessionId; private log; private logPath; private basePath; private initialized; constructor(command: string, basePath?: string, sessionId?: string); /** * 如果已有日志文件,加载已有内容而不是覆盖 */ private ensureLoaded; /** * 记录日志 */ addEntry(level: LogEntry['level'], message: string, options?: { taskId?: string; workerId?: string; metadata?: Record; }): Promise; /** * 记录任务完成 */ taskCompleted(): void; /** * 记录任务失败 */ taskFailed(): void; /** * 记录交付物创建 */ deliverableCreated(): void; /** * 结束会话 */ end(): Promise; /** * 保存日志 */ private save; getSessionId(): string; } /** * 读取历史日志 */ export declare function getExecutionLogs(basePath?: string): Promise; /** * 获取指定会话的日志 */ export declare function getLog(sessionId: string, basePath?: string): Promise; export declare function getLatestRuntimeObservation(basePath?: string): Promise; export declare function getRuntimeObservation(sessionId: string, basePath?: string): Promise; //# sourceMappingURL=logger.d.ts.map