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

@meetopenbot/plugin-sdk

v0.1.2

Published

Types and helpers for building OpenBot plugins on the event bus.

Downloads

437

Readme

OpenBot Plugin SDK

The official SDK for building plugins for OpenBot. This SDK provides the types and helpers needed to create plugins that can handle events, interact with storage, and render UI widgets within the OpenBot ecosystem.

Installation

npm install @meetopenbot/plugin-sdk

How it Works

OpenBot plugins operate on an event-driven architecture powered by Melony. Plugin authors work with the OpenBot SDK types and helpers; you do not need to import Melony types in your plugin code.

  1. Registration: The host loads your plugin and calls the factory function with a PluginContext.
  2. Subscription: Your factory function uses the PluginBuilder to subscribe to specific events (for example, agent:invoke).
  3. Processing: When an event occurs, your handler is called. You can perform logic, interact with storage, or call external APIs.
  4. Publication: Your handler can emit new events back to the bus (for example, agent:output or client:ui:widget) to communicate with the user or other plugins.

Core Concepts

Plugin

A plugin is defined by the Plugin or PluginModule interface. Use definePlugin to get full OpenBot typing without annotating Melony types yourself.

import { definePlugin } from '@meetopenbot/plugin-sdk';

export default definePlugin({
  id: 'my-plugin',
  name: 'My Plugin',
  description: 'A simple example plugin',
  configSchema: {
    type: 'object',
    properties: {
      apiKey: { type: 'string', description: 'Your API Key', format: 'password' },
    },
    required: ['apiKey'],
  },
  toolDefinitions: {
    get_weather: {
      description: 'Get the current weather',
      inputSchema: {
        type: 'object',
        properties: {
          location: { type: 'string' },
        },
      },
    },
  },
  factory: (context) => (builder) => {
    builder.on('agent:invoke', async function* (event) {
      // Handle events here
    });
  },
});

For community plugins published as npm packages, omit id and export a PluginModule. The host assigns id from the package name.

You can also type a plugin object explicitly with Plugin or PluginModule if you prefer. The factory function returns a PluginFactory, which registers handlers on the PluginBuilder and receives PluginHandlerContext in event handlers.

Configuration & Tools

  • configSchema: Defines the configuration options for your plugin. The host uses this to validate the configuration provided in AGENT.md.
  • toolDefinitions: Defines the tools your plugin provides. Other plugins (like a runtime plugin) can use these definitions to call your plugin's tools.

Events

Plugins communicate via an event bus. Common event types include:

  • agent:invoke: Dispatched when a user sends a message to the agent.
  • agent:output: Emitted by the agent to send a message back to the user.
  • client:ui:widget: Used to render a UI widget in the client.
  • action:<toolName>: Dispatched when a runtime requests a tool call.
  • action:<toolName>:result: Emitted when a tool handler finishes.

Storage

The PluginContext provides access to the storage interface, allowing plugins to interact with:

  • Channels & Threads: Manage conversation contexts.
  • Agents: Access and update agent details.
  • Variables: Store configuration or secrets.
  • Files: Read and list files in the channel's workspace.
  • Memories: Store and retrieve long-term memory records.

UI Widgets

Plugins can render interactive UI widgets using the uiWidget helper. Supported widget types include:

  • message: Simple text message with optional actions.
  • choice: A set of buttons for the user to choose from.
  • form: A form with various field types (text, number, select, etc.).
  • list: A list of items with status indicators.

Example: Hello World Plugin

This plugin responds to any message with "Hello, World!".

import { definePlugin, shouldHandleInvoke, agentOutput } from '@meetopenbot/plugin-sdk';

export default definePlugin({
  id: 'hello-world',
  name: 'Hello World',
  description: 'Responds with Hello World',
  factory: (context) => (builder) => {
    builder.on('agent:invoke', async function* (event) {
      if (shouldHandleInvoke(event, context.agentId)) {
        yield agentOutput({
          agentId: context.agentId,
          content: 'Hello, World!',
          threadId: event.meta?.threadId,
        });
      }
    });
  },
});

API Reference

License

MIT