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-genaiscript

v0.195.0

Published

Grackle GenAIScript runtime implementation

Readme

@grackle-ai/runtime-genaiscript

Grackle runtime that drives the GenAIScript CLI.

Overview

This package implements the AgentRuntime interface from @grackle-ai/runtime-sdk, letting Grackle run agents authored as GenAIScript programs. It is registered inside PowerLine under the runtime name genaiscript and is selected by any persona whose runtime is set to "genaiscript".

Each session writes the persona's script to a temporary .genai.mjs file and invokes the GenAIScript CLI as a child process (genaiscript run <script> -o <outputDir>). The CLI is one-shot: a session runs the script to completion, streams progress, and then idles — it cannot be resumed and does not accept interactive input. The GenAIScript package is installed lazily into an isolated per-runtime directory the first time it is needed (see Requirements).

Configuration

The runtime takes no static configuration of its own. Behavior is driven by the per-session SpawnOptions supplied by Grackle:

| Field | Type | Description | | --------------- | ---------------- | --------------------------------------------------------- | | sessionId | string | Identifies the session and the temporary script file | | scriptContent | string | The GenAIScript program executed as a .genai.mjs file | | mcpBroker | { url, token } | Optional MCP broker; injected into the script (see below) |

When an MCP broker is present, its URL and token are passed to the script as GenAIScript variables via environment variables, readable inside the script as env.vars.GRACKLE_MCP_URL and env.vars.GRACKLE_MCP_TOKEN:

| Environment variable | Script accessor | | ----------------------------------- | ---------------------------- | | GENAISCRIPT_VAR_GRACKLE_MCP_URL | env.vars.GRACKLE_MCP_URL | | GENAISCRIPT_VAR_GRACKLE_MCP_TOKEN | env.vars.GRACKLE_MCP_TOKEN |

Events

The session streams AgentEvents as the CLI runs:

| Event | Source | | -------- | --------------------------------------------------------------------------------- | | system | Stderr lines from the CLI (progress, console.log output) and lifecycle messages | | text | The script's output text and any annotations, parsed from the CLI's res.json | | usage | Token counts and cost, parsed from res.json when reported | | error | Script annotations marked as errors, non-zero exit, or spawn failures | | status | Final session status — waiting_input on success, failed otherwise |

Models & Credentials

Model selection and provider authentication are handled by GenAIScript itself, not by this runtime. The script declares the model it wants (e.g. via script({ model }) or a model alias), and the GenAIScript CLI resolves the corresponding provider credentials from the process environment / its own configuration (.env, etc.) following GenAIScript's standard conventions. This runtime does not define its own model list and does not read provider API keys directly — it inherits the environment of the PowerLine process it runs in.

See the GenAIScript configuration docs for the supported providers and credential variables.

Requirements

  • Node.js >= 22
  • The GenAIScript CLI — installed automatically on first use into an isolated per-runtime directory (Grackle pins a compatible version)
  • Valid credentials for whichever model provider your scripts target (configured per GenAIScript's conventions)

License

MIT