Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src-tauri/crates/berd-call/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ Use `berd-call settings --input-during-tts allow|suppress` to change whether
microphone input can interrupt speech, and `berd-call settings --muted true|false`
to mute or unmute microphone input. Both apply live and are reflected by `status`.

`berd-call settings --conversation-status working|waiting` tells the call whether its agent is working or waiting for you, for hosts such as the Buzz plugin that know. The call plays no status sounds until it is first set. `berd-call settings --status-sounds off|working|working-and-waiting`, or Status Sounds in the menu bar, chooses what plays: Pop every five seconds while the agent works (the default), also Purr while it waits, or nothing. The mode is saved for later calls. `status` shows both as `statusSounds` and `conversationStatus`, and both survive `settings --restart`.

Settings the runtime cannot change live, such as STT backend or call mode, use
`berd-call settings --restart [session options]`. The replacement options are
complete `berd-call session` options. The call keeps its control port, stream,
Expand Down
7 changes: 7 additions & 0 deletions src-tauri/crates/berd-call/src/cli_help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ Usage:
berd-call settings [--port PORT] --input-during-tts allow|suppress
berd-call settings [--port PORT] --muted true|false
berd-call settings [--port PORT] --spokesperson true|false
berd-call settings [--port PORT] --status-sounds off|working|working-and-waiting
berd-call settings [--port PORT] --conversation-status working|waiting
berd-call settings [--port PORT] --restart [session options]

The setting applies to subsequent speak calls. In a call started with
Expand All @@ -106,6 +108,11 @@ The setting applies to subsequent speak calls. In a call started with
or off, restarting the call's session in the other mode with the same voice;
options only the other mode takes are dropped, and in a call started with
--stream live, agents keep their own voice beside the Spokesperson's.
--conversation-status tells the call whether the agent is working or waiting
for you; the call plays nothing until it is first set. --status-sounds chooses
what plays and is saved for later calls: Pop every five seconds while the agent
works (working, the default), also Purr while it waits (working-and-waiting), or
nothing (off). Both survive --restart.
Non-blocking delivery requires a call started with --stream or --codex.
Successful delivery produces no notification."#;

Expand Down
26 changes: 26 additions & 0 deletions src-tauri/crates/berd-call/src/host_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ pub(crate) trait HostControl: Send + Sync + 'static {
policy: berd_call::input::InputDuringTtsPolicy,
) -> Result<Value, String>;
fn set_muted(&self, muted: bool) -> Result<Value, String>;
/// Which status sounds the call plays, saved for later calls.
fn set_status_sounds(&self, mode: berd_call::StatusSoundMode) -> Result<Value, String>;
/// Whether the agent is working or waiting for the user, as its host reports it.
fn set_conversation_status(
&self,
status: berd_call::ConversationStatus,
) -> Result<Value, String>;
fn restart(&self, session_arguments: Vec<String>) -> Result<Value, String>;
/// Restarts the call's session with the Spokesperson on or off.
fn set_spokesperson_mode(&self, on: bool) -> Result<Value, String>;
Expand Down Expand Up @@ -152,6 +159,12 @@ pub(crate) enum ControlRequest {
Muted {
muted: bool,
},
StatusSounds {
mode: berd_call::StatusSoundMode,
},
ConversationStatus {
status: berd_call::ConversationStatus,
},
Restart {
#[serde(rename = "sessionArguments")]
session_arguments: Vec<String>,
Expand Down Expand Up @@ -278,6 +291,10 @@ fn handle_connection(mut stream: TcpStream, control: &dyn HostControl) -> Result
ControlRequest::NonBlocking { enabled } => control.set_non_blocking(enabled),
ControlRequest::InputDuringTts { policy } => control.set_input_during_tts(policy),
ControlRequest::Muted { muted } => control.set_muted(muted),
ControlRequest::StatusSounds { mode } => control.set_status_sounds(mode),
ControlRequest::ConversationStatus { status } => {
control.set_conversation_status(status)
}
ControlRequest::Restart { session_arguments } => control.restart(session_arguments),
ControlRequest::SpokespersonMode { on } => control.set_spokesperson_mode(on),
},
Expand Down Expand Up @@ -420,6 +437,15 @@ mod tests {
fn set_muted(&self, muted: bool) -> Result<Value, String> {
Ok(json!({"muted": muted}))
}
fn set_status_sounds(&self, mode: berd_call::StatusSoundMode) -> Result<Value, String> {
Ok(json!({"statusSounds": mode}))
}
fn set_conversation_status(
&self,
status: berd_call::ConversationStatus,
) -> Result<Value, String> {
Ok(json!({"conversationStatus": status}))
}
fn restart(&self, session_arguments: Vec<String>) -> Result<Value, String> {
Ok(json!({"sessionArguments": session_arguments}))
}
Expand Down
Loading
Loading