(request: Request)
| 15 | } |
| 16 | |
| 17 | export async function POST(request: Request) { |
| 18 | try { |
| 19 | const body = (await request.json().catch(() => ({}))) as SessionRequest |
| 20 | const apiKey = body.apiKey?.trim() |
| 21 | |
| 22 | if (apiKey) { |
| 23 | return jsonSession(await createSession(apiKey, Boolean(body.remember)), request) |
| 24 | } |
| 25 | |
| 26 | return jsonSession(await restoreSession(body.sessionId?.trim()), request) |
| 27 | } catch (error) { |
| 28 | return jsonError(error, "Failed to create an Agent Kanban session.") |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | export async function DELETE(request: Request) { |
| 33 | try { |
nothing calls this directly
no test coverage detected