os.shell.tools.TextFamily is the framework boundary that runs the external textgrammar command. Its output is a versioned packet containing selections and node annotations. wsh-text-family-ls owns only the next step: validating that packet and exposing lower-case LiveScript values. It does not invoke processes, inspect the filesystem, discover grammars, assign syntax roles, choose a theme, or render HTML.
The lowering step checks the packet version, selections, span offsets, annotation selection indexes, and span indexes before returning values. Separate helpers resolve annotations or all selection spans. Each fallible operation follows the try-result contract and returns a namespaced error with its cause, so a caller decides whether to stop, add context, or present a recoverable highlighter message.
{ try-lower-packet, try-get-annotation-spans } = dependency 'textfamily.Packet'
{ value: packet, error } = try-lower-packet packet-json
throw error if error isnt void
{ value: spans, error } = try-get-annotation-spans packet, packet.annotations[0]
throw error if error isnt voidThis is the separation that makes the integration reusable: the framework owns generic process execution and error handling; the packet project owns the TextFamily JSON contract; the grammar composer owns PEG profiles and role maps; and the consuming feature decides what to do with the resulting intervals. No layer has to duplicate the responsibilities of another.
