@railtownai/railtracks-visualizer 0.0.39 → 0.0.41
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 +749 -277
- package/dist/esm/index.js +942 -469
- package/dist/types/agenthub/components/KeyboardShortcutsModal.d.ts +6 -0
- package/dist/types/agenthub/components/SendFeedbackButton.d.ts +2 -0
- package/dist/types/agenthub/components/ThemeToggleButton.d.ts +2 -0
- package/dist/types/agenthub/context/EvaluationsMockProvider.d.ts +40 -0
- package/dist/types/agenthub/context/SessionsMockProvider.d.ts +12 -0
- package/dist/types/agenthub/hooks/useEvaluations.d.ts +7 -0
- package/dist/types/agenthub/hooks/useSequenceShortcut.d.ts +13 -0
- package/dist/types/agenthub/hooks/useSessions.d.ts +26 -0
- package/dist/types/agenthub/hooks/useShareAgentSession.d.ts +4 -0
- package/dist/types/agenthub/pages/evaluation-details.d.ts +9 -0
- package/dist/types/agenthub/pages/evaluations-compare-drawer.d.ts +13 -0
- package/dist/types/agenthub/pages/evaluations-compare.d.ts +2 -0
- package/dist/types/agenthub/pages/evaluations.d.ts +2 -0
- package/dist/types/agenthub/pages/evaluations.types.d.ts +35 -0
- package/dist/types/agenthub/pages/index.d.ts +5 -0
- package/dist/types/agenthub/pages/session-details.d.ts +9 -0
- package/dist/types/agenthub/pages/sessions.d.ts +2 -0
- package/dist/types/agenthub/pages/visualizer.d.ts +2 -0
- package/dist/types/components/nodes/AgentNode.d.ts +1 -0
- package/dist/types/components/ui/drawer.d.ts +4 -0
- package/dist/types/components/ui/header.d.ts +1 -21
- package/dist/types/dto/AgentSession.d.ts +2 -0
- package/dist/types/hooks/index.d.ts +0 -1
- package/dist/types/hooks/useApi.d.ts +1 -0
- package/dist/types/index.d.ts +0 -1
- package/package.json +25 -20
- package/dist/types/components/ThemeToggle.d.ts +0 -2
- package/dist/types/components/ui/checkbox.d.ts +0 -4
- package/dist/types/hooks/useRailtracksStream.d.ts +0 -18
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
interface ApiEvaluatorResult {
|
|
3
|
+
name: string;
|
|
4
|
+
evaluator_id: string;
|
|
5
|
+
config_hash: string;
|
|
6
|
+
results: Array<{
|
|
7
|
+
metric: {
|
|
8
|
+
name: string;
|
|
9
|
+
};
|
|
10
|
+
value: number;
|
|
11
|
+
}>;
|
|
12
|
+
agent_runs: Array<{
|
|
13
|
+
session_id: string;
|
|
14
|
+
run_id: string;
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
export interface ApiEvaluation {
|
|
18
|
+
evaluation_id: string;
|
|
19
|
+
evaluation_name: string;
|
|
20
|
+
agent_name: string;
|
|
21
|
+
created_at: string;
|
|
22
|
+
agent_run_ids: string[];
|
|
23
|
+
results: ApiEvaluatorResult[];
|
|
24
|
+
metrics: Array<{
|
|
25
|
+
name: string;
|
|
26
|
+
min_value?: number;
|
|
27
|
+
max_value?: number;
|
|
28
|
+
options?: string[];
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
interface EvaluationsMockContextValue {
|
|
32
|
+
mockEvaluations: ApiEvaluation[] | null;
|
|
33
|
+
}
|
|
34
|
+
export interface EvaluationsMockProviderProps {
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
mockEvaluations: ApiEvaluation[] | null;
|
|
37
|
+
}
|
|
38
|
+
export declare const EvaluationsMockProvider: React.FC<EvaluationsMockProviderProps>;
|
|
39
|
+
export declare const useEvaluationsMock: () => EvaluationsMockContextValue | undefined;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import type { AgentSession } from "../../dto/AgentSession";
|
|
3
|
+
interface SessionsMockContextValue {
|
|
4
|
+
mockSessions: AgentSession[] | null;
|
|
5
|
+
}
|
|
6
|
+
export interface SessionsMockProviderProps {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
mockSessions: AgentSession[] | null;
|
|
9
|
+
}
|
|
10
|
+
export declare const SessionsMockProvider: React.FC<SessionsMockProviderProps>;
|
|
11
|
+
export declare const useSessionsMock: () => SessionsMockContextValue | undefined;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface UseSequenceShortcutOptions {
|
|
2
|
+
preventDefault?: boolean;
|
|
3
|
+
timeout?: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Custom hook to handle keyboard sequence shortcuts (e.g., G->S, G->E)
|
|
7
|
+
*
|
|
8
|
+
* @param firstKey - The first key in the sequence (case-insensitive)
|
|
9
|
+
* @param secondKey - The second key in the sequence (case-insensitive)
|
|
10
|
+
* @param callback - Function to execute when sequence is completed
|
|
11
|
+
* @param options - Optional configuration
|
|
12
|
+
*/
|
|
13
|
+
export declare const useSequenceShortcut: (firstKey: string, secondKey: string, callback: () => void, options?: UseSequenceShortcutOptions) => void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AgentRun } from "../../dto/AgentRun";
|
|
2
|
+
export interface RunListItem {
|
|
3
|
+
run_id: string;
|
|
4
|
+
session_id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
start_time: number;
|
|
7
|
+
end_time: number;
|
|
8
|
+
status: string;
|
|
9
|
+
duration?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface SessionListItem {
|
|
12
|
+
session_id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
start_time: number;
|
|
15
|
+
end_time: number;
|
|
16
|
+
duration?: number;
|
|
17
|
+
status: string;
|
|
18
|
+
runs: AgentRun[];
|
|
19
|
+
}
|
|
20
|
+
export declare const useSessions: () => {
|
|
21
|
+
sessions: SessionListItem[];
|
|
22
|
+
loading: boolean;
|
|
23
|
+
error: string | null;
|
|
24
|
+
refetch: () => Promise<void>;
|
|
25
|
+
fetchSessionById: (sessionId: string) => Promise<SessionListItem | null>;
|
|
26
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Evaluation } from "./evaluations.types";
|
|
3
|
+
interface EvaluationDetailsProps {
|
|
4
|
+
evaluation: Evaluation | null;
|
|
5
|
+
open: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const EvaluationDetails: React.FC<EvaluationDetailsProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Evaluation } from "./evaluations.types";
|
|
3
|
+
interface EvaluationsCompareProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
sourceEvaluationId: string | null;
|
|
7
|
+
targetEvaluationId: string | null;
|
|
8
|
+
evaluations: Evaluation[];
|
|
9
|
+
onSourceChange: (id: string | null) => void;
|
|
10
|
+
onTargetChange: (id: string | null) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const EvaluationsCompare: React.FC<EvaluationsCompareProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type MetricType = "Categorical" | "Continuous";
|
|
2
|
+
export interface CategoricalMetric {
|
|
3
|
+
name: string;
|
|
4
|
+
sha: string;
|
|
5
|
+
type: "Categorical";
|
|
6
|
+
options: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface ContinuousMetric {
|
|
9
|
+
name: string;
|
|
10
|
+
sha: string;
|
|
11
|
+
type: "Continuous";
|
|
12
|
+
min_value: number;
|
|
13
|
+
max_value: number;
|
|
14
|
+
}
|
|
15
|
+
export type Metric = CategoricalMetric | ContinuousMetric;
|
|
16
|
+
export interface Evaluator {
|
|
17
|
+
evaluator_id: string;
|
|
18
|
+
sha: string;
|
|
19
|
+
name: string;
|
|
20
|
+
metrics: Metric[];
|
|
21
|
+
}
|
|
22
|
+
export interface EvaluationRun {
|
|
23
|
+
session_id: string;
|
|
24
|
+
run_id: string;
|
|
25
|
+
results: Record<string, Record<string, number>>;
|
|
26
|
+
}
|
|
27
|
+
export interface Evaluation {
|
|
28
|
+
evaluation_id: string;
|
|
29
|
+
evaluators: Evaluator[];
|
|
30
|
+
name: string;
|
|
31
|
+
runs: EvaluationRun[];
|
|
32
|
+
results: Record<string, Record<string, number>>;
|
|
33
|
+
agent_name: string;
|
|
34
|
+
created_at: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { SessionListItem } from "../hooks/useSessions";
|
|
3
|
+
interface SessionDetailsProps {
|
|
4
|
+
session: SessionListItem | null;
|
|
5
|
+
open: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const SessionDetails: React.FC<SessionDetailsProps>;
|
|
9
|
+
export {};
|
|
@@ -19,6 +19,7 @@ interface AgentNodeProps {
|
|
|
19
19
|
id: string;
|
|
20
20
|
onInspect?: (nodeData: NodeData) => void;
|
|
21
21
|
}
|
|
22
|
+
export declare const getNodeIcon: (modelProvider?: string, size?: number) => string | JSX.Element;
|
|
22
23
|
export declare const getOverviewLlmDetails: (llmDetails: LLMDetails[]) => LLMDetails | null;
|
|
23
24
|
export declare const sumTotalCost: (llmDetails: LLMDetails[]) => number;
|
|
24
25
|
export declare const sumTotalInputTokens: (llmDetails: LLMDetails[]) => number;
|
|
@@ -1,26 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { JsonFile } from "../../hooks/useApi";
|
|
3
|
-
import { RealTimeLastUpdate } from "../../hooks/useRailtracksStream";
|
|
4
|
-
export interface AgentRunMenuItem {
|
|
5
|
-
id: number;
|
|
6
|
-
name: string;
|
|
7
|
-
run_id: string;
|
|
8
|
-
session_id: string;
|
|
9
|
-
}
|
|
10
2
|
interface HeaderProps {
|
|
11
|
-
|
|
12
|
-
currentFile: string | null;
|
|
13
|
-
onFileSelect: (filename: string) => void;
|
|
14
|
-
onRefresh: () => void;
|
|
15
|
-
loading: boolean;
|
|
16
|
-
isMultipleAgentRuns: boolean;
|
|
17
|
-
agentRuns: AgentRunMenuItem[];
|
|
18
|
-
selectedAgentRunId: string | null;
|
|
19
|
-
onAgentRunSelect: (runId: string) => void;
|
|
20
|
-
showTimeline: boolean;
|
|
21
|
-
onTimelineToggle: (checked: boolean) => void;
|
|
22
|
-
realTimeConnected?: boolean;
|
|
23
|
-
realTimeLastUpdate?: RealTimeLastUpdate | null;
|
|
3
|
+
title?: string;
|
|
24
4
|
}
|
|
25
5
|
export declare const Header: React.FC<HeaderProps>;
|
|
26
6
|
export {};
|
|
@@ -2,6 +2,8 @@ import { AgentRun } from "./AgentRun";
|
|
|
2
2
|
export type AgentSession = {
|
|
3
3
|
/** Unique identifier for the agent session */
|
|
4
4
|
session_id: string;
|
|
5
|
+
/** Backwards compatibility with older sessions. Name of the agent session */
|
|
6
|
+
session_name?: string;
|
|
5
7
|
/** Name of the agent session */
|
|
6
8
|
name: string;
|
|
7
9
|
/** Start time of the agent session (unix timestamp) */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { useApi } from "./useApi";
|
|
2
2
|
export { useFlowData } from "./useFlowData";
|
|
3
|
-
export { useRailtracksStream } from "./useRailtracksStream";
|
|
4
3
|
export type { JsonFile, ApiError } from "./useApi";
|
|
5
4
|
export type { FlowDataState } from "./useFlowData";
|
|
6
5
|
export type { AgentRunNode } from "../dto/AgentRunNode";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export { Timeline } from "./components/Timeline";
|
|
|
6
6
|
export { FileSelector } from "./components/FileSelector";
|
|
7
7
|
export { JsonTreeViewer } from "./components/ui/json-tree";
|
|
8
8
|
export { Badge } from "./components/ui/badge";
|
|
9
|
-
export { Checkbox } from "./components/ui/checkbox";
|
|
10
9
|
export { Drawer } from "./components/ui/drawer";
|
|
11
10
|
export { Select } from "./components/ui/select";
|
|
12
11
|
export { Sheet } from "./components/ui/sheet";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@railtownai/railtracks-visualizer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.41",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Railtown AI",
|
|
6
6
|
"description": "A visualizer for Railtracks agentic flows",
|
|
@@ -40,16 +40,19 @@
|
|
|
40
40
|
"react-dom": "^18.3.1"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
+
"@ant-design/icons": "6.1.0",
|
|
43
44
|
"@emotion/react": "11.14.0",
|
|
44
45
|
"@emotion/styled": "11.14.1",
|
|
45
|
-
"@radix-ui/react-checkbox": "1.3.3",
|
|
46
46
|
"@radix-ui/react-dialog": "1.1.15",
|
|
47
47
|
"@radix-ui/react-select": "2.2.6",
|
|
48
|
-
"@railtownai/railtracks-timeline": "0.0.
|
|
49
|
-
"@xyflow/react": "12.9.
|
|
50
|
-
"
|
|
48
|
+
"@railtownai/railtracks-timeline": "0.0.23",
|
|
49
|
+
"@xyflow/react": "12.9.3",
|
|
50
|
+
"antd": "5.29.1",
|
|
51
|
+
"lucide-react": "0.554.0",
|
|
51
52
|
"moment": "2.30.1",
|
|
52
53
|
"react-countup": "6.5.3",
|
|
54
|
+
"react-hotkeys-hook": "^4.5.1",
|
|
55
|
+
"react-router-dom": "7.9.6",
|
|
53
56
|
"react-textarea-autosize": "8.5.9",
|
|
54
57
|
"vaul": "1.1.2"
|
|
55
58
|
},
|
|
@@ -61,6 +64,7 @@
|
|
|
61
64
|
"build": "npm run build:types && npm run build:lib && npm run build:spa",
|
|
62
65
|
"clean": "rm -rf dist build test-results .railtracks/ui/*",
|
|
63
66
|
"dev": "rm -rf .railtracks/ui/* && vite build && cp -r build/* .railtracks/ui",
|
|
67
|
+
"viz": "railtracks_local viz",
|
|
64
68
|
"lint:fix": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,md}\"",
|
|
65
69
|
"lint:license": "license-checker --summary --excludePrivatePackages --failOn 'AGPL-1.0;AGPL-3.0;EPL-1.0;EPL-2.0;GPL-1.0;GPL-2.0;GPL-3.0;LGPL-2.0;LGPL-2.1;LGPL-3.0;'",
|
|
66
70
|
"lint": "prettier --check \"src/**/*.{js,jsx,ts,tsx,json,css,md}\"",
|
|
@@ -73,36 +77,37 @@
|
|
|
73
77
|
"up": "ncu -u -x react -x react-dom -x @types/react -x @types/react-dom"
|
|
74
78
|
},
|
|
75
79
|
"devDependencies": {
|
|
76
|
-
"@chromatic-com/storybook": "4.1.
|
|
80
|
+
"@chromatic-com/storybook": "4.1.3",
|
|
77
81
|
"@rollup/plugin-commonjs": "29.0.0",
|
|
78
82
|
"@rollup/plugin-json": "6.1.0",
|
|
79
83
|
"@rollup/plugin-node-resolve": "16.0.3",
|
|
80
84
|
"@rollup/plugin-swc": "0.4.0",
|
|
81
85
|
"@rollup/plugin-terser": "0.4.4",
|
|
82
|
-
"@storybook/addon-a11y": "10.0
|
|
83
|
-
"@storybook/addon-docs": "10.0
|
|
84
|
-
"@storybook/addon-onboarding": "10.0
|
|
85
|
-
"@storybook/react-vite": "10.0
|
|
86
|
+
"@storybook/addon-a11y": "10.1.0",
|
|
87
|
+
"@storybook/addon-docs": "10.1.0",
|
|
88
|
+
"@storybook/addon-onboarding": "10.1.0",
|
|
89
|
+
"@storybook/react-vite": "10.1.0",
|
|
86
90
|
"@testing-library/jest-dom": "6.9.1",
|
|
87
91
|
"@testing-library/react": "16.3.0",
|
|
88
92
|
"@testing-library/user-event": "14.6.1",
|
|
89
|
-
"@types/node": "24.10.
|
|
90
|
-
"@types/react": "18.
|
|
91
|
-
"@types/react-dom": "18.
|
|
92
|
-
"@vitejs/plugin-react-swc": "4.2.
|
|
93
|
+
"@types/node": "24.10.1",
|
|
94
|
+
"@types/react": "18.3.27",
|
|
95
|
+
"@types/react-dom": "18.3.7",
|
|
96
|
+
"@vitejs/plugin-react-swc": "4.2.2",
|
|
93
97
|
"clsx": "2.1.1",
|
|
94
|
-
"cross-env": "
|
|
98
|
+
"cross-env": "10.1.0",
|
|
95
99
|
"gh-pages": "6.3.0",
|
|
96
|
-
"jsdom": "27.
|
|
100
|
+
"jsdom": "27.2.0",
|
|
97
101
|
"license-checker": "25.0.1",
|
|
98
102
|
"npm-check-updates": "19.1.2",
|
|
99
103
|
"prettier": "3.6.2",
|
|
100
|
-
"rollup": "4.53.
|
|
104
|
+
"rollup": "4.53.3",
|
|
101
105
|
"rollup-plugin-postcss": "4.0.2",
|
|
102
|
-
"storybook": "10.0
|
|
106
|
+
"storybook": "10.1.0",
|
|
103
107
|
"typescript": "5.9.3",
|
|
104
|
-
"
|
|
105
|
-
"
|
|
108
|
+
"uuid": "13.0.0",
|
|
109
|
+
"vite": "7.2.4",
|
|
110
|
+
"vitest": "4.0.12"
|
|
106
111
|
},
|
|
107
112
|
"prettier": {
|
|
108
113
|
"singleQuote": false,
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
3
|
-
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
-
export { Checkbox };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
interface StreamMessage {
|
|
2
|
-
type: "connected" | "file_updated" | "keepalive";
|
|
3
|
-
filename?: string;
|
|
4
|
-
timestamp?: number;
|
|
5
|
-
[key: string]: any;
|
|
6
|
-
}
|
|
7
|
-
export interface RealTimeLastUpdate {
|
|
8
|
-
filename: string;
|
|
9
|
-
timestamp: Date;
|
|
10
|
-
}
|
|
11
|
-
declare const useRailtracksStream: (onMessage?: (data: StreamMessage) => void) => {
|
|
12
|
-
isConnected: boolean;
|
|
13
|
-
isConnecting: boolean;
|
|
14
|
-
error: string | null;
|
|
15
|
-
reconnect: () => Promise<void>;
|
|
16
|
-
disconnect: () => void;
|
|
17
|
-
};
|
|
18
|
-
export { useRailtracksStream };
|