File size: 1,063 Bytes
ad60bb2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

from abc import ABC, abstractmethod
from typing import Dict, Any, List, Optional

class BaseAgent(ABC):
    """
    Protocol 26: Standard Agent Interface for Matroska Swarm.
    All agents must implement this to be auto-discovered by the Router.
    """
    
    @property
    @abstractmethod
    def name(self) -> str:
        """Unique name of the agent (e.g., 'VideoAtomizer')"""
        pass
        
    @property
    @abstractmethod
    def description(self) -> str:
        """Short description for the Router's system prompt"""
        pass
        
    @property
    @abstractmethod
    def triggers(self) -> List[str]:
        """List of keywords or regex patterns that trigger this agent"""
        pass
        
    @abstractmethod
    async def process(self, task: Dict[str, Any]) -> Dict[str, Any]:
        """
        Execute the agent's logic.
        Args:
            task: The input packet (e.g., {'content': '...', 'context': {}})
        Returns:
            Dict containing 'status', 'result', and 'tensor_updates'
        """
        pass