sessionindex

package
v0.3.15 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hit

type Hit struct {
	SessionID string
	Seq       int64
	Role      string
	Snippet   string
}

Hit is one FTS match in a session transcript.

type MessageRow added in v0.3.14

type MessageRow struct {
	Seq  int64
	Role string
	Text string
}

MessageRow is one indexed transcript line for scroll / browse.

type Service

type Service interface {
	// SyncSessions ingests or refreshes index entries from a sessions directory.
	SyncSessions(ctx context.Context, sessionsDir string) error
	// Search runs FTS over indexed messages for the current workspace database.
	Search(ctx context.Context, query string, limit int) ([]Hit, error)
	// ListSessions returns recently active sessions (by last indexed seq, then file mtime).
	ListSessions(ctx context.Context, limit int) ([]SessionSummary, error)
	// ScrollMessages returns messages around anchorSeq in one session (before/after counts).
	ScrollMessages(ctx context.Context, sessionID string, anchorSeq int64, before, after int) ([]MessageRow, error)
}

Service indexes durable session JSONL logs and supports full-text search per tenant workspace.

type SessionSummary added in v0.3.14

type SessionSummary struct {
	SessionID    string
	MessageCount int
	LastSeq      int64
	// LastMod is the session JSONL mtime at last index sync (append activity).
	LastMod time.Time
}

SessionSummary is a indexed session row for discovery / browse.

Jump to

Keyboard shortcuts

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