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

osmp-protocol

v2.8.0

Published

OSMP — Octid Semantic Mesh Protocol. Agentic AI instruction encoding for any channel.

Readme

OSMP TypeScript SDK

TypeScript implementation of the Octid Semantic Mesh Protocol. Encodes, decodes, and validates agentic AI instructions using SAL (Semantic Assembly Language). 356 opcodes across 26 namespaces (v15.1). Deterministic decode to structured instructions. No inference. Pure JS D:PACK/BLK via fzstd (82KB, zero native deps).

Install

npm install osmp-protocol

Tier 1: Top-Level Functions, Zero Setup

import { encode, decode } from "osmp-protocol";

const sal = encode(["H:HR@NODE1>120", "H:CASREP", "M:EVA@*"]);
// "H:HR@NODE1>120;H:CASREP;M:EVA@*"

const text = decode("H:HR@NODE1>120;H:CASREP;M:EVA@*");
// "H:heart_rate →NODE1 >120; H:casualty_report; M:evacuation →*"

No constructors. Lazy singleton initialized on first import.

Additional Tier 1 Functions

import { validate, lookup, byteSize } from "osmp-protocol";

const result = validate("R:MOV@BOT1⚠");
console.log(result.valid);   // false -- ⚠ requires I:§ precondition

const definition = lookup("R:WPT");
// "waypoint"

console.log(byteSize("H:HR@NODE1>120"));
// 15

Tier 2: Class-Based Interface

For explicit ASD control, custom dependency rules, or concurrent instances:

import { AdaptiveSharedDictionary, OSMPEncoder, OSMPDecoder } from "osmp-protocol";

const asd = new AdaptiveSharedDictionary();
const enc = new OSMPEncoder(asd);
const dec = new OSMPDecoder(asd);

const sal = enc.encodeSequence(["H:HR@NODE1>120", "H:CASREP"]);
const result = dec.decodeFrame("H:HR@NODE1>120");
// result.namespace = "H"
// result.opcode = "HR"
// result.opcodeMeaning = "heart_rate"
// result.target = "NODE1"

Composition Validation

Eight deterministic rules enforced before any instruction hits the wire:

  1. Hallucination check -- every opcode must exist in the ASD
  2. Namespace-as-target -- @ must not be followed by NS:OPCODE
  3. R namespace consequence class -- mandatory except R:ESTOP
  4. I:§ precondition -- ⚠ and ⊘ require I:§ in the chain
  5. Byte check -- SAL bytes must not exceed NL bytes (exception: R safety chains)
  6. Slash rejection -- / is not a SAL operator
  7. Mixed-mode check -- no natural language embedded in SAL frames
  8. Regulatory dependency -- REQUIRES rules from loaded MDR corpora

Domain Code Resolution

import { resolveBlk } from "osmp-protocol";

const result = resolveBlk("mdr/icd10cm/MDR-ICD10CM-FY2026-blk.dpack", "J93.0");
// "Spontaneous tension pneumothorax"

Three corpora bundled: ICD-10-CM (74,719 codes), ISO 20022 (47,835 codes), MITRE ATT&CK (1,661 codes).

EML — Universal Binary Operator Evaluator

A companion math-evaluation module. Based on Odrzywołek (2026, arXiv:2603.21852): a single binary operator eml(x, y) = exp(x) − ln(y), together with the constant 1, generates the standard calculator function basis — exp, ln, sin, cos, sqrt, arithmetic, and more — as compact expression trees.

Byte-exact evaluation across Python, TypeScript, Go, and Rust on every IEEE-754-conformant platform. Full sin(x) or sqrt(x) approximation fits in fewer than 100 bytes on the wire.

import { eml, leaf, varX, branch, evaluateTree } from "osmp-protocol/eml";

// The operator itself
eml(2.0, 1.0);  // exp(2) - ln(1) = 7.389056...

// Build an expression tree: exp(x) = eml(x, 1)
const tree = branch(varX(), leaf(1.0));
evaluateTree(tree, 2.0);  // 7.389056...

Pre-Built Corpus

Sixteen single-variable base functions and four multi-variable arithmetic compounds ship pre-verified:

import {
  getBaseChain, evaluateChain,
  compoundXPlusY, compoundXTimesY, compoundLinearCalibration,
} from "osmp-protocol/eml";

// Base corpus (single variable x)
const chain = getBaseChain("ln(x)");
evaluateChain(chain, [Math.E]);        // 1.0
evaluateChain(chain, [Math.E ** 2]);   // 2.0

// Arithmetic compounds (multi-variable)
evaluateChain(compoundXPlusY(), [2.0, 3.0]);                // 5.0
evaluateChain(compoundXTimesY(), [2.0, 3.0]);               // 6.0
evaluateChain(compoundLinearCalibration(), [2.0, 3.0, 1.0]);// 7.0

Available base names: exp(x), ln(x), identity, zero, exp(x)-ln(x), exp(x)-x, e-x, exp(exp(x)), e-exp(x), 1-ln(x), e/x, exp(x)-1, exp(x)-e, e^e/x, ln(ln(x)), exp(exp(exp(x))).

Wire Format

Three wire encodings ship:

import { encodeTree, decodeTree, encodeChainRestricted, decodeChainRestricted } from "osmp-protocol/eml";

// Paper tree form: pre-order tagged traversal, 4-byte float32 or 8-byte float64 leaves
const tree = getBaseChain("ln(x)");  // Or build manually via branch()/leaf()/varX()
const wireBytes = encodeTree(tree);   // Uint8Array
const decoded = decodeTree(wireBytes);
evaluateTree(decoded, Math.E);        // 1.0

// Restricted chain form (bit-packed, single variable)
const chain = getBaseChain("ln(x)");
const chainBytes = encodeChainRestricted(chain, true);  // self-describing
const decodedChain = decodeChainRestricted(chainBytes, { selfDescribing: true, variableName: "x" });
evaluateChain(decodedChain, [Math.E]);  // 1.0

A wide multi-variable form (encodeChainWide / decodeChainWide) handles compounds with up to 15 variables and 15 levels in a single-byte header.

Cross-Device Determinism

import { corpusFingerprint } from "osmp-protocol/eml";

corpusFingerprint();
// "e9a4a71383f14624472fe0602ca5e0ff1959e00b09725a62d584e1361f842c1b"

Identical fingerprint across Python, TypeScript, Go, and Rust on every IEEE-754-conformant platform.

Precision Modes

Two modes toggled via setPrecisionMode:

  • "fast" (default) — fdlibm-derived, 1-ULP accurate, ships publicly.
  • "precision" — crlibm-derived, correctly-rounded, audit-grade. For regulated industries (medical IEC 62304, aerospace DO-178C, nuclear IEC 61513), audit-grade finance, and cryptographic protocol-frame hash inputs. Available under commercial license — contact [email protected].
import { setPrecisionMode, precisionModeAvailable, PrecisionModeNotAvailableError } from "osmp-protocol/eml";

precisionModeAvailable();  // false in public release

try {
  setPrecisionMode("precision");
} catch (e) {
  if (e instanceof PrecisionModeNotAvailableError) {
    console.log(e.message);
    // "Precision mode requires the commercial precision pack.
    //  Contact [email protected]."
  }
}

Build

cd sdk/typescript
npm install
npm run build

License

Apache 2.0.

SALBridge: Mixed Environment Integration

import { SALBridge } from "osmp-protocol";

const b = new SALBridge("MY_NODE");
b.registerPeer("GPT_AGENT", false);

// Outbound: SAL decoded to annotated NL
const out = b.send("H:HR@NODE1>120", "GPT_AGENT");

// Inbound: scanned for SAL acquisition
const result = b.receive("A:ACK", "GPT_AGENT");

// Metrics
const metrics = b.getMetrics("GPT_AGENT");