Merge main into the terminal flow-control branch

Conflicts resolved keeping both sides: main's active-client rules, input
lane, reply marking and key input, and this branch's flow control,
acknowledgements, subscriptions and sliced emulator feed. terminal_ack
joins the terminal lane; the feed marks each live slice it writes as
drawing, so the emulator's answers still go to onReply.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-26 00:03:20 +00:00
148 changed files with 18443 additions and 153 deletions
+12 -2
View File
@@ -1315,8 +1315,18 @@ app's terminal panel). Every request carries `terminal_request`
pipelines`), never the operator's tmux. At most 8 running terminals per
machine.
- `terminal_list` replies with `terminals` (running and ended, oldest first).
- `terminal_input {terminal_id, data}` writes UTF-8 input (at most 16 KiB);
`terminal_resize {terminal_id, cols, rows}` resizes. Neither is logged.
- `terminal_input {terminal_id, data, reply?, cols?, rows?}` writes UTF-8
input (at most 16 KiB); `terminal_resize {terminal_id, cols, rows,
activate?}` reports the size a client draws at. Neither is logged. With
several clients on one terminal, the *active* client (the opener, then
whichever most recently typed or sent `activate`, i.e. focused it) owns
the terminal's size, and only its emulator's automatic query answers
(`reply: true`) reach the shell; others' are acknowledged and dropped.
Typed input may carry the sender's `cols`/`rows`, applied first. When the
active connection closes, the next most recent client's size is applied.
`chat_shell_input`/`chat_shell_resize` follow the same rules. Input and
resize requests are handled on a lane of their own per connection, in
order, never behind a slow request read before them.
- `terminal_output {terminal_id, after, flow?}` replies with the retained
output (1 MiB tail) from byte `after` of the stream named `stream`, covering
bytes `[output_start, output_end)`; the output frames that follow the reply