// Package options provides shared types and interfaces for options indexers. package options import ( "context" "code.t-juice.club/torjus/labmcp/internal/database" ) // IndexResult contains the results of an indexing operation. type IndexResult struct { Revision *database.Revision OptionCount int FileCount int Duration interface{} // time.Duration - kept as interface to avoid import cycle AlreadyIndexed bool // True if revision was already indexed (skipped) } // Indexer is the interface for options indexers. // Both NixOS and Home Manager indexers implement this interface. type Indexer interface { // IndexRevision indexes a revision by git hash or channel name. // Returns AlreadyIndexed=true if the revision was already indexed. IndexRevision(ctx context.Context, revision string) (*IndexResult, error) // ReindexRevision forces re-indexing of a revision, deleting existing data first. ReindexRevision(ctx context.Context, revision string) (*IndexResult, error) // IndexFiles indexes files from the source repository tarball. IndexFiles(ctx context.Context, revisionID int64, ref string) (int, error) // ResolveRevision resolves a channel name or ref to a git ref. ResolveRevision(revision string) string // GetChannelName returns the channel name if the revision matches one. GetChannelName(revision string) string }