feat: @mosaic/coord — migrate from v0, gateway integration (P2-005)
Migrate the orchestration coordination package from v0 with full file-based mission/task lifecycle management. Adds gateway REST API at /api/coord/* and agent tools for coord queries. Package modules: - types: Mission, task, session, milestone type definitions - mission: Create, load, save missions with atomic file writes - tasks-file: TASKS.md markdown table parsing/generation with file locking - runner: Task execution subprocess spawning with session locks - status: Mission and task status queries Gateway integration: - CoordModule with CoordService wrapping coord functions - CoordController exposing status/tasks/task-detail endpoints - Agent tools: coord_mission_status, coord_list_tasks, coord_task_detail Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
31
apps/gateway/src/coord/coord.controller.ts
Normal file
31
apps/gateway/src/coord/coord.controller.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { Controller, Get, NotFoundException, Param, Query, UseGuards } from '@nestjs/common';
|
||||
import { AuthGuard } from '../auth/auth.guard.js';
|
||||
import { CoordService } from './coord.service.js';
|
||||
|
||||
@Controller('api/coord')
|
||||
@UseGuards(AuthGuard)
|
||||
export class CoordController {
|
||||
constructor(private readonly coordService: CoordService) {}
|
||||
|
||||
@Get('status')
|
||||
async missionStatus(@Query('projectPath') projectPath?: string) {
|
||||
const resolvedPath = projectPath ?? process.cwd();
|
||||
const status = await this.coordService.getMissionStatus(resolvedPath);
|
||||
if (!status) throw new NotFoundException('No active coord mission found');
|
||||
return status;
|
||||
}
|
||||
|
||||
@Get('tasks')
|
||||
async listTasks(@Query('projectPath') projectPath?: string) {
|
||||
const resolvedPath = projectPath ?? process.cwd();
|
||||
return this.coordService.listTasks(resolvedPath);
|
||||
}
|
||||
|
||||
@Get('tasks/:taskId')
|
||||
async taskStatus(@Param('taskId') taskId: string, @Query('projectPath') projectPath?: string) {
|
||||
const resolvedPath = projectPath ?? process.cwd();
|
||||
const detail = await this.coordService.getTaskStatus(resolvedPath, taskId);
|
||||
if (!detail) throw new NotFoundException(`Task ${taskId} not found in coord mission`);
|
||||
return detail;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user