@midsummer-ai/sdk 0.1.0-staging.4549 → 0.1.0-staging.4552

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.
@@ -1,4 +1,4 @@
1
- import { a as CallToken } from "../protocol-CFLp4co-.mjs";
1
+ import { a as CallToken } from "../protocol-Cda1THdm.mjs";
2
2
  import { CallTokenInput } from "./index.mjs";
3
3
  //#region src/calls/contract.d.ts
4
4
  interface CallsWorld {
package/calls/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { s as Json } from "../index-c616Dbux.mjs";
2
- import { a as CallToken, c as Layer, d as TrackName, r as CallErrorCode } from "../protocol-CFLp4co-.mjs";
2
+ import { a as CallToken, c as Layer, d as TrackName, r as CallErrorCode } from "../protocol-Cda1THdm.mjs";
3
3
  //#region src/calls/index.d.ts
4
4
  /** The most a message sent with `send` carries, as JSON. */
5
5
  declare const MAX_MESSAGE_BYTES: number;
package/calls/index.mjs CHANGED
@@ -558,6 +558,7 @@ function sfuMedia(ctx, auto, declined, offer) {
558
558
  publish: (tracks) => serial(async () => {
559
559
  const made = tracks.map(({ name, track }) => ({
560
560
  name,
561
+ track,
561
562
  transceiver: pc.addTransceiver(track, {
562
563
  direction: "sendonly",
563
564
  ...name === "camera" && layersOf(track) ? { sendEncodings: layersOf(track) } : {},
@@ -566,12 +567,14 @@ function sfuMedia(ctx, auto, declined, offer) {
566
567
  }));
567
568
  await pc.setLocalDescription(await pc.createOffer());
568
569
  try {
570
+ const sentIn = (name, track) => name === "camera" && (layersOf(track)?.length ?? 1) < SIMULCAST.length ? { layers: layersOf(track)?.length ?? 1 } : {};
569
571
  const answered = await ctx.post("publish", {
570
572
  participant: ctx.me,
571
573
  offer: sdpOf(pc.localDescription),
572
- tracks: made.map(({ name, transceiver }) => ({
574
+ tracks: made.map(({ name, track, transceiver }) => ({
573
575
  mid: transceiver.mid ?? "",
574
- name
576
+ name,
577
+ ...sentIn(name, track)
575
578
  }))
576
579
  });
577
580
  if (answered.answer) await pc.setRemoteDescription(answered.answer);
@@ -1,2 +1,2 @@
1
- import { a as CallToken, c as Layer, d as TrackName, f as WireParticipant, i as CallOp, l as Sdp, m as WireSignal, n as CALL_STATUS, o as CallWire, p as WireRoom, r as CallErrorCode, s as IceServer, t as CALL_OPS, u as TRACK_KINDS } from "../protocol-CFLp4co-.mjs";
1
+ import { a as CallToken, c as Layer, d as TrackName, f as WireParticipant, i as CallOp, l as Sdp, m as WireSignal, n as CALL_STATUS, o as CallWire, p as WireRoom, r as CallErrorCode, s as IceServer, t as CALL_OPS, u as TRACK_KINDS } from "../protocol-Cda1THdm.mjs";
2
2
  export { CALL_OPS, CALL_STATUS, CallErrorCode, CallOp, CallToken, CallWire, IceServer, Layer, Sdp, TRACK_KINDS, TrackName, WireParticipant, WireRoom, WireSignal };
package/calls/react.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { d as TrackName } from "../protocol-CFLp4co-.mjs";
1
+ import { d as TrackName } from "../protocol-Cda1THdm.mjs";
2
2
  import { Call, CallError, CallState, LocalTrack, Participant, Rtc, TokenSource } from "./index.mjs";
3
3
  import { AudioHTMLAttributes, ReactNode, VideoHTMLAttributes } from "react";
4
4
  //#region src/calls/react.d.ts
@@ -1,4 +1,4 @@
1
- import { a as CallToken } from "../protocol-CFLp4co-.mjs";
1
+ import { a as CallToken } from "../protocol-Cda1THdm.mjs";
2
2
  import { CallTokenInput } from "./index.mjs";
3
3
  //#region src/calls/stand-in.d.ts
4
4
  interface CallsStandIn {
package/here-C2jhTheQ.mjs CHANGED
@@ -12,7 +12,7 @@ function processEnv() {
12
12
  * This package's version: `0.0.0-dev` here, and in a published package the version it was published at, which the
13
13
  * release writes in its place as it stages the package (`stampSdk` in `scripts/release/packages.ts`).
14
14
  */
15
- const SDK_VERSION = "0.1.0-staging.4549";
15
+ const SDK_VERSION = "0.1.0-staging.4552";
16
16
  /**
17
17
  * The header that tells Midsummer which client made each of this package's calls: `Midsummer-Client: sdk/<version>
18
18
  * <part>`, `part` the product whose client it is (`database`, `storage`, `queues`, ...), so the platform counts which
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midsummer-ai/sdk",
3
- "version": "0.1.0-staging.4549",
3
+ "version": "0.1.0-staging.4552",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "description": "Midsummer's handles for an app's code: its Database, Storage, Queues, Vector DB, AI, Email and Agents, with stand-ins for tests.",
@@ -66,6 +66,7 @@ interface CallWire {
66
66
  expiresAt: number;
67
67
  };
68
68
  };
69
+ /** `layers` is how many layers a camera is sent in when that isn't three: 2 for one under 960×540, 1 for one under 480×270. */
69
70
  publish: {
70
71
  body: {
71
72
  participant: string;
@@ -73,6 +74,7 @@ interface CallWire {
73
74
  tracks: ReadonlyArray<{
74
75
  mid?: string;
75
76
  name: TrackName;
77
+ layers?: number;
76
78
  }>;
77
79
  };
78
80
  answer: {