@railtownai/railtracks-visualizer 0.0.65 → 0.0.67
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 +1588 -1140
- package/dist/esm/index.js +1588 -1140
- package/dist/types/agenthub/components/GuardrailsPopover.d.ts +18 -0
- package/dist/types/agenthub/components/JudgeAggregateView.d.ts +14 -0
- package/dist/types/agenthub/utils/judgeAggregateTree.d.ts +55 -0
- package/dist/types/dto/AgentRunNode.d.ts +17 -0
- package/package.json +22 -22
- package/dist/types/components/ui/tooltip.d.ts +0 -9
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type PopoverProps } from "antd";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import type { LLMGuardrail } from "../../dto/AgentRunNode";
|
|
4
|
+
export interface GuardrailsPopoverProps {
|
|
5
|
+
/** Guardrail decisions to list inside the popover */
|
|
6
|
+
guardrails: LLMGuardrail[];
|
|
7
|
+
/** Title on the outer card (default: "Guardrails") */
|
|
8
|
+
title?: string;
|
|
9
|
+
placement?: PopoverProps["placement"];
|
|
10
|
+
trigger?: PopoverProps["trigger"];
|
|
11
|
+
/** Shield icon size in px (width/height) */
|
|
12
|
+
shieldSize?: number;
|
|
13
|
+
/** Lucide stroke width (default 2.5; Lucide default is 2) */
|
|
14
|
+
shieldStrokeWidth?: number;
|
|
15
|
+
/** Accessible label for the shield control */
|
|
16
|
+
ariaLabel?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const GuardrailsPopover: React.FC<GuardrailsPopoverProps>;
|
|
@@ -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 {};
|
|
@@ -21,6 +21,21 @@ export interface LLMContent {
|
|
|
21
21
|
* For LLM responses, it can be a string or a json object. */
|
|
22
22
|
content: any;
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Represents a single guardrail decision for an LLM interaction
|
|
26
|
+
*/
|
|
27
|
+
export interface LLMGuardrail {
|
|
28
|
+
/** Name of the guardrail that produced this decision */
|
|
29
|
+
rail_name: string;
|
|
30
|
+
/** Phase of the LLM lifecycle where the guardrail ran */
|
|
31
|
+
phase: string;
|
|
32
|
+
/** Decision taken by the guardrail */
|
|
33
|
+
action: string;
|
|
34
|
+
/** Human-readable reason for the decision */
|
|
35
|
+
reason: string | null;
|
|
36
|
+
/** Optional additional metadata emitted by the guardrail */
|
|
37
|
+
meta: Record<string, any> | null;
|
|
38
|
+
}
|
|
24
39
|
/**
|
|
25
40
|
* Represents detailed information about an LLM interaction
|
|
26
41
|
*/
|
|
@@ -57,6 +72,8 @@ export interface NodeLatency {
|
|
|
57
72
|
* Represents internal execution details for a node
|
|
58
73
|
*/
|
|
59
74
|
export interface NodeInternals {
|
|
75
|
+
/** Optional array of LLM Guardrails */
|
|
76
|
+
guard_details?: LLMGuardrail[];
|
|
60
77
|
/** Optional array of LLM interaction details */
|
|
61
78
|
llm_details?: LLMDetails[];
|
|
62
79
|
/** Optional latency information for the node execution */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@railtownai/railtracks-visualizer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.67",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Railtown AI",
|
|
6
6
|
"description": "A visualizer for Railtracks agentic flows",
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"@emotion/styled": "11.14.1",
|
|
45
45
|
"@radix-ui/react-dialog": "1.1.15",
|
|
46
46
|
"@railtownai/railtracks-timeline": "0.0.23",
|
|
47
|
-
"@xyflow/react": "12.10.
|
|
48
|
-
"antd": "6.3.
|
|
49
|
-
"lucide-react": "
|
|
47
|
+
"@xyflow/react": "12.10.2",
|
|
48
|
+
"antd": "6.3.6",
|
|
49
|
+
"lucide-react": "1.8.0",
|
|
50
50
|
"moment": "2.30.1",
|
|
51
51
|
"react-countup": "6.5.3",
|
|
52
52
|
"react-hotkeys-hook": "^4.6.2",
|
|
53
|
-
"react-router-dom": "7.
|
|
53
|
+
"react-router-dom": "7.14.1",
|
|
54
54
|
"react-textarea-autosize": "8.5.9",
|
|
55
55
|
"vaul": "1.1.2"
|
|
56
56
|
},
|
|
@@ -74,37 +74,37 @@
|
|
|
74
74
|
"up": "ncu -u -x react -x react-dom -x @types/react -x @types/react-dom -x react-hotkeys-hook"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@chromatic-com/storybook": "5.
|
|
78
|
-
"@rollup/plugin-commonjs": "29.0.
|
|
77
|
+
"@chromatic-com/storybook": "5.1.2",
|
|
78
|
+
"@rollup/plugin-commonjs": "29.0.2",
|
|
79
79
|
"@rollup/plugin-json": "6.1.0",
|
|
80
80
|
"@rollup/plugin-node-resolve": "16.0.3",
|
|
81
81
|
"@rollup/plugin-swc": "0.4.0",
|
|
82
|
-
"@rollup/plugin-terser": "0.
|
|
83
|
-
"@storybook/addon-a11y": "10.
|
|
84
|
-
"@storybook/addon-docs": "10.
|
|
85
|
-
"@storybook/addon-onboarding": "10.
|
|
86
|
-
"@storybook/react-vite": "10.
|
|
82
|
+
"@rollup/plugin-terser": "1.0.0",
|
|
83
|
+
"@storybook/addon-a11y": "10.3.5",
|
|
84
|
+
"@storybook/addon-docs": "10.3.5",
|
|
85
|
+
"@storybook/addon-onboarding": "10.3.5",
|
|
86
|
+
"@storybook/react-vite": "10.3.5",
|
|
87
87
|
"@testing-library/jest-dom": "6.9.1",
|
|
88
88
|
"@testing-library/react": "16.3.2",
|
|
89
89
|
"@testing-library/user-event": "14.6.1",
|
|
90
|
-
"@types/node": "25.
|
|
90
|
+
"@types/node": "25.6.0",
|
|
91
91
|
"@types/react": "18.3.27",
|
|
92
92
|
"@types/react-dom": "18.3.7",
|
|
93
|
-
"@vitejs/plugin-react-swc": "4.
|
|
93
|
+
"@vitejs/plugin-react-swc": "4.3.0",
|
|
94
94
|
"clsx": "2.1.1",
|
|
95
95
|
"cross-env": "10.1.0",
|
|
96
96
|
"gh-pages": "6.3.0",
|
|
97
|
-
"jsdom": "
|
|
97
|
+
"jsdom": "29.0.2",
|
|
98
98
|
"license-checker": "25.0.1",
|
|
99
|
-
"npm-check-updates": "
|
|
100
|
-
"prettier": "3.8.
|
|
101
|
-
"rollup": "4.
|
|
99
|
+
"npm-check-updates": "21.0.2",
|
|
100
|
+
"prettier": "3.8.3",
|
|
101
|
+
"rollup": "4.60.1",
|
|
102
102
|
"rollup-plugin-postcss": "4.0.2",
|
|
103
|
-
"storybook": "10.
|
|
104
|
-
"typescript": "
|
|
103
|
+
"storybook": "10.3.5",
|
|
104
|
+
"typescript": "6.0.3",
|
|
105
105
|
"uuid": "13.0.0",
|
|
106
|
-
"vite": "
|
|
107
|
-
"vitest": "4.
|
|
106
|
+
"vite": "8.0.8",
|
|
107
|
+
"vitest": "4.1.4"
|
|
108
108
|
},
|
|
109
109
|
"prettier": {
|
|
110
110
|
"singleQuote": false,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
interface TooltipProps {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
content: React.ReactNode;
|
|
5
|
-
placement?: "top" | "bottom" | "left" | "right" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom";
|
|
6
|
-
delay?: number;
|
|
7
|
-
}
|
|
8
|
-
export declare const Tooltip: React.FC<TooltipProps>;
|
|
9
|
-
export {};
|