@railtownai/railtracks-visualizer 0.0.66 → 0.0.68
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 +897 -204
- package/dist/esm/index.js +895 -206
- package/dist/types/agenthub/components/JudgeAggregateView.d.ts +14 -0
- package/dist/types/agenthub/utils/judgeAggregateTree.d.ts +55 -0
- package/dist/types/hooks/useApi.d.ts +2 -1
- package/dist/types/lib/ThemeProvider.d.ts +11 -0
- package/dist/types/lib/apiBase.d.ts +1 -0
- package/dist/types/lib/theme.d.ts +4 -0
- package/package.json +9 -3
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Judge (LLM-as-judge) evaluator view: one card per categorical metric, with
|
|
3
|
+
* collapsible accordions per category label listing the agent nodes that received
|
|
4
|
+
* that label. Each node shows a short id (click to open the run in the Session
|
|
5
|
+
* Details drawer) and an inline toggle to reveal the judge's reasoning when present.
|
|
6
|
+
*/
|
|
7
|
+
import React from "react";
|
|
8
|
+
import type { JudgeMetric } from "../utils/judgeAggregateTree";
|
|
9
|
+
export interface JudgeAggregateViewProps {
|
|
10
|
+
metrics: JudgeMetric[];
|
|
11
|
+
/** Opens the run for a judged node. sessionId may be undefined for legacy evaluations. */
|
|
12
|
+
onAgentNodeClick?: (sessionId: string | undefined, nodeId: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const JudgeAggregateView: React.FC<JudgeAggregateViewProps>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the Judge (categorical) evaluator view model from aggregate_results.
|
|
3
|
+
*
|
|
4
|
+
* Shape of the data (see sample.json -> JudgeEvaluator):
|
|
5
|
+
* - aggregate_results.roots -> CategoricalAggregate nodes (one per metric) with
|
|
6
|
+
* `categories`, `counts`, `most_common_label`, `least_common_label`, and `children`.
|
|
7
|
+
* - Each child id resolves (in aggregate_results.nodes) to a Base leaf result whose
|
|
8
|
+
* `result_name` is `JudgeResult/<metric>`, `value` is the category label string, and
|
|
9
|
+
* `agent_data_id[0]` is the agent node id that was judged.
|
|
10
|
+
* - Reasoning lives separately in metric_results as Base results named
|
|
11
|
+
* `JudgeReasoning/<metric>`, paired to a node by `agent_data_id[0]` + metric name.
|
|
12
|
+
*/
|
|
13
|
+
import type { EvaluationResultItem, EvaluationAgent } from "../../dto/Evaluation";
|
|
14
|
+
/** A single judged agent node under a category label. */
|
|
15
|
+
export interface JudgeNodeRef {
|
|
16
|
+
nodeId: string;
|
|
17
|
+
/** Session that owns the node, when the evaluation carries session context. */
|
|
18
|
+
sessionId?: string;
|
|
19
|
+
/** Judge reasoning text for this node + metric, when available. */
|
|
20
|
+
reasoning?: string;
|
|
21
|
+
}
|
|
22
|
+
/** One category label within a metric, with the nodes that received it. */
|
|
23
|
+
export interface JudgeLabel {
|
|
24
|
+
labelName: string;
|
|
25
|
+
count: number;
|
|
26
|
+
nodes: JudgeNodeRef[];
|
|
27
|
+
}
|
|
28
|
+
/** One categorical metric judged across all runs. */
|
|
29
|
+
export interface JudgeMetric {
|
|
30
|
+
key: string;
|
|
31
|
+
metricName: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
mostCommon?: string;
|
|
34
|
+
leastCommon?: string;
|
|
35
|
+
total: number;
|
|
36
|
+
labels: JudgeLabel[];
|
|
37
|
+
}
|
|
38
|
+
type NodeMap = Record<string, unknown>;
|
|
39
|
+
type AgentLike = Pick<EvaluationAgent, "agent_name" | "agent_node_ids"> | {
|
|
40
|
+
agent_name: string;
|
|
41
|
+
agent_node_ids?: string[] | {
|
|
42
|
+
session_id: string;
|
|
43
|
+
agent_node_id: string;
|
|
44
|
+
}[];
|
|
45
|
+
};
|
|
46
|
+
export interface BuildJudgeMetricsInput {
|
|
47
|
+
roots: string[];
|
|
48
|
+
nodes: NodeMap;
|
|
49
|
+
agents?: AgentLike[];
|
|
50
|
+
/** Full evaluator results (metric_results + aggregates) used to resolve reasoning. */
|
|
51
|
+
rawResults?: EvaluationResultItem[];
|
|
52
|
+
}
|
|
53
|
+
/** Build the Judge view model: one entry per categorical metric. */
|
|
54
|
+
export declare function buildJudgeMetricsFromAggregate(input: BuildJudgeMetricsInput): JudgeMetric[];
|
|
55
|
+
export {};
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import { Theme } from "./theme";
|
|
3
|
+
export type ThemeMode = "light" | "dark" | "liquidGlassLight" | "liquidGlassDark";
|
|
4
|
+
export declare function themeForMode(mode: ThemeMode): Theme;
|
|
5
|
+
export declare function themeToMode(theme: Theme): ThemeMode;
|
|
3
6
|
interface ThemeContextType {
|
|
4
7
|
theme: Theme;
|
|
8
|
+
themeMode: ThemeMode;
|
|
5
9
|
setTheme: (theme: Theme) => void;
|
|
10
|
+
setThemeMode: (mode: ThemeMode) => void;
|
|
11
|
+
/** True for classic dark or dark liquid glass (graphs, muted text). */
|
|
6
12
|
isDarkMode: boolean;
|
|
13
|
+
/** True only for solid classic dark — heavy Ant Design chrome overrides. */
|
|
14
|
+
isClassicDarkTheme: boolean;
|
|
15
|
+
isLiquidGlass: boolean;
|
|
16
|
+
isLiquidGlassLight: boolean;
|
|
17
|
+
isLiquidGlassDark: boolean;
|
|
7
18
|
}
|
|
8
19
|
interface ThemeProviderProps {
|
|
9
20
|
children: ReactNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const API_BASE: string;
|
|
@@ -92,5 +92,9 @@ export interface Theme {
|
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
94
|
export declare const lightTheme: Theme;
|
|
95
|
+
/** Light “Liquid Glass”–inspired palette (web approximation). */
|
|
96
|
+
export declare const liquidGlassLightTheme: Theme;
|
|
97
|
+
/** Dark “Liquid Glass”–inspired palette — translucent panels on a deep mesh-like base. */
|
|
98
|
+
export declare const liquidGlassDarkTheme: Theme;
|
|
95
99
|
export declare const darkTheme: Theme;
|
|
96
100
|
export declare const defaultTheme: Theme;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@railtownai/railtracks-visualizer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.68",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Railtown AI",
|
|
6
6
|
"description": "A visualizer for Railtracks agentic flows",
|
|
@@ -71,7 +71,10 @@
|
|
|
71
71
|
"storybook:preview": "npx http-server ./storybook-static",
|
|
72
72
|
"test:ui": "vitest --ui",
|
|
73
73
|
"test": "vitest run --silent",
|
|
74
|
-
"up": "ncu -u -x react -x react-dom -x @types/react -x @types/react-dom -x react-hotkeys-hook"
|
|
74
|
+
"up": "ncu -u -x react -x react-dom -x @types/react -x @types/react-dom -x react-hotkeys-hook",
|
|
75
|
+
"electron": "npm run electron:start",
|
|
76
|
+
"electron:dev": "cross-env ELECTRON_DEV=1 VITE_API_ORIGIN=http://localhost:3030 concurrently -k \"vite\" \"wait-on http://127.0.0.1:3001 && electron electron/main.js\"",
|
|
77
|
+
"electron:start": "cross-env VITE_API_ORIGIN=http://localhost:3030 npm run build:spa && electron electron/main.js"
|
|
75
78
|
},
|
|
76
79
|
"devDependencies": {
|
|
77
80
|
"@chromatic-com/storybook": "5.1.2",
|
|
@@ -92,7 +95,9 @@
|
|
|
92
95
|
"@types/react-dom": "18.3.7",
|
|
93
96
|
"@vitejs/plugin-react-swc": "4.3.0",
|
|
94
97
|
"clsx": "2.1.1",
|
|
98
|
+
"concurrently": "9.2.1",
|
|
95
99
|
"cross-env": "10.1.0",
|
|
100
|
+
"electron": "34.5.8",
|
|
96
101
|
"gh-pages": "6.3.0",
|
|
97
102
|
"jsdom": "29.0.2",
|
|
98
103
|
"license-checker": "25.0.1",
|
|
@@ -104,7 +109,8 @@
|
|
|
104
109
|
"typescript": "6.0.3",
|
|
105
110
|
"uuid": "13.0.0",
|
|
106
111
|
"vite": "8.0.8",
|
|
107
|
-
"vitest": "4.1.4"
|
|
112
|
+
"vitest": "4.1.4",
|
|
113
|
+
"wait-on": "8.0.5"
|
|
108
114
|
},
|
|
109
115
|
"prettier": {
|
|
110
116
|
"singleQuote": false,
|