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

@mirva/sdk

v0.1.0

Published

Client for Mirva: call the tools your account has on its boards and canvases, over one WebSocket.

Downloads

78

Readme

@mirva/sdk

Client for Mirva: your boards and canvases from your own code, over one WebSocket. It is the client the Mirva MCP server is built on, so a script and an agent get the same tools with the same permissions.

npm install @mirva/sdk
import { writeFile } from 'node:fs/promises';
import { Mirva } from '@mirva/sdk';

const mirva = await Mirva.connect();                     // MIRVA_API_KEY from the environment

const drawings = (await mirva.tools.list_drawings()).json<{ shortId: string; name: string; type: string }[]>();
const board = drawings.find(d => d.type === 'Board');
if (!board) throw new Error('No board to work on');

await mirva.tools.add_note({ boardId: board.shortId, text: 'Shot list', x: 0, y: 0 });

const png = await mirva.capture(board.shortId, { maxDim: 1600 });
await writeFile('board.png', png.data);

const { reply, session } = await mirva.ask('Paint over the sketch in the house skill', { boardId: board.shortId });
console.log(reply.message, reply.tools);
for (const produced of reply.producedImages ?? []) {
  await writeFile(`${produced.fileId}.png`, (await session.image(produced.fileId)).data);
}

mirva.close();

Connecting

Mirva.connect(options) opens the socket, so a wrong url or key is reported there; new Mirva(options) connects on the first call instead. A dropped socket is dialled again by the next call.

| Option | Environment | Default | | |---|---|---|---| | apiKey | MIRVA_API_KEY | — | API key for the account to act as, from its API page. Revocable there; the credential to use. | | token | MIRVA_TOKEN | — | Session token, as an alternative when no API key is available | | url | MIRVA_URL | https://mirva.ai | Server origin |

Tools

Every tool the server offers is a method of mirva.tools, with its arguments typed and documented from the server's own tool list. Tools answer with a ToolOutput:

  • text: the answer's text; most tools answer with JSON, which json<T>() parses
  • images / image: images in the answer, decoded to a Buffer with their media type
  • raw: the answer as the server sent it

The types are generated from the tool list when this package is built. mirva.call(name, args) reaches any tool by name, including one newer than the build, and mirva.listTools() returns what the server offers now.

Asking Mirva

mirva.ask(message, { boardId }) starts a conversation with Mirva, scoped to the board when given one, and waits until Mirva has answered. A turn can run tools, generate images and edit the board, which takes minutes for a render; the reply carries what it did:

| Field | | |---|---| | message | Mirva's answer | | tools | the tools it ran, in order | | producedImages | the images it generated: fetch one with session.image(fileId) | | boardEdits | what it added to the board |

mirva.session({ boardId }) keeps one conversation for several requests, each seeing the earlier ones:

const session = await mirva.session({ boardId });
await session.ask('Block in the environment from my sketch');
await session.ask('Now a night version');

ask options: images (references to attach, as Buffers or base64), onMessage (called as messages arrive), timeoutMs (default 15 minutes), pollMs (default 2 seconds) and an abort signal. A turn Mirva stops or fails also ends with a reply, saying so.

How it works

The client speaks Deepkit RPC over a WebSocket to the server's /api/teams/rpc endpoint, the protocol Mirva's own web client uses. Every call runs on the server as the account whose credential you configured, with the web app's permission checks. MirvaClient, the connection underneath, is exported for calls to the RPC controller directly.

Security

Either credential acts as the account: treat it like a password. An API key can be revoked from the account's API page without touching the session; a session token cannot, which is why the key is the one to hand out.