jsonl

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractRange

func ExtractRange(jsonlPath string, afterID string, upToToolUseID string) ([]json.RawMessage, error)

ExtractRange reads messages from JSONL between (afterID, upToToolUseID] Returns messages in chronological order If afterID is empty, starts from beginning If afterID is not found (e.g., after /compact), starts from beginning with warning

func MessageID

func MessageID(msg json.RawMessage) string

MessageID extracts the ID from a message (handles different formats)

Types

type ClaudeAPIMsg added in v0.2.0

type ClaudeAPIMsg struct {
	Role    string          `json:"role"`
	Content json.RawMessage `json:"content"` // Can be string or array of content blocks
}

ClaudeAPIMsg represents the nested Claude API message in Claude Code format

type Message

type Message struct {
	UUID      string          `json:"uuid,omitempty"` // Claude Code message ID
	ID        string          `json:"id,omitempty"`   // Deprecated, kept for compatibility
	Type      string          `json:"type"`
	Message   ClaudeAPIMsg    `json:"message,omitempty"` // Nested Claude API message
	Content   json.RawMessage `json:"content"`           // Varies by type
	ToolUseID string          `json:"tool_use_id,omitempty"`
}

Message represents a Claude Code transcript message envelope

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL