Expand description
Phase 81.33.b.real Stage 4 — daemon-side plugin admin RPC router.
Plugins declare [plugin.admin] method_prefix = "nexo/admin/<id>/"
in their nexo-plugin.toml. The admin dispatcher checks the
router for every incoming method; matches forward via broker
JSON-RPC to the plugin’s subprocess. Replaces the previous
.with_<plugin>_handle(Arc<dyn XxxHandle>) typed builder
pattern.
See crate::plugin_http for the sibling HTTP router that
shares this design pattern (longest-prefix-first matching +
broker-RPC forwarding + reserved-prefix safety net).
Structs§
- Match
Info - Output of
PluginAdminRouter::match_method. Owned strings so the caller can drop the router lock immediately and the resulting forward call does not hold the lock across an async broker round-trip. - Plugin
Admin Response - Plugin reply shape. Mirrors the dispatcher’s typed
AdminRpcResultso the daemon can render the right status without per-plugin parsing. - Plugin
Admin Router - Longest-prefix-first matcher with interior mutability so the
daemon can construct an empty router at admin-bootstrap time
and populate it AFTER
wire_plugin_registryreturns the plugin handles.
Enums§
- Admin
Route Registration Error - Route registration error. Returned by
PluginAdminRouter::register. - Plugin
Admin Forward Error - Typed forwarder errors.
Constants§
- RESERVED_
ADMIN_ PREFIXES - Method prefixes reserved for daemon-internal admin handlers. Plugin registrations colliding with any of these are rejected — the daemon’s agents/credentials/pairing/etc. surfaces cannot be hijacked.
Functions§
- forward_
request - Forward an admin method invocation to the plugin via broker
JSON-RPC. Caller passes pre-parsed JSON params + parses the
returned
PluginAdminResponseinto the typed shape. - method_
to_ broker_ suffix - Translate the trailing portion of an admin method into the
broker subject suffix. Replaces
/with.sonexo/admin/whatsapp/bot/listwith prefixnexo/admin/whatsapp/→bot/list→bot.list.