go.bigb.es/claudio

v0.7.0
Doc Versions Source

Types

T type Entry

src
type Entry struct {
	Kind     EntryKind
	Time     time.Time
	Label    string // short summary for the list
	Content  string // full raw text
	SepAfter bool   // render a visual separator after this entry in the list

	// Structured HTTP fields (populated for request/response kinds).
	RequestLine string   // e.g. "POST /v1/messages HTTP/1.1" or "HTTP/2.0 200 OK"
	Headers     []Header // parsed headers
	Body        string   // pretty-printed JSON body (if available), otherwise raw body

	// Structured stream fields (populated for KindStream).
	Stream *StreamData
}

Entry is a single parsed log entry.

f func Parse

src

Parse reads a log file and returns parsed entries.

T type EntryKind

src
type EntryKind int

EntryKind classifies a log entry.

const (
	KindSlog     EntryKind = iota // time=... level=... structured log line (fallback)
	KindInfo                      // level=INFO
	KindWarn                      // level=WARN
	KindError                     // level=ERROR
	KindDebug                     // level=DEBUG
	KindIncoming                  // INCOMING REQUEST from Claude Code
	KindOutgoing                  // OUTGOING REQUEST to upstream API
	KindResponse                  // UPSTREAM RESPONSE
	KindStream                    // STREAM RESPONSE FROM UPSTREAM
)

m func (EntryKind) IsSlog

src
func (k EntryKind) IsSlog() bool

IsSlog returns true for any slog-derived entry kind.

m func (EntryKind) String

src
func (k EntryKind) String() string

T type Model

src
type Model struct {
	// contains filtered or unexported fields
}

Model is the bubbletea model for the log reader TUI.

f func New

src
func New(entries []Entry) Model

New creates a new log reader TUI model.

m func (Model) Init

src
func (m Model) Init() tea.Cmd

m func (Model) Update

src
func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

m func (Model) View

src
func (m Model) View() string

T type StreamData

src
type StreamData struct {
	Model      string
	Thinking   string // reassembled reasoning content
	Content    string // reassembled output content
	Chunks     int
	Usage      *StreamUsage
	StopReason string
}

StreamData holds parsed SSE stream information.

T type StreamUsage

src
type StreamUsage struct {
	PromptTokens     int `json:"prompt_tokens"`
	CompletionTokens int `json:"completion_tokens"`
	TotalTokens      int `json:"total_tokens"`
	CachedTokens     int `json:"cached_tokens,omitempty"`
}

StreamUsage holds token usage from the stream.