@crowdedkingdoms/crowdyjs 18.27.0 → 18.29.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.
Files changed (37) hide show
  1. package/MIGRATION.md +41 -0
  2. package/README.md +21 -15
  3. package/dist/binary-wire.d.ts +1 -0
  4. package/dist/binary-wire.d.ts.map +1 -1
  5. package/dist/binary-wire.js +14 -0
  6. package/dist/default-origin.d.ts +6 -6
  7. package/dist/default-origin.d.ts.map +1 -1
  8. package/dist/default-origin.js +6 -6
  9. package/dist/domains/chunks.d.ts +24 -15
  10. package/dist/domains/chunks.d.ts.map +1 -1
  11. package/dist/domains/chunks.js +24 -15
  12. package/dist/domains/gameApps.d.ts +7 -4
  13. package/dist/domains/gameApps.d.ts.map +1 -1
  14. package/dist/domains/gameApps.js +7 -4
  15. package/dist/domains/voxels.d.ts +22 -16
  16. package/dist/domains/voxels.d.ts.map +1 -1
  17. package/dist/domains/voxels.js +22 -16
  18. package/dist/generated/graphql-schema.d.ts +62 -28
  19. package/dist/generated/graphql-schema.d.ts.map +1 -1
  20. package/dist/generated/graphql.d.ts +10 -0
  21. package/dist/generated/graphql.d.ts.map +1 -1
  22. package/dist/generated/graphql.js +2 -2
  23. package/dist/index.d.ts +2 -2
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +1 -1
  26. package/dist/live-coding/assets/browser-authoring-index.json +1 -1
  27. package/dist/live-coding/assets/manifest.json +1 -1
  28. package/dist/live-coding/browser-authoring-index.generated.d.ts.map +1 -1
  29. package/dist/live-coding/browser-authoring-index.generated.js +101 -10
  30. package/dist/realtime.d.ts +7 -0
  31. package/dist/realtime.d.ts.map +1 -1
  32. package/dist/realtime.js +4 -0
  33. package/dist/stores/session.d.ts.map +1 -1
  34. package/dist/stores/session.js +1 -0
  35. package/dist/types.d.ts +26 -1
  36. package/dist/types.d.ts.map +1 -1
  37. package/package.json +1 -1
@@ -1800,6 +1800,24 @@ export type Chunk = {
1800
1800
  /** BASE64-encoded binary blob of the dense voxel-type grid. When present, the DECODED buffer is exactly 4096 bytes: one unsigned byte (voxel type 0-255) per voxel, indexed as x + y*16 + z*256 with x,y,z in 0-15. Null when the chunk has no voxel grid yet. Decode from base64 before reading. */
1801
1801
  voxels: Maybe<Scalars['String']['output']>;
1802
1802
  };
1803
+ /** A chunk near you was replaced as a whole (a hub's or mod's world.set_chunk; Buddy v0.45.0): read it again with getChunk, or getChunksByDistance with since. It comes instead of a voxel update per voxel. Received via the udpNotifications subscription. */
1804
+ export type ChunkChangedNotification = {
1805
+ __typename?: 'ChunkChangedNotification';
1806
+ /** The ID of the app the chunk is in. */
1807
+ appId: Scalars['BigInt']['output'];
1808
+ /** The X coordinate of the replaced chunk. */
1809
+ chunkX: Scalars['BigInt']['output'];
1810
+ /** The Y coordinate of the replaced chunk. */
1811
+ chunkY: Scalars['BigInt']['output'];
1812
+ /** The Z coordinate of the replaced chunk. */
1813
+ chunkZ: Scalars['BigInt']['output'];
1814
+ /** Chunk replication distance (0-8) the notification was fanned out over. */
1815
+ distance: Scalars['Int']['output'];
1816
+ /** Correlation byte from the datagram tail (always 0 today). */
1817
+ sequenceNumber: Scalars['Int']['output'];
1818
+ /** The stored chunk's new updatedAt, in epoch milliseconds: a copy at least this new is current. */
1819
+ updatedAtMs: Scalars['BigInt']['output'];
1820
+ };
1803
1821
  /** Authoritative result of an ordinary player claiming one chunk as a new grid under SELF_CLAIM. Grid creation, title assignment, and direct ACL grants are committed atomically. */
1804
1822
  export type ChunkClaimResult = {
1805
1823
  __typename?: 'ChunkClaimResult';
@@ -1883,9 +1901,9 @@ export type ChunksByDistanceResponse = {
1883
1901
  __typename?: 'ChunksByDistanceResponse';
1884
1902
  /** Chunks found within the search cube. */
1885
1903
  chunks: Array<Chunk>;
1886
- /** Echo of the `limit` applied to this page, or null if none was supplied. */
1904
+ /** The `limit` applied to this page: the one asked for, or 1000 when none (or 0) was. */
1887
1905
  limit: Maybe<Scalars['Int']['output']>;
1888
- /** Echo of the `skip` applied to this page, or null if none was supplied. */
1906
+ /** The `skip` applied to this page: the one asked for, or 0. */
1889
1907
  skip: Maybe<Scalars['Int']['output']>;
1890
1908
  };
1891
1909
  /** Claim (or re-assert) the hosting slug for an app. */
@@ -4140,20 +4158,26 @@ export type GetChunkLodsInput = {
4140
4158
  /** LOD levels to return (each >= 0; 0 is the finest). Only matching levels are included in the response. */
4141
4159
  lodLevels: Array<Scalars['Int']['input']>;
4142
4160
  };
4143
- /** Arguments for getChunksByDistance: selects chunks within a cubic (Chebyshev-distance) radius around a center chunk, with pagination. */
4161
+ /** Arguments for getChunksByDistance: selects the stored chunks in a region, either a cube (centerCoordinate and maxDistance) or a box (lowChunk and highChunk), with pagination. A cube is ordered by Chebyshev distance from its center, then x, y, z; a box by x, y, z. */
4144
4162
  export type GetChunksByDistanceInput = {
4145
4163
  /** Id of the app whose chunks to search (decimal string). */
4146
4164
  appId: Scalars['BigInt']['input'];
4147
- /** Center chunk of the search cube. */
4148
- centerCoordinate: ChunkCoordinatesInput;
4149
- /** Maximum number of chunks to return. Defaults to 1000 when omitted. Must be >= 0. */
4165
+ /** Center chunk of the search cube. With maxDistance; leave both out to search a box (lowChunk and highChunk) instead. */
4166
+ centerCoordinate?: InputMaybe<ChunkCoordinatesInput>;
4167
+ /** The opposite corner of the search box, with lowChunk; both corners are inclusive. */
4168
+ highChunk?: InputMaybe<ChunkCoordinatesInput>;
4169
+ /** Maximum number of chunks to return. Defaults to 1000 when omitted or 0; a cube at maxDistance 8 holds up to 4,913. Must be >= 0. */
4150
4170
  limit?: InputMaybe<Scalars['Int']['input']>;
4151
- /** Cube 'radius' in chunks measured as Chebyshev distance: matches chunks whose x, y and z each differ from the center by at most this many chunks (a (2*maxDistance+1)^3 cube). Integer, 1-8 inclusive. */
4152
- maxDistance: Scalars['Int']['input'];
4171
+ /** One corner of a search box, with highChunk, instead of a cube: for streaming only the slab a step uncovers. Corners are normalized per axis, and the box may cover at most 4,913 chunks (the cube maxDistance 8 reads). */
4172
+ lowChunk?: InputMaybe<ChunkCoordinatesInput>;
4173
+ /** Cube 'radius' in chunks measured as Chebyshev distance: matches chunks whose x, y and z each differ from the center by at most this many chunks (a (2*maxDistance+1)^3 cube). Integer, 1-8 inclusive. With centerCoordinate. */
4174
+ maxDistance?: InputMaybe<Scalars['Int']['input']>;
4175
+ /** Optional inclusive lower time bound: only chunks whose updatedAt is at or after it, i.e. chunks whose stored grid, chunk state or LODs were written since (updateChunk, updateChunkState, updateChunkLods). Single voxel edits do not move a chunk's updatedAt; read those with listVoxelUpdatesByDistance's since. */
4176
+ since?: InputMaybe<Scalars['DateTime']['input']>;
4153
4177
  /** Number of chunks to skip for pagination. Defaults to 0 when omitted. Must be >= 0. */
4154
4178
  skip?: InputMaybe<Scalars['Int']['input']>;
4155
4179
  };
4156
- /** Arguments for getVoxelList: selects all recorded voxel edits for one chunk by app id and chunk coordinates. */
4180
+ /** Arguments for getVoxelList: selects the recorded voxel edits for one chunk by app id and chunk coordinates, by position and at most 65,536 of them (listVoxels pages past that). */
4157
4181
  export type GetVoxelListInput = {
4158
4182
  /** Id of the app that owns the chunk (decimal string). */
4159
4183
  appId: Scalars['BigInt']['input'];
@@ -4755,29 +4779,37 @@ export type LinkIdentityInput = {
4755
4779
  provider: Scalars['String']['input'];
4756
4780
  state: Scalars['String']['input'];
4757
4781
  };
4758
- /** Arguments for listVoxelUpdatesByDistance: selects recorded voxel edits across chunks within a cubic (Chebyshev) radius of a center chunk, grouped per chunk and ordered by increasing distance. */
4782
+ /** Arguments for listVoxelUpdatesByDistance: selects recorded voxel edits across the chunks of a region, either a cube (centerCoordinate and maxDistance) or a box (lowChunk and highChunk), grouped per chunk. A cube is ordered by increasing Chebyshev distance, then x, y, z; a box by x, y, z. Edits are returned for chunks whose grid was never stored too. */
4759
4783
  export type ListVoxelUpdatesByDistanceInput = {
4760
4784
  /** Id of the app whose voxel edits to search (decimal string). */
4761
4785
  appId: Scalars['BigInt']['input'];
4762
- /** Center chunk of the search cube. */
4763
- centerCoordinate: ChunkCoordinatesInput;
4764
- /** Maximum number of CHUNKS (not voxels) to include. Defaults to 1000 when omitted. Must be >= 0. */
4786
+ /** Center chunk of the search cube. With maxDistance; leave both out to search a box (lowChunk and highChunk) instead. */
4787
+ centerCoordinate?: InputMaybe<ChunkCoordinatesInput>;
4788
+ /** The opposite corner of the search box, with lowChunk; both corners are inclusive. */
4789
+ highChunk?: InputMaybe<ChunkCoordinatesInput>;
4790
+ /** Maximum number of CHUNKS (not voxels) to include. Defaults to 1000 when omitted or 0. Must be >= 0. */
4765
4791
  limit?: InputMaybe<Scalars['Int']['input']>;
4766
- /** Cube radius in chunks measured as Chebyshev distance: matches chunks whose x, y and z each differ from the center by at most this many chunks. Integer, 1-8 inclusive. */
4767
- maxDistance: Scalars['Int']['input'];
4792
+ /** One corner of a search box, with highChunk, instead of a cube. Corners are normalized per axis, and the box may cover at most 4,913 chunks (the cube maxDistance 8 reads). */
4793
+ lowChunk?: InputMaybe<ChunkCoordinatesInput>;
4794
+ /** Cube radius in chunks measured as Chebyshev distance: matches chunks whose x, y and z each differ from the center by at most this many chunks. Integer, 1-8 inclusive. With centerCoordinate. */
4795
+ maxDistance?: InputMaybe<Scalars['Int']['input']>;
4768
4796
  /** Optional inclusive lower time bound; only edits with createdAt >= this timestamp are returned. */
4769
4797
  since?: InputMaybe<Scalars['DateTime']['input']>;
4770
4798
  /** Number of chunks to skip for pagination. Defaults to 0 when omitted. Must be >= 0. */
4771
4799
  skip?: InputMaybe<Scalars['Int']['input']>;
4772
4800
  };
4773
- /** Arguments for listVoxels: selects recorded voxel edits for one chunk, optionally only those at/after a timestamp. */
4801
+ /** Arguments for listVoxels: selects the recorded voxel edits of one chunk, ordered by voxel position (x, then y, then z), optionally only those at/after a timestamp, a page at a time. */
4774
4802
  export type ListVoxelsInput = {
4775
4803
  /** Id of the app that owns the chunk (decimal string). */
4776
4804
  appId: Scalars['BigInt']['input'];
4777
4805
  /** Address of the chunk whose voxel edits to list. */
4778
4806
  coordinates: ChunkCoordinatesInput;
4807
+ /** Most edits to return, 1-65,536 (the default). A page shorter than the limit is the last; read the next with skip. */
4808
+ limit?: InputMaybe<Scalars['Int']['input']>;
4779
4809
  /** Optional inclusive lower time bound. When set, only voxel edits with createdAt >= this timestamp are returned. */
4780
4810
  since?: InputMaybe<Scalars['DateTime']['input']>;
4811
+ /** Edits to skip, for the next page. Defaults to 0. */
4812
+ skip?: InputMaybe<Scalars['Int']['input']>;
4781
4813
  };
4782
4814
  /** A single level-of-detail (LOD) representation of a chunk. */
4783
4815
  export type LodData = {
@@ -6342,7 +6374,7 @@ export type MyTierAccess = {
6342
6374
  /** Why access is granted: platform_role, operator_grant, provisioning or verified_email. */
6343
6375
  via: Maybe<Scalars['String']['output']>;
6344
6376
  };
6345
- /** A grid overlapping a scanned region (returned by nearbyGrids). Bounds only — no permission keys. */
6377
+ /** A grid overlapping a scanned region (returned by nearbyGrids): its bounds and the caller's own permission keys on it. */
6346
6378
  export type NearbyGrid = {
6347
6379
  __typename?: 'NearbyGrid';
6348
6380
  /** The app (tenant) that owns the grid. */
@@ -6353,6 +6385,8 @@ export type NearbyGrid = {
6353
6385
  highChunk: ChunkCoordinates;
6354
6386
  /** Low (minimum) corner chunk of the grid box. */
6355
6387
  lowChunk: ChunkCoordinates;
6388
+ /** The caller's own unexpired permission keys on this grid, sorted; empty when none. These are the grants the server checks: a voxel edit needs update_voxel_data on the grid that decides its chunk. */
6389
+ permissionKeys: Array<Scalars['String']['output']>;
6356
6390
  };
6357
6391
  /** A grid overlapping a scanned region, plus a user's effective permission keys on it (returned by nearbyGridPermissions). */
6358
6392
  export type NearbyGridPermissions = {
@@ -6381,7 +6415,7 @@ export type NearbyGridPermissionsInput = {
6381
6415
  /** The user whose effective permissions to report per grid. */
6382
6416
  userId: Scalars['BigInt']['input'];
6383
6417
  };
6384
- /** Scan a region for grids. Player-safe: returns bounds only, no permission keys and no impersonation userId. */
6418
+ /** Scan a region for grids. Player-safe: returns each grid's bounds and the caller's own permission keys, and takes no userId. */
6385
6419
  export type NearbyGridsInput = {
6386
6420
  /** The app (tenant) to scan within. */
6387
6421
  appId: Scalars['BigInt']['input'];
@@ -7509,7 +7543,7 @@ export type Query = {
7509
7543
  getChunk: Maybe<Chunk>;
7510
7544
  /** Fetches only the requested level-of-detail (LOD) meshes for one chunk, identified by app id and coordinates. Returns null if the chunk does not exist. Cheaper than getChunk when you only need LODs. Requires a valid bearer token; app-scoped tokens are limited to their own app. Read-only. */
7511
7545
  getChunkLods: Maybe<ChunkLodsResponse>;
7512
- /** Returns all chunks for an app within a cubic (Chebyshev-distance) radius of a center chunk, paginated. The cube spans center +/- maxDistance chunks on each axis. Each chunk's `voxelStates`, when selected, include its recorded voxel edits as in getChunk (selecting them costs one more read). Use this for bulk region loads; use getChunk for a single chunk. Requires a valid bearer token; app-scoped tokens are limited to their own app. Read-only. */
7546
+ /** Returns the stored chunks of an app in a region, paginated: a cube (center +/- maxDistance chunks on each axis, nearest first) or a box between two corners (lowChunk and highChunk, at most 4,913 chunks, by x, y, z), optionally only those written since a time. Pages are stable: each chunk is on exactly one. Each chunk's `voxelStates`, when selected, include its recorded voxel edits as in getChunk (selecting them costs one more read). Use this for bulk region loads; use getChunk for a single chunk. Requires a valid bearer token; app-scoped tokens are limited to their own app. Read-only. */
7513
7547
  getChunksByDistance: ChunksByDistanceResponse;
7514
7548
  /** Returns all recorded voxel edits (the voxel_updates log) for a single chunk, newest first, as a ChunkVoxelResponse. Use getChunk instead when you want the packed voxel grid rather than the individual edit log. Requires a valid bearer token; app-scoped tokens are limited to their own app. Read-only. */
7515
7549
  getVoxelList: ChunkVoxelResponse;
@@ -7543,9 +7577,9 @@ export type Query = {
7543
7577
  inputLogSessions: InputLogSessionConnection;
7544
7578
  /** OPERATOR: legal holds, newest first (at most 500), on one organization or account if given; only the ones that apply now unless includeReleased. */
7545
7579
  legalHolds: Array<LegalHold>;
7546
- /** Lists recorded voxel edits for all chunks within a cubic (Chebyshev) radius of a center chunk, grouped per chunk and ordered by increasing distance, paginated over chunks. Requires a valid bearer token; app-scoped tokens are limited to their own app. Read-only. */
7580
+ /** Lists recorded voxel edits for the chunks of a region, grouped per chunk and paginated over chunks: a cube (center +/- maxDistance, by increasing distance) or a box between two corners (lowChunk and highChunk, at most 4,913 chunks, by x, y, z). It reads the edit log alone, so chunks whose grid was never stored are included. Requires a valid bearer token; app-scoped tokens are limited to their own app. Read-only. */
7547
7581
  listVoxelUpdatesByDistance: VoxelUpdatesByDistanceResponse;
7548
- /** Lists recorded voxel edits for a single chunk (optionally only those at/after `since`), newest first. Requires a valid bearer token; app-scoped tokens are limited to their own app. Read-only. */
7582
+ /** Lists the recorded voxel edits of a single chunk (optionally only those at/after `since`), one per voxel position, ordered by position and paged by limit (default and most 65,536) and skip. Requires a valid bearer token; app-scoped tokens are limited to their own app. Read-only. */
7549
7583
  listVoxels: Array<Voxel>;
7550
7584
  /** One managed player by the id your organization knows it by, or null. An org token with players:manage, or an org admin with manage_players. */
7551
7585
  managedPlayer: Maybe<ManagedPlayer>;
@@ -7599,7 +7633,7 @@ export type Query = {
7599
7633
  myTierAccess: MyTierAccess;
7600
7634
  /** List every grid overlapping a chunk-coordinate bounding box, each with the given user's effective permission keys on it. Useful for previewing what a user can do across a region (e.g. around their current position). Requires app-admin ('manage_apps'). */
7601
7635
  nearbyGridPermissions: Array<NearbyGridPermissions>;
7602
- /** List every grid overlapping a chunk-coordinate bounding box, returning gridId and bounds only. Player-safe: no permission keys and no impersonation userId. Requires an app-scoped token for the same app. */
7636
+ /** List every grid overlapping a chunk-coordinate bounding box: its gridId, its bounds and the caller's own permission keys on it. Player-safe: another user's keys need nearbyGridPermissions (app admin). The grid that decides a voxel edit in a chunk is the smallest box covering it (the lower gridId on a tie), and the edit needs update_voxel_data there. Requires an app-scoped token for the same app. */
7603
7637
  nearbyGrids: Array<NearbyGrid>;
7604
7638
  /** An org's off-session auto-billing configuration (enabled flag, recharge amount, low-water threshold, per-period cap, and last error). Requires the 'view_billing' org permission. */
7605
7639
  orgAutoBilling: OrgAutoBilling;
@@ -9590,7 +9624,7 @@ export declare enum UdpErrorCode {
9590
9624
  UserNotAuthenticated = "USER_NOT_AUTHENTICATED"
9591
9625
  }
9592
9626
  /** All game-server messages delivered over the UDP proxy as GraphQL payloads. Subscribe to udpNotifications before or with sending mutations so responses and GenericErrorResponse (correlate via sequenceNumber) are not missed. NOTE: the ActorUpdateResponse and VoxelUpdateResponse members are LEGACY and never emitted (applied updates arrive as your own *Notification self-echo; failures as GenericErrorResponse) — they remain in the union for backward compatibility and will be removed in a future major version. */
9593
- export type UdpNotification = ActorLeftNotification | ActorUpdateNotification | ActorUpdateResponse | ChannelAudioNotification | ChannelMessageNotification | ClientAudioNotification | ClientEventNotification | ClientTextNotification | ClientVideoNotification | GenericErrorResponse | RealtimeConnectionEvent | ServerEventNotification | SingleActorMessageNotification | VoxelUpdateNotification | VoxelUpdateResponse;
9627
+ export type UdpNotification = ActorLeftNotification | ActorUpdateNotification | ActorUpdateResponse | ChannelAudioNotification | ChannelMessageNotification | ChunkChangedNotification | ClientAudioNotification | ClientEventNotification | ClientTextNotification | ClientVideoNotification | GenericErrorResponse | RealtimeConnectionEvent | ServerEventNotification | SingleActorMessageNotification | VoxelUpdateNotification | VoxelUpdateResponse;
9594
9628
  /** UDP proxy session for the game token on the request. Returned by udpProxyConnectionStatus and connectUdpProxy. Binary UDP layouts are documented in database/client-wire-formats.md. */
9595
9629
  export type UdpProxyConnectionStatus = {
9596
9630
  __typename?: 'UdpProxyConnectionStatus';
@@ -10137,16 +10171,16 @@ export type VoxelUpdateResponse = {
10137
10171
  /** The unique identifier for this voxel update. */
10138
10172
  uuid: Scalars['String']['output'];
10139
10173
  };
10140
- /** Result of listVoxelUpdatesByDistance: per-chunk groups of voxel edits ordered by increasing distance from the center, plus an echo of the pagination applied. */
10174
+ /** Result of listVoxelUpdatesByDistance: per-chunk groups of voxel edits (a cube ordered by increasing distance from its center, a box by x, y, z), plus the pagination applied. */
10141
10175
  export type VoxelUpdatesByDistanceResponse = {
10142
10176
  __typename?: 'VoxelUpdatesByDistanceResponse';
10143
- /** The center chunk the search was performed around. */
10177
+ /** The center chunk of a cube search; for a box, its middle chunk (rounded toward lowChunk). */
10144
10178
  centerCoordinate: ChunkCoordinates;
10145
- /** Per-chunk groups of voxel edits, ordered by increasing Chebyshev distance from centerCoordinate. */
10179
+ /** Per-chunk groups of voxel edits: for a cube by increasing Chebyshev distance from centerCoordinate, then x, y, z; for a box by x, y, z. */
10146
10180
  chunks: Array<ChunkVoxelUpdatesResponse>;
10147
- /** Echo of the chunk `limit` applied to this page, or null if none was supplied. */
10181
+ /** The chunk `limit` applied to this page: the one asked for, or 1000 when none (or 0) was. */
10148
10182
  limit: Maybe<Scalars['Int']['output']>;
10149
- /** Echo of the chunk `skip` applied to this page, or null if none was supplied. */
10183
+ /** The chunk `skip` applied to this page: the one asked for, or 0. */
10150
10184
  skip: Maybe<Scalars['Int']['output']>;
10151
10185
  };
10152
10186
  export type WalletTransaction = {