novita-sandbox 1.0.0

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Novita AI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,105 @@
1
+ # Novita Agent Sandbox JS SDK
2
+
3
+ A TypeScript/JavaScript SDK for Novita Agent Sandbox environments that provides code execution, desktop automation, and cloud computing capabilities. Compatible with e2b.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Novita Agent Sandbox JS SDK](#novita-agent-sandbox-js-sdk)
8
+ - [Table of Contents](#table-of-contents)
9
+ - [Installation](#installation)
10
+ - [Features](#features)
11
+ - [Authentication](#authentication)
12
+ - [Usage](#usage)
13
+ - [Core Sandbox](#core-sandbox)
14
+ - [Code Interpreter](#code-interpreter)
15
+ - [Desktop Automation](#desktop-automation)
16
+ - [Documentation](#documentation)
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ npm install novita-sandbox
22
+ ```
23
+
24
+ ## Features
25
+
26
+ - **Code Interpreter**: Execute Python, JavaScript, and other languages in isolated environments
27
+ - **Desktop Automation**: Control desktop applications and GUI interactions
28
+ - **Cloud Computing**: Scalable sandbox environments for various computing tasks
29
+ - **Data Visualization**: Built-in charting and visualization capabilities
30
+ - **File System Operations**: Complete file system management and monitoring
31
+
32
+ ## Authentication
33
+
34
+ Get your Novita API key from [here](https://novita.ai/settings/key-management).
35
+
36
+ ## Usage
37
+
38
+ ### Core Sandbox
39
+
40
+ The basic package provides core functionality for interacting with sandbox environments.
41
+
42
+ ```typescript
43
+ import { Sandbox } from 'novita-sandbox';
44
+
45
+ // Using the official template `base` by default.
46
+ const sandbox = await Sandbox.create(
47
+ "base",
48
+ {
49
+ apiKey: process.env.NOVITA_API_KEY || '',
50
+ },
51
+ );
52
+
53
+ // File operations
54
+ await sandbox.files.write('/tmp/test.txt', 'Hello, World!');
55
+ const content = await sandbox.files.read('/tmp/test.txt');
56
+
57
+ // Command execution
58
+ const result = await sandbox.commands.run('ls -la /tmp');
59
+ console.log(result.stdout);
60
+
61
+ // Real-time monitoring
62
+ sandbox.files.watchDir('/tmp', (event) => {
63
+ console.log(`File ${event.name} was ${event.type}`);
64
+ });
65
+ ```
66
+
67
+ ### Code Interpreter
68
+
69
+ The Code Interpreter sandbox provides a Jupyter-like environment for executing code using the official `code-interpreter-v1` template.
70
+
71
+ ```typescript
72
+ import { Sandbox } from 'novita-sandbox/code-interpreter';
73
+
74
+ const sandbox = await Sandbox.create({
75
+ apiKey: process.env.NOVITA_API_KEY || '',
76
+ });
77
+
78
+ // Execute Python code
79
+ const result = await sandbox.runCode('print("Hello, World!")');
80
+ console.log(result.logs);
81
+ ```
82
+
83
+ ### Desktop Automation
84
+
85
+ The Desktop sandbox allows you to control desktop environments programmatically using the official `desktop` template.
86
+
87
+ ```typescript
88
+ import { Sandbox } from 'novita-sandbox/desktop';
89
+
90
+ const desktop = await Sandbox.create({
91
+ apiKey: process.env.NOVITA_API_KEY || ''
92
+ });
93
+
94
+ // Take a screenshot
95
+ const screenshot = await desktop.screenshot();
96
+
97
+ // Automate mouse and keyboard
98
+ await desktop.leftClick(100, 200);
99
+ await desktop.press('Enter');
100
+ await desktop.write('Hello, World!');
101
+ ```
102
+
103
+ ## Documentation
104
+
105
+ For comprehensive guides and API reference, visit the [official documentation](https://novita.ai/docs/guides/sandbox-overview).