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

@hap-protocol/sdk

v0.1.0

Published

TypeScript SDK for the Human Authorship Protocol (HAP)

Readme

@hap-protocol/sdk

TypeScript SDK for the Human Authorship Protocol (HAP) — create, score, and anchor human authorship records for AI-assisted creative works.

Installation

npm install @hap-protocol/sdk

Quick Start

import { createHAPRecord, hashHAPRecord, hashContent } from '@hap-protocol/sdk';
import { readFileSync } from 'fs';

// Hash your work file
const fileBuffer = readFileSync('./my-song.mp3');
const contentHash = hashContent(fileBuffer);

// Create a HAP record
const record = createHAPRecord({
  creator: {
    wallet_address: '0xYourWalletAddress',
    identifier: 'artist-name',
  },
  work: {
    title: 'My Song',
    type: 'music',
    description: 'Original track produced with AI assistance',
    content_hash: contentHash,
    uri: 'ipfs://QmYourIPFSHash',
  },
  ai_tools: [
    { name: 'Suno', version: '4.0', role: 'Melody and instrumentation generation' },
  ],
  layers: {
    recipes: {
      score: 0.9,
      evidence: 'Custom genre template and style guide created by artist',
      artifacts: ['ipfs://QmStyleGuide'],
    },
    voice: {
      score: 0.85,
      evidence: 'Consistent with artist\'s established Southern hip-hop aesthetic',
      artifacts: [],
    },
    inputs: {
      score: 0.8,
      evidence: 'Detailed lyrical direction, BPM, key, and mood brief provided',
      artifacts: ['ipfs://QmPromptLog'],
    },
    iteration: {
      score: 0.75,
      evidence: '14 revision rounds with specific directional feedback each time',
      artifacts: ['ipfs://QmRevisionHistory'],
    },
    curation: {
      score: 0.9,
      evidence: 'Selected from 8 generated variants, arranged and sequenced by artist',
      artifacts: [],
    },
  },
});

console.log('HCS:', record.hcs);           // e.g. 0.84
console.log('Tier:', record.tier_label);   // "Primary Human Authorship"

// Get the record hash for on-chain anchoring
const recordHash = hashHAPRecord(record);
console.log('Record Hash:', recordHash);

API

createHAPRecord(input)

Creates a new HAP record, computes HCS, and assigns a tier.

hashHAPRecord(record)

Returns the SHA-256 hash of the HAP record JSON. Used for on-chain anchoring.

hashContent(content)

Returns the SHA-256 hash of a file buffer or string.

computeHCS(layers, weights?)

Computes the Human Contribution Score from layer scores and optional weights.

getTier(hcs)

Returns the HCS tier (1–4) for a given score.

markAnchored(record, txHash, blockNumber)

Returns an updated record with on-chain anchoring details filled in.

On-Chain Anchoring

To anchor a record to the Guapcoin blockchain, use the bridge-guapcoin contract with the recordHash from hashHAPRecord().

License

MIT