import 'catalog_tools.dart'; import 'habit_tools.dart'; import 'tool_definition.dart'; import 'tracker_tools.dart'; /// Static registry of all tools exposed to the LLM. /// /// Order is the order surfaced to the model (`flutter_gemma` preserves the /// list). Read-only tools first, then destructive — mirrors a "look before /// you leap" prompt bias. final List kAllTools = [ // read-only searchCatalogTool, queryProtocolTool, listActiveHabitsTool, getStreakTool, // destructive (confirm gate) addHabitTool, logTrackerEntryTool, ]; class ToolRegistry { final Map _byName; ToolRegistry(List tools) : _byName = {for (final t in tools) t.name: t}; factory ToolRegistry.defaults() => ToolRegistry(kAllTools); ToolDefinition? byName(String name) => _byName[name]; Iterable get all => _byName.values; }