/** * ManifestAutoLoader — scan a plugins directory and auto-register every * plugin whose `plugin.manifest.json` declares `autoRegister: true`. * * Resolution order for the register function inside `runtimeEntry`: * 1. `module.registerTraitHandlers` — canonical name (preferred). * 2. First export matching `/^register\w+TraitHandlers$/` — backward- * compat with older plugins that use a domain-specific name (e.g. * `registerRoboticsTraitHandlers`). * * This is intentionally a runtime utility (Node.js `fs` + dynamic `import`) * and must NOT be bundled into browser builds. Tree-shake it out or use a * server-side entry that imports from `@holoscript/core/plugin-manifest/auto-loader`. */ import type { TraitRegistrarTarget } from '../runtime/plugin-trait-registrar'; export interface AutoLoadResult { /** Plugin ids successfully registered. */ loaded: string[]; /** Plugin ids with `autoRegister: false` — intentionally skipped. */ skipped: string[]; /** Plugins that encountered an error during load or registration. */ failed: Array<{ id: string; error: string; }>; } /** * Scan `pluginsDir` for subdirectories containing `plugin.manifest.json` and * auto-register all plugins whose manifest has `autoRegister: true`. * * @param pluginsDir Absolute path to the plugins root (e.g. `packages/plugins`). * @param registrar Runtime registrar to call each plugin's register function with. * @returns Summary of what was loaded, skipped, and failed. */ export declare function autoLoadPluginsFromManifests(pluginsDir: string, registrar: TraitRegistrarTarget): Promise;