Add missing var plugin files and update gitignore

- Added var plugin implementation files (get, set, delete, exists)
- Updated .gitignore to not ignore backend/autometabuilder/workflow/plugins/var/
- These files were created but not committed due to gitignore pattern

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-10 13:54:57 +00:00
parent 3175a4187f
commit 379908dd64
6 changed files with 59 additions and 0 deletions

1
.gitignore vendored
View File

@@ -19,6 +19,7 @@ lib64/
parts/
sdist/
var/
!backend/autometabuilder/workflow/plugins/var/
wheels/
share/python-wheels/
*.egg-info/

View File

@@ -0,0 +1 @@
"""Variable management workflow plugins."""

View File

@@ -0,0 +1,15 @@
"""Workflow plugin: delete variable from workflow store."""
def run(runtime, inputs):
"""Delete variable from workflow store."""
key = inputs.get("key")
if key is None:
return {"result": False, "deleted": False, "error": "key is required"}
if key in runtime.store:
del runtime.store[key]
return {"result": True, "deleted": True}
return {"result": False, "deleted": False}

View File

@@ -0,0 +1,13 @@
"""Workflow plugin: check if variable exists in workflow store."""
def run(runtime, inputs):
"""Check if variable exists in workflow store."""
key = inputs.get("key")
if key is None:
return {"result": False, "error": "key is required"}
exists = key in runtime.store
return {"result": exists}

View File

@@ -0,0 +1,15 @@
"""Workflow plugin: get variable from workflow store."""
def run(runtime, inputs):
"""Get variable value from workflow store."""
key = inputs.get("key")
default = inputs.get("default")
if key is None:
return {"result": default, "exists": False, "error": "key is required"}
exists = key in runtime.store
value = runtime.store.get(key, default)
return {"result": value, "exists": exists}

View File

@@ -0,0 +1,14 @@
"""Workflow plugin: set variable in workflow store."""
def run(runtime, inputs):
"""Set variable value in workflow store."""
key = inputs.get("key")
value = inputs.get("value")
if key is None:
return {"result": None, "key": None, "error": "key is required"}
runtime.store[key] = value
return {"result": value, "key": key}