@nice-code/devtools-core
v0.66.1
Published
Readme
@nice-code/devtools-core
Docs: nicecode.io — guides, integrations, and the full API surface. Working with an AI assistant? Point it at nicecode.io/llms-devtools.txt (the devtools suite) or nicecode.io/llms.txt (the whole stack) — the complete, current docs flattened into plain text.
The framework-agnostic core of the nice-* devtools — no React, no DOM-only
assumptions beyond runtime-guarded globals. It is what the devtools panels
(nice-devtools-shared + the per-suite browser devtools), the relay
(@nice-code/devtools-relay), and producers (app clients and backends) all
build on, so a backend can stream its telemetry to a devtools window without
pulling in React.
Contents:
- Transport seam —
IDevtoolsTransport+createBroadcastChannelTransport,createWebSocketTransport(relay),createFanoutTransport(span both). - Bridge / client —
DevtoolsBridge(host/producer side: register snapshot & sample scopes, dial a transport) andDevtoolsWindowClient(consumer side: multi-client fan-out,createRemoteTrafficCore). - Protocol — the versioned
hello/ready/snapshot/sample/command/backfillenvelope anddevtoolsChannelName. - Window presence —
focusExistingDevtoolsWindow/serveDevtoolsOpenerFocus/serveDevtoolsWindowPresence(dedupe/focus an already-open window). - Traffic metrics —
TrafficMetricsCore+ITrafficSample/window types +frameByteSize. - Event log —
EventLogCore(window-side synthesis of "what caused traffic"). - Dev gate —
isDevtoolsEnabled. - Remote (deployed staging) —
createRemoteSessionCarrier/remoteSessionJoinUrl(the producer/window side of an authenticated relay session; aproduction-declared producer never dials),normalizeBackendDialUrl(backend dial hygiene: coerces tows(s)://, refuses plainws://off-machine), andsummarizeShape(the shared shape-not-values redaction thatstreamContents: falsegates action, state and realm through).
The React panels live in nice-devtools-shared, which depends on and re-exports
this package.
