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

clarity-engine-sdk

v1.0.0

Published

Proactive AI Clarity Engine — one message away from clean structured memory trees. White-label ready for AI companies.

Readme

Clarity Engine SDK

One message → clean, structured, actionable plans.

Proactive AI clarity coach that auto-relabels messy input, builds a live hierarchical tree, and leads users to full clarity. White-label ready for AI companies.


Install

npm install clarity-engine-sdk openai
# Optional: Supabase for vector memory
npm install @supabase/supabase-js
# Optional: React components
npm install react react-dom

Quick Start

Node.js / Server

import { ClarityEngine } from "clarity-engine-sdk";

const engine = new ClarityEngine({
  openaiApiKey: process.env.OPENAI_API_KEY!,
  model: "gpt-4o",
  onClarityUpdate: (score, tree) => {
    console.log(`Clarity: ${score}/100`);
  },
});

const session = await engine.startSession();

const result = await engine.processMessage(
  session.id,
  "I need to launch my app but I have no idea where to start, everything feels overwhelming"
);

console.log(result.response);
console.log(`Clarity score: ${result.session.clarityScore}/100`);
console.log(engine.getTreeMarkdown(session.id));

React Hook

import { useClarity } from "clarity-engine-sdk";

function MyApp() {
  const { messages, sendMessage, clarityScore, isLoading, startSession } = useClarity({
    openaiApiKey: process.env.OPENAI_API_KEY!,
  });

  useEffect(() => { startSession(); }, []);

  return (
    <div>
      <div>Clarity Score: {clarityScore}/100</div>
      {messages.map(msg => (
        <div key={msg.id} style={{ textAlign: msg.role === "user" ? "right" : "left" }}>
          {msg.content}
        </div>
      ))}
      <button onClick={() => sendMessage("I want to build a startup")} disabled={isLoading}>
        Send
      </button>
    </div>
  );
}

Drop-in Chat Component

import { ClarityChat } from "clarity-engine-sdk";

function App() {
  return (
    <div style={{ height: 600 }}>
      <ClarityChat
        config={{ openaiApiKey: process.env.OPENAI_API_KEY! }}
        welcomeMessage="What's on your mind? Let's turn it into a plan."
        showClarityScore
        onComplete={(markdown) => console.log("Plan ready:\n", markdown)}
      />
    </div>
  );
}

White-Label Branding

const engine = new ClarityEngine({
  openaiApiKey: "...",
  branding: {
    name: "Aria",
    persona: "You speak in a warm, coach-like tone.",
  },
});
<ClarityChat
  config={{
    openaiApiKey: "...",
    branding: { name: "Aria" },
  }}
  theme={{
    primary: "#f97316",
    background: "#0a0a0a",
    surface: "#161616",
  }}
/>

API Reference

ClarityEngine

| Method | Description | |--------|-------------| | startSession(options?) | Start a new clarity session | | processMessage(sessionId, message) | Send a message and receive a structured response | | getSession(sessionId) | Retrieve the current session state | | getTreeMarkdown(sessionId) | Export the clarity tree as markdown | | clearSession(sessionId) | End and remove a session |

ClarityEngineConfig

| Property | Type | Description | |----------|------|-------------| | openaiApiKey | string | Required. OpenAI API key | | model | string | Model to use (default: gpt-4o) | | temperature | number | Sampling temperature (default: 0.7) | | maxTokens | number | Max tokens per response (default: 1024) | | supabaseUrl | string | Optional Supabase URL for vector memory | | supabaseKey | string | Optional Supabase anon key | | branding | object | White-label name and persona | | onClarityUpdate | function | Callback on clarity score changes | | onSessionComplete | function | Callback when session reaches 100 clarity |

useClarity(config)

Returns: { messages, session, tree, clarityScore, phase, isLoading, isComplete, error, startSession, sendMessage, reset, exportMarkdown }


License

Commercial license — see LICENSE.

Personal / internal use: free.
White-label / resell in your product: $4,999 one-time.
Contact: [email protected]