Expand description
§mnml-bridge — Mount protocol for mnml sibling tools
Bridge / Mount is the integration layer that lets sibling tools
(mnml-db-postgres, mnml-forge-bitbucket, …) render their UI as a
first-class pane inside mnml — owning the activity-bar icon, the
rail content, and the editor body — instead of running as a
plain Pty pane.
§The four tiers
- Env vars — every Pty mnml spawns sees
MNML_WORKSPACE,MNML_THEME, andMNML_IPC_DIR. Zero protocol; just read on startup. (Available today for any sibling.) - JSONL sibling → host — sibling writes JSONL commands to
$MNML_IPC_DIR/command; mnml ingests them.toast,open-pty,open(file), more coming. One-way. - mnml-bridge SDK — this crate. Typed Rust API around tiers 1 + 2, plus the Mount protocol below.
- Mount — sibling connects to a Unix-socket-per-mount, streams cell+style frames back, receives input events. Owns rail + body areas of an activity-bar section.
§Wire shape
Length-prefixed JSON. Every message is a Frame or Input. The
4-byte little-endian length precedes the JSON body so framing is
trivial (no streaming JSON parser needed).
Host → Sibling:
MountHello { cols, rows }firstResize { cols, rows }on terminal resizeInput { event }on every routed key / mouse event
Sibling → Host:
Frame { cells: Vec<Vec<Cell>> }whenever the sibling has a new screen state. Cell-perfect; the host stamps these into its own ratatui frame.
V1 keeps it simple: full frames, no diffing. A ~24x80 panel is ~2 KB of JSON; serialization cost is negligible vs ratatui’s own draw cycle.
Re-exports§
pub use install::ChipSpec;pub use install::CommandSpec;pub use install::ContextMenuEntry;pub use install::IntegrationSpec;pub use install::MenuBarEntry;pub use install::NotificationsSpec;pub use install::OsNotifyPolicy;pub use install::Requires;pub use install::SettingsPage;pub use install::StatuslineSpec;pub use install::install_integration;pub use install::integration_manifest_path;pub use install::list_installed_integrations;pub use install::uninstall_integration;pub use ipc::NotifyOpts;pub use ipc::ProgressStatus;pub use ipc::SegmentSide;pub use ipc::ToastLevel;pub use ipc::notify;pub use ipc::progress_end;pub use ipc::progress_start;pub use ipc::progress_update;pub use ipc::register_command;pub use ipc::set_activity_badge;pub use ipc::statusline_clear_segment;pub use ipc::statusline_set_segment;pub use ipc::toast;pub use ipc::toast_dismiss;pub use ipc::toast_error;pub use ipc::toast_info;pub use ipc::toast_persistent;pub use ipc::toast_warn;
Modules§
- install
- Integration manifest install helpers — sibling-authored self-registration for the rail chip, palette commands, chord bindings, context menu additions, menu-bar entries, statusline segments, settings pages, and OS notification policy. Writes a single TOML file per integration:
- ipc
- Tier-2 IPC helpers — write JSONL commands to the host.
- modifier
- Bitflags for
Cell::modifiers. Mirrors ratatui’sModifierconstants so a sibling can reuse its existing styling.
Structs§
- Cell
- A single terminal cell — one grapheme + style. Mirrors
ratatui’s
buffer::Cellshape but with serde derived. - Geometry
- Sent by the host once on connection, then on every terminal resize.
Enums§
- Host
Message - Host → sibling messages.
- Input
Event - Routed input event from the host. Key / mouse events that happened inside the mount’s area are forwarded as-is.
- RgbOr
Index - Either a true-color RGB triple or a 256-color palette index.
- Sibling
Message - Sibling → host messages.
Functions§
- read_
message - Read a length-prefixed JSON message from a stream.
- write_
message - Write a length-prefixed JSON message to a stream.