pub struct DescribePayload<'a> {Show 13 fields
pub describe_schema_version: u32,
pub moss_html_version: u32,
pub moss_binary_version: &'static str,
pub tokens: BTreeMap<&'a str, Vec<TokenJson<'a>>>,
pub components: Vec<ComponentJson>,
pub custom_properties: Vec<CustomPropJson>,
pub scope_attributes: Vec<ScopeAttrJson>,
pub frontmatter: Vec<FrontmatterFieldJson>,
pub languages: &'static [&'static str],
pub plugin_hooks: Vec<PluginHookInfo>,
pub manifest_fields: Vec<ManifestFieldInfo>,
pub slots: Vec<SlotInfo>,
pub cli_commands: Vec<CliCommandInfo>,
}Fields§
§describe_schema_version: u32§moss_html_version: u32§moss_binary_version: &'static str§tokens: BTreeMap<&'a str, Vec<TokenJson<'a>>>§components: Vec<ComponentJson>§custom_properties: Vec<CustomPropJson>Escape-hatch custom properties: the var(--moss-*, fallback) hooks
moss’s stylesheets read but never declare. Schema v6 added this — the
theming API both flagship sites actually used, previously undiscoverable.
scope_attributes: Vec<ScopeAttrJson>Structural data-* attributes on elements that carry no moss-* class
— <body data-page>, <html data-theme>. Schema v6.
frontmatter: Vec<FrontmatterFieldJson>§languages: &'static [&'static str]Every language code that makes a directory or filename suffix a
language edition (zh-hant/about.md, about.zh-hans.md).
Additive, so no describe_schema_version bump: the envelope’s rule
requires one for breaking changes, and a new key breaks no reader.
Here because the failure it prevents is silent. An unrecognized
directory name is not an error — the tree is treated as ordinary
content — so an agent that invents english/ gets a build that
succeeds, a page that publishes, and no switcher, with nothing
anywhere saying why. The allowlist has to be readable before the
directory is created, and this is the only place it is published.
plugin_hooks: Vec<PluginHookInfo>Plugin hook contract: each capability moss supports, with arity and context type.
manifest_fields: Vec<ManifestFieldInfo>Plugin manifest fields: each field in PluginManifest, with type and required flag.
slots: Vec<SlotInfo>Template injection slots: each named slot in the build pipeline.
cli_commands: Vec<CliCommandInfo>CLI commands: each subcommand moss exposes.
Implementations§
Source§impl<'a> DescribePayload<'a>
impl<'a> DescribePayload<'a>
pub fn new(tokens: &'a Tokens) -> Self
Sourcepub fn with_binary_version(self, version: &'static str) -> Self
pub fn with_binary_version(self, version: &'static str) -> Self
Builder method: report the version of the moss binary that is answering, rather than the version of this crate.
env!("CARGO_PKG_VERSION") expands where it is written, so the default
set in DescribePayload::new is moss-core’s version — a different
number from the app’s, on its own release cadence. describe --json
therefore reported 0.4.0 while moss --version reported 0.8.0,
under a field named moss_binary_version. An agent keying a vocabulary
cache on it saw a version that never matched the binary and did not move
when the app was upgraded.
Only the host crate can answer this, so it has to be passed in.
Sourcepub fn with_plugin_contract(
self,
plugin_hooks: Vec<PluginHookInfo>,
manifest_fields: Vec<ManifestFieldInfo>,
slots: Vec<SlotInfo>,
cli_commands: Vec<CliCommandInfo>,
) -> Self
pub fn with_plugin_contract( self, plugin_hooks: Vec<PluginHookInfo>, manifest_fields: Vec<ManifestFieldInfo>, slots: Vec<SlotInfo>, cli_commands: Vec<CliCommandInfo>, ) -> Self
Builder method: attach plugin contract data (hooks, manifest fields, slots, CLI commands). Called by the Tauri-layer describe.rs after constructing the base payload, since those types live outside moss-core.