agent-sdk-go

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2026 License: Apache-2.0

README

agent-sdk-go

Go clients for the Codex app-server, Claude Code CLI, and Pi RPC. The SDKs use the github.com/zoumo/agent-sdk-go module and require Go 1.26 or newer.

If you need Use Get started
Codex protocol types, turn operations, or saved thread queries github.com/zoumo/agent-sdk-go/client/codex Codex SDK
Claude protocol types, CLI options, or saved session queries github.com/zoumo/agent-sdk-go/client/claude Claude SDK
Pi native RPC commands, responses, and events github.com/zoumo/agent-sdk-go/client/pi Pi SDK
Replay a capture, record a fixture, or install the Replay CLI github.com/zoumo/agent-sdk-go/replay Replay
The same live session API for Codex, Claude, and Pi github.com/zoumo/agent-sdk-go/agent and one adapter per Core Unified Agent and examples

The native SDKs have separate client/codex/types and client/claude/types packages. Use the native SDK for protocol-specific controls and saved history even when your application uses agent for live sessions. See the dependency rules.

If you are Read
Testing an SDK or Replay change Test execution guide
Running an SDK against a recorded case Simulation guide
Looking up contracts or terms Documentation index, glossary
Preparing a release Release checks, licenses and attribution

Directories

Path Synopsis
Package agent defines the optional adapter-neutral contract for one live Agent session.
Package agent defines the optional adapter-neutral contract for one live Agent session.
claude
Package agentclaude adapts the native Claude Session to the adapter-neutral live agent contract.
Package agentclaude adapts the native Claude Session to the adapter-neutral live agent contract.
codex
Package agentcodex adapts the native Codex app-server SDK to the optional adapter-neutral agent runtime contract.
Package agentcodex adapts the native Codex app-server SDK to the optional adapter-neutral agent runtime contract.
internal/corelease
Package corelease owns the Core-scoped state shared by unified Agent adapters.
Package corelease owns the Core-scoped state shared by unified Agent adapters.
internal/eventenvelope
Package eventenvelope builds validated adapter-neutral event envelopes.
Package eventenvelope builds validated adapter-neutral event envelopes.
internal/interactionledger
Package interactionledger owns adapter-neutral interaction authority state.
Package interactionledger owns adapter-neutral interaction authority state.
internal/submissiontrace
Package submissiontrace owns the best-effort span lifecycle of one admitted unified submission.
Package submissiontrace owns the best-effort span lifecycle of one admitted unified submission.
internal/telemetry
Package telemetry instruments the public operations of the unified adapters.
Package telemetry instruments the public operations of the unified adapters.
pi
Package agentpi adapts Pi 1.6 RPC sessions to the unified agent contract.
Package agentpi adapts Pi 1.6 RPC sessions to the unified agent contract.
pi/tests/pipeer
Package pipeer serves the controlled Pi RPC peer used by adapter tests.
Package pipeer serves the controlled Pi RPC peer used by adapter tests.
client
claude
Package claude provides an independent native Session over an explicitly selected local Claude Code process.
Package claude provides an independent native Session over an explicitly selected local Claude Code process.
claude/examples/remote-execution-offline command
This example demonstrates how Claude can retain external MCP tools while disabling ordinary built-in tools.
This example demonstrates how Claude can retain external MCP tools while disabling ordinary built-in tools.
claude/examples/session-messages-offline command
This example creates synthetic saved content and queries it without Claude.
This example creates synthetic saved content and queries it without Claude.
claude/examples/session-metadata-offline command
This example discovers synthetic saved sessions without a Claude runtime.
This example discovers synthetic saved sessions without a Claude runtime.
claude/examples/subagents-offline command
This example runs only its own synthetic peer, never an installed Claude CLI.
This example runs only its own synthetic peer, never an installed Claude CLI.
claude/types
Package types provides the SDK's pure event, content, permission-answer, and callback-free configuration data, plus the existing JSON decoding codecs.
Package types provides the SDK's pure event, content, permission-answer, and callback-free configuration data, plus the existing JSON decoding codecs.
codex
Package codex provides native long-running Sessions over Codex app-server.
Package codex provides native long-running Sessions over Codex app-server.
codex/examples/apiusage
Package apiusage contains compile-checked examples.
Package apiusage contains compile-checked examples.
codex/examples/history-query-offline command
history-query-offline uses a synthetic subprocess, never an installed agent.
history-query-offline uses a synthetic subprocess, never an installed agent.
codex/examples/observe-subagents-offline command
This executable talks only to a synthetic copy of itself, never to Codex.
This executable talks only to a synthetic copy of itself, never to Codex.
codex/examples/observe-turn command
Observe a managed root and descendants on an explicitly chosen executable.
Observe a managed root and descendants on an explicitly chosen executable.
codex/examples/remote-execution-offline command
This example demonstrates a best-effort remote MCP profile for Codex.
This example demonstrates a best-effort remote MCP profile for Codex.
codex/examples/resume-thread command
Command resume-thread explicitly opens a fresh connection, resumes a native ID already known to the caller, reads it, and detaches server-side observation.
Command resume-thread explicitly opens a fresh connection, resumes a native ID already known to the caller, reads it, and detaches server-side observation.
codex/types
Package types exposes native app-server parameters, results, and recursive model types from the exact official Codex revision recorded in the generated source.
Package types exposes native app-server parameters, results, and recursive model types from the exact official Codex revision recorded in the generated source.
internal/lineage
Package lineage maintains bounded, confirmed parent relationships.
Package lineage maintains bounded, confirmed parent relationships.
internal/strictjson
Package strictjson validates native JSON syntax before typed decoding.
Package strictjson validates native JSON syntax before typed decoding.
pi
Package pi controls a Pi coding-agent v1.6.0 subprocess through its JSONL RPC protocol.
Package pi controls a Pi coding-agent v1.6.0 subprocess through its JSONL RPC protocol.
pi/tests/simulation
Package pisim exercises the public Pi SDK against native recordings.
Package pisim exercises the public Pi SDK against native recordings.
cmd
agent-replay command
Command agent-replay owns environments and process orchestration, never SDK assertions.
Command agent-replay owns environments and process orchestration, never SDK assertions.
internal
queue
Package queue adapts ChannX to typed event streams, with atomic admission and explicit drain/abort lifecycle.
Package queue adapts ChannX to typed event streams, with atomic admission and explicit drain/abort lifecycle.
replay/tool
Package tool contains shared process, file and JSON primitives used by the three public commands.
Package tool contains shared process, file and JSON primitives used by the three public commands.
testsupport/claude/replay
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
testsupport/codex/replay
SDK-specific fixtures and process adapters; native protocol matching belongs to the tool.
SDK-specific fixtures and process adapters; native protocol matching belongs to the tool.
testsupport/mocktest
Package mocktest bridges Go SDK fixture assertions to the in-process Replay library.
Package mocktest bridges Go SDK fixture assertions to the in-process Replay library.
testsupport/replaytest
Package testutil locates the repository root and prepares the installed tool used by process-boundary tests.
Package testutil locates the repository root and prepares the installed tool used by process-boundary tests.
testsupport/replaytest/builtintest
Package builtintest reads builtin recordings for installed CLI checks.
Package builtintest reads builtin recordings for installed CLI checks.
uuidv4
Package uuidv4 creates random RFC 4122 version 4 identifiers.
Package uuidv4 creates random RFC 4122 version 4 identifiers.
Package mcp defines one external MCP server configuration shared by the native Codex and Claude SDKs and the adapter-neutral agent layer.
Package mcp defines one external MCP server configuration shared by the native Codex and Claude SDKs and the adapter-neutral agent layer.
Package replay is the importable library entry for SDK protocol fixture preparation, recording and replay.
Package replay is the importable library entry for SDK protocol fixture preparation, recording and replay.
cli
Package cli runs the agent-replay command.
Package cli runs the agent-replay command.
data
Package data owns the tracked catalog and material snapshots embedded in the installed binary.
Package data owns the tracked catalog and material snapshots embedded in the installed binary.
internal/application
Package application is the single use-case boundary shared by the CLI and importable library adapters.
Package application is the single use-case boundary shared by the CLI and importable library adapters.
internal/builtin
Package builtin reads the generated material snapshot embedded in the installed binary.
Package builtin reads the generated material snapshot embedded in the installed binary.
internal/catalog
Package catalog projects the authoritative story and provider bindings into one run plan.
Package catalog projects the authoritative story and provider bindings into one run plan.
internal/command
Package command owns the single Cobra command tree, process I/O and error reporting.
Package command owns the single Cobra command tree, process I/O and error reporting.
internal/lifecycle
Package lifecycle owns fixture identity, environment routes, execution descriptors and finalization.
Package lifecycle owns fixture identity, environment routes, execution descriptors and finalization.
internal/official
Package official owns official SDK driver orchestration and its evidence.
Package official owns official SDK driver orchestration and its evidence.
internal/protocol/capture
Package capture records provider-independent stdio JSONL with owned process lifecycle, lossless native JSON, and explicit failure evidence.
Package capture records provider-independent stdio JSONL with owned process lifecycle, lossless native JSON, and explicit failure evidence.
internal/protocol/rawjson
Package rawjson validates JSON and edits selected object fields without serializing the surrounding message.
Package rawjson validates JSON and edits selected object fields without serializing the surrounding message.
internal/protocol/recording
Package recording owns the versioned envelope, not native protocol semantics.
Package recording owns the versioned envelope, not native protocol semantics.
internal/protocol/replay
Package replay implements strict native protocol consumption.
Package replay implements strict native protocol consumption.
internal/record
Package record owns native protocol capture in a prepared execution.
Package record owns native protocol capture in a prepared execution.
internal/version
Package version owns the executable identity shared by commands and evidence.
Package version owns the executable identity shared by commands and evidence.
tests
replay/e2e/fixturetest
Package fixturetest resolves persisted identities for installed CLI tests.
Package fixturetest resolves persisted identities for installed CLI tests.
replay/internal/replaylibrary
Package replaylibrary provides fixtures shared by the public Replay library test packages.
Package replaylibrary provides fixtures shared by the public Replay library test packages.
simulation
SDK-owned offline simulation.
SDK-owned offline simulation.
simulation/driver command
Explicit offline Go SDK acceptance entry.
Explicit offline Go SDK acceptance entry.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL