diff --git a/editors/index.js b/editors/index.js index 1332daf..ed8ce6d 100644 --- a/editors/index.js +++ b/editors/index.js @@ -11,6 +11,44 @@ const copilot = require('./copilot'); const cursorAgent = require('./cursor-agent'); const commandcode = require('./commandcode'); +const EDITOR_COLORS = { + 'cursor': '#f59e0b', + 'windsurf': '#06b6d4', + 'windsurf-next': '#22d3ee', + 'antigravity': '#a78bfa', + 'claude-code': '#f97316', + 'claude': '#f97316', + 'vscode': '#3b82f6', + 'vscode-insiders': '#60a5fa', + 'zed': '#10b981', + 'opencode': '#ec4899', + 'codex': '#0f766e', + 'gemini-cli': '#4285f4', + 'kimi-cli': '#84cc16', + 'copilot-cli': '#8957e5', + 'cursor-agent': '#f59e0b', + 'commandcode': '#e11d48', +}; + +const EDITOR_LABELS = { + 'cursor': 'Cursor', + 'windsurf': 'Windsurf', + 'windsurf-next': 'Windsurf Next', + 'antigravity': 'Antigravity', + 'claude-code': 'Claude Code', + 'claude': 'Claude Code', + 'vscode': 'VS Code', + 'vscode-insiders': 'VS Code Insiders', + 'zed': 'Zed', + 'opencode': 'OpenCode', + 'codex': 'Codex', + 'gemini-cli': 'Gemini CLI', + 'kimi-cli': 'Kimi CLI', + 'copilot-cli': 'Copilot CLI', + 'cursor-agent': 'Cursor Agent', + 'commandcode': 'Command Code', +}; + const editors = [cursor, windsurf, claude, vscode, zed, opencode, codex, gemini, kimi, copilot, cursorAgent, commandcode]; /** @@ -53,4 +91,4 @@ function resetCaches() { } } -module.exports = { getAllChats, getMessages, editors, resetCaches }; +module.exports = { getAllChats, getMessages, editors, resetCaches, EDITOR_LABELS, EDITOR_COLORS }; diff --git a/relay-client.js b/relay-client.js index d1d755a..9d046b9 100644 --- a/relay-client.js +++ b/relay-client.js @@ -4,28 +4,10 @@ const readline = require('readline'); const crypto = require('crypto'); const cache = require('./cache'); +const { EDITOR_LABELS } = require('./editors'); const SYNC_INTERVAL_MS = 30000; // 30 seconds -const EDITOR_LABELS = { - 'cursor': 'Cursor', - 'windsurf': 'Windsurf', - 'windsurf-next': 'Windsurf Next', - 'antigravity': 'Antigravity', - 'claude-code': 'Claude Code', - 'claude': 'Claude Code', - 'vscode': 'VS Code', - 'vscode-insiders': 'VS Code Insiders', - 'zed': 'Zed', - 'opencode': 'OpenCode', - 'codex': 'Codex CLI', - 'gemini-cli': 'Gemini CLI', - 'kimi-cli': 'Kimi CLI', - 'copilot-cli': 'Copilot CLI', - 'cursor-agent': 'Cursor (Background Agent)', - 'commandcode': 'CommandCode', -}; - /** * Interactive project picker using readline (no external deps beyond Node built-ins). * Returns an array of selected folder paths. diff --git a/share-image.js b/share-image.js index 229db88..159e172 100644 --- a/share-image.js +++ b/share-image.js @@ -3,6 +3,8 @@ * Accepts an `opts` object to toggle sections on/off. */ +const { EDITOR_LABELS, EDITOR_COLORS } = require('./editors'); + function fmt(n) { if (n == null) return '0'; if (n >= 1_000_000) return (n / 1_000_000).toFixed(1) + 'M'; @@ -18,44 +20,6 @@ function fmtCost(n) { return '$' + n.toFixed(2); } -const EDITOR_COLORS = { - 'cursor': '#f59e0b', - 'windsurf': '#06b6d4', - 'windsurf-next': '#22d3ee', - 'antigravity': '#a78bfa', - 'claude-code': '#f97316', - 'claude': '#f97316', - 'vscode': '#3b82f6', - 'vscode-insiders': '#60a5fa', - 'zed': '#10b981', - 'opencode': '#ec4899', - 'codex': '#0f766e', - 'gemini-cli': '#4285f4', - 'kimi-cli': '#84cc16', - 'copilot-cli': '#8957e5', - 'cursor-agent': '#f59e0b', - 'commandcode': '#e11d48', -}; - -const EDITOR_LABELS = { - 'cursor': 'Cursor', - 'windsurf': 'Windsurf', - 'windsurf-next': 'WS Next', - 'antigravity': 'Antigravity', - 'claude-code': 'Claude Code', - 'claude': 'Claude Code', - 'vscode': 'VS Code', - 'vscode-insiders': 'VS Code Ins.', - 'zed': 'Zed', - 'opencode': 'OpenCode', - 'codex': 'Codex', - 'gemini-cli': 'Gemini CLI', - 'kimi-cli': 'Kimi CLI', - 'copilot-cli': 'Copilot CLI', - 'cursor-agent': 'Cursor Agent', - 'commandcode': 'Cmd Code', -}; - /** * @param {object} overview — from getCachedOverview() * @param {object} stats — from getCachedDashboardStats()