engine

package
v1.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

Engine handles agent queries with caching and advanced search capabilities

func NewEngine

func NewEngine(indexPath, cachePath string) (*Engine, error)

NewEngine creates a new query engine with the specified index and cache paths

func (*Engine) ClearCache

func (e *Engine) ClearCache() error

ClearCache clears the query cache

func (*Engine) GetAllAgents

func (e *Engine) GetAllAgents() []*parser.AgentSpec

GetAllAgents returns all agents in the index

func (*Engine) GetCacheStats

func (e *Engine) GetCacheStats() map[string]interface{}

GetCacheStats returns cache performance statistics

func (*Engine) GetStats

func (e *Engine) GetStats() map[string]interface{}

GetStats returns statistics about the indexed agents

func (*Engine) Query

func (e *Engine) Query(query string, opts QueryOptions) ([]*parser.AgentSpec, error)

Query searches for agents using the provided query string and options

func (*Engine) QueryByField

func (e *Engine) QueryByField(field, value string) ([]*parser.AgentSpec, error)

QueryByField searches specific fields with the provided value

func (*Engine) QueryWithFuzzy

func (e *Engine) QueryWithFuzzy(query string, opts QueryOptions) ([]*parser.AgentSpec, error)

QueryWithFuzzy searches for agents using enhanced multi-field fuzzy matching

func (*Engine) RebuildIndex

func (e *Engine) RebuildIndex(dir string) error

RebuildIndex rebuilds the search index from the specified directory

func (*Engine) RebuildWithAgents

func (e *Engine) RebuildWithAgents(agents []*parser.AgentSpec) error

RebuildWithAgents rebuilds the index with a provided list of agents

func (*Engine) SaveCache

func (e *Engine) SaveCache() error

SaveCache saves the cache to disk

func (*Engine) SetFuzzyThreshold

func (e *Engine) SetFuzzyThreshold(threshold float64)

SetFuzzyThreshold adjusts the fuzzy matching threshold

func (*Engine) ShowAgent

func (e *Engine) ShowAgent(filename string) (*parser.AgentSpec, error)

ShowAgent retrieves an agent by filename with fuzzy matching fallback

func (*Engine) ShowCacheStats

func (e *Engine) ShowCacheStats() error

ShowCacheStats displays cache statistics

func (*Engine) UpdateIndex

func (e *Engine) UpdateIndex(dir string) error

UpdateIndex updates the index with new or modified agents

type QueryOptions

type QueryOptions struct {
	Limit       int             // Maximum number of results to return
	NoTools     bool            // Find agents with inherited tools only
	CustomTools bool            // Find agents with explicit tools only
	Regex       bool            // Use regex pattern matching
	Source      string          // Filter by installation source
	After       time.Time       // Filter agents installed after this time
	Context     context.Context // For cancellation and timeouts
}

QueryOptions provides filtering and configuration options for queries

Jump to

Keyboard shortcuts

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