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-controller/runtime

v0.5.0

Published

Pi runtime adapter for agent-controller — runs an ADL CompiledSpec against a Pi session and emits the NDJSON wire-event stream.

Downloads

563

Readme

@agent-controller/runtime — Pi runtime adapter

Node/TypeScript adapter that runs an agent-controller CompiledSpec against a Pi session and emits the NDJSON wire-event stream that agentctl consumes. This is the original / production adapter; the opencode adapter (@agent-controller/runtime-opencode) is the v0.2 sibling.

Requires Node 22.19.0+@earendil-works/pi-ai and @earendil-works/pi-coding-agent declare engines.node: ">=22.19.0" (the nested undici they ship needs that floor). Older Node 22.x will install but is outside the supported range.

Install

npm install -g @agent-controller/runtime
# or per-project
npm install --save-dev @agent-controller/runtime

Use with agentctl

agentctl (the Go CLI) spawns this package as a subprocess. The example specs under examples/ reference cwd-relative registry entries (tools/, extensions/, skills/, agents/) that ship with the source repo but not with this npm package. For an npm-only install, use a self-contained spec:

# 1) Write a self-contained spec (no tools[]/extensions[]/skills[]/subagents[])
cat > /tmp/hello.yaml <<'EOF'
apiVersion: agent-controller.dev/v1alpha1
kind: Agent
metadata: { name: hello }
spec:
  model: { provider: anthropic, name: claude-sonnet-4-20250514 }
  persona: { role: Helpful demo, instructions: Answer concisely. }
  task: Say hello.
  tools: []
  runtime: { type: local }
EOF

# 2) Point agentctl at the adapter and run
export ANTHROPIC_API_KEY=sk-ant-...

# global install
AGENT_CONTROLLER_RUNTIME="$(npm root -g)/@agent-controller/runtime/dist/index.js" \
  agentctl run /tmp/hello.yaml

# or per-project (from a directory with the package in node_modules)
AGENT_CONTROLLER_RUNTIME="./node_modules/@agent-controller/runtime/dist/index.js" \
  agentctl run /tmp/hello.yaml

Without AGENT_CONTROLLER_RUNTIME, agentctl run looks under <cwd>/runtime/dist/index.js — the source-clone-and-build install path.

agentctl (matching version) is available from the GitHub Releases page as cross-platform binaries.

Architecture role

This package is the subprocess spawned by agentctl run when spec.runtime.type is local or local-pi. It:

  1. Reads a CompiledSpec JSON document from stdin
  2. Constructs Pi's DefaultResourceLoader from the spec (skills paths, agent files, MCP config)
  3. Materializes <cwd>/.pi/mcp.json and <cwd>/.pi/agents/*.md for Pi's loaders
  4. Auto-installs spec.extensions[].source packages on demand
  5. Builds the system prompt: honesty preamble + persona + role + skill bodies
  6. Calls createAgentSession + session.prompt
  7. Translates Pi's internal events into the wire-protocol NDJSON envelope
  8. Runs the runtime-side hallucination detector on assistant messages

Environment variables

| Variable | Effect | |---|---| | AGENT_CONTROLLER_EXT_CONFIG | Per-extension config blob (set by adapter from spec.extensions[].config) | | AGENT_CONTROLLER_USE_FAKE_PROVIDER | If 1, the adapter loads the test fake-provider before starting the session (Layer-1 E2E only) | | AGENT_CONTROLLER_NO_AUTO_INSTALL | If 1, auto-installation of spec.extensions[].source is disabled; missing packages fail fast | | ANTHROPIC_BASE_URL | Forwarded to Pi for model gateway override | | AC_PI_BIN | Path to the pi CLI for subagent process spawning (set by the adapter when subagents exist) | | PI_CODING_AGENT_DIR | Pi's project-local config dir; isolated under a temp dir in tests |

What this adapter does NOT cover

Building from source

git clone https://github.com/CCDevelopForFun/agent-controller.git
cd agent-controller/runtime
npm install --ignore-scripts
npm run build           # tsc → dist/
npm test                # vitest

--ignore-scripts is important: Pi's nested install hook will otherwise try to set up the user's ~/.pi directory.

Cross-references

License

MIT — see LICENSE.