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

coaiajs

v0.1.0

Published

CoAIA unified TypeScript monorepo — CLI, MCP server, and library consolidating coaia-narrative, coaia-pde, coaia-planning, and coaiapy patterns into one package.

Readme

coaiajs

CoAIA unified TypeScript monorepo — CLI, MCP server, and library consolidating coaia-narrative, coaia-pde, coaia-planning, and coaiapy patterns into a single package.

What is this?

coaiajs is the TypeScript consolidation of the CoAIA (Creative Orientation AI Architecture) ecosystem. It unifies four previously separate projects:

| Origin Project | What it did | Where it lives now | |---|---|---| | coaia-narrative | JSONL knowledge graph, structural tension charts, narrative beats | src/narrative/ | | coaia-pde | Prompt Decomposition Engine | src/pde/ | | coaia-planning | Action planning, structural tension chart management | src/planning/ | | coaiapy | Python CLI with Redis, LLM, audio, GitHub, config, environment | src/ (core modules) |

The shared type system in src/types.ts is the union of all four projects.

Installation

# Clone and install
cd coaiajs
npm install

# Build
npm run build

Requirements

  • Node.js >= 20.0.0
  • TypeScript >= 5.7

Usage

CLI

# Run the CLI
npx coaia <command>

# Or after global install
coaia <command>

MCP Server

# Start the MCP server (for Claude, Copilot, etc.)
npx coaiajs-mcp

# Or via npm script
npm run mcp

Library

import { readConfig } from 'coaiajs/src/config.js';
import { tash, fetch } from 'coaiajs/src/redis.js';
import { llm } from 'coaiajs/src/llm.js';
import { createEnvironment } from 'coaiajs/src/environment.js';
import type { Entity, DecompositionResult, CoaiaConfig } from 'coaiajs/src/types.js';

Configuration

Configuration is loaded with the following priority (highest wins):

  1. Environment variablesREDIS_URL, OPENAI_API_KEY, LANGFUSE_PUBLIC_KEY, etc.
  2. .env file — in current working directory
  3. coaia.json — searched in ./coaia.json, ~/coaia.json, ~/.coaia/config.json
  4. Defaults

Environment Variables

| Variable | Description | |---|---| | REDIS_URL | Redis connection URL | | OPENAI_API_KEY | OpenAI API key | | LANGFUSE_PUBLIC_KEY | Langfuse public key | | LANGFUSE_SECRET_KEY | Langfuse secret key | | AWS_ACCESS_KEY_ID | AWS credentials for Polly | | GITHUB_TOKEN | GitHub API token |

coaia.json

{
  "redis": { "url": "redis://localhost:6379" },
  "openai": { "apiKey": "sk-...", "model": "gpt-4o" },
  "langfuse": { "publicKey": "pk-...", "secretKey": "sk-..." },
  "github": { "token": "ghp_..." }
}

Project Structure

coaiajs/
├── src/                    # Core library and CLI
│   ├── types.ts            # Shared type definitions (union of all projects)
│   ├── config.ts           # Configuration management
│   ├── redis.ts            # Redis tash/fetch operations
│   ├── environment.ts      # Environment variable management
│   ├── llm.ts              # OpenAI LLM wrapper
│   ├── audio.ts            # AWS Polly text-to-speech
│   ├── github.ts           # GitHub API wrapper
│   ├── cli.ts              # CLI entry point
│   ├── langfuse/           # Langfuse observability integration
│   ├── narrative/          # Knowledge graph, STC, narrative beats
│   ├── pde/                # Prompt Decomposition Engine
│   ├── planning/           # Action planning and STC management
│   └── pipeline/           # Pipeline template engine
├── mcp/                    # MCP server
│   ├── server.ts           # MCP server entry point
│   └── tools/              # MCP tool definitions
├── tests/                  # Test files
├── articles/               # Documentation articles
└── rispecs/                # RISE specification files

Development

# Watch mode
npm run dev

# Type checking without emit
npm run lint

# Run tests
npm test

Architecture

The architecture follows the Structural Tension pattern from Robert Fritz's creative process framework:

  • Desired Outcome — what you want to create
  • Current Reality — honest assessment of where you are
  • Action Steps — telescoped sub-charts bridging the gap

Each module operates independently but shares the unified type system (src/types.ts), enabling the MCP server to expose all capabilities through a single protocol.

License

MIT