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

@yansircc/pi-loop

v0.5.7

Published

Effect-based temporal loops for Pi

Readme

pi-loop

Effect-based temporal loops for Pi.

pi install npm:@yansircc/pi-loop

Commands

/loop 7m inspect the build       # execute now, then every exact 7 minutes
/loop monitor the deployment     # model-paced dynamic loop
/loop-list
/loop-kill <id|all>

Fixed intervals are elapsed durations, not approximated cron expressions. Dynamic loops execute once, enter AwaitingArm, and continue only when the model calls:

schedule_wakeup { loopId, delaySeconds, reason }

Model tools

  • cron_create: recurring calendar cron or one-shot prompt.
  • cron_delete: cancel by id or all.
  • cron_list: list active loops.
  • schedule_wakeup: arm one dynamic loop for 60–3600 seconds.

cron_create accepts a five-field cron expression, prompt, recurring, durable, and optional label. Cron uses an explicit IANA timezone and standard day-of-month/day-of-week OR semantics. Missed recurring occurrences coalesce into one claim.

State and delivery

Session loops are stored as versioned custom entries in the owning Pi session. Forked sessions do not inherit them. Durable cron and one-shot loops are stored in .pi-loop.json. One PID lease owns durable mutation; follower sessions may still run session loops.

When the extension runs inside pi-web it also exposes a structured multi-loop status and a typed control command. pi-web keeps a session runtime alive while at least one loop exists. If pi-web is stopped, no loop runs; reopening the session restores state and coalesces an overdue occurrence.

Delivery is at-most-once after claim: durable state commits before Pi receives the prompt. A failed commit emits no occurrence; a Pi failure after commit is logged and is not retried.

Project overrides belong in .pi-loop.config.json:

{
  "maxLoops": 50,
  "recurringMaxAgeMs": 604800000,
  "recurringJitterFraction": 0.5,
  "recurringJitterCapMs": 1800000,
  "checkIntervalMs": 1000,
  "durableFilePath": ".pi-loop.json",
  "timeZone": "Asia/Shanghai"
}

Development

pnpm install
pnpm run verify
pnpm run pi:pack

The package gate builds one self-contained Node ESM entry, packs it, extracts it without installing dependencies, and loads it through Pi's real extension loader.

Releases

Every push to main publishes the next patch version after verification. Add one commit trailer to select a larger SemVer increment:

Release-Bump: minor
Release-Bump: major

CI owns the version commit and tag. Without a trailer, 0.4.1 becomes 0.4.2; minor produces 0.5.0, and major produces 1.0.0.