//! Envelope-only round trips. No bus, no handler — proves a Python ADK
//! payload deserialises into our types cleanly.

use klieo_a2a::{JsonRpcRequest, SendMessageParams};
use serde_json::json;

#[test]
fn python_adk_send_message_payload_decodes() {
    // Captured from a real adk-python SendMessage call (manually
    // verified against the spec).
    let payload = json!({
        "jsonrpc": "2.0",
        "id": "rpc-1",
        "method": "SendMessage",
        "params": {
            "message": {
                "messageId": "msg-py-1",
                "contextId": "ctx-py-1",
                "role": "user",
                "parts": [
                    {"type": "text", "content": "Summarise this please"}
                ],
                "extensions": []
            }
        }
    });
    let req: JsonRpcRequest = serde_json::from_value(payload).unwrap();
    assert_eq!(req.method, "SendMessage");
    let params: SendMessageParams = serde_json::from_value(req.params).unwrap();
    assert_eq!(params.message.messageId, "msg-py-1");
}
