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

@anureo/adapter-ahp

v0.3.16

Published

External AHP harnesses over stdio or WebSocket for the Anureo SDK. Requires Bun or compatible TypeScript build tooling.

Readme

@anureo/adapter-ahp

Adapter connecting the Anureo SDK to external harnesses that implement AHP over stdio or WebSocket. These harnesses can themselves be built with the Anureo SDK.

Part of the Anureo SDK workspace. Install with npm install @anureo/adapter-ahp.

Usage

The examples below use the revised workspace API, which differs from the published 0.2.0 API. The protocol major remains 1, but external peers must upgrade together and reject mismatched lifecycle capabilities during initialization.

import { createClient } from '@anureo/sdk'
import { createAhpAdapter } from '@anureo/adapter-ahp'

const client = await createClient({
  adapter: createAhpAdapter({ command: 'my-harness', args: ['serve'] }),
  identity: { adapterId: 'ahp', runtimeConfigId: 'local' },
})
try {
  const session = await client.sessions.create({ cwd: process.cwd() })
  const turn = await session.submit({ input: 'Inspect the workspace.' })
  console.log(await turn.result())
  await session.close()
} finally {
  await client.dispose()
}

A standalone revised-v1 reference harness lives in examples/reference.ts; its stdio and WebSocket paths are exercised by the adapter tests.

Behavior the adapter enforces

  • Version handshake. initialize negotiates major 1 and requires protocolContract: "native-lifecycle" in both directions; every request and result is validated against the protocol schema before use.
  • Sequence integrity. Events carry (sessionId, streamId, seq). A gap in the sequence is repaired only when the harness negotiated x-anureo/event-replay@1 (via x-anureo/events/read); otherwise the stream fails with SOURCE_SEQUENCE_GAP instead of presenting a hole as complete history.
  • Session metadata. Delivered through the negotiated x-anureo/session-metadata@1 extension; the adapter always requests it and ignores duplicated metadata from other channels.
  • Interactions. interaction/requested is answered through interaction/respond / interaction/cancel; the adapter forwards the answer over the wire and surfaces remote resolutions (interaction/resolved) without double-answering.
  • Unknown notifications. Native notifications outside the AHP event set are converted to safe notice events with the raw (redacted) payload attached — a future-proofing harness cannot crash the host.
  • Connection loss. A closed transport fails every open session sink and rejects pending responses with outcomeUnknown-carrying errors; no session continues silently on a dead wire.

Exports

| Entry | Contents | |---|---| | @anureo/adapter-ahp | createAhpAdapter, AhpAdapterOptions, AhpAdapter, AhpWire, AhpTransport, createStdioTransport, createWebSocketTransport | | @anureo/adapter-ahp (wire) | AhpWire — the JSON-RPC 2.0 client with per-request timeouts, frame-size limits (maxFrameBytes, default 8 MiB), pending-request limits (maxPending, default 256), and notification backlog bounds (maxNotifications, default 2048) |

createWebSocketTransport deliberately restricts addresses: ws: is only accepted for loopback hosts (127.0.0.1, localhost, [::1]), credentials, query strings, and fragments in URLs are rejected, and the socket's buffered amount is bounded — remote or authenticated transports must bring their own factory via options.connect.

Development

cd packages/adapter/ahp
bun run typecheck
bun test tests

Documentation

AHP v1 lifecycle revision

The lifecycle design updates AHP v1 and package root entries in place. Root migration and local validation are complete: the root implementation and tests use the revised lifecycle, and parallel versioned entries have been removed. Local conformance and clean-install checks have passed. See the design and implementation plan.