Help us shape the future of Go! Take the 2026 Go Developer Survey

sessionindex

package
v0.4.45 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 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 the sessions source
	// configured on the implementation (tenant-scoped via ctx).
	SyncSessions(ctx context.Context) 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, most recently active first.
	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 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
	// Current marks the session the caller is running in, when known.
	Current bool
}

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