Skip to main content

LocalStore

Struct LocalStore 

Source
pub struct LocalStore { /* private fields */ }
Expand description

Local product facade backed by the workspace-wide canonical SQLite schema.

Implementations§

Source§

impl LocalStore

Source

pub fn replay_display_window( &self, session_id: &str, run_id: Option<&str>, cursor: Option<&ReplayCursor>, ) -> CliResult<DisplayReplayWindow>

Replay display messages as scoped replay events.

Source§

impl LocalStore

Source

pub fn open(config: &CliConfig) -> CliResult<Self>

Open canonical shared storage and the CLI-owned blob directory.

Source

pub fn import_legacy_database( &self, source_path: impl AsRef<Path>, workspace: impl AsRef<Path>, ) -> CliResult<LocalStoreImportReport>

Explicitly import a project-local legacy database into canonical shared storage.

Source

pub fn create_session( &mut self, profile: &str, title: Option<String>, ) -> CliResult<SessionRecord>

Create a session.

Source

pub fn load_session(&self, session_id: &str) -> CliResult<SessionRecord>

Load a session.

Source

pub fn load_workspace_session( &self, session_id: &str, ) -> CliResult<SessionRecord>

Load a session and require it to belong to the current workspace.

Source

pub fn resolve_session_prefix(&self, value: &str) -> CliResult<String>

Resolve an exact session id or unique prefix.

Source

pub fn delete_session(&mut self, session_id: &str) -> CliResult<bool>

Tombstone one shared session and remove only CLI-owned compatibility blobs.

Source

pub fn load_run(&self, session_id: &str, run_id: &str) -> CliResult<RunRecord>

Load a run.

Source

pub fn latest_session(&self) -> CliResult<Option<SessionRecord>>

Latest active session in the current workspace.

Source

pub fn admit_run( &mut self, session_id: &str, prompt: String, restore_from_run_id: Option<String>, profile: &str, initial_metadata: Map<String, Value>, host_instance_id: &str, replaces_waiting_run_id: Option<RunId>, hitl_resume_claim_id: Option<String>, ) -> CliResult<(RunRecord, RunAdmissionLease)>

Atomically admit a queued run and return its fenced lease.

Source

pub fn heartbeat_run_admission( config: &CliConfig, lease: &RunAdmissionLease, ) -> CliResult<RunAdmissionLease>

Extend a CLI-owned durable admission lease.

Source

pub fn release_run_admission(&self, lease: &RunAdmissionLease) -> CliResult<()>

Release a CLI-owned durable admission lease.

Source

pub fn complete_run_fenced( &mut self, run: &mut RunRecord, output: String, artifacts: RunArtifacts, admission_lease: &RunAdmissionLease, ) -> CliResult<Vec<DisplayMessage>>

Complete or pause an admitted product run while its lease remains current.

Source

pub fn fail_run_with_messages_fenced( &mut self, run: &mut RunRecord, message: String, messages: &[DisplayMessage], admission_lease: &RunAdmissionLease, ) -> CliResult<()>

Fail an admitted product run while its lease remains current.

Source

pub fn prepare_waiting_continuation( &self, session_id: &str, run_id: &str, ) -> CliResult<PreparedContinuation>

Side-effect-free prepare a waiting HITL continuation from canonical evidence.

Source

pub fn load_restore_state( &self, session_id: &str, run_id: Option<&str>, ) -> CliResult<Option<ResumableState>>

Load the latest saved state for a continuation source.

Source

pub fn list_sessions(&self, limit: usize) -> CliResult<Vec<SessionSummary>>

List session summaries for the current workspace.

Source

pub fn search_sessions( &self, query: SessionSearchQuery, ) -> CliResult<SessionSearchPage>

Search canonical local sessions and approved compatibility display projections.

Source

pub fn list_run_records(&self, session_id: &str) -> CliResult<Vec<RunRecord>>

List canonical run records in session sequence order.

Source

pub fn list_runs( &self, session_id: &str, limit: usize, ) -> CliResult<Vec<RunSummary>>

List run summaries in sequence order, retaining the newest limit runs.

Source

pub fn replay_display( &self, session_id: &str, run_id: Option<&str>, after: Option<usize>, ) -> CliResult<Vec<DisplayMessage>>

Replay display messages for a session or run.

Source

pub fn trim( &mut self, sessions: Vec<String>, keep_runs: usize, dry_run: bool, ) -> CliResult<TrimReport>

Trim old runs for selected sessions.

Source

pub fn trim_with_age( &mut self, sessions: Vec<String>, keep_runs: usize, older_than: Option<Duration>, dry_run: bool, ) -> CliResult<TrimReport>

Trim old runs for selected sessions and optional age horizon.

Source

pub fn all_session_ids(&self) -> CliResult<Vec<String>>

Return all session ids in the current workspace.

Source

pub fn list_approvals( &self, session_id: Option<&str>, run_id: Option<&str>, ) -> CliResult<Vec<ApprovalRecord>>

List persisted approval records.

Source

pub fn load_approval(&self, approval_id: &str) -> CliResult<ApprovalRecord>

Load one approval record.

Source

pub fn decide_approval( &mut self, approval_id: &str, status: ApprovalStatus, reason: Option<String>, ) -> CliResult<ApprovalRecord>

Record an approval decision.

Source

pub fn list_deferred_tools( &self, session_id: Option<&str>, run_id: Option<&str>, ) -> CliResult<Vec<DeferredToolRecord>>

List persisted deferred tool records.

Source

pub fn load_deferred_tool( &self, deferred_id: &str, ) -> CliResult<DeferredToolRecord>

Load one deferred tool record.

Source

pub fn complete_deferred_tool( &mut self, deferred_id: &str, response: Value, ) -> CliResult<DeferredToolRecord>

Complete one deferred tool record.

Source

pub fn fail_deferred_tool( &mut self, deferred_id: &str, error: &str, ) -> CliResult<DeferredToolRecord>

Fail one deferred tool record.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more