fix: fix some displays and features
This commit is contained in:
@ -13,18 +13,19 @@ use application::{
|
||||
CreateAgentFromTemplate, CreateLayout, CreateProject, CreateTemplate, DeleteAgent,
|
||||
DeleteLayout, DeleteProfile, DeleteTemplate, DetectAgentDrift, DetectProfiles, FirstRunState,
|
||||
GitBranches, GitCheckout, GitCommit, GitGraph, GitInit, GitLog, GitStage, GitStatus, GitUnstage,
|
||||
HealthUseCase, LaunchAgent, ListAgents, ListLayouts, ListProfiles, ListProjects, ListTemplates,
|
||||
LoadLayout, MoveTabToNewWindow, MutateLayout, OpenProject, OpenTerminal, ReadAgentContext,
|
||||
ReferenceProfiles, RenameLayout, ResizeTerminal, SaveProfile, SetActiveLayout,
|
||||
HealthUseCase, LaunchAgent, ListAgents, ListLayouts, ListProfiles, ListProjects, ListSkills,
|
||||
ListTemplates, LoadLayout, MoveTabToNewWindow, MutateLayout, OpenProject, OpenTerminal,
|
||||
ReadAgentContext, ReferenceProfiles, RenameLayout, ResizeTerminal, SaveProfile, SetActiveLayout,
|
||||
AssignSkillToAgent, CreateSkill, DeleteSkill, UnassignSkillFromAgent, UpdateSkill,
|
||||
SyncAgentWithTemplate, TerminalSessions, UpdateAgentContext, UpdateTemplate, WriteToTerminal,
|
||||
};
|
||||
use domain::ports::{
|
||||
AgentContextStore, AgentRuntime, Clock, EventBus, FileSystem, GitPort, IdGenerator,
|
||||
ProcessSpawner, ProfileStore, ProjectStore, PtyPort, TemplateStore,
|
||||
ProcessSpawner, ProfileStore, ProjectStore, PtyPort, SkillStore, TemplateStore,
|
||||
};
|
||||
|
||||
use infrastructure::{
|
||||
CliAgentRuntime, FsProfileStore, FsProjectStore, FsTemplateStore, Git2Repository,
|
||||
CliAgentRuntime, FsProfileStore, FsProjectStore, FsSkillStore, FsTemplateStore, Git2Repository,
|
||||
IdeaiContextStore, LocalFileSystem, LocalProcessSpawner, PortablePtyAdapter, SystemClock,
|
||||
TokioBroadcastEventBus, UuidGenerator,
|
||||
};
|
||||
@ -147,6 +148,19 @@ pub struct AppState {
|
||||
pub git_init: Arc<GitInit>,
|
||||
/// Return the commit graph for all local branches.
|
||||
pub git_graph: Arc<GitGraph>,
|
||||
// --- Skills (L12) ---
|
||||
/// Create a skill in a scope's store.
|
||||
pub create_skill: Arc<CreateSkill>,
|
||||
/// Update a skill's content.
|
||||
pub update_skill: Arc<UpdateSkill>,
|
||||
/// List skills in a scope.
|
||||
pub list_skills: Arc<ListSkills>,
|
||||
/// Delete a skill from its scope's store.
|
||||
pub delete_skill: Arc<DeleteSkill>,
|
||||
/// Assign a skill to an agent (records a `SkillRef`).
|
||||
pub assign_skill: Arc<AssignSkillToAgent>,
|
||||
/// Unassign a skill from an agent.
|
||||
pub unassign_skill: Arc<UnassignSkillFromAgent>,
|
||||
}
|
||||
|
||||
impl AppState {
|
||||
@ -287,6 +301,17 @@ impl AppState {
|
||||
let contexts = Arc::new(IdeaiContextStore::new(Arc::clone(&fs_port)));
|
||||
let contexts_port = Arc::clone(&contexts) as Arc<dyn AgentContextStore>;
|
||||
|
||||
// --- Skill store (L12) ---
|
||||
// Global skills live in the machine-local app-data dir; project skills are
|
||||
// resolved per call from each project's `.ideai/` (so one store serves all
|
||||
// open projects). Shared by the skill use cases and the agent launcher
|
||||
// (assigned-skill injection into the convention file, §14.2).
|
||||
let skill_store = Arc::new(FsSkillStore::new(
|
||||
Arc::clone(&fs_port),
|
||||
app_data_dir.to_string_lossy().into_owned(),
|
||||
));
|
||||
let skill_store_port = Arc::clone(&skill_store) as Arc<dyn SkillStore>;
|
||||
|
||||
let create_agent = Arc::new(CreateAgentFromScratch::new(
|
||||
Arc::clone(&contexts_port),
|
||||
Arc::clone(&ids) as Arc<dyn IdGenerator>,
|
||||
@ -307,6 +332,7 @@ impl AppState {
|
||||
Arc::clone(&runtime_port),
|
||||
Arc::clone(&fs_port),
|
||||
Arc::clone(&pty_port),
|
||||
Arc::clone(&skill_store_port),
|
||||
Arc::clone(&terminal_sessions),
|
||||
Arc::clone(&events_port),
|
||||
));
|
||||
@ -364,6 +390,25 @@ impl AppState {
|
||||
let git_init = Arc::new(GitInit::new(Arc::clone(&git_port), Arc::clone(&events_port)));
|
||||
let git_graph = Arc::new(GitGraph::new(Arc::clone(&git_port)));
|
||||
|
||||
// --- Skill use cases (L12) ---
|
||||
// Reuse the skill store (built above for the launcher) and the shared
|
||||
// agent context store for the agent↔skill assignment.
|
||||
let create_skill = Arc::new(CreateSkill::new(
|
||||
Arc::clone(&skill_store_port),
|
||||
Arc::clone(&ids) as Arc<dyn IdGenerator>,
|
||||
));
|
||||
let update_skill = Arc::new(UpdateSkill::new(Arc::clone(&skill_store_port)));
|
||||
let list_skills = Arc::new(ListSkills::new(Arc::clone(&skill_store_port)));
|
||||
let delete_skill = Arc::new(DeleteSkill::new(Arc::clone(&skill_store_port)));
|
||||
let assign_skill = Arc::new(AssignSkillToAgent::new(
|
||||
Arc::clone(&contexts_port),
|
||||
Arc::clone(&events_port),
|
||||
));
|
||||
let unassign_skill = Arc::new(UnassignSkillFromAgent::new(
|
||||
Arc::clone(&contexts_port),
|
||||
Arc::clone(&events_port),
|
||||
));
|
||||
|
||||
// --- Windows (L10) ---
|
||||
let move_tab = Arc::new(MoveTabToNewWindow::new(
|
||||
Arc::clone(&store_port),
|
||||
@ -422,6 +467,12 @@ impl AppState {
|
||||
git_log,
|
||||
git_init,
|
||||
git_graph,
|
||||
create_skill,
|
||||
update_skill,
|
||||
list_skills,
|
||||
delete_skill,
|
||||
assign_skill,
|
||||
unassign_skill,
|
||||
move_tab,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user