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

@haloforge/plugin-sdk

v0.2.2

Published

HaloForge Plugin SDK — build frontend components for HaloForge plugins

Readme

@haloforge/plugin-sdk

The official frontend SDK for building HaloForge plugins.

Install

npm i @haloforge/plugin-sdk react react-dom @tauri-apps/api lucide-react
npm i -D typescript @types/react @types/react-dom

react, react-dom, @tauri-apps/api, and lucide-react are peer dependencies and should be installed in the plugin frontend project.

Minimal Frontend Entry

import { definePlugin, invokePlugin, registerPlugin } from "@haloforge/plugin-sdk";

function HelloButton() {
  async function handleClick() {
    const result = await invokePlugin<{ message: string }>("hello", { name: "HaloForge" });
    alert(result.message);
  }

  return <button onClick={() => void handleClick()}>Greet</button>;
}

export default registerPlugin("com.example.hello-plugin", definePlugin({
  slots: {
    "devkit.toolbar": HelloButton,
  },
}));

What To Use

  • definePlugin: Level 1 and Level 2 plugins such as tabs and slot injections.
  • defineModulePlugin: Level 0 plugins that provide a full module panel.
  • defineAssistantPlugin: Level 3 plugins that register an assistant UI.
  • registerPlugin: register the bundle with HaloForge's runtime registry.
  • invokePlugin: call commands exposed by your Rust backend.
  • useHostNavigation, useHostFileIntent, useHostModels, useHostAI: stable host integration hooks for black-box-compatible plugins.
  • pickHostFile, pickHostDirectory, saveHostFile: stable host file dialog helpers.
  • usePluginSettings, useHostData, useSlotContext: read plugin and host state inside your React components.
  • useAppTheme: read HaloForge theme mode and CSS variables inside your plugin.
  • AppSelect: use the same host-styled dropdown/listbox HaloForge uses in the app.

Public Host API

Prefer these host helpers over reading window.__HF_HOST directly:

  • useHostNavigation() for module switches and settings tabs
  • useHostFileIntent() for startup/external file-open intents
  • pickHostFile() / pickHostDirectory() / saveHostFile() for host-owned file dialogs
  • useHostModels() / useAvailableModels() for model lists and current selection
  • useHostAI() for AI transport, session creation, stream-state polling, and generation stop
  • useHostTheme() for theme tokens
  • useHostEvent() for stable host events

These helpers currently adapt to HaloForge's existing host bridge internally, but they give plugin authors one documented surface that can keep working as HaloForge evolves.

Host-styled Selects

import { AppSelect } from "@haloforge/plugin-sdk";

export function ModelPicker({
  value,
  onChange,
}: {
  value: string;
  onChange: (next: string) => void;
}) {
  return (
    <AppSelect
      value={value}
      onChange={(event) => onChange(event.target.value)}
      className="w-full rounded-xl border border-border bg-background px-3 py-2 text-sm text-foreground"
    >
      <option value="gpt-5.4">GPT-5.4</option>
      <option value="claude-sonnet-4.6">Claude Sonnet 4.6</option>
    </AppSelect>
  );
}

AppSelect follows the active HaloForge theme automatically, so plugin dropdowns match the host app in both light and dark mode.

Typical Setup

  1. Build the native backend with haloforge-plugin-api.
  2. Build the frontend bundle with this SDK.
  3. Point manifest.json to the emitted frontend file via entry.frontend.
  4. Load the plugin inside HaloForge and call invokePlugin from mounted components.

Related Packages

  • Rust backend crate: haloforge-plugin-api
  • Repository: https://github.com/HaloForgeAI/haloforge-plugin-api
  • HaloForge homepage: https://github.com/HaloForgeAI