feat: base Sandbox interface#1090
Conversation
|
Assessment: Comment This PR introduces a clean, well-structured Review Themes
The design is solid — streaming-first with non-streaming convenience methods is the right pattern, and the language validation guard in |
0e736f1 to
f008526
Compare
|
Assessment: Comment Clean architecture with good separation of concerns. The previous review covered the main substantive issues (duplication, TSDoc gaps, export surface), and the author has committed to fixing all of them. This follow-up catches a few remaining gaps. Additional Review Items
|
f008526 to
0711ac8
Compare
|
Assessment: Comment The architecture and API design are solid. Previous review items have been acknowledged and are being addressed. This review surfaces two remaining documentation gaps and one unnecessary change. Review Themes
The streaming-first design with heredoc-based code execution is well thought out, and the security properties (base64 EOF markers can't collide, language validation, shell quoting) are correct. |
0711ac8 to
2e707f5
Compare
|
Assessment: Approve Well-designed abstraction with correct security properties, comprehensive test coverage for the happy path, and clean streaming-first API. The code has been through multiple review iterations and all prior feedback has been addressed. Review Themes
The architecture is solid and aligns well with the SDK tenets — streaming as the primitive, convenience methods on top, and |
b6c9fc2 to
f4383b0
Compare
|
Assessment: Approve Clean, well-designed abstraction with correct security properties and comprehensive test coverage. No new issues found after thorough analysis of shell quoting, event race conditions, streaming loop semantics, and type safety. Review DetailsVerified correct:
Prior feedback status: All 8 prior automated review items have been addressed. The two remaining open items (export surface for external implementors, dedicated |
f4383b0 to
392a184
Compare
bb696fc
Description
Introduces the
Sandboxinterface, the core abstraction that decouples tool logic from where code runs.This is the base interface only. Concrete implementations (Docker, SSH), vended tools/plugins and the Agent integration ship in follow-up PRs (incrementally broken off from the parent mega-PR #1011).
What's Included
Core Interface (src/sandbox/base.ts)
executeStreaming(command, options?)— stream stdout/stderr from a shell commandexecuteCodeStreaming(code, language, options?)— stream output from code execution via interpreterreadFile(path)— read file as Uint8ArraywriteFile(path, content)— write Uint8Array, creates parent directoriesremoveFile(path)— delete a filelistFiles(path)— list directory contents as FileInfo[]execute(command, options?)— non-streaming wrapper over executeStreamingexecuteCode(code, language, options?)— non-streaming wrapper over executeCodeStreamingreadText(path)— UTF-8 decode wrapper over readFilewriteText(path, content)— UTF-8 encode wrapper over writeFileShell-Based Defaults (src/sandbox/posix-shell.ts)
PosixShellSandboxabstract class (subclasses implement only executeStreaming)Related Issues
Documentation PR
Not yet
Type of Change
New feature
Testing
How have you tested the change?
npm run checkChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.