@railtownai/railtracks-visualizer 0.0.43 → 0.0.44

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 CHANGED
@@ -15383,6 +15383,10 @@ function cn(...inputs) {
15383
15383
  if (absValue >= 1) {
15384
15384
  precision = Math.max(precision, 3);
15385
15385
  }
15386
+ // For values < 1, ensure we show at least 2 decimal places
15387
+ if (absValue < 1) {
15388
+ precision = Math.max(precision, 2);
15389
+ }
15386
15390
  // Cap precision at 8 decimal places
15387
15391
  precision = Math.min(precision, 8);
15388
15392
  // Check if the value rounds to a whole number when rounded to the nearest integer
@@ -15406,6 +15410,16 @@ function cn(...inputs) {
15406
15410
  }
15407
15411
  return `${sign}$${rounded}`;
15408
15412
  }
15413
+ /**
15414
+ * Formats a number with comma separators for thousands
15415
+ * @param value - The number to format
15416
+ * @returns The formatted string with comma separators (e.g., 4420399 -> "4,420,399")
15417
+ */ function formatNumberWithCommas(value) {
15418
+ if (value === null || value === undefined) {
15419
+ return "0";
15420
+ }
15421
+ return value.toLocaleString("en-US");
15422
+ }
15409
15423
  /**
15410
15424
  * Formats latency in a human-readable format
15411
15425
  * @param latency - Latency in seconds
@@ -27531,6 +27545,7 @@ exports.defaultTheme = defaultTheme;
27531
27545
  exports.detectContentType = detectContentType;
27532
27546
  exports.formatCurrency = formatCurrency;
27533
27547
  exports.formatLatency = formatLatency;
27548
+ exports.formatNumberWithCommas = formatNumberWithCommas;
27534
27549
  exports.formatToolCalls = formatToolCalls;
27535
27550
  exports.getColor = getColor;
27536
27551
  exports.getSafeColor = getSafeColor;
package/dist/esm/index.js CHANGED
@@ -15363,6 +15363,10 @@ function cn(...inputs) {
15363
15363
  if (absValue >= 1) {
15364
15364
  precision = Math.max(precision, 3);
15365
15365
  }
15366
+ // For values < 1, ensure we show at least 2 decimal places
15367
+ if (absValue < 1) {
15368
+ precision = Math.max(precision, 2);
15369
+ }
15366
15370
  // Cap precision at 8 decimal places
15367
15371
  precision = Math.min(precision, 8);
15368
15372
  // Check if the value rounds to a whole number when rounded to the nearest integer
@@ -15386,6 +15390,16 @@ function cn(...inputs) {
15386
15390
  }
15387
15391
  return `${sign}$${rounded}`;
15388
15392
  }
15393
+ /**
15394
+ * Formats a number with comma separators for thousands
15395
+ * @param value - The number to format
15396
+ * @returns The formatted string with comma separators (e.g., 4420399 -> "4,420,399")
15397
+ */ function formatNumberWithCommas(value) {
15398
+ if (value === null || value === undefined) {
15399
+ return "0";
15400
+ }
15401
+ return value.toLocaleString("en-US");
15402
+ }
15389
15403
  /**
15390
15404
  * Formats latency in a human-readable format
15391
15405
  * @param latency - Latency in seconds
@@ -27485,4 +27499,4 @@ const GlobalStyles = ()=>{
27485
27499
  return getSafeColor(props.theme, path, fallback);
27486
27500
  };
27487
27501
 
27488
- export { AgenticFlowVisualizer, AnthropicIcon, Badge, Drawer, Edge, FileSelector, GlobalStyles, GoogleIcon, JsonTreeViewer, Node$1 as Node, OpenAIIcon, SafeThemeProvider, Select, Sheet, ThemeProvider, Timeline, Visualizer, calculateAutoLayout, cn, conditionalStyle, createSafeTheme, darkTheme, defaultTheme, detectContentType, formatCurrency, formatLatency, formatToolCalls, getColor, getSafeColor, getSafeSpacing, getSafeThemeValue, getSpacing, lightTheme, safeStyled, safeThemeColor, safeThemeSpacing, safeThemeValue, toTitleCase, truncateText, useComponentTheme, useSafeTheme, useTheme, useThemeValue };
27502
+ export { AgenticFlowVisualizer, AnthropicIcon, Badge, Drawer, Edge, FileSelector, GlobalStyles, GoogleIcon, JsonTreeViewer, Node$1 as Node, OpenAIIcon, SafeThemeProvider, Select, Sheet, ThemeProvider, Timeline, Visualizer, calculateAutoLayout, cn, conditionalStyle, createSafeTheme, darkTheme, defaultTheme, detectContentType, formatCurrency, formatLatency, formatNumberWithCommas, formatToolCalls, getColor, getSafeColor, getSafeSpacing, getSafeThemeValue, getSpacing, lightTheme, safeStyled, safeThemeColor, safeThemeSpacing, safeThemeValue, toTitleCase, truncateText, useComponentTheme, useSafeTheme, useTheme, useThemeValue };
@@ -0,0 +1,10 @@
1
+ import type { SessionListItem } from "../hooks/useSessions";
2
+ /**
3
+ * Calculate total input and output tokens for a session across all runs
4
+ * @param session - The session to calculate tokens for
5
+ * @returns An object containing inputTokens and outputTokens totals
6
+ */
7
+ export declare function calculateSessionTokens(session: SessionListItem): {
8
+ inputTokens: number;
9
+ outputTokens: number;
10
+ };
@@ -13,6 +13,12 @@ export declare function toTitleCase(str: string): string;
13
13
  * @returns The formatted dollar string with appropriate precision
14
14
  */
15
15
  export declare function formatCurrency(value: number | null | undefined): string;
16
+ /**
17
+ * Formats a number with comma separators for thousands
18
+ * @param value - The number to format
19
+ * @returns The formatted string with comma separators (e.g., 4420399 -> "4,420,399")
20
+ */
21
+ export declare function formatNumberWithCommas(value: number | null | undefined): string;
16
22
  /**
17
23
  * Formats latency in a human-readable format
18
24
  * @param latency - Latency in seconds
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@railtownai/railtracks-visualizer",
3
- "version": "0.0.43",
3
+ "version": "0.0.44",
4
4
  "license": "MIT",
5
5
  "author": "Railtown AI",
6
6
  "description": "A visualizer for Railtracks agentic flows",
@@ -106,8 +106,8 @@
106
106
  "storybook": "10.2.0",
107
107
  "typescript": "5.9.3",
108
108
  "uuid": "13.0.0",
109
- "vite": "7.2.4",
110
- "vitest": "4.0.12"
109
+ "vite": "7.3.1",
110
+ "vitest": "4.0.18"
111
111
  },
112
112
  "prettier": {
113
113
  "singleQuote": false,