/**
 * Flow Weaver Deployment System
 *
 * Unified abstractions for deploying workflows across CLI, HTTP, and serverless contexts.
 *
 * @module deployment
 */
// Core - Executor
export { UnifiedWorkflowExecutor, createExecutor } from './core/executor.js';
// Core - Adapters
export { CliRequestAdapter, HttpRequestAdapter, createAdapter, } from './core/adapters.js';
// Core - Formatters
export { formatCliResponse, formatHttpResponse, formatError, } from './core/formatters.js';
export { DEFAULT_CONFIG, DEFAULT_SERVER_CONFIG, DEFAULT_EXECUTION_CONFIG, getDefaultConfig, } from './config/defaults.js';
export { loadConfig, loadConfigSync, getConfigValue } from './config/loader.js';
// OpenAPI
export { OpenAPIGenerator, generateOpenAPIJson, generateOpenAPIYaml, } from './openapi/generator.js';
export { SchemaConverter, schemaConverter, } from './openapi/schema-converter.js';
// Export Targets
export { BaseExportTarget, ExportTargetRegistry, } from './targets/base.js';
export { generateStandaloneRuntimeModule } from '../api/inline-runtime.js';
import * as path from 'path';
import { pathToFileURL } from 'url';
import { ExportTargetRegistry } from './targets/base.js';
/**
 * Create an export target registry via marketplace discovery.
 *
 * Scans `node_modules/` for installed `flow-weaver-pack-*` packages that
 * declare `exportTargets` in their `flowweaver.manifest.json`.
 * Each target class is eagerly imported (to resolve the async import) but
 * lazily instantiated — the constructor only runs when `registry.get()` is called.
 *
 * @param projectDir — project root to scan for installed packs.
 *   When omitted, returns an empty registry (useful for tests).
 */
export async function createTargetRegistry(projectDir) {
    const registry = new ExportTargetRegistry();
    if (projectDir) {
        const { listInstalledPackages } = await import('../marketplace/registry.js');
        const packages = await listInstalledPackages(projectDir);
        for (const pkg of packages) {
            for (const def of pkg.manifest.exportTargets ?? []) {
                const filePath = path.join(pkg.path, def.file);
                // Dynamic import is async, so we resolve the module here
                // but defer instantiation to the lazy factory
                const mod = await import(pathToFileURL(filePath).href);
                const TargetClass = def.exportName ? mod[def.exportName] : mod.default;
                registry.register(def.name, () => new TargetClass());
            }
        }
    }
    return registry;
}
//# sourceMappingURL=index.js.map