feat(assistant): CLI parity with the bang commands #984

Merged
lytedev merged 1 commit from propose/cli-bang-parity into main 2026-08-12 15:21:28 -05:00
Owner

!done, !settings, !forget, !users, !mute and the !cal family existed only in Matrix. They are CLI verbs now.

The privileged ones ask rather than do. The agent and a person at a terminal reach the daemon over the same socket as the same uid, so nothing separates them — until now the only thing stopping the agent registering its own calendar or making itself an admin was that the protocol had no such verb. cal add|default|rm and allow|deny|promote therefore create an approval and perform nothing, exactly like mail send already does. Both callers ask, because the socket cannot tell which is which.

join/leave deliberately excluded — that logic is inline in the bang handlers and extracting it is a refactor that doesn't belong in a feature PR.

43 unit tests; the new one pins the wire names of every added request.

`!done`, `!settings`, `!forget`, `!users`, `!mute` and the `!cal` family existed only in Matrix. They are CLI verbs now. **The privileged ones ask rather than do.** The agent and a person at a terminal reach the daemon over the same socket as the same uid, so nothing separates them — until now the only thing stopping the agent registering its own calendar or making itself an admin was that the protocol had no such verb. `cal add|default|rm` and `allow|deny|promote` therefore create an approval and perform nothing, exactly like `mail send` already does. Both callers ask, because the socket cannot tell which is which. `join`/`leave` deliberately excluded — that logic is inline in the bang handlers and extracting it is a refactor that doesn't belong in a feature PR. 43 unit tests; the new one pins the wire names of every added request.
feat(assistant): CLI parity with the bang commands
Some checks failed
/ check-format (push) Successful in 10s
/ build (push) Failing after 19m49s
542b5d4ecc
The two interfaces had drifted apart for no reason anyone chose: !done,
!settings, !forget, !users, !mute and the !cal family existed only in
Matrix, so a person at a terminal had to open a chat client to use
them. They are now CLI verbs too.

The privileged ones do NOT simply become CLI verbs, and that is the
whole design of this change.

The agent and a person at a terminal reach the daemon over the same
unix socket as the same uid, so nothing at the OS level tells them
apart. Until now the only thing preventing the agent from registering
its own calendar or adding itself an admin was that the protocol had no
such verb -- an absence doing the work of a control. Adding the verb
would have quietly removed that, which is why this did not just mirror
the command list.

So `cal add|default|rm` and `allow|deny|promote` over the socket create
an APPROVAL and perform nothing, exactly like MailSend already does: the
caller asks, a human accepts in Matrix, and the daemon acts. Both
callers ask, because the socket cannot tell which one is calling. A
person who finds that tedious still has the bang command, where Matrix
has authenticated them and admin rights already apply.

`detail` is JSON rather than prose so the arguments performed are the
ones the human was shown; a caller cannot vary them between asking and
the approval landing. `cal add` probes the URL before asking, so nobody
is handed a question about a calendar that was never reachable, and the
probed `writable` flag travels through the approval rather than being
re-probed later, where it could disagree with what was approved.

The CLI names the user for `settings` where the bang command infers it
from the Matrix sender. The socket has no sender, and a setting applied
silently to the wrong person is worse than one that had to be spelled
out.

Joining and leaving rooms is deliberately NOT included. That logic lives
inline in the bang handlers, and lifting it out is a refactor of shared
code that does not belong in the same change as a feature. It is also
the least useful of the set: you join a room from the room.

Tested: 43 unit tests. The new one pins the wire names of every new
request -- three binaries share this protocol and a deploy upgrades them
at slightly different moments, so a renamed variant is a CLI that fails
against a daemon one commit behind.
lytedev deleted branch propose/cli-bang-parity 2026-08-12 15:21:28 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lytedev/nix!984
No description provided.