Documentation
¶
Overview ¶
Package toolperm provides parsing and validation for tool permission syntax as defined in the Agent Skills Specification.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Parser ¶
type Parser struct{}
Parser handles tool permission string parsing.
func (*Parser) Format ¶
func (p *Parser) Format(perms []Permission) string
Format converts a slice of permissions back to space-delimited string.
func (*Parser) Parse ¶
func (p *Parser) Parse(allowedTools string) ([]Permission, error)
Parse parses a space-delimited allowed-tools string into individual permissions. Returns an empty slice for empty input.
func (*Parser) ParseSingle ¶
func (p *Parser) ParseSingle(token string) (Permission, error)
ParseSingle parses a single tool permission token.
type Permission ¶
type Permission struct {
// Name is the tool name (e.g., "Read", "Bash", "Write")
Name string
// Scope is the optional scope specification (e.g., "git:*" from "Bash(git:*)")
// Empty string if no scope is specified.
Scope string
}
Permission represents a parsed tool permission.
func (Permission) String ¶
func (p Permission) String() string
String returns the permission in its canonical string form.
type ToolPermError ¶
type ToolPermError struct {
Token string // The problematic token
Message string // Description of the error
}
ToolPermError represents an error in tool permission syntax.
func (*ToolPermError) Error ¶
func (e *ToolPermError) Error() string
Click to show internal directories.
Click to hide internal directories.