Skip to main content

SkillStore

Struct SkillStore 

Source
pub struct SkillStore { /* private fields */ }

Implementations§

Source§

impl SkillStore

Source

pub fn set_scenario_memberships( &self, scenario_id: &str, skill_ids: &[String], add: bool, ) -> Result<Vec<String>>

Apply an entire membership batch or leave the database unchanged.

Group membership is exclusive: each skill belongs to at most one group. When add is true the skill is first removed from any other group it currently belongs to (within the same transaction) before the insert. The set of displaced scenario-ids is returned so the caller can update the corresponding metadata files.

Source§

impl SkillStore

Source

pub fn project_visit_history(&self) -> Result<Vec<(String, Option<i64>)>>

Lightweight metadata for synchronizing history without rescanning project skills.

Source

pub fn prune_recent_projects(&self) -> Result<()>

Zero marks an evicted history entry; NULL keeps legacy entries eligible until pruned.

Source

pub fn touch_project_visited(&self, id: &str) -> Result<()>

Reopening restores an evicted entry and evicts only the oldest history metadata.

Source§

impl SkillStore

Source

pub fn new(db_path: &PathBuf) -> Result<Self>

Source

pub fn insert_skill(&self, skill: &SkillRecord) -> Result<()>

Source

pub fn upsert_skill(&self, skill: &SkillRecord) -> Result<()>

Source

pub fn get_all_skills(&self) -> Result<Vec<SkillRecord>>

Source

pub fn get_skill_by_id(&self, id: &str) -> Result<Option<SkillRecord>>

Source

pub fn get_skill_by_central_path( &self, central_path: &str, ) -> Result<Option<SkillRecord>>

Source

pub fn get_skill_by_source_ref( &self, source_type: &str, source_ref: &str, ) -> Result<Option<SkillRecord>>

Source

pub fn update_skill_source_metadata( &self, id: &str, source_ref_resolved: Option<&str>, source_subpath: Option<&str>, source_branch: Option<&str>, source_revision: Option<&str>, ) -> Result<()>

Source

pub fn update_skill_check_state( &self, id: &str, remote_revision: Option<&str>, update_status: &str, last_check_error: Option<&str>, ) -> Result<()>

Source

pub fn update_skill_update_status( &self, id: &str, update_status: &str, ) -> Result<()>

Source

pub fn update_skill_enabled(&self, id: &str, enabled: bool) -> Result<()>

Source

pub fn rename_skill(&self, id: &str, new_name: &str) -> Result<()>

Source

pub fn update_central_path(&self, id: &str, new_path: &str) -> Result<()>

Source

pub fn update_skill_after_install( &self, id: &str, name: &str, description: Option<&str>, source_revision: Option<&str>, remote_revision: Option<&str>, content_hash: Option<&str>, update_status: &str, ) -> Result<()>

Source

pub fn update_skill_source_ref(&self, id: &str, source_ref: &str) -> Result<()>

Source

pub fn update_skill_after_reinstall( &self, id: &str, name: &str, description: Option<&str>, source_type: &str, source_ref: Option<&str>, source_ref_resolved: Option<&str>, source_subpath: Option<&str>, source_branch: Option<&str>, source_revision: Option<&str>, remote_revision: Option<&str>, content_hash: Option<&str>, update_status: &str, ) -> Result<()>

Source

pub fn park_central_paths_for_reindex(&self) -> Result<()>

Park every skill’s central_path on a unique placeholder before a reindex rewrites them. Path reassignments between existing skills (renames, collision reshuffles after a merge) would otherwise collide with the UNIQUE constraint mid-loop — e.g. skill A moving onto the path skill B is about to vacate.

Source

pub fn delete_skill(&self, id: &str) -> Result<()>

Source

pub fn insert_target(&self, target: &SkillTargetRecord) -> Result<()>

Source

pub fn get_targets_for_skill( &self, skill_id: &str, ) -> Result<Vec<SkillTargetRecord>>

Source

pub fn get_all_targets(&self) -> Result<Vec<SkillTargetRecord>>

Source

pub fn delete_target(&self, skill_id: &str, tool: &str) -> Result<()>

Source

pub fn clear_discovered(&self) -> Result<()>

Source

pub fn insert_discovered(&self, rec: &DiscoveredSkillRecord) -> Result<()>

Source

pub fn get_all_discovered(&self) -> Result<Vec<DiscoveredSkillRecord>>

Source

pub fn get_cache(&self, key: &str, ttl_secs: i64) -> Result<Option<String>>

Source

pub fn set_cache(&self, key: &str, data: &str) -> Result<()>

Source

pub fn replace_pending_conflicts( &self, rows: &[PendingConflictRow], ) -> Result<()>

Source

pub fn list_pending_conflicts(&self) -> Result<Vec<PendingConflictRow>>

Source

pub fn proxy_url(&self) -> Option<String>

Source

pub fn get_setting(&self, key: &str) -> Result<Option<String>>

Source

pub fn set_setting(&self, key: &str, value: &str) -> Result<()>

Source

pub fn remap_tool_key_references( &self, old_key: &str, new_key: &str, ) -> Result<()>

Source

pub fn has_tool_key_references(&self, key: &str) -> Result<bool>

Source

pub fn insert_scenario(&self, scenario: &ScenarioRecord) -> Result<()>

Source

pub fn get_all_scenarios(&self) -> Result<Vec<ScenarioRecord>>

Source

pub fn update_scenario( &self, id: &str, name: &str, description: Option<&str>, icon: Option<&str>, ) -> Result<()>

Source

pub fn delete_scenario(&self, id: &str) -> Result<()>

Source

pub fn reorder_scenarios(&self, ids: &[String]) -> Result<()>

Source

pub fn reorder_projects(&self, ids: &[String]) -> Result<()>

Source

pub fn add_skill_to_scenario( &self, scenario_id: &str, skill_id: &str, ) -> Result<()>

Source

pub fn remove_skill_from_scenario( &self, scenario_id: &str, skill_id: &str, ) -> Result<()>

Source

pub fn reorder_scenario_skills( &self, scenario_id: &str, skill_ids: &[String], ) -> Result<()>

Source

pub fn get_skill_ids_for_scenario( &self, scenario_id: &str, ) -> Result<Vec<String>>

Source

pub fn get_skills_for_scenario( &self, scenario_id: &str, ) -> Result<Vec<SkillRecord>>

Source

pub fn count_skills_for_scenario(&self, scenario_id: &str) -> Result<i64>

Source

pub fn get_scenarios_for_skill(&self, skill_id: &str) -> Result<Vec<String>>

Source

pub fn ensure_scenario_skill_tool_defaults( &self, scenario_id: &str, skill_id: &str, tools: &[String], ) -> Result<()>

Source

pub fn set_scenario_skill_tool_enabled( &self, scenario_id: &str, skill_id: &str, tool: &str, enabled: bool, ) -> Result<()>

Source

pub fn replace_scenarios_from_metadata( &self, scenarios: &[ScenarioMetaFile], ) -> Result<()>

Source

pub fn replace_scenario_memberships_from_metadata( &self, memberships: &[ScenarioSkillMetaFile], ) -> Result<()>

Source

pub fn get_scenario_skill_tool_toggles( &self, scenario_id: &str, skill_id: &str, ) -> Result<Vec<ScenarioSkillToolToggleRecord>>

Source

pub fn get_enabled_tools_for_scenario_skill( &self, scenario_id: &str, skill_id: &str, ) -> Result<Vec<String>>

Source

pub fn get_active_scenario_id(&self) -> Result<Option<String>>

Source

pub fn clear_active_scenario(&self) -> Result<()>

Source

pub fn set_active_scenario(&self, scenario_id: &str) -> Result<()>

Source

pub fn insert_project(&self, project: &ProjectRecord) -> Result<()>

Source

pub fn get_all_projects(&self) -> Result<Vec<ProjectRecord>>

Source

pub fn get_project_by_id(&self, id: &str) -> Result<Option<ProjectRecord>>

Source

pub fn delete_project(&self, id: &str) -> Result<()>

Source

pub fn get_all_tags(&self) -> Result<Vec<String>>

Source

pub fn set_tags_for_skill(&self, skill_id: &str, tags: &[String]) -> Result<()>

Source

pub fn get_tags_map(&self) -> Result<HashMap<String, Vec<String>>>

Source

pub fn rename_tag(&self, old: &str, new: &str) -> Result<Vec<String>>

Globally rename a tag across every skill that carries it. Returns the ids of the affected skills so the caller can refresh their metadata. If a skill already has new, the rows are merged (no duplicate) thanks to UPDATE OR IGNORE followed by removing any leftover old rows.

Source

pub fn delete_tag(&self, name: &str) -> Result<Vec<String>>

Globally remove a tag from every skill that carries it. Returns the ids of the affected skills so the caller can refresh their metadata.

Source

pub fn log_audit(&self, draft: AuditDraft)

Append an audit entry. Best-effort: errors are swallowed so callers never have to wrap or propagate them. Auto-prunes when the table grows beyond AUDIT_MAX_ENTRIES.

Source

pub fn list_audit(&self, limit: Option<i64>) -> Result<Vec<AuditEntry>>

Read the most recent audit entries (newest first). When limit is None, returns everything.

Auto Trait Implementations§

§

impl !Freeze for SkillStore

§

impl Forget for SkillStore

§

impl Move for SkillStore

§

impl RefUnwindSafe for SkillStore

§

impl Send for SkillStore

§

impl Sync for SkillStore

§

impl Unpin for SkillStore
where Align4<u32>: Unpin, Align1<u8>: Unpin, *mut sqlite3: Unpin, Arc<Mutex<*mut sqlite3>>: Unpin, Box<dyn FnMut() -> bool + Send>: Unpin, Box<dyn for<'c> FnMut(AuthContext<'c>) -> Authorization + Send>: Unpin, *const u8 is !null: Unpin, *const Node<Arc<str>, RawStatement> is !null: Unpin,

§

impl UnsafeUnpin for SkillStore
where Align4<u32>: UnsafeUnpin, Align1<u8>: UnsafeUnpin, *mut sqlite3: UnsafeUnpin, *const ArcInner<Mutex<*mut sqlite3>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<*mut sqlite3>>>: UnsafeUnpin, *const dyn FnMut() -> bool + Send is !null: UnsafeUnpin, PhantomData<dyn FnMut() -> bool + Send>: UnsafeUnpin, *const dyn for<'c> FnMut(AuthContext<'c>) -> Authorization + Send is !null: UnsafeUnpin, PhantomData<dyn for<'c> FnMut(AuthContext<'c>) -> Authorization + Send>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<NonNull<Node<Arc<str>, RawStatement>>>: UnsafeUnpin, PhantomData<fn() -> AHasher>: UnsafeUnpin, *const Node<Arc<str>, RawStatement> is !null: UnsafeUnpin,

§

impl UnwindSafe for SkillStore

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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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