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

@qwed-ai/sdk

v1.0.0

Published

TypeScript SDK for QWED Verification Protocol

Readme

@qwed-ai/sdk

TypeScript/JavaScript SDK for QWED Verification Protocol

npm version TypeScript

Installation

npm install @qwed-ai/sdk
# or
yarn add @qwed-ai/sdk
# or
pnpm add @qwed-ai/sdk

Quick Start

import { QWEDClient } from '@qwed-ai/sdk';

const client = new QWEDClient({
  apiKey: 'qwed_your_api_key',
  baseUrl: 'http://localhost:8000', // optional
});

// Verify a math query
const result = await client.verify('What is 2+2?');
console.log(result.verified); // true
console.log(result.status);   // 'VERIFIED'

Verification Methods

Natural Language

const result = await client.verify('Is 15% of 200 equal to 30?');

Math Expressions

const result = await client.verifyMath('x**2 + 2*x + 1 = (x+1)**2');
console.log(result.result?.is_valid); // true

Logic (QWED-DSL)

const result = await client.verifyLogic('(AND (GT x 5) (LT y 10))');
console.log(result.result?.satisfiability); // 'SAT'
console.log(result.result?.model);          // { x: 6, y: 9 }

Code Security

const result = await client.verifyCode(`
  import os
  os.system('rm -rf /')
`, { language: 'python' });

console.log(result.verified); // false
console.log(result.result?.vulnerabilities);

Fact Verification

const result = await client.verifyFact(
  'Paris is the capital of France',
  'France is a country in Europe. Its capital city is Paris.'
);
console.log(result.result?.verdict); // 'SUPPORTED'

SQL Validation

const result = await client.verifySQL(
  'SELECT * FROM users WHERE id = 1',
  'CREATE TABLE users (id INT PRIMARY KEY, name TEXT)',
  { dialect: 'postgresql' }
);

Batch Verification

const result = await client.verifyBatch([
  { query: '2+2=4', type: VerificationType.Math },
  { query: '3*3=9', type: VerificationType.Math },
  { query: '(AND (GT x 5))', type: VerificationType.Logic },
]);

console.log(result.summary.success_rate); // 100
console.log(result.items);                // individual results

Attestations

Request cryptographic proof of verification:

const result = await client.verify('2+2=4', {
  includeAttestation: true,
});

if (result.attestation) {
  const parsed = parseAttestation(result.attestation);
  console.log(parsed?.payload.qwed.result.status); // 'VERIFIED'
}

Agent Verification

// Register an agent
const agent = await client.registerAgent({
  agent: {
    name: 'CustomerBot',
    type: 'supervised',
    principal_id: 'org_123',
  },
  permissions: {
    allowed_engines: [VerificationType.SQL, VerificationType.Math],
    allowed_tools: ['database_read'],
  },
  budget: {
    max_daily_cost_usd: 50,
  },
});

// Verify agent action
const decision = await client.verifyAgentAction({
  agent_id: agent.agent_id,
  agent_token: agent.agent_token,
  action: {
    type: 'execute_sql',
    query: 'SELECT * FROM customers',
  },
});

if (decision.decision === 'APPROVED') {
  // Safe to execute
}

Error Handling

import { QWEDClient, QWEDError, QWEDAuthError, QWEDRateLimitError } from '@qwed-ai/sdk';

try {
  const result = await client.verify('test');
} catch (error) {
  if (error instanceof QWEDAuthError) {
    console.error('Invalid API key');
  } else if (error instanceof QWEDRateLimitError) {
    console.error(`Rate limited. Retry after ${error.retryAfter}s`);
  } else if (error instanceof QWEDError) {
    console.error(`Error ${error.code}: ${error.message}`);
  }
}

Types

All types are exported and fully documented:

import {
  VerificationType,
  VerificationStatus,
  VerificationResponse,
  BatchResponse,
  AgentVerificationResponse,
  // ... and more
} from '@qwed-ai/sdk';

Configuration

const client = new QWEDClient({
  apiKey: 'qwed_...',          // Required
  baseUrl: 'https://api.qwed.ai', // Optional, default: localhost:8000
  timeout: 30000,              // Optional, default: 30000ms
  headers: {                   // Optional custom headers
    'X-Custom-Header': 'value',
  },
});

License

Apache 2.0