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

eve-openai-compaction

v0.2.0

Published

A Codex-style checkpoint compaction strategy for Eve agents.

Readme

eve-openai-compaction

eve-openai-compaction provides a remote Codex-style compaction strategy for Eve. It sends the current transcript to OpenAI's stateless /responses/compact endpoint and carries the returned opaque encrypted checkpoint into the next Eve model call.

There is deliberately no local prose-summary fallback. A remote failure fails the compaction attempt.

Compatibility

The package targets [email protected], ai@7, and @ai-sdk/openai@4. It requires the included Eve patch to expose custom compaction strategies.

The package also ships patches/[email protected], the reviewable TypeScript source patch with focused Eve tests. The installable pnpm patch targets Eve's published dist files.

The continuation model must be an OpenAI Responses model configured with providerOptions.openai.store: false. AI SDK then replays the encrypted checkpoint instead of trying to reference a server-stored item by ID.

Install

pnpm add eve-openai-compaction @ai-sdk/openai
mkdir -p patches
cp node_modules/eve-openai-compaction/patches/[email protected] patches/[email protected]

Register the patch in pnpm-workspace.yaml:

patchedDependencies:
  [email protected]: patches/[email protected]

Then run pnpm install. pnpm permits only one patch entry per package version; combine unified diffs if the application already patches [email protected].

Use

import { createOpenAI } from "@ai-sdk/openai";
import { defineAgent } from "eve";
import { codexRemoteCompaction } from "eve-openai-compaction";

const openai = createOpenAI();

export default defineAgent({
  model: openai.responses("gpt-5.3-codex"),
  modelOptions: {
    providerOptions: {
      openai: { store: false },
    },
  },
  compaction: {
    strategy: codexRemoteCompaction(),
    thresholdPercent: 0.9,
  },
});

By default, the compaction request reads OPENAI_API_KEY only when compaction runs. To use workload identity or a secret manager, resolve credentials at the last responsible moment:

strategy: codexRemoteCompaction({
  apiKey: async () => await resolveShortLivedOpenAIToken(),
  headers: async () => ({ "OpenAI-Project": await resolveProjectId() }),
})

Do not put credentials in source, logs, argv, persisted Eve context, or static provider options.

Strategy

The package follows Codex CLI 0.144.6's remote-v2 replacement shape:

  1. Use AI SDK's OpenAI Responses serializer to turn Eve's full ModelMessage history and current system instructions into Responses input items.
  2. POST that window to the official stateless /responses/compact endpoint.
  3. Require exactly one valid opaque compaction item. Never decrypt or convert it to prose.
  4. Retain the newest genuine user messages under Codex's 64,000-token budget, preserving images and midpoint-truncating the text at the budget boundary.
  5. Replace Eve history with those user messages and an AI SDK openai.compaction custom part containing the encrypted checkpoint.

The 64k client-retention behavior is pinned to Codex compact_remote_v2.rs. The remote checkpoint semantics and canonical output are documented in the official OpenAI compaction guide.

Eve re-applies its current framework-owned post-compaction state after the strategy returns, and its current system instructions remain outside durable message history.