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

@tag-kit/core

v0.3.1

Published

Schema, catalog helpers, agreement scoring, and scope-overlap matching for human-in-the-loop tagging workflows. Domain-agnostic — bring your own taxonomy.

Readme

@tag-kit/core

Schema, catalog, scope-aware matching, and agreement scoring for tag-kit — structured tagging primitives for human-in-the-loop annotation.

Bring your own taxonomy. Bring your own UI. Bring your own scoring loop.

npm version License: MIT

Zero runtime dependencies. TypeScript strict, ESM-only, raw tsc output — no bundler.

Install

npm install @tag-kit/core
# or
pnpm add @tag-kit/core

What's in the box

  • SchemaTagScope, ReviewerTag, ExpectedTag, TagAgreement. Plain TypeScript interfaces, no validation library. Serialize them however you like.
  • CatalogdefineCatalog validates your vocabulary at startup (duplicate, empty, and malformed tagIds throw). findEntry, filterByModality, groupByCategory for the read paths.
  • MatchingtagsMatch / scopeOverlaps implement conservative scope overlap. Deliberately cautious; see the table below.
  • ScoringtagPrecisionRecall computes per-tag precision/recall/F1 across many entities. binaryAgreement is the lightweight variant when you've already bucketed by tag.

Usage

import { defineCatalog, tagPrecisionRecall, type ReviewerTag } from "@tag-kit/core";

// 1. Define your domain's vocabulary once, at startup.
const CATALOG = defineCatalog([
  {
    tagId: "audio.harassment",
    displayName: "Audio harassment",
    description: "Spoken harassment, slurs, or threats.",
    applicableModalities: ["audio", "video"],
    severity: "danger",
    group: "Audio",
    supportsSegmentScope: true,
    supportsSpanScope: false,
  },
]);

// 2. Annotators apply tags with optional per-modality / per-segment scope.
const predicted: ReviewerTag[] = [
  {
    tagId: "audio.harassment",
    scope: { modality: "audio", segment: { start: 12, end: 24 } },
    note: "harasser identifies the target by name",
  },
];

// 3. Score predictions against gold tags.
const agreement = tagPrecisionRecall([
  {
    entityId: "event-1",
    expected: [
      { tagId: "audio.harassment", scope: { modality: "audio", segment: { start: 10, end: 30 } } },
    ],
    predicted,
  },
]);
// → [{ tagId: "audio.harassment", precision: 1, recall: 1, f1: 1, samples: 1, ... }]

void CATALOG;
void agreement;

Matching rules

Two tags match when their tagIds are equal and their scopes overlap:

| Annotator A | Annotator B | Match? | | -------------------------- | ---------------------------- | ---------------------------- | | audio segment [10, 30] | audio segment [12, 24] | ✅ overlap | | audio segment [0, 10] | audio segment [100, 110] | ❌ disjoint | | audio whole-track | audio segment [12, 24] | ✅ broader contains narrower | | video whole-track | audio segment [12, 24] | ❌ different modality |

Ranges are half-open intervals [start, end) — touching is not overlapping. Different modality or assetId never match. Each expected tag is consumed at most once, so one prediction can't satisfy two gold tags.

Scoring notes

  • Results are sorted alphabetically by tagId so dashboards render consistently across runs.
  • NaN is replaced with 0 throughout, so the wire shape serializes cleanly.
  • An optional strategy argument swaps in alternative matching rules; omit it and output is byte-for-byte identical to pre-strategy releases.

Domain portability

modality is a free string, and segment.start / segment.end semantics (seconds, frames, samples, character offsets) are defined by you. The same primitives cover content moderation, medical chart annotation, legal document review, ML training-data labeling, and code review.

Status

v0.3.1 — API stable for the 0.3.x line; pre-1.0 overall. tagId is a stable foreign key: once shipped in a catalog it should never be renamed.

Links

License

MIT