DevToolsClient.ts
DevToolsClient.ts overview
Section titled “DevToolsClient.ts overview”Low-level devtools client and tracer wiring over the current Socket.
DevToolsClient speaks the devtools NDJSON protocol used by the unstable
devtools integration. It sends span starts, span events, span completions,
ping messages, and metric snapshots through a socket, then exposes tracer
layers that forward telemetry while preserving the current tracer’s behavior.
Since v4.0.0
Exports Grouped by Category
Section titled “Exports Grouped by Category”constructors
Section titled “constructors”Creates a devtools client over the current Socket, speaking the devtools
NDJSON protocol, sending periodic pings, and responding to metrics snapshot
requests.
When to use
Use when you already have a Socket and need the low-level DevToolsClient
service to exchange devtools telemetry directly.
Details
The effect requires Scope because it starts background fibers for the socket
stream and heartbeat.
Gotchas
make creates only the client service; tracing is installed separately.
See
layerfor providing the client as a layermakeTracerfor creating a tracer after aDevToolsClientis availablelayerTracerfor creating the client from the currentSocketand installing the tracer as a layer
Signature
declare const make: Effect.Effect< { readonly sendUnsafe: (_: DevToolsSchema.Span | DevToolsSchema.SpanEvent) => void }, never, Scope.Scope | Socket.Socket>Since v4.0.0
makeTracer
Section titled “makeTracer”Creates a tracer that delegates to the current tracer while sending span
starts, span events, and span ends to DevToolsClient.
Signature
declare const makeTracer: Effect.Effect<Tracer.Tracer, never, DevToolsClient>Since v4.0.0
layers
Section titled “layers”Layer that provides DevToolsClient using the current Socket.
When to use
Use to provide the low-level DevToolsClient service over an existing
Socket for custom devtools integrations that send telemetry through the
client directly.
Details
It delegates to make, so it speaks the devtools NDJSON protocol over the
provided Socket, sends periodic pings, responds to metrics snapshot
requests, and finalizes its background fibers when the layer scope closes.
Gotchas
This layer only provides the client. It does not install the devtools tracer by itself.
See
makefor constructing the client as a scoped effect instead of a layerlayerTracerfor a higher-level layer that creates the client and installs the devtools tracer
Signature
declare const layer: Layer.Layer<DevToolsClient, never, Socket.Socket>Since v4.0.0
layerTracer
Section titled “layerTracer”Layer that creates a DevToolsClient from the current Socket and installs
the devtools tracer.
Signature
declare const layerTracer: Layer.Layer<never, never, Socket.Socket>Since v4.0.0
services
Section titled “services”DevToolsClient (class)
Section titled “DevToolsClient (class)”Service for sending span and span-event telemetry to the Effect devtools connection.
Signature
declare class DevToolsClientSince v4.0.0