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

@synheart.ai/adapt-core-ts

v0.1.1

Published

Browser SDK for Synheart Adaptive UI - on-device human state inference using WASM

Readme

@synheart.ai/adapt-core-ts

Browser SDK for Synheart Adaptive UI - on-device human state inference using WebAssembly.

Features

  • On-device processing - All computation happens locally via WASM, no data leaves the browser
  • Automatic behavior collection - Uses @synheart.ai/behavior-web to capture scroll, click, typing, and other browser events
  • Adaptive UI modes - Returns calm, guided, focused, or power mode recommendations
  • Type-safe - Full TypeScript support with typed configuration
  • Framework agnostic - Works with React, Vue, Next.js, or vanilla JavaScript

Installation

npm install @synheart.ai/adapt-core-ts

Quick Start

import { createSynheartClient } from '@synheart.ai/adapt-core-ts';

// Behavior-only optimized config (recommended for browser use)
const client = await createSynheartClient({
  engineConfig: {
    confidence: { min_score_confidence: 0.25 },
    thresholds: { high_load: 0.6, high_attention: 0.7 },
    stability: { dwell_time_ms: 30000, max_switches_per_hour: 12 }
  },
  onDecision: (decision) => {
    console.log('Mode:', decision.mode);        // 'calm' | 'guided' | 'focused' | 'power'
    console.log('Axes:', decision.axes);        // density, motion, interruptibility, etc.
    console.log('Notifications:', decision.notification_budget); // per hour
  },
});

// Start automatic behavior collection and processing
client.startAutoMode();

// Later: clean up
client.terminate();

API Overview

createSynheartClient(options)

Creates and initializes the SDK client.

Options:

  • engineConfig - Engine configuration object (see below)
  • wasmUrl - Custom WASM module URL (auto-detected by default)
  • autoModeIntervalMs - Processing interval in ms (default: 500)
  • onDecision - Callback when a new decision is made
  • onError - Callback on errors

client.startAutoMode()

Starts automatic behavior collection and periodic processing.

client.stopAutoMode()

Stops automatic collection.

client.applyOverride(mode)

Manually override to a specific mode: 'calm', 'guided', 'focused', or 'power'.

client.terminate()

Clean up resources and terminate the worker.

Engine Configuration

interface EngineConfig {
  confidence?: {
    min_score_confidence?: number;  // Default: 0.5, use 0.25 for behavior-only
  };
  thresholds?: {
    high_load?: number;      // Stress threshold (default: 0.7)
    low_readiness?: number;  // Fatigue threshold (default: 0.3)
    high_attention?: number; // Focus threshold (default: 0.8)
    low_attention?: number;  // Distraction threshold (default: 0.3)
  };
  stability?: {
    dwell_time_ms?: number;          // Min time in mode (default: 300000 = 5min)
    max_switches_per_hour?: number;  // Rate limit (default: 3)
    hysteresis_threshold?: number;   // Change sensitivity (default: 0.1)
  };
}

Policy Decision Output

interface PolicyDecision {
  mode: 'calm' | 'guided' | 'focused' | 'power';
  axes: {
    density: 'compact' | 'normal' | 'spacious';
    motion: 'reduced' | 'normal' | 'full';
    interruptibility: 'none' | 'important' | 'normal' | 'all';
    assistance: 'minimal' | 'normal' | 'proactive';
    input_effort: 'minimal' | 'normal' | 'full';
  };
  notification_budget: number;  // Notifications per hour
  confidence: 'low' | 'medium' | 'high';
  reasons: string[];            // Why this decision was made
}

Framework Examples

See the examples/ directory for:

  • React - Hooks and context provider
  • Vue - Composables
  • Next.js - App router integration
  • Vanilla JS - No framework

Full Documentation

See FRONTEND_INTEGRATION_GUIDE.md for complete integration instructions.

License

Apache-2.0