pub struct CompletionSummary { /* private fields */ }Expand description
Accumulated, evidence-bound completion state for one human task.
The root CLI resets this per human task, feeds live AgentEvents as
they arrive, attaches caller-supplied working-tree paths, and renders the
/summary text. AgentEvent::History replays are display-only and are
never counted as live turns; use CompletionSummary::from_events to
rebuild from archived events deliberately.
Implementations§
Source§impl CompletionSummary
impl CompletionSummary
pub fn new() -> Self
Sourcepub fn begin_task(&mut self, task: impl Into<String>)
pub fn begin_task(&mut self, task: impl Into<String>)
Start a fresh task. Clears all observed state and records the task text shown at the top of every render.
Sourcepub fn observe(&mut self, event: &AgentEvent)
pub fn observe(&mut self, event: &AgentEvent)
Observe one live normalized event. Display-only history replay events
(AgentEvent::History) are ignored so restored conversations never
count as live turns or fabricate outcomes.
Sourcepub fn from_events<'a>(events: impl IntoIterator<Item = &'a AgentEvent>) -> Self
pub fn from_events<'a>(events: impl IntoIterator<Item = &'a AgentEvent>) -> Self
Deliberately rebuild a summary from stored or replayed events, such as
an archived journal. Unlike live observation this is an explicit
intent to summarize past activity; AgentEvent::History wrappers
are still display-only and stay excluded.
Sourcepub fn set_changed_paths(
&mut self,
paths: impl IntoIterator<Item = impl Into<String>>,
)
pub fn set_changed_paths( &mut self, paths: impl IntoIterator<Item = impl Into<String>>, )
Attach caller-supplied changed working-tree paths, such as git status output. The summary never inspects the filesystem itself.
Paths are trimmed, deduplicated preserving first-seen order, and
replace any previously attached set.
pub fn task(&self) -> Option<&str>
Sourcepub fn last_response(&self) -> Option<&str>
pub fn last_response(&self) -> Option<&str>
The final response text of the most recent turn with text. This is agent-reported prose, never evidence of execution.
pub fn last_response_slot(&self) -> Option<RosterSlot>
pub fn tool_outcomes(&self) -> &[ToolOutcome]
pub fn changed_paths(&self) -> &[String]
pub fn observed_turns(&self) -> usize
Sourcepub fn render_markdown(&self) -> String
pub fn render_markdown(&self) -> String
Render the summary as GitHub-flavored Markdown.
Sourcepub fn render_text(&self) -> String
pub fn render_text(&self) -> String
Render the summary as plain text.
Trait Implementations§
Source§impl Clone for CompletionSummary
impl Clone for CompletionSummary
Source§fn clone(&self) -> CompletionSummary
fn clone(&self) -> CompletionSummary
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more