websockets based IPC added in order to bind GUI/app together

This commit is contained in:
Priler 2026-01-07 00:15:36 +05:00
parent eb0d40bae6
commit adec595cfa
15 changed files with 1069 additions and 47 deletions

View file

@ -0,0 +1,50 @@
use serde::{Deserialize, Serialize};
// Events sent from jarvis-app to GUI
#[derive(Clone, Debug, Serialize)]
#[serde(tag = "event", rename_all = "snake_case")]
pub enum IpcEvent {
// Wake word detected, starting to listen
WakeWordDetected,
// Actively listening for command
Listening,
// Speech recognized
SpeechRecognized { text: String },
// Command was executed
CommandExecuted { id: String, success: bool },
// Returned to idle state
Idle,
// Error occurred
Error { message: String },
// App started
Started,
// App is shutting down
Stopping,
// Pong response
Pong,
}
// Actions sent from GUI to jarvis-app
#[derive(Clone, Debug, Deserialize)]
#[serde(tag = "action", rename_all = "snake_case")]
pub enum IpcAction {
// Request graceful shutdown
Stop,
// Reload commands from disk
ReloadCommands,
// Ping to check connection
Ping,
// Mute/unmute listening
SetMuted { muted: bool },
}