@crowdedkingdoms/crowdyjs 17.14.0-dev.1 → 18.0.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 (271) hide show
  1. package/MIGRATION.md +92 -1
  2. package/README.md +93 -162
  3. package/dist/crowdy-client.d.ts +12 -31
  4. package/dist/crowdy-client.d.ts.map +1 -1
  5. package/dist/crowdy-client.js +15 -37
  6. package/dist/crowdy-dsh/bridge.d.ts.map +1 -1
  7. package/dist/crowdy-dsh/bridge.js +3 -6
  8. package/dist/crowdy-studio/controller.d.ts +34 -59
  9. package/dist/crowdy-studio/controller.d.ts.map +1 -1
  10. package/dist/crowdy-studio/controller.js +96 -225
  11. package/dist/crowdy-studio/diagnostics.d.ts +3 -12
  12. package/dist/crowdy-studio/diagnostics.d.ts.map +1 -1
  13. package/dist/crowdy-studio/dom-shell.d.ts +2 -4
  14. package/dist/crowdy-studio/dom-shell.d.ts.map +1 -1
  15. package/dist/crowdy-studio/dom-shell.js +16 -49
  16. package/dist/crowdy-studio/embed/hud-layer.d.ts +1 -2
  17. package/dist/crowdy-studio/embed/hud-layer.d.ts.map +1 -1
  18. package/dist/crowdy-studio/embed/panel.d.ts +3 -13
  19. package/dist/crowdy-studio/embed/panel.d.ts.map +1 -1
  20. package/dist/crowdy-studio/embed/panel.js +3 -6
  21. package/dist/crowdy-studio/index.d.ts +1 -3
  22. package/dist/crowdy-studio/index.d.ts.map +1 -1
  23. package/dist/crowdy-studio/index.js +0 -2
  24. package/dist/crowdy-studio/models.d.ts +3 -4
  25. package/dist/crowdy-studio/models.d.ts.map +1 -1
  26. package/dist/crowdy-studio/starter-projects.d.ts +8 -12
  27. package/dist/crowdy-studio/starter-projects.d.ts.map +1 -1
  28. package/dist/crowdy-studio/starter-projects.js +12 -103
  29. package/dist/domains/appAccess.d.ts +14 -1
  30. package/dist/domains/appAccess.d.ts.map +1 -1
  31. package/dist/domains/appAccess.js +37 -1
  32. package/dist/domains/host.d.ts +3 -3
  33. package/dist/domains/host.js +3 -3
  34. package/dist/domains/marketplace.d.ts +9 -70
  35. package/dist/domains/marketplace.d.ts.map +1 -1
  36. package/dist/domains/marketplace.js +9 -120
  37. package/dist/domains/playerWallet.d.ts +6 -12
  38. package/dist/domains/playerWallet.d.ts.map +1 -1
  39. package/dist/domains/playerWallet.js +6 -21
  40. package/dist/errors.d.ts +7 -13
  41. package/dist/errors.d.ts.map +1 -1
  42. package/dist/errors.js +6 -10
  43. package/dist/generated/graphql.d.ts +141 -7083
  44. package/dist/generated/graphql.d.ts.map +1 -1
  45. package/dist/generated/graphql.js +5 -313
  46. package/dist/grid-mods/exec-client-halves.d.ts +19 -3
  47. package/dist/grid-mods/exec-client-halves.d.ts.map +1 -1
  48. package/dist/grid-mods/exec-client-halves.js +17 -2
  49. package/dist/grid-mods/grid-host-calls.d.ts +29 -17
  50. package/dist/grid-mods/grid-host-calls.d.ts.map +1 -1
  51. package/dist/grid-mods/grid-host-calls.js +40 -46
  52. package/dist/grid-mods/mod-runtime.d.ts +18 -11
  53. package/dist/grid-mods/mod-runtime.d.ts.map +1 -1
  54. package/dist/grid-mods/mod-runtime.js +4 -2
  55. package/dist/grid-scope.d.ts +0 -189
  56. package/dist/grid-scope.d.ts.map +1 -1
  57. package/dist/grid-scope.js +0 -70
  58. package/dist/index.d.ts +11 -17
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/index.js +10 -16
  61. package/dist/kit/actions.d.ts +5 -9
  62. package/dist/kit/actions.d.ts.map +1 -1
  63. package/dist/kit/actions.js +5 -9
  64. package/dist/kit/index.d.ts +2 -33
  65. package/dist/kit/index.d.ts.map +1 -1
  66. package/dist/kit/index.js +1 -32
  67. package/dist/kit/kit.d.ts +8 -208
  68. package/dist/kit/kit.d.ts.map +1 -1
  69. package/dist/kit/kit.js +5 -163
  70. package/dist/kit/social.d.ts +1 -3
  71. package/dist/kit/social.d.ts.map +1 -1
  72. package/dist/kit/social.js +1 -3
  73. package/dist/kit/wire.d.ts +16 -5
  74. package/dist/kit/wire.d.ts.map +1 -1
  75. package/dist/kit/wire.js +19 -5
  76. package/dist/live-coding/assets/browser-authoring-index.json +1 -1
  77. package/dist/live-coding/assets/manifest.json +1 -1
  78. package/dist/live-coding/browser-authoring-index.generated.d.ts.map +1 -1
  79. package/dist/live-coding/browser-authoring-index.generated.js +1496 -4386
  80. package/dist/live-coding/rust-analysis.d.ts.map +1 -1
  81. package/dist/live-coding/rust-analysis.js +30 -34
  82. package/dist/player-runtime/client-host-calls.d.ts +8 -0
  83. package/dist/player-runtime/client-host-calls.d.ts.map +1 -0
  84. package/dist/player-runtime/client-host-calls.js +28 -0
  85. package/dist/player-runtime/glue-runtime.d.ts +24 -20
  86. package/dist/player-runtime/glue-runtime.d.ts.map +1 -1
  87. package/dist/player-runtime/glue-runtime.js +26 -55
  88. package/dist/player-runtime/glue-sab.d.ts +2 -2
  89. package/dist/player-runtime/glue-sab.js +2 -2
  90. package/dist/player-runtime/player-code-broker.d.ts +70 -43
  91. package/dist/player-runtime/player-code-broker.d.ts.map +1 -1
  92. package/dist/player-runtime/player-code-broker.js +159 -64
  93. package/dist/player-runtime/player-glue-worker.d.ts +8 -9
  94. package/dist/player-runtime/player-glue-worker.d.ts.map +1 -1
  95. package/dist/player-runtime/player-glue-worker.js +26 -11
  96. package/dist/stores/inbox.d.ts +1 -1
  97. package/dist/stores/inbox.d.ts.map +1 -1
  98. package/dist/stores/index.d.ts +0 -11
  99. package/dist/stores/index.d.ts.map +1 -1
  100. package/dist/stores/index.js +0 -4
  101. package/dist/stores/session.d.ts +0 -2
  102. package/dist/stores/session.d.ts.map +1 -1
  103. package/package.json +1 -1
  104. package/dist/crowdy-studio/model-lint-log.d.ts +0 -76
  105. package/dist/crowdy-studio/model-lint-log.d.ts.map +0 -1
  106. package/dist/crowdy-studio/model-lint-log.js +0 -93
  107. package/dist/crowdy-studio/model-lint.d.ts +0 -61
  108. package/dist/crowdy-studio/model-lint.d.ts.map +0 -1
  109. package/dist/crowdy-studio/model-lint.js +0 -45
  110. package/dist/domains/compute.d.ts +0 -208
  111. package/dist/domains/compute.d.ts.map +0 -1
  112. package/dist/domains/compute.js +0 -274
  113. package/dist/domains/controlPlane.d.ts +0 -38
  114. package/dist/domains/controlPlane.d.ts.map +0 -1
  115. package/dist/domains/controlPlane.js +0 -43
  116. package/dist/domains/gameModel.d.ts +0 -1174
  117. package/dist/domains/gameModel.d.ts.map +0 -1
  118. package/dist/domains/gameModel.js +0 -1333
  119. package/dist/domains/playerCompute.d.ts +0 -91
  120. package/dist/domains/playerCompute.d.ts.map +0 -1
  121. package/dist/domains/playerCompute.js +0 -136
  122. package/dist/domains/playerModel.d.ts +0 -20
  123. package/dist/domains/playerModel.d.ts.map +0 -1
  124. package/dist/domains/playerModel.js +0 -54
  125. package/dist/kit/abilities.d.ts +0 -66
  126. package/dist/kit/abilities.d.ts.map +0 -1
  127. package/dist/kit/abilities.js +0 -71
  128. package/dist/kit/blueprints/combat.d.ts +0 -81
  129. package/dist/kit/blueprints/combat.d.ts.map +0 -1
  130. package/dist/kit/blueprints/combat.js +0 -357
  131. package/dist/kit/blueprints/core.d.ts +0 -222
  132. package/dist/kit/blueprints/core.d.ts.map +0 -1
  133. package/dist/kit/blueprints/core.js +0 -185
  134. package/dist/kit/blueprints/decks.d.ts +0 -50
  135. package/dist/kit/blueprints/decks.d.ts.map +0 -1
  136. package/dist/kit/blueprints/decks.js +0 -163
  137. package/dist/kit/blueprints/economy.d.ts +0 -88
  138. package/dist/kit/blueprints/economy.d.ts.map +0 -1
  139. package/dist/kit/blueprints/economy.js +0 -533
  140. package/dist/kit/blueprints/guild.d.ts +0 -51
  141. package/dist/kit/blueprints/guild.d.ts.map +0 -1
  142. package/dist/kit/blueprints/guild.js +0 -50
  143. package/dist/kit/blueprints/index.d.ts +0 -23
  144. package/dist/kit/blueprints/index.d.ts.map +0 -1
  145. package/dist/kit/blueprints/index.js +0 -22
  146. package/dist/kit/blueprints/inventory.d.ts +0 -84
  147. package/dist/kit/blueprints/inventory.d.ts.map +0 -1
  148. package/dist/kit/blueprints/inventory.js +0 -257
  149. package/dist/kit/blueprints/leaderboards.d.ts +0 -49
  150. package/dist/kit/blueprints/leaderboards.d.ts.map +0 -1
  151. package/dist/kit/blueprints/leaderboards.js +0 -126
  152. package/dist/kit/blueprints/liveops.d.ts +0 -42
  153. package/dist/kit/blueprints/liveops.d.ts.map +0 -1
  154. package/dist/kit/blueprints/liveops.js +0 -170
  155. package/dist/kit/blueprints/locks.d.ts +0 -82
  156. package/dist/kit/blueprints/locks.d.ts.map +0 -1
  157. package/dist/kit/blueprints/locks.js +0 -155
  158. package/dist/kit/blueprints/loot.d.ts +0 -90
  159. package/dist/kit/blueprints/loot.d.ts.map +0 -1
  160. package/dist/kit/blueprints/loot.js +0 -229
  161. package/dist/kit/blueprints/matches.d.ts +0 -84
  162. package/dist/kit/blueprints/matches.d.ts.map +0 -1
  163. package/dist/kit/blueprints/matches.js +0 -349
  164. package/dist/kit/blueprints/moderation.d.ts +0 -32
  165. package/dist/kit/blueprints/moderation.d.ts.map +0 -1
  166. package/dist/kit/blueprints/moderation.js +0 -140
  167. package/dist/kit/blueprints/npcs.d.ts +0 -78
  168. package/dist/kit/blueprints/npcs.d.ts.map +0 -1
  169. package/dist/kit/blueprints/npcs.js +0 -125
  170. package/dist/kit/blueprints/plots.d.ts +0 -63
  171. package/dist/kit/blueprints/plots.d.ts.map +0 -1
  172. package/dist/kit/blueprints/plots.js +0 -151
  173. package/dist/kit/blueprints/progression.d.ts +0 -68
  174. package/dist/kit/blueprints/progression.d.ts.map +0 -1
  175. package/dist/kit/blueprints/progression.js +0 -324
  176. package/dist/kit/blueprints/quests.d.ts +0 -72
  177. package/dist/kit/blueprints/quests.d.ts.map +0 -1
  178. package/dist/kit/blueprints/quests.js +0 -285
  179. package/dist/kit/blueprints/worldsim.d.ts +0 -91
  180. package/dist/kit/blueprints/worldsim.d.ts.map +0 -1
  181. package/dist/kit/blueprints/worldsim.js +0 -468
  182. package/dist/kit/combat.d.ts +0 -141
  183. package/dist/kit/combat.d.ts.map +0 -1
  184. package/dist/kit/combat.js +0 -196
  185. package/dist/kit/decks.d.ts +0 -157
  186. package/dist/kit/decks.d.ts.map +0 -1
  187. package/dist/kit/decks.js +0 -186
  188. package/dist/kit/director.d.ts +0 -88
  189. package/dist/kit/director.d.ts.map +0 -1
  190. package/dist/kit/director.js +0 -86
  191. package/dist/kit/economy.d.ts +0 -289
  192. package/dist/kit/economy.d.ts.map +0 -1
  193. package/dist/kit/economy.js +0 -427
  194. package/dist/kit/engine.d.ts +0 -48
  195. package/dist/kit/engine.d.ts.map +0 -1
  196. package/dist/kit/engine.js +0 -113
  197. package/dist/kit/features.d.ts +0 -60
  198. package/dist/kit/features.d.ts.map +0 -1
  199. package/dist/kit/features.js +0 -65
  200. package/dist/kit/instances.d.ts +0 -52
  201. package/dist/kit/instances.d.ts.map +0 -1
  202. package/dist/kit/instances.js +0 -60
  203. package/dist/kit/inventory.d.ts +0 -129
  204. package/dist/kit/inventory.d.ts.map +0 -1
  205. package/dist/kit/inventory.js +0 -200
  206. package/dist/kit/leaderboards.d.ts +0 -86
  207. package/dist/kit/leaderboards.d.ts.map +0 -1
  208. package/dist/kit/leaderboards.js +0 -133
  209. package/dist/kit/liveops.d.ts +0 -112
  210. package/dist/kit/liveops.d.ts.map +0 -1
  211. package/dist/kit/liveops.js +0 -183
  212. package/dist/kit/loot.d.ts +0 -128
  213. package/dist/kit/loot.d.ts.map +0 -1
  214. package/dist/kit/loot.js +0 -160
  215. package/dist/kit/matches.d.ts +0 -301
  216. package/dist/kit/matches.d.ts.map +0 -1
  217. package/dist/kit/matches.js +0 -458
  218. package/dist/kit/matchmaking.d.ts +0 -57
  219. package/dist/kit/matchmaking.d.ts.map +0 -1
  220. package/dist/kit/matchmaking.js +0 -59
  221. package/dist/kit/minigames.d.ts +0 -30
  222. package/dist/kit/minigames.d.ts.map +0 -1
  223. package/dist/kit/minigames.js +0 -38
  224. package/dist/kit/mobs.d.ts +0 -90
  225. package/dist/kit/mobs.d.ts.map +0 -1
  226. package/dist/kit/mobs.js +0 -98
  227. package/dist/kit/moderation.d.ts +0 -73
  228. package/dist/kit/moderation.d.ts.map +0 -1
  229. package/dist/kit/moderation.js +0 -103
  230. package/dist/kit/movement.d.ts +0 -78
  231. package/dist/kit/movement.d.ts.map +0 -1
  232. package/dist/kit/movement.js +0 -103
  233. package/dist/kit/notifications.d.ts +0 -45
  234. package/dist/kit/notifications.d.ts.map +0 -1
  235. package/dist/kit/notifications.js +0 -67
  236. package/dist/kit/npcs.d.ts +0 -226
  237. package/dist/kit/npcs.d.ts.map +0 -1
  238. package/dist/kit/npcs.js +0 -141
  239. package/dist/kit/objects.d.ts +0 -116
  240. package/dist/kit/objects.d.ts.map +0 -1
  241. package/dist/kit/objects.js +0 -119
  242. package/dist/kit/pets.d.ts +0 -85
  243. package/dist/kit/pets.d.ts.map +0 -1
  244. package/dist/kit/pets.js +0 -96
  245. package/dist/kit/plots.d.ts +0 -85
  246. package/dist/kit/plots.d.ts.map +0 -1
  247. package/dist/kit/plots.js +0 -113
  248. package/dist/kit/progression.d.ts +0 -181
  249. package/dist/kit/progression.d.ts.map +0 -1
  250. package/dist/kit/progression.js +0 -265
  251. package/dist/kit/quests.d.ts +0 -171
  252. package/dist/kit/quests.d.ts.map +0 -1
  253. package/dist/kit/quests.js +0 -237
  254. package/dist/kit/racing.d.ts +0 -85
  255. package/dist/kit/racing.d.ts.map +0 -1
  256. package/dist/kit/racing.js +0 -99
  257. package/dist/kit/shared.d.ts +0 -73
  258. package/dist/kit/shared.d.ts.map +0 -1
  259. package/dist/kit/shared.js +0 -101
  260. package/dist/kit/telemetry.d.ts +0 -66
  261. package/dist/kit/telemetry.d.ts.map +0 -1
  262. package/dist/kit/telemetry.js +0 -133
  263. package/dist/kit/territory.d.ts +0 -97
  264. package/dist/kit/territory.d.ts.map +0 -1
  265. package/dist/kit/territory.js +0 -114
  266. package/dist/kit/worldsim.d.ts +0 -263
  267. package/dist/kit/worldsim.d.ts.map +0 -1
  268. package/dist/kit/worldsim.js +0 -268
  269. package/dist/stores/model.d.ts +0 -81
  270. package/dist/stores/model.d.ts.map +0 -1
  271. package/dist/stores/model.js +0 -163
package/dist/kit/kit.d.ts CHANGED
@@ -1,231 +1,31 @@
1
1
  import type { ChannelsAPI } from '../domains/channels.js';
2
2
  import type { GameAppsAPI } from '../domains/gameApps.js';
3
- import type { GameModelAPI } from '../domains/gameModel.js';
4
3
  import type { TeamsAPI } from '../domains/teams.js';
5
4
  import type { UdpAPI } from '../domains/udp.js';
6
- import type { GameModelSeedMutation, GameModelUpsertAutomationMutation, GameModelUpsertAutomationTriggerMutation, Scalars } from '../generated/graphql.js';
7
- import type { ComputeAPI } from '../domains/compute.js';
8
- import { type KitBlueprint } from './blueprints/index.js';
9
- import { CombatKit, type CombatKitOptions } from './combat.js';
10
- import { DirectorKit, type DirectorKitOptions } from './director.js';
11
- import { DecksKit, type DecksKitOptions } from './decks.js';
12
- import { EconomyKit, type EconomyKitOptions } from './economy.js';
13
- import { EngineDetector } from './engine.js';
14
- import { FeaturesKit } from './features.js';
15
- import { InstancesKit, type InstancesKitOptions } from './instances.js';
16
- import { InventoryKit, type InventoryKitOptions } from './inventory.js';
17
- import { LeaderboardsKit, type LeaderboardsKitOptions } from './leaderboards.js';
18
- import { LootKit, type LootKitOptions } from './loot.js';
19
- import { MatchmakingKit, type MatchmakingKitOptions } from './matchmaking.js';
20
- import { MinigamesKit, type MinigamesKitOptions } from './minigames.js';
21
- import { MobsKit, type MobsKitOptions } from './mobs.js';
22
- import { NpcsKit, type NpcsKitOptions } from './npcs.js';
23
- import { ObjectsKit, type ObjectsKitOptions } from './objects.js';
24
- import { PetsKit, type PetsKitOptions } from './pets.js';
25
- import { PlotsKit, type PlotsKitOptions } from './plots.js';
26
- import { MatchesKit, type MatchesKitOptions } from './matches.js';
27
- import { ProgressionKit, type ProgressionKitOptions } from './progression.js';
28
- import { QuestsKit, type QuestsKitOptions } from './quests.js';
5
+ import type { Scalars } from '../generated/graphql.js';
29
6
  import { SocialKit, type SocialKitOptions } from './social.js';
30
- import { AbilitiesKit, type AbilitiesKitOptions } from './abilities.js';
31
- import { LiveopsKit, type LiveopsKitOptions } from './liveops.js';
32
- import { MovementKit, type MovementKitOptions } from './movement.js';
33
- import { RacingKit, type RacingKitOptions } from './racing.js';
34
- import { TerritoryKit, type TerritoryKitOptions } from './territory.js';
35
- import { ModerationKit, type ModerationKitOptions } from './moderation.js';
36
- import { TelemetryKit, type TelemetryKitOptions } from './telemetry.js';
37
- import { WorldsimKit, type WorldsimKitOptions } from './worldsim.js';
38
- /** Options for {@link GameKitClient}, configuring the runtime helpers to match your deployed blueprints. */
7
+ /** Options for {@link GameKitClient}. */
39
8
  export interface GameKitOptions {
40
- inventory?: InventoryKitOptions;
41
- objects?: ObjectsKitOptions;
42
- npcs?: NpcsKitOptions;
43
- plots?: PlotsKitOptions;
44
- economy?: EconomyKitOptions;
45
- progression?: ProgressionKitOptions;
46
- loot?: LootKitOptions;
47
- quests?: QuestsKitOptions;
48
- combat?: CombatKitOptions;
49
- matches?: MatchesKitOptions;
50
- decks?: DecksKitOptions;
51
- worldsim?: WorldsimKitOptions;
52
- liveops?: LiveopsKitOptions;
53
- moderation?: ModerationKitOptions;
54
- telemetry?: TelemetryKitOptions;
55
- abilities?: AbilitiesKitOptions;
56
- movement?: MovementKitOptions;
57
- territory?: TerritoryKitOptions;
58
- racing?: RacingKitOptions;
59
9
  social?: SocialKitOptions;
60
- leaderboards?: LeaderboardsKitOptions;
61
- mobs?: MobsKitOptions;
62
- pets?: PetsKitOptions;
63
- instances?: InstancesKitOptions;
64
- director?: DirectorKitOptions;
65
- matchmaking?: MatchmakingKitOptions;
66
- minigames?: MinigamesKitOptions;
67
10
  }
68
11
  /**
69
- * The extra (non-model) domains some kit helpers compose: channels + udp for
70
- * matches (notify-to-pull) and social chat, teams for parties/guilds, and
71
- * compute for the engine-backed helpers (mobs/pets, capability detection).
12
+ * The domains the kit composes: teams for parties and guilds, channels and udp for chat.
72
13
  * `client.kit(appId)` wires them automatically.
73
14
  */
74
15
  export interface GameKitDomains {
75
16
  channels?: ChannelsAPI;
76
17
  teams?: TeamsAPI;
77
18
  udp?: UdpAPI;
78
- compute?: ComputeAPI;
79
- }
80
- /** The result of {@link GameKitClient.deploy}: the seed outcome plus each automation/trigger upserted. */
81
- export interface KitDeployResult {
82
- seed: GameModelSeedMutation['gameModelSeed'];
83
- automations: GameModelUpsertAutomationMutation['gameModelUpsertAutomation'][];
84
- automationTriggers: GameModelUpsertAutomationTriggerMutation['gameModelUpsertAutomationTrigger'][];
85
- /** Engine templates deployed alongside (when `engines` was passed). */
86
- engines: Array<{
87
- templateName: string;
88
- moduleName: string;
89
- compileStatus: string;
90
- }>;
91
- /** Non-fatal static-analysis warnings from the seed. */
92
- warnings: string[];
93
19
  }
94
20
  /**
95
- * App-scoped **Game Kit** facade returned by `client.kit(appId)` — high-level
96
- * building blocks that map traditional game concepts (inventory, lockable
97
- * objects with custom permissions, NPCs) onto the Game Model + Automations
98
- * API. Everything composes `client.gameModel`; no new server surface.
99
- *
100
- * Two phases, matching the platform's model:
101
- *
102
- * 1. **Studio (admin) loads the rules** — {@link deploy} takes declarative
103
- * {@link KitBlueprint}s (built with `inventoryBlueprint`, `lockBlueprint`,
104
- * `npcBlueprint`, or by hand) and seeds the container types, property
105
- * schemas, policy-gated functions, and automations into the app in one
106
- * idempotent pass. Requires the app-admin `manage_apps` permission — run
107
- * it from a trusted admin context, never the shipped game client.
108
- * 2. **The game client plays** — {@link inventory}, {@link objects}, and
109
- * {@link npcs} wrap the runtime calls (create/read containers, invoke the
110
- * gated functions) assuming the blueprint conventions. Authorization is
111
- * enforced server-side on every call.
112
- *
113
- * See the docs guides "Game API → Modeling game concepts" and
114
- * "CrowdyJS → Game Kit".
115
- *
116
- * @example
117
- * ```ts
118
- * // Studio setup (admin token):
119
- * const kit = admin.kit(appId);
120
- * await kit.deploy([
121
- * inventoryBlueprint(),
122
- * lockBlueprint({ objectTypeName: 'Door', authority: { kind: 'key' } }),
123
- * ]);
124
- *
125
- * // Game client (player token):
126
- * const kit = game.kit(appId);
127
- * const bag = await kit.inventory.ensure(me.userId);
128
- * const result = await kit.objects.open(doorId, { keyId });
129
- * if (!result.success) showLockedMessage(result.errorMessage);
130
- * ```
21
+ * App-scoped **Game Kit** returned by `client.kit(appId)`: parties, guilds and chat rooms
22
+ * over teams and channels ({@link social}). Game rules and state live in ck-exec hubs
23
+ * (`client.exec`); the kit's wire codecs (`encodeEnginePose`, `parseEngineEvent`, ...) and
24
+ * `runOptimisticAction` are standalone exports.
131
25
  */
132
26
  export declare class GameKitClient {
133
- private readonly appId;
134
- private readonly gameModel;
135
- /** Inventory helpers (per-player bags and item stacks). */
136
- readonly inventory: InventoryKit;
137
- /** Lockable-object helpers (doors/chests/gates with custom permissions). */
138
- readonly objects: ObjectsKit;
139
- /** NPC helpers (spawn/read instances, manage the automations behind them). */
140
- readonly npcs: NpcsKit;
141
- /** Plot helpers (buy/rent land with transactional, enforced grid grants). */
142
- readonly plots: PlotsKit;
143
- /** Economy helpers (wallets, shops, escrow trades, player market). */
144
- readonly economy: EconomyKit;
145
- /** Progression helpers (xp/levels, skills, achievements, rating). */
146
- readonly progression: ProgressionKit;
147
- /** Loot helpers (server-rolled weighted tables, atomic claims). */
148
- readonly loot: LootKit;
149
- /** Quest helpers (catalog, progress, atomic reward turn-in, daily resets). */
150
- readonly quests: QuestsKit;
151
- /** Combat helpers (server-authoritative attacks, status effects, respawn). */
152
- readonly combat: CombatKit;
153
- /** Match helpers (lobbies, rounds, turns, scores, notify-to-pull channels). */
154
- readonly matches: MatchesKit;
155
- /** Deck helpers (hidden hands via owner visibility, server-dealt shuffles). */
156
- readonly decks: DecksKit;
157
- /** World simulation helpers (clock/weather, nodes, crops, wave counters). */
158
- readonly worldsim: WorldsimKit;
159
- /** Liveops helpers (event windows, seasons, battle-pass composition). */
160
- readonly liveops: LiveopsKit;
161
- /** Moderation helpers (reports, admin queue, personal mutes). */
162
- readonly moderation: ModerationKit;
163
- /** Telemetry helpers (track + sampled counters). */
164
- readonly telemetry: TelemetryKit;
165
- /** Realtime ability casts (abilities engine, type-94 events). */
166
- readonly abilities: AbilitiesKit;
167
- /** Movement-warden reads (observe/flag posture, type-95 events). */
168
- readonly movement: MovementKit;
169
- /** Control points + factions (territory engine, type-96 events). */
170
- readonly territory: TerritoryKit;
171
- /** Racing + possession (type-97 events, ghosts, the ball). */
172
- readonly racing: RacingKit;
173
27
  /** Social helpers (parties, guilds, chat over teams + channels). */
174
28
  readonly social: SocialKit;
175
- /** Leaderboard helpers (trusted submits, client-side ranking, seasons). */
176
- readonly leaderboards: LeaderboardsKit;
177
- /** Monetization helpers (feature keys, tier grants, featureGate policies). */
178
- readonly features: FeaturesKit;
179
- /** Mob-engine helpers (defs/slots, refereed attacks, contact events). */
180
- readonly mobs: MobsKit;
181
- /** Instance helpers (private world slices, seeded runs). */
182
- readonly instances: InstancesKit;
183
- /** Director helpers (encounter defs, run state, kill/boss reports). */
184
- readonly director: DirectorKit;
185
- /** Matchmaking helpers (queues, proposals, rating). */
186
- readonly matchmaking: MatchmakingKit;
187
- /** Minigame helpers (thin invoke wrapper for invoke-loop games). */
188
- readonly minigames: MinigamesKit;
189
- /** Pet helpers (adopt/summon/dismiss/rename over the npc engine). */
190
- readonly pets: PetsKit;
191
- /** Compute-engine capability detection shared by the engine-aware kits. */
192
- readonly engines: EngineDetector;
193
- private readonly compute?;
194
- constructor(appId: Scalars['BigInt']['input'], gameModel: GameModelAPI, gameApps: GameAppsAPI, options?: GameKitOptions, domains?: GameKitDomains);
195
- /**
196
- * Helpers for an additional lockable object type deployed under a different
197
- * type name (e.g. both `Door` and `Chest` lock blueprints in one app).
198
- */
199
- objectsFor(objectTypeName: string, keyTypeName?: string): ObjectsKit;
200
- /**
201
- * **Studio (admin)** — load blueprints into the app: one transactional
202
- * `gameModelSeed` for the definitions (and any seed containers/edges),
203
- * followed by an `upsertAutomation` per automation and an
204
- * `upsertAutomationTrigger` per event trigger. Idempotent: definitions
205
- * upsert on their names, automations key on the automation name.
206
- *
207
- * Requires the app-admin `manage_apps` permission.
208
- *
209
- * @param blueprints - The blueprints to deploy. Duplicate type/function/
210
- * automation names across blueprints throw before anything is sent.
211
- * @param options - `sessionId` scopes any seed containers to a session.
212
- * @returns A {@link KitDeployResult} with the seed counts, the upserted
213
- * automations/triggers, and any non-fatal seed `warnings`.
214
- * @throws {CrowdyGraphQLError} `FORBIDDEN` (`requiredPermission ===
215
- * 'manage_apps'`) without app-admin, or `BAD_USER_INPUT` for definitions
216
- * that fail to compile.
217
- */
218
- deploy(blueprints: KitBlueprint | KitBlueprint[], options?: {
219
- sessionId?: string;
220
- /**
221
- * Engine templates to deploy from the platform registry alongside the
222
- * blueprints (`computeDeployTemplate` — requires the compute domain +
223
- * 'manage_compute'). Each entry is a template name, optionally
224
- * `'template:module'` to override the module name.
225
- */
226
- engines?: string[];
227
- /** Wait for engine compiles (default true). */
228
- waitForEngines?: boolean;
229
- }): Promise<KitDeployResult>;
29
+ constructor(appId: Scalars['BigInt']['input'], gameApps: GameAppsAPI, options?: GameKitOptions, domains?: GameKitDomains);
230
30
  }
231
31
  //# sourceMappingURL=kit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"kit.d.ts","sourceRoot":"","sources":["../../src/kit/kit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EACV,qBAAqB,EACrB,iCAAi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ACnB;;;;;WAKG;QACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,+CAA+C;QAC/C,cAAc,CAAC,EAAE,OAAO,CAAC;KACrB,GACL,OAAO,CAAC,eAAe,CAAC;CA0C5B"}
1
+ {"version":3,"file":"kit.d.ts","sourceRoot":"","sources":["../../src/kit/kit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/D,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,qBAAa,aAAa;IACxB,oEAAoE;IACpE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;gBAGzB,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,EACjC,QAAQ,EAAE,WAAW,EACrB,OAAO,GAAE,cAAmB,EAC5B,OAAO,GAAE,cAAmB;CAW/B"}
package/dist/kit/kit.js CHANGED
@@ -1,170 +1,12 @@
1
- import { mergeBlueprints } from './blueprints/index.js';
2
- import { CombatKit } from './combat.js';
3
- import { DirectorKit } from './director.js';
4
- import { DecksKit } from './decks.js';
5
- import { EconomyKit } from './economy.js';
6
- import { EngineDetector } from './engine.js';
7
- import { FeaturesKit } from './features.js';
8
- import { InstancesKit } from './instances.js';
9
- import { InventoryKit } from './inventory.js';
10
- import { LeaderboardsKit } from './leaderboards.js';
11
- import { LootKit } from './loot.js';
12
- import { MatchmakingKit } from './matchmaking.js';
13
- import { MinigamesKit } from './minigames.js';
14
- import { MobsKit } from './mobs.js';
15
- import { NpcsKit } from './npcs.js';
16
- import { ObjectsKit } from './objects.js';
17
- import { PetsKit } from './pets.js';
18
- import { PlotsKit } from './plots.js';
19
- import { MatchesKit } from './matches.js';
20
- import { ProgressionKit } from './progression.js';
21
- import { QuestsKit } from './quests.js';
22
1
  import { SocialKit } from './social.js';
23
- import { AbilitiesKit } from './abilities.js';
24
- import { LiveopsKit } from './liveops.js';
25
- import { MovementKit } from './movement.js';
26
- import { RacingKit } from './racing.js';
27
- import { TerritoryKit } from './territory.js';
28
- import { ModerationKit } from './moderation.js';
29
- import { TelemetryKit } from './telemetry.js';
30
- import { WorldsimKit } from './worldsim.js';
31
2
  /**
32
- * App-scoped **Game Kit** facade returned by `client.kit(appId)` — high-level
33
- * building blocks that map traditional game concepts (inventory, lockable
34
- * objects with custom permissions, NPCs) onto the Game Model + Automations
35
- * API. Everything composes `client.gameModel`; no new server surface.
36
- *
37
- * Two phases, matching the platform's model:
38
- *
39
- * 1. **Studio (admin) loads the rules** — {@link deploy} takes declarative
40
- * {@link KitBlueprint}s (built with `inventoryBlueprint`, `lockBlueprint`,
41
- * `npcBlueprint`, or by hand) and seeds the container types, property
42
- * schemas, policy-gated functions, and automations into the app in one
43
- * idempotent pass. Requires the app-admin `manage_apps` permission — run
44
- * it from a trusted admin context, never the shipped game client.
45
- * 2. **The game client plays** — {@link inventory}, {@link objects}, and
46
- * {@link npcs} wrap the runtime calls (create/read containers, invoke the
47
- * gated functions) assuming the blueprint conventions. Authorization is
48
- * enforced server-side on every call.
49
- *
50
- * See the docs guides "Game API → Modeling game concepts" and
51
- * "CrowdyJS → Game Kit".
52
- *
53
- * @example
54
- * ```ts
55
- * // Studio setup (admin token):
56
- * const kit = admin.kit(appId);
57
- * await kit.deploy([
58
- * inventoryBlueprint(),
59
- * lockBlueprint({ objectTypeName: 'Door', authority: { kind: 'key' } }),
60
- * ]);
61
- *
62
- * // Game client (player token):
63
- * const kit = game.kit(appId);
64
- * const bag = await kit.inventory.ensure(me.userId);
65
- * const result = await kit.objects.open(doorId, { keyId });
66
- * if (!result.success) showLockedMessage(result.errorMessage);
67
- * ```
3
+ * App-scoped **Game Kit** returned by `client.kit(appId)`: parties, guilds and chat rooms
4
+ * over teams and channels ({@link social}). Game rules and state live in ck-exec hubs
5
+ * (`client.exec`); the kit's wire codecs (`encodeEnginePose`, `parseEngineEvent`, ...) and
6
+ * `runOptimisticAction` are standalone exports.
68
7
  */
69
8
  export class GameKitClient {
70
- constructor(appId, gameModel, gameApps, options = {}, domains = {}) {
71
- this.appId = appId;
72
- this.gameModel = gameModel;
73
- this.compute = domains.compute;
74
- this.engines = new EngineDetector(String(appId), domains.compute);
75
- this.inventory = new InventoryKit(appId, gameModel, options.inventory);
76
- this.objects = new ObjectsKit(appId, gameModel, options.objects);
77
- this.npcs = new NpcsKit(appId, gameModel, options.npcs, this.engines);
78
- this.plots = new PlotsKit(appId, gameModel, gameApps, options.plots);
79
- this.economy = new EconomyKit(appId, gameModel, options.economy, this.engines);
80
- this.progression = new ProgressionKit(appId, gameModel, options.progression);
81
- this.loot = new LootKit(appId, gameModel, options.loot, this.engines);
82
- this.quests = new QuestsKit(appId, gameModel, options.quests);
83
- this.combat = new CombatKit(appId, gameModel, options.combat, this.engines);
84
- this.matches = new MatchesKit(appId, gameModel, domains.channels, domains.udp, options.matches, this.engines);
85
- this.decks = new DecksKit(appId, gameModel, options.decks, this.engines);
86
- this.worldsim = new WorldsimKit(appId, gameModel, options.worldsim, this.engines);
87
- this.liveops = new LiveopsKit(appId, gameModel, options.liveops, this.engines);
88
- this.moderation = new ModerationKit(appId, gameModel, options.moderation);
89
- this.telemetry = new TelemetryKit(appId, gameModel, options.telemetry);
90
- this.abilities = new AbilitiesKit(appId, gameModel, this.engines, options.abilities);
91
- this.movement = new MovementKit(appId, gameModel, this.engines, options.movement);
92
- this.territory = new TerritoryKit(appId, gameModel, this.engines, options.territory);
93
- this.racing = new RacingKit(appId, gameModel, this.engines, options.racing);
94
- this.mobs = new MobsKit(appId, gameModel, this.engines, options.mobs);
95
- this.pets = new PetsKit(appId, gameModel, this.engines, options.pets);
96
- this.instances = new InstancesKit(appId, this.engines, options.instances);
97
- this.director = new DirectorKit(appId, gameModel, this.engines, options.director);
98
- this.matchmaking = new MatchmakingKit(appId, this.engines, options.matchmaking);
99
- this.minigames = new MinigamesKit(appId, this.engines, options.minigames);
9
+ constructor(appId, gameApps, options = {}, domains = {}) {
100
10
  this.social = new SocialKit(appId, domains.teams, domains.channels, domains.udp, gameApps, options.social);
101
- this.leaderboards = new LeaderboardsKit(appId, gameModel, options.leaderboards, this.engines);
102
- this.features = new FeaturesKit(appId, gameModel);
103
- }
104
- /**
105
- * Helpers for an additional lockable object type deployed under a different
106
- * type name (e.g. both `Door` and `Chest` lock blueprints in one app).
107
- */
108
- objectsFor(objectTypeName, keyTypeName) {
109
- return new ObjectsKit(this.appId, this.gameModel, {
110
- objectTypeName,
111
- keyTypeName,
112
- });
113
- }
114
- /**
115
- * **Studio (admin)** — load blueprints into the app: one transactional
116
- * `gameModelSeed` for the definitions (and any seed containers/edges),
117
- * followed by an `upsertAutomation` per automation and an
118
- * `upsertAutomationTrigger` per event trigger. Idempotent: definitions
119
- * upsert on their names, automations key on the automation name.
120
- *
121
- * Requires the app-admin `manage_apps` permission.
122
- *
123
- * @param blueprints - The blueprints to deploy. Duplicate type/function/
124
- * automation names across blueprints throw before anything is sent.
125
- * @param options - `sessionId` scopes any seed containers to a session.
126
- * @returns A {@link KitDeployResult} with the seed counts, the upserted
127
- * automations/triggers, and any non-fatal seed `warnings`.
128
- * @throws {CrowdyGraphQLError} `FORBIDDEN` (`requiredPermission ===
129
- * 'manage_apps'`) without app-admin, or `BAD_USER_INPUT` for definitions
130
- * that fail to compile.
131
- */
132
- async deploy(blueprints, options = {}) {
133
- const list = Array.isArray(blueprints) ? blueprints : [blueprints];
134
- const merged = mergeBlueprints(this.appId, list, options);
135
- const seed = await this.gameModel.seed(merged.seedInput);
136
- const automations = [];
137
- for (const automation of merged.automations) {
138
- automations.push(await this.gameModel.upsertAutomation(automation));
139
- }
140
- const automationTriggers = [];
141
- for (const trigger of merged.automationTriggers) {
142
- automationTriggers.push(await this.gameModel.upsertAutomationTrigger(trigger));
143
- }
144
- const engines = [];
145
- for (const entry of options.engines ?? []) {
146
- if (!this.compute) {
147
- throw new Error('kit.deploy engines requires the compute domain (createCrowdyClient default)');
148
- }
149
- const [templateName, moduleOverride] = entry.split(':');
150
- const module = await this.compute.deployTemplate({
151
- appId: this.appId,
152
- templateName,
153
- ...(moduleOverride ? { moduleName: moduleOverride } : {}),
154
- });
155
- let compileStatus = 'pending';
156
- if (options.waitForEngines !== false) {
157
- const compiled = await this.compute.waitForCompile(this.appId, module.name);
158
- compileStatus = compiled.compileStatus;
159
- }
160
- engines.push({ templateName, moduleName: module.name, compileStatus });
161
- }
162
- return {
163
- seed,
164
- automations,
165
- automationTriggers,
166
- engines,
167
- warnings: [...(seed.warnings ?? [])],
168
- };
169
11
  }
170
12
  }
@@ -36,9 +36,7 @@ export interface KitChatMessage {
36
36
  * Runtime **social** helpers — parties, guilds, and chat rooms in familiar
37
37
  * words, wrapped over the platform's teams (membership + roles) and
38
38
  * channels (location-independent messaging) with realtime delivery via the
39
- * UDP notification subscription. No model schema needed; the only
40
- * deployable is the optional {@link guildBlueprint} composite (guild hall +
41
- * bank).
39
+ * UDP notification subscription. Nothing is deployed.
42
40
  *
43
41
  * Conventions: a party is a team named `party:<name>` paired with an
44
42
  * equally-named channel; a guild is `guild:<name>` likewise. Guild
@@ -1 +1 @@
1
- {"version":3,"file":"social.d.ts","sourceRoot":"","sources":["../../src/kit/social.ts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AAmB,UAClB,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,YACzB;YAAE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;YAAC,WAAW,CAAC,EAAE,MAAM,CAAA;SAAE;;;;;;;;;MAY9D;IAEF,8DAA8D;IAC9D,QAAQ,CAAC,IAAI;QACX,4DAA4D;qBACzC,MAAM;;;;;;;;;;;;;QAOzB,wBAAwB;0BACA,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC;;;;;;;;0BAmDyzzjB,CAAC;;;;;;;;QA/C52zjB;;;;WAIG;0BAEU,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,QAC/B,MAAM,KACX,OAAO,CAAC,OAAO,CAAC;QAQnB;;;WAGG;+BAEU,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,YAC3B,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,KAC1C,CAAC,MAAM,IAAI,CAAC;MAsBf;CACH"}
@@ -3,9 +3,7 @@ import { decodeBase64, encodeBase64, generateCrowdyUuid } from '../utils.js';
3
3
  * Runtime **social** helpers — parties, guilds, and chat rooms in familiar
4
4
  * words, wrapped over the platform's teams (membership + roles) and
5
5
  * channels (location-independent messaging) with realtime delivery via the
6
- * UDP notification subscription. No model schema needed; the only
7
- * deployable is the optional {@link guildBlueprint} composite (guild hall +
8
- * bank).
6
+ * UDP notification subscription. Nothing is deployed.
9
7
  *
10
8
  * Conventions: a party is a team named `party:<name>` paired with an
11
9
  * equally-named channel; a guild is `guild:<name>` likewise. Guild
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Engine wire registry — the client mirror of the server's
3
- * `crowdy-game-kit-core::wire` (the single source of truth for the actor
4
- * pose layout and flag-bit registry used by compute-module game engines).
5
- * Parity with the Rust crate is checked by the kit unit suite: any change
6
- * here must land in kit-core first.
2
+ * Engine wire registry — the client mirror of `crowdy-game-kit-core::wire`
3
+ * (the actor pose layout and flag-bit registry the game engines emit, and
4
+ * hubs that keep a game's client parsers still send). Parity with the Rust
5
+ * crate is checked by the kit wire unit suite: any change here must land in
6
+ * kit-core first.
7
7
  *
8
8
  * 48-byte little-endian pose: pos f32 x3 (0..11), yaw/pitch f32 (12..19),
9
9
  * velocity f32 x3 (20..31), flags u8 (32), held u8 (33), 34-35 reserved,
@@ -172,4 +172,15 @@ export interface RaceTimingEvent {
172
172
  }
173
173
  /** Parse a race-timing event; null when the payload is another type. */
174
174
  export declare function parseRaceTimingEvent(bytes: Uint8Array): RaceTimingEvent | null;
175
+ /** A parsed type-98 zone-change event (a shrinking or moving play zone). */
176
+ export interface ZoneChangeEvent {
177
+ kind: string;
178
+ phase: number | null;
179
+ radiusNow: number;
180
+ centerX: number;
181
+ centerZ: number;
182
+ body: Record<string, unknown>;
183
+ }
184
+ /** Parse a zone-change event; null when the payload is another type. */
185
+ export declare function parseZoneChangeEvent(bytes: Uint8Array): ZoneChangeEvent | null;
175
186
  //# sourceMappingURL=wire.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../src/kit/wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,eAAO,MAAM,UAAU,KAAK,CAAC;AAE7B,4EAA4E;AAC5E,eAAO,MAAM,aAAa,IAAS,CAAC;AACpC,eAAO,MAAM,QAAQ,IAAS,CAAC;AAC/B,eAAO,MAAM,QAAQ,IAAS,CAAC;AAC/B,eAAO,MAAM,cAAc,IAAS,CAAC;AAErC,uEAAuE;AACvE,MAAM,WAAW,UAAU;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAA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AAM,WAAW,eAAe;IAC9B,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,wEAAwE;AACxE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,eAAe,GAAG,IAAI,CAS9E;AAED,4EAA4E;AAC5E,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,wEAAwE;AACxE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,eAAe,GAAG,IAAI,CAW9E"}
package/dist/kit/wire.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Engine wire registry — the client mirror of the server's
3
- * `crowdy-game-kit-core::wire` (the single source of truth for the actor
4
- * pose layout and flag-bit registry used by compute-module game engines).
5
- * Parity with the Rust crate is checked by the kit unit suite: any change
6
- * here must land in kit-core first.
2
+ * Engine wire registry — the client mirror of `crowdy-game-kit-core::wire`
3
+ * (the actor pose layout and flag-bit registry the game engines emit, and
4
+ * hubs that keep a game's client parsers still send). Parity with the Rust
5
+ * crate is checked by the kit wire unit suite: any change here must land in
6
+ * kit-core first.
7
7
  *
8
8
  * 48-byte little-endian pose: pos f32 x3 (0..11), yaw/pitch f32 (12..19),
9
9
  * velocity f32 x3 (20..31), flags u8 (32), held u8 (33), 34-35 reserved,
@@ -264,3 +264,17 @@ export function parseRaceTimingEvent(bytes) {
264
264
  body: parsed.body,
265
265
  };
266
266
  }
267
+ /** Parse a zone-change event; null when the payload is another type. */
268
+ export function parseZoneChangeEvent(bytes) {
269
+ const parsed = parseEngineEvent(bytes);
270
+ if (!parsed || parsed.eventType !== EVENT_ZONE_CHANGE)
271
+ return null;
272
+ return {
273
+ kind: String(parsed.body.kind ?? ''),
274
+ phase: parsed.body.phase != null ? Number(parsed.body.phase) : null,
275
+ radiusNow: Number(parsed.body.radiusNow ?? 0),
276
+ centerX: Number(parsed.body.centerX ?? 0),
277
+ centerZ: Number(parsed.body.centerZ ?? 0),
278
+ body: parsed.body,
279
+ };
280
+ }