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

@dawn-ai/evals

v0.8.21

Published

<p align="center"> <img src="https://raw.githubusercontent.com/cacheplane/dawnai/main/docs/brand/dawn-logo-horizontal-black-on-white.png" alt="Dawn" width="180" /> </p>

Downloads

816

Readme

@dawn-ai/evals

Evaluation harness for Dawn agents — running and scoring agent behavior against datasets and scenarios.

This is part of Dawn - the TypeScript meta-framework for LangGraph. Conceptual docs: Evaluating your Dawn agent and Testing your Dawn agent.

Install

pnpm add -D @dawn-ai/evals @dawn-ai/testing
import {
  contains,
  defineEval,
  gate,
  memoryFresh,
  memoryIsolated,
  memoryRecalled,
  runEval,
  toolCalled,
} from "@dawn-ai/evals"

Exported Groups

Eval definition and execution

  • defineEval(def) types an eval definition.
  • resolveDataset(dataset, baseDir) normalizes inline, JSON, JSONL, or function datasets.
  • runEval(def, options) executes cases with a caller-provided runCase function and returns an EvalReport.
  • Types include Dataset, EvalCase, EvalDefinition, RunEvalOptions, EvalReport, CaseResult, and ScoredReport.

Scores and gates

  • normalizeScore(value) converts numbers, booleans, and rich verdicts into a NormalizedScore.
  • gate and resolveGate() implement dataset-wide pass/fail policies.
  • Types include Score, CaseScore, Scorer, ScorerAggregate, GatePolicy, and GateResult.

Built-in scorers

  • exactMatch()
  • contains(substring)
  • regex(re)
  • jsonEquals(options?)
  • toolCalled(name, options?)
  • tokensUnder(budget)
  • custom(fn, options?)
  • llmJudge(options)

llmJudge() sends a chat-completions request whenever that scorer runs. In Dawn CLI or harness replay, that request can be served by aimock fixtures just like an agent model call; in live, record, or unmocked programmatic runs, it needs model credentials. You can also pass fetchImpl for custom mocking.

Memory scorers

  • memoryRecalled(expectedIds) checks that recall tool output contains every expected memory id.
  • memoryFresh(expectedValue) checks that the final message surfaced the newer value.
  • memoryIsolated(forbidden) checks that a value did not leak through recall output or the final message.

These scorers are useful with seedMemory() from @dawn-ai/testing.

Common Examples

Define a route eval:

import { contains, defineEval, gate, toolCalled } from "@dawn-ai/evals"
import { script } from "@dawn-ai/testing"

export default defineEval({
  name: "chat quality",
  dataset: [
    {
      name: "filters open items",
      input: "Filter open items",
      fixtures: script()
        .user("Filter open items")
        .callsTool("applyFilter", { status: "open" })
        .replies("Found 2 open items."),
    },
  ],
  scorers: [
    contains("Found", { threshold: 1 }),
    toolCalled("applyFilter", { threshold: 1 }),
  ],
  gate: gate.perScorer(),
})

Run an eval programmatically:

import { contains, defineEval, runEval } from "@dawn-ai/evals"
import { createAgentHarness, script } from "@dawn-ai/testing"

const h = await createAgentHarness({ appRoot: process.cwd(), route: "/chat#agent" })

const def = defineEval({
  name: "hello",
  dataset: [{ input: "hello", fixtures: script().user("hello").replies("Hi!") }],
  scorers: [contains("Hi", { threshold: 1 })],
  threshold: 1,
})

const report = await runEval(def, {
  runCase: (testCase) => {
    if (typeof testCase.input !== "string") {
      throw new Error("This eval expects string inputs.")
    }
    return h.run({ input: testCase.input, fixtures: testCase.fixtures })
  },
})

Use memory scorers:

import { defineEval, memoryFresh, memoryIsolated, memoryRecalled } from "@dawn-ai/evals"

export default defineEval({
  name: "memory behavior",
  dataset: [{ input: "What does Acme prefer?" }],
  scorers: [
    memoryRecalled(["memory_acme_terms"]),
    memoryFresh("net-30"),
    memoryIsolated("other-tenant-secret"),
  ],
})

Testing Notes

  • Evals replay aimock fixtures by default, so the agent run is deterministic when fixtures are committed.
  • dawn eval --live ignores fixtures and calls the real model locally.
  • dawn eval --record records live model responses into sibling fixture files.
  • Scorer code still executes in every mode. If an eval includes llmJudge(), replay fixtures must cover that judge request too; live, record, and unmocked programmatic runs need a model key unless you inject a mocked fetchImpl.

License

MIT