pub struct StepOutput {
pub output: Value,
pub duration_ms: u64,
pub cost_usd: Decimal,
pub input_tokens: Option<u64>,
pub output_tokens: Option<u64>,
pub model: Option<String>,
pub debug_messages: Option<Vec<DebugMessage>>,
}Expand description
Result of executing a single step.
Fields§
§output: ValueSerialized output (stdout for shell, body for http, value for agent).
For agent steps with a JSON schema, the value may not strictly conform
to the schema: Claude CLI can flatten wrapper objects with a single
array field, returning a bare array instead of {"items": [...]}.
Callers should handle both the expected wrapper and a bare value.
duration_ms: u64Wall-clock duration in milliseconds.
cost_usd: DecimalCost in USD (agent steps only).
input_tokens: Option<u64>Input token count (agent steps only).
output_tokens: Option<u64>Output token count (agent steps only).
model: Option<String>Model identifier used for agent steps (e.g. "claude-sonnet-4-20250514").
debug_messages: Option<Vec<DebugMessage>>Conversation trace from verbose agent invocations.
Implementations§
Source§impl StepOutput
impl StepOutput
Sourcepub fn debug_messages_json(&self) -> Option<Value>
pub fn debug_messages_json(&self) -> Option<Value>
Serialize debug messages to a JSON Value for store persistence.
Returns None when verbose mode was off (no messages captured).
Trait Implementations§
Source§impl Clone for StepOutput
impl Clone for StepOutput
Source§fn clone(&self) -> StepOutput
fn clone(&self) -> StepOutput
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more