added sandbox and bash tool

This commit is contained in:
2026-02-20 20:00:52 -07:00
parent 8b62f946ca
commit 93ce413c9b
10 changed files with 419 additions and 11 deletions
+24
View File
@@ -0,0 +1,24 @@
async def bash(command: str, sandbox=None) -> str:
"""
Execute a bash command in the sandbox.
Args:
command: Shell command to run
sandbox: PodmanSandbox instance
Returns:
Command output (stdout + stderr)
"""
if sandbox is None:
return "Error: Sandbox not available"
try:
result = await sandbox.run(command)
return result
except RuntimeError as e:
return f"Error: sandbox execution failed: {e}"
except Exception as e:
return f"Error: Unexpected failure: {e}"