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§
- Header
Error - Error surface for header parsing. The registry layer wraps these
into
PluginErrorvariants 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. Exposedpubso 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_depsheader. Returns the resolved dep list as raw lowercase token strings (always including"status"), orHeaderErroron malformed syntax / unknown / reserved dep name.