Liking cljdoc? Tell your friends :D

propolis

A small, protocol-neutral Clojure kernel for agent interoperability over A2A 1.0 (Agent2Agent), ACP v1 (Agent Client Protocol) and MCP (Model Context Protocol, revisions 2024-11-05 to 2026-07-28). It is pure .cljc, depends only on org.clojure/clojure and metosin/malli, and is licensed MIT.

What it holds:

  • The JSON-RPC 2.0 envelope.
  • One lifecycle table. RunState, WorkState, A2A TaskState and ACP StopReason meet in a single place.
  • Content projections. Neutral blocks project to A2A Parts and to ACP ContentBlocks.
  • Error tables.
  • Role-sized ports. These are defprotocols from std01 §3.4. The package ships no implementations.
  • Conformance cases. They are keyed by the official a2a-tck and acp-tck requirement ids.

It works on decoded maps: there is no transport, no JSON codec and no SDK. Wire correctness at the JVM boundary belongs to the official SDKs. Codecs to and from those SDKs (propolis.a2a.sdk, propolis.acp.sdk) come later, once spikes sp1 and sp2 of plan-interop-03 decide whether to adopt them.

Install

The cljc core (clojure + malli only):

io.github.hive-agi/propolis {:mvn/version "0.1.0"}

The JVM SDK layer propolis.a2a.sdk.* ships in the same jar, but its SDK jars are NOT in the pom: a consumer that requires those namespaces opts in by adding them itself.

org.a2aproject.sdk/a2a-java-sdk-spec              {:mvn/version "1.5.1.Final"}
org.a2aproject.sdk/a2a-java-sdk-server-common     {:mvn/version "1.5.1.Final"}
org.a2aproject.sdk/a2a-java-sdk-transport-jsonrpc {:mvn/version "1.5.1.Final"}

Usage

(require '[propolis.core.content :as content]
         '[propolis.core.lifecycle :as lifecycle])

(content/->a2a-part (content/text "hello"))     ;=> {:text "hello"}
(content/->acp-block (content/text "hello"))    ;=> {:type "text", :text "hello"}
(lifecycle/run-state->task-state :succeeded)    ;=> "TASK_STATE_COMPLETED"
(lifecycle/run-state->stop-reason :cancelled)   ;=> "cancelled"
(lifecycle/stop-reason->run-state "max_tokens") ;=> :failed

MCP

An MCP revision is a value, so one server can speak the legacy era (initialize, up to 2025-11-25) and the modern one (2026-07-28, version in every request's _meta) from the same code:

(require '[propolis.mcp.revisions :as rev]
         '[propolis.mcp.results :as results]
         '[propolis.mcp.schema :as schema]
         '[malli.core :as m])

(rev/negotiate ["2025-06-18" "2025-03-26"] :initialize "2024-11-05") ;=> "2025-06-18"
(:code (rev/negotiate ["2026-07-28"] :meta "2025-06-18"))            ;=> -32022
(results/call-tool-result "2026-07-28" [(content/->mcp-content (content/text "22.5 C"))]
                          {:structured {:temp 22.5}})
;=> {:content [{:type "text" :text "22.5 C"}] :resultType "complete" :structuredContent {:temp 22.5}}
(m/validate (schema/schema-for :call-tool-result "2025-06-18")
            {:content [] :structuredContent [1]})                    ;=> false, an object before 2026-07-28

Runnable examples, each with a test that runs it:

examplerun
(a) content on both wiresclojure -M:examples -m propolis.examples.a2a-data
(c) one run outcome, both protocolsclojure -M:examples -m propolis.examples.run-outcome
(b) codec round trip over a2a-javaclojure -M:sdk:examples-sdk -m propolis.examples.codec-round-trip
(d) in-process DefaultRequestHandler over port valuesclojure -M:sdk:examples-sdk -m propolis.examples.sdk-handler

Stability

Additive only. Between releases a published namespace, var, schema, protocol or table row may be added but never removed, renamed or narrowed. freeze-policy.edn states this and clojure -T:build freeze-check enforces it before every release. A deliberate break needs a BREAKING-CHANGE: marker and a new minor line.

Release

Releases are cut by CI (.github/workflows/release.yml) on a push to main that changes src/, src-sdk/, resources/, deps.edn, version.edn or VERSION. The release is patch+1 of max(VERSION, newest v* tag). VERSION is 0.0.9, so the first release is 0.1.0. Nobody tags or deploys by hand.

Namespace map

nswhat
propolis.core.jsonrpcRequest / Notification / Response malli schemas, constructors, classify
propolis.core.errorsJSON-RPC, A2A (-32001..-32009 with HTTP/gRPC/ErrorInfo reason) and ACP code tables; error builds the plain-data error value ports return
propolis.core.lifecycleWorkState hub; task-state<->work-state, stop-reason<->work-state, run-state<->work-state, composed projections; terminal/interrupted predicates
propolis.core.contentneutral ContentBlock (:content/kind), multimethod projections ->a2a-part / a2a-part->block, ->acp-block / acp-block->block
propolis.core.portsIAgentDescriptor, IContentCodec
propolis.a2a.v1.portsIA2AMessageSender IA2AStreamer IA2ATaskReader IA2ATaskCanceller IA2APushConfigs IA2AExtendedCard; client side IA2ARemote IA2APushReceiver
propolis.acp.v1.portsagent side IAcpInitializer IAcpSessions IAcpSessionRestore IAcpSessionCatalog IAcpPrompter IAcpConfigurable IAcpAuthenticator; client side IAcpPermissionGate IAcpFileSystem IAcpTerminals IAcpElicitor
propolis.mcp.revisionsMCP revisions as data (2024-11-05 .. 2026-07-28): era (legacy initialize or modern per-request _meta), features, content types; negotiate
propolis.mcp.methodsMCP method names per revision: side, request or notification, and which 2026-07-28 moved into InputRequiredResult
propolis.mcp.schemamalli schemas for Tool, CallToolRequestParams/Result, Resource, ReadResourceResult, ContentBlock, initialize, server/discover, InputRequiredResult, capabilities; schema-for narrows a contract to one revision
propolis.mcp.resultspure builders of CallToolResult, ReadResourceResult, ListToolsResult, InitializeResult, DiscoverResult and the resource-not-found error, shaped per revision
propolis.mcp.portsserver side IMcpToolCatalog IMcpToolCaller IMcpResourceCatalog IMcpResourceReader IMcpPromptCatalog IMcpCompleter; client side IMcpSampler IMcpRootsProvider IMcpElicitor
propolis.capabilityA2A card flags, ACP agentCapabilities and MCP server/client capabilities derived from satisfies? on the ports, plus honesty checks
propolis.conformance.catalogthe 133 a2a-tck and 134 acp-tck v1 requirement rows and the 104 MCP conformance kit scenarios (from resources/propolis/conformance/tck-requirements.edn), plus gating? and mcp-required?
propolis.conformance.casescore-level cases as data. Each one :pins an official id (CORE-SEND-002, ACP-CANCEL-001 and so on); the checks are pure

Strata. core names no protocol and changes rarely. The per-protocol ports sit above it. capability reads both protocol contexts, and conformance sits on top. Nothing depends on conformance.

Port contract. A port takes a decoded request map with the wire's camelCase keyword keys. It returns either the response map or an propolis.core.errors/error value. No exceptions and no Result type cross the seam; hive adapters lift these values into their own Result types at the edge.

JVM SDK layer (:sdk alias)

src-sdk/ holds propolis.a2a.sdk.*, which builds on a2a-java 1.5.1.Final (spec, server-common, transport-jsonrpc). It is reachable only through the :sdk alias, so a consumer of the cljc core never pulls the SDK: clojure -Spath lists no org.a2aproject jar.

nswhat
propolis.a2a.sdk.codecpure codecs between A2A 1.0 wire maps and org.a2aproject.sdk.spec records (Message, Text/File/Data Part, Task, TaskStatus, Artifact, AgentCard, TaskStatusUpdateEvent, TaskArtifactUpdateEvent), built only through the SDK's builders; the ns doc lists the normalisations
propolis.a2a.sdk.adapteragent-executor: IA2AExecutor (+ IA2ATaskCanceller) -> AgentExecutor; task-store: IA2ATaskReader + IA2ATaskWriter -> TaskStore + TaskStateProvider; ->a2a-error: error value -> SDK A2AError

Tests

clojure -M:test                 # core only, no SDK on the classpath
clojure -M:sdk:sdk-test:test    # core + SDK codec/adapter tests

The SDK tests use the real SDK as the oracle. Their property tests send malli-generated maps through the SDK builders and the SDK's JSON-RPC ProtoJSON (JSONRPCUtils, ProtoUtils, JsonUtil) and back again. The adapter tests drive a real DefaultRequestHandler.

The suite finds every *-test ns under test/. Three test namespaces cover:

  • the core tables and projections;
  • the conformance cases, including a check that every pinned id exists in the official catalog;
  • the dependency guard rails, which allow only clojure + malli and forbid any hive-* or JSON-library require.

Regenerating the TCK catalog

tck-requirements.edn is a snapshot. On a TCK bump, re-extract the rows:

  • a2a-tck: tck/requirements/*.py, from the RequirementSpec fields id, section, level and title;
  • acp-tck: src/tck/v1/requirements.py, from the Requirement fields id, tier, capability and text.

Then update the pinned commits in propolis.conformance.catalog and NOTICE, and run the tests. cases-pin-official-ids fails if a case pins an id the new TCK no longer has.

Paused work

The branch wip/codegen-paused holds the earlier slice:

  • a proto3 parser plus an a2a.proto→malli generator;
  • the vendored A2A v1.0.1 a2a.proto;
  • the generated propolis.a2a.v1.schema;
  • a drift check and 21 golden vectors.

That work is paused by plan-interop-03. It resumes only if a spike shows an SDK cannot run inside hive, or a cljc/bb consumer needs map schemas.

Licence

MIT, see LICENSE. Third-party attributions are in NOTICE.

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close