strategies

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package strategies provides detection strategies for different installation methods.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryStrategy

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

BinaryStrategy detects agents by scanning PATH for executables.

func NewBinaryStrategy

func NewBinaryStrategy(p platform.Platform) *BinaryStrategy

NewBinaryStrategy creates a new binary detection strategy.

func (*BinaryStrategy) Detect

func (s *BinaryStrategy) Detect(ctx context.Context, agents []catalog.AgentDef) ([]*agent.Installation, error)

Detect scans for installed agents and returns found installations.

func (*BinaryStrategy) IsApplicable

func (s *BinaryStrategy) IsApplicable(p platform.Platform) bool

IsApplicable returns true if this strategy can run on the given platform.

func (*BinaryStrategy) Method

func (s *BinaryStrategy) Method() agent.InstallMethod

Method returns the install method this strategy detects.

func (*BinaryStrategy) Name

func (s *BinaryStrategy) Name() string

Name returns the strategy name.

type BrewStrategy

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

BrewStrategy detects agents installed via Homebrew.

func NewBrewStrategy

func NewBrewStrategy(p platform.Platform) *BrewStrategy

NewBrewStrategy creates a new Homebrew detection strategy.

func (*BrewStrategy) Detect

func (s *BrewStrategy) Detect(ctx context.Context, agents []catalog.AgentDef) ([]*agent.Installation, error)

Detect scans for brew-installed agents.

func (*BrewStrategy) IsApplicable

func (s *BrewStrategy) IsApplicable(p platform.Platform) bool

IsApplicable returns true if brew is available (macOS/Linux).

func (*BrewStrategy) Method

func (s *BrewStrategy) Method() agent.InstallMethod

Method returns the install method this strategy detects.

func (*BrewStrategy) Name

func (s *BrewStrategy) Name() string

Name returns the strategy name.

type NPMStrategy

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

NPMStrategy detects agents installed via npm.

func NewNPMStrategy

func NewNPMStrategy(p platform.Platform) *NPMStrategy

NewNPMStrategy creates a new NPM detection strategy.

func (*NPMStrategy) Detect

func (s *NPMStrategy) Detect(ctx context.Context, agents []catalog.AgentDef) ([]*agent.Installation, error)

Detect scans for npm-installed agents.

func (*NPMStrategy) IsApplicable

func (s *NPMStrategy) IsApplicable(p platform.Platform) bool

IsApplicable returns true if npm is available.

func (*NPMStrategy) Method

func (s *NPMStrategy) Method() agent.InstallMethod

Method returns the install method this strategy detects.

func (*NPMStrategy) Name

func (s *NPMStrategy) Name() string

Name returns the strategy name.

type PipStrategy

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

PipStrategy detects agents installed via pip, pipx, or uv.

func NewPipStrategy

func NewPipStrategy(p platform.Platform) *PipStrategy

NewPipStrategy creates a new pip detection strategy.

func (*PipStrategy) Detect

func (s *PipStrategy) Detect(ctx context.Context, agents []catalog.AgentDef) ([]*agent.Installation, error)

Detect scans for pip/pipx/uv installed agents.

func (*PipStrategy) IsApplicable

func (s *PipStrategy) IsApplicable(p platform.Platform) bool

IsApplicable returns true if pip, pipx, or uv is available.

func (*PipStrategy) Method

func (s *PipStrategy) Method() agent.InstallMethod

Method returns the install method this strategy detects.

func (*PipStrategy) Name

func (s *PipStrategy) Name() string

Name returns the strategy name.

Jump to

Keyboard shortcuts

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