YLSpec Kotlin extensions

Copyright 2026 Cavanşir Qurbanzadə. Apache-2.0.

FunctionContract
ylspecDocument(data, profile, profileVersion, limits)Construct a mutable metadata envelope
Document.toYLSpec()Serialize using JNI and the C core
Document.toFrame()Encode the standard embedding frame
Document.validateYLSpec()Approve the core.data profile and supported capabilities
String.parseYLSpec(limits)Parse text without implicit profile approval
ByteArray.parseYLSpecFrame(offset, limits)Decode at the supplied byte offset

Integers use Long. TemporalValue preserves exact temporal text. Exceptions from C expose a symbolic code and payload-relative source position. Native memory is released before returning, and no caller-managed native handle is retained.