Features: - 30+ Custom Skills (cognitive, development, UI/UX, autonomous agents) - RalphLoop autonomous agent integration - Multi-AI consultation (Qwen) - Agent management system with sync capabilities - Custom hooks for session management - MCP servers integration - Plugin marketplace setup - Comprehensive installation script Components: - Skills: always-use-superpowers, ralph, brainstorming, ui-ux-pro-max, etc. - Agents: 100+ agents across engineering, marketing, product, etc. - Hooks: session-start-superpowers, qwen-consult, ralph-auto-trigger - Commands: /brainstorm, /write-plan, /execute-plan - MCP Servers: zai-mcp-server, web-search-prime, web-reader, zread - Binaries: ralphloop wrapper Installation: ./supercharge.sh
53 lines
2.4 KiB
JavaScript
53 lines
2.4 KiB
JavaScript
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
|