feat: add distributed async dataset with unix socket server and refactor agent communication bus
Implement AsyncDataSet class supporting client-server model over Unix sockets with SQLite backend, including KV store, table management, and concurrent query handling. Rename `get_messages` to `receive_messages` in AgentCommunicationBus and update all callers. Remove deprecated `get_recommended_agent` function from agent_roles, `invalidate_tool` from tool_cache, and legacy `receive_messages` wrapper. Add multiplexer command routing in handlers with `/prompt` command support. Introduce comprehensive help documentation system for workflows. Update default API URLs to production endpoints and refactor adaptive context window calculation in AdvancedContextManager.
This commit is contained in:
@@ -99,7 +99,7 @@ class AgentCommunicationBus:
|
||||
|
||||
self.conn.commit()
|
||||
|
||||
def get_messages(self, agent_id: str, unread_only: bool = True) -> List[AgentMessage]:
|
||||
def receive_messages(self, agent_id: str, unread_only: bool = True) -> List[AgentMessage]:
|
||||
cursor = self.conn.cursor()
|
||||
if unread_only:
|
||||
cursor.execute(
|
||||
@@ -153,9 +153,6 @@ class AgentCommunicationBus:
|
||||
def close(self):
|
||||
self.conn.close()
|
||||
|
||||
def receive_messages(self, agent_id: str) -> List[AgentMessage]:
|
||||
return self.get_messages(agent_id, unread_only=True)
|
||||
|
||||
def get_conversation_history(self, agent_a: str, agent_b: str) -> List[AgentMessage]:
|
||||
cursor = self.conn.cursor()
|
||||
cursor.execute(
|
||||
|
||||
@@ -125,7 +125,7 @@ class AgentManager:
|
||||
return message.message_id
|
||||
|
||||
def get_agent_messages(self, agent_id: str, unread_only: bool = True) -> List[AgentMessage]:
|
||||
return self.communication_bus.get_messages(agent_id, unread_only)
|
||||
return self.communication_bus.receive_messages(agent_id, unread_only)
|
||||
|
||||
def collaborate_agents(self, orchestrator_id: str, task: str, agent_roles: List[str]):
|
||||
orchestrator = self.get_agent(orchestrator_id)
|
||||
|
||||
@@ -229,45 +229,3 @@ def get_agent_role(role_name: str) -> AgentRole:
|
||||
|
||||
def list_agent_roles() -> Dict[str, AgentRole]:
|
||||
return AGENT_ROLES.copy()
|
||||
|
||||
|
||||
def get_recommended_agent(task_description: str) -> str:
|
||||
task_lower = task_description.lower()
|
||||
|
||||
code_keywords = [
|
||||
"code",
|
||||
"implement",
|
||||
"function",
|
||||
"class",
|
||||
"bug",
|
||||
"debug",
|
||||
"refactor",
|
||||
"optimize",
|
||||
]
|
||||
research_keywords = [
|
||||
"search",
|
||||
"find",
|
||||
"research",
|
||||
"information",
|
||||
"analyze",
|
||||
"investigate",
|
||||
]
|
||||
data_keywords = ["data", "database", "query", "statistics", "analyze", "process"]
|
||||
planning_keywords = ["plan", "organize", "workflow", "steps", "coordinate"]
|
||||
testing_keywords = ["test", "verify", "validate", "check", "quality"]
|
||||
doc_keywords = ["document", "documentation", "explain", "guide", "manual"]
|
||||
|
||||
if any(keyword in task_lower for keyword in code_keywords):
|
||||
return "coding"
|
||||
elif any(keyword in task_lower for keyword in research_keywords):
|
||||
return "research"
|
||||
elif any(keyword in task_lower for keyword in data_keywords):
|
||||
return "data_analysis"
|
||||
elif any(keyword in task_lower for keyword in planning_keywords):
|
||||
return "planning"
|
||||
elif any(keyword in task_lower for keyword in testing_keywords):
|
||||
return "testing"
|
||||
elif any(keyword in task_lower for keyword in doc_keywords):
|
||||
return "documentation"
|
||||
else:
|
||||
return "general"
|
||||
|
||||
Reference in New Issue
Block a user