/** * Plugin loader — loads OpenClaw-compatible plugins from the filesystem. * * This is a lightweight reimplementation of OpenClaw's plugin loading pipeline. * It reads `openclaw.plugin.json` manifests, loads entry point modules, and * calls the plugin's register function to collect tools and connectors. * * Unlike OpenClaw's loader, this does NOT use jiti (TypeScript-aware imports). * It expects plugins to be pre-compiled to JavaScript, or uses Node's native * TypeScript support (--experimental-strip-types in Node 22+). * * @module */ import type { Connector, Tool, ToolFactory } from "../types.js"; /** Parsed openclaw.plugin.json manifest. */ export interface PluginManifest { id: string; name?: string; description?: string; version?: string; kind?: "memory"; configSchema?: Record; channels?: string[]; providers?: string[]; skills?: string[]; } /** A fully loaded plugin with its collected registrations. */ export interface LoadedPlugin { id: string; name: string; description?: string; version?: string; source: string; tools: Tool[]; toolFactories: Array<{ factory: ToolFactory; names?: string[]; optional?: boolean; }>; connectors: Connector[]; } export interface PluginLoaderOptions { /** * Directories to scan for plugins. * Each directory should contain plugin subdirectories with `openclaw.plugin.json`. */ searchPaths: string[]; /** * Explicit plugin IDs to enable. If undefined, all discovered plugins are enabled. */ enabledPlugins?: string[]; /** * Plugin IDs to skip. */ disabledPlugins?: string[]; /** * Logger for diagnostic messages. */ logger?: { info: (msg: string) => void; warn: (msg: string) => void; error: (msg: string) => void; }; } /** * Discover and load plugins from the filesystem. * * Scans the provided search paths for directories containing * `openclaw.plugin.json` manifests, loads their entry points, and * calls the register function to collect tools and connectors. * * @param options - Loader configuration. * @returns Array of loaded plugins. */ export declare function loadPlugins(options: PluginLoaderOptions): Promise; //# sourceMappingURL=loader.d.ts.map