Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
.agentprobe/
.agentprobe.backup/
node_modules/
.tmp-agentprobe-e2e-*/
.venv/
Expand Down
190 changes: 95 additions & 95 deletions dashboard/dist/index.html

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions dashboard/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ import {
ScenarioDetailsModal,
type ScenarioDetailsTarget,
} from "./views/ScenarioDetailsModal.tsx";
import { ScoreIndexView, ScoreSessionView } from "./views/ScoreView.tsx";

type AppMode = "detecting" | "live" | "server";

Expand Down Expand Up @@ -2109,6 +2110,20 @@ function ServerDashboard() {
if (pathname === "/compare") {
return <CompareView />;
}
if (pathname === "/score") {
return <ScoreIndexView request={request} navigate={navigate} />;
}
const scoreSessionMatch = pathname.match(/^\/score\/([^/]+)\/([^/]+)$/);
if (scoreSessionMatch) {
return (
<ScoreSessionView
rubricId={decodeURIComponent(scoreSessionMatch[1] ?? "")}
dimensionId={decodeURIComponent(scoreSessionMatch[2] ?? "")}
request={request}
navigate={navigate}
/>
);
}
const scenarioMatch = pathname.match(
/^\/runs\/([^/]+)\/scenarios\/([0-9]+)$/,
);
Expand Down Expand Up @@ -2171,6 +2186,11 @@ function ServerDashboard() {
label: "Runs",
isActive: (p) => p === "/runs" || p.startsWith("/runs/"),
},
{
href: "/score",
label: "Score",
isActive: (p) => p === "/score" || p.startsWith("/score/"),
},
{
href: "/presets",
label: "Presets",
Expand Down
27 changes: 6 additions & 21 deletions dashboard/src/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,8 @@ function composeSignals(
return { signal: AbortSignal.any(signals), timeout };
}

export async function api<T>(
path: string,
init: ApiOptions = {},
): Promise<T> {
const {
budgetMs = DEFAULT_BUDGET_MS,
timeoutMs,
signal,
...rest
} = init;
export async function api<T>(path: string, init: ApiOptions = {}): Promise<T> {
const { budgetMs = DEFAULT_BUDGET_MS, timeoutMs, signal, ...rest } = init;
const headers: Record<string, string> = { accept: "application/json" };
const incomingHeaders = new Headers(rest.headers);
for (const [key, value] of incomingHeaders.entries()) {
Expand All @@ -88,11 +80,7 @@ export async function api<T>(
}

const elapsed = performance.now() - start;
if (
import.meta.env.DEV &&
Number.isFinite(budgetMs) &&
elapsed > budgetMs
) {
if (import.meta.env.DEV && Number.isFinite(budgetMs) && elapsed > budgetMs) {
const serverTiming = response.headers.get("server-timing");
console.warn(
`[budget] ${path} took ${elapsed.toFixed(0)}ms (budget ${budgetMs}ms)` +
Expand Down Expand Up @@ -127,10 +115,7 @@ export function jsonBody(method: string, body?: unknown): RequestInit {
}

export function useServerRequest(): ServerRequest {
return useCallback(
async <T>(path: string, init?: ApiOptions): Promise<T> => {
return await api<T>(path, init);
},
[],
);
return useCallback(async <T>(path: string, init?: ApiOptions): Promise<T> => {
return await api<T>(path, init);
}, []);
}
Loading
Loading