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

hffmnnj.jevpact

v0.1.2

Published

![Jevpact: Keep what matters.](https://unpkg.com/[email protected]/assets/banner.png)

Readme

Jevpact: Keep what matters.

jevpact

Jev-timed native context compaction for OpenCode V2, published as hffmnnj.jevpact.

The plugin asks TypeSafe Jev whether the current work looks like a useful transition, and if so requests one native OpenCode compaction. It never summarizes, rewrites, or continues the session itself.

It runs inside the existing OpenCode server; no separate local service is involved.

Inspired by transcendr/jevpact (CC BY 4.0, by Slopware Engineer, https://x.com/aienginerd). This is an original native OpenCode V2 plugin in that spirit, not a verbatim port.

How it works

  • Hosted endpoint: https://api.typesafe.ai/v1/systemone
  • Default System One model: jev-1.14.0; configure model to use another hosted model ID or alias. TypeSafe may return a resolved model ID for an alias.
  • Auth uses the existing TYPESAFE_API_KEY from the OpenCode server environment. The plugin never copies the key, writes it to disk, or logs it.
  • OpenCode native compaction and the native pressure fallback remain authoritative. This plugin only times the request; it is not a replacement summarizer, service, desktop controller, or resume mechanism.
  • Model settings select the compactor: provider-native compaction for models configured for it (for example, OpenAI Responses-native models), and OpenCode-native summary compaction otherwise. The plugin never overrides that routing or the compaction hook's result.
  • Judgments run out of band and never delay model dispatch. A Jev failure preserves normal work. There are no automatic transport retries.

What is sent

  • Source-linked current and prior requests, the current report, and recent visible chronology, capped at 24 KiB. Current source requests and the report are never truncated; if they cannot fit, the checkpoint is skipped.
  • Request text is the actual visible text retained by native compaction, not a reconstruction. Peer messages marked metadata.source='opencode-cross-communication' are never labelled as user requests; retained task context stays separated from them.
  • When native compaction kept only a summary and no raw requests, the excerpt carries a clearly labelled bounded visible summary excerpt as context. Recovered goal text is evidence for the checkpoint judgment only, not a new instruction or authority.
  • A completed todowrite-only update after the report counts as administrative bookkeeping. Shell/patch/read/subagent results, running or errored todos, and newer peer/child results still wait for interpretation.
  • The report must have an explicit successful finish and completion timestamp. Truncated, filtered, unknown-finish, errored, or still-streaming text is not treated as a completed checkpoint, even if it sounds settled.
  • Never sent: native encrypted state, tool result bodies, todo input/result bodies, system instructions, attachments, hidden reasoning.
  • If the exact API key string appears inside the evidence excerpt, it is redacted before sending. Arbitrary source text may still contain other sensitive information, so this is not a promise of full secret detection. Do not paste secrets into the session and expect the plugin to catch them.

What is stored

Status keeps only counts, choices, and error strings. No transcript text and no credentials are stored. The in-memory lastDecision also records session/checkpoint identity, request source, and applied thresholds so a missed checkpoint can be traced; it persists no transcript and leaves the lifetime stats schema unchanged. A checkpoint message ID is persisted for reload deduplication. Top-level status counters cover the current plugin instance; lifetime aggregate totals live in status.stats (see Statistics below).

Statistics

Lifetime totals live in native OpenCode plugin storage under key stats/v1, shared across locations. The stored totals survive plugin reloads and server restarts. Durable collection starts with this version: earlier in-memory counts are not recoverable history and are not backfilled. There is no telemetry service, transcript archive, dashboard, reset/delete endpoint, or estimated savings or cost.

The stored shape holds only a schema version, timestamps, allow-listed counters, the fixed skip reasons, cumulative and maximum latency, validated TypeSafe input/output token totals with a usage sample count, and requested route counts by mode. No error strings, session content, credentials, or arbitrary response metadata are stored.

  • TypeSafe usage is optional: missing or malformed usage is unknown, not a fabricated zero. Only validated input/output pairs add a usage sample.
  • Diagnostic calls have separate counts from real checkpoint evaluations, but known token usage and latency include both, so diagnostics' API consumption is not hidden.
  • compactionsRequested counts plugin native admissions, while compactionsCompleted and compactionsFailed count all native completion and failure events observed by the plugin, including native manual and pressure events. They are observed, not attributed savings.
  • The durable aggregate is served in status.stats and the read-only jevpact/stats RPC. Both carry statsStorageErrors, which counts collection and persistence failures. That counter lives in memory and is not durable when writes fail. If saved totals cannot be read, stats is null rather than fake zeros. Failed writes also raise this indicator and can leave gaps in the totals; normal compaction behavior continues.

Read the aggregate via POST /api/rpc/jevpact/stats with body {"input":{}} using the server's existing OpenCode authentication. From a source checkout, node scripts/check-live.ts prints the full status output, including status.stats; the script is not included in the npm package.

Model breakdown

stats.modelDetails adds its own startedAt and up to 128 provider/model rows. Each row reports real evaluation outcomes, admitted compaction requests by route, Jev latency, and validated Jev token usage. Usage measures the classifier call, not the primary model or the compaction operation.

Old totals are preserved without backfilling model identities. The difference between global evaluation/request counts and the sum of their model rows is unassigned history (or an identity beyond the bounded row limit). Global usage and latency additionally include diagnostics. Detail starts on the first model-attributed event; it can be absent until then. Diagnostics remain global and do not inflate any model row. Observed native completions remain global: an admitted request is not proof of completed compaction.

Only validated provider/model identifiers and numeric aggregates are added; no session IDs, transcripts, or individual score histories are stored.

What carries over from JevPact

The source review covered its controller state machine, timing-context.js, transcript.js, policy.js, Jev rubrics, and associated tests, not just the README.

  • Preserve source-linked current and prior requests and referential context.
  • Refuse old-turn checkpoints after new direction, incomplete source coverage, and tool activity that has no later assistant interpretation, before calling Jev.
  • Count token-bearing model responses since compaction, including tool-only steps, from the first post-compaction usage as the growth baseline.
  • Observe actual native completion; an admitted request is not completion.
  • Cancel stale decisions on prompts, new execution steps, stops, deletion, and unload.

Unlike the Codex controller, no pause, deferral, or resume messages, local service, rollout parser, or recovery-state database are needed. OpenCode already queues compaction safely and owns continuation. Native context pressure remains the fallback. The thresholds are intentionally conservative; no token-saving or accuracy improvement is claimed without workload measurement.

Install

The package targets Bun-based OpenCode V2. It ships TypeScript source; plain Node.js cannot import that source from node_modules, even on Node 26. Add one entry to the OpenCode plugins array:

{
  "plugins": [
    {
      "package": "hffmnnj.jevpact",
      "options": {}
    }
  ]
}

If the plugin was already registered from a local checkout, replace that entry rather than adding a second one. Loading both would load the same code twice. The runtime plugin ID remains jevpact, so existing durable statistics and checkpoint markers continue to apply.

OpenCode native hot reload picks it up; no service restart is needed. The plugin reads the existing TYPESAFE_API_KEY from the OpenCode server environment and never copies it into config or files.

Policy options

Fields below go inside options; all are optional and unset fields use the defaults shown:

| Option | Default | Meaning | |---|---|---| | model | jev-1.14.0 | Hosted TypeSafe System One model ID or alias; nonempty, no surrounding whitespace, at most 256 UTF-8 bytes | | minInputTokens | 100000 | Minimum context size before any evaluation | | minGrowthTokens | 30000 | Minimum growth since the post-compaction baseline | | minRequests | 3 | Minimum distinct model steps before evaluating | | minProbability | 0.8 | Minimum boundary probability to qualify | | minSupportingProbability | 0.7 | Minimum settled=yes and open_result=no probability to qualify | | minConfidence | 0.5 | Minimum answer confidence to qualify | | cooldownMs | 60000 | Minimum gap between evaluations | | enabled | true | Set false to disable without removing the entry |

Below the context floor nothing is sent and no compaction is requested. The endpoint is fixed: the selected model receives the session excerpt described above at TypeSafe's hosted service. Invalid model configuration prevents plugin setup; API errors or invalid responses leave normal execution unchanged. The existing thresholds are not calibrated specifically for alternative models. Boundary and settled must answer yes, and open_result must answer no; any contrary or unknown choice vetoes the checkpoint. The boundary bar stays at 0.8 while the two supporting answers default to 0.7: a real completed-work case with 0.74 no-open-result support was wrongly rejected by a blanket 0.8. No accuracy or savings claim is made for this change. Setting only the legacy minProbability keeps one explicit threshold for all three answers; setting both opts into the asymmetry. Context floor (100k), growth (30k), request count (3), and cooldown (60s) are unchanged.

Development

Node 26 or newer. These commands and the operational scripts below run from a source checkout only; they are not included in the npm package:

git clone https://github.com/hffmnnj/opencode-jevpact.git
cd opencode-jevpact
npm ci --ignore-scripts
npm run typecheck
npm test

Run these before registering the plugin. Installing the npm package requires no build or packaging step.

Limitations

  • Needs the server's existing TYPESAFE_API_KEY; without it the plugin reports unconfigured and does nothing.
  • Calls the hosted Jev endpoint, so evaluation needs network access.
  • Only visible text is considered, so it cannot see hidden state. After summary-mode compaction the evidence carries a labelled summary excerpt rather than raw requests; judgments there rest on that context.
  • Threshold defaults are provisional and may need tuning for your workload.
  • Checkpoints are considered before model requests and at successful turn completion. A successful turn with no remaining liveness signal is idle and is never compacted: the session is only eligible while an assistant text stream, a running shell, a running subagent, or a model request is active. This is checked again immediately before admission, so a judgment that finishes after work stops cannot compact an idle session. Child sessions are observed as parent activity and are never judged themselves. An active turn continues through OpenCode's own runner after compaction; new direction or stops cancel stale decisions.

Diagnostics

Live RPC methods (use the server's existing authentication):

  • jevpact/status is read-only: enabled and configured state, event-stream health, counters, and the in-memory lastDecision with its session/checkpoint identity, request source, applied thresholds, and Jev's answers.
  • jevpact/stats is read-only: lifetime aggregate totals, or null when saved totals cannot be read.
  • jevpact/check makes one live Jev call using an embedded harmless sample, never session text.

See docs/DEPLOY.md for commands; operational docs are not included in the npm package. Never put real secrets in config files, issue text, or pasted command output.