@sanity/ailf-studio 0.1.6 → 0.1.8

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.js CHANGED
@@ -600,6 +600,50 @@ var reportSchema = defineType4({
600
600
  title: "Average Infrastructure Efficiency",
601
601
  description: "Average actual / ceiling across areas. Only present in full-mode reports.",
602
602
  type: "number"
603
+ }),
604
+ defineField4({
605
+ description: "Aggregate agent behavior stats across all feature areas. Only present in agentic/full-mode reports.",
606
+ fields: [
607
+ defineField4({
608
+ name: "avgDocPagesVisited",
609
+ title: "Avg Doc Pages Visited",
610
+ description: "Average number of documentation pages visited per test across all areas.",
611
+ type: "number"
612
+ }),
613
+ defineField4({
614
+ name: "avgSearchesPerformed",
615
+ title: "Avg Searches Performed",
616
+ description: "Average number of searches performed per test across all areas.",
617
+ type: "number"
618
+ }),
619
+ defineField4({
620
+ name: "avgNetworkTimeMs",
621
+ title: "Avg Network Time (ms)",
622
+ description: "Average network time in milliseconds per test across all areas.",
623
+ type: "number"
624
+ }),
625
+ defineField4({
626
+ name: "testsWithBehaviorData",
627
+ title: "Tests With Behavior Data",
628
+ description: "Total number of tests that reported agent behavior data.",
629
+ type: "number"
630
+ }),
631
+ defineField4({
632
+ name: "totalUniqueDocSlugs",
633
+ title: "Total Unique Doc Slugs",
634
+ description: "Total number of unique documentation slugs visited across all tests.",
635
+ type: "number"
636
+ }),
637
+ defineField4({
638
+ name: "totalUniqueSearchQueries",
639
+ title: "Total Unique Search Queries",
640
+ description: "Total number of unique search queries performed across all tests.",
641
+ type: "number"
642
+ })
643
+ ],
644
+ name: "agentBehavior",
645
+ title: "Agent Behavior",
646
+ type: "object"
603
647
  })
604
648
  ],
605
649
  name: "overall",
@@ -1000,6 +1044,69 @@ var reportSchema = defineType4({
1000
1044
  ],
1001
1045
  title: "Per-Model Scores",
1002
1046
  type: "array"
1047
+ }),
1048
+ defineField4({
1049
+ description: "Per-feature agent behavior data from agentic evaluations \u2014 doc pages visited, searches performed, network time.",
1050
+ name: "agentBehavior",
1051
+ of: [
1052
+ {
1053
+ fields: [
1054
+ defineField4({
1055
+ name: "feature",
1056
+ title: "Feature",
1057
+ type: "string"
1058
+ }),
1059
+ defineField4({
1060
+ name: "avgDocPagesVisited",
1061
+ title: "Avg Doc Pages Visited",
1062
+ description: "Average number of documentation pages visited per test in this feature area.",
1063
+ type: "number"
1064
+ }),
1065
+ defineField4({
1066
+ name: "avgSearchesPerformed",
1067
+ title: "Avg Searches Performed",
1068
+ description: "Average number of searches performed per test in this feature area.",
1069
+ type: "number"
1070
+ }),
1071
+ defineField4({
1072
+ name: "avgNetworkTimeMs",
1073
+ title: "Avg Network Time (ms)",
1074
+ description: "Average network time in milliseconds per test in this feature area.",
1075
+ type: "number"
1076
+ }),
1077
+ defineField4({
1078
+ name: "docSlugsVisited",
1079
+ of: [{ type: "string" }],
1080
+ title: "Doc Slugs Visited",
1081
+ description: "Unique documentation slugs visited across all tests in this feature area.",
1082
+ type: "array"
1083
+ }),
1084
+ defineField4({
1085
+ name: "searchQueries",
1086
+ of: [{ type: "string" }],
1087
+ title: "Search Queries",
1088
+ description: "Unique search queries performed across all tests in this feature area.",
1089
+ type: "array"
1090
+ }),
1091
+ defineField4({
1092
+ name: "externalDomains",
1093
+ of: [{ type: "string" }],
1094
+ title: "External Domains",
1095
+ description: "External domains accessed by the agent during evaluation of this feature area.",
1096
+ type: "array"
1097
+ }),
1098
+ defineField4({
1099
+ name: "tasksWithBehaviorData",
1100
+ title: "Tasks With Behavior Data",
1101
+ description: "Number of tasks in this feature area that reported agent behavior data.",
1102
+ type: "number"
1103
+ })
1104
+ ],
1105
+ type: "object"
1106
+ }
1107
+ ],
1108
+ title: "Agent Behavior",
1109
+ type: "array"
1003
1110
  })
1004
1111
  ],
1005
1112
  group: ["main", "all-fields"],
@@ -2333,15 +2440,15 @@ import { route } from "sanity/router";
2333
2440
  // src/components/Dashboard.tsx
2334
2441
  import {
2335
2442
  Container,
2336
- Flex as Flex25,
2443
+ Flex as Flex26,
2337
2444
  Select as Select3,
2338
- Stack as Stack24,
2339
- Tab,
2340
- TabList,
2341
- TabPanel,
2342
- Text as Text33
2445
+ Stack as Stack25,
2446
+ Tab as Tab2,
2447
+ TabList as TabList2,
2448
+ TabPanel as TabPanel2,
2449
+ Text as Text34
2343
2450
  } from "@sanity/ui";
2344
- import { useCallback as useCallback14, useEffect as useEffect9, useState as useState10 } from "react";
2451
+ import { useCallback as useCallback14, useEffect as useEffect9, useState as useState11 } from "react";
2345
2452
  import { useClient as useClient8 } from "sanity";
2346
2453
  import { useRouter } from "sanity/router";
2347
2454
 
@@ -2630,6 +2737,16 @@ var GLOSSARY = {
2630
2737
  failureMode: "The type of documentation problem: missing-docs (functionality not covered), incorrect-docs (factual errors), outdated-docs (stale API/patterns), or poor-structure (hard to find/understand).",
2631
2738
  estimatedLift: "Estimated composite score improvement if this gap is fully fixed. Based on raising bottleneck dimensions to the median of non-bottlenecked dimensions.",
2632
2739
  confidence: "How confident the classifier is in this diagnosis. High = strong keyword + structural signal agreement. Medium = partial agreement. Low = weak signals only.",
2740
+ // -- Agent behavior --------------------------------------------------------
2741
+ agentBehaviorOverview: "How AI agents interacted with your documentation during evaluation: what they searched for, which pages they visited, and how much time they spent on network requests.",
2742
+ searchQueries: "The exact search queries agents used to find documentation. Helps you understand how agents discover your content and whether your docs appear for relevant queries.",
2743
+ docSlugsVisited: "Documentation page slugs that agents actually visited during evaluation. Compare against canonical docs to see if agents found the right pages.",
2744
+ externalDomains: "Non-Sanity domains that agents contacted during evaluation. High external domain counts may indicate agents couldn't find what they needed in your docs.",
2745
+ avgDocPagesVisited: "Average number of documentation pages visited per test. Higher counts can mean agents need to consult many pages (complex task) or can't find the right one quickly.",
2746
+ avgSearchesPerformed: "Average number of web searches performed per test. High search counts can indicate docs are hard to discover through search engines.",
2747
+ avgNetworkTimeMs: "Average time spent on network requests per test. Includes page fetches, search queries, and API calls.",
2748
+ totalRequests: "Total number of HTTP requests the agent made during the test, including searches, page visits, and API calls.",
2749
+ totalBytesDownloaded: "Total bytes downloaded by the agent. Large downloads may indicate the agent is fetching many pages or very large documents.",
2633
2750
  // -- Dimension deltas -----------------------------------------------------
2634
2751
  dimTaskCompletion: "Change in task completion between runs. Positive means implementations are more complete.",
2635
2752
  dimCodeCorrectness: "Change in code correctness between runs. Positive means better code quality.",
@@ -4343,28 +4460,297 @@ function getDateThreshold(preset) {
4343
4460
 
4344
4461
  // src/components/report-detail/ReportDetail.tsx
4345
4462
  import { ArrowLeftIcon as ArrowLeftIcon2 } from "@sanity/icons";
4346
- import { Box as Box14, Button as Button3, Stack as Stack22, Text as Text31, useToast } from "@sanity/ui";
4347
- import { useCallback as useCallback12, useEffect as useEffect7, useState as useState8 } from "react";
4463
+ import { Box as Box15, Button as Button3, Stack as Stack23, Tab, TabList, TabPanel, Text as Text32 } from "@sanity/ui";
4464
+ import { useCallback as useCallback12, useEffect as useEffect7, useMemo as useMemo7, useState as useState9 } from "react";
4348
4465
  import { useClient as useClient6 } from "sanity";
4349
4466
 
4467
+ // src/components/report-detail/AgentActivitySection.tsx
4468
+ import { useMemo as useMemo6, useState as useState7 } from "react";
4469
+ import { HelpCircleIcon as HelpCircleIcon5, SearchIcon as SearchIcon5 } from "@sanity/icons";
4470
+ import {
4471
+ Badge as Badge14,
4472
+ Box as Box10,
4473
+ Card as Card14,
4474
+ Flex as Flex18,
4475
+ Grid as Grid2,
4476
+ Stack as Stack15,
4477
+ Text as Text23,
4478
+ TextInput,
4479
+ Tooltip as Tooltip4
4480
+ } from "@sanity/ui";
4481
+
4482
+ // src/components/primitives/StatCard.tsx
4483
+ import { HelpCircleIcon as HelpCircleIcon4 } from "@sanity/icons";
4484
+ import { Box as Box9, Card as Card13, Stack as Stack14, Text as Text22, Tooltip as Tooltip3 } from "@sanity/ui";
4485
+ import { Fragment as Fragment4, jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
4486
+ function StatCard({
4487
+ label,
4488
+ value,
4489
+ tooltip,
4490
+ suffix,
4491
+ tone = "default"
4492
+ }) {
4493
+ return /* @__PURE__ */ jsx25(Card13, { padding: 3, radius: 2, shadow: 1, tone, children: /* @__PURE__ */ jsxs22(Stack14, { space: 2, children: [
4494
+ /* @__PURE__ */ jsxs22(Text22, { muted: true, size: 1, children: [
4495
+ label,
4496
+ tooltip && /* @__PURE__ */ jsxs22(Fragment4, { children: [
4497
+ " ",
4498
+ /* @__PURE__ */ jsx25(
4499
+ Tooltip3,
4500
+ {
4501
+ content: /* @__PURE__ */ jsx25(Box9, { padding: 2, children: /* @__PURE__ */ jsx25(Text22, { size: 1, children: tooltip }) }),
4502
+ portal: true,
4503
+ children: /* @__PURE__ */ jsx25("span", { style: { cursor: "help" }, children: /* @__PURE__ */ jsx25(HelpCircleIcon4, {}) })
4504
+ }
4505
+ )
4506
+ ] })
4507
+ ] }),
4508
+ /* @__PURE__ */ jsxs22(Text22, { size: 3, weight: "bold", children: [
4509
+ value,
4510
+ suffix && /* @__PURE__ */ jsxs22("span", { style: { fontSize: "0.6em", fontWeight: 400 }, children: [
4511
+ " ",
4512
+ suffix
4513
+ ] })
4514
+ ] })
4515
+ ] }) });
4516
+ }
4517
+
4518
+ // src/components/report-detail/AgentActivitySection.tsx
4519
+ import { jsx as jsx26, jsxs as jsxs23 } from "react/jsx-runtime";
4520
+ function AgentActivitySection({
4521
+ agentBehavior,
4522
+ overall
4523
+ }) {
4524
+ return /* @__PURE__ */ jsxs23(Stack15, { space: 5, children: [
4525
+ overall && /* @__PURE__ */ jsx26(OverviewGrid, { overall }),
4526
+ agentBehavior.map((ab) => /* @__PURE__ */ jsx26(FeatureActivityCard, { behavior: ab }, ab.feature))
4527
+ ] });
4528
+ }
4529
+ function OverviewGrid({ overall }) {
4530
+ return /* @__PURE__ */ jsx26(Card14, { padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs23(Stack15, { space: 4, children: [
4531
+ /* @__PURE__ */ jsxs23(Flex18, { align: "center", gap: 3, children: [
4532
+ /* @__PURE__ */ jsx26(Text23, { size: 2, weight: "semibold", children: "Agent Activity Overview" }),
4533
+ /* @__PURE__ */ jsx26(GlossaryTip, { text: GLOSSARY.agentBehaviorOverview })
4534
+ ] }),
4535
+ /* @__PURE__ */ jsxs23(Grid2, { columns: [1, 2, 3], gap: 3, children: [
4536
+ /* @__PURE__ */ jsx26(
4537
+ StatCard,
4538
+ {
4539
+ label: "Avg Pages Visited",
4540
+ tooltip: GLOSSARY.avgDocPagesVisited,
4541
+ value: overall.avgDocPagesVisited.toFixed(1)
4542
+ }
4543
+ ),
4544
+ /* @__PURE__ */ jsx26(
4545
+ StatCard,
4546
+ {
4547
+ label: "Avg Searches",
4548
+ tooltip: GLOSSARY.avgSearchesPerformed,
4549
+ value: overall.avgSearchesPerformed.toFixed(1)
4550
+ }
4551
+ ),
4552
+ /* @__PURE__ */ jsx26(
4553
+ StatCard,
4554
+ {
4555
+ label: "Avg Network Time",
4556
+ tooltip: GLOSSARY.avgNetworkTimeMs,
4557
+ value: formatDuration(overall.avgNetworkTimeMs)
4558
+ }
4559
+ ),
4560
+ /* @__PURE__ */ jsx26(
4561
+ StatCard,
4562
+ {
4563
+ label: "Unique Doc Slugs",
4564
+ tooltip: GLOSSARY.docSlugsVisited,
4565
+ value: String(overall.totalUniqueDocSlugs)
4566
+ }
4567
+ ),
4568
+ /* @__PURE__ */ jsx26(
4569
+ StatCard,
4570
+ {
4571
+ label: "Unique Search Queries",
4572
+ tooltip: GLOSSARY.searchQueries,
4573
+ value: String(overall.totalUniqueSearchQueries)
4574
+ }
4575
+ ),
4576
+ /* @__PURE__ */ jsx26(
4577
+ StatCard,
4578
+ {
4579
+ label: "Tests with Data",
4580
+ value: String(overall.testsWithBehaviorData)
4581
+ }
4582
+ )
4583
+ ] })
4584
+ ] }) });
4585
+ }
4586
+ function FeatureActivityCard({
4587
+ behavior
4588
+ }) {
4589
+ return /* @__PURE__ */ jsx26(Card14, { padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs23(Stack15, { space: 4, children: [
4590
+ /* @__PURE__ */ jsxs23(Flex18, { align: "center", gap: 3, wrap: "wrap", children: [
4591
+ /* @__PURE__ */ jsx26(Text23, { size: 2, weight: "semibold", children: behavior.feature }),
4592
+ /* @__PURE__ */ jsxs23(Badge14, { tone: "primary", children: [
4593
+ behavior.tasksWithBehaviorData,
4594
+ " test",
4595
+ behavior.tasksWithBehaviorData === 1 ? "" : "s"
4596
+ ] })
4597
+ ] }),
4598
+ /* @__PURE__ */ jsxs23(Grid2, { columns: [1, 3], gap: 3, children: [
4599
+ /* @__PURE__ */ jsx26(
4600
+ MiniStat,
4601
+ {
4602
+ label: "Avg pages visited",
4603
+ value: behavior.avgDocPagesVisited.toFixed(1)
4604
+ }
4605
+ ),
4606
+ /* @__PURE__ */ jsx26(
4607
+ MiniStat,
4608
+ {
4609
+ label: "Avg searches",
4610
+ value: behavior.avgSearchesPerformed.toFixed(1)
4611
+ }
4612
+ ),
4613
+ /* @__PURE__ */ jsx26(
4614
+ MiniStat,
4615
+ {
4616
+ label: "Avg network time",
4617
+ value: formatDuration(behavior.avgNetworkTimeMs)
4618
+ }
4619
+ )
4620
+ ] }),
4621
+ behavior.searchQueries.length > 0 && /* @__PURE__ */ jsx26(SearchQueryList, { queries: behavior.searchQueries }),
4622
+ behavior.docSlugsVisited.length > 0 && /* @__PURE__ */ jsx26(
4623
+ BadgeList,
4624
+ {
4625
+ items: behavior.docSlugsVisited,
4626
+ label: "Pages Visited",
4627
+ tone: "primary",
4628
+ tooltip: GLOSSARY.docSlugsVisited
4629
+ }
4630
+ ),
4631
+ behavior.externalDomains.length > 0 && /* @__PURE__ */ jsx26(
4632
+ BadgeList,
4633
+ {
4634
+ items: behavior.externalDomains,
4635
+ label: "External Domains",
4636
+ tone: "caution",
4637
+ tooltip: GLOSSARY.externalDomains
4638
+ }
4639
+ )
4640
+ ] }) });
4641
+ }
4642
+ function SearchQueryList({ queries }) {
4643
+ const [filter, setFilter] = useState7("");
4644
+ const filtered = useMemo6(() => {
4645
+ if (!filter) return queries;
4646
+ const lower = filter.toLowerCase();
4647
+ return queries.filter((q) => q.toLowerCase().includes(lower));
4648
+ }, [queries, filter]);
4649
+ return /* @__PURE__ */ jsxs23(Stack15, { space: 3, children: [
4650
+ /* @__PURE__ */ jsxs23(Flex18, { align: "center", gap: 3, wrap: "wrap", children: [
4651
+ /* @__PURE__ */ jsx26(Text23, { size: 1, weight: "semibold", children: "Search Queries" }),
4652
+ /* @__PURE__ */ jsx26(GlossaryTip, { text: GLOSSARY.searchQueries }),
4653
+ /* @__PURE__ */ jsx26(Badge14, { tone: "default", children: queries.length })
4654
+ ] }),
4655
+ queries.length > 5 && /* @__PURE__ */ jsx26(
4656
+ TextInput,
4657
+ {
4658
+ fontSize: 1,
4659
+ icon: SearchIcon5,
4660
+ onChange: (e) => setFilter(e.target.value),
4661
+ placeholder: "Filter queries\u2026",
4662
+ value: filter
4663
+ }
4664
+ ),
4665
+ /* @__PURE__ */ jsx26(
4666
+ Card14,
4667
+ {
4668
+ overflow: "auto",
4669
+ padding: 3,
4670
+ radius: 2,
4671
+ style: { maxHeight: 300 },
4672
+ tone: "transparent",
4673
+ children: /* @__PURE__ */ jsxs23(Stack15, { space: 2, children: [
4674
+ filtered.length === 0 && /* @__PURE__ */ jsx26(Text23, { muted: true, size: 1, children: "No matching queries" }),
4675
+ filtered.map((query, i) => /* @__PURE__ */ jsx26(
4676
+ Text23,
4677
+ {
4678
+ muted: true,
4679
+ size: 1,
4680
+ style: {
4681
+ fontFamily: "monospace",
4682
+ lineHeight: 1.5,
4683
+ wordBreak: "break-word"
4684
+ },
4685
+ children: query
4686
+ },
4687
+ `q-${i}`
4688
+ ))
4689
+ ] })
4690
+ }
4691
+ )
4692
+ ] });
4693
+ }
4694
+ function BadgeList({
4695
+ items,
4696
+ label,
4697
+ tone,
4698
+ tooltip
4699
+ }) {
4700
+ return /* @__PURE__ */ jsxs23(Stack15, { space: 3, children: [
4701
+ /* @__PURE__ */ jsxs23(Flex18, { align: "center", gap: 3, wrap: "wrap", children: [
4702
+ /* @__PURE__ */ jsx26(Text23, { size: 1, weight: "semibold", children: label }),
4703
+ tooltip && /* @__PURE__ */ jsx26(GlossaryTip, { text: tooltip }),
4704
+ /* @__PURE__ */ jsx26(Badge14, { tone: "default", children: items.length })
4705
+ ] }),
4706
+ /* @__PURE__ */ jsx26(Flex18, { gap: 2, wrap: "wrap", children: items.map((item) => /* @__PURE__ */ jsx26(Badge14, { mode: "outline", tone, children: item }, item)) })
4707
+ ] });
4708
+ }
4709
+ function MiniStat({ label, value }) {
4710
+ return /* @__PURE__ */ jsxs23(Stack15, { space: 1, children: [
4711
+ /* @__PURE__ */ jsx26(
4712
+ Text23,
4713
+ {
4714
+ muted: true,
4715
+ size: 0,
4716
+ style: { letterSpacing: "0.05em", textTransform: "uppercase" },
4717
+ weight: "semibold",
4718
+ children: label
4719
+ }
4720
+ ),
4721
+ /* @__PURE__ */ jsx26(Text23, { size: 2, weight: "bold", children: value })
4722
+ ] });
4723
+ }
4724
+ function GlossaryTip({ text }) {
4725
+ return /* @__PURE__ */ jsx26(
4726
+ Tooltip4,
4727
+ {
4728
+ content: /* @__PURE__ */ jsx26(Box10, { padding: 2, style: { maxWidth: 260 }, children: /* @__PURE__ */ jsx26(Text23, { size: 1, children: text }) }),
4729
+ placement: "bottom",
4730
+ portal: true,
4731
+ children: /* @__PURE__ */ jsx26(Text23, { muted: true, size: 0, children: /* @__PURE__ */ jsx26(HelpCircleIcon5, {}) })
4732
+ }
4733
+ );
4734
+ }
4735
+
4350
4736
  // src/components/report-detail/AreaScoreTable.tsx
4351
- import React from "react";
4352
- import { Card as Card14, Stack as Stack14, Text as Text23 } from "@sanity/ui";
4737
+ import React2 from "react";
4738
+ import { Card as Card16, Stack as Stack16, Text as Text25 } from "@sanity/ui";
4353
4739
 
4354
4740
  // src/components/primitives/ScoreCell.tsx
4355
- import { Card as Card13, Text as Text22 } from "@sanity/ui";
4356
- import { jsx as jsx25 } from "react/jsx-runtime";
4741
+ import { Card as Card15, Text as Text24 } from "@sanity/ui";
4742
+ import { jsx as jsx27 } from "react/jsx-runtime";
4357
4743
  function ScoreCell({ score, size = 1 }) {
4358
4744
  const rounded = Math.round(score);
4359
- return /* @__PURE__ */ jsx25(Card13, { padding: 1, radius: 2, tone: scoreTone(rounded), children: /* @__PURE__ */ jsx25(Text22, { align: "center", size, weight: "medium", children: rounded }) });
4745
+ return /* @__PURE__ */ jsx27(Card15, { padding: 1, radius: 2, tone: scoreTone(rounded), children: /* @__PURE__ */ jsx27(Text24, { align: "center", size, weight: "medium", children: rounded }) });
4360
4746
  }
4361
4747
 
4362
4748
  // src/components/report-detail/AreaScoreTable.tsx
4363
- import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
4749
+ import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
4364
4750
  function AreaScoreTable({ scores }) {
4365
- return /* @__PURE__ */ jsx26(Card14, { overflow: "auto", padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs22(Stack14, { space: 4, children: [
4366
- /* @__PURE__ */ jsx26(Text23, { size: 2, weight: "semibold", children: "Per-Area Scores" }),
4367
- /* @__PURE__ */ jsxs22(
4751
+ return /* @__PURE__ */ jsx28(Card16, { overflow: "auto", padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs24(Stack16, { space: 4, children: [
4752
+ /* @__PURE__ */ jsx28(Text25, { size: 2, weight: "semibold", children: "Per-Area Scores" }),
4753
+ /* @__PURE__ */ jsxs24(
4368
4754
  "div",
4369
4755
  {
4370
4756
  style: {
@@ -4373,9 +4759,9 @@ function AreaScoreTable({ scores }) {
4373
4759
  gridTemplateColumns: "2fr 1fr 1fr 1fr 1fr 1fr 1fr"
4374
4760
  },
4375
4761
  children: [
4376
- /* @__PURE__ */ jsx26(ColumnHeader, { borderBottom: true, label: "Area" }),
4377
- /* @__PURE__ */ jsx26(ColumnHeader, { borderBottom: true, label: "Score", tooltip: GLOSSARY.score }),
4378
- /* @__PURE__ */ jsx26(
4762
+ /* @__PURE__ */ jsx28(ColumnHeader, { borderBottom: true, label: "Area" }),
4763
+ /* @__PURE__ */ jsx28(ColumnHeader, { borderBottom: true, label: "Score", tooltip: GLOSSARY.score }),
4764
+ /* @__PURE__ */ jsx28(
4379
4765
  ColumnHeader,
4380
4766
  {
4381
4767
  borderBottom: true,
@@ -4383,7 +4769,7 @@ function AreaScoreTable({ scores }) {
4383
4769
  tooltip: GLOSSARY.taskCompletion
4384
4770
  }
4385
4771
  ),
4386
- /* @__PURE__ */ jsx26(
4772
+ /* @__PURE__ */ jsx28(
4387
4773
  ColumnHeader,
4388
4774
  {
4389
4775
  borderBottom: true,
@@ -4391,7 +4777,7 @@ function AreaScoreTable({ scores }) {
4391
4777
  tooltip: GLOSSARY.codeCorrectness
4392
4778
  }
4393
4779
  ),
4394
- /* @__PURE__ */ jsx26(
4780
+ /* @__PURE__ */ jsx28(
4395
4781
  ColumnHeader,
4396
4782
  {
4397
4783
  borderBottom: true,
@@ -4399,10 +4785,10 @@ function AreaScoreTable({ scores }) {
4399
4785
  tooltip: GLOSSARY.docCoverage
4400
4786
  }
4401
4787
  ),
4402
- /* @__PURE__ */ jsx26(ColumnHeader, { borderBottom: true, label: "Lift", tooltip: GLOSSARY.docLift }),
4403
- /* @__PURE__ */ jsx26(ColumnHeader, { borderBottom: true, label: "Tests", tooltip: GLOSSARY.tests }),
4404
- scores.map((score, i) => /* @__PURE__ */ jsxs22(React.Fragment, { children: [
4405
- /* @__PURE__ */ jsx26(
4788
+ /* @__PURE__ */ jsx28(ColumnHeader, { borderBottom: true, label: "Lift", tooltip: GLOSSARY.docLift }),
4789
+ /* @__PURE__ */ jsx28(ColumnHeader, { borderBottom: true, label: "Tests", tooltip: GLOSSARY.tests }),
4790
+ scores.map((score, i) => /* @__PURE__ */ jsxs24(React2.Fragment, { children: [
4791
+ /* @__PURE__ */ jsx28(
4406
4792
  "div",
4407
4793
  {
4408
4794
  style: {
@@ -4410,14 +4796,14 @@ function AreaScoreTable({ scores }) {
4410
4796
  borderRadius: 4,
4411
4797
  padding: "8px 0 8px 4px"
4412
4798
  },
4413
- children: /* @__PURE__ */ jsx26(Text23, { size: 1, weight: "medium", children: score.feature })
4799
+ children: /* @__PURE__ */ jsx28(Text25, { size: 1, weight: "medium", children: score.feature })
4414
4800
  }
4415
4801
  ),
4416
- /* @__PURE__ */ jsx26("div", { style: { background: rowBackground(i), padding: "6px 0" }, children: /* @__PURE__ */ jsx26(ScoreCell, { score: score.totalScore }) }),
4417
- /* @__PURE__ */ jsx26("div", { style: { background: rowBackground(i), padding: "6px 0" }, children: /* @__PURE__ */ jsx26(ScoreCell, { score: score.taskCompletion }) }),
4418
- /* @__PURE__ */ jsx26("div", { style: { background: rowBackground(i), padding: "6px 0" }, children: /* @__PURE__ */ jsx26(ScoreCell, { score: score.codeCorrectness }) }),
4419
- /* @__PURE__ */ jsx26("div", { style: { background: rowBackground(i), padding: "6px 0" }, children: /* @__PURE__ */ jsx26(ScoreCell, { score: score.docCoverage }) }),
4420
- /* @__PURE__ */ jsx26(
4802
+ /* @__PURE__ */ jsx28("div", { style: { background: rowBackground(i), padding: "6px 0" }, children: /* @__PURE__ */ jsx28(ScoreCell, { score: score.totalScore }) }),
4803
+ /* @__PURE__ */ jsx28("div", { style: { background: rowBackground(i), padding: "6px 0" }, children: /* @__PURE__ */ jsx28(ScoreCell, { score: score.taskCompletion }) }),
4804
+ /* @__PURE__ */ jsx28("div", { style: { background: rowBackground(i), padding: "6px 0" }, children: /* @__PURE__ */ jsx28(ScoreCell, { score: score.codeCorrectness }) }),
4805
+ /* @__PURE__ */ jsx28("div", { style: { background: rowBackground(i), padding: "6px 0" }, children: /* @__PURE__ */ jsx28(ScoreCell, { score: score.docCoverage }) }),
4806
+ /* @__PURE__ */ jsx28(
4421
4807
  "div",
4422
4808
  {
4423
4809
  style: {
@@ -4425,10 +4811,10 @@ function AreaScoreTable({ scores }) {
4425
4811
  background: rowBackground(i),
4426
4812
  display: "flex"
4427
4813
  },
4428
- children: /* @__PURE__ */ jsx26(Text23, { size: 1, children: formatDelta(score.docLift) })
4814
+ children: /* @__PURE__ */ jsx28(Text25, { size: 1, children: formatDelta(score.docLift) })
4429
4815
  }
4430
4816
  ),
4431
- /* @__PURE__ */ jsx26(
4817
+ /* @__PURE__ */ jsx28(
4432
4818
  "div",
4433
4819
  {
4434
4820
  style: {
@@ -4436,7 +4822,7 @@ function AreaScoreTable({ scores }) {
4436
4822
  background: rowBackground(i),
4437
4823
  display: "flex"
4438
4824
  },
4439
- children: /* @__PURE__ */ jsx26(Text23, { muted: true, size: 1, children: score.testCount })
4825
+ children: /* @__PURE__ */ jsx28(Text25, { muted: true, size: 1, children: score.testCount })
4440
4826
  }
4441
4827
  )
4442
4828
  ] }, score.feature))
@@ -4447,13 +4833,13 @@ function AreaScoreTable({ scores }) {
4447
4833
  }
4448
4834
 
4449
4835
  // src/components/report-detail/ComparisonSummary.tsx
4450
- import { Badge as Badge14, Box as Box9, Card as Card15, Flex as Flex18, Grid as Grid2, Stack as Stack15, Text as Text24, Tooltip as Tooltip3 } from "@sanity/ui";
4451
- import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
4836
+ import { Badge as Badge15, Box as Box11, Card as Card17, Flex as Flex19, Grid as Grid3, Stack as Stack17, Text as Text26, Tooltip as Tooltip5 } from "@sanity/ui";
4837
+ import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
4452
4838
  function ComparisonSummary({ comparison }) {
4453
- return /* @__PURE__ */ jsx27(Card15, { padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs23(Stack15, { space: 4, children: [
4454
- /* @__PURE__ */ jsxs23(Flex18, { align: "center", gap: 3, wrap: "wrap", children: [
4455
- /* @__PURE__ */ jsx27(Text24, { size: 2, weight: "semibold", children: "Comparison" }),
4456
- /* @__PURE__ */ jsx27(
4839
+ return /* @__PURE__ */ jsx29(Card17, { padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs25(Stack17, { space: 4, children: [
4840
+ /* @__PURE__ */ jsxs25(Flex19, { align: "center", gap: 3, wrap: "wrap", children: [
4841
+ /* @__PURE__ */ jsx29(Text26, { size: 2, weight: "semibold", children: "Comparison" }),
4842
+ /* @__PURE__ */ jsx29(
4457
4843
  DeltaCard,
4458
4844
  {
4459
4845
  delta: comparison.deltas.overall,
@@ -4461,7 +4847,7 @@ function ComparisonSummary({ comparison }) {
4461
4847
  tooltip: GLOSSARY.overallDelta
4462
4848
  }
4463
4849
  ),
4464
- comparison.deltas.actualDelta != null && /* @__PURE__ */ jsx27(
4850
+ comparison.deltas.actualDelta != null && /* @__PURE__ */ jsx29(
4465
4851
  DeltaCard,
4466
4852
  {
4467
4853
  delta: comparison.deltas.actualDelta,
@@ -4469,7 +4855,7 @@ function ComparisonSummary({ comparison }) {
4469
4855
  tooltip: GLOSSARY.actualDelta
4470
4856
  }
4471
4857
  ),
4472
- comparison.deltas.retrievalGapDelta != null && /* @__PURE__ */ jsx27(
4858
+ comparison.deltas.retrievalGapDelta != null && /* @__PURE__ */ jsx29(
4473
4859
  DeltaCard,
4474
4860
  {
4475
4861
  delta: comparison.deltas.retrievalGapDelta,
@@ -4479,8 +4865,8 @@ function ComparisonSummary({ comparison }) {
4479
4865
  }
4480
4866
  )
4481
4867
  ] }),
4482
- /* @__PURE__ */ jsxs23(Grid2, { columns: [1, 1, 3], gap: 3, children: [
4483
- comparison.improved.length > 0 && /* @__PURE__ */ jsx27(
4868
+ /* @__PURE__ */ jsxs25(Grid3, { columns: [1, 1, 3], gap: 3, children: [
4869
+ comparison.improved.length > 0 && /* @__PURE__ */ jsx29(
4484
4870
  AreaBadgeGroup,
4485
4871
  {
4486
4872
  areas: comparison.improved,
@@ -4488,7 +4874,7 @@ function ComparisonSummary({ comparison }) {
4488
4874
  tone: "positive"
4489
4875
  }
4490
4876
  ),
4491
- comparison.regressed.length > 0 && /* @__PURE__ */ jsx27(
4877
+ comparison.regressed.length > 0 && /* @__PURE__ */ jsx29(
4492
4878
  AreaBadgeGroup,
4493
4879
  {
4494
4880
  areas: comparison.regressed,
@@ -4496,7 +4882,7 @@ function ComparisonSummary({ comparison }) {
4496
4882
  tone: "critical"
4497
4883
  }
4498
4884
  ),
4499
- comparison.unchanged.length > 0 && /* @__PURE__ */ jsx27(
4885
+ comparison.unchanged.length > 0 && /* @__PURE__ */ jsx29(
4500
4886
  AreaBadgeGroup,
4501
4887
  {
4502
4888
  areas: comparison.unchanged,
@@ -4515,19 +4901,19 @@ function DeltaCard({
4515
4901
  }) {
4516
4902
  const isPositive = invertedPolarity ? delta < 0 : delta > 0;
4517
4903
  const isNegative = invertedPolarity ? delta > 0 : delta < 0;
4518
- return /* @__PURE__ */ jsx27(
4519
- Tooltip3,
4904
+ return /* @__PURE__ */ jsx29(
4905
+ Tooltip5,
4520
4906
  {
4521
- content: /* @__PURE__ */ jsx27(Box9, { padding: 2, style: { maxWidth: 260 }, children: /* @__PURE__ */ jsx27(Text24, { size: 1, children: tooltip }) }),
4907
+ content: /* @__PURE__ */ jsx29(Box11, { padding: 2, style: { maxWidth: 260 }, children: /* @__PURE__ */ jsx29(Text26, { size: 1, children: tooltip }) }),
4522
4908
  placement: "bottom",
4523
4909
  portal: true,
4524
- children: /* @__PURE__ */ jsx27(
4525
- Card15,
4910
+ children: /* @__PURE__ */ jsx29(
4911
+ Card17,
4526
4912
  {
4527
4913
  padding: 2,
4528
4914
  radius: 2,
4529
4915
  tone: isPositive ? "positive" : isNegative ? "critical" : "default",
4530
- children: /* @__PURE__ */ jsxs23(Text24, { size: 1, weight: "bold", children: [
4916
+ children: /* @__PURE__ */ jsxs25(Text26, { size: 1, weight: "bold", children: [
4531
4917
  formatDelta(delta),
4532
4918
  " ",
4533
4919
  label
@@ -4542,9 +4928,9 @@ function AreaBadgeGroup({
4542
4928
  label,
4543
4929
  tone
4544
4930
  }) {
4545
- return /* @__PURE__ */ jsxs23(Stack15, { space: 2, children: [
4546
- /* @__PURE__ */ jsx27(
4547
- Text24,
4931
+ return /* @__PURE__ */ jsxs25(Stack17, { space: 2, children: [
4932
+ /* @__PURE__ */ jsx29(
4933
+ Text26,
4548
4934
  {
4549
4935
  muted: true,
4550
4936
  size: 0,
@@ -4553,21 +4939,21 @@ function AreaBadgeGroup({
4553
4939
  children: label
4554
4940
  }
4555
4941
  ),
4556
- /* @__PURE__ */ jsx27(Flex18, { gap: 1, wrap: "wrap", children: areas.map((a) => /* @__PURE__ */ jsx27(Badge14, { tone, children: a }, a)) })
4942
+ /* @__PURE__ */ jsx29(Flex19, { gap: 1, wrap: "wrap", children: areas.map((a) => /* @__PURE__ */ jsx29(Badge15, { tone, children: a }, a)) })
4557
4943
  ] });
4558
4944
  }
4559
4945
 
4560
4946
  // src/components/report-detail/JudgmentList.tsx
4561
- import { useState as useState7 } from "react";
4562
- import { HelpCircleIcon as HelpCircleIcon4 } from "@sanity/icons";
4563
- import { Badge as Badge15, Box as Box10, Card as Card16, Flex as Flex19, Stack as Stack16, Text as Text25, Tooltip as Tooltip4 } from "@sanity/ui";
4947
+ import { useState as useState8 } from "react";
4948
+ import { HelpCircleIcon as HelpCircleIcon6 } from "@sanity/icons";
4949
+ import { Badge as Badge16, Box as Box12, Card as Card18, Flex as Flex20, Stack as Stack18, Text as Text27, Tooltip as Tooltip6 } from "@sanity/ui";
4564
4950
 
4565
4951
  // src/components/primitives/InlineCode.tsx
4566
- import { Fragment as Fragment4, jsx as jsx28 } from "react/jsx-runtime";
4952
+ import { Fragment as Fragment5, jsx as jsx30 } from "react/jsx-runtime";
4567
4953
  function InlineCode({ text }) {
4568
4954
  const parts = text.split(/`([^`]+)`/);
4569
- return /* @__PURE__ */ jsx28(Fragment4, { children: parts.map(
4570
- (part, i) => i % 2 === 1 ? /* @__PURE__ */ jsx28(
4955
+ return /* @__PURE__ */ jsx30(Fragment5, { children: parts.map(
4956
+ (part, i) => i % 2 === 1 ? /* @__PURE__ */ jsx30(
4571
4957
  "code",
4572
4958
  {
4573
4959
  style: {
@@ -4579,12 +4965,12 @@ function InlineCode({ text }) {
4579
4965
  children: part
4580
4966
  },
4581
4967
  i
4582
- ) : /* @__PURE__ */ jsx28("span", { children: part }, i)
4968
+ ) : /* @__PURE__ */ jsx30("span", { children: part }, i)
4583
4969
  ) });
4584
4970
  }
4585
4971
 
4586
4972
  // src/components/report-detail/JudgmentList.tsx
4587
- import { jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
4973
+ import { jsx as jsx31, jsxs as jsxs26 } from "react/jsx-runtime";
4588
4974
  function groupByArea(judgments) {
4589
4975
  const byArea = /* @__PURE__ */ new Map();
4590
4976
  for (const j of judgments) {
@@ -4599,56 +4985,56 @@ var DIMENSION_LABELS = DIMENSION_LABELS_KEBAB;
4599
4985
  function JudgmentList({ judgments }) {
4600
4986
  if (judgments.length === 0) return null;
4601
4987
  const grouped = groupByArea(judgments);
4602
- return /* @__PURE__ */ jsx29(Card16, { padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs24(Stack16, { space: 4, children: [
4603
- /* @__PURE__ */ jsxs24(Flex19, { align: "center", gap: 3, wrap: "wrap", children: [
4604
- /* @__PURE__ */ jsx29(Text25, { size: 2, weight: "semibold", children: "Low-Scoring Judgments" }),
4605
- /* @__PURE__ */ jsx29(
4606
- Tooltip4,
4988
+ return /* @__PURE__ */ jsx31(Card18, { padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs26(Stack18, { space: 4, children: [
4989
+ /* @__PURE__ */ jsxs26(Flex20, { align: "center", gap: 3, wrap: "wrap", children: [
4990
+ /* @__PURE__ */ jsx31(Text27, { size: 2, weight: "semibold", children: "Low-Scoring Judgments" }),
4991
+ /* @__PURE__ */ jsx31(
4992
+ Tooltip6,
4607
4993
  {
4608
- content: /* @__PURE__ */ jsx29(Box10, { padding: 2, style: { maxWidth: 260 }, children: /* @__PURE__ */ jsx29(Text25, { size: 1, children: GLOSSARY.lowScoringJudgments }) }),
4994
+ content: /* @__PURE__ */ jsx31(Box12, { padding: 2, style: { maxWidth: 260 }, children: /* @__PURE__ */ jsx31(Text27, { size: 1, children: GLOSSARY.lowScoringJudgments }) }),
4609
4995
  placement: "bottom",
4610
4996
  portal: true,
4611
- children: /* @__PURE__ */ jsx29(Text25, { muted: true, size: 0, children: /* @__PURE__ */ jsx29(HelpCircleIcon4, {}) })
4997
+ children: /* @__PURE__ */ jsx31(Text27, { muted: true, size: 0, children: /* @__PURE__ */ jsx31(HelpCircleIcon6, {}) })
4612
4998
  }
4613
4999
  ),
4614
- /* @__PURE__ */ jsx29(Card16, { padding: 2, radius: 2, tone: "critical", children: /* @__PURE__ */ jsxs24(Text25, { size: 1, weight: "bold", children: [
5000
+ /* @__PURE__ */ jsx31(Card18, { padding: 2, radius: 2, tone: "critical", children: /* @__PURE__ */ jsxs26(Text27, { size: 1, weight: "bold", children: [
4615
5001
  judgments.length,
4616
5002
  " judgment",
4617
5003
  judgments.length === 1 ? "" : "s",
4618
5004
  " below 70"
4619
5005
  ] }) })
4620
5006
  ] }),
4621
- grouped.map(([area, areaJudgments]) => /* @__PURE__ */ jsx29(Card16, { padding: 3, radius: 2, tone: "transparent", children: /* @__PURE__ */ jsxs24(Stack16, { space: 3, children: [
4622
- /* @__PURE__ */ jsxs24(Text25, { size: 1, weight: "semibold", children: [
5007
+ grouped.map(([area, areaJudgments]) => /* @__PURE__ */ jsx31(Card18, { padding: 3, radius: 2, tone: "transparent", children: /* @__PURE__ */ jsxs26(Stack18, { space: 3, children: [
5008
+ /* @__PURE__ */ jsxs26(Text27, { size: 1, weight: "semibold", children: [
4623
5009
  area,
4624
5010
  " ",
4625
- /* @__PURE__ */ jsxs24(Text25, { muted: true, size: 1, weight: "regular", as: "span", children: [
5011
+ /* @__PURE__ */ jsxs26(Text27, { muted: true, size: 1, weight: "regular", as: "span", children: [
4626
5012
  "(",
4627
5013
  areaJudgments.length,
4628
5014
  ")"
4629
5015
  ] })
4630
5016
  ] }),
4631
- areaJudgments.map((j, i) => /* @__PURE__ */ jsx29(JudgmentCard, { judgment: j }, `${area}-${i}`))
5017
+ areaJudgments.map((j, i) => /* @__PURE__ */ jsx31(JudgmentCard, { judgment: j }, `${area}-${i}`))
4632
5018
  ] }) }, area))
4633
5019
  ] }) });
4634
5020
  }
4635
5021
  function JudgmentCard({ judgment }) {
4636
- const [expanded, setExpanded] = useState7(false);
5022
+ const [expanded, setExpanded] = useState8(false);
4637
5023
  const dimLabel = DIMENSION_LABELS[judgment.dimension] ?? judgment.dimension;
4638
5024
  const sep = judgment.taskId.indexOf(" - ");
4639
5025
  const taskName = sep > 0 ? judgment.taskId.substring(sep + 3) : judgment.taskId;
4640
- return /* @__PURE__ */ jsx29(
4641
- Card16,
5026
+ return /* @__PURE__ */ jsx31(
5027
+ Card18,
4642
5028
  {
4643
5029
  padding: 3,
4644
5030
  radius: 2,
4645
5031
  shadow: 1,
4646
5032
  style: { cursor: "pointer" },
4647
5033
  onClick: () => setExpanded(!expanded),
4648
- children: /* @__PURE__ */ jsxs24(Stack16, { space: 3, children: [
4649
- /* @__PURE__ */ jsxs24(Flex19, { align: "center", gap: 2, wrap: "wrap", children: [
4650
- /* @__PURE__ */ jsx29(Card16, { padding: 2, radius: 2, tone: scoreTone(judgment.score), children: /* @__PURE__ */ jsx29(
4651
- Text25,
5034
+ children: /* @__PURE__ */ jsxs26(Stack18, { space: 3, children: [
5035
+ /* @__PURE__ */ jsxs26(Flex20, { align: "center", gap: 2, wrap: "wrap", children: [
5036
+ /* @__PURE__ */ jsx31(Card18, { padding: 2, radius: 2, tone: scoreTone(judgment.score), children: /* @__PURE__ */ jsx31(
5037
+ Text27,
4652
5038
  {
4653
5039
  align: "center",
4654
5040
  size: 1,
@@ -4657,32 +5043,32 @@ function JudgmentCard({ judgment }) {
4657
5043
  children: judgment.score
4658
5044
  }
4659
5045
  ) }),
4660
- /* @__PURE__ */ jsx29(Badge15, { tone: "default", children: dimLabel }),
4661
- /* @__PURE__ */ jsx29(Text25, { size: 1, weight: "medium", children: taskName }),
4662
- /* @__PURE__ */ jsx29(Text25, { muted: true, size: 0, children: judgment.modelId }),
4663
- /* @__PURE__ */ jsx29(Text25, { muted: true, size: 0, style: { marginLeft: "auto" }, children: expanded ? "\u25B2" : "\u25BC" })
5046
+ /* @__PURE__ */ jsx31(Badge16, { tone: "default", children: dimLabel }),
5047
+ /* @__PURE__ */ jsx31(Text27, { size: 1, weight: "medium", children: taskName }),
5048
+ /* @__PURE__ */ jsx31(Text27, { muted: true, size: 0, children: judgment.modelId }),
5049
+ /* @__PURE__ */ jsx31(Text27, { muted: true, size: 0, style: { marginLeft: "auto" }, children: expanded ? "\u25B2" : "\u25BC" })
4664
5050
  ] }),
4665
- expanded && /* @__PURE__ */ jsxs24(Stack16, { space: 3, children: [
4666
- /* @__PURE__ */ jsx29(Card16, { padding: 3, radius: 2, tone: "transparent", children: /* @__PURE__ */ jsx29(
4667
- Text25,
5051
+ expanded && /* @__PURE__ */ jsxs26(Stack18, { space: 3, children: [
5052
+ /* @__PURE__ */ jsx31(Card18, { padding: 3, radius: 2, tone: "transparent", children: /* @__PURE__ */ jsx31(
5053
+ Text27,
4668
5054
  {
4669
5055
  muted: true,
4670
5056
  size: 1,
4671
5057
  style: { lineHeight: 1.6, whiteSpace: "pre-wrap" },
4672
- children: /* @__PURE__ */ jsx29(InlineCode, { text: judgment.reason })
5058
+ children: /* @__PURE__ */ jsx31(InlineCode, { text: judgment.reason })
4673
5059
  }
4674
5060
  ) }),
4675
- judgment.canonicalDocs && judgment.canonicalDocs.length > 0 && /* @__PURE__ */ jsxs24(Flex19, { align: "center", gap: 2, wrap: "wrap", children: [
4676
- /* @__PURE__ */ jsx29(Text25, { muted: true, size: 0, children: "Docs:" }),
5061
+ judgment.canonicalDocs && judgment.canonicalDocs.length > 0 && /* @__PURE__ */ jsxs26(Flex20, { align: "center", gap: 2, wrap: "wrap", children: [
5062
+ /* @__PURE__ */ jsx31(Text27, { muted: true, size: 0, children: "Docs:" }),
4677
5063
  judgment.canonicalDocs.map((doc) => {
4678
- const badge = /* @__PURE__ */ jsx29(Badge15, { mode: "outline", tone: "primary", children: doc.slug });
4679
- return /* @__PURE__ */ jsx29(
4680
- Tooltip4,
5064
+ const badge = /* @__PURE__ */ jsx31(Badge16, { mode: "outline", tone: "primary", children: doc.slug });
5065
+ return /* @__PURE__ */ jsx31(
5066
+ Tooltip6,
4681
5067
  {
4682
- content: /* @__PURE__ */ jsx29(Box10, { padding: 2, children: /* @__PURE__ */ jsx29(Text25, { size: 1, children: doc.title || doc.slug }) }),
5068
+ content: /* @__PURE__ */ jsx31(Box12, { padding: 2, children: /* @__PURE__ */ jsx31(Text27, { size: 1, children: doc.title || doc.slug }) }),
4683
5069
  placement: "bottom",
4684
5070
  portal: true,
4685
- children: doc.documentId ? /* @__PURE__ */ jsx29(
5071
+ children: doc.documentId ? /* @__PURE__ */ jsx31(
4686
5072
  "a",
4687
5073
  {
4688
5074
  href: `/intent/edit/id=${doc.documentId}`,
@@ -4703,46 +5089,8 @@ function JudgmentCard({ judgment }) {
4703
5089
  }
4704
5090
 
4705
5091
  // src/components/report-detail/OverviewStats.tsx
4706
- import { Grid as Grid3 } from "@sanity/ui";
4707
-
4708
- // src/components/primitives/StatCard.tsx
4709
- import { HelpCircleIcon as HelpCircleIcon5 } from "@sanity/icons";
4710
- import { Box as Box11, Card as Card17, Stack as Stack17, Text as Text26, Tooltip as Tooltip5 } from "@sanity/ui";
4711
- import { Fragment as Fragment5, jsx as jsx30, jsxs as jsxs25 } from "react/jsx-runtime";
4712
- function StatCard({
4713
- label,
4714
- value,
4715
- tooltip,
4716
- suffix,
4717
- tone = "default"
4718
- }) {
4719
- return /* @__PURE__ */ jsx30(Card17, { padding: 3, radius: 2, shadow: 1, tone, children: /* @__PURE__ */ jsxs25(Stack17, { space: 2, children: [
4720
- /* @__PURE__ */ jsxs25(Text26, { muted: true, size: 1, children: [
4721
- label,
4722
- tooltip && /* @__PURE__ */ jsxs25(Fragment5, { children: [
4723
- " ",
4724
- /* @__PURE__ */ jsx30(
4725
- Tooltip5,
4726
- {
4727
- content: /* @__PURE__ */ jsx30(Box11, { padding: 2, children: /* @__PURE__ */ jsx30(Text26, { size: 1, children: tooltip }) }),
4728
- portal: true,
4729
- children: /* @__PURE__ */ jsx30("span", { style: { cursor: "help" }, children: /* @__PURE__ */ jsx30(HelpCircleIcon5, {}) })
4730
- }
4731
- )
4732
- ] })
4733
- ] }),
4734
- /* @__PURE__ */ jsxs25(Text26, { size: 3, weight: "bold", children: [
4735
- value,
4736
- suffix && /* @__PURE__ */ jsxs25("span", { style: { fontSize: "0.6em", fontWeight: 400 }, children: [
4737
- " ",
4738
- suffix
4739
- ] })
4740
- ] })
4741
- ] }) });
4742
- }
4743
-
4744
- // src/components/report-detail/OverviewStats.tsx
4745
- import { jsx as jsx31, jsxs as jsxs26 } from "react/jsx-runtime";
5092
+ import { Grid as Grid4 } from "@sanity/ui";
5093
+ import { jsx as jsx32, jsxs as jsxs27 } from "react/jsx-runtime";
4746
5094
  function OverviewStats({
4747
5095
  overall,
4748
5096
  durationMs,
@@ -4750,8 +5098,8 @@ function OverviewStats({
4750
5098
  isFullMode
4751
5099
  }) {
4752
5100
  const overallTone = scoreTone(overall.avgScore);
4753
- return /* @__PURE__ */ jsxs26(Grid3, { columns: [1, 1, 2, isFullMode ? 4 : 4], gap: 3, children: [
4754
- /* @__PURE__ */ jsx31(
5101
+ return /* @__PURE__ */ jsxs27(Grid4, { columns: [1, 1, 2, isFullMode ? 4 : 4], gap: 3, children: [
5102
+ /* @__PURE__ */ jsx32(
4755
5103
  StatCard,
4756
5104
  {
4757
5105
  label: "Overall Score",
@@ -4760,7 +5108,7 @@ function OverviewStats({
4760
5108
  value: overall.avgScore.toFixed(1)
4761
5109
  }
4762
5110
  ),
4763
- /* @__PURE__ */ jsx31(
5111
+ /* @__PURE__ */ jsx32(
4764
5112
  StatCard,
4765
5113
  {
4766
5114
  label: "Doc Lift",
@@ -4769,7 +5117,7 @@ function OverviewStats({
4769
5117
  value: overall.avgDocLift.toFixed(1)
4770
5118
  }
4771
5119
  ),
4772
- isFullMode && overall.avgActualScore != null && /* @__PURE__ */ jsx31(
5120
+ isFullMode && overall.avgActualScore != null && /* @__PURE__ */ jsx32(
4773
5121
  StatCard,
4774
5122
  {
4775
5123
  label: "Actual Score",
@@ -4778,7 +5126,7 @@ function OverviewStats({
4778
5126
  value: overall.avgActualScore.toFixed(1)
4779
5127
  }
4780
5128
  ),
4781
- isFullMode && overall.avgRetrievalGap != null && /* @__PURE__ */ jsx31(
5129
+ isFullMode && overall.avgRetrievalGap != null && /* @__PURE__ */ jsx32(
4782
5130
  StatCard,
4783
5131
  {
4784
5132
  label: "Retrieval Gap",
@@ -4788,7 +5136,7 @@ function OverviewStats({
4788
5136
  value: overall.avgRetrievalGap.toFixed(1)
4789
5137
  }
4790
5138
  ),
4791
- isFullMode && overall.avgInfrastructureEfficiency != null && /* @__PURE__ */ jsx31(
5139
+ isFullMode && overall.avgInfrastructureEfficiency != null && /* @__PURE__ */ jsx32(
4792
5140
  StatCard,
4793
5141
  {
4794
5142
  label: "Infra Efficiency",
@@ -4796,8 +5144,8 @@ function OverviewStats({
4796
5144
  value: formatPercent(overall.avgInfrastructureEfficiency)
4797
5145
  }
4798
5146
  ),
4799
- /* @__PURE__ */ jsx31(StatCard, { label: "Duration", value: formatDuration(durationMs) }),
4800
- /* @__PURE__ */ jsx31(
5147
+ /* @__PURE__ */ jsx32(StatCard, { label: "Duration", value: formatDuration(durationMs) }),
5148
+ /* @__PURE__ */ jsx32(
4801
5149
  StatCard,
4802
5150
  {
4803
5151
  label: "Tests",
@@ -4809,31 +5157,31 @@ function OverviewStats({
4809
5157
  }
4810
5158
 
4811
5159
  // src/components/report-detail/ProvenanceCard.tsx
4812
- import { Card as Card18, Flex as Flex20, Grid as Grid4, Stack as Stack18, Text as Text27 } from "@sanity/ui";
4813
- import { jsx as jsx32, jsxs as jsxs27 } from "react/jsx-runtime";
5160
+ import { Card as Card19, Flex as Flex21, Grid as Grid5, Stack as Stack19, Text as Text28 } from "@sanity/ui";
5161
+ import { jsx as jsx33, jsxs as jsxs28 } from "react/jsx-runtime";
4814
5162
  var VIEWABLE_PROMPTFOO_MODES = /* @__PURE__ */ new Set(["agentic", "observed"]);
4815
5163
  function ProvenanceCard({ provenance }) {
4816
- return /* @__PURE__ */ jsx32(Card18, { padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs27(Stack18, { space: 4, children: [
4817
- /* @__PURE__ */ jsx32(Text27, { size: 2, weight: "semibold", children: "Provenance" }),
4818
- /* @__PURE__ */ jsxs27(Grid4, { columns: [1, 2, 3], gap: 4, children: [
4819
- /* @__PURE__ */ jsx32(Field, { label: "Mode", value: provenance.mode }),
4820
- /* @__PURE__ */ jsx32(Field, { label: "Source", value: provenance.source.name }),
4821
- /* @__PURE__ */ jsx32(
5164
+ return /* @__PURE__ */ jsx33(Card19, { padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs28(Stack19, { space: 4, children: [
5165
+ /* @__PURE__ */ jsx33(Text28, { size: 2, weight: "semibold", children: "Provenance" }),
5166
+ /* @__PURE__ */ jsxs28(Grid5, { columns: [1, 2, 3], gap: 4, children: [
5167
+ /* @__PURE__ */ jsx33(Field, { label: "Mode", value: provenance.mode }),
5168
+ /* @__PURE__ */ jsx33(Field, { label: "Source", value: provenance.source.name }),
5169
+ /* @__PURE__ */ jsx33(
4822
5170
  Field,
4823
5171
  {
4824
5172
  label: "Trigger",
4825
5173
  value: provenance.trigger.type + (provenance.trigger.workflow ? ` (${provenance.trigger.workflow})` : "")
4826
5174
  }
4827
5175
  ),
4828
- /* @__PURE__ */ jsx32(
5176
+ /* @__PURE__ */ jsx33(
4829
5177
  Field,
4830
5178
  {
4831
5179
  label: "Models",
4832
5180
  value: provenance.models.map((m) => m.label).join(", ")
4833
5181
  }
4834
5182
  ),
4835
- /* @__PURE__ */ jsx32(Field, { label: "Grader Model", mono: true, value: provenance.graderModel }),
4836
- provenance.contextHash && /* @__PURE__ */ jsx32(
5183
+ /* @__PURE__ */ jsx33(Field, { label: "Grader Model", mono: true, value: provenance.graderModel }),
5184
+ provenance.contextHash && /* @__PURE__ */ jsx33(
4837
5185
  Field,
4838
5186
  {
4839
5187
  label: "Context Hash",
@@ -4842,8 +5190,8 @@ function ProvenanceCard({ provenance }) {
4842
5190
  }
4843
5191
  )
4844
5192
  ] }),
4845
- provenance.git && /* @__PURE__ */ jsx32(GitInfo, { git: provenance.git }),
4846
- /* @__PURE__ */ jsx32(PromptfooLinks, { provenance })
5193
+ provenance.git && /* @__PURE__ */ jsx33(GitInfo, { git: provenance.git }),
5194
+ /* @__PURE__ */ jsx33(PromptfooLinks, { provenance })
4847
5195
  ] }) });
4848
5196
  }
4849
5197
  function Field({
@@ -4851,9 +5199,9 @@ function Field({
4851
5199
  mono,
4852
5200
  value
4853
5201
  }) {
4854
- return /* @__PURE__ */ jsxs27(Stack18, { space: 1, children: [
4855
- /* @__PURE__ */ jsx32(
4856
- Text27,
5202
+ return /* @__PURE__ */ jsxs28(Stack19, { space: 1, children: [
5203
+ /* @__PURE__ */ jsx33(
5204
+ Text28,
4857
5205
  {
4858
5206
  muted: true,
4859
5207
  size: 0,
@@ -4862,7 +5210,7 @@ function Field({
4862
5210
  children: label
4863
5211
  }
4864
5212
  ),
4865
- /* @__PURE__ */ jsx32(Text27, { size: 1, style: mono ? { fontFamily: "monospace" } : void 0, children: value })
5213
+ /* @__PURE__ */ jsx33(Text28, { size: 1, style: mono ? { fontFamily: "monospace" } : void 0, children: value })
4866
5214
  ] });
4867
5215
  }
4868
5216
  function GitInfo({ git }) {
@@ -4870,15 +5218,15 @@ function GitInfo({ git }) {
4870
5218
  const branchUrl = `${repoUrl}/tree/${git.branch}`;
4871
5219
  const commitUrl = `${repoUrl}/commit/${git.sha}`;
4872
5220
  const prUrl = git.prNumber ? `${repoUrl}/pull/${git.prNumber}` : null;
4873
- return /* @__PURE__ */ jsx32(Card18, { border: true, padding: 3, radius: 2, tone: "transparent", children: /* @__PURE__ */ jsxs27(Flex20, { align: "center", gap: 3, wrap: "wrap", children: [
4874
- /* @__PURE__ */ jsx32(Text27, { muted: true, size: 1, weight: "semibold", children: "Git" }),
4875
- /* @__PURE__ */ jsxs27(Text27, { size: 1, children: [
4876
- /* @__PURE__ */ jsx32("a", { href: repoUrl, rel: "noopener noreferrer", target: "_blank", children: git.repo }),
5221
+ return /* @__PURE__ */ jsx33(Card19, { border: true, padding: 3, radius: 2, tone: "transparent", children: /* @__PURE__ */ jsxs28(Flex21, { align: "center", gap: 3, wrap: "wrap", children: [
5222
+ /* @__PURE__ */ jsx33(Text28, { muted: true, size: 1, weight: "semibold", children: "Git" }),
5223
+ /* @__PURE__ */ jsxs28(Text28, { size: 1, children: [
5224
+ /* @__PURE__ */ jsx33("a", { href: repoUrl, rel: "noopener noreferrer", target: "_blank", children: git.repo }),
4877
5225
  " / ",
4878
- /* @__PURE__ */ jsx32("a", { href: branchUrl, rel: "noopener noreferrer", target: "_blank", children: git.branch })
5226
+ /* @__PURE__ */ jsx33("a", { href: branchUrl, rel: "noopener noreferrer", target: "_blank", children: git.branch })
4879
5227
  ] }),
4880
- /* @__PURE__ */ jsx32(Text27, { muted: true, size: 1, style: { fontFamily: "monospace" }, children: /* @__PURE__ */ jsx32("a", { href: commitUrl, rel: "noopener noreferrer", target: "_blank", children: git.sha.slice(0, 12) }) }),
4881
- prUrl && /* @__PURE__ */ jsx32(Text27, { size: 1, children: /* @__PURE__ */ jsxs27("a", { href: prUrl, rel: "noopener noreferrer", target: "_blank", children: [
5228
+ /* @__PURE__ */ jsx33(Text28, { muted: true, size: 1, style: { fontFamily: "monospace" }, children: /* @__PURE__ */ jsx33("a", { href: commitUrl, rel: "noopener noreferrer", target: "_blank", children: git.sha.slice(0, 12) }) }),
5229
+ prUrl && /* @__PURE__ */ jsx33(Text28, { size: 1, children: /* @__PURE__ */ jsxs28("a", { href: prUrl, rel: "noopener noreferrer", target: "_blank", children: [
4882
5230
  "PR #",
4883
5231
  git.prNumber,
4884
5232
  " \u2192"
@@ -4893,14 +5241,14 @@ function PromptfooLinks({
4893
5241
  (e) => VIEWABLE_PROMPTFOO_MODES.has(e.mode)
4894
5242
  );
4895
5243
  if (viewable.length === 0) return null;
4896
- return /* @__PURE__ */ jsx32(Flex20, { gap: 3, wrap: "wrap", children: viewable.map((entry) => /* @__PURE__ */ jsx32(Text27, { size: 1, children: /* @__PURE__ */ jsxs27("a", { href: entry.url, rel: "noopener noreferrer", target: "_blank", children: [
5244
+ return /* @__PURE__ */ jsx33(Flex21, { gap: 3, wrap: "wrap", children: viewable.map((entry) => /* @__PURE__ */ jsx33(Text28, { size: 1, children: /* @__PURE__ */ jsxs28("a", { href: entry.url, rel: "noopener noreferrer", target: "_blank", children: [
4897
5245
  "View in Promptfoo (",
4898
5246
  entry.mode,
4899
5247
  ") \u2192"
4900
5248
  ] }) }, entry.mode)) });
4901
5249
  }
4902
5250
  if (provenance.promptfooUrl && VIEWABLE_PROMPTFOO_MODES.has(provenance.mode)) {
4903
- return /* @__PURE__ */ jsx32(Text27, { size: 1, children: /* @__PURE__ */ jsx32(
5251
+ return /* @__PURE__ */ jsx33(Text28, { size: 1, children: /* @__PURE__ */ jsx33(
4904
5252
  "a",
4905
5253
  {
4906
5254
  href: provenance.promptfooUrl,
@@ -4914,33 +5262,33 @@ function PromptfooLinks({
4914
5262
  }
4915
5263
 
4916
5264
  // src/components/report-detail/RecommendationsSection.tsx
4917
- import React3 from "react";
4918
- import { Badge as Badge16, Box as Box12, Card as Card19, Flex as Flex21, Stack as Stack19, Text as Text28, Tooltip as Tooltip6 } from "@sanity/ui";
4919
- import { HelpCircleIcon as HelpCircleIcon6 } from "@sanity/icons";
4920
- import { jsx as jsx33, jsxs as jsxs28 } from "react/jsx-runtime";
5265
+ import React4 from "react";
5266
+ import { Badge as Badge17, Box as Box13, Card as Card20, Flex as Flex22, Stack as Stack20, Text as Text29, Tooltip as Tooltip7 } from "@sanity/ui";
5267
+ import { HelpCircleIcon as HelpCircleIcon7 } from "@sanity/icons";
5268
+ import { jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
4921
5269
  function RecommendationsSection({
4922
5270
  recommendations
4923
5271
  }) {
4924
5272
  if (recommendations.gaps.length === 0) return null;
4925
- return /* @__PURE__ */ jsx33(Card19, { padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs28(Stack19, { space: 4, children: [
4926
- /* @__PURE__ */ jsxs28(Flex21, { align: "center", gap: 3, wrap: "wrap", children: [
4927
- /* @__PURE__ */ jsx33(Text28, { size: 2, weight: "semibold", children: "Recommendations" }),
4928
- /* @__PURE__ */ jsx33(
4929
- Tooltip6,
5273
+ return /* @__PURE__ */ jsx34(Card20, { padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs29(Stack20, { space: 4, children: [
5274
+ /* @__PURE__ */ jsxs29(Flex22, { align: "center", gap: 3, wrap: "wrap", children: [
5275
+ /* @__PURE__ */ jsx34(Text29, { size: 2, weight: "semibold", children: "Recommendations" }),
5276
+ /* @__PURE__ */ jsx34(
5277
+ Tooltip7,
4930
5278
  {
4931
- content: /* @__PURE__ */ jsx33(Box12, { padding: 2, style: { maxWidth: 260 }, children: /* @__PURE__ */ jsx33(Text28, { size: 1, children: GLOSSARY.recommendations }) }),
5279
+ content: /* @__PURE__ */ jsx34(Box13, { padding: 2, style: { maxWidth: 260 }, children: /* @__PURE__ */ jsx34(Text29, { size: 1, children: GLOSSARY.recommendations }) }),
4932
5280
  placement: "bottom",
4933
5281
  portal: true,
4934
- children: /* @__PURE__ */ jsx33(Text28, { muted: true, size: 0, children: /* @__PURE__ */ jsx33(HelpCircleIcon6, {}) })
5282
+ children: /* @__PURE__ */ jsx34(Text29, { muted: true, size: 0, children: /* @__PURE__ */ jsx34(HelpCircleIcon7, {}) })
4935
5283
  }
4936
5284
  ),
4937
- /* @__PURE__ */ jsx33(
4938
- Tooltip6,
5285
+ /* @__PURE__ */ jsx34(
5286
+ Tooltip7,
4939
5287
  {
4940
- content: /* @__PURE__ */ jsx33(Box12, { padding: 2, style: { maxWidth: 260 }, children: /* @__PURE__ */ jsx33(Text28, { size: 1, children: GLOSSARY.totalPotentialLift }) }),
5288
+ content: /* @__PURE__ */ jsx34(Box13, { padding: 2, style: { maxWidth: 260 }, children: /* @__PURE__ */ jsx34(Text29, { size: 1, children: GLOSSARY.totalPotentialLift }) }),
4941
5289
  placement: "bottom",
4942
5290
  portal: true,
4943
- children: /* @__PURE__ */ jsx33(Card19, { padding: 2, radius: 2, tone: "positive", children: /* @__PURE__ */ jsxs28(Text28, { size: 1, weight: "bold", children: [
5291
+ children: /* @__PURE__ */ jsx34(Card20, { padding: 2, radius: 2, tone: "positive", children: /* @__PURE__ */ jsxs29(Text29, { size: 1, weight: "bold", children: [
4944
5292
  "+",
4945
5293
  recommendations.totalPotentialLift.toFixed(1),
4946
5294
  " pts potential lift"
@@ -4948,7 +5296,7 @@ function RecommendationsSection({
4948
5296
  }
4949
5297
  )
4950
5298
  ] }),
4951
- /* @__PURE__ */ jsxs28(
5299
+ /* @__PURE__ */ jsxs29(
4952
5300
  "div",
4953
5301
  {
4954
5302
  style: {
@@ -4957,9 +5305,9 @@ function RecommendationsSection({
4957
5305
  gridTemplateColumns: "auto 2fr 2fr 1fr 1fr 1fr"
4958
5306
  },
4959
5307
  children: [
4960
- /* @__PURE__ */ jsx33(ColumnHeader, { borderBottom: true, label: "#" }),
4961
- /* @__PURE__ */ jsx33(ColumnHeader, { borderBottom: true, label: "Area" }),
4962
- /* @__PURE__ */ jsx33(
5308
+ /* @__PURE__ */ jsx34(ColumnHeader, { borderBottom: true, label: "#" }),
5309
+ /* @__PURE__ */ jsx34(ColumnHeader, { borderBottom: true, label: "Area" }),
5310
+ /* @__PURE__ */ jsx34(
4963
5311
  ColumnHeader,
4964
5312
  {
4965
5313
  borderBottom: true,
@@ -4967,8 +5315,8 @@ function RecommendationsSection({
4967
5315
  tooltip: GLOSSARY.failureMode
4968
5316
  }
4969
5317
  ),
4970
- /* @__PURE__ */ jsx33(ColumnHeader, { borderBottom: true, label: "Action" }),
4971
- /* @__PURE__ */ jsx33(
5318
+ /* @__PURE__ */ jsx34(ColumnHeader, { borderBottom: true, label: "Action" }),
5319
+ /* @__PURE__ */ jsx34(
4972
5320
  ColumnHeader,
4973
5321
  {
4974
5322
  borderBottom: true,
@@ -4976,7 +5324,7 @@ function RecommendationsSection({
4976
5324
  tooltip: GLOSSARY.estimatedLift
4977
5325
  }
4978
5326
  ),
4979
- /* @__PURE__ */ jsx33(
5327
+ /* @__PURE__ */ jsx34(
4980
5328
  ColumnHeader,
4981
5329
  {
4982
5330
  borderBottom: true,
@@ -4984,7 +5332,7 @@ function RecommendationsSection({
4984
5332
  tooltip: GLOSSARY.confidence
4985
5333
  }
4986
5334
  ),
4987
- recommendations.gaps.map((gap, i) => /* @__PURE__ */ jsx33(RecommendationRow, { gap, index: i }, `gap-${i}`))
5335
+ recommendations.gaps.map((gap, i) => /* @__PURE__ */ jsx34(RecommendationRow, { gap, index: i }, `gap-${i}`))
4988
5336
  ]
4989
5337
  }
4990
5338
  )
@@ -4996,8 +5344,8 @@ function RecommendationRow({
4996
5344
  }) {
4997
5345
  const confIcon = gap.confidence === "high" ? "\u{1F7E2}" : gap.confidence === "medium" ? "\u{1F7E1}" : "\u{1F534}";
4998
5346
  const bg = rowBackground(index);
4999
- return /* @__PURE__ */ jsxs28(React3.Fragment, { children: [
5000
- /* @__PURE__ */ jsx33(
5347
+ return /* @__PURE__ */ jsxs29(React4.Fragment, { children: [
5348
+ /* @__PURE__ */ jsx34(
5001
5349
  "div",
5002
5350
  {
5003
5351
  style: {
@@ -5007,10 +5355,10 @@ function RecommendationRow({
5007
5355
  display: "flex",
5008
5356
  padding: "8px 4px"
5009
5357
  },
5010
- children: /* @__PURE__ */ jsx33(Text28, { muted: true, size: 1, children: index + 1 })
5358
+ children: /* @__PURE__ */ jsx34(Text29, { muted: true, size: 1, children: index + 1 })
5011
5359
  }
5012
5360
  ),
5013
- /* @__PURE__ */ jsx33(
5361
+ /* @__PURE__ */ jsx34(
5014
5362
  "div",
5015
5363
  {
5016
5364
  style: {
@@ -5019,10 +5367,10 @@ function RecommendationRow({
5019
5367
  display: "flex",
5020
5368
  padding: "8px 0"
5021
5369
  },
5022
- children: /* @__PURE__ */ jsx33(Text28, { size: 1, weight: "medium", children: gap.area })
5370
+ children: /* @__PURE__ */ jsx34(Text29, { size: 1, weight: "medium", children: gap.area })
5023
5371
  }
5024
5372
  ),
5025
- /* @__PURE__ */ jsx33(
5373
+ /* @__PURE__ */ jsx34(
5026
5374
  "div",
5027
5375
  {
5028
5376
  style: {
@@ -5031,8 +5379,8 @@ function RecommendationRow({
5031
5379
  display: "flex",
5032
5380
  padding: "8px 0"
5033
5381
  },
5034
- children: /* @__PURE__ */ jsx33(
5035
- Badge16,
5382
+ children: /* @__PURE__ */ jsx34(
5383
+ Badge17,
5036
5384
  {
5037
5385
  tone: gap.failureMode === "missing-docs" ? "critical" : gap.failureMode === "incorrect-docs" ? "critical" : gap.failureMode === "outdated-docs" ? "caution" : "default",
5038
5386
  children: gap.failureMode
@@ -5040,7 +5388,7 @@ function RecommendationRow({
5040
5388
  )
5041
5389
  }
5042
5390
  ),
5043
- /* @__PURE__ */ jsx33(
5391
+ /* @__PURE__ */ jsx34(
5044
5392
  "div",
5045
5393
  {
5046
5394
  style: {
@@ -5049,10 +5397,10 @@ function RecommendationRow({
5049
5397
  display: "flex",
5050
5398
  padding: "8px 0"
5051
5399
  },
5052
- children: /* @__PURE__ */ jsx33(Text28, { muted: true, size: 1, children: gap.remediation })
5400
+ children: /* @__PURE__ */ jsx34(Text29, { muted: true, size: 1, children: gap.remediation })
5053
5401
  }
5054
5402
  ),
5055
- /* @__PURE__ */ jsx33(
5403
+ /* @__PURE__ */ jsx34(
5056
5404
  "div",
5057
5405
  {
5058
5406
  style: {
@@ -5061,13 +5409,13 @@ function RecommendationRow({
5061
5409
  display: "flex",
5062
5410
  padding: "8px 0"
5063
5411
  },
5064
- children: /* @__PURE__ */ jsx33(Card19, { padding: 2, radius: 2, tone: "positive", children: /* @__PURE__ */ jsxs28(Text28, { align: "center", size: 1, weight: "medium", children: [
5412
+ children: /* @__PURE__ */ jsx34(Card20, { padding: 2, radius: 2, tone: "positive", children: /* @__PURE__ */ jsxs29(Text29, { align: "center", size: 1, weight: "medium", children: [
5065
5413
  "+",
5066
5414
  gap.estimatedLift.toFixed(1)
5067
5415
  ] }) })
5068
5416
  }
5069
5417
  ),
5070
- /* @__PURE__ */ jsx33(
5418
+ /* @__PURE__ */ jsx34(
5071
5419
  "div",
5072
5420
  {
5073
5421
  style: {
@@ -5076,7 +5424,7 @@ function RecommendationRow({
5076
5424
  display: "flex",
5077
5425
  padding: "8px 0"
5078
5426
  },
5079
- children: /* @__PURE__ */ jsxs28(Text28, { size: 1, children: [
5427
+ children: /* @__PURE__ */ jsxs29(Text29, { size: 1, children: [
5080
5428
  confIcon,
5081
5429
  " ",
5082
5430
  gap.confidence
@@ -5089,16 +5437,16 @@ function RecommendationRow({
5089
5437
  // src/components/report-detail/ReportHeader.tsx
5090
5438
  import { ArrowLeftIcon, ClipboardIcon } from "@sanity/icons";
5091
5439
  import {
5092
- Badge as Badge17,
5093
- Box as Box13,
5440
+ Badge as Badge18,
5441
+ Box as Box14,
5094
5442
  Button as Button2,
5095
- Card as Card20,
5096
- Flex as Flex22,
5097
- Stack as Stack20,
5098
- Text as Text29,
5099
- Tooltip as Tooltip7
5443
+ Card as Card21,
5444
+ Flex as Flex23,
5445
+ Stack as Stack21,
5446
+ Text as Text30,
5447
+ Tooltip as Tooltip8
5100
5448
  } from "@sanity/ui";
5101
- import { Fragment as Fragment6, jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
5449
+ import { Fragment as Fragment6, jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
5102
5450
  function ReportHeader({
5103
5451
  completedAt,
5104
5452
  mode,
@@ -5111,9 +5459,9 @@ function ReportHeader({
5111
5459
  const dateLabel = formatCardDate(completedAt);
5112
5460
  const title = tag ?? dateLabel;
5113
5461
  const hasTag = Boolean(tag);
5114
- return /* @__PURE__ */ jsxs29(Fragment6, { children: [
5115
- /* @__PURE__ */ jsxs29(Flex22, { align: "center", gap: 3, children: [
5116
- /* @__PURE__ */ jsx34(
5462
+ return /* @__PURE__ */ jsxs30(Fragment6, { children: [
5463
+ /* @__PURE__ */ jsxs30(Flex23, { align: "center", gap: 3, children: [
5464
+ /* @__PURE__ */ jsx35(
5117
5465
  Button2,
5118
5466
  {
5119
5467
  icon: ArrowLeftIcon,
@@ -5122,23 +5470,23 @@ function ReportHeader({
5122
5470
  text: "Back"
5123
5471
  }
5124
5472
  ),
5125
- /* @__PURE__ */ jsxs29(Stack20, { flex: 1, space: 1, children: [
5126
- /* @__PURE__ */ jsx34(Text29, { size: 3, weight: "bold", children: title }),
5127
- hasTag && /* @__PURE__ */ jsx34(Text29, { muted: true, size: 1, children: dateLabel })
5473
+ /* @__PURE__ */ jsxs30(Stack21, { flex: 1, space: 1, children: [
5474
+ /* @__PURE__ */ jsx35(Text30, { size: 3, weight: "bold", children: title }),
5475
+ hasTag && /* @__PURE__ */ jsx35(Text30, { muted: true, size: 1, children: dateLabel })
5128
5476
  ] }),
5129
- /* @__PURE__ */ jsxs29(Flex22, { gap: 2, children: [
5130
- /* @__PURE__ */ jsx34(Badge17, { mode: "outline", tone: "default", children: sourceName }),
5131
- /* @__PURE__ */ jsx34(Badge17, { tone: "primary", children: mode })
5477
+ /* @__PURE__ */ jsxs30(Flex23, { gap: 2, children: [
5478
+ /* @__PURE__ */ jsx35(Badge18, { mode: "outline", tone: "default", children: sourceName }),
5479
+ /* @__PURE__ */ jsx35(Badge18, { tone: "primary", children: mode })
5132
5480
  ] })
5133
5481
  ] }),
5134
- /* @__PURE__ */ jsx34(
5135
- Tooltip7,
5482
+ /* @__PURE__ */ jsx35(
5483
+ Tooltip8,
5136
5484
  {
5137
- content: /* @__PURE__ */ jsx34(Box13, { padding: 2, children: /* @__PURE__ */ jsx34(Text29, { size: 1, children: "Click to copy report ID" }) }),
5485
+ content: /* @__PURE__ */ jsx35(Box14, { padding: 2, children: /* @__PURE__ */ jsx35(Text30, { size: 1, children: "Click to copy report ID" }) }),
5138
5486
  placement: "bottom",
5139
5487
  portal: true,
5140
- children: /* @__PURE__ */ jsx34(
5141
- Card20,
5488
+ children: /* @__PURE__ */ jsx35(
5489
+ Card21,
5142
5490
  {
5143
5491
  border: true,
5144
5492
  onClick: onCopyId,
@@ -5146,9 +5494,9 @@ function ReportHeader({
5146
5494
  radius: 2,
5147
5495
  style: { cursor: "pointer" },
5148
5496
  tone: "transparent",
5149
- children: /* @__PURE__ */ jsxs29(Flex22, { align: "center", gap: 3, children: [
5150
- /* @__PURE__ */ jsx34(
5151
- Text29,
5497
+ children: /* @__PURE__ */ jsxs30(Flex23, { align: "center", gap: 3, children: [
5498
+ /* @__PURE__ */ jsx35(
5499
+ Text30,
5152
5500
  {
5153
5501
  muted: true,
5154
5502
  size: 0,
@@ -5160,8 +5508,8 @@ function ReportHeader({
5160
5508
  children: "Report ID"
5161
5509
  }
5162
5510
  ),
5163
- /* @__PURE__ */ jsx34(
5164
- Text29,
5511
+ /* @__PURE__ */ jsx35(
5512
+ Text30,
5165
5513
  {
5166
5514
  size: 1,
5167
5515
  style: {
@@ -5171,7 +5519,7 @@ function ReportHeader({
5171
5519
  children: reportId
5172
5520
  }
5173
5521
  ),
5174
- /* @__PURE__ */ jsx34(Box13, { style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsx34(Text29, { muted: true, size: 1, children: /* @__PURE__ */ jsx34(ClipboardIcon, {}) }) })
5522
+ /* @__PURE__ */ jsx35(Box14, { style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsx35(Text30, { muted: true, size: 1, children: /* @__PURE__ */ jsx35(ClipboardIcon, {}) }) })
5175
5523
  ] })
5176
5524
  }
5177
5525
  )
@@ -5181,19 +5529,19 @@ function ReportHeader({
5181
5529
  }
5182
5530
 
5183
5531
  // src/components/report-detail/ThreeLayerTable.tsx
5184
- import React4 from "react";
5185
- import { Badge as Badge18, Card as Card21, Flex as Flex23, Stack as Stack21, Text as Text30 } from "@sanity/ui";
5186
- import { jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
5532
+ import React5 from "react";
5533
+ import { Badge as Badge19, Card as Card22, Flex as Flex24, Stack as Stack22, Text as Text31 } from "@sanity/ui";
5534
+ import { jsx as jsx36, jsxs as jsxs31 } from "react/jsx-runtime";
5187
5535
  function ThreeLayerTable({ scores }) {
5188
5536
  const filtered = scores.filter((s) => s.actualScore != null);
5189
5537
  if (filtered.length === 0) return null;
5190
5538
  const hasInverted = filtered.some((s) => s.invertedRetrievalGap);
5191
- return /* @__PURE__ */ jsx35(Card21, { overflow: "auto", padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs30(Stack21, { space: 4, children: [
5192
- /* @__PURE__ */ jsxs30(Flex23, { align: "center", gap: 3, children: [
5193
- /* @__PURE__ */ jsx35(Text30, { size: 2, weight: "semibold", children: "Three-Layer Decomposition" }),
5194
- /* @__PURE__ */ jsx35(Badge18, { tone: "primary", children: "full mode" })
5539
+ return /* @__PURE__ */ jsx36(Card22, { overflow: "auto", padding: 4, radius: 2, shadow: 1, children: /* @__PURE__ */ jsxs31(Stack22, { space: 4, children: [
5540
+ /* @__PURE__ */ jsxs31(Flex24, { align: "center", gap: 3, children: [
5541
+ /* @__PURE__ */ jsx36(Text31, { size: 2, weight: "semibold", children: "Three-Layer Decomposition" }),
5542
+ /* @__PURE__ */ jsx36(Badge19, { tone: "primary", children: "full mode" })
5195
5543
  ] }),
5196
- /* @__PURE__ */ jsxs30(
5544
+ /* @__PURE__ */ jsxs31(
5197
5545
  "div",
5198
5546
  {
5199
5547
  style: {
@@ -5202,9 +5550,9 @@ function ThreeLayerTable({ scores }) {
5202
5550
  gridTemplateColumns: "2fr 1fr 1fr 1fr 1fr 1fr"
5203
5551
  },
5204
5552
  children: [
5205
- /* @__PURE__ */ jsx35(ColumnHeader, { borderBottom: true, label: "Area" }),
5206
- /* @__PURE__ */ jsx35(ColumnHeader, { borderBottom: true, label: "Floor", tooltip: GLOSSARY.floor }),
5207
- /* @__PURE__ */ jsx35(
5553
+ /* @__PURE__ */ jsx36(ColumnHeader, { borderBottom: true, label: "Area" }),
5554
+ /* @__PURE__ */ jsx36(ColumnHeader, { borderBottom: true, label: "Floor", tooltip: GLOSSARY.floor }),
5555
+ /* @__PURE__ */ jsx36(
5208
5556
  ColumnHeader,
5209
5557
  {
5210
5558
  borderBottom: true,
@@ -5212,8 +5560,8 @@ function ThreeLayerTable({ scores }) {
5212
5560
  tooltip: GLOSSARY.ceiling
5213
5561
  }
5214
5562
  ),
5215
- /* @__PURE__ */ jsx35(ColumnHeader, { borderBottom: true, label: "Actual", tooltip: GLOSSARY.actual }),
5216
- /* @__PURE__ */ jsx35(
5563
+ /* @__PURE__ */ jsx36(ColumnHeader, { borderBottom: true, label: "Actual", tooltip: GLOSSARY.actual }),
5564
+ /* @__PURE__ */ jsx36(
5217
5565
  ColumnHeader,
5218
5566
  {
5219
5567
  borderBottom: true,
@@ -5221,7 +5569,7 @@ function ThreeLayerTable({ scores }) {
5221
5569
  tooltip: GLOSSARY.retGap
5222
5570
  }
5223
5571
  ),
5224
- /* @__PURE__ */ jsx35(
5572
+ /* @__PURE__ */ jsx36(
5225
5573
  ColumnHeader,
5226
5574
  {
5227
5575
  borderBottom: true,
@@ -5229,8 +5577,8 @@ function ThreeLayerTable({ scores }) {
5229
5577
  tooltip: GLOSSARY.efficiency
5230
5578
  }
5231
5579
  ),
5232
- filtered.map((score, i) => /* @__PURE__ */ jsxs30(React4.Fragment, { children: [
5233
- /* @__PURE__ */ jsx35(
5580
+ filtered.map((score, i) => /* @__PURE__ */ jsxs31(React5.Fragment, { children: [
5581
+ /* @__PURE__ */ jsx36(
5234
5582
  "div",
5235
5583
  {
5236
5584
  style: {
@@ -5238,13 +5586,13 @@ function ThreeLayerTable({ scores }) {
5238
5586
  borderRadius: 4,
5239
5587
  padding: "8px 0 8px 4px"
5240
5588
  },
5241
- children: /* @__PURE__ */ jsx35(Text30, { size: 1, weight: "medium", children: score.feature })
5589
+ children: /* @__PURE__ */ jsx36(Text31, { size: 1, weight: "medium", children: score.feature })
5242
5590
  }
5243
5591
  ),
5244
- /* @__PURE__ */ jsx35("div", { style: { background: rowBackground(i), padding: "6px 0" }, children: /* @__PURE__ */ jsx35(ScoreCell, { score: score.floorScore ?? 0 }) }),
5245
- /* @__PURE__ */ jsx35("div", { style: { background: rowBackground(i), padding: "6px 0" }, children: /* @__PURE__ */ jsx35(ScoreCell, { score: score.ceilingScore ?? score.totalScore }) }),
5246
- /* @__PURE__ */ jsx35("div", { style: { background: rowBackground(i), padding: "6px 0" }, children: /* @__PURE__ */ jsx35(ScoreCell, { score: score.actualScore ?? 0 }) }),
5247
- /* @__PURE__ */ jsx35(
5592
+ /* @__PURE__ */ jsx36("div", { style: { background: rowBackground(i), padding: "6px 0" }, children: /* @__PURE__ */ jsx36(ScoreCell, { score: score.floorScore ?? 0 }) }),
5593
+ /* @__PURE__ */ jsx36("div", { style: { background: rowBackground(i), padding: "6px 0" }, children: /* @__PURE__ */ jsx36(ScoreCell, { score: score.ceilingScore ?? score.totalScore }) }),
5594
+ /* @__PURE__ */ jsx36("div", { style: { background: rowBackground(i), padding: "6px 0" }, children: /* @__PURE__ */ jsx36(ScoreCell, { score: score.actualScore ?? 0 }) }),
5595
+ /* @__PURE__ */ jsx36(
5248
5596
  "div",
5249
5597
  {
5250
5598
  style: {
@@ -5253,10 +5601,10 @@ function ThreeLayerTable({ scores }) {
5253
5601
  display: "flex",
5254
5602
  padding: "6px 0"
5255
5603
  },
5256
- children: /* @__PURE__ */ jsx35(Text30, { size: 1, children: score.retrievalGap != null ? score.retrievalGap.toFixed(1) : "\u2014" })
5604
+ children: /* @__PURE__ */ jsx36(Text31, { size: 1, children: score.retrievalGap != null ? score.retrievalGap.toFixed(1) : "\u2014" })
5257
5605
  }
5258
5606
  ),
5259
- /* @__PURE__ */ jsx35(
5607
+ /* @__PURE__ */ jsx36(
5260
5608
  "div",
5261
5609
  {
5262
5610
  style: {
@@ -5265,7 +5613,7 @@ function ThreeLayerTable({ scores }) {
5265
5613
  display: "flex",
5266
5614
  padding: "6px 0"
5267
5615
  },
5268
- children: /* @__PURE__ */ jsxs30(Text30, { size: 1, children: [
5616
+ children: /* @__PURE__ */ jsxs31(Text31, { size: 1, children: [
5269
5617
  formatPercent(score.infrastructureEfficiency),
5270
5618
  score.invertedRetrievalGap && " \u26A0\uFE0F"
5271
5619
  ] })
@@ -5275,17 +5623,28 @@ function ThreeLayerTable({ scores }) {
5275
5623
  ]
5276
5624
  }
5277
5625
  ),
5278
- hasInverted && /* @__PURE__ */ jsx35(Text30, { muted: true, size: 0, children: GLOSSARY.invertedRetGap })
5626
+ hasInverted && /* @__PURE__ */ jsx36(Text31, { muted: true, size: 0, children: GLOSSARY.invertedRetGap })
5279
5627
  ] }) });
5280
5628
  }
5281
5629
 
5282
5630
  // src/components/report-detail/ReportDetail.tsx
5283
- import { jsx as jsx36, jsxs as jsxs31 } from "react/jsx-runtime";
5284
- function ReportDetail({ onBack, reportId }) {
5631
+ import { jsx as jsx37, jsxs as jsxs32 } from "react/jsx-runtime";
5632
+ var OVERVIEW_TAB = { id: "overview", label: "Overview" };
5633
+ var DIAGNOSTICS_TAB = { id: "diagnostics", label: "Diagnostics" };
5634
+ var ACTIVITY_TAB = { id: "activity", label: "Agent Activity" };
5635
+ function parseTab(raw) {
5636
+ if (raw === "diagnostics" || raw === "activity") return raw;
5637
+ return "overview";
5638
+ }
5639
+ function ReportDetail({
5640
+ activeTab,
5641
+ onBack,
5642
+ onTabChange,
5643
+ reportId
5644
+ }) {
5285
5645
  const client = useClient6({ apiVersion: API_VERSION });
5286
- const toast = useToast();
5287
- const [loading, setLoading] = useState8(true);
5288
- const [report, setReport] = useState8(null);
5646
+ const [loading, setLoading] = useState9(true);
5647
+ const [report, setReport] = useState9(null);
5289
5648
  useEffect7(() => {
5290
5649
  let cancelled = false;
5291
5650
  setLoading(true);
@@ -5303,26 +5662,38 @@ function ReportDetail({ onBack, reportId }) {
5303
5662
  }, [client, reportId]);
5304
5663
  const handleCopyReportId = useCallback12(() => {
5305
5664
  if (!report) return;
5306
- navigator.clipboard.writeText(report.reportId).then(() => {
5307
- toast.push({
5308
- closable: true,
5309
- status: "success",
5310
- title: "Report ID copied to clipboard"
5311
- });
5312
- }).catch(() => {
5313
- toast.push({
5314
- closable: true,
5315
- status: "error",
5316
- title: "Failed to copy \u2014 try selecting the text manually"
5317
- });
5665
+ navigator.clipboard.writeText(report.reportId).catch(() => {
5318
5666
  });
5319
- }, [report, toast]);
5667
+ }, [report]);
5668
+ const { summary } = report ?? {};
5669
+ const hasDiagnostics = Boolean(
5670
+ summary?.recommendations && summary.recommendations.gaps.length > 0 || summary?.lowScoringJudgments && summary.lowScoringJudgments.length > 0
5671
+ );
5672
+ const hasAgentActivity = Boolean(
5673
+ summary?.agentBehavior && summary.agentBehavior.length > 0
5674
+ );
5675
+ const tabs = useMemo7(() => {
5676
+ const result = [OVERVIEW_TAB];
5677
+ if (hasDiagnostics) result.push(DIAGNOSTICS_TAB);
5678
+ if (hasAgentActivity) result.push(ACTIVITY_TAB);
5679
+ return result;
5680
+ }, [hasDiagnostics, hasAgentActivity]);
5681
+ const currentTab = useMemo7(() => {
5682
+ const parsed = parseTab(activeTab);
5683
+ return tabs.some((t) => t.id === parsed) ? parsed : "overview";
5684
+ }, [activeTab, tabs]);
5685
+ const handleTabClick = useCallback12(
5686
+ (tabId) => {
5687
+ onTabChange(tabId === "overview" ? null : tabId);
5688
+ },
5689
+ [onTabChange]
5690
+ );
5320
5691
  if (loading) {
5321
- return /* @__PURE__ */ jsx36(LoadingState, { message: "Loading report\u2026" });
5692
+ return /* @__PURE__ */ jsx37(LoadingState, { message: "Loading report\u2026" });
5322
5693
  }
5323
- if (!report) {
5324
- return /* @__PURE__ */ jsx36(Box14, { padding: 5, children: /* @__PURE__ */ jsxs31(Stack22, { space: 4, children: [
5325
- /* @__PURE__ */ jsx36(
5694
+ if (!report || !summary) {
5695
+ return /* @__PURE__ */ jsx37(Box15, { padding: 5, children: /* @__PURE__ */ jsxs32(Stack23, { space: 4, children: [
5696
+ /* @__PURE__ */ jsx37(
5326
5697
  Button3,
5327
5698
  {
5328
5699
  icon: ArrowLeftIcon2,
@@ -5331,14 +5702,14 @@ function ReportDetail({ onBack, reportId }) {
5331
5702
  text: "Back"
5332
5703
  }
5333
5704
  ),
5334
- /* @__PURE__ */ jsx36(Text31, { align: "center", muted: true, size: 2, children: "Report not found" })
5705
+ /* @__PURE__ */ jsx37(Text32, { align: "center", muted: true, size: 2, children: "Report not found" })
5335
5706
  ] }) });
5336
5707
  }
5337
- const { comparison, provenance, summary } = report;
5708
+ const { comparison, provenance } = report;
5338
5709
  const totalTests = summary.scores.reduce((n, s) => n + s.testCount, 0);
5339
5710
  const isFullMode = summary.evaluationMode === "full" || summary.scores.some((s) => s.actualScore != null);
5340
- return /* @__PURE__ */ jsx36(Box14, { padding: 4, children: /* @__PURE__ */ jsxs31(Stack22, { space: 5, children: [
5341
- /* @__PURE__ */ jsx36(
5711
+ return /* @__PURE__ */ jsx37(Box15, { padding: 4, children: /* @__PURE__ */ jsxs32(Stack23, { space: 5, children: [
5712
+ /* @__PURE__ */ jsx37(
5342
5713
  ReportHeader,
5343
5714
  {
5344
5715
  completedAt: report.completedAt,
@@ -5350,29 +5721,80 @@ function ReportDetail({ onBack, reportId }) {
5350
5721
  tag: report.tag
5351
5722
  }
5352
5723
  ),
5353
- /* @__PURE__ */ jsx36(
5354
- OverviewStats,
5724
+ tabs.length > 1 && /* @__PURE__ */ jsx37(TabList, { space: 1, children: tabs.map((tab) => /* @__PURE__ */ jsx37(
5725
+ Tab,
5355
5726
  {
5356
- durationMs: report.durationMs,
5357
- isFullMode,
5358
- overall: summary.overall,
5359
- totalTests
5727
+ "aria-controls": `panel-${tab.id}`,
5728
+ id: `tab-${tab.id}`,
5729
+ label: tab.label,
5730
+ onClick: () => handleTabClick(tab.id),
5731
+ selected: currentTab === tab.id
5732
+ },
5733
+ tab.id
5734
+ )) }),
5735
+ currentTab === "overview" && /* @__PURE__ */ jsx37(
5736
+ TabPanel,
5737
+ {
5738
+ "aria-labelledby": "tab-overview",
5739
+ hidden: currentTab !== "overview",
5740
+ id: "panel-overview",
5741
+ children: /* @__PURE__ */ jsxs32(Stack23, { space: 5, children: [
5742
+ /* @__PURE__ */ jsx37(
5743
+ OverviewStats,
5744
+ {
5745
+ durationMs: report.durationMs,
5746
+ isFullMode,
5747
+ overall: summary.overall,
5748
+ totalTests
5749
+ }
5750
+ ),
5751
+ isFullMode && /* @__PURE__ */ jsx37(ThreeLayerTable, { scores: summary.scores }),
5752
+ /* @__PURE__ */ jsx37(AreaScoreTable, { scores: summary.scores }),
5753
+ comparison && /* @__PURE__ */ jsx37(ComparisonSummary, { comparison }),
5754
+ /* @__PURE__ */ jsx37(ProvenanceCard, { provenance })
5755
+ ] })
5360
5756
  }
5361
5757
  ),
5362
- isFullMode && /* @__PURE__ */ jsx36(ThreeLayerTable, { scores: summary.scores }),
5363
- /* @__PURE__ */ jsx36(AreaScoreTable, { scores: summary.scores }),
5364
- summary.recommendations && summary.recommendations.gaps.length > 0 && /* @__PURE__ */ jsx36(RecommendationsSection, { recommendations: summary.recommendations }),
5365
- summary.lowScoringJudgments && summary.lowScoringJudgments.length > 0 && /* @__PURE__ */ jsx36(JudgmentList, { judgments: summary.lowScoringJudgments }),
5366
- comparison && /* @__PURE__ */ jsx36(ComparisonSummary, { comparison }),
5367
- /* @__PURE__ */ jsx36(ProvenanceCard, { provenance })
5758
+ currentTab === "diagnostics" && hasDiagnostics && /* @__PURE__ */ jsx37(
5759
+ TabPanel,
5760
+ {
5761
+ "aria-labelledby": "tab-diagnostics",
5762
+ hidden: currentTab !== "diagnostics",
5763
+ id: "panel-diagnostics",
5764
+ children: /* @__PURE__ */ jsxs32(Stack23, { space: 5, children: [
5765
+ summary.recommendations && summary.recommendations.gaps.length > 0 && /* @__PURE__ */ jsx37(
5766
+ RecommendationsSection,
5767
+ {
5768
+ recommendations: summary.recommendations
5769
+ }
5770
+ ),
5771
+ summary.lowScoringJudgments && summary.lowScoringJudgments.length > 0 && /* @__PURE__ */ jsx37(JudgmentList, { judgments: summary.lowScoringJudgments })
5772
+ ] })
5773
+ }
5774
+ ),
5775
+ currentTab === "activity" && hasAgentActivity && /* @__PURE__ */ jsx37(
5776
+ TabPanel,
5777
+ {
5778
+ "aria-labelledby": "tab-activity",
5779
+ hidden: currentTab !== "activity",
5780
+ id: "panel-activity",
5781
+ children: /* @__PURE__ */ jsx37(
5782
+ AgentActivitySection,
5783
+ {
5784
+ agentBehavior: summary.agentBehavior,
5785
+ overall: summary.overall.agentBehavior
5786
+ }
5787
+ )
5788
+ }
5789
+ )
5368
5790
  ] }) });
5369
5791
  }
5370
5792
 
5371
5793
  // src/components/ScoreTimeline.tsx
5372
- import { Card as Card22, Flex as Flex24, Select as Select2, Stack as Stack23, Text as Text32 } from "@sanity/ui";
5373
- import { useCallback as useCallback13, useEffect as useEffect8, useMemo as useMemo6, useState as useState9 } from "react";
5794
+ import { Card as Card23, Flex as Flex25, Select as Select2, Stack as Stack24, Text as Text33 } from "@sanity/ui";
5795
+ import { useCallback as useCallback13, useEffect as useEffect8, useMemo as useMemo8, useState as useState10 } from "react";
5374
5796
  import { useClient as useClient7 } from "sanity";
5375
- import { jsx as jsx37, jsxs as jsxs32 } from "react/jsx-runtime";
5797
+ import { jsx as jsx38, jsxs as jsxs33 } from "react/jsx-runtime";
5376
5798
  var CHART_HEIGHT = 220;
5377
5799
  var CHART_WIDTH = 800;
5378
5800
  var PAD_BOTTOM = 30;
@@ -5407,11 +5829,11 @@ function scoreForPoint(point, area) {
5407
5829
  }
5408
5830
  function ScoreTimeline({ mode = null, source = null }) {
5409
5831
  const client = useClient7({ apiVersion: API_VERSION });
5410
- const [dataPoints, setDataPoints] = useState9([]);
5411
- const [loading, setLoading] = useState9(true);
5412
- const [rangeDays, setRangeDays] = useState9(30);
5413
- const [selectedArea, setSelectedArea] = useState9(null);
5414
- const areaNames = useMemo6(() => {
5832
+ const [dataPoints, setDataPoints] = useState10([]);
5833
+ const [loading, setLoading] = useState10(true);
5834
+ const [rangeDays, setRangeDays] = useState10(30);
5835
+ const [selectedArea, setSelectedArea] = useState10(null);
5836
+ const areaNames = useMemo8(() => {
5415
5837
  const names = /* @__PURE__ */ new Set();
5416
5838
  for (const dp of dataPoints) {
5417
5839
  for (const s of dp.scores) {
@@ -5438,7 +5860,7 @@ function ScoreTimeline({ mode = null, source = null }) {
5438
5860
  useEffect8(() => {
5439
5861
  void fetchData();
5440
5862
  }, [fetchData]);
5441
- const chartPoints = useMemo6(() => {
5863
+ const chartPoints = useMemo8(() => {
5442
5864
  const pts = [];
5443
5865
  const scored = dataPoints.map((dp) => ({
5444
5866
  date: dp.completedAt,
@@ -5452,7 +5874,7 @@ function ScoreTimeline({ mode = null, source = null }) {
5452
5874
  });
5453
5875
  return pts;
5454
5876
  }, [dataPoints, selectedArea]);
5455
- const avgScore = useMemo6(() => {
5877
+ const avgScore = useMemo8(() => {
5456
5878
  if (chartPoints.length === 0) return 0;
5457
5879
  return chartPoints.reduce((sum, p) => sum + p.score, 0) / chartPoints.length;
5458
5880
  }, [chartPoints]);
@@ -5471,22 +5893,22 @@ function ScoreTimeline({ mode = null, source = null }) {
5471
5893
  []
5472
5894
  );
5473
5895
  const polylinePoints = chartPoints.map((p) => `${p.x},${p.y}`).join(" ");
5474
- return /* @__PURE__ */ jsxs32(Stack23, { space: 4, children: [
5475
- /* @__PURE__ */ jsxs32(Flex24, { gap: 3, children: [
5476
- /* @__PURE__ */ jsx37(
5896
+ return /* @__PURE__ */ jsxs33(Stack24, { space: 4, children: [
5897
+ /* @__PURE__ */ jsxs33(Flex25, { gap: 3, children: [
5898
+ /* @__PURE__ */ jsx38(
5477
5899
  Select2,
5478
5900
  {
5479
5901
  onChange: handleRangeChange,
5480
5902
  value: rangeDays?.toString() ?? "all",
5481
- children: TIME_RANGES.map((r) => /* @__PURE__ */ jsx37("option", { value: r.days?.toString() ?? "all", children: r.label }, r.label))
5903
+ children: TIME_RANGES.map((r) => /* @__PURE__ */ jsx38("option", { value: r.days?.toString() ?? "all", children: r.label }, r.label))
5482
5904
  }
5483
5905
  ),
5484
- /* @__PURE__ */ jsxs32(Select2, { onChange: handleAreaChange, value: selectedArea ?? "", children: [
5485
- /* @__PURE__ */ jsx37("option", { value: "", children: "Overall" }),
5486
- areaNames.map((name) => /* @__PURE__ */ jsx37("option", { value: name, children: name }, name))
5906
+ /* @__PURE__ */ jsxs33(Select2, { onChange: handleAreaChange, value: selectedArea ?? "", children: [
5907
+ /* @__PURE__ */ jsx38("option", { value: "", children: "Overall" }),
5908
+ areaNames.map((name) => /* @__PURE__ */ jsx38("option", { value: name, children: name }, name))
5487
5909
  ] })
5488
5910
  ] }),
5489
- /* @__PURE__ */ jsx37(Card22, { padding: 3, radius: 2, shadow: 1, children: loading ? /* @__PURE__ */ jsx37(Flex24, { align: "center", justify: "center", style: { height: 200 }, children: /* @__PURE__ */ jsx37(Text32, { muted: true, size: 1, children: "Loading\u2026" }) }) : chartPoints.length === 0 ? /* @__PURE__ */ jsx37(Flex24, { align: "center", justify: "center", style: { height: 200 }, children: /* @__PURE__ */ jsx37(Text32, { muted: true, size: 1, children: "No reports found for this time range" }) }) : /* @__PURE__ */ jsxs32(
5911
+ /* @__PURE__ */ jsx38(Card23, { padding: 3, radius: 2, shadow: 1, children: loading ? /* @__PURE__ */ jsx38(Flex25, { align: "center", justify: "center", style: { height: 200 }, children: /* @__PURE__ */ jsx38(Text33, { muted: true, size: 1, children: "Loading\u2026" }) }) : chartPoints.length === 0 ? /* @__PURE__ */ jsx38(Flex25, { align: "center", justify: "center", style: { height: 200 }, children: /* @__PURE__ */ jsx38(Text33, { muted: true, size: 1, children: "No reports found for this time range" }) }) : /* @__PURE__ */ jsxs33(
5490
5912
  "svg",
5491
5913
  {
5492
5914
  style: { display: "block", width: "100%" },
@@ -5494,8 +5916,8 @@ function ScoreTimeline({ mode = null, source = null }) {
5494
5916
  children: [
5495
5917
  Y_TICKS.map((tick) => {
5496
5918
  const y = PAD_TOP + PLOT_HEIGHT - tick / Y_MAX * PLOT_HEIGHT;
5497
- return /* @__PURE__ */ jsxs32("g", { children: [
5498
- /* @__PURE__ */ jsx37(
5919
+ return /* @__PURE__ */ jsxs33("g", { children: [
5920
+ /* @__PURE__ */ jsx38(
5499
5921
  "line",
5500
5922
  {
5501
5923
  stroke: "#ccc",
@@ -5506,7 +5928,7 @@ function ScoreTimeline({ mode = null, source = null }) {
5506
5928
  y2: y
5507
5929
  }
5508
5930
  ),
5509
- /* @__PURE__ */ jsx37(
5931
+ /* @__PURE__ */ jsx38(
5510
5932
  "text",
5511
5933
  {
5512
5934
  dominantBaseline: "middle",
@@ -5526,7 +5948,7 @@ function ScoreTimeline({ mode = null, source = null }) {
5526
5948
  chartPoints.length - 1
5527
5949
  ].map((idx) => {
5528
5950
  const p = chartPoints[idx];
5529
- return /* @__PURE__ */ jsx37(
5951
+ return /* @__PURE__ */ jsx38(
5530
5952
  "text",
5531
5953
  {
5532
5954
  fill: "#999",
@@ -5538,7 +5960,7 @@ function ScoreTimeline({ mode = null, source = null }) {
5538
5960
  },
5539
5961
  idx
5540
5962
  );
5541
- }) : chartPoints.map((p, idx) => /* @__PURE__ */ jsx37(
5963
+ }) : chartPoints.map((p, idx) => /* @__PURE__ */ jsx38(
5542
5964
  "text",
5543
5965
  {
5544
5966
  fill: "#999",
@@ -5550,7 +5972,7 @@ function ScoreTimeline({ mode = null, source = null }) {
5550
5972
  },
5551
5973
  idx
5552
5974
  )),
5553
- /* @__PURE__ */ jsx37(
5975
+ /* @__PURE__ */ jsx38(
5554
5976
  "polyline",
5555
5977
  {
5556
5978
  fill: "none",
@@ -5560,7 +5982,7 @@ function ScoreTimeline({ mode = null, source = null }) {
5560
5982
  strokeWidth: 2.5
5561
5983
  }
5562
5984
  ),
5563
- chartPoints.map((p, idx) => /* @__PURE__ */ jsx37(
5985
+ chartPoints.map((p, idx) => /* @__PURE__ */ jsx38(
5564
5986
  "circle",
5565
5987
  {
5566
5988
  cx: p.x,
@@ -5569,7 +5991,7 @@ function ScoreTimeline({ mode = null, source = null }) {
5569
5991
  r: 4,
5570
5992
  stroke: "#fff",
5571
5993
  strokeWidth: 1.5,
5572
- children: /* @__PURE__ */ jsxs32("title", { children: [
5994
+ children: /* @__PURE__ */ jsxs33("title", { children: [
5573
5995
  formatDate2(p.date),
5574
5996
  ": ",
5575
5997
  Math.round(p.score)
@@ -5580,7 +6002,7 @@ function ScoreTimeline({ mode = null, source = null }) {
5580
6002
  ]
5581
6003
  }
5582
6004
  ) }),
5583
- /* @__PURE__ */ jsxs32(Text32, { muted: true, size: 1, children: [
6005
+ /* @__PURE__ */ jsxs33(Text33, { muted: true, size: 1, children: [
5584
6006
  chartPoints.length,
5585
6007
  " data point",
5586
6008
  chartPoints.length !== 1 ? "s" : ""
@@ -5590,7 +6012,7 @@ function ScoreTimeline({ mode = null, source = null }) {
5590
6012
  var ScoreTimeline_default = ScoreTimeline;
5591
6013
 
5592
6014
  // src/components/Dashboard.tsx
5593
- import { jsx as jsx38, jsxs as jsxs33 } from "react/jsx-runtime";
6015
+ import { jsx as jsx39, jsxs as jsxs34 } from "react/jsx-runtime";
5594
6016
  var VIEW_PARAM_MAP = {
5595
6017
  compare: "compare",
5596
6018
  timeline: "timeline"
@@ -5618,53 +6040,64 @@ function Dashboard() {
5618
6040
  },
5619
6041
  [router]
5620
6042
  );
6043
+ const handleTabChange = useCallback14(
6044
+ (tab) => {
6045
+ if (!routerState.reportId) return;
6046
+ if (tab) {
6047
+ router.navigate({ reportId: routerState.reportId, tab });
6048
+ } else {
6049
+ router.navigate({ reportId: routerState.reportId });
6050
+ }
6051
+ },
6052
+ [router, routerState.reportId]
6053
+ );
5621
6054
  const handleBack = useCallback14(() => {
5622
6055
  router.navigate({});
5623
6056
  }, [router]);
5624
- const [source, setSource] = useState10(null);
5625
- const [mode, setMode] = useState10(null);
5626
- const [sources, setSources] = useState10([]);
5627
- const [modes, setModes] = useState10([]);
6057
+ const [source, setSource] = useState11(null);
6058
+ const [mode, setMode] = useState11(null);
6059
+ const [sources, setSources] = useState11([]);
6060
+ const [modes, setModes] = useState11([]);
5628
6061
  useEffect9(() => {
5629
6062
  client.fetch(distinctSourcesQuery).then((data) => setSources(data ?? [])).catch(() => setSources([]));
5630
6063
  client.fetch(distinctModesQuery).then((data) => setModes(data ?? [])).catch(() => setModes([]));
5631
6064
  }, [client]);
5632
- return /* @__PURE__ */ jsx38(Container, { width: 2, children: /* @__PURE__ */ jsxs33(Stack24, { padding: 4, space: 4, children: [
5633
- /* @__PURE__ */ jsxs33(Flex25, { align: "center", gap: 3, children: [
5634
- /* @__PURE__ */ jsxs33(Stack24, { flex: 1, space: 1, children: [
5635
- /* @__PURE__ */ jsx38(Text33, { size: 3, weight: "bold", children: "AI Literacy Framework" }),
5636
- /* @__PURE__ */ jsx38(Text33, { muted: true, size: 1, children: "Evaluation reports and score trends" })
6065
+ return /* @__PURE__ */ jsx39(Container, { width: 2, children: /* @__PURE__ */ jsxs34(Stack25, { padding: 4, space: 4, children: [
6066
+ /* @__PURE__ */ jsxs34(Flex26, { align: "center", gap: 3, children: [
6067
+ /* @__PURE__ */ jsxs34(Stack25, { flex: 1, space: 1, children: [
6068
+ /* @__PURE__ */ jsx39(Text34, { size: 3, weight: "bold", children: "AI Literacy Framework" }),
6069
+ /* @__PURE__ */ jsx39(Text34, { muted: true, size: 1, children: "Evaluation reports and score trends" })
5637
6070
  ] }),
5638
- !isDetail && /* @__PURE__ */ jsxs33(Flex25, { gap: 2, children: [
5639
- /* @__PURE__ */ jsxs33(
6071
+ !isDetail && /* @__PURE__ */ jsxs34(Flex26, { gap: 2, children: [
6072
+ /* @__PURE__ */ jsxs34(
5640
6073
  Select3,
5641
6074
  {
5642
6075
  fontSize: 1,
5643
6076
  onChange: (e) => setSource(e.currentTarget.value || null),
5644
6077
  value: source ?? "",
5645
6078
  children: [
5646
- /* @__PURE__ */ jsx38("option", { value: "", children: "All sources" }),
5647
- sources.map((s) => /* @__PURE__ */ jsx38("option", { value: s, children: s }, s))
6079
+ /* @__PURE__ */ jsx39("option", { value: "", children: "All sources" }),
6080
+ sources.map((s) => /* @__PURE__ */ jsx39("option", { value: s, children: s }, s))
5648
6081
  ]
5649
6082
  }
5650
6083
  ),
5651
- /* @__PURE__ */ jsxs33(
6084
+ /* @__PURE__ */ jsxs34(
5652
6085
  Select3,
5653
6086
  {
5654
6087
  fontSize: 1,
5655
6088
  onChange: (e) => setMode(e.currentTarget.value || null),
5656
6089
  value: mode ?? "",
5657
6090
  children: [
5658
- /* @__PURE__ */ jsx38("option", { value: "", children: "All modes" }),
5659
- modes.map((m) => /* @__PURE__ */ jsx38("option", { value: m, children: m }, m))
6091
+ /* @__PURE__ */ jsx39("option", { value: "", children: "All modes" }),
6092
+ modes.map((m) => /* @__PURE__ */ jsx39("option", { value: m, children: m }, m))
5660
6093
  ]
5661
6094
  }
5662
6095
  )
5663
6096
  ] })
5664
6097
  ] }),
5665
- !isDetail && /* @__PURE__ */ jsxs33(TabList, { space: 1, children: [
5666
- /* @__PURE__ */ jsx38(
5667
- Tab,
6098
+ !isDetail && /* @__PURE__ */ jsxs34(TabList2, { space: 1, children: [
6099
+ /* @__PURE__ */ jsx39(
6100
+ Tab2,
5668
6101
  {
5669
6102
  "aria-controls": "latest-panel",
5670
6103
  id: "latest-tab",
@@ -5673,8 +6106,8 @@ function Dashboard() {
5673
6106
  selected: activeTab === "latest"
5674
6107
  }
5675
6108
  ),
5676
- /* @__PURE__ */ jsx38(
5677
- Tab,
6109
+ /* @__PURE__ */ jsx39(
6110
+ Tab2,
5678
6111
  {
5679
6112
  "aria-controls": "timeline-panel",
5680
6113
  id: "timeline-tab",
@@ -5683,8 +6116,8 @@ function Dashboard() {
5683
6116
  selected: activeTab === "timeline"
5684
6117
  }
5685
6118
  ),
5686
- /* @__PURE__ */ jsx38(
5687
- Tab,
6119
+ /* @__PURE__ */ jsx39(
6120
+ Tab2,
5688
6121
  {
5689
6122
  "aria-controls": "compare-panel",
5690
6123
  id: "compare-tab",
@@ -5694,7 +6127,7 @@ function Dashboard() {
5694
6127
  }
5695
6128
  )
5696
6129
  ] }),
5697
- !isDetail && activeTab === "latest" && /* @__PURE__ */ jsx38(TabPanel, { "aria-labelledby": "latest-tab", id: "latest-panel", children: /* @__PURE__ */ jsx38(
6130
+ !isDetail && activeTab === "latest" && /* @__PURE__ */ jsx39(TabPanel2, { "aria-labelledby": "latest-tab", id: "latest-panel", children: /* @__PURE__ */ jsx39(
5698
6131
  LatestReports,
5699
6132
  {
5700
6133
  mode,
@@ -5702,15 +6135,23 @@ function Dashboard() {
5702
6135
  source
5703
6136
  }
5704
6137
  ) }),
5705
- !isDetail && activeTab === "timeline" && /* @__PURE__ */ jsx38(TabPanel, { "aria-labelledby": "timeline-tab", id: "timeline-panel", children: /* @__PURE__ */ jsx38(ScoreTimeline_default, { mode, source }) }),
5706
- !isDetail && activeTab === "compare" && /* @__PURE__ */ jsx38(TabPanel, { "aria-labelledby": "compare-tab", id: "compare-panel", children: /* @__PURE__ */ jsx38(ComparisonView, {}) }),
5707
- isDetail && reportId && /* @__PURE__ */ jsx38(ReportDetail, { onBack: handleBack, reportId })
6138
+ !isDetail && activeTab === "timeline" && /* @__PURE__ */ jsx39(TabPanel2, { "aria-labelledby": "timeline-tab", id: "timeline-panel", children: /* @__PURE__ */ jsx39(ScoreTimeline_default, { mode, source }) }),
6139
+ !isDetail && activeTab === "compare" && /* @__PURE__ */ jsx39(TabPanel2, { "aria-labelledby": "compare-tab", id: "compare-panel", children: /* @__PURE__ */ jsx39(ComparisonView, {}) }),
6140
+ isDetail && reportId && /* @__PURE__ */ jsx39(
6141
+ ReportDetail,
6142
+ {
6143
+ activeTab: routerState.tab ?? null,
6144
+ onBack: handleBack,
6145
+ onTabChange: handleTabChange,
6146
+ reportId
6147
+ }
6148
+ )
5708
6149
  ] }) });
5709
6150
  }
5710
6151
 
5711
6152
  // src/tool.tsx
5712
6153
  var toolRouter = route.create("/", [
5713
- route.create("/report/:reportId"),
6154
+ route.create("/report/:reportId", [route.create("/:tab")]),
5714
6155
  route.create("/:view")
5715
6156
  ]);
5716
6157
  function ailfTool(options = {}) {
@@ -5725,7 +6166,7 @@ function ailfTool(options = {}) {
5725
6166
 
5726
6167
  // src/actions/RunEvaluationAction.tsx
5727
6168
  import { BarChartIcon as BarChartIcon2 } from "@sanity/icons";
5728
- import { useCallback as useCallback15, useEffect as useEffect10, useRef as useRef4, useState as useState11 } from "react";
6169
+ import { useCallback as useCallback15, useEffect as useEffect10, useRef as useRef4, useState as useState12 } from "react";
5729
6170
  import {
5730
6171
  getReleaseIdFromReleaseDocumentId as getReleaseIdFromReleaseDocumentId4,
5731
6172
  useClient as useClient9,
@@ -5755,7 +6196,7 @@ function createRunEvaluationAction(options = {}) {
5755
6196
  const dataset = useDataset();
5756
6197
  const projectId = useProjectId();
5757
6198
  const currentUser = useCurrentUser();
5758
- const [state, setState] = useState11({ status: "loading" });
6199
+ const [state, setState] = useState12({ status: "loading" });
5759
6200
  const requestedAtRef = useRef4(null);
5760
6201
  const perspectiveId = getReleaseIdFromReleaseDocumentId4(release._id);
5761
6202
  useEffect10(() => {