(value any)
| 251 | } |
| 252 | |
| 253 | func redactToolJSONValue(value any) any { |
| 254 | switch typed := value.(type) { |
| 255 | case map[string]any: |
| 256 | for key, item := range typed { |
| 257 | if sensitiveToolFieldName(key) { |
| 258 | typed[key] = "[REDACTED]" |
| 259 | continue |
| 260 | } |
| 261 | typed[key] = redactToolJSONValue(item) |
| 262 | } |
| 263 | return typed |
| 264 | case []any: |
| 265 | for i, item := range typed { |
| 266 | typed[i] = redactToolJSONValue(item) |
| 267 | } |
| 268 | return typed |
| 269 | case string: |
| 270 | return redactToolDiagnostic(typed) |
| 271 | default: |
| 272 | return typed |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | func redactToolMetadata(metadata map[string]json.RawMessage) map[string]json.RawMessage { |
| 277 | if len(metadata) == 0 { |
no test coverage detected