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

@ank1015/agents-core

v0.1.11

Published

Core agent runtime primitives for @ank1015/agents.

Downloads

24

Readme

@ank1015/agents-core

Core runtime primitives for the @ank1015/agents packages.

This package sits above @ank1015/agents-contracts and below applications. It provides small, provider-neutral runtime pieces: model catalog lookup, stream creation, provider-adapter routing, and an HTTP gateway transport.

Install

pnpm add @ank1015/agents-core

What This Package Provides

  • ModelRegistry helpers for static provider model catalogs.
  • A process-wide model registry for app startup wiring.
  • createAdapterTransport for routing requests to provider adapters.
  • GatewayTransport for streaming assistant events from a remote gateway.
  • createEventStream re-exported from @ank1015/agents-contracts.

Import Paths

import {
  createGatewayTransport,
  createModelRegistry,
} from '@ank1015/agents-core';

import { registerModels } from '@ank1015/agents-core/models';
import { createEventStream } from '@ank1015/agents-core/stream';
import { createAdapterTransport } from '@ank1015/agents-core/transport';

Model Registry

Use createModelRegistry for isolated registries, such as tests or per-runtime containers:

import { createModelRegistry } from '@ank1015/agents-core/models';
import { ANTHROPIC_MODELS } from '@ank1015/agents-provider-anthropic-spec';

const registry = createModelRegistry([ANTHROPIC_MODELS]);
const model = registry.get('anthropic', 'claude-sonnet-4-6');

Use the process-wide helpers when an app wants to register provider catalogs once at startup:

import { getModel, registerModels } from '@ank1015/agents-core/models';
import { ANTHROPIC_MODELS } from '@ank1015/agents-provider-anthropic-spec';

registerModels(ANTHROPIC_MODELS);

const model = getModel('anthropic', 'claude-sonnet-4-6');

Adapter Transport

createAdapterTransport multiplexes LLMRequests to provider adapters by request.provider:

import { createAdapterTransport } from '@ank1015/agents-core/transport';
import { createAnthropicProviderAdapter } from '@ank1015/agents-provider-anthropic';

const transport = createAdapterTransport([
  createAnthropicProviderAdapter({
    provider: 'anthropic',
    apiKey: { type: 'env', name: 'ANTHROPIC_API_KEY' },
  }),
]);

const stream = transport.stream({
  provider: 'anthropic',
  modelId: 'claude-sonnet-4-6',
  messages: [],
});

Gateway Transport

createGatewayTransport sends normalized LLM requests to a remote gateway endpoint and consumes assistant events from an SSE response.

import { createGatewayTransport } from '@ank1015/agents-core/transport';

const transport = createGatewayTransport({
  baseUrl: 'https://gateway.example.com',
  apiKey: process.env.AGENTS_GATEWAY_API_KEY ?? '',
});

The gateway transport posts to:

POST /v1/llm/stream

It expects server-sent event frames whose data: payloads are serialized AssistantEvent objects. The stream completes when it receives a done, error, or aborted event.

Streams

createEventStream is re-exported from @ank1015/agents-contracts for convenience:

import { createEventStream } from '@ank1015/agents-core/stream';

const stream = createEventStream<string, number>();
stream.push('started');
stream.end(1);

const result = await stream.result();

Versioning

This package is currently 0.1.11. Until 1.0.0, public runtime APIs may still evolve as the provider packages and gateway contract settle.