DevtoolsHub

class
hub.ts:230

Central WebSocket hub that brokers messages between Yoltra stores and DevTools extensions.

- Accepts WS connections, validates protocol handshakes, and routes messages. - Store events are fan-out to all extension clients. - Extension commands are routed to the target store by storeId. - Maintains a ring buffer of recent events for late-connecting extensions. - Binds to localhost only (v1 security).

Constructor

constructor

Create a new DevTools hub instance.

signature
new(opts): DevtoolsHub

Create a new DevTools hub instance.

Parameters

NameTypeDescription
optsDevtoolsHubOptionsHub configuration. All fields are optional.

Returns

DevtoolsHub

Properties

NameTypeDescription
extensionCountget/setnumber
historySizeget/setnumber
storeCountget/setnumber

Methods

static probe

Check if a DevTools hub is already running on the given port.

signature
probe(port): Promise<boolean>

Check if a DevTools hub is already running on the given port.

Parameters

NameTypeDescription
portnumberPort to probe.

Returns

Promise<boolean>, true if a hub is listening and responds to handshake.

start

Start the WebSocket server and begin accepting connections.

signature
start(): Promise<void>

Start the WebSocket server and begin accepting connections.

Returns

Promise<void>, Resolves once the server is bound and listening.

stop

Stop the server and close all connections.

signature
stop(): Promise<void>

Stop the server and close all connections.

Returns

Promise<void>, Resolves once the server has fully shut down.