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

pi-echo-plan-mode

v0.1.0

Published

Read-only plan mode with a model-callable approval gate, sharing pi-echo-core's mode state with pi-echo-permissions

Readme

pi-echo-plan-mode

Read-only exploration mode with a model-callable approval gate, adapted from Pi's own official plan-mode example.

Design note

pi-echo-plan-mode uses pi.setActiveTools()/pi.getActiveTools() as its primary mechanism, pi.on("before_agent_start") for system-prompt injection, pi.on("context") only for stale-message filtering, and pi.appendEntry/ctx.sessionManager.getEntries() for session-resume reconstruction — all lifted near-verbatim from Pi's official example. The one real change: the on/off flag lives in pi-echo-core's shared state.json mode field instead of a private closure boolean, so /plan flips the same mode pi-echo-permissions enforces. It deliberately does not implement its own permission-enforcement layer (that's pi-echo-permissions' job, via the shared mode flag) and does not attempt a fully general "plan quality" check — extractTodoItems's regex-based "Plan:" parser is a heuristic fallback for models that describe a plan without calling exit_plan_mode, not a guarantee of a coherent plan.

Composition with pi-echo-permissions

setActiveTools() is the primary enforcement (the model never even sees edit/write as callable while plan mode is on — cheapest, best UX). pi-echo-permissions' plan-mode branch in evaluate() is a deliberate backup, not redundant: it covers cases the tool-swap can't (a call already in flight when /plan is invoked mid-turn, an unknown custom/MCP tool this package has no reason to know about, or a state-sync bug). Neither package imports the other — pi-echo-core's state.json is the entire integration contract.

Usage

/plan            # toggle plan mode
/todos           # show the current plan's todo list
Ctrl+Alt+P       # toggle plan mode (shortcut)

While in plan mode, the model has access to read/bash/grep/find/ls/exit_plan_mode only; bash is further restricted to a read-only allowlist. The model is instructed to write a numbered Plan: section and then call exit_plan_mode with the full plan text to request approval — approving flips the shared mode back to whatever it was before plan mode was entered (see below) and restores full tool access. If the model describes a plan in prose without calling the tool, an agent_end fallback (matching the official example) offers to execute/refine/stay via a ctx.ui.select prompt.

A real bug found on review, fixed

Exiting plan mode used to always set the mode back to "manual", unconditionally. If a project's normal working mode was acceptEdits or dontAsk, toggling /plan on and back off silently demoted it to manual every time — a real, if minor, loss of the user's own configuration, not just plan mode's business to override. Fixed by capturing the mode that was active immediately before entering plan mode (previousMode, persisted alongside the todo list so it survives a session resume) and restoring exactly that on exit instead of hardcoding manual.