(allow, deny map[string]struct{}, readOnlyOnly, enabledOnly bool)
| 102 | } |
| 103 | |
| 104 | func (r *ToolRegistry) FilteredCopy(allow, deny map[string]struct{}, readOnlyOnly, enabledOnly bool) *ToolRegistry { |
| 105 | filtered := NewToolRegistry() |
| 106 | for _, tool := range r.ListTools() { |
| 107 | if enabledOnly && !tool.IsEnabled() { |
| 108 | continue |
| 109 | } |
| 110 | if allow != nil { |
| 111 | if _, ok := allow[tool.Name()]; !ok { |
| 112 | continue |
| 113 | } |
| 114 | } |
| 115 | if _, ok := deny[tool.Name()]; ok { |
| 116 | continue |
| 117 | } |
| 118 | if readOnlyOnly && !tool.IsReadOnly(nil) { |
| 119 | continue |
| 120 | } |
| 121 | filtered.Register(tool) |
| 122 | } |
| 123 | return filtered |
| 124 | } |
| 125 | |
| 126 | func (r *ToolRegistry) GetDeferredTools() map[string]Tool { |
| 127 | return r.deferred.GetAll() |
no test coverage detected