npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kyneta/transport

v1.8.0

Published

Transport infrastructure — base class, channel types, message vocabulary, and client utilities for @kyneta/exchange

Readme

@kyneta/transport

Transport infrastructure for @kyneta/exchange — base class, channel types, message vocabulary, identity types, client utilities, wire pipeline, and bridge transport.

What's in this package

| Module | Contents | |--------|----------| | Identity types | PeerId, DocId, ChannelId, TransportType, PeerIdentityDetails | | Message vocabulary | ChannelMsg, PresentMsg, InterestMsg, OfferMsg, DismissMsg, EstablishmentMsg, AddressedEnvelope, ReturnEnvelope | | Channel types | Channel, ConnectedChannel, EstablishedChannel, GeneratedChannel, ChannelDirectory | | Transport base class | Transport<G>, TransportFactory, TransportContext | | Wire pipeline | Pipeline<S, R>, FrameStreamParser, Encoding, PayloadOf, WireOpts | | Client state machine | StateTransition<S>, TransitionListener<S> (re-exported from @kyneta/machine) | | Reconnection | computeBackoffDelay, shouldReconnect, ReconnectDecision, ReconnectOptions, DEFAULT_RECONNECT, JITTER_FRACTION | | Re-exports from wire | Result, Ok, Err, ok, err, WireError | | Bridge transport | Moved to @kyneta/bridge-transport — codec-faithful + alias-aware in-process testing |

Wire pipeline

The Pipeline<S, R> class is the single wire pipeline for all transports. It composes alias resolution, wire-message encoding, fragmentation, and validation into a send/receive pair that transforms ChannelMsg ↔ wire pieces.

Four shapes cover every transport:

import { Pipeline } from "@kyneta/transport"

// Most transports (WebSocket, WebRTC, Unix socket)
const symmetric = new Pipeline({ send: "binary" })

// Symmetric text (if needed)
const text = new Pipeline({ send: "text" })

// SSE server — sends text downstream, receives binary CBOR uploads
const sseServer = new Pipeline({ send: "text", receive: "binary" })

// SSE client — sends binary CBOR uploads, receives text downstream
const sseClient = new Pipeline({ send: "binary", receive: "text" })

The type parameter S is the send encoding and R is the receive encoding (defaults to S for symmetric pipelines). PayloadOf<E> maps "binary"Uint8Array and "text"string.

Who depends on this

@kyneta/transport  (defines Transport, Channel, ChannelMsg, Pipeline, ...)
    ↑           ↑           ↑            ↑
@kyneta/exchange  @kyneta/bridge-transport  @kyneta/websocket-transport  ...
(Synchronizer)    (in-process testing)       (extends Transport)
  • @kyneta/wire@kyneta/transport depends on @kyneta/wire (workspace). Wire is a leaf — it provides format primitives. Transport builds the pipeline on top.
  • @kyneta/exchange — depends on @kyneta/transport and re-exports its infrastructure (identity types, message vocabulary, channel types, Transport base class, reconnection utilities). The exchange adds the sync runtime (Synchronizer, Exchange, TransportManager) on top.
  • Transport implementations (@kyneta/bridge-transport, @kyneta/websocket-transport, @kyneta/sse-transport, @kyneta/unix-socket-transport, @kyneta/webrtc-transport) — peer-depend on @kyneta/transport for the Transport<G> base class, channel types, message vocabulary, and Pipeline.

Creating a transport

Extend the Transport<G> base class:

import { Transport, type GeneratedChannel } from "@kyneta/transport"

class MyTransport extends Transport<void> {
  constructor() {
    super({ transportType: "my-transport" })
  }

  generate(): GeneratedChannel {
    return {
      transportType: this.transportType,
      send: (msg) => { /* send over your wire */ },
      stop: () => { /* cleanup */ },
    }
  }

  async onStart() {
    const channel = this.addChannel(undefined)
    this.establishChannel(channel.channelId)
  }

  async onStop() {
    // cleanup
  }
}

Dependencies

{
  "dependencies": {
    "@kyneta/wire": "workspace:^",
    "@kyneta/random": "workspace:^"
  }
}

@kyneta/schema and @kyneta/machine are peer dependencies (needed for SyncProtocol, ReplicaType, SubstratePayload, and the state-machine types used in message definitions).

License

MIT