Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResetVersionCache ¶ added in v0.49.0
func ResetVersionCache()
ResetVersionCache clears the cached version check result. Exposed for testing only.
Types ¶
type Usage ¶
type Usage struct {
OutputTokens int64 `json:"total_output_tokens,omitempty"`
PeakContextTokens int64 `json:"peak_context_tokens,omitempty"`
}
Usage holds token consumption data for a single review job. Stored as JSON in the review_jobs.token_usage column. Fields align with agentsview's token-use output.
func FetchForSession ¶
FetchForSession calls `agentsview token-use <sessionID>` to get token usage. Returns nil (no error) if agentsview is not installed, is too old (< 0.15.0), or the session data is unavailable.
func ParseJSON ¶
ParseJSON deserializes a token_usage JSON blob from the database. Returns nil for empty/null values.
func (Usage) FormatSummary ¶
FormatSummary returns a compact human-readable summary like "118.0k ctx · 28.8k out". Returns empty string if no data.