/**
 * The tool registry.
 *
 * A {@link ToolRegistry} is the in-memory directory of every defined tool plus
 * the named *collections* that group them (e.g. a read-only set vs. the full
 * coding set). Its payoff method is {@link ToolRegistry.toToolBox}, which turns a
 * chosen collection into a runtime {@link ToolBox}: the descriptors the model is
 * shown together with a {@link ToolRunner} that dispatches the model's calls to
 * the right tool's `invoke`.
 *
 * The registry stays decoupled from how a {@link ToolContext} is built: it asks
 * for a `ctxFactory` at box-construction time and calls it per dispatch, so each
 * tool run gets a fresh, correctly-scoped context.
 */
import type { ToolBox } from "../../runtime/contract";
import type { DefinedTool, ToolContext } from "./spec";
/** Thrown when a registry operation references a name that was never registered. */
export declare class UnknownToolError extends Error {
    /** The offending tool or collection name. */
    readonly missing: string;
    constructor(kind: "tool" | "collection", missing: string);
}
/** Supplies a fresh {@link ToolContext} for each individual tool dispatch. */
export type ContextFactory = () => ToolContext;
/**
 * A mutable catalog of tools and the named collections over them.
 *
 * Register tools first, then describe collections by listing tool names. A
 * collection is just a label for a subset; the same tool can belong to many.
 */
export declare class ToolRegistry {
    private readonly tools;
    private readonly collections;
    /** Add a defined tool. A later registration under the same name replaces it. */
    register(tool: DefinedTool): this;
    /** Register several tools in one call. */
    registerAll(tools: Iterable<DefinedTool>): this;
    /** True when a tool with this name has been registered. */
    has(name: string): boolean;
    /** Fetch a registered tool, or throw {@link UnknownToolError} if absent. */
    get(name: string): DefinedTool;
    /** The names of every registered tool, in registration order. */
    names(): string[];
    /**
     * Define (or redefine) a named collection as the given list of tool names.
     * Every listed tool must already be registered.
     */
    collection(name: string, toolNames: readonly string[]): this;
    /** The tool names belonging to a collection, or throw if it is undefined. */
    membersOf(collectionName: string): string[];
    /** The names of every defined collection. */
    collectionNames(): string[];
    /**
     * Build a runtime {@link ToolBox} from a set of tools.
     *
     * Pass a collection name to box that collection, or omit it to box every
     * registered tool. `ctxFactory` is invoked once per dispatched call to mint
     * the {@link ToolContext} the chosen tool runs under.
     */
    toToolBox(ctxFactory: ContextFactory, collectionName?: string): ToolBox;
}
