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

@agent-play/geography-mesh

v0.1.1

Published

AOI peer-mesh schemas, neighbor selection, and Yjs pose helpers for Agent Play world geography.

Readme

@agent-play/geography-mesh

Shared constants, Zod wire schemas, AOI neighbor selection, and Yjs pose helpers for Agent Play world geography — the peer-mesh presence layer for humans on the overworld.

This package is the reusable core used by @agent-play/play-ui and the web host. It does not open WebRTC sockets itself; clients and hosts compose transport on top of these helpers.

Full design lock: Yjs world geography multiplayer.
Integrator guide: Geography mesh docs.

Install

npm install @agent-play/geography-mesh

Peer runtime deps are declared normally (yjs, zod, lib0, y-protocols).

What it provides

| Export area | Purpose | |-------------|---------| | Constants | Cap 100 members / sid, mesh degree ≤16, pose Hz caps, SSE event names | | Schemas | Zod parsers for membership, coarse pose, neighbors, and WebRTC signal bodies | | selectAoiNeighbors | Pick ≤16 nearby peers with stage preference + hysteresis | | shouldPublishPose | Throttle pose fanout (distance / facing / moving / Hz) | | Yjs helpers | Read/write/remove poses on a shared Y.Doc geography map |

Quick start

import * as Y from "yjs";
import {
  GEOGRAPHY_MEMBER_CAP,
  GEOGRAPHY_MESH_DEGREE_MAX,
  applyPoseToGeographyMap,
  readPoseFromGeographyMap,
  selectAoiNeighbors,
  shouldPublishPose,
  GeographyPoseSchema,
} from "@agent-play/geography-mesh";

const doc = new Y.Doc();
const pose = GeographyPoseSchema.parse({
  id: "human-a",
  name: "Ada",
  x: 12.5,
  y: 8.0,
  facing: "right",
  isMoving: true,
});

applyPoseToGeographyMap(doc, pose);
const local = readPoseFromGeographyMap(doc, "human-a");

const neighbors = selectAoiNeighbors({
  selfId: "human-a",
  selfPos: { x: pose.x, y: pose.y },
  selfStage: "overworld",
  members: [
    { humanId: "human-a", x: pose.x, y: pose.y, stage: "overworld" },
    { humanId: "human-b", x: 13, y: 8.2, stage: "overworld" },
  ],
  degreeMax: GEOGRAPHY_MESH_DEGREE_MAX,
  nowMs: Date.now(),
});

const decision = shouldPublishPose({
  previous: null,
  next: pose,
  nowMs: Date.now(),
  lastPublishMs: null,
});

console.log({
  cap: GEOGRAPHY_MEMBER_CAP,
  neighborIds: neighbors.neighborIds,
  shouldPublish: decision.shouldPublish,
  local,
});

Host vs client roles

| Layer | Responsibility | |-------|----------------| | This package | Pure selection, schemas, Yjs map mutations | | Host (web-ui) | Membership join/leave (cap 100), coarse AOI hints, SDP/ICE signal relay over HTTP/SSE | | Client (play-ui) | GeographyMeshSession: WebRTC data channels to ≤16 AOI neighbors, apply Yjs updates, render remote pawns |

Pose bytes stay on the peer mesh. The host does not relay continuous pose streams.

Publish

Included in the monorepo publish chain (before @agent-play/play-ui):

npm run publish:packages -- --packages geography-mesh

See npm & CI.