import type { GlobalAgentMessage, RuntimeAddress } from "../seams/messaging-contract.js"; /** A sender whose `from` cannot be turned into a canonical address cannot be attributed at all. */ export declare class UnattributableSenderError extends Error { constructor(reason: string); } /** * THE OWNER CHECK ON ITS OWN — the reason this envelope cannot be attributed here, or `undefined`. * * SEPARATED FROM THE RENDERING (review r1, D1) because it is a DECISION and rendering is an effect, * and the three delivery paths need the decision at a different moment than the string: before any * push, outside every `try`, so that one envelope gets one answer whichever handle shape a host * attached. Evaluated inside a `try` whose `catch` maps to `delivery_uncertain`, the same refusal * became "the delivery may have occurred" for a message that provably never left the router — and * WS-10 §12's recovery contract then forbids retrying it, so a clean side-effect-free "no" turned into * a permanently ambiguous record. * * `owner` is the session whose input stream this is going into. A claimed CHILD sender is only * attributable by the session that owns that child (WS-10 §10.3), so an `agent:` origin from somewhere * else is refused rather than rendered with an address this side cannot vouch for. Pass `undefined` to * skip the check — for the official branch's owner-qualified relay, where the message is deliberately * being handed to a parent that does NOT own the sender. */ export declare function unattributableReason(message: GlobalAgentMessage, owner?: { winterSessionId: string; }): string | undefined; /** * The attributed turn, byte-for-byte as the Winter runtime renders it. * * Throws `UnattributableSenderError` on the same condition `unattributableReason` names, so a caller * that renders without checking still cannot produce an unattributable frame — but every caller in * this package checks FIRST, because a throw at this point is an effect-free refusal and must be * reported as one. */ export declare function renderAttributedTurn(message: GlobalAgentMessage, owner?: { winterSessionId: string; }): string; /** * The owner-qualified form: the same frame, plus the address the message was actually FOR. * * WS-15 §6.2's official-child rows are the only user: "Native child messaging through the active * owning parent session", and "the public result stays owner-qualified" — the official runtime has no * out-of-band door into a child, so a message for one is delivered to the owning parent, which is a * different fact from a message TO the parent and must not read like one. The `for` attribute is * router-authored (it is the resolved canonical address, not anything a sender wrote), so it is * escaped for the same defensive reason `from` is and can no more be forged than `from` can. */ export declare function renderOwnerQualifiedTurn(message: GlobalAgentMessage, target: RuntimeAddress): string;