-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
57 lines (48 loc) · 2.46 KB
/
types.go
File metadata and controls
57 lines (48 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package main
// ─── Types ─────────────────────────────────────────────────────────────────
// InputData is the JSON payload piped to stdin by Claude Code.
type InputData struct {
Version string `json:"version"`
SessionID string `json:"session_id"`
TranscriptPath string `json:"transcript_path"`
Model *ModelInfo `json:"model"`
ContextWindow *ContextWindowData `json:"context_window"`
}
// ModelInfo holds model display name.
type ModelInfo struct {
DisplayName string `json:"display_name"`
}
// ContextWindowData holds context usage statistics.
type ContextWindowData struct {
TotalInputTokens *int `json:"total_input_tokens"`
TotalOutputTokens *int `json:"total_output_tokens"`
TotalCacheCreationInputTokens *int `json:"total_cache_creation_input_tokens"`
TotalCacheReadInputTokens *int `json:"total_cache_read_input_tokens"`
ContextWindowSize *int `json:"context_window_size"`
RemainingPercentage *float64 `json:"remaining_percentage"`
UsedPercentage *float64 `json:"used_percentage"`
CurrentUsage *CurrentUsage `json:"current_usage"`
}
// CurrentUsage holds per-turn token counts.
type CurrentUsage struct {
InputTokens int `json:"input_tokens"`
OutputTokens int `json:"output_tokens"`
CacheCreationInputTokens int `json:"cache_creation_input_tokens"`
CacheReadInputTokens int `json:"cache_read_input_tokens"`
}
// ProjectInfo holds detected project badge and version for status bar rendering.
// Intentionally separate from hooks/session.go's ProjectInfo — different fields
// (Badge+Version here vs Type+Emoji there), no JSON tags, no shared behavior.
type ProjectInfo struct {
Badge string
Version string
}
// ─── Health Types ──────────────────────────────────────────────────────────
// ContextHealth represents context window health level.
type ContextHealth int
const (
HealthGreen ContextHealth = iota // >25% remaining
HealthYellow // 10-25% remaining
HealthRed // <10% remaining
HealthNone // no data available
)