feat(daemon): expose watching over the RPC surface and the CLI
The watch subscription was reachable only from the library. It is most useful against a daemon -- that is the session that stays connected long enough to receive the server's status pushes -- so it needs the wire. - proto: user.watch / user.unwatch / user.watched, with a Watched response - SessionApi gains watch_user / unwatch_user / watched_users, so a local and a remote session are still interchangeable above the seam - CLI: `watch add`, `watch remove`, `watch list`, documented in SKILL.md including the caveat that a one-shot run's watch ends with the run - docs/openrpc.json regenerated from the wire types
This commit is contained in:
@@ -207,6 +207,10 @@ pub enum Commands {
|
||||
/// What the server knows about another user
|
||||
User(UserArgs),
|
||||
|
||||
/// Keep a daemon updated about users you care about
|
||||
#[command(subcommand)]
|
||||
Watch(WatchCommand),
|
||||
|
||||
/// Confirm the credentials and connection work
|
||||
Whoami,
|
||||
|
||||
@@ -571,6 +575,26 @@ pub struct WishRunArgs {
|
||||
pub sort: SortKey,
|
||||
}
|
||||
|
||||
/// Watching only lasts as long as the session doing it, so these are aimed at
|
||||
/// a running daemon: it stays connected and keeps receiving the status pushes.
|
||||
#[derive(Subcommand, Debug)]
|
||||
pub enum WatchCommand {
|
||||
/// Start watching a user
|
||||
Add {
|
||||
/// The user to watch
|
||||
user: String,
|
||||
},
|
||||
|
||||
/// Stop watching a user
|
||||
Remove {
|
||||
/// The user to stop watching
|
||||
user: String,
|
||||
},
|
||||
|
||||
/// List the users being watched
|
||||
List,
|
||||
}
|
||||
|
||||
#[derive(Subcommand, Debug)]
|
||||
pub enum RoomCommand {
|
||||
/// List public rooms and their user counts
|
||||
|
||||
Reference in New Issue
Block a user