Expand description
Agent loop. The whole kernel.
Tiny on purpose: receive a goal, ask the model what to do, run any tool calls, feed results back, repeat until the model stops requesting tools or we hit the step budget. Everything interesting (which model, which tools, what system prompt) is injected by the caller.
The loop emits StepEvents through a channel so a UI/CLI/log layer can
observe progress without coupling to the agent’s internals.
Structs§
- Agent
- The ReAct loop: ask LLM, execute tools, repeat.
- Agent
Builder - Builder for configuring and creating an agent.
- Agent
Outcome
Enums§
- Finish
Reason - Why the agent’s run terminated.
- Permission
Decision - Placeholder text used when trimming old tool results to fit the transcript budget. Decision returned by a permission hook to allow, deny, or transform a tool call.
- Planning
Mode - Controls whether the agent executes tools immediately or presents a plan first.
- Step
Event
Type Aliases§
- Permission
Hook - Signature for a permission hook:
Fn(&tool_name, &arguments) -> PermissionDecision.