Hub API

Lookup tables for the hub: subsystems, launcher fields, duplication strategies, dock categories, the hub UI protocol, the namespace routes, the client runtime, the client context, and dock entry types.

Lookup tables for @devframes/hub — its node-side subsystems and its browser-side client runtime. Each section links the guide page that teaches the concept.

Hub subsystems

What DevframeHubContext adds to DevframeNodeContextHub.

SubsystemAPIPurpose
ctx.docksregister / update / values / activateDock entries (iframes, launchers, custom-render) and groups; activate(dockId, params?) sets the active dock (Cross-iframe dock activation).
ctx.terminalsregister / startChildProcessAggregate terminal sessions, streaming output (Terminals).
ctx.messagesadd / update / remove / clearServer-side toast/notification queue (FIFO, capped at 1000).
ctx.commandsregister / execute / listHierarchical command palette with keybindings and when clauses.

Launcher fields

The optional launcher fields that make a type: 'launcher' dock entry a live process controller — Process-control launchers.

FieldPurpose
commandBound command id; out-of-process hub UI providers dispatch via hub:commands:execute (register a handler via ctx.commands).
terminalSessionIdTracked session id; a "view in terminal" action calls hub:docks:activate with the terminals dock id and { sessionId }.
digestLatest progress line, shown inline; patch via docks.update().

Duplication strategies

The duplicationStrategy values deciding what happens when a devframe shares an already-mounted idDuplicate devframes.

StrategyBehavior
'warn' (default)Keep the first, drop the later, emit DF8105.
'silent'Drop the later one without warning.
'throw'Throw DF8105.
'duplicate'Every instance coexists under a disambiguated dock id (my-tool, my-tool-2, …).

Dock categories

DEFAULT_CATEGORIES_ORDER (from @devframes/hub, /node, /client, /constants) names the default dock-rail buckets — The dual role of category.

CategoryWeightTypical use
framework-100Framework internals.
default0Uncategorized.
app100App tools.
ui150Components, styling.
data250State, storage, queries.
web300Network, platform, a11y.
performance350Profiling, metrics.
advanced400Power-user tools.
docs500Documentation.
~builtin1000Built-in views; always last.

Hub UI protocol

The shared-state keys and RPC methods a hub UI provider renders from — The hub UI protocol.

ChannelTypeWhat it carries
devframe:docks shared stateDevframeDockEntry[]Every registered dock entry.
devframe:commands shared stateDevframeServerCommandEntry[]Serializable command list (handlers stripped).
devframe:user-settings shared stateDevframeDocksUserSettingsPersisted project-scope hub settings.
devframe:docks:active shared stateDevframeDocksActiveStateMost recent dock activation request.
hub:commands:execute RPC(id, ...args) => unknownServer-side command dispatch.
hub:docks:activate RPC({ dockId, params? }) => voidSwitch the active dock.

Hub namespace routes

What initHub() serves under its baseThe namespace.

PathServes
/the ui.viewer SPA, or index document when headless
<id>/each devframe's SPA + own __connection.json → shared socket
embedded.jsthe ui.embedded bootstrap (404 if none)
__connection.jsonmeta for the shared RPC socket
__wsWebSocket upgrade route
__index.jsonmachine-readable index: mounted devframes, endpoints
__client-imports.jsdock client-script import map for hub UI providers
__mcpaggregate MCP endpoint over the tool registry (opt-in mcp)

Client runtime options

The options of createDevframeClientRuntime()The client runtime.

OptionDescription
rpcAn already-connected DevframeRpcClient; when omitted, created via connectDevframe(connect).
connectForwarded to connectDevframe when rpc is omitted (e.g. baseURL).
clientType'standalone' (default) — owns the page; 'embedded' — inside a user app alongside a panel.
loadClientScriptsImport and run dock client scripts (default true).
renderersDock renderers registered at boot, keyed by dock type; local wins over the hub's renderer manifest.

Client context properties

The properties of DevframeClientContextThe client context.

PropertyDescription
rpcThe RPC client — server/client functions, shared state.
clientType'embedded' (inside the user app) or 'standalone' (independent hub page).
docksentries, selected, groupedEntries, switchEntry(), toggleEntry(), getStateById(), register() / update() for client-only docks.
panelDock panel state: position, size, drag/resize.
commandsCommand palette: register(), execute(), getKeybindings().
renderersDock-renderer registry — register(), get(), has(), mount(entry, container). Routes a dock type to a renderer (local boot or the hub's manifest; local wins). mount() resolves a status: mounted (with dispose), missing-renderer, or load-error (with error).
whenThe when-clause context.
connectionLive connection statusstatus, error, events.

Dock client script fields

Which ClientScriptEntry field carries an entry's client script, and when it runs — Dock client scripts.

Entry kindFieldRuns
actionactionwhen the dock button is activated
custom-renderrendererto render the entry's panel
iframeclientScript (optional)alongside the iframe panel, inside the host page

Frame-nav messages

The origin-locked postMessage protocol on devframe:frame-navShared-iframe soft navigation.

MessageDirectionMeaning
ready / manifestiframe → host pagetab list ({ tabs, current }), on load and change
navigatehost page → iframeshow a view ({ tabId, navTarget }); the SPA routes client-side
navigatediframe → host pagethe SPA navigated internally; the hub UI provider highlights the dock

Dock entry types

The built-in variants of the open dock union (DevframeDockEntryRegistry, @devframes/hub/types) a hub UI provider renders — Build Your Own Hub UI.

TypeThe hub UI provider renders
iframethe entry's url in a kept-alive iframe (per frameId when shared); honor subTabs soft nav
actiona dock-rail button; activating runs its client script
custom-rendera container its client script mounts into
launchera launch call-to-action reflecting launcher.status
groupone dock-rail button collapsing its member entries
~builtinyour native views (settings, feeds) for reserved ids