/** * Unified pack loader for built-in and external provider packs. * * Handles loading provider packs from: * 1. Built-in packs (openai, anthropic, google) * 2. External npm packages via dynamic import * * All packs go through the same validation and error handling path. */ import { Effect } from 'effect'; import { ProviderPackLoadError } from './errors'; import type { EffectProviderFactory } from './base'; /** * Result type for callers who want to handle errors individually. */ export type PackLoadResult = { success: true; factory: EffectProviderFactory; } | { success: false; error: ProviderPackLoadError; }; /** * Load a provider pack by ID or npm package name. * * Resolution order: * 1. Check if it's a built-in pack (openai, anthropic, google) * 2. Try to load as external npm package via dynamic import * * @param idOrPackage - Provider ID (for built-ins) or npm package name * @returns The provider factory * @throws ProviderPackLoadError if the pack cannot be loaded */ export declare function loadProviderPack(idOrPackage: string): Promise; /** * Load multiple provider packs with fail-fast behavior. * * Uses Promise.all so the first failure will abort all loading. * * @param packs - Array of pack specifications with id and optional package name * @returns Array of provider factories in the same order as input * @throws ProviderPackLoadError on the first pack that fails to load */ export declare function loadAllPacks(packs: Array<{ id: string; package?: string; }>): Promise; /** * Try to load a provider pack without throwing. * * Useful for batch loading where you want to collect errors * rather than fail-fast. * * @param idOrPackage - Provider ID or npm package name * @returns PackLoadResult with success/error status */ export declare function tryLoadProviderPack(idOrPackage: string): Promise; /** * Effect-based version of loadProviderPack. * * Returns an Effect with proper error channel instead of throwing. */ export declare const loadProviderPackEffect: (idOrPackage: string) => Effect.Effect; //# sourceMappingURL=loader.d.ts.map