refactor: Use dedicated WebSocket server for torch sync

- Add torch WebSocket server on port 4106
- Remove HTTP polling, use WebSocket for instant sync
- Torch state changes broadcast immediately to all clients
- Auto-reconnect on disconnect
- Add port 4106 to kill-ports script
This commit is contained in:
2026-02-14 16:40:40 -06:00
parent fe99c9ff61
commit c98f3e2b99
8 changed files with 309 additions and 334 deletions

View File

@@ -11,7 +11,6 @@ import { handleWhisperRoutes } from './whisper'
import { handleRecordingsRoutes } from './recordings'
import { handleClaudeStatus } from './claude-status'
import { handleGitStatus, handleGitDiff, handleGitLog, handleGitLogCommit, handleGitCompare, handleGitBranches, handleGitCurrentBranch, handleGitTree, handleGitFile } from './git'
import { handleTorch } from './torch'
export async function handleRequest(req: Request): Promise<Response> {
const url = new URL(req.url)
@@ -51,12 +50,6 @@ export async function handleRequest(req: Request): Promise<Response> {
if (res) return res
}
// Torch (multi-browser MCP control)
if (path.startsWith('/api/torch')) {
const res = await handleTorch(req, url)
if (res) return res
}
// Claude Code status (thinking/idle)
if (path === '/api/claude-status') {
const res = await handleClaudeStatus(req)