use async_trait::async_trait;
#[derive(Debug, Clone)]
pub enum CommandResponse {
Text(String),
Markdown(String),
Ok,
NotWired { reason: &'static str },
Error(String),
EffectExit,
EffectClearView,
EffectThemeDark,
EffectThemeLight,
EffectStartInjectInline,
EffectStartNewSession,
}
#[async_trait]
pub trait CommandBackend: Send + Sync {
async fn dispatch_quick(&self, prompt: &str) -> CommandResponse;
async fn dispatch_escalate(&self, prompt: &str) -> CommandResponse;
async fn dispatch_classify(&self, prompt: &str) -> CommandResponse;
async fn dispatch_explain(&self) -> CommandResponse;
async fn dispatch_show_plan(&self) -> CommandResponse;
async fn dispatch_show_proof(&self) -> CommandResponse;
async fn dispatch_show_goals(&self) -> CommandResponse;
async fn dispatch_goal_show(&self, goal_id: &str) -> CommandResponse;
async fn dispatch_inject(&self, text: &str) -> CommandResponse;
async fn dispatch_pause(&self) -> CommandResponse;
async fn dispatch_resume(&self) -> CommandResponse;
async fn dispatch_cancel(&self) -> CommandResponse;
async fn dispatch_approve(&self) -> CommandResponse;
async fn dispatch_reject(&self, reason: Option<&str>) -> CommandResponse;
async fn dispatch_diff(&self) -> CommandResponse;
async fn dispatch_cost(&self) -> CommandResponse;
async fn dispatch_new_session(&self) -> CommandResponse;
async fn dispatch_list_sessions(&self) -> CommandResponse;
async fn dispatch_resume_session(&self, session_id: &str) -> CommandResponse;
}
#[derive(Debug)]
pub struct StubBackend;
#[async_trait]
impl CommandBackend for StubBackend {
async fn dispatch_quick(&self, _prompt: &str) -> CommandResponse {
CommandResponse::NotWired {
reason: "requires W3 router; not yet merged",
}
}
async fn dispatch_escalate(&self, _prompt: &str) -> CommandResponse {
CommandResponse::NotWired {
reason: "requires W3 router; not yet merged",
}
}
async fn dispatch_classify(&self, _prompt: &str) -> CommandResponse {
CommandResponse::NotWired {
reason: "requires W2 classifier integration; pending coordination",
}
}
async fn dispatch_explain(&self) -> CommandResponse {
CommandResponse::NotWired {
reason: "requires W2 classifier integration; pending coordination",
}
}
async fn dispatch_show_plan(&self) -> CommandResponse {
CommandResponse::NotWired {
reason: "requires W6 chat_api integration; pending coordination",
}
}
async fn dispatch_show_proof(&self) -> CommandResponse {
CommandResponse::NotWired {
reason: "requires W6 chat_api integration; pending coordination",
}
}
async fn dispatch_show_goals(&self) -> CommandResponse {
CommandResponse::NotWired {
reason: "requires W6 chat_api integration; pending coordination",
}
}
async fn dispatch_goal_show(&self, _goal_id: &str) -> CommandResponse {
CommandResponse::NotWired {
reason: "requires W6 chat_api integration; pending coordination",
}
}
async fn dispatch_inject(&self, _text: &str) -> CommandResponse {
CommandResponse::NotWired {
reason: "requires W6 chat_api integration; pending coordination",
}
}
async fn dispatch_pause(&self) -> CommandResponse {
CommandResponse::NotWired {
reason: "requires W6 chat_api integration; pending coordination",
}
}
async fn dispatch_resume(&self) -> CommandResponse {
CommandResponse::NotWired {
reason: "requires W6 chat_api integration; pending coordination",
}
}
async fn dispatch_cancel(&self) -> CommandResponse {
CommandResponse::NotWired {
reason: "requires W6 chat_api integration; pending coordination",
}
}
async fn dispatch_approve(&self) -> CommandResponse {
CommandResponse::NotWired {
reason: "requires W6 chat_api integration; pending coordination",
}
}
async fn dispatch_reject(&self, _reason: Option<&str>) -> CommandResponse {
CommandResponse::NotWired {
reason: "requires W6 chat_api integration; pending coordination",
}
}
async fn dispatch_diff(&self) -> CommandResponse {
CommandResponse::NotWired {
reason: "requires git diff helper; pending orchestrator wiring",
}
}
async fn dispatch_cost(&self) -> CommandResponse {
CommandResponse::NotWired {
reason: "requires W3 cost tracker; pending coordination",
}
}
async fn dispatch_new_session(&self) -> CommandResponse {
CommandResponse::NotWired {
reason: "requires W1 session manager; pending coordination",
}
}
async fn dispatch_list_sessions(&self) -> CommandResponse {
CommandResponse::NotWired {
reason: "requires W1 session manager; pending coordination",
}
}
async fn dispatch_resume_session(&self, _session_id: &str) -> CommandResponse {
CommandResponse::NotWired {
reason: "requires W1 session manager; pending coordination",
}
}
}