Commit graph

434 commits

Author SHA1 Message Date
iamtoruk
7501aee130 Add Goose and Antigravity providers to README, bump provider count to 18 2026-05-03 12:14:35 -07:00
iamtoruk
6dbd25ce55 Bump version to 0.9.6 2026-05-03 12:12:56 -07:00
iamtoruk
988398abfc Fix $0.0000 display for near-zero costs
Closes #205
2026-05-03 12:11:10 -07:00
iamtoruk
6702d55345 Fix menubar provider view showing $0.00 after idle and refresh race condition
CLI timeout increased from 20s to 45s to handle cold file-cache latency on
provider-specific queries. Loading overlay now appears when the all-provider
payload confirms a provider has spend but its dedicated data hasn't loaded yet.
Manual refresh (force: true) bypasses the in-flight guard so users can always
re-fetch. Tab strip prefers the provider-specific payload cost when available
so it stays in sync with the hero section.
2026-05-03 12:00:03 -07:00
AgentSeal
8cf68e7a16 Fix Antigravity dedup collision and add Codex ChatGPT Plus token estimation (#204)
- Antigravity: use loop index as fallback when responseId is empty to prevent
  all entries in a cascade sharing the same dedup key; bump CACHE_VERSION to
  force re-parse of stale cached data
- Codex: estimate tokens from message text when info is null (ChatGPT Plus/Pro
  subscription sessions), feeding through calculateCost so subscription users
  see API-equivalent spend; add costIsEstimated flag to ParsedProviderCall
- Update LiteLLM pricing snapshot
2026-05-03 19:51:13 +02:00
Resham Joshi
95585febf4
Merge pull request #201 from getagentseal/fix/streaming-dedup
Some checks are pending
CI / semgrep (push) Waiting to run
Fix streaming dedup: keep last message.id occurrence for accurate tokens and tools
2026-05-02 22:30:48 -07:00
iamtoruk
800c106250 Fix streaming dedup: keep last occurrence of each message.id within session files
Claude Code writes the same message.id multiple times during streaming.
The first write has partial tokens (often 1) and no tool_use blocks.
The last write has authoritative token counts and all tool_use/MCP blocks.

Old behavior kept the first occurrence (keep-first), silently dropping
real output tokens (+6.3% undercount) and all MCP tool calls.

New behavior keeps the last occurrence's content but preserves the first
occurrence's timestamp for correct date bucketing.

Validated against 21,390 real session files: 40.5% had duplicate IDs,
output tokens were understated by up to 78% per session.
2026-05-02 22:30:17 -07:00
iamtoruk
341aa46f78 Strip ANSI escapes from bash commands across all providers
Use strip-ansi (already in dep tree via Ink) in extractBashCommands
to prevent terminal escape codes from leaking into dashboard bash
breakdown keys. Route goose, gemini, qwen, and openclaw through
extractBashCommands instead of inline split, which also gives them
multi-command extraction (matching claude/codex/droid behavior).
2026-05-02 20:59:24 -07:00
iamtoruk
292265bf47 Add deno dx as a run method 2026-05-02 20:31:27 -07:00
iamtoruk
fe1007cc63 Add missing Antigravity model aliases for gemini-3-pro, flash-image, flash-lite 2026-05-02 20:26:45 -07:00
Resham Joshi
f5b66861f7
Merge pull request #199 from NihalJain/fix_Antigravity
Good catch on the Antigravity model aliases
2026-05-02 20:26:05 -07:00
Nihal Jain
73cf90cb2c Add Antigravity Gemini model IDs with preview pricing aliases 2026-05-03 05:46:33 +05:30
iamtoruk
87b660e584 Fix hardcoded $ in forecast comparison text
Some checks are pending
CI / semgrep (push) Waiting to run
The "vs last month" line in the forecast section used a hardcoded $
instead of the user's selected currency symbol and rate. Use
asCompactCurrency() which handles both.

Closes #197
2026-05-02 16:16:43 -07:00
iamtoruk
c511627e87 Fix dashboard hang and ExperimentalWarning on Windows
Strip Ink v7 DEC mode 2026 synchronized output markers (BSU/ESU) on
Windows. ConPTY does not implement this protocol and buffers
indefinitely, causing the dashboard to hang with no output. The patch
intercepts standalone BSU/ESU writes on stdout while preserving full
interactivity (keyboard, live refresh, cursor management).

Fix ExperimentalWarning timing: the process.emit patch was restored
synchronously in the finally block, but Node defers the warning via
process.nextTick. Delay restore by one tick so the patch is still
active when the warning fires.

Closes #195
2026-05-02 11:54:58 -07:00
Resham Joshi
db993196cf
Fix menubar ghost status item on macOS Tahoe
Set accessory activation policy in willFinishLaunching before the
focus chain forms. Debounce observation tracking to coalesce rapid
property changes into a single status bar refresh.
2026-05-02 10:14:14 -07:00
Resham Joshi
3ea4a62408
Add Goose provider, fix Codex fork dedup
Some checks are pending
CI / semgrep (push) Waiting to run
Goose: read token usage from ~/.local/share/goose/sessions/sessions.db.
Lazy-loaded, zero overhead for non-Goose users.

Codex: use sessionId instead of file path in dedup key so forked
sessions sharing the same session_id don't double-count tokens.
2026-05-02 09:58:52 -07:00
Resham Joshi
8c845253c2
Add Antigravity IDE provider
Fetch token usage from Antigravity's local language server via RPC.
Falls back to cached results when the IDE is closed.
2026-05-02 08:58:23 -07:00
Nihal Jain
791f2b077d
Add gpt-5.5 model display name for Codex 2026-05-02 08:57:44 -07:00
Resham Joshi
110a1f506d
Merge pull request #189 from ozymandiashh/fix/codex-large-session-meta-buffer
Some checks are pending
CI / semgrep (push) Waiting to run
fix(codex): read complete session_meta line during discovery
2026-05-01 17:32:55 -07:00
ozymandiashh
ffe14fecb7 review: silence stream errors and tighten comment wording
- Attach a no-op `stream.on('error', () => {})` so a late read-ahead
  error that races with a successful first-line yield can never escape
  as an unhandled 'error' event. Defense in depth: empirically the
  destroy() in finally already swallows it on Node 18+, but the listener
  removes any version-dependent surprise.
- Tighten the comment to say "up to FIRST_LINE_READ_CAP" instead of
  "regardless of length"; the cap is real and worth being precise about.
2026-05-02 02:38:36 +03:00
ozymandiashh
ff8b20a79e review: drop streamError flag, add multi-chunk and torn-write tests
- Stop tracking a separate streamError flag. createReadStream's default
  64 KiB highWaterMark means the stream may already be reading chunk 2
  when we break out of the loop after yielding the first line; if that
  later chunk errors, the flag could reject an otherwise-valid line.
  readline's async iterator already re-throws stream errors on Node 16+,
  which the existing catch handles.
- Test: 120 KB session_meta line forces multi-chunk line assembly.
- Test: truncated mid-write first line is rejected, not parsed as half
  an object.
2026-05-02 02:34:41 +03:00
ozymandiashh
98bbe5b678 review: cap first-line read size and add edge-case tests
- Cap createReadStream at 1 MiB so a malformed file with no newline
  cannot make readline buffer indefinitely (real session_meta lines
  are 22-27 KB).
- Capture stream errors explicitly; readline's async iterator does
  not always re-throw underlying stream errors per Node docs.
- Test: assert project is extracted from the >16 KB session_meta to
  prove the line was actually parsed, not just discovered.
- Test: session_meta line with no trailing newline is still accepted.
- Test: empty rollout file is silently skipped.
2026-05-02 02:30:17 +03:00
ozymandiashh
945da9f0ba fix(codex): read full first line for session validation
`readFirstLine` allocated a fixed 16 KB buffer, but Codex CLI 0.128+
embeds the entire base_instructions / system prompt in the
`session_meta` line, pushing it past 20 KB. When the buffer doesn't
catch a newline, `isValidCodexSession` rejects the session, so every
recent Codex session is silently excluded from totals.

Switch to a streaming readline read so the first line is captured
regardless of length, and add a regression test that creates a
40 KB session_meta payload.

Locally, this changes my 30-day Codex total from €267 (only ~half
of sessions parsed) to €878 (all sessions parsed).
2026-05-02 02:17:53 +03:00
iamtoruk
033da415c5 Bump version to 0.9.5
Some checks are pending
CI / semgrep (push) Waiting to run
2026-05-01 08:16:14 -07:00
Resham Joshi
ffc0e486d3
Merge pull request #188 from getagentseal/feat/menubar-hardening
Harden menubar: refresh loop, concurrency, data sync, edge cases
2026-05-01 08:03:03 -07:00
iamtoruk
39fc05595c Harden menubar: fix refresh loop, concurrency, data sync, and edge cases
- Fix refresh loop: proper while loop with 30s sleep and force:true
  instead of single-fire Task that never repeated
- Fix loading overlay: counter-based isLoading so concurrent fetches
  don't flicker the overlay on/off
- Fix rapid tab switching: cancel previous switchTask, check
  Task.isCancelled after CLI returns to discard stale results
- Fix tab strip vs hero desync: fetch provider-specific and all-provider
  data in parallel so costs arrive from same data snapshot
- Fix stale menubar icon after wake: forceRefresh now fetches today/all
  in parallel alongside the current selection
- Fix accent color: ThemeState is now @Observable so color changes
  propagate via observation, removing .id() view hierarchy teardown
- Fix currency flash: defer store.currency and symbol update until a
  rate is available so symbol and rate apply atomically
- Fix export: terminationHandler instead of waitUntilExit (no UI freeze),
  HHmmss in filename to prevent overwrite on double-export
- Fix CurrencyState: @MainActor isolation with proper Sendable
  conformance, nonisolated on pure static functions
- Fix streak count: iterate calendar days instead of sparse history
  entries so gaps are counted as streak-breakers
- Fix TrendBar identity: stable date-based id instead of UUID
- Add GPT-5.3 and DeepSeek model display names
2026-05-01 08:01:25 -07:00
Resham Joshi
bbe99fa298
Merge pull request #180 from josteinaj/locate-workspaceStorage-in-vscode-dev-container
Some checks are pending
CI / semgrep (push) Waiting to run
VSCode: correctly locate workspaceStorage when working inside a dev container
2026-04-30 18:41:20 -07:00
Resham Joshi
78ad04c77f
Merge pull request #186 from getagentseal/fix/menubar-timezone-184
Fix timezone handling for non-UTC users
2026-04-30 17:33:27 -07:00
iamtoruk
68c6f2c710 Fix timezone handling: menubar UTC bugs, --timezone flag, DST-safe dates
Three fixes for issue #184:

1. Menubar Swift code used UTC instead of local timezone in two places:
   computeHistoryStats hardcoded TimeZone("UTC") and
   effectiveTokensInLast7Days used ISO8601DateFormatter (UTC default).
   Both now use .current to match CLI-produced local date keys.

2. Add --timezone flag and CODEBURN_TZ env var to override the system
   timezone for all date grouping. Sets process.env.TZ before any Date
   operations so all existing local-timezone code works unchanged.

3. Replace MS_PER_DAY arithmetic with Date constructor day-of-month
   math for yesterday/backfill computations. Subtracting 86400000ms
   from midnight skips a day on DST spring-forward (23-hour day).

Fixes #184
2026-04-30 17:33:02 -07:00
Resham Joshi
7ceef6b464
Merge pull request #185 from getagentseal/feat/codex-result-cache
Some checks are pending
CI / semgrep (push) Waiting to run
Add per-file result cache for Codex provider
2026-04-30 16:44:26 -07:00
iamtoruk
8ab9ea916b Add per-file result cache for Codex provider
Fixes #183. Users with large Codex session directories (45 GB, 10K+
files) experienced CPU pegging because every 30-second refresh re-parsed
all session files from scratch.

Three optimizations:

1. readFirstLine now reads 16 KB via fs.open() instead of loading the
   entire file through readSessionFile. Cuts discovery I/O from ~45 GB
   to ~160 MB for 10K files.

2. Per-file result cache (codex-results.json) with mtime+size
   fingerprinting. Parsed results are cached on first run; subsequent
   runs return cached data instantly for unchanged files.

3. Cache-accelerated discovery skips header validation for cached files,
   pulling the project name directly from the cache manifest.

Cache safety: fingerprint captured before read (no TOCTOU), atomic
write via temp+fsync+rename, 0o600 permissions, Object.hasOwn for
prototype pollution defense, eviction of deleted files on flush,
try/finally ensures flush even on parse errors.
2026-04-30 16:43:41 -07:00
Jostein Austvik Jacobsen
2de8909823
locate workspaceStorage in vscode dev container 2026-04-30 22:51:52 +02:00
iamtoruk
f35400f199 Fix menubar refresh stuck after first load (#179)
forceRefresh() was missing force:true, so the cache TTL guard
silently skipped every LaunchAgent and wake-triggered refresh.
Also adds right-click context menu and version label in footer.
2026-04-30 09:22:38 -07:00
Resham Joshi
78aa6fc534
Merge pull request #181 from davidg-h/fix/copilot-vscode-insiders-integration
Some checks are pending
CI / semgrep (push) Waiting to run
fix(copilot): discover VS Code Insiders transcripts
2026-04-30 07:53:57 -07:00
David
116388427e fix(copilot): discover VS Code Insiders transcripts 2026-04-30 16:27:22 +02:00
Resham Joshi
2e354834e6
Update README.md
Some checks are pending
CI / semgrep (push) Waiting to run
2026-04-29 16:43:06 +02:00
iamtoruk
1db63c6216 Add AgentSeal and CodeBurn GitHub star badges to README
Some checks are pending
CI / semgrep (push) Waiting to run
2026-04-28 16:37:08 -07:00
AgentSeal
46924322d9 Bump version to 0.9.4
Some checks are pending
CI / semgrep (push) Waiting to run
OpenClaw, Roo Code, KiloCode, Qwen, Droid providers. Durable daily cache
with migration. Gemini JSONL fix. README restructure with honeycomb hero.
16 providers supported.
2026-04-29 01:11:27 +02:00
AgentSeal
01f215f634 Switch hero image to raw.githubusercontent.com to avoid CDN cache delay 2026-04-29 01:05:44 +02:00
AgentSeal
d0cfa40c05 Update providers hero image with tighter honeycomb layout 2026-04-29 01:03:24 +02:00
AgentSeal
c3816b0161 Restructure README with new hero image, compare screenshot, and full reference
Replace providers hero image with honeycomb design. Add compare screenshot
to 2x2 grid. Consolidate all documentation into single README with provider
table showing data locations, full feature reference, reading the dashboard
guide, and credits section. Add bunx as alternative install option.
2026-04-29 00:44:56 +02:00
AgentSeal
465294ca1e Merge feat/cache-durability: durable daily cache with migration 2026-04-28 23:18:35 +02:00
AgentSeal
7b8f4df856 Fix review findings: error handling, constant dedup, migration persist
- Wrap hydrateCache() in try/catch so disk errors don't crash commands
  that previously never touched the cache
- Export MS_PER_DAY, BACKFILL_DAYS, toDateString from daily-cache.ts
  and remove duplicates from cli.ts
- Remove double hydrateCache() call in report JSON path
- Persist migrated cache to disk so old-version files aren't
  re-migrated on every run
- Export emptyCache() for use as fallback on hydration failure
2026-04-28 22:56:47 +02:00
AgentSeal
888f592bd2 Make daily cache durable: hydrate from all commands, migrate instead of nuke
- Extract ensureCacheHydrated() from menubar-json path into daily-cache.ts
- Call it from every command that parses sessions (report, status, today,
  month, export, optimize, compare, yield) so CLI-only users also persist
  historical data that survives source file deletion
- Replace strict version equality check with fill-defaults migration for
  cache versions 2-4, preserving history across schema changes
- Back up old cache to .bak before discarding on unmigrateable versions
- Fix Copilot auto bucket display names in menubar (Copilot (Anthropic),
  Copilot (OpenAI))
- Fix Roo Code / KiloCode provider key matching in menubar tab strip
2026-04-28 22:41:01 +02:00
Resham Joshi
fbb2c4e69c
Merge pull request #171 from ksp2000/feature/copilot-auto-model-buckets
refactor(copilot): use auto model buckets for transcript inference
2026-04-28 12:17:50 -07:00
Resham Joshi
77d04172b5
Merge pull request #173 from Aeversil/add-droid-provider
Add Droid CLI provider
2026-04-28 12:09:29 -07:00
Dunccan de Weerdt
26ebe75aa1 Add Droid CLI provider
Discovers and parses sessions from ~/.factory/sessions/, reading JSONL
message logs and companion settings.json files for token usage tracking.

- Discovers sessions by scanning per-cwd subdirectories
- Skips internal .factory housekeeping sessions
- Extracts tools, bash commands, and user messages from JSONL
- Distributes session-level cumulative token counts across calls
- Normalizes Droid model wrappers before existing pricing lookup
- Derives clean project names from cwd paths
- Adds menubar provider filtering for Droid
2026-04-28 20:16:45 +02:00
AgentSeal
607cb463c9 Merge branch 'fix/menubar-perf' 2026-04-28 19:50:13 +02:00
AgentSeal
d043795855 Add Qwen provider and replace hardcoded pricing with LiteLLM snapshot
- Add Qwen CLI provider (discovers sessions from ~/.qwen/projects/)
- Replace FALLBACK_PRICING (40 hand-maintained entries) with auto-generated
  LiteLLM snapshot (3595 models including Azure, OpenRouter pricing)
- Build script fetches and bundles LiteLLM data before tsup
- Provider-prefixed lookups (azure/, openrouter/) resolve to correct pricing
- Add display names for all GPT-5.x model variants
- Add Qwen to menubar provider filter and tab strip
2026-04-28 19:49:14 +02:00
Resham Joshi
ec2de6a642
Add OpenClaw, Roo Code, and KiloCode providers (#175)
- OpenClaw: JSONL parser with multi-path discovery, tool extraction
  (toolCall + tool_use block types), model tracking via model_change
  and custom model-snapshot events
- Roo Code + KiloCode: shared Cline-family parser extracts model from
  <model> tags in api_conversation_history.json, strips provider
  prefixes from model names
- Add cline-auto and openclaw-auto aliases and display names
- Add menubar provider filters and tab colors for all three
- Show cached data instantly instead of blocking on CLI refresh
2026-04-28 09:24:14 -07:00