@oh-my-pi/omp-stats 16.0.3 → 16.0.5
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/CHANGELOG.md +15 -0
- package/build.ts +11 -0
- package/dist/client/index.css +1 -1
- package/dist/client/index.html +11 -0
- package/dist/client/index.js +108 -108
- package/dist/client/styles.css +1070 -631
- package/dist/types/client/api.d.ts +19 -10
- package/dist/types/client/app/AppLayout.d.ts +16 -0
- package/dist/types/client/app/NavRail.d.ts +7 -0
- package/dist/types/client/app/RangeControl.d.ts +7 -0
- package/dist/types/client/app/SyncButton.d.ts +14 -0
- package/dist/types/client/app/ThemeToggle.d.ts +1 -0
- package/dist/types/client/app/TopBar.d.ts +15 -0
- package/dist/types/client/app/routes.d.ts +12 -0
- package/dist/types/client/components/chart-shared.d.ts +26 -40
- package/dist/types/client/components/models-table-shared.d.ts +20 -40
- package/dist/types/client/data/charts.d.ts +1 -0
- package/dist/types/client/data/formatters.d.ts +7 -0
- package/dist/types/client/data/useHashRoute.d.ts +8 -0
- package/dist/types/client/data/useResource.d.ts +13 -0
- package/dist/types/client/data/view-models.d.ts +37 -0
- package/dist/types/client/index.d.ts +1 -0
- package/dist/types/client/routes/BehaviorRoute.d.ts +7 -0
- package/dist/types/client/routes/CostsRoute.d.ts +7 -0
- package/dist/types/client/routes/ErrorsRoute.d.ts +8 -0
- package/dist/types/client/routes/ModelsRoute.d.ts +7 -0
- package/dist/types/client/routes/OverviewRoute.d.ts +8 -0
- package/dist/types/client/routes/ProjectsRoute.d.ts +7 -0
- package/dist/types/client/routes/RequestsRoute.d.ts +8 -0
- package/dist/types/client/routes/index.d.ts +7 -0
- package/dist/types/client/ui/AsyncBoundary.d.ts +12 -0
- package/dist/types/client/ui/DataTable.d.ts +17 -0
- package/dist/types/client/ui/EmptyState.d.ts +7 -0
- package/dist/types/client/ui/ErrorState.d.ts +6 -0
- package/dist/types/client/ui/JsonBlock.d.ts +7 -0
- package/dist/types/client/ui/MetricCluster.d.ts +5 -0
- package/dist/types/client/ui/Panel.d.ts +7 -0
- package/dist/types/client/ui/RequestDrawer.d.ts +5 -0
- package/dist/types/client/ui/SegmentedControl.d.ts +12 -0
- package/dist/types/client/ui/Skeleton.d.ts +8 -0
- package/dist/types/client/ui/StatusPill.d.ts +7 -0
- package/dist/types/client/ui/index.d.ts +11 -0
- package/dist/types/client/useSystemTheme.d.ts +9 -0
- package/package.json +4 -4
- package/src/aggregator.ts +4 -3
- package/src/client/App.tsx +89 -207
- package/src/client/api.ts +55 -37
- package/src/client/app/AppLayout.tsx +93 -0
- package/src/client/app/NavRail.tsx +44 -0
- package/src/client/app/RangeControl.tsx +39 -0
- package/src/client/app/SyncButton.tsx +75 -0
- package/src/client/app/ThemeToggle.tsx +37 -0
- package/src/client/app/TopBar.tsx +73 -0
- package/src/client/app/routes.ts +50 -0
- package/src/client/components/chart-shared.tsx +28 -91
- package/src/client/components/models-table-shared.tsx +9 -29
- package/src/client/components/range-meta.ts +3 -2
- package/src/client/data/charts.ts +14 -0
- package/src/client/data/formatters.ts +38 -0
- package/src/client/data/useHashRoute.ts +85 -0
- package/src/client/data/useResource.ts +154 -0
- package/src/client/data/view-models.ts +178 -0
- package/src/client/index.tsx +4 -0
- package/src/client/routes/BehaviorRoute.tsx +623 -0
- package/src/client/routes/CostsRoute.tsx +234 -0
- package/src/client/routes/ErrorsRoute.tsx +118 -0
- package/src/client/routes/ModelsRoute.tsx +430 -0
- package/src/client/routes/OverviewRoute.tsx +332 -0
- package/src/client/routes/ProjectsRoute.tsx +163 -0
- package/src/client/routes/RequestsRoute.tsx +123 -0
- package/src/client/routes/index.ts +7 -0
- package/src/client/styles.css +1242 -225
- package/src/client/ui/AsyncBoundary.tsx +54 -0
- package/src/client/ui/DataTable.tsx +122 -0
- package/src/client/ui/EmptyState.tsx +16 -0
- package/src/client/ui/ErrorState.tsx +25 -0
- package/src/client/ui/JsonBlock.tsx +75 -0
- package/src/client/ui/MetricCluster.tsx +67 -0
- package/src/client/ui/Panel.tsx +24 -0
- package/src/client/ui/RequestDrawer.tsx +208 -0
- package/src/client/ui/SegmentedControl.tsx +36 -0
- package/src/client/ui/Skeleton.tsx +17 -0
- package/src/client/ui/StatusPill.tsx +15 -0
- package/src/client/ui/index.ts +11 -0
- package/src/client/useSystemTheme.ts +73 -17
- package/dist/types/client/components/BehaviorChart.d.ts +0 -6
- package/dist/types/client/components/BehaviorModelsTable.d.ts +0 -7
- package/dist/types/client/components/BehaviorSummary.d.ts +0 -7
- package/dist/types/client/components/ChartsContainer.d.ts +0 -7
- package/dist/types/client/components/CostChart.d.ts +0 -6
- package/dist/types/client/components/CostSummary.d.ts +0 -6
- package/dist/types/client/components/Header.d.ts +0 -12
- package/dist/types/client/components/ModelsTable.d.ts +0 -8
- package/dist/types/client/components/RequestDetail.d.ts +0 -6
- package/dist/types/client/components/RequestList.d.ts +0 -8
- package/dist/types/client/components/StatsGrid.d.ts +0 -6
- package/src/client/components/BehaviorChart.tsx +0 -189
- package/src/client/components/BehaviorModelsTable.tsx +0 -342
- package/src/client/components/BehaviorSummary.tsx +0 -95
- package/src/client/components/ChartsContainer.tsx +0 -221
- package/src/client/components/CostChart.tsx +0 -171
- package/src/client/components/CostSummary.tsx +0 -53
- package/src/client/components/Header.tsx +0 -72
- package/src/client/components/ModelsTable.tsx +0 -265
- package/src/client/components/RequestDetail.tsx +0 -172
- package/src/client/components/RequestList.tsx +0 -73
- package/src/client/components/StatsGrid.tsx +0 -135
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import type { BehaviorDashboardStats, CostDashboardStats,
|
|
2
|
-
export declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function
|
|
9
|
-
export declare function
|
|
10
|
-
export declare function
|
|
1
|
+
import type { BehaviorDashboardStats, CostDashboardStats, FolderStats, MessageStats, ModelDashboardStats, OverviewStats, RequestDetails, TimeRange } from "./types";
|
|
2
|
+
export declare class ApiError extends Error {
|
|
3
|
+
status: number;
|
|
4
|
+
endpoint: string;
|
|
5
|
+
constructor(status: number, endpoint: string, message: string);
|
|
6
|
+
}
|
|
7
|
+
export declare function getOverviewStats(range?: TimeRange, signal?: AbortSignal): Promise<OverviewStats>;
|
|
8
|
+
export declare function getModelDashboardStats(range?: TimeRange, signal?: AbortSignal): Promise<ModelDashboardStats>;
|
|
9
|
+
export declare function getCostDashboardStats(range?: TimeRange, signal?: AbortSignal): Promise<CostDashboardStats>;
|
|
10
|
+
export declare function getRecentRequests(limit?: number, signal?: AbortSignal): Promise<MessageStats[]>;
|
|
11
|
+
export declare function getRecentErrors(limit?: number, signal?: AbortSignal): Promise<MessageStats[]>;
|
|
12
|
+
export declare function getRequestDetails(id: number, signal?: AbortSignal): Promise<RequestDetails>;
|
|
13
|
+
export declare function sync(signal?: AbortSignal): Promise<{
|
|
14
|
+
processed: number;
|
|
15
|
+
files: number;
|
|
16
|
+
totalMessages: number;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function getBehaviorDashboardStats(range?: TimeRange, signal?: AbortSignal): Promise<BehaviorDashboardStats>;
|
|
19
|
+
export declare function getFolderStats(range?: TimeRange, signal?: AbortSignal): Promise<FolderStats[]>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { TimeRange } from "../types";
|
|
3
|
+
import type { DashboardSection } from "./routes";
|
|
4
|
+
export interface AppLayoutProps {
|
|
5
|
+
activeSection: DashboardSection;
|
|
6
|
+
onSectionChange: (section: DashboardSection) => void;
|
|
7
|
+
range: TimeRange;
|
|
8
|
+
onRangeChange: (range: TimeRange) => void;
|
|
9
|
+
updatedAt: number | null;
|
|
10
|
+
onSyncStart?: () => void;
|
|
11
|
+
onSyncComplete?: (result: {
|
|
12
|
+
success: boolean;
|
|
13
|
+
}) => void;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export declare function AppLayout({ activeSection, onSectionChange, range, onRangeChange, updatedAt, onSyncStart, onSyncComplete, children, }: AppLayoutProps): React.JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type DashboardSection } from "./routes";
|
|
2
|
+
export interface NavRailProps {
|
|
3
|
+
activeSection: DashboardSection;
|
|
4
|
+
onSectionChange: (section: DashboardSection) => void;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function NavRail({ activeSection, onSectionChange, className }: NavRailProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TimeRange } from "../types";
|
|
2
|
+
export interface RangeControlProps {
|
|
3
|
+
value: TimeRange;
|
|
4
|
+
onChange: (value: TimeRange) => void;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function RangeControl({ value, onChange, className }: RangeControlProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface SyncButtonProps {
|
|
2
|
+
onSyncStart?: () => void;
|
|
3
|
+
onSyncComplete?: (result: {
|
|
4
|
+
success: boolean;
|
|
5
|
+
data?: {
|
|
6
|
+
processed: number;
|
|
7
|
+
files: number;
|
|
8
|
+
totalMessages: number;
|
|
9
|
+
};
|
|
10
|
+
error?: string;
|
|
11
|
+
}) => void;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function SyncButton({ onSyncStart, onSyncComplete, className }: SyncButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ThemeToggle(): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TimeRange } from "../types";
|
|
2
|
+
import type { DashboardSection } from "./routes";
|
|
3
|
+
export interface TopBarProps {
|
|
4
|
+
activeSection: DashboardSection;
|
|
5
|
+
range: TimeRange;
|
|
6
|
+
onRangeChange: (range: TimeRange) => void;
|
|
7
|
+
updatedAt: number | null;
|
|
8
|
+
onSyncStart?: () => void;
|
|
9
|
+
onSyncComplete?: (result: {
|
|
10
|
+
success: boolean;
|
|
11
|
+
}) => void;
|
|
12
|
+
onMenuToggle?: () => void;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function TopBar({ activeSection, range, onRangeChange, updatedAt, onSyncStart, onSyncComplete, onMenuToggle, className, }: TopBarProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export type DashboardSection = "overview" | "requests" | "errors" | "models" | "costs" | "behavior" | "projects";
|
|
3
|
+
export interface DashboardRoute {
|
|
4
|
+
id: DashboardSection;
|
|
5
|
+
label: string;
|
|
6
|
+
shortLabel?: string;
|
|
7
|
+
icon: React.ComponentType<{
|
|
8
|
+
size?: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
export declare const routes: DashboardRoute[];
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared chart primitives for the dashboard timeline charts
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Shared chart primitives for the dashboard timeline charts: the OMP color
|
|
3
|
+
* palette, light/dark chart chrome, legend/tooltip + scale plumbing, dataset
|
|
4
|
+
* styling, and the top-N-by-model / aggregate bucketing used by the cost and
|
|
5
|
+
* behavior series.
|
|
6
6
|
*/
|
|
7
7
|
export declare const MODEL_COLORS: string[];
|
|
8
8
|
export declare const CHART_THEMES: {
|
|
9
9
|
readonly dark: {
|
|
10
|
-
readonly legendLabel: "#
|
|
11
|
-
readonly tooltipBackground: "#
|
|
12
|
-
readonly tooltipTitle: "#
|
|
13
|
-
readonly tooltipBody: "#
|
|
14
|
-
readonly tooltipBorder: "rgba(255, 255, 255, 0.
|
|
10
|
+
readonly legendLabel: "#a89fb3";
|
|
11
|
+
readonly tooltipBackground: "#241a2e";
|
|
12
|
+
readonly tooltipTitle: "#eae5ef";
|
|
13
|
+
readonly tooltipBody: "#a89fb3";
|
|
14
|
+
readonly tooltipBorder: "rgba(255, 255, 255, 0.12)";
|
|
15
15
|
readonly grid: "rgba(255, 255, 255, 0.06)";
|
|
16
|
-
readonly tick: "#
|
|
16
|
+
readonly tick: "#867a93";
|
|
17
17
|
};
|
|
18
18
|
readonly light: {
|
|
19
|
-
readonly legendLabel: "#
|
|
19
|
+
readonly legendLabel: "#5a5462";
|
|
20
20
|
readonly tooltipBackground: "#ffffff";
|
|
21
|
-
readonly tooltipTitle: "#
|
|
22
|
-
readonly tooltipBody: "#
|
|
23
|
-
readonly tooltipBorder: "rgba(
|
|
24
|
-
readonly grid: "rgba(
|
|
25
|
-
readonly tick: "#
|
|
21
|
+
readonly tooltipTitle: "#241a2e";
|
|
22
|
+
readonly tooltipBody: "#5a5462";
|
|
23
|
+
readonly tooltipBorder: "rgba(20, 12, 28, 0.15)";
|
|
24
|
+
readonly grid: "rgba(20, 12, 28, 0.08)";
|
|
25
|
+
readonly tick: "#6a6275";
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
export type ChartTheme = (typeof CHART_THEMES)[keyof typeof CHART_THEMES];
|
|
@@ -51,7 +51,7 @@ export declare function buildSharedPlugins(opts: {
|
|
|
51
51
|
position: "top";
|
|
52
52
|
align: "start";
|
|
53
53
|
labels: {
|
|
54
|
-
color: "#
|
|
54
|
+
color: "#5a5462" | "#a89fb3";
|
|
55
55
|
usePointStyle: boolean;
|
|
56
56
|
padding: number;
|
|
57
57
|
font: {
|
|
@@ -61,10 +61,10 @@ export declare function buildSharedPlugins(opts: {
|
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
63
|
tooltip: {
|
|
64
|
-
backgroundColor: "#
|
|
65
|
-
titleColor: "#
|
|
66
|
-
bodyColor: "#
|
|
67
|
-
borderColor: "rgba(
|
|
64
|
+
backgroundColor: "#241a2e" | "#ffffff";
|
|
65
|
+
titleColor: "#241a2e" | "#eae5ef";
|
|
66
|
+
bodyColor: "#5a5462" | "#a89fb3";
|
|
67
|
+
borderColor: "rgba(20, 12, 28, 0.15)" | "rgba(255, 255, 255, 0.12)";
|
|
68
68
|
borderWidth: number;
|
|
69
69
|
padding: number;
|
|
70
70
|
cornerRadius: number;
|
|
@@ -88,11 +88,11 @@ export declare function buildSharedScales(opts: {
|
|
|
88
88
|
}): {
|
|
89
89
|
sharedScaleBase: {
|
|
90
90
|
grid: {
|
|
91
|
-
color: "rgba(
|
|
91
|
+
color: "rgba(20, 12, 28, 0.08)" | "rgba(255, 255, 255, 0.06)";
|
|
92
92
|
drawBorder: boolean;
|
|
93
93
|
};
|
|
94
94
|
ticks: {
|
|
95
|
-
color: "#
|
|
95
|
+
color: "#6a6275" | "#867a93";
|
|
96
96
|
font: {
|
|
97
97
|
size: number;
|
|
98
98
|
};
|
|
@@ -100,11 +100,11 @@ export declare function buildSharedScales(opts: {
|
|
|
100
100
|
};
|
|
101
101
|
yScale: {
|
|
102
102
|
grid: {
|
|
103
|
-
color: "rgba(
|
|
103
|
+
color: "rgba(20, 12, 28, 0.08)" | "rgba(255, 255, 255, 0.06)";
|
|
104
104
|
drawBorder: boolean;
|
|
105
105
|
};
|
|
106
106
|
ticks: {
|
|
107
|
-
color: "#
|
|
107
|
+
color: "#6a6275" | "#867a93";
|
|
108
108
|
font: {
|
|
109
109
|
size: number;
|
|
110
110
|
};
|
|
@@ -129,6 +129,7 @@ export declare function barDatasetStyle(color: string): {
|
|
|
129
129
|
borderColor: string;
|
|
130
130
|
borderWidth: number;
|
|
131
131
|
borderRadius: number;
|
|
132
|
+
maxBarThickness: number;
|
|
132
133
|
};
|
|
133
134
|
/**
|
|
134
135
|
* Map a generic ChartSeries' datasets through a per-index style function so
|
|
@@ -169,19 +170,4 @@ export declare function buildTopNByModelSeries<T extends ModelKeyedPoint, B>(poi
|
|
|
169
170
|
accumulate: (bucket: B, point: T) => void;
|
|
170
171
|
bucketToValue: (bucket: B) => number;
|
|
171
172
|
}): ChartSeries;
|
|
172
|
-
/**
|
|
173
|
-
* Outer surface card used by both time charts. `controls` slot covers
|
|
174
|
-
* chart-specific tabs (e.g. behavior metric picker); the by-model toggle and
|
|
175
|
-
* empty-state are part of the frame so callers don't redeclare them.
|
|
176
|
-
*/
|
|
177
|
-
export declare function ChartFrame({ title, subtitle, empty, emptyMessage, controls, byModel, onByModelChange, children, }: {
|
|
178
|
-
title: string;
|
|
179
|
-
subtitle: string;
|
|
180
|
-
empty: boolean;
|
|
181
|
-
emptyMessage: string;
|
|
182
|
-
controls?: React.ReactNode;
|
|
183
|
-
byModel: boolean;
|
|
184
|
-
onByModelChange: (v: boolean) => void;
|
|
185
|
-
children: React.ReactNode;
|
|
186
|
-
}): import("react").JSX.Element;
|
|
187
173
|
export {};
|
|
@@ -1,32 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared primitives for the per-model breakdown tables
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* chrome, expand-row plumbing, theme palette, and the mini-sparkline plus
|
|
2
|
+
* Shared primitives for the per-model breakdown tables. Each table owns its
|
|
3
|
+
* column definitions, sort order, and chart type — this module owns the
|
|
4
|
+
* surface chrome, expand-row plumbing, theme palette, the mini-sparkline, and
|
|
6
5
|
* the shared plugin/scale config consumed by multi-line detail charts.
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
readonly legendLabel: "#cbd5e1";
|
|
12
|
-
readonly tooltipBackground: "#16161e";
|
|
13
|
-
readonly tooltipTitle: "#f8fafc";
|
|
14
|
-
readonly tooltipBody: "#94a3b8";
|
|
15
|
-
readonly tooltipBorder: "rgba(255, 255, 255, 0.1)";
|
|
16
|
-
readonly grid: "rgba(255, 255, 255, 0.06)";
|
|
17
|
-
readonly tick: "#94a3b8";
|
|
18
|
-
};
|
|
19
|
-
readonly light: {
|
|
20
|
-
readonly legendLabel: "#334155";
|
|
21
|
-
readonly tooltipBackground: "#ffffff";
|
|
22
|
-
readonly tooltipTitle: "#0f172a";
|
|
23
|
-
readonly tooltipBody: "#334155";
|
|
24
|
-
readonly tooltipBorder: "rgba(15, 23, 42, 0.18)";
|
|
25
|
-
readonly grid: "rgba(15, 23, 42, 0.08)";
|
|
26
|
-
readonly tick: "#475569";
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export type TableChartTheme = (typeof TABLE_CHART_THEMES)[keyof typeof TABLE_CHART_THEMES];
|
|
7
|
+
import type { ChartTheme } from "./chart-shared";
|
|
8
|
+
export { CHART_THEMES as TABLE_CHART_THEMES, MODEL_COLORS } from "./chart-shared";
|
|
9
|
+
export type TableChartTheme = ChartTheme;
|
|
30
10
|
/** Style defaults for one line in a non-stacked detail chart. */
|
|
31
11
|
export declare function lineSeriesStyle(color: string): {
|
|
32
12
|
borderColor: string;
|
|
@@ -54,7 +34,7 @@ export declare function detailChartPlugins(chartTheme: TableChartTheme): {
|
|
|
54
34
|
display: boolean;
|
|
55
35
|
position: "top";
|
|
56
36
|
labels: {
|
|
57
|
-
color: "#
|
|
37
|
+
color: "#5a5462" | "#a89fb3";
|
|
58
38
|
usePointStyle: boolean;
|
|
59
39
|
padding: number;
|
|
60
40
|
font: {
|
|
@@ -63,10 +43,10 @@ export declare function detailChartPlugins(chartTheme: TableChartTheme): {
|
|
|
63
43
|
};
|
|
64
44
|
};
|
|
65
45
|
tooltip: {
|
|
66
|
-
backgroundColor: "#
|
|
67
|
-
titleColor: "#
|
|
68
|
-
bodyColor: "#
|
|
69
|
-
borderColor: "rgba(
|
|
46
|
+
backgroundColor: "#241a2e" | "#ffffff";
|
|
47
|
+
titleColor: "#241a2e" | "#eae5ef";
|
|
48
|
+
bodyColor: "#5a5462" | "#a89fb3";
|
|
49
|
+
borderColor: "rgba(20, 12, 28, 0.15)" | "rgba(255, 255, 255, 0.12)";
|
|
70
50
|
borderWidth: number;
|
|
71
51
|
cornerRadius: number;
|
|
72
52
|
};
|
|
@@ -78,10 +58,10 @@ export declare function detailChartPlugins(chartTheme: TableChartTheme): {
|
|
|
78
58
|
export declare function detailChartScalesSingleAxis(chartTheme: TableChartTheme): {
|
|
79
59
|
x: {
|
|
80
60
|
grid: {
|
|
81
|
-
color: "rgba(
|
|
61
|
+
color: "rgba(20, 12, 28, 0.08)" | "rgba(255, 255, 255, 0.06)";
|
|
82
62
|
};
|
|
83
63
|
ticks: {
|
|
84
|
-
color: "#
|
|
64
|
+
color: "#6a6275" | "#867a93";
|
|
85
65
|
font: {
|
|
86
66
|
size: number;
|
|
87
67
|
};
|
|
@@ -89,10 +69,10 @@ export declare function detailChartScalesSingleAxis(chartTheme: TableChartTheme)
|
|
|
89
69
|
};
|
|
90
70
|
y: {
|
|
91
71
|
grid: {
|
|
92
|
-
color: "rgba(
|
|
72
|
+
color: "rgba(20, 12, 28, 0.08)" | "rgba(255, 255, 255, 0.06)";
|
|
93
73
|
};
|
|
94
74
|
ticks: {
|
|
95
|
-
color: "#
|
|
75
|
+
color: "#6a6275" | "#867a93";
|
|
96
76
|
font: {
|
|
97
77
|
size: number;
|
|
98
78
|
};
|
|
@@ -108,10 +88,10 @@ export declare function detailChartScalesSingleAxis(chartTheme: TableChartTheme)
|
|
|
108
88
|
export declare function detailChartScalesDualAxis(chartTheme: TableChartTheme): {
|
|
109
89
|
x: {
|
|
110
90
|
grid: {
|
|
111
|
-
color: "rgba(
|
|
91
|
+
color: "rgba(20, 12, 28, 0.08)" | "rgba(255, 255, 255, 0.06)";
|
|
112
92
|
};
|
|
113
93
|
ticks: {
|
|
114
|
-
color: "#
|
|
94
|
+
color: "#6a6275" | "#867a93";
|
|
115
95
|
font: {
|
|
116
96
|
size: number;
|
|
117
97
|
};
|
|
@@ -122,10 +102,10 @@ export declare function detailChartScalesDualAxis(chartTheme: TableChartTheme):
|
|
|
122
102
|
display: boolean;
|
|
123
103
|
position: "left";
|
|
124
104
|
grid: {
|
|
125
|
-
color: "rgba(
|
|
105
|
+
color: "rgba(20, 12, 28, 0.08)" | "rgba(255, 255, 255, 0.06)";
|
|
126
106
|
};
|
|
127
107
|
ticks: {
|
|
128
|
-
color: "#
|
|
108
|
+
color: "#6a6275" | "#867a93";
|
|
129
109
|
font: {
|
|
130
110
|
size: number;
|
|
131
111
|
};
|
|
@@ -139,7 +119,7 @@ export declare function detailChartScalesDualAxis(chartTheme: TableChartTheme):
|
|
|
139
119
|
drawOnChartArea: boolean;
|
|
140
120
|
};
|
|
141
121
|
ticks: {
|
|
142
|
-
color: "#
|
|
122
|
+
color: "#6a6275" | "#867a93";
|
|
143
123
|
font: {
|
|
144
124
|
size: number;
|
|
145
125
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function formatInteger(value: number): string;
|
|
2
|
+
export declare function formatCompact(value: number): string;
|
|
3
|
+
export declare function formatCost(value: number, digits?: number): string;
|
|
4
|
+
export declare function formatPercent(value: number, digits?: number): string;
|
|
5
|
+
export declare function formatDurationMs(value: number | null, digits?: number): string;
|
|
6
|
+
export declare function formatTokensPerSecond(value: number | null): string;
|
|
7
|
+
export declare function formatRelativeTime(timestamp: number): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DashboardSection } from "../app/routes";
|
|
2
|
+
import type { TimeRange } from "../types";
|
|
3
|
+
export declare function useHashRoute(): {
|
|
4
|
+
section: DashboardSection;
|
|
5
|
+
setSection: (newSection: DashboardSection) => void;
|
|
6
|
+
range: TimeRange;
|
|
7
|
+
setRange: (newRange: string) => void;
|
|
8
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ResourceResult<T> {
|
|
2
|
+
data: T | null;
|
|
3
|
+
error: Error | null;
|
|
4
|
+
loading: boolean;
|
|
5
|
+
refreshing: boolean;
|
|
6
|
+
refetch: () => Promise<void>;
|
|
7
|
+
updatedAt: number | null;
|
|
8
|
+
}
|
|
9
|
+
export interface ResourceOptions {
|
|
10
|
+
pollMs?: number;
|
|
11
|
+
enabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function useResource<T>(key: readonly unknown[], fetcher: (signal: AbortSignal) => Promise<T>, options?: ResourceOptions): ResourceResult<T>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { BehaviorOverallStats, BehaviorTimeSeriesPoint, CostTimeSeriesPoint, FolderStats, ModelPerformancePoint, TimeRange } from "../types";
|
|
2
|
+
export interface CostSummaryView {
|
|
3
|
+
totalCost: number;
|
|
4
|
+
avgDailyCost: number;
|
|
5
|
+
topModelName: string;
|
|
6
|
+
topModelCost: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ModelPerformanceDataPoint {
|
|
9
|
+
timestamp: number;
|
|
10
|
+
avgTtftSeconds: number | null;
|
|
11
|
+
avgTokensPerSecond: number | null;
|
|
12
|
+
requests: number;
|
|
13
|
+
}
|
|
14
|
+
export interface ModelPerformanceSeries {
|
|
15
|
+
label: string;
|
|
16
|
+
data: ModelPerformanceDataPoint[];
|
|
17
|
+
}
|
|
18
|
+
export interface BehaviorSummaryView {
|
|
19
|
+
totalMessages: number;
|
|
20
|
+
totalYelling: number;
|
|
21
|
+
totalProfanity: number;
|
|
22
|
+
totalAnguish: number;
|
|
23
|
+
totalFrustration: number;
|
|
24
|
+
highestFrictionModel: {
|
|
25
|
+
model: string;
|
|
26
|
+
provider: string;
|
|
27
|
+
score: number;
|
|
28
|
+
} | null;
|
|
29
|
+
}
|
|
30
|
+
export interface FolderRowView extends FolderStats {
|
|
31
|
+
costPercentage: number;
|
|
32
|
+
requestsPercentage: number;
|
|
33
|
+
}
|
|
34
|
+
export declare function buildCostSummary(costSeries: CostTimeSeriesPoint[]): CostSummaryView;
|
|
35
|
+
export declare function buildModelPerformanceLookup(points: ModelPerformancePoint[], range: TimeRange): Map<string, ModelPerformanceSeries>;
|
|
36
|
+
export declare function buildBehaviorSummary(overall: BehaviorOverallStats, series: BehaviorTimeSeriesPoint[]): BehaviorSummaryView;
|
|
37
|
+
export declare function buildFolderRows(folders: FolderStats[]): FolderRowView[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TimeRange } from "../types";
|
|
2
|
+
export interface BehaviorRouteProps {
|
|
3
|
+
active: boolean;
|
|
4
|
+
range: TimeRange;
|
|
5
|
+
refreshTrigger: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function BehaviorRoute({ active, range, refreshTrigger }: BehaviorRouteProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TimeRange } from "../types";
|
|
2
|
+
export interface ErrorsRouteProps {
|
|
3
|
+
active: boolean;
|
|
4
|
+
range: TimeRange;
|
|
5
|
+
refreshTrigger: number;
|
|
6
|
+
onRequestClick: (id: number) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function ErrorsRoute({ active, refreshTrigger, onRequestClick }: ErrorsRouteProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TimeRange } from "../types";
|
|
2
|
+
export interface ModelsRouteProps {
|
|
3
|
+
active: boolean;
|
|
4
|
+
range: TimeRange;
|
|
5
|
+
refreshTrigger: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function ModelsRoute({ active, range, refreshTrigger }: ModelsRouteProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TimeRange } from "../types";
|
|
2
|
+
export interface OverviewRouteProps {
|
|
3
|
+
active: boolean;
|
|
4
|
+
range: TimeRange;
|
|
5
|
+
refreshTrigger: number;
|
|
6
|
+
onRequestClick: (id: number) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function OverviewRoute({ active, range, refreshTrigger, onRequestClick }: OverviewRouteProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TimeRange } from "../types";
|
|
2
|
+
export interface ProjectsRouteProps {
|
|
3
|
+
active: boolean;
|
|
4
|
+
range: TimeRange;
|
|
5
|
+
refreshTrigger: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function ProjectsRoute({ active, range, refreshTrigger }: ProjectsRouteProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TimeRange } from "../types";
|
|
2
|
+
export interface RequestsRouteProps {
|
|
3
|
+
active: boolean;
|
|
4
|
+
range: TimeRange;
|
|
5
|
+
refreshTrigger: number;
|
|
6
|
+
onRequestClick: (id: number) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function RequestsRoute({ active, refreshTrigger, onRequestClick }: RequestsRouteProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export interface AsyncBoundaryProps {
|
|
3
|
+
loading: boolean;
|
|
4
|
+
error: Error | null;
|
|
5
|
+
data: unknown | null;
|
|
6
|
+
empty?: boolean;
|
|
7
|
+
emptyText?: string;
|
|
8
|
+
fallback?: React.ReactNode;
|
|
9
|
+
onRetry?: () => void;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare function AsyncBoundary({ loading, error, data, empty, emptyText, fallback, onRetry, children, }: AsyncBoundaryProps): React.JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export interface DataTableColumn<T> {
|
|
3
|
+
key: string;
|
|
4
|
+
header: React.ReactNode;
|
|
5
|
+
render?: (item: T) => React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
numeric?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface DataTableProps<T> {
|
|
10
|
+
columns: DataTableColumn<T>[];
|
|
11
|
+
data: T[];
|
|
12
|
+
keyExtractor: (item: T) => string | number;
|
|
13
|
+
onRowClick?: (item: T) => void;
|
|
14
|
+
renderMobileCard?: (item: T, onClick?: () => void) => React.ReactNode;
|
|
15
|
+
emptyText?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function DataTable<T>({ columns, data, keyExtractor, onRowClick, renderMobileCard, emptyText, }: DataTableProps<T>): React.JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type LucideIcon } from "lucide-react";
|
|
2
|
+
export interface EmptyStateProps {
|
|
3
|
+
message?: string;
|
|
4
|
+
icon?: LucideIcon;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function EmptyState({ message, icon: Icon, className }: EmptyStateProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export interface PanelProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
3
|
+
title?: React.ReactNode;
|
|
4
|
+
subtitle?: React.ReactNode;
|
|
5
|
+
actions?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function Panel({ title, subtitle, actions, children, className, ...props }: PanelProps): React.JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface SegmentedControlOption<T> {
|
|
2
|
+
value: T;
|
|
3
|
+
label: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface SegmentedControlProps<T> {
|
|
7
|
+
options: SegmentedControlOption<T>[];
|
|
8
|
+
value: T;
|
|
9
|
+
onChange: (value: T) => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function SegmentedControl<T>({ options, value, onChange, className }: SegmentedControlProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export interface SkeletonProps {
|
|
3
|
+
variant?: "text" | "rect" | "circle";
|
|
4
|
+
width?: string | number;
|
|
5
|
+
height?: string | number;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function Skeleton({ variant, width, height, className }: SkeletonProps): React.JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export interface StatusPillProps {
|
|
3
|
+
variant: "success" | "danger" | "warning" | "info" | "default";
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function StatusPill({ variant, children, className }: StatusPillProps): React.JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./AsyncBoundary";
|
|
2
|
+
export * from "./DataTable";
|
|
3
|
+
export * from "./EmptyState";
|
|
4
|
+
export * from "./ErrorState";
|
|
5
|
+
export * from "./JsonBlock";
|
|
6
|
+
export * from "./MetricCluster";
|
|
7
|
+
export * from "./Panel";
|
|
8
|
+
export * from "./RequestDrawer";
|
|
9
|
+
export * from "./SegmentedControl";
|
|
10
|
+
export * from "./Skeleton";
|
|
11
|
+
export * from "./StatusPill";
|