refactor(panel): unify settings and bridge contracts, prune dead code, and rename trajectory metrics

- Share settings normalization and window-bridge protocol contracts across frontend and backend
- Encapsulate trajectory cache accessors inside config.mjs and validate bundle imports/syntax before writing
- Remove dead selectors, unused symbols, duplicate re-export imports, and unmounted account tab instantiation
- Rename speed-metrics.mjs to trajectory-metrics.mjs and audit-fixes.test.mjs to cross-module-regressions.test.mjs
This commit is contained in:
fish
2026-11-17 20:00:50 +09:00
parent dba3473494
commit 1ff1c128a8
34 changed files with 802 additions and 676 deletions
@@ -20,33 +20,10 @@ import {
} from '../core/formatters.js';
import { isEnglishLocale, t } from '../i18n/index.js';
export const CAPSULE_METRIC_KEYS = Object.freeze([
'context',
'tps',
'ttft',
'avg_tps',
'cost',
'session_cost',
'cache_hit',
'session_tokens',
'quota_auto',
'gemini_5h',
'gemini_weekly',
'claude_5h',
'claude_weekly',
]);
import { OVERVIEW_METRIC_KEYS, TOPBAR_SLOT_KEYS } from '../../shared/settings-normalization.mjs';
export const OVERVIEW_METRIC_KEYS = Object.freeze([
'tps',
'ttft',
'avg_tps',
'step_cost',
'session_cost',
'cache_hit',
'session_tokens',
'context_usage',
'quota_tightest',
]);
export { OVERVIEW_METRIC_KEYS };
export const CAPSULE_METRIC_KEYS = TOPBAR_SLOT_KEYS;
const THIRD_PARTY_FAMILY_RE = /claude|gpt|anthropic|openai|3p|sonnet|opus|haiku/i;