adk-code-mode-sandbox 0.3.0__tar.gz → 0.4.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: adk-code-mode-sandbox
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: In-sandbox runtime shim for adk-code-mode. Installs inside the container image the host runtime launches.
5
5
  Project-URL: Documentation, https://github.com/A2ANet/adk-code-mode#readme
6
6
  Project-URL: Issues, https://github.com/A2ANet/adk-code-mode/issues
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2025-present A2A Net <hello@a2anet.com>
2
2
  #
3
3
  # SPDX-License-Identifier: Apache-2.0
4
- __version__ = "0.3.0" # x-release-please-version
4
+ __version__ = "0.4.0" # x-release-please-version
@@ -44,6 +44,7 @@ import websockets
44
44
  import websockets.asyncio.server
45
45
 
46
46
  from adk_code_mode_sandbox._entry import (
47
+ TOOLS_DIR,
47
48
  _make_globals,
48
49
  _prepare_sys_path,
49
50
  _prepare_workdir,
@@ -159,9 +160,11 @@ async def _handle_connection(ws: Any) -> None:
159
160
  max_tools = int(os.environ.get(MAX_UPLOAD_TOOLS_ENV, _DEFAULT_MAX_TOOLS_BYTES))
160
161
  max_workspace = int(os.environ.get(MAX_UPLOAD_WORKSPACE_ENV, _DEFAULT_MAX_WORKSPACE_BYTES))
161
162
 
162
- tools_base = tempfile.mkdtemp(prefix="adk-cm-tools-")
163
- tools_dir = os.path.join(tools_base, "tools")
164
- os.makedirs(tools_dir)
163
+ # Extract into the documented /tools path (pre-created and owned by the
164
+ # sandbox user in the image) rather than a temp dir, so the overflow
165
+ # catalog's hard-coded /tools navigation resolves here exactly as it does
166
+ # under the Docker backend. The container is single-use, so no cleanup.
167
+ os.makedirs(TOOLS_DIR, exist_ok=True)
165
168
  workspace_dir = tempfile.mkdtemp(prefix="adk-cm-ws-")
166
169
 
167
170
  try:
@@ -173,11 +176,11 @@ async def _handle_connection(ws: Any) -> None:
173
176
  raise ValueError(
174
177
  f"tools archive ({len(tools_data):,} bytes) exceeds limit ({max_tools:,} bytes)"
175
178
  )
176
- _extract_tar(tools_data, tools_dir)
179
+ _extract_tar(tools_data, TOOLS_DIR)
177
180
 
178
181
  # 2. Sanitize environment, then prepare sys.path + a persistent /workspace.
179
182
  _sanitize_environ()
180
- _prepare_sys_path(tools_dir)
183
+ _prepare_sys_path(TOOLS_DIR)
181
184
  _prepare_workdir(workspace_dir)
182
185
 
183
186
  # 3. One persistent globals dict for the connection, so variables set in
@@ -192,7 +195,6 @@ async def _handle_connection(ws: Any) -> None:
192
195
  while await _run_one_block(ws, loop, globs, workspace_dir, max_workspace):
193
196
  pass
194
197
  finally:
195
- shutil.rmtree(tools_base, ignore_errors=True)
196
198
  shutil.rmtree(workspace_dir, ignore_errors=True)
197
199
 
198
200