/**
 * FederationPort — agent-to-agent messaging with cryptographic provenance (S4 spec).
 *
 * Implements A2A v1.0 transport (JWS RFC 7515) superset with Vauban Claim sextuplet
 * payload. Messages routed by consistent hashing on tenant_id. Delegation chains preserved.
 * Ed25519 signatures over CBOR canonical encoding.
 *
 * Spec: docs/plans/PreCarre/canonical/specs/S4.md
 */
// ─── Typed errors ─────────────────────────────────────────────────────────────
export class FederationSignatureInvalidError extends Error {
    messageId;
    reason;
    constructor(messageId, reason) {
        super(`Federation signature invalid (${messageId}): ${reason}`);
        this.messageId = messageId;
        this.reason = reason;
        this.name = "FederationSignatureInvalidError";
        Object.setPrototypeOf(this, new.target.prototype);
    }
}
export class FederationRoutingError extends Error {
    tenantId;
    reason;
    constructor(tenantId, reason) {
        super(`Federation routing failed for tenant ${tenantId}: ${reason}`);
        this.tenantId = tenantId;
        this.reason = reason;
        this.name = "FederationRoutingError";
        Object.setPrototypeOf(this, new.target.prototype);
    }
}
export class FederationDelegationChainError extends Error {
    messageId;
    chainDepth;
    reason;
    constructor(messageId, chainDepth, reason) {
        super(`Federation delegation chain invalid (${messageId}, depth=${chainDepth}): ${reason}`);
        this.messageId = messageId;
        this.chainDepth = chainDepth;
        this.reason = reason;
        this.name = "FederationDelegationChainError";
        Object.setPrototypeOf(this, new.target.prototype);
    }
}
export class FederationMessageExpiredError extends Error {
    messageId;
    notAfter;
    constructor(messageId, notAfter) {
        super(`Federation message expired (${messageId}): not_after=${notAfter}`);
        this.messageId = messageId;
        this.notAfter = notAfter;
        this.name = "FederationMessageExpiredError";
        Object.setPrototypeOf(this, new.target.prototype);
    }
}
//# sourceMappingURL=federation.js.map