@sanity/ailf-studio 0.1.16 → 0.1.17
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 +4 -0
- package/dist/index.js +496 -333
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -486,6 +486,14 @@ var evalRequestSchema = defineType({
|
|
|
486
486
|
title: "Report ID",
|
|
487
487
|
type: "string"
|
|
488
488
|
}),
|
|
489
|
+
defineField({
|
|
490
|
+
description: "The report ID this request was re-run from (lineage tracking)",
|
|
491
|
+
group: ["optional", "all-fields"],
|
|
492
|
+
name: "sourceReportId",
|
|
493
|
+
readOnly: true,
|
|
494
|
+
title: "Source Report ID",
|
|
495
|
+
type: "string"
|
|
496
|
+
}),
|
|
489
497
|
defineField({
|
|
490
498
|
description: "ISO timestamp of when the request was created",
|
|
491
499
|
group: ["main", "all-fields"],
|
|
@@ -891,6 +899,25 @@ var reportSchema = defineType4({
|
|
|
891
899
|
name: "git",
|
|
892
900
|
title: "Git Metadata",
|
|
893
901
|
type: "object"
|
|
902
|
+
}),
|
|
903
|
+
defineField4({
|
|
904
|
+
fields: [
|
|
905
|
+
defineField4({
|
|
906
|
+
description: "Report ID this report was re-run from",
|
|
907
|
+
name: "rerunOf",
|
|
908
|
+
title: "Re-run Of",
|
|
909
|
+
type: "string"
|
|
910
|
+
}),
|
|
911
|
+
defineField4({
|
|
912
|
+
description: "Report ID this report was explicitly compared against",
|
|
913
|
+
name: "comparedAgainst",
|
|
914
|
+
title: "Compared Against",
|
|
915
|
+
type: "string"
|
|
916
|
+
})
|
|
917
|
+
],
|
|
918
|
+
name: "lineage",
|
|
919
|
+
title: "Lineage",
|
|
920
|
+
type: "object"
|
|
894
921
|
})
|
|
895
922
|
],
|
|
896
923
|
group: ["main", "all-fields"],
|
|
@@ -2780,17 +2807,17 @@ import { route } from "sanity/router";
|
|
|
2780
2807
|
// src/components/Dashboard.tsx
|
|
2781
2808
|
import {
|
|
2782
2809
|
Container,
|
|
2783
|
-
Flex as
|
|
2810
|
+
Flex as Flex29,
|
|
2784
2811
|
Select as Select3,
|
|
2785
|
-
Stack as
|
|
2812
|
+
Stack as Stack27,
|
|
2786
2813
|
Tab as Tab2,
|
|
2787
2814
|
TabList as TabList2,
|
|
2788
2815
|
TabPanel as TabPanel2,
|
|
2789
|
-
Text as
|
|
2816
|
+
Text as Text36
|
|
2790
2817
|
} from "@sanity/ui";
|
|
2791
|
-
import { useCallback as
|
|
2792
|
-
import { useClient as
|
|
2793
|
-
import { useRouter } from "sanity/router";
|
|
2818
|
+
import { useCallback as useCallback22, useEffect as useEffect11, useState as useState17 } from "react";
|
|
2819
|
+
import { useClient as useClient14 } from "sanity";
|
|
2820
|
+
import { useRouter as useRouter2 } from "sanity/router";
|
|
2794
2821
|
|
|
2795
2822
|
// src/queries.ts
|
|
2796
2823
|
var REPORT_TYPE = "ailf.report";
|
|
@@ -4768,20 +4795,20 @@ import { ArrowLeftIcon as ArrowLeftIcon2 } from "@sanity/icons";
|
|
|
4768
4795
|
import {
|
|
4769
4796
|
Box as Box15,
|
|
4770
4797
|
Button as Button5,
|
|
4771
|
-
Stack as
|
|
4798
|
+
Stack as Stack25,
|
|
4772
4799
|
Tab,
|
|
4773
4800
|
TabList,
|
|
4774
4801
|
TabPanel,
|
|
4775
|
-
Text as
|
|
4802
|
+
Text as Text34,
|
|
4776
4803
|
Tooltip as Tooltip8
|
|
4777
4804
|
} from "@sanity/ui";
|
|
4778
4805
|
import {
|
|
4779
|
-
useCallback as
|
|
4780
|
-
useEffect as
|
|
4806
|
+
useCallback as useCallback20,
|
|
4807
|
+
useEffect as useEffect9,
|
|
4781
4808
|
useMemo as useMemo7,
|
|
4782
|
-
useState as
|
|
4809
|
+
useState as useState15
|
|
4783
4810
|
} from "react";
|
|
4784
|
-
import { useClient as
|
|
4811
|
+
import { useClient as useClient12 } from "sanity";
|
|
4785
4812
|
|
|
4786
4813
|
// src/components/report-detail/AgentActivitySection.tsx
|
|
4787
4814
|
import { useMemo as useMemo6, useState as useState8 } from "react";
|
|
@@ -5316,17 +5343,150 @@ function AreaBadgeGroup({
|
|
|
5316
5343
|
] });
|
|
5317
5344
|
}
|
|
5318
5345
|
|
|
5346
|
+
// src/components/report-detail/LineageCard.tsx
|
|
5347
|
+
import { LinkIcon as LinkIcon2 } from "@sanity/icons";
|
|
5348
|
+
import { Badge as Badge18, Card as Card18, Flex as Flex20, Stack as Stack18, Text as Text27 } from "@sanity/ui";
|
|
5349
|
+
import { useCallback as useCallback13, useEffect as useEffect8, useState as useState9 } from "react";
|
|
5350
|
+
import { useClient as useClient7 } from "sanity";
|
|
5351
|
+
import { useRouter } from "sanity/router";
|
|
5352
|
+
import { jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
5353
|
+
var REPORT_TYPE2 = "ailf.report";
|
|
5354
|
+
var SPAWNED_REPORTS_QUERY = (
|
|
5355
|
+
/* groq */
|
|
5356
|
+
`
|
|
5357
|
+
*[_type == $type && provenance.lineage.rerunOf == $reportId] | order(completedAt desc) {
|
|
5358
|
+
reportId,
|
|
5359
|
+
completedAt,
|
|
5360
|
+
tag
|
|
5361
|
+
}
|
|
5362
|
+
`
|
|
5363
|
+
);
|
|
5364
|
+
function LineageCard({ provenance, reportId }) {
|
|
5365
|
+
const { lineage } = provenance;
|
|
5366
|
+
const router = useRouter();
|
|
5367
|
+
const client = useClient7({ apiVersion: API_VERSION });
|
|
5368
|
+
const [spawned, setSpawned] = useState9([]);
|
|
5369
|
+
useEffect8(() => {
|
|
5370
|
+
let cancelled = false;
|
|
5371
|
+
client.fetch(SPAWNED_REPORTS_QUERY, {
|
|
5372
|
+
reportId,
|
|
5373
|
+
type: REPORT_TYPE2
|
|
5374
|
+
}).then((data) => {
|
|
5375
|
+
if (!cancelled) setSpawned(data ?? []);
|
|
5376
|
+
}).catch(() => {
|
|
5377
|
+
});
|
|
5378
|
+
return () => {
|
|
5379
|
+
cancelled = true;
|
|
5380
|
+
};
|
|
5381
|
+
}, [client, reportId]);
|
|
5382
|
+
const hasLineage = lineage?.rerunOf || lineage?.comparedAgainst;
|
|
5383
|
+
if (!hasLineage && spawned.length === 0) return null;
|
|
5384
|
+
return /* @__PURE__ */ jsx32(Card18, { padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs26(Stack18, { space: 4, children: [
|
|
5385
|
+
/* @__PURE__ */ jsx32(Flex20, { align: "center", gap: 2, children: /* @__PURE__ */ jsxs26(Text27, { size: 3, weight: "semibold", children: [
|
|
5386
|
+
/* @__PURE__ */ jsx32(LinkIcon2, {}),
|
|
5387
|
+
" Lineage"
|
|
5388
|
+
] }) }),
|
|
5389
|
+
lineage?.rerunOf && /* @__PURE__ */ jsx32(
|
|
5390
|
+
LineageLink,
|
|
5391
|
+
{
|
|
5392
|
+
label: "Re-run of",
|
|
5393
|
+
reportId: lineage.rerunOf,
|
|
5394
|
+
router
|
|
5395
|
+
}
|
|
5396
|
+
),
|
|
5397
|
+
lineage?.comparedAgainst && /* @__PURE__ */ jsx32(
|
|
5398
|
+
LineageLink,
|
|
5399
|
+
{
|
|
5400
|
+
label: "Compared against",
|
|
5401
|
+
reportId: lineage.comparedAgainst,
|
|
5402
|
+
router
|
|
5403
|
+
}
|
|
5404
|
+
),
|
|
5405
|
+
spawned.length > 0 && /* @__PURE__ */ jsxs26(Stack18, { space: 2, children: [
|
|
5406
|
+
/* @__PURE__ */ jsx32(Text27, { muted: true, size: 1, weight: "semibold", children: "SPAWNED RE-RUNS" }),
|
|
5407
|
+
spawned.map((s) => /* @__PURE__ */ jsx32(SpawnedReportRow, { report: s, router }, s.reportId))
|
|
5408
|
+
] })
|
|
5409
|
+
] }) });
|
|
5410
|
+
}
|
|
5411
|
+
function LineageLink({
|
|
5412
|
+
label,
|
|
5413
|
+
reportId,
|
|
5414
|
+
router
|
|
5415
|
+
}) {
|
|
5416
|
+
const handleClick = useCallback13(() => {
|
|
5417
|
+
router.navigate({ reportId });
|
|
5418
|
+
}, [reportId, router]);
|
|
5419
|
+
return /* @__PURE__ */ jsxs26(Flex20, { align: "center", gap: 2, children: [
|
|
5420
|
+
/* @__PURE__ */ jsxs26(Text27, { muted: true, size: 2, weight: "semibold", children: [
|
|
5421
|
+
label,
|
|
5422
|
+
":"
|
|
5423
|
+
] }),
|
|
5424
|
+
/* @__PURE__ */ jsx32(Text27, { size: 2, children: /* @__PURE__ */ jsxs26(
|
|
5425
|
+
"a",
|
|
5426
|
+
{
|
|
5427
|
+
href: "#",
|
|
5428
|
+
onClick: (e) => {
|
|
5429
|
+
e.preventDefault();
|
|
5430
|
+
handleClick();
|
|
5431
|
+
},
|
|
5432
|
+
style: { cursor: "pointer" },
|
|
5433
|
+
children: [
|
|
5434
|
+
reportId.slice(0, 12),
|
|
5435
|
+
"\u2026"
|
|
5436
|
+
]
|
|
5437
|
+
}
|
|
5438
|
+
) })
|
|
5439
|
+
] });
|
|
5440
|
+
}
|
|
5441
|
+
function SpawnedReportRow({
|
|
5442
|
+
report,
|
|
5443
|
+
router
|
|
5444
|
+
}) {
|
|
5445
|
+
const handleClick = useCallback13(() => {
|
|
5446
|
+
router.navigate({ reportId: report.reportId });
|
|
5447
|
+
}, [report.reportId, router]);
|
|
5448
|
+
const dateLabel = formatShortDate(report.completedAt);
|
|
5449
|
+
const label = report.tag ?? dateLabel;
|
|
5450
|
+
return /* @__PURE__ */ jsxs26(Flex20, { align: "center", gap: 2, children: [
|
|
5451
|
+
/* @__PURE__ */ jsx32(Text27, { size: 2, children: /* @__PURE__ */ jsx32(
|
|
5452
|
+
"a",
|
|
5453
|
+
{
|
|
5454
|
+
href: "#",
|
|
5455
|
+
onClick: (e) => {
|
|
5456
|
+
e.preventDefault();
|
|
5457
|
+
handleClick();
|
|
5458
|
+
},
|
|
5459
|
+
style: { cursor: "pointer" },
|
|
5460
|
+
children: label
|
|
5461
|
+
}
|
|
5462
|
+
) }),
|
|
5463
|
+
report.tag && /* @__PURE__ */ jsx32(Text27, { muted: true, size: 1, children: dateLabel }),
|
|
5464
|
+
/* @__PURE__ */ jsx32(Badge18, { fontSize: 1, mode: "outline", tone: "default", children: report.reportId.slice(0, 8) })
|
|
5465
|
+
] });
|
|
5466
|
+
}
|
|
5467
|
+
function formatShortDate(iso) {
|
|
5468
|
+
try {
|
|
5469
|
+
return new Date(iso).toLocaleDateString("en-US", {
|
|
5470
|
+
day: "numeric",
|
|
5471
|
+
month: "short",
|
|
5472
|
+
year: "numeric"
|
|
5473
|
+
});
|
|
5474
|
+
} catch {
|
|
5475
|
+
return iso;
|
|
5476
|
+
}
|
|
5477
|
+
}
|
|
5478
|
+
|
|
5319
5479
|
// src/components/report-detail/JudgmentList.tsx
|
|
5320
|
-
import { useState as
|
|
5480
|
+
import { useState as useState10 } from "react";
|
|
5321
5481
|
import { HelpCircleIcon as HelpCircleIcon6 } from "@sanity/icons";
|
|
5322
|
-
import { Badge as
|
|
5482
|
+
import { Badge as Badge19, Box as Box12, Card as Card19, Flex as Flex21, Stack as Stack19, Text as Text28, Tooltip as Tooltip6 } from "@sanity/ui";
|
|
5323
5483
|
|
|
5324
5484
|
// src/components/primitives/InlineCode.tsx
|
|
5325
|
-
import { Fragment as Fragment5, jsx as
|
|
5485
|
+
import { Fragment as Fragment5, jsx as jsx33 } from "react/jsx-runtime";
|
|
5326
5486
|
function InlineCode({ text }) {
|
|
5327
5487
|
const parts = text.split(/`([^`]+)`/);
|
|
5328
|
-
return /* @__PURE__ */
|
|
5329
|
-
(part, i) => i % 2 === 1 ? /* @__PURE__ */
|
|
5488
|
+
return /* @__PURE__ */ jsx33(Fragment5, { children: parts.map(
|
|
5489
|
+
(part, i) => i % 2 === 1 ? /* @__PURE__ */ jsx33(
|
|
5330
5490
|
"code",
|
|
5331
5491
|
{
|
|
5332
5492
|
style: {
|
|
@@ -5338,12 +5498,12 @@ function InlineCode({ text }) {
|
|
|
5338
5498
|
children: part
|
|
5339
5499
|
},
|
|
5340
5500
|
i
|
|
5341
|
-
) : /* @__PURE__ */
|
|
5501
|
+
) : /* @__PURE__ */ jsx33("span", { children: part }, i)
|
|
5342
5502
|
) });
|
|
5343
5503
|
}
|
|
5344
5504
|
|
|
5345
5505
|
// src/components/report-detail/JudgmentList.tsx
|
|
5346
|
-
import { jsx as
|
|
5506
|
+
import { jsx as jsx34, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5347
5507
|
function groupByArea(judgments) {
|
|
5348
5508
|
const byArea = /* @__PURE__ */ new Map();
|
|
5349
5509
|
for (const j of judgments) {
|
|
@@ -5358,56 +5518,56 @@ var DIMENSION_LABELS = DIMENSION_LABELS_KEBAB;
|
|
|
5358
5518
|
function JudgmentList({ judgments }) {
|
|
5359
5519
|
if (judgments.length === 0) return null;
|
|
5360
5520
|
const grouped = groupByArea(judgments);
|
|
5361
|
-
return /* @__PURE__ */
|
|
5362
|
-
/* @__PURE__ */
|
|
5363
|
-
/* @__PURE__ */
|
|
5364
|
-
/* @__PURE__ */
|
|
5521
|
+
return /* @__PURE__ */ jsx34(Card19, { padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs27(Stack19, { space: 4, children: [
|
|
5522
|
+
/* @__PURE__ */ jsxs27(Flex21, { align: "center", gap: 3, wrap: "wrap", children: [
|
|
5523
|
+
/* @__PURE__ */ jsx34(Text28, { size: 3, weight: "semibold", children: "Low-Scoring Judgments" }),
|
|
5524
|
+
/* @__PURE__ */ jsx34(
|
|
5365
5525
|
Tooltip6,
|
|
5366
5526
|
{
|
|
5367
|
-
content: /* @__PURE__ */
|
|
5527
|
+
content: /* @__PURE__ */ jsx34(Box12, { padding: 2, style: { maxWidth: 260 }, children: /* @__PURE__ */ jsx34(Text28, { size: 2, children: GLOSSARY.lowScoringJudgments }) }),
|
|
5368
5528
|
placement: "bottom",
|
|
5369
5529
|
portal: true,
|
|
5370
|
-
children: /* @__PURE__ */
|
|
5530
|
+
children: /* @__PURE__ */ jsx34(Text28, { muted: true, size: 1, children: /* @__PURE__ */ jsx34(HelpCircleIcon6, {}) })
|
|
5371
5531
|
}
|
|
5372
5532
|
),
|
|
5373
|
-
/* @__PURE__ */
|
|
5533
|
+
/* @__PURE__ */ jsx34(Card19, { padding: 2, radius: 2, tone: "critical", children: /* @__PURE__ */ jsxs27(Text28, { size: 2, weight: "bold", children: [
|
|
5374
5534
|
judgments.length,
|
|
5375
5535
|
" judgment",
|
|
5376
5536
|
judgments.length === 1 ? "" : "s",
|
|
5377
5537
|
" below 70"
|
|
5378
5538
|
] }) })
|
|
5379
5539
|
] }),
|
|
5380
|
-
grouped.map(([area, areaJudgments]) => /* @__PURE__ */
|
|
5381
|
-
/* @__PURE__ */
|
|
5540
|
+
grouped.map(([area, areaJudgments]) => /* @__PURE__ */ jsx34(Card19, { padding: 3, radius: 2, tone: "transparent", children: /* @__PURE__ */ jsxs27(Stack19, { space: 3, children: [
|
|
5541
|
+
/* @__PURE__ */ jsxs27(Text28, { size: 2, weight: "semibold", children: [
|
|
5382
5542
|
area,
|
|
5383
5543
|
" ",
|
|
5384
|
-
/* @__PURE__ */
|
|
5544
|
+
/* @__PURE__ */ jsxs27(Text28, { muted: true, size: 2, weight: "regular", as: "span", children: [
|
|
5385
5545
|
"(",
|
|
5386
5546
|
areaJudgments.length,
|
|
5387
5547
|
")"
|
|
5388
5548
|
] })
|
|
5389
5549
|
] }),
|
|
5390
|
-
areaJudgments.map((j, i) => /* @__PURE__ */
|
|
5550
|
+
areaJudgments.map((j, i) => /* @__PURE__ */ jsx34(JudgmentCard, { judgment: j }, `${area}-${i}`))
|
|
5391
5551
|
] }) }, area))
|
|
5392
5552
|
] }) });
|
|
5393
5553
|
}
|
|
5394
5554
|
function JudgmentCard({ judgment }) {
|
|
5395
|
-
const [expanded, setExpanded] =
|
|
5555
|
+
const [expanded, setExpanded] = useState10(false);
|
|
5396
5556
|
const dimLabel = DIMENSION_LABELS[judgment.dimension] ?? judgment.dimension;
|
|
5397
5557
|
const sep = judgment.taskId.indexOf(" - ");
|
|
5398
5558
|
const taskName = sep > 0 ? judgment.taskId.substring(sep + 3) : judgment.taskId;
|
|
5399
|
-
return /* @__PURE__ */
|
|
5400
|
-
|
|
5559
|
+
return /* @__PURE__ */ jsx34(
|
|
5560
|
+
Card19,
|
|
5401
5561
|
{
|
|
5402
5562
|
padding: 3,
|
|
5403
5563
|
radius: 2,
|
|
5404
5564
|
shadow: 1,
|
|
5405
5565
|
style: { cursor: "pointer" },
|
|
5406
5566
|
onClick: () => setExpanded(!expanded),
|
|
5407
|
-
children: /* @__PURE__ */
|
|
5408
|
-
/* @__PURE__ */
|
|
5409
|
-
/* @__PURE__ */
|
|
5410
|
-
|
|
5567
|
+
children: /* @__PURE__ */ jsxs27(Stack19, { space: 3, children: [
|
|
5568
|
+
/* @__PURE__ */ jsxs27(Flex21, { align: "center", gap: 2, wrap: "wrap", children: [
|
|
5569
|
+
/* @__PURE__ */ jsx34(Card19, { padding: 2, radius: 2, tone: scoreTone(judgment.score), children: /* @__PURE__ */ jsx34(
|
|
5570
|
+
Text28,
|
|
5411
5571
|
{
|
|
5412
5572
|
align: "center",
|
|
5413
5573
|
size: 2,
|
|
@@ -5416,24 +5576,24 @@ function JudgmentCard({ judgment }) {
|
|
|
5416
5576
|
children: judgment.score
|
|
5417
5577
|
}
|
|
5418
5578
|
) }),
|
|
5419
|
-
/* @__PURE__ */
|
|
5420
|
-
/* @__PURE__ */
|
|
5421
|
-
/* @__PURE__ */
|
|
5422
|
-
/* @__PURE__ */
|
|
5579
|
+
/* @__PURE__ */ jsx34(Badge19, { tone: "default", children: dimLabel }),
|
|
5580
|
+
/* @__PURE__ */ jsx34(Text28, { size: 2, weight: "medium", children: taskName }),
|
|
5581
|
+
/* @__PURE__ */ jsx34(Text28, { muted: true, size: 1, children: judgment.modelId }),
|
|
5582
|
+
/* @__PURE__ */ jsx34(Text28, { muted: true, size: 1, style: { marginLeft: "auto" }, children: expanded ? "\u25B2" : "\u25BC" })
|
|
5423
5583
|
] }),
|
|
5424
|
-
expanded && /* @__PURE__ */
|
|
5425
|
-
/* @__PURE__ */
|
|
5426
|
-
|
|
5584
|
+
expanded && /* @__PURE__ */ jsxs27(Stack19, { space: 3, children: [
|
|
5585
|
+
/* @__PURE__ */ jsx34(Card19, { padding: 3, radius: 2, tone: "transparent", children: /* @__PURE__ */ jsx34(
|
|
5586
|
+
Text28,
|
|
5427
5587
|
{
|
|
5428
5588
|
muted: true,
|
|
5429
5589
|
size: 2,
|
|
5430
5590
|
style: { lineHeight: 1.6, whiteSpace: "pre-wrap" },
|
|
5431
|
-
children: /* @__PURE__ */
|
|
5591
|
+
children: /* @__PURE__ */ jsx34(InlineCode, { text: judgment.reason })
|
|
5432
5592
|
}
|
|
5433
5593
|
) }),
|
|
5434
|
-
judgment.canonicalDocs && judgment.canonicalDocs.length > 0 && /* @__PURE__ */
|
|
5435
|
-
/* @__PURE__ */
|
|
5436
|
-
judgment.canonicalDocs.map((doc) => /* @__PURE__ */
|
|
5594
|
+
judgment.canonicalDocs && judgment.canonicalDocs.length > 0 && /* @__PURE__ */ jsxs27(Flex21, { align: "center", gap: 2, wrap: "wrap", children: [
|
|
5595
|
+
/* @__PURE__ */ jsx34(Text28, { muted: true, size: 1, children: "Docs:" }),
|
|
5596
|
+
judgment.canonicalDocs.map((doc) => /* @__PURE__ */ jsx34(DocBadge, { doc }, doc.slug))
|
|
5437
5597
|
] })
|
|
5438
5598
|
] })
|
|
5439
5599
|
] })
|
|
@@ -5449,17 +5609,17 @@ var editLinkStyle = {
|
|
|
5449
5609
|
function DocBadge({
|
|
5450
5610
|
doc
|
|
5451
5611
|
}) {
|
|
5452
|
-
const [hovered, setHovered] =
|
|
5612
|
+
const [hovered, setHovered] = useState10(false);
|
|
5453
5613
|
const isLinked = Boolean(doc.documentId);
|
|
5454
5614
|
const tooltipLabel = isLinked ? `Edit "${doc.title || doc.slug}"` : doc.title || doc.slug;
|
|
5455
|
-
const badge = /* @__PURE__ */
|
|
5456
|
-
return /* @__PURE__ */
|
|
5615
|
+
const badge = /* @__PURE__ */ jsx34(Badge19, { mode: "outline", tone: isLinked && hovered ? "caution" : "primary", children: doc.slug });
|
|
5616
|
+
return /* @__PURE__ */ jsx34(
|
|
5457
5617
|
Tooltip6,
|
|
5458
5618
|
{
|
|
5459
|
-
content: /* @__PURE__ */
|
|
5619
|
+
content: /* @__PURE__ */ jsx34(Box12, { padding: 2, children: /* @__PURE__ */ jsx34(Text28, { size: 2, children: tooltipLabel }) }),
|
|
5460
5620
|
placement: "bottom",
|
|
5461
5621
|
portal: true,
|
|
5462
|
-
children: isLinked ? /* @__PURE__ */
|
|
5622
|
+
children: isLinked ? /* @__PURE__ */ jsx34(
|
|
5463
5623
|
"a",
|
|
5464
5624
|
{
|
|
5465
5625
|
href: `/intent/edit/id=${doc.documentId}`,
|
|
@@ -5472,14 +5632,14 @@ function DocBadge({
|
|
|
5472
5632
|
},
|
|
5473
5633
|
children: badge
|
|
5474
5634
|
}
|
|
5475
|
-
) : /* @__PURE__ */
|
|
5635
|
+
) : /* @__PURE__ */ jsx34("span", { children: badge })
|
|
5476
5636
|
}
|
|
5477
5637
|
);
|
|
5478
5638
|
}
|
|
5479
5639
|
|
|
5480
5640
|
// src/components/report-detail/OverviewStats.tsx
|
|
5481
5641
|
import { Grid as Grid4 } from "@sanity/ui";
|
|
5482
|
-
import { jsx as
|
|
5642
|
+
import { jsx as jsx35, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
5483
5643
|
function OverviewStats({
|
|
5484
5644
|
overall,
|
|
5485
5645
|
durationMs,
|
|
@@ -5487,8 +5647,8 @@ function OverviewStats({
|
|
|
5487
5647
|
isFullMode
|
|
5488
5648
|
}) {
|
|
5489
5649
|
const overallTone = scoreTone(overall.avgScore);
|
|
5490
|
-
return /* @__PURE__ */
|
|
5491
|
-
/* @__PURE__ */
|
|
5650
|
+
return /* @__PURE__ */ jsxs28(Grid4, { columns: [1, 1, 2, isFullMode ? 4 : 4], gap: 3, children: [
|
|
5651
|
+
/* @__PURE__ */ jsx35(
|
|
5492
5652
|
StatCard,
|
|
5493
5653
|
{
|
|
5494
5654
|
label: "Overall Score",
|
|
@@ -5497,7 +5657,7 @@ function OverviewStats({
|
|
|
5497
5657
|
value: overall.avgScore.toFixed(1)
|
|
5498
5658
|
}
|
|
5499
5659
|
),
|
|
5500
|
-
/* @__PURE__ */
|
|
5660
|
+
/* @__PURE__ */ jsx35(
|
|
5501
5661
|
StatCard,
|
|
5502
5662
|
{
|
|
5503
5663
|
label: "Doc Lift",
|
|
@@ -5506,7 +5666,7 @@ function OverviewStats({
|
|
|
5506
5666
|
value: overall.avgDocLift.toFixed(1)
|
|
5507
5667
|
}
|
|
5508
5668
|
),
|
|
5509
|
-
isFullMode && overall.avgActualScore != null && /* @__PURE__ */
|
|
5669
|
+
isFullMode && overall.avgActualScore != null && /* @__PURE__ */ jsx35(
|
|
5510
5670
|
StatCard,
|
|
5511
5671
|
{
|
|
5512
5672
|
label: "Actual Score",
|
|
@@ -5515,7 +5675,7 @@ function OverviewStats({
|
|
|
5515
5675
|
value: overall.avgActualScore.toFixed(1)
|
|
5516
5676
|
}
|
|
5517
5677
|
),
|
|
5518
|
-
isFullMode && overall.avgRetrievalGap != null && /* @__PURE__ */
|
|
5678
|
+
isFullMode && overall.avgRetrievalGap != null && /* @__PURE__ */ jsx35(
|
|
5519
5679
|
StatCard,
|
|
5520
5680
|
{
|
|
5521
5681
|
label: "Retrieval Gap",
|
|
@@ -5525,7 +5685,7 @@ function OverviewStats({
|
|
|
5525
5685
|
value: overall.avgRetrievalGap.toFixed(1)
|
|
5526
5686
|
}
|
|
5527
5687
|
),
|
|
5528
|
-
isFullMode && overall.avgInfrastructureEfficiency != null && /* @__PURE__ */
|
|
5688
|
+
isFullMode && overall.avgInfrastructureEfficiency != null && /* @__PURE__ */ jsx35(
|
|
5529
5689
|
StatCard,
|
|
5530
5690
|
{
|
|
5531
5691
|
label: "Infra Efficiency",
|
|
@@ -5533,8 +5693,8 @@ function OverviewStats({
|
|
|
5533
5693
|
value: formatPercent(overall.avgInfrastructureEfficiency)
|
|
5534
5694
|
}
|
|
5535
5695
|
),
|
|
5536
|
-
/* @__PURE__ */
|
|
5537
|
-
/* @__PURE__ */
|
|
5696
|
+
/* @__PURE__ */ jsx35(StatCard, { label: "Duration", value: formatDuration(durationMs) }),
|
|
5697
|
+
/* @__PURE__ */ jsx35(
|
|
5538
5698
|
StatCard,
|
|
5539
5699
|
{
|
|
5540
5700
|
label: "Tests",
|
|
@@ -5546,31 +5706,31 @@ function OverviewStats({
|
|
|
5546
5706
|
}
|
|
5547
5707
|
|
|
5548
5708
|
// src/components/report-detail/ProvenanceCard.tsx
|
|
5549
|
-
import { Card as
|
|
5550
|
-
import { jsx as
|
|
5709
|
+
import { Card as Card20, Flex as Flex22, Grid as Grid5, Stack as Stack20, Text as Text29 } from "@sanity/ui";
|
|
5710
|
+
import { jsx as jsx36, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5551
5711
|
var VIEWABLE_PROMPTFOO_MODES = /* @__PURE__ */ new Set(["agentic", "observed"]);
|
|
5552
5712
|
function ProvenanceCard({ provenance }) {
|
|
5553
|
-
return /* @__PURE__ */
|
|
5554
|
-
/* @__PURE__ */
|
|
5555
|
-
/* @__PURE__ */
|
|
5556
|
-
/* @__PURE__ */
|
|
5557
|
-
/* @__PURE__ */
|
|
5558
|
-
/* @__PURE__ */
|
|
5713
|
+
return /* @__PURE__ */ jsx36(Card20, { padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs29(Stack20, { space: 4, children: [
|
|
5714
|
+
/* @__PURE__ */ jsx36(Text29, { size: 3, weight: "semibold", children: "Provenance" }),
|
|
5715
|
+
/* @__PURE__ */ jsxs29(Grid5, { columns: [1, 2, 3], gap: 4, children: [
|
|
5716
|
+
/* @__PURE__ */ jsx36(Field, { label: "Mode", value: provenance.mode }),
|
|
5717
|
+
/* @__PURE__ */ jsx36(Field, { label: "Source", value: provenance.source.name }),
|
|
5718
|
+
/* @__PURE__ */ jsx36(
|
|
5559
5719
|
Field,
|
|
5560
5720
|
{
|
|
5561
5721
|
label: "Trigger",
|
|
5562
5722
|
value: provenance.trigger.type + (provenance.trigger.workflow ? ` (${provenance.trigger.workflow})` : "")
|
|
5563
5723
|
}
|
|
5564
5724
|
),
|
|
5565
|
-
/* @__PURE__ */
|
|
5725
|
+
/* @__PURE__ */ jsx36(
|
|
5566
5726
|
Field,
|
|
5567
5727
|
{
|
|
5568
5728
|
label: "Models",
|
|
5569
5729
|
value: provenance.models.map((m) => m.label).join(", ")
|
|
5570
5730
|
}
|
|
5571
5731
|
),
|
|
5572
|
-
/* @__PURE__ */
|
|
5573
|
-
provenance.contextHash && /* @__PURE__ */
|
|
5732
|
+
/* @__PURE__ */ jsx36(Field, { label: "Grader Model", mono: true, value: provenance.graderModel }),
|
|
5733
|
+
provenance.contextHash && /* @__PURE__ */ jsx36(
|
|
5574
5734
|
Field,
|
|
5575
5735
|
{
|
|
5576
5736
|
label: "Context Hash",
|
|
@@ -5579,8 +5739,8 @@ function ProvenanceCard({ provenance }) {
|
|
|
5579
5739
|
}
|
|
5580
5740
|
)
|
|
5581
5741
|
] }),
|
|
5582
|
-
provenance.git && /* @__PURE__ */
|
|
5583
|
-
/* @__PURE__ */
|
|
5742
|
+
provenance.git && /* @__PURE__ */ jsx36(GitInfo, { git: provenance.git }),
|
|
5743
|
+
/* @__PURE__ */ jsx36(PromptfooLinks, { provenance })
|
|
5584
5744
|
] }) });
|
|
5585
5745
|
}
|
|
5586
5746
|
function Field({
|
|
@@ -5588,9 +5748,9 @@ function Field({
|
|
|
5588
5748
|
mono,
|
|
5589
5749
|
value
|
|
5590
5750
|
}) {
|
|
5591
|
-
return /* @__PURE__ */
|
|
5592
|
-
/* @__PURE__ */
|
|
5593
|
-
|
|
5751
|
+
return /* @__PURE__ */ jsxs29(Stack20, { space: 1, children: [
|
|
5752
|
+
/* @__PURE__ */ jsx36(
|
|
5753
|
+
Text29,
|
|
5594
5754
|
{
|
|
5595
5755
|
muted: true,
|
|
5596
5756
|
size: 1,
|
|
@@ -5599,7 +5759,7 @@ function Field({
|
|
|
5599
5759
|
children: label
|
|
5600
5760
|
}
|
|
5601
5761
|
),
|
|
5602
|
-
/* @__PURE__ */
|
|
5762
|
+
/* @__PURE__ */ jsx36(Text29, { size: 2, style: mono ? { fontFamily: "monospace" } : void 0, children: value })
|
|
5603
5763
|
] });
|
|
5604
5764
|
}
|
|
5605
5765
|
function GitInfo({ git }) {
|
|
@@ -5607,15 +5767,15 @@ function GitInfo({ git }) {
|
|
|
5607
5767
|
const branchUrl = `${repoUrl}/tree/${git.branch}`;
|
|
5608
5768
|
const commitUrl = `${repoUrl}/commit/${git.sha}`;
|
|
5609
5769
|
const prUrl = git.prNumber ? `${repoUrl}/pull/${git.prNumber}` : null;
|
|
5610
|
-
return /* @__PURE__ */
|
|
5611
|
-
/* @__PURE__ */
|
|
5612
|
-
/* @__PURE__ */
|
|
5613
|
-
/* @__PURE__ */
|
|
5770
|
+
return /* @__PURE__ */ jsx36(Card20, { border: true, padding: 3, radius: 2, tone: "transparent", children: /* @__PURE__ */ jsxs29(Flex22, { align: "center", gap: 3, wrap: "wrap", children: [
|
|
5771
|
+
/* @__PURE__ */ jsx36(Text29, { muted: true, size: 2, weight: "semibold", children: "Git" }),
|
|
5772
|
+
/* @__PURE__ */ jsxs29(Text29, { size: 2, children: [
|
|
5773
|
+
/* @__PURE__ */ jsx36("a", { href: repoUrl, rel: "noopener noreferrer", target: "_blank", children: git.repo }),
|
|
5614
5774
|
" / ",
|
|
5615
|
-
/* @__PURE__ */
|
|
5775
|
+
/* @__PURE__ */ jsx36("a", { href: branchUrl, rel: "noopener noreferrer", target: "_blank", children: git.branch })
|
|
5616
5776
|
] }),
|
|
5617
|
-
/* @__PURE__ */
|
|
5618
|
-
prUrl && /* @__PURE__ */
|
|
5777
|
+
/* @__PURE__ */ jsx36(Text29, { muted: true, size: 2, style: { fontFamily: "monospace" }, children: /* @__PURE__ */ jsx36("a", { href: commitUrl, rel: "noopener noreferrer", target: "_blank", children: git.sha.slice(0, 12) }) }),
|
|
5778
|
+
prUrl && /* @__PURE__ */ jsx36(Text29, { size: 2, children: /* @__PURE__ */ jsxs29("a", { href: prUrl, rel: "noopener noreferrer", target: "_blank", children: [
|
|
5619
5779
|
"PR #",
|
|
5620
5780
|
git.prNumber,
|
|
5621
5781
|
" \u2192"
|
|
@@ -5630,14 +5790,14 @@ function PromptfooLinks({
|
|
|
5630
5790
|
(e) => VIEWABLE_PROMPTFOO_MODES.has(e.mode)
|
|
5631
5791
|
);
|
|
5632
5792
|
if (viewable.length === 0) return null;
|
|
5633
|
-
return /* @__PURE__ */
|
|
5793
|
+
return /* @__PURE__ */ jsx36(Flex22, { gap: 3, wrap: "wrap", children: viewable.map((entry) => /* @__PURE__ */ jsx36(Text29, { size: 2, children: /* @__PURE__ */ jsxs29("a", { href: entry.url, rel: "noopener noreferrer", target: "_blank", children: [
|
|
5634
5794
|
"View in Promptfoo (",
|
|
5635
5795
|
entry.mode,
|
|
5636
5796
|
") \u2192"
|
|
5637
5797
|
] }) }, entry.mode)) });
|
|
5638
5798
|
}
|
|
5639
5799
|
if (provenance.promptfooUrl && VIEWABLE_PROMPTFOO_MODES.has(provenance.mode)) {
|
|
5640
|
-
return /* @__PURE__ */
|
|
5800
|
+
return /* @__PURE__ */ jsx36(Text29, { size: 2, children: /* @__PURE__ */ jsx36(
|
|
5641
5801
|
"a",
|
|
5642
5802
|
{
|
|
5643
5803
|
href: provenance.promptfooUrl,
|
|
@@ -5652,32 +5812,32 @@ function PromptfooLinks({
|
|
|
5652
5812
|
|
|
5653
5813
|
// src/components/report-detail/RecommendationsSection.tsx
|
|
5654
5814
|
import React4 from "react";
|
|
5655
|
-
import { Badge as
|
|
5815
|
+
import { Badge as Badge20, Box as Box13, Card as Card21, Flex as Flex23, Stack as Stack21, Text as Text30, Tooltip as Tooltip7 } from "@sanity/ui";
|
|
5656
5816
|
import { HelpCircleIcon as HelpCircleIcon7 } from "@sanity/icons";
|
|
5657
|
-
import { jsx as
|
|
5817
|
+
import { jsx as jsx37, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
5658
5818
|
function RecommendationsSection({
|
|
5659
5819
|
recommendations
|
|
5660
5820
|
}) {
|
|
5661
5821
|
if (recommendations.gaps.length === 0) return null;
|
|
5662
|
-
return /* @__PURE__ */
|
|
5663
|
-
/* @__PURE__ */
|
|
5664
|
-
/* @__PURE__ */
|
|
5665
|
-
/* @__PURE__ */
|
|
5822
|
+
return /* @__PURE__ */ jsx37(Card21, { padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs30(Stack21, { space: 4, children: [
|
|
5823
|
+
/* @__PURE__ */ jsxs30(Flex23, { align: "center", gap: 3, wrap: "wrap", children: [
|
|
5824
|
+
/* @__PURE__ */ jsx37(Text30, { size: 3, weight: "semibold", children: "Recommendations" }),
|
|
5825
|
+
/* @__PURE__ */ jsx37(
|
|
5666
5826
|
Tooltip7,
|
|
5667
5827
|
{
|
|
5668
|
-
content: /* @__PURE__ */
|
|
5828
|
+
content: /* @__PURE__ */ jsx37(Box13, { padding: 2, style: { maxWidth: 260 }, children: /* @__PURE__ */ jsx37(Text30, { size: 2, children: GLOSSARY.recommendations }) }),
|
|
5669
5829
|
placement: "bottom",
|
|
5670
5830
|
portal: true,
|
|
5671
|
-
children: /* @__PURE__ */
|
|
5831
|
+
children: /* @__PURE__ */ jsx37(Text30, { muted: true, size: 1, children: /* @__PURE__ */ jsx37(HelpCircleIcon7, {}) })
|
|
5672
5832
|
}
|
|
5673
5833
|
),
|
|
5674
|
-
/* @__PURE__ */
|
|
5834
|
+
/* @__PURE__ */ jsx37(
|
|
5675
5835
|
Tooltip7,
|
|
5676
5836
|
{
|
|
5677
|
-
content: /* @__PURE__ */
|
|
5837
|
+
content: /* @__PURE__ */ jsx37(Box13, { padding: 2, style: { maxWidth: 260 }, children: /* @__PURE__ */ jsx37(Text30, { size: 2, children: GLOSSARY.totalPotentialLift }) }),
|
|
5678
5838
|
placement: "bottom",
|
|
5679
5839
|
portal: true,
|
|
5680
|
-
children: /* @__PURE__ */
|
|
5840
|
+
children: /* @__PURE__ */ jsx37(Card21, { padding: 2, radius: 2, tone: "positive", children: /* @__PURE__ */ jsxs30(Text30, { size: 2, weight: "bold", children: [
|
|
5681
5841
|
"+",
|
|
5682
5842
|
recommendations.totalPotentialLift.toFixed(1),
|
|
5683
5843
|
" pts potential lift"
|
|
@@ -5685,7 +5845,7 @@ function RecommendationsSection({
|
|
|
5685
5845
|
}
|
|
5686
5846
|
)
|
|
5687
5847
|
] }),
|
|
5688
|
-
/* @__PURE__ */
|
|
5848
|
+
/* @__PURE__ */ jsxs30(
|
|
5689
5849
|
"div",
|
|
5690
5850
|
{
|
|
5691
5851
|
style: {
|
|
@@ -5694,9 +5854,9 @@ function RecommendationsSection({
|
|
|
5694
5854
|
gridTemplateColumns: "auto 2fr 2fr 1fr 1fr 1fr"
|
|
5695
5855
|
},
|
|
5696
5856
|
children: [
|
|
5697
|
-
/* @__PURE__ */
|
|
5698
|
-
/* @__PURE__ */
|
|
5699
|
-
/* @__PURE__ */
|
|
5857
|
+
/* @__PURE__ */ jsx37(ColumnHeader, { borderBottom: true, label: "#" }),
|
|
5858
|
+
/* @__PURE__ */ jsx37(ColumnHeader, { borderBottom: true, label: "Area" }),
|
|
5859
|
+
/* @__PURE__ */ jsx37(
|
|
5700
5860
|
ColumnHeader,
|
|
5701
5861
|
{
|
|
5702
5862
|
borderBottom: true,
|
|
@@ -5704,8 +5864,8 @@ function RecommendationsSection({
|
|
|
5704
5864
|
tooltip: GLOSSARY.failureMode
|
|
5705
5865
|
}
|
|
5706
5866
|
),
|
|
5707
|
-
/* @__PURE__ */
|
|
5708
|
-
/* @__PURE__ */
|
|
5867
|
+
/* @__PURE__ */ jsx37(ColumnHeader, { borderBottom: true, label: "Action" }),
|
|
5868
|
+
/* @__PURE__ */ jsx37(
|
|
5709
5869
|
ColumnHeader,
|
|
5710
5870
|
{
|
|
5711
5871
|
borderBottom: true,
|
|
@@ -5713,7 +5873,7 @@ function RecommendationsSection({
|
|
|
5713
5873
|
tooltip: GLOSSARY.estimatedLift
|
|
5714
5874
|
}
|
|
5715
5875
|
),
|
|
5716
|
-
/* @__PURE__ */
|
|
5876
|
+
/* @__PURE__ */ jsx37(
|
|
5717
5877
|
ColumnHeader,
|
|
5718
5878
|
{
|
|
5719
5879
|
borderBottom: true,
|
|
@@ -5721,7 +5881,7 @@ function RecommendationsSection({
|
|
|
5721
5881
|
tooltip: GLOSSARY.confidence
|
|
5722
5882
|
}
|
|
5723
5883
|
),
|
|
5724
|
-
recommendations.gaps.map((gap, i) => /* @__PURE__ */
|
|
5884
|
+
recommendations.gaps.map((gap, i) => /* @__PURE__ */ jsx37(RecommendationRow, { gap, index: i }, `gap-${i}`))
|
|
5725
5885
|
]
|
|
5726
5886
|
}
|
|
5727
5887
|
)
|
|
@@ -5733,8 +5893,8 @@ function RecommendationRow({
|
|
|
5733
5893
|
}) {
|
|
5734
5894
|
const confIcon = gap.confidence === "high" ? "\u{1F7E2}" : gap.confidence === "medium" ? "\u{1F7E1}" : "\u{1F534}";
|
|
5735
5895
|
const bg = rowBackground(index);
|
|
5736
|
-
return /* @__PURE__ */
|
|
5737
|
-
/* @__PURE__ */
|
|
5896
|
+
return /* @__PURE__ */ jsxs30(React4.Fragment, { children: [
|
|
5897
|
+
/* @__PURE__ */ jsx37(
|
|
5738
5898
|
"div",
|
|
5739
5899
|
{
|
|
5740
5900
|
style: {
|
|
@@ -5744,10 +5904,10 @@ function RecommendationRow({
|
|
|
5744
5904
|
display: "flex",
|
|
5745
5905
|
padding: "8px 4px"
|
|
5746
5906
|
},
|
|
5747
|
-
children: /* @__PURE__ */
|
|
5907
|
+
children: /* @__PURE__ */ jsx37(Text30, { muted: true, size: 2, children: index + 1 })
|
|
5748
5908
|
}
|
|
5749
5909
|
),
|
|
5750
|
-
/* @__PURE__ */
|
|
5910
|
+
/* @__PURE__ */ jsx37(
|
|
5751
5911
|
"div",
|
|
5752
5912
|
{
|
|
5753
5913
|
style: {
|
|
@@ -5756,10 +5916,10 @@ function RecommendationRow({
|
|
|
5756
5916
|
display: "flex",
|
|
5757
5917
|
padding: "8px 0"
|
|
5758
5918
|
},
|
|
5759
|
-
children: /* @__PURE__ */
|
|
5919
|
+
children: /* @__PURE__ */ jsx37(Text30, { size: 2, weight: "medium", children: gap.area })
|
|
5760
5920
|
}
|
|
5761
5921
|
),
|
|
5762
|
-
/* @__PURE__ */
|
|
5922
|
+
/* @__PURE__ */ jsx37(
|
|
5763
5923
|
"div",
|
|
5764
5924
|
{
|
|
5765
5925
|
style: {
|
|
@@ -5768,8 +5928,8 @@ function RecommendationRow({
|
|
|
5768
5928
|
display: "flex",
|
|
5769
5929
|
padding: "8px 0"
|
|
5770
5930
|
},
|
|
5771
|
-
children: /* @__PURE__ */
|
|
5772
|
-
|
|
5931
|
+
children: /* @__PURE__ */ jsx37(
|
|
5932
|
+
Badge20,
|
|
5773
5933
|
{
|
|
5774
5934
|
tone: gap.failureMode === "missing-docs" ? "critical" : gap.failureMode === "incorrect-docs" ? "critical" : gap.failureMode === "outdated-docs" ? "caution" : "default",
|
|
5775
5935
|
children: gap.failureMode
|
|
@@ -5777,7 +5937,7 @@ function RecommendationRow({
|
|
|
5777
5937
|
)
|
|
5778
5938
|
}
|
|
5779
5939
|
),
|
|
5780
|
-
/* @__PURE__ */
|
|
5940
|
+
/* @__PURE__ */ jsx37(
|
|
5781
5941
|
"div",
|
|
5782
5942
|
{
|
|
5783
5943
|
style: {
|
|
@@ -5786,10 +5946,10 @@ function RecommendationRow({
|
|
|
5786
5946
|
display: "flex",
|
|
5787
5947
|
padding: "8px 0"
|
|
5788
5948
|
},
|
|
5789
|
-
children: /* @__PURE__ */
|
|
5949
|
+
children: /* @__PURE__ */ jsx37(Text30, { muted: true, size: 2, children: gap.remediation })
|
|
5790
5950
|
}
|
|
5791
5951
|
),
|
|
5792
|
-
/* @__PURE__ */
|
|
5952
|
+
/* @__PURE__ */ jsx37(
|
|
5793
5953
|
"div",
|
|
5794
5954
|
{
|
|
5795
5955
|
style: {
|
|
@@ -5798,13 +5958,13 @@ function RecommendationRow({
|
|
|
5798
5958
|
display: "flex",
|
|
5799
5959
|
padding: "8px 0"
|
|
5800
5960
|
},
|
|
5801
|
-
children: /* @__PURE__ */
|
|
5961
|
+
children: /* @__PURE__ */ jsx37(Card21, { padding: 2, radius: 2, tone: "positive", children: /* @__PURE__ */ jsxs30(Text30, { align: "center", size: 2, weight: "medium", children: [
|
|
5802
5962
|
"+",
|
|
5803
5963
|
gap.estimatedLift.toFixed(1)
|
|
5804
5964
|
] }) })
|
|
5805
5965
|
}
|
|
5806
5966
|
),
|
|
5807
|
-
/* @__PURE__ */
|
|
5967
|
+
/* @__PURE__ */ jsx37(
|
|
5808
5968
|
"div",
|
|
5809
5969
|
{
|
|
5810
5970
|
style: {
|
|
@@ -5813,7 +5973,7 @@ function RecommendationRow({
|
|
|
5813
5973
|
display: "flex",
|
|
5814
5974
|
padding: "8px 0"
|
|
5815
5975
|
},
|
|
5816
|
-
children: /* @__PURE__ */
|
|
5976
|
+
children: /* @__PURE__ */ jsxs30(Text30, { size: 2, children: [
|
|
5817
5977
|
confIcon,
|
|
5818
5978
|
" ",
|
|
5819
5979
|
gap.confidence
|
|
@@ -5825,32 +5985,32 @@ function RecommendationRow({
|
|
|
5825
5985
|
|
|
5826
5986
|
// src/components/report-detail/ReportHeader.tsx
|
|
5827
5987
|
import { ArrowLeftIcon } from "@sanity/icons";
|
|
5828
|
-
import { Badge as
|
|
5988
|
+
import { Badge as Badge21, Button as Button4, Flex as Flex26, Stack as Stack23, Text as Text32 } from "@sanity/ui";
|
|
5829
5989
|
|
|
5830
5990
|
// src/components/report-detail/report-actions/ReportActions.tsx
|
|
5831
5991
|
import { ChevronDownIcon, CopyIcon as CopyIcon2 } from "@sanity/icons";
|
|
5832
5992
|
import {
|
|
5833
5993
|
Button as Button3,
|
|
5834
|
-
Flex as
|
|
5994
|
+
Flex as Flex25,
|
|
5835
5995
|
Menu as Menu2,
|
|
5836
5996
|
MenuButton as MenuButton2,
|
|
5837
5997
|
MenuDivider,
|
|
5838
5998
|
useToast as useToast7
|
|
5839
5999
|
} from "@sanity/ui";
|
|
5840
|
-
import { useCallback as
|
|
5841
|
-
import { useClient as
|
|
6000
|
+
import { useCallback as useCallback19, useState as useState14 } from "react";
|
|
6001
|
+
import { useClient as useClient11 } from "sanity";
|
|
5842
6002
|
|
|
5843
6003
|
// src/components/report-detail/report-actions/CopyReportAction.tsx
|
|
5844
6004
|
import { ClipboardIcon } from "@sanity/icons";
|
|
5845
6005
|
import { MenuItem as MenuItem2, useToast as useToast2 } from "@sanity/ui";
|
|
5846
|
-
import { useCallback as
|
|
5847
|
-
import { useClient as
|
|
5848
|
-
import { jsx as
|
|
6006
|
+
import { useCallback as useCallback14, useState as useState11 } from "react";
|
|
6007
|
+
import { useClient as useClient8 } from "sanity";
|
|
6008
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
5849
6009
|
function CopyReportAction({ documentId }) {
|
|
5850
|
-
const client =
|
|
6010
|
+
const client = useClient8({ apiVersion: API_VERSION });
|
|
5851
6011
|
const toast = useToast2();
|
|
5852
|
-
const [copying, setCopying] =
|
|
5853
|
-
const handleClick =
|
|
6012
|
+
const [copying, setCopying] = useState11(false);
|
|
6013
|
+
const handleClick = useCallback14(async () => {
|
|
5854
6014
|
setCopying(true);
|
|
5855
6015
|
try {
|
|
5856
6016
|
const doc = await client.fetch(
|
|
@@ -5882,7 +6042,7 @@ function CopyReportAction({ documentId }) {
|
|
|
5882
6042
|
setCopying(false);
|
|
5883
6043
|
}
|
|
5884
6044
|
}, [client, documentId, toast]);
|
|
5885
|
-
return /* @__PURE__ */
|
|
6045
|
+
return /* @__PURE__ */ jsx38(
|
|
5886
6046
|
MenuItem2,
|
|
5887
6047
|
{
|
|
5888
6048
|
disabled: copying,
|
|
@@ -5896,11 +6056,11 @@ function CopyReportAction({ documentId }) {
|
|
|
5896
6056
|
// src/components/report-detail/report-actions/CopyReportIdAction.tsx
|
|
5897
6057
|
import { CopyIcon } from "@sanity/icons";
|
|
5898
6058
|
import { MenuItem as MenuItem3, useToast as useToast3 } from "@sanity/ui";
|
|
5899
|
-
import { useCallback as
|
|
5900
|
-
import { jsx as
|
|
6059
|
+
import { useCallback as useCallback15 } from "react";
|
|
6060
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
5901
6061
|
function CopyReportIdAction({ reportId }) {
|
|
5902
6062
|
const toast = useToast3();
|
|
5903
|
-
const handleClick =
|
|
6063
|
+
const handleClick = useCallback15(() => {
|
|
5904
6064
|
navigator.clipboard.writeText(reportId).then(
|
|
5905
6065
|
() => {
|
|
5906
6066
|
toast.push({
|
|
@@ -5918,19 +6078,19 @@ function CopyReportIdAction({ reportId }) {
|
|
|
5918
6078
|
}
|
|
5919
6079
|
);
|
|
5920
6080
|
}, [reportId, toast]);
|
|
5921
|
-
return /* @__PURE__ */
|
|
6081
|
+
return /* @__PURE__ */ jsx39(MenuItem3, { icon: CopyIcon, onClick: handleClick, text: "Copy report ID" });
|
|
5922
6082
|
}
|
|
5923
6083
|
|
|
5924
6084
|
// src/components/report-detail/report-actions/CopyVisionQueryAction.tsx
|
|
5925
6085
|
import { SearchIcon as SearchIcon6 } from "@sanity/icons";
|
|
5926
6086
|
import { MenuItem as MenuItem4, useToast as useToast4 } from "@sanity/ui";
|
|
5927
|
-
import { useCallback as
|
|
5928
|
-
import { jsx as
|
|
6087
|
+
import { useCallback as useCallback16 } from "react";
|
|
6088
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
5929
6089
|
function CopyVisionQueryAction({
|
|
5930
6090
|
reportId
|
|
5931
6091
|
}) {
|
|
5932
6092
|
const toast = useToast4();
|
|
5933
|
-
const handleClick =
|
|
6093
|
+
const handleClick = useCallback16(() => {
|
|
5934
6094
|
const query = `*[_type == "ailf.report" && reportId == "${reportId}"][0]`;
|
|
5935
6095
|
navigator.clipboard.writeText(query).then(
|
|
5936
6096
|
() => {
|
|
@@ -5950,7 +6110,7 @@ function CopyVisionQueryAction({
|
|
|
5950
6110
|
}
|
|
5951
6111
|
);
|
|
5952
6112
|
}, [reportId, toast]);
|
|
5953
|
-
return /* @__PURE__ */
|
|
6113
|
+
return /* @__PURE__ */ jsx40(
|
|
5954
6114
|
MenuItem4,
|
|
5955
6115
|
{
|
|
5956
6116
|
icon: SearchIcon6,
|
|
@@ -5961,25 +6121,25 @@ function CopyVisionQueryAction({
|
|
|
5961
6121
|
}
|
|
5962
6122
|
|
|
5963
6123
|
// src/components/report-detail/report-actions/DeleteConfirmDialog.tsx
|
|
5964
|
-
import { Box as Box14, Button as Button2, Card as
|
|
5965
|
-
import { jsx as
|
|
6124
|
+
import { Box as Box14, Button as Button2, Card as Card22, Dialog, Flex as Flex24, Stack as Stack22, Text as Text31 } from "@sanity/ui";
|
|
6125
|
+
import { jsx as jsx41, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
5966
6126
|
function DeleteConfirmDialog({
|
|
5967
6127
|
isDeleting,
|
|
5968
6128
|
onClose,
|
|
5969
6129
|
onConfirm,
|
|
5970
6130
|
reportId
|
|
5971
6131
|
}) {
|
|
5972
|
-
return /* @__PURE__ */
|
|
6132
|
+
return /* @__PURE__ */ jsx41(
|
|
5973
6133
|
Dialog,
|
|
5974
6134
|
{
|
|
5975
6135
|
header: "Delete Report",
|
|
5976
6136
|
id: "delete-report-dialog",
|
|
5977
6137
|
onClose,
|
|
5978
6138
|
width: 1,
|
|
5979
|
-
children: /* @__PURE__ */
|
|
5980
|
-
/* @__PURE__ */
|
|
5981
|
-
/* @__PURE__ */
|
|
5982
|
-
|
|
6139
|
+
children: /* @__PURE__ */ jsx41(Box14, { padding: 4, children: /* @__PURE__ */ jsxs31(Stack22, { space: 4, children: [
|
|
6140
|
+
/* @__PURE__ */ jsx41(Text31, { children: "Are you sure you want to delete this report? This action cannot be undone." }),
|
|
6141
|
+
/* @__PURE__ */ jsx41(Card22, { border: true, padding: 3, radius: 2, tone: "transparent", children: /* @__PURE__ */ jsx41(
|
|
6142
|
+
Text31,
|
|
5983
6143
|
{
|
|
5984
6144
|
muted: true,
|
|
5985
6145
|
size: 1,
|
|
@@ -5987,8 +6147,8 @@ function DeleteConfirmDialog({
|
|
|
5987
6147
|
children: reportId
|
|
5988
6148
|
}
|
|
5989
6149
|
) }),
|
|
5990
|
-
/* @__PURE__ */
|
|
5991
|
-
/* @__PURE__ */
|
|
6150
|
+
/* @__PURE__ */ jsxs31(Flex24, { gap: 2, justify: "flex-end", children: [
|
|
6151
|
+
/* @__PURE__ */ jsx41(
|
|
5992
6152
|
Button2,
|
|
5993
6153
|
{
|
|
5994
6154
|
disabled: isDeleting,
|
|
@@ -5997,7 +6157,7 @@ function DeleteConfirmDialog({
|
|
|
5997
6157
|
text: "Cancel"
|
|
5998
6158
|
}
|
|
5999
6159
|
),
|
|
6000
|
-
/* @__PURE__ */
|
|
6160
|
+
/* @__PURE__ */ jsx41(
|
|
6001
6161
|
Button2,
|
|
6002
6162
|
{
|
|
6003
6163
|
disabled: isDeleting,
|
|
@@ -6015,11 +6175,11 @@ function DeleteConfirmDialog({
|
|
|
6015
6175
|
// src/components/report-detail/report-actions/DeleteReportAction.tsx
|
|
6016
6176
|
import { TrashIcon } from "@sanity/icons";
|
|
6017
6177
|
import { MenuItem as MenuItem5 } from "@sanity/ui";
|
|
6018
|
-
import { jsx as
|
|
6178
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
6019
6179
|
function DeleteReportAction({
|
|
6020
6180
|
onRequestDelete
|
|
6021
6181
|
}) {
|
|
6022
|
-
return /* @__PURE__ */
|
|
6182
|
+
return /* @__PURE__ */ jsx42(
|
|
6023
6183
|
MenuItem5,
|
|
6024
6184
|
{
|
|
6025
6185
|
icon: TrashIcon,
|
|
@@ -6033,17 +6193,17 @@ function DeleteReportAction({
|
|
|
6033
6193
|
// src/components/report-detail/report-actions/DownloadReportAction.tsx
|
|
6034
6194
|
import { DownloadIcon } from "@sanity/icons";
|
|
6035
6195
|
import { MenuItem as MenuItem6, useToast as useToast5 } from "@sanity/ui";
|
|
6036
|
-
import { useCallback as
|
|
6037
|
-
import { useClient as
|
|
6038
|
-
import { jsx as
|
|
6196
|
+
import { useCallback as useCallback17, useState as useState12 } from "react";
|
|
6197
|
+
import { useClient as useClient9 } from "sanity";
|
|
6198
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
6039
6199
|
function DownloadReportAction({
|
|
6040
6200
|
documentId,
|
|
6041
6201
|
reportId
|
|
6042
6202
|
}) {
|
|
6043
|
-
const client =
|
|
6203
|
+
const client = useClient9({ apiVersion: API_VERSION });
|
|
6044
6204
|
const toast = useToast5();
|
|
6045
|
-
const [downloading, setDownloading] =
|
|
6046
|
-
const handleClick =
|
|
6205
|
+
const [downloading, setDownloading] = useState12(false);
|
|
6206
|
+
const handleClick = useCallback17(async () => {
|
|
6047
6207
|
setDownloading(true);
|
|
6048
6208
|
try {
|
|
6049
6209
|
const doc = await client.fetch(
|
|
@@ -6083,7 +6243,7 @@ function DownloadReportAction({
|
|
|
6083
6243
|
setDownloading(false);
|
|
6084
6244
|
}
|
|
6085
6245
|
}, [client, documentId, reportId, toast]);
|
|
6086
|
-
return /* @__PURE__ */
|
|
6246
|
+
return /* @__PURE__ */ jsx43(
|
|
6087
6247
|
MenuItem6,
|
|
6088
6248
|
{
|
|
6089
6249
|
disabled: downloading,
|
|
@@ -6097,8 +6257,8 @@ function DownloadReportAction({
|
|
|
6097
6257
|
// src/components/report-detail/report-actions/RerunEvaluationAction.tsx
|
|
6098
6258
|
import { PlayIcon as PlayIcon2 } from "@sanity/icons";
|
|
6099
6259
|
import { MenuItem as MenuItem7, useToast as useToast6 } from "@sanity/ui";
|
|
6100
|
-
import { useCallback as
|
|
6101
|
-
import { useClient as
|
|
6260
|
+
import { useCallback as useCallback18, useState as useState13 } from "react";
|
|
6261
|
+
import { useClient as useClient10, useCurrentUser as useCurrentUser2 } from "sanity";
|
|
6102
6262
|
|
|
6103
6263
|
// src/lib/eval-scope.ts
|
|
6104
6264
|
function extractEvalScope(provenance) {
|
|
@@ -6113,7 +6273,7 @@ function extractEvalScope(provenance) {
|
|
|
6113
6273
|
}
|
|
6114
6274
|
|
|
6115
6275
|
// src/components/report-detail/report-actions/RerunEvaluationAction.tsx
|
|
6116
|
-
import { jsx as
|
|
6276
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
6117
6277
|
var EVAL_REQUEST_TYPE2 = "ailf.evalRequest";
|
|
6118
6278
|
function slugify2(s) {
|
|
6119
6279
|
return s.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40);
|
|
@@ -6139,6 +6299,8 @@ function buildRequestDoc(scope, meta) {
|
|
|
6139
6299
|
// Request metadata
|
|
6140
6300
|
requestedAt: now,
|
|
6141
6301
|
requestedBy: meta.userId,
|
|
6302
|
+
// Lineage — links this request back to the source report
|
|
6303
|
+
sourceReportId: meta.reportId,
|
|
6142
6304
|
status: "pending",
|
|
6143
6305
|
tag
|
|
6144
6306
|
};
|
|
@@ -6147,11 +6309,11 @@ function RerunEvaluationAction({
|
|
|
6147
6309
|
provenance,
|
|
6148
6310
|
reportId
|
|
6149
6311
|
}) {
|
|
6150
|
-
const client =
|
|
6312
|
+
const client = useClient10({ apiVersion: API_VERSION });
|
|
6151
6313
|
const currentUser = useCurrentUser2();
|
|
6152
6314
|
const toast = useToast6();
|
|
6153
|
-
const [requesting, setRequesting] =
|
|
6154
|
-
const handleClick =
|
|
6315
|
+
const [requesting, setRequesting] = useState13(false);
|
|
6316
|
+
const handleClick = useCallback18(async () => {
|
|
6155
6317
|
setRequesting(true);
|
|
6156
6318
|
try {
|
|
6157
6319
|
const scope = extractEvalScope(provenance);
|
|
@@ -6178,7 +6340,7 @@ function RerunEvaluationAction({
|
|
|
6178
6340
|
setRequesting(false);
|
|
6179
6341
|
}
|
|
6180
6342
|
}, [client, currentUser?.id, provenance, reportId, toast]);
|
|
6181
|
-
return /* @__PURE__ */
|
|
6343
|
+
return /* @__PURE__ */ jsx44(
|
|
6182
6344
|
MenuItem7,
|
|
6183
6345
|
{
|
|
6184
6346
|
disabled: requesting,
|
|
@@ -6190,16 +6352,16 @@ function RerunEvaluationAction({
|
|
|
6190
6352
|
}
|
|
6191
6353
|
|
|
6192
6354
|
// src/components/report-detail/report-actions/ReportActions.tsx
|
|
6193
|
-
import { Fragment as Fragment6, jsx as
|
|
6355
|
+
import { Fragment as Fragment6, jsx as jsx45, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
6194
6356
|
function ReportActions({
|
|
6195
6357
|
documentId,
|
|
6196
6358
|
onDeleted,
|
|
6197
6359
|
provenance,
|
|
6198
6360
|
reportId
|
|
6199
6361
|
}) {
|
|
6200
|
-
const client =
|
|
6362
|
+
const client = useClient11({ apiVersion: API_VERSION });
|
|
6201
6363
|
const toast = useToast7();
|
|
6202
|
-
const handleCopyId =
|
|
6364
|
+
const handleCopyId = useCallback19(() => {
|
|
6203
6365
|
navigator.clipboard.writeText(reportId).then(
|
|
6204
6366
|
() => {
|
|
6205
6367
|
toast.push({
|
|
@@ -6217,15 +6379,15 @@ function ReportActions({
|
|
|
6217
6379
|
}
|
|
6218
6380
|
);
|
|
6219
6381
|
}, [reportId, toast]);
|
|
6220
|
-
const [deleteDialogOpen, setDeleteDialogOpen] =
|
|
6221
|
-
const [deleting, setDeleting] =
|
|
6222
|
-
const handleRequestDelete =
|
|
6382
|
+
const [deleteDialogOpen, setDeleteDialogOpen] = useState14(false);
|
|
6383
|
+
const [deleting, setDeleting] = useState14(false);
|
|
6384
|
+
const handleRequestDelete = useCallback19(() => {
|
|
6223
6385
|
setDeleteDialogOpen(true);
|
|
6224
6386
|
}, []);
|
|
6225
|
-
const handleDeleteClose =
|
|
6387
|
+
const handleDeleteClose = useCallback19(() => {
|
|
6226
6388
|
if (!deleting) setDeleteDialogOpen(false);
|
|
6227
6389
|
}, [deleting]);
|
|
6228
|
-
const handleDeleteConfirm =
|
|
6390
|
+
const handleDeleteConfirm = useCallback19(async () => {
|
|
6229
6391
|
setDeleting(true);
|
|
6230
6392
|
try {
|
|
6231
6393
|
await client.delete(documentId);
|
|
@@ -6246,9 +6408,9 @@ function ReportActions({
|
|
|
6246
6408
|
setDeleting(false);
|
|
6247
6409
|
}
|
|
6248
6410
|
}, [client, documentId, onDeleted, toast]);
|
|
6249
|
-
return /* @__PURE__ */
|
|
6250
|
-
/* @__PURE__ */
|
|
6251
|
-
/* @__PURE__ */
|
|
6411
|
+
return /* @__PURE__ */ jsxs32(Fragment6, { children: [
|
|
6412
|
+
/* @__PURE__ */ jsxs32(Flex25, { children: [
|
|
6413
|
+
/* @__PURE__ */ jsx45(
|
|
6252
6414
|
Button3,
|
|
6253
6415
|
{
|
|
6254
6416
|
icon: CopyIcon2,
|
|
@@ -6262,10 +6424,10 @@ function ReportActions({
|
|
|
6262
6424
|
text: "Copy Report ID"
|
|
6263
6425
|
}
|
|
6264
6426
|
),
|
|
6265
|
-
/* @__PURE__ */
|
|
6427
|
+
/* @__PURE__ */ jsx45(
|
|
6266
6428
|
MenuButton2,
|
|
6267
6429
|
{
|
|
6268
|
-
button: /* @__PURE__ */
|
|
6430
|
+
button: /* @__PURE__ */ jsx45(
|
|
6269
6431
|
Button3,
|
|
6270
6432
|
{
|
|
6271
6433
|
icon: ChevronDownIcon,
|
|
@@ -6278,33 +6440,33 @@ function ReportActions({
|
|
|
6278
6440
|
}
|
|
6279
6441
|
),
|
|
6280
6442
|
id: "report-actions-menu",
|
|
6281
|
-
menu: /* @__PURE__ */
|
|
6282
|
-
/* @__PURE__ */
|
|
6283
|
-
/* @__PURE__ */
|
|
6443
|
+
menu: /* @__PURE__ */ jsxs32(Menu2, { children: [
|
|
6444
|
+
/* @__PURE__ */ jsx45(CopyReportIdAction, { reportId }),
|
|
6445
|
+
/* @__PURE__ */ jsx45(
|
|
6284
6446
|
RerunEvaluationAction,
|
|
6285
6447
|
{
|
|
6286
6448
|
provenance,
|
|
6287
6449
|
reportId
|
|
6288
6450
|
}
|
|
6289
6451
|
),
|
|
6290
|
-
/* @__PURE__ */
|
|
6291
|
-
/* @__PURE__ */
|
|
6452
|
+
/* @__PURE__ */ jsx45(MenuDivider, {}),
|
|
6453
|
+
/* @__PURE__ */ jsx45(
|
|
6292
6454
|
DownloadReportAction,
|
|
6293
6455
|
{
|
|
6294
6456
|
documentId,
|
|
6295
6457
|
reportId
|
|
6296
6458
|
}
|
|
6297
6459
|
),
|
|
6298
|
-
/* @__PURE__ */
|
|
6299
|
-
/* @__PURE__ */
|
|
6300
|
-
/* @__PURE__ */
|
|
6301
|
-
/* @__PURE__ */
|
|
6460
|
+
/* @__PURE__ */ jsx45(CopyReportAction, { documentId }),
|
|
6461
|
+
/* @__PURE__ */ jsx45(CopyVisionQueryAction, { reportId }),
|
|
6462
|
+
/* @__PURE__ */ jsx45(MenuDivider, {}),
|
|
6463
|
+
/* @__PURE__ */ jsx45(DeleteReportAction, { onRequestDelete: handleRequestDelete })
|
|
6302
6464
|
] }),
|
|
6303
6465
|
popover: { placement: "bottom-end", portal: true }
|
|
6304
6466
|
}
|
|
6305
6467
|
)
|
|
6306
6468
|
] }),
|
|
6307
|
-
deleteDialogOpen && /* @__PURE__ */
|
|
6469
|
+
deleteDialogOpen && /* @__PURE__ */ jsx45(
|
|
6308
6470
|
DeleteConfirmDialog,
|
|
6309
6471
|
{
|
|
6310
6472
|
isDeleting: deleting,
|
|
@@ -6317,7 +6479,7 @@ function ReportActions({
|
|
|
6317
6479
|
}
|
|
6318
6480
|
|
|
6319
6481
|
// src/components/report-detail/ReportHeader.tsx
|
|
6320
|
-
import { jsx as
|
|
6482
|
+
import { jsx as jsx46, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
6321
6483
|
function ReportHeader({
|
|
6322
6484
|
completedAt,
|
|
6323
6485
|
documentId,
|
|
@@ -6332,16 +6494,16 @@ function ReportHeader({
|
|
|
6332
6494
|
const dateLabel = formatCardDate(completedAt);
|
|
6333
6495
|
const title = tag ?? dateLabel;
|
|
6334
6496
|
const hasTag = Boolean(tag);
|
|
6335
|
-
return /* @__PURE__ */
|
|
6336
|
-
/* @__PURE__ */
|
|
6337
|
-
/* @__PURE__ */
|
|
6338
|
-
/* @__PURE__ */
|
|
6339
|
-
hasTag && /* @__PURE__ */
|
|
6497
|
+
return /* @__PURE__ */ jsxs33(Flex26, { align: "center", gap: 3, children: [
|
|
6498
|
+
/* @__PURE__ */ jsx46(Button4, { icon: ArrowLeftIcon, mode: "bleed", onClick: onBack, text: "Back" }),
|
|
6499
|
+
/* @__PURE__ */ jsxs33(Stack23, { flex: 1, space: 1, children: [
|
|
6500
|
+
/* @__PURE__ */ jsx46(Text32, { size: 4, weight: "bold", children: title }),
|
|
6501
|
+
hasTag && /* @__PURE__ */ jsx46(Text32, { muted: true, size: 2, children: dateLabel })
|
|
6340
6502
|
] }),
|
|
6341
|
-
/* @__PURE__ */
|
|
6342
|
-
/* @__PURE__ */
|
|
6343
|
-
/* @__PURE__ */
|
|
6344
|
-
/* @__PURE__ */
|
|
6503
|
+
/* @__PURE__ */ jsxs33(Flex26, { align: "center", gap: 2, children: [
|
|
6504
|
+
/* @__PURE__ */ jsx46(Badge21, { mode: "outline", tone: "default", children: sourceName }),
|
|
6505
|
+
/* @__PURE__ */ jsx46(Badge21, { tone: "primary", children: mode }),
|
|
6506
|
+
/* @__PURE__ */ jsx46(
|
|
6345
6507
|
ReportActions,
|
|
6346
6508
|
{
|
|
6347
6509
|
documentId,
|
|
@@ -6356,18 +6518,18 @@ function ReportHeader({
|
|
|
6356
6518
|
|
|
6357
6519
|
// src/components/report-detail/ThreeLayerTable.tsx
|
|
6358
6520
|
import React5 from "react";
|
|
6359
|
-
import { Badge as
|
|
6360
|
-
import { jsx as
|
|
6521
|
+
import { Badge as Badge22, Card as Card23, Flex as Flex27, Stack as Stack24, Text as Text33 } from "@sanity/ui";
|
|
6522
|
+
import { jsx as jsx47, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
6361
6523
|
function ThreeLayerTable({ scores }) {
|
|
6362
6524
|
const filtered = scores.filter((s) => s.actualScore != null);
|
|
6363
6525
|
if (filtered.length === 0) return null;
|
|
6364
6526
|
const hasInverted = filtered.some((s) => s.invertedRetrievalGap);
|
|
6365
|
-
return /* @__PURE__ */
|
|
6366
|
-
/* @__PURE__ */
|
|
6367
|
-
/* @__PURE__ */
|
|
6368
|
-
/* @__PURE__ */
|
|
6527
|
+
return /* @__PURE__ */ jsx47(Card23, { overflow: "auto", padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs34(Stack24, { space: 4, children: [
|
|
6528
|
+
/* @__PURE__ */ jsxs34(Flex27, { align: "center", gap: 3, children: [
|
|
6529
|
+
/* @__PURE__ */ jsx47(Text33, { size: 3, weight: "semibold", children: "Three-Layer Decomposition" }),
|
|
6530
|
+
/* @__PURE__ */ jsx47(Badge22, { tone: "primary", children: "full mode" })
|
|
6369
6531
|
] }),
|
|
6370
|
-
/* @__PURE__ */
|
|
6532
|
+
/* @__PURE__ */ jsxs34(
|
|
6371
6533
|
"div",
|
|
6372
6534
|
{
|
|
6373
6535
|
style: {
|
|
@@ -6376,9 +6538,9 @@ function ThreeLayerTable({ scores }) {
|
|
|
6376
6538
|
gridTemplateColumns: "2fr 1fr 1fr 1fr 1fr 1fr"
|
|
6377
6539
|
},
|
|
6378
6540
|
children: [
|
|
6379
|
-
/* @__PURE__ */
|
|
6380
|
-
/* @__PURE__ */
|
|
6381
|
-
/* @__PURE__ */
|
|
6541
|
+
/* @__PURE__ */ jsx47(ColumnHeader, { borderBottom: true, label: "Area" }),
|
|
6542
|
+
/* @__PURE__ */ jsx47(ColumnHeader, { borderBottom: true, label: "Floor", tooltip: GLOSSARY.floor }),
|
|
6543
|
+
/* @__PURE__ */ jsx47(
|
|
6382
6544
|
ColumnHeader,
|
|
6383
6545
|
{
|
|
6384
6546
|
borderBottom: true,
|
|
@@ -6386,8 +6548,8 @@ function ThreeLayerTable({ scores }) {
|
|
|
6386
6548
|
tooltip: GLOSSARY.ceiling
|
|
6387
6549
|
}
|
|
6388
6550
|
),
|
|
6389
|
-
/* @__PURE__ */
|
|
6390
|
-
/* @__PURE__ */
|
|
6551
|
+
/* @__PURE__ */ jsx47(ColumnHeader, { borderBottom: true, label: "Actual", tooltip: GLOSSARY.actual }),
|
|
6552
|
+
/* @__PURE__ */ jsx47(
|
|
6391
6553
|
ColumnHeader,
|
|
6392
6554
|
{
|
|
6393
6555
|
borderBottom: true,
|
|
@@ -6395,7 +6557,7 @@ function ThreeLayerTable({ scores }) {
|
|
|
6395
6557
|
tooltip: GLOSSARY.retGap
|
|
6396
6558
|
}
|
|
6397
6559
|
),
|
|
6398
|
-
/* @__PURE__ */
|
|
6560
|
+
/* @__PURE__ */ jsx47(
|
|
6399
6561
|
ColumnHeader,
|
|
6400
6562
|
{
|
|
6401
6563
|
borderBottom: true,
|
|
@@ -6403,8 +6565,8 @@ function ThreeLayerTable({ scores }) {
|
|
|
6403
6565
|
tooltip: GLOSSARY.efficiency
|
|
6404
6566
|
}
|
|
6405
6567
|
),
|
|
6406
|
-
filtered.map((score, i) => /* @__PURE__ */
|
|
6407
|
-
/* @__PURE__ */
|
|
6568
|
+
filtered.map((score, i) => /* @__PURE__ */ jsxs34(React5.Fragment, { children: [
|
|
6569
|
+
/* @__PURE__ */ jsx47(
|
|
6408
6570
|
"div",
|
|
6409
6571
|
{
|
|
6410
6572
|
style: {
|
|
@@ -6412,10 +6574,10 @@ function ThreeLayerTable({ scores }) {
|
|
|
6412
6574
|
borderRadius: 4,
|
|
6413
6575
|
padding: "8px 0 8px 4px"
|
|
6414
6576
|
},
|
|
6415
|
-
children: /* @__PURE__ */
|
|
6577
|
+
children: /* @__PURE__ */ jsx47(Text33, { size: 2, weight: "medium", children: score.feature })
|
|
6416
6578
|
}
|
|
6417
6579
|
),
|
|
6418
|
-
/* @__PURE__ */
|
|
6580
|
+
/* @__PURE__ */ jsx47(
|
|
6419
6581
|
"div",
|
|
6420
6582
|
{
|
|
6421
6583
|
style: {
|
|
@@ -6423,10 +6585,10 @@ function ThreeLayerTable({ scores }) {
|
|
|
6423
6585
|
display: "flex",
|
|
6424
6586
|
padding: "2px 0"
|
|
6425
6587
|
},
|
|
6426
|
-
children: /* @__PURE__ */
|
|
6588
|
+
children: /* @__PURE__ */ jsx47(ScoreCell, { score: score.floorScore ?? 0 })
|
|
6427
6589
|
}
|
|
6428
6590
|
),
|
|
6429
|
-
/* @__PURE__ */
|
|
6591
|
+
/* @__PURE__ */ jsx47(
|
|
6430
6592
|
"div",
|
|
6431
6593
|
{
|
|
6432
6594
|
style: {
|
|
@@ -6434,10 +6596,10 @@ function ThreeLayerTable({ scores }) {
|
|
|
6434
6596
|
display: "flex",
|
|
6435
6597
|
padding: "2px 0"
|
|
6436
6598
|
},
|
|
6437
|
-
children: /* @__PURE__ */
|
|
6599
|
+
children: /* @__PURE__ */ jsx47(ScoreCell, { score: score.ceilingScore ?? score.totalScore })
|
|
6438
6600
|
}
|
|
6439
6601
|
),
|
|
6440
|
-
/* @__PURE__ */
|
|
6602
|
+
/* @__PURE__ */ jsx47(
|
|
6441
6603
|
"div",
|
|
6442
6604
|
{
|
|
6443
6605
|
style: {
|
|
@@ -6445,10 +6607,10 @@ function ThreeLayerTable({ scores }) {
|
|
|
6445
6607
|
display: "flex",
|
|
6446
6608
|
padding: "2px 0"
|
|
6447
6609
|
},
|
|
6448
|
-
children: /* @__PURE__ */
|
|
6610
|
+
children: /* @__PURE__ */ jsx47(ScoreCell, { score: score.actualScore ?? 0 })
|
|
6449
6611
|
}
|
|
6450
6612
|
),
|
|
6451
|
-
/* @__PURE__ */
|
|
6613
|
+
/* @__PURE__ */ jsx47(
|
|
6452
6614
|
"div",
|
|
6453
6615
|
{
|
|
6454
6616
|
style: {
|
|
@@ -6457,10 +6619,10 @@ function ThreeLayerTable({ scores }) {
|
|
|
6457
6619
|
display: "flex",
|
|
6458
6620
|
padding: "6px 0"
|
|
6459
6621
|
},
|
|
6460
|
-
children: /* @__PURE__ */
|
|
6622
|
+
children: /* @__PURE__ */ jsx47(Text33, { size: 2, children: score.retrievalGap != null ? score.retrievalGap.toFixed(1) : "\u2014" })
|
|
6461
6623
|
}
|
|
6462
6624
|
),
|
|
6463
|
-
/* @__PURE__ */
|
|
6625
|
+
/* @__PURE__ */ jsx47(
|
|
6464
6626
|
"div",
|
|
6465
6627
|
{
|
|
6466
6628
|
style: {
|
|
@@ -6469,7 +6631,7 @@ function ThreeLayerTable({ scores }) {
|
|
|
6469
6631
|
display: "flex",
|
|
6470
6632
|
padding: "6px 0"
|
|
6471
6633
|
},
|
|
6472
|
-
children: /* @__PURE__ */
|
|
6634
|
+
children: /* @__PURE__ */ jsxs34(Text33, { size: 2, children: [
|
|
6473
6635
|
formatPercent(score.infrastructureEfficiency),
|
|
6474
6636
|
score.invertedRetrievalGap && " \u26A0\uFE0F"
|
|
6475
6637
|
] })
|
|
@@ -6479,12 +6641,12 @@ function ThreeLayerTable({ scores }) {
|
|
|
6479
6641
|
]
|
|
6480
6642
|
}
|
|
6481
6643
|
),
|
|
6482
|
-
hasInverted && /* @__PURE__ */
|
|
6644
|
+
hasInverted && /* @__PURE__ */ jsx47(Text33, { muted: true, size: 1, children: GLOSSARY.invertedRetGap })
|
|
6483
6645
|
] }) });
|
|
6484
6646
|
}
|
|
6485
6647
|
|
|
6486
6648
|
// src/components/report-detail/ReportDetail.tsx
|
|
6487
|
-
import { jsx as
|
|
6649
|
+
import { jsx as jsx48, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
6488
6650
|
var OVERVIEW_TAB = { id: "overview", label: "Overview" };
|
|
6489
6651
|
var DIAGNOSTICS_TAB = { id: "diagnostics", label: "Diagnostics" };
|
|
6490
6652
|
var ACTIVITY_TAB = { id: "activity", label: "Agent Activity" };
|
|
@@ -6498,10 +6660,10 @@ function ReportDetail({
|
|
|
6498
6660
|
onTabChange,
|
|
6499
6661
|
reportId
|
|
6500
6662
|
}) {
|
|
6501
|
-
const client =
|
|
6502
|
-
const [loading, setLoading] =
|
|
6503
|
-
const [report, setReport] =
|
|
6504
|
-
|
|
6663
|
+
const client = useClient12({ apiVersion: API_VERSION });
|
|
6664
|
+
const [loading, setLoading] = useState15(true);
|
|
6665
|
+
const [report, setReport] = useState15(null);
|
|
6666
|
+
useEffect9(() => {
|
|
6505
6667
|
let cancelled = false;
|
|
6506
6668
|
setLoading(true);
|
|
6507
6669
|
client.fetch(reportDetailQuery, { reportId }).then((data) => {
|
|
@@ -6538,18 +6700,18 @@ function ReportDetail({
|
|
|
6538
6700
|
if (disabledTabs.has(parsed)) return "overview";
|
|
6539
6701
|
return tabs.some((t) => t.id === parsed) ? parsed : "overview";
|
|
6540
6702
|
}, [activeTab, disabledTabs, tabs]);
|
|
6541
|
-
const handleTabClick =
|
|
6703
|
+
const handleTabClick = useCallback20(
|
|
6542
6704
|
(tabId) => {
|
|
6543
6705
|
onTabChange(tabId === "overview" ? null : tabId);
|
|
6544
6706
|
},
|
|
6545
6707
|
[onTabChange]
|
|
6546
6708
|
);
|
|
6547
6709
|
if (loading) {
|
|
6548
|
-
return /* @__PURE__ */
|
|
6710
|
+
return /* @__PURE__ */ jsx48(LoadingState, { message: "Loading report\u2026" });
|
|
6549
6711
|
}
|
|
6550
6712
|
if (!report || !summary) {
|
|
6551
|
-
return /* @__PURE__ */
|
|
6552
|
-
/* @__PURE__ */
|
|
6713
|
+
return /* @__PURE__ */ jsx48(Box15, { padding: 5, children: /* @__PURE__ */ jsxs35(Stack25, { space: 4, children: [
|
|
6714
|
+
/* @__PURE__ */ jsx48(
|
|
6553
6715
|
Button5,
|
|
6554
6716
|
{
|
|
6555
6717
|
icon: ArrowLeftIcon2,
|
|
@@ -6558,14 +6720,14 @@ function ReportDetail({
|
|
|
6558
6720
|
text: "Back"
|
|
6559
6721
|
}
|
|
6560
6722
|
),
|
|
6561
|
-
/* @__PURE__ */
|
|
6723
|
+
/* @__PURE__ */ jsx48(Text34, { align: "center", muted: true, size: 3, children: "Report not found" })
|
|
6562
6724
|
] }) });
|
|
6563
6725
|
}
|
|
6564
6726
|
const { comparison, provenance } = report;
|
|
6565
6727
|
const totalTests = summary.scores.reduce((n, s) => n + s.testCount, 0);
|
|
6566
6728
|
const isFullMode = summary.evaluationMode === "full" || summary.scores.some((s) => s.actualScore != null);
|
|
6567
|
-
return /* @__PURE__ */
|
|
6568
|
-
/* @__PURE__ */
|
|
6729
|
+
return /* @__PURE__ */ jsx48(Box15, { padding: 4, children: /* @__PURE__ */ jsxs35(Stack25, { space: 5, children: [
|
|
6730
|
+
/* @__PURE__ */ jsx48(
|
|
6569
6731
|
ReportHeader,
|
|
6570
6732
|
{
|
|
6571
6733
|
completedAt: report.completedAt,
|
|
@@ -6579,10 +6741,10 @@ function ReportDetail({
|
|
|
6579
6741
|
tag: report.tag
|
|
6580
6742
|
}
|
|
6581
6743
|
),
|
|
6582
|
-
/* @__PURE__ */
|
|
6744
|
+
/* @__PURE__ */ jsx48(TabList, { space: 1, children: tabs.map((tab) => {
|
|
6583
6745
|
const isDisabled = disabledTabs.has(tab.id);
|
|
6584
6746
|
const tooltip = getDisabledTabTooltip(tab.id, summary);
|
|
6585
|
-
const tabElement = /* @__PURE__ */
|
|
6747
|
+
const tabElement = /* @__PURE__ */ jsx48(
|
|
6586
6748
|
Tab,
|
|
6587
6749
|
{
|
|
6588
6750
|
"aria-controls": `panel-${tab.id}`,
|
|
@@ -6593,25 +6755,25 @@ function ReportDetail({
|
|
|
6593
6755
|
selected: currentTab === tab.id
|
|
6594
6756
|
}
|
|
6595
6757
|
);
|
|
6596
|
-
return isDisabled && tooltip ? /* @__PURE__ */
|
|
6758
|
+
return isDisabled && tooltip ? /* @__PURE__ */ jsx48(
|
|
6597
6759
|
Tooltip8,
|
|
6598
6760
|
{
|
|
6599
|
-
content: /* @__PURE__ */
|
|
6761
|
+
content: /* @__PURE__ */ jsx48(Box15, { padding: 2, style: { maxWidth: 280 }, children: tooltip }),
|
|
6600
6762
|
placement: "bottom",
|
|
6601
6763
|
portal: true,
|
|
6602
|
-
children: /* @__PURE__ */
|
|
6764
|
+
children: /* @__PURE__ */ jsx48("span", { style: { display: "inline-block" }, children: tabElement })
|
|
6603
6765
|
},
|
|
6604
6766
|
tab.id
|
|
6605
|
-
) : /* @__PURE__ */
|
|
6767
|
+
) : /* @__PURE__ */ jsx48("span", { children: tabElement }, tab.id);
|
|
6606
6768
|
}) }),
|
|
6607
|
-
currentTab === "overview" && /* @__PURE__ */
|
|
6769
|
+
currentTab === "overview" && /* @__PURE__ */ jsx48(
|
|
6608
6770
|
TabPanel,
|
|
6609
6771
|
{
|
|
6610
6772
|
"aria-labelledby": "tab-overview",
|
|
6611
6773
|
hidden: currentTab !== "overview",
|
|
6612
6774
|
id: "panel-overview",
|
|
6613
|
-
children: /* @__PURE__ */
|
|
6614
|
-
/* @__PURE__ */
|
|
6775
|
+
children: /* @__PURE__ */ jsxs35(Stack25, { space: 5, children: [
|
|
6776
|
+
/* @__PURE__ */ jsx48(
|
|
6615
6777
|
OverviewStats,
|
|
6616
6778
|
{
|
|
6617
6779
|
durationMs: report.durationMs,
|
|
@@ -6620,37 +6782,38 @@ function ReportDetail({
|
|
|
6620
6782
|
totalTests
|
|
6621
6783
|
}
|
|
6622
6784
|
),
|
|
6623
|
-
isFullMode && /* @__PURE__ */
|
|
6624
|
-
/* @__PURE__ */
|
|
6625
|
-
comparison && /* @__PURE__ */
|
|
6626
|
-
/* @__PURE__ */
|
|
6785
|
+
isFullMode && /* @__PURE__ */ jsx48(ThreeLayerTable, { scores: summary.scores }),
|
|
6786
|
+
/* @__PURE__ */ jsx48(AreaScoreTable, { scores: summary.scores }),
|
|
6787
|
+
comparison && /* @__PURE__ */ jsx48(ComparisonSummary, { comparison }),
|
|
6788
|
+
/* @__PURE__ */ jsx48(LineageCard, { provenance, reportId: report.reportId }),
|
|
6789
|
+
/* @__PURE__ */ jsx48(ProvenanceCard, { provenance })
|
|
6627
6790
|
] })
|
|
6628
6791
|
}
|
|
6629
6792
|
),
|
|
6630
|
-
currentTab === "diagnostics" && hasDiagnostics && /* @__PURE__ */
|
|
6793
|
+
currentTab === "diagnostics" && hasDiagnostics && /* @__PURE__ */ jsx48(
|
|
6631
6794
|
TabPanel,
|
|
6632
6795
|
{
|
|
6633
6796
|
"aria-labelledby": "tab-diagnostics",
|
|
6634
6797
|
hidden: currentTab !== "diagnostics",
|
|
6635
6798
|
id: "panel-diagnostics",
|
|
6636
|
-
children: /* @__PURE__ */
|
|
6637
|
-
summary.recommendations && summary.recommendations.gaps.length > 0 && /* @__PURE__ */
|
|
6799
|
+
children: /* @__PURE__ */ jsxs35(Stack25, { space: 5, children: [
|
|
6800
|
+
summary.recommendations && summary.recommendations.gaps.length > 0 && /* @__PURE__ */ jsx48(
|
|
6638
6801
|
RecommendationsSection,
|
|
6639
6802
|
{
|
|
6640
6803
|
recommendations: summary.recommendations
|
|
6641
6804
|
}
|
|
6642
6805
|
),
|
|
6643
|
-
summary.lowScoringJudgments && summary.lowScoringJudgments.length > 0 && /* @__PURE__ */
|
|
6806
|
+
summary.lowScoringJudgments && summary.lowScoringJudgments.length > 0 && /* @__PURE__ */ jsx48(JudgmentList, { judgments: summary.lowScoringJudgments })
|
|
6644
6807
|
] })
|
|
6645
6808
|
}
|
|
6646
6809
|
),
|
|
6647
|
-
currentTab === "activity" && hasAgentActivity && /* @__PURE__ */
|
|
6810
|
+
currentTab === "activity" && hasAgentActivity && /* @__PURE__ */ jsx48(
|
|
6648
6811
|
TabPanel,
|
|
6649
6812
|
{
|
|
6650
6813
|
"aria-labelledby": "tab-activity",
|
|
6651
6814
|
hidden: currentTab !== "activity",
|
|
6652
6815
|
id: "panel-activity",
|
|
6653
|
-
children: /* @__PURE__ */
|
|
6816
|
+
children: /* @__PURE__ */ jsx48(
|
|
6654
6817
|
AgentActivitySection,
|
|
6655
6818
|
{
|
|
6656
6819
|
agentBehavior: summary.agentBehavior,
|
|
@@ -6672,27 +6835,27 @@ function getDisabledTabTooltip(tabId, summary) {
|
|
|
6672
6835
|
if (!summary) return null;
|
|
6673
6836
|
switch (tabId) {
|
|
6674
6837
|
case "diagnostics":
|
|
6675
|
-
return /* @__PURE__ */
|
|
6838
|
+
return /* @__PURE__ */ jsx48(Text34, { muted: true, size: 2, children: "No diagnostic data available. Diagnostics require low-scoring judgments or gap analysis recommendations." });
|
|
6676
6839
|
case "activity":
|
|
6677
|
-
return summary.evaluationMode === "baseline" ? /* @__PURE__ */
|
|
6840
|
+
return summary.evaluationMode === "baseline" ? /* @__PURE__ */ jsxs35(Text34, { muted: true, size: 2, children: [
|
|
6678
6841
|
"Not available for baseline-only evaluations. Run with",
|
|
6679
6842
|
" ",
|
|
6680
|
-
/* @__PURE__ */
|
|
6843
|
+
/* @__PURE__ */ jsx48("code", { style: inlineCodeStyle, children: "--mode full" }),
|
|
6681
6844
|
" or",
|
|
6682
6845
|
" ",
|
|
6683
|
-
/* @__PURE__ */
|
|
6846
|
+
/* @__PURE__ */ jsx48("code", { style: inlineCodeStyle, children: "--mode agentic" }),
|
|
6684
6847
|
" to capture agent browsing behavior."
|
|
6685
|
-
] }) : /* @__PURE__ */
|
|
6848
|
+
] }) : /* @__PURE__ */ jsx48(Text34, { muted: true, size: 2, children: "No agent activity data was recorded for this evaluation." });
|
|
6686
6849
|
default:
|
|
6687
6850
|
return null;
|
|
6688
6851
|
}
|
|
6689
6852
|
}
|
|
6690
6853
|
|
|
6691
6854
|
// src/components/ScoreTimeline.tsx
|
|
6692
|
-
import { Card as
|
|
6693
|
-
import { useCallback as
|
|
6694
|
-
import { useClient as
|
|
6695
|
-
import { jsx as
|
|
6855
|
+
import { Card as Card24, Flex as Flex28, Select as Select2, Stack as Stack26, Text as Text35 } from "@sanity/ui";
|
|
6856
|
+
import { useCallback as useCallback21, useEffect as useEffect10, useMemo as useMemo8, useState as useState16 } from "react";
|
|
6857
|
+
import { useClient as useClient13 } from "sanity";
|
|
6858
|
+
import { jsx as jsx49, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
6696
6859
|
var CHART_HEIGHT = 220;
|
|
6697
6860
|
var CHART_WIDTH = 800;
|
|
6698
6861
|
var PAD_BOTTOM = 30;
|
|
@@ -6726,11 +6889,11 @@ function scoreForPoint(point, area) {
|
|
|
6726
6889
|
return match?.totalScore ?? null;
|
|
6727
6890
|
}
|
|
6728
6891
|
function ScoreTimeline({ mode = null, source = null }) {
|
|
6729
|
-
const client =
|
|
6730
|
-
const [dataPoints, setDataPoints] =
|
|
6731
|
-
const [loading, setLoading] =
|
|
6732
|
-
const [rangeDays, setRangeDays] =
|
|
6733
|
-
const [selectedArea, setSelectedArea] =
|
|
6892
|
+
const client = useClient13({ apiVersion: API_VERSION });
|
|
6893
|
+
const [dataPoints, setDataPoints] = useState16([]);
|
|
6894
|
+
const [loading, setLoading] = useState16(true);
|
|
6895
|
+
const [rangeDays, setRangeDays] = useState16(30);
|
|
6896
|
+
const [selectedArea, setSelectedArea] = useState16(null);
|
|
6734
6897
|
const areaNames = useMemo8(() => {
|
|
6735
6898
|
const names = /* @__PURE__ */ new Set();
|
|
6736
6899
|
for (const dp of dataPoints) {
|
|
@@ -6740,7 +6903,7 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
6740
6903
|
}
|
|
6741
6904
|
return Array.from(names).sort();
|
|
6742
6905
|
}, [dataPoints]);
|
|
6743
|
-
const fetchData =
|
|
6906
|
+
const fetchData = useCallback21(async () => {
|
|
6744
6907
|
setLoading(true);
|
|
6745
6908
|
try {
|
|
6746
6909
|
const startDate = rangeDays ? daysAgo(rangeDays) : "1970-01-01T00:00:00Z";
|
|
@@ -6755,7 +6918,7 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
6755
6918
|
setLoading(false);
|
|
6756
6919
|
}
|
|
6757
6920
|
}, [client, mode, rangeDays, source]);
|
|
6758
|
-
|
|
6921
|
+
useEffect10(() => {
|
|
6759
6922
|
void fetchData();
|
|
6760
6923
|
}, [fetchData]);
|
|
6761
6924
|
const chartPoints = useMemo8(() => {
|
|
@@ -6776,14 +6939,14 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
6776
6939
|
if (chartPoints.length === 0) return 0;
|
|
6777
6940
|
return chartPoints.reduce((sum, p) => sum + p.score, 0) / chartPoints.length;
|
|
6778
6941
|
}, [chartPoints]);
|
|
6779
|
-
const handleRangeChange =
|
|
6942
|
+
const handleRangeChange = useCallback21(
|
|
6780
6943
|
(e) => {
|
|
6781
6944
|
const val = e.currentTarget.value;
|
|
6782
6945
|
setRangeDays(val === "all" ? null : Number(val));
|
|
6783
6946
|
},
|
|
6784
6947
|
[]
|
|
6785
6948
|
);
|
|
6786
|
-
const handleAreaChange =
|
|
6949
|
+
const handleAreaChange = useCallback21(
|
|
6787
6950
|
(e) => {
|
|
6788
6951
|
const val = e.currentTarget.value;
|
|
6789
6952
|
setSelectedArea(val || null);
|
|
@@ -6791,22 +6954,22 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
6791
6954
|
[]
|
|
6792
6955
|
);
|
|
6793
6956
|
const polylinePoints = chartPoints.map((p) => `${p.x},${p.y}`).join(" ");
|
|
6794
|
-
return /* @__PURE__ */
|
|
6795
|
-
/* @__PURE__ */
|
|
6796
|
-
/* @__PURE__ */
|
|
6957
|
+
return /* @__PURE__ */ jsxs36(Stack26, { space: 4, children: [
|
|
6958
|
+
/* @__PURE__ */ jsxs36(Flex28, { gap: 3, children: [
|
|
6959
|
+
/* @__PURE__ */ jsx49(
|
|
6797
6960
|
Select2,
|
|
6798
6961
|
{
|
|
6799
6962
|
onChange: handleRangeChange,
|
|
6800
6963
|
value: rangeDays?.toString() ?? "all",
|
|
6801
|
-
children: TIME_RANGES.map((r) => /* @__PURE__ */
|
|
6964
|
+
children: TIME_RANGES.map((r) => /* @__PURE__ */ jsx49("option", { value: r.days?.toString() ?? "all", children: r.label }, r.label))
|
|
6802
6965
|
}
|
|
6803
6966
|
),
|
|
6804
|
-
/* @__PURE__ */
|
|
6805
|
-
/* @__PURE__ */
|
|
6806
|
-
areaNames.map((name) => /* @__PURE__ */
|
|
6967
|
+
/* @__PURE__ */ jsxs36(Select2, { onChange: handleAreaChange, value: selectedArea ?? "", children: [
|
|
6968
|
+
/* @__PURE__ */ jsx49("option", { value: "", children: "Overall" }),
|
|
6969
|
+
areaNames.map((name) => /* @__PURE__ */ jsx49("option", { value: name, children: name }, name))
|
|
6807
6970
|
] })
|
|
6808
6971
|
] }),
|
|
6809
|
-
/* @__PURE__ */
|
|
6972
|
+
/* @__PURE__ */ jsx49(Card24, { padding: 3, radius: 2, shadow: 1, children: loading ? /* @__PURE__ */ jsx49(Flex28, { align: "center", justify: "center", style: { height: 200 }, children: /* @__PURE__ */ jsx49(Text35, { muted: true, size: 2, children: "Loading\u2026" }) }) : chartPoints.length === 0 ? /* @__PURE__ */ jsx49(Flex28, { align: "center", justify: "center", style: { height: 200 }, children: /* @__PURE__ */ jsx49(Text35, { muted: true, size: 2, children: "No reports found for this time range" }) }) : /* @__PURE__ */ jsxs36(
|
|
6810
6973
|
"svg",
|
|
6811
6974
|
{
|
|
6812
6975
|
style: { display: "block", width: "100%" },
|
|
@@ -6814,8 +6977,8 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
6814
6977
|
children: [
|
|
6815
6978
|
Y_TICKS.map((tick) => {
|
|
6816
6979
|
const y = PAD_TOP + PLOT_HEIGHT - tick / Y_MAX * PLOT_HEIGHT;
|
|
6817
|
-
return /* @__PURE__ */
|
|
6818
|
-
/* @__PURE__ */
|
|
6980
|
+
return /* @__PURE__ */ jsxs36("g", { children: [
|
|
6981
|
+
/* @__PURE__ */ jsx49(
|
|
6819
6982
|
"line",
|
|
6820
6983
|
{
|
|
6821
6984
|
stroke: "#ccc",
|
|
@@ -6826,7 +6989,7 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
6826
6989
|
y2: y
|
|
6827
6990
|
}
|
|
6828
6991
|
),
|
|
6829
|
-
/* @__PURE__ */
|
|
6992
|
+
/* @__PURE__ */ jsx49(
|
|
6830
6993
|
"text",
|
|
6831
6994
|
{
|
|
6832
6995
|
dominantBaseline: "middle",
|
|
@@ -6846,7 +7009,7 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
6846
7009
|
chartPoints.length - 1
|
|
6847
7010
|
].map((idx) => {
|
|
6848
7011
|
const p = chartPoints[idx];
|
|
6849
|
-
return /* @__PURE__ */
|
|
7012
|
+
return /* @__PURE__ */ jsx49(
|
|
6850
7013
|
"text",
|
|
6851
7014
|
{
|
|
6852
7015
|
fill: "#999",
|
|
@@ -6858,7 +7021,7 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
6858
7021
|
},
|
|
6859
7022
|
idx
|
|
6860
7023
|
);
|
|
6861
|
-
}) : chartPoints.map((p, idx) => /* @__PURE__ */
|
|
7024
|
+
}) : chartPoints.map((p, idx) => /* @__PURE__ */ jsx49(
|
|
6862
7025
|
"text",
|
|
6863
7026
|
{
|
|
6864
7027
|
fill: "#999",
|
|
@@ -6870,7 +7033,7 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
6870
7033
|
},
|
|
6871
7034
|
idx
|
|
6872
7035
|
)),
|
|
6873
|
-
/* @__PURE__ */
|
|
7036
|
+
/* @__PURE__ */ jsx49(
|
|
6874
7037
|
"polyline",
|
|
6875
7038
|
{
|
|
6876
7039
|
fill: "none",
|
|
@@ -6880,7 +7043,7 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
6880
7043
|
strokeWidth: 2.5
|
|
6881
7044
|
}
|
|
6882
7045
|
),
|
|
6883
|
-
chartPoints.map((p, idx) => /* @__PURE__ */
|
|
7046
|
+
chartPoints.map((p, idx) => /* @__PURE__ */ jsx49(
|
|
6884
7047
|
"circle",
|
|
6885
7048
|
{
|
|
6886
7049
|
cx: p.x,
|
|
@@ -6889,7 +7052,7 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
6889
7052
|
r: 4,
|
|
6890
7053
|
stroke: "#fff",
|
|
6891
7054
|
strokeWidth: 1.5,
|
|
6892
|
-
children: /* @__PURE__ */
|
|
7055
|
+
children: /* @__PURE__ */ jsxs36("title", { children: [
|
|
6893
7056
|
formatDate2(p.date),
|
|
6894
7057
|
": ",
|
|
6895
7058
|
Math.round(p.score)
|
|
@@ -6900,7 +7063,7 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
6900
7063
|
]
|
|
6901
7064
|
}
|
|
6902
7065
|
) }),
|
|
6903
|
-
/* @__PURE__ */
|
|
7066
|
+
/* @__PURE__ */ jsxs36(Text35, { muted: true, size: 2, children: [
|
|
6904
7067
|
chartPoints.length,
|
|
6905
7068
|
" data point",
|
|
6906
7069
|
chartPoints.length !== 1 ? "s" : ""
|
|
@@ -6910,19 +7073,19 @@ function ScoreTimeline({ mode = null, source = null }) {
|
|
|
6910
7073
|
var ScoreTimeline_default = ScoreTimeline;
|
|
6911
7074
|
|
|
6912
7075
|
// src/components/Dashboard.tsx
|
|
6913
|
-
import { jsx as
|
|
7076
|
+
import { jsx as jsx50, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
6914
7077
|
var VIEW_PARAM_MAP = {
|
|
6915
7078
|
compare: "compare",
|
|
6916
7079
|
timeline: "timeline"
|
|
6917
7080
|
};
|
|
6918
7081
|
function Dashboard() {
|
|
6919
|
-
const client =
|
|
6920
|
-
const router =
|
|
7082
|
+
const client = useClient14({ apiVersion: API_VERSION });
|
|
7083
|
+
const router = useRouter2();
|
|
6921
7084
|
const routerState = router.state;
|
|
6922
7085
|
const reportId = routerState.reportId ?? null;
|
|
6923
7086
|
const isDetail = reportId !== null;
|
|
6924
7087
|
const activeTab = isDetail ? "latest" : VIEW_PARAM_MAP[routerState.view ?? ""] ?? "latest";
|
|
6925
|
-
const navigateToTab =
|
|
7088
|
+
const navigateToTab = useCallback22(
|
|
6926
7089
|
(tab) => {
|
|
6927
7090
|
if (tab === "latest") {
|
|
6928
7091
|
router.navigate({});
|
|
@@ -6932,13 +7095,13 @@ function Dashboard() {
|
|
|
6932
7095
|
},
|
|
6933
7096
|
[router]
|
|
6934
7097
|
);
|
|
6935
|
-
const handleSelectReport =
|
|
7098
|
+
const handleSelectReport = useCallback22(
|
|
6936
7099
|
(id) => {
|
|
6937
7100
|
router.navigate({ reportId: id });
|
|
6938
7101
|
},
|
|
6939
7102
|
[router]
|
|
6940
7103
|
);
|
|
6941
|
-
const handleTabChange =
|
|
7104
|
+
const handleTabChange = useCallback22(
|
|
6942
7105
|
(tab) => {
|
|
6943
7106
|
if (!routerState.reportId) return;
|
|
6944
7107
|
if (tab) {
|
|
@@ -6949,52 +7112,52 @@ function Dashboard() {
|
|
|
6949
7112
|
},
|
|
6950
7113
|
[router, routerState.reportId]
|
|
6951
7114
|
);
|
|
6952
|
-
const handleBack =
|
|
7115
|
+
const handleBack = useCallback22(() => {
|
|
6953
7116
|
router.navigate({});
|
|
6954
7117
|
}, [router]);
|
|
6955
|
-
const [source, setSource] =
|
|
6956
|
-
const [mode, setMode] =
|
|
6957
|
-
const [sources, setSources] =
|
|
6958
|
-
const [modes, setModes] =
|
|
6959
|
-
|
|
7118
|
+
const [source, setSource] = useState17(null);
|
|
7119
|
+
const [mode, setMode] = useState17(null);
|
|
7120
|
+
const [sources, setSources] = useState17([]);
|
|
7121
|
+
const [modes, setModes] = useState17([]);
|
|
7122
|
+
useEffect11(() => {
|
|
6960
7123
|
client.fetch(distinctSourcesQuery).then((data) => setSources(data ?? [])).catch(() => setSources([]));
|
|
6961
7124
|
client.fetch(distinctModesQuery).then((data) => setModes(data ?? [])).catch(() => setModes([]));
|
|
6962
7125
|
}, [client]);
|
|
6963
|
-
return /* @__PURE__ */
|
|
6964
|
-
/* @__PURE__ */
|
|
6965
|
-
/* @__PURE__ */
|
|
6966
|
-
/* @__PURE__ */
|
|
6967
|
-
/* @__PURE__ */
|
|
7126
|
+
return /* @__PURE__ */ jsx50(Container, { width: 2, children: /* @__PURE__ */ jsxs37(Stack27, { padding: 4, space: 4, children: [
|
|
7127
|
+
/* @__PURE__ */ jsxs37(Flex29, { align: "center", gap: 3, children: [
|
|
7128
|
+
/* @__PURE__ */ jsxs37(Stack27, { flex: 1, space: 1, children: [
|
|
7129
|
+
/* @__PURE__ */ jsx50(Text36, { size: 4, weight: "bold", children: "AI Literacy Framework" }),
|
|
7130
|
+
/* @__PURE__ */ jsx50(Text36, { muted: true, size: 2, children: "Evaluation reports and score trends" })
|
|
6968
7131
|
] }),
|
|
6969
|
-
!isDetail && /* @__PURE__ */
|
|
6970
|
-
/* @__PURE__ */
|
|
7132
|
+
!isDetail && /* @__PURE__ */ jsxs37(Flex29, { gap: 2, children: [
|
|
7133
|
+
/* @__PURE__ */ jsxs37(
|
|
6971
7134
|
Select3,
|
|
6972
7135
|
{
|
|
6973
7136
|
fontSize: 2,
|
|
6974
7137
|
onChange: (e) => setSource(e.currentTarget.value || null),
|
|
6975
7138
|
value: source ?? "",
|
|
6976
7139
|
children: [
|
|
6977
|
-
/* @__PURE__ */
|
|
6978
|
-
sources.map((s) => /* @__PURE__ */
|
|
7140
|
+
/* @__PURE__ */ jsx50("option", { value: "", children: "All sources" }),
|
|
7141
|
+
sources.map((s) => /* @__PURE__ */ jsx50("option", { value: s, children: s }, s))
|
|
6979
7142
|
]
|
|
6980
7143
|
}
|
|
6981
7144
|
),
|
|
6982
|
-
/* @__PURE__ */
|
|
7145
|
+
/* @__PURE__ */ jsxs37(
|
|
6983
7146
|
Select3,
|
|
6984
7147
|
{
|
|
6985
7148
|
fontSize: 2,
|
|
6986
7149
|
onChange: (e) => setMode(e.currentTarget.value || null),
|
|
6987
7150
|
value: mode ?? "",
|
|
6988
7151
|
children: [
|
|
6989
|
-
/* @__PURE__ */
|
|
6990
|
-
modes.map((m) => /* @__PURE__ */
|
|
7152
|
+
/* @__PURE__ */ jsx50("option", { value: "", children: "All modes" }),
|
|
7153
|
+
modes.map((m) => /* @__PURE__ */ jsx50("option", { value: m, children: m }, m))
|
|
6991
7154
|
]
|
|
6992
7155
|
}
|
|
6993
7156
|
)
|
|
6994
7157
|
] })
|
|
6995
7158
|
] }),
|
|
6996
|
-
!isDetail && /* @__PURE__ */
|
|
6997
|
-
/* @__PURE__ */
|
|
7159
|
+
!isDetail && /* @__PURE__ */ jsxs37(TabList2, { space: 1, children: [
|
|
7160
|
+
/* @__PURE__ */ jsx50(
|
|
6998
7161
|
Tab2,
|
|
6999
7162
|
{
|
|
7000
7163
|
"aria-controls": "latest-panel",
|
|
@@ -7004,7 +7167,7 @@ function Dashboard() {
|
|
|
7004
7167
|
selected: activeTab === "latest"
|
|
7005
7168
|
}
|
|
7006
7169
|
),
|
|
7007
|
-
/* @__PURE__ */
|
|
7170
|
+
/* @__PURE__ */ jsx50(
|
|
7008
7171
|
Tab2,
|
|
7009
7172
|
{
|
|
7010
7173
|
"aria-controls": "timeline-panel",
|
|
@@ -7014,7 +7177,7 @@ function Dashboard() {
|
|
|
7014
7177
|
selected: activeTab === "timeline"
|
|
7015
7178
|
}
|
|
7016
7179
|
),
|
|
7017
|
-
/* @__PURE__ */
|
|
7180
|
+
/* @__PURE__ */ jsx50(
|
|
7018
7181
|
Tab2,
|
|
7019
7182
|
{
|
|
7020
7183
|
"aria-controls": "compare-panel",
|
|
@@ -7025,7 +7188,7 @@ function Dashboard() {
|
|
|
7025
7188
|
}
|
|
7026
7189
|
)
|
|
7027
7190
|
] }),
|
|
7028
|
-
!isDetail && activeTab === "latest" && /* @__PURE__ */
|
|
7191
|
+
!isDetail && activeTab === "latest" && /* @__PURE__ */ jsx50(TabPanel2, { "aria-labelledby": "latest-tab", id: "latest-panel", children: /* @__PURE__ */ jsx50(
|
|
7029
7192
|
LatestReports,
|
|
7030
7193
|
{
|
|
7031
7194
|
mode,
|
|
@@ -7033,9 +7196,9 @@ function Dashboard() {
|
|
|
7033
7196
|
source
|
|
7034
7197
|
}
|
|
7035
7198
|
) }),
|
|
7036
|
-
!isDetail && activeTab === "timeline" && /* @__PURE__ */
|
|
7037
|
-
!isDetail && activeTab === "compare" && /* @__PURE__ */
|
|
7038
|
-
isDetail && reportId && /* @__PURE__ */
|
|
7199
|
+
!isDetail && activeTab === "timeline" && /* @__PURE__ */ jsx50(TabPanel2, { "aria-labelledby": "timeline-tab", id: "timeline-panel", children: /* @__PURE__ */ jsx50(ScoreTimeline_default, { mode, source }) }),
|
|
7200
|
+
!isDetail && activeTab === "compare" && /* @__PURE__ */ jsx50(TabPanel2, { "aria-labelledby": "compare-tab", id: "compare-panel", children: /* @__PURE__ */ jsx50(ComparisonView, {}) }),
|
|
7201
|
+
isDetail && reportId && /* @__PURE__ */ jsx50(
|
|
7039
7202
|
ReportDetail,
|
|
7040
7203
|
{
|
|
7041
7204
|
activeTab: routerState.tab ?? null,
|
|
@@ -7065,10 +7228,10 @@ function ailfTool(options = {}) {
|
|
|
7065
7228
|
// src/actions/RunEvaluationAction.tsx
|
|
7066
7229
|
import { BarChartIcon as BarChartIcon2 } from "@sanity/icons";
|
|
7067
7230
|
import { useToast as useToast8 } from "@sanity/ui";
|
|
7068
|
-
import { useCallback as
|
|
7231
|
+
import { useCallback as useCallback23, useEffect as useEffect12, useRef as useRef5, useState as useState18 } from "react";
|
|
7069
7232
|
import {
|
|
7070
7233
|
getReleaseIdFromReleaseDocumentId as getReleaseIdFromReleaseDocumentId4,
|
|
7071
|
-
useClient as
|
|
7234
|
+
useClient as useClient15,
|
|
7072
7235
|
useCurrentUser as useCurrentUser3,
|
|
7073
7236
|
useDataset as useDataset2,
|
|
7074
7237
|
useProjectId as useProjectId2
|
|
@@ -7091,15 +7254,15 @@ function createRunEvaluationAction(options = {}) {
|
|
|
7091
7254
|
const { mode = "baseline" } = options;
|
|
7092
7255
|
const RunEvaluationAction = (props) => {
|
|
7093
7256
|
const { release } = props;
|
|
7094
|
-
const client =
|
|
7257
|
+
const client = useClient15({ apiVersion: API_VERSION2 });
|
|
7095
7258
|
const dataset = useDataset2();
|
|
7096
7259
|
const projectId = useProjectId2();
|
|
7097
7260
|
const currentUser = useCurrentUser3();
|
|
7098
7261
|
const toast = useToast8();
|
|
7099
|
-
const [state, setState] =
|
|
7262
|
+
const [state, setState] = useState18({ status: "loading" });
|
|
7100
7263
|
const requestedAtRef = useRef5(null);
|
|
7101
7264
|
const perspectiveId = getReleaseIdFromReleaseDocumentId4(release._id);
|
|
7102
|
-
|
|
7265
|
+
useEffect12(() => {
|
|
7103
7266
|
let cancelled = false;
|
|
7104
7267
|
client.fetch(contentImpactQuery, buildReportQueryParams(perspectiveId)).then((results) => {
|
|
7105
7268
|
if (cancelled) return;
|
|
@@ -7122,7 +7285,7 @@ function createRunEvaluationAction(options = {}) {
|
|
|
7122
7285
|
cancelled = true;
|
|
7123
7286
|
};
|
|
7124
7287
|
}, [client, perspectiveId]);
|
|
7125
|
-
|
|
7288
|
+
useEffect12(() => {
|
|
7126
7289
|
if (state.status !== "requested" && state.status !== "polling") return;
|
|
7127
7290
|
const { requestId, startedAt } = state;
|
|
7128
7291
|
if (state.status === "requested") {
|
|
@@ -7172,7 +7335,7 @@ function createRunEvaluationAction(options = {}) {
|
|
|
7172
7335
|
}, POLL_INTERVAL_MS2);
|
|
7173
7336
|
return () => clearInterval(interval);
|
|
7174
7337
|
}, [client, perspectiveId, state]);
|
|
7175
|
-
|
|
7338
|
+
useEffect12(() => {
|
|
7176
7339
|
if (state.status !== "error") return;
|
|
7177
7340
|
const timer = setTimeout(() => {
|
|
7178
7341
|
client.fetch(contentImpactQuery, buildReportQueryParams(perspectiveId)).then((results) => {
|
|
@@ -7192,7 +7355,7 @@ function createRunEvaluationAction(options = {}) {
|
|
|
7192
7355
|
}, 15e3);
|
|
7193
7356
|
return () => clearTimeout(timer);
|
|
7194
7357
|
}, [client, perspectiveId, state]);
|
|
7195
|
-
const handleRequest =
|
|
7358
|
+
const handleRequest = useCallback23(async () => {
|
|
7196
7359
|
const releaseTitle = release.metadata?.title ?? perspectiveId ?? "release";
|
|
7197
7360
|
const tag = `release-${slugify3(releaseTitle)}-${dateStamp3()}`;
|
|
7198
7361
|
const now = Date.now();
|