Files
analysis_claude_code/web/src/data/execution-flows.ts
T

471 lines
24 KiB
TypeScript

import type { FlowNode, FlowEdge } from "@/types/agent-data";
export interface FlowDefinition {
nodes: FlowNode[];
edges: FlowEdge[];
}
const FLOW_WIDTH = 600;
const COL_CENTER = FLOW_WIDTH / 2;
const COL_LEFT = 140;
const COL_RIGHT = FLOW_WIDTH - 140;
export const EXECUTION_FLOWS: Record<string, FlowDefinition> = {
s01: {
nodes: [
{ id: "start", label: "User Input", type: "start", x: COL_CENTER, y: 30 },
{ id: "llm", label: "LLM Call", type: "process", x: COL_CENTER, y: 110 },
{ id: "tool_check", label: "tool_use?", type: "decision", x: COL_CENTER, y: 190 },
{ id: "bash", label: "Execute Bash", type: "subprocess", x: COL_LEFT, y: 280 },
{ id: "append", label: "Append Result", type: "process", x: COL_LEFT, y: 360 },
{ id: "end", label: "Output", type: "end", x: COL_RIGHT, y: 280 },
],
edges: [
{ from: "start", to: "llm" },
{ from: "llm", to: "tool_check" },
{ from: "tool_check", to: "bash", label: "yes" },
{ from: "tool_check", to: "end", label: "no" },
{ from: "bash", to: "append" },
{ from: "append", to: "llm" },
],
},
s02: {
nodes: [
{ id: "start", label: "User Input", type: "start", x: COL_CENTER, y: 30 },
{ id: "llm", label: "LLM Call", type: "process", x: COL_CENTER, y: 110 },
{ id: "tool_check", label: "tool_use?", type: "decision", x: COL_CENTER, y: 190 },
{ id: "dispatch", label: "Tool Dispatch", type: "process", x: COL_LEFT, y: 280 },
{ id: "exec", label: "bash / read / write / edit", type: "subprocess", x: COL_LEFT, y: 360 },
{ id: "append", label: "Append Result", type: "process", x: COL_LEFT, y: 440 },
{ id: "end", label: "Output", type: "end", x: COL_RIGHT, y: 280 },
],
edges: [
{ from: "start", to: "llm" },
{ from: "llm", to: "tool_check" },
{ from: "tool_check", to: "dispatch", label: "yes" },
{ from: "tool_check", to: "end", label: "no" },
{ from: "dispatch", to: "exec" },
{ from: "exec", to: "append" },
{ from: "append", to: "llm" },
],
},
s11: {
nodes: [
{ id: "start", label: "User Input", type: "start", x: COL_CENTER, y: 30 },
{ id: "llm", label: "LLM Call", type: "process", x: COL_CENTER, y: 110 },
{ id: "tool_check", label: "tool_use?", type: "decision", x: COL_CENTER, y: 190 },
{ id: "bg_check", label: "background?", type: "decision", x: COL_LEFT, y: 280 },
{ id: "spawn", label: "Spawn Thread", type: "subprocess", x: 70, y: 370 },
{ id: "placeholder", label: "Return Placeholder", type: "process", x: 70, y: 450 },
{ id: "notify", label: "Notification\nQueue", type: "process", x: COL_RIGHT, y: 500 },
{ id: "collect", label: "Collect Results", type: "process", x: COL_RIGHT, y: 590 },
{ id: "exec", label: "Execute Tool", type: "subprocess", x: COL_LEFT + 110, y: 370 },
{ id: "append", label: "Append Result", type: "process", x: COL_CENTER, y: 690 },
{ id: "end", label: "Output", type: "end", x: COL_RIGHT, y: 280 },
],
edges: [
{ from: "start", to: "llm" },
{ from: "llm", to: "tool_check" },
{ from: "tool_check", to: "bg_check", label: "yes" },
{ from: "tool_check", to: "end", label: "no" },
{ from: "bg_check", to: "spawn", label: "bg" },
{ from: "bg_check", to: "exec", label: "fg" },
{ from: "spawn", to: "placeholder" },
{ from: "spawn", to: "notify", label: "done" },
{ from: "notify", to: "collect" },
{ from: "placeholder", to: "append" },
{ from: "exec", to: "append" },
{ from: "collect", to: "append" },
{ from: "append", to: "llm" },
],
},
s12: {
nodes: [
{ id: "start", label: "User Input", type: "start", x: COL_CENTER, y: 30 },
{ id: "llm", label: "LLM Call", type: "process", x: COL_CENTER, y: 110 },
{ id: "tool_check", label: "cron tool?", type: "decision", x: COL_CENTER, y: 190 },
{ id: "schedule", label: "schedule_cron", type: "subprocess", x: COL_LEFT, y: 280 },
{ id: "store", label: "Durable Store\n.scheduled_tasks", type: "process", x: COL_LEFT, y: 360 },
{ id: "scheduler", label: "Scheduler Loop", type: "process", x: COL_CENTER, y: 450 },
{ id: "match", label: "cron_matches?", type: "decision", x: COL_CENTER, y: 540 },
{ id: "queue", label: "Cron Queue", type: "process", x: COL_RIGHT, y: 540 },
{ id: "processor", label: "Queue Processor", type: "process", x: COL_RIGHT, y: 630 },
{ id: "agent", label: "Agent Loop", type: "process", x: COL_CENTER, y: 720 },
{ id: "end", label: "Output", type: "end", x: COL_RIGHT, y: 280 },
],
edges: [
{ from: "start", to: "llm" },
{ from: "llm", to: "tool_check" },
{ from: "tool_check", to: "schedule", label: "yes" },
{ from: "tool_check", to: "end", label: "no" },
{ from: "schedule", to: "store" },
{ from: "store", to: "scheduler" },
{ from: "scheduler", to: "match" },
{ from: "match", to: "queue", label: "due" },
{ from: "queue", to: "processor" },
{ from: "processor", to: "agent" },
{ from: "agent", to: "llm" },
],
},
s13: {
nodes: [
{ id: "start", label: "User Requirement", type: "start", x: COL_CENTER, y: 30 },
{ id: "lead", label: "Lead Proposes\nSmall Team", type: "process", x: COL_CENTER, y: 110 },
{ id: "confirm", label: "User Confirms?", type: "decision", x: COL_CENTER, y: 190 },
{ id: "spawn", label: "Spawn Persistent\nTeammate", type: "subprocess", x: COL_LEFT, y: 280 },
{ id: "bus", label: "MessageBus\nTyped Requests", type: "process", x: COL_CENTER, y: 370 },
{ id: "teammate", label: "Teammate\nWORK / IDLE", type: "process", x: COL_RIGHT, y: 280 },
{ id: "gate", label: "Plan Approved?", type: "decision", x: COL_RIGHT, y: 370 },
{ id: "scan", label: "Scan Ready Tasks", type: "subprocess", x: COL_CENTER, y: 470 },
{ id: "ready", label: "Ready Task?", type: "decision", x: COL_CENTER, y: 560 },
{ id: "claim", label: "Atomic Claim\ntask_lock", type: "subprocess", x: COL_LEFT, y: 650 },
{ id: "cwd", label: "Task Worktree\nTool cwd", type: "process", x: COL_RIGHT, y: 650 },
{ id: "result", label: "Result + IDLE\nRuntime Delivery", type: "process", x: COL_CENTER, y: 740 },
{ id: "end", label: "Continue Alone", type: "end", x: COL_RIGHT, y: 190 },
],
edges: [
{ from: "start", to: "lead" },
{ from: "lead", to: "confirm" },
{ from: "confirm", to: "spawn", label: "yes" },
{ from: "confirm", to: "end", label: "no" },
{ from: "spawn", to: "bus", label: "assignment" },
{ from: "bus", to: "teammate" },
{ from: "teammate", to: "gate" },
{ from: "gate", to: "bus", label: "waiting" },
{ from: "gate", to: "scan", label: "approved / idle" },
{ from: "scan", to: "ready" },
{ from: "ready", to: "bus", label: "no: wait" },
{ from: "ready", to: "claim", label: "yes" },
{ from: "claim", to: "cwd" },
{ from: "cwd", to: "result" },
{ from: "result", to: "bus", label: "reply + wake Lead" },
{ from: "bus", to: "lead", label: "runtime delivery" },
],
},
s14: {
nodes: [
{ id: "start", label: "User Input", type: "start", x: COL_CENTER, y: 30 },
{ id: "llm", label: "LLM Call", type: "process", x: COL_CENTER, y: 110 },
{ id: "connect", label: "connect_mcp?", type: "decision", x: COL_CENTER, y: 200 },
{ id: "client", label: "MCP Client", type: "process", x: COL_LEFT, y: 300 },
{ id: "discover", label: "Discover Tools", type: "subprocess", x: COL_LEFT, y: 390 },
{ id: "pool", label: "Assemble Tool Pool\nmcp__server__tool", type: "process", x: COL_CENTER, y: 480 },
{ id: "call", label: "MCP Tool Call", type: "subprocess", x: COL_RIGHT, y: 390 },
{ id: "server", label: "External Server", type: "process", x: COL_RIGHT, y: 480 },
{ id: "append", label: "Append Result", type: "process", x: COL_CENTER, y: 580 },
{ id: "end", label: "Output", type: "end", x: 520, y: 200 },
],
edges: [
{ from: "start", to: "llm" },
{ from: "llm", to: "connect" },
{ from: "connect", to: "client", label: "connect" },
{ from: "connect", to: "call", label: "use" },
{ from: "connect", to: "end", label: "done" },
{ from: "client", to: "discover" },
{ from: "discover", to: "pool" },
{ from: "pool", to: "llm" },
{ from: "call", to: "server" },
{ from: "server", to: "append" },
{ from: "append", to: "llm" },
],
},
s15: {
nodes: [
{ id: "start", label: "User Input", type: "start", x: COL_CENTER, y: 30 },
{ id: "context", label: "Assemble Context\nmemory + tasks", type: "process", x: COL_CENTER, y: 115 },
{ id: "policy", label: "Policy + Hooks", type: "process", x: COL_LEFT, y: 210 },
{ id: "llm", label: "LLM Call", type: "process", x: COL_CENTER, y: 300 },
{ id: "router", label: "Route Tool", type: "decision", x: COL_CENTER, y: 390 },
{ id: "builtin", label: "Built-in Tools", type: "subprocess", x: 85, y: 500 },
{ id: "team", label: "Teams /\nProtocols", type: "subprocess", x: 230, y: 500 },
{ id: "async", label: "Background /\nCron", type: "subprocess", x: 370, y: 500 },
{ id: "external", label: "Worktree /\nMCP", type: "subprocess", x: 515, y: 500 },
{ id: "append", label: "Append Result", type: "process", x: COL_CENTER, y: 610 },
{ id: "recover", label: "Recover /\nCompact", type: "process", x: COL_LEFT, y: 700 },
{ id: "end", label: "Final Output", type: "end", x: COL_RIGHT, y: 390 },
],
edges: [
{ from: "start", to: "context" },
{ from: "context", to: "policy" },
{ from: "policy", to: "llm" },
{ from: "context", to: "llm" },
{ from: "llm", to: "router" },
{ from: "router", to: "builtin", label: "local" },
{ from: "router", to: "team", label: "team" },
{ from: "router", to: "async", label: "async" },
{ from: "router", to: "external", label: "ext" },
{ from: "router", to: "end", label: "done" },
{ from: "builtin", to: "append" },
{ from: "team", to: "append" },
{ from: "async", to: "append" },
{ from: "external", to: "append" },
{ from: "append", to: "recover" },
{ from: "recover", to: "context" },
],
},
s16: {
nodes: [
{ id: "start", label: "Workflow Tool Call", type: "start", x: COL_CENTER, y: 30 },
{ id: "validate", label: "Validate Meta +\nPermission", type: "process", x: COL_CENTER, y: 120 },
{ id: "launch", label: "async_launched", type: "process", x: COL_CENTER, y: 210 },
{ id: "phase", label: "Select Phase", type: "process", x: COL_CENTER, y: 300 },
{ id: "pipeline", label: "Pipeline /\nParallel Agents", type: "subprocess", x: COL_LEFT, y: 410 },
{ id: "journal", label: "Append Journal", type: "process", x: COL_LEFT, y: 520 },
{ id: "more", label: "More Stages?", type: "decision", x: COL_CENTER, y: 620 },
{ id: "output", label: "Write Output", type: "process", x: COL_RIGHT, y: 520 },
{ id: "notify", label: "task_notification", type: "end", x: COL_RIGHT, y: 620 },
],
edges: [
{ from: "start", to: "validate" },
{ from: "validate", to: "launch" },
{ from: "launch", to: "phase" },
{ from: "phase", to: "pipeline" },
{ from: "pipeline", to: "journal" },
{ from: "journal", to: "more" },
{ from: "more", to: "phase", label: "yes" },
{ from: "more", to: "output", label: "no" },
{ from: "output", to: "notify" },
],
},
s17: {
nodes: [
{ id: "start", label: "Model Wants to Stop", type: "start", x: COL_CENTER, y: 30 },
{ id: "active", label: "Active Goal?", type: "decision", x: COL_CENTER, y: 120 },
{ id: "background", label: "Background Work\nRunning?", type: "decision", x: COL_CENTER, y: 215 },
{ id: "defer", label: "defer\nGoal Stays Active", type: "end", x: COL_RIGHT, y: 215 },
{ id: "conversation", label: "Evaluator Reads\nConversation", type: "process", x: COL_CENTER, y: 315 },
{ id: "evaluate", label: "Evaluator Result?", type: "decision", x: COL_CENTER, y: 415 },
{ id: "complete", label: "achieved\nGoal Cleared", type: "end", x: COL_RIGHT, y: 415 },
{ id: "failed", label: "failed\nGoal Cleared", type: "end", x: COL_RIGHT, y: 520 },
{ id: "cap", label: "Stop-Block Cap\nReached?", type: "decision", x: COL_LEFT, y: 520 },
{ id: "continue", label: "Append Reason\nto messages[]", type: "process", x: COL_LEFT, y: 625 },
{ id: "loop", label: "Next Agent Turn", type: "subprocess", x: COL_LEFT, y: 730 },
{ id: "limit", label: "limit\nGoal Stays Active", type: "end", x: COL_CENTER, y: 520 },
{ id: "return", label: "Return", type: "end", x: COL_RIGHT, y: 120 },
],
edges: [
{ from: "start", to: "active" },
{ from: "active", to: "return", label: "no" },
{ from: "active", to: "background", label: "yes" },
{ from: "background", to: "defer", label: "yes" },
{ from: "background", to: "conversation", label: "no" },
{ from: "conversation", to: "evaluate" },
{ from: "evaluate", to: "complete", label: "ok" },
{ from: "evaluate", to: "failed", label: "impossible" },
{ from: "evaluate", to: "cap", label: "not yet" },
{ from: "cap", to: "limit", label: "yes" },
{ from: "cap", to: "continue", label: "no" },
{ from: "continue", to: "loop" },
{ from: "loop", to: "start" },
],
},
};
const CURRENT_FLOW_OVERRIDES: Record<string, FlowDefinition> = {
s03: {
nodes: [
{ id: "start", label: "Tool Call", type: "start", x: COL_CENTER, y: 30 },
{ id: "hard", label: "Hard Deny?", type: "decision", x: COL_CENTER, y: 120 },
{ id: "rules", label: "Rule Match?", type: "decision", x: COL_CENTER, y: 220 },
{ id: "ask", label: "Ask User", type: "subprocess", x: COL_LEFT, y: 320 },
{ id: "allow", label: "Approved?", type: "decision", x: COL_LEFT, y: 410 },
{ id: "exec", label: "Execute Tool", type: "process", x: COL_CENTER, y: 520 },
{ id: "blocked_policy", label: "Blocked", type: "end", x: COL_RIGHT, y: 120 },
{ id: "blocked_user", label: "Blocked", type: "end", x: COL_RIGHT, y: 410 },
{ id: "append", label: "Append Result", type: "process", x: COL_CENTER, y: 610 },
],
edges: [
{ from: "start", to: "hard" },
{ from: "hard", to: "blocked_policy", label: "deny" },
{ from: "hard", to: "rules", label: "ok" },
{ from: "rules", to: "ask", label: "needs approval" },
{ from: "rules", to: "exec", label: "allow" },
{ from: "ask", to: "allow" },
{ from: "allow", to: "blocked_user", label: "no" },
{ from: "allow", to: "exec", label: "yes" },
{ from: "exec", to: "append" },
],
},
s04: {
nodes: [
{ id: "start", label: "User Input", type: "start", x: COL_CENTER, y: 30 },
{ id: "user_hook", label: "UserPromptSubmit\nHooks", type: "subprocess", x: COL_CENTER, y: 120 },
{ id: "llm", label: "LLM Call", type: "process", x: COL_CENTER, y: 220 },
{ id: "tool_check", label: "tool_use?", type: "decision", x: COL_CENTER, y: 310 },
{ id: "pre", label: "PreToolUse\nHooks", type: "subprocess", x: COL_LEFT, y: 410 },
{ id: "blocked", label: "Blocked?", type: "decision", x: COL_LEFT, y: 500 },
{ id: "exec", label: "Tool Handler", type: "process", x: COL_CENTER, y: 600 },
{ id: "post", label: "PostToolUse\nHooks", type: "subprocess", x: COL_CENTER, y: 690 },
{ id: "stop", label: "Stop Hooks", type: "subprocess", x: COL_RIGHT, y: 410 },
{ id: "end", label: "Output", type: "end", x: COL_RIGHT, y: 500 },
],
edges: [
{ from: "start", to: "user_hook" },
{ from: "user_hook", to: "llm" },
{ from: "llm", to: "tool_check" },
{ from: "tool_check", to: "pre", label: "yes" },
{ from: "tool_check", to: "stop", label: "no" },
{ from: "pre", to: "blocked" },
{ from: "blocked", to: "end", label: "yes" },
{ from: "blocked", to: "exec", label: "no" },
{ from: "exec", to: "post" },
{ from: "post", to: "llm" },
{ from: "stop", to: "end" },
],
},
s05: {
nodes: [
{ id: "start", label: "User Input", type: "start", x: COL_CENTER, y: 30 },
{ id: "llm", label: "LLM Call", type: "process", x: COL_CENTER, y: 120 },
{ id: "tool", label: "tool_use?", type: "decision", x: COL_CENTER, y: 210 },
{ id: "todo", label: "todo_write?", type: "decision", x: COL_LEFT, y: 310 },
{ id: "update", label: "TodoManager\n.update()", type: "process", x: COL_LEFT, y: 410 },
{ id: "other", label: "Run Tool", type: "subprocess", x: COL_CENTER, y: 410 },
{ id: "reminder", label: "3 rounds?\nInject Reminder", type: "process", x: COL_RIGHT, y: 500 },
{ id: "append", label: "Append Result", type: "process", x: COL_CENTER, y: 590 },
{ id: "end", label: "Output", type: "end", x: COL_RIGHT, y: 310 },
],
edges: [
{ from: "start", to: "llm" },
{ from: "llm", to: "tool" },
{ from: "tool", to: "todo", label: "yes" },
{ from: "tool", to: "end", label: "no" },
{ from: "todo", to: "update", label: "todo" },
{ from: "todo", to: "other", label: "other" },
{ from: "update", to: "append" },
{ from: "other", to: "append" },
{ from: "append", to: "reminder" },
{ from: "reminder", to: "llm" },
],
},
s06: {
nodes: [
{ id: "start", label: "User Input", type: "start", x: COL_CENTER, y: 30 },
{ id: "parent", label: "Parent LLM", type: "process", x: COL_CENTER, y: 120 },
{ id: "task_check", label: "task tool?", type: "decision", x: COL_CENTER, y: 220 },
{ id: "run", label: "Run Subagent\nfresh messages[]", type: "subprocess", x: COL_LEFT, y: 330 },
{ id: "subloop", label: "Subagent Loop\nmax 30 turns", type: "process", x: COL_LEFT, y: 430 },
{ id: "final_text", label: "Return Final\nText", type: "process", x: COL_LEFT, y: 530 },
{ id: "tool", label: "Run Parent Tool", type: "subprocess", x: COL_RIGHT, y: 330 },
{ id: "append", label: "Append Result", type: "process", x: COL_CENTER, y: 630 },
{ id: "end", label: "Output", type: "end", x: COL_RIGHT, y: 220 },
],
edges: [
{ from: "start", to: "parent" },
{ from: "parent", to: "task_check" },
{ from: "task_check", to: "run", label: "task" },
{ from: "task_check", to: "tool", label: "other" },
{ from: "task_check", to: "end", label: "done" },
{ from: "run", to: "subloop" },
{ from: "subloop", to: "final_text" },
{ from: "final_text", to: "append" },
{ from: "tool", to: "append" },
{ from: "append", to: "parent" },
],
},
s07: {
nodes: [
{ id: "start", label: "Startup", type: "start", x: COL_CENTER, y: 30 },
{ id: "scan", label: "Scan skills/", type: "process", x: COL_CENTER, y: 120 },
{ id: "catalog", label: "Inject Catalog\nOnly", type: "process", x: COL_CENTER, y: 210 },
{ id: "llm", label: "LLM Call", type: "process", x: COL_CENTER, y: 310 },
{ id: "need", label: "load_skill?", type: "decision", x: COL_CENTER, y: 400 },
{ id: "read", label: "Read SKILL.md", type: "subprocess", x: COL_LEFT, y: 500 },
{ id: "inject", label: "Tool Result\nFull Skill", type: "process", x: COL_LEFT, y: 590 },
{ id: "other", label: "Other Tool", type: "subprocess", x: COL_RIGHT, y: 500 },
{ id: "append", label: "Append Result", type: "process", x: COL_CENTER, y: 690 },
],
edges: [
{ from: "start", to: "scan" },
{ from: "scan", to: "catalog" },
{ from: "catalog", to: "llm" },
{ from: "llm", to: "need" },
{ from: "need", to: "read", label: "yes" },
{ from: "need", to: "other", label: "no" },
{ from: "read", to: "inject" },
{ from: "inject", to: "append" },
{ from: "other", to: "append" },
{ from: "append", to: "llm" },
],
},
s08: {
nodes: [
{ id: "start", label: "messages[]", type: "start", x: COL_CENTER, y: 30 },
{ id: "budget", label: "Tool Result\nBudget", type: "process", x: COL_CENTER, y: 120 },
{ id: "snip", label: "Snip Compact", type: "process", x: COL_CENTER, y: 210 },
{ id: "micro", label: "Micro Compact", type: "process", x: COL_CENTER, y: 300 },
{ id: "threshold", label: "over limit?", type: "decision", x: COL_CENTER, y: 390 },
{ id: "summary", label: "LLM Summary\nCompact", type: "subprocess", x: COL_LEFT, y: 500 },
{ id: "llm", label: "LLM Call", type: "process", x: COL_CENTER, y: 610 },
{ id: "too_long", label: "prompt_too_long?", type: "decision", x: COL_RIGHT, y: 610 },
{ id: "reactive", label: "Reactive Compact", type: "subprocess", x: COL_LEFT, y: 720 },
],
edges: [
{ from: "start", to: "budget" },
{ from: "budget", to: "snip" },
{ from: "snip", to: "micro" },
{ from: "micro", to: "threshold" },
{ from: "threshold", to: "summary", label: "yes" },
{ from: "threshold", to: "llm", label: "no" },
{ from: "summary", to: "llm" },
{ from: "llm", to: "too_long" },
{ from: "too_long", to: "reactive", label: "yes" },
{ from: "reactive", to: "llm" },
],
},
s09: {
nodes: [
{ id: "start", label: "Session Start", type: "start", x: COL_CENTER, y: 30 },
{ id: "index", label: "Load MEMORY.md\nIndex", type: "process", x: COL_CENTER, y: 120 },
{ id: "select", label: "Select Relevant\nMemory Files", type: "process", x: COL_CENTER, y: 220 },
{ id: "inject", label: "Inject Memory\nContent", type: "process", x: COL_CENTER, y: 320 },
{ id: "compact", label: "Compact Pipeline", type: "subprocess", x: COL_CENTER, y: 420 },
{ id: "llm", label: "LLM Call", type: "process", x: COL_CENTER, y: 520 },
{ id: "extract", label: "Extract New\nMemories", type: "subprocess", x: COL_LEFT, y: 630 },
{ id: "write", label: "Write .memory\nFiles", type: "process", x: COL_LEFT, y: 720 },
{ id: "dream", label: "Periodic\nConsolidate", type: "process", x: COL_RIGHT, y: 720 },
],
edges: [
{ from: "start", to: "index" },
{ from: "index", to: "select" },
{ from: "select", to: "inject" },
{ from: "inject", to: "compact" },
{ from: "compact", to: "llm" },
{ from: "llm", to: "extract" },
{ from: "extract", to: "write" },
{ from: "write", to: "index" },
{ from: "write", to: "dream" },
],
},
s10: {
nodes: [
{ id: "start", label: "User Goal", type: "start", x: COL_CENTER, y: 30 },
{ id: "create", label: "create_task", type: "subprocess", x: COL_CENTER, y: 120 },
{ id: "save", label: "Persist JSON\n.tasks/", type: "process", x: COL_CENTER, y: 210 },
{ id: "list", label: "list / get", type: "subprocess", x: COL_RIGHT, y: 300 },
{ id: "deps", label: "blockedBy\ncomplete?", type: "decision", x: COL_CENTER, y: 390 },
{ id: "blocked", label: "Remain Pending", type: "end", x: COL_RIGHT, y: 490 },
{ id: "claim", label: "claim_task\nowner + in_progress", type: "subprocess", x: COL_LEFT, y: 490 },
{ id: "complete", label: "complete_task", type: "subprocess", x: COL_LEFT, y: 590 },
{ id: "unblock", label: "Report\nUnblocked", type: "process", x: COL_CENTER, y: 690 },
{ id: "append", label: "Append Result", type: "process", x: COL_CENTER, y: 780 },
],
edges: [
{ from: "start", to: "create" },
{ from: "create", to: "save" },
{ from: "save", to: "list" },
{ from: "save", to: "deps" },
{ from: "deps", to: "blocked", label: "no" },
{ from: "deps", to: "claim", label: "yes" },
{ from: "claim", to: "complete" },
{ from: "complete", to: "unblock" },
{ from: "unblock", to: "append" },
{ from: "append", to: "list" },
],
},
};
export function getFlowForVersion(version: string): FlowDefinition | null {
return CURRENT_FLOW_OVERRIDES[version] ?? EXECUTION_FLOWS[version] ?? null;
}