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

@@ -25,6 +25,7 @@
"dev:share": "bun --watch src/test/remote-app.ts ",
"build:lib": "bun run bun-lib.config.mjs",
"postbuild:lib": "dts -i src/lib.ts -o assistant-lib.d.ts -d libs -t",
"dev:live": "bun --watch src/test/live-app.ts ",
"build": "rimraf dist && bun run bun.config.mjs"
},
"bin": {
@@ -43,19 +44,18 @@
"devDependencies": {
"@inquirer/prompts": "^8.2.0",
"@kevisual/ai": "^0.0.24",
"@kevisual/api": "^0.0.35",
"@kevisual/cnb": "^0.0.13",
"@kevisual/api": "^0.0.42",
"@kevisual/load": "^0.0.6",
"@kevisual/local-app-manager": "^0.1.32",
"@kevisual/logger": "^0.0.4",
"@kevisual/query": "0.0.38",
"@kevisual/query": "0.0.39",
"@kevisual/query-login": "0.0.7",
"@kevisual/router": "^0.0.64",
"@kevisual/router": "^0.0.67",
"@kevisual/types": "^0.0.12",
"@kevisual/use-config": "^1.0.28",
"@opencode-ai/plugin": "^1.1.47",
"@kevisual/use-config": "^1.0.30",
"@opencode-ai/plugin": "^1.1.48",
"@types/bun": "^1.3.8",
"@types/node": "^25.1.0",
"@types/node": "^25.2.0",
"@types/send": "^1.2.1",
"@types/ws": "^8.18.1",
"chalk": "^5.6.2",
@@ -78,11 +78,10 @@
},
"dependencies": {
"@aws-sdk/client-s3": "^3.980.0",
"@kevisual/ha-api": "^0.0.8",
"@kevisual/js-filter": "^0.0.5",
"@kevisual/oss": "^0.0.18",
"@kevisual/oss": "^0.0.19",
"@kevisual/video-tools": "^0.0.13",
"@opencode-ai/sdk": "^1.1.47",
"@opencode-ai/sdk": "^1.1.48",
"es-toolkit": "^1.44.0",
"eventemitter3": "^5.0.4",
"lowdb": "^7.0.1",