Skip to main content
The Supervisor worker orchestrates agent execution, manages project state, and handles human-in-the-loop interrupts.

Architecture

Environment Bindings

Key Functions

Project Management

List Projects
Create Project
Hydrate Project

Agent Execution

executeParallelNodes Executes agents in parallel (fan-out/fan-in):
executeSequentialNodes Executes agents sequentially:

Streaming

handleStreamRequest Handles Server-Sent Events for real-time updates:

Context Assembly

assembleContext Assembles context from previous artifacts:

Database Schema

projects Table

artifacts Table

execution_traces Table

Storage Strategy

  • D1 Database: Projects, artifacts, execution traces
  • R2 Storage: Large artifacts (if content > threshold)
  • Artifact Keys: artifacts/{projectId}/{phase}/{artifactId}

Human-in-the-Loop

The supervisor checks for interrupt signals:
Interrupt points:
  • After Logic Agent (before API design)
  • After API Agent (before Frontend design)
  • After critical phases