Files
metabuilder/packages/package_manager/playwright/tests.json
johndoe6345789 c760bd7cd0 feat: MetaBuilder Workflow Engine v3.0.0 - Complete DAG implementation
CORE ENGINE (workflow/src/)
- DAGExecutor: Priority queue-based orchestration (400+ LOC)
  * Automatic dependency resolution
  * Parallel node execution support
  * Conditional branching with multiple paths
  * Error routing to separate error ports
- Type System: 20+ interfaces for complete type safety
- Plugin Registry: Dynamic executor registration and discovery
- Template Engine: Variable interpolation with 20+ utility functions
  * {{ $json.field }}, {{ $context.user.id }}, {{ $env.VAR }}
  * {{ $steps.nodeId.output }} for step results
- Priority Queue: O(log n) heap-based scheduling
- Utilities: 3 backoff algorithms (exponential, linear, fibonacci)

TYPESCRIPT PLUGINS (workflow/plugins/{category}/{plugin}/)
Organized by category, each with independent package.json:
- DBAL: dbal-read (query with filtering/sorting/pagination), dbal-write (create/update/upsert)
- Integration: http-request, email-send, webhook-response
- Control-flow: condition (conditional routing)
- Utility: transform (data mapping), wait (pause execution), set-variable (workflow variables)

NEXT.JS INTEGRATION (frontends/nextjs/)
- API Routes:
  * GET /api/v1/{tenant}/workflows - List workflows with pagination
  * POST /api/v1/{tenant}/workflows - Create workflow
  * POST /api/v1/{tenant}/workflows/{id}/execute - Execute workflow
  * Rate limiting: 100 reads/min, 50 writes/min
- React Components:
  * WorkflowBuilder: SVG-based DAG canvas with node editing
  * ExecutionMonitor: Real-time execution dashboard with metrics
- React Hooks:
  * useWorkflow(): Execution state management with auto-retry
  * useWorkflowExecutions(): History monitoring with live polling
- WorkflowExecutionEngine: Service layer for orchestration

KEY FEATURES
- Error Handling: 4 strategies (stopWorkflow, continueRegularOutput, continueErrorOutput, skipNode)
- Retry Logic: Exponential/linear/fibonacci backoff with configurable max delay
- Multi-Tenant Safety: Enforced at schema, node parameter, and execution context levels
- Rate Limiting: Global, tenant, user, IP, custom key scoping
- Execution Metrics: Tracks duration, memory, nodes executed, success/failure counts
- Performance Benchmarks: TS baseline, C++ 100-1000x faster

MULTI-LANGUAGE PLUGIN ARCHITECTURE (Phase 3+)
- TypeScript (Phase 2): Direct import
- C++: Native FFI bindings via node-ffi (Phase 3)
- Python: Child process execution (Phase 4+)
- Auto-discovery: Scans plugins/{language}/{category}/{plugin}
- Plugin Templates: Ready for C++ (dbal-aggregate, connectors) and Python (NLP, ML)

DOCUMENTATION
- WORKFLOW_ENGINE_V3_GUIDE.md: Complete architecture and concepts
- WORKFLOW_INTEGRATION_GUIDE.md: Next.js integration patterns
- WORKFLOW_MULTI_LANGUAGE_ARCHITECTURE.md: Language support roadmap
- workflow/plugins/STRUCTURE.md: Directory organization
- workflow/plugins/MIGRATION.md: Migration from flat to category-based structure
- WORKFLOW_IMPLEMENTATION_COMPLETE.md: Executive summary

SCHEMA & EXAMPLES
- metabuilder-workflow-v3.schema.json: Complete JSON Schema validation
- complex-approval-flow.workflow.json: Production example with all features

COMPLIANCE
 MetaBuilder CLAUDE.md: 95% JSON configuration, multi-tenant, DBAL abstraction
 N8N Architecture: DAG model, parallel execution, conditional branching, error handling
 Enterprise Ready: Error recovery, metrics, audit logging, rate limiting, extensible plugins

Ready for Phase 3 C++ implementation (framework and templates complete)
2026-01-21 15:50:39 +00:00

150 lines
8.0 KiB
JSON

{
"$schema": "https://metabuilder.dev/schemas/package-playwright.schema.json",
"package": "package_manager",
"description": "Package management admin panel - Install, enable, disable, uninstall packages",
"version": "1.0",
"tags": ["@admin", "@package-management", "@phase-3"],
"tests": [
{
"name": "admin can view list of packages",
"description": "Package list displays all available and installed packages",
"tags": ["@package-management", "@smoke"],
"timeout": 30000,
"steps": [
{"action": "navigate", "url": "/admin/packages"},
{"action": "waitForLoadState", "state": "networkidle"},
{"action": "expect", "testId": "package-list-grid", "assertion": {"matcher": "toBeVisible"}},
{"action": "expect", "selector": "[data-testid='package-card']", "assertion": {"matcher": "toHaveCount", "count": 12}},
{"action": "expect", "selector": "[data-testid='package-card']:first-child h3", "assertion": {"matcher": "toContainText", "text": "User Manager"}}
]
},
{
"name": "can search packages by name",
"description": "Package list can be filtered by name search",
"tags": ["@package-management", "@search"],
"timeout": 30000,
"steps": [
{"action": "navigate", "url": "/admin/packages"},
{"action": "waitForLoadState", "state": "networkidle"},
{"action": "fill", "placeholder": "Search packages...", "value": "User Manager"},
{"action": "wait", "timeout": 500},
{"action": "expect", "selector": "[data-testid='package-card']", "assertion": {"matcher": "toHaveCount", "count": 1}},
{"action": "expect", "selector": "[data-testid='package-card'] h3", "assertion": {"matcher": "toContainText", "text": "User Manager"}}
]
},
{
"name": "can filter by installation status",
"description": "Package list can be filtered by installed/available status",
"tags": ["@package-management", "@filter"],
"timeout": 30000,
"steps": [
{"action": "navigate", "url": "/admin/packages"},
{"action": "waitForLoadState", "state": "networkidle"},
{"action": "click", "testId": "status-filter-button"},
{"action": "click", "role": "option", "text": "Installed"},
{"action": "wait", "timeout": 500},
{"action": "expect", "selector": "[data-testid='package-card']:not(.disabled)", "assertion": {"matcher": "toHaveCount", "count": 12}}
]
},
{
"name": "can install available package",
"description": "User can install an available package",
"tags": ["@package-management", "@install"],
"timeout": 30000,
"steps": [
{"action": "navigate", "url": "/admin/packages"},
{"action": "waitForLoadState", "state": "networkidle"},
{"action": "click", "role": "button", "text": "Install", "selector": "[data-testid='package-card']:has-text('Auth')"},
{"action": "waitForLoadState", "state": "networkidle"},
{"action": "expect", "role": "alert", "assertion": {"matcher": "toContainText", "text": "Package installed successfully"}}
]
},
{
"name": "installed package shows installed badge",
"description": "Installed packages display installed status badge",
"tags": ["@package-management", "@status"],
"timeout": 30000,
"steps": [
{"action": "navigate", "url": "/admin/packages"},
{"action": "waitForLoadState", "state": "networkidle"},
{"action": "expect", "selector": "[data-testid='package-card']:has-text('User Manager') [data-testid='installed-badge']", "assertion": {"matcher": "toBeVisible"}},
{"action": "expect", "selector": "[data-testid='package-card']:has-text('User Manager') [data-testid='installed-badge']", "assertion": {"matcher": "toContainText", "text": "Installed"}}
]
},
{
"name": "can view package details in modal",
"description": "Click details shows package information in modal",
"tags": ["@package-management", "@details"],
"timeout": 30000,
"steps": [
{"action": "navigate", "url": "/admin/packages"},
{"action": "waitForLoadState", "state": "networkidle"},
{"action": "click", "role": "button", "text": "Details", "selector": "[data-testid='package-card']:first-child"},
{"action": "waitForSelector", "selector": "[role='dialog']"},
{"action": "expect", "role": "dialog", "assertion": {"matcher": "toBeVisible"}},
{"action": "expect", "selector": "[data-testid='package-description']", "assertion": {"matcher": "toBeVisible"}},
{"action": "expect", "selector": "[data-testid='package-version']", "assertion": {"matcher": "toContainText", "text": "1.0"}}
]
},
{
"name": "can uninstall package",
"description": "User can uninstall a previously installed package",
"tags": ["@package-management", "@uninstall"],
"timeout": 30000,
"steps": [
{"action": "navigate", "url": "/admin/packages"},
{"action": "waitForLoadState", "state": "networkidle"},
{"action": "click", "role": "button", "text": "Manage", "selector": "[data-testid='package-card']:has-text('Auth')"},
{"action": "waitForSelector", "selector": "[data-testid='package-menu']"},
{"action": "click", "role": "menuitem", "text": "Uninstall"},
{"action": "waitForSelector", "selector": "[role='dialog']"},
{"action": "click", "role": "button", "text": "Confirm"},
{"action": "waitForLoadState", "state": "networkidle"},
{"action": "expect", "role": "alert", "assertion": {"matcher": "toContainText", "text": "Package uninstalled successfully"}}
]
},
{
"name": "can enable disabled package",
"description": "User can enable a previously disabled package",
"tags": ["@package-management", "@enable"],
"timeout": 30000,
"steps": [
{"action": "navigate", "url": "/admin/packages"},
{"action": "click", "role": "button", "text": "Manage", "selector": "[data-testid='package-card']:has-text('Dashboard')"},
{"action": "click", "role": "menuitem", "text": "Disable"},
{"action": "waitForLoadState", "state": "networkidle"},
{"action": "click", "role": "button", "text": "Manage", "selector": "[data-testid='package-card']:has-text('Dashboard')"},
{"action": "click", "role": "menuitem", "text": "Enable"},
{"action": "waitForLoadState", "state": "networkidle"},
{"action": "expect", "role": "alert", "assertion": {"matcher": "toContainText", "text": "Package enabled successfully"}}
]
},
{
"name": "can disable enabled package",
"description": "User can disable an enabled package",
"tags": ["@package-management", "@disable"],
"timeout": 30000,
"steps": [
{"action": "navigate", "url": "/admin/packages"},
{"action": "click", "role": "button", "text": "Manage", "selector": "[data-testid='package-card']:has-text('Dashboard')"},
{"action": "click", "role": "menuitem", "text": "Disable"},
{"action": "waitForLoadState", "state": "networkidle"},
{"action": "expect", "role": "alert", "assertion": {"matcher": "toContainText", "text": "Package disabled successfully"}},
{"action": "expect", "selector": "[data-testid='package-card']:has-text('Dashboard')", "assertion": {"matcher": "toHaveClass", "className": "disabled"}}
]
},
{
"name": "package version displayed correctly",
"description": "Package version chip displays current version",
"tags": ["@package-management", "@version"],
"timeout": 30000,
"steps": [
{"action": "navigate", "url": "/admin/packages"},
{"action": "waitForLoadState", "state": "networkidle"},
{"action": "expect", "selector": "[data-testid='package-card']:has-text('User Manager') [data-testid='version-chip']", "assertion": {"matcher": "toBeVisible"}},
{"action": "expect", "selector": "[data-testid='package-card']:has-text('User Manager') [data-testid='version-chip']", "assertion": {"matcher": "toContainText", "text": "1.0"}}
]
}
]
}