chat: huginn chat window, a cited event id with its neighbours from the chat index

sources::window resolves an event id to its chunk, then walks chunks of the
same room both ways (5 per read, at most 6 reads a side), dedupes by event id
and cuts to before/after with more_before/more_after. An id the index lacks is
a typed SelectionInvalid on event_id naming the three reasons; an id in two
chunks is an index fault. No embedder, no Synapse. ChatFilter gains event_id
and chunk-start bounds, chat_scroll gains an order, the wire gains ChatWindow
request/response, the CLI gains `huginn chat window`.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Eureka 2026-11-11 19:28:43 +00:00
commit 955b93969c
16 changed files with 602 additions and 29 deletions

View file

@ -163,3 +163,9 @@ trimmed start, not by the stored chunk start, and a long chunk trimmed to a span
that crosses rooms can be listed again by the continuation `--after`. Behaviour
is deliberately unchanged here; the event-id window in cut chat-window replaces
the time cursor.
`huginn chat window <EVENT_ID> [--before N] [--after N]` (cut chat-window) reads
the cited message and its neighbours in the same room from this index, no
embedder and no Synapse; an id the index lacks is refused naming `event_id`.
The listing limit above is not changed by it: the cut spec does not assign that
fix, so it stays open.