feat: Add Python plugins from AutoMetabuilder + restructure workflow folder

Restructure workflow/ for multi-language plugin support:
- Rename src/ to core/ (engine code: DAG executor, registry, types)
- Create executor/{cpp,python,ts}/ for language-specific runtimes
- Consolidate plugins to plugins/{ts,python}/ by language then category

Add 80+ Python plugins from AutoMetabuilder in 14 categories:
- control: bot control, switch logic, state management
- convert: type conversions (json, boolean, dict, list, number, string)
- core: AI requests, context management, tool calls
- dict: dictionary operations (get, set, keys, values, merge)
- list: list operations (concat, find, sort, slice, filter)
- logic: boolean logic (and, or, xor, equals, comparisons)
- math: arithmetic operations (add, subtract, multiply, power, etc.)
- string: string manipulation (concat, split, replace, format)
- notifications: Slack, Discord integrations
- test: assertion helpers and test suite runner
- tools: file operations, git, docker, testing utilities
- utils: filtering, mapping, reducing, condition branching
- var: variable store operations (get, set, delete, exists)
- web: Flask server, environment variables, JSON handling

Add language executor runtimes:
- TypeScript: direct import execution (default, fast startup)
- Python: child process with JSON stdin/stdout communication
- C++: placeholder for native FFI bindings (Phase 3)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-21 16:08:08 +00:00
parent c760bd7cd0
commit 5ac579a2ed
171 changed files with 2188 additions and 1565 deletions

View File

@@ -0,0 +1 @@
"""Mathematical operations plugins."""

View File

@@ -0,0 +1,7 @@
"""Workflow plugin: absolute value."""
def run(_runtime, inputs):
"""Calculate absolute value."""
value = inputs.get("value", 0)
return {"result": abs(value)}

View File

@@ -0,0 +1,7 @@
"""Workflow plugin: add numbers."""
def run(_runtime, inputs):
"""Add two or more numbers."""
numbers = inputs.get("numbers", [])
return {"result": sum(numbers)}

View File

@@ -0,0 +1,12 @@
"""Workflow plugin: divide numbers."""
def run(_runtime, inputs):
"""Divide a by b."""
a = inputs.get("a", 0)
b = inputs.get("b", 1)
if b == 0:
return {"result": None, "error": "Division by zero"}
return {"result": a / b}

View File

@@ -0,0 +1,11 @@
"""Workflow plugin: maximum value."""
def run(_runtime, inputs):
"""Find maximum value in numbers."""
numbers = inputs.get("numbers", [])
if not numbers:
return {"result": None}
return {"result": max(numbers)}

View File

@@ -0,0 +1,11 @@
"""Workflow plugin: minimum value."""
def run(_runtime, inputs):
"""Find minimum value in numbers."""
numbers = inputs.get("numbers", [])
if not numbers:
return {"result": None}
return {"result": min(numbers)}

View File

@@ -0,0 +1,12 @@
"""Workflow plugin: modulo operation."""
def run(_runtime, inputs):
"""Calculate a modulo b."""
a = inputs.get("a", 0)
b = inputs.get("b", 1)
if b == 0:
return {"result": None, "error": "Modulo by zero"}
return {"result": a % b}

View File

@@ -0,0 +1,10 @@
"""Workflow plugin: multiply numbers."""
def run(_runtime, inputs):
"""Multiply two or more numbers."""
numbers = inputs.get("numbers", [])
result = 1
for num in numbers:
result *= num
return {"result": result}

View File

@@ -0,0 +1,8 @@
"""Workflow plugin: power operation."""
def run(_runtime, inputs):
"""Calculate a to the power of b."""
a = inputs.get("a", 0)
b = inputs.get("b", 1)
return {"result": a ** b}

View File

@@ -0,0 +1,8 @@
"""Workflow plugin: round number."""
def run(_runtime, inputs):
"""Round number to specified precision."""
value = inputs.get("value", 0)
precision = inputs.get("precision", 0)
return {"result": round(value, precision)}

View File

@@ -0,0 +1,8 @@
"""Workflow plugin: subtract numbers."""
def run(_runtime, inputs):
"""Subtract b from a."""
a = inputs.get("a", 0)
b = inputs.get("b", 0)
return {"result": a - b}