diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-15 01:37:57 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-15 01:37:57 +0300 |
| commit | bfe2f84f4fc8f37517eaadfa3274eb0ff79b47ab (patch) | |
| tree | b97f7700b5e13627d273a83e41eb7f3366b65039 /src/server/protocol.rs | |
| parent | 80d70642b7a86d1d9473ed55586412e0345d015e (diff) | |
feat: add system toast delivery
Diffstat (limited to 'src/server/protocol.rs')
| -rw-r--r-- | src/server/protocol.rs | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/server/protocol.rs b/src/server/protocol.rs index 1a220767..e9b7975e 100644 --- a/src/server/protocol.rs +++ b/src/server/protocol.rs @@ -247,8 +247,10 @@ pub struct TerminalFrame { pub enum NotifyKind { /// Play a sound (bell/agent-done, etc.). Sound, - /// Display a toast message. + /// Display a toast message through the outer terminal. Toast, + /// Display a toast message through the host OS notification service. + SystemToast, } /// Messages sent from the server to the client over the client protocol socket. @@ -754,14 +756,20 @@ mod tests { #[test] fn server_notify_roundtrip() { - let msg = ServerMessage::Notify { - kind: NotifyKind::Sound, - message: "agent done".to_owned(), - }; - let encoded = bincode::serde::encode_to_vec(&msg, bincode::config::standard()).unwrap(); - let (decoded, _): (ServerMessage, _) = - bincode::serde::decode_from_slice(&encoded, bincode::config::standard()).unwrap(); - assert_eq!(msg, decoded); + for kind in [ + NotifyKind::Sound, + NotifyKind::Toast, + NotifyKind::SystemToast, + ] { + let msg = ServerMessage::Notify { + kind, + message: "agent done".to_owned(), + }; + let encoded = bincode::serde::encode_to_vec(&msg, bincode::config::standard()).unwrap(); + let (decoded, _): (ServerMessage, _) = + bincode::serde::decode_from_slice(&encoded, bincode::config::standard()).unwrap(); + assert_eq!(msg, decoded); + } } #[test] |
