Skip to main content

matrixcode_core/command/handlers/
workflow.rs

1//! /workflow 命令处理器
2
3use std::future::Future;
4use std::pin::Pin;
5
6use crate::command::{BackendContext, Command};
7
8pub struct Workflow;
9
10impl Command for Workflow {
11    fn name(&self) -> &'static str {
12        "workflow"
13    }
14
15    fn help(&self) -> Option<&'static str> {
16        Some("列出可用工作流")
17    }
18
19    fn execute<'a>(
20        &'a self,
21        ctx: &'a mut BackendContext<'_>,
22    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'a>> {
23        Box::pin(async move {
24            // TODO: 实现工作流发现
25            let info = "🔄 可用工作流:\n\n暂无已注册的工作流。\n\n提示:使用 /workflow run <name> 运行工作流".to_string();
26            let _ = ctx
27                .event_tx
28                .send(crate::AgentEvent::progress(info, None))
29                .await;
30            false
31        })
32    }
33}