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

@pumped-fn/sdk-test

v4.0.1

Published

In-memory test helpers for @pumped-fn/sdk

Readme

@pumped-fn/sdk-test

In-memory test helpers for @pumped-fn/sdk. Every helper keeps createScope as the seam.

config.model / modelStub ---------> scalar provider seam
config.attempt / attemptStub -----> streaming provider seam
sessionStoreStub ----------------> configured load and commit ports
sessionKit ----------------------> complete agent turn tag bundle
createScope ----------------------> explicit test-owned session seam
import * as session from "@pumped-fn/sdk/session"
import { createScope } from "@pumped-fn/lite"
import { sessionKit } from "@pumped-fn/sdk-test"

const bundle = sessionKit({
  id: "test-session",
  role: {
    name: "reviewer",
    version: "1",
    instructions: "Review the request.",
    maxRounds: 1,
  },
  respond: {
    events: [{ type: "content_delta", content: "ready" }],
    result: { content: "ready", stop: true },
  },
})
const scope = createScope({ tags: bundle.tags })
const owner = scope.createContext()
await owner.resolve(session.session)

const result = await owner.exec({
  flow: session.run,
  input: {
    work: { id: "review", branchId: "main", role: "reviewer", policy: "all" },
    input: { prompt: "Check this." },
  },
})

await owner.close()
await scope.dispose()

Every test creates its own scope and owner context with exactly the extensions, presets, and tags it needs. sessionKit supplies the authority, record, clock, turn, store, attempt, role, and validation tags. Resolve session.session on the owner before execution, then close the owner and scope in that order.

Pass respond to configure attemptStub, or pass attempt to replace it with a custom flow. Every other tag value can also be replaced through the matching option. The returned record and store make state checks direct. validationStub is the default trivial validation engine and can also be used by tests that wire tags themselves.

initialRecord, testAuthority, and modelRequest supply valid defaults with shallow overrides. testAuthority denies all sandbox access unless the test grants it. modelStub and attemptStub are stable module-level flows configured by config.model and config.attempt. attemptStubConfig supplies the attempt response and implementation tags together. sessionStoreStub owns an isolated record map and supplies its config plus named load and commit bindings. None of these helpers creates or caches a scope.

The existing workflow helpers remain: kit, suspense, MemoryWorkflowLog, MemorySuspenseLog, and localRemoteRunner.

The issue-triage example uses the same scope seam for independent tests of agent.turn, evidence backends, verification, publication, and queue concurrency.

Migration to 4.0.0

| Before | Now | |---|---| | hand-written SessionRecord literal | initialRecord(id, authority, overrides?) | | full session.createAuthority object | testAuthority(overrides?) with deny-all defaults | | eight-field ModelRequest literal | modelRequest(overrides?) | | local validation.standard({ id: "test", toJsonSchema: () => true }) | validationStub | | hand-wired session and agent tag list | sessionKit(options?).tags |

Migration to 3.0.0

3.0.0 tracks the @pumped-fn/sdk facade removal. The test helpers no longer own or cache a scope; each test builds its own createScope seam. The scope example above is the current, post-migration wiring.

| Removed in 2.x | Replacement in 3.0.0 | |---|---| | helper-owned scope or singleton | test-owned createScope({ tags, presets, extensions }) | | provider mock object | attemptStubConfig / config.attempt / attemptStub | | session mock object | sessionStoreStub with config, binding.load, and binding.commit |

None of these helpers creates or caches a scope, so the migration keeps createScope as the only seam.


Part of pumped-fn.