SDKs and APIs

A3S Code provides Rust, Node.js, Python, and Go SDKs. Install the a3s CLI when you want the terminal application. Treat each registry and GitHub Releases as the source of truth for package versions and release status.

EntryPackage or commandDocumentationUse it for
Terminala3s codeA3S CLIRun a coding agent directly in your terminal
Rusta3s-code-coredocs.rsUse the complete runtime API or extension traits
Node.js@a3s-lab/codenpmSubscribe to async events in a Node.js application
Pythona3s-codePyPIUse synchronous or asynchronous Python APIs
Gogithub.com/A3S-Lab/Code/sdk/go/v8Setup belowUse a pure-Go API backed by the native runtime

Install

SHELLSCRIPT
# Rust
cargo add a3s-code-core
# Node.js
npm install @a3s-lab/code
# Python
python -m pip install a3s-code
# Go
go get github.com/A3S-Lab/Code/sdk/go/v8

Python wheel platforms (v8.0.3)

a3s-code on PyPI is a small pure-Python bootstrap. On first import it downloads the matching native wheel from the v8.0.3 GitHub Release and checks its SHA-256 manifest. Native wheels use the CPython 3.10 stable ABI (cp310-abi3), so the same asset supports CPython 3.10 through 3.14:

HostWheel platform tagBaseline
Apple Silicon macOSmacosx_11_0_arm64macOS 11+
Intel macOSmacosx_12_0_x86_64macOS 12+
Linux x86_64manylinux_2_28_x86_64glibc 2.28+
Windows x86_64win_amd64Windows 10+

For an Intel Mac on macOS 12 or later, install with the interpreter that will run your application:

SHELLSCRIPT
python3.14 -m ensurepip --upgrade # only if this interpreter has no pip
python3.14 -m pip install --upgrade pip
python3.14 -m pip install a3s-code

If python3.14 -m pip reports No module named pip, the error is in the Python environment, before A3S Code is imported. Initialize or reinstall pip for that interpreter and retry. The Intel wheel is x86_64 and targets macOS 12; it does not include the optional local ONNX embedding adapter. Keep workspace retrieval model-free or configure an explicitly authorized remote embedding provider on Intel.

Go module and bridge

The Go 1.23+ API is pure Go and does not require CGO. One long-lived a3s-code-go-bridge process owns the native runtime and carries multiplexed requests and EventEnvelopeV1 values over a versioned JSONL protocol.

A Go-enabled repository release publishes a path-prefixed module tag sdk/go/vX.Y.Z, matching release vX.Y.Z, together with a3s-code-go-bridge-SHA256SUMS and x86-64 bridge executables:

SystemAsset target
Linuxx86_64-unknown-linux-gnu
macOSx86_64-apple-darwin
Windowsx86_64-pc-windows-msvc.exe

Download the bridge from GitHub Releases, verify it against the published SHA-256 file, and keep its version equal to the Go module version. Put it on PATH, set A3S_CODE_GO_BRIDGE, or pass code.WithBridgePath:

SHELLSCRIPT
export A3S_CODE_GO_BRIDGE=/opt/a3s/bin/a3s-code-go-bridge
POWERSHELL
$env:A3S_CODE_GO_BRIDGE = 'C:\a3s\a3s-code-go-bridge.exe'

For an architecture without a release asset, build it from a source checkout:

SHELLSCRIPT
bash .github/setup-workspace.sh
cargo build --release --package a3s-code-go-bridge --bin a3s-code-go-bridge

code.Create performs a fail-closed handshake for the transport protocol, event protocol, and complete operation inventory. Go failures use stable *code.Error codes while context cancellation and deadlines remain available through errors.Is. The bridge covers the complete serializable Agent/Session surface plus Go-backed hooks, budget guards, slash commands, and pipeline callbacks. Arbitrary Rust trait-object implementations remain a Rust-native extension mechanism; the other SDKs use their equivalent value configuration, callback, direct-tool, or MCP boundary.

What the SDKs share

All four SDKs use the same session lifecycle, event format, and snapshots. A UI can subscribe to the same AgentEvent / EventEnvelopeV1 stream and resume saved work by session ID.

Priority scheduler surface

v6.9 adds the same Agent-wide scheduler controls to every SDK. Select a session's urgent, interactive, foreground, background, or maintenance priority at creation time, then read the shared occupancy snapshot from the Agent or any sibling session:

SDKSession optionAgent / Session snapshot
RustSessionOptions::with_task_priority(TaskPriority)task_scheduler_stats().await
Node.jstaskPrioritytaskSchedulerStats()
PythonSessionOptions.task_prioritytask_scheduler_stats()
GoSessionOptions.TaskPriorityTaskSchedulerStats(ctx)

The snapshot includes global capacity, active and pending totals, per-priority counts, and shutdown state. See Task scheduler for ordering, aging, cancellation, configuration, and complete examples.

Tool-result projection surface

All four SDKs pin the same versioned deterministic projection policy to a session:

SDKSession option or builder
Rustwith_tool_result_transform_policy(ToolResultTransformPolicyV1)
Node.jstoolResultTransformPolicy
PythonSessionOptions.tool_result_transform_policy
GoSessionOptions.ToolResultTransformPolicy

Rust and Python expose a context_efficient() preset; Node.js and Go accept the same explicit fields. The policy persists in snapshots and every Tool result carries a3s.code.tool-result-evidence.v1 metadata. See Tools for field values, ordering, bounds, loss modes, and SDK examples.

The shared guides place Go beside Node.js and Python for the complete common SDK capability surface. Start with quick start, then continue to streaming, direct tools, sessions, verification, MCP, and persistence.

All four SDKs can configure persistence, memory, local/S3 workspaces, remote Git, permissions and confirmation, hooks, MCP, queues, deterministic replay, and orchestration. Rust additionally accepts arbitrary in-process trait implementations such as a custom LlmClient or ContextProvider; other languages integrate custom services through callbacks, direct tools, or MCP. For UI integration, start with sessions and event streams.