import { ToolPolicyEnvelopeSchemaService } from './policy-envelope/index.js';
/**
 * Registry for the executable tool set available to one agent run.
 */
export class ToolRegistry {
    toolMap = new Map();
    constructor(tools) {
        for (const tool of tools) {
            if (this.toolMap.has(tool.name)) {
                throw new Error(`Duplicate tool name: ${tool.name}`);
            }
            this.toolMap.set(tool.name, tool);
        }
    }
    get(name) {
        return this.toolMap.get(name);
    }
    list() {
        return [...this.toolMap.values()].map((tool) => ToolPolicyEnvelopeSchemaService.addToTool(tool));
    }
    names() {
        return [...this.toolMap.keys()];
    }
}
//# sourceMappingURL=registry.js.map