import type { OrgDaemon, RunningOrg } from './daemon.js'; /** * Resolves an org_send `to` address ("role" for same-org, "org:role" for * cross-org) into its parts. Centralizes the one addressing rule that * matters (an "own-org:role" self-prefix is intra-org, not cross-org) so * deliver()/deliverRemote() don't each re-derive it — the qualified `to` * string returned is always the canonical display form for that address. */ export declare function resolveAddress(fromOrg: string, to: string): { cross: boolean; orgName: string; role: string; qualified: string; }; /** Mailbox bodies are unbounded — a pasted 20KB file would persist in the * recipient's context for the whole run. Bodies over MAIL_BODY_MAX are * written to /.mail/.md and replaced with a ~1KB * digest plus a pointer; smaller messages stay byte-identical. */ export declare function mailBody(root: string, orgName: string, org: RunningOrg | undefined, header: string, body: string, id: string): string; /** Route a message. to = "role" (same org) or "org:role" (cross-org). Returns a receipt string. */ export declare function deliver(daemon: OrgDaemon, fromOrg: string, fromRole: string, to: string, subject: string, body: string): Promise; /** Inbound handler for cross-process delivery — called by the server's POST /api/xdeliver route * when ANOTHER process's deliverRemote() reaches this daemon. Pushes straight into the target * agent's mailbox; the agent picks it up on its own next turn (see Mailbox — never interrupts). */ export declare function receiveRemote(daemon: OrgDaemon, toOrg: string, toRole: string, fromQualified: string, subject: string, body: string): { ok: true; receipt: string; } | { ok: false; error: string; }; //# sourceMappingURL=cross-org.d.ts.map