更改项目名为NebulaShell

This commit is contained in:
Falck
2026-05-02 08:30:31 +08:00
parent d16e28ab17
commit 2c2ec60a2b
233 changed files with 298 additions and 276 deletions

View File

@@ -0,0 +1,23 @@
"""WebSocket 事件定义"""
from dataclasses import dataclass, field
from typing import Any, Optional
@dataclass
class WsEvent:
"""WebSocket 事件"""
type: str
client: Any = None
path: str = ""
message: str = ""
context: dict[str, Any] = field(default_factory=dict)
# 事件类型常量
EVENT_CONNECT = "ws.connect"
EVENT_DISCONNECT = "ws.disconnect"
EVENT_MESSAGE = "ws.message"
EVENT_ERROR = "ws.error"
EVENT_SUBSCRIBE = "ws.subscribe"
EVENT_UNSUBSCRIBE = "ws.unsubscribe"
EVENT_BROADCAST = "ws.broadcast"