/** * Type declarations for src/transports/amq-client.mjs * (kept in sync with the implementation; used for IDE + tsc checking) */ export interface AmqMessage { id?: string; from?: string; to?: string | string[]; subject?: string; kind?: string; thread?: string; body?: string; root?: string; priority?: string; created?: string; box?: string; [key: string]: unknown; } export interface WatchEvent { type: 'new_message' | 'existing'; messages: AmqMessage[]; } export interface AmqTransport { initMailbox(options: { root: string; agents?: string[] }): void; sendMessage(options: SendMessageOptions): AmqMessage; listInbox(options: ListInboxOptions): AmqMessage[]; drainInbox(options: { root: string; me: string }): AmqMessage[]; readMessage(options: { root: string; me: string; id: string }): AmqMessage; watchInbox(options: WatchInboxOptions): AsyncIterable; replyTo(options: ReplyToOptions): AmqMessage; waitForMessages(options: { root: string; me: string; timeoutMs?: number; pollMs?: number }): Promise; setPresence(options: { root: string; me: string; status?: string }): Record; listPresence(options: { root: string }): Array>; who(options: { root: string; me?: string }): Array>; listReceipts(options: { root: string; me: string; msgId?: string; stage?: string }): Array>; waitReceipt(options: { root: string; me: string; msgId: string; stage?: string; timeout?: string }): Record; monitorPeek(options: { root: string; me: string; timeout?: string; includeBody?: boolean }): Record; threadMessages(options: { root: string; me: string; id: string; includeBody?: boolean; limit?: number }): Array>; doctor(options: { root: string; ops?: boolean }): Record; formatMessage(message?: Partial): string; formatEvidence(message?: Partial, options?: { root?: string; self?: string; label?: string }): string; hasAmq(): boolean; } export interface ListInboxOptions { root: string; me: string; box?: 'new' | 'cur'; from?: string; kind?: string; priority?: string; limit?: number; offset?: number; } export interface WatchInboxOptions { root: string; me: string; signal?: AbortSignal; poll?: boolean; debounceMs?: number; debounceMaxMs?: number; retryBaseMs?: number; retryMaxMs?: number; } export interface SendMessageOptions { root: string; me: string; to: string; body: string; subject?: string; kind?: string; priority?: string; thread?: string; waitFor?: string; waitTimeout?: string; } export interface ReplyToOptions { root: string; me: string; id: string; body: string; subject?: string; kind?: string; priority?: string; waitFor?: string; waitTimeout?: string; } export function hasAmq(): boolean; export function initMailbox(options: { root: string; agents?: string[] }): void; export function createAmqTransport(): AmqTransport; export function sendMessage(options: SendMessageOptions): AmqMessage; export function listInbox(options: ListInboxOptions): AmqMessage[]; export function drainInbox(options: { root: string; me: string }): AmqMessage[]; export function readMessage(options: { root: string; me: string; id: string }): AmqMessage; export function watchInbox(options: WatchInboxOptions): AsyncIterable; export function replyTo(options: ReplyToOptions): AmqMessage; export function waitForMessages(options: { root: string; me: string; timeoutMs?: number; pollMs?: number }): Promise; export function setPresence(options: { root: string; me: string; status?: string }): Record; export function listPresence(options: { root: string }): Array>; export function who(options: { root: string; me?: string }): Array>; export function listReceipts(options: { root: string; me: string; msgId?: string; stage?: string }): Array>; export function waitReceipt(options: { root: string; me: string; msgId: string; stage?: string; timeout?: string }): Record; export function monitorPeek(options: { root: string; me: string; timeout?: string; includeBody?: boolean }): Record; export function threadMessages(options: { root: string; me: string; id: string; includeBody?: boolean; limit?: number }): Array>; export function doctor(options: { root: string; ops?: boolean }): Record; export function formatMessage(message?: Partial): string; export function formatEvidence(message?: Partial, options?: { root?: string; self?: string; label?: string }): string;