Add Svelte 5 frontend (App, TitleBar, BlockRing, ModelStack, WeeklyBar, Settings)
This commit is contained in:
parent
14ffcf4bd3
commit
0e8a87fbc5
17 changed files with 779 additions and 0 deletions
60
src/types.ts
Normal file
60
src/types.ts
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
// 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue