Summary
DefaultScriptProvider supports manifest-defined scripts via ScriptsConfig.entries, but there is no way to populate these entries from configuration. The entries vector is always empty unless populated programmatically in C++.
The entity manifest (sensor_manifest.yaml, turtlebot3_manifest.yaml, etc.) already defines the full entity hierarchy (areas, components, apps, functions) via ManifestParser. Scripts should be loadable from the same manifest file as a new top-level section.
Proposed solution
Extend the entity manifest YAML with an optional scripts: section:
# In sensor_manifest.yaml (alongside existing areas/components/apps/functions)
scripts:
- id: "run-diagnostics"
name: "Run Diagnostics"
description: "Check health of all sensors"
path: "/opt/scripts/run-diagnostics.sh"
format: "bash"
timeout_sec: 30
entity_filter: ["compute-unit"]
env:
GATEWAY_URL: "http://localhost:8080"
- id: "inject-nan"
name: "Inject NaN Fault"
description: "Enable NaN values on all sensors"
path: "/opt/scripts/inject-nan.sh"
format: "bash"
timeout_sec: 30
entity_filter: ["compute-unit"]
Implementation scope:
- Add
parse_scripts() to ManifestParser - parse scripts: section into std::vector<ScriptEntryConfig>
- Extend
Manifest struct with scripts field
- In
gateway_node.cpp, after manifest parsing, populate scripts_config.entries from manifest.scripts
- Scripts loaded from manifest are
managed: true (immutable, not deletable via API)
- Unit tests for script manifest parsing
- Update manifest documentation with scripts section reference
This follows the existing pattern - ManifestParser already uses yaml-cpp and parses Areas/Components/Apps/Functions. Adding scripts is a natural extension.
Additional context
Needed for selfpatch/selfpatch_demos#42 (Scripts API demo integration). All three demos need manifest-defined scripts to showcase the Scripts API feature.
Currently ScriptsConfig.entries fields per entry: id, name, description, path, format, timeout_sec, entity_filter (string vector), env (string map), args (JSON array), parameters_schema (optional JSON).
Summary
DefaultScriptProvidersupports manifest-defined scripts viaScriptsConfig.entries, but there is no way to populate these entries from configuration. Theentriesvector is always empty unless populated programmatically in C++.The entity manifest (
sensor_manifest.yaml,turtlebot3_manifest.yaml, etc.) already defines the full entity hierarchy (areas, components, apps, functions) viaManifestParser. Scripts should be loadable from the same manifest file as a new top-level section.Proposed solution
Extend the entity manifest YAML with an optional
scripts:section:Implementation scope:
parse_scripts()toManifestParser- parsescripts:section intostd::vector<ScriptEntryConfig>Manifeststruct withscriptsfieldgateway_node.cpp, after manifest parsing, populatescripts_config.entriesfrommanifest.scriptsmanaged: true(immutable, not deletable via API)This follows the existing pattern -
ManifestParseralready uses yaml-cpp and parses Areas/Components/Apps/Functions. Adding scripts is a natural extension.Additional context
Needed for selfpatch/selfpatch_demos#42 (Scripts API demo integration). All three demos need manifest-defined scripts to showcase the Scripts API feature.
Currently
ScriptsConfig.entriesfields per entry:id,name,description,path,format,timeout_sec,entity_filter(string vector),env(string map),args(JSON array),parameters_schema(optional JSON).