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:
Michel de Graaf
2026-08-28 13:22:50 +00:00
parent b505718db9
commit a91d35b672
13 changed files with 322 additions and 11 deletions
+19
View File
@@ -383,6 +383,25 @@ impl Record for RoomMemberRecord {
}
}
/// One user this session is watching, with whatever the server has already
/// said about them. The status is `None` until the watch reply lands.
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
pub struct WatchedUserRecord {
pub user: String,
/// `online`, `away`, or `offline`.
pub status: Option<String>,
}
impl Record for WatchedUserRecord {
fn text(&self) -> String {
format!(
"{}\t{}",
sanitize(&self.user),
self.status.clone().unwrap_or_else(|| "-".to_string())
)
}
}
/// One configured share folder.
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
pub struct ShareRecord {