@relaymessenger/sdk 0.3.6-staging.23 → 0.3.6-staging.25

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.
Files changed (62) hide show
  1. package/README.md +231 -32
  2. package/dist/{call-room.d.ts → calls/call-room.d.ts} +2 -2
  3. package/dist/calls/call-room.d.ts.map +1 -0
  4. package/dist/calls/call-room.js.map +1 -0
  5. package/dist/calls/engine-werift-video.d.ts +70 -0
  6. package/dist/calls/engine-werift-video.d.ts.map +1 -0
  7. package/dist/calls/engine-werift-video.js +594 -0
  8. package/dist/calls/engine-werift-video.js.map +1 -0
  9. package/dist/calls/engine-werift.d.ts +48 -0
  10. package/dist/calls/engine-werift.d.ts.map +1 -0
  11. package/dist/calls/engine-werift.js +457 -0
  12. package/dist/calls/engine-werift.js.map +1 -0
  13. package/dist/calls/index.d.ts +11 -0
  14. package/dist/calls/index.d.ts.map +1 -0
  15. package/dist/calls/index.js +11 -0
  16. package/dist/calls/index.js.map +1 -0
  17. package/dist/calls/transport.d.ts +466 -0
  18. package/dist/calls/transport.d.ts.map +1 -0
  19. package/dist/calls/transport.js +1409 -0
  20. package/dist/calls/transport.js.map +1 -0
  21. package/dist/calls/video-frame.d.ts +56 -0
  22. package/dist/calls/video-frame.d.ts.map +1 -0
  23. package/dist/calls/video-frame.js +245 -0
  24. package/dist/calls/video-frame.js.map +1 -0
  25. package/dist/calls/video-rtp.d.ts +51 -0
  26. package/dist/calls/video-rtp.d.ts.map +1 -0
  27. package/dist/calls/video-rtp.js +294 -0
  28. package/dist/calls/video-rtp.js.map +1 -0
  29. package/dist/calls/video.d.ts +188 -0
  30. package/dist/calls/video.d.ts.map +1 -0
  31. package/dist/calls/video.js +228 -0
  32. package/dist/calls/video.js.map +1 -0
  33. package/dist/client.d.ts +15 -8
  34. package/dist/client.d.ts.map +1 -1
  35. package/dist/client.js +46 -17
  36. package/dist/client.js.map +1 -1
  37. package/dist/index.d.ts +3 -3
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +3 -3
  40. package/dist/index.js.map +1 -1
  41. package/dist/links.d.ts +12 -5
  42. package/dist/links.d.ts.map +1 -1
  43. package/dist/links.js +11 -12
  44. package/dist/links.js.map +1 -1
  45. package/dist/operations.d.ts +16 -4
  46. package/dist/operations.d.ts.map +1 -1
  47. package/dist/operations.js +21 -3
  48. package/dist/operations.js.map +1 -1
  49. package/dist/payment.d.ts +67 -0
  50. package/dist/payment.d.ts.map +1 -0
  51. package/dist/payment.js +147 -0
  52. package/dist/payment.js.map +1 -0
  53. package/dist/types.d.ts +143 -41
  54. package/dist/types.d.ts.map +1 -1
  55. package/package.json +36 -2
  56. package/dist/call-room.d.ts.map +0 -1
  57. package/dist/call-room.js.map +0 -1
  58. package/dist/invoice.d.ts +0 -64
  59. package/dist/invoice.d.ts.map +0 -1
  60. package/dist/invoice.js +0 -184
  61. package/dist/invoice.js.map +0 -1
  62. /package/dist/{call-room.js → calls/call-room.js} +0 -0
package/README.md CHANGED
@@ -58,41 +58,48 @@ The CLI, Pi, OpenClaw, the Claude Code channel, MCP, and the Chat SDK adapter
58
58
  include selection guidance and structured inbound discovery.
59
59
  `selectionReply(parts, replyTo)` discovers values and the explicit source target.
60
60
 
61
- ## Invoice
61
+ ## Payment
62
62
 
63
- Only a verified agent can send an `invoice` part, and it must be the only part
64
- of its Message. The `url` is your own Stripe-hosted checkout page on one of
65
- `INVOICE_CHECKOUT_HOSTS` (`checkout`, `buy`, `book`, `donate` or
66
- `invoice.stripe.com`); Relay never touches the money.
63
+ Ask a person to pay in two steps. Create a payment request on your
64
+ organization's connected Stripe account, then send its `checkout_url` as a
65
+ `payment` part, the only part of its Message. The card reads its amount and
66
+ title from the request. The money settles to your Stripe account.
67
67
 
68
68
  ```ts
69
- import { invoicePart } from "@relaymessenger/sdk";
70
-
71
- const invoice = invoicePart({
72
- title: "House blend, 250 g",
73
- amount: 2400, // minor units
74
- currency: "usd",
75
- goods: "physical", // "digital" for anything delivered in chat or used in an app
76
- url: "https://buy.stripe.com/test_123",
77
- });
78
- if (typeof invoice === "string") throw new Error(invoice);
69
+ const request = await relay.paymentRequests.create(
70
+ {
71
+ amount: 2400, // minor units
72
+ currency: "usd",
73
+ description: "House blend, 250 g",
74
+ category: "physical_goods", // or "digital_goods", "donation"
75
+ },
76
+ { idempotencyKey: `order-${orderId}` },
77
+ );
79
78
  await relay.chats.messages.send(chatId, {
80
- message: { parts: [invoice], idempotency_key: crypto.randomUUID() },
79
+ message: {
80
+ parts: [{ type: "payment", checkout_url: request.checkout_url }],
81
+ idempotency_key: crypto.randomUUID(),
82
+ },
81
83
  });
82
84
  ```
83
85
 
84
- `invoicePart` applies the server's checks (title, amount, currency, goods,
85
- Stripe checkout url, optional `recurring` of up to 3 years) and returns a
86
- normalized part or an error string. When your Stripe webhook learns the
87
- outcome, move the card with
88
- `relay.messages.invoice.update(messageId, { status: "succeeded" })`; only the
89
- sending agent may.
90
-
91
- `answerMessages` accepts one `invoice` fenced JSON block and sends it as its
92
- own Message after the words. A second invoice, or an invoice beside buttons or
93
- a selection, stays text with an error. `INVOICE_GUIDANCE` is the
94
- when-to-invoice text the CLI, Pi, OpenClaw, MCP and the Claude Code channel
95
- carry; the text bridges also carry `INVOICE_BLOCK_INSTRUCTION`.
86
+ For a subscription, pass `mode: "subscription"` and a recurring `price_id`
87
+ instead of `amount` and `currency`. `relay.paymentRequests.list`, `retrieve`
88
+ and `cancel` read and cancel requests. The status moves only on Stripe's word
89
+ or your cancel, and arrives as `payment.succeeded`, `payment.canceled` or
90
+ `payment.expired`; a paid request also adds a `payment_receipt` message from
91
+ the payer, which arrives as `message.received`.
92
+
93
+ A model inside a bridge never holds the Relay token, so it gives the request's
94
+ fields and the bridge creates it. `answerMessages` lifts one `payment` fenced
95
+ JSON block (`description`, `category`, `amount` and `currency`, or
96
+ `mode: "subscription"` with `price_id`) out of the words and returns it as
97
+ `payment`, checked by `paymentRequestFields`; `createPaymentPart` creates the
98
+ request on the card Message's own idempotency key and returns the `payment`
99
+ part to send last. A second payment, or a payment beside buttons or a
100
+ selection, stays text with an error. `PAYMENT_GUIDANCE` is the text the CLI,
101
+ Pi, OpenClaw, MCP and the Claude Code channel carry; the text bridges also
102
+ carry `PAYMENT_BLOCK_INSTRUCTION`.
96
103
 
97
104
  ## Chat permissions
98
105
 
@@ -357,10 +364,202 @@ the signaling socket without first dropping the old one.
357
364
  WebRTC carries the audio. Relay's server owns SFU/provider details, so clients
358
365
  only exchange SDP in the room protocol and never receive Cloudflare
359
366
  credentials, session IDs, or ICE-provider configuration. Node agents that want
360
- this SDP/ICE and PCM plumbing handled for them can use
361
- `@relaymessenger/livekit`, whose provider-neutral `RelayCallTransport` uses a
362
- standards-compatible Node WebRTC binding and whose LiveKit adapter plugs the
363
- result into LiveKit Agents audio input/output.
367
+ this SDP/ICE and PCM plumbing handled for them use `RelayCallTransport` from
368
+ `@relaymessenger/sdk/calls`, below; `@relaymessenger/livekit` plugs it into
369
+ LiveKit Agents audio input and output.
370
+
371
+ ### Join a Call as the agent
372
+
373
+ `@relaymessenger/sdk/calls` owns the agent's WebRTC peer, so your code never
374
+ handles SDP, ICE, or SFU credentials. It needs WebRTC packages that
375
+ `@relaymessenger/sdk` lists as optional peer dependencies; install them only if
376
+ your agent joins Calls (`node-webcodecs` only for video):
377
+
378
+ ```sh
379
+ npm install @relaymessenger/sdk werift @evan/opus rtp-packet node-webcodecs
380
+ ```
381
+
382
+ ```ts
383
+ import Relay from "@relaymessenger/sdk";
384
+ import { RelayCallTransport } from "@relaymessenger/sdk/calls";
385
+
386
+ const relay = new Relay({ apiKey: process.env.RELAY_AGENT_TOKEN! });
387
+ const transport = new RelayCallTransport({ relay, callId });
388
+
389
+ transport.on("audio", ({ samples, sampleRate, channelCount }) => {
390
+ // Interleaved signed PCM16 from the remote Relay participant.
391
+ });
392
+ // Inbound audio is 48 kHz stereo unless you pass
393
+ // `inboundAudio: { sampleRate: 8000 | 12000 | 16000 | 24000 | 48000, channelCount: 1 | 2 }`;
394
+ // the `"wrtc"` engine accepts only the default.
395
+
396
+ await transport.connect();
397
+ await transport.writeAudio({
398
+ samples,
399
+ sampleRate: 48_000,
400
+ channelCount: 1,
401
+ });
402
+ await transport.waitForPlayout();
403
+ ```
404
+
405
+ `writeAudio()` resolves once its 10 ms slices are queued, `queuedAudioMs()` is
406
+ what has not left yet, and `waitForPlayout()` resolves when the queue is empty
407
+ and the pump is idle (early on `clearAudio()`). Until the other participant is
408
+ receiving the agent's audio (`subscribed`: its `roomState` entry lists `audio`
409
+ in `receiving`), written audio is held, in order, and the track keeps sending
410
+ silence; then it plays from the start, so a greeting that starts early is not
411
+ cut. A restart holds again until the new session is received. `clearAudio()`
412
+ drops held audio too.
413
+
414
+ ### Video
415
+
416
+ Relay calls carry video whenever a camera is on. The video API copies
417
+ LiveKit's `@livekit/rtc-node` names: `VideoSource`, `LocalVideoTrack`,
418
+ `VideoFrame`, `VideoBufferType`, `VideoStream`. Video needs the default
419
+ `"werift"` engine and the optional dependency `node-webcodecs` (prebuilt for
420
+ macOS arm64 and Linux x64/arm64).
421
+
422
+ Send a video feed:
423
+
424
+ ```ts
425
+ import {
426
+ LocalVideoTrack,
427
+ VideoBufferType,
428
+ VideoFrame,
429
+ VideoSource,
430
+ } from "@relaymessenger/sdk/calls";
431
+
432
+ await transport.connect();
433
+
434
+ const source = new VideoSource(640, 480);
435
+ const track = LocalVideoTrack.createVideoTrack("camera", source);
436
+ await transport.publishTrack(track, {
437
+ videoEncoding: { maxBitrate: 800_000, maxFramerate: 15 },
438
+ });
439
+
440
+ // RGBA, BGRA or I420 bytes, tightly packed.
441
+ source.captureFrame(new VideoFrame(rgba, 640, 480, VideoBufferType.RGBA));
442
+
443
+ // Camera off, then on again; the track stays negotiated.
444
+ await transport.unpublishTrack(track);
445
+ await transport.publishTrack(track);
446
+ ```
447
+
448
+ Receive the other participant's video:
449
+
450
+ ```ts
451
+ import { VideoBufferType, VideoStream } from "@relaymessenger/sdk/calls";
452
+
453
+ transport.on("trackSubscribed", async (track) => {
454
+ const stream = new VideoStream(track, { format: VideoBufferType.RGBA, capacity: 2 });
455
+ for await (const { frame, timestampUs } of stream) {
456
+ // frame.data is width x height x 4 bytes of RGBA.
457
+ }
458
+ });
459
+ transport.on("remoteVideo", (on) => {
460
+ // The other participant's camera started or stopped sending.
461
+ });
462
+ ```
463
+
464
+ Frames are decoded only while a `VideoStream` is open. `transport.videoStats()`
465
+ reports frames, packets, keyframes and decode errors in both directions.
466
+
467
+ ### ICE servers, TURN, and diagnostics
468
+
469
+ By default the peer uses the servers the Call room sends after it joins:
470
+ Cloudflare's STUN server and TURN credentials that Relay mints for the call.
471
+ An agent in a container or behind a firewall that blocks outbound UDP connects
472
+ through TURN with no setup. Each restart uses the room's latest servers. A room
473
+ that sends none falls back to Cloudflare's STUN server
474
+ (`stun:stun.cloudflare.com:3478`), as Cloudflare's own Realtime echo example
475
+ does.
476
+
477
+ The offer leaves as soon as the first local candidate exists, without waiting
478
+ for ICE gathering to finish: the SFU is ICE-lite and learns the agent's address
479
+ from its connectivity checks, TURN relay checks included.
480
+
481
+ To use your own servers instead, pass `iceServers` in the standard
482
+ `RTCIceServer` shape and, if every path must go through TURN,
483
+ `iceTransportPolicy: "relay"`. Your value replaces the room's. Both options are
484
+ accepted by `RelayCallTransport` and by `RelayLiveKitCall.connect()` in
485
+ `@relaymessenger/livekit`:
486
+
487
+ ```ts
488
+ const transport = new RelayCallTransport({
489
+ relay,
490
+ callId,
491
+ iceServers: [
492
+ {
493
+ urls: [
494
+ "turn:turn.example.com:3478?transport=udp",
495
+ "turn:turn.example.com:3478?transport=tcp",
496
+ "turns:turn.example.com:5349?transport=tcp",
497
+ ],
498
+ username: process.env.TURN_USERNAME!,
499
+ credential: process.env.TURN_CREDENTIAL!,
500
+ },
501
+ ],
502
+ iceTransportPolicy: "all",
503
+ });
504
+ ```
505
+
506
+ `iceServers` may also be a function; it is called before every peer
507
+ connection, so it can mint fresh TURN credentials for each restart. The room's
508
+ servers are on `room.iceServers` and its `iceServers` event.
509
+
510
+ `connect()` resolves when media first reaches `connected`. It has no overall
511
+ deadline: when an SFU session is not `connected` within
512
+ `sessionConnectTimeoutMs` (5 seconds by default) of its answer, becomes
513
+ `failed`, or stays `disconnected` for 7 seconds, the transport closes that
514
+ peer, waits 250 ms (x1.1 per further attempt, at most 10 s), and publishes
515
+ from a new peer on a new session, for as long as the Call is ringing or in
516
+ progress. Outgoing audio keeps flowing into the new peer. `connect()` rejects
517
+ only when the Call ends, the room or transport closes, the room reports an
518
+ error, or the `signal` passed to it aborts. Each replacement emits
519
+ `restarted` with the reason and the replaced session's summary, for example
520
+ `local: host 2, srflx 0, relay 0; remote: udp 1473; states: new→complete 0.2s, connecting 0.3s, no connected; …`,
521
+ and `diagnostics().restarts` counts them. `mediaConnectTimeoutMs` and
522
+ `connectionTimeoutMs` are deprecated names for `sessionConnectTimeoutMs`.
523
+
524
+ `transport.waitForPeerAudio(timeoutMs)` resolves once the person's audio has
525
+ arrived and the room shows them connected (the transport's `peerAudio` event);
526
+ start the agent's session after it so the first words are heard.
527
+
528
+ The same facts are available at any time from `transport.diagnostics()`: local candidate counts by type, the remote
529
+ candidates' transport and port (never their address), the ICE gathering, ICE
530
+ connection and peer connection state changes with their offsets from
531
+ `connect()`, packet counts in both directions (`inbound`: RTP received, Opus
532
+ decode failures, PCM frames delivered, first and last packet offsets, packets
533
+ in the last 5 s; `outbound`: PCM frames accepted, Opus packets, RTP written
534
+ with the caller's audio, RTP written with silence, first and last packet
535
+ offsets, packets in the last 5 s, paced queue size, pacer state), the room frames seen (`roomState` count, pull `offer` count,
536
+ `ended` reason, `error` messages), and the one-line `summary`, for example
537
+ `…; in: 1234 rtp, 0 bad, 1234 frames, first 0.9s last 41.2s, 250/5s; out: 2600 frames, 1300 opus, 1300 rtp, silence 700, first 1.1s last 41.0s, 250/5s, queue 0, pacer alive; room: 3 roomState, 1 offer`.
538
+ Packet counts come from the `werift` engine; `wrtc` reports zero packets and
539
+ `pacer n/a`.
540
+
541
+ Like a live microphone, the `werift` engine's published track sends one Opus
542
+ packet every 20 ms from the moment media connects until the transport closes,
543
+ paced by the monotonic clock: a timer that fires late sends every packet due
544
+ by then, so the wire carries exactly 50 packets a second; a stall longer than
545
+ 200 ms restarts the clock instead of bursting. The track carries
546
+ the caller's audio when some is queued, Opus silence otherwise. Cloudflare's
547
+ SFU will not let the person's side pull a track that has carried no RTP, so a
548
+ silent agent track would never be heard. Silence never counts toward
549
+ `queuedAudioMs()` or `waitForPlayout()`. The `wrtc` engine sends only the
550
+ audio written to it; write silence yourself if you use it.
551
+
552
+ `onWarning` is called once per call, with the summary, when outbound audio is
553
+ queued but no RTP packet has been written for 2 s while media is connected.
554
+ Nothing is restarted; the callback exists so the failing direction is named in
555
+ the agent's logs.
556
+
557
+ `RelayCallTransport` consumes the SDK's `CallRoom`; it does not duplicate the
558
+ room protocol. The default engine is `werift` (pure TypeScript WebRTC) with
559
+ `@evan/opus` (prebuilt Opus, WASM fallback), so no native WebRTC binding is
560
+ loaded. Pass `engine: "wrtc"` to use the optional `@roamhq/wrtc` binding
561
+ instead. The transport boundary stays provider-neutral; `@relaymessenger/livekit`
562
+ adapts it to LiveKit Agents.
364
563
 
365
564
  ## Webhooks
366
565
 
@@ -1,5 +1,5 @@
1
- import type { CallRoomClientFrame, CallRoomEndedFrame, CallRoomErrorFrame, CallRoomIceServer, CallRoomIceServersFrame, CallRoomServerAnswerFrame, CallRoomServerFrame, CallRoomStateFrame, CallRoomSubscriptionOfferFrame } from "./types.js";
2
- import type { WebSocketConstructor } from "./websocket.js";
1
+ import type { CallRoomClientFrame, CallRoomEndedFrame, CallRoomErrorFrame, CallRoomIceServer, CallRoomIceServersFrame, CallRoomServerAnswerFrame, CallRoomServerFrame, CallRoomStateFrame, CallRoomSubscriptionOfferFrame } from "../types.js";
2
+ import type { WebSocketConstructor } from "../websocket.js";
3
3
  export interface CallRoomOptions {
4
4
  /** Abort closes the signaling socket without ending the Call. */
5
5
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,GAAG,IAAyB;QACnE,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;YACxD,IAAI,CAAC;gBAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,+CAA+C,CAAC,CAAC;QACtF,CAAC;IACH,CAAC;CACF;AAED,kGAAkG;AAClG,MAAM,MAAM,GAAG,GAAS,EAAE,GAAE,CAAC,CAAC"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Video for the werift engine: `node-webcodecs` 1.3.0 encodes and decodes
3
+ * (its static build: LGPL FFmpeg with openh264 and libvpx), `rtp-packet`
4
+ * packetizes, `video-rtp.ts` depacketizes, werift carries RTP and RTCP.
5
+ *
6
+ * Choices measured on 2026-09-22 (/tmp/video-spike-webcodecs, the spike that
7
+ * picked this engine), each kept here:
8
+ * - `NODE_WEBCODECS_FORCE=static` selects the bundled FFmpeg
9
+ * (node-webcodecs dist/native.js `load()`; the default order tries a
10
+ * dynamic build linked against system FFmpeg first).
11
+ * - `hardwareAcceleration: "prefer-software"` on encoder and decoder: on a
12
+ * Mac, VideoToolbox otherwise takes the stream.
13
+ * - H.264 is sent as constrained baseline `avc1.42e01f`, Annex-B; the codec
14
+ * string FFmpeg reports for H.264 is "MPEG4/ISO/AVC", so the codec is never
15
+ * matched by FFmpeg's name, only by the negotiated MIME type.
16
+ * - A keyframe every 1 s, and on every PLI or FIR from the SFU.
17
+ * - The send codec is the first codec of the SFU's answer (werift
18
+ * rtpSender.js:408 `this.codec = params.codecs[0]`).
19
+ * - The receive codec is learned from the payload type of the first RTP
20
+ * packet, looked up in the pulled m-line's codecs: the SFU's pull offer
21
+ * lists every codec (spike receiver.mjs).
22
+ * - werift sends no PLI on loss by itself: the receiver sends one when the
23
+ * stream starts, when a frame is dropped and on a decode error, then every
24
+ * 1 s until a keyframe decodes (spike receiver.mjs `pliTimer`).
25
+ */
26
+ import { MediaStreamTrack, type RTCRtpTransceiver } from "werift";
27
+ import type { RelayMediaStreamTrackLike } from "./transport.js";
28
+ import { type RelayVideoFactory, type RelayVideoReceiverLike, type RelayVideoReceiverStats, type RelayVideoSenderLike, type RelayVideoSenderStats, type TrackPublishOptions } from "./video.js";
29
+ import { VideoFrame, VideoRotation } from "./video-frame.js";
30
+ type WebCodecs = typeof import("node-webcodecs");
31
+ export declare const KEYFRAME_INTERVAL_MS = 1000;
32
+ export declare const KEYFRAME_REQUEST_INTERVAL_MS = 1000;
33
+ export declare const DEFAULT_VIDEO_BITRATE = 800000;
34
+ export declare const DEFAULT_VIDEO_FRAMERATE = 30;
35
+ /** Loads node-webcodecs once, on first video use, so audio-only calls never load FFmpeg. */
36
+ export declare const loadWebCodecs: () => Promise<WebCodecs>;
37
+ /**
38
+ * Raw frames in, H.264 or VP8 RTP out on one werift track. One sender lives
39
+ * for the whole call; a restart binds it to the new peer's transceiver.
40
+ */
41
+ export declare class WeriftVideoSender implements RelayVideoSenderLike {
42
+ #private;
43
+ readonly track: RelayMediaStreamTrackLike;
44
+ constructor(wc: WebCodecs, options?: TrackPublishOptions);
45
+ /**
46
+ * Offer the codecs this sender can encode, the preferred one first (werift
47
+ * fills an empty `transceiver.codecs` from the peer's config at
48
+ * `createOffer`, peerConnection.js:520-523, so setting it here wins).
49
+ */
50
+ bind(transceiver: unknown, peer: unknown): void;
51
+ setEnabled(enabled: boolean): void;
52
+ capture(frame: VideoFrame, timestampUs: bigint, rotation: VideoRotation): void;
53
+ stats(): RelayVideoSenderStats;
54
+ close(): void;
55
+ }
56
+ /**
57
+ * One pulled video m-line: RTP in, decoded I420 frames out. RTP is counted
58
+ * always; it is reordered, assembled and decoded only while active.
59
+ */
60
+ export declare class WeriftVideoReceiver implements RelayVideoReceiverLike {
61
+ #private;
62
+ onframe: RelayVideoReceiverLike["onframe"];
63
+ constructor(track: MediaStreamTrack, transceiver: RTCRtpTransceiver | undefined);
64
+ setActive(active: boolean): void;
65
+ stats(): RelayVideoReceiverStats;
66
+ stop(): void;
67
+ }
68
+ export declare const createWeriftVideoFactory: () => RelayVideoFactory;
69
+ export {};
70
+ //# sourceMappingURL=engine-werift-video.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine-werift-video.d.ts","sourceRoot":"","sources":["../../src/calls/engine-werift-video.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EACL,gBAAgB,EAEhB,KAAK,iBAAiB,EAGvB,MAAM,QAAQ,CAAC;AAEhB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EAGzB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAmB,UAAU,EAAE,aAAa,EAAoB,MAAM,kBAAkB,CAAC;AAWhG,KAAK,SAAS,GAAG,cAAc,gBAAgB,CAAC,CAAC;AAMjD,eAAO,MAAM,oBAAoB,OAAQ,CAAC;AAC1C,eAAO,MAAM,4BAA4B,OAAQ,CAAC;AAClD,eAAO,MAAM,qBAAqB,SAAU,CAAC;AAC7C,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAU1C,4FAA4F;AAC5F,eAAO,MAAM,aAAa,QAAO,OAAO,CAAC,SAAS,CAgBjD,CAAC;AA0CF;;;GAGG;AACH,qBAAa,iBAAkB,YAAW,oBAAoB;;IAC5D,QAAQ,CAAC,KAAK,EAAE,yBAAyB,CAAC;gBA8B9B,EAAE,EAAE,SAAS,EAAE,OAAO,GAAE,mBAAwB;IAS5D;;;;OAIG;IACH,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI;IAqB/C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAKlC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