@crowdedkingdoms/crowdyjs 18.37.0 → 18.38.0-dev.1

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/MIGRATION.md CHANGED
@@ -120,6 +120,21 @@ super-admin's session). There is no SDK replacement.
120
120
  `dev`'s SDL after #417 merged (`npm run schema:sync:paths -- --schema <that schema.gql>`, then
121
121
  `npm run codegen`).
122
122
 
123
+ ## 18.38.0: choose the speakers each player receives
124
+
125
+ Nothing changes until you call it. With Buddy v0.49.0, `game.udp.setSpeakers({ voice, video })` tells the server
126
+ whose spatial voice and webcam video this player receives; streams a list leaves out are neither sent nor billed:
127
+
128
+ ```ts
129
+ // Hear only the conversation, see nobody's camera, and leave a kind alone by omitting it.
130
+ game.udp.setSpeakers({ voice: conversation.map((p) => p.actorUuid), video: [] });
131
+ // Hear everyone in range again.
132
+ game.udp.setSpeakers({ voice: null });
133
+ ```
134
+
135
+ A list names at most the app's `gameClientBootstrap.maxVoiceSpeakers` / `maxVideoSpeakers` (an org admin sets them
136
+ with `updateApp`; 32 by default and at most). Binary relay only.
137
+
123
138
  ## 18.37.0: the owner echo turns on and off on a live session
124
139
 
125
140
  `game.udp.setOwnMediaEcho(true)` asks for your own spatial voice and video on a session that is
package/README.md CHANGED
@@ -12,19 +12,23 @@ gameplay, minted per app through `client.portal`.
12
12
 
13
13
  Start here:
14
14
 
15
- - [SDK guide](https://docs.crowdedkingdoms.com/crowdyjs/readme) — the canonical
15
+ - [SDK guide](https://docs.dev.crowdedkingdoms.com/crowdyjs/readme) — the canonical
16
16
  walkthrough of everything in this README.
17
- - [Build a game](https://docs.crowdedkingdoms.com/build-a-game/intro) — a
17
+ - [Build a game](https://docs.dev.crowdedkingdoms.com/build-a-game/intro) — a
18
18
  hands-on tutorial from sign-in to a playable voxel game.
19
- - [Platform overview](https://docs.crowdedkingdoms.com/overview/client-workflow)
19
+ - [Platform overview](https://docs.dev.crowdedkingdoms.com/overview/client-workflow)
20
20
  — how a client session flows through the platform.
21
21
 
22
22
  ## Install
23
23
 
24
24
  ```bash
25
- npm install @crowdedkingdoms/crowdyjs
25
+ npm install @crowdedkingdoms/crowdyjs@dev
26
26
  ```
27
27
 
28
+ This README is the `dev` branch's: it documents the release on the `dev` dist-tag
29
+ (`npm view @crowdedkingdoms/crowdyjs dist-tags`), and its links go to the dev docs site. A
30
+ plain `npm install` resolves `latest`, the production release, which has no `client.exec`.
31
+
28
32
  **Server compatibility.** A release selects fields the Game API it was built against has,
29
33
  so it needs that Game API or newer; promote the Game API before the SDK on each tier.
30
34
 
@@ -229,8 +233,8 @@ Notes:
229
233
  - Use `client.auth.setToken(token)` to seed a token externally (e.g. when
230
234
  restoring auth from a non-default storage).
231
235
 
232
- Deeper reading: [Portals & app-scoped tokens](https://docs.crowdedkingdoms.com/management-api/portals-and-app-tokens)
233
- and [Sign in](https://docs.crowdedkingdoms.com/management-api/authentication).
236
+ Deeper reading: [Portals & app-scoped tokens](https://docs.dev.crowdedkingdoms.com/management-api/portals-and-app-tokens)
237
+ and [Sign in](https://docs.dev.crowdedkingdoms.com/management-api/authentication).
234
238
 
235
239
  ### Org-managed players
236
240
 
@@ -522,7 +526,7 @@ query AppForRouting($appId: BigInt!) {
522
526
  `CrowdyClient` with `httpUrl: gameApiUrl` (and the matching `wsUrl`) holding
523
527
  that app's app-scoped token, then drive gameplay through that client. Apps
524
528
  with no `gameApiUrl` keep working against the default `httpUrl` you
525
- configured. See [Loading an app's Game API](https://docs.crowdedkingdoms.com/crowdyjs/shared-environment-routing).
529
+ configured. See [Loading an app's Game API](https://docs.dev.crowdedkingdoms.com/crowdyjs/shared-environment-routing).
526
530
 
527
531
  ## Realtime notifications
528
532
 
@@ -975,7 +979,7 @@ reach your bundle. Reads are synchronous snapshots and writes happen on
975
979
  WebSocket events (not `requestAnimationFrame`), so render loops read freely
976
980
  and a backgrounded tab keeps ingesting updates; pass `workerTicker()` to also
977
981
  keep timer-driven sends at full rate while hidden. See the
978
- [World Stores guide](https://docs.crowdedkingdoms.com/crowdyjs/stores).
982
+ [World Stores guide](https://docs.dev.crowdedkingdoms.com/crowdyjs/stores).
979
983
 
980
984
  ## Game Kit
981
985
 
@@ -1053,7 +1057,7 @@ The protocol is held to ck-exec's golden record of the starters
1053
1057
  (`test/unit/fixtures/kit-protocol.json`): every module call and topic in it is replayed in
1054
1058
  `test/unit/game-kit.test.mjs`. The blueprints, `kit.deploy`, the engines and the model-backed
1055
1059
  helpers went with the game model in 18.0.0; the hub modules replace them. See the
1056
- [Game Kit docs](https://docs.crowdedkingdoms.com/game-kit/intro) and
1060
+ [Game Kit docs](https://docs.dev.crowdedkingdoms.com/game-kit/intro) and
1057
1061
  [MIGRATION.md](MIGRATION.md).
1058
1062
 
1059
1063
  ## ck-exec
@@ -1117,7 +1121,7 @@ Integers above 2^53 decode as `number` and lose precision unless you pass
1117
1121
  `{ decode: { useBigInt64: true } }`. A call's whole numbers outside 32 bits (a timestamp in
1118
1122
  milliseconds, a player id) go out as 64-bit integers (18.11.0; before, as floats, which a
1119
1123
  hub's integer fields refuse). The wire format is in the
1120
- [ck-exec docs](https://docs.crowdedkingdoms.com/exec/intro).
1124
+ [ck-exec docs](https://docs.dev.crowdedkingdoms.com/exec/intro).
1121
1125
 
1122
1126
  ### A mod's CLIENT half
1123
1127
 
@@ -1188,7 +1192,7 @@ counts what was dropped); `invoke` sends at most 256 KiB each way and is refused
1188
1192
  module is not running. `NOT_FOUND` holds a CLIENT half back 15 s and `RATE_LIMITED` 60 s. The
1189
1193
  grid's owner is asked about their own CLIENT halves like anyone; answer yes in `confirm` when
1190
1194
  `prompt.authorId` is the player. See
1191
- [CLIENT halves](https://docs.crowdedkingdoms.com/exec/client-halves).
1195
+ [CLIENT halves](https://docs.dev.crowdedkingdoms.com/exec/client-halves).
1192
1196
 
1193
1197
  ## Hosting your game
1194
1198
 
@@ -1201,7 +1205,7 @@ set response headers. Then, in Studio, open the app's
1201
1205
  origin as the app's **Launch URL**. The redirect URI is what admits the origin to CORS
1202
1206
  and to the hosted sign-in return, so `portal.signIn` works there as in the
1203
1207
  [Quick start](#quick-start).
1204
- [Host your game](https://docs.crowdedkingdoms.com/build-a-game/host-your-game)
1208
+ [Host your game](https://docs.dev.crowdedkingdoms.com/build-a-game/host-your-game)
1205
1209
  has the requirements and recipes.
1206
1210
 
1207
1211
  `client.hosting`, `uploadPublishFiles`, `publishDirectory` and `manifestForDirectory`
@@ -1297,8 +1301,8 @@ CLIENT project needs ck-api `v2.25.1` or later. A CLIENT crate still on the lega
1297
1301
  `mountCrowdyStudio` and the controller take `mods: client.exec`. Crowdy Studio runs nothing
1298
1302
  on legacy player compute since 18.0.0.
1299
1303
 
1300
- See [CLIENT halves](https://docs.crowdedkingdoms.com/exec/client-halves), [mods](https://docs.crowdedkingdoms.com/exec/mods)
1301
- and [Embed Crowdy Studio in your game](https://docs.crowdedkingdoms.com/crowdyjs/crowdy-studio-embed).
1304
+ See [CLIENT halves](https://docs.dev.crowdedkingdoms.com/exec/client-halves), [mods](https://docs.dev.crowdedkingdoms.com/exec/mods)
1305
+ and [Embed Crowdy Studio in your game](https://docs.dev.crowdedkingdoms.com/crowdyjs/crowdy-studio-embed).
1302
1306
 
1303
1307
  ### The Studio agent (DeepSeek Harness in the browser)
1304
1308
 
@@ -1554,7 +1558,7 @@ no other repositories and no network access required:
1554
1558
  `src/generated/graphql-schema.ts`, the generated schema types.
1555
1559
 
1556
1560
  Schema refresh is explicit, from the published
1557
- [SDL](https://docs.crowdedkingdoms.com/schema/game-api.graphql):
1561
+ [SDL](https://docs.dev.crowdedkingdoms.com/schema/game-api.graphql):
1558
1562
 
1559
1563
  ```bash
1560
1564
  npm run schema:sync:prod
@@ -108,6 +108,21 @@ export interface BinaryRelayConfig {
108
108
  * billed as data out. Needs {@link advertiseCapabilities}.
109
109
  */
110
110
  ownMediaEcho?: boolean;
111
+ /** The speaker lists to start with (see {@link BinaryRelayTransport.setSpeakers}). */
112
+ speakers?: SpeakerLists;
113
+ }
114
+ /**
115
+ * The speakers whose spatial voice and webcam video a session receives (Buddy
116
+ * v0.49.0): a list receives only those actors, `null` everyone in range.
117
+ */
118
+ export interface SpeakerLists {
119
+ voice: readonly string[] | null;
120
+ video: readonly string[] | null;
121
+ }
122
+ /** A change to {@link SpeakerLists}: an omitted kind is left as it is. */
123
+ export interface SpeakerListsChange {
124
+ voice?: readonly string[] | null;
125
+ video?: readonly string[] | null;
111
126
  }
112
127
  /** Uplink counters kept by the relay transport (see {@link BinaryRelayTransport.stats}). */
113
128
  export interface BinaryRelaySendStats {
@@ -146,12 +161,19 @@ export declare class BinaryRelayTransport {
146
161
  private readonly advertiseCapabilities;
147
162
  private readonly capabilitiesIntervalMs;
148
163
  private capabilityFlags;
164
+ private readonly speakers;
149
165
  private capsTimer;
150
166
  private pendingMembers;
151
167
  private pendingBytes;
152
168
  private bundleTimer;
153
169
  private readonly sendStats;
154
170
  constructor(config: BinaryRelayConfig, callbacks: BinaryRelayCallbacks);
171
+ /**
172
+ * Change the speakers whose spatial voice and video this session receives.
173
+ * Each changed kind is sent at once when ready, and every list is sent again
174
+ * with each capabilities advertisement.
175
+ */
176
+ setSpeakers(change: SpeakerListsChange): void;
155
177
  /**
156
178
  * Start or stop asking for this session's own spatial voice and video
157
179
  * (`ClientCapability.OWN_MEDIA_ECHO`). Advertised at once when ready, and on
@@ -192,6 +214,7 @@ export declare class BinaryRelayTransport {
192
214
  private startCapabilities;
193
215
  private stopCapabilities;
194
216
  private sendCapabilities;
217
+ private sendSpeakers;
195
218
  /**
196
219
  * The server wants this client on a different instance.
197
220
  *
@@ -1 +1 @@
1
- {"version":3,"file":"binary-relay.d.ts","sourceRoot":"","sources":["../src/binary-relay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,eA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IAChC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAuE;IAChG,OAAO,CAAC,SAAS,CAA+C;IAChE,OAAO,CAAC,cAAc,CAAoB;IAC1C,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,WAAW,CAA8C;IACjE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAMxB;gBAGA,MAAM,EAAE,iBAAiB,EACR,SAAS,EAAE,oBAAoB;IAmBlD;;;;OAIG;IACH,WAAW,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI;IAO7C;;;;OAIG;IACH,eAAe,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI;IASlC,uCAAuC;IACvC,KAAK,IAAI,oBAAoB;IAI7B,wEAAwE;IACxE,OAAO,IAAI,OAAO;IAQlB,wEAAwE;IACxE,cAAc,IAAI,gBAAgB,GAAG,IAAI;IAIzC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAO5B,UAAU,IAAI,IAAI;IAwBlB,oEAAoE;IACpE,OAAO,IAAI,IAAI;IASf;;;;OAIG;IACH,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAgDlC;;;;OAIG;IACH,UAAU,IAAI,IAAI;IAoBlB,OAAO,CAAC,QAAQ;IAQhB,OAAO,CAAC,IAAI;YA8HE,kBAAkB;IAuChC;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IAgBzB,OAAO,CAAC,gBAAgB;YAOV,gBAAgB;YAchB,YAAY;IAa1B;;;;;;OAMG;IACH,OAAO,CAAC,wBAAwB;IA2BhC,OAAO,CAAC,UAAU;CAyBnB"}
@@ -13,7 +13,7 @@
13
13
  */
14
14
  import { silentLogger } from './logger.js';
15
15
  import { CrowdyRealtimeError } from './errors.js';
16
- import { BUNDLE_LENGTH_PREFIX_BYTES, bundleSizeOf, ClientCapability, createSignContext, packMessageBundle, parseRelayFrame, RELAY_MAX_BUNDLE_MEMBER_BYTES, RELAY_MAX_BUNDLE_MEMBERS, RELAY_MAX_DATAGRAM_BYTES, SDK_CAPABILITIES, serializeClientCapabilities, } from './binary-wire.js';
16
+ import { BUNDLE_LENGTH_PREFIX_BYTES, bundleSizeOf, ClientCapability, createSignContext, packMessageBundle, parseRelayFrame, RELAY_MAX_BUNDLE_MEMBER_BYTES, RELAY_MAX_BUNDLE_MEMBERS, RELAY_MAX_DATAGRAM_BYTES, SDK_CAPABILITIES, serializeClientCapabilities, serializeClientMediaSpeakers, SpeakerListMode, } from './binary-wire.js';
17
17
  export const RELAY_SUBPROTOCOL = 'crowdy-relay-v1';
18
18
  const BEARER_PREFIX = 'bearer.';
19
19
  /**
@@ -75,6 +75,13 @@ export function isSameEstate(current, candidate) {
75
75
  const site = (h) => h.split('.').slice(-2).join('.');
76
76
  return site(a) === site(b) && site(a).includes('.');
77
77
  }
78
+ function speakerChange(list) {
79
+ if (list === undefined)
80
+ return { mode: SpeakerListMode.KEEP, names: [] };
81
+ if (list === null)
82
+ return { mode: SpeakerListMode.EVERYONE, names: [] };
83
+ return { mode: SpeakerListMode.ONLY, names: list };
84
+ }
78
85
  /**
79
86
  * True in a browser whose document is hidden (background tab). Browsers clamp
80
87
  * timers there, so the bundle window cannot be honoured; the transport flushes
@@ -121,6 +128,25 @@ export class BinaryRelayTransport {
121
128
  this.capabilitiesIntervalMs = Math.max(1000, config.capabilitiesIntervalMs ?? 15000);
122
129
  this.capabilityFlags =
123
130
  SDK_CAPABILITIES | (config.ownMediaEcho ? ClientCapability.OWN_MEDIA_ECHO : 0);
131
+ this.speakers = {
132
+ voice: config.speakers?.voice ?? null,
133
+ video: config.speakers?.video ?? null,
134
+ };
135
+ }
136
+ /**
137
+ * Change the speakers whose spatial voice and video this session receives.
138
+ * Each changed kind is sent at once when ready, and every list is sent again
139
+ * with each capabilities advertisement.
140
+ */
141
+ setSpeakers(change) {
142
+ if (change.voice !== undefined)
143
+ this.speakers.voice = change.voice;
144
+ if (change.video !== undefined)
145
+ this.speakers.video = change.video;
146
+ if (change.voice !== undefined)
147
+ void this.sendSpeakers(speakerChange(change.voice), speakerChange(undefined));
148
+ if (change.video !== undefined)
149
+ void this.sendSpeakers(speakerChange(undefined), speakerChange(change.video));
124
150
  }
125
151
  /**
126
152
  * Start or stop asking for this session's own spatial voice and video
@@ -424,12 +450,18 @@ export class BinaryRelayTransport {
424
450
  */
425
451
  startCapabilities() {
426
452
  this.stopCapabilities();
427
- if (!this.advertiseCapabilities)
428
- return;
429
- void this.sendCapabilities();
430
- const timer = setInterval(() => {
431
- void this.sendCapabilities();
432
- }, this.capabilitiesIntervalMs);
453
+ // The speaker lists live with the session on the server, as the capabilities do, and
454
+ // go with it on a token refresh or a migration: both are sent on every tick.
455
+ const tick = () => {
456
+ if (this.advertiseCapabilities)
457
+ void this.sendCapabilities();
458
+ if (this.speakers.voice !== null)
459
+ void this.sendSpeakers(speakerChange(this.speakers.voice), speakerChange(undefined));
460
+ if (this.speakers.video !== null)
461
+ void this.sendSpeakers(speakerChange(undefined), speakerChange(this.speakers.video));
462
+ };
463
+ tick();
464
+ const timer = setInterval(tick, this.capabilitiesIntervalMs);
433
465
  // Node: never keep a process alive for this timer (tests, tools).
434
466
  timer.unref?.();
435
467
  this.capsTimer = timer;
@@ -456,6 +488,21 @@ export class BinaryRelayTransport {
456
488
  this.logger.debug?.(`capabilities not sent: ${String(error)}`);
457
489
  }
458
490
  }
491
+ async sendSpeakers(voice, video) {
492
+ const ctx = this.signContext;
493
+ if (!ctx || this.appId == null || !this.isReady())
494
+ return;
495
+ try {
496
+ const frame = await serializeClientMediaSpeakers(ctx, this.appId, voice, video);
497
+ if (this.signContext !== ctx)
498
+ return;
499
+ this.sendFrame(frame);
500
+ this.flushSends();
501
+ }
502
+ catch (error) {
503
+ this.logger.debug?.(`speaker list not sent: ${String(error)}`);
504
+ }
505
+ }
459
506
  /**
460
507
  * The server wants this client on a different instance.
461
508
  *
@@ -47,6 +47,7 @@ export declare function packMessageBundle(members: readonly Uint8Array[]): Uint8
47
47
  export declare const WireMessageType: {
48
48
  readonly MESSAGE_BUNDLE: 2;
49
49
  readonly CLIENT_CAPABILITIES: 29;
50
+ readonly CLIENT_MEDIA_SPEAKERS: 47;
50
51
  readonly MESSAGE_BUNDLE_SIGNED: 30;
51
52
  readonly GENERIC_ERROR_MESSAGE: 3;
52
53
  readonly CHANNEL_MESSAGE_REQUEST: 17;
@@ -106,6 +107,32 @@ export declare const SDK_CAPABILITIES: number;
106
107
  * again every few seconds (a relay-side Buddy migration is silent to us).
107
108
  */
108
109
  export declare function serializeClientCapabilities(ctx: RelaySignContext, appId: string | number | bigint, flags?: number, sequenceNumber?: number): Promise<Uint8Array>;
110
+ /**
111
+ * How a `CLIENT_MEDIA_SPEAKERS` changes one kind's list (Buddy v0.49.0): leave it,
112
+ * receive only the names that follow, or receive everyone in range again.
113
+ */
114
+ export declare const SpeakerListMode: {
115
+ readonly KEEP: 0;
116
+ readonly ONLY: 1;
117
+ readonly EVERYONE: 2;
118
+ };
119
+ /**
120
+ * The most speakers one list may name: what a datagram holds, and an app's
121
+ * number when it sets none (`gameClientBootstrap.maxVoiceSpeakers` /
122
+ * `maxVideoSpeakers` give the app's own).
123
+ */
124
+ export declare const MAX_MEDIA_SPEAKERS = 32;
125
+ /** One kind's change in a `CLIENT_MEDIA_SPEAKERS`. */
126
+ export interface SpeakerListChange {
127
+ mode: number;
128
+ names: readonly string[];
129
+ }
130
+ /**
131
+ * Build a `CLIENT_MEDIA_SPEAKERS` (47) datagram: the capabilities' long-spatial
132
+ * layout with `[voiceMode][voiceCount][videoMode][videoCount]` and the names,
133
+ * each a 32-byte actor id as the spatial messages carry it.
134
+ */
135
+ export declare function serializeClientMediaSpeakers(ctx: RelaySignContext, appId: string | number | bigint, voice?: SpeakerListChange, video?: SpeakerListChange, sequenceNumber?: number): Promise<Uint8Array>;
109
136
  export interface SpatialSendBase {
110
137
  appId: string;
111
138
  chunk: {
@@ -1 +1 @@
1
- {"version":3,"file":"binary-wire.d.ts","sourceRoot":"","sources":["../src/binary-wire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;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,eAAe,EAAE,CAuBpE"}
@@ -82,6 +82,8 @@ export const WireMessageType = {
82
82
  // advertised BUNDLE_SIGNED receives its bundles with ONE trailing HMAC over the
83
83
  // datagram and members without per-member HMACs (containsAuth = 0).
84
84
  CLIENT_CAPABILITIES: 29,
85
+ // Buddy v0.49.0: the speakers whose spatial voice and video this session receives.
86
+ CLIENT_MEDIA_SPEAKERS: 47,
85
87
  MESSAGE_BUNDLE_SIGNED: 30,
86
88
  GENERIC_ERROR_MESSAGE: 3,
87
89
  CHANNEL_MESSAGE_REQUEST: 17,
@@ -266,6 +268,39 @@ export function serializeClientCapabilities(ctx, appId, flags = SDK_CAPABILITIES
266
268
  new DataView(payload.buffer).setUint32(0, flags >>> 0, true);
267
269
  return serializeSpatial(ctx, WireMessageType.CLIENT_CAPABILITIES, appId, { x: 0, y: 0, z: 0 }, 0, 0, '', payload, sequenceNumber);
268
270
  }
271
+ /**
272
+ * How a `CLIENT_MEDIA_SPEAKERS` changes one kind's list (Buddy v0.49.0): leave it,
273
+ * receive only the names that follow, or receive everyone in range again.
274
+ */
275
+ export const SpeakerListMode = { KEEP: 0, ONLY: 1, EVERYONE: 2 };
276
+ /**
277
+ * The most speakers one list may name: what a datagram holds, and an app's
278
+ * number when it sets none (`gameClientBootstrap.maxVoiceSpeakers` /
279
+ * `maxVideoSpeakers` give the app's own).
280
+ */
281
+ export const MAX_MEDIA_SPEAKERS = 32;
282
+ const KEEP_LIST = { mode: SpeakerListMode.KEEP, names: [] };
283
+ /**
284
+ * Build a `CLIENT_MEDIA_SPEAKERS` (47) datagram: the capabilities' long-spatial
285
+ * layout with `[voiceMode][voiceCount][videoMode][videoCount]` and the names,
286
+ * each a 32-byte actor id as the spatial messages carry it.
287
+ */
288
+ export function serializeClientMediaSpeakers(ctx, appId, voice = KEEP_LIST, video = KEEP_LIST, sequenceNumber = 0) {
289
+ const names = [...voice.names, ...video.names];
290
+ const payload = new Uint8Array(4 + names.length * UUID_SIZE);
291
+ payload[0] = voice.mode;
292
+ payload[1] = voice.names.length;
293
+ payload[2] = video.mode;
294
+ payload[3] = video.names.length;
295
+ names.forEach((name, i) => {
296
+ const bytes = textEncoder.encode(name);
297
+ if (bytes.length > UUID_SIZE) {
298
+ throw new Error(`UUID too long: ${bytes.length} > ${UUID_SIZE}`);
299
+ }
300
+ payload.set(bytes, 4 + i * UUID_SIZE);
301
+ });
302
+ return serializeSpatial(ctx, WireMessageType.CLIENT_MEDIA_SPEAKERS, appId, { x: 0, y: 0, z: 0 }, 0, 0, '', payload, sequenceNumber);
303
+ }
269
304
  export function serializeActorUpdate(ctx, input) {
270
305
  return serializeSpatial(ctx, WireMessageType.ACTOR_UPDATE_REQUEST_2, input.appId, input.chunk, input.distance ?? 8, input.decayRate ?? 1, input.uuid, decodeBase64(input.state ?? ''), input.sequenceNumber ?? 0);
271
306
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * GENERATED — do not edit. The operator tooling's
3
- * `sync-client-origins.mjs --write --tier prod` writes this file, and
3
+ * `sync-client-origins.mjs --write --tier dev` writes this file, and
4
4
  * `check-sdk-default-origin.mjs` refuses it when it names the wrong tier or a
5
5
  * host that declaration does not carry. Regenerate; never hand-edit.
6
6
  *
@@ -10,14 +10,14 @@
10
10
  * than no default at all. Every fallback this SDK ever removed named a host that
11
11
  * was already dead. A generated file plus a gate is what makes this one different.
12
12
  *
13
- * Source: the operator's per-tier public CK API origin declaration, tier 'prod'
13
+ * Source: the operator's per-tier public CK API origin declaration, tier 'dev'
14
14
  */
15
15
  /** The tier this build of the SDK is published for. */
16
- export declare const CROWDY_DEFAULT_TIER = "prod";
16
+ export declare const CROWDY_DEFAULT_TIER = "dev";
17
17
  /** The public CK API origin for that tier. */
18
- export declare const CROWDY_DEFAULT_HTTP_ORIGIN = "https://ck.prod.crowdedkingdoms.com";
18
+ export declare const CROWDY_DEFAULT_HTTP_ORIGIN = "https://ck.dev.crowdedkingdoms.com";
19
19
  /** The same host over WebSocket. A scheme is composed; a hostname is looked up. */
20
- export declare const CROWDY_DEFAULT_WS_ORIGIN = "wss://ck.prod.crowdedkingdoms.com";
20
+ export declare const CROWDY_DEFAULT_WS_ORIGIN = "wss://ck.dev.crowdedkingdoms.com";
21
21
  /** The bare hostname, for callers that need to compare rather than dial. */
22
- export declare const CROWDY_DEFAULT_HOST = "ck.prod.crowdedkingdoms.com";
22
+ export declare const CROWDY_DEFAULT_HOST = "ck.dev.crowdedkingdoms.com";
23
23
  //# sourceMappingURL=default-origin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"default-origin.d.ts","sourceRoot":"","sources":["../src/default-origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAE1C,8CAA8C;AAC9C,eAAO,MAAM,0BAA0B,wCAAwC,CAAC;AAEhF,mFAAmF;AACnF,eAAO,MAAM,wBAAwB,sCAAsC,CAAC;AAE5E,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,gCAAgC,CAAC"}
1
+ {"version":3,"file":"default-origin.d.ts","sourceRoot":"","sources":["../src/default-origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,QAAQ,CAAC;AAEzC,8CAA8C;AAC9C,eAAO,MAAM,0BAA0B,uCAAuC,CAAC;AAE/E,mFAAmF;AACnF,eAAO,MAAM,wBAAwB,qCAAqC,CAAC;AAE3E,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,+BAA+B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * GENERATED — do not edit. The operator tooling's
3
- * `sync-client-origins.mjs --write --tier prod` writes this file, and
3
+ * `sync-client-origins.mjs --write --tier dev` writes this file, and
4
4
  * `check-sdk-default-origin.mjs` refuses it when it names the wrong tier or a
5
5
  * host that declaration does not carry. Regenerate; never hand-edit.
6
6
  *
@@ -10,13 +10,13 @@
10
10
  * than no default at all. Every fallback this SDK ever removed named a host that
11
11
  * was already dead. A generated file plus a gate is what makes this one different.
12
12
  *
13
- * Source: the operator's per-tier public CK API origin declaration, tier 'prod'
13
+ * Source: the operator's per-tier public CK API origin declaration, tier 'dev'
14
14
  */
15
15
  /** The tier this build of the SDK is published for. */
16
- export const CROWDY_DEFAULT_TIER = 'prod';
16
+ export const CROWDY_DEFAULT_TIER = 'dev';
17
17
  /** The public CK API origin for that tier. */
18
- export const CROWDY_DEFAULT_HTTP_ORIGIN = 'https://ck.prod.crowdedkingdoms.com';
18
+ export const CROWDY_DEFAULT_HTTP_ORIGIN = 'https://ck.dev.crowdedkingdoms.com';
19
19
  /** The same host over WebSocket. A scheme is composed; a hostname is looked up. */
20
- export const CROWDY_DEFAULT_WS_ORIGIN = 'wss://ck.prod.crowdedkingdoms.com';
20
+ export const CROWDY_DEFAULT_WS_ORIGIN = 'wss://ck.dev.crowdedkingdoms.com';
21
21
  /** The bare hostname, for callers that need to compare rather than dial. */
22
- export const CROWDY_DEFAULT_HOST = 'ck.prod.crowdedkingdoms.com';
22
+ export const CROWDY_DEFAULT_HOST = 'ck.dev.crowdedkingdoms.com';
@@ -119,6 +119,23 @@ export declare class UdpAPI {
119
119
  * is `realtime.ownMediaEcho`.
120
120
  */
121
121
  setOwnMediaEcho(on: boolean): void;
122
+ /**
123
+ * Binary relay only: the speakers whose spatial voice and webcam video this
124
+ * player receives (Buddy v0.49.0). For each kind, an array of actor uuids
125
+ * receives only those (`[]` none), `null` receives everyone in range again,
126
+ * and an omitted kind is left as it is. Streams a list leaves out are neither
127
+ * sent nor billed. A list names at most the app's
128
+ * `gameClientBootstrap.maxVoiceSpeakers` / `maxVideoSpeakers` (never more than
129
+ * 32): the server refuses a longer one with a `GenericErrorResponse`
130
+ * (`INVALID_REQUEST`) and keeps the list it had. The lists go again after every
131
+ * reconnect and every 15 s, so they outlive a token refresh or a migration.
132
+ *
133
+ * @throws {CrowdyRealtimeError} `SPEAKER_LIST_TOO_LONG` for a list over 32.
134
+ */
135
+ setSpeakers(change: {
136
+ voice?: readonly string[] | null;
137
+ video?: readonly string[] | null;
138
+ }): void;
122
139
  disconnect(): Promise<boolean>;
123
140
  /**
124
141
  * Read the current UDP proxy session status **without** opening one. With no
@@ -1 +1 @@
1
- {"version":3,"file":"udp.d.ts","sourceRoot":"","sources":["../../src/domains/udp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAEL,KAAK,uBAAuB,EAG5B,KAAK,6BAA6B,EAElC,KAAK,gCAAgC,EAErC,KAAK,gCAAgC,EAErC,KAAK,gCAAgC,EAErC,KAAK,gCAAgC,EAErC,KAAK,+BAA+B,EAEpC,KAAK,gCAAgC,EAErC,KAAK,uCAAuC,EAE5C,KAAK,mCAAmC,EAExC,KAAK,iCAAiC,EAEtC,KAAK,yCAAyC,EAC/C,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAkB1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBAAa,MAAM;IAOf,OAAO,CAAC,GAAG;IACX,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,OAAO,CAAC;IAChB;;;;OAIG;IACH,OAAO,CAAC,2BAA2B,CAAC;IAdtC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA2B;IACrD,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAA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CAAC,GAClD,OAAO,CAAC,OAAO,CAAC;IAcnB;;;;;;;;;;;;;;;OAeG;IACG,gBAAgB,CACpB,KAAK,EAAE,iCAAiC,CAAC,OAAO,CAAC,GAChD,OAAO,CAAC,OAAO,CAAC;IAcnB;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,wBAAwB,CAC5B,KAAK,EAAE,yCAAyC,CAAC,OAAO,CAAC,GACxD,OAAO,CAAC,OAAO,CAAC;IAcnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,SAAS,CAAC,QAAQ,EAAE,uBAAuB,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,IAAI;IAIvE;;;;;;;;;;;;;;;;;;;;;;OAsBG;YACW,WAAW;YAyCX,eAAe;IAmC7B,OAAO,CAAC,YAAY;CAQrB"}
@@ -176,6 +176,22 @@ export class UdpAPI {
176
176
  setOwnMediaEcho(on) {
177
177
  this.subs.setOwnMediaEcho(on);
178
178
  }
179
+ /**
180
+ * Binary relay only: the speakers whose spatial voice and webcam video this
181
+ * player receives (Buddy v0.49.0). For each kind, an array of actor uuids
182
+ * receives only those (`[]` none), `null` receives everyone in range again,
183
+ * and an omitted kind is left as it is. Streams a list leaves out are neither
184
+ * sent nor billed. A list names at most the app's
185
+ * `gameClientBootstrap.maxVoiceSpeakers` / `maxVideoSpeakers` (never more than
186
+ * 32): the server refuses a longer one with a `GenericErrorResponse`
187
+ * (`INVALID_REQUEST`) and keeps the list it had. The lists go again after every
188
+ * reconnect and every 15 s, so they outlive a token refresh or a migration.
189
+ *
190
+ * @throws {CrowdyRealtimeError} `SPEAKER_LIST_TOO_LONG` for a list over 32.
191
+ */
192
+ setSpeakers(change) {
193
+ this.subs.setSpeakers(change);
194
+ }
179
195
  async disconnect() {
180
196
  if (this.subs.usingBinaryTransport()) {
181
197
  this.subs.disconnect();
@@ -923,6 +923,10 @@ export type App = {
923
923
  description: Maybe<Scalars['String']['output']>;
924
924
  /** Seconds a realtime session may go without gameplay input (movement, messages, edits, voice; keep-alives and keyframes that repeat an unchanged state do not count) before the replication server releases it with reason idle. 900 (15 minutes) unless the app sets its own; 0 means never. A released player is not reconnected automatically: the SDKs report the session inactive and the game reconnects on the next player input. */
925
925
  effectiveIdleTimeoutSeconds: Scalars['Int']['output'];
926
+ /** The most speakers whose webcam video one player's game may name in its speaker list: the app's maxVideoSpeakers, else 32. Video the list leaves out is neither sent nor billed; a player whose game sends no list receives every camera in range. */
927
+ effectiveMaxVideoSpeakers: Scalars['Int']['output'];
928
+ /** The most speakers whose spatial voice one player's game may name in its speaker list (the realtime servers' CLIENT_MEDIA_SPEAKERS): the app's maxVoiceSpeakers, else 32. The servers deliver voice only from the speakers a list names, so voice the list leaves out is neither sent nor billed; a player whose game sends no list receives every speaker in range. */
929
+ effectiveMaxVoiceSpeakers: Scalars['Int']['output'];
926
930
  /** The youngest age the app admits now: the higher of minPlayerAge and the platform's minimum (18 until players 13 and over are admitted, then 13). A player's country can require more (territoryPolicies); younger players are refused AGE_REQUIREMENT_NOT_MET at mint. */
927
931
  effectiveMinPlayerAge: Scalars['Int']['output'];
928
932
  /** Resolved game-api base URL for SDK/runtime calls: the per-tenant URL for dedicated apps, or the shared platform URL for shared apps. Null for legacy or not-yet-deployed apps. */
@@ -941,6 +945,10 @@ export type App = {
941
945
  launchUrl: Maybe<Scalars['String']['output']>;
942
946
  /** Whether the organization lets its org-managed players build and run mods (and use the Studio agent) in this app, paying for their mod compute, egress, storage and model tokens itself. False by default, and false on a tier that does not serve org-managed players. Set with setAppManagedPlayerMods (manage_billing). Players with a Crowded Kingdoms account are unaffected. */
943
947
  managedPlayerModsEnabled: Scalars['Boolean']['output'];
948
+ /** The most speakers whose webcam video one player's game may name in its speaker list, when the app sets a number: 1 to 32. null uses 32 (effectiveMaxVideoSpeakers). Set with updateApp (manage_apps). */
949
+ maxVideoSpeakers: Maybe<Scalars['Int']['output']>;
950
+ /** The most speakers whose spatial voice one player's game may name in its speaker list, when the app sets a number: 1 to 32. null uses 32 (effectiveMaxVoiceSpeakers). Set with updateApp (manage_apps). */
951
+ maxVoiceSpeakers: Maybe<Scalars['Int']['output']>;
944
952
  /** Opaque JSON-encoded string of marketplace media (cover image URL, screenshots, long description, etc.). Stored internally as JSONB; clients must JSON.parse on read and JSON.stringify on write. Null/"{}" when unset. */
945
953
  metadata: Maybe<Scalars['String']['output']>;
946
954
  /** The youngest age the app admits, 13 to 18, when it asks more than the platform's minimum; null for the platform's minimum. Set with updateApp (manage_apps). */
@@ -4285,6 +4293,10 @@ export type GameClientBootstrap = {
4285
4293
  maxDecayRate: Scalars['Int']['output'];
4286
4294
  /** Maximum allowed value for the `distance` (chunk fan-out radius) field on spatial sends. Currently 8; the server clamps send `distance` to 0..this. distance is the number of chunks outward the message is replicated. */
4287
4295
  maxReplicationDistance: Scalars['Int']['output'];
4296
+ /** The most speakers whose webcam video this player's speaker list may name (App.effectiveMaxVideoSpeakers, 1 to 32): the realtime servers refuse a longer list. A player whose game sends no list receives every camera in range. */
4297
+ maxVideoSpeakers: Scalars['Int']['output'];
4298
+ /** The most speakers whose spatial voice this player's speaker list may name (App.effectiveMaxVoiceSpeakers, 1 to 32): the realtime servers refuse a longer list (CLIENT_MEDIA_SPEAKERS, opcode 47). A player whose game sends no list receives every speaker in range. */
4299
+ maxVoiceSpeakers: Scalars['Int']['output'];
4288
4300
  /** The authenticated user resolved from the bearer game token on the request. Use this for the local player identity instead of a separate `me` call. */
4289
4301
  me: User;
4290
4302
  /** GraphQL WebSocket subprotocol expected by udpNotifications. */
@@ -5589,7 +5601,7 @@ export type Mutation = {
5589
5601
  updateActor: Actor;
5590
5602
  /** Replaces an actor’s `publicState` and/or `privateState` blobs (fields omitted from `input` are left unchanged). OWNER-EXCLUSIVE: only the actor’s owner may write (throws Unauthorized otherwise). Game-plane: requires an app token for the actor’s app (a session token or another app’s token is answered NotFound). `uuid` is the 32-character ASCII actor id; blobs are base64-encoded binary. */
5591
5603
  updateActorState: Actor;
5592
- /** Update mutable fields of an existing app (name, description, visibility, status, metadata, wildernessWritesOpen, claimOwnerKeys, replayLoggingEnabled, replayLoggingRecordsMedia, replayLoggingRecordsVoice, replayLoggingRecordsVideo, minPlayerAge, idleTimeoutSeconds); only fields present in the input are changed. Turning replayLoggingEnabled on is refused with INPUT_LOG_FUNDS_NEEDED unless the org's wallet can spend at least the projected cost of keeping one retention period of the app's recent traffic (extensions.requiredMicrousd and spendableMicrousd say how much), or the org is billing-exempt; recordings already kept go on billing after it is turned off, until they age out. Turning it off is refused with SAFETY_LOG_REQUIRED while the app admits players under 18. Requires the 'manage_apps' permission on the app (resolved via its org); super admins bypass. Use this to publish (status=LIVE), change visibility (PUBLIC lists the app in the marketplace), or restore an archived app (status back to DRAFT/LIVE); a restore counts against the cap of 10 apps for an organization without a funded wallet or auto-billing (APP_LIMIT_REACHED). Throws if the app id does not exist. */
5604
+ /** Update mutable fields of an existing app (name, description, visibility, status, metadata, wildernessWritesOpen, claimOwnerKeys, replayLoggingEnabled, replayLoggingRecordsMedia, replayLoggingRecordsVoice, replayLoggingRecordsVideo, minPlayerAge, idleTimeoutSeconds, maxVoiceSpeakers, maxVideoSpeakers); only fields present in the input are changed. Turning replayLoggingEnabled on is refused with INPUT_LOG_FUNDS_NEEDED unless the org's wallet can spend at least the projected cost of keeping one retention period of the app's recent traffic (extensions.requiredMicrousd and spendableMicrousd say how much), or the org is billing-exempt; recordings already kept go on billing after it is turned off, until they age out. Turning it off is refused with SAFETY_LOG_REQUIRED while the app admits players under 18. Requires the 'manage_apps' permission on the app (resolved via its org); super admins bypass. Use this to publish (status=LIVE), change visibility (PUBLIC lists the app in the marketplace), or restore an archived app (status back to DRAFT/LIVE); a restore counts against the cap of 10 apps for an organization without a funded wallet or auto-billing (APP_LIMIT_REACHED). Throws if the app id does not exist. */
5593
5605
  updateApp: App;
5594
5606
  /** Updates an avatar’s mutable fields (currently `name`) and returns it. OWNER-EXCLUSIVE: only the avatar’s owner may call this (throws Unauthorized otherwise). Requires a valid game token. To change state blobs use `updateAvatarState`. */
5595
5607
  updateAvatar: Avatar;
@@ -10226,6 +10238,10 @@ export type UpdateAppInput = {
10226
10238
  description?: InputMaybe<Scalars['String']['input']>;
10227
10239
  /** Seconds a realtime session may go without gameplay input before the replication server releases it with reason idle: 60 to 86400, or 0 to turn the timeout off. null returns the app to the platform default (900 seconds). Takes effect within about 15 seconds, for sessions already open too. Omit to leave unchanged. */
10228
10240
  idleTimeoutSeconds?: InputMaybe<Scalars['Int']['input']>;
10241
+ /** The most speakers whose webcam video one player's game may name in its speaker list: 1 to 32. A longer list is refused. null returns the app to 32. The realtime servers apply it within about 15 seconds, to lists already sent too. Omit to leave unchanged. */
10242
+ maxVideoSpeakers?: InputMaybe<Scalars['Int']['input']>;
10243
+ /** The most speakers whose spatial voice one player's game may name in its speaker list: 1 to 32. A longer list is refused. null returns the app to 32. The realtime servers apply it within about 15 seconds, to lists already sent too. Omit to leave unchanged. */
10244
+ maxVoiceSpeakers?: InputMaybe<Scalars['Int']['input']>;
10229
10245
  /** New JSON-encoded marketplace metadata string, replacing the existing value (see App.metadata). Omit to leave unchanged. */
10230
10246
  metadata?: InputMaybe<Scalars['String']['input']>;
10231
10247
  /** The youngest age the app admits, 13 to 18. It only ever raises the platform's minimum (18 until players 13 and over are admitted, then 13), never lowers it; younger players are refused AGE_REQUIREMENT_NOT_MET at their next mint or refresh. null returns the app to the platform's minimum. Omit to leave unchanged. */