grasp-sdk 0.1.4__tar.gz → 0.1.6__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.

Potentially problematic release.


This version of grasp-sdk might be problematic. Click here for more details.

Files changed (29) hide show
  1. {grasp_sdk-0.1.4/grasp_sdk.egg-info → grasp_sdk-0.1.6}/PKG-INFO +21 -3
  2. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/README.md +20 -2
  3. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/grasp_sdk/__init__.py +1 -1
  4. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/grasp_sdk/sandbox/chrome-stable.mjs +50 -20
  5. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/grasp_sdk/sandbox/chromium.mjs +25 -19
  6. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6/grasp_sdk.egg-info}/PKG-INFO +21 -3
  7. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/pyproject.toml +1 -1
  8. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/MANIFEST.in +0 -0
  9. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/build_and_publish.py +0 -0
  10. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/example_usage.py +0 -0
  11. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/grasp_sdk/models/__init__.py +0 -0
  12. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/grasp_sdk/services/__init__.py +0 -0
  13. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/grasp_sdk/services/browser.py +0 -0
  14. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/grasp_sdk/services/sandbox.py +0 -0
  15. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/grasp_sdk/utils/__init__.py +0 -0
  16. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/grasp_sdk/utils/auth.py +0 -0
  17. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/grasp_sdk/utils/config.py +0 -0
  18. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/grasp_sdk/utils/logger.py +0 -0
  19. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/grasp_sdk.egg-info/SOURCES.txt +0 -0
  20. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/grasp_sdk.egg-info/dependency_links.txt +0 -0
  21. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/grasp_sdk.egg-info/entry_points.txt +0 -0
  22. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/grasp_sdk.egg-info/not-zip-safe +0 -0
  23. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/grasp_sdk.egg-info/requires.txt +0 -0
  24. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/grasp_sdk.egg-info/top_level.txt +0 -0
  25. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/py.typed +0 -0
  26. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/requirements.txt +0 -0
  27. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/setup.cfg +0 -0
  28. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/setup.py +0 -0
  29. {grasp_sdk-0.1.4 → grasp_sdk-0.1.6}/test_install.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: grasp_sdk
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary: Python SDK for Grasp E2B - Browser automation and sandbox management
5
5
  Home-page: https://github.com/grasp-team/grasp-e2b
6
6
  Author: Grasp Team
@@ -47,8 +47,14 @@ Dynamic: requires-python
47
47
 
48
48
  # Grasp SDK - Python Implementation
49
49
 
50
+ [![PyPI version](https://badge.fury.io/py/grasp-sdk.svg)](https://badge.fury.io/py/grasp-sdk)
51
+ [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
52
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
53
+
50
54
  🐍 Python implementation of Grasp SDK for E2B platform providing secure command execution and browser automation in isolated cloud environments.
51
55
 
56
+ **Current Version: 0.1.4** - [View on PyPI](https://pypi.org/project/grasp-sdk/0.1.4/)
57
+
52
58
  ## 🚀 Features
53
59
 
54
60
  - **Secure Execution**: Run commands and scripts in isolated E2B sandboxes
@@ -61,8 +67,8 @@ Dynamic: requires-python
61
67
  ## 📦 Installation
62
68
 
63
69
  ```bash
64
- # Install from PyPI (when published)
65
- pip install grasp-sdk
70
+ # Install from PyPI
71
+ pip install grasp_sdk
66
72
 
67
73
  # Install from source
68
74
  pip install -e .
@@ -300,6 +306,18 @@ This Python implementation provides the same API surface as the Node.js/TypeScri
300
306
 
301
307
  MIT License - see the [LICENSE](../LICENSE) file for details.
302
308
 
309
+ ## 📋 Release History
310
+
311
+ ### v0.1.4 (2025-01-27)
312
+ - Version synchronization update
313
+ - Package metadata improvements
314
+ - Documentation updates
315
+
316
+ ### v0.1.0 (2025-01-27)
317
+ - Initial release
318
+ - Core functionality implementation
319
+ - Complete API compatibility with Node.js version
320
+
303
321
  ## 🔗 Related
304
322
 
305
323
  - [Node.js/TypeScript Implementation](../src/)
@@ -1,7 +1,13 @@
1
1
  # Grasp SDK - Python Implementation
2
2
 
3
+ [![PyPI version](https://badge.fury.io/py/grasp-sdk.svg)](https://badge.fury.io/py/grasp-sdk)
4
+ [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+
3
7
  🐍 Python implementation of Grasp SDK for E2B platform providing secure command execution and browser automation in isolated cloud environments.
4
8
 
9
+ **Current Version: 0.1.4** - [View on PyPI](https://pypi.org/project/grasp-sdk/0.1.4/)
10
+
5
11
  ## 🚀 Features
6
12
 
7
13
  - **Secure Execution**: Run commands and scripts in isolated E2B sandboxes
@@ -14,8 +20,8 @@
14
20
  ## 📦 Installation
15
21
 
16
22
  ```bash
17
- # Install from PyPI (when published)
18
- pip install grasp-sdk
23
+ # Install from PyPI
24
+ pip install grasp_sdk
19
25
 
20
26
  # Install from source
21
27
  pip install -e .
@@ -253,6 +259,18 @@ This Python implementation provides the same API surface as the Node.js/TypeScri
253
259
 
254
260
  MIT License - see the [LICENSE](../LICENSE) file for details.
255
261
 
262
+ ## 📋 Release History
263
+
264
+ ### v0.1.4 (2025-01-27)
265
+ - Version synchronization update
266
+ - Package metadata improvements
267
+ - Documentation updates
268
+
269
+ ### v0.1.0 (2025-01-27)
270
+ - Initial release
271
+ - Core functionality implementation
272
+ - Complete API compatibility with Node.js version
273
+
256
274
  ## 🔗 Related
257
275
 
258
276
  - [Node.js/TypeScript Implementation](../src/)
@@ -24,7 +24,7 @@ from .models import (
24
24
  SandboxStatus,
25
25
  )
26
26
 
27
- __version__ = "0.1.4"
27
+ __version__ = "0.1.6"
28
28
  __author__ = "Grasp Team"
29
29
  __email__ = "team@grasp.dev"
30
30
 
@@ -109,12 +109,37 @@ try {
109
109
 
110
110
  args.push(
111
111
  '--no-sandbox',
112
+ '--disable-setuid-sandbox',
112
113
  '--disable-dev-shm-usage',
113
114
  '--disable-gpu',
114
115
  '--disable-software-rasterizer',
115
116
  '--user-data-dir=/home/user/.browser-context'
116
117
  );
117
118
 
119
+ args.push(
120
+ // 避免缓存积累影响性能
121
+ '--disable-application-cache',
122
+
123
+ // 关闭所有硬件加速特性,防止 GPU 相关崩溃
124
+ '--disable-accelerated-2d-canvas',
125
+ '--disable-accelerated-video-decode',
126
+
127
+ // 禁用后台渲染,减少无关资源消耗
128
+ '--disable-background-timer-throttling',
129
+ '--disable-backgrounding-occluded-windows',
130
+ '--disable-renderer-backgrounding',
131
+
132
+ // 避免过度日志影响性能
133
+ '--disable-logging',
134
+
135
+ // 禁用不必要的多媒体解码
136
+ '--mute-audio',
137
+
138
+ // 避免崩溃时弹窗
139
+ '--no-default-browser-check',
140
+ '--no-first-run',
141
+ );
142
+
118
143
  if(headless) {
119
144
  args.push('--headless=new');
120
145
  }
@@ -188,12 +213,12 @@ try {
188
213
  changeOrigin: true
189
214
  });
190
215
 
191
- let wsId = null;
216
+ const clients = new Set();
192
217
 
193
- // Log WebSocket messages
218
+ // 监听 WebSocket 事件
194
219
  proxy.on('open', () => {
195
220
  console.log('🔌 CDP WebSocket connection established');
196
- wsId = Date.now();
221
+ const wsId = Date.now();
197
222
  logger.info('CDP WebSocket connection established', { sandboxId, wsId });
198
223
  Sentry.addBreadcrumb({
199
224
  category: 'websocket',
@@ -201,6 +226,28 @@ try {
201
226
  level: 'info',
202
227
  data: { sandboxId }
203
228
  });
229
+
230
+ clients.add(wsId);
231
+ proxy.once('close', async (req, socket, head) => {
232
+ console.log('🔒 CDP WebSocket connection closed');
233
+ await logger.info('CDP WebSocket connection closed', { sandboxId });
234
+ Sentry.addBreadcrumb({
235
+ category: 'websocket',
236
+ message: 'CDP connection closed',
237
+ level: 'info',
238
+ data: { sandboxId }
239
+ });
240
+ clients.delete(wsId);
241
+
242
+ if(clients.size <= 0) {
243
+ setTimeout(() => {
244
+ if(clients.size <= 0) {
245
+ console.log('❌ Force closed...', wsId);
246
+ process.exit(0);
247
+ }
248
+ }, keepAliveMS);
249
+ }
250
+ });
204
251
  });
205
252
 
206
253
  proxy.on('proxyReqWs', (proxyReq, req, socket, options, head) => {
@@ -222,23 +269,6 @@ try {
222
269
  extra: { url: req?.url }
223
270
  });
224
271
  });
225
-
226
- proxy.on('close', async (req, socket, head) => {
227
- console.log('🔒 CDP WebSocket connection closed');
228
- await logger.info('CDP WebSocket connection closed', { sandboxId });
229
- Sentry.addBreadcrumb({
230
- category: 'websocket',
231
- message: 'CDP connection closed',
232
- level: 'info',
233
- data: { sandboxId }
234
- });
235
- const closeId = wsId;
236
- setTimeout(() => {
237
- if(wsId === closeId) {
238
- process.exit(0);
239
- }
240
- }, keepAliveMS);
241
- });
242
272
 
243
273
  const server = http.createServer(async (req, res) => {
244
274
  if (req.url === '/health') {
@@ -123,6 +123,7 @@ try {
123
123
  '--disable-background-timer-throttling',
124
124
  '--disable-backgrounding-occluded-windows',
125
125
  '--disable-renderer-backgrounding',
126
+ "--disable-software-rasterizer",
126
127
  ...JSON.parse(process.env.BROWSER_ARGS),
127
128
  );
128
129
 
@@ -183,12 +184,12 @@ try {
183
184
  changeOrigin: true
184
185
  });
185
186
 
186
- let wsId = null;
187
+ const clients = new Set();
187
188
 
188
189
  // 监听 WebSocket 事件
189
190
  proxy.on('open', () => {
190
191
  console.log('🔌 CDP WebSocket connection established');
191
- wsId = Date.now();
192
+ const wsId = Date.now();
192
193
  logger.info('CDP WebSocket connection established', { sandboxId, wsId });
193
194
  Sentry.addBreadcrumb({
194
195
  category: 'websocket',
@@ -196,6 +197,28 @@ try {
196
197
  level: 'info',
197
198
  data: { sandboxId }
198
199
  });
200
+
201
+ clients.add(wsId);
202
+ proxy.once('close', async (req, socket, head) => {
203
+ console.log('🔒 CDP WebSocket connection closed');
204
+ await logger.info('CDP WebSocket connection closed', { sandboxId });
205
+ Sentry.addBreadcrumb({
206
+ category: 'websocket',
207
+ message: 'CDP connection closed',
208
+ level: 'info',
209
+ data: { sandboxId }
210
+ });
211
+ clients.delete(wsId);
212
+
213
+ if(clients.size <= 0) {
214
+ setTimeout(() => {
215
+ if(clients.size <= 0) {
216
+ console.log('❌ Force closed...', wsId);
217
+ process.exit(0);
218
+ }
219
+ }, keepAliveMS);
220
+ }
221
+ });
199
222
  });
200
223
 
201
224
  proxy.on('proxyReqWs', (proxyReq, req, socket, options, head) => {
@@ -217,23 +240,6 @@ try {
217
240
  extra: { url: req?.url }
218
241
  });
219
242
  });
220
-
221
- proxy.on('close', async (req, socket, head) => {
222
- console.log('🔒 CDP WebSocket connection closed');
223
- await logger.info('CDP WebSocket connection closed', { sandboxId });
224
- Sentry.addBreadcrumb({
225
- category: 'websocket',
226
- message: 'CDP connection closed',
227
- level: 'info',
228
- data: { sandboxId }
229
- });
230
- const closeId = wsId;
231
- setTimeout(() => {
232
- if(wsId === closeId) {
233
- process.exit(0);
234
- }
235
- }, keepAliveMS);
236
- });
237
243
 
238
244
  const server = http.createServer(async (req, res) => {
239
245
  if (req.url === '/health') {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: grasp_sdk
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary: Python SDK for Grasp E2B - Browser automation and sandbox management
5
5
  Home-page: https://github.com/grasp-team/grasp-e2b
6
6
  Author: Grasp Team
@@ -47,8 +47,14 @@ Dynamic: requires-python
47
47
 
48
48
  # Grasp SDK - Python Implementation
49
49
 
50
+ [![PyPI version](https://badge.fury.io/py/grasp-sdk.svg)](https://badge.fury.io/py/grasp-sdk)
51
+ [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
52
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
53
+
50
54
  🐍 Python implementation of Grasp SDK for E2B platform providing secure command execution and browser automation in isolated cloud environments.
51
55
 
56
+ **Current Version: 0.1.4** - [View on PyPI](https://pypi.org/project/grasp-sdk/0.1.4/)
57
+
52
58
  ## 🚀 Features
53
59
 
54
60
  - **Secure Execution**: Run commands and scripts in isolated E2B sandboxes
@@ -61,8 +67,8 @@ Dynamic: requires-python
61
67
  ## 📦 Installation
62
68
 
63
69
  ```bash
64
- # Install from PyPI (when published)
65
- pip install grasp-sdk
70
+ # Install from PyPI
71
+ pip install grasp_sdk
66
72
 
67
73
  # Install from source
68
74
  pip install -e .
@@ -300,6 +306,18 @@ This Python implementation provides the same API surface as the Node.js/TypeScri
300
306
 
301
307
  MIT License - see the [LICENSE](../LICENSE) file for details.
302
308
 
309
+ ## 📋 Release History
310
+
311
+ ### v0.1.4 (2025-01-27)
312
+ - Version synchronization update
313
+ - Package metadata improvements
314
+ - Documentation updates
315
+
316
+ ### v0.1.0 (2025-01-27)
317
+ - Initial release
318
+ - Core functionality implementation
319
+ - Complete API compatibility with Node.js version
320
+
303
321
  ## 🔗 Related
304
322
 
305
323
  - [Node.js/TypeScript Implementation](../src/)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "grasp_sdk"
7
- version = "0.1.4"
7
+ version = "0.1.6"
8
8
  authors = [
9
9
  {name = "Grasp Team", email = "team@grasp.com"},
10
10
  ]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes