export interface ISafeImportSuccess> { ok: true; module: T; elapsedMs: number; } export interface ISafeImportFailure { ok: false; error: Error; elapsedMs: number; timedOut: boolean; } export type SafeImportResult> = ISafeImportSuccess | ISafeImportFailure; export interface ISafeImportOptions { /** Max ms to wait for the dynamic import before timing out. */ timeoutMs?: number; /** Skip the existsSync pre-check (caller already verified). */ skipExistsCheck?: boolean; } export declare const DEFAULT_SAFE_IMPORT_TIMEOUT_MS = 8000; /** * Bun-or-jiti-aware dynamic import. Use this anywhere the engine needs to * load a user-authored TypeScript file (config, knowledge, boundaries, * pipelines, etc.) from an absolute path. Falls back to native `import()` * for `.js` / `.mjs` so library consumers without TypeScript files pay * nothing. * * A module that already failed in this process rejects with its ORIGINAL * error — immediately, without touching the module registry again (see * {@link moduleEvaluationErrors}). A failure on a file that does not exist is * not remembered, so a file created later in the same process still loads. */ export declare function importModuleViaLoader>(filePath: string): Promise; export declare function safeImport>(filePath: string, options?: ISafeImportOptions): Promise>; //# sourceMappingURL=safe-import.d.ts.map