Documentation
¶
Overview ¶
Package transcript converts native agent transcripts into the Entire Transcript Format (also called compact or unified transcripts), decodes that format into typed lines (Decode, Parse), and folds transcript records into it (Fold, Folder). The format is specified in README.md. This API is versioned with the CLI and may change; consumers should pin a version.
Index ¶
- Constants
- func Convert(content []byte, opts Options) ([]byte, error)
- func ConvertWithBoundary(content []byte, opts Options) (full []byte, boundary int, err error)
- func Fold(records []Record, opts Options) ([]byte, error)
- func IsInjectedPrompt(text string) bool
- func IsInstructionFileDump(text string) bool
- func OpenCodeSnapshotLines(export []byte) ([][]byte, error)
- func SliceFromLine(content []byte, startLine int) []byte
- func StripIDEContextTags(text string) string
- type Block
- type CallUsage
- type CodexLive
- type Folder
- type JSONLAdapter
- type Line
- type Op
- type OpenCodeAdapter
- type Options
- type PiAdapter
- type Record
- type SkippedLine
- type SkippedLinesError
- type ToolResult
- type ToolResultAgent
- type ToolResultFile
Constants ¶
const ( TypeUser = "user" TypeAssistant = "assistant" )
Message type constants for transcript lines.
const ( ContentTypeText = "text" ContentTypeToolUse = "tool_use" )
Content type constants for content blocks within messages.
const ( BlockText = ContentTypeText BlockToolUse = ContentTypeToolUse BlockImage = "image" )
Block types. Other values pass through verbatim; see Block.Raw.
const ( ToolStatusSuccess = "success" ToolStatusError = "error" )
Tool result statuses.
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
Convert converts a full.jsonl transcript into the condensed transcript.jsonl format. The output format puts version, agent, and cli_version on every line, merges streaming assistant fragments with the same message ID, and inlines tool results into the preceding assistant's tool_use blocks:
{"v":1,"agent":"claude-code","cli_version":"0.42.0","type":"user","ts":"...","content":"..."}
{"v":1,"agent":"claude-code","cli_version":"0.42.0","type":"assistant","ts":"...","id":"msg_xxx","content":[{"type":"text","text":"..."},{"type":"tool_use","id":"...","name":"...","input":{...},"result":{"output":"...","status":"..."}}]}
func ConvertWithBoundary ¶
ConvertWithBoundary compacts the entire transcript — ignoring opts.StartLine for the purpose of truncation — and returns the full compact bytes together with the boundary: the line index in the compact output at which this checkpoint's data (the content from opts.StartLine onward in the raw transcript) begins.
Storing the full compact transcript on every checkpoint makes each checkpoint self-contained: the session is reconstructable from any single surviving checkpoint, and downstream readers segment this checkpoint's slice as fullCompactLines[boundary:]. boundary is 0 when StartLine <= 0 (the first checkpoint of a session, whose data starts at the beginning).
boundary is derived as lineCount(full) - lineCount(delta), where delta is the existing per-checkpoint sliced compaction (Convert with the original StartLine). This reuses each format's existing, independently-tested slicing behavior (line offsets for JSONL/Copilot/Droid/pi/Codex, message-index for OpenCode/Gemini) rather than threading source indices through every emitter.
A single compact line can carry content from both sides of StartLine when its source straddles the boundary — most notably same-ID streaming assistant fragments, which compaction merges into one line. No integer line offset can split within a line, so the boundary rounds toward inclusion: such a merged line is counted as part of this checkpoint's slice. fullCompactLines[boundary:] therefore never drops this checkpoint's content, but its first line may repeat up to one merged line that began in the previous checkpoint. Downstream segmenters must tolerate this bounded head overlap. See the straddle case in TestFullWithBoundary_StraddlingAssistantFragments_RoundsToInclusion.
Likewise, a tool result can arrive after StartLine for a call made before it, even after a later prompt. The full conversion inlines it into that earlier line, which is before the boundary; the delta, which lacks the call, drops it.
func IsInjectedPrompt ¶
IsInjectedPrompt reports whether text is agent-injected rather than user-authored. It is the single source of truth for that question: callers that pick a session title, count user turns, or compact a transcript all use it so the classification cannot drift between them.
func IsInstructionFileDump ¶ added in v0.13.3
IsInstructionFileDump reports whether text is an agent's dump of its instruction files (AGENTS.md), the one kind of injected content that carries text from outside the conversation. Callers that must not store that text blank exactly what this matches.
func OpenCodeSnapshotLines ¶ added in v0.13.2
OpenCodeSnapshotLines splits an OpenCode export, either version, into the snapshot lines OpenCodeAdapter reads: the messages of the normalized export (opencodev2.Normalize), in order, each compacted onto one line with no trailing newline. Feed them each followed by "\n".
A pending revert (the session's info.revert, set by OpenCode's undo) hides the messages from its message on, as OpenCode shows the session: the reverted message and every later one, or, when the revert names a part of that message, its parts from that one on. OpenCode deletes them with the next prompt, or brings them back with redo; Convert keeps them, as the database still holds them, so for such an export the fold of these lines is Convert of the export without them.
func SliceFromLine ¶
SliceFromLine returns the content starting from line number `startLine` (0-indexed). This is used to extract only the checkpoint-specific portion of a cumulative transcript. For example, if startLine is 2, lines 0 and 1 are skipped and the result starts at line 2. Returns empty slice if startLine exceeds the number of lines.
func StripIDEContextTags ¶
StripIDEContextTags removes IDE-injected context tags from prompt text. The VSCode extension injects tags like:
- <ide_opened_file>...</ide_opened_file> - currently open file
- <ide_selection>...</ide_selection> - selected code in editor
Also removes system-injected tags like:
- <local-command-caveat>...</local-command-caveat>
- <system-reminder>...</system-reminder>
- <command-name>...</command-name>
Cursor's <user_query> wrapper is unwrapped (content kept) and its prepended <timestamp> line is removed (content included, leading position only).
These shouldn't appear in commit messages or session descriptions. Not idempotent: the unwrap can expose user content at the start of the message, so callers must apply it exactly once per text.
Types ¶
type Block ¶
type Block struct {
Type string // BlockText, BlockToolUse, BlockImage, or a passthrough type
ID string
Text string
Name string
Input json.RawMessage
Result *ToolResult
Raw json.RawMessage // the block exactly as stored
}
Block is one content block of a Line.
type CallUsage ¶ added in v0.12.2
type CallUsage struct {
Model string `json:"model,omitempty"`
InputTokens int64 `json:"inputTokens,omitempty"`
OutputTokens int64 `json:"outputTokens,omitempty"`
CacheReadTokens int64 `json:"cacheReadTokens,omitempty"`
CacheWriteTokens int64 `json:"cacheWriteTokens,omitempty"`
CacheWrite5mTokens *int64 `json:"cacheWrite5mTokens,omitempty"`
CacheWrite1hTokens *int64 `json:"cacheWrite1hTokens,omitempty"`
ReasoningTokens int64 `json:"reasoningTokens,omitempty"`
}
CallUsage is an authoritative per-call usage snapshot for an assistant message. InputTokens excludes cache reads and writes, and ReasoningTokens is a subset of OutputTokens. A nil cache-write split means unreported; a pointer to zero means reported as zero.
type CodexLive ¶ added in v0.13.0
type CodexLive struct {
Text *string // agent text so far (from deltas); nil: the item's own text
Output *string // command output so far; nil: the item's own output
Interrupted bool // the item's turn ended while it was in progress: show it failed
TS string // fallback time (RFC 3339), used when the item has none
TurnCWD string // the turn's working directory, shown on a file change's result; empty: none
}
CodexLive is what a live stream knows about an item beyond the item itself.
type Folder ¶
type Folder struct {
// contains filtered or unexported fields
}
Folder applies records incrementally. Messages keep the order in which their IDs were first created. The zero value is not usable; call NewFolder.
A Folder keeps every message in memory and has no limits of its own. Applying a record costs time in the record's size, except that the first append or result after a message record splits that record's content into blocks, once. Until an append or a matching result decodes the message, the split blocks are kept beside the raw content. Producing a line costs time in that message's size, and Lines in the size of all messages. Callers folding records from an untrusted source must bound the number and size of records and messages.
func NewFolder ¶
NewFolder returns an empty Folder whose lines carry opts.Agent and opts.CLIVersion; opts.StartLine is ignored.
func (*Folder) Apply ¶
Apply applies records in order and returns the IDs of the messages they touched, each once, in order of first touch. Apply validates every record before changing anything, so on error the Folder is unchanged.
func (*Folder) Line ¶
Line returns the compact line (without a trailing newline) for message id. visible is false when the message is unknown, dropped, or an assistant message whose content is [] or null; such a message has no line in Lines. An assistant message with no content at all is visible and prints "content":null, as Convert always has.
type JSONLAdapter ¶ added in v0.12.1
type JSONLAdapter struct {
// contains filtered or unexported fields
}
JSONLAdapter turns a Claude Code, Cursor or Droid JSONL transcript into transcript records. It is incremental: Feed accepts the transcript in chunks split anywhere, and the records depend only on the bytes fed, not on how they were chunked. Convert uses the same constructors, so folding the records reproduces Convert's output for that agent.
The constructor fixes the behavior. NewClaudeAdapter also emits per-call usage snapshots (model, fresh input, cache and output tokens) by the rules below; NewCursorAdapter and NewDroidAdapter keep the legacy per-message input and output token counts. NewDroidAdapter unwraps Droid's envelope before parsing each line.
The compaction rules live here, as decisions about which message a record targets:
- Consecutive assistant entries with the same message ID are fragments of one message: the first opens it, the rest append to it.
- A tool result in a user entry becomes a result record on the assistant message holding the tool_use with its tool_use_id, wherever the result falls. Claude Code writes the results of parallel tool calls one user entry each, sometimes after the next assistant message began or after text it injected (isMeta). A result without a tool_use_id targets the last assistant message, until a user entry with text or images (whose own results still count). Other results are dropped, as is a user entry that held only such results.
- The text and images of a user entry become a separate user message.
- For Claude Code, the fragment with the strictly highest output tokens supplies the message's usage snapshot (an earlier one wins ties) and the first fragment naming a model supplies its model. User entries holding only tool results between fragments of one message ID do not split the API call: later fragments become continuation messages that carry no usage, and any improved snapshot goes to the call's first visible message in a usage record. A message whose content is empty has no line, so the next fragment takes over the call's usage instead of continuing it.
Fold keys are the agent's message ID where it has one and it is unused, otherwise derived from the source line number (1-based, counting every line fed, including blank and dropped ones). A message ID the agent reuses for a later, non-adjacent message gets "<id>@L<line>" as its key and keeps the agent's ID as SourceID; messages without an ID, including all user messages, get "@L<line>" and no SourceID. Keys are stable only for a transcript fed from its first line, so a stream that resumes must replay from line 1 rather than start a fresh adapter mid-file.
Folding every record from Feed and a final Flush reproduces Convert's output for the same bytes, with Options.StartLine 0 and the Options.Agent that selects this constructor ("claude-code" for NewClaudeAdapter). Records carry no redaction: redact the transcript before feeding it, as checkpoints do.
func NewClaudeAdapter ¶ added in v0.12.1
func NewClaudeAdapter() *JSONLAdapter
NewClaudeAdapter returns an adapter for a Claude Code JSONL transcript.
func NewCursorAdapter ¶ added in v0.12.1
func NewCursorAdapter() *JSONLAdapter
NewCursorAdapter returns an adapter for a Cursor JSONL transcript, which shares Claude Code's line format.
func NewDroidAdapter ¶ added in v0.12.1
func NewDroidAdapter() *JSONLAdapter
NewDroidAdapter returns an adapter for a Factory AI Droid JSONL transcript, unwrapping each line's envelope first.
func (*JSONLAdapter) Feed ¶ added in v0.12.1
func (a *JSONLAdapter) Feed(chunk []byte) []Record
Feed consumes the next chunk of the transcript and returns the records implied by every line it completed. A trailing partial line is held until a later chunk completes it, or until Flush.
func (*JSONLAdapter) Flush ¶ added in v0.12.1
func (a *JSONLAdapter) Flush() []Record
Flush treats a held partial line as complete. Call it only once the transcript is final; while an agent is still writing, a partial line is usually an unfinished write.
func (*JSONLAdapter) Lines ¶ added in v0.12.1
func (a *JSONLAdapter) Lines() int
Lines returns the number of source lines consumed so far: every newline-terminated line fed, including blank and dropped ones, plus a partial line once Flush has consumed it. A held partial line is not counted. Line-derived keys ("@L<n>") use the same numbering.
type Line ¶
type Line struct {
Version int
Type string // TypeUser, TypeAssistant, or a future additive type
Agent string
CLIVersion string
Timestamp string
ID string
Model string
InputTokens int64 // excludes CacheReadTokens and CacheWriteTokens
OutputTokens int64
CacheReadTokens int64
CacheWriteTokens int64
CacheWrite5mTokens *int64 // nil means the split is unknown
CacheWrite1hTokens *int64 // nil means the split is unknown
ReasoningTokens int64
Blocks []Block
}
Line is one decoded line of the Entire Transcript Format.
func Decode ¶
Decode reads Entire Transcript Format bytes into typed lines.
Like go/parser.ParseFile, Decode returns a usable partial result together with the error: every readable line is returned, and if any line was skipped the error is a *SkippedLinesError listing each one. Callers choose their policy:
lines, err := transcript.Decode(b)
// strict: if err != nil { return err }
// tolerant: log err; use lines
A line is skipped when it is not a JSON object, has no "v", has a "v" other than 1, has no "type", or has a known field of the wrong JSON type ("ts" is the exception: a non-string "ts" is ignored). Blank lines are ignored. Unknown fields are ignored, and lines with an unknown "type" are returned as they are.
func Parse ¶
Parse decodes a transcript in any supported format into typed lines.
Input that is already in the Entire Transcript Format is passed to Decode and o is ignored; a caller holding a checkpoint boundary from ConvertWithBoundary slices the result with lines[boundary:]. Any other input is converted with Convert and the result decoded. A Convert error is returned as is.
type Op ¶
type Op string
Op names what a record does to its target message.
const ( // OpMessage creates a message, or replaces the role, timestamp, source ID // and content of a known one and restores it if it was dropped. OpMessage Op = "message" // OpAppend appends content blocks to a message. The record's timestamp // replaces the message's, so an append without one clears it. Content // that is not an array adds no blocks, and appending to a message whose // content is not an array discards that content. OpAppend Op = "append" // OpResult sets the result of a tool_use block in a message. Nothing // changes when the content is not an array, when one of its blocks is not // an object, or when no tool_use block matches. OpResult Op = "result" // OpUsage sets a message's token counts or per-call usage snapshot. OpUsage Op = "usage" // OpDrop hides a message. OpDrop Op = "drop" )
type OpenCodeAdapter ¶ added in v0.13.2
type OpenCodeAdapter struct {
// contains filtered or unexported fields
}
OpenCodeAdapter turns snapshots of an OpenCode session's messages into transcript records as the session changes. OpenCode keeps a session in its database and rewrites a message's rows in place while the message grows, so there is no append-only transcript to follow: a live producer exports the session again whenever it changes and feeds every message's latest snapshot.
A snapshot line is one message as OpenCodeSnapshotLines writes it: the message of a normalized export (opencodev2.Normalize, so OpenCode 1 shape for either version), {"info":{...},"parts":[...]}, on one line. Each message is keyed by its info.id, which is also its SourceID on assistant lines, and sent whole (OpMessage). Feeding a message again sends it again only when its record changed (text grew, a tool's state moved on, its tokens were counted), and the new record replaces the old one in the fold; an unchanged snapshot sends nothing. Drop hides a message the session no longer has (a revert, or a compaction OpenCode applied), and feeding it again restores it where it was first created.
Folding every record from a sequence of snapshots reproduces Convert of the export made of each message's latest snapshot (with Options.StartLine 0), dropped messages left out, provided messages are first fed in the session's order: a message keeps the position at which it was first fed, so a message first fed after a later one stays after it. Feeding every export whole (FeedExport) satisfies that. An assistant message with no text or tool parts is still sent, with content [], which the fold does not show; this keeps its position for when its content arrives.
Lines that are not a JSON object with a non-empty info.id, and messages whose role is neither user nor assistant, are consumed and ignored. Lines have no size limit: a long line is held whole until its newline arrives. Records carry no redaction: redact the snapshots before feeding them.
func NewOpenCodeAdapter ¶ added in v0.13.2
func NewOpenCodeAdapter() *OpenCodeAdapter
NewOpenCodeAdapter returns an adapter for one OpenCode session's snapshots.
func (*OpenCodeAdapter) Drop ¶ added in v0.13.2
func (a *OpenCodeAdapter) Drop(id string) []Record
Drop hides message id: it returns an OpDrop when the message was sent and not dropped since, and nothing otherwise. The next snapshot of the message sends it again, restored at its first position.
func (*OpenCodeAdapter) Feed ¶ added in v0.13.2
func (a *OpenCodeAdapter) Feed(chunk []byte) []Record
Feed consumes the next chunk of snapshot lines and returns the records for every line it completed. A trailing partial line is held until a later chunk completes it, or until Flush.
func (*OpenCodeAdapter) FeedExport ¶ added in v0.13.2
func (a *OpenCodeAdapter) FeedExport(export []byte) ([]Record, error)
FeedExport reads a whole export of the session, either version: it feeds every message's snapshot in order, then drops every message sent before that the export no longer has, in the order they were first sent. Do not call it while a partial line from Feed is held. An export that cannot be read returns an error and changes nothing.
func (*OpenCodeAdapter) Flush ¶ added in v0.13.2
func (a *OpenCodeAdapter) Flush() []Record
Flush treats a held partial line as complete.
func (*OpenCodeAdapter) Lines ¶ added in v0.13.2
func (a *OpenCodeAdapter) Lines() int
Lines returns the number of snapshot lines consumed so far: every newline-terminated line fed, including blank and ignored ones, plus a partial line once Flush has consumed it, plus every message FeedExport read. A held partial line is not counted.
type Options ¶
type Options struct {
// Agent is written to every line, e.g. "claude-code". Claude Code and
// Cursor share a JSONL line format, so for that format Agent also selects
// the accounting: "claude-code" emits per-call usage (model, fresh input,
// cache and output tokens), and any other value converts as Cursor, with
// legacy per-message input and output counts.
Agent string
CLIVersion string // e.g. "0.42.0"
StartLine int // checkpoint_transcript_start (0 = no truncation)
}
Options provides metadata fields written to every output line, and picks the conversion where the transcript's format alone does not.
type PiAdapter ¶ added in v0.13.0
type PiAdapter struct {
// contains filtered or unexported fields
}
PiAdapter turns a Pi session transcript into transcript records as it is written. Feed accepts the transcript in chunks split anywhere, and the records depend only on the bytes fed, not on how they were chunked. Convert uses the same adapter, so after any complete line, folding every record so far reproduces Convert of the bytes so far (with Options.StartLine 0), wherever Convert succeeds: it still fails on a line of 10 MiB or more, which the adapter reads whole.
Pi sessions are trees: every entry has an id and a parentId, and /tree and branching continue from an earlier entry. The conversation is the active branch, the path from the last message entry to the root (pijsonl.ResolveActiveBranch). While no entry has a non-empty parentId there is no tree, and every message is active.
Each message is keyed by its entry ID, which is also its SourceID, and sent whole (OpMessage) with the results of its tool calls spliced in: per tool call ID, the last toolResult entry on the active branch. It is sent again when a result it shows changes (one arrives, or a branch switch leaves it behind), and dropped (OpDrop) when it leaves the active branch. An OpMessage on a dropped key restores it where it was first created, so returning to an earlier branch needs no new keys. An assistant message with no visible content but non-zero usage is sent with no content, which the fold keeps and prints as "content":null, so its usage has a line.
A line that only grows the active branch (the usual case: a message whose parent is the tip, perhaps through entries that are not messages) is read without going over the whole tree, so reading a long session that only grew takes linear time. Any other line reconciles the whole tree, as does every line while there is no tree yet, which Pi (session version 3) has only for its first line or two.
Lines have no size limit: a long line is held whole until its newline arrives, as JSONLAdapter holds one.
Entry IDs are unique in transcripts Pi writes. A repeated ID is re-read as the entry it names, which keeps its first position. Records carry no redaction: redact the transcript before feeding it.
func NewPiAdapter ¶ added in v0.13.0
func NewPiAdapter() *PiAdapter
NewPiAdapter returns an adapter for one Pi transcript, to be fed from its first line.
func (*PiAdapter) Feed ¶ added in v0.13.0
Feed consumes the next chunk of the transcript and returns the records implied by every line it completed. A trailing partial line is held until a later chunk completes it, or until Flush.
type Record ¶
type Record struct {
Op Op `json:"op"`
ID string `json:"id"`
SourceID string `json:"sourceId,omitempty"`
Role string `json:"role,omitempty"`
// TS is the agent's timestamp, passed through verbatim.
TS json.RawMessage `json:"ts,omitempty"`
// Content is a JSON array of compact content blocks. Adapters may pass a
// non-array value through on OpMessage when the agent wrote one.
Content json.RawMessage `json:"content,omitempty"`
// ToolUseID selects the tool_use block an OpResult targets. Empty selects
// the last tool_use block in the message.
ToolUseID string `json:"toolUseId,omitempty"`
Result *ToolResult `json:"result,omitempty"`
// Token counts. A non-zero value replaces the message's previous value.
InputTokens int `json:"inputTokens,omitempty"`
OutputTokens int `json:"outputTokens,omitempty"`
// Usage, when non-nil, replaces the message's whole per-call usage
// snapshot, zeros included. An assistant message with a snapshot ignores
// the token counts above.
Usage *CallUsage `json:"usage,omitempty"`
}
Record is one transcript record. Which fields apply depends on Op; Role is TypeUser or TypeAssistant.
ID is the fold key. It is unique within a session and stable: the same transcript yields the same IDs on every run. SourceID is the agent's own ID for the message and is what the compact line prints as "id"; it is empty when the agent has none. The two differ when the adapter had to derive a key, for example when the agent reuses a message ID for a second, non-adjacent message that compaction keeps separate.
Zero-length TS and Content mean absent, as they do once the record is encoded. JSON null or [] content is present.
When decoding a stream, decode each record into a zero Record: a field the next record omits keeps its old value otherwise, so an append without "ts" would inherit the previous record's timestamp instead of clearing it.
func CodexNotificationRecords ¶ added in v0.13.0
func CodexNotificationRecords(method string, params []byte, live CodexLive) (recs []Record, ok bool)
CodexNotificationRecords maps one Codex app-server item notification (method item/started or item/completed, its params) to records, with the same mapping as Convert's Codex item path. ok is false for anything else, including an item it can't read or one without an ID. An item that isn't shown (reasoning, …) is ok with no records.
type SkippedLine ¶
SkippedLine describes one line Decode could not read.
type SkippedLinesError ¶
type SkippedLinesError struct {
Skipped []SkippedLine
}
SkippedLinesError reports the lines Decode skipped.
func (*SkippedLinesError) Error ¶
func (e *SkippedLinesError) Error() string
type ToolResult ¶
type ToolResult struct {
Output string `json:"output"`
Status string `json:"status"` // ToolStatusSuccess or ToolStatusError
// ExitCode is the exit code of the command the call ran, when the agent
// records one. nil means unknown, never success.
ExitCode *int `json:"exitCode,omitempty"`
// Declined reports that the user declined the call, so it never ran.
// Its Status is ToolStatusError, as before the field existed.
Declined bool `json:"declined,omitempty"`
// CWD is the working directory of the call, as the agent records it:
// for a Codex command its own, for a Codex file change the turn's.
CWD string `json:"cwd,omitempty"`
File *ToolResultFile `json:"file,omitempty"`
MatchCount int `json:"matchCount,omitempty"`
// Agent identifies the subagent this tool call launched, when the agent
// records one in the parent transcript.
Agent *ToolResultAgent `json:"agent,omitempty"`
}
ToolResult is the result inlined into the tool_use block that requested it. Its JSON encoding is the stored "result" object.
func (*ToolResult) UnmarshalJSON ¶ added in v0.12.1
func (r *ToolResult) UnmarshalJSON(b []byte) error
UnmarshalJSON decodes a tool result. An "agent" that is not an object with a non-empty string "id" decodes as absent rather than failing the result, so a malformed one neither drops the block around it nor folds into an empty agent.
type ToolResultAgent ¶ added in v0.12.1
type ToolResultAgent struct {
// ID is the agent's own ID for the child session or thread, never the
// tool call ID (that is the tool_use block's id).
ID string `json:"id"`
}
ToolResultAgent identifies a subagent launched by a tool call.
type ToolResultFile ¶
type ToolResultFile struct {
FilePath string `json:"filePath"`
NumLines int `json:"numLines,omitempty"`
}
ToolResultFile carries file metadata from Read/Edit tool results.