/** * The plugin registry. * * Built-ins are registered by an explicit import, not by scanning a directory. * A scan would make the set of supported agents depend on what happens to be on * disk next to this file, which is unpredictable in a bundle and untestable * anywhere. * * AN EXTERNAL PLUGIN IS LOADED ONLY WHEN A USER NAMES IT. There is no entry-point * discovery here on purpose: the equivalent would mean any installed package * could get its code imported by a tool the user ran for an unrelated reason. * TOKEN_OPTIMIZER_LEARN_PLUGINS is a list of module specifiers, and a user who * writes one has asked for exactly that module. */ import { AgentPlugin } from './plugin.js'; /** The variable naming extra plugins to import, as ESM specifiers. */ export declare const PLUGIN_ENV = "TOKEN_OPTIMIZER_LEARN_PLUGINS"; export declare class PluginError extends Error { } /** * Add a plugin at runtime. * * A name that collides with a built-in replaces it, which is how someone fixes * our parser for their own layout without waiting for a release. */ export declare function registerAgent(plugin: AgentPlugin): void; /** Drop everything registered at runtime. For tests, and for nothing else. */ export declare function resetRegisteredAgents(): void; export declare function agentNames(): readonly string[]; export declare function agentPlugins(): readonly AgentPlugin[]; export declare function agentPlugin(name: string): AgentPlugin; /** The plugins that have data on this machine. */ export declare function detectedAgents(): Promise; /** * Import the plugins named in the environment. * * Returns what went wrong rather than throwing, so a typo in the variable costs a * line of output and not the run. A module that loads but exports nothing usable * is reported the same way -- silently ignoring it would leave a user waiting for * results from a plugin that never ran. */ export declare function loadExternalAgents(env?: NodeJS.ProcessEnv): Promise; //# sourceMappingURL=registry.d.ts.map