Skip to main content

Module header

Module header 

Source
Expand description

Parses the optional @data_deps = [...] declaration from the first contiguous block of // line comments at the top of a plugin script. See docs/specs/plugin-api.md §@data_deps header syntax for the full contract.

Resolved dep list is always a superset of ["status"] — every plugin implicitly has access to the stdin payload — even if the author lists other deps explicitly or declares no header at all.

Names are returned as raw lowercase tokens (Vec<String>); the consumer maps them to its own dep enum at registration time. Names reserved from plugins per spec (credentials, jsonl) and any token outside the plugin-accessible set surface as HeaderError::UnknownDep so the consumer doesn’t have to repeat the validation.

Enums§

HeaderError
Error surface for header parsing. The registry layer wraps these into PluginError variants with the plugin id attached.

Constants§

KNOWN_DEPS
Plugin-accessible dep names per docs/specs/plugin-api.md. The header validator rejects any token outside this list; the consumer maps these strings back to its own enum at registration time. Exposed pub so consumer-side drift-detection tests can iterate the same catalog rather than hard-coding a parallel list (a third copy that could itself fall out of sync).

Functions§

parse_data_deps_header
Parse a plugin script’s @data_deps header. Returns the resolved dep list as raw lowercase token strings (always including "status"), or HeaderError on malformed syntax / unknown / reserved dep name.