-- -- (C) 2013-26 - ntop.org -- -- Base tool registry for the agentic LLM loop. -- Always loaded by mcp.lua. Contains tools that work with live ntopng data only -- Pro tools are loaded on top if nAnalyst is available local dirs = ntop.getDirs() package.path = dirs.installdir .. "/scripts/lua/modules/llm/tools/?.lua;" .. package.path package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path local json = require("dkjson") local tools = {} -- name -> { description, handler, artifact, read_only, requires_clickhouse, tier, license, min_edition } -- Only tools this instance is entitled to (they have a live handler and are dispatchable). tools._registry = {} -- name -> { description, tier, license, min_edition, read_only, artifact, requires_clickhouse } -- Full catalog of every tool ntopng ships, entitled or not. No handler. UI-only: -- lets the Tools Catalog show what a higher license would unlock. Never dispatched. tools._catalog = {} -- Resolve the license label for a tool, from its tier and edition constraints. -- tier == "community" -> "community" (bundled, no license) -- tier == "pro", no min_edition -> "enterprise_m" (nAnalyst floor) -- tier == "pro", min_edition == "..." -> that edition (enterprise_m|enterprise_l|enterprise_xl) -- The label maps to i18n key llm.tool_license_