feat(panel): modularize 3-tab preferences, add model context windows, and optimize telemetry

- Refactor Preferences into decoupled General, Structure, and Other tabs with unified settings schema, factory reset, and trajectory cache rebuild endpoints
- Extract standalone widget, metric, and step-table column registries to customize topbar/composer slots, hover popup modules, live overview layout, and step detail columns
- Add bilingual zh-CN/en-US i18n dictionaries, theme accent presets, and font scale controls across Shadow DOM overlay and sidebar views
- Support per-model host-advertised context window rules across App and IDE transports
- Preserve CLEARED step generation timings, memoize per-poll model resolution, optimize LOESS sorted-x fitting, and update bilingual READMEs and test suites
This commit is contained in:
fish
2026-11-15 01:18:29 +09:00
parent ad33e9cc62
commit 18c608ae63
63 changed files with 16614 additions and 5873 deletions
+425
View File
@@ -0,0 +1,425 @@
/**
* @fileoverview English (en-US) dictionary for Antigravity Usage & Speed Monitor.
* Zero emoji characters.
*/
export const I18N_MESSAGES_EN_US = Object.freeze({
// Top Navigation
'nav.overview': 'Live',
'nav.consumption': 'Usage',
'nav.steps': 'Steps',
'nav.settings': 'Settings',
// Top Session Header
'header.followLatest': 'Follow Latest Session',
'header.currentWindowNamed': 'Current ({title})',
'header.latestNamed': 'Latest ({title})',
'header.lockedSession': 'Pinned Session ({id})',
'header.lockedMeta': 'Pinned',
'header.convMetaWithSubs': 'Main {main} · {subs} sub ({total} steps)',
'header.convMetaSteps': '{count} steps',
'header.hasUpdate': 'Update',
'header.upgradeToVer': 'Update v{ver}',
'header.upgrading': 'Updating…',
'header.ariaUpdate': 'New version available, click to update',
'header.ariaRefresh': 'Refresh telemetry',
'header.statusSyncing': 'Syncing',
'header.statusSynced': 'Synced',
'header.statusRetrying': 'Retrying',
'header.statusGenerating': 'Running{suffix}',
'header.statusQuotaCached': 'Quota Cached',
'header.statusQuotaOffline': 'Quota Offline',
'header.statusLive': 'Live 2s',
// Formatters & Common Labels
'fmt.pending': 'N/A',
'fmt.speedIncomplete': 'Incomplete timing',
'fmt.speedInvalidOutput': 'No valid output',
'fmt.speedInconsistent': 'Invalid timing',
'fmt.speedShort': 'Too brief (<0.5s)',
'fmt.speedLegacy': 'Legacy cached',
'fmt.sampleSteps': '{valid}/{total} steps',
'fmt.resetUnknown': 'Unknown reset',
'fmt.resetSoon': 'Resetting soon',
'fmt.resetUnder1m': 'Resets in <1m',
'fmt.resetDaysHours': 'Resets in {d}d {h}h',
'fmt.resetHoursMins': 'Resets in {h}h {m}m',
'fmt.resetMins': 'Resets in {m}m',
'fmt.selectTime': 'Select time',
'fmt.unknownModel': 'Unknown model',
'fmt.mainAgent': 'Main Agent',
'fmt.mainBadge': 'Main',
'fmt.subAgent': 'Subagent',
'fmt.subBadge': 'S{index}',
'fmt.subBadgeShort': 'Sub',
'fmt.selectedCount': '{count} {unit} selected',
'fmt.selectedListTitle': 'Selected ({count}): {names}',
'fmt.selectPlaceholder': 'Select',
// Capsule & Multi-Session Overlay
'capsule.ariaMonitor': 'Usage & Speed Monitor',
'capsule.ariaMulti': 'Active Sessions Overview',
'capsule.multiZero': '0 active',
'capsule.multiRunning': '{count} active',
'capsule.multiRunningWithSubs': '{count} active · {subs} sub',
'capsule.tpsRunning': 'Running',
'capsule.tpsIdle': 'Idle',
'capsule.quotaLeft': '{pct}% left',
'capsule.quotaUnknown': '--% left',
'capsule.newVersion': 'Update',
'capsule.updating': 'Updating…',
'capsule.ariaUpdateTitle': 'New version available, click to update',
'capsule.hoverNewVer': 'Update v{ver} available',
'capsule.hoverNewVerGeneric': 'New version available',
'capsule.hoverUpdateHintTopbar': 'Click v{ver} in titlebar to update',
'capsule.hoverUpdateHintComposer': 'Click v{ver} badge to update',
'capsule.hoverUpdateHintTopbarGeneric': 'Click update badge in titlebar',
'capsule.hoverUpdateHintComposerGeneric': 'Click update badge to install',
'multi.title': 'Active Sessions',
'multi.ariaDialog': 'Active Sessions Panel',
'multi.pinned': 'Pinned',
'multi.loading': 'Loading...',
'multi.empty': 'No active running sessions',
'multi.allIdle': 'All idle',
'multi.metaWithSubs': '{main} main · {subs} subagents active',
'multi.metaMainOnly': '{main} sessions active',
'multi.hereTag': 'Here',
'multi.inspectSessionTitle': 'Inspect session in monitor: {title}',
// Live Overview & Widgets
'module.metrics': 'Live Metrics',
'module.context': 'Context Window',
'module.quotas': 'Available Quotas',
'module.live_tasks': 'Live Running Tasks',
// Capsule Slot Metric Options
'capMetric.context': 'Context Usage (%)',
'capMetric.tps': 'Output Speed (TPS)',
'capMetric.ttft': 'First Token Latency (TTFT)',
'capMetric.avg_tps': 'Avg Speed (Avg TPS)',
'capMetric.cost': 'Step Cost ($)',
'capMetric.session_cost': 'Session Cost ($)',
'capMetric.cache_hit': 'Cache Hit Rate (%)',
'capMetric.session_tokens': 'Session Tokens',
'capMetric.quota_auto': 'Auto Tightest Quota',
'capMetric.gemini_5h': 'Gemini 5h Quota',
'capMetric.gemini_weekly': 'Gemini Weekly Quota',
'capMetric.claude_5h': 'Claude 5h Quota',
'capMetric.claude_weekly': 'Claude Weekly Quota',
// Overview Matrix Metric Options & Cells
'ovMetric.tps': 'Output Speed',
'ovMetric.ttft': 'First Token',
'ovMetric.avg_tps': 'Avg Speed',
'ovMetric.step_cost': 'Step Cost',
'ovMetric.session_cost': 'Session Cost',
'ovMetric.cache_hit': 'Cache Hit',
'ovMetric.session_tokens': 'Session Tokens',
'ovMetric.context_usage': 'Context Usage',
'ovMetric.quota_tightest': 'Tightest Quota',
'ovMetric.subAvgTtft': 'Avg {val}',
'ovMetric.subValidSamples': 'Valid {samples}',
'ovMetric.subCacheAndTotal': 'Cache {cache}% · Total {cost}',
'ovMetric.subStepsAndCache': '{steps} steps · Cache {cache}%',
'ovMetric.subStepCost': 'Latest {cost}',
'ovMetric.subPromptHit': 'Latest {latest}% · Avg {avg}%',
'ovMetric.subInOutTokens': 'In {inTok} · Out {outTok}',
'ovMetric.subCtxRatio': '{used} / {limit}',
'ovMetric.subQuotaPool': '{label}',
'ovMetric.subQuotaPending': 'Waiting for quota sync',
// Context Window Widget
'ctx.followActive': 'Follow Active ({badge})',
'ctx.followActiveTitle': 'Automatically inspect the active or running agent context window',
'ctx.expandMore': '+{count} More ▾',
'ctx.expandMoreTitle': 'Expand all {count} subagent context pills',
'ctx.collapse': 'Less ▴',
'ctx.collapseTitle': 'Collapse extra subagent pills',
'ctx.ch.assistant': 'Assistant',
'ctx.ch.assistantTitle': 'Model reasoning, responses, and tool call arguments',
'ctx.ch.toolResults': 'Tool Results',
'ctx.ch.toolResultsTitle': 'File reads, terminal outputs, and tool execution results',
'ctx.ch.userInput': 'User Input',
'ctx.ch.userInputTitle': 'User messages and uploaded attachments',
'ctx.ch.subagent': 'Subagent',
'ctx.ch.subagentTitle': 'Subagent reports and background task notifications',
'ctx.ch.checkpoint': 'Checkpoint',
'ctx.ch.checkpointTitle': 'Compacted conversation checkpoint summaries',
'ctx.ch.systemPrompt': 'System Prompt',
'ctx.ch.systemPromptTitle': 'Core identity, sandbox, artifact, and environment prompts',
'ctx.ch.systemTools': 'System Tools',
'ctx.ch.systemToolsTitle': 'Built-in tool schema declarations',
'ctx.ch.mcpTools': 'MCP Tools',
'ctx.ch.mcpToolsTitle': 'MCP external server tool and resource schemas',
'ctx.ch.skills': 'Skills',
'ctx.ch.skillsTitle': 'Installed Skills index and instructions',
'ctx.ch.userRules': 'User Rules',
'ctx.ch.userRulesTitle': 'Global and workspace custom user_rules',
// Quota Pools Widget
'quota.weeklyShort': 'Weekly',
'quota.weeklyPool': 'Weekly ({pool})',
'quota.loading': 'Loading...',
'quota.failed': 'Unavailable (--%)',
'quota.usedAndLeft': '{reset} · Used {used}% ({rem}% left)',
'quota.cycle5hTitle': 'Current 5h cycle ({pool}): {tok} Tokens · {cost} · {calls} calls',
'quota.cycleWkCustomTitle': 'Current calendar week: {tok} Tokens · {cost} · {calls} calls',
'quota.cycleWkPoolTitle': 'Current weekly cycle ({pool}): {tok} Tokens · {cost} · {calls} calls',
'quota.footTokensCustom': 'Week Total: {tok} ({cost})',
'quota.footTokensCycle': 'Cycle Total: {tok} ({cost})',
'quota.footCredits': 'AI Credits: {credits}',
'quota.footCallsCustom': 'Week Calls: {calls}',
'quota.footCallsCycle': 'Cycle Calls: {calls}',
'quota.footTipCustom': 'Counted since Monday 00:00 local time',
'quota.footTipCycle': 'Summed across each quota pool weekly reset window',
// Live Activity Widget
'live.currentSession': 'Current Session',
'live.switchSessionTitle': 'Switch monitor to session: {title}',
'live.thinking': 'Thinking',
'live.running': 'Running',
'live.done': 'Done',
'live.doneWithSteps': 'Done ({steps} steps)',
'live.subToggleRunning': 'Subagents {run}/{total} {arrow}',
'live.subToggleIdle': 'Subagents ({total}) {arrow}',
'live.subCollapseTitle': 'Collapse subagent list',
'live.subExpandTitle': 'Expand subagent activity list',
// Consumption View
'cons.rangeToday': 'Today',
'cons.range24h': '24h',
'cons.range7d': '7d',
'cons.range14d': '14d',
'cons.range30d': '30d',
'cons.rangeAll': 'All',
'cons.rangeCustom': 'Custom',
'cons.rangeAria': 'Usage statistics time range',
'cons.applyFilter': 'Apply',
'cons.rangeTo': 'to',
'cons.overviewTitle': 'Usage Overview',
'cons.totalTokens': 'Total Tokens',
'cons.estCost': 'Est. Cost',
'cons.cacheHitRate': 'Cache Hit Rate',
'cons.callsCount': '{calls} calls',
'cons.cacheHitTokens': 'Hit {tokens}',
'cons.newInput': 'New Input',
'cons.uncachedInput': 'Uncached input',
'cons.cacheRead': 'Cache Read',
'cons.savedCost': 'Saved {cost}',
'cons.outputUsage': 'Output',
'cons.replyAndThink': 'Reply {resp} · Think {think}',
'cons.trendTitle': 'Usage Trend',
'cons.allTime': 'All Time',
'cons.trendHeatmapHint': 'Daily ({days}d) · Hover for details',
'cons.trendPointsHintHourly': 'Hourly ({points} pts) · Hover for details',
'cons.trendPointsHintDaily': 'Daily ({points} pts) · Hover for details',
'cons.topModels': 'Top Models',
'cons.clientSources': 'Client Sources',
'cons.monthlyTitle': 'Monthly Breakdown',
'cons.monthLabel': 'M{m}',
'cons.legInput': 'Input',
'cons.legCache': 'Cache',
'cons.legOutput': 'Output',
'cons.legThinking': 'Think',
'cons.footInput': 'In ',
'cons.footCache': 'Cache ',
'cons.footOutput': 'Out ',
'cons.footThinking': 'Think ',
'cons.footCalls': 'Calls ',
// Steps Detail View & Step Column Registry
'steps.title': 'Step Records',
'steps.tabSteps': 'Steps ({count})',
'steps.tabStepsFiltered': 'Steps ({filtered}/{total})',
'steps.tabModels': 'Analytics',
'steps.allAgents': 'All Agents',
'steps.allModels': 'All Models',
'steps.selectModel': 'Select Model',
'steps.unitAgent': 'agents',
'steps.unitModel': 'models',
'steps.lineTitle': 'Session Timeline',
'steps.fitTitle': 'Trend Fit',
'steps.modelsTitle': 'Model Summary',
'steps.modelsEmpty': 'No model calls in current scope',
'steps.metricTotalTokens': 'Tokens',
'steps.metricContext': 'Context',
'steps.metricTps': 'TPS',
'steps.metricTtft': 'TTFT',
'steps.metricCache': 'Cache',
'steps.metricCost': 'Cost',
'steps.badgeBackAll': 'Click to return to All Agents',
'steps.badgeFilterAgent': 'Click to filter {agent} (Ctrl/Shift-click to multi-select)',
'steps.ctxTitle': 'Context {ctx} · Thinking {think} · Reply {resp}',
'steps.modelCallsShare': '{calls} calls · {pct}%',
'steps.modelCallsOnly': '{calls} calls',
'steps.modelsSummaryPrefix': '{count} models · ',
'steps.modelPerfFoot': 'Avg {tps} · TTFT {ttft} · Cache {cache}%',
'steps.modelSplitFoot': 'In {inTok} · Cache {cacheTok} · Think {thinkTok} · Out {respTok}',
'steps.fitActiveCardTitle': '{title} (Active in Trend Fit; Ctrl/Shift-click to compare)',
'steps.fitInactiveCardTitle': 'Click to inspect {text} in Trend Fit (Ctrl/Shift-click to compare)',
// Step Table Columns (Headers & Option Labels)
'stepCol.step.th': 'Step',
'stepCol.step.opt': 'Step & Agent',
'stepCol.time.th': 'Time',
'stepCol.time.opt': 'Timestamp (HH:mm:ss)',
'stepCol.model.th': 'Model',
'stepCol.model.opt': 'Model',
'stepCol.tps.th': 'Speed',
'stepCol.tps.opt': 'Output Speed (TPS)',
'stepCol.ttft.th': 'TTFT',
'stepCol.ttft.opt': 'First Token (TTFT)',
'stepCol.duration.th': 'Time(s)',
'stepCol.duration.opt': 'Total Duration (s)',
'stepCol.tokens_combo.th': 'Ctx / Think / Reply',
'stepCol.tokens_combo.opt': 'Ctx / Think / Reply (Combo)',
'stepCol.input_tokens.th': 'Input',
'stepCol.input_tokens.opt': 'New Input Tokens',
'stepCol.cache_tokens.th': 'CacheTok',
'stepCol.cache_tokens.opt': 'Cache Read Tokens',
'stepCol.output_tokens.th': 'Output',
'stepCol.output_tokens.opt': 'Total Output Tokens',
'stepCol.cache.th': 'Cache',
'stepCol.cache.opt': 'Cache Hit Rate (%)',
'stepCol.cost.th': 'Cost',
'stepCol.cost.opt': 'Step Cost ($)',
// Preferences (3-Tab Modular Settings)
'settings.subTab.general': 'General',
'settings.subTab.structure': 'Structure',
'settings.subTab.other': 'Other',
'settings.subTab.aria': 'Preferences category tabs',
'settings.saving': 'Saving…',
'settings.saved': 'Saved',
'settings.saveFailed': 'Save failed',
'settings.resetDone': 'Reset to default',
'settings.resetBtn': 'Reset',
// Preferences -> General Tab
'settings.gen.appearanceTitle': 'Interface & Appearance',
'settings.gen.language': 'Language',
'settings.gen.langZh': '简体中文',
'settings.gen.langEn': 'English',
'settings.gen.langAuto': 'Follow System',
'settings.gen.themeAccent': 'Accent Color',
'settings.gen.accentHost': 'Host',
'settings.gen.accentBlue': 'Blue',
'settings.gen.accentEmerald': 'Emerald',
'settings.gen.accentAmber': 'Amber',
'settings.gen.accentViolet': 'Violet',
'settings.gen.accentCyan': 'Cyan',
'settings.gen.accentRose': 'Rose',
'settings.gen.fontScale': 'Font Size',
'settings.gen.fontSm': 'Small',
'settings.gen.fontMd': 'Default',
'settings.gen.fontLg': 'Large',
'settings.gen.fontXl': 'XL',
'settings.gen.fontHint': 'Scales sidebar and popover typography while keeping the inline capsule compact',
'settings.gen.updateTitle': 'Updates & Pricing',
'settings.gen.updateMode': 'Update Policy',
'settings.gen.updateManual': 'Notify only, update manually',
'settings.gen.updateAuto': 'Auto update',
'settings.gen.updateOff': 'Disable updates',
'settings.gen.pricingLabel': 'Pricing Catalog',
'settings.gen.versionLabel': 'Current Version',
'settings.gen.modelCount': '{count} models',
'settings.gen.srcRemote': 'Cloud synced',
'settings.gen.srcLocal': 'Local file',
'settings.gen.srcDefault': 'Built-in',
'settings.gen.syncAt': 'Synced {time}',
'settings.gen.pubAt': 'Published {date}',
'settings.gen.defaultPricing': 'Default catalog',
'settings.gen.syncBtn': 'Sync Pricing',
'settings.gen.syncingBtn': 'Syncing…',
'settings.gen.syncingMsg': 'Syncing pricing catalog…',
'settings.gen.syncedMsg': 'Pricing updated ({count} models)',
'settings.gen.syncFallbackMsg': 'Timed out, using local catalog',
'settings.gen.checkUpdateBtn': 'Check Updates',
'settings.gen.checkingBtn': 'Checking…',
'settings.gen.checkingMsg': 'Checking for updates…',
'settings.gen.checkFailedMsg': 'Check failed: {err}',
'settings.gen.upToDateMsg': 'Already up to date (v{ver})',
'settings.gen.downloadingMsg': 'Downloading update…',
'settings.gen.updatedRestartMsg': 'Update complete, restarting panel…',
'settings.gen.updateSkippedMsg': 'Update not applied',
'settings.gen.updateFailedMsg': 'Update failed',
'settings.gen.canUpgradeSub': 'v{ver} available ({mode})',
'settings.gen.upgradeToBtn': 'Upgrade to v{ver}',
'settings.gen.manualUpgradeBtn': 'Upgrade v{ver}',
'settings.gen.updateOffSub': 'Notifications off ({mode})',
'settings.gen.latestSub': 'Up to date ({mode})',
// Preferences -> Structure Tab
'settings.str.mountSection': 'Mount & Capsule Bar',
'settings.str.mountBadge': '{count}/5 slots',
'settings.str.mountMode': 'Panel Mount Mode',
'settings.str.mountDual': 'Dual Mount (Titlebar + Sidebar)',
'settings.str.mountComposer': 'Composer Mount (Input Box + Sidebar)',
'settings.str.mountSidebar': 'Sidebar Only',
'settings.str.multiToggle': 'Active Sessions Pill',
'settings.str.show': 'Show',
'settings.str.hide': 'Hide',
'settings.str.capsuleSlotsLabel': 'Capsule Metrics & Order (Left → Right, 1–5)',
'settings.str.addCapsuleSlot': 'Add Slot ({count}/{max})',
'settings.str.hoverSection': 'Hover Quick-View',
'settings.str.hoverBadgeOff': 'Off',
'settings.str.hoverBadgeCount': '{count} modules',
'settings.str.hoverModulesLabel': 'Hover Popup Modules (Top → Bottom, 0–4)',
'settings.str.hoverEmptyHint': 'Hover quick-view disabled (click capsule to open full panel)',
'settings.str.addHoverModule': 'Add Module ({count}/{max})',
'settings.str.overviewSection': 'Live Overview Layout',
'settings.str.overviewBadge': '{modCount} mod · {metCount} cells',
'settings.str.overviewModulesLabel': 'Overview Modules & Order (Top → Bottom, min 1)',
'settings.str.addOverviewModule': 'Add Module ({count}/{max})',
'settings.str.overviewMetricsLabel': 'First-Row Metrics (Left → Right, 1–4)',
'settings.str.overviewMetricsInactiveHint': '"Live Metrics" is hidden here; these cells still apply to Hover Quick-View or when re-added',
'settings.str.addOverviewMetric': 'Add Metric ({count}/{max})',
'settings.str.stepsSection': 'Step Table Columns',
'settings.str.stepsBadge': '{count} cols',
'settings.str.stepsColsLabel': '"Steps" Visible Columns (Left → Right, min 2)',
'settings.str.addStepCol': 'Add Column ({count}/{max})',
'settings.slot.moveUp': 'Move earlier',
'settings.slot.moveDown': 'Move later',
'settings.slot.remove': 'Remove item',
'settings.slot.minReached': 'Keep at least {min}',
'settings.slot.alreadyAdded': 'Added',
// Preferences -> Other Tab
'settings.oth.modelTitle': 'Model Identity Display',
'settings.oth.modelFormat': 'Model Name Format',
'settings.oth.modelShort': 'Short Alias (e.g. argon-4-high)',
'settings.oth.modelUpstream': 'Raw Upstream ID (e.g. gemini-3.8-flash-n)',
'settings.oth.orchFormat': 'Orchestrator Series ID',
'settings.oth.orchCompact': 'Compact Alias (e.g. orchestrator-argon)',
'settings.oth.orchFull': 'Full Upstream ID (e.g. gemini-pro-orchestrator)',
'settings.oth.baselineTitle': 'Model Context Settings',
'settings.oth.ctxModel': 'Model',
'settings.oth.ctxBaselineLabel': 'Context Window Limit',
'settings.oth.ctxChooseModel': 'Choose a model',
'settings.oth.ctxDefault': 'Follow host settings',
'settings.oth.ctxExpensive': '{name} (uses more quota)',
'settings.oth.ctxTokens': '{count} tokens',
'settings.oth.ctxUnavailable': '{name} (currently unavailable)',
'settings.oth.ctxConfigured': '{name} · Set',
'settings.oth.ctxConfiguredReported': '{name} · Set / Last seen {reported}',
'settings.oth.ctxDefaultReported': 'Default · Last seen {name}',
'settings.oth.ctxReported': 'The host reported {name} on the latest request.',
'settings.oth.ctxMixed': 'Different limits by thinking level',
'settings.oth.ctxMixedHint': 'Thinking levels for this model have different saved limits. Choose a limit to apply it to all levels.',
'settings.oth.ctxBaselineHint': 'Thinking levels for the same model share a limit. Saved limits are reapplied at plugin startup and used for future messages.',
'settings.oth.ctxNoModels': 'The host has not returned any available models.',
'settings.oth.ctxNoOptions': 'The host has not provided context options or a capacity for this model. Follow host settings is the only available option.',
'settings.oth.maintTitle': 'Cache & Reset',
'settings.oth.cacheLabel': 'Local Trajectory Cache',
'settings.oth.cacheDesc': 'Clear cached step records and rescan all conversation transcripts immediately',
'settings.oth.rebuildBtn': 'Rebuild Trajectory Cache',
'settings.oth.rebuildingBtn': 'Rebuilding…',
'settings.oth.rebuildDone': 'Trajectory cache rebuilt',
'settings.oth.rebuildFailed': 'Failed to rebuild cache',
'settings.oth.resetLabel': 'Factory Defaults',
'settings.oth.resetDesc': 'Restore all preferences across General, Structure, and Other tabs to default values',
'settings.oth.resetAllBtn': 'Reset All Defaults',
'settings.oth.resetConfirmBtn': 'Click Again to Confirm',
'settings.oth.resettingBtn': 'Resetting…',
'settings.oth.resetAllDone': 'All preferences restored to defaults',
});