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

paratext-envelope

v0.1.0

Published

Cognitive metadata middleware for agent-to-agent communication. Generates register, confidence, and intent metadata for each clause using multilingual routing.

Readme

paratext-envelope

Cognitive metadata middleware for agent-to-agent communication.

When AI agents talk to each other, they lose all the metadata about how something was said -- confidence, cognitive register, intent. Paratext Envelope generates a JSON metadata sidecar that travels alongside agent messages, telling the receiving agent what the sending agent's language reveals about its reasoning.

Install

npm install paratext-envelope

Requires an Anthropic API key. The package uses Claude's multilingual capabilities to generate cognitive routing metadata.

Quick Start

import { generateEnvelope } from 'paratext-envelope';

const envelope = await generateEnvelope(
  "The infrastructure costs will exceed projections by 15%, but the team feels confident they can absorb it through Q3 optimization."
);

console.log(envelope.message_meta.dominant_register); // "precision"
console.log(envelope.message_meta.overall_confidence); // 0.91
console.log(envelope.clauses[0].register.selected);    // "precision"
console.log(envelope.clauses[1].register.selected);    // "relational"

What It Does

The pipeline segments text into cognitive clauses, routes each clause through 6 languages in parallel (German/precision, Spanish/embodiment, French/nuance, Japanese/relational, Portuguese/warmth, English/baseline), and scores which language each thought most naturally lives in. Those scores become the metadata.

The envelope format:

{
  "paratext_version": "0.1",
  "content": "original text",
  "clauses": [{
    "text": "clause text",
    "register": {
      "selected": "precision",
      "source_language": "de",
      "confidence": 0.91,
      "perplexity_differential": 5.4
    },
    "cognitive_mode": "analytical",
    "intent": "assertion",
    "weight": 0.91
  }],
  "message_meta": {
    "overall_confidence": 0.85,
    "dominant_register": "precision",
    "register_distribution": { "precision": 0.36, "embodiment": 0.33 },
    "cognitive_coherence": 0.67
  }
}

Why

Two agents given the same research findings produce measurably different briefings when one has the paratext envelope. Specifically:

  • "likely 25-30%" became "18-30%" -- the agent with metadata widened uncertainty ranges to match actual confidence scores
  • "broken integration" became "systematic failure to integrate" -- the agent matched the precision register instead of dramatizing
  • Isolated risk tiers became compound risk scenarios -- register shifts signaled where the source moved from data to gut feeling

Options

const envelope = await generateEnvelope(text, {
  model: 'claude-sonnet-4-5-20250929',  // default
  onProgress: (step, detail) => {
    console.log(step, detail);
  },
});

Summarize

import { generateEnvelope, summarizeEnvelope } from 'paratext-envelope';

const envelope = await generateEnvelope(text);
const summary = summarizeEnvelope(envelope);
// Returns a compact version with just register, confidence, mode, intent per clause

CLI

npx paratext "Your text here"
npx paratext --json "Your text here"
npx paratext --file input.txt
npx paratext --output result.json "Your text here"

API Server

The package includes an Express server for HTTP access:

node node_modules/paratext-envelope/src/server.mjs

# POST http://localhost:3000/envelope
curl -X POST http://localhost:3000/envelope \
  -H "Content-Type: application/json" \
  -d '{"text": "Your text here"}'

# GET http://localhost:3000/health

Environment

Set ANTHROPIC_API_KEY in your environment or .env file.

License

MIT