/** * @fileoverview Plugin discovery for the project-local layout. * * Discovery is descriptor-driven: the caller passes a `PluginLayout` * (`{ domain, userSubdirs }`) declared by the owning tool. The kernel * never enumerates tool domains itself (ADR-0009 corollary 1). Two * artifact sources are walked for the layout: * * 1. USER SOURCE — `/opensip-tools///*.{js,mjs}` * for each `kind` in `layout.userSubdirs` (e.g. `checks`/`recipes` * for fitness, `scenarios`/`recipes` for simulation). Auto-loaded * by directory presence; no config opt-in. * * 2. NPM PLUGINS — packages installed under * `/opensip-tools/.runtime/plugins//node_modules/` * whose names appear in the project's * `opensip-tools.config.yml#plugins.: [...]`. The explicit * list is required so a `plugin install` step is intentional, not * an accidental load of every transitive devDep. * * A layout with an empty `userSubdirs` and no declared npm plugins * (e.g. the language-adapter domain, whose adapters ship as direct CLI * deps) discovers nothing — an emergent property, not a special case. */ import type { DiscoveredPlugin, PluginLayout } from './types.js'; /** * Discover all plugins for a layout in the project layout. * * Returns a list of `DiscoveredPlugin` entries (loose .mjs files + * npm packages) for the loader to import. Discovery is silent on a * missing project directory or absent subdirs — callers that care * about "did we find anything?" should check the returned length. * * @param layout The owning tool's `PluginLayout` (`{ domain, * userSubdirs }`). * @param projectDir Project root. Required — there is no user-global * fallback. Pass undefined to discover nothing * (used by callers that don't have a project * context yet). */ export declare function discoverPlugins(layout: PluginLayout, projectDir?: string): DiscoveredPlugin[]; /** * Read the declared plugin list for a domain from the project config. * Returns undefined when the config is absent, unreadable, or has no * entry for the domain. Does NOT throw on YAML parse errors — returns * undefined so discovery falls through gracefully and the config-layer * schema validation surfaces parse errors on its own path. * * Config-path resolution mirrors `resolveProjectConfigPath` (the same * helper the targets loader uses): --config flag → `package.json# * opensip-tools.configPath` pointer → default `/opensip- * tools.config.yml`. Without this, projects that locate their config * via the package.json pointer have their `plugins.: [...]` * declaration silently ignored — discovery falls through to the empty * default path and the plugin pack never registers. * * The `--config` precedence is honored only when callers pass through * their explicit value via `explicitConfigPath`; this entry point is * the implicit one (no --config available at the discovery seam), so * we resolve without an explicit path and rely on the pointer + default. */ export declare function readProjectPluginsList(projectDir: string, domain: string): readonly string[] | undefined; //# sourceMappingURL=discover.d.ts.map