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

aloha-sdk

v1.2.12

Published

Provides TypeScript types for plugin development and lets your plugin access additional capabilities such as logging and browser-based website rendering.

Downloads

6

Readme

aloha-sdk

Provides TypeScript types for plugin development and lets your plugin access additional capabilities such as logging and browser-based website rendering.

npm version github action

Plugins with dependencies

To bundle dependencies with your plugin we recommend using a bundler.

To get started quickly use the official vite-aloha template

See: TypeScript example with dependencies

If you don't need to include dependencies from the NPM registry, you can use a simplified approach with just a single file as entry point.

Complete Plugin Example (simplified - no bundler)

How to prototype an AI app in 15 minutes

See: EcmaScript example without dependencies

SDK API

Plugin class

import type { PluginContext } from "./plugin-context";
export abstract class Plugin {
  private readonly context: PluginContext

  constructor(context: PluginContext) {
    this.context = context
  }

  /**
   * Get the context object to interact with the assistant
   * 
   * @returns The context object
   */
  getContext(): PluginContext {
    return this.context
  }

  /**
   * This method is called when the assistant calls a tool provided by the plugin in the manifest.
   * 
   * @param toolName - The name of the tool to call
   * @param args - The arguments to pass to the tool
   */
  abstract toolCall(toolName: string, args: Record<string, any>): Promise<string> | string
}

PluginContext class

import type { Logger } from './logger'
export abstract class PluginContext {
  /**
   * Render a URL in the assistant web browser and get the response content
   * 
   * @param url - The URL to render
   * @returns The rendered content (like HTML)
   */
  abstract renderUrl(url: string): Promise<string>

  /** Get Aloha default logger instance 
   *  You can use it to log messages from your plugin
   * 
   * @returns The logger instance
  */
  abstract getLogger(): Logger
}

SDK API Usage Example

import { Plugin } from 'aloha-sdk'
import type { Logger, PluginContext } from 'aloha-sdk'

export default class MyPlugin extends Plugin {
  private logger: Logger;

  constructor(context: PluginContext) {
    super(context);
    this.logger = context.getLogger();
  }

  async toolCall(toolName: string, args: { taskName: string }): Promise<string> {
    if (toolName === "getTaskDate") {
      const url = `https://cool-tasks.com/${args.taskName}`
      const body = await this.getContext().renderUrl(url)
      try {
        const taskDate = ... // use response body to extract date
        return `${args.taskName} due date is ${taskDate}`;
      } catch (exc: any) {
        this.logger.error(`Failed to parse due date of task ${args.taskName}: ${body}`, exc);
        throw new Error(`Sorry, we couldn't find the due date of '${args.taskName}' task.`)
      }
    }

    throw new Error(`This tool is not available`)
  }
}

CLI Usage

See: CLI Documentation


alohadesktop.com