Skip to content

Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.

356 B
Raw Blame
export function createPluginRegistry<TPlugin extends { metadata: { id: string } }>() {
  const plugins = new Map<string, TPlugin>();
  return {
    register(plugin: TPlugin) {
      plugins.set(plugin.metadata.id, plugin);
    },
    get: (id: string) => plugins.get(id),
    getAll: () => [...plugins.values()],
    ids: () => [...plugins.keys()],
  };
}