@wildshard/engine 0.1.17 → 0.1.19

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 (343) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/budgets/shard-size-baseline.json +10 -4
  3. package/index.html +6 -4
  4. package/lint/engine-sides.json +21 -0
  5. package/lint/host-callback-syntax.mjs +2 -1
  6. package/lint/host-callbacks.mjs +3 -3
  7. package/lint/host-files.mjs +5 -4
  8. package/lint/no-base64.mjs +3 -1
  9. package/lint/ratchet.json +0 -68
  10. package/lint/ratchet.mjs +1 -4
  11. package/lint/shard-imports.mjs +6 -7
  12. package/lint/shard-source.d.mts +9 -0
  13. package/lint/shard-source.mjs +91 -0
  14. package/lint/shardfile-boundaries.mjs +10 -8
  15. package/lint/sim-closure.mjs +6 -3
  16. package/lint/wildshard-plugin.d.ts +4 -0
  17. package/lint/wildshard-plugin.js +22 -23
  18. package/package.json +25 -16
  19. package/scripts/agent-sync.mjs +27 -8
  20. package/scripts/app-build/appCook.ts +8 -2
  21. package/scripts/app-build/catalogue.ts +10 -7
  22. package/scripts/app-build/gen.ts +22 -2
  23. package/scripts/app-build/isolation.d.mts +10 -0
  24. package/scripts/app-build/isolation.mjs +47 -0
  25. package/scripts/app-build/outputProducts.d.mts +3 -0
  26. package/scripts/app-build/outputProducts.mjs +35 -0
  27. package/scripts/app-build/previousDeploy.d.mts +2 -0
  28. package/scripts/app-build/previousDeploy.mjs +10 -1
  29. package/scripts/app-build/serviceWorker.ts +10 -3
  30. package/scripts/app-build/splitOutput.mjs +4 -2
  31. package/scripts/app-build/standaloneOutput.d.mts +1 -1
  32. package/scripts/app-build/standaloneOutput.mjs +5 -3
  33. package/scripts/app-build/titlePreloads.d.mts +8 -0
  34. package/scripts/app-build/titlePreloads.mjs +69 -0
  35. package/scripts/app-build/worldMapAtlas.ts +10 -6
  36. package/scripts/app-build-pipeline.mjs +34 -3
  37. package/scripts/built-product.mjs +1 -1
  38. package/scripts/cell-mem-bench.mjs +81 -23
  39. package/scripts/check-custom-sections-zero.mjs +1 -1
  40. package/scripts/check-devserver.mjs +3 -1
  41. package/scripts/check-models.mjs +2 -0
  42. package/scripts/check-paths.allow.json +0 -115
  43. package/scripts/check-paths.mjs +2 -2
  44. package/scripts/check-platform-ratchets.mjs +2 -3
  45. package/scripts/chromium-keychain-check.mjs +4 -2
  46. package/scripts/chromium-keychain.d.mts +1 -1
  47. package/scripts/chromium-keychain.mjs +3 -1
  48. package/scripts/ci-static.sh +1 -1
  49. package/scripts/committed-fast-checks.mjs +0 -2
  50. package/scripts/content-sw-proof.mjs +2 -1
  51. package/scripts/cook-worker.mjs +9 -3
  52. package/scripts/cook.mjs +20 -3
  53. package/scripts/devices.d.mts +4 -0
  54. package/scripts/devices.mjs +39 -0
  55. package/scripts/devserver-client.d.mts +4 -2
  56. package/scripts/devserver-client.mjs +25 -8
  57. package/scripts/docs-inputs-proof.mjs +6 -6
  58. package/scripts/doctor-proof.mjs +1 -1
  59. package/scripts/e2e-faults.mjs +159 -0
  60. package/scripts/e7-voice-staging-proof.mjs +1 -1
  61. package/scripts/gate-related-tests.mjs +1 -1
  62. package/scripts/git-source-view.mjs +1 -1
  63. package/scripts/goldens/capture.mjs +17 -5
  64. package/scripts/grid-crossing-nightly.mjs +59 -0
  65. package/scripts/grid-crossing-qa.mjs +44 -0
  66. package/scripts/grid-crossing-ratchet.d.mts +6 -0
  67. package/scripts/grid-crossing-ratchet.mjs +52 -0
  68. package/scripts/grid-crossing-report.mjs +122 -0
  69. package/scripts/grid-crossing-stages.mjs +47 -0
  70. package/scripts/grid-crossing-tour.mjs +277 -0
  71. package/scripts/grid-crossing-walk-proof.mjs +136 -18
  72. package/scripts/host-ruler/roots.mjs +2 -2
  73. package/scripts/host-ruler.d.mts +91 -0
  74. package/scripts/host-ruler.mjs +565 -0
  75. package/scripts/live-prepush.py +3 -5
  76. package/scripts/loading-flow/benchmax.mjs +3 -1
  77. package/scripts/look-loop/test_look_loop.py +1 -38
  78. package/scripts/memory-proof.mjs +213 -0
  79. package/scripts/mmo-bots.mjs +8 -2
  80. package/scripts/net-lag-proof.mjs +219 -0
  81. package/scripts/night-market-kit-budget.mjs +2 -2
  82. package/scripts/offline-proof-rules.d.mts +5 -3
  83. package/scripts/offline-proof-rules.mjs +34 -7
  84. package/scripts/offline-proof.mjs +88 -18
  85. package/scripts/{shard-platform-output.mjs → output-reader.mjs} +1 -1
  86. package/scripts/page-release/content.d.mts +9 -1
  87. package/scripts/page-release/content.mjs +131 -17
  88. package/scripts/page-release/flow.mjs +36 -10
  89. package/scripts/page-release/stamp-content.mjs +24 -0
  90. package/scripts/page-release.mjs +28 -6
  91. package/scripts/page-size.mjs +2 -1
  92. package/scripts/pin-packs.ts +1 -1
  93. package/scripts/pins.ts +4 -4
  94. package/scripts/precommit-checks.mjs +1 -7
  95. package/scripts/precommit-jobs.mjs +0 -1
  96. package/scripts/precommit-source.py +1 -9
  97. package/scripts/program-discovery.mjs +1 -1
  98. package/scripts/ring-cook.mjs +2 -1
  99. package/scripts/ring-step.ts +1 -1
  100. package/scripts/script-scenario-metrics.mjs +1 -1
  101. package/scripts/shard-output-content.d.mts +1 -1
  102. package/scripts/shard-output-content.mjs +2 -2
  103. package/scripts/shard-outputs.mjs +1 -1
  104. package/scripts/shard-public.mjs +1 -1
  105. package/scripts/shard-wire-meter.mjs +24 -9
  106. package/scripts/side-parity.mjs +4 -2
  107. package/scripts/standalone-smoke.mjs +8 -3
  108. package/scripts/tier-textures-proof.mjs +101 -0
  109. package/scripts/tier-textures.mjs +78 -0
  110. package/scripts/tile-bake-report.mjs +1 -1
  111. package/scripts/tile-bakes.mjs +1 -1
  112. package/scripts/title-assets.generated.json +2 -0
  113. package/scripts/tsconfig.json +1 -2
  114. package/scripts/vendor/basisu/LICENSE +201 -0
  115. package/scripts/vendor/basisu/basis_encoder.cjs +2 -0
  116. package/scripts/vendor/basisu/basis_encoder.wasm +0 -0
  117. package/scripts/vitest-push-guards.config.ts +1 -1
  118. package/scripts/vps/harden-apply.sh +4 -1
  119. package/scripts/vps/harden-prometheus.sh +176 -0
  120. package/scripts/vps/harden.sh +16 -0
  121. package/scripts/vps/rebuild.sh +18 -0
  122. package/scripts/vps/wildshard-config +84 -24
  123. package/scripts/worker-client-play.mjs +7 -2
  124. package/scripts/worker-client-proof.mjs +1 -1
  125. package/scripts/worker-client-slug.mjs +44 -0
  126. package/scripts/worktree-reap.mjs +5 -5
  127. package/src/.oxlintrc.json +3 -182
  128. package/src/client/app/entry.ts +47 -12
  129. package/src/client/engine/boot/bootCache.ts +2 -2
  130. package/src/client/engine/boot/bootTrace.ts +12 -4
  131. package/src/client/engine/boot/browserChunkRecovery.ts +4 -0
  132. package/src/client/engine/boot/clearDownloads.ts +5 -2
  133. package/src/client/engine/boot/contentRead.ts +11 -0
  134. package/src/client/engine/boot/gpuFiles.ts +4 -2
  135. package/src/client/engine/boot/lastEnd.ts +99 -12
  136. package/src/client/engine/boot/parsedPages.ts +127 -58
  137. package/src/client/engine/boot/texturePack.ts +2 -2
  138. package/src/client/engine/build.d.ts +2 -0
  139. package/src/client/engine/core/Game.ts +18 -0
  140. package/src/client/engine/core/bootstrap.ts +4 -1
  141. package/src/client/engine/debug/probe.ts +18 -1
  142. package/src/client/engine/fx/LightPool.ts +41 -1
  143. package/src/client/engine/net/netPlayer.ts +19 -2
  144. package/src/client/engine/net/otherPlayers.ts +55 -8
  145. package/src/client/engine/net/predictor.ts +33 -9
  146. package/src/client/engine/net/redial.ts +29 -6
  147. package/src/client/engine/pwa/cacheNames.ts +58 -1
  148. package/src/client/engine/pwa/sw.js +53 -14
  149. package/src/client/engine/render/dataLook.ts +152 -40
  150. package/src/client/engine/render/families/detail.ts +89 -0
  151. package/src/client/engine/render/families/pbr.ts +7 -1
  152. package/src/client/engine/render/look.ts +6 -0
  153. package/src/client/engine/render/lookLight.ts +103 -11
  154. package/src/client/engine/render/lookRender.ts +105 -0
  155. package/src/client/engine/render/precompile.ts +20 -14
  156. package/src/client/engine/saves/indexed.ts +2 -2
  157. package/src/client/engine/telemetry/browserErrors.ts +28 -4
  158. package/src/client/engine/telemetry/deviceSnapshot.ts +155 -0
  159. package/src/client/engine/telemetry/staleBuildReport.ts +22 -1
  160. package/src/client/engine/ui/debugOptions.ts +1 -1
  161. package/src/client/engine/ui/lookLightOption.ts +10 -6
  162. package/src/client/engine/ui/namePrompt.ts +7 -0
  163. package/src/client/game/boot/audio.generated.ts +114 -216
  164. package/src/client/game/boot/bytes.generated.ts +118 -238
  165. package/src/client/game/boot/placedSpawn.ts +35 -0
  166. package/src/client/game/boot/spawnDownload.ts +25 -6
  167. package/src/client/game/boot/versions.generated.ts +7 -7
  168. package/src/client/game/devScene/hook.ts +291 -0
  169. package/src/client/game/grid/area.ts +38 -0
  170. package/src/client/game/grid/cellLoading.ts +12 -2
  171. package/src/client/game/grid/live.ts +134 -12
  172. package/src/client/game/grid/liveSession.ts +47 -5
  173. package/src/client/game/grid/mapAtlas.ts +18 -4
  174. package/src/client/game/grid/menu.ts +4 -0
  175. package/src/client/game/grid/minimapBlend.ts +15 -5
  176. package/src/client/game/grid/neighbourPanels.ts +10 -1
  177. package/src/client/game/grid/oneWayIn.ts +5 -1
  178. package/src/client/game/grid/placedCards.ts +55 -0
  179. package/src/client/game/grid/placedCells.ts +233 -0
  180. package/src/client/game/grid/placedContent.ts +85 -0
  181. package/src/client/game/grid/prefetch.ts +9 -1
  182. package/src/client/game/grid/productInputs.ts +3 -1
  183. package/src/client/game/grid/productLeases.ts +4 -1
  184. package/src/client/game/grid/products.ts +8 -4
  185. package/src/client/game/grid/regionalRuntime.ts +6 -0
  186. package/src/client/game/grid/regionalWorld.ts +15 -2
  187. package/src/client/game/grid/roadCull.ts +44 -14
  188. package/src/client/game/grid/roadLook.ts +24 -15
  189. package/src/client/game/grid/roadLookPlatform.ts +4 -2
  190. package/src/client/game/grid/roadResources.ts +24 -0
  191. package/src/client/game/grid/roadSign.worker.ts +4 -3
  192. package/src/client/game/grid/roadSignPaint.ts +16 -5
  193. package/src/client/game/grid/roadSignPreparation.ts +4 -3
  194. package/src/client/game/grid/roadSignScale.ts +8 -0
  195. package/src/client/game/grid/roadTileBacking.ts +13 -3
  196. package/src/client/game/grid/roadTileCapture.worker.ts +3 -1
  197. package/src/client/game/grid/roadTileCaptureWorker.ts +2 -1
  198. package/src/client/game/grid/roadTileWrite.worker.ts +4 -2
  199. package/src/client/game/grid/roadTileWriter.ts +2 -1
  200. package/src/client/game/grid/screenReports.ts +39 -0
  201. package/src/client/game/grid/session.ts +29 -4
  202. package/src/client/game/grid/shardfileFar.ts +9 -3
  203. package/src/client/game/grid/softWallLook.ts +25 -8
  204. package/src/client/game/mainMenu.ts +6 -2
  205. package/src/client/game/plugin/context.ts +2 -1
  206. package/src/client/game/plugin/followedMovers.ts +7 -1
  207. package/src/client/game/quest/figures.ts +2 -0
  208. package/src/client/game/session/finish.ts +11 -1
  209. package/src/client/game/shard/titleList.ts +6 -2
  210. package/src/client/game/shardfile/assetCache.ts +4 -4
  211. package/src/client/game/shardfile/client.ts +4 -1
  212. package/src/client/game/shardfile/clientAssets.ts +9 -5
  213. package/src/client/game/shardfile/clientLibrary.ts +1 -1
  214. package/src/client/game/shardfile/clientWater.ts +51 -9
  215. package/src/client/game/shardfile/clientWorker.ts +21 -8
  216. package/src/client/game/shardfile/look.ts +8 -3
  217. package/src/client/game/shardfile/product.ts +34 -7
  218. package/src/client/game/shardfile/productChecks.ts +2 -2
  219. package/src/client/game/shardfile/productCost.ts +2 -2
  220. package/src/client/game/shardfile/readAsset.ts +2 -2
  221. package/src/client/game/shardfile/reflectingWater.ts +73 -0
  222. package/src/client/game/shardfile/seatGrace.ts +9 -0
  223. package/src/client/game/shardfile/skinPlayback.ts +1 -1
  224. package/src/client/game/systems/npc/figureRows.ts +9 -0
  225. package/src/client/game/titleDeck.ts +4 -3
  226. package/src/client/host/online/doctor.ts +2 -0
  227. package/src/client/host/online/linkScreens.ts +30 -4
  228. package/src/client/host/online/shell.ts +14 -0
  229. package/src/client/host/standalone/shell.ts +4 -0
  230. package/src/cook/game/astc6Encode.ts +55 -0
  231. package/src/cook/game/astc6Wasm.ts +176 -0
  232. package/src/cook/game/cookJob.ts +30 -6
  233. package/src/cook/game/cookWorker.ts +38 -11
  234. package/src/cook/game/entryTotals.ts +51 -24
  235. package/src/cook/game/shardCook.ts +67 -9
  236. package/src/cook/game/spawnParts.ts +33 -8
  237. package/src/cook/game/tierTextures.ts +349 -0
  238. package/src/e2e/smoke/game.ts +19 -14
  239. package/src/e2e/smoke/page-globals.d.ts +9 -8
  240. package/src/e2e/smoke/template2.spec.ts +8 -7
  241. package/src/server/engine/ai/bossContenders.ts +27 -3
  242. package/src/server/engine/ai/phases.ts +1 -1
  243. package/src/server/engine/entities/creatureRefill.ts +9 -2
  244. package/src/server/engine/net/ledgerBook.ts +2 -0
  245. package/src/server/engine/net/room.ts +15 -0
  246. package/src/server/engine/sim/respawn.ts +8 -0
  247. package/src/server/game/boss/arenaRoomEntry.ts +5 -1
  248. package/src/server/game/boss/arenaRoomNative.ts +2 -0
  249. package/src/server/game/boss/native.ts +2 -1
  250. package/src/server/game/boss/nativeWake.ts +9 -5
  251. package/src/server/game/boss/openArenaNative.ts +2 -2
  252. package/src/server/game/boss/openArenaRoom.ts +3 -1
  253. package/src/server/game/grid/room.ts +44 -3
  254. package/src/server/game/grid/simulation.ts +23 -0
  255. package/src/server/game/population/mixedRoster.ts +11 -3
  256. package/src/server/game/population/nativeBake.ts +8 -3
  257. package/src/server/game/population/nativeReturns.ts +6 -3
  258. package/src/server/game/population/roster.ts +5 -3
  259. package/src/server/game/quest/eliteDrops.ts +15 -4
  260. package/src/server/game/quest/nativeChapter.ts +1 -1
  261. package/src/server/game/quest/nativeComposition.ts +5 -1
  262. package/src/server/game/riding/nativeTaming.ts +10 -6
  263. package/src/server/game/riding/wildRefill.ts +3 -2
  264. package/src/server/game/shardfile/bossRow.ts +4 -2
  265. package/src/server/game/shardfile/homeKeeper.ts +4 -2
  266. package/src/server/host/bake/headlessWorker.ts +1 -1
  267. package/src/server/host/dedicated/cellHost.ts +98 -16
  268. package/src/server/host/dedicated/cellProtocol.ts +16 -1
  269. package/src/server/host/dedicated/cellWorker.ts +8 -5
  270. package/src/server/host/dedicated/dedicatedRoom.ts +16 -6
  271. package/src/server/host/dedicated/gridCells.ts +15 -6
  272. package/src/server/host/dedicated/loopLag.ts +21 -0
  273. package/src/server/host/dedicated/main.ts +13 -5
  274. package/src/server/host/dedicated/packReader.ts +3 -3
  275. package/src/server/host/dedicated/placementFile.ts +4 -19
  276. package/src/server/host/dedicated/roadRoom.ts +34 -4
  277. package/src/server/host/dedicated/serverMetrics.ts +126 -0
  278. package/src/server/host/dedicated/socketPump.ts +21 -4
  279. package/src/server/host/dedicated/socketTransport.ts +2 -1
  280. package/src/server/host/dedicated/workerTable.ts +15 -4
  281. package/src/server/host/dedicated/world.ts +95 -8
  282. package/src/server/host/headless.ts +1 -1
  283. package/src/server/host/headlessRuntime.ts +1 -1
  284. package/src/server/host/standalone/roadWorld.ts +15 -3
  285. package/src/server/host/standalone/serverHost.ts +4 -1
  286. package/src/server/host/standalone/serverProduct.ts +41 -11
  287. package/src/shared/engine/ai/BossBrain.ts +8 -0
  288. package/src/shared/engine/net/deviceWord.ts +138 -0
  289. package/src/shared/engine/net/socketFrames.ts +7 -4
  290. package/src/shared/game/boss/wake.ts +6 -0
  291. package/src/shared/game/devColliders.ts +47 -0
  292. package/src/shared/game/eliteSystem.ts +8 -0
  293. package/src/shared/game/grid/allocator.ts +3 -0
  294. package/src/shared/game/grid/catalogueSlot.ts +7 -0
  295. package/src/shared/game/grid/placementRows.ts +36 -0
  296. package/src/shared/game/plugin/bossRecord.ts +3 -2
  297. package/src/shared/game/shardfile/ktx2Targets.ts +23 -3
  298. package/src/shared/game/shardfile/outputDescriptor.ts +9 -5
  299. package/src/shared/game/shardfile/packReads.ts +28 -3
  300. package/src/shared/game/shardfile/serverPack.ts +9 -0
  301. package/src/shared/game/systems/looks/trampleField.ts +2 -0
  302. package/src/shared/host/formatJsonSchema.ts +2 -2
  303. package/src/tsconfig.json +1 -27
  304. package/lint/host-reviews.json +0 -14
  305. package/lint/listed-view-code.json +0 -13
  306. package/lint/platform-pending-users.json +0 -2520
  307. package/lint/platform-pending-users.md +0 -18
  308. package/scripts/cell-mem/metrics-preload.mjs +0 -65
  309. package/scripts/check-closed-components.d.mts +0 -7
  310. package/scripts/check-closed-components.mjs +0 -87
  311. package/scripts/g571-hosts.d.mts +0 -3
  312. package/scripts/g571-hosts.mjs +0 -54
  313. package/scripts/host-ruler/register-migrate.mjs +0 -242
  314. package/scripts/listed-view-code.d.mts +0 -7
  315. package/scripts/listed-view-code.mjs +0 -93
  316. package/scripts/look-loop/fit-lut.py +0 -142
  317. package/scripts/look-loop/palette-delta.py +0 -183
  318. package/scripts/look-loop/regions/driftwood-isle.json +0 -25
  319. package/scripts/look-loop/regions/far-reach.json +0 -225
  320. package/scripts/look-loop/regions/open-plot-night-market.json +0 -855
  321. package/scripts/look-loop/regions/pine-hollow.json +0 -22
  322. package/scripts/look-loop/regions/sunscar-dunes.json +0 -281
  323. package/scripts/platform-chargebacks.d.mts +0 -9
  324. package/scripts/platform-chargebacks.mjs +0 -135
  325. package/scripts/shard-component-spans.d.mts +0 -15
  326. package/scripts/shard-component-spans.mjs +0 -18
  327. package/scripts/shard-components.d.mts +0 -16
  328. package/scripts/shard-components.mjs +0 -363
  329. package/scripts/shard-platform-hosts.d.mts +0 -2
  330. package/scripts/shard-platform-hosts.mjs +0 -93
  331. package/scripts/shard-platform-sections.d.mts +0 -2
  332. package/scripts/shard-platform-sections.mjs +0 -9
  333. package/scripts/shard-platform.d.mts +0 -76
  334. package/scripts/shard-platform.mjs +0 -1072
  335. package/src/.oxfmtrc.json +0 -48
  336. package/src/scripts/ask-new.sh +0 -29
  337. package/src/scripts/asks.mjs +0 -142
  338. package/src/scripts/herdr-prompt.sh +0 -34
  339. package/src/scripts/herdr-question-open.sh +0 -67
  340. package/src/scripts/md-wrap.mjs +0 -229
  341. /package/scripts/{shard-platform-format.d.mts → node-format.d.mts} +0 -0
  342. /package/scripts/{shard-platform-format.mjs → node-format.mjs} +0 -0
  343. /package/scripts/{shard-platform-output.d.mts → output-reader.d.mts} +0 -0
@@ -333,10 +333,8 @@ export const ASSET_VERSIONS: Readonly<Record<string, string>> = {
333
333
  "/assets/music/patchwork-fairground/music.json": '310052c2',
334
334
  "/assets/music/patchwork-fairground/take-a-9218b66bf0b9.m4a": '9218b66b',
335
335
  "/assets/music/patchwork-fairground/take-b-0e7f6f396f9d.m4a": '0e7f6f39',
336
- "/assets/music/piano/music.json": '61d975a8',
337
- "/assets/music/pine-hollow-folk/music.json": 'e85dd102',
338
- "/assets/music/pine-hollow-orchestral/music.json": '156fb297',
339
- "/assets/music/pine-hollow-piano/music.json": '64a1d36d',
336
+ "/assets/music/piano/music.json": 'e12001b8',
337
+ "/assets/music/pine-hollow-piano/music.json": '8dc6256c',
340
338
  "/assets/music/saltwind-lighthouse/music.json": '044784de',
341
339
  "/assets/music/saltwind-lighthouse/take-a-d962afb1ace0.m4a": 'd962afb1',
342
340
  "/assets/music/saltwind-lighthouse/take-b-6533451204d4.m4a": '65334512',
@@ -571,7 +569,7 @@ export const ASSET_VERSIONS: Readonly<Record<string, string>> = {
571
569
  "/assets/sfx/alien-plain/monolith-5f8937babd37.m4a": '5f8937ba',
572
570
  "/assets/sfx/alien-plain/rock-outcrop-26127eb4de91.m4a": '26127eb4',
573
571
  "/assets/sfx/alien-plain/sfx.json": '482524ae',
574
- "/assets/sfx/best/sfx.json": '930d300a',
572
+ "/assets/sfx/best/sfx.json": '528350a9',
575
573
  "/assets/sfx/clockwork-canyon/ambience-24d7c730b7d6.m4a": '24d7c730',
576
574
  "/assets/sfx/clockwork-canyon/boiler-6032e2ff6897.m4a": '6032e2ff',
577
575
  "/assets/sfx/clockwork-canyon/clock-tick-1a1c07574d21.m4a": '1a1c0757',
@@ -595,7 +593,7 @@ export const ASSET_VERSIONS: Readonly<Record<string, string>> = {
595
593
  "/assets/sfx/desert-ruin/ruins-west-f765ff652fd4.m4a": 'f765ff65',
596
594
  "/assets/sfx/desert-ruin/sfx.json": '105df34b',
597
595
  "/assets/sfx/desert-ruin/tents-south-66cdbaee8b50.m4a": '66cdbaee',
598
- "/assets/sfx/driftwood-isle/sfx.json": '9275cc7c',
596
+ "/assets/sfx/driftwood-isle/sfx.json": 'eee1e508',
599
597
  "/assets/sfx/ember-forge/ambience-04688340a792.m4a": '04688340',
600
598
  "/assets/sfx/ember-forge/anvil-strikes-e3381c76f4ab.m4a": 'e3381c76',
601
599
  "/assets/sfx/ember-forge/bellows-feccf2e42cf7.m4a": 'feccf2e4',
@@ -656,7 +654,7 @@ export const ASSET_VERSIONS: Readonly<Record<string, string>> = {
656
654
  "/assets/sfx/patchwork-fairground/crowd-murmur-38a483e9e64c.m4a": '38a483e9',
657
655
  "/assets/sfx/patchwork-fairground/sfx.json": 'd87611b8',
658
656
  "/assets/sfx/patchwork-fairground/wheel-creak-f120165f01a9.m4a": 'f120165f',
659
- "/assets/sfx/pine-hollow/sfx.json": 'c81500dc',
657
+ "/assets/sfx/pine-hollow/sfx.json": '4d9621c3',
660
658
  "/assets/sfx/saltwind-lighthouse/basin-gulls-33a2c0cccece.m4a": '33a2c0cc',
661
659
  "/assets/sfx/saltwind-lighthouse/lighthouse-foghorn-195fbaedb647.m4a": '195fbaed',
662
660
  "/assets/sfx/saltwind-lighthouse/quay-net-rope-6f857686854b.m4a": '6f857686',
@@ -849,7 +847,9 @@ export const ASSET_VERSIONS: Readonly<Record<string, string>> = {
849
847
  "/assets/tex/wood_trunk_wall/nor_gl_1k.phone.webp": 'a70475f6',
850
848
  "/assets/title/driftwood-isle-portrait.jpg": 'e9d5c9ae',
851
849
  "/assets/title/launch-1206x2622-6afc7dd7eee8.png": '6afc7dd7',
850
+ "/assets/title/main-crossroads-landscape-first.jpg": 'f3f19648',
852
851
  "/assets/title/main-crossroads-landscape.jpg": '9437ac10',
852
+ "/assets/title/main-crossroads-square-first.jpg": '98ef65b2',
853
853
  "/assets/title/main-crossroads-square.jpg": '24abf23d',
854
854
  "/assets/title/nalati-grasslands-portrait.jpg": '5ac0c2e4',
855
855
  "/assets/title/nine-dragon-stack-portrait.jpg": 'd92d65e3',
@@ -0,0 +1,291 @@
1
+ import * as THREE from 'three';
2
+ import type { Scope } from '@wildshard/engine/app/scope';
3
+ import type { Physics } from '@wildshard/engine/physics/Physics';
4
+ import type { LookKey } from '@wildshard/engine/render/dataLook';
5
+ import type { LookStrategy } from '@wildshard/engine/render/look';
6
+ import { lampLights } from '@wildshard/engine/render/lookLight';
7
+ import type { LookLamp } from '@wildshard/format/look-light';
8
+ import type { ShardWater } from '@wildshard/format/water';
9
+ import { installClientWater } from '../shardfile/clientWater';
10
+ import { isDevColliders, swapDevBoxes, type DevBox } from '@wildshard/engine/game/devColliders';
11
+
12
+ /**
13
+ * SHARD-SOURCE AP5 (J347: engine is the deployed client and server; dev tooling is sharddev's). The dev hook: the one thing
14
+ * a DEVSERVER page carries for `wildshard watch`. sharddev owns the rest, its WebSocket server and protocol, the part diff
15
+ * and a page script `watch` injects into the page it serves; that script owns one scope per part and the swap order, and
16
+ * calls these five functions on `window.__wildshardDevHook`:
17
+ *
18
+ * addPart(name, part) draw a new part: meshes, sprites, lamps (the look's lamp lights) and water (the client's water)
19
+ * replacePart(name, part) build the new part first, then dispose the old part's scope, in one call: no frame shows neither
20
+ * removePart(name) dispose the part's scope (its boxes stay: the page script calls swapColliders(name, []))
21
+ * setLook(look) the data look's day keys (sky, fog, sun, ambient) in place: true, or false when the page's look
22
+ * can't take them live and the page must reload
23
+ * swapColliders(name, boxes) the part's solid boxes, in the page's world and the in-page server's (the worker, by its
24
+ * harness port), new set first, then the old one goes
25
+ *
26
+ * `version` is `DEV_HOOK_VERSION`; sharddev refuses a page with another (its page script) and a client whose build flags
27
+ * say another (`build-flags.json` `devHook`, written by `scripts/app-build-pipeline.mjs`). Bump it on any change to these
28
+ * signatures or to `DevPart`. A production build has none of this: `finish.ts` imports it only behind `__DEVSERVER__`, and
29
+ * `scripts/check-devserver.mjs` refuses a bundle that holds `DEV_HOOK_GLOBAL`.
30
+ */
31
+ export const DEV_HOOK_VERSION = 1;
32
+ export const DEV_HOOK_GLOBAL = '__wildshardDevHook';
33
+
34
+ export type Rgb = readonly [number, number, number];
35
+
36
+ export interface DevMaterial {
37
+ readonly key: string;
38
+ readonly name: string;
39
+ readonly kind: 'standard' | 'basic' | 'sprite';
40
+ readonly colour: Rgb;
41
+ readonly roughness: number;
42
+ readonly metalness: number;
43
+ readonly emissive: Rgb;
44
+ readonly emissiveIntensity: number;
45
+ /** a `DevTexture` key */
46
+ readonly map: string | null;
47
+ readonly repeat: readonly [number, number];
48
+ readonly offset: readonly [number, number];
49
+ readonly alphaTest: number;
50
+ readonly side: 'front' | 'back' | 'double';
51
+ readonly vertexColours: boolean;
52
+ readonly transparent: boolean;
53
+ readonly opacity: number;
54
+ readonly blending: 'normal' | 'additive';
55
+ readonly depthWrite: boolean;
56
+ readonly fog: boolean;
57
+ }
58
+
59
+ /** One RGBA8 raster, row 0 at v = 0. Immutable by key: a key the hook holds is not uploaded again. */
60
+ export interface DevTexture { readonly key: string; readonly width: number; readonly height: number; readonly colourSpace: 'srgb' | 'linear'; readonly rgba: Uint8Array }
61
+
62
+ /** One geometry in its own frame. Immutable by key, like a texture. */
63
+ export interface DevGeometry {
64
+ readonly key: string;
65
+ readonly position: Float32Array;
66
+ readonly normal: Float32Array;
67
+ readonly uv: Float32Array | null;
68
+ readonly colour: Float32Array | null;
69
+ readonly index: Uint32Array | null;
70
+ }
71
+
72
+ export interface DevDraw {
73
+ readonly geometry: string;
74
+ readonly material: string;
75
+ /** column-major world matrix */
76
+ readonly matrix: readonly number[];
77
+ readonly instances: { readonly count: number; readonly matrices: ArrayLike<number>; readonly colours: ArrayLike<number> | null } | null;
78
+ readonly castShadow: boolean;
79
+ readonly receiveShadow: boolean;
80
+ }
81
+
82
+ export interface DevSprite { readonly material: string; readonly position: readonly [number, number, number]; readonly scale: readonly [number, number]; readonly center: readonly [number, number] }
83
+
84
+ /** One part, decoded: every colour linear, every matrix column-major in world metres. Colliders come by `swapColliders`. */
85
+ export interface DevPart {
86
+ readonly materials: readonly DevMaterial[];
87
+ readonly textures: readonly DevTexture[];
88
+ readonly geometries: readonly DevGeometry[];
89
+ readonly draws: readonly DevDraw[];
90
+ readonly sprites: readonly DevSprite[];
91
+ /** the shardfile's lamp rows (`look.light.lamps`), drawn as the look's lamps are */
92
+ readonly lamps: readonly LookLamp[];
93
+ /** the shardfile's water rows, drawn as the client draws a shard's water */
94
+ readonly water: ShardWater;
95
+ }
96
+
97
+ /** The part of a shardfile look a watched page takes live. */
98
+ export interface DevLook { readonly keys: readonly LookKey[] }
99
+
100
+ export interface DevHook {
101
+ readonly version: number;
102
+ addPart: (name: string, part: DevPart) => void;
103
+ replacePart: (name: string, part: DevPart) => void;
104
+ removePart: (name: string) => void;
105
+ setLook: (look: DevLook) => boolean;
106
+ swapColliders: (name: string, boxes: readonly DevBox[]) => void;
107
+ }
108
+
109
+ export interface DevHookPorts {
110
+ readonly scope: Scope;
111
+ readonly scene: THREE.Object3D;
112
+ /** the page's physics world now (the player's prediction): a grid crossing swaps it, so the hook reads it per call;
113
+ * null on a page without one */
114
+ readonly physics: () => Physics | null;
115
+ /** the page's look now */
116
+ readonly look: () => LookStrategy | null;
117
+ /** the in-page server's half of `swapColliders` (the worker page's harness port); null when the page has none */
118
+ readonly server: () => ((name: string, boxes: readonly DevBox[]) => void) | null;
119
+ readonly watchFrames: (fn: (dt: number) => void) => () => void;
120
+ }
121
+
122
+ interface Held<T extends { dispose: () => void }> { readonly value: T; users: number }
123
+ interface LivePart { readonly scope: Scope; readonly geometries: readonly string[]; readonly textures: readonly string[] }
124
+
125
+ /** Build the hook over the page's scene and world; `installDevHook` puts it on the window. */
126
+ export function createDevHook(ports: DevHookPorts): DevHook & { readonly root: THREE.Group; held: () => { geometries: number; textures: number } } {
127
+ const { scope } = ports, root = new THREE.Group(), parts = new Map<string, LivePart>(), colliders = new Map<string, Scope>();
128
+ const boxesOf = new Map<string, readonly DevBox[]>();
129
+ let collidersIn: Physics | null = null;
130
+ const geometries = new Map<string, Held<THREE.BufferGeometry>>(), textures = new Map<string, Held<THREE.DataTexture>>();
131
+ root.name = 'devScene';
132
+ ports.scene.add(root);
133
+ scope.onDispose(() => {
134
+ for (const name of Array.from(parts.keys())) removePart(name);
135
+ root.removeFromParent();
136
+ });
137
+
138
+ const acquire = <T extends { dispose: () => void }>(map: Map<string, Held<T>>, key: string, make: () => T): T => {
139
+ const held = map.get(key);
140
+ if (held !== undefined) { held.users++; return held.value; }
141
+ const value = make();
142
+ map.set(key, { value, users: 1 });
143
+ return value;
144
+ };
145
+ const drop = <T extends { dispose: () => void }>(map: Map<string, Held<T>>, keys: readonly string[]): void => {
146
+ for (const key of keys) {
147
+ const held = map.get(key);
148
+ if (held !== undefined && --held.users === 0) { held.value.dispose(); map.delete(key); }
149
+ }
150
+ };
151
+ const release = (live: LivePart): void => { live.scope.dispose(); drop(geometries, live.geometries); drop(textures, live.textures); };
152
+
153
+ /** One part under its own scope, not yet in the scene; on a throw, everything it took is given back first. */
154
+ const build = (name: string, part: DevPart): { live: LivePart; group: THREE.Group } => {
155
+ const partScope = scope.child(`devScene.${name}`), group = new THREE.Group(), owned: { dispose: () => void }[] = [];
156
+ const geometryKeys: string[] = [], textureKeys: string[] = [], live: LivePart = { scope: partScope, geometries: geometryKeys, textures: textureKeys };
157
+ group.name = `devScene.${name}`;
158
+ partScope.onDispose(() => { group.removeFromParent(); for (const resource of owned) resource.dispose(); });
159
+ try {
160
+ const maps = new Map<string, THREE.DataTexture>(), shapes = new Map<string, THREE.BufferGeometry>();
161
+ for (const row of part.textures) { maps.set(row.key, acquire(textures, row.key, () => makeTexture(row))); textureKeys.push(row.key); }
162
+ for (const row of part.geometries) { shapes.set(row.key, acquire(geometries, row.key, () => makeGeometry(row))); geometryKeys.push(row.key); }
163
+ const need = <T>(map: Map<string, T>, key: string, what: string): T => { const value = map.get(key); if (value === undefined) throw new Error(`dev hook: part ${name} names ${what} ${key} it does not carry`); return value; };
164
+ const materials = new Map<string, THREE.Material>();
165
+ for (const row of part.materials) {
166
+ const material = makeMaterial(row, row.map === null ? null : need(maps, row.map, 'texture'), owned);
167
+ materials.set(row.key, material); owned.push(material);
168
+ }
169
+ for (const draw of part.draws) {
170
+ const material = need(materials, draw.material, 'material'), geometry = need(shapes, draw.geometry, 'geometry');
171
+ let mesh: THREE.Mesh;
172
+ if (draw.instances === null) mesh = new THREE.Mesh(geometry, material);
173
+ else {
174
+ if (draw.instances.matrices.length !== draw.instances.count * 16) throw new Error(`dev hook: part ${name} has ${draw.instances.matrices.length} instance matrix floats for ${draw.instances.count} instances`);
175
+ const instanced = new THREE.InstancedMesh(geometry, material, draw.instances.count);
176
+ owned.push(instanced);
177
+ instanced.instanceMatrix.array.set(draw.instances.matrices);
178
+ if (draw.instances.colours !== null) instanced.instanceColor = new THREE.InstancedBufferAttribute(Float32Array.from(draw.instances.colours), 3);
179
+ instanced.computeBoundingSphere();
180
+ mesh = instanced;
181
+ }
182
+ mesh.matrixAutoUpdate = false;
183
+ mesh.matrix.fromArray(draw.matrix);
184
+ mesh.castShadow = draw.castShadow; mesh.receiveShadow = draw.receiveShadow;
185
+ group.add(mesh);
186
+ }
187
+ for (const sprite of part.sprites) {
188
+ const card = new THREE.Sprite(need(materials, sprite.material, 'material') as THREE.SpriteMaterial);
189
+ card.position.set(...sprite.position); card.scale.set(sprite.scale[0], sprite.scale[1], 1); card.center.set(...sprite.center);
190
+ group.add(card);
191
+ }
192
+ if (part.lamps.length > 0) {
193
+ // the look's own lamp lights (B2, M4.3): what a baked shard's `look.light.lamps` draws
194
+ const lamps = lampLights(part.lamps);
195
+ group.add(lamps);
196
+ owned.push({ dispose: () => { for (const light of lamps.children) if (light instanceof THREE.Light) light.dispose(); } });
197
+ const { update } = lamps;
198
+ if (update !== null) { let time = 0; partScope.onDispose(ports.watchFrames(dt => { time += dt; update(time); })); }
199
+ }
200
+ // the client's own water surfaces, under this part's scope
201
+ installClientWater(part.water, { root: group, scope: partScope, frame: run => { partScope.onDispose(ports.watchFrames(run)); } });
202
+ group.updateMatrixWorld(true);
203
+ } catch (cause) { release(live); throw cause; }
204
+ return { live, group };
205
+ };
206
+
207
+ const replacePart = (name: string, part: DevPart): void => {
208
+ const { live, group } = build(name, part), old = parts.get(name);
209
+ root.add(group);
210
+ parts.set(name, live);
211
+ if (old !== undefined) release(old);
212
+ };
213
+ const addPart = (name: string, part: DevPart): void => {
214
+ if (parts.has(name)) throw new Error(`dev hook: part ${name} is already drawn (replacePart swaps it)`);
215
+ replacePart(name, part);
216
+ };
217
+ function removePart(name: string): void {
218
+ const live = parts.get(name);
219
+ if (live === undefined) return;
220
+ parts.delete(name);
221
+ release(live);
222
+ }
223
+ const setLook = (look: DevLook): boolean => {
224
+ const current = ports.look();
225
+ return current !== null && 'liveKeys' in current && current.liveKeys !== undefined && current.liveKeys(look.keys);
226
+ };
227
+ // The boxes go into the page's world as it is now. After a grid crossing that is a new world: every held part's boxes
228
+ // are made again in it, and the old world's sets are disposed (Physics skips removal from a freed world).
229
+ const swapColliders = (name: string, boxes: readonly DevBox[]): void => {
230
+ const message = { wildshardDevColliders: name, boxes };
231
+ if (!isDevColliders(message)) throw new Error(`dev hook: part ${name} has a malformed collider box`);
232
+ if (boxes.length === 0) boxesOf.delete(name); else boxesOf.set(name, boxes);
233
+ const physics = ports.physics();
234
+ if (physics !== collidersIn) {
235
+ for (const held of colliders.values()) held.dispose();
236
+ colliders.clear();
237
+ collidersIn = physics;
238
+ if (physics !== null) for (const [part, held] of boxesOf) if (part !== name) swapDevBoxes(physics, scope, colliders, part, held);
239
+ }
240
+ if (physics !== null) swapDevBoxes(physics, scope, colliders, name, boxes);
241
+ ports.server()?.(name, boxes);
242
+ };
243
+ scope.onDispose(() => { for (const held of colliders.values()) held.dispose(); colliders.clear(); });
244
+ return { version: DEV_HOOK_VERSION, root, addPart, replacePart, removePart, setLook, swapColliders,
245
+ held: () => ({ geometries: geometries.size, textures: textures.size }) };
246
+ }
247
+
248
+ /** Put the hook on the window for sharddev's page script, for the page's level. */
249
+ export function installDevHook(ports: DevHookPorts): DevHook {
250
+ const hook = createDevHook(ports), { version, addPart, replacePart, removePart, setLook, swapColliders } = hook;
251
+ ports.scope.expose(window, DEV_HOOK_GLOBAL, Object.freeze({ version, addPart, replacePart, removePart, setLook, swapColliders } satisfies DevHook));
252
+ return hook;
253
+ }
254
+
255
+ function makeMaterial(row: DevMaterial, shared: THREE.DataTexture | null, owned: { dispose: () => void }[]): THREE.Material {
256
+ let map: THREE.Texture | null = null;
257
+ if (shared !== null) {
258
+ // a clone shares the raster (one upload) and keeps its own repeat and offset, as an author's `clone()` does
259
+ map = shared.clone(); owned.push(map); map.repeat.set(...row.repeat); map.offset.set(...row.offset); map.version++;
260
+ }
261
+ const colour = new THREE.Color().setRGB(...row.colour);
262
+ const common = { name: row.name, color: colour, map, alphaTest: row.alphaTest, transparent: row.transparent, opacity: row.opacity, depthWrite: row.depthWrite, fog: row.fog,
263
+ blending: row.blending === 'additive' ? THREE.AdditiveBlending : THREE.NormalBlending };
264
+ if (row.kind === 'sprite') return new THREE.SpriteMaterial(common);
265
+ const side = row.side === 'double' ? THREE.DoubleSide : row.side === 'back' ? THREE.BackSide : THREE.FrontSide;
266
+ if (row.kind === 'basic') return new THREE.MeshBasicMaterial({ ...common, side, vertexColors: row.vertexColours });
267
+ return new THREE.MeshStandardMaterial({ ...common, side, vertexColors: row.vertexColours, roughness: row.roughness, metalness: row.metalness,
268
+ emissive: new THREE.Color().setRGB(...row.emissive), emissiveIntensity: row.emissiveIntensity });
269
+ }
270
+
271
+ function makeGeometry(source: DevGeometry): THREE.BufferGeometry {
272
+ const geometry = new THREE.BufferGeometry();
273
+ geometry.setAttribute('position', new THREE.BufferAttribute(source.position, 3));
274
+ geometry.setAttribute('normal', new THREE.BufferAttribute(source.normal, 3));
275
+ if (source.uv !== null) geometry.setAttribute('uv', new THREE.BufferAttribute(source.uv, 2));
276
+ if (source.colour !== null) geometry.setAttribute('color', new THREE.BufferAttribute(source.colour, 3));
277
+ if (source.index !== null) geometry.setIndex(new THREE.BufferAttribute(source.index, 1));
278
+ geometry.computeBoundingSphere();
279
+ return geometry;
280
+ }
281
+
282
+ function makeTexture(row: DevTexture): THREE.DataTexture {
283
+ if (row.rgba.byteLength !== row.width * row.height * 4) throw new Error(`dev hook: texture ${row.key} is ${row.rgba.byteLength} bytes, not ${row.width}x${row.height} RGBA8`);
284
+ const texture = new THREE.DataTexture(row.rgba, row.width, row.height);
285
+ texture.colorSpace = row.colourSpace === 'linear' ? THREE.LinearSRGBColorSpace : THREE.SRGBColorSpace;
286
+ texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
287
+ texture.magFilter = THREE.LinearFilter; texture.minFilter = THREE.LinearMipmapLinearFilter; texture.generateMipmaps = true;
288
+ texture.anisotropy = 4;
289
+ texture.needsUpdate = true;
290
+ return texture;
291
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * T2E-1b (TEMPLATE-E2E): the area the test probe reports. A grid page's own level is the shell (`platform.grid`); the
3
+ * player stands in one of its cells, whose shard, door panels and quest flags are what a smoke asserts on. A one-shard
4
+ * page's area is its shard.
5
+ */
6
+ import type { ProbeArea, ProbeAreaTarget } from '@wildshard/engine/debug/probe';
7
+
8
+ /** What the grid lends the probe: the cell the player is in, the catalogue cells, and per cell its panels and flags. */
9
+ export interface GridAreaPorts {
10
+ /** the cell the page stands in; null on the road between cells */
11
+ readonly current: string | null;
12
+ readonly cells: readonly { readonly instance: string; readonly slug: string }[];
13
+ readonly targets: (instance: string) => readonly ProbeAreaTarget[];
14
+ readonly flags: (instance: string) => readonly string[];
15
+ }
16
+
17
+ /** The current grid cell as the probe's area; null on the road. */
18
+ export function gridArea(ports: GridAreaPorts): ProbeArea | null {
19
+ const cell = ports.cells.find(row => row.instance === ports.current);
20
+ if (cell === undefined) return null;
21
+ return { slug: cell.slug, instance: cell.instance, targets: ports.targets(cell.instance), flags: [...new Set(ports.flags(cell.instance))].sort() };
22
+ }
23
+
24
+ /** A one-shard page's area: its shard, the targets its shardfile client exposes (debug `shardfile`), and its flags. */
25
+ export function shardArea(slug: string, exposed: unknown, flags: readonly string[]): ProbeArea {
26
+ return { slug, instance: null, targets: exposedTargets(exposed), flags: [...new Set(flags)].sort() };
27
+ }
28
+
29
+ function isTarget(value: unknown): value is ProbeAreaTarget {
30
+ return typeof value === 'object' && value !== null && 'panel' in value && typeof value.panel === 'string'
31
+ && 'visible' in value && typeof value.visible === 'boolean' && 'solid' in value && typeof value.solid === 'boolean';
32
+ }
33
+
34
+ function exposedTargets(exposed: unknown): readonly ProbeAreaTarget[] {
35
+ if (typeof exposed !== 'object' || exposed === null || !('targets' in exposed) || typeof exposed.targets !== 'function') return [];
36
+ const rows: unknown = Reflect.apply(exposed.targets, exposed, []);
37
+ return Array.isArray(rows) ? rows.filter(isTarget).map(row => ({ panel: row.panel, visible: row.visible, solid: row.solid })) : [];
38
+ }
@@ -49,6 +49,9 @@ export function cellLoadingStep(input: CellLoadingInput): CellLoadingStep {
49
49
  }
50
50
  const hooksDone = (last: string): boolean => !input.hybrid || input.hooks.has(last);
51
51
  if (!input.product) return { kind: 'step', key: 'world', detail: input.requested ? 'reading its region files' : 'requested as you approach' };
52
+ // QA 11-13 row 43: a resident product but no readiness request is a world nobody is building yet; its hooks are a past
53
+ // visit's, not progress (a return visit read "saved state and its systems" for 11 s while nothing built it)
54
+ if (!input.requested) return { kind: 'step', key: 'world', detail: 'waiting for its world to start' };
52
55
  const running = input.hook === null ? '' : ` · ${input.hook}`;
53
56
  if (!hooksDone('afterWorld')) return { kind: 'step', key: 'world', detail: `${input.claimedMB.toFixed(0)} MB admitted${running}` };
54
57
  if (!hooksDone('afterKit')) return { kind: 'step', key: 'loadout', detail: `weapons, held items and HUD${running}` };
@@ -71,6 +74,8 @@ export class CellLoading {
71
74
  /** the step shown: a running hook's own step, else the furthest reached (a region learns it has hooks only when they
72
75
  * start, so between hooks a row never goes back) */
73
76
  private reached = -1;
77
+ /** GC8: the step the screen shows now and its detail, for a harness to time each step (null while closed). */
78
+ private shown: { readonly step: string; readonly detail: string } | null = null;
74
79
  /** `known`: whether the waiting cell is one of this session's neighbours (no screen for one that is not) */
75
80
  constructor(private readonly screen: CellLoadingScreen, private readonly known: (instance: string) => boolean) {}
76
81
  /** Show, step or hide the screen from this cell's live state (null: no cell is waiting). */
@@ -87,14 +92,19 @@ export class CellLoading {
87
92
  }
88
93
  const rows = path.map((row, i): CellLoadingRow => ({ label: row.label, state: i < this.reached ? 'done' : i === this.reached ? 'now' : 'next' }));
89
94
  const detail = step.kind === 'step' ? step.detail : '';
90
- this.screen.show({ instance: input.instance, name: input.name, step: path[Math.max(0, this.reached)]?.key ?? '', rows, detail,
95
+ this.shown = { step: path[Math.max(0, this.reached)]?.key ?? '', detail };
96
+ this.screen.show({ instance: input.instance, name: input.name, step: this.shown.step, rows, detail,
91
97
  failed: step.kind === 'failed' ? step.reason : null });
92
98
  }
93
99
  /** The screen's cell (null: none shown). */
94
100
  get open(): string | null { return this.instance; }
101
+ /** NET-LAG NL7: the row the screen shows running now (its label), null when none is shown: a proof times each stage. */
102
+ get stage(): string | null { return this.instance === null || this.reached < 0 ? null : loadingPath('cell').steps[this.reached]?.label ?? null; }
103
+ /** GC8: the step shown now and its detail, or null. */
104
+ get now(): { readonly step: string; readonly detail: string } | null { return this.instance === null ? null : this.shown; }
95
105
  /** Hide the screen: `entered`, the cell is ready (the card completes and fades); else it was left or cancelled. */
96
106
  close(entered = false): void {
97
- const was = this.instance; this.instance = null; this.reached = -1;
107
+ const was = this.instance; this.instance = null; this.reached = -1; this.shown = null;
98
108
  if (was !== null) this.screen.hide(entered);
99
109
  }
100
110
  }