castle-web-cli 0.4.239 → 0.4.241

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 (396) hide show
  1. package/dist/agent.js +5 -1
  2. package/dist/api.d.ts +20 -0
  3. package/dist/api.js +57 -0
  4. package/dist/bundle.d.ts +38 -1
  5. package/dist/bundle.js +309 -13
  6. package/dist/castle-host/host.js +163 -11
  7. package/dist/castleJson.d.ts +10 -0
  8. package/dist/castleJson.js +46 -2
  9. package/dist/check.js +5 -2
  10. package/dist/devSessionServer.js +4 -1
  11. package/dist/devSessionStorage.d.ts +1 -0
  12. package/dist/devSessionStorage.js +32 -7
  13. package/dist/importOrder.d.ts +2 -0
  14. package/dist/importOrder.js +29 -0
  15. package/dist/index.js +6 -3
  16. package/dist/init.js +24 -2
  17. package/dist/multiplayerDoc.d.ts +1 -1
  18. package/dist/multiplayerDoc.js +2 -0
  19. package/dist/platformDoc.js +3 -2
  20. package/dist/playPagePolicy.js +5 -1
  21. package/dist/resetLeaderboards.d.ts +8 -1
  22. package/dist/resetLeaderboards.js +43 -8
  23. package/dist/roomLogs.d.ts +1 -0
  24. package/dist/roomLogs.js +30 -6
  25. package/dist/save-deck.d.ts +32 -2
  26. package/dist/save-deck.js +240 -39
  27. package/kits/base/CLAUDE.md +1 -1
  28. package/kits/base/castle.json +1 -1
  29. package/kits/base/sdk/README.md +174 -6
  30. package/kits/base/sdk/analytics.d.ts +8 -0
  31. package/kits/base/sdk/analytics.js +92 -0
  32. package/kits/base/sdk/castle.d.ts +5 -1
  33. package/kits/base/sdk/castle.js +2 -0
  34. package/kits/base/sdk/commands.d.ts +48 -0
  35. package/kits/base/sdk/commands.js +1 -0
  36. package/kits/base/sdk/debugConsole.d.ts +17 -0
  37. package/kits/base/sdk/debugConsole.js +154 -0
  38. package/kits/base/sdk/experiments.js +24 -1
  39. package/kits/base/sdk/hostRetry.d.ts +7 -0
  40. package/kits/base/sdk/hostRetry.js +57 -0
  41. package/kits/base/sdk/hub.d.ts +20 -2
  42. package/kits/base/sdk/hub.js +99 -13
  43. package/kits/base/sdk/multiplayer.d.ts +2 -0
  44. package/kits/base/sdk/multiplayer.js +168 -26
  45. package/kits/base/sdk/reconnectBudget.d.ts +6 -0
  46. package/kits/base/sdk/reconnectBudget.js +41 -1
  47. package/kits/base/sdk/runtime.js +36 -19
  48. package/kits/base/sdk/server/hub.d.ts +19 -0
  49. package/kits/base/sdk/server/hub.js +12 -0
  50. package/kits/base/sdk/server/platformHandle.d.ts +1 -0
  51. package/kits/base/sdk/server/wrapper.d.ts +1 -1
  52. package/kits/base/sdk/server/wrapper.js +26 -1
  53. package/kits/base/sdk/transport.d.ts +2 -1
  54. package/kits/base/sdk/transport.js +35 -0
  55. package/kits/hub-game/CLAUDE.md +66 -19
  56. package/kits/hub-game/code/client/act.js +9 -6
  57. package/kits/hub-game/code/client/actCore.js +26 -6
  58. package/kits/hub-game/code/client/actGateLog.js +36 -0
  59. package/kits/hub-game/code/client/actionOverflow.js +29 -8
  60. package/kits/hub-game/code/client/actionRailSurface.js +186 -0
  61. package/kits/hub-game/code/client/actionRailTree.js +173 -0
  62. package/kits/hub-game/code/client/askSurface.js +85 -0
  63. package/kits/hub-game/code/client/askTree.js +51 -0
  64. package/kits/hub-game/code/client/attention.js +31 -6
  65. package/kits/hub-game/code/client/ballot.js +42 -5
  66. package/kits/hub-game/code/client/ballotSurface.js +115 -0
  67. package/kits/hub-game/code/client/ballotTree.js +180 -0
  68. package/kits/hub-game/code/client/catchingUp.js +19 -0
  69. package/kits/hub-game/code/client/celebrate.js +66 -0
  70. package/kits/hub-game/code/client/chrome.js +481 -57
  71. package/kits/hub-game/code/client/companion.js +93 -23
  72. package/kits/hub-game/code/client/companionDress.js +1 -1
  73. package/kits/hub-game/code/client/cornerSurface.js +106 -0
  74. package/kits/hub-game/code/client/cornerTree.js +83 -0
  75. package/kits/hub-game/code/client/decor.js +20 -11
  76. package/kits/hub-game/code/client/deviceStorage.js +121 -0
  77. package/kits/hub-game/code/client/disguise.js +23 -0
  78. package/kits/hub-game/code/client/disguiseDraw.js +87 -0
  79. package/kits/hub-game/code/client/dockSurface.js +206 -0
  80. package/kits/hub-game/code/client/dockTree.js +232 -0
  81. package/kits/hub-game/code/client/earned.js +29 -0
  82. package/kits/hub-game/code/client/emoteSurface.js +188 -0
  83. package/kits/hub-game/code/client/emoteTree.js +264 -0
  84. package/kits/hub-game/code/client/farAvatars.js +4 -3
  85. package/kits/hub-game/code/client/fpsTelemetry.js +3 -1
  86. package/kits/hub-game/code/client/grab.js +121 -50
  87. package/kits/hub-game/code/client/holdShow.js +19 -0
  88. package/kits/hub-game/code/client/hookLayer.js +96 -12
  89. package/kits/hub-game/code/client/hubControls.js +7 -1
  90. package/kits/hub-game/code/client/hudSurface.js +11 -3
  91. package/kits/hub-game/code/client/hudTree.js +7 -4
  92. package/kits/hub-game/code/client/idle.js +21 -3
  93. package/kits/hub-game/code/client/invites.js +24 -3
  94. package/kits/hub-game/code/client/keys.js +15 -0
  95. package/kits/hub-game/code/client/labelsNear.js +8 -1
  96. package/kits/hub-game/code/client/layoutCache.js +57 -8
  97. package/kits/hub-game/code/client/loadingCover.js +53 -4
  98. package/kits/hub-game/code/client/menuIcons.js +15 -0
  99. package/kits/hub-game/code/client/menuSurface.js +102 -0
  100. package/kits/hub-game/code/client/menuTree.js +135 -0
  101. package/kits/hub-game/code/client/modelLook.js +41 -0
  102. package/kits/hub-game/code/client/padCues.js +11 -7
  103. package/kits/hub-game/code/client/padReadability.js +3 -3
  104. package/kits/hub-game/code/client/pickerSurface.js +152 -0
  105. package/kits/hub-game/code/client/pickerTree.js +163 -0
  106. package/kits/hub-game/code/client/pushVisit.js +4 -2
  107. package/kits/hub-game/code/client/quality.js +188 -29
  108. package/kits/hub-game/code/client/qualityEntry.js +10 -1
  109. package/kits/hub-game/code/client/quickChatSurface.js +222 -0
  110. package/kits/hub-game/code/client/quickChatTree.js +201 -0
  111. package/kits/hub-game/code/client/rehello.js +75 -0
  112. package/kits/hub-game/code/client/renderVisibility.js +17 -0
  113. package/kits/hub-game/code/client/replay.js +118 -0
  114. package/kits/hub-game/code/client/role.js +3 -0
  115. package/kits/hub-game/code/client/safeLayout.js +441 -56
  116. package/kits/hub-game/code/client/safeStyle.js +13 -10
  117. package/kits/hub-game/code/client/say.js +2 -0
  118. package/kits/hub-game/code/client/soundSurface.js +77 -0
  119. package/kits/hub-game/code/client/soundTree.js +74 -0
  120. package/kits/hub-game/code/client/soundscape.js +12 -9
  121. package/kits/hub-game/code/client/soundscapeCues.js +1 -1
  122. package/kits/hub-game/code/client/state.js +67 -1
  123. package/kits/hub-game/code/client/stuckSurface.js +76 -0
  124. package/kits/hub-game/code/client/stuckTree.js +67 -0
  125. package/kits/hub-game/code/client/talk.js +42 -12
  126. package/kits/hub-game/code/client/talkTree.js +4 -2
  127. package/kits/hub-game/code/client/textAskSurface.js +147 -0
  128. package/kits/hub-game/code/client/textAskTree.js +67 -0
  129. package/kits/hub-game/code/client/tiers.js +252 -27
  130. package/kits/hub-game/code/client/together.js +4 -1
  131. package/kits/hub-game/code/client/uiDom.js +86 -8
  132. package/kits/hub-game/code/client/uiTree.js +33 -4
  133. package/kits/hub-game/code/client/vehicle.js +72 -51
  134. package/kits/hub-game/code/client/weakestTier.js +75 -31
  135. package/kits/hub-game/code/client/wear.js +159 -5
  136. package/kits/hub-game/code/client/worldLabels.js +205 -25
  137. package/kits/hub-game/code/companionSpec.js +4 -2
  138. package/kits/hub-game/code/server/act.js +3 -0
  139. package/kits/hub-game/code/server/actGate.js +83 -0
  140. package/kits/hub-game/code/server/actions.js +71 -15
  141. package/kits/hub-game/code/server/actors.js +20 -5
  142. package/kits/hub-game/code/server/analytics.js +35 -3
  143. package/kits/hub-game/code/server/ask.js +39 -3
  144. package/kits/hub-game/code/server/ballot.js +167 -4
  145. package/kits/hub-game/code/server/celebrate.js +64 -0
  146. package/kits/hub-game/code/server/companion.js +17 -2
  147. package/kits/hub-game/code/server/decor.js +11 -2
  148. package/kits/hub-game/code/server/disguise.js +63 -0
  149. package/kits/hub-game/code/server/earned.js +6 -2
  150. package/kits/hub-game/code/server/friendBests.js +13 -4
  151. package/kits/hub-game/code/server/friendsAmong.js +67 -8
  152. package/kits/hub-game/code/server/grab.js +12 -2
  153. package/kits/hub-game/code/server/heldOffers.js +142 -0
  154. package/kits/hub-game/code/server/holdShow.js +98 -0
  155. package/kits/hub-game/code/server/hub.js +991 -72
  156. package/kits/hub-game/code/server/idle.js +110 -9
  157. package/kits/hub-game/code/server/index.js +9 -0
  158. package/kits/hub-game/code/server/labels.js +13 -3
  159. package/kits/hub-game/code/server/manifest.js +94 -6
  160. package/kits/hub-game/code/server/menu.js +26 -3
  161. package/kits/hub-game/code/server/npcs.js +55 -9
  162. package/kits/hub-game/code/server/observe.js +67 -6
  163. package/kits/hub-game/code/server/players.js +14 -2
  164. package/kits/hub-game/code/server/replay.js +135 -0
  165. package/kits/hub-game/code/server/standing.js +7 -3
  166. package/kits/hub-game/code/server/storageLimit.js +4 -1
  167. package/kits/hub-game/code/server/townDay.js +74 -0
  168. package/kits/hub-game/code/server/vehicle.js +3 -0
  169. package/kits/hub-game/code/server/vis.js +26 -4
  170. package/kits/hub-game/code/server/wallet.js +677 -0
  171. package/kits/hub-game/code/server/wear.js +13 -3
  172. package/kits/hub-game/code/server/writerLease.js +191 -0
  173. package/kits/hub-game/code/shared/act.js +1 -1
  174. package/kits/hub-game/code/shared/expression.js +6 -0
  175. package/kits/hub-game/code/shared/replay.js +37 -0
  176. package/kits/hub-game/code/systems/hub.js +429 -55
  177. package/kits/hub-game/docs/analytics.md +16 -2
  178. package/kits/hub-game/docs/contract.md +956 -101
  179. package/kits/hub-game/docs/home-pieces.md +5 -6
  180. package/kits/hub-game/docs/observed-progress.md +49 -1
  181. package/kits/hub-game/docs/vehicle-preset.md +23 -0
  182. package/kits/hub-game/index.html +1 -0
  183. package/kits/hub-game/models/hats/baker-cap.pxmodel +3 -3
  184. package/kits/hub-game/models/hats/bat-clip.pxmodel +3 -3
  185. package/kits/hub-game/models/hats/beekeeper.pxmodel +3 -3
  186. package/kits/hub-game/models/hats/cap.pxmodel +3 -3
  187. package/kits/hub-game/models/hats/captain.pxmodel +3 -3
  188. package/kits/hub-game/models/hats/chef-toque.pxmodel +3 -3
  189. package/kits/hub-game/models/hats/crooked-top.pxmodel +3 -3
  190. package/kits/hub-game/models/hats/delivery-cap.pxmodel +3 -3
  191. package/kits/hub-game/models/hats/fire-helmet.pxmodel +3 -3
  192. package/kits/hub-game/models/hats/flower-crown.pxmodel +3 -3
  193. package/kits/hub-game/models/hats/foam-crown.pxmodel +3 -3
  194. package/kits/hub-game/models/hats/hard-hat.pxmodel +3 -3
  195. package/kits/hub-game/models/hats/lantern.pxmodel +3 -3
  196. package/kits/hub-game/models/hats/laurel.pxmodel +3 -3
  197. package/kits/hub-game/models/hats/lighthouse.pxmodel +3 -3
  198. package/kits/hub-game/models/hats/nurse-cap.pxmodel +3 -3
  199. package/kits/hub-game/models/hats/police-cap.pxmodel +3 -3
  200. package/kits/hub-game/models/hats/sailor.pxmodel +3 -3
  201. package/kits/hub-game/models/hats/souwester.pxmodel +3 -3
  202. package/kits/hub-game/models/hats/straw.pxmodel +3 -3
  203. package/kits/hub-game/models/hats/sunflower.pxmodel +3 -3
  204. package/kits/hub-game/models/hats/sweatband.pxmodel +3 -3
  205. package/kits/hub-game/models/hats/teacher-beret.pxmodel +3 -3
  206. package/kits/hub-game/models/hats/witch.pxmodel +3 -3
  207. package/kits/hub-game/models/hold-show/daisy.pxmodel +231 -0
  208. package/kits/hub-game/models/hold-show/moonflower.pxmodel +171 -0
  209. package/kits/hub-game/models/hold-show/rose.pxmodel +191 -0
  210. package/kits/hub-game/models/hold-show/square/daisy.pxmodel +233 -0
  211. package/kits/hub-game/models/hold-show/square/moonflower.pxmodel +173 -0
  212. package/kits/hub-game/models/hold-show/square/rose.pxmodel +193 -0
  213. package/kits/hub-game/models/hold-show/square/sunflower.pxmodel +313 -0
  214. package/kits/hub-game/models/hold-show/square/tulip.pxmodel +133 -0
  215. package/kits/hub-game/models/hold-show/sunflower.pxmodel +311 -0
  216. package/kits/hub-game/models/hold-show/tulip.pxmodel +131 -0
  217. package/kits/hub-game/package-lock.json +3 -3
  218. package/kits/hub-game/package.json +4 -3
  219. package/kits/hub-game/scripts/fixtures/engine-models-stub.mjs +1 -0
  220. package/kits/hub-game/scripts/fixtures/hud-surface.json +12 -12
  221. package/kits/hub-game/scripts/fixtures/talk-surface.json +8 -8
  222. package/kits/hub-game/scripts/gen-hats.mjs +1 -1
  223. package/kits/hub-game/scripts/gen-hold-show.mjs +27 -0
  224. package/kits/hub-game/scripts/pack.mjs +89 -23
  225. package/kits/hub-game/scripts/test-act-client.mjs +5 -0
  226. package/kits/hub-game/scripts/test-act-core.mjs +32 -0
  227. package/kits/hub-game/scripts/test-act-gate.mjs +186 -0
  228. package/kits/hub-game/scripts/test-action-rail-crowded-dom.mjs +7 -1
  229. package/kits/hub-game/scripts/test-action-rail-default-dom.mjs +102 -0
  230. package/kits/hub-game/scripts/test-action-rail-never-silent-dom.mjs +50 -0
  231. package/kits/hub-game/scripts/test-action-rail-surface.mjs +368 -0
  232. package/kits/hub-game/scripts/test-action-rail-town-jobs-dom.mjs +118 -0
  233. package/kits/hub-game/scripts/test-actions-client.mjs +5 -3
  234. package/kits/hub-game/scripts/test-actions.mjs +24 -0
  235. package/kits/hub-game/scripts/test-actors.mjs +19 -0
  236. package/kits/hub-game/scripts/test-again-corner-dom.mjs +59 -0
  237. package/kits/hub-game/scripts/test-analytics.mjs +79 -0
  238. package/kits/hub-game/scripts/test-arrival-pose-server.mjs +25 -8
  239. package/kits/hub-game/scripts/test-ask-client.mjs +9 -0
  240. package/kits/hub-game/scripts/test-ask-surface.mjs +188 -0
  241. package/kits/hub-game/scripts/test-attention.mjs +43 -1
  242. package/kits/hub-game/scripts/test-ballot-sheet-dom.mjs +71 -0
  243. package/kits/hub-game/scripts/test-ballot-surface.mjs +276 -0
  244. package/kits/hub-game/scripts/test-ballot.mjs +421 -4
  245. package/kits/hub-game/scripts/test-ban-join.mjs +1 -1
  246. package/kits/hub-game/scripts/test-celebrate-client.mjs +62 -0
  247. package/kits/hub-game/scripts/test-celebrate.mjs +116 -0
  248. package/kits/hub-game/scripts/test-chat.mjs +73 -0
  249. package/kits/hub-game/scripts/test-companion-client.mjs +203 -21
  250. package/kits/hub-game/scripts/test-companion.mjs +110 -3
  251. package/kits/hub-game/scripts/test-control-layout-dom.mjs +57 -10
  252. package/kits/hub-game/scripts/test-corner-surface.mjs +268 -0
  253. package/kits/hub-game/scripts/test-decor-client.mjs +59 -3
  254. package/kits/hub-game/scripts/test-decor.mjs +27 -0
  255. package/kits/hub-game/scripts/test-device-class.mjs +4 -1
  256. package/kits/hub-game/scripts/test-disguise-client.mjs +281 -0
  257. package/kits/hub-game/scripts/test-disguise.mjs +176 -0
  258. package/kits/hub-game/scripts/test-dock-surface.mjs +404 -0
  259. package/kits/hub-game/scripts/test-door-stay-client.mjs +602 -0
  260. package/kits/hub-game/scripts/test-door-stay.mjs +613 -0
  261. package/kits/hub-game/scripts/test-earned-client.mjs +119 -0
  262. package/kits/hub-game/scripts/test-emote-surface.mjs +616 -0
  263. package/kits/hub-game/scripts/test-fps-telemetry.mjs +39 -4
  264. package/kits/hub-game/scripts/test-friend-bests.mjs +38 -12
  265. package/kits/hub-game/scripts/test-ghost-click-dom.mjs +75 -0
  266. package/kits/hub-game/scripts/test-grab-client.mjs +29 -2
  267. package/kits/hub-game/scripts/test-grab-orbit.mjs +260 -11
  268. package/kits/hub-game/scripts/test-grab.mjs +10 -1
  269. package/kits/hub-game/scripts/test-hats.mjs +28 -0
  270. package/kits/hub-game/scripts/test-held-offers.mjs +394 -0
  271. package/kits/hub-game/scripts/test-high-only.mjs +3 -3
  272. package/kits/hub-game/scripts/test-hold-show-client.mjs +175 -0
  273. package/kits/hub-game/scripts/test-hold-show.mjs +355 -0
  274. package/kits/hub-game/scripts/test-hub-controls.mjs +3 -1
  275. package/kits/hub-game/scripts/test-hub-idle.mjs +348 -0
  276. package/kits/hub-game/scripts/test-hub-leaving.mjs +21 -0
  277. package/kits/hub-game/scripts/test-hub-ops.mjs +119 -0
  278. package/kits/hub-game/scripts/test-hub-trip.mjs +240 -4
  279. package/kits/hub-game/scripts/test-hud-clear.mjs +83 -0
  280. package/kits/hub-game/scripts/test-hud-rate.mjs +2 -1
  281. package/kits/hub-game/scripts/test-idle.mjs +160 -0
  282. package/kits/hub-game/scripts/test-invites-client.mjs +53 -0
  283. package/kits/hub-game/scripts/test-labels.mjs +11 -0
  284. package/kits/hub-game/scripts/test-landscape-layout.mjs +20 -0
  285. package/kits/hub-game/scripts/test-loading-cover.mjs +67 -1
  286. package/kits/hub-game/scripts/test-manifest.mjs +27 -0
  287. package/kits/hub-game/scripts/test-menu-client.mjs +54 -5
  288. package/kits/hub-game/scripts/test-menu-surface.mjs +236 -0
  289. package/kits/hub-game/scripts/test-npcs.mjs +128 -0
  290. package/kits/hub-game/scripts/test-observed.mjs +171 -3
  291. package/kits/hub-game/scripts/test-pack.mjs +166 -0
  292. package/kits/hub-game/scripts/test-pad-cues.mjs +39 -0
  293. package/kits/hub-game/scripts/test-picker-surface.mjs +321 -0
  294. package/kits/hub-game/scripts/test-placeat-server.mjs +648 -0
  295. package/kits/hub-game/scripts/test-placement-cache.mjs +1 -1
  296. package/kits/hub-game/scripts/test-pointer-clear-dom.mjs +82 -0
  297. package/kits/hub-game/scripts/test-progress-reset.mjs +184 -6
  298. package/kits/hub-game/scripts/test-push-visit.mjs +9 -0
  299. package/kits/hub-game/scripts/test-quality.mjs +312 -9
  300. package/kits/hub-game/scripts/test-quick-chat-surface.mjs +511 -0
  301. package/kits/hub-game/scripts/test-rehello.mjs +242 -3
  302. package/kits/hub-game/scripts/test-rejoin-yaw.mjs +138 -0
  303. package/kits/hub-game/scripts/test-relations-among.mjs +13 -7
  304. package/kits/hub-game/scripts/test-relations-refresh.mjs +90 -2
  305. package/kits/hub-game/scripts/test-replay-client.mjs +110 -0
  306. package/kits/hub-game/scripts/test-replay.mjs +178 -0
  307. package/kits/hub-game/scripts/test-resume-held.mjs +13 -0
  308. package/kits/hub-game/scripts/test-resume-pose-server.mjs +43 -5
  309. package/kits/hub-game/scripts/test-role-client.mjs +2 -1
  310. package/kits/hub-game/scripts/test-safe-act.mjs +233 -0
  311. package/kits/hub-game/scripts/test-safe-caption.mjs +364 -0
  312. package/kits/hub-game/scripts/test-safe-layout.mjs +79 -0
  313. package/kits/hub-game/scripts/test-safe-prompt.mjs +163 -0
  314. package/kits/hub-game/scripts/test-sound-surface.mjs +256 -0
  315. package/kits/hub-game/scripts/test-soundscape.mjs +85 -2
  316. package/kits/hub-game/scripts/test-standing.mjs +135 -2
  317. package/kits/hub-game/scripts/test-stuck-surface.mjs +174 -0
  318. package/kits/hub-game/scripts/test-stuck.mjs +36 -1
  319. package/kits/hub-game/scripts/test-talk-surface.mjs +23 -6
  320. package/kits/hub-game/scripts/test-talk-walk-dom.mjs +123 -0
  321. package/kits/hub-game/scripts/test-text-ask-surface.mjs +273 -0
  322. package/kits/hub-game/scripts/test-tiers.mjs +453 -3
  323. package/kits/hub-game/scripts/test-toast-no-row-dom.mjs +71 -0
  324. package/kits/hub-game/scripts/test-together.mjs +11 -0
  325. package/kits/hub-game/scripts/test-town-day.mjs +90 -0
  326. package/kits/hub-game/scripts/test-try-on.mjs +39 -0
  327. package/kits/hub-game/scripts/test-ui-dom-dom.mjs +49 -2
  328. package/kits/hub-game/scripts/test-ui-tree.mjs +28 -0
  329. package/kits/hub-game/scripts/test-vehicle-client.mjs +68 -1
  330. package/kits/hub-game/scripts/test-vis.mjs +145 -0
  331. package/kits/hub-game/scripts/test-wallet.mjs +650 -0
  332. package/kits/hub-game/scripts/test-weakest-tier.mjs +135 -1
  333. package/kits/hub-game/scripts/test-world-labels.mjs +340 -0
  334. package/kits/hub-game/scripts/test-writer-lease-server.mjs +234 -0
  335. package/kits/hub-game/scripts/test-writer-lease.mjs +281 -0
  336. package/kits/hub-game/scripts/writer-storage-fixture.mjs +37 -0
  337. package/kits/hub-game/tools/hubScene/export.mjs +6 -5
  338. package/kits/hub-game/tools/hubScene/hubdata.mjs +10 -0
  339. package/kits/hub-game/tools/hubScene/test/export-fixture.mjs +36 -2
  340. package/kits/hub-game/tools/hubScene/validate-manifest.mjs +10 -2
  341. package/kits/multiplayer-3d/castle.json +5 -5
  342. package/kits/multiplayer-3d/code/client/resumeGate.js +66 -2
  343. package/kits/multiplayer-3d/code/server/ownership.js +25 -6
  344. package/kits/multiplayer-3d/code/server/world.js +19 -4
  345. package/kits/multiplayer-3d/code/systems/multiplayer.js +108 -18
  346. package/kits/multiplayer-3d/package-lock.json +1 -1
  347. package/kits/multiplayer-3d/package.json +2 -1
  348. package/kits/multiplayer-3d/scripts/test-ground-half.mjs +56 -0
  349. package/kits/multiplayer-3d/scripts/test-join-watchdog.mjs +54 -3
  350. package/kits/multiplayer-3d/scripts/test-owned-moves.mjs +190 -0
  351. package/kits/multiplayer-3d/scripts/test-resume-gate.mjs +417 -5
  352. package/kits/multiplayer-3d/scripts/test-resync-reconnect.mjs +68 -0
  353. package/kits/physics-2d/castle.json +2 -2
  354. package/kits/physics-2d/engine/scene.js +10 -2
  355. package/kits/physics-3d/CLAUDE.md +14 -0
  356. package/kits/physics-3d/behaviors/Player.jsx +39 -3
  357. package/kits/physics-3d/castle.json +3 -3
  358. package/kits/physics-3d/docs/engine-model-cache.md +109 -0
  359. package/kits/physics-3d/docs/engine-player.md +76 -0
  360. package/kits/physics-3d/docs/engine-skip-work.md +16 -0
  361. package/kits/physics-3d/docs/pxmodel-format.md +5 -1
  362. package/kits/physics-3d/engine3d/gait.js +16 -8
  363. package/kits/physics-3d/engine3d/groundsize.js +23 -0
  364. package/kits/physics-3d/engine3d/kithooks.js +50 -0
  365. package/kits/physics-3d/engine3d/look.js +110 -17
  366. package/kits/physics-3d/engine3d/lookbake.js +19 -1
  367. package/kits/physics-3d/engine3d/materialpresets.js +3 -2
  368. package/kits/physics-3d/engine3d/modelcache.js +280 -0
  369. package/kits/physics-3d/engine3d/modelcachedigest.js +37 -0
  370. package/kits/physics-3d/engine3d/modelcachegate.js +69 -0
  371. package/kits/physics-3d/engine3d/modelrefs.js +13 -0
  372. package/kits/physics-3d/engine3d/optimize.js +20 -9
  373. package/kits/physics-3d/engine3d/playerRun.js +26 -1
  374. package/kits/physics-3d/engine3d/pxmodel.js +7 -3
  375. package/kits/physics-3d/engine3d/templatecache.js +722 -0
  376. package/kits/physics-3d/engine3d/world3d.js +211 -17
  377. package/kits/physics-3d/package-lock.json +1 -1
  378. package/kits/physics-3d/package.json +2 -1
  379. package/kits/physics-3d/play/behaviors/Player.js +43 -3
  380. package/kits/physics-3d/scripts/render.mjs +56 -8
  381. package/kits/physics-3d/scripts/template-cache-fixtures.mjs +37 -0
  382. package/kits/physics-3d/scripts/template-cache-v1-bytes.json +49 -0
  383. package/kits/physics-3d/scripts/test-coaxial-escape.mjs +176 -0
  384. package/kits/physics-3d/scripts/test-gait.mjs +53 -9
  385. package/kits/physics-3d/scripts/test-ground-half.mjs +120 -0
  386. package/kits/physics-3d/scripts/test-model-cache.mjs +600 -0
  387. package/kits/physics-3d/scripts/test-orbit-shadow-fade.mjs +1 -0
  388. package/kits/physics-3d/scripts/test-sleeping-models.mjs +384 -0
  389. package/kits/physics-3d/scripts/test-template-cache-minified.mjs +106 -0
  390. package/kits/physics-3d/scripts/test-template-cache.mjs +519 -0
  391. package/kits/physics-3d/scripts/test-wall-slide.mjs +272 -0
  392. package/kits/physics-3d/systems/physics3d.js +59 -2
  393. package/kits/real-time/castle.json +2 -2
  394. package/kits/real-time/code/client/connection.js +3 -0
  395. package/package.json +2 -2
  396. package/vendor/three/examples/jsm/libs/fflate.module.js +2672 -0
@@ -12,6 +12,7 @@ for (let n = 3600; n <= 3700; n++) telemetry.frame(n * 1000 / 60, context);
12
12
  assert.equal(messages.length, 1);
13
13
  assert.equal(messages[0].median, 600); assert.equal(messages[0].p10, 600);
14
14
  assert.equal(messages[0].final, false);
15
+ assert.equal(JSON.stringify(messages[0]), JSON.stringify({ k: 'hub-fps', median: 600, p10: 600, ...context, final: false }), 'absent quality preserves message bytes');
15
16
  doc.hidden = true; listeners.get('visibilitychange')();
16
17
  telemetry.frame(900000, context);
17
18
  doc.hidden = false;
@@ -24,7 +25,8 @@ const calls = [], h = { place: { analytics: true, fpsTelemetry: { scene: context
24
25
  players: new Map([['p', { arrived: true }]]), session: { hub: { track: (id, event) => { calls.push([id, event]); return true; } } } };
25
26
  const session = { players: [{ playerId: 'p' }] }, player = session.players[0];
26
27
  assert.equal(fps(h, session, player, messages[0]), true);
27
- assert.equal(calls[0][1].value, 600 * 4096 + 600);
28
+ assert.equal(JSON.stringify(calls[0][1]), JSON.stringify({ kind: 26, subject: 2, value: 600 * 4096 + 600, result: 4, flags: 0 }), 'absent quality preserves track args bytes');
29
+ assert.equal(Object.hasOwn(calls[0][1], 'quality'), false);
28
30
  assert.equal(fps(h, session, player, messages[0]), false, 'rate limited');
29
31
  assert.equal(fps(h, session, player, { ...messages[0], final: true }), true, 'one departure flush');
30
32
  assert.equal(fps(h, session, player, { ...messages[0], final: true }), false);
@@ -32,6 +34,16 @@ h.sim.timeMs += 60000;
32
34
  for (const override of [{ median: NaN }, { p10: 601 }, { tier: 4 }, { avatars: 256 }, { userId: 'other' }, { scene: 'other' }]) {
33
35
  assert.equal(fps(h, session, player, { ...messages[0], ...override }), false);
34
36
  }
37
+ for (const quality of [undefined, null, '', 'low', 'high', 0, 1, 2, true, {}, []]) {
38
+ const before = calls.length;
39
+ assert.equal(fps(h, session, player, { ...messages[0], quality }), false, 'invalid quality refuses report');
40
+ assert.equal(calls.length, before);
41
+ }
42
+ for (const [quality, code] of [['hide', 1], ['skip', 2]]) {
43
+ assert.equal(fps(h, session, player, { ...messages[0], quality }), true);
44
+ assert.deepEqual(calls.at(-1)[1], { kind: 26, subject: 2, value: 600 * 4096 + 600, result: 4, flags: 0, quality: code });
45
+ h.sim.timeMs += 60000;
46
+ }
35
47
  assert.equal(fps(h, { players: [] }, player, messages[0]), false);
36
48
  h.players.get('p').arrived = false;
37
49
  assert.equal(fps(h, session, player, messages[0]), false);
@@ -94,12 +106,13 @@ system.fpsTelemetry.dispose();
94
106
 
95
107
  // The active system's render tier survives replacement of the shared debug pointer.
96
108
  const tierMethod = source.slice(source.indexOf(' deviceTier(scene, mp, now) {'), source.indexOf('\n interestFrame('));
97
- const deviceTier = new Function('Hub', 'fpsTelemetryFor', `return function ${tierMethod.trim()}`)(Hub, fpsTelemetryFor);
109
+ const deviceTier = new Function('Hub', 'fpsTelemetryFor', 'lowQuality', 'qualityFor', `return function ${tierMethod.trim()}`)(Hub, fpsTelemetryFor,
110
+ () => system.tiers.current() === 'low' ? Hub.deck.quality?.low : null, () => null);
98
111
  const previousDebug = globalThis.__hub;
99
112
  Hub.deck.tiers = true;
100
- let observedTier;
113
+ let observedTier, observedQuality;
101
114
  system.fpsNet = town.multiplayer.net;
102
- system.fpsTelemetry = { frame: (_now, next) => { observedTier = next.tier; } };
115
+ system.fpsTelemetry = { frame: (_now, next) => { observedTier = next.tier; observedQuality = next.quality; } };
103
116
  try {
104
117
  for (const [current, weakest, code] of [['low', false, 1], ['high', false, 2], ['low', true, 3]]) {
105
118
  system.tiers = { frame() {}, current: () => current, weakest: () => weakest, handle: { current } };
@@ -108,5 +121,27 @@ try {
108
121
  globalThis.__hub = { tier: { current: 'unknown' } };
109
122
  measure.call(system, town, town.multiplayer, 400001);
110
123
  assert.equal(observedTier, code);
124
+ assert.equal(observedQuality, undefined, 'no hub.quality omits mode');
125
+ }
126
+ for (const quality of ['hide', 'skip']) {
127
+ Hub.deck.quality = { low: { decor: quality } };
128
+ for (const current of ['low', 'high']) {
129
+ system.tiers = { frame() {}, current: () => current, weakest: () => false, handle: { current } };
130
+ deviceTier.call(system, town, town.multiplayer, 500000);
131
+ measure.call(system, town, town.multiplayer, 500001);
132
+ assert.equal(observedQuality, current === 'low' ? quality : undefined, 'uses active scene quality despite debug pointer');
133
+ }
111
134
  }
112
135
  } finally { globalThis.__hub = previousDebug; }
136
+
137
+ for (const quality of ['hide', 'skip', undefined]) {
138
+ const reports = [];
139
+ const t = makeFpsTelemetry({ send: (message) => reports.push(message), document: null, target: {} });
140
+ t.frame(0, { ...context, quality });
141
+ t.frame(1000, { ...context, quality });
142
+ t.leave(); t.dispose();
143
+ assert.deepEqual(reports, [{ k: 'hub-fps', median: 10, p10: 10, ...context,
144
+ ...(quality ? { quality } : {}), final: true }]);
145
+ assert.equal(Object.hasOwn(reports[0], 'quality'), quality !== undefined);
146
+ }
147
+ console.log('FPS quality modes, track encoding, omission and invalid values: passed');
@@ -1,6 +1,6 @@
1
1
  import assert from 'node:assert/strict';
2
2
  import { register } from 'node:module';
3
- import { friendsAmong, forget, resend } from '../code/server/friendsAmong.js';
3
+ import { EARLY_EMPTY_MS, EARLY_WINDOW_MS, friendsAmong, forget, resend } from '../code/server/friendsAmong.js';
4
4
  import { friendBests } from '../code/server/friendBests.js';
5
5
 
6
6
  register(`data:text/javascript,${encodeURIComponent(`
@@ -46,9 +46,16 @@ function harness({ platform = { friendsAmong: async (_id, ids) => ids }, rows =
46
46
  const identity = (_h, id) => identities.get(id) ?? null;
47
47
  h.ctx.friendsAmong = (id, ids) => friendsAmong(h, id, ids, identity);
48
48
  const api = friendBests(h, 'test', { better: 'higher' }, identity);
49
- return { h, api, sent, calls, writes, identity, saved: () => saved };
49
+ return { h, api, sent, calls, writes, identity, identities, saved: () => saved };
50
50
  }
51
51
  try {
52
+ await test('a player id that comes back as another account never inherits the old membership', async () => {
53
+ const r = harness({ platform: { friendsAmong: async (id, ids) => ids.filter((u) => u === '3') }, rows: [row('3', 9)] });
54
+ assert.equal((await r.api.friendFor('p1'))?.userId, '3');
55
+ r.identities.set('p1', '4');
56
+ assert.equal(await r.api.friendFor('p1'), null);
57
+ assert.deepEqual(await r.h.ctx.friendsAmong('p1', ['3']), []);
58
+ });
52
59
  await test('kit API is dormant until used; rejects guests, disconnects and malformed candidates', async () => {
53
60
  const r = harness();
54
61
  assert.deepEqual(r.sent, []);
@@ -97,7 +104,16 @@ try {
97
104
  assert.deepEqual(await c, ['4']);
98
105
  assert.equal(count, 2);
99
106
  });
100
- await test('empty answers retry at 40 s after the late client marker; concurrent pending reads never duplicate ops', async () => {
107
+ await test('v1.166: a session\'s first empty answer is kept 5 s, later ones 40 s; the early re-read finds a friend marked meanwhile', async () => {
108
+ const start = now;
109
+ const early = harness({ rows: [row('2', 118)], platform: { friendsAmong: async (_id, ids) => (now - start >= 3000 ? ids : []) } });
110
+ assert.equal(await early.api.friendFor('p1'), null, 'arrival precedes seen marker');
111
+ now = start + EARLY_EMPTY_MS - 1;
112
+ assert.equal(await early.api.friendFor('p1'), null);
113
+ now = start + EARLY_EMPTY_MS;
114
+ assert.deepEqual(await early.api.friendFor('p1'), { userId: '2', username: 'Mira', best: 118 });
115
+ });
116
+ await test('empty answers after the early re-read wait out the first minute, then 40 s; concurrent pending reads never duplicate ops', async () => {
101
117
  const start = now;
102
118
  const at = [];
103
119
  const r = harness({ rows: [row('2', 118)], platform: { friendsAmong: async (_id, ids) => {
@@ -105,23 +121,27 @@ try {
105
121
  return now - start >= 20000 ? ids : [];
106
122
  } } });
107
123
  assert.equal(await r.api.friendFor('p1'), null, 'arrival precedes seen marker');
108
- now = start + 24999;
109
- assert.equal(await r.api.friendFor('p1'), null);
124
+ now = start + EARLY_EMPTY_MS;
125
+ assert.equal(await r.api.friendFor('p1'), null, 'the one early re-read is still before the marker');
126
+ assert.deepEqual(at, [start, start + EARLY_EMPTY_MS]);
127
+ const redo = start + EARLY_WINDOW_MS;
110
128
  now = start + 39999;
111
129
  assert.equal(await r.api.friendFor('p1'), null);
112
- assert.equal(at.length, 1);
113
- now = start + 40000;
130
+ now = redo - 1;
131
+ assert.equal(await r.api.friendFor('p1'), null);
132
+ assert.equal(at.length, 2, 'the next read waits a minute from the first');
133
+ now = redo;
114
134
  const [a, b] = await Promise.all([r.api.friendFor('p1'), r.api.friendFor('p1')]);
115
135
  assert.deepEqual(a, { userId: '2', username: 'Mira', best: 118 });
116
136
  assert.deepEqual(b, a);
117
- assert.deepEqual(at, [start, start + 40000]);
137
+ assert.deepEqual(at, [start, start + EARLY_EMPTY_MS, redo]);
118
138
  now += 599999;
119
139
  assert.deepEqual(await r.api.friendFor('p1'), a);
120
- assert.equal(at.length, 2);
140
+ assert.equal(at.length, 3);
121
141
  now++;
122
142
  assert.deepEqual(await r.api.friendFor('p1'), a);
123
- assert.equal(at.length, 3);
124
- assert.ok(at.slice(1).every((time, i) => time - at[i] >= 25000));
143
+ assert.equal(at.length, 4);
144
+ assert.ok(at.slice(2).every((time, i) => time - at[i + 1] >= 25000));
125
145
 
126
146
  let settle, asks = 0;
127
147
  const pending = harness({ platform: { friendsAmong: () => {
@@ -141,9 +161,15 @@ try {
141
161
  let calls = 0;
142
162
  const r = harness({ platform: { friendsAmong: async () => { calls++; throw Object.assign(new Error(), { code }); } } });
143
163
  assert.deepEqual(await r.h.ctx.friendsAmong('p1', ['2']), []);
144
- now += 25000;
164
+ now += EARLY_EMPTY_MS - 1;
145
165
  assert.deepEqual(await r.h.ctx.friendsAmong('p1', ['2']), []);
146
166
  assert.equal(calls, 1);
167
+ // v1.166: the session's first refusal is provisional; one re-read, then 40 s.
168
+ now += 1;
169
+ assert.deepEqual(await r.h.ctx.friendsAmong('p1', ['2']), []);
170
+ now += 25000;
171
+ assert.deepEqual(await r.h.ctx.friendsAmong('p1', ['2']), []);
172
+ assert.equal(calls, 2);
147
173
  }
148
174
  assert.deepEqual(await harness({ platform: {} }).h.ctx.friendsAmong('p1', ['2']), []);
149
175
  });
@@ -0,0 +1,75 @@
1
+ // A tap's click only reaches the control its pointerdown went to. In
2
+ // landscape the Character button opens its strip over itself on pointerdown,
3
+ // and the tap's click, hit-tested where the finger lifts, used to land on the
4
+ // tile now under it: the strip picked that character and shut at once. Real
5
+ // chrome in a real browser (the same GPU launcher as the other DOM tests),
6
+ // with synthetic events and a real CDP touch tap.
7
+ import assert from 'node:assert/strict';
8
+ import { build } from 'vite';
9
+ import { chromium } from 'playwright-core';
10
+ import { launchChromium, logRenderer } from '../../../experiments/hub-town/qa/launch.mjs';
11
+
12
+ const bundle = await build({ configFile: false, logLevel: 'silent', build: {
13
+ write: false, lib: { entry: new URL('../code/client/chrome.js', import.meta.url).pathname, name: 'HubChrome', formats: ['iife'] },
14
+ } });
15
+ const browser = await launchChromium(chromium, { executablePath: process.env.CHROME });
16
+ try {
17
+ const context = await browser.newContext({ viewport: { width: 844, height: 390 }, hasTouch: true, isMobile: true });
18
+ const page = await context.newPage();
19
+ await page.setContent('<meta name="viewport" content="width=device-width,initial-scale=1"><style>body{margin:0}</style>');
20
+ await logRenderer(page);
21
+ await page.addScriptTag({ content: (Array.isArray(bundle) ? bundle[0] : bundle).output[0].code });
22
+ const mount = () => page.evaluate(() => {
23
+ globalThis.hubChrome?.dispose();
24
+ globalThis.picked = [];
25
+ globalThis.clicked = [];
26
+ if (!globalThis.watching) {
27
+ globalThis.watching = true;
28
+ window.addEventListener('click', (e) => clicked.push(e.target.closest?.('button')?.getAttribute('aria-label') ?? e.target.textContent), true);
29
+ }
30
+ globalThis.hubChrome = HubChrome.makeChrome({ avatarCount: 24, onBack() {}, onAvatar: (i) => picked.push(i) });
31
+ hubChrome.showPicker(true, 0);
32
+ });
33
+ const state = () => page.evaluate(() => {
34
+ const toggle = [...document.querySelectorAll('button')].find((b) => b.textContent === 'Character');
35
+ const tiles = [...document.querySelectorAll('button[aria-label^="Character"]')].filter((b) => b !== toggle);
36
+ return { picked: [...picked], open: tiles.some((b) => b.offsetParent !== null) };
37
+ });
38
+ // Dispatched as the browser would: pointerdown on one element, click on another.
39
+ const tap = (down, up, detail = 1) => page.evaluate(({ down, up, detail }) => {
40
+ const toggle = [...document.querySelectorAll('button')].find((b) => b.textContent === 'Character');
41
+ const tiles = [...document.querySelectorAll('button[aria-label^="Character"]')].filter((b) => b !== toggle);
42
+ const pick = (name) => (name === 'toggle' ? toggle : tiles[0]);
43
+ if (down) {pick(down).dispatchEvent(new PointerEvent('pointerdown', { bubbles: true, cancelable: true, composed: true, pointerType: 'touch', isPrimary: true }));}
44
+ if (detail === 0) {pick(up).click();}
45
+ else {pick(up).dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, composed: true, detail }));}
46
+ }, { down, up, detail });
47
+
48
+ await mount();
49
+ await tap('toggle', 'tile');
50
+ assert.deepEqual(await state(), { picked: [], open: true }, 'a click off the toggle its pointerdown opened from is dropped');
51
+
52
+ await tap('tile', 'tile');
53
+ assert.deepEqual(await state(), { picked: [0], open: false }, 'a pointerdown and click on the same tile picks it');
54
+
55
+ await mount();
56
+ await tap('toggle', 'tile');
57
+ await tap(null, 'tile', 0);
58
+ assert.deepEqual(await state(), { picked: [0], open: false }, 'a keyboard click (detail 0) still picks');
59
+
60
+ // A real finger: CDP touch at the Character button's centre, on a landscape phone.
61
+ await mount();
62
+ const box = await page.getByRole('button', { name: 'Character', exact: true }).boundingBox();
63
+ const x = box.x + box.width / 2, y = box.y + box.height / 2;
64
+ const cdp = await context.newCDPSession(page);
65
+ await cdp.send('Input.dispatchTouchEvent', { type: 'touchStart', touchPoints: [{ x, y }] });
66
+ await cdp.send('Input.dispatchTouchEvent', { type: 'touchEnd', touchPoints: [] });
67
+ await page.waitForTimeout(300);
68
+ const clicked = await page.evaluate(() => clicked);
69
+ const touch = await state();
70
+ console.log(`touch tap on Character at ${Math.round(x)},${Math.round(y)}: its click went to ${JSON.stringify(clicked)}; ${JSON.stringify(touch)}`);
71
+ assert.deepEqual(touch, { picked: [], open: true }, 'a real touch tap opens the strip and picks nothing');
72
+
73
+ await page.evaluate(() => hubChrome.dispose());
74
+ console.log('ghost click DOM tests passed: toggle-to-tile click dropped, same-tile and keyboard clicks pick, real touch tap opens the strip');
75
+ } finally { await browser.close(); }
@@ -37,7 +37,7 @@ const PILLOW = { kind: 'sphere', radius: 0.3 };
37
37
 
38
38
  // One client in a place: the player at the origin facing +z, and loose
39
39
  // objects `{ id: { x, z, y?, shape? } }`, all this client's to begin with.
40
- function rig(grab, objects) {
40
+ function rig(grab, objects, refuse = undefined) {
41
41
  hub.place = grab === null ? {} : { grab };
42
42
  hub.hidden.clear();
43
43
  hub.held.clear();
@@ -50,7 +50,7 @@ function rig(grab, objects) {
50
50
  onGrab: (fn) => (press = fn),
51
51
  grabPrompt: (text) => prompts.push(text),
52
52
  };
53
- const g = makeGrab(chrome);
53
+ const g = makeGrab(chrome, refuse);
54
54
  const actors = new Map();
55
55
  const bodies = new Map();
56
56
  for (const [id, o] of Object.entries(objects)) {
@@ -143,6 +143,20 @@ test('without reach or steady: the 1.6 m reach, the 60 degree cone, and ownershi
143
143
  }
144
144
  });
145
145
 
146
+ test('v1.204: a grab or throw press refused while catching up says why, sends nothing and holds nothing', () => {
147
+ let catching = true; const refusals = [];
148
+ const { step, grabs, sent, g } = rig({ ...GRAB_DEFAULTS }, { a: at(1.5, 0) }, () => { if (!catching) {return false;} refusals.push(1); return true; });
149
+ assert.equal(step(), 'Grab');
150
+ step(16, true);
151
+ assert.deepEqual(grabs(), []); assert.equal(g.holding(), null); assert.equal(refusals.length, 1);
152
+ step(); assert.equal(refusals.length, 1, 'a frame without a press says nothing');
153
+ catching = false; step(16, true);
154
+ assert.deepEqual(grabs(), ['a']); assert.equal(g.holding(), 'a');
155
+ catching = true; const before = sent.length; step(16, true);
156
+ assert.equal(g.holding(), 'a', 'a refused throw keeps the hold'); assert.equal(refusals.length, 2);
157
+ assert.equal(sent.slice(before).some((d) => d.op === 'throw'), false);
158
+ });
159
+
146
160
  test('without reach or steady: a big object is offered past 3.5 m centre to centre, as before', () => {
147
161
  // A wide box (1.84 m from centre to edge) whose centre is 3.4 m out and
148
162
  // 1.8 m up: the v1.22 centre bound applies only to a place that asks.
@@ -274,6 +288,19 @@ test('steady: the grace ends after 600 ms and the button goes; another object ta
274
288
  assert.equal(step(STEADY_GRACE_MS + 100), 'Grab');
275
289
  });
276
290
 
291
+ test('v1.204, steady: a press queued before catching up grabs nothing during it', () => {
292
+ // Queue the press while the object is briefly someone else's.
293
+ const queued = rig({ ...GRAB_DEFAULTS, steady: true }, { a: at(1.5, 0) });
294
+ queued.step(); queued.mine.delete('a'); queued.step(16, true);
295
+ hub.catching = 0;
296
+ queued.mine.add('a'); queued.step();
297
+ assert.deepEqual(queued.grabs(), [], 'the queued press is dropped while catching');
298
+ assert.equal(queued.g.holding(), null);
299
+ hub.catching = null;
300
+ queued.step();
301
+ assert.deepEqual(queued.grabs(), [], 'and does not come back after');
302
+ });
303
+
277
304
  test('steady: a press in the grace waits for the object to be this client’s again, then grabs it', () => {
278
305
  const { step, mine, grabs, sent } = rig({ ...GRAB_DEFAULTS, steady: true }, { a: at(1.5, 0) });
279
306
  assert.equal(step(), 'Grab');