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

@xpaysh/template-adapter

v0.1.0

Published

Reference PlatformAdapter implementation for an imaginary 'demo' eCommerce platform. Copy this directory to bootstrap a new agentic-commerce-for-<platform> plugin — every method is wired to a deterministic in-memory catalog so the sample boots and serves

Readme

@xpaysh/template-adapter

A working reference PlatformAdapter implementation, backed by a deterministic in-memory catalog.

Purpose: copy this directory when bootstrapping a new agentic-commerce-for-<platform> plugin. Every method in the contract is implemented; you swap the in-memory store for your platform's native client (Shopify, Magento, Saleor, …) and the protocol routes work end-to-end.

What's covered

| Method | Reference impl | |---|---| | listProducts(query) | Returns paginated DEMO_PRODUCTS. Honors query.search (case-insensitive title match), limit, offset. | | getProduct(id) | Returns the demo product or null. | | createCart(input) | Allocates an in-memory cart from input.lines; throws on unknown productId. | | updateCart(id, mutation) | Applies add/remove/set_quantity operations; recomputes subtotal. | | completeCheckout(input) | Finalises the cart → order; deletes the source cart. Emits a fake paymentReference. | | getOrder(id) | Returns the demo order or null. |

State is per-instance — createTemplateAdapter() returns a fresh adapter; the exported templateAdapter is a process-wide singleton convenient for ad-hoc usage outside tests.

Use

const { createTemplateAdapter } = require('@xpaysh/template-adapter');

const adapter = createTemplateAdapter();

const products = await adapter.listProducts({ limit: 10 });
const cart = await adapter.createCart({
  lines: [{ productId: 'demo-shirt-blue', variantId: 'demo-shirt-blue-m', quantity: 2 }],
});
const order = await adapter.completeCheckout({
  cartId: cart.id,
  buyer: { email: '[email protected]' },
});

Pattern for contributing a new platform

  1. Fork xpaysh/agentic-commerce-plugin-template.
  2. Copy packages/template-adapter to agentic-commerce-for-<your-platform>/src/adapter.ts (rename the export).
  3. Replace the in-memory Maps with the platform's native client (axios, GraphQL, SDK).
  4. Implement the same six methods. The Cart/Product/Order shapes are documented in @xpaysh/adapter-contract.
  5. Reuse the route tables: @xpaysh/discovery for /llms.txt + JSON-LD + robots.txt; @xpaysh/ucp-schemas generateUcpProfile() for /.well-known/ucp; @xpaysh/cart-deeplinks for HS256 cart-handoff URLs; @xpaysh/http-message-signatures verifyRequest() for RFC 9421 sig verification on /ucp/* + /acp/* routes.
  6. Wire conformance: tests/conformance.test.ts loads fixtures from @xpaysh/conformance-fixtures and validates against the canonical schemas. Copy from any sibling plugin (e.g. agentic-commerce-for-commercetools).
  7. Submit to xpaysh/awesome-agentic-commerce — see its BOUNTIES.md for reward amounts on accepted community plugins.

License

Apache-2.0.