diff --git a/README.md b/README.md index a6119f0..0bcae1f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,31 @@ A Go library for building agentic systems. Provides a sandboxed `execute_code` t ## Primitives -**`agent.Core`** — the central interface for a running agent session. Exposes `Submit` (send a prompt, stream events back), `Interrupt`, `Inject`, `Queue`/`PopQueue` (buffered prompt delivery), `State`, `Reply`, `SystemPrompt`, `Usage`, `CtxSz`, `ListModels`, `CWD`/`SetCWD`, `SetSessionID`, `IsRunning`, and `Close`. +**`agent.Core`** — the central interface for a running agent session. Key methods: + +- `Submit` — send a prompt, stream events via the bus +- `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: ` +- `Reply` — assistant text from the last completed turn +- `IsRunning` — whether a turn is in progress +- `AgentName`/`BackendName`/`ModelName` — active identifiers +- `Usage`/`Cost`/`CtxSz` — token counts, cost, context size +- `ListModels` — available models from the backend +- `CWD`/`SetCWD` — working directory for tool execution +- `SetSessionID` — rename the session +- `SystemPrompt` — fully rendered system prompt +- `Context` — current message history as sent to the backend +- `GenerationParams`/`SetGenerationParams` — sampling parameters +- `CompactionModel`/`SetCompactionModel` — model override for compaction +- `SetEnv` — inject session-scoped env var into subprocesses +- `WaitChange` — block until a field changes (state, usage, ctxsz, cwd) +- `ToolCallCount` — monotonic tool call counter +- `SaveSession` — persist session state to disk +- `Detach`/`ListDetached`/`SignalDetached`/`GetDetachedOutput` — background process management +- `Close` — release resources **`agent.Session`** — the conversation turn accumulator. Tracks message history, token usage, context compaction, and session persistence. Supports `compact` (summarize-and-truncate) and `PreCompactionSnapshot`. @@ -12,7 +36,7 @@ A Go library for building agentic systems. Provides a sandboxed `execute_code` t **`agent.Hooks`** — lifecycle callbacks (`agentSpawn`, `preTurn`, `postTurn`, `preCompact`, `postCompact`, `turnError`) executed as shell commands with a JSON payload. Run via `Hooks.Run`. -**`backend.Backend`** — the LLM interface: `ChatStream`, `Models`, `ContextLength`, `Name`, `Model`/`SetModel`, `DefaultModel`. Implementations: Ollama, OpenAI-compatible, Anthropic, Copilot, Kiro. +**`backend.Backend`** — the LLM interface: `ChatStream`, `Models`, `ContextLength`, `Name`, `Model`/`SetModel`, `DefaultModel`. Implementations: Ollama, OpenAI-compatible (including OpenRouter), Anthropic, Copilot, Kiro/CodeWhisperer, Gemini. **`tools.Server`** — interface for a tool provider: `ListTools`, `CallTool`, `Close`. The only built-in implementation is `execute.Server`. Custom servers implement this interface directly. @@ -22,13 +46,12 @@ A Go library for building agentic systems. Provides a sandboxed `execute_code` t ``` pkg/agent/ — Core interface, agent loop, session management -pkg/backend/ — Backend interface + implementations (Ollama, OpenAI, Anthropic, Copilot, Kiro) +pkg/backend/ — Backend interface + implementations (Ollama, OpenAI, Anthropic, Copilot, Kiro, Gemini) pkg/config/ — Config struct and loader pkg/env/ — Environment variable loading (env file + shell) pkg/log/ — Structured logging pkg/paths/ — Config and data directory resolution pkg/skills/ — Skill file discovery and loading -pkg/store/ — Store interfaces and implementations (FlatDir, Session, Batch, Skill) pkg/tools/ — Server and Dispatcher interfaces; tool definitions pkg/tools/execute/ — execute.Server: execute_code ``` @@ -103,4 +126,4 @@ Skills are sourced from `OLLIE_SKILLS_PATH` (default: `~/.config/ollie/skills/`) ## License -GPLv3 \ No newline at end of file +GPLv3