page.tsx18 lines · main
| 1 | import { apiJson } from '@/lib/api'; |
| 2 | import { apiOrigin } from '@/lib/env'; |
| 3 | |
| 4 | import { AgentsBoard, type AgentsPayload } from './agents-client'; |
| 5 | |
| 6 | export const metadata = { title: 'ai agents · admin' }; |
| 7 | export 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 | */ |
| 15 | export default async function AdminAgentsPage() { |
| 16 | const initial = await apiJson<AgentsPayload>('/v1/admin/agents').catch(() => null); |
| 17 | return <AgentsBoard apiOrigin={apiOrigin} initial={initial} />; |
| 18 | } |