提交

提交图

444 次代码提交

作者 SHA1 备注 提交日期
Jarrod Watts ee7562fc02 fix(render): only pad progress labels when lines stack 2026-04-20 18:53:58 +10:00
dependabot[bot] f6862cb8ba chore(deps-dev): bump @types/node from 25.5.2 to 25.6.0
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 25.5.2 to 25.6.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.6.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-20 18:49:02 +10:00
dependabot[bot] 6114b68be1 chore(deps-dev): bump typescript from 6.0.2 to 6.0.3
Bumps [typescript](https://github.com/microsoft/TypeScript) from 6.0.2 to 6.0.3.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Commits](https://github.com/microsoft/TypeScript/compare/v6.0.2...v6.0.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-version: 6.0.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-20 18:48:41 +10:00
github-actions[bot] 26776cfeda build: compile dist/ [auto] 2026-04-20 08:48:26 +00:00
Nandana Dileep 4b4506997b fix: show initial context tokens when used_percentage is 0
On a fresh session Claude Code emits used_percentage=0 before any user
input, while current_usage already holds the real initial-context tokens
(system prompt, tools, memory files — ~9% on a 200k model).  The HUD
was treating 0 as a valid native value and skipping the token-based
fallback, so the context bar stayed at 0% even though /context showed 9%.

Treat used_percentage=0 the same as null: fall through to the manual
calculation from current_usage.  When tokens are present the bar now
reflects the true initial usage; when both are zero it still shows 0%.

Fixes #417
2026-04-20 18:48:07 +10:00
github-actions[bot] 3139961220 build: compile dist/ [auto] 2026-04-20 08:46:22 +00: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 8e771def92 fix: align progress-bar labels to equal visual width (fixes #437)
When Context, Usage, and Weekly lines wrap to separate rows on narrow
terminals, their progress bars now align vertically. A shared
paddedLabel() helper pads each label with spaces to the maximum visual
width across the three labels, accounting for CJK double-width chars.

- Add src/render/lines/label-align.ts with paddedLabel() utility
- Update identity.ts and usage.ts to use paddedLabel()
- Add tests for English and Chinese label alignment
2026-04-20 18:46:07 +10:00
github-actions[bot] e7c0cb9ef3 build: compile dist/ [auto] 2026-04-20 08:45:13 +00:00
Wei Zheng eeca878a20 fix(render): move speed field after cost to stabilize HUD layout
The output speed (`out: N tok/s`) only renders while stdin is actively
streaming and disappears once output ends. Placing it between git and
duration causes the surrounding elements (duration, cost) to reflow
horizontally every time speed appears or disappears — jarring visual
churn on every turn.

Moving speed to the end of the line (after cost, before customLine)
means the transient field only appends/disappears at the tail, leaving
all stable elements in place.

Applied to both renderProjectLine (expanded layout) and
renderSessionLine (compact layout) for consistency.
2026-04-20 18:44:54 +10:00
Jarrod Watts 169ef0e810 fix(setup): keep Git Bash quoting fix on current command template 2026-04-20 18:39:05 +10:00
YuGe-Git 82aae32145 fix(setup): use sort -V for Windows Git Bash to avoid awk quoting breakage
The macOS/Linux awk-based version sorting command uses '"'"' to nest
single quotes inside bash -c '...'. After JSON encoding/decoding in
settings.json, this quoting breaks on Windows Git Bash, causing a
silent syntax error that prevents the HUD statusline from starting.

Replace awk with sort -V (GNU version sort, included with Git for
Windows) in the Windows + Git Bash section, which avoids nested
single quotes entirely.

Fixes #326

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-20 18:39:05 +10:00
Martijn van Elferen 83fe73dfa3 fix(setup): support marketplace install paths
Widen glob from cache/claude-hud/claude-hud/*/ to cache/*/claude-hud/*/
so setup detects the plugin regardless of install method.

Fixes #398
2026-04-20 18:37:03 +10:00
github-actions[bot] b554fc2a0c build: compile dist/ [auto] 2026-04-20 08:35:04 +00:00
Jarrod Watts f87bc8a32d fix: normalize resolved binary before validating cache 2026-04-20 18:34:42 +10:00
d 🔹 64262f680c fix: invalidate version cache when claude binary target changes 2026-04-20 18:34:42 +10:00
github-actions[bot] b62ddc2ca5 build: compile dist/ [auto] 2026-04-20 08:32:20 +00:00
Jarrod Watts 20d771f83e fix: label default agents as agent 2026-04-20 18:32:00 +10:00
simran91 338a761b3b fix(transcript): label default subagent_type as 'general-purpose'
When the Agent/Task tool is called without an explicit subagent_type
parameter, Claude Code's runtime defaults to the general-purpose agent
(per the Agent tool spec). The HUD only sees the transcript input and
previously fell back to the literal string 'unknown', which made
perfectly normal Agent launches look broken or untracked in the HUD's
agents line.

Flip the fallback to 'general-purpose' so the displayed label matches
the tool's actual runtime behavior.

Before: `✓ unknown: Build phase 2 agents`
After:  `✓ general-purpose: Build phase 2 agents`
2026-04-20 18:32:00 +10:00
github-actions[bot] 52e56571fb build: compile dist/ [auto] 2026-04-20 08:30:18 +00:00
Jarrod Watts d12762276a chore: drop generated stdin artifacts from PR 2026-04-20 18:29:58 +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
github-actions[bot] 0b87e4ad18 build: compile dist/ [auto] 2026-04-20 08:24:03 +00:00
Jarrod Watts 029cca67dd fix: export width override and prefer COLUMNS for HUD layout 2026-04-20 18:23:39 +10:00
墨泪 1b7859636a fix(setup): inject COLUMNS env for accurate terminal width detection
Claude Code runs the statusLine command as a subprocess with piped
stdout/stderr, so process.stdout.columns is unavailable. Without an
explicit COLUMNS value, getTerminalWidth() falls back to the
UNKNOWN_TERMINAL_WIDTH constant and width-dependent layout (line
combining, wrapping) cannot use the real terminal dimensions.

Fix: inject COLUMNS into the generated statusLine command on all
platforms:
- macOS/Linux/WSL: `stty size </dev/tty` reads from the controlling
  terminal (works even when stdout is piped)
- Windows PowerShell: `[Console]::WindowWidth` reads the console
  buffer width

Both subtract 4 columns to account for Claude Code's PromptInputFooter
padding (paddingX={2}, i.e. 2 columns on each side).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-20 18:23:39 +10:00
墨泪 e74af045ef fix(render): skip width-dependent layout when terminal width is unknown
When running as a CC statusLine subprocess, stdout/stderr are piped and
COLUMNS may not be set. getTerminalWidth() falls back to
UNKNOWN_TERMINAL_WIDTH (40), which is not a real measurement.

Previously, this fallback value was treated as real terminal width in two
places:
- canCombine in renderExpanded(): context + usage lines were always split
  because combined width exceeded 40 columns
- wrapLineToWidth in render(): all output lines were forcefully wrapped
  at 40 characters, breaking the layout

Fix: introduce a widthIsReal guard that checks whether the resolved width
is the UNKNOWN_TERMINAL_WIDTH sentinel. When width is unknown:
- canCombine defaults to true (combine lines optimistically)
- wrapLineToWidth is skipped (wrapWidth=0 → no-op)

The host process (Claude Code) handles final display layout, so wrapping
at an arbitrary fallback value is harmful rather than helpful.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-20 18:23:39 +10:00
github-actions[bot] bfde7cfd96 build: compile dist/ [auto] 2026-04-05 01:01:58 +00:00
Jarrod Watts 017041ed0d Merge pull request #381 from Yimaha/feat/native-cost-field
feat: use cost.total_cost_usd from stdin instead of manual token estimation
2026-04-05 11:01:40 +10:00
github-actions[bot] 99b5c2d1c0 build: compile dist/ [auto] 2026-04-05 01:01:30 +00:00
Jarrod Watts 9a4606a5b0 Merge pull request #384 from jarrodwatts/maintainer/board-20260405
fix: keep compact usage windows labeled on wrap
2026-04-05 11:01:13 +10:00
Jarrod Watts 565154d5cd fix(cost): prefer native stdin cost with safe fallback 2026-04-05 10:59:33 +10:00
Jarrod Watts 0d331e0ade fix(render): keep compact usage windows labeled on wrap 2026-04-05 10:59:33 +10:00
Jarrod Watts 71d0a0d94d Merge pull request #383 from jarrodwatts/dependabot/npm_and_yarn/types/node-25.5.2
chore(deps-dev): bump @types/node from 25.5.0 to 25.5.2
2026-04-05 10:43:56 +10:00
dependabot[bot] fb677baf9e chore(deps-dev): bump @types/node from 25.5.0 to 25.5.2
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 25.5.0 to 25.5.2.
- [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.5.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-04 21:32:38 +00: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
github-actions[bot] f4848b1acb build: compile dist/ [auto] 2026-04-04 07:07:41 +00:00
Jarrod Watts aa1f00e5bb Merge pull request #378 from jarrodwatts/maintainer/issue-375-stdin-timeout
fix: bound stdin reads to avoid statusline hangs
2026-04-04 18:07:23 +11:00
Jarrod Watts dad7ade968 fix: bound stdin reads to avoid statusline hangs 2026-04-04 18:06:06 +11:00
Jarrod Watts c4fd79e6d3 release: cut v0.0.12 (#377)
Release / release (push) Has been cancelled
v0.0.12
2026-04-04 17:54:51 +11:00
Jarrod Watts bfa69033dc docs: add language selection to configure flow (#376)
* docs: add language selection to configure flow

* docs: tighten configure language flow
2026-04-04 17:51:30 +11:00
github-actions[bot] ede1147a4d build: compile dist/ [auto] 2026-04-04 06:38:52 +00:00
Jarrod Watts 6dddf2ed1b feat: add offline estimated cost display (#305) (#374) 2026-04-04 17:38:30 +11:00
github-actions[bot] 6662b4d686 build: compile dist/ [auto] 2026-04-04 06:26:09 +00:00
Jarrod Watts b36a4977fa fix: stabilize CI version cache tests (#373) 2026-04-04 17:25:55 +11:00
Jarrod Watts 2cc8f28d21 feat: add git push count threshold coloring (#292) (#372) 2026-04-04 15:24:07 +11:00
Jarrod Watts 1d8b1ac491 fix: keep context and usage visible on narrow terminals (#314) (#371) 2026-04-04 15:20:33 +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
Peter Chan @ TreeholeHK 5869a69c25 feat(git): add per-file and total line diffs, clickable OSC 8 hyperlinks, dedicated files line
- git.ts: add LineDiff and TrackedFile interfaces; parse `git diff --numstat HEAD`
  for per-file and total line diffs; build GitHub branch URL from remote
- project.ts: add renderGitFilesLine() — a dedicated HUD line that shows
  modified/added/deleted files sorted by mtime, with per-file (+N -N) diffs,
  OSC 8 clickable file links, max 6 files, overflow count, untracked count
- project.ts: add OSC 8 clickable hyperlink for project folder (file://) and
  git branch (GitHub tree URL); show total [+N -N] on the project line
- render/index.ts: call renderGitFilesLine always-last in renderExpanded,
  passing terminalWidth so the line can suppress itself on narrow terminals
- render/lines/index.ts: export renderGitFilesLine

Enabled via existing `gitStatus.showFileStats: true` config flag.
2026-04-04 15:00:05 +11:00