Commit Graph

238 Commits

Author SHA1 Message Date
github-actions[bot]
cf1dbdef64 build: compile dist/ [auto] 2026-03-05 12:14:40 +00:00
xiangboit
9b491d09eb fix(usage-api): proxy CONNECT tunnel broken by premature socket return (#167)
* fix(usage-api): do not return socket from createConnection in proxy tunnel agent

Node.js _http_agent.js calls `oncreate(null, newSocket)` immediately
when createConnection returns a truthy value, which causes the HTTP
request to be written directly to the raw proxy socket before the
CONNECT handshake completes. Proxies like Clash reject this with
400 Bad Request, surfacing as persistent 403/network errors in the
Usage display.

Return undefined instead so the socket is only delivered via the
async callback after the CONNECT tunnel + TLS handshake succeeds.

Fixes proxy CONNECT failures with Clash and similar HTTP proxies.

* test(usage-api): cover proxy CONNECT request ordering

---------

Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
2026-03-05 23:14:15 +11:00
Jarrod Watts
b10fe59935 ci(release): use changelog notes with explicit token permissions 2026-03-05 18:43:18 +11:00
Jarrod Watts
b57aa1e8fa chore(release): 0.0.9 v0.0.9 2026-03-05 18:40:35 +11:00
github-actions[bot]
b8d6fd3f70 build: compile dist/ [auto] 2026-03-05 07:36:22 +00:00
Jarrod Watts
9141620f45 fix(render): avoid non-breaking space output in status line (#165) 2026-03-05 18:36:06 +11:00
github-actions[bot]
229636f4d9 build: compile dist/ [auto] 2026-03-05 07:33:05 +00:00
Jarrod Watts
a47f5b7905 fix: address Windows setup, Bedrock labels, and usage API reliability (#164)
* docs(setup): handle win32 bash vs powershell command paths

* fix(stdin): normalize bedrock model ids when display_name is missing

* fix(usage): harden proxy oauth fallback and timeout handling
2026-03-05 18:32:44 +11:00
github-actions[bot]
d9c48050f8 build: compile dist/ [auto] 2026-03-03 06:00:48 +00: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
github-actions[bot]
d373661ef7 build: compile dist/ [auto] 2026-03-03 05:47:32 +00:00
Jarrod Watts
9ae17fb644 fix: consolidate CLAUDE_CONFIG_DIR handling and keychain fallback (#160)
* fix: consolidate CLAUDE_CONFIG_DIR handling and keychain fallback

* chore: remove dist artifacts from this PR

* chore: bump version to 0.0.8

* docs: expand 0.0.8 changelog from post-0.0.7 commits
2026-03-03 16:47:15 +11:00
github-actions[bot]
c1d0583bea build: compile dist/ [auto] 2026-03-03 04:27:11 +00:00
dependabot[bot]
0e96fa8ac7 chore(deps-dev): bump @types/node from 25.2.3 to 25.3.3 (#153)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 25.2.3 to 25.3.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 25.3.3
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-03 15:26:48 +11:00
Jarrod Watts
6ff4212238 fix: prevent HUD rows disappearing in narrow terminals (#159)
* fix(render): handle narrow terminals without dropping rows

* chore: drop dist artifacts from issue-151 PR

* fix(render): preserve multiline activity under narrow widths
2026-03-03 15:26:30 +11:00
github-actions[bot]
b3dd713660 build: compile dist/ [auto] 2026-03-03 03:19:36 +00:00
Jarrod Watts
26eddbaec9 fix: prefer subscription plan label over API env var (#158) 2026-03-03 14:19:19 +11:00
github-actions[bot]
a4657530ba build: compile dist/ [auto] 2026-03-03 03:19:18 +00:00
Jarrod Watts
1792060612 feat(config): add contextValue remaining mode (#157) 2026-03-03 14:18:46 +11:00
github-actions[bot]
df61de50b4 build: compile dist/ [auto] 2026-03-03 03:08:33 +00:00
KwCCCC
eb81ffb1bd fix: display reset time in days when >= 24 hours (#132)
* fix: display reset time in days when >= 24 hours

The 7-day usage window reset countdown shows raw hours (e.g., "151h 59m")
which is hard to read. Format as days + hours when >= 24h (e.g., "6d 7h").

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

* test: cover day-based usage reset formatting

---------

Co-authored-by: KwCCCC <KwCCCC@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
2026-03-03 14:08:17 +11:00
github-actions[bot]
30c3a642b1 build: compile dist/ [auto] 2026-03-03 02:54:17 +00:00
myaiexp
bdfa4454b3 feat: show session name in statusline (#155)
* feat: show session name in statusline

Reads the session slug (auto-generated) and custom title (set via
/rename) from the transcript JSONL and displays it in dim text after
the project/git info on both expanded and compact layouts.

Custom title takes priority over auto-generated slug when both exist.

* test: add session name coverage and harden integration spawn

---------

Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
2026-03-03 13:54:01 +11:00
github-actions[bot]
883b281df4 build: compile dist/ [auto] 2026-03-03 02:48:46 +00:00
Ricky (aka 利器君)
bd520e42d7 fix: prevent double-counting CLAUDE.md when cwd is home directory (#141)
* fix: prevent double-counting CLAUDE.md when cwd is home directory

When the working directory is the user's home directory, the project
scope check for {cwd}/.claude/CLAUDE.md resolves to the same path as
the user scope check (~/.claude/CLAUDE.md), causing the HUD to display
"2 CLAUDE.md" instead of "1 CLAUDE.md". Skip the project scope
.claude/ checks when cwd equals the home directory.

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

* fix: handle home cwd config counting edge cases

* fix: avoid home cwd double-counting for rules and settings

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
2026-03-03 13:48:30 +11:00
github-actions[bot]
ac7929c181 build: compile dist/ [auto] 2026-03-03 02:43:44 +00:00
seb
dc3e34ed4b fix: handle object layout values in migrateConfig() (#144)
Add typeof guard to only run legacy string migration when layout is a
string. When layout is an object (written by third-party config editors),
extract nested lineLayout, showSeparators, and pathLevels to top level.

- Widen LegacyConfig type to accept Record<string, unknown>
- Export mergeConfig for direct testing of migration paths
- Add test cases for all migration scenarios
2026-03-03 13:43:25 +11:00
dependabot[bot]
803bea1c1e chore(deps-dev): bump c8 from 10.1.3 to 11.0.0 (#154)
Bumps [c8](https://github.com/bcoe/c8) from 10.1.3 to 11.0.0.
- [Release notes](https://github.com/bcoe/c8/releases)
- [Changelog](https://github.com/bcoe/c8/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bcoe/c8/compare/v10.1.3...v11.0.0)

---
updated-dependencies:
- dependency-name: c8
  dependency-version: 11.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-03 13:35:13 +11:00
Jarrod Watts
10193cc94a Bump marketplace version to 0.0.7 (#117)
* feat: show API billing indicator in model badge

When ANTHROPIC_API_KEY is present in the environment, display
[Opus | API] in red instead of [Opus | Max]. This helps users
who manage both Max plan and API key access (e.g., work vs personal)
immediately see when they're running on API billing.

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

* Bump marketplace version to 0.0.7

---------

Co-authored-by: Fielding Johnston <fielding@justfielding.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 13:53:01 +11:00
dependabot[bot]
c8918f48d2 chore(deps-dev): bump @types/node from 25.2.1 to 25.2.3 (#122)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 25.2.1 to 25.2.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 25.2.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-16 13:52:12 +11:00
dependabot[bot]
2497b92c3d chore(deps-dev): bump @types/node from 25.1.0 to 25.2.1 (#116)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 25.1.0 to 25.2.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 25.2.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-08 12:10:23 +11:00
Jarrod Watts
ffef15fc33 feat: redesign default layout to clean 2-line display (#112)
New default: model+project on line 1, context+usage bars combined on line 2.
All optional features (tools, agents, todos) hidden by default with
setup onboarding step to enable them.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 13:17:23 +11:00
Jarrod Watts
9fc2858619 feat: detect bedrock provider (#111) 2026-02-03 12:47:13 +11:00
github-actions[bot]
7e8e7e48c4 build: compile dist/ [auto] 2026-02-03 01:36:34 +00:00
Jarrod Watts
dec6efa509 feat(render): add output speed display (#110) 2026-02-03 12:36:19 +11:00
Jarrod Watts
0ac11a1f36 fix(usage): show api failure reason (#109) 2026-02-03 12:33:07 +11:00
Jarrod Watts
eafe12d876 feat(render): allow token context display (#108) 2026-02-03 12:20:00 +11:00
Jarrod Watts
f25627d7f8 feat(config): add seven-day usage threshold (#107) 2026-02-03 12:15:13 +11:00
Jarrod Watts
44adb2631d fix(transcript): support task todo updates (#106) 2026-02-03 12:14:27 +11:00
Jarrod Watts
c4582e9831 fix(render): keep hud to one line (#105) 2026-02-03 12:13:32 +11:00
dependabot[bot]
0ba87bae2b chore(deps-dev): bump @types/node from 25.0.9 to 25.1.0 (#103)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 25.0.9 to 25.1.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 25.1.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-03 11:44:58 +11:00
Jarrod Watts
f851ecc745 fix(setup): use Platform context instead of uname for detection (#95)
The Bash tool on Windows uses Git Bash as its interpreter, so `uname -s`
returns MINGW even when the user launched Claude Code from PowerShell.
This caused setup to generate bash commands that fail in PowerShell.

Fix: Instruct Claude to use the Platform value from its environment
context (darwin/linux/win32) instead of running uname. This correctly
identifies the user's actual platform regardless of the Bash tool's
environment.

- darwin → bash commands (macOS)
- linux → bash commands (all distros: Ubuntu, NixOS, Arch, etc.)
- win32 → PowerShell commands (works on PowerShell, cmd.exe, Git Bash)

Fixes #90

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 16:30:10 +11:00
github-actions[bot]
63855858ed build: compile dist/ [auto] 2026-01-19 05:11:41 +00:00
Jarrod Watts
17475d3f61 fix(extra-cmd): improve robustness and add tests (#94)
- Add debug logging for failures (uses DEBUG=claude-hud pattern)
- Support --extra-cmd=value syntax (in addition to --extra-cmd value)
- Reject empty values with debug warning
- Add security comment explaining shell injection is intentional (user CLI input)
- Export sanitize() for testability
- Add 30 unit tests for sanitize, arg parsing, timeout, malformed JSON

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 16:11:23 +11:00
github-actions[bot]
59c1203a84 build: compile dist/ [auto] 2026-01-19 04:24:44 +00:00
Jarrod Watts
32cd0ca56b feat: add --extra-cmd CLI argument for custom status labels (#92)
- Add `--extra-cmd` CLI flag to execute a user-specified command
- Command must return JSON with a `label` field, e.g., `{"label": "$1.23/day"}`
- Includes security hardening:
  - sanitize() to strip terminal escape sequences (CSI, OSC, control chars, bidi)
  - maxBuffer: 10KB limit to prevent memory issues
  - Label truncation to 50 chars max
- Display extraLabel in session line when present

Co-authored-by: Johnny Wang <johnnywang1991@msn.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 15:24:29 +11:00
github-actions[bot]
e8e55cd33b build: compile dist/ [auto] 2026-01-19 04:03:29 +00:00
Aster
e0df6fdf90 feat: add usageBarEnabled config option for quota display style (#85)
* feat: add usageBarEnabled config option for quota display style

Add configurable display style for usage limits:
- usageBarEnabled: true → visual bar (██░░ 25%)
- usageBarEnabled: false → text format (5h: 25%)

Changes:
- config.ts: Add usageBarEnabled option (default: true)
- colors.ts: Add quotaBar() and getQuotaColor() with blue color scheme
- usage.ts, session-line.ts: Conditional rendering based on config

Closes #84

* fix: add clamp guard to coloredBar for consistency

Apply the same safeWidth/safePercent guards from quotaBar to coloredBar
to prevent RangeError on malformed input values.

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

* chore: revert dist files to main

Remove build artifacts from PR diff. CI will rebuild dist/ after merge.

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

* test: add usageBarEnabled: false to baseContext

Ensures existing tests continue to check text format behavior.
The new bar format is opt-in via config.

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

---------

Co-authored-by: Aster Kim <aster@spoonlabs.com>
Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 15:03:12 +11:00
github-actions[bot]
eda85b4599 build: compile dist/ [auto] 2026-01-19 03:55:05 +00:00
Nikolay Bratanov
2a13e6f828 fix: resolve symlinks in path comparison for auto-execute (#87)
* fix: resolve symlinks in path comparison for auto-execute

The HUD fails to output when ~/.claude is a symlink (common on macOS
with iCloud). This happens because process.argv[1] contains the symlink
path while fileURLToPath resolves to the real path.

Use realpathSync to normalize both paths before comparison.

Fixes #86

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

* fix: add try/catch fallback for realpathSync

Wrap realpathSync calls in try/catch to handle edge cases where the path
doesn't exist, has permission issues, or has a broken symlink chain.
Falls back to raw path comparison on errors.

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

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
2026-01-19 14:54:48 +11:00