diff --git a/cmd/config_cmd.go b/cmd/config_cmd.go index b04cc61..8d6e4a5 100644 --- a/cmd/config_cmd.go +++ b/cmd/config_cmd.go @@ -4,7 +4,7 @@ package cmd import ( "fmt" - "cburn/internal/config" + "github.com/theirongolddev/cburn/internal/config" "github.com/spf13/cobra" ) diff --git a/cmd/daily.go b/cmd/daily.go index a858199..3fc1c1f 100644 --- a/cmd/daily.go +++ b/cmd/daily.go @@ -3,8 +3,8 @@ package cmd import ( "fmt" - "cburn/internal/cli" - "cburn/internal/pipeline" + "github.com/theirongolddev/cburn/internal/cli" + "github.com/theirongolddev/cburn/internal/pipeline" "github.com/spf13/cobra" ) diff --git a/cmd/hourly.go b/cmd/hourly.go index 6225535..b11f1fa 100644 --- a/cmd/hourly.go +++ b/cmd/hourly.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "cburn/internal/cli" - "cburn/internal/pipeline" + "github.com/theirongolddev/cburn/internal/cli" + "github.com/theirongolddev/cburn/internal/pipeline" "github.com/spf13/cobra" ) diff --git a/cmd/models.go b/cmd/models.go index 4389ba0..deee892 100644 --- a/cmd/models.go +++ b/cmd/models.go @@ -3,8 +3,8 @@ package cmd import ( "fmt" - "cburn/internal/cli" - "cburn/internal/pipeline" + "github.com/theirongolddev/cburn/internal/cli" + "github.com/theirongolddev/cburn/internal/pipeline" "github.com/spf13/cobra" ) diff --git a/cmd/projects.go b/cmd/projects.go index 21efba4..61a6ebe 100644 --- a/cmd/projects.go +++ b/cmd/projects.go @@ -3,8 +3,8 @@ package cmd import ( "fmt" - "cburn/internal/cli" - "cburn/internal/pipeline" + "github.com/theirongolddev/cburn/internal/cli" + "github.com/theirongolddev/cburn/internal/pipeline" "github.com/spf13/cobra" ) diff --git a/cmd/root.go b/cmd/root.go index 2d345a0..bb98db8 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -6,10 +6,10 @@ import ( "path/filepath" "time" - "cburn/internal/cli" - "cburn/internal/model" - "cburn/internal/pipeline" - "cburn/internal/store" + "github.com/theirongolddev/cburn/internal/cli" + "github.com/theirongolddev/cburn/internal/model" + "github.com/theirongolddev/cburn/internal/pipeline" + "github.com/theirongolddev/cburn/internal/store" "github.com/spf13/cobra" ) diff --git a/cmd/sessions.go b/cmd/sessions.go index 2bb6e98..d82436b 100644 --- a/cmd/sessions.go +++ b/cmd/sessions.go @@ -4,8 +4,8 @@ import ( "fmt" "sort" - "cburn/internal/cli" - "cburn/internal/pipeline" + "github.com/theirongolddev/cburn/internal/cli" + "github.com/theirongolddev/cburn/internal/pipeline" "github.com/spf13/cobra" ) diff --git a/cmd/setup.go b/cmd/setup.go index 6d423ea..3bd170c 100644 --- a/cmd/setup.go +++ b/cmd/setup.go @@ -5,9 +5,9 @@ import ( "fmt" "strings" - "cburn/internal/config" - "cburn/internal/source" - "cburn/internal/tui/theme" + "github.com/theirongolddev/cburn/internal/config" + "github.com/theirongolddev/cburn/internal/source" + "github.com/theirongolddev/cburn/internal/tui/theme" "github.com/charmbracelet/huh" "github.com/spf13/cobra" diff --git a/cmd/status.go b/cmd/status.go index be671f9..182adc9 100644 --- a/cmd/status.go +++ b/cmd/status.go @@ -8,9 +8,9 @@ import ( "strings" "time" - "cburn/internal/claudeai" - "cburn/internal/cli" - "cburn/internal/config" + "github.com/theirongolddev/cburn/internal/claudeai" + "github.com/theirongolddev/cburn/internal/cli" + "github.com/theirongolddev/cburn/internal/config" "github.com/charmbracelet/lipgloss" "github.com/spf13/cobra" diff --git a/cmd/summary.go b/cmd/summary.go index 122fe23..1ca233f 100644 --- a/cmd/summary.go +++ b/cmd/summary.go @@ -4,8 +4,8 @@ import ( "fmt" "os" - "cburn/internal/cli" - "cburn/internal/pipeline" + "github.com/theirongolddev/cburn/internal/cli" + "github.com/theirongolddev/cburn/internal/pipeline" "github.com/spf13/cobra" ) diff --git a/cmd/tui.go b/cmd/tui.go index 96f080a..b666dfb 100644 --- a/cmd/tui.go +++ b/cmd/tui.go @@ -3,9 +3,9 @@ package cmd import ( "fmt" - "cburn/internal/config" - "cburn/internal/tui" - "cburn/internal/tui/theme" + "github.com/theirongolddev/cburn/internal/config" + "github.com/theirongolddev/cburn/internal/tui" + "github.com/theirongolddev/cburn/internal/tui/theme" tea "github.com/charmbracelet/bubbletea" "github.com/spf13/cobra" diff --git a/go.mod b/go.mod index 09d4bcd..3eb7912 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module cburn +module github.com/theirongolddev/cburn go 1.24.2 diff --git a/internal/claudeai/client.go b/internal/claudeai/client.go index e384c1c..3678a61 100644 --- a/internal/claudeai/client.go +++ b/internal/claudeai/client.go @@ -148,7 +148,7 @@ func (c *Client) get(ctx context.Context, path string) ([]byte, error) { req.Header.Set("Cookie", "sessionKey="+c.sessionKey) req.Header.Set("Accept", "application/json") - req.Header.Set("User-Agent", "cburn/1.0") + req.Header.Set("User-Agent", "github.com/theirongolddev/cburn/1.0") //nolint:gosec // URL is constructed from const baseURL resp, err := c.http.Do(req) diff --git a/internal/pipeline/aggregator.go b/internal/pipeline/aggregator.go index b10f5f3..94beefd 100644 --- a/internal/pipeline/aggregator.go +++ b/internal/pipeline/aggregator.go @@ -6,8 +6,8 @@ import ( "strings" "time" - "cburn/internal/config" - "cburn/internal/model" + "github.com/theirongolddev/cburn/internal/config" + "github.com/theirongolddev/cburn/internal/model" ) // Aggregate computes summary statistics from a slice of session stats, @@ -51,7 +51,7 @@ func Aggregate(sessions []model.SessionStats, since, until time.Time) model.Summ // Cache savings (sum across all models found in sessions) for _, s := range filtered { for modelName, mu := range s.Models { - stats.CacheSavings += config.CalculateCacheSavings(modelName, mu.CacheReadTokens) + stats.CacheSavings += config.CalculateCacheSavingsAt(modelName, s.StartTime, mu.CacheReadTokens) } } diff --git a/internal/pipeline/bench_test.go b/internal/pipeline/bench_test.go index d84669d..fea0288 100644 --- a/internal/pipeline/bench_test.go +++ b/internal/pipeline/bench_test.go @@ -5,8 +5,8 @@ import ( "path/filepath" "testing" - "cburn/internal/source" - "cburn/internal/store" + "github.com/theirongolddev/cburn/internal/source" + "github.com/theirongolddev/cburn/internal/store" ) func BenchmarkLoad(b *testing.B) { diff --git a/internal/pipeline/incremental.go b/internal/pipeline/incremental.go index 35fa7b2..b6cd59a 100644 --- a/internal/pipeline/incremental.go +++ b/internal/pipeline/incremental.go @@ -8,8 +8,8 @@ import ( "sync" "sync/atomic" - "cburn/internal/source" - "cburn/internal/store" + "github.com/theirongolddev/cburn/internal/source" + "github.com/theirongolddev/cburn/internal/store" ) // CachedLoadResult extends LoadResult with cache metadata. @@ -173,5 +173,6 @@ func CacheDir() string { // CachePath returns the full path to the cache database. func CachePath() string { - return filepath.Join(CacheDir(), "metrics.db") + // v2 includes historical pricing-aware cost calculations. + return filepath.Join(CacheDir(), "metrics_v2.db") } diff --git a/internal/pipeline/loader.go b/internal/pipeline/loader.go index 85b78a1..d469efb 100644 --- a/internal/pipeline/loader.go +++ b/internal/pipeline/loader.go @@ -6,8 +6,8 @@ import ( "sync" "sync/atomic" - "cburn/internal/model" - "cburn/internal/source" + "github.com/theirongolddev/cburn/internal/model" + "github.com/theirongolddev/cburn/internal/source" ) // LoadResult holds the output of the full data loading pipeline. diff --git a/internal/source/parser.go b/internal/source/parser.go index b50cca1..37dfcda 100644 --- a/internal/source/parser.go +++ b/internal/source/parser.go @@ -8,8 +8,8 @@ import ( "os" "time" - "cburn/internal/config" - "cburn/internal/model" + "github.com/theirongolddev/cburn/internal/config" + "github.com/theirongolddev/cburn/internal/model" ) // Byte patterns for field extraction. @@ -173,8 +173,9 @@ func ParseFile(df DiscoveredFile) ParseResult { } for _, call := range calls { - call.EstimatedCost = config.CalculateCost( + call.EstimatedCost = config.CalculateCostAt( call.Model, + call.Timestamp, call.InputTokens, call.OutputTokens, call.CacheCreation5mTokens, diff --git a/internal/store/cache.go b/internal/store/cache.go index 55a91ee..d733df1 100644 --- a/internal/store/cache.go +++ b/internal/store/cache.go @@ -8,7 +8,7 @@ import ( "path/filepath" "time" - "cburn/internal/model" + "github.com/theirongolddev/cburn/internal/model" _ "modernc.org/sqlite" // register sqlite driver ) diff --git a/internal/tui/components/card.go b/internal/tui/components/card.go index 755d366..d7fa125 100644 --- a/internal/tui/components/card.go +++ b/internal/tui/components/card.go @@ -2,7 +2,7 @@ package components import ( - "cburn/internal/tui/theme" + "github.com/theirongolddev/cburn/internal/tui/theme" "github.com/charmbracelet/lipgloss" ) diff --git a/internal/tui/components/chart.go b/internal/tui/components/chart.go index bdab429..2981f62 100644 --- a/internal/tui/components/chart.go +++ b/internal/tui/components/chart.go @@ -5,7 +5,7 @@ import ( "math" "strings" - "cburn/internal/tui/theme" + "github.com/theirongolddev/cburn/internal/tui/theme" "github.com/charmbracelet/lipgloss" ) diff --git a/internal/tui/components/progress.go b/internal/tui/components/progress.go index 55e3b3e..39ece5b 100644 --- a/internal/tui/components/progress.go +++ b/internal/tui/components/progress.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "cburn/internal/tui/theme" + "github.com/theirongolddev/cburn/internal/tui/theme" "github.com/charmbracelet/bubbles/progress" "github.com/charmbracelet/lipgloss" diff --git a/internal/tui/components/statusbar.go b/internal/tui/components/statusbar.go index 88967c1..9323deb 100644 --- a/internal/tui/components/statusbar.go +++ b/internal/tui/components/statusbar.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "cburn/internal/claudeai" - "cburn/internal/tui/theme" + "github.com/theirongolddev/cburn/internal/claudeai" + "github.com/theirongolddev/cburn/internal/tui/theme" "github.com/charmbracelet/bubbles/progress" "github.com/charmbracelet/lipgloss" diff --git a/internal/tui/components/tabbar.go b/internal/tui/components/tabbar.go index 63b943f..3fee4fd 100644 --- a/internal/tui/components/tabbar.go +++ b/internal/tui/components/tabbar.go @@ -3,7 +3,7 @@ package components import ( "strings" - "cburn/internal/tui/theme" + "github.com/theirongolddev/cburn/internal/tui/theme" "github.com/charmbracelet/lipgloss" ) diff --git a/internal/tui/setup.go b/internal/tui/setup.go index ce054f4..48f2f4d 100644 --- a/internal/tui/setup.go +++ b/internal/tui/setup.go @@ -3,8 +3,8 @@ package tui import ( "fmt" - "cburn/internal/config" - "cburn/internal/tui/theme" + "github.com/theirongolddev/cburn/internal/config" + "github.com/theirongolddev/cburn/internal/tui/theme" "github.com/charmbracelet/huh" ) diff --git a/internal/tui/tab_breakdown.go b/internal/tui/tab_breakdown.go index 6554b53..429e38b 100644 --- a/internal/tui/tab_breakdown.go +++ b/internal/tui/tab_breakdown.go @@ -4,9 +4,9 @@ import ( "fmt" "strings" - "cburn/internal/cli" - "cburn/internal/tui/components" - "cburn/internal/tui/theme" + "github.com/theirongolddev/cburn/internal/cli" + "github.com/theirongolddev/cburn/internal/tui/components" + "github.com/theirongolddev/cburn/internal/tui/theme" "github.com/charmbracelet/lipgloss" ) diff --git a/internal/tui/tab_overview.go b/internal/tui/tab_overview.go index 930c301..beecd4d 100644 --- a/internal/tui/tab_overview.go +++ b/internal/tui/tab_overview.go @@ -5,10 +5,10 @@ import ( "strings" "time" - "cburn/internal/cli" - "cburn/internal/pipeline" - "cburn/internal/tui/components" - "cburn/internal/tui/theme" + "github.com/theirongolddev/cburn/internal/cli" + "github.com/theirongolddev/cburn/internal/pipeline" + "github.com/theirongolddev/cburn/internal/tui/components" + "github.com/theirongolddev/cburn/internal/tui/theme" "github.com/charmbracelet/lipgloss" ) diff --git a/internal/tui/tab_settings.go b/internal/tui/tab_settings.go index 204e339..db5ee80 100644 --- a/internal/tui/tab_settings.go +++ b/internal/tui/tab_settings.go @@ -6,10 +6,10 @@ import ( "strings" "time" - "cburn/internal/cli" - "cburn/internal/config" - "cburn/internal/tui/components" - "cburn/internal/tui/theme" + "github.com/theirongolddev/cburn/internal/cli" + "github.com/theirongolddev/cburn/internal/config" + "github.com/theirongolddev/cburn/internal/tui/components" + "github.com/theirongolddev/cburn/internal/tui/theme" "github.com/charmbracelet/bubbles/textinput" tea "github.com/charmbracelet/bubbletea" diff --git a/main.go b/main.go index ebefdd7..ed68bb6 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,7 @@ // cburn analyzes Claude Code usage from local JSONL session logs. package main -import "cburn/cmd" +import "github.com/theirongolddev/cburn/cmd" func main() { cmd.Execute()