Frontend communication domain facade.
External callers tell the frontend WHAT to do through semantic operations. The Frontend domain handles HOW (binary encoding, batching, protocol versioning) internally.
Render frames
The Editor builds a Frame struct (display list of styled text
runs). send_render_frame/2 encodes and sends it to the frontend.
Parser commands
Tree-sitter parsing runs in a separate Zig process. Parser commands (setup_buffer, update_buffer, set_queries) encode the appropriate wire messages and send them to the parser port.
Configuration
Font, title, theme, and window background are set through individual semantic operations.
Summary
Functions
Returns the frontend capabilities struct.
Sends a clipboard write command to the GUI frontend.
Configures the editor font.
Decodes a binary event from the frontend or parser process.
Returns the default capabilities struct.
Returns true if the frontend supports GUI chrome opcodes.
Returns true if the frontend is ready to receive commands.
Returns true if the frontend supports semantic render-model opcodes.
Sends a list of pre-encoded commands to the frontend process.
Sends a bare, content-free frame transaction to the frontend (#2219).
Sends the per-frame render batch and stamps a monotonic send time so the
frontend emits a [:minga, :render, :hop_latency] (hop: :send_commands)
sample for the Renderer.Server → Port.Manager scheduling delay.
Toggles the GUI go-to-definition link cursor (#2630).
Sets the window title.
Sets the window background color.
Subscribes the calling process to frontend events.
Returns the terminal dimensions {width, height}.
Functions
@spec capabilities(GenServer.server()) :: MingaEditor.Frontend.Capabilities.t()
Returns the frontend capabilities struct.
@spec clipboard_write(GenServer.server(), String.t(), atom()) :: MingaEditor.Frontend.Adapter.admission()
Sends a clipboard write command to the GUI frontend.
@spec configure_font( GenServer.server(), String.t(), pos_integer(), boolean(), atom(), [String.t()] ) :: MingaEditor.Frontend.Adapter.admission()
Configures the editor font.
@spec decode_event(binary()) :: {:ok, MingaEditor.Frontend.Protocol.input_event()} | {:error, :unknown_opcode | :malformed}
Decodes a binary event from the frontend or parser process.
@spec default_capabilities() :: MingaEditor.Frontend.Capabilities.t()
Returns the default capabilities struct.
@spec gui?(MingaEditor.Frontend.Capabilities.t()) :: boolean()
Returns true if the frontend supports GUI chrome opcodes.
@spec ready?(GenServer.server()) :: boolean()
Returns true if the frontend is ready to receive commands.
@spec semantic_ui?(MingaEditor.Frontend.Capabilities.t()) :: boolean()
Returns true if the frontend supports semantic render-model opcodes.
@spec send_commands(GenServer.server() | nil, [binary()]) :: MingaEditor.Frontend.Adapter.admission()
Sends a list of pre-encoded commands to the frontend process.
@spec send_frame_boundary( GenServer.server(), non_neg_integer(), non_neg_integer(), non_neg_integer() ) :: MingaEditor.Frontend.Adapter.admission()
Sends a bare, content-free frame transaction to the frontend (#2219).
Used by frame-synchronization contracts that must emit a frame boundary without
re-rendering (the operator-pending no-op optimization). Brackets nothing with
begin_frame ++ commit_frame. frame_seq is the strictly monotonic global frame
sequence; base_frame_seq names the previously emitted frame (0 for the first).
input_seq is the echoed input correlation sequence (ticket #2215, default 0).
@spec send_render_commands(GenServer.server() | nil, [binary()]) :: MingaEditor.Frontend.Adapter.admission()
Sends the per-frame render batch and stamps a monotonic send time so the
frontend emits a [:minga, :render, :hop_latency] (hop: :send_commands)
sample for the Renderer.Server → Port.Manager scheduling delay.
@spec set_link_cursor(GenServer.server() | nil, boolean()) :: MingaEditor.Frontend.Adapter.admission()
Toggles the GUI go-to-definition link cursor (#2630).
Emitted out-of-band (post-commit) like set_title, so it joins the frontend
out-of-band allowlist. The GUI shows NSCursor.pointingHand while active.
@spec set_title(GenServer.server() | nil, String.t()) :: MingaEditor.Frontend.Adapter.admission()
Sets the window title.
@spec set_window_bg(GenServer.server() | nil, non_neg_integer()) :: MingaEditor.Frontend.Adapter.admission()
Sets the window background color.
@spec subscribe(GenServer.server()) :: :ok
Subscribes the calling process to frontend events.
@spec terminal_size(GenServer.server()) :: {pos_integer(), pos_integer()} | nil
Returns the terminal dimensions {width, height}.