Commit graph

90 commits

Author SHA1 Message Date
Christopher Sant
5cdcd2c2ee feat: add rolling 30-day window to menubar status
Add a '30 Days' section to the menubar format output, positioned between
'7 Days' and 'Month' to match the tab order in the interactive report.

The rolling 30-day date range logic already existed (used by report and
export commands) - this wires it into the status menubar renderer.

Both 30 Days (rolling window) and Month (calendar month) are shown,
giving useful context early in the month when the calendar month total
is nearly empty.
2026-04-15 21:48:20 -07:00
AgentSeal
475ab0da61 fix: case-insensitive Codex originator check
Codex Desktop on Windows uses "Codex Desktop" as the originator
string instead of "codex_cli" or "codex_vscode". The startsWith
check was case-sensitive, rejecting these sessions silently.

Fixes #1 (comment by @JiglioNero).
2026-04-15 16:06:28 -07:00
AgentSeal
7c7ab32865 0.5.2 2026-04-15 14:29:59 -07:00
AgentSeal
13acaa6d45 0.5.1 2026-04-15 14:29:41 -07:00
AgentSeal
e7e8273bb4 docs: add OpenCode to README 2026-04-15 14:28:49 -07:00
AgentSeal
2d114d9393 feat: add OpenCode provider
Reads session data from OpenCode's SQLite databases at
~/.local/share/opencode/. Reuses the existing better-sqlite3
adapter (same as Cursor), lazy-loaded so users without OpenCode
see no difference. Adds bashCommands to the provider interface
so shell command breakdowns work across all providers.

31 tests, schema validation, diagnostic stderr on failures.
Also fixes a pre-existing tsc error in currency.ts.
2026-04-15 14:24:37 -07:00
AgentSeal
3612c5a994 v0.5.0: Cursor IDE support, SQLite adapter, result caching
Major release adding Cursor as the third supported provider.
Lazy-loaded SQLite, file-based result cache, provider-specific
dashboard layouts, debounced period switching, broader classifier.
2026-04-15 05:48:22 -07:00
AgentSeal
0d1a51ed3c docs: add Cursor to README, repo description, and topics
- Cursor listed as supported provider with data location and caveats
- Auto mode pricing estimation explained
- Languages panel and cache behavior documented
- Project structure updated with new files
- Repo description and topics updated on GitHub
2026-04-15 05:46:25 -07:00
AgentSeal
2afab5f71a fix: final review cleanup
- Remove unused vi import from cursor test
- Move LANG_DISPLAY_NAMES to module scope (was re-created per render)
- Remove redundant 'script' regex (scrip?t already covers it)
- Unexport getDbFingerprint (internal to cache module)
- Move beforeEach inside describe block (only cursor tests need it)
2026-04-15 05:35:11 -07:00
AgentSeal
94762ca1f4 fix: address review findings before merge
- getProvider() now async, eliminates race condition with cursor loading
- cursor:edit pseudo-tool prevents inflating Claude's Edit count in --provider all
- Tightened SCRIPT_PATTERNS to avoid false positives (run requires file context)
- Removed duplicated LANG_NAMES from cursor.ts (dashboard handles display)
- Test no longer assumes cursor always loads (CI-safe)
- Removed unnecessary type assertion and setTimeout yield
2026-04-15 05:31:51 -07:00
AgentSeal
91edd6f14a chore: remove 120-day period, shrink Cursor lookback to 35 days
120 days was for testing. Max dashboard period is 30 days, so
Cursor SQL lookback is now 35 days (30 + margin for This Month).
Smaller scan window = faster cold starts, smaller cache file.
2026-04-15 05:24:34 -07:00
AgentSeal
3fabc105d8 perf: file-based result cache for Cursor DB
First run parses the 21GB DB (slow, ~40-80s). Writes parsed
results to ~/.cache/codeburn/cursor-results.json. Subsequent
runs check DB mtime+size -- if unchanged, load from cache
(instant). Cache auto-invalidates when Cursor modifies the DB.
2026-04-15 05:11:30 -07:00
AgentSeal
6ba3691d24 fix: broader activity classification for informal messages
- File extension patterns (.py, .json, .ts, etc.) trigger Coding
- Script/API keywords (run, script, api, query, etc.) trigger Coding
- URL patterns trigger Exploration
- HTTP status codes (404, 500) trigger Debugging
- "make a/me/the" and "write a/me/the" trigger Feature Dev
- Catches informal Cursor messages that missed strict patterns
2026-04-15 05:03:15 -07:00
AgentSeal
4597cbbd16 fix: combine user + assistant text for better activity classification 2026-04-15 05:00:39 -07:00
AgentSeal
effe5b2438 fix: map language IDs to readable names in Languages panel 2026-04-15 04:56:25 -07:00
AgentSeal
caa0464832 fix: strip lang: prefix in Languages panel display 2026-04-15 04:55:01 -07:00
AgentSeal
5c6c266c85 fix: improve Cursor activity classification and language panel
- Fetch actual user messages (type 1 bubbles) for keyword classification
  instead of using assistant response text
- Synthetic Edit tool when codeBlocks present so classifier detects coding
- Languages use lang: prefix to separate from tool classification
- Dashboard filters lang: entries for Languages panel, hides from Core Tools
2026-04-15 04:53:07 -07:00
AgentSeal
d6c6e827ea fix: clean language names, remove diagnostic scripts 2026-04-15 04:49:09 -07:00
AgentSeal
7b23fbb57b fix: pass provider to static dashboard for correct panel titles 2026-04-15 04:48:03 -07:00
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