E2B filesystem implementation for DeepSeek Harness
$ dsh plugin --profile web add npm:@deepseek-ai/dsh-fs-e2bRun the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial
English | 中文
E2B implementation of the @deepseek-ai/dsh-fs provider contract. It has no config: load @deepseek-ai/dsh-e2b first, then this service in place of dsh-fs-local. The provider uses the owner's remote cwd and SDK handle, so file tools observe the same world as E2B-backed Bash processes.
ctx.e2b.cwd; GNU realpath -mz supplies canonical target identity without requiring the final file to exist, and ASCII/base64 plus strict NUL framing preserves newline and multibyte paths across the decoded SDK transport. stat, no-follow lstat, and stable one-level directory listings project E2B metadata into the filesystem seam; listings reuse returned metadata and resolve symbolic-link entries sequentially. Versions are opaque hashes of E2B metadata plus a per-write extended attribute.file: URIs, and provider-owned containment checks, so generic subprocess consumers never parse E2B target ids or apply host path rules.readBytes short-circuits on the stat size before any content transfer, then streams the remote object and cancels the stream at the first chunk past maxBytes (FS_TOO_LARGE), so neither an at-rest oversized file nor a post-stat grower is buffered whole in host memory. The empty-file quirk of the pinned SDK (content-length 0 returns '' in stream format) yields an empty result.0700 before uploading content, and preserve an existing file's POSIX mode. Replacements publish through E2B's same-filesystem atomic rename. A guarded createIfAbsent publishes with remote ln -T instead, making the commit atomically no-replace even when a directory appears at the destination; metadata read from the staged file before that commit is projected to the target path for the returned version, so no fallible metadata request follows either commit point. E2B creates missing parent directories. Literal edits LF-normalize for matching, restore dominant CRLF storage, and serialize mutations per canonical target within the host process.FsError vocabulary. Cancellation is best-effort at earlier SDK request boundaries and checked immediately before publication. The signal is not forwarded into the rename or guarded-link commit, so cancellation cannot interrupt atomic publication or turn a committed write into a reported failure.The provider does not copy, mount, or reconcile the host workspace. Giving it a host path as cwd creates a remote directory with the same spelling only.
Indirectly, through dsh-tool-fs, which renders remote UTF-8 content, directory results, mutation acknowledgements, and provider errors while E2B identity and transport remain internal.
No direct invalidation; the named consumer owns any request-prefix changes.
createIfAbsent preserves a remote creator racing publication, but another harness connection or command can still race replacement; version guards detect only metadata changes represented by E2B.realpath/base64/chmod, same-filesystem rename, streaming reads, and metadata extended attributes; custom templates are outside this POC.