Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Extension Architecture

Hone has two extension systems that coexist: V1 built-in extensions for language support that ships with the IDE, and V2 plugins for third-party and community extensions distributed via the marketplace.

V1 Built-in Extensions (hone-extensions/)

Language Packs

11 built-in language extensions ship with the IDE binary:

ExtensionLanguages
TypeScriptTypeScript, JavaScript, JSX, TSX
PythonPython
RustRust
GoGo
C++C, C++, Objective-C
HTML/CSSHTML, CSS, SCSS, Less
JSONJSON, JSONC
MarkdownMarkdown
DockerDockerfile, Docker Compose
TOML/YAMLTOML, YAML
GitGit commit, Git rebase, .gitignore

Manifest Format

Each V1 extension declares a hone-extension.json manifest:

{
  "name": "typescript",
  "displayName": "TypeScript Language",
  "version": "1.0.0",
  "activationEvents": [
    "onLanguage:typescript",
    "onLanguage:javascript"
  ],
  "contributes": {
    "languages": [
      {
        "id": "typescript",
        "extensions": [".ts", ".tsx"],
        "aliases": ["TypeScript"]
      }
    ],
    "lspServer": {
      "command": "typescript-language-server",
      "args": ["--stdio"],
      "languages": ["typescript", "javascript"]
    },
    "commands": [],
    "snippets": [
      {
        "language": "typescript",
        "path": "./snippets/typescript.json"
      }
    ]
  }
}

Loading

V1 extensions are loaded by ExtensionRegistry in hone-core:

  1. Scan hone-extensions/ directory for hone-extension.json manifests
  2. Parse manifests and register language contributions
  3. Activate extensions lazily based on activation events (e.g., when a TypeScript file is opened)
  4. Start LSP servers as needed

V2 Plugin SDK (hone-extension/)

Overview

V2 plugins are independent packages compiled to native binaries via Perry. They use the @hone/sdk package for the plugin API.

Plugin Structure

import { HonePlugin, HoneHost } from '@hone/sdk';

class MyPlugin extends HonePlugin {
  activate(host: HoneHost): void {
    host.commands.registerCommand('myPlugin.hello', () => {
      host.window.showInformationMessage('Hello from my plugin!');
    });
  }

  deactivate(): void {
    // cleanup
  }
}

HoneHost Interface

HoneHost provides 80+ types covering:

  • commands – register and execute commands
  • window – show messages, create output channels, status bar items
  • workspace – access files, folders, settings
  • editor – manipulate the active editor (selections, decorations, edits)
  • languages – register language features (completions, hover, diagnostics)
  • debug – register debug adapters
  • terminal – create and manage terminal instances

Execution Tiers

Plugins run in one of three tiers based on their declared permissions:

TierCapabilitiesIsolation
InProcessUI-only (commands, decorations, status bar)Runs in main process
PluginHostEditor access, file system readSeparate plugin host process
IsolatedProcessNetwork, file system write, spawn processesFully sandboxed process

The tier is declared in the plugin’s package.json:

{
  "hone": {
    "tier": "PluginHost",
    "permissions": ["fs.read", "editor"]
  }
}

Distribution

V2 plugins are distributed via the Hone marketplace (marketplace.hone.codes):

  1. Buildhone-build submits the plugin source to perry-hub workers for cross-platform compilation
  2. Publish – compiled binaries are uploaded to the marketplace
  3. Install – IDE downloads the platform-appropriate binary from the marketplace
  4. Update – marketplace notifies IDE of available updates

CLI

The hone-extension package includes a CLI for plugin development:

  • hone ext init – scaffold a new plugin project
  • hone ext build – compile the plugin
  • hone ext publish – publish to the marketplace
  • hone ext test – run plugin tests

Coexistence

Both systems can:

  • Register commands in the command registry
  • Contribute UI elements (sidebar views, status bar items, decorations)
  • Interact with the editor (read/write documents, manage cursors)
  • Respond to lifecycle events

V1 extensions handle core language support and ship bundled with the IDE. V2 plugins extend the IDE with third-party functionality and are installed independently by users. Both register with the same underlying command and contribution systems, so they interoperate seamlessly.