/** * AlertDetector - 错误检测器 * 基于 SPEC-SRV-005: Detector 架构重构 * * 职责:检测高危的运行时错误 */ import type { ErrorSummary } from '../types'; export type IssueSeverity = 'critical' | 'warning' | 'info'; export declare class AlertDetector { private alertDir; private errorPath; private lastAlertTime; /** * @param projectRoot 用户项目根目录,告警将写入 /.agent-aware/alert/ * 默认从环境变量 USER_PROJECT_ROOT 读取,如果未设置则使用 process.cwd() */ constructor(projectRoot?: string); /** * 计算严重级别 */ calculateSeverity(errorSummary: ErrorSummary): IssueSeverity; /** * 检测并写入问题 */ checkAndAlert(errorSummary: ErrorSummary): Promise; /** * 读取现有的告警数据 */ private readAlerts; /** * 写入 error.json(保留历史记录,最多 100 条) */ private writeAlert; /** * 生成问题描述 */ private generateDescription; } //# sourceMappingURL=alertDetector.d.ts.map