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

@sajalmishra/markpin-shared

v0.0.3

Published

Shared TypeScript types for the Markpin annotation system

Readme

@sajalmishra/markpin-shared

Shared TypeScript types and utilities for the Markpin visual feedback tool.

What is this

This is the internal types package used by both @sajalmishra/markpin (the React toolbar) and @sajalmishra/markpin-mcp (the MCP server). It contains the full AFS (Annotation Format Schema) — the TypeScript type definitions that describe how annotations, sessions, and events are structured across the entire Markpin system.

When to use this directly

Most users do not need to install this package. It is bundled into @sajalmishra/markpin and @sajalmishra/markpin-mcp at build time, so both packages are self-contained.

Install this directly only if you are building a custom integration with the Markpin REST API or SSE stream and need the TypeScript types in your own code — for example, a custom dashboard that reads annotations, or a server-side script that POSTs annotations programmatically.

Install

npm install @sajalmishra/markpin-shared
# or
pnpm add @sajalmishra/markpin-shared

What is included

Core annotation types

| Type | Description | |------|-------------| | Annotation | The complete annotation object — all AFS fields combined | | AnnotationTarget | Element selector, bounding box, URL, and viewport info | | AnnotationMetadata | Arbitrary key/value pairs attached to an annotation |

Session types

| Type | Description | |------|-------------| | Session | A browser session containing an array of annotations |

Event types

| Type | Description | |------|-------------| | AFSEvent | Union type of all possible SSE events | | AFSEventType | Enum of all event type strings (e.g. annotation.created) |

Enums

| Enum | Values | |------|--------| | AnnotationStatus | open · in_progress · resolved · dismissed · wont_fix | | AnnotationIntent | bug · improvement · question · praise · task · note | | AnnotationSeverity | critical · high · medium · low · info | | AnnotationKind | element · region · page · freeform · placement · rearrange | | SessionStatus | active · paused · ended | | OutputFormat | json · markdown · xml |

Toolbar types

| Type | Description | |------|-------------| | ToolbarSettings | Theme, position, server URL, and default intent/severity | | ToolbarState | Current session ID, annotation list, capture mode, and error state |

Usage example

import type { Annotation } from '@sajalmishra/markpin-shared';
import { AnnotationStatus, AnnotationIntent } from '@sajalmishra/markpin-shared';

// Type a function that processes incoming annotations
function handleAnnotation(ann: Annotation): void {
  if (ann.intent === AnnotationIntent.Bug && ann.status === AnnotationStatus.Open) {
    console.log(`Bug at ${ann.target.selector}: ${ann.comment}`);
  }
}

// Type-safe status check
function isPending(ann: Annotation): boolean {
  return ann.status === AnnotationStatus.Open || ann.status === AnnotationStatus.InProgress;
}

Links

License

MIT