Discovery
discovery
Resolve the installed AXM tools from their entry-point groups (one resolver).
Every consumer that turns a tool name into an implementation goes through
:func:tool_entry_points: the MCP catalog (axm_mcp.discovery), the axm
CLI (:mod:axm.cli) and :func:axm.tools.load_tool (hence every tool_node).
They therefore never disagree on which distribution owns a name.
Resolution contract (axm-tribunal migration, decision "Groupes de points d'entree", same rule as the graph and ticket-type groups):
- the groups are read in :data:
TOOL_ENTRY_POINT_GROUPSorder: the tribunal groupaxm.tribunal.toolsfirst, the legacyaxm.toolssecond; - a name published by both groups resolves to the tribunal one. Publishing a tribunal homonym IS the switch away from a legacy tool; the shadowing is logged at debug level;
- a name published twice inside ONE group is ambiguous and raises
:class:
DuplicateToolErrornaming both distributions, instead of the old "last entry point wins" that depended on the filesystem order; - the mapping is ordered by name, independent of
sys.pathor install order.
Python tool entry points are not loaded here; declarative providers additionally
read their installed package resource. No Svelte is compiled or evaluated.
Retiring the legacy group
(tribunal phase 10) is dropping "axm.tools" from the tuple.
DuplicateToolError
Bases: ValueError
One entry-point group publishes the same tool name twice.
Attributes:
| Name | Type | Description |
|---|---|---|
group |
The entry-point group holding the two declarations. |
|
name |
The tool name declared twice. |
|
distributions |
The two declaring distributions, sorted. |
Source code in packages/axm/src/axm/tools/discovery.py
tool_entry_points()
Map every installed AXM tool name to the entry point that owns it.
Returns:
| Type | Description |
|---|---|
dict[str, ToolReference]
|
|
dict[str, ToolReference]
|
its legacy homonym. Python entries stay lazy; declarative resources |
dict[str, ToolReference]
|
are read and validated to publish their names and exact schemas. |
Raises:
| Type | Description |
|---|---|
DuplicateToolError
|
One group publishes a name twice. |