@mosaic-sandbox/computesdk
v0.2.2
Published
ComputeSDK provider for Mosaic Sandbox (MAR)
Readme
Mosaic provider for ComputeSDK
This package adapts Mosaic Sandbox's REST lifecycle to the current
@computesdk/provider interface.
import { compute } from 'computesdk';
import { mosaic } from '@mosaic-sandbox/computesdk';
const sdk = compute({
provider: mosaic({
baseUrl: process.env.MOSAIC_API_URL,
apiKey: process.env.MOSAIC_API_TOKEN,
}),
});
const sandbox = await sdk.sandbox.create({
templateId: 'node-20',
memoryMb: 4096,
vcpus: 2,
});
const result = await sandbox.runCommand('node -v');
await sandbox.destroy();The adapter implements create, get, list, destroy, command execution, resource mapping, timeouts, bearer authentication, environment variables, working directories, and background commands. Preview URLs and file APIs remain separate acceptance gates and are not needed for the ComputeSDK TTI benchmark.
Do not describe a result as a ComputeSDK benchmark unless:
- The adapter is invoked through
compute.sandbox.create(). - The client runs outside Mosaic infrastructure against a public HTTPS API.
- The run uses 100 attempts with no retries.
- Sequential, 200 ms staggered, and burst modes are reported separately.
- Raw iteration results, failures, runner metadata, median, P95, P99, and success rate are retained.
