internal/

directory
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: Apache-2.0

Directories

Path Synopsis
Package adapter defines the contract every agent CLI backend implements, and the registry that turns a config block into a live adapter.
Package adapter defines the contract every agent CLI backend implements, and the registry that turns a config block into a live adapter.
agentcli
Package agentcli holds the plumbing every CLI-backed adapter needs: resolving the binary, learning which flags the installed version actually supports, and turning one subprocess run into a stream of IR events.
Package agentcli holds the plumbing every CLI-backed adapter needs: resolving the binary, learning which flags the installed version actually supports, and turning one subprocess run into a stream of IR events.
claudecode
Package claudecode adapts the Claude Code CLI (`claude`) into an inference backend.
Package claudecode adapts the Claude Code CLI (`claude`) into an inference backend.
codex
Package codex adapts the Codex CLI (`codex exec`) into an inference backend.
Package codex adapts the Codex CLI (`codex exec`) into an inference backend.
cursor
Package cursor adapts the Cursor Agent CLI (`cursor-agent`) into an inference backend.
Package cursor adapts the Cursor Agent CLI (`cursor-agent`) into an inference backend.
fake
Package fake provides an in-memory adapter for tests: it exercises the gateway end to end without spawning a CLI.
Package fake provides an in-memory adapter for tests: it exercises the gateway end to end without spawning a CLI.
mock
Package mock is a scripted backend, compiled in only with the "conformance" build tag.
Package mock is a scripted backend, compiled in only with the "conformance" build tag.
qwencode
Package qwen adapts the Qwen Code CLI (`qwen`) into an inference backend.
Package qwen adapts the Qwen Code CLI (`qwen`) into an inference backend.
Package config defines agent2api's configuration schema and assembles the effective config from three layers: built-in defaults, an optional config file, and CLI flags — later layers winning per key.
Package config defines agent2api's configuration schema and assembles the effective config from three layers: built-in defaults, an optional config file, and CLI flags — later layers winning per key.
frontend
anthropic
Package anthropic implements the Anthropic-compatible HTTP surface: POST /v1/messages, streaming and non-streaming.
Package anthropic implements the Anthropic-compatible HTTP surface: POST /v1/messages, streaming and non-streaming.
openai
Package openai implements the OpenAI-compatible HTTP surface: POST /v1/chat/completions and GET /v1/models, streaming and non-streaming.
Package openai implements the OpenAI-compatible HTTP surface: POST /v1/chat/completions and GET /v1/models, streaming and non-streaming.
responses
Package responses serves the OpenAI Responses API as a text-only endpoint.
Package responses serves the OpenAI Responses API as a text-only endpoint.
sse
Package sse encodes Server-Sent Events and pumps adapter events into them.
Package sse encodes Server-Sent Events and pumps adapter events into them.
Package gate bounds how many agent CLI processes an adapter may have running at once.
Package gate bounds how many agent CLI processes an adapter may have running at once.
Package ir defines the protocol-neutral internal representation that sits between API frontends (OpenAI, Anthropic) and agent CLI adapters.
Package ir defines the protocol-neutral internal representation that sits between API frontends (OpenAI, Anthropic) and agent CLI adapters.
Package logging builds the process logger from configuration.
Package logging builds the process logger from configuration.
Package prompt renders a conversation into the single prompt string an agent CLI accepts.
Package prompt renders a conversation into the single prompt string an agent CLI accepts.
Package router resolves the model name in a request to the adapter that serves it.
Package router resolves the model name in a request to the adapter that serves it.
Package runner owns agent CLI subprocess lifecycle: spawning, streaming stdout line by line, capturing a bounded stderr tail, enforcing idle and absolute deadlines, and making sure nothing outlives the request.
Package runner owns agent CLI subprocess lifecycle: spawning, streaming stdout line by line, capturing a bounded stderr tail, enforcing idle and absolute deadlines, and making sure nothing outlives the request.
Package selfupdate replaces the running agent2api binary with the latest published release.
Package selfupdate replaces the running agent2api binary with the latest published release.
Package server wires configuration into a running HTTP gateway: it builds the adapters, the router and the API frontends, and owns the listener.
Package server wires configuration into a running HTTP gateway: it builds the adapters, the router and the API frontends, and owns the listener.
Package version reports the build's identity.
Package version reports the build's identity.

Jump to

Keyboard shortcuts

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