page.tsx18 lines · main
1import { apiJson } from '@/lib/api';
2import { apiOrigin } from '@/lib/env';
3
4import { AgentsBoard, type AgentsPayload } from './agents-client';
5
6export const metadata = { title: 'ai agents · admin' };
7export const dynamic = 'force-dynamic';
8
9/**
10 * AI agents — thin server shell. Fetches the first agent list server-side
11 * (instant paint, cookies forwarded by apiFetch) and hands off to the client
12 * board, which refetches after every mutation using the same api-origin +
13 * credentials pattern the mcp page's client controls use.
14 */
15export default async function AdminAgentsPage() {
16 const initial = await apiJson<AgentsPayload>('/v1/admin/agents').catch(() => null);
17 return <AgentsBoard apiOrigin={apiOrigin} initial={initial} />;
18}