Expand description
Agent layer — sends a turn and returns a streaming event iterator.
Control requests (hook callbacks, can_use_tool) are answered by the
Session itself; this layer only turns frames into AgentEvents.
prompt yields the events of one turn; watch yields every turn’s,
including the turns the CLI starts on its own.
Structs§
- Agent
- Runs turns on a Session.
- Turn
Error - Why a turn failed.
resultcarries cost and usage up to the failure. - Turn
Result - Outcome of a finished turn, from its
resultframe.
Enums§
- Agent
Error - Error starting a turn.
- Agent
Event - One event of a turn, translated from the CLI’s stdout frames.
Type Aliases§
- Agent
Stream - Events of one turn; ends after
DoneorError. Dropping it before then cancels the turn (seeAgent::prompt_message).