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

@rayspec/adapter-anthropic

v1.8.0

Published

The Anthropic Claude Agent SDK adapter (the abstraction's stress case). Maps the neutral `Backend` interface onto `@anthropic-ai/claude-agent-sdk` (pinned), so the same declared agent runs unchanged on any RaySpec backend adapter.

Readme

@rayspec/adapter-anthropic

The Anthropic Claude Agent SDK adapter (the abstraction's stress case). Maps the neutral Backend interface onto @anthropic-ai/claude-agent-sdk (pinned), so the same declared agent runs unchanged on any RaySpec backend adapter.

Part of RaySpecfile-deployable AI infrastructure: describe a product's backend in one declarative YAML file, and RaySpec stands up accounts and authentication, in-process agents, an HTTP API, a Postgres-backed data layer, durable background jobs, and the supporting tooling — deployed GitOps-style from that single file.

Most projects consume this package indirectly — start with npx rayspec init or @rayspec/server rather than depending on it directly.

Cancelling a run on this backend

Cancelling a run reaches this backend: the run's abort signal is linked to the AbortController this adapter hands the SDK, which is the pinned SDK's documented cancellation mechanism for a plain-string prompt, and the SDK then really does tear the child process down. A test in this package proves that against a live process rather than a flag: it drives the real SDK against a stand-in executable, holds the pid the SDK spawned, and watches it disappear. What that establishes is the SDK's teardown, which is process-level — signals sent to a pid — and not the vendor claude binary's own shutdown behaviour.

These are the limits that come with it. The first three were measured against a real child process on the pinned SDK (0.3.185) or read out of it; the rest are properties of the surrounding platform, or of cancellation in general, rather than of this SDK.

  • Stopping takes seconds, not milliseconds. The SDK ends the child's standard input immediately, waits a two-second grace period, sends SIGTERM to a child still running, and sends SIGKILL five seconds after that. Measured in one run of that test, which prints what it measured: standard input closed 1 ms after the abort, a child that honours SIGTERM gone at 2014 ms, a child that ignores it gone at 7030 ms, and the adapter's own call back at 2008 ms — so no caller waits for the last rung, but the child can outlive the answer by seconds. The two "gone" figures are polled at 25 ms and are indicative of one machine; the test asserts the rungs, not these latencies.
  • A host process that exits inside that window can leave an orphan. The escalation timers are unref()ed, so they do not hold the host process open, and the SIGKILL rung is lost if the host goes away first. The SDK does send SIGTERM to its tracked children from a process-exit hook, so a child that honours it still dies — measured, within a millisecond of a host that exits normally. A child that ignores SIGTERM does not: with the host exiting 200 ms after the abort, it was still running twenty seconds later, when the observation stopped and it had to be killed by hand. A host that is killed outright runs no exit hook at all, so neither child is reached in that case.
  • Only the child itself is signalled. Every rung of the ladder is sent to the pid the SDK spawned, never to a process group — the SDK spawns without detached. Any process that child starts in turn is therefore not reached by cancelling the run.
  • A run executing in a separate worker process receives no signal by default. The signal is delivered in-process, so it only reaches a run executing in the process that holds it. Setting RAYSPEC_RUN_CANCEL_POLL_MS makes that run's own process re-read its cancellation record on the configured interval and raise the abort there, so this adapter is handed the signal after all and every rung above applies as usual; leave it unset and the run keeps going until it returns on its own. Both behaviours are shared by all four backends.
  • A tool call already in flight is not interrupted. The run-level signal is not composed into the per-tool abort, so a handler that had already started runs to its own tool timeout. Its result is discarded, and a non-idempotent tool's taint marker keeps the run quarantined rather than silently re-runnable.
  • Work the child already committed upstream is not undone. Cancellation stops a process; it rolls nothing back.

Links

License

Source-available under the Functional Source License (FSL-1.1-ALv2) — each release converts to Apache-2.0 two years after publication. See LICENSE.