/** * @oni.bot/core — Request/Reply coordination broker * * Enables request/response patterns between agents in a graph. * A requesting agent sends a typed payload to a target agent and * receives a promise that resolves when the target replies. */ export interface PendingRequest { id: string; from: string; to: string; payload: unknown; timestamp: number; resolved: boolean; response?: unknown; } /** Message object returned by request() and reply() — suitable for routing through the graph. */ export interface BrokerMessage { id: string; from: string; to: string; content: string; metadata: Record; timestamp: number; } export declare class RequestReplyBroker { private pending; private resolvers; private rejectors; private timeouts; /** * Create a request from one agent to another. * Returns the request id, a promise that resolves with the reply, * and a message object suitable for routing through the graph. */ request(from: string, to: string, payload: unknown, opts?: { timeoutMs?: number; }): { requestId: string; promise: Promise; message: BrokerMessage; }; /** * Reply to a pending request, resolving the caller's promise. * Returns a reply message object. */ reply(requestId: string, payload: unknown): BrokerMessage; /** Check whether an agent has any unresolved incoming requests. */ hasPending(agentId: string): boolean; /** Return all unresolved requests targeted at the given agent. */ getPending(agentId: string): PendingRequest[]; /** * Cancel all pending request timeouts and clear internal state. * Call when the broker is no longer needed to allow GC. */ dispose(): void; } //# sourceMappingURL=request-reply.d.ts.map