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

cmp-mesh

v2.0.0

Published

Distribute computation across nearby devices. No cloud. No server. No internet required.

Readme


Your laptop is processing a large file. There are 3 other devices on the same WiFi doing nothing. What if they could help?

import { CMP } from 'cmp-mesh';

const mesh = new CMP();
await mesh.start();
await mesh.waitForPeers(1);

const result = await mesh.distribute(imageBytes, processorWasm);
// ⚡ Processed across 3 devices in 200ms instead of 800ms

CMP discovers nearby devices automatically, negotiates who helps, splits the work, executes in WASM sandboxes, encrypts everything, and assembles the result. Your code just calls distribute().


Quick Start

git clone https://github.com/agentviscro/cmp.git
cd cmp
npm install

Run your first distributed computation (60 seconds):

npx tsx examples/04-two-node-compute.ts
  [1] Creating two CMPNodes...
      Node A: 5d01151a
      Node B: 692bba5a

  [2] Waiting for peer discovery...
      Node A sees 1 peer(s)

  [4] Node A submitting WASM computation to mesh...
      WASM module: 56 bytes
      Input data:  64 bytes

  [5] RESULT:
      Distributed: true
      Time:        239ms
      Devices:     1

  ║  DISTRIBUTED COMPUTATION SUCCESSFUL!         ║
  ║  Node A submitted → Node B executed → Result ║
  ║  All over real LAN with Ed25519 auth.        ║

Two real nodes. Real WASM execution. Real encrypted transport. No cloud.


Examples

Process real data:

npx tsx examples/02-distribute-work.ts
  ── Task 1: Sort 1000 random numbers ──
  Output: [32,39,43,49,61,69,78,86,86,87]   Time: 7ms

  ── Task 2: Word frequency analysis ──
  "devices" → 2 times, "compute" → 2 times   Time: 4ms

  ── Task 3: Transform sensor data ──
  Avg Temperature: 27.2°C, Alert: HIGH_TEMP_WARNING   Time: 55ms

Watch the mesh think:

npx tsx examples/03-consciousness.ts
  Task 1 succeeded → success pheromone: ████████ 1.50
  Task 2 succeeded → success pheromone: █████████████ 2.50
  Threat detected  → danger pheromone:  ███████████████████ 6.30

  Mesh behavior: DEFENSIVE
  → No voting happened. No leader decided. Emergent behavior.

Interactive CLI:

npx tsx packages/cli/src/cli.ts start
cmp> status
  Peers        3
  Credits      100 CCU
  Behavior     HIGH_DEMAND
  Pheromones   12 (dominant: compute_success)
  DAG          45 nodes, 2 branches
  Wormholes    1 active, 2 remote meshes

cmp> consciousness pheromones
  compute_success      ████████████ 1.20 (8 deposits)
  danger               ██ 0.23 (2 deposits)

cmp> spacetime fork experiment-1
  Forked: branch-a1b2c3d4 ("experiment-1")

cmp> wormhole declare mesh-beta Beta 100
  Declared wormhole → mesh-beta ("Beta", 100ms)

When to Use CMP

| Use CMP when | Don't use CMP when | |---|---| | Heavy computation (image processing, AI inference, data analysis) | Task takes < 1 second on one device | | Multiple devices nearby on same network | Only one device available | | No cloud / can't use cloud / privacy-critical data | Reliable cloud infrastructure exists | | Need offline capability | Internet is always available | | Edge processing (IoT, sensors, warehouses) | Need massive GPU (training large models) |

Real use cases:

  • Disaster relief — 10 phones with no cell tower pool compute for offline AI translation
  • Hospital — 50 tablets process medical images without data leaving the building
  • Classroom — 30 students pool devices to train an ML model together
  • Warehouse — IoT sensors form a mesh and process anomaly detection at the edge
  • Field research — Drones and phones in a remote area share compute for data analysis

Architecture

CMP implements a 13-layer protocol stack — the deepest of any peer-to-peer system:

┌─────────────────────────────────────────────────────────┐
│  Layer 13: Cross-Mesh Wormholes     (Federation)    v2.0│
│  Layer 12: Computation Spacetime    (Temporal Fork) v2.0│
│  Layer 11: Collective Consciousness (Stigmergy)     v2.0│
├─────────────────────────────────────────────────────────┤
│  Layer 10: Lifeforms     (Autonomous entities)      v1.4│
│  Layer 9:  Precognition  (Predictive scheduling)    v1.3│
│  Layer 8:  Mesh Cognition (Learning from history)   v1.2│
│  Layer 7:  Certification (Computation provenance)   v1.1│
├─────────────────────────────────────────────────────────┤
│  Layer 6:  Assembly       (Result collection)       v1.0│
│  Layer 5:  Execution      (WASM sandbox)            v1.0│
│  Layer 4:  Distribution   (Chunk splitting)         v1.0│
│  Layer 3:  Negotiation    (Bid/assign)              v1.0│
│  Layer 2:  Capability     (Resource profiling)      v1.0│
│  Layer 1:  Discovery      (BLE/LAN/WiFi/WebRTC)    v1.0│
└─────────────────────────────────────────────────────────┘

91 wire protocol message types. Full spec: CMP Protocol Specification v2.0

What makes CMP different

| Feature | CMP | BOINC | Spark | libp2p | |---------|-----|-------|-------|--------| | Zero infrastructure | ✓ | ✗ | ✗ | Partial | | Works offline | ✓ | ✗ | ✗ | ✗ | | Privacy preserving | ✓ | ✗ | Partial | Partial | | Autonomous entities (Lifeforms) | ✓ | ✗ | ✗ | ✗ | | Pheromone coordination | ✓ | ✗ | ✗ | ✗ | | Temporal forking | ✓ | ✗ | ✗ | ✗ | | Process teleportation | ✓ | ✗ | ✗ | ✗ | | Self-evolving code | ✓ | ✗ | ✗ | ✗ |

Novel concepts (no prior art)

  • Stigmergy — Nodes leave pheromone trails that influence other nodes' behavior. Coordination without communication.
  • Computation Spacetime — Fork a running process into parallel timelines, race them, merge the winner back. Git for live computation.
  • Lifeform Teleportation — Serialize an autonomous entity (identity + state + genome + economic balance + synapses + causal history) and transmit it to a completely different mesh.
  • Genome Mutation — WASM binaries evolve through natural selection. Mutant generations compete; the fittest survive.
  • Emergent Behavior — The mesh automatically shifts between NORMAL, HIGH_DEMAND, DEFENSIVE, CONSERVATION, and DREAMING based on collective pheromone concentrations.

SDK

import { CMP } from 'cmp-mesh';

const mesh = new CMP();
await mesh.start();

// 5 methods. That's it.
mesh.peers              // Number of nearby devices
mesh.behavior           // Mesh consciousness state
mesh.distribute(data, wasm)  // Distribute computation
mesh.run(lang, code, input)  // Run code on mesh
mesh.status()           // Full status

See SDK documentation for full API reference with examples.


Project Structure

cmp/
├── packages/
│   ├── core/           Protocol layers, types, crypto, consciousness, spacetime, wormholes
│   ├── transport/      BLE, LAN (UDP/TCP), WiFi Direct, WebRTC transports
│   ├── runtime/        WASM sandbox, multi-runtime execution engine
│   ├── cli/            Interactive REPL (2,400 lines)
│   └── mobile/         React Native entry point
├── examples/           4 runnable examples
├── docs/               Protocol specifications
├── sdk.ts              Simple 5-method API wrapper
└── SDK-README.md       Developer documentation

68,059 lines of TypeScript. 212 source files. 827 tests. 0 failures.


Tests

npm run test:all        # Run all test suites

# Individual suites
npm run test            # Core protocol (49 tests)
npm run test:auth       # Ed25519 authentication + flow control (45 tests)
npm run test:distributed # Two-node WASM distribution (2 tests)
npm run test:consciousness # Layer 11: Pheromones, quorum, swarm (43 tests)
npm run test:spacetime  # Layer 12: DAG, forking, racing (39 tests)
npm run test:wormhole   # Layer 13: Discovery, teleport, synapses (30 tests)
npm run test:bridge     # V2 integration (15 tests)

Protocol Spec

The complete v2.0 specification (709 lines, 26 sections) covering all 13 layers, 91 message types, security model, and incentive mechanism:

CMP Protocol Specification v2.0


Roadmap

  • [x] v1.0 — Core protocol (6 layers, distributed WASM execution)
  • [x] v1.2 — Mesh Cognition (learning from past executions)
  • [x] v1.3 — Mesh Intelligence (immune system, metabolism, futures, morphogenesis)
  • [x] v1.4 — Lifeforms (autonomous entities, CRDT state, fusion/fission, mutation)
  • [x] v1.5 — Ground Truth (Ed25519 auth, flow control, native crypto, distributed compute proven)
  • [x] v2.0 — Consciousness (stigmergy, spacetime, wormholes)
  • [ ] v2.5 — ZK proofs, neuromorphic routing, homomorphic computation
  • [ ] v3.0 — Production hardening, monitoring, observability

Contributing

CMP is an open protocol. Contributions welcome.

git clone https://github.com/agentviscro/cmp.git
cd cmp
npm install
npm run test:all   # Make sure everything passes

Areas where help is needed:

  • React Native testing — Run the real protocol on phones via BLE
  • WebGPU integration — GPU compute from WASM sandboxes
  • ZK-SNARK verification — Replace redundant execution with zero-knowledge proofs
  • Production hardening — Rate limiting, monitoring, graceful upgrades
  • Real applications — Build something on CMP and tell us about it

License

MIT — LICENSE