scalebox-sdk 0.1.12__py3-none-any.whl → 0.1.13__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.
- scalebox/__init__.py +1 -1
- scalebox/test/aclient.py +72 -72
- scalebox/test/code_interpreter_centext.py +21 -21
- scalebox/test/code_interpreter_centext_sync.py +21 -21
- scalebox/test/code_interpreter_test.py +34 -34
- scalebox/test/code_interpreter_test_sync.py +34 -34
- scalebox/test/run_all_validation_tests.py +334 -334
- scalebox/test/test_basic.py +78 -78
- scalebox/test/test_code_interpreter_async_comprehensive.py +2653 -2653
- scalebox/test/test_code_interpreter_e2basync_comprehensive.py +2655 -2655
- scalebox/test/test_code_interpreter_e2bsync_comprehensive.py +3416 -3416
- scalebox/test/test_code_interpreter_execcode.py +3352 -0
- scalebox/test/test_code_interpreter_sync_comprehensive.py +3416 -3412
- scalebox/test/test_csx_desktop_examples.py +130 -0
- scalebox/test/test_e2b_first.py +11 -11
- scalebox/test/test_sandbox_async_comprehensive.py +736 -738
- scalebox/test/test_sandbox_stress_and_edge_cases.py +778 -778
- scalebox/test/test_sandbox_sync_comprehensive.py +779 -770
- scalebox/test/test_sandbox_usage_examples.py +987 -987
- scalebox/test/testacreate.py +24 -24
- scalebox/test/testagetinfo.py +18 -18
- scalebox/test/testcodeinterpreter_async.py +508 -508
- scalebox/test/testcodeinterpreter_sync.py +239 -239
- scalebox/test/testcomputeuse.py +245 -243
- scalebox/test/testnovnc.py +12 -12
- scalebox/test/testsandbox_async.py +202 -118
- scalebox/test/testsandbox_sync.py +71 -38
- scalebox/version.py +2 -2
- {scalebox_sdk-0.1.12.dist-info → scalebox_sdk-0.1.13.dist-info}/METADATA +1 -1
- {scalebox_sdk-0.1.12.dist-info → scalebox_sdk-0.1.13.dist-info}/RECORD +34 -32
- {scalebox_sdk-0.1.12.dist-info → scalebox_sdk-0.1.13.dist-info}/WHEEL +0 -0
- {scalebox_sdk-0.1.12.dist-info → scalebox_sdk-0.1.13.dist-info}/entry_points.txt +0 -0
- {scalebox_sdk-0.1.12.dist-info → scalebox_sdk-0.1.13.dist-info}/licenses/LICENSE +0 -0
- {scalebox_sdk-0.1.12.dist-info → scalebox_sdk-0.1.13.dist-info}/top_level.txt +0 -0
|
@@ -1,118 +1,202 @@
|
|
|
1
|
-
import asyncio
|
|
2
|
-
|
|
3
|
-
from sandbox_async.main import AsyncSandbox
|
|
4
|
-
|
|
5
|
-
from scalebox.sandbox.commands.command_handle import PtySize
|
|
6
|
-
|
|
7
|
-
# from scalebox.sandbox_async.main import AsyncSandbox
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
async def pty_output_handler(output):
|
|
11
|
-
"""处理 PTY 输出的回调函数"""
|
|
12
|
-
print(f"PTY 输出: {output}")
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
async def main():
|
|
16
|
-
sandbox = AsyncSandbox()
|
|
17
|
-
proc = await sandbox.commands.run("echo hello from async")
|
|
18
|
-
print("exit_code =", proc.exit_code)
|
|
19
|
-
print("stdout =", proc.stdout)
|
|
20
|
-
# 4. 创建 PTY
|
|
21
|
-
pty_size = PtySize(rows=24, cols=80)
|
|
22
|
-
pty_handle = await sandbox.pty.create(
|
|
23
|
-
size=pty_size,
|
|
24
|
-
on_data=pty_output_handler,
|
|
25
|
-
cwd="/root",
|
|
26
|
-
envs={"CUSTOM_ENV": "value"},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
1
|
+
import asyncio
|
|
2
|
+
|
|
3
|
+
from sandbox_async.main import AsyncSandbox
|
|
4
|
+
|
|
5
|
+
from scalebox.sandbox.commands.command_handle import PtySize
|
|
6
|
+
|
|
7
|
+
# from scalebox.sandbox_async.main import AsyncSandbox
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
async def pty_output_handler(output):
|
|
11
|
+
"""处理 PTY 输出的回调函数"""
|
|
12
|
+
print(f"PTY 输出: {output}")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
async def main():
|
|
16
|
+
sandbox = await (AsyncSandbox.create(timeout=3600))
|
|
17
|
+
proc = await sandbox.commands.run("echo hello from async")
|
|
18
|
+
print("exit_code =", proc.exit_code)
|
|
19
|
+
print("stdout =", proc.stdout)
|
|
20
|
+
# 4. 创建 PTY
|
|
21
|
+
pty_size = PtySize(rows=24, cols=80)
|
|
22
|
+
pty_handle = await sandbox.pty.create(
|
|
23
|
+
size=pty_size,
|
|
24
|
+
on_data=pty_output_handler,
|
|
25
|
+
cwd="/root",
|
|
26
|
+
envs={"CUSTOM_ENV": "value"},
|
|
27
|
+
request_timeout=40
|
|
28
|
+
)
|
|
29
|
+
print(f"PTY 已创建,PID: {pty_handle.pid}")
|
|
30
|
+
|
|
31
|
+
# 5. 向 PTY 发送输入
|
|
32
|
+
await sandbox.pty.send_stdin(
|
|
33
|
+
pid=pty_handle.pid,
|
|
34
|
+
data=b"echo 'Hello from PTY 0s'\n",
|
|
35
|
+
request_timeout=10
|
|
36
|
+
)
|
|
37
|
+
await asyncio.sleep(30)
|
|
38
|
+
await sandbox.pty.send_stdin(
|
|
39
|
+
pid=pty_handle.pid,
|
|
40
|
+
data=b"echo 'Hello from PTY 30s'\n",
|
|
41
|
+
request_timeout=10
|
|
42
|
+
)
|
|
43
|
+
await asyncio.sleep(30)
|
|
44
|
+
await sandbox.pty.send_stdin(
|
|
45
|
+
pid=pty_handle.pid,
|
|
46
|
+
data=b"echo 'Hello from PTY 60s'\n",
|
|
47
|
+
request_timeout=10
|
|
48
|
+
)
|
|
49
|
+
await asyncio.sleep(30)
|
|
50
|
+
await sandbox.pty.send_stdin(
|
|
51
|
+
pid=pty_handle.pid,
|
|
52
|
+
data=b"echo 'Hello from PTY 90s'\n",
|
|
53
|
+
request_timeout=10
|
|
54
|
+
)
|
|
55
|
+
await asyncio.sleep(30)
|
|
56
|
+
await sandbox.pty.send_stdin(
|
|
57
|
+
pid=pty_handle.pid,
|
|
58
|
+
data=b"echo 'Hello from PTY 120s'\n",
|
|
59
|
+
request_timeout=10
|
|
60
|
+
)
|
|
61
|
+
await asyncio.sleep(30)
|
|
62
|
+
await sandbox.pty.send_stdin(
|
|
63
|
+
pid=pty_handle.pid,
|
|
64
|
+
data=b"echo 'Hello from PTY 150s'\n",
|
|
65
|
+
request_timeout=10
|
|
66
|
+
)
|
|
67
|
+
await asyncio.sleep(30)
|
|
68
|
+
await sandbox.pty.send_stdin(
|
|
69
|
+
pid=pty_handle.pid,
|
|
70
|
+
data=b"echo 'Hello from PTY 180s'\n",
|
|
71
|
+
request_timeout=10
|
|
72
|
+
)
|
|
73
|
+
await asyncio.sleep(30)
|
|
74
|
+
await sandbox.pty.send_stdin(
|
|
75
|
+
pid=pty_handle.pid,
|
|
76
|
+
data=b"echo 'Hello from PTY 210s'\n",
|
|
77
|
+
request_timeout=10
|
|
78
|
+
)
|
|
79
|
+
await asyncio.sleep(30)
|
|
80
|
+
await sandbox.pty.send_stdin(
|
|
81
|
+
pid=pty_handle.pid,
|
|
82
|
+
data=b"echo 'Hello from PTY 240s'\n",
|
|
83
|
+
request_timeout=10
|
|
84
|
+
)
|
|
85
|
+
await asyncio.sleep(30)
|
|
86
|
+
await sandbox.pty.send_stdin(
|
|
87
|
+
pid=pty_handle.pid,
|
|
88
|
+
data=b"echo 'Hello from PTY 270s'\n",
|
|
89
|
+
request_timeout=10
|
|
90
|
+
)
|
|
91
|
+
await asyncio.sleep(30)
|
|
92
|
+
await sandbox.pty.send_stdin(
|
|
93
|
+
pid=pty_handle.pid,
|
|
94
|
+
data=b"echo 'Hello from PTY 300s'\n",
|
|
95
|
+
request_timeout=10
|
|
96
|
+
)
|
|
97
|
+
await asyncio.sleep(30)
|
|
98
|
+
await sandbox.pty.send_stdin(
|
|
99
|
+
pid=pty_handle.pid,
|
|
100
|
+
data=b"echo 'Hello from PTY 330s'\n",
|
|
101
|
+
request_timeout=10
|
|
102
|
+
)
|
|
103
|
+
await asyncio.sleep(30)
|
|
104
|
+
await sandbox.pty.send_stdin(
|
|
105
|
+
pid=pty_handle.pid,
|
|
106
|
+
data=b"echo 'Hello from PTY 360s'\n",
|
|
107
|
+
request_timeout=10
|
|
108
|
+
)
|
|
109
|
+
await asyncio.sleep(30)
|
|
110
|
+
await sandbox.pty.send_stdin(
|
|
111
|
+
pid=pty_handle.pid,
|
|
112
|
+
data=b"echo 'Hello from PTY 390s'\n",
|
|
113
|
+
request_timeout=10
|
|
114
|
+
)
|
|
115
|
+
await asyncio.sleep(30)
|
|
116
|
+
await sandbox.pty.send_stdin(
|
|
117
|
+
pid=pty_handle.pid,
|
|
118
|
+
data=b"echo 'Hello from PTY 420s'\n",
|
|
119
|
+
request_timeout=10
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
# 6. 调整 PTY 大小
|
|
123
|
+
new_size = PtySize(rows=30, cols=100)
|
|
124
|
+
await sandbox.pty.resize(pid=pty_handle.pid, size=new_size, request_timeout=10)
|
|
125
|
+
print("PTY 大小已调整")
|
|
126
|
+
killed = await sandbox.pty.kill(pty_handle.pid)
|
|
127
|
+
print(f"PTY 是否被杀死: {killed}")
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
# 静态方法使用示例
|
|
131
|
+
async def static_methods_example():
|
|
132
|
+
# 1. 创建沙箱
|
|
133
|
+
sandbox = await AsyncSandbox.create()
|
|
134
|
+
sandbox_id = sandbox.sandbox_id
|
|
135
|
+
|
|
136
|
+
try:
|
|
137
|
+
# 2. 使用静态方法获取沙箱信息
|
|
138
|
+
info = await AsyncSandbox.get_info(sandbox_id)
|
|
139
|
+
print(f"静态方法获取的沙箱信息: {info}")
|
|
140
|
+
|
|
141
|
+
# 3. 使用静态方法设置超时
|
|
142
|
+
await AsyncSandbox.set_timeout(sandbox_id, 1800) # 30分钟
|
|
143
|
+
|
|
144
|
+
# 4. 使用静态方法获取指标
|
|
145
|
+
try:
|
|
146
|
+
metrics = await AsyncSandbox.get_metrics(sandbox_id)
|
|
147
|
+
print(f"静态方法获取的指标: {metrics}")
|
|
148
|
+
except Exception as e:
|
|
149
|
+
print(f"静态方法获取指标失败: {e}")
|
|
150
|
+
|
|
151
|
+
finally:
|
|
152
|
+
# 5. 使用静态方法关闭沙箱
|
|
153
|
+
killed = await AsyncSandbox.kill(sandbox_id)
|
|
154
|
+
print(f"静态方法关闭沙箱结果: {killed}")
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
# 连接现有沙箱示例
|
|
158
|
+
async def connect_example():
|
|
159
|
+
# 1. 创建沙箱并获取ID
|
|
160
|
+
sandbox = await AsyncSandbox.create()
|
|
161
|
+
sandbox_id = sandbox.sandbox_id
|
|
162
|
+
await sandbox.kill() # 先关闭
|
|
163
|
+
|
|
164
|
+
# 2. 连接到现有沙箱
|
|
165
|
+
try:
|
|
166
|
+
connected_sandbox = await AsyncSandbox.connect(sandbox_id)
|
|
167
|
+
print(f"成功连接到沙箱: {connected_sandbox.sandbox_id}")
|
|
168
|
+
|
|
169
|
+
# 使用连接的沙箱
|
|
170
|
+
is_running = await connected_sandbox.is_running()
|
|
171
|
+
print(f"连接后沙箱状态: {is_running}")
|
|
172
|
+
|
|
173
|
+
await connected_sandbox.kill()
|
|
174
|
+
except Exception as e:
|
|
175
|
+
print(f"连接沙箱失败: {e}")
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
# 上下文管理器使用示例
|
|
179
|
+
async def context_manager_example():
|
|
180
|
+
sandbox = AsyncSandbox()
|
|
181
|
+
# async with AsyncSandbox() as sandbox:
|
|
182
|
+
# # 在上下文中使用沙箱
|
|
183
|
+
# is_running = await sandbox.is_running()
|
|
184
|
+
# print(f"上下文管理器中的沙箱状态: {is_running}")
|
|
185
|
+
|
|
186
|
+
# 创建和使用 PTY
|
|
187
|
+
pty_handle = await sandbox.pty.create(
|
|
188
|
+
size=PtySize(rows=24, cols=80), on_data=pty_output_handler
|
|
189
|
+
)
|
|
190
|
+
|
|
191
|
+
# 发送命令
|
|
192
|
+
await sandbox.pty.send_stdin(pty_handle.pid, b"ls -la\n")
|
|
193
|
+
|
|
194
|
+
# 等待一段时间
|
|
195
|
+
await asyncio.sleep(10)
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
if __name__ == "__main__":
|
|
199
|
+
asyncio.run(main())
|
|
200
|
+
# asyncio.run(static_methods_example())
|
|
201
|
+
# asyncio.run(connect_example())
|
|
202
|
+
# asyncio.run(context_manager_example())
|
|
@@ -1,38 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
sandbox = Sandbox(api_key=f"sk-Wk4IgtUYOqnttxGaxZmELEV4p2FXh15Evt0FIcSa")
|
|
11
|
-
# print(sandbox.files.list("/root",2))
|
|
12
|
-
# proc = sandbox.commands._start(
|
|
13
|
-
# cmd="python3 -c \"import math; print('π =', math.pi); exit(42)\"",
|
|
14
|
-
# ).wait(on_pty=None,
|
|
15
|
-
# on_stdout=lambda data: print("[STDOUT]", data, end=""),
|
|
16
|
-
# on_stderr=lambda data: print("[STDERR]", data, end=""),)
|
|
17
|
-
|
|
18
|
-
# proc = sandbox.commands._start(
|
|
19
|
-
# cmd="ls /",
|
|
20
|
-
# ).wait(on_pty=None,
|
|
21
|
-
# on_stdout=lambda data: print("[STDOUT]", data, end=""),
|
|
22
|
-
# on_stderr=lambda data: print("[STDERR]", data, end=""),)
|
|
23
|
-
#
|
|
24
|
-
# print("exit_code =", proc.exit_code) # 42
|
|
25
|
-
# print("full_output =", proc.stdout) # π = 3.141592653589793
|
|
26
|
-
# pty=sandbox.pty.create(size=PtySize(1024, 768),user="root",cwd="/root/",)
|
|
27
|
-
# sandbox.pty.send_stdin(pid=pty.pid,data=b"echo \"hello\"")
|
|
28
|
-
# sandbox.pty.send_stdin(pid=pty.pid,data=b"echo \"world!\"")
|
|
29
|
-
# result=pty.wait(
|
|
30
|
-
# on_pty=lambda data: print("[STDOUT]", data, end=""),
|
|
31
|
-
# )
|
|
32
|
-
# print("exit_code =", result.exit_code)
|
|
33
|
-
# print("full_output =", result.stdout)
|
|
34
|
-
result = sandbox.commands.run(
|
|
35
|
-
cmd="ls /", on_stdout=output_handler, on_stderr=output_handler
|
|
36
|
-
)
|
|
37
|
-
print(result.exit_code)
|
|
38
|
-
print(result.error)
|
|
1
|
+
import time
|
|
2
|
+
|
|
3
|
+
from scalebox.sandbox.commands.command_handle import PtySize
|
|
4
|
+
from scalebox.sandbox_sync.main import Sandbox
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def output_handler(output):
|
|
8
|
+
"""处理 输出的回调函数"""
|
|
9
|
+
print(f"PTY 输出: {output}")
|
|
10
|
+
sandbox = Sandbox.create(api_key=f"sk-Wk4IgtUYOqnttxGaxZmELEV4p2FXh15Evt0FIcSa")
|
|
11
|
+
# print(sandbox.files.list("/root",2))
|
|
12
|
+
# proc = sandbox.commands._start(
|
|
13
|
+
# cmd="python3 -c \"import math; print('π =', math.pi); exit(42)\"",
|
|
14
|
+
# ).wait(on_pty=None,
|
|
15
|
+
# on_stdout=lambda data: print("[STDOUT]", data, end=""),
|
|
16
|
+
# on_stderr=lambda data: print("[STDERR]", data, end=""),)
|
|
17
|
+
|
|
18
|
+
# proc = sandbox.commands._start(
|
|
19
|
+
# cmd="ls /",
|
|
20
|
+
# ).wait(on_pty=None,
|
|
21
|
+
# on_stdout=lambda data: print("[STDOUT]", data, end=""),
|
|
22
|
+
# on_stderr=lambda data: print("[STDERR]", data, end=""),)
|
|
23
|
+
#
|
|
24
|
+
# print("exit_code =", proc.exit_code) # 42
|
|
25
|
+
# print("full_output =", proc.stdout) # π = 3.141592653589793
|
|
26
|
+
# pty=sandbox.pty.create(size=PtySize(1024, 768),user="root",cwd="/root/",)
|
|
27
|
+
# sandbox.pty.send_stdin(pid=pty.pid,data=b"echo \"hello\"")
|
|
28
|
+
# sandbox.pty.send_stdin(pid=pty.pid,data=b"echo \"world!\"")
|
|
29
|
+
# result=pty.wait(
|
|
30
|
+
# on_pty=lambda data: print("[STDOUT]", data, end=""),
|
|
31
|
+
# )
|
|
32
|
+
# print("exit_code =", result.exit_code)
|
|
33
|
+
# print("full_output =", result.stdout)
|
|
34
|
+
result = sandbox.commands.run(
|
|
35
|
+
cmd="ls /", on_stdout=output_handler, on_stderr=output_handler
|
|
36
|
+
)
|
|
37
|
+
print(result.exit_code)
|
|
38
|
+
print(result.error)
|
|
39
|
+
pty=sandbox.pty.create(size=PtySize(1024, 768),user="root",cwd="/root/",request_timeout=3600)
|
|
40
|
+
sandbox.pty.send_stdin(pid=pty.pid,data=b"echo \"hello\"")
|
|
41
|
+
sandbox.pty.send_stdin(pid=pty.pid,data=b"echo \"world!\"")
|
|
42
|
+
time.sleep(30)
|
|
43
|
+
sandbox.pty.send_stdin(pid=pty.pid,data=b"echo \"world!\" 30s")
|
|
44
|
+
time.sleep(30)
|
|
45
|
+
sandbox.pty.send_stdin(pid=pty.pid,data=b"echo \"world!\" 60s")
|
|
46
|
+
time.sleep(30)
|
|
47
|
+
sandbox.pty.send_stdin(pid=pty.pid,data=b"echo \"world!\" 90s")
|
|
48
|
+
time.sleep(30)
|
|
49
|
+
sandbox.pty.send_stdin(pid=pty.pid,data=b"echo \"world!\" 120s")
|
|
50
|
+
time.sleep(30)
|
|
51
|
+
sandbox.pty.send_stdin(pid=pty.pid,data=b"echo \"world!\" 150s")
|
|
52
|
+
time.sleep(30)
|
|
53
|
+
sandbox.pty.send_stdin(pid=pty.pid,data=b"echo \"world!\" 180s")
|
|
54
|
+
time.sleep(30)
|
|
55
|
+
sandbox.pty.send_stdin(pid=pty.pid,data=b"echo \"world!\" 210s")
|
|
56
|
+
time.sleep(30)
|
|
57
|
+
sandbox.pty.send_stdin(pid=pty.pid,data=b"echo \"world!\" 240s")
|
|
58
|
+
time.sleep(30)
|
|
59
|
+
sandbox.pty.send_stdin(pid=pty.pid,data=b"echo \"world!\" 270s")
|
|
60
|
+
time.sleep(30)
|
|
61
|
+
sandbox.pty.send_stdin(pid=pty.pid,data=b"echo \"world!\" 300s")
|
|
62
|
+
result=pty.wait(
|
|
63
|
+
on_pty=lambda data: print("[STDOUT]", data, end=""),
|
|
64
|
+
)
|
|
65
|
+
print("exit_code =", result.exit_code)
|
|
66
|
+
print("full_output =", result.stdout)
|
|
67
|
+
# result=sandbox.commands.run(cmd="ls /",
|
|
68
|
+
# on_stdout=output_handler,
|
|
69
|
+
# on_stderr=output_handler)
|
|
70
|
+
# print(result.exit_code)
|
|
71
|
+
# print(result.error)
|
scalebox/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scalebox-sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.13
|
|
4
4
|
Summary: ScaleBox Python SDK - A multi-language code execution sandbox with Python, R, Node.js, Deno/TypeScript, Java, and Bash support
|
|
5
5
|
Author-email: ScaleBox Team <dev@scalebox.dev>
|
|
6
6
|
Maintainer-email: ScaleBox Team <dev@scalebox.dev>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
scalebox/__init__.py,sha256=
|
|
1
|
+
scalebox/__init__.py,sha256=LZUsWxfCD_rlMNgwd9J9UYGpDFtvsu8MoBhUOJmc2_U,1812
|
|
2
2
|
scalebox/cli.py,sha256=HWIyGuhbP1WZm839CwTysauL78xMBOoatFychxzloxQ,3904
|
|
3
3
|
scalebox/connection_config.py,sha256=J49-3tYaaoRDpa1l2dbnW3T8XmLrqEZBPXlraFvPp7I,2563
|
|
4
4
|
scalebox/exceptions.py,sha256=10R9VXfvgO4XJJnxyzyrzkxliyeEBX0ZC36izXa8R5k,2053
|
|
5
5
|
scalebox/requirements.txt,sha256=LEYsk2VzoxKR-V44Y6qJuJ3vKdTYS79f1Gv1Ajleifo,567
|
|
6
|
-
scalebox/version.py,sha256=
|
|
6
|
+
scalebox/version.py,sha256=XiMcSPespfFB1cpWXU34gxTmofAOuld7LklpOJm1qGg,323
|
|
7
7
|
scalebox/api/__init__.py,sha256=4Ci1HcIcKfSdloTw1BNwneudeqo1yC_MUZgwGdl9Mb8,4167
|
|
8
8
|
scalebox/api/metadata.py,sha256=lg5ekfnFZYZoCoJxIPo961HEGVg_rLLRJBbw4ZApM_Y,512
|
|
9
9
|
scalebox/api/client/__init__.py,sha256=0s784iDWjy52HOxrCdQVVeF8Fqrc9gzh1cLpMd9sOA8,150
|
|
@@ -120,38 +120,40 @@ scalebox/sandbox_sync/filesystem/watch_handle.py,sha256=dC9p74AHMv-3mQ1tudmOPjrp
|
|
|
120
120
|
scalebox/test/CODE_INTERPRETER_TESTS_READY.md,sha256=cU9aOccv6BWllsz4aIIHokMW9QPxsPlJEJKR_oXr69o,9695
|
|
121
121
|
scalebox/test/README.md,sha256=YwFmc4kjgZN9uRVrN2qCPUDC6RfeAXFJ-syeRS9mdiE,8182
|
|
122
122
|
scalebox/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
123
|
-
scalebox/test/aclient.py,sha256=
|
|
124
|
-
scalebox/test/code_interpreter_centext.py,sha256=
|
|
125
|
-
scalebox/test/code_interpreter_centext_sync.py,sha256=
|
|
126
|
-
scalebox/test/code_interpreter_test.py,sha256=
|
|
127
|
-
scalebox/test/code_interpreter_test_sync.py,sha256=
|
|
128
|
-
scalebox/test/run_all_validation_tests.py,sha256=
|
|
123
|
+
scalebox/test/aclient.py,sha256=hCZAs2X1AwRHevexdbH0Z2MdahSczjvRglnyb1WFrV4,2335
|
|
124
|
+
scalebox/test/code_interpreter_centext.py,sha256=f2GC3l8jsNF9n1Sl4boxJMGqWNl1d1Ff29f_5hahH00,468
|
|
125
|
+
scalebox/test/code_interpreter_centext_sync.py,sha256=cGebrc7c1VQDsv6X0Ez7Xs2plvv_j7EjqQhklLmQ01o,433
|
|
126
|
+
scalebox/test/code_interpreter_test.py,sha256=xGIi5TIHsg3iRPfCJs7Ln7Mpo7Jmk5caWGLtu_1qYbA,733
|
|
127
|
+
scalebox/test/code_interpreter_test_sync.py,sha256=q-RioskwGFFrlNUjZ6aaPLvMfnhofeEpfJP-9aSpjrw,676
|
|
128
|
+
scalebox/test/run_all_validation_tests.py,sha256=iWldYseiCW-34Mowkj1AbV_ciFG5mg-DYj_Znl9Agm8,12729
|
|
129
129
|
scalebox/test/run_code_interpreter_tests.sh,sha256=L5sBr5jsFhZxtqfq98yhOA8FK8-bOvYUSVeft8hb1LI,1973
|
|
130
130
|
scalebox/test/run_tests.sh,sha256=1gWoC_RhemlmtqKfBCw2_fRI20saDJ8iCTRtPUiuUE8,6091
|
|
131
|
-
scalebox/test/test_basic.py,sha256=
|
|
132
|
-
scalebox/test/test_code_interpreter_async_comprehensive.py,sha256=
|
|
133
|
-
scalebox/test/test_code_interpreter_e2basync_comprehensive.py,sha256=
|
|
134
|
-
scalebox/test/test_code_interpreter_e2bsync_comprehensive.py,sha256=
|
|
135
|
-
scalebox/test/
|
|
136
|
-
scalebox/test/
|
|
137
|
-
scalebox/test/
|
|
138
|
-
scalebox/test/
|
|
139
|
-
scalebox/test/
|
|
140
|
-
scalebox/test/
|
|
141
|
-
scalebox/test/
|
|
142
|
-
scalebox/test/
|
|
143
|
-
scalebox/test/
|
|
144
|
-
scalebox/test/
|
|
145
|
-
scalebox/test/
|
|
146
|
-
scalebox/test/
|
|
147
|
-
scalebox/test/
|
|
148
|
-
scalebox/test/
|
|
131
|
+
scalebox/test/test_basic.py,sha256=EfK7XzgY63CxLw8x8C1Tnu0yD4vazJxYLHvBV4Zz08U,2375
|
|
132
|
+
scalebox/test/test_code_interpreter_async_comprehensive.py,sha256=r63dsWsLIEtQKzyswQDOT1s3yVbXKsNgsgWoSDgTQ2c,84464
|
|
133
|
+
scalebox/test/test_code_interpreter_e2basync_comprehensive.py,sha256=7HyhEB5FjE_f52mLM3pcpOJnh3kPIYH0-72NWM1RtPw,84506
|
|
134
|
+
scalebox/test/test_code_interpreter_e2bsync_comprehensive.py,sha256=kJWw5wSgR7P8X_hC0APxDTTBnY26a23uZjTGutPMF2c,105658
|
|
135
|
+
scalebox/test/test_code_interpreter_execcode.py,sha256=ODHS4IJGUZ84MvlmFDHupar6AFJikd_MvjFpv8qVgDY,103484
|
|
136
|
+
scalebox/test/test_code_interpreter_sync_comprehensive.py,sha256=PfsqhvjZNusH9EpZdY1Zo_RlcMiRbwwHBSQsRRcOC2g,105572
|
|
137
|
+
scalebox/test/test_csx_desktop_examples.py,sha256=hBF-YHnPctN2jeLLl-TAIj8w1T8lG1RB3PVw1ljZ2Aw,4414
|
|
138
|
+
scalebox/test/test_e2b_first.py,sha256=fi7HKlqSuoJyYy-gEpPJTzSWsvXuPJXqk-c93t_l5VU,316
|
|
139
|
+
scalebox/test/test_sandbox_async_comprehensive.py,sha256=jQ0Zo_OaDSkeVA08mPocyy3brWp9sv22FlarAlPo2UA,27097
|
|
140
|
+
scalebox/test/test_sandbox_stress_and_edge_cases.py,sha256=-lzub_06u_SmMVqu1OWIcP5VANm5FIz-a2bRTNqgUOk,27602
|
|
141
|
+
scalebox/test/test_sandbox_sync_comprehensive.py,sha256=lRsP0Cp_h5Vgmv7rbL90n8aMQIzkBEIQh_NMoiE8Rrg,27747
|
|
142
|
+
scalebox/test/test_sandbox_usage_examples.py,sha256=B-UdG3nW2dF2ACGKt77zuPaTobMoKMaFf074VERmzuU,34691
|
|
143
|
+
scalebox/test/testacreate.py,sha256=9_Hvllm2uWJtWxV2AWjC11sYxN_jtvx8j-TN3E6myGc,765
|
|
144
|
+
scalebox/test/testagetinfo.py,sha256=jbr-CNR6ubYrhLhoXOmugKttzSYaDSsXnDD-_ZJCWyU,555
|
|
145
|
+
scalebox/test/testcodeinterpreter_async.py,sha256=Cmrgv2iRhgJgzr8yvQz3PL4qM_TY_TVvgtRlNrG-G7Y,14258
|
|
146
|
+
scalebox/test/testcodeinterpreter_sync.py,sha256=g9ni-hOz11IYVGwqslRA8CZE6bkWaVBVd2aZxauWFHw,5713
|
|
147
|
+
scalebox/test/testcomputeuse.py,sha256=FU0tDPvpPhkaEeuQCuWwJKcqA2vejI_SDJswvipXNpo,7293
|
|
148
|
+
scalebox/test/testnovnc.py,sha256=p5UM1ueKbyjlyYBcaToFGljG4ppIqC7JGPqltIGY6Po,310
|
|
149
|
+
scalebox/test/testsandbox_async.py,sha256=DzT4yXWCEgBtfvthGq4E_1TTBd-2BfQ_2DSHttos1ms,6140
|
|
150
|
+
scalebox/test/testsandbox_sync.py,sha256=v1dFAJWKbyLnjIiafTR9TafxJF1gaUk-W2mmQU4YYLg,2886
|
|
149
151
|
scalebox/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
150
152
|
scalebox/utils/httpcoreclient.py,sha256=kjTndd-YECPe3n_G1HfGgitzRwntC21tqtIqZ62V6Lg,9868
|
|
151
153
|
scalebox/utils/httpxclient.py,sha256=oLpCP2RChvnspS6Unl6ngmpY72yPokTfSqMm9m-7k38,13442
|
|
152
|
-
scalebox_sdk-0.1.
|
|
153
|
-
scalebox_sdk-0.1.
|
|
154
|
-
scalebox_sdk-0.1.
|
|
155
|
-
scalebox_sdk-0.1.
|
|
156
|
-
scalebox_sdk-0.1.
|
|
157
|
-
scalebox_sdk-0.1.
|
|
154
|
+
scalebox_sdk-0.1.13.dist-info/licenses/LICENSE,sha256=9zP32kHlBovkfji1R6ptx3H7WjJJvnf4UuwTpfogmsY,1069
|
|
155
|
+
scalebox_sdk-0.1.13.dist-info/METADATA,sha256=axGwwnTWHdpMlBfhUwfLZGRLaWAqmdzAqLHcUYOZ3yY,12216
|
|
156
|
+
scalebox_sdk-0.1.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
157
|
+
scalebox_sdk-0.1.13.dist-info/entry_points.txt,sha256=g7C1Trcg8EyvAGMnHpJ3alqtZzQuMypYUQVFK13kOFM,47
|
|
158
|
+
scalebox_sdk-0.1.13.dist-info/top_level.txt,sha256=CDjlibkbOG-MT-s1TRxs4Xe_iN1m11ii48spB6DOMj4,9
|
|
159
|
+
scalebox_sdk-0.1.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|