pub struct OutboxStore { /* private fields */ }Implementations§
Source§impl OutboxStore
impl OutboxStore
pub fn default_root() -> Result<PathBuf>
pub fn open(root: impl Into<PathBuf>) -> Result<Self>
Sourcepub fn open_existing_default() -> Option<Self>
pub fn open_existing_default() -> Option<Self>
Open at the default location only if it already exists — for read paths that must not create state as a side effect.
pub fn root(&self) -> &Path
Sourcepub fn stage(
&self,
tool: &str,
kind: OutboxKind,
args: Value,
taint: Taint,
session_id: Option<String>,
workspace: Option<PathBuf>,
) -> Result<OutboxItem>
pub fn stage( &self, tool: &str, kind: OutboxKind, args: Value, taint: Taint, session_id: Option<String>, workspace: Option<PathBuf>, ) -> Result<OutboxItem>
Stage a drafted call. No lock: the id is fresh, so there is no state to race on, and the agent loop must never wait on a review session.
Sourcepub fn items(&self) -> Result<Vec<OutboxItem>>
pub fn items(&self) -> Result<Vec<OutboxItem>>
Every item, oldest first.
Sourcepub fn item(&self, id: &str) -> Result<OutboxItem>
pub fn item(&self, id: &str) -> Result<OutboxItem>
Find one item by id or unique prefix. Ambiguity is an error rather than a guess, same as session and proposal lookup.
Sourcepub fn update_args(&self, id: &str, args: Value) -> Result<OutboxItem>
pub fn update_args(&self, id: &str, args: Value) -> Result<OutboxItem>
Replace a pending item’s release arguments. args_before is untouched
— it is the baseline the learning capture diffs against.
Sourcepub fn resolve(
&self,
id: &str,
status: &str,
reason: Option<String>,
) -> Result<OutboxItem>
pub fn resolve( &self, id: &str, status: &str, reason: Option<String>, ) -> Result<OutboxItem>
Resolve a pending item as sent or rejected, in place — the file is
its own audit record, so nothing moves to an archive.
Sourcepub fn record_error(&self, id: &str, error: &str) -> Result<()>
pub fn record_error(&self, id: &str, error: &str) -> Result<()>
Record a failed release attempt. The item stays pending: the draft
is still good, and the next send retries.
Sourcepub fn lock(&self) -> Result<OutboxLock>
pub fn lock(&self) -> Result<OutboxLock>
Writer lock for read-modify-write paths (edit, send, reject). Taken
before reading the item acted on; never held across $EDITOR.