Class: SessionLogReader
Defined in: src/session/session_log_reader.ts:16
Constructors
Constructor
new SessionLogReader():
SessionLogReader
Returns
SessionLogReader
Methods
iterateTurns()
staticiterateTurns(filePath):AsyncGenerator<SessionLogTurn,void>
Defined in: src/session/session_log_reader.ts:46
Group entries into turn buckets. A turn starts with a user_message and
ends with the matching final_result. Orphan turns (user_message without
a terminating final_result, e.g. a crash mid-turn) are yielded with a
synthetic final_result so replay still renders what was captured.
Parameters
filePath
string
Returns
AsyncGenerator<SessionLogTurn, void>
readAll()
staticreadAll(filePath):Promise<SessionLogEntry[]>
Defined in: src/session/session_log_reader.ts:23
Read the whole JSONL file and parse each non-empty line. Malformed lines are skipped silently — a partial/aborted write at the tail of the file must not poison the rest of the replay.
Parameters
filePath
string
Returns
Promise<SessionLogEntry[]>
turnGenerator()
staticturnGenerator(turn):AsyncGenerator<AgentRunnerStepResult,AgentRunnerFinalResult>
Defined in: src/session/session_log_reader.ts:96
Reconstruct a live-shaped async generator for a single turn. Yields each step result then returns the final result — same shape as AgentRunner.runOneShotAsyncGenerator so the same consumer code works.
Parameters
turn
Returns
AsyncGenerator<AgentRunnerStepResult, AgentRunnerFinalResult>