@railtownai/railtracks-visualizer 0.0.54 → 0.0.55
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/cjs/index.js +2819 -268
- package/dist/esm/index.js +2818 -270
- package/dist/types/agenthub/components/EvaluationsCompareView.d.ts +33 -0
- package/dist/types/agenthub/components/EvaluationsTable.d.ts +5 -1
- package/dist/types/agenthub/pages/evaluations-compare-drawer.d.ts +6 -6
- package/dist/types/agenthub/pages/evaluations-compare.d.ts +5 -1
- package/dist/types/agenthub/utils/evaluationsHaveSameMetrics.d.ts +15 -0
- package/dist/types/index.d.ts +6 -2
- package/package.json +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable comparison UI for two evaluations. Accepts Evaluation DTOs;
|
|
3
|
+
* DTO is auto-detected and transformed internally.
|
|
4
|
+
* Use in page view or drawer.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <EvaluationsCompareView
|
|
9
|
+
* evaluations={evaluations}
|
|
10
|
+
* evaluationId1={id1}
|
|
11
|
+
* evaluationId2={id2}
|
|
12
|
+
* onEvaluationId1Change={setId1}
|
|
13
|
+
* onEvaluationId2Change={setId2}
|
|
14
|
+
* />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import React from "react";
|
|
18
|
+
import type { Evaluation } from "../pages/evaluations.types";
|
|
19
|
+
import type { Evaluation as EvaluationDto } from "../../dto/Evaluation";
|
|
20
|
+
export interface EvaluationsCompareViewProps {
|
|
21
|
+
/** Evaluation DTOs from your API. Pre-transformed data is also accepted. */
|
|
22
|
+
evaluations: (Evaluation | EvaluationDto)[];
|
|
23
|
+
evaluationId1: string | null;
|
|
24
|
+
evaluationId2: string | null;
|
|
25
|
+
onEvaluationId1Change: (id: string | null) => void;
|
|
26
|
+
onEvaluationId2Change: (id: string | null) => void;
|
|
27
|
+
loading?: boolean;
|
|
28
|
+
/** When true, evaluation dropdowns are visible. When false (default), read-only view with no dropdowns or change button. */
|
|
29
|
+
showEvaluationComparisonDropdowns?: boolean;
|
|
30
|
+
/** Optional href for back link. When provided, a "Back to Evaluations" link is shown. */
|
|
31
|
+
backHref?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const EvaluationsCompareView: React.FC<EvaluationsCompareViewProps>;
|
|
@@ -21,7 +21,11 @@ export interface EvaluationsTableProps {
|
|
|
21
21
|
error?: string | null;
|
|
22
22
|
onRefresh?: () => void;
|
|
23
23
|
onRowClick?: (evaluation: Evaluation) => void;
|
|
24
|
-
onCompare?: (
|
|
24
|
+
onCompare?: (evaluationId1: string, evaluationId2: string) => void;
|
|
25
|
+
/** When provided, opens the compare drawer with these IDs (e.g. from URL compare param). */
|
|
26
|
+
compareIdsFromUrl?: [string, string] | null;
|
|
27
|
+
/** Called when compare selections change (e.g. to update URL). */
|
|
28
|
+
onCompareUrlChange?: (id1: string | null, id2: string | null) => void;
|
|
25
29
|
showFilters?: boolean;
|
|
26
30
|
showCompare?: boolean;
|
|
27
31
|
emptyMessage?: React.ReactNode;
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
import React from "react";
|
|
6
6
|
import type { Evaluation } from "./evaluations.types";
|
|
7
7
|
import type { Evaluation as EvaluationDto } from "../../dto/Evaluation";
|
|
8
|
-
export interface
|
|
8
|
+
export interface EvaluationsCompareDrawerProps {
|
|
9
9
|
open: boolean;
|
|
10
10
|
onClose: () => void;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
evaluationId1: string | null;
|
|
12
|
+
evaluationId2: string | null;
|
|
13
13
|
/** Evaluation DTOs from your API. Pre-transformed data is also accepted. */
|
|
14
14
|
evaluations: (Evaluation | EvaluationDto)[];
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
onEvaluationId1Change: (id: string | null) => void;
|
|
16
|
+
onEvaluationId2Change: (id: string | null) => void;
|
|
17
17
|
}
|
|
18
|
-
export declare const
|
|
18
|
+
export declare const EvaluationsCompareDrawer: React.FC<EvaluationsCompareDrawerProps>;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export
|
|
2
|
+
export interface EvaluationsComparePageProps {
|
|
3
|
+
/** Optional href for back link (e.g. "#/evaluations" for HashRouter). */
|
|
4
|
+
backHref?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const EvaluationsComparePage: React.FC<EvaluationsComparePageProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper to determine if two evaluations have the same metrics for comparison.
|
|
3
|
+
* Use before rendering EvaluationsCompareView so the Container app can decide
|
|
4
|
+
* whether to show the compare UI or display an error.
|
|
5
|
+
*
|
|
6
|
+
* Compares metric names across ALL evaluators (LLM, Tool, Judge, etc.).
|
|
7
|
+
* Supports both Evaluation (page format) and Evaluation DTO (API format).
|
|
8
|
+
*/
|
|
9
|
+
import type { Evaluation } from "../pages/evaluations.types";
|
|
10
|
+
import type { Evaluation as EvaluationDto } from "../../dto/Evaluation";
|
|
11
|
+
/**
|
|
12
|
+
* Returns true if both evaluations have the same set of metrics
|
|
13
|
+
* (evaluator_id + metric name) across all evaluators.
|
|
14
|
+
*/
|
|
15
|
+
export declare function evaluationsHaveSameMetrics(a: Evaluation | EvaluationDto | null | undefined, b: Evaluation | EvaluationDto | null | undefined): boolean;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,13 +2,17 @@ export { default as AgenticFlowVisualizer } from "./components/AgenticFlowVisual
|
|
|
2
2
|
export { default as Visualizer } from "./components/Visualizer";
|
|
3
3
|
export { SessionDetails } from "./agenthub/pages/session-details";
|
|
4
4
|
export { EvaluationsTable } from "./agenthub/components/EvaluationsTable";
|
|
5
|
-
export {
|
|
6
|
-
export type {
|
|
5
|
+
export { EvaluationsCompareView } from "./agenthub/components/EvaluationsCompareView";
|
|
6
|
+
export type { EvaluationsCompareViewProps } from "./agenthub/components/EvaluationsCompareView";
|
|
7
|
+
export { EvaluationsCompareDrawer } from "./agenthub/pages/evaluations-compare-drawer";
|
|
8
|
+
export type { EvaluationsCompareDrawerProps } from "./agenthub/pages/evaluations-compare-drawer";
|
|
9
|
+
export { EvaluationsComparePage } from "./agenthub/pages/evaluations-compare";
|
|
7
10
|
export { EvaluationDetailsDrawer } from "./agenthub/pages/evaluation-details-drawer";
|
|
8
11
|
export type { EvaluationDetailsDrawerProps } from "./agenthub/pages/evaluation-details-drawer";
|
|
9
12
|
export { EvaluatorResult } from "./agenthub/pages/evaluator-result";
|
|
10
13
|
export type { EvaluatorResultProps } from "./agenthub/pages/evaluator-result";
|
|
11
14
|
export { transformEvaluation, isEvaluationDto } from "./agenthub/utils/transformEvaluation";
|
|
15
|
+
export { evaluationsHaveSameMetrics } from "./agenthub/utils/evaluationsHaveSameMetrics";
|
|
12
16
|
export type { Evaluation } from "./dto/Evaluation";
|
|
13
17
|
export { Node } from "./components/Node";
|
|
14
18
|
export { Edge } from "./components/Edge";
|