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

@srs-solver/sdk

v0.0.1

Published

TypeScript SDK for SRS Solver API - Quantum-inspired SAT solving

Readme

@srs-solver/sdk

TypeScript/JavaScript SDK for the SRS Solver API - A quantum-inspired SAT solver using Symbolic Resonance Collapse.

Installation

npm install @srs-solver/sdk

Quick Start

import { SRSSolverClient } from '@srs-solver/sdk';

// Initialize the client with your API key
const client = new SRSSolverClient('your-api-key');

// Solve a SAT problem
const result = await client.solve({
  numVars: 3,
  clauses: [
    { literals: [1, 2] },
    { literals: [-1, 3] },
    { literals: [-2, -3] }
  ],
  maxIterations: 100,
  returnDiagnostics: true
});

console.log('Satisfiable:', result.satisfiable);
console.log('Solution:', result.solution);
console.log('Execution time:', result.executionTime, 'ms');

Features

  • Type-safe - Full TypeScript support with type definitions
  • Rate limiting - Built-in rate limiting to prevent API throttling
  • Automatic retries - Configurable retry logic for failed requests
  • Request queueing - Efficient request management with concurrency control
  • Error handling - Comprehensive error handling and reporting

API Reference

SRSSolverClient

Constructor

new SRSSolverClient(apiKey: string, baseUrl?: string)
  • apiKey - Your SRS Solver API key (get one from the dashboard)
  • baseUrl - Optional custom API endpoint

Methods

solve(request: SolveRequest): Promise<SolveResponse>

Solve a SAT problem.

Request Parameters:

{
  numVars: number;              // Number of variables in the problem
  clauses: SATClause[];         // Array of clauses
  maxIterations?: number;       // Maximum iterations (default: 150)
  lambda?: number;              // Decay constant (default: 0.15)
  returnDiagnostics?: boolean;  // Include detailed diagnostics (default: false)
}

Response:

{
  success: boolean;             // Whether the request succeeded
  satisfiable: boolean;         // Whether a solution was found
  solution?: number[];          // Variable assignments if satisfiable
  iterations: number;           // Number of iterations performed
  executionTime: number;        // Execution time in milliseconds
  metrics?: {
    finalEntropy: number;
    finalCoherence: number;
    finalEnergy: number;
    satisfactionRatio: number;
  };
  detailed_diagnostics?: {
    entropy_history: number[];
    coherence_history: number[];
    energy_history: number[];
    satisfaction_history: number[];
  }
}
setApiKey(apiKey: string): void

Update the API key.

Advanced Usage

Custom Configuration

import { DynamicApi, ApiConfig } from '@srs-solver/sdk';

const apiConfig: ApiConfig = {
  baseUrl: 'https://your-custom-endpoint.com',
  endpoints: {
    customEndpoint: {
      method: 'POST',
      path: '/custom',
      rateLimitPerSecond: 5,
      retryConfig: {
        maxRetries: 3,
        retryDelay: 1000
      }
    }
  },
  globalHeaders: {
    'X-Custom-Header': 'value'
  },
  timeout: 30000
};

const dynamicApi = new DynamicApi(apiConfig);
const api = dynamicApi.createApiMethods();

Error Handling

try {
  const result = await client.solve({
    numVars: 3,
    clauses: [{ literals: [1, 2] }]
  });
  
  if (result.satisfiable) {
    console.log('Solution found:', result.solution);
  } else {
    console.log('No solution exists');
  }
} catch (error) {
  if (error.response?.status === 401) {
    console.error('Invalid API key');
  } else if (error.response?.status === 429) {
    console.error('Rate limit exceeded');
  } else {
    console.error('Request failed:', error.message);
  }
}

SAT Problem Format

Clauses are represented in CNF (Conjunctive Normal Form):

  • Positive literals: variable is true (e.g., 1 means x₁ = true)
  • Negative literals: variable is false (e.g., -1 means x₁ = false)

Example: (x₁ ∨ x₂) ∧ (¬x₁ ∨ x₃)

{
  numVars: 3,
  clauses: [
    { literals: [1, 2] },   // x₁ OR x₂
    { literals: [-1, 3] }   // NOT x₁ OR x₃
  ]
}

License

MIT

Support

For issues and questions, visit GitHub Issues