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

@openplait/runtime

v0.1.0-alpha.0

Published

Application-neutral query planning and transformation runtime for OpenPlait.

Readme

@openplait/runtime

Application-neutral query planning, datasource resolution, execution, and normalized-frame transformations for OpenPlait.

The runtime validates queries, resolves named datasource instances, checks adapter capabilities, safely pushes a leading transformation prefix to the source, executes queries concurrently, applies runtime transforms, and returns client-deferred transforms with detailed execution metadata.

Multiple datasource instances

Applications own adapter construction and credentials. The registry contains only server-side instances; dashboards and queries refer to them by name and kind.

import { ClickHouseAdapter } from "@openplait/adapter-clickhouse";
import { DatasourceRegistry, OpenPlaitRuntime } from "@openplait/runtime";

const primaryConfig = {
  url: process.env.PRIMARY_CLICKHOUSE_URL!,
  username: process.env.PRIMARY_CLICKHOUSE_USER,
  password: process.env.PRIMARY_CLICKHOUSE_PASSWORD,
};
const archiveConfig = {
  url: process.env.ARCHIVE_CLICKHOUSE_URL!,
  username: process.env.ARCHIVE_CLICKHOUSE_USER,
  password: process.env.ARCHIVE_CLICKHOUSE_PASSWORD,
};

const datasources = new DatasourceRegistry()
  .register({
    name: "primary",
    kind: "ClickHouseDatasource",
    scope: "dashboard",
    config: primaryConfig,
    adapter: new ClickHouseAdapter(primaryConfig),
  })
  .register({
    name: "archive",
    kind: "ClickHouseDatasource",
    scope: "dashboard",
    config: archiveConfig,
    adapter: new ClickHouseAdapter(archiveConfig),
  });

const runtime = new OpenPlaitRuntime(datasources, {
  defaultTimeoutMs: 30_000,
  hooks: {
    onQueryStart: ({ original }) => logger.info({ query: original.metadata.name }),
  },
});

const response = await runtime.execute({
  queries,
  transformations,
  variables,
  audit: { requestId, actorId, tenantId },
  abortSignal: request.signal,
});

OpenLIT can build this registry from its datasource records. Nothing in the runtime depends on OpenLIT, React, a particular secret store, or a specific datasource kind.

Transformation placement

  • source: must be pushed down or planning fails.
  • runtime: always runs against normalized frames.
  • client: is returned in deferredTransformations for the consumer.
  • auto: pushes only when every selected adapter supports the operation and the rewrite preserves semantics.

The initial safe ClickHouse pushdown set is row filtering for direct-field queries, ordering, and limiting. Other transformations execute in the runtime.

Implemented transforms

FilterRows, SelectFields, RenameFields, CalculateField, Sort, Limit, GroupAndReduce, JoinFrames, MergeFrames, Pivot, Unpivot, ConvertUnit, FillMissing, WindowCalculation, LabelsToFields, and ExtractJsonProperty.

The optional cache is supplied by the host application. Lifecycle hooks expose plans, query start/completion, and errors without imposing an observability SDK.

Alert evaluation

AlertEvaluator executes an AlertRule through the same datasource registry and transformation runtime. It reduces the selected numeric field, evaluates the threshold, and persists lifecycle state through a host-provided AlertStateStore.

import { AlertEvaluator, InMemoryAlertStateStore } from "@openplait/runtime";

const alerts = new AlertEvaluator(runtime, {
  stateStore: new InMemoryAlertStateStore(), // Replace in production.
});

const evaluation = await alerts.evaluate(rule, {
  audit: { requestId, actorId, tenantId },
  abortSignal: request.signal,
});

for (const intent of evaluation.notifications) {
  await applicationNotificationService.deliver(intent);
}

OpenPlait emits notification intents only. The consuming application owns the durable store, scheduler, secrets, channel configuration, retries, and delivery.