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

billion-context-web

v0.1.0

Published

Browser-side context-compression client for billion-context / acp-kernel. Brings incremental, reversible, prefix-cache-friendly context compression to web apps without running a Node proxy.

Readme

English | 中文

billion-context-web

billion-context / acp-kernel 的浏览器端上下文压缩客户端。

billion-context 是一个 Node.js 代理,架在任意 AI 助手与其模型 API 之间,用 acp-kernel 压缩重写 Anthropic/OpenAI 流。billion-context-web同样的增量、可逆、对前缀缓存友好的压缩带到浏览器里运行的应用 —— 无需代理进程,无需 Node。

⚠️ 这是一个骨架包,压缩接口目前是占位实现。 请按需对接 acp-kernel,或转发到运行中的 billion-context 代理端点。

为什么

长 AI 会话会把上下文撑爆。一旦超过上下文窗口,会话质量下降甚至崩掉,而各家 provider 按 token 计费。压缩能让一个会话连跑数天 —— 海量 token 穿过同一个窗口。

浏览器里通常没法跑 Node 代理。billion-context-web 给 Web 应用提供一个客户端,对接 billion-context 端点(或打包后直接调用 acp-kernel),让聊天界面、浏览器内 IDE 实验、agent 前端都能享有与 CLI 助手相同的压缩能力。

安装

npm install billion-context-web

快速开始

import { BillionContextWeb } from 'billion-context-web';

const bc = new BillionContextWeb({
  endpoint: 'http://localhost:8787', // 运行中的 billion-context 代理
  contextWindow: 200_000,            // 可选:自动检测失败时的兜底窗口
});

const result = await bc.compress({ messages });
console.log(result.tokensBefore, '->', result.tokensAfter);

API

new BillionContextWeb(options?)

| 选项 | 类型 | 说明 | | -------------- | ----------------------------- | ----------------------------------------------- | | endpoint | string | 运行中的 billion-context 代理地址。 | | contextWindow| number | 自动检测失败时的兜底窗口大小(tokens)。 | | headers | Record<string, string> | 附加到上游请求的额外 headers。 | | fetch | typeof fetch | 自定义 fetch(默认为全局 fetch)。 |

bc.compress(request): Promise<CompressResult>

把已消耗的对话范围折叠成摘要。(骨架:no-op。)

License

MIT © ranxianglei