refactor(app): rewrite the M2 Discord voice core in Rust
The user asked for a faster, real app instead of Electron. The app is now a Rust crate (serenity + songbird); the GUI in M5 will be a Tauri 2 shell on the system WebView2. - Same behaviour as the Electron core: one voice channel, per-speaker PCM to the voice worker, speaking_end and speaker_leave, sentence playback with stop and cancel, transcription notice on join, slash command join/leave/stop (create-or-update), registered chat channels with live events, history and sends that never ping, worker process with a fresh token and restart backoff. - songbird 0.6.1 garbles about a third of received frames under DAVE (its decoder keeps the bytes DAVE decryption leaves at the end of the payload; a 20 ms stepped test tone showed repeats, skips and reordering, while sending was exact). songbird now only decrypts; the core reorders packets in a small window (Opus FEC for the last lost frame) and decodes them with libopus itself. - Live test on real Discord with two bots: five sentences heard (CER 0/0/0/5/12.5%), 0.71-0.90 s from end of speech to final, speech read back at 3.4%, sound gone 0.08 s after stop. The release binary uses about 16 MB of memory; a Windows build (MinGW) logs in under Wine. - Spec moved to app/src/discord_core.spec.md; architecture, decisions, roadmap and pc-features updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -50,14 +50,14 @@ v1도 STT는 이미 faster-whisper입니다. 느린 진짜 이유는 엔진이
|
||||
```
|
||||
[게임PC (Windows 11) 한 대에서 전부 실행]
|
||||
|
||||
1. Jarvis 관리 앱 (exe, Electron + TypeScript)
|
||||
1. Jarvis 관리 앱 (exe, Rust. 화면은 Tauri 2 + Windows 기본 WebView2)
|
||||
├─ GUI: 대시보드 / 봇 / 채널·호출 / 채팅 채널 / 대화 기억 / 모델 / 기능
|
||||
│ / 게임 모드 / PC 제어 / 화면 보기 / 데이터 / 로그
|
||||
├─ 서비스 관리자: 아래 프로세스를 띄우고, 감시하고, 죽으면 재시작
|
||||
├─ 디스코드 음성 코어 (discord.js + @discordjs/voice + DAVE 복호화)
|
||||
├─ 디스코드 음성 코어 (serenity + songbird + DAVE 복호화, Opus 해독은 앱이 직접)
|
||||
│ 화자별 Opus 수신 → PCM → 음성 워커로 전달 / TTS 음성 재생
|
||||
├─ 채팅 채널 연결 (등록한 채널 읽기·보내기·수정·검색)
|
||||
├─ 브라우저 에이전트 (Playwright + 봇용 크롬창, 백그라운드 가능)
|
||||
├─ 브라우저 에이전트 (크롬 개발자 프로토콜(CDP) + 봇용 크롬창, 백그라운드 가능)
|
||||
├─ 게임·안티치트 감지 (게임 모드 전환, 자동 입력 차단)
|
||||
└─ PC 제어 모듈 (전체·모니터별·창별 화면 캡처, agent-desktop으로 프로그램 조작,
|
||||
접근성 정보가 없는 화면만 키보드/마우스 입력)
|
||||
@@ -80,10 +80,10 @@ v1도 STT는 이미 faster-whisper입니다. 느린 진짜 이유는 엔진이
|
||||
|
||||
| 부분 | 선택 | 이유 |
|
||||
|---|---|---|
|
||||
| GUI 앱 | Electron + TypeScript (React UI) | 디스코드 음성 코어(discord.js), Playwright, 화면 캡처가 모두 Node 생태계라 한 언어로 묶입니다. v1 봇 코드(TypeScript)를 옮길 수 있습니다. Tauri는 가볍지만 Rust와 Node 사이드카를 따로 둬야 해서 복잡해집니다. |
|
||||
| 관리 앱 | Rust (화면은 Tauri 2) | 처음에는 Electron + TypeScript로 정했지만 더 빠르고 가벼운 진짜 앱으로 바꿈(사용자 결정, 2026-11-11). 디스코드 음성(serenity, songbird, DAVE), 브라우저 조종(CDP), 화면 캡처(Windows Graphics Capture)를 모두 Rust로 할 수 있어 Node 사이드카가 필요 없습니다. 화면은 Tauri 2가 Windows에 이미 있는 WebView2로 그리므로 크로미움을 따로 싣지 않습니다. 같은 음성 코어를 이 서버에서 띄웠을 때 실행 파일 하나, 메모리 약 16MB였습니다(Electron은 프로세스 5개). songbird 0.6.1은 DAVE로 받은 소리를 해독할 때 조각 3분의 1가량을 깨뜨려서, 암호 풀기만 맡기고 순서 맞추기와 Opus 해독은 앱이 직접 합니다 ([discord_core.spec.md](../../app/src/discord_core.spec.md)). |
|
||||
| 음성 워커 | Python (faster-whisper, MeloTTS, 기존 jarvis) | STT·TTS 모델과 기존 두뇌 코드(메모리, 도구, 스펙 문서)가 Python입니다. 다시 짜는 것보다 재사용이 안전합니다. |
|
||||
| LLM 엔진 | Strata (MIT) | Windows 설치 지원, RTX 50 지원, `--data-dir`로 저장 위치 지정, 헤드리스 실행(`--no-tui`). 앱에 포함해 배포해도 라이선스 문제가 없습니다. |
|
||||
| PC 프로그램 조작 | agent-desktop (Apache-2.0) | Windows UI Automation으로 버튼·입력칸을 읽고 직접 누릅니다. 좌표 클릭보다 정확하고, 커서와 포커스를 뺏지 않습니다. 실행 파일 하나라 설치 파일에 넣기 쉽습니다. ([pc-features.md](pc-features.md#키보드마우스-제어와-안티치트)) |
|
||||
| LLM 예비 엔진 | OpenAI 호환 주소 | Strata에 문제가 생기면 같은 모델(GGUF)을 llama.cpp 같은 다른 로컬 엔진으로 돌려 연결합니다. 모델은 바꾸지 않습니다. |
|
||||
| Python 런타임 | uv + 독립 실행형 Python 3.12 | 사용자가 Python을 따로 깔 필요가 없고 시스템 Python과 섞이지 않습니다. 전부 데이터 폴더 안에 설치됩니다. |
|
||||
| 설치 파일 | NSIS (electron-builder) | 설치 파일은 약 200MB 내외로 두고, 모델과 런타임은 첫 실행 때 받습니다. |
|
||||
| 설치 파일 | NSIS (Tauri 번들러) | 설치 파일은 약 200MB 내외로 두고, 모델과 런타임은 첫 실행 때 받습니다. |
|
||||
|
||||
Reference in New Issue
Block a user