added sandbox and bash tool
This commit is contained in:
@@ -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}"
|
||||
Reference in New Issue
Block a user