Architecture
MonoSurf separates browser ownership, page automation, reusable site contracts, and safety checks so each result says which layer produced it. Verified againstmonosurf 0.11.3, OpenCLIs build
2026-07-19-222928.
System Map
monosurf and kernel-cli websurf are frontends over the same
facade and core, so they share help, docs, the profile TUI, the profile
registry, plugins, grants, and browser state. Kernel CLI links this stack
in-process; it does not spawn the standalone CLI. The engine can use Chromium
installed by Chrome, Playwright, Puppeteer, or a headless-shell distribution
without turning those packages into the control layer.
Four Architecture Planes
Session Ownership
Ownership determines what happens at the end of a command:
This boundary prevents an attach command from accidentally terminating an
Electron app or browser it did not launch.
For managed profiles, MonoSurf 0.11.3 proves listener ownership from the
process command line’s exact
--user-data-dir argument. New profiles skip
active unregistered ports and keep the exact chosen port through launch proof
and cleanup. A foreign listener blocks start and profile-backed connection;
stop signals only a listener proven to belong to that profile. Temporarily
unknown OS metadata is retried for a bounded interval, then fails closed.
Explicit browse --cdp-url <endpoint> is the separate, intentional foreign-
attach path and never transfers lifecycle ownership to MonoSurf.
Identity and Profile State
doctor --fix can
remove stale process records or temporary debris without deleting a managed
profile. profile rm and doctor --prune are the explicit destructive
boundaries.
Login Snapshot Boundary
MonoSurf can hold session evidence in two encrypted owners:
This design keeps server-rotated tokens current while retaining a protected
bootstrap path. It does not claim that a grant erases browser state; grants
authorize site-command access to the protected capability.
Bridge import is cookie-only. The batch hydration runs before navigation,
validates every cookie scope, supplies an explicit HTTP(S) origin, preserves
domain/path/HttpOnly/Secure/SameSite/expiry, and fails the command on any CDP
error. It never clones localStorage, IndexedDB, service workers, passwords, a
Chrome profile, or the Chrome process. Full Agent Browser state uses the
separate same-profile managed-login path.
Direct Browse Data Flow
Site Plugin Data Flow
Trust Gates
Operational Evidence
MonoSurf exposes health and regression checks as part of the architecture:Companion Boundary
~/.niia/bin/monolex-native-host staged by Monolex desktop; neither standalone
CLI archive bundles it. See OpenCLIs Vault,
MonoPass, and the Monolex CLI Agent Browser
surface for the adjacent ownership boundaries.
Release Proof Layers
Keep these facts separate when validating a MonoSurf release:- Source and embedded docs describe intended behavior.
- OpenCLIs CDN
latest.jsonnames version 0.11.3 and build2026-07-19-222928; immutablemeta.jsonowns platform hashes. - The OpenCLIs API owns description, docs links, AI use, and wrapper guidance.
- The installed path proves which artifact runs.
monosurf versionproves the binary version.doctor, self-tests, and a real browse command prove the current runtime.
How It Works
Follow session selection, login-state resolution, page work, and cleanup.
Usage and Command Reference
Run the supported command families and option groups.
Auth Gate
Understand grants, live sessions, snapshots, and revocation.
Kernel CLI Reference
Continue the workflow outside the browser page.