Pure session history: a working directory, conversations, and immutable entries.
Conversation 1 is the root. Forks reference visible entry cutoffs rather than
copying transcripts. Conversation and entry IDs come from one strictly monotonic
session-local sequence (next_id), which fork prefix traversal relies on
(entry.id <= cutoff). All functions return new values; this module performs no
persistence, process management, model requests, or tool execution.
This is the trusted in-memory core. External data validation and durable command admission belong to the daemon boundary, not these constructors.
Summary
Functions
Appends a raw entry to a conversation's own segment.
Creates another independent conversation in the session.
Returns visible entries oldest first, respecting every ancestor's fork cutoff.
Forks through a concrete entry visible in the source conversation, inclusively.
Creates an empty root conversation. The working directory must be absolute.
Types
Functions
Appends a raw entry to a conversation's own segment.
@spec create_conversation(t()) :: {:ok, t(), H.Conversation.t()}
Creates another independent conversation in the session.
@spec entries(t(), pos_integer()) :: {:ok, [H.Entry.t()]} | {:error, error()}
Returns visible entries oldest first, respecting every ancestor's fork cutoff.
@spec fork(t(), pos_integer(), pos_integer()) :: {:ok, t(), H.Conversation.t()} | {:error, error()}
Forks through a concrete entry visible in the source conversation, inclusively.
Creates an empty root conversation. The working directory must be absolute.