Expand description
What a session’s transcript says about its mail: the lines its own user typed, and when each message reached the model.
The mailbox records a message as SENT: filed for its session and handed to the session’s door. Only the harness’s transcript records it as DELIVERED: in the model’s context. The two differ whenever the session is busy, since a message handed to a harness mid-turn waits in its queue until the running tool call returns. This module reads the transcript for both halves of that.
A line a person types into a session reaches it through the harness’s own composer, not through supercode, so no envelope is filed for it. Claude Code records each one:
- typed at an idle prompt: a
userentry markedpromptSource: typed; - typed while the session was busy: a
queue-operationenqueue(sent), then either adequeueand auserentry markedpromptSource: queued, or aremove(absorbed_mid_turn) and aqueued_commandattachment from a human (delivered).
file_typed_lines files each as a user envelope in the session’s
mailbox, so it has an id like every other message. A line waiting in the
queue is filed as sent; the queue also holds scheduled prompts and other
sessions’ messages, so a queued line that lands as someone else’s is taken
back out of the mailbox, and one removed from the queue unread is withdrawn. The id is derived from
the session’s address, the moment the line was sent and its words, so it is
the same before and after the line reaches the model, and every reader
derives the same one. A line supercode itself typed into the session’s pane
(a Room member’s or a voice turn) is filed already under its own id.
Mail supercode filed reaches the model as its rendering,
<cross-session-message id="m-…", inside a prompt or a queued-command
attachment; a Room or voice turn reaches it as a typed line with its words.
Codex rollouts do not record who wrote a user message (a typed line and the injected AGENTS.md or environment context look alike), and other harnesses’ records are not read here: their typed lines are not filed and their mail’s delivery is unknown.
Structs§
- Answer
- One answer the session gave its user: a turn’s final message.
- Channel
Line - One line a session received on a channel of its harness’s own: its header
(
[channel: <room> · from: <who> · at: <time> …]) and words. - Transcript
Mail - What one transcript says about a session’s mail.
- Typed
Line - One line the session’s user typed, as its transcript records it.
Enums§
- Delivery
- Where a message stands.
Constants§
- ANSWER_
ID_ PREFIX - Prefix of the id of a session’s answer to its user.
- CHANNEL_
ID_ PREFIX - Prefix of the id of a channel line a harness received on its own channel
(Claude Code’s
[channel: …]prompts, from a Room or another bridge). - MIN_
PREFIX_ DIGITS - Fewest hex digits after the kind (
m-,u-,a-) a prefix may give. - TYPED_
ID_ PREFIX - Prefix of the id of a line a session’s user typed.
Functions§
- answer_
id - The id of the answer the transcript entry
native_idrecords in the session ataddress:a-and 24 hex digits. - channel_
line_ id - The id of the channel line with
headerin the session ataddress. - deliveries
- Where each of
stored(the mailbox of the session ataddress) stands, by id, as the transcript readingmailshows it (None: unreadable). - file_
answers - File every answer the session at
addressgave its user that is not filed yet, in the user’s mailbox underroot, from the session (nameis what the user knows it by). Returns how many were filed now. - file_
typed_ lines - File every line the user of
mailbox’s session typed that is not filed yet, reading the transcript asmail. Returns how many were filed now. - find_
messages - The messages filed on this machine under
rootwhose id isidor starts with it, like git’s short hashes: the mailbox holding each, and the envelope. A prefix shorter than the kind andMIN_PREFIX_DIGITSdigits matches nothing; more than one match means the prefix is ambiguous. - read
- The transcript’s reading of the session at
address, when it can be read. - read_
claude - Read a Claude Code transcript for its typed lines and delivered mail.
- sent_by
- Everything the session at
addresssent that is filed on this machine underroot: its messages to other sessions and its answers to its user, each with the mailbox it is filed in, oldest first. - transcript
- The transcript of the session at
addresson this machine, when its harness’s records are read here. - typed_
line_ id - The id of the line with
textthat the user of the session ataddresssent atsent_at_ms:u-and 24 hex digits. - user_
address - The mailbox of the person who uses the sessions on
machine: where the lines they type come from and where the sessions’ answers go.