@barry-rocks/sdk/transcripts
Types for session transcripts: the events, sessions, sources, and scans that tools reading a harness’s conversation history work with.
import { … } from "@barry-rocks/sdk/transcripts";Interfaces
Section titled “Interfaces”TranscriptEvent
Section titled “TranscriptEvent”Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
event |
SessionEvent |
- |
key |
string |
Stable across re-reads — a key derived from read order would make every pass look new. |
TranscriptScan
Section titled “TranscriptScan”Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
entriesParsed |
number |
- |
events |
TranscriptEvent[] |
- |
linesRead |
number |
Both counts, because their ratio is the signal: a thousand lines yielding no entries is a reader that stopped understanding its format. |
TranscriptSession
Section titled “TranscriptSession”Properties
Section titled “Properties”| Property | Type |
|---|---|
cwd? |
string | null |
harnessSessionId? |
string | null |
metadata? |
Record<string, unknown> |
TranscriptSource
Section titled “TranscriptSource”Methods
Section titled “Methods”locate()
Section titled “locate()”locate(
session):Promise<string|null>
null is an ordinary answer: a hosted session has no file, a new one has none yet.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
session |
TranscriptSession |
Returns
Section titled “Returns”Promise<string | null>
read()
Section titled “read()”read(
path,since?):Promise<TranscriptScan>
since is the last key persisted. A reader may skip work with it but need
not: keys make re-reading safe, so correctness never depends on the cursor.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
path |
string |
since? |
string |
Returns
Section titled “Returns”Promise<TranscriptScan>
roots()?
Section titled “roots()?”
optionalroots(session):Promise<readonlystring[]>
Allowed locations for recorded transcript reads. Callers must realpath both root and file. Absence is not unrestricted access: authorization-dependent reads must fail closed.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
session |
TranscriptSession |
Returns
Section titled “Returns”Promise<readonly string[]>