Parse a Responses request body — the user's prompt (the LAST input item
with role:"user", joining its content[].text), the requested model, and
the declared function-tool names. Tolerates malformed JSON (returns an empty
prompt). Pure and exported so request capture is testable without the server.
Parse a Responses request body — the user's prompt (the LAST
inputitem withrole:"user", joining itscontent[].text), the requestedmodel, and the declared function-tool names. Tolerates malformed JSON (returns an empty prompt). Pure and exported so request capture is testable without the server.