/** A register function that accepts a registry. */ export type RegisterFn = (registry: TRegistry) => void | Promise; /** * Extract a named register function from a dynamically imported module, * handling both ESM and CJS default export patterns. * * For example, a grader plugin exports `registerGraders(registry)`, * an executor plugin exports `registerExecutors(registry)`, etc. */ export declare function extractRegisterFn(mod: unknown, fnName: string): RegisterFn | undefined; /** * Options for loadPlugin. * * @typeParam TItem - the type of item being registered (Grader, Executor, etc.) * @typeParam TRegistry - the registry type that holds items */ export interface LoadPluginOptions { /** npm package name or local file path */ specifier: string; /** The target registry to register into */ registry: TRegistry; /** Human-readable plugin kind for error messages (e.g. "grader", "executor") */ kind: string; /** Name of the exported register function (e.g. "registerGraders", "registerExecutors") */ registerFnName: string; /** Factory to create a temporary staging registry */ createStagingRegistry: () => TRegistry; /** Extract all items from a registry (for conflict checking + commit) */ getAll: (registry: TRegistry) => TItem[]; /** Get the name of a registered item */ getName: (item: TItem) => string; /** Check if an item with this name exists in the registry */ has: (registry: TRegistry, name: string) => boolean; /** Register a single item into the registry */ register: (registry: TRegistry, item: TItem) => void; /** Directory to resolve specifiers from (defaults to process.cwd()) */ cwd?: string; } /** * Dynamically import a plugin package and register its items. * * The package must export a named register function matching `registerFnName` * (e.g. `registerGraders`, `registerExecutors`). * * Registration uses a staging registry for atomicity: if the register * function throws partway through, the caller's registry is not left * inconsistent. * * Conflict detection ensures no existing items are overwritten. */ export declare function loadPlugin(options: LoadPluginOptions): Promise; //# sourceMappingURL=plugin-loader.d.ts.map