fix: fix some displays and features

This commit is contained in:
2026-06-06 17:06:45 +02:00
parent 2332b7f815
commit 3be55795a6
31 changed files with 3118 additions and 30 deletions

View File

@ -34,6 +34,7 @@ use crate::markdown::MarkdownDoc;
use crate::profile::AgentProfile;
use crate::project::{Project, ProjectPath};
use crate::remote::RemoteKind;
use crate::skill::{Skill, SkillScope};
use crate::template::AgentTemplate;
use crate::terminal::PtySize;
@ -209,7 +210,7 @@ pub enum FsError {
}
/// Errors from persistence stores ([`TemplateStore`], [`ProjectStore`],
/// [`AgentContextStore`]).
/// [`AgentContextStore`], [`SkillStore`]).
#[derive(Debug, Clone, PartialEq, Eq, Error)]
pub enum StoreError {
/// The requested item was not found.
@ -460,6 +461,57 @@ pub trait TemplateStore: Send + Sync {
async fn delete(&self, id: crate::ids::TemplateId) -> Result<(), StoreError>;
}
/// CRUD for [`Skill`]s across both scopes ([`SkillScope::Global`] in the IDE
/// store, [`SkillScope::Project`] under `.ideai/skills/`), per ARCHITECTURE
/// §14.2 and L12.
///
/// The two scopes are **isolated**: a skill saved as `Project` never surfaces in
/// a `Global` listing and vice-versa. Each call carries the [`SkillScope`]
/// explicitly (or via the [`Skill`] for [`save`](Self::save)) so the adapter
/// resolves the right backing location.
///
/// `root` identifies the project whose `.ideai/skills/` to use for
/// [`SkillScope::Project`]; it is **ignored** for [`SkillScope::Global`] (which
/// lives in the machine-global IDE store). Passing the root per call — rather
/// than baking it into the adapter — keeps a single store instance correct
/// across every open project (mirroring [`AgentContextStore`]).
#[async_trait]
pub trait SkillStore: Send + Sync {
/// Lists all skills in `scope` (for `root`'s project when project-scoped).
///
/// # Errors
/// [`StoreError`] on failure.
async fn list(&self, scope: SkillScope, root: &ProjectPath) -> Result<Vec<Skill>, StoreError>;
/// Gets a skill by id within `scope`.
///
/// # Errors
/// [`StoreError::NotFound`] if absent in that scope.
async fn get(
&self,
scope: SkillScope,
root: &ProjectPath,
id: crate::ids::SkillId,
) -> Result<Skill, StoreError>;
/// Saves (creates or replaces by id) a skill in its own [`Skill::scope`].
///
/// # Errors
/// [`StoreError`] on failure.
async fn save(&self, skill: &Skill, root: &ProjectPath) -> Result<(), StoreError>;
/// Deletes a skill by id within `scope`.
///
/// # Errors
/// [`StoreError::NotFound`] if absent in that scope.
async fn delete(
&self,
scope: SkillScope,
root: &ProjectPath,
id: crate::ids::SkillId,
) -> Result<(), StoreError>;
}
/// Persistence of the known-projects registry and the workspace.
#[async_trait]
pub trait ProjectStore: Send + Sync {