Smith::Tools::RuleSet
Inherits Reference < Object
The configured rules, consulted before anything is shown to the user.
Constructors
build(allow : Array(String) = [] of String, ask : Array(String) = [] of String, deny : Array(String) = [] of String, project_dir : String = Dir.current, warn_io : IO = STDERR) : RuleSet
Sourcenew(allow : Array(Rule) = [] of Rule, ask : Array(Rule) = [] of Rule, deny : Array(Rule) = [] of Rule, project_dir : String = Dir.current)
SourceInstance methods
decide(tool_name : String, args : JSON::Any) : Decision
Sourceempty?
Sourcegoverns?(tool_name : String) : Bool
Whether a call to this tool could be stopped by a rule. Kept to a set lookup so the common case โ no rules for read tools โ costs nothing.
matching_deny(tool_name : String, args : JSON::Any) : String | Nil
Which deny rule stopped a call, so the model is told what to avoid.
project_dir
Sourcesuggest(tool_name : String, args : JSON::Any) : String
The narrowest rule worth offering behind [a]lways โ narrower than "this tool, everywhere", which is what the old prompt remembered.