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

@polycrest/document-service

v0.4.0

Published

Headless HTTP service hosting @polycrest/document-core — validate/apply/agent-context/queries. The source of truth for server-authoritative document editing. Zero runtime dependencies beyond document-core.

Readme

@polycrest/document-service

Headless HTTP host for @polycrest/document-core — the source of truth in server-authoritative document editing. A stateless shell over the engine: every request carries the document; the service never invents behavior, it only calls normalizeChangeSet / applyChangeSetToDocument / validateChangeSet / createAgentContext / getOutline / searchDocument.

Zero runtime dependencies beyond document-core (Node built-in http). Binds to 127.0.0.1 only — this is an in-machine engine host, not a web API.

Run

node dist/server.js --port 5211 [--automation]
# or via the bin: polycrest-document-service --port 5211
  • --port <n> (or PORT env) — default 5211.
  • --automation — deterministic seeded IDs. The seed starts at 1000 so service-minted IDs never collide with a browser-side seeded generator minting from 1 (the harness under ?automation=1).

A ready line is printed once listening: [document-service] ready on http://127.0.0.1:<port> engine=<version> automation=<bool>

Endpoints (all JSON)

| Route | Request | Response | | --- | --- | --- | | POST /apply | {document, changeSet} | {document, result, normalizedChangeSet} | | POST /validate | {document, changeSet} | {valid, conflicts} | | POST /agent-context | {document, request?} | AgentDocumentContext | | GET\|POST /outline | {document} | OutlineEntry[] | | GET\|POST /search | {document, query, roles?, limit?} (?q= also accepted) | SearchResult[] | | GET /health | — | {ok, engineVersion} |

Contract rules:

  • Normalize once (hard rule #5). /apply normalizes the change set exactly once and returns the normalized set so a mirror (the browser editor) replays the identical set without re-minting. The change-set id is minted server-side when omitted.
  • Conflicts are data, not HTTP errors. A rejected apply returns 200 with result.applied === false and typed DocumentConflict[]. HTTP 400 means the request itself was malformed; 500 an unexpected fault.
  • engineVersion is the resolved document-core version — consumers (the .NET DocumentServiceProcess launcher) pin against it and fail fast on mismatch.
  • Determinism. No wall-clock ever appears in responses; under --automation every response is reproducible for identical request sequences.

Consumers

  • dotnet/Polycrest.Document.ServiceClient — typed C# client + process launcher/supervisor (spawn via Node, /health poll, version pin).
  • dotnet/Polycrest.Document.Mcp — the MCP collaborative-editing host.