errorResult builds a ToolResponse from an ExecuteResult with an error message.
(msg string)
| 354 | // errorResult builds a ToolResponse from an ExecuteResult with |
| 355 | // an error message. |
| 356 | func errorResult(msg string) fantasy.ToolResponse { |
| 357 | data, err := json.Marshal(ExecuteResult{ |
| 358 | Success: false, |
| 359 | Error: msg, |
| 360 | }) |
| 361 | if err != nil { |
| 362 | return fantasy.NewTextErrorResponse(msg) |
| 363 | } |
| 364 | return fantasy.NewTextResponse(string(data)) |
| 365 | } |
| 366 | |
| 367 | // detectFileDump checks whether the command matches a file-dump |
| 368 | // pattern and returns an advisory note, or empty string if no |
no test coverage detected