Skip to content

transcript

transcript

TaskNotification dataclass

TaskNotification(*, tool_use_id: str)

A parsed <task-notification> payload from a queue-operation message.

TextBlock dataclass

TextBlock(*, text: str = '')

A text content block from a transcript message.

ToolResult dataclass

ToolResult(
    *,
    tool_use_id: str,
    content: list[Any] | str = (lambda: [])(),
    is_error: bool = False,
    is_async: bool = False,
)

A tool-result content block linking back to its tool use via tool_use_id.

ToolUse dataclass

ToolUse(
    *,
    name: str,
    raw_input: RawDict = (lambda: {})(),
    id: str,
    result: ToolResult | None = None,
    message_index: int = -1,
)

A tool invocation extracted from the transcript, with typed input parsing, file/command access, and result linkage.

ToolUseBlock dataclass

ToolUseBlock(
    *, name: str, input: RawDict = (lambda: {})(), id: str
)

A tool-use content block from a transcript message, containing the tool name and raw input.

TranscriptMessage dataclass

TranscriptMessage(
    *,
    type: str,
    content: list[ContentBlock],
    raw: RawDict = (lambda: {})(),
)

A single message in a transcript with parsed content blocks, tool-use extraction, and text access.

ToolUseQuery dataclass

ToolUseQuery(items: list[ToolUse])

Chainable query builder for filtering and inspecting transcript tool uses.

Use .where() to filter by name, file, error status, etc., and terminal methods like .count(), .any(), .first(), .last(), .files() to extract results.

ToolUseSequence

ToolUseSequence(
    items: list[ToolUse], *, _include_errors: bool = False
)

Sequence of tool uses that filters out errors by default.

Access .with_errors for an unfiltered view. Use .where(...) to build a ToolUseQuery for chained filtering.

Transcript dataclass

Transcript(
    messages: list[TranscriptMessage],
    path: Path | None = None,
    classifier: Callable[[TranscriptMessage], bool]
    | None = None,
)

The full session transcript: a sequence of messages with tool-use querying, slicing, and history checks.

TranscriptSlice dataclass

TranscriptSlice(
    messages: list[TranscriptMessage],
    path: Path | None = None,
    classifier: Callable[[TranscriptMessage], bool]
    | None = None,
)

Bases: Transcript

A contiguous slice of a Transcript, returned by slicing operations like recent, after, before.

Turn dataclass

Turn(
    messages: list[TranscriptMessage],
    path: Path | None = None,
    classifier: Callable[[TranscriptMessage], bool]
    | None = None,
    start_idx: int = 0,
    user_message: TranscriptMessage | None = None,
)

Bases: TranscriptSlice

The current conversation turn starting from the last user message, with edited-file tracking.