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

@jxsuite/protocol

v0.4.0

Published

The Studio Backend Protocol — wire types and the canonical route table every Jx Studio backend implements

Readme

@jxsuite/protocol

The Studio Backend Protocol: the wire types and canonical route table that every Jx Studio backend implements. Jx Studio is backend-agnostic — the editor talks to whatever registered a StudioPlatform adapter (see @jxsuite/studio/platform), and every adapter ultimately speaks the contract defined here. This package is the single source of truth for that contract:

  • @jxsuite/protocol/types — the request/response shapes (DirEntry, GitStatusResult, StarterInfo, AiModelsResponse, CfConnection, …). Environment-agnostic: no DOM, no node — importable in browsers, Bun, and Cloudflare Workers alike.
  • @jxsuite/protocol/routesSTUDIO_ROUTES, the canonical endpoint table with methods, one-line contract summaries, and per-route optionality.

Who implements this

| Backend | Transport | | ------------------------------- | --------------------------------------------------------------------------------------------------------- | | @jxsuite/server (dev server) | The literal /__studio/* HTTP routes — the reference implementation | | Desktop (Electrobun / Chromium) | Typed RPC / WebSocket JSON-RPC dispatching into the same handlers | | Cloud platforms | HTTP behind a session gateway (e.g. /api/v1/p/:owner/:repo/:branch/studio/*), same sub-paths and shapes |

A backend is free to change the transport and path prefix; the sub-path, method, and body shapes are the contract. STUDIO_PROTOCOL_VERSION bumps when any shape changes incompatibly.

Core vs optional

Optional routes back optional StudioPlatform members. Omitting one is not an error — Studio degrades exactly as each entry's degradation describes (the starter picker empties, the Projects catalogue hides, the Publish panel explains git-push publishing, and so on). coreRouteNames() / optionalRouteNames() split the table programmatically; a conformance test for a new backend can iterate STUDIO_ROUTES and assert every core route is served.

Highlights an implementer should know:

  • git/commit commits the staged files if any are staged, otherwise all dirty files. Cloud backends may make commit+push atomic and treat git/push as a sync check (ahead stays 0).
  • git/pull returns 409 { code: "pull_conflict", conflicts: [paths] } when local dirty files overlap remote changes.
  • format dispatches { format, action: "parse" | "serialize", source? | doc?, options? } through the project's format registry; without it only .json documents open.
  • ai/chat accepts { messages, tools, systemPrompt, model } and streams the normalized StreamEvent SSE defined by @jxsuite/ai/streaming-client. ai/models returns AiModelsResponse; report configured: true when the backend holds credentials (Studio then unlocks the assistant without a locally stored key) and managed: true when the platform brokers them.
  • cf/proxy is an allowlisted Cloudflare API passthrough (accounts and Pages projects/deployments only). Credentials are injected by the backend — a header-borne user token on the dev server, a vaulted OAuth token on cloud platforms — and must never be persisted by stateless implementations.
  • Errors are { error, code?, detail? } (ErrorBody) with a meaningful HTTP status; code is the machine-readable discriminator Studio switches on (e.g. remote_moved, cf_not_connected, needs_installation_access).

Versioning

The types are published as TypeScript source (like every @jxsuite package) and follow the monorepo's release train. Within the monorepo, packages depend on it via workspace:^. Consumers install @jxsuite/protocol and import its /types and /routes entrypoints; its only runtime dependency is @jxsuite/schema.