// Copyright (c) 2026 Juhapekka Piiroinen // All Rights Reserved. // AmoosedWeb project: https://amoosed.com #pragma once #include #include #include #include #include #include namespace amoosed { struct Part { std::string url, sha256, codec, nonce; std::size_t offset = 0, length = 0, plain_length = 0; }; struct Resource { std::string path, mime, sha256, access, delivery; std::size_t length = 0; std::vector parts; }; struct AudioPacket { std::size_t length = 0; std::string sha256; }; struct AudioLocation { std::size_t packet = 0, copy = 0; double start_seconds = 0, duration_seconds = 0; }; struct AudioCarrier { std::size_t length = 0; std::string sha256; std::vector packets; std::vector locations; }; struct AudioSetClip { std::vector wav; std::vector locations; }; struct AppIndex { std::string entry, encoding_key, member_key_id; std::vector resources; std::map audio_carriers; }; // Input is the verified AMW document section JSON. This parser checks the // transport schema but does not establish index provenance by itself. bool parse_app_index(std::string_view document_json, AppIndex& output, std::string& error); const Resource* find_resource(const AppIndex& index, std::string_view path); }