acp
Dart SDK for the Agent Client Protocol (ACP) — connect any editor to any coding agent.
0.1.0-rc.3
HelgeSverre/dart-agentclientprotocol
What this package is like to depend on
Last release 4 months ago
19 Apr 2026
Too new to tell
only 1 release windows
Unknown
no stable releases
Nothing withdrawn
no release was ever pulled
4 months old
3 releases · first in 2026
3 releases in the last 12 months
see the full history below
Release timeline
3 releases · Apr 2026 to Apr 2026Releases
latest 3-
0.1.0-rc.319 Apr 2026 pre-releaseRelease notes
Open source →Pub package layout polish. No code changes; only file moves and publish metadata.
Changed
SPEC.mdmoved todoc/spec.md(root reserved for README/CHANGELOG/LICENSE).example/basic_agent.dartrenamed toexample/main.dartso pub.dev's Example tab links to a runnable file directly..pubignorenow excludes all ofdoc/andjustfilefrom the published package — internal architecture/decision/protocol/spec docs and the dev task runner are not useful to consumers; the homepage links to the rendered versions.
Removed
- 13 stale
.gitkeepfiles acrossexample/,test/*/,tool/*/,doc/*/(those directories now have real content).
Tooling
actions/checkoutbumped from v4 to v5 in CI workflows.
-
0.1.0-rc.219 Apr 2026 pre-releaseRelease notes
Open source →Pre-release code review pass. Fixes two crashes in normal lifecycle code, threads typed enums and discriminated unions through the schema generator, adds resource bounds to streaming transports, and tightens dev tooling.
Fixed
- CRITICAL
Connection._cleanupwas not re-entrant; a transport error fired during graceful close drain would re-enter the body and throwStateErrorfrom_stateController.close(). Re-entry is now guarded. - CRITICAL
BrowserWebSocketTransportdid not cancel its event listeners on close; a message arriving after_controller.close()threwStateError: Cannot add event after closing. Listeners are now cancelled and theonMessagehandler short-circuits when closed. Connection.sendRequestleakedcancelToken.whenCanceledlisteners on every successful request; long-lived session-scoped cancel tokens accumulatedO(n)closures across prompts. Each request now uses a per-requestAcpCancellationSourcethat is released on completion.Connectionno longer leaks raw exceptiontoString()to the peer ininternalErrorresponses (could disclose paths, query fragments, internal state to untrusted clients). The peer now receives a generic message; the full error stays in the local log.Connectionpreviously coerced a non-object response result to{}, silently producing zero-valued typed responses. Surfaces the protocol violation as an error instead.JsonRpcResponse.fromJsonnow rejects success responses withid: nullper JSON-RPC 2.0 §5; previously these silently never matched a pending request and the caller timed out.Connection._waitForWriteQueueDrainno longer busy-polls every 10ms; blocks on a completer signaled from the drain loop.ClientSideConnection._sessionUpdateControlleris now closed on transport-initiated disconnect (not only on explicitclose()); fixes a resource leak when the remote drops the connection.StdioProcessTransport.close()could deadlock waiting for_stderrDoneto complete viacancel()(which never firesonDone). Capped at 2s.StdioProcessTransport._handleLinenow validates JSON object type explicitly, mirroringStdioTransport, instead of letting aTypeErrorescape on non-object payloads.StdioTransport.send()now closes the transport on flush failure so subsequent sends fail fast instead of silently buffering into a dead sink.ReconnectingTransportnow uses a single-subscription stream formessages, matching the documented delivery contract; a broadcast controller silently dropped messages emitted before/between subscribers.HttpSseTransportandStreamableHttpTransportcap each SSE event'sdata:accumulation at 16 MB (configurable viamaxMessageBytes). Previously a server that streameddata:lines without ever terminating could OOM the process.StreamableHttpTransport.send()calls are now serialized; concurrent sends could race on_sessionIdand cause the server to fork the session.HttpSseTransport.send()includes the server's response body inHttpExceptionfor failed requests instead of draining it before checking status.
Changed
- BREAKING (schema): Schema generator now emits typed enums and
discriminated unions instead of raw
String/Map<String, dynamic>for fields whose JSON Schema references a known type. Notably:PromptResponse.stopReasonis nowStopReason?(wasString). Unknown wire values decode tonullfor forward compatibility.AgentMessageChunk.content,UserMessageChunk.content, andAgentThoughtChunk.contentare nowContentBlock(wasMap).SessionNotification.updateis nowSessionUpdate(wasMap);SessionUpdate.fromJson/UnknownSessionUpdateforward-compat are now invoked on the live notification path.InitializeResponse.authMethodsis nowList<AuthMethod>(wasList<Map<String, dynamic>>).- All other enum-typed and known-ref fields across the unstable surface
are similarly upgraded.
Migration: pass typed values (e.g.
StopReason.endTurninstead of'end_turn') and pattern-match on typed content blocks.
- Examples updated to use typed
TextContent(text: ...)forAgentMessageChunk.content(was raw map literals). subprocess_client.dartresolvesbasic_agent.dartviaPlatform.scriptso the example works regardless of CWD.project_assistant.dartbuilds paths viaUri.directory(...).resolveto handle Windows separators and root CWD correctly._LinkedTransportextracted fromstreaming_agent.dartandproject_assistant.dartinto a sharedexample/in_memory_transport.dart.
Added
EnumFieldTypein the schema generator; emits typed enum field declarations and wiresEnumName.fromString(...)intofromJson.- Generator emits doc comments before
@experimentalannotations sodart docattaches the description to the symbol on pub.dev. validateAbsolutePathunit test covering POSIX, UNC, and Windows drive-letter paths.- Cooperative-cancellation unit test
(
Future.any([work, cancelToken.whenCanceled])). - Compliance suite now compares full JSON-RPC envelopes through round-trip
(
expect(roundTripped, json)) instead of single fields, so dropped or added top-level keys would now fail the test. - HTTP+SSE transport test covering chunked SSE event delivery (real proxies routinely split frames across writes).
Tooling
tool/generate/generate.dartnow exits non-zero when configured types are missing from the schema; previously it printed a warning and exited 0.tool/generate/src/json_schema_parser.dartescapes the strict Dart reserved-word set when emitting field names; previously onlyconst,default, andenumwere handled.tool/schema_sync/sync.dartexits non-zero on HTTP failure and validates downloaded JSON before writing.unstable_methods.darttype list is sorted explicitly so an upstream schema reformat can't trigger a false-positivegit diffin CI.- CI matrix adds
windows-latest.codegen-freshnessjob now runsdart analyzeon freshly-regenerated code. .pubignoreexcludestest/anddart_test.yaml.- New
just dry-runandjust release-checkrecipes.
Test suite
- 375 tests pass (was 357).
- CRITICAL
-
0.1.0-rc.119 Apr 2026 pre-releaseRelease notes
Open source →Add .pubignore to exclude development-only content from the published
package archive — upstream ACP spec reference copies under docs/, the
marketing website/, codegen tooling and bundled schemas under tool/, and
historical planning docs under doc/plans/. Compressed archive drops from
~471 KB to ~129 KB.Fix README installation snippet to pin to 0.1.0-rc.1 (caret ranges don't
include pre-releases in pub, so the old ^0.1.0 wouldn't resolve).Release notes
Open source →First release candidate. API is stabilizing but may still change before 0.1.0.
Added
- Core JSON-RPC 2.0 message types (
JsonRpcRequest,JsonRpcResponse,JsonRpcNotification) with batch parsing viaJsonRpcMessage.parseBatch(). Connectionclass with request correlation, timeouts, cancellation, and write serialization.AgentSideConnection/ClientSideConnectiontyped facades overConnection.AgentHandler/ClientHandlerabstract interfaces for method dispatch, plusUnstableAgentHandler/UnstableClientHandlermix-ins for opt-in unstable method handling.- Full ACP v0.12.0 schema models (initialize, session, content blocks, capabilities, etc.), generated from the checked-in upstream schemas.
- Unstable v0.12 method surface gated by
useUnstableProtocol:session/fork,session/resume,session/close,session/set_model,providers/*,logout,nes/*,document/*, elicitation. - Stable
session/listgated bysessionCapabilities.list. - Capability enforcement (strict / permissive modes) for outgoing requests.
- Transport implementations:
StdioTransport— NDJSON over stdin/stdout; auto-starts on first subscription.StdioProcessTransport— spawns agent as subprocess.HttpSseTransport— HTTP POST + Server-Sent Events.WebSocketTransport— WebSocket text frames.ReconnectingTransport— auto-reconnect wrapper with exponential backoff.
- Connection keepalive via
$/ping/$/pongnotifications. - Cancellation token system (
AcpCancellationSource/AcpCancellationToken) with linked request+session cancellation for prompt handlers. - Outgoing absolute-path and prompt content capability validation (errors include the offending value).
- Terminal handle for ergonomic terminal lifecycle management.
- Extension method / notification support for vendor-specific protocols (
_-prefixed methods). - Comprehensive exception hierarchy (
AcpExceptionand subtypes), protocol warnings stream, tracing hooks (onSend/onReceive). _metaround-trip fidelity on every generated sealed variant.- 357 tests (unit, integration, compliance, golden).
- Architecture documentation in
doc/, GitHub Actions CI for analysis, formatting, and testing.
- Core JSON-RPC 2.0 message types (