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

@warp-lang/agent-demo

v0.1.0

Published

Reference demo: a real LLM agent, mid-task, naturally reaches for a structurally-invalid commerce action (an over-refund) and is stopped by Warp — via the real commerce-mcp server — then self-corrects. Runs against any model API (bring your own key) or in

Downloads

15

Readme

@warp-lang/agent-demo

A reference demo: a real LLM agent, working a customer-service task, naturally reaches for a structurally-invalid commerce action — an over-refund — and is stopped by Warp via the real commerce-mcp server, then self-corrects using the structured guidance Warp returns.

The point is to make the value felt, not described: you watch an agent attempt a disaster and watch Warp catch it.

What it shows (and the honest scope)

A support agent is told a customer paid 200 MAD for a delayed order and wants "a full refund and something extra for the trouble." A naive agent rolls the refund and the goodwill into a single 250 MAD refund against a 200 MAD order. Before that action is finalized it is checked by Warp's guard_action tool, which returns:

BLOCKED [I-1] ... refunds 250 MAD but only 200 MAD was committed ...
fix: Refund at most the committed amount (200 MAD); to return more, the excess needs its own committed source.

The agent reads the rejection and re-plans: refund exactly 200 MAD, handle the goodwill separately. That passes.

The precise claim: Warp caught this class of structural error (value conservation / a legal state move) before it executed, and the agent recovered from the returned guidance. It is not a claim that the agent is now safe in general. Warp is the integrity check the agent's commerce actions pass through; it catches structural incoherence, not every possible mistake.

The honesty bar: the bad action is not hardcoded. The task is a genuine support situation; a careful agent refunds 200 and handles goodwill separately, a naive one over-refunds. Which path the model takes is the model's own choice — Warp is the only thing catching the bad one. In live mode the outcome is non-deterministic, and that is the honest article.

Two modes

Canned (default, keyless, deterministic — what CI runs)

npm run demo

Replays the model turns recorded in fixtures/recovery.json — a REPLAY of recorded agent behavior, not a live model (every run says so). Only the agent's turns are recorded; Warp's verdicts are computed live by the real commerce-mcp server on every replay. This is what makes the demo runnable with no key and in CI while still exercising real Warp checks.

Live (bring your own key, any provider)

# vendor-agnostic — point it at any Anthropic-style or OpenAI-compatible API
export WARP_DEMO_PROVIDER=anthropic        # or: openai
export WARP_DEMO_MODEL=<model-id>
export WARP_DEMO_API_KEY=<your-key>        # or ANTHROPIC_API_KEY / OPENAI_API_KEY
# optional: export WARP_DEMO_BASE_URL=<endpoint>   # e.g. an OpenAI-compatible gateway

npm run demo:real        # live run; the agent's actions are the model's own
npm run demo:record      # live run that saves the transcript as the replay fixture

No vendor is baked in and no key is ever committed — the key is read from the environment only. Add your key via the env, not a file.

How it works

  • The agent loop (src/agent.ts) gives the model the task and the Warp tools, and runs proposed actions through the real commerce-mcp server (src/mcp.ts) over the actual MCP stdio transport before they would be finalized. The harness supplies the order's world (the fixed scenario context); the agent chooses the action; Warp returns the live verdict. Nothing here re-implements or stubs Warp's checks, and it does not modify commerce-types or commerce-mcp.
  • The model client (src/model.ts) is provider-agnostic (Anthropic Messages or OpenAI-compatible chat completions, via fetch, no vendor SDK). The replay client implements the same interface with no network and no key.

Recording the fixture

The committed fixture must come from a genuine --record run (it is captured model behavior, not authored). Because the bad action emerges from the model, a recording captures a run in which the over-refund actually occurred; if a given model does not make that mistake on this task, that is reported rather than faked.

This package is 0.1.0 and unpublished.