Home/Tools/@tpmjs/tools-sprites-create

spritesCreateTool

@tpmjs/tools-sprites-create

Create a new isolated Linux sandbox environment (sprite) with persistent filesystem using the Sprites API. Sprites are lightweight VMs for running code securely.

Official
sandbox
v0.1.2
MIT

Interactive Playground

Test @tpmjs/tools-sprites-create (spritesCreateTool) with AI-powered execution

0/2000 characters

Installation & Usage

Install this tool and use it with the AI SDK

1. Install the package

npm install @tpmjs/tools-sprites-create
pnpm add @tpmjs/tools-sprites-create
yarn add @tpmjs/tools-sprites-create
bun add @tpmjs/tools-sprites-create
deno add npm:@tpmjs/tools-sprites-create

2. Import the tool

import { spritesCreateTool } from '@tpmjs/tools-sprites-create';

3. Use with AI SDK

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { spritesCreateTool } from '@tpmjs/tools-sprites-create';

const result = await generateText({
  model: openai('gpt-4o'),
  tools: { spritesCreateTool },
  prompt: 'Your prompt here...',
});

console.log(result.text);

Parameters

Available configuration options

Auto-extracted
name
Required
Type: string

Unique name for the sprite (must be lowercase alphanumeric with hyphens, 3-63 characters)

Schema extracted: 1/16/2026, 3:45:29 AM

README

@tpmjs/sprites-create

Create a new isolated Linux sandbox environment (sprite) with persistent filesystem.

Installation

npm install @tpmjs/sprites-create

Requirements

Usage

import { spritesCreateTool } from '@tpmjs/sprites-create';

const result = await spritesCreateTool.execute({
  name: 'my-new-sandbox'
});

console.log(result);
// {
//   name: 'my-new-sandbox',
//   status: 'creating',
//   createdAt: '2024-01-15T10:30:00Z'
// }

Input Parameters

ParameterTypeRequiredDescription
namestringYesUnique name for the sprite (lowercase alphanumeric with hyphens, 3-63 characters)

Output

FieldTypeDescription
namestringName of the created sprite
status'creating' | 'running' | 'stopped' | 'error'Current status
createdAtstringISO 8601 timestamp of creation
runtimestring?Optional runtime configuration
metadataobject?Optional custom metadata

Name Validation

Sprite names must:

  • Be 3-63 characters long
  • Start and end with a lowercase letter or number
  • Contain only lowercase letters, numbers, and hyphens

Error Handling

The tool throws errors in these cases:

  • SPRITES_TOKEN environment variable is not set
  • Invalid sprite name format
  • Sprite name already exists (HTTP 409)
  • Invalid or expired API token (HTTP 401)
  • Network timeout (60 second limit)
  • API errors with descriptive messages

License

MIT

Statistics

Downloads/month

0

Quality Score

0%

Bundle Size

NPM Keywords

tpmjs
sprites
sandbox
code-execution
ai

Maintainers

thomasdavis(thomasalwyndavis@gmail.com)

Frameworks

vercel-ai
spritesCreateTool | TPMJS | TPMJS