Files
claude-hud/dist/render/tools-line.js
Jarrod Watts 7ce11b1ea9 fix: add marketplace.json and correct plugin installation flow
The previous installation command didn't work because Claude Code
plugins require a marketplace manifest. This adds the marketplace.json
and updates install instructions to the correct two-step flow:

1. /plugin marketplace add jarrodwatts/claude-hud
2. /plugin install claude-hud@claude-hud

Also commits dist/ for plugin distribution since users can't run
npm build when installing via marketplace.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 21:51:51 +11:00

40 lines
1.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { yellow, green, cyan, dim } from './colors.js';
export function renderToolsLine(ctx) {
const { tools } = ctx.transcript;
if (tools.length === 0) {
return null;
}
const parts = [];
const runningTools = tools.filter((t) => t.status === 'running');
const completedTools = tools.filter((t) => t.status === 'completed' || t.status === 'error');
for (const tool of runningTools.slice(-2)) {
const target = tool.target ? truncatePath(tool.target) : '';
parts.push(`${yellow('◐')} ${cyan(tool.name)}${target ? dim(`: ${target}`) : ''}`);
}
const toolCounts = new Map();
for (const tool of completedTools) {
const count = toolCounts.get(tool.name) ?? 0;
toolCounts.set(tool.name, count + 1);
}
const sortedTools = Array.from(toolCounts.entries())
.sort((a, b) => b[1] - a[1])
.slice(0, 4);
for (const [name, count] of sortedTools) {
parts.push(`${green('✓')} ${name} ${dim(`×${count}`)}`);
}
if (parts.length === 0) {
return null;
}
return parts.join(' | ');
}
function truncatePath(path, maxLen = 20) {
if (path.length <= maxLen)
return path;
const parts = path.split('/');
const filename = parts.pop() || path;
if (filename.length >= maxLen) {
return filename.slice(0, maxLen - 3) + '...';
}
return '.../' + filename;
}
//# sourceMappingURL=tools-line.js.map