NCO Task Master - Create, manage, delegate, and track AI tasks
NCO 태스크 생성, 관리, 위임, 추적
Created → Queued → Active → Completed/Failed
↓
Delegated → Active → Completed/Failed
curl -s http://localhost:6200/api/task-master/tasks
With filters:
curl -s "http://localhost:6200/api/task-master/tasks?status=active&ai=gemini&limit=10"
Response:
{
"success": true,
"tasks": [
{
"id": "task_123",
"title": "Code Review",
"description": "Review auth module",
"status": "active",
"priority": "high",
"assignee": "gemini",
"createdAt": "2025-12-09T10:00:00Z",
"progress": 50
}
],
"total": 100,
"page": 1
}
curl -s http://localhost:6200/api/task-master/tasks/{taskId}
Required fields: title, description, assignedAI
curl -s -X POST http://localhost:6200/api/task-master/tasks \
-H "Content-Type: application/json" \
-d '{
"title": "Implement Feature X",
"description": "Add new authentication feature",
"assignedAI": "gemini",
"priority": "high",
"metadata": {
"category": "feature",
"sprint": "2025-Q4"
}
}'
Response:
{
"success": true,
"taskId": "task_456",
"message": "Task created successfully"
}
curl -s -X PATCH http://localhost:6200/api/task-master/tasks/{taskId}/status \
-H "Content-Type: application/json" \
-d '{"status": "completed", "result": "Task completed successfully"}'
Status values:
queued - Waiting in queueactive - Currently being processedcompleted - Successfully finishedfailed - Failed with errorcancelled - Manually cancelleddelegated - Passed to another AIRequired field: targetAI (camelCase)
curl -s -X POST http://localhost:6200/api/task-master/tasks/{taskId}/delegate \
-H "Content-Type: application/json" \
-d '{
"targetAI": "codex",
"reason": "Better suited for code generation"
}'
Response:
{
"success": true,
"message": "Task delegated to codex",
"newTaskId": "task_457"
}
curl -s http://localhost:6200/api/task-master/stats
Response:
{
"success": true,
"stats": {
"total": 1000,
"byStatus": {
"queued": 10,
"active": 5,
"completed": 900,
"failed": 85
},
"byAi": {
"gemini": 400,
"codex": 300,
"ollama": 200,
"claude-code": 100
},
"avgCompletionTime": 5000,
"successRate": 91.5
}
}
curl -s http://localhost:6200/api/task-master/workspaces
curl -s -X POST http://localhost:6200/api/task-master/tasks \
-H "Content-Type: application/json" \
-d '{
"tasks": [
{"title": "Task 1", "assignee": "gemini"},
{"title": "Task 2", "assignee": "codex"},
{"title": "Task 3", "assignee": "ollama"}
]
}'
// If task fails, delegate to another AI
const failedTask = await getTask(taskId);
if (failedTask.status === 'failed') {
const nextAi = getNextAvailableAi(failedTask.assignee);
await delegateTask(taskId, nextAi, 'Auto-retry after failure');
}
// Get least loaded AI
const daemons = await getDaemons();
const leastLoaded = daemons
.filter(d => d.status === 'running')
.sort((a, b) => a.currentLoad - b.currentLoad)[0];
await createTask({ assignee: leastLoaded.name, ... });
// Submit high priority task
await createTask({
title: 'Urgent Fix',
priority: 'critical', // critical > high > normal > low
assignee: 'gemini'
});
const ws = new WebSocket('ws://localhost:6201/nco-ws');
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
switch(data.type) {
case 'task:started':
console.log('Task started:', data.taskId);
break;
case 'task:progress':
console.log('Progress:', data.progress);
break;
case 'task:completed':
console.log('Completed:', data.result);
break;
case 'task:failed':
console.log('Failed:', data.error);
break;
}
};
{
"success": false,
"error": "Task not found",
"code": "TASK_NOT_FOUND"
}
{
"success": false,
"error": "Cannot transition from completed to active",
"code": "INVALID_TRANSITION"
}
Test Status: Verified 2025-12-09