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

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:
javis-bot
2026-06-09 14:51:05 +09:00
parent a5bf8d1826
commit c4abf63f38
308 changed files with 94135 additions and 1 deletions

View File

@@ -0,0 +1,68 @@
"""Tests for stop tool."""
import pytest
from unittest.mock import Mock
from src.jarvis.tools.builtin.stop import StopTool, STOP_SIGNAL
from src.jarvis.tools.base import ToolContext
from src.jarvis.tools.types import ToolExecutionResult
class TestStopTool:
"""Test stop tool functionality."""
def setup_method(self):
"""Set up test fixtures."""
self.tool = StopTool()
self.context = Mock(spec=ToolContext)
self.context.user_print = Mock()
def test_tool_properties(self):
"""Test tool metadata properties."""
assert self.tool.name == "stop"
assert "end" in self.tool.description.lower()
assert "conversation" in self.tool.description.lower()
assert self.tool.inputSchema["type"] == "object"
assert self.tool.inputSchema["required"] == []
assert self.tool.inputSchema["properties"] == {}
def test_run_returns_stop_signal(self):
"""Test that run returns the special stop signal."""
result = self.tool.run({}, self.context)
assert isinstance(result, ToolExecutionResult)
assert result.success is True
assert result.reply_text == STOP_SIGNAL
assert result.error_message is None
def test_run_with_none_args(self):
"""Test that run works with None args."""
result = self.tool.run(None, self.context)
assert isinstance(result, ToolExecutionResult)
assert result.success is True
assert result.reply_text == STOP_SIGNAL
def test_stop_signal_is_unique(self):
"""Test that stop signal is a unique value unlikely to be confused with real content."""
assert STOP_SIGNAL.startswith("__")
assert STOP_SIGNAL.endswith("__")
assert "JARVIS" in STOP_SIGNAL
assert "STOP" in STOP_SIGNAL
class TestStopSignalIntegration:
"""Test stop signal integration with registry."""
def test_stop_tool_in_registry(self):
"""Test that stop tool is registered in BUILTIN_TOOLS."""
from src.jarvis.tools.registry import BUILTIN_TOOLS
assert "stop" in BUILTIN_TOOLS
assert isinstance(BUILTIN_TOOLS["stop"], StopTool)
def test_stop_tool_always_available(self):
"""Test that stop tool is available to all profiles via BUILTIN_TOOLS."""
from src.jarvis.tools.registry import BUILTIN_TOOLS
assert "stop" in BUILTIN_TOOLS, "stop tool must be in BUILTIN_TOOLS"