Skip to main content

SqliteRuntimeRepository

Struct SqliteRuntimeRepository 

Source
pub struct SqliteRuntimeRepository { /* private fields */ }
Available on crate feature sqlite-persistence only.

Implementations§

Source§

impl SqliteRuntimeRepository

Source

pub fn new(db_path: &str) -> Result<SqliteRuntimeRepository, KernelError>

Source

pub fn enqueue_attempt( &self, attempt_id: &str, run_id: &str, ) -> Result<(), KernelError>

Source

pub fn set_attempt_timeout_policy( &self, attempt_id: &str, policy: &TimeoutPolicyConfig, ) -> Result<(), KernelError>

Source

pub fn set_attempt_priority( &self, attempt_id: &str, priority: i32, ) -> Result<(), KernelError>

Source

pub fn set_attempt_tenant_id( &self, attempt_id: &str, tenant_id: Option<&str>, ) -> Result<(), KernelError>

Source

pub fn get_attempt_status( &self, attempt_id: &str, ) -> Result<Option<(u32, AttemptExecutionStatus)>, KernelError>

Source

pub fn set_attempt_trace_context( &self, attempt_id: &str, trace_id: &str, parent_span_id: Option<&str>, span_id: &str, trace_flags: &str, ) -> Result<(), KernelError>

Source

pub fn get_attempt_trace_context( &self, attempt_id: &str, ) -> Result<Option<AttemptTraceContextRow>, KernelError>

Source

pub fn latest_attempt_trace_for_run( &self, run_id: &str, ) -> Result<Option<AttemptTraceContextRow>, KernelError>

Source

pub fn latest_attempt_id_for_run( &self, run_id: &str, ) -> Result<Option<String>, KernelError>

Source

pub fn advance_attempt_trace( &self, attempt_id: &str, next_span_id: &str, ) -> Result<Option<AttemptTraceContextRow>, KernelError>

Source

pub fn set_attempt_started_at_for_test( &self, attempt_id: &str, started_at: Option<DateTime<Utc>>, ) -> Result<(), KernelError>

Source

pub fn get_lease_for_attempt( &self, attempt_id: &str, ) -> Result<Option<LeaseRecord>, KernelError>

Source

pub fn get_lease_by_id( &self, lease_id: &str, ) -> Result<Option<LeaseRecord>, KernelError>

Source

pub fn active_leases_for_worker( &self, worker_id: &str, now: DateTime<Utc>, ) -> Result<usize, KernelError>

Source

pub fn active_leases_for_tenant( &self, tenant_id: &str, now: DateTime<Utc>, ) -> Result<usize, KernelError>

Source

pub fn queue_depth(&self, now: DateTime<Utc>) -> Result<usize, KernelError>

Source

pub fn a2a_compat_queue_depth(&self) -> Result<usize, KernelError>

Source

pub fn list_dispatchable_attempt_contexts( &self, now: DateTime<Utc>, limit: usize, ) -> Result<Vec<DispatchableAttemptContext>, KernelError>

Source

pub fn heartbeat_lease_with_version( &self, lease_id: &str, worker_id: &str, expected_version: u64, heartbeat_at: DateTime<Utc>, lease_expires_at: DateTime<Utc>, ) -> Result<(), KernelError>

Source

pub fn mark_attempt_status( &self, attempt_id: &str, status: AttemptExecutionStatus, ) -> Result<(), KernelError>

Source

pub fn ack_attempt( &self, attempt_id: &str, status: AttemptExecutionStatus, retry_policy: Option<&RetryPolicyConfig>, now: DateTime<Utc>, ) -> Result<AttemptAckOutcome, KernelError>

Source

pub fn get_attempt_retry_history( &self, attempt_id: &str, ) -> Result<Option<AttemptRetryHistorySnapshot>, KernelError>

Source

pub fn list_dead_letters( &self, status_filter: Option<&str>, limit: usize, ) -> Result<Vec<DeadLetterRow>, KernelError>

Source

pub fn get_dead_letter( &self, attempt_id: &str, ) -> Result<Option<DeadLetterRow>, KernelError>

Source

pub fn replay_dead_letter( &self, attempt_id: &str, now: DateTime<Utc>, ) -> Result<DeadLetterRow, KernelError>

Source

pub fn claim_replay_effect( &self, thread_id: &str, replay_target: &str, fingerprint: &str, now: DateTime<Utc>, ) -> Result<ReplayEffectClaim, KernelError>

Source

pub fn complete_replay_effect( &self, fingerprint: &str, response_json: &str, now: DateTime<Utc>, ) -> Result<(), KernelError>

Source

pub fn abandon_replay_effect( &self, fingerprint: &str, ) -> Result<(), KernelError>

Source

pub fn list_replay_effects_for_thread( &self, thread_id: &str, ) -> Result<Vec<ReplayEffectLogRow>, KernelError>

Source

pub fn upsert_job( &self, thread_id: &str, status: &str, ) -> Result<(), KernelError>

Source

pub fn list_runs( &self, limit: usize, offset: usize, status_filter: Option<&str>, ) -> Result<Vec<(String, String, DateTime<Utc>)>, KernelError>

Source

pub fn insert_interrupt( &self, interrupt_id: &str, thread_id: &str, run_id: &str, attempt_id: &str, value_json: &str, ) -> Result<(), KernelError>

Source

pub fn list_interrupts( &self, status_filter: Option<&str>, run_id_filter: Option<&str>, limit: usize, ) -> Result<Vec<InterruptRow>, KernelError>

Source

pub fn get_interrupt( &self, interrupt_id: &str, ) -> Result<Option<InterruptRow>, KernelError>

Source

pub fn update_interrupt_status( &self, interrupt_id: &str, status: &str, ) -> Result<(), KernelError>

Source

pub fn persist_interrupt_resume_result( &self, interrupt_id: &str, resume_payload_hash: &str, resume_response_json: &str, ) -> Result<(), KernelError>

Source

pub fn record_step_report( &self, worker_id: &str, attempt_id: &str, action_id: &str, status: &str, dedupe_token: &str, ) -> Result<StepReportWriteResult, KernelError>

Source

pub fn upsert_api_key_record( &self, key_id: &str, secret_hash: &str, active: bool, role: &str, ) -> Result<(), KernelError>

Source

pub fn get_api_key_record( &self, key_id: &str, ) -> Result<Option<ApiKeyRow>, KernelError>

Source

pub fn set_api_key_status( &self, key_id: &str, active: bool, ) -> Result<(), KernelError>

Source

pub fn has_any_api_keys(&self) -> Result<bool, KernelError>

Source

pub fn upsert_a2a_session( &self, session: &A2aSessionRow, ) -> Result<(), KernelError>

Source

pub fn get_active_a2a_session( &self, sender_id: &str, now: DateTime<Utc>, ) -> Result<Option<A2aSessionRow>, KernelError>

Source

pub fn purge_expired_a2a_sessions( &self, now: DateTime<Utc>, ) -> Result<u64, KernelError>

Source

pub fn create_bounty( &self, bounty_id: &str, title: &str, description: Option<&str>, reward: i64, created_by: &str, created_at: DateTime<Utc>, ) -> Result<BountyRow, KernelError>

Source

pub fn get_bounty( &self, bounty_id: &str, ) -> Result<Option<BountyRow>, KernelError>

Source

pub fn accept_bounty( &self, bounty_id: &str, accepted_by: &str, accepted_at: DateTime<Utc>, ) -> Result<bool, KernelError>

Source

pub fn close_bounty( &self, bounty_id: &str, closed_at: DateTime<Utc>, ) -> Result<bool, KernelError>

Source

pub fn create_swarm_task( &self, parent_task_id: &str, decomposition_json: &str, proposer_id: &str, proposer_reward_pct: i32, solver_reward_pct: i32, aggregator_reward_pct: i32, status: &str, created_at: DateTime<Utc>, ) -> Result<SwarmTaskRow, KernelError>

Source

pub fn get_swarm_task( &self, parent_task_id: &str, ) -> Result<Option<SwarmTaskRow>, KernelError>

Source

pub fn upsert_worker_registration( &self, worker_id: &str, domains_json: &str, max_load: i32, metadata_json: Option<&str>, status: &str, now: DateTime<Utc>, ) -> Result<WorkerRegistryRow, KernelError>

Source

pub fn get_worker_registration( &self, worker_id: &str, ) -> Result<Option<WorkerRegistryRow>, KernelError>

Source

pub fn count_active_claims_for_worker( &self, worker_id: &str, now: DateTime<Utc>, ) -> Result<u64, KernelError>

Source

pub fn create_dispute( &self, dispute_id: &str, bounty_id: &str, opened_by: &str, description: &str, created_at: DateTime<Utc>, ) -> Result<DisputeRow, KernelError>

Source

pub fn get_dispute( &self, dispute_id: &str, ) -> Result<Option<DisputeRow>, KernelError>

Source

pub fn append_dispute_evidence( &self, dispute_id: &str, submitted_by: &str, evidence_json: &str, ) -> Result<bool, KernelError>

Source

pub fn resolve_dispute( &self, dispute_id: &str, resolved_by: &str, resolution: &str, resolved_at: DateTime<Utc>, ) -> Result<Option<DisputeRow>, KernelError>

Source

pub fn settle_bounty_via_dispute( &self, bounty_id: &str, settlement_status: &str, closed_at: DateTime<Utc>, ) -> Result<bool, KernelError>

Source

pub fn create_recipe(&self, recipe: &RecipeRow) -> Result<(), KernelError>

Source

pub fn get_recipe( &self, recipe_id: &str, ) -> Result<Option<RecipeRow>, KernelError>

Source

pub fn list_recipes_by_author( &self, author_id: &str, ) -> Result<Vec<RecipeRow>, KernelError>

Source

pub fn create_organism(&self, organism: &OrganismRow) -> Result<(), KernelError>

Source

pub fn get_organism( &self, organism_id: &str, ) -> Result<Option<OrganismRow>, KernelError>

Source

pub fn update_organism_status( &self, organism_id: &str, status: &str, current_step: i32, ) -> Result<bool, KernelError>

Source

pub fn upsert_a2a_compat_task( &self, task: &A2aCompatTaskRow, ) -> Result<(), KernelError>

Source

pub fn list_a2a_compat_tasks( &self, sender_id: &str, protocol_version: &str, ) -> Result<Vec<A2aCompatTaskRow>, KernelError>

Source

pub fn claim_a2a_compat_task( &self, sender_id: &str, protocol_version: &str, now: DateTime<Utc>, lease_duration_ms: u64, requested_task_id: Option<&str>, ) -> Result<A2aCompatClaimOutcome, KernelError>

Source

pub fn get_a2a_compat_task( &self, session_id: &str, ) -> Result<Option<A2aCompatTaskRow>, KernelError>

Source

pub fn touch_a2a_compat_task_lease( &self, session_id: &str, sender_id: &str, now: DateTime<Utc>, lease_duration_ms: u64, ) -> Result<bool, KernelError>

Source

pub fn remove_a2a_compat_task( &self, session_id: &str, ) -> Result<u64, KernelError>

Source

pub fn append_audit_log(&self, entry: &AuditLogEntry) -> Result<(), KernelError>

Source

pub fn list_audit_logs( &self, limit: usize, ) -> Result<Vec<AuditLogRow>, KernelError>

Source

pub fn list_audit_logs_filtered( &self, request_id: Option<&str>, action: Option<&str>, from_ms: Option<i64>, to_ms: Option<i64>, limit: usize, ) -> Result<Vec<AuditLogRow>, KernelError>

Trait Implementations§

Source§

impl Clone for SqliteRuntimeRepository

Source§

fn clone(&self) -> SqliteRuntimeRepository

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl RuntimeRepository for SqliteRuntimeRepository

Source§

fn list_dispatchable_attempts( &self, now: DateTime<Utc>, limit: usize, ) -> Result<Vec<AttemptDispatchRecord>, KernelError>

Return attempts eligible for dispatch at the current time.
Source§

fn upsert_lease( &self, attempt_id: &str, worker_id: &str, lease_expires_at: DateTime<Utc>, ) -> Result<LeaseRecord, KernelError>

Create or replace a lease for an attempt.
Source§

fn heartbeat_lease( &self, lease_id: &str, heartbeat_at: DateTime<Utc>, lease_expires_at: DateTime<Utc>, ) -> Result<(), KernelError>

Refresh heartbeat for an existing lease.
Source§

fn expire_leases_and_requeue( &self, stale_before: DateTime<Utc>, ) -> Result<u64, KernelError>

Expire stale leases and requeue affected attempts.
Source§

fn transition_timed_out_attempts( &self, now: DateTime<Utc>, ) -> Result<u64, KernelError>

Transition attempts that exceeded their configured execution timeout.
Source§

fn latest_seq_for_run(&self, _run_id: &String) -> Result<u64, KernelError>

Returns latest persisted sequence for a run (used by replay wiring).
Source§

fn upsert_bounty(&self, bounty: &BountyRecord) -> Result<(), KernelError>

Create or update a bounty
Source§

fn get_bounty( &self, bounty_id: &str, ) -> Result<Option<BountyRecord>, KernelError>

Get a bounty by ID
Source§

fn list_bounties( &self, status: Option<&str>, limit: usize, ) -> Result<Vec<BountyRecord>, KernelError>

List bounties by status
Source§

fn accept_bounty( &self, bounty_id: &str, accepted_by: &str, ) -> Result<(), KernelError>

Accept a bounty (transition to accepted)
Source§

fn close_bounty(&self, bounty_id: &str) -> Result<(), KernelError>

Close a bounty (transition to closed)
Source§

fn upsert_swarm_decomposition( &self, task: &SwarmTaskRecord, ) -> Result<(), KernelError>

Create or update swarm task decomposition
Source§

fn get_swarm_decomposition( &self, parent_task_id: &str, ) -> Result<Option<SwarmTaskRecord>, KernelError>

Get swarm task decomposition
Source§

fn register_worker(&self, worker: &WorkerRecord) -> Result<(), KernelError>

Register a worker
Source§

fn get_worker( &self, worker_id: &str, ) -> Result<Option<WorkerRecord>, KernelError>

Get a worker by ID
Source§

fn list_workers( &self, domain: Option<&str>, status: Option<&str>, limit: usize, ) -> Result<Vec<WorkerRecord>, KernelError>

List workers by domain and status
Source§

fn heartbeat_worker( &self, worker_id: &str, heartbeat_at_ms: i64, ) -> Result<(), KernelError>

Update worker heartbeat
Source§

fn create_recipe(&self, recipe: &RecipeRecord) -> Result<(), KernelError>

Create a recipe
Source§

fn get_recipe( &self, recipe_id: &str, ) -> Result<Option<RecipeRecord>, KernelError>

Get a recipe by ID
Source§

fn fork_recipe( &self, original_id: &str, new_id: &str, new_author: &str, ) -> Result<Option<RecipeRecord>, KernelError>

Fork a recipe (create a copy with new ID)
Source§

fn list_recipes( &self, author_id: Option<&str>, limit: usize, ) -> Result<Vec<RecipeRecord>, KernelError>

List recipes by author
Source§

fn express_organism(&self, organism: &OrganismRecord) -> Result<(), KernelError>

Express a recipe as an organism
Source§

fn get_organism( &self, organism_id: &str, ) -> Result<Option<OrganismRecord>, KernelError>

Get an organism by ID
Source§

fn update_organism( &self, organism_id: &str, current_step: i32, status: &str, ) -> Result<(), KernelError>

Update organism status (step progression)
Source§

fn create_session(&self, session: &SessionRecord) -> Result<(), KernelError>

Create a collaborative session
Source§

fn get_session( &self, session_id: &str, ) -> Result<Option<SessionRecord>, KernelError>

Get a session by ID
Source§

fn add_session_message( &self, message: &SessionMessageRecord, ) -> Result<(), KernelError>

Add a message to session history
Source§

fn get_session_history( &self, session_id: &str, limit: usize, ) -> Result<Vec<SessionMessageRecord>, KernelError>

Get session message history
Source§

fn open_dispute(&self, dispute: &DisputeRecord) -> Result<(), KernelError>

Open a dispute
Source§

fn get_dispute( &self, dispute_id: &str, ) -> Result<Option<DisputeRecord>, KernelError>

Get a dispute by ID
Source§

fn get_disputes_for_bounty( &self, bounty_id: &str, ) -> Result<Vec<DisputeRecord>, KernelError>

Get disputes for a bounty
Source§

fn resolve_dispute( &self, dispute_id: &str, resolution: &str, resolved_by: &str, ) -> Result<(), KernelError>

Resolve a dispute

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> LangchainIntoOpenAI<U> for T
where U: OpenAIFromLangchain<T>,

Source§

fn into_openai(self) -> U

Source§

impl<T, U> OpenAiIntoLangchain<U> for T
where U: LangchainFromOpenAI<T>,

Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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: 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<T, U> TryLangchainIntoOpenAI<U> for T

Source§

impl<T, U> TryOpenAiIntoLangchain<U> for T

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
Source§

impl<T> ErasedDestructor for T
where T: 'static,