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

stub-auth

v1.3.1

Published

Stub AI provider driver for core-auth — canned responses to validate the auth pipeline; the reference example for building provider plugins.

Readme

stub-auth

npm version npm downloads CI

A stub AI-provider driver for core-auth. It returns canned, valid Anthropic Messages API responses (JSON or SSE) so the auth pipeline — discovery, routing, and the per-app adapters in Claude Code and OpenCode — can be validated end to end without contacting any real provider. It is also the reference example for building new provider plugins: define { id, label, models, handle }, let core-auth do the rest.

Under-the-Hood Architecture

flowchart LR
  A[cc / oc chat] --> B[core-auth / loader proxy]
  B --> C{active provider}
  C -->|stub| D[driver.handle]
  D -->|stream?| E[canned SSE]
  D -->|else| F[canned JSON]
  E --> A
  F --> A

Structure

  • src/
    • src/driver.ts — the provider: id/label/models + handle() returning the canned response.
    • src/index.ts — OpenCode entry (defineProvider(driver).opencode).
    • src/handler.ts — Claude entry (the named handle the loader proxy calls).
    • src/commands.ts — cross-app slash-commands (the reference example of the command framework).
    • core-auth/, core/ — git submodules (auth engine; shared config/logging/commands), bundled in.
  • dist/
    • dist/index.js + dist/handler.js — esbuild bundles the submodules in, producing self-contained entries; not committed.

Installation

Via plugin-updater (recommended)

npx plugin-updater@latest init https://github.com/intisy-ai/stub-auth

Via npm

npm install stub-auth

Selecting the Stub Provider

After installing, pick Stub in the loader's Providers tab (cc auth) or run oc auth login and select a stub/... model. The active provider is stored by the loader.

Configuration

Config file: <configDir>/config/stub-auth.json (edit via the loader or /stub-auth-config set).

{
  "logging": true,
  "response_text": "Hello from stub-auth — the core-auth pipeline works end to end.",
  "model_count": 3,
  "latency_ms": 0,
  "fail_rate": 0,
  "streaming": null
}

| Key | Default | | --- | --- | | logging | true | | response_text | "Hello from stub-auth — the core-auth pipeline works end to end." | | model_count | 3 | | latency_ms | 0 | | fail_rate | 0 | | streaming | null |

Commands

| Command | Description | Arguments | | --- | --- | --- | | /stub-auth-config | View and change stub-auth configuration | list | get <key> | set <key> <value> | | /stub-accounts | List stub-auth demo accounts | |

Dependencies

  • core
  • core-auth

Logging

Logs are written to <configDir>/logs/YYYY-MM-DD/stub-auth-HH-MM-SS.log and are toggled by this plugin's logging config (default on). Console mirroring is global, off by default, and controlled by the shared config/settings.json logConsole flag.

License

MIT.