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

@@ -1,27 +1,37 @@
"""Workflow plugin: parse CLI arguments."""
import argparse
from ...base import NodeExecutor
def run(runtime, inputs):
"""Parse command line arguments.
Inputs:
args: Optional list of arguments (defaults to sys.argv)
"""
parser = argparse.ArgumentParser(description="MetaBuilder Workflow")
class ParseCliArgs(NodeExecutor):
"""Parse command line arguments."""
parser.add_argument("--config", "-c", default="config.json",
help="Path to configuration file")
parser.add_argument("--workflow", "-w",
help="Path to workflow file")
parser.add_argument("--verbose", "-v", action="store_true",
help="Enable verbose output")
parser.add_argument("--dry-run", action="store_true",
help="Simulate workflow execution")
node_type = "backend.parse_cli_args"
category = "backend"
description = "Parse command line arguments"
args_list = inputs.get("args")
parsed = parser.parse_args(args_list)
def execute(self, inputs, runtime=None):
"""Parse command line arguments.
runtime.context["cli_args"] = vars(parsed)
Inputs:
args: Optional list of arguments (defaults to sys.argv)
"""
parser = argparse.ArgumentParser(description="MetaBuilder Workflow")
return {"success": True, "args": vars(parsed)}
parser.add_argument("--config", "-c", default="config.json",
help="Path to configuration file")
parser.add_argument("--workflow", "-w",
help="Path to workflow file")
parser.add_argument("--verbose", "-v", action="store_true",
help="Enable verbose output")
parser.add_argument("--dry-run", action="store_true",
help="Simulate workflow execution")
args_list = inputs.get("args")
parsed = parser.parse_args(args_list)
runtime.context["cli_args"] = vars(parsed)
return {"success": True, "args": vars(parsed)}

View File

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

View File

@@ -6,8 +6,11 @@
"license": "MIT",
"keywords": ["backend", "workflow", "plugin", "cli", "args"],
"main": "backend_parse_cli_args.py",
"files": ["backend_parse_cli_args.py", "factory.py"],
"metadata": {
"plugin_type": "backend.parse_cli_args",
"category": "backend"
"category": "backend",
"class": "ParseCliArgs",
"entrypoint": "execute"
}
}