0
Fork 0
mirror of https://github.com/mastra-ai/mastra.git synced 2026-11-17 08:44:46 +00:00
mastra/workspaces/sprites/README.md

1.6 KiB

@mastra/sprites

Fly.io Sprites sandbox provider for Mastra workspaces.

Implements the WorkspaceSandbox interface using Fly.io Sprites — persistent Linux VMs that keep their filesystem between runs and hibernate when idle — through the official @fly/sprites SDK. Supports get-or-create by Sprite name, command execution with streaming output, timeouts and cancellation, background processes with stdin, and checkpoint capture.

Requires Node.js 24 or later.

Installation

npm install @mastra/sprites

Usage

import { Workspace } from '@mastra/core/workspace';
import { SpritesSandbox } from '@mastra/sprites';

const sandbox = new SpritesSandbox({
  id: 'mastra-project',
  // token read from SPRITES_TOKEN
});

const workspace = new Workspace({ sandbox });
await workspace.init();

const result = await workspace.sandbox.executeCommand('echo', ['Hello!']);
console.log(result.stdout); // "Hello!"

// stop() keeps the Sprite and its files; destroy() deletes it.
await sandbox.destroy();

Documentation

Changelog

See the package changelog for version history and release notes.

Support

We have an open community Discord. Come and say hello and let us know if you have any questions or need any help getting things running.