Parses state_transitions.csv and validates state transitions.
bool is_valid_script_filename(const std::string &name)
True when name is a safe bare script filename: ^[A-Za-z0-9_-]+.script$, no separators.
constexpr uint32_t kMaxScriptTimeoutMs
Hard ceiling on script_timeout_ms, independent of per-state config.
ScriptLoadResult load_dynamic_states(const fsw::config::Config &cfg, const std::string &config_text, const ScriptLoadContext &ctx)
Resolve, load and validate every [[states]] entry carrying a script_file.
State
System state IDs — must match the TypeScript SystemState enum in web-gui/shared/types....
The whole parsed config.toml, restricted to what C++ consumes.
A parsed script, as a flat arena.
One dynamic state, resolved and proven usable.
State return_target
Where the state lands when the script runs off its end.
std::vector< std::string > pressure_roles
Canonical PT role names this script reads, deduplicated.
std::vector< std::string > slug_names
Parallel to program.slugs — what each slug reference resolves to, decided at load.
State timeout_target
Where it lands when timeout_ms expires.
fsw::script::ScriptProgram program
std::vector< State > slug_states
Everything load_dynamic_states needs that it cannot get from Config alone.
const StateMachine * state_machine
Transition matrix, already loaded.
State fire_state
The [fire] state, so a script cannot be attached to the burn.
std::function< bool(const std::string &state_name)> has_actuator_column
True when the named state has a column in state_machine_actuators.csv.
std::string config_dir
Directory holding config.toml; scripts resolve to <config_dir>/scripts/<script_file>.
What a config load made of its dynamic states.
std::map< State, std::string > refused
std::map< State, DynamicState > dynamic