(id: string)
| 49 | }; |
| 50 | |
| 51 | const requireInstance = (id: string) => { |
| 52 | const plugin = usePluginStore.getState().plugins[id]; |
| 53 | if (!plugin) { |
| 54 | throw new Error(`Plugin ${id} not found`); |
| 55 | } |
| 56 | if (!plugin.instance) { |
| 57 | throw new Error(`Plugin ${id} has no instance`); |
| 58 | } |
| 59 | return plugin; |
| 60 | }; |
| 61 | |
| 62 | type LoadedPluginData = { |
| 63 | metadata: PluginMetadata; |