28 lines
992 B
Markdown
28 lines
992 B
Markdown
|
|
# 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.
|