Module launcher_ipc

Module launcher_ipc 

Source

Structs§

LauncherIpcHandle
Handle the host holds for its lifetime so the launcher’s IPC pipe stays open. Dropping it closes the connection (launcher logs as a disconnect).

Statics§

COMMAND_TX 🔒
Phase B.4 — global outbound command channel. Set once when the launcher pipe connects; sync callers (CEF lifecycle callbacks fire on the UI thread) post Commands without needing a tokio runtime handle. Drained by a task spawned in connect_to_launcher that writes to the pipe.

Functions§

apply_event_to_shadow 🔒
apply_shadow_projection 🔒
Apply a launcher event to host’s shadow projections, then fan the event out to every top-level renderer via the JS bridge.
compute_and_report_host_counts
Phase B.4 follow-up — compute the host’s authoritative counts from AppState and report them. Callers invoke this AFTER each window/pool transition.
connect_to_launcher
If AGENTMUX_LAUNCHER_PIPE is set, connect, Register as Host, and return a handle the caller (host main.rs) holds for the host’s lifetime. If unset → return None and the host runs in pre-Phase-B mode (no launcher connection).
report_backend_window_id_registered
Phase B.5 (window_id_map step b) — sync API: report the frontend’s register_backend_window IPC to the launcher. Called from commands/window.rs::register_backend_window after the host’s local window_id_map insert. No-op if the launcher pipe isn’t connected.
report_backend_window_id_unregistered
Phase B.5 (window_id_map step b) — sync API: report a window’s backend ID being dropped (close path). Called from client.rs::on_before_close after the host’s local window_id_map.remove. No-op if launcher pipe absent.
report_host_counts
Phase B.4 follow-up — sync API: report the host’s current authoritative counts so the launcher reducer can compare against its mirror and emit Event::DriftDetected on mismatch. Callers invoke this AFTER each window-level transition so the launcher gets a fresh snapshot to compare against its just-applied transition.
report_host_pool_count
Phase B.4 follow-up — sync API: report the host’s pool count only. Used by spawn_pool_window where the windows dimension is mid-flight relative to the launcher mirror (refill happens during a close path that hasn’t sent ReportWindowClosed yet); snapshotting only the pool dimension preserves the check-every-transition guarantee without producing false windows-drift. (codex P2 PR #578 round-3.)
report_hwnd_destroyed
Phase B.9.1 — sync API: report a Win32 HWND destroyed.
report_hwnd_foreground_changed
Phase B.9.1 — sync API: report foreground change.
report_hwnd_iconic_changed
Phase B.9.1 — sync API: report iconic (minimized) change.
report_hwnd_opened
Phase B.9.1 (WRR) — sync API: report a Win32 HWND created. Called from the WRR SetWinEventHook callback. No-op if the launcher pipe isn’t connected (task dev mode); reducer arm stashes pending-without-label until reconciliation.
report_hwnd_position_changed
Phase B.9.1 — sync API: report position change. Caller is responsible for debouncing — see wrr/position_debounce.rs.
report_hwnd_visibility_changed
Phase B.9.1 — sync API: report visibility change.
report_monitor_topology_changed
Phase B.9.1 — sync API: report current monitor topology. Sent once at install time; mid-session topology changes are a B.9.2 follow-up.
report_panes_reaped
Phase F.6 — sync API: tell the launcher that all browser-pane HWNDs belonging to a closing top-level window have been reaped (lifecycle entries drained, pane HWND map cleared, subwindow cascade closes initiated). Sent from client.rs::on_before_close AFTER the pane drain step, BEFORE the post-close pool-drain decision is reported.
report_pool_drain_decision
Phase F.6 — sync API: tell the launcher the result of the post-close drain-pool-if-last decision. was_last == true when the closing window was the last user-visible window (Stage 1 of the wrr two-stage close cascade just kicked off in client.rs::on_before_close); false when other windows remain and the warm pool stays warm.
report_pool_window_added
Phase B.4 follow-up — sync API: report a pool window being added to the warm pool inventory. Called from spawn_pool_window on the UI thread. No-op when launcher pipe is absent.
report_pool_window_promoted
Phase F.5 — sync API: tell the launcher that a pool window is promoting to a user-visible top-level window. Sent BETWEEN report_pool_window_removed and report_window_opened so the launcher’s pool-respawn saga (state-machine bracket around the implicit refill) can correlate the promote event with the subsequent PoolWindowAdded for the freshly-spawned replacement pool slot.
report_pool_window_removed
Phase B.4 follow-up — sync API: report a pool window leaving the pool (promote, destroy). On promote callers should also call report_window_opened so the label transitions atomically (from the launcher’s perspective) from pool to windows.
report_window_closed
Phase B.4 — sync API: report a window close to the launcher’s state mirror. Same no-op-if-disconnected semantics as report_window_opened.
report_window_opened
Phase B.4 — sync API: report a window open to the launcher’s state mirror. Called from CEF lifecycle callbacks on the UI thread. No-op if the launcher pipe isn’t connected (task dev mode); failures to enqueue (channel closed, drain task died) are logged but don’t propagate — the host’s authoritative state is unaffected, the mirror just falls behind. B.5 tightens.