@railtownai/railtracks-visualizer 0.0.66 → 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.
@@ -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 {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@railtownai/railtracks-visualizer",
3
- "version": "0.0.66",
3
+ "version": "0.0.67",
4
4
  "license": "MIT",
5
5
  "author": "Railtown AI",
6
6
  "description": "A visualizer for Railtracks agentic flows",