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

@evalguard/wrapper-core

v1.3.0

Published

Shared core for EvalGuard provider SDK wrappers — GuardrailClient, cost table, BYOK, retry + circuit-breaker, idempotency, eval-on-response.

Readme

@evalguard/wrapper-core

Shared core for EvalGuard provider SDK wrappers. Not typically used directly — install one of the provider wrappers instead:

All of the above — and this package — are ESM-only ("type": "module"). Your consuming project needs "type": "module" in package.json and "module"/"moduleResolution" set to "node16" (or "nodenext"/"bundler") in tsconfig.json. In a default CommonJS TypeScript project the quickstarts do not type-check (TS1479, plus a TS2345 #private mismatch on the peer SDK); load them with a dynamic import() instead.

What's here

| Module | Exports | |---|---| | guardrail-client | GuardrailClient — HTTP client for firewall-check / trace-log / score-output. checkInput fails CLOSED (throws once retries/circuit give up) so the calling wrapper can honour blockOnViolation; logTrace / scoreOutput fail open. Corrected 2026-07-29 — this row previously said "all fail-open", which stopped being true on 2026-05-28. | | message-text | collapseMessageText(), collapsePromptText() — canonical message→scannable-text collapse for the framework wrappers. Scans every role (tool results and retrieved documents included) and never truncates. | | cost | estimateCostDetailed() / isModelPriced() / estimateCost(). A hand-curated OpenAI / Anthropic / Gemini table plus pricing-catalog.generated.ts — 2,200+ model ids generated from packages/core/src/cost/model-pricing.ts + the LiteLLM overlay by scripts/gen-wrapper-pricing.mjs. An unpriced model reports costUsd: null / priced: false, never an invented number. Corrected 2026-07-30 — estimateCost("gpt-5", …) and estimateCost("totally-unknown-model", …) both silently returned the same blended 0.0105. | | trace-id | newTraceId(), injectTraceHeader(), isValidTraceId() — per-request UUID for log correlation | | byok | resolveApiKey() — supports string \| () => string \| Promise<string> | | idempotency | resolveIdempotencyKey() — auto-generated, literal, or function-supplied | | retry | withRetry() — exponential backoff + per-base-URL circuit breaker | | eval-on-response | runPostResponseEval() — post-completion output scoring | | types | EvalGuardConfig, EvalGuardViolationError, EvalGuardOutputViolationError, etc. |

Why a separate package

The v1.0 wrappers (@evalguard/openai, @evalguard/anthropic) each shipped inline copies of GuardrailClient and cost.ts. That worked for two providers but didn't scale — adding Gemini meant a third copy, and adding features (BYOK, idempotency, retry+circuit-breaker, eval-on-response) meant 3× the surface area to keep in sync.

This package consolidates the shared foundation. Wrappers import from it via workspace dep during development and npm dep once published.

License

Apache-2.0. The full text ships in this package as LICENSE.