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

@agent-relay/harnesses

v11.8.3

Published

Pre-built harness definitions for Agent Relay.

Readme

@agent-relay/harnesses

Pre-built harness definitions for local coding agents. Requires Node.js 22 or newer.

Use this package with @agent-relay/harness-driver when Agent Relay should create or supervise managed sessions.

Runtime selection

Claude Code, Codex, and OpenCode offer both an official AI SDK native harness runtime and the existing PTY runtime. Their adapters begin as experimental, so auto continues to select PTY until each adapter passes its promotion gates.

import { claude } from '@agent-relay/harnesses';

await claude.create({ relay }); // auto: PTY while the adapter is experimental
await claude.create({ relay, runtime: 'native' }); // explicit native harness runtime
await claude.create({ relay, runtime: 'pty' }); // explicit terminal runtime

Runtime selection is final before the session starts. Relay does not switch a running session between PTY and AI SDK.

| Harness | AI SDK adapter | PTY | Initial selection | | --------------- | ------------------------------------ | --- | ---------------------------------------- | | Claude Code | @ai-sdk/[email protected] | yes | PTY; native is explicit and experimental | | Codex | @ai-sdk/[email protected] | yes | PTY; native is explicit and experimental | | OpenCode | @ai-sdk/[email protected] | yes | PTY; native is explicit and experimental | | Pi | @ai-sdk/[email protected] | no | explicit experimental native | | Deep Agents | @ai-sdk/[email protected] | no | explicit experimental native | | Other built-ins | none | yes | PTY |

Pi and Deep Agents require runtime: 'native' while experimental. Deep Agents does not advertise manual compaction, and stopping its current adapter does not preserve in-memory conversation.

Harness execution is pty or native. The broker may internally wrap native harnesses and attached app servers as headless processes, but headless is not an observability mode. Both execution paths publish the same normalized AgentEvent contract.

Native sessions receive authenticated Agent Relay host tools and collaboration instructions at startup. They can discover agents and channels, check or search messages, send DMs, post to channels, and reply to threads without relying on a provider-global MCP configuration or extra prompting from the user.

Native harness attach

AI SDK sessions expose agent-event history and live events instead of terminal bytes:

agent-relay node agent attach my-agent --mode view
agent-relay node agent attach my-agent --mode drive
agent-relay node agent attach my-agent --mode view --json
agent-relay node agent attach my-agent --mode view --reasoning --diagnostics

view is read-only. drive sends each input line after broker acknowledgement; /interrupt, /approve <id>, /reject <id>, and /detach are local controls. passthrough is unavailable because a native harness session has no terminal byte stream. --json writes normalized NDJSON to stdout. Reasoning and diagnostics stay hidden unless requested.

Observability

The AI SDK stream is Relay's reference observability profile. Relay publishes portable agent events and the activities starting, thinking, typing, using_tool, waiting, idle, and error. Every event carries its source and either exact or inferred fidelity.

PTY sessions use the same capability matrix. Today the broker provides exact startup and runtime failure plus inferred busy and idle boundaries. Signals that terminal bytes cannot prove, including reasoning, text blocks, tools, approvals, files, and compaction, are reported as unavailable rather than guessed.

Another Relay application can inspect events successfully accepted into Relaycast's durable agent log through the messaging surface:

const activity = await relay.messaging.sessionEvents?.list('my-agent', {
  type: 'activity.changed',
  limit: 100,
});

The broker owns PTY publication for every spawn surface. A managed create({ relay }) call additionally mirrors those broker events into listeners on that local AgentRelay instance.

Hosted publication is operational observability, not a lossless audit ledger. The broker preserves order through a bounded publisher queue and logs queue, timeout, and Relaycast failures locally; events can be absent during a sustained outage or broker crash.

Local-host security and troubleshooting

The AI SDK local-host provider is a process and filesystem lifecycle boundary, not an operating-system sandbox. It rejects lexical traversal and static symlink escapes on a best-effort basis for adapter file operations, holds bridge ports on loopback until handing them to the adapter process, and terminates only child processes it started. Concurrent filesystem mutation by another process is outside this boundary, so the path guard is not TOCTOU-safe and must not be used as isolation for untrusted code.

The local-host AI SDK runtime currently supports macOS and Linux. On Windows, use the PTY runtime; an explicit native selection fails with a typed platform error instead of attempting POSIX adapter bootstrap commands. Preflight checks the platform, Node.js 22, pnpm, workspace access, cache access, and loopback port allocation. If startup fails, verify those commands and permissions first. Bootstrap work is cached by stable adapter identity under the runtime cache; deleting unrelated workspace files is never part of cleanup.

Adapter upgrades must keep the @ai-sdk/[email protected] family coherent and pass the registry, lifecycle, agent-event replay, observability, real-CLI, and 100-cycle soak contracts before changing an adapter's rollout state.