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

@mrsf/monaco-mrsf

v0.4.8

Published

Monaco editor plugin for rendering and editing Sidemark/MRSF (Markdown Review Sidecar Format) review comments

Readme

@mrsf/monaco-mrsf

Monaco editor integration for Sidemark/MRSF review comments.

Current scope:

  • public type contracts for host integrations
  • editor-agnostic anchor and selection mapping helpers
  • live line tracking for in-memory anchor updates during editing
  • neutral thread and decoration projection over MRSF sidecars
  • Monaco decoration mapping and editor adapter for applying gutter and inline annotations
  • review store and plugin controller for loading, mutating, saving, and reanchoring sidecars through a host adapter
  • memory-host helpers for browser demos and in-memory host integrations
  • hover summaries and editor action registration for add, reply, resolve, and reanchor workflows
  • multi-thread overlay controls with per-line thread switching and add-thread actions
  • explicit save hooks for host applications via onSaveRequest
  • shared-style gutter renderer hooks for badge and add-button overrides via threadOverlay.gutterRenderers

The package is intended to work in both browser and desktop hosts by taking host-provided document and sidecar I/O adapters.

A full runnable browser example lives in examples/monaco-demo.

Example

import * as monaco from "monaco-editor";
import {
	MemoryHostAdapter,
	MemoryHostSession,
	MonacoMrsfPlugin,
} from "@mrsf/monaco-mrsf";

const resourceId = "file:///docs/guide.md";

const editor = monaco.editor.create(container, {
	value: "# Guide\n\nHello world\n",
	language: "markdown",
	glyphMargin: true,
});

const model = editor.getModel();
if (model) {
	monaco.editor.setModelLanguage(model, "markdown");
}

const host = new MemoryHostAdapter({
	resources: {
		[resourceId]: {
			documentText: "# Guide\n\nHello world\n",
			documentPath: "/docs/guide.md",
			sidecarPath: "/docs/guide.md.review.yaml",
			sidecar: {
				mrsf_version: "1.0",
				document: "/docs/guide.md",
				comments: [],
			},
		},
	},
});

const session = new MemoryHostSession(host, resourceId);

const plugin = new MonacoMrsfPlugin(editor, host, {
	monacoApi: monaco,
	watchHostChanges: false,
	threadOverlay: {
		threadFilters: false,
		gutterRenderers: {
			badge: ({ mark, defaultPresentation }) => ({
				label: `🗨 ${defaultPresentation.countText}`,
				icon: "🗨",
				countText: defaultPresentation.countText,
				title: `${mark.threadCount} threads, ${mark.commentCount} comments`,
			}),
		},
	},
	onStateChange: ({ state }) => {
		void session.replaceSidecar(structuredClone(state.document));
	},
	onSaveRequest: async ({ defaultSave }) => {
		await defaultSave();
		console.log("Saved through host hook");
	},
	actionHandlers: {
		createCommentDraft(context) {
			return {
				text: `Comment on line ${context.line}`,
				author: "Demo User",
			};
		},
		createReplyDraft() {
			return {
				text: "Reply from demo",
				author: "Demo User",
			};
		},
	},
});

await plugin.loadCurrent();
await plugin.save({ reason: "toolbar" });

For real browser apps, replace MemoryHostAdapter with a host adapter that reads and writes sidecars through your backend or workspace service.

threadOverlay.gutterRenderers follows the same shared gutter presentation contract used by the HTML-based plugins, so badge labels, count capping, and add-button overrides can stay consistent across hosts.