文件历史

提交图

73 次代码提交

作者 SHA1 备注 提交日期
Jarrod Watts 2649ccfd2e feat(cache): add prompt cache countdown (#477)
* feat(cache): add prompt cache countdown

* fix(cache): localize prompt cache and bust stale transcript cache

---------

Co-authored-by: Jarrod Watts <jarrod@Jarrods-MacBook-Pro.local>
2026-04-20 23:55:25 +10:00
Jarrod Watts 9739abc914 feat(layout): add configurable expanded merge groups (#476)
Co-authored-by: Jarrod Watts <jarrod@Jarrods-MacBook-Pro.local>
2026-04-20 23:52:34 +10:00
Jarrod Watts 7610fde8da feat(git): support wrapped branch display (#474)
Co-authored-by: Jarrod Watts <jarrod@Jarrods-MacBook-Pro.local>
2026-04-20 23:50:27 +10:00
zviehrman13 118bf874e4 feat: make usage reset label configurable 2026-04-20 20:52:47 +10:00
Wojciech Pędzimąż 3287adc786 test: add integration tests for timeFormat modes and limit-reached preposition 2026-04-20 18:58:23 +10:00
Wojciech Pędzimąż 01b436cefb fix: correct limit-reached preposition and i18n-ify the absolute "at" prefix
Two bugs caught in review:

1. Limit-reached path hardcoded t("format.resets") = "resets" for ALL
   timeFormat modes, so relative mode (the default) produced "Limit reached
   (resets 2h 30m)" instead of the correct "resets in 2h 30m". Applied the
   same resetsKey selection logic used in formatUsageWindowPart to both
   usage.ts and session-line.ts.

2. formatAbsolute hardcoded the English word "at", breaking zh locale:
   t("format.resets") = "重置于" (resets at) + "at 14:30" = "重置于 at 14:30"
   (doubled preposition). Added "format.at" i18n key (en: "at", zh: "" — zh
   omits the prefix since its "format.resets" already encodes the preposition).

Also updates the render.test.js assertion that was written against the old
incorrect behavior.
2026-04-20 18:58:23 +10:00
Jarrod Watts 84b74d419b fix(render): only pad progress labels when lines stack 2026-04-20 18:54:14 +10:00
kagura-agent 2233a8537c test: update assertions for paddedLabel alignment padding
Adjust two test expectations to account for the trailing spaces
that paddedLabel() adds when aligning shorter labels (Usage, Weekly)
to the width of the longest label (Context = 7 chars).
2026-04-20 18:46:07 +10:00
kagura-agent 4f2775b2bd fix(stdin): use env var instead of model ID to detect Bedrock provider
getProviderLabel was string-matching `anthropic.claude-` in model IDs,
which false-positived on cross-region IDs like `us.anthropic.claude-sonnet-4-6`.
Now checks `CLAUDE_CODE_USE_BEDROCK=1` env var instead.

Fixes #466

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-20 18:29:58 +10:00
Jarrod Watts 565154d5cd fix(cost): prefer native stdin cost with safe fallback 2026-04-05 10:59:33 +10:00
Yimaha b263939c73 feat: use cost.total_cost_usd from stdin instead of manual estimation
Replace the hardcoded Anthropic pricing table and estimateSessionCost()
logic with a direct read of stdin.cost.total_cost_usd — the native field
Claude Code provides after each API response.

- Add cost.* fields to StdinData type
- Extract costUsd in index.ts and pass through RenderContext
- Simplify renderCostEstimate to read ctx.costUsd directly
- Rename i18n key label.estimatedCost → label.cost
- Update label to "Cost ($USD)" / "耗油量(美元)" (zh)
- Remove dead estimateSessionCost, pricing table, and related helpers
- Update tests to use costUsd; add index.test.js coverage for the field
- Update README to reflect native field behavior

Closes #380

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 11:33:17 -04:00
Jarrod Watts 6dddf2ed1b feat: add offline estimated cost display (#305) (#374) 2026-04-04 17:38:30 +11:00
Jarrod Watts 2cc8f28d21 feat: add git push count threshold coloring (#292) (#372) 2026-04-04 15:24:07 +11:00
Jarrod Watts 1816b98fa9 feat: add output style display toggle (#343) (#370) 2026-04-04 15:18:42 +11:00
Jarrod Watts 37711c6c27 Merge pull request #369 from jarrodwatts/maintainer/pr-317-git-files
feat(git): add per-file diffs and files HUD line
2026-04-04 15:00:43 +11:00
Jarrod Watts f8c05371f9 test: cover git file diff rendering 2026-04-04 15:00:05 +11:00
Jarrod Watts 64de69c5cd Merge pull request #336 from krushnamegh/patch-1
Refactor agent rendering and status icon logic
2026-04-04 14:55:16 +11:00
Jarrod Watts 5d923d75ca test: cover agent elapsed formatting 2026-04-04 14:55:08 +11:00
Jarrod Watts dc329fcad7 Merge remote-tracking branch 'origin/main' into feat/session-token-usage 2026-04-04 14:53:18 +11:00
Jarrod Watts 1668b9ca50 test: harden session token usage parsing 2026-04-04 14:50:57 +11:00
Jarrod Watts 50128ce2f0 Merge remote-tracking branch 'origin/main' into feat/label
# Conflicts:
#	src/render/lines/usage.ts
#	src/render/session-line.ts
#	tests/render.test.js
2026-04-04 14:38:25 +11:00
Jarrod Watts 7ea5f331d9 fix: wrap HUD output when terminal width is unavailable 2026-04-04 13:59:08 +11:00
Jarrod Watts f223562354 test: align reset countdown expectation for i18n 2026-04-04 13:51:04 +11:00
Jarrod Watts 6c863b2f02 Merge main into i18n branch and keep English default 2026-04-04 13:50:24 +11:00
Jarrod Watts 03c394825c fix: stop guessing auth mode from env vars 2026-04-04 13:28:03 +11:00
Zane Wang e6ed4aa1a6 test: add render tests for modelFormat and modelOverride
Cover both rendering paths (expanded + compact) to verify that:
- modelFormat compact/short correctly strips context suffix and prefix
- modelOverride completely replaces the model name in the badge
- modelOverride takes precedence over modelFormat
- loadConfig structural test validates new display fields
2026-04-03 06:49:40 +08:00
xiaodream 7895941b8b fix: address code review findings for i18n
- Fix detectLanguage() to follow POSIX priority: LC_ALL > LC_MESSAGES > LANG
- Fix Chinese format.resetsIn from broken wrap-around grammar to prefix form
- Fix loadConfig() to call mergeConfig({}) when no config file exists,
  ensuring detectLanguage() runs for auto-detection
- Add setLanguage('en') guard to render.test.js for locale-independent tests
- Add dedicated i18n test suite (tests/i18n.test.js) covering t(),
  detectLanguage(), and mergeConfig language handling

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 17:03:53 +08:00
윤혁준 7752a901ee feat: add styled Weekly label for 7-day usage window
When both 5h and 7d usage windows are displayed, the 7d gauge had no
label prefix. This adds a dim-styled "Weekly" label (matching the
Context/Usage label style) and removes colons from usage window labels
for consistency with other HUD labels.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 14:08:59 +09:00
Jarrod Watts 7ea243ae88 feat: add configurable element colors 2026-03-23 15:04:40 +11:00
Jarrod Watts 3aebe1b973 Simplify usage display to stdin only (#288)
* Simplify usage display to stdin only

* chore: bump version to 0.0.11
2026-03-23 14:47:39 +11:00
Jarrod Watts 2ac029d035 fix weekly-only usage rendering 2026-03-23 13:17:21 +11:00
Jarrod Watts b76c7d36da clarify approximate memory hud wording 2026-03-23 13:08:02 +11:00
Jarrod Watts 210d274eee restack memory hud as opt-in expanded line 2026-03-23 13:03:45 +11:00
Jarrod Watts 11311be1ea milestone-3: add opt-in Claude Code version display 2026-03-23 12:33:27 +11:00
Jarrod Watts bafe095025 feat: add opt-in combined context display mode 2026-03-23 12:10:53 +11:00
Andrew Moore 40c4451d9c feat: support 256-color and hex color values in config (#236)
* feat: support 256-color and hex color values in config

Extends the colors config to accept 256-color indices (0-255) and hex
strings (#rrggbb) in addition to the existing named color presets.
This allows full theme customization without patching source files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: allow number type in color config validation test

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 11:52:59 +11:00
Xy cb407d0534 feat: add customLine display support (#223)
Add a static `display.customLine` config field that renders a user-defined
phrase (max 80 chars) in Claude orange on the project line, joined with
the standard │ separator.

- config.ts: add customLine to HudConfig.display with validation
- colors.ts: add claudeOrange() using 256-color (38;5;208)
- project.ts: append customLine to expanded mode project line
- session-line.ts: append customLine to compact mode parts
- setup.md: add "Custom line" option to Step 4
- configure.md: add Q5 Custom Line to both Flow A and Flow B
2026-03-20 11:52:29 +11:00
hoklims 8e51163c96 fix: render showSpeed and showDuration in expanded layout (#232)
* fix: render showSpeed and showDuration in expanded layout

These config options were only implemented in the compact layout
(renderSessionLine in session-line.ts). When using lineLayout: "expanded",
enabling display.showSpeed or display.showDuration had no effect.

This adds both options to renderProjectLine (the expanded layout's
project line), matching the compact layout behavior:
- showSpeed: output token speed (tok/s)
- showDuration: session duration timer

Fixes #221

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test: add renderProjectLine tests for showSpeed and showDuration

Address Copilot review feedback by adding test coverage for the
new expanded layout rendering of speed and duration:
- duration shown when showDuration is true
- duration omitted when showDuration is false
- speed code path doesn't crash when showSpeed is true
- speed omitted when showSpeed is false

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test: cover expanded layout speed rendering

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
2026-03-20 11:45:39 +11:00
d 🔹 2330284631 fix: clarify usage time format — show 'resets in' instead of ambiguous elapsed/total (#244)
* fix: clarify usage time format — show 'resets in' instead of ambiguous elapsed/total

Fixes #240

The format `(2h 43m / 5h)` was confusing because it mimics the common
`(elapsed / total)` pattern, but actually showed time remaining until
reset. Changed to `(resets in 2h 43m)` which is unambiguous.

Before: `Usage █░░░░░░░░░ 7% (2h 43m / 5h)`
After:  `Usage █░░░░░░░░░ 7% (resets in 2h 43m)`

* test: cover usage reset wording

---------

Co-authored-by: d 🔹 <258577966+voidborne-d@users.noreply.github.com>
Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
2026-03-20 11:43:34 +11:00
Chris Anthony 30f46e7fbd Fix extraLabel not displayed in expanded layout (#243)
The --extra-cmd feature only rendered extraLabel in compact mode via
renderSessionLine. In the default expanded layout, extraLabel was
collected but never passed to any render function.

Append extraLabel to the project line in expanded mode, consistent
with its placement on the session line in compact mode.

Fixes #242
2026-03-20 11:41:01 +11:00
Jarrod Watts a089537a11 fix: surface stale usage syncing during rate limits (#207) 2026-03-14 11:25:42 +11:00
Jarrod Watts 14763584eb feat: add configurable HUD color overrides (#206)
* feat: add configurable HUD color overrides

* docs: preserve manual color overrides in configure flow
2026-03-14 11:20:23 +11:00
Hwang In-wook 603e48f699 feat: show reset time for 7-day usage in text-only mode (#194)
* feat: show reset time for 7-day usage in text-only mode

- When usageBarEnabled is false, 7d usage now displays reset time,
- consistent with the existing 5h usage text-only behavior.

* test: cover text-mode 7-day reset countdown

---------

Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
2026-03-14 11:14:56 +11:00
Paul e8d64924bc fix: resilient usage display under API rate limiting (#193)
* fix: resilient usage display under API rate limiting

The Anthropic usage API rate-limits to ~1 call per 5 minutes. With the
previous 60s cache TTL, 4 out of 5 API calls returned 429, causing the
HUD to permanently display "(429)" instead of actual usage data.

Three-layer fix:
- Increase cache TTL from 60s to 5 minutes to match rate limit window
- Preserve lastGoodData in cache across rate-limited periods so the HUD
  always shows the best available data instead of errors
- Exponential backoff (60s→120s→240s→5min cap) with Retry-After header
  support for consecutive 429 responses

Also show "syncing..." instead of raw HTTP status on first-run rate limit.

* Update usage-api.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: harden 429 cache fallback behavior

* test: stabilize usage cache suite after rebase

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
2026-03-14 11:11:36 +11:00
Xingxing 069f194fb2 fix(context): scale autocompact buffer by raw usage (#190)
* fix(context): scale autocompact buffer by raw usage to avoid inflated percentages at low context

Previously the buffered context percentage applied a flat 22.5% buffer
regardless of actual usage. This caused the HUD to show ~28% context
used immediately after /clear or at session start, when real usage was
only ~5%. The fix scales the buffer linearly: zero buffer at ≤5% raw
usage, ramping to full buffer at ≥50%, matching when autocompact
actually kicks in.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test: harden autocompact buffer startup coverage

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
2026-03-14 10:57:49 +11:00
Jarrod Watts 499ddc881e fix(context): adjust autocompact fallback buffer (#184) 2026-03-09 14:37:25 +11:00
seb 6c8c89cb19 feat(config): repair expanded element ordering (#166)
Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
2026-03-06 10:55:44 +11:00
myaiexp 5467f29e50 feat(config): add showSessionName toggle (default off) (#170)
* feat(config): add showSessionName toggle (default off)

Session name display from #155 is now opt-in via display.showSessionName
config. This addresses user feedback requesting the ability to hide the
session name. Added to setup onboarding and configure command flows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test(docs): cover session-name default behavior

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
2026-03-06 10:44:05 +11:00
Jarrod Watts 9141620f45 fix(render): avoid non-breaking space output in status line (#165) 2026-03-05 18:36:06 +11:00
Fredrik Averpil 4d31c33682 feat: add showProject config to hide project name (#136)
* feat: add showProject config to hide project name from statusline

Adds `display.showProject` (default: true) to control whether the
project path is displayed. When set to false, the project name and
its associated git info are hidden from both compact and expanded
layouts.

* fix: keep git status visible when project name is hidden

---------

Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
2026-03-03 17:00:33 +11:00