Skip to content

Events Reference ​

Devframe carries change notifications across channels of differing direction and reach: a node event bus, server RPC, and server-pushed broadcasts and shared state.

Two prefixes mark the wire surface: hub: for hub-layer server RPC (client → server), devframe: for the client-facing protocol (server → client). The internal event bus mirrors the subsystem vocabulary (docks, terminals, messages, commands) — docks:activate fans out to devframe:docks:activate.

Each name lives in code: HUB_EVENTS (@devframes/hub/constants) backs the hub tables, DEVFRAME_EVENTS (devframe/constants) the core ones.

Hub events ​

Internal node event bus ​

Each subsystem host emits on ctx.<subsystem>.events, consumed inside the same node process by createHubContext, which fans them onto the wire.

EventEmitted byConsumed byPayload
docks:entry:updatedDocksHost.register / updatecontext → devframe:docks shared stateDevframeDockUserEntry
docks:activateDocksHost.activate()context → broadcast + devframe:docks:activeDevframeDockActivation
terminals:session:updatedTerminalsHost register / update / remove / status changecontext → devframe:terminals:updated; terminals pluginDevframeTerminalSession
messages:added / messages:updated / messages:removed / messages:clearedMessagesHost mutationscontext → devframe:messages:updated; messages pluginentry / entry / id / —
commands:registered / commands:unregisteredCommandsHost register / update / unregistercontext → devframe:commands shared stateentry / id

Server RPC methods — client → server ​

MethodSignaturePurpose
hub:docks:activate({ dockId, params? }) => voidAsk the viewer to switch its active dock — see Deep Linking.
hub:commands:execute(id, ...args) => unknownInvoke a registered server command by id.
hub:messages:add(input) => DevframeMessageEntryAdd a message to the feed (marked from: 'browser').
hub:messages:update(id, patch) => DevframeMessageEntry | undefinedPatch a message by id.
hub:messages:remove(id) => voidRemove a message by id.
hub:messages:clear() => voidRemove every message.
hub:terminals:write(id, data) => voidSend input to an interactive PTY session.
hub:terminals:resize(id, cols, rows) => voidResize an interactive PTY session.
hub:terminals:terminate(id) => voidKill a session's process, keeping it registered.
hub:terminals:restart(id) => voidRe-run a session's command in place.
hub:terminals:remove(id) => voidKill a session's process and drop it from the registry.

Broadcasts & shared state — server → client ​

A hub-aware client reads or subscribes via rpc.client.register(...); the client host registers the devframe:docks:activate handler for you.

NameKindCarries
devframe:docks:activatebroadcastLive "switch active dock" request — the client host calls its local switchEntry.
devframe:terminals:updatedbroadcastTerminal sessions changed; re-read terminal state.
devframe:messages:updatedbroadcastMessage list changed; re-read message state.
devframe:docksshared stateProjected dock entry list (DevframeDockEntry[]).
devframe:docks:activeshared stateMost recent DevframeDockActivation, so a dock that mounts in response still converges on it.
devframe:commandsshared stateSerializable command list, handlers stripped (DevframeServerCommandEntry[]).
devframe:user-settingsshared statePersisted per-workspace hub settings (DevframeDocksUserSettings).
devframe:terminalsstreaming channelLive terminal output stream, keyed by session id.

Core devframe events ​

This map covers notifications only; request/response RPC endpoints (devframe:rpc:server-state:*, devframe:streaming:subscribe, anonymous:devframe:auth, …) are typed in types/rpc-augments.ts, not events.

Node host bus ​

Emitted on ctx.agent.events; adapters (e.g. the MCP server) re-publish their manifest.

EventEmitted byPayload
agent:manifest:changedany tool/resource/provider change—
agent:tool:registered / agent:tool:unregisteredregisterTool / unregisterToolAgentTool / id
agent:resource:registered / agent:resource:unregisteredregisterResource / unregisterResourceAgentResource / id

Client connection events ​

Emitted on the RPC client's rpc.events (RpcClientEvents) to track connection lifecycle and errors.

EventCarries
rpc:is-trusted:updatedTrust gate flipped (boolean).
rpc:errorAn RPC call rejected (error, method).
connection:statusConnection status changed (status, previous).
connection:errorA connection-level error (WebSocket errored, or trust refused).

Broadcasts — server → client ​

Pushed to subscribed clients, wired by the framework's own hosts.

NameCarries
devframe:auth:revokedThis connection's bearer token was revoked; the client drops to untrusted.
devframe:rpc:client-state:updatedFull shared-state snapshot for a key.
devframe:rpc:client-state:patchIncremental shared-state patch for a key.
devframe:streaming:chunkA streaming chunk for a subscribed channel/id.
devframe:streaming:endA streaming terminator (optionally an error).
devframe:streaming:upload-cancelServer-side cancel of an in-flight upload.

Plus one postMessage channel, devframe:remote-assets-error, posted by the remote-assets fallback page to window.parent so an embedding viewer can replace the 502 page.

Released under the MIT License.