import type { XRayResult } from './types.js';
export type XRayTargetType = 'npm' | 'file' | 'dir';
export type XRayActivityKind = 'scan' | 'watch' | 'preinstall';
export type XRayActivityStatus = 'pass' | 'warn' | 'blocked' | 'detected';
export interface XRayHistoryEntry {
    id: string;
    target: string;
    targetType: XRayTargetType;
    deepScan: boolean;
    trustScore: number;
    riskLevel: XRayResult['riskLevel'];
    filesScanned: number;
    findingCount: number;
    scannedAt: string;
    result: {
        target: string;
        trustScore: number;
        riskLevel: XRayResult['riskLevel'];
        findings: XRayResult['findings'];
        filesScanned: number;
        scannedAt: string;
        deepScan: boolean;
    };
}
export interface XRayActivityEntry {
    id: string;
    kind: XRayActivityKind;
    status: XRayActivityStatus;
    target: string;
    targetType: XRayTargetType;
    deepScan: boolean;
    trustScore: number;
    riskLevel: XRayResult['riskLevel'];
    filesScanned: number;
    findingCount: number;
    scannedAt: string;
    summary: string;
}
export interface XRayWatchSessionEntry {
    id: string;
    root: string;
    deepScan: boolean;
    startedAt: string;
    lastHeartbeatAt: string;
    endedAt: string | null;
    active: boolean;
    state: 'active' | 'stale' | 'ended';
    changesDetected: number;
    findingsDetected: number;
    highestRiskLevel: XRayResult['riskLevel'];
    lastEventAt: string | null;
    lastEventSummary: string | null;
}
export declare function serializeXRayResult(result: XRayResult): {
    target: string;
    trustScore: number;
    riskLevel: "LOW" | "MEDIUM" | "HIGH" | "CRITICAL" | "SAFE";
    findings: import("./types.js").XRayFinding[];
    filesScanned: number;
    scannedAt: string;
    deepScan: boolean;
};
export declare function createHistoryEntry(result: XRayResult, targetType: XRayTargetType): XRayHistoryEntry;
export declare function readHistory(): XRayHistoryEntry[];
export declare function getHistoryEntry(id: string): XRayHistoryEntry | null;
export declare function appendHistory(entry: XRayHistoryEntry): void;
export declare function appendActivity(entry: Omit<XRayActivityEntry, 'id'>): XRayActivityEntry;
export declare function readActivity(limit?: number): XRayActivityEntry[];
export declare function readWatchSessions(): XRayWatchSessionEntry[];
export declare function startWatchSession(root: string, deepScan: boolean): XRayWatchSessionEntry;
export declare function heartbeatWatchSession(sessionId: string): XRayWatchSessionEntry | null;
export declare function recordWatchSessionEvent(sessionId: string, payload: {
    findingsDetected: number;
    riskLevel: XRayResult['riskLevel'];
    summary: string;
    scannedAt?: string;
}): XRayWatchSessionEntry | null;
export declare function endWatchSession(sessionId: string): XRayWatchSessionEntry | null;
export declare const DETECTION_EVENTS_FILE: string;
export declare function emitDetectionEvent(event: {
    target: string;
    findingCount: number;
    riskLevel: string;
    severity: string;
    summary: string;
}): void;
export declare function readAndClearDetectionEvents(): Array<Record<string, unknown>>;
