Skip to main content

Module backend

Module backend 

Source
Expand description

The agent backend seam (plan §4 “sdk-adapter”, §8 testing strategy).

CONTRACT FILE — do not modify in implementation phases. If a change seems necessary, report it instead of editing.

There is no Rust Claude Agent SDK, so the real backend drives the claude CLI headless (--print --output-format stream-json), which is the same process the official SDKs wrap — Claude Code’s native config (CLAUDE.md, .claude/skills, .mcp.json, hooks) is inherited because the session runs with cwd = repo root. The mock backend returns scripted event streams so the entire engine is testable without model calls.

Structs§

SessionSpec
Everything needed to spawn one agent session.

Enums§

AgentEvent
Normalized events surfaced from a session’s output stream.
PromptMode
How the session receives its prompt.
SessionExit
Why a session ended.

Traits§

AgentBackend
Factory for agent sessions — the mockable seam.
AgentSession
A live agent session. Consumers poll next_event until None, then call exit_status.