websockets based IPC added in order to bind GUI/app together
This commit is contained in:
parent
88ecf21b2c
commit
9b310fd831
15 changed files with 1069 additions and 47 deletions
50
crates/jarvis-core/src/ipc/events.rs
Normal file
50
crates/jarvis-core/src/ipc/events.rs
Normal 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 },
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue