/**
 * Addon Loader Service
 *
 * Scans ~/.crewly/addons/ on server startup, loads each addon's
 * manifest.json, dynamically imports its entrypoint, and calls
 * addon.register(app, server) so addons can attach routes, WS
 * servers, and middleware to the running Crewly instance.
 *
 * Singleton pattern matching other Crewly services.
 *
 * @module services/addon/addon-loader.service
 */
import type { Application } from 'express';
import type { Server as HttpServer } from 'http';
import type { LoadedAddon } from './addon.types.js';
/**
 * AddonLoaderService discovers and loads addons from the file system.
 *
 * On server startup, call `loadAddons(app, server)` to scan the
 * addons directory and register all valid addons. On shutdown, call
 * `unloadAddons()` to invoke each addon's cleanup hook.
 */
export declare class AddonLoaderService {
    private static instance;
    /** Successfully loaded addons indexed by name */
    private addons;
    private logger;
    private constructor();
    /**
     * Get the singleton instance.
     *
     * @returns The singleton AddonLoaderService instance
     */
    static getInstance(): AddonLoaderService;
    /**
     * Clear the singleton instance (for testing).
     */
    static clearInstance(): void;
    /**
     * Scan the addons directory and load all valid addons.
     *
     * Each addon directory must contain a manifest.json with name,
     * version, and entrypoint fields. The entrypoint module must
     * export a `register(app, server)` function.
     *
     * Errors in one addon do not prevent others from loading.
     *
     * @param app - The Express application instance
     * @param server - The HTTP server instance
     * @returns Array of successfully loaded addon names
     */
    loadAddons(app: Application, server: HttpServer): Promise<string[]>;
    /**
     * Unload all loaded addons, calling their unregister hooks.
     * Called during server shutdown.
     */
    unloadAddons(): Promise<void>;
    /**
     * Get a loaded addon by name.
     *
     * @param name - The addon name from its manifest
     * @returns The loaded addon record, or undefined
     */
    getAddon(name: string): LoadedAddon | undefined;
    /**
     * List all loaded addons.
     *
     * @returns Array of loaded addon records
     */
    listAddons(): LoadedAddon[];
    /**
     * Get the number of loaded addons.
     *
     * @returns Count of loaded addons
     */
    getAddonCount(): number;
    /**
     * Get the absolute path to the addons directory.
     *
     * @returns Path to ~/.crewly/addons/
     */
    getAddonsDir(): string;
    /**
     * Load a single addon from its directory.
     *
     * @param addonPath - Absolute path to the addon directory
     * @param app - Express app
     * @param server - HTTP server
     * @throws If manifest is invalid or entrypoint fails to load
     */
    private loadSingleAddon;
    /**
     * Validate that a manifest has all required fields.
     *
     * @param manifest - The parsed manifest object
     * @param manifestPath - Path to the manifest file (for error messages)
     * @throws If any required field is missing or invalid
     */
    private validateManifest;
}
//# sourceMappingURL=addon-loader.service.d.ts.map