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

@a9650615/claude-acp-kit

v0.2.1

Published

Generic Claude ACP (Agent Client Protocol) library — build agents fast with batteries included: auth, usage, permissions, tools, MCP supervision.

Readme

@a9650615/claude-acp-kit

Generic Claude ACP (Agent Client Protocol) library — batteries-included primitives so a new agent project can ship in minutes instead of weeks.

Status: 0.1.0 – pre-release. API surface is stabilizing; expect minor breakages until 1.0.

Why

Every Claude agent needs the same plumbing: JSON-RPC framing over stdio, session lifecycle, permission flow, credential detection, usage tracking, MCP supervision, structured logging. This library packages all of that with strict types and zero magic, so your project only writes the parts that are actually unique.

Features

| Feature | What it does | | ------------------------- | --------------------------------------------------------------------- | | AcpServer | NDJSON JSON-RPC dispatch loop with typed handlers | | Sessions | Lifecycle, persistence, mode switching, cancellation | | Auth detector | Reads ~/.claude/.credentials.json, watches mtime, sniffs 401s | | Login helper | Shells to claude /login and waits for refreshed creds | | Usage tracker | Wraps ccusage for session/daily/monthly; in-process token counter | | Budget gate | Per-session caps + alert hooks | | Permissions | allow_once / allow_always / reject_* policy + audit log | | Tools registry | Zod-validated tool definitions, typed executor | | MCP supervisor | Spawn, restart, health-check stdio MCP servers | | Backoff/retry | Exponential w/ jitter for 429/529 | | Cancellation | Propagates session/cancel to in-flight work | | Logger | pino-based, session_id correlation | | Heartbeat | Health checks + auto-reconnect |

Install

npm install @a9650615/claude-acp-kit
# optional: enable ccusage integration
npm install ccusage

Try it without installing

npx @a9650615/claude-acp-kit doctor                                    # environment check
npx @a9650615/claude-acp-kit init my-agent && cd my-agent && npm i     # scaffold an agent
npx @a9650615/claude-acp-kit usage daily --since 2026-01-01            # ccusage report
npx @a9650615/claude-acp-kit skills list                               # discover ~/.claude/skills
npx @a9650615/claude-acp-kit serve ./agent.ts                          # run an agent file

Subcommands documented in src/cli/README.md.

Quickstart

import { AcpServer, Transport, createLogger } from "@a9650615/claude-acp-kit";

const { StdioTransport } = Transport;

const logger = createLogger({ level: "info" });
const transport = new StdioTransport({ logger });

const server = new AcpServer({
  transport,
  logger,
  agent: {
    async prompt(ctx, params) {
      ctx.emit({
        sessionUpdate: "agent_message_chunk",
        content: { type: "text", text: "hello!" },
      });
      return { stopReason: "end_turn" };
    },
  },
});

await server.start();

This matches examples/minimal-agent verbatim (modulo the relative imports we use to build pre-publish). See examples/ for the full set, including a richer agent wired with usage tracking, budget gating, permissions, and a tool registry.

Documentation

| For | Read | | --- | --- | | First-time setup | docs/GETTING_STARTED.md | | Per-feature usage | docs/USAGE.md | | Copy-paste patterns | docs/RECIPES.md | | Common gotchas | docs/FAQ.md | | Git flow + agent handoff | docs/GIT_FLOW.md | | Module architecture | ARCHITECTURE.md | | Each module's API | src/<module>/README.md |

Architecture

See ARCHITECTURE.md for module boundaries, interface contracts, and ADRs.

For agents (human or AI) working on this repo

Read AGENTS.md first. It is the canonical rule sheet for module ownership, the non-contamination contract, the git/npm boundaries, and the documentation duties. A pre-commit import guard (scripts/check-imports.mjs) enforces module boundaries mechanically.

Project layout

acp_base_lib/
├── src/
│   ├── server.ts             # AcpServer dispatch
│   ├── transport/            # stdio NDJSON JSON-RPC
│   ├── protocol/             # wire types + zod schemas
│   ├── session/              # session lifecycle
│   ├── auth/                 # cred detect + login
│   ├── usage/                # ccusage + tracker
│   ├── tools/                # registry + executor
│   ├── permissions/          # gate + policy
│   ├── mcp/                  # MCP child-process supervisor
│   ├── logging/              # pino logger
│   ├── errors/               # normalized JSON-RPC errors
│   ├── utils/                # backoff, cancellation, events
│   └── config/               # env + file loader
├── examples/
├── docs/
│   ├── adr/                  # architectural decision records
│   └── work-log/             # per-module dev journals
└── .github/workflows/        # CI + release

Development

npm install
npm run typecheck
npm run lint
npm run test
npm run build

Per-module work logs

Every module owner appends to docs/work-log/<module>.md when shipping work. Captures intent, tradeoffs, and follow-ups. Don't skip — that log is how a future contributor (or you in six months) understands a non-obvious choice.

Contributing

Read CONTRIBUTING.md. Conventional commits enforced via lefthook. Releases via changesets.

License

MIT