Architecture
September 3, 2026 · View on GitHub
Where this plugin fits
remote controller player device
(HA, ctl script, …)
|
| HiveMind encrypted WebSocket
|
hivemind-core <--------- HiveMindPlayerProtocol (this package)
| |
| ovos-media (OCP, playback, VLC/MPV)
| ovos-audio (TTS only)
| ovos-PHAL (optional)
HiveMindPlayerProtocol is loaded by hivemind-core as the
hivemind.agent.protocol plugin. It owns:
- Local playback: it embeds
ovos_media.service.MediaServicefor OCP playback and initializesovos_audio.service.PlaybackServicefor TTS only, plus optionallyovos_PHAL.service.PHAL, all on the device's internalFakeBus. - Downstream dispatch: when
hivemind-coreforwards an inboundhive.send.downstreambus event, the protocol routes the payload to the correct peer. PROPAGATE and BROADCAST fan out. Targeted messages go to their peer. - Response routing with client isolation: internal bus messages whose
context["destination"]matches a connected HiveMind peer get wrapped asHiveMessageType.BUSmessages and forwarded to that peer only.
What this plugin does NOT do
- Natural-language answering:
natural_language_queryyields only the end-of-queryNonesentinel. If a satellite sends a QUERY message,hivemind-coregets an empty answer and may escalate upstream. - Upstream forwarding: handled by
hivemind-core's slave/upstream protocol. - Authentication, ACL, policy:
hivemind-core's responsibility.
Internal bus
The protocol uses a FakeBus (an in-process event emitter) rather than a real
WebSocket bus. ovos-media, ovos-audio, and PHAL are wired to this FakeBus at
startup. hivemind-core forwards all OCP messages onto the FakeBus, where the
embedded media daemon consumes them.
Plugin lifecycle
hivemind-corereadsagent_protocol.module = "hivemind-player-agent-plugin".AgentProtocolFactory.create(...)instantiatesHiveMindPlayerProtocol.__post_init__creates the TTS-onlyPlaybackService, embeds and startsMediaService(unlessdisable_media), optionally starts PHAL, and registers the two FakeBus handlers.- The protocol is purely event-driven from that point. It reacts to FakeBus events and dispatches HiveMessages to peers.