Documentation
¶
Overview ¶
Package export provides the shared JSONL conversation-export primitive: one turn's structured record plus a session-level JSONL writer. It is used by the `tapes checkout` CLI command and by the tapes API's session-export HTTP endpoints, so both surfaces render the exact same grain from the same code path.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SessionJSONL ¶
func SessionJSONL(ctx context.Context, query skill.Querier, sessionID string, w io.Writer, opts ...skill.TranscriptOption) error
SessionJSONL writes one JSON object per non-synthetic turn in the session to w. The response is the rendered spine transcript for the turn (assistant + tool lines, prompt excluded since it has its own field). This is the generalized body of the CLI's former exportJSONL, widened from *strings.Builder to io.Writer so it can be reused for streaming HTTP responses.
Types ¶
type Turn ¶
type Turn struct {
TraceID string `json:"trace_id"`
SessionID string `json:"session_id"`
UserPrompt string `json:"user_prompt,omitempty"`
Response string `json:"response,omitempty"`
StartedAt string `json:"started_at,omitempty"`
TotalInputTokens int64 `json:"total_input_tokens"`
TotalOutputTokens int64 `json:"total_output_tokens"`
MainInputTokens int64 `json:"main_input_tokens"`
MainOutputTokens int64 `json:"main_output_tokens"`
}
Turn is one turn's structured (jsonl) export record.