@sanity/ailf-studio 1.8.0 → 1.9.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/index.d.ts +1 -0
- package/dist/index.js +837 -514
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -100,6 +100,24 @@ import {
|
|
|
100
100
|
useProjectId
|
|
101
101
|
} from "sanity";
|
|
102
102
|
|
|
103
|
+
// ../shared/dist/feature-flags.js
|
|
104
|
+
var FEATURE_FLAGS = {
|
|
105
|
+
showFailureModes: {
|
|
106
|
+
enabled: false,
|
|
107
|
+
rationale: 'Current classification is too broad (majority "Unclassified") to be actionable in the diagnostics view.',
|
|
108
|
+
reEnableWhen: "Failure taxonomy is refined so non-Unclassified buckets carry meaningful signal.",
|
|
109
|
+
relatedWorkItem: "W0037-detect-model-output-failures",
|
|
110
|
+
addedAt: "2026-04-22"
|
|
111
|
+
},
|
|
112
|
+
showRegressedSinceLastRun: {
|
|
113
|
+
enabled: false,
|
|
114
|
+
rationale: "Bare list of regressed area names lacks explanatory context for why each regressed.",
|
|
115
|
+
reEnableWhen: "Per-area regression attribution can be surfaced alongside the list.",
|
|
116
|
+
relatedWorkItem: null,
|
|
117
|
+
addedAt: "2026-04-22"
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
|
|
103
121
|
// ../shared/dist/score-grades.js
|
|
104
122
|
var GRADE_BOUNDARIES = {
|
|
105
123
|
good: 80,
|
|
@@ -3265,17 +3283,17 @@ import { route } from "sanity/router";
|
|
|
3265
3283
|
// src/components/Dashboard.tsx
|
|
3266
3284
|
import { HelpCircleIcon as HelpCircleIcon8 } from "@sanity/icons";
|
|
3267
3285
|
import {
|
|
3268
|
-
Box as
|
|
3269
|
-
Button as
|
|
3286
|
+
Box as Box32,
|
|
3287
|
+
Button as Button12,
|
|
3270
3288
|
Container,
|
|
3271
|
-
Flex as
|
|
3272
|
-
Stack as
|
|
3289
|
+
Flex as Flex37,
|
|
3290
|
+
Stack as Stack39,
|
|
3273
3291
|
Tab as Tab3,
|
|
3274
3292
|
TabList as TabList3,
|
|
3275
3293
|
TabPanel as TabPanel3,
|
|
3276
|
-
Text as
|
|
3294
|
+
Text as Text49
|
|
3277
3295
|
} from "@sanity/ui";
|
|
3278
|
-
import { useCallback as
|
|
3296
|
+
import { useCallback as useCallback37, useEffect as useEffect16 } from "react";
|
|
3279
3297
|
import { useRouter as useRouter3 } from "sanity/router";
|
|
3280
3298
|
|
|
3281
3299
|
// src/lib/help-context.ts
|
|
@@ -6045,22 +6063,22 @@ function LatestReports({
|
|
|
6045
6063
|
// src/components/report-detail/ReportDetail.tsx
|
|
6046
6064
|
import { ArrowLeftIcon as ArrowLeftIcon3 } from "@sanity/icons";
|
|
6047
6065
|
import {
|
|
6048
|
-
Badge as
|
|
6049
|
-
Box as
|
|
6050
|
-
Button as
|
|
6051
|
-
Flex as
|
|
6052
|
-
Stack as
|
|
6066
|
+
Badge as Badge9,
|
|
6067
|
+
Box as Box27,
|
|
6068
|
+
Button as Button10,
|
|
6069
|
+
Flex as Flex30,
|
|
6070
|
+
Stack as Stack31,
|
|
6053
6071
|
Tab,
|
|
6054
6072
|
TabList,
|
|
6055
6073
|
TabPanel,
|
|
6056
|
-
Text as
|
|
6074
|
+
Text as Text40,
|
|
6057
6075
|
Tooltip as Tooltip10
|
|
6058
6076
|
} from "@sanity/ui";
|
|
6059
6077
|
import {
|
|
6060
|
-
useCallback as
|
|
6078
|
+
useCallback as useCallback34,
|
|
6061
6079
|
useEffect as useEffect12,
|
|
6062
6080
|
useMemo as useMemo15,
|
|
6063
|
-
useState as
|
|
6081
|
+
useState as useState25
|
|
6064
6082
|
} from "react";
|
|
6065
6083
|
import { useClient as useClient10 } from "sanity";
|
|
6066
6084
|
|
|
@@ -7582,20 +7600,22 @@ var NDJSON_TYPES = /* @__PURE__ */ new Set([
|
|
|
7582
7600
|
function useArtifactDetail(type, key) {
|
|
7583
7601
|
const { runId } = useReportArtifactContext();
|
|
7584
7602
|
const ref = useArtifactRef(type);
|
|
7603
|
+
const cacheKey2 = key ?? "";
|
|
7585
7604
|
const [status, setStatus] = useState13(
|
|
7586
|
-
() => runId && getCached({ runId, type, key }) !== null ? "ready" : "idle"
|
|
7605
|
+
() => runId && getCached({ runId, type, key: cacheKey2 }) !== null ? "ready" : "idle"
|
|
7587
7606
|
);
|
|
7588
7607
|
const [, setTick] = useState13(0);
|
|
7589
7608
|
useEffect7(() => {
|
|
7590
7609
|
if (!runId) return void 0;
|
|
7591
|
-
return subscribe({ runId, type, key }, () => {
|
|
7610
|
+
return subscribe({ runId, type, key: cacheKey2 }, () => {
|
|
7592
7611
|
setStatus("ready");
|
|
7593
7612
|
setTick((n) => n + 1);
|
|
7594
7613
|
});
|
|
7595
|
-
}, [runId, type,
|
|
7614
|
+
}, [runId, type, cacheKey2]);
|
|
7596
7615
|
const request = useCallback16(async () => {
|
|
7597
|
-
if (!runId || !ref
|
|
7598
|
-
|
|
7616
|
+
if (!runId || !ref) return;
|
|
7617
|
+
if (ref.layout === "per-entry" && !key) return;
|
|
7618
|
+
const cacheId = { runId, type, key: cacheKey2 };
|
|
7599
7619
|
if (isKnownNotFound(cacheId)) {
|
|
7600
7620
|
setStatus("error");
|
|
7601
7621
|
return;
|
|
@@ -7608,7 +7628,7 @@ function useArtifactDetail(type, key) {
|
|
|
7608
7628
|
setStatus("loading");
|
|
7609
7629
|
try {
|
|
7610
7630
|
await recordInFlight(cacheId, async () => {
|
|
7611
|
-
const url = buildSigningUrl(runId, type, key);
|
|
7631
|
+
const url = key ? buildSigningUrl(runId, type, key) : buildSigningUrl(runId, type);
|
|
7612
7632
|
const body = NDJSON_TYPES.has(type) ? await signAndFetchNdjson(url) : await signAndFetchJson(url);
|
|
7613
7633
|
setCached(cacheId, body);
|
|
7614
7634
|
return body;
|
|
@@ -7620,8 +7640,8 @@ function useArtifactDetail(type, key) {
|
|
|
7620
7640
|
}
|
|
7621
7641
|
setStatus("error");
|
|
7622
7642
|
}
|
|
7623
|
-
}, [runId, ref, type, key]);
|
|
7624
|
-
const full = runId ? getCached({ runId, type, key }) : null;
|
|
7643
|
+
}, [runId, ref, type, key, cacheKey2]);
|
|
7644
|
+
const full = runId ? getCached({ runId, type, key: cacheKey2 }) : null;
|
|
7625
7645
|
return [full, status, request];
|
|
7626
7646
|
}
|
|
7627
7647
|
|
|
@@ -9387,41 +9407,306 @@ function AreaJumpRail({ areas }) {
|
|
|
9387
9407
|
] });
|
|
9388
9408
|
}
|
|
9389
9409
|
|
|
9390
|
-
// src/components/report-detail/
|
|
9391
|
-
import {
|
|
9392
|
-
import {
|
|
9393
|
-
|
|
9410
|
+
// src/components/report-detail/PipelineExecutionPanel.tsx
|
|
9411
|
+
import { ChevronDownIcon as ChevronDownIcon2, ChevronRightIcon as ChevronRightIcon2 } from "@sanity/icons";
|
|
9412
|
+
import { Badge as Badge8, Box as Box22, Button as Button4, Card as Card15, Flex as Flex21, Stack as Stack24, Text as Text32 } from "@sanity/ui";
|
|
9413
|
+
import { useCallback as useCallback23, useState as useState17 } from "react";
|
|
9414
|
+
import { Fragment as Fragment10, jsx as jsx36, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
9415
|
+
var PRE_W0060_HELP_URL = "https://github.com/sanity-labs/ai-literacy-framework/blob/main/docs/design-docs/artifact-data-surfacing.md";
|
|
9416
|
+
function PipelineExecutionPanel() {
|
|
9417
|
+
const ref = useArtifactRef("pipelineContext");
|
|
9418
|
+
const preview = ref?.preview;
|
|
9419
|
+
if (!ref || !preview) {
|
|
9420
|
+
return /* @__PURE__ */ jsx36(EmptyState, {});
|
|
9421
|
+
}
|
|
9422
|
+
return /* @__PURE__ */ jsx36(LoadedPanel, { preview });
|
|
9423
|
+
}
|
|
9424
|
+
function EmptyState() {
|
|
9425
|
+
return /* @__PURE__ */ jsx36(Card15, { padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs28(Stack24, { space: 3, children: [
|
|
9426
|
+
/* @__PURE__ */ jsx36(Text32, { size: 3, weight: "semibold", children: "Pipeline Execution" }),
|
|
9427
|
+
/* @__PURE__ */ jsxs28(Text32, { muted: true, size: 2, children: [
|
|
9428
|
+
"Pipeline context was not captured for this run.",
|
|
9429
|
+
" ",
|
|
9430
|
+
/* @__PURE__ */ jsx36(
|
|
9431
|
+
"a",
|
|
9432
|
+
{
|
|
9433
|
+
href: PRE_W0060_HELP_URL,
|
|
9434
|
+
rel: "noopener noreferrer",
|
|
9435
|
+
target: "_blank",
|
|
9436
|
+
children: "Why?"
|
|
9437
|
+
}
|
|
9438
|
+
)
|
|
9439
|
+
] })
|
|
9440
|
+
] }) });
|
|
9441
|
+
}
|
|
9442
|
+
function LoadedPanel({ preview }) {
|
|
9443
|
+
const [expanded, setExpanded] = useState17(false);
|
|
9444
|
+
const [full, status, request] = useArtifactDetail("pipelineContext");
|
|
9445
|
+
const handleToggle = useCallback23(() => {
|
|
9446
|
+
setExpanded((prev) => {
|
|
9447
|
+
const next = !prev;
|
|
9448
|
+
if (next) {
|
|
9449
|
+
void request();
|
|
9450
|
+
}
|
|
9451
|
+
return next;
|
|
9452
|
+
});
|
|
9453
|
+
}, [request]);
|
|
9394
9454
|
return /* @__PURE__ */ jsx36(Card15, { padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs28(Stack24, { space: 4, children: [
|
|
9395
|
-
/* @__PURE__ */
|
|
9396
|
-
|
|
9397
|
-
/* @__PURE__ */ jsx36(
|
|
9398
|
-
|
|
9455
|
+
/* @__PURE__ */ jsxs28(Flex21, { align: "center", gap: 3, justify: "space-between", wrap: "wrap", children: [
|
|
9456
|
+
/* @__PURE__ */ jsx36(Text32, { size: 3, weight: "semibold", children: "Pipeline Execution" }),
|
|
9457
|
+
preview.belowCritical === true && /* @__PURE__ */ jsx36(Badge8, { tone: "critical", children: "Below critical" })
|
|
9458
|
+
] }),
|
|
9459
|
+
/* @__PURE__ */ jsx36(HeaderRow, { preview }),
|
|
9460
|
+
/* @__PURE__ */ jsx36(Box22, { children: /* @__PURE__ */ jsx36(
|
|
9461
|
+
Button4,
|
|
9462
|
+
{
|
|
9463
|
+
icon: expanded ? ChevronDownIcon2 : ChevronRightIcon2,
|
|
9464
|
+
mode: "bleed",
|
|
9465
|
+
onClick: handleToggle,
|
|
9466
|
+
padding: 2,
|
|
9467
|
+
text: expanded ? "Hide details" : "Show details"
|
|
9468
|
+
}
|
|
9469
|
+
) }),
|
|
9470
|
+
expanded && /* @__PURE__ */ jsx36(Details, { full, preview, status })
|
|
9471
|
+
] }) });
|
|
9472
|
+
}
|
|
9473
|
+
function HeaderRow({ preview }) {
|
|
9474
|
+
const failedCount = preview.failedSteps.length;
|
|
9475
|
+
return /* @__PURE__ */ jsxs28(Flex21, { align: "center", gap: 3, wrap: "wrap", children: [
|
|
9476
|
+
/* @__PURE__ */ jsx36(Stat2, { label: "Steps", value: String(preview.stepCount) }),
|
|
9477
|
+
/* @__PURE__ */ jsx36(Dot, {}),
|
|
9478
|
+
/* @__PURE__ */ jsx36(Stat2, { label: "Duration", value: formatDuration(preview.totalDurationMs) }),
|
|
9479
|
+
/* @__PURE__ */ jsx36(Dot, {}),
|
|
9480
|
+
/* @__PURE__ */ jsxs28(Flex21, { align: "baseline", gap: 2, children: [
|
|
9481
|
+
/* @__PURE__ */ jsx36(SectionTitle, { children: "Failed" }),
|
|
9482
|
+
failedCount > 0 ? /* @__PURE__ */ jsx36(Badge8, { tone: "critical", children: failedCount }) : /* @__PURE__ */ jsx36(Text32, { size: 2, children: "0" })
|
|
9483
|
+
] }),
|
|
9484
|
+
typeof preview.cacheHits === "number" && /* @__PURE__ */ jsxs28(Fragment10, { children: [
|
|
9485
|
+
/* @__PURE__ */ jsx36(Dot, {}),
|
|
9486
|
+
/* @__PURE__ */ jsx36(Stat2, { label: "Cache hits", value: String(preview.cacheHits) })
|
|
9487
|
+
] })
|
|
9488
|
+
] });
|
|
9489
|
+
}
|
|
9490
|
+
function Stat2({ label, value }) {
|
|
9491
|
+
return /* @__PURE__ */ jsxs28(Flex21, { align: "baseline", gap: 2, children: [
|
|
9492
|
+
/* @__PURE__ */ jsx36(SectionTitle, { children: label }),
|
|
9493
|
+
/* @__PURE__ */ jsx36(Text32, { size: 2, children: value })
|
|
9494
|
+
] });
|
|
9495
|
+
}
|
|
9496
|
+
function Dot() {
|
|
9497
|
+
return /* @__PURE__ */ jsx36(Text32, { "aria-hidden": true, muted: true, size: 1, children: "\xB7" });
|
|
9498
|
+
}
|
|
9499
|
+
function Details({
|
|
9500
|
+
full,
|
|
9501
|
+
preview,
|
|
9502
|
+
status
|
|
9503
|
+
}) {
|
|
9504
|
+
if (status === "loading") {
|
|
9505
|
+
return /* @__PURE__ */ jsx36(Text32, { muted: true, size: 2, children: "Loading pipeline context\u2026" });
|
|
9506
|
+
}
|
|
9507
|
+
if (status === "error") {
|
|
9508
|
+
return /* @__PURE__ */ jsx36(Card15, { padding: 3, radius: 2, tone: "critical", children: /* @__PURE__ */ jsx36(Text32, { size: 2, children: "Failed to load pipeline context." }) });
|
|
9509
|
+
}
|
|
9510
|
+
if (!full) {
|
|
9511
|
+
return null;
|
|
9512
|
+
}
|
|
9513
|
+
return /* @__PURE__ */ jsxs28(Stack24, { space: 4, children: [
|
|
9514
|
+
/* @__PURE__ */ jsx36(StepTimeline, { steps: full.steps ?? [] }),
|
|
9515
|
+
/* @__PURE__ */ jsx36(ConfigPane, { config: full.config ?? {} }),
|
|
9516
|
+
/* @__PURE__ */ jsx36(
|
|
9517
|
+
CacheTelemetry,
|
|
9518
|
+
{
|
|
9519
|
+
cacheKeys: full.state?.remoteCacheHits ?? [],
|
|
9520
|
+
preview
|
|
9521
|
+
}
|
|
9522
|
+
)
|
|
9523
|
+
] });
|
|
9524
|
+
}
|
|
9525
|
+
function StepTimeline({ steps }) {
|
|
9526
|
+
if (steps.length === 0) {
|
|
9527
|
+
return /* @__PURE__ */ jsx36(Text32, { muted: true, size: 2, children: "No pipeline steps recorded." });
|
|
9528
|
+
}
|
|
9529
|
+
const maxDuration = Math.max(
|
|
9530
|
+
1,
|
|
9531
|
+
...steps.map((s) => typeof s.durationMs === "number" ? s.durationMs : 0)
|
|
9532
|
+
);
|
|
9533
|
+
return /* @__PURE__ */ jsxs28(Stack24, { space: 3, children: [
|
|
9534
|
+
/* @__PURE__ */ jsx36(SectionTitle, { children: "Steps" }),
|
|
9535
|
+
/* @__PURE__ */ jsx36(Stack24, { space: 2, children: steps.map((step) => /* @__PURE__ */ jsx36(StepRow, { maxDurationMs: maxDuration, step }, step.name)) })
|
|
9536
|
+
] });
|
|
9537
|
+
}
|
|
9538
|
+
function StepRow({
|
|
9539
|
+
maxDurationMs,
|
|
9540
|
+
step
|
|
9541
|
+
}) {
|
|
9542
|
+
const widthPct = typeof step.durationMs === "number" && maxDurationMs > 0 ? Math.max(2, Math.round(step.durationMs / maxDurationMs * 100)) : 0;
|
|
9543
|
+
const tone = step.status === "success" ? "positive" : step.status === "failed" ? "critical" : "default";
|
|
9544
|
+
const barColor = tone === "critical" ? "var(--card-bg-critical-color, #c4314b)" : tone === "positive" ? "var(--card-bg-positive-color, #43d675)" : "var(--card-muted-fg-color, #999)";
|
|
9545
|
+
return /* @__PURE__ */ jsxs28(Flex21, { align: "center", gap: 3, wrap: "nowrap", children: [
|
|
9546
|
+
/* @__PURE__ */ jsx36(Box22, { style: { minWidth: 180, maxWidth: 220 }, children: /* @__PURE__ */ jsx36(
|
|
9547
|
+
Text32,
|
|
9548
|
+
{
|
|
9549
|
+
size: 2,
|
|
9550
|
+
style: { fontFamily: "monospace" },
|
|
9551
|
+
textOverflow: "ellipsis",
|
|
9552
|
+
children: step.name
|
|
9553
|
+
}
|
|
9554
|
+
) }),
|
|
9555
|
+
/* @__PURE__ */ jsx36(Box22, { style: { minWidth: 72 }, children: /* @__PURE__ */ jsx36(Badge8, { tone, children: step.status }) }),
|
|
9556
|
+
/* @__PURE__ */ jsxs28(Box22, { flex: 1, style: { position: "relative", minWidth: 80 }, children: [
|
|
9399
9557
|
/* @__PURE__ */ jsx36(
|
|
9558
|
+
Box22,
|
|
9559
|
+
{
|
|
9560
|
+
style: {
|
|
9561
|
+
backgroundColor: "var(--card-border-color, #e5e5e5)",
|
|
9562
|
+
borderRadius: 3,
|
|
9563
|
+
height: 6,
|
|
9564
|
+
width: "100%"
|
|
9565
|
+
}
|
|
9566
|
+
}
|
|
9567
|
+
),
|
|
9568
|
+
widthPct > 0 && /* @__PURE__ */ jsx36(
|
|
9569
|
+
Box22,
|
|
9570
|
+
{
|
|
9571
|
+
style: {
|
|
9572
|
+
backgroundColor: barColor,
|
|
9573
|
+
borderRadius: 3,
|
|
9574
|
+
height: 6,
|
|
9575
|
+
left: 0,
|
|
9576
|
+
position: "absolute",
|
|
9577
|
+
top: 0,
|
|
9578
|
+
width: `${widthPct}%`
|
|
9579
|
+
}
|
|
9580
|
+
}
|
|
9581
|
+
)
|
|
9582
|
+
] }),
|
|
9583
|
+
/* @__PURE__ */ jsx36(Box22, { style: { minWidth: 80, textAlign: "right" }, children: /* @__PURE__ */ jsx36(Text32, { muted: true, size: 1, style: { fontFamily: "monospace" }, children: typeof step.durationMs === "number" ? formatDuration(step.durationMs) : "\u2014" }) })
|
|
9584
|
+
] });
|
|
9585
|
+
}
|
|
9586
|
+
function ConfigPane({ config }) {
|
|
9587
|
+
const [expanded, setExpanded] = useState17(false);
|
|
9588
|
+
const json = JSON.stringify(config, null, 2);
|
|
9589
|
+
return /* @__PURE__ */ jsxs28(Stack24, { space: 2, children: [
|
|
9590
|
+
/* @__PURE__ */ jsxs28(Flex21, { align: "center", gap: 2, children: [
|
|
9591
|
+
/* @__PURE__ */ jsx36(SectionTitle, { children: "Effective config" }),
|
|
9592
|
+
/* @__PURE__ */ jsx36(
|
|
9593
|
+
Button4,
|
|
9594
|
+
{
|
|
9595
|
+
fontSize: 1,
|
|
9596
|
+
icon: expanded ? ChevronDownIcon2 : ChevronRightIcon2,
|
|
9597
|
+
mode: "bleed",
|
|
9598
|
+
onClick: () => setExpanded((prev) => !prev),
|
|
9599
|
+
padding: 1,
|
|
9600
|
+
text: expanded ? "Collapse" : "Expand"
|
|
9601
|
+
}
|
|
9602
|
+
)
|
|
9603
|
+
] }),
|
|
9604
|
+
expanded && /* @__PURE__ */ jsxs28(Box22, { style: { position: "relative" }, children: [
|
|
9605
|
+
/* @__PURE__ */ jsx36(Card15, { border: true, padding: 3, radius: 2, tone: "transparent", children: /* @__PURE__ */ jsx36(
|
|
9606
|
+
"pre",
|
|
9607
|
+
{
|
|
9608
|
+
style: {
|
|
9609
|
+
fontFamily: "monospace",
|
|
9610
|
+
fontSize: 12,
|
|
9611
|
+
lineHeight: "1.5",
|
|
9612
|
+
margin: 0,
|
|
9613
|
+
maxHeight: 400,
|
|
9614
|
+
overflow: "auto",
|
|
9615
|
+
whiteSpace: "pre-wrap",
|
|
9616
|
+
wordBreak: "break-word"
|
|
9617
|
+
},
|
|
9618
|
+
children: json
|
|
9619
|
+
}
|
|
9620
|
+
) }),
|
|
9621
|
+
/* @__PURE__ */ jsx36(
|
|
9622
|
+
CopyButton,
|
|
9623
|
+
{
|
|
9624
|
+
label: "Copy config",
|
|
9625
|
+
style: { position: "absolute", right: 8, top: 8 },
|
|
9626
|
+
text: json
|
|
9627
|
+
}
|
|
9628
|
+
)
|
|
9629
|
+
] })
|
|
9630
|
+
] });
|
|
9631
|
+
}
|
|
9632
|
+
function CacheTelemetry({
|
|
9633
|
+
cacheKeys,
|
|
9634
|
+
preview
|
|
9635
|
+
}) {
|
|
9636
|
+
const [expanded, setExpanded] = useState17(false);
|
|
9637
|
+
const count = cacheKeys.length || preview.cacheHits || 0;
|
|
9638
|
+
if (count === 0) return null;
|
|
9639
|
+
return /* @__PURE__ */ jsxs28(Stack24, { space: 2, children: [
|
|
9640
|
+
/* @__PURE__ */ jsxs28(Flex21, { align: "center", gap: 2, children: [
|
|
9641
|
+
/* @__PURE__ */ jsx36(SectionTitle, { children: "Remote cache hits" }),
|
|
9642
|
+
/* @__PURE__ */ jsx36(Text32, { size: 2, children: count }),
|
|
9643
|
+
cacheKeys.length > 0 && /* @__PURE__ */ jsx36(
|
|
9644
|
+
Button4,
|
|
9645
|
+
{
|
|
9646
|
+
fontSize: 1,
|
|
9647
|
+
icon: expanded ? ChevronDownIcon2 : ChevronRightIcon2,
|
|
9648
|
+
mode: "bleed",
|
|
9649
|
+
onClick: () => setExpanded((prev) => !prev),
|
|
9650
|
+
padding: 1,
|
|
9651
|
+
text: expanded ? "Hide keys" : "Show keys"
|
|
9652
|
+
}
|
|
9653
|
+
)
|
|
9654
|
+
] }),
|
|
9655
|
+
expanded && cacheKeys.length > 0 && /* @__PURE__ */ jsx36(Stack24, { space: 1, children: cacheKeys.map((k) => /* @__PURE__ */ jsx36(Text32, { size: 1, style: { fontFamily: "monospace" }, children: k }, k)) })
|
|
9656
|
+
] });
|
|
9657
|
+
}
|
|
9658
|
+
function SectionTitle({ children }) {
|
|
9659
|
+
return /* @__PURE__ */ jsx36(
|
|
9660
|
+
Text32,
|
|
9661
|
+
{
|
|
9662
|
+
muted: true,
|
|
9663
|
+
size: 1,
|
|
9664
|
+
style: { letterSpacing: "0.05em", textTransform: "uppercase" },
|
|
9665
|
+
weight: "semibold",
|
|
9666
|
+
children
|
|
9667
|
+
}
|
|
9668
|
+
);
|
|
9669
|
+
}
|
|
9670
|
+
|
|
9671
|
+
// src/components/report-detail/ProvenanceCard.tsx
|
|
9672
|
+
import { Button as Button5, Card as Card16, Flex as Flex22, Grid as Grid4, Stack as Stack25, Text as Text33 } from "@sanity/ui";
|
|
9673
|
+
import { useState as useState18 } from "react";
|
|
9674
|
+
import { jsx as jsx37, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
9675
|
+
var TASK_IDS_INLINE_THRESHOLD = 3;
|
|
9676
|
+
function ProvenanceCard({ provenance }) {
|
|
9677
|
+
return /* @__PURE__ */ jsx37(Card16, { padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs29(Stack25, { space: 4, children: [
|
|
9678
|
+
/* @__PURE__ */ jsx37(Text33, { size: 3, weight: "semibold", children: "Provenance" }),
|
|
9679
|
+
/* @__PURE__ */ jsxs29(Grid4, { columns: [1, 2, 3], gap: 4, children: [
|
|
9680
|
+
/* @__PURE__ */ jsx37(Field, { label: "Mode", value: provenance.mode }),
|
|
9681
|
+
/* @__PURE__ */ jsx37(Field, { label: "Source", value: provenance.source.name }),
|
|
9682
|
+
/* @__PURE__ */ jsx37(
|
|
9400
9683
|
Field,
|
|
9401
9684
|
{
|
|
9402
9685
|
label: "Trigger",
|
|
9403
9686
|
value: provenance.trigger.type + (provenance.trigger.workflow ? ` (${provenance.trigger.workflow})` : "")
|
|
9404
9687
|
}
|
|
9405
9688
|
),
|
|
9406
|
-
/* @__PURE__ */
|
|
9689
|
+
/* @__PURE__ */ jsx37(
|
|
9407
9690
|
Field,
|
|
9408
9691
|
{
|
|
9409
9692
|
label: "Models",
|
|
9410
9693
|
value: provenance.models.map((m) => m.label).join(", ")
|
|
9411
9694
|
}
|
|
9412
9695
|
),
|
|
9413
|
-
/* @__PURE__ */
|
|
9414
|
-
provenance.contextHash && /* @__PURE__ */
|
|
9696
|
+
/* @__PURE__ */ jsx37(Field, { label: "Grader Model", mono: true, value: provenance.graderModel }),
|
|
9697
|
+
provenance.contextHash && /* @__PURE__ */ jsx37(
|
|
9415
9698
|
Field,
|
|
9416
9699
|
{
|
|
9417
9700
|
label: "Context Hash",
|
|
9418
9701
|
mono: true,
|
|
9419
9702
|
value: provenance.contextHash.slice(0, 16) + "\u2026"
|
|
9420
9703
|
}
|
|
9421
|
-
)
|
|
9704
|
+
),
|
|
9705
|
+
provenance.areas.length > 0 && /* @__PURE__ */ jsx37(Field, { label: "Areas", value: provenance.areas.join(", ") }),
|
|
9706
|
+
provenance.taskIds && provenance.taskIds.length > 0 && /* @__PURE__ */ jsx37(TaskIdsField, { taskIds: provenance.taskIds })
|
|
9422
9707
|
] }),
|
|
9423
|
-
provenance.git && /* @__PURE__ */
|
|
9424
|
-
/* @__PURE__ */
|
|
9708
|
+
provenance.git && /* @__PURE__ */ jsx37(GitInfo, { git: provenance.git }),
|
|
9709
|
+
/* @__PURE__ */ jsx37(PromptfooLinks, { provenance })
|
|
9425
9710
|
] }) });
|
|
9426
9711
|
}
|
|
9427
9712
|
function Field({
|
|
@@ -9429,9 +9714,9 @@ function Field({
|
|
|
9429
9714
|
mono,
|
|
9430
9715
|
value
|
|
9431
9716
|
}) {
|
|
9432
|
-
return /* @__PURE__ */
|
|
9433
|
-
/* @__PURE__ */
|
|
9434
|
-
|
|
9717
|
+
return /* @__PURE__ */ jsxs29(Stack25, { space: 1, children: [
|
|
9718
|
+
/* @__PURE__ */ jsx37(
|
|
9719
|
+
Text33,
|
|
9435
9720
|
{
|
|
9436
9721
|
muted: true,
|
|
9437
9722
|
size: 1,
|
|
@@ -9440,7 +9725,46 @@ function Field({
|
|
|
9440
9725
|
children: label
|
|
9441
9726
|
}
|
|
9442
9727
|
),
|
|
9443
|
-
/* @__PURE__ */
|
|
9728
|
+
/* @__PURE__ */ jsx37(Text33, { size: 2, style: mono ? { fontFamily: "monospace" } : void 0, children: value })
|
|
9729
|
+
] });
|
|
9730
|
+
}
|
|
9731
|
+
function TaskIdsField({ taskIds }) {
|
|
9732
|
+
const [expanded, setExpanded] = useState18(false);
|
|
9733
|
+
const count = taskIds.length;
|
|
9734
|
+
const needsToggle = count > TASK_IDS_INLINE_THRESHOLD;
|
|
9735
|
+
const showList = !needsToggle || expanded;
|
|
9736
|
+
return /* @__PURE__ */ jsxs29(Stack25, { space: 1, children: [
|
|
9737
|
+
/* @__PURE__ */ jsxs29(Flex22, { align: "center", gap: 2, children: [
|
|
9738
|
+
/* @__PURE__ */ jsx37(
|
|
9739
|
+
Text33,
|
|
9740
|
+
{
|
|
9741
|
+
muted: true,
|
|
9742
|
+
size: 1,
|
|
9743
|
+
style: {
|
|
9744
|
+
letterSpacing: "0.05em",
|
|
9745
|
+
textTransform: "uppercase"
|
|
9746
|
+
},
|
|
9747
|
+
weight: "semibold",
|
|
9748
|
+
children: "Tasks"
|
|
9749
|
+
}
|
|
9750
|
+
),
|
|
9751
|
+
/* @__PURE__ */ jsxs29(Text33, { muted: true, size: 1, children: [
|
|
9752
|
+
"(",
|
|
9753
|
+
count,
|
|
9754
|
+
")"
|
|
9755
|
+
] })
|
|
9756
|
+
] }),
|
|
9757
|
+
showList && /* @__PURE__ */ jsx37(Stack25, { space: 1, children: taskIds.map((id) => /* @__PURE__ */ jsx37(Text33, { size: 2, style: { fontFamily: "monospace" }, children: id }, id)) }),
|
|
9758
|
+
needsToggle && /* @__PURE__ */ jsx37(
|
|
9759
|
+
Button5,
|
|
9760
|
+
{
|
|
9761
|
+
fontSize: 1,
|
|
9762
|
+
mode: "bleed",
|
|
9763
|
+
onClick: () => setExpanded((prev) => !prev),
|
|
9764
|
+
padding: 1,
|
|
9765
|
+
text: expanded ? "Hide" : `Show all ${count}`
|
|
9766
|
+
}
|
|
9767
|
+
)
|
|
9444
9768
|
] });
|
|
9445
9769
|
}
|
|
9446
9770
|
function GitInfo({ git }) {
|
|
@@ -9448,15 +9772,15 @@ function GitInfo({ git }) {
|
|
|
9448
9772
|
const branchUrl = `${repoUrl}/tree/${git.branch}`;
|
|
9449
9773
|
const commitUrl = `${repoUrl}/commit/${git.sha}`;
|
|
9450
9774
|
const prUrl = git.prNumber ? `${repoUrl}/pull/${git.prNumber}` : null;
|
|
9451
|
-
return /* @__PURE__ */
|
|
9452
|
-
/* @__PURE__ */
|
|
9453
|
-
/* @__PURE__ */
|
|
9454
|
-
/* @__PURE__ */
|
|
9775
|
+
return /* @__PURE__ */ jsx37(Card16, { border: true, padding: 3, radius: 2, tone: "transparent", children: /* @__PURE__ */ jsxs29(Flex22, { align: "center", gap: 3, wrap: "wrap", children: [
|
|
9776
|
+
/* @__PURE__ */ jsx37(Text33, { muted: true, size: 2, weight: "semibold", children: "Git" }),
|
|
9777
|
+
/* @__PURE__ */ jsxs29(Text33, { size: 2, children: [
|
|
9778
|
+
/* @__PURE__ */ jsx37("a", { href: repoUrl, rel: "noopener noreferrer", target: "_blank", children: git.repo }),
|
|
9455
9779
|
" / ",
|
|
9456
|
-
/* @__PURE__ */
|
|
9780
|
+
/* @__PURE__ */ jsx37("a", { href: branchUrl, rel: "noopener noreferrer", target: "_blank", children: git.branch })
|
|
9457
9781
|
] }),
|
|
9458
|
-
/* @__PURE__ */
|
|
9459
|
-
prUrl && /* @__PURE__ */
|
|
9782
|
+
/* @__PURE__ */ jsx37(Text33, { muted: true, size: 2, style: { fontFamily: "monospace" }, children: /* @__PURE__ */ jsx37("a", { href: commitUrl, rel: "noopener noreferrer", target: "_blank", children: git.sha.slice(0, 12) }) }),
|
|
9783
|
+
prUrl && /* @__PURE__ */ jsx37(Text33, { size: 2, children: /* @__PURE__ */ jsxs29("a", { href: prUrl, rel: "noopener noreferrer", target: "_blank", children: [
|
|
9460
9784
|
"PR #",
|
|
9461
9785
|
git.prNumber,
|
|
9462
9786
|
" \u2192"
|
|
@@ -9467,14 +9791,14 @@ function PromptfooLinks({
|
|
|
9467
9791
|
provenance
|
|
9468
9792
|
}) {
|
|
9469
9793
|
if (provenance.promptfooUrls && provenance.promptfooUrls.length > 0) {
|
|
9470
|
-
return /* @__PURE__ */
|
|
9794
|
+
return /* @__PURE__ */ jsx37(Flex22, { align: "center", gap: 3, wrap: "wrap", children: provenance.promptfooUrls.map((entry) => /* @__PURE__ */ jsx37(Text33, { size: 2, children: /* @__PURE__ */ jsxs29("a", { href: entry.url, rel: "noopener noreferrer", target: "_blank", children: [
|
|
9471
9795
|
"View in Promptfoo (",
|
|
9472
9796
|
entry.mode,
|
|
9473
9797
|
") \u2192"
|
|
9474
9798
|
] }) }, entry.mode)) });
|
|
9475
9799
|
}
|
|
9476
9800
|
if (provenance.promptfooUrl) {
|
|
9477
|
-
return /* @__PURE__ */
|
|
9801
|
+
return /* @__PURE__ */ jsx37(Text33, { size: 2, children: /* @__PURE__ */ jsx37(
|
|
9478
9802
|
"a",
|
|
9479
9803
|
{
|
|
9480
9804
|
href: provenance.promptfooUrl,
|
|
@@ -9484,40 +9808,40 @@ function PromptfooLinks({
|
|
|
9484
9808
|
}
|
|
9485
9809
|
) });
|
|
9486
9810
|
}
|
|
9487
|
-
return /* @__PURE__ */
|
|
9811
|
+
return /* @__PURE__ */ jsx37(PromptfooUnavailable, { reason: "not-shared" });
|
|
9488
9812
|
}
|
|
9489
9813
|
var UNAVAILABLE_TOOLTIPS = {
|
|
9490
9814
|
"not-shared": "No Promptfoo share link was generated for this report. This usually means the evaluation was run locally without the --share flag."
|
|
9491
9815
|
};
|
|
9492
9816
|
function PromptfooUnavailable({ reason }) {
|
|
9493
|
-
return /* @__PURE__ */
|
|
9494
|
-
/* @__PURE__ */
|
|
9495
|
-
/* @__PURE__ */
|
|
9817
|
+
return /* @__PURE__ */ jsxs29(Flex22, { align: "center", gap: 2, children: [
|
|
9818
|
+
/* @__PURE__ */ jsx37(Text33, { muted: true, size: 2, children: "Promptfoo report not available" }),
|
|
9819
|
+
/* @__PURE__ */ jsx37(InfoTip, { text: UNAVAILABLE_TOOLTIPS[reason] ?? "" })
|
|
9496
9820
|
] });
|
|
9497
9821
|
}
|
|
9498
9822
|
|
|
9499
9823
|
// src/components/report-detail/report-actions/ActionButton.tsx
|
|
9500
|
-
import { Button as
|
|
9501
|
-
import { jsx as
|
|
9824
|
+
import { Button as Button6, useToast as useToast2 } from "@sanity/ui";
|
|
9825
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
9502
9826
|
|
|
9503
9827
|
// src/components/report-detail/report-actions/JudgmentActions.tsx
|
|
9504
9828
|
import { DocumentTextIcon, LinkIcon as LinkIcon3 } from "@sanity/icons";
|
|
9505
9829
|
import { MenuDivider, MenuItem, useToast as useToast3 } from "@sanity/ui";
|
|
9506
|
-
import { useCallback as
|
|
9830
|
+
import { useCallback as useCallback24 } from "react";
|
|
9507
9831
|
|
|
9508
9832
|
// src/components/report-detail/report-actions/SplitActionButton.tsx
|
|
9509
|
-
import { ChevronDownIcon as
|
|
9510
|
-
import { Button as
|
|
9511
|
-
import { jsx as
|
|
9833
|
+
import { ChevronDownIcon as ChevronDownIcon3 } from "@sanity/icons";
|
|
9834
|
+
import { Button as Button7, Flex as Flex23, Menu, MenuButton } from "@sanity/ui";
|
|
9835
|
+
import { jsx as jsx39, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
9512
9836
|
function SplitActionButton({
|
|
9513
9837
|
menu,
|
|
9514
9838
|
menuId,
|
|
9515
9839
|
placement = "bottom-end",
|
|
9516
9840
|
primary
|
|
9517
9841
|
}) {
|
|
9518
|
-
return /* @__PURE__ */
|
|
9519
|
-
/* @__PURE__ */
|
|
9520
|
-
|
|
9842
|
+
return /* @__PURE__ */ jsxs30(Flex23, { children: [
|
|
9843
|
+
/* @__PURE__ */ jsx39(
|
|
9844
|
+
Button7,
|
|
9521
9845
|
{
|
|
9522
9846
|
fontSize: primary.fontSize,
|
|
9523
9847
|
icon: primary.icon,
|
|
@@ -9533,13 +9857,13 @@ function SplitActionButton({
|
|
|
9533
9857
|
text: primary.text
|
|
9534
9858
|
}
|
|
9535
9859
|
),
|
|
9536
|
-
/* @__PURE__ */
|
|
9860
|
+
/* @__PURE__ */ jsx39(
|
|
9537
9861
|
MenuButton,
|
|
9538
9862
|
{
|
|
9539
|
-
button: /* @__PURE__ */
|
|
9540
|
-
|
|
9863
|
+
button: /* @__PURE__ */ jsx39(
|
|
9864
|
+
Button7,
|
|
9541
9865
|
{
|
|
9542
|
-
icon:
|
|
9866
|
+
icon: ChevronDownIcon3,
|
|
9543
9867
|
mode: "ghost",
|
|
9544
9868
|
padding: 2,
|
|
9545
9869
|
style: {
|
|
@@ -9550,7 +9874,7 @@ function SplitActionButton({
|
|
|
9550
9874
|
}
|
|
9551
9875
|
),
|
|
9552
9876
|
id: menuId,
|
|
9553
|
-
menu: /* @__PURE__ */
|
|
9877
|
+
menu: /* @__PURE__ */ jsx39(Menu, { children: menu }),
|
|
9554
9878
|
popover: { placement, portal: true }
|
|
9555
9879
|
}
|
|
9556
9880
|
)
|
|
@@ -9558,10 +9882,10 @@ function SplitActionButton({
|
|
|
9558
9882
|
}
|
|
9559
9883
|
|
|
9560
9884
|
// src/components/report-detail/report-actions/JudgmentActions.tsx
|
|
9561
|
-
import { Fragment as
|
|
9885
|
+
import { Fragment as Fragment11, jsx as jsx40, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
9562
9886
|
function JudgmentActions({ onShowPrompts } = {}) {
|
|
9563
9887
|
const toast = useToast3();
|
|
9564
|
-
const handleCopyLink =
|
|
9888
|
+
const handleCopyLink = useCallback24(() => {
|
|
9565
9889
|
navigator.clipboard.writeText(window.location.href).then(
|
|
9566
9890
|
() => {
|
|
9567
9891
|
toast.push({
|
|
@@ -9579,12 +9903,12 @@ function JudgmentActions({ onShowPrompts } = {}) {
|
|
|
9579
9903
|
}
|
|
9580
9904
|
);
|
|
9581
9905
|
}, [toast]);
|
|
9582
|
-
return /* @__PURE__ */
|
|
9906
|
+
return /* @__PURE__ */ jsx40(
|
|
9583
9907
|
SplitActionButton,
|
|
9584
9908
|
{
|
|
9585
|
-
menu: /* @__PURE__ */
|
|
9586
|
-
onShowPrompts && /* @__PURE__ */
|
|
9587
|
-
/* @__PURE__ */
|
|
9909
|
+
menu: /* @__PURE__ */ jsxs31(Fragment11, { children: [
|
|
9910
|
+
onShowPrompts && /* @__PURE__ */ jsxs31(Fragment11, { children: [
|
|
9911
|
+
/* @__PURE__ */ jsx40(
|
|
9588
9912
|
MenuItem,
|
|
9589
9913
|
{
|
|
9590
9914
|
icon: DocumentTextIcon,
|
|
@@ -9592,9 +9916,9 @@ function JudgmentActions({ onShowPrompts } = {}) {
|
|
|
9592
9916
|
text: "Show prompts"
|
|
9593
9917
|
}
|
|
9594
9918
|
),
|
|
9595
|
-
/* @__PURE__ */
|
|
9919
|
+
/* @__PURE__ */ jsx40(MenuDivider, {})
|
|
9596
9920
|
] }),
|
|
9597
|
-
/* @__PURE__ */
|
|
9921
|
+
/* @__PURE__ */ jsx40(MenuItem, { icon: LinkIcon3, onClick: handleCopyLink, text: "Copy link" })
|
|
9598
9922
|
] }),
|
|
9599
9923
|
menuId: "judgment-actions-menu",
|
|
9600
9924
|
primary: {
|
|
@@ -9611,20 +9935,20 @@ function JudgmentActions({ onShowPrompts } = {}) {
|
|
|
9611
9935
|
// src/components/report-detail/report-actions/ReportActions.tsx
|
|
9612
9936
|
import { CopyIcon as CopyIcon3 } from "@sanity/icons";
|
|
9613
9937
|
import { MenuDivider as MenuDivider2, useToast as useToast9 } from "@sanity/ui";
|
|
9614
|
-
import { useCallback as
|
|
9938
|
+
import { useCallback as useCallback30, useState as useState22 } from "react";
|
|
9615
9939
|
import { useClient as useClient9 } from "sanity";
|
|
9616
9940
|
|
|
9617
9941
|
// src/components/report-detail/report-actions/CopyReportAction.tsx
|
|
9618
9942
|
import { ClipboardIcon } from "@sanity/icons";
|
|
9619
9943
|
import { MenuItem as MenuItem2, useToast as useToast4 } from "@sanity/ui";
|
|
9620
|
-
import { useCallback as
|
|
9944
|
+
import { useCallback as useCallback25, useState as useState19 } from "react";
|
|
9621
9945
|
import { useClient as useClient6 } from "sanity";
|
|
9622
|
-
import { jsx as
|
|
9946
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
9623
9947
|
function CopyReportAction({ documentId }) {
|
|
9624
9948
|
const client = useClient6({ apiVersion: API_VERSION });
|
|
9625
9949
|
const toast = useToast4();
|
|
9626
|
-
const [copying, setCopying] =
|
|
9627
|
-
const handleClick =
|
|
9950
|
+
const [copying, setCopying] = useState19(false);
|
|
9951
|
+
const handleClick = useCallback25(async () => {
|
|
9628
9952
|
setCopying(true);
|
|
9629
9953
|
try {
|
|
9630
9954
|
const doc = await client.fetch(
|
|
@@ -9656,7 +9980,7 @@ function CopyReportAction({ documentId }) {
|
|
|
9656
9980
|
setCopying(false);
|
|
9657
9981
|
}
|
|
9658
9982
|
}, [client, documentId, toast]);
|
|
9659
|
-
return /* @__PURE__ */
|
|
9983
|
+
return /* @__PURE__ */ jsx41(
|
|
9660
9984
|
MenuItem2,
|
|
9661
9985
|
{
|
|
9662
9986
|
disabled: copying,
|
|
@@ -9670,11 +9994,11 @@ function CopyReportAction({ documentId }) {
|
|
|
9670
9994
|
// src/components/report-detail/report-actions/CopyReportIdAction.tsx
|
|
9671
9995
|
import { CopyIcon as CopyIcon2 } from "@sanity/icons";
|
|
9672
9996
|
import { MenuItem as MenuItem3, useToast as useToast5 } from "@sanity/ui";
|
|
9673
|
-
import { useCallback as
|
|
9674
|
-
import { jsx as
|
|
9997
|
+
import { useCallback as useCallback26 } from "react";
|
|
9998
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
9675
9999
|
function CopyReportIdAction({ reportId }) {
|
|
9676
10000
|
const toast = useToast5();
|
|
9677
|
-
const handleClick =
|
|
10001
|
+
const handleClick = useCallback26(() => {
|
|
9678
10002
|
navigator.clipboard.writeText(reportId).then(
|
|
9679
10003
|
() => {
|
|
9680
10004
|
toast.push({
|
|
@@ -9692,19 +10016,19 @@ function CopyReportIdAction({ reportId }) {
|
|
|
9692
10016
|
}
|
|
9693
10017
|
);
|
|
9694
10018
|
}, [reportId, toast]);
|
|
9695
|
-
return /* @__PURE__ */
|
|
10019
|
+
return /* @__PURE__ */ jsx42(MenuItem3, { icon: CopyIcon2, onClick: handleClick, text: "Copy report ID" });
|
|
9696
10020
|
}
|
|
9697
10021
|
|
|
9698
10022
|
// src/components/report-detail/report-actions/CopyVisionQueryAction.tsx
|
|
9699
10023
|
import { SearchIcon as SearchIcon6 } from "@sanity/icons";
|
|
9700
10024
|
import { MenuItem as MenuItem4, useToast as useToast6 } from "@sanity/ui";
|
|
9701
|
-
import { useCallback as
|
|
9702
|
-
import { jsx as
|
|
10025
|
+
import { useCallback as useCallback27 } from "react";
|
|
10026
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
9703
10027
|
function CopyVisionQueryAction({
|
|
9704
10028
|
reportId
|
|
9705
10029
|
}) {
|
|
9706
10030
|
const toast = useToast6();
|
|
9707
|
-
const handleClick =
|
|
10031
|
+
const handleClick = useCallback27(() => {
|
|
9708
10032
|
const query = `*[_type == "ailf.report" && reportId == "${reportId}"][0]`;
|
|
9709
10033
|
navigator.clipboard.writeText(query).then(
|
|
9710
10034
|
() => {
|
|
@@ -9724,7 +10048,7 @@ function CopyVisionQueryAction({
|
|
|
9724
10048
|
}
|
|
9725
10049
|
);
|
|
9726
10050
|
}, [reportId, toast]);
|
|
9727
|
-
return /* @__PURE__ */
|
|
10051
|
+
return /* @__PURE__ */ jsx43(
|
|
9728
10052
|
MenuItem4,
|
|
9729
10053
|
{
|
|
9730
10054
|
icon: SearchIcon6,
|
|
@@ -9735,25 +10059,25 @@ function CopyVisionQueryAction({
|
|
|
9735
10059
|
}
|
|
9736
10060
|
|
|
9737
10061
|
// src/components/report-detail/report-actions/DeleteConfirmDialog.tsx
|
|
9738
|
-
import { Box as
|
|
9739
|
-
import { jsx as
|
|
10062
|
+
import { Box as Box23, Button as Button8, Card as Card17, Dialog as Dialog2, Flex as Flex24, Stack as Stack26, Text as Text34 } from "@sanity/ui";
|
|
10063
|
+
import { jsx as jsx44, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
9740
10064
|
function DeleteConfirmDialog({
|
|
9741
10065
|
isDeleting,
|
|
9742
10066
|
onClose,
|
|
9743
10067
|
onConfirm,
|
|
9744
10068
|
reportId
|
|
9745
10069
|
}) {
|
|
9746
|
-
return /* @__PURE__ */
|
|
10070
|
+
return /* @__PURE__ */ jsx44(
|
|
9747
10071
|
Dialog2,
|
|
9748
10072
|
{
|
|
9749
10073
|
header: "Delete Report",
|
|
9750
10074
|
id: "delete-report-dialog",
|
|
9751
10075
|
onClose,
|
|
9752
10076
|
width: 1,
|
|
9753
|
-
children: /* @__PURE__ */
|
|
9754
|
-
/* @__PURE__ */
|
|
9755
|
-
/* @__PURE__ */
|
|
9756
|
-
|
|
10077
|
+
children: /* @__PURE__ */ jsx44(Box23, { padding: 4, children: /* @__PURE__ */ jsxs32(Stack26, { space: 4, children: [
|
|
10078
|
+
/* @__PURE__ */ jsx44(Text34, { children: "Are you sure you want to delete this report? This action cannot be undone." }),
|
|
10079
|
+
/* @__PURE__ */ jsx44(Card17, { border: true, padding: 3, radius: 2, tone: "transparent", children: /* @__PURE__ */ jsx44(
|
|
10080
|
+
Text34,
|
|
9757
10081
|
{
|
|
9758
10082
|
muted: true,
|
|
9759
10083
|
size: 1,
|
|
@@ -9761,9 +10085,9 @@ function DeleteConfirmDialog({
|
|
|
9761
10085
|
children: reportId
|
|
9762
10086
|
}
|
|
9763
10087
|
) }),
|
|
9764
|
-
/* @__PURE__ */
|
|
9765
|
-
/* @__PURE__ */
|
|
9766
|
-
|
|
10088
|
+
/* @__PURE__ */ jsxs32(Flex24, { gap: 2, justify: "flex-end", children: [
|
|
10089
|
+
/* @__PURE__ */ jsx44(
|
|
10090
|
+
Button8,
|
|
9767
10091
|
{
|
|
9768
10092
|
disabled: isDeleting,
|
|
9769
10093
|
mode: "ghost",
|
|
@@ -9771,8 +10095,8 @@ function DeleteConfirmDialog({
|
|
|
9771
10095
|
text: "Cancel"
|
|
9772
10096
|
}
|
|
9773
10097
|
),
|
|
9774
|
-
/* @__PURE__ */
|
|
9775
|
-
|
|
10098
|
+
/* @__PURE__ */ jsx44(
|
|
10099
|
+
Button8,
|
|
9776
10100
|
{
|
|
9777
10101
|
disabled: isDeleting,
|
|
9778
10102
|
onClick: onConfirm,
|
|
@@ -9789,11 +10113,11 @@ function DeleteConfirmDialog({
|
|
|
9789
10113
|
// src/components/report-detail/report-actions/DeleteReportAction.tsx
|
|
9790
10114
|
import { TrashIcon } from "@sanity/icons";
|
|
9791
10115
|
import { MenuItem as MenuItem5 } from "@sanity/ui";
|
|
9792
|
-
import { jsx as
|
|
10116
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
9793
10117
|
function DeleteReportAction({
|
|
9794
10118
|
onRequestDelete
|
|
9795
10119
|
}) {
|
|
9796
|
-
return /* @__PURE__ */
|
|
10120
|
+
return /* @__PURE__ */ jsx45(
|
|
9797
10121
|
MenuItem5,
|
|
9798
10122
|
{
|
|
9799
10123
|
icon: TrashIcon,
|
|
@@ -9807,17 +10131,17 @@ function DeleteReportAction({
|
|
|
9807
10131
|
// src/components/report-detail/report-actions/DownloadReportAction.tsx
|
|
9808
10132
|
import { DownloadIcon } from "@sanity/icons";
|
|
9809
10133
|
import { MenuItem as MenuItem6, useToast as useToast7 } from "@sanity/ui";
|
|
9810
|
-
import { useCallback as
|
|
10134
|
+
import { useCallback as useCallback28, useState as useState20 } from "react";
|
|
9811
10135
|
import { useClient as useClient7 } from "sanity";
|
|
9812
|
-
import { jsx as
|
|
10136
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
9813
10137
|
function DownloadReportAction({
|
|
9814
10138
|
documentId,
|
|
9815
10139
|
reportId
|
|
9816
10140
|
}) {
|
|
9817
10141
|
const client = useClient7({ apiVersion: API_VERSION });
|
|
9818
10142
|
const toast = useToast7();
|
|
9819
|
-
const [downloading, setDownloading] =
|
|
9820
|
-
const handleClick =
|
|
10143
|
+
const [downloading, setDownloading] = useState20(false);
|
|
10144
|
+
const handleClick = useCallback28(async () => {
|
|
9821
10145
|
setDownloading(true);
|
|
9822
10146
|
try {
|
|
9823
10147
|
const doc = await client.fetch(
|
|
@@ -9857,7 +10181,7 @@ function DownloadReportAction({
|
|
|
9857
10181
|
setDownloading(false);
|
|
9858
10182
|
}
|
|
9859
10183
|
}, [client, documentId, reportId, toast]);
|
|
9860
|
-
return /* @__PURE__ */
|
|
10184
|
+
return /* @__PURE__ */ jsx46(
|
|
9861
10185
|
MenuItem6,
|
|
9862
10186
|
{
|
|
9863
10187
|
disabled: downloading,
|
|
@@ -9871,7 +10195,7 @@ function DownloadReportAction({
|
|
|
9871
10195
|
// src/components/report-detail/report-actions/RerunEvaluationAction.tsx
|
|
9872
10196
|
import { PlayIcon as PlayIcon2 } from "@sanity/icons";
|
|
9873
10197
|
import { MenuItem as MenuItem7, useToast as useToast8 } from "@sanity/ui";
|
|
9874
|
-
import { useCallback as
|
|
10198
|
+
import { useCallback as useCallback29, useState as useState21 } from "react";
|
|
9875
10199
|
import { useClient as useClient8, useCurrentUser as useCurrentUser3 } from "sanity";
|
|
9876
10200
|
|
|
9877
10201
|
// src/lib/eval-scope.ts
|
|
@@ -9887,7 +10211,7 @@ function extractEvalScope(provenance) {
|
|
|
9887
10211
|
}
|
|
9888
10212
|
|
|
9889
10213
|
// src/components/report-detail/report-actions/RerunEvaluationAction.tsx
|
|
9890
|
-
import { jsx as
|
|
10214
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
9891
10215
|
var EVAL_REQUEST_TYPE2 = "ailf.evalRequest";
|
|
9892
10216
|
function slugify2(s) {
|
|
9893
10217
|
return s.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40);
|
|
@@ -9926,8 +10250,8 @@ function RerunEvaluationAction({
|
|
|
9926
10250
|
const client = useClient8({ apiVersion: API_VERSION });
|
|
9927
10251
|
const currentUser = useCurrentUser3();
|
|
9928
10252
|
const toast = useToast8();
|
|
9929
|
-
const [requesting, setRequesting] =
|
|
9930
|
-
const handleClick =
|
|
10253
|
+
const [requesting, setRequesting] = useState21(false);
|
|
10254
|
+
const handleClick = useCallback29(async () => {
|
|
9931
10255
|
setRequesting(true);
|
|
9932
10256
|
try {
|
|
9933
10257
|
const scope = extractEvalScope(provenance);
|
|
@@ -9954,7 +10278,7 @@ function RerunEvaluationAction({
|
|
|
9954
10278
|
setRequesting(false);
|
|
9955
10279
|
}
|
|
9956
10280
|
}, [client, currentUser?.id, provenance, reportId, toast]);
|
|
9957
|
-
return /* @__PURE__ */
|
|
10281
|
+
return /* @__PURE__ */ jsx47(
|
|
9958
10282
|
MenuItem7,
|
|
9959
10283
|
{
|
|
9960
10284
|
disabled: requesting,
|
|
@@ -9966,7 +10290,7 @@ function RerunEvaluationAction({
|
|
|
9966
10290
|
}
|
|
9967
10291
|
|
|
9968
10292
|
// src/components/report-detail/report-actions/ReportActions.tsx
|
|
9969
|
-
import { Fragment as
|
|
10293
|
+
import { Fragment as Fragment12, jsx as jsx48, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
9970
10294
|
function ReportActions({
|
|
9971
10295
|
documentId,
|
|
9972
10296
|
onDeleted,
|
|
@@ -9975,7 +10299,7 @@ function ReportActions({
|
|
|
9975
10299
|
}) {
|
|
9976
10300
|
const client = useClient9({ apiVersion: API_VERSION });
|
|
9977
10301
|
const toast = useToast9();
|
|
9978
|
-
const handleCopyId =
|
|
10302
|
+
const handleCopyId = useCallback30(() => {
|
|
9979
10303
|
navigator.clipboard.writeText(reportId).then(
|
|
9980
10304
|
() => {
|
|
9981
10305
|
toast.push({
|
|
@@ -9993,15 +10317,15 @@ function ReportActions({
|
|
|
9993
10317
|
}
|
|
9994
10318
|
);
|
|
9995
10319
|
}, [reportId, toast]);
|
|
9996
|
-
const [deleteDialogOpen, setDeleteDialogOpen] =
|
|
9997
|
-
const [deleting, setDeleting] =
|
|
9998
|
-
const handleRequestDelete =
|
|
10320
|
+
const [deleteDialogOpen, setDeleteDialogOpen] = useState22(false);
|
|
10321
|
+
const [deleting, setDeleting] = useState22(false);
|
|
10322
|
+
const handleRequestDelete = useCallback30(() => {
|
|
9999
10323
|
setDeleteDialogOpen(true);
|
|
10000
10324
|
}, []);
|
|
10001
|
-
const handleDeleteClose =
|
|
10325
|
+
const handleDeleteClose = useCallback30(() => {
|
|
10002
10326
|
if (!deleting) setDeleteDialogOpen(false);
|
|
10003
10327
|
}, [deleting]);
|
|
10004
|
-
const handleDeleteConfirm =
|
|
10328
|
+
const handleDeleteConfirm = useCallback30(async () => {
|
|
10005
10329
|
setDeleting(true);
|
|
10006
10330
|
try {
|
|
10007
10331
|
await client.delete(documentId);
|
|
@@ -10022,25 +10346,25 @@ function ReportActions({
|
|
|
10022
10346
|
setDeleting(false);
|
|
10023
10347
|
}
|
|
10024
10348
|
}, [client, documentId, onDeleted, toast]);
|
|
10025
|
-
return /* @__PURE__ */
|
|
10026
|
-
/* @__PURE__ */
|
|
10349
|
+
return /* @__PURE__ */ jsxs33(Fragment12, { children: [
|
|
10350
|
+
/* @__PURE__ */ jsx48(
|
|
10027
10351
|
SplitActionButton,
|
|
10028
10352
|
{
|
|
10029
|
-
menu: /* @__PURE__ */
|
|
10030
|
-
/* @__PURE__ */
|
|
10031
|
-
/* @__PURE__ */
|
|
10353
|
+
menu: /* @__PURE__ */ jsxs33(Fragment12, { children: [
|
|
10354
|
+
/* @__PURE__ */ jsx48(CopyReportIdAction, { reportId }),
|
|
10355
|
+
/* @__PURE__ */ jsx48(
|
|
10032
10356
|
RerunEvaluationAction,
|
|
10033
10357
|
{
|
|
10034
10358
|
provenance,
|
|
10035
10359
|
reportId
|
|
10036
10360
|
}
|
|
10037
10361
|
),
|
|
10038
|
-
/* @__PURE__ */
|
|
10039
|
-
/* @__PURE__ */
|
|
10040
|
-
/* @__PURE__ */
|
|
10041
|
-
/* @__PURE__ */
|
|
10042
|
-
/* @__PURE__ */
|
|
10043
|
-
/* @__PURE__ */
|
|
10362
|
+
/* @__PURE__ */ jsx48(MenuDivider2, {}),
|
|
10363
|
+
/* @__PURE__ */ jsx48(DownloadReportAction, { documentId, reportId }),
|
|
10364
|
+
/* @__PURE__ */ jsx48(CopyReportAction, { documentId }),
|
|
10365
|
+
/* @__PURE__ */ jsx48(CopyVisionQueryAction, { reportId }),
|
|
10366
|
+
/* @__PURE__ */ jsx48(MenuDivider2, {}),
|
|
10367
|
+
/* @__PURE__ */ jsx48(DeleteReportAction, { onRequestDelete: handleRequestDelete })
|
|
10044
10368
|
] }),
|
|
10045
10369
|
menuId: "report-actions-menu",
|
|
10046
10370
|
primary: {
|
|
@@ -10050,7 +10374,7 @@ function ReportActions({
|
|
|
10050
10374
|
}
|
|
10051
10375
|
}
|
|
10052
10376
|
),
|
|
10053
|
-
deleteDialogOpen && /* @__PURE__ */
|
|
10377
|
+
deleteDialogOpen && /* @__PURE__ */ jsx48(
|
|
10054
10378
|
DeleteConfirmDialog,
|
|
10055
10379
|
{
|
|
10056
10380
|
isDeleting: deleting,
|
|
@@ -10064,8 +10388,8 @@ function ReportActions({
|
|
|
10064
10388
|
|
|
10065
10389
|
// src/components/report-detail/ReportHeader.tsx
|
|
10066
10390
|
import { ArrowLeftIcon as ArrowLeftIcon2 } from "@sanity/icons";
|
|
10067
|
-
import { Button as
|
|
10068
|
-
import { jsx as
|
|
10391
|
+
import { Button as Button9, Flex as Flex25, Stack as Stack27, Text as Text35 } from "@sanity/ui";
|
|
10392
|
+
import { jsx as jsx49, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
10069
10393
|
function ReportHeader({
|
|
10070
10394
|
completedAt,
|
|
10071
10395
|
onBack,
|
|
@@ -10075,11 +10399,11 @@ function ReportHeader({
|
|
|
10075
10399
|
const dateLabel = formatCardDate(completedAt);
|
|
10076
10400
|
const displayTitle = title ?? tag ?? dateLabel;
|
|
10077
10401
|
const hasSubtitle = Boolean(title ?? tag);
|
|
10078
|
-
return /* @__PURE__ */
|
|
10079
|
-
/* @__PURE__ */
|
|
10080
|
-
/* @__PURE__ */
|
|
10081
|
-
/* @__PURE__ */
|
|
10082
|
-
hasSubtitle && /* @__PURE__ */
|
|
10402
|
+
return /* @__PURE__ */ jsxs34(Flex25, { align: "center", gap: 3, children: [
|
|
10403
|
+
/* @__PURE__ */ jsx49(Button9, { icon: ArrowLeftIcon2, mode: "bleed", onClick: onBack, text: "Back" }),
|
|
10404
|
+
/* @__PURE__ */ jsxs34(Stack27, { flex: 1, space: 1, children: [
|
|
10405
|
+
/* @__PURE__ */ jsx49(Text35, { size: 4, weight: "bold", children: displayTitle }),
|
|
10406
|
+
hasSubtitle && /* @__PURE__ */ jsx49(Text35, { muted: true, size: 2, children: dateLabel })
|
|
10083
10407
|
] })
|
|
10084
10408
|
] });
|
|
10085
10409
|
}
|
|
@@ -10087,17 +10411,17 @@ function ReportHeader({
|
|
|
10087
10411
|
// src/components/report-detail/StrengthsList.tsx
|
|
10088
10412
|
import { useMemo as useMemo14 } from "react";
|
|
10089
10413
|
import { CheckmarkCircleIcon as CheckmarkCircleIcon2, SearchIcon as SearchIcon7 } from "@sanity/icons";
|
|
10090
|
-
import { Box as
|
|
10414
|
+
import { Box as Box25, Flex as Flex28, Stack as Stack29, Text as Text38 } from "@sanity/ui";
|
|
10091
10415
|
|
|
10092
10416
|
// src/components/report-detail/AreaScoresGrid.tsx
|
|
10093
10417
|
import React3, {
|
|
10094
|
-
useCallback as
|
|
10418
|
+
useCallback as useCallback31,
|
|
10095
10419
|
useMemo as useMemo12,
|
|
10096
|
-
useState as
|
|
10420
|
+
useState as useState23
|
|
10097
10421
|
} from "react";
|
|
10098
10422
|
import { WarningOutlineIcon as WarningOutlineIcon2 } from "@sanity/icons";
|
|
10099
|
-
import { Box as
|
|
10100
|
-
import { Fragment as
|
|
10423
|
+
import { Box as Box24, Flex as Flex26, Stack as Stack28, Text as Text36 } from "@sanity/ui";
|
|
10424
|
+
import { Fragment as Fragment13, jsx as jsx50, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
10101
10425
|
var DIMENSION_TOOLTIPS2 = {
|
|
10102
10426
|
agentOutput: "Quality and completeness of the agent's output. Graded 0\u2013100.",
|
|
10103
10427
|
assertionPassRate: "Fraction of structural assertions that passed. Graded 0\u2013100.",
|
|
@@ -10143,9 +10467,9 @@ function AreaScoresGrid({
|
|
|
10143
10467
|
);
|
|
10144
10468
|
const showLift = isLiteracyMode(mode);
|
|
10145
10469
|
const dimKeys = useMemo12(() => collectDimensionKeys(scores), [scores]);
|
|
10146
|
-
const [sortField, setSortField] =
|
|
10147
|
-
const [sortDir, setSortDir] =
|
|
10148
|
-
const handleSort =
|
|
10470
|
+
const [sortField, setSortField] = useState23("score");
|
|
10471
|
+
const [sortDir, setSortDir] = useState23("desc");
|
|
10472
|
+
const handleSort = useCallback31(
|
|
10149
10473
|
(field) => {
|
|
10150
10474
|
if (field === sortField) {
|
|
10151
10475
|
setSortDir((d) => d === "asc" ? "desc" : "asc");
|
|
@@ -10189,8 +10513,8 @@ function AreaScoresGrid({
|
|
|
10189
10513
|
}
|
|
10190
10514
|
return map;
|
|
10191
10515
|
}, [perModel]);
|
|
10192
|
-
return /* @__PURE__ */
|
|
10193
|
-
/* @__PURE__ */
|
|
10516
|
+
return /* @__PURE__ */ jsxs35(Box24, { ref: containerRef, style: { ...neutralCardStyle, overflow: "auto" }, children: [
|
|
10517
|
+
/* @__PURE__ */ jsxs35(
|
|
10194
10518
|
"div",
|
|
10195
10519
|
{
|
|
10196
10520
|
style: {
|
|
@@ -10206,7 +10530,7 @@ function AreaScoresGrid({
|
|
|
10206
10530
|
padding: "12px 16px 8px"
|
|
10207
10531
|
},
|
|
10208
10532
|
children: [
|
|
10209
|
-
/* @__PURE__ */
|
|
10533
|
+
/* @__PURE__ */ jsx50(
|
|
10210
10534
|
ColHeader2,
|
|
10211
10535
|
{
|
|
10212
10536
|
active: sortField === "score",
|
|
@@ -10216,7 +10540,7 @@ function AreaScoresGrid({
|
|
|
10216
10540
|
tooltip: GLOSSARY.score
|
|
10217
10541
|
}
|
|
10218
10542
|
),
|
|
10219
|
-
/* @__PURE__ */
|
|
10543
|
+
/* @__PURE__ */ jsx50(
|
|
10220
10544
|
ColHeader2,
|
|
10221
10545
|
{
|
|
10222
10546
|
active: sortField === "area",
|
|
@@ -10225,7 +10549,7 @@ function AreaScoresGrid({
|
|
|
10225
10549
|
onClick: () => handleSort("area")
|
|
10226
10550
|
}
|
|
10227
10551
|
),
|
|
10228
|
-
dimKeys.map((key) => /* @__PURE__ */
|
|
10552
|
+
dimKeys.map((key) => /* @__PURE__ */ jsx50(
|
|
10229
10553
|
ColHeader2,
|
|
10230
10554
|
{
|
|
10231
10555
|
active: sortField === key,
|
|
@@ -10236,7 +10560,7 @@ function AreaScoresGrid({
|
|
|
10236
10560
|
},
|
|
10237
10561
|
key
|
|
10238
10562
|
)),
|
|
10239
|
-
tier !== "narrow" && showLift && /* @__PURE__ */
|
|
10563
|
+
tier !== "narrow" && showLift && /* @__PURE__ */ jsx50(
|
|
10240
10564
|
ColHeader2,
|
|
10241
10565
|
{
|
|
10242
10566
|
active: sortField === "lift",
|
|
@@ -10246,12 +10570,12 @@ function AreaScoresGrid({
|
|
|
10246
10570
|
tooltip: GLOSSARY.docLift
|
|
10247
10571
|
}
|
|
10248
10572
|
),
|
|
10249
|
-
tier === "full" && hasActual && /* @__PURE__ */
|
|
10573
|
+
tier === "full" && hasActual && /* @__PURE__ */ jsx50(ColHeader2, { label: "Actual", tooltip: GLOSSARY.actualScore })
|
|
10250
10574
|
]
|
|
10251
10575
|
}
|
|
10252
10576
|
),
|
|
10253
|
-
sorted.map((area) => /* @__PURE__ */
|
|
10254
|
-
/* @__PURE__ */
|
|
10577
|
+
sorted.map((area) => /* @__PURE__ */ jsxs35(React3.Fragment, { children: [
|
|
10578
|
+
/* @__PURE__ */ jsx50(
|
|
10255
10579
|
AreaRow,
|
|
10256
10580
|
{
|
|
10257
10581
|
area,
|
|
@@ -10262,7 +10586,7 @@ function AreaScoresGrid({
|
|
|
10262
10586
|
tier
|
|
10263
10587
|
}
|
|
10264
10588
|
),
|
|
10265
|
-
modelScoresByFeature && /* @__PURE__ */
|
|
10589
|
+
modelScoresByFeature && /* @__PURE__ */ jsx50(
|
|
10266
10590
|
ModelSubRows,
|
|
10267
10591
|
{
|
|
10268
10592
|
dimKeys,
|
|
@@ -10283,7 +10607,7 @@ function ModelSubRows({
|
|
|
10283
10607
|
tier
|
|
10284
10608
|
}) {
|
|
10285
10609
|
if (!models || models.length === 0) return null;
|
|
10286
|
-
return /* @__PURE__ */
|
|
10610
|
+
return /* @__PURE__ */ jsx50(Fragment13, { children: models.map((entry) => /* @__PURE__ */ jsx50(
|
|
10287
10611
|
ModelRow2,
|
|
10288
10612
|
{
|
|
10289
10613
|
dimKeys,
|
|
@@ -10305,7 +10629,7 @@ function ModelRow2({
|
|
|
10305
10629
|
tier
|
|
10306
10630
|
}) {
|
|
10307
10631
|
const isNarrow = tier === "narrow";
|
|
10308
|
-
return /* @__PURE__ */
|
|
10632
|
+
return /* @__PURE__ */ jsxs35(
|
|
10309
10633
|
"div",
|
|
10310
10634
|
{
|
|
10311
10635
|
style: {
|
|
@@ -10323,8 +10647,8 @@ function ModelRow2({
|
|
|
10323
10647
|
padding: isNarrow ? "6px 12px 6px 20px" : "6px 16px 6px 28px"
|
|
10324
10648
|
},
|
|
10325
10649
|
children: [
|
|
10326
|
-
/* @__PURE__ */
|
|
10327
|
-
|
|
10650
|
+
/* @__PURE__ */ jsx50(Flex26, { align: "center", children: /* @__PURE__ */ jsx50(
|
|
10651
|
+
Text36,
|
|
10328
10652
|
{
|
|
10329
10653
|
size: 1,
|
|
10330
10654
|
style: {
|
|
@@ -10335,8 +10659,8 @@ function ModelRow2({
|
|
|
10335
10659
|
children: Math.round(scores.totalScore)
|
|
10336
10660
|
}
|
|
10337
10661
|
) }),
|
|
10338
|
-
/* @__PURE__ */
|
|
10339
|
-
dimKeys.map((key) => /* @__PURE__ */
|
|
10662
|
+
/* @__PURE__ */ jsx50(Flex26, { align: "center", gap: 2, children: /* @__PURE__ */ jsx50(Text36, { muted: true, size: 1, children: label }) }),
|
|
10663
|
+
dimKeys.map((key) => /* @__PURE__ */ jsx50(
|
|
10340
10664
|
DimCell,
|
|
10341
10665
|
{
|
|
10342
10666
|
area: label,
|
|
@@ -10346,8 +10670,8 @@ function ModelRow2({
|
|
|
10346
10670
|
},
|
|
10347
10671
|
key
|
|
10348
10672
|
)),
|
|
10349
|
-
!isNarrow && showLift && /* @__PURE__ */
|
|
10350
|
-
|
|
10673
|
+
!isNarrow && showLift && /* @__PURE__ */ jsxs35(
|
|
10674
|
+
Text36,
|
|
10351
10675
|
{
|
|
10352
10676
|
size: 1,
|
|
10353
10677
|
style: {
|
|
@@ -10361,8 +10685,8 @@ function ModelRow2({
|
|
|
10361
10685
|
]
|
|
10362
10686
|
}
|
|
10363
10687
|
),
|
|
10364
|
-
tier === "full" && hasActual && /* @__PURE__ */
|
|
10365
|
-
|
|
10688
|
+
tier === "full" && hasActual && /* @__PURE__ */ jsx50(
|
|
10689
|
+
Text36,
|
|
10366
10690
|
{
|
|
10367
10691
|
size: 1,
|
|
10368
10692
|
style: {
|
|
@@ -10386,7 +10710,7 @@ function AreaRow({
|
|
|
10386
10710
|
tier
|
|
10387
10711
|
}) {
|
|
10388
10712
|
const isNarrow = tier === "narrow";
|
|
10389
|
-
return /* @__PURE__ */
|
|
10713
|
+
return /* @__PURE__ */ jsxs35(
|
|
10390
10714
|
"div",
|
|
10391
10715
|
{
|
|
10392
10716
|
style: {
|
|
@@ -10403,15 +10727,15 @@ function AreaRow({
|
|
|
10403
10727
|
padding: isNarrow ? "8px 12px" : "10px 16px"
|
|
10404
10728
|
},
|
|
10405
10729
|
children: [
|
|
10406
|
-
/* @__PURE__ */
|
|
10407
|
-
/* @__PURE__ */
|
|
10730
|
+
/* @__PURE__ */ jsxs35(Flex26, { align: "center", gap: isNarrow ? 0 : 2, children: [
|
|
10731
|
+
/* @__PURE__ */ jsx50(
|
|
10408
10732
|
HoverTip,
|
|
10409
10733
|
{
|
|
10410
|
-
text: /* @__PURE__ */
|
|
10411
|
-
/* @__PURE__ */
|
|
10734
|
+
text: /* @__PURE__ */ jsxs35(Text36, { size: 2, style: { lineHeight: 1.5 }, children: [
|
|
10735
|
+
/* @__PURE__ */ jsx50("span", { style: { fontWeight: 600 }, children: area.feature }),
|
|
10412
10736
|
" score:",
|
|
10413
10737
|
" ",
|
|
10414
|
-
/* @__PURE__ */
|
|
10738
|
+
/* @__PURE__ */ jsx50(
|
|
10415
10739
|
"span",
|
|
10416
10740
|
{
|
|
10417
10741
|
style: {
|
|
@@ -10422,12 +10746,12 @@ function AreaRow({
|
|
|
10422
10746
|
children: Math.round(area.totalScore)
|
|
10423
10747
|
}
|
|
10424
10748
|
),
|
|
10425
|
-
/* @__PURE__ */
|
|
10749
|
+
/* @__PURE__ */ jsx50("span", { style: { color: "var(--card-muted-fg-color)" }, children: "/100" }),
|
|
10426
10750
|
".",
|
|
10427
10751
|
" ",
|
|
10428
10752
|
GLOSSARY.score
|
|
10429
10753
|
] }),
|
|
10430
|
-
children: /* @__PURE__ */
|
|
10754
|
+
children: /* @__PURE__ */ jsx50(
|
|
10431
10755
|
"div",
|
|
10432
10756
|
{
|
|
10433
10757
|
style: {
|
|
@@ -10448,11 +10772,11 @@ function AreaRow({
|
|
|
10448
10772
|
)
|
|
10449
10773
|
}
|
|
10450
10774
|
),
|
|
10451
|
-
!isNarrow && delta != null && delta !== 0 && /* @__PURE__ */
|
|
10775
|
+
!isNarrow && delta != null && delta !== 0 && /* @__PURE__ */ jsx50(HoverTip, { text: GLOSSARY.areaDelta, children: /* @__PURE__ */ jsx50(DeltaIndicator, { delta, icon: true, size: 1 }) })
|
|
10452
10776
|
] }),
|
|
10453
|
-
/* @__PURE__ */
|
|
10454
|
-
/* @__PURE__ */
|
|
10455
|
-
area.negativeDocLift && showLift && /* @__PURE__ */
|
|
10777
|
+
/* @__PURE__ */ jsxs35(Flex26, { align: "center", gap: 2, wrap: "wrap", children: [
|
|
10778
|
+
/* @__PURE__ */ jsx50(Text36, { size: 2, weight: "medium", children: area.feature }),
|
|
10779
|
+
area.negativeDocLift && showLift && /* @__PURE__ */ jsx50(HoverTip, { text: GLOSSARY.docsHurt, children: /* @__PURE__ */ jsx50(
|
|
10456
10780
|
"span",
|
|
10457
10781
|
{
|
|
10458
10782
|
style: {
|
|
@@ -10465,11 +10789,11 @@ function AreaRow({
|
|
|
10465
10789
|
gap: 3,
|
|
10466
10790
|
padding: "1px 5px"
|
|
10467
10791
|
},
|
|
10468
|
-
children: /* @__PURE__ */
|
|
10792
|
+
children: /* @__PURE__ */ jsx50(WarningOutlineIcon2, {})
|
|
10469
10793
|
}
|
|
10470
10794
|
) })
|
|
10471
10795
|
] }),
|
|
10472
|
-
dimKeys.map((key) => /* @__PURE__ */
|
|
10796
|
+
dimKeys.map((key) => /* @__PURE__ */ jsx50(
|
|
10473
10797
|
DimCell,
|
|
10474
10798
|
{
|
|
10475
10799
|
area: area.feature,
|
|
@@ -10478,14 +10802,14 @@ function AreaRow({
|
|
|
10478
10802
|
},
|
|
10479
10803
|
key
|
|
10480
10804
|
)),
|
|
10481
|
-
!isNarrow && showLift && /* @__PURE__ */
|
|
10805
|
+
!isNarrow && showLift && /* @__PURE__ */ jsx50(
|
|
10482
10806
|
HoverTip,
|
|
10483
10807
|
{
|
|
10484
|
-
text: /* @__PURE__ */
|
|
10485
|
-
/* @__PURE__ */
|
|
10808
|
+
text: /* @__PURE__ */ jsxs35(Text36, { size: 2, style: { lineHeight: 1.5 }, children: [
|
|
10809
|
+
/* @__PURE__ */ jsx50("span", { style: { fontWeight: 600 }, children: area.feature }),
|
|
10486
10810
|
" doc lift:",
|
|
10487
10811
|
" ",
|
|
10488
|
-
/* @__PURE__ */
|
|
10812
|
+
/* @__PURE__ */ jsxs35(
|
|
10489
10813
|
"span",
|
|
10490
10814
|
{
|
|
10491
10815
|
style: {
|
|
@@ -10503,8 +10827,8 @@ function AreaRow({
|
|
|
10503
10827
|
"pts. ",
|
|
10504
10828
|
GLOSSARY.docLift
|
|
10505
10829
|
] }),
|
|
10506
|
-
children: /* @__PURE__ */
|
|
10507
|
-
|
|
10830
|
+
children: /* @__PURE__ */ jsxs35(
|
|
10831
|
+
Text36,
|
|
10508
10832
|
{
|
|
10509
10833
|
size: 2,
|
|
10510
10834
|
style: {
|
|
@@ -10520,12 +10844,12 @@ function AreaRow({
|
|
|
10520
10844
|
)
|
|
10521
10845
|
}
|
|
10522
10846
|
),
|
|
10523
|
-
tier === "full" && hasActual && /* @__PURE__ */
|
|
10847
|
+
tier === "full" && hasActual && /* @__PURE__ */ jsx50(
|
|
10524
10848
|
HoverTip,
|
|
10525
10849
|
{
|
|
10526
10850
|
text: area.actualScore != null ? `${area.feature} actual score: ${Math.round(area.actualScore)}/100. ${GLOSSARY.actualScore}` : `No agentic data for ${area.feature}.`,
|
|
10527
|
-
children: /* @__PURE__ */
|
|
10528
|
-
|
|
10851
|
+
children: /* @__PURE__ */ jsx50(
|
|
10852
|
+
Text36,
|
|
10529
10853
|
{
|
|
10530
10854
|
size: 2,
|
|
10531
10855
|
style: {
|
|
@@ -10554,17 +10878,17 @@ function DimCell({
|
|
|
10554
10878
|
const tooltip = dimKey ? DIMENSION_TOOLTIPS2[dimKey] : "";
|
|
10555
10879
|
const textSize = size === "small" ? 0 : 1;
|
|
10556
10880
|
const barHeight = size === "small" ? 3 : 4;
|
|
10557
|
-
return /* @__PURE__ */
|
|
10881
|
+
return /* @__PURE__ */ jsx50(
|
|
10558
10882
|
HoverTip,
|
|
10559
10883
|
{
|
|
10560
|
-
text: /* @__PURE__ */
|
|
10561
|
-
/* @__PURE__ */
|
|
10884
|
+
text: /* @__PURE__ */ jsxs35(Text36, { size: 2, style: { lineHeight: 1.5 }, children: [
|
|
10885
|
+
/* @__PURE__ */ jsx50("span", { style: { fontWeight: 600 }, children: area }),
|
|
10562
10886
|
" \u2192",
|
|
10563
10887
|
" ",
|
|
10564
|
-
/* @__PURE__ */
|
|
10888
|
+
/* @__PURE__ */ jsx50("span", { style: { fontWeight: 600 }, children: dim }),
|
|
10565
10889
|
":",
|
|
10566
10890
|
" ",
|
|
10567
|
-
/* @__PURE__ */
|
|
10891
|
+
/* @__PURE__ */ jsx50(
|
|
10568
10892
|
"span",
|
|
10569
10893
|
{
|
|
10570
10894
|
style: {
|
|
@@ -10575,14 +10899,14 @@ function DimCell({
|
|
|
10575
10899
|
children: Math.round(value)
|
|
10576
10900
|
}
|
|
10577
10901
|
),
|
|
10578
|
-
/* @__PURE__ */
|
|
10902
|
+
/* @__PURE__ */ jsx50("span", { style: { color: "var(--card-muted-fg-color)" }, children: "/100" }),
|
|
10579
10903
|
".",
|
|
10580
10904
|
" ",
|
|
10581
10905
|
tooltip
|
|
10582
10906
|
] }),
|
|
10583
|
-
children: /* @__PURE__ */
|
|
10584
|
-
/* @__PURE__ */
|
|
10585
|
-
|
|
10907
|
+
children: /* @__PURE__ */ jsxs35(Stack28, { space: 1, style: { width: "100%" }, children: [
|
|
10908
|
+
/* @__PURE__ */ jsx50(
|
|
10909
|
+
Text36,
|
|
10586
10910
|
{
|
|
10587
10911
|
size: textSize,
|
|
10588
10912
|
style: {
|
|
@@ -10593,7 +10917,7 @@ function DimCell({
|
|
|
10593
10917
|
children: Math.round(value)
|
|
10594
10918
|
}
|
|
10595
10919
|
),
|
|
10596
|
-
/* @__PURE__ */
|
|
10920
|
+
/* @__PURE__ */ jsx50(
|
|
10597
10921
|
"div",
|
|
10598
10922
|
{
|
|
10599
10923
|
style: {
|
|
@@ -10603,7 +10927,7 @@ function DimCell({
|
|
|
10603
10927
|
overflow: "hidden",
|
|
10604
10928
|
width: "100%"
|
|
10605
10929
|
},
|
|
10606
|
-
children: /* @__PURE__ */
|
|
10930
|
+
children: /* @__PURE__ */ jsx50(
|
|
10607
10931
|
"div",
|
|
10608
10932
|
{
|
|
10609
10933
|
style: {
|
|
@@ -10628,7 +10952,7 @@ function ColHeader2({
|
|
|
10628
10952
|
onClick,
|
|
10629
10953
|
tooltip
|
|
10630
10954
|
}) {
|
|
10631
|
-
const handleKeyDown =
|
|
10955
|
+
const handleKeyDown = useCallback31(
|
|
10632
10956
|
(e) => {
|
|
10633
10957
|
if (onClick && (e.key === "Enter" || e.key === " ")) {
|
|
10634
10958
|
e.preventDefault();
|
|
@@ -10638,8 +10962,8 @@ function ColHeader2({
|
|
|
10638
10962
|
[onClick]
|
|
10639
10963
|
);
|
|
10640
10964
|
const arrow = active ? direction === "asc" ? " \u2191" : " \u2193" : "";
|
|
10641
|
-
return /* @__PURE__ */
|
|
10642
|
-
/* @__PURE__ */
|
|
10965
|
+
return /* @__PURE__ */ jsxs35(Flex26, { align: "center", gap: 1, children: [
|
|
10966
|
+
/* @__PURE__ */ jsx50(
|
|
10643
10967
|
"div",
|
|
10644
10968
|
{
|
|
10645
10969
|
onClick,
|
|
@@ -10650,8 +10974,8 @@ function ColHeader2({
|
|
|
10650
10974
|
userSelect: "none"
|
|
10651
10975
|
},
|
|
10652
10976
|
tabIndex: onClick ? 0 : void 0,
|
|
10653
|
-
children: /* @__PURE__ */
|
|
10654
|
-
|
|
10977
|
+
children: /* @__PURE__ */ jsxs35(
|
|
10978
|
+
Text36,
|
|
10655
10979
|
{
|
|
10656
10980
|
muted: true,
|
|
10657
10981
|
size: 1,
|
|
@@ -10668,14 +10992,14 @@ function ColHeader2({
|
|
|
10668
10992
|
)
|
|
10669
10993
|
}
|
|
10670
10994
|
),
|
|
10671
|
-
tooltip && /* @__PURE__ */
|
|
10995
|
+
tooltip && /* @__PURE__ */ jsx50(InfoTip, { text: tooltip })
|
|
10672
10996
|
] });
|
|
10673
10997
|
}
|
|
10674
10998
|
|
|
10675
10999
|
// src/components/report-detail/ModelSelector.tsx
|
|
10676
|
-
import { useCallback as
|
|
10677
|
-
import { Flex as
|
|
10678
|
-
import { jsx as
|
|
11000
|
+
import { useCallback as useCallback32 } from "react";
|
|
11001
|
+
import { Flex as Flex27, Text as Text37 } from "@sanity/ui";
|
|
11002
|
+
import { jsx as jsx51, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
10679
11003
|
var pillBase = {
|
|
10680
11004
|
borderColor: "var(--card-border-color)",
|
|
10681
11005
|
borderRadius: 999,
|
|
@@ -10706,8 +11030,8 @@ function ModelSelector({
|
|
|
10706
11030
|
selection,
|
|
10707
11031
|
onChange
|
|
10708
11032
|
}) {
|
|
10709
|
-
return /* @__PURE__ */
|
|
10710
|
-
/* @__PURE__ */
|
|
11033
|
+
return /* @__PURE__ */ jsxs36(Flex27, { align: "center", gap: 1, wrap: "wrap", children: [
|
|
11034
|
+
/* @__PURE__ */ jsx51(
|
|
10711
11035
|
Pill2,
|
|
10712
11036
|
{
|
|
10713
11037
|
isSelected: selection === null,
|
|
@@ -10715,7 +11039,7 @@ function ModelSelector({
|
|
|
10715
11039
|
onClick: () => onChange(null)
|
|
10716
11040
|
}
|
|
10717
11041
|
),
|
|
10718
|
-
models.map((model) => /* @__PURE__ */
|
|
11042
|
+
models.map((model) => /* @__PURE__ */ jsx51(
|
|
10719
11043
|
Pill2,
|
|
10720
11044
|
{
|
|
10721
11045
|
isSelected: selection === model.modelId,
|
|
@@ -10724,7 +11048,7 @@ function ModelSelector({
|
|
|
10724
11048
|
},
|
|
10725
11049
|
model.modelId
|
|
10726
11050
|
)),
|
|
10727
|
-
/* @__PURE__ */
|
|
11051
|
+
/* @__PURE__ */ jsx51(
|
|
10728
11052
|
"div",
|
|
10729
11053
|
{
|
|
10730
11054
|
style: {
|
|
@@ -10735,7 +11059,7 @@ function ModelSelector({
|
|
|
10735
11059
|
}
|
|
10736
11060
|
}
|
|
10737
11061
|
),
|
|
10738
|
-
/* @__PURE__ */
|
|
11062
|
+
/* @__PURE__ */ jsx51(
|
|
10739
11063
|
Pill2,
|
|
10740
11064
|
{
|
|
10741
11065
|
isSelected: selection === "expanded",
|
|
@@ -10750,7 +11074,7 @@ function Pill2({
|
|
|
10750
11074
|
label,
|
|
10751
11075
|
onClick
|
|
10752
11076
|
}) {
|
|
10753
|
-
const handleKeyDown =
|
|
11077
|
+
const handleKeyDown = useCallback32(
|
|
10754
11078
|
(e) => {
|
|
10755
11079
|
if (e.key === "Enter" || e.key === " ") {
|
|
10756
11080
|
e.preventDefault();
|
|
@@ -10759,7 +11083,7 @@ function Pill2({
|
|
|
10759
11083
|
},
|
|
10760
11084
|
[onClick]
|
|
10761
11085
|
);
|
|
10762
|
-
return /* @__PURE__ */
|
|
11086
|
+
return /* @__PURE__ */ jsx51(
|
|
10763
11087
|
"span",
|
|
10764
11088
|
{
|
|
10765
11089
|
onClick,
|
|
@@ -10767,8 +11091,8 @@ function Pill2({
|
|
|
10767
11091
|
role: "button",
|
|
10768
11092
|
style: isSelected ? pillSelected : pillDefault,
|
|
10769
11093
|
tabIndex: 0,
|
|
10770
|
-
children: /* @__PURE__ */
|
|
10771
|
-
|
|
11094
|
+
children: /* @__PURE__ */ jsx51(
|
|
11095
|
+
Text37,
|
|
10772
11096
|
{
|
|
10773
11097
|
size: 1,
|
|
10774
11098
|
style: {
|
|
@@ -10783,13 +11107,13 @@ function Pill2({
|
|
|
10783
11107
|
}
|
|
10784
11108
|
|
|
10785
11109
|
// src/components/report-detail/useModelSelection.ts
|
|
10786
|
-
import { useCallback as
|
|
11110
|
+
import { useCallback as useCallback33, useMemo as useMemo13, useState as useState24 } from "react";
|
|
10787
11111
|
function useModelSelection({
|
|
10788
11112
|
scores,
|
|
10789
11113
|
perModel
|
|
10790
11114
|
}) {
|
|
10791
|
-
const [selection, setSelection] =
|
|
10792
|
-
const onSelectionChange =
|
|
11115
|
+
const [selection, setSelection] = useState24(null);
|
|
11116
|
+
const onSelectionChange = useCallback33((next) => {
|
|
10793
11117
|
setSelection(next);
|
|
10794
11118
|
}, []);
|
|
10795
11119
|
const isExpanded = selection === "expanded";
|
|
@@ -10811,7 +11135,7 @@ function useModelSelection({
|
|
|
10811
11135
|
}
|
|
10812
11136
|
|
|
10813
11137
|
// src/components/report-detail/StrengthsList.tsx
|
|
10814
|
-
import { jsx as
|
|
11138
|
+
import { jsx as jsx52, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
10815
11139
|
function StrengthsList({
|
|
10816
11140
|
mode,
|
|
10817
11141
|
scores,
|
|
@@ -10835,13 +11159,13 @@ function StrengthsList({
|
|
|
10835
11159
|
(a, b) => (b.infrastructureEfficiency ?? 0) - (a.infrastructureEfficiency ?? 0)
|
|
10836
11160
|
);
|
|
10837
11161
|
if (displayedScores.length === 0) return null;
|
|
10838
|
-
return /* @__PURE__ */
|
|
10839
|
-
/* @__PURE__ */
|
|
10840
|
-
/* @__PURE__ */
|
|
10841
|
-
/* @__PURE__ */
|
|
10842
|
-
/* @__PURE__ */
|
|
10843
|
-
/* @__PURE__ */
|
|
10844
|
-
hasModels && /* @__PURE__ */
|
|
11162
|
+
return /* @__PURE__ */ jsxs37(Stack29, { space: 5, children: [
|
|
11163
|
+
/* @__PURE__ */ jsxs37(Stack29, { space: 3, children: [
|
|
11164
|
+
/* @__PURE__ */ jsxs37(Flex28, { align: "center", gap: 2, wrap: "wrap", children: [
|
|
11165
|
+
/* @__PURE__ */ jsx52(CheckmarkCircleIcon2, { style: { color: "#34d399" } }),
|
|
11166
|
+
/* @__PURE__ */ jsx52(Text38, { size: 2, weight: "medium", children: "Strong Areas (70+)" }),
|
|
11167
|
+
/* @__PURE__ */ jsx52(InfoTip, { text: GLOSSARY.strengths }),
|
|
11168
|
+
hasModels && /* @__PURE__ */ jsx52(Box25, { style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsx52(
|
|
10845
11169
|
ModelSelector,
|
|
10846
11170
|
{
|
|
10847
11171
|
models: perModel,
|
|
@@ -10850,7 +11174,7 @@ function StrengthsList({
|
|
|
10850
11174
|
}
|
|
10851
11175
|
) })
|
|
10852
11176
|
] }),
|
|
10853
|
-
/* @__PURE__ */
|
|
11177
|
+
/* @__PURE__ */ jsx52(
|
|
10854
11178
|
AreaScoresGrid,
|
|
10855
11179
|
{
|
|
10856
11180
|
mode,
|
|
@@ -10860,33 +11184,33 @@ function StrengthsList({
|
|
|
10860
11184
|
}
|
|
10861
11185
|
)
|
|
10862
11186
|
] }),
|
|
10863
|
-
retrievalSuccesses.length > 0 && /* @__PURE__ */
|
|
10864
|
-
/* @__PURE__ */
|
|
10865
|
-
|
|
11187
|
+
retrievalSuccesses.length > 0 && /* @__PURE__ */ jsxs37(Box25, { style: neutralCardStyle, children: [
|
|
11188
|
+
/* @__PURE__ */ jsx52(
|
|
11189
|
+
Box25,
|
|
10866
11190
|
{
|
|
10867
11191
|
padding: 4,
|
|
10868
11192
|
style: { borderBottom: "1px solid var(--card-border-color)" },
|
|
10869
|
-
children: /* @__PURE__ */
|
|
10870
|
-
/* @__PURE__ */
|
|
10871
|
-
/* @__PURE__ */
|
|
11193
|
+
children: /* @__PURE__ */ jsxs37(Flex28, { align: "center", gap: 2, children: [
|
|
11194
|
+
/* @__PURE__ */ jsx52(SearchIcon7, { style: { color: "#34d399" } }),
|
|
11195
|
+
/* @__PURE__ */ jsxs37(Text38, { size: 2, weight: "medium", children: [
|
|
10872
11196
|
"Retrieval Successes (",
|
|
10873
11197
|
Math.round(EFFICIENCY_POSITIVE * 100),
|
|
10874
11198
|
"%+ efficiency)"
|
|
10875
11199
|
] }),
|
|
10876
|
-
/* @__PURE__ */
|
|
11200
|
+
/* @__PURE__ */ jsx52(InfoTip, { text: GLOSSARY.retrievalExcellence })
|
|
10877
11201
|
] })
|
|
10878
11202
|
}
|
|
10879
11203
|
),
|
|
10880
|
-
/* @__PURE__ */
|
|
10881
|
-
|
|
11204
|
+
/* @__PURE__ */ jsx52(Stack29, { children: retrievalSuccesses.map((area, i) => /* @__PURE__ */ jsxs37(
|
|
11205
|
+
Flex28,
|
|
10882
11206
|
{
|
|
10883
11207
|
align: "center",
|
|
10884
11208
|
justify: "space-between",
|
|
10885
11209
|
padding: 4,
|
|
10886
11210
|
style: i > 0 ? dividerStyle : void 0,
|
|
10887
11211
|
children: [
|
|
10888
|
-
/* @__PURE__ */
|
|
10889
|
-
/* @__PURE__ */
|
|
11212
|
+
/* @__PURE__ */ jsx52(Text38, { size: 2, children: area.feature }),
|
|
11213
|
+
/* @__PURE__ */ jsx52(
|
|
10890
11214
|
"span",
|
|
10891
11215
|
{
|
|
10892
11216
|
style: {
|
|
@@ -10916,9 +11240,8 @@ import {
|
|
|
10916
11240
|
BoltIcon,
|
|
10917
11241
|
ArrowDownIcon as ArrowDownIcon2
|
|
10918
11242
|
} from "@sanity/icons";
|
|
10919
|
-
import { Box as
|
|
10920
|
-
import { jsx as
|
|
10921
|
-
var SHOW_REGRESSED = false;
|
|
11243
|
+
import { Box as Box26, Flex as Flex29, Stack as Stack30, Text as Text39 } from "@sanity/ui";
|
|
11244
|
+
import { jsx as jsx53, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
10922
11245
|
function WeaknessesList({
|
|
10923
11246
|
mode,
|
|
10924
11247
|
scores,
|
|
@@ -10946,15 +11269,15 @@ function WeaknessesList({
|
|
|
10946
11269
|
const efficiencyAnomalies = scores.filter(
|
|
10947
11270
|
(s) => s.infrastructureEfficiency != null && s.infrastructureEfficiency > EFFICIENCY_ANOMALY
|
|
10948
11271
|
);
|
|
10949
|
-
const hasContent = weakAreas.length > 0 || docsHurt.length > 0 || retrievalIssues.length > 0 || dimWeaknesses.length > 0 ||
|
|
11272
|
+
const hasContent = weakAreas.length > 0 || docsHurt.length > 0 || retrievalIssues.length > 0 || dimWeaknesses.length > 0 || FEATURE_FLAGS.showRegressedSinceLastRun.enabled && regressed.length > 0 || efficiencyAnomalies.length > 0;
|
|
10950
11273
|
if (!hasContent) return null;
|
|
10951
|
-
return /* @__PURE__ */
|
|
10952
|
-
weakAreas.length > 0 && /* @__PURE__ */
|
|
10953
|
-
/* @__PURE__ */
|
|
10954
|
-
/* @__PURE__ */
|
|
10955
|
-
/* @__PURE__ */
|
|
10956
|
-
/* @__PURE__ */
|
|
10957
|
-
hasModels && /* @__PURE__ */
|
|
11274
|
+
return /* @__PURE__ */ jsxs38(Stack30, { space: 5, children: [
|
|
11275
|
+
weakAreas.length > 0 && /* @__PURE__ */ jsxs38(Stack30, { space: 3, children: [
|
|
11276
|
+
/* @__PURE__ */ jsxs38(Flex29, { align: "center", gap: 2, wrap: "wrap", children: [
|
|
11277
|
+
/* @__PURE__ */ jsx53(ErrorOutlineIcon3, { style: { color: "#f87171" } }),
|
|
11278
|
+
/* @__PURE__ */ jsx53(Text39, { size: 2, weight: "medium", children: "Weak Areas (<70)" }),
|
|
11279
|
+
/* @__PURE__ */ jsx53(InfoTip, { text: GLOSSARY.weakAreas }),
|
|
11280
|
+
hasModels && /* @__PURE__ */ jsx53(Box26, { style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsx53(
|
|
10958
11281
|
ModelSelector,
|
|
10959
11282
|
{
|
|
10960
11283
|
models: perModel,
|
|
@@ -10963,7 +11286,7 @@ function WeaknessesList({
|
|
|
10963
11286
|
}
|
|
10964
11287
|
) })
|
|
10965
11288
|
] }),
|
|
10966
|
-
/* @__PURE__ */
|
|
11289
|
+
/* @__PURE__ */ jsx53(
|
|
10967
11290
|
AreaScoresGrid,
|
|
10968
11291
|
{
|
|
10969
11292
|
mode,
|
|
@@ -10973,22 +11296,22 @@ function WeaknessesList({
|
|
|
10973
11296
|
}
|
|
10974
11297
|
)
|
|
10975
11298
|
] }),
|
|
10976
|
-
docsHurt.length > 0 && /* @__PURE__ */
|
|
10977
|
-
/* @__PURE__ */
|
|
10978
|
-
/* @__PURE__ */
|
|
10979
|
-
/* @__PURE__ */
|
|
10980
|
-
/* @__PURE__ */
|
|
11299
|
+
docsHurt.length > 0 && /* @__PURE__ */ jsxs38(Stack30, { space: 3, children: [
|
|
11300
|
+
/* @__PURE__ */ jsxs38(Flex29, { align: "center", gap: 2, children: [
|
|
11301
|
+
/* @__PURE__ */ jsx53(ErrorOutlineIcon3, { style: { color: "#f87171" } }),
|
|
11302
|
+
/* @__PURE__ */ jsx53(Text39, { size: 2, weight: "medium", children: "Docs Hurt Performance (Negative Doc Lift)" }),
|
|
11303
|
+
/* @__PURE__ */ jsx53(InfoTip, { text: GLOSSARY.docsHurt })
|
|
10981
11304
|
] }),
|
|
10982
|
-
/* @__PURE__ */
|
|
10983
|
-
|
|
11305
|
+
/* @__PURE__ */ jsx53(Box26, { style: sectionStyle("red"), children: docsHurt.map((area, i) => /* @__PURE__ */ jsxs38(
|
|
11306
|
+
Box26,
|
|
10984
11307
|
{
|
|
10985
11308
|
padding: 4,
|
|
10986
11309
|
style: i > 0 ? { borderTop: "1px solid rgba(239,68,68,0.2)" } : void 0,
|
|
10987
11310
|
children: [
|
|
10988
|
-
/* @__PURE__ */
|
|
10989
|
-
/* @__PURE__ */
|
|
10990
|
-
/* @__PURE__ */
|
|
10991
|
-
/* @__PURE__ */
|
|
11311
|
+
/* @__PURE__ */ jsxs38(Flex29, { align: "center", justify: "space-between", wrap: "wrap", children: [
|
|
11312
|
+
/* @__PURE__ */ jsxs38(Flex29, { align: "center", gap: 2, children: [
|
|
11313
|
+
/* @__PURE__ */ jsx53(Text39, { size: 2, weight: "medium", children: area.feature }),
|
|
11314
|
+
/* @__PURE__ */ jsx53(
|
|
10992
11315
|
"span",
|
|
10993
11316
|
{
|
|
10994
11317
|
style: {
|
|
@@ -11003,7 +11326,7 @@ function WeaknessesList({
|
|
|
11003
11326
|
}
|
|
11004
11327
|
)
|
|
11005
11328
|
] }),
|
|
11006
|
-
/* @__PURE__ */
|
|
11329
|
+
/* @__PURE__ */ jsx53(
|
|
11007
11330
|
"span",
|
|
11008
11331
|
{
|
|
11009
11332
|
style: {
|
|
@@ -11016,8 +11339,8 @@ function WeaknessesList({
|
|
|
11016
11339
|
}
|
|
11017
11340
|
)
|
|
11018
11341
|
] }),
|
|
11019
|
-
/* @__PURE__ */
|
|
11020
|
-
area.invertedRetrievalGap && /* @__PURE__ */
|
|
11342
|
+
/* @__PURE__ */ jsx53(Box26, { paddingTop: 2, children: /* @__PURE__ */ jsxs38(Text39, { muted: true, size: 2, children: [
|
|
11343
|
+
area.invertedRetrievalGap && /* @__PURE__ */ jsxs38("span", { style: { color: "#fbbf24" }, children: [
|
|
11021
11344
|
"Agent does better by NOT finding these docs.",
|
|
11022
11345
|
" "
|
|
11023
11346
|
] }),
|
|
@@ -11032,22 +11355,22 @@ function WeaknessesList({
|
|
|
11032
11355
|
area.feature
|
|
11033
11356
|
)) })
|
|
11034
11357
|
] }),
|
|
11035
|
-
retrievalIssues.length > 0 && /* @__PURE__ */
|
|
11036
|
-
/* @__PURE__ */
|
|
11037
|
-
/* @__PURE__ */
|
|
11038
|
-
/* @__PURE__ */
|
|
11039
|
-
/* @__PURE__ */
|
|
11358
|
+
retrievalIssues.length > 0 && /* @__PURE__ */ jsxs38(Stack30, { space: 3, children: [
|
|
11359
|
+
/* @__PURE__ */ jsxs38(Flex29, { align: "center", gap: 2, children: [
|
|
11360
|
+
/* @__PURE__ */ jsx53(SearchIcon8, { style: { color: "#fbbf24" } }),
|
|
11361
|
+
/* @__PURE__ */ jsx53(Text39, { size: 2, weight: "medium", children: "Retrieval Issues (<70% efficiency)" }),
|
|
11362
|
+
/* @__PURE__ */ jsx53(InfoTip, { text: GLOSSARY.retrievalIssues })
|
|
11040
11363
|
] }),
|
|
11041
|
-
/* @__PURE__ */
|
|
11042
|
-
|
|
11364
|
+
/* @__PURE__ */ jsx53(Box26, { style: sectionStyle("amber"), children: retrievalIssues.map((area, i) => /* @__PURE__ */ jsxs38(
|
|
11365
|
+
Box26,
|
|
11043
11366
|
{
|
|
11044
11367
|
padding: 4,
|
|
11045
11368
|
style: i > 0 ? { borderTop: "1px solid rgba(245,158,11,0.2)" } : void 0,
|
|
11046
11369
|
children: [
|
|
11047
|
-
/* @__PURE__ */
|
|
11048
|
-
/* @__PURE__ */
|
|
11049
|
-
/* @__PURE__ */
|
|
11050
|
-
/* @__PURE__ */
|
|
11370
|
+
/* @__PURE__ */ jsxs38(Flex29, { align: "center", justify: "space-between", wrap: "wrap", children: [
|
|
11371
|
+
/* @__PURE__ */ jsxs38(Flex29, { align: "center", gap: 2, children: [
|
|
11372
|
+
/* @__PURE__ */ jsx53(Text39, { size: 2, weight: "medium", children: area.feature }),
|
|
11373
|
+
/* @__PURE__ */ jsx53(
|
|
11051
11374
|
"span",
|
|
11052
11375
|
{
|
|
11053
11376
|
style: {
|
|
@@ -11062,7 +11385,7 @@ function WeaknessesList({
|
|
|
11062
11385
|
}
|
|
11063
11386
|
)
|
|
11064
11387
|
] }),
|
|
11065
|
-
/* @__PURE__ */
|
|
11388
|
+
/* @__PURE__ */ jsx53(
|
|
11066
11389
|
"span",
|
|
11067
11390
|
{
|
|
11068
11391
|
style: {
|
|
@@ -11075,7 +11398,7 @@ function WeaknessesList({
|
|
|
11075
11398
|
}
|
|
11076
11399
|
)
|
|
11077
11400
|
] }),
|
|
11078
|
-
/* @__PURE__ */
|
|
11401
|
+
/* @__PURE__ */ jsx53(Box26, { paddingTop: 2, children: /* @__PURE__ */ jsxs38(Text39, { muted: true, size: 2, children: [
|
|
11079
11402
|
"Actual score (",
|
|
11080
11403
|
Math.round(area.actualScore ?? 0),
|
|
11081
11404
|
") is much lower than ceiling (",
|
|
@@ -11090,21 +11413,21 @@ function WeaknessesList({
|
|
|
11090
11413
|
area.feature
|
|
11091
11414
|
)) })
|
|
11092
11415
|
] }),
|
|
11093
|
-
dimWeaknesses.length > 0 && /* @__PURE__ */
|
|
11094
|
-
/* @__PURE__ */
|
|
11095
|
-
/* @__PURE__ */
|
|
11096
|
-
/* @__PURE__ */
|
|
11097
|
-
/* @__PURE__ */
|
|
11416
|
+
dimWeaknesses.length > 0 && /* @__PURE__ */ jsxs38(Stack30, { space: 3, children: [
|
|
11417
|
+
/* @__PURE__ */ jsxs38(Flex29, { align: "center", gap: 2, children: [
|
|
11418
|
+
/* @__PURE__ */ jsx53(WarningOutlineIcon3, { style: { color: "#fbbf24" } }),
|
|
11419
|
+
/* @__PURE__ */ jsx53(Text39, { size: 2, weight: "medium", children: "Dimension Weaknesses (<50)" }),
|
|
11420
|
+
/* @__PURE__ */ jsx53(InfoTip, { text: GLOSSARY.dimWeaknesses })
|
|
11098
11421
|
] }),
|
|
11099
|
-
/* @__PURE__ */
|
|
11100
|
-
|
|
11422
|
+
/* @__PURE__ */ jsx53(Box26, { style: neutralCardStyle, children: dimWeaknesses.map(({ area, dims }, i) => /* @__PURE__ */ jsxs38(
|
|
11423
|
+
Box26,
|
|
11101
11424
|
{
|
|
11102
11425
|
padding: 4,
|
|
11103
11426
|
style: i > 0 ? dividerStyle : void 0,
|
|
11104
11427
|
children: [
|
|
11105
|
-
/* @__PURE__ */
|
|
11106
|
-
/* @__PURE__ */
|
|
11107
|
-
/* @__PURE__ */
|
|
11428
|
+
/* @__PURE__ */ jsxs38(Flex29, { align: "center", gap: 2, paddingBottom: 2, children: [
|
|
11429
|
+
/* @__PURE__ */ jsx53(Text39, { size: 2, weight: "medium", children: area.feature }),
|
|
11430
|
+
/* @__PURE__ */ jsx53(
|
|
11108
11431
|
"span",
|
|
11109
11432
|
{
|
|
11110
11433
|
style: {
|
|
@@ -11119,7 +11442,7 @@ function WeaknessesList({
|
|
|
11119
11442
|
}
|
|
11120
11443
|
)
|
|
11121
11444
|
] }),
|
|
11122
|
-
/* @__PURE__ */
|
|
11445
|
+
/* @__PURE__ */ jsx53(Flex29, { gap: 2, wrap: "wrap", children: dims.map((w) => /* @__PURE__ */ jsx53(HoverTip, { text: w.tip, children: /* @__PURE__ */ jsxs38(
|
|
11123
11446
|
"span",
|
|
11124
11447
|
{
|
|
11125
11448
|
style: {
|
|
@@ -11141,33 +11464,33 @@ function WeaknessesList({
|
|
|
11141
11464
|
area.feature
|
|
11142
11465
|
)) })
|
|
11143
11466
|
] }),
|
|
11144
|
-
|
|
11145
|
-
/* @__PURE__ */
|
|
11146
|
-
|
|
11467
|
+
FEATURE_FLAGS.showRegressedSinceLastRun.enabled && regressed.length > 0 && /* @__PURE__ */ jsxs38(Box26, { style: neutralCardStyle, children: [
|
|
11468
|
+
/* @__PURE__ */ jsx53(
|
|
11469
|
+
Box26,
|
|
11147
11470
|
{
|
|
11148
11471
|
padding: 4,
|
|
11149
11472
|
style: { borderBottom: "1px solid var(--card-border-color)" },
|
|
11150
|
-
children: /* @__PURE__ */
|
|
11151
|
-
/* @__PURE__ */
|
|
11152
|
-
/* @__PURE__ */
|
|
11473
|
+
children: /* @__PURE__ */ jsxs38(Flex29, { align: "center", gap: 2, children: [
|
|
11474
|
+
/* @__PURE__ */ jsx53(ArrowDownIcon2, { style: { color: "#f87171" } }),
|
|
11475
|
+
/* @__PURE__ */ jsx53(Text39, { size: 2, weight: "medium", children: "Regressed Since Last Run" })
|
|
11153
11476
|
] })
|
|
11154
11477
|
}
|
|
11155
11478
|
),
|
|
11156
|
-
/* @__PURE__ */
|
|
11479
|
+
/* @__PURE__ */ jsx53(Stack30, { children: regressed.map((featureName, i) => {
|
|
11157
11480
|
const area = scores.find((s) => s.feature === featureName);
|
|
11158
11481
|
const areaDelta = perArea?.[featureName];
|
|
11159
|
-
return /* @__PURE__ */
|
|
11160
|
-
|
|
11482
|
+
return /* @__PURE__ */ jsxs38(
|
|
11483
|
+
Flex29,
|
|
11161
11484
|
{
|
|
11162
11485
|
align: "center",
|
|
11163
11486
|
justify: "space-between",
|
|
11164
11487
|
padding: 4,
|
|
11165
11488
|
style: i > 0 ? dividerStyle : void 0,
|
|
11166
11489
|
children: [
|
|
11167
|
-
/* @__PURE__ */
|
|
11168
|
-
/* @__PURE__ */
|
|
11169
|
-
areaDelta != null && /* @__PURE__ */
|
|
11170
|
-
area && /* @__PURE__ */
|
|
11490
|
+
/* @__PURE__ */ jsx53(Text39, { size: 2, children: featureName }),
|
|
11491
|
+
/* @__PURE__ */ jsxs38(Flex29, { align: "center", gap: 3, children: [
|
|
11492
|
+
areaDelta != null && /* @__PURE__ */ jsx53(DeltaIndicator, { delta: areaDelta, icon: true }),
|
|
11493
|
+
area && /* @__PURE__ */ jsx53(
|
|
11171
11494
|
"span",
|
|
11172
11495
|
{
|
|
11173
11496
|
style: {
|
|
@@ -11189,32 +11512,32 @@ function WeaknessesList({
|
|
|
11189
11512
|
);
|
|
11190
11513
|
}) })
|
|
11191
11514
|
] }),
|
|
11192
|
-
efficiencyAnomalies.length > 0 && /* @__PURE__ */
|
|
11193
|
-
/* @__PURE__ */
|
|
11194
|
-
|
|
11515
|
+
efficiencyAnomalies.length > 0 && /* @__PURE__ */ jsxs38(Box26, { style: neutralCardStyle, children: [
|
|
11516
|
+
/* @__PURE__ */ jsx53(
|
|
11517
|
+
Box26,
|
|
11195
11518
|
{
|
|
11196
11519
|
padding: 4,
|
|
11197
11520
|
style: { borderBottom: "1px solid var(--card-border-color)" },
|
|
11198
|
-
children: /* @__PURE__ */
|
|
11199
|
-
/* @__PURE__ */
|
|
11200
|
-
/* @__PURE__ */
|
|
11201
|
-
/* @__PURE__ */
|
|
11202
|
-
/* @__PURE__ */
|
|
11521
|
+
children: /* @__PURE__ */ jsxs38(Stack30, { space: 2, children: [
|
|
11522
|
+
/* @__PURE__ */ jsxs38(Flex29, { align: "center", gap: 2, children: [
|
|
11523
|
+
/* @__PURE__ */ jsx53(BoltIcon, { style: { color: "#fbbf24" } }),
|
|
11524
|
+
/* @__PURE__ */ jsx53(Text39, { size: 2, weight: "medium", children: "Efficiency Anomalies (>100%)" }),
|
|
11525
|
+
/* @__PURE__ */ jsx53(InfoTip, { text: GLOSSARY.efficiencyAnomalies })
|
|
11203
11526
|
] }),
|
|
11204
|
-
/* @__PURE__ */
|
|
11527
|
+
/* @__PURE__ */ jsx53(Text39, { muted: true, size: 2, children: "Agent outperforms injected docs \u2014 may indicate doc quality issues or agent memorization." })
|
|
11205
11528
|
] })
|
|
11206
11529
|
}
|
|
11207
11530
|
),
|
|
11208
|
-
/* @__PURE__ */
|
|
11209
|
-
|
|
11531
|
+
/* @__PURE__ */ jsx53(Stack30, { children: efficiencyAnomalies.map((area, i) => /* @__PURE__ */ jsxs38(
|
|
11532
|
+
Flex29,
|
|
11210
11533
|
{
|
|
11211
11534
|
align: "center",
|
|
11212
11535
|
justify: "space-between",
|
|
11213
11536
|
padding: 4,
|
|
11214
11537
|
style: i > 0 ? dividerStyle : void 0,
|
|
11215
11538
|
children: [
|
|
11216
|
-
/* @__PURE__ */
|
|
11217
|
-
/* @__PURE__ */
|
|
11539
|
+
/* @__PURE__ */ jsx53(Text39, { size: 2, children: area.feature }),
|
|
11540
|
+
/* @__PURE__ */ jsx53(
|
|
11218
11541
|
"span",
|
|
11219
11542
|
{
|
|
11220
11543
|
style: {
|
|
@@ -11242,12 +11565,12 @@ var tipArea = {
|
|
|
11242
11565
|
fontWeight: 600
|
|
11243
11566
|
};
|
|
11244
11567
|
function dimTip(area, dim, score, description) {
|
|
11245
|
-
return /* @__PURE__ */
|
|
11246
|
-
/* @__PURE__ */
|
|
11568
|
+
return /* @__PURE__ */ jsxs38(Text39, { size: 2, style: { lineHeight: 1.5 }, children: [
|
|
11569
|
+
/* @__PURE__ */ jsx53("span", { style: tipArea, children: area }),
|
|
11247
11570
|
" scores",
|
|
11248
11571
|
" ",
|
|
11249
|
-
/* @__PURE__ */
|
|
11250
|
-
/* @__PURE__ */
|
|
11572
|
+
/* @__PURE__ */ jsx53("span", { style: tipValue, children: score }),
|
|
11573
|
+
/* @__PURE__ */ jsx53("span", { style: { color: "var(--card-muted-fg-color)" }, children: "/100" }),
|
|
11251
11574
|
" on",
|
|
11252
11575
|
" ",
|
|
11253
11576
|
dim.toLowerCase(),
|
|
@@ -11276,7 +11599,7 @@ function getDimensionWeaknesses(area) {
|
|
|
11276
11599
|
}
|
|
11277
11600
|
|
|
11278
11601
|
// src/components/report-detail/ReportDetail.tsx
|
|
11279
|
-
import { jsx as
|
|
11602
|
+
import { jsx as jsx54, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
11280
11603
|
var OVERVIEW_TAB = { id: "overview", label: "Overview" };
|
|
11281
11604
|
var DIAGNOSTICS_TAB = { id: "diagnostics", label: "Diagnostics" };
|
|
11282
11605
|
var ACTIVITY_TAB = { id: "activity", label: "Agent Activity" };
|
|
@@ -11293,8 +11616,8 @@ function ReportDetail({
|
|
|
11293
11616
|
subTab
|
|
11294
11617
|
}) {
|
|
11295
11618
|
const client = useClient10({ apiVersion: API_VERSION });
|
|
11296
|
-
const [loading, setLoading] =
|
|
11297
|
-
const [report, setReport] =
|
|
11619
|
+
const [loading, setLoading] = useState25(true);
|
|
11620
|
+
const [report, setReport] = useState25(null);
|
|
11298
11621
|
useEffect12(() => {
|
|
11299
11622
|
let cancelled = false;
|
|
11300
11623
|
setLoading(true);
|
|
@@ -11339,19 +11662,19 @@ function ReportDetail({
|
|
|
11339
11662
|
if (disabledTabs.has(parsed)) return "overview";
|
|
11340
11663
|
return tabs.some((t) => t.id === parsed) ? parsed : "overview";
|
|
11341
11664
|
}, [activeTab, disabledTabs, tabs]);
|
|
11342
|
-
const handleTabClick =
|
|
11665
|
+
const handleTabClick = useCallback34(
|
|
11343
11666
|
(tabId) => {
|
|
11344
11667
|
onTabChange(tabId === "overview" ? null : tabId, null, null);
|
|
11345
11668
|
},
|
|
11346
11669
|
[onTabChange]
|
|
11347
11670
|
);
|
|
11348
11671
|
if (loading) {
|
|
11349
|
-
return /* @__PURE__ */
|
|
11672
|
+
return /* @__PURE__ */ jsx54(LoadingState, { message: "Loading report\u2026" });
|
|
11350
11673
|
}
|
|
11351
11674
|
if (!report || !summary) {
|
|
11352
|
-
return /* @__PURE__ */
|
|
11353
|
-
/* @__PURE__ */
|
|
11354
|
-
|
|
11675
|
+
return /* @__PURE__ */ jsx54(Box27, { padding: 5, children: /* @__PURE__ */ jsxs39(Stack31, { space: 4, children: [
|
|
11676
|
+
/* @__PURE__ */ jsx54(
|
|
11677
|
+
Button10,
|
|
11355
11678
|
{
|
|
11356
11679
|
icon: ArrowLeftIcon3,
|
|
11357
11680
|
mode: "bleed",
|
|
@@ -11359,18 +11682,18 @@ function ReportDetail({
|
|
|
11359
11682
|
text: "Back"
|
|
11360
11683
|
}
|
|
11361
11684
|
),
|
|
11362
|
-
/* @__PURE__ */
|
|
11685
|
+
/* @__PURE__ */ jsx54(Text40, { align: "center", muted: true, size: 3, children: "Report not found" })
|
|
11363
11686
|
] }) });
|
|
11364
11687
|
}
|
|
11365
11688
|
const { comparison, provenance } = report;
|
|
11366
11689
|
const totalTests = summary.scores.reduce((n, s) => n + s.testCount, 0);
|
|
11367
|
-
return /* @__PURE__ */
|
|
11690
|
+
return /* @__PURE__ */ jsx54(
|
|
11368
11691
|
ReportArtifactProvider,
|
|
11369
11692
|
{
|
|
11370
11693
|
runId: report.provenance?.runId,
|
|
11371
11694
|
manifest: summary?.artifactManifest,
|
|
11372
|
-
children: /* @__PURE__ */
|
|
11373
|
-
/* @__PURE__ */
|
|
11695
|
+
children: /* @__PURE__ */ jsx54(Box27, { padding: 4, children: /* @__PURE__ */ jsxs39(Stack31, { space: 5, children: [
|
|
11696
|
+
/* @__PURE__ */ jsx54(
|
|
11374
11697
|
ReportHeader,
|
|
11375
11698
|
{
|
|
11376
11699
|
completedAt: report.completedAt,
|
|
@@ -11379,11 +11702,11 @@ function ReportDetail({
|
|
|
11379
11702
|
title: report.title
|
|
11380
11703
|
}
|
|
11381
11704
|
),
|
|
11382
|
-
/* @__PURE__ */
|
|
11383
|
-
/* @__PURE__ */
|
|
11705
|
+
/* @__PURE__ */ jsxs39(Flex30, { align: "center", gap: 2, wrap: "wrap", children: [
|
|
11706
|
+
/* @__PURE__ */ jsx54(TabList, { space: 1, children: tabs.map((tab) => {
|
|
11384
11707
|
const isDisabled = disabledTabs.has(tab.id);
|
|
11385
11708
|
const tooltip = getDisabledTabTooltip(tab.id, summary);
|
|
11386
|
-
const tabElement = /* @__PURE__ */
|
|
11709
|
+
const tabElement = /* @__PURE__ */ jsx54(
|
|
11387
11710
|
Tab,
|
|
11388
11711
|
{
|
|
11389
11712
|
"aria-controls": `panel-${tab.id}`,
|
|
@@ -11394,27 +11717,27 @@ function ReportDetail({
|
|
|
11394
11717
|
selected: currentTab === tab.id
|
|
11395
11718
|
}
|
|
11396
11719
|
);
|
|
11397
|
-
return isDisabled && tooltip ? /* @__PURE__ */
|
|
11720
|
+
return isDisabled && tooltip ? /* @__PURE__ */ jsx54(
|
|
11398
11721
|
Tooltip10,
|
|
11399
11722
|
{
|
|
11400
|
-
content: /* @__PURE__ */
|
|
11723
|
+
content: /* @__PURE__ */ jsx54(Box27, { padding: 2, style: { maxWidth: 280 }, children: tooltip }),
|
|
11401
11724
|
placement: "bottom",
|
|
11402
11725
|
portal: true,
|
|
11403
|
-
children: /* @__PURE__ */
|
|
11726
|
+
children: /* @__PURE__ */ jsx54("span", { style: { display: "inline-block" }, children: tabElement })
|
|
11404
11727
|
},
|
|
11405
11728
|
tab.id
|
|
11406
|
-
) : /* @__PURE__ */
|
|
11729
|
+
) : /* @__PURE__ */ jsx54("span", { children: tabElement }, tab.id);
|
|
11407
11730
|
}) }),
|
|
11408
|
-
/* @__PURE__ */
|
|
11409
|
-
/* @__PURE__ */
|
|
11731
|
+
/* @__PURE__ */ jsxs39(Flex30, { align: "center", gap: 2, style: { marginLeft: "auto" }, children: [
|
|
11732
|
+
/* @__PURE__ */ jsx54(
|
|
11410
11733
|
HoverTip,
|
|
11411
11734
|
{
|
|
11412
11735
|
text: SOURCE_TIP[provenance.source.name] ?? GLOSSARY.reportMode,
|
|
11413
|
-
children: /* @__PURE__ */
|
|
11736
|
+
children: /* @__PURE__ */ jsx54(Badge9, { mode: "outline", tone: "default", children: provenance.source.name })
|
|
11414
11737
|
}
|
|
11415
11738
|
),
|
|
11416
|
-
/* @__PURE__ */
|
|
11417
|
-
/* @__PURE__ */
|
|
11739
|
+
/* @__PURE__ */ jsx54(HoverTip, { text: MODE_TIP2[provenance.mode] ?? GLOSSARY.reportMode, children: /* @__PURE__ */ jsx54(Badge9, { tone: "primary", children: provenance.mode }) }),
|
|
11740
|
+
/* @__PURE__ */ jsx54(
|
|
11418
11741
|
ReportActions,
|
|
11419
11742
|
{
|
|
11420
11743
|
documentId: report._id,
|
|
@@ -11425,14 +11748,14 @@ function ReportDetail({
|
|
|
11425
11748
|
)
|
|
11426
11749
|
] })
|
|
11427
11750
|
] }),
|
|
11428
|
-
currentTab === "overview" && /* @__PURE__ */
|
|
11751
|
+
currentTab === "overview" && /* @__PURE__ */ jsx54(
|
|
11429
11752
|
TabPanel,
|
|
11430
11753
|
{
|
|
11431
11754
|
"aria-labelledby": "tab-overview",
|
|
11432
11755
|
hidden: currentTab !== "overview",
|
|
11433
11756
|
id: "panel-overview",
|
|
11434
|
-
children: /* @__PURE__ */
|
|
11435
|
-
/* @__PURE__ */
|
|
11757
|
+
children: /* @__PURE__ */ jsxs39(Stack31, { space: 5, children: [
|
|
11758
|
+
/* @__PURE__ */ jsx54(
|
|
11436
11759
|
DiagnosticsOverview,
|
|
11437
11760
|
{
|
|
11438
11761
|
comparison,
|
|
@@ -11443,19 +11766,20 @@ function ReportDetail({
|
|
|
11443
11766
|
totalTests
|
|
11444
11767
|
}
|
|
11445
11768
|
),
|
|
11446
|
-
/* @__PURE__ */
|
|
11447
|
-
/* @__PURE__ */
|
|
11769
|
+
/* @__PURE__ */ jsx54(CostLatencyPanel, { testResults: summary.testResults }),
|
|
11770
|
+
/* @__PURE__ */ jsx54(
|
|
11448
11771
|
LineageCard,
|
|
11449
11772
|
{
|
|
11450
11773
|
provenance,
|
|
11451
11774
|
reportId: report.reportId
|
|
11452
11775
|
}
|
|
11453
11776
|
),
|
|
11454
|
-
/* @__PURE__ */
|
|
11777
|
+
/* @__PURE__ */ jsx54(ProvenanceCard, { provenance }),
|
|
11778
|
+
/* @__PURE__ */ jsx54(PipelineExecutionPanel, {})
|
|
11455
11779
|
] })
|
|
11456
11780
|
}
|
|
11457
11781
|
),
|
|
11458
|
-
currentTab === "diagnostics" && hasDiagnostics && /* @__PURE__ */
|
|
11782
|
+
currentTab === "diagnostics" && hasDiagnostics && /* @__PURE__ */ jsx54(
|
|
11459
11783
|
DiagnosticsPanel,
|
|
11460
11784
|
{
|
|
11461
11785
|
artifactCache,
|
|
@@ -11471,13 +11795,13 @@ function ReportDetail({
|
|
|
11471
11795
|
testResults: summary.testResults
|
|
11472
11796
|
}
|
|
11473
11797
|
),
|
|
11474
|
-
currentTab === "activity" && hasAgentActivity && /* @__PURE__ */
|
|
11798
|
+
currentTab === "activity" && hasAgentActivity && /* @__PURE__ */ jsx54(
|
|
11475
11799
|
TabPanel,
|
|
11476
11800
|
{
|
|
11477
11801
|
"aria-labelledby": "tab-activity",
|
|
11478
11802
|
hidden: currentTab !== "activity",
|
|
11479
11803
|
id: "panel-activity",
|
|
11480
|
-
children: /* @__PURE__ */
|
|
11804
|
+
children: /* @__PURE__ */ jsx54(
|
|
11481
11805
|
AgentBehaviorCard,
|
|
11482
11806
|
{
|
|
11483
11807
|
agentBehavior: summary.agentBehavior,
|
|
@@ -11498,7 +11822,6 @@ var DIAG_TABS = [
|
|
|
11498
11822
|
{ id: "strengths", label: "Strengths" },
|
|
11499
11823
|
{ id: "issues", label: "Issues" }
|
|
11500
11824
|
];
|
|
11501
|
-
var SHOW_FAILURE_MODES = false;
|
|
11502
11825
|
function DiagnosticsPanel({
|
|
11503
11826
|
artifactCache,
|
|
11504
11827
|
comparison,
|
|
@@ -11516,9 +11839,9 @@ function DiagnosticsPanel({
|
|
|
11516
11839
|
const issueCount = scores.filter((s) => s.totalScore < SCORE_CAUTION).length + scores.filter((s) => s.negativeDocLift).length + scores.filter(
|
|
11517
11840
|
(s) => s.infrastructureEfficiency != null && s.infrastructureEfficiency < EFFICIENCY_CAUTION && !s.invertedRetrievalGap
|
|
11518
11841
|
).length;
|
|
11519
|
-
return /* @__PURE__ */
|
|
11520
|
-
/* @__PURE__ */
|
|
11521
|
-
|
|
11842
|
+
return /* @__PURE__ */ jsx54(TabPanel, { "aria-labelledby": "tab-diagnostics", id: "panel-diagnostics", children: /* @__PURE__ */ jsxs39(Stack31, { space: 4, children: [
|
|
11843
|
+
/* @__PURE__ */ jsx54(
|
|
11844
|
+
Flex30,
|
|
11522
11845
|
{
|
|
11523
11846
|
align: "center",
|
|
11524
11847
|
gap: 1,
|
|
@@ -11527,7 +11850,7 @@ function DiagnosticsPanel({
|
|
|
11527
11850
|
paddingBottom: 8
|
|
11528
11851
|
},
|
|
11529
11852
|
wrap: "wrap",
|
|
11530
|
-
children: DIAG_TABS.map((tab) => /* @__PURE__ */
|
|
11853
|
+
children: DIAG_TABS.map((tab) => /* @__PURE__ */ jsxs39(
|
|
11531
11854
|
"button",
|
|
11532
11855
|
{
|
|
11533
11856
|
onClick: () => onNavigate(tab.id === "strengths" ? null : tab.id, null),
|
|
@@ -11547,7 +11870,7 @@ function DiagnosticsPanel({
|
|
|
11547
11870
|
type: "button",
|
|
11548
11871
|
children: [
|
|
11549
11872
|
tab.label,
|
|
11550
|
-
tab.id === "issues" && issueCount > 0 && /* @__PURE__ */
|
|
11873
|
+
tab.id === "issues" && issueCount > 0 && /* @__PURE__ */ jsx54(
|
|
11551
11874
|
"span",
|
|
11552
11875
|
{
|
|
11553
11876
|
style: {
|
|
@@ -11567,7 +11890,7 @@ function DiagnosticsPanel({
|
|
|
11567
11890
|
))
|
|
11568
11891
|
}
|
|
11569
11892
|
),
|
|
11570
|
-
subTab === "strengths" && /* @__PURE__ */
|
|
11893
|
+
subTab === "strengths" && /* @__PURE__ */ jsx54(
|
|
11571
11894
|
StrengthsList,
|
|
11572
11895
|
{
|
|
11573
11896
|
comparison,
|
|
@@ -11576,8 +11899,8 @@ function DiagnosticsPanel({
|
|
|
11576
11899
|
scores
|
|
11577
11900
|
}
|
|
11578
11901
|
),
|
|
11579
|
-
subTab === "issues" && /* @__PURE__ */
|
|
11580
|
-
/* @__PURE__ */
|
|
11902
|
+
subTab === "issues" && /* @__PURE__ */ jsxs39(Stack31, { space: 5, children: [
|
|
11903
|
+
/* @__PURE__ */ jsx54(
|
|
11581
11904
|
WeaknessesList,
|
|
11582
11905
|
{
|
|
11583
11906
|
comparison,
|
|
@@ -11586,8 +11909,8 @@ function DiagnosticsPanel({
|
|
|
11586
11909
|
scores
|
|
11587
11910
|
}
|
|
11588
11911
|
),
|
|
11589
|
-
|
|
11590
|
-
judgments && judgments.length > 0 && /* @__PURE__ */
|
|
11912
|
+
FEATURE_FLAGS.showFailureModes.enabled && /* @__PURE__ */ jsx54(FailureModesPanel, { failureModes }),
|
|
11913
|
+
judgments && judgments.length > 0 && /* @__PURE__ */ jsx54(
|
|
11591
11914
|
JudgmentList,
|
|
11592
11915
|
{
|
|
11593
11916
|
artifactCache,
|
|
@@ -11623,17 +11946,17 @@ function getDisabledTabTooltip(tabId, summary) {
|
|
|
11623
11946
|
if (!summary) return null;
|
|
11624
11947
|
switch (tabId) {
|
|
11625
11948
|
case "diagnostics":
|
|
11626
|
-
return /* @__PURE__ */
|
|
11949
|
+
return /* @__PURE__ */ jsx54(Text40, { muted: true, size: 2, children: "No diagnostic data available. Diagnostics require at least one scored feature area." });
|
|
11627
11950
|
case "activity":
|
|
11628
|
-
return summary.evaluationMode === "baseline" ? /* @__PURE__ */
|
|
11951
|
+
return summary.evaluationMode === "baseline" ? /* @__PURE__ */ jsxs39(Text40, { muted: true, size: 2, children: [
|
|
11629
11952
|
"Not available for baseline-only evaluations. Run with",
|
|
11630
11953
|
" ",
|
|
11631
|
-
/* @__PURE__ */
|
|
11954
|
+
/* @__PURE__ */ jsx54("code", { style: inlineCodeStyle, children: "--mode full" }),
|
|
11632
11955
|
" or",
|
|
11633
11956
|
" ",
|
|
11634
|
-
/* @__PURE__ */
|
|
11957
|
+
/* @__PURE__ */ jsx54("code", { style: inlineCodeStyle, children: "--mode agentic" }),
|
|
11635
11958
|
" to capture agent browsing behavior."
|
|
11636
|
-
] }) : /* @__PURE__ */
|
|
11959
|
+
] }) : /* @__PURE__ */ jsx54(Text40, { muted: true, size: 2, children: "No agent activity data was recorded for this evaluation." });
|
|
11637
11960
|
default:
|
|
11638
11961
|
return null;
|
|
11639
11962
|
}
|
|
@@ -11641,12 +11964,12 @@ function getDisabledTabTooltip(tabId, summary) {
|
|
|
11641
11964
|
|
|
11642
11965
|
// src/components/report-detail/AreaScoreRow.tsx
|
|
11643
11966
|
import { WarningOutlineIcon as WarningOutlineIcon4 } from "@sanity/icons";
|
|
11644
|
-
import { Box as
|
|
11645
|
-
import { jsx as
|
|
11967
|
+
import { Box as Box28, Flex as Flex31, Stack as Stack32, Text as Text41 } from "@sanity/ui";
|
|
11968
|
+
import { jsx as jsx55, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
11646
11969
|
|
|
11647
11970
|
// src/components/report-detail/AreaScoreTable.tsx
|
|
11648
11971
|
import React4 from "react";
|
|
11649
|
-
import { Card as
|
|
11972
|
+
import { Card as Card19, Stack as Stack33, Text as Text43 } from "@sanity/ui";
|
|
11650
11973
|
|
|
11651
11974
|
// src/lib/scoring.ts
|
|
11652
11975
|
var HEX_MAP = {
|
|
@@ -11663,49 +11986,49 @@ function scoreHex(score) {
|
|
|
11663
11986
|
}
|
|
11664
11987
|
|
|
11665
11988
|
// src/components/primitives/ScoreCell.tsx
|
|
11666
|
-
import { Card as
|
|
11667
|
-
import { jsx as
|
|
11989
|
+
import { Card as Card18, Text as Text42 } from "@sanity/ui";
|
|
11990
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
11668
11991
|
|
|
11669
11992
|
// src/components/report-detail/AreaScoreTable.tsx
|
|
11670
|
-
import { jsx as
|
|
11993
|
+
import { jsx as jsx57, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
11671
11994
|
|
|
11672
11995
|
// src/components/report-detail/AutoComparisonCard.tsx
|
|
11673
|
-
import { Badge as
|
|
11674
|
-
import { jsx as
|
|
11996
|
+
import { Badge as Badge10, Box as Box29, Card as Card20, Flex as Flex32, Grid as Grid5, Stack as Stack34, Text as Text44, Tooltip as Tooltip11 } from "@sanity/ui";
|
|
11997
|
+
import { jsx as jsx58, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
11675
11998
|
|
|
11676
11999
|
// src/components/report-detail/OverviewStats.tsx
|
|
11677
12000
|
import { Grid as Grid6 } from "@sanity/ui";
|
|
11678
|
-
import { jsx as
|
|
12001
|
+
import { jsx as jsx59, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
11679
12002
|
|
|
11680
12003
|
// src/components/report-detail/RecommendationsSection.tsx
|
|
11681
12004
|
import { BoltIcon as BoltIcon2 } from "@sanity/icons";
|
|
11682
|
-
import { Box as
|
|
11683
|
-
import { jsx as
|
|
12005
|
+
import { Box as Box30, Flex as Flex33, Stack as Stack35, Text as Text45 } from "@sanity/ui";
|
|
12006
|
+
import { jsx as jsx60, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
11684
12007
|
|
|
11685
12008
|
// src/components/report-detail/ThreeLayerTable.tsx
|
|
11686
12009
|
import React5 from "react";
|
|
11687
|
-
import { Badge as
|
|
11688
|
-
import { jsx as
|
|
12010
|
+
import { Badge as Badge11, Card as Card21, Flex as Flex34, Stack as Stack36, Text as Text46 } from "@sanity/ui";
|
|
12011
|
+
import { jsx as jsx61, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
11689
12012
|
|
|
11690
12013
|
// src/components/report-detail/JudgmentDetailDrawerOutlet.tsx
|
|
11691
|
-
import { Card as
|
|
11692
|
-
import { useCallback as
|
|
12014
|
+
import { Card as Card22 } from "@sanity/ui";
|
|
12015
|
+
import { useCallback as useCallback35, useEffect as useEffect14, useRef as useRef8, useState as useState27 } from "react";
|
|
11693
12016
|
|
|
11694
12017
|
// src/components/report-detail/JudgmentDetailDrawer.tsx
|
|
11695
|
-
import { useEffect as useEffect13, useState as
|
|
12018
|
+
import { useEffect as useEffect13, useState as useState26 } from "react";
|
|
11696
12019
|
import { CloseIcon as CloseIcon2 } from "@sanity/icons";
|
|
11697
12020
|
import {
|
|
11698
|
-
Box as
|
|
11699
|
-
Button as
|
|
11700
|
-
Flex as
|
|
11701
|
-
Stack as
|
|
12021
|
+
Box as Box31,
|
|
12022
|
+
Button as Button11,
|
|
12023
|
+
Flex as Flex35,
|
|
12024
|
+
Stack as Stack37,
|
|
11702
12025
|
Tab as Tab2,
|
|
11703
12026
|
TabList as TabList2,
|
|
11704
12027
|
TabPanel as TabPanel2,
|
|
11705
|
-
Text as
|
|
12028
|
+
Text as Text47,
|
|
11706
12029
|
Tooltip as Tooltip12
|
|
11707
12030
|
} from "@sanity/ui";
|
|
11708
|
-
import { jsx as
|
|
12031
|
+
import { jsx as jsx62, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
11709
12032
|
var HEADER_STYLE = {
|
|
11710
12033
|
borderBottom: "1px solid var(--card-border-color)"
|
|
11711
12034
|
};
|
|
@@ -11741,10 +12064,10 @@ var COPY_BUTTON_SLOT_STYLE = {
|
|
|
11741
12064
|
function DocBadge({
|
|
11742
12065
|
doc
|
|
11743
12066
|
}) {
|
|
11744
|
-
const [hovered, setHovered] =
|
|
12067
|
+
const [hovered, setHovered] = useState26(false);
|
|
11745
12068
|
const isLinked = Boolean(doc.documentId);
|
|
11746
12069
|
const tooltipLabel = isLinked ? `Edit "${doc.title || doc.slug}"` : doc.title || doc.slug;
|
|
11747
|
-
const badge = /* @__PURE__ */
|
|
12070
|
+
const badge = /* @__PURE__ */ jsx62(
|
|
11748
12071
|
"span",
|
|
11749
12072
|
{
|
|
11750
12073
|
style: {
|
|
@@ -11757,13 +12080,13 @@ function DocBadge({
|
|
|
11757
12080
|
children: doc.slug
|
|
11758
12081
|
}
|
|
11759
12082
|
);
|
|
11760
|
-
return /* @__PURE__ */
|
|
12083
|
+
return /* @__PURE__ */ jsx62(
|
|
11761
12084
|
Tooltip12,
|
|
11762
12085
|
{
|
|
11763
|
-
content: /* @__PURE__ */
|
|
12086
|
+
content: /* @__PURE__ */ jsx62(Box31, { padding: 2, children: /* @__PURE__ */ jsx62(Text47, { size: 2, children: tooltipLabel }) }),
|
|
11764
12087
|
placement: "bottom",
|
|
11765
12088
|
portal: true,
|
|
11766
|
-
children: isLinked ? /* @__PURE__ */
|
|
12089
|
+
children: isLinked ? /* @__PURE__ */ jsx62(
|
|
11767
12090
|
"a",
|
|
11768
12091
|
{
|
|
11769
12092
|
href: `/intent/edit/id=${doc.documentId}`,
|
|
@@ -11778,7 +12101,7 @@ function DocBadge({
|
|
|
11778
12101
|
},
|
|
11779
12102
|
children: badge
|
|
11780
12103
|
}
|
|
11781
|
-
) : /* @__PURE__ */
|
|
12104
|
+
) : /* @__PURE__ */ jsx62("span", { children: badge })
|
|
11782
12105
|
}
|
|
11783
12106
|
);
|
|
11784
12107
|
}
|
|
@@ -11789,7 +12112,7 @@ function JudgmentDetailDrawer({
|
|
|
11789
12112
|
onShowPrompts,
|
|
11790
12113
|
testResult
|
|
11791
12114
|
}) {
|
|
11792
|
-
const [tab, setTab] =
|
|
12115
|
+
const [tab, setTab] = useState26("reasoning");
|
|
11793
12116
|
const sep = judgment.taskId.indexOf(" - ");
|
|
11794
12117
|
const rawTaskName = sep > 0 ? judgment.taskId.substring(sep + 3) : judgment.taskId;
|
|
11795
12118
|
const { name: taskName, variant } = splitVariant(rawTaskName);
|
|
@@ -11807,7 +12130,7 @@ function JudgmentDetailDrawer({
|
|
|
11807
12130
|
useEffect13(() => {
|
|
11808
12131
|
setTab("reasoning");
|
|
11809
12132
|
}, [judgment.taskId, judgment.dimension, judgment.modelId]);
|
|
11810
|
-
const [fetchDispatched, setFetchDispatched] =
|
|
12133
|
+
const [fetchDispatched, setFetchDispatched] = useState26(false);
|
|
11811
12134
|
useEffect13(() => {
|
|
11812
12135
|
setFetchDispatched(false);
|
|
11813
12136
|
}, [judgment.taskId, judgment.dimension, judgment.modelId]);
|
|
@@ -11843,15 +12166,15 @@ function JudgmentDetailDrawer({
|
|
|
11843
12166
|
window.addEventListener("keydown", onKeyDown);
|
|
11844
12167
|
return () => window.removeEventListener("keydown", onKeyDown);
|
|
11845
12168
|
}, [onClose]);
|
|
11846
|
-
return /* @__PURE__ */
|
|
11847
|
-
|
|
12169
|
+
return /* @__PURE__ */ jsxs46(
|
|
12170
|
+
Flex35,
|
|
11848
12171
|
{
|
|
11849
12172
|
"aria-label": `Judgment detail: ${judgment.score} ${dimLabel}, ${taskName}`,
|
|
11850
12173
|
direction: "column",
|
|
11851
12174
|
role: "dialog",
|
|
11852
12175
|
style: { flex: 1, height: "100%", minHeight: 0, overflow: "hidden" },
|
|
11853
12176
|
children: [
|
|
11854
|
-
/* @__PURE__ */
|
|
12177
|
+
/* @__PURE__ */ jsx62(
|
|
11855
12178
|
"div",
|
|
11856
12179
|
{
|
|
11857
12180
|
"aria-hidden": true,
|
|
@@ -11864,10 +12187,10 @@ function JudgmentDetailDrawer({
|
|
|
11864
12187
|
}
|
|
11865
12188
|
}
|
|
11866
12189
|
),
|
|
11867
|
-
/* @__PURE__ */
|
|
11868
|
-
/* @__PURE__ */
|
|
11869
|
-
/* @__PURE__ */
|
|
11870
|
-
/* @__PURE__ */
|
|
12190
|
+
/* @__PURE__ */ jsxs46(Flex35, { align: "flex-start", gap: 2, padding: 4, style: HEADER_STYLE, children: [
|
|
12191
|
+
/* @__PURE__ */ jsxs46(Stack37, { flex: 1, space: 2, children: [
|
|
12192
|
+
/* @__PURE__ */ jsxs46(Flex35, { align: "center", gap: 2, wrap: "wrap", children: [
|
|
12193
|
+
/* @__PURE__ */ jsx62(
|
|
11871
12194
|
"span",
|
|
11872
12195
|
{
|
|
11873
12196
|
style: {
|
|
@@ -11882,7 +12205,7 @@ function JudgmentDetailDrawer({
|
|
|
11882
12205
|
children: judgment.score
|
|
11883
12206
|
}
|
|
11884
12207
|
),
|
|
11885
|
-
/* @__PURE__ */
|
|
12208
|
+
/* @__PURE__ */ jsx62(
|
|
11886
12209
|
"span",
|
|
11887
12210
|
{
|
|
11888
12211
|
style: {
|
|
@@ -11895,13 +12218,13 @@ function JudgmentDetailDrawer({
|
|
|
11895
12218
|
children: dimLabel
|
|
11896
12219
|
}
|
|
11897
12220
|
),
|
|
11898
|
-
/* @__PURE__ */
|
|
12221
|
+
/* @__PURE__ */ jsx62(
|
|
11899
12222
|
Tooltip12,
|
|
11900
12223
|
{
|
|
11901
|
-
content: /* @__PURE__ */
|
|
12224
|
+
content: /* @__PURE__ */ jsx62(Box31, { padding: 2, children: /* @__PURE__ */ jsx62(Text47, { size: 1, children: judgment.modelId }) }),
|
|
11902
12225
|
placement: "bottom",
|
|
11903
12226
|
portal: true,
|
|
11904
|
-
children: /* @__PURE__ */
|
|
12227
|
+
children: /* @__PURE__ */ jsx62(
|
|
11905
12228
|
"span",
|
|
11906
12229
|
{
|
|
11907
12230
|
style: {
|
|
@@ -11918,7 +12241,7 @@ function JudgmentDetailDrawer({
|
|
|
11918
12241
|
)
|
|
11919
12242
|
}
|
|
11920
12243
|
),
|
|
11921
|
-
(testResult?.latencyMs != null || testResult?.cost != null && testResult.cost > 0) && /* @__PURE__ */
|
|
12244
|
+
(testResult?.latencyMs != null || testResult?.cost != null && testResult.cost > 0) && /* @__PURE__ */ jsx62(
|
|
11922
12245
|
"span",
|
|
11923
12246
|
{
|
|
11924
12247
|
"aria-hidden": true,
|
|
@@ -11930,38 +12253,38 @@ function JudgmentDetailDrawer({
|
|
|
11930
12253
|
}
|
|
11931
12254
|
}
|
|
11932
12255
|
),
|
|
11933
|
-
testResult?.latencyMs != null && /* @__PURE__ */
|
|
12256
|
+
testResult?.latencyMs != null && /* @__PURE__ */ jsx62(
|
|
11934
12257
|
Tooltip12,
|
|
11935
12258
|
{
|
|
11936
|
-
content: /* @__PURE__ */
|
|
12259
|
+
content: /* @__PURE__ */ jsx62(Box31, { padding: 2, children: /* @__PURE__ */ jsx62(Text47, { size: 1, children: "End-to-end generation latency for this model call." }) }),
|
|
11937
12260
|
placement: "bottom",
|
|
11938
12261
|
portal: true,
|
|
11939
|
-
children: /* @__PURE__ */
|
|
12262
|
+
children: /* @__PURE__ */ jsxs46(Text47, { muted: true, size: 1, children: [
|
|
11940
12263
|
(testResult.latencyMs / 1e3).toFixed(1),
|
|
11941
12264
|
"s"
|
|
11942
12265
|
] })
|
|
11943
12266
|
}
|
|
11944
12267
|
),
|
|
11945
|
-
testResult?.cost != null && testResult.cost > 0 && /* @__PURE__ */
|
|
12268
|
+
testResult?.cost != null && testResult.cost > 0 && /* @__PURE__ */ jsx62(
|
|
11946
12269
|
Tooltip12,
|
|
11947
12270
|
{
|
|
11948
|
-
content: /* @__PURE__ */
|
|
12271
|
+
content: /* @__PURE__ */ jsx62(Box31, { padding: 2, children: /* @__PURE__ */ jsx62(Text47, { size: 1, children: "Provider-reported cost for this model call." }) }),
|
|
11949
12272
|
placement: "bottom",
|
|
11950
12273
|
portal: true,
|
|
11951
|
-
children: /* @__PURE__ */
|
|
12274
|
+
children: /* @__PURE__ */ jsxs46(Text47, { muted: true, size: 1, children: [
|
|
11952
12275
|
"$",
|
|
11953
12276
|
testResult.cost.toFixed(4)
|
|
11954
12277
|
] })
|
|
11955
12278
|
}
|
|
11956
12279
|
)
|
|
11957
12280
|
] }),
|
|
11958
|
-
/* @__PURE__ */
|
|
11959
|
-
/* @__PURE__ */
|
|
11960
|
-
/* @__PURE__ */
|
|
12281
|
+
/* @__PURE__ */ jsxs46(Flex35, { align: "center", gap: 2, wrap: "wrap", children: [
|
|
12282
|
+
/* @__PURE__ */ jsx62(Text47, { size: 2, weight: "medium", children: taskName }),
|
|
12283
|
+
/* @__PURE__ */ jsx62(VariantBadge, { variant })
|
|
11961
12284
|
] })
|
|
11962
12285
|
] }),
|
|
11963
|
-
/* @__PURE__ */
|
|
11964
|
-
/* @__PURE__ */
|
|
12286
|
+
/* @__PURE__ */ jsxs46(Flex35, { align: "center", gap: 1, children: [
|
|
12287
|
+
/* @__PURE__ */ jsx62(
|
|
11965
12288
|
"span",
|
|
11966
12289
|
{
|
|
11967
12290
|
style: {
|
|
@@ -11979,8 +12302,8 @@ function JudgmentDetailDrawer({
|
|
|
11979
12302
|
children: "Esc"
|
|
11980
12303
|
}
|
|
11981
12304
|
),
|
|
11982
|
-
/* @__PURE__ */
|
|
11983
|
-
|
|
12305
|
+
/* @__PURE__ */ jsx62(
|
|
12306
|
+
Button11,
|
|
11984
12307
|
{
|
|
11985
12308
|
"aria-label": "Close (Esc)",
|
|
11986
12309
|
autoFocus: true,
|
|
@@ -11992,8 +12315,8 @@ function JudgmentDetailDrawer({
|
|
|
11992
12315
|
)
|
|
11993
12316
|
] })
|
|
11994
12317
|
] }),
|
|
11995
|
-
/* @__PURE__ */
|
|
11996
|
-
|
|
12318
|
+
/* @__PURE__ */ jsxs46(
|
|
12319
|
+
Flex35,
|
|
11997
12320
|
{
|
|
11998
12321
|
align: "center",
|
|
11999
12322
|
gap: 2,
|
|
@@ -12002,8 +12325,8 @@ function JudgmentDetailDrawer({
|
|
|
12002
12325
|
paddingY: 2,
|
|
12003
12326
|
style: TAB_BAR_STYLE,
|
|
12004
12327
|
children: [
|
|
12005
|
-
/* @__PURE__ */
|
|
12006
|
-
/* @__PURE__ */
|
|
12328
|
+
/* @__PURE__ */ jsx62(Box31, { flex: 1, style: { minWidth: 0 }, children: /* @__PURE__ */ jsxs46(TabList2, { space: 2, children: [
|
|
12329
|
+
/* @__PURE__ */ jsx62(
|
|
12007
12330
|
Tab2,
|
|
12008
12331
|
{
|
|
12009
12332
|
"aria-controls": "judgment-panel-reasoning",
|
|
@@ -12013,7 +12336,7 @@ function JudgmentDetailDrawer({
|
|
|
12013
12336
|
selected: tab === "reasoning"
|
|
12014
12337
|
}
|
|
12015
12338
|
),
|
|
12016
|
-
hasOutputTab && /* @__PURE__ */
|
|
12339
|
+
hasOutputTab && /* @__PURE__ */ jsx62(
|
|
12017
12340
|
Tab2,
|
|
12018
12341
|
{
|
|
12019
12342
|
"aria-controls": "judgment-panel-output",
|
|
@@ -12024,7 +12347,7 @@ function JudgmentDetailDrawer({
|
|
|
12024
12347
|
}
|
|
12025
12348
|
)
|
|
12026
12349
|
] }) }),
|
|
12027
|
-
/* @__PURE__ */
|
|
12350
|
+
/* @__PURE__ */ jsx62(
|
|
12028
12351
|
JudgmentActions,
|
|
12029
12352
|
{
|
|
12030
12353
|
onShowPrompts: onShowPrompts ? () => onShowPrompts(judgment) : void 0
|
|
@@ -12033,15 +12356,15 @@ function JudgmentDetailDrawer({
|
|
|
12033
12356
|
]
|
|
12034
12357
|
}
|
|
12035
12358
|
),
|
|
12036
|
-
/* @__PURE__ */
|
|
12037
|
-
/* @__PURE__ */
|
|
12359
|
+
/* @__PURE__ */ jsxs46(Box31, { padding: 4, style: CONTENT_STYLE, children: [
|
|
12360
|
+
/* @__PURE__ */ jsx62(
|
|
12038
12361
|
TabPanel2,
|
|
12039
12362
|
{
|
|
12040
12363
|
"aria-labelledby": "judgment-tab-reasoning",
|
|
12041
12364
|
hidden: tab !== "reasoning",
|
|
12042
12365
|
id: "judgment-panel-reasoning",
|
|
12043
|
-
children: /* @__PURE__ */
|
|
12044
|
-
/* @__PURE__ */
|
|
12366
|
+
children: /* @__PURE__ */ jsxs46(Box31, { style: COPYABLE_BLOCK_STYLE, children: [
|
|
12367
|
+
/* @__PURE__ */ jsx62(Box31, { style: COPY_BUTTON_SLOT_STYLE, children: /* @__PURE__ */ jsx62(
|
|
12045
12368
|
CopyButton,
|
|
12046
12369
|
{
|
|
12047
12370
|
copiedLabel: "Reasoning copied",
|
|
@@ -12049,26 +12372,26 @@ function JudgmentDetailDrawer({
|
|
|
12049
12372
|
text: reasoningText
|
|
12050
12373
|
}
|
|
12051
12374
|
) }),
|
|
12052
|
-
/* @__PURE__ */
|
|
12053
|
-
reasoningIsPreview && /* @__PURE__ */
|
|
12375
|
+
/* @__PURE__ */ jsx62(Markdown, { content: reasoningText }),
|
|
12376
|
+
reasoningIsPreview && /* @__PURE__ */ jsx62(Text47, { muted: true, size: 1, style: { marginTop: 8 }, children: fullStatus === "loading" ? "Loading full reasoning\u2026" : "Showing preview (280 chars). Full reasoning not yet loaded." })
|
|
12054
12377
|
] })
|
|
12055
12378
|
}
|
|
12056
12379
|
),
|
|
12057
|
-
hasOutputTab && /* @__PURE__ */
|
|
12380
|
+
hasOutputTab && /* @__PURE__ */ jsxs46(
|
|
12058
12381
|
TabPanel2,
|
|
12059
12382
|
{
|
|
12060
12383
|
"aria-labelledby": "judgment-tab-output",
|
|
12061
12384
|
hidden: tab !== "output",
|
|
12062
12385
|
id: "judgment-panel-output",
|
|
12063
12386
|
children: [
|
|
12064
|
-
!resolvedOutput && fetchInFlight && /* @__PURE__ */
|
|
12065
|
-
!resolvedOutput && fetchFailed && /* @__PURE__ */
|
|
12387
|
+
!resolvedOutput && fetchInFlight && /* @__PURE__ */ jsx62(Text47, { muted: true, size: 1, children: "Fetching model output\u2026" }),
|
|
12388
|
+
!resolvedOutput && fetchFailed && /* @__PURE__ */ jsxs46(Text47, { muted: true, size: 1, style: { color: "#f87171" }, children: [
|
|
12066
12389
|
"Failed to load model output",
|
|
12067
12390
|
artifactCache?.error ? `: ${artifactCache.error}` : ""
|
|
12068
12391
|
] }),
|
|
12069
|
-
!resolvedOutput && entryUnavailable && /* @__PURE__ */
|
|
12070
|
-
resolvedOutput && /* @__PURE__ */
|
|
12071
|
-
/* @__PURE__ */
|
|
12392
|
+
!resolvedOutput && entryUnavailable && /* @__PURE__ */ jsx62(Text47, { muted: true, size: 1, children: "Model output not available for this entry." }),
|
|
12393
|
+
resolvedOutput && /* @__PURE__ */ jsxs46(Box31, { style: COPYABLE_BLOCK_STYLE, children: [
|
|
12394
|
+
/* @__PURE__ */ jsx62(Box31, { style: COPY_BUTTON_SLOT_STYLE, children: /* @__PURE__ */ jsx62(
|
|
12072
12395
|
CopyButton,
|
|
12073
12396
|
{
|
|
12074
12397
|
copiedLabel: "Output copied",
|
|
@@ -12076,15 +12399,15 @@ function JudgmentDetailDrawer({
|
|
|
12076
12399
|
text: resolvedOutput
|
|
12077
12400
|
}
|
|
12078
12401
|
) }),
|
|
12079
|
-
/* @__PURE__ */
|
|
12402
|
+
/* @__PURE__ */ jsx62(Markdown, { content: resolvedOutput })
|
|
12080
12403
|
] })
|
|
12081
12404
|
]
|
|
12082
12405
|
}
|
|
12083
12406
|
)
|
|
12084
12407
|
] }),
|
|
12085
|
-
judgment.canonicalDocs && judgment.canonicalDocs.length > 0 && /* @__PURE__ */
|
|
12086
|
-
/* @__PURE__ */
|
|
12087
|
-
judgment.canonicalDocs.map((doc) => /* @__PURE__ */
|
|
12408
|
+
judgment.canonicalDocs && judgment.canonicalDocs.length > 0 && /* @__PURE__ */ jsx62(Box31, { padding: 4, style: RELATED_DOCS_STYLE, children: /* @__PURE__ */ jsxs46(Flex35, { align: "center", gap: 2, wrap: "wrap", children: [
|
|
12409
|
+
/* @__PURE__ */ jsx62("span", { style: SECTION_LABEL_STYLE, children: "Related docs" }),
|
|
12410
|
+
judgment.canonicalDocs.map((doc) => /* @__PURE__ */ jsx62(DocBadge, { doc }, doc.slug))
|
|
12088
12411
|
] }) })
|
|
12089
12412
|
]
|
|
12090
12413
|
}
|
|
@@ -12092,7 +12415,7 @@ function JudgmentDetailDrawer({
|
|
|
12092
12415
|
}
|
|
12093
12416
|
|
|
12094
12417
|
// src/components/report-detail/JudgmentDetailDrawerOutlet.tsx
|
|
12095
|
-
import { jsx as
|
|
12418
|
+
import { jsx as jsx63, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
12096
12419
|
var MIN_WIDTH2 = 480;
|
|
12097
12420
|
var MAX_WIDTH2 = 900;
|
|
12098
12421
|
var OVERLAY_BREAKPOINT2 = 1024;
|
|
@@ -12102,7 +12425,7 @@ function computeDefaultWidth() {
|
|
|
12102
12425
|
return Math.min(MAX_WIDTH2, Math.max(MIN_WIDTH2, target));
|
|
12103
12426
|
}
|
|
12104
12427
|
function useIsNarrow2() {
|
|
12105
|
-
const [narrow, setNarrow] =
|
|
12428
|
+
const [narrow, setNarrow] = useState27(
|
|
12106
12429
|
() => typeof window !== "undefined" && window.innerWidth < OVERLAY_BREAKPOINT2
|
|
12107
12430
|
);
|
|
12108
12431
|
useEffect14(() => {
|
|
@@ -12115,11 +12438,11 @@ function useIsNarrow2() {
|
|
|
12115
12438
|
return narrow;
|
|
12116
12439
|
}
|
|
12117
12440
|
function useResizable2(defaultWidth) {
|
|
12118
|
-
const [width, setWidth] =
|
|
12441
|
+
const [width, setWidth] = useState27(defaultWidth);
|
|
12119
12442
|
const dragging = useRef8(false);
|
|
12120
12443
|
const startX = useRef8(0);
|
|
12121
12444
|
const startWidth = useRef8(0);
|
|
12122
|
-
const handleMouseDown =
|
|
12445
|
+
const handleMouseDown = useCallback35(
|
|
12123
12446
|
(e) => {
|
|
12124
12447
|
e.preventDefault();
|
|
12125
12448
|
dragging.current = true;
|
|
@@ -12162,7 +12485,7 @@ function JudgmentDetailDrawerOutlet({
|
|
|
12162
12485
|
const isNarrow = useIsNarrow2();
|
|
12163
12486
|
const { handleMouseDown, width } = useResizable2(computeDefaultWidth());
|
|
12164
12487
|
if (!isOpen || !active) return null;
|
|
12165
|
-
return /* @__PURE__ */
|
|
12488
|
+
return /* @__PURE__ */ jsxs47(
|
|
12166
12489
|
"div",
|
|
12167
12490
|
{
|
|
12168
12491
|
style: isNarrow ? {
|
|
@@ -12188,7 +12511,7 @@ function JudgmentDetailDrawerOutlet({
|
|
|
12188
12511
|
width
|
|
12189
12512
|
},
|
|
12190
12513
|
children: [
|
|
12191
|
-
!isNarrow && /* @__PURE__ */
|
|
12514
|
+
!isNarrow && /* @__PURE__ */ jsx63(
|
|
12192
12515
|
"div",
|
|
12193
12516
|
{
|
|
12194
12517
|
"aria-label": "Resize judgment drawer",
|
|
@@ -12213,8 +12536,8 @@ function JudgmentDetailDrawerOutlet({
|
|
|
12213
12536
|
}
|
|
12214
12537
|
}
|
|
12215
12538
|
),
|
|
12216
|
-
/* @__PURE__ */
|
|
12217
|
-
|
|
12539
|
+
/* @__PURE__ */ jsx63(
|
|
12540
|
+
Card22,
|
|
12218
12541
|
{
|
|
12219
12542
|
borderLeft: !isNarrow,
|
|
12220
12543
|
style: {
|
|
@@ -12223,7 +12546,7 @@ function JudgmentDetailDrawerOutlet({
|
|
|
12223
12546
|
flexDirection: "column",
|
|
12224
12547
|
overflow: "hidden"
|
|
12225
12548
|
},
|
|
12226
|
-
children: /* @__PURE__ */
|
|
12549
|
+
children: /* @__PURE__ */ jsx63(ReportArtifactProvider, { runId: active.runId, manifest: active.manifest, children: /* @__PURE__ */ jsx63(
|
|
12227
12550
|
JudgmentDetailDrawer,
|
|
12228
12551
|
{
|
|
12229
12552
|
artifactCache: active.artifactCache,
|
|
@@ -12241,10 +12564,10 @@ function JudgmentDetailDrawerOutlet({
|
|
|
12241
12564
|
}
|
|
12242
12565
|
|
|
12243
12566
|
// src/components/ScoreTimeline.tsx
|
|
12244
|
-
import { Card as
|
|
12245
|
-
import { useCallback as
|
|
12567
|
+
import { Card as Card23, Flex as Flex36, Select as Select2, Stack as Stack38, Text as Text48 } from "@sanity/ui";
|
|
12568
|
+
import { useCallback as useCallback36, useEffect as useEffect15, useMemo as useMemo16, useState as useState28 } from "react";
|
|
12246
12569
|
import { useClient as useClient11 } from "sanity";
|
|
12247
|
-
import { jsx as
|
|
12570
|
+
import { jsx as jsx64, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
12248
12571
|
var CHART_HEIGHT = 220;
|
|
12249
12572
|
var CHART_WIDTH = 800;
|
|
12250
12573
|
var PAD_BOTTOM = 30;
|
|
@@ -12279,10 +12602,10 @@ function scoreForPoint(point, area) {
|
|
|
12279
12602
|
}
|
|
12280
12603
|
function ScoreTimeline({ mode = null, source = null }) {
|
|
12281
12604
|
const client = useClient11({ apiVersion: API_VERSION });
|
|
12282
|
-
const [dataPoints, setDataPoints] =
|
|
12283
|
-
const [loading, setLoading] =
|
|
12284
|
-
const [rangeDays, setRangeDays] =
|
|
12285
|
-
const [selectedArea, setSelectedArea] =
|
|
12605
|
+
const [dataPoints, setDataPoints] = useState28([]);
|
|
12606
|
+
const [loading, setLoading] = useState28(true);
|
|
12607
|
+
const [rangeDays, setRangeDays] = useState28(30);
|
|
12608
|
+
const [selectedArea, setSelectedArea] = useState28(null);
|
|
12286
12609
|
const areaNames = useMemo16(() => {
|
|
12287
12610
|
const names = /* @__PURE__ */ new Set();
|
|
12288
12611
|
for (const dp of dataPoints) {
|
|
@@ -12292,7 +12615,7 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
12292
12615
|
}
|
|
12293
12616
|
return Array.from(names).sort();
|
|
12294
12617
|
}, [dataPoints]);
|
|
12295
|
-
const fetchData =
|
|
12618
|
+
const fetchData = useCallback36(async () => {
|
|
12296
12619
|
setLoading(true);
|
|
12297
12620
|
try {
|
|
12298
12621
|
const startDate = rangeDays ? daysAgo(rangeDays) : "1970-01-01T00:00:00Z";
|
|
@@ -12328,14 +12651,14 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
12328
12651
|
if (chartPoints.length === 0) return 0;
|
|
12329
12652
|
return chartPoints.reduce((sum, p) => sum + p.score, 0) / chartPoints.length;
|
|
12330
12653
|
}, [chartPoints]);
|
|
12331
|
-
const handleRangeChange =
|
|
12654
|
+
const handleRangeChange = useCallback36(
|
|
12332
12655
|
(e) => {
|
|
12333
12656
|
const val = e.currentTarget.value;
|
|
12334
12657
|
setRangeDays(val === "all" ? null : Number(val));
|
|
12335
12658
|
},
|
|
12336
12659
|
[]
|
|
12337
12660
|
);
|
|
12338
|
-
const handleAreaChange =
|
|
12661
|
+
const handleAreaChange = useCallback36(
|
|
12339
12662
|
(e) => {
|
|
12340
12663
|
const val = e.currentTarget.value;
|
|
12341
12664
|
setSelectedArea(val || null);
|
|
@@ -12343,22 +12666,22 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
12343
12666
|
[]
|
|
12344
12667
|
);
|
|
12345
12668
|
const polylinePoints = chartPoints.map((p) => `${p.x},${p.y}`).join(" ");
|
|
12346
|
-
return /* @__PURE__ */
|
|
12347
|
-
/* @__PURE__ */
|
|
12348
|
-
/* @__PURE__ */
|
|
12669
|
+
return /* @__PURE__ */ jsxs48(Stack38, { space: 4, children: [
|
|
12670
|
+
/* @__PURE__ */ jsxs48(Flex36, { gap: 3, children: [
|
|
12671
|
+
/* @__PURE__ */ jsx64(
|
|
12349
12672
|
Select2,
|
|
12350
12673
|
{
|
|
12351
12674
|
onChange: handleRangeChange,
|
|
12352
12675
|
value: rangeDays?.toString() ?? "all",
|
|
12353
|
-
children: TIME_RANGES.map((r) => /* @__PURE__ */
|
|
12676
|
+
children: TIME_RANGES.map((r) => /* @__PURE__ */ jsx64("option", { value: r.days?.toString() ?? "all", children: r.label }, r.label))
|
|
12354
12677
|
}
|
|
12355
12678
|
),
|
|
12356
|
-
/* @__PURE__ */
|
|
12357
|
-
/* @__PURE__ */
|
|
12358
|
-
areaNames.map((name) => /* @__PURE__ */
|
|
12679
|
+
/* @__PURE__ */ jsxs48(Select2, { onChange: handleAreaChange, value: selectedArea ?? "", children: [
|
|
12680
|
+
/* @__PURE__ */ jsx64("option", { value: "", children: "Overall" }),
|
|
12681
|
+
areaNames.map((name) => /* @__PURE__ */ jsx64("option", { value: name, children: name }, name))
|
|
12359
12682
|
] })
|
|
12360
12683
|
] }),
|
|
12361
|
-
/* @__PURE__ */
|
|
12684
|
+
/* @__PURE__ */ jsx64(Card23, { padding: 3, radius: 2, shadow: 1, children: loading ? /* @__PURE__ */ jsx64(Flex36, { align: "center", justify: "center", style: { height: 200 }, children: /* @__PURE__ */ jsx64(Text48, { muted: true, size: 2, children: "Loading\u2026" }) }) : chartPoints.length === 0 ? /* @__PURE__ */ jsx64(Flex36, { align: "center", justify: "center", style: { height: 200 }, children: /* @__PURE__ */ jsx64(Text48, { muted: true, size: 2, children: "No reports found for this time range" }) }) : /* @__PURE__ */ jsxs48(
|
|
12362
12685
|
"svg",
|
|
12363
12686
|
{
|
|
12364
12687
|
style: { display: "block", width: "100%" },
|
|
@@ -12366,8 +12689,8 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
12366
12689
|
children: [
|
|
12367
12690
|
Y_TICKS.map((tick) => {
|
|
12368
12691
|
const y = PAD_TOP + PLOT_HEIGHT - tick / Y_MAX * PLOT_HEIGHT;
|
|
12369
|
-
return /* @__PURE__ */
|
|
12370
|
-
/* @__PURE__ */
|
|
12692
|
+
return /* @__PURE__ */ jsxs48("g", { children: [
|
|
12693
|
+
/* @__PURE__ */ jsx64(
|
|
12371
12694
|
"line",
|
|
12372
12695
|
{
|
|
12373
12696
|
stroke: "#ccc",
|
|
@@ -12378,7 +12701,7 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
12378
12701
|
y2: y
|
|
12379
12702
|
}
|
|
12380
12703
|
),
|
|
12381
|
-
/* @__PURE__ */
|
|
12704
|
+
/* @__PURE__ */ jsx64(
|
|
12382
12705
|
"text",
|
|
12383
12706
|
{
|
|
12384
12707
|
dominantBaseline: "middle",
|
|
@@ -12398,7 +12721,7 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
12398
12721
|
chartPoints.length - 1
|
|
12399
12722
|
].map((idx) => {
|
|
12400
12723
|
const p = chartPoints[idx];
|
|
12401
|
-
return /* @__PURE__ */
|
|
12724
|
+
return /* @__PURE__ */ jsx64(
|
|
12402
12725
|
"text",
|
|
12403
12726
|
{
|
|
12404
12727
|
fill: "#999",
|
|
@@ -12410,7 +12733,7 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
12410
12733
|
},
|
|
12411
12734
|
idx
|
|
12412
12735
|
);
|
|
12413
|
-
}) : chartPoints.map((p, idx) => /* @__PURE__ */
|
|
12736
|
+
}) : chartPoints.map((p, idx) => /* @__PURE__ */ jsx64(
|
|
12414
12737
|
"text",
|
|
12415
12738
|
{
|
|
12416
12739
|
fill: "#999",
|
|
@@ -12422,7 +12745,7 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
12422
12745
|
},
|
|
12423
12746
|
idx
|
|
12424
12747
|
)),
|
|
12425
|
-
/* @__PURE__ */
|
|
12748
|
+
/* @__PURE__ */ jsx64(
|
|
12426
12749
|
"polyline",
|
|
12427
12750
|
{
|
|
12428
12751
|
fill: "none",
|
|
@@ -12432,7 +12755,7 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
12432
12755
|
strokeWidth: 2.5
|
|
12433
12756
|
}
|
|
12434
12757
|
),
|
|
12435
|
-
chartPoints.map((p, idx) => /* @__PURE__ */
|
|
12758
|
+
chartPoints.map((p, idx) => /* @__PURE__ */ jsx64(
|
|
12436
12759
|
"circle",
|
|
12437
12760
|
{
|
|
12438
12761
|
cx: p.x,
|
|
@@ -12441,7 +12764,7 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
12441
12764
|
r: 4,
|
|
12442
12765
|
stroke: "#fff",
|
|
12443
12766
|
strokeWidth: 1.5,
|
|
12444
|
-
children: /* @__PURE__ */
|
|
12767
|
+
children: /* @__PURE__ */ jsxs48("title", { children: [
|
|
12445
12768
|
formatDate(p.date),
|
|
12446
12769
|
": ",
|
|
12447
12770
|
Math.round(p.score)
|
|
@@ -12452,7 +12775,7 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
12452
12775
|
]
|
|
12453
12776
|
}
|
|
12454
12777
|
) }),
|
|
12455
|
-
/* @__PURE__ */
|
|
12778
|
+
/* @__PURE__ */ jsxs48(Text48, { muted: true, size: 2, children: [
|
|
12456
12779
|
chartPoints.length,
|
|
12457
12780
|
" data point",
|
|
12458
12781
|
chartPoints.length !== 1 ? "s" : ""
|
|
@@ -12462,13 +12785,13 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
12462
12785
|
var ScoreTimeline_default = ScoreTimeline;
|
|
12463
12786
|
|
|
12464
12787
|
// src/components/Dashboard.tsx
|
|
12465
|
-
import { jsx as
|
|
12788
|
+
import { jsx as jsx65, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
12466
12789
|
var VIEW_PARAM_MAP = {
|
|
12467
12790
|
compare: "compare",
|
|
12468
12791
|
timeline: "timeline"
|
|
12469
12792
|
};
|
|
12470
12793
|
function Dashboard() {
|
|
12471
|
-
return /* @__PURE__ */
|
|
12794
|
+
return /* @__PURE__ */ jsx65(HelpProvider, { children: /* @__PURE__ */ jsx65(JudgmentDrawerProvider, { children: /* @__PURE__ */ jsx65(DashboardShell, {}) }) });
|
|
12472
12795
|
}
|
|
12473
12796
|
function DashboardShell() {
|
|
12474
12797
|
const router = useRouter3();
|
|
@@ -12478,7 +12801,7 @@ function DashboardShell() {
|
|
|
12478
12801
|
useEffect16(() => {
|
|
12479
12802
|
if (!reportId) closeDrawer();
|
|
12480
12803
|
}, [reportId, closeDrawer]);
|
|
12481
|
-
const handleJudgmentDrawerClose =
|
|
12804
|
+
const handleJudgmentDrawerClose = useCallback37(() => {
|
|
12482
12805
|
closeDrawer();
|
|
12483
12806
|
const state = { ...router.state };
|
|
12484
12807
|
if (state.focus) {
|
|
@@ -12486,10 +12809,10 @@ function DashboardShell() {
|
|
|
12486
12809
|
router.navigate(state);
|
|
12487
12810
|
}
|
|
12488
12811
|
}, [closeDrawer, router]);
|
|
12489
|
-
return /* @__PURE__ */
|
|
12490
|
-
/* @__PURE__ */
|
|
12491
|
-
/* @__PURE__ */
|
|
12492
|
-
/* @__PURE__ */
|
|
12812
|
+
return /* @__PURE__ */ jsxs49(Flex37, { style: { height: "100%" }, children: [
|
|
12813
|
+
/* @__PURE__ */ jsx65(Box32, { flex: 1, overflow: "auto", children: /* @__PURE__ */ jsx65(DashboardContent, {}) }),
|
|
12814
|
+
/* @__PURE__ */ jsx65(JudgmentDetailDrawerOutlet, { onClose: handleJudgmentDrawerClose }),
|
|
12815
|
+
/* @__PURE__ */ jsx65(HelpDrawer, {})
|
|
12493
12816
|
] });
|
|
12494
12817
|
}
|
|
12495
12818
|
function DashboardContent() {
|
|
@@ -12500,7 +12823,7 @@ function DashboardContent() {
|
|
|
12500
12823
|
const isDetail = reportId !== null;
|
|
12501
12824
|
const activeTab = isDetail ? "latest" : VIEW_PARAM_MAP[routerState.view ?? ""] ?? "latest";
|
|
12502
12825
|
const defaultTopic = deriveHelpTopic(routerState);
|
|
12503
|
-
const navigateToTab =
|
|
12826
|
+
const navigateToTab = useCallback37(
|
|
12504
12827
|
(tab) => {
|
|
12505
12828
|
if (tab === "latest") {
|
|
12506
12829
|
router.navigate({});
|
|
@@ -12510,13 +12833,13 @@ function DashboardContent() {
|
|
|
12510
12833
|
},
|
|
12511
12834
|
[router]
|
|
12512
12835
|
);
|
|
12513
|
-
const handleSelectReport =
|
|
12836
|
+
const handleSelectReport = useCallback37(
|
|
12514
12837
|
(id) => {
|
|
12515
12838
|
router.navigate({ reportId: id });
|
|
12516
12839
|
},
|
|
12517
12840
|
[router]
|
|
12518
12841
|
);
|
|
12519
|
-
const handleTabChange =
|
|
12842
|
+
const handleTabChange = useCallback37(
|
|
12520
12843
|
(tab, subTab, focus) => {
|
|
12521
12844
|
if (!routerState.reportId) return;
|
|
12522
12845
|
const state = {
|
|
@@ -12529,20 +12852,20 @@ function DashboardContent() {
|
|
|
12529
12852
|
},
|
|
12530
12853
|
[router, routerState.reportId]
|
|
12531
12854
|
);
|
|
12532
|
-
const handleBack =
|
|
12855
|
+
const handleBack = useCallback37(() => {
|
|
12533
12856
|
router.navigate({});
|
|
12534
12857
|
}, [router]);
|
|
12535
|
-
const handleOpenHelp =
|
|
12858
|
+
const handleOpenHelp = useCallback37(() => {
|
|
12536
12859
|
openHelp(defaultTopic);
|
|
12537
12860
|
}, [openHelp, defaultTopic]);
|
|
12538
|
-
return /* @__PURE__ */
|
|
12539
|
-
/* @__PURE__ */
|
|
12540
|
-
/* @__PURE__ */
|
|
12541
|
-
/* @__PURE__ */
|
|
12542
|
-
/* @__PURE__ */
|
|
12861
|
+
return /* @__PURE__ */ jsx65(Container, { width: 4, children: /* @__PURE__ */ jsxs49(Stack39, { padding: 4, space: 4, children: [
|
|
12862
|
+
/* @__PURE__ */ jsxs49(Flex37, { align: "center", gap: 3, children: [
|
|
12863
|
+
/* @__PURE__ */ jsxs49(Stack39, { flex: 1, space: 1, children: [
|
|
12864
|
+
/* @__PURE__ */ jsx65(Text49, { size: 4, weight: "bold", children: "AI Literacy Framework" }),
|
|
12865
|
+
/* @__PURE__ */ jsx65(Text49, { muted: true, size: 2, children: "Evaluation reports and score trends" })
|
|
12543
12866
|
] }),
|
|
12544
|
-
/* @__PURE__ */
|
|
12545
|
-
|
|
12867
|
+
/* @__PURE__ */ jsx65(
|
|
12868
|
+
Button12,
|
|
12546
12869
|
{
|
|
12547
12870
|
icon: HelpCircleIcon8,
|
|
12548
12871
|
mode: "bleed",
|
|
@@ -12552,8 +12875,8 @@ function DashboardContent() {
|
|
|
12552
12875
|
}
|
|
12553
12876
|
)
|
|
12554
12877
|
] }),
|
|
12555
|
-
!isDetail && /* @__PURE__ */
|
|
12556
|
-
/* @__PURE__ */
|
|
12878
|
+
!isDetail && /* @__PURE__ */ jsxs49(TabList3, { space: 1, children: [
|
|
12879
|
+
/* @__PURE__ */ jsx65(
|
|
12557
12880
|
Tab3,
|
|
12558
12881
|
{
|
|
12559
12882
|
"aria-controls": "latest-panel",
|
|
@@ -12563,7 +12886,7 @@ function DashboardContent() {
|
|
|
12563
12886
|
selected: activeTab === "latest"
|
|
12564
12887
|
}
|
|
12565
12888
|
),
|
|
12566
|
-
/* @__PURE__ */
|
|
12889
|
+
/* @__PURE__ */ jsx65(
|
|
12567
12890
|
Tab3,
|
|
12568
12891
|
{
|
|
12569
12892
|
"aria-controls": "timeline-panel",
|
|
@@ -12573,7 +12896,7 @@ function DashboardContent() {
|
|
|
12573
12896
|
selected: activeTab === "timeline"
|
|
12574
12897
|
}
|
|
12575
12898
|
),
|
|
12576
|
-
/* @__PURE__ */
|
|
12899
|
+
/* @__PURE__ */ jsx65(
|
|
12577
12900
|
Tab3,
|
|
12578
12901
|
{
|
|
12579
12902
|
"aria-controls": "compare-panel",
|
|
@@ -12584,10 +12907,10 @@ function DashboardContent() {
|
|
|
12584
12907
|
}
|
|
12585
12908
|
)
|
|
12586
12909
|
] }),
|
|
12587
|
-
!isDetail && activeTab === "latest" && /* @__PURE__ */
|
|
12588
|
-
!isDetail && activeTab === "timeline" && /* @__PURE__ */
|
|
12589
|
-
!isDetail && activeTab === "compare" && /* @__PURE__ */
|
|
12590
|
-
isDetail && reportId && /* @__PURE__ */
|
|
12910
|
+
!isDetail && activeTab === "latest" && /* @__PURE__ */ jsx65(TabPanel3, { "aria-labelledby": "latest-tab", id: "latest-panel", children: /* @__PURE__ */ jsx65(LatestReports, { onSelectReport: handleSelectReport }) }),
|
|
12911
|
+
!isDetail && activeTab === "timeline" && /* @__PURE__ */ jsx65(TabPanel3, { "aria-labelledby": "timeline-tab", id: "timeline-panel", children: /* @__PURE__ */ jsx65(ScoreTimeline_default, {}) }),
|
|
12912
|
+
!isDetail && activeTab === "compare" && /* @__PURE__ */ jsx65(TabPanel3, { "aria-labelledby": "compare-tab", id: "compare-panel", children: /* @__PURE__ */ jsx65(ComparisonView, {}) }),
|
|
12913
|
+
isDetail && reportId && /* @__PURE__ */ jsx65(
|
|
12591
12914
|
ReportDetail,
|
|
12592
12915
|
{
|
|
12593
12916
|
activeTab: routerState.tab ?? null,
|
|
@@ -12623,7 +12946,7 @@ function ailfTool(options = {}) {
|
|
|
12623
12946
|
// src/actions/RunEvaluationAction.tsx
|
|
12624
12947
|
import { BarChartIcon as BarChartIcon2 } from "@sanity/icons";
|
|
12625
12948
|
import { useToast as useToast10 } from "@sanity/ui";
|
|
12626
|
-
import { useCallback as
|
|
12949
|
+
import { useCallback as useCallback38, useEffect as useEffect17, useRef as useRef9, useState as useState29 } from "react";
|
|
12627
12950
|
import {
|
|
12628
12951
|
getReleaseIdFromReleaseDocumentId as getReleaseIdFromReleaseDocumentId3,
|
|
12629
12952
|
useClient as useClient12,
|
|
@@ -12654,7 +12977,7 @@ function createRunEvaluationAction(options = {}) {
|
|
|
12654
12977
|
const projectId = useProjectId2();
|
|
12655
12978
|
const currentUser = useCurrentUser4();
|
|
12656
12979
|
const toast = useToast10();
|
|
12657
|
-
const [state, setState] =
|
|
12980
|
+
const [state, setState] = useState29({ status: "loading" });
|
|
12658
12981
|
const requestedAtRef = useRef9(null);
|
|
12659
12982
|
const perspectiveId = getReleaseIdFromReleaseDocumentId3(release._id);
|
|
12660
12983
|
useEffect17(() => {
|
|
@@ -12750,7 +13073,7 @@ function createRunEvaluationAction(options = {}) {
|
|
|
12750
13073
|
}, 15e3);
|
|
12751
13074
|
return () => clearTimeout(timer);
|
|
12752
13075
|
}, [client, perspectiveId, state]);
|
|
12753
|
-
const handleRequest =
|
|
13076
|
+
const handleRequest = useCallback38(async () => {
|
|
12754
13077
|
const releaseTitle = release.metadata?.title ?? perspectiveId ?? "release";
|
|
12755
13078
|
const tag = `release-${slugify3(releaseTitle)}-${dateStamp3()}`;
|
|
12756
13079
|
const now = Date.now();
|