Reorganize: Move all skills to skills/ folder
- Created skills/ directory - Moved 272 skills to skills/ subfolder - Kept agents/ at root level - Kept installation scripts and docs at root level Repository structure: - skills/ - All 272 skills from skills.sh - agents/ - Agent definitions - *.sh, *.ps1 - Installation scripts - README.md, etc. - Documentation Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
3
skills/plugins/claude-hud/dist/render/agents-line.d.ts
vendored
Normal file
3
skills/plugins/claude-hud/dist/render/agents-line.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { RenderContext } from '../types.js';
|
||||
export declare function renderAgentsLine(ctx: RenderContext): string | null;
|
||||
//# sourceMappingURL=agents-line.d.ts.map
|
||||
1
skills/plugins/claude-hud/dist/render/agents-line.d.ts.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/agents-line.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"agents-line.d.ts","sourceRoot":"","sources":["../../src/render/agents-line.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAc,MAAM,aAAa,CAAC;AAG7D,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI,CAqBlE"}
|
||||
44
skills/plugins/claude-hud/dist/render/agents-line.js
vendored
Normal file
44
skills/plugins/claude-hud/dist/render/agents-line.js
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
import { yellow, green, magenta, dim } from './colors.js';
|
||||
export function renderAgentsLine(ctx) {
|
||||
const { agents } = ctx.transcript;
|
||||
const runningAgents = agents.filter((a) => a.status === 'running');
|
||||
const recentCompleted = agents
|
||||
.filter((a) => a.status === 'completed')
|
||||
.slice(-2);
|
||||
const toShow = [...runningAgents, ...recentCompleted].slice(-3);
|
||||
if (toShow.length === 0) {
|
||||
return null;
|
||||
}
|
||||
const lines = [];
|
||||
for (const agent of toShow) {
|
||||
lines.push(formatAgent(agent));
|
||||
}
|
||||
return lines.join('\n');
|
||||
}
|
||||
function formatAgent(agent) {
|
||||
const statusIcon = agent.status === 'running' ? yellow('◐') : green('✓');
|
||||
const type = magenta(agent.type);
|
||||
const model = agent.model ? dim(`[${agent.model}]`) : '';
|
||||
const desc = agent.description ? dim(`: ${truncateDesc(agent.description)}`) : '';
|
||||
const elapsed = formatElapsed(agent);
|
||||
return `${statusIcon} ${type}${model ? ` ${model}` : ''}${desc} ${dim(`(${elapsed})`)}`;
|
||||
}
|
||||
function truncateDesc(desc, maxLen = 40) {
|
||||
if (desc.length <= maxLen)
|
||||
return desc;
|
||||
return desc.slice(0, maxLen - 3) + '...';
|
||||
}
|
||||
function formatElapsed(agent) {
|
||||
const now = Date.now();
|
||||
const start = agent.startTime.getTime();
|
||||
const end = agent.endTime?.getTime() ?? now;
|
||||
const ms = end - start;
|
||||
if (ms < 1000)
|
||||
return '<1s';
|
||||
if (ms < 60000)
|
||||
return `${Math.round(ms / 1000)}s`;
|
||||
const mins = Math.floor(ms / 60000);
|
||||
const secs = Math.round((ms % 60000) / 1000);
|
||||
return `${mins}m ${secs}s`;
|
||||
}
|
||||
//# sourceMappingURL=agents-line.js.map
|
||||
1
skills/plugins/claude-hud/dist/render/agents-line.js.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/agents-line.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"agents-line.js","sourceRoot":"","sources":["../../src/render/agents-line.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAE1D,MAAM,UAAU,gBAAgB,CAAC,GAAkB;IACjD,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,UAAU,CAAC;IAElC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;IACnE,MAAM,eAAe,GAAG,MAAM;SAC3B,MAAM,CA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EAAE,GAAG,IAAI,IAAI,GAAG,CAAC,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;AAC1F,CAAC;AAED,SAAS,YAAY,CAAC,IAAY,EAAE,SAAiB,EAAE;IACrD,IAAI,IAAI,CAAC,MAAM,IAAI,MAAM;QAAE,OAAO,IAAI,CAAC;IACvC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;AAC3C,CAAC;AAED,SAAS,aAAa,CAAC,KAAiB;IACtC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IACxC,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,GAAG,CAAC;IAC5C,MAAM,EAAE,GAAG,GAAG,GAAG,KAAK,CAAC;IAEvB,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAC;IAC5B,IAAI,EAAE,GAAG,KAAK;QAAE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;IAEnD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC;IACpC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IAC7C,OAAO,GAAG,IAAI,KAAK,IAAI,GAAG,CAAC;AAC7B,CAAC"}
|
||||
10
skills/plugins/claude-hud/dist/render/colors.d.ts
vendored
Normal file
10
skills/plugins/claude-hud/dist/render/colors.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
export declare const RESET = "\u001B[0m";
|
||||
export declare function green(text: string): string;
|
||||
export declare function yellow(text: string): string;
|
||||
export declare function red(text: string): string;
|
||||
export declare function cyan(text: string): string;
|
||||
export declare function magenta(text: string): string;
|
||||
export declare function dim(text: string): string;
|
||||
export declare function getContextColor(percent: number): string;
|
||||
export declare function coloredBar(percent: number, width?: number): string;
|
||||
//# sourceMappingURL=colors.d.ts.map
|
||||
1
skills/plugins/claude-hud/dist/render/colors.d.ts.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/colors.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/render/colors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,cAAY,CAAC;AAS/B,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1C;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExC;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExC;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAIvD;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,GAAG,MAAM,CAKtE"}
|
||||
39
skills/plugins/claude-hud/dist/render/colors.js
vendored
Normal file
39
skills/plugins/claude-hud/dist/render/colors.js
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
export const RESET = '\x1b[0m';
|
||||
const DIM = '\x1b[2m';
|
||||
const RED = '\x1b[31m';
|
||||
const GREEN = '\x1b[32m';
|
||||
const YELLOW = '\x1b[33m';
|
||||
const MAGENTA = '\x1b[35m';
|
||||
const CYAN = '\x1b[36m';
|
||||
export function green(text) {
|
||||
return `${GREEN}${text}${RESET}`;
|
||||
}
|
||||
export function yellow(text) {
|
||||
return `${YELLOW}${text}${RESET}`;
|
||||
}
|
||||
export function red(text) {
|
||||
return `${RED}${text}${RESET}`;
|
||||
}
|
||||
export function cyan(text) {
|
||||
return `${CYAN}${text}${RESET}`;
|
||||
}
|
||||
export function magenta(text) {
|
||||
return `${MAGENTA}${text}${RESET}`;
|
||||
}
|
||||
export function dim(text) {
|
||||
return `${DIM}${text}${RESET}`;
|
||||
}
|
||||
export function getContextColor(percent) {
|
||||
if (percent >= 85)
|
||||
return RED;
|
||||
if (percent >= 70)
|
||||
return YELLOW;
|
||||
return GREEN;
|
||||
}
|
||||
export function coloredBar(percent, width = 10) {
|
||||
const filled = Math.round((percent / 100) * width);
|
||||
const empty = width - filled;
|
||||
const color = getContextColor(percent);
|
||||
return `${color}${'█'.repeat(filled)}${DIM}${'░'.repeat(empty)}${RESET}`;
|
||||
}
|
||||
//# sourceMappingURL=colors.js.map
|
||||
1
skills/plugins/claude-hud/dist/render/colors.js.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/colors.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../../src/render/colors.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG,SAAS,CAAC;AAE/B,MAAM,GAAG,GAAG,SAAS,CAAC;AACtB,MAAM,GAAG,GAAG,UAAU,CAAC;AACvB,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,MAAM,GAAG,UAAU,CAAC;AAC1B,MAAM,OAAO,GAAG,UAAU,CAAC;AAC3B,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB,MAAM,UAAU,KAAK,CAAC,IAAY;IAChC,OAAO,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,EAAE,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,IAAY;IACjC,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,KAAK,EAAE,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,IAAY;IAC9B,OAAO,GAAG,GAAG,GAAG,IAAI,GAAG,KAAK,EAAE,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,IAAY;IAC/B,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,EAAE,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,GAAG,OAAO,GAAG,IAAI,GAAG,KAAK,EAAE,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,IAAY;IAC9B,OAAO,GAAG,GAAG,GAAG,IAAI,GAAG,KAAK,EAAE,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,IAAI,OAAO,IAAI,EAAE;QAAE,OAAO,GAAG,CAAC;IAC9B,IAAI,OAAO,IAAI,EAAE;QAAE,OAAO,MAAM,CAAC;IACjC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,OAAe,EAAE,QAAgB,EAAE;IAC5D,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;IACnD,MAAM,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAC7B,MAAM,KAAK,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IACvC,OAAO,GAAG,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,EAAE,CAAC;AAC3E,CAAC"}
|
||||
3
skills/plugins/claude-hud/dist/render/index.d.ts
vendored
Normal file
3
skills/plugins/claude-hud/dist/render/index.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { RenderContext } from '../types.js';
|
||||
export declare function render(ctx: RenderContext): void;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
skills/plugins/claude-hud/dist/render/index.d.ts.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/index.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/render/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAuFjD,wBAAgB,MAAM,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAuB/C"}
|
||||
83
skills/plugins/claude-hud/dist/render/index.js
vendored
Normal file
83
skills/plugins/claude-hud/dist/render/index.js
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
import { renderSessionLine } from './session-line.js';
|
||||
import { renderToolsLine } from './tools-line.js';
|
||||
import { renderAgentsLine } from './agents-line.js';
|
||||
import { renderTodosLine } from './todos-line.js';
|
||||
import { renderIdentityLine, renderProjectLine, renderEnvironmentLine, renderUsageLine, } from './lines/index.js';
|
||||
import { dim, RESET } from './colors.js';
|
||||
function visualLength(str) {
|
||||
// eslint-disable-next-line no-control-regex
|
||||
return str.replace(/\x1b\[[0-9;]*m/g, '').length;
|
||||
}
|
||||
function makeSeparator(length) {
|
||||
return dim('─'.repeat(Math.max(length, 20)));
|
||||
}
|
||||
function collectActivityLines(ctx) {
|
||||
const activityLines = [];
|
||||
const display = ctx.config?.display;
|
||||
if (display?.showTools !== false) {
|
||||
const toolsLine = renderToolsLine(ctx);
|
||||
if (toolsLine) {
|
||||
activityLines.push(toolsLine);
|
||||
}
|
||||
}
|
||||
if (display?.showAgents !== false) {
|
||||
const agentsLine = renderAgentsLine(ctx);
|
||||
if (agentsLine) {
|
||||
activityLines.push(agentsLine);
|
||||
}
|
||||
}
|
||||
if (display?.showTodos !== false) {
|
||||
const todosLine = renderTodosLine(ctx);
|
||||
if (todosLine) {
|
||||
activityLines.push(todosLine);
|
||||
}
|
||||
}
|
||||
return activityLines;
|
||||
}
|
||||
function renderCompact(ctx) {
|
||||
const lines = [];
|
||||
const sessionLine = renderSessionLine(ctx);
|
||||
if (sessionLine) {
|
||||
lines.push(sessionLine);
|
||||
}
|
||||
return lines;
|
||||
}
|
||||
function renderExpanded(ctx) {
|
||||
const lines = [];
|
||||
const identityLine = renderIdentityLine(ctx);
|
||||
if (identityLine) {
|
||||
lines.push(identityLine);
|
||||
}
|
||||
const projectLine = renderProjectLine(ctx);
|
||||
if (projectLine) {
|
||||
lines.push(projectLine);
|
||||
}
|
||||
const environmentLine = renderEnvironmentLine(ctx);
|
||||
if (environmentLine) {
|
||||
lines.push(environmentLine);
|
||||
}
|
||||
const usageLine = renderUsageLine(ctx);
|
||||
if (usageLine) {
|
||||
lines.push(usageLine);
|
||||
}
|
||||
return lines;
|
||||
}
|
||||
export function render(ctx) {
|
||||
const lineLayout = ctx.config?.lineLayout ?? 'expanded';
|
||||
const showSeparators = ctx.config?.showSeparators ?? false;
|
||||
const headerLines = lineLayout === 'expanded'
|
||||
? renderExpanded(ctx)
|
||||
: renderCompact(ctx);
|
||||
const activityLines = collectActivityLines(ctx);
|
||||
const lines = [...headerLines];
|
||||
if (showSeparators && activityLines.length > 0) {
|
||||
const maxWidth = Math.max(...headerLines.map(visualLength), 20);
|
||||
lines.push(makeSeparator(maxWidth));
|
||||
}
|
||||
lines.push(...activityLines);
|
||||
for (const line of lines) {
|
||||
const outputLine = `${RESET}${line.replace(/ /g, '\u00A0')}`;
|
||||
console.log(outputLine);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
skills/plugins/claude-hud/dist/render/index.js.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/index.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/render/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,M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K,UAAU;QAC3C,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC;QACrB,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAEvB,MAAM,aAAa,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;IAEhD,MAAM,KAAK,GAAa,CAAC,GAAG,WAAW,CAAC,CAAC;IAEzC,IAAI,cAAc,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC,CAAC;QAChE,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC;IAE7B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,UAAU,GAAG,GAAG,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC;QAC7D,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC1B,CAAC;AACH,CAAC"}
|
||||
3
skills/plugins/claude-hud/dist/render/lines/environment.d.ts
vendored
Normal file
3
skills/plugins/claude-hud/dist/render/lines/environment.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { RenderContext } from '../../types.js';
|
||||
export declare function renderEnvironmentLine(ctx: RenderContext): string | null;
|
||||
//# sourceMappingURL=environment.d.ts.map
|
||||
1
skills/plugins/claude-hud/dist/render/lines/environment.d.ts.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/lines/environment.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../src/render/lines/environment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGpD,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI,CAqCvE"}
|
||||
30
skills/plugins/claude-hud/dist/render/lines/environment.js
vendored
Normal file
30
skills/plugins/claude-hud/dist/render/lines/environment.js
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import { dim } from '../colors.js';
|
||||
export function renderEnvironmentLine(ctx) {
|
||||
const display = ctx.config?.display;
|
||||
if (display?.showConfigCounts === false) {
|
||||
return null;
|
||||
}
|
||||
const totalCounts = ctx.claudeMdCount + ctx.rulesCount + ctx.mcpCount + ctx.hooksCount;
|
||||
const threshold = display?.environmentThreshold ?? 0;
|
||||
if (totalCounts === 0 || totalCounts < threshold) {
|
||||
return null;
|
||||
}
|
||||
const parts = [];
|
||||
if (ctx.claudeMdCount > 0) {
|
||||
parts.push(`${ctx.claudeMdCount} CLAUDE.md`);
|
||||
}
|
||||
if (ctx.rulesCount > 0) {
|
||||
parts.push(`${ctx.rulesCount} rules`);
|
||||
}
|
||||
if (ctx.mcpCount > 0) {
|
||||
parts.push(`${ctx.mcpCount} MCPs`);
|
||||
}
|
||||
if (ctx.hooksCount > 0) {
|
||||
parts.push(`${ctx.hooksCount} hooks`);
|
||||
}
|
||||
if (parts.length === 0) {
|
||||
return null;
|
||||
}
|
||||
return dim(parts.join(' | '));
|
||||
}
|
||||
//# sourceMappingURL=environment.js.map
|
||||
1
skills/plugins/claude-hud/dist/render/lines/environment.js.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/lines/environment.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../src/render/lines/environment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,MAAM,UAAU,qBAAqB,CAAC,GAAkB;IACtD,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAEpC,IAAI,OAAO,E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0 +1,3 @@
|
||||
import type { RenderContext } from '../../types.js';
|
||||
export declare function renderIdentityLine(ctx: RenderContext): string;
|
||||
//# sourceMappingURL=identity.d.ts.map
|
||||
1
skills/plugins/claude-hud/dist/render/lines/identity.d.ts.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/lines/identity.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/render/lines/identity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAMpD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CA6C7D"}
|
||||
53
skills/plugins/claude-hud/dist/render/lines/identity.js
vendored
Normal file
53
skills/plugins/claude-hud/dist/render/lines/identity.js
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
import { getContextPercent, getBufferedPercent, getModelName } from '../../stdin.js';
|
||||
import { coloredBar, cyan, dim, getContextColor, RESET } from '../colors.js';
|
||||
const DEBUG = process.env.DEBUG?.includes('claude-hud') || process.env.DEBUG === '*';
|
||||
export function renderIdentityLine(ctx) {
|
||||
const model = getModelName(ctx.stdin);
|
||||
const rawPercent = getContextPercent(ctx.stdin);
|
||||
const bufferedPercent = getBufferedPercent(ctx.stdin);
|
||||
const autocompactMode = ctx.config?.display?.autocompactBuffer ?? 'enabled';
|
||||
const percent = autocompactMode === 'disabled' ? rawPercent : bufferedPercent;
|
||||
if (DEBUG && autocompactMode === 'disabled') {
|
||||
console.error(`[claude-hud:context] autocompactBuffer=disabled, showing raw ${rawPercent}% (buffered would be ${bufferedPercent}%)`);
|
||||
}
|
||||
const bar = coloredBar(percent);
|
||||
const display = ctx.config?.display;
|
||||
const parts = [];
|
||||
const planName = display?.showUsage !== false ? ctx.usageData?.planName : undefined;
|
||||
const modelDisplay = planName ? `${model} | ${planName}` : model;
|
||||
if (display?.showModel !== false && display?.showContextBar !== false) {
|
||||
parts.push(`${cyan(`[${modelDisplay}]`)} ${bar} ${getContextColor(percent)}${percent}%${RESET}`);
|
||||
}
|
||||
else if (display?.showModel !== false) {
|
||||
parts.push(`${cyan(`[${modelDisplay}]`)} ${getContextColor(percent)}${percent}%${RESET}`);
|
||||
}
|
||||
else if (display?.showContextBar !== false) {
|
||||
parts.push(`${bar} ${getContextColor(percent)}${percent}%${RESET}`);
|
||||
}
|
||||
else {
|
||||
parts.push(`${getContextColor(percent)}${percent}%${RESET}`);
|
||||
}
|
||||
if (display?.showDuration !== false && ctx.sessionDuration) {
|
||||
parts.push(dim(`⏱️ ${ctx.sessionDuration}`));
|
||||
}
|
||||
let line = parts.join(' | ');
|
||||
if (display?.showTokenBreakdown !== false && percent >= 85) {
|
||||
const usage = ctx.stdin.context_window?.current_usage;
|
||||
if (usage) {
|
||||
const input = formatTokens(usage.input_tokens ?? 0);
|
||||
const cache = formatTokens((usage.cache_creation_input_tokens ?? 0) + (usage.cache_read_input_tokens ?? 0));
|
||||
line += dim(` (in: ${input}, cache: ${cache})`);
|
||||
}
|
||||
}
|
||||
return line;
|
||||
}
|
||||
function formatTokens(n) {
|
||||
if (n >= 1000000) {
|
||||
return `${(n / 1000000).toFixed(1)}M`;
|
||||
}
|
||||
if (n >= 1000) {
|
||||
return `${(n / 1000).toFixed(0)}k`;
|
||||
}
|
||||
return n.toString();
|
||||
}
|
||||
//# sourceMappingURL=identity.js.map
|
||||
1
skills/plugins/claude-hud/dist/render/lines/identity.js.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/lines/identity.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../../src/render/lines/identity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,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2BAA2B,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,uBAAuB,IAAI,CAAC,CAAC,CAAC,CAAC;YAC5G,IAAI,IAAI,GAAG,CAAC,SAAS,KAAK,YAAY,KAAK,GAAG,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,YAAY,CAAC,CAAS;IAC7B,IAAI,CAAC,IAAI,OAAO,EAAE,CAAC;QACjB,OAAO,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;IACxC,CAAC;IACD,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;QACd,OAAO,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;IACrC,CAAC;IACD,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;AACtB,CAAC"}
|
||||
5
skills/plugins/claude-hud/dist/render/lines/index.d.ts
vendored
Normal file
5
skills/plugins/claude-hud/dist/render/lines/index.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export { renderIdentityLine } from './identity.js';
|
||||
export { renderProjectLine } from './project.js';
|
||||
export { renderEnvironmentLine } from './environment.js';
|
||||
export { renderUsageLine } from './usage.js';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
skills/plugins/claude-hud/dist/render/lines/index.d.ts.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/lines/index.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/render/lines/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
|
||||
5
skills/plugins/claude-hud/dist/render/lines/index.js
vendored
Normal file
5
skills/plugins/claude-hud/dist/render/lines/index.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export { renderIdentityLine } from './identity.js';
|
||||
export { renderProjectLine } from './project.js';
|
||||
export { renderEnvironmentLine } from './environment.js';
|
||||
export { renderUsageLine } from './usage.js';
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
skills/plugins/claude-hud/dist/render/lines/index.js.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/lines/index.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/render/lines/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
|
||||
3
skills/plugins/claude-hud/dist/render/lines/project.d.ts
vendored
Normal file
3
skills/plugins/claude-hud/dist/render/lines/project.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { RenderContext } from '../../types.js';
|
||||
export declare function renderProjectLine(ctx: RenderContext): string | null;
|
||||
//# sourceMappingURL=project.d.ts.map
|
||||
1
skills/plugins/claude-hud/dist/render/lines/project.d.ts.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/lines/project.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/render/lines/project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGpD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI,CA6CnE"}
|
||||
44
skills/plugins/claude-hud/dist/render/lines/project.js
vendored
Normal file
44
skills/plugins/claude-hud/dist/render/lines/project.js
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
import { cyan, magenta, yellow } from '../colors.js';
|
||||
export function renderProjectLine(ctx) {
|
||||
if (!ctx.stdin.cwd) {
|
||||
return null;
|
||||
}
|
||||
const segments = ctx.stdin.cwd.split(/[/\\]/).filter(Boolean);
|
||||
const pathLevels = ctx.config?.pathLevels ?? 1;
|
||||
const projectPath = segments.length > 0 ? segments.slice(-pathLevels).join('/') : '/';
|
||||
let gitPart = '';
|
||||
const gitConfig = ctx.config?.gitStatus;
|
||||
const showGit = gitConfig?.enabled ?? true;
|
||||
if (showGit && ctx.gitStatus) {
|
||||
const gitParts = [ctx.gitStatus.branch];
|
||||
if ((gitConfig?.showDirty ?? true) && ctx.gitStatus.isDirty) {
|
||||
gitParts.push('*');
|
||||
}
|
||||
if (gitConfig?.showAheadBehind) {
|
||||
if (ctx.gitStatus.ahead > 0) {
|
||||
gitParts.push(` ↑${ctx.gitStatus.ahead}`);
|
||||
}
|
||||
if (ctx.gitStatus.behind > 0) {
|
||||
gitParts.push(` ↓${ctx.gitStatus.behind}`);
|
||||
}
|
||||
}
|
||||
if (gitConfig?.showFileStats && ctx.gitStatus.fileStats) {
|
||||
const { modified, added, deleted, untracked } = ctx.gitStatus.fileStats;
|
||||
const statParts = [];
|
||||
if (modified > 0)
|
||||
statParts.push(`!${modified}`);
|
||||
if (added > 0)
|
||||
statParts.push(`+${added}`);
|
||||
if (deleted > 0)
|
||||
statParts.push(`✘${deleted}`);
|
||||
if (untracked > 0)
|
||||
statParts.push(`?${untracked}`);
|
||||
if (statParts.length > 0) {
|
||||
gitParts.push(` ${statParts.join(' ')}`);
|
||||
}
|
||||
}
|
||||
gitPart = ` ${magenta('git:(')}${cyan(gitParts.join(''))}${magenta(')')}`;
|
||||
}
|
||||
return `${yellow(projectPath)}${gitPart}`;
|
||||
}
|
||||
//# sourceMappingURL=project.js.map
|
||||
1
skills/plugins/claude-hud/dist/render/lines/project.js.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/lines/project.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../../src/render/lines/project.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAErD,MAAM,UAAU,iBAAiB,CAAC,GAAkB;IAClD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9D,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,IAAI,CAAC,CAAC;IAC/C,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAEtF,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC;IACxC,MAAM,OAAO,GAAG,SAAS,EAAE,OAAO,IAAI,IAAI,CAAC;IAE3C,IAAI,OAAO,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAa,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAElD,IAAI,CAAC,SAAS,EAAE,SAAS,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;YAC5D,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;QAED,IAAI,SAAS,EA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C,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;IAC5E,CAAC;IAED,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,OAAO,EAAE,CAAC;AAC5C,CAAC"}
|
||||
3
skills/plugins/claude-hud/dist/render/lines/usage.d.ts
vendored
Normal file
3
skills/plugins/claude-hud/dist/render/lines/usage.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { RenderContext } from '../../types.js';
|
||||
export declare function renderUsageLine(ctx: RenderContext): string | null;
|
||||
//# sourceMappingURL=usage.d.ts.map
|
||||
1
skills/plugins/claude-hud/dist/render/lines/usage.d.ts.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/lines/usage.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/render/lines/usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAIpD,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI,CA2CjE"}
|
||||
59
skills/plugins/claude-hud/dist/render/lines/usage.js
vendored
Normal file
59
skills/plugins/claude-hud/dist/render/lines/usage.js
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
import { isLimitReached } from '../../types.js';
|
||||
import { red, yellow, dim, getContextColor, RESET } from '../colors.js';
|
||||
export function renderUsageLine(ctx) {
|
||||
const display = ctx.config?.display;
|
||||
if (display?.showUsage === false) {
|
||||
return null;
|
||||
}
|
||||
if (!ctx.usageData?.planName) {
|
||||
return null;
|
||||
}
|
||||
if (ctx.usageData.apiUnavailable) {
|
||||
return yellow(`usage: ⚠`);
|
||||
}
|
||||
if (isLimitReached(ctx.usageData)) {
|
||||
const resetTime = ctx.usageData.fiveHour === 100
|
||||
? formatResetTime(ctx.usageData.fiveHourResetAt)
|
||||
: formatResetTime(ctx.usageData.sevenDayResetAt);
|
||||
return red(`⚠ Limit reached${resetTime ? ` (resets ${resetTime})` : ''}`);
|
||||
}
|
||||
const threshold = display?.usageThreshold ?? 0;
|
||||
const fiveHour = ctx.usageData.fiveHour;
|
||||
const sevenDay = ctx.usageData.sevenDay;
|
||||
const effectiveUsage = Math.max(fiveHour ?? 0, sevenDay ?? 0);
|
||||
if (effectiveUsage < threshold) {
|
||||
return null;
|
||||
}
|
||||
const fiveHourDisplay = formatUsagePercent(ctx.usageData.fiveHour);
|
||||
const fiveHourReset = formatResetTime(ctx.usageData.fiveHourResetAt);
|
||||
const fiveHourPart = fiveHourReset
|
||||
? `5h: ${fiveHourDisplay} (${fiveHourReset})`
|
||||
: `5h: ${fiveHourDisplay}`;
|
||||
if (sevenDay !== null && sevenDay >= 80) {
|
||||
const sevenDayDisplay = formatUsagePercent(sevenDay);
|
||||
return `${fiveHourPart} | 7d: ${sevenDayDisplay}`;
|
||||
}
|
||||
return fiveHourPart;
|
||||
}
|
||||
function formatUsagePercent(percent) {
|
||||
if (percent === null) {
|
||||
return dim('--');
|
||||
}
|
||||
const color = getContextColor(percent);
|
||||
return `${color}${percent}%${RESET}`;
|
||||
}
|
||||
function formatResetTime(resetAt) {
|
||||
if (!resetAt)
|
||||
return '';
|
||||
const now = new Date();
|
||||
const diffMs = resetAt.getTime() - now.getTime();
|
||||
if (diffMs <= 0)
|
||||
return '';
|
||||
const diffMins = Math.ceil(diffMs / 60000);
|
||||
if (diffMins < 60)
|
||||
return `${diffMins}m`;
|
||||
const hours = Math.floor(diffMins / 60);
|
||||
const mins = diffMins % 60;
|
||||
return mins > 0 ? `${hours}h ${mins}m` : `${hours}h`;
|
||||
}
|
||||
//# sourceMappingURL=usage.js.map
|
||||
1
skills/plugins/claude-hud/dist/render/lines/usage.js.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/lines/usage.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../../src/render/lines/usage.ts"],"names":[],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QAAQ,GAAG,CAAC;IAEzC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAC;IACxC,MAAM,IAAI,GAAG,QAAQ,GAAG,EAAE,CAAC;IAC3B,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC;AACvD,CAAC"}
|
||||
7
skills/plugins/claude-hud/dist/render/session-line.d.ts
vendored
Normal file
7
skills/plugins/claude-hud/dist/render/session-line.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { RenderContext } from '../types.js';
|
||||
/**
|
||||
* Renders the full session line (model + context bar + project + git + counts + usage + duration).
|
||||
* Used for compact layout mode.
|
||||
*/
|
||||
export declare function renderSessionLine(ctx: RenderContext): string;
|
||||
//# sourceMappingURL=session-line.d.ts.map
|
||||
1
skills/plugins/claude-hud/dist/render/session-line.d.ts.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/session-line.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"session-line.d.ts","sourceRoot":"","sources":["../../src/render/session-line.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAOjD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CA6J5D"}
|
||||
181
skills/plugins/claude-hud/dist/render/session-line.js
vendored
Normal file
181
skills/plugins/claude-hud/dist/render/session-line.js
vendored
Normal file
@@ -0,0 +1,181 @@
|
||||
import { isLimitReached } from '../types.js';
|
||||
import { getContextPercent, getBufferedPercent, getModelName } from '../stdin.js';
|
||||
import { coloredBar, cyan, dim, magenta, red, yellow, getContextColor, RESET } from './colors.js';
|
||||
const DEBUG = process.env.DEBUG?.includes('claude-hud') || process.env.DEBUG === '*';
|
||||
/**
|
||||
* Renders the full session line (model + context bar + project + git + counts + usage + duration).
|
||||
* Used for compact layout mode.
|
||||
*/
|
||||
export function renderSessionLine(ctx) {
|
||||
const model = getModelName(ctx.stdin);
|
||||
const rawPercent = getContextPercent(ctx.stdin);
|
||||
const bufferedPercent = getBufferedPercent(ctx.stdin);
|
||||
const autocompactMode = ctx.config?.display?.autocompactBuffer ?? 'enabled';
|
||||
const percent = autocompactMode === 'disabled' ? rawPercent : bufferedPercent;
|
||||
if (DEBUG && autocompactMode === 'disabled') {
|
||||
console.error(`[claude-hud:context] autocompactBuffer=disabled, showing raw ${rawPercent}% (buffered would be ${bufferedPercent}%)`);
|
||||
}
|
||||
const bar = coloredBar(percent);
|
||||
const parts = [];
|
||||
const display = ctx.config?.display;
|
||||
// Model and context bar (FIRST)
|
||||
// Plan name only shows if showUsage is enabled (respects hybrid toggle)
|
||||
const planName = display?.showUsage !== false ? ctx.usageData?.planName : undefined;
|
||||
const modelDisplay = planName ? `${model} | ${planName}` : model;
|
||||
if (display?.showModel !== false && display?.showContextBar !== false) {
|
||||
parts.push(`${cyan(`[${modelDisplay}]`)} ${bar} ${getContextColor(percent)}${percent}%${RESET}`);
|
||||
}
|
||||
else if (display?.showModel !== false) {
|
||||
parts.push(`${cyan(`[${modelDisplay}]`)} ${getContextColor(percent)}${percent}%${RESET}`);
|
||||
}
|
||||
else if (display?.showContextBar !== false) {
|
||||
parts.push(`${bar} ${getContextColor(percent)}${percent}%${RESET}`);
|
||||
}
|
||||
else {
|
||||
parts.push(`${getContextColor(percent)}${percent}%${RESET}`);
|
||||
}
|
||||
// Project path (SECOND)
|
||||
if (ctx.stdin.cwd) {
|
||||
// Split by both Unix (/) and Windows (\) separators for cross-platform support
|
||||
const segments = ctx.stdin.cwd.split(/[/\\]/).filter(Boolean);
|
||||
const pathLevels = ctx.config?.pathLevels ?? 1;
|
||||
// Always join with forward slash for consistent display
|
||||
// Handle root path (/) which results in empty segments
|
||||
const projectPath = segments.length > 0 ? segments.slice(-pathLevels).join('/') : '/';
|
||||
// Build git status string
|
||||
let gitPart = '';
|
||||
const gitConfig = ctx.config?.gitStatus;
|
||||
const showGit = gitConfig?.enabled ?? true;
|
||||
if (showGit && ctx.gitStatus) {
|
||||
const gitParts = [ctx.gitStatus.branch];
|
||||
// Show dirty indicator
|
||||
if ((gitConfig?.showDirty ?? true) && ctx.gitStatus.isDirty) {
|
||||
gitParts.push('*');
|
||||
}
|
||||
// Show ahead/behind (with space separator for readability)
|
||||
if (gitConfig?.showAheadBehind) {
|
||||
if (ctx.gitStatus.ahead > 0) {
|
||||
gitParts.push(` ↑${ctx.gitStatus.ahead}`);
|
||||
}
|
||||
if (ctx.gitStatus.behind > 0) {
|
||||
gitParts.push(` ↓${ctx.gitStatus.behind}`);
|
||||
}
|
||||
}
|
||||
// Show file stats in Starship-compatible format (!modified +added ✘deleted ?untracked)
|
||||
if (gitConfig?.showFileStats && ctx.gitStatus.fileStats) {
|
||||
const { modified, added, deleted, untracked } = ctx.gitStatus.fileStats;
|
||||
const statParts = [];
|
||||
if (modified > 0)
|
||||
statParts.push(`!${modified}`);
|
||||
if (added > 0)
|
||||
statParts.push(`+${added}`);
|
||||
if (deleted > 0)
|
||||
statParts.push(`✘${deleted}`);
|
||||
if (untracked > 0)
|
||||
statParts.push(`?${untracked}`);
|
||||
if (statParts.length > 0) {
|
||||
gitParts.push(` ${statParts.join(' ')}`);
|
||||
}
|
||||
}
|
||||
gitPart = ` ${magenta('git:(')}${cyan(gitParts.join(''))}${magenta(')')}`;
|
||||
}
|
||||
parts.push(`${yellow(projectPath)}${gitPart}`);
|
||||
}
|
||||
// Config counts (respects environmentThreshold)
|
||||
if (display?.showConfigCounts !== false) {
|
||||
const totalCounts = ctx.claudeMdCount + ctx.rulesCount + ctx.mcpCount + ctx.hooksCount;
|
||||
const envThreshold = display?.environmentThreshold ?? 0;
|
||||
if (totalCounts > 0 && totalCounts >= envThreshold) {
|
||||
if (ctx.claudeMdCount > 0) {
|
||||
parts.push(dim(`${ctx.claudeMdCount} CLAUDE.md`));
|
||||
}
|
||||
if (ctx.rulesCount > 0) {
|
||||
parts.push(dim(`${ctx.rulesCount} rules`));
|
||||
}
|
||||
if (ctx.mcpCount > 0) {
|
||||
parts.push(dim(`${ctx.mcpCount} MCPs`));
|
||||
}
|
||||
if (ctx.hooksCount > 0) {
|
||||
parts.push(dim(`${ctx.hooksCount} hooks`));
|
||||
}
|
||||
}
|
||||
}
|
||||
// Usage limits display (shown when enabled in config, respects usageThreshold)
|
||||
if (display?.showUsage !== false && ctx.usageData?.planName) {
|
||||
if (ctx.usageData.apiUnavailable) {
|
||||
parts.push(yellow(`usage: ⚠`));
|
||||
}
|
||||
else if (isLimitReached(ctx.usageData)) {
|
||||
const resetTime = ctx.usageData.fiveHour === 100
|
||||
? formatResetTime(ctx.usageData.fiveHourResetAt)
|
||||
: formatResetTime(ctx.usageData.sevenDayResetAt);
|
||||
parts.push(red(`⚠ Limit reached${resetTime ? ` (resets ${resetTime})` : ''}`));
|
||||
}
|
||||
else {
|
||||
const usageThreshold = display?.usageThreshold ?? 0;
|
||||
const fiveHour = ctx.usageData.fiveHour;
|
||||
const sevenDay = ctx.usageData.sevenDay;
|
||||
const effectiveUsage = Math.max(fiveHour ?? 0, sevenDay ?? 0);
|
||||
if (effectiveUsage >= usageThreshold) {
|
||||
const fiveHourDisplay = formatUsagePercent(fiveHour);
|
||||
const fiveHourReset = formatResetTime(ctx.usageData.fiveHourResetAt);
|
||||
const fiveHourPart = fiveHourReset
|
||||
? `5h: ${fiveHourDisplay} (${fiveHourReset})`
|
||||
: `5h: ${fiveHourDisplay}`;
|
||||
if (sevenDay !== null && sevenDay >= 80) {
|
||||
const sevenDayDisplay = formatUsagePercent(sevenDay);
|
||||
parts.push(`${fiveHourPart} | 7d: ${sevenDayDisplay}`);
|
||||
}
|
||||
else {
|
||||
parts.push(fiveHourPart);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Session duration
|
||||
if (display?.showDuration !== false && ctx.sessionDuration) {
|
||||
parts.push(dim(`⏱️ ${ctx.sessionDuration}`));
|
||||
}
|
||||
let line = parts.join(' | ');
|
||||
// Token breakdown at high context
|
||||
if (display?.showTokenBreakdown !== false && percent >= 85) {
|
||||
const usage = ctx.stdin.context_window?.current_usage;
|
||||
if (usage) {
|
||||
const input = formatTokens(usage.input_tokens ?? 0);
|
||||
const cache = formatTokens((usage.cache_creation_input_tokens ?? 0) + (usage.cache_read_input_tokens ?? 0));
|
||||
line += dim(` (in: ${input}, cache: ${cache})`);
|
||||
}
|
||||
}
|
||||
return line;
|
||||
}
|
||||
function formatTokens(n) {
|
||||
if (n >= 1000000) {
|
||||
return `${(n / 1000000).toFixed(1)}M`;
|
||||
}
|
||||
if (n >= 1000) {
|
||||
return `${(n / 1000).toFixed(0)}k`;
|
||||
}
|
||||
return n.toString();
|
||||
}
|
||||
function formatUsagePercent(percent) {
|
||||
if (percent === null) {
|
||||
return dim('--');
|
||||
}
|
||||
const color = getContextColor(percent);
|
||||
return `${color}${percent}%${RESET}`;
|
||||
}
|
||||
function formatResetTime(resetAt) {
|
||||
if (!resetAt)
|
||||
return '';
|
||||
const now = new Date();
|
||||
const diffMs = resetAt.getTime() - now.getTime();
|
||||
if (diffMs <= 0)
|
||||
return '';
|
||||
const diffMins = Math.ceil(diffMs / 60000);
|
||||
if (diffMins < 60)
|
||||
return `${diffMins}m`;
|
||||
const hours = Math.floor(diffMins / 60);
|
||||
const mins = diffMins % 60;
|
||||
return mins > 0 ? `${hours}h ${mins}m` : `${hours}h`;
|
||||
}
|
||||
//# sourceMappingURL=session-line.js.map
|
||||
1
skills/plugins/claude-hud/dist/render/session-line.js.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/session-line.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
3
skills/plugins/claude-hud/dist/render/todos-line.d.ts
vendored
Normal file
3
skills/plugins/claude-hud/dist/render/todos-line.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { RenderContext } from '../types.js';
|
||||
export declare function renderTodosLine(ctx: RenderContext): string | null;
|
||||
//# sourceMappingURL=todos-line.d.ts.map
|
||||
1
skills/plugins/claude-hud/dist/render/todos-line.d.ts.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/todos-line.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"todos-line.d.ts","sourceRoot":"","sources":["../../src/render/todos-line.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI,CAsBjE"}
|
||||
25
skills/plugins/claude-hud/dist/render/todos-line.js
vendored
Normal file
25
skills/plugins/claude-hud/dist/render/todos-line.js
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
import { yellow, green, dim } from './colors.js';
|
||||
export function renderTodosLine(ctx) {
|
||||
const { todos } = ctx.transcript;
|
||||
if (!todos || todos.length === 0) {
|
||||
return null;
|
||||
}
|
||||
const inProgress = todos.find((t) => t.status === 'in_progress');
|
||||
const completed = todos.filter((t) => t.status === 'completed').length;
|
||||
const total = todos.length;
|
||||
if (!inProgress) {
|
||||
if (completed === total && total > 0) {
|
||||
return `${green('✓')} All todos complete ${dim(`(${completed}/${total})`)}`;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
const content = truncateContent(inProgress.content);
|
||||
const progress = dim(`(${completed}/${total})`);
|
||||
return `${yellow('▸')} ${content} ${progress}`;
|
||||
}
|
||||
function truncateContent(content, maxLen = 50) {
|
||||
if (content.length <= maxLen)
|
||||
return content;
|
||||
return content.slice(0, maxLen - 3) + '...';
|
||||
}
|
||||
//# sourceMappingURL=todos-line.js.map
|
||||
1
skills/plugins/claude-hud/dist/render/todos-line.js.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/todos-line.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"todos-line.js","sourceRoot":"","sources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OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;AAC9C,CAAC"}
|
||||
3
skills/plugins/claude-hud/dist/render/tools-line.d.ts
vendored
Normal file
3
skills/plugins/claude-hud/dist/render/tools-line.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { RenderContext } from '../types.js';
|
||||
export declare function renderToolsLine(ctx: RenderContext): string | null;
|
||||
//# sourceMappingURL=tools-line.d.ts.map
|
||||
1
skills/plugins/claude-hud/dist/render/tools-line.d.ts.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/tools-line.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"tools-line.d.ts","sourceRoot":"","sources":["../../src/render/tools-line.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI,CAoCjE"}
|
||||
43
skills/plugins/claude-hud/dist/render/tools-line.js
vendored
Normal file
43
skills/plugins/claude-hud/dist/render/tools-line.js
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
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) {
|
||||
// Normalize Windows backslashes to forward slashes for consistent display
|
||||
const normalizedPath = path.replace(/\\/g, '/');
|
||||
if (normalizedPath.length <= maxLen)
|
||||
return normalizedPath;
|
||||
// Split by forward slash (already normalized)
|
||||
const parts = normalizedPath.split('/');
|
||||
const filename = parts.pop() || normalizedPath;
|
||||
if (filename.length >= maxLen) {
|
||||
return filename.slice(0, maxLen - 3) + '...';
|
||||
}
|
||||
return '.../' + filename;
|
||||
}
|
||||
//# sourceMappingURL=tools-line.js.map
|
||||
1
skills/plugins/claude-hud/dist/render/tools-line.js.map
vendored
Normal file
1
skills/plugins/claude-hud/dist/render/tools-line.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"tools-line.js","sourceRoot":"","sources":["../../src/render/tools-line.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,UAAU,eAAe,CAAC,GAAkB;IAChD,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,UAAU,CAAC;IAEjC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;IACjE,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAA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