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

purra-compaction

v1.0.1

Published

Managed semantic conversation compaction for PurrA

Readme

purra-compaction · TypeScript

English | 简体中文

在上下文预算不足时,使用 PurrA 的受控模型任务执行器压缩较早的对话轮次。 要求 Node.js 22+ 和相同版本的 purra。

安装

按照源码安装说明操作,选择 integrations/compaction/typescript。

配置

import { Agent, type ModelGateway } from "purra";
import { SemanticCompaction } from "purra-compaction";

function createAgent(model: ModelGateway) {
  return new Agent({
    model,
    context: {
      compressionFactory: tasks => new SemanticCompaction(tasks, {
        maxSummaryTokens: 1024,
        maxInputTokens: 16000,
        keepRecentMessages: 8,
      }),
    },
  });
}

| 参数 | 默认值 | 用途 | | --- | --- | --- | | maxSummaryTokens | 1024 | 摘要调用的输出上限 | | maxInputTokens | 16000 | 摘要模型的估算输入 Token 上限 | | keepRecentMessages | 8 | 近期消息保留目标,会按完整轮次调整 |

行为

每次压缩使用一次受控调用,消耗当前 Run 的预算。指令和近期完整轮次会保留, 较早内容被总结为目标、约束、决策、已完成工作、待解决问题和证据引用。

摘要是不可信的上下文块。私有推理和厂商续接数据不参与摘要。 无效或超限摘要会导致压缩失败,不替换输入。Core 将接受的摘要保存在已准备的上下文检查点中, 原始对话由应用保存。