Plugins & API
This page is the unified reference for RelayCraft plugin capabilities and RelayCraft.api.
What Plugins Can Extend
Section titled “What Plugins Can Extend”- Left sidebar pages (
api.ui.registerPage) - Standard UI slots (
api.ui.registerSlot) - Traffic context menu actions (
api.ui.registerContextMenuItem) - Rule automation (
api.rules.createMock) - Traffic analytics (
api.traffic.listFlows,api.traffic.getFlow) - Runtime-aware dashboards (
api.host.getRuntime)
Runtime Entry
Section titled “Runtime Entry”Plugin UI code receives:
RelayCraft.api: scoped plugin APIRelayCraft.components: curated host UI componentsRelayCraft.icons: curated icon set
ProxyPilot is kept as a compatibility alias of RelayCraft.
Manifest Essentials
Section titled “Manifest Essentials”Each plugin defines metadata, capabilities, and permissions in plugin.yaml.
manifestVersion: "1.0"id: "com.example.my-plugin"name: "My Plugin"version: "0.1.0"entry: ui: "dist/index.js"permissions: - traffic:read - rules:writecapabilities: ui: pages: - id: "my-page" title: "My Page" icon: "Puzzle" path: "/my-page"Permission Model
Section titled “Permission Model”Restricted API calls are blocked unless the permission is declared in permissions.
| API Method | Required Permission |
|---|---|
stats.getProcessStats | stats:read |
rules.list | rules:read |
rules.get | rules:read |
rules.createMock | rules:write |
traffic.listFlows | traffic:read |
traffic.getFlow | traffic:read |
host.getRuntime does not require additional permission.
Namespace Overview
Section titled “Namespace Overview”t(key, options?)changeLanguage(lng)getCurrentLanguage()
register(theme)remove(themeName)list()
registerPage(page)unregisterPage(pageId)registerSlot(slotName, component, props?)unregisterSlot(slotId)registerContextMenuItem(item)unregisterContextMenuItem(itemId)toast(message, type?)
chat(messages)complete(prompt, options?)
getProcessStats()
getStatus()start()stop()restart()
settings
Section titled “settings”get(key?)set(key, value)watch(key, cb)
info(message, context?)warn(message, context?)error(message, context?)debug(message, context?)
send(request)
storage
Section titled “storage”get(key)set(key, value)remove(key)clear()list()
events
Section titled “events”on(eventName, callback)off(eventName, callback)emit(eventName, payload)
list(filter?)get(id)createMock(config)
traffic
Section titled “traffic”listFlows(filter?)getFlow(id, options?)
getRuntime()
UI Slots
Section titled “UI Slots”Standard slot names:
sidebar-topsidebar-bottomstatus-bar-leftstatus-bar-centerstatus-bar-rightflow-detail-tabsflow-detail-actions
Traffic API Shape
Section titled “Traffic API Shape”listFlows(filter?)
Section titled “listFlows(filter?)”Filter fields:
sessionId,method,host,urlPattern,statusoffset,limit
Response fields:
flows[]total,offset,limit,hasMore
getFlow(id, options?)
Section titled “getFlow(id, options?)”Options:
includeBodies(defaultfalse)maxBodyBytes(default128KB, host hard cap2MB)
Response includes request/response metadata and rule hit info.
Compatibility Notes
Section titled “Compatibility Notes”- RelayCraft keeps v1 APIs backward compatible.
- New APIs are additive.
- Permission checks are enforced at runtime by the host bridge.