Plugins

Extend Clarity with custom tools. Safe, permissioned, and documented.

Overview

Plugins run in an isolated sandbox with scoped permissions. You define a manifest, implement one or more actions, and optionally register UI hooks to surface controls inside the editor.

Manifest

{
  "name": "clarity-citations",
  "version": "1.0.0",
  "description": "Insert and format citations",
  "permissions": ["network", "clipboard"],
  "actions": [
    {"id": "scan", "title": "Scan References"},
    {"id": "insertCitation", "title": "Insert Citation"}
  ],
  "ui": {
    "panel": true,
    "quickActions": ["insertCitation"]
  }
}

UI Hooks

  • Panel: Renders a right-side panel with your plugin UI.
  • Quick Actions: Add small buttons to the toolbar or command palette.
  • Context Tools: Show actions based on selection (coming soon).

Running a Plugin

POST /v1/plugins/run
Authorization: Bearer CLARITY_API_KEY
Content-Type: application/json

{
  "plugin": "clarity-citations",
  "action": "insertCitation",
  "args": {"query": "LLMs in education"}
}