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

@dualcondition/sdk

v0.1.0

Published

Dual Condition Agent SDK — T1/T2 scoring, anchor decay monitoring, and inter-agent quality gating. Includes adapters for popular agent frameworks. Based on the SNP framework (Schlegel, 2026).

Readme

@dualcondition/sdk

Dual Condition Agent SDK — T1/T2 scoring, anchor decay monitoring, and inter-agent quality gating, with first-party adapters for popular agent frameworks.

Based on the Spontaneous Narrative Projection framework (Schlegel, 2026).

Install

npm install @dualcondition/sdk

@dualcondition/scorer is included as a dependency — no extra install needed.

Core API

The SDK re-exports the entire scorer surface so you only need one import:

const dc = require("@dualcondition/sdk");

const result = dc.score("You are a theoretical physicist. Examine negative space.");
console.log(result.t1, result.t2, result.zone);

const anchor = dc.extractConstraints("You are a skeptical physicist. Respond in JSON.");
const adherence = dc.checkAnchor(anchor, agentOutput);
console.log(adherence.psi); // 0–1, constraint adherence

const gateResult = dc.gate(incomingInstruction, { mode: "audit" });

See the @dualcondition/scorer README for the full surface.

LangChain adapter

Wrap the scorer as a LangChain-compatible tool that an agent can call to evaluate a candidate prompt or instruction before executing it.

Without @langchain/core (zero deps)

const { createScorerTool } = require("@dualcondition/sdk/langchain");

const dcTool = createScorerTool();
// dcTool is a plain object matching DynamicStructuredTool shape:
//   { name, description, schema, func, invoke, call }

const out = await dcTool.invoke({
  prompt: "Translate 'hello' to French.",
});
console.log(JSON.parse(out));
// → { t1: 0.61, t2: 0, interaction: 0, zone: "Overconstrained", ... }

Drop it directly into an agent's tools array.

With @langchain/core (recommended for full type safety)

const { tool } = require("@langchain/core/tools");
const { z } = require("zod");
const { createScorerTool } = require("@dualcondition/sdk/langchain");

const dcTool = createScorerTool({ tool, z });
// Returns an official LangChain DynamicStructuredTool.

// In an agent:
const agent = createReactAgent({ llm, tools: [dcTool] });

Quality gate tool

createGateTool() returns a tool that scores incoming instructions and rejects (or just logs, in audit mode) ones that fall below an interaction-score threshold. Use this in multi-agent handoffs.

const { createGateTool } = require("@dualcondition/sdk/langchain");

// Audit mode (default): always accepts, logs scores. Recommended for production.
const auditGate = createGateTool();

// Enforce mode: rejects instructions below the threshold. Opt in explicitly.
const enforceGate = createGateTool({ mode: "enforce", minInteraction: 0.3 });

The audit-mode default is intentional (ADR-006): never block production pipelines until you've built trust with the scores.

Forthcoming adapters

  • @dualcondition/sdk/crewai — CrewAI step + flow integration
  • @dualcondition/sdk/autogen — Microsoft AutoGen middleware
  • Python SDK (pip install dualcondition) — currently a placeholder; full Python port of the scorer is on the roadmap

These adapters ship as part of the free open-source tier (ADR-010).

License

MIT