alita-sdk 0.3.414__py3-none-any.whl → 0.3.415__py3-none-any.whl

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.
@@ -64,36 +64,10 @@ def _is_deno_available() -> bool:
64
64
 
65
65
 
66
66
  def _setup_pyodide_cache_env() -> None:
67
- """Setup Pyodide caching environment variables for performance optimization"""
67
+ """Setup Pyodide caching environment variables for performance optimization [NO-OP]"""
68
68
  try:
69
- # Check if cache environment file exists and source it
70
- cache_env_file = os.path.expanduser("~/.pyodide_cache_env")
71
- if os.path.exists(cache_env_file):
72
- with open(cache_env_file, 'r') as f:
73
- for line in f:
74
- line = line.strip()
75
- if line.startswith('export ') and '=' in line:
76
- # Parse export VAR=value format
77
- var_assignment = line[7:] # Remove 'export '
78
- if '=' in var_assignment:
79
- key, value = var_assignment.split('=', 1)
80
- # Remove quotes if present
81
- value = value.strip('"').strip("'")
82
- os.environ[key] = value
83
- logger.debug(f"Set Pyodide cache env: {key}={value}")
84
-
85
- # Set default caching environment variables if not already set
86
- cache_defaults = {
87
- 'PYODIDE_PACKAGES_PATH': os.path.expanduser('~/.cache/pyodide'),
88
- 'DENO_DIR': os.path.expanduser('~/.cache/deno'),
89
- 'PYODIDE_CACHE_DIR': os.path.expanduser('~/.cache/pyodide'),
90
- }
91
-
92
- for key, default_value in cache_defaults.items():
93
- if key not in os.environ:
94
- os.environ[key] = default_value
95
- logger.debug(f"Set default Pyodide env: {key}={default_value}")
96
-
69
+ for key in ["SANDBOX_BASE", "DENO_DIR"]:
70
+ logger.info("Sandbox env: %s -> %s", key, os.environ.get(key, "n/a"))
97
71
  except Exception as e:
98
72
  logger.warning(f"Could not setup Pyodide cache environment: {e}")
99
73
 
@@ -142,7 +116,7 @@ class PyodideSandboxTool(BaseTool):
142
116
  def _prepare_pyodide_input(self, code: str) -> str:
143
117
  """Prepare input for PyodideSandboxTool by injecting state and alita_client into the code block."""
144
118
  pyodide_predata = ""
145
-
119
+
146
120
  # Add alita_client if available
147
121
  if self.alita_client:
148
122
  try:
@@ -158,7 +132,7 @@ class PyodideSandboxTool(BaseTool):
158
132
  f"auth_token='{self.alita_client.auth_token}')\n")
159
133
  except FileNotFoundError:
160
134
  logger.error(f"sandbox_client.py not found. Ensure the file exists.")
161
-
135
+
162
136
  return f"#elitea simplified client\n{pyodide_predata}{code}"
163
137
 
164
138
  def _initialize_sandbox(self) -> None:
@@ -175,9 +149,19 @@ class PyodideSandboxTool(BaseTool):
175
149
 
176
150
  from langchain_sandbox import PyodideSandbox
177
151
 
152
+ # Air-gapped settings
153
+ sandbox_base = os.environ.get("SANDBOX_BASE", os.path.expanduser('~/.cache/pyodide'))
154
+ sandbox_tmp = os.path.join(sandbox_base, "tmp")
155
+ deno_cache = os.environ.get("DENO_DIR", os.path.expanduser('~/.cache/deno'))
156
+
178
157
  # Configure sandbox with performance optimizations
179
158
  self._sandbox = PyodideSandbox(
180
159
  stateful=self.stateful,
160
+ #
161
+ allow_env=["SANDBOX_BASE"],
162
+ allow_read=[sandbox_base, sandbox_tmp, deno_cache],
163
+ allow_write=[sandbox_tmp, deno_cache],
164
+ #
181
165
  allow_net=self.allow_net,
182
166
  # Use auto node_modules_dir for better caching
183
167
  node_modules_dir="auto"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alita_sdk
3
- Version: 0.3.414
3
+ Version: 0.3.415
4
4
  Summary: SDK for building langchain agents using resources from Alita
5
5
  Author-email: Artem Rozumenko <artyom.rozumenko@gmail.com>, Mikalai Biazruchka <mikalai_biazruchka@epam.com>, Roman Mitusov <roman_mitusov@epam.com>, Ivan Krakhmaliuk <lifedj27@gmail.com>, Artem Dubrovskiy <ad13box@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -121,7 +121,7 @@ alita_sdk/runtime/tools/mcp_server_tool.py,sha256=MhLxZJ44LYrB_0GrojmkyqKoDRaqIH
121
121
  alita_sdk/runtime/tools/pgvector_search.py,sha256=NN2BGAnq4SsDHIhUcFZ8d_dbEOM8QwB0UwpsWCYruXU,11692
122
122
  alita_sdk/runtime/tools/prompt.py,sha256=nJafb_e5aOM1Rr3qGFCR-SKziU9uCsiP2okIMs9PppM,741
123
123
  alita_sdk/runtime/tools/router.py,sha256=p7e0tX6YAWw2M2Nq0A_xqw1E2P-Xz1DaJvhUstfoZn4,1584
124
- alita_sdk/runtime/tools/sandbox.py,sha256=7KpTAE4Fs1dvQIwAH__jwrxXG4QUa9GhcOhlkE8EKro,16049
124
+ alita_sdk/runtime/tools/sandbox.py,sha256=LTCHC9xnuYThWX30PCTVEtjeg50FX7w2c29KU5E68W0,15251
125
125
  alita_sdk/runtime/tools/tool.py,sha256=lE1hGi6qOAXG7qxtqxarD_XMQqTghdywf261DZawwno,5631
126
126
  alita_sdk/runtime/tools/vectorstore.py,sha256=0SzfY1dYrGr7YUapJzXY01JFyzLv36dPjwHzs1XZIM4,34392
127
127
  alita_sdk/runtime/tools/vectorstore_base.py,sha256=k_6LAhhBJEs5SXCQJI3bBvJLQli6_3pHjqF6SCQGJGc,28312
@@ -353,8 +353,8 @@ alita_sdk/tools/zephyr_scale/api_wrapper.py,sha256=kT0TbmMvuKhDUZc0i7KO18O38JM9S
353
353
  alita_sdk/tools/zephyr_squad/__init__.py,sha256=0ne8XLJEQSLOWfzd2HdnqOYmQlUliKHbBED5kW_Vias,2895
354
354
  alita_sdk/tools/zephyr_squad/api_wrapper.py,sha256=kmw_xol8YIYFplBLWTqP_VKPRhL_1ItDD0_vXTe_UuI,14906
355
355
  alita_sdk/tools/zephyr_squad/zephyr_squad_cloud_client.py,sha256=R371waHsms4sllHCbijKYs90C-9Yu0sSR3N4SUfQOgU,5066
356
- alita_sdk-0.3.414.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
357
- alita_sdk-0.3.414.dist-info/METADATA,sha256=qLODyJVtp0z8r9KLfWTSl84P-PykpgbyZZT_wCelv9Y,19071
358
- alita_sdk-0.3.414.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
359
- alita_sdk-0.3.414.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
360
- alita_sdk-0.3.414.dist-info/RECORD,,
356
+ alita_sdk-0.3.415.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
357
+ alita_sdk-0.3.415.dist-info/METADATA,sha256=56q2LMSzT9wVT1UilbADle-ONyYKKpCudn__DVOcbi4,19071
358
+ alita_sdk-0.3.415.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
359
+ alita_sdk-0.3.415.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
360
+ alita_sdk-0.3.415.dist-info/RECORD,,