(params: Record<string, unknown>)
| 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. |
| 391 | function parseCommandRpcParams(params: Record<string, unknown>): CommandRpcParams { |
| 392 | try { |
| 393 | return commandRpcParamsSchema.parse(params); |
| 394 | } catch (error) { |
| 395 | const detail = |
| 396 | error instanceof Error ? cleanSchemaParseMessage(error.message) : 'invalid command params'; |
| 397 | throw new AppError('INVALID_ARGS', `Invalid params: ${detail}`); |
| 398 | } |
| 399 | } |
| 400 | |
| 401 | function methodToDaemonRequest( |
| 402 | method: string, |
no test coverage detected