45af56d9cf
Also added: - Memory API endpoints - Briefs API endpoints - AnveVoice stats API - Claude spawn API - TTS proxy - Cleopatra voice widget - api-auth middleware
26 lines
831 B
TypeScript
26 lines
831 B
TypeScript
import { NextResponse } from 'next/server';
|
|
|
|
export async function POST(request: Request) {
|
|
try {
|
|
const { tabId, tabName, apiKey } = await request.json();
|
|
|
|
if (!apiKey) {
|
|
return NextResponse.json({ error: 'API key required' }, { status: 400 });
|
|
}
|
|
|
|
// For now, return instructions for manual spawn
|
|
// Real implementation would use sessions_spawn via OpenClaw SDK
|
|
const sessionKey = `claude-${tabId}-${Date.now()}`;
|
|
|
|
return NextResponse.json({
|
|
success: true,
|
|
sessionId: sessionKey,
|
|
sessionKey,
|
|
message: `To start Claude Code for ${tabName}, use the spawn command in Horus`,
|
|
instruction: `Ask Horus to spawn a Claude session for ${tabName}`
|
|
});
|
|
} catch (error) {
|
|
return NextResponse.json({ error: 'Failed to spawn session' }, { status: 500 });
|
|
}
|
|
}
|