Hive

Extensions

Hive is designed to be extended into personal software. An extension is a single folder with a manifest (hive-extension.json) and, if it does more than declare themes or shell commands, one small program Hive runs and talks to over JSON-RPC on stdin and stdout. You don't have to build a window, host a server, wire up OAuth, or write a keychain wrapper: Hive draws your UI from blocks, holds your secrets and small storage, exposes your tools to every agent thread over MCP, and connects you to the project's event bus.

Agents call its tools as mcp__hive__<tool> You see its views, cards, commands, settings Hive reads the manifest refuses what it doesn't declare draws blocks keeps secrets, storage Your program hive-extension.json main.js a child process, its own process group tools/call card/present
Hive is the only thing that draws, holds secrets, or talks to agents. Your program answers calls and sends a few requests of its own.

The manifest

Every extension starts with hive-extension.json. Four fields are required: id (lowercase letters, digits and dashes, starting with a letter), name, version, and api (the protocol version, currently 1). A manifest with only those and declarative contributions (themes, prompts, shell commands) is a valid, data-only extension that runs no process at all.

Add run and contributes for an active extension:

{
  "id": "standup",
  "name": "Standup",
  "version": "0.1.0",
  "api": 1,
  "description": "Collects each thread's standup note and shows today's count in the title bar.",
  "category": "Tools",
  "run": ["node", "main.js"],
  "requires": [{ "program": "node", "fix": "Install Node.js" }],
  "permissions": ["events:emit"],
  "contributes": {
    "tools": [{
      "name": "standup_note",
      "description": "Record what this thread did today, in one line.",
      "inputSchema": {
        "type": "object",
        "properties": { "text": { "type": "string" } },
        "required": ["text"]
      }
    }],
    "views": [
      { "id": "status", "title": "Standup", "where": "titlebar.status" },
      { "id": "today", "title": "Standup", "where": "deck.section" }
    ],
    "events": {
      "emits": [{ "type": "standup.logged" }]
    }
  }
}

Top-level manifest fields (defined in internal/ext/manifest.go):

Hive reads the manifest before running any code, and refuses any tool, view, card, download, or event the manifest doesn't declare.

What an extension can contribute

Everything an extension adds is declared under contributes. You can mix and match any of these in one extension:

Tools for agents (contributes.tools)

Every enabled extension's tools are served on Hive's MCP server so agents call them as mcp__hive__<name>. Each tool declares name, description, and JSON inputSchema, plus optional:

A tool handler receives its parsed arguments and a caller object (the thread, project, role, title, and machine). If two extensions declare the same tool name, the first loaded wins. A tool call times out after 5 minutes. You can also add contributes.instructions (appended to MCP server instructions) and contributes.briefs (appended to the system prompt of agents working in matching folders).

Views and the title bar (contributes.views)

An extension never draws raw pixels. A view returns blocks — a fixed vocabulary of rows, text, buttons, actions, lists, fields, progress bars, sections, empty states, and dividers that Hive renders in its own theme. A view's where chooses its slot:

Place Where it appears
titlebar.status A short status pill in the window's title bar on every page: its first row's text, subtitle as tooltip, and action on click
deck.section A section on the deck after Hive's own cards: compact rows (five, then See more)
workspace.pane A workspace pane kind. Set web to show an HTML file from the extension's folder or a URL instead of blocks
project.section, project.side, project.header The project page: a main section, a side list, or a header button
projects.menu Extra items in a project card's menu
repo.tab, repo.header A tab or header facts on the repo page
workspace.details, chat.side, settings.page The workspace details sidebar, the chat side column, or the extension's own settings page

Call hive.changed(viewId) whenever a view's data changes and Hive re-renders it if it's on screen.

Cards and the deck (contributes.cards, contributes.deck)

Commands, settings, themes, prompts, and list sources

Capabilities: provides and using capabilities

Parts in Hive compose loosely through named capabilities (internal/ext/provides.go):

Accounts, secrets, and storage

Trusted versus untrusted

The Extension Store (on the rail) shows where every extension comes from and what it asks for — platforms, size, publisher, trust level, and required or optional capabilities and downloads — before you install it:

Kind What it is
Core Ships inside Hive. Loads only when it matches the exact build of Hive.
Trusted Listed as first-party in the Extension Store index.
Untrusted Anything else: community store listings, git URLs, or a local folder you linked while developing.

Trust is a provenance label, not a sandbox yet: today every extension's program runs as you, with your user permissions. Declared permissions are shown on the Extension Store page before install and again when an update adds a new permission; a sandbox enforcing them for third-party extensions is planned.

Only a person installs an extension. A project never brings or installs one (even when trusted), and agents have no tool to install extensions. A folder dropped into Hive's extensions directory is listed as found and nothing runs until you press Install. Installs are sealed: Hive only loads an installed extension with the install record you created.

Permissions

Declare permissions when your extension needs more than Hive's core API:

Permission Means Enforced today
network Network access Shown, not enforced
files:project Files in the project Shown, not enforced
files:home Files in your home folder Shown, not enforced
processes Starting other programs Shown, not enforced
screen Seeing the screen Shown, not enforced
input Input to other apps Shown, not enforced
microphone The microphone Shown, not enforced
deck Reading/answering cards and starting, reading, messaging, stopping threads Yes
preview Styling a project's web preview (CSS only) Yes
events:emit Publishing declared event types onto project event logs Yes
events:read Subscribing to declared event prefixes on enabled projects Yes

The event bus (emit and subscribe)

Extensions can participate directly in Hive's event bus — publishing their own events for automations to react to, or subscribing to thread, task, CI, and landing events without polling.

Declare contributes.events and the matching permissions (events:emit, events:read):

{
  "permissions": ["events:emit", "events:read"],
  "contributes": {
    "events": {
      "emits": [{ "type": "standup.logged" }],
      "reads": ["task.", "ci."]
    }
  }
}

Other host notifications an extension hears automatically: hive/changed (projects or theme changed), settings/changed, requirements/changed, toast/action, and shutdown.

Installing or turning on an extension never approves a download. No binary, model, or dataset is fetched on install or enable. Every download waits for the user's explicit yes — from the Download button on the extension's page in Settings ▸ Extensions, or from a Hive consent prompt that names what it is, how big it is, and where it comes from. Consent is stored per item, so a previously approved item can be re-fetched if its file is missing.

Declare each item in contributes.downloads:

"downloads": [{
  "id": "whisper-small",
  "what": "Speech model (small)",
  "kind": "data",
  "optional": true,
  "from": "huggingface.co",
  "url": "https://huggingface.co/…/ggml-small.bin",
  "size": 487601967,
  "sha256": "…64 hex characters…",
  "why": "Turns your speech into text, on this computer."
}]

Protocol methods:

Method What it does
download/request Requests an item and returns its state (pending while waiting for the user, declined if refused, or starts/finds the verified file if approved)
download/status Returns the current state without prompting the user
download/progress Core extensions report progress on managed assets (downloading is refused without consent; ready for an already-present asset is accepted)
download/changed Host notification when the user answers or a host download changes state

States are not_requested, pending, approved, declined, downloading, ready, and failed. A ready host download includes path to the verified file. In Go (ext/sdk/), use Host.DownloadRequest, Host.DownloadStatus, Host.DownloadProgress, and DownloadChanged; in JavaScript, send the JSON-RPC requests directly.

The JavaScript SDK (extensions/sdk/hive.js)

extensions/sdk/hive.js is a single zero-dependency file for Node or Bun: copy it beside your main.js. It redirects console.log to stderr automatically so stdout stays valid JSON-RPC 2.0. (A Go SDK also lives in ext/sdk/, and extensions/lanes/ is a complete extension built on it.)

API What it does
hive.tool(name, (args, caller) => ...) Register a handler for a tool in contributes.tools
hive.view(id, render, act) Register a view's render({ project }) and optional act({ project, action, value })
hive.card(kind, render, act) Register a card kind's render({ card, payload }) and act(...)
hive.command(id, ({ project }) => ...) Register a handler for a command without a shell run line
hive.provide(capability, (method, params) => ...) Answer capability/call for a capability in contributes.provides
hive.emit(capability, event, data) Send a capability/event notification to users of that capability
hive.events.emit(ev) Publish a declared event on the project event bus (events/emit)
hive.events.subscribe(opts, onBatch) Subscribe to declared event prefixes (events/subscribe); returns { id, cursor, unsubscribe }
hive.changed(viewId) Ask Hive to re-render a view if it is on screen
hive.present(card) Present one of your card kinds on the deck (card/present)
hive.toast(t) / hive.removeToast(id) / hive.onToastAction(fn) Show, replace, or dismiss a bottom-right notice with up to two action buttons
hive.open(url) Open an http(s), mailto, or hive:// link
hive.storage.get(key) / set(key, value) Persist small JSON values in the extension's data folder
hive.secrets.get(key) / set(key, value) / delete(key) Store and read secrets in the OS keychain
hive.settings / hive.onSettings(fn) Read current settings and react when the user changes them
hive.info / hive.onInfo(fn) Read { projectsFolder, projects, theme } and react to hive/changed
hive.requirements() / hive.onRequirements(fn) Inspect requirement status and react to requirements/changed
hive.themes() / hive.setTheme(name, opts) List or switch Hive themes
hive.log(text) / hive.unavailable(why) / hive.onShutdown(fn) Write to extension logs, mark unavailable, or clean up on exit

Worked example: zero to installed

Let's build Standup, a tiny personal-software extension that gives every agent a standup_note tool, shows today's count in the title bar, lists today's notes on the deck, and emits a standup.logged event when a note arrives.

1. Create the folder and copy the SDK

mkdir -p ~/Code/standup-ext
cp <hive-checkout>/extensions/sdk/hive.js ~/Code/standup-ext/hive.js

2. Write hive-extension.json

Save this as ~/Code/standup-ext/hive-extension.json:

{
  "id": "standup",
  "name": "Standup",
  "version": "0.1.0",
  "api": 1,
  "description": "Collects one-line standup notes from your threads.",
  "category": "Tools",
  "run": ["node", "main.js"],
  "requires": [{ "program": "node", "fix": "Install Node.js" }],
  "permissions": ["events:emit"],
  "contributes": {
    "tools": [{
      "name": "standup_note",
      "description": "Record what this thread accomplished today, in one line.",
      "inputSchema": {
        "type": "object",
        "properties": { "text": { "type": "string" } },
        "required": ["text"]
      }
    }],
    "views": [
      { "id": "status", "title": "Standup", "where": "titlebar.status" },
      { "id": "today", "title": "Standup", "where": "deck.section" }
    ],
    "settings": [
      { "key": "maxNotes", "title": "Notes shown on deck", "type": "number", "default": 5 }
    ],
    "events": {
      "emits": [{ "type": "standup.logged" }]
    }
  }
}

3. Write main.js

Save this as ~/Code/standup-ext/main.js:

const hive = require("./hive.js");

async function loadNotes() {
  return (await hive.storage.get("notes")) ?? [];
}

hive.tool("standup_note", async ({ text }, caller) => {
  const notes = await loadNotes();
  const entry = {
    text: text.trim(),
    thread: caller.title || caller.thread || "thread",
    project: caller.project || "",
    at: new Date().toISOString(),
  };
  notes.unshift(entry);
  await hive.storage.set("notes", notes.slice(0, 50));

  if (entry.project) {
    await hive.events.emit({
      project: entry.project,
      type: "standup.logged",
      subject: entry.thread,
      data: { text: entry.text },
    });
  }

  hive.changed("status");
  hive.changed("today");
  hive.toast(`Standup logged: ${entry.text}`);
  return "Logged to Standup.";
});

hive.view("status", async () => {
  const notes = await loadNotes();
  return {
    blocks: [{
      type: "row",
      title: `${notes.length} standup`,
      subtitle: notes[0]?.text || "No standup notes yet",
    }],
  };
});

hive.view("today", async () => {
  const notes = await loadNotes();
  const limit = Number(hive.settings.maxNotes) || 5;
  if (!notes.length) {
    return { blocks: [{ type: "empty", text: "No standup notes yet. Ask any thread to log one." }] };
  }
  return {
    blocks: [
      ...notes.slice(0, limit).map((n, i) => ({
        type: "row",
        title: n.text,
        subtitle: n.thread,
        action: { id: "clear-one", value: String(i), title: "Remove" },
      })),
      { type: "button", title: "Clear all", action: "clear" },
    ],
  };
}, async ({ action, value }) => {
  if (action === "clear") {
    await hive.storage.set("notes", []);
  } else if (action === "clear-one") {
    const notes = await loadNotes();
    notes.splice(Number(value), 1);
    await hive.storage.set("notes", notes);
  }
  hive.changed("status");
  hive.changed("today");
});

4. Install and iterate live

  1. Open the Extension Store from the rail (the cube icon below Artifacts).
  2. Scroll to Install from elsewhere ▸ From a folder on this Mac and pick ~/Code/standup-ext.
  3. Hive links the folder (it shows as Untrusted), starts main.js, and reloads it automatically whenever you edit a file (ignoring node_modules and dot-folders).
  4. Try it: open any thread and ask it to call standup_note. Your title bar updates immediately, the note appears in the Standup section on your deck, and standup.logged lands on the project's event bus.
  5. Tweak its maxNotes setting under Settings ▸ Extension settings ▸ Standup.

When you want to share it with someone else, push the folder to a git repository — anyone can install it from Extension Store ▸ Install from elsewhere ▸ From a git repository, where Hive clones it, seals the install, and shows its manifest permissions and downloads before anything runs.

Managing extensions

This page's source is pages/extensions.md in hive/docs.