The mirror looked broken because a backgrounded tab on one device still pinned the shared PTY to its (default 80x24) size — so the device actively viewing got a cramped terminal. Fix: only an ACTIVELY-VIEWING client votes on PTY size. - attachWs no longer seeds a default size vote (a join may be a hidden mirror) - new 'blur' client message + clearClientDims(): a tab going hidden withdraws its size vote (still mirrors output); show() re-casts it - PTY size = min cols/rows across clients that have actually reported dims - session/protocol tests cover hidden-mirror-doesn't-clamp + blur Session manager (separate page, for the 'too many sessions' problem): - GET stays; add DELETE /live-sessions/:id and DELETE /live-sessions[?detached=1] - manager.killById(); LiveSessionInfo gains cols/rows - public/manage.html + manage.ts: list/open/kill sessions, kill-all / kill-detached, auto-refresh; 🗂 toolbar button; bundled as a 2nd esbuild entry Verified: two concurrent clients mirror output + shared input; manage page lists/kills (3→2→0). 225 tests green, tsc clean.
43 lines
1.4 KiB
JSON
43 lines
1.4 KiB
JSON
{
|
|
"name": "web-terminal",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"description": "Browser terminal over WebSocket to the host's local shell (vibe coding). LAN-only, no auth.",
|
|
"engines": {
|
|
"node": ">=18"
|
|
},
|
|
"scripts": {
|
|
"postinstall": "chmod +x node_modules/node-pty/prebuilds/darwin-*/spawn-helper 2>/dev/null || true",
|
|
"start": "tsx src/server.ts",
|
|
"dev": "tsx watch src/server.ts",
|
|
"build": "tsc -p tsconfig.json",
|
|
"build:web": "esbuild public/main.ts public/manage.ts --bundle --format=esm --outdir=public/build --sourcemap",
|
|
"dev:web": "esbuild public/main.ts public/manage.ts --bundle --format=esm --outdir=public/build --sourcemap --watch",
|
|
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.web.json",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"setup-hooks": "node scripts/setup-hooks.mjs"
|
|
},
|
|
"dependencies": {
|
|
"@xterm/addon-fit": "^0.11.0",
|
|
"@xterm/addon-search": "^0.16.0",
|
|
"@xterm/addon-web-links": "^0.12.0",
|
|
"@xterm/xterm": "^6.0.0",
|
|
"express": "^5.2.1",
|
|
"node-pty": "^1.1.0",
|
|
"qrcode": "^1.5.4",
|
|
"ws": "^8.21.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/express": "^5.0.6",
|
|
"@types/node": "^25.9.3",
|
|
"@types/qrcode": "^1.5.6",
|
|
"@types/ws": "^8.18.1",
|
|
"esbuild": "^0.28.1",
|
|
"tsx": "^4.22.4",
|
|
"typescript": "^6.0.3",
|
|
"vitest": "^4.1.9"
|
|
}
|
|
}
|