CX · Reference guidea2a-xap
PlaygroundDownloadsAboutv0.17.0

a2a-xap

A2A tasks over the xap substrate (EXPERIMENTAL x/ tier, #6 Y2b). An A2A agent's task lifecycle is recorded into a cx-stdlib/journal — an append-only, hash-chained log — so task history is replayable (journal:slice + lifecycle) and tamper-evident (journal:verify) for free, rather than living in a bespoke task store. task-event shapes a transition; record appends it (returning the committed entry); history reads the ordered entries; lifecycle projects them to the state path. Messages map to a cx-stdlib/bus (message-envelope + publish-message) for live pub/sub fan-out — the complement to the durable journal. Auth maps to cx-stdlib/did + vc: an agent is a DID, and authority is a DID-signed capability delegation carried as a Verifiable Credential (agent-did / grant-credential / grant-status) — decentralized, verifiable, and the input to #7's PEP. Together (journal + bus + did/vc) this is the distinctive A2A-over-xap positioning.

Experimental x/ tier — imported as cx-x/a2a-xap. Bundled and gated in-tree like any other module, but EXEMPT from the frozen-surface stability promise (std-lib README, decision D3): a semver-breaking change is allowed here while the surface settles, and the frozen-surface canary never counts it. Pin behaviour you depend on with your own fixtures.

a2a-xap:task-event

[$a2a-xap:task-event] ($id::string $state::string $address::string '') -> element — Shape one A2A task transition [a2a-task id= state= address=?] as a journalable element; address carries the Tier-1 subject (the proposal address for input-required).

a2a-xap:propose-task

[$a2a-xap:propose-task] ($jr::element $id::string $proposal::element) -> element — Park a task pending approval: journal the input-required transition carrying the proposal's Tier-1 address — the durable, replayable pending-approval record (approval happens out-of-band).

a2a-xap:approval-credential

[$a2a-xap:approval-credential] ($issuer-did::string $issuer-key::bytes $subject-did::string $proposal-address::string $opts::map) -> element — Issue a DID-signed credential whose delegation subject IS the proposal address — the same delegation value shape the PEP consumes, so A2A-carried approvals and authz approvals speak one language.

a2a-xap:record

[$a2a-xap:record] -> element — Append a task transition to the journal, returning the committed hash-chained [entry].

a2a-xap:history

[$a2a-xap:history] -> [sequence element] — Read the recorded task entries in sequence order (the replayable lifecycle).

a2a-xap:lifecycle

[$a2a-xap:lifecycle] -> [sequence string] — Project recorded entries to their ordered state path, e.g. ('submitted', 'working', 'completed').

a2a-xap:message-envelope

[$a2a-xap:message-envelope] -> element — Wrap an A2A message as a topic-carrying bus message on the :a2a-message topic.

a2a-xap:publish-message

[$a2a-xap:publish-message] -> element — Emit an A2A message to the bus; the delivery report's @delivered count is the subscriber fan-out.

a2a-xap:agent-did

[$a2a-xap:agent-did] -> string — Derive the DID identifying an agent from its Ed25519 public key.

a2a-xap:grant-credential

[$a2a-xap:grant-credential] -> element — Issue a DID-signed capability delegation (a Verifiable Credential) from an issuer agent to a subject agent.

a2a-xap:grant-status

[$a2a-xap:grant-status] -> string — Verify a grant credential at a given time, returning its status ('valid'/'expired'/'revoked'/…) — the PEP authz gate.