SuperCharge Claude Code v1.0.0 - Complete Customization Package
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
This commit is contained in:
59
plugins/claude-hud/dist/render/lines/usage.js
vendored
Normal file
59
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
|
||||
Reference in New Issue
Block a user