@crvouga/mockingbird-service-livekit 0.1.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/CHANGELOG.md +5 -0
- package/README.md +50 -0
- package/dist/chunk-4Y4K4CKO.js +2963 -0
- package/dist/chunk-4Y4K4CKO.js.map +7 -0
- package/dist/chunk-AFAW6SZA.js +330 -0
- package/dist/chunk-AFAW6SZA.js.map +7 -0
- package/dist/cli.js +19 -0
- package/dist/cli.js.map +7 -0
- package/dist/index.d.ts +905 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +7 -0
- package/dist/server.d.ts +1254 -0
- package/dist/server.js +12 -0
- package/dist/server.js.map +7 -0
- package/package.json +86 -0
package/CHANGELOG.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# @crvouga/mockingbird-service-livekit
|
|
2
|
+
|
|
3
|
+
Stateful LiveKit mock for `livekit-server-sdk`. It serves Twirp JSON room APIs, validates genuine HS256 LiveKit grants, models participant/track/data state, exposes deterministic SIP and egress controls, and emits correctly signed lifecycle webhooks.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -D @crvouga/mockingbird-service-livekit
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
ESM only. Node 22+ or Bun 1.2+.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { createServer } from "@crvouga/mockingbird-service-livekit/server"
|
|
17
|
+
|
|
18
|
+
const mock = await createServer({
|
|
19
|
+
keys: { fixture: "fixture-secret-that-is-at-least-32-chars" },
|
|
20
|
+
})
|
|
21
|
+
const health = await fetch(`${mock.url}/health`)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Point `RoomServiceClient` at `mock.url`. Supported RoomService calls include CreateRoom, ListRooms, DeleteRoom, UpdateRoomMetadata, ListParticipants, GetParticipant, RemoveParticipant, UpdateParticipant, MutePublishedTrack, and SendData. Room creation is idempotent by name and participant identity is unique within a room.
|
|
25
|
+
|
|
26
|
+
## Controls
|
|
27
|
+
|
|
28
|
+
- `POST /__admin/rooms/:room/participants` joins a synthetic participant.
|
|
29
|
+
- `DELETE /__admin/rooms/:room/participants/:identity` disconnects it.
|
|
30
|
+
- `POST /__admin/rooms/:room/participants/:identity/tracks` publishes a track.
|
|
31
|
+
- `GET /__admin/rooms/:room/participants/:identity/inbox` inspects targeted data.
|
|
32
|
+
- `GET /__admin/resources` and `POST /__admin/resources/:id/transition` inspect and advance SIP/egress state.
|
|
33
|
+
- Fault presets include rate limiting, network loss, and webhook duplicate/reorder/drop delivery.
|
|
34
|
+
|
|
35
|
+
Webhooks cover room, participant, track, egress, and SIP transitions. Each raw body is signed by a short-lived LiveKit access token whose `sha256` claim is accepted by the official `WebhookReceiver`.
|
|
36
|
+
|
|
37
|
+
## API
|
|
38
|
+
|
|
39
|
+
- `LiveKitAPI`, `LiveKitAPIOptions`, `LiveKitEvent`: portable handler and event contract.
|
|
40
|
+
- `LiveKitRoom`, `LiveKitParticipant`, `LiveKitTrack`, `DataMessage`, `AsyncResource`: durable state.
|
|
41
|
+
- `createRuntime`, `LiveKitRuntime`, `LiveKitRuntimeOptions`: full runtime and webhook hub.
|
|
42
|
+
- `LIVEKIT_NAMESPACE`, `LIVEKIT_PRESETS`: constants and fault controls.
|
|
43
|
+
- `document`, `operationIds`, `supportedOperationIds`: generated OpenAPI metadata.
|
|
44
|
+
- `createServer`, `LiveKitServerOptions`, `DEFAULT_PORT`, `serveTarget` from `./server`: Node adapter and CLI integration.
|
|
45
|
+
|
|
46
|
+
## Deliberately not modelled
|
|
47
|
+
|
|
48
|
+
WebRTC media transport, signaling sockets, transcoding, PSTN calls, production scaling, billing, and dashboards are not modelled. The deterministic server API and lifecycle contract is the initial fidelity boundary.
|
|
49
|
+
|
|
50
|
+
Official oracle: [LiveKit RoomService API](https://docs.livekit.io/reference/other/roomservice-api/).
|