axio-tools-docker 0.6.1__tar.gz → 0.6.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/.gitignore +2 -0
  2. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/PKG-INFO +32 -1
  3. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/README.md +31 -0
  4. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/pyproject.toml +1 -1
  5. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/.github/workflows/publish.yml +0 -0
  6. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/.github/workflows/tests.yml +0 -0
  7. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/LICENSE +0 -0
  8. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/Makefile +0 -0
  9. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/src/axio_tools_docker/__init__.py +0 -0
  10. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/src/axio_tools_docker/config.py +0 -0
  11. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/src/axio_tools_docker/handler.py +0 -0
  12. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/src/axio_tools_docker/manager.py +0 -0
  13. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/src/axio_tools_docker/plugin.py +0 -0
  14. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/src/axio_tools_docker/settings.py +0 -0
  15. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/src/axio_tools_docker/tui/__init__.py +0 -0
  16. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/src/axio_tools_docker/tui/docker.py +0 -0
  17. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/tests/test_config.py +0 -0
  18. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/tests/test_handler.py +0 -0
  19. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/tests/test_manager.py +0 -0
  20. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/tests/test_plugin.py +0 -0
  21. {axio_tools_docker-0.6.1 → axio_tools_docker-0.6.2}/uv.lock +0 -0
@@ -10,3 +10,5 @@ dist/
10
10
  build/
11
11
  _build/
12
12
  .DS_Store
13
+ *.sqlite
14
+ *.db
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: axio-tools-docker
3
- Version: 0.6.1
3
+ Version: 0.6.2
4
4
  Summary: Docker sandbox tools for Axio
5
5
  Project-URL: Homepage, https://github.com/axio-agent/axio-tools-docker
6
6
  Project-URL: Repository, https://github.com/axio-agent/axio-tools-docker
@@ -81,8 +81,39 @@ async def main() -> None:
81
81
  | `sandbox_write` | Write a file into the container's filesystem |
82
82
  | `sandbox_read` | Read a file from the container's filesystem |
83
83
 
84
+ ## Container lifecycle
85
+
86
+ The sandbox container is created **lazily** on the first tool call (`sandbox_exec`,
87
+ `sandbox_write`, or `sandbox_read`) — `plugin.init()` itself does not start Docker.
88
+ The same container is reused for all subsequent tool calls within the session.
89
+
90
+ When `await plugin.close()` is called the container is stopped and removed
91
+ (`docker rm -f`). You should always call `close()` when the agent session ends
92
+ to avoid leaving containers behind:
93
+
94
+ ```python
95
+ async def run_with_cleanup(agent, ctx, plugin):
96
+ try:
97
+ result = await agent.run("...", ctx)
98
+ finally:
99
+ await plugin.close()
100
+ ```
101
+
102
+ If Docker is not installed or the `docker` CLI is not on `PATH`, the container
103
+ creation step will raise a `RuntimeError` on the first tool call. You can detect
104
+ this before starting a session with `SandboxManager.docker_available()` (returns
105
+ `True` if the `docker` executable is found on `PATH`).
106
+
84
107
  ## Configuration
85
108
 
109
+ | Field | Type | Default | Description |
110
+ |-------|------|---------|-------------|
111
+ | `image` | `str` | `"python:latest"` | Docker image to use for the sandbox container |
112
+ | `memory` | `str` | `"256m"` | Memory limit passed to `docker run --memory` (e.g., `"512m"`, `"1g"`) |
113
+ | `cpus` | `str` | `"1.0"` | CPU limit passed to `docker run --cpus` |
114
+ | `network` | `bool` | `False` | Whether to allow network access. When `False`, `--network none` is set on the container. |
115
+ | `workdir` | `str` | `"/workspace"` | Working directory inside the container |
116
+
86
117
  <!-- name: test_readme_config -->
87
118
  ```python
88
119
  from axio_tools_docker.config import SandboxConfig
@@ -68,8 +68,39 @@ async def main() -> None:
68
68
  | `sandbox_write` | Write a file into the container's filesystem |
69
69
  | `sandbox_read` | Read a file from the container's filesystem |
70
70
 
71
+ ## Container lifecycle
72
+
73
+ The sandbox container is created **lazily** on the first tool call (`sandbox_exec`,
74
+ `sandbox_write`, or `sandbox_read`) — `plugin.init()` itself does not start Docker.
75
+ The same container is reused for all subsequent tool calls within the session.
76
+
77
+ When `await plugin.close()` is called the container is stopped and removed
78
+ (`docker rm -f`). You should always call `close()` when the agent session ends
79
+ to avoid leaving containers behind:
80
+
81
+ ```python
82
+ async def run_with_cleanup(agent, ctx, plugin):
83
+ try:
84
+ result = await agent.run("...", ctx)
85
+ finally:
86
+ await plugin.close()
87
+ ```
88
+
89
+ If Docker is not installed or the `docker` CLI is not on `PATH`, the container
90
+ creation step will raise a `RuntimeError` on the first tool call. You can detect
91
+ this before starting a session with `SandboxManager.docker_available()` (returns
92
+ `True` if the `docker` executable is found on `PATH`).
93
+
71
94
  ## Configuration
72
95
 
96
+ | Field | Type | Default | Description |
97
+ |-------|------|---------|-------------|
98
+ | `image` | `str` | `"python:latest"` | Docker image to use for the sandbox container |
99
+ | `memory` | `str` | `"256m"` | Memory limit passed to `docker run --memory` (e.g., `"512m"`, `"1g"`) |
100
+ | `cpus` | `str` | `"1.0"` | CPU limit passed to `docker run --cpus` |
101
+ | `network` | `bool` | `False` | Whether to allow network access. When `False`, `--network none` is set on the container. |
102
+ | `workdir` | `str` | `"/workspace"` | Working directory inside the container |
103
+
73
104
  <!-- name: test_readme_config -->
74
105
  ```python
75
106
  from axio_tools_docker.config import SandboxConfig
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "axio-tools-docker"
3
- version = "0.6.1"
3
+ version = "0.6.2"
4
4
  description = "Docker sandbox tools for Axio"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"