@absolutejs/absolute 0.19.0-beta.543 → 0.19.0-beta.545

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.
@@ -867,6 +867,232 @@ var buildRAGRetrievalTracePresentation = (trace) => {
867
867
  steps
868
868
  };
869
869
  };
870
+ var formatCompactList = (values) => values && values.length > 0 ? values.join(", ") : "none";
871
+ var formatCoverageMap = (entries) => {
872
+ if (!entries) {
873
+ return "none";
874
+ }
875
+ const values = Object.entries(entries);
876
+ return values.length > 0 ? values.map(([key, value]) => `${key} ${value}`).join(" \xB7 ") : "none";
877
+ };
878
+ var formatDurationLabel = (value) => {
879
+ if (typeof value !== "number" || !Number.isFinite(value)) {
880
+ return "n/a";
881
+ }
882
+ if (value < 1000) {
883
+ return `${value}ms`;
884
+ }
885
+ if (value < 60000) {
886
+ return `${(value / 1000).toFixed(value >= 1e4 ? 0 : 1)}s`;
887
+ }
888
+ if (value < 3600000) {
889
+ return `${(value / 60000).toFixed(value >= 600000 ? 0 : 1)}m`;
890
+ }
891
+ return `${(value / 3600000).toFixed(value >= 36000000 ? 0 : 1)}h`;
892
+ };
893
+ var formatDateLabel = (value) => typeof value === "number" && Number.isFinite(value) ? new Date(value).toLocaleString("en-US") : "n/a";
894
+ var formatAgeLabel = (value) => {
895
+ if (typeof value !== "number" || !Number.isFinite(value)) {
896
+ return "n/a";
897
+ }
898
+ if (value < 1000) {
899
+ return `${Math.round(value)}ms`;
900
+ }
901
+ if (value < 60000) {
902
+ return `${(value / 1000).toFixed(value >= 1e4 ? 0 : 1)}s`;
903
+ }
904
+ if (value < 3600000) {
905
+ return `${(value / 60000).toFixed(value >= 600000 ? 0 : 1)}m`;
906
+ }
907
+ if (value < 86400000) {
908
+ return `${(value / 3600000).toFixed(value >= 36000000 ? 0 : 1)}h`;
909
+ }
910
+ return `${(value / 86400000).toFixed(value >= 864000000 ? 0 : 1)}d`;
911
+ };
912
+ var buildSyncOverviewLatestRow = (sources) => {
913
+ const latest = [...sources].filter((record) => typeof record.lastSuccessfulSyncAt === "number" || typeof record.lastSyncedAt === "number").sort((left, right) => (right.lastSuccessfulSyncAt ?? right.lastSyncedAt ?? 0) - (left.lastSuccessfulSyncAt ?? left.lastSyncedAt ?? 0))[0];
914
+ if (!latest) {
915
+ return {
916
+ label: "Latest sync",
917
+ value: "No completed run yet"
918
+ };
919
+ }
920
+ return {
921
+ label: "Latest sync",
922
+ value: [
923
+ latest.label,
924
+ typeof latest.documentCount === "number" ? `${latest.documentCount} docs` : "",
925
+ typeof latest.chunkCount === "number" ? `${latest.chunkCount} chunks` : "",
926
+ typeof latest.lastSyncDurationMs === "number" ? formatDurationLabel(latest.lastSyncDurationMs) : "",
927
+ typeof latest.lastSuccessfulSyncAt === "number" ? formatDateLabel(latest.lastSuccessfulSyncAt) : typeof latest.lastSyncedAt === "number" ? formatDateLabel(latest.lastSyncedAt) : ""
928
+ ].filter(Boolean).join(" \xB7 ")
929
+ };
930
+ };
931
+ var buildRAGReadinessPresentation = (readiness) => {
932
+ if (!readiness) {
933
+ return {
934
+ sections: [
935
+ {
936
+ label: "Provider",
937
+ title: "Unavailable",
938
+ summary: "Readiness data is not available yet."
939
+ }
940
+ ]
941
+ };
942
+ }
943
+ return {
944
+ sections: [
945
+ {
946
+ label: "Provider",
947
+ title: readiness.providerConfigured ? readiness.providerName ?? "Runtime provider routing" : "Not configured",
948
+ summary: readiness.providerConfigured ? readiness.model ? `Requests route through ${readiness.providerName ?? "the runtime provider registry"} with default model ${readiness.model}.` : `Requests route through ${readiness.providerName ?? "the runtime provider registry"}.` : "Provider-backed retrieval is not configured yet."
949
+ },
950
+ {
951
+ label: "Embeddings",
952
+ title: readiness.embeddingConfigured ? readiness.embeddingModel === "collection-managed embeddings" ? "Collection-managed" : "Configured" : "Missing",
953
+ summary: readiness.embeddingConfigured ? readiness.embeddingModel === "collection-managed embeddings" ? "Embeddings come from the collection and vector store layer, so retrieval stays vector-backed without a separate top-level embedding provider." : readiness.embeddingModel ?? "Embedding model configured." : "Embeddings are not configured yet."
954
+ },
955
+ {
956
+ label: "Retrieval Stack",
957
+ title: readiness.rerankerConfigured ? "Reranker ready" : "Vector only",
958
+ summary: readiness.indexManagerConfigured ? "Index manager configured." : "Index manager not configured."
959
+ },
960
+ {
961
+ label: "Extractors",
962
+ title: readiness.extractorsConfigured ? `${readiness.extractorNames.length} configured` : "None configured",
963
+ summary: readiness.extractorsConfigured ? `Configured extractors: ${formatCompactList(readiness.extractorNames)}` : "No extractors configured.",
964
+ pills: readiness.extractorNames.length > 0 ? readiness.extractorNames : ["No extractors configured"]
965
+ }
966
+ ]
967
+ };
968
+ };
969
+ var buildRAGCorpusHealthPresentation = (health) => {
970
+ if (!health) {
971
+ return {
972
+ sections: [
973
+ {
974
+ label: "Corpus health",
975
+ title: "Unavailable",
976
+ summary: "Corpus health is not available yet."
977
+ }
978
+ ]
979
+ };
980
+ }
981
+ return {
982
+ sections: [
983
+ {
984
+ label: "Corpus coverage",
985
+ title: `Formats: ${formatCoverageMap(health.coverageByFormat)}`,
986
+ summary: `Kinds: ${formatCoverageMap(health.coverageByKind)}`,
987
+ rows: [
988
+ {
989
+ label: "Average chunks per document",
990
+ value: health.averageChunksPerDocument.toFixed(2)
991
+ }
992
+ ]
993
+ },
994
+ {
995
+ label: "Chunk quality",
996
+ title: `${health.averageChunksPerDocument.toFixed(2)} avg chunks/doc`,
997
+ summary: `Empty docs ${health.emptyDocuments} \xB7 empty chunks ${health.emptyChunks} \xB7 low signal ${health.lowSignalChunks}`,
998
+ rows: [
999
+ {
1000
+ label: "Missing source",
1001
+ value: String(health.documentsMissingSource)
1002
+ },
1003
+ {
1004
+ label: "Missing title",
1005
+ value: String(health.documentsMissingTitle)
1006
+ },
1007
+ {
1008
+ label: "Missing metadata",
1009
+ value: String(health.documentsMissingMetadata)
1010
+ }
1011
+ ]
1012
+ },
1013
+ {
1014
+ label: "Freshness",
1015
+ title: `${health.staleDocuments.length} stale docs`,
1016
+ summary: `Stale threshold ${formatAgeLabel(health.staleAfterMs)}`,
1017
+ rows: [
1018
+ {
1019
+ label: "Oldest age",
1020
+ value: formatAgeLabel(health.oldestDocumentAgeMs)
1021
+ },
1022
+ {
1023
+ label: "Newest age",
1024
+ value: formatAgeLabel(health.newestDocumentAgeMs)
1025
+ }
1026
+ ]
1027
+ },
1028
+ {
1029
+ label: "Failures",
1030
+ title: `${health.failedIngestJobs} ingest \xB7 ${health.failedAdminJobs} admin`,
1031
+ summary: `Duplicate sources ${health.duplicateSourceGroups.length} \xB7 duplicate ids ${health.duplicateDocumentIdGroups.length}`,
1032
+ rows: [
1033
+ {
1034
+ label: "Failures by input",
1035
+ value: formatCoverageMap(health.failuresByInputKind)
1036
+ },
1037
+ {
1038
+ label: "Failures by extractor",
1039
+ value: formatCoverageMap(health.failuresByExtractor)
1040
+ },
1041
+ {
1042
+ label: "Failures by admin action",
1043
+ value: formatCoverageMap(health.failuresByAdminAction)
1044
+ }
1045
+ ]
1046
+ }
1047
+ ]
1048
+ };
1049
+ };
1050
+ var buildRAGSyncOverviewPresentation = (sources) => {
1051
+ const records = sources ?? [];
1052
+ if (records.length === 0) {
1053
+ return {
1054
+ rows: [
1055
+ { label: "Configured sync sources", value: "0" },
1056
+ {
1057
+ label: "Latest sync",
1058
+ value: "No sync sources configured yet."
1059
+ }
1060
+ ],
1061
+ sections: [
1062
+ {
1063
+ label: "Sync overview",
1064
+ title: "No sync sources configured",
1065
+ summary: "Add sync sources to monitor directories, URLs, storage, or mailboxes."
1066
+ }
1067
+ ]
1068
+ };
1069
+ }
1070
+ const countByStatus = (status) => records.filter((record) => record.status === status).length;
1071
+ return {
1072
+ rows: [
1073
+ { label: "Configured sync sources", value: String(records.length) },
1074
+ { label: "Completed", value: String(countByStatus("completed")) },
1075
+ { label: "Running", value: String(countByStatus("running")) },
1076
+ {
1077
+ label: "Failed",
1078
+ value: String(countByStatus("failed"))
1079
+ },
1080
+ buildSyncOverviewLatestRow(records)
1081
+ ],
1082
+ sections: [
1083
+ {
1084
+ label: "Sync overview",
1085
+ title: `${records.length} configured`,
1086
+ summary: `${countByStatus("completed")} completed \xB7 ${countByStatus("running")} running \xB7 ${countByStatus("failed")} failed`
1087
+ },
1088
+ {
1089
+ label: "Latest sync",
1090
+ title: buildSyncOverviewLatestRow(records).value,
1091
+ summary: "Most recent completed or last-known sync activity."
1092
+ }
1093
+ ]
1094
+ };
1095
+ };
870
1096
  var formatMediaTimestamp = (value) => {
871
1097
  if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
872
1098
  return;
@@ -2409,7 +2635,7 @@ var buildRAGComparisonTraceDiffRows = (entry, leader) => {
2409
2635
  }
2410
2636
  return rows;
2411
2637
  };
2412
- var buildRAGRetrievalComparisonCardPresentations = (comparison) => {
2638
+ var buildRAGRetrievalComparisonPresentations = (comparison) => {
2413
2639
  const leader = comparison.entries[0];
2414
2640
  return comparison.entries.map((entry) => ({
2415
2641
  diffLabel: leader?.label ?? "Leader",
@@ -2426,7 +2652,7 @@ var buildRAGRetrievalComparisonOverviewPresentation = (comparison) => buildCompa
2426
2652
  resolveLabel: (id) => comparison.entries.find((entry) => entry.retrievalId === id)?.label ?? id ?? "n/a",
2427
2653
  summary: comparison.summary
2428
2654
  });
2429
- var buildRAGRerankerComparisonCardPresentations = (comparison) => {
2655
+ var buildRAGRerankerComparisonPresentations = (comparison) => {
2430
2656
  const leader = comparison.entries[0];
2431
2657
  return comparison.entries.map((entry) => ({
2432
2658
  diffLabel: leader?.label ?? "Leader",
@@ -2443,7 +2669,7 @@ var buildRAGRerankerComparisonOverviewPresentation = (comparison) => buildCompar
2443
2669
  resolveLabel: (id) => comparison.entries.find((entry) => entry.rerankerId === id)?.label ?? id ?? "n/a",
2444
2670
  summary: comparison.summary
2445
2671
  });
2446
- var buildRAGGroundingProviderCardPresentations = (entries) => entries.map((entry) => ({
2672
+ var buildRAGGroundingProviderPresentations = (entries) => entries.map((entry) => ({
2447
2673
  headline: [
2448
2674
  entry.label,
2449
2675
  `passing ${formatEvaluationPassingRate(entry.response.passingRate)}`,
@@ -2481,6 +2707,26 @@ var buildRAGGroundingProviderOverviewPresentation = (input) => {
2481
2707
  winnerSummary: winnerEntry ? `passing ${formatEvaluationPassingRate(winnerEntry.response.passingRate)} \xB7 citation f1 ${winnerEntry.response.summary.averageCitationF1.toFixed(3)} \xB7 resolved ${formatEvaluationPassingRate(winnerEntry.response.summary.averageResolvedCitationRate)}` : "Stored workflow evaluation"
2482
2708
  };
2483
2709
  };
2710
+ var buildRAGQualityOverviewPresentation = (input) => ({
2711
+ rows: [
2712
+ ...buildRAGRetrievalComparisonOverviewPresentation(input.retrievalComparison).rows,
2713
+ ...buildRAGRerankerComparisonOverviewPresentation(input.rerankerComparison).rows,
2714
+ {
2715
+ label: "Grounding",
2716
+ value: formatGroundingHistorySummaryValue(input.groundingEvaluation)
2717
+ },
2718
+ ...input.groundingProviderOverview?.rows ?? [
2719
+ {
2720
+ label: "Grounding providers",
2721
+ value: "Configure an AI provider to compare grounded answers."
2722
+ }
2723
+ ]
2724
+ ],
2725
+ insights: [
2726
+ "The example should answer three questions quickly: which strategy wins, whether grounding is stable, and whether the result regressed.",
2727
+ "Detailed case-by-case evidence stays behind collapsible sections so the page reads like a product surface instead of a console buffer."
2728
+ ]
2729
+ });
2484
2730
  var buildRAGGroundingProviderCaseComparisonPresentations = (comparisons) => comparisons.map((comparison) => {
2485
2731
  const resolveLabel = (key) => comparison.entries.find((entry) => entry.providerKey === key)?.label ?? key ?? "n/a";
2486
2732
  return {
@@ -4327,5 +4573,5 @@ export {
4327
4573
  AIStreamProvider
4328
4574
  };
4329
4575
 
4330
- //# debugId=01927E5ECB27E62E64756E2164756E21
4576
+ //# debugId=95C7A62BF77FE1EA64756E2164756E21
4331
4577
  //# sourceMappingURL=index.js.map