Expand description
Configuration management for behavior trees
Loads and validates behavior tree configs from a 2-tier config.json scope layout.
Structs§
- Behavior
Config - A behavior tree definition loaded from a JSON configuration file.
- Node
Config - Configuration referencing a behavior node type and its inline configuration.
- Node
Reference - Subsumption
Layer Config - A single priority layer within a
Subsumptioncomposition node. - Validation
Result
Enums§
- Composition
Config - A node in a behavior tree: either a composite control-flow node or a leaf behavior node.
- Parallel
Policy Config - Determines when a
Parallelcomposition node succeeds, based on its children’s outcomes.
Functions§
- behavior_
capabilities_ satisfied - Returns
trueif every capabilityconfigdeclares viarequires_capabilitiesis present inavailable_capabilities– the same subset check [validate_required_capabilities] uses to produce validation errors, exposed for runtime filtering (e.g. excluding a behavior from/behavior/availablewhen the robot doesn’t provide a capability it needs). - detect_
project_ root - Detect project root by looking for mecha10.json
- get_
current_ environment - Get the current environment from environment variable
- list_
available_ behaviors - List the names of every behavior available to a project, across both tiers
(
configs/behaviors/{name}/config.jsonandconfigs/behaviors/@mecha10/{name}/config.json). A name present in both tiers is only listed once. - list_
capable_ behaviors - List the names of every behavior available to a project (see
list_available_behaviors), excluding any whoserequires_capabilitiesisn’t fully satisfied byavailable_capabilities– e.g. so a robot with noFlightcapability never reports a flight-only behavior as available on/behavior/available. A behavior whose config can’t be loaded or parsed is excluded rather than reported as available. - load_
behavior_ config - Load a behavior’s
config.json, resolved viaresolve_behavior_config_path. - resolve_
behavior_ config_ path - Resolve the on-disk
config.jsonpath for a behavior, checking the 2 tiers in override precedence order (project -> framework) and returning the highest-precedence one that exists. Returns an error listing both attempted paths if neither exists. - validate_
behavior_ composition_ json - Validate a behavior composition JSON value against the
schemars-derivedBehaviorConfigJSON Schema – structural validation only, noNodeRegistryrequired. Returns an error describing every schema violation found. - validate_
behavior_ config - Validate a behavior tree configuration: checks it against the real
BehaviorConfigJSON Schema (seevalidate_behavior_composition_json), that every leaf node’snodetype exists inregistry, and that every capability it declares viarequires_capabilitiesis present inavailable_capabilities– rules a JSON Schema can’t express on its own since they cross-reference the live node registry / the project’s other nodes.