HaloForge Plugin API
Build native plugins for HaloForge — the Game Dev Team Workbench & AI Assistant.
This repository contains both the Rust crate and the JavaScript/TypeScript SDK that plugin authors need.
- SDK repository: https://github.com/HaloForgeAI/haloforge-plugin-api
- HaloForge homepage: https://github.com/HaloForgeAI
Packages
| Package | Language | Registry | Install |
|---|---|---|---|
haloforge-plugin-api |
Rust | crates.io | cargo add haloforge-plugin-api serde_json |
@haloforge/plugin-sdk |
TypeScript | npm | npm i @haloforge/plugin-sdk react react-dom @tauri-apps/api lucide-react |
@haloforge/plugin-pack |
CLI | npm | npx @haloforge/plugin-pack check . |
Start a Plugin
1. Create the Rust backend
Then make sure your crate builds as a dynamic library:
# Cargo.toml
[]
= ["cdylib"]
2. Create the frontend bundle
You can use any React-compatible bundler. A minimal setup looks like this:
Build your frontend into the file referenced by manifest.json under entry.frontend.
3. Add a manifest.json
Every plugin ships with a manifest.json that declares compatibility, capabilities, entry points, and permissions.
Permission names are strict. For AI Chat access, the only valid manifest permission name is host_aichat_access.
4. Implement the native backend
use *;
;
declare_plugin!;
5. Implement the 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,
},
}));
When HaloForge loads the bundle, it injects the runtime plugin context needed by invokePlugin, slot context, and the public host hooks. Plugin authors should prefer the SDK hooks over touching window.__HF_HOST directly.
For host-owned file pickers and AI transport helpers, the SDK also exports:
pickHostFile()pickHostDirectory()saveHostFile()useHostAI().createSession(...)useHostAI().getStreamState(...)
6. Validate and package the plugin
The packer validates manifest.json, builds the Rust backend, builds the frontend bundle, collects optional assets/ and LICENSE, then writes a .hfpkg archive into dist/.
Recommended Layout
my-plugin/
Cargo.toml
manifest.json
src/
lib.rs
frontend/
package.json
src/
index.tsx
Plugin Manifest
The most important manifest fields are:
capability_levels: which HaloForge extension tiers your plugin uses.integration: per-level configuration, like slot IDs or module metadata.entry.native: the compiled Rust library paths for each platform you ship.entry.frontend: the built JavaScript bundle HaloForge should load.host_capabilities: stable black-box-compatible host features consumed through@haloforge/plugin-sdk.permissions: the host capabilities your plugin needs approved.
See the HaloForge organization for real plugin examples.
Additional docs:
CLI Packager
@haloforge/plugin-pack is the public packager for HaloForge plugins.
hf-pack check <plugin-dir>validatesmanifest.json.hf-pack info <plugin-dir-or-.hfpkg>prints plugin metadata.hf-pack pack <plugin-dir>builds and assembles a distributable.hfpkgarchive.
It rejects invalid permission names such as host_a_i_chat_access and points plugin authors to the canonical host_aichat_access name.
hf-pack metadata <path.hfpkg>emits catalog draft JSON and can sign it directly for official plugin publishing.hf-pack submit <catalog-draft.json>uploads that draft toadmin.haloforge.link.
The CLI supports these plugin layouts:
manifest.jsonat the plugin root.- Rust backend in
backend/Cargo.toml,native/Cargo.toml,rust/Cargo.toml, or rootCargo.toml. - Frontend app in
frontend/package.json,ui/package.json,web/package.json,app/package.json, or rootpackage.json. - Optional
assets/,native/, andLICENSEfiles in the plugin root.
It also supports common build-output layouts where the manifest points to packaged paths like frontend/index.js, while the actual frontend build emits files under frontend/dist/ or frontend/build/.
hf-pack check and hf-pack pack also warn on:
- direct
__HF_HOSTaccess - direct host IPC strings such as
aichat_send_message - direct
plugin_invokeusage instead ofinvokePlugin()/invokeOtherPlugin()
Capability Levels
| Level | Type | Description |
|---|---|---|
| 0 | Module | Full sidebar module |
| 1 | Module Feature | Tab inside an existing module |
| 2 | UI Extension | Inject into UI slots |
| 3 | AI Assistant | Custom AI assistant persona |
| 4 | Service | Workflow step types & background services |
License
MIT