Skip to main content

Module wcore

Module wcore 

Source
Expand description

AgentMux Core: application coordinator for storage + pub/sub. Port of Go’s pkg/wcore/wcore.go + window.go + workspace.go + block.go.

Orchestrates Store mutations with MPS event publishing.

Re-exportsΒ§

pub use block::*;
pub use event::*;
pub use tab::*;
pub use window::*;
pub use workspace::*;

ModulesΒ§

block πŸ”’
Block CRUD operations.
dnd πŸ”’
Drag-and-drop operations: moving/promoting/tearing-off blocks and tabs.
event πŸ”’
Pub/sub event publishing for StoreObj updates.
tab πŸ”’
Tab CRUD and reorder operations.
window πŸ”’
Window CRUD, focus, workspace switching, and repair operations.
workspace πŸ”’
Workspace CRUD operations.

ConstantsΒ§

LAYOUT_ACTION_CLEAR_TREE
LAYOUT_ACTION_INSERT
LAYOUT_ACTION_INSERT_AT_INDEX
LAYOUT_ACTION_REMOVE
LAYOUT_ACTION_REPLACE
LAYOUT_ACTION_SPLIT_HORIZONTAL
LAYOUT_ACTION_SPLIT_VERTICAL

FunctionsΒ§

default_three_pane_tree πŸ”’
Pure builder for the default 3-pane tree (agent | [sysinfo / swarm]). Returns (rootnode, focused_node_id, leaforder). Shared by the pre-bootstrap store-direct writer above (first launch β€” reducer not hydrated yet) and the post-bootstrap reducer-routed CreateWindow seed (SPEC_864 Phase 3, seed_layout_via_reducer), so the layout shape can never drift between the two paths.
ensure_initial_data
Ensure initial data is present in the store. Creates a default Client, Window, Workspace, Tab if the store is empty. Returns true if this is a first launch (client was just created).
get_client
Get the singleton client record.
seed_default_layout πŸ”’
Seed a tab with the default 3-pane launch layout (agent + sysinfo + swarm):
single_leaf_tree πŸ”’
Pure builder for a single-pane tree wrapping exactly one block β€” no splits. Used by the post-bootstrap CreateWindow seed (handle_create_window) when the caller supplies a specific seed_view (e.g. β€œOpen in New Window” on a widget) instead of wanting the default 3-pane launch layout β€” the new window’s sole pane is the requested widget, not that widget plus the default agent/swarm/sysinfo split.
write_default_three_pane_layout πŸ”’
Write the default 3-pane launch layout (agent | [sysinfo / swarm]) into tab_id’s LayoutState, wrapping three block IDs that the caller has ALREADY created.