@crowdedkingdoms/crowdyjs 18.4.1 → 18.6.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,60 @@ 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.6.0: the input log
124
+
125
+ Additive. An app with replay logging on has its client inputs recorded, and `client.inputLog`
126
+ reads them back on the app-scoped client:
127
+
128
+ ```ts
129
+ const { edges, pageInfo } = await game.inputLog.sessions(appId, { first: 20 });
130
+ let after: string | undefined;
131
+ do {
132
+ const page = await game.inputLog.messages(appId, edges[0].node.gameTokenId, { first: 200, after });
133
+ for (const { node } of page.edges) handle(node.messageType, decodeBase64(node.body));
134
+ after = page.pageInfo.endCursor ?? undefined;
135
+ if (!page.pageInfo.hasNextPage) break;
136
+ } while (after);
137
+ ```
138
+
139
+ A player reads only the sessions and inputs they sent; a holder of `manage_apps` on the app reads
140
+ every session. Keep paging while `hasNextPage` is true: a messages page can be short, or empty,
141
+ when it stopped at the server's time or scan limit. Inputs are kept for the published retention,
142
+ so an old session can still be listed after its inputs are gone. Both calls throw
143
+ `INPUT_LOG_UNAVAILABLE` on a deployment without input logging, and `messages` throws it, retryable
144
+ with the same cursor, when the log cannot be read right now.
145
+
146
+ `App.replayLoggingEnabled` is selected on every app read and set with `apps.update(appId,
147
+ { replayLoggingEnabled: true })` (`manage_apps`). Turning it on is refused with
148
+ `INPUT_LOG_FUNDS_NEEDED` unless the org's wallet has a spendable balance or the org is exempt from
149
+ billing, because stored input logs are billed (crowdedkingdoms.com/pricing). It needs ck-api with
150
+ the input log (`inputLogSessions`, `inputLogMessages`).
151
+
152
+ ## 18.5.0: channel messages limited by distance
153
+
154
+ Additive. `client.udp.sendRangedChannelMessage(input)` publishes to a channel like
155
+ `sendChannelMessage`, but only members near an origin chunk receive it: a member gets it when one of
156
+ its live actors is in `input.appId` within `input.maxDistance` chunks of `input.chunk`, measured as
157
+ the straight-line distance between chunk coordinates, boundary included. `maxDistance` is an integer
158
+ from 0 (the origin chunk only) to 2147483647; it is not the 0-8 Chebyshev ring count spatial sends
159
+ take. A member with no live actor does not receive it.
160
+
161
+ ```ts
162
+ await client.udp.sendRangedChannelMessage({
163
+ channelId,
164
+ uuid: self.uuid,
165
+ payload: encodeBase64(bytes),
166
+ appId,
167
+ chunk: { x: '10', y: '0', z: '-4' },
168
+ maxDistance: 6,
169
+ });
170
+ ```
171
+
172
+ Members receive the ordinary `channelMessage` notification, so receivers need no change and an older
173
+ SDK receives these messages too. The send right is the channel's `send_messages`, as for
174
+ `sendChannelMessage`; a refusal arrives as a `genericError` (`UNAUTHORIZED`, or `INVALID_APP_ID` when
175
+ `appId` is not the token's app). It needs ck-api with `sendRangedChannelMessage` and Buddy v0.35.0.
176
+
123
177
  ## 18.4.1: the generated types come from graphql-codegen 7
124
178
 
125
179
  No call changes, and the GraphQL documents the SDK sends are byte-for-byte the same. Thirteen types
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
  CrowdyJS targets browsers by default and uses native `fetch`, `WebSocket`,
29
33
  `crypto`, `btoa`, and `atob`. Node tools can still use the SDK, but must
30
34
  provide browser-compatible globals when opening realtime connections (e.g.
@@ -183,8 +187,8 @@ Notes:
183
187
  - Use `client.auth.setToken(token)` to seed a token externally (e.g. when
184
188
  restoring auth from a non-default storage).
185
189
 
186
- Deeper reading: [Portals & app-scoped tokens](https://docs.crowdedkingdoms.com/management-api/portals-and-app-tokens)
187
- and [Sign in](https://docs.crowdedkingdoms.com/management-api/authentication).
190
+ Deeper reading: [Portals & app-scoped tokens](https://docs.dev.crowdedkingdoms.com/management-api/portals-and-app-tokens)
191
+ and [Sign in](https://docs.dev.crowdedkingdoms.com/management-api/authentication).
188
192
 
189
193
  ### Token refresh during gameplay
190
194
 
@@ -239,13 +243,14 @@ never told about, so a native refresh without it is a re-placement.
239
243
  | `client.chunks`, `client.voxels`, `client.actors`, `client.avatars`, `client.state` | World data reads + writes: terrain/LODs, voxel edit + history/rollback, durable actors, avatars, per-user app state blobs. |
240
244
  | `client.host` | Game-host election (`get`, `amIHost`) + actor liveness `heartbeat`. `amIHost` is UI convenience only — a hub decides host-only actions from its caller. |
241
245
  | `client.teleport` | Teleport requests. |
246
+ | `client.inputLog` | The input log (18.6.0): `sessions(appId)` and `messages(appId, gameTokenId)` read the client inputs recorded for an app with replay logging on (`apps.update(appId, { replayLoggingEnabled: true })`). A player reads their own; `manage_apps` reads every session. Keep paging while `hasNextPage` is true. |
242
247
  | `client.channels`, `client.teams` | Messaging channels and app-scoped player teams (membership + roles). |
243
248
  | `client.exec` | **ck-exec:** an app's server code as hubs and spokes. `connect(appId, { nodeType, key })` opens a player's connection to an execution host; the `ExecConnection` it returns has `call`, `callRaw`, `subscribe`, `ping`, `onReconnect` and `close`, with MessagePack payloads, and it reconnects and renews subscriptions by itself. `starters` / `build` / `deploy` build and deploy an app (`manage_compute`); `logs`, `instances`, `versions`, `activateVersion` and `setEnabled` operate it; `mod*` are players' mods on grids they own, and `modClient*`, `gridClientMods`, `consentClientMod`, `trustAuthor`, `revokeClientModConsent` and `revokeAuthorTrust` their CLIENT halves. See [ck-exec](#ck-exec). |
244
249
  | `client.playerWallet` | Player spend: balance, ledger, hourly charges, spend caps, card setup, auto-recharge. A ck-exec mod's compute is billed here, to its owner. |
245
250
  | `client.marketplace` | Player-authorized grid claims (`claimGridOwnership`, `claimGridChunk`, `releaseClaimedGrid`, requests and invites) and studio moderation of player code (admission queue, listing administration, claim policy). Mods publish and install through `client.exec`. |
246
251
  | `client.crowdyStudio` | Cloud project, personal-library, and common-file APIs for Crowdy Studio: target-scoped files, metadata/module names, optimistic revisions, copy-by-value imports, atomic saves. |
247
252
  | `client.crowdyStudioGitHub` | Optional GitHub repository for a Crowdy Studio project: status, `bind` (push the project in, or take the repository), `unbind`, `refresh`, `layout`, `tree`, `getFile`, commit-guarded `putFile` / `deleteFile`. While bound the repository is the working tree and every Studio save commits; the project's `files` are the server's mirror at `github.sha`. Never required. |
248
- | `client.udp` | UDP proxy subscriptions + spatial mutations (`sendActorUpdate`, `sendVoxelUpdate`, `sendAudioPacket`, `sendVideoPacket` / `sendVideoFrame`, `sendTextPacket`, `sendClientEvent`, `sendSingleActorMessage`, `sendChannelMessage`). |
253
+ | `client.udp` | UDP proxy subscriptions + spatial mutations (`sendActorUpdate`, `sendVoxelUpdate`, `sendAudioPacket`, `sendVideoPacket` / `sendVideoFrame`, `sendTextPacket`, `sendClientEvent`, `sendSingleActorMessage`, `sendChannelMessage`, `sendRangedChannelMessage`). |
249
254
  | `client.realtime` | Connection status, manual `connect()` / `disconnect()`, `onStatus()` listener. |
250
255
  | `client.refreshGameplayToken()` | Safely rotates an active game client's app token (see [Token refresh](#token-refresh-during-gameplay)). |
251
256
  | `client.world(appId)` | Higher-level helpers for browser games (`actor.join`, `actor.sendState`, `actor.sendText`, `actor.sendToActor`). |
@@ -307,7 +312,7 @@ query AppForRouting($appId: BigInt!) {
307
312
  `CrowdyClient` with `httpUrl: gameApiUrl` (and the matching `wsUrl`) holding
308
313
  that app's app-scoped token, then drive gameplay through that client. Apps
309
314
  with no `gameApiUrl` keep working against the default `httpUrl` you
310
- configured. See [Loading an app's Game API](https://docs.crowdedkingdoms.com/crowdyjs/shared-environment-routing).
315
+ configured. See [Loading an app's Game API](https://docs.dev.crowdedkingdoms.com/crowdyjs/shared-environment-routing).
311
316
 
312
317
  ## Realtime notifications
313
318
 
@@ -440,7 +445,10 @@ The plain `sendActorUpdate`, `sendVoxelUpdate`, `sendAudioPacket`,
440
445
  result immediately. The `AndWait` variants allocate a `sequenceNumber` when
441
446
  one is missing and wait for either a matching notification or
442
447
  `GenericErrorResponse`. `sendChannelMessage` broadcasts an opaque payload on a
443
- channel.
448
+ channel. `sendRangedChannelMessage` publishes on a channel too, but only members
449
+ with a live actor within `maxDistance` chunks (straight-line distance between
450
+ chunk coordinates) of `chunk` receive it; they get the same `channelMessage`
451
+ notification.
444
452
 
445
453
  ### Bundled sends on the binary relay
446
454
 
@@ -618,7 +626,7 @@ reach your bundle. Reads are synchronous snapshots and writes happen on
618
626
  WebSocket events (not `requestAnimationFrame`), so render loops read freely
619
627
  and a backgrounded tab keeps ingesting updates; pass `workerTicker()` to also
620
628
  keep timer-driven sends at full rate while hidden. See the
621
- [World Stores guide](https://docs.crowdedkingdoms.com/crowdyjs/stores).
629
+ [World Stores guide](https://docs.dev.crowdedkingdoms.com/crowdyjs/stores).
622
630
 
623
631
  ## Game Kit
624
632
 
@@ -701,7 +709,7 @@ exec.onReconnect((host) => console.log('moved to', host));
701
709
 
702
710
  Integers above 2^53 decode as `number` and lose precision unless you pass
703
711
  `{ decode: { useBigInt64: true } }`. The wire format is in the
704
- [ck-exec docs](https://docs.crowdedkingdoms.com/exec/intro).
712
+ [ck-exec docs](https://docs.dev.crowdedkingdoms.com/exec/intro).
705
713
 
706
714
  ### A mod's CLIENT half
707
715
 
@@ -772,7 +780,7 @@ counts what was dropped); `invoke` sends at most 256 KiB each way and is refused
772
780
  module is not running. `NOT_FOUND` holds a CLIENT half back 15 s and `RATE_LIMITED` 60 s. The
773
781
  grid's owner is asked about their own CLIENT halves like anyone; answer yes in `confirm` when
774
782
  `prompt.authorId` is the player. See
775
- [CLIENT halves](https://docs.crowdedkingdoms.com/exec/client-halves).
783
+ [CLIENT halves](https://docs.dev.crowdedkingdoms.com/exec/client-halves).
776
784
 
777
785
  ## Hosting a game on Crowdy Games
778
786
 
@@ -891,8 +899,8 @@ CLIENT project needs ck-api `v2.25.1` or later. A CLIENT crate still on the lega
891
899
  `mountCrowdyStudio` and the controller take `mods: client.exec`. Crowdy Studio runs nothing
892
900
  on legacy player compute since 18.0.0.
893
901
 
894
- See [CLIENT halves](https://docs.crowdedkingdoms.com/exec/client-halves), [mods](https://docs.crowdedkingdoms.com/exec/mods)
895
- and [Embed Crowdy Studio in your game](https://docs.crowdedkingdoms.com/crowdyjs/crowdy-studio-embed).
902
+ See [CLIENT halves](https://docs.dev.crowdedkingdoms.com/exec/client-halves), [mods](https://docs.dev.crowdedkingdoms.com/exec/mods)
903
+ and [Embed Crowdy Studio in your game](https://docs.dev.crowdedkingdoms.com/crowdyjs/crowdy-studio-embed).
896
904
 
897
905
  ### The Studio agent (DeepSeek Harness in the browser)
898
906
 
@@ -1071,7 +1079,7 @@ no other repositories and no network access required:
1071
1079
  `src/generated/graphql-schema.ts`, the generated schema types.
1072
1080
 
1073
1081
  Schema refresh is explicit, from the published
1074
- [SDL](https://docs.crowdedkingdoms.com/schema/game-api.graphql):
1082
+ [SDL](https://docs.dev.crowdedkingdoms.com/schema/game-api.graphql):
1075
1083
 
1076
1084
  ```bash
1077
1085
  npm run schema:sync:prod
@@ -51,6 +51,7 @@ export declare const WireMessageType: {
51
51
  readonly GENERIC_ERROR_MESSAGE: 3;
52
52
  readonly CHANNEL_MESSAGE_REQUEST: 17;
53
53
  readonly CHANNEL_MESSAGE_NOTIFICATION: 18;
54
+ readonly CHANNEL_MESSAGE_RANGED_REQUEST: 32;
54
55
  readonly ACTOR_UPDATE_REQUEST_2: 128;
55
56
  readonly ACTOR_UPDATE_RESPONSE_2: 129;
56
57
  readonly ACTOR_UPDATE_NOTIFICATION_2: 130;
@@ -158,6 +159,27 @@ export declare function serializeChannelMessage(ctx: RelaySignContext, input: {
158
159
  payload?: string | null;
159
160
  sequenceNumber?: number | null;
160
161
  }): Promise<Uint8Array>;
162
+ /** Largest `maxDistance` a ranged channel message may carry (the GraphQL `Int` ceiling). */
163
+ export declare const CHANNEL_RANGED_MAX_DISTANCE = 2147483647;
164
+ /**
165
+ * CHANNEL_MESSAGE_RANGED_REQUEST (Buddy v0.35.0):
166
+ * `[1B type=32][8B channelId][32B uuid][8B appId][8B chunkX][8B chunkY][8B chunkZ]
167
+ * [4B maxDistance u32][2B payloadLen][payload][1B containsAuth][32B HMAC]
168
+ * [8B gameTokenId][1B seq]` — HMAC over everything before it, as for 17.
169
+ */
170
+ export declare function serializeRangedChannelMessage(ctx: RelaySignContext, input: {
171
+ channelId: string;
172
+ uuid: string;
173
+ payload?: string | null;
174
+ appId: string;
175
+ chunk: {
176
+ x: string;
177
+ y: string;
178
+ z: string;
179
+ };
180
+ maxDistance: number;
181
+ sequenceNumber?: number | null;
182
+ }): Promise<Uint8Array>;
161
183
  /**
162
184
  * Parse one relay BINARY frame (one Buddy datagram, possibly a
163
185
  * MESSAGE_BUNDLE) into notification objects. Unparseable inner messages are
@@ -1 +1 @@
1
- {"version":3,"file":"binary-wire.d.ts","sourceRoot":"","sources":["../src/binary-wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,eAAO,MAAM,wBAAwB,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88
88
  CHANNEL_MESSAGE_NOTIFICATION: 18,
89
+ // Buddy v0.35.0: a channel publish only members near an origin chunk receive
90
+ // (they get an ordinary CHANNEL_MESSAGE_NOTIFICATION).
91
+ CHANNEL_MESSAGE_RANGED_REQUEST: 32,
89
92
  ACTOR_UPDATE_REQUEST_2: 128,
90
93
  ACTOR_UPDATE_RESPONSE_2: 129,
91
94
  ACTOR_UPDATE_NOTIFICATION_2: 130,
@@ -322,6 +325,62 @@ export async function serializeChannelMessage(ctx, input) {
322
325
  tail.setUint8(prefixLen + HMAC_SIZE + 8, (input.sequenceNumber ?? 0) & 0xff);
323
326
  return out;
324
327
  }
328
+ /** Largest `maxDistance` a ranged channel message may carry (the GraphQL `Int` ceiling). */
329
+ export const CHANNEL_RANGED_MAX_DISTANCE = 0x7fffffff;
330
+ /**
331
+ * CHANNEL_MESSAGE_RANGED_REQUEST (Buddy v0.35.0):
332
+ * `[1B type=32][8B channelId][32B uuid][8B appId][8B chunkX][8B chunkY][8B chunkZ]
333
+ * [4B maxDistance u32][2B payloadLen][payload][1B containsAuth][32B HMAC]
334
+ * [8B gameTokenId][1B seq]` — HMAC over everything before it, as for 17.
335
+ */
336
+ export async function serializeRangedChannelMessage(ctx, input) {
337
+ const payload = input.payload ? decodeBase64(input.payload) : new Uint8Array(0);
338
+ if (payload.length > 1024) {
339
+ throw new Error(`Channel payload exceeds 1024 bytes: ${payload.length}`);
340
+ }
341
+ if (!Number.isInteger(input.maxDistance) ||
342
+ input.maxDistance < 0 ||
343
+ input.maxDistance > CHANNEL_RANGED_MAX_DISTANCE) {
344
+ throw new Error(`maxDistance must be an integer from 0 to ${CHANNEL_RANGED_MAX_DISTANCE}: ${input.maxDistance}`);
345
+ }
346
+ const uuidBytes = textEncoder.encode(input.uuid);
347
+ if (uuidBytes.length !== UUID_SIZE) {
348
+ throw new Error(`Invalid uuid length: must be exactly ${UUID_SIZE} bytes when UTF-8 encoded. Received ${uuidBytes.length} bytes.`);
349
+ }
350
+ const prefixLen = 1 + 8 + UUID_SIZE + 32 + 4 + 2 + payload.length + 1;
351
+ const prefix = new Uint8Array(prefixLen);
352
+ const view = new DataView(prefix.buffer);
353
+ let off = 0;
354
+ view.setUint8(off, WireMessageType.CHANNEL_MESSAGE_RANGED_REQUEST);
355
+ off += 1;
356
+ view.setBigUint64(off, BigInt(input.channelId), true);
357
+ off += 8;
358
+ prefix.set(uuidBytes, off);
359
+ off += UUID_SIZE;
360
+ view.setBigInt64(off, BigInt(input.appId), true);
361
+ off += 8;
362
+ view.setBigInt64(off, BigInt(input.chunk.x), true);
363
+ off += 8;
364
+ view.setBigInt64(off, BigInt(input.chunk.y), true);
365
+ off += 8;
366
+ view.setBigInt64(off, BigInt(input.chunk.z), true);
367
+ off += 8;
368
+ view.setUint32(off, input.maxDistance, true);
369
+ off += 4;
370
+ view.setUint16(off, payload.length, true);
371
+ off += 2;
372
+ prefix.set(payload, off);
373
+ off += payload.length;
374
+ view.setUint8(off, 1); // containsAuth
375
+ const hmac = await signWithToken(ctx, prefix);
376
+ const out = new Uint8Array(prefixLen + HMAC_SIZE + 8 + 1);
377
+ out.set(prefix, 0);
378
+ out.set(hmac, prefixLen);
379
+ const tail = new DataView(out.buffer);
380
+ tail.setBigUint64(prefixLen + HMAC_SIZE, ctx.gameTokenId, true);
381
+ tail.setUint8(prefixLen + HMAC_SIZE + 8, (input.sequenceNumber ?? 0) & 0xff);
382
+ return out;
383
+ }
325
384
  function stripNulls(value) {
326
385
  return value.replace(/\0/g, '');
327
386
  }
@@ -51,6 +51,7 @@ import { GameAppsAPI } from './domains/gameApps.js';
51
51
  import { VoxelsAPI } from './domains/voxels.js';
52
52
  import { ActorsAPI } from './domains/actors.js';
53
53
  import { TeleportAPI } from './domains/teleport.js';
54
+ import { InputLogAPI } from './domains/inputLog.js';
54
55
  import { StateAPI } from './domains/state.js';
55
56
  import { ServerStatusAPI } from './domains/serverStatus.js';
56
57
  import { ChannelsAPI } from './domains/channels.js';
@@ -267,6 +268,8 @@ export declare class CrowdyClient {
267
268
  readonly actors: ActorsAPI;
268
269
  /** Teleport: move an actor to a destination chunk/world. */
269
270
  readonly teleport: TeleportAPI;
271
+ /** The input log: recorded client inputs of an app with replay logging on. */
272
+ readonly inputLog: InputLogAPI;
270
273
  /** Per-user/per-app persisted state blobs. */
271
274
  readonly state: StateAPI;
272
275
  /** Server status + version discovery (UDP availability, version floors). */
@@ -1 +1 @@
1
- {"version":3,"file":"crowdy-client.d.ts","sourceRoot":"","sources":["../src/crowdy-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAK5C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,SAAS,EACT,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM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C,QAAQ,EAAE,WAAW,CAAC;gBAEnB,MAAM,GAAE,kBAAuB;IAwM3C,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAIpC,0DAA0D;IAC1D,QAAQ,IAAI,MAAM,GAAG,IAAI;IAIzB;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,oBAAoB,IAAI,OAAO,CAAC,gBAAgB,CAAC;YAczC,2BAA2B;IAezC;;;;OAIG;IACG,2BAA2B,IAAI,OAAO,CAAC,IAAI,CAAC;IASlD;;;;;;;OAOG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW;IAIjC;;;;;;;OAOG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS;IAI7D;;;;;;OAMG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,aAAa;IAQ3D,gEAAgE;IAChE,KAAK,IAAI,IAAI;IAMb,yDAAyD;IACzD,IAAI,eAAe,IAAI,MAAM,CAE5B;CACF;AAED,wBAAgB,kBAAkB,CAChC,MAAM,GAAE,kBAAuB,GAC9B,YAAY,CAEd"}
@@ -52,6 +52,7 @@ import { GameAppsAPI } from './domains/gameApps.js';
52
52
  import { VoxelsAPI } from './domains/voxels.js';
53
53
  import { ActorsAPI } from './domains/actors.js';
54
54
  import { TeleportAPI } from './domains/teleport.js';
55
+ import { InputLogAPI } from './domains/inputLog.js';
55
56
  import { StateAPI } from './domains/state.js';
56
57
  import { ServerStatusAPI } from './domains/serverStatus.js';
57
58
  import { ChannelsAPI } from './domains/channels.js';
@@ -203,6 +204,7 @@ export class CrowdyClient {
203
204
  this.voxels = new VoxelsAPI(this.graphql);
204
205
  this.actors = new ActorsAPI(this.graphql);
205
206
  this.teleport = new TeleportAPI(this.graphql);
207
+ this.inputLog = new InputLogAPI(this.graphql);
206
208
  this.state = new StateAPI(this.graphql);
207
209
  this.serverStatus = new ServerStatusAPI(this.graphql);
208
210
  this.channels = new ChannelsAPI(this.graphql);
@@ -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';
@@ -218,11 +218,17 @@ export declare class AppsAPI {
218
218
  * world grid covers): every voxel and chunk write there is refused with `FORBIDDEN`,
219
219
  * whoever makes it, within 15 seconds on every game API replica. Apps start open.
220
220
  *
221
+ * `replayLoggingEnabled: true` turns on replay logging: the realtime servers record
222
+ * every client input they accept for the app, readable with `client.inputLog` and
223
+ * billed as stored input logs (crowdedkingdoms.com/pricing). Apps start with it off
224
+ * ("No replication logging"), and recording stops shortly after it is turned off.
225
+ *
221
226
  * @param appId - Numeric app id.
222
227
  * @param input - {@link UpdateAppInput} fields to change.
223
228
  * @returns The updated {@link App}.
224
229
  * @throws {CrowdyGraphQLError} `FORBIDDEN`/`SCOPE_MISSING` without
225
- * `manage_apps`.
230
+ * `manage_apps`, or `INPUT_LOG_FUNDS_NEEDED` when turning replay logging on for
231
+ * an org whose wallet has no spendable balance (a billing-exempt org needs none).
226
232
  */
227
233
  update(appId: string, input: UpdateAppInput): Promise<UpdateAppMutation['updateApp']>;
228
234
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/domains/apps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAgBL,KAAK,QAAQ,EAEb,KAAK,cAAc,EAEnB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EACjC,KA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CAAC;KAC7C,GACL,OAAO,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAKxC;;;;;;;OAOG;IACG,qBAAqB,CACzB,IAAI,GAAE,4BAAiC,GACtC,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAKjD;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,oBAAoB,IAAI,OAAO,CACnC,yBAAyB,CAAC,sBAAsB,CAAC,CAClD;IAKD;;;;;;;;;;;;;;OAcG;IACG,MAAM,CACV,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAK1C;;;;;;;;;;;;;;;;;;OAkBG;IACG,MAAM,CACV,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAQ1C;;;;;;;OAOG;IACG,OAAO,CACX,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;CAI7C"}
@@ -256,11 +256,17 @@ export class AppsAPI {
256
256
  * world grid covers): every voxel and chunk write there is refused with `FORBIDDEN`,
257
257
  * whoever makes it, within 15 seconds on every game API replica. Apps start open.
258
258
  *
259
+ * `replayLoggingEnabled: true` turns on replay logging: the realtime servers record
260
+ * every client input they accept for the app, readable with `client.inputLog` and
261
+ * billed as stored input logs (crowdedkingdoms.com/pricing). Apps start with it off
262
+ * ("No replication logging"), and recording stops shortly after it is turned off.
263
+ *
259
264
  * @param appId - Numeric app id.
260
265
  * @param input - {@link UpdateAppInput} fields to change.
261
266
  * @returns The updated {@link App}.
262
267
  * @throws {CrowdyGraphQLError} `FORBIDDEN`/`SCOPE_MISSING` without
263
- * `manage_apps`.
268
+ * `manage_apps`, or `INPUT_LOG_FUNDS_NEEDED` when turning replay logging on for
269
+ * an org whose wallet has no spendable balance (a billing-exempt org needs none).
264
270
  */
265
271
  async update(appId, input) {
266
272
  const data = await this.api.request(UpdateAppDocument, {
@@ -0,0 +1,74 @@
1
+ import type { GraphQLClient } from '../client.js';
2
+ import { type InputLogMessageFilter, type InputLogMessagesQuery, type InputLogSessionFilter, type InputLogSessionsQuery } from '../generated/graphql.js';
3
+ /** One page of {@link InputLogAPI.sessions}. */
4
+ export type InputLogSessionPage = InputLogSessionsQuery['inputLogSessions'];
5
+ /** One recorded session, as {@link InputLogAPI.sessions} returns it. */
6
+ export type InputLogSessionRecord = InputLogSessionPage['edges'][number]['node'];
7
+ /** One page of {@link InputLogAPI.messages}. */
8
+ export type InputLogMessagePage = InputLogMessagesQuery['inputLogMessages'];
9
+ /** One recorded input, as {@link InputLogAPI.messages} returns it. */
10
+ export type InputLogMessageRecord = InputLogMessagePage['edges'][number]['node'];
11
+ /** Paging and filters for {@link InputLogAPI.sessions} and {@link InputLogAPI.messages}. */
12
+ export interface InputLogPageOptions<Filter> {
13
+ /** Page size. The server defaults to 50 and clamps to 1..200. */
14
+ first?: number;
15
+ /** A previous page's `pageInfo.endCursor`; omit for the first page. */
16
+ after?: string;
17
+ filter?: Filter;
18
+ }
19
+ /**
20
+ * The input log: the client inputs the realtime servers recorded for an app with
21
+ * replay logging on (`App.replayLoggingEnabled`, set with {@link AppsAPI.update}).
22
+ * Exposed as `client.inputLog`.
23
+ *
24
+ * **Game plane.** Call it on the app-scoped client for the app (`portal.mintAppToken`
25
+ * or hosted sign-in). An identity session token is refused, and the client follows
26
+ * the app to its datacenter like any gameplay call.
27
+ *
28
+ * **Who sees what.** A player reads only the sessions and inputs they sent. A holder of
29
+ * `manage_apps` on the app reads every session and may filter by `userId`.
30
+ *
31
+ * Inputs are kept for the input log's published retention (crowdedkingdoms.com/pricing)
32
+ * and then deleted, so an old session can still be listed after its inputs are gone.
33
+ * Without input logging on the deployment, both calls throw
34
+ * {@link CrowdyGraphQLError} `INPUT_LOG_UNAVAILABLE`; `messages` also throws it, retryable
35
+ * with the same cursor, when the log cannot be read right now.
36
+ */
37
+ export declare class InputLogAPI {
38
+ private gql;
39
+ constructor(gql: GraphQLClient);
40
+ /**
41
+ * Recorded sessions of an app, newest first. A session is one game token's inputs.
42
+ *
43
+ * @param appId - Numeric app id.
44
+ * @param opts - Paging, and {@link InputLogSessionFilter}: `userId` (another user's
45
+ * needs `manage_apps`), `from` / `to`, and `messageType` (sessions containing it).
46
+ * @returns One page: `edges[].node` are the sessions, `pageInfo.endCursor` the next
47
+ * page's `after`, `totalCount` the matching sessions.
48
+ * @throws {CrowdyGraphQLError} `FORBIDDEN` for another user's sessions without
49
+ * `manage_apps`, or `INPUT_LOG_UNAVAILABLE`.
50
+ */
51
+ sessions(appId: string, opts?: InputLogPageOptions<InputLogSessionFilter>): Promise<InputLogSessionPage>;
52
+ /**
53
+ * The recorded inputs of one session, oldest first, each as the client sent it.
54
+ *
55
+ * `body` is the message in base64, from its type byte up to its authentication tail,
56
+ * which is not recorded (`decodeBase64` gives the bytes). `sizeBytes` is what stored
57
+ * input logs are billed on. Spatial inputs also carry their chunk and actor, and
58
+ * channel inputs their channel.
59
+ *
60
+ * **Keep paging while `pageInfo.hasNextPage` is true.** A page can hold fewer than
61
+ * `first` inputs, or none, when it reached the server's time or scan limit.
62
+ *
63
+ * @param appId - Numeric app id.
64
+ * @param gameTokenId - The session: {@link InputLogSessionRecord.gameTokenId}.
65
+ * @param opts - Paging, and {@link InputLogMessageFilter}: `from` / `to`, and
66
+ * `messageTypes` (at most 64).
67
+ * @returns One page of inputs.
68
+ * @throws {CrowdyGraphQLError} `NOT_FOUND` for a session that is not yours without
69
+ * `manage_apps`, `BAD_USER_INPUT` for a cursor from another session, or
70
+ * `INPUT_LOG_UNAVAILABLE`.
71
+ */
72
+ messages(appId: string, gameTokenId: string, opts?: InputLogPageOptions<InputLogMessageFilter>): Promise<InputLogMessagePage>;
73
+ }
74
+ //# sourceMappingURL=inputLog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inputLog.d.ts","sourceRoot":"","sources":["../../src/domains/inputLog.ts"],"names":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