Commit graph

71 commits

Author SHA1 Message Date
AgentSeal
11cdcaa89d feat: activity classification + language breakdown for Cursor
- Extract user text from bubbles for activity classifier
- Extract codeBlocks languageId for programming language breakdown
- Show Languages panel instead of Core Tools/Shell/MCP for Cursor
- Adaptive dashboard layout based on active provider
- 120-day daily activity range for longer periods
2026-04-15 04:46:12 -07:00
AgentSeal
ea5fd90a68 fix: remove incremental cache, always read full lookback window
The incremental cache saved a timestamp watermark but not the parsed
data, so subsequent runs found no new entries and returned empty.
Removed the cache layer entirely -- the 120-day SQL time filter
already limits the scan sufficiently.
2026-04-15 04:34:06 -07:00
AgentSeal
8120f1937f chore: add debug query script 2026-04-15 04:31:06 -07:00
AgentSeal
c7195c4a17 fix: handle ISO string timestamps from Cursor database
Cursor stores createdAt as ISO strings ('2026-02-23T06:00:51.123Z'),
not numeric timestamps. Was comparing string against number, so all
rows were filtered out. Now uses ISO string comparison throughout.
2026-04-15 04:17:56 -07:00
AgentSeal
f2999da15f fix: rename diagnostic script to .cjs 2026-04-15 04:15:12 -07:00
AgentSeal
0454e65fad chore: add timestamp diagnostic script 2026-04-15 04:09:59 -07:00
AgentSeal
5da6e772e4 feat: change 90-day period to 120 days 2026-04-15 04:05:12 -07:00
AgentSeal
76c9edd811 feat: debounce arrow key period switching (600ms)
Arrow keys now wait 600ms before loading data, so quickly
scrolling through periods (7d -> 30d -> 90d) skips intermediate
loads. Number keys (1-5) still load immediately.
2026-04-15 04:04:23 -07:00
AgentSeal
5ead1e9c07 perf: yield to event loop before heavy SQLite query
Adds a setTimeout(0) before parseBubbles so Ink can render
the Loading state before the synchronous query blocks.
2026-04-15 04:01:17 -07:00
AgentSeal
b7b7b2c7d6 perf: lazy-load cursor provider to eliminate startup overhead
Cursor module (sqlite.ts, better-sqlite3) now only loads when
cursor provider is actually requested. Claude/Codex startup
is unaffected -- cursor import never happens unless needed.
2026-04-15 03:59:49 -07:00
AgentSeal
3c439cb28f perf: remove provider pre-fetch on dashboard startup
The dashboard was pre-loading data for ALL detected providers
on startup, causing unnecessary SQLite scans when Cursor was
detected. Now only loads data for the active provider.
2026-04-15 03:56:21 -07:00
AgentSeal
2871af10e8 feat: add 90-day period option for testing Cursor data
Adds 90 Days tab (key: 4), shifts Month to key 5.
Available via --period 90days and interactive dashboard.
2026-04-15 03:55:23 -07:00
AgentSeal
dacebd6d3c perf: add 90-day time floor to Cursor SQL query
Instead of scanning all 300K+ rows on every load, only query
entries from the last 90 days. Eliminates the full table scan
that caused slow provider switching on large databases.
2026-04-15 03:51:11 -07:00
AgentSeal
70931b7269 feat: add Cursor IDE provider with SQLite adapter
Reads token usage from Cursor's local state.vscdb database.
Supports per-request input/output tokens, model tracking,
and incremental caching for large databases.

- better-sqlite3 as optionalDependency (lazy-loaded, no impact on Claude/Codex)
- Parameterized SQL queries, read-only mode, per-row error handling
- Schema detection with clear error on format changes
- Cache layer with timestamp watermark for incremental reads
- Provider colors and [p] key cycling in dashboard
- 39 tests passing, zero regressions
2026-04-15 03:44:43 -07:00
AgentSeal
b7b6c208bd fix: read version from package.json instead of hardcoding
Closes #35 (comment)
2026-04-15 02:26:17 -07:00
AgentSeal
83610e1a09 bump to 0.4.4: auto-refresh, readable project names, agent sessions, Codex cache fix 2026-04-15 01:42:31 -07:00
AgentSeal
4c07c52fc4
Merge pull request #36 from AgentSeal/fix/refresh-readme-changelog
feat: auto-refresh, updated README, changelog for 0.4.4
2026-04-15 10:41:40 +02:00
AgentSeal
81ec362d67 docs: changelog for 0.4.4 2026-04-15 01:40:48 -07:00
AgentSeal
d9e391be11 docs: update screenshot, add total downloads and install size badges, document --refresh flag 2026-04-15 01:40:48 -07:00
AgentSeal
d597d458f9 feat: auto-refresh dashboard, show 'home' for home dir sessions 2026-04-15 01:40:48 -07:00
AgentSeal
e75655e283
Merge pull request #34 from AgentSeal/fix/readable-project-names
feat: readable project names in dashboard
2026-04-15 10:10:43 +02:00
AgentSeal
c6c4979c06 feat: readable project names — strip home dir prefix, show ~ for home sessions 2026-04-15 01:09:18 -07:00
AgentSeal
3858006da0 bump to 0.4.3: menubar actions fix, stale comment cleanup 2026-04-15 00:35:31 -07:00
AgentSeal
5c7639b2fb fix: stale comment referencing removed config currency subcommand 2026-04-15 00:32:51 -07:00
mukunda katta
ad733fe596 fix(menubar): invoke binary directly + correct currency subcommand (#32, #27)
The two menubar action items were built as `bash -c "cd ~/codeburn &&
npx tsx src/cli.ts ..."`, which:

1. assumes a `~/codeburn` source checkout that npm-installed users
   don't have, and
2. interacts badly with how SwiftBar serialises `param2=` on long
   quoted strings — only the `cd` half ends up reaching `bash -c`,
   so the `npx tsx` fallback runs from `$HOME` and fails with
   `ERR_MODULE_NOT_FOUND: /Users/<u>/src/cli.ts`.

Replace with the resolved `${bin}` plus separate `paramN=` args,
which SwiftBar/xbar deliver as discrete argv entries — no shell
quoting, no checkout assumption.

While here, fix the currency submenu the same way: the items were
emitting `${bin} config currency XXX`, but the real CLI subcommand
defined in `src/cli.ts` is `codeburn currency [code]` (with
`--reset` for USD). The previous form silently failed on click.
That's #27.

Closes #32
Closes #27

Verified by running `npm run build` (clean) + `npm test -- --run`
(28/28 pass), and inspecting the rendered output of `codeburn status
--format menubar` to confirm the action lines now look like:

  Open Full Report | terminal=true shell=<bin> param1=report
  Export CSV to Desktop | terminal=false shell=<bin> param1=export param2=-o param3=<HOME>/Desktop/codeburn-report.csv
  --US Dollar (USD) * | terminal=false refresh=true shell=<bin> param1=currency param2=--reset
  --British Pound (GBP) | terminal=false refresh=true shell=<bin> param1=currency param2=GBP
2026-04-14 23:11:32 -07:00
AgentSeal
bd8ae2e971 bump to 0.4.2: agent sessions, Codex cache fix, responsive dashboard, CSV injection fix 2026-04-14 10:21:40 -07:00
AgentSeal
9f172416fd
Merge pull request #25 from AgentSeal/fix/include-agent-sessions
fix: include agent sessions, fix Codex cache hit
2026-04-14 19:19:35 +02:00
AgentSeal
51c56d0726 fix: include agent/subagent sessions, fix Codex cache hit and cost calculation
- Remove agent-*.jsonl exclusion filter that was dropping ~46% of API calls
- Scan subagents/ directories for subagent session files
- Normalize Codex token semantics: OpenAI includes cached tokens inside
  input_tokens, subtract them to match Anthropic's separate reporting
- Fixes cost double-counting and 100% cache hit display for Codex users
2026-04-14 10:18:14 -07:00
AgentSeal
ce2c1d2995 Merge branch 'fix/csv-formula-injection' 2026-04-14 09:39:03 -07:00
AgentSeal
186b672fdc docs: add external PR authorship rule to CLAUDE.md 2026-04-14 09:37:18 -07:00
AgentSeal
a7760e2f2a Merge branch 'feature/terminal-scaling-clean'
# Conflicts:
#	src/dashboard.tsx
2026-04-14 09:35:20 -07:00
AgentSeal
16f39e264e feat: responsive dashboard — dynamic reflow, wider cap, half-width panels
- Use Ink's useWindowSize() hook for reactive terminal reflow (PR #18)
- Raise width cap from 104 to 160 columns for wide screens
- Move Activity panel from full-width to half-width row with Model panel
- Pair Tool + Bash panels, MCP goes full-width at bottom
- Addresses issue #23 (UI responsiveness)
2026-04-14 09:15:37 -07:00
AgentSeal
d2560d7ad8 bump to 0.4.1: multi-currency support, 30-day rolling window 2026-04-14 09:06:35 -07:00
AgentSeal
9ca866fe43 chore: harden gitignore and add commit hygiene rules 2026-04-14 09:03:23 -07:00
AgentSeal
fc7387f427 docs: add branching strategy and PR workflow to CLAUDE.md 2026-04-14 09:00:25 -07:00
AgentSeal
fb18a79779 docs: update README for Codex support, provider system, currency command 2026-04-14 08:52:26 -07:00
AgentSeal
40d04261d6 cleanup: strip TUI picker, promote currency command, remove verbose comments
- Remove CurrencyPicker component and all related state from dashboard
- Promote 'codeburn config currency' to top-level 'codeburn currency'
- Strip JSDoc comments that explain WHAT not WHY
- Remove forceRender hack and unused imports
2026-04-14 08:47:45 -07:00
AgentSeal
9ab7f37f6f Fix CSV formula injection in exports 2026-04-14 11:04:10 -04:00
BlairWelsh
f08f97cd3d feat: add interactive currency picker to dashboard
Press c in the dashboard to open a searchable currency picker modal.
Type to filter, arrow keys to navigate, enter to select, escape to
cancel. Shows 24 common currencies with the active one marked, and
accepts any valid ISO 4217 code typed directly.

Session-only switch -- does not write to config, so users can quickly
compare costs in different currencies without changing their default.
2026-04-14 14:09:39 +01:00
BlairWelsh
d322d9b837 docs: mention menubar currency picker in README 2026-04-14 13:51:12 +01:00
BlairWelsh
df69c2aadf feat: add currency picker to menubar plugin
Adds a Currency submenu to the SwiftBar/xbar dropdown with 16 common
currencies. Clicking one runs codeburn config currency and refreshes
the plugin. Active currency is marked with *.

The full 162 ISO 4217 currencies are available via the CLI for any
not listed in the menubar.
2026-04-14 13:51:11 +01:00
BlairWelsh
d248f0d6df docs: add Currency section to README 2026-04-14 13:51:11 +01:00
BlairWelsh
85304dbe30 feat: add multi-currency support
Display costs in any of 162 ISO 4217 currencies. Exchange rates are
fetched from frankfurter.app (ECB-backed, free, no API key) and cached
for 24h alongside the existing LiteLLM pricing cache.

Currency symbols and decimal rules come from Node's built-in Intl API
rather than hardcoded tables.

New command: codeburn config currency <code>
Reset: codeburn config currency --reset

Config stored at ~/.config/codeburn/config.json.
All internal calculations remain in USD -- conversion is display-only.
2026-04-14 13:51:11 +01:00
Ale Bles
79d4f86c30 feat: dynamic terminal width, reflows on terminal size change
fix: move useWindowSize() out of plain function into calling components
2026-04-14 14:46:19 +02:00
AgentSeal
efab93e78e cleanup: use Period type instead of inline union in renderDashboard 2026-04-14 04:58:47 -07:00
AgentSeal
bbaf71431d
Merge pull request #14 from oysteinkrog/feat/30days-period
feat: add 30-day rolling window period
2026-04-14 13:58:14 +02:00
Øystein Krog
f66afc893d feat: add 30-day rolling window period
Add a '30days' period that shows the last 30 days of usage data, distinct
from 'month' which shows the current calendar month.

- New period available via `--period 30days` and keyboard shortcut `3`
- Dashboard cycles: Today > 7 Days > 30 Days > This Month
- Fix export command to use actual 30-day range instead of calendar month
  for the '30 Days' export label
2026-04-14 13:51:06 +02:00
AgentSeal
25bd54404c bump to 0.4.0: multi-provider support (Codex, provider plugin system) 2026-04-14 04:35:51 -07:00
AgentSeal
391a235d1d feat: multi-provider support (Codex + provider plugin system)
Add Codex (OpenAI) as a second provider alongside Claude Code. Provider
plugin architecture makes adding future providers (Pi, OpenCode, Amp) a
single-file addition.

- Provider interface: types, session discovery, stateful JSONL parsing
- Codex parser: token_count dedup, tool normalization, model resolution
- TUI: press p to cycle All/Claude/Codex with 1-min cache for instant switching
- CLI: --provider flag on report, today, month, status, export commands
- Pricing: Codex model fallbacks, fixed fuzzy matching for gpt-5.4-mini
- Menubar: per-provider cost breakdown when multiple providers detected
- 27 tests (10 new: Codex parser, provider registry, tool/model mapping)
2026-04-14 04:32:09 -07:00
AgentSeal
b2b405aabb fix: require Node 20+ (string-width uses /v regex flag) 2026-04-14 01:57:15 -07:00