Documentation
¶
Overview ¶
Package agent implements the core turn loop (spec: openspec/specs/agent-loop, ADR-0001, ADR-0005, ADR-0007). The loop depends only on the ports.Provider port, the tool.Registry port, and the policy.Gate port — it never knows which model backend or which concrete tool implementation is behind them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
Provider ports.Provider
Tools *tool.Registry
Gate policy.Gate
// OnEvent, if set, receives every streamed Event as it arrives — the
// seam a Bubble Tea front-end (T-030) hooks into for live rendering.
OnEvent func(ports.Event)
// OnToolResult, if set, is fired after each tool call executes (or is
// denied/fails), carrying the call and its neutral result block. The TUI
// (T-031) uses it to render edit diffs and tool output.
OnToolResult func(call ports.ToolCall, result ports.Block)
}
Agent wires the three ports together and runs turns until the model stops requesting tools.
Click to show internal directories.
Click to hide internal directories.