Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Fix exports

Tomas Valenta063f8cfd83a1
diff --git a/packages/js-sdk/src/index.ts b/packages/js-sdk/src/index.ts
index 1030c9cee..7c5947f97 100644
--- a/packages/js-sdk/src/index.ts
+++ b/packages/js-sdk/src/index.ts
@@ -11,7 +11,6 @@ export { WatchHandle } from './sandbox/filesystem/watchHandle'
export type { FilesystemEvent } from './sandbox/filesystem/watchHandle'
export type {
EntryInfo,
- FileFormat,
} from './sandbox/filesystem'
export {
EventType,
diff --git a/packages/js-sdk/src/sandbox/filesystem/index.ts b/packages/js-sdk/src/sandbox/filesystem/index.ts
index f08003ae3..f9c4dc553 100644
--- a/packages/js-sdk/src/sandbox/filesystem/index.ts
+++ b/packages/js-sdk/src/sandbox/filesystem/index.ts
@@ -17,8 +17,6 @@ import { WatchHandle, FilesystemEvent } from './watchHandle'
export type EntryInfo = PlainMessage<FsEntryInfo>
-export type FileFormat = 'text' | 'stream' | 'bytes' | 'blob'
-
export interface FilesystemRequestOpts extends Partial<Pick<ConnectionOpts, 'requestTimeoutMs'>> {
user?: Username
}
@@ -40,7 +38,7 @@ export class Filesystem {
async read(path: string, opts?: FilesystemRequestOpts & { format: 'bytes' }): Promise<Uint8Array>
async read(path: string, opts?: FilesystemRequestOpts & { format: 'blob' }): Promise<Blob>
async read(path: string, opts?: FilesystemRequestOpts & { format: 'stream' }): Promise<ReadableStream<Uint8Array>>
- async read(path: string, opts?: FilesystemRequestOpts & { format?: FileFormat }): Promise<unknown> {
+ async read(path: string, opts?: FilesystemRequestOpts & { format?: 'text' | 'stream' | 'bytes' | 'blob' }): Promise<unknown> {
const requestTimeoutMs = opts?.requestTimeoutMs ?? this.connectionConfig.requestTimeoutMs
const format = opts?.format ?? 'text'
diff --git a/packages/python-sdk/e2b/__init__.py b/packages/python-sdk/e2b/__init__.py
index 40cad42a1..2a2286d3f 100644
--- a/packages/python-sdk/e2b/__init__.py
+++ b/packages/python-sdk/e2b/__init__.py
@@ -13,5 +13,4 @@ from .sandbox.process.process_handle import (
ProcessStdout,
)
from .sandbox.filesystem.watch_handle import WatchHandle
-from .sandbox.filesystem.filesystem import FileFormat
from e2b.envd.filesystem.filesystem_pb2 import FilesystemEvent, FileType, EntryInfo
diff --git a/packages/python-sdk/e2b/sandbox/filesystem/filesystem.py b/packages/python-sdk/e2b/sandbox/filesystem/filesystem.py
index 4a0a878b2..f16d0643d 100644
--- a/packages/python-sdk/e2b/sandbox/filesystem/filesystem.py
+++ b/packages/python-sdk/e2b/sandbox/filesystem/filesystem.py
@@ -19,9 +19,6 @@ from e2b.envd.filesystem import filesystem_connect, filesystem_pb2
from e2b.envd.permissions.permissions_pb2 import User
from e2b.envd.api import ENVD_API_FILES_ROUTE
-
-FileFormat = Literal["text", "bytes", "stream"]
-
READ_CHUNK_SIZE = 2 << 16 # 64KiB
@@ -64,7 +61,7 @@ class Filesystem:
def read(
self,
path: str,
- format: FileFormat = "text",
+ format: Literal["text", "bytes", "stream"] = "text",
request_timeout: Optional[float] = None,
user: Username = "user",
):