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

@dxos/echo-panproto

v0.16.0

Published

Declarative, serializable ECHO <-> foreign-record lenses executed by panproto.

Readme

@dxos/echo-panproto

Declarative, serializable lenses between an ECHO object and a foreign (e.g. atproto) record, backed by panproto. A lens is data — the whole mapping is a Panproto.Lens value, not a hand-written codec.

import { Panproto } from '@dxos/echo-panproto';

// Register the ECHO-specific codecs a lens references by name (once, from the owning plugin).
Panproto.registerTextFormat('markdown-html', { encode: markdownToHtml, decode: htmlToMarkdown });
Panproto.registerRefType('text', { read: loadTextRef, make: makeTextRef });

const lens: Panproto.Lens = {
  adapters: [
    { kind: 'scalar', wire: 'title', echo: ['catalog', 'title'] },
    { kind: 'array', wire: 'authors', echo: ['catalog', 'authors'], separator: '\t' },
    { kind: 'prefix', wire: 'status', echo: ['status'], prefix: 'buzz.bookhive.defs#' },
    { kind: 'ref', wire: 'review', echo: ['review'], ref: { refType: 'text', format: 'markdown-html' } },
  ],
};

const record = await Panproto.encode(book, lens); // ECHO object -> wire record
const fields = await Panproto.decode(record, lens); // wire record -> ECHO-shaped fields

Two parts: engine (migration) + runner (adapters)

A Lens has two parts, run by Panproto.encode/decode:

  • migration — panproto (structural). Cross-lexicon vertex/edge alignment: field renames and nesting between two atproto lexicons, executed by the panproto engine (liftJson). This is what the wasm on the ./wasm entrypoint runs.
  • adapters — the runner (ECHO effects). The value-level and ECHO-specific work panproto's graph transform cannot express: Ref<Text> resolution, array↔string, object metadata (createdAt), scalar value coercions (knownValue prefix, date widen), and nested structs. Authored as data; executed host-side. Any structural move can shift between migration and adapters with no consumer change.

Entrypoint split

  • @dxos/echo-panproto — the durable Panproto API (the Lens schema, the encode/decode runner, registerTextFormat/registerRefType). Depends on @dxos/echo; the Lens schema itself is a side-effect-free leaf, so importing it does not load the engine.
  • @dxos/echo-panproto/wasm — the engine. Wraps upstream @panproto/core (which ships and loads its own wasm) and is loaded lazily by the runner, so the API surface never statically depends on it. This is the one swappable implementation detail.

panproto engine

The engine bridges to upstream @panproto/[email protected], whose high-level TypeScript API executes migrations at runtime: Panproto.init() → panproto.parseLexicon(lexicon) → panproto.migration(src, tgt).map().mapEdge().compile() → mig.liftJson(record, rootVertex). See the panproto book (https://panproto.dev/book) — verified against reference/sdk-typescript.html and the tutorials/. panproto's structural graph transforms are used for migration; scalar value transforms and ECHO effects are the runner's adapters (the shipped API exposes structural lens-DSL steps but no value-expression step).