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

@moxxy/core

v0.7.0

Published

The moxxy runtime as a programmatic library: the agentic Session + runTurn loop, the event log, the plugin host, every block registry (providers, tools, modes, compactors, cache strategies, channels, …), session persistence, and the permission engine. Pai

Readme

@moxxy/core

The moxxy runtime, as a library. Construct an agentic Session, register the blocks you want (providers, tools, modes, compactors, channels, …), and run turns — embed moxxy's agent loop directly in your own code instead of going through the CLI or desktop app.

@moxxy/core is the engine + the block registries. It ships no built-in LLM provider or loop strategy — those are swappable packages you register, so nothing is welded in.

Just want to run an agent fast? Use @moxxy/agentsetupAgent(openaiPreset({ apiKey })) and you're done. This package is the layer underneath, for when you want full control of the blocks.

Install

npm i @moxxy/core @moxxy/sdk @moxxy/mode-default @moxxy/plugin-provider-openai

(@moxxy/sdk gives you the typed contracts + define* factories for authoring your own blocks.)

Quick start — setupAgent

setupAgent wires a Session + your blocks in one synchronous call and hands back a small agent you destructure:

import { setupAgent } from '@moxxy/core';
import defaultMode from '@moxxy/mode-default';
import openai from '@moxxy/plugin-provider-openai';

const { ask, stream, session } = setupAgent({
  plugins: [defaultMode, openai],
  provider: { name: 'openai', config: { apiKey: process.env.OPENAI_API_KEY } },
});

// `ask` → the final reply text (async):
console.log(await ask('Say hello in French.'));

// `stream` → an async generator yielding each event:
for await (const event of stream('Now in German.')) {
  if (event.type === 'assistant_chunk') process.stdout.write(event.delta);
}

collect(prompt) resolves with every event; session is the live Session for anything the sugar doesn't cover.

Tools

import { defineTool } from '@moxxy/sdk';
import { z } from 'zod';

const { ask, addTool } = setupAgent({ plugins: [defaultMode, openai], provider: { name: 'openai' } });

addTool(
  defineTool({
    name: 'get_weather',
    description: 'Current weather for a city.',
    inputSchema: z.object({ city: z.string() }),
    handler: async ({ city }) => `It's sunny in ${city}.`,
  }),
);

console.log(await ask("What's the weather in Paris?"));

Hot-swap blocks between turns

Nothing is hardcoded — the registries are the enable/disable/swap mechanism, exposed as chainable sugar (and on agent.session directly):

agent.setProvider('anthropic', { apiKey: process.env.ANTHROPIC_API_KEY }); // swap LLM
agent.setMode('goal');                                                     // swap loop strategy
agent.removeTool('get_weather');
await agent.discover();                                                     // load npm plugins

Under the hood (manual wiring)

setupAgent is sugar over the raw API, which you can use directly:

import { Session, runTurn, autoAllowResolver } from '@moxxy/core';

const session = new Session({ cwd: process.cwd(), permissionResolver: autoAllowResolver });
session.pluginHost.registerStatic(defaultMode);
session.pluginHost.registerStatic(openai);
session.providers.setActive('openai', { apiKey: process.env.OPENAI_API_KEY });

for await (const event of runTurn(session, 'Summarise the files in this repo.')) {
  // …
}

What's in the box

setupAgent + Session + runTurn/collectTurn · the registries (ProviderRegistry, ToolRegistryImpl, ModeRegistry, CompactorRegistry, CacheStrategyRegistry, ChannelRegistryImpl, EmbedderRegistry, …) · PluginHost + plugin discovery/loading · SessionPersistence (save / resume) · the PermissionEngine + resolvers (autoAllowResolver, denyByDefaultResolver, allow-list, callback) · the EventLog · skills · createLogger. The @moxxy/sdk types in the public surface (MoxxyEvent, Plugin, ToolDef, PermissionResolver, RunTurnOptions) are re-exported, so the API is fully typed from a single import.

packages/core/src/index.ts is the curated public surface. The package is 0.x: the API may still change between minor versions while it settles.

You bring the model

@moxxy/core is provider-agnostic: it defines the LLMProvider contract (in @moxxy/sdk) but bundles no vendor. Register a provider plugin (or your own) before running a turn.

License

MIT