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

@ai-chen2050/crelay-js-sdk

v2.12.8

Published

Tools for making a causality-key of cRelay client.

Readme

cRelay-js-sdk

This project serves as the official Javascript SDK for CausalityGraph, providing a robust implementation of the Nostr protocol with advanced causality tracking and secure messaging capabilities. It is designed to be the primary development toolkit for building decentralized applications that require strong causality guarantees and secure communication.

It combines three key technologies:

  1. Nostr (decentralized messaging protocol) and CIP (Causality Implementation Possibilities)
  2. Ethereum EIP-191 signatures (secure cryptographic signing)
  3. VLC (Verifiable Logical Clock)

Installation

# bun
curl -fsSL https://bun.sh/install | bash

# install just for linux
curl -LO https://github.com/casey/just/releases/download/1.28.0/just-1.28.0-x86_64-unknown-linux-musl.tar.gz
tar -xvf just-1.28.0-x86_64-unknown-linux-musl.tar.gz
sudo mv just /usr/local/bin/

# or for macOS
brew install just

# compile by yourself
just build

# or install by npm
npm i @ai-chen2050/crelay-js-sdk

# jsr
npx jsr add @ai-chen2050/crelay-js-sdk

If using TypeScript, this package requires TypeScript >= 5.0.

CIP Implementation

The cip directory implements various CIP (Common Interface Protocol) specifications:

CIP-01: Basic Subspace Operations

  • Subspace creation and management
  • Basic event operations
  • Authentication and authorization

CIP-02: Common Graph Operations

  • Project and task management
  • Entity and relation tracking
  • Observation recording
  • Structured data organization

CIP-03: Model Graph Operations

  • Model versioning and tracking
  • Dataset management
  • Compute and algorithm operations
  • Validation and fine-tuning
  • Conversation and session handling

CIP-04: OpenResearch Operations

  • Research paper submission and indexing
  • Paper annotations and reviews
  • AI analysis integration
  • Research discussions
  • Academic collaboration features

Each CIP implementation follows a consistent pattern:

  • Event type definitions
  • Tag structure specifications
  • Event creation and parsing
  • Subspace operation management

Examples

For detailed examples, please refer to the following files in the examples directory:

Subspace Operations

Basic subspace creation and management:

// Create and join a subspace
const subspaceEvent = NewSubspaceCreateEvent(
  subspaceName,
  DefaultCommonPrjOps + ',' + DefaultSubspaceOps,
  rules,
  description,
  imageURL,
)
ValidateSubspaceCreateEvent(subspaceEvent)

const joinEvent = NewSubspaceJoinEvent(subspaceEvent.subspaceID, 'Join')
ValidateSubspaceJoinEvent(joinEvent)

Common Operations

Project, task, entity, and relation management:

// Create a project
const projectEvent = await newProjectEvent(subspaceID, '')
projectEvent.setProjectInfo(
  'proj-001',
  'Test Project',
  'This is a test project',
  ['user1', 'user2'],
  'active',
)

// Create a task
const taskEvent = await newTaskEvent(subspaceID, '')
taskEvent.setTaskInfo(
  'proj-001',
  'task-001',
  'Test Task',
  'user1',
  'in_progress',
  '2024-12-31',
  'high',
)

Model Graph Operations

Model, dataset, and training management:

// Create a model
const modelEvent = await newModelEvent(subspaceID, '')
modelEvent.setParent('parent-hash-123')
modelEvent.setContributions('0.5,0.3,0.2')

// Create a dataset
const datasetEvent = await newDatasetEvent(subspaceID, '')
datasetEvent.setDatasetInfo(
  'proj-001',
  'task-001',
  'training',
  'json',
  ['user1', 'user2'],
)

OpenResearch Operations

Research paper and collaboration management:

// Create a paper
const paperEvent = await newPaperEvent(subspaceID, '')
paperEvent.setPaperInfo(
  '10.1234/example.2023',
  'research',
  ['John Doe', 'Jane Smith'],
  ['AI', 'Machine Learning', 'Research'],
  '2023',
  'Journal of Example Research',
  'Example Research Paper',
  'This is an example research paper abstract.',
  'https://example.com/paper',
  'abc123def456',
)

// Create a review
const reviewEvent = await newReviewEvent(subspaceID, '')
reviewEvent.setReviewInfo(
  paperEvent.id,
  4.5,
  {
    methodology: 4.5,
    results: 4.0,
    discussion: 5.0,
  },
  'Overall, this is a well-written paper with strong methodology.',
  'Clear methodology, comprehensive literature review.',
  'Could use more discussion on limitations.',
  'Consider expanding the discussion section.',
)

Each example demonstrates the core functionality of its respective CIP implementation. For complete working examples including relay connection, event signing, and publishing, please refer to the corresponding files in the examples directory.

Plumbing

To develop cRelay-js-sdk, install just and run just -l to see commands available.