github coder/acp-go-sdk v0.6.3
v0.6.3: Schema 0.6.3 alignment and friendlier generated types

latest releases: v0.13.5, v0.13.4, v0.13.0...
8 months ago

Tracks ACP schema 0.6.3 (up from 0.4.9). The code generator gains JSON Schema discriminator support, smarter nested-type naming, and multi-line doc comments — which together rename a handful of generated types and reshape how callers build RequestPermissionRequest and McpServer values.

Added

  • Implementation metadata on initialize. InitializeRequest gained an optional ClientInfo *Implementation and InitializeResponse gained an optional AgentInfo *Implementation, carrying name, optional title, and version. The schema notes these will become required in a future protocol revision, so populating them now is recommended (#3 by @ThomasK33):
    resp, err := conn.Initialize(ctx, acp.InitializeRequest{
        ProtocolVersion: acp.ProtocolVersionNumber,
        ClientInfo: &acp.Implementation{
            Name:    "my-editor",
            Title:   acp.Ptr("My Editor"),
            Version: "1.2.3",
        },
    })
  • JSON-RPC envelope and error types. New generated AgentOutgoingMessage / ClientOutgoingMessage (with Request / Response / Notification variants) and an Error struct mirroring the JSON-RPC 2.0 error object (#3).
  • Discriminator-aware codegen. The generator now honors explicit discriminator: { propertyName: "type" } annotations on schema unions like ContentBlock and McpServer, falling back to the previous const-property scan only when none is declared. Inline variants are also given idiomatic names via word-boundary heuristics — e.g. RequestPermissionRequest + toolCallRequestPermissionToolCall instead of RequestPermissionRequestToolCall (#3).

Changed

  • Schema bumped to 0.6.3. schema/version and the SDK version are now 0.6.3.
  • Doc comments preserve formatting. cmd/generate replaces the old SanitizeComment collapser with FormatDocComment, which keeps newlines and paragraph breaks from JSON Schema descriptions. Generated godoc on types like ContentBlock, Agent, and Client is now multi-line and noticeably easier to read.
  • Generated type renames. A few inline-variant types now have shorter, more idiomatic names (see Breaking Changes below).
  • ResourceBlock helper signature. ResourceBlock(EmbeddedResource)ResourceBlock(EmbeddedResourceResource). Callers no longer need to wrap the resource:
    // Before
    acp.ResourceBlock(acp.EmbeddedResource{Resource: res})
    // After
    acp.ResourceBlock(res)
  • ContentBlockText doc clarifies that text content may be Markdown and clients SHOULD render it as such.

Breaking Changes

Code that referenced the old generated names or constructed RequestPermissionRequest / McpServer literals must be updated:

Before After
RequestPermissionRequest{ ToolCall: ToolCallUpdate{...} } RequestPermissionRequest{ ToolCall: RequestPermissionToolCall{...} }
SessionUpdate{ ToolCallUpdate: &SessionUpdateToolCallUpdate{...} } SessionUpdate{ ToolCallUpdate: &SessionToolCallUpdate{...} }
McpServer{ Stdio: &Stdio{...} } McpServer{ Stdio: &McpServerStdio{...} }
ResourceBlock(EmbeddedResource{Resource: res}) ResourceBlock(res) (where res is EmbeddedResourceResource)

The custom ToolCallUpdateOpt callbacks now receive *SessionToolCallUpdate; recompiling against the new types is sufficient if you used the provided WithUpdate* helpers.

Full Changelog: v0.4.9...v0.6.3

Don't miss a new acp-go-sdk release

NewReleases is sending notifications on new releases.