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

@centerforagenticai/pi-prompt-graph

v0.2.0

Published

Conditional, cyclic workflow graphs for Pi units.

Downloads

125

Readme

@centerforagenticai/pi-prompt-graph

Kind: extension · Status: experimental · Pi: ^0.85.1 · Node: >=24

Conditional, cyclic workflow graphs for Pi, built from commands, templates, delegated agents, human questions, and state updates.

What it does

pi-prompt-graph loads a Markdown graph from .pi/graphs/ or ~/.pi/agent/graphs/, checks it, and can run it in the current Pi session. A graph routes on node results, so it can express a bounded loop such as implement → verify → implement without asking the agent to remember the loop.

  • Parses long-form YAML frontmatter and a compact arrow shorthand.
  • Checks destinations, terminal reachability, attempt budgets, and routing.
  • Runs template, agent, command, human, and set nodes.
  • Records state and an append-only journal under .pi/runs/<runId>/.
  • Supports static fan-out, joins, artifacts, result projection, resume, run inspection, token accounting, cost ceilings, and per-node tool allowlists.

The status is experimental because the installed /graph run path still has important limits. Its EmbeddedRunner overlaps independent fan-out branches up to the graph's maxConcurrency, while template nodes remain limited to one shared live session. /graph check does not validate template or agent names against a catalogue. Dynamic fan-out and join identity across some cycle laps are not implemented. The command path does not use the concurrent DurableRunner, and the package root does not expose its runtime values. The graph_transition tool checks whether a target is legal but does not yet change the active run.

How it fits

How a graph is checked and run

The extension registers one command and one tool with Pi. The command loader finds a graph file, then the pure parser, compiler, validator, and routing machine turn it into an executable graph. EmbeddedRunner calls only the adapter needed by each node. It commits state, journal records, and declared artifacts to the run directory. The pure layers do not call Pi, a model, the filesystem, a session, or the clock.

Install and enable

Install the public npm package, then restart Pi:

pi install npm:@centerforagenticai/pi-prompt-graph

For one run without installing it:

pi -e npm:@centerforagenticai/pi-prompt-graph

The package manifest enables ./dist/index.js. It needs Pi ^0.85.1 and Node >=24. A graph with template nodes also needs a compatible pi-prompt-template-model extension. An agent node starts a Pi child process from an agent definition found in .agents/, ~/.agents/, .pi/agents/, or ~/.pi/agent/agents/.

Surface

| Kind | Name | Purpose | | --- | --- | --- | | Command | /graph check <name> | Load and compile a graph without running nodes. | | Command | /graph show <name> | Print a Mermaid flowchart for the compiled graph. | | Command | /graph expand <name> | Expand shorthand graph syntax. | | Command | /graph run <name> [--input <json>] | Run a graph through EmbeddedRunner. | | Command | /graph resume <runId> [answer] | Resume a suspended run or answer a human node. | | Command | /graph explain <runId> | Reconstruct the route from its journal. | | Command | /graph inspect <runId> [options] | Inspect bounded run state and journal data. | | Command | /graph status <runId> | Show one bounded status line. | | Command | /graph goto <runId> <node> | Record an operator move in the journal. | | Command | /graph stop <runId> | Record an operator stop in the journal. | | Tool | graph_transition | Check whether a requested transition is legal during an active run. | | Export | @centerforagenticai/pi-prompt-graph | The default Pi extension and its TypeScript contract types. |

It registers no skills.

Configuration

The extension reads no settings file or environment variable. Graph files are its configuration. Project graphs in .pi/graphs/ override same-named user graphs in ~/.pi/agent/graphs/. Run data goes to .pi/runs/ in the current project.

Each graph declares its own nodes, routes, attempt budget, and optional limits. The compiler defaults mode to session, maxConcurrency to 1 in session mode or 4 in orchestrated mode, maxStateBytes to 1048576, and collapse to off. The session runner is sequential; /graph run uses EmbeddedRunner, which applies the graph concurrency limit to independent work and keeps shared template execution sequential. See Write and run a graph for the authoring workflow and the worked examples for complete graphs.

When it runs

The extension loads with Pi and stays idle until /graph or graph_transition is called. It also hooks these Pi events:

  • tool_call enforces the current node's declared tool allowlist.
  • input pauses an active run at the next node boundary when a person or RPC client sends input. Extension-generated input does not pause the run.
  • session_shutdown suspends an active run at the next node boundary.
  • session_start warns once about the newest suspended run under .pi/runs/.

Nodes run only after /graph run or /graph resume. The extension starts no daemon and does no periodic background work.

Develop

The source is maintained in a private repository and published as release snapshots; contributions are welcome as pull requests on GitHub, which maintainers carry into the source repository.

npm install
npm run test:public-package

Documentation

License

MIT. See LICENSE.