Skip to main content

template_node_defaults

Function template_node_defaults 

Source
pub fn template_node_defaults(
    templates: &[TemplateCatalogEntry],
    template_id: &Option<String>,
    available_ids: &[String],
) -> Vec<bool>
Expand description

Compute which of available_ids should be pre-checked in mecha10 init’s node-selection step, sourced from the live-fetched templates catalog instead of the compiled-in Template::new(...) list mecha10_templates::init::defaults::get_template_defaults used to read. template_id defaults to "rover" when omitted, exactly like that function; an unrecognized template_id falls back to [FALLBACK_BASIC_NODES], same as that function’s own get_fallback_defaults fallback.

This intentionally doesn’t error on an unrecognized template_id - non-interactive mecha10 init --template <name> kept this same graceful-fallback behavior before this migration (no hard validation error), and this preserves that rather than introducing a new failure mode.