Files
mcpctl/.taskmaster/tasks/task_144.md

28 lines
992 B
Markdown
Raw Permalink Normal View History

# Task ID: 144
**Title:** Session routes and exec/attach endpoints
**Status:** pending
**Dependencies:** 143
**Priority:** high
**Description:** Create Session routes with CRUD, one-shot exec, and WebSocket attach endpoints
**Details:**
Create src/mcpd/src/routes/session.routes.ts:
1. GET /api/v1/sessions - list with ?project=&agent=&task= filters
2. POST /api/v1/sessions - create and provision
3. GET /api/v1/sessions/:id - get
4. DELETE /api/v1/sessions/:id - end session
5. POST /api/v1/sessions/:id/exec - one-shot exec, body: { command: string[] }, returns { exitCode, stdout, stderr }
6. GET /api/v1/sessions/:id/attach - WebSocket upgrade, bidirectional stdio with terminal resize and exit code propagation
7. Use existing execInContainer, attachInteractive from orchestrator
8. Register in main.ts
**Test Strategy:**
Route tests: test CRUD, test exec returns command output, test attach upgrades to WebSocket. Integration: exec 'echo hello' in session pod, verify output.