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

@agentic-research/observer-core

v0.1.0

Published

Portable provider-observer contracts with validated facts and explicit cursor handoff.

Readme

@agentic-research/observer-core

Portable, host-neutral contracts for turning provider records into validated observation drafts.

An observer owns provider-facing work such as pagination, rate-limit handling, response validation, and normalization. It returns facts plus its proposed next cursor. The host owns credentials, persistence, cursor commits, scheduling, delivery, and downstream projections.

That separation lets the same observer run directly in Canonical Hours today, inside a Cloister workerd bundle later, or behind another host without changing its provider logic.

Install

pnpm add @agentic-research/observer-core

Within this repository, pnpm resolves the package from packages/observer through the workspace protocol.

Define an observer

import { z } from "zod";
import {
  ObservationPipeline,
  type Extractor,
  type Transformer,
} from "@agentic-research/observer-core";

interface Config {
  repo: string;
}

interface ReviewRecord {
  id: string;
  createdAtMs: number;
  state: unknown;
}

const extractor: Extractor<Config, ReviewRecord> = {
  name: "github",
  async extract({ config, cursor, signal }) {
    const page = await fetchReviews(config.repo, { cursor, signal });
    return {
      records: page.reviews,
      nextCursor: page.nextCursor,
    };
  },
};

const transformer: Transformer<ReviewRecord, {
  state: "approved" | "changes_requested";
}> = {
  payloadSchema: z.object({
    state: z.enum(["approved", "changes_requested"]),
  }),
  transform(review) {
    return {
      subject: "pr:agentic-research/canonical-hours#186",
      kind: "github.pull_request.review",
      eventTimeMs: review.createdAtMs,
      providerEventId: review.id,
      payload: { state: review.state },
    };
  },
};

const observer = new ObservationPipeline(extractor, transformer);
const batch = await observer.observe({
  config: { repo: "agentic-research/canonical-hours" },
  cursor: "page:1",
});

batch.observations contains schema-validated drafts. batch.nextCursor is only a proposal: the host must not commit it until the corresponding observations are durable.

Returning null from transform() intentionally filters a provider record. Malformed observation metadata or payloads throw ObservationValidationError; they are never logged-and-discarded silently.

Observation identity and provenance

Every draft carries:

| Field | Meaning | | --- | --- | | subject | Canonical identity of the observed resource | | kind | Versionable fact vocabulary, such as github.pull_request.review | | eventTimeMs | Provider event time as a safe integer in Unix milliseconds | | providerEventId | Stable provider-side event identity used for deduplication and provenance | | payload | Provider-independent fact payload validated by the transformer schema |

The receiving host may add tenant, route, observer version, receipt, authentication, and content-hash fields when it accepts the draft. Those fields do not belong to the provider package.

Vespers and Cloister

The dependency direction is:

GitHub / Linear observer package
              ↓
         observer-core
          ↙          ↘
Canonical Hours      Cloister runtime
or Vespers adapter   and delivery

Vespers projects drafts into its own lifecycle Observation vocabulary; it does not redefine the provider protocol. Cloister can consume this package from the pnpm workspace now and can become the source repository later without changing the npm package name or reversing the dependency direction.

Cap'n Proto schema

src/observation.capnp ships with the npm package as the cross-runtime type description for ObservationDraft and ObservationBatch. TypeScript callers use the interfaces exported from this package; future Rust or Go consumers can generate native types from the same schema.

Verification

From the repository root:

task observer:check

This runs TypeScript compilation, unit tests, a published-entrypoint smoke test, and a live Miniflare/workerd portability test. Release and CI workflows call the same Taskfile surfaces. The package owns those tasks in this directory's Taskfile.yml; the repository root imports it under the observer: namespace.