agentic-ui-libs 1.0.0-beta.9 → 1.1.0-beta.-1.0
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/assets/agentic-ui-libs.css +12431 -0
- package/dist/features/debug-logs/components/DebugCard.d.ts.map +1 -1
- package/dist/features/debug-logs/index.d.ts +2 -1
- package/dist/features/debug-logs/index.d.ts.map +1 -1
- package/dist/features/md-editor/MDEditor.d.ts.map +1 -1
- package/dist/features/md-editor/components/AIRefinePanel.d.ts.map +1 -1
- package/dist/features/md-editor/components/SlashMenu.d.ts.map +1 -1
- package/dist/features/md-editor/utils/markdown.d.ts.map +1 -1
- package/dist/features/tracing/components/GenerationsList.d.ts +13 -0
- package/dist/features/tracing/components/GenerationsList.d.ts.map +1 -0
- package/dist/features/tracing/components/SessionsList.d.ts +12 -0
- package/dist/features/tracing/components/SessionsList.d.ts.map +1 -0
- package/dist/features/tracing/components/TracesList.d.ts +12 -0
- package/dist/features/tracing/components/TracesList.d.ts.map +1 -0
- package/dist/features/tracing/components/detail/DetailPage.d.ts +15 -0
- package/dist/features/tracing/components/detail/DetailPage.d.ts.map +1 -0
- package/dist/features/tracing/components/detail/NodeDetailPanel.d.ts +13 -0
- package/dist/features/tracing/components/detail/NodeDetailPanel.d.ts.map +1 -0
- package/dist/features/tracing/components/detail/ObservationNode.d.ts +9 -0
- package/dist/features/tracing/components/detail/ObservationNode.d.ts.map +1 -0
- package/dist/features/tracing/components/detail/TraceTree.d.ts +9 -0
- package/dist/features/tracing/components/detail/TraceTree.d.ts.map +1 -0
- package/dist/features/tracing/components/detail/config/index.d.ts +5 -0
- package/dist/features/tracing/components/detail/config/index.d.ts.map +1 -0
- package/dist/features/tracing/components/detail/config/observationFilterConfig.d.ts +41 -0
- package/dist/features/tracing/components/detail/config/observationFilterConfig.d.ts.map +1 -0
- package/dist/features/tracing/components/detail/index.d.ts +14 -0
- package/dist/features/tracing/components/detail/index.d.ts.map +1 -0
- package/dist/features/tracing/components/detail/services/DetailPageService.d.ts +119 -0
- package/dist/features/tracing/components/detail/services/DetailPageService.d.ts.map +1 -0
- package/dist/features/tracing/components/detail/services/index.d.ts +5 -0
- package/dist/features/tracing/components/detail/services/index.d.ts.map +1 -0
- package/dist/features/tracing/components/detail/types.d.ts +216 -0
- package/dist/features/tracing/components/detail/types.d.ts.map +1 -0
- package/dist/features/tracing/components/shared/ColumnCustomization.d.ts +14 -0
- package/dist/features/tracing/components/shared/ColumnCustomization.d.ts.map +1 -0
- package/dist/features/tracing/components/shared/EmptyState.d.ts +15 -0
- package/dist/features/tracing/components/shared/EmptyState.d.ts.map +1 -0
- package/dist/features/tracing/components/shared/FilterPanel.d.ts +13 -0
- package/dist/features/tracing/components/shared/FilterPanel.d.ts.map +1 -0
- package/dist/features/tracing/components/shared/LoadingSpinner.d.ts +11 -0
- package/dist/features/tracing/components/shared/LoadingSpinner.d.ts.map +1 -0
- package/dist/features/tracing/components/shared/TokenBreakdownTooltip.d.ts +18 -0
- package/dist/features/tracing/components/shared/TokenBreakdownTooltip.d.ts.map +1 -0
- package/dist/features/tracing/components/shared/TracingListHeader.d.ts +32 -0
- package/dist/features/tracing/components/shared/TracingListHeader.d.ts.map +1 -0
- package/dist/features/tracing/components/shared/TracingTable.d.ts +9 -0
- package/dist/features/tracing/components/shared/TracingTable.d.ts.map +1 -0
- package/dist/features/tracing/components/shared/index.d.ts +14 -0
- package/dist/features/tracing/components/shared/index.d.ts.map +1 -0
- package/dist/features/tracing/components/shared/skeletons/NodeDetailSkeleton.d.ts +12 -0
- package/dist/features/tracing/components/shared/skeletons/NodeDetailSkeleton.d.ts.map +1 -0
- package/dist/features/tracing/components/shared/skeletons/TableSkeleton.d.ts +13 -0
- package/dist/features/tracing/components/shared/skeletons/TableSkeleton.d.ts.map +1 -0
- package/dist/features/tracing/components/shared/skeletons/TreeSkeleton.d.ts +24 -0
- package/dist/features/tracing/components/shared/skeletons/TreeSkeleton.d.ts.map +1 -0
- package/dist/features/tracing/components/shared/skeletons/index.d.ts +8 -0
- package/dist/features/tracing/components/shared/skeletons/index.d.ts.map +1 -0
- package/dist/features/tracing/contexts/EnvironmentContext.d.ts +50 -0
- package/dist/features/tracing/contexts/EnvironmentContext.d.ts.map +1 -0
- package/dist/features/tracing/contexts/index.d.ts +6 -0
- package/dist/features/tracing/contexts/index.d.ts.map +1 -0
- package/dist/features/tracing/index.d.ts +22 -0
- package/dist/features/tracing/index.d.ts.map +1 -0
- package/dist/features/tracing/mocks/index.d.ts +6 -0
- package/dist/features/tracing/mocks/index.d.ts.map +1 -0
- package/dist/features/tracing/mocks/mockData.d.ts +12 -0
- package/dist/features/tracing/mocks/mockData.d.ts.map +1 -0
- package/dist/features/tracing/services/ObservationTreeBuilder.d.ts +51 -0
- package/dist/features/tracing/services/ObservationTreeBuilder.d.ts.map +1 -0
- package/dist/features/tracing/services/TraceTreeService.d.ts +105 -0
- package/dist/features/tracing/services/TraceTreeService.d.ts.map +1 -0
- package/dist/features/tracing/services/TracingApiService.d.ts +139 -0
- package/dist/features/tracing/services/TracingApiService.d.ts.map +1 -0
- package/dist/features/tracing/services/TracingUtils.d.ts +164 -0
- package/dist/features/tracing/services/TracingUtils.d.ts.map +1 -0
- package/dist/features/tracing/services/index.d.ts +10 -0
- package/dist/features/tracing/services/index.d.ts.map +1 -0
- package/dist/features/tracing/types.d.ts +545 -0
- package/dist/features/tracing/types.d.ts.map +1 -0
- package/dist/features/tracing/utils/index.d.ts +7 -0
- package/dist/features/tracing/utils/index.d.ts.map +1 -0
- package/dist/features/tracing/utils/observationIconUtils.d.ts +19 -0
- package/dist/features/tracing/utils/observationIconUtils.d.ts.map +1 -0
- package/dist/features/tracing/utils/staticApidata.d.ts +1 -0
- package/dist/features/tracing/utils/staticApidata.d.ts.map +1 -0
- package/dist/index.angular.d.ts +32 -0
- package/dist/index.angular.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +79899 -7309
- package/dist/shared/ui/CodeEditor.d.ts +15 -0
- package/dist/shared/ui/CodeEditor.d.ts.map +1 -1
- package/dist/shared/ui/DataViewer.d.ts +30 -0
- package/dist/shared/ui/DataViewer.d.ts.map +1 -0
- package/dist/shared/ui/IconPreview.d.ts.map +1 -1
- package/dist/shared/ui/Modal.d.ts +16 -0
- package/dist/shared/ui/Modal.d.ts.map +1 -0
- package/dist/shared/ui/Select.d.ts +2 -0
- package/dist/shared/ui/Select.d.ts.map +1 -1
- package/dist/shared/ui/daterangepicker.d.ts +4 -2
- package/dist/shared/ui/daterangepicker.d.ts.map +1 -1
- package/dist/shared/ui/index.d.ts +4 -0
- package/dist/shared/ui/index.d.ts.map +1 -1
- package/dist/ui-libs.umd.js +80065 -7475
- package/package.json +33 -21
- package/dist/assets/style.css +0 -4170
- package/dist/features/debug-logs/components/DataViewer.d.ts +0 -18
- package/dist/features/debug-logs/components/DataViewer.d.ts.map +0 -1
- package/dist/features/prompt-editor/PromptEditor.d.ts +0 -14
- package/dist/features/prompt-editor/PromptEditor.d.ts.map +0 -1
- package/dist/features/prompt-editor/RefinePanel.d.ts +0 -41
- package/dist/features/prompt-editor/RefinePanel.d.ts.map +0 -1
- package/dist/features/prompt-editor/components/AddToolbar.d.ts +0 -8
- package/dist/features/prompt-editor/components/AddToolbar.d.ts.map +0 -1
- package/dist/features/prompt-editor/components/ChatMessage.d.ts +0 -13
- package/dist/features/prompt-editor/components/ChatMessage.d.ts.map +0 -1
- package/dist/features/prompt-editor/components/CodeEditor.d.ts +0 -8
- package/dist/features/prompt-editor/components/CodeEditor.d.ts.map +0 -1
- package/dist/features/prompt-editor/components/ContentBlock.d.ts +0 -23
- package/dist/features/prompt-editor/components/ContentBlock.d.ts.map +0 -1
- package/dist/features/prompt-editor/components/EditableContent.d.ts +0 -16
- package/dist/features/prompt-editor/components/EditableContent.d.ts.map +0 -1
- package/dist/features/prompt-editor/components/FormattingToolbar.d.ts +0 -10
- package/dist/features/prompt-editor/components/FormattingToolbar.d.ts.map +0 -1
- package/dist/features/prompt-editor/components/Header.d.ts +0 -2
- package/dist/features/prompt-editor/components/Header.d.ts.map +0 -1
- package/dist/features/prompt-editor/components/InsertMenu.d.ts +0 -14
- package/dist/features/prompt-editor/components/InsertMenu.d.ts.map +0 -1
- package/dist/features/prompt-editor/components/RefineDropdown.d.ts +0 -14
- package/dist/features/prompt-editor/components/RefineDropdown.d.ts.map +0 -1
- package/dist/features/prompt-editor/components/Section.d.ts +0 -27
- package/dist/features/prompt-editor/components/Section.d.ts.map +0 -1
- package/dist/features/prompt-editor/components/SectionHeader.d.ts +0 -15
- package/dist/features/prompt-editor/components/SectionHeader.d.ts.map +0 -1
- package/dist/features/prompt-editor/components/icons.d.ts +0 -16
- package/dist/features/prompt-editor/components/icons.d.ts.map +0 -1
- package/dist/features/prompt-editor/data/insertableItems.d.ts +0 -17
- package/dist/features/prompt-editor/data/insertableItems.d.ts.map +0 -1
- package/dist/features/prompt-editor/index.d.ts +0 -19
- package/dist/features/prompt-editor/index.d.ts.map +0 -1
- package/dist/features/prompt-editor/services/EditorUtils.d.ts +0 -48
- package/dist/features/prompt-editor/services/EditorUtils.d.ts.map +0 -1
- package/dist/features/prompt-editor/services/PromptApiService.d.ts +0 -22
- package/dist/features/prompt-editor/services/PromptApiService.d.ts.map +0 -1
- package/dist/features/prompt-editor/types.d.ts +0 -102
- package/dist/features/prompt-editor/types.d.ts.map +0 -1
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tracing API Service
|
|
3
|
+
* Handles all API calls to Langfuse TRPC endpoints for sessions and traces
|
|
4
|
+
*/
|
|
5
|
+
import { TracingApiConfig, SessionsAllRequest, SessionsAllResponse, SessionsCountResponse, SessionMetricsResponse, SessionByIdRequest, SessionByIdResponse, TracesAllRequest, TracesAllResponse, TracesMetricsRequest, TracesMetricsResponse, TraceByIdRequest, TraceByIdResponse, FilterOptionsRequest, FilterOptionsResponse, ScoreKeysRequest, ScoreKeysResponse, Filter, Observation, GenerationsAllRequest, GenerationsAllResponse, GenerationsCountResponse } from '../types';
|
|
6
|
+
import { Environment } from '../../../shared/types';
|
|
7
|
+
export declare class TracingApiService {
|
|
8
|
+
private config;
|
|
9
|
+
constructor(config: TracingApiConfig);
|
|
10
|
+
/**
|
|
11
|
+
* Helper to build TRPC URL with encoded input
|
|
12
|
+
*/
|
|
13
|
+
private buildTrpcUrl;
|
|
14
|
+
/**
|
|
15
|
+
* Helper to make GET request with proper headers
|
|
16
|
+
*/
|
|
17
|
+
private makeRequest;
|
|
18
|
+
/**
|
|
19
|
+
* Fetch paginated sessions with filters
|
|
20
|
+
* Endpoint: /tracing/api/trpc/sessions.all
|
|
21
|
+
*/
|
|
22
|
+
fetchSessions(request: SessionsAllRequest): Promise<SessionsAllResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* Get total count of sessions matching filters
|
|
25
|
+
* Endpoint: /tracing/api/trpc/sessions.countAll
|
|
26
|
+
*/
|
|
27
|
+
fetchSessionsCount(projectId: string, filters: Filter[]): Promise<SessionsCountResponse>;
|
|
28
|
+
/**
|
|
29
|
+
* Fetch metrics for specific sessions
|
|
30
|
+
* Endpoint: /tracing/api/trpc/sessions.metrics
|
|
31
|
+
*/
|
|
32
|
+
fetchSessionMetrics(projectId: string, sessionIds: string[]): Promise<SessionMetricsResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Fetch single session by ID
|
|
35
|
+
* Endpoint: /tracing/api/trpc/sessions.byId
|
|
36
|
+
*/
|
|
37
|
+
fetchSessionById(request: SessionByIdRequest): Promise<SessionByIdResponse>;
|
|
38
|
+
/**
|
|
39
|
+
* Fetch paginated traces with filters
|
|
40
|
+
* Endpoint: /tracing/api/trpc/traces.all
|
|
41
|
+
*/
|
|
42
|
+
fetchTraces(request: TracesAllRequest): Promise<TracesAllResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* Fetch metrics for multiple traces (latency, tokens, cost)
|
|
45
|
+
* Endpoint: /tracing/api/trpc/traces.metrics
|
|
46
|
+
*/
|
|
47
|
+
fetchTracesMetrics(request: TracesMetricsRequest): Promise<TracesMetricsResponse>;
|
|
48
|
+
/**
|
|
49
|
+
* Fetch single trace by ID (light call without observations)
|
|
50
|
+
* Endpoint: /tracing/api/trpc/traces.byId
|
|
51
|
+
*/
|
|
52
|
+
fetchTraceById(request: TraceByIdRequest): Promise<TraceByIdResponse>;
|
|
53
|
+
/**
|
|
54
|
+
* Fetch single trace by ID with observations and scores
|
|
55
|
+
* Endpoint: /tracing/api/trpc/traces.byIdWithObservationsAndScores
|
|
56
|
+
*/
|
|
57
|
+
fetchTraceByIdWithObservations(request: TraceByIdRequest): Promise<TraceByIdResponse>;
|
|
58
|
+
/**
|
|
59
|
+
* Fetch multiple traces by IDs with batching
|
|
60
|
+
* Uses traces.byId (light call without observations) for each trace
|
|
61
|
+
* Batches requests to avoid overwhelming the server
|
|
62
|
+
*
|
|
63
|
+
* @param traceIds - Array of trace IDs to fetch
|
|
64
|
+
* @param projectId - Project ID
|
|
65
|
+
* @param batchSize - Number of parallel requests per batch (default: 5)
|
|
66
|
+
* @returns Array of trace responses
|
|
67
|
+
*/
|
|
68
|
+
fetchTracesByIds(traceIds: string[], projectId: string, batchSize?: number): Promise<TraceByIdResponse[]>;
|
|
69
|
+
/**
|
|
70
|
+
* Fetch single observation by ID
|
|
71
|
+
* Endpoint: /tracing/api/trpc/observations.byId
|
|
72
|
+
*/
|
|
73
|
+
fetchObservationById(params: {
|
|
74
|
+
observationId: string;
|
|
75
|
+
traceId: string;
|
|
76
|
+
projectId: string;
|
|
77
|
+
startTime?: string;
|
|
78
|
+
}): Promise<Observation | null>;
|
|
79
|
+
/**
|
|
80
|
+
* Fetch paginated generations (LLM observations with type=GENERATION)
|
|
81
|
+
* Endpoint: /tracing/api/trpc/generations.all
|
|
82
|
+
*/
|
|
83
|
+
fetchGenerations(request: GenerationsAllRequest): Promise<GenerationsAllResponse>;
|
|
84
|
+
/**
|
|
85
|
+
* Get total count of generations matching filters
|
|
86
|
+
* Endpoint: /tracing/api/trpc/generations.countAll
|
|
87
|
+
*/
|
|
88
|
+
fetchGenerationsCount(projectId: string, filters: Filter[]): Promise<GenerationsCountResponse>;
|
|
89
|
+
/**
|
|
90
|
+
* Fetch available filter options
|
|
91
|
+
* Endpoint: /tracing/api/trpc/sessions.filterOptions
|
|
92
|
+
*/
|
|
93
|
+
fetchFilterOptions(request: FilterOptionsRequest): Promise<FilterOptionsResponse>;
|
|
94
|
+
/**
|
|
95
|
+
* Fetch score keys and properties
|
|
96
|
+
* Endpoint: /tracing/api/trpc/scores.getScoreKeysAndProps
|
|
97
|
+
*/
|
|
98
|
+
fetchScoreKeys(request: ScoreKeysRequest): Promise<ScoreKeysResponse>;
|
|
99
|
+
/**
|
|
100
|
+
* Fetch environments for the project (app)
|
|
101
|
+
* Endpoint: /aaa/api/v1/apps/:appId/environments
|
|
102
|
+
* @returns Array of Environment objects
|
|
103
|
+
*/
|
|
104
|
+
fetchEnvironments(): Promise<Environment[]>;
|
|
105
|
+
/**
|
|
106
|
+
* Build meta values for TRPC requests
|
|
107
|
+
* Converts filter values to proper types (Date, etc.)
|
|
108
|
+
*/
|
|
109
|
+
private buildMetaValues;
|
|
110
|
+
/**
|
|
111
|
+
* Update API configuration
|
|
112
|
+
*/
|
|
113
|
+
updateConfig(config: TracingApiConfig): void;
|
|
114
|
+
/**
|
|
115
|
+
* Get current configuration
|
|
116
|
+
*/
|
|
117
|
+
getConfig(): TracingApiConfig;
|
|
118
|
+
/**
|
|
119
|
+
* Helper to calculate time range filter
|
|
120
|
+
*/
|
|
121
|
+
static getTimeRangeFilter(option: string): Filter | null;
|
|
122
|
+
/**
|
|
123
|
+
* Helper to format token count
|
|
124
|
+
*/
|
|
125
|
+
static formatTokens(tokens: number | undefined): string;
|
|
126
|
+
/**
|
|
127
|
+
* Helper to format cost (string or number to currency)
|
|
128
|
+
*/
|
|
129
|
+
static formatCost(cost: string | number | undefined): string;
|
|
130
|
+
/**
|
|
131
|
+
* Helper to format duration in ms to human readable
|
|
132
|
+
*/
|
|
133
|
+
static formatDuration(ms: number | undefined): string;
|
|
134
|
+
/**
|
|
135
|
+
* Helper to format date
|
|
136
|
+
*/
|
|
137
|
+
static formatDate(dateString: string | undefined): string;
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=TracingApiService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TracingApiService.d.ts","sourceRoot":"","sources":["../../../../src/features/tracing/services/TracingApiService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,MAAM,EACN,WAAW,EACX,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EAEzB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAmB;gBAErB,MAAM,EAAE,gBAAgB;IASpC;;OAEG;IACH,OAAO,CAAC,YAAY;IAKpB;;OAEG;YACW,WAAW;IAoBzB;;;OAGG;IACG,aAAa,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAsB9E;;;OAGG;IACG,kBAAkB,CACtB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,qBAAqB,CAAC;IAsBjC;;;OAGG;IACG,mBAAmB,CACvB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAAE,GACnB,OAAO,CAAC,sBAAsB,CAAC;IAgBlC;;;OA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,WAAW,EAAE,CAAC;IA+BjD;;;OAGG;IACH,OAAO,CAAC,eAAe;IAYvB;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI;IAK5C;;OAEG;IACH,SAAS,IAAI,gBAAgB;IAI7B;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAgCxD;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM;IAKvD;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM;IAO5D;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM;IASrD;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM;CAK1D"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tracing Utility Functions
|
|
3
|
+
* Helper functions for formatting, calculations, and data manipulation
|
|
4
|
+
*/
|
|
5
|
+
import { Session, Trace, Filter, TokenBreakdown, CostBreakdown, FilterColumn } from '../types';
|
|
6
|
+
export declare class TracingUtils {
|
|
7
|
+
/**
|
|
8
|
+
* Format token count with locale string
|
|
9
|
+
*/
|
|
10
|
+
static formatTokens(tokens: number | string | undefined | null): string;
|
|
11
|
+
/**
|
|
12
|
+
* Format cost to currency string
|
|
13
|
+
*/
|
|
14
|
+
static formatCost(cost: string | number | undefined | null): string;
|
|
15
|
+
/**
|
|
16
|
+
* Format duration from milliseconds to human-readable string
|
|
17
|
+
*/
|
|
18
|
+
static formatDuration(ms: number | undefined | null): string;
|
|
19
|
+
/**
|
|
20
|
+
* Format date to locale string
|
|
21
|
+
*/
|
|
22
|
+
static formatDate(dateString: string | undefined | null): string;
|
|
23
|
+
/**
|
|
24
|
+
* Format date to relative time (e.g., "2 hours ago")
|
|
25
|
+
*/
|
|
26
|
+
static formatRelativeTime(dateString: string | undefined | null): string;
|
|
27
|
+
/**
|
|
28
|
+
* Calculate token breakdown from session or trace
|
|
29
|
+
*/
|
|
30
|
+
static getTokenBreakdown(item: Session | Trace): TokenBreakdown;
|
|
31
|
+
/**
|
|
32
|
+
* Calculate cost breakdown from session or trace
|
|
33
|
+
*/
|
|
34
|
+
static getCostBreakdown(item: Session | Trace): CostBreakdown;
|
|
35
|
+
/**
|
|
36
|
+
* Truncate string with ellipsis
|
|
37
|
+
*/
|
|
38
|
+
static truncate(str: string | undefined | null, maxLength: number): string;
|
|
39
|
+
/**
|
|
40
|
+
* Get status badge color class
|
|
41
|
+
*/
|
|
42
|
+
static getStatusColor(status: string | undefined): string;
|
|
43
|
+
/**
|
|
44
|
+
* Get status icon (for use with lucide-react)
|
|
45
|
+
*/
|
|
46
|
+
static getStatusIcon(status: string | undefined): 'check-circle' | 'loader' | 'x-circle' | 'help-circle';
|
|
47
|
+
/**
|
|
48
|
+
* Parse JSON safely
|
|
49
|
+
*/
|
|
50
|
+
static safeParseJSON(jsonString: string | undefined | null): any;
|
|
51
|
+
/**
|
|
52
|
+
* Stringify JSON with pretty print
|
|
53
|
+
*/
|
|
54
|
+
static prettyJSON(obj: any): string;
|
|
55
|
+
/**
|
|
56
|
+
* Build filter from time range option
|
|
57
|
+
*/
|
|
58
|
+
static buildTimeRangeFilter(option: string): Filter | null;
|
|
59
|
+
/**
|
|
60
|
+
* Export data to CSV
|
|
61
|
+
*/
|
|
62
|
+
static exportToCSV(data: any[], filename: string): void;
|
|
63
|
+
/**
|
|
64
|
+
* Debounce function for search inputs
|
|
65
|
+
*/
|
|
66
|
+
static debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
|
|
67
|
+
/**
|
|
68
|
+
* Merge filters, replacing duplicates by column
|
|
69
|
+
*/
|
|
70
|
+
static mergeFilters(existing: Filter[], newFilters: Filter[]): Filter[];
|
|
71
|
+
/**
|
|
72
|
+
* Remove filter by column
|
|
73
|
+
*/
|
|
74
|
+
static removeFilter(filters: Filter[], column: string): Filter[];
|
|
75
|
+
/**
|
|
76
|
+
* Get user-friendly filter description
|
|
77
|
+
*/
|
|
78
|
+
static getFilterDescription(filter: Filter): string;
|
|
79
|
+
/**
|
|
80
|
+
* Validate filter value based on type
|
|
81
|
+
*/
|
|
82
|
+
static isValidFilterValue(filter: Filter): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Get color for cost value (green for low, yellow for medium, red for high)
|
|
85
|
+
*/
|
|
86
|
+
static getCostColor(cost: string | number): string;
|
|
87
|
+
/**
|
|
88
|
+
* Get color for token count
|
|
89
|
+
*/
|
|
90
|
+
static getTokenColor(tokens: number): string;
|
|
91
|
+
/**
|
|
92
|
+
* Get color for duration
|
|
93
|
+
*/
|
|
94
|
+
static getDurationColor(ms: number): string;
|
|
95
|
+
/**
|
|
96
|
+
* Group sessions by date
|
|
97
|
+
*/
|
|
98
|
+
static groupSessionsByDate(sessions: Session[]): Map<string, Session[]>;
|
|
99
|
+
/**
|
|
100
|
+
* Calculate aggregate metrics for sessions
|
|
101
|
+
*/
|
|
102
|
+
static aggregateSessionMetrics(sessions: Session[]): {
|
|
103
|
+
totalTraces: number;
|
|
104
|
+
totalObservations: number;
|
|
105
|
+
totalTokens: number;
|
|
106
|
+
totalCost: number;
|
|
107
|
+
avgDuration: number;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Sort sessions by field
|
|
111
|
+
*/
|
|
112
|
+
static sortSessions(sessions: Session[], field: keyof Session, order: 'ASC' | 'DESC'): Session[];
|
|
113
|
+
/**
|
|
114
|
+
* Filter sessions by search term
|
|
115
|
+
*/
|
|
116
|
+
static filterSessionsBySearch(sessions: Session[], searchTerm: string): Session[];
|
|
117
|
+
/**
|
|
118
|
+
* Filter traces by search term
|
|
119
|
+
*/
|
|
120
|
+
static filterTracesBySearch(traces: Trace[], searchTerm: string): Trace[];
|
|
121
|
+
/**
|
|
122
|
+
* Get unique values from array
|
|
123
|
+
*/
|
|
124
|
+
static getUniqueValues<T>(arr: T[]): T[];
|
|
125
|
+
/**
|
|
126
|
+
* Check if filter is active (has valid value)
|
|
127
|
+
*/
|
|
128
|
+
static isFilterActive(filter: Filter): boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Get active filters count
|
|
131
|
+
*/
|
|
132
|
+
static getActiveFiltersCount(filters: Filter[]): number;
|
|
133
|
+
/**
|
|
134
|
+
* Build filter description for display
|
|
135
|
+
*/
|
|
136
|
+
static buildFilterBadgeText(filter: Filter): string;
|
|
137
|
+
/**
|
|
138
|
+
* Generate CSV filename with timestamp
|
|
139
|
+
*/
|
|
140
|
+
static generateCSVFilename(prefix: string): string;
|
|
141
|
+
/**
|
|
142
|
+
* Convert sessions to CSV-friendly format
|
|
143
|
+
*/
|
|
144
|
+
static sessionsToCsvData(sessions: Session[]): any[];
|
|
145
|
+
/**
|
|
146
|
+
* Convert traces to CSV-friendly format
|
|
147
|
+
*/
|
|
148
|
+
static tracesToCsvData(traces: Trace[]): any[];
|
|
149
|
+
/**
|
|
150
|
+
* Check if value is empty (null, undefined, empty string, empty array)
|
|
151
|
+
*/
|
|
152
|
+
static isEmpty(value: any): boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Get display value for table cell
|
|
155
|
+
*/
|
|
156
|
+
static getDisplayValue(value: any, defaultValue?: string): string;
|
|
157
|
+
/**
|
|
158
|
+
* Convert filters for API payload
|
|
159
|
+
* Uses filterId if provided, otherwise converts field names to appropriate format
|
|
160
|
+
* Also removes 'logic' field as backend doesn't support it yet
|
|
161
|
+
*/
|
|
162
|
+
static convertFiltersToApiFormat(filters: Filter[], availableColumns: FilterColumn[]): Filter[];
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=TracingUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TracingUtils.d.ts","sourceRoot":"","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,KAAK,EAAE,GAAG,GAAG,EAAE;IAqB9C;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO;IAQnC;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,YAAY,GAAE,MAAY,GAAG,MAAM;IAOtE;;;;OAIG;IACH,MAAM,CAAC,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,MAAM,EAAE;CA8BhG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Services - Barrel Export
|
|
3
|
+
* Business logic and data processing services
|
|
4
|
+
*/
|
|
5
|
+
export { TracingApiService } from './TracingApiService';
|
|
6
|
+
export { TracingUtils } from './TracingUtils';
|
|
7
|
+
export { buildObservationTree, flattenObservationTree, findObservationNode, getDescendantIds, calculateNodeMetrics, } from './ObservationTreeBuilder';
|
|
8
|
+
export type { ObservationTreeNode as TreeBuilderNode } from './ObservationTreeBuilder';
|
|
9
|
+
export { TraceTreeService } from './TraceTreeService';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/tracing/services/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,mBAAmB,IAAI,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|