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

@connorhatcher/om-pi

v0.1.0

Published

Observational Memory extension for pi-coding-agent.

Readme

@connorhatcher/om-pi

Observational Memory extension for pi-coding-agent.

It provides:

  • custom session_before_compact summarization powered by @connorhatcher/obversational-memory stateless pipelines
  • custom session_before_tree branch summaries
  • sync/async auto-compaction trigger flows keyed by mode
  • ephemeral memory injection through the context hook (custom message, no system prompt overwrite)
  • lightweight status/control commands

Under the hood, compact hooks now use:

  • DelegateLLMClient to bridge pi completeSimple callbacks into OM
  • mapPiMessagesToOm to convert pi entries into core Message[]
  • runCompactionCycle for observer/reflection orchestration

Install

pi install npm:@connorhatcher/om-pi

Commands

  • /obs-memory-status shows mode, thresholds, raw-tail estimate, and observer/reflector pipeline counters
  • /obs-auto-compact <args> updates auto-compaction settings (keyed or positional)
    • keyed examples: mode=sync enabled=on observer=30k retain=8k
    • positional examples: sync on 30k 8k
  • /obs-mode [manual|sync|async] toggles mode (or sets explicitly)
  • /obs-view [obs|raw|<maxLines>] shows latest OM-native observations for the current branch
  • /obs-reflect queues a forced reflection pass and triggers compaction

Mode behavior:

  • manual: no auto compaction trigger; use /obs-reflect (or other manual trigger paths)
  • sync: auto trigger at agent_end when thresholds are crossed
  • async: enables buffered scheduling/activation paths (including blockAfter safety behavior)

Legacy aliases are still accepted and normalized:

  • blocking -> manual
  • buffered -> sync

Notes:

  • OM context injection uses an ephemeral custom message in context and does not mutate the base system prompt.
  • Runtime state is persisted in pi session custom entries and rehydrated on session lifecycle events.
  • om-pi reads observations from compaction details.observations and does not parse legacy markdown sections.
  • If latest compaction details are missing OM-native observations, om-pi warns and skips injection/view instead of legacy fallback parsing.

Flags

Typical runtime knobs used by this extension are:

  • --obs-mode
  • --obs-observer-threshold
  • --obs-reflector-threshold
  • --obs-raw-tail-retain
  • --obs-auto-compact
  • --obs-debug

If your pi runtime does not expose these flags directly, use the slash commands above.

Local config file

om-pi can read local defaults from .pi/config.json.

Example:

{
  "om-pi": {
    "enabled": true,
    "mode": "sync",
    "observerThreshold": 1000,
    "reflectorThreshold": 1500,
    "rawTailRetain": 8000,
    "debug": true
  }
}

Supported keys in the om-pi (or omPi) section:

  • enabled / autoCompact
  • mode (manual|sync|async, plus legacy aliases)
  • observerThreshold / observer / observation.messageTokens
  • reflectorThreshold / reflector / reflection.observationTokens
  • rawTailRetain / retain ("off" => 0)
  • observation.bufferTokens / observationBufferTokens / obsBufferTokens
  • observation.bufferActivation / observationBufferActivation / obsBufferActivation
  • observation.blockAfter / observationBlockAfter / obsBlockAfter
  • reflection.bufferActivation / reflectionBufferActivation
  • reflection.blockAfter / reflectionBlockAfter
  • experimentalAsyncBuffering / obsAsyncBuffering
  • shareTokenBudget
  • debug

Compatibility note:

  • When shareTokenBudget=true, om-pi applies a soft fallback to disable async buffering (observation.bufferTokens=false effective) so sessions continue without hard failure.

CLI flags still take precedence over .pi/config.json.

Fallback-Safe Behavior

Hook handlers intentionally return undefined when preconditions are missing or work fails. This lets pi fall back to its default behavior instead of blocking the session flow.

Cases that intentionally fall back:

  • no active model
  • API key resolution fails
  • summarization call errors/aborts

Non-Goals (v1)

  • No strict 1:1 command parity with the reference plugin