/**
 * 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
 */
export type Protocol = "mcp" | "a2a-jsonrpc" | "a2a-grpc" | "http-gateway";
export interface AgentRef {
    readonly agent_id: string;
    readonly tenant_id: string;
    readonly agent_card_url?: string;
}
export interface FederationMessageHeader {
    readonly message_id: string;
    readonly from_agent: AgentRef;
    readonly to_agent: AgentRef;
    readonly correlation_id: string;
    readonly causation_id?: string;
    readonly timestamp: string;
    readonly nonce: string;
}
export interface TransportMeta {
    readonly protocol: Protocol;
    readonly version: string;
    readonly jws_signature: string;
}
/**
 * Content claim payload — Vauban Claim sextuplet.
 * Domain normalized to "vauban.federation.message.v1" for all S4 messages.
 */
export interface ContentClaim {
    readonly subject: string;
    readonly predicate: {
        readonly domain: "vauban.federation.message.v1";
        readonly body: Record<string, unknown>;
    };
    readonly evidence: {
        readonly proof: string;
        readonly public_inputs: Record<string, unknown>;
    };
    readonly temporal_frame: {
        readonly not_before: string;
        readonly not_after: string;
        readonly revoked_at?: string | null;
    };
    readonly revelation_mask: {
        readonly disclosed: string[];
        readonly committed: string[];
    };
    readonly anchor: ReadonlyArray<{
        readonly chain: "StarknetMainnet" | "StarknetL3Glacis";
        readonly tx_hash?: string;
    }>;
}
export interface FederationMessage {
    readonly id: string;
    readonly header: FederationMessageHeader;
    readonly content_claim: ContentClaim;
    readonly transport: TransportMeta;
    readonly delegation_chain?: ReadonlyArray<{
        readonly id: string;
        readonly parent_id?: string;
        readonly scope: {
            readonly capabilities: ReadonlyArray<string>;
            readonly constraints: ReadonlyArray<unknown>;
            readonly jurisdictions: ReadonlyArray<string>;
            readonly expires_at: string;
        };
        readonly ed25519_sig: string;
    }>;
}
export type MessageId = string;
export interface VerifyResult {
    readonly valid: boolean;
    readonly errors: string[];
    readonly signer_agent_id?: string;
    readonly chain_depth?: number;
}
export interface ReceiveOpts {
    readonly destinationTenantId?: string;
    readonly timeout?: number;
    readonly maxMessages?: number;
}
export interface FederationPort {
    /**
     * Send a message to another agent.
     * Message is JWS-signed and routed by consistent hashing on destination tenant_id.
     * Returns message_id on success.
     */
    send(message: FederationMessage, opts?: {
        timeoutMs?: number;
    }): Promise<MessageId>;
    /**
     * Receive pending messages (subscriber pattern).
     * Messages are routed to this agent's tenant by consistent hash.
     * Returns empty array if no messages within timeout window.
     */
    receive(opts?: ReceiveOpts): Promise<FederationMessage[]>;
    /**
     * Verify JWS signature and Claim sextuplet integrity.
     * Checks Ed25519 signature, CBOR canonicalization, temporal bounds, delegation chain narrowing.
     * Does NOT verify on-chain anchor (separate concern).
     */
    verifyMessage(msg: FederationMessage): Promise<VerifyResult>;
    /**
     * Acknowledge a received message to mark it as consumed.
     * Prevents redelivery.
     */
    ack(messageId: MessageId): Promise<void>;
    /**
     * Nack a message to return it to the queue (poison pill protection).
     * Max 3 nacks per message, then dead-letter.
     */
    nack(messageId: MessageId, reason?: string): Promise<void>;
}
export declare class FederationSignatureInvalidError extends Error {
    readonly messageId: string;
    readonly reason: string;
    constructor(messageId: string, reason: string);
}
export declare class FederationRoutingError extends Error {
    readonly tenantId: string;
    readonly reason: string;
    constructor(tenantId: string, reason: string);
}
export declare class FederationDelegationChainError extends Error {
    readonly messageId: string;
    readonly chainDepth: number;
    readonly reason: string;
    constructor(messageId: string, chainDepth: number, reason: string);
}
export declare class FederationMessageExpiredError extends Error {
    readonly messageId: string;
    readonly notAfter: string;
    constructor(messageId: string, notAfter: string);
}
//# sourceMappingURL=federation.d.ts.map