(message: string)
| 379 | // (e.g. `$.positionals: Expected an array`). Strip the `$` sigil so the wire message |
| 380 | // stays user-facing without leaking the schema's internal path representation. |
| 381 | function cleanSchemaParseMessage(message: string): string { |
| 382 | const separator = message.indexOf(': '); |
| 383 | if (separator === -1 || !message.startsWith('$')) return message; |
| 384 | const field = message.slice(0, separator).replace(/^\$\.?/, ''); |
| 385 | const detail = message.slice(separator + 2); |
| 386 | return field ? `${field}: ${detail}` : detail; |
| 387 | } |
| 388 | |
| 389 | // Validate the command params at the boundary so malformed client input is rejected as |
| 390 | // INVALID_ARGS (-> JSON-RPC -32602 / HTTP 400) instead of leaking as an internal 500. |
no test coverage detected
searching dependent graphs…