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

@lannguyensi/grounding-sdk

v0.1.0

Published

Ergonomic facade over agent-grounding: verify claims, track hypotheses, validate sessions

Readme

grounding-sdk

Ergonomic facade over the agent-grounding primitives. Three entry points — verify, track, validate — wrap claim-gate, hypothesis-tracker, and evidence-ledger so agent code does not have to learn the full surface.

No new engine, no extra persistence. Each function routes to the same library call the MCP server would make.

Install

npm install @lannguyensi/grounding-sdk

Quickstart

import {
  createStore,
  track,
  verify,
  validate,
} from "@lannguyensi/grounding-sdk";
import { initSession, advancePhase } from "@lannguyensi/grounding-wrapper";
import { getDb, addEntry, getSummary } from "@lannguyensi/evidence-ledger";

// 1. Track a hypothesis. The store is in-memory; snapshot it yourself
//    via hypothesis-tracker's exportStore/importStore when you need
//    persistence across processes.
const store = createStore("debug-session-1");
const h = track(store, {
  text: "retry loop masks upstream 503",
  requiredChecks: ["grep access log", "inspect retry policy"],
});

// 2. Verify a claim against explicit evidence flags.
const vResult = verify(
  "the 503 is from upstream, not local",
  {
    readmeRead: true,
    processChecked: true,
    configChecked: true,
    healthChecked: true,
    hasEvidence: true,
    alternativesConsidered: true,
  },
  "root_cause",
);
// vResult.allowed === true, vResult.score 0–100

// 3. Validate against a grounding session + ledger summary. Analogous
//    to the MCP claim_evaluate_from_session tool.
let session = initSession({ keyword: "crash", problem: "500 on /health" });
session = advancePhase(session); // …walk phases as your agent does its work
const summary = getSummary(getDb(), "debug-session-1");
const result = validate({
  session,
  claim: "ship the fix — upstream confirmed",
  type: "root_cause",
  ledgerSummary: summary,
});
// result.derivedContext shows which prereqs were detected

API

verify(claim, evidence?, type?): ClaimResult

Evaluate a claim against explicit evidence flags. Maps the SDK's camelCase Evidence shape to the underlying claim-gate ClaimContext and calls evaluateClaim. Use when you already have the context in hand and no session is involved.

evidence defaults to {} (no prereqs satisfied).

track(store, input): Hypothesis

Register a hypothesis in the given HypothesisStore. input can be a string (treated as { text }) or a TrackInput with an optional requiredChecks: string[]. Returns the created Hypothesis with auto-generated id and timestamps. The store is the hypothesis-tracker in-memory shape — bring your own persistence via that package's exportStore / importStore.

validate({ session, claim, type?, ledgerSummary? }): ValidateResult

Derive a ClaimContext from the session's phase progress plus (optional) ledger summary, then evaluate the claim against it. Mirrors the MCP claim_evaluate_from_session tool for in-process use. Returns the standard ClaimResult plus a derivedContext field so callers can see which prereqs the SDK detected.

When ledgerSummary is omitted, has_evidence and alternatives_considered both default to false — the result is still well-defined, just based on fewer inputs.

Helpers

  • deriveContextFromSession(session, summary?): ClaimContext — the mapping validate uses internally, exported for consumers that already have their own evaluateClaim flow.
  • createStore(session?): HypothesisStore — re-exported from hypothesis-tracker, so consumers only import from one package.

When to use what

| You have | Use | | --------------------------------------- | ---------- | | Claim + hand-collected evidence flags | verify | | A new hypothesis you want to remember | track | | A grounding session and its ledger | validate |

For the full MCP tool surface, use grounding-mcp directly. This SDK is the in-process ergonomic alternative.