import { getAgentRun } from '@/lib/delegation.js';

export const runtime = 'nodejs';
export const dynamic = 'force-dynamic';

export async function GET(_req, { params }) {
  const { id } = await params;
  const run = getAgentRun(id);
  return run
    ? Response.json({ run })
    : new Response('Run not found', { status: 404 });
}
