@botmesh/core - v2.0.0-alpha.2
    Preparing search index...

    Interface PluginSpec<TConfig>

    interface PluginSpec<TConfig = Record<string, unknown>> {
        name: string;
        version: string;
        description?: string;
        requires?: string[];
        multiple?: boolean;
        install(
            ctx: PluginContext,
            config?: TConfig,
        ):
            | void
            | "Plugin.install() must be synchronous and return nothing: bot.plug() does not await it. Do async setup lazily on first use (LazyProvider in @botmesh/ai).";
        uninstall?(ctx: PluginContext): void | Promise<void>;
    }

    Type Parameters

    • TConfig = Record<string, unknown>
    Index
    name: string
    version: string
    description?: string
    requires?: string[]

    Names of plugins that must already be plugged (bot.plug() throws a descriptive error before install() runs otherwise). Checked at plug time only.

    multiple?: boolean

    Allow several instances of this plugin (same name) on one bot at a time, each with its own config and unplugged on its own. Default false: plugging a name that is already plugged throws, so a plugin registered twice by mistake never runs its handlers twice. Every instance must set it.

    • Register the plugin's handlers, hooks and tools. It must be synchronous and return nothing: bot.plug() does not await it. An async install (or one that returns a promise) does not compile (SyncInstallError names the reason); at runtime a rejected promise is still reported on the bot's 'error' event, but the plugin is already considered installed and nothing is rolled back. Do async setup lazily on first use (the LazyProvider pattern in @botmesh/ai).

      Parameters

      Returns
          | void
          | "Plugin.install() must be synchronous and return nothing: bot.plug() does not await it. Do async setup lazily on first use (LazyProvider in @botmesh/ai)."