session: rename config.go → agent_config.go, update README

This commit is contained in:
Levi Neely 2026-07-29 19:18:04 +02:00
parent 916b31ee89
commit 1664644023
2 changed files with 15 additions and 23 deletions

View File

@ -6,10 +6,10 @@ A Go library for building agentic systems. Provides sandboxed tool execution, a
```mermaid ```mermaid
graph TD graph TD
agent --> tools session --> tools
agent --> backend session --> backend
agent --> log session --> log
agent --> paths session --> paths
execute --> tools execute --> tools
execute --> skills execute --> skills
@ -24,40 +24,32 @@ graph TD
## Packages ## Packages
``` ```
agent/ Core interface, agent loop, compaction, hooks, session persistence, config loading session/ Session + Agent: the core runtime (loop, compaction, hooks, commands, persistence)
backend/ Backend interface + LLM providers (Anthropic, OpenAI, Ollama, Gemini, Copilot, CodeWhisperer) backend/ Backend interface + LLM providers (Anthropic, OpenAI, Ollama, Gemini, Copilot, CodeWhisperer)
tools/ Server/Dispatcher interfaces, tool registry, discovery, schema parsing tools/ Server/Dispatcher interfaces, tool registry, discovery, schema parsing
execute/ Sandboxed shell execution, promoted tool dispatch, skill dispatch, remote SSH execution execute/ Sandboxed shell execution, promoted tool dispatch, skill dispatch, remote SSH
detach/ Background process management (ring buffer, signal) detach/ Background process management (ring buffer, signal)
skills/ Skill metadata parsing and per-session registry skills/ Skill metadata parsing and per-session registry
elevate/ Elevation broker (privilege escalation daemon, policy management) elevate/ Elevation broker (privilege escalation daemon, policy)
sandbox/ Landrun sandbox configuration and command wrapping sandbox/ Landrun sandbox configuration and command wrapping
env/ Session environment helpers env/ Session environment helpers
log/ Structured logger log/ Structured logger
paths/ XDG path resolution paths/ XDG path resolution
``` ```
## Primitives ## Core concepts
**`agent.Core`** — the central interface for a running agent session: **`session.Session`** — the public interface. A session is the runtime environment that hosts an agent. It provides identity, working directory, event bus, environment, and lifecycle management.
- `Submit` — send a prompt, stream events via the bus **`session.Agent`** — the reasoning entity within a session. Owns the conversation history, LLM backend, tools, hooks, and system prompt. Swappable via `/agent` command.
- `Interrupt` — cancel the current turn
- `Inject` — append a user interruption to the next tool result
- `Queue`/`PopQueue` — buffered prompt FIFO
- `Bus` — session event bus (pubsub)
- `State` — current state: `idle`, `thinking`, or `calling: <tool>`
- `Reply` — assistant text from the last completed turn
- `WaitChange` — block until a field changes (state, usage, ctxsz, cwd)
- `Detach`/`ListDetached`/`SignalDetached`/`GetDetachedOutput` — background process management
**`backend.Backend`** — the LLM interface: `ChatStream`, `Models`, `ContextLength`, `Name`, `Model`/`SetModel`, `DefaultModel`. **`session.harness`** (unexported) — implements Session. Wires the agent to the session environment and drives turn execution.
**`tools.Server`** — interface for a tool provider: `ListTools`, `CallTool`. The primary implementation is `execute.Server` (local) with `execute.RemoteServer` for SSH-transparent execution. **`backend.Backend`** — the LLM interface: `ChatStream`, `Models`, `ContextLength`, `Name`, `Model`/`SetModel`.
**`tools.Dispatcher`** — routes tool calls to the correct server by name. Built via `NewDispatcher` or `NewDispatcherFunc`. **`tools.Server`** — interface for a tool provider: `ListTools`, `CallTool`. Implementations: `execute.Server` (local) and `execute.RemoteServer` (SSH).
**`tools.Registry`** — per-session dynamic tool loading. Discovers tool scripts from `OLLIE_TOOLS_PATH`, parses their schemas and metadata, and promotes them to native callable functions on demand. **`tools.Registry`** — per-session dynamic tool loading. Discovers scripts from `OLLIE_TOOLS_PATH`, parses schemas, promotes to native callable functions on demand.
## Install ## Install
@ -102,7 +94,7 @@ Skills are domain-specific knowledge modules in `OLLIE_SKILLS_PATH` (default: `~
The 9P server (`olliesrv`) is the session manager. It instantiates the execute server, elevation broker, and tool/skill registries at daemon level. Sessions are created, queried, and controlled via the 9P filesystem — all agent interaction uses the `ollie-9p` client internally. The 9P server (`olliesrv`) is the session manager. It instantiates the execute server, elevation broker, and tool/skill registries at daemon level. Sessions are created, queried, and controlled via the 9P filesystem — all agent interaction uses the `ollie-9p` client internally.
`NewAgentCore` handles per-session state: message history, tool call routing, compaction, and hooks. `Core.Close()` tears down resources when a session is killed. `session.New()` creates a session with its agent. The session drives turn execution, manages compaction, and handles lifecycle events. `Close()` tears down resources when a session is killed.
## License ## License