@railtownai/railtracks-visualizer 0.0.49 → 0.0.50
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 +17967 -5939
- package/dist/esm/index.js +17972 -5951
- package/dist/types/agenthub/components/EvaluationsTable.d.ts +34 -0
- package/dist/types/agenthub/components/ToolUseEvaluatorMetricsTable.d.ts +17 -0
- package/dist/types/agenthub/context/EvaluationsMockProvider.d.ts +3 -31
- package/dist/types/agenthub/hooks/useEvaluations.d.ts +2 -2
- package/dist/types/agenthub/pages/evaluation-details-drawer.d.ts +10 -0
- package/dist/types/agenthub/pages/evaluations.d.ts +5 -1
- package/dist/types/agenthub/pages/evaluations.types.d.ts +26 -0
- package/dist/types/agenthub/pages/evaluator-result-page.d.ts +11 -0
- package/dist/types/agenthub/pages/evaluator-result.d.ts +15 -0
- package/dist/types/agenthub/pages/index.d.ts +2 -0
- package/dist/types/agenthub/utils/transformEvaluation.d.ts +9 -0
- package/dist/types/dto/Evaluation.d.ts +140 -0
- package/dist/types/dto/index.d.ts +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/lib/theme.d.ts +16 -0
- package/dist/types/lib/utils.d.ts +32 -0
- package/package.json +1 -1
- package/dist/types/agenthub/pages/evaluation-details.d.ts +0 -9
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* We can export this component to be used in other React projects. Just pass in the
|
|
3
|
+
* evaluations data and there we go!
|
|
4
|
+
*
|
|
5
|
+
* Accepts either raw DTO (API) data or pre-transformed data. DTO is auto-detected
|
|
6
|
+
* and transformed internally.
|
|
7
|
+
*
|
|
8
|
+
* Example (raw API/DTO):
|
|
9
|
+
* <EvaluationsTable evaluations={apiData} />
|
|
10
|
+
*
|
|
11
|
+
* Example (transformed):
|
|
12
|
+
* <EvaluationsTable evaluations={evaluations} onRowClick={handleRowClick} />
|
|
13
|
+
*
|
|
14
|
+
* Example:
|
|
15
|
+
* <EvaluationsTable evaluations={evaluations} onCompare={handleCompare} />
|
|
16
|
+
*/
|
|
17
|
+
import React from "react";
|
|
18
|
+
import type { Evaluation } from "../pages/evaluations.types";
|
|
19
|
+
import type { Evaluation as EvaluationDto } from "../../dto/Evaluation";
|
|
20
|
+
export interface EvaluationsTableProps {
|
|
21
|
+
/** Raw DTO (API) or pre-transformed evaluations. DTO is auto-detected and transformed. */
|
|
22
|
+
evaluations: (Evaluation | EvaluationDto)[];
|
|
23
|
+
loading?: boolean;
|
|
24
|
+
error?: string | null;
|
|
25
|
+
onRefresh?: () => void;
|
|
26
|
+
onRowClick?: (evaluation: Evaluation) => void;
|
|
27
|
+
onCompare?: (sourceId: string, targetId: string) => void;
|
|
28
|
+
showFilters?: boolean;
|
|
29
|
+
showCompare?: boolean;
|
|
30
|
+
emptyMessage?: React.ReactNode;
|
|
31
|
+
/** Optional title rendered to the left of the toolbar (e.g. "Evaluations") */
|
|
32
|
+
title?: React.ReactNode;
|
|
33
|
+
}
|
|
34
|
+
export declare const EvaluationsTable: React.FC<EvaluationsTableProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { EvaluationResultItem } from "../../dto/Evaluation";
|
|
3
|
+
export interface ToolUseTreeRow {
|
|
4
|
+
key: string;
|
|
5
|
+
name: string;
|
|
6
|
+
invocations?: number;
|
|
7
|
+
runtimeMs?: number;
|
|
8
|
+
failureRate?: string | "Success" | "Failed";
|
|
9
|
+
level: 1 | 2 | 3;
|
|
10
|
+
children?: ToolUseTreeRow[];
|
|
11
|
+
}
|
|
12
|
+
export interface ToolUseEvaluatorMetricsTableProps {
|
|
13
|
+
rawResults: EvaluationResultItem[];
|
|
14
|
+
/** Title shown above the table. When provided, an expand/collapse-all button is shown next to it. */
|
|
15
|
+
title?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const ToolUseEvaluatorMetricsTable: React.FC<ToolUseEvaluatorMetricsTableProps>;
|
|
@@ -1,39 +1,11 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
name: string;
|
|
4
|
-
evaluator_id: string;
|
|
5
|
-
config_hash: string;
|
|
6
|
-
results: Array<{
|
|
7
|
-
metric: {
|
|
8
|
-
name: string;
|
|
9
|
-
};
|
|
10
|
-
value: number;
|
|
11
|
-
}>;
|
|
12
|
-
agent_runs: Array<{
|
|
13
|
-
session_id: string;
|
|
14
|
-
run_id: string;
|
|
15
|
-
}>;
|
|
16
|
-
}
|
|
17
|
-
export interface ApiEvaluation {
|
|
18
|
-
evaluation_id: string;
|
|
19
|
-
evaluation_name: string;
|
|
20
|
-
agent_name: string;
|
|
21
|
-
created_at: string;
|
|
22
|
-
agent_run_ids: string[];
|
|
23
|
-
results: ApiEvaluatorResult[];
|
|
24
|
-
metrics: Array<{
|
|
25
|
-
name: string;
|
|
26
|
-
min_value?: number;
|
|
27
|
-
max_value?: number;
|
|
28
|
-
options?: string[];
|
|
29
|
-
}>;
|
|
30
|
-
}
|
|
2
|
+
import type { Evaluation } from "../../dto/Evaluation";
|
|
31
3
|
interface EvaluationsMockContextValue {
|
|
32
|
-
mockEvaluations:
|
|
4
|
+
mockEvaluations: Evaluation[] | null;
|
|
33
5
|
}
|
|
34
6
|
export interface EvaluationsMockProviderProps {
|
|
35
7
|
children: ReactNode;
|
|
36
|
-
mockEvaluations:
|
|
8
|
+
mockEvaluations: Evaluation[] | null;
|
|
37
9
|
}
|
|
38
10
|
export declare const EvaluationsMockProvider: React.FC<EvaluationsMockProviderProps>;
|
|
39
11
|
export declare const useEvaluationsMock: () => EvaluationsMockContextValue | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Evaluation } from "../pages/evaluations.types";
|
|
1
|
+
import type { Evaluation as EvaluationsPageEvaluation } from "../pages/evaluations.types";
|
|
2
2
|
export declare const useEvaluations: () => {
|
|
3
|
-
evaluations:
|
|
3
|
+
evaluations: EvaluationsPageEvaluation[];
|
|
4
4
|
loading: boolean;
|
|
5
5
|
error: string | null;
|
|
6
6
|
refetch: () => Promise<void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Evaluation } from "./evaluations.types";
|
|
3
|
+
interface EvaluationDetailsDrawerProps {
|
|
4
|
+
evaluation: Evaluation | null;
|
|
5
|
+
open: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
getEvaluatorResultsHref?: (evaluationId: string, evaluatorId: string) => string;
|
|
8
|
+
}
|
|
9
|
+
export declare const EvaluationDetailsDrawer: React.FC<EvaluationDetailsDrawerProps>;
|
|
10
|
+
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { EvaluationResultItem } from "../../dto/Evaluation";
|
|
1
2
|
export type MetricType = "Categorical" | "Continuous";
|
|
2
3
|
export interface CategoricalMetric {
|
|
3
4
|
name: string;
|
|
4
5
|
sha: string;
|
|
5
6
|
type: "Categorical";
|
|
6
7
|
options: string[];
|
|
8
|
+
description?: string | null;
|
|
7
9
|
}
|
|
8
10
|
export interface ContinuousMetric {
|
|
9
11
|
name: string;
|
|
@@ -11,6 +13,7 @@ export interface ContinuousMetric {
|
|
|
11
13
|
type: "Continuous";
|
|
12
14
|
min_value: number;
|
|
13
15
|
max_value: number;
|
|
16
|
+
description?: string | null;
|
|
14
17
|
}
|
|
15
18
|
export type Metric = CategoricalMetric | ContinuousMetric;
|
|
16
19
|
export interface Evaluator {
|
|
@@ -24,12 +27,35 @@ export interface EvaluationRun {
|
|
|
24
27
|
run_id: string;
|
|
25
28
|
results: Record<string, Record<string, number>>;
|
|
26
29
|
}
|
|
30
|
+
/** Detailed stats for a single metric (e.g. Latency/dice_roll) */
|
|
31
|
+
export interface DetailedMetricStat {
|
|
32
|
+
metricLabel: string;
|
|
33
|
+
mean: number;
|
|
34
|
+
median: number;
|
|
35
|
+
minimum: number;
|
|
36
|
+
maximum: number;
|
|
37
|
+
std: number;
|
|
38
|
+
}
|
|
27
39
|
export interface Evaluation {
|
|
28
40
|
evaluation_id: string;
|
|
29
41
|
evaluators: Evaluator[];
|
|
30
42
|
name: string;
|
|
31
43
|
runs: EvaluationRun[];
|
|
32
44
|
results: Record<string, Record<string, number>>;
|
|
45
|
+
/** Per-evaluator detailed stats (mean, median, min, max, std) for each metric */
|
|
46
|
+
detailedStats?: Record<string, DetailedMetricStat[]>;
|
|
47
|
+
/** Per-evaluator status (evaluator_id -> status) */
|
|
48
|
+
evaluatorStatuses?: Record<string, string>;
|
|
49
|
+
/** Per-evaluator raw results from DTO (for ToolUseEvaluator tree table) */
|
|
50
|
+
rawEvaluatorResults?: Record<string, EvaluationResultItem[]>;
|
|
51
|
+
/** Display name(s) - comma-separated when multiple agents */
|
|
33
52
|
agent_name: string;
|
|
53
|
+
/** Agents in the evaluation (name per agent) */
|
|
54
|
+
agents: {
|
|
55
|
+
agent_name: string;
|
|
56
|
+
}[];
|
|
57
|
+
/** Number of agents in the evaluation */
|
|
58
|
+
agents_count: number;
|
|
34
59
|
created_at: string;
|
|
60
|
+
completed_at?: string;
|
|
35
61
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface EvaluatorResultPageProps {
|
|
3
|
+
/** Optional href for back link. Pass from the host app (e.g. "#/evaluations" for HashRouter). */
|
|
4
|
+
backHref?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Page that resolves evaluationId and evaluatorId from the route,
|
|
8
|
+
* fetches evaluation data, and renders EvaluatorResult.
|
|
9
|
+
* backHref should be passed from the outer/host app for portability.
|
|
10
|
+
*/
|
|
11
|
+
export declare const EvaluatorResultPage: React.FC<EvaluatorResultPageProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Evaluation } from "./evaluations.types";
|
|
3
|
+
export interface EvaluatorResultProps {
|
|
4
|
+
/** Full evaluation. Pass null to show empty/loading state. */
|
|
5
|
+
evaluation: Evaluation | null;
|
|
6
|
+
/** Evaluator ID to show results for. */
|
|
7
|
+
evaluatorId: string;
|
|
8
|
+
/** Optional href for back link. When provided, a "Back to Evaluations" control is shown. */
|
|
9
|
+
backHref?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Full-page component that renders a single evaluator's result.
|
|
13
|
+
* Exportable and reusable: pass Evaluation and evaluatorId from any React app.
|
|
14
|
+
*/
|
|
15
|
+
export declare const EvaluatorResult: React.FC<EvaluatorResultProps>;
|
|
@@ -2,4 +2,6 @@ export { VisualizerPage } from "./visualizer";
|
|
|
2
2
|
export { SessionsPage } from "./sessions";
|
|
3
3
|
export { EvaluationsPage } from "./evaluations";
|
|
4
4
|
export { EvaluationsComparePage } from "./evaluations-compare";
|
|
5
|
+
export { EvaluatorResult } from "./evaluator-result";
|
|
6
|
+
export { EvaluatorResultPage } from "./evaluator-result-page";
|
|
5
7
|
export { SessionDetails } from "./session-details";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Evaluation as EvaluationsPageEvaluation } from "../pages/evaluations.types";
|
|
2
|
+
import type { Evaluation as EvaluationDto } from "../../dto/Evaluation";
|
|
3
|
+
/**
|
|
4
|
+
* Transform Evaluation DTO to evaluations page Evaluation type.
|
|
5
|
+
* Use when passing raw API/JSON data to EvaluationsTable or when building a data hook.
|
|
6
|
+
*/
|
|
7
|
+
export declare function transformEvaluation(evalDto: EvaluationDto): EvaluationsPageEvaluation;
|
|
8
|
+
/** Type guard: true if the value is an Evaluation DTO (raw API shape) rather than transformed. */
|
|
9
|
+
export declare function isEvaluationDto(x: EvaluationsPageEvaluation | EvaluationDto): x is EvaluationDto;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DTOs for evaluation data from .railtracks/data/evaluations/*.json
|
|
3
|
+
*/
|
|
4
|
+
/** Numeric metric definition (LLMMetric or ToolMetric) */
|
|
5
|
+
export type EvaluationNumericMetricDefinition = {
|
|
6
|
+
name: string;
|
|
7
|
+
metric_type: "LLMMetric" | "ToolMetric";
|
|
8
|
+
identifier: string;
|
|
9
|
+
description: string | null;
|
|
10
|
+
min_value: number | null;
|
|
11
|
+
max_value: number | null;
|
|
12
|
+
};
|
|
13
|
+
/** Categorical metric definition */
|
|
14
|
+
export type EvaluationCategoricalMetricDefinition = {
|
|
15
|
+
name: string;
|
|
16
|
+
metric_type: "Categorical";
|
|
17
|
+
identifier: string;
|
|
18
|
+
description: string | null;
|
|
19
|
+
categories: string[];
|
|
20
|
+
};
|
|
21
|
+
/** Metric definition in the evaluation's metrics_map */
|
|
22
|
+
export type EvaluationMetricDefinition = EvaluationNumericMetricDefinition | EvaluationCategoricalMetricDefinition;
|
|
23
|
+
/** LLM result (per-call metric value) */
|
|
24
|
+
export type EvaluationLLMResult = {
|
|
25
|
+
type: "LLM";
|
|
26
|
+
result_name: string;
|
|
27
|
+
metric_id: string;
|
|
28
|
+
agent_data_id: string[];
|
|
29
|
+
value: number;
|
|
30
|
+
llm_call_index: number;
|
|
31
|
+
model_name: string;
|
|
32
|
+
model_provider: string;
|
|
33
|
+
};
|
|
34
|
+
/** Tool result (per-tool-call metric value) */
|
|
35
|
+
export type EvaluationToolResult = {
|
|
36
|
+
type: "Tool";
|
|
37
|
+
result_name: string;
|
|
38
|
+
metric_id: string;
|
|
39
|
+
agent_data_id: string[];
|
|
40
|
+
value: number;
|
|
41
|
+
tool_name: string;
|
|
42
|
+
tool_node_id: string | null;
|
|
43
|
+
};
|
|
44
|
+
/** Base result (e.g. JudgeResult, JudgeReasoning - value can be string for categorical) */
|
|
45
|
+
export type EvaluationBaseResult = {
|
|
46
|
+
type: "Base";
|
|
47
|
+
result_name: string;
|
|
48
|
+
metric_id: string;
|
|
49
|
+
agent_data_id: string[];
|
|
50
|
+
value: number | string;
|
|
51
|
+
};
|
|
52
|
+
/** Metric reference used in aggregated stats */
|
|
53
|
+
export type EvaluationMetricReference = {
|
|
54
|
+
name: string;
|
|
55
|
+
identifier: string;
|
|
56
|
+
min_value?: number;
|
|
57
|
+
max_value?: number | null;
|
|
58
|
+
metric_type?: "LLMMetric" | "ToolMetric" | "Categorical";
|
|
59
|
+
description?: string | null;
|
|
60
|
+
categories?: string[];
|
|
61
|
+
};
|
|
62
|
+
/** LLM inference aggregate (mean/median/etc per llm_call_index) */
|
|
63
|
+
export type EvaluationLLMInferenceAggregate = {
|
|
64
|
+
type: "LLMInferenceAggregate";
|
|
65
|
+
metric: EvaluationMetricReference;
|
|
66
|
+
values: number[];
|
|
67
|
+
mean: number;
|
|
68
|
+
minimum: number;
|
|
69
|
+
maximum: number;
|
|
70
|
+
median: number;
|
|
71
|
+
std: number;
|
|
72
|
+
mode: number;
|
|
73
|
+
llm_call_index: number;
|
|
74
|
+
model_name: string;
|
|
75
|
+
model_provider: string;
|
|
76
|
+
};
|
|
77
|
+
/** Tool aggregate (mean/median/etc per tool) */
|
|
78
|
+
export type EvaluationToolAggregate = {
|
|
79
|
+
type: "ToolAggregate";
|
|
80
|
+
metric: EvaluationMetricReference;
|
|
81
|
+
values: number[];
|
|
82
|
+
mean: number;
|
|
83
|
+
minimum: number;
|
|
84
|
+
maximum: number;
|
|
85
|
+
median: number;
|
|
86
|
+
std: number;
|
|
87
|
+
mode: number;
|
|
88
|
+
tool_name: string;
|
|
89
|
+
};
|
|
90
|
+
/** Categorical aggregate (counts and labels) */
|
|
91
|
+
export type EvaluationAggregateCategorical = {
|
|
92
|
+
type: "AggregateCategorical";
|
|
93
|
+
metric: EvaluationMetricReference & {
|
|
94
|
+
metric_type: "Categorical";
|
|
95
|
+
categories: string[];
|
|
96
|
+
};
|
|
97
|
+
labels: string[];
|
|
98
|
+
most_common_label: string;
|
|
99
|
+
least_common_label: string;
|
|
100
|
+
counts: Record<string, number>;
|
|
101
|
+
};
|
|
102
|
+
/** Union of possible items in evaluator results array */
|
|
103
|
+
export type EvaluationResultItem = EvaluationLLMResult | EvaluationToolResult | EvaluationBaseResult | EvaluationLLMInferenceAggregate | EvaluationToolAggregate | EvaluationAggregateCategorical;
|
|
104
|
+
/** Type guard for LLM result */
|
|
105
|
+
export declare function isLLMResult(item: EvaluationResultItem): item is EvaluationLLMResult;
|
|
106
|
+
/** Type guard for Tool result */
|
|
107
|
+
export declare function isToolResult(item: EvaluationResultItem): item is EvaluationToolResult;
|
|
108
|
+
/** Type guard for Base result */
|
|
109
|
+
export declare function isBaseResult(item: EvaluationResultItem): item is EvaluationBaseResult;
|
|
110
|
+
/** Type guard for LLM inference aggregate */
|
|
111
|
+
export declare function isLLMInferenceAggregate(item: EvaluationResultItem): item is EvaluationLLMInferenceAggregate;
|
|
112
|
+
/** Type guard for Tool aggregate */
|
|
113
|
+
export declare function isToolAggregate(item: EvaluationResultItem): item is EvaluationToolAggregate;
|
|
114
|
+
/** Type guard for AggregateCategorical */
|
|
115
|
+
export declare function isAggregateCategorical(item: EvaluationResultItem): item is EvaluationAggregateCategorical;
|
|
116
|
+
/** Type guard for aggregated stats (numeric - LLMInferenceAggregate or ToolAggregate) */
|
|
117
|
+
export declare function isAggregatedStats(item: EvaluationResultItem): item is EvaluationLLMInferenceAggregate | EvaluationToolAggregate;
|
|
118
|
+
/** Result set from a single evaluator. Array of these in evaluator_results. */
|
|
119
|
+
export type EvaluationEvaluatorResult = {
|
|
120
|
+
evaluator_name: string;
|
|
121
|
+
evaluator_id: string;
|
|
122
|
+
status?: string;
|
|
123
|
+
results: EvaluationResultItem[];
|
|
124
|
+
};
|
|
125
|
+
/** Agent entry in the evaluation (each has name and associated data IDs) */
|
|
126
|
+
export type EvaluationAgent = {
|
|
127
|
+
agent_name: string;
|
|
128
|
+
agent_data_ids: string[];
|
|
129
|
+
};
|
|
130
|
+
/** Root evaluation document */
|
|
131
|
+
export type Evaluation = {
|
|
132
|
+
evaluation_id: string;
|
|
133
|
+
evaluation_name: string;
|
|
134
|
+
created_at: string;
|
|
135
|
+
completed_at?: string;
|
|
136
|
+
agents: EvaluationAgent[];
|
|
137
|
+
metrics_map: Record<string, EvaluationMetricDefinition>;
|
|
138
|
+
/** Array of evaluator results. One evaluation can have multiple evaluator results. */
|
|
139
|
+
evaluator_results: EvaluationEvaluatorResult[];
|
|
140
|
+
};
|
|
@@ -7,3 +7,4 @@ import { AgentRunStamp } from "./AgentRunStamp";
|
|
|
7
7
|
import { AgentRunStep } from "./AgentRunStep";
|
|
8
8
|
import { AgentSession } from "./AgentSession";
|
|
9
9
|
export type { AgentRun, AgentSession, AgentRunNode, AgentRunEdge, AgentRunEdgeDetails, AgentRunEdgeStamp, AgentRunStamp, AgentRunStep };
|
|
10
|
+
export { type Evaluation, type EvaluationMetricDefinition, type EvaluationNumericMetricDefinition, type EvaluationCategoricalMetricDefinition, type EvaluationLLMResult, type EvaluationToolResult, type EvaluationBaseResult, type EvaluationMetricReference, type EvaluationLLMInferenceAggregate, type EvaluationToolAggregate, type EvaluationAggregateCategorical, type EvaluationResultItem, type EvaluationEvaluatorResult, isLLMResult, isToolResult, isBaseResult, isLLMInferenceAggregate, isToolAggregate, isAggregateCategorical, isAggregatedStats } from "./Evaluation";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export { default as AgenticFlowVisualizer } from "./components/AgenticFlowVisualizer";
|
|
2
2
|
export { default as Visualizer } from "./components/Visualizer";
|
|
3
3
|
export { SessionDetails } from "./agenthub/pages/session-details";
|
|
4
|
+
export { EvaluationsTable } from "./agenthub/components/EvaluationsTable";
|
|
5
|
+
export { transformEvaluation, isEvaluationDto } from "./agenthub/utils/transformEvaluation";
|
|
6
|
+
export type { Evaluation } from "./agenthub/pages/evaluations.types";
|
|
7
|
+
export type { Evaluation as EvaluationDto } from "./dto/Evaluation";
|
|
4
8
|
export { Node } from "./components/Node";
|
|
5
9
|
export { Edge } from "./components/Edge";
|
|
6
10
|
export { Timeline } from "./components/Timeline";
|
|
@@ -22,6 +22,22 @@ export interface Theme {
|
|
|
22
22
|
mutedBorder: string;
|
|
23
23
|
input: string;
|
|
24
24
|
ring: string;
|
|
25
|
+
/** Evaluator metric tag variants (tooluse=blue, llminference=purple, judge=red) */
|
|
26
|
+
tagTooluse?: {
|
|
27
|
+
bg: string;
|
|
28
|
+
border: string;
|
|
29
|
+
color: string;
|
|
30
|
+
};
|
|
31
|
+
tagLlminference?: {
|
|
32
|
+
bg: string;
|
|
33
|
+
border: string;
|
|
34
|
+
color: string;
|
|
35
|
+
};
|
|
36
|
+
tagJudge?: {
|
|
37
|
+
bg: string;
|
|
38
|
+
border: string;
|
|
39
|
+
color: string;
|
|
40
|
+
};
|
|
25
41
|
};
|
|
26
42
|
spacing: {
|
|
27
43
|
xs: string;
|
|
@@ -25,6 +25,17 @@ export declare function formatNumberWithCommas(value: number | null | undefined)
|
|
|
25
25
|
* @returns The formatted latency string
|
|
26
26
|
*/
|
|
27
27
|
export declare function formatLatency(latency: number): string;
|
|
28
|
+
/**
|
|
29
|
+
* Formats duration between two timestamps as compact string (e.g. "2m 4s", "1h 5m 30s")
|
|
30
|
+
* @param createdAt - Start timestamp (ISO string)
|
|
31
|
+
* @param completedAt - End timestamp (ISO string, optional)
|
|
32
|
+
* @returns Formatted duration or "-" if incomplete
|
|
33
|
+
*/
|
|
34
|
+
export declare function formatDuration(createdAt: string, completedAt?: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* Formats an ISO date string to a short locale string (e.g. "Jan 15, 3:45 PM PST")
|
|
37
|
+
*/
|
|
38
|
+
export declare function formatDateShort(iso: string): string;
|
|
28
39
|
/**
|
|
29
40
|
* Truncates text to a specified length
|
|
30
41
|
* @param text - The text to truncate
|
|
@@ -91,6 +102,27 @@ export declare const detectContentType: (output: {
|
|
|
91
102
|
role: string;
|
|
92
103
|
content: any;
|
|
93
104
|
}) => "string" | "toolResponse" | "toolCallList" | "other";
|
|
105
|
+
/**
|
|
106
|
+
* Minimal evaluator shape for formatMetricValue (avoids coupling to agenthub types)
|
|
107
|
+
*/
|
|
108
|
+
export interface EvaluatorMetricInfo {
|
|
109
|
+
metrics: Array<{
|
|
110
|
+
name: string;
|
|
111
|
+
type: string;
|
|
112
|
+
options?: string[];
|
|
113
|
+
}>;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Formats a metric value for display based on evaluator metric definitions.
|
|
117
|
+
* Handles Categorical (index → option label), Continuous (decimal), and fallback.
|
|
118
|
+
*/
|
|
119
|
+
export declare function formatMetricValue(evaluator: EvaluatorMetricInfo | null | undefined, metricName: string, value: number | undefined): string;
|
|
120
|
+
/**
|
|
121
|
+
* Maps a status string to an Ant Design Tag color
|
|
122
|
+
* @param status - The status string (e.g., completed, failed, running)
|
|
123
|
+
* @returns The Ant Design color name for Tag component
|
|
124
|
+
*/
|
|
125
|
+
export declare function getStatusColor(status: string): string;
|
|
94
126
|
/**
|
|
95
127
|
* Formats tool calls for display in a code block
|
|
96
128
|
*/
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { Evaluation } from "./evaluations.types";
|
|
3
|
-
interface EvaluationDetailsProps {
|
|
4
|
-
evaluation: Evaluation | null;
|
|
5
|
-
open: boolean;
|
|
6
|
-
onClose: () => void;
|
|
7
|
-
}
|
|
8
|
-
export declare const EvaluationDetails: React.FC<EvaluationDetailsProps>;
|
|
9
|
-
export {};
|