godchat_core/ports/
driven.rs1use crate::types::*;
2
3pub trait ProjectRepo: Send + Sync {
4 fn list(&self) -> Vec<Project>;
5 fn get(&self, id: &ProjectId) -> Option<Project>;
6 fn upsert(&self, project: &Project);
7}
8
9pub trait TaskRepo: Send + Sync {
10 fn create(&self, task: &Task<Conceptualizing>) -> TaskId;
11 fn get(&self, id: &TaskId) -> Option<TaskSummary>;
12 fn list_by_project(&self, project_id: &ProjectId) -> Vec<TaskSummary>;
13 fn save(&self, task: &TaskSummary);
14 fn children(&self, parent_id: &TaskId) -> Vec<TaskSummary>;
15}
16
17pub trait InsightStore: Send + Sync {
18 fn add(&self, content: &str, links: &[InsightLink]) -> Insight;
19 fn search(&self, query: &str) -> Vec<Insight>;
20 fn related(&self, target: &InsightLink) -> Vec<Insight>;
21}
22
23pub trait Spawner: Send + Sync {
24 fn spawn_command(&self, task: &TaskSummary, brief: &ContextBrief) -> String;
25}