@crowandraven/evalkeeper 0.17.1 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/decisions.js +1 -1
- package/dist/decisions.js.map +1 -1
- package/dist/drafts.d.ts +2 -0
- package/dist/drafts.js +1 -1
- package/dist/drafts.js.map +1 -1
- package/dist/glossary.d.ts +25 -14
- package/dist/glossary.js +25 -14
- package/dist/glossary.js.map +1 -1
- package/dist/health.js +2 -2
- package/dist/health.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/memoryStore.d.ts +2 -1
- package/dist/memoryStore.js +9 -0
- package/dist/memoryStore.js.map +1 -1
- package/dist/next/actions.js +58 -3
- package/dist/next/actions.js.map +1 -1
- package/dist/prisma/contracts.d.ts +5 -2
- package/dist/prisma/contracts.js +7 -1
- package/dist/prisma/contracts.js.map +1 -1
- package/dist/prisma/index.d.ts +40 -1
- package/dist/prisma/index.js +37 -1
- package/dist/prisma/index.js.map +1 -1
- package/dist/prune.d.ts +43 -10
- package/dist/prune.js +42 -13
- package/dist/prune.js.map +1 -1
- package/dist/react/AddCase.js +11 -5
- package/dist/react/AddCase.js.map +1 -1
- package/dist/react/AnswerKey.js +7 -4
- package/dist/react/AnswerKey.js.map +1 -1
- package/dist/react/CaseMenu.d.ts +2 -2
- package/dist/react/CaseMenu.js +10 -31
- package/dist/react/CaseMenu.js.map +1 -1
- package/dist/react/CompareView.js +3 -3
- package/dist/react/CompareView.js.map +1 -1
- package/dist/react/ConfirmAnswer.js +1 -1
- package/dist/react/ConfirmAnswer.js.map +1 -1
- package/dist/react/Drawer.d.ts +32 -0
- package/dist/react/Drawer.js +60 -0
- package/dist/react/Drawer.js.map +1 -0
- package/dist/react/HubSections.d.ts +34 -30
- package/dist/react/HubSections.js +104 -103
- package/dist/react/HubSections.js.map +1 -1
- package/dist/react/Menu.d.ts +37 -0
- package/dist/react/Menu.js +51 -0
- package/dist/react/Menu.js.map +1 -0
- package/dist/react/ModelMenu.d.ts +1 -1
- package/dist/react/ModelMenu.js +8 -32
- package/dist/react/ModelMenu.js.map +1 -1
- package/dist/react/RunView.js +24 -4
- package/dist/react/RunView.js.map +1 -1
- package/dist/react/Spending.d.ts +25 -0
- package/dist/react/Spending.js +51 -0
- package/dist/react/Spending.js.map +1 -0
- package/dist/react/SuiteSections.d.ts +27 -14
- package/dist/react/SuiteSections.js +227 -61
- package/dist/react/SuiteSections.js.map +1 -1
- package/dist/react/app.d.ts +18 -0
- package/dist/react/app.js.map +1 -1
- package/dist/react/format.d.ts +13 -0
- package/dist/react/format.js +13 -0
- package/dist/react/format.js.map +1 -1
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.js +3 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/pieces.d.ts +21 -8
- package/dist/react/pieces.js +44 -14
- package/dist/react/pieces.js.map +1 -1
- package/dist/runner.d.ts +18 -8
- package/dist/runner.js +148 -12
- package/dist/runner.js.map +1 -1
- package/dist/settings.d.ts +12 -0
- package/dist/settings.js +18 -0
- package/dist/settings.js.map +1 -1
- package/dist/spending.d.ts +100 -0
- package/dist/spending.js +133 -0
- package/dist/spending.js.map +1 -0
- package/dist/stats.d.ts +3 -1
- package/dist/stats.js +6 -2
- package/dist/stats.js.map +1 -1
- package/dist/store.d.ts +5 -0
- package/dist/suggest.js +17 -12
- package/dist/suggest.js.map +1 -1
- package/dist/suiteSettings.d.ts +78 -0
- package/dist/suiteSettings.js +142 -0
- package/dist/suiteSettings.js.map +1 -0
- package/dist/suites/crisisRisk.js +3 -3
- package/dist/suites/crisisRisk.js.map +1 -1
- package/dist/suites/hopelessness.js +6 -6
- package/dist/suites/hopelessness.js.map +1 -1
- package/dist/suites/injection.js +2 -2
- package/dist/suites/injection.js.map +1 -1
- package/dist/summary.d.ts +41 -4
- package/dist/summary.js +46 -8
- package/dist/summary.js.map +1 -1
- package/dist/testing.d.ts +19 -0
- package/dist/testing.js +61 -0
- package/dist/testing.js.map +1 -1
- package/dist/todo.d.ts +146 -0
- package/dist/todo.js +198 -0
- package/dist/todo.js.map +1 -0
- package/dist/types.d.ts +46 -7
- package/dist/types.js +28 -4
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/schema/evalkeeper.prisma +13 -0
- package/src/decisions.ts +1 -1
- package/src/drafts.ts +3 -1
- package/src/glossary.ts +35 -14
- package/src/health.ts +3 -2
- package/src/index.ts +3 -0
- package/src/memoryStore.ts +15 -1
- package/src/next/actions.ts +67 -2
- package/src/prisma/contracts.ts +16 -1
- package/src/prisma/index.ts +68 -1
- package/src/prune.ts +71 -14
- package/src/react/AddCase.tsx +13 -11
- package/src/react/AnswerKey.tsx +17 -5
- package/src/react/CaseMenu.tsx +23 -77
- package/src/react/CompareView.tsx +4 -10
- package/src/react/ConfirmAnswer.tsx +1 -1
- package/src/react/Drawer.tsx +130 -0
- package/src/react/HubSections.tsx +180 -414
- package/src/react/Menu.tsx +155 -0
- package/src/react/ModelMenu.tsx +23 -74
- package/src/react/RunView.tsx +46 -3
- package/src/react/Spending.tsx +200 -0
- package/src/react/SuiteSections.tsx +591 -148
- package/src/react/app.ts +18 -0
- package/src/react/format.ts +15 -0
- package/src/react/index.ts +3 -0
- package/src/react/pieces.tsx +57 -18
- package/src/runner.ts +199 -13
- package/src/settings.ts +20 -0
- package/src/spending.ts +209 -0
- package/src/stats.ts +8 -2
- package/src/store.ts +5 -0
- package/src/suggest.ts +21 -14
- package/src/suiteSettings.ts +201 -0
- package/src/suites/crisisRisk.ts +3 -3
- package/src/suites/hopelessness.ts +6 -6
- package/src/suites/injection.ts +2 -2
- package/src/summary.ts +59 -8
- package/src/testing.ts +77 -0
- package/src/todo.ts +318 -0
- package/src/types.ts +63 -9
- package/starter/index.ts +7 -0
- package/templates/lib/evalkeeper/actions.ts +20 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type HistoryEntry, type Settings, type SettingsVersion } from "../index.js";
|
|
2
1
|
import { type EvalAppConfig } from "./app.js";
|
|
3
2
|
/**
|
|
4
3
|
* Everything the evals hub shows, loaded together. Sections read from
|
|
@@ -10,19 +9,12 @@ export declare function loadHub(app: EvalAppConfig): Promise<{
|
|
|
10
9
|
suite: import("../types.js").AnySuite;
|
|
11
10
|
route: import("../runner.js").Route;
|
|
12
11
|
cases: number;
|
|
13
|
-
caseResults: Record<string,
|
|
14
|
-
passed: number;
|
|
15
|
-
models: number;
|
|
16
|
-
}>;
|
|
12
|
+
caseResults: Record<string, import("../prune.js").CaseResult>;
|
|
17
13
|
provisional: number;
|
|
18
14
|
rows: import("../board.js").BoardRow[];
|
|
19
15
|
liveRunId: string | null;
|
|
20
16
|
}[];
|
|
21
17
|
weekly: import("../weekly.js").WeeklySummary;
|
|
22
|
-
histories: [HistoryEntry[], {
|
|
23
|
-
settings: Settings;
|
|
24
|
-
version: SettingsVersion | null;
|
|
25
|
-
}][];
|
|
26
18
|
thumbs: import("../feedback.js").ThumbsSummary[];
|
|
27
19
|
down: number;
|
|
28
20
|
waiting: number;
|
|
@@ -31,42 +23,54 @@ export declare function loadHub(app: EvalAppConfig): Promise<{
|
|
|
31
23
|
suite: import("../types.js").AnySuite;
|
|
32
24
|
route: import("../runner.js").Route;
|
|
33
25
|
cases: number;
|
|
34
|
-
caseResults: Record<string,
|
|
35
|
-
passed: number;
|
|
36
|
-
models: number;
|
|
37
|
-
}>;
|
|
26
|
+
caseResults: Record<string, import("../prune.js").CaseResult>;
|
|
38
27
|
provisional: number;
|
|
39
28
|
rows: import("../board.js").BoardRow[];
|
|
40
29
|
liveRunId: string | null;
|
|
41
30
|
}[];
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
suites: {
|
|
32
|
+
suite: import("../types.js").AnySuite;
|
|
33
|
+
board: {
|
|
44
34
|
suite: import("../types.js").AnySuite;
|
|
45
35
|
route: import("../runner.js").Route;
|
|
46
36
|
cases: number;
|
|
47
|
-
caseResults: Record<string,
|
|
48
|
-
passed: number;
|
|
49
|
-
models: number;
|
|
50
|
-
}>;
|
|
37
|
+
caseResults: Record<string, import("../prune.js").CaseResult>;
|
|
51
38
|
provisional: number;
|
|
52
39
|
rows: import("../board.js").BoardRow[];
|
|
53
40
|
liveRunId: string | null;
|
|
54
41
|
};
|
|
55
|
-
|
|
42
|
+
todos: import("../todo.js").Todo[];
|
|
43
|
+
status: import("../todo.js").SuiteStatus;
|
|
44
|
+
settings: {
|
|
45
|
+
settings: import("../settings.js").Settings;
|
|
46
|
+
version: import("../settings.js").SettingsVersion | null;
|
|
47
|
+
} | null;
|
|
56
48
|
}[];
|
|
57
|
-
|
|
49
|
+
spending: import("../spending.js").SpendingReading | null;
|
|
58
50
|
}>;
|
|
59
51
|
/** What `loadHub` returns, for sections and custom pages. */
|
|
60
52
|
export type HubData = Awaited<ReturnType<typeof loadHub>>;
|
|
61
|
-
/**
|
|
62
|
-
|
|
63
|
-
|
|
53
|
+
/**
|
|
54
|
+
* What the evals hub is for, with its menu (Spending and daily limits)
|
|
55
|
+
* beside the title, and spending when it needs room: over a limit,
|
|
56
|
+
* stopped, or a test running.
|
|
57
|
+
*/
|
|
58
|
+
export declare function HubIntro({ data }: {
|
|
59
|
+
data?: HubData;
|
|
60
|
+
}): import("react").JSX.Element;
|
|
61
|
+
/**
|
|
62
|
+
* Thumbs down people gave this week, in one line linking to them, shown
|
|
63
|
+
* only when there's something to look at. The hub's one number: the rest
|
|
64
|
+
* (cost, speed, scores) is on each suite's page.
|
|
65
|
+
*/
|
|
64
66
|
export declare function HubStats({ data }: {
|
|
65
67
|
data: HubData;
|
|
66
|
-
}): import("react").JSX.Element;
|
|
68
|
+
}): import("react").JSX.Element | null;
|
|
67
69
|
/**
|
|
68
|
-
* One
|
|
69
|
-
*
|
|
70
|
+
* One short row per feature, its name and status, with what needs you
|
|
71
|
+
* first: Needs attention, then Can't tell yet, then Healthy. Each row
|
|
72
|
+
* opens the suite's page, where its to-do list and details are. An
|
|
73
|
+
* injection suite counts on its base feature's row.
|
|
70
74
|
*/
|
|
71
75
|
export declare function SuiteList({ data }: {
|
|
72
76
|
data: HubData;
|
|
@@ -79,9 +83,9 @@ export declare function NoEvalYet({ data }: {
|
|
|
79
83
|
data: HubData;
|
|
80
84
|
}): import("react").JSX.Element | null;
|
|
81
85
|
/**
|
|
82
|
-
* The hub as Evalkeeper arranges it: where each suite stands
|
|
83
|
-
*
|
|
84
|
-
*
|
|
86
|
+
* The hub as Evalkeeper arranges it: where each suite stands, in one row
|
|
87
|
+
* each. A hub of your own loads the same data (`loadHub`) and arranges
|
|
88
|
+
* these sections another way.
|
|
85
89
|
*/
|
|
86
90
|
export declare function HubPage({ app }: {
|
|
87
91
|
app: EvalAppConfig;
|
|
@@ -1,136 +1,137 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
2
|
-
import { attacksFrom,
|
|
3
|
-
import { Link, Card, InfoTip,
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { ChevronDown } from "lucide-react";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { answerKeyHealth, attacksFrom, currentSettings, isInjectionSuite, priorityOf, replacedStarters, SUITE_STATUS_LABEL, SUITE_STATUS_ORDER, suiteStatus, suiteTodos, targetCasesOf, thumbsSummary, } from "../index.js";
|
|
3
|
+
import { Link, Card, InfoTip, SuiteStatusBadge } from "./pieces.js";
|
|
4
|
+
import { LINK } from "./format.js";
|
|
5
|
+
import { daysAgo, evalsPath, loadWeekly } from "./app.js";
|
|
6
|
+
import { ChevronRight } from "lucide-react";
|
|
8
7
|
import { WeeklyCheck } from "./WeeklyCheck.js";
|
|
8
|
+
import { InfoPopover } from "./InfoPopover.js";
|
|
9
|
+
import { GLOSSARY } from "../glossary.js";
|
|
10
|
+
import { PageMenu } from "./Drawer.js";
|
|
11
|
+
import { SpendingAlert, SpendingForm } from "./Spending.js";
|
|
9
12
|
/**
|
|
10
13
|
* Everything the evals hub shows, loaded together. Sections read from
|
|
11
14
|
* this, so a hub of your own loads the same data once.
|
|
12
15
|
*/
|
|
13
16
|
export async function loadHub(app) {
|
|
14
|
-
const [boards, weekly] = await Promise.all([
|
|
17
|
+
const [boards, weekly, feedback, spending] = await Promise.all([
|
|
15
18
|
Promise.all(app.suites.map((s) => app.runner.board(s.key))),
|
|
16
19
|
loadWeekly(app),
|
|
20
|
+
app.feedbackStore.listFeedback(),
|
|
21
|
+
// The hub must load even when spending can't be read.
|
|
22
|
+
app.spending ? app.spending.read().catch(() => null) : null,
|
|
17
23
|
]);
|
|
18
|
-
const
|
|
19
|
-
app.settings.history(s.operation),
|
|
20
|
-
app.settings.current(s.operation),
|
|
21
|
-
])));
|
|
22
|
-
const thumbs = thumbsSummary(await app.feedbackStore.listFeedback(), daysAgo(7));
|
|
24
|
+
const thumbs = thumbsSummary(feedback, daysAgo(7));
|
|
23
25
|
const down = thumbs.reduce((t, s) => t + s.down, 0);
|
|
24
26
|
const waiting = thumbs.reduce((t, s) => t + s.open, 0);
|
|
25
27
|
const flagged = thumbs.filter((s) => s.alert).length;
|
|
26
|
-
// An injection suite shows on its base suite's
|
|
28
|
+
// An injection suite shows on its base suite's row, not its own.
|
|
27
29
|
const attacksOn = (key) => boards.filter((x) => isInjectionSuite(x.suite) && x.suite.base.key === key);
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
const features = boards.filter((b) => !isInjectionSuite(b.suite));
|
|
31
|
+
const suites = await Promise.all(features.map(async (b) => {
|
|
32
|
+
const { suite } = b;
|
|
33
|
+
const [current, saved, cases] = await Promise.all([
|
|
34
|
+
// One feature with no settings yet mustn't break the hub.
|
|
35
|
+
currentSettings(app.settings, suite.operation),
|
|
36
|
+
app.runner.suiteSettings(suite.key),
|
|
37
|
+
app.store.listCases(suite.key),
|
|
38
|
+
]);
|
|
39
|
+
const attacked = attacksOn(suite.key);
|
|
40
|
+
const tested = b.rows.filter((r) => r.test && !r.test.stale && !r.baseline);
|
|
41
|
+
const testedAt = tested.reduce((m, r) => (r.test && (!m || r.test.at > m) ? r.test.at : m), null);
|
|
42
|
+
const input = {
|
|
43
|
+
rows: b.rows,
|
|
44
|
+
checks: suite.checks,
|
|
45
|
+
priority: priorityOf(suite, current?.settings),
|
|
46
|
+
models: app.models,
|
|
47
|
+
attacks: attacksFrom(attacked),
|
|
48
|
+
cases: b.cases,
|
|
49
|
+
provisional: b.provisional,
|
|
50
|
+
target: targetCasesOf(suite, saved),
|
|
51
|
+
unmadeAttacks: app.actions.makeAttackCases
|
|
52
|
+
? attacked
|
|
53
|
+
.filter((a) => a.cases === 0)
|
|
54
|
+
.map((a) => ({ key: a.suite.key, label: a.suite.label }))
|
|
55
|
+
: [],
|
|
56
|
+
replacedStarters: replacedStarters(suite, cases).length,
|
|
57
|
+
splitCases: answerKeyHealth(cases, b.caseResults, new Date(), testedAt)
|
|
58
|
+
.split.length,
|
|
59
|
+
};
|
|
60
|
+
const todos = suiteTodos(input);
|
|
61
|
+
return {
|
|
62
|
+
suite,
|
|
63
|
+
board: b,
|
|
64
|
+
todos,
|
|
65
|
+
status: suiteStatus(input, todos),
|
|
66
|
+
settings: current,
|
|
67
|
+
};
|
|
68
|
+
}));
|
|
37
69
|
return {
|
|
38
70
|
app,
|
|
39
71
|
boards,
|
|
40
72
|
weekly,
|
|
41
|
-
histories,
|
|
42
73
|
thumbs,
|
|
43
74
|
down,
|
|
44
75
|
waiting,
|
|
45
76
|
flagged,
|
|
46
77
|
attacksOn,
|
|
47
|
-
|
|
48
|
-
|
|
78
|
+
suites,
|
|
79
|
+
spending,
|
|
49
80
|
};
|
|
50
81
|
}
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
|
|
82
|
+
/**
|
|
83
|
+
* What the evals hub is for, with its menu (Spending and daily limits)
|
|
84
|
+
* beside the title, and spending when it needs room: over a limit,
|
|
85
|
+
* stopped, or a test running.
|
|
86
|
+
*/
|
|
87
|
+
export function HubIntro({ data }) {
|
|
88
|
+
const app = data?.app;
|
|
89
|
+
const spending = data?.spending ?? null;
|
|
90
|
+
const entries = app && spending && app.actions.saveLimits
|
|
91
|
+
? [
|
|
92
|
+
{
|
|
93
|
+
key: "spending",
|
|
94
|
+
label: "Spending and daily limits",
|
|
95
|
+
body: _jsx(SpendingForm, { app: app, reading: spending }),
|
|
96
|
+
},
|
|
97
|
+
]
|
|
98
|
+
: [];
|
|
99
|
+
return (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "space-y-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-4", children: [_jsx("h1", { className: "text-2xl font-semibold", children: "Evals" }), _jsx(PageMenu, { label: "Evals menu", entries: entries })] }), _jsx("p", { className: "readable text-muted", children: "Each suite tests one AI feature against answers people confirmed. Test models on it, then pick the live one on evidence." })] }), app && _jsx(SpendingAlert, { app: app, reading: spending })] }));
|
|
54
100
|
}
|
|
55
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* Thumbs down people gave this week, in one line linking to them, shown
|
|
103
|
+
* only when there's something to look at. The hub's one number: the rest
|
|
104
|
+
* (cost, speed, scores) is on each suite's page.
|
|
105
|
+
*/
|
|
56
106
|
export function HubStats({ data }) {
|
|
57
|
-
const { app, down, waiting, flagged
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
? `${needs.slowest.label} on ${needs.slowest.model}`
|
|
64
|
-
: "—" }), _jsx(Stat, { title: "Costliest live model", term: "costliest", value: needs.costliest ? perAnswer(needs.costliest.usd) : "—", detail: needs.costliest
|
|
65
|
-
? `${needs.costliest.label} on ${needs.costliest.model}`
|
|
66
|
-
: "—" }), _jsx(Link, { href: evalsPath(app, "feedback"), className: "block h-full", children: _jsx(Stat, { title: "Thumbs down this week", term: "thumbs", value: String(down), detail: flagged
|
|
67
|
-
? `${flagged} feature${flagged === 1 ? "" : "s"} need a look · ${waiting} waiting`
|
|
68
|
-
: `${waiting} waiting for a look` }) })] }) }));
|
|
107
|
+
const { app, down, waiting, flagged } = data;
|
|
108
|
+
if (!down && !waiting)
|
|
109
|
+
return null;
|
|
110
|
+
return (_jsxs("p", { className: "text-sm", children: [_jsxs(Link, { href: evalsPath(app, "feedback"), className: LINK, children: [down, " thumbs down this week"] }), _jsx(InfoTip, { term: "thumbs" }), _jsxs("span", { className: "text-muted", children: [" ", "\u00B7 ", waiting, " waiting for a look", flagged
|
|
111
|
+
? ` · ${flagged} feature${flagged === 1 ? "" : "s"} need a look`
|
|
112
|
+
: ""] })] }));
|
|
69
113
|
}
|
|
70
114
|
/**
|
|
71
|
-
* One
|
|
72
|
-
*
|
|
115
|
+
* One short row per feature, its name and status, with what needs you
|
|
116
|
+
* first: Needs attention, then Can't tell yet, then Healthy. Each row
|
|
117
|
+
* opens the suite's page, where its to-do list and details are. An
|
|
118
|
+
* injection suite counts on its base feature's row.
|
|
73
119
|
*/
|
|
74
120
|
export function SuiteList({ data }) {
|
|
75
|
-
const { app,
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
const [history, current] = histories[i] ?? [[], null];
|
|
79
|
-
const health = suiteHealth(b.rows, b.suite.checks, priorityOf(b.suite, current?.settings), b.cases, b.provisional, app.models, { attacks: attacksFrom(attacked) });
|
|
80
|
-
return { b, attacked, history, current, health };
|
|
81
|
-
});
|
|
82
|
-
const card = (c) => (_jsx(SuiteCard, { app: app, board: c.b, attacked: c.attacked, health: c.health, history: c.history, current: c.current }, c.b.suite.key));
|
|
83
|
-
return (_jsxs("section", { "aria-labelledby": "suites", className: "space-y-3", children: [_jsxs("h2", { id: "suites", className: "text-lg font-semibold", children: ["Suites", _jsx(InfoTip, { term: "suites" })] }), cards.length === 0 && _jsx(NoSuites, {}), STANDING_ORDER.map((standing) => {
|
|
84
|
-
const group = all.filter((c) => c.health.standing === standing);
|
|
85
|
-
if (!group.length)
|
|
86
|
-
return null;
|
|
87
|
-
const heading = (_jsxs("span", { className: "flex items-center gap-2 text-sm text-muted", children: [_jsx(StandingBadge, { standing: standing }), group.length, " ", group.length === 1 ? "suite" : "suites"] }));
|
|
88
|
-
return (_jsxs("div", { role: "group", "aria-label": STANDING_LABEL[standing], className: "space-y-3 pt-2", children: [heading, _jsx("div", { className: "space-y-4", children: group.map(card) })] }, standing));
|
|
89
|
-
})] }));
|
|
121
|
+
const { app, suites } = data;
|
|
122
|
+
const ordered = SUITE_STATUS_ORDER.flatMap((status) => suites.filter((s) => s.status === status));
|
|
123
|
+
return (_jsxs("section", { "aria-labelledby": "suites", className: "space-y-3", children: [_jsxs("div", { className: "flex items-center", children: [_jsx("h2", { id: "suites", className: "text-lg font-semibold", children: "Suites" }), _jsxs(InfoPopover, { label: "About suites and their status", children: [_jsx("p", { className: "text-muted", children: GLOSSARY.suites }), _jsx("ul", { className: "space-y-1", children: SUITE_STATUS_ORDER.map((status) => (_jsxs("li", { children: [_jsxs("strong", { children: [SUITE_STATUS_LABEL[status], ":"] }), " ", STATUS_MEANS[status]] }, status))) })] })] }), suites.length === 0 ? (_jsx(NoSuites, {})) : (_jsx("ul", { className: "divide-y divide-line overflow-hidden rounded-lg border border-line bg-card", children: ordered.map((s) => (_jsx("li", { children: _jsxs(Link, { href: evalsPath(app, s.suite.key), className: "flex items-center justify-between gap-4 px-4 py-3 hover:bg-tint", title: `${s.suite.label}: ${SUITE_STATUS_LABEL[s.status]}`, children: [_jsx("span", { className: "min-w-0 truncate font-medium", children: s.suite.label }), _jsxs("span", { className: "flex shrink-0 items-center gap-2", children: [_jsx(SuiteStatusBadge, { status: s.status }), _jsx(ChevronRight, { "aria-hidden": true, className: "h-4 w-4 text-muted" })] })] }) }, s.suite.key))) }))] }));
|
|
90
124
|
}
|
|
125
|
+
/** What each status means, for the Suites heading's info. */
|
|
126
|
+
const STATUS_MEANS = {
|
|
127
|
+
attention: "something is on the suite's to-do list.",
|
|
128
|
+
unknown: "no model tested yet, or too few cases to judge.",
|
|
129
|
+
healthy: "nothing to do.",
|
|
130
|
+
};
|
|
91
131
|
/** Before the first suite: what a suite is, and how to add one. */
|
|
92
132
|
function NoSuites() {
|
|
93
133
|
return (_jsxs(Card, { className: "readable space-y-3 text-sm", children: [_jsx("p", { className: "font-semibold", children: "No suites yet" }), _jsx("p", { className: "text-muted", children: "A suite tests one AI feature: its cases, the answers a person confirms, and the checks that grade any model against them. To add one:" }), _jsxs("ol", { className: "list-decimal space-y-2 pl-4", children: [_jsxs("li", { children: ["Write it: the input and answer shapes with zod, two or three checks,", " ", _jsx("code", { children: "run" }), ", and ", _jsx("code", { children: "grade" }), "."] }), _jsxs("li", { children: ["Add it to ", _jsx("code", { children: "app.suites" }), " in", " ", _jsx("code", { children: "lib/evalkeeper/index.ts" }), ", with its instructions hash."] }), _jsxs("li", { children: ["Add cases (here, or with ", _jsx("code", { children: "importCases" }), " from files you have), confirm their answers, and test models."] })] }), _jsxs("p", { className: "text-muted", children: ["Step by step:", " ", _jsx("a", { href: "https://seanhudson.github.io/evalkeeper/start/adding-to-your-app/#5-write-your-first-suite", target: "_blank", rel: "noreferrer", className: "underline", children: "Write your first suite" }), "."] })] }));
|
|
94
134
|
}
|
|
95
|
-
function Stat({ title, term, value, detail, }) {
|
|
96
|
-
return (
|
|
97
|
-
// Full height, so the four cards line up however much each says.
|
|
98
|
-
_jsxs(Card, { className: "h-full space-y-1", children: [_jsxs("p", { className: "text-sm text-muted", children: [title, _jsx(InfoTip, { term: term })] }), _jsx("p", { className: "text-2xl font-semibold tabular-nums", children: value }), _jsx("p", { className: "text-sm text-muted", children: detail })] }));
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* The live model's check furthest under its bar, as a bar with a tick at
|
|
102
|
-
* the bar, so a card shows how far off it is, not only that it is.
|
|
103
|
-
*/
|
|
104
|
-
function WorstCheck({ worst: w, }) {
|
|
105
|
-
return (_jsxs("div", { className: "flex flex-wrap items-center gap-3 text-sm text-muted", children: [_jsxs("span", { children: [w.label, w.serious ? " (serious)" : "", " ", _jsx("span", { className: `font-semibold ${w.serious ? "text-bad" : "text-warn"}`, children: pct(w.rate) })] }), _jsxs("span", { "aria-hidden": true, className: "relative h-1.5 w-40 rounded-full bg-tint", children: [_jsx("span", { className: `absolute inset-y-0 left-0 rounded-full ${w.serious ? "bg-bad" : "bg-warn"}`, style: { width: `${Math.round(w.rate * 100)}%` } }), _jsx("span", { className: "absolute -inset-y-1 w-px bg-ink", style: { left: `${Math.round(w.bar * 100)}%` } })] }), _jsxs("span", { children: ["bar ", pct(w.bar), _jsx(InfoTip, { term: "bar" })] })] }));
|
|
106
|
-
}
|
|
107
|
-
/** Green at 95% and up, amber from 80%, red below. */
|
|
108
|
-
const scoreTone = (rate) => rate >= 0.95 ? "text-good" : rate >= 0.8 ? "text-warn" : "text-bad";
|
|
109
|
-
/**
|
|
110
|
-
* One feature on the hub: its live version and models, what the live
|
|
111
|
-
* model costs and how fast it is, its latest test, how it does under
|
|
112
|
-
* attack, what needs a look, and its settings history.
|
|
113
|
-
*/
|
|
114
|
-
function SuiteCard({ app, board: b, attacked, health: h, history, current, }) {
|
|
115
|
-
const label = (model) => app.models[model]?.label ?? model;
|
|
116
|
-
const live = b.rows.find((r) => r.live && !r.variant);
|
|
117
|
-
const t = live?.test;
|
|
118
|
-
const version = current?.version ?? null;
|
|
119
|
-
const since = version
|
|
120
|
-
? (history.find((e) => e.to.id === version.id)?.createdAt ??
|
|
121
|
-
version.createdAt)
|
|
122
|
-
: null;
|
|
123
|
-
const s = current?.settings;
|
|
124
|
-
const price = s ? app.models[s.model] : undefined;
|
|
125
|
-
const versions = Math.max(1, ...history.map((e) => e.to.number));
|
|
126
|
-
return (_jsxs(Card, { className: "relative space-y-4 transition-colors hover:border-muted", children: [_jsxs("div", { className: "flex flex-wrap items-start justify-between gap-4", children: [_jsxs("div", { className: "min-w-0 space-y-2", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("h2", { className: "font-semibold", children: _jsx(Link, { href: evalsPath(app, b.suite.key), className: "after:absolute after:inset-0 after:rounded-lg", children: b.suite.label }) }), _jsx(StandingBadge, { standing: h.standing }), _jsx(InfoTip, { term: "standing" })] }), _jsx(HealthReasons, { flags: h.flags }), _jsx("p", { className: "readable text-sm text-muted", children: b.suite.description })] }), t && (_jsxs("div", { className: "shrink-0 space-y-0.5 text-right text-sm", children: [_jsxs("p", { className: "font-semibold tabular-nums", children: [perAnswer(t.costPerAnswer), " / answer"] }), _jsxs("p", { className: "text-xs text-muted", children: [seconds(t.avgMs), " avg"] }), price?.inputPer1M !== undefined &&
|
|
127
|
-
price.outputPer1M !== undefined && (_jsxs("p", { className: "text-xs text-muted", children: ["$", price.inputPer1M, " / $", price.outputPer1M, " per 1M"] }))] }))] }), _jsxs("div", { className: "space-y-1", children: [s && (_jsxs("p", { className: "text-sm text-muted", children: [_jsx("span", { className: "font-semibold text-ink", children: label(s.model) }), s.fallbackModel ? (_jsxs(_Fragment, { children: [" ", "\u00B7 fallback", " ", _jsx("span", { className: "font-semibold text-ink", children: label(s.fallbackModel) })] })) : (" · no fallback"), s.reasoningEffort ? ` · reasoning ${s.reasoningEffort}` : ""] })), _jsxs("p", { className: "text-sm", children: [t ? (_jsxs(_Fragment, { children: ["Accuracy", " ", _jsx("span", { className: `font-semibold ${scoreTone(t.right / t.total)}`, children: pct(t.right / t.total) })] })) : ("Live model not tested yet"), " ", "\u00B7 ", b.cases, " cases \u00B7 ", h.testedModels, " models tested"] }), h.worst && _jsx(WorstCheck, { worst: h.worst })] }), h.details.length > 0 && (_jsx("ul", { className: "readable list-disc space-y-1 pl-5 text-sm text-muted", children: h.details.slice(0, 3).map((d) => (_jsx("li", { children: d }, d))) })), attacked
|
|
128
|
-
.filter((a) => a.cases > 0)
|
|
129
|
-
.map((a) => {
|
|
130
|
-
const r = live ? attacksResisted(live.key, [a]) : null;
|
|
131
|
-
return (_jsxs("p", { className: "relative text-sm", children: ["Attacks resisted", _jsx(InfoTip, { term: "attacksResisted" }), ":", " ", r === null ? (_jsx("span", { className: "text-muted", children: "not tested yet" })) : (_jsx(Link, { href: evalsPath(app, a.suite.key), className: `font-semibold hover:underline ${scoreTone(r.resisted / r.of)}`, children: pct(r.resisted / r.of) })), " ", "of ", a.cases, " ", a.cases === 1 ? "attack" : "attacks"] }, a.suite.key));
|
|
132
|
-
}), s && (_jsxs("details", { className: "group/history relative rounded-md bg-tint", children: [_jsxs("summary", { className: "flex list-none items-center justify-between gap-2 p-3 text-sm font-medium", children: ["Versions", _jsxs("span", { className: "flex items-center gap-1 text-xs font-normal text-muted", children: [_jsxs("span", { className: "font-medium text-ink", children: ["v", version?.number ?? 1] }), " ", since ? (_jsxs(_Fragment, { children: ["live since ", _jsx(LocalDate, { date: since })] })) : ("defaults from code"), " ", "\u00B7 ", versions, " version", versions === 1 ? "" : "s", _jsx(ChevronDown, { "aria-hidden": true, className: "h-4 w-4 transition-transform group-open/history:rotate-180" })] })] }), _jsx("div", { className: "px-3 pb-3", children: _jsx(HistoryEntries, { app: app, suite: b.suite.key, entries: history, liveId: version?.id ?? null, label: label, defaults: s, plain: true }) })] }))] }));
|
|
133
|
-
}
|
|
134
135
|
/**
|
|
135
136
|
* The AI features no suite tests yet, from your app's `features`: where
|
|
136
137
|
* an eval would tell you the most next. Shows nothing without them.
|
|
@@ -141,15 +142,15 @@ export function NoEvalYet({ data }) {
|
|
|
141
142
|
const gaps = (app.features ?? []).filter((f) => !tested.has(f.operation));
|
|
142
143
|
if (!gaps.length)
|
|
143
144
|
return null;
|
|
144
|
-
return (_jsxs("section", { "aria-labelledby": "no-eval-yet", className: "space-y-2", children: [
|
|
145
|
+
return (_jsxs("section", { "aria-labelledby": "no-eval-yet", className: "space-y-2", children: [_jsxs("h2", { id: "no-eval-yet", className: "text-lg font-semibold", children: ["No eval yet", _jsx(InfoTip, { term: "noEvalYet" })] }), _jsxs("p", { className: "readable text-sm text-muted", children: ["Nothing tells you yet whether", " ", gaps.length === 1 ? "this feature" : "these features", " got worse."] }), _jsx("ul", { className: "space-y-3", children: gaps.map((f) => (_jsx("li", { children: _jsxs(Card, { className: "space-y-1 py-3", children: [_jsx("p", { className: "font-semibold", children: f.label }), f.description && (_jsx("p", { className: "readable text-sm text-muted", children: f.description }))] }) }, f.operation))) })] }));
|
|
145
146
|
}
|
|
146
147
|
/**
|
|
147
|
-
* The hub as Evalkeeper arranges it: where each suite stands
|
|
148
|
-
*
|
|
149
|
-
*
|
|
148
|
+
* The hub as Evalkeeper arranges it: where each suite stands, in one row
|
|
149
|
+
* each. A hub of your own loads the same data (`loadHub`) and arranges
|
|
150
|
+
* these sections another way.
|
|
150
151
|
*/
|
|
151
152
|
export async function HubPage({ app }) {
|
|
152
153
|
const data = await loadHub(app);
|
|
153
|
-
return (_jsxs("div", { className: "space-y-8", children: [_jsx(HubIntro, {
|
|
154
|
+
return (_jsxs("div", { className: "space-y-8", children: [_jsx(HubIntro, { data: data }), _jsx(WeeklyCheck, { app: app, weekly: data.weekly }), _jsx(SuiteList, { data: data }), _jsx(HubStats, { data: data }), _jsx(NoEvalYet, { data: data })] }));
|
|
154
155
|
}
|
|
155
156
|
//# sourceMappingURL=HubSections.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HubSections.js","sourceRoot":"","sources":["../../src/react/HubSections.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACd,WAAW,EACX,aAAa,GAKd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,SAAS,EACT,aAAa,EACb,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,OAAO,EACP,SA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;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,EAAE,GAAG,EAA0B;IAC3D,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IAChC,OAAO,CACL,eAAK,SAAS,EAAC,WAAW,aACxB,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,GAAI,EACxB,KAAC,WAAW,IAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,GAAI,EAC9C,KAAC,SAAS,IAAC,IAAI,EAAE,IAAI,GAAI,EACzB,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,GAAI,EACxB,KAAC,SAAS,IAAC,IAAI,EAAE,IAAI,GAAI,IACrB,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { FormAction } from "./app.js";
|
|
3
|
+
/**
|
|
4
|
+
* A vertical-dots button and its menu.
|
|
5
|
+
*/
|
|
6
|
+
export declare function Menu({ label, children, width, className, }: {
|
|
7
|
+
/** The button's accessible name: "Choose GPT-6 Luna". */
|
|
8
|
+
label: string;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
/** The menu's width class; `w-56` by default. */
|
|
11
|
+
width?: string;
|
|
12
|
+
/** Classes for the wrapper (to place it). */
|
|
13
|
+
className?: string;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
/**
|
|
16
|
+
* A menu item that does something in the browser (opens a form or a
|
|
17
|
+
* drawer), then closes the menu.
|
|
18
|
+
*/
|
|
19
|
+
export declare function MenuButton({ onSelect, children, danger, }: {
|
|
20
|
+
onSelect: () => void;
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
/** Shown in the bad color, for retiring and the like. */
|
|
23
|
+
danger?: boolean;
|
|
24
|
+
}): import("react").JSX.Element;
|
|
25
|
+
/**
|
|
26
|
+
* A menu item that submits a server action with hidden fields, with an
|
|
27
|
+
* optional note under its words ("free, all 34 reused"). The menu closes
|
|
28
|
+
* once the form is read, so it doesn't cover the rows below.
|
|
29
|
+
*/
|
|
30
|
+
export declare function MenuForm({ action, fields, children, note, danger, }: {
|
|
31
|
+
action: FormAction;
|
|
32
|
+
/** Hidden fields, by name; undefined ones are left out. */
|
|
33
|
+
fields: Readonly<Record<string, string | undefined>>;
|
|
34
|
+
children: ReactNode;
|
|
35
|
+
note?: string | null;
|
|
36
|
+
danger?: boolean;
|
|
37
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext, useRef, useState, } from "react";
|
|
4
|
+
import { EllipsisVertical } from "lucide-react";
|
|
5
|
+
import { Button } from "./pieces.js";
|
|
6
|
+
import { useDismiss } from "./InfoPopover.js";
|
|
7
|
+
/**
|
|
8
|
+
* The one menu on the eval pages: a vertical-dots button that opens a list
|
|
9
|
+
* of items. A model row's menu, a case's menu, and the page title's menu
|
|
10
|
+
* are all this, so every menu looks and behaves the same. Closes on a
|
|
11
|
+
* click outside, Escape, or once an item is chosen.
|
|
12
|
+
*/
|
|
13
|
+
const Close = createContext(() => { });
|
|
14
|
+
/** A menu item's look, shared by buttons and forms. */
|
|
15
|
+
const ITEM = "block w-full rounded px-3 py-1.5 text-left text-sm hover:bg-tint";
|
|
16
|
+
/**
|
|
17
|
+
* A vertical-dots button and its menu.
|
|
18
|
+
*/
|
|
19
|
+
export function Menu({ label, children, width = "w-56", className = "relative", }) {
|
|
20
|
+
const [open, setOpen] = useState(false);
|
|
21
|
+
const ref = useRef(null);
|
|
22
|
+
useDismiss(open, setOpen, ref);
|
|
23
|
+
return (_jsxs("div", { ref: ref, className: className, children: [_jsx(Button, { type: "button", "aria-label": label, title: label, "aria-haspopup": "menu", "aria-expanded": open, onClick: () => {
|
|
24
|
+
setOpen(!open);
|
|
25
|
+
}, className: "inline-flex h-8 w-8 items-center justify-center rounded-md text-muted hover:bg-tint hover:text-ink", children: _jsx(EllipsisVertical, { "aria-hidden": true, className: "h-4 w-4" }) }), open && (_jsx("div", { role: "menu", "aria-label": label, className: `absolute right-0 z-20 mt-1 ${width} rounded-md border border-line bg-card p-1 shadow-lg`, children: _jsx(Close.Provider, { value: () => {
|
|
26
|
+
setOpen(false);
|
|
27
|
+
}, children: children }) }))] }));
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A menu item that does something in the browser (opens a form or a
|
|
31
|
+
* drawer), then closes the menu.
|
|
32
|
+
*/
|
|
33
|
+
export function MenuButton({ onSelect, children, danger = false, }) {
|
|
34
|
+
const close = useContext(Close);
|
|
35
|
+
return (_jsx(Button, { type: "button", role: "menuitem", className: `${ITEM}${danger ? " text-bad" : ""}`, onClick: () => {
|
|
36
|
+
onSelect();
|
|
37
|
+
close();
|
|
38
|
+
}, children: children }));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A menu item that submits a server action with hidden fields, with an
|
|
42
|
+
* optional note under its words ("free, all 34 reused"). The menu closes
|
|
43
|
+
* once the form is read, so it doesn't cover the rows below.
|
|
44
|
+
*/
|
|
45
|
+
export function MenuForm({ action, fields, children, note, danger = false, }) {
|
|
46
|
+
const close = useContext(Close);
|
|
47
|
+
return (_jsxs("form", { action: action, onSubmit: () => setTimeout(() => {
|
|
48
|
+
close();
|
|
49
|
+
}), children: [Object.entries(fields).map(([name, value]) => value === undefined ? null : (_jsx("input", { type: "hidden", name: name, value: value }, name))), _jsxs(Button, { type: "submit", role: "menuitem", className: `${ITEM}${danger ? " text-bad" : ""}`, children: [children, note && _jsx("span", { className: "block text-xs text-muted", children: note })] })] }));
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=Menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../src/react/Menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC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C,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,aAE/C,QAAQ,EACR,IAAI,IAAI,eAAM,SAAS,EAAC,0BAA0B,YAAE,IAAI,GAAQ,IAC1D,IACJ,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -2,7 +2,7 @@ import type { FormAction } from "./app.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* A model row's menu: test it (with what that costs now), make it live,
|
|
4
4
|
* or make it the fallback, where the row allows either. Keeps the model
|
|
5
|
-
* table narrow.
|
|
5
|
+
* table narrow. The eval pages' one `Menu`.
|
|
6
6
|
*/
|
|
7
7
|
export declare function ModelMenu({ suite, model, label, test, makeLive, makeFallback, effort, }: {
|
|
8
8
|
suite: string;
|
package/dist/react/ModelMenu.js
CHANGED
|
@@ -1,43 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { EllipsisVertical } from "lucide-react";
|
|
5
|
-
import { Button } from "./pieces.js";
|
|
3
|
+
import { Menu, MenuForm } from "./Menu.js";
|
|
6
4
|
/**
|
|
7
5
|
* A model row's menu: test it (with what that costs now), make it live,
|
|
8
6
|
* or make it the fallback, where the row allows either. Keeps the model
|
|
9
|
-
* table narrow.
|
|
7
|
+
* table narrow. The eval pages' one `Menu`.
|
|
10
8
|
*/
|
|
11
9
|
export function ModelMenu({ suite, model, label, test, makeLive, makeFallback, effort, }) {
|
|
12
|
-
const [open, setOpen] = useState(false);
|
|
13
|
-
const ref = useRef(null);
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
if (!open)
|
|
16
|
-
return;
|
|
17
|
-
const close = (e) => {
|
|
18
|
-
if (e instanceof KeyboardEvent
|
|
19
|
-
? e.key === "Escape"
|
|
20
|
-
: !ref.current?.contains(e.target))
|
|
21
|
-
setOpen(false);
|
|
22
|
-
};
|
|
23
|
-
document.addEventListener("mousedown", close);
|
|
24
|
-
document.addEventListener("keydown", close);
|
|
25
|
-
return () => {
|
|
26
|
-
document.removeEventListener("mousedown", close);
|
|
27
|
-
document.removeEventListener("keydown", close);
|
|
28
|
-
};
|
|
29
|
-
}, [open]);
|
|
30
10
|
if (!test && !makeLive && !makeFallback)
|
|
31
11
|
return null;
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}), children: [_jsx("input", { type: "hidden", name: "suite", value: suite }), _jsx("input", { type: "hidden", name: "model", value: model }), effort !== undefined && (_jsx("input", { type: "hidden", name: "effort", value: effort ?? "default" })), _jsxs(Button, { type: "submit", role: "menuitem", className: item, children: [text, note && _jsx("span", { className: "block text-xs text-muted", children: note })] })] }));
|
|
39
|
-
return (_jsxs("div", { ref: ref, className: "relative", children: [_jsx(Button, { type: "button", "aria-label": `Choose ${label}`, title: `Choose ${label}`, "aria-haspopup": "menu", "aria-expanded": open, onClick: () => {
|
|
40
|
-
setOpen(!open);
|
|
41
|
-
}, className: "inline-flex h-8 w-8 items-center justify-center rounded-md text-muted hover:bg-tint hover:text-ink", children: _jsx(EllipsisVertical, { "aria-hidden": true, className: "h-4 w-4" }) }), open && (_jsxs("div", { role: "menu", className: "absolute right-0 z-20 mt-1 w-56 rounded-md border border-line bg-card p-1 shadow-lg", children: [test && choice(test.action, test.text, test.note), makeLive && choice(makeLive, "Make live"), makeFallback && choice(makeFallback, "Make fallback")] }))] }));
|
|
12
|
+
const fields = {
|
|
13
|
+
suite,
|
|
14
|
+
model,
|
|
15
|
+
effort: effort === undefined ? undefined : (effort ?? "default"),
|
|
16
|
+
};
|
|
17
|
+
return (_jsxs(Menu, { label: `Choose ${label}`, children: [test && (_jsx(MenuForm, { action: test.action, fields: fields, note: test.note, children: test.text })), makeLive && (_jsx(MenuForm, { action: makeLive, fields: fields, children: "Make live" })), makeFallback && (_jsx(MenuForm, { action: makeFallback, fields: fields, children: "Make fallback" }))] }));
|
|
42
18
|
}
|
|
43
19
|
//# sourceMappingURL=ModelMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelMenu.js","sourceRoot":"","sources":["../../src/react/ModelMenu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ModelMenu.js","sourceRoot":"","sources":["../../src/react/ModelMenu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAG3C;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,KAAK,EACL,KAAK,EACL,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,MAAM,GAoBP;IACC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,YAAY;QAAE,OAAO,IAAI,CAAC;IACrD,MAAM,MAAM,GAAG;QACb,KAAK;QACL,KAAK;QACL,MAAM,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,SAAS,CAAC;KACjE,CAAC;IACF,OAAO,CACL,MAAC,IAAI,IAAC,KAAK,EAAE,UAAU,KAAK,EAAE,aAC3B,IAAI,IAAI,CACP,KAAC,QAAQ,IAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,YAC3D,IAAI,CAAC,IAAI,GACD,CACZ,EACA,QAAQ,IAAI,CACX,KAAC,QAAQ,IAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,0BAE/B,CACZ,EACA,YAAY,IAAI,CACf,KAAC,QAAQ,IAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,8BAEnC,CACZ,IACI,CACR,CAAC;AACJ,CAAC"}
|