triflux 2.4.0 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/triflux.mjs +20 -3
- package/hud/hud-qos-status.mjs +8 -8
- package/package.json +1 -1
package/bin/triflux.mjs
CHANGED
|
@@ -50,7 +50,7 @@ function which(cmd) {
|
|
|
50
50
|
|
|
51
51
|
function whichInShell(cmd, shell) {
|
|
52
52
|
const cmds = {
|
|
53
|
-
bash: `bash -c
|
|
53
|
+
bash: `bash -c "source ~/.bashrc 2>/dev/null && command -v ${cmd} 2>/dev/null"`,
|
|
54
54
|
cmd: `cmd /c where ${cmd} 2>nul`,
|
|
55
55
|
pwsh: `pwsh -NoProfile -c "(Get-Command ${cmd} -EA SilentlyContinue).Source"`,
|
|
56
56
|
};
|
|
@@ -283,9 +283,26 @@ function cmdDoctor(options = {}) {
|
|
|
283
283
|
console.log("");
|
|
284
284
|
ok(`${BOLD}${cleared}개${RESET} 캐시 파일 초기화 완료`);
|
|
285
285
|
}
|
|
286
|
-
|
|
286
|
+
// 캐시 즉시 재생성
|
|
287
|
+
console.log("");
|
|
288
|
+
section("Cache Rebuild");
|
|
289
|
+
const mcpCheck = join(PKG_ROOT, "scripts", "mcp-check.mjs");
|
|
290
|
+
if (existsSync(mcpCheck)) {
|
|
291
|
+
try {
|
|
292
|
+
execSync(`"${process.execPath}" "${mcpCheck}"`, { timeout: 15000, stdio: "ignore" });
|
|
293
|
+
ok("MCP 인벤토리 재생성됨");
|
|
294
|
+
} catch { warn("MCP 인벤토리 재생성 실패 — 다음 세션에서 자동 재시도"); }
|
|
295
|
+
}
|
|
296
|
+
const hudScript = join(CLAUDE_DIR, "hud", "hud-qos-status.mjs");
|
|
297
|
+
if (existsSync(hudScript)) {
|
|
298
|
+
try {
|
|
299
|
+
execSync(`"${process.execPath}" "${hudScript}" --refresh-gemini`, { timeout: 15000, stdio: "ignore" });
|
|
300
|
+
ok("Gemini 쿼터 캐시 재생성됨");
|
|
301
|
+
} catch { warn("Gemini 쿼터 캐시 재생성 실패"); }
|
|
302
|
+
}
|
|
303
|
+
info("Claude/Codex 캐시는 다음 사용 시 자동 생성됩니다");
|
|
287
304
|
console.log(`\n ${LINE}`);
|
|
288
|
-
console.log(` ${GREEN_BRIGHT}${BOLD}✓ 캐시 초기화 완료${RESET}\n`);
|
|
305
|
+
console.log(` ${GREEN_BRIGHT}${BOLD}✓ 캐시 초기화 + 재생성 완료${RESET}\n`);
|
|
289
306
|
return;
|
|
290
307
|
}
|
|
291
308
|
|
package/hud/hud-qos-status.mjs
CHANGED
|
@@ -1261,10 +1261,10 @@ function getClaudeRows(stdin, claudeUsage, combinedSvPct) {
|
|
|
1261
1261
|
const weeklyPercent = claudeUsage?.weeklyPercent ?? 0;
|
|
1262
1262
|
const fiveHourReset = claudeUsage?.fiveHourResetsAt
|
|
1263
1263
|
? formatResetRemaining(claudeUsage.fiveHourResetsAt)
|
|
1264
|
-
:
|
|
1264
|
+
: "n/a";
|
|
1265
1265
|
const weeklyReset = claudeUsage?.weeklyResetsAt
|
|
1266
1266
|
? formatResetRemainingDayHour(claudeUsage.weeklyResetsAt)
|
|
1267
|
-
:
|
|
1267
|
+
: "n/a";
|
|
1268
1268
|
|
|
1269
1269
|
const hasData = claudeUsage != null;
|
|
1270
1270
|
|
|
@@ -1273,7 +1273,7 @@ function getClaudeRows(stdin, claudeUsage, combinedSvPct) {
|
|
|
1273
1273
|
if (!hasData) {
|
|
1274
1274
|
const quotaSection = cols < 40
|
|
1275
1275
|
? `${dim("--%/--%")} ${dim("ctx:")}${colorByPercent(contextPercent, `${contextPercent}%`)}`
|
|
1276
|
-
: `${dim("5h --% 1w --% sv
|
|
1276
|
+
: `${dim("5h --% 1w --% sv:--% ctx:")}${colorByPercent(contextPercent, `${contextPercent}%`)}`;
|
|
1277
1277
|
return [{ prefix, left: quotaSection, right: "" }];
|
|
1278
1278
|
}
|
|
1279
1279
|
if (cols < 40) {
|
|
@@ -1429,16 +1429,16 @@ function getProviderRow(provider, marker, markerColor, qosProfile, accountsConfi
|
|
|
1429
1429
|
const usedP = clampPercent((1 - (bucket.remainingFraction ?? 1)) * 100);
|
|
1430
1430
|
const rstRemaining = formatResetRemaining(bucket.resetTime) || "n/a";
|
|
1431
1431
|
quotaSection = `${dim("1d:")}${tierBar(usedP, provAnsi)}${colorByProvider(usedP, formatPercentCell(usedP), provFn)} ${dim(formatTimeCell(rstRemaining))} ` +
|
|
1432
|
-
`${dim("1w:")}${tierInfBar()}${dim("\u221E%".padStart(PERCENT_CELL_WIDTH))} ${dim(formatTimeCellDH("
|
|
1432
|
+
`${dim("1w:")}${tierInfBar()}${dim("\u221E%".padStart(PERCENT_CELL_WIDTH))} ${dim(formatTimeCellDH("n/a"))}`;
|
|
1433
1433
|
} else {
|
|
1434
1434
|
quotaSection = `${dim("1d:")}${tierDimBar()}${dim(formatPlaceholderPercentCell())} ` +
|
|
1435
|
-
`${dim(formatTimeCell("
|
|
1435
|
+
`${dim(formatTimeCell("n/a"))} ${dim("1w:")}${tierInfBar()}${dim("\u221E%".padStart(PERCENT_CELL_WIDTH))} ${dim(formatTimeCellDH("n/a"))}`;
|
|
1436
1436
|
}
|
|
1437
1437
|
}
|
|
1438
1438
|
|
|
1439
1439
|
// 폴백: 쿼터 데이터 없을 때
|
|
1440
1440
|
if (!quotaSection) {
|
|
1441
|
-
quotaSection = `${dim("5h:")}${tierDimBar()}${dim("
|
|
1441
|
+
quotaSection = `${dim("5h:")}${tierDimBar()}${dim(formatPlaceholderPercentCell())} ${dim(formatTimeCell("n/a"))} ${dim("1w:")}${tierDimBar()}${dim(formatPlaceholderPercentCell())} ${dim(formatTimeCellDH("n/a"))}`;
|
|
1442
1442
|
}
|
|
1443
1443
|
|
|
1444
1444
|
const prefix = `${bold(markerColor(`${marker}`))}:`;
|
|
@@ -1575,8 +1575,8 @@ async function main() {
|
|
|
1575
1575
|
|
|
1576
1576
|
// 비활성 줄 dim 래핑 (rows 순서: [claude, codex, gemini])
|
|
1577
1577
|
if (outputLines.length >= 3) {
|
|
1578
|
-
if (!codexActive) outputLines[1] = `${DIM}${
|
|
1579
|
-
if (!geminiActive) outputLines[2] = `${DIM}${
|
|
1578
|
+
if (!codexActive) outputLines[1] = `${DIM}${outputLines[1]}${RESET}`;
|
|
1579
|
+
if (!geminiActive) outputLines[2] = `${DIM}${outputLines[2]}${RESET}`;
|
|
1580
1580
|
}
|
|
1581
1581
|
|
|
1582
1582
|
// 선행 개행: 알림 배너(노란 글씨)가 빈 첫 줄에 오도록 → HUD 내용 보호
|