chore: init main branch

This commit is contained in:
954801926@qq.com committed 2026-07-29 23:36:41 +08:00
commit 549c8b5b13
231 files changed
+27286

No files matched your search

+110
View File
@@ -0,0 +1,110 @@
// Dashboard types — match the Rust structs in src-tauri/src/dashboard.rs (camelCase serde)
export interface TotalsRow {
requests: number;
inputOther: number;
output: number;
inputCacheRead: number;
inputCacheCreation: number;
costUsd: number;
totalTokens: number;
cacheHitRate: number;
}
export interface DailyRow extends TotalsRow {
date: string;
byModel: Record<string, number>;
byProvider: Record<string, number>;
byProviderModel: Record<string, Record<string, number>>;
}
export interface ModelRow extends TotalsRow {
model: string;
modelDisplay: string;
modelResolved: string;
priceId: string;
costEstimated: boolean;
}
export interface RecentRow {
time: number;
model: string;
modelDisplay: string;
modelResolved: string;
inputOther: number;
output: number;
inputCacheRead: number;
inputCacheCreation: number;
totalTokens: number;
costUsd: number;
costEstimated: boolean;
priceId: string;
fromEnv: boolean;
}
export interface RangeStats {
range: string;
totals: TotalsRow;
daily: DailyRow[];
models: ModelRow[];
recent: RecentRow[];
recentTotal: number;
recentLimit: number;
}
export interface HeatmapCell {
date: string;
dow: number;
weekIndex: number;
requests: number;
totalTokens: number;
costUsd: number;
cacheHitRate: number;
level: number;
}
export interface MonthLabel {
weekIndex: number;
label: string;
}
export interface HeatmapData {
weeks: number;
start: string;
end: string;
maxTokens: number;
cells: HeatmapCell[];
monthLabels: MonthLabel[];
}
export interface ScanMeta {
filesScanned: number;
linesSeen: number;
recordCount: number;
home: string;
sessionsRoot: string;
errors: string[];
}
export interface AllModelRow {
model: string;
modelDisplay: string;
requests: number;
totalTokens: number;
costUsd: number;
costEstimated: boolean;
cacheHitRate: number;
}
export interface SummaryResult {
home: string;
valid: boolean;
scannedAt: number;
meta: ScanMeta;
range: string;
stats: RangeStats;
heatmap: HeatmapData;
allModels: AllModelRow[];
allModelCount: number;
rangeTotals: Record<string, TotalsRow>;
}