| 59 | } |
| 60 | |
| 61 | void printStreamRaw(const char* messageType, const fl::json& data) { |
| 62 | // Build pure JSONL message: RESULT: {"type":"...", ...data} |
| 63 | fl::json output = fl::json::object(); |
| 64 | output.set("type", messageType); |
| 65 | |
| 66 | // Copy all fields from data into output |
| 67 | if (data.is_object()) { |
| 68 | auto keys = data.keys(); |
| 69 | for (fl::size i = 0; i < keys.size(); i++) { |
| 70 | output.set(keys[i].c_str(), data[keys[i]]); |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | // Use fl:: serial transport for consistent formatting |
| 75 | fl::string formatted = fl::formatJsonResponse(output, "RESULT: "); |
| 76 | fl::println(formatted.c_str()); |
| 77 | } |
| 78 | |
| 79 | // ============================================================================ |
| 80 | // Standard JSON-RPC Response Format (Phase 4 Refactoring) |