import { EventEmitter } from 'node:events'; import type { TaskAssignmentPayload } from './specialized-agent.js'; import type { SafetyPolicy, VerifiedHandoff, BoundaryArtifact, AuditEntry } from './types.js'; export interface TwoAgentResult { readonly taskId: string; readonly status: 'completed' | 'rejected' | 'escalated' | 'failed'; readonly codeArtifacts: readonly BoundaryArtifact[]; readonly reviewArtifact: BoundaryArtifact | null; readonly codeHandoff: VerifiedHandoff | null; readonly reviewHandoff: VerifiedHandoff | null; readonly attempts: number; readonly auditTrail: readonly AuditEntry[]; } export declare class TwoAgentLoop extends EventEmitter { private messageBus; private compositionVerifier; private trustManager; private codeAgent; private reviewAgent; private auditTrail; private codebaseRoot; constructor(codebaseRoot: string, opts?: { codeModel?: string; reviewModel?: string; safetyPolicy?: SafetyPolicy; }); /** * Run the two-agent loop on a task. * Code Agent writes -> Assay verifies -> Review Agent reviews -> Assay verifies. * If rejected at any boundary, Code Agent gets feedback and retries. */ run(task: TaskAssignmentPayload, maxAttempts?: number): Promise; /** Get the current audit trail. */ getAuditTrail(): readonly AuditEntry[]; private writeArtifactsToDisk; private removeArtifactsFromDisk; private audit; }