npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@miosa/sdk

v1.2.0

Published

TypeScript SDK for the MIOSA API — cloud VM desktop infrastructure for AI agents

Downloads

264

Readme

@miosa/sdk (TypeScript)

Official TypeScript / JavaScript SDK for MIOSA — the AI cloud platform for sandboxes, computers, deployments, and managed data.

npm version npm downloads Types License: MIT Docs

Ships ESM + CJS. Full TypeScript types included — no @types/ package needed. Node.js 18+.

Install

npm install @miosa/sdk
# or
pnpm add @miosa/sdk
# or
yarn add @miosa/sdk
# or
bun add @miosa/sdk

Quickstart

import { Miosa } from "@miosa/sdk";

const miosa = new Miosa({ apiKey: "msk_live_..." });

// Boot a sandbox, write a file, run a command
const sbx = await miosa.sandboxes.create({ name: "my-build" });

await sbx.files.write("/workspace/hello.ts", `console.log("hello from miosa")`);
const result = await sbx.exec("npx tsx /workspace/hello.ts");
console.log(result.stdout); // hello from miosa

// Expose a live preview URL
const url = await sbx.expose(3000);
console.log(url); // https://3000-<slug>.sandbox.miosa.ai

await sbx.destroy();

What's included

| Resource | Description | |---|---| | miosa.sandboxes | Lightweight code-execution VMs — exec, files, snapshots, previews | | miosa.computers | Full Linux desktop VMs for computer-use agents | | miosa.deployments | Versioned production releases with rollback | | miosa.databases | Managed Postgres / Redis lifecycle | | miosa.storage | S3-compatible object storage | | miosa.volumes | Persistent block storage | | miosa.apiKeys | Programmatic API key management | | miosa.usage | Usage reports per workspace, per external tenant | | miosa.settings | Workspace config, branding, BYOK provider keys | | miosa.webhooks | Outgoing tenant webhooks — CRUD, test, delivery history | | miosa.openComputers | BYOC host management — register your own machines | | miosa.completions | OpenAI-compatible chat completions with SSE streaming | | miosa.embeddings | OpenAI-compatible embedding vectors |

Sandbox sub-resources

Every Sandbox instance exposes composable sub-resources:

const sbx = await miosa.sandboxes.create();

// Files
await sbx.files.write("/workspace/app.py", "print('hi')");
const text    = await sbx.files.readText("/workspace/app.py");
const entries = await sbx.files.list("/workspace");
const stat    = await sbx.files.stat("/workspace/app.py");

// Exec — callable directly, or via .exec.run / .exec.stream
const result = await sbx.exec.run("python /workspace/app.py");
for await (const event of sbx.exec.stream("tail -f /var/log/app.log")) {
  if ("line" in event) console.log(event.line);
}

// Snapshots
const snap = await sbx.snapshots.create("pre-migration");
const restored = await sbx.snapshots.restore(snap.id);
await sbx.snapshots.delete(snap.id);

// Previews
const preview = await sbx.previews.create(8000);
console.log(preview.url);

// Live SSE event stream
for await (const event of sbx.events.stream()) {
  console.log(event.type, event.data);
}

// Pause / resume
await sbx.pause();
await sbx.resume();

Desktop control (Computers)

const computer = await miosa.computers.create({
  name: "agent-desktop",
  template_type: "miosa-desktop",
  size: "medium",
});
await computer.start();
await computer.wait(5);

const png = await computer.screenshot();    // Uint8Array
await computer.click(640, 400);
await computer.type("hello world");
await computer.key("Return");
await computer.scroll("down", 3);
await computer.drag(100, 100, 400, 400);

const result = await computer.bash("ls -la /home/user");
console.log(result.output);

await computer.destroy();

White-label / multi-tenant

const sbx = await miosa.sandboxes.create({
  externalWorkspaceId: "dental-office-123",
  externalUserId: "dr-smith-456",
});

const sandboxes = await miosa.sandboxes.list({
  externalWorkspaceId: "dental-office-123",
});

Error handling

import { MiosaError } from "@miosa/sdk";

try {
  await miosa.sandboxes.get("sbx_doesnt_exist");
} catch (e) {
  if (e instanceof MiosaError) {
    console.error(`${e.status} ${e.code}: ${e.message}`);
  }
}

The SDK retries 429 and 5xx automatically (3 retries, exponential backoff + jitter). Set maxRetries: 0 to disable.

Configuration

| Option | Env var | Default | |---|---|---| | apiKey | MIOSA_API_KEY | — | | baseUrl | MIOSA_BASE_URL | https://api.miosa.ai/api/v1 | | timeout | — | 30 000 ms | | maxRetries | — | 3 |

const miosa = new Miosa({
  apiKey: process.env.MIOSA_API_KEY!,
  timeout: 60_000,
  maxRetries: 5,
});

Links

License

MIT