(body: unknown)
| 76 | }; |
| 77 | |
| 78 | const detectFromBody = (body: unknown): boolean => { |
| 79 | if (typeof body === "string") { |
| 80 | const parsed = parseJsonSafe(body); |
| 81 | return parsed !== undefined && detectFromStructured(parsed, 0); |
| 82 | } |
| 83 | return detectFromStructured(body, 0); |
| 84 | }; |
| 85 | |
| 86 | /** Strict detection over a text fragment whose JSON body survives only as a |
| 87 | * suffix of a transport error message (the MCP SDK embeds the failed POST's |
no test coverage detected