//#region src/tui/extension-host/tool-renderers.ts
const renderers = /* @__PURE__ */ new Map();
function registerTuiToolRenderer(toolName, renderer) {
	renderers.set(toolName, renderer);
	return () => {
		if (renderers.get(toolName) === renderer) renderers.delete(toolName);
	};
}
function renderToolWithExtensions(ctx) {
	const renderer = renderers.get(ctx.toolName);
	if (!renderer) return null;
	return renderer(ctx);
}
function clearTuiToolRenderers() {
	renderers.clear();
}
/** Test helper */
function getTuiToolRendererCount() {
	return renderers.size;
}
//#endregion
export { clearTuiToolRenderers, getTuiToolRendererCount, registerTuiToolRenderer, renderToolWithExtensions };

//# sourceMappingURL=tool-renderers.js.map