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

@jasonbelmonti/claudex

v4.0.6

Published

Provider-agnostic normalized TypeScript interface over CLI-authenticated Claude, Codex, and Copilot SDKs.

Readme

claudex

claudex is a Node-hosted TypeScript library that exposes one normalized API over the CLI-authenticated Claude, Codex, and Copilot SDKs, plus a passive @jasonbelmonti/claudex/ingest surface for replaying local provider artifacts.

The goal is provider-agnostic orchestration, not fake parity. The stable contract covers readiness, session lifecycle, buffered and streamed turns, structured output, and normalized event/result/error shapes. Anything that does not normalize cleanly stays capability-gated or provider-specific.

Status

  • ClaudexAdapter default resolver: merged
  • Claude adapter: merged
  • Codex adapter: merged
  • Copilot adapter: merged and included after Codex and Claude in default resolution
  • Shared contract harness: merged
  • Node-based validation and package smoke checks: passing on main
  • Migration guidance for the Node-only major release: published in-repo

Docs

Install

npm install @jasonbelmonti/claudex

@jasonbelmonti/claudex 3.0.0 moved the package to a Node-only release line. Version 4.0.0 raises the supported Node floor for the provider SDK refresh. The package is ESM-only, repository validation runs on standard Node workflows, and Bun is no longer part of the supported runtime or maintenance contract.

Runtime And Module Requirements

  • Package metadata declares engines.node ^20.19.0 || >=22.12.0.
  • Repository CI verifies Node 20.19.0, Node 22.12.0, and the currently supported Node 24 release line.
  • The package is ESM-only. CommonJS consumers must use dynamic import() or an ESM bridge.

If you are upgrading from the Bun-first 1.x line, read docs/node-only-migration.md before adopting version 3.0.0 or newer. If you are on early Node 20 or early Node 22, upgrade before adopting version 4.0.0 or newer.

Quick Start

import { ClaudexAdapter, supportsCapability } from "@jasonbelmonti/claudex";

const adapter = new ClaudexAdapter();
const readiness = await adapter.checkReadiness();

if (readiness.status !== "ready" && readiness.status !== "degraded") {
  throw new Error(
    `Provider is not runnable: ${readiness.provider} (${readiness.status})`,
  );
}

const session = await adapter.createSession({
  executionMode: "plan",
  approvalMode: "deny",
});

const result = await session.run({
  prompt: "Summarize the repository state.",
});

console.log(result.text);

if (supportsCapability(session.capabilities, "session:fork") && session.fork) {
  const forked = await session.fork();
  await forked.run({
    prompt: "Take a different approach.",
  });
}

The stable root entrypoint intentionally exposes the provider-agnostic surface. By default, ClaudexAdapter checks Codex, Claude, then Copilot and pins the first runnable provider. When you need explicit provider wiring or test doubles, pass adapters through ClaudexAdapter's providers option. Use preferredProviders only to override the default priority:

const copilotFirst = new ClaudexAdapter({
  preferredProviders: ["copilot", "codex", "claude"],
});

What The Contract Guarantees

  • checkReadiness() returns a normalized readiness object with provider status, checks, capabilities, and raw provider diagnostics.
  • createSession() and resumeSession() return an AgentSession with the same run() and runStreamed() surface for supported runtime providers.
  • run() returns a normalized TurnResult.
  • runStreamed() yields normalized AgentEvent values and normally finishes with a terminal event; consumers should treat that as the common contract shape, not as a hard duplicate-suppression guarantee.
  • Structured output accepts one JSON Schema shape for supported runtime providers and returns parsed structuredOutput or a typed AgentError.
  • Every event, result, and error preserves the originating provider and keeps raw provider payloads in raw. extensions may appear on some event shapes, but they are not a universal result/error guarantee.

What Callers Still Need To Gate

Do not branch on provider name when a capability flag will do.

  • session:fork: Claude only
  • attachment:image: Codex only in the current surface, and only for local file paths
  • stream:message-delta: Claude and Copilot only
  • event:reasoning-summary: Codex only in the current normalized surface
  • event:file-change: Claude, Codex, and Copilot; payload detail differs
  • event:todo-update: Codex only
  • event:approval: Copilot only
  • mcp:session-descriptors: Claude and Copilot only; Codex MCP config remains available through codex.sdkOptions.config
  • usage:cost: Claude only

Copilot supports the normalized executionMode: "plan" and sandboxProfile: "read-only" pair. Claudex marks every Copilot turn as plan mode, rejects provider requests to leave or auto-switch out of plan mode, and implements read-only as a deliberately tool-less session with permission requests denied. Copilot does not currently support the normalized workspace-write or full-access sandbox profiles.

See docs/capability-matrix.md for the full matrix and docs/consumer-guide.md for orchestration guidance.

Passive Ingest

@jasonbelmonti/claudex/ingest is the read-only companion surface for best-effort observation of local provider artifacts. It does not create sessions, resume sessions, or represent authoritative live control state.

Supported passive sources in the current contract:

  • Claude transcript .jsonl
  • Claude snapshot/task .json
  • Codex transcript .jsonl
  • Codex session-index .jsonl

Outside the current ingest contract:

  • other provider-native logs, temp files, or extension metadata
  • live approval responses, hooks, plugins, MCP state, and other control-plane behavior
  • authoritative live session status

Use the live adapter surface when you need to start or resume sessions, or when terminal turn state must be authoritative. Use @jasonbelmonti/claudex/ingest when you need best-effort history backfill, watch/reconcile over local artifacts, or a read-only observability view. See docs/consumer-guide.md for examples and boundary guidance.

Development

If you're working on the repository itself:

npm ci

Then run the usual checks:

npm run typecheck
npm test

Authenticated local smoke tests are opt-in:

npm run test:smoke

To limit smoke to one provider:

CLAUDEX_SMOKE=1 CLAUDEX_SMOKE_PROVIDERS=codex npm run test -- ./test/smoke/codex.smoke.ts

Copilot live smoke is explicit and depends on local Copilot auth/entitlement:

CLAUDEX_SMOKE=1 CLAUDEX_SMOKE_PROVIDERS=copilot npm run test -- ./test/smoke/copilot.smoke.ts

CI Contract

Pull requests and pushes to main run the repository CI contract from .github/workflows/ci.yml:

  • Node 20.19.0, 22.12.0, and 24 baseline verification via npm run check
  • Node 20.19.0 and 22.12.0 test-suite verification via npm test
  • Node 24 coverage via npm run test:coverage
  • Node 20.19.0, 22.12.0, and 24 packed-artifact verification via npm run package:check

To reproduce the full CI command set locally on a supported Node release:

npm run check
npm test
npm run test:coverage
npm run package:check