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

@moikapy/kapy-script

v0.1.2

Published

The AI-native programming language. A kapy CLI extension for compiling, running, and testing .kapy files.

Readme

kapy-script

The AI-native programming language. Designed for agent authorship, clean enough for anyone.

CI npm: @moikapy/kapy-script npm: @moikapy/kapy-runtime License: MIT

v0.1 — 239 tests, 0 failures. Production-compiled, designed for humans.

Install

# Standalone CLI
npm install -g @moikapy/kapy-script
kapy run hello.kapy

# Or as a @moikapy/kapy extension
bun install -g @moikapy/kapy
kapy install @moikapy/kapy-script

Quick Start

fn greet
  input name: string
  output string
  "Hello, {name}!"
kapy init my-project
cd my-project
kapy run src/main.kapy
# → Hello from my-project!

The Language

Functions (all async)

fn add
  input a: number
  input b: number
  output number
  a + b

Every function is async. No await, no async — I/O is implicit.

Result type

result = json.parse('{"key": "value"}')
result?      # Unwrap Ok, propagate Err
result!      # Unwrap Ok, crash on Err

Pattern matching

sealed trait Result
  case Ok(value: any)
  case Err(message: string)

match result
  Ok(v) -> v
  Err(e) -> handle_error(e)

Agents

agent ResearchAgent
  input query: string
  output Report

  tools
    search_web, read_document

  steps
    search_web(query) -> sources
    return sources

Standard library

import kapy/http        # HTTP client (get, post, put, del)
import kapy/fs           # File system (readFile, writeFile, exists)
import kapy/json         # JSON with Result types (parse, stringify)
import kapy/ai           # AI providers (OpenAI, Anthropic, Ollama)
import kapy/ai/chain     # LLM chaining (run, parallel, mapReduce)
import kapy/web/router   # HTTP server (create, get, post, listen)
import kapy/test          # Test assertions (assertEqual, assertTrue, ...)

# Escape braces in strings
text = "\{ \"hello\": 1 \}"
result = json.parse(text)

Commands

| Command | Description | |---------|-------------| | kapy run <file> | Compile and execute a .kapy file | | kapy run --watch <file> | Re-run on file changes | | kapy check <file> | Parse and type-check | | kapy fmt <file> | Format a .kapy file | | kapy fmt --check <file> | Check formatting | | kapy lint <file> | Lint for common issues | | kapy lint --strict <file> | Treat warnings as errors | | kapy test [path] | Run test declarations | | kapy init <name> | Scaffold a new project | | kapy repl | Interactive REPL |

Version Features

| Feature | v0.1 ✅ | v0.5 🔜 | |---------|---------|---------| | Functions, agents, sealed traits | ✅ | | | Pattern matching | ✅ | | | Result type with ? and ! | ✅ | | | Import, print, test | ✅ | | | HTTP, FS, JSON, AI providers | ✅ | | | Router, LLM chaining, test assertions | ✅ | | | Trait method dispatch | | 🔜 | | Exhaustiveness checking | | 🔜 | | Union & intersection types | | 🔜 | | Package manager | | 🔜 |

Stats

  • 37 source files, ~7,680 lines
  • 239 tests, 467 assertions
  • 7 example files (hello, greet, divide, result, agent, cli-tool, web-api)

Project Structure

src/
  lexer/        Tokenizer (indentation-aware, string interpolation)
  parser/       Recursive descent parser → AST
  typechecker/  Local type inference, ADTs, version-gated warnings
  transpiler/   AST → TypeScript emitter with source maps
  runtime/      @moikapy/kapy-runtime (Result, llm, embed, print, stdlib)
  cli/          Standalone CLI (run, check, test, init, repl, fmt, lint)
  extension/    @moikapy/kapy-script kapy extension
test/           13 test files
examples/       7 .kapy example files

Contributing

See CONTRIBUTING.md.

License

MIT — see LICENSE.