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

iah-localagent

v0.1.0

Published

IAH localagent daemon — runs a Claude-backed agent on your machine and serves IAH page chat over HTTP polling. npx, no Python/uv.

Readme

iah-localagent

Run a localagent on your own machine and chat with it from the IAH web page.

iah-localagent is a small Node/TS daemon (runnable via npx, no Python/uv). It polls IAH for queued chat turns, runs each one through your local claude CLI, and posts the reply back — so the IAH page can talk to an agent that executes on your laptop instead of a cloud pod.

v1 scope: HTTP polling, one turn at a time, text in / text out. No MCP/tools, attachments, install-service, or token streaming (those are deliberately out).

Quick start

# 1. In the IAH web page: add a localagent. It shows a one-time token.
# 2. On your machine:
npx iah-localagent start \
  --server-url http://127.0.0.1:3000 \
  --token <the-one-time-token>

Check your setup without running the loop:

npx iah-localagent doctor --server-url http://127.0.0.1:3000 --token <token>

Options

| flag | env | default | meaning | |---|---|---|---| | --server-url <url> | IAH_LOCALAGENT_SERVER_URL | — | iah-fe base URL | | --token <token> | IAH_LOCALAGENT_TOKEN | — | per-localagent bearer token (shown once when you add it) | | --poll-interval <sec> | | 3 | queue poll cadence | | --ready-interval <sec> | | 20 | heartbeat cadence | | --turn-timeout <sec> | | 540 | per-turn claude timeout (< the 600s server lease) | | --claude-bin <path> | IAH_LOCALAGENT_CLAUDE_BIN | claude | claude executable | | --once | | | run one turn then exit (for testing) | | --debug | | | verbose logging |

The token is never written to logs (only a ***xxxx fingerprint).

How it works

IAH page  ──▶  iah-fe  ──▶  iah backend           this daemon (your machine)
   chat        Bearer       /internal/localagent      ▲  poll = claim
              proxy +       turns queue (lease)        │  GET  /turns/pending
              X-Internal-Secret                        │  run  claude -p
                                                       │  POST /turns/{id}/result
                                                       └──── heartbeat /ready
  • Preflight (start/doctor): refuses to run unless the claude CLI is present and the server accepts the token. A missing CLI or bad token fails loudly at startup instead of hanging a turn later.
  • Poll == claim: GET /api/v1/localagent/turns/pending returns the single claimed turn (or null); the server flips it to running with a lease.
  • Execute: the prompt is piped to claude -p --output-format json (--append-system-prompt when the server sends one). The server model is advisory — the daemon uses your local claude provider config.
  • Report: POST .../turns/{id}/result with {status:"done", output_text} or {status:"error", error_code, error_message}. Errors surface on the page as session.error. Error codes: CLAUDE_NOT_FOUND, CLAUDE_ENV_MISSING, CLAUDE_CLI_FAILED, CLAUDE_BAD_OUTPUT (the server owns EMPTY_REPLY / LOCALAGENT_TIMEOUT).
  • Duplicate / expired / non-running results come back accepted:false and are treated as a normal no-op, not retried.

Develop

pnpm install
pnpm typecheck
pnpm test       # vitest unit tests
pnpm build      # -> dist/bin/iah-localagent.js
node dist/bin/iah-localagent.js --version

Layout: src/{config,protocol,transport,claude-runner,preflight,main-loop,logger}.ts, CLI at src/bin/iah-localagent.ts. Zero runtime dependencies (Node ≥20 built-ins).