Mission Control

Mission Control is PocketPaw’s internal framework for managing AI agents, tasks, documents, and activities. It provides the execution backbone for Deep Work and can also be used directly via the REST API for custom multi-agent workflows.

Core Concepts

Agents

An AgentProfile represents a virtual team member with a name, role, specialties, and backend configuration.

FieldDescription
nameAgent name (e.g., backend-dev)
roleJob title (e.g., Backend Engineer)
specialtiesSkills like ["backend", "database", "api"]
backendAgent backend (default: claude_agent_sdk)
statusIDLE, ACTIVE, BLOCKED, or OFFLINE
levelINTERN (needs approval), SPECIALIST (independent), LEAD (full autonomy)

Tasks

Tasks track units of work with status, priority, dependencies, and assignees.

StatusDescription
INBOXNew, unassigned
ASSIGNEDHas owner(s), not yet started
IN_PROGRESSBeing worked on
REVIEWDone, awaiting approval
DONECompleted
BLOCKEDWaiting on something
SKIPPEDManually skipped

Tasks support dependency chains via blocked_by (IDs of tasks that must complete first) and blocks (IDs of tasks waiting on this one).

Documents

Documents store deliverables, research notes, and protocols. Types: DELIVERABLE, RESEARCH, PROTOCOL, TEMPLATE, DRAFT. Documents are auto-versioned on update.

Messages & Notifications

Tasks have threaded message boards. Messages support @mentions — mentioning an agent by name (e.g., @backend-dev) creates a notification for that agent. Use @all to notify everyone.

Activity Feed

All changes (task creation, status updates, messages, heartbeats) generate activity entries for a full audit trail.

Task Execution

When a task is dispatched for execution:

  1. A dedicated AgentRouter is created with the assigned agent’s backend
  2. The task prompt is built with agent identity, project context, PRD, and upstream deliverables
  3. The agent streams output via the router
  4. Output is broadcast as mc_task_output WebSocket events
  5. On completion, the output is saved as a DELIVERABLE document
  6. The scheduler callback fires to unblock dependent tasks

Up to 5 tasks can run concurrently. Double-dispatch is prevented by a background launch guard.

Heartbeat System

The HeartbeatDaemon periodically checks agent status using APScheduler:

  • Default interval: 15 minutes
  • Checks for unread notifications and assigned tasks
  • Updates agent status (ACTIVE if urgent work, IDLE otherwise)
  • Agents are woken up with 2-second stagger to avoid thundering herd

REST API

Mission Control exposes a full CRUD API at /api/mission-control.

Agent Endpoints

MethodEndpointDescription
GET/agentsList agents (filter by status)
POST/agentsCreate agent
GET/agents/{id}Get agent details
PATCH/agents/{id}Update agent
DELETE/agents/{id}Delete agent
POST/agents/{id}/heartbeatRecord heartbeat

Task Endpoints

MethodEndpointDescription
GET/tasksList tasks (filter by status, assignee, tags)
POST/tasksCreate task
GET/tasks/{id}Get task with messages
PATCH/tasks/{id}Update task
DELETE/tasks/{id}Delete task
POST/tasks/{id}/assignAssign to agents
POST/tasks/{id}/statusUpdate status
POST/tasks/{id}/runExecute with agent (background)
POST/tasks/{id}/stopStop running task
GET/tasks/runningList currently executing tasks

Message & Document Endpoints

MethodEndpointDescription
GET/tasks/{id}/messagesGet task messages
POST/tasks/{id}/messagesPost message (auto-detects @mentions)
GET/tasks/{id}/documentsGet task documents
GET/documentsList all documents
POST/documentsCreate document
PATCH/documents/{id}Update document (auto-increments version)

Activity & Reports

MethodEndpointDescription
GET/activityActivity feed (filter by agent/task)
GET/statsCounts by status for all entities
GET/standupGenerated standup report (markdown)
GET/notificationsList notifications

Storage

Mission Control uses file-based JSON storage at ~/.pocketclaw/mission_control/:

mission_control/
├── agents.json
├── tasks.json
├── messages.json
├── activities.json
├── documents.json
├── notifications.json
└── projects.json

All writes use atomic temp-file-then-rename for crash safety. The storage backend is protocol-based (MissionControlStoreProtocol), so it can be swapped for SQLite, Postgres, or any other backend.

WebSocket Events

Real-time updates for the dashboard:

EventPayload
mc_task_startedtask_id, agent_id, agent_name, task_title
mc_task_outputtask_id, content, output_type (message/tool_use/tool_result)
mc_task_completedtask_id, agent_id, status, error
mc_activity_createdFull activity object
Info

Mission Control is the execution engine behind Deep Work. Deep Work adds the planning layer (research, PRD, task breakdown, team assembly) on top of Mission Control’s task management.