feat: agent JSON text-frame dispatch and msg/* handlers #3
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/agent-msg-dispatch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
net.rs::idle_loop now wires Message::Text(t) into the dispatcher's route_json instead of just logging the byte length. JSON-shaped outbox frames (begin with
{) go out as Message::Text via a new send_text helper so the server's user-session forwarder picks them up; opaque payloads keep their existing Message::Binary framing.dispatch.rs::route_json adds an "msg" arm that defers to crate::host::msg::handle for the legacy MeshCentral SPA
{action:"msg", type:<sub>}envelope.New host/msg.rs implements handlers for the SPA's DeskTools / Information panels:
serialize_reply echoes nodeid/userid/username/sessionid/tag/pid/requestid back so the server-side router can deliver the reply to the originating control session.
8 unit tests cover console help / unknown-command fallback, ps / psinfo / sysinfo / userSessions / smbios reply shapes, and the unknown-msg-type drop path.
Dev-env: port bump to 4302 (matches server dev port), justfile recipe simplification, meshagent.msh template re-render.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
net.rs::idle_loop now wires Message::Text(t) into the dispatcher's route_json instead of just logging the byte length. JSON-shaped outbox frames (begin with `{`) go out as Message::Text via a new send_text helper so the server's user-session forwarder picks them up; opaque payloads keep their existing Message::Binary framing. dispatch.rs::route_json adds an "msg" arm that defers to crate::host::msg::handle for the legacy MeshCentral SPA `{action:"msg", type:<sub>}` envelope. New host/msg.rs implements handlers for the SPA's DeskTools / Information panels: - console: text-command shell (help, info, version, osinfo, cpuinfo, uptime/sysinfo, processes/ps, services, users, volumes/disks, netinfo/ifaces, kill <pid>) - ps: pid-keyed object {cmd, user} - services: name-keyed systemd snapshot - psinfo: per-pid detail for the process-details dialog - sysinfo: hardware/network/drives/cpu/load bundle - userSessions: utmp -> session-list shape (State, StationName, SessionId, Username, ...) for the Desktop session selector - smbios: /sys/class/dmi/id/* DMI fields for the Information panel serialize_reply echoes nodeid/userid/username/sessionid/tag/pid/requestid back so the server-side router can deliver the reply to the originating control session. 8 unit tests cover console help / unknown-command fallback, ps / psinfo / sysinfo / userSessions / smbios reply shapes, and the unknown-msg-type drop path. Dev-env: port bump to 4302 (matches server dev port), justfile recipe simplification, meshagent.msh template re-render. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>