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
+7
View File
@@ -133,6 +133,13 @@ wishlist later rather than repeating the same search.
be `null` when the server has not answered that half — `null` means unknown,
not offline.
**`watch add <user>`** / **`watch remove <user>`** — prints nothing; exit 0 is
the confirmation. **`watch list`** — one object per watched user: `user`,
`status`. A watch lasts only as long as the session holding it, so these are
worth using against a running daemon (`--daemon`), where the connection stays
up and keeps receiving the server's status pushes. A one-shot run's watch ends
with the run.
**`whoami`** — one object: `user`, `server`, `listening`, `listen_port`,
`shared_folders`, `shared_files`, `download_dir`, `privilege_seconds`. The
cheapest way to prove the credentials and connection work.