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

@nanocodana/core

v0.2.0

Published

The NanoCodana agent engine — file tools, a virtual shell, Agent Skills, MCP, and tool-approval gating over any filesystem. Built on the Vercel AI SDK.

Readme

@nanocodana/core

The NanoCodana agent engine — the agent loop, the file tools, a virtual shell, Agent Skills, MCP, and tool-approval gating, built on the Vercel AI SDK.

It imports no Node builtins and touches no DOM, so it runs wherever JavaScript does — a serverless function, an edge runtime, a container, a remote sandbox, or embedded in your own app — over whatever storage you hand it.

Most apps want an adapter instead: @nanocodana/browser (in-tab, IndexedDB) or @nanocodana/nodejs (real disk). Reach for core when the filesystem is yours.

npm install @nanocodana/core ai

Bring your own filesystem

import { NanoCodana } from '@nanocodana/core'

const agent = new NanoCodana({
  model,
  fs: myFileSystem,      // any IFileSystem
  // or: sandbox: mySandbox
})

const result = await agent.stream({
  messages: [{ role: 'user', content: 'Add a health check route.' }],
})

for await (const chunk of result.fullStream) {
  if (chunk.type === 'text-delta') process.stdout.write(chunk.text)
}

Or seed files and persist the changes

You usually don't need to implement a filesystem. Seed the built-in in-memory FS and mirror every edit back to your store — content may be a function (sync or async) so a large project hydrates lazily, one file per actual read:

const paths = await db.listPaths(projectId)        // cheap: names only

const agent = new NanoCodana({
  model,
  initialFiles: paths.map((path) => ({
    path,
    content: () => db.readFile(projectId, path),   // fetched on first read
  })),
  onFilesChange: (changes) => persist(projectId, changes),
})

What you get

Read · Write · Edit · MultiEdit · Delete · Glob · Grep · LS · TodoWrite · a virtual Bash, plus optional GenerateImage, MCP tools, and Anthropic-style Agent Skills discovered from the agent's own filesystem. Automatic Anthropic prompt caching is on by default.

The shell

Bash is a real POSIX-ish shell running against the agent's filesystem — no child processes, no host access. Core ships a Node-free build of it, so this package loads unmodified on Cloudflare Workers, in a browser, and anywhere else JavaScript runs, with no bundler configuration and no nodejs_compat.

The trade: commands needing native or wasm backends are unavailable here — sqlite3, python3, js-exec and tar throw. Everything else works normally, including gzip, gunzip, zcat and rg -z, which the Node-free build implements without node:zlib. @nanocodana/nodejs uses the full shell and has all of them.

Need the agent but not the shell? Import @nanocodana/core/no-bash — the same API without the bundled shell (~1.2 MB).

Configure it by passing an object instead of a boolean:

new NanoCodana({ model, virtualBash: { env: { CI: '1' }, maxCommandCount: 500 } })

Set virtualBash: false to drop the tool entirely.

Size

Installing this package pulls 59 MB across 112 packages, and essentially all of it is the AI SDK — @ai-sdk/* 15 MB, ai 10 MB, zod 7 MB, the MCP SDK 6 MB. The shell is not among them: it is vendored into this package as a single pre-built file, so just-bash and its ~78 MB of runtimes never enter your tree.

What reaches a browser is smaller again, because the shell is loaded through a dynamic import and every code-splitting bundler puts it in its own chunk:

| | raw | gzipped | |---|---|---| | initial load | 616 kB | 182 kB | | shell chunk, on first Bash call | 1,221 kB | +338 kB |

Measured on a real app. Someone who never runs a command never downloads the shell. To drop it from the build entirely rather than deferring it, import @nanocodana/core/no-bash — on a Cloudflare Worker that is 854 KiB → 448 KiB gzipped.

Note that virtualBash: false does not shrink a single-file build: no bundler can eliminate a reachable dynamic import based on a runtime flag. It stops a splitting bundler fetching the chunk; only changing the import removes the bytes.

Running on Node? See @nanocodana/nodejs, which documents its own larger footprint and how to prune it.

Docs: https://nanocodana.github.io/docs/core/ · MIT