@blaxel/core 0.2.49-dev.213 → 0.2.49-dev1

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.
Files changed (243) hide show
  1. package/dist/agents/index.d.ts +15 -0
  2. package/dist/agents/index.js +109 -0
  3. package/dist/authentication/apikey.d.ts +10 -0
  4. package/dist/authentication/apikey.js +24 -0
  5. package/dist/authentication/clientcredentials.d.ts +17 -0
  6. package/dist/authentication/clientcredentials.js +85 -0
  7. package/dist/authentication/credentials.d.ts +6 -0
  8. package/dist/authentication/credentials.js +17 -0
  9. package/dist/authentication/deviceMode.d.ts +15 -0
  10. package/dist/authentication/deviceMode.js +70 -0
  11. package/dist/authentication/index.d.ts +3 -0
  12. package/dist/authentication/index.js +62 -0
  13. package/dist/authentication/types.d.ts +9 -0
  14. package/dist/authentication/types.js +2 -0
  15. package/dist/cache/index.d.ts +1 -0
  16. package/dist/cache/index.js +26 -0
  17. package/dist/cjs/.tsbuildinfo +1 -1
  18. package/dist/cjs/agents/index.js +2 -2
  19. package/dist/cjs/authentication/clientcredentials.js +1 -4
  20. package/dist/cjs/client/responseInterceptor.js +53 -0
  21. package/dist/cjs/client/sdk.gen.js +143 -3
  22. package/dist/cjs/common/autoload.js +7 -0
  23. package/dist/cjs/common/env.js +3 -0
  24. package/dist/cjs/common/internal.js +0 -40
  25. package/dist/cjs/common/settings.js +2 -5
  26. package/dist/cjs/common/version.js +6 -0
  27. package/dist/cjs/common/webhook.js +101 -0
  28. package/dist/cjs/jobs/executions.js +119 -0
  29. package/dist/cjs/jobs/jobs.js +2 -2
  30. package/dist/cjs/sandbox/action.js +2 -1
  31. package/dist/cjs/sandbox/index.js +1 -0
  32. package/dist/cjs/sandbox/interpreter.js +400 -0
  33. package/dist/cjs/sandbox/sandbox.js +10 -67
  34. package/dist/cjs/tools/mcpTool.js +2 -6
  35. package/dist/cjs/types/client/responseInterceptor.d.ts +12 -0
  36. package/dist/cjs/types/client/sdk.gen.d.ts +41 -1
  37. package/dist/cjs/types/client/types.gen.d.ts +599 -16
  38. package/dist/cjs/types/common/internal.d.ts +0 -2
  39. package/dist/cjs/types/common/settings.d.ts +0 -1
  40. package/dist/cjs/types/common/version.d.ts +2 -0
  41. package/dist/cjs/types/common/webhook.d.ts +89 -0
  42. package/dist/cjs/types/jobs/executions.d.ts +42 -0
  43. package/dist/cjs/types/sandbox/client/sdk.gen.d.ts +1 -1
  44. package/dist/cjs/types/sandbox/index.d.ts +1 -0
  45. package/dist/cjs/types/sandbox/interpreter.d.ts +71 -0
  46. package/dist/cjs/types/sandbox/sandbox.d.ts +6 -12
  47. package/dist/cjs/types/sandbox/types.d.ts +0 -3
  48. package/dist/cjs-browser/.tsbuildinfo +1 -1
  49. package/dist/cjs-browser/agents/index.js +2 -2
  50. package/dist/cjs-browser/authentication/clientcredentials.js +1 -4
  51. package/dist/cjs-browser/client/responseInterceptor.js +53 -0
  52. package/dist/cjs-browser/client/sdk.gen.js +143 -3
  53. package/dist/cjs-browser/common/autoload.js +7 -0
  54. package/dist/cjs-browser/common/env.js +3 -0
  55. package/dist/cjs-browser/common/internal.js +0 -40
  56. package/dist/cjs-browser/common/settings.js +2 -5
  57. package/dist/cjs-browser/common/version.js +6 -0
  58. package/dist/cjs-browser/common/webhook.js +101 -0
  59. package/dist/cjs-browser/jobs/executions.js +119 -0
  60. package/dist/cjs-browser/jobs/jobs.js +2 -2
  61. package/dist/cjs-browser/sandbox/action.js +2 -1
  62. package/dist/cjs-browser/sandbox/index.js +1 -0
  63. package/dist/cjs-browser/sandbox/interpreter.js +400 -0
  64. package/dist/cjs-browser/sandbox/sandbox.js +10 -67
  65. package/dist/cjs-browser/tools/mcpTool.js +2 -6
  66. package/dist/cjs-browser/types/client/responseInterceptor.d.ts +12 -0
  67. package/dist/cjs-browser/types/client/sdk.gen.d.ts +41 -1
  68. package/dist/cjs-browser/types/client/types.gen.d.ts +599 -16
  69. package/dist/cjs-browser/types/common/internal.d.ts +0 -2
  70. package/dist/cjs-browser/types/common/settings.d.ts +0 -1
  71. package/dist/cjs-browser/types/common/version.d.ts +2 -0
  72. package/dist/cjs-browser/types/common/webhook.d.ts +89 -0
  73. package/dist/cjs-browser/types/jobs/executions.d.ts +42 -0
  74. package/dist/cjs-browser/types/sandbox/client/sdk.gen.d.ts +1 -1
  75. package/dist/cjs-browser/types/sandbox/index.d.ts +1 -0
  76. package/dist/cjs-browser/types/sandbox/interpreter.d.ts +71 -0
  77. package/dist/cjs-browser/types/sandbox/sandbox.d.ts +6 -12
  78. package/dist/cjs-browser/types/sandbox/types.d.ts +0 -3
  79. package/dist/client/authentication.d.ts +25 -0
  80. package/dist/client/authentication.js +15 -0
  81. package/dist/client/client.d.ts +2 -0
  82. package/dist/client/client.gen.d.ts +12 -0
  83. package/dist/client/client.gen.js +8 -0
  84. package/dist/{cjs/sandbox/websocket/index.js → client/client.js} +1 -1
  85. package/dist/client/index.d.ts +2 -0
  86. package/dist/client/index.js +19 -0
  87. package/dist/client/interceptors.d.ts +3 -0
  88. package/dist/client/interceptors.js +17 -0
  89. package/dist/client/sdk.gen.d.ts +499 -0
  90. package/dist/client/sdk.gen.js +1751 -0
  91. package/dist/client/types.gen.d.ts +4546 -0
  92. package/dist/client/types.gen.js +4 -0
  93. package/dist/common/autoload.d.ts +3 -0
  94. package/dist/common/autoload.js +27 -0
  95. package/dist/common/env.d.ts +5 -0
  96. package/dist/common/env.js +42 -0
  97. package/dist/common/errors.d.ts +1 -0
  98. package/dist/common/errors.js +17 -0
  99. package/dist/common/internal.d.ts +4 -0
  100. package/dist/common/internal.js +188 -0
  101. package/dist/common/internal.test.d.ts +1 -0
  102. package/dist/common/internal.test.js +39 -0
  103. package/dist/common/logger.d.ts +25 -0
  104. package/dist/common/logger.js +69 -0
  105. package/dist/common/node.d.ts +5 -0
  106. package/dist/common/node.js +26 -0
  107. package/dist/common/settings.d.ts +31 -0
  108. package/dist/common/settings.js +170 -0
  109. package/dist/esm/.tsbuildinfo +1 -1
  110. package/dist/esm/agents/index.js +3 -3
  111. package/dist/esm/authentication/clientcredentials.js +1 -4
  112. package/dist/esm/client/responseInterceptor.js +49 -0
  113. package/dist/esm/client/sdk.gen.js +132 -0
  114. package/dist/esm/common/autoload.js +7 -0
  115. package/dist/esm/common/env.js +3 -0
  116. package/dist/esm/common/internal.js +0 -38
  117. package/dist/esm/common/settings.js +2 -5
  118. package/dist/esm/common/version.js +3 -0
  119. package/dist/esm/common/webhook.js +97 -0
  120. package/dist/esm/jobs/executions.js +114 -0
  121. package/dist/esm/jobs/jobs.js +3 -3
  122. package/dist/esm/sandbox/action.js +3 -2
  123. package/dist/esm/sandbox/index.js +1 -0
  124. package/dist/esm/sandbox/interpreter.js +396 -0
  125. package/dist/esm/sandbox/sandbox.js +10 -67
  126. package/dist/esm/tools/mcpTool.js +3 -7
  127. package/dist/esm-browser/.tsbuildinfo +1 -1
  128. package/dist/esm-browser/agents/index.js +3 -3
  129. package/dist/esm-browser/authentication/clientcredentials.js +1 -4
  130. package/dist/esm-browser/client/responseInterceptor.js +49 -0
  131. package/dist/esm-browser/client/sdk.gen.js +132 -0
  132. package/dist/esm-browser/common/autoload.js +7 -0
  133. package/dist/esm-browser/common/env.js +3 -0
  134. package/dist/esm-browser/common/internal.js +0 -38
  135. package/dist/esm-browser/common/settings.js +2 -5
  136. package/dist/esm-browser/common/version.js +3 -0
  137. package/dist/esm-browser/common/webhook.js +97 -0
  138. package/dist/esm-browser/jobs/executions.js +114 -0
  139. package/dist/esm-browser/jobs/jobs.js +3 -3
  140. package/dist/esm-browser/sandbox/action.js +3 -2
  141. package/dist/esm-browser/sandbox/index.js +1 -0
  142. package/dist/esm-browser/sandbox/interpreter.js +396 -0
  143. package/dist/esm-browser/sandbox/sandbox.js +10 -67
  144. package/dist/esm-browser/tools/mcpTool.js +3 -7
  145. package/dist/index.browser.test.d.ts +1 -0
  146. package/dist/index.browser.test.js +45 -0
  147. package/dist/index.d.ts +17 -0
  148. package/dist/index.js +33 -0
  149. package/dist/jobs/index.d.ts +3 -0
  150. package/dist/jobs/index.js +19 -0
  151. package/dist/jobs/jobs.d.ts +13 -0
  152. package/dist/jobs/jobs.js +90 -0
  153. package/dist/jobs/start.d.ts +1 -0
  154. package/dist/jobs/start.js +66 -0
  155. package/dist/jobs/types.d.ts +3 -0
  156. package/dist/jobs/types.js +2 -0
  157. package/dist/mcp/client.d.ts +28 -0
  158. package/dist/mcp/client.js +247 -0
  159. package/dist/{cjs-browser/types/sandbox/websocket → mcp}/index.d.ts +1 -0
  160. package/dist/{cjs-browser/sandbox/websocket → mcp}/index.js +1 -0
  161. package/dist/mcp/server.d.ts +24 -0
  162. package/dist/mcp/server.js +213 -0
  163. package/dist/models/index.d.ts +8 -0
  164. package/dist/models/index.js +31 -0
  165. package/dist/sandbox/action.d.ts +19 -0
  166. package/dist/sandbox/action.js +84 -0
  167. package/dist/sandbox/client/client.gen.d.ts +12 -0
  168. package/dist/sandbox/client/client.gen.js +6 -0
  169. package/dist/sandbox/client/index.d.ts +2 -0
  170. package/dist/sandbox/client/index.js +19 -0
  171. package/dist/sandbox/client/sdk.gen.d.ts +101 -0
  172. package/dist/sandbox/client/sdk.gen.js +289 -0
  173. package/dist/sandbox/client/types.gen.d.ts +578 -0
  174. package/dist/sandbox/client/types.gen.js +3 -0
  175. package/dist/{cjs/types/sandbox/filesystem/filesystem-ws.d.ts → sandbox/filesystem/filesystem.d.ts} +6 -18
  176. package/dist/sandbox/filesystem/filesystem.js +276 -0
  177. package/dist/sandbox/filesystem/index.d.ts +2 -0
  178. package/dist/sandbox/filesystem/index.js +18 -0
  179. package/dist/sandbox/filesystem/types.d.ts +15 -0
  180. package/dist/sandbox/filesystem/types.js +2 -0
  181. package/dist/sandbox/index.d.ts +4 -0
  182. package/dist/sandbox/index.js +36 -0
  183. package/dist/sandbox/network/index.d.ts +1 -0
  184. package/dist/sandbox/network/index.js +17 -0
  185. package/dist/sandbox/network/network.d.ts +5 -0
  186. package/dist/sandbox/network/network.js +10 -0
  187. package/dist/sandbox/preview.d.ts +37 -0
  188. package/dist/sandbox/preview.js +148 -0
  189. package/dist/sandbox/process/index.d.ts +1 -0
  190. package/dist/sandbox/process/index.js +17 -0
  191. package/dist/sandbox/process/process.d.ts +24 -0
  192. package/dist/sandbox/process/process.js +189 -0
  193. package/dist/sandbox/sandbox.d.ts +33 -0
  194. package/dist/sandbox/sandbox.js +178 -0
  195. package/dist/sandbox/session.d.ts +27 -0
  196. package/dist/sandbox/session.js +123 -0
  197. package/dist/sandbox/types.d.ts +51 -0
  198. package/dist/sandbox/types.js +81 -0
  199. package/dist/telemetry/telemetry.d.ts +62 -0
  200. package/dist/telemetry/telemetry.js +80 -0
  201. package/dist/tools/index.d.ts +11 -0
  202. package/dist/tools/index.js +52 -0
  203. package/dist/tools/mcpTool.d.ts +28 -0
  204. package/dist/tools/mcpTool.js +218 -0
  205. package/dist/tools/types.d.ts +8 -0
  206. package/dist/tools/types.js +2 -0
  207. package/dist/tools/zodSchema.d.ts +9 -0
  208. package/dist/tools/zodSchema.js +50 -0
  209. package/dist/volume/index.d.ts +23 -0
  210. package/dist/volume/index.js +113 -0
  211. package/package.json +2 -2
  212. package/dist/cjs/sandbox/codegen/codegen-ws.js +0 -30
  213. package/dist/cjs/sandbox/filesystem/filesystem-ws.js +0 -106
  214. package/dist/cjs/sandbox/network/network-ws.js +0 -12
  215. package/dist/cjs/sandbox/process/process-ws.js +0 -139
  216. package/dist/cjs/sandbox/websocket/client.js +0 -269
  217. package/dist/cjs/types/sandbox/codegen/codegen-ws.d.ts +0 -10
  218. package/dist/cjs/types/sandbox/network/network-ws.d.ts +0 -7
  219. package/dist/cjs/types/sandbox/process/process-ws.d.ts +0 -27
  220. package/dist/cjs/types/sandbox/websocket/client.d.ts +0 -48
  221. package/dist/cjs/types/sandbox/websocket/index.d.ts +0 -1
  222. package/dist/cjs-browser/sandbox/codegen/codegen-ws.js +0 -30
  223. package/dist/cjs-browser/sandbox/filesystem/filesystem-ws.js +0 -106
  224. package/dist/cjs-browser/sandbox/network/network-ws.js +0 -12
  225. package/dist/cjs-browser/sandbox/process/process-ws.js +0 -139
  226. package/dist/cjs-browser/sandbox/websocket/client.js +0 -269
  227. package/dist/cjs-browser/types/sandbox/codegen/codegen-ws.d.ts +0 -10
  228. package/dist/cjs-browser/types/sandbox/filesystem/filesystem-ws.d.ts +0 -35
  229. package/dist/cjs-browser/types/sandbox/network/network-ws.d.ts +0 -7
  230. package/dist/cjs-browser/types/sandbox/process/process-ws.d.ts +0 -27
  231. package/dist/cjs-browser/types/sandbox/websocket/client.d.ts +0 -48
  232. package/dist/esm/sandbox/codegen/codegen-ws.js +0 -26
  233. package/dist/esm/sandbox/filesystem/filesystem-ws.js +0 -102
  234. package/dist/esm/sandbox/network/network-ws.js +0 -8
  235. package/dist/esm/sandbox/process/process-ws.js +0 -135
  236. package/dist/esm/sandbox/websocket/client.js +0 -265
  237. package/dist/esm/sandbox/websocket/index.js +0 -1
  238. package/dist/esm-browser/sandbox/codegen/codegen-ws.js +0 -26
  239. package/dist/esm-browser/sandbox/filesystem/filesystem-ws.js +0 -102
  240. package/dist/esm-browser/sandbox/network/network-ws.js +0 -8
  241. package/dist/esm-browser/sandbox/process/process-ws.js +0 -135
  242. package/dist/esm-browser/sandbox/websocket/client.js +0 -265
  243. package/dist/esm-browser/sandbox/websocket/index.js +0 -1
@@ -0,0 +1,578 @@
1
+ export type Directory = {
2
+ files: Array<File>;
3
+ name: string;
4
+ path: string;
5
+ /**
6
+ * @name Subdirectories
7
+ */
8
+ subdirectories: Array<Subdirectory>;
9
+ };
10
+ export type ErrorResponse = {
11
+ error: string;
12
+ };
13
+ export type File = {
14
+ group: string;
15
+ lastModified: string;
16
+ name: string;
17
+ owner: string;
18
+ path: string;
19
+ permissions: string;
20
+ size: number;
21
+ };
22
+ export type FileRequest = {
23
+ content?: string;
24
+ isDirectory?: boolean;
25
+ permissions?: string;
26
+ };
27
+ export type FileWithContent = {
28
+ content: string;
29
+ group: string;
30
+ lastModified: string;
31
+ name: string;
32
+ owner: string;
33
+ path: string;
34
+ permissions: string;
35
+ size: number;
36
+ };
37
+ export type PortMonitorRequest = {
38
+ /**
39
+ * URL to call when a new port is detected
40
+ */
41
+ callback?: string;
42
+ };
43
+ export type ProcessLogs = {
44
+ logs: string;
45
+ stderr: string;
46
+ stdout: string;
47
+ };
48
+ export type ProcessRequest = {
49
+ command: string;
50
+ env?: {
51
+ [key: string]: string;
52
+ };
53
+ name?: string;
54
+ timeout?: number;
55
+ waitForCompletion?: boolean;
56
+ waitForPorts?: Array<number>;
57
+ workingDir?: string;
58
+ };
59
+ export type ProcessResponse = {
60
+ command: string;
61
+ completedAt: string;
62
+ exitCode: number;
63
+ logs: string;
64
+ name: string;
65
+ pid: string;
66
+ startedAt: string;
67
+ status: 'failed' | 'killed' | 'stopped' | 'running' | 'completed';
68
+ workingDir: string;
69
+ };
70
+ export type Subdirectory = {
71
+ name: string;
72
+ path: string;
73
+ };
74
+ export type SuccessResponse = {
75
+ message: string;
76
+ path?: string;
77
+ };
78
+ export type DeleteFilesystemByPathData = {
79
+ body?: never;
80
+ path: {
81
+ /**
82
+ * File or directory path
83
+ */
84
+ path: string;
85
+ };
86
+ query?: {
87
+ /**
88
+ * Delete directory recursively
89
+ */
90
+ recursive?: boolean;
91
+ };
92
+ url: '/filesystem/{path}';
93
+ };
94
+ export type DeleteFilesystemByPathErrors = {
95
+ /**
96
+ * File or directory not found
97
+ */
98
+ 404: ErrorResponse;
99
+ /**
100
+ * Unprocessable entity
101
+ */
102
+ 422: ErrorResponse;
103
+ /**
104
+ * Internal server error
105
+ */
106
+ 500: ErrorResponse;
107
+ };
108
+ export type DeleteFilesystemByPathError = DeleteFilesystemByPathErrors[keyof DeleteFilesystemByPathErrors];
109
+ export type DeleteFilesystemByPathResponses = {
110
+ /**
111
+ * Success message
112
+ */
113
+ 200: SuccessResponse;
114
+ };
115
+ export type DeleteFilesystemByPathResponse = DeleteFilesystemByPathResponses[keyof DeleteFilesystemByPathResponses];
116
+ export type GetFilesystemByPathData = {
117
+ body?: never;
118
+ path: {
119
+ /**
120
+ * File or directory path
121
+ */
122
+ path: string;
123
+ };
124
+ query?: never;
125
+ url: '/filesystem/{path}';
126
+ };
127
+ export type GetFilesystemByPathErrors = {
128
+ /**
129
+ * File or directory not found
130
+ */
131
+ 404: ErrorResponse;
132
+ /**
133
+ * Unprocessable entity
134
+ */
135
+ 422: ErrorResponse;
136
+ /**
137
+ * Internal server error
138
+ */
139
+ 500: ErrorResponse;
140
+ };
141
+ export type GetFilesystemByPathError = GetFilesystemByPathErrors[keyof GetFilesystemByPathErrors];
142
+ export type GetFilesystemByPathResponses = {
143
+ /**
144
+ * Directory listing
145
+ */
146
+ 200: Directory | FileWithContent;
147
+ };
148
+ export type GetFilesystemByPathResponse = GetFilesystemByPathResponses[keyof GetFilesystemByPathResponses];
149
+ export type PutFilesystemByPathData = {
150
+ /**
151
+ * File or directory details
152
+ */
153
+ body: FileRequest;
154
+ path: {
155
+ /**
156
+ * File or directory path
157
+ */
158
+ path: string;
159
+ };
160
+ query?: never;
161
+ url: '/filesystem/{path}';
162
+ };
163
+ export type PutFilesystemByPathErrors = {
164
+ /**
165
+ * Bad request
166
+ */
167
+ 400: ErrorResponse;
168
+ /**
169
+ * Unprocessable entity
170
+ */
171
+ 422: ErrorResponse;
172
+ /**
173
+ * Internal server error
174
+ */
175
+ 500: ErrorResponse;
176
+ };
177
+ export type PutFilesystemByPathError = PutFilesystemByPathErrors[keyof PutFilesystemByPathErrors];
178
+ export type PutFilesystemByPathResponses = {
179
+ /**
180
+ * Success message
181
+ */
182
+ 200: SuccessResponse;
183
+ };
184
+ export type PutFilesystemByPathResponse = PutFilesystemByPathResponses[keyof PutFilesystemByPathResponses];
185
+ export type DeleteNetworkProcessByPidMonitorData = {
186
+ body?: never;
187
+ path: {
188
+ /**
189
+ * Process ID
190
+ */
191
+ pid: number;
192
+ };
193
+ query?: never;
194
+ url: '/network/process/{pid}/monitor';
195
+ };
196
+ export type DeleteNetworkProcessByPidMonitorErrors = {
197
+ /**
198
+ * Invalid process ID
199
+ */
200
+ 400: ErrorResponse;
201
+ /**
202
+ * Unprocessable entity
203
+ */
204
+ 422: ErrorResponse;
205
+ /**
206
+ * Internal server error
207
+ */
208
+ 500: ErrorResponse;
209
+ };
210
+ export type DeleteNetworkProcessByPidMonitorError = DeleteNetworkProcessByPidMonitorErrors[keyof DeleteNetworkProcessByPidMonitorErrors];
211
+ export type DeleteNetworkProcessByPidMonitorResponses = {
212
+ /**
213
+ * Object containing PID and success message
214
+ */
215
+ 200: {
216
+ [key: string]: unknown;
217
+ };
218
+ };
219
+ export type DeleteNetworkProcessByPidMonitorResponse = DeleteNetworkProcessByPidMonitorResponses[keyof DeleteNetworkProcessByPidMonitorResponses];
220
+ export type PostNetworkProcessByPidMonitorData = {
221
+ /**
222
+ * Port monitor configuration
223
+ */
224
+ body: PortMonitorRequest;
225
+ path: {
226
+ /**
227
+ * Process ID
228
+ */
229
+ pid: number;
230
+ };
231
+ query?: never;
232
+ url: '/network/process/{pid}/monitor';
233
+ };
234
+ export type PostNetworkProcessByPidMonitorErrors = {
235
+ /**
236
+ * Invalid request
237
+ */
238
+ 400: ErrorResponse;
239
+ /**
240
+ * Unprocessable entity
241
+ */
242
+ 422: ErrorResponse;
243
+ /**
244
+ * Internal server error
245
+ */
246
+ 500: ErrorResponse;
247
+ };
248
+ export type PostNetworkProcessByPidMonitorError = PostNetworkProcessByPidMonitorErrors[keyof PostNetworkProcessByPidMonitorErrors];
249
+ export type PostNetworkProcessByPidMonitorResponses = {
250
+ /**
251
+ * Object containing PID and success message
252
+ */
253
+ 200: {
254
+ [key: string]: unknown;
255
+ };
256
+ };
257
+ export type PostNetworkProcessByPidMonitorResponse = PostNetworkProcessByPidMonitorResponses[keyof PostNetworkProcessByPidMonitorResponses];
258
+ export type GetNetworkProcessByPidPortsData = {
259
+ body?: never;
260
+ path: {
261
+ /**
262
+ * Process ID
263
+ */
264
+ pid: number;
265
+ };
266
+ query?: never;
267
+ url: '/network/process/{pid}/ports';
268
+ };
269
+ export type GetNetworkProcessByPidPortsErrors = {
270
+ /**
271
+ * Invalid process ID
272
+ */
273
+ 400: ErrorResponse;
274
+ /**
275
+ * Unprocessable entity
276
+ */
277
+ 422: ErrorResponse;
278
+ /**
279
+ * Internal server error
280
+ */
281
+ 500: ErrorResponse;
282
+ };
283
+ export type GetNetworkProcessByPidPortsError = GetNetworkProcessByPidPortsErrors[keyof GetNetworkProcessByPidPortsErrors];
284
+ export type GetNetworkProcessByPidPortsResponses = {
285
+ /**
286
+ * Object containing PID and array of network.PortInfo
287
+ */
288
+ 200: {
289
+ [key: string]: unknown;
290
+ };
291
+ };
292
+ export type GetNetworkProcessByPidPortsResponse = GetNetworkProcessByPidPortsResponses[keyof GetNetworkProcessByPidPortsResponses];
293
+ export type GetProcessData = {
294
+ body?: never;
295
+ path?: never;
296
+ query?: never;
297
+ url: '/process';
298
+ };
299
+ export type GetProcessResponses = {
300
+ /**
301
+ * Process list
302
+ */
303
+ 200: Array<ProcessResponse>;
304
+ };
305
+ export type GetProcessResponse = GetProcessResponses[keyof GetProcessResponses];
306
+ export type PostProcessData = {
307
+ /**
308
+ * Process execution request
309
+ */
310
+ body: ProcessRequest;
311
+ path?: never;
312
+ query?: never;
313
+ url: '/process';
314
+ };
315
+ export type PostProcessErrors = {
316
+ /**
317
+ * Invalid request
318
+ */
319
+ 400: ErrorResponse;
320
+ /**
321
+ * Unprocessable entity
322
+ */
323
+ 422: ErrorResponse;
324
+ /**
325
+ * Internal server error
326
+ */
327
+ 500: ErrorResponse;
328
+ };
329
+ export type PostProcessError = PostProcessErrors[keyof PostProcessErrors];
330
+ export type PostProcessResponses = {
331
+ /**
332
+ * Process information
333
+ */
334
+ 200: ProcessResponse;
335
+ };
336
+ export type PostProcessResponse = PostProcessResponses[keyof PostProcessResponses];
337
+ export type DeleteProcessByIdentifierData = {
338
+ body?: never;
339
+ path: {
340
+ /**
341
+ * Process identifier (PID or name)
342
+ */
343
+ identifier: string;
344
+ };
345
+ query?: never;
346
+ url: '/process/{identifier}';
347
+ };
348
+ export type DeleteProcessByIdentifierErrors = {
349
+ /**
350
+ * Process not found
351
+ */
352
+ 404: ErrorResponse;
353
+ /**
354
+ * Unprocessable entity
355
+ */
356
+ 422: ErrorResponse;
357
+ /**
358
+ * Internal server error
359
+ */
360
+ 500: ErrorResponse;
361
+ };
362
+ export type DeleteProcessByIdentifierError = DeleteProcessByIdentifierErrors[keyof DeleteProcessByIdentifierErrors];
363
+ export type DeleteProcessByIdentifierResponses = {
364
+ /**
365
+ * Process stopped
366
+ */
367
+ 200: SuccessResponse;
368
+ };
369
+ export type DeleteProcessByIdentifierResponse = DeleteProcessByIdentifierResponses[keyof DeleteProcessByIdentifierResponses];
370
+ export type GetProcessByIdentifierData = {
371
+ body?: never;
372
+ path: {
373
+ /**
374
+ * Process identifier (PID or name)
375
+ */
376
+ identifier: string;
377
+ };
378
+ query?: never;
379
+ url: '/process/{identifier}';
380
+ };
381
+ export type GetProcessByIdentifierErrors = {
382
+ /**
383
+ * Process not found
384
+ */
385
+ 404: ErrorResponse;
386
+ };
387
+ export type GetProcessByIdentifierError = GetProcessByIdentifierErrors[keyof GetProcessByIdentifierErrors];
388
+ export type GetProcessByIdentifierResponses = {
389
+ /**
390
+ * Process information
391
+ */
392
+ 200: ProcessResponse;
393
+ };
394
+ export type GetProcessByIdentifierResponse = GetProcessByIdentifierResponses[keyof GetProcessByIdentifierResponses];
395
+ export type DeleteProcessByIdentifierKillData = {
396
+ body?: never;
397
+ path: {
398
+ /**
399
+ * Process identifier (PID or name)
400
+ */
401
+ identifier: string;
402
+ };
403
+ query?: never;
404
+ url: '/process/{identifier}/kill';
405
+ };
406
+ export type DeleteProcessByIdentifierKillErrors = {
407
+ /**
408
+ * Process not found
409
+ */
410
+ 404: ErrorResponse;
411
+ /**
412
+ * Unprocessable entity
413
+ */
414
+ 422: ErrorResponse;
415
+ /**
416
+ * Internal server error
417
+ */
418
+ 500: ErrorResponse;
419
+ };
420
+ export type DeleteProcessByIdentifierKillError = DeleteProcessByIdentifierKillErrors[keyof DeleteProcessByIdentifierKillErrors];
421
+ export type DeleteProcessByIdentifierKillResponses = {
422
+ /**
423
+ * Process killed
424
+ */
425
+ 200: SuccessResponse;
426
+ };
427
+ export type DeleteProcessByIdentifierKillResponse = DeleteProcessByIdentifierKillResponses[keyof DeleteProcessByIdentifierKillResponses];
428
+ export type GetProcessByIdentifierLogsData = {
429
+ body?: never;
430
+ path: {
431
+ /**
432
+ * Process identifier (PID or name)
433
+ */
434
+ identifier: string;
435
+ };
436
+ query?: never;
437
+ url: '/process/{identifier}/logs';
438
+ };
439
+ export type GetProcessByIdentifierLogsErrors = {
440
+ /**
441
+ * Process not found
442
+ */
443
+ 404: ErrorResponse;
444
+ /**
445
+ * Unprocessable entity
446
+ */
447
+ 422: ErrorResponse;
448
+ /**
449
+ * Internal server error
450
+ */
451
+ 500: ErrorResponse;
452
+ };
453
+ export type GetProcessByIdentifierLogsError = GetProcessByIdentifierLogsErrors[keyof GetProcessByIdentifierLogsErrors];
454
+ export type GetProcessByIdentifierLogsResponses = {
455
+ /**
456
+ * Process logs
457
+ */
458
+ 200: ProcessLogs;
459
+ };
460
+ export type GetProcessByIdentifierLogsResponse = GetProcessByIdentifierLogsResponses[keyof GetProcessByIdentifierLogsResponses];
461
+ export type GetProcessByIdentifierLogsStreamData = {
462
+ body?: never;
463
+ path: {
464
+ /**
465
+ * Process identifier (PID or name)
466
+ */
467
+ identifier: string;
468
+ };
469
+ query?: never;
470
+ url: '/process/{identifier}/logs/stream';
471
+ };
472
+ export type GetProcessByIdentifierLogsStreamErrors = {
473
+ /**
474
+ * Process not found
475
+ */
476
+ 404: ErrorResponse;
477
+ /**
478
+ * Unprocessable entity
479
+ */
480
+ 422: ErrorResponse;
481
+ /**
482
+ * Internal server error
483
+ */
484
+ 500: ErrorResponse;
485
+ };
486
+ export type GetProcessByIdentifierLogsStreamError = GetProcessByIdentifierLogsStreamErrors[keyof GetProcessByIdentifierLogsStreamErrors];
487
+ export type GetProcessByIdentifierLogsStreamResponses = {
488
+ /**
489
+ * Stream of process logs, one line per log (prefixed with stdout:/stderr:)
490
+ */
491
+ 200: string;
492
+ };
493
+ export type GetProcessByIdentifierLogsStreamResponse = GetProcessByIdentifierLogsStreamResponses[keyof GetProcessByIdentifierLogsStreamResponses];
494
+ export type GetWatchFilesystemByPathData = {
495
+ body?: never;
496
+ path: {
497
+ /**
498
+ * Directory path to watch
499
+ */
500
+ path: string;
501
+ };
502
+ query?: {
503
+ /**
504
+ * Ignore patterns (comma-separated)
505
+ */
506
+ ignore?: string;
507
+ };
508
+ url: '/watch/filesystem/{path}';
509
+ };
510
+ export type GetWatchFilesystemByPathErrors = {
511
+ /**
512
+ * Invalid path
513
+ */
514
+ 400: ErrorResponse;
515
+ /**
516
+ * Internal server error
517
+ */
518
+ 500: ErrorResponse;
519
+ };
520
+ export type GetWatchFilesystemByPathError = GetWatchFilesystemByPathErrors[keyof GetWatchFilesystemByPathErrors];
521
+ export type GetWatchFilesystemByPathResponses = {
522
+ /**
523
+ * Stream of modified file paths, one per line
524
+ */
525
+ 200: string;
526
+ };
527
+ export type GetWatchFilesystemByPathResponse = GetWatchFilesystemByPathResponses[keyof GetWatchFilesystemByPathResponses];
528
+ export type GetWsProcessByIdentifierLogsStreamData = {
529
+ body?: never;
530
+ path: {
531
+ /**
532
+ * Process identifier (PID or name)
533
+ */
534
+ identifier: string;
535
+ };
536
+ query?: never;
537
+ url: '/ws/process/{identifier}/logs/stream';
538
+ };
539
+ export type GetWsProcessByIdentifierLogsStreamErrors = {
540
+ /**
541
+ * Process not found
542
+ */
543
+ 404: ErrorResponse;
544
+ /**
545
+ * Unprocessable entity
546
+ */
547
+ 422: ErrorResponse;
548
+ /**
549
+ * Internal server error
550
+ */
551
+ 500: ErrorResponse;
552
+ };
553
+ export type GetWsProcessByIdentifierLogsStreamError = GetWsProcessByIdentifierLogsStreamErrors[keyof GetWsProcessByIdentifierLogsStreamErrors];
554
+ export type GetWsWatchFilesystemByPathData = {
555
+ body?: never;
556
+ path: {
557
+ /**
558
+ * Directory path to watch
559
+ */
560
+ path: string;
561
+ };
562
+ query?: never;
563
+ url: '/ws/watch/filesystem/{path}';
564
+ };
565
+ export type GetWsWatchFilesystemByPathErrors = {
566
+ /**
567
+ * Invalid path
568
+ */
569
+ 400: ErrorResponse;
570
+ /**
571
+ * Internal server error
572
+ */
573
+ 500: ErrorResponse;
574
+ };
575
+ export type GetWsWatchFilesystemByPathError = GetWsWatchFilesystemByPathErrors[keyof GetWsWatchFilesystemByPathErrors];
576
+ export type ClientOptions = {
577
+ baseUrl: 'https://run.blaxel.ai/{workspace_id}/sandboxes/{sandbox_id}' | (string & {});
578
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file is auto-generated by @hey-api/openapi-ts
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,29 +1,17 @@
1
+ import { Sandbox } from "../../client/types.gen.js";
1
2
  import { SandboxAction } from "../action.js";
2
- import { WebSocketClient } from "../websocket/index.js";
3
3
  import { Directory, SuccessResponse } from "../client/index.js";
4
- import { SandboxProcess } from "../process/index.js";
5
- import { SandboxProcessWebSocket } from "../process/process-ws.js";
6
4
  import { CopyResponse, SandboxFilesystemFile, WatchEvent } from "./types.js";
7
- import { SandboxConfiguration } from "../types.js";
8
- export declare class SandboxFileSystemWebSocket extends SandboxAction {
9
- private process;
10
- private wsClient;
11
- private httpClient;
12
- constructor(sandbox: SandboxConfiguration, process: SandboxProcess | SandboxProcessWebSocket, wsClient: WebSocketClient);
5
+ export declare class SandboxFileSystem extends SandboxAction {
6
+ constructor(sandbox: Sandbox);
13
7
  mkdir(path: string, permissions?: string): Promise<SuccessResponse>;
14
8
  write(path: string, content: string): Promise<SuccessResponse>;
15
- writeBinary(path: string, content: Buffer | Blob | File | Uint8Array | string): Promise<SuccessResponse>;
16
- writeTree(files: SandboxFilesystemFile[], destinationPath?: string | null): Promise<Directory>;
9
+ writeBinary(path: string, content: Buffer | Blob | File | Uint8Array): Promise<unknown>;
10
+ writeTree(files: SandboxFilesystemFile[], destinationPath?: string | null): Promise<Directory | undefined>;
17
11
  read(path: string): Promise<string>;
18
- readBinary(path: string): Promise<Blob>;
19
- download(src: string, destinationPath: string, options?: {
20
- mode?: number;
21
- }): Promise<void>;
22
12
  rm(path: string, recursive?: boolean): Promise<SuccessResponse>;
23
13
  ls(path: string): Promise<Directory>;
24
- cp(source: string, destination: string, { maxWait }?: {
25
- maxWait?: number;
26
- }): Promise<CopyResponse>;
14
+ cp(source: string, destination: string): Promise<CopyResponse>;
27
15
  watch(path: string, callback: (fileEvent: WatchEvent) => void | Promise<void>, options?: {
28
16
  onError?: (error: Error) => void;
29
17
  withContent: boolean;