import { proxyWorker, withOwnedJob } from '@/lib/agent-worker-proxy';

export const POST = async (
  request: Request,
  context: { params: Promise<{ jobId: string }> },
) =>
  await withOwnedJob(
    context,
    async (jobId) =>
      await proxyWorker(jobId, 'run-command', {
        method: 'POST',
        body: await request.text(),
      }),
  );
