@railtownai/railtracks-visualizer 0.0.53 → 0.0.54
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 +53 -11
- package/dist/esm/index.js +53 -11
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -114503,7 +114503,7 @@ function isLLMAggregateNode(n) {
|
|
|
114503
114503
|
const primaryMetric = sortedMetrics[0];
|
|
114504
114504
|
nodeChildren.push({
|
|
114505
114505
|
key: `${callKey}-${nodeId}`,
|
|
114506
|
-
name:
|
|
114506
|
+
name: nodeId,
|
|
114507
114507
|
level: 3,
|
|
114508
114508
|
metrics,
|
|
114509
114509
|
value: metrics[primaryMetric],
|
|
@@ -114637,11 +114637,19 @@ function buildTreeFromProcessedData(latencyByTool, failureRateByTool, usageCount
|
|
|
114637
114637
|
}
|
|
114638
114638
|
const children = [];
|
|
114639
114639
|
for (const [aid, group] of agentGroups){
|
|
114640
|
-
|
|
114641
|
-
const
|
|
114640
|
+
// Deduplicate by tool_node_id (or key) so each tool invocation appears once
|
|
114641
|
+
const seenIds = new Set();
|
|
114642
|
+
const uniqueLatencies = group.latencies.filter((l)=>{
|
|
114643
|
+
const id = l.toolNodeId ?? l.key;
|
|
114644
|
+
if (seenIds.has(id)) return false;
|
|
114645
|
+
seenIds.add(id);
|
|
114646
|
+
return true;
|
|
114647
|
+
});
|
|
114648
|
+
const totalRuntimeMs = uniqueLatencies.reduce((s, l)=>s + l.value * 1000, 0);
|
|
114649
|
+
const cnt = uniqueLatencies.length;
|
|
114642
114650
|
let failed = 0;
|
|
114643
114651
|
const failList = failureByToolAgentIndex.get(`${toolName}|${aid}`) ?? [];
|
|
114644
|
-
const leaves =
|
|
114652
|
+
const leaves = uniqueLatencies.map((l, idx)=>{
|
|
114645
114653
|
const failVal = failureByKey.get(l.key);
|
|
114646
114654
|
const failValByIndex = failList[idx];
|
|
114647
114655
|
const resolvedFail = failVal ?? (failValByIndex !== undefined ? failValByIndex : undefined);
|
|
@@ -114910,6 +114918,42 @@ const AggregateResultsTable = ({ rawResults = [], aggregateResults, agents, titl
|
|
|
114910
114918
|
}
|
|
114911
114919
|
];
|
|
114912
114920
|
const headerIconColor = theme.colors.foreground;
|
|
114921
|
+
const LLM_LABEL_BY_LEVEL = {
|
|
114922
|
+
1: "Agent",
|
|
114923
|
+
2: "LLM Call",
|
|
114924
|
+
3: "Agent Node"
|
|
114925
|
+
};
|
|
114926
|
+
const LLMTagForLevel = ({ level })=>{
|
|
114927
|
+
const label = LLM_LABEL_BY_LEVEL[level];
|
|
114928
|
+
const Icon = level === 3 ? Bot : Cpu;
|
|
114929
|
+
const tagStyle = level === 1 ? {
|
|
114930
|
+
background: theme.colors.tagToolLevel1?.bg ?? theme.colors.success,
|
|
114931
|
+
color: theme.colors.tagToolLevel1?.color ?? theme.colors.successForeground,
|
|
114932
|
+
border: "none"
|
|
114933
|
+
} : level === 2 ? {
|
|
114934
|
+
background: theme.colors.tagLlminference?.bg ?? theme.colors.muted,
|
|
114935
|
+
color: theme.colors.tagLlminference?.color ?? theme.colors.foreground,
|
|
114936
|
+
border: "none"
|
|
114937
|
+
} : {
|
|
114938
|
+
background: theme.colors.tagToolLevel2?.bg ?? theme.colors.primary,
|
|
114939
|
+
color: theme.colors.tagToolLevel2?.color ?? theme.colors.primaryForeground,
|
|
114940
|
+
border: "none"
|
|
114941
|
+
};
|
|
114942
|
+
return /*#__PURE__*/ React.createElement(Tag, {
|
|
114943
|
+
style: {
|
|
114944
|
+
marginRight: 8,
|
|
114945
|
+
display: "inline-flex",
|
|
114946
|
+
alignItems: "center",
|
|
114947
|
+
gap: 6,
|
|
114948
|
+
...tagStyle
|
|
114949
|
+
}
|
|
114950
|
+
}, /*#__PURE__*/ React.createElement(Icon, {
|
|
114951
|
+
size: 12,
|
|
114952
|
+
style: {
|
|
114953
|
+
flexShrink: 0
|
|
114954
|
+
}
|
|
114955
|
+
}), label);
|
|
114956
|
+
};
|
|
114913
114957
|
const llmColumns = [
|
|
114914
114958
|
{
|
|
114915
114959
|
title: /*#__PURE__*/ React.createElement("span", {
|
|
@@ -114928,16 +114972,14 @@ const AggregateResultsTable = ({ rawResults = [], aggregateResults, agents, titl
|
|
|
114928
114972
|
key: "name",
|
|
114929
114973
|
render: (name, row)=>/*#__PURE__*/ React.createElement("span", {
|
|
114930
114974
|
style: {
|
|
114975
|
+
display: "inline-flex",
|
|
114976
|
+
alignItems: "center",
|
|
114977
|
+
gap: 8,
|
|
114931
114978
|
fontFamily: "monospace",
|
|
114932
114979
|
fontSize: 13
|
|
114933
114980
|
}
|
|
114934
|
-
}, /*#__PURE__*/ React.createElement(
|
|
114935
|
-
|
|
114936
|
-
style: {
|
|
114937
|
-
marginRight: 8,
|
|
114938
|
-
verticalAlign: "middle",
|
|
114939
|
-
color: agentIconColor
|
|
114940
|
-
}
|
|
114981
|
+
}, /*#__PURE__*/ React.createElement(LLMTagForLevel, {
|
|
114982
|
+
level: row.level
|
|
114941
114983
|
}), name)
|
|
114942
114984
|
},
|
|
114943
114985
|
...METRIC_COLUMNS.map(({ key, title, Icon })=>({
|
package/dist/esm/index.js
CHANGED
|
@@ -114483,7 +114483,7 @@ function isLLMAggregateNode(n) {
|
|
|
114483
114483
|
const primaryMetric = sortedMetrics[0];
|
|
114484
114484
|
nodeChildren.push({
|
|
114485
114485
|
key: `${callKey}-${nodeId}`,
|
|
114486
|
-
name:
|
|
114486
|
+
name: nodeId,
|
|
114487
114487
|
level: 3,
|
|
114488
114488
|
metrics,
|
|
114489
114489
|
value: metrics[primaryMetric],
|
|
@@ -114617,11 +114617,19 @@ function buildTreeFromProcessedData(latencyByTool, failureRateByTool, usageCount
|
|
|
114617
114617
|
}
|
|
114618
114618
|
const children = [];
|
|
114619
114619
|
for (const [aid, group] of agentGroups){
|
|
114620
|
-
|
|
114621
|
-
const
|
|
114620
|
+
// Deduplicate by tool_node_id (or key) so each tool invocation appears once
|
|
114621
|
+
const seenIds = new Set();
|
|
114622
|
+
const uniqueLatencies = group.latencies.filter((l)=>{
|
|
114623
|
+
const id = l.toolNodeId ?? l.key;
|
|
114624
|
+
if (seenIds.has(id)) return false;
|
|
114625
|
+
seenIds.add(id);
|
|
114626
|
+
return true;
|
|
114627
|
+
});
|
|
114628
|
+
const totalRuntimeMs = uniqueLatencies.reduce((s, l)=>s + l.value * 1000, 0);
|
|
114629
|
+
const cnt = uniqueLatencies.length;
|
|
114622
114630
|
let failed = 0;
|
|
114623
114631
|
const failList = failureByToolAgentIndex.get(`${toolName}|${aid}`) ?? [];
|
|
114624
|
-
const leaves =
|
|
114632
|
+
const leaves = uniqueLatencies.map((l, idx)=>{
|
|
114625
114633
|
const failVal = failureByKey.get(l.key);
|
|
114626
114634
|
const failValByIndex = failList[idx];
|
|
114627
114635
|
const resolvedFail = failVal ?? (failValByIndex !== undefined ? failValByIndex : undefined);
|
|
@@ -114890,6 +114898,42 @@ const AggregateResultsTable = ({ rawResults = [], aggregateResults, agents, titl
|
|
|
114890
114898
|
}
|
|
114891
114899
|
];
|
|
114892
114900
|
const headerIconColor = theme.colors.foreground;
|
|
114901
|
+
const LLM_LABEL_BY_LEVEL = {
|
|
114902
|
+
1: "Agent",
|
|
114903
|
+
2: "LLM Call",
|
|
114904
|
+
3: "Agent Node"
|
|
114905
|
+
};
|
|
114906
|
+
const LLMTagForLevel = ({ level })=>{
|
|
114907
|
+
const label = LLM_LABEL_BY_LEVEL[level];
|
|
114908
|
+
const Icon = level === 3 ? Bot : Cpu;
|
|
114909
|
+
const tagStyle = level === 1 ? {
|
|
114910
|
+
background: theme.colors.tagToolLevel1?.bg ?? theme.colors.success,
|
|
114911
|
+
color: theme.colors.tagToolLevel1?.color ?? theme.colors.successForeground,
|
|
114912
|
+
border: "none"
|
|
114913
|
+
} : level === 2 ? {
|
|
114914
|
+
background: theme.colors.tagLlminference?.bg ?? theme.colors.muted,
|
|
114915
|
+
color: theme.colors.tagLlminference?.color ?? theme.colors.foreground,
|
|
114916
|
+
border: "none"
|
|
114917
|
+
} : {
|
|
114918
|
+
background: theme.colors.tagToolLevel2?.bg ?? theme.colors.primary,
|
|
114919
|
+
color: theme.colors.tagToolLevel2?.color ?? theme.colors.primaryForeground,
|
|
114920
|
+
border: "none"
|
|
114921
|
+
};
|
|
114922
|
+
return /*#__PURE__*/ React__default.createElement(Tag, {
|
|
114923
|
+
style: {
|
|
114924
|
+
marginRight: 8,
|
|
114925
|
+
display: "inline-flex",
|
|
114926
|
+
alignItems: "center",
|
|
114927
|
+
gap: 6,
|
|
114928
|
+
...tagStyle
|
|
114929
|
+
}
|
|
114930
|
+
}, /*#__PURE__*/ React__default.createElement(Icon, {
|
|
114931
|
+
size: 12,
|
|
114932
|
+
style: {
|
|
114933
|
+
flexShrink: 0
|
|
114934
|
+
}
|
|
114935
|
+
}), label);
|
|
114936
|
+
};
|
|
114893
114937
|
const llmColumns = [
|
|
114894
114938
|
{
|
|
114895
114939
|
title: /*#__PURE__*/ React__default.createElement("span", {
|
|
@@ -114908,16 +114952,14 @@ const AggregateResultsTable = ({ rawResults = [], aggregateResults, agents, titl
|
|
|
114908
114952
|
key: "name",
|
|
114909
114953
|
render: (name, row)=>/*#__PURE__*/ React__default.createElement("span", {
|
|
114910
114954
|
style: {
|
|
114955
|
+
display: "inline-flex",
|
|
114956
|
+
alignItems: "center",
|
|
114957
|
+
gap: 8,
|
|
114911
114958
|
fontFamily: "monospace",
|
|
114912
114959
|
fontSize: 13
|
|
114913
114960
|
}
|
|
114914
|
-
}, /*#__PURE__*/ React__default.createElement(
|
|
114915
|
-
|
|
114916
|
-
style: {
|
|
114917
|
-
marginRight: 8,
|
|
114918
|
-
verticalAlign: "middle",
|
|
114919
|
-
color: agentIconColor
|
|
114920
|
-
}
|
|
114961
|
+
}, /*#__PURE__*/ React__default.createElement(LLMTagForLevel, {
|
|
114962
|
+
level: row.level
|
|
114921
114963
|
}), name)
|
|
114922
114964
|
},
|
|
114923
114965
|
...METRIC_COLUMNS.map(({ key, title, Icon })=>({
|