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

@loop-engine/loop-status-client

v0.1.0

Published

OSS client for the Boss Loops Cloud loop-status API: subscribe (SSE) + cursor pull/replay over OSS LoopEvent types.

Readme

@loop-engine/loop-status-client

OSS client for the Boss Loops Cloud loop-status API — subscribe to a live stream of loop-state transitions (SSE) and pull/replay them from a cursor, all over the OSS @loop-engine/events LoopEvent types.

Boss Loops OSS is distributed as the @loop-engine/* packages; this is the distribution-level client for the hosted loop-status surface (BL-BRAND-01).

It contains no proprietary logic: it is an HTTP/SSE client over a Cloud API with public event types, so any consumer (first- or third-party) can subscribe to loop status. The Cloud API itself is the proprietary surface.

Design

  • Pull is the backbone, stream is convenience. pullTransitions is the durable, cursor-ordered read; streamLoopState is a best-effort live push of the same events. A consumer resumes from its last cursor and never misses a transition — "degradation is time, not data".
  • Auth is supplied, never minted. You pass getToken(); the client sends it as a Bearer token. Token issuance is platform-only (PLAT-AUTH-01) — this client has no knowledge of signing or org claims, by design.

Usage

import { createLoopStatusClient, cursorOf } from "@loop-engine/loop-status-client";

const client = createLoopStatusClient({
  baseUrl: "https://cloud.bossloops.example",
  getToken: async () => fetchServiceToken(), // your PLAT-AUTH-01 token source
});

// Durable catch-up from a stored cursor.
let cursor: string | null = loadCursor();
let page = await client.pullTransitions({ organizationId, since: cursor, limit: 200 });
for (const event of page.events) handle(event);
cursor = page.nextCursor;
while (page.hasMore) {
  page = await client.pullTransitions({ organizationId, since: cursor });
  for (const event of page.events) handle(event);
  cursor = page.nextCursor;
}

// Live stream, resuming from the same cursor.
const controller = new AbortController();
await client.streamLoopState({
  organizationId,
  since: cursor,
  signal: controller.signal,
  onEvent: (event) => {
    handle(event);
    cursor = cursorOf(event) ?? cursor; // persist for resume
  },
  onResyncRequired: async (nextCursor) => {
    // history exceeded one catch-up page — drain via pull, then the stream continues live
    cursor = nextCursor;
  },
});

API

  • createLoopStatusClient(options){ pullTransitions, streamLoopState }
  • pullTransitions({ organizationId, since?, limit?, signal? }){ events, nextCursor, hasMore }
  • streamLoopState({ organizationId, since?, signal?, onEvent, onPing?, onResyncRequired?, onError? })
  • cursorOf(event) → the resume cursor for a LoopEvent
  • LoopStatusError — thrown on non-2xx, carries status

Build / test

  • pnpm build — tsup (esm + cjs + dts)
  • pnpm test — vitest (mocked fetch; no network)