Add Discord-native hybrid front-end for Jarvis (bot + bridge)
Some checks failed
Release / semantic-release (push) Successful in 59s
tests / Unit tests (Linux, Python 3.11) (push) Successful in 13m45s
Release / build-linux (push) Failing after 7m47s
Release / build-windows (push) Has been cancelled
Release / build-macos (arm64, macos-latest) (push) Has been cancelled
Release / build-macos (x64, macos-15-intel) (push) Has been cancelled
Release / release-main (push) Has been cancelled
Release / release-develop (push) Has been cancelled
Some checks failed
Release / semantic-release (push) Successful in 59s
tests / Unit tests (Linux, Python 3.11) (push) Successful in 13m45s
Release / build-linux (push) Failing after 7m47s
Release / build-windows (push) Has been cancelled
Release / build-macos (arm64, macos-latest) (push) Has been cancelled
Release / build-macos (x64, macos-15-intel) (push) Has been cancelled
Release / release-main (push) Has been cancelled
Release / release-develop (push) Has been cancelled
Transform isair/jarvis into a Discord-controlled voice assistant running on the Ubuntu VNC desktop, keeping the mature ~39k-line Python brain intact. - bot/ (Node + bun, discord.js): /자비스 slash commands (ephemeral), voice channel join + voice receive/playback, pluggable VNC screen broadcast (selfbot live / noVNC / screenshot) - bridge/ (Python, Flask): wraps jarvis STT + run_reply_engine + Piper TTS behind a thin localhost HTTP API - .env.example, scripts/ (start_bridge/start_bot/dev), README rewrite, docs/language-comparison.md and docs/vnc-xfce-setup.md Language decision: hybrid (Python brain + Node/bun Discord layer) because Discord blocks bot video; native screen broadcast only works via a Node selfbot library.
This commit is contained in:
51
bot/src/stream/index.ts
Normal file
51
bot/src/stream/index.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Pluggable VNC screen-broadcast backends.
|
||||
*
|
||||
* Per the chosen design (option 1): the streaming method is swappable via
|
||||
* STREAM_BACKEND in .env. The default is the real live "Go Live" stream via a
|
||||
* selfbot account (only way to get a native Discord video broadcast), with safe
|
||||
* fallbacks (noVNC link / periodic screenshots) available without code changes.
|
||||
*/
|
||||
import type { AppConfig } from "../config.ts";
|
||||
|
||||
export interface StreamContext {
|
||||
guildId: string;
|
||||
voiceChannelId: string;
|
||||
/** Post an image to the invoking text channel (used by the screenshot backend). */
|
||||
postImage?: (png: Buffer, name: string) => Promise<void>;
|
||||
}
|
||||
|
||||
export interface ScreenStreamer {
|
||||
readonly kind: AppConfig["streamBackend"];
|
||||
/** Start broadcasting. Returns a short user-facing status/link message. */
|
||||
start(ctx: StreamContext): Promise<string>;
|
||||
stop(): Promise<void>;
|
||||
isActive(): boolean;
|
||||
}
|
||||
|
||||
export async function createStreamer(config: AppConfig): Promise<ScreenStreamer> {
|
||||
switch (config.streamBackend) {
|
||||
case "selfbot": {
|
||||
const { SelfbotStreamer } = await import("./selfbot.ts");
|
||||
return new SelfbotStreamer(config);
|
||||
}
|
||||
case "novnc": {
|
||||
const { NoVncStreamer } = await import("./novnc.ts");
|
||||
return new NoVncStreamer(config);
|
||||
}
|
||||
case "screenshot": {
|
||||
const { ScreenshotStreamer } = await import("./screenshot.ts");
|
||||
return new ScreenshotStreamer(config);
|
||||
}
|
||||
case "none":
|
||||
default:
|
||||
return {
|
||||
kind: "none",
|
||||
async start() {
|
||||
return "화면 송출이 비활성화되어 있습니다 (STREAM_BACKEND=none).";
|
||||
},
|
||||
async stop() {},
|
||||
isActive: () => false,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user