go

module
v0.0.0-...-0129a13 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT

README

Modular Agent in Go

The Go SDK builds agents, sessions, tools, Providers and plugins from SDK draft 0.1. Import github.com/daniel-ballance/modular-agent/go/modular. Tests can use modular/modulartest without a real model. The SDK README has the shared scenario and cross-language checks, implementation status and specification findings.

ma is the Go reference implementation of the standard configuration. It uses only the Go SDK and its official plugins.

The SDK wraps the clean-room Go build from the experiment (modular-agent-go at 7e4dbd5). The base implements production edition 3: the Harness, transient and durable Runtimes, ACP, the plugin binding, local and HTTP history, and parts as HTTP services.

The build's own notes, including how to run it and its services, are in docs/clean-room. Paths in those notes are relative to the old repository root. conformance links to this repository's kits.

Build and check

Go is pinned with mise. The kit tests need the ACP kit's dependencies: run npm ci in ../conformance/acp first.

mise exec -- go build ./...
mise exec -- go vet ./...
mise exec -- go test -count=1 ./...
mise exec -- go test -race -count=1 ./...

Commands need Linux with unprivileged user, PID and mount namespaces. The service sandbox also needs Bubblewrap.

The Go conformance plugin passes 146/146 checks on stdio and 153/153 over WebSocket. Go ma passes 18/18 reference checks, and the ACP kit with crash, probe and job checks passes 188/188 on stdio and 193/193 over WebSocket. Run scripts/websocket-kits.sh go from the repository root after building go/.bin/modular and go/.bin/ma.

Directories

Path Synopsis
Package acpinterface is a stable ACP v1 stdio Interface.
Package acpinterface is a stable ACP v1 stdio Interface.
Package agenthttp exposes the agent through an authenticated HTTP Interface.
Package agenthttp exposes the agent through an authenticated HTTP Interface.
Package anthropic adapts the Messages API.
Package anthropic adapts the Messages API.
Package api is the version 1 in-process binding of the description's contracts.
Package api is the version 1 in-process binding of the description's contracts.
Package approval is an optional feature plugin on the standard tool gate.
Package approval is an optional feature plugin on the standard tool gate.
cmd
ma command
ma/internal/codemode
Package codemode runs Python in Monty and routes external functions through the agent.
Package codemode runs Python in Monty and routes external functions through the agent.
modular command
modular-service command
modular-service runs exactly one part in its own process.
modular-service runs exactly one part in its own process.
Package commands turns slash input into plugin commands, never model input.
Package commands turns slash input into plugin commands, never model input.
Package configuration merges global settings and then project settings.
Package configuration merges global settings and then project settings.
Package conformancemodel is the credential-free model in docs/bindings/acp.md.
Package conformancemodel is the credential-free model in docs/bindings/acp.md.
Package contextview decides the model's view and appends summaries, never deleting history.
Package contextview decides the model's view and appends summaries, never deleting history.
Package credentials reads the experiment key only when the Provider asks.
Package credentials reads the experiment key only when the Provider asks.
Package durable resumes interrupted turns from committed history boundaries.
Package durable resumes interrupted turns from committed history boundaries.
Package environmenthttp adapts WorkingEnvironment to a rooted filesystem and Bubblewrap commands.
Package environmenthttp adapts WorkingEnvironment to a rooted filesystem and Bubblewrap commands.
Package fake is a scripted, offline Provider.
Package fake is a scripted, offline Provider.
Package gateway keeps Provider credentials behind authenticated model access.
Package gateway keeps Provider credentials behind authenticated model access.
Package guardrail redacts recipient views, leaving the record untouched.
Package guardrail redacts recipient views, leaving the record untouched.
Package harness hosts plugins and open sessions.
Package harness hosts plugins and open sessions.
Package history stores immutable history trees in atomic JSON snapshots.
Package history stores immutable history trees in atomic JSON snapshots.
Package historyhttp implements the modular-agent-history/1 HTTP binding.
Package historyhttp implements the modular-agent-history/1 HTTP binding.
internal
apikeymodels
Package apikeymodels reads the shared catalog for API-key Providers.
Package apikeymodels reads the shared catalog for API-key Providers.
proctest
Package proctest contains subprocess acceptance helpers.
Package proctest contains subprocess acceptance helpers.
runtimetest
Package runtimetest runs the same plugin-facing acceptance cases with either Runtime.
Package runtimetest runs the same plugin-facing acceptance cases with either Runtime.
telemetry
Package telemetry records metadata only.
Package telemetry records metadata only.
wswire
Package wswire carries JSON-RPC messages without changing their binding.
Package wswire carries JSON-RPC messages without changing their binding.
Package jobs records session-owned work.
Package jobs records session-owned work.
Package local provides local files and supervised commands, not a sandbox.
Package local provides local files and supervised commands, not a sandbox.
Package mcptools adapts the official MCP Go SDK to the tool-source contract.
Package mcptools adapts the official MCP Go SDK to the tool-source contract.
Package modelselect chooses model access above the Runtime.
Package modelselect chooses model access above the Runtime.
Package modular builds agents without exposing the underlying Harness.
Package modular builds agents without exposing the underlying Harness.
anthropic
Package anthropic provides the Anthropic Messages API Provider.
Package anthropic provides the Anthropic Messages API Provider.
cmd/fixtures command
files
Package files provides the six standard file and command tools.
Package files provides the six standard file and command tools.
internal/fixtures
Package fixtures contains the shared SDK fixtures in both placements.
Package fixtures contains the shared SDK fixtures in both placements.
mcp
Package mcp configures the SDK's MCP tool source.
Package mcp configures the SDK's MCP tool source.
modulartest
Package modulartest builds agents for offline tests.
Package modulartest builds agents for offline tests.
openai
Package openai provides the OpenAI Responses API Provider.
Package openai provides the OpenAI Responses API Provider.
subscription
Package subscription implements shared sign-ins for subscription Providers.
Package subscription implements shared sign-ins for subscription Providers.
Package pluginrpc implements modular-agent-plugin/1 over bidirectional stdio.
Package pluginrpc implements modular-agent-plugin/1 over bidirectional stdio.
Package portable translates history at storage and plugin boundaries.
Package portable translates history at storage and plugin boundaries.
Package questions implements recorded, keyed actor input, including late answers.
Package questions implements recorded, keyed actor input, including late answers.
Package resultcheck lets a plugin return a model to work within the same turn.
Package resultcheck lets a plugin return a model to work within the same turn.
This explicit real-run driver is not an offline test.
This explicit real-run driver is not an offline test.
Package servicehttp contains the version 1 HTTP binding's authentication and framing.
Package servicehttp contains the version 1 HTTP binding's authentication and framing.
Package subagents builds child agents only from sessions, jobs and standard input.
Package subagents builds child agents only from sessions, jobs and standard input.
Package systemprompt builds the turn's system prompt using the working environment.
Package systemprompt builds the turn's system prompt using the working environment.
Package terminal provides interactive line, print, and JSON event Interfaces.
Package terminal provides interactive line, print, and JSON event Interfaces.
Package tools offers file and shell tools using only the working environment capability.
Package tools offers file and shell tools using only the working environment capability.
Package transient runs turns only while its process lives.
Package transient runs turns only while its process lives.
Package turnrun implements the standard turn protocol shared by Runtime plugins.
Package turnrun implements the standard turn protocol shared by Runtime plugins.
Package vanilla is the composition root.
Package vanilla is the composition root.

Jump to

Keyboard shortcuts

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