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

@agentproto/provider-presets

v0.6.1

Published

@agentproto/provider-presets — concrete provider/backend preset registry (baseUrl, keyEnv, scrubEnv, defaultModel) shared by Anthropic/OpenAI-compatible adapters and the user-facing presets catalog. Pure TS data; projection stays in the consumer.

Readme

@agentproto/provider-presets

Concrete provider/backend preset registry — the shared, adapter-agnostic facts about a backend an Anthropic/OpenAI-compatible client can front: base URL, the conventional env var holding its API key, the core env vars to scrub, and an optional default model. Pure TS data; projection stays in the consumer.

Why

@agentproto/adapter-claude-code and @agentproto/adapter-claude-sdk both front Anthropic-compatible gateways (Moonshot, OpenRouter, Requesty, DeepSeek, xAI-Anthropic, LLM Endpoint, …). The claude binary and the Claude Agent SDK both honor ANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN, so the facts about a gateway — its URL, its key env, its default model — are identical across both. Those facts used to be inlined (and copy-pasted) in each adapter's mode table, drifting independently. This package is the single source of truth for them.

Layering

The registry is data only. It does not know about claude-code vs claude-sdk. How a given adapter projects a preset into its own manifest (modes, options, env_unset, bin_args_append) stays in the adapter.

@agentproto/provider-presets        ← concrete preset DATA (this package)
   ↑ consumed by
@agentproto/adapter-claude-code     ← projects preset → AgentCliMode (+ cloud-toggle scrub)
@agentproto/adapter-claude-sdk      ← projects preset → AgentCliMode (+ CLAUDE_SDK_* env, --thinking)
   ↑ composed with
@agentproto/provider-kit            ← catalog MECHANICS (lister, wizard, MCP tools) — skeleton only

This keeps @agentproto/provider-kit (the catalog mechanics) and the generic @agentproto/driver-agent-cli both free of concrete provider URLs — data flows down, projection stays in the consumer.

Surface

| Export | Purpose | |---|---| | ANTHROPIC_GATEWAY_PRESETS | Record<id, ProviderPreset> — the registry | | anthropicGatewayPresetList | flat ProviderPreset[] for catalog UIs | | getAnthropicGatewayPreset(id) | lookup; throws on unknown id (loud at load, not a silent no-baseUrl mode) | | AnthropicGatewayPresetId | "moonshot" \| "openrouter" \| "requesty" \| "deepseek" \| "xai-anthropic" \| "llm-endpoint" \| "xai" \| "openai" \| "openai-direct" \| "mistral" \| "groq" \| "nebius" \| "huggingface" \| "deepinfra" (and any adapter-declared preset id) | | ProviderPreset | the data shape |

Stage

  • Stage 1 (this package): the registry data; claude-code / claude-sdk consume it. ✅
  • Stage 2: agentproto presets list CLI + list_provider_presets MCP tool + daemon GET /presets, with ready/available status from key presence. ✅
  • Stage 3: an AIP-45 presets manifest field so external adapters declare their own gateway presets, merged into the listing at runtime. ✅

Built-in vs adapter-declared presets

Built-in presets (this registry) are for public, fixed-endpoint gateways — Moonshot, OpenRouter, Requesty, DeepSeek, and xAI all expose one canonical Anthropic-compatible (or, for xAI, OpenAI-compatible) URL. The registry also includes the local llm-endpoint Anthropic-compatible proxy, the xai-anthropic Anthropic-compatible xAI gateway, and OpenAI-flavored direct presets for Mistral, Groq, Nebius, Hugging Face, and DeepInfra. That fixed baseUrl is exactly what makes them safe to ship as a preset: it's the source of truth, no operator input needed.

A self-hosted gateway — e.g. a LiteLLM proxy at <your-host>/anthropic (default http://localhost:4000) — has no canonical URL, so it does not belong in this registry (a hardcoded baseUrl would silently hit localhost for anyone not running it there). It's the canonical use case for the Stage 3 adapter-declared presets field: an adapter author (or operator) declares their own preset with their real proxy URL.

// In an adapter's AgentCliDefinition — a self-hosted LiteLLM preset
import type { AgentCliDefinition } from "@agentproto/driver-agent-cli"

export const definition: AgentCliDefinition = {
  // …adapter fields…
  presets: [
    {
      id: "litellm",
      label: "LiteLLM proxy (self-hosted)",
      description:
        "A self-hosted LiteLLM proxy speaking the Anthropic Messages API. " +
        "Set baseUrl to <your-proxy>/anthropic.",
      schemaFlavor: "anthropic",
      baseUrl: "http://localhost:4000/anthropic", // ← override per deployment
      keyEnv: "LITELLM_API_KEY",
      scrubEnv: ["ANTHROPIC_API_KEY"],
      homepage: "https://docs.litellm.ai",
    },
  ],
}

Declared presets are merged into agentproto presets list alongside the built-ins, keyed by id (adapter-declared entries do not shadow built-ins).

Adding a gateway

Add an entry to ANTHROPIC_GATEWAY_PRESETS in src/anthropic-gateways.ts. The satisfies Record<string, ProviderPreset> guard checks the shape; the test suite checks id matches the key, the URL/keyEnv shapes, and that the ambient ANTHROPIC_API_KEY is scrubbed. Then project it into each adapter's mode table.

A gateway belongs here only if it has a fixed public endpoint. If the base URL is operator-defined (self-hosted proxy, on-prem gateway), declare it as an adapter preset instead — see above.