Skip to main content

Module mail_transcript

Module mail_transcript 

Source
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 user entry marked promptSource: typed;
  • typed while the session was busy: a queue-operation enqueue (sent), then either a dequeue and a user entry marked promptSource: queued, or a remove (absorbed_mid_turn) and a queued_command attachment 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.
ChannelLine
One line a session received on a channel of its harness’s own: its header ([channel: <room> · from: <who> · at: <time> …]) and words.
TranscriptMail
What one transcript says about a session’s mail.
TypedLine
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_id records in the session at address: a- and 24 hex digits.
channel_line_id
The id of the channel line with header in the session at address.
deliveries
Where each of stored (the mailbox of the session at address) stands, by id, as the transcript reading mail shows it (None: unreadable).
file_answers
File every answer the session at address gave its user that is not filed yet, in the user’s mailbox under root, from the session (name is 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 as mail. Returns how many were filed now.
find_messages
The messages filed on this machine under root whose id is id or starts with it, like git’s short hashes: the mailbox holding each, and the envelope. A prefix shorter than the kind and MIN_PREFIX_DIGITS digits 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 address sent that is filed on this machine under root: 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 address on this machine, when its harness’s records are read here.
typed_line_id
The id of the line with text that the user of the session at address sent at sent_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.