@railtownai/railtracks-visualizer 0.0.23 → 0.0.24

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.
@@ -1,8 +1,9 @@
1
1
  import React from "react";
2
+ import { LLMDetails, NodeDetails } from "../../dto/AgentRunNode";
2
3
  interface NodeData {
3
4
  label: string;
4
5
  nodeType?: "Tool" | "Agent" | "Coordinator";
5
- details?: any;
6
+ details?: NodeDetails;
6
7
  id?: string;
7
8
  edges?: any[];
8
9
  edgeDetails?: {
@@ -18,5 +19,9 @@ interface AgentNodeProps {
18
19
  id: string;
19
20
  onInspect?: (nodeData: NodeData) => void;
20
21
  }
22
+ export declare const getOverviewLlmDetails: (llmDetails: LLMDetails[]) => LLMDetails | null;
23
+ export declare const sumTotalCost: (llmDetails: LLMDetails[]) => number;
24
+ export declare const sumTotalInputTokens: (llmDetails: LLMDetails[]) => number;
25
+ export declare const sumTotalOutputTokens: (llmDetails: LLMDetails[]) => number;
21
26
  export declare const AgentNode: React.FC<AgentNodeProps>;
22
27
  export {};
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ interface CodeBlockProps {
3
+ content: string;
4
+ language?: string;
5
+ }
6
+ export declare const CodeBlock: React.FC<CodeBlockProps>;
7
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ interface OutputRendererProps {
3
+ data: {
4
+ role: string;
5
+ content: any;
6
+ };
7
+ }
8
+ export declare const OutputRenderer: React.FC<OutputRendererProps>;
9
+ export {};
@@ -3,8 +3,10 @@ interface JsonTreeViewerProps {
3
3
  data: any;
4
4
  maxDepth?: number;
5
5
  initialExpanded?: boolean;
6
+ expanded?: boolean;
6
7
  className?: string;
7
8
  priorityKeys?: string[];
9
+ excludeKeys?: string[];
8
10
  }
9
11
  declare const JsonTreeViewer: React.FC<JsonTreeViewerProps>;
10
12
  export { JsonTreeViewer };
@@ -13,8 +13,6 @@ export interface EdgeStamp {
13
13
  * Represents detailed information about an edge
14
14
  */
15
15
  export interface EdgeDetails {
16
- /** Optional state of the edge (e.g., "pending", "completed", "failed") */
17
- state?: string;
18
16
  /** Optional status information for the edge */
19
17
  status?: string;
20
18
  /** Optional array of input arguments passed to the target node */
@@ -113,3 +113,29 @@ export interface AgentRunNode {
113
113
  /** Reference to the parent node, or null if this is a root node */
114
114
  parent: AgentRunNode | null;
115
115
  }
116
+ /**
117
+ * Represents a tool call with identifier, name, and arguments
118
+ */
119
+ export interface ToolCall {
120
+ /** Unique identifier for this tool call */
121
+ identifier: string;
122
+ /** Name of the tool being called */
123
+ name: string;
124
+ /** Arguments passed to the tool */
125
+ arguments: Record<string, any>;
126
+ }
127
+ /**
128
+ * Represents a tool response with identifier, name, and result
129
+ */
130
+ export interface ToolResponse {
131
+ /** Unique identifier for this tool response */
132
+ identifier: string;
133
+ /** Name of the tool that generated this response */
134
+ name: string;
135
+ /** The result of the tool call */
136
+ result: any;
137
+ }
138
+ /**
139
+ * Union type for different content types that can be rendered
140
+ */
141
+ export type Content = string | ToolCall[] | ToolResponse | any;
@@ -1,4 +1,5 @@
1
1
  import { type ClassValue } from "clsx";
2
+ import { ToolCall } from "../dto/AgentRunNode";
2
3
  export declare function cn(...inputs: ClassValue[]): string;
3
4
  /**
4
5
  * Converts a string to title case
@@ -77,3 +78,14 @@ export declare function getSafeThemeValue(theme: any, path: string, fallback: an
77
78
  * @returns A safe theme object with fallbacks
78
79
  */
79
80
  export declare function createSafeTheme(theme?: any): any;
81
+ /**
82
+ * Detects the type of content for rendering
83
+ */
84
+ export declare const detectContentType: (output: {
85
+ role: string;
86
+ content: any;
87
+ }) => "string" | "toolResponse" | "toolCallList" | "other";
88
+ /**
89
+ * Formats tool calls for display in a code block
90
+ */
91
+ export declare const formatToolCalls: (toolCalls: ToolCall[]) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@railtownai/railtracks-visualizer",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Railtown AI",
6
6
  "description": "A visualizer for RailTracks agentic flows",
@@ -57,7 +57,7 @@
57
57
  "build:size": "npm pack --dry-run",
58
58
  "build": "npm run build:types && npm run build:lib && npm run build:spa",
59
59
  "clean": "rm -rf dist build test-results .railtracks/ui/*",
60
- "dev:spa": "rm -rf .railtracks/ui/* && vite build && cp -r build/* .railtracks/ui",
60
+ "dev": "rm -rf .railtracks/ui/* && vite build && cp -r build/* .railtracks/ui",
61
61
  "lint:fix": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,md}\"",
62
62
  "lint": "prettier --check \"src/**/*.{js,jsx,ts,tsx,json,css,md}\"",
63
63
  "start": "storybook dev -p 6006",