/** * A2A (Agent2Agent, Linux Foundation) Agent Card adapter — cards only. * * Maps ruflo's bespoke federation identity (`FederationManifest` / * `FederationNode`) to and from a spec-compliant A2A Agent Card so ruflo * nodes are discoverable by A2A peers and A2A peers appear in federation * discovery. This is an ADAPTER over the existing federation schema, not a * rewrite — A2A Tasks/messaging are deliberately out of scope. * * Spec: A2A Protocol 1.0.0 — https://a2a-protocol.org/latest/specification/ * (schema source of truth: specification/a2a.proto in a2aproject/A2A). * Required AgentCard fields per spec §4.4.1: name, description, * supportedInterfaces, version, capabilities, defaultInputModes, * defaultOutputModes, skills. */ import { FederationNode } from '../domain/entities/federation-node.js'; import type { FederationManifest } from '../domain/services/discovery-service.js'; /** A2A protocol version this adapter targets. */ export declare const A2A_PROTOCOL_VERSION = "1.0"; /** * Well-known URI for Agent Card discovery (A2A 1.0 §8.2 + IANA registration * §14). NOTE: earlier drafts used `/.well-known/agent.json`; 0.3.0+ settled * on `agent-card.json`. */ export declare const A2A_WELL_KNOWN_PATH = "/.well-known/agent-card.json"; /** * Open-form protocol binding string advertising ruflo's federation wire * (Ed25519-signed envelopes over WebSocket/QUIC). Spec §4.4.6 explicitly * allows non-core bindings: "This is an open form string, to be easily * extended for other protocol bindings." */ export declare const RUFLO_FEDERATION_BINDING = "RUFLO-FEDERATION"; /** * Extension URI carrying the bespoke federation identity inside the card * (spec §4.6 AgentExtension). Enables lossless round-trip in fromAgentCard. */ export declare const RUFLO_FEDERATION_EXTENSION_URI = "urn:ruflo:federation:manifest:v1"; export interface A2AAgentInterface { readonly url: string; readonly protocolBinding: string; readonly protocolVersion: string; readonly tenant?: string; } export interface A2AAgentSkill { readonly id: string; readonly name: string; readonly description: string; readonly tags: readonly string[]; readonly examples?: readonly string[]; readonly inputModes?: readonly string[]; readonly outputModes?: readonly string[]; } export interface A2AAgentExtension { readonly uri: string; readonly description?: string; readonly required?: boolean; readonly params?: Record; } export interface A2AAgentCapabilities { readonly streaming?: boolean; readonly pushNotifications?: boolean; readonly extensions?: readonly A2AAgentExtension[]; readonly extendedAgentCard?: boolean; } export interface A2AAgentProvider { readonly url: string; readonly organization: string; } export interface A2AAgentCard { readonly name: string; readonly description: string; readonly supportedInterfaces: readonly A2AAgentInterface[]; readonly version: string; readonly capabilities: A2AAgentCapabilities; readonly defaultInputModes: readonly string[]; readonly defaultOutputModes: readonly string[]; readonly skills: readonly A2AAgentSkill[]; readonly provider?: A2AAgentProvider; readonly documentationUrl?: string; readonly iconUrl?: string; readonly securitySchemes?: Record; readonly securityRequirements?: readonly Record[]; readonly signatures?: readonly { protected: string; signature: string; }[]; } export interface ToAgentCardOptions { /** Human-readable agent name; defaults to `ruflo-federation/`. */ readonly name?: string; /** Human-readable description override. */ readonly description?: string; readonly provider?: A2AAgentProvider; readonly documentationUrl?: string; /** * Extra spec-core interfaces to advertise ahead of the federation binding * (e.g. a JSONRPC endpoint once A2A messaging lands). First entry is the * preferred interface per spec. */ readonly additionalInterfaces?: readonly A2AAgentInterface[]; } /** * Generate a spec-compliant A2A Agent Card from a ruflo federation manifest. * Every agent type becomes an AgentSkill; the federation endpoint becomes a * `RUFLO-FEDERATION` interface; the bespoke identity (nodeId, publicKey, * complianceModes, manifest signature) rides in a spec §4.6 extension so * `fromAgentCard` can restore it. */ export declare function toAgentCard(manifest: FederationManifest, options?: ToAgentCardOptions): A2AAgentCard; export interface AgentCardValidation { readonly valid: boolean; readonly errors: readonly string[]; } /** * Structural validation against the A2A 1.0 AgentCard REQUIRED fields. * Intentionally strict on required shape, lenient on unknown extra fields * (forward compatibility with future spec minors). */ export declare function validateAgentCard(value: unknown): AgentCardValidation; /** * Map a validated remote A2A Agent Card into the bespoke federation registry * shape (a `FederationNode`) so A2A peers appear in federation discovery. * * Trust posture: A2A cards are self-describing metadata, NOT authenticated * federation manifests — consumed peers always enter at * `TrustLevel.UNTRUSTED` regardless of embedded identity claims. Trust is * earned afterwards through the normal handshake + TrustEvaluator path. */ export declare function fromAgentCard(card: A2AAgentCard, sourceUrl?: string): FederationNode; //# sourceMappingURL=agent-card.d.ts.map