mirror of
https://github.com/johndoe6345789/AutoMetabuilder.git
synced 2026-04-24 13:54:59 +00:00
- Implement core components: CLI argument parsing, environment loading, GitHub service creation, and logging configuration. - Add support for OpenAI client setup and model resolution. - Develop SDLC context loader from GitHub and repository files. - Implement workflow context and engine builders. - Introduce major workflow packages: `game_tick_loop` and `contextual_iterative_loop`. - Update localization files with new package descriptions and labels. - Streamline web navigation by loading items from a dedicated JSON file.
27 lines
765 B
Python
27 lines
765 B
Python
"""Workflow plugin: branch condition."""
|
|
import re
|
|
from ..value_helpers import ValueHelpers
|
|
|
|
|
|
def run(_runtime, inputs):
|
|
"""Evaluate a branch condition."""
|
|
value = inputs.get("value")
|
|
mode = inputs.get("mode", "is_truthy")
|
|
compare = inputs.get("compare", "")
|
|
decision = False
|
|
|
|
if mode == "is_empty":
|
|
decision = not ValueHelpers.ensure_list(value)
|
|
elif mode == "is_truthy":
|
|
decision = bool(value)
|
|
elif mode == "equals":
|
|
decision = str(value) == compare
|
|
elif mode == "not_equals":
|
|
decision = str(value) != compare
|
|
elif mode == "contains":
|
|
decision = compare in str(value)
|
|
elif mode == "regex":
|
|
decision = bool(re.search(compare, str(value)))
|
|
|
|
return {"result": decision}
|