reader

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

ABOUTME: Read-only access to agentsview SQLite data for the sync pipeline. ABOUTME: Queries sessions, messages, and tool calls incrementally with explicit column lists.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	SessionID     string
	Ordinal       int
	Role          string
	Content       string
	Timestamp     string
	HasThinking   bool
	HasToolUse    bool
	ContentLength int
}

Message represents an agentsview message record.

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader provides read-only access to an agentsview SQLite database.

func NewReader

func NewReader(dbPath string) (*Reader, error)

NewReader opens the agentsview SQLite database in read-only mode.

func (*Reader) Close

func (r *Reader) Close() error

Close closes the database connection.

func (*Reader) ReadMessagesForSession

func (r *Reader) ReadMessagesForSession(sessionID string) ([]Message, error)

ReadMessagesForSession returns messages for a session ordered by ordinal ASC.

func (*Reader) ReadSessionsSince

func (r *Reader) ReadSessionsSince(createdAfter string) ([]Session, error)

ReadSessionsSince returns sessions with created_at > createdAfter, ordered by created_at ASC. If createdAfter is empty, all sessions are returned.

func (*Reader) ReadToolCallsForSession

func (r *Reader) ReadToolCallsForSession(sessionID string) ([]ToolCall, error)

ReadToolCallsForSession returns tool calls for a session. The returned MessageID is the message ordinal (not the messages table PK).

type Session

type Session struct {
	ID               string
	Project          string
	Machine          string
	Agent            string
	FirstMessage     string
	StartedAt        string
	EndedAt          string
	MessageCount     int
	UserMessageCount int
	FileHash         string
	ParentSessionID  string
	RelationshipType string
	CreatedAt        string
}

Session represents an agentsview session record.

type ToolCall

type ToolCall struct {
	MessageOrdinal      int
	SessionID           string
	ToolName            string
	Category            string
	ToolUseID           string
	InputJSON           string
	SkillName           string
	ResultContentLength int
	ResultContent       string
	SubagentSessionID   string
}

ToolCall represents an agentsview tool call record.

Jump to

Keyboard shortcuts

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