-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
Toolset filtering in set package is basic. Can't express complex filters like:
- "All file tools except delete"
- "Tools matching regex pattern"
- "Tools with specific annotations"
Proposal
Add expression-based filtering:
type FilterExpr interface {
Matches(tool model.Tool) bool
}
// Built-in expressions
func NameMatches(pattern string) FilterExpr // regex
func HasTag(tag string) FilterExpr
func InNamespace(ns string) FilterExpr
func HasAnnotation(key string) FilterExpr
func IsReadOnly() FilterExpr
func IsDestructive() FilterExpr
// Combinators
func And(exprs ...FilterExpr) FilterExpr
func Or(exprs ...FilterExpr) FilterExpr
func Not(expr FilterExpr) FilterExpr
// Usage
filter := And(
InNamespace("filesystem"),
Not(HasAnnotation("destructive")),
)
toolset := set.NewToolset(tools).Filter(filter)Benefit
- Expressive filtering
- Safer tool exposure
- Annotation-aware filtering
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request