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

@civaapple/qi-scheduler

v0.5.1

Published

Durable bounded proactive watchers with attention policy and idempotent Session triggers

Readme

@civaapple/qi-scheduler

Durable, bounded proactive watchers with attention policy and idempotent Session triggers.

Purpose

The Scheduler supports time- and event-based continuation without granting unbounded background autonomy. A watcher has explicit lifetime, state, delivery identity, attention checks, and external completion conditions.

Non-goals

  • A watcher is not an immortal daemon or a hidden Agent loop.
  • External events do not bypass Session trigger and capability boundaries.
  • Suppressed attention is not silently converted into successful delivery.

Core model

SqliteWatcherScheduler persists watcher definitions and delivery records. SessionEventTriggerSink appends a stable Run trigger. External event IDs and stable Run IDs make delivery replayable after crashes.

Behavioral invariants

  • A stopped watcher cannot emit another Run.
  • Every watcher has a hard maximum lifetime.
  • External completion can close a watcher automatically.
  • Event delivery is idempotent by external event ID.
  • Attention policy is checked before proactive interruption.
  • Stopping an in-flight watcher aborts before trigger commit.

Failure semantics

Durable watcher states are active, stopped, completed, and expired. Attention denial produces no delivery; a duplicate occurrence produces no second Run; and a trigger failure leaves the reserved occurrence pending for recovery with the same stable Run ID. These outcomes are observable without inventing extra watcher states.

Install and minimal use

npm install @civaapple/qi-scheduler
import { SqliteWatcherScheduler } from "@civaapple/qi-scheduler";

const scheduler = new SqliteWatcherScheduler(":memory:", {
  async trigger({ runId }) {
    return runId;
  },
});
try {
  console.log(scheduler.get("missing")); // undefined
} finally {
  scheduler.close();
}

Public API

Watcher types, SqliteWatcherScheduler, attention and external condition ports, TriggerSink, and SessionEventTriggerSink.

Change guide

New trigger modes must define lifetime, deduplication key, cancellation boundary, attention policy, external completion, and crash replay before implementation.

Verification

tests/watcher-scheduler.test.mjs covers lifecycle, idempotency, attention, crash replay, and in-flight stop.

Further reading