import { EventEmitter } from 'node:events'; import type { AgentMessage, MultiAgentMessageType, BoundaryVerificationStatus, BoundaryClaim } from './types.js'; export interface ConversationThread { readonly threadId: string; readonly taskId: string; readonly participants: string[]; readonly messages: AgentMessage[]; readonly status: 'active' | 'completed' | 'blocked' | 'escalated'; readonly startedAt: string; readonly completedAt?: string; } export declare class MessageBus extends EventEmitter { private threads; private allMessages; /** * Send a message from one agent to another. * Messages are logged and emitted for consumption. */ send(sender: string, recipient: string, type: MultiAgentMessageType, payload: T, opts?: { threadId?: string; replyTo?: string; claims?: readonly BoundaryClaim[]; verificationStatus?: BoundaryVerificationStatus; }): AgentMessage; /** * Update the verification status of a message after boundary verification. */ updateVerificationStatus(messageId: string, status: BoundaryVerificationStatus, claims?: readonly BoundaryClaim[]): void; /** * Get all messages for a specific agent (inbox). */ getInbox(agentId: string): AgentMessage[]; /** * Get all messages sent by a specific agent (outbox). */ getOutbox(agentId: string): AgentMessage[]; /** * Get a specific conversation thread. */ getThread(threadId: string): ConversationThread | undefined; /** * Get all threads. */ getAllThreads(): ConversationThread[]; /** * Complete a thread. */ completeThread(threadId: string): void; /** * Get all messages (for audit trail). */ getAllMessages(): readonly AgentMessage[]; /** * Get message count for a thread. */ getThreadMessageCount(threadId: string): number; }