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

@@ -7,6 +7,7 @@
import { startTerminalServer } from './services/terminal'
import { startGitServer } from './services/git-watcher'
import { startTorchServer } from './services/torch-server'
import { WORKING_DIR } from './config'
console.log('')
@@ -14,6 +15,7 @@ console.log('='.repeat(50))
console.log('Terminal Server (Independent Process)')
console.log(` Terminal WebSocket: ws://localhost:4103`)
console.log(` Git WebSocket: ws://localhost:4105`)
console.log(` Torch WebSocket: ws://localhost:4106`)
console.log(` Working Dir: ${WORKING_DIR}`)
console.log('')
console.log('This process is stable and won\'t restart')
@@ -23,3 +25,4 @@ console.log('')
startTerminalServer()
startGitServer()
startTorchServer()