import type { Report, Triage } from '../triage/index.js'; import { type Symptom } from '../triage/grouping.js'; export interface ReportRecord { id: string; projectId: string; receivedAt: string; message: string; email?: string; triage: Triage; incidentId?: string; } export type IncidentStatus = 'open' | 'fixing' | 'pr_opened' | 'needs_human' | 'merged'; export interface IncidentRecord { id: string; projectId: string; title: string; description: string; /** Console errors from the reports; the fix engine reads file references out of them. */ stackTrace?: string; feature?: string; /** How reports are matched to this incident (see triage/grouping.ts). */ symptom?: Symptom; reportIds: string[]; status: IncidentStatus; prUrl?: string; issueUrl?: string; failureReason?: string; updatedAt: string; } /** * Reports and incidents, two JSON files. Reports of the same bug in one project (same feature, and the same error or * largely the same symptom: see triage/grouping.ts) share an incident, so ten customers hitting one bug produce one fix, * while two different bugs on one page get a fix each. * ponytail: whole-file rewrites; SQLite later. */ export declare class IncidentStore { private reportsFile; private incidentsFile; constructor(dir?: string); private read; private write; reports: () => ReportRecord[]; incidents: () => IncidentRecord[]; incident: (id: string) => IncidentRecord | undefined; /** Stores the report and attaches it to the incident it matches; a bug candidate that matches none opens one. */ addReport(projectId: string, report: Report, triage: Triage): { record: ReportRecord; incident?: IncidentRecord; isNew: boolean; }; update(id: string, patch: Partial>): IncidentRecord | undefined; byPullRequest(url: string): IncidentRecord | undefined; } //# sourceMappingURL=index.d.ts.map