HubLensTypeScriptmattpocock/sandcastle
mattpocock

sandcastle

AI🌱 NEW PROJECT BOOST#TypeScript#Docker#Agentic AI#Sandboxing#Automation
View on GitHub
66

// summary

Sandcastle is a TypeScript library designed to orchestrate AI coding agents within isolated, secure sandbox environments. It supports multiple providers including Docker, Podman, and Vercel to manage agent execution and branch strategies effectively. The library simplifies complex workflows by handling sandbox lifecycles, git worktrees, and automated commit merging.

// technical analysis

Sandcastle is a TypeScript library designed to orchestrate AI coding agents within secure, isolated environments by leveraging Git worktrees and containerized sandboxes. It solves the challenge of safely executing autonomous agents by providing a structured way to isolate changes, manage branch strategies, and persist state across multiple agent iterations. The project prioritizes flexibility through a provider-agnostic architecture, allowing developers to swap between Docker, Podman, and Vercel, or implement custom sandbox providers to suit specific infrastructure needs.

// key highlights

01
Supports multiple sandbox providers including Docker, Podman, and Vercel for flexible environment isolation.
02
Enables multi-step agent workflows by allowing multiple runs within a single persistent sandbox container.
03
Integrates with Git worktrees to manage agent changes on specific branches without affecting the main codebase.
04
Provides comprehensive lifecycle hooks for both host and sandbox environments to automate setup tasks like dependency installation.
05
Offers a programmatic API for advanced use cases like CI pipelines, custom tooling, and parallelized agent orchestration.
06
Includes built-in logging and observability features to track agent iterations, tool calls, and generated commits.

// use cases

01
Parallelizing multiple AFK AI coding agents
02
Creating automated code review pipelines
03
Orchestrating custom AI agents with isolated environment management

// getting started

To begin, install the package via npm and run 'npx sandcastle init' to scaffold the necessary configuration files. Configure your environment variables in the generated .sandcastle/.env file, then execute your agent logic by running the main TypeScript file using 'npx tsx'. You can then define your agent and sandbox provider in your code to start orchestrating your AI coding tasks.