@dimchansky/meshpost 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +330 -96
- package/dist/channel.d.ts +37 -2
- package/dist/channel.js +226 -12
- package/dist/combine.d.ts +12 -1
- package/dist/combine.js +304 -213
- package/dist/crypto.d.ts +34 -0
- package/dist/crypto.js +158 -0
- package/dist/identity.d.ts +45 -0
- package/dist/identity.js +264 -0
- package/dist/index.d.ts +17 -5
- package/dist/index.js +8 -2
- package/dist/mqtt.d.ts +9 -1
- package/dist/mqtt.js +95 -87
- package/dist/nostr.d.ts +27 -0
- package/dist/nostr.js +1008 -0
- package/dist/room.d.ts +37 -7
- package/dist/room.js +656 -65
- package/dist/rpc.d.ts +48 -0
- package/dist/rpc.js +382 -0
- package/dist/signaling.d.ts +9 -8
- package/dist/signaling.js +10 -2
- package/dist/state.d.ts +56 -0
- package/dist/state.js +305 -0
- package/dist/tabs.js +8 -1
- package/dist/turn.d.ts +13 -0
- package/dist/turn.js +213 -0
- package/dist/voice.d.ts +108 -0
- package/dist/voice.js +1160 -0
- package/dist/ws.d.ts +17 -2
- package/dist/ws.js +248 -33
- package/docs/behavior.md +107 -54
- package/package.json +67 -2
package/docs/behavior.md
CHANGED
|
@@ -4,33 +4,39 @@ This document specifies limits, lifecycle rules, wire formats, and security boun
|
|
|
4
4
|
|
|
5
5
|
## Limits and timeouts
|
|
6
6
|
|
|
7
|
-
| Parameter | Default / Limit | Notes
|
|
8
|
-
| ---------------------------- | ---------------------------------------- |
|
|
9
|
-
| Max packet size | `16,384` bytes (16 KiB) | Or the smaller peer SCTP `maxMessageSize`.
|
|
10
|
-
| `createChannel` payload max | `16,384 - (1 + nameBytes.length)` bytes | `name` must be `1–64` UTF-8 bytes.
|
|
11
|
-
| Send buffer limit | `64 KiB` unreliable / `256 KiB` reliable | Per peer and per data channel. Exceeding returns `'busy'`.
|
|
12
|
-
| `onDrain` threshold | `32 KiB` unreliable / `128 KiB` reliable | Fires when `bufferedAmount` drops to half the data channel limit.
|
|
13
|
-
| `maxPeers` | `32` | Simultaneous peer connections per room.
|
|
14
|
-
| `handshakeTimeoutMs` | `35,000` ms (`180,000` ms manual demo) | Deadline per connection attempt before retry.
|
|
15
|
-
| `iceGatheringTimeoutMs` | `2,500` ms (up to `10,000` ms with TURN) | Max wait for ICE candidates before publishing SDP (default capped at `handshakeTimeoutMs / 2`).
|
|
16
|
-
| Disconnect grace period | `8,000` ms | Wait time for transient `disconnected` state before dropping.
|
|
17
|
-
| Leave flush grace | `750` ms | Max wait for `meshpost/1/leave` to flush on `room.leave()`.
|
|
18
|
-
| Early-packet buffer | `64` packets or `256 KiB` per peer | Holds packets arriving before both data channels open.
|
|
19
|
-
| Discovery lease | `30,000` ms (`5,000` ms heartbeat) | Peers send a heartbeat every 5,000 ms and expire from the roster after 30,000 ms of silence.
|
|
20
|
-
| MQTT handshake
|
|
21
|
-
|
|
|
22
|
-
| WS handshake / ping
|
|
23
|
-
| In-band `rtc:` queue / cap | `16` pending / `32` remote streams | Max queued incoming `'meshpost/1/rtc:'` frames and max tracked remote `MediaStream`s per peer.
|
|
7
|
+
| Parameter | Default / Limit | Notes |
|
|
8
|
+
| ---------------------------- | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
9
|
+
| Max packet size | `16,384` bytes (16 KiB) | Or the smaller peer SCTP `maxMessageSize`. |
|
|
10
|
+
| `createChannel` payload max | `16,384 - (1 + nameBytes.length)` bytes | `name` must be `1–64` UTF-8 bytes. |
|
|
11
|
+
| Send buffer limit | `64 KiB` unreliable / `256 KiB` reliable | Per peer and per data channel. Exceeding returns `'busy'`. |
|
|
12
|
+
| `onDrain` threshold | `32 KiB` unreliable / `128 KiB` reliable | Fires when `bufferedAmount` drops to half the data channel limit. |
|
|
13
|
+
| `maxPeers` | `32` | Simultaneous peer connections per room. |
|
|
14
|
+
| `handshakeTimeoutMs` | `35,000` ms (`180,000` ms manual demo) | Deadline per connection attempt before retry. |
|
|
15
|
+
| `iceGatheringTimeoutMs` | `2,500` ms (up to `10,000` ms with TURN) | Max wait for ICE candidates before publishing SDP (default capped at `handshakeTimeoutMs / 2`). |
|
|
16
|
+
| Disconnect grace period | `8,000` ms | Wait time for transient `disconnected` state before dropping. |
|
|
17
|
+
| Leave flush grace | `750` ms | Max wait for `meshpost/1/leave` to flush on `room.leave()`. |
|
|
18
|
+
| Early-packet buffer | `64` packets or `256 KiB` per peer | Holds packets arriving before both data channels open. |
|
|
19
|
+
| Discovery lease | `30,000` ms (`5,000` ms heartbeat) | Peers send a heartbeat every 5,000 ms and expire from the roster after 30,000 ms of silence. |
|
|
20
|
+
| MQTT / Nostr handshake | `10,000` ms | Deadline for MQTT `CONNACK -> SUBACK` or Nostr `REQ -> EOSE` per relay. |
|
|
21
|
+
| Signaling replay / MID TTL | `±60,000` ms / `120,000` ms | Anti-replay window for password-encrypted MQTT, Nostr, & WS signaling (`mid` max `64` chars, `2,048` cap). |
|
|
22
|
+
| WS handshake / ping / queues | `10,000` ms / `25,000` ms / `128` / `64` | `wsSignaling()` open deadline, keepalive ping interval, and max pending async encrypt/decrypt queue depths. |
|
|
23
|
+
| In-band `rtc:` queue / cap | `16` pending / `32` remote streams | Max queued incoming `'meshpost/1/rtc:'` frames and max tracked remote `MediaStream`s per peer. |
|
|
24
|
+
| `createVoice` remote cap | `4` audio streams per peer | Max concurrent incoming audio streams played/metered per peer (`180` ms meter default). |
|
|
25
|
+
| `createRpc` defaults / caps | `10,000` ms / `256` / `16` / `256` B | Default call timeout, max pending outgoing calls, max concurrent per peer, max error UTF-8 bytes. |
|
|
26
|
+
| `fetchTurnCredentials` caps | `5,000` ms / `64 KiB` / `16` servers | Default request timeout, max JSON response body, and max sanitized `RTCIceServer` entries. |
|
|
27
|
+
| `hello` / `F5` reclaim caps | `4,096` B / `60,000` ms / `128` peers | Max `'meshpost/1/hello:'` frame size, same-tab reload preimage TTL, and superseded ghost-peer FIFO cap. |
|
|
24
28
|
|
|
25
29
|
## Room lifecycle
|
|
26
30
|
|
|
27
31
|
### Identity and membership
|
|
28
32
|
|
|
29
33
|
- `joinRoom(name, options)` generates a fresh random peer ID (UUID v4, exposed as `room.id`). A page reload creates a new peer ID.
|
|
34
|
+
- When `options.identity` (`PeerIdentity` from `createIdentity()` / `importIdentity()`) is supplied, `room.userId` exposes the local 22-char base64url `userId` (`SHA-256("meshpost/1/userid:" || rawUncompressedP256PubKey)[0..16]`), and `room.peerUserId(peerId)` returns each connected remote peer's cryptographically verified `userId` (verified synchronously before `onPeerJoin` fires, or `null` if anonymous/disconnected).
|
|
35
|
+
- In browser tabs with `crypto.subtle`, `joinRoom()` automatically commits a 128-bit one-time Lamport preimage (`SHA-256("meshpost/1/reclaim:" + self + ":" + secret)`) in its WebRTC `hello` frame and writes `{ id, secret, ts }` to `sessionStorage` **only on `pagehide`** (so duplicating a live tab never clones the secret), alongside a best-effort `meshpost/1/leave` notice when `!event.persisted`. When a reloaded tab (`F5`) reconnects within `60 s`, remote peers verify the preimage, drop the superseded ghost connection (`onPeerLeave(oldId)` fires strictly before `onPeerJoin(newId)`), and ignore `oldId` in future roster snapshots (`128`-entry FIFO cap) without waiting `8,000 ms` `disconnectGrace`.
|
|
30
36
|
- `joinRoom()` returns synchronously and starts discovery immediately.
|
|
31
|
-
- `room.peers` returns a snapshot array of remote peer IDs whose unreliable and reliable channels
|
|
32
|
-
- Subscribe to `onPeerJoin` and `onPeerLeave` for future changes. Each subscription (`onPacket`, `onDrain`, `onPeerJoin`, `onPeerLeave`, `onSignalingChange`, `onError`, `onPeerStream`, `onPeerStreamEnd`, `channel.onPacket`, `blobChannel.onBlob`,
|
|
33
|
-
- Subscribing with an already-aborted `signal` (or after `room.leave()`) is a no-op. Unsubscribing, firing a `once` listener, or calling `room.leave()` detaches any registered `'abort'` listener from `signal`. On `channel.onPacket`, `once` unsubscribes only after a packet matches both delivery mode and channel name.
|
|
37
|
+
- `room.peers` returns a snapshot array of remote peer IDs whose unreliable and reliable channels have opened and completed the `'meshpost/1/hello:'` handshake.
|
|
38
|
+
- Subscribe to `onPeerJoin` and `onPeerLeave` for future changes. Each subscription (`onPacket`, `onDrain`, `onPeerJoin`, `onPeerLeave`, `onSignalingChange`, `onError`, `onPeerStream`, `onPeerStreamEnd`, `channel.onPacket`, `codecChannel.onMessage`, `peerState.onChange`, `rpc.handle`, `blobChannel.onBlob`, `blobChannel.onProgress`, and `voice.onChange`) returns an idempotent unsubscribe function and optionally accepts `ListenOptions` (`{ once?: boolean, signal?: AbortSignal }`).
|
|
39
|
+
- Subscribing with an already-aborted `signal` (or after `room.leave()`) is a no-op. Unsubscribing, firing a `once` listener, or calling `room.leave()` detaches any registered `'abort'` listener from `signal`. On `channel.onPacket`, `once` unsubscribes only after a packet matches both delivery mode and channel name; on `codecChannel.onMessage` and `rpc.handle`, `once` unsubscribes only after `codec.decode` succeeds.
|
|
34
40
|
- A room of `N` peers forms up to `N(N - 1) / 2` direct connections (bounded per peer by `maxPeers`).
|
|
35
41
|
- There is no host election, packet forwarding, or history replay. Any peer can join first.
|
|
36
42
|
|
|
@@ -55,27 +61,36 @@ This document specifies limits, lifecycle rules, wire formats, and security boun
|
|
|
55
61
|
|
|
56
62
|
`room.onError((error) => ...)` emits `RoomError` objects (`{ code, message, peerId? }`) with built-in anti-spam guarantees:
|
|
57
63
|
|
|
58
|
-
| Code | When emitted
|
|
59
|
-
| ------------------- |
|
|
60
|
-
| `'room-full'` | An advertised remote peer cannot be tracked because `peers.size >= maxPeers`. Includes `peerId`.
|
|
61
|
-
| `'ice-failed'` | A non-ready link fails (`connectionState === 'failed'`) or hits `handshakeTimeoutMs`. Includes `peerId`.
|
|
62
|
-
| `'media-error'` | In-band WebRTC media renegotiation fails on a live link. Includes `peerId`. Healthy data channels stay open.
|
|
63
|
-
| `'
|
|
64
|
-
| `'
|
|
64
|
+
| Code | When emitted | Anti-spam rule |
|
|
65
|
+
| ------------------- | ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
|
66
|
+
| `'room-full'` | An advertised remote peer cannot be tracked because `peers.size >= maxPeers`. Includes `peerId`. | Emitted at most once per peer ID while that peer stays in the roster. |
|
|
67
|
+
| `'ice-failed'` | A non-ready link fails (`connectionState === 'failed'`) or hits `handshakeTimeoutMs`. Includes `peerId`. | Emitted at most once per peer until it connects (`ready`) or leaves the roster. |
|
|
68
|
+
| `'media-error'` | In-band WebRTC media renegotiation fails on a live link. Includes `peerId`. Healthy data channels stay open. | Emitted per failed renegotiation operation. |
|
|
69
|
+
| `'auth-failed'` | A remote peer sends a malformed `'meshpost/1/hello:'` frame or fails DTLS-bound `ECDSA P-256` verification. | Emitted at most once per peer until it connects (`ready`) or leaves the roster; link is dropped. |
|
|
70
|
+
| `'decrypt-failed'` | A password-protected signaling adapter fails to decrypt an incoming frame (or rejects plaintext downgrade). | Rate-limited independently to once every `15,000` ms per signaling session. |
|
|
71
|
+
| `'clock-skew'` | A valid AEAD-authenticated signaling message falls outside the `±60,000` ms anti-replay clock window. | Rate-limited independently to once every `15,000` ms per signaling session. |
|
|
72
|
+
| `'signaling-error'` | A signaling adapter reports a transport-level failure (e.g. all MQTT/Nostr relays or WS disconnected/failed). | Emitted once per offline transition in `mqttSignaling()`, `nostrSignaling()`, and `wsSignaling()`. |
|
|
65
73
|
|
|
66
|
-
Note:
|
|
74
|
+
Note: when `privateTopic` is `false` (default), `mqttSignaling()`, `nostrSignaling()`, and `wsSignaling()` derive their room topic/tag/key from `namespaceHash(appId + ':' + room)` so peers entering a wrong password receive a `'decrypt-failed'` diagnostic; setting `privateTopic: true` derives the topic/tag/room key via HKDF from `password` instead, hiding room activity on shared relays at the cost of disabling `'decrypt-failed'` wrong-password detection.
|
|
67
75
|
|
|
68
76
|
### Synchronous errors
|
|
69
77
|
|
|
70
|
-
- `joinRoom()` throws `TypeError` for invalid `name` (`^[a-zA-Z0-9_-]{1,64}$`), invalid `appId` (`^[a-zA-Z0-9._-]{1,64}$`), or
|
|
71
|
-
- `
|
|
78
|
+
- `joinRoom()` throws `TypeError` for invalid `name` (`^[a-zA-Z0-9_-]{1,64}$`), invalid `appId` (`^[a-zA-Z0-9._-]{1,64}$`), empty `password`, an invalid/forged `identity` (`PeerIdentity`), or a non-function `RTCPeerConnection` option, and throws `Error` if `RTCPeerConnection` is unavailable on `globalThis` and not provided via `options.RTCPeerConnection`.
|
|
79
|
+
- `createIdentity()`, `exportIdentity()`, and `importIdentity()` reject with `Error` when `crypto.subtle` is unavailable, `exportIdentity()` rejects with `Error` when `extractable: false`, `importIdentity()` rejects with `TypeError` on invalid shape (`!isSerializedIdentity`) or `Error` if `(x, y)` fails a challenge signature check against `d`.
|
|
80
|
+
- `joinRoom()` throws `RangeError` for invalid timeouts or `maxPeers`, throws browser errors immediately if `rtcConfig` is malformed, and throws `Error` if `mqttSignaling()`, `nostrSignaling()`, or default `wsSignaling()` (`encrypt: true`) is used with `password` without `crypto.subtle`.
|
|
72
81
|
- `room.send()` throws `Error` after `leave()`, and `TypeError` for non-`Uint8Array` payloads or invalid `delivery`.
|
|
73
|
-
- `room.addStream()` throws `Error` after `leave()`, and `TypeError` for non-`MediaStream` arguments.
|
|
74
|
-
- `createChannel()` throws `TypeError` for an empty name
|
|
82
|
+
- `room.addStream()` throws `Error` after `leave()`, and `TypeError` for non-`MediaStream` arguments, invalid `AddStreamOptions`, or invalid `tag` (`^[a-zA-Z0-9._-]{1,32}$`). `room.replaceStreamTrack()` rejects with `Error` if the room is closed or the stream is not attached, and `TypeError` for invalid or mismatched-`kind` tracks.
|
|
83
|
+
- `createChannel()` throws `TypeError` for an invalid `room`, empty `name`, invalid `delivery`, or non-function `onPacket` listener, and `RangeError` if the UTF-8 name exceeds 64 bytes.
|
|
84
|
+
- `createCodecChannel()` throws `TypeError` for an invalid `codec`, non-`Uint8Array` `encode()` return, or non-function `onMessage` listener; `jsonCodec()` throws `TypeError` for a non-function `validate` or unserializable value (`undefined`).
|
|
85
|
+
- `createRpc()` throws `TypeError` for an invalid `room`, `requestCodec`, `responseCodec`, or `handle` callback, `Error` if a second active `handle()` is registered on the same `RpcEndpoint`, and `RangeError` for out-of-range `timeoutMs`, `maxPendingCalls`, or `maxConcurrentPerPeer`. `rpc.call()` rejects with `TypeError`/`RangeError` for invalid `peerId`/`timeoutMs`, or with `RpcError`.
|
|
86
|
+
- `createPeerState()` throws `TypeError` for an invalid `room`, `delivery`, `coalesce`, `codec`, `undefined` state value, or non-function `onChange` listener; `RangeError` if `initial` or `set(value)` encodes past the 16 KiB packet limit; and `Error` when calling `set()` or `clear()` after `close()` or `room.leave()`.
|
|
75
87
|
- `createBlobChannel()` throws `RangeError` for invalid `maxReceiveBytes`, `chunkSize`, `receiveTimeoutMs`, or `maxConcurrentPerPeer`. `blobChannel.send()` rejects with `Error` when closed and `TypeError` for non-`Uint8Array` payloads.
|
|
76
|
-
- `wsSignaling()` throws `TypeError` for non-`ws:`/`wss:` URLs and `RangeError` for invalid `handshakeTimeoutMs` or `pingIntervalMs`.
|
|
77
|
-
- `combineSignaling()` throws `RangeError` when given 0 adapters and `TypeError` if any argument is not a function.
|
|
78
|
-
- `mqttSignaling()` throws `RangeError` for empty `urls` or invalid `handshakeTimeoutMs`,
|
|
88
|
+
- `wsSignaling()` throws `TypeError` for non-`ws:`/`wss:` URLs, non-boolean `encrypt`/`privateTopic`, `privateTopic: true` without `password`, or a non-function `WebSocket` option; `Error` if `privateTopic: true` is combined with `encrypt: false` or if `WebSocket` is unavailable at session startup; and `RangeError` for invalid `handshakeTimeoutMs` or `pingIntervalMs`.
|
|
89
|
+
- `combineSignaling()` throws `RangeError` when given 0 adapters and `TypeError` if any argument is not a function; `withLocalTabs()` throws `TypeError` if `primary` is not a function.
|
|
90
|
+
- `mqttSignaling()` throws `RangeError` for empty `urls` or invalid `handshakeTimeoutMs`, `TypeError` for an empty `password`, non-boolean `privateTopic`, `privateTopic: true` without `password`, or a non-function `WebSocket` option, and `Error` if `WebSocket` is unavailable at session startup.
|
|
91
|
+
- `nostrSignaling()` throws `RangeError` for empty `urls` or invalid `handshakeTimeoutMs`, `TypeError` for non-`ws:`/`wss:` `urls`, invalid `appId`, empty `password`, non-boolean `privateTopic`, `privateTopic: true` without `password`, or a non-function `WebSocket` option, and `Error` if `WebSocket` is unavailable at session startup.
|
|
92
|
+
- `createVoice()` throws `TypeError` for invalid `room`, `audioConstraints`, `to`, `streamTag`, or `strictStreamTag`, and `RangeError` for out-of-range `volume`, `speakingThreshold`, or `speakingIntervalMs`. `voice.setVolume()` and `voice.setPeerVolume()` throw `RangeError` for non-finite numbers; `voice.setPeerVolume()` and `voice.setPeerMuted()` throw `TypeError` for invalid `peerId` strings (`1..128` chars); `voice.switchDevice()` rejects with `TypeError` for whitespace-only/non-string `deviceId` values.
|
|
93
|
+
- `fetchTurnCredentials()` rejects with `TypeError` for invalid URLs, disallowed protocols, embedded URL credentials, or invalid `accessKey`, and `RangeError` for invalid `timeoutMs`.
|
|
79
94
|
|
|
80
95
|
## Sending and receiving
|
|
81
96
|
|
|
@@ -125,7 +140,7 @@ Note: on public MQTT topics, `roomTopic` hashes `(appId, room)` without `passwor
|
|
|
125
140
|
|
|
126
141
|
### ICE gathering, opt-in Trickle ICE, and loopback fallback
|
|
127
142
|
|
|
128
|
-
- Adapters can opt in to **Trickle ICE** by setting `trickle: true` on their returned `SignalingSession` (enabled by default in `tabSignaling()`, `wsSignaling()`,
|
|
143
|
+
- Adapters can opt in to **Trickle ICE** by setting `trickle: true` on their returned `SignalingSession` (enabled by default in `tabSignaling()`, `wsSignaling()`, `mqttSignaling()`, `nostrSignaling()`, `withLocalTabs(primary)` when `primary` sets `trickle: true`, and in `combineSignaling()` when every child session sets `trickle: true`).
|
|
129
144
|
- When `trickle` is `true`, Meshpost publishes `offer` and `answer` immediately after `setLocalDescription()` without waiting for `iceGatheringTimeoutMs`, batches outgoing ICE candidates over a `50 ms` window (up to `16` per batch, capped at `64` per link), and buffers incoming candidates that arrive before `setRemoteDescription()` resolves (including early candidates arriving before the `offer` on the answerer).
|
|
130
145
|
- When `trickle` is omitted or `false` (such as `manualSignaling()` or simple custom adapters), each side waits to publish one complete SDP (no trickle ICE required). Publication occurs when `iceGatheringState` reaches `'complete'` or when `iceGatheringTimeoutMs` elapses, whichever comes first.
|
|
131
146
|
- In non-trickle mode, when you configure TURN servers (or `iceTransportPolicy: 'relay'`) and omit `iceGatheringTimeoutMs`, Meshpost waits up to `min(10,000 ms, handshakeTimeoutMs / 2)` for the first `relay` or public (`srflx`) candidate.
|
|
@@ -145,20 +160,39 @@ Each `RTCPeerConnection` creates two pre-negotiated channels with `protocol` set
|
|
|
145
160
|
### Framing and early packets
|
|
146
161
|
|
|
147
162
|
- Application messages on both channels are raw binary `ArrayBuffer` frames. `room.send()` adds no library header.
|
|
163
|
+
- Immediately once stream `0` and stream `1` both open (and before `onPeerJoin` fires), each endpoint sends exactly one `'meshpost/1/hello:'` JSON frame (`<= 4,096` bytes, `{ v: 1, rc?, st?, reclaim?, id? }`) on stream `1`. _(Wire-protocol upgrade note: v0.4 requires both endpoints to complete the `'meshpost/1/hello:'` exchange before promoting a link to `ready`, so v0.4 and v0.3 peers do not interoperate — upgrade room participants together.)_ Optional `st` maps 0-RTT initial `stream.id -> tag` (`[a-zA-Z0-9._-]{1,32}`) before `earlyStreams` flush. When `options.identity` is set, `id` carries `{ pub, sig }` where `sig` is an IEEE P1363 `ECDSA P-256` (`SHA-256`) signature over the length-prefixed transcript `"meshpost/1/id-sig\0" || appId || room || signerId || verifierId || signerDtlsFp || verifierDtlsFp`. Both SDP descriptions must contain exactly one unique `sha-256`/`sha-384`/`sha-512` `a=fingerprint:` value (blocking RFC 8122 §5 multi-fingerprint signaling MitM). A second `'meshpost/1/hello:'` frame on an open link immediately closes the link.
|
|
148
164
|
- A text message `'meshpost/1/leave'` on stream `1` signals graceful departure.
|
|
149
|
-
- Text messages prefixed with `'meshpost/1/rtc:'` (max `64 KiB`, max `16` pending incoming frames per link) on stream `1` carry in-band JSON control frames for media renegotiation (`{ kind: 'offer' | 'answer', sdp }` and `{ kind: 'stream-end', id }`). Other text messages are ignored.
|
|
150
|
-
- Mid-session `addStream()` / `removeStream()` renegotiation runs entirely in-band over stream `1` using Perfect Negotiation (deterministic polite role `self > peerId`, serialized per link alongside `stream-end`), reusing the existing BUNDLE ICE/DTLS transport without exchanging new Trickle ICE candidates. Voice/media works even when the signaling server is offline or with `manualSignaling()`.
|
|
151
|
-
- Active local streams on the initial offerer (`self < peerId`) are attached before initial `createOffer()` for 0-RTT media setup; remote streams received before `link.ready` are buffered and fire via `onPeerStream` strictly after `onPeerJoin` (once per `stream.id`, capped at `32` remote streams per peer). On disconnect, `onPeerStreamEnd` fires for active remote streams before `onPeerLeave`.
|
|
152
|
-
- `addStream()` ignores streams with 0 tracks and does not observe tracks added to a `MediaStream`
|
|
165
|
+
- Text messages prefixed with `'meshpost/1/rtc:'` (max `64 KiB`, max `16` pending incoming frames per link) on stream `1` carry in-band JSON control frames for media renegotiation (`{ kind: 'offer' | 'answer', sdp, tags? }` and `{ kind: 'stream-end', id }`). Optional `tags` maps attached `stream.id -> tag` on both offers and answers (preserving tags across Perfect Negotiation glare rollbacks, stored in a `64`-entry `Map` that pins active remote stream IDs). Other text messages are ignored.
|
|
166
|
+
- Mid-session `addStream()` / `removeStream()` renegotiation runs entirely in-band over stream `1` using Perfect Negotiation (deterministic polite role `self > peerId`, serialized per link alongside `stream-end`), reusing the existing BUNDLE ICE/DTLS transport without exchanging new Trickle ICE candidates. `replaceStreamTrack(stream, oldTrack, newTrack)` swaps active `RTCRtpSender` tracks directly via `replaceTrack()` with zero SDP renegotiation (and updates `stream` in place for future joiners without stopping `oldTrack`). Voice/media works even when the signaling server is offline or with `manualSignaling()`.
|
|
167
|
+
- Active local streams on the initial offerer (`self < peerId`) are attached before initial `createOffer()` for 0-RTT media setup; remote streams received before `link.ready` are buffered and fire via `onPeerStream(peerId, stream, meta)` strictly after `onPeerJoin` (once per `stream.id`, capped at `32` remote streams per peer). On disconnect, `onPeerStreamEnd(peerId, stream, meta)` fires for active remote streams before `onPeerLeave`.
|
|
168
|
+
- `addStream()` ignores streams with 0 tracks and does not observe tracks added manually to a `MediaStream` without `replaceStreamTrack()`; `removeStream()` and `replaceStreamTrack()` never call `track.stop()`.
|
|
153
169
|
- Incoming binary packets larger than `16,384` bytes are ignored on stream `0` and close the link on stream `1`.
|
|
154
170
|
- Packets arriving before both channels open are buffered up to `64` packets and `256 KiB` per peer.
|
|
155
171
|
- Exceeding the early buffer drops excess unreliable packets or closes the incomplete link on a reliable packet.
|
|
156
172
|
- Buffered packets fire strictly after `onPeerJoin`.
|
|
157
173
|
|
|
158
|
-
### Logical channels (`createChannel`)
|
|
174
|
+
### Logical channels (`createChannel` & `createCodecChannel`)
|
|
159
175
|
|
|
160
176
|
- `createChannel(room, name, { delivery })` frames packets as `[nameLen (1 byte), ...utf8(name), ...payload]`.
|
|
161
|
-
- `nameLen` is `1–64` bytes.
|
|
177
|
+
- `nameLen` is `1–64` bytes. A lazy per-`Room` `WeakMap` router attaches a single shared `room.onPacket` listener while at least one channel subscriber is active, decodes `name` once with strict UTF-8 (`fatal: true`), dispatches in `O(1)` time to matching subscribers (isolating each callback with `try/catch` + `reportError`), and passes a zero-copy `subarray` view of the original `Uint8Array`.
|
|
178
|
+
- `createCodecChannel(room, name, codec, options?)` wraps `createChannel` with synchronous `codec.encode(value)` on `send()` (preserving synchronous `ReadonlyMap<string, SendResult>`) and guarded `codec.decode(bytes)` on `onMessage` (dropping malformed frames without consuming `{ once: true }`).
|
|
179
|
+
|
|
180
|
+
### Request-response RPC (`createRpc`)
|
|
181
|
+
|
|
182
|
+
- `createRpc(room, name, options?)` layers reliable request-response over `createChannel(room, name, { delivery: 'reliable' })` with a 5-byte header `[opcode (u8), reqId (u32 BE)]`:
|
|
183
|
+
- `0x01` `REQ`: `[0x01, reqId, ...requestCodec.encode(req)]`
|
|
184
|
+
- `0x02` `RES_OK`: `[0x02, reqId, ...responseCodec.encode(res)]`
|
|
185
|
+
- `0x03` `RES_ERR`: `[0x03, reqId, errKind (u8), ...utf8(message <= 256 B)]` (`1 = 'unhandled'`, `2 = 'remote-error'`, `3 = 'too-large'`, `4 = 'busy'`).
|
|
186
|
+
- Pending calls bind `reqId` to the target `peerId` (ignoring spoofed responses from third peers) and reject immediately on `onPeerLeave` (`'disconnected'`), `AbortSignal` (`'aborted'`), `timeoutMs` (`'timeout'`), `close()` / `room.leave()` (`'closed'`), send failure (`'unavailable' | 'busy' | 'too-large'`), or invalid `RES_OK` decode (`'remote-error'`).
|
|
187
|
+
- Incoming `REQ` enforces `!handler` (`'unhandled'`) and `maxConcurrentPerPeer` (`16` default, `'busy'`) before decoding, replies `'remote-error'` on malformed `REQ` without consuming `{ once: true }`, sanitizes/truncates error messages to `256` UTF-8 bytes without stack traces, and suppresses stale replies if the requester disconnected while an async handler was running.
|
|
188
|
+
|
|
189
|
+
### Per-peer state sync (`createPeerState`)
|
|
190
|
+
|
|
191
|
+
- `createPeerState(room, name, options?)` frames state updates with a 5-byte header `[opcode (u8), seq (u32 BE)]`:
|
|
192
|
+
- `0x01` `SET`: `[0x01, seq, ...codec.encode(value)]`
|
|
193
|
+
- `0x02` `CLEAR`: `[0x02, seq]` (exact 5 bytes).
|
|
194
|
+
- Live `set(value)` uses `options.delivery` (`'reliable'` default or `'unreliable'`), while `options.initial`, `onPeerJoin` hydration, and `clear()` always transmit on the `'reliable'` channel for `name`. Both channels feed a single per-peer RFC 1982 `u32` sequence table (`lastSeqByPeer`), updated only after `codec.decode` succeeds (`!== undefined`), so out-of-order unreliable packets or racing hydration frames never regress state or resurrect cleared state.
|
|
195
|
+
- When `coalesce` is `true` (default), `createPeerState` retains only the single latest encoded frame (`O(1)` memory) and flushes `'busy'` peers on `room.onDrain` (keeping `dirtyReliable` independent of unreliable `'accepted'` returns so UDP loss cannot drop pending reliable hydrations). Disconnecting peers (`onPeerLeave`) are automatically removed and emit `onChange(peerId, undefined, prev)`.
|
|
162
196
|
|
|
163
197
|
### Chunked transfers (`createBlobChannel`)
|
|
164
198
|
|
|
@@ -174,7 +208,7 @@ Each `RTCPeerConnection` creates two pre-negotiated channels with `protocol` set
|
|
|
174
208
|
|
|
175
209
|
### Custom `Signaling` contract
|
|
176
210
|
|
|
177
|
-
- A `Signaling` factory receives `Discovery` (`appId`, `room`, `self`, optional `password`, `roster`, `receive`, `status`, optional `error`) and returns `{ send(to, signal), close() }
|
|
211
|
+
- A `Signaling` factory receives `Discovery` (`appId`, `room`, `self`, optional `password`, `roster`, `receive`, `status`, optional `error`) and returns a `SignalingSession` (`{ trickle?, canReach?(peerId), send(to, signal), close() }`).
|
|
178
212
|
- `send(to, signal)` must return `boolean` (`true` when accepted for delivery; returning `false` drops the pending link).
|
|
179
213
|
- Report `status('online')` before publishing a roster.
|
|
180
214
|
- Deliver a roster containing a sender before calling `receive(from, signal)`.
|
|
@@ -197,16 +231,24 @@ Each `RTCPeerConnection` creates two pre-negotiated channels with `protocol` set
|
|
|
197
231
|
|
|
198
232
|
- Zero-dependency MQTT 3.1.1 client over WebSocket connecting to `urls` (default `defaultMqttRelays`) in parallel.
|
|
199
233
|
- Waits for `CONNACK` and `SUBACK` within `handshakeTimeoutMs` (`10 s`), monitors `PINGRESP` every 20 s, and caps incoming buffers at `128 KiB`.
|
|
200
|
-
- Splits traffic across two topics: `${roomTopic}` for presence (`hello`, `heartbeat`, `bye`) and `${roomTopic}/${peerId}` for targeted `present` and `signal` messages.
|
|
201
|
-
- Deduplicates messages across brokers using `${from}:${mid}` with a `120 s` TTL (and reuses one startup `mid` for initial `hello`).
|
|
234
|
+
- Splits traffic across two topics: `${roomTopic}` for presence (`hello`, `heartbeat`, `bye`) and `${roomTopic}/${peerId}` for targeted `present` and `signal` messages (`roomTopic` is `'meshpost/1/' + namespaceHash(appId:room)` by default, or `'meshpost/1/p/' + privateId` after key derivation when `privateTopic: true`).
|
|
235
|
+
- Deduplicates messages across brokers using `${from}:${mid}` with a `120 s` TTL (and reuses one startup `mid` for initial `hello`). Valid AEAD frames outside `±60 s` emit rate-limited `'clock-skew'` without polluting `seenMids` or the peer roster.
|
|
202
236
|
- Transitions to `'offline'` if all brokers fail on startup or disconnect later, then reconnects with jittered backoff.
|
|
203
237
|
|
|
238
|
+
### `nostrSignaling(options?)`
|
|
239
|
+
|
|
240
|
+
- Zero-dependency NIP-01 client over port-443 WebSocket relays connecting to `urls` (default `defaultNostrRelays`) in parallel, signing ephemeral `kind: 25050` events (never persisted by relays) with pure-TS BIP-340 Schnorr (`secp256k1`) and lazy SHA-256 (`sideEffects: false` tree-shakeable).
|
|
241
|
+
- Subscribes via `["REQ", subId, { kinds: [25050], "#t": [roomTag, inboxTag], since }]` (`roomTag` is `'mp1_' + namespaceHash(appId:room)` by default, or `'mp1_p_' + privateId` after key derivation when `privateTopic: true`), completes handshake on `["EOSE", subId]` within `handshakeTimeoutMs` (`10 s`), refreshes idle subscriptions every `25 s`, and sends `bye` + `["CLOSE", subId]` on `close()`.
|
|
242
|
+
- Filters self-echoes (`pubkey`) and `created_at` (`±120 s`), verifies `ev.id` SHA-256 commitments, runs hardware `AES-256-GCM` decryption (`'meshpost/1/nostr:' + targetTag` AAD, capped at `64` pending decrypts) _before_ `BigInt` `verifySchnorr` when `password` is set (or caps `verifySchnorr` at `64`/s in plaintext mode), and records `seenEventIds` (`2,048` cap) strictly after verification.
|
|
243
|
+
|
|
204
244
|
### `wsSignaling(url, options?)`
|
|
205
245
|
|
|
206
|
-
- Zero-dependency JSON-over-WebSocket signaling adapter (`ws://` or `wss://`).
|
|
207
|
-
-
|
|
208
|
-
-
|
|
209
|
-
-
|
|
246
|
+
- Zero-dependency JSON-over-WebSocket signaling adapter (`ws://` or `wss://`), automatically appending `?room=<roomKey>` (unless `room` is already in the query string) so edge runtimes such as [examples/ws-worker/](../examples/ws-worker/README.md) can shard one Durable Object per room.
|
|
247
|
+
- When `password` is set and `encrypt` is `true` (default), encrypts signaling envelopes (`{ mid, ts, signal }`) end-to-end with `AES-256-GCM` as base64url `{ type: 'signal', to, box }`, bound via AAD `'meshpost/1/ws:' + roomKey + ':' + from + ':' + to` (`roomKey` is `namespaceHash(appId:room)` by default, or `'p_' + privateId` when `privateTopic: true`). Plaintext `{ signal }` frames arriving in encrypted mode are rejected (anti-downgrade) and trigger rate-limited `'decrypt-failed'`; valid AEAD frames outside `±60 s` trigger rate-limited `'clock-skew'`.
|
|
248
|
+
- Serializes incoming `roster` and encrypted `signal` frames in wire order with bounded queues (`128` outgoing encrypt / `64` incoming signal decrypt) and only registers peers in `knownPeers` after AEAD + replay + `isSignal` verification pass.
|
|
249
|
+
- When `password` is omitted or `encrypt: false` (for plain HTTP LAN testing without `crypto.subtle`), isolates rooms via `roomKey = namespaceHash(appId:room[:password])` and sends `{ type: 'signal', to, signal }`.
|
|
250
|
+
- Client sends `{ type: 'join', room, id }` on open (within `handshakeTimeoutMs`, `10,000` ms default), `{ type: 'signal', to, signal | box }` for peer signaling, `{ type: 'ping' }` every `pingIntervalMs` (`25,000` ms default), and `{ type: 'leave' }` on close.
|
|
251
|
+
- Server sends `{ type: 'roster', peers: string[] }` (validated UUIDs, capped at `256`), `{ type: 'signal', from, signal | box }`, and `{ type: 'pong' }`. Incoming frames larger than `128 KiB` are ignored.
|
|
210
252
|
- Tracks `awaitingPong`: if no `{ type: 'pong' }` (or other valid server message) arrives before the next ping interval, the socket is closed to trigger reconnect.
|
|
211
253
|
- Reconnects with jittered exponential backoff (`500 ms` to `10 s`, `±25%` jitter) when `reconnect` is `true` (default), emitting `'offline'` and `'signaling-error'` once per offline transition.
|
|
212
254
|
|
|
@@ -215,9 +257,20 @@ Each `RTCPeerConnection` creates two pre-negotiated channels with `protocol` set
|
|
|
215
257
|
- Composes one or more `Signaling` adapters into a single adapter (returning the single adapter directly when given one).
|
|
216
258
|
- Pre-initializes all child states as `'connecting'` and buffers synchronous startup callbacks until every child factory returns without throwing (closing already-started children if any factory throws).
|
|
217
259
|
- Aggregate `SignalingState` is `'online'` if any child is `'online'`, `'connecting'` if none is `'online'` and any is `'connecting'`, `'offline'` if none is `'online'`/`'connecting'` and any is `'offline'`, and `'closed'` when all children are `'closed'`.
|
|
218
|
-
- Maintains per-child peer sets, publishes their union to `Discovery.roster`, clears
|
|
260
|
+
- Maintains per-child peer sets, publishes their union to `Discovery.roster`, clears unreachable entries when a child goes `'offline'`/`'closed'` (preserving already-open WebRTC links and any peers still reachable via nested `canReach`), routes `send(to, signal)` to every reachable child advertising `to`, and forwards child `error` reports.
|
|
219
261
|
- Advertises `trickle: true` only when every child session advertises `trickle === true`, and deduplicates incoming `{ kind: 'ice' }` candidates per `(from, attempt)` across child adapters.
|
|
220
262
|
|
|
263
|
+
### `withLocalTabs(primary)`
|
|
264
|
+
|
|
265
|
+
- Composes `tabSignaling()` with `primary`, publishing the union roster and deduplicating Trickle ICE across both transports while forwarding **only `primary`'s `SignalingState` and `error` events** to the room.
|
|
266
|
+
- Exposes `SignalingSession.canReach(peerId)` so same-browser tabs still negotiate and connect even while `primary` (and `room.signalingState`) is `'connecting'` or `'offline'` (including when nested inside `combineSignaling()`).
|
|
267
|
+
- Delegates directly to `primary` without error when `BroadcastChannel` is undefined, on `file:` or opaque (`origin === 'null'`) origins, or if `new BroadcastChannel(...)` throws `SecurityError`.
|
|
268
|
+
|
|
269
|
+
### `createVoice(room, options?)` and `fetchTurnCredentials(url, options?)`
|
|
270
|
+
|
|
271
|
+
- `createVoice(room, options?)` tags outgoing mic streams with `streamTag` (`'voice'` default) and attaches hidden `<audio autoplay>` elements for up to `4` matching remote audio streams per peer (`meta.tag === streamTag`, plus untagged streams when `strictStreamTag` is `false`; hydrating any streams already active on `room` at construction), supports per-peer volume (`setPeerVolume`, scaled by master `volume`, `128`-peer cap) and per-peer mute (`setPeerMuted`, independent of `deafened`, `128`-peer cap), hot-swaps microphone input devices via serialized `switchDevice(deviceId?)` + `room.replaceStreamTrack()` with zero SDP renegotiation, coalesces concurrent `startMic()`/`toggleMic()` calls, cancels pending `getUserMedia` via `micEpoch`/`switchEpoch` on `stopMic()`/`close()`, saves/restores `navigator.audioSession.type` (`'play-and-record'`) across all exit paths, routes `AnalyserNode` through a zero-gain `GainNode` to `destination` for WebKit pull-graph compatibility, unlocks blocked audio via lock-free `{ capture: true }` gestures + `visibilitychange`, and closes automatically on `room.leave()` without redundant `removeStream()` renegotiation.
|
|
272
|
+
- `fetchTurnCredentials(url, options?)` validates `https://` (or `http://localhost` / `127.0.0.1` / `[::1]`) without embedded credentials, sends `POST` with `redirect: 'error'`, `credentials: 'omit'`, `cache: 'no-store'`, enforces `timeoutMs` (`5,000` ms default) and a `64 KiB` streaming body limit, and returns `1..16` sanitized `RTCIceServer` entries (`^(stuns?|turns?):[^\s]+$`).
|
|
273
|
+
|
|
221
274
|
### `manualSignaling(outgoing)`
|
|
222
275
|
|
|
223
276
|
- Produces JSON envelopes with `{ v: 1, app, room, from, auth?, to?, signal? }`.
|
|
@@ -229,9 +282,9 @@ Each `RTCPeerConnection` creates two pre-negotiated channels with `protocol` set
|
|
|
229
282
|
|
|
230
283
|
- **In-transit data:** WebRTC DTLS encrypts all data channel traffic end-to-end between connected peers.
|
|
231
284
|
- **Signaling integrity:** SDP contains the DTLS certificate fingerprint. An attacker who can modify signaling messages can intercept and alter the handshake (MitM).
|
|
232
|
-
- **Public MQTT without `password`:** Anyone on a public
|
|
233
|
-
- **
|
|
234
|
-
- **
|
|
285
|
+
- **Public MQTT / Nostr without `password`:** Anyone on a public relay can observe room topics/tags or tamper with unencrypted SDP. Use `password` or a trusted signaling server whenever confidentiality or authenticity matters.
|
|
286
|
+
- **Password-encrypted signaling (`mqttSignaling`, `nostrSignaling`, & `wsSignaling`):** When `password` is set, `mqttSignaling()`, `nostrSignaling()`, and `wsSignaling()` (unless `encrypt: false` is explicitly set for plain HTTP LAN testing) derive a 256-bit master secret via a single `PBKDF2-HMAC-SHA256` pass (`100,000` iterations, salt `'meshpost/1/' + namespaceHash(appId:room)`) and expand it via RFC 5869 `HKDF-SHA256` into an `AES-256-GCM` key (`info: 'meshpost/1/aead'`) and a 128-bit `privateId` (`info: 'meshpost/1/topic'`). _(Note: adding HKDF domain separation updates the password wire derivation from v0.2/v0.3 `mqttSignaling`.)_ Every message is authenticated with transport/room/recipient AAD, rejects timestamps outside `±60 s` (emitting `'clock-skew'`), and tracks seen `mid`s for `120 s`. Setting `privateTopic: true` derives the MQTT topic, Nostr `#t` tag, or WS room key from `privateId` so outsiders on shared relays cannot correlate activity to `(appId, room)`. Browser Web Crypto (`crypto.subtle`) requires `https://` or `http://localhost`.
|
|
287
|
+
- **Verifiable peer identity & `F5` session reclaim (`createIdentity` & `'meshpost/1/hello:'`):** Optional `PeerIdentity` proves ownership of a 128-bit `userId` (`SHA-256("meshpost/1/userid:" || rawUncompressedP256PubKey)[0..16]`) via a WebCrypto `ECDSA P-256` (`SHA-256`) signature bound to `(appId, room, signerId, verifierId, signerDtlsFp, verifierDtlsFp)` — rejecting weak hashes and multi-fingerprint SDP injections (RFC 8122 §5) so even an active MitM on unencrypted signaling cannot relay or replay `id.sig`. Same-tab `F5` ghost-session eviction requires presenting the 128-bit preimage matching the prior link's `SHA-256` commitment (`reclaimCommit`, saved to `sessionStorage` only on `pagehide`), preventing third-party peers from spoof-dropping live connections.
|
|
235
288
|
- **Chunked transfers (`createBlobChannel`):** Default worst-case receive memory is `maxConcurrentPerPeer × maxReceiveBytes` (`16 MiB/peer`, up to `512 MiB` across `32` peers), and `receiveTimeoutMs` resets on each `DATA` chunk. Apps facing untrusted peers should tune these bounds accordingly.
|
|
236
289
|
- **Manual signaling:** Exchange connection text only over a trusted channel with the intended peer.
|
|
237
|
-
- **Application concerns:**
|
|
290
|
+
- **Application concerns:** Authorization, shared state semantics, and game rules belong in the application layer.
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dimchansky/meshpost",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"author": "Dmitrij Koniajev",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
|
8
|
-
"description": "Zero-dependency TypeScript library for hostless
|
|
8
|
+
"description": "Zero-dependency TypeScript library for hostless WebRTC mesh rooms (browsers & headless runtimes).",
|
|
9
9
|
"keywords": [
|
|
10
10
|
"webrtc",
|
|
11
11
|
"p2p",
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
"datachannel",
|
|
15
15
|
"serverless",
|
|
16
16
|
"mqtt",
|
|
17
|
+
"nostr",
|
|
18
|
+
"websocket",
|
|
19
|
+
"rpc",
|
|
20
|
+
"voice",
|
|
21
|
+
"webcrypto",
|
|
17
22
|
"typescript",
|
|
18
23
|
"esm"
|
|
19
24
|
],
|
|
@@ -37,6 +42,66 @@
|
|
|
37
42
|
".": {
|
|
38
43
|
"types": "./dist/index.d.ts",
|
|
39
44
|
"import": "./dist/index.js"
|
|
45
|
+
},
|
|
46
|
+
"./room": {
|
|
47
|
+
"types": "./dist/room.d.ts",
|
|
48
|
+
"import": "./dist/room.js"
|
|
49
|
+
},
|
|
50
|
+
"./channel": {
|
|
51
|
+
"types": "./dist/channel.d.ts",
|
|
52
|
+
"import": "./dist/channel.js"
|
|
53
|
+
},
|
|
54
|
+
"./rpc": {
|
|
55
|
+
"types": "./dist/rpc.d.ts",
|
|
56
|
+
"import": "./dist/rpc.js"
|
|
57
|
+
},
|
|
58
|
+
"./state": {
|
|
59
|
+
"types": "./dist/state.d.ts",
|
|
60
|
+
"import": "./dist/state.js"
|
|
61
|
+
},
|
|
62
|
+
"./blob": {
|
|
63
|
+
"types": "./dist/blob.d.ts",
|
|
64
|
+
"import": "./dist/blob.js"
|
|
65
|
+
},
|
|
66
|
+
"./voice": {
|
|
67
|
+
"types": "./dist/voice.d.ts",
|
|
68
|
+
"import": "./dist/voice.js"
|
|
69
|
+
},
|
|
70
|
+
"./turn": {
|
|
71
|
+
"types": "./dist/turn.d.ts",
|
|
72
|
+
"import": "./dist/turn.js"
|
|
73
|
+
},
|
|
74
|
+
"./identity": {
|
|
75
|
+
"types": "./dist/identity.d.ts",
|
|
76
|
+
"import": "./dist/identity.js"
|
|
77
|
+
},
|
|
78
|
+
"./mqtt": {
|
|
79
|
+
"types": "./dist/mqtt.d.ts",
|
|
80
|
+
"import": "./dist/mqtt.js"
|
|
81
|
+
},
|
|
82
|
+
"./nostr": {
|
|
83
|
+
"types": "./dist/nostr.d.ts",
|
|
84
|
+
"import": "./dist/nostr.js"
|
|
85
|
+
},
|
|
86
|
+
"./ws": {
|
|
87
|
+
"types": "./dist/ws.d.ts",
|
|
88
|
+
"import": "./dist/ws.js"
|
|
89
|
+
},
|
|
90
|
+
"./tabs": {
|
|
91
|
+
"types": "./dist/tabs.d.ts",
|
|
92
|
+
"import": "./dist/tabs.js"
|
|
93
|
+
},
|
|
94
|
+
"./manual": {
|
|
95
|
+
"types": "./dist/manual.d.ts",
|
|
96
|
+
"import": "./dist/manual.js"
|
|
97
|
+
},
|
|
98
|
+
"./combine": {
|
|
99
|
+
"types": "./dist/combine.d.ts",
|
|
100
|
+
"import": "./dist/combine.js"
|
|
101
|
+
},
|
|
102
|
+
"./signaling": {
|
|
103
|
+
"types": "./dist/signaling.d.ts",
|
|
104
|
+
"import": "./dist/signaling.js"
|
|
40
105
|
}
|
|
41
106
|
},
|
|
42
107
|
"files": [
|