diff --git a/workflow/examples/README.md b/workflow/examples/README.md new file mode 100644 index 000000000..590cfe923 --- /dev/null +++ b/workflow/examples/README.md @@ -0,0 +1,62 @@ +# Workflow Examples + +Example workflow packages from AutoMetabuilder demonstrating various patterns. + +## Python Examples (`python/`) + +These are JSON-based workflow definitions that use the Python plugins. + +### Templates + +| Package | Description | +|---------|-------------| +| `blank` | Empty starter template | +| `single_pass` | Single AI request with tool execution | +| `iterative_loop` | AI loop with tool calls until completion | +| `contextual_iterative_loop` | Loop with repository context | +| `plan_execute_summarize` | Planning, execution, and summarization pattern | + +### Data Processing + +| Package | Description | +|---------|-------------| +| `data_processing_demo` | Filter, map, reduce operations | +| `conditional_logic_demo` | Branching and conditional logic | +| `repo_scan_context` | Scan repository and build context | + +### Plugin Test Suites + +| Package | Description | +|---------|-------------| +| `dict_plugins_test` | Dictionary operation tests | +| `list_plugins_test` | List operation tests | +| `logic_plugins_test` | Boolean logic tests | +| `math_plugins_test` | Arithmetic operation tests | +| `string_plugins_test` | String manipulation tests | + +### Infrastructure + +| Package | Description | +|---------|-------------| +| `backend_bootstrap` | Initialize backend services | +| `default_app_workflow` | Full application workflow | +| `web_server_bootstrap` | Flask server with routes | +| `web_server_json_routes` | JSON API route configuration | + +### Specialized + +| Package | Description | +|---------|-------------| +| `game_tick_loop` | Game loop with tick phases | +| `testing_triangle` | Lint, unit test, UI test pipeline | + +## Workflow Structure + +Each package contains: + +- `package.json` - Package metadata +- `workflow.json` - Workflow definition with nodes and connections + +## Running Examples + +These workflows are designed to run with the Python executor and plugins in `workflow/plugins/python/`. diff --git a/workflow/examples/python/backend_bootstrap/package.json b/workflow/examples/python/backend_bootstrap/package.json new file mode 100644 index 000000000..197d38c68 --- /dev/null +++ b/workflow/examples/python/backend_bootstrap/package.json @@ -0,0 +1,23 @@ +{ + "name": "backend_bootstrap", + "version": "1.0.0", + "description": "meta.workflow_packages.backend_bootstrap.description", + "author": "AutoMetabuilder", + "license": "MIT", + "keywords": [ + "backend", + "bootstrap", + "initialization" + ], + "main": "workflow.json", + "metadata": { + "label": "meta.workflow_packages.backend_bootstrap.label", + "description": "meta.workflow_packages.backend_bootstrap.description", + "tags": [ + "backend", + "bootstrap" + ], + "icon": "settings", + "category": "templates" + } +} diff --git a/workflow/examples/python/backend_bootstrap/workflow.json b/workflow/examples/python/backend_bootstrap/workflow.json new file mode 100644 index 000000000..dc81df058 --- /dev/null +++ b/workflow/examples/python/backend_bootstrap/workflow.json @@ -0,0 +1,159 @@ +{ + "name": "Backend Bootstrap", + "active": false, + "nodes": [ + { + "id": "load_messages", + "name": "Load Messages", + "type": "backend.load_messages", + "typeVersion": 1, + "position": [0, 50], + "parameters": {} + }, + { + "id": "load_metadata", + "name": "Load Metadata", + "type": "backend.load_metadata", + "typeVersion": 1, + "position": [300, 50], + "parameters": {} + }, + { + "id": "load_prompt", + "name": "Load Prompt", + "type": "backend.load_prompt", + "typeVersion": 1, + "position": [600, 50], + "parameters": {} + }, + { + "id": "create_github", + "name": "Create GitHub Client", + "type": "backend.create_github", + "typeVersion": 1, + "position": [900, 50], + "parameters": {} + }, + { + "id": "create_openai", + "name": "Create OpenAI Client", + "type": "backend.create_openai", + "typeVersion": 1, + "position": [1200, 50], + "parameters": {} + }, + { + "id": "load_tools", + "name": "Load Tools", + "type": "backend.load_tools", + "typeVersion": 1, + "position": [1500, 50], + "parameters": {} + }, + { + "id": "build_tool_map", + "name": "Build Tool Map", + "type": "backend.build_tool_map", + "typeVersion": 1, + "position": [1800, 50], + "parameters": {} + }, + { + "id": "load_plugins", + "name": "Load Plugins", + "type": "backend.load_plugins", + "typeVersion": 1, + "position": [2100, 50], + "parameters": {} + } + ], + "connections": { + "Load Messages": { + "main": { + "0": [ + { + "node": "Load Metadata", + "type": "main", + "index": 0 + } + ] + } + }, + "Load Metadata": { + "main": { + "0": [ + { + "node": "Load Prompt", + "type": "main", + "index": 0 + } + ] + } + }, + "Load Prompt": { + "main": { + "0": [ + { + "node": "Create GitHub Client", + "type": "main", + "index": 0 + } + ] + } + }, + "Create GitHub Client": { + "main": { + "0": [ + { + "node": "Create OpenAI Client", + "type": "main", + "index": 0 + } + ] + } + }, + "Create OpenAI Client": { + "main": { + "0": [ + { + "node": "Load Tools", + "type": "main", + "index": 0 + } + ] + } + }, + "Load Tools": { + "main": { + "0": [ + { + "node": "Build Tool Map", + "type": "main", + "index": 0 + } + ] + } + }, + "Build Tool Map": { + "main": { + "0": [ + { + "node": "Load Plugins", + "type": "main", + "index": 0 + } + ] + } + } + }, + "triggers": [ + { + "nodeId": "load_messages", + "kind": "manual", + "enabled": true, + "meta": { + "description": "Initialize backend services and dependencies" + } + } + ] +} diff --git a/workflow/examples/python/blank/package.json b/workflow/examples/python/blank/package.json new file mode 100644 index 000000000..1ad88e5f6 --- /dev/null +++ b/workflow/examples/python/blank/package.json @@ -0,0 +1,20 @@ +{ + "name": "blank", + "version": "1.0.0", + "description": "meta.workflow_packages.blank.description", + "author": "AutoMetabuilder", + "license": "MIT", + "keywords": [ + "starter" + ], + "main": "workflow.json", + "metadata": { + "label": "meta.workflow_packages.blank.label", + "description": "meta.workflow_packages.blank.description", + "tags": [ + "starter" + ], + "icon": "workflow", + "category": "templates" + } +} diff --git a/workflow/examples/python/blank/workflow.json b/workflow/examples/python/blank/workflow.json new file mode 100644 index 000000000..3f5108aa1 --- /dev/null +++ b/workflow/examples/python/blank/workflow.json @@ -0,0 +1,18 @@ +{ + "name": "Blank Canvas", + "active": false, + "nodes": [ + { + "id": "start", + "name": "Start", + "type": "core.start", + "typeVersion": 1, + "position": [ + 0, + 0 + ], + "parameters": {} + } + ], + "connections": {} +} diff --git a/workflow/examples/python/conditional_logic_demo/package.json b/workflow/examples/python/conditional_logic_demo/package.json new file mode 100644 index 000000000..78e3313e2 --- /dev/null +++ b/workflow/examples/python/conditional_logic_demo/package.json @@ -0,0 +1,23 @@ +{ + "name": "conditional_logic_demo", + "version": "1.0.0", + "description": "meta.workflow_packages.conditional_logic_demo.description", + "author": "AutoMetabuilder", + "license": "MIT", + "keywords": [ + "logic", + "conditional", + "branching" + ], + "main": "workflow.json", + "metadata": { + "label": "meta.workflow_packages.conditional_logic_demo.label", + "description": "meta.workflow_packages.conditional_logic_demo.description", + "tags": [ + "logic", + "demo" + ], + "icon": "workflow", + "category": "templates" + } +} diff --git a/workflow/examples/python/conditional_logic_demo/workflow.json b/workflow/examples/python/conditional_logic_demo/workflow.json new file mode 100644 index 000000000..3dad7412a --- /dev/null +++ b/workflow/examples/python/conditional_logic_demo/workflow.json @@ -0,0 +1,116 @@ +{ + "name": "Conditional Logic Demo", + "active": false, + "nodes": [ + { + "id": "create_user_data", + "name": "Create User Data", + "type": "var.set", + "typeVersion": 1, + "position": [ + 0, + 100 + ], + "parameters": { + "key": "user", + "value": { + "name": "Alice", + "age": 25, + "score": 85, + "role": "developer" + } + } + }, + { + "id": "extract_age", + "name": "Extract Age", + "type": "dict.get", + "typeVersion": 1, + "position": [ + 300, + 50 + ], + "parameters": { + "object": "$user", + "key": "age" + } + }, + { + "id": "check_adult", + "name": "Check If Adult", + "type": "logic.gte", + "typeVersion": 1, + "position": [ + 600, + 100 + ], + "parameters": { + "a": "$age", + "b": 18 + } + }, + { + "id": "format_report", + "name": "Format Final Report", + "type": "string.format", + "typeVersion": 1, + "position": [ + 900, + 100 + ], + "parameters": { + "template": "User: {name}, Age: {age}, Adult: {is_adult}", + "variables": { + "name": "Alice", + "age": "$age", + "is_adult": "$is_adult" + } + } + } + ], + "connections": { + "Create User Data": { + "main": { + "0": [ + { + "node": "Extract Age", + "type": "main", + "index": 0 + } + ] + } + }, + "Extract Age": { + "main": { + "0": [ + { + "node": "Check If Adult", + "type": "main", + "index": 0 + } + ] + } + }, + "Check If Adult": { + "main": { + "0": [ + { + "node": "Format Final Report", + "type": "main", + "index": 0 + } + ] + } + } + }, + "triggers": [ + { + "nodeId": "create_user_data", + "kind": "manual", + "enabled": true, + "meta": { + "description": "Manually triggered Conditional Logic Demo workflow execution" + } + } + ] +} diff --git a/workflow/examples/python/contextual_iterative_loop/package.json b/workflow/examples/python/contextual_iterative_loop/package.json new file mode 100644 index 000000000..f24831989 --- /dev/null +++ b/workflow/examples/python/contextual_iterative_loop/package.json @@ -0,0 +1,24 @@ +{ + "name": "contextual_iterative_loop", + "version": "1.0.0", + "description": "meta.workflow_packages.contextual_iterative_loop.description", + "author": "AutoMetabuilder", + "license": "MIT", + "keywords": [ + "context", + "loop", + "map-reduce" + ], + "main": "workflow.json", + "metadata": { + "label": "meta.workflow_packages.contextual_iterative_loop.label", + "description": "meta.workflow_packages.contextual_iterative_loop.description", + "tags": [ + "context", + "loop", + "map-reduce" + ], + "icon": "workflow", + "category": "templates" + } +} diff --git a/workflow/examples/python/contextual_iterative_loop/workflow.json b/workflow/examples/python/contextual_iterative_loop/workflow.json new file mode 100644 index 000000000..d71c2e570 --- /dev/null +++ b/workflow/examples/python/contextual_iterative_loop/workflow.json @@ -0,0 +1,187 @@ +{ + "name": "meta.workflow_packages.contextual_iterative_loop.label", + "active": false, + "nodes": [ + { + "id": "list_files", + "name": "List Files", + "type": "tools.list_files", + "typeVersion": 1, + "position": [ + 0, + 50 + ], + "parameters": { + "path": "." + } + }, + { + "id": "filter_python", + "name": "Filter Python", + "type": "utils.filter_list", + "typeVersion": 1, + "position": [ + 300, + 50 + ], + "parameters": { + "items": "$repo_files", + "mode": "regex", + "pattern": "\\.py$" + } + }, + { + "id": "map_python", + "name": "Map Python", + "type": "utils.map_list", + "typeVersion": 1, + "position": [ + 600, + 50 + ], + "parameters": { + "items": "$python_files", + "template": "PY: {item}" + } + }, + { + "id": "reduce_python", + "name": "Reduce Python", + "type": "utils.reduce_list", + "typeVersion": 1, + "position": [ + 900, + 50 + ], + "parameters": { + "items": "$python_lines", + "separator": "\\n" + } + }, + { + "id": "seed_messages", + "name": "Seed Messages", + "type": "core.seed_messages", + "typeVersion": 1, + "position": [ + 1200, + 50 + ], + "parameters": {} + }, + { + "id": "append_repo_summary", + "name": "Append Repo Summary", + "type": "core.append_context_message", + "typeVersion": 1, + "position": [ + 1500, + 50 + ], + "parameters": { + "messages": "$messages", + "context": "$python_summary" + } + }, + { + "id": "append_user_instruction", + "name": "Append User Instruction", + "type": "core.append_user_instruction", + "typeVersion": 1, + "position": [ + 1800, + 50 + ], + "parameters": { + "messages": "$messages" + } + }, + { + "id": "main_loop", + "name": "Main Loop", + "type": "control.loop", + "typeVersion": 1, + "position": [ + 2100, + 50 + ], + "parameters": { + "max_iterations": 5, + "stop_when": "$no_tool_calls", + "stop_on": "true" + } + } + ], + "connections": { + "List Files": { + "main": { + "0": [ + { + "node": "Filter Python", + "type": "main", + "index": 0 + } + ] + } + }, + "Filter Python": { + "main": { + "0": [ + { + "node": "Map Python", + "type": "main", + "index": 0 + } + ] + } + }, + "Map Python": { + "main": { + "0": [ + { + "node": "Reduce Python", + "type": "main", + "index": 0 + } + ] + } + }, + "Append User Instruction": { + "main": { + "0": [ + { + "node": "Append Repo Summary", + "type": "main", + "index": 0 + }, + { + "node": "Append User Instruction", + "type": "main", + "index": 0 + } + ] + } + }, + "Reduce Python": { + "main": { + "0": [ + { + "node": "Append Repo Summary", + "type": "main", + "index": 0 + } + ] + } + } + }, + "triggers": [ + { + "nodeId": "list_files", + "kind": "manual", + "enabled": true, + "meta": { + "description": "Manually triggered meta.workflow_packages.contextual_iterative_loop.label workflow execution" + } + } + ] +} diff --git a/workflow/examples/python/data_processing_demo/package.json b/workflow/examples/python/data_processing_demo/package.json new file mode 100644 index 000000000..c21e9eb71 --- /dev/null +++ b/workflow/examples/python/data_processing_demo/package.json @@ -0,0 +1,24 @@ +{ + "name": "data_processing_demo", + "version": "1.0.0", + "description": "meta.workflow_packages.data_processing_demo.description", + "author": "AutoMetabuilder", + "license": "MIT", + "keywords": [ + "map", + "reduce", + "filter", + "data" + ], + "main": "workflow.json", + "metadata": { + "label": "meta.workflow_packages.data_processing_demo.label", + "description": "meta.workflow_packages.data_processing_demo.description", + "tags": [ + "data", + "processing" + ], + "icon": "workflow", + "category": "templates" + } +} diff --git a/workflow/examples/python/data_processing_demo/workflow.json b/workflow/examples/python/data_processing_demo/workflow.json new file mode 100644 index 000000000..d92a3b5f8 --- /dev/null +++ b/workflow/examples/python/data_processing_demo/workflow.json @@ -0,0 +1,253 @@ +{ + "name": "Data Processing Demo", + "active": false, + "nodes": [ + { + "id": "create_sample_data", + "name": "Create Sample Data", + "type": "var.set", + "typeVersion": 1, + "position": [ + 0, + 50 + ], + "parameters": { + "key": "numbers", + "value": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ] + } + }, + { + "id": "filter_even", + "name": "Filter Even Numbers", + "type": "utils.filter_list", + "typeVersion": 1, + "position": [ + 300, + 50 + ], + "parameters": { + "items": "$numbers", + "mode": "lambda", + "condition": "lambda x: x % 2 == 0" + } + }, + { + "id": "map_square", + "name": "Square Each Number", + "type": "utils.map_list", + "typeVersion": 1, + "position": [ + 600, + 50 + ], + "parameters": { + "items": "$filtered_numbers", + "transform": "lambda x: x * x" + } + }, + { + "id": "reduce_sum", + "name": "Sum All Values", + "type": "math.add", + "typeVersion": 1, + "position": [ + 900, + 50 + ], + "parameters": { + "numbers": "$squared_numbers" + } + }, + { + "id": "check_threshold", + "name": "Check If Sum > 50", + "type": "logic.gt", + "typeVersion": 1, + "position": [ + 1200, + 50 + ], + "parameters": { + "a": "$sum", + "b": 50 + } + }, + { + "id": "branch_result", + "name": "Branch On Result", + "type": "utils.branch_condition", + "typeVersion": 1, + "position": [ + 1500, + 50 + ], + "parameters": { + "condition": "$is_greater" + } + }, + { + "id": "format_success", + "name": "Format Success Message", + "type": "string.format", + "typeVersion": 1, + "position": [ + 1800, + 0 + ], + "parameters": { + "template": "Success! Sum is {sum}, which is greater than 50.", + "variables": { + "sum": "$sum" + } + } + }, + { + "id": "format_failure", + "name": "Format Failure Message", + "type": "string.format", + "typeVersion": 1, + "position": [ + 1800, + 100 + ], + "parameters": { + "template": "Sum is {sum}, which is not greater than 50.", + "variables": { + "sum": "$sum" + } + } + }, + { + "id": "store_result", + "name": "Store Final Result", + "type": "var.set", + "typeVersion": 1, + "position": [ + 2100, + 50 + ], + "parameters": { + "key": "final_message", + "value": "$message" + } + } + ], + "connections": { + "Create Sample Data": { + "main": { + "0": [ + { + "node": "Filter Even Numbers", + "type": "main", + "index": 0 + } + ] + } + }, + "Filter Even Numbers": { + "main": { + "0": [ + { + "node": "Square Each Number", + "type": "main", + "index": 0 + } + ] + } + }, + "Square Each Number": { + "main": { + "0": [ + { + "node": "Sum All Values", + "type": "main", + "index": 0 + } + ] + } + }, + "Sum All Values": { + "main": { + "0": [ + { + "node": "Check If Sum > 50", + "type": "main", + "index": 0 + } + ] + } + }, + "Check If Sum > 50": { + "main": { + "0": [ + { + "node": "Branch On Result", + "type": "main", + "index": 0 + } + ] + } + }, + "Branch On Result": { + "main": { + "0": [ + { + "node": "Format Success Message", + "type": "main", + "index": 0 + } + ], + "1": [ + { + "node": "Format Failure Message", + "type": "main", + "index": 0 + } + ] + } + }, + "Format Success Message": { + "main": { + "0": [ + { + "node": "Store Final Result", + "type": "main", + "index": 0 + } + ] + } + }, + "Format Failure Message": { + "main": { + "0": [ + { + "node": "Store Final Result", + "type": "main", + "index": 0 + } + ] + } + } + }, + "triggers": [ + { + "nodeId": "create_sample_data", + "kind": "manual", + "enabled": true, + "meta": { + "description": "Manually triggered Data Processing Demo workflow execution" + } + } + ] +} diff --git a/workflow/examples/python/default_app_workflow/README.md b/workflow/examples/python/default_app_workflow/README.md new file mode 100644 index 000000000..2b21f1872 --- /dev/null +++ b/workflow/examples/python/default_app_workflow/README.md @@ -0,0 +1,83 @@ +# Default Application Workflow + +The Default Application Workflow is AutoMetabuilder's production-ready system that combines backend initialization with an iterative AI agent loop. It demonstrates the framework's self-referential approach where internal logic is expressed as declarative workflows. + +## Overview + +This workflow package replaces imperative Python code with a declarative JSON-based approach, providing a complete end-to-end workflow that bootstraps the backend and executes the AI loop. + +## Key Components + +### Phase 1: Backend Bootstrap (9 nodes) + +Initializes all required services: +- Message loading from storage +- Metadata configuration +- Prompt template loading +- GitHub client initialization +- OpenAI client initialization +- Tool definitions loading +- Plugin loading and initialization +- Context seeding +- Message seeding + +### Phase 2: AI Agent Loop (8 nodes) + +Executes the core agent through iterative cycles: +1. Loading context +2. Seeding messages +3. Making LLM requests +4. Executing tool calls +5. Appending results + +The loop continues for up to 10 iterations or until no tool calls are returned. + +## Main Advantages + +The workflow-based architecture provides: + +- **Separation of Concerns**: Clear boundaries between initialization and execution +- **Flexibility**: Easy to modify individual nodes without affecting others +- **Observability**: Each node execution can be logged and monitored +- **Extensibility**: New nodes can be added without changing existing ones +- **Visual**: The declarative format enables visual workflow editors +- **Testable**: Individual nodes can be unit tested in isolation +- **Modular**: Components can be reused across different workflows + +## File Structure + +``` +default_app_workflow/ +├── package.json # Package metadata and configuration +├── workflow.json # Workflow definition with nodes and connections +└── README.md # This documentation file +``` + +## Customization + +To create a custom variant: + +1. Copy this package to a new directory +2. Edit the `workflow.json` file to modify nodes or connections +3. Update the `package.json` with new name and description +4. Update any configuration references + +## Related Workflows + +- `backend_bootstrap` - Initialization only +- `single_pass` - Single AI request without loop +- `iterative_loop` - Loop-only without bootstrap +- `plan_execute_summarize` - Advanced planning workflow + +## Architecture Notes + +The system distinguishes between: + +- **Immutable Context**: Configuration and dependencies that don't change during execution +- **Mutable Store**: Execution state that changes as the workflow progresses + +This separation enables both workflow data flow and programmatic access patterns. + +## License + +MIT diff --git a/workflow/examples/python/default_app_workflow/package.json b/workflow/examples/python/default_app_workflow/package.json new file mode 100644 index 000000000..80df15345 --- /dev/null +++ b/workflow/examples/python/default_app_workflow/package.json @@ -0,0 +1,7 @@ +{ + "name": "default_app_workflow", + "version": "1.0.0", + "description": "Default application workflow with backend bootstrap and iterative AI loop", + "keywords": ["backend", "bootstrap", "ai", "iterative", "default"], + "license": "MIT" +} diff --git a/workflow/examples/python/default_app_workflow/workflow.json b/workflow/examples/python/default_app_workflow/workflow.json new file mode 100644 index 000000000..5900bb953 --- /dev/null +++ b/workflow/examples/python/default_app_workflow/workflow.json @@ -0,0 +1,110 @@ +{ + "version": "2.2.0", + "name": "default_app_workflow", + "description": "Default application workflow with backend bootstrap and iterative AI loop", + "active": false, + "trigger": { + "type": "manual", + "node": "load_messages" + }, + "nodes": [ + { + "id": "load_messages", + "type": "operation", + "op": "load_messages", + "description": "Load initial messages from storage" + }, + { + "id": "load_metadata", + "type": "operation", + "op": "load_metadata", + "description": "Load workflow metadata and configuration" + }, + { + "id": "load_prompts", + "type": "operation", + "op": "load_prompts", + "description": "Load prompt templates" + }, + { + "id": "create_github_client", + "type": "operation", + "op": "create_github_client", + "description": "Initialize GitHub API client" + }, + { + "id": "create_openai_client", + "type": "operation", + "op": "create_openai_client", + "description": "Initialize OpenAI API client" + }, + { + "id": "load_tools", + "type": "operation", + "op": "load_tools", + "description": "Load available tool definitions" + }, + { + "id": "load_plugins", + "type": "operation", + "op": "load_plugins", + "description": "Load and initialize plugins" + }, + { + "id": "seed_context", + "type": "operation", + "op": "seed_context", + "description": "Initialize execution context" + }, + { + "id": "seed_messages", + "type": "operation", + "op": "seed_messages", + "description": "Seed initial conversation messages" + }, + { + "id": "append_user_instructions", + "type": "operation", + "op": "append_message", + "description": "Append user instructions to messages" + }, + { + "id": "ai_loop", + "type": "loop", + "max_iterations": 10, + "when": "$no_tool_calls", + "nodes": [ + { + "id": "ai_request", + "type": "operation", + "op": "ai_request", + "description": "Make request to AI model" + }, + { + "id": "execute_tool_calls", + "type": "operation", + "op": "execute_tool_calls", + "description": "Execute any tool calls from AI response" + }, + { + "id": "append_results", + "type": "operation", + "op": "append_results", + "description": "Append tool results to conversation" + } + ] + } + ], + "connections": [ + { "from": "load_messages", "to": "load_metadata" }, + { "from": "load_metadata", "to": "load_prompts" }, + { "from": "load_prompts", "to": "create_github_client" }, + { "from": "create_github_client", "to": "create_openai_client" }, + { "from": "create_openai_client", "to": "load_tools" }, + { "from": "load_tools", "to": "load_plugins" }, + { "from": "load_plugins", "to": "seed_context" }, + { "from": "seed_context", "to": "seed_messages" }, + { "from": "seed_messages", "to": "append_user_instructions" }, + { "from": "append_user_instructions", "to": "ai_loop" } + ] +} diff --git a/workflow/examples/python/dict_plugins_test/package.json b/workflow/examples/python/dict_plugins_test/package.json new file mode 100644 index 000000000..bf8be858a --- /dev/null +++ b/workflow/examples/python/dict_plugins_test/package.json @@ -0,0 +1,16 @@ +{ + "name": "dict_plugins_test", + "version": "1.0.0", + "description": "meta.workflow_packages.dict_plugins_test.description", + "author": "AutoMetabuilder", + "license": "MIT", + "keywords": ["testing", "dict", "unit-test"], + "main": "workflow.json", + "metadata": { + "label": "meta.workflow_packages.dict_plugins_test.label", + "description": "meta.workflow_packages.dict_plugins_test.description", + "tags": ["testing", "dict", "unit-test"], + "icon": "workflow", + "category": "testing" + } +} diff --git a/workflow/examples/python/dict_plugins_test/workflow.json b/workflow/examples/python/dict_plugins_test/workflow.json new file mode 100644 index 000000000..ad51b14c7 --- /dev/null +++ b/workflow/examples/python/dict_plugins_test/workflow.json @@ -0,0 +1,312 @@ +{ + "name": "Dict Plugins Test Suite", + "active": false, + "nodes": [ + { + "id": "test_get", + "name": "Test Get", + "type": "dict.get", + "typeVersion": 1, + "position": [ + 0, + 0 + ], + "parameters": { + "object": { + "name": "Alice", + "age": 30 + }, + "key": "name" + } + }, + { + "id": "assert_get", + "name": "Assert Get Value", + "type": "test.assert_equals", + "typeVersion": 1, + "position": [ + 300, + 0 + ], + "parameters": { + "actual": "$test_get.result", + "expected": "Alice", + "message": "dict.get should retrieve value" + } + }, + { + "id": "assert_get_found", + "name": "Assert Get Found", + "type": "test.assert_true", + "typeVersion": 1, + "position": [ + 600, + 0 + ], + "parameters": { + "value": "$test_get.found", + "message": "dict.get should set found flag" + } + }, + { + "id": "test_set", + "name": "Test Set", + "type": "dict.set", + "typeVersion": 1, + "position": [ + 0, + 100 + ], + "parameters": { + "object": { + "a": 1 + }, + "key": "b", + "value": 2 + } + }, + { + "id": "test_get_new_key", + "name": "Test Get New Key", + "type": "dict.get", + "typeVersion": 1, + "position": [ + 300, + 100 + ], + "parameters": { + "object": "$test_set.result", + "key": "b" + } + }, + { + "id": "assert_set", + "name": "Assert Set Value", + "type": "test.assert_equals", + "typeVersion": 1, + "position": [ + 600, + 100 + ], + "parameters": { + "actual": "$test_get_new_key.result", + "expected": 2, + "message": "dict.set should add new key" + } + }, + { + "id": "test_keys", + "name": "Test Keys", + "type": "dict.keys", + "typeVersion": 1, + "position": [ + 0, + 200 + ], + "parameters": { + "object": { + "a": 1, + "b": 2, + "c": 3 + } + } + }, + { + "id": "assert_keys_length", + "name": "Assert Keys Length", + "type": "list.length", + "typeVersion": 1, + "position": [ + 300, + 200 + ], + "parameters": { + "items": "$test_keys.result" + } + }, + { + "id": "assert_keys", + "name": "Assert Keys Count", + "type": "test.assert_equals", + "typeVersion": 1, + "position": [ + 600, + 200 + ], + "parameters": { + "actual": "$assert_keys_length.result", + "expected": 3, + "message": "dict.keys should return all keys" + } + }, + { + "id": "test_merge", + "name": "Test Merge", + "type": "dict.merge", + "typeVersion": 1, + "position": [ + 0, + 300 + ], + "parameters": { + "objects": [ + { + "a": 1 + }, + { + "b": 2 + }, + { + "c": 3 + } + ] + } + }, + { + "id": "test_merged_keys", + "name": "Get Merged Keys", + "type": "dict.keys", + "typeVersion": 1, + "position": [ + 300, + 300 + ], + "parameters": { + "object": "$test_merge.result" + } + }, + { + "id": "assert_merge_length", + "name": "Assert Merge Length", + "type": "list.length", + "typeVersion": 1, + "position": [ + 600, + 300 + ], + "parameters": { + "items": "$test_merged_keys.result" + } + }, + { + "id": "assert_merge", + "name": "Assert Merge", + "type": "test.assert_equals", + "typeVersion": 1, + "position": [ + 900, + 300 + ], + "parameters": { + "actual": "$assert_merge_length.result", + "expected": 3, + "message": "dict.merge should merge dicts" + } + } + ], + "connections": { + "Test Get": { + "main": { + "0": [ + { + "node": "Assert Get Value", + "type": "main", + "index": 0 + }, + { + "node": "Assert Get Found", + "type": "main", + "index": 0 + } + ] + } + }, + "Test Set": { + "main": { + "0": [ + { + "node": "Test Get New Key", + "type": "main", + "index": 0 + } + ] + } + }, + "Test Get New Key": { + "main": { + "0": [ + { + "node": "Assert Set Value", + "type": "main", + "index": 0 + } + ] + } + }, + "Test Keys": { + "main": { + "0": [ + { + "node": "Assert Keys Length", + "type": "main", + "index": 0 + } + ] + } + }, + "Assert Keys Length": { + "main": { + "0": [ + { + "node": "Assert Keys Count", + "type": "main", + "index": 0 + } + ] + } + }, + "Test Merge": { + "main": { + "0": [ + { + "node": "Get Merged Keys", + "type": "main", + "index": 0 + } + ] + } + }, + "Get Merged Keys": { + "main": { + "0": [ + { + "node": "Assert Merge Length", + "type": "main", + "index": 0 + } + ] + } + }, + "Assert Merge Length": { + "main": { + "0": [ + { + "node": "Assert Merge", + "type": "main", + "index": 0 + } + ] + } + } + }, + "triggers": [ + { + "nodeId": "test_get", + "kind": "manual", + "enabled": true, + "meta": { + "description": "Manually triggered Dict Plugins Test Suite workflow execution" + } + } + ] +} diff --git a/workflow/examples/python/game_tick_loop/package.json b/workflow/examples/python/game_tick_loop/package.json new file mode 100644 index 000000000..c484d384d --- /dev/null +++ b/workflow/examples/python/game_tick_loop/package.json @@ -0,0 +1,24 @@ +{ + "name": "game_tick_loop", + "version": "1.0.0", + "description": "meta.workflow_packages.game_tick_loop.description", + "author": "AutoMetabuilder", + "license": "MIT", + "keywords": [ + "game", + "loop", + "ticks" + ], + "main": "workflow.json", + "metadata": { + "label": "meta.workflow_packages.game_tick_loop.label", + "description": "meta.workflow_packages.game_tick_loop.description", + "tags": [ + "game", + "loop", + "ticks" + ], + "icon": "workflow", + "category": "templates" + } +} diff --git a/workflow/examples/python/game_tick_loop/workflow.json b/workflow/examples/python/game_tick_loop/workflow.json new file mode 100644 index 000000000..b838892b4 --- /dev/null +++ b/workflow/examples/python/game_tick_loop/workflow.json @@ -0,0 +1,123 @@ +{ + "name": "meta.workflow_packages.game_tick_loop.label", + "active": false, + "nodes": [ + { + "id": "seed_messages", + "name": "Seed Messages", + "type": "core.seed_messages", + "typeVersion": 1, + "position": [ + 0, + 50 + ], + "parameters": {} + }, + { + "id": "map_ticks", + "name": "Map Ticks", + "type": "utils.map_list", + "typeVersion": 1, + "position": [ + 300, + 50 + ], + "parameters": { + "items": [ + "tick_start", + "tick_update", + "tick_render" + ], + "template": "Tick: {item}" + } + }, + { + "id": "reduce_ticks", + "name": "Reduce Ticks", + "type": "utils.reduce_list", + "typeVersion": 1, + "position": [ + 600, + 50 + ], + "parameters": { + "items": "$tick_lines", + "separator": "\\n" + } + }, + { + "id": "append_tick_context", + "name": "Append Tick Context", + "type": "core.append_context_message", + "typeVersion": 1, + "position": [ + 900, + 50 + ], + "parameters": { + "messages": "$messages", + "context": "$tick_context" + } + }, + { + "id": "main_loop", + "name": "Main Loop", + "type": "control.loop", + "typeVersion": 1, + "position": [ + 1200, + 50 + ], + "parameters": { + "max_iterations": 3, + "stop_when": "$no_tool_calls", + "stop_on": "true" + } + } + ], + "connections": { + "Map Ticks": { + "main": { + "0": [ + { + "node": "Reduce Ticks", + "type": "main", + "index": 0 + } + ] + } + }, + "Append Tick Context": { + "main": { + "0": [ + { + "node": "Append Tick Context", + "type": "main", + "index": 0 + } + ] + } + }, + "Reduce Ticks": { + "main": { + "0": [ + { + "node": "Append Tick Context", + "type": "main", + "index": 0 + } + ] + } + } + }, + "triggers": [ + { + "nodeId": "seed_messages", + "kind": "manual", + "enabled": true, + "meta": { + "description": "Manually triggered meta.workflow_packages.game_tick_loop.label workflow execution" + } + } + ] +} diff --git a/workflow/examples/python/iterative_loop/package.json b/workflow/examples/python/iterative_loop/package.json new file mode 100644 index 000000000..b768272b0 --- /dev/null +++ b/workflow/examples/python/iterative_loop/package.json @@ -0,0 +1,22 @@ +{ + "name": "iterative_loop", + "version": "1.0.0", + "description": "meta.workflow_packages.iterative_loop.description", + "author": "AutoMetabuilder", + "license": "MIT", + "keywords": [ + "loop", + "tools" + ], + "main": "workflow.json", + "metadata": { + "label": "meta.workflow_packages.iterative_loop.label", + "description": "meta.workflow_packages.iterative_loop.description", + "tags": [ + "loop", + "tools" + ], + "icon": "workflow", + "category": "templates" + } +} diff --git a/workflow/examples/python/iterative_loop/workflow.json b/workflow/examples/python/iterative_loop/workflow.json new file mode 100644 index 000000000..b96663936 --- /dev/null +++ b/workflow/examples/python/iterative_loop/workflow.json @@ -0,0 +1,198 @@ +{ + "name": "Iterative Agent Loop", + "active": false, + "nodes": [ + { + "id": "load_context", + "name": "Load Context", + "type": "core.load_context", + "typeVersion": 1, + "position": [ + 0, + 0 + ], + "parameters": {} + }, + { + "id": "seed_messages", + "name": "Seed Messages", + "type": "core.seed_messages", + "typeVersion": 1, + "position": [ + 0, + 100 + ], + "parameters": {} + }, + { + "id": "append_context", + "name": "Append Context", + "type": "core.append_context_message", + "typeVersion": 1, + "position": [ + 300, + 50 + ], + "parameters": {} + }, + { + "id": "append_user_instruction", + "name": "Append User Instruction", + "type": "core.append_user_instruction", + "typeVersion": 1, + "position": [ + 600, + 50 + ], + "parameters": {} + }, + { + "id": "main_loop", + "name": "Main Loop", + "type": "control.loop", + "typeVersion": 1, + "position": [ + 900, + 50 + ], + "parameters": { + "max_iterations": 10, + "stop_when": "$no_tool_calls", + "stop_on": "true" + } + }, + { + "id": "ai_request", + "name": "AI Request", + "type": "core.ai_request", + "typeVersion": 1, + "position": [ + 1200, + 50 + ], + "parameters": {} + }, + { + "id": "run_tool_calls", + "name": "Run Tool Calls", + "type": "core.run_tool_calls", + "typeVersion": 1, + "position": [ + 1500, + 50 + ], + "parameters": {} + }, + { + "id": "append_tool_results", + "name": "Append Tool Results", + "type": "core.append_tool_results", + "typeVersion": 1, + "position": [ + 1800, + 50 + ], + "parameters": {} + } + ], + "connections": { + "Load Context": { + "main": { + "0": [ + { + "node": "Append Context", + "type": "main", + "index": 0 + } + ] + } + }, + "Seed Messages": { + "main": { + "0": [ + { + "node": "Append Context", + "type": "main", + "index": 0 + } + ] + } + }, + "Append Context": { + "main": { + "0": [ + { + "node": "Append User Instruction", + "type": "main", + "index": 0 + } + ] + } + }, + "Append User Instruction": { + "main": { + "0": [ + { + "node": "Main Loop", + "type": "main", + "index": 0 + } + ] + } + }, + "Main Loop": { + "main": { + "0": [ + { + "node": "AI Request", + "type": "main", + "index": 0 + } + ] + } + }, + "AI Request": { + "main": { + "0": [ + { + "node": "Run Tool Calls", + "type": "main", + "index": 0 + } + ] + } + }, + "Run Tool Calls": { + "main": { + "0": [ + { + "node": "Append Tool Results", + "type": "main", + "index": 0 + } + ] + } + }, + "Append Tool Results": { + "main": { + "0": [ + { + "node": "Main Loop", + "type": "main", + "index": 0 + } + ] + } + } + }, + "triggers": [ + { + "nodeId": "load_context", + "kind": "manual", + "enabled": true, + "meta": { + "description": "Manually triggered Iterative Agent Loop workflow execution" + } + } + ] +} diff --git a/workflow/examples/python/list_plugins_test/package.json b/workflow/examples/python/list_plugins_test/package.json new file mode 100644 index 000000000..532d8c499 --- /dev/null +++ b/workflow/examples/python/list_plugins_test/package.json @@ -0,0 +1,16 @@ +{ + "name": "list_plugins_test", + "version": "1.0.0", + "description": "meta.workflow_packages.list_plugins_test.description", + "author": "AutoMetabuilder", + "license": "MIT", + "keywords": ["testing", "list", "unit-test"], + "main": "workflow.json", + "metadata": { + "label": "meta.workflow_packages.list_plugins_test.label", + "description": "meta.workflow_packages.list_plugins_test.description", + "tags": ["testing", "list", "unit-test"], + "icon": "workflow", + "category": "testing" + } +} diff --git a/workflow/examples/python/list_plugins_test/workflow.json b/workflow/examples/python/list_plugins_test/workflow.json new file mode 100644 index 000000000..7e3527c35 --- /dev/null +++ b/workflow/examples/python/list_plugins_test/workflow.json @@ -0,0 +1,277 @@ +{ + "name": "List Plugins Test Suite", + "active": false, + "nodes": [ + { + "id": "test_concat", + "name": "Test Concat", + "type": "list.concat", + "typeVersion": 1, + "position": [ + 0, + 0 + ], + "parameters": { + "lists": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 5 + ] + ] + } + }, + { + "id": "assert_concat_length", + "name": "Assert Concat Length", + "type": "list.length", + "typeVersion": 1, + "position": [ + 300, + 0 + ], + "parameters": { + "items": "$test_concat.result" + } + }, + { + "id": "assert_concat", + "name": "Assert Concat", + "type": "test.assert_equals", + "typeVersion": 1, + "position": [ + 600, + 0 + ], + "parameters": { + "actual": "$assert_concat_length.result", + "expected": 5, + "message": "list.concat should concatenate lists" + } + }, + { + "id": "test_length", + "name": "Test Length", + "type": "list.length", + "typeVersion": 1, + "position": [ + 0, + 100 + ], + "parameters": { + "items": [ + 1, + 2, + 3, + 4, + 5 + ] + } + }, + { + "id": "assert_length", + "name": "Assert Length", + "type": "test.assert_equals", + "typeVersion": 1, + "position": [ + 300, + 100 + ], + "parameters": { + "actual": "$test_length.result", + "expected": 5, + "message": "list.length should count items" + } + }, + { + "id": "test_slice", + "name": "Test Slice", + "type": "list.slice", + "typeVersion": 1, + "position": [ + 0, + 200 + ], + "parameters": { + "items": [ + 1, + 2, + 3, + 4, + 5 + ], + "start": 1, + "end": 3 + } + }, + { + "id": "assert_slice_length", + "name": "Assert Slice Length", + "type": "list.length", + "typeVersion": 1, + "position": [ + 300, + 200 + ], + "parameters": { + "items": "$test_slice.result" + } + }, + { + "id": "assert_slice", + "name": "Assert Slice", + "type": "test.assert_equals", + "typeVersion": 1, + "position": [ + 600, + 200 + ], + "parameters": { + "actual": "$assert_slice_length.result", + "expected": 2, + "message": "list.slice should extract slice" + } + }, + { + "id": "test_find", + "name": "Test Find", + "type": "list.find", + "typeVersion": 1, + "position": [ + 0, + 300 + ], + "parameters": { + "items": [ + { + "id": 1, + "name": "Alice" + }, + { + "id": 2, + "name": "Bob" + } + ], + "key": "name", + "value": "Bob" + } + }, + { + "id": "assert_find", + "name": "Assert Find Result", + "type": "test.assert_exists", + "typeVersion": 1, + "position": [ + 300, + 300 + ], + "parameters": { + "value": "$test_find.result", + "message": "list.find should find item" + } + }, + { + "id": "assert_find_found", + "name": "Assert Found Flag", + "type": "test.assert_true", + "typeVersion": 1, + "position": [ + 600, + 300 + ], + "parameters": { + "value": "$test_find.found", + "message": "list.find should set found flag" + } + } + ], + "connections": { + "Test Concat": { + "main": { + "0": [ + { + "node": "Assert Concat Length", + "type": "main", + "index": 0 + } + ] + } + }, + "Assert Concat Length": { + "main": { + "0": [ + { + "node": "Assert Concat", + "type": "main", + "index": 0 + } + ] + } + }, + "Test Length": { + "main": { + "0": [ + { + "node": "Assert Length", + "type": "main", + "index": 0 + } + ] + } + }, + "Test Slice": { + "main": { + "0": [ + { + "node": "Assert Slice Length", + "type": "main", + "index": 0 + } + ] + } + }, + "Assert Slice Length": { + "main": { + "0": [ + { + "node": "Assert Slice", + "type": "main", + "index": 0 + } + ] + } + }, + "Test Find": { + "main": { + "0": [ + { + "node": "Assert Find Result", + "type": "main", + "index": 0 + }, + { + "node": "Assert Found Flag", + "type": "main", + "index": 0 + } + ] + } + } + }, + "triggers": [ + { + "nodeId": "test_concat", + "kind": "manual", + "enabled": true, + "meta": { + "description": "Manually triggered List Plugins Test Suite workflow execution" + } + } + ] +} diff --git a/workflow/examples/python/logic_plugins_test/package.json b/workflow/examples/python/logic_plugins_test/package.json new file mode 100644 index 000000000..4195917a2 --- /dev/null +++ b/workflow/examples/python/logic_plugins_test/package.json @@ -0,0 +1,24 @@ +{ + "name": "logic_plugins_test", + "version": "1.0.0", + "description": "meta.workflow_packages.logic_plugins_test.description", + "author": "AutoMetabuilder", + "license": "MIT", + "keywords": [ + "testing", + "logic", + "unit-test" + ], + "main": "workflow.json", + "metadata": { + "label": "meta.workflow_packages.logic_plugins_test.label", + "description": "meta.workflow_packages.logic_plugins_test.description", + "tags": [ + "testing", + "logic", + "unit-test" + ], + "icon": "workflow", + "category": "testing" + } +} diff --git a/workflow/examples/python/logic_plugins_test/workflow.json b/workflow/examples/python/logic_plugins_test/workflow.json new file mode 100644 index 000000000..6b7908277 --- /dev/null +++ b/workflow/examples/python/logic_plugins_test/workflow.json @@ -0,0 +1,342 @@ +{ + "name": "Logic Plugins Test Suite", + "active": false, + "nodes": [ + { + "id": "test_and_true", + "name": "Test AND (all true)", + "type": "logic.and", + "typeVersion": 1, + "position": [ + 0, + 0 + ], + "parameters": { + "values": [ + true, + true, + true + ] + } + }, + { + "id": "assert_and_true", + "name": "Assert AND result is true", + "type": "test.assert_true", + "typeVersion": 1, + "position": [ + 300, + 0 + ], + "parameters": { + "value": "$test_and_true.result", + "message": "logic.and with all true values should return true" + } + }, + { + "id": "test_and_false", + "name": "Test AND (with false)", + "type": "logic.and", + "typeVersion": 1, + "position": [ + 0, + 100 + ], + "parameters": { + "values": [ + true, + false, + true + ] + } + }, + { + "id": "assert_and_false", + "name": "Assert AND result is false", + "type": "test.assert_false", + "typeVersion": 1, + "position": [ + 300, + 100 + ], + "parameters": { + "value": "$test_and_false.result", + "message": "logic.and with any false value should return false" + } + }, + { + "id": "test_or_true", + "name": "Test OR (with true)", + "type": "logic.or", + "typeVersion": 1, + "position": [ + 0, + 200 + ], + "parameters": { + "values": [ + false, + false, + true + ] + } + }, + { + "id": "assert_or_true", + "name": "Assert OR result is true", + "type": "test.assert_true", + "typeVersion": 1, + "position": [ + 300, + 200 + ], + "parameters": { + "value": "$test_or_true.result", + "message": "logic.or with any true value should return true" + } + }, + { + "id": "test_or_false", + "name": "Test OR (all false)", + "type": "logic.or", + "typeVersion": 1, + "position": [ + 0, + 300 + ], + "parameters": { + "values": [ + false, + false, + false + ] + } + }, + { + "id": "assert_or_false", + "name": "Assert OR result is false", + "type": "test.assert_false", + "typeVersion": 1, + "position": [ + 300, + 300 + ], + "parameters": { + "value": "$test_or_false.result", + "message": "logic.or with all false values should return false" + } + }, + { + "id": "test_equals_true", + "name": "Test Equals (same)", + "type": "logic.equals", + "typeVersion": 1, + "position": [ + 0, + 400 + ], + "parameters": { + "a": 42, + "b": 42 + } + }, + { + "id": "assert_equals_true", + "name": "Assert Equals is true", + "type": "test.assert_true", + "typeVersion": 1, + "position": [ + 300, + 400 + ], + "parameters": { + "value": "$test_equals_true.result", + "message": "logic.equals with same values should return true" + } + }, + { + "id": "test_equals_false", + "name": "Test Equals (different)", + "type": "logic.equals", + "typeVersion": 1, + "position": [ + 0, + 500 + ], + "parameters": { + "a": 42, + "b": 24 + } + }, + { + "id": "assert_equals_false", + "name": "Assert Equals is false", + "type": "test.assert_false", + "typeVersion": 1, + "position": [ + 300, + 500 + ], + "parameters": { + "value": "$test_equals_false.result", + "message": "logic.equals with different values should return false" + } + }, + { + "id": "test_gt", + "name": "Test Greater Than", + "type": "logic.gt", + "typeVersion": 1, + "position": [ + 0, + 600 + ], + "parameters": { + "a": 10, + "b": 5 + } + }, + { + "id": "assert_gt", + "name": "Assert GT is true", + "type": "test.assert_true", + "typeVersion": 1, + "position": [ + 300, + 600 + ], + "parameters": { + "value": "$test_gt.result", + "message": "logic.gt should return true when a > b" + } + }, + { + "id": "test_lt", + "name": "Test Less Than", + "type": "logic.lt", + "typeVersion": 1, + "position": [ + 0, + 700 + ], + "parameters": { + "a": 3, + "b": 7 + } + }, + { + "id": "assert_lt", + "name": "Assert LT is true", + "type": "test.assert_true", + "typeVersion": 1, + "position": [ + 300, + 700 + ], + "parameters": { + "value": "$test_lt.result", + "message": "logic.lt should return true when a < b" + } + } + ], + "connections": { + "Test AND (all true)": { + "main": { + "0": [ + { + "node": "Assert AND result is true", + "type": "main", + "index": 0 + } + ] + } + }, + "Test AND (with false)": { + "main": { + "0": [ + { + "node": "Assert AND result is false", + "type": "main", + "index": 0 + } + ] + } + }, + "Test OR (with true)": { + "main": { + "0": [ + { + "node": "Assert OR result is true", + "type": "main", + "index": 0 + } + ] + } + }, + "Test OR (all false)": { + "main": { + "0": [ + { + "node": "Assert OR result is false", + "type": "main", + "index": 0 + } + ] + } + }, + "Test Equals (same)": { + "main": { + "0": [ + { + "node": "Assert Equals is true", + "type": "main", + "index": 0 + } + ] + } + }, + "Test Equals (different)": { + "main": { + "0": [ + { + "node": "Assert Equals is false", + "type": "main", + "index": 0 + } + ] + } + }, + "Test Greater Than": { + "main": { + "0": [ + { + "node": "Assert GT is true", + "type": "main", + "index": 0 + } + ] + } + }, + "Test Less Than": { + "main": { + "0": [ + { + "node": "Assert LT is true", + "type": "main", + "index": 0 + } + ] + } + } + }, + "triggers": [ + { + "nodeId": "test_and_true", + "kind": "manual", + "enabled": true, + "meta": { + "description": "Manually triggered Logic Plugins Test Suite workflow execution" + } + } + ] +} diff --git a/workflow/examples/python/math_plugins_test/package.json b/workflow/examples/python/math_plugins_test/package.json new file mode 100644 index 000000000..2d513e572 --- /dev/null +++ b/workflow/examples/python/math_plugins_test/package.json @@ -0,0 +1,16 @@ +{ + "name": "math_plugins_test", + "version": "1.0.0", + "description": "meta.workflow_packages.math_plugins_test.description", + "author": "AutoMetabuilder", + "license": "MIT", + "keywords": ["testing", "math", "unit-test"], + "main": "workflow.json", + "metadata": { + "label": "meta.workflow_packages.math_plugins_test.label", + "description": "meta.workflow_packages.math_plugins_test.description", + "tags": ["testing", "math", "unit-test"], + "icon": "workflow", + "category": "testing" + } +} diff --git a/workflow/examples/python/math_plugins_test/workflow.json b/workflow/examples/python/math_plugins_test/workflow.json new file mode 100644 index 000000000..98a52f1ba --- /dev/null +++ b/workflow/examples/python/math_plugins_test/workflow.json @@ -0,0 +1,276 @@ +{ + "name": "Math Plugins Test Suite", + "active": false, + "nodes": [ + { + "id": "test_add", + "name": "Test Add", + "type": "math.add", + "typeVersion": 1, + "position": [ + 0, + 0 + ], + "parameters": { + "numbers": [ + 1, + 2, + 3, + 4, + 5 + ] + } + }, + { + "id": "assert_add", + "name": "Assert Add equals 15", + "type": "test.assert_equals", + "typeVersion": 1, + "position": [ + 300, + 0 + ], + "parameters": { + "actual": "$test_add.result", + "expected": 15, + "message": "math.add should sum all numbers" + } + }, + { + "id": "test_multiply", + "name": "Test Multiply", + "type": "math.multiply", + "typeVersion": 1, + "position": [ + 0, + 100 + ], + "parameters": { + "numbers": [ + 2, + 3, + 4 + ] + } + }, + { + "id": "assert_multiply", + "name": "Assert Multiply equals 24", + "type": "test.assert_equals", + "typeVersion": 1, + "position": [ + 300, + 100 + ], + "parameters": { + "actual": "$test_multiply.result", + "expected": 24, + "message": "math.multiply should multiply all numbers" + } + }, + { + "id": "test_subtract", + "name": "Test Subtract", + "type": "math.subtract", + "typeVersion": 1, + "position": [ + 0, + 200 + ], + "parameters": { + "a": 10, + "b": 3 + } + }, + { + "id": "assert_subtract", + "name": "Assert Subtract equals 7", + "type": "test.assert_equals", + "typeVersion": 1, + "position": [ + 300, + 200 + ], + "parameters": { + "actual": "$test_subtract.result", + "expected": 7, + "message": "math.subtract should return a - b" + } + }, + { + "id": "test_divide", + "name": "Test Divide", + "type": "math.divide", + "typeVersion": 1, + "position": [ + 0, + 300 + ], + "parameters": { + "a": 20, + "b": 4 + } + }, + { + "id": "assert_divide", + "name": "Assert Divide equals 5", + "type": "test.assert_equals", + "typeVersion": 1, + "position": [ + 300, + 300 + ], + "parameters": { + "actual": "$test_divide.result", + "expected": 5, + "message": "math.divide should return a / b" + } + }, + { + "id": "test_max", + "name": "Test Max", + "type": "math.max", + "typeVersion": 1, + "position": [ + 0, + 400 + ], + "parameters": { + "numbers": [ + 3, + 7, + 2, + 9, + 1 + ] + } + }, + { + "id": "assert_max", + "name": "Assert Max equals 9", + "type": "test.assert_equals", + "typeVersion": 1, + "position": [ + 300, + 400 + ], + "parameters": { + "actual": "$test_max.result", + "expected": 9, + "message": "math.max should return maximum value" + } + }, + { + "id": "test_min", + "name": "Test Min", + "type": "math.min", + "typeVersion": 1, + "position": [ + 0, + 500 + ], + "parameters": { + "numbers": [ + 3, + 7, + 2, + 9, + 1 + ] + } + }, + { + "id": "assert_min", + "name": "Assert Min equals 1", + "type": "test.assert_equals", + "typeVersion": 1, + "position": [ + 300, + 500 + ], + "parameters": { + "actual": "$test_min.result", + "expected": 1, + "message": "math.min should return minimum value" + } + } + ], + "connections": { + "Test Add": { + "main": { + "0": [ + { + "node": "Assert Add equals 15", + "type": "main", + "index": 0 + } + ] + } + }, + "Test Multiply": { + "main": { + "0": [ + { + "node": "Assert Multiply equals 24", + "type": "main", + "index": 0 + } + ] + } + }, + "Test Subtract": { + "main": { + "0": [ + { + "node": "Assert Subtract equals 7", + "type": "main", + "index": 0 + } + ] + } + }, + "Test Divide": { + "main": { + "0": [ + { + "node": "Assert Divide equals 5", + "type": "main", + "index": 0 + } + ] + } + }, + "Test Max": { + "main": { + "0": [ + { + "node": "Assert Max equals 9", + "type": "main", + "index": 0 + } + ] + } + }, + "Test Min": { + "main": { + "0": [ + { + "node": "Assert Min equals 1", + "type": "main", + "index": 0 + } + ] + } + } + }, + "triggers": [ + { + "nodeId": "test_add", + "kind": "manual", + "enabled": true, + "meta": { + "description": "Manually triggered Math Plugins Test Suite workflow execution" + } + } + ] +} diff --git a/workflow/examples/python/plan_execute_summarize/package.json b/workflow/examples/python/plan_execute_summarize/package.json new file mode 100644 index 000000000..16835f1c3 --- /dev/null +++ b/workflow/examples/python/plan_execute_summarize/package.json @@ -0,0 +1,22 @@ +{ + "name": "plan_execute_summarize", + "version": "1.0.0", + "description": "meta.workflow_packages.plan_execute_summarize.description", + "author": "AutoMetabuilder", + "license": "MIT", + "keywords": [ + "plan", + "summarize" + ], + "main": "workflow.json", + "metadata": { + "label": "meta.workflow_packages.plan_execute_summarize.label", + "description": "meta.workflow_packages.plan_execute_summarize.description", + "tags": [ + "plan", + "summarize" + ], + "icon": "workflow", + "category": "templates" + } +} diff --git a/workflow/examples/python/plan_execute_summarize/workflow.json b/workflow/examples/python/plan_execute_summarize/workflow.json new file mode 100644 index 000000000..cb3f31752 --- /dev/null +++ b/workflow/examples/python/plan_execute_summarize/workflow.json @@ -0,0 +1,184 @@ +{ + "name": "meta.workflow_packages.plan_execute_summarize.label", + "active": false, + "nodes": [ + { + "id": "load_context", + "name": "Load Context", + "type": "core.load_context", + "typeVersion": 1, + "position": [ + 0, + 50 + ], + "parameters": {} + }, + { + "id": "seed_messages", + "name": "Seed Messages", + "type": "core.seed_messages", + "typeVersion": 1, + "position": [ + 300, + 50 + ], + "parameters": {} + }, + { + "id": "append_context", + "name": "Append Context", + "type": "core.append_context_message", + "typeVersion": 1, + "position": [ + 600, + 50 + ], + "parameters": { + "messages": "$messages", + "context": "$sdlc_context" + } + }, + { + "id": "append_user_instruction", + "name": "Append User Instruction", + "type": "core.append_user_instruction", + "typeVersion": 1, + "position": [ + 900, + 50 + ], + "parameters": { + "messages": "$messages" + } + }, + { + "id": "planner_request", + "name": "Planner Request", + "type": "core.ai_request", + "typeVersion": 1, + "position": [ + 1200, + 50 + ], + "parameters": { + "messages": "$messages" + } + }, + { + "id": "run_tool_calls", + "name": "Run Tool Calls", + "type": "core.run_tool_calls", + "typeVersion": 1, + "position": [ + 1500, + 50 + ], + "parameters": { + "response": "$llm_response" + } + }, + { + "id": "append_tool_results", + "name": "Append Tool Results", + "type": "core.append_tool_results", + "typeVersion": 1, + "position": [ + 1800, + 50 + ], + "parameters": { + "messages": "$messages", + "tool_results": "$tool_results" + } + }, + { + "id": "summary_request", + "name": "Summary Request", + "type": "core.ai_request", + "typeVersion": 1, + "position": [ + 2100, + 50 + ], + "parameters": { + "messages": "$messages" + } + } + ], + "connections": { + "Append Tool Results": { + "main": { + "0": [ + { + "node": "Append Context", + "type": "main", + "index": 0 + }, + { + "node": "Append User Instruction", + "type": "main", + "index": 0 + }, + { + "node": "Planner Request", + "type": "main", + "index": 0 + }, + { + "node": "Append Tool Results", + "type": "main", + "index": 0 + }, + { + "node": "Summary Request", + "type": "main", + "index": 0 + } + ] + } + }, + "Load Context": { + "main": { + "0": [ + { + "node": "Append Context", + "type": "main", + "index": 0 + } + ] + } + }, + "Planner Request": { + "main": { + "0": [ + { + "node": "Run Tool Calls", + "type": "main", + "index": 0 + } + ] + } + }, + "Run Tool Calls": { + "main": { + "0": [ + { + "node": "Append Tool Results", + "type": "main", + "index": 0 + } + ] + } + } + }, + "triggers": [ + { + "nodeId": "load_context", + "kind": "manual", + "enabled": true, + "meta": { + "description": "Manually triggered meta.workflow_packages.plan_execute_summarize.label workflow execution" + } + } + ] +} diff --git a/workflow/examples/python/repo_scan_context/package.json b/workflow/examples/python/repo_scan_context/package.json new file mode 100644 index 000000000..7262e1093 --- /dev/null +++ b/workflow/examples/python/repo_scan_context/package.json @@ -0,0 +1,24 @@ +{ + "name": "repo_scan_context", + "version": "1.0.0", + "description": "meta.workflow_packages.repo_scan_context.description", + "author": "AutoMetabuilder", + "license": "MIT", + "keywords": [ + "map", + "reduce", + "context" + ], + "main": "workflow.json", + "metadata": { + "label": "meta.workflow_packages.repo_scan_context.label", + "description": "meta.workflow_packages.repo_scan_context.description", + "tags": [ + "map", + "reduce", + "context" + ], + "icon": "workflow", + "category": "templates" + } +} diff --git a/workflow/examples/python/repo_scan_context/workflow.json b/workflow/examples/python/repo_scan_context/workflow.json new file mode 100644 index 000000000..65efcb2ae --- /dev/null +++ b/workflow/examples/python/repo_scan_context/workflow.json @@ -0,0 +1,219 @@ +{ + "name": "meta.workflow_packages.repo_scan_context.label", + "active": false, + "nodes": [ + { + "id": "list_files", + "name": "List Files", + "type": "tools.list_files", + "typeVersion": 1, + "position": [ + 0, + 50 + ], + "parameters": { + "path": "." + } + }, + { + "id": "filter_python", + "name": "Filter Python", + "type": "utils.filter_list", + "typeVersion": 1, + "position": [ + 300, + 50 + ], + "parameters": { + "items": "$repo_files", + "mode": "regex", + "pattern": "\\.py$" + } + }, + { + "id": "reduce_python", + "name": "Reduce Python", + "type": "utils.reduce_list", + "typeVersion": 1, + "position": [ + 600, + 50 + ], + "parameters": { + "items": "$python_files", + "separator": "\\n" + } + }, + { + "id": "seed_messages", + "name": "Seed Messages", + "type": "core.seed_messages", + "typeVersion": 1, + "position": [ + 900, + 50 + ], + "parameters": {} + }, + { + "id": "append_repo_summary", + "name": "Append Repo Summary", + "type": "core.append_context_message", + "typeVersion": 1, + "position": [ + 1200, + 50 + ], + "parameters": { + "messages": "$messages", + "context": "$python_summary" + } + }, + { + "id": "append_user_instruction", + "name": "Append User Instruction", + "type": "core.append_user_instruction", + "typeVersion": 1, + "position": [ + 1500, + 50 + ], + "parameters": { + "messages": "$messages" + } + }, + { + "id": "ai_request", + "name": "Ai Request", + "type": "core.ai_request", + "typeVersion": 1, + "position": [ + 1800, + 50 + ], + "parameters": { + "messages": "$messages" + } + }, + { + "id": "run_tool_calls", + "name": "Run Tool Calls", + "type": "core.run_tool_calls", + "typeVersion": 1, + "position": [ + 2100, + 50 + ], + "parameters": { + "response": "$llm_response" + } + }, + { + "id": "append_tool_results", + "name": "Append Tool Results", + "type": "core.append_tool_results", + "typeVersion": 1, + "position": [ + 2400, + 50 + ], + "parameters": { + "messages": "$messages", + "tool_results": "$tool_results" + } + } + ], + "connections": { + "List Files": { + "main": { + "0": [ + { + "node": "Filter Python", + "type": "main", + "index": 0 + } + ] + } + }, + "Filter Python": { + "main": { + "0": [ + { + "node": "Reduce Python", + "type": "main", + "index": 0 + } + ] + } + }, + "Append Tool Results": { + "main": { + "0": [ + { + "node": "Append Repo Summary", + "type": "main", + "index": 0 + }, + { + "node": "Append User Instruction", + "type": "main", + "index": 0 + }, + { + "node": "Ai Request", + "type": "main", + "index": 0 + }, + { + "node": "Append Tool Results", + "type": "main", + "index": 0 + } + ] + } + }, + "Reduce Python": { + "main": { + "0": [ + { + "node": "Append Repo Summary", + "type": "main", + "index": 0 + } + ] + } + }, + "Ai Request": { + "main": { + "0": [ + { + "node": "Run Tool Calls", + "type": "main", + "index": 0 + } + ] + } + }, + "Run Tool Calls": { + "main": { + "0": [ + { + "node": "Append Tool Results", + "type": "main", + "index": 0 + } + ] + } + } + }, + "triggers": [ + { + "nodeId": "list_files", + "kind": "manual", + "enabled": true, + "meta": { + "description": "Manually triggered meta.workflow_packages.repo_scan_context.label workflow execution" + } + } + ] +} diff --git a/workflow/examples/python/single_pass/package.json b/workflow/examples/python/single_pass/package.json new file mode 100644 index 000000000..86e5253b7 --- /dev/null +++ b/workflow/examples/python/single_pass/package.json @@ -0,0 +1,22 @@ +{ + "name": "single_pass", + "version": "1.0.0", + "description": "meta.workflow_packages.single_pass.description", + "author": "AutoMetabuilder", + "license": "MIT", + "keywords": [ + "single", + "tools" + ], + "main": "workflow.json", + "metadata": { + "label": "meta.workflow_packages.single_pass.label", + "description": "meta.workflow_packages.single_pass.description", + "tags": [ + "single", + "tools" + ], + "icon": "workflow", + "category": "templates" + } +} diff --git a/workflow/examples/python/single_pass/workflow.json b/workflow/examples/python/single_pass/workflow.json new file mode 100644 index 000000000..1459d6d9d --- /dev/null +++ b/workflow/examples/python/single_pass/workflow.json @@ -0,0 +1,161 @@ +{ + "name": "Single Pass", + "active": false, + "nodes": [ + { + "id": "load_context", + "name": "Load Context", + "type": "core.load_context", + "typeVersion": 1, + "position": [ + 0, + 0 + ], + "parameters": {} + }, + { + "id": "seed_messages", + "name": "Seed Messages", + "type": "core.seed_messages", + "typeVersion": 1, + "position": [ + 0, + 100 + ], + "parameters": {} + }, + { + "id": "append_context", + "name": "Append Context", + "type": "core.append_context_message", + "typeVersion": 1, + "position": [ + 300, + 50 + ], + "parameters": {} + }, + { + "id": "append_user_instruction", + "name": "Append User Instruction", + "type": "core.append_user_instruction", + "typeVersion": 1, + "position": [ + 600, + 50 + ], + "parameters": {} + }, + { + "id": "ai_request", + "name": "AI Request", + "type": "core.ai_request", + "typeVersion": 1, + "position": [ + 900, + 50 + ], + "parameters": {} + }, + { + "id": "run_tool_calls", + "name": "Run Tool Calls", + "type": "core.run_tool_calls", + "typeVersion": 1, + "position": [ + 1200, + 50 + ], + "parameters": {} + }, + { + "id": "append_tool_results", + "name": "Append Tool Results", + "type": "core.append_tool_results", + "typeVersion": 1, + "position": [ + 1500, + 50 + ], + "parameters": {} + } + ], + "connections": { + "Load Context": { + "main": { + "0": [ + { + "node": "Append Context", + "type": "main", + "index": 0 + } + ] + } + }, + "Seed Messages": { + "main": { + "0": [ + { + "node": "Append Context", + "type": "main", + "index": 0 + } + ] + } + }, + "Append Context": { + "main": { + "0": [ + { + "node": "Append User Instruction", + "type": "main", + "index": 0 + } + ] + } + }, + "Append User Instruction": { + "main": { + "0": [ + { + "node": "AI Request", + "type": "main", + "index": 0 + } + ] + } + }, + "AI Request": { + "main": { + "0": [ + { + "node": "Run Tool Calls", + "type": "main", + "index": 0 + } + ] + } + }, + "Run Tool Calls": { + "main": { + "0": [ + { + "node": "Append Tool Results", + "type": "main", + "index": 0 + } + ] + } + } + }, + "triggers": [ + { + "nodeId": "load_context", + "kind": "manual", + "enabled": true, + "meta": { + "description": "Manually triggered single-pass workflow execution" + } + } + ] +} diff --git a/workflow/examples/python/string_plugins_test/package.json b/workflow/examples/python/string_plugins_test/package.json new file mode 100644 index 000000000..2b7002e43 --- /dev/null +++ b/workflow/examples/python/string_plugins_test/package.json @@ -0,0 +1,16 @@ +{ + "name": "string_plugins_test", + "version": "1.0.0", + "description": "meta.workflow_packages.string_plugins_test.description", + "author": "AutoMetabuilder", + "license": "MIT", + "keywords": ["testing", "string", "unit-test"], + "main": "workflow.json", + "metadata": { + "label": "meta.workflow_packages.string_plugins_test.label", + "description": "meta.workflow_packages.string_plugins_test.description", + "tags": ["testing", "string", "unit-test"], + "icon": "workflow", + "category": "testing" + } +} diff --git a/workflow/examples/python/string_plugins_test/workflow.json b/workflow/examples/python/string_plugins_test/workflow.json new file mode 100644 index 000000000..f05070387 --- /dev/null +++ b/workflow/examples/python/string_plugins_test/workflow.json @@ -0,0 +1,242 @@ +{ + "name": "String Plugins Test Suite", + "active": false, + "nodes": [ + { + "id": "test_concat", + "name": "Test Concat", + "type": "string.concat", + "typeVersion": 1, + "position": [ + 0, + 0 + ], + "parameters": { + "strings": [ + "Hello", + "World" + ], + "separator": " " + } + }, + { + "id": "assert_concat", + "name": "Assert Concat", + "type": "test.assert_equals", + "typeVersion": 1, + "position": [ + 300, + 0 + ], + "parameters": { + "actual": "$test_concat.result", + "expected": "Hello World", + "message": "string.concat should join strings" + } + }, + { + "id": "test_upper", + "name": "Test Upper", + "type": "string.upper", + "typeVersion": 1, + "position": [ + 0, + 100 + ], + "parameters": { + "text": "hello" + } + }, + { + "id": "assert_upper", + "name": "Assert Upper", + "type": "test.assert_equals", + "typeVersion": 1, + "position": [ + 300, + 100 + ], + "parameters": { + "actual": "$test_upper.result", + "expected": "HELLO", + "message": "string.upper should uppercase text" + } + }, + { + "id": "test_lower", + "name": "Test Lower", + "type": "string.lower", + "typeVersion": 1, + "position": [ + 0, + 200 + ], + "parameters": { + "text": "WORLD" + } + }, + { + "id": "assert_lower", + "name": "Assert Lower", + "type": "test.assert_equals", + "typeVersion": 1, + "position": [ + 300, + 200 + ], + "parameters": { + "actual": "$test_lower.result", + "expected": "world", + "message": "string.lower should lowercase text" + } + }, + { + "id": "test_split", + "name": "Test Split", + "type": "string.split", + "typeVersion": 1, + "position": [ + 0, + 300 + ], + "parameters": { + "text": "a,b,c", + "separator": "," + } + }, + { + "id": "assert_split_length", + "name": "Assert Split Length", + "type": "list.length", + "typeVersion": 1, + "position": [ + 300, + 300 + ], + "parameters": { + "items": "$test_split.result" + } + }, + { + "id": "assert_split", + "name": "Assert Split Count", + "type": "test.assert_equals", + "typeVersion": 1, + "position": [ + 600, + 300 + ], + "parameters": { + "actual": "$assert_split_length.result", + "expected": 3, + "message": "string.split should split into array" + } + }, + { + "id": "test_length", + "name": "Test Length", + "type": "string.length", + "typeVersion": 1, + "position": [ + 0, + 400 + ], + "parameters": { + "text": "Hello" + } + }, + { + "id": "assert_length", + "name": "Assert Length", + "type": "test.assert_equals", + "typeVersion": 1, + "position": [ + 300, + 400 + ], + "parameters": { + "actual": "$test_length.result", + "expected": 5, + "message": "string.length should return character count" + } + } + ], + "connections": { + "Test Concat": { + "main": { + "0": [ + { + "node": "Assert Concat", + "type": "main", + "index": 0 + } + ] + } + }, + "Test Upper": { + "main": { + "0": [ + { + "node": "Assert Upper", + "type": "main", + "index": 0 + } + ] + } + }, + "Test Lower": { + "main": { + "0": [ + { + "node": "Assert Lower", + "type": "main", + "index": 0 + } + ] + } + }, + "Test Split": { + "main": { + "0": [ + { + "node": "Assert Split Length", + "type": "main", + "index": 0 + } + ] + } + }, + "Assert Split Length": { + "main": { + "0": [ + { + "node": "Assert Split Count", + "type": "main", + "index": 0 + } + ] + } + }, + "Test Length": { + "main": { + "0": [ + { + "node": "Assert Length", + "type": "main", + "index": 0 + } + ] + } + } + }, + "triggers": [ + { + "nodeId": "test_concat", + "kind": "manual", + "enabled": true, + "meta": { + "description": "Manually triggered String Plugins Test Suite workflow execution" + } + } + ] +} diff --git a/workflow/examples/python/testing_triangle/package.json b/workflow/examples/python/testing_triangle/package.json new file mode 100644 index 000000000..e5fed5329 --- /dev/null +++ b/workflow/examples/python/testing_triangle/package.json @@ -0,0 +1,24 @@ +{ + "name": "testing_triangle", + "version": "1.0.0", + "description": "meta.workflow_packages.testing_triangle.description", + "author": "AutoMetabuilder", + "license": "MIT", + "keywords": [ + "testing", + "lint", + "e2e" + ], + "main": "workflow.json", + "metadata": { + "label": "meta.workflow_packages.testing_triangle.label", + "description": "meta.workflow_packages.testing_triangle.description", + "tags": [ + "testing", + "lint", + "e2e" + ], + "icon": "workflow", + "category": "templates" + } +} diff --git a/workflow/examples/python/testing_triangle/workflow.json b/workflow/examples/python/testing_triangle/workflow.json new file mode 100644 index 000000000..3d1b651ad --- /dev/null +++ b/workflow/examples/python/testing_triangle/workflow.json @@ -0,0 +1,157 @@ +{ + "name": "meta.workflow_packages.testing_triangle.label", + "active": false, + "nodes": [ + { + "id": "lint", + "name": "Lint", + "type": "tools.run_lint", + "typeVersion": 1, + "position": [ + 0, + 50 + ], + "parameters": { + "path": "src" + } + }, + { + "id": "lint_failed", + "name": "Lint Failed", + "type": "utils.branch_condition", + "typeVersion": 1, + "position": [ + 300, + 50 + ], + "parameters": { + "value": "$lint_results", + "mode": "regex", + "compare": "(FAILED|ERROR)" + } + }, + { + "id": "lint_ok", + "name": "Lint Ok", + "type": "utils.not", + "typeVersion": 1, + "position": [ + 600, + 50 + ], + "parameters": { + "value": "$lint_failed" + } + }, + { + "id": "unit_tests", + "name": "Unit Tests", + "type": "tools.run_tests", + "typeVersion": 1, + "position": [ + 900, + 50 + ], + "parameters": { + "path": "tests" + } + }, + { + "id": "unit_failed", + "name": "Unit Failed", + "type": "utils.branch_condition", + "typeVersion": 1, + "position": [ + 1200, + 50 + ], + "parameters": { + "value": "$unit_results", + "mode": "regex", + "compare": "(FAILED|ERROR)" + } + }, + { + "id": "unit_ok", + "name": "Unit Ok", + "type": "utils.not", + "typeVersion": 1, + "position": [ + 1500, + 50 + ], + "parameters": { + "value": "$unit_failed" + } + }, + { + "id": "ui_tests", + "name": "Ui Tests", + "type": "tools.run_tests", + "typeVersion": 1, + "position": [ + 1800, + 50 + ], + "parameters": { + "path": "tests/ui" + } + } + ], + "connections": { + "Lint": { + "main": { + "0": [ + { + "node": "Lint Failed", + "type": "main", + "index": 0 + } + ] + } + }, + "Lint Failed": { + "main": { + "0": [ + { + "node": "Lint Ok", + "type": "main", + "index": 0 + } + ] + } + }, + "Unit Tests": { + "main": { + "0": [ + { + "node": "Unit Failed", + "type": "main", + "index": 0 + } + ] + } + }, + "Unit Failed": { + "main": { + "0": [ + { + "node": "Unit Ok", + "type": "main", + "index": 0 + } + ] + } + } + }, + "triggers": [ + { + "nodeId": "lint", + "kind": "manual", + "enabled": true, + "meta": { + "description": "Manually triggered meta.workflow_packages.testing_triangle.label workflow execution" + } + } + ] +} diff --git a/workflow/examples/python/web_server_bootstrap/package.json b/workflow/examples/python/web_server_bootstrap/package.json new file mode 100644 index 000000000..4bfa7505d --- /dev/null +++ b/workflow/examples/python/web_server_bootstrap/package.json @@ -0,0 +1,8 @@ +{ + "name": "web_server_bootstrap", + "version": "1.0.0", + "description": "Bootstrap the Flask web server with all routes", + "keywords": ["web", "flask", "server", "bootstrap"], + "license": "MIT", + "category": "infrastructure" +} diff --git a/workflow/examples/python/web_server_bootstrap/workflow.json b/workflow/examples/python/web_server_bootstrap/workflow.json new file mode 100644 index 000000000..56de65304 --- /dev/null +++ b/workflow/examples/python/web_server_bootstrap/workflow.json @@ -0,0 +1,347 @@ +{ + "name": "Web Server Bootstrap", + "active": true, + "nodes": [ + { + "id": "configure_logging", + "name": "Configure Logging", + "type": "backend.configure_logging", + "typeVersion": 1, + "position": [0, 0], + "parameters": {} + }, + { + "id": "load_env", + "name": "Load Environment", + "type": "backend.load_env", + "typeVersion": 1, + "position": [300, 0], + "parameters": {} + }, + { + "id": "create_app", + "name": "Create Flask App", + "type": "web.create_flask_app", + "typeVersion": 1, + "position": [600, 0], + "parameters": { + "name": "autometabuilder", + "config": { + "JSON_SORT_KEYS": false + } + } + }, + { + "id": "create_context_routes", + "name": "Create Context Routes", + "type": "web.route_context", + "typeVersion": 1, + "position": [900, -150], + "parameters": {} + }, + { + "id": "create_run_routes", + "name": "Create Run Routes", + "type": "web.route_run", + "typeVersion": 1, + "position": [900, -50], + "parameters": {} + }, + { + "id": "create_prompt_routes", + "name": "Create Prompt Routes", + "type": "web.route_prompt", + "typeVersion": 1, + "position": [900, 50], + "parameters": {} + }, + { + "id": "create_settings_routes", + "name": "Create Settings Routes", + "type": "web.route_settings", + "typeVersion": 1, + "position": [900, 150], + "parameters": {} + }, + { + "id": "create_translations_routes", + "name": "Create Translation Routes", + "type": "web.route_translations", + "typeVersion": 1, + "position": [900, 250], + "parameters": {} + }, + { + "id": "create_navigation_routes", + "name": "Create Navigation Routes", + "type": "web.route_navigation", + "typeVersion": 1, + "position": [900, 350], + "parameters": {} + }, + { + "id": "register_context", + "name": "Register Context Blueprint", + "type": "web.register_blueprint", + "typeVersion": 1, + "position": [1200, -150], + "parameters": { + "blueprint": "={{$node.create_context_routes.json.result}}" + } + }, + { + "id": "register_run", + "name": "Register Run Blueprint", + "type": "web.register_blueprint", + "typeVersion": 1, + "position": [1200, -50], + "parameters": { + "blueprint": "={{$node.create_run_routes.json.result}}" + } + }, + { + "id": "register_prompt", + "name": "Register Prompt Blueprint", + "type": "web.register_blueprint", + "typeVersion": 1, + "position": [1200, 50], + "parameters": { + "blueprint": "={{$node.create_prompt_routes.json.result}}" + } + }, + { + "id": "register_settings", + "name": "Register Settings Blueprint", + "type": "web.register_blueprint", + "typeVersion": 1, + "position": [1200, 150], + "parameters": { + "blueprint": "={{$node.create_settings_routes.json.result}}" + } + }, + { + "id": "register_translations", + "name": "Register Translations Blueprint", + "type": "web.register_blueprint", + "typeVersion": 1, + "position": [1200, 250], + "parameters": { + "blueprint": "={{$node.create_translations_routes.json.result}}" + } + }, + { + "id": "register_navigation", + "name": "Register Navigation Blueprint", + "type": "web.register_blueprint", + "typeVersion": 1, + "position": [1200, 350], + "parameters": { + "blueprint": "={{$node.create_navigation_routes.json.result}}" + } + }, + { + "id": "start_server", + "name": "Start Web Server", + "type": "web.start_server", + "typeVersion": 1, + "position": [1500, 100], + "parameters": { + "host": "0.0.0.0", + "port": 8000, + "debug": false + } + } + ], + "connections": { + "Configure Logging": { + "main": { + "0": [ + { + "node": "Load Environment", + "type": "main", + "index": 0 + } + ] + } + }, + "Load Environment": { + "main": { + "0": [ + { + "node": "Create Flask App", + "type": "main", + "index": 0 + } + ] + } + }, + "Create Flask App": { + "main": { + "0": [ + { + "node": "Create Context Routes", + "type": "main", + "index": 0 + }, + { + "node": "Create Run Routes", + "type": "main", + "index": 0 + }, + { + "node": "Create Prompt Routes", + "type": "main", + "index": 0 + }, + { + "node": "Create Settings Routes", + "type": "main", + "index": 0 + }, + { + "node": "Create Translation Routes", + "type": "main", + "index": 0 + }, + { + "node": "Create Navigation Routes", + "type": "main", + "index": 0 + } + ] + } + }, + "Create Context Routes": { + "main": { + "0": [ + { + "node": "Register Context Blueprint", + "type": "main", + "index": 0 + } + ] + } + }, + "Create Run Routes": { + "main": { + "0": [ + { + "node": "Register Run Blueprint", + "type": "main", + "index": 0 + } + ] + } + }, + "Create Prompt Routes": { + "main": { + "0": [ + { + "node": "Register Prompt Blueprint", + "type": "main", + "index": 0 + } + ] + } + }, + "Create Settings Routes": { + "main": { + "0": [ + { + "node": "Register Settings Blueprint", + "type": "main", + "index": 0 + } + ] + } + }, + "Create Translation Routes": { + "main": { + "0": [ + { + "node": "Register Translations Blueprint", + "type": "main", + "index": 0 + } + ] + } + }, + "Create Navigation Routes": { + "main": { + "0": [ + { + "node": "Register Navigation Blueprint", + "type": "main", + "index": 0 + } + ] + } + }, + "Register Context Blueprint": { + "main": { + "0": [ + { + "node": "Start Web Server", + "type": "main", + "index": 0 + } + ] + } + }, + "Register Run Blueprint": { + "main": { + "0": [ + { + "node": "Start Web Server", + "type": "main", + "index": 0 + } + ] + } + }, + "Register Prompt Blueprint": { + "main": { + "0": [ + { + "node": "Start Web Server", + "type": "main", + "index": 0 + } + ] + } + }, + "Register Settings Blueprint": { + "main": { + "0": [ + { + "node": "Start Web Server", + "type": "main", + "index": 0 + } + ] + } + }, + "Register Translations Blueprint": { + "main": { + "0": [ + { + "node": "Start Web Server", + "type": "main", + "index": 0 + } + ] + } + }, + "Register Navigation Blueprint": { + "main": { + "0": [ + { + "node": "Start Web Server", + "type": "main", + "index": 0 + } + ] + } + } + } +} diff --git a/workflow/examples/python/web_server_json_routes/package.json b/workflow/examples/python/web_server_json_routes/package.json new file mode 100644 index 000000000..7f9def762 --- /dev/null +++ b/workflow/examples/python/web_server_json_routes/package.json @@ -0,0 +1,13 @@ +{ + "name": "web_server_json_routes", + "version": "1.0.0", + "description": "Web server with routes defined in JSON workflow", + "main": "workflow.json", + "author": "AutoMetabuilder", + "metadata": { + "label": "Web Server (JSON Routes)", + "tags": ["web", "server", "json-routes"], + "icon": "web", + "category": "templates" + } +} diff --git a/workflow/examples/python/web_server_json_routes/workflow.json b/workflow/examples/python/web_server_json_routes/workflow.json new file mode 100644 index 000000000..aca7fcd66 --- /dev/null +++ b/workflow/examples/python/web_server_json_routes/workflow.json @@ -0,0 +1,135 @@ +{ + "name": "Web Server with JSON Routes", + "active": true, + "nodes": [ + { + "id": "configure_logging", + "name": "Configure Logging", + "type": "backend.configure_logging", + "typeVersion": 1, + "position": [0, 0], + "parameters": {} + }, + { + "id": "load_env", + "name": "Load Environment", + "type": "backend.load_env", + "typeVersion": 1, + "position": [300, 0], + "parameters": {} + }, + { + "id": "create_app", + "name": "Create Flask App", + "type": "web.create_flask_app", + "typeVersion": 1, + "position": [600, 0], + "parameters": { + "name": "autometabuilder", + "config": { + "JSON_SORT_KEYS": false + } + } + }, + { + "id": "register_api_routes", + "name": "Register API Routes", + "type": "web.register_routes", + "typeVersion": 1, + "position": [900, 0], + "parameters": { + "blueprint_name": "api", + "routes": [ + { + "path": "/api/navigation", + "methods": ["GET"], + "handler": "web.api_navigation", + "handler_type": "plugin" + }, + { + "path": "/api/workflow/packages", + "methods": ["GET"], + "handler": "web.api_workflow_packages", + "handler_type": "plugin" + }, + { + "path": "/api/workflow/plugins", + "methods": ["GET"], + "handler": "web.api_workflow_plugins", + "handler_type": "plugin" + }, + { + "path": "/api/workflow/graph", + "methods": ["GET"], + "handler": "web.api_workflow_graph", + "handler_type": "plugin" + }, + { + "path": "/api/translation-options", + "methods": ["GET"], + "handler": "web.api_translation_options", + "handler_type": "plugin" + } + ] + } + }, + { + "id": "start_server", + "name": "Start Web Server", + "type": "web.start_server", + "typeVersion": 1, + "position": [1200, 0], + "parameters": { + "host": "0.0.0.0", + "port": 8000, + "debug": false + } + } + ], + "connections": { + "Configure Logging": { + "main": { + "0": [ + { + "node": "Load Environment", + "type": "main", + "index": 0 + } + ] + } + }, + "Load Environment": { + "main": { + "0": [ + { + "node": "Create Flask App", + "type": "main", + "index": 0 + } + ] + } + }, + "Create Flask App": { + "main": { + "0": [ + { + "node": "Register API Routes", + "type": "main", + "index": 0 + } + ] + } + }, + "Register API Routes": { + "main": { + "0": [ + { + "node": "Start Web Server", + "type": "main", + "index": 0 + } + ] + } + } + } +}