Resource.forVersion

Return a copy of this Resource with any fields newer than the negotiated protocol version stripped, so the wire output stays valid for the peer's version. The 2024-11-05 Resource type carried only uri/name/description/mimeType/annotations/_meta. Later fields are version-gated: BaseMetadata.title and Resource.size were introduced by 2025-06-18 / 2025-03-26 respectively (both absent from 2024-11-05), and Resource.icons by 2025-11-25 (absent from every earlier version, present in draft which is >= 2025-11-25). Annotation sub-fields are themselves version-gated: audience/priority existed in 2024-11-05 but Annotations.lastModified was introduced in 2025-06-18, so annotations are projected via Annotations.forVersion. Mirrors Tool.forVersion / Prompt.forVersion.

struct Resource
const @safe
forVersion