toolGroups method

Map<String, List<AgentTool>> toolGroups()

Groups the full static tool set by availability id, from the SAME instances the constructor registered. The boot hook stores this map in _toolGroupsById; the sqlite variant swap replaces the read entry in place so the gate always re-registers the current variant.

Implementation

Map<String, List<AgentTool>> toolGroups() {
  final groups = <String, List<AgentTool>>{};
  for (final tool in _toolRegistry.agentTools) {
    final id = _availabilityId(tool.name);
    if (id != null) groups.putIfAbsent(id, () => []).add(tool);
  }
  return groups;
}