Files
javis_bot/bot/package.json
javis-bot 4176a68873 fix(selfbot): smooth VNC capture via keepalive + stop ffmpeg leak on stream end
The Go-Live broadcast looked badly choppy: video and scrolling stuttered while
the cursor stayed smooth. Root cause is TigerVNC: it only refreshes its
framebuffer while a VNC client is attached, but the broadcast reads that
framebuffer with x11grab (not as a VNC client). With no viewer attached the
captured screen idled at ~1.5 fps (measured 3/30 distinct frames); the cursor
looked smooth only because x11grab overlays the live cursor on every frame.

- Add a headless RFB keepalive (vnc-keepalive.ts) that stays connected for the
  life of the stream and requests incremental framebuffer updates at the stream
  framerate. SelfbotStreamer starts it on broadcast start and tears it down on
  stop/self-end. Measured 3/30 -> 57/60 distinct frames at 60 fps. Fail-open;
  authenticates with VNC_PASSWORD or the ~/.config/tigervnc/passwd file.
- Fix a resource leak: when the Go-Live ended on its own, only the active flag
  was cleared, leaving the x11grab->nvenc ffmpeg running forever (pinning a CPU
  core while no media was transmitted, with only the gateway TCP left and no UDP
  media). The self-end path now tears down capture, keepalive and voice like
  stop() does.
- Tests for both paths (self-end teardown; keepalive DES auth, port mapping,
  password resolution). Add @types/bun so bun:test typechecks; document the
  keepalive and recommended Chrome flags in README and .env.example.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-10 15:21:44 +09:00

37 lines
941 B
JSON

{
"name": "javis-bot",
"version": "0.1.0",
"private": true,
"type": "module",
"description": "Discord-native voice/video front-end for the Jarvis brain (bun + discord.js)",
"scripts": {
"start": "bun run src/index.ts",
"register": "bun run src/register-commands.ts",
"token": "bun run src/get-token.ts",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@discordjs/voice": "^0.18.0",
"discord.js": "^14.16.3",
"dotenv": "^16.4.5",
"libsodium-wrappers": "^0.7.15",
"opusscript": "^0.1.1",
"prism-media": "^1.3.5",
"qrcode": "^1.5.4"
},
"optionalDependencies": {
"@dank074/discord-video-stream": "^6.0.0",
"discord.js-selfbot-v13": "^3.7.1"
},
"devDependencies": {
"@types/bun": "^1.3.14",
"@types/node": "^22.7.0",
"@types/qrcode": "^1.5.6",
"typescript": "^5.6.3"
},
"trustedDependencies": [
"@lng2004/node-datachannel",
"node-av"
]
}