@cloudflare/sandbox 0.0.0-bb72193 → 0.0.0-bb855ca
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/CHANGELOG.md +24 -0
- package/Dockerfile +36 -13
- package/README.md +231 -9
- package/container_src/bun.lock +122 -0
- package/container_src/handler/exec.ts +4 -2
- package/container_src/handler/process.ts +1 -1
- package/container_src/index.ts +171 -1
- package/container_src/jupyter-server.ts +336 -0
- package/container_src/mime-processor.ts +255 -0
- package/container_src/package.json +9 -0
- package/container_src/startup.sh +52 -0
- package/package.json +1 -1
- package/src/client.ts +37 -54
- package/src/index.ts +13 -4
- package/src/interpreter-types.ts +383 -0
- package/src/interpreter.ts +150 -0
- package/src/jupyter-client.ts +266 -0
- package/src/sandbox.ts +281 -153
- package/src/types.ts +15 -0
package/src/types.ts
CHANGED
|
@@ -342,6 +342,14 @@ export interface GetProcessLogsResponse {
|
|
|
342
342
|
processId: string;
|
|
343
343
|
}
|
|
344
344
|
|
|
345
|
+
// Import code interpreter types
|
|
346
|
+
import type {
|
|
347
|
+
CodeContext,
|
|
348
|
+
CreateContextOptions,
|
|
349
|
+
ExecutionResult,
|
|
350
|
+
RunCodeOptions
|
|
351
|
+
} from './interpreter-types';
|
|
352
|
+
|
|
345
353
|
// Main Sandbox Interface
|
|
346
354
|
|
|
347
355
|
export interface ISandbox {
|
|
@@ -362,6 +370,13 @@ export interface ISandbox {
|
|
|
362
370
|
// Utility methods
|
|
363
371
|
cleanupCompletedProcesses(): Promise<number>;
|
|
364
372
|
getProcessLogs(id: string): Promise<{ stdout: string; stderr: string }>;
|
|
373
|
+
|
|
374
|
+
// Code Interpreter API
|
|
375
|
+
createCodeContext(options?: CreateContextOptions): Promise<CodeContext>;
|
|
376
|
+
runCode(code: string, options?: RunCodeOptions): Promise<ExecutionResult>;
|
|
377
|
+
runCodeStream(code: string, options?: RunCodeOptions): Promise<ReadableStream>;
|
|
378
|
+
listCodeContexts(): Promise<CodeContext[]>;
|
|
379
|
+
deleteCodeContext(contextId: string): Promise<void>;
|
|
365
380
|
}
|
|
366
381
|
|
|
367
382
|
// Type Guards
|