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
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:
250
pipelines/legal/contract-review.yaml
Normal file
250
pipelines/legal/contract-review.yaml
Normal file
@@ -0,0 +1,250 @@
|
||||
# ZCLAW Pipeline - Contract Review
|
||||
# 合同审查:上传合同文档,自动识别风险条款并生成修改建议
|
||||
|
||||
apiVersion: zclaw/v1
|
||||
kind: Pipeline
|
||||
metadata:
|
||||
name: contract-review
|
||||
displayName: 合同智能审查
|
||||
category: legal
|
||||
description: 上传合同文档,AI 自动识别风险条款、合规问题,并生成修改建议
|
||||
tags:
|
||||
- 法律
|
||||
- 合同
|
||||
- 风险评估
|
||||
icon: ⚖️
|
||||
author: ZCLAW
|
||||
version: 1.0.0
|
||||
|
||||
spec:
|
||||
# 输入参数定义
|
||||
inputs:
|
||||
- name: contract_type
|
||||
type: select
|
||||
required: true
|
||||
label: 合同类型
|
||||
options:
|
||||
- 劳动合同
|
||||
- 服务合同
|
||||
- 买卖合同
|
||||
- 租赁合同
|
||||
- 合作协议
|
||||
- 保密协议
|
||||
- 许可协议
|
||||
- 其他
|
||||
|
||||
default: 服务合同
|
||||
|
||||
- name: contract_content
|
||||
type: text
|
||||
required: true
|
||||
label: 合同内容
|
||||
placeholder: 请粘贴或上传合同全文内容
|
||||
|
||||
- name: review_focus
|
||||
type: multi-select
|
||||
required: false
|
||||
label: 审查重点
|
||||
default: [风险条款, 合规问题]
|
||||
options:
|
||||
- 风险条款
|
||||
- 合规问题
|
||||
- 权利义务
|
||||
- 付款条款
|
||||
- 违约责任
|
||||
- 知识产权
|
||||
- 保密条款
|
||||
- 争议解决
|
||||
- 全部审查
|
||||
|
||||
- name: industry
|
||||
type: string
|
||||
required: false
|
||||
label: 行业领域
|
||||
placeholder: 例如:互联网、金融、医疗
|
||||
|
||||
- name: export_formats
|
||||
type: multi-select
|
||||
required: false
|
||||
label: 导出格式
|
||||
default: [html]
|
||||
options:
|
||||
- html
|
||||
- markdown
|
||||
- json
|
||||
|
||||
# 执行步骤
|
||||
steps:
|
||||
# Step 1: 提取合同关键信息
|
||||
- id: extract_info
|
||||
description: 提取合同基本信息
|
||||
action:
|
||||
type: llm_generate
|
||||
template: |
|
||||
从以下合同内容中提取关键信息:
|
||||
|
||||
合同类型: {{contract_type}}
|
||||
行业领域: {{industry}}
|
||||
|
||||
请提取以下信息:
|
||||
1. 合同双方(甲方/乙方)
|
||||
2. 合同标的和 3. 合同期限
|
||||
4. 主要金额/对价
|
||||
5. 关键日期
|
||||
|
||||
合同内容:
|
||||
```
|
||||
{{contract_content}}
|
||||
```
|
||||
|
||||
以 JSON 格式输出:
|
||||
{
|
||||
"parties": {
|
||||
"party_a": "甲方名称",
|
||||
"party_b": "乙方名称"
|
||||
},
|
||||
"subject": "合同标的",
|
||||
"duration": "合同期限",
|
||||
"amount": "主要金额",
|
||||
"key_dates": ["签署日期", "生效日期", "到期日期"]
|
||||
}
|
||||
input:
|
||||
contract_type: ${inputs.contract_type}
|
||||
contract_content: ${inputs.contract_content}
|
||||
industry: ${inputs.industry}
|
||||
json_mode: true
|
||||
temperature: 0.3
|
||||
max_tokens: 1500
|
||||
|
||||
# Step 2: 风险条款分析
|
||||
- id: analyze_risks
|
||||
description: 分析合同中的风险条款
|
||||
action:
|
||||
type: llm_generate
|
||||
template: |
|
||||
作为专业法律顾问,请对以下合同进行风险审查。
|
||||
|
||||
合同基本信息:
|
||||
```
|
||||
${steps.extract_info.output}
|
||||
```
|
||||
|
||||
重点审查以下方面:
|
||||
{{review_focus}}
|
||||
|
||||
请分析以下风险点:
|
||||
1. 不公平条款
|
||||
2. 模糊表述
|
||||
3. 责任限制
|
||||
4. 隐性成本
|
||||
5. 解约风险
|
||||
6. 争议解决机制
|
||||
7. 法律适用问题
|
||||
|
||||
对于每个风险点,请提供:
|
||||
"risk": "风险描述",
|
||||
"severity": "高/中/低",
|
||||
"location": "条款位置",
|
||||
"description": "详细分析",
|
||||
"suggestion": "修改建议"
|
||||
}
|
||||
input:
|
||||
contract_info: ${steps.extract_info.output}
|
||||
review_focus: ${inputs.review_focus}
|
||||
json_mode: true
|
||||
temperature: 0.5
|
||||
max_tokens: 3000
|
||||
|
||||
# Step 3: 合规检查
|
||||
- id: check_compliance
|
||||
description: 检查合同合规性
|
||||
action:
|
||||
type: llm_generate
|
||||
template: |
|
||||
检查以下合同的合规性问题。
|
||||
|
||||
合同类型: {{contract_type}}
|
||||
行业领域: {{industry}}
|
||||
|
||||
请检查:
|
||||
1. 是否符合《民法典》相关规定
|
||||
2. 是否违反消费者权益保护法
|
||||
3. 格式条款是否规范
|
||||
4. 管辖权条款是否合理
|
||||
5. 保密条款是否合规
|
||||
6. 违约责任是否明确
|
||||
|
||||
合同内容摘要:
|
||||
```
|
||||
${steps.extract_info.output}
|
||||
```
|
||||
|
||||
錈对分析输出 JSON:
|
||||
{
|
||||
"compliance_checks": [
|
||||
{
|
||||
"item": "检查项名称",
|
||||
"status": "通过/需注意/存在风险",
|
||||
"details": "详细说明",
|
||||
"recommendation": "建议"
|
||||
}
|
||||
]
|
||||
}
|
||||
input:
|
||||
contract_type: ${inputs.contract_type}
|
||||
contract_info: ${steps.extract_info.output}
|
||||
industry: ${inputs.industry}
|
||||
json_mode: true
|
||||
temperature: 0.4
|
||||
max_tokens: 2000
|
||||
|
||||
# Step 4: 生成审查报告
|
||||
- id: generate_report
|
||||
description: 生成完整审查报告
|
||||
action:
|
||||
type: llm_generate
|
||||
template: |
|
||||
基于以上分析,生成一份完整的合同审查报告。
|
||||
|
||||
报告应包含:
|
||||
1. 合同概览
|
||||
2. 主要风险清单(按严重程度排序)
|
||||
3. 合规问题汇总
|
||||
4. 修改建议(按优先级排序)
|
||||
5. 谈判要点
|
||||
|
||||
分析结果:
|
||||
- 合同基本信息: ${steps.extract_info.output}
|
||||
- 风险分析: ${steps.analyze_risks.output}
|
||||
- 合规检查: ${steps.check_compliance.output}
|
||||
|
||||
请生成结构化的报告内容。
|
||||
input:
|
||||
contract_info: ${steps.extract_info.output}
|
||||
risk_analysis: ${steps.analyze_risks.output}
|
||||
compliance_checks: ${steps.check_compliance.output}
|
||||
json_mode: true
|
||||
temperature: 0.6
|
||||
max_tokens: 4000
|
||||
|
||||
# Step 5: 导出报告
|
||||
- id: export_report
|
||||
description: 导出审查报告
|
||||
action:
|
||||
type: file_export
|
||||
formats: ${inputs.export_formats}
|
||||
input: ${steps.generate_report.output}
|
||||
|
||||
# 输出映射
|
||||
outputs:
|
||||
report_summary: ${steps.generate_report.output.summary}
|
||||
risk_count: ${steps.analyze_risks.output.risks | length}
|
||||
high_risk_count: ${steps.analyze_risks.output.risks | select(.severity == "高") | length
|
||||
compliance_issues: ${steps.check_compliance.output.compliance_checks | length}
|
||||
export_files: ${steps.export_report.output}
|
||||
|
||||
# 错误处理
|
||||
on_error: stop
|
||||
|
||||
# 超时设置
|
||||
timeout_secs: 180
|
||||
Reference in New Issue
Block a user