agentic-threat-hunting-framework 0.4.0__py3-none-any.whl → 0.5.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
athf/core/web_search.py CHANGED
@@ -84,7 +84,7 @@ class TavilySearchClient:
84
84
  """Get or create Tavily client instance."""
85
85
  if self._client is None:
86
86
  try:
87
- from tavily import TavilyClient # type: ignore[import-not-found]
87
+ from tavily import TavilyClient
88
88
 
89
89
  self._client = TavilyClient(api_key=self.api_key)
90
90
  except ImportError:
athf/plugin_system.py ADDED
@@ -0,0 +1,48 @@
1
+ """Plugin system for ATHF extensions."""
2
+ from typing import Dict, Type, Callable
3
+ import importlib.metadata
4
+ from click import Command
5
+
6
+
7
+ class PluginRegistry:
8
+ """Central registry for ATHF plugins."""
9
+
10
+ _agents: Dict[str, Type] = {}
11
+ _commands: Dict[str, Command] = {}
12
+
13
+ @classmethod
14
+ def register_agent(cls, name: str, agent_class: Type) -> None:
15
+ """Register an agent plugin."""
16
+ cls._agents[name] = agent_class
17
+
18
+ @classmethod
19
+ def register_command(cls, name: str, command: Command) -> None:
20
+ """Register a CLI command plugin."""
21
+ cls._commands[name] = command
22
+
23
+ @classmethod
24
+ def get_agent(cls, name: str) -> Type:
25
+ """Get registered agent by name."""
26
+ return cls._agents.get(name)
27
+
28
+ @classmethod
29
+ def get_command(cls, name: str) -> Command:
30
+ """Get registered command by name."""
31
+ return cls._commands.get(name)
32
+
33
+ @classmethod
34
+ def load_plugins(cls) -> None:
35
+ """Auto-discover and load all installed plugins."""
36
+ try:
37
+ for ep in importlib.metadata.entry_points(group='athf.commands'):
38
+ command = ep.load()
39
+ cls.register_command(ep.name, command)
40
+ except Exception:
41
+ pass # No plugins installed yet
42
+
43
+ try:
44
+ for ep in importlib.metadata.entry_points(group='athf.agents'):
45
+ agent = ep.load()
46
+ cls.register_agent(ep.name, agent)
47
+ except Exception:
48
+ pass # No plugins installed yet