pub struct SkillStore { /* private fields */ }Implementations§
Source§impl SkillStore
impl SkillStore
Sourcepub fn set_scenario_memberships(
&self,
scenario_id: &str,
skill_ids: &[String],
add: bool,
) -> Result<Vec<String>>
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
impl SkillStore
Sourcepub fn project_visit_history(&self) -> Result<Vec<(String, Option<i64>)>>
pub fn project_visit_history(&self) -> Result<Vec<(String, Option<i64>)>>
Lightweight metadata for synchronizing history without rescanning project skills.
Sourcepub fn prune_recent_projects(&self) -> Result<()>
pub fn prune_recent_projects(&self) -> Result<()>
Zero marks an evicted history entry; NULL keeps legacy entries eligible until pruned.
Sourcepub fn touch_project_visited(&self, id: &str) -> Result<()>
pub fn touch_project_visited(&self, id: &str) -> Result<()>
Reopening restores an evicted entry and evicts only the oldest history metadata.
Source§impl SkillStore
impl SkillStore
pub fn new(db_path: &PathBuf) -> Result<Self>
pub fn insert_skill(&self, skill: &SkillRecord) -> Result<()>
pub fn upsert_skill(&self, skill: &SkillRecord) -> Result<()>
pub fn get_all_skills(&self) -> Result<Vec<SkillRecord>>
pub fn get_skill_by_id(&self, id: &str) -> Result<Option<SkillRecord>>
pub fn get_skill_by_central_path( &self, central_path: &str, ) -> Result<Option<SkillRecord>>
pub fn get_skill_by_source_ref( &self, source_type: &str, source_ref: &str, ) -> Result<Option<SkillRecord>>
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<()>
pub fn update_skill_check_state( &self, id: &str, remote_revision: Option<&str>, update_status: &str, last_check_error: Option<&str>, ) -> Result<()>
pub fn update_skill_update_status( &self, id: &str, update_status: &str, ) -> Result<()>
pub fn update_skill_enabled(&self, id: &str, enabled: bool) -> Result<()>
pub fn rename_skill(&self, id: &str, new_name: &str) -> Result<()>
pub fn update_central_path(&self, id: &str, new_path: &str) -> Result<()>
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<()>
pub fn update_skill_source_ref(&self, id: &str, source_ref: &str) -> Result<()>
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<()>
Sourcepub fn park_central_paths_for_reindex(&self) -> Result<()>
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.
pub fn delete_skill(&self, id: &str) -> Result<()>
pub fn insert_target(&self, target: &SkillTargetRecord) -> Result<()>
pub fn get_targets_for_skill( &self, skill_id: &str, ) -> Result<Vec<SkillTargetRecord>>
pub fn get_all_targets(&self) -> Result<Vec<SkillTargetRecord>>
pub fn delete_target(&self, skill_id: &str, tool: &str) -> Result<()>
pub fn clear_discovered(&self) -> Result<()>
pub fn insert_discovered(&self, rec: &DiscoveredSkillRecord) -> Result<()>
pub fn get_all_discovered(&self) -> Result<Vec<DiscoveredSkillRecord>>
pub fn get_cache(&self, key: &str, ttl_secs: i64) -> Result<Option<String>>
pub fn set_cache(&self, key: &str, data: &str) -> Result<()>
pub fn replace_pending_conflicts( &self, rows: &[PendingConflictRow], ) -> Result<()>
pub fn list_pending_conflicts(&self) -> Result<Vec<PendingConflictRow>>
pub fn proxy_url(&self) -> Option<String>
pub fn get_setting(&self, key: &str) -> Result<Option<String>>
pub fn set_setting(&self, key: &str, value: &str) -> Result<()>
pub fn remap_tool_key_references( &self, old_key: &str, new_key: &str, ) -> Result<()>
pub fn has_tool_key_references(&self, key: &str) -> Result<bool>
pub fn insert_scenario(&self, scenario: &ScenarioRecord) -> Result<()>
pub fn get_all_scenarios(&self) -> Result<Vec<ScenarioRecord>>
pub fn update_scenario( &self, id: &str, name: &str, description: Option<&str>, icon: Option<&str>, ) -> Result<()>
pub fn delete_scenario(&self, id: &str) -> Result<()>
pub fn reorder_scenarios(&self, ids: &[String]) -> Result<()>
pub fn reorder_projects(&self, ids: &[String]) -> Result<()>
pub fn add_skill_to_scenario( &self, scenario_id: &str, skill_id: &str, ) -> Result<()>
pub fn remove_skill_from_scenario( &self, scenario_id: &str, skill_id: &str, ) -> Result<()>
pub fn reorder_scenario_skills( &self, scenario_id: &str, skill_ids: &[String], ) -> Result<()>
pub fn get_skill_ids_for_scenario( &self, scenario_id: &str, ) -> Result<Vec<String>>
pub fn get_skills_for_scenario( &self, scenario_id: &str, ) -> Result<Vec<SkillRecord>>
pub fn count_skills_for_scenario(&self, scenario_id: &str) -> Result<i64>
pub fn get_scenarios_for_skill(&self, skill_id: &str) -> Result<Vec<String>>
pub fn ensure_scenario_skill_tool_defaults( &self, scenario_id: &str, skill_id: &str, tools: &[String], ) -> Result<()>
pub fn set_scenario_skill_tool_enabled( &self, scenario_id: &str, skill_id: &str, tool: &str, enabled: bool, ) -> Result<()>
pub fn replace_scenarios_from_metadata( &self, scenarios: &[ScenarioMetaFile], ) -> Result<()>
pub fn replace_scenario_memberships_from_metadata( &self, memberships: &[ScenarioSkillMetaFile], ) -> Result<()>
pub fn get_scenario_skill_tool_toggles( &self, scenario_id: &str, skill_id: &str, ) -> Result<Vec<ScenarioSkillToolToggleRecord>>
pub fn get_enabled_tools_for_scenario_skill( &self, scenario_id: &str, skill_id: &str, ) -> Result<Vec<String>>
pub fn get_active_scenario_id(&self) -> Result<Option<String>>
pub fn clear_active_scenario(&self) -> Result<()>
pub fn set_active_scenario(&self, scenario_id: &str) -> Result<()>
pub fn insert_project(&self, project: &ProjectRecord) -> Result<()>
pub fn get_all_projects(&self) -> Result<Vec<ProjectRecord>>
pub fn get_project_by_id(&self, id: &str) -> Result<Option<ProjectRecord>>
pub fn delete_project(&self, id: &str) -> Result<()>
Sourcepub fn rename_tag(&self, old: &str, new: &str) -> Result<Vec<String>>
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.
Sourcepub fn delete_tag(&self, name: &str) -> Result<Vec<String>>
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.
Sourcepub fn log_audit(&self, draft: AuditDraft)
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.
Sourcepub fn list_audit(&self, limit: Option<i64>) -> Result<Vec<AuditEntry>>
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
impl UnsafeUnpin for SkillStorewhere
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> 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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.