@statewalker/webrun-streams-signaling 0.1.1 → 0.1.4
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 +35 -2
- package/dist/qr-signaling.d.ts.map +1 -1
- package/package.json +13 -7
- package/src/qr-signaling.ts +6 -1
package/README.md
CHANGED
|
@@ -99,7 +99,26 @@ await room.leave();
|
|
|
99
99
|
- **`parseCompressedSignal(signal): { sessionId, role, description, candidates }`** — reverse of the above.
|
|
100
100
|
- **`encodeSignal(signal): string`** / **`decodeSignal(encoded): CompressedSignal`** — URL-safe base64 (de)serialisation for QR strings.
|
|
101
101
|
|
|
102
|
-
Types
|
|
102
|
+
### Types and constants
|
|
103
|
+
|
|
104
|
+
All re-exported from `./types` at the package root.
|
|
105
|
+
|
|
106
|
+
| Export | Kind | Purpose |
|
|
107
|
+
| --- | --- | --- |
|
|
108
|
+
| `SignalingTransport` | interface | The pluggable channel offers/answers travel over. |
|
|
109
|
+
| `SignalingMessage` | union | Offer / answer / ICE-candidate envelopes. |
|
|
110
|
+
| `SessionDescription` / `IceCandidate` | interface | Structural views of the WebRTC handshake payloads (no DOM types required). |
|
|
111
|
+
| `PeerRole` | `"initiator" \| "responder"` | Which side of the handshake this peer plays. |
|
|
112
|
+
| `ConnectionState` | union | Lifecycle state reported by `PeerConnection`. |
|
|
113
|
+
| `PeerConnectionEvents` | interface | The event callbacks `PeerConnection` accepts. |
|
|
114
|
+
| `WebRtcConnectionOptions` | interface | ICE configuration and the injected `rtc` factory. |
|
|
115
|
+
| `RtcPeerConnectionFactory` | type | `(config: RTCConfiguration) => RTCPeerConnection` — the injection seam that keeps native WebRTC out of the import graph. |
|
|
116
|
+
| `DEFAULT_ICE_SERVERS` | const | STUN servers used when none are supplied. |
|
|
117
|
+
| `CompressedSignal` | interface | The compact offer/answer shape behind the QR helpers. |
|
|
118
|
+
| `RoomLike` / `RoomParticipantLike` / `RoomLocalParticipantLike` | interface | Structural view of a LiveKit room, so `livekit-client` stays an optional peer dependency. |
|
|
119
|
+
| `RoomManagerOptions` | interface | Includes `roomFactory`, the injection point for the real `Room`. |
|
|
120
|
+
| `ParticipantInfo` | interface | Identity + metadata for a room participant. |
|
|
121
|
+
| `ROOM_EVENT` | const | Room event-name constants used by `RoomManager`. |
|
|
103
122
|
|
|
104
123
|
## Notes
|
|
105
124
|
|
|
@@ -108,6 +127,20 @@ Types (`ByteChannel`-adjacent handshake shapes) are re-exported from `./types`
|
|
|
108
127
|
- **`peerjs` is not a dependency.** These helpers use native WebRTC; the peerjs byte transport lives in `@statewalker/webrun-streams-peerjs`.
|
|
109
128
|
- Built red/green TDD.
|
|
110
129
|
|
|
130
|
+
## Dependencies
|
|
131
|
+
|
|
132
|
+
| Dependency | Kind | Why |
|
|
133
|
+
| --- | --- | --- |
|
|
134
|
+
| [`@statewalker/webrun-streams`](../webrun-streams) | runtime | `ByteChannel`, and `emulateMux` for the transport built on top. |
|
|
135
|
+
| `livekit-client` | **peer, optional** (`^2.18.3`) | Only for `RoomManager`. Injected via `RoomManagerOptions.roomFactory`; the module itself keeps a structural `RoomLike` view, so the dependency is avoidable. |
|
|
136
|
+
|
|
137
|
+
Native WebRTC is likewise injected (the optional `rtc` factory, defaulting to
|
|
138
|
+
`new RTCPeerConnection`), which is why the test suite needs no vendor install.
|
|
139
|
+
`peerjs` is deliberately **not** a dependency — that transport lives in
|
|
140
|
+
[`@statewalker/webrun-streams-peerjs`](../webrun-streams-peerjs).
|
|
141
|
+
|
|
142
|
+
ESM only (`"type": "module"`).
|
|
143
|
+
|
|
111
144
|
## License
|
|
112
145
|
|
|
113
|
-
MIT
|
|
146
|
+
MIT © statewalker — see [LICENSE](../../LICENSE).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qr-signaling.d.ts","sourceRoot":"","sources":["../src/qr-signaling.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM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ErD,YAAY,OAAO,GAAE,kBAAuB,EAG3C;IAED,YAAY,IAAI,MAAM,CAErB;IAED,qEAAqE;IAC/D,KAAK,IAAI,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;KAAE,CAAC,CAuBrF;IAED,8EAA8E;IACxE,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,WAAW,CAAA;KAAE,CAAC,CAuB3E;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@statewalker/webrun-streams-signaling",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Generic P2P signaling/connection-setup (PeerManager, QrSignaling, RoomManager) yielding webrun-streams ByteChannels",
|
|
@@ -16,14 +16,18 @@
|
|
|
16
16
|
"directory": "packages/webrun-streams-signaling"
|
|
17
17
|
},
|
|
18
18
|
"exports": {
|
|
19
|
-
".":
|
|
19
|
+
".": {
|
|
20
|
+
"source": "./src/index.ts",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"import": "./dist/index.js"
|
|
23
|
+
}
|
|
20
24
|
},
|
|
21
25
|
"files": [
|
|
22
26
|
"dist",
|
|
23
27
|
"src"
|
|
24
28
|
],
|
|
25
29
|
"dependencies": {
|
|
26
|
-
"@statewalker/webrun-streams": "0.
|
|
30
|
+
"@statewalker/webrun-streams": "^0.2.1"
|
|
27
31
|
},
|
|
28
32
|
"peerDependencies": {
|
|
29
33
|
"livekit-client": "^2.18.3"
|
|
@@ -34,17 +38,19 @@
|
|
|
34
38
|
}
|
|
35
39
|
},
|
|
36
40
|
"devDependencies": {
|
|
37
|
-
"@
|
|
38
|
-
"
|
|
41
|
+
"@biomejs/biome": "^2.5.15",
|
|
42
|
+
"@types/node": "^26.6.4",
|
|
43
|
+
"livekit-client": "^2.22.3",
|
|
39
44
|
"rimraf": "^6.1.3",
|
|
40
|
-
"rolldown": "^1.2.
|
|
45
|
+
"rolldown": "^1.2.12",
|
|
41
46
|
"typescript": "^7.0.2",
|
|
42
|
-
"vitest": "^
|
|
47
|
+
"vitest": "^5.0.3"
|
|
43
48
|
},
|
|
44
49
|
"sideEffects": false,
|
|
45
50
|
"publishConfig": {
|
|
46
51
|
"access": "public"
|
|
47
52
|
},
|
|
53
|
+
"types": "./dist/index.d.ts",
|
|
48
54
|
"scripts": {
|
|
49
55
|
"build": "rimraf dist && rolldown -c && tsc --emitDeclarationOnly --declaration",
|
|
50
56
|
"test": "vitest run",
|
package/src/qr-signaling.ts
CHANGED
|
@@ -219,7 +219,12 @@ export class QrSignaling {
|
|
|
219
219
|
const description = pc.getLocalDescription();
|
|
220
220
|
if (!description) throw new Error("No local description after answer");
|
|
221
221
|
const qr = encodeSignal(
|
|
222
|
-
createCompressedSignal(
|
|
222
|
+
createCompressedSignal(
|
|
223
|
+
parsed.sessionId,
|
|
224
|
+
"responder",
|
|
225
|
+
description,
|
|
226
|
+
pc.getCollectedCandidates(),
|
|
227
|
+
),
|
|
223
228
|
);
|
|
224
229
|
|
|
225
230
|
return { qr, channel: await channel };
|