agentic-ui-libs 1.2.0-beta.20 → 1.2.0-beta.21

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.
@@ -4331,7 +4331,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4331
4331
  onClick,
4332
4332
  isFirst = false
4333
4333
  }) => {
4334
- const { title, value, change, info, highlighted } = data;
4334
+ const { title, value, change, info, highlighted, failedCount } = data;
4335
4335
  const formatValue2 = (val) => {
4336
4336
  if (typeof val === "number") {
4337
4337
  return val.toLocaleString();
@@ -4385,6 +4385,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4385
4385
  ] }),
4386
4386
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-baseline gap-3", "data-test-id": `dashboard_metric_card_value_container_${data.metricType || data.title.toLowerCase().replace(/\s+/g, "_")}`, children: [
4387
4387
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-2xl font-semibold text-gray-900", "data-test-id": `dashboard_metric_card_value_${data.metricType || data.title.toLowerCase().replace(/\s+/g, "_")}`, children: formatValue2(value) }),
4388
+ (failedCount ?? 0) > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-xs font-medium text-red-500", "data-test-id": `dashboard_metric_card_failed_${data.metricType}`, children: [
4389
+ "(",
4390
+ failedCount,
4391
+ " failed)"
4392
+ ] }),
4388
4393
  change && /* @__PURE__ */ jsxRuntimeExports.jsxs(
4389
4394
  "div",
4390
4395
  {
@@ -21395,7 +21400,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
21395
21400
  if ("object" != _typeof$i(i2)) return i2;
21396
21401
  throw new TypeError("@@toPrimitive must return a primitive value.");
21397
21402
  }
21398
- return ("string" === r2 ? String : Number)(t);
21403
+ return String(t);
21399
21404
  }
21400
21405
  var Bar = /* @__PURE__ */ function(_PureComponent) {
21401
21406
  function Bar2() {
@@ -28702,7 +28707,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
28702
28707
  return null;
28703
28708
  }
28704
28709
  const filteredPayload = payload.filter(
28705
- (entry) => entry.name && entry.name !== "" && entry.name !== entry.dataKey
28710
+ (entry) => entry.name && entry.name !== "" && entry.name !== entry.dataKey && entry.value != null && !(typeof entry.value === "number" && Number.isNaN(entry.value)) && !(entry.dataKey === "failedModelRuns" && Number(entry.value) === 0)
28706
28711
  );
28707
28712
  if (filteredPayload.length === 0) {
28708
28713
  return null;
@@ -28802,6 +28807,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
28802
28807
  agentRuns: 0,
28803
28808
  toolRuns: 0,
28804
28809
  modelRuns: 0,
28810
+ failedModelRuns: null,
28805
28811
  codeTools: 0,
28806
28812
  workflowTools: 0,
28807
28813
  knowledgeTools: 0,
@@ -28904,6 +28910,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
28904
28910
  label: config2.title,
28905
28911
  strokeWidth: 2
28906
28912
  }];
28913
+ const lineSeries = chartLines.filter((c2) => (c2.seriesType ?? "line") === "line");
28914
+ const barSeries = chartLines.filter((c2) => c2.seriesType === "bar");
28907
28915
  if (isLoading) {
28908
28916
  console.log("AnalyticsChart: Loading state active");
28909
28917
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ChartSkeleton, { className, chartType: config2.type, height });
@@ -29010,7 +29018,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
29010
29018
  bottom: 20
29011
29019
  },
29012
29020
  children: [
29013
- /* @__PURE__ */ jsxRuntimeExports.jsx("defs", { children: chartLines.map((lineConfig, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("linearGradient", { id: `gradient-${lineConfig.dataKey}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
29021
+ /* @__PURE__ */ jsxRuntimeExports.jsx("defs", { children: lineSeries.map((lineConfig, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("linearGradient", { id: `gradient-${lineConfig.dataKey}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
29014
29022
  /* @__PURE__ */ jsxRuntimeExports.jsx("stop", { offset: "5%", stopColor: lineConfig.color, stopOpacity: 0.08 }),
29015
29023
  /* @__PURE__ */ jsxRuntimeExports.jsx("stop", { offset: "95%", stopColor: lineConfig.color, stopOpacity: 0.01 })
29016
29024
  ] }, `gradient-${index}`)) }),
@@ -29062,7 +29070,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
29062
29070
  allowEscapeViewBox: { x: false, y: false }
29063
29071
  }
29064
29072
  ),
29065
- chartLines.map((lineConfig) => /* @__PURE__ */ jsxRuntimeExports.jsx(
29073
+ lineSeries.map((lineConfig) => /* @__PURE__ */ jsxRuntimeExports.jsx(
29066
29074
  Area,
29067
29075
  {
29068
29076
  type: "monotone",
@@ -29070,12 +29078,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
29070
29078
  stroke: "none",
29071
29079
  fill: `url(#gradient-${lineConfig.dataKey})`,
29072
29080
  fillOpacity: 1,
29081
+ connectNulls: false,
29073
29082
  isAnimationActive: false,
29074
29083
  name: ""
29075
29084
  },
29076
29085
  `area-${lineConfig.dataKey}`
29077
29086
  )),
29078
- chartLines.map((lineConfig) => /* @__PURE__ */ jsxRuntimeExports.jsx(
29087
+ lineSeries.map((lineConfig) => /* @__PURE__ */ jsxRuntimeExports.jsx(
29079
29088
  Line,
29080
29089
  {
29081
29090
  type: "monotone",
@@ -29083,6 +29092,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
29083
29092
  stroke: lineConfig.color,
29084
29093
  strokeWidth: 2.5,
29085
29094
  strokeDasharray: lineConfig.strokeDasharray,
29095
+ connectNulls: false,
29086
29096
  dot: false,
29087
29097
  activeDot: {
29088
29098
  r: 5,
@@ -29093,6 +29103,19 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
29093
29103
  name: lineConfig.label
29094
29104
  },
29095
29105
  lineConfig.dataKey
29106
+ )),
29107
+ barSeries.map((lineConfig) => /* @__PURE__ */ jsxRuntimeExports.jsx(
29108
+ Bar,
29109
+ {
29110
+ dataKey: lineConfig.dataKey,
29111
+ fill: lineConfig.color,
29112
+ fillOpacity: 0.9,
29113
+ name: lineConfig.label,
29114
+ maxBarSize: 14,
29115
+ radius: [3, 3, 0, 0],
29116
+ isAnimationActive: false
29117
+ },
29118
+ `bar-${lineConfig.dataKey}`
29096
29119
  ))
29097
29120
  ]
29098
29121
  }
@@ -29114,8 +29137,15 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
29114
29137
  })
29115
29138
  ] })
29116
29139
  ] }) }),
29117
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-4", "data-test-id": "dashboard_analytics_chart_legend", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-4 text-sm text-muted-foreground", "data-test-id": "dashboard_analytics_chart_legend_items", children: chartLines.map((lineConfig) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", "data-test-id": `dashboard_analytics_chart_legend_item_${lineConfig.dataKey}`, children: [
29118
- /* @__PURE__ */ jsxRuntimeExports.jsx(
29140
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-4", "data-test-id": "dashboard_analytics_chart_legend", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-4 text-sm text-muted-foreground", "data-test-id": "dashboard_analytics_chart_legend_items", children: chartLines.filter((lineConfig) => !lineConfig.hideInLegend).map((lineConfig) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", "data-test-id": `dashboard_analytics_chart_legend_item_${lineConfig.dataKey}`, children: [
29141
+ lineConfig.seriesType === "bar" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
29142
+ "div",
29143
+ {
29144
+ className: "w-2 h-2 rounded-[2px]",
29145
+ style: { backgroundColor: lineConfig.color },
29146
+ "data-test-id": `dashboard_analytics_chart_legend_color_${lineConfig.dataKey}`
29147
+ }
29148
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
29119
29149
  "div",
29120
29150
  {
29121
29151
  className: "w-[8px] h-[8px] rounded-full",
@@ -29672,6 +29702,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
29672
29702
  return "bg-green-100 text-green-800 border-green-200";
29673
29703
  if (["knowledge", "KNOWLEDGE", "knowledge tool"].includes(type) || ["knowledge", "knowledge tool"].includes(normalized))
29674
29704
  return "bg-purple-100 text-purple-800 border-purple-200";
29705
+ if (["PRE_PROCESSOR", "POST_PROCESSOR", "INPUT_PROCESSOR", "input_processor", "pre_processor", "post_processor", "processor"].includes(type) || ["pre_processor", "post_processor", "processor", "input_processor"].includes(normalized))
29706
+ return "bg-yellow-100 text-yellow-800 border-yellow-200";
29675
29707
  return "bg-gray-100 text-gray-800 border-gray-200";
29676
29708
  }
29677
29709
  function getToolTypeName(type) {
@@ -29680,6 +29712,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
29680
29712
  if (["toollibrary", "workflow tool"].includes(normalized)) return "Workflow Tool";
29681
29713
  if (["mcp", "mcptool"].includes(normalized)) return "MCP Tool";
29682
29714
  if (["knowledge", "knowledge tool", "knowledge"].includes(normalized) || type === "KNOWLEDGE") return "Knowledge";
29715
+ if (["pre_processor", "post_processor", "processor", "input_processor"].includes(normalized) || type === "PRE_PROCESSOR" || type === "POST_PROCESSOR" || type === "INPUT_PROCESSOR" || type === "input_processor")
29716
+ return "Processor";
29683
29717
  if (type === "inlineTool") return "Code Tool";
29684
29718
  if (type === "toolLibrary") return "Workflow Tool";
29685
29719
  if (type === "KNOWLEDGE") return "Knowledge";
@@ -29906,7 +29940,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
29906
29940
  model.provider && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-gray-500 truncate", "data-test-id": `dashboard_model_list_view_row_provider_${index}`, children: getProviderDisplayName(model.provider) })
29907
29941
  ] })
29908
29942
  ] }),
29909
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center font-medium text-xs text-gray-700", "data-test-id": `dashboard_model_list_view_row_runs_${index}`, children: formatValue2(model.runs || 0) }),
29943
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center font-medium text-xs text-gray-700 flex items-center justify-center gap-1", "data-test-id": `dashboard_model_list_view_row_runs_${index}`, children: [
29944
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: formatValue2(model.runs || 0) }),
29945
+ (model.failedRuns ?? 0) > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-red-500 text-[10px] font-medium", "data-test-id": `dashboard_model_list_view_row_failed_${index}`, children: [
29946
+ "(",
29947
+ model.failedRuns,
29948
+ " failed)"
29949
+ ] })
29950
+ ] }),
29910
29951
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center font-medium text-xs text-gray-700", "data-test-id": `dashboard_model_list_view_row_tokens_${index}`, children: formatValue2(model.tokens || model.totalTokens || 0) }),
29911
29952
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center font-medium text-xs text-gray-700", "data-test-id": `dashboard_model_list_view_row_response_time_${index}`, children: model.responseTime || (model.avgResponseTime ? `${model.avgResponseTime}ms` : "N/A") })
29912
29953
  ]
@@ -30586,6 +30627,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
30586
30627
  {
30587
30628
  title: "Model Runs",
30588
30629
  value: data.data.modelRuns,
30630
+ failedCount: data.data.failedModelRuns || 0,
30589
30631
  metricType: "modelRuns",
30590
30632
  icon: "cpu",
30591
30633
  info: "Number of times the AI agents called various language models to generate responses",
@@ -30662,8 +30704,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
30662
30704
  basePoint.toolRuns = point2.count || 0;
30663
30705
  break;
30664
30706
  case "modelRuns":
30707
+ case "modelruns": {
30708
+ const failed = point2.failedModelRuns;
30665
30709
  basePoint.modelRuns = point2.count || 0;
30710
+ basePoint.failedModelRuns = typeof failed === "number" && failed >= 0 ? failed : 0;
30666
30711
  break;
30712
+ }
30667
30713
  default:
30668
30714
  basePoint.users = point2.count || 0;
30669
30715
  basePoint.sessions = point2.count || 0;
@@ -30672,6 +30718,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
30672
30718
  basePoint.agentRuns = point2.count || 0;
30673
30719
  basePoint.toolRuns = point2.count || 0;
30674
30720
  basePoint.modelRuns = point2.count || 0;
30721
+ {
30722
+ const failed = point2.failedModelRuns;
30723
+ basePoint.failedModelRuns = typeof failed === "number" && failed >= 0 ? failed : 0;
30724
+ }
30675
30725
  }
30676
30726
  console.log(`Transformed point ${index} for metric ${metricType}:`, basePoint);
30677
30727
  return basePoint;
@@ -30756,22 +30806,16 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
30756
30806
  id: `model-${index + 1}`,
30757
30807
  name: item.connectionName ? `${item.modelName} - ${item.connectionName}` : item.modelName || `Model ${index + 1}`,
30758
30808
  modelName: item.modelName,
30759
- // Keep original modelName field
30760
30809
  provider: item.provider,
30761
- // Include provider information
30762
30810
  runs: item.count || 0,
30811
+ failedRuns: item.failedRuns || 0,
30763
30812
  responseTime: item.avgResponseTime ? item.avgResponseTime < 1e3 ? `${Math.round(item.avgResponseTime)}ms` : `${(item.avgResponseTime / 1e3).toFixed(2)}s` : "0ms",
30764
30813
  avgResponseTime: item.avgResponseTime,
30765
- // Keep original avgResponseTime
30766
30814
  tokens: item.tokens || item.totalTokens || Math.floor((item.count || 0) * 300),
30767
- // Use actual token data when available
30768
30815
  totalTokens: item.totalTokens || item.tokens,
30769
- // Include totalTokens field
30770
30816
  successRate: item.successRate ? `${Math.round(item.successRate)}%` : "98%",
30771
- // Default success rate for models
30772
30817
  lastRun: item.lastRun || new Date(Date.now() - Math.random() * 7 * 24 * 60 * 60 * 1e3).toLocaleDateString(),
30773
30818
  icon: item.icon
30774
- // Preserve original icon data if available
30775
30819
  }));
30776
30820
  }
30777
30821
  // Extract control options from listView data for agents
@@ -30825,9 +30869,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
30825
30869
  if (["toollibrary", "workflow tool"].includes(normalized)) return "Workflow Tool";
30826
30870
  if (["mcp", "mcptool"].includes(normalized)) return "MCP Tool";
30827
30871
  if (["knowledge", "knowledge tool"].includes(normalized) || toolType === "KNOWLEDGE") return "Knowledge";
30872
+ if (["pre_processor", "post_processor", "processor", "input_processor"].includes(normalized)) return "Processor";
30828
30873
  if (toolType === "inlineTool") return "Code Tool";
30829
30874
  if (toolType === "toolLibrary") return "Workflow Tool";
30830
30875
  if (toolType === "MCP" || toolType === "mcpTool") return "MCP Tool";
30876
+ if (toolType === "PRE_PROCESSOR" || toolType === "POST_PROCESSOR" || toolType === "INPUT_PROCESSOR" || toolType === "input_processor") return "Processor";
30831
30877
  return "Code Tool";
30832
30878
  };
30833
30879
  options.push({
@@ -30954,6 +31000,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
30954
31000
  if (aggregated.has(key)) {
30955
31001
  const existing = aggregated.get(key);
30956
31002
  existing.count = (existing.count || 0) + (item.count || 0);
31003
+ existing.failedRuns = (existing.failedRuns || 0) + (item.failedRuns || 0);
30957
31004
  existing.avgResponseTime = existing.avgResponseTime && item.avgResponseTime ? (existing.avgResponseTime + item.avgResponseTime) / 2 : existing.avgResponseTime || item.avgResponseTime;
30958
31005
  existing.tokens = (existing.tokens || 0) + (item.tokens || 0);
30959
31006
  } else {
@@ -30965,11 +31012,24 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
30965
31012
  // Batch fetch enhanced data for all metrics with table and control data
30966
31013
  async fetchEnhancedMetricsData(fromTimestamp, toTimestamp, timeDimension, filters = []) {
30967
31014
  try {
30968
- const [agentsData, toolsData, modelsData] = await Promise.all([
31015
+ const results = await Promise.allSettled([
30969
31016
  this.fetchTimeSeriesDataWithTableData("agent-runs", "runs", fromTimestamp, toTimestamp, timeDimension, filters),
30970
31017
  this.fetchTimeSeriesDataWithTableData("tool-runs", "runs", fromTimestamp, toTimestamp, timeDimension, filters),
30971
31018
  this.fetchTimeSeriesDataWithTableData("model-runs", "runs", fromTimestamp, toTimestamp, timeDimension, filters)
30972
31019
  ]);
31020
+ if (results[0].status === "rejected") {
31021
+ console.error("Error fetching agent runs enhanced data:", results[0].reason);
31022
+ }
31023
+ if (results[1].status === "rejected") {
31024
+ console.error("Error fetching tool runs enhanced data:", results[1].reason);
31025
+ }
31026
+ if (results[2].status === "rejected") {
31027
+ console.error("Error fetching model runs enhanced data:", results[2].reason);
31028
+ }
31029
+ const emptyData = { chartData: [], tableData: [], controlOptions: [] };
31030
+ const agentsData = results[0].status === "fulfilled" ? results[0].value : emptyData;
31031
+ const toolsData = results[1].status === "fulfilled" ? results[1].value : emptyData;
31032
+ const modelsData = results[2].status === "fulfilled" ? results[2].value : emptyData;
30973
31033
  return {
30974
31034
  agents: agentsData,
30975
31035
  tools: toolsData,
@@ -30986,13 +31046,30 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
30986
31046
  const getChangeType = (changePercent) => {
30987
31047
  return changePercent > 0 ? "increase" : "decrease";
30988
31048
  };
30989
- const [agentsData, toolsData, modelsData, toolRunsTimeSeriesData] = await Promise.all([
31049
+ const results = await Promise.allSettled([
30990
31050
  this.fetchTimeSeriesDataWithTableData("agent-runs", "runs", fromTimestamp, toTimestamp, timeDimension, filters),
30991
31051
  this.fetchTimeSeriesDataWithTableData("tool-runs", "runs", fromTimestamp, toTimestamp, timeDimension, filters),
30992
31052
  this.fetchTimeSeriesDataWithTableData("model-runs", "runs", fromTimestamp, toTimestamp, timeDimension, filters),
30993
31053
  this.fetchTimeSeriesData("tool-runs", "runs", fromTimestamp, toTimestamp, timeDimension, filters)
30994
31054
  ]);
30995
- const enhancedToolRunsChartData = this.transformTimeSeriesDataForToolRuns(toolRunsTimeSeriesData);
31055
+ if (results[0].status === "rejected") {
31056
+ console.error("Error fetching agent runs data:", results[0].reason);
31057
+ }
31058
+ if (results[1].status === "rejected") {
31059
+ console.error("Error fetching tool runs data:", results[1].reason);
31060
+ }
31061
+ if (results[2].status === "rejected") {
31062
+ console.error("Error fetching model runs data:", results[2].reason);
31063
+ }
31064
+ if (results[3].status === "rejected") {
31065
+ console.error("Error fetching tool runs time series data:", results[3].reason);
31066
+ }
31067
+ const emptyEnhancedData = { chartData: [], tableData: [], controlOptions: [] };
31068
+ const agentsData = results[0].status === "fulfilled" ? results[0].value : emptyEnhancedData;
31069
+ const toolsData = results[1].status === "fulfilled" ? results[1].value : emptyEnhancedData;
31070
+ const modelsData = results[2].status === "fulfilled" ? results[2].value : emptyEnhancedData;
31071
+ const toolRunsTimeSeriesData = results[3].status === "fulfilled" ? results[3].value : void 0;
31072
+ const enhancedToolRunsChartData = toolRunsTimeSeriesData ? this.transformTimeSeriesDataForToolRuns(toolRunsTimeSeriesData) : [];
30996
31073
  return [
30997
31074
  {
30998
31075
  title: "Agent Runs",
@@ -31006,68 +31083,70 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
31006
31083
  value: Math.abs(trends.agentRuns.changePercent),
31007
31084
  type: getChangeType(trends.agentRuns.changePercent)
31008
31085
  } : void 0,
31009
- view: {
31010
- type: "chart",
31011
- chart: {
31012
- type: "line",
31013
- title: "Agent Runs",
31014
- data: agentsData.chartData,
31015
- dataKey: "agentRuns",
31016
- color: "#0BA5EC",
31017
- yAxisLabel: "Number of Agent Runs",
31018
- height: 300,
31019
- showGrid: true,
31020
- curve: "monotone",
31021
- tooltip: { show: true, style: "dark" },
31022
- dateRange: {
31023
- start: fromTimestamp.split("T")[0],
31024
- end: toTimestamp.split("T")[0]
31025
- }
31026
- },
31027
- table: {
31028
- title: "Agent Runs",
31029
- data: agentsData.tableData,
31030
- columns: [
31031
- {
31032
- key: "name",
31033
- title: "Name",
31034
- width: 200,
31035
- align: "left"
31036
- },
31037
- {
31038
- key: "runs",
31039
- title: "Runs",
31040
- width: 100,
31041
- align: "right",
31042
- formatter: (value) => `${Math.floor(value / 1e3)}k`
31043
- },
31044
- {
31045
- key: "responseTime",
31046
- title: "Response Time",
31047
- width: 120,
31048
- align: "right"
31049
- },
31050
- {
31051
- key: "tokens",
31052
- title: "Tokens",
31053
- width: 100,
31054
- align: "right",
31055
- formatter: (value) => `${Math.floor(value / 1e3)}k`
31086
+ ...agentsData && {
31087
+ view: {
31088
+ type: "chart",
31089
+ chart: {
31090
+ type: "line",
31091
+ title: "Agent Runs",
31092
+ data: agentsData.chartData,
31093
+ dataKey: "agentRuns",
31094
+ color: "#0BA5EC",
31095
+ yAxisLabel: "Number of Agent Runs",
31096
+ height: 300,
31097
+ showGrid: true,
31098
+ curve: "monotone",
31099
+ tooltip: { show: true, style: "dark" },
31100
+ dateRange: {
31101
+ start: fromTimestamp.split("T")[0],
31102
+ end: toTimestamp.split("T")[0]
31056
31103
  }
31057
- ]
31058
- }
31059
- },
31060
- controls: {
31061
- dropdown: {
31062
- label: "All Agents",
31063
- options: agentsData.controlOptions,
31064
- defaultValue: ["all"],
31065
- multiSelect: true,
31066
- searchable: true
31104
+ },
31105
+ table: {
31106
+ title: "Agent Runs",
31107
+ data: agentsData.tableData,
31108
+ columns: [
31109
+ {
31110
+ key: "name",
31111
+ title: "Name",
31112
+ width: 200,
31113
+ align: "left"
31114
+ },
31115
+ {
31116
+ key: "runs",
31117
+ title: "Runs",
31118
+ width: 100,
31119
+ align: "right",
31120
+ formatter: (value) => `${Math.floor(value / 1e3)}k`
31121
+ },
31122
+ {
31123
+ key: "responseTime",
31124
+ title: "Response Time",
31125
+ width: 120,
31126
+ align: "right"
31127
+ },
31128
+ {
31129
+ key: "tokens",
31130
+ title: "Tokens",
31131
+ width: 100,
31132
+ align: "right",
31133
+ formatter: (value) => `${Math.floor(value / 1e3)}k`
31134
+ }
31135
+ ]
31136
+ }
31067
31137
  },
31068
- toggle: {
31069
- chartView: true,
31070
- tableView: true
31138
+ controls: {
31139
+ dropdown: {
31140
+ label: "All Agents",
31141
+ options: agentsData.controlOptions,
31142
+ defaultValue: ["all"],
31143
+ multiSelect: true,
31144
+ searchable: true
31145
+ },
31146
+ toggle: {
31147
+ chartView: true,
31148
+ tableView: true
31149
+ }
31071
31150
  }
31072
31151
  }
31073
31152
  },
@@ -31082,99 +31161,107 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
31082
31161
  value: Math.abs(trends.toolRuns.changePercent.total),
31083
31162
  type: getChangeType(trends.toolRuns.changePercent.total)
31084
31163
  } : void 0,
31085
- view: {
31086
- type: "chart",
31087
- chart: {
31088
- type: "line",
31089
- title: "Tool Runs",
31090
- data: enhancedToolRunsChartData,
31091
- yAxisLabel: "Number of Tool Runs",
31092
- lines: [
31093
- {
31094
- dataKey: "toolRuns",
31095
- color: "#667085",
31096
- label: "Tool Runs"
31097
- },
31098
- {
31099
- dataKey: "codeTools",
31100
- color: "#F38744",
31101
- label: "Code Tools"
31102
- },
31103
- {
31104
- dataKey: "workflowTools",
31105
- color: "#2970FF",
31106
- label: "Workflow Tools"
31107
- },
31108
- {
31109
- dataKey: "knowledgeTools",
31110
- color: "#7A5AF8",
31111
- label: "Knowledge"
31112
- },
31113
- {
31114
- dataKey: "mcpTools",
31115
- color: "#47CD89",
31116
- label: "MCP Tools"
31164
+ ...toolsData && {
31165
+ view: {
31166
+ type: "chart",
31167
+ chart: {
31168
+ type: "line",
31169
+ title: "Tool Runs",
31170
+ data: enhancedToolRunsChartData,
31171
+ yAxisLabel: "Number of Tool Runs",
31172
+ lines: [
31173
+ {
31174
+ dataKey: "toolRuns",
31175
+ color: "#667085",
31176
+ label: "Tool Runs"
31177
+ },
31178
+ {
31179
+ dataKey: "codeTools",
31180
+ color: "#F38744",
31181
+ label: "Code Tools"
31182
+ },
31183
+ {
31184
+ dataKey: "workflowTools",
31185
+ color: "#2970FF",
31186
+ label: "Workflow Tools"
31187
+ },
31188
+ {
31189
+ dataKey: "knowledgeTools",
31190
+ color: "#7A5AF8",
31191
+ label: "Knowledge"
31192
+ },
31193
+ {
31194
+ dataKey: "mcpTools",
31195
+ color: "#47CD89",
31196
+ label: "MCP Tools"
31197
+ },
31198
+ {
31199
+ dataKey: "processors",
31200
+ color: "#EAB308",
31201
+ label: "Processors"
31202
+ }
31203
+ ],
31204
+ height: 300,
31205
+ showGrid: true,
31206
+ showLegend: true,
31207
+ curve: "monotone",
31208
+ tooltip: { show: true, style: "dark" },
31209
+ dateRange: {
31210
+ start: fromTimestamp.split("T")[0],
31211
+ end: toTimestamp.split("T")[0]
31117
31212
  }
31118
- ],
31119
- height: 300,
31120
- showGrid: true,
31121
- showLegend: true,
31122
- curve: "monotone",
31123
- tooltip: { show: true, style: "dark" },
31124
- dateRange: {
31125
- start: fromTimestamp.split("T")[0],
31126
- end: toTimestamp.split("T")[0]
31213
+ },
31214
+ table: {
31215
+ title: "Tool Runs",
31216
+ data: toolsData.tableData,
31217
+ columns: [
31218
+ {
31219
+ key: "name",
31220
+ title: "Name",
31221
+ width: 200,
31222
+ align: "left"
31223
+ },
31224
+ {
31225
+ key: "type",
31226
+ title: "Type",
31227
+ width: 150,
31228
+ align: "left"
31229
+ },
31230
+ {
31231
+ key: "runs",
31232
+ title: "Runs",
31233
+ width: 100,
31234
+ align: "right",
31235
+ formatter: (value) => `${Math.floor(value / 1e3)}k`
31236
+ },
31237
+ {
31238
+ key: "responseTime",
31239
+ title: "Response Time",
31240
+ width: 120,
31241
+ align: "right"
31242
+ }
31243
+ ]
31127
31244
  }
31128
31245
  },
31129
- table: {
31130
- title: "Tool Runs",
31131
- data: toolsData.tableData,
31132
- columns: [
31133
- {
31134
- key: "name",
31135
- title: "Name",
31136
- width: 200,
31137
- align: "left"
31138
- },
31139
- {
31140
- key: "type",
31141
- title: "Type",
31142
- width: 150,
31143
- align: "left"
31144
- },
31145
- {
31146
- key: "runs",
31147
- title: "Runs",
31148
- width: 100,
31149
- align: "right",
31150
- formatter: (value) => `${Math.floor(value / 1e3)}k`
31151
- },
31152
- {
31153
- key: "responseTime",
31154
- title: "Response Time",
31155
- width: 120,
31156
- align: "right"
31157
- }
31158
- ]
31159
- }
31160
- },
31161
- controls: {
31162
- dropdown: {
31163
- label: "All Tools",
31164
- options: toolsData.controlOptions,
31165
- defaultValue: ["all"],
31166
- multiSelect: true,
31167
- searchable: true
31168
- },
31169
- toggle: {
31170
- chartView: true,
31171
- tableView: true
31246
+ controls: {
31247
+ dropdown: {
31248
+ label: "All Tools",
31249
+ options: toolsData.controlOptions,
31250
+ defaultValue: ["all"],
31251
+ multiSelect: true,
31252
+ searchable: true
31253
+ },
31254
+ toggle: {
31255
+ chartView: true,
31256
+ tableView: true
31257
+ }
31172
31258
  }
31173
31259
  }
31174
31260
  },
31175
31261
  {
31176
31262
  title: "Model Runs",
31177
31263
  value: data.data.modelRuns,
31264
+ failedCount: data.data.failedModelRuns || 0,
31178
31265
  metricType: "modelRuns",
31179
31266
  icon: "cpu",
31180
31267
  highlighted: false,
@@ -31183,68 +31270,79 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
31183
31270
  value: Math.abs(trends.modelRuns.changePercent),
31184
31271
  type: getChangeType(trends.modelRuns.changePercent)
31185
31272
  } : void 0,
31186
- view: {
31187
- type: "chart",
31188
- chart: {
31189
- type: "line",
31190
- title: "Model Runs",
31191
- data: modelsData.chartData,
31192
- dataKey: "modelRuns",
31193
- color: "#47CD89",
31194
- yAxisLabel: "Number of Model Runs",
31195
- height: 300,
31196
- showGrid: true,
31197
- curve: "monotone",
31198
- tooltip: { show: true, style: "dark" },
31199
- dateRange: {
31200
- start: fromTimestamp.split("T")[0],
31201
- end: toTimestamp.split("T")[0]
31202
- }
31203
- },
31204
- table: {
31205
- title: "Model Runs",
31206
- data: modelsData.tableData,
31207
- columns: [
31208
- {
31209
- key: "name",
31210
- title: "Model Name",
31211
- width: 200,
31212
- align: "left"
31213
- },
31214
- {
31215
- key: "runs",
31216
- title: "Runs",
31217
- width: 100,
31218
- align: "right",
31219
- formatter: (value) => `${Math.floor(value / 1e3)}k`
31220
- },
31221
- {
31222
- key: "tokens",
31223
- title: "Tokens",
31224
- width: 120,
31225
- align: "right",
31226
- formatter: (value) => `${Math.floor(value / 1e3)}k`
31227
- },
31228
- {
31229
- key: "responseTime",
31230
- title: "Response Time",
31231
- width: 120,
31232
- align: "right"
31273
+ ...modelsData && {
31274
+ view: {
31275
+ type: "chart",
31276
+ chart: {
31277
+ type: "line",
31278
+ title: "Model Runs",
31279
+ data: modelsData.chartData,
31280
+ yAxisLabel: "Number of Model Runs",
31281
+ lines: [
31282
+ { dataKey: "modelRuns", color: "#47CD89", label: "Model Runs" },
31283
+ {
31284
+ dataKey: "failedModelRuns",
31285
+ color: "#ef4444",
31286
+ label: "Failed",
31287
+ seriesType: "bar",
31288
+ hideInLegend: true
31289
+ }
31290
+ ],
31291
+ height: 300,
31292
+ showGrid: true,
31293
+ showLegend: true,
31294
+ curve: "monotone",
31295
+ tooltip: { show: true, style: "dark" },
31296
+ dateRange: {
31297
+ start: fromTimestamp.split("T")[0],
31298
+ end: toTimestamp.split("T")[0]
31233
31299
  }
31234
- ]
31235
- }
31236
- },
31237
- controls: {
31238
- dropdown: {
31239
- label: "All Models",
31240
- options: modelsData.controlOptions,
31241
- defaultValue: ["all"],
31242
- multiSelect: true,
31243
- searchable: true
31300
+ },
31301
+ table: {
31302
+ title: "Model Runs",
31303
+ data: modelsData.tableData,
31304
+ columns: [
31305
+ {
31306
+ key: "name",
31307
+ title: "Model Name",
31308
+ width: 200,
31309
+ align: "left"
31310
+ },
31311
+ {
31312
+ key: "runs",
31313
+ title: "Runs",
31314
+ width: 100,
31315
+ align: "right",
31316
+ formatter: (value) => `${Math.floor(value / 1e3)}k`
31317
+ },
31318
+ {
31319
+ key: "tokens",
31320
+ title: "Tokens",
31321
+ width: 120,
31322
+ align: "right",
31323
+ formatter: (value) => `${Math.floor(value / 1e3)}k`
31324
+ },
31325
+ {
31326
+ key: "responseTime",
31327
+ title: "Response Time",
31328
+ width: 120,
31329
+ align: "right"
31330
+ }
31331
+ ]
31332
+ }
31244
31333
  },
31245
- toggle: {
31246
- chartView: true,
31247
- tableView: true
31334
+ controls: {
31335
+ dropdown: {
31336
+ label: "All Models",
31337
+ options: modelsData.controlOptions,
31338
+ defaultValue: ["all"],
31339
+ multiSelect: true,
31340
+ searchable: true
31341
+ },
31342
+ toggle: {
31343
+ chartView: true,
31344
+ tableView: true
31345
+ }
31248
31346
  }
31249
31347
  }
31250
31348
  }
@@ -31256,12 +31354,34 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
31256
31354
  const getChangeType = (changePercent) => {
31257
31355
  return changePercent > 0 ? "increase" : "decrease";
31258
31356
  };
31259
- const [usersData, sessionsData, messagesData, tokensData] = await Promise.all([
31357
+ const results = await Promise.allSettled([
31260
31358
  this.fetchTimeSeriesData("users", "usage-analytics", fromTimestamp, toTimestamp, timeDimension, filters),
31261
31359
  this.fetchTimeSeriesData("sessions", "usage-analytics", fromTimestamp, toTimestamp, timeDimension, filters),
31262
31360
  this.fetchTimeSeriesData("messages", "usage-analytics", fromTimestamp, toTimestamp, timeDimension, filters),
31263
31361
  this.fetchTimeSeriesData("tokens", "usage-analytics", fromTimestamp, toTimestamp, timeDimension, filters)
31264
31362
  ]);
31363
+ if (results[0].status === "rejected") {
31364
+ console.error("Error fetching users data:", results[0].reason);
31365
+ }
31366
+ if (results[1].status === "rejected") {
31367
+ console.error("Error fetching sessions data:", results[1].reason);
31368
+ }
31369
+ if (results[2].status === "rejected") {
31370
+ console.error("Error fetching messages data:", results[2].reason);
31371
+ }
31372
+ if (results[3].status === "rejected") {
31373
+ console.error("Error fetching tokens data:", results[3].reason);
31374
+ }
31375
+ const emptyTimeSeries = {
31376
+ type: "time-series",
31377
+ category: "usage-analytics",
31378
+ metric: "",
31379
+ data: []
31380
+ };
31381
+ const usersData = results[0].status === "fulfilled" ? results[0].value : { ...emptyTimeSeries, metric: "users" };
31382
+ const sessionsData = results[1].status === "fulfilled" ? results[1].value : { ...emptyTimeSeries, metric: "sessions" };
31383
+ const messagesData = results[2].status === "fulfilled" ? results[2].value : { ...emptyTimeSeries, metric: "messages" };
31384
+ const tokensData = results[3].status === "fulfilled" ? results[3].value : { ...emptyTimeSeries, metric: "tokens" };
31265
31385
  return [
31266
31386
  {
31267
31387
  title: "Users",
@@ -31275,22 +31395,24 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
31275
31395
  value: Math.abs(trends.users.changePercent),
31276
31396
  type: getChangeType(trends.users.changePercent)
31277
31397
  } : void 0,
31278
- view: {
31279
- type: "chart",
31280
- chart: {
31281
- type: "line",
31282
- title: "Total Users",
31283
- data: this.transformTimeSeriesDataForMetric(usersData, "users"),
31284
- dataKey: "users",
31285
- color: "#4E5BA6",
31286
- yAxisLabel: "Number of Users",
31287
- height: 300,
31288
- showGrid: true,
31289
- curve: "monotone",
31290
- tooltip: { show: true, style: "dark" },
31291
- dateRange: {
31292
- start: fromTimestamp.split("T")[0],
31293
- end: toTimestamp.split("T")[0]
31398
+ ...usersData && {
31399
+ view: {
31400
+ type: "chart",
31401
+ chart: {
31402
+ type: "line",
31403
+ title: "Total Users",
31404
+ data: this.transformTimeSeriesDataForMetric(usersData, "users"),
31405
+ dataKey: "users",
31406
+ color: "#4E5BA6",
31407
+ yAxisLabel: "Number of Users",
31408
+ height: 300,
31409
+ showGrid: true,
31410
+ curve: "monotone",
31411
+ tooltip: { show: true, style: "dark" },
31412
+ dateRange: {
31413
+ start: fromTimestamp.split("T")[0],
31414
+ end: toTimestamp.split("T")[0]
31415
+ }
31294
31416
  }
31295
31417
  }
31296
31418
  }
@@ -31306,22 +31428,24 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
31306
31428
  value: Math.abs(trends.sessions.changePercent),
31307
31429
  type: getChangeType(trends.sessions.changePercent)
31308
31430
  } : void 0,
31309
- view: {
31310
- type: "chart",
31311
- chart: {
31312
- type: "line",
31313
- title: "Total Sessions",
31314
- data: this.transformTimeSeriesDataForMetric(sessionsData, "sessions"),
31315
- dataKey: "sessions",
31316
- color: "#0BA5EC",
31317
- yAxisLabel: "Number of Sessions",
31318
- height: 300,
31319
- showGrid: true,
31320
- curve: "monotone",
31321
- tooltip: { show: true, style: "dark" },
31322
- dateRange: {
31323
- start: fromTimestamp.split("T")[0],
31324
- end: toTimestamp.split("T")[0]
31431
+ ...sessionsData && {
31432
+ view: {
31433
+ type: "chart",
31434
+ chart: {
31435
+ type: "line",
31436
+ title: "Total Sessions",
31437
+ data: this.transformTimeSeriesDataForMetric(sessionsData, "sessions"),
31438
+ dataKey: "sessions",
31439
+ color: "#0BA5EC",
31440
+ yAxisLabel: "Number of Sessions",
31441
+ height: 300,
31442
+ showGrid: true,
31443
+ curve: "monotone",
31444
+ tooltip: { show: true, style: "dark" },
31445
+ dateRange: {
31446
+ start: fromTimestamp.split("T")[0],
31447
+ end: toTimestamp.split("T")[0]
31448
+ }
31325
31449
  }
31326
31450
  }
31327
31451
  }
@@ -31337,22 +31461,24 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
31337
31461
  value: Math.abs(trends.messages.changePercent.total),
31338
31462
  type: getChangeType(trends.messages.changePercent.total)
31339
31463
  } : void 0,
31340
- view: {
31341
- type: "chart",
31342
- chart: {
31343
- type: "line",
31344
- title: "Total Messages",
31345
- data: this.transformTimeSeriesDataForMetric(messagesData, "messages"),
31346
- dataKey: "messages",
31347
- color: "#E478FA",
31348
- yAxisLabel: "Number of Messages",
31349
- height: 300,
31350
- showGrid: true,
31351
- curve: "monotone",
31352
- tooltip: { show: true, style: "dark" },
31353
- dateRange: {
31354
- start: fromTimestamp.split("T")[0],
31355
- end: toTimestamp.split("T")[0]
31464
+ ...messagesData && {
31465
+ view: {
31466
+ type: "chart",
31467
+ chart: {
31468
+ type: "line",
31469
+ title: "Total Messages",
31470
+ data: this.transformTimeSeriesDataForMetric(messagesData, "messages"),
31471
+ dataKey: "messages",
31472
+ color: "#E478FA",
31473
+ yAxisLabel: "Number of Messages",
31474
+ height: 300,
31475
+ showGrid: true,
31476
+ curve: "monotone",
31477
+ tooltip: { show: true, style: "dark" },
31478
+ dateRange: {
31479
+ start: fromTimestamp.split("T")[0],
31480
+ end: toTimestamp.split("T")[0]
31481
+ }
31356
31482
  }
31357
31483
  }
31358
31484
  }
@@ -31368,38 +31494,40 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
31368
31494
  value: Math.abs(trends.tokens.changePercent.total),
31369
31495
  type: getChangeType(trends.tokens.changePercent.total)
31370
31496
  } : void 0,
31371
- view: {
31372
- type: "chart",
31373
- chart: {
31374
- type: "line",
31375
- title: "Token Usage Breakdown",
31376
- data: this.transformTimeSeriesDataForMetric(tokensData, "tokens"),
31377
- yAxisLabel: "Number of Tokens",
31378
- lines: [
31379
- {
31380
- dataKey: "totalTokens",
31381
- color: "#FF692E",
31382
- label: "Total Tokens"
31383
- },
31384
- {
31385
- dataKey: "inputTokens",
31386
- color: "#5925DC",
31387
- label: "Input Tokens"
31388
- },
31389
- {
31390
- dataKey: "outputTokens",
31391
- color: "#E478FA",
31392
- label: "Output Tokens"
31497
+ ...tokensData && {
31498
+ view: {
31499
+ type: "chart",
31500
+ chart: {
31501
+ type: "line",
31502
+ title: "Token Usage Breakdown",
31503
+ data: this.transformTimeSeriesDataForMetric(tokensData, "tokens"),
31504
+ yAxisLabel: "Number of Tokens",
31505
+ lines: [
31506
+ {
31507
+ dataKey: "totalTokens",
31508
+ color: "#FF692E",
31509
+ label: "Total Tokens"
31510
+ },
31511
+ {
31512
+ dataKey: "inputTokens",
31513
+ color: "#5925DC",
31514
+ label: "Input Tokens"
31515
+ },
31516
+ {
31517
+ dataKey: "outputTokens",
31518
+ color: "#E478FA",
31519
+ label: "Output Tokens"
31520
+ }
31521
+ ],
31522
+ height: 300,
31523
+ showGrid: true,
31524
+ showLegend: true,
31525
+ curve: "monotone",
31526
+ tooltip: { show: true, style: "dark" },
31527
+ dateRange: {
31528
+ start: fromTimestamp.split("T")[0],
31529
+ end: toTimestamp.split("T")[0]
31393
31530
  }
31394
- ],
31395
- height: 300,
31396
- showGrid: true,
31397
- showLegend: true,
31398
- curve: "monotone",
31399
- tooltip: { show: true, style: "dark" },
31400
- dateRange: {
31401
- start: fromTimestamp.split("T")[0],
31402
- end: toTimestamp.split("T")[0]
31403
31531
  }
31404
31532
  }
31405
31533
  }
@@ -31427,35 +31555,27 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
31427
31555
  let workflowTools = 0;
31428
31556
  let knowledgeTools = 0;
31429
31557
  let mcpTools = 0;
31558
+ let processors = 0;
31430
31559
  if (point2.listView && Array.isArray(point2.listView)) {
31431
31560
  point2.listView.forEach((item) => {
31432
31561
  const count = item.count || 0;
31433
- const toolType = (item.toolType || item.tool_type || "").toLowerCase();
31434
- const toolName = (item.toolName || item.tool_name || "").toLowerCase();
31435
- console.log(`Processing listView item:`, { toolType, toolName, count });
31562
+ const toolType = item.toolType || item.tool_type || "";
31436
31563
  const normalizedToolType = toolType.toLowerCase();
31437
- if (["inlinetool", "inlineTool", "tool", "code", "codetool", "event", "EVENT"].includes(toolType) || ["inlinetool", "tool", "code", "codetool", "event"].includes(normalizedToolType)) {
31564
+ if (["inlinetool", "tool", "code", "codetool", "event"].includes(normalizedToolType)) {
31438
31565
  codeTools += count;
31439
- } else if (["toollibrary", "toolLibrary", "workflow", "tool"].includes(toolType) || ["toollibrary", "workflow", "tool"].includes(normalizedToolType)) {
31566
+ } else if (["toollibrary", "workflow"].includes(normalizedToolType)) {
31440
31567
  workflowTools += count;
31441
- } else if (["knowledge", "KNOWLEDGE", "knowledgetool"].includes(toolType) || ["knowledge", "knowledgetool"].includes(normalizedToolType)) {
31568
+ } else if (["knowledge", "knowledgetool"].includes(normalizedToolType) || toolType === "KNOWLEDGE") {
31442
31569
  knowledgeTools += count;
31443
- } else if (["mcp", "MCP", "mcptool", "mcpTool"].includes(toolType) || ["mcp", "mcptool"].includes(normalizedToolType)) {
31570
+ } else if (["mcp", "mcptool"].includes(normalizedToolType)) {
31444
31571
  mcpTools += count;
31572
+ } else if (["pre_processor", "post_processor", "processor", "input_processor"].includes(normalizedToolType) || toolType === "INPUT_PROCESSOR" || toolType === "input_processor") {
31573
+ processors += count;
31445
31574
  } else {
31446
- console.log(`Unknown tool type '${toolType}' for tool '${toolName}', defaulting to code tools`);
31447
31575
  codeTools += count;
31448
31576
  }
31449
31577
  });
31450
- console.log(`Calculated breakdown for point ${index}:`, {
31451
- codeTools,
31452
- workflowTools,
31453
- knowledgeTools,
31454
- mcpTools,
31455
- total: codeTools + workflowTools + knowledgeTools + mcpTools,
31456
- expectedTotal: totalToolRuns
31457
- });
31458
- const calculatedTotal = codeTools + workflowTools + knowledgeTools + mcpTools;
31578
+ const calculatedTotal = codeTools + workflowTools + knowledgeTools + mcpTools + processors;
31459
31579
  if (Math.abs(calculatedTotal - totalToolRuns) > 1) {
31460
31580
  console.warn(`Breakdown total (${calculatedTotal}) doesn't match expected total (${totalToolRuns}) for point ${index}`);
31461
31581
  const difference = totalToolRuns - calculatedTotal;
@@ -31463,7 +31583,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
31463
31583
  console.log(`Adjusted codeTools by ${difference} to balance total`);
31464
31584
  }
31465
31585
  } else {
31466
- console.log(`No listView data for point ${index}, assigning all ${totalToolRuns} to codeTools`);
31467
31586
  codeTools = totalToolRuns;
31468
31587
  }
31469
31588
  const basePoint = {
@@ -31474,11 +31593,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
31474
31593
  toolRuns: totalToolRuns,
31475
31594
  value: totalToolRuns,
31476
31595
  count: totalToolRuns,
31477
- // Tool breakdown data for multi-line chart (using actual data)
31478
31596
  codeTools,
31479
31597
  workflowTools,
31480
31598
  knowledgeTools,
31481
31599
  mcpTools,
31600
+ processors,
31482
31601
  // Token data
31483
31602
  input_tokens: point2.input_tokens || 0,
31484
31603
  output_tokens: point2.output_tokens || 0,
@@ -31516,14 +31635,33 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
31516
31635
  // Enhanced batch fetch method that returns complete MetricData with embedded view and controls
31517
31636
  async fetchAllCardsDataWithEnhancedViews(fromTimestamp, toTimestamp, timeDimension, filters = []) {
31518
31637
  try {
31519
- const [usageAnalyticsCards, runsCards] = await Promise.all([
31638
+ const cardsResults = await Promise.allSettled([
31520
31639
  this.fetchUsageAnalyticsCards(fromTimestamp, toTimestamp, timeDimension, filters),
31521
31640
  this.fetchRunsCards(fromTimestamp, toTimestamp, timeDimension, filters)
31522
31641
  ]);
31523
- const [enhancedUsageAnalytics, enhancedRuns] = await Promise.all([
31524
- this.transformUsageAnalyticsCardsWithEnhancedData(usageAnalyticsCards, fromTimestamp, toTimestamp, timeDimension, filters),
31525
- this.transformRunsCardsWithEnhancedData(runsCards, fromTimestamp, toTimestamp, timeDimension, filters)
31642
+ if (cardsResults[0].status === "rejected") {
31643
+ console.error("Error fetching usage analytics cards:", cardsResults[0].reason);
31644
+ }
31645
+ if (cardsResults[1].status === "rejected") {
31646
+ console.error("Error fetching runs cards:", cardsResults[1].reason);
31647
+ }
31648
+ if (cardsResults[0].status === "rejected" && cardsResults[1].status === "rejected") {
31649
+ throw new Error("Both usage analytics and runs cards failed to load");
31650
+ }
31651
+ const usageAnalyticsCards = cardsResults[0].status === "fulfilled" ? cardsResults[0].value : void 0;
31652
+ const runsCards = cardsResults[1].status === "fulfilled" ? cardsResults[1].value : void 0;
31653
+ const enhancementResults = await Promise.allSettled([
31654
+ usageAnalyticsCards ? this.transformUsageAnalyticsCardsWithEnhancedData(usageAnalyticsCards, fromTimestamp, toTimestamp, timeDimension, filters) : Promise.resolve([]),
31655
+ runsCards ? this.transformRunsCardsWithEnhancedData(runsCards, fromTimestamp, toTimestamp, timeDimension, filters) : Promise.resolve([])
31526
31656
  ]);
31657
+ if (enhancementResults[0].status === "rejected") {
31658
+ console.error("Error transforming usage analytics cards:", enhancementResults[0].reason);
31659
+ }
31660
+ if (enhancementResults[1].status === "rejected") {
31661
+ console.error("Error transforming runs cards:", enhancementResults[1].reason);
31662
+ }
31663
+ const enhancedUsageAnalytics = enhancementResults[0].status === "fulfilled" ? enhancementResults[0].value : [];
31664
+ const enhancedRuns = enhancementResults[1].status === "fulfilled" ? enhancementResults[1].value : [];
31527
31665
  return {
31528
31666
  usageAnalytics: enhancedUsageAnalytics,
31529
31667
  runs: enhancedRuns
@@ -31536,13 +31674,21 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
31536
31674
  // Batch fetch time series data for default selected metrics
31537
31675
  async fetchDefaultTimeSeriesData(fromTimestamp, toTimestamp, timeDimension, filters = []) {
31538
31676
  try {
31539
- const [sessionsData, agentRunsData] = await Promise.all([
31677
+ const results = await Promise.allSettled([
31540
31678
  this.fetchTimeSeriesData("sessions", "usage-analytics", fromTimestamp, toTimestamp, timeDimension, filters),
31541
31679
  this.fetchTimeSeriesData("agent-runs", "runs", fromTimestamp, toTimestamp, timeDimension, filters)
31542
31680
  ]);
31681
+ if (results[0].status === "rejected") {
31682
+ console.error("Error fetching sessions data:", results[0].reason);
31683
+ }
31684
+ if (results[1].status === "rejected") {
31685
+ console.error("Error fetching agent runs data:", results[1].reason);
31686
+ }
31687
+ const sessionsData = results[0].status === "fulfilled" ? results[0].value : void 0;
31688
+ const agentRunsData = results[1].status === "fulfilled" ? results[1].value : void 0;
31543
31689
  return {
31544
- sessions: this.transformTimeSeriesData(sessionsData),
31545
- agentRuns: this.transformTimeSeriesData(agentRunsData)
31690
+ sessions: sessionsData ? this.transformTimeSeriesData(sessionsData) : [],
31691
+ agentRuns: agentRunsData ? this.transformTimeSeriesData(agentRunsData) : []
31546
31692
  };
31547
31693
  } catch (error) {
31548
31694
  console.error("Error fetching default time series data:", error);
@@ -32269,6 +32415,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
32269
32415
  ] })
32270
32416
  ] });
32271
32417
  };
32418
+ function modelListViewRowLabel(listItem) {
32419
+ if (!listItem.modelName) return "";
32420
+ return listItem.connectionName ? `${listItem.modelName} - ${listItem.connectionName}` : listItem.modelName;
32421
+ }
32272
32422
  const DashboardSection = ({
32273
32423
  section,
32274
32424
  className,
@@ -32366,16 +32516,17 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
32366
32516
  });
32367
32517
  return baseData.map((item) => {
32368
32518
  let filteredValue = 0;
32519
+ let matchingItems = [];
32369
32520
  if (item["listView"] && Array.isArray(item["listView"])) {
32370
- const matchingItems = item["listView"].filter((listItem) => {
32521
+ matchingItems = item["listView"].filter((listItem) => {
32371
32522
  if (metricType === "agentRuns" && listItem.agentName) {
32372
32523
  return listItem.agentName === selectedLabel || listItem.agentName.toLowerCase() === (selectedLabel == null ? void 0 : selectedLabel.toLowerCase());
32373
32524
  }
32374
32525
  if (metricType === "toolRuns" && listItem.toolName) {
32375
32526
  return listItem.toolName === selectedLabel || listItem.toolName.toLowerCase() === (selectedLabel == null ? void 0 : selectedLabel.toLowerCase());
32376
32527
  }
32377
- if (metricType === "modelRuns" && listItem.modelName) {
32378
- return listItem.modelName === selectedLabel || listItem.modelName.toLowerCase() === (selectedLabel == null ? void 0 : selectedLabel.toLowerCase());
32528
+ if (metricType === "modelRuns" && listItem.modelName && selectedLabel) {
32529
+ return modelListViewRowLabel(listItem) === selectedLabel;
32379
32530
  }
32380
32531
  return false;
32381
32532
  });
@@ -32385,10 +32536,17 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
32385
32536
  );
32386
32537
  }
32387
32538
  console.log("📊 Filtered value for", selectedLabel, ":", filteredValue);
32539
+ const failedModelRunsSum = metricType === "modelRuns" ? matchingItems.reduce(
32540
+ (sum2, listItem) => sum2 + (Number(listItem.failedRuns) || 0),
32541
+ 0
32542
+ ) : 0;
32388
32543
  const result = {
32389
32544
  ...item,
32390
32545
  [metricType]: filteredValue
32391
32546
  };
32547
+ if (metricType === "modelRuns") {
32548
+ result.failedModelRuns = failedModelRunsSum;
32549
+ }
32392
32550
  return result;
32393
32551
  });
32394
32552
  }
@@ -32400,8 +32558,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
32400
32558
  const selectedLabels = selectedOptions.map((opt) => opt.label);
32401
32559
  return baseData.map((item) => {
32402
32560
  let aggregatedValue = 0;
32561
+ let matchingItems = [];
32403
32562
  if (item["listView"] && Array.isArray(item["listView"])) {
32404
- const matchingItems = item["listView"].filter((listItem) => {
32563
+ matchingItems = item["listView"].filter((listItem) => {
32405
32564
  if (metricType === "agentRuns" && listItem.agentName) {
32406
32565
  return selectedLabels.some(
32407
32566
  (label) => listItem.agentName === label || listItem.agentName.toLowerCase() === (label == null ? void 0 : label.toLowerCase())
@@ -32413,9 +32572,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
32413
32572
  );
32414
32573
  }
32415
32574
  if (metricType === "modelRuns" && listItem.modelName) {
32416
- return selectedLabels.some(
32417
- (label) => listItem.modelName === label || listItem.modelName.toLowerCase() === (label == null ? void 0 : label.toLowerCase())
32418
- );
32575
+ const rowLabel = modelListViewRowLabel(listItem);
32576
+ return selectedLabels.some((label) => rowLabel === label);
32419
32577
  }
32420
32578
  return false;
32421
32579
  });
@@ -32424,10 +32582,18 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
32424
32582
  0
32425
32583
  );
32426
32584
  }
32427
- return {
32585
+ const failedModelRunsMulti = metricType === "modelRuns" ? matchingItems.reduce(
32586
+ (sum2, listItem) => sum2 + (Number(listItem.failedRuns) || 0),
32587
+ 0
32588
+ ) : 0;
32589
+ const multiResult = {
32428
32590
  ...item,
32429
32591
  [metricType]: aggregatedValue
32430
32592
  };
32593
+ if (metricType === "modelRuns") {
32594
+ multiResult.failedModelRuns = failedModelRunsMulti;
32595
+ }
32596
+ return multiResult;
32431
32597
  });
32432
32598
  }
32433
32599
  return baseData;
@@ -32659,35 +32825,30 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
32659
32825
  data: filteredData,
32660
32826
  yAxisLabel: "Number of Tool Runs",
32661
32827
  lines: [
32662
- {
32663
- dataKey: "toolRuns",
32664
- color: "#06b6d4",
32665
- // Blue for Tool Runs
32666
- label: "Tool Runs"
32667
- },
32668
32828
  {
32669
32829
  dataKey: "codeTools",
32670
32830
  color: "#f97316",
32671
- // Orange for Code Tools
32672
32831
  label: "Code Tools"
32673
32832
  },
32674
32833
  {
32675
32834
  dataKey: "workflowTools",
32676
32835
  color: "#10b981",
32677
- // Green for Workflow Tools
32678
32836
  label: "Workflow Tools"
32679
32837
  },
32680
32838
  {
32681
32839
  dataKey: "knowledgeTools",
32682
32840
  color: "#8b5cf6",
32683
- // Purple for Knowledge
32684
32841
  label: "Knowledge"
32685
32842
  },
32686
32843
  {
32687
32844
  dataKey: "mcpTools",
32688
32845
  color: "#ef4444",
32689
- // Red for MCP Tools
32690
32846
  label: "MCP Tools"
32847
+ },
32848
+ {
32849
+ dataKey: "processors",
32850
+ color: "#eab308",
32851
+ label: "Processors"
32691
32852
  }
32692
32853
  ],
32693
32854
  height: 300,
@@ -32707,12 +32868,20 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
32707
32868
  type: "line",
32708
32869
  title: getChartTitle("Model Runs"),
32709
32870
  data: getFilteredData(baseData, "modelRuns"),
32710
- dataKey: "modelRuns",
32711
- color: "#10b981",
32712
- // Green as shown in Figma
32713
32871
  yAxisLabel: "Number of Model Runs",
32872
+ lines: [
32873
+ { dataKey: "modelRuns", color: "#10b981", label: "Model Runs" },
32874
+ {
32875
+ dataKey: "failedModelRuns",
32876
+ color: "#ef4444",
32877
+ label: "Failed",
32878
+ seriesType: "bar",
32879
+ hideInLegend: true
32880
+ }
32881
+ ],
32714
32882
  height: 300,
32715
32883
  showGrid: true,
32884
+ showLegend: true,
32716
32885
  curve: "monotone",
32717
32886
  tooltip: { show: true, style: "dark" },
32718
32887
  dateRange: {
@@ -32725,12 +32894,20 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
32725
32894
  type: "line",
32726
32895
  title: getChartTitle("Model Runs"),
32727
32896
  data: filteredData,
32728
- dataKey: "modelRuns",
32729
- color: "#10b981",
32730
- // Green as shown in Figma
32731
32897
  yAxisLabel: "Number of Model Runs",
32898
+ lines: [
32899
+ { dataKey: "modelRuns", color: "#10b981", label: "Model Runs" },
32900
+ {
32901
+ dataKey: "failedModelRuns",
32902
+ color: "#ef4444",
32903
+ label: "Failed",
32904
+ seriesType: "bar",
32905
+ hideInLegend: true
32906
+ }
32907
+ ],
32732
32908
  height: 300,
32733
32909
  showGrid: true,
32910
+ showLegend: true,
32734
32911
  curve: "monotone",
32735
32912
  tooltip: { show: true, style: "dark" },
32736
32913
  dateRange: {
@@ -34982,8 +35159,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
34982
35159
  if (appConfig) {
34983
35160
  try {
34984
35161
  apiServiceRef.current = new DashboardApiService(appConfig);
34985
- loadEnvironments();
34986
- loadInitialData();
35162
+ const initDashboard = async () => {
35163
+ await loadEnvironments();
35164
+ await loadInitialData();
35165
+ };
35166
+ initDashboard();
34987
35167
  } catch (err) {
34988
35168
  console.error("Failed to initialize API service:", err);
34989
35169
  }