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:
@@ -1,6 +1,7 @@
|
||||
import json
|
||||
import time
|
||||
|
||||
from pr.commands.multiplexer_commands import MULTIPLEXER_COMMANDS
|
||||
from pr.autonomous import run_autonomous_mode
|
||||
from pr.core.api import list_models
|
||||
from pr.tools import read_file
|
||||
@@ -13,6 +14,12 @@ def handle_command(assistant, command):
|
||||
command_parts = command.strip().split(maxsplit=1)
|
||||
cmd = command_parts[0].lower()
|
||||
|
||||
if cmd in MULTIPLEXER_COMMANDS:
|
||||
# Pass the assistant object and the remaining arguments to the multiplexer command
|
||||
return MULTIPLEXER_COMMANDS[cmd](
|
||||
assistant, command_parts[1:] if len(command_parts) > 1 else []
|
||||
)
|
||||
|
||||
if cmd == "/edit":
|
||||
rp_editor = RPEditor(command_parts[1] if len(command_parts) > 1 else None)
|
||||
rp_editor.start()
|
||||
@@ -23,6 +30,18 @@ def handle_command(assistant, command):
|
||||
if task:
|
||||
run_autonomous_mode(assistant, task)
|
||||
|
||||
elif cmd == "/prompt":
|
||||
rp_editor = RPEditor(command_parts[1] if len(command_parts) > 1 else None)
|
||||
rp_editor.start()
|
||||
rp_editor.thread.join()
|
||||
prompt_text = str(rp_editor.get_text())
|
||||
rp_editor.stop()
|
||||
rp_editor = None
|
||||
if prompt_text.strip():
|
||||
from pr.core.assistant import process_message
|
||||
|
||||
process_message(assistant, prompt_text)
|
||||
|
||||
elif cmd == "/auto":
|
||||
if len(command_parts) < 2:
|
||||
print(f"{Colors.RED}Usage: /auto [task description]{Colors.RESET}")
|
||||
|
||||
Reference in New Issue
Block a user