File size: 1,294 Bytes
04d8658
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/** Types for the dashboard plugin system. */

export interface PluginManifest {
  name: string;
  label: string;
  description: string;
  icon: string;
  version: string;
  tab: {
    path: string;
    position: string;  // "end", "after:<tab>", "before:<tab>"
    /** When set to a built-in route path (e.g. `"/"`, `"/sessions"`), this
     *  plugin's component replaces the built-in page at that route rather
     *  than adding a new tab. Useful for themes that want a custom home
     *  page without losing the rest of the dashboard. */
    override?: string;
    /** When true, the plugin registers its component and slot contributors
     *  without adding a tab to the nav. Used by slot-only plugins (e.g. a
     *  plugin that just injects a header crest). */
    hidden?: boolean;
  };
  /** Named shell slots this plugin populates. Mirrored by the backend's
   *  manifest discovery; used purely as a documentation/discovery aid —
   *  actual slot registration happens when the plugin's JS bundle calls
   *  `window.__HERMES_PLUGINS__.registerSlot(name, slot, Component)`. */
  slots?: string[];
  entry: string;
  css?: string | null;
  has_api: boolean;
  source: string;
}

export interface RegisteredPlugin {
  manifest: PluginManifest;
  component: React.ComponentType;
}