Initial commit (Clean history)

This commit is contained in:
anhduy-tech
2025-12-30 11:27:14 +07:00
commit ef48c93de0
19255 changed files with 3248867 additions and 0 deletions

21
app/workflow_registry.py Normal file
View File

@@ -0,0 +1,21 @@
from typing import Callable, Dict
ACTION_REGISTRY: Dict[str, Callable] = {}
ACTION_SCHEMAS: Dict[str, dict] = {}
def register_action(name: str, schema=None):
def decorator(func):
ACTION_REGISTRY[name] = func
ACTION_SCHEMAS[name] = schema or {}
return func
return decorator
def validate_action_schema(action_name, params):
schema = ACTION_SCHEMAS.get(action_name, {})
required = schema.get("required", [])
for key in required:
if key not in params:
raise Exception(f"Action '{action_name}' missing required param: {key}")
return True