Commit graph

81 commits

Author SHA1 Message Date
Resham Joshi
389c14ce5e
fix(ui): mark estimated headline totals with ~ on every hero (#1722)
#1657 put the ~ mark on estimated rows, but the headline total stayed bare on
the desktop hero, the mac hero, the Windows hero and tray text, and GNOME.
Each now applies the same 1% rule to the provider split's estimated portion
(the desktop helper moves from the VS Code summary into lib/format). Combined
device totals carry no estimated split and stay unmarked.
2026-10-10 07:05:58 +02:00
Resham Joshi
fce75d5420
feat(app,windows): one-click updates for the desktop app and the Windows tray (#1685)
* feat(desktop): one-click updates through electron-updater on the update-feeds release

* feat(tray): signed one-click updates through tauri-plugin-updater; feed publishing and release docs

* ci(tray): build without the updater key until it is configured

* chore(windows): set the tray updater public key

* ci(windows): skip updater signing in the release build smoke

* ci(windows): build without updater artifacts when no signing key is available

* ci(windows): turn off updater artifacts through TAURI_CONFIG, not CLI flags pwsh mangles

* ci(windows): run tauri build under bash so --no-sign reaches the CLI (pwsh drops the -- separator)
2026-10-08 05:06:55 +02:00
Resham Joshi
39b9b3adcd
feat(quota): Command Code quota and ClinePass from the Cline sign-in (#1682)
* feat(quota): Command Code quota and ClinePass from the Cline sign-in

Command Code: reads the CLI's ~/.commandcode/auth.json key and the billing
credits and subscription endpoints. 5-hour and weekly windows as used of
cap, remaining credits as a note, plan from planId. Live in the Mac dock
from the local CLI, in codeburn quota and the Windows dock.

ClinePass: without a saved or env key, falls back to the Cline CLI's
providers.json session (accessToken, then apiKey, then auth.apiKey, with
Cline's path overrides). Read-only; an expired session stops before the
network and says to run cline. The Mac catalog adds the local CLI source
so Automatic connects without a key.

* fix(quota): keep retrying after an expired Cline sign-in

Running cline refreshes the session file CodeBurn only reads, so an
expired or rejected Cline session is now a retryable failure that keeps
the last quota and shows the guidance, on the Mac and in the CLI. A
rejected API key and a missing credential stay terminal.

* test(quota): build expected Cline paths with path.join for Windows
2026-10-07 23:34:31 +02:00
Matt Van Horn
ec2822a147
feat(windows): localize the Windows tray into Simplified Chinese (#1608)
Localizes the Windows tray menu, tooltip, usage row, dock menu and footer into Simplified Chinese, reusing the macOS menubar glossary. Refs #1336, #1646.
2026-10-07 20:10:56 +02:00
Resham Joshi
063e42796d
feat(providers): add Command Code (#1658)
* feat: Command Code support

Reads the cmd CLI's session transcripts at
~/.commandcode/projects/<slug>/<id>.jsonl (CODEBURN_COMMANDCODE_DIR moves
the root). Checkpoint and prompt sidecars are skipped.

usage.inputTokens includes cacheReadTokens, so fresh input is
inputTokens - cacheReadTokens. The recorded costUsd is kept per call
(costFromBilling); a call without one is priced from tokens and marked
estimated. Forks copy parent message ids into a new file, so calls dedupe
by message id across sessions.

Desktop: Electron sandbox read path, macOS and Windows change watchers,
Windows tab colour. No quota adapter.

* fix(command-code): dedupe on meta.messageId, not the 8-hex line id

The top-level id is randomUUID().slice(0, 8) and only unique within one
file, so calls from unrelated sessions could collide and vanish.
meta.messageId is a full uuid that survives forks. Fixture ids now use
the real 8-hex shape.

* test(command-code): check sidecar skipping by file name, not a posix path
2026-10-07 00:18:50 +02:00
Resham Joshi
b2be8eba56
feat: mark estimated dollars the same way in every view (#1657)
* Mark estimated costs with the same ~ in every view

The ~ marker and legend that report already used now appear wherever a
dollar figure is mostly a guess: the models and sessions CLI output, the
desktop Models, Overview, Sessions and Settings provider rows, the macOS
menu bar model rows and provider tabs, and the Windows tray.

One rule decides the marker everywhere: the estimated portion is at least
1% of the figure. report, overview and the MCP tables switch to it from
"any estimated cent", so a metered Codex row holding a few text-estimated
turns stays unmarked.

JSON is additive: estimatedCostUSD and isEstimated on models rows,
estimatedCost and isEstimated on sessions rows, estimatedCostUSD on
menubar providerDetails rows. Totals are unchanged.

* Skip the ~ marker on figures that print as zero

A sub-cent row that is fully estimated printed as "~$0.00": nothing visible
to qualify. The shared helper now also requires the amount, as the surface
prints it in the active currency, to show a non-zero digit. CLI, desktop,
macOS and Windows helpers all apply it.
2026-10-06 22:27:13 +02:00
Resham Joshi
04d0b65327
feat(cursor): show the Cursor sync status and an on/off switch in the apps (#1638)
* feat(cursor): show the cursor.com sync in the apps, with an off switch

status --format menubar-json gains an additive cursorSync block (enabled,
state, lastSuccessAt, and a fixed errorCode/error on failure), read from
the sync sidecar, the config and the Cursor app's login. It never syncs,
never makes a request and never carries the token, the account hash or
server text. It is absent when Cursor is not signed in and has never
synced, and it is attached after the snapshot and per-device payloads.

With the Cursor provider selected, the desktop overview, the macOS menu
bar and the Windows tray show one line under the total: "Synced from
cursor.com 12 min ago", or the error in a muted warning colour. A
"Sync Cursor usage from cursor.com" switch writes config cursorSync:
Settings > Providers > Cursor on the desktop, the Cursor settings pane
on macOS and Windows. Desktop and mac strings are in all six locales;
the tray stays English until its localization lands.

* fix(cursor): guard config writes, show the env override in the switches

The tray's shared config writer now refuses to write over a config.json
that does not parse or is not an object (it used to replace it with an
empty map plus the one key), which also protects the currency, budget
and Claude config directory writers. The desktop writer rejects null
and array configs the same way.

With CODEBURN_CURSOR_SYNC=0 set, the desktop, mac and tray switches show
"Turned off by CODEBURN_CURSOR_SYNC=0" and are disabled. A failed mac
save now says so under the switch. The tray hero note uses the warning
ink and maps errorCode to its own messages.
2026-10-05 17:11:41 +02:00
Resham Joshi
aded4c2326
feat(devin): plan and quota from the Devin CLI cache (#1606)
Some checks failed
Tests / desktop (push) Has been cancelled
Tests / test-platforms (windows-latest) (push) Has been cancelled
Windows Menubar CI / check (ubuntu-latest) (push) Has been cancelled
Windows Menubar CI / check (windows-latest) (push) Has been cancelled
CI / semgrep (push) Has been cancelled
Tests / test (22) (push) Has been cancelled
Tests / test (22.13.0) (push) Has been cancelled
Tests / test (26) (push) Has been cancelled
Tests / test-platforms (macos-latest) (push) Has been cancelled
Tests / test (24) (push) Has been cancelled
macOS Menubar CI / test (push) Has been cancelled
* feat(quota): Devin plan quota from the Devin CLI's local cache

Reads the newest ~/.cache/devin/cli/user_status.*.bin and walks only the
plan status message of its protobuf payload: plan name, daily and weekly
remaining percent and their resets. No network call and no API key; each
reading says how old the cache is. Any out-of-range field fails the read
instead of showing a number, and a window whose reset has passed since
the fetch is dropped.

CLI reader feeds codeburn quota and the Windows dock; the Mac Capacity
Dock gets the same decoder, and Devin moves from browser session to
local CLI, live.

* docs(windows): count twelve quota readers

* fix(app): list Devin among menu bar quota providers
2026-10-02 16:43:15 +02:00
ozymandiashh
157347aa99
feat: Amp support - read the local thread mirror (#1572) (#1578)
* feat: Amp support - read the local thread mirror (#1572)

Amp (Sourcegraph's coding agent) mirrors every thread it serves as one
JSON document per thread at ~/.local/share/amp/threads/ (AMP_DATA_DIR
honored, comma-separated). Each file is { id, messages,
usageLedger?{events} }; the ledger's events are the per-request record
(tokens.input/output, cache tokens joined from the billed message
through toMessageId -> messages[].messageId), with a per-assistant-
message usage fallback for threads without a ledger and a total-only
record billing as output.

Amp bills a subscription and records no charged dollars, so every call
is priced from the underlying model's token rates and marked
costIsEstimated; the recorded credits field is ignored (no published
per-credit dollar rate). Thread files carry no cwd, so sessions group
under the provider name. Registered eager; parse version
usage-ledger-v1; no artwork yet (mono-initial fallback, like Codebuff).

Surfaces: CLI registry + doctor probe roots, Electron sandbox read
paths + menubar catalog (Amp after Cursor, matching the Swift order),
Windows tray tab color + usage_guard root, GNOME prefs dropdown, macOS
ProviderConnectionCatalog, docs/providers/amp.md, README tool list,
CHANGELOG.

* fix: address Amp provider review feedback
2026-10-02 10:36:05 +02:00
ozymandiashh
59ed66b977
feat(dock): one Claude ring per config directory, with its own sessions and today (#1570)
* feat(dock): one Claude ring per config directory, with its own sessions and today (#1523)

Rate limits are per account, so a machine with a work and a personal
~/.claude cannot be served by one Claude ring. When the CLI knows two or
more Claude config directories:

- `codeburn quota --format json` adds a top-level `claudeProfiles` array,
  one entry per directory (`providers[]` unchanged). Each entry carries
  the directory's own windows, read from its own `<dir>/.credentials.json`
  (the macOS Keychain fallback stays reserved for the default ~/.claude),
  plus that directory's own today totals from a single Claude-only,
  cache-backed parse of today's range, filtered per source id exactly like
  the menubar's per-config payloads.
- Live sessions carry `claudeConfigSourceId`, so a per-profile ring claims
  only its own sessions. Claude Desktop sessions keep their own bucket id
  and belong to no profile.
- The Windows Capacity Dock gains a `claudeProfiles` preference (combined,
  default; separate draws one captioned ring per directory). Profile rings
  keep addressing the `claude` provider id for the provider set, glyphs,
  colors and the connect button; the settings row appears only when the
  CLI reports more than one profile.
- Captioned rows are taller by two new metrics (caption line + gap),
  mirrored in TS and Rust: the page tells Rust the rail is captioned in
  the layout request, and the frame carries the effective row extent the
  hit-test uses. Non-captioned rails are pixel-identical to before.
- The desktop app's shared dock-prefs schema parses and sanitizes the new
  key, so its pane cannot strip it from windows-dock.json.

Closes #1523

* review: opt-in profile reads, today timeout, missing-dir filter (#1570)

- `quota --claude-profiles` gates the per-directory reads: without it the
  payload lists profiles ({id,label,path}) only, so a combined rail and
  WSL users pay nothing; the Windows dock passes the flag only while its
  claudeProfiles preference is separate, and an unknown option from an
  older CLI reads as CliOutdated.
- The default ~/.claude profile reuses the claude provider row's result —
  no second request, no second macOS Keychain read.
- claudeTodayBySource races the same timeoutMs and answers an empty map
  on loss, so a silent child cannot cost the dock every provider's quota.
- Missing config directories are filtered before the >1 check.
- `captioned` applies only while a Claude ring is in the selected set;
  profile rows tolerate a list-mode answer; comments trimmed; merge with
  #1560 keeps both keepExpanded and claudeProfiles.

* test(quota): set USERPROFILE for the default-dir check; drop issue refs

---------

Co-authored-by: Resham Joshi <65915470+iamtoruk@users.noreply.github.com>
2026-09-28 19:06:53 +02:00
Swizzy
b6a977dd7c
Capacity Dock: setting for the hover bubble's surface (#1573)
* menubar: dock preference for the hover bubble's surface

* menubar: let the dock's hover bubble keep its own surface

* menubar: setting for the dock's hover bubble surface

* docs: dock hover bubble surface setting
2026-09-28 18:47:51 +02:00
Swizzy
d5880796bc
menubar: dock preference to keep every ring out at rest (#1560) 2026-09-27 16:14:22 +02:00
Resham Joshi
fe560f7f4d
chore: remove Roo Code support (#1551)
Roo Code was discontinued in May 2026 (its repository is archived).
Cached Roo sessions and daily history slices are dropped on load.
2026-09-24 21:34:39 +02:00
Resham Joshi
b8cc0edcbf
0.9.25 round 2: fixes found testing the built apps (#1517)
Some checks are pending
CI / semgrep (push) Waiting to run
macOS Menubar CI / test (push) Waiting to run
Tests / desktop (push) Waiting to run
Tests / test (22) (push) Waiting to run
Tests / test (22.13.0) (push) Waiting to run
Tests / test (24) (push) Waiting to run
Tests / test (26) (push) Waiting to run
Tests / test-platforms (macos-latest) (push) Waiting to run
Tests / test-platforms (windows-latest) (push) Waiting to run
Windows Menubar CI / check (windows-latest) (push) Waiting to run
Windows Menubar CI / check (ubuntu-latest) (push) Waiting to run
* fix: open menu bar Settings centered on the active screen

The window was positioned at a 520x380 placeholder while SwiftUI's own
minimum is 880x620, so the grown window kept its top-left corner and ran
off the bottom-right edge. Size the window from the view's minimum, place
it with a tested pure function, and honour a saved frame only while it
still fits on one of today's screens.

* fix: say where the telemetry toggle is managed when the desktop app owns it

A desktop telemetry.v1.json with enabled:false locks the menu bar toggle
off, so clicking it does nothing. Name the desktop app's Privacy & data
pane in the caption, and pin the four desktop/veto combinations plus the
standalone case in tests.

* fix(desktop): export the provider id, and never swallow a rejected setter

The export pane built its provider list from `current.providers`, which is
keyed on the lowercased display name. Five of the seventeen providers on a
real corpus ("cursor agent", "grok build", "kimi code", "hermes agent",
"grok bot") are not valid ids, so vProvider rejected them as bad-args.
`exportNow` had a try/finally and no catch, so the rejection produced no
toast and no file: the button did nothing. Use detectedProviders, which
already resolves ids from providerDetails, and toast on rejection.

The telemetry consent toggle swallowed its rejection the same way.

* fix(desktop): warm only the selected period, and only while visible

The post-paint sweep warmed all six standard periods x seven reports plus
the provider overviews: up to 48 serve-routed queries, ~18 CPU-seconds a
minute for five minutes and 2.79 GB peak RSS on a real corpus, and it ran
with the window hidden. It now warms the selected period's reports (its
own overview is already under that memo key from the visible poll) and
the other providers' headlines for that same period, holding before every
request while a user fetch is in flight or the window is hidden. Other
periods take the ordinary on-demand path.

Also corrects two comments that claimed background priority lets a click
jump ahead: spawnCli takes the serve fast path before priority is read,
and the resident child answers FIFO.

* fix(desktop): answer the click, report the write, tell the truth about the Claude login

Nine bridge setters in Settings attached only .then(), so a rejected
envelope produced no toast and the control read as if it had ignored the
click. One shared helper toasts the rejection, per pane fallback wording.

Telemetry save() swallowed write errors while setEnabled returned the
in-memory status, so the UI could show ON while the file the macOS menu
bar app reads still said OFF. The setters now carry persisted:boolean and
the renderer toasts when it is false; the write goes through the existing
atomic writeFileAtomic (temp file, rename) so a crash cannot tear it.

The Claude card called a logged-in Claude Code 2.x user "disconnected"
forever, because the credential lives only in the keychain and the first
poll never reads it. A new darwin-only keychainUnchecked state says we
have not looked yet and offers the forced read, keeping the login
instructions for the genuinely-logged-out case. ConnectAffordance's
toggle is renamed to what it does: it discloses instructions.

* fix: retry tax is the cost of retried edit turns, not a multiple of spend

* stop the change guard watching a Warp path it can never stat

* apply a menu bar language change in place instead of relaunching

* keep honoring WARP_DB_PATH in the change guard

* restart a menu bar too old to watch AppleLanguages

* one rebuild per language change, and no global bundle in tests

* fix(desktop): a forced quota refresh must not join the poll it just aborted

Check now / Refresh / ⌘R invalidated the quota service and then handed the
caller the background fetch it had just aborted, so every provider failed
its generation check and resolved disconnected: the click repainted every
card as logged out without ever reading the keychain, and Claude showed
"Not connected. Log in with the Claude CLI." A call now joins an in-flight
run only when that run is at least as privileged, so a keychain-allowed
call starts its own; a second forced click still joins the first, which
keeps the single macOS prompt. A superseded run hands its caller the run
that replaced it instead of its own abort artefacts.

retainOnFailure also holds accessDenied through a keychainUnchecked poll,
so the "Allow in keychain" guidance is not replaced by "Check now" one
cycle after the user denied the prompt.

* fix(desktop): stop the sweep churning, and never spend a query on an abandoned one

The prefetch effect depended on the detected-provider entries, whose costs
move on every overview poll, so it was torn down and restarted each cadence
tick: a warm slower than the interval was discarded and re-issued forever.
It now depends on the provider ids alone, and a finished warm is kept for
its own period/provider key even if the effect was torn down meanwhile —
only a config-generation change makes a result wrong.

Both loops re-test cancellation and the memo after the hold, which has no
bound, so an abandoned sweep issues nothing and a section the user visited
meanwhile is not parsed again. The hidden half of the hold waits on
visibilitychange instead of waking the renderer every two seconds for a
window nobody is looking at.

* fix(desktop): never offer a provider id the CLI will reject, and keep the keychain note

detectedProviders applied the round-trip filter only to the legacy
providers map; a providerDetails id with a space reached the picker and the
export as a --provider value the main process rejects.

The Plans settings row showed the "not read your login yet" line without
the note that macOS may ask once for keychain access, which the Plans card
does show.
2026-09-21 13:53:45 +02:00
ozymandiashh
1f6c3846c0
fix: name the usage that prices at $0 instead of hiding it (#1491)
The codeburn models default table dropped every row under its $0.01 floor with nothing saying so, hiding usage that prices at $0 for lack of pricing data. The default table keeps its floor and its numbers but prints one line naming what the floor hid: N more models price at $0 (M tok), with codeburn models --unpriced to see them. An explicit --min-cost stays silent; json, csv and markdown are unchanged. The macOS popover, Windows tray and web dashboard render the existing unpricedModels block as one secondary line. Verified: machine formats byte-identical, the hidden count matches --unpriced, totals unchanged.
2026-09-18 16:48:26 -07:00
iamtoruk
df38e63849 fix(usage): fold Windows case in spend identity, qualify --json counts, drop scratch tests 2026-09-07 14:56:32 -07:00
Aditya Vikram Singh
f5fd47e83d fix(usage): preserve project identity and qualify incomplete session counts 2026-09-07 22:02:54 +05:30
iamtoruk
d7f24d6cba fix(windows): the dock lands where it was dropped and never fails open
- A rail dropped while expanded reappeared elsewhere: the drop
  normalised against the live rail's travel while layout denormalised
  against the resting one, 71 px of drift at four rows on this work
  area. The drop now walks back to the resting start the rail grew
  from and normalises over the resting travel; a test drops an
  expanded rail and asserts it lands exactly where it was released.
- The click-through state was set before the call that applies it and
  a failure was discarded, so one failed call left an always-on-top
  window hit-testable forever. The state records only a successful
  call and the next tick retries; the same fail-open in begin_drag is
  fixed.
- Any button held anywhere on the desktop pinned the poll at 62 Hz;
  only a press that began on the rail counts now.
- The dock state file the desktop app also writes is replaced through
  a temp file and rename.
- The consent notice and the settings hint say that the daily report
  includes the names of the models, tools, skills and MCP servers in
  use, as the owner decided, and no longer claim more than that.
2026-09-03 03:06:12 -07:00
iamtoruk
91706484d6 feat(windows): consent-gated telemetry from the tray app and the Capacity Dock
The tray had no telemetry. It now sends the same envelope as the desktop
app to the same endpoint, with app name codeburn-menubar. Consent comes
from the desktop app's telemetry state file when that app is installed,
so one decision covers both apps and events share one anonymous id;
otherwise the tray asks once, defaulting off for EU, EEA, UK and Swiss
locales and for an unknown locale, and keeps its own toggle under
Settings, General, Privacy. Switching off rotates the id.

Events, all name-only or bucketed: app_open, app_close with session
minutes, popover_open, settings_open with the pane, update_click with
the action, glance_open, dock_enabled and dock_disabled with the edge
and a scale bucket, dock_provider_switch, dock_drag_end with the edge,
and the CLI's usage_snapshot once a day, skipped when the desktop app is
the consent source so nothing is counted twice. The queue persists under
the app's local data directory, capped at two hundred events, and flushes
every five minutes and on quit; a 4xx drops the batch, anything else
keeps it. Debug builds never send.
2026-09-03 01:18:23 -07:00
iamtoruk
00403c9152 feat(windows): report updates and point at GitHub instead of installing them
Outside a Store package the tray app no longer runs `npm install -g
codeburn@latest --force` and `codeburn menubar --force` on one click.
The MSI is unsigned and its checksum is published in the same release,
so an automated install has nothing to verify; a manual install at
least passes through SmartScreen. The check still runs and reports a
newer version, the badge and About now open the windows-v* release
page, and the manual command is shown as copyable text. Inside a Store
package the checker stands down as before. One-click install returns
once the MSI is signed and the installer verifies the signature.
2026-09-02 23:09:36 -07:00
iamtoruk
e95ea95769 fix(windows): private key files, a real log, and a clean uninstall
- On Linux provider keys were written under the plain umask despite a
  comment promising owner-only permissions. The directory is created
  0700 and the file 0600, the temp file before the rename too, and the
  plain-text fallback is stated where it lives, including in the
  settings pane copy.
- A release build has no console, so every eprintln wrote into nothing.
  A small logger appends timestamped lines to codeburn.log under the
  app's local data directory, rolls at 256 KB, and keeps stderr in
  debug builds. All call sites use it.
- Uninstall left the launch-at-login Run value pointing at a deleted
  exe, so Windows errored at every login. A WiX fragment removes that
  one value on a real uninstall, not on upgrade. User data under the
  config directory is kept on purpose and the fragment says why.
- The webview CSP allowed a host nothing in the page contacts.
- The updater's verification site now states its trust boundary: the
  hash and the MSI come from the same release, so the check proves
  transfer integrity only. Signing is a release decision.
2026-09-02 15:16:06 -07:00
iamtoruk
79b2d7731b fix(windows): the dock survives a fast toggle and never blocks clicks
Four dock bugs and one Linux gap:

- A fast off/on toggle destroyed the fresh window. Hiding bumped a
  dismiss generation but the page's close request ignored it, so the
  retract that finished after the next show tore down the reused window.
  The generation now travels through the dismiss handshake and a stale
  close is ignored; the page also replays its entrance on a new present.
- The pointer tracker could exit and never restart, and a reused or
  rebuilt window got none, leaving a transparent always-on-top window
  that swallowed every click. A running flag and a drop guard respawn
  it, a panic costs one tick, and the window is created click-through
  so no path leaves it hit-testable.
- A layout request during a drag snapped the rail out from under the
  pointer. Requests are kept and deferred until the drop settles.
- Pointer polling ran at 62 Hz whenever the dock was on. It now polls
  at 62 Hz only while engaged or within 120 px, 25 Hz to 600 px, and
  8 Hz beyond, about an 87 percent cut at an idle desktop.
- On Linux the dock could be switched on and produce a window nothing
  ever made click-through. It is unavailable there now and reports off.

Error output in these files goes through the tray's log file instead
of a stderr a release build does not have.
2026-09-02 15:16:06 -07:00
iamtoruk
c131309090 feat(windows): the Capacity Dock hover panel becomes a glance
Port of 53c5c7b3 onto the Windows dock. The panel was a list of quota
bars; it is now a glance, in the mac's blocks and in its order: a
provider header, the sessions running right now as pills with their
context gauges, a Today strip, and a row of quota-window percentages,
separated by hairlines. The connection states, the Connect button and
the footer lines the CLI can still answer honestly stay where they were.

A percentage is its own gauge now rather than a bar beside a label: dim
glyphs with the value's severity colour filling them left to right and
wiped off on a slant. The mac solves that edge in points against a
measured text box, so the run gets a box of its own here and the clip is
written as a share of its width plus the slant in pixels; a run centred
in a wider column would otherwise be wiped from the column's edge and
read as fully coloured at half its value. The glance ramps at 70, 80 and
90 rather than the rail's 50, 75, 90, so a healthy row reads as text
rather than as a wall of colour.

Every block carries its own padding and an explicit content height, all
whole pixels at any detail scale, because the window Rust sizes around
the card is measured from what the page drew. Hairlines are overlays for
the same reason: a rule must not add a pixel the measurement did not
reserve. Whichever block ends the card carries the closing inset, which
is the rule the mac's own windowsHeight bakes in.

Three deliberate differences from the Swift, all noted where they are:
the connection lines take the same side inset as every other block
rather than sitting flush to the bubble edge; a disconnected provider
keeps the sign-in guidance the existing bubble had, which the mac's
glance drops; and the footer stays, since the mac reads freshness off
its own adapters and `codeburn quota --format json` does not carry it.
2026-09-02 08:44:43 -07:00
iamtoruk
b1316717ac feat(windows): the Capacity Dock rail emerges from its edge
Switching the dock on made a rail appear where there had been nothing, and
switching it off made one vanish. Neither reads as a thing arriving or leaving,
because neither has any direction: the window is created, painted, destroyed.

Now the rail comes out of the edge it is docked to. It starts tucked its whole
cross width behind that edge, so nothing of it shows, and the transform is
released on the frame after the first layout, which is the first moment there is
an edge and a size to be tucked behind. A floating rail has no edge to hide
behind, so it fades and scales from 0.92 instead. Both use dockAttach, the same
280 ms curve the drag glide already settles on.

Leaving is the same in reverse, and it needs a handshake because Rust owns the
window: hide asks the page to retract, the bubble goes first, the rail slides
back over dockDetach, and the page then calls dock_close. Rust keeps a 400 ms
timer so a page that never answers costs a fifth of a second rather than a rail
that will not go away, and a generation counter means switching the dock off and
straight back on cannot have the old timer take the new window.

Nothing here moves a window. It is a transform on the rail alone, so every
window metric stays the whole pixel it was, and prefers-reduced-motion skips
both plays: the rail is simply placed, and the dismiss closes without waiting.
2026-09-02 07:56:12 -07:00
iamtoruk
527340b686 feat(windows): the update checker stands down inside a Store package
The desktop app's Store build ships this tray app inside its own MSIX package,
and a package updates as one thing. An .msi install underneath it would be
refused at worst and undone by the next Store update at best, so the check does
not run there at all: no request to GitHub, no `codeburn --version` spawn, no
cache file on disk.

GetCurrentPackageFullName is the documented ask, which is why the length is
requested with no buffer to put it in: outside a package it answers
APPMODEL_ERROR_NO_PACKAGE, inside one it complains about the buffer.

storeManaged travels with the status so the surfaces go quiet rather than
inventing a silence of their own: the header badge hides, About says where
updates come from instead of offering two buttons that can do nothing, and the
tray menu does not carry Check for Updates at all. The CLI banner needed no
change, since it reads cliUpdateAvailable, which a store-managed status leaves
false.
2026-09-02 04:29:52 -07:00
iamtoruk
790c2dd603 fix(windows): the tray shows the logo alone unless the number icon is asked for
The number beside the logo is a second tray icon, the only way the notification
area can carry text, and two icons read as clutter. It is now opt-in: a fresh
install shows the logo, the figure stays in the tooltip and at the top of the
tray menu, and the settings toggle brings the number icon back. Anyone who
already chose either way keeps that choice. Startup no longer restores a badge
from the status cache unless the setting asks for one.
2026-09-02 03:27:43 -07:00
iamtoruk
fd9931666d fix(windows): three things that read rough beside the mac
A pass over the popover, the settings window and the dock, in both
themes, looking for what the mac does not do.

The insight pills were clipped by the card edge whenever Plan was there
to make seven of them. The mac keeps that row in a horizontal ScrollView
with no indicator and lets each pill keep its width, so this does the
same; a pixel comes off the pill padding as well, which is what lets the
ordinary six sit inside a 384 px card with the last word whole.

The Capacity Dock size slider drew a white track on the dark theme, the
loudest thing in that window. The track is painted from the tokens now,
ember up to the thumb and a quiet fill after it, in both themes.

And the settings window did not follow a theme or accent changed
anywhere else: the tray's theme item retinted the popover and the dock
and left this window on the old palette until it was reopened. It reads
the same broadcast the other surfaces do now.
2026-09-02 02:09:09 -07:00
iamtoruk
36c7b990aa feat(windows): the popover reads as what it is to a screen reader
An accessibility pass over the surfaces a keyboard or a screen reader
reaches, against what the mac announces.

The period and scope strips are radio groups now, with the pattern in
full: one tab stop each, arrow keys between the segments, aria-checked
rather than aria-pressed. Six tab stops for one choice is what a plain
row of buttons gives, and it is why leaving a control you have already
answered took six presses.

The insight pills already carried tab roles; they gain a name and the
panel they control, so the content below is announced as belonging to the
selected pill rather than as loose text.

Everything painted rather than written gets a label: each day in the
calendar picker announces its date instead of a bare number, and the
heatmap cells and trend columns carry the day and the figure with a role
for that label to attach to, which a bare span does not have.

Focus rings reach the last places they could not: text inputs, and the
accent swatches, where the selected swatch already wears an outline and a
focused one needed its own ring further out.
2026-09-02 01:52:48 -07:00
iamtoruk
85ce84a8bb feat(windows): the tray says when a paired device did not report
Under combined scope the tray figure is the cross-device total, so a peer
that failed to answer makes it smaller than what these machines actually
spent. The mac marks that beside its title with a dimmed
"reachable/total" and says "N of M devices reporting" in the tooltip.

The tooltip and the menu's usage row carry the counts here, in the mac's
words. The badge cannot: it is a 16 px bitmap with room for about four
glyphs, and squeezing "2/3" into it costs the figure its legibility. It
is drawn dimmed instead, half way to the panel behind it, so a reduced
total still reads as incomplete rather than as a glitch, and the words
are one hover away.
2026-09-02 01:39:10 -07:00
iamtoruk
ff97aa7b8f feat(windows): Pulse says what an edit costs on each model
Pulse had the mac's three tiles and not its caption, which is the line
that turns them into a decision: what one accepted edit costs on the
cheapest model of the period, and on the dearest when that is a different
model. The figures come from `current.modelEfficiency`, which the CLI has
emitted all along and the Windows payload type simply did not name.

Three decimals under a cent, as on the mac: a model that costs a tenth of
a cent an edit and one that costs nine of them both read as $0.00
otherwise, and telling those apart is the whole point of the line.
2026-09-02 01:33:27 -07:00
iamtoruk
929bca8019 fix(windows): the rail keeps its edge while the size changes
Dragging the Capacity Dock size slider tore the rail off the screen edge
and left it floating there for as long as the drag lasted. Three things
were wrong.

The window moves from Rust and the page paints inside it, and a size
change moved the window without telling the page. The page found out one
event and one round trip later, so in between it drew a rail sized and
offset for the window it used to have: on a right-docked rail that is a
pill hanging a bubble's width off its own edge. The new size and the
frame it belongs to now travel together in one event, and the page
applies both in a single render.

The rail is also pinned to the edge it is docked to, right or bottom,
rather than positioned from the window's left and top. A docked rail's
outer edge is the window's own edge, because the window is sized from the
rail, so that pin holds through any resize the window is given
underneath it.

And the writes are serialized. `set_dock_prefs` is async, so the several
writes a dragged slider starts were several tasks that could finish in
any order and leave the rail at a size the slider was no longer showing.
One at a time now, with a patch that is still waiting merged into the one
ahead of it, which also costs the drag fewer round trips.
2026-09-02 01:29:53 -07:00
iamtoruk
2b3c106da8 fix(windows): the daily budget lives where the CLI keeps it
The app wrote the spend limit as a top-level dailyBudget in dollars. The
CLI's own config type has never had that key: it reads budget.daily, in
the display currency. So a limit set in the settings window did nothing
for `codeburn report`, and a limit set by the CLI did nothing for the
tray.

The limit is budget.daily now, written as the reader typed it, in
whatever currency they are looking at, which is what the CLI's other
budget tiers already mean. Every comparison converts it back to dollars
against the rate the app already has for the currency, because the
payload is in dollars; the popover re-reads it when the currency changes,
since what a limit is worth in dollars moves with the rate.

An existing dailyBudget is read once more and moved across on the first
read after this build, rate applied, old key removed, so a limit set
before this does not silently switch off. The token budget has no CLI
counterpart and stays exactly where it was.
2026-09-02 00:51:59 -07:00
iamtoruk
ff56796640 feat(windows): a mark for every provider, and the mac's sigil for the rest
The dock, the settings sidebar and the dock's provider switches drew a
dotted circle for anything outside the ten quota providers, so a machine
running Droid or Kilo Code got a placeholder where the mac has a mark.

Seven more of the mac's own marks are ported from
Resources/ProviderIcons: Devin, OpenCode, Kilo Code, Kiro, IBM Bob,
Factory (which the CLI calls droid) and Qwen. Ids that share a mark go
through an alias table seeded with the mac's own bundledVectorAliases,
plus the CLI's spelling of an id the mac's catalogue spells differently
(kilo-code, ibm-bob) and the product aliases CapacityDockProvider.iconName
already implies: Kimi Code draws Kimi, Cursor Agent draws Cursor.

Everything else now gets the mac's generated sigil rather than a dotted
circle: two hooks whose reach, rotation and terminal come from an FNV-1a
hash of the id, drawn around the provider's monogram. Same hash, same
arithmetic, so a provider gets the same sigil here as it does there. The
drawing is mirrored in y and turns the other way because AppKit draws
y-up and SVG y-down.

hasProviderGlyph went with the dotted circle: nothing called it, and
there is no longer a provider without a glyph.
2026-09-02 00:32:53 -07:00
iamtoruk
fee71400cd chore(windows): remove what nothing reads
None of this is reachable, and none of it is caught by the compiler:
tsc's noUnusedLocals only sees a name unused inside its own file, and CSS
has no such check at all.

- --scroll-height, a token no rule ever read.
- DropMenu's danger flag and the .dropmenu-danger rule behind it, which
  no caller has ever set.
- SunMoonIcon and PowerIcon, from a footer that has not looked like that
  for a while. FlameIcon stays: the Stats costliest-session row draws it.
- currentTheme, whose last caller went with the theme cycle, and
  settingsSnapshot, which never had one.
- .segmented, .segment and .segment-active, left behind by the period
  control that now draws its own tabs.
- A SystemTime import in usage_guard that only the tests use, which the
  ordinary build had been warning about since it landed.
2026-09-02 00:23:16 -07:00
iamtoruk
c9502bc7ff feat(windows): export into Downloads and reveal what came out
Export opened a console, ran the CLI in it and left the result in
whatever directory the app happened to be started from, which on this
platform is next to the executable. The mac has always written into
~/Downloads as codeburn-<timestamp> and then revealed the result in
Finder with it selected, so this does the same: no console, a folder of
CSVs or one JSON file with the mac's yyyy-MM-dd-HHmmss stamp, and
Explorer opening on it through /select, which is the Windows counterpart
of activateFileViewerSelecting.

The Downloads folder comes from the known-folder API rather than
%USERPROFILE%\Downloads, since it can be moved. The stamp is formatted in
the page because a local-time format in Rust would cost a dependency or a
hand-rolled timezone; it never reaches a shell, but it does become a
directory name, so Rust checks it is digits and hyphens of the right
length rather than trusting it.
2026-09-02 00:17:50 -07:00
iamtoruk
f021513479 fix(windows): one answer to what CodeBurn watches
The empty state and the tab strip's known-tool fallback both answer the
first-run question "where does this look?", and they answered it
differently: the strip said "Pi session logs" where the empty state said
%USERPROFILE%\.pi, and "OpenCode session storage" against
%USERPROFILE%\.local\share\opencode. Neither Pi spelling was right
either. The CLI reads ~/.pi/agent/sessions.

Both read one table now, lib/watched, whose paths are the roots the CLI's
own providers probe. Cursor and Copilot gain the paths they never had
rather than a description, so all six rows read the same way, and a long
path wraps inside the hover card instead of running past it.
2026-09-02 00:11:17 -07:00
iamtoruk
8a227ef87d feat(windows): the tray theme item cycles System, Light and Dark
The item said "Toggle Dark/Light" and flipped between two states, so a
reader who had ever chosen Light or Dark could not get back to following
the system, which is the only setting the mac has at all. It steps
System, Light, Dark now and names the state it moves to, because a menu
item reads as a verb. The popover's More menu runs the same cycle from
the same wording, so the two can never disagree.

The choice is written to the settings file from Rust rather than asked of
the popover, which means the item works with no popover on screen, and
every window retints from the broadcast that already exists. That made
the resolved-theme state in the popover dead, and the media listener that
kept it, so both are gone.

One bug had to go first. A tray's on_menu_event handler is registered
globally rather than against that tray, so registering it on both the
logo and the badge icon ran every menu item twice: the cycle skipped a
step, and Show Capacity Dock had been toggling itself straight back.
2026-09-02 00:03:52 -07:00
iamtoruk
6ed5b8f2fd feat(windows): the CLI timeout is a silence, not a stopwatch
A flat 60 s wall-clock timeout cannot tell a wedged child from a slow one. It
killed a first parse of a large corpus, which is the run that most needs to
finish, and it waited a full minute on a child that had died on its feet.

Port of CLIWatchdog.swift. Every read spawn now sets CODEBURN_PROGRESS=1,
under which the CLI's parser writes a keepalive line every 10 s for the whole
of a scan, so silence means something: 45 s of it stops the child, with the
mac's ten-minute cold budget until one payload has come back, and a
fifteen-minute ceiling for a child that chatters forever without finishing.
Every byte on either pipe restarts the clock, which is why both are drained in
chunks now rather than read to the end. Progress lines are stripped from
stderr before it can become the error a window shows.

The stop is asked for first: Ctrl+Break to the child's own process group,
which is what a console process has here instead of SIGTERM and which node
delivers as SIGBREAK, so the CLI unlinks its own refresh lock on the way out.
Only a child that ignores it inside five seconds is killed. The kill is
taskkill /T, because what this app spawns is codeburn.cmd and the process
doing the work is node, a generation below: killing the handle we hold ends
the shim and orphans the parse.
2026-09-01 23:44:55 -07:00
iamtoruk
f019b45c85 feat(windows): one quota poll on the cadence, for every window that shows one
The quota store already had the cadence setting and the mac's backoff, but
two things went around it. The Capacity Dock never used the store at all: it
kept its own fetch on a fixed five minutes, so the setting did nothing there.
And every usage tick called the store's refresh directly, which with an open
popover meant a quota spawn every thirty seconds however the cadence was set.

The dock now reads the same store as the popover and the settings window, so
one setting governs all three and a failure backs off with jitter rather than
retrying on the dot. The store reads the cadence itself instead of waiting to
be told, because three windows run their own copy and one that forgot to wire
it would poll at the default forever.

Refreshes are split by who asked. Retry, Refresh Now and a key just saved are
a reader asking and outrank the cadence. A background usage tick only rides
along with a poll the cadence has already earned, and never in Manual. The
popover opening gets an answer the cadence had not earned yet, down to the
mac's thirty-second interactive floor.

Two windows still keep two stores, and their timers fire within a second of
each other, so `dock_quota` in Rust now coalesces: whoever asks second waits
for the run in flight and is answered from it. The cache lives ten seconds,
far below the interactive floor, so a Retry is always a live answer.
2026-09-01 23:26:53 -07:00
iamtoruk
75b1d14423 feat(windows): no background refresh while nobody can see the tray
A locked session or sleeping displays kept the refresh loop spawning a Node
process every two minutes for a figure nobody could look at. The mac stops
on screensDidSleep and refreshes on didWake; this is the Windows half of
that.

The notifications need a window to be delivered to, so there is a hidden one
on a thread of its own with its own message pump, in the shape of the dock's
cursor thread. It registers for session change (lock and unlock), for the
console display state, and for suspend and resume. A message-only window
would not do here: WM_POWERBROADCAST is not delivered to one.

The loop keeps its timer while the machine is unattended and skips the fetch,
so the first tick after the screens come back finds fresh numbers even if a
notification was never delivered. Waking, unlocking or the screens coming
back refreshes at once, in every mode but Manual, as on the mac. An open
popover clears a latched flag on its own, since it is proof the screens are
on.
2026-09-01 23:00:09 -07:00
iamtoruk
8bbdd1c7d2 feat(windows): the usage refresh follows the cadence and the power state
The background loop ran on a fixed 60 s open, 120 s closed, whatever the
Usage refresh setting said beyond Manual, and whatever the machine was
running on. Every tick is a full Node process, so a laptop on battery paid
the same as one on the wall.

The arithmetic is now RefreshCadence.swift's, in Rust where it can be
tested and where the power read belongs: Auto is 30 s while the popover is
open, 120 s hidden on AC, 150 s on battery and 300 s in battery saver
(GetSystemPowerStatus through the windows-sys dependency, one new feature
flag). Manual answers nothing and the loop stops until the popover opens
or Refresh is pressed. A fixed cadence is what it says, except that an open
popover always gets the active one, as on the mac: the reader is looking at
those numbers.

The page asks for a plan on every tick rather than arming one interval,
because the power state changes under a timer that has already been armed.
Debug builds print each plan on stderr.
2026-09-01 22:51:12 -07:00
iamtoruk
3aa58edace fix(windows): a forced update check is not answered by the cached one in flight
Check for Updates from the tray opens the About pane and asks it to check
straight away, and the answer came back stale: the pane mounts, its first
subscriber starts the ordinary cached check, and the forced one that
follows a tick later was coalesced into it. The reader pressed a button and
got whatever the two-day cache already held.

Coalescing is right for two surfaces asking the same question at once and
wrong for a button, so a forced check now waits for the run in flight and
then asks properly.
2026-09-01 22:32:18 -07:00
iamtoruk
3da4bb8dcb feat(windows): Check for Updates in the tray menu and in About
The tray menu was missing the mac's Check for Updates, and the About pane
had the button greyed out with a note saying the check did not exist yet.

The mac answers its menu item with an NSAlert carrying one of three
results. Here the same three belong on the About pane instead: it already
shows the version, and unlike the mac - which sends the reader back to the
menu to install what the check found - the button that installs it can sit
right next to the result. So the menu item opens About and the anchor tells
the pane to check straight away, which is one window rather than a modal
over a window.

Up to date names the version, an available update names the release and,
when the CLI is behind too, both; a failed check says what failed and why,
scrubbed on the Rust side before it gets here. The row's hint says when
GitHub last answered, because a cached answer can be up to two days old and
a reader should be able to see that.
2026-09-01 22:16:39 -07:00
iamtoruk
8de3aad4b9 feat(windows): the update badge and the CLI update banner in the popover
Two surfaces the mac has had and this build did not: the header badge that
says an update is waiting, and the strip under the footer that says the CLI
itself is behind.

Both read one store (src/lib/update.ts), which is the observable half of the
mac's UpdateChecker; the check itself is already in Rust and cached, so
asking on mount costs nothing and the store only offers Rust the chance to
re-check every twelve hours, well inside its own two-day interval.

The badge is the mac's: it appears only when there is an update or a failed
check, its label carries which stage failed, and the click does what the
mac's does - retry a failed check, install an offered update, ask again
otherwise. The banner keeps both of the mac's ways out: Update now, which
runs the same one-click sequence, and the command itself, copyable, for
anyone who would rather watch npm work in their own terminal.

The banner's blue is the mac's Color.blue rather than the brand ember,
deliberately: the star banner sits two rows below it in terracotta, and an
informational strip that borrows the brand colour reads as a second one.
2026-09-01 22:14:54 -07:00
iamtoruk
dd6bc2453a feat(windows): the rail turns mid-drag when the edge in reach turns
A rail dragged from the right edge to the top stayed a tall pill all the
way there and only became a wide one after the drop, so the drag never
showed what the drop would do. It turns while it is being carried now, as
the mac's dragChanged does: as soon as the edge in reach runs the other
way, the rail is laid out for that orientation and the window is resized
under the pointer.

The grip is what makes that survivable. The drag anchor was the cursor's
offset from the window origin, which means nothing once the rail changes
shape; it is the fraction of the rail the pointer grabbed now, so a
53 by 112 pill that becomes 74 by 64 hangs from the same place in itself.
That is the mac's pointerAnchoredDragFrame, which applies the fractions
from the start frame to whatever size the rail currently has.

The page is handed the new frame with the drag event, since a rail that
has turned lives in a different window and paints a different shape.
2026-09-01 21:55:50 -07:00
iamtoruk
69b3762376 feat(windows): a Connect button and footer lines in the dock bubble
The bubble told you a provider needed reconnecting and left you to find
the settings window yourself. It now offers the mac's one recovery:
Connect for a provider the CLI found no credential for, Reconnect for one
that was refused, tinted with the provider's brand colour and opening the
settings window on that provider's own pane, where Retry and the
instructions are. Z.ai and ClinePass say "Add API Key" instead, because
their pane is where a key is pasted.

A provider that is in the dock's set stays on the rail after it drops
out, as it does on the mac. A row that quietly disappeared was the reason
the button had nowhere to appear, and a dashed ring with a Reconnect
button is the more useful answer.

The footer is the mac's: a divider and up to two small lines. The mac
fills them from facts its own adapters return and the CLI's quota output
drops, so the dock tells the two it can still tell honestly: when the
reading was taken, since the rail refreshes every five minutes, and how
many windows the five-row card had no room for.
2026-09-01 21:43:07 -07:00
iamtoruk
37d0f47d62 feat(windows): the dock seeds its provider set from what is connected
An empty provider set meant "nobody has chosen yet", and the rail read it
as "show everything signed in" for as long as nobody ever chose. The mac
instead writes the set down the first time it sees a connection, so the
switches in the settings window start out describing what the dock is
actually doing, and it caps the set at five.

autoSeed is that rule: until manualSelection latches, the set follows the
connected providers, capped, and the resting provider is renormalized so
it always names a row the rail is showing. It runs in the dock page,
which is where the quota answer already arrives, and only once the stored
preferences have been read; acting on the defaults before that would have
overwritten a set the user had chosen.

The resting provider is also normalized on the way out, so a provider
switched off in the settings cannot leave the rail resting on a row that
is no longer there. dock_preferred goes with it: the page reads the
preferred provider out of the preferences with everything else now.
2026-09-01 21:36:49 -07:00
iamtoruk
7b5266af51 feat(windows): a Glass appearance for the Capacity Dock
The second appearance now draws something: a translucent surface inside
the rail's own outline, with a brighter rim than graphite gets, dark
enough at 60 to 74 percent to carry the warm off-white type over any
wallpaper. The mac's Liquid Glass, as far as a shaped window on Windows
can go.

It is painted rather than the acrylic window effect, because that effect
cannot be shaped. Applying it and cutting the window down to the painted
outlines was tried first: a polygon region built from the flattened rail
and bubble paths, handed to SetWindowRgn, which reported success and left
a complex region on the window. The blur was unmoved. DWM draws an accent
backdrop for the whole window rectangle, and the dock's window is a good
deal larger than the rail: it carries the fully expanded rail plus the
bubble's reach, so the appearance was a grey slab a third of the screen
tall with a faint rail inside it. The corner preference does not clip it
either, which package B already found on the popover.

So the setting is called Glass and not Acrylic, since a name that
promises a blur it cannot give is worse than the honest one. The stored
value still reads the old "acrylic" spelling.
2026-09-01 21:31:34 -07:00
iamtoruk
7423b9b73d feat(windows): the squircle gauge shape
The gauge is a path now rather than an SVG circle, so the Gauge shape
setting has something to choose between: CapacityDockGaugePath's circle,
and its continuous rounded rectangle at a 30 percent corner radius.

The continuous corner is what makes a squircle read as one. It reaches
about one and a half radii along each edge and is drawn as a single cubic
pulled 55 percent of that reach toward the corner; a circular quarter-arc
would kink where it meets the straight edge, which is the whole difference
from a circle at this size.

Both shapes start at twelve o'clock and run clockwise, so the usage arc is
trimmed with a dash pattern over a normalized path length rather than a
circumference the squircle does not have, and the mac's compensating
rotation is not needed.
2026-09-01 21:15:12 -07:00
iamtoruk
804f665a84 feat(windows): the Capacity Dock follows the size setting
The rail was fixed at the mac's smallest scale because both halves of its
geometry hard-coded the numbers that scale produces. Now the page and the
Rust side each rebuild every metric from the stored scale, with the mac's
rounding, so the two stay in step at any size between 60 and 120 percent.

dockGeometry.ts exports a cached metrics(scale) instead of a frozen M, and
dock.rs grows a Metrics struct with the same base values. The bubble keeps
the mac's floor of 0.9: below that its type stops being readable, so a
60 percent rail still gets a 315 px card. What a stylesheet rule needs
rather than an element (the row gap, the gauge box, the percent type, the
bubble's spacings) arrives as a --dock-* variable on .dock.

Writing a dock preference now re-reads the geometry in Rust and moves the
window, because the page can only paint inside the window it is given.
The settings section says appearance and gauge shape are still stored and
unread; size no longer is.
2026-09-01 21:09:02 -07:00