import type { ConfigSource } from '../config/types.js'; import type { Logger } from '../logging/types.js'; import { type PluginDiscoveryOptions } from './discovery.js'; /** * Options passed to plugin hooks during initialization. * Mirrors the shape of the CLI hook options but without oclif-specific fields. */ export interface PluginHookOptions { /** Named instance (if known) */ instance?: string; /** Explicit config file path (if known) */ configPath?: string; /** Account Manager host override */ accountManagerHost?: string; /** CLI flags or equivalent options */ flags?: Record; } /** * Orchestrates plugin discovery, loading, and hook invocation for non-oclif consumers * (VS Code extension, MCP server, etc.). * * Replicates the hook collection logic from `base-command.ts:412-530` without * depending on `@oclif/core`. */ export declare class B2CPluginManager { private _initialized; private _middlewareApplied; private _pluginNames; private _sourcesBefore; private _sourcesAfter; private _httpMiddleware; private _authMiddleware; private readonly logger?; private readonly discoveryOptions?; constructor(options?: { logger?: Logger; discoveryOptions?: PluginDiscoveryOptions; }); /** * Discovers installed plugins and invokes their hooks. * * Collects config sources, HTTP middleware, and auth middleware providers. */ initialize(hookOptions?: PluginHookOptions): Promise; /** * Collects config sources from a hook result, applying priority mapping * matching `base-command.ts:434-457`. */ private collectConfigSources; /** * Returns the collected config sources split by priority. */ getConfigSources(): { sourcesBefore: ConfigSource[]; sourcesAfter: ConfigSource[]; }; /** * Registers collected middleware providers and config sources with the global registries. * * After calling this method: * - HTTP middleware is available to all SDK client factories via {@link globalMiddlewareRegistry} * - Auth middleware is available to OAuth strategies via {@link globalAuthMiddlewareRegistry} * - Config sources are available to {@link resolveConfig} via {@link globalConfigSourceRegistry} */ applyMiddleware(): void; /** Names of all discovered plugins */ get pluginNames(): string[]; /** Whether initialize() has been called */ get initialized(): boolean; }