import type { DriftMetrics, ParsedFrame } from '../types/index.js'; import { BaselineStore } from './baseline.js'; import { TripwireInjector } from './tripwire.js'; import { CircuitBreaker } from './circuit-breaker.js'; export interface MonitorConfig { baselineTestInterval: number; tripwireRate: number; embeddingWindowSize: number; driftThreshold: number; } export declare class ContinuousMonitor { private config; private baselineStore; private tripwireInjector; private circuitBreaker; private frameValidator; private frameResolver; private agentMetrics; private agentEmbeddings; private lastBaselineTest; private crossAgentBehavior; private enabled; constructor(baselineStore: BaselineStore, tripwireInjector: TripwireInjector, circuitBreaker: CircuitBreaker, config?: Partial); /** * Enable or disable monitoring. */ setEnabled(enabled: boolean): void; /** * Update configuration. */ setConfig(config: Partial): void; /** * Record an operation for an agent (simple version). * Used by DriftDetectionEngine. */ recordOperation(agentId: string, frame: string | ParsedFrame, action: string | string[], success: boolean, senderId?: string): DriftMetrics; /** * Record an operation for an agent (full version). * This is called after every frame processing. */ private _recordOperation; /** * Get metrics for an agent. */ getMetrics(agentId: string): DriftMetrics; /** * Record an embedding for trend tracking. */ private recordEmbedding; /** * Calculate drift from embedding trend. */ private calculateEmbeddingDrift; /** * Calculate trend direction. */ private calculateTrend; /** * Record cross-agent behavior for emergent protocol detection. */ private recordCrossAgentBehavior; /** * Check for emergent protocol patterns. */ private checkEmergentProtocol; /** * Run a baseline test for an agent. */ runBaselineTest(agentId: string): void; /** * Record a drift alert. */ private recordDriftAlert; /** * Get drift status for an agent. */ getDriftStatus(agentId: string): { metrics: DriftMetrics; circuitState: string; isAllowed: boolean; driftScore: number; operationCount: number; circuitBreakerState: 'closed' | 'open' | 'half-open'; }; /** * Get all agent metrics. */ getAllMetrics(): DriftMetrics[]; /** * Get all agent IDs being tracked. */ getAllAgentIds(): string[]; /** * Reset an agent's monitoring data. */ resetAgent(agentId: string): void; /** * Clear all monitoring data. */ clearAll(): void; /** * Get drift history for an agent. */ getDriftHistory(agentId: string, since?: number, limit?: number): Array<{ timestamp: number; driftScore: number; frame: string; action: string; alert?: { type: string; message: string; }; }>; } //# sourceMappingURL=monitor.d.ts.map