App screenPro
Agent dashboard
This code is yours with Pro. Agent dashboard and everything else.
Plus the full Detent workspace template, 14 whole screens and 21 Pro components. The source lands in your project, yours to change, in unlimited projects.
$99once
Get Pro · $99 once$99 once · lifetime updates · all sales final. Try every Pro screen live first.
Wire it up
All optional. Installed, it starts still and waits for your users; pass autoplay to play the demo you see here.
<AgentDashboard
data={data}
state={state}
title={title}
onRetryRun={(run) => {}}
onReload={() => {}}
subscribeLogs={(push) => {}}
/>// lib/agents.ts: record every generateText and streamText call
import { registerTelemetry } from "ai"
import { createAgentRecorder } from "@/components/detent/blocks/agent-dashboard/ai-sdk"
export const agents = createAgentRecorder({
pricing: { "claude-sonnet-5.5": { input: 3, output: 15 } }, // $ per 1M tokens; AI Gateway cost is read on its own
onRecord: (run) => {}, // save finished runs to your database here
})
registerTelemetry(agents.telemetry)
// Name each agent where you call the model
await generateText({ model, tools, prompt, telemetry: { functionId: "Support" } })
// app/api/agents/route.ts
import { agents } from "@/lib/agents"
export const GET = (req: Request) => {
const timeZone = new URL(req.url).searchParams.get("tz") ?? undefined // the viewer's day and hours, not the server's
return Response.json(agents.snapshot({ timeZone, cap: 40, deploys: [{ at: "2026-11-17T14:14:00Z", label: "v41" }] }))
}
// app/api/agents/logs/route.ts
import { logStream } from "@/components/detent/blocks/agent-dashboard/ai-sdk"
export const GET = (req: Request) => logStream(agents, req.signal, new URL(req.url).searchParams.get("tz") ?? undefined)
// app/agents/page.tsx
"use client"
import { useEffect, useState } from "react"
import { AgentDashboard } from "@/components/detent/blocks/agent-dashboard/AgentDashboard"
import { subscribeToLogs } from "@/components/detent/blocks/agent-dashboard/ai-sdk"
import type { AgentDashboardData } from "@/components/detent/blocks/agent-dashboard/types"
const tz = Intl.DateTimeFormat().resolvedOptions().timeZone
const logs = subscribeToLogs(`/api/agents/logs?tz=${tz}`)
export default function Page() {
const [data, setData] = useState<AgentDashboardData>()
const [failed, setFailed] = useState(false)
const load = () => fetch(`/api/agents?tz=${tz}`).then((r) => r.json()).then(setData, () => setFailed(true))
useEffect(() => void load(), [])
return <AgentDashboard data={data} autoplay={false} state={failed ? "error" : data ? "live" : "loading"} subscribeLogs={logs} onReload={() => (setFailed(false), load())} />
}
// Runs saved elsewhere? Build the same page from them:
// toDashboard(records, { cap: 40, yesterday })Your data
dataEverything it draws: runs by hour, recent runs with their steps, agents, models, tools, latency, spend, issues, deploys and logs.
AgentDashboardDatastateWhat to show while data is on its way, when there is none yet, or when it failed to load.
'live' | 'loading' | 'empty' | 'error''live'titleThe name in the header.
string'Agents'initialTabThe view it opens on.
'Overview' | 'Logs' | 'Spend''Overview'framedDraw its own rounded card. Turn off when it fills a page.
booleantrueaccentThe one accent colour. Selection, focus, links and the AI’s glow all derive from it.
string'#3a5bf6'autoplayPlays the scripted demo the site shows: it types, clicks and, in a chat, sends and approves. Leave it off in a real app. It hands over for good the moment someone touches the block.
booleanfalseclassNameAdded to the root. The block fills its container and lays itself out by its width.
stringWhat it tells you
onRetryRunCalled when a person approves a retry. Reject the promise and the sheet says the retry failed.
(run: Run) => Promise<void> | voidonReloadCalled from Try again in the error state.
() => voidsubscribeLogsStream new log lines in: call push with each line, and return a function that stops the stream.
(push: PushLog) => () => voidEvery block also takes accent, the one colour everything in it derives from; autoplay, which plays the demo until someone touches it; and className.