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

@moolam/runtime

v1.1.0

Published

Internal component of Sutra SDK — applications should install sutra-sdk. Reference runtime: agent lifecycle host, in-process task scheduler, and event bus. Edge and cloud share the runtime contracts from @moolam/contracts; this package provides the portab

Downloads

433

Readme

@moolam/runtime

Reference in-process implementations of the runtime contracts: the execution environment seams an agent needs from whatever hosts it. Phones, servers, and test harnesses implement the same four contracts; this package provides the plain, dependency-free versions that serve tests, examples, and simple deployments.

Architecture

| File | Implements | Contract (from @moolam/contracts) | |---|---|---| | src/lifecycle.ts | RuntimeHost | LifecycleAware management with strict one-way transitions (suspend/resume excepted) | | src/scheduler.ts | InProcessScheduler | SchedulerInterface: deferred and periodic tasks over plain timers | | src/events.ts | InProcessEventBus, ValidatingEventBus | EventBusInterface: pub/sub for observations, never control flow |

Design philosophy lives in design/runtime.md; the decision record is ADR 0005.

Event catalog (implementors)

Typed EventBus domain events (turn.stage.*, sync.outcome, sync.advisory, tool.*, …) are defined in @moolam/observability with Zod schemas and committed JSON Schema under packages/sync-protocol/schemas/Event*.json.

Reference (trigger, payload, privacy, worked examples): ../observability/docs/event-catalog.md

Prefer createValidatingEventBus() from @moolam/observability so unknown types and learner-content keys are rejected at publish. Bare InProcessEventBus stays available for untyped test fixtures.

Public API

RuntimeHost, InProcessScheduler, InProcessEventBus, ValidatingEventBus, exported from src/index.ts.

Quick start

import { RuntimeHost, InProcessScheduler, InProcessEventBus } from "@moolam/runtime";
import { createValidatingEventBus } from "@moolam/observability";

const host = new RuntimeHost();
host.register(myComponent);          // anything LifecycleAware
await host.start();

const bus = createValidatingEventBus(); // or new InProcessEventBus() for untyped tests
bus.subscribe("sync.outcome", (e) => console.log(e.type, e.payload.outcome));

Contributing notes

  • The scheduler stays minimal: deferred and periodic, nothing else. Cron grammars and distributed queues belong in hosts.
  • No component may require that an event subscriber exists for correctness.
  • New runtime features must answer: does the loop need this on a phone, a server, and a test runner alike?
  • New EventBus domain types require a catalog schema + reference-doc update (see the event catalog link above) before publish is allowed.

Examples

The runtime tests double as the conformance reference for writing a new host (a worker, a desktop app, an embedded controller).

Tests

pnpm --filter @moolam/runtime test