pub struct AgentStateSnapshot {
pub todos: Vec<TodoItem>,
pub files: BTreeMap<String, String>,
pub scratchpad: BTreeMap<String, Value>,
pub pending_interrupts: Vec<AgentInterrupt>,
}
Expand description
Snapshot of agent state shared between runtime, planners, and tools.
Fields§
§todos: Vec<TodoItem>
§files: BTreeMap<String, String>
§scratchpad: BTreeMap<String, Value>
§pending_interrupts: Vec<AgentInterrupt>
Pending interrupts awaiting human response
Implementations§
Source§impl AgentStateSnapshot
impl AgentStateSnapshot
pub fn apply_command(&mut self, command: Command)
Source§impl AgentStateSnapshot
impl AgentStateSnapshot
Sourcepub fn add_interrupt(&mut self, interrupt: AgentInterrupt)
pub fn add_interrupt(&mut self, interrupt: AgentInterrupt)
Add an interrupt to the pending interrupts list.
Sourcepub fn clear_interrupts(&mut self)
pub fn clear_interrupts(&mut self)
Clear all pending interrupts.
Sourcepub fn has_pending_interrupts(&self) -> bool
pub fn has_pending_interrupts(&self) -> bool
Check if there are any pending interrupts.
Sourcepub fn merge(&mut self, other: AgentStateSnapshot)
pub fn merge(&mut self, other: AgentStateSnapshot)
Merge another state snapshot into this one using reducer logic.
Sourcepub fn reduce_files(
left: Option<BTreeMap<String, String>>,
right: Option<BTreeMap<String, String>>,
) -> Option<BTreeMap<String, String>>
pub fn reduce_files( left: Option<BTreeMap<String, String>>, right: Option<BTreeMap<String, String>>, ) -> Option<BTreeMap<String, String>>
File reducer function matching Python’s file_reducer behavior. Merges two optional file dictionaries, handling None values appropriately.
Sourcepub fn with_merged_files(
&self,
new_files: Option<BTreeMap<String, String>>,
) -> Self
pub fn with_merged_files( &self, new_files: Option<BTreeMap<String, String>>, ) -> Self
Create a new state with merged files, handling None values.
pub fn with_updated_todos(&self, new_todos: Vec<TodoItem>) -> Self
Trait Implementations§
Source§impl Clone for AgentStateSnapshot
impl Clone for AgentStateSnapshot
Source§fn clone(&self) -> AgentStateSnapshot
fn clone(&self) -> AgentStateSnapshot
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AgentStateSnapshot
impl Debug for AgentStateSnapshot
Source§impl Default for AgentStateSnapshot
impl Default for AgentStateSnapshot
Source§fn default() -> AgentStateSnapshot
fn default() -> AgentStateSnapshot
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AgentStateSnapshot
impl<'de> Deserialize<'de> for AgentStateSnapshot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AgentStateSnapshot
impl RefUnwindSafe for AgentStateSnapshot
impl Send for AgentStateSnapshot
impl Sync for AgentStateSnapshot
impl Unpin for AgentStateSnapshot
impl UnwindSafe for AgentStateSnapshot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more