refactor(workflow): convert all plugins to class/struct + factory pattern

- Python: class extending NodeExecutor + factory.py (80+ plugins)
- TypeScript: class implements NodeExecutor + factory.ts (7 groups, 116 classes)
- Go: struct with methods + factory.go (36 plugins)
- Rust: struct impl NodeExecutor trait + factory.rs (54 plugins)
- Mojo: struct + factory.mojo (11 plugins)

All package.json files now include:
- files array listing source files
- metadata.class/struct field
- metadata.entrypoint field

This enables a unified plugin loading system across all languages
with no import side effects (Spring-style DI pattern).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-22 14:53:04 +00:00
parent 2562c2f55b
commit 7ce8b4ae8a
653 changed files with 13243 additions and 3034 deletions

View File

@@ -0,0 +1,7 @@
"""Factory for LogicAnd plugin."""
from .logic_and import LogicAnd
def create():
return LogicAnd()

View File

@@ -1,7 +1,15 @@
"""Workflow plugin: logical AND."""
from ...base import NodeExecutor
def run(_runtime, inputs):
class LogicAnd(NodeExecutor):
"""Perform logical AND on values."""
values = inputs.get("values", [])
return {"result": all(values)}
node_type = "logic.and"
category = "logic"
description = "Perform logical AND on values"
def execute(self, inputs, runtime=None):
values = inputs.get("values", [])
return {"result": all(values)}

View File

@@ -1,13 +1,16 @@
{
"name": "@metabuilder/logic_and",
"version": "1.0.0",
"description": "logic_and plugin",
"description": "Perform logical AND on values",
"author": "MetaBuilder",
"license": "MIT",
"keywords": ["logic", "workflow", "plugin"],
"main": "logic_and.py",
"files": ["logic_and.py", "factory.py"],
"metadata": {
"plugin_type": "logic.and",
"category": "logic"
"category": "logic",
"class": "LogicAnd",
"entrypoint": "execute"
}
}

View File

@@ -0,0 +1,7 @@
"""Factory for LogicEquals plugin."""
from .logic_equals import LogicEquals
def create():
return LogicEquals()

View File

@@ -1,8 +1,16 @@
"""Workflow plugin: equality comparison."""
from ...base import NodeExecutor
def run(_runtime, inputs):
class LogicEquals(NodeExecutor):
"""Check if two values are equal."""
a = inputs.get("a")
b = inputs.get("b")
return {"result": a == b}
node_type = "logic.equals"
category = "logic"
description = "Check if two values are equal"
def execute(self, inputs, runtime=None):
a = inputs.get("a")
b = inputs.get("b")
return {"result": a == b}

View File

@@ -1,13 +1,16 @@
{
"name": "@metabuilder/logic_equals",
"version": "1.0.0",
"description": "logic_equals plugin",
"description": "Check if two values are equal",
"author": "MetaBuilder",
"license": "MIT",
"keywords": ["logic", "workflow", "plugin"],
"main": "logic_equals.py",
"files": ["logic_equals.py", "factory.py"],
"metadata": {
"plugin_type": "logic.equals",
"category": "logic"
"category": "logic",
"class": "LogicEquals",
"entrypoint": "execute"
}
}

View File

@@ -0,0 +1,7 @@
"""Factory for LogicGt plugin."""
from .logic_gt import LogicGt
def create():
return LogicGt()

View File

@@ -1,8 +1,16 @@
"""Workflow plugin: greater than comparison."""
from ...base import NodeExecutor
def run(_runtime, inputs):
class LogicGt(NodeExecutor):
"""Check if a > b."""
a = inputs.get("a")
b = inputs.get("b")
return {"result": a > b}
node_type = "logic.gt"
category = "logic"
description = "Check if a > b"
def execute(self, inputs, runtime=None):
a = inputs.get("a")
b = inputs.get("b")
return {"result": a > b}

View File

@@ -1,13 +1,16 @@
{
"name": "@metabuilder/logic_gt",
"version": "1.0.0",
"description": "logic_gt plugin",
"description": "Check if a > b",
"author": "MetaBuilder",
"license": "MIT",
"keywords": ["logic", "workflow", "plugin"],
"main": "logic_gt.py",
"files": ["logic_gt.py", "factory.py"],
"metadata": {
"plugin_type": "logic.gt",
"category": "logic"
"category": "logic",
"class": "LogicGt",
"entrypoint": "execute"
}
}

View File

@@ -0,0 +1,7 @@
"""Factory for LogicGte plugin."""
from .logic_gte import LogicGte
def create():
return LogicGte()

View File

@@ -1,8 +1,16 @@
"""Workflow plugin: greater than or equal comparison."""
from ...base import NodeExecutor
def run(_runtime, inputs):
class LogicGte(NodeExecutor):
"""Check if a >= b."""
a = inputs.get("a")
b = inputs.get("b")
return {"result": a >= b}
node_type = "logic.gte"
category = "logic"
description = "Check if a >= b"
def execute(self, inputs, runtime=None):
a = inputs.get("a")
b = inputs.get("b")
return {"result": a >= b}

View File

@@ -1,13 +1,16 @@
{
"name": "@metabuilder/logic_gte",
"version": "1.0.0",
"description": "logic_gte plugin",
"description": "Check if a >= b",
"author": "MetaBuilder",
"license": "MIT",
"keywords": ["logic", "workflow", "plugin"],
"main": "logic_gte.py",
"files": ["logic_gte.py", "factory.py"],
"metadata": {
"plugin_type": "logic.gte",
"category": "logic"
"category": "logic",
"class": "LogicGte",
"entrypoint": "execute"
}
}

View File

@@ -0,0 +1,7 @@
"""Factory for LogicIn plugin."""
from .logic_in import LogicIn
def create():
return LogicIn()

View File

@@ -1,8 +1,16 @@
"""Workflow plugin: membership test."""
from ...base import NodeExecutor
def run(_runtime, inputs):
class LogicIn(NodeExecutor):
"""Check if value is in collection."""
value = inputs.get("value")
collection = inputs.get("collection", [])
return {"result": value in collection}
node_type = "logic.in"
category = "logic"
description = "Check if value is in collection"
def execute(self, inputs, runtime=None):
value = inputs.get("value")
collection = inputs.get("collection", inputs.get("array", []))
return {"result": value in collection}

View File

@@ -1,13 +1,16 @@
{
"name": "@metabuilder/logic_in",
"version": "1.0.0",
"description": "logic_in plugin",
"description": "Check if value is in collection",
"author": "MetaBuilder",
"license": "MIT",
"keywords": ["logic", "workflow", "plugin"],
"main": "logic_in.py",
"files": ["logic_in.py", "factory.py"],
"metadata": {
"plugin_type": "logic.in",
"category": "logic"
"category": "logic",
"class": "LogicIn",
"entrypoint": "execute"
}
}

View File

@@ -0,0 +1,7 @@
"""Factory for LogicLt plugin."""
from .logic_lt import LogicLt
def create():
return LogicLt()

View File

@@ -1,8 +1,16 @@
"""Workflow plugin: less than comparison."""
from ...base import NodeExecutor
def run(_runtime, inputs):
class LogicLt(NodeExecutor):
"""Check if a < b."""
a = inputs.get("a")
b = inputs.get("b")
return {"result": a < b}
node_type = "logic.lt"
category = "logic"
description = "Check if a < b"
def execute(self, inputs, runtime=None):
a = inputs.get("a")
b = inputs.get("b")
return {"result": a < b}

View File

@@ -1,13 +1,16 @@
{
"name": "@metabuilder/logic_lt",
"version": "1.0.0",
"description": "logic_lt plugin",
"description": "Check if a < b",
"author": "MetaBuilder",
"license": "MIT",
"keywords": ["logic", "workflow", "plugin"],
"main": "logic_lt.py",
"files": ["logic_lt.py", "factory.py"],
"metadata": {
"plugin_type": "logic.lt",
"category": "logic"
"category": "logic",
"class": "LogicLt",
"entrypoint": "execute"
}
}

View File

@@ -0,0 +1,7 @@
"""Factory for LogicLte plugin."""
from .logic_lte import LogicLte
def create():
return LogicLte()

View File

@@ -1,8 +1,16 @@
"""Workflow plugin: less than or equal comparison."""
from ...base import NodeExecutor
def run(_runtime, inputs):
class LogicLte(NodeExecutor):
"""Check if a <= b."""
a = inputs.get("a")
b = inputs.get("b")
return {"result": a <= b}
node_type = "logic.lte"
category = "logic"
description = "Check if a <= b"
def execute(self, inputs, runtime=None):
a = inputs.get("a")
b = inputs.get("b")
return {"result": a <= b}

View File

@@ -1,13 +1,16 @@
{
"name": "@metabuilder/logic_lte",
"version": "1.0.0",
"description": "logic_lte plugin",
"description": "Check if a <= b",
"author": "MetaBuilder",
"license": "MIT",
"keywords": ["logic", "workflow", "plugin"],
"main": "logic_lte.py",
"files": ["logic_lte.py", "factory.py"],
"metadata": {
"plugin_type": "logic.lte",
"category": "logic"
"category": "logic",
"class": "LogicLte",
"entrypoint": "execute"
}
}

View File

@@ -0,0 +1,7 @@
"""Factory for LogicOr plugin."""
from .logic_or import LogicOr
def create():
return LogicOr()

View File

@@ -1,7 +1,15 @@
"""Workflow plugin: logical OR."""
from ...base import NodeExecutor
def run(_runtime, inputs):
class LogicOr(NodeExecutor):
"""Perform logical OR on values."""
values = inputs.get("values", [])
return {"result": any(values)}
node_type = "logic.or"
category = "logic"
description = "Perform logical OR on values"
def execute(self, inputs, runtime=None):
values = inputs.get("values", [])
return {"result": any(values)}

View File

@@ -1,13 +1,16 @@
{
"name": "@metabuilder/logic_or",
"version": "1.0.0",
"description": "logic_or plugin",
"description": "Perform logical OR on values",
"author": "MetaBuilder",
"license": "MIT",
"keywords": ["logic", "workflow", "plugin"],
"main": "logic_or.py",
"files": ["logic_or.py", "factory.py"],
"metadata": {
"plugin_type": "logic.or",
"category": "logic"
"category": "logic",
"class": "LogicOr",
"entrypoint": "execute"
}
}

View File

@@ -0,0 +1,7 @@
"""Factory for LogicXor plugin."""
from .logic_xor import LogicXor
def create():
return LogicXor()

View File

@@ -1,8 +1,16 @@
"""Workflow plugin: logical XOR."""
from ...base import NodeExecutor
def run(_runtime, inputs):
class LogicXor(NodeExecutor):
"""Perform logical XOR on two values."""
a = inputs.get("a", False)
b = inputs.get("b", False)
return {"result": bool(a) != bool(b)}
node_type = "logic.xor"
category = "logic"
description = "Perform logical XOR on two values"
def execute(self, inputs, runtime=None):
a = bool(inputs.get("a", False))
b = bool(inputs.get("b", False))
return {"result": a != b}

View File

@@ -1,13 +1,16 @@
{
"name": "@metabuilder/logic_xor",
"version": "1.0.0",
"description": "logic_xor plugin",
"description": "Perform logical XOR on two values",
"author": "MetaBuilder",
"license": "MIT",
"keywords": ["logic", "workflow", "plugin"],
"main": "logic_xor.py",
"files": ["logic_xor.py", "factory.py"],
"metadata": {
"plugin_type": "logic.xor",
"category": "logic"
"category": "logic",
"class": "LogicXor",
"entrypoint": "execute"
}
}