Skip to documentation
KonclaveDocumentationSource snapshot · Apache 2.0
Browse documentation

A2A and protocol reference

Use this page to choose an interoperability boundary, implement an A2A adapter, or consume the native wire contracts. The detailed compatibility profiles...

GuideSource revision 8d0d3676e9fcView authoritative source

Repository-relative paths and “this checkout” refer to the Konclave source repository, not this website. The source link above identifies the exact revision used here.

On this page

Use this page to choose an interoperability boundary, implement an A2A adapter, or consume the native wire contracts. The detailed compatibility profiles remain authoritative: A2A and native protocol.

Choose the boundary

Wide tables scroll horizontally.

Reader goalStart hereImportant boundary
Call an HTTP agentA2AHttpJsonClient in client.rsStandard A2A exposes plaintext to the gateway.
Publish or discover an agentA2A profile, Konclave.A2ADiscoveryCards, labels, skills, catalogs, and OASF metadata are discovery, not authority.
Route a task to KonclaveBridge guideOperator-selected conversation and exact target; web callers cannot choose native authority.
Replace task persistenceTask-store contractPreserve atomicity and exact-retry semantics, not just CRUD shapes.
Publish output artifactsArtifact profileExplicit output publication; ordinary response text is not an artifact.
Implement a native peerNative compatibility and security obligationsA validating protobuf codec is not authentication, authorization, or durable replay protection.

Standard bridging and protected handoff solve different problems. Standard HTTP interoperability is simpler but trusts the gateway with plaintext. Protected handoff uses the native Konclave path; it is not an encrypted A2A Part. A protected-required card is rejected by the standard gateway/client. An optional protected profile permits explicitly selected standard mode, not automatic downgrade. Web authentication grants no native identity, membership, role, or collaboration-policy authority.

Supported HTTP profile

The vendored schema is A2A v1.0.1; the supported protocol version is 1.0, HTTP+JSON. This is a narrowed initial profile, not every feature represented by the upstream DTOs.

Wide tables scroll horizontally.

Input or outputContract
Initial requestOne USER message with one nonempty text/plain part; text at most 64 KiB. No incoming task identifier.
Caller identifiersCanonical ASCII message/context identifiers, at most 128 bytes; gateway task identifiers are 32 lowercase hexadecimal characters.
Unsupported request contentBytes, URLs, structured data, filenames, metadata, extensions, references, push configuration, and alternate output modes.
HistoryRequested length is 0 or 1. Task-list projections suppress content/history/status prose.
Encoded boundsRequest 128 KiB; Agent Card 256 KiB; response 256 KiB.
ListingDefault page 50, maximum 256; artifact-inclusive pages default/max 8. Artifacts are omitted by default.
HTTP media typeapplication/a2a+json; inbound compatibility application/json is accepted. If supplied, A2A-Version must be exactly 1.0.
InterfacesCanonical HTTPS without credentials/query/fragment/backslashes/control characters. HTTP is limited to explicit loopback development.

The gateway guide owns endpoint and error details. Its send/get/list/stream/subscribe routes authenticate and authorize before inspecting bodies, tenant/task identity, or persistence. Metadata listing and artifact-inclusive listing are separate authorization actions. Denial uses HTTP 401/403; unavailable authentication uses 503 with Retry-After. Cancellation authenticates and authorizes but returns UNSUPPORTED_OPERATION; push paths return PUSH_NOTIFICATION_NOT_SUPPORTED. Do not implement application cancellation by treating a closed HTTP connection as a cancel command.

A2AHttpClientConfig::new accepts a nonzero timeout up to 60 seconds and a nonzero response limit no larger than the profile maximum; defaults are 60 seconds and that maximum. A2AHttpJsonClient::new accepts a validated card and optional A2ABearerCredential, checks the tenant on requests, and validates response identity. Its protected HTTP client disables redirects and automatic proxy discovery. Mutual-TLS cards require a deployment-specific client; this client returns UnsupportedAuthentication rather than silently changing authentication.

A maintained call sequence

The executable example owner is outbound_client_round_trips_server_tasks_cards_and_etags. It compiles a loopback publication, injects a completing submitter and SQLite store, constructs A2AHttpJsonClient, then exercises:

  1. send_message with a validated initial text request.
  2. A2ATaskId::parse on the returned identity, then get_task(..., Some(0)).
  3. Authenticated extended-card retrieval and metadata-only list_tasks.
  4. send_streaming_message, terminal completion, and finite stream closure.
  5. Public card fetch and conditional ETag retrieval.

Request construction is in the test’s common::request_with_message_id: tenant tenant-a, context context-1, one text part, no incoming task ID, explicit history and return_immediately. The publication fixture is a2a/examples/agent-publication.json. These are source-backed test examples, not evidence that tests were rerun for this documentation.

Waiting, retries, bridge recovery, and streams

Wide tables scroll horizontally.

EventCaller-visible consequence
Normal blocking sendWait defaults to 30 seconds with 250 ms polling; configurable limits are 5 minutes and 1 second respectively. Submission time counts toward the deadline.
returnImmediatelyStill submits and reloads the durable task; it is not a promise that native work already ran.
Wait deadlineHTTP 504; the gateway does not fabricate a terminal task state.
Exact retry while SUBMITTED/WORKINGReinvokes the idempotent submitter using the same immutable task identity. Changed creation content conflicts.
Stream connectionSnapshot first, then immutable artifact updates and ordered statuses; finite observation deadline.
Stream disconnectEnds the projection observer, not native execution or the bridge response observer. Reconnect using a fresh subscription; there is no wire resume cursor.

The bridge maps one task to send_directed_request using an operator-configured conversation and exact device. It derives a deterministic message ID and uses the same identity as the local RPC RequestId. Exact resend reconciles the daemon request ledger and durable send identity. Send results must match the configured identities before SUBMITTED becomes WORKING.

Only an inbound text reply from the configured sender/conversation, replying to the exact request, can complete the bridge task. Appending that AGENT message and the WORKING-to-COMPLETED transition are idempotent. A reply over 64 KiB fails with konclave_response_out_of_bounds; it is never truncated. Initial permanent rejection may reject a still-SUBMITTED task but cannot overwrite WORKING.

Bridge observation defaults to 5 minutes, maximum 24 hours; retry delay is at most 5 seconds. Observer capacity defaults to 256, maximum 1024, and is reserved before send. Expiry leaves the task WORKING. Restart recovery is driven by an exact caller resend, not automatic startup enumeration. Relay admission, local persistence, receipts, and request claims do not guarantee remote execution.

Task-store and artifact extension points

A2ATaskStore is a synchronous semantic contract; A2AGatewayApplication::new accepts a portable store while open_sqlite supplies the shipped single-gateway SQLite implementation. The gateway and bridge must share the same logical store.

Implementers must preserve:

  • The key (agent, optional tenant, task) and immutable route/context/source/options/ text digest. Exact retry returns the original identity even after content pruning.
  • Atomic creation of SUBMITTED generation 0, initial status, and USER message.
  • Expected-generation transitions: SUBMITTED to WORKING or terminal, WORKING to terminal; no INPUT_REQUIRED/AUTH_REQUIRED. Terminal states are immutable.
  • Append-only message/artifact identity: exact content retries preserve the first timestamp; changed content conflicts. COMPLETED needs an AGENT message or complete canonical artifact; other terminal states need bounded reasons.
  • Atomic snapshots and retention tombstones. Active tasks are not pruned; idempotency retention outlives content retention.

Use the optional test-support feature’s A2ATaskStoreContractFixture and assert_a2a_task_store_contract, including independent handles and reopen behavior. The canonical guide owns all configuration bounds and conformance requirements. SQLite full synchronization and a process mutex do not provide cross-replica fencing. The standard task store contains plaintext, not the daemon’s sealed profile state.

Artifacts are output-only: 1–8 parts, at most 64 KiB aggregate inline content, 192 KiB canonical document, and 8 artifacts per task within the response bound. Supported profiles include canonical text, finite canonical JSON, explicitly typed raw bytes, and encrypted content-addressed URL descriptors. Filenames are safe basenames; metadata/extensions are not supported.

A2AArtifactObjectStore requires content-address verification and exact-repeat idempotency. Override open_object for incremental bounded reading; its compatibility default materializes get. FileA2AArtifactObjectStore is the shipped owner-protected filesystem adapter. A2AGatewayArtifactPublisher is bound to the exact route; exact retries remain idempotent after terminalization, while changed content under one artifact ID conflicts. No managed backend is implied by these traits.

The client never automatically fetches arbitrary output URLs. Explicit encrypted artifact retrieval removes the secret fragment, sends no A2A authorization header, disables redirects/proxies, and verifies exact length, SHA-256, and descriptor-bound AES-GCM. The ciphertext service supports bounded GET /sha256/{ciphertext-sha256}, not HEAD or range requests. See the artifact profile before implementing storage or retrieval.

Native protobuf ownership and release profile

Authored native schemas live under proto/konclave/protocol/v1, separately from vendored A2A. Konclave.ProtocolContracts exposes generated wire::v1 DTOs and validating v1 codecs; Konclave.ProtocolContracts.TypeScript provides corresponding source codecs. Generated objects remain untrusted. Validate before side effects; verify credentials, signatures, routes, expiry, consumption, roles, and local authority at their owning boundaries.

Wide tables scroll horizontally.

Native contractValue / obligation
Protobuf namespace / application versionkonclave.protocol.v1 / 1.0
Shared local-service protocol2; no downgrade to 1
Application / text262144 / 261120 bytes
Relay envelope / payload1048576 / 1047552 bytes
Replay pageAt most 100 envelopes and 16777216 bytes
Relay control / active devices1024 bytes / 128 devices
Application identityMessage ID 16 bytes; directed target 32 bytes; nonzero uint64 sender counter
TypeScript integersbigint for uint64; directed expiry additionally constrained to the safe-integer range by its validator

The protocol snapshot for this guide’s documented source baseline is protocol-v1.0.0-alpha.4: prerelease, transport endpoint major 1, relay/application 1.0, daemon profile schema 24, RFC 9420 suite MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519, and MLS extensions 0xff00–0xff02. Package, wire, service, and storage versions are independent axes; this is not a stable-platform or npm-publication promise, nor a claim that this is the newest checked-in protocol snapshot.

Relay transport is protobuf: WebSocket binary ReplayRequest/ReplayPage, with HTTP submit/ack. Application plaintext is inside MLS ciphertext, not relay JSON. Preserve original bytes for opaque forwarding: TypeScript decoding drops unknown fields, so decode/re-encode is not a lossless forwarder. Never reuse removed protobuf field numbers; reserve them.

The shared binary examples are fixtures/protocol/v1; TypeScript parity ownership is fixtures.test.ts. For example application-message.bin and directed-request-message.bin are decoded and re-encoded against maintained builders. Compatibility requires supported prior fixtures to remain readable; these fixtures are not a substitute for authorization or crash/replay tests.

The fixture test imports the validating application codecs from src/application.ts. Its application cases use this exact encode/decode composition:

Code example
roundTrip: (bytes) => encodeApplicationMessage(decodeApplicationMessage(bytes));

Here bytes is the fixture’s Uint8Array; the test compares the decoded value to the maintained builder and the re-encoded bytes to the original fixture. For untrusted application input, decodeApplicationMessage first checks the byte and nested-field bounds, decodes protobuf, and validates version, identifiers, counter, content variant and variant-specific limits. Encoding validates again. Failures throw ProtocolValidationError; neither codec supplies signature, membership, policy or persistence checks. This is an excerpt of an existing executable test, not a standalone program or a lossless unknown-field forwarder.

Content: Konclave,Apache-2.0. Revision: 8d0d3676e9fc746749a4fc04ddeb4499023c4104.