hopx-ai 0.1.10__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 hopx-ai might be problematic. Click here for more details.
- hopx_ai-0.1.10/.gitignore +45 -0
- hopx_ai-0.1.10/CHANGELOG.md +92 -0
- hopx_ai-0.1.10/COOKBOOK_TEST_RESULTS.md +102 -0
- hopx_ai-0.1.10/DESKTOP_AUTOMATION.md +550 -0
- hopx_ai-0.1.10/FIXES_APPLIED_v0.1.9.md +143 -0
- hopx_ai-0.1.10/INVESTIGATION_RESULTS.md +196 -0
- hopx_ai-0.1.10/PKG-INFO +460 -0
- hopx_ai-0.1.10/README.md +427 -0
- hopx_ai-0.1.10/agent_test_report.json +87 -0
- hopx_ai-0.1.10/bunnyshell/_async_client.py +230 -0
- hopx_ai-0.1.10/bunnyshell/_client.py +230 -0
- hopx_ai-0.1.10/example_dx_showcase.py +230 -0
- hopx_ai-0.1.10/examples/agent_code_execution.py +222 -0
- hopx_ai-0.1.10/examples/agent_commands.py +120 -0
- hopx_ai-0.1.10/examples/agent_complete_workflow.py +223 -0
- hopx_ai-0.1.10/examples/agent_files.py +108 -0
- hopx_ai-0.1.10/examples/agent_v3_1_1_error_codes.py +99 -0
- hopx_ai-0.1.10/examples/agent_v3_1_features.py +122 -0
- hopx_ai-0.1.10/examples/async_iterator.py +43 -0
- hopx_ai-0.1.10/examples/async_quick_start.py +36 -0
- hopx_ai-0.1.10/examples/context_manager.py +24 -0
- hopx_ai-0.1.10/examples/debug_logging.py +42 -0
- hopx_ai-0.1.10/examples/desktop_automation.py +103 -0
- hopx_ai-0.1.10/examples/desktop_complete_workflow.py +164 -0
- hopx_ai-0.1.10/examples/desktop_screenshot_recording.py +98 -0
- hopx_ai-0.1.10/examples/desktop_vnc.py +54 -0
- hopx_ai-0.1.10/examples/desktop_windows.py +99 -0
- hopx_ai-0.1.10/examples/lazy_iterator.py +35 -0
- hopx_ai-0.1.10/examples/lifecycle.py +54 -0
- hopx_ai-0.1.10/examples/list_sandboxes.py +38 -0
- hopx_ai-0.1.10/examples/quick_start.py +30 -0
- hopx_ai-0.1.10/examples/rotate_api_keys.py +108 -0
- hopx_ai-0.1.10/examples/template_build.py +93 -0
- hopx_ai-0.1.10/examples/template_nodejs.py +61 -0
- hopx_ai-0.1.10/examples/templates.py +41 -0
- hopx_ai-0.1.10/hopx_ai/__init__.py +114 -0
- hopx_ai-0.1.10/hopx_ai/_agent_client.py +373 -0
- hopx_ai-0.1.10/hopx_ai/_async_client.py +230 -0
- hopx_ai-0.1.10/hopx_ai/_client.py +230 -0
- hopx_ai-0.1.10/hopx_ai/_generated/__init__.py +22 -0
- hopx_ai-0.1.10/hopx_ai/_generated/models.py +502 -0
- hopx_ai-0.1.10/hopx_ai/_utils.py +9 -0
- hopx_ai-0.1.10/hopx_ai/_ws_client.py +141 -0
- hopx_ai-0.1.10/hopx_ai/async_sandbox.py +427 -0
- hopx_ai-0.1.10/hopx_ai/cache.py +97 -0
- hopx_ai-0.1.10/hopx_ai/commands.py +174 -0
- hopx_ai-0.1.10/hopx_ai/desktop.py +1227 -0
- hopx_ai-0.1.10/hopx_ai/env_vars.py +242 -0
- hopx_ai-0.1.10/hopx_ai/errors.py +249 -0
- hopx_ai-0.1.10/hopx_ai/files.py +489 -0
- hopx_ai-0.1.10/hopx_ai/models.py +274 -0
- hopx_ai-0.1.10/hopx_ai/models_updated.py +270 -0
- hopx_ai-0.1.10/hopx_ai/sandbox.py +1439 -0
- hopx_ai-0.1.10/hopx_ai/template/__init__.py +47 -0
- hopx_ai-0.1.10/hopx_ai/template/build_flow.py +540 -0
- hopx_ai-0.1.10/hopx_ai/template/builder.py +300 -0
- hopx_ai-0.1.10/hopx_ai/template/file_hasher.py +81 -0
- hopx_ai-0.1.10/hopx_ai/template/ready_checks.py +106 -0
- hopx_ai-0.1.10/hopx_ai/template/tar_creator.py +122 -0
- hopx_ai-0.1.10/hopx_ai/template/types.py +199 -0
- hopx_ai-0.1.10/hopx_ai/terminal.py +164 -0
- hopx_ai-0.1.10/pyproject.toml +66 -0
- hopx_ai-0.1.10/test_agent_comprehensive.py +677 -0
- hopx_ai-0.1.10/test_agent_v3_1_1.py +401 -0
- hopx_ai-0.1.10/test_agent_v3_1_improvements.py +301 -0
- hopx_ai-0.1.10/test_all_features.py +159 -0
- hopx_ai-0.1.10/test_api_endpoints.py +127 -0
- hopx_ai-0.1.10/test_async_live.py +95 -0
- hopx_ai-0.1.10/test_env_vars.py +103 -0
- hopx_ai-0.1.10/test_hybrid_complete.py +101 -0
- hopx_ai-0.1.10/test_hybrid_live.py +86 -0
- hopx_ai-0.1.10/test_improvements.py +174 -0
- hopx_ai-0.1.10/test_jwt_api.py +77 -0
- hopx_ai-0.1.10/test_jwt_auth.py +152 -0
- hopx_ai-0.1.10/test_jwt_simple.py +109 -0
- hopx_ai-0.1.10/test_live.py +86 -0
- hopx_ai-0.1.10/test_logs_polling.py +100 -0
- hopx_ai-0.1.10/test_logs_simple.py +60 -0
- hopx_ai-0.1.10/test_qa_comprehensive.py +497 -0
- hopx_ai-0.1.10/test_qa_simple.py +276 -0
- hopx_ai-0.1.10/test_sdk_e2e_template.py +266 -0
- hopx_ai-0.1.10/test_template_comprehensive.py +881 -0
- hopx_ai-0.1.10/test_template_id.py +70 -0
- hopx_ai-0.1.10/test_template_id_final.py +67 -0
- hopx_ai-0.1.10/test_template_name.py +62 -0
- hopx_ai-0.1.10/test_websocket_features.py +136 -0
- hopx_ai-0.1.10/test_with_real_key.py +511 -0
- hopx_ai-0.1.10/test_working_features.py +123 -0
- hopx_ai-0.1.10/vm_agent_openapi.md +1545 -0
- hopx_ai-0.1.10/vm_agent_openapi_script.md +338 -0
- hopx_ai-0.1.10/vm_api_agent_readme.md +485 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Virtual environment
|
|
2
|
+
venv/
|
|
3
|
+
env/
|
|
4
|
+
ENV/
|
|
5
|
+
|
|
6
|
+
# Python
|
|
7
|
+
__pycache__/
|
|
8
|
+
*.py[cod]
|
|
9
|
+
*$py.class
|
|
10
|
+
*.so
|
|
11
|
+
.Python
|
|
12
|
+
build/
|
|
13
|
+
develop-eggs/
|
|
14
|
+
dist/
|
|
15
|
+
downloads/
|
|
16
|
+
eggs/
|
|
17
|
+
.eggs/
|
|
18
|
+
lib/
|
|
19
|
+
lib64/
|
|
20
|
+
parts/
|
|
21
|
+
sdist/
|
|
22
|
+
var/
|
|
23
|
+
wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# Testing
|
|
30
|
+
.pytest_cache/
|
|
31
|
+
.coverage
|
|
32
|
+
htmlcov/
|
|
33
|
+
.tox/
|
|
34
|
+
|
|
35
|
+
# IDE
|
|
36
|
+
.vscode/
|
|
37
|
+
.idea/
|
|
38
|
+
*.swp
|
|
39
|
+
*.swo
|
|
40
|
+
.DS_Store
|
|
41
|
+
|
|
42
|
+
# Test files
|
|
43
|
+
test_live.py
|
|
44
|
+
*.log
|
|
45
|
+
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the Bunnyshell Python SDK will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.10] - 2025-11-09
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **CRITICAL**: Fixed `template_id` type conversion issue when creating sandboxes from built templates
|
|
12
|
+
- Template build API returns integer template_id (e.g., `83`)
|
|
13
|
+
- Sandbox create API expects string template_id (e.g., `"83"`)
|
|
14
|
+
- SDK now automatically converts `template_id` to string in both `Sandbox.create()` and `AsyncSandbox.create()`
|
|
15
|
+
- Fixes error: `NotFoundError: The template '83' was not found`
|
|
16
|
+
|
|
17
|
+
### Technical Details
|
|
18
|
+
- Added `str(template_id)` conversion in `sandbox.py` and `async_sandbox.py`
|
|
19
|
+
- Works with both integer and string `template_id` values
|
|
20
|
+
- Maintains backward compatibility
|
|
21
|
+
|
|
22
|
+
## [0.1.9] - 2025-11-09
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
- **NEW**: `timeout_seconds` parameter in `Sandbox.create()` - auto-kill sandbox after specified seconds
|
|
26
|
+
- **NEW**: `internet_access` parameter in `Sandbox.create()` - enable/disable internet access (default: True)
|
|
27
|
+
- Support for both parameters in sync (`Sandbox`) and async (`AsyncSandbox`) versions
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
- **BREAKING**: Renamed parameter `timeout` → `timeout_seconds` to match API specification
|
|
31
|
+
- Old parameter was never functional (not sent to API), so impact is minimal
|
|
32
|
+
- Migration: Change `timeout=300` to `timeout_seconds=300`
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
- `timeout_seconds` now correctly sent to API (was previously ignored)
|
|
36
|
+
|
|
37
|
+
## [0.1.8] - 2025-11-07
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
- **CRITICAL**: Fixed IPv6 timeout issue causing 60-270 second delays on all API calls
|
|
41
|
+
- Forced IPv4 resolution in HTTPClient, AgentHTTPClient, and AsyncHTTPClient
|
|
42
|
+
- Performance improvement: 120-600x faster API calls (from 60-270s to 0.2-0.5s)
|
|
43
|
+
- Fixed `/execute` endpoint usage (was using `/execute/rich` which returned kernel setup code)
|
|
44
|
+
- Added agent readiness check with retry to avoid 401 errors on newly created sandboxes
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
- Updated HTTPClient transport to use `local_address="0.0.0.0"` to force IPv4
|
|
48
|
+
- Updated AgentHTTPClient transport to use `local_address="0.0.0.0"` to force IPv4
|
|
49
|
+
- Updated AsyncHTTPClient transport to use `local_address="0.0.0.0"` to force IPv4
|
|
50
|
+
- Improved agent initialization with health check and retry logic
|
|
51
|
+
|
|
52
|
+
### Performance
|
|
53
|
+
- Create sandbox: 60-270s → 0.5s (120-600x faster)
|
|
54
|
+
- Get info: 60s → 0.2s (300x faster)
|
|
55
|
+
- Run code: 60s → 0.5s (120x faster)
|
|
56
|
+
|
|
57
|
+
## [0.1.7] - 2024-10-22
|
|
58
|
+
|
|
59
|
+
### Added
|
|
60
|
+
- Template building support
|
|
61
|
+
- Desktop automation features
|
|
62
|
+
- WebSocket features for streaming
|
|
63
|
+
- Advanced use cases examples
|
|
64
|
+
|
|
65
|
+
## [0.1.6] - 2024-10-15
|
|
66
|
+
|
|
67
|
+
### Added
|
|
68
|
+
- Environment variables management
|
|
69
|
+
- Process management
|
|
70
|
+
- Cache management
|
|
71
|
+
|
|
72
|
+
## [0.1.5] - 2024-10-08
|
|
73
|
+
|
|
74
|
+
### Added
|
|
75
|
+
- File operations (read, write, upload, download)
|
|
76
|
+
- Command execution
|
|
77
|
+
- IPython kernel support
|
|
78
|
+
|
|
79
|
+
## [0.1.4] - 2024-10-01
|
|
80
|
+
|
|
81
|
+
### Added
|
|
82
|
+
- Basic code execution
|
|
83
|
+
- Multiple language support (Python, JavaScript, Bash, Go)
|
|
84
|
+
- Background execution
|
|
85
|
+
|
|
86
|
+
## [0.1.0] - 2024-09-15
|
|
87
|
+
|
|
88
|
+
### Added
|
|
89
|
+
- Initial release
|
|
90
|
+
- Basic sandbox creation and management
|
|
91
|
+
- Sync and async support
|
|
92
|
+
- JWT authentication
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Python SDK Cookbook Test Results
|
|
2
|
+
|
|
3
|
+
**Date**: November 7, 2025
|
|
4
|
+
**Python SDK Version**: 0.1.8
|
|
5
|
+
**Total Tests**: 10 cookbook examples
|
|
6
|
+
|
|
7
|
+
## Summary
|
|
8
|
+
|
|
9
|
+
| Test | Status | Issues Found |
|
|
10
|
+
|------|--------|--------------|
|
|
11
|
+
| 01_basic_operations.py | ✅ PASS | None |
|
|
12
|
+
| 02_code_execution.py | ✅ MOSTLY PASS | Timeout test fails (intentional) |
|
|
13
|
+
| 03_file_operations.py | ✅ MOSTLY PASS | plot.png not found (minor) |
|
|
14
|
+
| 04_commands.py | ⚠️ PASS w/ISSUE | Commands return empty output |
|
|
15
|
+
| 05_environment_variables.py | ❌ FAIL | env.set_all() JSON parse error |
|
|
16
|
+
| 06_process_management.py | ❌ FAIL | list_processes() returns dict not objects |
|
|
17
|
+
| 07_desktop_automation.py | ⏭️ SKIPPED | Advanced feature |
|
|
18
|
+
| 08_websocket_features.py | ⏭️ SKIPPED | Advanced feature |
|
|
19
|
+
| 09_advanced_use_cases.py | ✅ MOSTLY PASS | Report generation fails |
|
|
20
|
+
| 10_best_practices.py | ✅ MOSTLY PASS | env.set_all() error (same as #5) |
|
|
21
|
+
|
|
22
|
+
## Critical Issues to Fix
|
|
23
|
+
|
|
24
|
+
### 1. ❌ CRITICAL: `env.set_all()` JSON Parse Error
|
|
25
|
+
|
|
26
|
+
**File**: `bunnyshell/env_vars.py`
|
|
27
|
+
**Line**: 121
|
|
28
|
+
**Error**: `json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)`
|
|
29
|
+
|
|
30
|
+
**Problem**: Agent returns 204 No Content (empty response), but SDK tries to parse JSON
|
|
31
|
+
|
|
32
|
+
**Tests Affected**:
|
|
33
|
+
- 05_environment_variables.py
|
|
34
|
+
- 10_best_practices.py
|
|
35
|
+
|
|
36
|
+
**Fix Needed**: Handle 204 No Content response in `set_all()` method
|
|
37
|
+
|
|
38
|
+
### 2. ⚠️ MAJOR: `commands.run()` Returns Empty Output
|
|
39
|
+
|
|
40
|
+
**File**: `bunnyshell/commands.py`
|
|
41
|
+
**Error**: Commands execute but return:
|
|
42
|
+
```python
|
|
43
|
+
success: False
|
|
44
|
+
exit_code: 1
|
|
45
|
+
stdout: []
|
|
46
|
+
stderr: []
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Tests Affected**:
|
|
50
|
+
- 04_commands.py (all command examples return empty)
|
|
51
|
+
|
|
52
|
+
**Fix Needed**: Investigate why `/commands/run` endpoint returns empty output
|
|
53
|
+
|
|
54
|
+
### 3. ⚠️ MAJOR: `list_processes()` Returns Dict Not Objects
|
|
55
|
+
|
|
56
|
+
**File**: `bunnyshell/sandbox.py` line ~1086
|
|
57
|
+
**Error**: `AttributeError: 'dict' object has no attribute 'pid'`
|
|
58
|
+
|
|
59
|
+
**Problem**: SDK returns raw dict instead of Process objects
|
|
60
|
+
|
|
61
|
+
**Tests Affected**:
|
|
62
|
+
- 06_process_management.py
|
|
63
|
+
|
|
64
|
+
**Fix Needed**: Parse response and return proper objects or update cookbook example
|
|
65
|
+
|
|
66
|
+
## Minor Issues
|
|
67
|
+
|
|
68
|
+
### 4. ℹ️ MINOR: plot.png Not Found
|
|
69
|
+
|
|
70
|
+
**Test**: 03_file_operations.py
|
|
71
|
+
**Issue**: Matplotlib plot not saved correctly
|
|
72
|
+
**Impact**: Low - example issue, not SDK issue
|
|
73
|
+
|
|
74
|
+
### 5. ℹ️ MINOR: Report Generation Fails
|
|
75
|
+
|
|
76
|
+
**Test**: 09_advanced_use_cases.py
|
|
77
|
+
**Issue**: PDF not generated (reportlab not installed in sandbox)
|
|
78
|
+
**Impact**: Low - example issue, needs package installation
|
|
79
|
+
|
|
80
|
+
## Fixes Already Applied
|
|
81
|
+
|
|
82
|
+
✅ **Fixed**: `FileNotFoundError` duplicate code parameter
|
|
83
|
+
- Changed from `super().__init__(message, code="...", **kwargs)`
|
|
84
|
+
- To: `kwargs.setdefault('code', '...'); super().__init__(message, **kwargs)`
|
|
85
|
+
- Applied to: FileNotFoundError, CodeExecutionError, CommandExecutionError, DesktopNotAvailableError
|
|
86
|
+
|
|
87
|
+
## Next Steps
|
|
88
|
+
|
|
89
|
+
1. **Fix `env.set_all()`** - Handle 204 No Content response
|
|
90
|
+
2. **Fix `commands.run()`** - Investigate empty output issue
|
|
91
|
+
3. **Fix `list_processes()`** - Return proper objects or update examples
|
|
92
|
+
4. **Test again** - Re-run all cookbook examples
|
|
93
|
+
5. **Publish v0.1.9** - With all fixes
|
|
94
|
+
|
|
95
|
+
## Overall Assessment
|
|
96
|
+
|
|
97
|
+
**Core functionality**: ✅ Works (basic operations, code execution, file operations)
|
|
98
|
+
**Advanced features**: ⚠️ Need fixes (commands, env vars, process management)
|
|
99
|
+
**Critical performance fix**: ✅ IPv4 fix working perfectly (120-600x faster)
|
|
100
|
+
|
|
101
|
+
The SDK is **usable** for core features but needs fixes for advanced functionality.
|
|
102
|
+
|