60 lines
1.3 KiB
TypeScript
60 lines
1.3 KiB
TypeScript
// Mirrors the Rust serde structs in src-tauri/src/{usage,settings,paths}.rs.
|
|
// Keep in lockstep — if you rename a field on one side, rename it here too.
|
|
|
|
export type ModelFamily = "opus" | "sonnet" | "haiku" | "other";
|
|
|
|
export interface ModelBreakdown {
|
|
opus: number;
|
|
sonnet: number;
|
|
haiku: number;
|
|
other: number;
|
|
}
|
|
|
|
export interface BlockSummary {
|
|
block_start: string; // ISO 8601
|
|
block_end: string;
|
|
now: string;
|
|
seconds_remaining: number;
|
|
total_tokens: number;
|
|
by_family: ModelBreakdown;
|
|
message_count: number;
|
|
}
|
|
|
|
export interface DayBucket {
|
|
date_local: string; // YYYY-MM-DD
|
|
total_tokens: number;
|
|
}
|
|
|
|
export interface WeeklySummary {
|
|
window_start: string;
|
|
window_end: string;
|
|
total_tokens: number;
|
|
by_day: DayBucket[]; // length 7, oldest-first
|
|
by_family: ModelBreakdown;
|
|
}
|
|
|
|
export interface Caps {
|
|
block_tokens: number;
|
|
weekly_tokens: number;
|
|
}
|
|
|
|
export interface UsageSnapshot {
|
|
block: BlockSummary | null;
|
|
weekly: WeeklySummary;
|
|
caps: Caps;
|
|
generated_at: string;
|
|
}
|
|
|
|
export interface Settings {
|
|
caps: Caps;
|
|
wsl_distro_override: string | null;
|
|
include_native: boolean;
|
|
window_pos: [number, number] | null;
|
|
autostart: boolean;
|
|
}
|
|
|
|
export interface ResolvedRoots {
|
|
roots: string[];
|
|
wsl_distro: string | null;
|
|
native_present: boolean;
|
|
}
|