387 lines
10 KiB
JSON
387 lines
10 KiB
JSON
|
|
{
|
|||
|
|
"id": "workflow-1768962824958",
|
|||
|
|
"name": "code",
|
|||
|
|
"version": "1.0.0",
|
|||
|
|
"nodes": [
|
|||
|
|
{
|
|||
|
|
"id": "start-node-default",
|
|||
|
|
"type": "start",
|
|||
|
|
"name": "start-node-default",
|
|||
|
|
"position": {
|
|||
|
|
"x": 100,
|
|||
|
|
"y": 200
|
|||
|
|
},
|
|||
|
|
"data": {
|
|||
|
|
"label": "开始"
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "check-docs-1",
|
|||
|
|
"type": "mcp",
|
|||
|
|
"name": "check-docs-1",
|
|||
|
|
"position": {
|
|||
|
|
"x": 330,
|
|||
|
|
"y": 165
|
|||
|
|
},
|
|||
|
|
"data": {
|
|||
|
|
"serverId": "filesystem",
|
|||
|
|
"toolName": "read_file",
|
|||
|
|
"toolDescription": "读取步骤文档文件",
|
|||
|
|
"parameters": [
|
|||
|
|
{
|
|||
|
|
"name": "file_path",
|
|||
|
|
"type": "string",
|
|||
|
|
"description": "步骤文档文件路径",
|
|||
|
|
"required": true
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
"parameterValues": {
|
|||
|
|
"file_path": "./step_documentation.md"
|
|||
|
|
},
|
|||
|
|
"mode": "manualParameterConfig",
|
|||
|
|
"validationStatus": "valid",
|
|||
|
|
"outputPorts": 1
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "if-docs-exist",
|
|||
|
|
"type": "ifElse",
|
|||
|
|
"name": "if-docs-exist",
|
|||
|
|
"position": {
|
|||
|
|
"x": 600,
|
|||
|
|
"y": 135
|
|||
|
|
},
|
|||
|
|
"data": {
|
|||
|
|
"evaluationTarget": "file_content",
|
|||
|
|
"branches": [
|
|||
|
|
{
|
|||
|
|
"id": "has-docs",
|
|||
|
|
"label": "存在文档",
|
|||
|
|
"condition": "文件存在且包含内容"
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "no-docs",
|
|||
|
|
"label": "无文档",
|
|||
|
|
"condition": "文件不存在或为空"
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
"outputPorts": 2
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "error-no-docs",
|
|||
|
|
"type": "subAgent",
|
|||
|
|
"name": "error-no-docs",
|
|||
|
|
"position": {
|
|||
|
|
"x": 840,
|
|||
|
|
"y": 285
|
|||
|
|
},
|
|||
|
|
"data": {
|
|||
|
|
"description": "处理缺少步骤文档的情况",
|
|||
|
|
"prompt": "错误:未找到步骤文档。此工作流需要步骤文档才能继续。请创建一个包含开发步骤的 step_documentation.md 文件。",
|
|||
|
|
"model": "sonnet",
|
|||
|
|
"outputPorts": 1
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "end-error",
|
|||
|
|
"type": "end",
|
|||
|
|
"name": "end-error",
|
|||
|
|
"position": {
|
|||
|
|
"x": 1320,
|
|||
|
|
"y": 510
|
|||
|
|
},
|
|||
|
|
"data": {
|
|||
|
|
"label": "结束 - 错误"
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "extract-steps-1",
|
|||
|
|
"type": "subAgent",
|
|||
|
|
"name": "extract-steps-1",
|
|||
|
|
"position": {
|
|||
|
|
"x": 855,
|
|||
|
|
"y": 120
|
|||
|
|
},
|
|||
|
|
"data": {
|
|||
|
|
"description": "从文档中提取开发步骤",
|
|||
|
|
"prompt": "从步骤文档中提取并列出所有开发步骤。对于每个步骤,识别任务描述、要求和验收标准。以编号列表格式输出步骤。",
|
|||
|
|
"model": "sonnet",
|
|||
|
|
"outputPorts": 1
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "foreach-loop-start",
|
|||
|
|
"type": "subAgent",
|
|||
|
|
"name": "foreach-loop-start",
|
|||
|
|
"position": {
|
|||
|
|
"x": 1290,
|
|||
|
|
"y": 15
|
|||
|
|
},
|
|||
|
|
"data": {
|
|||
|
|
"description": "初始化foreach循环处理步骤",
|
|||
|
|
"prompt": "初始化foreach循环以按顺序处理每个开发步骤。跟踪当前步骤索引和总步骤数。",
|
|||
|
|
"model": "sonnet",
|
|||
|
|
"outputPorts": 1
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "develop-step-1",
|
|||
|
|
"type": "subAgent",
|
|||
|
|
"name": "develop-step-1",
|
|||
|
|
"position": {
|
|||
|
|
"x": 1710,
|
|||
|
|
"y": 45
|
|||
|
|
},
|
|||
|
|
"data": {
|
|||
|
|
"description": "开发当前步骤",
|
|||
|
|
"prompt": "根据要求开发当前步骤。专注于实现本步骤描述的核心功能。",
|
|||
|
|
"model": "sonnet",
|
|||
|
|
"outputPorts": 1
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "verify-step-1",
|
|||
|
|
"type": "subAgent",
|
|||
|
|
"name": "verify-step-1",
|
|||
|
|
"position": {
|
|||
|
|
"x": 1980,
|
|||
|
|
"y": 165
|
|||
|
|
},
|
|||
|
|
"data": {
|
|||
|
|
"description": "验证完成的步骤",
|
|||
|
|
"prompt": "验证当前步骤是否已成功完成。检查是否满足所有要求,功能是否按预期工作。",
|
|||
|
|
"model": "sonnet",
|
|||
|
|
"outputPorts": 1
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "if-step-passed",
|
|||
|
|
"type": "ifElse",
|
|||
|
|
"name": "if-step-passed",
|
|||
|
|
"position": {
|
|||
|
|
"x": 2340,
|
|||
|
|
"y": 150
|
|||
|
|
},
|
|||
|
|
"data": {
|
|||
|
|
"evaluationTarget": "verification_result",
|
|||
|
|
"branches": [
|
|||
|
|
{
|
|||
|
|
"id": "step-passed",
|
|||
|
|
"label": "通过",
|
|||
|
|
"condition": "验证成功"
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "step-failed",
|
|||
|
|
"label": "失败",
|
|||
|
|
"condition": "验证失败"
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
"outputPorts": 2
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "step-complete",
|
|||
|
|
"type": "subAgent",
|
|||
|
|
"name": "step-complete",
|
|||
|
|
"position": {
|
|||
|
|
"x": 2625,
|
|||
|
|
"y": 135
|
|||
|
|
},
|
|||
|
|
"data": {
|
|||
|
|
"description": "移动到下一步",
|
|||
|
|
"prompt": "当前步骤成功完成。移动到序列中的下一步。如果这是最后一步,则标记工作流为完成。",
|
|||
|
|
"model": "sonnet",
|
|||
|
|
"outputPorts": 1
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "fix-bugs-1",
|
|||
|
|
"type": "subAgent",
|
|||
|
|
"name": "fix-bugs-1",
|
|||
|
|
"position": {
|
|||
|
|
"x": 2625,
|
|||
|
|
"y": 345
|
|||
|
|
},
|
|||
|
|
"data": {
|
|||
|
|
"description": "修复错误或完成开发",
|
|||
|
|
"prompt": "修复验证过程中发现的任何错误或问题。继续在此步骤上工作,直到验证通过为止。",
|
|||
|
|
"model": "sonnet",
|
|||
|
|
"outputPorts": 1
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "loop-back",
|
|||
|
|
"type": "subAgent",
|
|||
|
|
"name": "loop-back",
|
|||
|
|
"position": {
|
|||
|
|
"x": 1380,
|
|||
|
|
"y": 345
|
|||
|
|
},
|
|||
|
|
"data": {
|
|||
|
|
"description": "返回开发阶段",
|
|||
|
|
"prompt": "返回开发阶段以继续修复当前步骤。循环返回直到验证通过。",
|
|||
|
|
"model": "sonnet",
|
|||
|
|
"outputPorts": 1
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "end-success",
|
|||
|
|
"type": "end",
|
|||
|
|
"name": "end-success",
|
|||
|
|
"position": {
|
|||
|
|
"x": 3120,
|
|||
|
|
"y": 210
|
|||
|
|
},
|
|||
|
|
"data": {
|
|||
|
|
"label": "结束 - 成功"
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
"connections": [
|
|||
|
|
{
|
|||
|
|
"id": "c1",
|
|||
|
|
"from": "start-node-default",
|
|||
|
|
"to": "check-docs-1",
|
|||
|
|
"fromPort": "output",
|
|||
|
|
"toPort": "input"
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "c2",
|
|||
|
|
"from": "check-docs-1",
|
|||
|
|
"to": "if-docs-exist",
|
|||
|
|
"fromPort": "output",
|
|||
|
|
"toPort": "input"
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "c3",
|
|||
|
|
"from": "if-docs-exist",
|
|||
|
|
"to": "error-no-docs",
|
|||
|
|
"fromPort": "branch-1",
|
|||
|
|
"toPort": "input"
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "c4",
|
|||
|
|
"from": "if-docs-exist",
|
|||
|
|
"to": "extract-steps-1",
|
|||
|
|
"fromPort": "branch-0",
|
|||
|
|
"toPort": "input"
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "c5",
|
|||
|
|
"from": "error-no-docs",
|
|||
|
|
"to": "end-error",
|
|||
|
|
"fromPort": "output",
|
|||
|
|
"toPort": "input"
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "c6",
|
|||
|
|
"from": "extract-steps-1",
|
|||
|
|
"to": "foreach-loop-start",
|
|||
|
|
"fromPort": "output",
|
|||
|
|
"toPort": "input"
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "c7",
|
|||
|
|
"from": "foreach-loop-start",
|
|||
|
|
"to": "develop-step-1",
|
|||
|
|
"fromPort": "output",
|
|||
|
|
"toPort": "input"
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "c8",
|
|||
|
|
"from": "develop-step-1",
|
|||
|
|
"to": "verify-step-1",
|
|||
|
|
"fromPort": "output",
|
|||
|
|
"toPort": "input"
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "c9",
|
|||
|
|
"from": "verify-step-1",
|
|||
|
|
"to": "if-step-passed",
|
|||
|
|
"fromPort": "output",
|
|||
|
|
"toPort": "input"
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "c10",
|
|||
|
|
"from": "if-step-passed",
|
|||
|
|
"to": "step-complete",
|
|||
|
|
"fromPort": "branch-0",
|
|||
|
|
"toPort": "input"
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "c11",
|
|||
|
|
"from": "if-step-passed",
|
|||
|
|
"to": "fix-bugs-1",
|
|||
|
|
"fromPort": "branch-1",
|
|||
|
|
"toPort": "input"
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "c12",
|
|||
|
|
"from": "step-complete",
|
|||
|
|
"to": "end-success",
|
|||
|
|
"fromPort": "output",
|
|||
|
|
"toPort": "input"
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "c13",
|
|||
|
|
"from": "fix-bugs-1",
|
|||
|
|
"to": "loop-back",
|
|||
|
|
"fromPort": "output",
|
|||
|
|
"toPort": "input"
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "c14",
|
|||
|
|
"from": "loop-back",
|
|||
|
|
"to": "develop-step-1",
|
|||
|
|
"fromPort": "output",
|
|||
|
|
"toPort": "input"
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
"createdAt": "2026-01-21T02:33:44.958Z",
|
|||
|
|
"updatedAt": "2026-01-21T02:33:44.958Z",
|
|||
|
|
"conversationHistory": {
|
|||
|
|
"schemaVersion": "1.0.0",
|
|||
|
|
"messages": [
|
|||
|
|
{
|
|||
|
|
"id": "msg-1768962395829-0.4059296316485371",
|
|||
|
|
"sender": "user",
|
|||
|
|
"content": "这是一个按步骤开发并验证的工作流,如果用户提供了工作步骤文档则检查步骤文档,如果没有提供则检查项目是否存在步骤文档。如果没有步骤文档,则退出提示该工作流需要步骤文档。获取到步骤文档之后,foreach进行逐步开发与验证,每一步都必须经过开发,开发完成之后验证,验证完成之后进行下一步,没完成则继续这一步的bug消除或开发,直到最终完成",
|
|||
|
|
"timestamp": "2026-01-21T02:26:35.829Z"
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "ai-1768962395829-0.3003715067855044",
|
|||
|
|
"sender": "ai",
|
|||
|
|
"content": "I'll review the current workflow and analyze the user's request to refine it.\n\nBased on the current workflow, I see it has only a Start and End node. The user's request is to create a step-by-step development and validation workflow that:\n\n1. Checks for step documentation (either provided by user or existing in project)\n2. If no step documentation exists, exits with an error message\n3. If step documentation exists, processes each step with:\n - Development of the step\n - Verification after development\n - If verification fails, continue debugging/completing the current step\n - Only proceed to next step after successful verification\n4. Continues until all steps are completed\n(no content)\n\n(no content)\n\n(no content)",
|
|||
|
|
"timestamp": "2026-01-21T02:26:35.829Z",
|
|||
|
|
"isLoading": false,
|
|||
|
|
"toolInfo": null
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "ai-completion-1768962499055-0.9858225921933254",
|
|||
|
|
"sender": "ai",
|
|||
|
|
"content": "Created step-by-step development and validation workflow with loop structure for iterative development, verification, and bug fixing until completion",
|
|||
|
|
"timestamp": "2026-01-21T02:28:19.055Z",
|
|||
|
|
"isLoading": false
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "8b3720ea-6fea-403c-a6f7-43bf6e0ee4ec",
|
|||
|
|
"sender": "user",
|
|||
|
|
"content": "其中的步骤信息和提示词都换成中文",
|
|||
|
|
"timestamp": "2026-01-21T02:31:41.307Z"
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"id": "ac28af67-28ab-486c-9453-23de15ee3871",
|
|||
|
|
"sender": "ai",
|
|||
|
|
"content": "将步骤信息和提示词全部更新为中文",
|
|||
|
|
"timestamp": "2026-01-21T02:31:41.307Z"
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
"currentIteration": 1,
|
|||
|
|
"maxIterations": 20,
|
|||
|
|
"createdAt": "2026-01-21T02:23:02.038Z",
|
|||
|
|
"updatedAt": "2026-01-21T02:31:41.307Z",
|
|||
|
|
"sessionId": "f50c6996-4640-4c4f-9383-59268a016851"
|
|||
|
|
},
|
|||
|
|
"subAgentFlows": []
|
|||
|
|
}
|