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
src/jarvis/tools/builtin/stop.py
Normal file
51
src/jarvis/tools/builtin/stop.py
Normal file
@@ -0,0 +1,51 @@
|
||||
"""Tool to end a conversation gracefully.
|
||||
|
||||
When the user says non-follow-up phrases like "okay", "stop", "shush", "shut up",
|
||||
or similar dismissive phrases, the LLM should call this tool to end the conversation.
|
||||
The user will need to use the wake word again to start a new conversation.
|
||||
"""
|
||||
|
||||
from typing import Dict, Any, Optional
|
||||
from ..base import Tool, ToolContext
|
||||
from ..types import ToolExecutionResult
|
||||
from ...debug import debug_log
|
||||
|
||||
|
||||
# Special marker that signals the reply engine to stop without responding
|
||||
STOP_SIGNAL = "__JARVIS_STOP_CONVERSATION__"
|
||||
|
||||
|
||||
class StopTool(Tool):
|
||||
"""Tool to end a conversation without generating a response."""
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
return "stop"
|
||||
|
||||
@property
|
||||
def description(self) -> str:
|
||||
return (
|
||||
"End the current conversation. Use when the user dismisses you, says goodbye, "
|
||||
"indicates they are done, tells you to stop or be quiet, or otherwise signals "
|
||||
"the conversation should end. Do NOT use this for follow-up questions, requests "
|
||||
"for more information, or any query that expects a response."
|
||||
)
|
||||
|
||||
@property
|
||||
def inputSchema(self) -> Dict[str, Any]:
|
||||
return {
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"required": []
|
||||
}
|
||||
|
||||
def run(self, args: Optional[Dict[str, Any]], context: ToolContext) -> ToolExecutionResult:
|
||||
"""Execute the stop tool - signals conversation end."""
|
||||
debug_log("stop tool invoked - ending conversation", "tools")
|
||||
|
||||
# Return the special stop signal that the reply engine will recognize
|
||||
return ToolExecutionResult(
|
||||
success=True,
|
||||
reply_text=STOP_SIGNAL,
|
||||
error_message=None
|
||||
)
|
||||
Reference in New Issue
Block a user