Skip to main content

Module agent

Module agent 

Source
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.
AgentBuilder
Builder for configuring and creating an agent.
AgentOutcome

Enums§

FinishReason
Why the agent’s run terminated.
PermissionDecision
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.
PlanningMode
Controls whether the agent executes tools immediately or presents a plan first.
StepEvent

Type Aliases§

PermissionHook
Signature for a permission hook: Fn(&tool_name, &arguments) -> PermissionDecision.