Separate and tested web_socket_manager

This commit is contained in:
2024-11-03 22:26:12 +01:00
parent 4bd497e1ca
commit e243c6ac3b
11 changed files with 433 additions and 776 deletions

View File

@@ -414,34 +414,32 @@ classDiagram
class WebAgent {
+context: str
+response: str
+response: str readonly
+current_state WebAgentState readonly
+command_result Optional[CommandResult] readonly
+validation_error Optional[str] readonly
+add_state_change_handler(handler Callable) void
+add_response_change_handler(handler Callable) void
+approve_context() void
+set__response(response str) void
+approve_response() void
}
class WebAgentState {
<<enumeration>>
UPDATE
CONTEXT_APPROVAL
INFERENCE
RESPONSE_APPROVAL
STOPPED
}
class WebServer {
-agent: WebAgent
-app: Application
-clients: Set~WebSocketResponse~
+clients Set~WebSocketResponse~ readonly
class WebSocketManager {
-web_sockets: Set~WebSocket~
+WebServer(agent WebAgent, io_buffer WebIOBuffer, host str, port int)
+start() void
+stop() void
+broadcast(message_type str, data str, **kwargs) void
+WebServer(agent WebAgent, io_buffer WebIOBuffer, static_files path, host str, port int)
}
class ClientMessage {