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

@sunnyx11/pi-press

v0.7.1

Published

Precompute Pi compaction summaries in the background and reuse them when compaction starts.

Readme

pi-press

pi-press 是一个面向 Pi 的 TypeScript 扩展,在上下文接近压缩阈值时提前在后台生成摘要。

功能与取舍

  • 后台生成摘要,当前 agent 继续运行。
  • 后续请求复用摘要和近期消息,并按新增历史刷新检查点。
  • 保留原始会话记录,正式压缩和会话恢复使用 Pi 原生实现。

预压缩可能产生额外的 provider 请求和 token 消耗。摘要不可用时使用 Pi 原生压缩。

安装

运行要求:

  • Node.js >=22.19.0
  • Pi coding-agent >=1.5.0
  • 已配置可用的模型和 provider
# 安装最新版本
pi install npm:@sunnyx11/pi-press

# 固定安装指定版本
pi install npm:@sunnyx11/[email protected]

# 在当前进程中临时加载
pi -e npm:@sunnyx11/[email protected]

# 更新未固定版本或卸载
pi update npm:@sunnyx11/pi-press
pi remove npm:@sunnyx11/pi-press

pi-press 是 Pi 扩展包,不提供独立 CLI。Pi 扩展与宿主进程具有相同的系统权限,安装前应检查包来源和源码。

配置

配置优先级为:项目配置 > 全局配置 > 内置默认值。

  • 全局配置:~/.pi/agent/pi-press.json
  • 项目配置:<cwd>/.pi/pi-press.json

全局目录可以通过 PI_CODING_AGENT_DIR 修改。项目配置只需声明需要覆盖的字段。

{
  "precomputeMode": "threshold",
  "softThresholdPercent": 60,
  "summaryThinkingLevel": "low",
  "taskTimeoutMs": 300000
}

summaryThinkingLevel 只影响后台摘要;设置为 "inherit" 可使用主会话思考级别。摘要输出上限由 Pi 和模型决定,容量检查使用宿主当前模型生效的 compaction.reserveTokens。旧配置字段 summaryReserveTokens 仅提示一次并忽略。完整配置见预压缩设计。

诊断查询

默认查询当前会话的最近事件。持久化诊断不保存用户消息、完整摘要、工具结果或认证信息。

/pi-press-diagnostics
/pi-press-diagnostics --session <session-id> --last 50
/pi-press-diagnostics --session <session-id> --last 100 --json

开发

npm install
pi -e ./src/index.ts
npm run typecheck
npm test
npm run test:smoke:pi

npm run test:smoke:pi 使用当前环境安装的 Pi 和当前配置模型,可能产生真实 provider 调用费用。详细开发与验证要求见代码规范。

相关文档

致谢

感谢 LINUX DO 社区。

许可证

本项目使用 MIT License。