feat(pipeline): implement Pipeline DSL system for automated workflows
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

Add complete Pipeline DSL system including:
- Rust backend (zclaw-pipeline crate) with parser, executor, and state management
- Frontend components: PipelinesPanel, PipelineResultPreview, ClassroomPreviewer
- Pipeline recommender for Agent conversation integration
- 5 pipeline templates: education, marketing, legal, research, productivity
- Documentation for Pipeline DSL architecture

Pipeline DSL enables declarative workflow definitions with:
- YAML-based configuration
- Expression resolution (${inputs.topic}, ${steps.step1.output})
- LLM integration, parallel execution, file export
- Agent smart recommendations in conversations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
iven
2026-03-25 00:52:12 +08:00
parent 0179f947aa
commit 9c781f5f2a
30 changed files with 6944 additions and 24 deletions

View File

@@ -0,0 +1,336 @@
# ZCLAW Pipeline - Literature Review
# 文献综述:输入研究主题,自动检索文献并生成综述报告
apiVersion: zclaw/v1
kind: Pipeline
metadata:
name: literature-review
displayName: 文献综述生成器
category: research
description: 输入研究主题,自动检索相关文献、分析关键观点、生成结构化综述报告
tags:
- 研究
- 文献
- 学术
- 综述
icon: 📚
author: ZCLAW
version: 1.0.0
spec:
# 输入参数定义
inputs:
- name: research_topic
type: string
required: true
label: 研究主题
placeholder: 例如:人工智能在医疗诊断中的应用
validation:
min_length: 5
max_length: 200
- name: research_field
type: select
required: false
label: 研究领域
default: 计算机科学
options:
- 计算机科学
- 医学
- 生物学
- 物理学
- 化学
- 经济学
- 心理学
- 社会学
- 教育学
- 其他
- name: review_depth
type: select
required: false
label: 综述深度
default: 标准
options:
- 快速概览
- 标准
- 深度分析
- name: time_range
type: select
required: false
label: 文献时间范围
default: 近5年
options:
- 近1年
- 近3年
- 近5年
- 近10年
- 全部
- name: language_preference
type: select
required: false
label: 语言偏好
default: 中英混合
options:
- 仅中文
- 仅英文
- 中英混合
- name: export_formats
type: multi-select
required: false
label: 导出格式
default: [html, markdown]
options:
- html
- markdown
- pdf
# 执行步骤
steps:
# Step 1: 解析研究主题
- id: parse_topic
description: 解析研究主题,提取关键词
action:
type: llm_generate
template: |
作为学术研究专家,请分析以下研究主题,提取关键概念和搜索词。
研究主题: {{research_topic}}
研究领域: {{research_field}}
请提取以下信息:
1. 核心概念3-5个
2. 相关关键词10-15个
3. 同义词和变体
4. 相关研究领域
5. 建议的搜索策略
以 JSON 格式输出:
{
"core_concepts": ["概念1", "概念2"],
"keywords": ["关键词1", "关键词2"],
"synonyms": {
"概念1": ["同义词1", "同义词2"]
},
"related_fields": ["领域1", "领域2"],
"search_strategy": "搜索策略说明"
}
input:
research_topic: ${inputs.research_topic}
research_field: ${inputs.research_field}
json_mode: true
temperature: 0.3
max_tokens: 2000
# Step 2: 生成文献搜索查询
- id: generate_queries
description: 生成学术搜索查询
action:
type: llm_generate
template: |
基于以下关键词,生成用于学术数据库搜索的查询语句。
核心概念: ${steps.parse_topic.output.core_concepts}
关键词: ${steps.parse_topic.output.keywords}
时间范围: {{time_range}}
语言偏好: {{language_preference}}
请生成适合以下数据库的搜索查询:
1. Google Scholar
2. PubMed (如果是医学/生物相关)
3. IEEE Xplore (如果是工程/计算机相关)
4. CNKI (中国知网)
以 JSON 格式输出:
{
"queries": [
{
"database": "数据库名称",
"query": "搜索查询语句",
"expected_results": "预期结果描述"
}
],
"inclusion_criteria": ["纳入标准1", "纳入标准2"],
"exclusion_criteria": ["排除标准1", "排除标准2"]
}
input:
parsed_topic: ${steps.parse_topic.output}
time_range: ${inputs.time_range}
language_preference: ${inputs.language_preference}
json_mode: true
temperature: 0.4
max_tokens: 1500
# Step 3: 分析研究趋势
- id: analyze_trends
description: 分析研究趋势和发展脉络
action:
type: llm_generate
template: |
基于以下研究主题,分析该领域的研究趋势。
研究主题: {{research_topic}}
核心概念: ${steps.parse_topic.output.core_concepts}
综述深度: {{review_depth}}
请分析以下方面:
1. 研究历史脉络
2. 主要研究方向
3. 关键突破和里程碑
4. 当前研究热点
5. 未来发展趋势
6. 主要挑战和争议
以 JSON 格式输出:
{
"historical_development": {
"early_stage": "早期发展阶段描述",
"middle_stage": "中期发展阶段描述",
"current_stage": "当前阶段描述"
},
"main_research_directions": [
{
"direction": "研究方向名称",
"description": "方向描述",
"key_contributors": ["主要贡献者"]
}
],
"key_milestones": [
{
"year": "年份",
"event": "里程碑事件",
"significance": "意义"
}
],
"current_hotspots": ["热点1", "热点2"],
"future_trends": ["趋势1", "趋势2"],
"challenges": ["挑战1", "挑战2"]
}
input:
research_topic: ${inputs.research_topic}
parsed_topic: ${steps.parse_topic.output}
review_depth: ${inputs.review_depth}
json_mode: true
temperature: 0.5
max_tokens: 3000
# Step 4: 生成关键观点分析
- id: analyze_key_points
description: 分析领域关键观点和理论
action:
type: llm_generate
template: |
基于以下信息,分析该研究领域的核心观点和理论框架。
研究主题: {{research_topic}}
研究趋势: ${steps.analyze_trends.output}
综述深度: {{review_depth}}
请分析以下内容:
1. 主要理论框架
2. 核心观点和假说
3. 研究方法论
4. 主要争议和不同学派
5. 共识和结论
以 JSON 格式输出:
{
"theoretical_frameworks": [
{
"name": "理论名称",
"proponents": ["提出者"],
"core_concepts": ["核心概念"],
"applications": ["应用领域"]
}
],
"core_viewpoints": [
{
"viewpoint": "观点描述",
"evidence": ["支持证据"],
"counter_evidence": ["反对证据"]
}
],
"methodologies": [
{
"method": "方法名称",
"description": "方法描述",
"advantages": ["优点"],
"limitations": ["局限"]
}
],
"debates": [
{
"topic": "争议话题",
"positions": ["立场1", "立场2"],
"current_status": "当前状态"
}
],
"consensus": ["共识1", "共识2"]
}
input:
research_topic: ${inputs.research_topic}
trends: ${steps.analyze_trends.output}
review_depth: ${inputs.review_depth}
json_mode: true
temperature: 0.6
max_tokens: 4000
# Step 5: 生成综述报告
- id: generate_review
description: 生成完整文献综述报告
action:
type: llm_generate
template: |
基于以上分析,生成一份完整的文献综述报告。
报告应包含以下结构:
1. 摘要
2. 引言(研究背景、目的、意义)
3. 研究方法(文献检索策略、筛选标准)
4. 研究现状分析
5. 主要研究发现
6. 讨论与展望
7. 结论
8. 参考文献建议
分析数据:
- 主题解析: ${steps.parse_topic.output}
- 搜索策略: ${steps.generate_queries.output}
- 研究趋势: ${steps.analyze_trends.output}
- 关键观点: ${steps.analyze_key_points.output}
请生成结构化的综述内容。
input:
topic_analysis: ${steps.parse_topic.output}
search_queries: ${steps.generate_queries.output}
trends: ${steps.analyze_trends.output}
key_points: ${steps.analyze_key_points.output}
json_mode: true
temperature: 0.7
max_tokens: 5000
# Step 6: 导出报告
- id: export_review
description: 导出综述报告
action:
type: file_export
formats: ${inputs.export_formats}
input: ${steps.generate_review.output}
# 输出映射
outputs:
review_title: ${steps.generate_review.output.title}
abstract: ${steps.generate_review.output.abstract}
key_findings: ${steps.generate_review.output.key_findings}
future_directions: ${steps.analyze_trends.output.future_trends}
export_files: ${steps.export_review.output}
# 错误处理
on_error: stop
# 超时设置
timeout_secs: 300