triflux 7.1.4 → 7.2.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/.claude-plugin/marketplace.json +31 -31
- package/.claude-plugin/plugin.json +22 -23
- package/bin/triflux.mjs +18 -5
- package/hooks/keyword-rules.json +393 -361
- package/hub/bridge.mjs +799 -786
- package/hub/delegator/contracts.mjs +37 -38
- package/hub/delegator/schema/delegator-tools.schema.json +250 -250
- package/hub/delegator/service.mjs +307 -302
- package/hub/intent.mjs +108 -11
- package/hub/lib/process-utils.mjs +20 -0
- package/hub/pipe.mjs +589 -589
- package/hub/pipeline/gates/confidence.mjs +1 -1
- package/hub/pipeline/gates/selfcheck.mjs +2 -4
- package/hub/pipeline/state.mjs +191 -187
- package/hub/pipeline/transitions.mjs +124 -120
- package/hub/public/dashboard.html +355 -349
- package/hub/quality/deslop.mjs +5 -3
- package/hub/reflexion.mjs +5 -1
- package/hub/research.mjs +6 -1
- package/hub/router.mjs +791 -782
- package/hub/server.mjs +893 -822
- package/hub/store.mjs +807 -778
- package/hub/team/agent-map.json +10 -0
- package/hub/team/ansi.mjs +3 -4
- package/hub/team/cli/commands/control.mjs +43 -43
- package/hub/team/cli/commands/interrupt.mjs +36 -36
- package/hub/team/cli/commands/kill.mjs +3 -3
- package/hub/team/cli/commands/send.mjs +37 -37
- package/hub/team/cli/commands/start/index.mjs +18 -8
- package/hub/team/cli/commands/start/parse-args.mjs +3 -1
- package/hub/team/cli/commands/start/start-headless.mjs +4 -1
- package/hub/team/cli/commands/status.mjs +87 -87
- package/hub/team/cli/commands/stop.mjs +1 -1
- package/hub/team/cli/commands/task.mjs +1 -1
- package/hub/team/cli/index.mjs +41 -39
- package/hub/team/cli/manifest.mjs +29 -28
- package/hub/team/cli/services/hub-client.mjs +37 -0
- package/hub/team/cli/services/state-store.mjs +26 -12
- package/hub/team/dashboard.mjs +11 -4
- package/hub/team/handoff.mjs +12 -0
- package/hub/team/headless.mjs +202 -200
- package/hub/team/native-supervisor.mjs +386 -346
- package/hub/team/nativeProxy.mjs +680 -692
- package/hub/team/staleState.mjs +361 -369
- package/hub/team/tui-viewer.mjs +27 -3
- package/hub/team/tui.mjs +1 -0
- package/hub/token-mode.mjs +114 -24
- package/hub/workers/delegator-mcp.mjs +1059 -1057
- package/hud/colors.mjs +88 -0
- package/hud/constants.mjs +78 -0
- package/hud/hud-qos-status.mjs +206 -1872
- package/hud/providers/claude.mjs +309 -0
- package/hud/providers/codex.mjs +151 -0
- package/hud/providers/gemini.mjs +320 -0
- package/hud/renderers.mjs +424 -0
- package/hud/terminal.mjs +140 -0
- package/hud/utils.mjs +271 -0
- package/package.json +1 -2
- package/scripts/__tests__/keyword-detector.test.mjs +234 -234
- package/scripts/headless-guard-fast.sh +21 -0
- package/scripts/headless-guard.mjs +26 -6
- package/scripts/lib/keyword-rules.mjs +166 -168
- package/scripts/setup.mjs +725 -690
- package/scripts/tfx-route-post.mjs +424 -424
- package/scripts/tfx-route.sh +1671 -1650
- package/scripts/tmp-cleanup.mjs +74 -0
- package/skills/tfx-auto/SKILL.md +279 -278
- package/skills/tfx-auto-codex/SKILL.md +98 -77
- package/skills/tfx-codex/SKILL.md +65 -65
- package/skills/tfx-gemini/SKILL.md +83 -82
- package/skills/tfx-hub/SKILL.md +205 -136
- package/skills/tfx-multi/SKILL.md +11 -5
- package/.mcp.json +0 -8
package/hud/colors.mjs
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// ANSI 색상 (OMC colors.js 스키마 일치)
|
|
3
|
+
// ============================================================================
|
|
4
|
+
export const RESET = "\x1b[0m";
|
|
5
|
+
export const DIM = "\x1b[2m";
|
|
6
|
+
export const BOLD = "\x1b[1m";
|
|
7
|
+
export const RED = "\x1b[31m";
|
|
8
|
+
export const GREEN = "\x1b[32m";
|
|
9
|
+
export const YELLOW = "\x1b[33m";
|
|
10
|
+
export const CYAN = "\x1b[36m";
|
|
11
|
+
export const CLAUDE_ORANGE = "\x1b[38;2;232;112;64m"; // #E87040 (Claude 공식 오렌지)
|
|
12
|
+
export const CODEX_WHITE = "\x1b[97m"; // bright white (SGR 37은 Windows Terminal에서 연회색 매핑)
|
|
13
|
+
export const GEMINI_BLUE = "\x1b[38;5;39m";
|
|
14
|
+
|
|
15
|
+
export function green(t) { return `${GREEN}${t}${RESET}`; }
|
|
16
|
+
export function yellow(t) { return `${YELLOW}${t}${RESET}`; }
|
|
17
|
+
export function red(t) { return `${RED}${t}${RESET}`; }
|
|
18
|
+
export function cyan(t) { return `${CYAN}${t}${RESET}`; }
|
|
19
|
+
export function dim(t) { return `${DIM}${t}${RESET}`; }
|
|
20
|
+
export function bold(t) { return `${BOLD}${t}${RESET}`; }
|
|
21
|
+
export function claudeOrange(t) { return `${CLAUDE_ORANGE}${t}${RESET}`; }
|
|
22
|
+
export function codexWhite(t) { return `${CODEX_WHITE}${t}${RESET}`; }
|
|
23
|
+
export function geminiBlue(t) { return `${GEMINI_BLUE}${t}${RESET}`; }
|
|
24
|
+
|
|
25
|
+
export function colorByPercent(value, text) {
|
|
26
|
+
if (value >= 85) return red(text);
|
|
27
|
+
if (value >= 70) return yellow(text);
|
|
28
|
+
if (value >= 50) return cyan(text);
|
|
29
|
+
return green(text);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function colorCooldown(seconds, text) {
|
|
33
|
+
if (seconds > 120) return red(text);
|
|
34
|
+
if (seconds > 0) return yellow(text);
|
|
35
|
+
return dim(text);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function colorParallel(current, cap) {
|
|
39
|
+
if (current >= cap) return green(`${current}/${cap}`);
|
|
40
|
+
if (current > 1) return yellow(`${current}/${cap}`);
|
|
41
|
+
return red(`${current}/${cap}`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const GAUGE_WIDTH = 5;
|
|
45
|
+
export const GAUGE_BLOCKS = ["░", "▒", "▓", "█"]; // 밝기 0~3
|
|
46
|
+
|
|
47
|
+
export function coloredBar(percent, width = GAUGE_WIDTH, baseColor = null) {
|
|
48
|
+
const safePercent = Math.min(100, Math.max(0, percent));
|
|
49
|
+
const perBlock = 100 / width;
|
|
50
|
+
|
|
51
|
+
// 상태별 색상
|
|
52
|
+
let barColor;
|
|
53
|
+
if (safePercent >= 85) barColor = RED;
|
|
54
|
+
else if (safePercent >= 70) barColor = YELLOW;
|
|
55
|
+
else barColor = baseColor || GREEN;
|
|
56
|
+
|
|
57
|
+
let bar = "";
|
|
58
|
+
for (let i = 0; i < width; i++) {
|
|
59
|
+
const blockStart = i * perBlock;
|
|
60
|
+
const blockEnd = (i + 1) * perBlock;
|
|
61
|
+
|
|
62
|
+
if (safePercent >= blockEnd) {
|
|
63
|
+
bar += "█"; // 완전 채움
|
|
64
|
+
} else if (safePercent > blockStart) {
|
|
65
|
+
// 프론티어: 구간 내 진행률
|
|
66
|
+
const progress = (safePercent - blockStart) / perBlock;
|
|
67
|
+
if (progress >= 0.75) bar += "▓";
|
|
68
|
+
else if (progress >= 0.33) bar += "▒";
|
|
69
|
+
else bar += "░";
|
|
70
|
+
} else {
|
|
71
|
+
bar += "░"; // 미도달
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// 채워진 부분 = barColor, 빈 부분 = DIM
|
|
76
|
+
const filledEnd = Math.ceil(safePercent / perBlock);
|
|
77
|
+
const coloredPart = barColor + bar.slice(0, filledEnd) + RESET;
|
|
78
|
+
const dimPart = filledEnd < width ? DIM + bar.slice(filledEnd) + RESET : "";
|
|
79
|
+
|
|
80
|
+
return coloredPart + dimPart;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// 프로바이더별 색상 % (< 70%: 프로바이더 색, ≥ 70%: 경고색)
|
|
84
|
+
export function colorByProvider(value, text, providerColorFn) {
|
|
85
|
+
if (value >= 85) return red(text);
|
|
86
|
+
if (value >= 70) return yellow(text);
|
|
87
|
+
return providerColorFn(text);
|
|
88
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// 상수 / 경로
|
|
3
|
+
// ============================================================================
|
|
4
|
+
import { homedir } from "node:os";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
|
|
7
|
+
export const VERSION = "2.0";
|
|
8
|
+
|
|
9
|
+
export const QOS_PATH = join(homedir(), ".omc", "state", "cli_qos_profile.json");
|
|
10
|
+
export const ACCOUNTS_CONFIG_PATH = join(homedir(), ".omc", "router", "accounts.json");
|
|
11
|
+
export const ACCOUNTS_STATE_PATH = join(homedir(), ".omc", "state", "cli_accounts_state.json");
|
|
12
|
+
|
|
13
|
+
// tfx-multi 상태 (v2.2 HUD 통합)
|
|
14
|
+
export const TEAM_STATE_PATH = join(homedir(), ".claude", "cache", "tfx-hub", "team-state.json");
|
|
15
|
+
|
|
16
|
+
// Claude OAuth Usage API (api.anthropic.com/api/oauth/usage)
|
|
17
|
+
export const CLAUDE_CREDENTIALS_PATH = join(homedir(), ".claude", ".credentials.json");
|
|
18
|
+
export const CLAUDE_USAGE_CACHE_PATH = join(homedir(), ".claude", "cache", "claude-usage-cache.json");
|
|
19
|
+
export const OMC_PLUGIN_USAGE_CACHE_PATH = join(homedir(), ".claude", "plugins", "oh-my-claudecode", ".usage-cache.json");
|
|
20
|
+
export const CLAUDE_USAGE_STALE_MS_SOLO = 5 * 60 * 1000; // OMC 없을 때: 5분 캐시
|
|
21
|
+
export const CLAUDE_USAGE_STALE_MS_WITH_OMC = 15 * 60 * 1000; // OMC 있을 때: 15분 (OMC가 30초마다 갱신)
|
|
22
|
+
export const CLAUDE_USAGE_429_BACKOFF_MS = 10 * 60 * 1000; // 429 에러 시 10분 backoff
|
|
23
|
+
export const CLAUDE_USAGE_ERROR_BACKOFF_MS = 3 * 60 * 1000; // 기타 에러 시 3분 backoff
|
|
24
|
+
export const CLAUDE_API_TIMEOUT_MS = 10_000;
|
|
25
|
+
export const FIVE_HOUR_MS = 5 * 60 * 60 * 1000;
|
|
26
|
+
export const SEVEN_DAY_MS = 7 * 24 * 60 * 60 * 1000;
|
|
27
|
+
export const ONE_DAY_MS = 24 * 60 * 60 * 1000;
|
|
28
|
+
export const DEFAULT_OAUTH_CLIENT_ID = "9d1c250a-e61b-44d9-88ed-5944d1962f5e";
|
|
29
|
+
|
|
30
|
+
export const CODEX_AUTH_PATH = join(homedir(), ".codex", "auth.json");
|
|
31
|
+
export const CODEX_QUOTA_CACHE_PATH = join(homedir(), ".claude", "cache", "codex-rate-limits-cache.json");
|
|
32
|
+
export const CODEX_QUOTA_STALE_MS = 15 * 1000; // 15초
|
|
33
|
+
export const CODEX_MIN_BUCKETS = 2;
|
|
34
|
+
|
|
35
|
+
// Gemini 쿼터 API 관련
|
|
36
|
+
export const GEMINI_OAUTH_PATH = join(homedir(), ".gemini", "oauth_creds.json");
|
|
37
|
+
export const GEMINI_QUOTA_CACHE_PATH = join(homedir(), ".claude", "cache", "gemini-quota-cache.json");
|
|
38
|
+
export const GEMINI_PROJECT_CACHE_PATH = join(homedir(), ".claude", "cache", "gemini-project-id.json");
|
|
39
|
+
export const GEMINI_SESSION_CACHE_PATH = join(homedir(), ".claude", "cache", "gemini-session-cache.json");
|
|
40
|
+
export const GEMINI_RPM_TRACKER_PATH = join(homedir(), ".claude", "cache", "gemini-rpm-tracker.json");
|
|
41
|
+
export const SV_ACCUMULATOR_PATH = join(homedir(), ".claude", "cache", "sv-accumulator.json");
|
|
42
|
+
// 이전 .omc/ 경로 fallback (기존 환경 호환)
|
|
43
|
+
export const LEGACY_GEMINI_QUOTA_CACHE = join(homedir(), ".omc", "state", "gemini_quota_cache.json");
|
|
44
|
+
export const LEGACY_GEMINI_PROJECT_CACHE = join(homedir(), ".omc", "state", "gemini_project_id.json");
|
|
45
|
+
export const LEGACY_GEMINI_SESSION_CACHE = join(homedir(), ".omc", "state", "gemini_session_tokens_cache.json");
|
|
46
|
+
export const LEGACY_GEMINI_RPM_TRACKER = join(homedir(), ".omc", "state", "gemini_rpm_tracker.json");
|
|
47
|
+
export const LEGACY_SV_ACCUMULATOR = join(homedir(), ".omc", "state", "sv-accumulator.json");
|
|
48
|
+
|
|
49
|
+
export const GEMINI_RPM_WINDOW_MS = 60 * 1000; // 60초 슬라이딩 윈도우
|
|
50
|
+
export const GEMINI_QUOTA_STALE_MS = 5 * 60 * 1000; // 5분
|
|
51
|
+
export const GEMINI_SESSION_STALE_MS = 15 * 1000; // 15초
|
|
52
|
+
export const GEMINI_API_TIMEOUT_MS = 3000; // 3초
|
|
53
|
+
|
|
54
|
+
export const ACCOUNT_LABEL_WIDTH = 10;
|
|
55
|
+
export const PROVIDER_PREFIX_WIDTH = 2;
|
|
56
|
+
export const PERCENT_CELL_WIDTH = 3;
|
|
57
|
+
export const TIME_CELL_INNER_WIDTH = 6;
|
|
58
|
+
export const SV_CELL_WIDTH = 5;
|
|
59
|
+
|
|
60
|
+
export const CLAUDE_REFRESH_FLAG = "--refresh-claude-usage";
|
|
61
|
+
export const CODEX_REFRESH_FLAG = "--refresh-codex-rate-limits";
|
|
62
|
+
export const GEMINI_REFRESH_FLAG = "--refresh-gemini-quota";
|
|
63
|
+
export const GEMINI_SESSION_REFRESH_FLAG = "--refresh-gemini-session";
|
|
64
|
+
|
|
65
|
+
// 모바일/Termux 컴팩트 모드 감지
|
|
66
|
+
export const HUD_CONFIG_PATH = join(homedir(), ".omc", "config", "hud.json");
|
|
67
|
+
export const COMPACT_COLS_THRESHOLD = 80;
|
|
68
|
+
export const MINIMAL_COLS_THRESHOLD = 60;
|
|
69
|
+
|
|
70
|
+
// rows 임계값 상수 (selectTier 에서 tier 결정에 사용)
|
|
71
|
+
export const ROWS_BUDGET_FULL = 40;
|
|
72
|
+
export const ROWS_BUDGET_LARGE = 35;
|
|
73
|
+
export const ROWS_BUDGET_MEDIUM = 28;
|
|
74
|
+
export const ROWS_BUDGET_SMALL = 22;
|
|
75
|
+
|
|
76
|
+
// Gemini Pro 풀 공유 그룹: 같은 remainingFraction을 공유하는 모델 ID들
|
|
77
|
+
export const GEMINI_PRO_POOL = new Set(["gemini-2.5-pro", "gemini-3-pro-preview", "gemini-3.1-pro-preview"]);
|
|
78
|
+
export const GEMINI_FLASH_POOL = new Set(["gemini-2.5-flash", "gemini-3-flash-preview"]);
|