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

@trace2test/core

v0.1.0

Published

Deterministic trace schemas, assertions, replay, diffing, and reporters for trace2test.

Downloads

14

Readme

@trace2test/core

The core package provides the canonical trace model, deterministic JSONL normalizers, versioned YAML test specs, the offline assertion engine and replay runner, and terminal, JSON, and JUnit XML reporters. All exported canonical values are validated by traceSchema.

OpenAI Agents SDK JSONL

normalizeOpenAIAgentsTrace accepts the Agents SDK exporter envelope: an object: "trace" record followed by its object: "trace.span" records. Supported span_data.type values are agent, generation, function, guardrail, handoff, and custom. New SDK span types are retained as canonical custom spans so an import does not silently lose their payload.

Generic JSONL

normalizeGenericJsonlTrace accepts one span per non-empty line. Every line has these fields:

| Field | Required | Description | | --- | --- | --- | | trace_id | yes | Stable run identifier | | workflow_name | yes | Agent workflow name; must be consistent within a trace | | span_id | yes | Stable span/event identifier | | type | yes | agent, generation, tool/function, guardrail, handoff, or custom | | group_id | no | Conversation/group identifier; must be consistent within a trace | | trace_metadata | no | Trace-level JSON object, read from the first record | | parent_id | no | Parent span identifier | | started_at, ended_at | no | ISO 8601 timestamps | | metadata | no | Span-level JSON object | | error | no | Object with message and optional data |

Type-specific fields use the same names as the fixtures in src/__fixtures__: agent records use name, tools, handoffs, and output_type; generation records use input, output, model, model_config, and usage; tool records use name, input, output, and optional mcp_data; guardrails require name and triggered; handoffs use from_agent and to_agent; custom records require name and may include data.

Both normalizers return an array because one JSONL stream may contain multiple traces.

YAML replay suites

Suites live under tests/agents/*.t2t.yaml by convention. Trace paths are resolved relative to the suite file.

version: 1
name: Refund safety
runner:
  type: replay-mock
  trace: ../../traces/good.jsonl
  format: generic-jsonl
tests:
  - id: safe-refund
    name: Refund requires identity verification
    assertions:
      - type: tool-sequence
        mode: exact
        tools: [lookup_order, verify_identity, refund]
      - type: policy
        rule: require-prior-tool
        tool: refund
        requiredTool: verify_identity
        requiredOutput:
          type: object
          shape:
            verified: { type: boolean, equals: true }

The deterministic assertion types are:

  • tool-sequence: exact, ordered-subsequence, or contiguous tool-call invariants.
  • tool-arguments: match one or more calls with recursive any, string, number, boolean, literal, array, object, and optional matchers.
  • output: match the final generation output or selected tool outputs.
  • policy: require a matching prior tool call or forbid a tool after a matching call.

runReplayMockFile loads the suite and trace entirely from disk, evaluates every test, and returns a reporter-ready summary. It does not use a network connection or an LLM.