TranscriptTail

works.iterative.claude.ui.transcript.TranscriptTail
See theTranscriptTail companion class

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def read(message: String): Option[TranscriptTail]

Reads that message back, refusing one this contract did not write.

Reads that message back, refusing one this contract did not write.

A message whose markup is empty may arrive with its newline stripped — server-sent events carry the message as lines, and a last line with nothing on it is not a line — so a count on its own is a tail that holds nothing.

Attributes

def written(tail: TranscriptTail): String

The message: the row count on the first line, the markup after it.

The message: the row count on the first line, the markup after it.

Deliberately not JSON. This is the one message on this contract's wire that a browser reads, and reading it must cost the page nothing: measured while deciding, giving the bundle a JSON parser to read two fields took it from 12 750 bytes gzipped to 151 128 — ten times the whole bundle, and more than a whole transcript, to read a number and a string. A line and a remainder cost a indexOf.

The markup carries newlines of its own, which is why the count goes first and everything after the first newline is the markup: there is exactly one place to cut, wherever the rest wraps.

Attributes

Concrete fields

val beatEveryMillis: Long

How often a followed session says something, whether or not anything has changed.

How often a followed session says something, whether or not anything has changed.

A session that only spoke when it grew would leave a page unable to tell a quiet session from a connection it has stopped hearing: both are silence. A connection can go silent while it is still open — a host frozen under the page, a proxy holding a connection nothing crosses — and nothing tells the browser, which reports a break and not a silence. So a host says "nothing changed" often enough that silence means something is wrong. That message is an ordinary tail, keeping every row the page holds and adding none.

Attributes

val silenceLimitMillis: Long

How long a page goes on believing it is following while it hears nothing.

How long a page goes on believing it is following while it hears nothing.

Long enough to survive a beat that is merely late, short enough that a reader is not left trusting a page that has stopped.

Attributes