mode

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultName = "default"

Variables

This section is empty.

Functions

func IsReserved

func IsReserved(name string) bool

func NormalizeRelativeRuntimePath

func NormalizeRelativeRuntimePath(input string) (string, error)

func NormalizeRelativeSelectorPath

func NormalizeRelativeSelectorPath(input string) (string, error)

func ValidateName

func ValidateName(name string) (string, error)

Types

type Base

type Base string
const (
	BaseAll  Base = "all"
	BaseNone Base = "none"
)

func (*Base) UnmarshalText

func (base *Base) UnmarshalText(text []byte) error

type Definition

type Definition struct {
	Base    Base     `toml:"base,omitempty"`
	Enable  []string `toml:"enable,omitempty"`
	Disable []string `toml:"disable,omitempty"`
}

func ImplicitDefault

func ImplicitDefault() Definition

func (*Definition) ApplyDefaults

func (definition *Definition) ApplyDefaults()

func (*Definition) SortAndDeduplicate

func (definition *Definition) SortAndDeduplicate()

type Effective

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

func ImplicitEffective

func ImplicitEffective() Effective

func NewEffective

func NewEffective(name string, definition Definition, validator SelectorValidator) (Effective, error)

func (Effective) AllowsDotAgentsPath

func (mode Effective) AllowsDotAgentsPath(relativePath string) (bool, error)

func (Effective) AllowsMCP

func (mode Effective) AllowsMCP(name string) bool

func (Effective) AllowsPackagePath

func (mode Effective) AllowsPackagePath(module, relativePath string) (bool, error)

func (Effective) Base

func (mode Effective) Base() Base

func (Effective) Definition

func (mode Effective) Definition() Definition

func (Effective) FingerprintMaterial

func (mode Effective) FingerprintMaterial() string

func (Effective) Name

func (mode Effective) Name() string

type MatchSpecificity

type MatchSpecificity uint16

type Selector

type Selector struct {
	Kind         SelectorKind
	Module       string
	RelativePath string
	MCPName      string
}

func ParseSelector

func ParseSelector(raw string) (Selector, error)

func (Selector) CanonicalString

func (selector Selector) CanonicalString() string

func (Selector) MatchesDotAgentsPath

func (selector Selector) MatchesDotAgentsPath(relativePath string) (MatchSpecificity, bool, error)

func (Selector) MatchesMCP

func (selector Selector) MatchesMCP(name string) bool

func (Selector) MatchesPackagePath

func (selector Selector) MatchesPackagePath(module, relativePath string) (MatchSpecificity, bool, error)

type SelectorKind

type SelectorKind uint8
const (
	SelectorPackage SelectorKind = iota + 1
	SelectorPackagePath
	SelectorMCP
	SelectorDotAgents
)

type SelectorValidator

type SelectorValidator interface{ ValidateSelector(Selector) error }

Jump to

Keyboard shortcuts

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