AgentManager was never instantiated or passed to the CoordinationServer,
causing all agent-related tRPC procedures to throw "Agent manager not
available". Creates DrizzleAgentRepository, SimpleGitWorktreeManager,
and ClaudeAgentManager in startServer() and passes agentManager into
the server context deps.
listWaitingAgents, listAgents, and getAgentQuestions now return empty
results instead of throwing when agentManager is not wired into the
tRPC context. Mutation procedures (spawn, stop, resume) still throw.
- getAgentQuestions returns structured PendingQuestions from AgentManager
- listWaitingAgents filters agents to waiting_for_input status
- Updated JSDoc procedure list with both new procedures
Create tRPC client with httpBatchLink targeting /trpc (Vite proxy).
Wrap app in trpc.Provider and QueryClientProvider with sensible
defaults. Add health check query to App.tsx for connection
verification. Add vite-env.d.ts for CSS module types. Remove
unused Plan import from backend router.
- Import PhaseDispatchManager type from dispatch module
- Add requirePhaseDispatchManager helper function
- Add createPhaseDependency: creates dependency between two phases
- Add getPhaseDependencies: returns phase IDs that a phase depends on
- Add queuePhase: queues phase for dispatch
- Add dispatchNextPhase: dispatches next available phase
- Add getPhaseQueueState: returns phase queue state
All procedures follow existing naming conventions and error handling patterns.
- Import PhaseDispatchManager type from dispatch module
- Add optional phaseDispatchManager to TRPCContext interface
- Add phaseDispatchManager to CreateContextOptions
- Wire phaseDispatchManager through createContext function
Includes blocking fix: added 'blocked' status to phases schema enum
- Import buildDecomposePrompt from agent prompts
- Add spawnArchitectDecompose procedure for decompose mode
- Validates plan and phase exist before spawning
- Spawns agent with decompose mode and comprehensive prompt
- Add createDependency method to TaskRepository interface
- Implement createDependency in DrizzleTaskRepository
- Add createTasksFromDecomposition procedure for bulk task creation
- Procedure verifies plan exists before creating tasks
- Creates tasks in order, building number-to-ID map
- Creates task dependencies after all tasks exist
- Dependencies mapped from task numbers to IDs
- Import PlanRepository type from repositories
- Add planRepository?: PlanRepository to TRPCContext type
- Add planRepository to CreateContextOptions
- Update createContext to include planRepository
- Add spawnArchitectDiscuss for context-gathering mode
- Add spawnArchitectBreakdown for phase decomposition mode
- Both procedures validate initiative exists before spawning
- Use comprehensive prompts from agent/prompts module
- Add coordinationManager to TRPCContext and CreateContextOptions
- Add requireCoordinationManager helper function
- Add queueMerge mutation for queuing tasks for merge
- Add processMerges mutation for processing merges in dependency order
- Add getMergeQueueStatus query for queue state inspection
- Add getNextMergeable query for next mergeable task
- Add TaskRepository to TRPCContext (optional, same pattern as AgentManager)
- Add requireTaskRepository helper function
- Add listTasks procedure (query tasks by planId, ordered by order field)
- Add getTask procedure (get single task by ID, throws NOT_FOUND)
- Add updateTaskStatus procedure (update task status to pending/in_progress/completed/blocked)
- Import AgentManager type into context.ts
- Add optional agentManager field to TRPCContext interface
- Add optional agentManager to CreateContextOptions
- Update TrpcAdapterOptions with optional agentManager
- Pass agentManager through to createContext in adapter