feat: unify websocket runtime and harden node control

This commit is contained in:
lpf
2026-03-08 22:22:49 +08:00
parent 7e67619826
commit 4172a57b39
15 changed files with 2082 additions and 124 deletions

View File

@@ -48,3 +48,18 @@ type Response struct {
Action string `json:"action,omitempty"`
Payload map[string]interface{} `json:"payload,omitempty"`
}
// WireMessage is the websocket envelope for node lifecycle messages.
type WireMessage struct {
Type string `json:"type"`
ID string `json:"id,omitempty"`
Node *NodeInfo `json:"node,omitempty"`
}
// WireAck is the websocket response envelope for node lifecycle messages.
type WireAck struct {
OK bool `json:"ok"`
Type string `json:"type"`
ID string `json:"id,omitempty"`
Error string `json:"error,omitempty"`
}