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

@nibblelayer/apex-control-plane-core

v0.1.0

Published

Public Apex manifest construction helpers for control-plane consumers.

Readme

@nibblelayer/apex-control-plane-core

Manifest builder and checksum utilities for the Apex control plane.

Purpose

Provides public helpers for building, versioning, and diffing x402-compatible manifests. Used by the API manifest routes, the dashboard manifest preview, and external CI tools that need to validate or construct manifests.

Install

pnpm add @nibblelayer/apex-control-plane-core

Quick Start

import { buildManifest, computeChecksum, hasManifestChanged } from '@nibblelayer/apex-control-plane-core';
import type { ManifestInput } from '@nibblelayer/apex-control-plane-core';

const input: ManifestInput = {
  serviceId: 'svc_abc123',
  environment: { mode: 'test', network: 'eip155:1', facilitatorUrl: 'https://facilitator.example.com' },
  wallet: { address: '0x...', token: '0x...', network: 'eip155:1' },
  routes: [{
    route: { method: 'GET', path: '/api/weather', description: 'Weather data', enabled: true },
    priceRules: [{ scheme: 'exact', amount: '1000', token: '0x...', network: 'eip155:1', active: true }],
    discovery: null,
  }],
  eventsEndpoint: '/events',
  idempotencyEnabled: true,
  refreshIntervalMs: 60000,
  currentVersion: 0,
};

const manifest = buildManifest(input);
// => { serviceId, environment: 'test', version: 1, routes: {...}, checksum: '...', ... }

const checksum = computeChecksum(manifest);
const changed = hasManifestChanged(manifest, previousChecksum);

API Reference

ManifestInput

Input structure consumed by the manifest builder.

interface ManifestInput {
  serviceId: string;
  environment: {
    mode: 'test' | 'prod';
    network: string;
    facilitatorUrl: string;
  };
  wallet: {
    address: string;
    token: string;
    network: string;
  };
  routes: Array<{
    route: {
      method: HttpMethod;
      path: string;
      description?: string;
      enabled: boolean;
    };
    priceRules: Array<{
      scheme: PaymentScheme;
      amount: string;
      token: string;
      network: string;
      active: boolean;
    }>;
    discovery: {
      discoverable: boolean;
      category?: string;
      tags?: string[];
      inputSchema?: Record<string, unknown>;
      outputSchema?: Record<string, unknown>;
      published: boolean;
    } | null;
  }>;
  eventsEndpoint: string;
  idempotencyEnabled: boolean;
  refreshIntervalMs: number;
  currentVersion: number;
}

buildManifest(input: ManifestInput): ApexManifest

Builds a complete, validated manifest from database-level input.

Behavior:

  • Filters out routes where route.enabled is false.
  • Filters out price rules where active is false.
  • Constructs route keys as "METHOD /path" (e.g. "GET /api/weather").
  • Builds the accepts array from active price rules for each route.
  • Adds a payment-identifier extension to route extensions when idempotencyEnabled is true.
  • Adds a bazaar extension when discovery is discoverable and published.
  • Increments the manifest version from currentVersion.
  • Computes an SHA256 checksum of the canonical JSON (sorted keys) and attaches it to the manifest.

Parameters:

| Parameter | Type | Description | |---|---|---| | input | ManifestInput | Database-level configuration for the service |

Returns: ApexManifest — a complete manifest ready for distribution to SDK consumers.

computeChecksum(payload: unknown): string

Computes an SHA256 hash of the canonical JSON representation of payload. Keys are sorted deterministically before hashing.

Parameters:

| Parameter | Type | Description | |---|---|---| | payload | unknown | Any JSON-serializable value |

Returns: string — hex-encoded SHA256 checksum.

hasManifestChanged(payload: unknown, previousChecksum: string): boolean

Compares the current checksum of payload against a previously stored checksum.

Parameters:

| Parameter | Type | Description | |---|---|---| | payload | unknown | Any JSON-serializable value | | previousChecksum | string | Previously stored hex-encoded checksum |

Returns: booleantrue if the checksum differs, indicating the payload has changed.

Manifest Structure

The output of buildManifest is an ApexManifest object containing:

  • serviceId — Identifies the service this manifest belongs to.
  • environment — The target environment mode ('test' or 'prod').
  • version — Monotonically increasing integer, incremented on each build.
  • routes — Map of route keys ("METHOD /path") to route definitions, each containing:
    • accepts — Array of accepted payment configurations built from active price rules.
    • extensions — Optional extensions (payment-identifier, bazaar).
  • wallet — Wallet configuration for payment settlement.
  • eventsEndpoint — Endpoint for payment event delivery.
  • refreshIntervalMs — Suggested refresh interval for SDK consumers.
  • checksum — SHA256 hash of the entire canonical manifest JSON.

Dependencies

  • @nibblelayer/apex-contracts — types and schemas

License

Apache-2.0