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

@muse-code/sdk

v1.3.0

Published

TypeScript SDK for the Muse Session Protocol (MSP): connect to a Muse Code session, drive turns, and fold the event stream. Zero runtime dependencies.

Readme

@muse-code/sdk

The TypeScript SDK for Muse Code: a typed Node client for driving a Muse Code agent over the Muse Session Protocol (MSP).

  • Spawn a muse serve host, open and resume sessions, and send turns.
  • Stream a turn's items and text deltas as async iterators; await the turn's server-authored outcome.
  • Answer tool-approval requests with a handler you register — or register none and run under the server's own default-deny.
  • A client-side fold keeps a live, typed view of the session — items, session state, pending commands — with gap recovery after dropped deliveries and safe same-command retry that can never double-submit.

Zero runtime dependencies: pure TypeScript over the Node standard library. The MSP wire declarations are bundled into the package, so nothing else is needed to typecheck against it.

Install

npm install @muse-code/sdk
npm install -D @types/node   # required for TypeScript consumers

Node 20 or newer. @types/node is declared as an optional peer dependency: a JavaScript consumer needs nothing, while a TypeScript consumer installs it explicitly — without it the declarations that name ChildProcess, Readable and friends do not resolve.

You also need the Muse Code CLI: a muse binary on PATH, or an explicit path passed at spawn time.

This package versions in lockstep with Muse Code: the SDK version is the Muse Code release it ships with — @muse-code/sdk X.Y.Z pairs with Muse Code X.Y.Z. The stable MSP surface follows the product's compatibility posture: evolution is additive, and a breaking change follows a documented deprecation and changelog path. Surfaces marked experimental (x-msp-openness) may change or be removed with a changelog entry and no deprecation window. Pin an exact version, and read the changelog before moving off it.

Use

import { MuseClient } from "@muse-code/sdk";

const client = await MuseClient.spawn({
  museBin: "muse",
  args: ["serve"],
  clientInfo: { name: "my-app", version: "1.0.0" },
});

const session = await client.startSession({ workspaceRoot: process.cwd() });

const turn = await session.sendUserTurn({
  input: [{ type: "text", text: "Summarize this repository." }],
});
for await (const item of turn.items()) console.log(item);
await turn.completed;

await client.close();

turn.items() replays what the session already holds before its live tail; turn.deltas() is live-only. turn.completed settles on every exit, so an awaited turn can never hang on a session that ended without an answer.

To approve tool use programmatically, register a handler on the session; approval choices are server-minted, and a decision the request never offered is refused and reported rather than sent:

session.onApproval(async (request) => ({
  choiceId: request.availableChoices[0].choiceId,
}));

Status: developer preview. The facade — spawn, session open/resume, turns, approvals, and recovery after dropped deliveries — is complete and covered by the conformance suites in the source repository.

Documentation