search

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package search provides full-text search over local session transcripts. It is read-only and agent-agnostic: it extracts the human-readable string values from each JSONL line (skipping keys and obvious binary/base64 blobs) and matches a literal or regular-expression query against them. It backs both `cct search` and `export --match`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SessionMatches

func SessionMatches(path string, q Query) (bool, error)

SessionMatches reports whether a single session file matches (used by export --match, where only a yes/no is needed).

Types

type Match

type Match struct {
	Session sessions.Session
	Hits    int
	Snippet string
}

Match is one session that matched, with a hit count and a short snippet.

func Search(list []sessions.Session, q Query) ([]Match, error)

Search runs the query against every session and returns the matches, sorted by hit count (desc) then most-recent. Unreadable sessions are skipped silently.

type Query

type Query struct {
	Text          string
	Regex         bool
	CaseSensitive bool
}

Query describes what to look for.

Jump to

Keyboard shortcuts

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