ZioConversationArchive

works.iterative.claude.zio.log.ZioConversationArchive
See theZioConversationArchive companion object
class ZioConversationArchive extends ConversationArchive[[A] =>> IO[ArchiveError, A]]

Attributes

Companion
object
Graph
Supertypes
trait ConversationArchive[[A] =>> IO[ArchiveError, A]]
class Object
trait Matchable
class Any

Members list

Type members

Types

type EntryStream = ZStream[Any, ArchiveError, ConversationLogEntry]

Value members

Concrete methods

def entries(sessionId: SessionId): EntryStream

Streams the main-thread entries of a session. Resolves vendor-then-mirror like forSession.

Streams the main-thread entries of a session. Resolves vendor-then-mirror like forSession.

Attributes

def entriesBefore(token: PageToken, limit: Int): IO[ArchiveError, EntryPage]

Reads the page of up to limit entries immediately older than token.

Reads the page of up to limit entries immediately older than token.

The token is pinned to the transcript it was minted against; if the session now resolves to a different file (the vendor tree was pruned between pages), this fails with ArchiveError.PageSourceMoved rather than reading a stale offset against the wrong file. If the session no longer resolves under either root at all, this fails with ArchiveError.SessionNotFound.

Attributes

def forSession(sessionId: SessionId): IO[ArchiveError, Option[SessionRecord]]

Locates a session by encoding the configured cwd, resolving the live vendor tree first and falling back to the archive mirror; None when no main transcript exists under either root. The returned record's root names which one won.

Locates a session by encoding the configured cwd, resolving the live vendor tree first and falling back to the archive mirror; None when no main transcript exists under either root. The returned record's root names which one won.

Attributes

def lastEntries(sessionId: SessionId, limit: Int): IO[ArchiveError, EntryPage]

Reads the last limit main-thread entries of a session without parsing the transcript from the start. Entries within the returned page are oldest-first; the page itself is the newest slice of the transcript. The page's older cursor pages backward through earlier, older pages. Resolves vendor-then-mirror like forSession, so a pruned session still tails from the mirror.

Reads the last limit main-thread entries of a session without parsing the transcript from the start. Entries within the returned page are oldest-first; the page itself is the newest slice of the transcript. The page's older cursor pages backward through earlier, older pages. Resolves vendor-then-mirror like forSession, so a pruned session still tails from the mirror.

Attributes

def mirror(sessionId: SessionId): IO[ArchiveError, MirrorReport]

Idempotently mirrors the whole session tree into the archive directory, reporting what was copied, extended, refreshed, and skipped.

Idempotently mirrors the whole session tree into the archive directory, reporting what was copied, extended, refreshed, and skipped.

Custody is one-directional: when the session resolves under works.iterative.claude.core.log.model.RecordRoot.Archive (the vendor tree is already pruned), this is a no-op returning works.iterative.claude.core.log.model.MirrorReport.empty — the archive is never truncated or recopied from nothing. Only a Vendor-resolved record is ever a mirror source. SessionNotFound is raised only when neither root holds the session.

Attributes

def subagentEntries(sessionId: SessionId, parentToolUseId: String): EntryStream

Streams a sub-agent's own sidechain entries, joined to its parent by the tool_use id recorded in the sub-agent's .meta.json. Resolves vendor-then-mirror like forSession.

Streams a sub-agent's own sidechain entries, joined to its parent by the tool_use id recorded in the sub-agent's .meta.json. Resolves vendor-then-mirror like forSession.

Attributes