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

semantic-assert-typesafe

v0.2.0

Published

TypeSafe (Jev) provider for semantic-assert, powered by the official TypeSafe SDK with retries and per-call cost.

Readme

semantic-assert-typesafe

TypeSafe System One (Jev) as a provider for semantic-assert. Jev returns calibrated probabilities in a few hundred milliseconds, which is what the core's thresholds are designed around.

import { typesafe } from "semantic-assert-typesafe";

const provider = typesafe({
  // apiKey defaults to TYPESAFE_API_KEY; baseUrl to TYPESAFE_BASE_URL;
  // model to TYPESAFE_DEFAULT_MODEL, then jev-latest.
  usdPerMtokInput: 0.042, // or TYPESAFE_USD_PER_MTOK_INPUT
});

Cost is unknown by default. Set usdPerMtokInput (or TYPESAFE_USD_PER_MTOK_INPUT) to your current rate and the provider estimates each call's cost from input tokens, because Jev bills input tokens only. For reference, Jev 1.13 was listed at $0.042 per million input tokens on 2026-09-17; check docs.typesafe.ai/models for the current price. The estimate is not an invoice.

Requests use the official @typesafe-ai/sdk. The typesafe() factory and its options are unchanged, including lazy API-key validation, baseUrl, model, timeoutMs, maxRetries, and injectable fetch and sleep functions. The exported JevClient remains a compatibility facade.

The facade owns retries (three by default) for HTTP 429/529, connection failures, and timeouts, with exponential backoff. With the default 10 s per-attempt timeout that is up to about 47 s for one call, longer than Playwright's default 30 s test timeout; lower timeoutMs or maxRetries, or raise the test timeout, to suit. SDK retries are disabled to avoid nested retries and preserve the sleeper hook. HTTP failures remain JevApiError values; connection and timeout failures use the SDK's error types. Malformed successful responses fail immediately. The SDK handles request construction, authentication, and a per-attempt timeout covering both headers and response-body delivery. Top-level numeric and boolean state or instructions are converted to JSON text to fit the SDK's input types; values inside objects and arrays are preserved.

Keep the API key server-side. Never build this into a browser bundle.

pnpm --filter semantic-assert-typesafe test