Expand description
Step 7 of browser-multi-instance — admin RPC handlers.
Pure-fn handlers (one per verb) that operate on
instance_registry + filesystem sentinel files. They take a
serde_json::Value request payload and return the JSON reply.
Wiring is split:
- Handlers (this file) — testable in-process, no broker dep.
- Broker subscriber loop — see
auto_discovery.rs+ main.rs wire-up (deferred follow-upbrowser.auto_discovery.subscriber).
Daemon-side admin RPC nexo/admin/browser/<verb> is forwarded
via the broker pattern declared in nexo-plugin.toml
[plugin.admin] (Step 8).
Functions§
- dispatch
- Generic dispatch entry point — matches the broker topic suffix to a handler. Unknown verb ⇒ structured error.
- launch_
visible nexo/admin/browser/launch_visible— request a non-headless Chrome boot for the instance so the operator can complete a manual pairing flow. Idempotent: shuts the current Chrome down (if any) so the next lazy-boot honours the one-shotheadless = falseoverride.- list_
instances nexo/admin/browser/list_instances— enumerate every declared instance with its current paired state.- mark_
paired nexo/admin/browser/mark_paired— touches the.nexo-pairedsentinel inside the instance’suser_data_dirso the dashboardauth_check(Stage 6 wizard) flips green. Operator-confirmed signal; replaces fragile Chrome-internal SQLite probing.- restart
nexo/admin/browser/restart— shutdown + register intent to re-boot. The actual Chrome boot is lazy (nexttool.invoke), so this verb is effectivelyshutdownfrom the runtime’s perspective.- shutdown
nexo/admin/browser/shutdown— shut down the Chrome handle for a specific instance. Idempotent. The registry entry stays so the nexttool.invokelazy-reboots Chrome.