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:
37
src/jarvis/debug.py
Normal file
37
src/jarvis/debug.py
Normal file
@@ -0,0 +1,37 @@
|
||||
"""Debug logging utilities for Jarvis."""
|
||||
import sys
|
||||
import time
|
||||
from typing import Optional
|
||||
from .config import load_settings
|
||||
|
||||
|
||||
_last_check_time: float = 0.0
|
||||
_cached_voice_debug: Optional[bool] = None
|
||||
_CACHE_TTL_SECONDS: float = 2.0
|
||||
|
||||
|
||||
def _is_debug_enabled() -> bool:
|
||||
global _last_check_time, _cached_voice_debug
|
||||
now = time.time()
|
||||
if _cached_voice_debug is None or (now - _last_check_time) > _CACHE_TTL_SECONDS:
|
||||
try:
|
||||
_cached_voice_debug = bool(load_settings().voice_debug)
|
||||
except Exception:
|
||||
_cached_voice_debug = False
|
||||
_last_check_time = now
|
||||
return bool(_cached_voice_debug)
|
||||
|
||||
|
||||
def debug_log(message: str, category: str = "debug") -> None:
|
||||
"""Unified debug logging function for Jarvis.
|
||||
|
||||
Args:
|
||||
message: The debug message to log
|
||||
category: The log category (e.g., "debug", "voice", "echo", "tts", etc.)
|
||||
"""
|
||||
if not _is_debug_enabled():
|
||||
return
|
||||
try:
|
||||
print(f"[{category:^10}] {message}", file=sys.stderr)
|
||||
except Exception:
|
||||
pass
|
||||
Reference in New Issue
Block a user