/** * Plugin discovery and dynamic import for the CLEO provider registry. * * Scans `${CLEO_HOME}/plugins/model-providers/` for `*.{ts,mjs,js,cjs}` files, * imports each one via `pathToFileURL(absPath).href`, and calls the module's * `register` export (named or default) with the plugin API surface. * * - Non-existent plugin directory → silently no-ops (not an error). * - Import errors → logged via `process.stderr` and skipped (never throws). * - Idempotent: the discovery promise is module-level singleton; repeated * calls await the same promise. * * @task T9262 * @epic T9261 (T-LLM-CRED-CENTRALIZATION Phase 3) */ import type { ProviderPluginApi, ProviderProfile } from '@cleocode/contracts'; /** * Return the user plugin directory path — `${CLEO_HOME}/plugins/model-providers`. * * Does NOT check whether the directory exists; callers must handle that. */ export declare function getPluginDir(): string; /** * Scan `pluginDir` for files matching {@link PLUGIN_EXTENSIONS}, sorted * lexicographically for deterministic load order, and load each one. * * Non-existent directories are silently ignored (returns without error). * * @param pluginDir - Absolute path to the plugins directory. * @param api - Plugin API surface passed to each plugin. */ export declare function scanAndLoadPlugins(pluginDir: string, api: ProviderPluginApi): Promise; /** * Build the {@link ProviderPluginApi} surface backed by the given * `registerProvider` function and run full plugin discovery. * * This is the entry-point called by the registry's `ensureDiscovered()` * singleton. It: * 1. Registers all builtin profiles via the provided `builtins` array. * 2. Scans `${CLEO_HOME}/plugins/model-providers/` for user plugins. * * @param registerProvider - The registry's registration function. * @param builtins - Builtin profiles to pre-register before plugins. */ export declare function runDiscovery(registerProvider: (profile: ProviderProfile) => void, builtins: ReadonlyArray): Promise; //# sourceMappingURL=loader.d.ts.map