From a36b73505754acab6872d23c9add58dfca3cecdd Mon Sep 17 00:00:00 2001 From: haoyuren <13851610112@163.com> Date: Sun, 15 Mar 2026 18:47:29 -0500 Subject: Add online users popover, MCP get_online_users, claude-workspace, stronger CLAUDE.md - Online users: click "N online" badge to see user names with cursor colors - MCP get_online_users tool: main process tracks users in .lattex-online-users.json - CLAUDE.md: show current user's Overleaf name (fetched from /user/settings) - CLAUDE.md: mandatory first steps with MUST/NEVER language at top of file - claude-workspace/ directory: untracked scratch space for Claude Code experiments - chokidar + bridge skip claude-workspace/ to prevent syncing to Overleaf Co-Authored-By: Claude Opus 4.6 --- src/mcp/lattex.mjs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/mcp/lattex.mjs') diff --git a/src/mcp/lattex.mjs b/src/mcp/lattex.mjs index 861ff40..cfac04a 100644 --- a/src/mcp/lattex.mjs +++ b/src/mcp/lattex.mjs @@ -486,6 +486,15 @@ const TOOLS = [ } } } + }, + // ── Online Users ── + { + name: 'get_online_users', + description: 'Get the list of users currently online in this Overleaf project.', + inputSchema: { + type: 'object', + properties: {} + } } ] @@ -861,6 +870,21 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { ) } + case 'get_online_users': { + const cwd = process.cwd() + const usersPath = join(cwd, '.lattex-online-users.json') + try { + const users = JSON.parse(readFileSync(usersPath, 'utf-8')) + if (!Array.isArray(users) || users.length === 0) { + return textResult('No other users currently online.') + } + const lines = users.map(u => `- ${u.name}${u.email ? ` (${u.email})` : ''}`) + return textResult(`${users.length} user(s) online:\n${lines.join('\n')}`) + } catch { + return textResult('No other users currently online.') + } + } + default: return errorResult(`Unknown tool: ${name}`) } -- cgit v1.2.3