@railtownai/railtracks-visualizer 0.0.59 → 0.0.61
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 +1817 -2591
- package/dist/esm/index.js +1814 -2592
- package/dist/types/agenthub/components/JsonValueTree.d.ts +11 -0
- package/dist/types/agenthub/components/SessionTree.d.ts +2 -0
- package/dist/types/components/Edge.d.ts +2 -0
- package/dist/types/components/Node.d.ts +1 -1
- package/dist/types/components/nodes/AgentNode.d.ts +6 -2
- package/dist/types/components/nodes/InputsOutputsCollapse.d.ts +35 -0
- package/dist/types/components/nodes/NodeDetailsDrawer.d.ts +10 -1
- package/dist/types/components/nodes/ToolNode.d.ts +1 -1
- package/dist/types/components/nodes/constants.d.ts +6 -0
- package/dist/types/components/nodes/index.d.ts +0 -2
- package/dist/types/dto/AgentRunNode.d.ts +1 -1
- package/dist/types/lib/utils.d.ts +18 -0
- package/package.json +1 -1
- package/dist/types/components/nodes/CodeBlock.d.ts +0 -8
- package/dist/types/components/nodes/CoordinatorNode.d.ts +0 -22
- package/dist/types/components/nodes/ExpandableTextarea.d.ts +0 -9
- package/dist/types/components/nodes/OutputRenderer.d.ts +0 -9
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders a Tool Output in a Tree component
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
export interface JsonValueTreeProps {
|
|
7
|
+
data: unknown;
|
|
8
|
+
className?: string;
|
|
9
|
+
maxHeight?: number | string;
|
|
10
|
+
}
|
|
11
|
+
export declare const JsonValueTree: React.FC<JsonValueTreeProps>;
|
|
@@ -2,6 +2,8 @@ import React from "react";
|
|
|
2
2
|
import type { AgentRun } from "../../dto/AgentRun";
|
|
3
3
|
import type { AgentRunNode } from "../../dto/AgentRunNode";
|
|
4
4
|
import type { SessionListItem } from "../hooks/useSessions";
|
|
5
|
+
/** Tool/agent failure is carried on the incoming edge's details.status (e.g. Failed), same as flow edges and session I/O. */
|
|
6
|
+
export declare function isNodeFailureFromIncomingEdge(run: AgentRun, nodeId: string): boolean;
|
|
5
7
|
export interface SelectedNodeInfo {
|
|
6
8
|
nodeId: string;
|
|
7
9
|
runId: string;
|
|
@@ -8,6 +8,8 @@ interface EdgeProps {
|
|
|
8
8
|
targetY: number;
|
|
9
9
|
sourcePosition: any;
|
|
10
10
|
targetPosition: any;
|
|
11
|
+
/** React Flow sets this for animated edges; used for active-step stroke color without rebuilding edge data on theme change */
|
|
12
|
+
animated?: boolean;
|
|
11
13
|
style?: React.CSSProperties;
|
|
12
14
|
markerEnd?: string;
|
|
13
15
|
bidirectional?: boolean;
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { LLMDetails, NodeDetails } from "../../dto/AgentRunNode";
|
|
3
3
|
interface NodeData {
|
|
4
4
|
label: string;
|
|
5
|
-
nodeType?: "Tool" | "Agent"
|
|
5
|
+
nodeType?: "Tool" | "Agent";
|
|
6
6
|
details?: NodeDetails;
|
|
7
7
|
id?: string;
|
|
8
8
|
edges?: any[];
|
|
@@ -21,7 +21,7 @@ interface AgentNodeProps {
|
|
|
21
21
|
defaultDrawerOpen?: boolean;
|
|
22
22
|
}
|
|
23
23
|
export interface GetNodeIconOptions {
|
|
24
|
-
nodeType?: "tool" | "
|
|
24
|
+
nodeType?: "tool" | "agent";
|
|
25
25
|
modelProvider?: string;
|
|
26
26
|
modelName?: string;
|
|
27
27
|
size?: number;
|
|
@@ -39,6 +39,10 @@ export declare const getNodeIcon: (options?: GetNodeIconOptions) => string | JSX
|
|
|
39
39
|
* @returns The provider label for the model.
|
|
40
40
|
*/
|
|
41
41
|
export declare const getProviderLabel: (modelName?: string, modelProvider?: string) => string;
|
|
42
|
+
/**
|
|
43
|
+
* Display label for a Railtracks model_name slug (frontend copy only; does not alter data).
|
|
44
|
+
*/
|
|
45
|
+
export declare const getModelLabel: (modelName?: string | null) => string;
|
|
42
46
|
export declare const getOverviewLlmDetails: (llmDetails: LLMDetails[]) => LLMDetails | null;
|
|
43
47
|
export declare const sumTotalCost: (llmDetails: LLMDetails[]) => number;
|
|
44
48
|
export declare const sumTotalInputTokens: (llmDetails: LLMDetails[]) => number;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { LLMContent } from "../../dto/AgentRunNode";
|
|
3
|
+
export declare function formatContentAsText(content: any): string;
|
|
4
|
+
export declare function isTabularData(data: any): boolean;
|
|
5
|
+
export declare function formatOutputAsText(output: {
|
|
6
|
+
role: string;
|
|
7
|
+
content: any;
|
|
8
|
+
} | null, toolOutput: any): string;
|
|
9
|
+
export declare function renderContentForDisplay(content: any): string;
|
|
10
|
+
export declare function filterKeysWithName(obj: any): any;
|
|
11
|
+
export interface LLMInputsRendererProps {
|
|
12
|
+
input: LLMContent[];
|
|
13
|
+
modelProvider?: string;
|
|
14
|
+
modelName?: string;
|
|
15
|
+
toolStatusMap?: Map<string, string>;
|
|
16
|
+
}
|
|
17
|
+
export declare const LLMInputsRenderer: React.FC<LLMInputsRendererProps>;
|
|
18
|
+
export interface InputsOutputsCollapseProps {
|
|
19
|
+
inputs: LLMContent[];
|
|
20
|
+
output: {
|
|
21
|
+
role: string;
|
|
22
|
+
content: any;
|
|
23
|
+
} | null;
|
|
24
|
+
toolOutput: any | null;
|
|
25
|
+
modelProvider?: string;
|
|
26
|
+
modelName?: string;
|
|
27
|
+
toolStatusMap?: Map<string, string>;
|
|
28
|
+
/** When true, Inputs panel uses a read-only textarea (Tool node shape in session panel). */
|
|
29
|
+
toolInputAsTextarea?: boolean;
|
|
30
|
+
/** When true, Inputs label uses Typography.Title level 2 (run-level session view). */
|
|
31
|
+
largeInputsTitle?: boolean;
|
|
32
|
+
/** Override whether the Inputs panel has content (e.g. require Agent/Tool node type). */
|
|
33
|
+
hasInputs?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export declare const InputsOutputsCollapse: React.FC<InputsOutputsCollapseProps>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import type { LLMContent } from "../../dto/AgentRunNode";
|
|
2
3
|
interface NodeData {
|
|
3
4
|
label: string;
|
|
4
|
-
nodeType?: "Tool" | "Agent"
|
|
5
|
+
nodeType?: "Tool" | "Agent";
|
|
5
6
|
details?: any;
|
|
6
7
|
id?: string;
|
|
7
8
|
edges?: any[];
|
|
@@ -18,5 +19,13 @@ interface NodeDetailsDrawerProps {
|
|
|
18
19
|
onClose: () => void;
|
|
19
20
|
nodeData: NodeData;
|
|
20
21
|
}
|
|
22
|
+
/** Merged tool internals + first edge detail (same shape ToolNode used on-canvas). */
|
|
23
|
+
export declare function buildToolDrawerPayload(nodeData: NodeData): Record<string, unknown> | null;
|
|
24
|
+
/** Tool drawer I/O from first edge detail (aligned with session-details getNodeInputsOutputs for Tool). */
|
|
25
|
+
export declare function buildToolDrawerIo(nodeData: NodeData): {
|
|
26
|
+
inputs: LLMContent[];
|
|
27
|
+
toolOutput: any;
|
|
28
|
+
toolStatusMap: Map<string, string>;
|
|
29
|
+
};
|
|
21
30
|
export declare const NodeDetailsDrawer: React.FC<NodeDetailsDrawerProps>;
|
|
22
31
|
export {};
|
|
@@ -1 +1,7 @@
|
|
|
1
|
+
/** Max width for rich content (drawer output blocks, etc.) */
|
|
1
2
|
export declare const NODE_MAX_WIDTH = 500;
|
|
3
|
+
/** Compact xyflow node card width range */
|
|
4
|
+
export declare const FLOW_NODE_MIN_WIDTH = 176;
|
|
5
|
+
export declare const FLOW_NODE_MAX_WIDTH = 250;
|
|
6
|
+
/** Used by auto-layout horizontal spacing (~typical card width between min and max) */
|
|
7
|
+
export declare const LAYOUT_NODE_WIDTH: number;
|
|
@@ -80,7 +80,7 @@ export interface NodeDetails {
|
|
|
80
80
|
export interface AgentRunNode {
|
|
81
81
|
/** Unique identifier for this node */
|
|
82
82
|
identifier: string;
|
|
83
|
-
/** Type of node (e.g., "Tool", "Agent"
|
|
83
|
+
/** Type of node (e.g., "Tool", "Agent") */
|
|
84
84
|
node_type: string;
|
|
85
85
|
/** Optional human-readable name for this node */
|
|
86
86
|
name?: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ClassValue } from "clsx";
|
|
2
|
+
import type { AgentRun } from "../dto/AgentRun";
|
|
2
3
|
import { ToolCall } from "../dto/AgentRunNode";
|
|
3
4
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
4
5
|
/**
|
|
@@ -51,6 +52,18 @@ export declare function formatDateFriendly(iso: string): string;
|
|
|
51
52
|
* @returns The truncated text
|
|
52
53
|
*/
|
|
53
54
|
export declare function truncateText(text: string, maxLength: number): string;
|
|
55
|
+
/**
|
|
56
|
+
* True for plain object literals (own enumerable keys, not arrays, Date, etc.).
|
|
57
|
+
*/
|
|
58
|
+
export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
|
|
59
|
+
/**
|
|
60
|
+
* Escapes `\` and `.` in a segment so dot-delimited path keys stay unambiguous (e.g. JSON tree UIs).
|
|
61
|
+
*/
|
|
62
|
+
export declare function escapeDotPathSegment(segment: string): string;
|
|
63
|
+
/**
|
|
64
|
+
* Compact JSON-like string for tree / debug views: strings use JSON quoting; null and undefined as words.
|
|
65
|
+
*/
|
|
66
|
+
export declare function formatJsonTreePrimitive(value: unknown): string;
|
|
54
67
|
/**
|
|
55
68
|
* Styled-components utility for conditional styling
|
|
56
69
|
* @param condition - The condition to check
|
|
@@ -131,6 +144,11 @@ export declare function formatMetricValue(evaluator: EvaluatorMetricInfo | null
|
|
|
131
144
|
* @returns The Ant Design color name for Tag component
|
|
132
145
|
*/
|
|
133
146
|
export declare function getStatusColor(status: string): string;
|
|
147
|
+
/**
|
|
148
|
+
* Last timeline step for a run: max of stamp track (`stamps` / `steps`) and all node/edge stamp steps.
|
|
149
|
+
* Used so the visualizer defaults past step 0 when the graph only appears at later steps.
|
|
150
|
+
*/
|
|
151
|
+
export declare function getDefaultTimelineStepForRun(run: AgentRun): number;
|
|
134
152
|
/**
|
|
135
153
|
* Formats tool calls for display in a code block
|
|
136
154
|
*/
|
package/package.json
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface NodeData {
|
|
3
|
-
label: string;
|
|
4
|
-
nodeType?: "Tool" | "Agent" | "Coordinator";
|
|
5
|
-
details?: any;
|
|
6
|
-
id?: string;
|
|
7
|
-
edges?: any[];
|
|
8
|
-
edgeDetails?: {
|
|
9
|
-
input_args?: any[];
|
|
10
|
-
input_kwargs?: any;
|
|
11
|
-
output?: any;
|
|
12
|
-
state?: string;
|
|
13
|
-
status?: string;
|
|
14
|
-
}[];
|
|
15
|
-
}
|
|
16
|
-
interface CoordinatorNodeProps {
|
|
17
|
-
data: NodeData;
|
|
18
|
-
id: string;
|
|
19
|
-
onInspect?: (nodeData: NodeData) => void;
|
|
20
|
-
}
|
|
21
|
-
export declare const CoordinatorNode: React.FC<CoordinatorNodeProps>;
|
|
22
|
-
export {};
|