grasp-sdk 0.1.4__py3-none-any.whl → 0.1.5__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.

Potentially problematic release.


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

grasp_sdk/__init__.py CHANGED
@@ -24,7 +24,7 @@ from .models import (
24
24
  SandboxStatus,
25
25
  )
26
26
 
27
- __version__ = "0.1.4"
27
+ __version__ = "0.1.5"
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
  }
@@ -201,6 +226,24 @@ try {
201
226
  level: 'info',
202
227
  data: { sandboxId }
203
228
  });
229
+
230
+ const closeId = 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
+ setTimeout(() => {
241
+ if(wsId === closeId) {
242
+ console.log('❌ Force closed...', wsId);
243
+ process.exit(0);
244
+ }
245
+ }, keepAliveMS);
246
+ });
204
247
  });
205
248
 
206
249
  proxy.on('proxyReqWs', (proxyReq, req, socket, options, head) => {
@@ -222,23 +265,6 @@ try {
222
265
  extra: { url: req?.url }
223
266
  });
224
267
  });
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
268
 
243
269
  const server = http.createServer(async (req, res) => {
244
270
  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
 
@@ -196,6 +197,24 @@ try {
196
197
  level: 'info',
197
198
  data: { sandboxId }
198
199
  });
200
+
201
+ const closeId = 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
+ setTimeout(() => {
212
+ if(wsId === closeId) {
213
+ console.log('❌ Force closed...', wsId);
214
+ process.exit(0);
215
+ }
216
+ }, keepAliveMS);
217
+ });
199
218
  });
200
219
 
201
220
  proxy.on('proxyReqWs', (proxyReq, req, socket, options, head) => {
@@ -217,23 +236,6 @@ try {
217
236
  extra: { url: req?.url }
218
237
  });
219
238
  });
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
239
 
238
240
  const server = http.createServer(async (req, res) => {
239
241
  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.5
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,7 @@
1
- grasp_sdk/__init__.py,sha256=mrVv_PJNafRp0xb1P0ZAZ0akMPi-uE1IKnjkfQN-PMo,8621
1
+ grasp_sdk/__init__.py,sha256=wJdchdfNnMLhGBp-t6v3Up1zfxvQf67NwuZDwTopAL0,8621
2
2
  grasp_sdk/models/__init__.py,sha256=lAlbb9tG8fsKz1fo2IVr30pGVytU5V-KblDAzZnLbVQ,2738
3
- grasp_sdk/sandbox/chrome-stable.mjs,sha256=M7EwEr2UVlatkoBUoyik8Yer-fsyCdTv4GsGLFGhaAQ,11575
4
- grasp_sdk/sandbox/chromium.mjs,sha256=ojNhKHAtFfJ1X6G0zJm4-Vt-8W21EZM2VbXXth3Zikc,11719
3
+ grasp_sdk/sandbox/chrome-stable.mjs,sha256=UVgt7_AiUEwZ1ndQr78tDXlb8hPKQ_lwtO6nhyCBFyM,12328
4
+ grasp_sdk/sandbox/chromium.mjs,sha256=AedeHdh2H-RRvMUSS2Yf2kQKEagKepAC-3Yh7OkA5qE,11840
5
5
  grasp_sdk/services/__init__.py,sha256=HqRD-WRedLwOb2gZPXPFzI-3892VT9IknKSbuDyiss8,327
6
6
  grasp_sdk/services/browser.py,sha256=7pHvAFgEVwY4w_QQf_wr70F6DM4q1OntF700P217PHI,14566
7
7
  grasp_sdk/services/sandbox.py,sha256=QWOvuv7RO7zU67bsKFottBSCa9039fLqw8cn5d83qAw,22018
@@ -9,8 +9,8 @@ grasp_sdk/utils/__init__.py,sha256=IQzRV-iZJXanSlaXBcgXBCcOXTVBCY6ZujxQpDTGW9w,8
9
9
  grasp_sdk/utils/auth.py,sha256=M_SX3uKTjjfi6fzk384IqPvUtqt98bif22HHMgio1D4,7258
10
10
  grasp_sdk/utils/config.py,sha256=txnmKQ6nxw-wvOBmr9mkZiWX7ROKwyHQLBpM_Wy9XZI,4171
11
11
  grasp_sdk/utils/logger.py,sha256=k6WDmzL3cPTcQbiiTD4Q6fsDdUO_kyXQHz7nlmtv7G4,7228
12
- grasp_sdk-0.1.4.dist-info/METADATA,sha256=ucSsrgoV4SJgkJNig7FwgNWvWdb82CnsZ1-eJaBGiZM,9522
13
- grasp_sdk-0.1.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
- grasp_sdk-0.1.4.dist-info/entry_points.txt,sha256=roDjUu4JR6b1tUtRmq018mw167AbfC5zQiOtv3o6IMo,45
15
- grasp_sdk-0.1.4.dist-info/top_level.txt,sha256=C9GL798_aP9Hgjq7UUlaGHLDfUohO2PSGYuGDV0cMx8,10
16
- grasp_sdk-0.1.4.dist-info/RECORD,,
12
+ grasp_sdk-0.1.5.dist-info/METADATA,sha256=2A7hZzcDXZrJI2MfjJ6hOuj-1QrC7rrGKRQyFJGqXWU,10167
13
+ grasp_sdk-0.1.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
+ grasp_sdk-0.1.5.dist-info/entry_points.txt,sha256=roDjUu4JR6b1tUtRmq018mw167AbfC5zQiOtv3o6IMo,45
15
+ grasp_sdk-0.1.5.dist-info/top_level.txt,sha256=C9GL798_aP9Hgjq7UUlaGHLDfUohO2PSGYuGDV0cMx8,10
16
+ grasp_sdk-0.1.5.dist-info/RECORD,,