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

@grackle-ai/runtime-sdk

v0.115.2

Published

Grackle runtime SDK — interfaces, base classes, shared utilities, and runtime installer

Readme

@grackle-ai/runtime-sdk

SDK for building Grackle agent runtimes.

Grackle runs AI coding agents inside environments. Each kind of agent is driven by a runtime: a module that knows how to spawn that particular agent SDK, stream its events, feed it follow-up input, and tear it down. A runtime is to an agent (Claude Code, Codex, Copilot, GenAIScript, ACP) what an adapter is to an environment.

This package provides the interfaces, base classes, and shared utilities you need to write a custom runtime. If you want to drive an agent that isn't covered by the built-in runtimes, implement the AgentRuntime interface (or extend BaseAgentRuntime / BaseAgentSession) and plug it into the Grackle PowerLine.

Built-in Runtime Packages

Install

npm install @grackle-ai/runtime-sdk

Key Concepts

Runtimes

A runtime is a class that implements the AgentRuntime interface. It tells Grackle how to:

  • Spawn — create and start a new agent session from a set of SpawnOptions (prompt, model, max turns, branch, MCP servers, and more).
  • Resume — reattach to a previously suspended session using its runtime session ID.

Both spawn() and resume() return an AgentSession.

Sessions

An AgentSession is a handle to an in-progress agent run. It exposes:

  • stream() — an async iterable of AgentEvents emitted as the agent works.
  • sendInput(text) — send follow-up user input to a session that is waiting for it.
  • kill(reason?) — forcefully terminate the session.
  • drainBufferedEvents() — collect any events that were buffered but not yet consumed by the stream.

Each AgentEvent carries a type, timestamp, content, and optional raw payload.

Base Classes

Most runtimes don't implement these interfaces from scratch. The SDK ships two abstract base classes that encode the shared lifecycle so a new runtime only needs to fill in the SDK-specific pieces:

  • BaseAgentRuntime — implements spawn() and resume() by delegating to a single createSession() method you supply.
  • BaseAgentSession — implements the full event-queue and waiting_input lifecycle: streaming, sequential follow-up processing, status transitions, and teardown. Subclasses implement abstract hooks such as setupSdk(), runInitialQuery(), executeFollowUp(), and abortActive().

Shared Utilities

  • Working directory & worktreesresolveWorkingDirectory() and findGitRepoPath() locate the right git repository (honoring Docker /workspace and Codespaces /workspaces/* conventions) and prepare it for the session. The lower-level ensureWorktree() / removeWorktree() helpers create and clean up per-branch git worktrees for isolation.
  • MCP configurationresolveMcpServers() merges MCP server configs from the shared GRACKLE_MCP_CONFIG file and spawn options, applies disallowedTools filtering, and injects the Grackle MCP broker entry. convertMcpServers() translates Grackle's keyed config into the named-array format expected by ACP agents.
  • Runtime installerensureRuntimeInstalled() lazily installs a runtime's npm packages into an isolated ~/.grackle/runtimes/<name>/ directory, importFromRuntime() dynamically imports modules from it, and getRuntimeBinDirectory() exposes the runtime's .bin path for spawning agent CLIs.
  • AsyncQueue — a small AsyncIterable queue used to bridge pushed events into for await consumers, with push, shift, drain, and close.
  • logger — a shared pino structured logger.

Requirements

  • Node.js >= 22

License

MIT