Expand description
§aonyx-api
The Aonyx Agent automation API: a REST + WebSocket surface over the
same core that powers the CLI/TUI. It is a thin transport — every
endpoint bottoms out in the existing aonyx-* crates, no agent-loop
logic is reimplemented here.
This crate is feature-driven by the binary: aonyx-agent depends on it
behind its api feature and serves build_router via
aonyx serve api. To avoid a dependency cycle, aonyx-api never
depends on aonyx-agent; the agent loop is injected through a trait
(added in a later phase), exactly like the channel adapters.
§Surface (grown phase by phase)
- V4.1 (this scaffold) —
build_routerwith/v1/health(open) and/v1/info(bearer-authed),ApiState,AuthConfig,ServerInfo, and theApiErrorresponse type. - V4.2 — sessions + blocking turns.
- V4.3 — WebSocket / SSE streaming.
- V4.4 — memory palace, tools, skills, config, OpenAPI.
Re-exports§
Modules§
- error
- The API error type and its HTTP rendering.
Structs§
- ApiState
- State shared with every request handler.
- Auth
Config - Authentication + authorization policy for the API.
- Config
Info - Non-secret server configuration (
GET /v1/config). Never carries keys. - Server
Info - Server identity + capabilities, returned by
GET /v1/info. - Skill
Info - Metadata for one loaded skill (
GET /v1/skills). - Tool
Info - Metadata for one registered tool (
GET /v1/tools).
Enums§
- Stream
Frame - A single streamed event of a turn, serialized to the client as a JSON
frame (
{"type": "...", ...}). Mirrors the agent loop’s internalTurnEvent; the binary maps its events onto these.
Traits§
- ApiAgent
- One agent turn over a full message history — blocking or streaming — plus read-only metadata accessors the binary fills from its live components.
Functions§
- build_
router - Build the complete API router for the given
ApiState. - serve
- Bind
addr(e.g.127.0.0.1:8788) and serve the full API until the process is stopped. The binary wires this fromaonyx serve api.