import type { ExtensionFactory } from "./types.ts";
declare function loadVirtualModules(): Promise<Record<string, object>>;
/**
 * Persistent on-disk cache for jiti-transpiled extension modules.
 * jiti keys cache entries by source-content hash, so entries self-invalidate
 * when extension sources change; stale sibling version dirs are pruned
 * in the background.
 */
declare function getTranspileCacheDir(): string;
export interface ExtensionCacheToken {
    cwd: string;
    generation: number;
}
export declare function clearExtensionCache(): void;
export declare function useExtensionCacheCwd(cwd: string): ExtensionCacheToken;
/**
 * Locate an installed package's root directory without consulting its
 * "exports" map: require.resolve("<pkg>/package.json") throws
 * ERR_PACKAGE_PATH_NOT_EXPORTED under Node for packages that do not export
 * "./package.json" (pi-ai does not), and import.meta.resolve() cannot be
 * used because its mere presence silently disables bytecode generation for
 * the compiled binary (CJS bundle). Scanning require.resolve.paths() walks
 * the same node_modules chain Node would, without exports-map encapsulation.
 */
declare function findPackageRoot(packageName: string, searchPaths?: string[]): string;
/**
 * Get aliases for jiti (used in Node.js/development mode).
 * In Bun binary mode, virtualModules is used instead.
 */
declare function getAliases(): Record<string, string>;
export declare const extensionLoaderTestHooks: {
    loadVirtualModules: typeof loadVirtualModules;
    getAliases: typeof getAliases;
    findPackageRoot: typeof findPackageRoot;
    getTranspileCacheDir: typeof getTranspileCacheDir;
};
export declare function loadExtensionModule(extensionPath: string, cacheToken?: ExtensionCacheToken): Promise<ExtensionFactory | undefined>;
export {};
//# sourceMappingURL=loader-virtual-modules.d.ts.map