Files
zclaw_openfang/crates/zclaw-pipeline/src/lib.rs
iven 0d4fa96b82
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
refactor: 统一项目名称从OpenFang到ZCLAW
重构所有代码和文档中的项目名称,将OpenFang统一更新为ZCLAW。包括:
- 配置文件中的项目名称
- 代码注释和文档引用
- 环境变量和路径
- 类型定义和接口名称
- 测试用例和模拟数据

同时优化部分代码结构,移除未使用的模块,并更新相关依赖项。
2026-03-27 07:36:03 +08:00

91 lines
2.4 KiB
Rust

//! ZCLAW Pipeline Engine
//!
//! Declarative pipeline system for multi-step automation workflows.
//! Pipelines orchestrate Skills and Hands to accomplish complex tasks.
//!
//! # Architecture
//!
//! ```text
//! User Input → Intent Router → Pipeline v2 → Executor → Presentation
//! ↓ ↓
//! Trigger Matching ExecutionContext
//! ```
//!
//! # Example
//!
//! ```yaml
//! apiVersion: zclaw/v2
//! kind: Pipeline
//! metadata:
//! name: course-generator
//! displayName: 课程生成器
//! category: education
//! trigger:
//! keywords: [课程, 教程, 学习]
//! patterns:
//! - "帮我做*课程"
//! - "生成{level}级别的{topic}教程"
//! params:
//! - name: topic
//! type: string
//! required: true
//! label: 课程主题
//! stages:
//! - id: outline
//! type: llm
//! prompt: "为{params.topic}创建课程大纲"
//! - id: content
//! type: parallel
//! each: "${stages.outline.sections}"
//! stage:
//! type: llm
//! prompt: "为章节${item.title}生成内容"
//! output:
//! type: dynamic
//! supported_types: [slideshow, quiz, document]
//! ```
pub mod types;
pub mod types_v2;
pub mod parser;
pub mod parser_v2;
pub mod state;
pub mod executor;
pub mod actions;
pub mod trigger;
pub mod intent;
pub mod engine;
pub mod presentation;
// Glob re-exports with explicit disambiguation for conflicting names
pub use types::*;
pub use types_v2::*;
pub use parser::*;
pub use parser_v2::*;
pub use state::*;
pub use executor::*;
pub use trigger::*;
pub use intent::*;
pub use engine::*;
pub use presentation::*;
// Explicit re-exports: presentation::* wins for PresentationType/ExportFormat
// types_v2::* wins for InputMode, engine::* wins for LoopContext
pub use presentation::PresentationType;
pub use presentation::ExportFormat;
pub use types_v2::InputMode;
pub use engine::context::LoopContext;
pub use actions::ActionRegistry;
pub use actions::{LlmActionDriver, SkillActionDriver, HandActionDriver, OrchestrationActionDriver};
/// Convenience function to parse pipeline YAML (v1)
pub fn parse_pipeline_yaml(yaml: &str) -> Result<Pipeline, parser::ParseError> {
parser::PipelineParser::parse(yaml)
}
/// Convenience function to parse pipeline v2 YAML
pub fn parse_pipeline_v2_yaml(yaml: &str) -> Result<PipelineV2, parser_v2::ParseErrorV2> {
parser_v2::PipelineParserV2::parse(yaml)
}