import type { Config } from '../../config/schema.js'; import type { AgentIPCMessage, AgentResponseMessage, AgentSignal, IPCPriority } from './types.js'; export interface TaskOptions { context?: string; priority?: IPCPriority; sessionKey?: string; callbackAgentId?: string; timeoutMs?: number; } export declare class AgentBus { private readonly appConfig; private readonly agentId; private readonly inbox; private responseHandlers; private unsubscribe?; constructor(appConfig: Config, _stateDir: string, agentId?: string); /** * Start listening for messages */ startListening(handler: (msg: AgentIPCMessage) => Promise): Promise; /** * Stop listening for messages */ stopListening(): void; /** * Send a task to another agent */ sendTask(targetAgentId: string, task: string, options?: TaskOptions): Promise; /** * Send a task and wait for response */ sendTaskAndWait(targetAgentId: string, task: string, options?: TaskOptions): Promise; /** * Send a signal to another agent */ sendSignal(targetAgentId: string, signal: AgentSignal, data?: unknown): Promise; /** * Wait for a response to a specific message */ waitForResponse(messageId: string, timeoutMs?: number): Promise; /** * Send a response to a message */ respond(toMessageId: string, toAgentId: string, success: boolean, data?: unknown, error?: string): Promise; /** * Get pending message count */ getPendingCount(): Promise; /** * Peek at pending messages */ peekPending(limit?: number): Promise; private deliverMessage; }