mirror of
https://github.com/luckyyzh/pi-agent-integrated.git
synced 2026-10-03 02:59:35 +00:00
16 lines
453 B
TypeScript
16 lines
453 B
TypeScript
import { NextResponse } from "next/server";
|
|
import { listAllSessions } from "@/lib/session-reader";
|
|
import { getRunningRpcSessionIds } from "@/lib/rpc-manager";
|
|
|
|
export async function GET() {
|
|
try {
|
|
const sessions = await listAllSessions();
|
|
return NextResponse.json({ sessions, runningSessionIds: getRunningRpcSessionIds() });
|
|
} catch (error) {
|
|
return NextResponse.json(
|
|
{ error: String(error) },
|
|
{ status: 500 }
|
|
);
|
|
}
|
|
}
|