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<void>): Promise<void>;
    /**
     * Stop listening for messages
     */
    stopListening(): void;
    /**
     * Send a task to another agent
     */
    sendTask(targetAgentId: string, task: string, options?: TaskOptions): Promise<string>;
    /**
     * Send a task and wait for response
     */
    sendTaskAndWait(targetAgentId: string, task: string, options?: TaskOptions): Promise<AgentResponseMessage>;
    /**
     * Send a signal to another agent
     */
    sendSignal(targetAgentId: string, signal: AgentSignal, data?: unknown): Promise<void>;
    /**
     * Wait for a response to a specific message
     */
    waitForResponse(messageId: string, timeoutMs?: number): Promise<AgentResponseMessage>;
    /**
     * Send a response to a message
     */
    respond(toMessageId: string, toAgentId: string, success: boolean, data?: unknown, error?: string): Promise<void>;
    /**
     * Get pending message count
     */
    getPendingCount(): Promise<number>;
    /**
     * Peek at pending messages
     */
    peekPending(limit?: number): Promise<AgentIPCMessage[]>;
    private deliverMessage;
}
