pub struct Playbook { /* private fields */ }Expand description
Structured context store for accumulated strategies and insights.
The Playbook replaces traditional message history with a curated collection of strategy entries (bullets) that evolve based on execution feedback.
Implementations§
Source§impl Playbook
impl Playbook
Sourcepub fn add_bullet(
&mut self,
section: &str,
content: &str,
bullet_id: Option<&str>,
metadata: Option<&HashMap<String, i64>>,
) -> &Bullet
pub fn add_bullet( &mut self, section: &str, content: &str, bullet_id: Option<&str>, metadata: Option<&HashMap<String, i64>>, ) -> &Bullet
Add a new bullet to the playbook.
Sourcepub fn update_bullet(
&mut self,
bullet_id: &str,
content: Option<&str>,
metadata: Option<&HashMap<String, i64>>,
) -> Option<&Bullet>
pub fn update_bullet( &mut self, bullet_id: &str, content: Option<&str>, metadata: Option<&HashMap<String, i64>>, ) -> Option<&Bullet>
Update an existing bullet.
Sourcepub fn tag_bullet(
&mut self,
bullet_id: &str,
tag: &str,
increment: i64,
) -> Option<&Bullet>
pub fn tag_bullet( &mut self, bullet_id: &str, tag: &str, increment: i64, ) -> Option<&Bullet>
Tag a bullet to update its counters.
Sourcepub fn remove_bullet(&mut self, bullet_id: &str)
pub fn remove_bullet(&mut self, bullet_id: &str)
Remove a bullet from the playbook.
Sourcepub fn get_bullet(&self, bullet_id: &str) -> Option<&Bullet>
pub fn get_bullet(&self, bullet_id: &str) -> Option<&Bullet>
Get a bullet by ID.
Sourcepub fn bullet_count(&self) -> usize
pub fn bullet_count(&self) -> usize
Get number of bullets.
Sourcepub fn section_names(&self) -> Vec<&str>
pub fn section_names(&self) -> Vec<&str>
Get section names.
Sourcepub fn save_to_file(&self, path: &Path) -> Result<()>
pub fn save_to_file(&self, path: &Path) -> Result<()>
Save playbook to JSON file.
Sourcepub fn load_from_file(path: &Path) -> Result<Self, Box<dyn Error>>
pub fn load_from_file(path: &Path) -> Result<Self, Box<dyn Error>>
Load playbook from JSON file.
Sourcepub fn apply_delta(&mut self, delta: &DeltaBatch)
pub fn apply_delta(&mut self, delta: &DeltaBatch)
Apply a batch of delta operations.
Sourcepub fn stats(&self) -> PlaybookStats
pub fn stats(&self) -> PlaybookStats
Get playbook statistics.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Playbook
impl RefUnwindSafe for Playbook
impl Send for Playbook
impl Sync for Playbook
impl Unpin for Playbook
impl UnsafeUnpin for Playbook
impl UnwindSafe for Playbook
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