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/telemetry

v1.1.0

Published

Internal component of Sutra SDK — applications should install sutra-sdk. Cognitive friction telemetry: interaction observation folded into durable, protocol-level friction samples. Shared by edge and cloud hosts.

Readme

@moolam/telemetry

Cognitive friction sensing. The collector folds raw interaction events (prompt rendered, input, deletions, assistance requests, submission) into one FrictionSample per task: hesitation latency, input velocity, revision churn, assistance count, outcome. Friction is the platform's leading evidence signal (correctness is lagging); these samples drive mastery posteriors and task routing.

Shared by design: the edge host records friction on-device, and cloud components consume the same sample shape. Raw keystroke content never leaves the device; samples carry behavioral metadata only.

Field pilot: device matrix, offline bundle, consent record shape, write-ahead / markSynced, and sovereignty checklist — docs/pilot/FIELD-PILOT-KIT.md (§5).

Turn trajectories: captured fields, forbidden content, consent and subject-isolation procedure, and worked valid/rejected JSON — docs/TRAJECTORY-METADATA-POLICY.md.

Training export: explicit consent-gated CLI, schema validation, failure playbook, locality controls, and external LoRA handoff — docs/sdk/training-export-runbook.md.

Architecture

  • src/collector.ts: CognitiveTelemetryCollector with a write-ahead SQLite insert before acknowledgment (a killed app never loses an acknowledged sample; a half-observed task is discarded by design, since partial evidence poisons the posterior).
  • Persistence goes through the StorageDriver contract, so any SQLite binding (expo-sqlite, better-sqlite3, wa-sqlite) or in-memory driver works.
  • Sync seam: unsynced() lists rows with synced = 0; after a successful cloud compaction, markSynced(capturedAt[]) flips those rows — idempotent on replay.
  • Spec: PRD CAST-01 and CAST-02.

Consent gate (field pilot)

Operators must hold a per-subjectId×deviceId consent record (field-pilot.consent.v1) before persist/sync. Forbidden scopes for this pilot: rawKeystrokeExport, utteranceExport, trajectoryExport. See the kit §5 worked JSON example.

| Leaves device (only if frictionSampleSync) | Stays sovereign | |-----------------------------------------------|-----------------| | FrictionSample metadata columns | Keystrokes, utterance text, consent vault, half-open exercises |

Public API

CognitiveTelemetryCollector, InteractionEvent, FrictionSample and supporting types, exported from src/index.ts.

Notable methods: initialize, observe / submitted (write-ahead), unsynced, markSynced, durableSampleCount, castIntegrityProbe (bounded aggregates — no unbounded SELECT *).

Quick start

import { CognitiveTelemetryCollector } from "@moolam/telemetry";

const telemetry = new CognitiveTelemetryCollector(storageDriver, hlcClock);
await telemetry.initialize();

telemetry.observe({ type: "prompt-rendered", conceptId: "math.fractions", atMs: Date.now() });
telemetry.observe({ type: "input", atMs: Date.now(), charsDelta: 12 });
telemetry.observe({ type: "submitted", atMs: Date.now(), outcome: "correct" });
// `submitted` finalizes the FrictionSample and persists it write-ahead

const pending = await telemetry.unsynced();
await telemetry.markSynced(pending.map((s) => s.capturedAt));

Contributing notes

  • Sample semantics are protocol surface: changing what a field means requires the same change in the cloud's interpretation and a PRD update.
  • Privacy invariant: no raw content in samples, ever. New fields must be behavioral metadata.
  • Concurrent collectors for the same subjectId must not share mutable accumulators across devices.

Examples

examples/offline-edge/ shows friction capture inside a full offline turn.

Tests

pnpm --filter @moolam/telemetry test