feat: Implement LiveCode module with WebSocket and SSE support

- Added config management using `useConfig` for environment variables.
- Created `LiveCode` class to manage WebSocket connections and routing.
- Implemented `SSEManager` for Server-Sent Events handling.
- Developed `WSSManager` for managing WebSocket connections with heartbeat functionality.
- Introduced `ReconnectingWebSocket` class for robust WebSocket client with automatic reconnection.
- Added test files for live application demonstrating WebSocket and TCP server integration.
This commit is contained in:
2026-02-02 23:29:58 +08:00
parent 5774391bbe
commit a76c2235ea
19 changed files with 871 additions and 385 deletions

View File

@@ -1,6 +1,6 @@
import { useContextKey } from '@kevisual/context';
import { app, assistantConfig, runtime } from './app.ts';
import { proxyRoute, proxyWs } from './services/proxy/proxy-page-index.ts';
import { proxyLivecodeWs, proxyRoute, proxyWs } from './services/proxy/proxy-page-index.ts';
import './routes/index.ts';
import './routes-simple/index.ts';
@@ -49,6 +49,7 @@ export const runServer = async (port: number = 51515, listenPath = '127.0.0.1')
func: proxyRoute as any,
},
...proxyWs(),
...proxyLivecodeWs(),
qwenAsr,
]);
const manager = useContextKey('manager', new AssistantApp(assistantConfig, app));