新增: 初始化 DevFlow 项目仓库

Tauri 2 + Vue 3 + Vite 6 桌面应用,Rust workspace 含 13 个 crate
(df-ai / df-storage / df-workflow / df-core / df-execute 等)。
核心能力:AI 聊天 agentic 循环(工具调用+人工审批)、工作流引擎、
任务/想法/项目/阶段管理、可追溯性,及配套前端组件。
This commit is contained in:
2026-06-12 01:31:05 +08:00
commit 98393b4908
178 changed files with 27859 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
[package]
name = "df-stages"
version = "0.1.0"
edition = "2021"
[dependencies]
df-core = { path = "../df-core" }
df-workflow = { path = "../df-workflow" }
serde = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true }
async-trait = { workspace = true }
anyhow = { workspace = true }
tracing = { workspace = true }

View File

@@ -0,0 +1,50 @@
//! 编码阶段 — 代码生成与审查阶段模板
use async_trait::async_trait;
use df_workflow::node::{Node, NodeContext, NodeResult, NodeSchema};
/// 代码生成节点
pub struct CodeGenNode;
#[async_trait]
impl Node for CodeGenNode {
async fn execute(&self, _ctx: NodeContext) -> NodeResult {
// TODO: 调用 AI 生成代码
tracing::info!("代码生成节点执行");
Ok(df_workflow::node::NodeOutput::empty())
}
fn schema(&self) -> NodeSchema {
NodeSchema {
params: serde_json::json!({"type": "object"}),
output: serde_json::json!({"type": "object"}),
}
}
fn node_type(&self) -> &str {
"stage.coding.codegen"
}
}
/// 代码审查节点
pub struct CodeReviewNode;
#[async_trait]
impl Node for CodeReviewNode {
async fn execute(&self, _ctx: NodeContext) -> NodeResult {
// TODO: 调用 AI 审查代码
tracing::info!("代码审查节点执行");
Ok(df_workflow::node::NodeOutput::empty())
}
fn schema(&self) -> NodeSchema {
NodeSchema {
params: serde_json::json!({"type": "object"}),
output: serde_json::json!({"type": "object"}),
}
}
fn node_type(&self) -> &str {
"stage.coding.review"
}
}

View File

@@ -0,0 +1,57 @@
//! 想法阶段 — 想法捕获与评估阶段模板
use async_trait::async_trait;
use df_workflow::node::{Node, NodeContext, NodeResult, NodeSchema};
/// 想法捕获节点
pub struct IdeaCaptureNode;
#[async_trait]
impl Node for IdeaCaptureNode {
async fn execute(&self, _ctx: NodeContext) -> NodeResult {
// TODO: 调用 df-ideas 的捕获功能
tracing::info!("想法捕获节点执行");
Ok(df_workflow::node::NodeOutput::empty())
}
fn schema(&self) -> NodeSchema {
NodeSchema {
params: serde_json::json!({
"type": "object",
"properties": {
"title": { "type": "string" },
"description": { "type": "string" }
},
"required": ["title"]
}),
output: serde_json::json!({"type": "object"}),
}
}
fn node_type(&self) -> &str {
"stage.idea.capture"
}
}
/// 想法评估节点
pub struct IdeaEvalNode;
#[async_trait]
impl Node for IdeaEvalNode {
async fn execute(&self, _ctx: NodeContext) -> NodeResult {
// TODO: 调用 df-ideas 的评估功能
tracing::info!("想法评估节点执行");
Ok(df_workflow::node::NodeOutput::empty())
}
fn schema(&self) -> NodeSchema {
NodeSchema {
params: serde_json::json!({"type": "object"}),
output: serde_json::json!({"type": "object"}),
}
}
fn node_type(&self) -> &str {
"stage.idea.eval"
}
}

View File

@@ -0,0 +1,7 @@
//! df-stages: 阶段插件 — 开发流程各阶段的节点模板注册
pub mod coding;
pub mod idea;
pub mod release;
pub mod requirement;
pub mod testing;

View File

@@ -0,0 +1,73 @@
//! 发布阶段 — 构建、部署与发布阶段模板
use async_trait::async_trait;
use df_workflow::node::{Node, NodeContext, NodeResult, NodeSchema};
/// 构建节点
pub struct BuildNode;
#[async_trait]
impl Node for BuildNode {
async fn execute(&self, _ctx: NodeContext) -> NodeResult {
// TODO: 调用 df-execute 执行构建命令
tracing::info!("构建节点执行");
Ok(df_workflow::node::NodeOutput::empty())
}
fn schema(&self) -> NodeSchema {
NodeSchema {
params: serde_json::json!({"type": "object"}),
output: serde_json::json!({"type": "object"}),
}
}
fn node_type(&self) -> &str {
"stage.release.build"
}
}
/// 部署节点
pub struct DeployNode;
#[async_trait]
impl Node for DeployNode {
async fn execute(&self, _ctx: NodeContext) -> NodeResult {
// TODO: 调用 df-execute 执行部署命令
tracing::info!("部署节点执行");
Ok(df_workflow::node::NodeOutput::empty())
}
fn schema(&self) -> NodeSchema {
NodeSchema {
params: serde_json::json!({"type": "object"}),
output: serde_json::json!({"type": "object"}),
}
}
fn node_type(&self) -> &str {
"stage.release.deploy"
}
}
/// 发布公告节点
pub struct ReleaseNotesNode;
#[async_trait]
impl Node for ReleaseNotesNode {
async fn execute(&self, _ctx: NodeContext) -> NodeResult {
// TODO: 调用 AI 生成发布公告
tracing::info!("发布公告节点执行");
Ok(df_workflow::node::NodeOutput::empty())
}
fn schema(&self) -> NodeSchema {
NodeSchema {
params: serde_json::json!({"type": "object"}),
output: serde_json::json!({"type": "object"}),
}
}
fn node_type(&self) -> &str {
"stage.release.notes"
}
}

View File

@@ -0,0 +1,50 @@
//! 需求阶段 — 需求分析与文档生成阶段模板
use async_trait::async_trait;
use df_workflow::node::{Node, NodeContext, NodeResult, NodeSchema};
/// 需求分析节点
pub struct RequirementAnalysisNode;
#[async_trait]
impl Node for RequirementAnalysisNode {
async fn execute(&self, _ctx: NodeContext) -> NodeResult {
// TODO: 调用 AI 分析需求
tracing::info!("需求分析节点执行");
Ok(df_workflow::node::NodeOutput::empty())
}
fn schema(&self) -> NodeSchema {
NodeSchema {
params: serde_json::json!({"type": "object"}),
output: serde_json::json!({"type": "object"}),
}
}
fn node_type(&self) -> &str {
"stage.requirement.analysis"
}
}
/// 需求文档生成节点
pub struct RequirementDocNode;
#[async_trait]
impl Node for RequirementDocNode {
async fn execute(&self, _ctx: NodeContext) -> NodeResult {
// TODO: 调用 AI 生成需求文档
tracing::info!("需求文档生成节点执行");
Ok(df_workflow::node::NodeOutput::empty())
}
fn schema(&self) -> NodeSchema {
NodeSchema {
params: serde_json::json!({"type": "object"}),
output: serde_json::json!({"type": "object"}),
}
}
fn node_type(&self) -> &str {
"stage.requirement.doc"
}
}

View File

@@ -0,0 +1,50 @@
//! 测试阶段 — 测试生成与执行阶段模板
use async_trait::async_trait;
use df_workflow::node::{Node, NodeContext, NodeResult, NodeSchema};
/// 测试用例生成节点
pub struct TestGenNode;
#[async_trait]
impl Node for TestGenNode {
async fn execute(&self, _ctx: NodeContext) -> NodeResult {
// TODO: 调用 AI 生成测试用例
tracing::info!("测试用例生成节点执行");
Ok(df_workflow::node::NodeOutput::empty())
}
fn schema(&self) -> NodeSchema {
NodeSchema {
params: serde_json::json!({"type": "object"}),
output: serde_json::json!({"type": "object"}),
}
}
fn node_type(&self) -> &str {
"stage.testing.testgen"
}
}
/// 测试执行节点
pub struct TestRunNode;
#[async_trait]
impl Node for TestRunNode {
async fn execute(&self, _ctx: NodeContext) -> NodeResult {
// TODO: 调用 df-execute 执行测试命令
tracing::info!("测试执行节点执行");
Ok(df_workflow::node::NodeOutput::empty())
}
fn schema(&self) -> NodeSchema {
NodeSchema {
params: serde_json::json!({"type": "object"}),
output: serde_json::json!({"type": "object"}),
}
}
fn node_type(&self) -> &str {
"stage.testing.run"
}
}