/** * Dynamic factory loader. * * Loads an extension factory from a filesystem path by dynamic import, * invokes it, and wraps the result as a `ResolvedExtension`. * * @module extensions/factory-loader */ import { type BoundExtensionEntrypoint } from "./entrypoint-identity.js"; import type { ExtensionSource, ResolvedExtension } from "./types.js"; type ImportMetaResolver = (specifier: string) => string; interface ImportResolutionCapabilities { readonly resolver?: ImportMetaResolver; readonly runtime: "node" | "other"; } /** @internal Verify that a canonical file URL is not redirected by runtime resolution. */ export declare function assertCanonicalExtensionImport(specifier: string, path: string, capabilities?: ImportResolutionCapabilities): void; /** * Dynamically import an extension factory from `path` and resolve it. * * `path` may be either an absolute filesystem path (for project and * local-file sources) or a bare module specifier (for `package` source). * Absolute paths are converted to `file://` URLs; bare specifiers are * passed through so the runtime's module resolver can find them. * * The module must `export default` an `ExtensionFactory` (a function that * returns an `Extension`). On any error — missing default export, default * export that is not a function, factory throw, or import failure — this * throws `EXTENSION_VALIDATION_ERROR` with a `detail` field that names the * path and what went wrong. * * @param path Absolute filesystem path or bare module specifier. * @param source Where the extension was discovered (drives merge priority). * @param config Optional config forwarded to the factory. * @param binding Internal filesystem identity captured during discovery. */ export declare function loadExtensionFactory(path: string, source: ExtensionSource, config?: unknown, binding?: BoundExtensionEntrypoint): Promise; export {}; //# sourceMappingURL=factory-loader.d.ts.map